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
We must make sure that Anki DB data have sufficient quality to begin with.
private static void verifyAnkiNotesIntegrity() throws ClassNotFoundException { List<AnkiNote> notesWithoutPron = new AnkiDatabase().getNotesWithoutPron(); for (AnkiNote note : notesWithoutPron) { String deutsch = note.getDeutsch(); String tags = note.getTags(); String articleError = "Note has flag %s, but does not start with %s: %s%n"; //Notes with tag Femininum must have german field starting with e or r/e if (tags.contains("Femininum") && !(deutsch.startsWith("e ") || deutsch.startsWith("r/e "))) { System.err.printf(articleError, "Femininum", "e or r/e", note); } //Notes with tag Maskulinum must start with r or r/e or r/s if (tags.contains("Maskulinum") && !(deutsch.startsWith("r ") || deutsch.startsWith("r/e ") || deutsch.startsWith("r/s "))) { System.err.printf(articleError, "Maskulinum", "r or r/e", note); } //Notes with tag Neutrum must start with s or (s) if (tags.contains("Neutrum") && !(deutsch.startsWith("s ") || deutsch.startsWith("(s) ") || deutsch.startsWith("r/s "))) { System.err.printf(articleError, "Neutrum", "s or (s)", note); } //No nbsp; in notes! if (note.getFlds().contains("nbsp;")) { System.err.printf("Note contains nbsp; :%s%n", note); } //No special characters in words! String word = note.getWord(); if (word != null && (word.contains("<") || word.contains(" ") || word.contains(">") || word.contains("­"))) { System.err.printf("Note contains one of characters <, ,>,-: %s%n", note); } //When note has Maskulinum, Femininum or Neutrum, then it must have wort if ((tags.contains("Maskulinum") || tags.contains("Femininum") || tags.contains("Neutrum")) && !tags.contains("wort")) { System.err.printf("Note has Maskulinu, Femininum or Neutrum, but doesn't have wort: %s%n", note); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tvoid checkConsistency()\n\t{\n\t\t\n\t}", "@Test(timeout = 4000)\n public void test68() throws Throwable {\n PipedReader pipedReader0 = new PipedReader();\n StreamTokenizer streamTokenizer0 = new StreamTokenizer(pipedReader0);\n streamTokenizer0.nval = 713.6331870209585;\n SQLUtil.renderNumber(streamTokenizer0);\n SQLUtil.normalize(\"lhXRl\", true);\n Random.setNextRandom((-4));\n String string0 = null;\n DBSchema dBSchema0 = new DBSchema((String) null);\n SQLUtil.typeAndName(dBSchema0);\n String string1 = \"%~-1t&Ncqx{&'OP~@\";\n TableContainer tableContainer0 = new TableContainer(\"^jnE\");\n tableContainer0.getSchema();\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"%~-1t&Ncqx{&'OP~@\", (DBSchema) null);\n String[] stringArray0 = new String[2];\n stringArray0[0] = null;\n stringArray0[1] = \"713.6331870209585\";\n DBPrimaryKeyConstraint dBPrimaryKeyConstraint0 = new DBPrimaryKeyConstraint(defaultDBTable0, (String) null, true, stringArray0);\n defaultDBTable0.setPrimaryKey(dBPrimaryKeyConstraint0);\n SQLUtil.typeAndName(dBPrimaryKeyConstraint0);\n // Undeclared exception!\n try { \n DBDataType.getInstance((-1717986917), (String) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.model.DBDataType\", e);\n }\n }", "private void verifyStatistics()\n throws SQLException {\n IndexStatsUtil stats = new IndexStatsUtil(getConnection(), 5000);\n IdxStats[] myStats = stats.getStatsTable(TAB, 2);\n for (int i=0; i < myStats.length; i++) {\n IdxStats s = myStats[i];\n assertEquals(_100K, s.rows);\n switch (s.lcols) {\n case 1:\n assertEquals(10, s.card);\n break;\n case 2:\n assertEquals(_100K, s.card);\n break;\n default:\n fail(\"unexpected number of leading columns: \" + s.lcols);\n }\n }\n }", "final void checkEnsure() {\r\n\t\t\r\n\t\ttry {\r\n\t\t\tif (this.conn == null || this.conn.isClosed()) {\r\n\t\t\t\tthis.conn = this.ci.createConnection();\r\n\t\t\t\tthis.databaseType = ConnectionHolder.DT_UNKNOWN;\r\n\t\t\t\tthis.loops = this.ci.connectionMaxLoops();\r\n\t\t\t\tthis.date = System.currentTimeMillis() + this.ci.connectionTimeToLive();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (--this.loops < 0 || this.date < System.currentTimeMillis()) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.conn.close();\r\n\t\t\t\t} catch (final Throwable t) {\r\n\t\t\t\t\t// ignore\r\n\t\t\t\t}\r\n\t\t\t\tthis.conn = this.ci.createConnection();\r\n\t\t\t\tthis.databaseType = ConnectionHolder.DT_UNKNOWN;\r\n\t\t\t\tthis.loops = this.ci.connectionMaxLoops();\r\n\t\t\t\tthis.date = System.currentTimeMillis() + this.ci.connectionTimeToLive();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (this.databaseType == ConnectionHolder.DT_UNKNOWN) {\r\n\t\t\t\tthis.databaseType = this.conn.getMetaData().getDatabaseProductName().toUpperCase().indexOf(\"ORACLE\") == -1\r\n\t\t\t\t\t? ConnectionHolder.DT_NORMAL\r\n\t\t\t\t\t: ConnectionHolder.DT_ORACLE;\r\n\t\t\t}\r\n\t\t\ttry (final Statement st = this.conn.createStatement()) {\r\n\t\t\t\t/** Do not use it here, may be unsupported? */\r\n\t\t\t\ttry {\r\n\t\t\t\t\tst.setQueryTimeout(10);\r\n\t\t\t\t} catch (final Throwable t) {\r\n\t\t\t\t\t// ignore\r\n\t\t\t\t}\r\n\t\t\t\tst.execute(\r\n\t\t\t\t\t\tthis.databaseType == ConnectionHolder.DT_ORACLE\r\n\t\t\t\t\t\t\t? \"SELECT 5 FROM DUAL\"\r\n\t\t\t\t\t\t\t: \"SELECT 5\");\r\n\t\t\t}\r\n\t\t} catch (final SQLException e) {\r\n\t\t\tif (this.conn != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.conn.close();\r\n\t\t\t\t} catch (final Throwable t) {\r\n\t\t\t\t\t// ignore\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.conn = this.ci.createConnection();\r\n\t\t\tthis.databaseType = ConnectionHolder.DT_UNKNOWN;\r\n\t\t\tthis.loops = this.ci.connectionMaxLoops();\r\n\t\t\tthis.date = System.currentTimeMillis() + this.ci.connectionTimeToLive();\r\n\t\t}\r\n\t}", "private void performSanityCheck()\n\t{\n\t\tif (variableNames != null && domainSizes != null\n\t\t\t\t&& propositionNames != null)\n\t\t{\n\t\t\tcheckStateSizes();\n\t\t\tcheckDomainSizes();\n\t\t}\n\t}", "@Override\n\tprotected boolean checkDataStructure(Data data) throws ImportitException {\n\t\tdata.setDatabase(39);\n\t\tdata.setGroup(3);\n\t\tboolean validDb = checkDatabaseName(data);\n\t\tboolean validHead = false;\n\t\tboolean validTable = false;\n\t\tboolean existImportantFields = false;\n\t\tif (validDb) {\n\t\t\tList<Field> headerFields = data.getHeaderFields();\n\t\t\tList<Field> tableFields = data.getTableFields();\n\t\t\tvalidHead = false;\n\t\t\tvalidTable = false;\n\t\t\ttry {\n\n\t\t\t\tvalidHead = checkWarehouseGroupProperties(headerFields, data.getOptionCode().useEnglishVariables());\n\t\t\t\tvalidTable = checkFieldList(tableFields, 39, 3, false, data.getOptionCode().useEnglishVariables());\n\t\t\t\tString[] checkDataCustomerPartProperties = checkDataWarehouseGroupProperties(data);\n\t\t\t\texistImportantFields = checkDataCustomerPartProperties.length == 2;\n\n\t\t\t} catch (ImportitException e) {\n\t\t\t\tlogger.error(e);\n\t\t\t\tdata.appendError(Util.getMessage(\"err.structure.check\", e.getMessage()));\n\t\t\t}\n\t\t}\n\t\tif (validTable && validHead && validDb & existImportantFields) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private void populateDataAndVerify(ReplicatedEnvironment masterEnv) {\n createTestData();\n populateDB(masterEnv, dbName, keys);\n readDB(masterEnv, dbName, startKey, numKeys);\n logger.info(numKeys + \" records (start key: \" +\n startKey + \") have been populated into db \" +\n dbName + \" and verified\");\n }", "private void checkDatabaseStructure(DatabaseUpdateType update) {\n }", "private void validateInternalTable(ConnectorTableMetadata meta)\n {\n String table = AccumuloTable.getFullTableName(meta.getTable());\n String indexTable = Indexer.getIndexTableName(meta.getTable());\n String metricsTable = Indexer.getMetricsTableName(meta.getTable());\n\n if (conn.tableOperations().exists(table)) {\n throw new PrestoException(ACCUMULO_TABLE_EXISTS,\n \"Cannot create internal table when an Accumulo table already exists\");\n }\n\n if (AccumuloTableProperties.getIndexColumns(meta.getProperties()).size() > 0) {\n if (conn.tableOperations().exists(indexTable) || conn.tableOperations().exists(metricsTable)) {\n throw new PrestoException(ACCUMULO_TABLE_EXISTS,\n \"Internal table is indexed, but the index table and/or index metrics table(s) already exist\");\n }\n }\n }", "@Override\n\tpublic boolean checkData() {\n\t\treturn false;\n\t}", "@Test(timeout = 4000)\n public void test46() throws Throwable {\n PipedWriter pipedWriter0 = new PipedWriter();\n PipedReader pipedReader0 = new PipedReader();\n Boolean boolean0 = Boolean.FALSE;\n SQLUtil.isQuery(\"selectntowrong c|ck\");\n Boolean.valueOf(true);\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"selectntowrong c|ck\");\n // Undeclared exception!\n try { \n defaultDBTable0.getUniqueConstraint(\"^h=wZ>:9%}Pj6(#%M\");\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.model.DefaultDBTable\", e);\n }\n }", "private void m14054e() {\n SQLiteDatabase openOrCreateDatabase;\n SQLiteDatabase sQLiteDatabase = null;\n boolean z = true;\n try {\n openOrCreateDatabase = SQLiteDatabase.openOrCreateDatabase(f18052m, null);\n } catch (Exception e) {\n openOrCreateDatabase = sQLiteDatabase;\n }\n if (openOrCreateDatabase != null) {\n try {\n long queryNumEntries = DatabaseUtils.queryNumEntries(openOrCreateDatabase, \"wof\");\n long queryNumEntries2 = DatabaseUtils.queryNumEntries(openOrCreateDatabase, \"bdcltb09\");\n boolean z2 = queryNumEntries > BNOffScreenParams.MIN_ENTER_INTERVAL;\n if (queryNumEntries2 <= BNOffScreenParams.MIN_ENTER_INTERVAL) {\n z = false;\n }\n openOrCreateDatabase.close();\n if (z2 || z) {\n new C3333a().execute(new Boolean[]{Boolean.valueOf(z2), Boolean.valueOf(z)});\n }\n } catch (Exception e2) {\n }\n }\n }", "protected boolean checkBioScarso() {\n return bioService.count() < BIO_NEEDED_MINUMUM_SIZE;\n }", "public void sanityCheck() {\n if ( bucket >= mNumBins ) bucket = mNumBins - 1;\n\n // Sanity check, should not happen.\n if ( bucket < 0 ) bucket = 0;\n }", "@Test(timeout = 4000)\n public void test018() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.prepareStatement((Connection) null, \"Expected exactly one row, found more.\", true);\n fail(\"Expecting exception: IllegalStateException\");\n \n } catch(IllegalStateException e) {\n //\n // Tried to mutate a database with read-only settings: Expected exactly one row, found more.\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test018() throws Throwable {\n DBSchema dBSchema0 = new DBSchema(\"create table\");\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"_2W8l71V=lzq~*\", dBSchema0);\n String[] stringArray0 = new String[8];\n Object[] objectArray0 = new Object[6];\n // Undeclared exception!\n try { \n SQLUtil.renderQuery(defaultDBTable0, stringArray0, objectArray0);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // 6\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Override\n\t\tpublic void checkPreconditions() {\n\t\t}", "private void ensureCapacity() {\n if(size() >= (0.75 * data.length)) // size() == curSize\n resize(2 * size());\n }", "public boolean checkDbStructure(){\n\t\tboolean isStructureOk = false;\n\t\t\n\t\ttry {\n\t\t\tmMysqlConnection = DriverManager\n\t\t\t\t.getConnection(getConnectionURI());\n\t\t\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Name, Description, Version from \" + mDbName + \".\" + TABLE_AREA);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\t\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select Area_ID, Route_ID from \" + mDbName + \".\" + TABLE_AREA_HAS_ROUTES);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Ticket_ID, Name, StartName, EndName from \" + mDbName + \".\" + TABLE_ROUTE);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select Route_ID, Station_ID, Position from \" + mDbName + \".\" + TABLE_ROUTE_HAS_STATIONS);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Name, Abbreviation, Latitude, Longitude from \" + mDbName + \".\" + TABLE_STATION);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\n\t\t\tmPreparedStatement = mMysqlConnection\n\t\t\t\t.prepareStatement(\"select ID, Name, Icon, Is_Superior from \" + mDbName + \".\" + TABLE_TICKET);\t\t\t\n\t\t\tmPreparedStatement.executeQuery();\n\t\t\t\n\t\t\tisStructureOk = true;\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\tLOGGER.severe(\"!EXCEPTION: \" + e.getMessage());\n\t\t\tisStructureOk = false;\n\t\t}\n\t\t\n\t\treturn isStructureOk;\n\t}", "private void validCheck ()\n\t{\n\t\tassert allButLast != null || cachedFlatListOrMore != null;\n\t}", "private void checkStructure() {\n for (DatabaseUpdateType updateType : DatabaseUpdateType.values()) {\n checkDatabaseStructure(updateType);\n }\n }", "@Test(timeout = 4000)\n public void test017() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.prepareStatement((Connection) null, \"EJ1m8=\", true, (-91830697), 2478, (int) (byte)26);\n fail(\"Expecting exception: IllegalStateException\");\n \n } catch(IllegalStateException e) {\n //\n // Tried to mutate a database with read-only settings: EJ1m8=\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "public void check() {\r\n logger.info(\"ADIT monitor - Checking database and application.\");\r\n\r\n checkApplication();\r\n\r\n checkDBConnection();\r\n checkDBRead(this.getMonitorConfiguration().getTestDocumentId());\r\n }", "private void validateCreateTable(ConnectorTableMetadata meta)\n {\n validateColumns(meta);\n validateLocalityGroups(meta);\n if (!AccumuloTableProperties.isExternal(meta.getProperties())) {\n validateInternalTable(meta);\n }\n }", "@Test\n public void test006_test_capcaity() {\n try {\n HashTableADT test = new HashTable<Integer, String>(2, 0.5);\n test.insert(1, \"2\");\n test.insert(2, \"3\");\n if (test.getCapacity() != 5) { //capacity should be 2* original + 1\n fail(\"resize not correct\");\n }\n } catch (Exception e) {\n fail(\"Correct Exception wasn't thrown\");\n }\n }", "private void verificaData() {\n\t\t\n\t}", "private void checkInitialization()\n {\n if (!initialized)\n throw new SecurityException(\"ArrayQueue object is corrupt.\");\n }", "@Test(timeout = 4000)\n public void test018() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n String[] stringArray0 = new String[5];\n Object[] objectArray0 = new Object[3];\n // Undeclared exception!\n try { \n SQLUtil.renderQuery(defaultDBTable0, stringArray0, objectArray0);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // 3\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "private void ensureCapacity() {\r\n\t\t\tdouble loadFactor = getLoadFactor();\r\n\r\n\t\t\tif (loadFactor >= CAPACITY_THRESHOLD)\r\n\t\t\t\trehash();\r\n\t\t}", "@Test(timeout = 4000)\n public void test056() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n String[] stringArray0 = new String[4];\n DBUniqueConstraint dBUniqueConstraint0 = new DBUniqueConstraint(defaultDBTable0, \"org.databene.commons.condition.CompositeCondition\", true, stringArray0);\n // Undeclared exception!\n try { \n DBUtil.containsMandatoryColumn(dBUniqueConstraint0);\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Column 'null' not found in table 'null'\n //\n verifyException(\"org.databene.jdbacl.model.DefaultDBTable\", e);\n }\n }", "abstract void initializeNeededData();", "private void validateData() {\n }", "public boolean isDBValid(){\r\n return noInduk != null && !noInduk.isEmpty();\r\n }", "@Test(timeout = 4000)\n public void test48() throws Throwable {\n PipedWriter pipedWriter0 = new PipedWriter();\n PipedReader pipedReader0 = new PipedReader(pipedWriter0);\n StreamTokenizer streamTokenizer0 = new StreamTokenizer(pipedReader0);\n SQLUtil.renderNumber(streamTokenizer0);\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n DBCheckConstraint dBCheckConstraint0 = new DBCheckConstraint((String) null, true, defaultDBTable0, \"- 0\");\n StringBuilder stringBuilder0 = new StringBuilder();\n stringBuilder0.append((-2812.6353F));\n SQLUtil.appendConstraintName((DBConstraint) dBCheckConstraint0, stringBuilder0);\n assertEquals(\"-2812.6353\", stringBuilder0.toString());\n }", "public void optimiseForDb() {\n \tif (CollectionUtils.isNotEmpty(this.allocation)) {\n\t \tList<Allocation> alloc = Lists.newArrayList(this.allocation)\n\t \t\t\t.stream()\n\t \t\t\t.filter(a -> a.account != null && a.getPercentage() != 0.0)\n\t \t\t\t.collect(Collectors.toList());\n\t \tif (alloc.size() != this.allocation.size()) {\n\t \t\tLOG.info(\"{} optimised\", this); //$NON-NLS-1$\n\t \t\tthis.allocation.clear();\n\t \t\tthis.allocation.addAll(alloc);\n\t \t}\n\t \tif (CollectionUtils.isEmpty(alloc)) {\n\t \t\tLOG.info(\"{} empty, cleared\", this); //$NON-NLS-1$\n\t \t\t// de-allocate any empty list. They are a waste of space in the database\n\t \t\tthis.allocation = null;\n\t \t}\n \t} else {\n \t\t// de-allocate any empty list. They are a waste of space in the database\n \t\tthis.allocation = null;\n \t}\n }", "@Test(timeout = 4000)\n public void test104() throws Throwable {\n try { \n DBUtil.getMetaData((Connection) null, \"!f7d,\", (String) null, false, true, false, true, (String) null, true);\n fail(\"Expecting exception: Exception\");\n \n } catch(Exception e) {\n //\n // Connecting null failed: \n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "public final void validateRetrieveInputs() throws Exception {\n if (getDBTable() == null) throw new Exception(\"getDBTable missing\");\n if (getColumnForPrimaryKey() == null) throw new Exception(\"WHERE ID missing\");\n }", "@Test(timeout = 4000)\n public void test063() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.checkReadOnly(\"derby.version.beta\", true);\n fail(\"Expecting exception: IllegalStateException\");\n \n } catch(IllegalStateException e) {\n //\n // Tried to mutate a database with read-only settings: derby.version.beta\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test109() throws Throwable {\n Boolean boolean0 = SQLUtil.mutatesDataOrStructure(\" SELECT * FROM \");\n assertFalse(boolean0);\n assertNotNull(boolean0);\n }", "protected boolean checkCompatibility() {\n IDatabaseAdapter adapter = getDbAdapter(dbType, connectionPool);\n try (ITransaction tx = TransactionFactory.openTransaction(connectionPool)) {\n return adapter.checkCompatibility(this.adminSchemaName);\n }\n }", "@Test\n public void shouldCreateEpiDataGathering() {\n assertThat(DatabaseHelper.getEpiDataGatheringDao().queryForAll().size(), is(0));\n\n Case caze = TestEntityCreator.createCase();\n TestEntityCreator.createEpiDataGathering(caze);\n\n // Assure that the burial has been successfully created\n assertThat(DatabaseHelper.getEpiDataGatheringDao().queryForAll().size(), is(1));\n }", "@Test\n public void missingHighScoresTest() {\n database.createHighScoreTable(testTable);\n database.addHighScore(110, testTable);\n database.addHighScore(140, testTable);\n int[] scores = database.loadHighScores(testTable);\n assertEquals(0, scores[4]);\n assertEquals(0, scores[3]);\n assertEquals(0, scores[2]);\n assertEquals(110, scores[1]);\n assertEquals(140, scores[0]);\n database.clearTable(testTable);\n\n }", "private void checkDataBase() {\n final Config dbConfig = config.getConfig(\"db\");\n\n checkArgument(!isNullOrEmpty(dbConfig.getString(\"driver\")), \"db.driver is not set!\");\n checkArgument(!isNullOrEmpty(dbConfig.getString(\"url\")), \"db.url is not set!\");\n\n dbConfig.getString(\"user\");\n dbConfig.getString(\"password\");\n dbConfig.getObject(\"additional\");\n }", "private void validator() throws Exception {\n if (getDBTable() == null) throw new Exception(\"getDBTable missing\");\n if (getColumnsString() == null) throw new Exception(\"getColumnsString missing\");\n if (getColumnsType() == null || getColumnsType().size() <= 0) throw new Exception(\"getColumnsType missing\");\n if (getDuplicateUpdateColumnString() == null) {\n if (getColumnsString().split(\",\").length != getColumnsType().size())\n throw new Exception(\"mismatch for type and columns\");\n\n } else {\n if (getColumnsString().split(\",\").length +\n getDuplicateUpdateColumnString().split(\",\").length != getColumnsType().size())\n throw new Exception(\"mismatch for type and columns\");\n }\n }", "protected void checkSize(){\n if (size == data.length){\n resize( 2 * data.length);\n }\n }", "@Test(timeout = 4000)\n public void test122() throws Throwable {\n String[] stringArray0 = new String[5];\n DBSchema dBSchema0 = new DBSchema(\"\");\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"k4#~A6 _d6{6v)5_\", dBSchema0);\n DBColumn[] dBColumnArray0 = new DBColumn[4];\n // Undeclared exception!\n try { \n SQLUtil.renderQuery(defaultDBTable0, stringArray0, dBColumnArray0);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // 4\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "public boolean initializeDatabase() {\n try {\n initializeCategory();\n initializeExpense();\n initializeIncome();\n initializeBalance();\n initializeUser();\n } catch (Throwable t) {\n\n System.out.println(t.getMessage());\n return false;\n }\n return true;\n }", "@Test(timeout = 4000)\n public void test037() throws Throwable {\n DBUtil.checkReadOnly(\"SELECT pronae,oid FROM pg_roc WHEE \", false);\n }", "public void sanityCheck() {\n\t\tif (DEBUG) {\n\t\t\tint curMaxColumnHeight = 0;\n\t\t\tint [] curWidths = new int [height];\n\t\t\tint [] curHeights = new int [width];\n\n\t\t\tfor(int i = 0; i < width; i++){\n\t\t\t\tfor(int j =0; j < height; j++){\n\t\t\t\t\tif(grid[i][j]){\n\t\t\t\t\t\tcurWidths[j]++;\n\t\t\t\t\t\tif(curHeights[i]<=j){\n\t\t\t\t\t\t\tcurHeights[i] = j + 1;\n\t\t\t\t\t\t\tif(curHeights[i] > curMaxColumnHeight){\n\t\t\t\t\t\t\t\tcurMaxColumnHeight = curHeights[i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!Arrays.equals(curWidths,widths)){\n\t\t\t\tthrow new RuntimeException(\"Incorrect width array\");\n\t\t\t}\n\t\t\tif(!Arrays.equals(curHeights,heights)){\n\t\t\t\tthrow new RuntimeException(\"Incorrect height array\");\n\t\t\t}\n\t\t\tif(curMaxColumnHeight != maxColumnHeight){\n\t\t\t\tSystem.out.println(curMaxColumnHeight+ \" \"+maxColumnHeight);\n\t\t\t\tthrow new RuntimeException(\"Incorrect maxColumnHeight\");\n\t\t\t}\n\t\t}\n\t}", "@Test(timeout = 4000)\n public void test71() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n FileSystemHandling.shouldThrowIOException((EvoSuiteFile) null);\n TableContainer tableContainer0 = new TableContainer(\"-KwE,kZ\");\n DefaultDBTable defaultDBTable1 = new DefaultDBTable();\n DBDataType.getInstance((-1717986917), \"%~-1t&Ncqx{&'OP~@\");\n tableContainer0.getSchema();\n Integer integer0 = RawTransaction.SAVEPOINT_ROLLBACK;\n Integer integer1 = RawTransaction.LOCK_ESCALATE;\n SQLUtil.removeComments(\"/**/\");\n System.setCurrentTimeMillis(1722L);\n // Undeclared exception!\n try { \n SQLUtil.normalize((String) null, false);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"java.io.StringReader\", e);\n }\n }", "@Test(timeout = 4000)\n public void test059() throws Throwable {\n DBUtil.assertAllDbResourcesClosed(false);\n DBCatalog dBCatalog0 = new DBCatalog();\n // Undeclared exception!\n try { \n dBCatalog0.getTable(\"uJr'z\");\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Table 'uJr'z'\n //\n verifyException(\"org.databene.jdbacl.model.DBCatalog\", e);\n }\n }", "@Test(timeout = 4000)\n public void test057() throws Throwable {\n DBSchema dBSchema0 = new DBSchema(\"Er\");\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"Er\", dBSchema0);\n String[] stringArray0 = new String[0];\n DBUniqueConstraint dBUniqueConstraint0 = new DBUniqueConstraint(defaultDBTable0, \"e/ \", false, stringArray0);\n boolean boolean0 = DBUtil.containsMandatoryColumn(dBUniqueConstraint0);\n assertFalse(boolean0);\n }", "private void getDataFromDB() {\n ArrayList<ArtworkData> artworkData = getArtworksFromDatabase();\n if (artworkData.size() <= 0) {\n // there is no data in local DB, error\n onErrorReceived();\n } else {\n sendArtworkData(artworkData);\n }\n }", "@Test(timeout = 4000)\n public void test34() throws Throwable {\n Discretize discretize0 = new Discretize();\n Properties properties0 = new Properties();\n ProtectedProperties protectedProperties0 = new ProtectedProperties(properties0);\n ProtectedProperties protectedProperties1 = new ProtectedProperties(protectedProperties0);\n Attribute attribute0 = new Attribute(\"-\", \"-\", protectedProperties0);\n ArrayList<Attribute> arrayList0 = new ArrayList<Attribute>();\n arrayList0.add(attribute0);\n Instances instances0 = new Instances(\"relational\", arrayList0, 30);\n discretize0.setInputFormat(instances0);\n BinarySparseInstance binarySparseInstance0 = new BinarySparseInstance(2);\n // Undeclared exception!\n try { \n discretize0.input(binarySparseInstance0);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // Instance has no dataset assigned!!\n //\n verifyException(\"weka.core.RelationalLocator\", e);\n }\n }", "protected boolean check(CrawlDatum datum) {\n if (datum.getStatus() != expectedDbStatus)\n return false;\n return true;\n }", "@Test(timeout = 4000)\n public void test092() throws Throwable {\n Proxy proxy0 = (Proxy)DBUtil.wrapWithPooledConnection((Connection) null, false);\n // Undeclared exception!\n try { \n DBUtil.prepareStatement((Connection) proxy0, \"SELECT pronae,oid FROM pg_roc WHEE \", false);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test000() throws Throwable {\n try { \n DBUtil.getMetaData((Connection) null, \" i/1o\", \"l\", true, true, true, true, \" i/1o\", false);\n fail(\"Expecting exception: Exception\");\n \n } catch(Exception e) {\n //\n // Connecting null failed: \n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test118() throws Throwable {\n NameSpec nameSpec0 = NameSpec.IF_REPRODUCIBLE;\n // Undeclared exception!\n try { \n SQLUtil.pkSpec((DBPrimaryKeyConstraint) null, nameSpec0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test016() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.prepareStatement((Connection) null, \"EJ1mj8=\", false, 0, (int) (byte)38, (-91830680));\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "@Test\n\tpublic void emptyTRDbTest() {\n\t\tDBI dbi = TEST_ENVIRONMENT.getDbi();\n\t\tTradeRequestDao tradeRequestDao = dbi.onDemand(TradeRequestDao.class);\n\t\tint expected = 0;\n\t\tint actual = tradeRequestDao.getAll().size();\n\t\tAssert.assertEquals(\"User table should be empty to start\", expected, actual);\n\t}", "@Test(expected = TileDBError.class)\n public void testLoadingEncryptedArrayNoKeyErrors() throws Exception {\n Array.create(arrayURI, schemaCreate());\n new ArraySchema(new Context(), arrayURI).close();\n }", "private synchronized void validateData(Quote q) throws DataValidationException, InvalidDataException {\n\t\tif (q == null) throw new InvalidDataException(\"Quote cannot be null.\");\n\t\tif (q.getQuoteSide(BookSide.SELL).getPrice().lessOrEqual(q.getQuoteSide(BookSide.BUY).getPrice())) {\n\t\t\tthrow new DataValidationException(\"Sell price: \" + q.getQuoteSide(BookSide.SELL).getPrice() +\n\t\t\t\t\t\" cannot be less than or equal to the buy price: \" + q.getQuoteSide(BookSide.BUY).getPrice());\n\t\t}\n\t\tif (q.getQuoteSide(BookSide.BUY).getPrice().lessOrEqual(PriceFactory.makeLimitPrice(0)) || \n\t\t\t\tq.getQuoteSide(BookSide.SELL).getPrice().lessOrEqual(PriceFactory.makeLimitPrice(0))) {\n\t\t\tthrow new DataValidationException(\"The buy and sell prices cannot be less than or equal to 0. \"\n\t\t\t\t\t+ \"Your buy price: \" + q.getQuoteSide(BookSide.BUY).getPrice() \n\t\t\t\t\t+ \". Your sell price: \" + q.getQuoteSide(BookSide.SELL).getPrice());\n\t\t}\n\t\tif (q.getQuoteSide(BookSide.BUY).getOriginalVolume() <= 0 || \n\t\t\t\tq.getQuoteSide(BookSide.SELL).getOriginalVolume() <= 0) {\n\t\t\tthrow new DataValidationException(\"The original volume of the BUY or SELL side cannot be less than or equal to 0. \"\n\t\t\t\t\t+ \"Your BUY volume: \" + q.getQuoteSide(BookSide.BUY).getOriginalVolume()\n\t\t\t\t\t+ \". Your SELL volume: \" + q.getQuoteSide(BookSide.SELL).getOriginalVolume());\n\t\t}\n\t}", "public String checkKeyAndData() {\n int keyLength = keys.length;\n Grid2DByte weatherGrid = getWeatherGrid();\n byte[] b = weatherGrid.getBuffer().array();\n for (int i = 0; i < b.length; i++) {\n int index = 0xFF & b[i];\n if (index >= keyLength) {\n return \"Data Values Exceeded in Grid at coordinate: \"\n + (i % weatherGrid.getXdim()) + \",\"\n + (i / weatherGrid.getXdim()) + \" Value=\" + index\n + \" MinAllowed=0 MaxAllowed=\" + (keyLength - 1);\n }\n }\n return null;\n }", "private boolean inDatabase() {\r\n \t\treturn inDatabase(0, null);\r\n \t}", "public boolean needsAllocArrays() {\n return this.table == null;\n }", "private void validateSortedData() {\n Preconditions.checkArgument(\n indices.length == values.length,\n \"Indices size and values size should be the same.\");\n if (this.indices.length > 0) {\n Preconditions.checkArgument(\n this.indices[0] >= 0 && this.indices[this.indices.length - 1] < this.n,\n \"Index out of bound.\");\n }\n for (int i = 1; i < this.indices.length; i++) {\n Preconditions.checkArgument(\n this.indices[i] > this.indices[i - 1], \"Indices duplicated.\");\n }\n }", "private void checkInitialization()\n {\n if (!initialized)\n throw new SecurityException(\"ArrayBag object is not initialized \" +\n \"properly.\");\n }", "public void loadInitialData() {\n\t\t\texecuteTransaction(new Transaction<Boolean>() {\n\t\t\t\t@Override\n\t\t\t\tpublic Boolean execute(Connection conn) throws SQLException {\n\t\t\t\t\tList<Item> inventory;\n\t\t\t\t\tList<Location> locationList;\n\t\t\t\t\tList<User> userList;\n\t\t\t\t\tList<JointLocations> jointLocationsList;\n\t\t\t\t\t//List<Description> descriptionList; \n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\tinventory = InitialData.getInventory();\n\t\t\t\t\t\tlocationList = InitialData.getLocations(); \n\t\t\t\t\t\tuserList = InitialData.getUsers();\n\t\t\t\t\t\tjointLocationsList = InitialData.getJointLocations();\n\t\t\t\t\t\t//descriptionList = //InitialData.getDescriptions();\n\t\t\t\t\t\t\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tthrow new SQLException(\"Couldn't read initial data\", e);\n\t\t\t\t\t}\n\n\t\t\t\t\tPreparedStatement insertItem = null;\n\t\t\t\t\tPreparedStatement insertLocation = null; \n\t\t\t\t\tPreparedStatement insertUser = null;\n\t\t\t\t\tPreparedStatement insertJointLocations = null;\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// AD: populate locations first since location_id is foreign key in inventory table\n\t\t\t\t\t\tinsertLocation = conn.prepareStatement(\"insert into locations (description_short, description_long) values (?, ?)\" );\n\t\t\t\t\t\tfor (Location location : locationList)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinsertLocation.setString(1, location.getShortDescription());\n\t\t\t\t\t\t\tinsertLocation.setString(2, location.getLongDescription());\n\t\t\t\t\t\t\tinsertLocation.addBatch();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinsertLocation.executeBatch(); \n\t\t\t\t\t\t\n\t\t\t\t\t\tinsertJointLocations = conn.prepareStatement(\"insert into jointLocations (fk_location_id, location_north, location_south, location_east, location_west) values (?, ?, ?, ?, ?)\" );\n\t\t\t\t\t\tfor (JointLocations jointLocations: jointLocationsList)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinsertJointLocations.setInt(1, jointLocations.getLocationID());\n\t\t\t\t\t\t\tinsertJointLocations.setInt(2, jointLocations.getLocationNorth());\n\t\t\t\t\t\t\tinsertJointLocations.setInt(3, jointLocations.getLocationSouth());\n\t\t\t\t\t\t\tinsertJointLocations.setInt(4, jointLocations.getLocationEast());\n\t\t\t\t\t\t\tinsertJointLocations.setInt(5, jointLocations.getLocationWest());\n\t\t\t\t\t\t\tinsertJointLocations.addBatch();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinsertJointLocations.executeBatch();\n\t\t\t\t\t\t\n\t\t\t\t\t\tinsertItem = conn.prepareStatement(\"insert into inventory (location_id, item_name) values (?, ?)\");\n\t\t\t\t\t\tfor (Item item : inventory) \n\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t// Auto generate itemID\n\t\t\t\t\t\t\tinsertItem.setInt(1, item.getLocationID());\n\t\t\t\t\t\t\tinsertItem.setString(2, item.getName());\n\t\t\t\t\t\t\tinsertItem.addBatch();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinsertItem.executeBatch();\n\t\t\t\t\t\t\n\t\t\t\t\t\tinsertUser = conn.prepareStatement(\"insert into users (username, password) values (?, ?)\");\n\t\t\t\t\t\tfor(User user: userList) {\n\t\t\t\t\t\t\tinsertUser.setString(1, user.getUsername());\n\t\t\t\t\t\t\tinsertUser.setString(2, user.getPassword());\n\t\t\t\t\t\t\tinsertUser.addBatch();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinsertUser.executeBatch();\n\t\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.println(\"Tables populated\");\n\t\t\t\t\t\t\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tDBUtil.closeQuietly(insertLocation);\t\n\t\t\t\t\t\tDBUtil.closeQuietly(insertItem);\n\t\t\t\t\t\tDBUtil.closeQuietly(insertUser);\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t});\n\t\t}", "@Test(timeout = 4000)\n public void test26() throws Throwable {\n PipedWriter pipedWriter0 = new PipedWriter();\n PipedReader pipedReader0 = new PipedReader(pipedWriter0);\n StreamTokenizer streamTokenizer0 = new StreamTokenizer(pipedReader0);\n DBCatalog dBCatalog0 = new DBCatalog();\n SQLUtil.ownerDotComponent(dBCatalog0);\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n MockFileOutputStream mockFileOutputStream0 = new MockFileOutputStream(\"null\", true);\n // Undeclared exception!\n try { \n DBDataType.getInstance((String) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.model.DBDataType\", e);\n }\n }", "@Override\n public boolean verifyJobDatabase() {\n try (Connection conn = getConnection()) {\n } catch (Exception e) {\n LOG.error(\"Failed to verify connection to the Job Database. \", e);\n return false;\n }\n return true;\n }", "private void FetchingData() {\n\t\t try { \n\t\t\t \n\t \tmyDbhelper.onCreateDataBase();\n\t \t \t\n\t \t\n\t \t} catch (IOException ioe) {\n\t \n\t \t\tthrow new Error(\"Unable to create database\");\n\t \n\t \t} \n\t \ttry {\n\t \n\t \t\tmyDbhelper.openDataBase();\n\t \t\tmydb = myDbhelper.getWritableDatabase();\n\t\t\tSystem.out.println(\"executed\");\n\t \t\n\t \t}catch(SQLException sqle){\n\t \n\t \t\tthrow sqle;\n\t \n\t \t}\n\t}", "private void validate() {\n for (DBRow row : rows) {\n for (DBColumn column : columns) {\n Cell cell = Cell.at(row, column);\n DBValue value = values.get(cell);\n notNull(value,\"Cell \" + cell);\n }\n }\n }", "public boolean checkDataBase() {\n SQLiteDatabase sQLiteDatabase;\n try {\n SQLiteDatabase sQLiteDatabase2;\n sQLiteDatabase = sQLiteDatabase2 = SQLiteDatabase.openDatabase((String)(DB_PATH + DB_NAME), (SQLiteDatabase.CursorFactory)null, (int)0);\n }\n catch (SQLiteException var1_4) {\n return false;\n }\n if (sQLiteDatabase != null) {\n sQLiteDatabase.close();\n }\n boolean bl = false;\n if (sQLiteDatabase == null) return bl;\n return true;\n }", "@Test(timeout = 4000)\n public void test097() throws Throwable {\n String[] stringArray0 = new String[8];\n DBSchema dBSchema0 = new DBSchema(\"B?<P%cF\");\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"V\", dBSchema0);\n DBPrimaryKeyConstraint dBPrimaryKeyConstraint0 = new DBPrimaryKeyConstraint(defaultDBTable0, \" on \", true, stringArray0);\n NameSpec nameSpec0 = NameSpec.ALWAYS;\n String string0 = SQLUtil.pkSpec(dBPrimaryKeyConstraint0, nameSpec0);\n assertEquals(\"CONSTRAINT \\\" on \\\" PRIMARY KEY (, , , , , , , )\", string0);\n }", "@Test(timeout = 4000)\n public void test37() throws Throwable {\n String string0 = null;\n Character character0 = new Character('G');\n SQLUtil.renderValue(character0);\n String string1 = \"\";\n FileSystemHandling.createFolder((EvoSuiteFile) null);\n String string2 = \"7,;h@u(x3;.o)$2Y+\";\n DBCatalog dBCatalog0 = new DBCatalog(\"'G'\");\n String string3 = \"XSDAB.S\";\n // Undeclared exception!\n try { \n dBCatalog0.getTable(\"XSDAB.S\");\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Table 'XSDAB.S'\n //\n verifyException(\"org.databene.jdbacl.model.DBCatalog\", e);\n }\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic static void prepareQuery() throws InterruptedException, FileNotFoundException, IOException{\n\t\tint querySetSize=2;\n\t\tHashMap<Integer, Integer> totQ=(HashMap<Integer, Integer>) General.readObject(\"O:/ImageRetrieval/Herve1.5K/Herve_querys_L_to_L.hashMap\");\n\t\t\n\t\tString subQSetFolder=\"O:/ImageRetrieval/Herve1.5K/HerveQuerys_LtoL_perSubSet\"+querySetSize+\"/\";\n\t\tGeneral.makeORdelectFolder(subQSetFolder);\n\t\tRandom rand=new Random();\n\t\tArrayList<HashMap<Integer, Integer>> Qsets =General.randSplitHashMap(rand, totQ, 0, querySetSize);\n\t\tint totQnum=0;\n\t\tfor (int i = 0; i < Qsets.size(); i++) {\n\t\t\tGeneral.writeObject(subQSetFolder+\"Q\"+i+\".hashMap\", Qsets.get(i));\n\t\t\tSystem.out.println(i+\", \"+Qsets.get(i).size());\n\t\t\ttotQnum+=Qsets.get(i).size();\n\t\t}\n\t\tGeneral.Assert(totQnum==totQ.size(), \"err, totQnum:\"+totQnum+\", should ==\"+totQ.size());\n\t\tSystem.out.println(\"taget querySetSize:\"+querySetSize+\", totQnum:\"+totQnum+\", should ==\"+totQ.size());\n\t}", "protected void checkIsSet(Object data, String error)\r\n\t\t\tthrows InsufficientArticleDataException {\r\n\t\t\r\n\t\tif (data == null) {\r\n\t\t\tthrow new InsufficientArticleDataException(error);\r\n\t\t}\r\n\t}", "@Test(timeout = 4000)\n public void test062() throws Throwable {\n DBUtil.checkReadOnly(\"SELECT pronae,oid FROM pg_roc WHEE \", true);\n }", "@Test\n\tpublic void assertRowCountWithAPIDataSize() throws Exception\n\t{\n\t\ttry {\n\t\t\tint actualRowCount = dashboardPage.getActualRows().size();\n\t\t\tresponsePage = new APIResponsePageObject(driver);\n\t\t\tint expectedRowCount = responsePage.getRateDataFromAPI().size();\n\t\t\terrorMessage = \"The table row count doesnt match with api rate data count. Not all the currencies are fetched in the table from api\";\n\t\t\tAssert.assertEquals(actualRowCount, expectedRowCount, errorMessage);\n\t\t}\n\t\tcatch (Exception ex) {\n\t\t\tSystem.out.println(ex.getMessage());\n\t\t}\n\t\t\n\t}", "private boolean checkDataBase() {\r\n SQLiteDatabase checkDB = null;\r\n try {\r\n checkDB = SQLiteDatabase.openDatabase(\"/data/data/me.shubhamgoswami.adharshilasurvey/adharShila.db\", null,\r\n SQLiteDatabase.OPEN_READONLY);\r\n checkDB.close();\r\n } catch (SQLiteException e) {\r\n // database doesn't exist yet.\r\n }\r\n return checkDB != null;\r\n }", "@Test\n public void shouldCreateEpiDataBurial() {\n assertThat(DatabaseHelper.getEpiDataBurialDao().queryForAll().size(), is(0));\n\n Case caze = TestEntityCreator.createCase();\n TestEntityCreator.createEpiDataBurial(caze);\n\n // Assure that the burial has been successfully created\n assertThat(DatabaseHelper.getEpiDataBurialDao().queryForAll().size(), is(1));\n }", "void verifyMetaRowsAreUpdated(HConnection hConnection)\n throws IOException {\n List<Result> results = MetaTableAccessor.fullScan(hConnection);\n assertTrue(results.size() >= REGION_COUNT);\n\n for (Result result : results) {\n byte[] hriBytes = result.getValue(HConstants.CATALOG_FAMILY,\n HConstants.REGIONINFO_QUALIFIER);\n assertTrue(hriBytes != null && hriBytes.length > 0);\n assertTrue(MetaMigrationConvertingToPB.isMigrated(hriBytes));\n\n byte[] splitA = result.getValue(HConstants.CATALOG_FAMILY,\n HConstants.SPLITA_QUALIFIER);\n if (splitA != null && splitA.length > 0) {\n assertTrue(MetaMigrationConvertingToPB.isMigrated(splitA));\n }\n\n byte[] splitB = result.getValue(HConstants.CATALOG_FAMILY,\n HConstants.SPLITB_QUALIFIER);\n if (splitB != null && splitB.length > 0) {\n assertTrue(MetaMigrationConvertingToPB.isMigrated(splitB));\n }\n }\n }", "@Override\n\tpublic int dbsize() {\n\t\treturn 0;\n\t}", "@Override\n public void prepare() throws QueryException {\n md = new MemData(data);\n\n final Iterator<Item> d = docs.iterator();\n final Iterator<byte[]> n = names.iterator();\n final Iterator<byte[]> p = paths.iterator();\n\n while(d.hasNext()) {\n md.insert(md.meta.size, -1, docData(d.next(), n.next(), p.next()));\n }\n }", "@Before\n public void createAndFillTable() {\n try {\n DBhandler dBhandler = new DBhandler(h2DbConnection);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "@Test(timeout = 4000)\n public void test28() throws Throwable {\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n Attribute attribute0 = new Attribute((String) null, (String) null);\n LinkedList<Attribute> linkedList0 = new LinkedList<Attribute>();\n ArrayList<Attribute> arrayList0 = new ArrayList<Attribute>();\n arrayList0.add(attribute0);\n Instances instances0 = new Instances(\"date\", arrayList0, 0);\n Instances instances1 = new Instances((String) null, arrayList0, 1);\n attribute0.enumerateValues();\n double[] doubleArray0 = new double[18];\n SparseInstance sparseInstance0 = new SparseInstance(1, doubleArray0);\n Discretize discretize0 = new Discretize();\n discretize0.setInputFormat(instances0);\n discretize0.setInputFormat(instances1);\n discretize0.batchFinished();\n System.setCurrentTimeMillis(2);\n Filter.useFilter(instances0, discretize0);\n Locale.getISOLanguages();\n discretize0.input(sparseInstance0);\n discretize0.batchFinished();\n // Undeclared exception!\n try { \n discretize0.findNumBins(102);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // 102\n //\n verifyException(\"weka.filters.unsupervised.attribute.Discretize\", e);\n }\n }", "@Test(timeout = 4000)\n public void test048() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.addRequiredCondition((String) null, (StringBuilder) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test101() throws Throwable {\n // Undeclared exception!\n try { \n DBUtil.countRows(\"6vyv%@\\\":8OZvgeq:\", (Connection) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "public static void checkDataStatus() {\r\n\t\ttry {\r\n\t\t\tThread.sleep(2000);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\tif (DataHandler.currentDataFileName == null)\r\n\t\t\tDialogConfigureYear.noDatabaseMessage();\r\n\t}", "protected boolean isValidData() {\n return true;\n }", "@Test(timeout = 4000)\n public void test105() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n String[] stringArray0 = new String[9];\n DBUniqueConstraint dBUniqueConstraint0 = new DBUniqueConstraint(defaultDBTable0, \"Ron?<[u:{U\", false, stringArray0);\n // Undeclared exception!\n try { \n DBUtil.equivalent(dBUniqueConstraint0, (DBPrimaryKeyConstraint) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test036() throws Throwable {\n // Undeclared exception!\n SQLUtil.mutatesDataOrStructure(\"/*\");\n }", "@Test(timeout = 4000)\n public void test19() throws Throwable {\n PipedWriter pipedWriter0 = new PipedWriter();\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n String[] stringArray0 = new String[6];\n stringArray0[0] = \"wrong ch\";\n stringArray0[4] = \"wrong ch\";\n DBPrimaryKeyConstraint dBPrimaryKeyConstraint0 = new DBPrimaryKeyConstraint(defaultDBTable0, \"wrong ch\", false, stringArray0);\n NameSpec nameSpec0 = NameSpec.IF_REPRODUCIBLE;\n StringBuilder stringBuilder0 = SQLUtil.createConstraintSpecBuilder(dBPrimaryKeyConstraint0, nameSpec0);\n // Undeclared exception!\n try { \n stringBuilder0.insert(533, (CharSequence) \"wrong ch\");\n fail(\"Expecting exception: StringIndexOutOfBoundsException\");\n \n } catch(StringIndexOutOfBoundsException e) {\n //\n // String index out of range: 533\n //\n verifyException(\"java.lang.AbstractStringBuilder\", e);\n }\n }", "@Test(timeout = 4000)\n public void test021() throws Throwable {\n StringBuilder stringBuilder0 = new StringBuilder();\n // Undeclared exception!\n try { \n SQLUtil.renderColumnTypeWithSize((DBColumn) null, stringBuilder0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test021() throws Throwable {\n StringBuilder stringBuilder0 = new StringBuilder();\n // Undeclared exception!\n try { \n SQLUtil.renderColumnTypeWithSize((DBColumn) null, stringBuilder0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test\n public void testByteSizeTooBig() {\n ds.setMaxDocumentBytes(150);\n putD1();\n putD2();\n \n assertEquals(true, docExists(testStringNumber.STRING1));\n assertEquals(true, docExists(testStringNumber.STRING2));\n putD3();\n System.out.println(\"hey\");\n assertEquals(false, docExists(testStringNumber.STRING1));\n assertEquals(true, docExists(testStringNumber.STRING2));\n assertEquals(true, docExists(testStringNumber.STRING3));\n \n }", "@Test(timeout = 4000)\n public void test098() throws Throwable {\n NameSpec nameSpec0 = NameSpec.IF_REPRODUCIBLE;\n // Undeclared exception!\n try { \n SQLUtil.constraintSpec((DBConstraint) null, nameSpec0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "private void ensureHashingIndexExists() {\n DB metadataDB = client.getDB(\"cacheManagerMetadata\");\n if (!metadataDB.collectionExists(\"hashingIndex\")) {\n DBCollection hashingIndex = metadataDB.getCollection(\"hashingIndex\");\n hashingIndex.createIndex(new BasicDBObject(\"hashValue\", 1),\n new BasicDBObject(\"unique\", 1));\n }\n }", "public static void test()\n\t{\n\t Environment myDbEnvironment = null;\n\t Database myDatabase = null;\n\n\t /* OPENING DB */\n\n\t // Open Database Environment or if not, create one.\n\t EnvironmentConfig envConfig = new EnvironmentConfig();\n\t envConfig.setAllowCreate(true);\n\t myDbEnvironment = new Environment(new File(\"db/\"), envConfig);\n\n\t // Open Database or if not, create one.\n\t DatabaseConfig dbConfig = new DatabaseConfig();\n\t dbConfig.setAllowCreate(true);\n\t dbConfig.setSortedDuplicates(true);\n\t myDatabase = myDbEnvironment.openDatabase(null, \"schema\", dbConfig);\n\n\t Cursor cursor = null;\n\t /* GET <K,V > FROM DB */\n\t DatabaseEntry foundKey = new DatabaseEntry();\n\t DatabaseEntry foundData = new DatabaseEntry();\n\n\t cursor = myDatabase.openCursor(null, null);\n\t cursor.getFirst(foundKey, foundData, LockMode.DEFAULT);\n\n\t do {\n\t try {\n\t String keyString = new String(foundKey.getData(), \"UTF-8\");\n\t String dataString = new String(foundData.getData(), \"UTF-8\");\n\t System.out.println(\"<\" + keyString + \", \" + dataString + \">\");\n\t } catch (UnsupportedEncodingException e) {\n\t e.printStackTrace();\n\t }\n\t } while (cursor.getNext(foundKey, foundData, LockMode.DEFAULT) == OperationStatus.SUCCESS);\n\t if (cursor != null) cursor.close();\n\t System.out.println(\"-----\");\n\t \n\t if (myDatabase != null) myDatabase.close();\n\t if (myDbEnvironment != null) myDbEnvironment.close();\n\t}", "@Test(timeout = 4000)\n public void test59() throws Throwable {\n System.setCurrentTimeMillis((-27L));\n DBCatalog dBCatalog0 = new DBCatalog();\n DBSchema dBSchema0 = new DBSchema(\" Y*-X>Nz.q@~K^o8Z]v\", dBCatalog0);\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\" Y*-X>Nz.q@~K^o8Z]v\", dBSchema0);\n // Undeclared exception!\n try { \n SQLUtil.parseColumnTypeAndSize(\"getObjectImpl(int,Map)\");\n fail(\"Expecting exception: NumberFormatException\");\n \n } catch(NumberFormatException e) {\n //\n // For input string: \\\"int\\\"\n //\n verifyException(\"java.lang.NumberFormatException\", e);\n }\n }", "@Test\r\n\tpublic void driverRatioMuseumsWithStore() {\r\n\r\n\t\tfinal Object testingData[][] = {\r\n\r\n\t\t\t// testingData[i][0] -> usernamed of the logged Actor.\r\n\t\t\t// testingData[i][1] -> expected Exception.\r\n\r\n\t\t\t{\r\n\t\t\t\t// + 1) An administrator displays the statistics\r\n\t\t\t\t\"admin\", null\r\n\t\t\t}, {\r\n\t\t\t\t// - 2) An unauthenticated actor tries to display the statistics\r\n\t\t\t\tnull, IllegalArgumentException.class\r\n\t\t\t}, {\r\n\t\t\t\t// - 3) A visitor displays the statistics\r\n\t\t\t\t\"visitor1\", IllegalArgumentException.class\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfor (int i = 0; i < testingData.length; i++) {\r\n\r\n\t\t\tthis.startTransaction();\r\n\r\n\t\t\tthis.templateRatioMuseumsWithStore((String) testingData[i][0], (Class<?>) testingData[i][1]);\r\n\r\n\t\t\tthis.rollbackTransaction();\r\n\t\t\tthis.entityManager.clear();\r\n\t\t}\r\n\r\n\t}" ]
[ "0.588483", "0.5881999", "0.5836039", "0.5831953", "0.5699112", "0.5686732", "0.5680917", "0.5677198", "0.5615798", "0.55925155", "0.558875", "0.55533254", "0.5544379", "0.5518213", "0.5500044", "0.54983145", "0.54872435", "0.5472949", "0.54513764", "0.54389304", "0.54164684", "0.5408164", "0.53735113", "0.5363131", "0.5362018", "0.5349129", "0.5333074", "0.5328698", "0.53142345", "0.5299311", "0.52983487", "0.5296919", "0.52943563", "0.5290346", "0.5289859", "0.52782214", "0.5264697", "0.5261322", "0.5253968", "0.525045", "0.52474815", "0.5246001", "0.5244144", "0.5237204", "0.52339643", "0.52336216", "0.52331746", "0.52273136", "0.52258235", "0.52140677", "0.5210994", "0.52100205", "0.520413", "0.5202641", "0.52025867", "0.52025336", "0.5177223", "0.51765674", "0.5166688", "0.5161869", "0.5160771", "0.51603884", "0.51493126", "0.5144253", "0.51333827", "0.5130015", "0.512981", "0.51288944", "0.5128299", "0.5118929", "0.51143545", "0.51076406", "0.51070285", "0.51056933", "0.51033837", "0.5095931", "0.5095899", "0.50936466", "0.5090803", "0.5090772", "0.50889003", "0.5088763", "0.5085916", "0.5083132", "0.50793666", "0.5072561", "0.5069832", "0.5067979", "0.50672877", "0.5067125", "0.5061737", "0.50587356", "0.50555456", "0.5055216", "0.5055216", "0.50425583", "0.5042213", "0.5040346", "0.5035925", "0.50349486", "0.503314" ]
0.0
-1
Constructor for the class.
public MapDictionary(String dictionaryLocation) { try { Scanner dictionary = new Scanner(new FileReader(dictionaryLocation)); while(dictionary.hasNextLine()) { String word = dictionary.nextLine().toLowerCase(); if(PredictivePrototype.isValidWord(word)) addElement(word, PredictivePrototype.wordToSignature(word)); } dictionary.close(); } catch (FileNotFoundException e) { System.out.print("Dictionary not found."); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Constructor() {\r\n\t\t \r\n\t }", "public Constructor(){\n\t\t\n\t}", "public CyanSus() {\n\n }", "public PSRelation()\n {\n }", "public _355() {\n\n }", "private Instantiation(){}", "public Chick() {\n\t}", "public CSSTidier() {\n\t}", "public Pitonyak_09_02() {\r\n }", "public Trening() {\n }", "public Coche() {\n super();\n }", "public Phl() {\n }", "public Curso() {\r\n }", "public Tbdtokhaihq3() {\n super();\n }", "public Libro() {\r\n }", "public Orbiter() {\n }", "public Cohete() {\n\n\t}", "private TMCourse() {\n\t}", "public Lanceur() {\n\t}", "public Chauffeur() {\r\n\t}", "public Clade() {}", "public SgaexpedbultoImpl()\n {\n }", "public RngObject() {\n\t\t\n\t}", "public Odontologo() {\n }", "public Ov_Chipkaart() {\n\t\t\n\t}", "public Self__1() {\n }", "public SlanjePoruke() {\n }", "public Parameters() {\n\t}", "public ClassTemplate() {\n\t}", "public Tigre() {\r\n }", "public Pasien() {\r\n }", "public ExamMB() {\n }", "public Aanbieder() {\r\n\t\t}", "public Anschrift() {\r\n }", "public Excellon ()\n {}", "private Rekenhulp()\n\t{\n\t}", "public Demo() {\n\t\t\n\t}", "@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }", "public Zeffit()\n {\n // TODO: initialize instance variable(s)\n }", "public TRIP_Sensor () {\n super();\n }", "public Mitarbeit() {\r\n }", "public mapper3c() { super(); }", "public Soil()\n\t{\n\n\t}", "public Catelog() {\n super();\n }", "public Rol() {}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public JSFOla() {\n }", "public Goodsinfo() {\n super();\n }", "public DetArqueoRunt () {\r\n\r\n }", "public Carrera(){\n }", "public CMN() {\n\t}", "public Supercar() {\r\n\t\t\r\n\t}", "public Node(){\n\n\t\t}", "public Data() {\n \n }", "public Data() {\n }", "public Data() {\n }", "public PjxParser()\r\n {\r\n LOG.info(this + \" instantiated\");\r\n }", "public SubjectClass() {\n }", "public Cgg_jur_anticipo(){}", "public Classe() {\r\n }", "public Carrinho() {\n\t\tsuper();\n\t}", "public Resource() {\n }", "public Resource() {\n }", "public TTau() {}", "public Magazzino() {\r\n }", "public Livro() {\n\n\t}", "public HGDClient() {\n \n \t}", "public AirAndPollen() {\n\n\t}", "public Parser()\n {\n //nothing to do\n }", "public EnsembleLettre() {\n\t\t\n\t}", "private Node() {\n\n }", "public Achterbahn() {\n }", "public Purp() {\n }", "public AntrianPasien() {\r\n\r\n }", "public Genret() {\r\n }", "@Override public void init()\n\t\t{\n\t\t}", "private SingleObject()\r\n {\r\n }", "public Instance() {\n }", "public ChaCha()\n\t{\n\t\tsuper();\n\t}", "public Rook()\n {\n super();\n }", "public Reader(){\n\n\t}", "private ATCres() {\r\n // prevent to instantiate this class\r\n }", "public Tbdcongvan36() {\n super();\n }", "public OOP_207(){\n\n }", "public OVChipkaart() {\n\n }", "@Override\n\t\tpublic void init() {\n\t\t}", "public Generic(){\n\t\tthis(null);\n\t}", "public Sequence(){\n\n }", "public Event() {\r\n\r\n\t}", "public Boop() {\n\t\tsuper();\n\t}", "public Stat() {\n }", "public Requisition() {\n\n }", "public Component() {\n }", "public Corso() {\n\n }", "@Override\n public void init() {}", "public BaseParameters(){\r\n\t}", "public ContasCorrentes(){\n this(0,\"\",0.0,0.0,0);\n }", "public SensorData() {\n\n\t}", "public Book() {\n\t\t// Default constructor\n\t}", "protected Betaling()\r\n\t{\r\n\t\t\r\n\t}", "public SimOI() {\n super();\n }" ]
[ "0.84834844", "0.80363995", "0.7402332", "0.73984003", "0.7169051", "0.7097029", "0.7073533", "0.7069785", "0.70525056", "0.70207524", "0.7020108", "0.6995734", "0.6990981", "0.69893134", "0.6969099", "0.6965046", "0.696421", "0.6951068", "0.6946851", "0.69132704", "0.68860525", "0.68828857", "0.6879351", "0.6863541", "0.6849351", "0.68467003", "0.6843756", "0.6835958", "0.6814206", "0.6801247", "0.67999965", "0.67924136", "0.679119", "0.67893094", "0.67813194", "0.6779526", "0.67769456", "0.67760205", "0.6775397", "0.6775162", "0.67691094", "0.6767995", "0.6766996", "0.6765329", "0.67651075", "0.6764254", "0.6758045", "0.67576134", "0.67563283", "0.675321", "0.6750128", "0.67358655", "0.67323154", "0.6731836", "0.67299706", "0.67299706", "0.672308", "0.67227376", "0.6718976", "0.6712384", "0.67080057", "0.6702406", "0.6702406", "0.66974086", "0.6695257", "0.6694878", "0.6688753", "0.6688724", "0.66674787", "0.6665243", "0.665841", "0.6656873", "0.6652635", "0.66342133", "0.66329515", "0.6627858", "0.6627226", "0.66240734", "0.66228473", "0.6617534", "0.6616546", "0.66159505", "0.66157675", "0.6602376", "0.66015846", "0.6600396", "0.6598987", "0.65954584", "0.6595302", "0.65948933", "0.659425", "0.65941626", "0.65926206", "0.6592146", "0.6591548", "0.65899646", "0.65848094", "0.6583974", "0.65833145", "0.65825796", "0.6582045" ]
0.0
-1
Check whether a key for the word's signature exists. If so, add the word to the existing set. Otherwise, create a new entry.
public void addElement(String word, String signature) { if(dictionaryMap.get(signature)!= null) dictionaryMap.get(signature).add(word); else { Set<String> newSignature = new TreeSet<>(); newSignature.add(word); dictionaryMap.put(signature, newSignature); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean add(String word) {\r\n\t\treturn dict.add(word);\r\n\t}", "public boolean add(String key) {\n char[] characters = key.trim().toCharArray();\n\n TrieNode trieNode = root; // current trie node\n\n boolean alreadyExists = true;\n\n for (char ch : characters) {\n // get the character represent index from the current trie node\n int index = ch - 'a';\n if (trieNode.offsprings[index] == null) {\n trieNode.offsprings[index] = new TrieNode();\n alreadyExists = false;\n }\n\n trieNode = trieNode.offsprings[index];\n }\n\n trieNode.isRepresentACompleteWord = true;\n\n return alreadyExists;\n }", "public boolean put(String word){\n\n\t\tif (word != null){\n\t\t\tint hash = getHash(word);\n\t\t\tif (hash != INVALID){\n\t\t\t\tm_arraylists[hash].put(word);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public static void addKeyWord(String word)\r\n\t{\r\n\t\tkeywords.add(word);\r\n\t}", "public void add(LLNodeHash word){\n if (!checkWord(word)){\n put(word);\n }\n }", "public synchronized boolean add(String key, String content) {\n if (store.get(key) != null) {\n logger.warning(\"Key \" + key + \" already in store\");\n return false;\n }\n logger.info(\"Adding key \" + key);\n ensureMapSize();\n MapData mapData = new MapData();\n mapData.setContent(content);\n mapData.setTime((new Date()).getTime());\n store.put(key, mapData);\n tally.put(key, 0);\n return true;\n }", "public void add(String word) {\n Signature sig = new Signature(word);\n add(sig, word);\n }", "public void insert( Word x )\n {\n WordList whichList = theLists[ myhash( x.key ) ];\n //System.out.println(\"WordList found\");\n \n\t whichList.add( x );\n\t //System.out.println(\"Word \" + x.value + \" successfully added\");\n }", "void add(String key);", "private void wordAdd(String word){\n if (!fileWords.containsKey(word)){\n fileWords.put(word,1);\n if (probabilities.containsKey(word)) {\n double oldCount = probabilities.get(word);\n probabilities.put(word, oldCount+1);\n } else {\n probabilities.put(word, 1.0);\n }\n }\n }", "public boolean addEntryFromMenu(String newWord)\n {\n if (this.hasWord(newWord))\n {\n return false;\n }\n else\n {\n //a new blank entry\n Entry newEntry = new Entry();\n //adds my new word tothe entry\n newEntry.setWord(newWord);\n //insert the new entry to the list\n this.addEntryInOrder(newEntry);\n return true;\n }\n //System.out.println(\"You broke logic\");\n //#unreachable\n }", "public boolean addWord(String word) {\n return false;\n }", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\tprivate boolean checkAndAdd(DefinitionName key, DmsDefinition obj, HashMap map){\n if (map.containsKey(key))\n return(false);\n else\n map.put(key,obj);\n\n return(true);\n }", "public static Word insert(Set<Keyword> keywordSet, IWord currentWord, String text) {\n\n // check to see if the new word is already a child word of current word\n WordKeywordPair duplicate = null;\n for (WordKeywordPair wordKeywordPair : currentWord.getWordKeywordPairs()) {\n Word word = wordKeywordPair.getWord();\n if (word.getText().equalsIgnoreCase(text)) {\n duplicate = wordKeywordPair;\n }\n }\n\n // CASE 1: newWord is already in the child words of currentWord\n // - find the WordKeywordPair\n // - add keywords to this WordKeywordPair\n // - increment frequency of currentWord\n if (duplicate != null) {\n duplicate.addKeywords(keywordSet);\n duplicate.getWord().incrementFrequency();\n return duplicate.getWord();\n } else {\n // CASE 2: newWord is not in the child words of currentWord\n // - create and add a child word\n // - to this child add the new keywords\n // - increment the frequency of currentWord\n Word wordToAdd = new Word(text);\n WordKeywordPair newWordKeywordPair = new WordKeywordPair(wordToAdd, keywordSet);\n currentWord.addWordKeyWordPair(newWordKeywordPair);\n currentWord.incrementFrequency();\n return newWordKeywordPair.getWord();\n }\n\n }", "public boolean addEntryInOrder(Entry newEntry)\n {\n if (this.isEmpty())\n {\n //if its empty, initializing as a new list won't hurt\n //catches slippery null lists\n entryList = new LinkedList<Entry>();\n entryList.add(newEntry);\n return true;\n }\n\n\n //current position in list\n int index = 0;\n //current word in list\n String current;\n //the word from the entry I'm adding, assumes its valid\n String newWord = newEntry.getWord();\n\n if (this.hasWord(newWord))\n {\n //the entry already exists\n return false;\n }\n\n while(index < entryList.size())\n {\n current = entryList.get(index).getWord();\n\n if (newWord.compareToIgnoreCase(current) < 0)\n {\n //the new word goes before the current word\n entryList.add(index, newEntry);\n return true;\n }\n else if (newWord.compareToIgnoreCase(current) == 0)\n {\n return false;\n //word already exists in database\n }\n //move on to the next one\n index++;\n\n }\n\n //if it comes after everything in the database\n entryList.add(newEntry);\n return true;//woohoo we did it\n\n }", "private boolean duplicateDictionaryExists(Dictionary dictionary) throws LIMSRuntimeException {\n try {\n\n List list = new ArrayList();\n\n // not case sensitive hemolysis and Hemolysis are considered\n // duplicates\n // description within category is unique AND local abbreviation\n // within category is unique\n String sql = null;\n if (dictionary.getDictionaryCategory() != null) {\n sql = \"from Dictionary t where \"\n + \"((trim(lower(t.dictEntry)) = :param and trim(lower(t.dictionaryCategory.categoryName)) = :param2 and t.id != :dictId)) \";\n //Commented by Dung 2016.07.18\n //localAbbreviation will wrong when put here\n/* + \"or \"\n + \"(trim(lower(t.localAbbreviation)) = :param4 and trim(lower(t.dictionaryCategory.categoryName)) = :param2 and t.id != :dictId)) \";*/\n\n } else {\n sql = \"from Dictionary t where \"\n + \"((trim(lower(t.dictEntry)) = :param and t.dictionaryCategory is null and t.id != :param3) \"\n + \"or \"\n + \"(trim(lower(t.localAbbreviation)) = :param4 and t.dictionaryCategory is null and t.id != :param3)) \";\n\n }\n Query query = HibernateUtil.getSession().createQuery(sql);\n query.setParameter(\"param\", dictionary.getDictEntry().toLowerCase().trim());\n /*query.setParameter(\"param4\", dictionary.getLocalAbbreviation().toLowerCase().trim());*/\n if (dictionary.getDictionaryCategory() != null) {\n query.setParameter(\"param2\", dictionary.getDictionaryCategory().getCategoryName().toLowerCase().trim());\n }\n\n // initialize with 0 (for new records where no id has been generated\n // yet\n String dictId = \"0\";\n if (!StringUtil.isNullorNill(dictionary.getId())) {\n dictId = dictionary.getId();\n }\n query.setInteger(\"dictId\", Integer.parseInt(dictId));\n\n list = query.list();\n HibernateUtil.getSession().flush();\n HibernateUtil.getSession().clear();\n\n if (list.size() > 0) {\n return true;\n } else {\n return false;\n }\n\n } catch (Exception e) {\n // bugzilla 2154\n LogEvent.logError(\"DictionaryDAOImpl\", \"duplicateDictionaryExists()\", e.toString());\n throw new LIMSRuntimeException(\"Error in duplicateDictionaryExists()\", e);\n }\n }", "public boolean\tadd(String e) {\n\t\tboolean notExist = false;\n\t\tif (map.put(e, PRESENT)==null) {\n\t\t\tnotExist = true;\n\t\t}\n\t\treturn notExist;\n\t}", "public abstract boolean insert(Key key);", "com.icare.eai.schema.om.evSORequest.EvSORequestDocument.EvSORequest.Key addNewKey();", "public void addWord(Word word);", "private void addWordsFromFile(File file){\n \n FileResource fr = new FileResource(file);\n String fileName = file.getName();\n for (String word : fr.words()) {\n if (!hashWords.containsKey(word)) {// if hash map doesnt contain the key word\n ArrayList<String> newList = new ArrayList<String>();//create a new Arraylist\n newList.add(fileName);//add the file name to it \n hashWords.put(word, newList);// map the word to the new list\n } else if (hashWords.containsKey(word)\n && !hashWords.get(word).contains(fileName)) {\n //the hash map contains the keyword but not the filename\n // it gets stored as a new value in the\n //arraylist of the hashmap:\n \n ArrayList<String> currentList = hashWords.get(word);//currentList is the existing array list of files\n //for the given word\n currentList.add(fileName);//Add new file name to existing list\n hashWords.put(word, currentList);//map the 'word' to the updated arraylist\n }\n }\n }", "int insertSelective(WdWordDict record);", "public boolean add(Word words) {\n\t // Insert words as active\n\t\t \twords.removeNonAlphaNum();\n\t\t \ttotalWords++;\n\t int currentPosition = findPos(words.getContent());\n\t if (isActive(array, currentPosition)) {\n\t \tarray[currentPosition].element.addLineNumbers((Integer)words.getLines().getHead().data);\n\t return false;\n\t }\n\n\t array[currentPosition] = new HashEntry(words, true);\n\t theSize++;\n\t \n\t // Rehashing\n\t if(++occupied > array.length / 2)\n\t rehash();\n\t \n\t return true;\n\t }", "private void populateDictionaryBySynonyms() {\n\n Enumeration e = dictionaryTerms.keys();\n while (e.hasMoreElements()) {\n String word = (String) e.nextElement();\n String tag = dictionaryTerms.get(word);\n\n ArrayList<String> synonyms = PyDictionary.findSynonyms(word);\n\n for (int i = 0; i < synonyms.size(); i++) {\n if (!dictionaryTerms.containsKey(synonyms.get(i))) {\n dictionaryTerms.put(synonyms.get(i), tag);\n }\n }\n }\n }", "boolean add(Object key, Object value);", "int insert(WdWordDict record);", "public boolean add(E key)\r\n {\r\n if(this.contains(key))\r\n {\r\n return false;\r\n }\r\n\r\n else\r\n {\r\n super.add(key);\r\n }\r\n return true;\r\n }", "public boolean add(K key, V value){\r\n int loc = find(key);\r\n if(needToRehash()){\r\n rehash();\r\n }\r\n Entry<K,V> newEntry = new Entry<>(key,value);\r\n if(hashTable[loc]!= null && hashTable[loc].equals(key))\r\n return false;\r\n else{\r\n hashTable[loc] = newEntry;\r\n size++;\r\n return true;\r\n }\r\n }", "private void addEntry(String word, String file, int position, HashMap<String, ArrayList<Integer>> subIndex) {\n\t\tif (subIndex.containsKey(word)) {\r\n\t\t\t// checks if the file name is a key in the nested\r\n\t\t\t// hash map of the word\r\n\t\t\tsubIndex.get(word).add(position);\r\n\t\t\r\n\t\t/*\r\n\t\t * if the word is not yet a key, create a new entry in the hash map.\r\n\t\t * Create new hash map to hold the file the word is found and an array\r\n\t\t * to find the position Then put that in the wordMap hash map as value\r\n\t\t * and the word as a key.\r\n\t\t */\r\n\t\t}else {\r\n\t\t\tsubIndex.put(word, new ArrayList<Integer>());\r\n\t\t\tsubIndex.get(word).add(position);\r\n\t\t\r\n\t\t}\r\n\t\r\n\t}", "public void add(String word) {\n if (hashTable.contains(word)) {\n hashTable.put(word, hashTable.get(word) + 1);\n }\n else {\n hashTable.put(word,1);\n }\n }", "private void addToRoot(String line) {\r\n String[] components = line.split(\"\\\",\\\"\"); //get all components of line, that are [word, type, meaning]\r\n removeSpaces(components); //remove space and extra symbol from all components\r\n\r\n if (components.length == 3) { //if the components are valid\r\n\r\n boolean[] status = dict.addWord(components[0], components[1], components[2], 'a'); //try adding in add mode\r\n\r\n if (status[1]) { // if word already exists but have other meaning so need to append the meaning\r\n dict.addWord(components[0], components[1], components[2], 'u'); //add in update mdoe\r\n }\r\n }\r\n\r\n //System.out.println(\"Added word : \" + components[0]);\r\n }", "@Override\n public boolean add(X x) {\n if (!allowElementsWithoutIdentification)\n throw new IllegalArgumentException(\"It is not allowed to put Elements without Identification in this Set\");\n\n return map.put(x, placeholder) == null;\n }", "public boolean add(String key, String value){\r\n // takes a key and turns it into a hashed thing\r\n int arrIndex = hash(key);\r\n\r\n Entry entry = new Entry(key, value);\r\n\r\n if (hashTableArray[arrIndex] == null){\r\n hashTableArray[arrIndex] = new LinkedList<>();\r\n }\r\n if(contains(key)) {\r\n return false; // the key is already in use, so don't use it.\r\n } else {\r\n hashTableArray[arrIndex].add(entry); // add the key and value pair to the linked list.\r\n }\r\n return true;\r\n }", "private boolean addBook(Book book) {\n\t\tfor (int i = 0; i < items.size(); i++)\n\t\t\tif (items.get(i).keyEquals(book))\n\t\t\t\treturn false;\n\t\titems.add(book);\n\t\treturn true;\n\t}", "void addCorrect(String key, String val) {\n List<String> list = map.get(key);\n if (list == null) {\n list = Collections.synchronizedList(new ArrayList<>());\n List<String> exist = map.putIfAbsent(key, list);\n if (exist != null) {\n list = exist;\n }\n }\n list.add(val);\n }", "public static void checkMagazine(String[] magazine, String[] ransom) {\n HashMap<String, Integer> usableWords = makeMap(magazine);\n for (int i = 0; i < ransom.length; i++) {\n if (usableWords.containsKey(ransom[i]) && usableWords.get(ransom[i]) > 0) {\n usableWords.merge(ransom[i], -1, Integer::sum); // uses the word\n } else {\n System.out.println(\"No\");\n return;\n }\n }\n System.out.println(\"Yes\");\n}", "private void insertWordEntry(String file, String word, String partition) {\n\t\tArrayList<String> fileList = new ArrayList<String>();\n\t\tfileList.add(file);\n\t\tindexedDir.get(partition).put(word, fileList);\n\t}", "private void add(String key) {\n dict = add(dict, key, 0);\n }", "public void put(LLNodeHash word){\n int h = hash(word.getKey());\n if (hashTable[h] == null){\n hashTable[h] = new LLNodeHash(word.getKey(), word.getFreq(), null);\n }\n else{\n LLNodeHash ptr = hashTable[h];\n //while loop to traverse the linked list till the last node\n while (ptr.getNext() != null){\n ptr = ptr.getNext();\n }\n //sets the next node to the new inserted word\n ptr.setNext(new LLNodeHash(word.getKey(), 1, null));\n }\n //checks the load factor after each addition to the hashtable to see\n //if there is a need to rehash based on the load factor\n checkLoadFactor();\n }", "public void insert(String word, String signature) {\n\t\tStringBuffer sB = new StringBuffer(signature);\n\t\tif (sB.length() == 0) { // Base case for recursive call. If the length of the signature equals zero, the word is inserted into words, but no new subtrees are instantiated. \n\t\t\twords.add(word.toLowerCase());\n\t\t}\n\t\telse {\n\t\t\tint index = Character.getNumericValue(sB.charAt(0)) - 2; // Converts the value of each character into an int index\n\t\t\tif (rangeCheck(index)) {\n\t\t\t\t/**\n\t\t\t\t * If true a new TreeDictionary is stored at tD[index], the level of the new Tree is set to 1 more down than the current level, the word is inserted into this objects\n\t\t\t\t * Tree<Set> words, before the insert is called recursively on the newly instantiated Tree.\n\t\t\t\t * If false, which means that a TreeDictionary is already stored at this index, the word is inserted into the Tree at this index and the insert is called recursively\n\t\t\t\t * on the existing TreeDictionary at that index.\n\t\t\t\t */\n\t\t\t\tif (tD[index] == null) { \n\t\t\t\t\ttD[index] = new TreeDictionary();\n\t\t\t\t\ttD[index].level = level + 1;\n\t\t\t\t\ttD[index].words.add(word.toLowerCase());\n\t\t\t\t\ttD[index].insert(word, sB.substring(1)); \n\t\t\t\t}\n\t\t\t\telse { \n\t\t\t\t\ttD[index].words.add(word.toLowerCase()); \n\t\t\t\t\ttD[index].insert(word, sB.substring(1));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "boolean containsKey(int key) throws ContentStoreException;", "@Override\n\tpublic boolean containsKey(Key k) {\n\t\treturn bst.has(k);\n\t}", "public boolean add(E element){\n Object result = map.put(element, \"\");\n return (result == null);\n }", "boolean add(String token, ArrayList<Posting> documentList) { \r\n\t\tif (token == null)\r\n\t\t\treturn false;\r\n\t\tif (map.containsKey(token)) {\r\n\t\t\tmap.put(token, mergeTwoPostingList(map.get(token), documentList));\r\n\t\t\treturn true;\r\n\t\t} else { \r\n\t\t\tmap.put(token, documentList);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic boolean exists(T key) {\r\n\t\treturn existsRec(raiz, key);\r\n\t}", "protected abstract Set<String> _addToSet(String key, Collection<String> str);", "public boolean checkAndUpdate(String word) {\n if (hashTable.contains(word)) {\n hashTable.put(word, hashTable.get(word) - 1);\n if (hashTable.get(word) == 0) {\n hashTable.delete(word);\n }\n return true;\n }\n return false;\n }", "public void AddKeywords()\n\t{\n\t\ttry\n\t\t{\n\t\t\tConnector con = new Connector();\n\t\t\tString query; \n\t\t\t\n\t\t\tfor(int i = 0; i < keywords.size(); i++)\n\t\t\t{\n\t\t\t\tString keyword = keywords.get(i); \n\t\t\t\t\n\t\t\t\tint kid = GetKIDFromWord(keyword); \n\t\t\t\t\n\t\t\t\t//word is not already in table\n\t\t\t\tif(kid == -1)\n\t\t\t\t{\n\t\t\t\t\t//insert word into Keywords \n\t\t\t\t\tSystem.out.println(\"test\"); \n\t\t\t\t\tquery = \"INSERT INTO Keywords(word) VALUE ('\"+keyword+\"')\"; \n\t\t\t \tint intoTable = con.stmt.executeUpdate(query); \n\t\t\t \t\n\t\t\t \t//able to put it in the table\n\t\t\t \tif(intoTable > 0)\n\t\t\t \t{\n\t\t\t \t\t//insert into HasKeywords\n\t\t\t\t \tkid = GetKIDFromWord(keyword); \n\t\t\t\t\t\tquery = \"INSERT INTO HasKeywords(keyword_hid, keyword_kid) VALUE('\"+hid+\"', '\"+kid+\"')\";\n\t\t\t\t \tint hasKey = con.stmt.executeUpdate(query); \n\t\t\t \t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//word is already in table\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tList<Integer> hkCheck = GetHIDSFromKID(kid);\n\t\t\t\t\t\n\t\t\t\t\tboolean inHKTable = false; \n\t\t\t\t\tfor(int j = 0; j < hkCheck.size(); j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(hkCheck.get(j) == hid)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinHKTable = true; \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\tif(inHKTable == false)\n\t\t\t\t\t{\n\t\t\t\t\t\tquery = \"INSERT INTO HasKeywords(keyword_hid, keyword_kid) VALUE('\"+hid+\"', '\"+kid+\"')\";\n\t\t\t\t \tint hasKey = con.stmt.executeUpdate(query); \n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tcon.closeConnection();\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}", "private RadixTree add(Signature key, String word) {\n if (key.isEmpty()) {\n words.add(word);\n return this;\n } else {\n for (Signature label : children.keySet()) {\n if (label.isPrefix(key)) {\n int len = label.size();\n Signature suffix = key.suffix(len);\n RadixTree child = children.get(label);\n return child.add(suffix, word);\n } else {\n Signature prefix = key.lcp(label);\n int len = prefix.size();\n if (len > 0) {\n RadixTree father = split(label, prefix);\n return father.add(key.suffix(len), word);\n }\n }\n }\n }\n // No continuation found\n RadixTree child = new RadixTree();\n child.words.add(word);\n children.put(key, child);\n return child;\n }", "@Override\n\tpublic boolean contains(K key) {\n\t\treturn false;\n\t}", "public void addWord(String word) {\n if (word == null || word.equals(\"\")) return;\n char[] str = word.toCharArray();\n WordDictionary cur = this;\n for (char c: str) {\n if (cur.letters[c - 'a'] == null) cur.letters[c - 'a'] = new WordDictionary();\n cur = cur.letters[c - 'a'];\n }\n cur.end = true;\n }", "public boolean contains(Key key);", "public boolean checkWord(LLNodeHash word){\n //finds index of the word in the array\n int h = hash(word.getKey());\n LLNodeHash ptr = hashTable[h];\n //looks through linked list at that index and changes frequency of word if found\n while (ptr != null){\n if (ptr.getKey().equals(word.getKey())){\n ptr.setFreq(ptr.getFreq() + word.getFreq());\n return true;\n }\n ptr = ptr.getNext();\n }\n return false;\n }", "public void checkNewAdded(Instance add) {\n List<Instance> keySet = new LinkedList<Instance>();\n keySet.addAll(backRelation.keySet());\n Boolean added = false;\n for (Instance inst : keySet) {\n if (inst.getName().equals(add.getName()) || inst.getMd5().equals(add.getMd5())) {\n added = true;\n ArrayList<Instance> tmp = backRelation.get(inst);\n tmp.add(add);\n backRelation.remove(inst);\n backRelation.put(inst, tmp);\n if (relatedInstances.containsKey(inst)) {\n ArrayList<Instance> tmpRI = relatedInstances.get(add);\n tmpRI.add(inst);\n relatedInstances.remove(add);\n relatedInstances.put(add, tmpRI);\n\n } else {\n ArrayList<Instance> tmpRI = new ArrayList<Instance>();\n tmpRI.add(inst);\n relatedInstances.put(add, tmpRI);\n }\n\n }\n }\n if (added) {\n instances.add(add);\n }\n }", "boolean addAll(Object key, Set values);", "public void insert(String word) {\n TrieNode now = root;\n for(int i = 0; i < word.length(); i++) {\n Character c = word.charAt(i);\n if (!now.children.containsKey(c)) {\n now.children.put(c, new TrieNode());\n }\n now = now.children.get(c);\n }\n now.hasWord = true;\n}", "private boolean contains(String key) {\n return contains(dict, key);\n }", "public void addWord(String word) {\n // Write your code here\n TrieNode now = root;\n for(int i = 0; i < word.length(); i++) {\n Character c = word.charAt(i);\n if (!now.children.containsKey(c)) {\n now.children.put(c, new TrieNode());\n }\n now = now.children.get(c);\n }\n now.hasWord = true;\n }", "public void addTerm(Term term) throws PreExistingTermException {\n ArrayList<String> temp = new ArrayList<>();\n\n for (Term t: listOfTerms) {\n String termName = t.getTermName();\n temp.add(termName);\n }\n\n String newTermName = term.getTermName();\n\n if (!temp.contains(newTermName)) {\n this.listOfTerms.add(term);\n } else {\n throw new PreExistingTermException();\n }\n }", "protected boolean addMiss(String key, byte[] bs) {\n\t\tMiss miss = missMap.get(key);\n\t\tif(miss==null) {\n\t\t\tsynchronized(missMap) {\n\t\t\t\tmissMap.put(key, new Miss(bs,clean==null?MIN_INTERVAL:clean.timeInterval));\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn miss.add(bs); \n\t}", "boolean putWord(WordBean wordBean);", "public boolean add(int key) {\n Entry tab[] = table;\n int index = (key & 0x7FFFFFFF) % tab.length;\n for (Entry e = tab[index]; e != null; e = e.next) {\n if (e.key == key) {\n return false;\n }\n }\n\n if (count >= threshold) {\n // Rehash the table if the threshold is exceeded\n rehash();\n\n tab = table;\n index = (key & 0x7FFFFFFF) % tab.length;\n }\n\n // Creates the new entry.\n Entry e = new Entry(key, tab[index]);\n tab[index] = e;\n count++;\n return true;\n }", "@Override\n public boolean containsKey(Object key) {\n return entries.containsKey(key);\n }", "boolean nameExists(Key name);", "public static void add_word_place_info(String word,String book,int chapter_no,int verse_no)\n\t{\n\t if(word.length()>0)\n\t {\n\t boolean tag_studied=word_place.containsKey(word);\n\t if(true==tag_studied)\n\t {\n\t Map<String,Map<Integer,Integer> > item_1=word_place.get(word);\n\t tag_studied=item_1.containsKey(book);\n\t if(true==tag_studied)\n\t {\n\t\tMap<Integer,Integer> item_2=item_1.get(book);\n\t\ttag_studied=item_2.containsKey(chapter_no);\n\t\tif(true==tag_studied)\n\t\t{\n\t\t ;\n\t\t}\n\t\telse\n\t\t{\n\t\t item_2.put(chapter_no,verse_no);\n\t\t}\n\t }\n\t else\n\t {\n\t\tMap<Integer,Integer> place_chapter_verse=new HashMap();\n\t\tplace_chapter_verse.put(chapter_no,verse_no);\n\t\t\n\t\titem_1.put(book,place_chapter_verse);\n\t }\n\t }\n\t else\n\t {\n\t Map<Integer,Integer> place_chapter_verse=new HashMap();\n\t place_chapter_verse.put(chapter_no,verse_no);\n\t \n\t Map<String,Map<Integer,Integer> > place_book_chapter_verse=new HashMap();\n\t place_book_chapter_verse.put(book,place_chapter_verse);\n\t \n\t word_place.put(word,place_book_chapter_verse);\n\t }\n\t }\n\t}", "public void dictionaryAdd(String engWord, String vietWord) {\n String[] explain = vietWord.split(\"\\n\");\n\n if (dictionary.getWordList().get(engWord) != null) {\n dictionary.getWordList().get(engWord).addAll(Arrays.asList(explain));\n } else {\n ArrayList<String> arrayList = new ArrayList<>(Arrays.asList(explain));\n dictionary.getWordList().put(engWord, arrayList);\n }\n }", "public boolean add( String key, T value )\r\n {\r\n HashMap<String,T> top = tables.peekFirst();\r\n T result = top.get( key );\r\n top.put( key, value );\r\n return result==null;\r\n }", "public boolean add(Object x)\n {\n if (loadFactor() > 1)\n {\n resize(nearestPrime(2 * buckets.length - 1));\n }\n\n int h = x.hashCode();\n h = h % buckets.length;\n if (h < 0) { h = -h; }\n\n Node current = buckets[h];\n while (current != null)\n {\n if (current.data.equals(x))\n {\n return false; // Already in the set\n }\n current = current.next;\n }\n Node newNode = new Node();\n newNode.data = x;\n newNode.next = buckets[h];\n buckets[h] = newNode;\n currentSize++;\n return true;\n }", "private void upgradeDictionary() throws IOException {\n File fileAnnotation = new File(filePathAnnSource);\n FileReader fr = new FileReader(fileAnnotation);\n BufferedReader br = new BufferedReader(fr);\n String line;\n\n if (fileAnnotation.exists()) {\n while ((line = br.readLine()) != null) {\n String[] annotations = line.split(\"[ \\t]\");\n String word = line.substring(line.lastIndexOf(\"\\t\") + 1);\n\n if (!nonDictionaryTerms.contains(word.toLowerCase())) {\n if (dictionaryTerms.containsKey(word.toLowerCase())) {\n if (!dictionaryTerms.get(word.toLowerCase()).equalsIgnoreCase(annotations[1])) {\n System.out.println(\"Conflict: word:: \" + word + \" Dictionary Tag: \" + dictionaryTerms.get(word.toLowerCase()) + \" New Tag: \" + annotations[1]);\n nonDictionaryTerms.add(word.toLowerCase());\n// removeLineFile(dictionaryTerms.get(word.toLowerCase())+\" \"+word.toLowerCase(),filePathDictionaryAuto);\n dictionaryTerms.remove(word.toLowerCase());\n writePrintStream(word, filePathNonDictionaryAuto);\n }\n } else {\n System.out.println(\"Updating Dictionary:: Word: \" + word + \"\\tTag: \" + annotations[1]);\n dictionaryTerms.put(word.toLowerCase(), annotations[1]);\n writePrintStream(annotations[1] + \" \" + word.toLowerCase(), filePathDictionaryAuto);\n }\n }\n\n// if (dictionaryTerms.containsKey(word.toLowerCase())) {\n// if (!dictionaryTerms.get(word.toLowerCase()).equalsIgnoreCase(annotations[1])) {\n// System.out.println(\"Conflict: word: \" + word + \" Dictionary Tag: \" + dictionaryTerms.get(word.toLowerCase()) + \" New Tag: \" + annotations[1]);\n// nonDictionaryTerms.add(word.toLowerCase());\n//\n// }\n// } else {\n// dictionary.add(word.toLowerCase());\n// dictionaryTerms.put(word.toLowerCase(), annotations[1]);\n// System.out.println(\"Updating Dictionary: Word: \" + word + \"\\tTag: \" + annotations[1]);\n// }\n }\n }\n\n\n br.close();\n fr.close();\n }", "public boolean containsKey(Key key) ;", "private void addToMap(Word from, Word to) {\n Set<Word> s = wordMap.get(from);\n if(s == null) {\n s = new HashSet<>();\n wordMap.put(from, s);\n }\n s.add(to);\n }", "public void addUnknown(String word, String tag) {\n\t\tthis.unknownWordTable.put(word, tag);\n\t}", "public void add (String word) {\n Trie pointeur ;\n\n if(word.length() != 0){\n String lettre = Character.toString(word.charAt(0));\n String ssChaine = word.substring(1);\n pointeur = this.fils.get(lettre);\n if(pointeur == null){\n pointeur = new Trie();\n this.fils.put(lettre,pointeur);\n\n }\n pointeur.add(ssChaine);\n if(ssChaine.length()==0){\n this.fin = true;\n }\n \n }\n \n }", "public Boolean addToDictionary(String type, String word, String priority, String phonetic, String accent) throws DynamicCallException, ExecutionException {\n return (Boolean)call(\"addToDictionary\", type, word, priority, phonetic, accent).get();\n }", "public V add(K key, V value)\n { \n checkInitialization();\n if ((key == null) || (value == null))\n throw new IllegalArgumentException();\n else\n { \n V result = null; \n int keyIndex = locateIndex(key); \n if ((keyIndex < numberOfEntries) && \n key.equals(dictionary[keyIndex].getKey()))\n {\n // Key found; return and replace entry's value\n result = dictionary[keyIndex].getValue(); // Get old value\n dictionary[keyIndex].setValue(value); // Replace value \n }\n else // Key not found; add new entry to dictionary\n { \n makeRoom(keyIndex);\n dictionary[keyIndex] = new Entry(key, value);\n numberOfEntries++;\n ensureCapacity(); // Ensure enough room for next add\n } // end if \n return result;\n } // end if\n }", "private void saveMissingTagAndBiGram(){\n BiGram newBiGram;\n for(Tag tag1 : Tag.values()){\n if(!tagMap.containsKey(tag1))\n tagMap.put(tag1, (long)1);\n for (Tag tag2 :Tag.values()){\n newBiGram = new BiGram(tag1, tag2);\n if(!biGramMap.containsKey(newBiGram))\n biGramMap.put(newBiGram, (long)1);\n }\n }\n }", "public Boolean addToDictionary(String text, String toReplace) throws DynamicCallException, ExecutionException {\n return (Boolean)call(\"addToDictionary\", text, toReplace).get();\n }", "@Override\n\tpublic boolean containsWord(String word) {\n\t\tlock.lockReadOnly();\n\t\ttry {\n\t\t\treturn super.containsWord(word);\n\t\t} finally {\n\t\t\tlock.unlockReadOnly();\n\t\t}\n\t}", "private void addPair(int word1, int word2) {\n\t\trelatedPairs[word1].add(word2);\n\t}", "public boolean insert(int val) {\n boolean res=!map.containsKey(val);\n if(res)\n map.put(val,new HashSet());\n map.get(val).add(li.size());\n li.add(val);\n return res;\n }", "public void put(K searchKey, V newValue) {\n\t\tint index = hash(searchKey);\n\t\t\n\t\tIterator<WordCode<K, V>> itr = myBuckets.get(index).iterator();\n\t\t\n\t\twhile (itr.hasNext()) {\n\t\t\tWordCode<K, V> wc = itr.next();\n\t\t\tif (wc.myKey.equals(searchKey)) itr.remove();\n\t\t\t\n\t\t}\n\t\tmyBuckets.get(index).add(new WordCode<K, V>(searchKey, newValue));\n\t\t\t\n\t\tnumEntries++;\n\t}", "@Override\n\t\t\tpublic boolean contains(String key) {\n\t\t\t\treturn false;\n\t\t\t}", "public boolean existsKey(String inKey);", "public boolean addThemeWord(String word){\r\n\t\treturn themeWords.add(word);\r\n\t}", "public boolean add(String e) {\r\n \tSystem.out.println(e + \" \" + PRESENT);\r\n return map.put(e, PRESENT)==null;\r\n }", "public void testADDForExistant() \n throws Exception\n {\n String id = \"occ_hermes1\";\n Occurrence occ = (Occurrence) tm.getObjectByID(id);\n \n tag.setNonexistant(\"add\");\n tag.setOccurrence(occ);\n \n // set a script for the body of the tag\n scriptWasCalled = false;\n setScriptForTagBody(tag);\n \n tag.doTag(null);\n \n // the body script must not have been called\n assertFalse(scriptWasCalled);\n }", "public void mergeKeyWords(HashMap<String, Occurrence> kws) {\n // COMPLETE THIS METHOD\n Set<String> key = kws.keySet();\n Iterator<String> itre = key.iterator();\n while (itre.hasNext())\n {\n String word = itre.next();\n Occurrence occ = kws.get(word);\n if (!keywordsIndex.containsKey(word)){ // keyword is not in keywordIndex\n ArrayList<Occurrence> occurrences = new ArrayList<Occurrence>();\n Occurrence xyz = new Occurrence(occ.document, occ.frequency);\n occurrences.add(xyz);\n keywordsIndex.put(word, occurrences);\n\n } else{ // keyword is a duplicate\n Occurrence xyz = new Occurrence(occ.document, occ.frequency);\n keywordsIndex.get(word).add(xyz);\n insertLastOccurrence(keywordsIndex.get(word));\n }\n }\n\n }", "public boolean add(int key) {\r\n\t\tint i = ArrayUtils.binarySearch(keys, size, key);\r\n\r\n\t\tif (i >= 0) {\r\n\t\t\treturn false; // already in array no need to add again\r\n\t\t} else {\r\n\t\t\ti = ~i;\r\n\r\n\t\t\tif (size >= keys.length) {\r\n\t\t\t\tint n = ArrayUtils.idealArraySize(size + 1);\r\n\r\n\t\t\t\tint[] nkeys = new int[n];\r\n\r\n\t\t\t\tSystem.arraycopy(keys, 0, nkeys, 0, keys.length);\r\n\t\t\t\tkeys = nkeys;\r\n\t\t\t}\r\n\r\n\t\t\tif (size - i != 0) {\r\n\t\t\t\tSystem.arraycopy(keys, i, keys, i + 1, size - i);\r\n\t\t\t}\r\n\r\n\t\t\tkeys[i] = key;\r\n\t\t\tsize++;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t}", "com.icare.eai.schema.om.evSORequest.EvSORequestDocument.EvSORequest.Key insertNewKey(int i);", "static void insert(Item x) {\n int i = hash(x.sum);\n while (st[i] != null) {\n i++;\n if (i >= st.length) i -= st.length;\n }\n st[i] = x;\n }", "public void add(String word, String url) {\n \n // don't need to add this word if it's a stop word\n for (String stopWord : Settings.getStopWords()) {\n if (word.equalsIgnoreCase(stopWord)) return;\n }\n \n // don't need to add this word if it's already in here\n StringNode check = locate(word);\n if (check != null) {\n check.getPagesContainingWord().add(url);\n return;\n }\n \n // not a stop word, not present--need to add it\n StringNode newNode = new StringNode(word, new URLLinkedList());\n newNode.getPagesContainingWord().add(url);\n if (first == null) { // if first is null, there's nothing in the list\n first = newNode; // set first to this new node\n newNode.getPagesContainingWord().add(url);\n }\n else { // first isn't null, so we want to find the correct place to put this new node\n StringNode current = first;\n // this barebones linked list is very inconvenient, so we have to make a special \n // check for the first item in the list.\n if (word.compareTo(current.getWord()) < 0) { // the word in the new node goes before the word in the first node\n first = newNode; // now the new node is the first one\n newNode.setNext(current); // and its next is the old first one\n }\n else if (!current.hasNext()) { // no next node, so this word goes after current\n current.setNext(newNode);\n }\n else { // new node doesn't go before first, so check the rest of the list\n boolean newNodePlaced = false;\n StringNode previous;\n while (current.hasNext() && !newNodePlaced) { \n previous = current;\n current = current.getNext(); // grab next node\n if (word.compareTo(current.getWord()) < 0) { // new word goes before this one\n// StringNode oldNext = current.getNext();\n// current.setNext(newNode);\n// newNode.setNext(oldNext);\n// newNodePlaced = true;\n previous.setNext(newNode);\n newNode.setNext(current);\n newNodePlaced = true;\n }\n }\n if (!newNodePlaced) { // if we're here and haven't yet placed the node, it goes at the end\n current.setNext(newNode);\n }\n }\n }\n size++;\n }", "void contains(String str) {\n dictionary.add(str);\n assertEquals(words.contains(str), trie.contains(str));\n assertEquals(words.size(), trie.size());\n }", "@Override\r\n public boolean put(KeyType key, int isbn, String author, boolean checkedIn, String genre,\r\n String description) {\r\n\r\n\r\n \r\n int index = Math.abs(key.hashCode()) % this.capacity; //hashes the key to a usable index\r\n \r\n //adds a KeyValue object to a linked list creating a linked list at the specific index if \r\n //needed\r\n \r\n \r\n if (this.array[index] == null) {\r\n this.array[index] = new LinkedList<Book>(); // creates a linked list at the index\r\n this.array[index].add(new Book((String) key, isbn, author, checkedIn, genre, description)); // adds\r\n // the\r\n // KeyValue\r\n // object\r\n // to\r\n // the\r\n // list\r\n this.size++;\r\n\r\n grow(this.array);\r\n return true;\r\n }\r\n\r\n this.array[index].add(new Book((String) key,isbn, author, checkedIn, genre, description));\r\n this.size++;\r\n\r\n grow(this.array);\r\n return false;\r\n \r\n\r\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate boolean checkAndAdd(Object key, Object obj, @SuppressWarnings(\"rawtypes\") TreeMap map){\n if (map.containsKey(key))\n return(false);\n else\n map.put(key,obj);\n\n return(true);\n }", "public boolean put( AnyType key , AnyType value)\n { \n int currentPos = findPos( key );\t//TODO: test this\n \n if( array[ currentPos ] == null )\n ++occupied;\n array[ currentPos ] = new HashEntry<>(key, value);\n \n theSize++;\n \n // Rehash\n if( occupied > array.length / 2 )\n rehash( );\n \n return true;\n }", "public void addSynonymFromMenu(String wordToAddTo)\n {\n if (wordToAddTo.equals(\"\"))\n {\n //if the word is empty go back to caller\n System.out.println(\"\\nPlease type a valid word\\n\");\n return;\n }\n\n //checks whether the word is in the database and gets it\n if (!this.hasWord(wordToAddTo))\n {\n //if the word isn't there, go back to caller\n System.out.println(\"Sorry, I could not find that word in the thesaurus\\n\");\n return;\n }\n Entry entryToModify = entryList.get(getIndexOfWord(wordToAddTo));\n\n //controls if the loop is repeated\n boolean repeatCheck = true;\n while(repeatCheck)\n {\n System.out.println(\"What synonym would you like \" +\n \"to add to the word: \" + wordToAddTo);\n System.out.print(\">> \");\n //Scanner to take user input\n Scanner inputScanner = new Scanner(System.in);\n //the synonym to be added\n //will accept spaces in words\n String userInput = inputScanner.nextLine();\n\n if (userInput.equals(\"\"))\n {\n System.out.println(\"Sorry, I can't add nothing\\n\");\n //jump down to loop control\n }\n else\n {\n //checks to see if the entry already has that synonym\n\n if (entryToModify.hasSynonym(userInput))\n System.out.println(wordToAddTo + \" already has that synonym\\n\");\n else\n {\n //adds the synonym to the entry\n entryToModify.addSynonymInOrder(userInput);\n System.out.println(userInput + \" was added to the entry\\n\");\n }\n }\n\n //loop control menu\n System.out.println(\"\\nWould you like to add another synonym?\");\n System.out.print(\"type (yes/no) >>\");\n //does the user want to add another entry?\n String userResponse = inputScanner.next();\n if (userResponse.equalsIgnoreCase(\"yes\"))\n {}\n else\n {\n System.out.println(\"\\nGoing back to the main menu\\n\");\n repeatCheck = false;\n }\n }\n }", "public boolean add(T newEntry);", "int addKeyword(final KadId resourceId, final KadSearchEntry entry, long lastActivityTime);", "public void add(K key,V value) {\n DictionaryPair pair = new DictionaryPair(key,value);\n int index = findPosition(key);\n\n if (index!=DsConst.NOT_FOUND) {\n list.set(index,pair);\n } else {\n list.addLast(pair);\n this.count++;\n }\n }", "public String addItemByKey(String key, String value) throws DictionaryException {\n\t\tSystem.out.println(\"Going to add value : \" + value + \" for Key : \" + key);\n\t\tMap<String, List<String>> dictMap = getDictionary();\n\t\tif (dictMap != null && dictMap.isEmpty() != true) {\n\t\t\t// Check if key exists and add the item\n\t\t\tif (dictMap.containsKey(key)) {\n\t\t\t\tList<String> membersList = dictMap.get(key);\n\t\t\t\tif (membersList.contains(value)) {\n\t\t\t\t\t//Already existing value\n\t\t\t\t\tthrow new DictionaryException(ExceptionConstant.ADD_ERROR);\n\t\t\t\t} else {\n\t\t\t\t\tmembersList.add(value);\n\t\t\t\t\tdictMap.put(key, membersList);\n\t\t\t\t\tdictionary.setMultiValueDict(dictMap);\n\t\t\t\t}\n\t\t\t\t// Code for a fresh key and value insert\n\t\t\t} else {\n\t\t\t\tList<String> valueList = new ArrayList<>();\n\t\t\t\tvalueList.add(value);\n\t\t\t\tdictMap.put(key, valueList);\n\t\t\t}\n\t\t\t// First time entry of items in map\n\t\t} else {\n\t\t\tList<String> valueList = new ArrayList<>();\n\t\t\tvalueList.add(value);\n\t\t\tdictMap.put(key, valueList);\n\n\t\t}\n\t\treturn ApplicationMessage.ADD_SUCCESS_MSG;\n\t}" ]
[ "0.5974995", "0.58252174", "0.5744606", "0.5735508", "0.5708189", "0.5617863", "0.56155115", "0.5541254", "0.5512819", "0.54857814", "0.5438572", "0.54350626", "0.54314953", "0.54168415", "0.53612894", "0.53031373", "0.53012586", "0.5300914", "0.5291033", "0.5271849", "0.52638507", "0.5256144", "0.5244364", "0.5229191", "0.5219281", "0.5213256", "0.52056986", "0.52034044", "0.520172", "0.5200744", "0.51943105", "0.519234", "0.51714283", "0.5166699", "0.51651204", "0.5157052", "0.5136351", "0.51276606", "0.5110726", "0.51039696", "0.5095173", "0.50899714", "0.5089768", "0.5078511", "0.50759095", "0.5071161", "0.5068789", "0.5067182", "0.5066524", "0.50546247", "0.50497293", "0.50395536", "0.50330687", "0.5031477", "0.49993253", "0.49969488", "0.49949548", "0.49883437", "0.49881002", "0.4987044", "0.49737045", "0.49729073", "0.49639702", "0.49623507", "0.49618652", "0.49585277", "0.49584484", "0.49569488", "0.49481764", "0.49406704", "0.4936504", "0.4932698", "0.49237388", "0.49221793", "0.49156117", "0.4911285", "0.49076152", "0.49011534", "0.48991752", "0.48857343", "0.48850748", "0.48848104", "0.48840564", "0.4881029", "0.48808134", "0.4868521", "0.48676455", "0.48596746", "0.48586255", "0.48570144", "0.48537356", "0.48529452", "0.4850455", "0.48412055", "0.48367098", "0.4836432", "0.48353192", "0.48327884", "0.4832441", "0.4829998" ]
0.67448115
0
Get all words associated with the given signature.
public Set<String> signatureToWords(String signature) { if(dictionaryMap.containsKey(signature)) return dictionaryMap.get(signature); return new TreeSet<>(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Collection<String> signatureToWords(String sig);", "@Override\n\tpublic Set<String> signatureToWords(String signature) {\n\t\tif(dictionary.containsKey(signature));\n\t\t\treturn dictionary.get(signature);\n\t}", "public static Set<String> signatureToWords(String signature){\n\n\t\tFile dictionary = new File(DICTIONARY_PATH); // Final Dictionary\n\t\t\n\t\t// The set of string words to return\n\t\tSet<String> out = new TreeSet<String>();\n\t\t\n\t\t// Try-catch attempting to read the file, throws an error if it isn't present\n\t\ttry { \n\t\t\tScanner scan = new Scanner(dictionary);\n\t\t\t\n\t\t\t// Scan each word in the dictionary and check if it's signature matches\n\t\t\twhile(scan.hasNextLine()) {\n\t\t\t\t\n\t\t\t\tString dictWord = scan.nextLine().toLowerCase();\n\t\t\t\t\n\t\t\t\t// If the signature matches, add the word to the set\n\t\t\t\tif( signature.equals(wordToSignature(dictWord)) \n\t\t\t\t\t\t&& (out.contains(dictWord)==false)\n\t\t\t\t\t\t&& isValidWord(dictWord)) {\n\t\t\t\t\tout.add(dictWord);\n\t\t\t\t}\n\t\t\t}\n\t\t\tscan.close();\n\t\t}catch(FileNotFoundException e) {\n\t\t\t// If the file is not there print a message and the stack trace\n\t\t\tSystem.out.println(\"File not found ...\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn out;\n\t}", "public Set<String> signatureToWordsHelper(String signature) {\n\n\t\tif (signature.isEmpty()) {\n\t\t\treturn dictionary;\n\t\t} else {\n\t\t\tint characterVal = Integer.parseInt(signature.substring(0, 1));\n\t\t\tcharMatching = nodes[characterVal - 2].signatureToWordsHelper(signature.substring(1));\n\t\t\treturn charMatching;\n\n\t\t}\n\t}", "@Override\n\tpublic Set<String> signatureToWords(String signature) {\n\t\tSet<String> trimMatching = new HashSet<>();\n\t\tint max = signature.length();\n\n\t\tsignatureToWordsHelper(signature).forEach(el -> trimMatching.add(el.substring(0, max)));\n\t\treturn trimMatching;\n\n\t}", "@Override\n\tpublic TreeSet<String> signatureToWords(String signature) {\n\t\t\n\t\tStringBuffer sB = new StringBuffer(signature);\n\t\t\n\t\tif (sB.length() == 0) {\n\t\t\tTreeSet<String> tS = new TreeSet<>();\n\t\t\tIterator<String> iterator = words.iterator(); \n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tString word = iterator.next().toString();\n\t\t\t\tString subString = word.substring(0, level);\n\t\t\t\ttS.add(subString);\n\t\t\t}\n\t\t\treturn tS;\t\n\t\t}\n\t\telse {\n\t\t\tint index = Character.getNumericValue(sB.charAt(0)) -2;\n\t\t\tString subString = sB.substring(1);\n\t\t\treturn tD[index].signatureToWords(subString);\n\t\t}\n\t}", "public KeyWordList extractKeyWords(String input);", "public abstract Set<String> getTerms(Document doc);", "public List<String> getAllWords() {\n List<String> words = new ArrayList<>();\n // get the words to the list\n getAllWords(root, \"\", 0, words);\n // and return the list of words\n return words;\n }", "public Collection<String> words() {\n Collection<String> words = new ArrayList<String>();\n TreeSet<Integer> keyset = new TreeSet<Integer>();\n keyset.addAll(countToWord.keySet());\n for (Integer count : keyset) {\n words.addAll(this.countToWord.get(count));\n }\n return words;\n }", "public Set<String> getWords() {\n return wordsOccurrences.keySet();\n }", "public Set<String> getWords() {\n return wordMap.keySet();\n }", "Set<Keyword> listKeywords();", "List<T> getWord();", "public Iterator<String> words();", "public String[] getWords(SortOrder sortBy) {\n String[] result = new String[wordFrequency.size()];\n ArrayList<Map.Entry<String, MutableInteger>> entries =\n new ArrayList<Map.Entry<String, MutableInteger>>(wordFrequency.entrySet());\n if (sortBy == SortOrder.ALPHABETICALLY_ASCENDING) {\n Collections.sort(entries, SORT_ALPHABETICALLY_ASCENDING);\n } else {\n Collections.sort(entries, SORT_BY_FREQUENCY_ASCENDING);\n }\n\n //... Add words to the String array.\n int i = 0;\n for (Map.Entry<String, MutableInteger> ent : entries) {\n result[i++] = ent.getKey();\n }\n return result;\n }", "public static ArrayList<String> findWords(TrieNode root) {\n\t\tArrayList<String> result = new ArrayList<String>();\n\t\tgetWords(root, \"\", result);\n\t\treturn result;\n\t}", "public String get_all_words(){\n\t\tString found_words = \"\";\n\t\t//We try to find the word within our childs\n\t\tfor(LexiNode child: childs){\n\t\t\t\tfound_words += child.get_all_words();\n\t\t}\n\t\tif(current_word != null && !found_words.equals(\"\"))\n\t\t\treturn current_word + \"#\" + found_words;\n\t\telse if(current_word != null && found_words.equals(\"\"))\n\t\t\treturn current_word+ \"#\";\n\t\telse //current_word == null && found_words != null\n\t\t\treturn found_words;\n\t}", "private static List<String> getSensorWords(SensorDetails details){\r\n\t\tvar sensorLoc = details.location;\r\n\t\tvar fullstopIndex1 = sensorLoc.indexOf(\".\");\r\n\t\tvar fullstopIndex2 = sensorLoc.lastIndexOf(\".\");\r\n\t\tvar strLength = sensorLoc.length();\r\n\t\tvar firstWord = sensorLoc.substring(0, fullstopIndex1);\r\n\t\tvar secondWord = sensorLoc.substring(fullstopIndex1 + 1, fullstopIndex2);\r\n\t\tvar thirdWord = sensorLoc.substring(fullstopIndex2 + 1, strLength);\r\n\t\tvar wordsList = List.of(firstWord, secondWord, thirdWord);\r\n\t\treturn wordsList;\r\n\t}", "public Set<String> hyponyms(String word) {\n Set<String> toReturn = new HashSet<String>();\n Set<Integer> wordIndexes = new HashSet<Integer>();\n wordIndexes = wnetsi.get(word);\n Set<Integer> toReturnInt = GraphHelper.descendants(g, wordIndexes);\n Object[] returnArray = toReturnInt.toArray();\n for (int i = 0; i < returnArray.length; i += 1) {\n Set<String> stringReturn = wnetis.get(returnArray[i]);\n Iterator<String> strIter = stringReturn.iterator();\n while (strIter.hasNext()) {\n toReturn.add(strIter.next());\n }\n }\n return toReturn;\n }", "String legalTerms();", "String getSynonyms();", "public ArrayList<String> getWords() {\n return new ArrayList<>(words);\n }", "public List<String> GetKeywords()\n\t{\n\t\tList<String> words = new ArrayList<String>(); \n\t\ttry\n\t\t{\n\t\t\tConnector con = new Connector();\n\t \n\t String query = \"SELECT keyword_kid FROM HasKeywords WHERE keyword_hid = '\"+hid+\"'\"; \n\t ResultSet rs = con.stmt.executeQuery(query); \n\t \n\t List<Integer> k_ids = new ArrayList<Integer>(); \n\t while(rs.next())\n\t {\n\t \tint new_id = rs.getInt(\"keyword_kid\"); \n\t \tk_ids.add(new_id); \n\t }\n\t \n\t for(int i = 0; i < k_ids.size(); i++)\n\t {\n\t \tquery = \"SELECT word FROM Keywords WHERE k_id = '\"+k_ids.get(i)+\"'\"; \n\t \trs = con.stmt.executeQuery(query); \n\t \twhile(rs.next())\n\t \t{\n\t \t\tString kw = rs.getString(\"word\"); \n\t \t\twords.add(kw); \n\t \t}\n\t }\n\t \n\t con.closeConnection();\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\tkeywords = words; \n\t\treturn keywords; \n\t}", "public Iterator words() {\n return index.keySet().iterator();\n }", "public String[] getKeywords() {\n\t\tString t = doc.get(\"keyword\");\n\n\t\tif (t == null || t.trim().length() == 0) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn t.trim().split(\"\\\\+\");\n\t\t}\n\t}", "public void computeWords(){\n\n loadDictionary();\n\n CharacterGrid characterGrid = readCharacterGrid();\n\n Set<String> wordSet = characterGrid.findWordMatchingDictionary(dictionary);\n\n System.out.println(wordSet.size());\n for (String word : wordSet) {\n\t System.out.println(word);\n }\n\n // System.out.println(\"Finish scanning character grid in \" + (System.currentTimeMillis() - startTime) + \" ms\");\n }", "public static void getSynonyms(ArrayList<String> keywords) {\n final String endpoint = \"http://www.dictionaryapi.com/api/v1/references/collegiate/xml/\";\n final String key = \"79b70eee-858c-486a-b155-a44db036bfe0\";\n try {\n for (String keyword : keywords) {\n String url = endpoint + keyword + \"?key=\" + key;\n System.out.print(\"url--\" + url);\n URL obj = new URL(url);\n HttpURLConnection con = (HttpURLConnection) obj.openConnection();\n con.setRequestProperty(\"User-Agent\", USER_AGENT);\n BufferedReader in = new BufferedReader(\n new InputStreamReader(con.getInputStream()));\n String inputLine;\n StringBuffer response = new StringBuffer();\n\n while ((inputLine = in.readLine()) != null) {\n response.append(inputLine);\n }\n in.close();\n\n //print result\n System.out.println(response.toString());\n\n DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n DocumentBuilder builder;\n InputSource is;\n try {\n builder = factory.newDocumentBuilder();\n is = new InputSource(new StringReader(response.toString()));\n Document doc = builder.parse(is);\n NodeList list = doc.getElementsByTagName(\"syn\");\n System.out.println(\"synonyms\" + list.item(0).getTextContent());\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n }", "public String get_all_words_and_definitions(){\n\t\tString found_words = \"\";\n\t\t//We try to find the word within our childs\n\t\tfor(LexiNode child: childs){\n\t\t\t\tfound_words += child.get_all_words_and_definitions();\n\t\t}\n\t\tif(current_word != null && !found_words.equals(\"\"))\n\t\t\treturn current_word +\" & \" + definition + \"\\n\" + found_words ;\n\t\telse if(current_word != null && found_words.equals(\"\"))\n\t\t\treturn current_word +\" & \" + definition + \"\\n\";\n\t\telse //current_word == null && found_words != null\n\t\t\treturn found_words;\n\t}", "private List<String> findSynonyms(String gene,String scope){\n\t\t\n\t\tList<String> li = new ArrayList<String> ();\n\t\t\n\t\tif (this.termSet.contains(gene)){\n\t\t\tfor (String str:this.synonymDictionary.get(gene).get(scope)){\n\t\t\t\tli.add(str);\n\t\t\t};\n\t\t}\n\t\treturn li;\n\t\n\t}", "private static ArrayList<String> getAllKeyWord(String [] lignes){\n ArrayList<String> res= new ArrayList<>();\n\n // La recherche dans le pdf\n for(String ligne : lignes){\n for(String mot : ligne.split(\" |/|-|\\\\(|\\\\)|,\")){\n\n try{\n if(mot.toLowerCase(Locale.ENGLISH).equals(\"c#\".toLowerCase(Locale.ENGLISH)))\n res.add(\"csharp\");\n else\n if(mot.toLowerCase(Locale.ENGLISH).equals(\"c++\".toLowerCase(Locale.ENGLISH)))\n res.add(\"cpp\");\n else\n if(!mot.toLowerCase(Locale.ENGLISH).matches(\"| |à|de|je|un|et|une|en|d'un|d'une|le|la|avec|:|\\\\|\"))\n res.add(mot.toLowerCase(Locale.ENGLISH));\n }catch (IllegalArgumentException e){\n //System.out.println(e.getMessage());\n continue;\n }\n }\n //System.out.println(\"line: \"+s);\n }\n return (ArrayList) res.stream().distinct().collect(Collectors.toList());\n }", "public Set<String> getWords() {\n\t\treturn Collections.unmodifiableSet(this.invertedIndex.keySet());\n\t}", "public static void main(String[] args) {\n\t\tListDictionary dict = new ListDictionary(\"/usr/share/dict/words\");\n\t\tfor (int i = 0; i < args.length; i++) {\n\t\t\tString space = \"\";\n\t\t\tif (args[i].matches(\"[2-9]+\")) {\n\t\t\t\tSystem.out.print(args[i] + \": \");\n\t\t\t\tfor (String element : dict.signatureToWords(args[i])) {\n\t\t\t\t\tSystem.out.print(space + element);\n\t\t\t\t\tspace = \" \";\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t}\n\t\t}\n\t}", "public String[] getParameters(String signature) {\n StringBuilder sb = new StringBuilder();\n String[] tokens = (signature.split(\"\\\\s\"));\n for (int i = 1; i < tokens.length; i++)\n sb.append(tokens[i]);\n String fullParamString = sb.toString().substring(sb.indexOf(\"(\") + 1, sb.indexOf(\")\"));\n String[] params = getParams(fullParamString);\n return params;\n }", "private List<String> getFilteredWords() {\r\n\t\tArrayList<String> filteredWords = new ArrayList<String>(16);\r\n\t\t\r\n\t\tfor (String word : allWords) {\r\n\t\t\tif (matchesFilter(word) == true) {\r\n\t\t\t\tfilteredWords.add(word);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn filteredWords;\r\n\t}", "ImmutableList<SchemaOrgType> getKeywordsList();", "public static Vector<String> getTokenizeDoc(String[] words) {\n\t\t// 0th position is where all the labels are so we need to look from 1\n\t\t// create a arrayList to keep all the words\n\t\tVector<String> wordList = new Vector<String>();\n\t\tfor(int i = 1; i< words.length; i++){\n\t\t\twords[i] = words[i].replaceAll(\"\\\\W\",\"\");\n\t\t\tif(words[i].length() > 0)wordList.add(words[i]);\n\t\t}\n\t\treturn wordList;\n\t}", "public Cursor getWords() \n\t{\n\t\tString query = String.format(_select, getDate()) +\n\t\t\t\t\t\t_havingDataContraint +\n\t\t\t\t\t\t\" ORDER BY \" + DBConstants.WordTable.WORD_KEY;\n\t\t\n\t\treturn _db.rawQuery(query, null);\t\n }", "private List<SearchWord> getSearchWords(Long lastUpdateTime) {\n return new ArrayList<>();\n }", "public Set<String> hyponyms(String word) {\n HashSet<String> set = new HashSet<String>();\n for (Integer id: synsets.keySet()) {\n TreeSet<String> hs = synsets.get(id);\n if (hs.contains(word)) {\n for (String s: hs) {\n set.add(s);\n }\n TreeSet<Integer> ids = new TreeSet<Integer>();\n ids.add(id);\n Set<Integer> desc = GraphHelper.descendants(dg, ids);\n for (Integer i: desc) {\n for (String s: synsets.get(i)) {\n set.add(s);\n }\n }\n }\n }\n return set;\n }", "public ArrayList<String> getWords() {\n return words;\n }", "public Set<String> hyponyms(String word) {\n Set<Integer> synIDs = new TreeSet<Integer>();\n Set<Integer> synKeys = synsetMap.keySet();\n for (Integer id : synKeys) {\n if (synsetMap.get(id).contains(word)) {\n synIDs.add(id);\n }\n }\n Set<Integer> hypIDs = GraphHelper.descendants(g, synIDs);\n Set<String> result = new TreeSet<String>();\n\n for (Integer i : hypIDs) {\n ArrayList<String> al = synsetMap.get(i);\n result.addAll(al);\n }\n return result;\n }", "List<String> getKeywordsForMaterial(int materialId);", "public List<Word> getTextWords(String text) {\n\n List<Word> words = new ArrayList<Word>();\n\n for (Word word : new SentenceParser().getSentenceWords(text)) {\n Collections.addAll(words, word);\n }\n return words;\n }", "private List<String> help(String s, Set<String> wordDict) {\n\t\tList<String> ret = new ArrayList<>();\n\n\t\tif (wordDict.contains(s))\n\t\t\tret.add(s);\n\t\telse\n\t\t\tfor (int i = 0; i < s.length(); i++) {\n\t\t\t\tif (wordDict.contains(s.substring(0, i + 1))) {\n\n//\t\t\t\t\tSystem.out.println(s.substring(0, i + 1));\n\n\t\t\t\t\tList<String> tmp = help(s.substring(i + 1), wordDict);\n\t\t\t\t\tif (tmp.size() > 0) {\n\t\t\t\t\t\tret.add(s.substring(0, i + 1));\n\t\t\t\t\t\tret.addAll(tmp);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\treturn ret;\n\t}", "private List<String> getContextWords(Tree tree) {\r\n List<String> words = null;\r\n if (op.trainOptions.useContextWords) {\r\n words = Generics.newArrayList();\r\n List<Label> leaves = tree.yield();\r\n for (Label word : leaves) {\r\n words.add(word.value());\r\n }\r\n }\r\n return words;\r\n }", "public List<String> getFrequentWords() {\n\t\tif (this.frequentWords == null) {\n\t\t\tSet<String> wordsToReturn = new TreeSet<String>();\n\t\t\tfor (String folder : termFrequencyManager.getTfidfByFolder().keySet()) {\n\t\t\t\tint index = 0;\n\t\t\t\tMap<String, TFIDFSummary> tfidSummaries =\n\t\t\t\t\t\ttermFrequencyManager.getTfidfByFolder().get(folder);\n\t\t\t\tArrayList<TFIDFSummary> tfidfSummariesList = new ArrayList<TFIDFSummary>(tfidSummaries.size());\n\t\t\t\tfor (String term : tfidSummaries.keySet()) {\n\t\t\t\t\ttfidfSummariesList.add(tfidSummaries.get(term));\n\t\t\t\t}\n\t\t\t\tCollections.sort(tfidfSummariesList);\n\n\t\t\t\twhile (index < tfidfSummariesList.size() && index < MAX_NUM_ATTRIBUTES_BY_FOLDER) {\n\t\t\t\t\tTFIDFSummary ts = tfidfSummariesList.get(tfidfSummariesList.size() - 1 - index);\n\t\t\t\t\twordsToReturn.add(ts.getTerm());\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.frequentWords = new ArrayList<String>(wordsToReturn);\n\t\t}\n\t\tSystem.out.println(\"Numero de palabras frecuentes: \" + this.frequentWords.size());\n\t\tfor (String w : frequentWords) System.out.println(\"FreqWord \" + w);\n\t\treturn this.frequentWords;\n\t}", "public List<String> getKeyPhrases() {\n throwExceptionIfError();\n return keyPhrases;\n }", "public List<String> findAllWords(String[] words, String target,int k) {\n List<String> res = new ArrayList<>();\n if(target == null || k < 0) return res;\n TrieNode root = buildTrie(words);\n int[] targetDP = new int[target.length() + 1];\n for(int i = 0; i < targetDP.length; i++) targetDP[i] = i;\n helper(root, \"\", target, targetDP, res, k);\n return res;\n }", "public Set<String> hyponyms(String word) {\n hypernymSet = new TreeSet<String>();\n firstsIDset = new HashSet<Integer>();\n for (String[] synStrings : sFile.values()) {\n for (String synset : synStrings) {\n if (synset.equals(word)) {\n for (String synset2 : synStrings) {\n hypernymSet.add(synset2);\n }\n for (Integer key : sFile.keySet()) {\n if (sFile.get(key).equals(synStrings)) {\n firstsIDset.add(key);\n }\n }\n }\n }\n }\n\n sIDset = GraphHelper.descendants(theDigraph, firstsIDset);\n for (Integer id : sIDset) {\n synsetWordStrings = sFile.get(id);\n for (String word2 : synsetWordStrings) {\n hypernymSet.add(word2);\n }\n }\n return hypernymSet;\n }", "public static ArrayList<String> getKeywords()\r\n\t{\r\n\t\treturn keywords;\r\n\t}", "public ArrayList<String> createWordBank() {\r\n ArrayList<String> wordBank = new ArrayList<String>();\r\n AssetManager assetM = getActivity().getAssets(); // get asset manager to access dictionary file\r\n try {\r\n InputStream is = assetM.open(\"dictionary\"); // open input stream to read dictionary\r\n BufferedReader r = new BufferedReader(new InputStreamReader(is)); // read from input stream\r\n String line;\r\n while ((line = r.readLine()) != null) { // while line is not null\r\n if (line.length() == 9) wordBank.add(line); // take only the 9 letter words\r\n }\r\n } catch (IOException e) {\r\n }\r\n return wordBank;\r\n }", "public Collection<Term> getAll() {\n\t\treturn terms.values();\n\t}", "public List<RIOntoTerm> getRIontoTermsForKeyWord (String keyWord) throws PreferencesException;", "static ArrayList<String> split_words(String s){\n ArrayList<String> words = new ArrayList<>();\n\n Pattern p = Pattern.compile(\"\\\\w+\");\n Matcher match = p.matcher(s);\n while (match.find()) {\n words.add(match.group());\n }\n return words;\n }", "private String[] termsArray(Scanner scan){\r\n\t\tArrayList<String> list = new ArrayList<String>();\r\n\t\twhile (scan.hasNext()) {\r\n\t\t\tlist.add(scan.next());\r\n\t\t}\r\n\t\treturn (String[]) list.toArray(new String[0]);\r\n\t}", "public Set<String> hyponyms(String word) {\n Set<String> hyponyms = new HashSet<String>();\n Set<Integer> ids = new HashSet<Integer>();\n for (Integer key: synsetNouns.keySet()) {\n if (synsetNouns.get(key).contains(word)) {\n ids.add(key);\n }\n }\n Set<Integer> descendants = GraphHelper.descendants(hyponym, ids);\n for (Integer j: descendants) {\n for (String value: synsetNouns.get(j)) {\n hyponyms.add(value);\n }\n }\n return hyponyms;\n }", "public Set<String> getSignatures()\n/* */ {\n/* 150 */ return this.signatures;\n/* */ }", "public String[] getAvailableTokenNames()\n throws SignedDocException;", "String[] getReservedWords();", "private HashSet<String> buildsetofterms(String filename)\r\n\t{\r\n\t\tString readLine, terms[];\r\n HashSet<String> fileTerms = new HashSet<String>();\r\n try \r\n {\r\n BufferedReader reader = new BufferedReader(new FileReader(filename));\r\n while ((readLine = reader.readLine()) != null)\r\n {\r\n terms = (readLine.toLowerCase().replaceAll(\"[.,:;'\\\"]\", \" \").split(\" +\"));\r\n for (String term : terms)\r\n {\r\n if (term.length() > 2 && !term.equals(\"the\"))\r\n fileTerms.add(term);\r\n }\r\n }\r\n }\r\n catch(IOException e){\r\n e.printStackTrace();\r\n }\r\n return fileTerms;\r\n }", "public Term[] getStopWords() {\n List<Term> allStopWords = new ArrayList<Term>();\n for (String fieldName : stopWordsPerField.keySet()) {\n Set<String> stopWords = stopWordsPerField.get(fieldName);\n for (String text : stopWords) {\n allStopWords.add(new Term(fieldName, text));\n }\n }\n return allStopWords.toArray(new Term[allStopWords.size()]);\n\t}", "@Override\n public List<DefinitionDTO> findAllWords() {\n List<Word> words = wordRepository.findAll();\n return DTOMapper.mapWordListToDefinitionDTOList(words);\n }", "public Set<String> hyponyms(String word) {\n HashSet<String> allhyponyms = new HashSet<String>();\n int maxV = synset.size();\n // int maxV = 0;\n // for (Integer i : synset.keySet()) {\n // if (maxV < i) {\n // maxV = i;\n // }\n // }\n // maxV += 1;\n Digraph digraph = new Digraph(maxV);\n\n // ArrayList<Integer> hypoKeys = new ArrayList<Integer>();\n // for (int i = 0; i < hyponym.size(); i++) {\n // hypoKeys.add(hyponym.get(0).get(i));\n // }\n \n for (ArrayList<Integer> a : hyponym) {\n int key = a.get(0);\n for (int j = 1; j < a.size(); j++) {\n digraph.addEdge(key, a.get(j));\n }\n }\n\n // get synonyms (in same synset), ex. given \"jump\", will get \"parachuting\" as well as \"leap\"\n ArrayList<String> strArray = new ArrayList<String>();\n for (Integer k : getSynsetKeys(word)) {\n strArray.addAll(synset.get(k));\n }\n for (String str : strArray) {\n allhyponyms.add(str);\n }\n\n // for each int from set<int> with all synset IDS\n for (Integer s : GraphHelper.descendants(digraph, getSynsetKeys(word))) {\n for (String t : synset.get(s)) {\n allhyponyms.add(t);\n }\n }\n return allhyponyms;\n }", "@Override\n\tpublic Set<String> getWordSet() {\n\t\tlock.lockReadOnly();\n\t\ttry {\n\t\t\treturn super.getWordSet();\n\t\t} finally {\n\t\t\tlock.unlockReadOnly();\n\t\t}\n\t}", "public ArrayList<String> getTerms () throws FileNotFoundException {\n String inputFile = getInputFile();\r\n Scanner scanner = new Scanner (new File (inputFile));\r\n ArrayList<String> terms = new ArrayList<String>();\r\n ArrayList<String> definitions = new ArrayList<String>();\r\n while (scanner.hasNextLine()) {\r\n terms.add(scanner.nextLine()); //took out .toLowerCase() part so it prints correctly \r\n definitions.add(scanner.nextLine());\r\n }\r\n return terms;\r\n }", "private Set<Integer> getSynsetKeys(String word) {\n HashSet<Integer> kset = new HashSet<Integer>();\n\n for (ArrayList<String> o : synsetRev.keySet()) {\n for (String p : o) {\n if (p.equals(word)) {\n kset.add(synsetRev.get(o));\n }\n }\n }\n return kset;\n }", "public List<Map.Entry<String, Integer>> getWordList(){\n\t\treturn new ArrayList<>(GeneralWordCounter.entrySet());\n\t}", "public List<Word> getWordsStartingAt(int start);", "public ArrayList <String> getWordList () {\r\n return words;\r\n }", "public static String wordToSignature(String word){\n\t\tStringBuffer signature = new StringBuffer();\n\t\tfor(int i = 0; i < word.length(); i++){\n\t\t\tchar index = word.charAt(i);\n\t\t\tif(index == 'a' || index == 'b' || index == 'c'||index == 'A' || index == 'B' || index == 'C'){\n\t\t\t\tsignature.append(2);\n\t\t\t} else if(index == 'd'||index=='e'||index =='f'||index == 'D' || index == 'E' || index == 'F'){\n\t\t\t\tsignature.append(3);\n\t\t\t} else if (index =='g'|| index == 'h'|| index =='i'||index == 'G' || index == 'H' || index == 'I'){\n\t\t\t\tsignature.append(4);\n\t\t\t} else if(index =='j'|| index == 'k'|| index == 'l'||index == 'J' || index == 'K' || index == 'L'){\n\t\t\t\tsignature.append(5);\n\t\t\t} else if(index=='m'|| index =='n'|| index =='o'||index == 'M' || index == 'N' || index == 'O'){\n\t\t\t\tsignature.append(6);\n\t\t\t} else if(index == 'p'|| index == 'q' || index =='r'|| index =='s'||index == 'P' || index == 'Q' || index == 'R'||index =='S'){\n\t\t\t\tsignature.append(7);\n\t\t\t} else if(index == 't'|| index == 'u' || index == 'v'||index == 'T' || index == 'U' || index == 'V'){\n\t\t\t\tsignature.append(8);\n\t\t\t} else if(index =='w' || index == 'x' || index == 'y' || index == 'z'||index == 'W' || index == 'X' || index == 'Y'|| index =='Z'){\n\t\t\t\tsignature.append(9);\n\t\t\t}\n\t\t}return signature.toString();\n\t}", "@Override\n\tpublic List<Literature> searchKeywords() {\n\t\treturn null;\n\t}", "public static List<String> GetWordsOnly(String pathToAnnFile) throws FileNotFoundException {\r\n\r\n\r\n List<String> originalList = GetFullAnnotations(pathToAnnFile);\r\n List<String> finalList = new ArrayList<>();\r\n\r\n for (String anno : originalList) {\r\n String[] split_anno = anno.split(\"\\t\"); // split each line\r\n String annoWord = split_anno[2]; // extract word\r\n finalList.add(annoWord); // append word to list\r\n }\r\n return finalList;\r\n }", "private ArrayList<WordDocument> getDocumentsWhereWordExists(String word){\n try{\n return dictionary.get(word).getDocumentWhereWordExistsIn();\n }catch (NullPointerException ex){\n return new ArrayList<WordDocument>();\n }\n }", "private static List<String> getWord(String urlname) {\n\t\tList<String> returnWord = new ArrayList<String>();\n\t\tBufferedReader reader;\n\t\ttry {\n\t\t\tURL url = new URL(urlname);\n\t\t\tInputStream in = url.openStream();\n\t\t\treader = new BufferedReader(new InputStreamReader(in));\n\t\t\twhile (true) {\n\t\t\t\tString word = reader.readLine();\n\t\t\t\tif (word == null)\n\t\t\t\t\tbreak;\n\t\t\t\treturnWord.add(word);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(e.getMessage());\n\t\t}\n\t\treturn returnWord;\n\t}", "public List<String> findAllSynonyms(String gene){\n\t\tList<String> synonyms = new ArrayList<String> ();\n\t\tif (this.termSet.contains(gene)){\n\t\t\tMap<String,List<String>> geneSynonyms = this.synonymDictionary.get(gene);\n\t\t\tSet<String> keys = geneSynonyms.keySet();\n\t\t\tfor(String k:keys){\n\t\t\t\tList<String> subList = geneSynonyms.get(k);\n\t\t\t\tfor(String s:subList){\n\t\t\t\t\tsynonyms.add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn synonyms;\n\t}", "public String search_words(String word){\n\t\tString found_words = \"\";\n\t\t//We try to find the word within our childs\n\t\tfor(LexiNode child: childs)\n\t\t\tif(word.toLowerCase().charAt(0) == Character.toLowerCase(child.getRepresentative_letter()))\n\t\t\t\tfound_words += child.search_words(word, 0);\n\t\t\n\t\treturn found_words;\n\t}", "public List<Term> getAllTermsByDictionary(String table, String dictionary) {\n List<Term> termList = new ArrayList<Term>();\n\n // Select All Query\n String selectQuery = \"SELECT * FROM \" + table + \" WHERE \" + KEY_DICTIONARY + \" = '\" + dictionary + \"' ORDER BY \" + KEY_TERM;\n\n SQLiteDatabase db = this.getWritableDatabase();\n Cursor cursor = db.rawQuery(selectQuery, null);\n\n // looping through all rows and adding to list\n if (cursor.moveToFirst()) {\n do {\n if (!cursor.getString(2).isEmpty()) {\n /*\n Term term = new Term();\n term.setId(Integer.parseInt(cursor.getString(0)));\n term.setDictionary(cursor.getString(1));\n term.setTerm(cursor.getString(2));\n term.setSubject(cursor.getString(3));\n term.setDefinition(cursor.getString(4));\n term.setSynonyms(cursor.getString(5));\n */\n Term term = new Term(Integer.parseInt(cursor.getString(0)),cursor.getString(1), cursor.getString(2), cursor.getString(3),\n cursor.getString(4), cursor.getString(5), Integer.parseInt(cursor.getString(6)));\n // Adding term to list\n termList.add(term);\n }\n } while (cursor.moveToNext());\n }\n\n // return term list\n return termList;\n }", "List<FraseEntidade> getPhrasesByAuthorName(String name);", "public Vector<Word> allKeyValue(){\n\n\tVector<Word> words = new Vector<Word>();\n\tfor(int w = 0; w < theTable.length; w++){\n\t // System.out.println(\"w: \" + w);\n\t // System.out.println(\"theTable[w]: \" + theTable[w]);\n\t if(theTable[w] != null){\n\t\twords.addElement(theTable[w]);\n\t }\n\t}\n\treturn words;\n }", "Stream<CharSequence> toWords(CharSequence sentence);", "public List<String> extractIllnesses(String description) {\n\t\tList<String> newSentences = this.getSentences(description);\n\t\t\n\t\t// For each sentence, generate valid word sequences\n\t\tList<String> allValidWordSequences = new ArrayList<String>();\n\t\tnewSentences.forEach(s -> allValidWordSequences.addAll(this.getWordCombinations(s)));\n\n\t\tSicknessMap medicalRecords = SicknessMap.getInstance();\n\t\tList<String> results = allValidWordSequences.stream()\n\t\t\t\t.filter(potentialIllness -> medicalRecords.contains(potentialIllness))\n\t\t\t\t.map(actualIllness -> medicalRecords.getByKey(actualIllness))\n\t\t\t\t.collect(Collectors.toList());\n\t\treturn results;\n\t}", "public Set<String> getWordsFromWordPOSByPOSs(Set<String> POSTags) {\n\t\tSet<String> words = new HashSet<String>();\n\n\t\tif (POSTags == null) {\n\t\t\treturn words;\n\t\t}\n\n\t\tIterator<Entry<WordPOSKey, WordPOSValue>> iter = this\n\t\t\t\t.getWordPOSHolderIterator();\n\n\t\twhile (iter.hasNext()) {\n\t\t\tEntry<WordPOSKey, WordPOSValue> wordPOSEntry = iter.next();\n\t\t\tString POS = wordPOSEntry.getKey().getPOS();\n\t\t\tif (POSTags.contains(POS)) {\n\t\t\t\tString word = wordPOSEntry.getKey().getWord();\n\t\t\t\twords.add(word);\n\t\t\t}\n\t\t}\n\n\t\treturn words;\n\t}", "private static String[] getKeywords(String[] args) {\n String[] keywords = new String[args.length - 2];\n for (int i = 2; i < args.length; i++) {\n keywords[i - 2] = args[i].toLowerCase();\n }\n return keywords;\n }", "public String [] get_word_array(){\n\t\treturn word_array;\n\t}", "public Term[] getTerms() { return terms; }", "public static String getWords(String fileName){\n\t\tString result = null;\n\t\ttry {\n\t\t\tFileInputStream fin = new FileInputStream(fileName);\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(fin));\n\t\t\t\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tString line = br.readLine();\n\t\t\t\n\t\t\twhile(line != null){\n\t\t\t\tsb.append(line);\n\t\t\t\tline = br.readLine();\n\t\t\t}\n\t\t\tbr.close();\n\t\t\tresult = Utils.removeStopWords(sb.toString());\n\t\t\treturn result;\n\t\t} \n\t\tcatch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\treturn result;\n\t\t}\n\t}", "private ISet<String> getKeySet(IList<String> words) {\n\t\tISet<String> keySet = new ChainedHashSet<String>();\n\t\tfor (String word: words) {\n\t\t\tkeySet.add(word);\n\t\t}\n\t\treturn keySet;\n }", "public String getKeywords()\r\n {\r\n return (m_keywords);\r\n }", "public List<String> findWords(String prefix){\n // Auto Completion\n\n // c\n // a\n // r - findLastNodeOf('car') , word.add('car') cause root.isEndOfWord=true\n // word.add('card') d e\n // isEndOfWord=true f\n // u\n // l word.add('careful'), isEndOfWord=true\n List<String> words = new ArrayList<>();\n var lastNode = findLastNodeOf(prefix);\n //start recursion\n findWords(lastNode,prefix,words);\n return words;\n }", "@Override\r\n\t\t\tpublic String[] getTerms(Document doc) {\n\t\t\t\treturn null;\r\n\t\t\t}", "java.lang.String getSignatureText();", "public static Map<String, String> listTokenFromCSP()\r\n\t\t\tthrows BkavSignaturesException {\r\n\t\tMap<String, String> result = new HashMap<>();\r\n\t\ttry {\r\n\t\t\tSunMSCAPI providerMSCAPI = new SunMSCAPI();\r\n\t\t\tSecurity.addProvider(providerMSCAPI);\r\n\t\t\tKeyStore ks = KeyStore.getInstance(CSP_KEYSTORE);\r\n\t\t\tks.load(null, null);\r\n\r\n\t\t\tEnumeration<String> aliases = ks.aliases();\r\n\t\t\tString alias = null;\r\n\r\n\t\t\twhile (aliases.hasMoreElements()) {\r\n\t\t\t\talias = aliases.nextElement();\r\n\t\t\t\tCertificate cert = ks.getCertificate(alias);\r\n\t\t\t\tif (cert instanceof X509Certificate) {\r\n\t\t\t\t\tX509Certificate x509Cert = (X509Certificate) cert;\r\n\t\t\t\t\tString certSerial = x509Cert.getSerialNumber().toString(16);\r\n\r\n\t\t\t\t\tString subjectDN = x509Cert.getSubjectDN().getName();\r\n\t\t\t\t\tString author = \"\";\r\n\t\t\t\t\tLdapName ldap;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tldap = new LdapName(subjectDN);\r\n\t\t\t\t\t\tfor (Rdn rdn : ldap.getRdns()) {\r\n\t\t\t\t\t\t\tif (\"CN\".equalsIgnoreCase(rdn.getType())) {\r\n\t\t\t\t\t\t\t\tauthor = rdn.getValue().toString();\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} catch (InvalidNameException e) {\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresult.put(certSerial, author);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (KeyStoreException e) {\r\n\t\t\tthrow new BkavSignaturesException(\"KeyStoreException\", e);\r\n\t\t} catch (NoSuchAlgorithmException e) {\r\n\t\t\tthrow new BkavSignaturesException(\"NoSuchAlgorithmException\", e);\r\n\t\t} catch (CertificateException e) {\r\n\t\t\tthrow new BkavSignaturesException(\"CertificateException\", e);\r\n\t\t} catch (IOException e) {\r\n\t\t\tthrow new BkavSignaturesException(\"IOException\", e);\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}", "@SuppressWarnings({ \"deprecation\", \"unchecked\", \"rawtypes\" })\n\tpublic String generateWordlists(Corpus co) {\n\t\tlong startTime = System.currentTimeMillis();\n\t\t// Set up weka word vector\n\t\tFastVector attributes;\n\t\tInstances dataSet;\n\t\tattributes = new FastVector();\n\n\t\tattributes.addElement(new Attribute(\"aspect_id\", (FastVector) null));\n\t\tattributes.addElement(new Attribute(\"tokens\", (FastVector) null));\n\n\t\tdataSet = new Instances(\"BeerAspects\", attributes, 0);\n\n\t\tCorpus topReviews;\n\t\tCorpus lowReviews;\n\n\t\t// Do top and low for all aspects\n\t\tfor (Aspect aspect : Aspect.values()) {\n\n\t\t\t// Only for actual aspects\n\t\t\tif (aspect.equals(Aspect.NONE) || aspect.equals(Aspect.OVERALL))\n\t\t\t\tcontinue;\n\n\t\t\ttopReviews = co.getTopReviews(aspect);\n\t\t\ttopReviews.analyze();\n\t\t\tString tokens = topReviews.getTokenConcatenation(aspect);\n\n\t\t\tInstance instance = new SparseInstance(2);\n\t\t\tinstance.setValue((Attribute) attributes.elementAt(0), aspect.name() + \"_TOP\");\n\t\t\tinstance.setValue((Attribute) attributes.elementAt(1), tokens);\n\n\t\t\tdataSet.add(instance);\n\n\t\t\tlowReviews = co.getLowReviews(aspect);\n\t\t\tlowReviews.analyze();\n\t\t\ttokens = lowReviews.getTokenConcatenation(aspect);\n\t\t\t// System.out.println(tokens);\n\n\t\t\tinstance = new SparseInstance(2);\n\t\t\tinstance.setValue((Attribute) attributes.elementAt(0), aspect.name() + \"_LOW\");\n\t\t\tinstance.setValue((Attribute) attributes.elementAt(1), tokens);\n\n\t\t\tdataSet.add(instance);\n\t\t}\n\n\t\t// System.out.println(dataSet.toString());\n\t\tInstances dataFiltered = transformToWordVector(dataSet, co.getProps());\n\n\t\t// System.out.println(dataFiltered.toString());\n\t\tString pathsToLists = writeWordlists(dataFiltered);\n\n\t\twriteArffFile(dataFiltered, this.outputDir+\"wordvector.arff\");\n\n\t\tlong stopTime = System.currentTimeMillis();\n\t\tlong elapsedTime = stopTime - startTime;\n\t\tSystem.out.println(\"Generated wordlists in: \" + elapsedTime / 1000 + \" s\");\n\t\treturn pathsToLists;\n\t}", "public Map<String, Integer> getWords()\n {\n return (Map<String, Integer>) getStateHelper().eval(PropertyKeys.words, null);\n }", "List<String> getTokens();", "public Set<String> getAllKnownWords() throws IOException {\n log.info(\"Reading all data to build known words set.\");\n Set<String> words = new HashSet<>();\n if (this.hasTrain()) {\n for (AnnoSentence sent : getTrainInput()) {\n words.addAll(sent.getWords());\n }\n }\n if (this.hasDev()) {\n for (AnnoSentence sent : getDevInput()) {\n words.addAll(sent.getWords());\n }\n }\n if (this.hasTest()) {\n for (AnnoSentence sent : getTestInput()) {\n words.addAll(sent.getWords());\n }\n }\n return words;\n }", "private String[] getKeywordsFromBar()\n {\n String text = keywordBar.getText();\n \n if(text.equals(\"\")) return null;\n else return text.split(\"\\\\s*,\\\\s*\");\n }", "java.lang.String getWord();", "public PublicKey[] getPeopleInConvo (String sig) {\n Logger.write(\"VERBOSE\", \"DB\", \"getPeopleInConvo(...)\");\n Vector<PublicKey> keys = new Vector<PublicKey>();\n \n try {\n ResultSet keySet = query(DBStrings.getConversationMembers.replace(\"__SIG__\", sig));\n while (keySet.next())\n keys.add(Crypto.decodeKey(keySet.getString(\"key\")));\n } catch (java.sql.SQLException e) {\n Logger.write(\"ERROR\", \"DB\", \"SQLException: \" + e);\n }\n \n return keys.toArray(new PublicKey[0]);\n }" ]
[ "0.79413116", "0.7929594", "0.7601417", "0.73435044", "0.71207607", "0.69304264", "0.6044577", "0.59158635", "0.58998233", "0.5800664", "0.5684714", "0.5638704", "0.5629627", "0.55754113", "0.5573807", "0.5549139", "0.55466807", "0.55140454", "0.55041265", "0.5421715", "0.54045695", "0.5360631", "0.53533393", "0.5348308", "0.5344417", "0.5343823", "0.53420806", "0.5318428", "0.53091884", "0.5304929", "0.5304363", "0.52995795", "0.5299423", "0.5283962", "0.5280472", "0.52757376", "0.5265439", "0.52573335", "0.52537817", "0.52313197", "0.5203841", "0.5197754", "0.5195319", "0.51807094", "0.51699585", "0.5169446", "0.5144651", "0.51372886", "0.51306957", "0.512941", "0.51226956", "0.5118927", "0.5117397", "0.50992215", "0.50965345", "0.50949067", "0.5082606", "0.50813127", "0.50811404", "0.507906", "0.5068273", "0.5061105", "0.5058412", "0.5057421", "0.5051882", "0.5049197", "0.50441116", "0.50195765", "0.5013648", "0.50097096", "0.50013274", "0.5000419", "0.49930945", "0.49929366", "0.49925306", "0.49839294", "0.4980134", "0.49666524", "0.49666467", "0.49546424", "0.4952857", "0.49503744", "0.49470207", "0.4945892", "0.49447894", "0.49403477", "0.4927167", "0.49184862", "0.491241", "0.49099308", "0.49079183", "0.490403", "0.48994207", "0.48979405", "0.48951548", "0.4887191", "0.48860896", "0.4883311", "0.48791423", "0.4876071" ]
0.7737322
2
Replace the android default class loader
void injectorClassLoader() { //To get the package name String pkgName = context.getPackageName(); //To get the context Context contextImpl = ((ContextWrapper) context).getBaseContext(); //Access to the Activity of the main thread Object activityThread = null; try { activityThread = Reflection.getField(contextImpl, "mMainThread"); } catch (Exception e) { e.printStackTrace(); } //Get package container Map mPackages = null; try { mPackages = (Map) Reflection.getField(activityThread, "mPackages"); } catch (Exception e) { e.printStackTrace(); } //To obtain a weak reference object, the standard reflection WeakReference weakReference = (WeakReference) mPackages.get(pkgName); if (weakReference == null) { log.e("loadedApk is null"); } else { //Get apk need to be loaded Object loadedApk = weakReference.get(); if (loadedApk == null) { log.e("loadedApk is null"); return; } if (appClassLoader == null) { //Access to the original class loader ClassLoader old = null; try { old = (ClassLoader) Reflection.getField(loadedApk, "mClassLoader"); } catch (Exception e) { e.printStackTrace(); } //According to the default class loader instantiate a plug-in class loader appClassLoader = new SyknetAppClassLoader(old, this); } //Replace the new plug-in loader loader by default try { Reflection.setField(loadedApk, "mClassLoader", appClassLoader); } catch (Exception e) { e.printStackTrace(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static AndroidNClassLoader createAndroidNClassLoader(PathClassLoader original, Application application) throws Exception {\n AndroidNClassLoader androidNClassLoader = new AndroidNClassLoader(\"\", original, application);\n Field originPathList = ShareReflectUtil.findField(original, \"pathList\");\n Object originPathListObject = originPathList.get(original);\n //should reflect definingContext also\n Field originClassloader = ShareReflectUtil.findField(originPathListObject, \"definingContext\");\n originClassloader.set(originPathListObject, androidNClassLoader);\n //copy pathList\n Field pathListField = ShareReflectUtil.findField(androidNClassLoader, \"pathList\");\n //just use PathClassloader's pathList\n pathListField.set(androidNClassLoader, originPathListObject);\n\n //we must recreate dexFile due to dexCache\n List<File> additionalClassPathEntries = new ArrayList<>();\n Field dexElement = ShareReflectUtil.findField(originPathListObject, \"dexElements\");\n Object[] originDexElements = (Object[]) dexElement.get(originPathListObject);\n for (Object element : originDexElements) {\n DexFile dexFile = (DexFile) ShareReflectUtil.findField(element, \"dexFile\").get(element);\n if (dexFile == null) {\n continue;\n }\n additionalClassPathEntries.add(new File(dexFile.getName()));\n //protect for java.lang.AssertionError: Failed to close dex file in finalizer.\n oldDexFiles.add(dexFile);\n }\n Method makePathElements = ShareReflectUtil.findMethod(originPathListObject, \"makePathElements\", List.class, File.class,\n List.class);\n ArrayList<IOException> suppressedExceptions = new ArrayList<>();\n Object[] newDexElements = (Object[]) makePathElements.invoke(originPathListObject, additionalClassPathEntries, null, suppressedExceptions);\n dexElement.set(originPathListObject, newDexElements);\n\n try {\n Class.forName(CHECK_CLASSLOADER_CLASS, true, androidNClassLoader);\n } catch (Throwable thr) {\n Log.e(TAG, \"load TinkerTestAndroidNClassLoader fail, try to fixDexElementsForProtectedApp\");\n fixDexElementsForProtectedApp(application, newDexElements);\n }\n\n return androidNClassLoader;\n }", "public Class<?> loadClass(String str, boolean z) throws ClassNotFoundException {\n if (str.startsWith(BuildConfig.APPLICATION_ID) || str.startsWith(\"android\") || str.startsWith(\"external\") || str.startsWith(\"me.weishu.epic.art\") || str.startsWith(\"com.taobao.android.dexposed\")) {\n return this.mHostClassLoader.loadClass(str);\n }\n return super.loadClass(str, z);\n }", "protected ClassLoader(ClassLoader parent) {\r\n if (parent == null) {\r\n if (!getClass().equals(Launcher.ExtClassLoader.class)) {\r\n this.parent = getSystemClassLoader();\r\n } else {\r\n this.parent = null;\r\n }\r\n } else {\r\n this.parent = parent;\r\n }\r\n RefNative.initNativeClassLoader(this, parent);\r\n }", "void resetClassLoader (boolean forAdjunct) {\r\n synchronized (classLoaderLock) {\r\n if (classLoader == null) {\r\n return;\r\n }\r\n if (forAdjunct) {\r\n classLoader = CALClassLoader.resetAdjunctClasses(classLoader);\r\n } else {\r\n // Simply discard the class loader. This will unload all classes in the module\r\n // and adjunct.\r\n classLoader = null;\r\n }\r\n }\r\n }", "@Override\n public ClassLoader getClassLoader() {\n return null;\n }", "private void initClassloaders() {\n\t\tthis.commonloader = createClassloader(\"common\",null);\n\t\tthis.sharedloader = createClassloader(\"shared\", commonloader);\n\t\tthis.catalinaloader = createClassloader(\"server\", commonloader);\n\t}", "@Override\n public Loader getClassLoader() {\n\treturn this.classLoader;\n }", "boolean isForceClassLoaderReset();", "private void loadClasses() {\n\t\tString[] classes = new String[] { \"com.sssprog.delicious.api.ApiAsyncTask\" };\n\t\tfor (String c : classes) {\n\t\t\ttry {\n\t\t\t\tClass.forName(c);\n\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "ClassLoader getNewTempClassLoader() {\n return new ClassLoader(getClassLoader()) {\n };\n }", "public IClassLoader getClassLoader();", "private void loadClassesFromJar(final String runnableID, final File jarfile) {\n \n mTaskCache.get(runnableID).taskClasses = new LinkedList<Class>();\n \n Log.i(TAG,\n \"XXX: Calling DexClassLoader with jarfile: \" + jarfile.getAbsolutePath());\n final File tmpDir = mContext.getDir(\"dex\", 0);\n \n mTaskCache.get(runnableID).classLoader = new DexClassLoader(\n jarfile.getAbsolutePath(),\n tmpDir.getAbsolutePath(),\n null,\n BackgroundService.class.getClassLoader());\n // mTaskCache.get(mCurrentRunnableID).classLoader = mTaskCache.get(runnableID).classLoader;\n // setRunnableID(runnableID); \n \n // load all available classes\n String path = jarfile.getPath();\n \n \n try {\n // load dexfile\n DexFile dx = DexFile.loadDex(\n path,\n File.createTempFile(\"opt\", \"dex\", mContext.getCacheDir()).getPath(),\n 0);\n \n // extract all available classes\n for (Enumeration<String> classNames = dx.entries(); classNames.hasMoreElements();) {\n String className = classNames.nextElement();\n Log.i(TAG, String.format(\"found class: %s\", className));\n try {\n // TODO: do only forName() here?\n // final Class<Object> loadedClass = (Class<Object>) mClassLoaderWrapper.get().loadClass(className);\n final Class<Object> loadedClass = (Class<Object>) mTaskCache.get(runnableID).classLoader.loadClass(className);\n Log.i(TAG, String.format(\"Loaded class: %s\", className));\n // add associated classes to task class list\n if (loadedClass == null) {\n Log.e(TAG, \"EEEEEE loadedClass is null\");\n }\n if (mTaskCache.get(runnableID) == null) {\n Log.e(TAG, \"EEEEEE no mapentry found\");\n }\n if (mTaskCache.get(runnableID).taskClasses == null) {\n Log.e(TAG, \"EEEEEE taskClasses empty\");\n }\n mTaskCache.get(runnableID).taskClasses.add(loadedClass);\n // add task class to task list\n if (DistributedRunnable.class.isAssignableFrom(loadedClass)) {\n mTaskCache.get(runnableID).taskClass = loadedClass;\n }\n }\n catch (ClassNotFoundException ex) {\n Log.getStackTraceString(ex);\n }\n }\n }\n catch (IOException e) {\n System.out.println(\"Error opening \" + path);\n }\n // notify listeners\n for (JobCenterHandler handler : mHandlerList) {\n handler.onBinaryReceived(runnableID);\n }\n }", "private static ClassLoader getClassLoader() {\n return LoggerProviders.class.getClassLoader();\n }", "public static void loadClass(String name) {\n\n }", "private ClassLoader getClassLoader() {\r\n return this.getClass().getClassLoader();\r\n }", "public ClassLoader getClassLoader () { return _classLoader; }", "public Class<?> initializeClassLoader(Class<?> clazz, ClassLoaderSystem system, ClassLoaderPolicy policy)\n {\n return initializeClassLoader(clazz, system, policy, getParentPackages());\n }", "private static void zza(java.lang.ClassLoader r3) throws com.google.android.gms.dynamite.DynamiteModule.zzc {\n /*\n r0 = 0\n java.lang.String r1 = \"com.google.android.gms.dynamiteloader.DynamiteLoaderV2\"\n java.lang.Class r3 = r3.loadClass(r1) // Catch:{ ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException -> 0x0031 }\n r1 = 0\n java.lang.Class[] r2 = new java.lang.Class[r1] // Catch:{ ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException -> 0x0031 }\n java.lang.reflect.Constructor r3 = r3.getConstructor(r2) // Catch:{ ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException -> 0x0031 }\n java.lang.Object[] r1 = new java.lang.Object[r1] // Catch:{ ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException -> 0x0031 }\n java.lang.Object r3 = r3.newInstance(r1) // Catch:{ ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException -> 0x0031 }\n android.os.IBinder r3 = (android.os.IBinder) r3 // Catch:{ ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException -> 0x0031 }\n if (r3 != 0) goto L_0x001a\n r3 = r0\n goto L_0x002e\n L_0x001a:\n java.lang.String r1 = \"com.google.android.gms.dynamite.IDynamiteLoaderV2\"\n android.os.IInterface r1 = r3.queryLocalInterface(r1) // Catch:{ ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException -> 0x0031 }\n boolean r2 = r1 instanceof com.google.android.gms.dynamite.zzl // Catch:{ ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException -> 0x0031 }\n if (r2 == 0) goto L_0x0028\n r3 = r1\n com.google.android.gms.dynamite.zzl r3 = (com.google.android.gms.dynamite.zzl) r3 // Catch:{ ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException -> 0x0031 }\n goto L_0x002e\n L_0x0028:\n com.google.android.gms.dynamite.zzm r1 = new com.google.android.gms.dynamite.zzm // Catch:{ ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException -> 0x0031 }\n r1.<init>(r3) // Catch:{ ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException -> 0x0031 }\n r3 = r1\n L_0x002e:\n zzaSH = r3 // Catch:{ ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException -> 0x0031 }\n return\n L_0x0031:\n r3 = move-exception\n com.google.android.gms.dynamite.DynamiteModule$zzc r1 = new com.google.android.gms.dynamite.DynamiteModule$zzc\n java.lang.String r2 = \"Failed to instantiate dynamite loader\"\n r1.<init>(r2, r3, r0)\n throw r1\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.dynamite.DynamiteModule.zza(java.lang.ClassLoader):void\");\n }", "void addClassLoader(ClassLoader cl);", "private static native void initCachedClassMap();", "protected ClassLoader getClassLoader()\n {\n return m_classLoader;\n }", "LiveClassLoader()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tthis.defineClassMethod = ClassLoader.class.getDeclaredMethod(\"defineClass\", String.class, byte[].class, int.class, int.class);\r\n\t\t\tthis.defineClassMethod.setAccessible(true);\r\n\t\t}\r\n\t\tcatch (NoSuchMethodException | SecurityException e)\r\n\t\t{\r\n\t\t\t// TODO: debug..\r\n\t\t\tSystem.out.println(\"CLASS LOADER >> Erro ao recuperar o metodo 'ClassLoader.defineClass()'!\");\r\n\t\t\t\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "ClassLoader getClassLoader() throws GeDARuntimeException;", "AndroidFactory getAndroidFactory();", "public Class<?> initializeClassLoader(Class<?> clazz, ClassLoaderPolicy policy)\n {\n ClassLoaderSystem system = new DefaultClassLoaderSystem();\n return initializeClassLoader(clazz, system, policy, getParentPackages());\n }", "public void initClassLoader() {\n FileClassLoadingService classLoader = new FileClassLoadingService();\n\n // init from preferences...\n Domain classLoaderDomain = getPreferenceDomain().getSubdomain(\n FileClassLoadingService.class);\n\n Collection details = classLoaderDomain.getPreferences();\n if (details.size() > 0) {\n\n // transform preference to file...\n Transformer transformer = new Transformer() {\n\n public Object transform(Object object) {\n DomainPreference pref = (DomainPreference) object;\n return new File(pref.getKey());\n }\n };\n\n classLoader.setPathFiles(CollectionUtils.collect(details, transformer));\n }\n\n this.modelerClassLoader = classLoader;\n }", "static Downloader m61430a(Context context) {\n try {\n Class.forName(\"com.squareup.okhttp.OkHttpClient\");\n return C18811c.m61450a(context);\n } catch (ClassNotFoundException unused) {\n return new C18803ab(context);\n }\n }", "public String getSharedLoader(IPath baseDir);", "public Class<?> initializeClassLoader(Class<?> clazz, ClassLoaderSystem system, ClassFilter parentFilter, ClassLoaderPolicy policy)\n {\n Set<String> parentPackages = getParentPackages();\n String[] parentPkgs = parentPackages.toArray(new String[parentPackages.size()]);\n PackageClassFilter filter = new PackageClassFilter(parentPkgs);\n filter.setIncludeJava(true);\n CombiningClassFilter beforeFilter = CombiningClassFilter.create(filter, parentFilter);\n ParentPolicy parentPolicy = new ParentPolicy(beforeFilter, ClassFilterUtils.NOTHING);\n return initializeClassLoader(clazz, system, parentPolicy, policy);\n }", "public static ClassLoader getDefaultClassLoader() {\n ClassLoader cl = null;\n try {\n cl = Thread.currentThread().getContextClassLoader();\n } finally {\n if (cl == null) {\n cl = ClassUtils.class.getClassLoader();\n }\n if (cl == null) {\n cl = ClassLoader.getSystemClassLoader();\n }\n }\n return cl;\n }", "protected void setUpClassloader() throws Exception\n {\n threadContextClassLoader = Thread.currentThread()\n .getContextClassLoader();\n Thread.currentThread()\n .setContextClassLoader(\n new URLClassLoader(new URL[0], this.getClass()\n .getClassLoader()));\n classLoaderSet = true;\n }", "public Class<?> initializeClassLoader(Class<?> clazz, ClassLoaderSystem system, ClassLoaderPolicy policy, String... parentPackages)\n {\n // The parent filter\n PackageClassFilter filter = new PackageClassFilter(parentPackages);\n filter.setIncludeJava(true);\n return initializeClassLoader(clazz, system, filter, ClassFilterUtils.NOTHING, policy);\n }", "private NativeLibraryLoader() {\n }", "public static synchronized void initNativeLibs(android.content.Context r6) {\n /*\n r2 = org.telegram.messenger.NativeLoader.class;\n monitor-enter(r2);\n r0 = nativeLoaded;\t Catch:{ all -> 0x00d1 }\n if (r0 == 0) goto L_0x0009;\n L_0x0007:\n monitor-exit(r2);\n return;\n L_0x0009:\n net.hockeyapp.android.C2367a.m11720a(r6);\t Catch:{ all -> 0x00d1 }\n r0 = android.os.Build.CPU_ABI;\t Catch:{ Exception -> 0x0122 }\n r1 = \"armeabi-v7a\";\n r0 = r0.equalsIgnoreCase(r1);\t Catch:{ Exception -> 0x0122 }\n if (r0 == 0) goto L_0x00d4;\n L_0x0017:\n r0 = \"armeabi-v7a\";\n L_0x001a:\n r1 = \"os.arch\";\n r1 = java.lang.System.getProperty(r1);\t Catch:{ Throwable -> 0x012b }\n if (r1 == 0) goto L_0x0130;\n L_0x0023:\n r3 = \"686\";\n r1 = r1.contains(r3);\t Catch:{ Throwable -> 0x012b }\n if (r1 == 0) goto L_0x0130;\n L_0x002c:\n r0 = \"x86\";\n r1 = r0;\n L_0x0030:\n r0 = getNativeLibraryDir(r6);\t Catch:{ Throwable -> 0x012b }\n if (r0 == 0) goto L_0x005f;\n L_0x0036:\n r3 = new java.io.File;\t Catch:{ Throwable -> 0x012b }\n r4 = \"libtmessages.27.so\";\n r3.<init>(r0, r4);\t Catch:{ Throwable -> 0x012b }\n r0 = r3.exists();\t Catch:{ Throwable -> 0x012b }\n if (r0 == 0) goto L_0x005f;\n L_0x0044:\n r0 = \"load normal lib\";\n org.telegram.messenger.FileLog.m13725d(r0);\t Catch:{ Throwable -> 0x012b }\n r0 = \"tmessages.27\";\n java.lang.System.loadLibrary(r0);\t Catch:{ Error -> 0x005b }\n r0 = net.hockeyapp.android.C2367a.f7955a;\t Catch:{ Error -> 0x005b }\n r3 = org.telegram.messenger.BuildVars.DEBUG_VERSION;\t Catch:{ Error -> 0x005b }\n init(r0, r3);\t Catch:{ Error -> 0x005b }\n r0 = 1;\n nativeLoaded = r0;\t Catch:{ Error -> 0x005b }\n goto L_0x0007;\n L_0x005b:\n r0 = move-exception;\n org.telegram.messenger.FileLog.m13728e(r0);\t Catch:{ Throwable -> 0x012b }\n L_0x005f:\n r3 = new java.io.File;\t Catch:{ Throwable -> 0x012b }\n r0 = r6.getFilesDir();\t Catch:{ Throwable -> 0x012b }\n r4 = \"lib\";\n r3.<init>(r0, r4);\t Catch:{ Throwable -> 0x012b }\n r3.mkdirs();\t Catch:{ Throwable -> 0x012b }\n r4 = new java.io.File;\t Catch:{ Throwable -> 0x012b }\n r0 = \"libtmessages.27loc.so\";\n r4.<init>(r3, r0);\t Catch:{ Throwable -> 0x012b }\n r0 = r4.exists();\t Catch:{ Throwable -> 0x012b }\n if (r0 == 0) goto L_0x009c;\n L_0x007c:\n r0 = \"Load local lib\";\n org.telegram.messenger.FileLog.m13725d(r0);\t Catch:{ Error -> 0x0095 }\n r0 = r4.getAbsolutePath();\t Catch:{ Error -> 0x0095 }\n java.lang.System.load(r0);\t Catch:{ Error -> 0x0095 }\n r0 = net.hockeyapp.android.C2367a.f7955a;\t Catch:{ Error -> 0x0095 }\n r5 = org.telegram.messenger.BuildVars.DEBUG_VERSION;\t Catch:{ Error -> 0x0095 }\n init(r0, r5);\t Catch:{ Error -> 0x0095 }\n r0 = 1;\n nativeLoaded = r0;\t Catch:{ Error -> 0x0095 }\n goto L_0x0007;\n L_0x0095:\n r0 = move-exception;\n org.telegram.messenger.FileLog.m13728e(r0);\t Catch:{ Throwable -> 0x012b }\n r4.delete();\t Catch:{ Throwable -> 0x012b }\n L_0x009c:\n r0 = new java.lang.StringBuilder;\t Catch:{ Throwable -> 0x012b }\n r0.<init>();\t Catch:{ Throwable -> 0x012b }\n r5 = \"Library not found, arch = \";\n r0 = r0.append(r5);\t Catch:{ Throwable -> 0x012b }\n r0 = r0.append(r1);\t Catch:{ Throwable -> 0x012b }\n r0 = r0.toString();\t Catch:{ Throwable -> 0x012b }\n org.telegram.messenger.FileLog.m13726e(r0);\t Catch:{ Throwable -> 0x012b }\n r0 = loadFromZip(r6, r3, r4, r1);\t Catch:{ Throwable -> 0x012b }\n if (r0 != 0) goto L_0x0007;\n L_0x00b9:\n r0 = \"tmessages.27\";\n java.lang.System.loadLibrary(r0);\t Catch:{ Error -> 0x00cb }\n r0 = net.hockeyapp.android.C2367a.f7955a;\t Catch:{ Error -> 0x00cb }\n r1 = org.telegram.messenger.BuildVars.DEBUG_VERSION;\t Catch:{ Error -> 0x00cb }\n init(r0, r1);\t Catch:{ Error -> 0x00cb }\n r0 = 1;\n nativeLoaded = r0;\t Catch:{ Error -> 0x00cb }\n goto L_0x0007;\n L_0x00cb:\n r0 = move-exception;\n org.telegram.messenger.FileLog.m13728e(r0);\t Catch:{ all -> 0x00d1 }\n goto L_0x0007;\n L_0x00d1:\n r0 = move-exception;\n monitor-exit(r2);\n throw r0;\n L_0x00d4:\n r0 = android.os.Build.CPU_ABI;\t Catch:{ Exception -> 0x0122 }\n r1 = \"armeabi\";\n r0 = r0.equalsIgnoreCase(r1);\t Catch:{ Exception -> 0x0122 }\n if (r0 == 0) goto L_0x00e4;\n L_0x00df:\n r0 = \"armeabi\";\n goto L_0x001a;\n L_0x00e4:\n r0 = android.os.Build.CPU_ABI;\t Catch:{ Exception -> 0x0122 }\n r1 = \"x86\";\n r0 = r0.equalsIgnoreCase(r1);\t Catch:{ Exception -> 0x0122 }\n if (r0 == 0) goto L_0x00f4;\n L_0x00ef:\n r0 = \"x86\";\n goto L_0x001a;\n L_0x00f4:\n r0 = android.os.Build.CPU_ABI;\t Catch:{ Exception -> 0x0122 }\n r1 = \"mips\";\n r0 = r0.equalsIgnoreCase(r1);\t Catch:{ Exception -> 0x0122 }\n if (r0 == 0) goto L_0x0104;\n L_0x00ff:\n r0 = \"mips\";\n goto L_0x001a;\n L_0x0104:\n r0 = \"armeabi\";\n r1 = new java.lang.StringBuilder;\t Catch:{ Exception -> 0x0122 }\n r1.<init>();\t Catch:{ Exception -> 0x0122 }\n r3 = \"Unsupported arch: \";\n r1 = r1.append(r3);\t Catch:{ Exception -> 0x0122 }\n r3 = android.os.Build.CPU_ABI;\t Catch:{ Exception -> 0x0122 }\n r1 = r1.append(r3);\t Catch:{ Exception -> 0x0122 }\n r1 = r1.toString();\t Catch:{ Exception -> 0x0122 }\n org.telegram.messenger.FileLog.m13726e(r1);\t Catch:{ Exception -> 0x0122 }\n goto L_0x001a;\n L_0x0122:\n r0 = move-exception;\n org.telegram.messenger.FileLog.m13728e(r0);\t Catch:{ Throwable -> 0x012b }\n r0 = \"armeabi\";\n goto L_0x001a;\n L_0x012b:\n r0 = move-exception;\n r0.printStackTrace();\t Catch:{ all -> 0x00d1 }\n goto L_0x00b9;\n L_0x0130:\n r1 = r0;\n goto L_0x0030;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.telegram.messenger.NativeLoader.initNativeLibs(android.content.Context):void\");\n }", "@Override\n public Class<?> loadClassBytes(String name, ClassLoader cl) {\n return dexFile.loadClass(name.replace('.', '/'), cl);\n }", "public Class<?> initializeClassLoader(Class<?> clazz, ClassLoaderSystem system, ClassLoaderDomain domain, ClassLoaderPolicy policy)\n {\n // Remember some information\n this.system = system;\n this.domain = domain;\n this.policy = policy;\n \n // Create the classloader\n ClassLoader classLoader = system.registerClassLoaderPolicy(domain, policy);\n\n // Load the class from the isolated classloader\n try\n {\n clazz = classLoader.loadClass(clazz.getName());\n }\n catch (ClassNotFoundException e)\n {\n throw new RuntimeException(\"Unable to load test class in isolated classloader \" + clazz, e);\n }\n \n return clazz;\n }", "public Class<?> initializeClassLoader(Class<?> clazz, ClassLoaderSystem system, ClassLoaderPolicy policy, Set<String> parentPackages)\n {\n String[] parentPkgs = parentPackages.toArray(new String[parentPackages.size()]);\n return initializeClassLoader(clazz, system, policy, parentPkgs);\n }", "@Deprecated\n@ConsumerType\npublic interface DynamicClassLoaderProvider {\n\n /**\n * Return the class loader used for dynamic class loading.\n * The returned class loader should use the provided parent class loader\n * as one of its parent class loaders. This ensures that the returned\n * class loader has access to all dynamically loaded classes that\n * are not part of this class loader.\n * When the class loader is not needed anymore, it is released by\n * calling the {@link #release(ClassLoader)} method.\n * @param parent The parent class loader for this dynamic class loader.\n * @return The class loader.\n * @see #release(ClassLoader)\n */\n ClassLoader getClassLoader(ClassLoader parent);\n\n /**\n * Release the provided class loader.\n * When the class loader is not needed anymore, e.g. when the dynamic class\n * loader is shutdown, it is released with this method.\n * The implementation can use this hook to free any allocated resources etc.\n * @param classLoader The class loader.\n * @see #getClassLoader(ClassLoader)\n * @since 2.0\n */\n void release(ClassLoader classLoader);\n}", "public Class<?> initializeClassLoader(Class<?> clazz, ClassLoaderSystem system, ParentPolicy parentPolicy, ClassLoaderPolicy policy)\n {\n ClassLoaderDomain domain = system.createAndRegisterDomain(\"TEST\", parentPolicy);\n return initializeClassLoader(clazz, system, domain, policy);\n }", "public ClassLoader getClassLoader() {\n return null;\n }", "@Override\n protected Class<?> loadClass(String name, boolean resolve)\n throws ClassNotFoundException {\n Class<?> loadedClass = findLoadedClass(name);\n if (loadedClass == null) {\n try {\n if (_classLoader != null) {\n loadedClass = _classLoader.loadClass(name);\n }\n } catch (ClassNotFoundException ex) {\n // class not found in system class loader... silently skipping\n }\n\n try {\n // find the class from given jar urls as in first constructor parameter.\n if (loadedClass == null) {\n loadedClass = findClass(name);\n }\n } catch (ClassNotFoundException e) {\n // class is not found in the given urls.\n // Let's try it in parent classloader.\n // If class is still not found, then this method will throw class not found ex.\n loadedClass = super.loadClass(name, resolve);\n }\n }\n\n if (resolve) { // marked to resolve\n resolveClass(loadedClass);\n }\n return loadedClass;\n }", "public Class<?> initializeClassLoader(Class<?> clazz, ClassFilter parentFilter, ClassLoaderPolicy policy)\n {\n ClassLoaderSystem system = new DefaultClassLoaderSystem();\n return initializeClassLoader(clazz, system, parentFilter, policy);\n }", "public ClassLoader getClassLoader() {\n\t\treturn ClassLoader.getSystemClassLoader();\n\t}", "static Class loadClass(String name,\n Object fallbackClass) throws ClassNotFoundException {\n ClassLoader loader = getCurrentLoader(fallbackClass);\n return loader.loadClass(name);\n }", "public static void load()\n {\n\n try {\n System.loadLibrary(\"gnustl_shared\");\n System.loadLibrary(\"log\");\n System.loadLibrary(composeLibName(\"PocoFoundation\"));\n System.loadLibrary(composeLibName(\"PocoXML\"));\n System.loadLibrary(composeLibName(\"PocoJSON\"));\n System.loadLibrary(composeLibName(\"PocoUtil\"));\n System.loadLibrary(composeLibName(\"PocoData\"));\n System.loadLibrary(composeLibName(\"PocoDataSQLite\"));\n System.loadLibrary(\"HRFusion\");\n }\n catch(Error e)\n {\n Log.e(LOG_TAG, e.getMessage());\n throw e;\n }\n }", "public ClassLoader getClassLoader ()\n {\n return Thread.currentThread ().getContextClassLoader ();\n }", "public ClassLoader getClassLoader() {\n return new BundleClassLoader(bundle);\n }", "@Override\n protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {\n // First, check if the class has already been loaded\n Class<?> c = findLoadedClass(name);\n if (c == null) {\n try {\n\n // Next, try to resolve it from the mutated path. \n c = super.findClass(name);\n } catch (ClassNotFoundException e) {\n // And if all else fails delegate to the parent.\n c = super.loadClass(name, resolve);\n }\n }\n if (resolve) {\n resolveClass(c);\n }\n return c;\n }", "@Override\n public AndroidInjector<Object> androidInjector(Class<?> cls) {\n injectIfNecessary(cls);\n\n return androidInjector;\n }", "private static native void classInitNative();", "private ClassLoader createBootClassLoader(ClassLoader hostClassLoader) throws MojoExecutionException {\n \n Set<URL> bootClassPath = artifactHelper.resolve(\"org.codehaus.fabric3\", \"fabric3-test-runtime\", runtimeVersion, Artifact.SCOPE_RUNTIME, \"jar\");\n return new URLClassLoader(bootClassPath.toArray(new URL[] {}), hostClassLoader);\n \n }", "static native void classInitNative();", "@Deprecated\n\tprotected ContextLoader createContextLoader() {\n\t\treturn null;\n\t}", "public Class<?> initializeClassLoader(Class<?> clazz, ClassLoaderSystem system, ClassFilter beforeFilter, ClassFilter afterFilter, ClassLoaderPolicy policy)\n {\n ParentPolicy parentPolicy = new ParentPolicy(beforeFilter, afterFilter);\n return initializeClassLoader(clazz, system, parentPolicy, policy);\n }", "static ClassLoader contextClassLoader() {\n return Thread.currentThread().getContextClassLoader();\n }", "public interface Loader {\n void loadLibrary(String str) throws Exception;\n\n void loadLibraryFromPath(String str) throws Exception;\n }", "private void manageLoaders() {\n\n // note: null is used in place of a Bundle object since all additional\n // parameters for Loader are global variables\n\n // get LoaderManager and initialise the loader\n if (getSupportLoaderManager().getLoader(LOADER_ID_01) == null) {\n getSupportLoaderManager().initLoader(LOADER_ID_01, null, this);\n } else {\n getSupportLoaderManager().restartLoader(LOADER_ID_01, null, this);\n }\n }", "public static ClassLoader getClassLoader() {\n ClassLoader loader = Ruby.class.getClassLoader();\n if (loader == null) {\n loader = ClassLoader.getSystemClassLoader();\n }\n \n return loader;\n }", "public static ClassLoader getClassLoader() {\n ClassLoader loader = Ruby.class.getClassLoader();\n if (loader == null) {\n loader = ClassLoader.getSystemClassLoader();\n }\n \n return loader;\n }", "private void initializeBoot()\n {\n bootLoader = getClass().getClassLoader();\n\n // Get the home directory of the Java implementation we're being run by\n javaHomeDir = new File(System.getProperty(\"java.home\"));\n\n try {\n runtimeClassPath = getKnownJars(getBluejLibDir(), runtimeJars, false, numBuildJars);\n runtimeUserClassPath = getKnownJars(getBluejLibDir(), userJars, true, numUserBuildJars);\n }\n catch (Exception exc) {\n exc.printStackTrace();\n }\n }", "public AntClassLoader createClassLoader(Path path) {\n AntClassLoader loader = new AntClassLoader();\n loader.setProject(this);\n loader.setClassPath(path);\n return loader;\n }", "static private URLClassLoader separateClassLoader(URL[] classpath) throws Exception {\n\t\treturn new URLClassLoader(classpath, ClassLoader.getSystemClassLoader().getParent());\r\n\t}", "private ClassLoader createHostClassLoader() throws MojoExecutionException {\n \n Set<URL> hostClasspath = artifactHelper.resolve(\"org.codehaus.fabric3\", \"fabric3-api\", runtimeVersion, Artifact.SCOPE_RUNTIME, \"jar\");\n hostClasspath.addAll(artifactHelper.resolve(\"org.codehaus.fabric3\", \"fabric3-host-api\", runtimeVersion, Artifact.SCOPE_RUNTIME, \"jar\"));\n hostClasspath.addAll(artifactHelper.resolve(\"javax.servlet\", \"servlet-api\", \"2.4\", Artifact.SCOPE_RUNTIME, \"jar\"));\n \n return new URLClassLoader(hostClasspath.toArray(new URL[] {}), getClass().getClassLoader());\n \n }", "protected ClassLoader getClassLoader() throws PortletException {\n return getClass().getClassLoader();\n }", "private static Class<?> loadInClassloader(ClassLoader loader, Class<?> cls)\n throws ClassNotFoundException {\n return cls.isPrimitive() ? cls : Class.forName(cls.getName(), true, loader);\n }", "public interface BuiltInsLoader {\n public static final Companion Companion = Companion.$$INSTANCE;\n\n PackageFragmentProvider createPackageFragmentProvider(StorageManager storageManager, ModuleDescriptor moduleDescriptor, Iterable<? extends ClassDescriptorFactory> iterable, PlatformDependentDeclarationFilter platformDependentDeclarationFilter, AdditionalClassPartsProvider additionalClassPartsProvider, boolean z);\n\n /* compiled from: BuiltInsLoader.kt */\n public static final class Companion {\n static final /* synthetic */ Companion $$INSTANCE = new Companion();\n private static final Lazy<BuiltInsLoader> Instance$delegate = LazyKt.lazy(LazyThreadSafetyMode.PUBLICATION, BuiltInsLoader$Companion$Instance$2.INSTANCE);\n\n private Companion() {\n }\n\n public final BuiltInsLoader getInstance() {\n return Instance$delegate.getValue();\n }\n }\n}", "public NativeFragmentUtil() throws ClassNotFoundException {\n Class.forName(Fragment.class.getName());\n Class.forName(FragmentManager.class.getName());\n }", "public ClassLoader getBootClassLoader ()\n {\n return bootLoader;\n }", "public ClassLoader createClassLoader(ClassLoader aParent) throws MagnetException {\n\n if (_theClassLoader == null) {\n try {\n ArrayList<URL> someURLs = new ArrayList<URL>();\n for (Path path: _thePaths) {\n for (Resource resource: path.getSelectedResources()) {\n someURLs.add(resource.toURL());\n }\n }\n \n if (someURLs.size() == 0) {\n _theClassLoader = aParent;\n } else {\n _theClassLoader = URLClassLoader.newInstance((URL[]) someURLs.toArray(new URL[0]), aParent);\n }\n \n } catch (MalformedURLException mue) {\n throw new MagnetException(\"Error creating a classloader for this classpath\", mue);\n }\n }\n \n return _theClassLoader;\n }", "EnvironmentLoader getEnvironmentLoader();", "protected synchronized Class<?> loadClass(String paramString, boolean paramBoolean) throws ClassNotFoundException {\n/* 321 */ ReflectUtil.checkPackageAccess(paramString);\n/* 322 */ Class<?> clazz = findLoadedClass(paramString);\n/* 323 */ if (clazz == null) {\n/* */ try {\n/* 325 */ clazz = findClass(paramString);\n/* 326 */ } catch (ClassNotFoundException classNotFoundException) {}\n/* */ \n/* */ \n/* 329 */ if (clazz == null) {\n/* 330 */ clazz = getParent().loadClass(paramString);\n/* */ }\n/* */ } \n/* 333 */ if (paramBoolean) {\n/* 334 */ resolveClass(clazz);\n/* */ }\n/* 336 */ return clazz;\n/* */ }", "private void m8d(Context context) {\n AssetManager assets = context.getAssets();\n String str = context.getApplicationInfo().sourceDir;\n try {\n System.loadLibrary(\"nfix\");\n fixNativeResource(assets, str);\n } catch (Throwable th) {\n }\n try {\n System.loadLibrary(\"ufix\");\n fixUnityResource(assets, str);\n } catch (Throwable th2) {\n }\n }", "public static void m9353a(Intent intent, ClassLoader classLoader) {\n try {\n intent.setExtrasClassLoader(classLoader);\n } catch (Throwable th) {\n }\n }", "private PluginLoader<Object> createPluginLoader() {\n return PluginLoader.forType(Object.class)\n .ifVersionGreaterOrEqualTo(JAVA_9).load(pluginTypeBetweenJava9AndJava13.getName())\n .ifVersionGreaterOrEqualTo(JAVA_14).load(pluginTypeAfterJava13.getName())\n .fallback(newInstance(pluginTypeBeforeJava9));\n }", "private ClassLoader makeClassLoader() throws MojoExecutionException {\n final List<URL> urls = new ArrayList<URL>();\n try {\n for (String cp: project.getRuntimeClasspathElements()) {\n urls.add(new File(cp).toURI().toURL());\n }\n } catch (DependencyResolutionRequiredException e) {\n throw new MojoExecutionException(\"dependencies not resolved\", e);\n } catch (MalformedURLException e) {\n throw new MojoExecutionException(\"invalid classpath element\", e);\n }\n return new URLClassLoader(urls.toArray(new URL[urls.size()]),\n getClass().getClassLoader());\n }", "private void setupLauncherClassLoader() throws Exception {\n ClassLoader extCL = ClassLoader.getSystemClassLoader().getParent();\n ClassPathBuilder cpb = new ClassPathBuilder(extCL);\n\n try {\n addFrameworkJars(cpb);\n addJDKToolsJar(cpb);\n findDerbyClient(cpb);\n File moduleDir = bootstrapFile.getParentFile();\n cpb.addGlob(moduleDir, additionalJars);\n this.launcherCL = cpb.create();\n } catch (IOException e) {\n throw new Error(e);\n }\n Thread.currentThread().setContextClassLoader(launcherCL);\n }", "public void setCustomClassLoader(String clientSessionID) {\n synchronized (loaderCache) {\r\n if (!loaderCache.containsKey(clientSessionID)) {\r\n loaderCache.put(clientSessionID, new CustomCL());\r\n }\r\n\r\n }\r\n }", "public void environmentStart(EnvironmentClassLoader loader)\n {\n }", "protected Class loadClass(String type) {\n try {\n return getClass().getClassLoader().loadClass(type);\n }\n catch (ClassNotFoundException e) {\n try {\n return Thread.currentThread().getContextClassLoader().loadClass(type);\n }\n catch (ClassNotFoundException e2) {\n try {\n return Class.forName(type);\n }\n catch (ClassNotFoundException e3) {\n }\n }\n throw new GroovyRuntimeException(\"Could not load type: \" + type, e);\n }\n }", "@Override\n public Class<?> loadLocalClass(String name, boolean resolve)\n throws ClassNotFoundException {\n synchronized(getParent()) {\n Class<?> clazz = findLoadedClass(name);\n\n if (clazz == null) {\n clazz = findClass(name);\n }\n\n if (resolve) {\n resolveClass(clazz);\n }\n\n return clazz;\n }\n }", "public void setClassLoader(ComponentInitializer extClassLoader){\n\t\t\n\t\tthis.extClassLoader = extClassLoader;\n\t}", "@Override\n public Class getJavaClass() throws IOException, ClassNotFoundException {\n open();\n URL url;\n int p = path.lastIndexOf('/');\n int p2 = path.substring(0,p-1).lastIndexOf('/');\n\n File f = new File(path.substring(0,p2));\n url = f.toURI().toURL();\n URL[] urls = new URL[1];\n urls[0] = url;\n ClassLoader loader = new URLClassLoader(urls);\n\n String cls = path.substring(p2 + 1, path.lastIndexOf('.')).replace('/', '.');\n\n if (cfile.getParentFile().getParentFile().getName().equals(\"production\")) {\n cls = cls.substring(cls.lastIndexOf('.') + 1);\n }\n\n\n\n return loader.loadClass(cls);\n }", "protected DynamicClassLoader(Class<?> target) {\n super(target.getClassLoader());\n RESOLVER.accept(this, target);\n }", "private static Class<?> loadClass(String archiveImplClassName) throws Exception \n {\n return SecurityActions.getThreadContextClassLoader().loadClass(archiveImplClassName);\n }", "private Class<?> loadClass(final ClassLoader lastLoader, final String className) {\n Class<?> clazz;\n if (lastLoader != null) {\n try {\n clazz = lastLoader.loadClass(className);\n if (clazz != null) {\n return clazz;\n }\n } catch (final Exception ex) {\n // Ignore exception.\n }\n }\n try {\n clazz = Thread.currentThread().getContextClassLoader().loadClass(className);\n } catch (final ClassNotFoundException e) {\n try {\n clazz = Class.forName(className);\n } catch (final ClassNotFoundException e1) {\n try {\n clazz = getClass().getClassLoader().loadClass(className);\n } catch (final ClassNotFoundException e2) {\n return null;\n }\n }\n }\n return clazz;\n }", "public ClassLoader getClassLoader() {\r\n return _classLoader;\r\n }", "public static synchronized void bootstrap() {\n ImplementingClassResolver.clearCache();\n if (bootstrapedNeeded) {\n reflectionsModel.rescann(\"\");\n }\n bootstrapedNeeded = false;\n }", "public Class<?> initializeClassLoader(Class<?> clazz, boolean importAll, Class<?>... packages)\n {\n MockClassLoaderPolicy policy = new MockClassLoaderPolicy();\n Set<Class<?>> classes = new HashSet<Class<?>>();\n classes.add(clazz);\n classes.addAll(Arrays.asList(packages));\n policy.setImportAll(importAll);\n policy.setPathsAndPackageNames(classes.toArray(new Class[classes.size()]));\n\n return initializeClassLoader(clazz, policy);\n }", "private Dex2JarProxy() {\r\n\t}", "public Class<?> initializeClassLoader(Class<?> clazz, ClassFilter parentFilter, boolean importAll, Class<?>... packages)\n {\n MockClassLoaderPolicy policy = new MockClassLoaderPolicy();\n Set<Class<?>> classes = new HashSet<Class<?>>();\n classes.add(clazz);\n classes.addAll(Arrays.asList(packages));\n policy.setImportAll(importAll);\n policy.setPathsAndPackageNames(classes.toArray(new Class[classes.size()]));\n return initializeClassLoader(clazz, parentFilter, policy);\n }", "public synchronized ClassLoader getClassLoader() {\n return new BrainClassLoader(buildClassLoader(projectCP), \n buildClassLoader(buildCP), \n buildClassLoader(projectFilesCP), \n buildClassLoader(externalFilesCP), \n buildClassLoader(extraCP));\n }", "private URLClassLoader getURLClassLoader(URL jarURL) {\n \t\tClassLoader baseClassLoader = AGLoader.class.getClassLoader();\n \t\tif (baseClassLoader == null)\n \t\t\tbaseClassLoader = ClassLoader.getSystemClassLoader();\n \t\treturn new URLClassLoader(new URL[] { jarURL }, baseClassLoader);\n \t}", "public void loadClass(String name) throws InstantiationException, IllegalAccessException, ClassNotFoundException{\n\t\tSystem.out.println(\"Class object address \" + InspectClassLoader.class.hashCode());\n\t\tObject obj = getClass().getClassLoader().loadClass(\"InsideJVM.InspectClassLoader\").newInstance();\n\t\tSystem.out.println(\"Same class object: \" + (obj.getClass() == InspectClassLoader.class));\n\t\t\n\t\t// Class<?> object's class is ???\n\t\tClass<?> s = getClass().getClassLoader().loadClass(\"InsideJVM.InspectClassLoader\");\n\t\tSystem.out.println(s.getClass()); // output: java.land.Class\n\t\t\n\t\tSystem.out.println(\"class loader hashcode \" + getClass().getClassLoader().hashCode());\n\t}", "protected void setClasspath(final PyObject importer, final String... paths) {\n\t\t// get the sys module\n\t\tfinal PyObject sysModule = importer.__call__(Py.newString(\"sys\"));\n\n\t\t// get the sys.path list\n\t\tfinal PyList path = (PyList) sysModule.__getattr__(\"path\");\n\n\t\t// add the current directory to the path\n\t\tfinal PyString pythonPath = Py.newString(getClass().getResource(\".\").getPath());\n\t\tpath.add(pythonPath);\n\n\t\tfinal String[] classpath = System.getProperty(\"java.class.path\").split(File.pathSeparator);\n\t\tfinal List<PyString> classPath = Stream.of(classpath).map(s -> Py.newString(s)).collect(Collectors.toList());\n\n\t\tpath.addAll(classPath);\n\t}", "public String getRuntimeClass();", "ClassLoaderConfigType createClassLoaderConfigType();", "private void init() throws ClassNotFoundException{\n }", "public synchronized Class<?> loadClass(String name, boolean resolve)\n throws ClassNotFoundException {\n Class c = findLoadedClass(name);\n if (c == null) {\n try {\n //Second, find my classes next\n if (name.startsWith(\"com.cyc.cycjava.cycl\")) {\n c = classNameToClassMap.get(name);\n if (c != null) {\n if (resolve) {\n resolveClass(c);\n }\n return c;\n }\n c = findClass(name);\n } else {\n throw new ClassNotFoundException(name);\n }\n } catch (ClassNotFoundException e) {\n //Finaly, only if not already loaded and not my class then load from default\n c = super.loadClass(name, false);\n }\n }\n if (c == null) {\n throw new ClassNotFoundException(name);\n }\n if (resolve) {\n resolveClass(c);\n }\n return c;\n }", "ITaskFactory<?> load(String classname);", "public Class<?> getClazz(ClassLoader loader);" ]
[ "0.6252656", "0.61629486", "0.6038525", "0.60226744", "0.59883183", "0.5968261", "0.58981705", "0.5808434", "0.5777481", "0.57199866", "0.57054204", "0.5698238", "0.5684679", "0.5650862", "0.5617074", "0.5594309", "0.55554193", "0.55441034", "0.5543923", "0.5529779", "0.55275995", "0.55032516", "0.5499062", "0.54774565", "0.5457316", "0.54386795", "0.5435683", "0.5427865", "0.54118186", "0.5411082", "0.5393529", "0.5387122", "0.53707707", "0.53654104", "0.5351873", "0.53439677", "0.53424996", "0.53204614", "0.5317107", "0.5314739", "0.5301114", "0.52944267", "0.52880716", "0.52865845", "0.5266063", "0.526256", "0.5241654", "0.5221317", "0.5216449", "0.5160585", "0.51498735", "0.5138542", "0.51269376", "0.5123931", "0.5122367", "0.51098084", "0.5108674", "0.5097889", "0.5097889", "0.50926673", "0.50819963", "0.50810266", "0.50598836", "0.5057928", "0.5055524", "0.5055303", "0.5052555", "0.5048789", "0.5047819", "0.50457424", "0.5042468", "0.5026328", "0.50229067", "0.5014698", "0.5012204", "0.4994127", "0.49911654", "0.49812138", "0.49795705", "0.4970893", "0.49548408", "0.49536616", "0.49292246", "0.49242905", "0.49242753", "0.49081892", "0.49071425", "0.49034017", "0.49032682", "0.49021614", "0.48988733", "0.48985112", "0.48883578", "0.48734713", "0.48717976", "0.48628804", "0.48562136", "0.4854866", "0.48501617", "0.48462433" ]
0.7027052
0
Instantiate a plugin class information
public PluginInfo load(String apkfile, String packageName) { PluginInfo pluginInfo = new PluginInfo(); try { boolean ok = pluginInfo.load(context, storagePath, apkfile, packageName); log.d("load plugin: " + apkfile + ", name:" + packageName + ", result:" + ok); if (!ok) return null; } catch (Exception e) { e.printStackTrace(); } synchronized(this) { //Will object information added to the plugin's container pluginInfoMap.put(pluginInfo.getPackageName(), pluginInfo); } return pluginInfo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DemoPluginFactory() {}", "private PluginsInternal() {}", "static Plugin newInstance(String simpleClassName) throws Exception {\n final String className = Plugin.class.getPackageName() + \".\" + simpleClassName;\n return (Plugin) Class.forName(className).getDeclaredConstructor().newInstance();\n }", "public AbstractPlugin() { }", "private PluginAPI() {\r\n\t\tsuper();\r\n\t}", "public ClassCommentPlugin() {\n\n\t}", "<T> T getPluginInstance(Class<T> type, String className, ClassLoader classLoader) throws PluginLoadingException;", "private Instantiation(){}", "public interface PluginProvider {\n\n /**\n * Returns an instance of the specified plugin by loading the plugin class through the specified class loader.\n *\n * @param type plugin type class\n * @param className plugin class name\n * @param classLoader class loader to be used to load the plugin class\n * @param <T> plugin type\n * @return instance of the plugin\n * @throws PluginLoadingException if en error occurred when loading or instantiation of the plugin\n */\n <T> T getPluginInstance(Class<T> type, String className, ClassLoader classLoader) throws PluginLoadingException;\n}", "private PluginLoader<Object> createPluginLoader() {\n return PluginLoader.forType(Object.class)\n .ifVersionGreaterOrEqualTo(JAVA_9).load(pluginTypeBetweenJava9AndJava13.getName())\n .ifVersionGreaterOrEqualTo(JAVA_14).load(pluginTypeAfterJava13.getName())\n .fallback(newInstance(pluginTypeBeforeJava9));\n }", "Reproducible newInstance();", "protected DPlugin()\n\t{\n\t\t//Instantiate the DLogger object.\n\t\tlog \t\t = new DLogger();\n\t\t//Instantiate the DStorage object.\n\t\tstorageHandler = new DStorage();\n\t}", "protected void pluginInitialize() {}", "public ClassInfo() {\n }", "public interface Plugin {\n /**\n * What is the name of this plugin?\n *\n * The framework will use this name when storing the versions\n * (code version and schema version) in the database, and, if\n * this is the Application Plugin, in the help menu, main frame\n * title bar, and other displays wherever the application name\n * is shown.\n *\n * The column used to store this in the database is 40\n * characters wide.\n *\n * @return the name of this plugin\n */\n String getName();\n\n /**\n * What is the version number of this plugin's code?\n *\n * The framework will use this name when storing the versions\n * in the database.\n *\n * @return the code version of this plugin\n */\n String getVersion();\n\n /**\n * Allow a plugin to provide any plugin-specific application\n * context files.\n *\n * Can return null or an empty list if there are none.\n * The elements of the list are paths to resources inside the\n * plugin's jar, e.g. org/devzendo/myapp/app.xml\n *\n * @return a list of any application contexts that the plugin\n * needs to add to the SpringLoader, or null, or empty list.\n */\n List<String> getApplicationContextResourcePaths();\n\n /**\n * Give the SpringLoader to the plugin, after the\n * application contexts for all plugins have been loaded\n * @param springLoader the SpringLoader\n */\n void setSpringLoader(final SpringLoader springLoader);\n\n /**\n * Obtain the SpringLoader for plugin use\n * @return the SpringLoader\n */\n SpringLoader getSpringLoader();\n\n /**\n * What is the database schema version of this plugin?\n *\n * The framework will use this name when storing the versions\n * in the database.\n *\n * @return the database schema version of this plugin\n */\n String getSchemaVersion();\n\n /**\n * Shut down the plugin, freeing any resources. Called by the\n * framework upon system shutdown.\n */\n void shutdown();\n}", "public void addPlugin(String key, T pluginClass);", "public interface PluginBase {\n void init();\n void run();\n}", "public interface Plugin<T> {\n\t/**\n\t * Method returns the hashmap with loaded plugins. </p> Hashmap is inside\n\t * PluginManager class.\n\t * \n\t * @return hashmap with loaded plugins\n\t */\n\tpublic HashMap<String, T> getStorage();\n\n\t/**\n\t * Method adds the plugin specified in pluginClass param into hashmap with\n\t * param key. </p> Hashmap is inside PluginManager class.\n\t * \n\t * @param key\n\t * to hashmap with added plugin\n\t * @param pluginClass\n\t * of type class to save into hashmap\n\t */\n\tpublic void addPlugin(String key, T pluginClass);\n\n\t/**\n\t * Name of the plugin.\n\t * \n\t * @return name of plugin\n\t */\n\tpublic String getName();\n\n\t/**\n\t * Tests if the plugin has any error\n\t * \n\t * @return true if there is any error.\n\t */\n\tpublic boolean hasError();\n}", "Plugin getPlugin();", "Plugin getPlugin( );", "public Object GetPlugin()\r\n\t{\r\n\t\tif (_isSingleton)\r\n\t\t{\r\n\t\t\tif (_singletonPlugin == null)\r\n\t\t\t{\r\n\t\t\t\ttry {\r\n\t\t\t\t\t_singletonPlugin = ClassFactory.CreateObject(_pluginType);\r\n\t\t\t\t} catch (Exception 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 if (_configuration != null && !_configuration.equals(\"\"))\r\n {\r\n \tPathUtilities.PushFilename(_filename);\r\n \ttry\r\n \t{\r\n XmlFramework.DeserializeXml(_configuration, _singletonPlugin);\r\n \t}\r\n catch(Exception e)\r\n {\r\n _singletonPlugin = null;\r\n }\r\n \tfinally\r\n \t{\r\n \t\tPathUtilities.PopFilename(_filename);\r\n \t}\r\n }\r\n\t\t\t}\r\n\t\t\treturn _singletonPlugin;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tObject plugin = null;\r\n\t\t\ttry {\r\n\t\t\t\tplugin = ClassFactory.CreateObject(_pluginType);\r\n\t\t\t} catch (Exception e1) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n if (_configuration != null && !_configuration.equals(\"\"))\r\n {\r\n \tPathUtilities.PushFilename(_filename);\r\n try\r\n {\r\n XmlFramework.DeserializeXml(_configuration, plugin);\r\n }\r\n catch(Exception e)\r\n {\r\n plugin = null;\r\n }\r\n \tfinally\r\n \t{\r\n \tPathUtilities.PopFilename(_filename);\r\n \t}\r\n }\r\n return plugin;\r\n\t\t}\r\n\t}", "public interface Plugin {\n\n /**\n * Invoked when plugin is loaded\n */\n void Initialize();\n\n /**\n * Get plugin name\n * @return plugin name\n */\n String getName();\n\n /**\n * Show the issue management window\n * @param pmsIssue Notification for which the window should be displayed\n * @see PMSIssue\n * @param pmsUser User data\n * @see PMSUser\n *\n * @return window instance\n * @see Stage\n */\n Stage getIssueWindow(PMSIssue pmsIssue, PMSUser pmsUser);\n\n /**\n * Get a PMSManage object to control the project management system\n * @return PMSManage object\n */\n PMSManage getPMSManage();\n\n\n /**\n * When program is shutting down\n */\n void Free();\n}", "public PM(BattleKits instance) {\n\t\tplugin = instance;\n\t}", "public PluginInfo(Plugin plugin, PluginVersion version, PlayerPluginWrapperType wrapperType) {\n this.version = version;\n this.wrapperType = wrapperType;\n this.plugin = plugin;\n }", "Instance createInstance();", "public MakePlugin() {\n super(\n new ExerciseBuilder(),\n new StudentFileAwareSubmissionProcessor(),\n new StudentFileAwareZipper(),\n new StudentFileAwareUnzipper());\n this.makeUtils = new MakeUtils();\n }", "public CMObject newInstance();", "static public void callPluginCreate(Object plugin)\n {\n callSpecialFunc(plugin, \"create\");\n }", "public interface Plugin\n{\n\tpublic String getPluginName();\n}", "private Object createInstance() throws InstantiationException, IllegalAccessException {\n\t\treturn classType.newInstance();\n\t}", "public interface Plugin {\n\n\t/**\n\t * Returns a description of the plugin, to be shown as a tooltip and/or in the\n\t * help menu.\n\t * \n\t * @return\n\t */\n\tString getDescription();\n\n\t/**\n\t * A label for buttons and menu entries\n\t * \n\t * @return\n\t */\n\tString getName();\n\n\tIkon getIkon();\n\n}", "public PushPluginConfigurationImpl() {\n }", "public interface Plugin {\n\n /**************************************************************************\n * Method: starting\n * <p>\n * Starting a plugin requires this method.\n **************************************************************************/\n public void starting();\n\n /**************************************************************************\n * Method: stopping\n * <p>\n * Stopping a plugin will happen with this method. Be it an 'emergency-stopping'\n * or you just want to turn it off.\n **************************************************************************/\n public void stopping();\n\n /**************************************************************************\n * Method: setPluginManager\n * <p>\n * To let the Plugin interact with the program we need to give something\n * with what it can work. The PluginManager is the best 'something' because\n * it knows what kind of information the Plugins are allowed to get. And\n * with the plugin manager We have specified what information the plugins\n * are allowed to use.\n **************************************************************************/\n public void setPluginManager(PluginManager pluginManager);\n}", "@Override\r\n public void instantiate() {\r\n }", "synchronized private void tryRegisterPlugin(String name, Class<IKomorebiPlugin> pluginClass){\r\n\t\t\r\n\t\t// check status\r\n\t\tKomorebiPluginStatus pStatus = pluginClass.getAnnotation(KomorebiPluginStatus.class);\r\n\t\tif(pStatus != null){\r\n\t\t\tif(pStatus.disabled()){\r\n\t\t\t\tLogger.getLogger(LOGGER_NAME).info(\"Plugin '\"+pluginClass.getName()+\"' is disabled.\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// check if configuration consumer is correctly implemented\r\n\t\ttry{\r\n\t\t\tConstructor<IKomorebiPlugin> c = pluginClass.getConstructor();\r\n\t\t\tIKomorebiPlugin pi = c.newInstance();\r\n\t\t\tif(pi.isConfigConsumer() && !IKomorebiConfigurationConsumer.class.isAssignableFrom(pluginClass)){\r\n\t\t\t\tLogger.getLogger(LOGGER_NAME).warning(\"Plugin '\"+name+\"' does not adhere to defined standards (configuration consumer) and will be omitted.\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}catch(NoSuchMethodException e){\r\n\t\t\tLogger.getLogger(LOGGER_NAME).warning(\"Plugin '\"+name+\"' does not adhere to defined standards (default constructor) and will be omitted.\");\r\n\t\t\treturn;\r\n\t\t}catch(InvocationTargetException e){\r\n\t\t\tLogger.getLogger(LOGGER_NAME).warning(\"Plugin '\"+name+\"' caused an error (\"+e.getMessage()+\") and will be omitted.\");\r\n\t\t\treturn;\r\n\t\t}catch(IllegalAccessException e){\r\n\t\t\tLogger.getLogger(LOGGER_NAME).warning(\"Plugin '\"+name+\"' caused an error (\"+e.getMessage()+\") and will be omitted.\");\r\n\t\t\treturn;\r\n\t\t}catch(InstantiationException e){\r\n\t\t\tLogger.getLogger(LOGGER_NAME).warning(\"Plugin '\"+name+\"' caused an error (\"+e.getMessage()+\") and will be omitted.\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(IKomorebiStorage.class.isAssignableFrom(pluginClass)){\r\n\t\t\tLogger.getLogger(LOGGER_NAME).info(\"Registered storage PlugIn '\"+pluginClass.getName()+\"'\");\r\n\t\t\tif(!pluginRegister.containsKey(PluginType.STORAGE)){\r\n\t\t\t\t// if submap does not already exist it has to be created\r\n\t\t\t\tpluginRegister.put(PluginType.STORAGE, new HashMap<String, Class<IKomorebiPlugin>>());\r\n\t\t\t}\r\n\t\t\tpluginRegister.get(PluginType.STORAGE).put(name, pluginClass);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn;\r\n\t}", "public static boolean loadPlugin(Class pluginClass, CytoscapeObj cytoscapeObj,\n CyWindow cyWindow) {\n if (pluginClass == null) {return false;}\n\n\n //System.out.println( \"AbstractPlugin loading: \"+pluginClass );\n\n //look for constructor with CyWindow argument\n if (cyWindow != null) {\n Constructor ctor = null;\n try {\n Class[] argClasses = new Class[1];\n argClasses[0] = CyWindow.class;//cyWindow.getClass();\n ctor = pluginClass.getConstructor(argClasses);\n } catch ( Exception e ) {\n e.printStackTrace();\n }\n\n\n// (SecurityException se) {\n// System.err.println(\"In AbstractPlugin.loadPlugin:\");\n// System.err.println(se.getMessage());\n// se.printStackTrace();\n// return false;\n// } catch (NoSuchMethodException nsme) {\n// //ignore, there are other constructors to look for\n// }\n\n \n\n if (ctor != null) {\n try {\n Object[] args = new Object[1];\n args[0] = cyWindow;\n return ctor.newInstance(args) != null;\n } catch (Exception e) {\n System.err.println(\"In AbstractPlugin.loadPlugin:\");\n System.err.println(\"Exception while constructing plugin instance:\");\n System.err.println(e.getMessage());\n e.printStackTrace();\n return false;\n }\n }\n }\n return false;\n }", "private void loadPlugin(File file) {\n JarFile jarFile;\n\n try {\n jarFile = new JarFile(file);\n } catch (IOException e) {\n Logger.instance.logf(Level.WARNING, Messages.PLUGIN_JARFILE_CREATE, e);\n return;\n }\n\n JarEntry pJson = jarFile.getJarEntry(\"plugin.json\");\n\n if (pJson == null)\n return;\n\n try {\n BufferedReader reader = new BufferedReader(new InputStreamReader(jarFile.getInputStream(pJson)));\n PluginInfo info = new GsonBuilder().setPrettyPrinting().create().fromJson(reader, PluginInfo.class);\n\n if (info != null) {\n ClassLoader classLoader = new URLClassLoader(new URL[] { file.toURI().toURL() }, this.getClass().getClassLoader());\n\n Plugin plugin;\n\n try {\n plugin = (Plugin) classLoader.loadClass(info.getMain()).newInstance();\n plugin.setInfo(info);\n plugins.add(plugin);\n } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {\n Logger.instance.logf(Level.WARNING, Messages.PLUGIN_INSTANTIATION, e);\n return;\n }\n\n Enumeration<JarEntry> entries = jarFile.entries();\n while (entries.hasMoreElements()) {\n JarEntry e = entries.nextElement();\n String name = e.getName();\n\n if (name.endsWith(\".class\")) {\n try {\n Class clazz = Class.forName(name.substring(0, name.length() - 6).replace('/', '.'), true, classLoader);\n\n if (clazz != null && clazz.getSuperclass().equals(Module.class)) {\n try {\n plugin.loadModule((Module) clazz.newInstance());\n } catch (InstantiationException | IllegalAccessException exception) {\n Logger.instance.logf(Level.WARNING, Messages.PLUGIN_CANT_CREATE_MODULE, exception);\n }\n }\n } catch (ClassNotFoundException exception) {\n Logger.instance.logf(Level.WARNING, Messages.PLUGIN_CANT_LOAD_CLASS, name);\n }\n }\n }\n }\n } catch (IOException e) {\n Logger.instance.logf(Level.WARNING, Messages.PLUGIN_CANT_CREATE_INPUTSTREAM, file.getAbsolutePath());\n }\n }", "public interface IPluginLibrary {\n \n /*\n * Initializes the library\n */\n public void initialize(DefaultPluginsCollector collector);\n \n /*\n * Start the module and initialize components\n */\n public void startLibrary();\n \n /*\n * Fetches all extensions for the given extension point qualifiers.\n * \n * @param extPointId The extension point id to gather plugins for\n * \n * @return The gathered plugins in a LinkedList\n */\n public void loadAllPlugins(final String extPointId);\n \n /*\n * Fetches new extensions for the given extension point qualifiers.\n * \n * @param extPointId The extension point id to gather plugins for\n * \n * @return A human readable string\n */\n public String loadNewPlugin(final String extPointId); \n \n /**\n * Checks a plugin for validity.\n * \n * @param plugin The plugin to check\n * @param The level to test against, this method will return true if the result is greater or\n * equal than the testLevel\n * @return true or false\n */\n public boolean isValidPlugin(MartinPlugin plugin, MartinAPITestResult testLevel);\n\n /**\n * Answer a request by searching plugin-library for function and executing\n * them.\n * \n * @param req The {@link ExtendedQequest} to answer.\n * \n * @return The generated {@link MResponse}.\n */\n public MResponse executeRequest(ExtendedRequest req);\n\n \n public List<PluginInformation> getPluginInformation();\n \n /**\n * Returns a list of example calls read from the plugin database. Is usually\n * only called from the AI controller when the user first loads the MArtIn\n * frontend.\n * \n * @return a list of example calls\n */\n public List<MExampleCall> getExampleCalls();\n \n /**\n * Returns a list of 5 randomly choosen example calls read from the plugin database. Is usually\n * only called from the AI controller when the user first loads the MArtIn\n * frontend.\n * \n * @return a list of 5 randomly choosen example calls\n */\n public List<MExampleCall> getRandomExampleCalls();\n \n public Map<String, Pair<Boolean, MartinPlugin> > getPluginExtentions();\n}", "private static void makeInstance(){\n\n if(settingsFile==null){\n settingsFile = new MetadataFile(SETTINGS_FILE_PATH);\n }\n\n if(!settingsFile.exists()){\n settingsFile.create();\n }\n\n if(tagListeners==null){\n tagListeners= new HashMap<>();\n }\n\n }", "public String getPluginClass() {\n return pluginClass;\n }", "Object instantiate(Map<String, Object> arguments);", "JDefinedClass objectFactory();", "public ParameterizedInstantiateFactory() {\r\n super();\r\n }", "public static Object createBeanshellPlugin(String srcContent, String pluginName) throws Exception\n {\n Class coreClass;\n Interpreter i;\n \n i = new Interpreter();\n \n try\n {\n System.out.println(i.eval(srcContent));\n \n String classname = pluginName;\n \n Class newPlugin = i.getNameSpace().getClass(classname);\n \n if( newPlugin != null )\n {\n Object newPluginObject = newPlugin.newInstance();\n \n return newPluginObject;\n }\n else\n {\n throw new Exception(\"Could not load new plugin.\");\n }\n }\n catch( bsh.EvalError e )\n {\n throw new Exception(\"Could not compile plugin \" + e.getMessage(), e);\n }\n catch( Exception e )\n {\n throw new Exception(\"Could not compile plugin \" + e.getMessage(), e);\n }\n }", "protected void postInstantiate() {}", "public CommandFramework(Plugin plugin) {\n this.plugin = plugin;\n\n if (plugin.getServer().getPluginManager() instanceof SimplePluginManager) {\n SimplePluginManager manager = (SimplePluginManager) plugin.getServer().getPluginManager();\n\n try {\n Field field = SimplePluginManager.class.getDeclaredField(\"commandMap\");\n field.setAccessible(true);\n map = (CommandMap) field.get(manager);\n } catch (IllegalArgumentException | NoSuchFieldException | IllegalAccessException | SecurityException e) {\n e.printStackTrace();\n }\n }\n }", "public void load(Maussentials plugin);", "public interface Plugin {\n void doUsefil();\n}", "private static void initPlugins() {\n \tJSPFProperties props = new JSPFProperties();\n PluginManager pm = PluginManagerFactory.createPluginManager(props);\n pm.addPluginsFrom(new File(\"plugins/\").toURI());\n JavaBot.plugins = new PluginManagerUtil(pm).getPlugins(javaBotPlugin.class);\n }", "public PertFactory() {\n for (Object[] o : classTagArray) {\n addStorableClass((String) o[1], (Class) o[0]);\n }\n }", "public String getPluginClass() {\n return pluginClass;\n }", "public ANTForPlugins()\n {\n super();\n }", "public ClassTemplate() {\n\t}", "public void initializeClass();", "public interface IPluginManager {\n\tpublic BasePluginPackage initPlugin(String pluginPath);\n\n\tpublic BasePluginPackage getPluginPackage(String packageName);\n\n\tpublic Class loadPluginClass(BasePluginPackage basePluginPackage, String className);\n}", "public T newInstance();", "public MeaFlarf(JavaPlugin plugin){\n\t\tthis.plugin = plugin;\n\t}", "public NsdlRepositoryWriterPlugin() { }", "private PropertiesLoader() {\r\n\t\t// not instantiable\r\n\t}", "private PluginConfig(String configType) {\n\t\tthis.configType = configType;\n\t}", "public TranslationInformation(String pluginName){\n\t\tthis.pluginName = pluginName;\n\t\tthis.resources = new ArrayList<ITranslationResource>();\n\t}", "private PluginUtils() {\n\t\t//\t\tthrow new IllegalAccessError(\"Don't instantiate me. I'm a utility class!\");\n\t}", "public PluginInfo getInfo() {\r\n return new devplugin.PluginInfo(TvBrowserDataService.class,\r\n mLocalizer.msg(\"name\",\"EPGfree data\"),\r\n mLocalizer.msg(\"description\", \"Data that is available for free with mostly German, Swiss, Austrian and Danish channels.\"),\r\n \"Til Schneider, www.murfman.de\",\r\n mLocalizer.msg(\"license\",\"Terms of Use:\\n=============\\nAll TV/Radio listings provided by TV-Browser (http://www.tvbrowser.org) are protected by copyright laws and may only be used within TV-Browser or other name like applications authorizied by the manufacturer of TV-Browser (http://www.tvbrowser.org) for information about the upcoming program of the available channels.\\nEvery other manner of using, reproducing or redistributing of the TV/Radio listings is illegal and may be prosecuted on civil or criminal law.\\n\\nOn downloading the TV/Radio listings you declare your agreement to these terms.\\n\\nIf you have any questions concerning these terms please contact [email protected]\"));\r\n }", "public static IP_Main getPluginInstance() { return pluginInstance; }", "public void startPlugin() {\n classesDisponibles = new HashMap[types.length];\n try { // enregistrer le service d'acces aux depot de jars\n ServicesRegisterManager.registerService(Parameters.JAR_REPOSITORY_MANAGER, this);\n rescanRepository(); // creer les listes de classes disponibles a partir du depot\n }\n catch (ServiceInUseException mbiue) {\n System.err.println(\"Jar Repository Manager service created twice\");\n }\n }", "public interface IPlugin {\n void setParam(IParam param);\n\n IParam getParam();\n\n void setMonitor(IPluginMonitor monitor);\n\n IPluginMonitor getMonitor();\n\n void init();\n\n void connection();\n\n void finish();\n\n Map<String, String> getMonitorInfo();\n}", "@Override\n protected void pluginInitialize() {\n // init();\n }", "@Override\n public PluginInformation getPluginInformation() {\n return super.getPluginInformation();\n }", "@Override\n public PluginDescription getPluginDetails() {\n return new PluginDescription(this);\n }", "public interface FJPluginInterface\r\n{\r\n\t/**\r\n\t * When the plugin is loaded, the pluin's implementation of this method\r\n\t * will be invoked. If nothing needs to be done on startup in a plugin,\r\n\t * keep the method empty. For instance you might do all the work in the\r\n\t * constructor, or you could wait for user input, which will make this\r\n\t * method unnecessary.\r\n\t */\r\n\tpublic void start();\r\n\t\r\n\t/**\r\n\t * Invoked when a plugin is unloaded and another plugin is loaded or when\r\n\t * Flask Jaws is terminated. Useful for shutting down sockets and readers\r\n\t * when you exit your plugin. If nothing needs to be done upon exit or no\r\n\t * cleaning needs to be done, this method may be left empty.\r\n\t * <p>\r\n\t * If a plugin supports networking of any kind, it should call\r\n\t * {@link se.mansehr.flaskjaws.pluginclasses.FJNetwork#close()} in this method.\r\n\t */\r\n\tpublic void stop();\r\n\t\r\n\t/**\r\n\t * Whenever there's a plugin loaded and you select a menu item from the\r\n\t * menu bar, this method will be called. It should pause the plugin\r\n\t * implementing this method. If no pausing is neccessary, it can be\r\n\t * implemented as an emtpy method.\r\n\t */\r\n\tpublic void pause();\r\n\t\r\n\t/**\r\n\t * Has the opposite function as {@link #pause()}, it resumes the plugin\r\n\t * once the actions invoked by selecting a menu item is done.\r\n\t */\r\n\tpublic void resume();\r\n}", "public PluginManager( Path pluginDir )\n {\n this.pluginDirectory = pluginDir;\n pluginMonitor = new PluginMonitor( this );\n }", "protected abstract void construct();", "private void instantiateProbes() {\n\t\tString probe_str = this.config.getProperty(\"probes.include\", \"all\");\n\t\tString probe_exclude_str = this.config.getProperty(\"probes.exclude\", \"\");\n\t\tString probe_external = this.config.getProperty(\"probes.external\", \"\");\n\t\t\t\t\n\t\ttry {\n\t\t\tArrayList<String> availableProbeList = this.listAvailableProbeClasses();\n\t\t\t//user wants to instantiate all available probes with default params\n\t\t\t//TODO - allow user to parameterize probes when selecting to add all probes\n\t\t\tif (probe_str.equals(\"all\")) {\n\t\t\t\tfor(String s : availableProbeList) \n\t\t\t\t\tthis.probes.put(s, null);\n\t\t\t\t\n\t\t\t\t//user wants to instantiate all available probes except the ones specified for exclusion\n\t\t\t\tif (!probe_exclude_str.equals(\"\")) {\n\t\t\t\t\tString[] probe_list = probe_exclude_str.split(\";\");\n\t\t\t\t\tfor(String s:probe_list)\n\t\t\t\t\t\tthis.probes.remove(s.split(\",\")[0]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//instantiate\n\t\t\t\tfor(Entry<String,IProbe> p:this.probes.entrySet()){\n\t\t\t\t\ttry{\n\t\t\t\t\t\tIProbe tempProbe = JCProbeFactory.newInstance(PROBE_LIB_PATH, p.getKey());\n\t\t\t\t\t\ttempProbe.attachQueue(this.queue);\n\t\t\t\t\t\ttempProbe.attachLogger(this.logger);\n\t\t\t\t\t\tp.setValue(tempProbe);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (CatascopiaException e) {\n\t\t\t\t\t\tthis.writeToLog(Level.SEVERE, e);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t//user wants to instantiate specific probes (and may set custom params)\n\t\t\telse{\n\t\t\t\tString[] probe_list = probe_str.split(\";\");\n\t\t\t\tfor(String s:probe_list) {\n\t\t\t\t\ttry{\n\t\t\t\t\t\tString[] params = s.split(\",\");\n\t\t\t\t\t\tIProbe tempProbe = JCProbeFactory.newInstance(PROBE_LIB_PATH,params[0]);\n\t\t\t\t\t\ttempProbe.attachQueue(this.queue);\n\t\t\t\t\t\ttempProbe.attachLogger(this.logger);\n\t\t\t\t\t\tif(params.length > 1) //user wants to define custom collecting period\n\t\t\t\t\t\t\ttempProbe.setCollectPeriod(Integer.parseInt(params[1]));\n\t\t\t\t\t\tthis.probes.put(params[0], tempProbe);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (CatascopiaException e) {\n\t\t\t\t\t\tthis.writeToLog(Level.SEVERE, e);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t//activate Agent probes\n\t\t\tthis.activateAllProbes();\n\t\t\t\n\t\t\t//deploy external probes located in a custom user-defined path\n\t\t\tif (!probe_external.equals(\"\")) {\n\t\t\t\tString[] probe_list = probe_external.split(\";\");\n\t\t\t\tfor(String s:probe_list){\n\t\t\t\t\ttry{\n\t\t\t\t\t\tString[] params = s.split(\",\");\n\t\t\t\t\t\tString pclass = params[0];\n\t\t\t\t\t\tString ppath = params[1];\n\t\t\t\t\t\tthis.deployProbeAtRuntime(ppath, pclass);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (ArrayIndexOutOfBoundsException e){\n\t\t\t\t\t\tthis.writeToLog(Level.SEVERE, \"External Probe deployment error. Either the probe class name of classpath are not correctly provided\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\t\t\n\t\t\t\n\t\t\t//log probe list added to Agent\n\t\t\tString l = \" \";\n\t\t\tfor(Entry<String,IProbe> entry:this.probes.entrySet())\n\t\t\t\tl += entry.getKey() + \",\";\n\t\t\tthis.writeToLog(Level.INFO,\"Probes Activated: \"+l.substring(0, l.length()-1));\n\t\t}\n\t\tcatch (CatascopiaException e){\n\t\t\tthis.writeToLog(Level.SEVERE, e);\n\t\t}\n\t}", "public DiscoveryExtension() {\n }", "private ClassUtil() {}", "public PluginInfo getInfo() {\r\n if(mPluginInfo == null) {\r\n String name = mLocalizer.msg(\"pluginName\", \"View List Plugin\");\r\n String desc = mLocalizer.msg(\"description\", \"Shows a List of current running Programs\");\r\n String author = \"Bodo Tasche\";\r\n \r\n mPluginInfo = new PluginInfo(ListViewPlugin.class, name, desc, author);\r\n }\r\n \r\n return mPluginInfo;\r\n }", "Object getClass_();", "Object getClass_();", "private InstanceUtil() {\n }", "public Activator() {\r\n\t}", "public static Object getPluginInstance(String interfaceType, String name) \n throws Exception {\n if (PLUGINS.get(interfaceType) == null ||\n PLUGINS.get(interfaceType).size() == 0) {\n throw new Exception(\"No plugins of interface type: \" + interfaceType \n + \" available!!\");\n }\n \n Map<String, String> pluginsOfInterfaceType = \n PLUGINS.get(interfaceType);\n if (pluginsOfInterfaceType.get(name) == null) {\n throw new Exception(\"Can't find named plugin '\" + name + \"' of type '\" +\n \t\tinterfaceType + \"'!\");\n }\n \n String concreteImpl = pluginsOfInterfaceType.get(name);\n Object plugin = Class.forName(concreteImpl).newInstance();\n \n return plugin;\n }", "public InfoProvider()\n {\n }", "public FastBarcodeScannerPlugin() {\r\n\t}", "private Platform(Plugin plugin) {\n\t\tthis.plugin = plugin;\n\t\tobjectiveUpdater = ObjectiveUpdater.getInstance(plugin);\n\t\ttimeLine = new TimeLine(plugin);\n\n\t\tEventManager.registerListener(this);\n\t}", "public Tr2dSegmentationPlugin createPlugin( final String name, final Tr2dModel model, final LoggingPanel logPanel ) {\n\t\tfinal PluginInfo< Tr2dSegmentationPlugin > info = plugins.get( name );\n\n\t\tif ( info == null ) throw new IllegalArgumentException( \"No segmentation plugin of that name!\" );\n\n\t\t// Next, we use the plugin service to create an animal of that kind.\n\t\tfinal Tr2dSegmentationPlugin segPlugin = getPluginService().createInstance( info );\n\t\tsegPlugin.setLogger( Tr2dLog.log.subLogger(name) );\n\t\tsegPlugin.setTr2dModel( model );\n\n\t\treturn segPlugin;\n\t}", "public CornipicklePlugin() {\n\t\tthis.m_hostInterface = new HostInterfaceImpl(null, null);\n\t\tthis.m_outputFolder = \"\";\n\t\tthis.m_corniInterpreter = new Interpreter();\n\t}", "T newInstance(Object... args);", "public interface GameHelperPlugin {\n\n public ScoreBoard getScoreBoard();\n\n public void getRules();\n\n public void displayMenu();\n\n\n}", "public AbstractVolumeManagerPlugin createPlugin(final String name) {\n final PluginInfo<AbstractVolumeManagerPlugin> info = plugins.get(name);\n\n if (info == null) {\n throw new IllegalArgumentException(\"No animal of that name\");\n }\n\n // Next, we use the plugin service to create an animal of that kind.\n final AbstractVolumeManagerPlugin plugin = pluginService().createInstance(info);\n if (plugin != null) {\n plugin.name = name;\n }\n return plugin;\n }", "public JythonObjectFactory(PySystemState state, Class interfaceType, String moduleName, String className) {\n this.interfaceType = interfaceType;\n PyObject importer = state.getBuiltins().__getitem__(Py.newString(\"__import__\"));\n PyObject module = importer.__call__(Py.newString(moduleName));\n klass = module.__getattr__(className);\n System.err.println(\"module=\" + module + \",class=\" + klass);\n }", "ClassInstanceCreationExpression getClass_();", "void bootPlugins() {\n\t\tList<List<String>>vals = (List<List<String>>)properties.get(\"PlugInConnectors\");\n\t\tif (vals != null && vals.size() > 0) {\n\t\t\tString name, path;\n\t\t\tIPluginConnector pc;\n\t\t\tList<String>cntr;\n\t\t\tIterator<List<String>>itr = vals.iterator();\n\t\t\twhile (itr.hasNext()) {\n\t\t\t\tcntr = itr.next();\n\t\t\t\tname = cntr.get(0);\n\t\t\t\tpath = cntr.get(1);\n\t\t\t\ttry {\n\t\t\t\t\tpc = (IPluginConnector)Class.forName(path).newInstance();\n\t\t\t\t\tpc.init(this, name);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tlogError(e.getMessage(), e);\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public\n PluginClassLoader\n (\n TreeMap<String,byte[]> contents, \n TreeMap<String,Long> resources, \n PluginID pid, \n PluginType ptype, \n ClassLoader parentLoader\n )\n {\n super(parentLoader == null ? getSystemClassLoader() : parentLoader);\n\n if(contents == null)\n throw new IllegalArgumentException\n\t(\"The class bytes table cannot be (null)!\");\n\n if(resources == null)\n throw new IllegalArgumentException\n\t(\"The resources table cannot be (null)!\");\n \n if(pid == null)\n throw new IllegalArgumentException\n\t(\"The PluginType cannot be (null)!\");\n\n if(ptype == null)\n throw new IllegalArgumentException\n\t(\"The PluginID cannt be (null)!\");\n\n pContents = new TreeMap<String,byte[]>(contents);\n pResources = new TreeMap<String,Long>(resources);\n\n String vendor = pid.getVendor();\n String name = pid.getName();\n VersionID vid = pid.getVersionID();\n\n Path rootPluginPath = new Path(PackageInfo.sInstPath, \"plugins\");\n\n Path pluginPath = \n new Path(rootPluginPath, vendor + \"/\" + ptype + \"/\" + name + \"/\" + vid);\n\n pResourceRootPath = new Path(pluginPath, \".resources\");\n\n LogMgr.getInstance().log\n (LogMgr.Kind.Plg, LogMgr.Level.Finest, \n \"Resource path (\" + pResourceRootPath + \") \" + \n \"for Plugin (\" + vendor + \"/\" + ptype + \"/\" + name + \"/\" + vid + \")\");\n }", "public PIInfo() {\n }", "public BuildAnalyzerPlugin() {\n\t\tsuper();\n\t\tmonitor.register();\n\t\tplugin = this;\n\t}", "public ClassBundle() {\n }", "private VerifierFactory() {\n }", "public interface Reflection {\n\t/**\n\t * Creates the template which specifies which constructor to \n\t * call upon. The specifies the classes of the arguments which\n\t * need to be given to the constructor.\n\t */\n\t@SuppressWarnings(\"unchecked\")\n\tpublic Class[] getTemplate();\n\t\n\t/**\n\t * Create the object array which serves as the parameters \n\t * to construct another object of this type.\n\t */\n\tpublic Object[] getConstructorArgs ();\n}", "private PluginRegistry(@Nonnull Config config,\n @Nonnull Map<String, PluginMap> pluginMapsByCategory,\n @Nonnull BiMap<Class<?>, PluginMap> pluginMapsByClass) {\n this.config = config;\n this.pluginMapsByCategory = pluginMapsByCategory;\n this.pluginMapsByClass = pluginMapsByClass;\n }", "public static void main(String[] args) throws InstantiationException, IllegalAccessException, ClassNotFoundException {\n\ttry {\n\tClass cls=Class.forName(\"udemy.ObjCreation\");\n\tObjCreation o=(ObjCreation)cls.newInstance();\n\tSystem.out.println(o.a);\n\t}\n\tcatch(InstantiationException e) {\n\t\te.printStackTrace();\n\t}\n\tcatch(IllegalAccessException e) {\n\t\te.printStackTrace();\n\t}\n\tcatch(ClassNotFoundException e) {\n\t\tSystem.out.println(\"not found class\");\n\t\te.printStackTrace();\n\t}\n}", "public void loadPluginsStartup();" ]
[ "0.7197168", "0.6677877", "0.6550236", "0.65090954", "0.64255214", "0.6381311", "0.63779056", "0.63636076", "0.6252725", "0.620136", "0.61791974", "0.61373115", "0.6101616", "0.6059629", "0.60570425", "0.60316086", "0.5982488", "0.5952594", "0.5947042", "0.5943994", "0.5937352", "0.59048367", "0.58815277", "0.5879964", "0.5878403", "0.5878092", "0.584097", "0.58156514", "0.57954025", "0.57856834", "0.5781273", "0.577966", "0.57754976", "0.57710606", "0.57701117", "0.57542515", "0.5751603", "0.5726031", "0.57100993", "0.5708467", "0.5672958", "0.5652821", "0.56458074", "0.5640241", "0.5632084", "0.5631219", "0.5616317", "0.5590539", "0.5585778", "0.55636114", "0.555324", "0.5547211", "0.55439657", "0.5538704", "0.55348825", "0.5531689", "0.5510232", "0.5507483", "0.5500591", "0.55000305", "0.5484002", "0.5479293", "0.547318", "0.54662085", "0.54629755", "0.54609966", "0.5459913", "0.5459053", "0.5449938", "0.54444325", "0.5441234", "0.54273975", "0.5423295", "0.54001695", "0.539802", "0.5396227", "0.53955525", "0.53955525", "0.5391408", "0.53773725", "0.53700686", "0.53642267", "0.5360752", "0.53573", "0.5356778", "0.5352973", "0.53485245", "0.53454715", "0.53419477", "0.5334453", "0.53257334", "0.53254855", "0.53219557", "0.5315115", "0.5308765", "0.53041804", "0.5302355", "0.5298331", "0.5296274", "0.52947867", "0.5290231" ]
0.0
-1
This method filters creating same objects.
public Word getWord(String wordName){ Word word = words.get(wordName); if (word == null){ word = new Word(wordName); words.put(wordName, word); } return word; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static Filter newFilter()\r\n {\r\n Filter filter = new Filter(\"filter1\", new Source(\"display1\", \"name1\", \"server\", \"key1\"));\r\n filter.getOtherSources().add(filter.getSource());\r\n Group group = new Group();\r\n group.addFilterCriteria(new Criteria(\"field1\", Conditional.EQ, \"123\"));\r\n Group group2 = new Group();\r\n group2.addFilterCriteria(new Criteria(\"field1\", Conditional.EQ, \"124\"));\r\n group.addFilterGroup(group2);\r\n filter.setFilterGroup(group);\r\n return filter;\r\n }", "private static <T> void cloneCollection(Collection<T> originalCollection, Collection<T> clonedCollection, PropertyFilter propertyFilter) {\n\t\tJpaCloner jpaCloner = new JpaCloner(propertyFilter);\n\t\tSet<Object> exploredEntities = new HashSet<Object>();\n\t\tfor (T root : originalCollection) {\n\t\t\tclonedCollection.add(clone(root, jpaCloner, exploredEntities));\n\t\t}\n\t}", "protected boolean filterOutObject(PhysicalObject object) {\n return false;\n }", "@Test\r\n\tpublic void testInstanceFiltering() {\n\t\t\r\n\t\tMetaModel lhsUnfiltered = this.metaModelFactory.getLHSMetaModel();\r\n\t\t\r\n\t\tassertTrue(\"Unfiltered LHS MetaModel has unexpected amount of classes\", lhsUnfiltered.getClasses().size() == 8);\r\n\t\tassertTrue(\"Unfiltered LHS MetaModel has unexpected amount of attributes\", lhsUnfiltered.getAttributes().size() == 7);\r\n\t\tassertTrue(\"Unfiltered LHS MetaModel has unexpected amount of references\", lhsUnfiltered.getReferences().size() == 16);\r\n\t\t\r\n\t\tMetaModel rhsUnfiltered = this.metaModelFactory.getRHSMetaModel();\r\n\t\tassertTrue(\"Unfiltered RHS MetaModel has unexpected amount of classes\", rhsUnfiltered.getClasses().size() == 7);\r\n\t\tassertTrue(\"Unfiltered RHS MetaModel has unexpected amount of attributes\", rhsUnfiltered.getAttributes().size() == 12);\r\n\t\tassertTrue(\"Unfiltered RHS MetaModel has unexpected amount of references\", rhsUnfiltered.getReferences().size() == 8);\r\n\t\t\r\n\t\tthis.metaModelFactory.addFilter(new InstanceFilter());\r\n\t\t\r\n\t\tMetaModel lhsFiltered = this.metaModelFactory.getLHSMetaModel();\r\n\t\t\r\n\t\t// Classes Model, Attribute, Entity\r\n\t\tassertTrue(\"Filtered LHS MetaModel has unexpected amount of classes\", lhsFiltered.getClasses().size() == 3);\r\n\t\tassertTrue(\"Filtered LHS MetaModel has unexpected amount of attributes\", lhsFiltered.getAttributes().size() == 2);\r\n\t\tassertTrue(\"Filtered LHS MetaModel has unexpected amount of references\", lhsFiltered.getReferences().size() == 3);\r\n\t\t\r\n\t\t\r\n\t\tMetaModel rhsFiltered = this.metaModelFactory.getRHSMetaModel();\r\n\t\t\r\n\t\tassertTrue(\"Filtered RHS MetaModel has unexpected amount of classes\", rhsFiltered.getClasses().size() == 3);\r\n\t\tassertTrue(\"Filtered RHS MetaModel has unexpected amount of attributes\", rhsFiltered.getAttributes().size() == 4);\r\n\t\tassertTrue(\"Filtered RHS MetaModel has unexpected amount of references\", rhsFiltered.getReferences().size() == 2);\r\n\t}", "public ObjectFilter()\n\t{\n\t}", "@Override\n public int filterOrder() {\n return 1;\n }", "@Override\n public int filterOrder() {\n return 1;\n }", "@Override\n public boolean shouldFilter() {\n return true;\n }", "void filterCreate(ServerContext context, CreateRequest request,\n ResultHandler<Resource> handler, RequestHandler next);", "private static <T> void cloneCollection(Collection<T> originalCollection, Collection<T> clonedCollection, PropertyFilter propertyFilter, String... patterns) {\n\t\tJpaCloner jpaCloner = new JpaCloner(propertyFilter);\n\t\tfor (T root : originalCollection) {\n\t\t\tclonedCollection.add(clone(root, jpaCloner, patterns));\n\t\t}\n\t}", "public static <T> Set<T> clone(Set<T> set, PropertyFilter propertyFilter) {\n\t\tSet<T> clonedSet = new HashSet<T>();\n\t\tcloneCollection(set, clonedSet, propertyFilter);\n\t\treturn clonedSet;\n\t}", "private void clearAllFilter() {\n }", "private LinkgrabberFilterRule getCurrentCopy() {\r\n LinkgrabberFilterRule ret = this.rule.duplicate();\r\n save(ret);\r\n return ret;\r\n }", "public SamFilterParams create() {\n return new SamFilterParams(this);\n }", "public Object clone() {\n return new RelevantObjectsCommand(name, \n relevantStateVariables, \n relevantObjects,\n relevancyRelationship);\n }", "List<GElement> getCopiesOfSelection(List selectedObjects) {\n\t\tList<GElement> toCopy = new ArrayList<GElement>();\n\t\tfor (Iterator it = selectedObjects.iterator(); it.hasNext();) {\n\t\t\tObject o = it.next();\n\t\t\tif(o instanceof GElementEditPart){\n\t\t\t\ttoCopy.add(((GElementEditPart)o).getCastedModel());\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\n\t\tMap<GElement, GElement> orig2Copy = new HashMap<GElement, GElement>();\n\t\tList<GElement> copied = new ArrayList<GElement>();\n\t\tfor (GElement el: toCopy){\n\t\t\tGElement copy = el.getCopy();\n\t\t\tcopied.add(copy);\n\t\t\torig2Copy.put(el, copy);\n\t\t}\n\t\t\n\t\tfor (GElement el: toCopy){\n\t\t\tList<Connection> srces = el.getSrcConnections();\n\t\t\tfor (Connection c: srces){\n\t\t\t\tif(toCopy.contains(c.getTarget())){\n\t\t\t\t\tnew Connection(orig2Copy.get(c.getSource()),orig2Copy.get(c.getTarget()) );\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn copied;\n\t}", "@Override\n public List<MongoPrideAssay> filterByAttributes(List<Triple<String, String, String>> filters) {\n Query queryMongo = PrideMongoUtils.buildQuery(filters);\n return mongoTemplate.find(queryMongo, MongoPrideAssay.class);\n }", "PropertiedObjectFilter<O> getFilter();", "private List<String> retrieveObjectsInRoom(Room room) {\n List<String> retirevedInRoom = new ArrayList<>();\n for (String object : room.getObjects()) {\n if (wantedObjects.contains(object)) {\n retirevedInRoom.add(object);\n }\n }\n return retirevedInRoom;\n }", "@Override\n\tpublic int filterOrder() {\n\t\treturn 1;\n\t}", "public Results copy()\n {\n Results copy = new Results();\n for(Object object : results) {\n copy.add( object );\n }\n return copy;\n }", "public List<OnlineObject> getNewObjects() {\n\t\tsynchronized (this.onlineObjects) {\n\t\t\treturn new ArrayList<OnlineObject>(this.recentlyAddedObjects);\n\t\t}\n\t}", "static ObjectInputFilter createFilter(String param2String, boolean param2Boolean) {\n/* 446 */ Global global = new Global(param2String, param2Boolean);\n/* 447 */ return global.isEmpty() ? null : global;\n/* */ }", "boolean doFilter() { return false; }", "@Override\n\tpublic boolean shouldFilter() {\n\t\treturn true;\n\t}", "Collection<? extends Object> getSameAs();", "static ObjectInputFilter createFilter(String param2String, boolean param2Boolean) {\n/* 448 */ Global global = new Global(param2String, param2Boolean);\n/* 449 */ return global.isEmpty() ? null : global;\n/* */ }", "@Override\n public boolean equals(Object objectToCompare)\n {\n if (this == objectToCompare)\n {\n return true;\n }\n if (!(objectToCompare instanceof RelationshipCreateRequest))\n {\n return false;\n }\n RelationshipCreateRequest that = (RelationshipCreateRequest) objectToCompare;\n return Objects.equals(getRelationshipTypeGUID(), that.getRelationshipTypeGUID()) &&\n Objects.equals(getInitialProperties(), that.getInitialProperties()) &&\n Objects.equals(getEntityOneGUID(), that.getEntityOneGUID()) &&\n Objects.equals(getEntityTwoGUID(), that.getEntityTwoGUID()) &&\n getInitialStatus() == that.getInitialStatus();\n }", "public static void main(String[] args) {\n HashSet<Person> set = new HashSet<>(10);\n for (int i = 0; i < 10; i++) {\n set.add(new Person(\"person\" + i, i));\n }\n for (int i = 0; i < 10; i++) {\n set.add(new Person(\"person\", 15));\n }\n Person p1 = new Person(\"person\", 15);\n Person p2 = new Person(\"person\", 15);\n System.out.println(p1 + \" hascode: \" + p1.hashCode());\n System.out.println(p2 + \" hascode: \" + p2.hashCode());\n System.out.println(\"person1 equals person2 \" + p1.equals(p2));\n for (Person person : set) {\n System.out.println(person);\n }\n }", "private Filter ssoFilter() {\n\t\tCompositeFilter filter = new CompositeFilter();\n\t\tList<Filter> filters = new ArrayList<>();\n\t\tfilters.add(ssoFilter(facebook(), \"/login/facebook\"));\n\t\tfilters.add(ssoFilter(github(), \"/login/github\"));\n//\t\tfilters.add(ssoFilter(twitter(), \"/login/twitter\"));\n\t\tfilters.add(ssoFilter(linkedin(), \"/login/linkedin\"));\n\t\tfilter.setFilters(filters);\n\t\treturn filter;\n\t}", "private static FieldInfos filterFields(FieldInfos fieldInfos) {\n List<FieldInfo> fieldInfoCopy = new ArrayList<>(fieldInfos.size());\n for (FieldInfo fieldInfo : fieldInfos) {\n fieldInfoCopy.add(\n new FieldInfo(\n fieldInfo.name,\n fieldInfo.number,\n false,\n false,\n false,\n IndexOptions.NONE,\n DocValuesType.NONE,\n -1,\n fieldInfo.attributes(),\n 0,\n 0,\n 0,\n 0,\n fieldInfo.getVectorSimilarityFunction(),\n fieldInfo.isSoftDeletesField()\n )\n );\n }\n FieldInfos newFieldInfos = new FieldInfos(fieldInfoCopy.toArray(new FieldInfo[0]));\n return newFieldInfos;\n }", "public static <T> T clone(T root, PropertyFilter propertyFilter) {\n\t\treturn clone(root, new JpaCloner(propertyFilter), new HashSet<Object>()); \n\t}", "private boolean updateFilter() {\n \tList<Rankable> items = rankings.getRankings();\n \tHashSet<String> hashtags = new HashSet<String>();\n \t\n \tfor (Rankable item: items) {\n \thashtags.add((String)item.getObject());\n }\n \t\n \n \t\n \tfor(String word: initialWords){\n \t\thashtags.add(word);\n \t}\n \n \tif(filter.equals(hashtags)){\n \t\treturn false;\n \t} else {\n \t\tfilter = hashtags;\n \t\treturn true;\n \t}\n \n\t\t\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\tSystem.out.println(\"FirstFilter::destroy\");\r\n\t}", "private Set<Staff> getClonedEquivalent(Set<Staff> originalStaff, Map<Long, Staff> oldIdToNewStaff) {\n\tSet<Staff> clonedStaffSet = new HashSet<Staff>();\n\tfor (Staff originalStf : originalStaff) {\n\t Staff newStaff = oldIdToNewStaff.get(originalStf.getId());\n\t if (newStaff == null) {\n\t\tcontinue;\n\t }\n\t clonedStaffSet.add(newStaff);\n\t}\n\treturn clonedStaffSet;\n }", "@Override\r\n protected boolean excludesAnd(AbstractResourceFilter<T> filter) {\n return this.equals(filter);\r\n }", "protected Shingle copy() {\n return new Shingle(this);\n }", "public boolean sameType(FilterCondition fc) {\n return fc.getClass() == getClass();\n }", "@Override\n public Filter getFilter() {\n\n return new Filter() {\n @Override\n protected FilterResults performFiltering(CharSequence charSequence) {\n\n String charString = charSequence.toString();\n\n if (charString.isEmpty()) {\n\n mDataset = mArrayList;\n } else {\n\n ArrayList<DataObject> filteredList = new ArrayList<>();\n\n for (DataObject data : mArrayList) {\n\n if (data.getid().toLowerCase().contains(charString.toLowerCase()) || data.getname().toLowerCase().contains(charString.toLowerCase())) {\n\n filteredList.add(data);\n }\n }\n\n mDataset = filteredList;\n }\n\n FilterResults filterResults = new FilterResults();\n filterResults.values = mDataset;\n return filterResults;\n }\n\n @Override\n protected void publishResults(CharSequence charSequence, FilterResults filterResults) {\n mDataset = (ArrayList<DataObject>) filterResults.values;\n notifyDataSetChanged();\n }\n };\n }", "private Reviews filterByFunc(FilterFunction filterFunc)\n\t{\n\t\tArrayList<Review> filteredList = new ArrayList<Review>();\n\t\tfor(Review review : list)\n\t\t\tif(filterFunc.filter(review))\n\t\t\t\tfilteredList.add(review);\n\t\treturn new Reviews(filteredList);\n\t}", "@Override\n\tpublic String create(Set<String> filterField) {\n\t\treturn null;\n\t}", "private ArrayList<Task> filterByDate(ArrayList<Task> toFilter, Date date) {\n ArrayList<Integer> toDelete = new ArrayList<Integer>();\n Calendar calAim = Calendar.getInstance();\n Calendar calTest = Calendar.getInstance();\n calAim.setTime(date);\n\n //remove all on different dates\n for (int i = 0; i < toFilter.size(); i++) {\n if (toFilter.get(i).getClass().equals(Deadline.class)) {\n Deadline temp = (Deadline) toFilter.get(i);\n calTest.setTime(temp.getTime());\n } else if (toFilter.get(i).getClass().equals(Event.class)) {\n Event temp = (Event) toFilter.get(i);\n calTest.setTime(temp.getTime());\n } else if (toFilter.get(i).getClass().equals(Period.class)) {\n Period temp = (Period) toFilter.get(i);\n calTest.setTime(temp.getStart());\n }\n boolean sameDay = calAim.get(Calendar.DAY_OF_YEAR) == calTest.get(Calendar.DAY_OF_YEAR)\n && calAim.get(Calendar.YEAR) == calTest.get(Calendar.YEAR);\n if (!sameDay) {\n toDelete.add(i);\n }\n }\n\n for (int i = toDelete.size() - 1; i >= 0; ) {\n toFilter.remove((int) toDelete.get(i));\n i--;\n }\n return toFilter;\n }", "public interface Filter extends Cloneable {\n public abstract Filter createClone();\n\n}", "public List<ProductToBuyViewModel> filterProductsToBuyList(List<ProductToBuyViewModel> productList){\n\n List<ProductToBuyViewModel> filteredList = new ArrayList<>();\n for (int i = 0; i < productList.size(); i++) {\n ProductToBuyViewModel product = productList.get(i);\n\n ProductToBuyViewModel newProduct = new ProductToBuyViewModel();\n newProduct.setProductId(product.getProductId());\n newProduct.setQuantity(product.getQuantity());\n\n filteredList.add(newProduct);\n }\n\n //List with uniques inventoryId\n Set<Integer> productId = new HashSet<>();\n\n for(int i = 0; i < filteredList.size(); i++){\n\n ProductToBuyViewModel product = filteredList.get(i);\n Integer inId = product.getProductId();\n\n if(productId.add(inId) == false){\n\n int quantity = product.getQuantity();\n\n for(int x = 0; x < filteredList.size(); x++){\n\n ProductToBuyViewModel product2 = filteredList.get(x);\n\n if(product2.getProductId() == inId){\n\n product2.setQuantity(product2.getQuantity() + quantity);\n filteredList.remove(i);\n\n //To break the loop\n x = filteredList.size();\n }\n }\n i = -1;\n productId.clear();\n }\n }\n return filteredList;\n }", "protected boolean allowsDuplicates(Class type) {\n return !Set.class.isAssignableFrom(type);\n }", "@Override\n public void checkActivityUnique(ActivityWrapper newActivity) throws RecordAlreadyExistsException {\n Activity[] filtered = filterList(a -> {\n Activity activity = (Activity) a;\n return activity.getEndTime().equals(newActivity.getEndTime())\n && activity.getStartTime().equals(newActivity.getStartTime())\n && activity.getTitle().equalsIgnoreCase(newActivity.getTitle());\n });\n\n if (filtered.length > 0) {\n throw new RecordAlreadyExistsException(\"activities\",\n \"title '\" + filtered[0].getTitle() + \"' and times '\" + filtered[0].getStartTime() + \" - \" + filtered[0].getEndTime() +\n \"'\");\n }\n }", "ObservableList<Person> getFilteredPersonList();", "protected Graph filterGraph(final Collection<Object> roots) {\n final Set<Relation> edges = graph.getEdges();\n // crate object->relations mapping\n final Map<cz.cuni.mff.ufal.textan.core.Object, Set<Relation>> objRels = new HashMap<>();\n for (Relation relation : edges) {\n for (Triple<Integer, String, cz.cuni.mff.ufal.textan.core.Object> triple : relation.getObjects()) {\n final cz.cuni.mff.ufal.textan.core.Object obj = triple.getThird();\n if (!ignoredObjectTypes.contains(obj.getType())) {\n Set<Relation> rels = objRels.get(obj);\n if (rels == null) {\n rels = new HashSet<>();\n objRels.put(obj, rels);\n }\n rels.add(new Relation(relation));\n }\n }\n }\n //initilization\n final Map<Long, cz.cuni.mff.ufal.textan.core.Object> newNodes = new HashMap<>();\n final Set<Relation> newEdges = new HashSet<>();\n final Set<Relation> doneRelations = new HashSet<>(); //processed relations\n final Set<cz.cuni.mff.ufal.textan.core.Object> doneObjects = new HashSet<>(); //processed objects\n final Deque<cz.cuni.mff.ufal.textan.core.Object> stack = new ArrayDeque<>(); //objects whose relations need processing\n for (Object root : roots) {\n newNodes.put(root.getId(), root);\n doneObjects.add(root);\n stack.add(root);\n }\n //filtering\n while (!stack.isEmpty()) {\n final cz.cuni.mff.ufal.textan.core.Object obj = stack.pop();\n final Set<Relation> rels = objRels.get(obj);\n if (rels == null) {\n continue;\n }\n for (Relation rel : rels) {\n if (doneRelations.contains(rel)) {\n continue;\n }\n doneRelations.add(rel);\n if (ignoredRelationTypes.contains(rel.getType())) {\n continue;\n }\n final Set<Triple<Integer, String, cz.cuni.mff.ufal.textan.core.Object>> newObjs = new HashSet<>();\n for (Triple<Integer, String, cz.cuni.mff.ufal.textan.core.Object> triple : rel.getObjects()) {\n if (!ignoredObjectTypes.contains(triple.getThird().getType())) {\n newObjs.add(triple);\n if (!doneObjects.contains(triple.getThird())) {\n doneObjects.add(triple.getThird());\n newNodes.put(triple.getThird().getId(), triple.getThird());\n stack.add(triple.getThird());\n }\n }\n }\n //add only if there are more objects connected\n //or if the original relation was unary too\n if (newObjs.size() > 1 || rel.getObjects().size() == 1) {\n newEdges.add(rel);\n rel.getObjects().clear();\n rel.getObjects().addAll(newObjs);\n }\n }\n }\n //use new nodes and edges\n return new Graph(newNodes, newEdges);\n }", "private IdentifiableComparator() {\n\t\t// This class is not intended to create own objects from it.\n\t}", "public static void main(String[] args) {\n\t\tA1 a1=new A1(\"ram\",1,\"ram\");\n\t\tA1 a2=new A1(\"ram\",1,\"ram\");\n\t\tHashSet<A1> set=new HashSet<A1>();\n\t System.out.println(a1.getName());\n\t System.out.println(a2.getName());\n\t set.add(a1);\n\t set.add(a2);\n\t System.out.println(set.size());\n\t}", "public SamFilterParamsBuilder findAndRemoveDuplicates(final boolean val) {\n mFindAndRemoveDuplicates = val;\n return this;\n }", "@Override\n public boolean equals(Object o) {\n if(o == null){\n return false;\n }\n\n if (this == o) { return true; }\n if (getClass() != o.getClass()) { return false; }\n Query a_new = (Query) o;\n return this.requestedPosts== (a_new.getRequestedPosts()) && this.getQueryID() == a_new.getQueryID();\n }", "public abstract Instance duplicate();", "public static NodeFilter makeFilter()\n\t{\n\t\tNodeFilter[] fa = new NodeFilter[3];\n\t\tfa[0] = new HasAttributeFilter(\"HREF\");\n\t\tfa[1] = new TagNameFilter(\"A\");\n\t\tfa[2] = new HasParentFilter(new TagNameFilter(\"H3\"));\n\t\tNodeFilter filter = new AndFilter(fa);\n\t\treturn filter;\n\t}", "default Set<StackKey> findAll(Predicate<ItemStack> filter) {\n Set<StackKey> items = new HashSet<>();\n for (IInventoryAdapter inventoryObject : this) {\n for (IInvSlot slot : InventoryIterator.get(inventoryObject)) {\n ItemStack stack = slot.getStack();\n if (!InvTools.isEmpty(stack) && filter.test(stack)) {\n stack = stack.copy();\n InvTools.setSize(stack, 1);\n items.add(StackKey.make(stack));\n }\n }\n }\n return items;\n }", "static void findDuplicate()\n\t{\n\n\t\tList<String> oList = null;\n\t\tSet<String> oSet = null;\n\t\ttry {\n\t\t\toList = new ArrayList<String>();\n\t\t\toList.add(\"Apple\");\n\t\t\toList.add(\"Boy\");\n\t\t\toList.add(\"Frog\");\n\t\t\toList.add(\"Dog\");\n\t\t\toList.add(\"Eagle\");\n\t\t\toList.add(\"Frog\");\n\t\t\toList.add(\"Apple\");\n\t\t\toList.add(\"Boy\");\n\t\t\toList.add(\"Apple\");\n\t\t\toList.add(\"Boy\");\n\t\t\tSystem.out.println(oList);\n\t\t\t\n\t\t\toSet = new TreeSet<>();\n\t\t\t\n\t\t\tString s = \"\";\n\t\t\tfor(int i=0;i<oList.size();i++)\n\t\t\t{\n\t\t\t\tif((oSet.add(oList.get(i))==false) && (!s.contains(oList.get(i))))\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Duplicate: \"+oList.get(i));\n\t\t\t\t\ts+=oList.get(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}catch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\toList = null;\n\t\t\toSet = null;\n\t\t}\n\t}", "@Override\n protected void publishResults(CharSequence arg0, FilterResults arg1) {\n FilteredObjects = (ArrayList<Com_ItemObject>) arg1.values;\n notifyDataSetChanged();\n }", "public static <T> List<T> clone(List<T> list, PropertyFilter propertyFilter) {\n\t\tList<T> clonedList = new ArrayList<T>(list.size());\n\t\tcloneCollection(list, clonedList, propertyFilter);\n\t\treturn clonedList;\n\t}", "public boolean shouldFilter() {\n return true;\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tSet<Customer>customerset=new HashSet<Customer>();\r\n\t\t\r\n\t\t//let's create some equal objects and store them in the set.\r\n\t\tCustomer c1 =new Customer(\"Vikas\", \"Natick\",\"email_address\", 25, Gender.Male);\r\n\t\tCustomer c2 =new Customer(\"Vikas\", \"Natick\",\"email_address\",25, Gender.Male);\r\n\t\tCustomer c3 =new Customer(\"Vikas\", \"Natick\",\"email_address\",25, Gender.Male);\r\n\t\tcustomerset.add(c1);\r\n\t\tcustomerset.add(c2);\r\n\t\tcustomerset.add(c3);\r\n\t\t// without orverriding equals and override all the three objects would be added in the set\r\n\t\t//even when only equals method is overriddden but not hashcode, all the objects are duplicated. \r\n\t\tSystem.out.println(customerset);\r\n\t\t\r\n\r\n\t}", "@Test\r\n void filterMethod() {\r\n\t\tStream<TransactionBean> transactionBeanStream = transactions.stream().filter(t -> t.getType() == Transaction.GROCERY);\r\n\t\tList<TransactionBean> afterStreamList = transactionBeanStream.peek(System.out::println).collect(Collectors.toCollection(ArrayList::new));\r\n\t\tassertSame(\"wrong type\", Transaction.GROCERY, afterStreamList.get(0).getType());\r\n\t\tassertSame(\"wrong type\", Transaction.GROCERY, afterStreamList.get(1).getType());\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "void permutateObjects()\n {\n for (int i = 0; i < sampleObjects.length; i++)\n {\n for (int i1 = 0; i1 < (r.nextInt() % 7); i1++)\n {\n addToObject(sampleObjects[i], sampleStrings[r.nextInt(5)],\n sampleStrings[r.nextInt(5)]);\n addToObject(sampleObjects[i], sampleStrings[r.nextInt(5)],\n sampleNumbers[r.nextInt(5)]);\n addToObject(sampleObjects[i], sampleStrings[r.nextInt(5)],\n specialValues[r.nextInt(2)]);\n addToObject(sampleObjects[i], sampleStrings[r.nextInt(5)],\n sampleArrays[r.nextInt(5)]);\n }\n }\n }", "public Results cloneResults(boolean matchesFilterOnly) {\r\n Results clone = new Results(this);\r\n for (int irow = 0; irow < this.getActualRowCount(); irow++) {\r\n ResultRow row = this.getRow(irow);\r\n if (matchesFilterOnly) {\r\n Boolean match = (Boolean) row.getRowAnnotation(AnomalySearchConstants.ROWANNOTATIONKEY_MATCHED_SEARCH);\r\n if (match != null && match) {\r\n clone.addRow(row);\r\n }\r\n } else {\r\n clone.addRow(row);\r\n }\r\n }\r\n return clone;\r\n }", "@Test\n\tpublic void CreateNewFilter() throws Throwable\n\t{\n\t\t\n\t\tHome h=new Home(driver);\n\t\th.getConatctLink().click();\n\t\t\n\t\tContacts c=new Contacts(driver);\n\t\tc.clickOnFilterLnk();\n\t\t\n\t\tCreateNewFilterPage nfp=new CreateNewFilterPage(driver);\n\t\tnfp.EnterViweName(driver).sendKeys(\"sam\"+\"_\"+wLib.getRamDomNum());\n\t\tnfp.clickOnSaveBtn();\n\t\t\n\t\tContacts c1=new Contacts(driver);\n\t\tc1.clickOnFilterLnk();\n\t\t\n\t\tCreateNewFilterPage nfp1=new CreateNewFilterPage(driver);\n\t\tnfp1.EnterViweName(driver).sendKeys(\"saigun\"+\"_\"+wLib.getRamDomNum());\n\t\tnfp1.clickOnSaveBtn();\n\t\t\n\t\t\n\t}", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }" ]
[ "0.5444329", "0.5342161", "0.5293217", "0.5273742", "0.52000695", "0.51993865", "0.51993865", "0.5137831", "0.5106418", "0.5092942", "0.5088498", "0.50646657", "0.5026058", "0.499525", "0.49883556", "0.49743056", "0.4964455", "0.4954479", "0.4951456", "0.49224803", "0.49154943", "0.49144346", "0.4912913", "0.49117813", "0.4911737", "0.48999447", "0.48908746", "0.48887253", "0.48861495", "0.48498967", "0.48462725", "0.48423767", "0.483366", "0.48167637", "0.4806047", "0.47979724", "0.4795071", "0.4792554", "0.478661", "0.47853947", "0.47762662", "0.4762587", "0.4751928", "0.47460175", "0.47384563", "0.4734231", "0.47318062", "0.47303888", "0.47280377", "0.47225213", "0.46996328", "0.46883035", "0.4687971", "0.46877852", "0.468588", "0.46823773", "0.4679369", "0.46774405", "0.46753034", "0.46732017", "0.4670502", "0.46694258", "0.46694258", "0.46694258", "0.46694258", "0.46694258", "0.46694258", "0.46694258", "0.46694258", "0.46694258", "0.46694258", "0.46694258", "0.46694258", "0.46694258", "0.46694258", "0.46694258", "0.46694258", "0.46694258", "0.46694258", "0.46694258", "0.46694258", "0.46694258", "0.46694258", "0.4667657", "0.46615738", "0.4661452", "0.46491286", "0.46491286", "0.46491286", "0.46491286", "0.46491286", "0.46491286", "0.46491286", "0.46491286", "0.46491286", "0.46491286", "0.46491286", "0.46491286", "0.46491286", "0.46491286", "0.46491286" ]
0.0
-1
Called when an item has been stored.
void onItemStored(EntityId storedItem);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void store(Item item) {\n this.items.add(item);\n }", "@Override\n\tItem save(Item item);", "public void onSetNewCurrentItem() {\n }", "public void handleStore()\r\n {\r\n //\r\n }", "public void save(Item item) {\r\n \t\tpersistenceManager.save(item);\r\n \t}", "protected void doStore(String description, Object item, String supplier) {\n items.put(description, item);\n suppliers.put(supplier, description);\n }", "@Override\r\n\t\t\tpublic void itemStateChanged(ItemEvent e) {\n\t\t\t}", "@Override\n public void onReceiveItem(InventoryItem itemReceived) {\n inventory.add(itemReceived);\n }", "@Override\r\n\tpublic void itemStateChanged(ItemEvent e) {\n\t\t\r\n\t}", "@Override\n\tpublic void itemSave(User savedBy, final HomeItem item)\n\t{\n\t\tif (item.getPublished() && !item.isValid())\n\t\t{\n\t\t\titem.setPublished(Boolean.FALSE);\n\t\t}\n\n\t\tif (((HomeItemImpl) item).isChanged() || item.getId() == null)\n\t\t{\n\t\t\tif (((HomeItemImpl) item).isChanged())\n\t\t\t{\n\t\t\t\t// set modified by/on\n\t\t\t\t((HomeItemImpl) item).initModifiedBy(savedBy);\n\t\t\t\t((HomeItemImpl) item).initModifiedOn(new Date());\n\n\t\t\t\t// deal with the content\n\t\t\t\t((HomeItemImpl) item).saveContent(savedBy);\n\t\t\t}\n\n\t\t\t// insert or update\n\t\t\tif (item.getId() == null)\n\t\t\t{\n\t\t\t\tsqlService().transact(new Runnable()\n\t\t\t\t{\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run()\n\t\t\t\t\t{\n\t\t\t\t\t\tinsertItemTx((HomeItemImpl) item);\n\n\t\t\t\t\t}\n\t\t\t\t}, \"save(insert)\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsqlService().transact(new Runnable()\n\t\t\t\t{\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run()\n\t\t\t\t\t{\n\t\t\t\t\t\tupdateItemTx((HomeItemImpl) item);\n\n\t\t\t\t\t}\n\t\t\t\t}, \"save(update)\");\n\t\t\t}\n\n\t\t\t((HomeItemImpl) item).clearChanged();\n\t\t}\n\t}", "@Override\n\tpublic void itemStateChanged(ItemEvent arg0) {\n\n\t}", "@Override\n\tpublic void itemStateChanged(ItemEvent arg0) {\n\n\t}", "public void onAdicionarItemTroca()\n\t{\n\t\t\n\t}", "@Override\n\tpublic void itemStateChanged(ItemEvent e) {\n\t\t\n\n\t\t\n\t}", "@Override\r\n\tpublic void itemStateChanged(ItemEvent arg0) {\n\r\n\t}", "public Object putItem (String key, Object item);", "@Override\r\n\t\t\t\t\tpublic void addItemEventOccurred(AddItemEvent event) {\n\r\n\t\t\t\t\t}", "public abstract void addItemListener(ItemListener listener);", "public void storeItemPosition(long position) {\n\t\tmEditor.putLong(\"KEY_DATA_POSITION\", position);\n\t\tmEditor.commit();\n\t}", "@Override\r\n public void updatedSaleInventory(ItemAndQuantity lastItem) {\r\n }", "public void insert(KeyedItem newItem);", "@Override\n public Item vendItem(Item item) {\n allItems.put(item.getItemId(), item);\n return item;\n }", "public void setItem(Item item) {\n this.item = item;\n }", "public void save() {\n\t\tList<EmbeddedEntity> embeddedEntities = new ArrayList<>();\n\t\tfor (FeedItem item : items)\n\t\t\tembeddedEntities.add(item.getEntity());\n\t\tEntity feed = new Entity(getKey());\n\t\tfeed.setUnindexedProperty(\"items\", embeddedEntities); //NOI18N\n\t\tdatastore.put(feed);\n\t}", "public void itemStateChanged(ItemEvent e) {\n\t\t\t\t}", "@Override\n public String storeItem() {\n return \"N/\" + description;\n }", "@Override public void store(SQLiteDatabase db, List<TimelineItemDTOKey> items)\n {\n }", "@Override\n public void onAdded() {\n }", "void add(Item item);", "public interface CurrentItemListener {\n void onNewCurrentItem(int currentItem, int totalItemsCount);\n}", "public void itemStateChanged(ItemEvent arg0) {\n\t\t\r\n\t}", "@Override\n public void setChanged() {\n set(getItem());\n }", "@Override\n public void onNewItem(int faceId, Face item)\n {\n Log.d(APP_LOG_TAG, \"face detected\");\n }", "public void push(Object item) {\r\n\t\tdata.add(item);\r\n\r\n\t}", "private void storeEvent() throws IOException {\n\t\tMagical.getStorage().create(Storage.EVENTS_INDEX, event);\n\t\tMagical.addDisplayList(Storage.EVENTS_INDEX, event);\n\t}", "public void set(Item item) {\r\n if (lastAccessed == null) throw new IllegalStateException();\r\n lastAccessed.item = item;\r\n }", "void notifyListItemInserted(int position);", "public void onStoreReady() {\n mMxEventDispatcher.dispatchOnStoreReady();\n }", "@Override\r\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tif(dbHelper.InsertItem(listResult))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tSharedPreferences sharedPrefer = getSharedPreferences(getResources().getString(R.string.information_string), Context.MODE_PRIVATE);\r\n\t\t\t\t\t\t \tSharedPreferences.Editor sharedEditor = sharedPrefer.edit();\r\n\t\t\t\t\t\t \tsharedEditor.putString(getResources().getString(R.string.masterversion), Common.serverTime);\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t \tsharedEditor.commit();\r\n\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\tMessage msg = Message.obtain();\r\n\t\t\t\t\t\t\t\tmsg.obj = \"ProductItemSave\";\r\n\t\t\t\t\t\t\t\thandler.sendMessage(msg);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}", "@Override\r\n\tpublic void insertEncoreItem(Item item) {\n\t\tint i = sqlSession.insert(ns+\".insertEncoreItem\", item);\r\n\t\tif(i>0) System.out.println(\"insert Encore item1\");\r\n\t}", "protected void persist(T item) {\n\t\tSession session = null;\n\t\ttry {\n\t\t\tsession = mDbHelper.beginTransaction();\n\t\t\tsession.persist(item);\n\t\t\tmDbHelper.endTransaction(session);\n\t\t} catch (Exception e) {\n\t\t\tmDbHelper.cancelTransaction(session);\n\t\t\tAppLogger.error(e, \"Failed to execute persist\");\n\t\t}\n\t}", "public void store() {\r\n\t\tdata = busExt.get();\r\n\t}", "public void setItem (Item item)\n\t{\n\t\tthis.item = item;\n\t}", "@Override\n protected void executeLowLevelRequest() {\n doPutItem();\n }", "public void setItem(T item) {\n this.item = item;\n }", "@Override\n\tpublic void saveFoodItem(FoodItem item) {\n\t\tfoodItemRepository.save(item);\n\t}", "@Override\r\n\tpublic void storedBook(Book book) {\n\t\tticketDao.insertBook(book);\r\n\t}", "public void saveData() {\n if (dataComplete()) {\n if(validLengths())\n {\n Item old_item = items.get(item_index);\n int item_purchase_status = 0;\n if (!item_purchased.isChecked()) {\n item_purchase_status = 1;\n }\n\n ds.open();\n Item new_item = new Item(old_item.id, item_name.getText().toString(), item_category.getText().toString(),\n item_description.getText().toString(), Double.parseDouble(item_price.getText().toString()), item_purchase_status);\n boolean success = ds.editEntry(new_item);\n ds.close();\n\n if (success) {\n exit();\n } else {\n empty_error.setVisibility(empty_error.INVISIBLE);\n overflow_error.setVisibility(overflow_error.INVISIBLE);\n unexpected_error.setVisibility(unexpected_error.VISIBLE);\n }\n }\n else\n {\n empty_error.setVisibility(empty_error.INVISIBLE);\n unexpected_error.setVisibility(unexpected_error.INVISIBLE);\n overflow_error.setVisibility(overflow_error.VISIBLE);\n }\n } else {\n unexpected_error.setVisibility(unexpected_error.INVISIBLE);\n overflow_error.setVisibility(overflow_error.INVISIBLE);\n empty_error.setVisibility(empty_error.VISIBLE);\n }\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}", "private void onLoad(Item item) {\n ImageView view = new ImageView(item.getIcon());\n addDragEventHandlers(view, DRAGGABLE_TYPE.ITEM, unequippedInventory, equippedItems);\n addEntity(item, view);\n unequippedInventory.getChildren().add(view);\n System.out.println(\"Get new Item \" + item.getName() + \" in Inventory\");\n }", "public void setItem (jkt.hms.masters.business.MasStoreItem item) {\n\t\tthis.item = item;\n\t}", "public abstract void addItem(AbstractItemAPI item);", "@Override // see item.java\n\tpublic void useItem() {\n\n\t}", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n // Save the values.\n outState.putInt(BOOK_QUANTITY, quantity);\n }", "@Override\n public void onItemInserted(Object toInsert, String prevId) {\n if(toInsert instanceof SpotifyItem)\n return;\n DrinkInfo prevItem = new DrinkInfo();\n prevItem.setFirebaseId(prevId);\n\n //Get position of the preceeding item\n int prevIndex = mDrinkInfos.indexOf(prevItem);\n\n if(prevIndex == -1)\n prevIndex = 0;\n Log.d(TAG, \"Array size = \" + mDrinkInfos.size() + \", prevIndex = \" + prevIndex);\n\n //Perform insertion\n mDrinkInfos.add(mDrinkInfos.size(), (DrinkInfo)toInsert);\n Log.d(TAG, \"Added: \" + ((DrinkInfo) toInsert).getDrinkName() + \", at index: \" + prevIndex);\n mDrinkQueueAdapter.notifyDataSetChanged();\n }", "public void save() {\r\n\t\tGame.getInstance().getInventory().add(id);\r\n\t}", "@Override\r\n public void onResponse(@Nonnull com.apollographql.apollo.api.Response<OnCreateBuyableItemSubscription.Data> response) {\n Log.i(TAG, \"new data added\");\r\n final BuyableItem newItem = new BuyableItem(response.data().onCreateBuyableItem().title(), response.data().onCreateBuyableItem().priceInCents());\r\n Handler handler = new Handler(Looper.getMainLooper()) {\r\n @Override\r\n public void handleMessage(Message inputMessage) {\r\n buyableItemAdapter.addItem(newItem);\r\n }\r\n };\r\n\r\n handler.obtainMessage().sendToTarget();\r\n\r\n }", "public void fireOnItemAddedToInventoryCommands();", "public interface NewBucketListItemListener {\n\n void createBucketItem(String title, String description, int color);\n}", "protected void save(T item) {\n\t\tSession session = null;\n\t\ttry {\n\t\t\tsession = mDbHelper.beginTransaction();\n\t\t\tsession.save(item);\n\t\t\tmDbHelper.endTransaction(session);\n\t\t} catch (Exception e) {\n\t\t\tmDbHelper.cancelTransaction(session);\n\t\t\tAppLogger.error(e, \"Failed to execute save\");\n\t\t}\n\t}", "public void putItemByKey(String key, Item value) {\n throw new OurBadException(\" Item '\" + this.serialize() + \"' is not an object.\");\n }", "public void doCreateItem() {\r\n\t\tlogger.info(\"Se procede a crear el book \" + newItem.getDescription());\r\n\t\tBook entity = newItem.getEntity();\r\n\t\tentity.setUser(Global.activeUser());\r\n\t\tentity.setBookBalance(BigDecimal.ZERO);\r\n\t\tentity.setTotalBudget(BigDecimal.ZERO);\r\n\t\tentity.setTotalIncome(BigDecimal.ZERO);\r\n\t\tentity.setTotalExpenses(BigDecimal.ZERO);\r\n\t\tentity = bookService.create(entity);\r\n\r\n\t\t// Actualizar el mapa de books\r\n\t\tGlobalBook.instance().put(new BookData(entity));\r\n\r\n\t\tlogger.info(\"Se ha creado el book \" + newItem.getDescription());\r\n\t\tnewItem = new BookData(new Book());\r\n\t\tFacesContext.getCurrentInstance().addMessage(null,\r\n\t\t\t\tnew FacesMessage(FacesMessage.SEVERITY_INFO, \"Libro creado\", \"Libro creado correctamente\"));\r\n\t}", "@Override\r\n public void onCompleted() {\n Log.i(TAG, \"subscribed to buyable items\");\r\n }", "public void itemStateChanged(ItemEvent e){\n\n // YOU CODE HERE\n }", "public void onInventoryChanged();", "@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 }", "@Override\r\n public void handleMessage(Message inputMessage){\n Log.i(\"graphql insert\", \"made it to the callback\");\r\n //grab the data\r\n CreateBuyableItemMutation.CreateBuyableItem item = response.data().createBuyableItem();\r\n //make a new buyable item with it\r\n buyableItems.add(new BuyableItem(item));\r\n recyclerView.getAdapter().notifyDataSetChanged();\r\n\r\n }", "@Override\n\tpublic void viewItem() {\n\t\t\n\t}", "public jkt.hms.masters.business.MasStoreItem getItem () {\n\t\treturn item;\n\t}", "private void saveProduct() {\n //Delegating to the Presenter to trigger focus loss on listener registered Views,\n //in order to persist their data\n mPresenter.triggerFocusLost();\n\n //Retrieving the data from the views and the adapter\n String productName = mEditTextProductName.getText().toString().trim();\n String productSku = mEditTextProductSku.getText().toString().trim();\n String productDescription = mEditTextProductDescription.getText().toString().trim();\n ArrayList<ProductAttribute> productAttributes = mProductAttributesAdapter.getProductAttributes();\n mCategoryOtherText = mEditTextProductCategoryOther.getText().toString().trim();\n\n //Delegating to the Presenter to initiate the Save process\n mPresenter.onSave(productName,\n productSku,\n productDescription,\n mCategoryLastSelected,\n mCategoryOtherText,\n productAttributes\n );\n }", "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 }", "@Override\n protected void dataItemAdded(Series<Number, Number> series, int itemIndex, Data<Number, Number> item) {\n }", "@Override\r\n public void ItemQuantity(int quantity) {\n this.quantity = quantity;\r\n }", "protected void onAdd( E entity, int index )\r\n\t{\r\n\t\t\r\n\t}", "@Override\n\tpublic void push(E item) {\n\t\t\n\t}", "@Override\n protected void dataItemAdded(Series<Number, Number> series, int itemIndex, Data<Number, Number> item) {\n }", "public void setItemWanted(Item item) {\n itemWanted = item;\n }", "@Override\n public void onItemAdded(Object toAdd) {\n if(toAdd instanceof SpotifyItem)\n return;\n\n //Reflect changes in the drink list\n DrinkInfo item = (DrinkInfo)toAdd;\n Log.d(TAG, \"Array size = \" + mDrinkInfos.size());\n mDrinkInfos.add(mDrinkInfos.size(), item);\n mDrinkQueueAdapter.notifyDataSetChanged();\n Log.d(TAG, \"Added song: \" + item.getDrinkName());\n }", "void onSaved(SnapshotMetadata metadata) throws Exception;", "public interface ProductItemAvailableListener {\n void onProductItemAvailable(List<ProductItem> products);\n}", "public void saveItem(Items item) {\n\t\tItems item1 = itemDao.getItemByName(item.getItems1());\r\n\t\tif (item1 == null) {\r\n\t\t\titemDao.saveItem(item);\r\n\t\t} else if (item1.getItems1().equalsIgnoreCase(item.getItems1())) {\r\n\t\t\tSystem.out.println(\"Item already exists\");\r\n\t\t}\r\n\t}", "public void addItem(SoldItem item) {\n\n items.add(item);\n log.debug(\"Added \" + item.getName() + \" quantity of \" + item.getQuantity());\n\n }", "public void setItem (Object anObject)\r\n {\r\n // TODO: implement (?)\r\n }", "@Override\n\t\t\t\t\t\tpublic void onGetBookCartItemsSuccess(BookCardItemEntity cardItemEntity) {\n\t\t\t\t\t\t\tif (bookCartInfoListener != null) {\n\t\t\t\t\t\t\t\tbookCartInfoListener.onSuccess(false, cardItemEntity);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "@Override\n public <T> void storeInItemCache(String key, CacheElement<T> cacheElement, int dependingPublicationId, int\n dependingItemId) {\n\n if (!isEnabled()) {\n return;\n }\n\n CacheDependency dependency = new CacheDependencyImpl(dependingPublicationId, dependingItemId);\n List<CacheDependency> dependencies = new ArrayList<>();\n dependencies.add(dependency);\n storeInItemCache(key, cacheElement, dependencies);\n\n }", "public Item getItem() { \n return myItem;\n }", "public void setItem(ItemType item) {\n\t this.item = item;\n\t}", "public void setItem(ItemType item) {\n\t this.item = item;\n\t}", "public void onMenuSave() {\n String lastSavedPath = controller.getLastSavePath();\n\n if (lastSavedPath == null) {\n onMenuSaveAs();\n return;\n }\n\n handleFileStorageFactoryResult(controller.saveFile(lastSavedPath));\n }", "public void setEditedItem(Object item) {editedItem = item;}", "public interface onAddItemListener {\n void onAddItem(String item);\n}", "@Override\n\tpublic Boolean insert(Intervention item) {\n\t\treturn true;\n\t}", "@Override // see item.java\n\tpublic void pickUp() {\n\n\t}", "public void onSave() {\n\t\tsetCreationDate(new Date());\n\t\tPageAlias.create(this, null);\n\t\tupdateChildPaths();\n\t}", "@Override\n public void addItem(P_CK t) {\n \n }", "@Override\n\t\t\t\t\tpublic void onGetBookCartItemsSuccess(BookCardItemEntity cardItemEntity) {\n\t\t\t\t\t\tif (bookCartInfoListener != null) {\n\t\t\t\t\t\t\tbookCartInfoListener.onSuccess(false, cardItemEntity);\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "void insertItem(Position position, IItem item);", "@Override\n public void updateItem(P_CK t) {\n \n }", "public void save(Item file) {\n\t\tthis.getItemdao().save(file);\r\n\t}" ]
[ "0.7093229", "0.6623451", "0.6455247", "0.6367681", "0.62596285", "0.61556625", "0.6087866", "0.60846806", "0.6077842", "0.6057684", "0.6039786", "0.6039786", "0.6032316", "0.6031709", "0.5996691", "0.5993159", "0.596024", "0.59145457", "0.5912879", "0.5908252", "0.5882246", "0.58780116", "0.58486795", "0.5823868", "0.5819291", "0.5816919", "0.57838726", "0.5773051", "0.57688254", "0.57508993", "0.573725", "0.57306063", "0.5720131", "0.57187897", "0.5713345", "0.570823", "0.5700088", "0.56833404", "0.5678625", "0.5666917", "0.56495816", "0.5647195", "0.5646843", "0.562808", "0.5623261", "0.56218064", "0.56163853", "0.560787", "0.55832297", "0.55832297", "0.5576937", "0.5572582", "0.55535096", "0.5548056", "0.55379534", "0.55342305", "0.5530833", "0.55183536", "0.5515493", "0.5512659", "0.5511544", "0.5508244", "0.55053914", "0.5500232", "0.5499715", "0.5474237", "0.54686576", "0.5463962", "0.5448891", "0.54480994", "0.5448036", "0.5447698", "0.54379755", "0.5432273", "0.5413294", "0.54127795", "0.5412062", "0.54043823", "0.53978586", "0.5396657", "0.5393366", "0.53870237", "0.53868765", "0.53834754", "0.53798", "0.5379283", "0.5374741", "0.5371739", "0.5371739", "0.53699744", "0.53660154", "0.5349259", "0.5347297", "0.53383505", "0.5336956", "0.53275347", "0.5327249", "0.531866", "0.53177047", "0.5315235" ]
0.7251406
0
Called when an item has been dropped.
void onItemDropped(EntityId droppedItem);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onDropped();", "void onDrop(int from, int to);", "public interface DropListener {\n\t\n\t/**\n\t * Called when an item is to be dropped.\n\t * @param from - index item started at.\n\t * @param to - index to place item at.\n\t */\n\tvoid onDrop(int from, int to);\n}", "private void dropped(HeroItem item, Unit unit) {\n if (ItemMaster.isBreakable(item)) {\n item.broken(); // remove from game?\n if (item instanceof QuickItem) {\n QuickItem quickItemObj = (QuickItem) item;\n if (quickItemObj.isConcoction()) {\n quickItemObj.activate(Ref.getSelfTargetingRefCopy(unit)); // setForceTarget(true)\n }\n }\n } else {\n unit.getGame().getDroppedItemManager().itemFalls(unit.getCoordinates(), item);\n }\n }", "@Override\n\tpublic void dragDropped() {\n\n\t}", "protected void doItemDrop(Location loc, Player player, ItemStack itemStack) {\n // To avoid drops occasionally spawning in a block and warping up to the\n // surface, wait for the next tick and check whether the block is\n // actually unobstructed. We don't attempt to save the drop if e.g.\n // a mob is standing in lava, however.\n Bukkit.getScheduler().scheduleSyncDelayedTask(BeastMaster.PLUGIN, () -> {\n Block block = loc.getBlock();\n Location revisedLoc = (block != null &&\n !canAccomodateItemDrop(block) &&\n player != null) ? player.getLocation()\n : loc;\n org.bukkit.entity.Item item = revisedLoc.getWorld().dropItem(revisedLoc, itemStack);\n item.setInvulnerable(isInvulnerable());\n item.setGlowing(isGlowing());\n }, 1);\n }", "public void drop(String itemName, World world) {\n\t\tItem item = world.dbItems().get(itemName);\n\n\t\tList<Item> items = super.getItems();\n\t\tRoom room = super.getRoom();\n\t\tList<Item> roomItems = room.getItems();\n\n\t\tif (items.contains(item)) {\n\t\t\troom.addItem(item);\n\t\t\tsuper.removeItem(item);\n\t\t\tSystem.out.println(\"Dropped \" + item + \" on the floor.\");\n\t\t} else {\n\t\t\tSystem.out.println(\"No \" + item + \" in inventory.\");\n\t\t}\n\t}", "public String dropItem(String item){\n if(hasGrabbedItem(item)){\n grabbedItems.remove(item);\n return \"You have dropped: \" + item;\n }else{\n return \"You don't have one to drop.\";\n }\n }", "@Override\n\tprotected void on_object_drop(GfxObject bonus) {\n\n\t}", "public void dropItem(final String pStringItem){this.aItemsList.dropItem(pStringItem);}", "@Override\r\n public void drop(DropTargetDropEvent dtde) {\r\n onDropFile(dtde);\r\n }", "private void dropItem(String item)//Made by Justin\n {\n itemFound = decodeItem(item);\n if (itemFound == null)\n {\n System.out.println(\"I don't know of any \" + item + \".\");\n }\n else\n {\n player.inventoryDel(itemFound);\n }\n }", "public void onFrameDrop() {}", "@Override\n\tpublic Item getItemDropped(int par1, Random par2Random, int par3) {\n\t\treturn Item.getItemFromBlock(this);\n\t}", "@Override\n\tpublic void handleDrop(Player player, Task task, Game game) {\n\t\t\n\t}", "@Override\n\tpublic void handleDroppedCFComponent(CFComponent component) {\n\n\t}", "public boolean isDropped();", "public abstract void drop();", "public void dropItemAtCurrentPlace(Item it)\r\n\t{\r\n\t\tthis.currentPlace.addItem(it);\r\n\t}", "@SubscribeEvent(priority=EventPriority.NORMAL, receiveCanceled=true)\n\tpublic void spiderDrop(LivingDropsEvent event)\n\t{\n\t if (event.getEntity() instanceof EntitySpider)\n\t {\n\t int radomint=new Random().nextInt(3);\n\t if(radomint==0){\n\t ItemStack itemStackToDrop = new ItemStack(ItemLoader.spiderGland, 1);\n\t event.getDrops().add(new EntityItem(event.getEntity().worldObj, event.getEntity().posX, \n\t event.getEntity().posY, event.getEntity().posZ, itemStackToDrop));\n\t }\n\t }\n\t}", "public void dropItem(int x, int y, int i) {\n \n ParentItem item = getInventory()[i];\n \n if (item != null) {\n \n inventory.removeItem(i);\n \n item.putOnBoard(x, y, gameboard);\n \n }\n \n }", "public void drop(DropTargetEvent event) {\n if(dropItem == null)\n return;\n TreeObject[] sel = getSelection();\n for (int i = 0; i < sel.length; i++) {\n if(dropBefore) {\n sel[i].moveBefore(dropItem);\n } else if(dropInto) {\n sel[i].moveTo(dropItem);\n } else {\n sel[sel.length - i - 1].moveAfter(dropItem);\n }\n }\n treeViewer1.refresh();\n }", "public void dropItems() {\n\t\tlocation.getChunk().load();\n\t\tArrays.stream(inventory.getContents())\n\t\t\t.filter(ItemStackUtils::isValid)\n\t\t\t.forEach((item) -> location.getWorld().dropItemNaturally(location, item));\n\t\tinventory.clear();\n\t}", "void dropItem(Command command) {\n HashMap newInventory = inventory.getInventory();\n Iterator iterator = newInventory.entrySet().iterator();\n String seeItem;\n// int indexItem = -1;\n String nameOfItem = \"\";\n String dropFromInventory = \"debug\";\n\n while (iterator.hasNext()) {\n HashMap.Entry liste = (HashMap.Entry) iterator.next();\n String itemName = (String) liste.getKey();\n if (itemName.equalsIgnoreCase(command.getSecondWord())) {\n dropFromInventory = itemName;\n nameOfItem = itemName;\n break;\n }\n }\n if (!nameOfItem.equals(\"\")) {\n itemLocation.addItem(currentRoom, new PickableItem(nameOfItem, inventory.getItemWeight(nameOfItem), inventory.getUseable(nameOfItem)));\n inventory.removeItemInventory(nameOfItem);\n System.out.println(\"You have dropped: \" + nameOfItem);\n\n } else {\n System.out.println(\"Can't drop item that isn't in inventory \" + command.getSecondWord());\n }\n }", "public void dragDropEnd(DragSourceDropEvent evt) {\n }", "public int quantityDropped(Random par1Random)\n {\n return dropItemQty;\n }", "@Override\n public void onItemDismiss(int position) {\n dummyDataList.remove(position);\n notifyItemRemoved(position);\n\n }", "public void dropItem(Location loc){\n\t\t\n\t\tPlayer p = getThrower();\n\t\tItemStack droppedItem;\n\t\t\n\t\tdroppable.clear();\n\t\t\n\t\taddItem(Material.IRON_INGOT, 8, 8, 3); //Item, weight, maximum stack size, minimum stack size\n\t\taddItem(Material.GOLD_INGOT, 5, 5, 1);\n\t\taddItem(Material.DIAMOND, 3, 3, 1);\n\t\taddItem(Material.GOLDEN_APPLE, 1, 1, 1);\n\t\taddItem(Material.ROTTEN_FLESH, 10, 5, 1);\n\t\taddItem(Material.BREAD, 15, 32, 15);\n\t\taddItem(Material.BONE, 10, 5, 1);\n\t\taddItem(Material.SULPHUR, 10, 5, 1);\n\t\taddItem(Material.SADDLE, 1, 1, 1);\n\t\t\n\t\tint Size = droppable.size();\n\t\trandNum = ThreadLocalRandom.current().nextInt(Size);\n\t\t\n\t\tdroppedItem = droppable.get(randNum);\n\t\t\n\t\tp.getWorld().dropItem(loc, droppedItem);\n\t\tp.getWorld().dropItem(loc, new ItemStack(Material.GOLD_NUGGET, rand.nextInt(10) + 1));\n\t\t\n\t}", "@Override\n public void onItemDragStarted(int position) {\n }", "public void dropItem(Item seekItem)\n {\n //get each item from the items's array list.\n for (Item item : items){\n if(item.getName().equals(seekItem.getName())){\n currentRoom.getInventory().getItems().add(item);\n removePlayerItem(item);\n System.out.println(\"You have placed the \"+ item.getName() +\" in the \" + currentRoom.getName() + \".\");\n }\n }\n }", "public void setDropped(boolean dropped);", "public boolean dropItem(Items item)\n {\n boolean itemDropped = false;\n if(haveItem(item) && !currentRoom.haveItem(item)){ //if item in inventory not room\n \n Inventory.remove(item.getName(), item);\n //currentRoom.removeItem(item); //responsibility for this is in cmd_take\n itemsHeld --; //inventory tracker -1\n itemDropped = true;\n \n }\n return itemDropped;\n //if(haveItem(item))\n //Inventory.remove(item);\n //itemsHeld --; //inventory tracker -1\n \n }", "@Override\n\tpublic void drop(DropTargetDropEvent e) {\n\t\tgetContainerDelegate().removeFromPlaceHolderVisibleRequesters(getTargetComponent());\n\t\tgetTargetComponent().setFocused(false);\n\t\ttry {\n\t\t\tDataFlavor chosen = chooseDropFlavor(e);\n\t\t\tif (chosen == null) {\n\t\t\t\te.rejectDrop();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// the actions that the source has specified with\n\t\t\t// DragGestureRecognizer\n\t\t\tint sa = e.getSourceActions();\n\n\t\t\tif ((sa & acceptableActions) == 0) {\n\t\t\t\te.rejectDrop();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tObject data = null;\n\n\t\t\ttry {\n\n\t\t\t\t/*\n\t\t\t\t * the source listener receives this action in dragDropEnd. if\n\t\t\t\t * the action is DnDConstants.ACTION_COPY_OR_MOVE then the\n\t\t\t\t * source receives MOVE!\n\t\t\t\t */\n\n\t\t\t\tdata = e.getTransferable().getTransferData(chosen);\n\t\t\t\tif (logger.isLoggable(Level.FINE)) {\n\t\t\t\t\tlogger.fine(\"data is a \" + data.getClass().getName());\n\t\t\t\t}\n\t\t\t\tif (data == null) {\n\t\t\t\t\tthrow new NullPointerException();\n\t\t\t\t}\n\t\t\t} catch (Throwable t) {\n\t\t\t\tif (logger.isLoggable(Level.WARNING)) {\n\t\t\t\t\tlogger.warning(\"Couldn't get transfer data: \" + t.getMessage());\n\t\t\t\t}\n\t\t\t\tt.printStackTrace();\n\t\t\t\te.dropComplete(false);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (data instanceof FIBDraggable) {\n\n\t\t\t\ttry {\n\t\t\t\t\tFIBDraggable element = (FIBDraggable) data;\n\t\t\t\t\tif (element == null) {\n\t\t\t\t\t\te.rejectDrop();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tObject source = e.getSource();\n\n\t\t\t\t\t// OK, let's got for the drop\n\t\t\t\t\tif (source instanceof FIBDropTarget && element.acceptDragging((FIBDropTarget) source)) {\n\t\t\t\t\t\tPoint pt = e.getLocation();\n\t\t\t\t\t\tif (element.elementDragged((FIBDropTarget) source, pt)) {\n\t\t\t\t\t\t\te.acceptDrop(acceptableActions);\n\t\t\t\t\t\t\te.dropComplete(true);\n\t\t\t\t\t\t\tlogger.info(\"Drop succeeded\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\te.rejectDrop();\n\t\t\t\t\te.dropComplete(false);\n\t\t\t\t\treturn;\n\n\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\tlogger.warning(\"Unexpected: \" + e1);\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\te.rejectDrop();\n\t\t\t\t\te.dropComplete(false);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\te.rejectDrop();\n\t\t\te.dropComplete(false);\n\t\t\treturn;\n\t\t}\n\n\t\tfinally {\n\t\t\t// getController().getDrawingView().resetCapturedNode();\n\t\t}\n\t}", "@Override\n public int quantityDropped(int meta, int fortune, Random random)\n {\n return super.quantityDropped(meta, fortune, random);\n }", "@Override\n\tprotected Item getDropItem() {\n\t\treturn ZollernItems.enderShard;\n\t}", "public void itemRemoved(E item);", "@Override\n public void onItemRemoved(Object toRemove) {\n if(toRemove instanceof SpotifyItem)\n return;\n\n //Reflect the change in the list of DrinkInfo objects\n DrinkInfo item = (DrinkInfo)toRemove;\n mDrinkInfos.remove(item);\n mDrinkQueueAdapter.notifyDataSetChanged();\n Log.d(TAG, \"Removed: \" + item.getDrinkName());\n\n //Notify the activity if the dequeued drink was the current user's\n if(mActivity != null && item.getCustomerName().equals(mUserFullName))\n mActivity.onDrinkFinished(item);\n }", "public String dropItem(String itemName) {\r\n\t\t\tif(this.getPlayer().getItem(itemName) == null) {\r\n\t\t\t\treturn \"You do not have this item in your inventory.\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.handleDecQuestrelatedItem(this.getPlayer().getItem(itemName));\r\n\t\t\t\tthis.getPlayer().getCurrentLocation().addItem(this.getPlayer().getItem(itemName));\r\n\t\t\t\tthis.getPlayer().removeItem(itemName);\r\n\t\t\t\treturn \"You drop \" + itemName + \". \\n\"\r\n\t\t\t\t\t\t+ \"You can carry \" + this.getPlayer().getCarryCapacity() + \" more units of weight.\";\r\n\t\t\t}\r\n\t\t}", "public boolean saveNBTToDroppedItem() {\n return true;\n }", "protected void dropIt() {\n\t\tshowUnselected();\n\n\t\tfirePropertyChange(\n\t\t\t\"insertQuestion\",\n\t\t\tSwingUtilities.getAccessibleIndexInParent(this),\n\t\t\t-1);\n\t}", "@Override\n public int damageDropped (int metadata)\n {\n return metadata;\n }", "@Override\n public int damageDropped (int metadata)\n {\n return metadata;\n }", "public void onDropped(StringBuilder sb, char[] buf, int len) {\n }", "public void playerDropItem(Player p, Item i) {\n\t\tTile tileInFront = p.getLocation().getTileInDirection(p.getPosition(), p.getFacing());\n\t\tif (tileInFront.getGameObject() == null) {\n\t\t\ttileInFront.setGameObject(i);\n\t\t\tp.getInventory().remove(i);\n\t\t}\n\n\t}", "public void onDragEnded();", "@Override\n\tpublic int quantityDropped(Random par1Random) {\n\t\treturn 1;\n\t}", "@Override\n public void onDragEnd() {\n // Do nothing.\n }", "public int quantityDropped(Random par1Random)\n {\n return 1;\n }", "public int idDropped(int par1, EaglercraftRandom par2Random, int par3) {\n\t\treturn Item.sign.itemID;\n\t}", "@Override\r\n public void dropActionChanged(DropTargetDragEvent dtde) {}", "public void mouseReleased(MouseEvent me) {\n endDrag();\n }", "void drop();", "void drop();", "@Override\n public void onDeleteItemFromBench(CharacterItem item) {\n }", "public void dragDropEnd(boolean success);", "@Override\n public boolean onDrag(View viewDroppedUpon , DragEvent de){\n\n\n log(\"adapter pos\"+this.viewHolder.getAdapterPosition());\n switch (de.getAction()){\n\n case DragEvent.ACTION_DRAG_STARTED:\n //log(\"StartingDrag\"+DragEvent.ACTION_DRAG_STARTED);\n return true;\n\n case DragEvent.ACTION_DRAG_ENDED:\n //log(\"Ending Drag\"+DragEvent.ACTION_DRAG_ENDED);\n return true;\n\n case DragEvent.ACTION_DRAG_ENTERED:\n //log(\"Drag entered \"+DragEvent.ACTION_DRAG_ENTERED);\n return true;\n\n case DragEvent.ACTION_DRAG_EXITED:\n //log(\"Drag ended \"+DragEvent.ACTION_DRAG_ENDED);\n\n return true;\n\n case DragEvent.ACTION_DRAG_LOCATION:\n //log(\"Drag location \"+DragEvent.ACTION_DRAG_LOCATION);\n return true;\n\n case DragEvent.ACTION_DROP:\n //log(\"droppable is \"+this.droppable);\n\n log(\"Action dropped \" + DragEvent.ACTION_DROP);\n\n View dropped=(View)de.getLocalState();\n\n\n log(\"viewDroppedUpon tag \"+viewDroppedUpon.getTag());\n log(\"dropped tag \"+dropped.getTag());\n int pos=this.viewHolder.getAdapterPosition();\n\n\n\n mPairMaker.makePairs(dropped,viewDroppedUpon,pos,LongPressListener.getPosition());\n\n\n\n\n\n return true;\n }\n\n\n\n return false;\n }", "public void dropActionChanged(DropTargetDragEvent dtde){}", "public int idDropped(int par1, EaglercraftRandom par2Random, int par3) {\n\t\treturn !this.canDropItself ? 0 : super.idDropped(par1, par2Random, par3);\n\t}", "public void drop(DragAndDropEvent event) {\n\t\t\t\t// Wrapper for the object that is dragged\n\t\t\t\tTransferable t = event.getTransferable();\n\n\t\t\t\t// Make sure the drag source is the same tree\n\t\t\t\tif (t.getSourceComponent() != treeTable)\n\t\t\t\t\treturn;\n\n\t\t\t\tAbstractSelectTargetDetails target = (AbstractSelectTargetDetails) event.getTargetDetails();\n\n\t\t\t\t// Get ids of the dragged item and the target item\n\t\t\t\tObject sourceItemId = t.getData(\"itemId\");\n\t\t\t\tObject targetItemId = target.getItemIdOver();\n\n\t\t\t\t// if we drop on ourselves, ignore\n\t\t\t\tif (sourceItemId == targetItemId)\n\t\t\t\t\treturn;\n\n\t\t\t\t// On which side of the target the item was dropped\n\t\t\t\tVerticalDropLocation location = target.getDropLocation();\n\n\t\t\t\t// place source after target\n\t\t\t\ttreeHier.moveAfterSibling(sourceItemId, targetItemId);\n\n\t\t\t\t// if top, switch them\n\t\t\t\tif (location == VerticalDropLocation.TOP) {\n\t\t\t\t\ttreeHier.moveAfterSibling(targetItemId, sourceItemId);\n\t\t\t\t}\n\n\t\t\t\tCollection<ExpressZipLayer> layers = (Collection<ExpressZipLayer>) treeHier.rootItemIds();\n\t\t\t\tfor (SetupMapViewListener listener : listeners)\n\t\t\t\t\tlistener.layerMovedEvent(layers);\n\t\t\t}", "@Override\r\n\t\tpublic void dropActionChanged(DropTargetDragEvent dtde) {\n\t\t\t\r\n\t\t}", "public void drop() {\n process(4);\n }", "@Override\n\tpublic void drop(String accountNo) {\n\t\t\n\t}", "@Override\n\tpublic void drop(DropTargetDropEvent event) {\n\n\t\t// Accept copy drops\n\t\tevent.acceptDrop(DnDConstants.ACTION_COPY);\n\n\t\t// Get the transfer which can provide the dropped item data\n\t\tTransferable transferable = event.getTransferable();\n\n\t\t// Get the data formats of the dropped item\n\t\tDataFlavor[] flavors = transferable.getTransferDataFlavors();\n\n\t\t// Loop through the flavors\n\t\tfor (DataFlavor flavor : flavors) {\n\t\t\ttry {\n\t\t\t\t// If the drop items are files\n\t\t\t\tif (flavor.isFlavorJavaFileListType()) {\n\n\t\t\t\t\t// Get all of the dropped files\n\t\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\t\tList<File> files = (List<File>) transferable.getTransferData(flavor);\n\n\t\t\t\t\t// Loop them through\n\t\t\t\t\tfor (File file : files) {\n\t\t\t\t\t\tString path = file.getPath();\n\t\t\t\t\t\tif (path.toLowerCase().endsWith(\".png\") || path.toLowerCase().endsWith(\".jpg\") || path.toLowerCase().endsWith(\".jpeg\") || path.toLowerCase().endsWith(\".bmp\")) {\n\t\t\t\t\t\t\t// Print out the file path\n\t\t\t\t\t\t\tpath = file.getPath();\n\t\t\t\t\t\t\tSystem.out.println(\"File path is '\" + path + \"'.\");\n\t\t\t\t\t\t\tif (getQuestEditation() != null) {\n\t\t\t\t\t\t\t\tgetQuestEditation().getImagePanel().setImage(path, false);\n\t\t\t\t\t\t\t\tgetQuestEditation().getImagePanel().repaint();\n\t\t\t\t\t\t\t\tgetQuestEditation().setPictureIsFromFolder(false);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tgetAddAnswer().getAnswerPanel().setImage(path, false);\n\t\t\t\t\t\t\t\tgetAddAnswer().getAnswerPanel().repaint();\n\t\t\t\t\t\t\t\tgetAddAnswer().setPictureIsFromFolder(false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else if (flavor.match(DataFlavor.imageFlavor)) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tImage image = (Image) transferable.getTransferData(DataFlavor.imageFlavor);\n\t\t\t\t\t\tif (getQuestEditation() != null) {\n\t\t\t\t\t\t\tgetQuestEditation().getImagePanel().setImage((BufferedImage) image);\n\t\t\t\t\t\t\tgetQuestEditation().getImagePanel().setPath(\"none\");\n\t\t\t\t\t\t\tgetQuestEditation().getImagePanel().repaint();\n\t\t\t\t\t\t\tgetQuestEditation().setPictureIsFromFolder(false);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tgetAddAnswer().getAnswerPanel().setImage((BufferedImage) image);\n\t\t\t\t\t\t\tgetAddAnswer().getAnswerPanel().setPath(\"none\");\n\t\t\t\t\t\t\tgetAddAnswer().getAnswerPanel().repaint();\n\t\t\t\t\t\t\tgetAddAnswer().setPictureIsFromFolder(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (InvalidDnDOperationException ex) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.println(\"word 2010 error\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t// Inform that the drop is complete\n\t\tevent.dropComplete(true);\n\t}", "void notifyListItemRemoved(int position);", "@Override\r\n public void dragExit(DropTargetEvent dte) {}", "@Override\n public void mouseDrop()\n {\n }", "@Override\n public void dropBlockAsItemWithChance(@Nonnull World worldIn, @Nonnull BlockPos pos, @Nonnull IBlockState state, float chance, int fortune)\n {\n }", "@ForgeSubscribe(priority = EventPriority.HIGHEST)\n public void onLivingDrops(LivingDropsEvent event) {\n if (!event.recentlyHit)\n return;\n int id = -1;\n if (event.entityLiving instanceof EntityZombie)\n id = event.entityLiving instanceof EntityPigZombie ? -1 : 2;\n else if (event.entityLiving instanceof EntitySkeleton)\n id = ((EntitySkeleton)event.entityLiving).getSkeletonType() == 0 ? 0 : -1;\n else if (event.entityLiving instanceof EntityCreeper)\n id = 4;\n if (id < 0)\n return;\n if (_PlayerHeads.debug);\n else if (_PlayerHeads.dropRates[id] <= 0.0 || _PlayerHeads.random.nextDouble() - 0.005 * (double)event.lootingLevel >= _PlayerHeads.dropRates[id])\n return;\n ItemStack head = new ItemStack(Item.skull, 1, id);\n EntityItem drop = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, head);\n drop.delayBeforeCanPickup = 10;\n event.drops.add(drop);\n }", "public Item dropItem(String itemName) {\n Item item = items.remove(itemName);\n if(item != null) {\n currentRoom.addItem(item);\n }\n return item;\n }", "@Override\r\n\tpublic void sellItem(AbstractItemAPI item) {\n\t\titems.remove(item);\r\n\t\t\r\n\t}", "public int quantityDropped(Random random) {\n/* 37 */ return 0;\n/* */ }", "@Override\r\n\tpublic void onUnequipped(ItemStack stack, EntityLivingBase living)\r\n\t{\n\t}", "@Override\n public void onItemLongClicked(int position) {\n items.remove(position);\n // Notify the adapter\n itemsAdapter.notifyItemRemoved(position);\n Toast.makeText(getContext(), \"Item was removed\", Toast.LENGTH_SHORT).show();\n saveItems();\n }", "public void rollCombatDrop() {\n\t\tRandom r=new Random();\n\t\t\n\t\tint x=r.nextInt(3);\n\t\tItem i=combatDrops.get(x);\n\t\taddItem(i.getName());\n\t\t\n\t\tevents.appendText(\"You find an \"+i.getName()+\" after defeating the \"+e.getName()+\"!\\n\"); // Infrom player\n\t}", "public void doRemoveItem() {\n doRemoveItem(this.mSrcPos - getHeaderViewsCount());\n }", "public interface IDraggableViewHolder {\n /**\n * Called when an item enters drag state\n */\n void onDragged();\n\n /**\n * Called when an item has been dropped\n */\n void onDropped();\n}", "public void onContainerClosed(EntityPlayer playerIn)\n {\n super.onContainerClosed(playerIn);\n\n if (!this.worldObj.isRemote)\n {\n for (int i = 0; i < 9; ++i)\n {\n ItemStack itemstack = this.craftMatrix.removeStackFromSlot(i);\n\n if (itemstack != null)\n {\n playerIn.dropItem(itemstack, false);\n }\n }\n }\n }", "public Drop(Item item)\n {\n assert item != null : \"Go.Go gets null direction\";\n this.item = item;\n }", "@Override\r\n\t\tpublic void dragExit(DropTargetEvent dte) {\n\t\t\t\r\n\t\t}", "public void drop(){\r\n if(activeFish.isEmpty()) return;\r\n \r\n ArrayList<Fish> toremove = new ArrayList<Fish>();\r\n for(Fish bone : activeFish){\r\n bone.drop();\r\n\r\n if(!(bone.inBounds())){ // branch for out of bound fh\r\n toremove.add(bone);\r\n }\r\n }\r\n missedFish(toremove);\r\n\r\n update();\r\n }", "void onItemDeleted();", "public abstract void filesDropped( File[] files );", "public void onDropOutFoder(Object dragInfo){\n\t\t\n\t\tif(path!=null&&(!path.equals(\"\"))){\n\t\t\tmFolderDrop.setVisibility(View.GONE);\n\t\t\tif(dragInfo!=null){\n\t\t\t\tDataInfo info = (DataInfo) dragInfo;\n\t\t\t\tMap<String, Object> retmap=null;\n\t\t\t\tSystem.out.println(\"drop outside info name \"+ info.getName() + \"position=\" + info.getPosition()+ \"currentPage =\" + currentPage);\n\t\t\t\ttry {\n\t\t\t\t\t//retmap = libCloud.Mydownload_depart(Params.RECOMMEND_VIDEO,path,info.getResid());\n\t\t\t\t\tretmap = libCloud.Mydownload_depart(Params.RECOMMEND_VIDEO,path,info.getId());\n\t\t\t\t} catch (WeiboException 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\tMyDownloadVideoDataAdapter adapter1 = (MyDownloadVideoDataAdapter) ((CustomerGridView) mListViews.get(currentPage -1)).getAdapter();\n\t\t\t\tSystem.out.println(\"drop outside drop position = \" + info.getPosition());\n\t\t\t\tList<DataInfo> list1 = adapter1.getList();\n\t\t\t\tfor(int i=0;i<list1.size();i++){\n\t\t\t\t\tDataInfo inf = list1.get(i);\n\t\t\t\t\tSystem.out.println(\"position = \" + inf.getPosition() + \"name = \" + inf.getName());\n\t\t\t\t}\n\t\t\t\tlist1.remove(info.getPosition());\n\t\t\t\t//adapter1.getList().remove(info.getPosition());\n\t\t\t\tfor(int i=0;i<list1.size();i++){\n\t\t\t\t\tDataInfo inf = list1.get(i);\n\t\t\t\t\tSystem.out.println(\"position = \" + inf.getPosition() + \"name = \" + inf.getName());\n\t\t\t\t}\n\t\t\t\tadapter1.notifyDataSetChanged();\n\t\t\t}\n\t\t}\n\t}", "public Item getItemDropped(int meta, Random p_149650_2_, int p_149650_3_)\n\t {\n\t \treturn MGHouseItems.item_boat_door;\n\t }", "@Override\n\t\t\tpublic void dragExit(DropTargetEvent e) {\n\t\t\t}", "public void trade(Drop myDrop, User receiver) {\n getInventory().removeDrop(myDrop);\n receiver.getInventory().addDrop(myDrop);\n }", "@Override\r\n public void uncall() {\r\n Player player = MbPets.getInstance().getServer().getPlayer(getOwner());\r\n if (player != null) {\r\n if (getEntity().getInventory().getDecor() != null) {\r\n if (player.getInventory().firstEmpty() >= 0) {\r\n player.getInventory().addItem(getEntity().getInventory().getDecor());\r\n } else {\r\n player.getWorld().dropItemNaturally(player.getLocation(),\r\n getEntity().getInventory().getDecor());\r\n }\r\n }\r\n }\r\n super.uncall();\r\n }", "public void itemRemoved(boolean wasSelected);", "void onDeleteItem(E itemElementView);", "@ForgeSubscribe(priority = EventPriority.HIGHEST)\n public void onPlayerDrops(PlayerDropsEvent event) {\n if (_PlayerHeads.debug);\n else if (_PlayerHeads.pvp && !event.recentlyHit || _PlayerHeads.dropRates[3] <= 0.0 || _PlayerHeads.random.nextDouble() - 0.005 * (double)event.lootingLevel >= _PlayerHeads.dropRates[3])\n return;\n ItemStack head = new ItemStack(Item.skull, 1, 3);\n head.setTagInfo(\"SkullOwner\", new NBTTagString(\"\", event.entityPlayer.username));\n EntityItem drop = new EntityItem(event.entityPlayer.worldObj, event.entityPlayer.posX, event.entityPlayer.posY, event.entityPlayer.posZ, head);\n drop.delayBeforeCanPickup = 10;\n event.drops.add(drop);\n }", "public int quantityDropped(Random p_149745_1_)\n {\n return this.isFullBlock ? 2 : 1;\n }", "protected abstract void removeItem();", "public void dropActionChanged(DragSourceDragEvent evt) {\n }", "@Override\r\n\tpublic void dropped(DNDEvent e) {\n\t\tif (dockable.getTitle() == e.getDragSource()) {\r\n\t\t\tDockableTitleBar titleBar = (DockableTitleBar)dockable.getTitle().getParent();\r\n\t\t\tDNDEvent event = new DNDEvent(\r\n\t\t\t\t\te.getDragSource(), \r\n\t\t\t\t\te.getDropTarget(), \r\n\t\t\t\t\ttitleBar.getLocationOnScreen().x + e.getX() - e.getOriginX(), \r\n\t\t\t\t\ttitleBar.getLocationOnScreen().y + e.getY() + e.getOriginY(), \r\n\t\t\t\t\te.getOriginX(), e.getOriginY(), \r\n\t\t\t\t\tDNDEvent.RESULT_FAILURE);\r\n\t\t\ttitleBar.dropped(event);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t// TODO: quick but really dirty...\r\n\t\t//Dockable sourceDockable = (Dockable)e.getDragSource().getParent().getParent().getParent().getParent();\r\n\t\t// TODO: less dirty...\r\n\t\tDockable sourceDockable = (Dockable)((DockableTitleBar)e.getDragSource().getParent()).getDockable();\r\n\t\tDockable targetDockable = dockable;\r\n\t\t\r\n\t\tDockingCanvas sourceCanvas = sourceDockable.getDockingRoot().getDockingCanvas();\r\n\t\tDockingCanvas targetCanvas = targetDockable.getDockingRoot().getDockingCanvas();\r\n\t\t\r\n\t\t\r\n\t\t// remove drag source\r\n\t\tsourceDockable.getDockingRoot().remove();\r\n\t\tif (sourceCanvas.isDisposable() && sourceCanvas.getComponentCount() == 0) {\r\n\t\t\tsourceCanvas.getOwner().dispose();\r\n\t\t}\r\n\t\t\r\n\t\t// add to drop target\r\n\t\ttargetDockable.getDockingRoot().add(sourceDockable, direction);\r\n\t\t\r\n\t\t\r\n\t\t// re-validate and repaint target canvas\r\n\t\ttargetCanvas.revalidate();\r\n\t\ttargetCanvas.repaint();\r\n\t\t\r\n\t\t// re-validate and repaint source canvas if different to target canvas\r\n\t\tif (targetCanvas != sourceCanvas) {\r\n\t\t\tsourceCanvas.revalidate();\r\n\t\t\tsourceCanvas.repaint();\r\n\t\t}\r\n\t\t\r\n\t\tmouseOver = false;\r\n\t\t\r\n\t\t//dockable.getDockingRoot().findRoot().printTree(\"\");\r\n\t}", "@Override\n\tpublic void receiveDrop ( String dropString ) {\n\t\taddAttribute ( WidgetAttribute.valueOf ( dropString ) ) ;\n\t}", "private void onItemDeleted() {\n Log.i(\"BasketFragment\",\"deleted\");\n }", "@Override\n public Item getItemDropped(IBlockState state, Random rand, int fortune) {\n return this == BlockHandler.rubyore ? ItemHandler.ruby : (this == BlockHandler.sapphireore ? ItemHandler.sapphire : (this == BlockHandler.topazore ? ItemHandler.topaz : (this == BlockHandler.peridotore ? ItemHandler.peridot : (this == BlockHandler.amethystore ? ItemHandler.amethyst : (this == BlockHandler.berylore ? ItemHandler.beryl : (this == BlockHandler.citrineore ? ItemHandler.citrine : Item.getItemFromBlock(this)))))));\n }", "@Override\n public void deleteItem(int position) {\n originalData.remove(currentData.get(position));\n //Removed of the current data using the current position gotten from the click listener\n currentData.remove(position);\n\n //Notify changes to adapter through presenter\n }", "@Override\r\n\t\t\tpublic void dragLeave(DropTargetEvent event) {\n\t\t\t\t\r\n\t\t\t}", "private void destroyBlockAndDropItem(final Location at) {\n if (at == null) {\n return;\n }\n\n final Block b = at.getBlock();\n\n if (!MaterialManager.getInstance().contains(b.getType().name())) {\n return;\n }\n\n double chance = MaterialManager.getInstance().getChanceToDropBlock(b.getType().name());\n\n if (chance > 1.0)\n chance = 1.0;\n if (chance < 0.0)\n chance = 0.0;\n\n final double random = Math.random();\n\n if (chance == 1.0 || chance <= random) {\n ItemStack is = new ItemStack(b.getType(), 1);\n\n if (is.getType() == Material.AIR) {\n return;\n }\n\n // drop item\n at.getWorld().dropItemNaturally(at, is);\n }\n\n // changes original block to Air block\n b.setType(Material.AIR);\n }" ]
[ "0.76469743", "0.7115269", "0.70639575", "0.70027274", "0.6982976", "0.697036", "0.69101954", "0.688341", "0.68129", "0.6770748", "0.669499", "0.66838026", "0.6617167", "0.657801", "0.6576419", "0.65617085", "0.65612555", "0.6536216", "0.65086824", "0.64774996", "0.64350545", "0.6401887", "0.6371318", "0.6348095", "0.63028765", "0.6292266", "0.628482", "0.6284737", "0.627326", "0.62518805", "0.6230884", "0.6229222", "0.6228134", "0.62244403", "0.6224091", "0.62233", "0.62148726", "0.61877936", "0.61868733", "0.6183248", "0.61517465", "0.61517465", "0.61293507", "0.6111794", "0.610618", "0.6040086", "0.5978373", "0.59778994", "0.59760636", "0.5975438", "0.59639406", "0.5962173", "0.5962173", "0.5947671", "0.59351707", "0.59239465", "0.5921718", "0.5920209", "0.59038156", "0.5903216", "0.58774954", "0.5868597", "0.5857579", "0.58563805", "0.58551323", "0.58543015", "0.58488756", "0.5847631", "0.5843813", "0.5841567", "0.5828892", "0.5821432", "0.58161163", "0.57959366", "0.57909775", "0.57874197", "0.57847625", "0.5784609", "0.57824695", "0.57811725", "0.57809347", "0.5780572", "0.57805145", "0.5775736", "0.5772168", "0.5765309", "0.5759499", "0.5759441", "0.5757419", "0.5742082", "0.5741316", "0.5730486", "0.57228816", "0.5711437", "0.5703288", "0.57022953", "0.5698986", "0.56980014", "0.56973493", "0.569604" ]
0.81873107
0
creates a GObject instance of a deck
public GDeck(Deck startdeck){ cards=startdeck; add(back=new GImage(((GCard)startdeck.get(0)).getBackImage().getImage())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Deck() {\n generateDeckOfCards();\n }", "public void createDeck(){\n //Does nothing because it will be overridden in the child classes.\n }", "private Pile createDeck() {\n \t\tPile deck = new Pile(\"deck\"); // TODO Refactor, no hardcoded string\n\t\tpileNames.add(\"deck\");\n \t\tfor (Suit suit : Suit.values()) {\n \t\t\tfor (Rank rank : Rank.values()) {\n \t\t\t\tdeck.addCard(new Card(suit, rank));\n \t\t\t}\n \t\t}\n \t\t// Put the deck at the middle of the table\n \t\tmTable.set(MID_OF_TABLE, deck);\n \t\treturn deck;\n \t}", "public Deck()\n {\n deck = new ArrayList<>();\n }", "public Deck() {\n this.deck = new LinkedList<>();\n }", "public Deck()\r\n\t{\r\n\t\tcards = new String[DECK_SIZE];\r\n\t\t\r\n\t\tnewDeck();\r\n\t}", "public Deck() {\n deck = new LinkedList<>();\n for (int i = 1; i < FACE_VALUES + 1; i++) {\n deck.add(new Card(i, SPADES));\n deck.add(new Card(i, CLUB));\n deck.add(new Card(i, DIAMOND));\n deck.add(new Card(i, HEART));\n }\n }", "public Deck() {\n System.out.println(\"Inside deck\");\n cards = new ArrayList<>();\n fillDeck();\n }", "public Deck(){\n\t\tcards = new ArrayList<>(deckSize);\n\t\tdeck = new int[deckSize];\n\t}", "public Deck( ) {\r\n int ordinal;\r\n alalSets = new ArrayList<>();\r\n \r\n // load the cards\r\n for ( ordinal = 1; ordinal <= 13; ordinal++) {\r\n for( int iCount = 1; iCount <= 4; iCount++) {\r\n // the deck adds one set which contains one card\r\n \r\n ArrayList<Card> redCardSet = new ArrayList<>();\r\n Card redCard = new Card();\r\n redCard.value = ordinal;\r\n redCard.color = Enums.RED;\r\n redCardSet.add(redCard); // add card to set\r\n alalSets.add( redCardSet ); // add set to deck\r\n\r\n ArrayList<Card> blackCardSet = new ArrayList<>();\r\n Card blackCard = new Card();\r\n blackCard.value = ordinal;\r\n blackCard.color = Enums.BLACK;\r\n blackCardSet.add(blackCard);\r\n alalSets.add( blackCardSet );\r\n }\r\n }\r\n }", "public Deck() {\n cards = new Card[52];\n size = 0;\n for (int suit = Card.SPADES; suit <= Card.CLUBS; suit++) {\n for (int rank = Card.ACE; rank <= Card.KING; rank++) {\n cards[size] = new Card(rank, suit);\n size += 1;\n }\n }\n }", "public Deck() {\n deck = new ArrayList<>();\n for (Color d : Color.values()) {\n for (Value e : Value.values()) {\n Card c = new Card(d, e);\n deck.add(c);\n }\n }\n }", "public Deck() {\n this.allocateMasterPack();\n this.init(1);\n }", "public Deck() { // This constructor creates a standard deck\n\n\tcards = new Card[52];\n\tint k=0;\n\t\n\tfor (int i=0; i<4; i++)\n\t for (int j=2; j<15; j++){\n\t\tcards[k]= new Card (j, i);\n\t\tk++;\n\t\t }\n\t \n\n\tshuffle();\n\t\n\tcardsLeft = 52;\n\t/*\tfor (int i=0; i<52; i++)\n\t\tSystem.out.println (cards[i]);*/\n }", "public Deck() {\n this.cards = new Card[STANDARD_DECK_SIZE];\n this.topCardIndex = 0;\n int cardIndex = 0;\n int DeckLength = this.cards.length;\n for (Card.Suit suit : Card.Suit.values() ) {\n for (int i = Card.ACE ; i <= Card.KING ; i++ ) {\n cards[cardIndex] = new Card (i, suit);\n cardIndex++;\n }\n }\n }", "public DeckOfCards() {\n\n String faces[] = {\"Ace\", \"Deuce\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\", \"Ten\", \"Jack\", \"Queen\", \"King\"};\n String suits[] = {\"Hearts\", \"Diamonds\", \"Clubs\", \"Spades\"};\n\n deck = new Card[NUMBER_OF_CARDS]; //create an array of card objects (52)\n currentCard = 0;\n randomNumbers = new Random();\n\n //Populate deck with card objects\n for(int count = 0; count < deck.length; count++){\n deck[count] = new Card(faces[count % 13], suits[count / 13]);\n //first 13 cards will be ace through king of hearts then ace though king of diamonds etc...\n\n }\n\n }", "public void makeDeck()\r\n\t{\r\n\t\tfor (int i = 1; i < 5; i++)\r\n\t\t{\r\n\t\t\tfor (int j = 2; j < 15; j++)\r\n\t\t\t{\r\n\t\t\t\tdeck.add(new Card(i,j));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void generateDeck() {\n\t\tList<String> valueList = Arrays.asList(\"Ace\", \"2\", \"3\",\"4\", \"5\", \"6\",\"7\", \"8\", \"9\",\"10\", \"Jack\", \"Queen\",\"King\");\n\t\tList<String> suitList = Arrays.asList(\"Diamonds\", \"Spades\", \"Clubs\", \"Hearts\");\n\t\tvalues.addAll(valueList);\n\t\tsuits.addAll(suitList);\n\t\t\n\t\t//adding card objects to deckOfCards arraylist\n\t\tint i = 1;\n\t\twhile(i<=52){\n Card card = new Card(values.get(random.nextInt(13)), suits.get(random.nextInt(4)));\n if (!deckOfCards.contains(card)) {\n deckOfCards.add(card);\n i++;\n }else{\n\n }\n }\n\t}", "public Deck(){\n\t\tcount = 51;\n\t\tcards = new Card[52];\n\t\trand = new Random();\n\t\tfor(Suit suit : Suit.values()){\n\t\t\tfor (int i = 2; i < 15; i++) {\n\t\t\t\tcards[suit.ordinal()*13 + i - 2] = new Card(suit,i);\n\t\t\t}\n\t\t}\n\t}", "public DeckGao()\r\n {\r\n cards = new ArrayList<CardGao>();\r\n top = NUMCARDS - 1;\r\n\r\n for(String suit : SUITS)\r\n {\r\n for(int i = 1; i<14; i++)\r\n {\r\n cards.add(new CardGao(suit, i));\r\n }\r\n }\r\n }", "public Deck () {\r\n int arrayPlace = 51;\r\n cardDeck = new Card [52];\r\n String [] suits = {\"Clubs\", \"Diamonds\", \"Hearts\", \"Spades\"};\r\n for (int index = 0; index < suits.length; index++) {\r\n for (int i = 1; i < 14; i++) {\r\n cardDeck [arrayPlace] = new Card (i, suits[index]);\r\n arrayPlace--;\r\n }\r\n }\r\n }", "public Deck(String name){\r\n\t\tthis(name, new ArrayList<Card>());\r\n\t}", "@Override\n public String toString() {\n return \"Deck{\" + \"deck=\" + deck + '}';\n }", "public Deck()\n\t{\n\t\t//call other Constructor defining one deck with out shuffling\n\t\tthis(false);\n\t}", "public void createDeck() {\n\t\t// for loop that repeats 4 times - one for each suit\n\t\tfor (String suit : suits) {\n\t\t\t// for loop that repeats 13 times (2-14) - once for each value\n\t\t\tfor (int i = 2; i < 15; i++) {\n\t\t\t\t//create instance of new card createCard(value, name);\n\t\t\t\tCard card = new Card(i, suit);\n\t\t\t\t//add card to deck array\n\t\t\t\taddCardToDeck(card);\n\t\t\t}\t\n\t\t}\n\t}", "public Deck()\n {\n this(1);\n }", "@Test\n public void create() {\n Deck deck = new DeckImplementation();\n assertEquals(\"Wrong initial deck size!\", 180,\n deck.numberOfCardsRemaining());\n deck.drawACard();\n assertEquals(\"Wrong size deck after draw!\", 179,\n deck.numberOfCardsRemaining());\n }", "public Deck()\n {\n deck = new Stack<Card>();\n /* Increments through each suit, and then for each suit through each rank,\n * and pushes a\n * new card with the corresponding information onto the deck.\n */\n /* The above comment did not show up in the checkstyle. */\n for (Suit suit : Suit.values())\n {\n /* Increments through each card value. */\n for (CardValue value : CardValue.values())\n {\n deck.push(new Card(suit, value));\n }\n }\n Collections.shuffle(deck);\n }", "public static Group newDeck() {\n\t\tGroup g = new Group();\n\t\tfor (Suit s : Suit.values()) {\n\t\t\tfor (Rank r : Rank.values()) {\n\t\t\t\tCard c = new Card(r,s);\n\t\t\t\tg.add(c);\n\t\t\t}\n\t\t}\n\t\treturn g;\n\t}", "public void createDecks(){\r\n\t\tfor (int j = 10; j < 20; j++){\r\n\t\t\taddCard(new Card(cardNames[j]));\r\n\t\t}\r\n\t}", "public Deck() {\n\t\trand = new Random();\n\t\trand.setSeed(System.currentTimeMillis());\n\t\twhile(deck.size()<52){\n\t\t\tint suit = rand.nextInt(4);\n\t\t\tint rank = rand.nextInt(13);\n\t\t\tString card = this.rank[rank] +\" of \" + this.suit[suit];\n\t\t\tdeck.add(card);\n\t\t}\n\t}", "public Deck(Deck iDeck){\n this.addAll(iDeck);\n }", "public void buildDeck () {\n this.deck = new ArrayList();\n for (ValueType value: ValueType.values()) {\n for(SuitType suit: SuitType.values()) {\n deck.add(new Card(value, suit));\n }\n }\n shuffleDeck();\n }", "public Game() {\n //Create the deck of cards\n cards = new Card[52 * numDecks];\n cards = initialize(cards, numDecks);\n cards = shuffleDeck(cards, numDecks);\n }", "public poker_class ()\n\t{\n\t face = \"Two\";\n\t suit = \"Clubs\";\n\t}", "public Deck makeComputerDeck()\r\n\t{\r\n\t\tDeck computer = new Deck();\r\n\r\n \tfor (int i = 0; i < (DECK_COUNT/2); i++)\r\n \t{\r\n \t computer.addToDeck(deck.remove(0));\r\n \t}\r\n\r\n\t\treturn computer;\r\n\t}", "public Deck(int numDecks) {\n\t\t// Loop through number of decks, suits, and rank\n\t\tfor (int k = 0; k<numDecks; k++) {\n\t\t\tfor (int i = 1; i <= 4; i++) {\n\t\t\t\tfor (int j = 1; j <= 13; j++) {\n\t\t\t\t\t// Add Card object to linked list\n\t\t\t\t\tdeck.add(new Card(i,j));\n\t\t\t\t\tsize++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void createDeck(){\n for (char suit:standardSuits) {\n for (Map.Entry<Character, Integer> item:deckCards.entrySet()) {\n Card card = new Card(item.getKey(),item.getValue(),suit);\n deckOfCards.add(card);\n }\n }\n }", "private List<Card> setupDeck(){\n List<Card> llist = new LinkedList<Card>();\n String[] faceCards = {\"J\",\"Q\",\"K\",\"A\"};\n String[] suits = {\"spades\",\"clubs\",\"diamonds\",\"hearts\"};\n\n for(int i=2; i<=10; i++){\n for(int j=1; j<=4; j++){\n llist.add(new Card(Integer.toString(i), suits[j-1], j, i));\n }\n }\n for(int k=1; k<=4; k++){\n for(int l=1; l<=4; l++){\n llist.add(new Card(faceCards[k-1],suits[l-1], l, k+10));\n }\n }\n return llist;\n }", "private List<Card> createDeck(){\n List<Card> newDeck= new ArrayList<Card>();\n for (int i =0;i<CardSet.ALL_CARDS.size(); ++i ) {\n newDeck.add(CardSet.ALL_CARDS.get(i));\n }\n return newDeck;\n }", "public Deck(ArrayList<Card> deck)\n {\n this.deck = deck;\n }", "@Test\r\n public void testDeck() {\r\n Deck instance = new Deck();\r\n System.out.println(\"Testing Contructor\");\r\n assertNotNull(instance);\r\n }", "void makeDeck() {\n\t\t// start with an array of 1..28 for easy shuffling\n\t\tint[] cardValues = new int[28];\n\t\t// assign values from 1 to 28\n\t\tfor (int i=0; i < cardValues.length; i++) {\n\t\t\tcardValues[i] = i+1;\n\t\t}\n\n\t\t// shuffle the cards\n\t\tRandom randgen = new Random();\n\t\tfor (int i = 0; i < cardValues.length; i++) {\n\t\t\tint other = randgen.nextInt(28);\n\t\t\tint temp = cardValues[i];\n\t\t\tcardValues[i] = cardValues[other];\n\t\t\tcardValues[other] = temp;\n\t\t}\n\n\t\t// create a circular linked list from this deck and make deckRear point to its last node\n\t\tCardNode cn = new CardNode();\n\t\tcn.cardValue = cardValues[0];\n\t\tcn.next = cn;\n\t\tdeckRear = cn;\n\t\tfor (int i=1; i < cardValues.length; i++) {\n\t\t\tcn = new CardNode();\n\t\t\tcn.cardValue = cardValues[i];\n\t\t\tcn.next = deckRear.next;\n\t\t\tdeckRear.next = cn;\n\t\t\tdeckRear = cn;\n\t\t}\n\t}", "private Deck()\n\t{\n\t\tfor (Suit s : Suit.values())\n\t\t\tfor(Rank r : Rank.values())\n\t\t\t\tcards.add(new Card(s,r));\n\t}", "public Card () {}", "@Override\r\n public void dealerCreateNewDeck() {\r\n this.dealer.createNewDeck();\r\n System.out.println(\"Dealer deck created\");\r\n }", "public de.uni_koblenz.jgralabtest.schemas.gretl.pddsl.Card createCard();", "public CardDeck cardDeck(){\r\n\t\treturn deck;\r\n\t}", "public SpoonsDeck() {\r\n\t deck = new ArrayList<SpoonsCard>();\r\n\t int cardCt = 0; // How many cards have been created so far.\r\n\t for ( int suit = 0; suit <= 3; suit++ ) {\r\n\t for ( int value = 2; value <= 14; value++ ) {\r\n\t \t deck.add(cardCt, new SpoonsCard(value,suit)); \r\n\t \t cardCt++;\r\n\t }\r\n\t \r\n\t }\r\n\t cardsUsed = 0;\r\n }", "public stdDeck(){\n super();\n for(int i=1; i<14; i++){\n stdCard card = new stdCard(Suit.CLUBS, i);\n deck.add(card);\n card = new stdCard(Suit.DIAMONDS, i);\n deck.add(card);\n card = new stdCard(Suit.HEARTS, i);\n deck.add(card);\n card = new stdCard(Suit.SPADES, i);\n deck.add(card);\n }\n }", "public void generateDeck(){\n\t\tString type;\n\t\t//Randomize MAX_TILES number of Tile Objects\n\t\tfor(int i=0; i<GameInfo.MAX_TILES; i++){\n\t\t\ttype = GameInfo.allowedTiles[rg.nextInt(GameInfo.MAX_TYPES)];\n\t\t\tdeck.add(tf.create(type));\n\t\t}\n\t\tgenerated = true;\n\t}", "private void generateDeckOfCards() {\n this.cards = new ArrayList<Card>(Suit.values().length * Rank.values().length);\n for (Suit suit : Suit.values()) {\n for (Rank rank : Rank.values()) {\n cards.add(new Card(suit, rank));\n }\n }\n }", "private void createDeckFromInput() {\n\n if(titleField.getText().isBlank()) {\n MainGUI.confirmDialog(\"Deckname cannot be blank\");\n return;\n }\n String deckName = titleField.getText();\n Deck deck = new Deck(deckName, 0,0,0,0,0);\n int deckID = DatabaseAPI.storeDeck(deck);\n DatabaseAPI.createUserDeckBridge(user.getId(), deckID);\n\n String[] tags = FormatData.formatHashtags(tagField.getText());\n for(String tag : tags) {\n if(!FormatData.isBlankString(tag)) {\n int tagID = DatabaseAPI.checkTag(tag);\n if(tagID != 0) {\n DatabaseAPI.createDeckTagBridge(deckID, tagID);\n } else {\n int newTagID = DatabaseAPI.storeTag(tag);\n DatabaseAPI.createDeckTagBridge(deckID, newTagID);\n }\n }\n }\n\n\n }", "private void buildDeck() {\r\n //Initialise size of deck and number of cards \r\n this.numOfCards = FIFTYTWO;\r\n //create new Deck Array \r\n this.deck = new ICard[this.numOfCards];\r\n //Creates Deck deck \r\n createDeck(Suit.values(), Rank.values());\r\n //shuffles deck \r\n shuffleCards(deck);\r\n\r\n }", "public Card()\n {}", "public BigTwoDeck(){\r\n\t\tinitialize();\r\n\t}", "void fillDeck()\n\t{\n\t\t\n\t\tfor ( byte decks = 0 ; decks < howManyDecks ; decks++ )\n\t\t\tfor ( byte suit = 0 ; suit < 4 ; suit++ )\n\t\t\t\tfor ( byte value = 1 ; value < 14 ; value++ ) \n\t\t\t\t\tdeck.add ( new Card (value , suit , true) );\n\t}", "@Override\r\n public List<Card> getDeck() {\n myDeck2.clear();\r\n\r\n //loops through twice in order to create the deck of 104\r\n for (int k = 0; k < 2; k++) {\r\n for (int i = 0; i < 4; i++) {\r\n for (int j = 1; j <= 13; j++) {\r\n Card nextCard = new Card(suit[i], j);\r\n myDeck2.add(nextCard);\r\n }\r\n }\r\n }\r\n\r\n return myDeck2;\r\n }", "public VegasDeckClass(int numberOfDecks){\n createCards(VEGAS, numberOfDecks);\n this.vegasDeckCardList = getCardList();\n }", "public Deck(boolean shuffle) {\n\t\t//52 cards\n\t\tthis.cardNumber = 52;\n\t\t//Total slots of 52 ARRAY\n\t\tthis.card = new Card[this.cardNumber];\n\t\t\n\t\t//location of the card\n\t\tint cardLocation= 0;\n\t\t\n\t\t// each suit\n\t\tfor(int suit = 0; suit < 4; suit++)\n\t\t{\n\t\t\t//each number in the deck\n\t\t\tfor(int num = 1; num <=13; num++)\n\t\t\t{\n\t\t\t\t// add a new card to the deck \n\t\t\t\tthis.card[cardLocation] = new Card(Suit.values()[suit],num);\n\t\t\t\tcardLocation++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Shuffling done\n\t\tif(shuffle == true)\n\t\t{\n\t\t\tthis.shuffle();\n\t\t}\n\t}", "private void buildDeck(int numDecks) {\n for (int i = 0; i < numDecks; ++i) {\n for (int j = 1; j < 14; ++j) {\n deck.add(new Card(j, Suit.Clubs));\n deck.add(new Card(j, Suit.Hearts));\n deck.add(new Card(j, Suit.Diamonds));\n deck.add(new Card(j, Suit.Spades));\n }\n }\n }", "public void initChestDeck() {\n\t\tchestDeck = new Deck();\n\t\tfor (int i = 0; i < 16; i++) {\n\t\t\tchestDeck.addCard(new Card(i + 16));\n\t\t}\n\t\t//makes cards random\n\t\tchestDeck.shuffle();\n\t}", "public ResourceDeck(JComponent container){\n super(container);\n deck = new ArrayList<ResourceCard>();\n populateDeck();\n }", "public Deck(String id) {\n this.id = id;\n }", "public void buildDeck(){\n\t\tfor(int i = 0; i < deckSize; i++){\n\t\t\tdeck[i] = i;\n\t\t}\n\t}", "public War()\n {\n //Create the decks\n dealer = new Deck(); \n dw = new Deck();\n de = new Deck(); \n warPile = new Deck(); \n \n \n fillDeck(); //Add the cards to the dealer's pile \n dealer.shuffle();//shuffle the dealer's deck\n deal(); //deal the piles \n \n }", "Card(){\t \n}", "public Deck(Deck other){\r\n this.cards = other.getCards();\r\n this.deckSize = other.getDeckSize();\r\n }", "public Card build() {\n return new Card(frontFace, backFace);\n }", "public void initChanceDeck() {\n\t\tchanceDeck = new Deck();\n\t\tfor (int i = 0; i < 16; i++) {\n\t\t\tchanceDeck.addCard(new Card(i));\n\t\t}\n\t\t//shuffled to make the order random\n\t\tchanceDeck.shuffle();\n\t}", "public DiscardDeck() {\n\t\tthis.content = new ArrayList<Card>();\n\t}", "private void createDeck() {\n FileReader reader = null;\n try {\n try {\n reader = new FileReader(deckInputFile);\n Scanner in = new Scanner(reader);\n \n // read the top line column names of the file\n // e.g. description, size, speed etc.\n String categories = in.nextLine();\n\n // loop through the file line by line, creating a card and adding to the deck\n while (in.hasNextLine()) {\n String values = in.nextLine();\n Card newCard = new Card(categories, values);\n deck.add(newCard);\n }\n } finally {\n if (reader != null) {\n reader.close();\n }\n }\n } catch (IOException e) {\n System.out.print(\"error\");\n }\n }", "public BaseballCard(){\r\n\r\n\t}", "public static Stack<int[]> createDeck() {\n\t\t// Populate deck with 4 suits, 13 cards each [RANK, SUIT]\n\t\tStack<int[]> deck = new Stack<int[]>();\n\t\tfor (int j = HEARTS; j <= SPADES; j++) {\n\t\t\tfor (int i = 1; i <= 13; i++) {\n\t\t\t\tint[] card = new int[] {i, j};\n\t\t\t\tdeck.push(card);\n\t\t\t}\n\t\t}\n\t\tCollections.shuffle(deck);\n\t\treturn deck;\n\t}", "public void populateDeck(){\n\n //Add everything to r\n for(int i=0;i<LUMBER;i++){\n deck.add(new ResourceCard(container, Resource.WOOD, cardStartPoint));\n }\n\n for(int i=0;i<WOOL;i++){\n deck.add(new ResourceCard(container, Resource.WOOL, cardStartPoint));\n }\n\n for(int i=0;i<GRAIN;i++){\n deck.add(new ResourceCard(container, Resource.WHEAT, cardStartPoint));\n }\n\n for(int i=0;i<BRICK;i++){\n deck.add(new ResourceCard(container, Resource.BRICKS, cardStartPoint));\n }\n\n for(int i=0;i<ORE;i++){\n deck.add(new ResourceCard(container, Resource.ORE, cardStartPoint));\n }\n //Collections.shuffle(deck);\n\n }", "private void initializeDeck() {\n drawPile.clear();\n\n for (ICard.Color color : ICard.Color.values()) {\n // Numbered cards\n drawPile.add(new NumberedCard(color, 0));\n for (int value = 1; value < 10; value++) {\n drawPile.add(new NumberedCard(color, value));\n drawPile.add(new NumberedCard(color, value));\n }\n\n // Special cards\n drawPile.add(new SkipCard(color));\n drawPile.add(new SkipCard(color));\n\n drawPile.add(new ReverseCard(color));\n drawPile.add(new ReverseCard(color));\n\n drawPile.add(new DrawTwoCard(color));\n drawPile.add(new DrawTwoCard(color));\n }\n\n for (int i = 0; i < 4; i++) {\n drawPile.add(new WildCard());\n drawPile.add(new WildFourCard());\n }\n }", "public Deck( int copiesPerCard ) {\n if (copiesPerCard <= 0) {\n throw new IllegalArgumentException();\n }\n this.cards = new Card[STANDARD_DECK_SIZE * copiesPerCard];\n this.topCardIndex = 0;\n int DeckLength = this.cards.length;\n int cardIndex = 0;\n for (int copy = 1; copy <= copiesPerCard ; copy++ ) {\n for (Card.Suit suit : Card.Suit.values() ) {\n for (int i = Card.ACE ; i <= Card.KING ; i++ ) {\n cards[cardIndex] = new Card (i, suit);\n cardIndex++;\n }\n }\n }\n }", "public void startGame() {\n this.deck = new Deck();\n this.deck.shuffle(); //shuffle the deck\n Card card = this.deck.deal(this.getPlayerHand());\n card = this.deck.deal(this.getPlayerHand());\n card = this.deck.deal(this.getDealerHand());\n }", "public Card(FrontFace frontFace, BackFace backFace) {\n this.frontFace = frontFace;\n this.backFace = backFace;\n }", "public static Deck buildStandardDeck() {\n final List<Card> cards = new ArrayList<>();\n for (final Rank rank : Rank.values()) {\n for (final Suite suite : Suite.values()) {\n cards.add(new Card(rank, suite));\n }\n }\n return new Deck(cards);\n }", "public Dealer(int deckNum, HandCard handCard) {\n List<Deck> deckList = new ArrayList<>();\n for (int i = 0; i < deckNum; i++) {\n deckList.add(new Deck());\n }\n this.deckList = deckList;\n this.handCard = handCard;\n\n this.cardIterator = new CardIterator();\n }", "private void fillDeck() {\n int index = 0;\n for (int suit = 1; suit <= 4; suit++) {\n for (int rank = 1; rank <= 13; rank++) {\n deck[index] = new Card(rank, suit);\n index++;\n\n }\n }\n }", "public interface Deck {\n\n long getId();\n String getName();\n HeroClass getDeckClass();\n\n}", "public ArrayList<Card> buildDeck() {\n\t\t//reads in the deck from the txt file\n\t\tArrayList<Card> deck = new ArrayList<Card>();\n\t\ttry\n\t\t{\n\t\t\t//I had to give the absolute path for this to work in command prompt\n\t\t\t// eg \"C:\\\\Users\\\\Roddy\\\\workspace\\\\Trumps\\\\StarCitizenDeck.txt\"\n\t\t\tBufferedReader reader = new BufferedReader(new FileReader(\"StarCitizenDeck.txt\"));\n\n\t\t\tString line = reader.readLine();\n\t\t\t//skip the first line because it is just the names of attributes\n\t\t\t//will maybe read this line in and change card constructor\n\t\t\t//so decks with more/less/different attributes can be used\n\t\t\tline = reader.readLine();\n\t\t\twhile (line != null)\n\t\t\t{\n\t\t\t\t//read each line in and create new card\n\t\t\t\tCard card = new Card(line);\n\t\t\t\tdeck.add(card);\n\t\t\t\tline = reader.readLine();\n\t\t\t}\n\t\t\treader.close();\n\t\t\t//return the built deck as and arraylist of cards\n\t\t\t//String deckString = oWriter.writeValueAsString(deck);\n\t\t\treturn deck;\n\t\t} catch (IOException e)\n\t\t{\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "public CardGame( int handSize, int copiesPerDeck ){\n this.handOne = new Hand(handSize);\n this.handTwo = new Hand(handSize);\n this.gameDeck = new Deck(copiesPerDeck);\n this.playerScore = 0;\n this.oppoScore = 0;\n }", "public Deck( Card c1, Card c2, Card c3, Card c4, Card c5, Card c6, Card c7, Card c8, Card c9,\n\t\t\t\t Card c10, Card c11, Card c12, Card c13, Card c14, Card c15, Card c16, Card c17, Card c18,\n\t\t\t\t Card c19, Card c20, Card c21, Card c22, Card c23, Card c24, Card c25, Card c26, Card c27, \n\t\t\t\t Card c28, Card c29, Card c30, Card c31, Card c32, Card c33, Card c34, Card c35, Card c36, \n\t\t\t\t Card c37, Card c38, Card c39, Card c40, Card c41, Card c42, Card c43, Card c44, Card c45, \n\t\t\t\t Card c46, Card c47, Card c48, Card c49, Card c50, Card c51, Card c52 ) \n\t{\n\t\tCard[] tempDeck = { c1, c2, c3, c4, c5, c6, c7, c8, c9,\n\t\t\t\t\t\t\tc10, c11, c12, c13, c14, c15, c16, c17, c18,\n\t\t\t\t\t\t\tc19, c20, c21, c22, c23, c24, c25, c26, c27,\n\t\t\t\t\t\t\tc28, c29, c30, c31, c32, c33, c34, c35, c36, c37,\n\t\t\t\t\t\t\tc38, c39, c40, c41, c42, c43, c44, c45, c46, \n\t\t\t\t\t\t\tc47, c48, c49, c50, c51, c52 };\n\t\t\n\t\tdeck = new Card[tempDeck.length];\n\t\t\n\t\tfor( int i = 0; i < tempDeck.length; i++ ) {\n\t\t\tdeck[i] = tempDeck[i];\n\t\t}\n\t}", "public Deck getDeck(){\r\n\t\t return cards;\r\n\t }", "public Game() {\t\t\t\t\t\n\t\t\n\t\tmDeck = new Deck();\t\t\t\t\t\t\t\t\t\t\t\n\t\tmDealer = new Dealer(mDeck.getCard(), mDeck.getCard());\t//dealer gets a random value card twice to initialise the dealers hand with 2 cards\n\t\tmUser = new User();\t\t\t\t\t\t\t\t\t\t\t\n\t\tgiveCard();\t\t\t\t\t\n\t}", "public void createFullDeck(){\n for(Suit cardSuit: Suit.values()){\n //iterating over all the values\n for(Value cardValue: Value.values()){\n cards.add(new Card(cardSuit,cardValue));\n }\n }\n }", "public void fillTreasureDeck() {\n\t\t// create 20 treasure cards\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tthis.addCard(new Card(\"The Earth Stone\", CardType.TREASURE));\n\t\t\tthis.addCard(new Card(\"The Ocean's Chalice\", CardType.TREASURE));\n\t\t\tthis.addCard(new Card(\"The Statue of the Wind\", CardType.TREASURE));\n\t\t\tthis.addCard(new Card(\"The Crystal of Fire\", CardType.TREASURE));\n\t\t}\n\n\t\t// create 3 helicopter lift cards\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\tthis.addCard(new Card(\"Helicopter Lift\", CardType.HELI));\n\t\t}\n\n\t\t// create 2 sandbag cards\n\t\tfor (int i = 0; i < 2; i++) {\n\t\t\tthis.addCard(new Card(\"Sandbag\", CardType.SANDBAG));\n\t\t}\n\n\t\t// create 3 water rise cards\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\tthis.addCard(new Card(\"Water Rise\", CardType.WATER_RISE));\n\t\t}\n\t}", "private void initPanelDeck() {\r\n\t\tgsp.panelDeck = gsp.createPanel(100, 50, 50, 50, 0, 0, 400, 350);\r\n\t\t\r\n\t\tgsp.buttonDeck = new JButton();\r\n\t\tgsp.setImageIcon(\"Deck\", gsp.buttonDeck);\r\n\t\t\r\n\t\tgsp.labelLastCard = new JLabel();\r\n\t\tgsp.updateLastCardView();\r\n\t\t\r\n\t\tgsp.panelDeck.add(gsp.buttonDeck);\r\n\t\tgsp.panelDeck.add(gsp.labelLastCard);\r\n\t}", "public Game(Boolean newGame) throws IOException, InterruptedException {\n if (newGame)\n\n { market = new Market();\n reserve = new Reserve();\n\n productionCardDecks = new ArrayList<>();\n\n deckProductionCardOneBlu = new DeckProductionCardOneBlu();\n deckProductionCardTwoBlu = new DeckProductionCardTwoBlu();\n deckProductionCardThreeBlu = new DeckProductionCardThreeBlu();\n\n deckProductionCardOneGreen = new DeckProductionCardOneGreen();\n deckProductionCardTwoGreen = new DeckProductionCardTwoGreen();\n deckProductionCardThreeGreen = new DeckProductionCardThreeGreen();\n\n deckProductionCardOneViolet = new DeckProductionCardOneViolet();\n deckProductionCardTwoViolet = new DeckProductionCardTwoViolet();\n deckProductionCardThreeViolet = new DeckProductionCardThreeViolet();\n\n deckProductionCardOneYellow = new DeckProductionCardOneYellow();\n deckProductionCardTwoYellow = new DeckProductionCardTwoYellow();\n deckProductionCardThreeYellow = new DeckProductionCardThreeYellow();\n\n\n productionCardDecks.add(deckProductionCardOneBlu);\n productionCardDecks.add(deckProductionCardTwoBlu);\n productionCardDecks.add(deckProductionCardThreeBlu);\n productionCardDecks.add(deckProductionCardOneGreen);\n productionCardDecks.add(deckProductionCardTwoGreen);\n productionCardDecks.add(deckProductionCardThreeGreen);\n productionCardDecks.add(deckProductionCardOneViolet);\n productionCardDecks.add(deckProductionCardTwoViolet);\n productionCardDecks.add(deckProductionCardThreeViolet);\n productionCardDecks.add(deckProductionCardOneYellow);\n productionCardDecks.add(deckProductionCardTwoYellow);\n productionCardDecks.add(deckProductionCardThreeYellow);\n\n deckLeaderCard= new DeckLeaderCard();}\n else {\n restoreGame();\n }\n this.isOver=false;\n\n }", "public Card(){\n suit = 0;\n rank = 0;\n }", "public Deck(String name){\n mJson = new JSONObject();\n cards = new ArrayList<>();\n mCardIterator = cards.iterator();\n createdAt = System.currentTimeMillis();\n lastPlayed = NEVER_PLAYED;\n this.name = name;\n try {\n mJson.put(KEY_NAME, name);\n } catch (JSONException e) {\n //Should never get here\n }\n }", "public Deck getDeck() {\n\t\treturn deck;\n\t}", "public Shoe(int numDecks)\n {\n\n // this will construct the remaining decks.\n\n cardAry = new Card[numDecks*52];\n // create the cards ....\n for (int deckIdx=0; deckIdx<numDecks; deckIdx++)\n {\n for (int suit=0; suit<4; suit++) {\n for( int rank = 1; rank < 14; rank++) {\n cardAry[(deckIdx*52)+(suit*13+rank-1)] = new Card (Card.Suit.numToSuit(suit),\n rank);\n }\n }\n }\n this.numDecks = numDecks;\n this.numCards = 52*numDecks;\n }", "public BlackJackGame()\r\n\t{\r\n\t\tplayer1 = new Player();\r\n\t\tdealer = new Player();\r\n\t\tcardDeck = new Deck();\r\n\t\tendGame = false;\r\n\t}", "public Player (Deck mainDeck) {\n this.mainDeck = mainDeck;\n }", "public Deck(int numPacks) {\n //Build the master pack.\n this.allocateMasterPack();\n //If the user wants more packs than are available, give them the max.\n if (numPacks > Deck.MAX_PACKS)\n this.init(Deck.MAX_PACKS);\n //If the user wants 0 or less packs, give them one.\n else if (numPacks < 1)\n this.init(1);\n else\n //Otherwise, build the deck with the specified number of packs.\n this.init(numPacks);\n }", "@Override\n public void createShoe(int ndecks) {\n Deck deck;\n for (int i = 0; i < ndecks; i++) {\n deck = new Deck();\n this.cards.addAll(deck.getDeck());\n }\n }" ]
[ "0.72849053", "0.70248157", "0.69753385", "0.689712", "0.6893141", "0.684197", "0.6772485", "0.6675049", "0.6664046", "0.66399837", "0.6628198", "0.6581082", "0.656239", "0.6553608", "0.6549225", "0.6519147", "0.6517799", "0.6516865", "0.6506769", "0.647555", "0.64073545", "0.6405591", "0.6383293", "0.6379861", "0.63737", "0.6345869", "0.6326761", "0.6325104", "0.6320516", "0.630366", "0.62862426", "0.62726194", "0.6216619", "0.61805", "0.6179296", "0.6177786", "0.6169817", "0.61615807", "0.6157415", "0.6141724", "0.6118909", "0.61153686", "0.6063368", "0.6057307", "0.60283893", "0.6025812", "0.60082495", "0.5997527", "0.59879756", "0.59873474", "0.59689033", "0.5954408", "0.59515035", "0.59187174", "0.5911913", "0.5910632", "0.58964455", "0.5895018", "0.58871204", "0.58821034", "0.587553", "0.5864199", "0.5862644", "0.5852936", "0.5834371", "0.5817498", "0.58139855", "0.5801321", "0.5798898", "0.57960045", "0.5782413", "0.5761197", "0.57555264", "0.5745233", "0.5744143", "0.57433647", "0.57427967", "0.57392085", "0.57344097", "0.5725999", "0.5713782", "0.5708547", "0.57080245", "0.5706535", "0.5704949", "0.57036096", "0.57011724", "0.5691299", "0.56895435", "0.56857675", "0.5665823", "0.56654775", "0.56600344", "0.56546044", "0.56445396", "0.5641658", "0.5634635", "0.56284994", "0.55989933", "0.55950296" ]
0.6594073
11
returns the deck used by the GDeck
public Deck getDeck(){ return cards; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Deck getDeck() {\n\t\treturn deck;\n\t}", "public CardDeck cardDeck(){\r\n\t\treturn deck;\r\n\t}", "public Deck getDeck() {\n\t\treturn this.deck;\n\t}", "public CardDeck getCardDeck() {\n return cardDeck;\n }", "public ArrayList<Card> getDeck()\n {\n return deck;\n }", "public ArrayList<Card> getDeck() {\n return deck;\n }", "public static int getDeckSize() {\n return DECK_SIZE;\n }", "@Override\n public String toString() {\n return \"Deck{\" + \"deck=\" + deck + '}';\n }", "public int getDeckSize()\n\t{\n\t\treturn deck.size();\n\t}", "public Deck getDeck(String token) throws RemoteException {\n return mainScreenProvider.getDeck(token);\n }", "public JavaDeck getJavaDeck() {\r\n return this.cardDeck;\r\n }", "@Override\r\n public List<Card> getDeck() {\n myDeck2.clear();\r\n\r\n //loops through twice in order to create the deck of 104\r\n for (int k = 0; k < 2; k++) {\r\n for (int i = 0; i < 4; i++) {\r\n for (int j = 1; j <= 13; j++) {\r\n Card nextCard = new Card(suit[i], j);\r\n myDeck2.add(nextCard);\r\n }\r\n }\r\n }\r\n\r\n return myDeck2;\r\n }", "public int getSizeOfDeck(){\n return cardDeck.size();\n }", "public String GetDeckCard(int value){\n return deck.get(value);\n }", "public TrainCard usedCard(){\n TrainCard removedCard = cardDeck.remove(0);\n return removedCard;\n }", "public CardDeck getDeck(String name)\n {\n if(deckStore.isValidName(name) == false)\n {\n return null;\n }\n \n return deckStore.get(name);\n }", "public int GetDeckSize(){\n System.out.println(\"DECK \" + deck.size());\n\n return deck.size();\n }", "public Image deckImage() {\n if (this.size() == 0) {\n return getImageFromStream(\"graphics/empty_deck.png\");\n }\n return getImageFromStream(this.topCard().getImageSource());\n }", "public int deckSize() {\n\t\treturn size;\n\t}", "private ArrayList<Card> getDeckCards(){\n\t\t\t\tArrayList<Card> getdeck = new ArrayList<>();\r\n\t\t\t\t// deck = new ArrayList(52);\r\n\r\n\t\t\t\t// create cards in the deck (0-51)\r\n\t\t\t\tfor (int i = 0; i <= 10; i++) {\r\n\t\t\t\t\tgetdeck.add(new Card(i));\r\n\t\t\t\t}\r\n\t\t\t\t//Collections.shuffle(getdeck);\r\n\t\t\t\t// shuffle the cards\r\n\t\t\t\tfor (int i = 0; i <= getdeck.size()-1; i++) {\r\n\t\t\t\t\tint newindex = (int) (Math.random() * 51);\r\n\t\t\t\t\tCard temp = getdeck.get(i);\r\n\t\t\t\t\tgetdeck.set(i, getdeck.get(newindex));\r\n\t\t\t\t\tgetdeck.set(newindex, temp);\r\n\t\t\t\t}\r\n\t\t\t\t//TODO delete println\r\n\t\t\t\t// print shuffled deck\r\n\t\t\t\tfor (int i = 0; i <= getdeck.size()-1; i++) {\r\n\t\t\t\t\tSystem.out.println(getdeck.get(i).getCardNbr());\r\n\t\t\t\t}\r\n\t\t\t\treturn getdeck;\r\n\t}", "public ArrayList<HouseCards> getHouseCardDeck(){\n\t\treturn houseCardDeck;\n\t}", "public Deck() {\n\t\trand = new Random();\n\t\trand.setSeed(System.currentTimeMillis());\n\t\twhile(deck.size()<52){\n\t\t\tint suit = rand.nextInt(4);\n\t\t\tint rank = rand.nextInt(13);\n\t\t\tString card = this.rank[rank] +\" of \" + this.suit[suit];\n\t\t\tdeck.add(card);\n\t\t}\n\t}", "public int size() {\n return deck.size();\n }", "public int CardsOnDeck()\n\t{\n\t\treturn cardNumber;\n\t}", "Deque<PokerCard> getShuffledHalfDeck();", "public int size()\r\n\t{\r\n\t\treturn deck.size();\r\n\t}", "public CardStack getAvailableCards()\n {\n return null;\n }", "public ArrayList<Card> getDeckWorker() {\n\t\treturn this.deckWorker;\n }", "public List<Card> getCards()\n {\n return this.deckOfCards;\n }", "@JsonIgnore\n\tpublic List<Card> getAvailableCards() {\n\t\tList<Card> availableCards = new ArrayList<>();\n\t\tfor (int i = dealtCards.get(); i < Deck.DECK_SIZE; i++) {\n\t\t\tCard card = cards.get(i);\n\t\t\tavailableCards.add(card);\n\t\t}\n\t\treturn availableCards;\n\t}", "public Card drawFromDeck() {\n\t\treturn cards.remove(0);\n\t}", "public Deck randomShuffle(){\n\t\tshuffleOnceRandom();\n\t\tshuffleOnceRandom();\n\t\treturn ourDeck;\n\t}", "void getArrangedDeck() {\n\t\t\t\t\n\t\tint strength = 1;\n\t\t\n\t\tfor(int index = 0; index < this.numberOfCards; index++) {\n\n\t\t\tif((index+1)%4==0) {\n\t\t\t\tthis.cardsInDeck[index].setColor('\\u2660');\n\t\t\t} else {\n\t\t\t\tif((index+2)%4==0) {\n\t\t\t\t\tthis.cardsInDeck[index].setColor('\\u2665');\n\t\t\t\t} else {\n\t\t\t\t\tif((index+3)%4==0) {\n\t\t\t\t\t\tthis.cardsInDeck[index].setColor('\\u2666');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.cardsInDeck[index].setColor('\\u2663');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tthis.cardsInDeck[index].setStrength(strength);\n\t\t\tif((index+1) % 4 == 0){\n\t\t\t\tstrength++;\n\t\t\t}\n\t\t\t\n\t\t\tif (index >= 0 && index <= 3) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"2\");\n\t\t\t}\n\t\t\tif (index >= 4 && index <= 7) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"3\");\n\t\t\t}\n\t\t\tif (index >= 8 && index <= 11) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"4\");\n\t\t\t}\n\t\t\tif (index >= 12 && index <= 15) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"5\");\n\t\t\t}\n\t\t\tif (index >= 16 && index <= 19) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"6\");\n\t\t\t}\n\t\t\tif (index >= 20 && index <= 23) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"7\");\n\t\t\t}\n\t\t\tif (index >= 24 && index <= 27) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"8\");\n\t\t\t}\n\t\t\tif (index >= 28 && index <= 31) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"9\");\n\t\t\t}\n\t\t\tif (index >= 32 && index <= 35) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"10\");\n\t\t\t}\n\t\t\tif (index >= 36 && index <= 39) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"J\");\n\t\t\t}\n\t\t\tif (index >= 40 && index <= 43) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"Q\");\n\t\t\t}\n\t\t\tif (index >= 44 && index <= 47) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"K\");\n\t\t\t}\n\t\t\tif (index >= 48 && index <= 51) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"A\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public Deck() {\n this.cards = new Card[STANDARD_DECK_SIZE];\n this.topCardIndex = 0;\n int cardIndex = 0;\n int DeckLength = this.cards.length;\n for (Card.Suit suit : Card.Suit.values() ) {\n for (int i = Card.ACE ; i <= Card.KING ; i++ ) {\n cards[cardIndex] = new Card (i, suit);\n cardIndex++;\n }\n }\n }", "public Card topDeckCard(){\n Preconditions.checkArgument(!isDeckEmpty());\n return deck.topCard();\n }", "public List<String> getDeckNames()\n {\n return deckStore.getNames();\n }", "public Card drawCard() {\n Card c = cards.get(0);//get a card\n cards.remove(0);//remove the card form the deck that's given out\n discard.add(c);//so the card given out is added to the discard list\n return c;//return a card object\n\n }", "public CardGao dealCard()\r\n {\r\n return cards.get(top--);\r\n\r\n }", "public Card DrawCard() {\n\t\tCard card = mydeck.get(0);\r\n\t\tmydeck.remove(0);\r\n\t\t\r\n\t\t//TODO delete print line\r\n\t\tSystem.out.println(\"Print Card: \" + card);\r\n\t\tSystem.out.println(\" \");\r\n\t\t// print deck\r\n\t\tSystem.out.println(\"Printing Deck\");\r\n\t\tfor (int i = 0; i <= mydeck.size()-1; i++) {\r\n\t\t\tSystem.out.println(mydeck.get(i).getCardNbr());}\r\n\t\treturn card;\r\n\t}", "public ArrayList<CareerCards> getCareerCardDeck(){\n\t\treturn careerCardDeck;\n\t}", "public Card getPresentCard() {\n return storageCards.peek();\n }", "public List<Deck> getDecks(String token) throws RemoteException {\n return mainScreenProvider.getDecks(token);\n }", "@Override\npublic Deck<T> getDeck(){\n\treturn deck;\n}", "public int deckLength() {\n\t\treturn this.deck.size();\n\t}", "@Test\n public void getDeckTest1() {\n GenericStandardDeckGame g = new GenericStandardDeckGame();\n List<Card> deck = g.getDeck();\n assertEquals(deck.size(), 52);\n }", "public static List<ScrumPokerCard> getDeck() {\n return Arrays.stream(values()).collect(Collectors.toList());\n }", "private List<Card> createDeck(){\n List<Card> newDeck= new ArrayList<Card>();\n for (int i =0;i<CardSet.ALL_CARDS.size(); ++i ) {\n newDeck.add(CardSet.ALL_CARDS.get(i));\n }\n return newDeck;\n }", "public void print_Deck() {\n for(int i = 0; i<52; i++) {\n System.out.println(deck.get(i));\n }\n }", "public String getCards()\r\n\t{\r\n\t\t// creates a larger string which will have the cards appended to it\r\n\t\tString cardList = \"\";\r\n\t\t\r\n\t\t// adds all cards currently in hand\r\n\t\tfor (int i = 0; i < handCount; i++)\r\n\t\t{\r\n\t\t\tcardList = cardList + pCards[i] + \" \";\r\n\t\t}\r\n\t\t\r\n\t\treturn cardList;\r\n\t}", "public int officialSize()\n {\n return this.originalSizeOfDeck;\n }", "public static Card[] getStandardDeck() {\n Card[] deck = new Card[52];\n int s = 0;\n for (SUIT suit : SUIT.values()) {\n for (int i = 12; i > -1; i--) {\n deck[s + i] = new Card(suit, i);\n }\n s += 13;\n }\n return deck;\n }", "public Card dealCard() {\n if (deck.size() == 52) {\n shuffle();\n }\n Card temp;\n temp = deck.get(0);\n remove(0);\n return temp;\n }", "public String getCardSuit() {\n return Csuit;\n }", "public Card giveCard()\n {\n return deck.pop();\n }", "public Deck() {\n generateDeckOfCards();\n }", "public int size() {\n return this.deck.size();\n }", "public Card drawCard() {\n return gameDeck.removeTopCard();\n }", "public Deck(){\n\t\tcount = 51;\n\t\tcards = new Card[52];\n\t\trand = new Random();\n\t\tfor(Suit suit : Suit.values()){\n\t\t\tfor (int i = 2; i < 15; i++) {\n\t\t\t\tcards[suit.ordinal()*13 + i - 2] = new Card(suit,i);\n\t\t\t}\n\t\t}\n\t}", "public JSONObject deckToJSON() {\n\t\tMap deckMap = devCardToMap();\n\t\tJSONObject deck = new JSONObject(deckMap);\n\t\treturn deck;\n\t}", "public Deck makeComputerDeck()\r\n\t{\r\n\t\tDeck computer = new Deck();\r\n\r\n \tfor (int i = 0; i < (DECK_COUNT/2); i++)\r\n \t{\r\n \t computer.addToDeck(deck.remove(0));\r\n \t}\r\n\r\n\t\treturn computer;\r\n\t}", "public String suit() {\r\n return suit;\r\n }", "public UnoCard getCard(){\n Random rnd = new Random();\n int rnd_number = rnd.nextInt(((this.cards.size()-1)-0) + 1) + 0;\n return this.cards.get(rnd_number);\n\n }", "public int getHighCard() {\r\n return highCard;\r\n }", "public Card drawCard() {\n return deck.pop();\n }", "public Blackjack getBlackjack() {\n\t\treturn blackjack;\n\t}", "public Card draw() {\n\t\t\n\t\tCard topCard = deck.get(0);\n\t\tdeck.remove(0);\n\t\treturn topCard;\n\t\t\n\t}", "public Deck(){\n\t\tcards = new ArrayList<>(deckSize);\n\t\tdeck = new int[deckSize];\n\t}", "private Pile createDeck() {\n \t\tPile deck = new Pile(\"deck\"); // TODO Refactor, no hardcoded string\n\t\tpileNames.add(\"deck\");\n \t\tfor (Suit suit : Suit.values()) {\n \t\t\tfor (Rank rank : Rank.values()) {\n \t\t\t\tdeck.addCard(new Card(suit, rank));\n \t\t\t}\n \t\t}\n \t\t// Put the deck at the middle of the table\n \t\tmTable.set(MID_OF_TABLE, deck);\n \t\treturn deck;\n \t}", "public Deck() { // This constructor creates a standard deck\n\n\tcards = new Card[52];\n\tint k=0;\n\t\n\tfor (int i=0; i<4; i++)\n\t for (int j=2; j<15; j++){\n\t\tcards[k]= new Card (j, i);\n\t\tk++;\n\t\t }\n\t \n\n\tshuffle();\n\t\n\tcardsLeft = 52;\n\t/*\tfor (int i=0; i<52; i++)\n\t\tSystem.out.println (cards[i]);*/\n }", "public int getPlayer1DeckSize()\n\t{\n\t\treturn player1.getDeck().size();\n\t}", "public String draw()\r\n\t{\r\n\t\tString cardToDraw = \"\";\r\n\t\t\r\n\t\t// Checks deck status with isEmpty method\r\n\t\tif ( !isEmpty() )\r\n\t\t{\r\n\t\t\tcardToDraw = cards[topCard];\r\n\t\t\ttopCard--;\r\n\t\t}\r\n\t\t\r\n\t\treturn cardToDraw;\r\n\t}", "public ArrayList<ActionCards> getActionCardDeck(){\n\t\treturn actionCardDeck;\n\t}", "private static void showDeckInfo() {\n }", "public Pile getDeckPile() {\n return deckPile;\n }", "public Deck()\n {\n deck = new ArrayList<>();\n }", "public int deal(){\n\t\tint topCard = deck[top];\n\t\ttop--;\n\t\treturn topCard;\n\t}", "public Card giveCard(){\n return this.cardDeck.get(lastIndex++);\n }", "public int dealCard() {\n\n\t\tif (currentPosition == 52) {\n\t\t\tshuffle();\n\t\t}\n\t\tcurrentPosition++;\n\t\treturn deck[currentPosition - 1];\n\t}", "public int cardsLeft() {\n return deck.size();\n }", "public ArrayList<IBuilding> getDeckBuilding() {\n\t\treturn this.deckBuilding;\n }", "public int cardsRemaining() {\n return deck.cardsRemaining();\n }", "public int leaderDeckSize(){\n return deckLeaderCard.size();\n }", "public List<DeckOfCards> getListOfDecks() {\n\t\treturn ImmutableList.copyOf(listOfDecks);\n\t}", "public String getCHEQUE_BANK() {\r\n return CHEQUE_BANK;\r\n }", "public Card topCard() {\n Preconditions.checkArgument(!cardState.isDeckEmpty());\n return (cardState.topDeckCard());\n }", "private static void showPlayerDeckInfo() {\n }", "private List<Card> setupDeck(){\n List<Card> llist = new LinkedList<Card>();\n String[] faceCards = {\"J\",\"Q\",\"K\",\"A\"};\n String[] suits = {\"spades\",\"clubs\",\"diamonds\",\"hearts\"};\n\n for(int i=2; i<=10; i++){\n for(int j=1; j<=4; j++){\n llist.add(new Card(Integer.toString(i), suits[j-1], j, i));\n }\n }\n for(int k=1; k<=4; k++){\n for(int l=1; l<=4; l++){\n llist.add(new Card(faceCards[k-1],suits[l-1], l, k+10));\n }\n }\n return llist;\n }", "public com.google.protobuf.ByteString getCards() {\n return cards_;\n }", "public void generateDeck() {\n\t\tList<String> valueList = Arrays.asList(\"Ace\", \"2\", \"3\",\"4\", \"5\", \"6\",\"7\", \"8\", \"9\",\"10\", \"Jack\", \"Queen\",\"King\");\n\t\tList<String> suitList = Arrays.asList(\"Diamonds\", \"Spades\", \"Clubs\", \"Hearts\");\n\t\tvalues.addAll(valueList);\n\t\tsuits.addAll(suitList);\n\t\t\n\t\t//adding card objects to deckOfCards arraylist\n\t\tint i = 1;\n\t\twhile(i<=52){\n Card card = new Card(values.get(random.nextInt(13)), suits.get(random.nextInt(4)));\n if (!deckOfCards.contains(card)) {\n deckOfCards.add(card);\n i++;\n }else{\n\n }\n }\n\t}", "public Card getCardInDeck(int i){\n\t\treturn deck[i];\n\t}", "public com.google.protobuf.ByteString getCards() {\n return cards_;\n }", "com.google.protobuf.ByteString getCards();", "@Override\r\n\tpublic String toString() {\r\n\t\treturn name + \" (Deck, \" + cards.size() + \" cards)\";\r\n\t}", "private Deck()\n\t{\n\t\tfor (Suit s : Suit.values())\n\t\t\tfor(Rank r : Rank.values())\n\t\t\t\tcards.add(new Card(s,r));\n\t}", "public Card deal() {\n\t\tif (cardsUsed == deck.length)\n\t\t\tthrow new IllegalStateException(\"No cards are left in the deck.\");\n\t\tcardsUsed++;\n\t\treturn deck[cardsUsed - 1];\n\n\t}", "public Cards deal() {\n if (!hasMoreCards()) {\n return null;\n } else {\n Cards temp = null;\n temp = deck[cardHold];\n cardHold = cardHold + 1;\n return temp;\n }\n }", "public GDeck(Deck startdeck){\r\n\t\t cards=startdeck;\r\n\t\t add(back=new GImage(((GCard)startdeck.get(0)).getBackImage().getImage()));\r\n\t }", "@Override\n\tpublic PlayingCard[] getCards() {\n\t\tif(getCount() != 0) {\n\t\t\tPlayingCard[] kopie = new SkatCard[getCount()];\n\t\t\tfor(int i = 0; i < getCount(); i++) {\n\t\t\t\tkopie[i] = new SkatCard(aktuellesDeck[i].getSuit(), aktuellesDeck[i].getRank());\n\t\t\t}\n\t\t\treturn kopie;\n\t\t}else {\n\t\t\tSystem.out.println(\"Stapel leer --> Kopie vom Stapel leer\");\n\t\t\treturn null;\n\t\t}\n\t}", "public Card getLastDrawnCard()\n\t{\n\t\treturn currentHand.get(getHandSize() - 1);\n\t}", "public Card topCard() {\n return this.deck.peek();\n }" ]
[ "0.7579105", "0.7548552", "0.7528196", "0.7175975", "0.69428205", "0.6936485", "0.6849949", "0.68267894", "0.6742814", "0.6737536", "0.67177373", "0.6713053", "0.66988695", "0.65751565", "0.6526635", "0.6521507", "0.65194625", "0.64813423", "0.6450335", "0.63770086", "0.6365126", "0.63637936", "0.63542014", "0.6351745", "0.63475513", "0.6344941", "0.6319275", "0.63088197", "0.6301239", "0.6283407", "0.6276426", "0.62576425", "0.6224322", "0.6219603", "0.6178399", "0.61426336", "0.61315155", "0.61118954", "0.6099502", "0.6083201", "0.606258", "0.60549426", "0.60531175", "0.60357404", "0.6034204", "0.6013922", "0.5998947", "0.5980329", "0.5974682", "0.59734964", "0.5971767", "0.5963828", "0.59154904", "0.59049314", "0.59019375", "0.58973646", "0.58916134", "0.5872913", "0.58696264", "0.58656675", "0.586291", "0.58481264", "0.5839608", "0.5835434", "0.5826952", "0.5826778", "0.582554", "0.58217955", "0.5817833", "0.58172196", "0.581615", "0.5815343", "0.5805073", "0.5792763", "0.57867616", "0.57732", "0.5770851", "0.5768025", "0.5763299", "0.5761567", "0.5758225", "0.57581216", "0.57566476", "0.57536393", "0.5753109", "0.5749422", "0.5747344", "0.57440865", "0.57421595", "0.57199395", "0.57138747", "0.5712803", "0.57113516", "0.57091284", "0.57046723", "0.5697038", "0.5692267", "0.5688949", "0.5678246", "0.5677755" ]
0.69935143
4
returns the image used by the back of the deck
public GImage getBack(){ return back; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Image getBackImage() {\n return getImage(\"playing-cards/blue-back.png\");\n }", "public Image deckImage() {\n if (this.size() == 0) {\n return getImageFromStream(\"graphics/empty_deck.png\");\n }\n return getImageFromStream(this.topCard().getImageSource());\n }", "public static Drawable GetCardBackSideImage()\r\n\t{\r\n\t\tDrawable image = null;\r\n\t\tif(IsPortraitMode())\r\n\t\t{\r\n\t\t\tif(m_CardBackImageProtrait == null)\r\n\t\t\t{\r\n\t\t\t\tm_CardBackImageProtrait = CGameHelper.GetCardBackSideImage_Internal();\r\n\t\t\t}\r\n\t\t\timage = m_CardBackImageProtrait;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(m_CardBackImageLandscape == null)\r\n\t\t\t{\r\n\t\t\t\tm_CardBackImageLandscape = CGameHelper.GetCardBackSideImage_Internal();\r\n\t\t\t}\r\n\t\t\timage = m_CardBackImageLandscape;\r\n\t\t}\r\n\t\t\r\n\t\treturn image;\r\n\t}", "static public Icon getBackCardIcon()\n {\n iconBack = new ImageIcon(\"images/\" + \"BK.gif\");\n return iconBack;\n }", "public static Icon getBackCardIcon() {\n //Load all of the icons if they have not been already.\n if (!GUICard.iconsLoaded)\n GUICard.loadCardIcons();\n return GUICard.iconBack;\n }", "public void generateCardImage() {\r\n\t\tString i1 = \"lib/card/\" + cardSuit + \"/\" + cardSuit + \" \"\r\n\t\t\t\t+ cardValue + \".PNG\";\r\n\t\tString i2 = \"lib/card/back2.PNG\";\r\n\t\t\r\n\t\tFile f1 = new File(i1);\r\n\t\tFile f2 = new File(i2);\r\n\t\t\r\n\t\ttry {\r\n\t\t\tcardImage = ImageIO.read(f1);\r\n\t\t\tcardBack = ImageIO.read(f2);\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\tSystem.out.println(cardValue);\r\n\t\t\tSystem.out.println(cardSuit);\r\n\t\t}\r\n\t}", "public Image getImage() {\n return (isFacingRight) ? Images.get(\"rightTedhaun\") : Images.get(\"leftTedhaun\");\n }", "public ImageIcon getCardPicture()\n {\n\t// Local constants\n\n\t// Local variables\n\n\t/************** Start getCardPicture Method *****************/\n\n // Return card picture\n return picture;\n\n }", "public int getImage();", "java.lang.String getImage();", "public ImageIcon getTopCardImage() {\r\n return new ImageIcon(validColor + \"_\" + validValue + \".png\");\r\n }", "String getImage();", "@Override\r\n\tpublic int getImage() {\n\t\treturn Parametre.BALLE;\r\n\t}", "public Image getCardPlayer2() {\n Random rand1 = new Random();\r\n randomNum1 = rand1.nextInt((52 - 1) + 1) + 1;\r\n Image p2 = new Image(\"/Images/cards/Card\" + randomNum1 + \".png\");\r\n return p2;\r\n }", "public Image getCardPlayer3() {\n Random rand5 = new Random();\r\n randomNum5 = rand5.nextInt((52 - 1) + 1) + 1;\r\n Image p3 = new Image(\"/Images/cards/Card\" + randomNum5 + \".png\");\r\n return p3;\r\n }", "public static Bitmap GetTempCardNumberBitmap()\r\n\t{\r\n\t\tBitmap image = null;\r\n\t\tif(CGameHelper.m_GameContext != null)\r\n\t\t{\r\n\t\t\tResources res = CGameHelper.m_GameContext.getResources();\r\n\t\t\tif(res == null)\r\n\t\t\t\treturn image; \r\n\r\n\t\t\tif(m_TempCardNumberBitmap == null)\r\n\t\t\t{\r\n\t\t\t\tm_TempCardNumberBitmap = BitmapFactory.decodeResource(res, R.drawable.z);\r\n\t\t\t}\r\n\t\t\timage = m_TempCardNumberBitmap;\r\n\t\t} \r\n\t\treturn image;\r\n\t}", "public Image getCardCroupier2() {\n Random rand3 = new Random();\r\n randomNum3 = rand3.nextInt((52 - 1) + 1) + 1;\r\n Image c2 = new Image(\"/Images/cards/Card\" + randomNum3 + \".png\");\r\n return c2;\r\n }", "public static Bitmap GetCardSoruceBitmap()\r\n\t{\r\n\t\tBitmap image = null;\r\n\t\tif(CGameHelper.m_GameContext != null)\r\n\t\t{\r\n\t\t\tResources res = CGameHelper.m_GameContext.getResources();\r\n\t\t\tif(res == null)\r\n\t\t\t\treturn image; \r\n\r\n\t\t\tif(IsPortraitMode())\r\n\t\t\t{\r\n\t\t\t\tif(m_CardBitmapProtrait == null)\r\n\t\t\t\t{\r\n\t\t\t\t\tm_CardBitmapProtrait = BitmapFactory.decodeResource(res, R.drawable.card);\r\n\t\t\t\t}\r\n\t\t\t\timage = m_CardBitmapProtrait;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif(m_CardBitmapLandscape == null)\r\n\t\t\t\t{\r\n\t\t\t\t\tm_CardBitmapLandscape = BitmapFactory.decodeResource(res, R.drawable.card2);\r\n\t\t\t\t}\r\n\t\t\t\timage = m_CardBitmapLandscape;\r\n\t\t\t}\r\n\t\t} \r\n\t\treturn image;\r\n\t}", "private Image getCardImage(Card card) {\n return getImage(\"playing-cards/\" + card + \".png\");\n }", "public Image getImage() {\r\n\t\tif (isShieldActivated()) {\r\n\t\t\treturn GameGUI.SPACESHIP_IMAGE_SHIELD;\r\n\t\t}\r\n\t\treturn GameGUI.SPACESHIP_IMAGE;\r\n\t}", "public Image getCardPlayer1() {\n Random rand = new Random();\r\n randomNum = rand.nextInt((52 - 1) + 1) + 1;\r\n Image p1 = new Image(\"/Images/cards/Card\" + randomNum + \".png\");\r\n return p1;\r\n }", "public java.lang.String getEatImage() {\n return localEatImage;\n }", "public Image getCardCroupier3() {\n Random rand9 = new Random();\r\n randomNum9 = rand9.nextInt((52 - 1) + 1) + 1;\r\n Image c3 = new Image(\"/Images/cards/Card\" + randomNum9 + \".png\");\r\n return c3;\r\n }", "public Image getHotImage () {\r\n\tcheckWidget();\r\n\treturn hotImage;\r\n}", "public Bitmap getImage(){\n return images[currentFrame];\n }", "public Image getEight();", "public Card getLastDrawnCard()\n\t{\n\t\treturn currentHand.get(getHandSize() - 1);\n\t}", "protected Image getP0Image(){\n if (isBoosting()) {\n if (getAnimationStep()==3) return Boost4Image;\n if (getAnimationStep()==2) return Boost3Image;\n else return Boost2Image;\n }\n else return BoostImage;\n }", "abstract BufferedImage getBackround();", "public Image getCardCroupier1() {\n Random rand2 = new Random();\r\n randomNum2 = rand2.nextInt((52 - 1) + 1) + 1;\r\n Image c1 = new Image(\"/Images/cards/Card\" + randomNum2 + \".png\");\r\n return c1;\r\n }", "public static ImageIcon[] getCardImage(){\n\t\treturn cardImage;\n\t}", "int getBackpack();", "public Image getImage() {\n if (tamagoStats.getAge() <= 0) {\n return images.get(\"oeuf\").get(\"noeuf\");\n } else if (tamagoStats.getAge() <= 3) {\n return images.get(\"bebe\").get(\"metamorph\");\n } else if (tamagoStats.getAge() <= 7) {\n return images.get(\"enfant\").get(\"evoli\");\n } else {\n return images.get(\"adulte\").get(\"noctali\");\n }\n }", "public BufferedImage image(){\n\t\treturn shotPic;\n\t}", "public BufferedImage getImage() { // operates every 10 ms\n\t\tif(isLife()) { // alive\n\t\t\treturn images[0]; // return images[0]\n\t\t}else if(isDead()) { // dead\n\t\t\tBufferedImage img = images[index++]; // start from the second image\n\t\t\tif(index==images.length) { // if at the last image\n\t\t\t\tstate = REMOVE; // change the state to REMOVE\n\t\t\t}\n\t\t\treturn img; // return explosion image\n\t\t}\n\t\treturn null; // return null when state removed\n\t\t/*\n\t\t * index=1\n\t\t * 10M img=images[1] index=2 return images[1]\n\t\t * 20M img=images[2] index=3 return images[2]\n\t\t * 30M img=images[3] index=4 return images[3]\n\t\t * 40M img=images[4] index=5(REMOVE) \t\treturn images[4]\n\t\t * 50M return null\n\t\t */\n\t}", "public String getImage() {\n\t\tString ans=\"Data/NF.png\";\n\t\tif(image!=null)\n\t\t\tans=\"Data/Users/Pics/\"+image;\n\t\treturn ans;\n\t}", "public Image getTieOver();", "public Image getSix();", "String getItemImage();", "public Image getTieUnder();", "public Image getFive();", "public String getImage() {\n\t\treturn null;\n\t}", "public Image getQuaverUp();", "public String getImage() { return image; }", "public Image getBattleImage() {\r\n\t\treturn battleImage;\r\n\t}", "public String get_card(int index){\r\n return String.valueOf(hand.get(index).get_value()) + hand.get(index).get_suit() + \".jpg\";\r\n }", "public String getImage()\n {\n return image;\n }", "public BufferedImage getImage ( ) {\n\n BufferedImage img =\n param.Parameters.PROBLEM.getData(param.Parameters.STATE, program, 0, 0);\n\n System.gc();\n\n return img;\n \n }", "public String getImage() {\n\t\treturn image;\n\t}", "public String getImage() {\n\t\treturn image;\n\t}", "public Image getCrotchetRest();", "private Image getCurrentPicture(){\r\n\t\tif (i >= images.size()) {\r\n\t\t\ti = 0;\r\n\t\t}else if(i<0){\r\n\t\t\ti = images.size() -1;\r\n\t\t}\r\n\t\treturn new Image(images.get(i).getUrl());\r\n\t}", "public Image getQuaverDown();", "public BufferedImage getBlackImage() {\n return blackImages[imageNumber];\n }", "public BufferedImage getCurrentImage(){\n\t\treturn getCurrentImage(System.currentTimeMillis()-lastUpdate);\n\t}", "public ImageObj prevImage() {\n if (position != 0) {\n position--;\n }\n else {\n position = model.getImageList().size() - 1;\n }\n\n return model.getImageList().get(position);\n }", "public BufferedImage getImage() {\n/* 81 */ return this.bufImg;\n/* */ }", "public Image getBassClef();", "public Image getImage() {\n\t\t// Check we have frames\n\t\tif(frames.size() == 0) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn getFrame(currentFrameIndex).image;\n\t\t}\n\t}", "public BufferedImage queryImage() {\n\t\treturn cloud;\n\t}", "public String getImage() {\n return image;\n }", "public float getIMG(){\n return profile.getImg();\n }", "public String getImg(){\n switch(image){\n case 0: // Case 0: Ant looks up/north\n return \"imgs/ant_n.png\";\n case 1: // Case 1: Ant looks right/east\n return \"imgs/ant_e.png\";\n case 2: // Case 2: Ant looks down/south\n return \"imgs/ant_s.png\";\n case 3: // Case 3: Ant looks left/west\n return \"imgs/ant_w.png\";\n default: // Default: This shouldn't happen on a normal run. It returns an empty string and prints an error.\n System.err.println(\"Something went wrong while the ant was trying change direction\");\n return \"\";\n }\n }", "public GDeck(Deck startdeck){\r\n\t\t cards=startdeck;\r\n\t\t add(back=new GImage(((GCard)startdeck.get(0)).getBackImage().getImage()));\r\n\t }", "public Image getFlat();", "public String getImage() {\n return image;\n }", "public String getImage() {\n return image;\n }", "public String getImage() {\n return image;\n }", "public String getImage() {\n return image;\n }", "@Override\n\tpublic Image getImage() {\n\t\treturn img;\n\t}", "public String getImage() {\n return this.Image;\n }", "private Card drawCard() {\n return cardStack.pop();\n }", "public Image getDuck(int player, boolean ep) {if (player==1) return duck1; else return duck2;}", "@Override\n\tpublic final Image getImage() {\n\t\treturn this.getSprite().getImage();\n\t}", "public BufferedImage getImage() {\n\t\t return img;\n\t}", "private byte[] getImageOne() {\n Bitmap icon = BitmapFactory.decodeResource(getApplicationContext().getResources(),\n R.drawable.image0);\n return ImageConvert.convertImage2ByteArray(icon);\n }", "public Stack<ColorImage> getCurrentImageHistory() {\n return currentImage;\n }", "@Override\n\tpublic Image getImage() {\n\t\treturn image;\n\t}", "public BufferedImage getImage() {\t\r\n\t\treturn this.image;\t\t\t\r\n\t}", "public ColorImage getCurrentImage() {\n try {\n return currentImage.peek();\n } catch (EmptyStackException e) {\n return null;\n }\n }", "@Override\r\n\tpublic Image getImg() {\n\t\treturn img.getImage();\r\n\t}", "public Image getImage() {\n return null;\r\n }", "public String getImg_0() {\n return img_0;\n }", "public Bitmap getImage() {\n return image;\n }", "public Image getImage()\n {\n return null;\n }", "public static Bitmap GetDealSpriteBitmap()\r\n\t{\r\n\t\t// Load background desktop image from resouce\r\n\t\tBitmap image = null;\r\n\t\tif(CGameHelper.m_GameContext != null)\r\n\t\t{\r\n\t\t\tResources res = CGameHelper.m_GameContext.getResources();\r\n\t\t\tif(res == null)\r\n\t\t\t\treturn image; \r\n\r\n\t\t\tif(m_DealSpriteBitmap == null)\r\n\t\t\t{\r\n\t\t\t\tm_DealSpriteBitmap = BitmapFactory.decodeResource(res, R.drawable.face);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\timage = m_DealSpriteBitmap;\r\n\t\t} \r\n\t\treturn image;\r\n\t}", "public Image getImage() {\r\n\t\treturn GDAssemblerUI.getImage(GDAssemblerUI.IMAGE_GD);\r\n\t}", "public Image getTrebleClef();", "public BufferedImage getExport() {\n int ebackw = Integer.parseInt\n (main.myProps.getProperty(\"export.back\"));\n int efrontw = main.forecast;\n main.display.setBounds(ebackw, efrontw);\n\n Dimension dim = main.display.getPreferredSize(); \n BufferedImage img = new BufferedImage\n (dim.width, dim.height, BufferedImage.TYPE_INT_ARGB);\n Graphics gc = img.getGraphics();\n main.display.paintComponent(gc);\n int d[] = main.display.getExportSize(); \n gc.dispose();\n\n main.display.resetBounds();\n return img.getSubimage(d[0], d[1], d[2], d[3]);\n }", "static String getImage() {\n int rand = (int) (Math.random() * 13);\n return \"file:src/images/spaceships/\" + rand + \".png\";\n }", "public Image getThree();", "public ObjectImage getObjectImage ()\r\n {\r\n return recoverable_.getObjectImage ();\r\n }", "int getExpoBracketingNImagesPref();", "public Image getSemiquaverUp();", "public Card getTopCardDiscardPile() {\r\n return discardPile.get(discardPile.size() - 1);\r\n }", "public Image getSemiquaverDown();", "public Image getImage()\n {\n if (fill instanceof ImageFill)\n {\n return ((ImageFill) fill).getImage();\n }\n else\n {\n return null;\n }\n }", "public Image getImage() {\r\n return image;\r\n }", "public Image getSeven();", "WorldImage getImage();" ]
[ "0.79224235", "0.7649302", "0.6984779", "0.685439", "0.6703633", "0.66994864", "0.658462", "0.65837455", "0.65679044", "0.65408474", "0.6540846", "0.6491198", "0.64640707", "0.6420549", "0.64011914", "0.63999087", "0.6380434", "0.6376176", "0.635493", "0.6321197", "0.6301168", "0.62983793", "0.629346", "0.6280442", "0.6244378", "0.6223326", "0.6212171", "0.62113416", "0.6207363", "0.6195045", "0.6194336", "0.617727", "0.614792", "0.6143748", "0.61382025", "0.61156696", "0.6093199", "0.6088909", "0.6080125", "0.60768056", "0.6061005", "0.605505", "0.60534036", "0.6052999", "0.6032743", "0.6029739", "0.60178316", "0.60084707", "0.59951", "0.59951", "0.5987704", "0.5985757", "0.59803265", "0.59761566", "0.59722465", "0.59667355", "0.5960452", "0.59584373", "0.5944867", "0.5931958", "0.5931588", "0.5923295", "0.5922222", "0.59004366", "0.5897179", "0.58932614", "0.58932614", "0.58932614", "0.58932614", "0.58703846", "0.5862716", "0.58625907", "0.58621883", "0.5857549", "0.5857461", "0.5855897", "0.5842818", "0.58244467", "0.582279", "0.5817987", "0.5803067", "0.5797109", "0.579402", "0.5790654", "0.5788844", "0.5782195", "0.57704467", "0.5759496", "0.57562464", "0.5751053", "0.57505345", "0.574999", "0.57486665", "0.574366", "0.5740601", "0.57370365", "0.57335407", "0.5704709", "0.5701971", "0.56995547" ]
0.6740726
4
Test of getFirst method, of class TestDataGenerator.
@org.junit.Test public void testGetFirst() { System.out.println("getFirst"); TestDataGenerator instance = new TestDataGenerator(); First result = instance.getFirst(); // Assert.assertEquals("Here is a string to check", result.getOruString()); Assert.assertEquals(444422, result.getOruInt()); Assert.assertTrue(result.isOruBoolean()); Assert.assertEquals(8.8886664E7f, result.getOruFloat(), 0); Assert.assertEquals(5555533333222L, result.getOruLong()); Assert.assertEquals(9.99966663322E9, result.getOruDoble(), 0); Assert.assertEquals(OruEnum.FIRST_ENUM, result.getOruEnum()); Assert.assertNotNull(result.getSecond()); // Second // Assert.assertEquals(531223, result.getSecond().getSecondInt()); Assert.assertEquals(666666666L, result.getSecond().getOruLong()); Assert.assertEquals("Here is a second String", result.getSecond().getSecondString()); Assert.assertFalse(result.getSecond().isSecondBoolean()); Assert.assertEquals(4444.333f, result.getSecond().getSecondFloat(), 0); Assert.assertEquals(555555.55555, result.getSecond().getSecondDoble(), 0); Assert.assertNotNull(result.getListOfThrird()); //Collection Assert.assertEquals(3, result.getListOfThrird().size()); // 1 Thrird thrird = result.getListOfThrird().get(0); Assert.assertEquals(0, thrird.getThrirdInt()); Assert.assertEquals(0L, thrird.getThrirdLong()); Assert.assertEquals("Thrird String 0", thrird.getThrirdString()); Assert.assertTrue(thrird.isThrirdBoolean()); Assert.assertEquals(0.0f, thrird.getThrirdFloat(), 0); Assert.assertEquals(0.0, thrird.getThrirdDoble(), 0); // 2 Thrird thrird2 = result.getListOfThrird().get(1); Assert.assertEquals(1, thrird2.getThrirdInt()); Assert.assertEquals(1L, thrird2.getThrirdLong()); Assert.assertEquals("Thrird String 1", thrird2.getThrirdString()); Assert.assertTrue(thrird2.isThrirdBoolean()); Assert.assertEquals(1.0f, thrird2.getThrirdFloat(), 0); Assert.assertEquals(1.0, thrird2.getThrirdDoble(), 0); // 3 Thrird thrird3 = result.getListOfThrird().get(2); Assert.assertEquals(2, thrird3.getThrirdInt()); Assert.assertEquals(2L, thrird3.getThrirdLong()); Assert.assertEquals("Thrird String 2", thrird3.getThrirdString()); Assert.assertTrue(thrird3.isThrirdBoolean()); Assert.assertEquals(2.0f, thrird3.getThrirdFloat(), 0); Assert.assertEquals(2.0, thrird3.getThrirdDoble(), 0); Assert.assertNotNull(result.getCollectionOfObjects()); //Collection //Support for [java.util.HashMap$KeySet] is yet to be added Assert.assertNotNull(result.getMapOfThrird()); //MAP Assert.assertEquals(5, result.getMapOfThrird().size()); // 1 Thrird thrird4 = result.getMapOfThrird().get("KEY_12"); Assert.assertEquals(12, thrird4.getThrirdInt()); Assert.assertEquals(12L, thrird4.getThrirdLong()); Assert.assertEquals("Thrird String 12", thrird4.getThrirdString()); Assert.assertTrue(thrird4.isThrirdBoolean()); Assert.assertEquals(12.0f, thrird4.getThrirdFloat(), 0); Assert.assertEquals(12.0, thrird4.getThrirdDoble(), 0); // 1 Thrird thrird5 = result.getMapOfThrird().get("KEY_11"); Assert.assertEquals(11, thrird5.getThrirdInt()); Assert.assertEquals(11L, thrird5.getThrirdLong()); Assert.assertEquals("Thrird String 11", thrird5.getThrirdString()); Assert.assertTrue(thrird5.isThrirdBoolean()); Assert.assertEquals(11.0f, thrird5.getThrirdFloat(), 0); Assert.assertEquals(11.0, thrird5.getThrirdDoble(), 0); // 1 Thrird thrird6 = result.getMapOfThrird().get("KEY_14"); Assert.assertEquals(14, thrird6.getThrirdInt()); Assert.assertEquals(14L, thrird6.getThrirdLong()); Assert.assertEquals("Thrird String 14", thrird6.getThrirdString()); Assert.assertTrue(thrird6.isThrirdBoolean()); Assert.assertEquals(14.0f, thrird6.getThrirdFloat(), 0); Assert.assertEquals(14.0, thrird6.getThrirdDoble(), 0); // 1 Thrird thrird7 = result.getMapOfThrird().get("KEY_13"); Assert.assertEquals(13, thrird7.getThrirdInt()); Assert.assertEquals(13L, thrird7.getThrirdLong()); Assert.assertEquals("Thrird String 13", thrird7.getThrirdString()); Assert.assertTrue(thrird7.isThrirdBoolean()); Assert.assertEquals(13.0f, thrird7.getThrirdFloat(), 0); Assert.assertEquals(13.0, thrird7.getThrirdDoble(), 0); // 1 Thrird thrird8 = result.getMapOfThrird().get("KEY_10"); Assert.assertEquals(10, thrird8.getThrirdInt()); Assert.assertEquals(10L, thrird8.getThrirdLong()); Assert.assertEquals("Thrird String 10", thrird8.getThrirdString()); Assert.assertTrue(thrird8.isThrirdBoolean()); Assert.assertEquals(10.0f, thrird8.getThrirdFloat(), 0); Assert.assertEquals(10.0, thrird8.getThrirdDoble(), 0); Assert.assertNotNull(result.getMapOfObjects()); //MAP Assert.assertEquals(8, result.getMapOfObjects().size()); Assert.assertEquals("VALUE_7", result.getMapOfObjects().get("KEY_FOR_STRING")); Assert.assertEquals("VALUE_1", result.getMapOfObjects().get(new Character('1'))); Assert.assertEquals("VALUE_7", result.getMapOfObjects().get(new Double(123456.7890625))); Assert.assertEquals("VALUE_4", result.getMapOfObjects().get(new Integer(1234567))); Assert.assertEquals("VALUE_6", result.getMapOfObjects().get(new Float(1234.56F))); Assert.assertEquals("VALUE_5", result.getMapOfObjects().get(new Long(1234567891011L))); Assert.assertEquals("VALUE_3", result.getMapOfObjects().get(new Short((short) 12345))); Assert.assertEquals("VALUE_2", result.getMapOfObjects().get(new Byte((byte) 123))); Assert.assertNotNull(result.getArrayOfThrird()); //Array Assert.assertEquals(5, result.getArrayOfThrird().length); // 1 Thrird thrird9 = result.getArrayOfThrird()[0]; Assert.assertEquals(0, thrird9.getThrirdInt()); Assert.assertEquals(0L, thrird9.getThrirdLong()); Assert.assertEquals("Thrird String 0", thrird9.getThrirdString()); Assert.assertTrue(thrird9.isThrirdBoolean()); Assert.assertEquals(0.0f, thrird9.getThrirdFloat(), 0); Assert.assertEquals(0.0, thrird9.getThrirdDoble(), 0); // 2 Thrird thrird10 = result.getArrayOfThrird()[1]; Assert.assertEquals(1, thrird10.getThrirdInt()); Assert.assertEquals(1L, thrird10.getThrirdLong()); Assert.assertEquals("Thrird String 1", thrird10.getThrirdString()); Assert.assertTrue(thrird10.isThrirdBoolean()); Assert.assertEquals(1.0f, thrird10.getThrirdFloat(), 0); Assert.assertEquals(1.0, thrird10.getThrirdDoble(), 0); // 3 Thrird thrird11 = result.getArrayOfThrird()[2]; Assert.assertEquals(2, thrird11.getThrirdInt()); Assert.assertEquals(2L, thrird11.getThrirdLong()); Assert.assertEquals("Thrird String 2", thrird11.getThrirdString()); Assert.assertTrue(thrird11.isThrirdBoolean()); Assert.assertEquals(2.0f, thrird11.getThrirdFloat(), 0); Assert.assertEquals(2.0, thrird11.getThrirdDoble(), 0); // 4 Assert.assertNull(result.getArrayOfThrird()[3]); // 5 Assert.assertNull(result.getArrayOfThrird()[4]); Assert.assertNotNull(result.getArrayOfString()); //Array Assert.assertEquals(3, result.getArrayOfString().length); // 1 Assert.assertEquals("array_1", result.getArrayOfString()[0]); // 2 Assert.assertEquals("array_2", result.getArrayOfString()[1]); // 3 Assert.assertEquals("arrat_3", result.getArrayOfString()[2]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n\tpublic void testGetFirst() {\n\t}", "@Test\r\n\tvoid testFirst() {\r\n\t\tSimpleList test = new SimpleList();\r\n\t\ttest.add(3);\r\n\t\ttest.add(7);\r\n\t\ttest.add(10);\r\n\t\tint output = test.first();\r\n\t\tassertEquals(10, output);\r\n\t}", "public Object getFirst()\n {\n if(first == null){\n throw new NoSuchElementException();}\n \n \n \n return first.data;\n }", "public int getFirst();", "public Item getFirst();", "public T getFirst();", "public T getFirst();", "@Test\r\n\tvoid testFirst2() {\r\n\t\tSimpleList test = new SimpleList();\r\n\t\tint output = test.first();\r\n\t\tassertEquals(-1, output);\r\n\t}", "@Test\n public void testGetFirst() throws Exception {\n System.out.println(\"getFirst\");\n Connection con = ConnexionMySQL.newConnexion();\n Inscription result = Inscription.getFirst(con);\n assertEquals(\"[email protected]\", result.getMail());\n }", "@Test\n public void testGetFirstValue() {\n final ConfigSearchResult<?> result = new ConfigSearchResult<>(CONFIGS);\n assertEquals(result.getFirstValue(), DS_1);\n }", "public T getFirst() {\n return this.getHelper(this.indexCorrespondingToTheFirstElement).data;\n }", "public String getFirst(){ return this.first; }", "T first();", "public T getFirst()\n\t{\n\t\treturn head.getData();\n\t}", "public String getFirst(){\n return this.first;\n }", "public T1 getFirst() {\n\t\treturn first;\n\t}", "public java.lang.Integer getFirstResult()\r\n {\r\n return this.firstResult;\r\n }", "public int getFirst() {\n return first;\n }", "@Override\r\n\tprotected void doFirst() {\n\t\t\r\n\t}", "public E getFirst();", "public Object getFirst() {\r\n if (size == 0)\r\n throw new NoSuchElementException();\r\n\r\n return header.next.element;\r\n }", "@Test\n public void nextTest() {\n this.it.next();\n this.it.next();\n assertThat(\"work3\", is(this.it.next()));\n }", "public Optional<T> getFirstItem() {\n return getData().stream().findFirst();\n }", "public int getFirst() {\n\t\treturn first;\n\t}", "public T first(int x)throws EmptyCollectionException, \n InvalidArgumentException;", "public Object getFirst()\n {\n if (first == null)\n {\n throw new NoSuchElementException();\n }\n else\n return first.getValue();\n }", "public T getFirst( ){\r\n\t\tif (isEmpty())\r\n\t\t\tthrow new NoSuchElementException(\"ChainedArrays are empty\");\r\n\t\t//first node\r\n\t\tArrayNode<T> first = beginMarker.next;\r\n\t\ttry{\r\n\t\t\t//first elem\r\n\t\t\treturn first.getFirst();\r\n\t\t}catch( IndexOutOfBoundsException e){\r\n\t\t\tthrow new NoSuchElementException(\"ChainedArrays are empty\");\r\n\t\t}\r\n\t\t\r\n\t}", "@Test\n public void addFirst() {\n\n collection.addFirst(0000);\n collection.addFirst(0001);\n assertEquals(collection.getFirst(),0001);\n }", "@Test\n void testForNextPlayerUserStartsFirst() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n Human testHuman = testDealer.getUser();\n testDealer.setNextPlayer(testDealer.getUser().getId());\n \n assertEquals(testDealer.getUser() , testDealer.getTrickPlayer());\n assertEquals(testDealer.getBotA().getId(), testDealer.getNextPlayer());\n }", "@Override\r\n\t\tpublic T getFirst() {\n\t\t\treturn pair.getFirst();\r\n\t\t}", "public A getFirst() { return first; }", "public boolean first() {\n initialize();\n return next();\n }", "public U getFirst(){\r\n\t \tif (getArraySize()==0)\r\n\t \t\tthrow new IndexOutOfBoundsException();\r\n\t \t//calls get\r\n\t \treturn get(0);\r\n\t }", "int getFirstNumber();", "public String getFirst() {\n if(first == null) return null;\n return first.data;\n }", "public T getFirst()\n\t{\n\t\treturn getFirstNode().getData();\n\t}", "public T getData() {\n return this.first;\n }", "public E getFirst() {\n\t\tif (mSize == 0)\n\t\t\tthrow new NoSuchElementException();\n\t\treturn mHead.next.data;\n\t}", "public T getFirst() {\n return t;\n }", "@Override\n public Tile getFirst() {\n return tiles.iterator().next();\n }", "@Override\n public Persona First() {\n return array.get(0);\n }", "@Test\n public void testGetNext() throws Exception {\n//TODO: Test goes here... \n }", "@Test\n\tpublic void testAddFirst() {\n\t\tLinkedListInterface e = new LinkedList();\n\t\te.addLast(\"JOHNSON Shawn\");\n\t\te.addLast(\"LIUKIN Anastasia\");\n\t\te.addLast(\"JIANG Yuyuan\");\n\t\te.addFirst(\"IZBASA Sandra Raluca\");\n\t\tassertEquals(e.get(0), \"IZBASA Sandra Raluca\");\n\t\tassertEquals(e.get(1), \"JOHNSON Shawn\");\n\t\te.addFirst(\"RAISMAN Alexandra\");\n\t\tassertEquals(e.get(0), \"RAISMAN Alexandra\");\n\t\tassertEquals(e.get(2), \"JOHNSON Shawn\");\n\t}", "int getFirstItemOnPage();", "public Object firstElement();", "public boolean first(String key) {\n initialize();\n return next(key);\n }", "public void setFirstResult(java.lang.Integer firstResult)\r\n {\r\n this.firstResult = firstResult;\r\n }", "@Test\n public void getByIndex(){\n List <String> list = new ArrayList<>();\n list.add(\"hola\");\n list.add(\"tdd\");\n list.add(\"test\");\n\n assertEquals(\"tdd\",list.get(1));\n }", "public K getFirst() {\r\n\t\treturn first;\r\n\t}", "@Test\r\n\tpublic void firstTest() {\r\n\t\t\r\n\t\tTree tree = new Tree(\"greg\");\r\n\t\ttree.addElement(\"opera\");\r\n\t\ttree.addElement(\"qwerty\");\r\n\t\ttree.addElement(\"odf\");\r\n\t\ttree.addElement(7363);\r\n\t\ttree.addElement(new Double(23.3));\r\n\t\t\r\n\t\tassertTrue(tree.contains(7363));\r\n\t\tassertTrue(tree.contains(\"greg\"));\r\n\t\tassertTrue(tree.contains(\"opera\"));\r\n\t\tassertTrue(tree.contains(\"odf\"));\r\n\t}", "R getFirstRowOrThrow();", "@Test\n\tpublic static void PersonTest01() {\n\t\t\tString targetTable = \"DATA_TEST\";\n\t\t\ttargetTable = \"test_sample\";\n\t\t\ttry{\n\t\t\tPriorDAO DAO = new PriorDAO();\n\t\t\tDAO.DropTempTable(targetTable);\n\t\t\tString[] inArgs ={\"CREATE_EMPTY_FACT_TABLE\",targetTable};\n\t\t\tDAO.RunProcedure(inArgs, null, null);\n\t\tGenerator Gen = new Generator();\n\t\tint crowedSize = 10000;\n\t\tcrowedSize = 1000;\n\t\tmakePop(Gen, crowedSize, targetTable);\n\t\tGeneratorType2 Gen2 = new GeneratorType2();\n\t\tmakePop(Gen2, crowedSize, targetTable);\n\t\tPrint(\"Finished\");\n\t\t\t}catch(Exception e)\n\t\t\t{\n\t\t\t\tPrint(\"Failed :\"+e.getMessage());\n\t\t\t}\n\t}", "String getFirst(int n);", "public E getFirst(){\n return head.getNext().getElement();\n }", "@Override\r\n\tpublic T first() {\n\t\treturn head.content;\r\n\t}", "public static void main(String[] args) {\n\n System.out.println(\"\\ngetFirst() Test:\");\n System.out.println(\"------------------------------------\");\n\n MyLinkedList<String> gf1 = new MyLinkedList<String>();\n MyLinkedList<String> gf2 = new MyLinkedList<String>();\n MyLinkedList<String> gf3 = new MyLinkedList<String>();\n boolean test1 = false;\n boolean test2 = false;\n boolean test3 = false;\n\n gf1.add(\"node1\");\n\n gf2.add(\"node1\");\n gf2.add(\"node2\");\n\n gf3.add(\"node1\");\n gf3.add(\"node2\");\n gf3.add(\"node3\");\n\n System.out.println(\"1-element list: \\t\" + gf1);\n System.out.println(\"First element: \\t\\t\" + gf1.getFirst());\n System.out.println(\" \");\n\n System.out.println(\"2-element list: \\t\" + gf2);\n System.out.println(\"First element: \\t\\t\" + gf2.getFirst());\n System.out.println(\" \");\n\n System.out.println(\"3-element list: \\t\" + gf3);\n System.out.println(\"First element: \\t\\t\" + gf3.getFirst());\n System.out.println(\" \");\n\n MyLinkedList<String> emptyList = new MyLinkedList<String>();\n\n System.out.println(\"\\nTesting empty list: \");\n\n boolean firstFail = false;\n if(emptyList.getFirst() == null) {\n firstFail = true;\n }\n\n System.out.println(\" \");\n System.out.println(\"Results: \");\n System.out.println(\"Test 1:\\t\\t\\t\" + (gf1.getFirst() == \"node1\" ? \"PASSED\" : \"FAILED\"));\n System.out.println(\"Test 2:\\t\\t\\t\" + (gf1.getFirst() == \"node1\" ? \"PASSED\" : \"FAILED\"));\n System.out.println(\"Test 3:\\t\\t\\t\" + (gf1.getFirst() == \"node1\" ? \"PASSED\" : \"FAILED\"));\n\n System.out.println(\"Null list test:\\t\\t\" + (firstFail ? \"PASSED\" : \"FAILED\"));\n System.out.println(\"====================================\");\n\n /*=====================================================*/\n\n /**\n * This tests uses four lists differeing\n * in size and returns the last element.\n */\n\n System.out.println(\"\\ngetLast() Test:\");\n System.out.println(\"------------------------------------\");\n\n System.out.println(\"1-element list: \\t\" + gf1);\n System.out.println(\"Last element: \\t\\t\" + gf1.getLast());\n System.out.println(\" \");\n\n System.out.println(\"2-element list: \\t\" + gf2);\n System.out.println(\"Last element: \\t\\t\" + gf2.getLast());\n System.out.println(\" \");\n\n System.out.println(\"3-element list: \\t\" + gf3);\n System.out.println(\"Last element: \\t\\t\" + gf3.getLast());\n System.out.println(\" \");\n\n System.out.println(\"\\nTesting empty list: \");\n\n boolean lastFail = false;\n if(emptyList.getLast() == null) {\n lastFail = true;\n }\n\n System.out.println(\" \");\n System.out.println(\"Results: \");\n\n System.out.println(\"Test 1:\\t\\t\\t\" + (gf1.getLast() == \"node1\" ? \"PASSED\" : \"FAILED\"));\n System.out.println(\"Test 2:\\t\\t\\t\" + (gf2.getLast() == \"node2\" ? \"PASSED\" : \"FAILED\"));\n System.out.println(\"Test 3:\\t\\t\\t\" + (gf3.getLast() == \"node3\" ? \"PASSED\" : \"FAILED\"));\n\n System.out.println(\"Test for null list:\\t\" + (lastFail ? \"PASSED\" : \"FAILED\"));\n System.out.println(\"====================================\");\n\n /*====================================================*/\n\n /**\n * This tests uses four lists and adds an element\n * to the list including an empty list.\n */\n\n System.out.println(\"\\n\\nadd() Test:\");\n System.out.println(\"------------------------------------\");\n System.out.println(\"Element to add: \\tadded\");\n System.out.println(\" \");\n MyLinkedList<String> addEmptyList = new MyLinkedList<String>();\n\n System.out.println(\"0-element list: \\t\" + addEmptyList);\n addEmptyList.add(\"added\");\n System.out.println(\"After adding: \\t\\t\" + addEmptyList);\n System.out.println(\" \");\n\n System.out.println(\"1-element list: \\t\" + gf1);\n gf1.add(\"added\");\n System.out.println(\"After adding: \\t\\t\" + gf1);\n System.out.println(\" \");\n\n System.out.println(\"2-element list: \\t\" + gf2);\n gf2.add(\"added\");\n System.out.println(\"After adding: \\t\\t\" + gf2);\n System.out.println(\" \");\n\n System.out.println(\"3-element list: \\t\" + gf3);\n gf3.add(\"added\");\n System.out.println(\"After adding: \\t\\t\" + gf3);\n\n System.out.println(\"\\nResults:\");\n System.out.println(\"1-element test:\\t\\t\" + ((gf1.getLast() == \"added\") ? \"PASSED\" : \"FAILED\"));\n System.out.println(\"2-element test:\\t\\t\" + ((gf2.getLast() == \"added\") ? \"PASSED\" : \"FAILED\"));\n System.out.println(\"3-element test:\\t\\t\" + ((gf3.getLast() == \"added\") ? \"PASSED\" : \"FAILED\"));\n\n System.out.println(\"====================================\");\n /*====================================================*/\n\n /**\n * This tests uses four lists and adds an element\n * to the list including an empty list.\n */\n\n MyLinkedList<String> af = new MyLinkedList<String>();\n MyLinkedList<String> af1 = new MyLinkedList<String>();\n MyLinkedList<String> af2 = new MyLinkedList<String>();\n MyLinkedList<String> af3 = new MyLinkedList<String>();\n\n af.add(\"1\");\n af.add(\"2\");\n\n af1.add(\"1\");\n af1.add(\"2\");\n af1.add(\"3\");\n\n af2.add(\"1\");\n af2.add(\"2\");\n af2.add(\"3\");\n af2.add(\"4\");\n\n af3.add(\"1\");\n af3.add(\"2\");\n af3.add(\"3\");\n af3.add(\"4\");\n af3.add(\"5\");\n af3.add(\"6\");\n\n System.out.println(\"\\n\\naddAfter() Test:\");\n System.out.println(\"------------------------------------\");\n System.out.println(\"Element to add: \\tadded\");\n\n\n System.out.println(\" \");\n System.out.println(\"Base List: \");\n int index = 0;\n af.addAfter(index, \"added\");\n System.out.println(\"After adding: \\t\\t\" + af);\n\n\n System.out.println(\"Index to add after:\\t\" + index);\n System.out.println(\" \");\n System.out.println(\"List 1: \\t\\t\" + af1);\n af1.addAfter(index, \"added\");\n System.out.println(\"After adding: \\t\\t\" + af1);\n\n index++;\n System.out.println(\"Index to add after:\\t\" + index);\n System.out.println(\" \");\n System.out.println(\"List 2: \\t\\t\" + af2);\n af2.addAfter(index, \"added\");\n System.out.println(\"After adding: \\t\\t\" + af2);\n\n index++;\n System.out.println(\"Index to add after:\\t\" + index);\n System.out.println(\" \");\n System.out.println(\"List 3: \\t\\t\" + af3);\n af3.addAfter(index, \"added\");\n System.out.println(\"After adding: \\t\\t\" + af3);\n index++;\n System.out.println(\"Index to add after:\\t\" + index);\n System.out.println(\" \");\n System.out.println(\"Testing invalid Indexes: \");\n\n int indexError = 2;\n try {\n emptyList.addAfter(-7, 200);\n emptyList.addAfter(200, 200);\n\n }catch(Exception e) {\n System.out.println();\n }\n\n int indexT = 1;\n System.out.println(\"\\nResults:\");\n System.out.println(\"List 1 Test\\t\\t\\t\" + ((af1.get(indexT) == \"added\")? \"PASSED\" : \"FAILED\"));\n System.out.println(\"List 2 Test\\t\\t\\t\" + ((af2.get(indexT+1) == \"added\")? \"PASSED\" : \"FAILED\"));\n System.out.println(\"List 3 Test\\t\\t\\t\" + ((af3.get(indexT+2) == \"added\")? \"PASSED\" : \"FAILED\"));\n\n System.out.println(\"Invalid (Index -7) test:\\t\" + (!(emptyList.get(indexError-9) == \"added\")? \"PASSED\" : \"FAILED\"));\n System.out.println(\"Invalid (Index 200)test:\\t\" + (!(emptyList.get(indexError+198) == \"added\")? \"PASSED\" : \"FAILED\"));\n\n System.out.println(\"====================================\");\n /*====================================================*/\n\n /**\n * This tests uses a list and sets a specified index\n * with \"added\". Additionally, it tests out of bounds\n * indexes.\n */\n\n System.out.println(\"\\n\\nset() Test:\");\n System.out.println(\"------------------------------------\");\n\n index = 2;\n System.out.println(\"index to set: \" + index);\n System.out.println(\"set value: \" + 2.5);\n System.out.println(\" \");\n System.out.println(\"List before setting: \\t\\t\" + af2);\n af2.set(index, \"2.5\");\n System.out.println(\"List after setting: \\t\\t\" + af2);\n System.out.println(\" \");\n\n MyLinkedList<String> testList = new MyLinkedList<String>();\n System.out.println(\"Testing out of bounds indexes: \");\n testList.set(-50, 45);\n testList.set(50, 45);\n\n System.out.println(\"\\nResult:\");\n System.out.println(\"Test 1: \\t\\t\" + ((af2.get(2) == \"2.5\") ? \"PASSED\" : \"FAILED\"));\n\n System.out.println(\"Test index 50: \\t\\t\" + ((testList.get(50) == null) ? \"PASSED\" : \"FAILED\"));\n System.out.println(\"Test index -50: \\t\" + ((testList.get(50) == null) ? \"PASSED\" : \"FAILED\"));\n\n System.out.println(\"====================================\");\n /*====================================================*/\n\n System.out.println(\"\\n\\nlastIndex() Test:\");\n System.out.println(\"------------------------------------\");\n System.out.println(\"Testing for value of 2\");\n System.out.println(\" \");\n\n MyLinkedList<Integer> lastIndexEmpty = new MyLinkedList<>();\n System.out.println(\"Empty list: \\t\\t\" + lastIndexEmpty);\n int last = lastIndexEmpty.lastIndex(\"2\");\n if(last == -1) {\n System.out.println(\"Last index \" + \"[null]\");\n }\n System.out.println(\"List: \\t\\t\" + af2);\n int last1 = af2.lastIndex(\"2\");\n System.out.println(\"Last index: \" + last1);\n af2.add(\"2\");\n System.out.println(\" \");\n System.out.println(\"List: \\t\\t\" + af2);\n int last2 = af2.lastIndex(\"2\");\n System.out.println(\"Last index: \" + last2);\n\n System.out.println(\"\\nResults:\");\n System.out.println(\"Test 1 \\t\\t\\t\\t\" + ((last1 == 1) ? \"PASSED\" : \"FAILED\"));\n System.out.println(\"Test 2 \\t\\t\\t\\t\" + ((last2 == 5) ? \"PASSED\" : \"FAILED\"));\n System.out.println(\"Test element not in list \\t\" + ((last == -1) ? \"PASSED\" : \"FAILED\"));\n\n System.out.println(\"====================================\");\n /*====================================================*/\n\n /**\n * This tests creates a deep copy and turns a \"cloned\"\n * list.\n */\n\n System.out.println(\"\\n\\nclone() Test:\");\n System.out.println(\"------------------------------------\");\n\n MyLinkedList<Integer> list = new MyLinkedList<>();\n MyLinkedList<Integer> cloneEmpty = new MyLinkedList<>();\n\n list.add(1);\n list.add(2);\n list.add(3);\n list.add(4);\n list.add(5);\n list.add(6);\n\n System.out.println(\"Empty list: \\t\\t\" + cloneEmpty);\n MyLinkedList<Integer> emptyListClone = new MyLinkedList<>();\n System.out.println(\"Cloned Empty List: \\t\" + emptyListClone);\n System.out.println(\"\\nList: \\t\\t\" + list);\n MyLinkedList<Integer> listClone = new MyLinkedList<>();\n listClone = list.clone();\n System.out.println(\"Cloned List: \\t\" + listClone);\n\n System.out.println(\"\\nResults: \");\n System.out.println(\"Empty list test : \" + (emptyListClone.isEmpty()?\"PASSED\":\"**FAILED**\"));\n\n if(list.size() == listClone.size()) {\n boolean cloneListTrue = true;\n System.out.println(\"Equal list test : \" + (cloneListTrue ? \"PASSED\" : \"**FAILED**\"));\n }\n\n System.out.println(\"====================================\");\n /*====================================================*/\n\n /**\n * This tests both elements in and not in lists.\n */\n\n System.out.println(\"\\n\\nremoveAll() Test:\");\n System.out.println(\"------------------------------------\");\n\n MyLinkedList<Integer> rmList = new MyLinkedList<>();\n\n rmList.add(1);\n rmList.add(2);\n rmList.add(2);\n rmList.add(2);\n rmList.add(3);\n rmList.add(4);\n\n Integer toRm = 2;\n System.out.println(\"Before removeAll(): \\t\\t\" + rmList);\n System.out.println(\"Removing \" + toRm);\n rmList.removeAll(toRm);\n System.out.println(\"After removeAll(): \\t\\t\" + rmList);\n\n System.out.println(\"\\nTest for element not in list (10)\");\n rmList.removeAll(10);\n System.out.println(\"After: \" + rmList);\n\n System.out.println(\"====================================\");\n /*====================================================*/\n\n /**\n * This tests uses four lists. The first two are equal\n * while the third list is different. The fourth list\n * is empty.\n */\n\n System.out.println(\"\\n\\nequals() Test:\");\n System.out.println(\"------------------------------------\");\n\n MyLinkedList<String> equals1 = new MyLinkedList<String>();\n MyLinkedList<String> equals2 = new MyLinkedList<String>();\n MyLinkedList<String> equals3 = new MyLinkedList<String>();\n MyLinkedList<String> equals4 = null; \n\n equals1.add(\"Alpha\");\n equals1.add(\"Bravo\");\n equals1.add(\"Charlie\");\n equals1.add(\"Delta\");\n\n equals2.add(\"Alpha\");\n equals2.add(\"Bravo\");\n equals2.add(\"Charlie\");\n equals2.add(\"Delta\");\n\n equals3.add(\"Alpha\");\n equals3.add(\"Bravo\");\n equals3.add(\"Charlie\");\n equals3.add(\"ECHO\");\n\n System.out.println(\"List 1\\t\\t\" + equals1);\n System.out.println(\"List 2\\t\\t\" + equals2);\n System.out.println(\"List 3\\t\\t\" + equals3);\n\n System.out.println(\"\\nResults: \");\n System.out.println(\"Testing list 1 and 2 = \" + ((equals1.equals(equals2)) ? \"PASSED\" : \"FAILED\"));\n System.out.println(\"Testing list 1 and 3 = \" + (!(equals1.equals(equals3)) ? \"PASSED\" : \"FAILED\"));\n System.out.println(\"Testing list 1 and null:\");\n try {\n System.out.println(\"List 1 and empty list = \" + (!(equals1.equals(equals4)) ? \"PASSED\" : \"FAILED\"));\n } catch (Exception e) {\n System.out.println(\"PASSED\");\n }\n\n System.out.println(\"====================================\");\n /*====================================================*/\n\n /**\n * This test uses four lists testing both even and odd\n * length lists.\n */\n\n System.out.println(\"\\n\\nsplit() Test:\");\n System.out.println(\"------------------------------------\");\n\n MyLinkedList<String> split1 = new MyLinkedList<String>();\n MyLinkedList<String> split2 = new MyLinkedList<String>();\n MyLinkedList<String> split3 = new MyLinkedList<String>();\n MyLinkedList<String> split4 = new MyLinkedList<String>();\n\n split1.add(\"node1\");\n split1.add(\"node2\");\n split1.add(\"node3\");\n split1.add(\"node4\");\n\n System.out.println(\"List1 before splitting: \\t\" + split1);\n split2 = split1.split();\n\n System.out.println(\"List1 after splitting: \\t\\t\" + split1);\n System.out.println(\"Return List (second half): \\t\" + split2);\n\n split3.add(\"node1\");\n split3.add(\"node2\");\n split3.add(\"node3\");\n split3.add(\"node4\");\n split3.add(\"node5\");\n\n System.out.println(\"\\nList3 before splitting: \\t\" + split3);\n split4 = split3.split();\n\n System.out.println(\"List3 after splitting: \\t\\t\" + split3);\n System.out.println(\"Return List (second half): \\t\" + split4);\n\n System.out.println(\"====================================\");\n /*====================================================*/\n\n System.out.println(\"\\n\\ndoubler() Test:\");\n System.out.println(\"------------------------------------\");\n\n MyLinkedList<Integer> doubler1 = new MyLinkedList<>();\n MyLinkedList<Integer> doubler2 = new MyLinkedList<>();\n\n for (int i = 0; i < 4; i++) {\n doubler1.add(i);\n }\n\n System.out.println(\"Before doubling:\\t\" + doubler1);\n doubler1.doubler();\n System.out.println(\"After doubling:\\t\\t\" + doubler1);\n\n\n System.out.println(\"\\nTesting empty list:\");\n try {\n emptyList.doubler();\n }catch (Exception e) {\n System.out.println(\"\\nResults: \");\n System.out.println(\"Null list test: \\t\" + \" PASSED\");\n }\n\n System.out.println(\"====================================\");\n /*====================================================*/\n\n /**\n * Tests two different sets of indexes as well as\n * those that are outside of the range.\n */\n\n System.out.println(\"\\n\\nsublist() Test:\");\n System.out.println(\"------------------------------------\");\n\n MyLinkedList<Integer> subList = new MyLinkedList<>();\n MyLinkedList<Integer> subList2 = new MyLinkedList<>();\n\n subList.add(1);\n subList.add(2);\n subList.add(3);\n subList.add(4);\n subList.add(5);\n subList.add(6);\n\n System.out.println(\"Original list: \\t\" + subList);\n System.out.println(\"\\nSub List (Indexes 3 - 5): \\t\" + subList.sublist(3, 5));\n\n boolean sublistFail = false;\n\n System.out.println(\"Sub List (Indexes 2 - 4): \\t\" + subList.sublist(2, 4));\n System.out.println(\"\\nTest invalid indexes (30 and 40): \");\n try{\n if(subList.sublist(30, 40) == null) {\n sublistFail = true;\n }\n else{\n sublistFail = false;\n }\n\n }catch(Exception e){\n }\n\n System.out.println(\"\\nResults: \");\n System.out.println(\"Index out of bounds test: \\t\" + (sublistFail ? \"PASSED\" : \"FAILED\"));\n System.out.println(\"====================================\");\n\n\n\n\n\n\n /*\n MyLinkedList<String> list0 = new MyLinkedList<String>();\n MyLinkedList<String> list1 = new MyLinkedList<String>();\n MyLinkedList<String> list2 = new MyLinkedList<String>();\n\n list1.addFirst(\"node1\");\n System.out.println(\"1-element list: \" + list1);\n list2.addFirst(\"node2\"); list2.addFirst(\"node1\");\n System.out.println(\"2-element list: \" + list2);\n\n System.out.println(\"\\nTesting getFirst...\");\n System.out.println(list0.getFirst());\n System.out.println(list1.size() + \" \" + list1);\n System.out.println(list1.getFirst().equals(\"node1\")?\"PASSED\":\"**FAILED**\");\n System.out.println(list2.size() + \" \" + list2);\n System.out.println(list2.getFirst().equals(\"node1\")?\"PASSED\":\"**FAILED**\");\n\n System.out.println(\"\\nTesting getLast...\");\n System.out.println(list0.getLast());\n System.out.println(list1.size() + \" \" + list1);\n System.out.println(list1.getLast().equals(\"node1\")?\"PASSED\":\"**FAILED**\");\n System.out.println(list1.size() + \" \" + list1);\n System.out.println(list2.size() + \" \" + list2);\n System.out.println(list2.getLast().equals(\"node2\")?\"PASSED\":\"**FAILED**\");\n System.out.println(list2.size() + \" \" + list2);\n\n System.out.println(\"\\nTesting add...\");\n MyLinkedList<String> list3 = new MyLinkedList<String>();\n MyLinkedList<String> list4 = new MyLinkedList<String>();\n list3.add(\"node1\"); list3.add(\"node2\"); list3.add(\"node3\");\n System.out.println(\"3-element list: \" + list3);\n list4.add(\"node1\"); list4.add(\"node2\"); list4.add(\"node3\"); list4.add(\"node4\");\n System.out.println(\"4-element list: \" + list4);\n\n System.out.println(\"\\nTesting addAfter...\");\n MyLinkedList<String> listAddAfter1 = new MyLinkedList<String>();\n listAddAfter1.add(\"node1\");\n listAddAfter1.add(\"node2\");\n listAddAfter1.add(\"node3\");\n listAddAfter1.add(\"node4\");\n listAddAfter1.addAfter(2, \"after 2\");\n System.out.println(\"Add-after-2: \" + listAddAfter1);\n\n\n System.out.println(\"\\nTesting set...\");\n MyLinkedList<String> test = new MyLinkedList<String>();\n System.out.println(\" empty list test = \" + ((test.set(2,\"bad\") == null)?\"PASSED\":\"**FAILED**\"));\n test.addFirst(\"Mark\");\n test.addFirst(\"Sohaib\");\n test.addFirst(\"Salman\");\n System.out.println(\" return value test = \" + ((test.set(1,\"Nora\")).equals(\"Sohaib\")?\"PASSED\":\"**FAILED**\"));\n System.out.println(\" non-empty test = \" + ((test.get(0).equals(\"Salman\") && test.get(1).equals(\"Nora\") &&\n test.get(2).equals(\"Mark\"))?\"PASSED\":\"**FAILED**\"));\n\n System.out.println(\"\\nTesting addAfter...\");\n MyLinkedList<String> other = new MyLinkedList<String>();\n other.add(\"one\");\n other.add(\"two\");\n other.add(\"three\");\n other.add(\"four\");\n System.out.println(other.size() + \" \" + other);\n other.addAfter(2,\"three.5\");\n System.out.println((other.get(3).equals(\"three.5\")?\"PASSED\":\"**FAILED**\"));\n System.out.println(other.size() + \" \" + other);\n\n System.out.println(\"\\nTesting lastIndex...\");\n System.out.println((test.lastIndex(\"Salman\")==0)?\"PASSED\":\"**FAILED**\");\n test.addFirst(\"Mark\");\n System.out.println((test.lastIndex(\"Mark\")==3)?\"PASSED\":\"**FAILED**\");\n\n System.out.println(\"\\nTesting clone...\");\n MyLinkedList<String> empty = new MyLinkedList<String>();\n list1 = empty.clone();\n System.out.println(\" empty list test = \" + (list1.isEmpty()?\"PASSED\":\"**FAILED**\"));\n MyLinkedList<String> another = other.clone();\n System.out.println(another.size() + \" \" + another);\n System.out.println(\" making sure nodes not shared...\");\n other.remove(\"two\");\n System.out.println(other.size() + \" \" + other);\n System.out.println(another.size() + \" \" + another);\n\n System.out.println(\"\\nTesting removeAll...\");\n other.add(\"three\");\n System.out.println(other);\n other.removeAll(\"three\");\n System.out.println(other);\n //time for you to write some tests!\n\n System.out.println(\"\\nTesting equals...\");\n System.out.println(\" reflexive test = \" + (list2.equals(list2)?\"PASSED\":\"**FAILED**\"));\n MyLinkedList<String> emptyList = new MyLinkedList<String>();\n list0.clear();\n list1.clear();\n list1.add(\"node1\");\n System.out.println(\" empty list test/true = \" + (emptyList.equals(list0)?\"PASSED\":\"**FAILED**\"));\n System.out.println(\" empty list test1/false = \" + (!emptyList.equals(list1)?\"PASSED\":\"**FAILED**\"));\n System.out.println(\" empty list test2/false = \" + (!list1.equals(emptyList)?\"PASSED\":\"**FAILED**\"));\n list0.add(\"node1\");\n System.out.println(\" singleton test = \" + (list0.equals(list1)?\"PASSED\":\"**FAILED**\"));\n System.out.println(\" subset inclusion 1/false = \" + (!list1.equals(list2)?\"PASSED\":\"**FAILED**\"));\n System.out.println(\" subset inclusion 2/false = \" + (!list2.equals(list1)?\"PASSED\":\"**FAILED**\"));\n list0.add(\"node2\"); list0.add(\"node3\"); list0.add(\"node4\");\n list0.add(\"node5\"); list0.add(\"node6\"); list0.add(\"node7\");\n list4.add(\"node5\"); list4.add(\"node6\"); list4.add(\"node7\");\n System.out.println(\" 7-element test/true = \" + (list0.equals(list4)?\"PASSED\":\"**FAILED**\"));\n list0.remove(\"node4\");\n list0.add(\"node5\");\n System.out.println(\" 7-element test/false = \" + (!list0.equals(list4)?\"PASSED\":\"**FAILED**\"));\n System.out.println(\" 7-element test/false = \" + (!list4.equals(list0)?\"PASSED\":\"**FAILED**\"));\n\n\n System.out.println(\"\\nTesting split...\");\n MyLinkedList<String> toSplit = new MyLinkedList<String>();\n MyLinkedList<String> back = new MyLinkedList<String>();\n\n toSplit.add(\"node1\");\n toSplit.add(\"node2\");\n toSplit.add(\"node3\");\n toSplit.add(\"node4\");\n toSplit.add(\"node5\");\n\n\n System.out.println(\"Before splitting:\\n\" + toSplit);\n back = toSplit.split();\n System.out.println(\"Front\\n\" + toSplit);\n String backString = back.toString();\n System.out.println(\"Back:\\n\" + backString);\n\n\n System.out.println(\"\\nTesting doubler:\\n\");\n MyLinkedList<String> toDouble = new MyLinkedList<String>();\n toDouble.add(\"node1\");\n toDouble.add(\"node2\");\n toDouble.add(\"node3\");\n toDouble.add(\"node4\");\n System.out.println(\"Before doubling \" + toDouble);\n toDouble.doubler();\n System.out.println(\"After doubling \" + toDouble);\n\n\n System.out.println(\"\\nTesting sublist:\\n\");\n MyLinkedList<String> sub = new MyLinkedList<String>();\n sub.add(\"node1\");\n sub.add(\"node2\");\n sub.add(\"node3\");\n sub.add(\"node4\");\n MyLinkedList<String> subList = new MyLinkedList<String>();\n subList = toDouble.sublist(2, 4);\n System.out.println(\"After sublist \" + subList.toString());\n\n System.out.println(\"\\nTesting sublist\\n\");\n LinkedList<Integer> list = new LinkedList<>();\n list.add(1);\n list.add(2);\n list.add(3);\n list.add(4);\n list.add(5);\n list.add(6);\n\n System.out.println(list.subList(2, 5));\n\n MyLinkedList<String> result = new MyLinkedList<>();\n list0.clear();\n list1.clear();\n list1.add(\"node1\");\n list2.clear();\n list2.add(\"node1\");\n list2.add(\"node2\");\n list3.clear();\n list3.add(\"node1\"); list3.add(\"node2\"); list3.add(\"node3\");\n list4.clear();\n list4.add(\"node1\"); list4.add(\"node2\"); list4.add(\"node3\"); list4.add(\"node4\");\n MyLinkedList<String> list5 = new MyLinkedList<String>();\n list5.add(\"node1\"); list5.add(\"node2\"); list5.add(\"node3\"); list5.add(\"node4\");\n list5.add(\"node5\");\n MyLinkedList<String> list6 = new MyLinkedList<String>();\n list6.add(\"node1\"); list6.add(\"node2\"); list6.add(\"node3\"); list6.add(\"node4\");\n list6.add(\"node5\"); list6.add(\"node6\");\n System.out.print(\"SPLIT \");\n System.out.println(list0.size() + \" \" + list0);\n result = list0.split();\n System.out.println(\" list \" + list0.size() + \" \" + list0);\n System.out.println(\" result \" + result.size() + \" \" + result);\n System.out.print(\"SPLIT \");\n System.out.println(list1.size() + \" \" + list1);\n result = list1.split();\n System.out.println(\" list \" + list1.size() + \" \" + list1);\n System.out.println(\" result \" + result.size() + \" \" + result);\n System.out.print(\"SPLIT \");\n System.out.println(list2.size() + \" \" + list2);\n result = list2.split();\n System.out.println(\" list \" + list2.size() + \" \" + list2);\n System.out.println(\" result \" + result.size() + \" \" + result);\n System.out.print(\"SPLIT \");\n System.out.println(list3.size() + \" \" + list3);\n result = list3.split();\n System.out.println(\" list \" + list3.size() + \" \" + list3);\n System.out.println(\" result \" + result.size() + \" \" + result);\n System.out.print(\"SPLIT \");\n System.out.println(list4.size() + \" \" + list4);\n result = list4.split();\n System.out.println(\" list \" + list4.size() + \" \" + list4);\n System.out.println(\" result \" + result.size() + \" \" + result);\n System.out.print(\"SPLIT \");\n System.out.println(list5.size() + \" \" + list5);\n result = list5.split();\n System.out.println(\" list \" + list5.size() + \" \" + list5);\n System.out.println(\" result \" + result.size() + \" \" + result);\n System.out.print(\"SPLIT \");\n System.out.println(list6.size() + \" \" + list6);\n result = list6.split();\n System.out.println(\" list \" + list6.size() + \" \" + list6);\n System.out.println(\" result \" + result.size() + \" \" + result);\n */\n\n }", "@Test(dataProvider = \"validFPData\")\r\n\tpublic void testFirstPage(List<String> valid) {\r\n\t\tList<String> result = pages.firstPage();\r\n\t\tAssert.assertTrue(result.equals(valid));\r\n\t}", "@Test\r\n\tpublic void first() throws DendrytDAOException {\n//\t\tProblemSubmitingService p = new ProblemSubmitingServlet();\r\n//\t\tassertEquals(5, p.getAllProducts().length);\r\n//\t\t\r\n//\t\tIProblemDAO i = new ProblemDAO();\r\n//\t\tassertEquals(0, i.readAll().length);\r\n//\t\t\r\n//\t\tp.submitProblem(new Problem());\r\n//\t\tassertEquals(1 , i.readAll().length);\r\n//\r\n\t}", "@Test (timeout = 44245500)\n\tpublic void testInsertFirstIsEmptySizeAndGetFirst1() {\n\t\tassertTrue(list.isEmpty());\n\t\tassertEquals(0,list.size());\n\t\tassertEquals(list,list.insertAt(0, \"Hello\"));\n\t\tassertFalse(list.isEmpty());\n\t\tassertEquals(1,list.size());\n\t\tassertEquals(\"Hello\",list.get(0));\n\t\tlist.insertAt(1, \"world\");\n\t\tassertEquals(\"world\",list.get(1));\n\t\tassertEquals(2, list.size());\n\t\tlist.insertAt(0, \"foo\");\n\t\tassertEquals(3,list.size());\n\t\tassertEquals(\"foo\", list.get(0));\n\t\tassertEquals(\"Hello\", list.get(1));\n\t\t\n\t\t\n\t}", "Node getFirst() {\n return this.first;\n }", "@Override\r\n\t\tpublic T getFirst() {\n\t\t\tsynchronized (mutex) {\r\n\t\t\t\treturn pair.getFirst();\r\n\t\t\t}\r\n\t\t}", "public T getFirst() {\n\t\t//if the head is not empty\n\t\tif (head!= null) {\n\t\t\t//return the data in the head node of the list\n\t\t\treturn head.getData();\n\t\t}\n\t\t//otherwise return null\n\t\telse { return null; }\n\t}", "public void testHasNext() {\r\n System.out.println(\"hasNext\");\r\n // tested in testNext()\r\n }", "public abstract PaginatedResult<T> first() throws AblyException;", "@Test\r\n public void sequentialHasNextInvocationDoesntAffectRetrievalOrder() {\r\n assertThat(it.hasNext(), is(true));\r\n assertThat(it.hasNext(), is(true));\r\n assertThat(it.next(), is(2));\r\n assertThat(it.next(), is(4));\r\n assertThat(it.next(), is(6));\r\n }", "public void testNext() {\n for (int i = 0; i < 10; i++) {\n test1.append(new Buffer(i, rec));\n }\n assertTrue(test1.getValue().inRange(0));\n test1.next();\n assertTrue(test1.getValue().inRange(1));\n test1.next();\n assertTrue(test1.getValue().inRange(2));\n for (int i = 0; i < 10; i++) {\n test1.next();\n }\n assertEquals(10, test1.currPos());\n }", "public node getFirst() {\n\t\treturn head;\n\t\t//OR\n\t\t//getAt(0);\n\t}", "public Item sample()\n {\n checkNotEmpty();\n\n return items[nextIndex()];\n }", "@Override\r\n\tpublic Object first(){\r\n\t\tcheck();\r\n\t\treturn head.value;\r\n\t}", "public Object getFirst(){\n return pattern[0];\n }", "@Test\r\n public void testGet() {\r\n System.out.println(\"get\");\r\n int index = 1;\r\n Number n3 = nc1.get(index);\r\n assertEquals(n1.getNumber(), n3.getNumber());\r\n \r\n }", "@Override\r\n\t\tpublic E getFirst() {\n\t\t\treturn pair.getFirst();\r\n\t\t}", "@Override\r\n\t\tpublic E getFirst() {\n\t\t\treturn pair.getFirst();\r\n\t\t}", "@Test\n public void testIterator(){\n while(ROW_ITR.hasNext()){\n ROW_ITR.next();\n }\n }", "@Test\n public void terminalOperations() {\n // count\n assertEquals(4, TestData.getBooks().stream().count());\n // findFirst\n Optional<Book> gangOfFour = TestData.getBooks().stream()\n .filter(book -> book.name.equals(\"Design Patterns: Elements of Reusable Object-Oriented Software\"))\n .findFirst();\n assertTrue(gangOfFour.isPresent());\n assertEquals(4, gangOfFour.get().authors.size());\n }", "public void testGetRowKey() {\n TaskSeriesCollection c = createCollection1();\n }", "@Test\n public void testGetNext()\n {\n System.out.println(\"getNext\");\n final File file = new File(\"src/test/data/test.example.txt\");\n final Lexer lexer = new Lexer();\n final Token token = lexer.analyze(file);\n assertEquals(Syntax.LABEL, token.getSyntax());\n assertTrue(token.getNext() != null);\n final Token next = token.getNext();\n assertEquals(\"{\", next.getValue());\n assertEquals(Syntax.OPEN, next.getSyntax());\n assertEquals(2, next.getLine());\n assertEquals(1, next.getPosition());\n }", "public double getFirst()\n {\n return first;\n }", "@Test\n\tpublic void testOnce() {\n\t\tString actual = new SpecialsBean().getNextCouponCode();\n\t\tassertNotNull(actual);\n\t\tassertTrue(actual.startsWith(\"Special\"));\n\t}", "public int first() throws Exception{\n if(isEmpty())\n throw new Exception();\n return front.getData();\n }", "public void setFirstResult(int begin) {\n\r\n\t}", "public float getFirstNumber(){\n return firstNumber;\n }", "@Test\r\n public void testSmallest() {\r\n int[] numbers = {16, 3, 9, 85};\r\n int expResult = numbers[1];\r\n int result = Main.smallest(numbers);\r\n \r\n assertEquals(expResult, result);\r\n }", "public Object getFirst()\n {\n return ((Node)nodes.elementAt(0)).data;\n }", "public int getFirstElement() {\n\t\tif( head == null) {\n\t\t\tSystem.out.println(\"List is empty\");\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\t}\n\t\telse {\n\t\t\treturn head.data;\n\t\t}\n\t}", "@Test\npublic void testGetSomeStudentBySnoAndSname() {\n//TODO: Test goes here...\n for (Student s : StudentDao.getSomeStudentBySnoAndSname(1001, \"1\"))\n System.out.println(s.getSno());\n}", "public Node<T> getFirst() {\r\n\t\treturn first;\r\n\t}", "@Test\n public void testNext_Start() {\n OasisList<Integer> baseList = new SegmentedOasisList<>();\n baseList.addAll(Arrays.asList(1, 2, 3, 4, 5));\n\n ListIterator<Integer> instance = baseList.listIterator();\n Integer expResult = 1;\n Integer result = instance.next();\n assertEquals(expResult, result);\n }", "Object firstData() {\n\t\t// por defecto enviamos null\n\t\treturn null;\n\t}", "public TestHead getTestHeadByHeadId(@NotNull final String headId) {\n Session session = SessionFactoryHelper.getOpenedSession();\n session.beginTransaction();\n String hql = \"from TestHead as T where T.headId = :expectedName\";\n Query<TestHead> query = session.createQuery(hql, TestHead.class);\n query.setParameter(\"expectedName\", headId);\n List<TestHead> result = query.list();\n session.getTransaction().commit();\n session.close();\n return (TestHead) returnWithFirstItem(result);\n }", "public Node getFirst()\n {\n return this.first;\n }", "@Test\r\n public void iteratorWorksInFirst() throws Exception {\r\n Iterator<Integer> it = sInt.iterator();\r\n assertTrue(it.hasNext());\r\n assertEquals(1, (int) it.next());\r\n Iterator<String> it2 = sStr.iterator();\r\n assertTrue(it2.hasNext());\r\n assertEquals(\"kek\", it2.next());\r\n }", "@Test\r\n public void getSalaTest() \r\n {\r\n SalaEntity entity = data.get(0);\r\n SalaEntity resultEntity = salaLogic.getSala(data.get(0).getId());\r\n Assert.assertNotNull(resultEntity);\r\n Assert.assertEquals(entity.getId(), resultEntity.getId());\r\n Assert.assertEquals(resultEntity.getNumero(), entity.getNumero());\r\n }", "@Test\n public void testGetFirstNoValue() {\n final ConfigSearchResult<?> result = new ConfigSearchResult<>();\n assertNull(result.getFirstValue());\n }", "@Test\r\n\tpublic void testGetLast() {\n\t}", "public LinkedListIterator<AnyType> first() {\n return new LinkedListIterator<AnyType>(header.next);\n }", "public Unit first()\n\t{\n\t\tif (size() == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\treturn iterator().next();\n\t}", "public Object getFirst() {\n if (first == null)\n return null;\n return first.getInfo();\n }", "private void testGet() {\n init();\n assertTrue(\"FListInteger.get(l1, 0)\", FListInteger.get(l1, 0) == 5);\n assertTrue(\"FListInteger.get(l2, 0)\", FListInteger.get(l2, 0) == 4);\n assertTrue(\"FListInteger.get(l3, 0)\", FListInteger.get(l3, 0) == 7);\n }", "@Test\n\tpublic void testNext() {\n\t\tIntArrayIterator instance = createIterator();\n\t\tboolean[] expResults = new boolean[] { true, true, true, true, true, true, false };\n\t\tboolean result = false;\n\t\tboolean exceptionResult = false;\n\t\t\n\t\t// iterate over the underlying array, testing proper\n\t\t// results for each iteration against the iterator\n\t\tfor(int i = 0; i <= testData.length; ++i) {\n\t\t\tresult = instance.hasNext();\n\t\t\tassertEquals(expResults[i], result);\n\n\t\t\ttry {\n\t\t\t\tint value = instance.next();\n\t\t\t\tassertEquals(testData[i], value);\n\t\t\t}\n\t\t\tcatch (NoSuchElementException e) {\n\t\t\t\t// on last iteration, next() should throw\n\t\t\t\tassertEquals(testData.length, i);\n\t\t\t\texceptionResult = true;\n\t\t\t}\n\t\t}\n\t\tassertEquals(true, exceptionResult);\n\t}" ]
[ "0.7423596", "0.71160495", "0.6777389", "0.6633933", "0.65096134", "0.64711416", "0.64711416", "0.6469377", "0.64328456", "0.63558143", "0.62582695", "0.62101585", "0.61702853", "0.6145823", "0.6109989", "0.610733", "0.6087615", "0.6057123", "0.6050599", "0.60347074", "0.6022548", "0.599747", "0.599507", "0.596905", "0.59394556", "0.59334", "0.5933312", "0.5917661", "0.59049827", "0.5881245", "0.58650917", "0.5849043", "0.58350116", "0.58205956", "0.581317", "0.58025914", "0.57993424", "0.57923913", "0.57769716", "0.57595557", "0.5754051", "0.5751474", "0.5743597", "0.57428294", "0.5728351", "0.5705852", "0.5695197", "0.5695082", "0.56913704", "0.56912625", "0.5683402", "0.5682773", "0.5667707", "0.5661497", "0.56439", "0.56418127", "0.56405956", "0.56229967", "0.55967325", "0.55956626", "0.5589546", "0.5583973", "0.55742157", "0.5549498", "0.5545839", "0.5529677", "0.552875", "0.55278426", "0.5520549", "0.5511712", "0.55080825", "0.54889166", "0.54889166", "0.54795015", "0.54679835", "0.54662925", "0.5465782", "0.5463454", "0.5462094", "0.5458603", "0.545427", "0.5442249", "0.5437519", "0.5433808", "0.5430643", "0.54269457", "0.54232305", "0.54230636", "0.5421791", "0.5419189", "0.54188186", "0.5415813", "0.5414654", "0.54100776", "0.53988713", "0.5392371", "0.5389428", "0.5386886", "0.5382645", "0.5376299" ]
0.7656511
0
Iterates through all the obs in the test obs group and returns the first one that who concept matches the specified concept Returns null if obs not found
public static Obs getObsFromObsGroup(Concept concept, Obs group) { if (group.getGroupMembers() != null) { for(Obs obs : group.getGroupMembers()) { // need to check for voided obs here because getGroupMembers returns voided obs if (!obs.isVoided() && obs.getConcept().equals(concept)) { return obs; } } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Obs getObsFromEncounter(Concept concept, Encounter encounter) {\r\n \t\tif (encounter.getObsAtTopLevel(false) != null) {\r\n \t\t\tfor (Obs obs : encounter.getObsAtTopLevel(false)) {\r\n \t\t\t\tif (!obs.isVoided() && obs.getConcept().equals(concept)) {\r\n \t\t\t\t\treturn obs;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn null;\r\n \t}", "public static CalculationResultMap firstObs(Concept concept, Collection<Integer> cohort, PatientCalculationContext context) {\n ObsForPersonDataDefinition def = new ObsForPersonDataDefinition(\"first obs\", TimeQualifier.FIRST, concept, context.getNow(), null);\n return MentalHealthConfigCalculationUtils.evaluateWithReporting(def, cohort, null, null, context);\n }", "Concept getConcept(String id);", "public Individual getFittest(){\n Individual fittest = individuals.get(0);\n for (Individual individual: individuals){\n if(fittest.equals(individual)){\n continue;\n }\n else if(fittest.getFitness() < individual.getFitness()){\n fittest = individual;\n }\n }\n return fittest;\n }", "public final Concept getConcept(final String name) {\r\n Concept[] d;\r\n Concept s;\r\n\r\n d = this.m_data;\r\n\r\n for (s = d[name.hashCode() & (d.length - 1)]; s != null; s = s.m_next) {\r\n if (s.m_name.equals(name))\r\n return s;\r\n }\r\n\r\n return null;\r\n }", "private ReportConcept getRelatedConcept(ReportConcept entry) {\n\t\t// if completly removed, no point in searching\n\t\tif(entry.getLabels().isEmpty())\n\t\t\treturn null;\n\t\t\n\t\tfor (ReportConcept c : concepts) {\n\t\t\t// labels in the new concept are contained within the old concept label list\n\t\t\tif(Collections.indexOfSubList(entry.getLabels(),c.getLabels()) > -1 || Collections.indexOfSubList(c.getLabels(),entry.getLabels()) > -1){\n\t\t\t\t//if(entry.getName().contains(c.getName()) || c.getName().contains(entry.getName())){\n\t\t\t\treturn c;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "String getConcept();", "public static void getRoomConcept(String concept)\n\t{\n\t\t\n\t}", "public String getConcept() {\n\t\treturn concept;\n\t}", "public static CalculationResultMap firstObsOnOrAfter(Concept concept, Date onOrAfter, Collection<Integer> cohort, PatientCalculationContext context) {\n ObsForPersonDataDefinition def = new ObsForPersonDataDefinition(\"first obs on or after\", TimeQualifier.FIRST, concept, context.getNow(), onOrAfter);\n return MentalHealthConfigCalculationUtils.evaluateWithReporting(def, cohort, null, null, context);\n }", "default Concept getConcept(ConceptName conceptName) {return (Concept) conceptName;}", "public Concept getConcept() {\n\t\treturn concept;\n\t}", "public Concept getConcept() {\n\t\treturn concept;\n\t}", "Concept getConceptName();", "public static CalculationResultMap lastObs(Concept concept, Collection<Integer> cohort, PatientCalculationContext context) {\n ObsForPersonDataDefinition def = new ObsForPersonDataDefinition(\"last obs\", TimeQualifier.LAST, concept, context.getNow(), null);\n return MentalHealthConfigCalculationUtils.evaluateWithReporting(def, cohort, null, null, context);\n }", "public Object getAdditionalTagValue(String tagId, Concept concept) {\n\n Collection additionalTags = this.assignedTag.getAdditionalTags();\n\n for (Iterator i = additionalTags.iterator(); i.hasNext();) {\n\n AssignedTag additionalTag = (AssignedTag) i.next();\n Tag tag = additionalTag.getTag();\n Concept[] concepts = (additionalTag.getTarget()).getConcepts();\n\n if (tag.getId() == tagId && Arrays.binarySearch(concepts, concept) >= 0) {\n\n return additionalTag.getValue();\n }\n }\n\n return null;\n }", "protected Atom findAtom(String curAsymId, int curSeqId, String curAtomName, String curCompId, String curInsertionCode, String curAltId) {\n \t\tfor (Atom a: atomVector) {\n \t\t\tif (a.partialEquals(curAsymId, curSeqId, curAtomName, curCompId, curInsertionCode, curAltId)) {\n \t\t\t\treturn a;\n \t\t\t}\n \t\t}\n \t\treturn null;\n \t}", "public static ISPObsComponent findAOSystem(ISPObservation obs) {\n if (obs != null) {\n Iterator iter = obs.getObsComponents().iterator();\n while (iter.hasNext()) {\n ISPObsComponent obsComp = (ISPObsComponent) iter.next();\n if (isAOInstrument(obsComp)) {\n return obsComp;\n }\n }\n }\n return null;\n }", "public T caseObservation(Observation object) {\n\t\treturn null;\n\t}", "public Individual getIndividual(int id){\n for(Individual individual : individuals){\n if(individual.getId() == id){\n return individual;\n }\n }\n return null;\n }", "public static Toy getThatToy(String nm) {\n\t\tfor (int i = 0; i < toyList.size(); i++) {\n\t\t\tif (toyList.get(i).getName().equals(nm)) {\n\t\t\t\treturn toyList.get(i);\n\t\t\t}\n\t\t\telse {\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private List<ConceptSource> getConceptMapping(List<Obs> patientObsList){\n\t\tList<ConceptSource> conceptSourceList = new ArrayList<ConceptSource>();\n\t\tfor(Obs o : patientObsList){\n\t\t\tConcept c = o.getConcept();\n\t\t\tCollection<ConceptMap> conceptMap = c.getConceptMappings();\n\t\t\tIterator it;\n\t\t\tit = conceptMap.iterator();\n\t\t\twhile(it.hasNext()){\n\t\t\t\tConceptMap cm = (ConceptMap) it.next();\n\t\t\t\tInteger mapId = cm.getConceptMapId();\n\t\t\t\tConceptSource cs = cm.getSource();\n\t\t\t\tconceptSourceList.add(cs);\n\t\t\t}\n\t\t}\n\t\treturn conceptSourceList;\n\n\t}", "java.lang.String getConceptId();", "public Individual getSecondFittest() {\n int maxFit1 = 0;\n int maxFit2 = 0;\n for (int i = 0; i < m_individual.length; i++) {\n if (m_individual[i].fitness > m_individual[maxFit1].fitness) {\n maxFit2 = maxFit1;\n maxFit1 = i;\n } else if (m_individual[i].fitness > m_individual[maxFit2].fitness) {\n maxFit2 = i;\n }\n }\n return m_individual[maxFit2];\n }", "List<Concept2OntClassMapping> lookupConcept2OntClassMappingPairs(Concept concept);", "com.google.ads.googleads.v13.common.ConceptGroup getConceptGroup();", "private ReportConcept getReportConcept(Concept c) {\n\t\tfor (ReportConcept e : concepts) {\n\t\t\tif (c.getCode().endsWith(e.getName())) {\n\t\t\t\treturn e;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public Element fittest() {\r\n Map.Entry<Fitness, List<Element>> bestEntry\r\n = elementsByFitness.lastEntry();\r\n if (bestEntry == null) {\r\n return null;\r\n }\r\n List<Element> bestElements = bestEntry.getValue();\r\n assert !bestElements.isEmpty();\r\n Element result = bestElements.get(0);\r\n\r\n return result;\r\n }", "public static CalculationResultMap allObs(Concept concept, Collection<Integer> cohort, PatientCalculationContext context) {\n ObsForPersonDataDefinition def = new ObsForPersonDataDefinition(\"all obs\", TimeQualifier.ANY, concept, context.getNow(), null);\n return MentalHealthConfigCalculationUtils.ensureEmptyListResults(MentalHealthConfigCalculationUtils.evaluateWithReporting(def, cohort, null, null, context), cohort);\n }", "public org.hl7.fhir.ResourceReference getObservation()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.ResourceReference target = null;\n target = (org.hl7.fhir.ResourceReference)get_store().find_element_user(OBSERVATION$0, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }", "public VocabularyConcept getEditableConcept() {\r\n for (VocabularyConcept vc : vocabularyConcepts.getList()) {\r\n if (vc != null) {\r\n return vc;\r\n }\r\n }\r\n return null;\r\n }", "private ReportConcept mergeConcepts(ReportConcept previous, ReportConcept entry, Collection<ReportConcept> concepts){\n\t\tIClass pc = previous.getConceptClass();\n\t\tIClass ec = entry.getConceptClass();\n\t\tIClass common = getDirectCommonChild(pc,ec);\n\t\t\n\t\t// make sure that common ground is valid\n\t\tif(common != null){\n\t\t\t// we can't have two attributes s.a. 3 mm inferring a finding\n\t\t\tif(isFeature(common) && !isFeature(pc) && !isFeature(ec))\n\t\t\t\tcommon = null;\n\t\t\t// check if we are doing the same to diagnosis\n\t\t\tif(isDisease(common) && !isDisease(pc) && !isDisease(ec))\n\t\t\t\tcommon = null;\n\t\t\t\n\t\t\t// if previous concept is in fact more specific then current concept\n\t\t\t//TODO: this breaks depth of invasion 1.3mm\n\t\t\tif(pc.hasSuperClass(ec)){\n\t\t\t\t/*\n\t\t\t\tint stp = previous.getOffset();\n\t\t\t\tint enp = stp+previous.getLength();\n\t\t\t\tint stc = entry.getOffset();\n\t\t\t\tint enc = stc+entry.getLength();\n\t\t\t\t// we only accept common if more specific encompas the more general\n\t\t\t\tif(!(stp <= stc && enc <= enp)){\n\t\t\t\t\tcommon = null;\n\t\t\t\t}*/\n\t\t\t\tif(isSubset(previous.getLabels(),entry.getLabels())){\n\t\t\t\t\tcommon = null;\n\t\t\t\t}\n\t\t\t}else if(pc.hasSubClass(ec)){\n\t\t\t\t/*int stp = pc.getConcept().getOffset();\n\t\t\t\tint enp = stp+pc.getConcept().getText().length();\n\t\t\t\tint stc = ec.getConcept().getOffset();\n\t\t\t\tint enc = stc+ec.getConcept().getText().length();\n\t\t\t\t// we only accept common if more specific encompas the more general\n\t\t\t\tif(!(stc <= stp && enp <= enc)){\n\t\t\t\t\tcommon = null;\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t// common ground was found\n\t\tif(common != null){\n\t\t\tReportConcept ne = createReportConcept(common);\n\t\t\tne.addLabels(previous.getLabels());\n\t\t\tne.addLabels(entry.getLabels());\n\t\t\t//ne.addComponent(previous);\n\t\t\t//ne.addComponent(entry);\n\t\t\t\n\t\t\t\n\t\t\t// if new concept is just an old concept\n\t\t\t// then retain the old concept\n\t\t\tif(entry.equals(ne))\n\t\t\t\tne.setConceptEntry(entry.getConceptEntry());\n\t\t\tif(previous.equals(ne))\n\t\t\t\tne.setConceptEntry(previous.getConceptEntry());\n\t\t\t\n\t\t\t\n\t\t\t//CORRECTION: previous should take precedence, MAX was arbitrary\n\t\t\tif(previous.getConceptEntry().hasNumericValue())\n\t\t\t\tne.setNumericValue(previous.getNumericValue());\n\t\t\telse if(entry.getConceptEntry().hasNumericValue())\n\t\t\t\tne.setNumericValue(entry.getNumericValue());\n\t\t\t\n\t\t\t// copy resource link\n\t\t\tif(previous.hasResourceLink())\n\t\t\t\tne.setResourceLink(previous.getResourceLink());\n\t\t\telse if(entry.hasResourceLink())\n\t\t\t\tne.setResourceLink(entry.getResourceLink());\n\t\t\t\n\t\t\t// copy negation\n\t\t\tif(previous.isNegated())\n\t\t\t\tne.setNegation(previous.getNegation());\n\t\t\telse if(entry.isNegated())\n\t\t\t\tne.setNegation(entry.getNegation());\n\t\t\t\t\n\t\t\t// update list\n\t\t\tconcepts.remove(entry);\n\t\t\tconcepts.remove(previous);\n\t\t\tconcepts.add(ne);\n\t\t\n\t\t\treturn ne;\n\t\t}\n\t\treturn null;\n\t}", "public SuspectCard findSuspectCard(String search) {\n for (SuspectCard card : this.getSuspectCards()) {\n if (card.getName().toLowerCase().equals(search.toLowerCase())) {\n return card;\n }\n }\n return null;\n }", "GuiObservation getObservation(UUID observationUuid);", "public O first()\r\n {\r\n if (isEmpty()) return null; \r\n return first.getObject();\r\n }", "private OntologyConcept getOntologyConcept(JCas jcas, LookupHit hit)\n {\n String codingScheme = this.properties.getProperty(CODING_SCHEME_PRP_KEY);\n String idname = this.properties.getProperty(ID_PRP_KEY);\n String labelName = this.properties.getProperty(LABEL_PRP_KEY);\n MetaDataHit mdh = hit.getDictMetaDataHit();\n String id = mdh.getMetaFieldValue(idname);\n OntologyConcept concept = new OntologyConcept(jcas);\n concept.setCode(id);\n /* I'm not sure what the oui is supposed to be, but it's not being used elsewhere in the pipeline */\n concept.setOui(mdh.getMetaFieldValue(labelName));\n concept.setCodingScheme(codingScheme);\n return concept;\n }", "@XmlElement\n private String getConceptPreferredName() {\n return concept != null ? concept.getDefaultPreferredName() : \"\";\n }", "private Test searchTest(final String testFullName) {\n Test test = null;\n for (TestPackage pkg : mSessionLog.getTestPackages()) {\n test = pkg.searchTest(testFullName);\n if (test != null) {\n break;\n }\n }\n \n return test;\n }", "@Override\n\tpublic <S extends Translator> Optional<S> findOne(Example<S> example) {\n\t\treturn null;\n\t}", "TCpySpouse selectOneByExample(TCpySpouseExample example);", "public ResponseEntity<BeaconConceptWithDetails> getConceptDetails(String conceptId) {\n\t\ttry {\n\t\t\tconceptId = fix(conceptId);\n\t\n\t\t\tList<Graph> graphs = searchByIds(search::nodesBy, Util.list(conceptId), NdexClient.QUERY_FOR_NODE_MATCH);\t\t\n\t\t\tCollection<Node> nodes = Util.flatmap(Graph::getNodes, graphs);\n\t\t\tcombineDuplicates(nodes);\n\t\t\t\n\t\t\tList<BeaconConceptWithDetails> conceptDetails= Util.map(translator::nodeToConceptDetails, nodes);\n\t\t\t\n\t\t\tfinal String id = conceptId;\n\t\t\tconceptDetails.removeIf(d -> !d.getId().equalsIgnoreCase(id));\n\t\t\t\n\t\t\tassert(conceptDetails.size() == 1);\n\n\t\t\treturn ResponseEntity.ok(conceptDetails.get(0));\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tlog(e);\n\t\t\treturn ResponseEntity.ok(new BeaconConceptWithDetails());\n\t\t}\n\t}", "private List<ConceptMinimal> getConceptMinimalList(String id, Terminology terminology)\n throws JsonMappingException, JsonProcessingException {\n Optional<ElasticObject> esObject = getElasticObject(id, terminology);\n if (!esObject.isPresent()) {\n return Collections.<ConceptMinimal> emptyList();\n }\n\n return esObject.get().getConceptMinimals();\n }", "public Concept getConcept(Term term) {\r\n String n = term.getName();\r\n Concept concept = concepts.get(n);\r\n if (concept == null)\r\n concept = new Concept(term, this); // the only place to make a new Concept\r\n return concept;\r\n }", "public List<OWLObject> search(OWLObject queryObj) {\n\t\tList<OWLObject> hits = new ArrayList<OWLObject>(maxHits);\n\t\tSystem.out.println(\"gettings atts for \"+queryObj+\" -- \"+simEngine.comparisonProperty);\n\t\tSet<OWLObject> atts = simEngine.getAttributeClosureFor(queryObj);\n\t\tSystem.out.println(\"all atts: \"+atts.size());\n\t\tif (atts.size() == 0)\n\t\t\treturn hits;\n\t\t\n\t\t// only compare using significant atts;\n\t\t// we don't do the same test on candidates as these will be removed by the\n\t\t// intersection operation. they will have a small effect on the score, as\n\t\t// we don't divide by the union, but instead the sum of sizes\n\t\tatts = filterNonSignificantAttributes(atts);\n\t\tSystem.out.println(\"filtered atts: \"+atts.size());\n\n\t\t//bloomFilter = new BloomFilter<OWLObject>(0.05, atts.size());\n\t\t//bloomFilter.addAll(atts);\n\t\t\t\t\n\t\tSortedMap<Integer,Set<OWLObject>> scoreCandidateMap = new TreeMap<Integer,Set<OWLObject>>();\n\t\t\n\t\tfor (OWLObject candidate : getCandidates()) {\n\t\t\tif (candidate.equals(queryObj))\n\t\t\t\tcontinue;\n\t\t\tSet<OWLObject> iAtts = simEngine.getAttributeClosureFor(candidate);\n\t\t\t//Set<OWLObject> iAtts = simEngine.getGraph().getAncestors(candidate);\n\n\t\t\tif (iAtts.size() == 0)\n\t\t\t\tcontinue;\n\t\t\tint cAttsSize = iAtts.size();\n\t\n\t\t\tiAtts.retainAll(atts);\n\t\t\t//Collection<OWLObject> iAtts = bloomFilter.intersection(cAtts);\n\t\t\t\n\t\t\t// simJ, one-sided, scaled by 1000\n\t\t\t// negate to ensure largest first\n\t\t\t//Integer score = - (iAtts.size() * 1000 / cAttsSize);\n\t\t\t\n\t\t\t// this biases us towards genes with large numbers of annotations,\n\t\t\t// but it is better at finding the models that share all features\n\t\t\tInteger score = - iAtts.size();\n\t\t\tif (!scoreCandidateMap.containsKey(score)) \n\t\t\t\tscoreCandidateMap.put(score, new HashSet<OWLObject>());\n\t\t\tscoreCandidateMap.get(score).add(candidate);\n\t\t\treporter.report(this,\"query_candidate_overlap_total\",queryObj,candidate,iAtts.size(),cAttsSize);\n\t\t}\n\t\t\n\t\tint n = 0;\n\t\tfor (Set<OWLObject> cs : scoreCandidateMap.values()) {\n\t\t\tn += cs.size();\n\t\t\thits.addAll(cs);\n\t\t}\n\t\t\n\t\tn = 0;\n\t\tfor (OWLObject hit : hits) {\n\t\t\tn++;\n\t\t\treporter.report(this,\"query_hit_rank_threshold\",queryObj,hit,n,maxHits);\n\t\t}\n\t\tif (hits.size() > maxHits)\n\t\t\thits = hits.subList(0, maxHits);\n\t\t\n\n\n\t\treturn hits;\n\t}", "public void setConcept(Concept concept) {\n\t\tthis.concept = concept;\n\t}", "public Optional<Term> getMatchingTerm(Term nextTerm) {\n\t\treturn Optional.ofNullable(terms.get(nextTerm.tag));\n\t}", "public Set<Individual> getFiller(Role role, Concept concept, Individual ind) {\n\t\tTList<T> current = this.getRoot();\n\t\tSet<Individual> candidateRoles = new HashSet<>();\n\t\tSet<Individual> candidateInds = new HashSet<>();\n\t\twhile (current != null) {\n\t\t\tAssertion aValue = current.getValue();\n\t\t\tif (aValue instanceof RoleAssertion) {\n\t\t\t\tRoleAssertion ra = (RoleAssertion) aValue;\n\t\t\t\tDLElement el = ra.getElement();\n\t\t\t\tif (role.equals(el) && ind.equals(ra.getIndividualA()))\n\t\t\t\t\tcandidateRoles.add(ra.getIndividualB());\n\t\t\t} else if (aValue instanceof ConceptAssertion) {\n\t\t\t\tif (concept.equals(aValue.getElement()))\n\t\t\t\t\tcandidateInds.add(aValue.getIndividualA());\n\t\t\t}\n\t\t\tcurrent = current.getNext();\n\t\t}\n\t\t//find individuals\n\t\tcandidateInds.retainAll(candidateRoles);\n\t\treturn candidateInds;\n\t}", "public static MElement createConcept(String concept) {\n System.out.println(\"Attempting to create Concept from string \" + concept);\n AbstractMFeature2 sf = AbstractMFeature2.getSemanticFeature(concept);\n return getInstance(sf, MFeatureType.CONCEPT);\n }", "private Student getStudentByID(String sid) {\n\t\tfor(Student student: students) {\r\n\t\t\t//no need to check for null as Array list is dynamic and \r\n\t\t\tif(student.getStudentId().equals(sid)) {\r\n\t\t\t\treturn student;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//return null if sid was not found\r\n\t\treturn null;\r\n\t}", "private static Integer findTermTypeConcept(int conceptModuleSequence)\n\t{\n\t\tOfInt parents = Get.taxonomyService().getTaxonomyParentSequences(conceptModuleSequence).iterator();\n\t\twhile (parents.hasNext())\n\t\t{\n\t\t\tint current = parents.next();\n\t\t\tif (current == MetaData.MODULE.getConceptSequence())\n\t\t\t{\n\t\t\t\treturn conceptModuleSequence;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn findTermTypeConcept(current);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private Pair getFirstOccurrence(Object o) {\n\t\tNode p;\n\t\tint k;\n\n\t\tif (o != null) {\n\t\t\tfor (k = 0, p = mHead.next; k < mSize; p = p.next, k++)\n\t\t\t\tif (o.equals(p.data))\n\t\t\t\t\treturn new Pair(p, k);\n\t\t} else {\n\t\t\tfor (k = 0, p = mHead.next; k < mSize; p = p.next, k++)\n\t\t\t\tif (p.data == null)\n\t\t\t\t\treturn new Pair(p, k);\n\t\t}\n\t\treturn new Pair(null, NOT_FOUND);\n\t}", "public Individual getBest() {\n\t\treturn individuals[0];\n\t}", "private static Theory bestTheory(Collection<Point> data, Collection<Theory> theories, GoodnessOfFitCalculator gofCalculator) {\r\n boolean first = true;\r\n double bestGoodnessOfFit = 0.0;\r\n Theory bestTheory = null;\r\n for (Theory theory : theories) {\r\n double gof = gofCalculator.goodnessOfFit(data, theory);\r\n if (first) {\r\n bestTheory = theory;\r\n bestGoodnessOfFit = gof;\r\n first = false; \r\n } else if (gof < bestGoodnessOfFit) {\r\n bestTheory = theory;\r\n bestGoodnessOfFit = gof;\r\n }\r\n }\r\n return bestTheory;\r\n }", "public static IDescribable getFirst( Collection<? extends IDescribable> results )\r\n\t{\r\n\t if(( results == null ) || ( results.size() == 0 ))\r\n\t return null;\r\n\t return results.iterator().next();\r\n\t}", "public MediaVO sample(int idx) {\n\t\tif (idx >= samples.size()) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\treturn samples.get(idx);\n\t}", "public void test_sf_945436() {\n String SOURCE=\n \"<?xml version='1.0'?>\" +\n \"<!DOCTYPE owl [\" +\n \" <!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' >\" +\n \" <!ENTITY rdfs 'http://www.w3.org/2000/01/rdf-schema#' >\" +\n \" <!ENTITY xsd 'http://www.w3.org/2001/XMLSchema#' >\" +\n \" <!ENTITY owl 'http://www.w3.org/2002/07/owl#' >\" +\n \" <!ENTITY dc 'http://purl.org/dc/elements/1.1/' >\" +\n \" <!ENTITY base 'http://jena.hpl.hp.com/test' >\" +\n \" ]>\" +\n \"<rdf:RDF xmlns:owl ='&owl;' xmlns:rdf='&rdf;' xmlns:rdfs='&rdfs;' xmlns:dc='&dc;' xmlns='&base;#' xml:base='&base;'>\" +\n \" <C rdf:ID='x'>\" +\n \" <rdfs:label xml:lang=''>a_label</rdfs:label>\" +\n \" </C>\" +\n \" <owl:Class rdf:ID='C'>\" +\n \" </owl:Class>\" +\n \"</rdf:RDF>\";\n OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );\n m.read( new StringReader( SOURCE ), null );\n Individual x = m.getIndividual( \"http://jena.hpl.hp.com/test#x\" );\n assertEquals( \"Label on resource x\", \"a_label\", x.getLabel( null) );\n assertEquals( \"Label on resource x\", \"a_label\", x.getLabel( \"\" ) );\n assertSame( \"fr label on resource x\", null, x.getLabel( \"fr\" ) );\n }", "public Unit first()\n\t{\n\t\tif (size() == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\treturn iterator().next();\n\t}", "@Override\n public CourseIdea findBySlug(String slug) {\n return ideas.stream()\n .filter(idea -> idea.getSlug().equals(slug))\n .findFirst()\n .orElseThrow(NotFoundException::new);\n\n }", "public Prediction getPredFor(String name) {\n if (name != null) {\n for (int i=0; i< getPredictions().size(); i++) {\n if (getPredictions().get(i).stop.equals(name)) {\n return getPredictions().get(i);\n }\n }\n }\n throw new RuntimeException(\"Either you were too stupid to use \" +\n \"hasPredFor, or someone is stealing \" +\n \"your list's predictions.\");\n }", "@Override\n\tpublic <S extends Audit> Optional<S> findOne(Example<S> example) {\n\t\treturn null;\n\t}", "public Concept getConcept(String conceptUri) throws OEClientException {\r\n\t\tlogger.info(\"getConcept entry: {}\", conceptUri);\r\n\r\n\t\tMap<String, String> queryParameters = new HashMap<String, String>();\r\n\t\tqueryParameters.put(\"properties\", basicProperties);\r\n\t\tqueryParameters.put(\"path\", getPathParameter(conceptUri));\r\n\t\tInvocation.Builder invocationBuilder = getInvocationBuilder(getApiURL(), queryParameters);\r\n\r\n\t\tDate startDate = new Date();\r\n\t\tlogger.info(\"getConcept making call : {}\", startDate.getTime());\r\n\t\tResponse response = invocationBuilder.get();\r\n\t\tlogger.info(\"getConcept call complete: {}\", startDate.getTime());\r\n\r\n\t\tlogger.info(\"getConceptDetails - status: {}\", response.getStatus());\r\n\t\tif (response.getStatus() == 200) {\r\n\t\t\tString stringResponse = response.readEntity(String.class);\r\n\t\t\tif (logger.isDebugEnabled()) logger.debug(\"getConceptDetails: jsonResponse {}\", stringResponse);\r\n\t\t\tJsonObject jsonResponse = JSON.parse(stringResponse);\r\n\t\t\treturn new Concept(this, jsonResponse.get(\"@graph\").getAsArray().get(0).getAsObject());\r\n\t\t} else {\r\n\t\t\tthrow new OEClientException(String.format(\"Error(%d) %s from server\", response.getStatus(), response.getStatusInfo().toString()));\r\n\t\t}\r\n\t}", "public SemanticConcept getSelectedInputConcept(){\n \n return this.selectedInputConcept;\n \n }", "public static ConceptDeclarationContext getConceptDeclaration(String name, ParseTree tree) {\n\t\tParseTree root = getRoot(tree);\n\t\tif (!(root instanceof CompilationUnitContext)) {\n\t\t\tthrow new IllegalStateException(\"The Root is no compilationUnit\");\n\t\t}\n\t\tCompilationUnitContext ctx = (CompilationUnitContext) root;\n\t\tfor (ConceptDeclarationContext concept : ctx.conceptDeclaration()) {\n\t\t\tif (concept.Identifier().getText().equals(name)) {\n\t\t\t\treturn concept;\n\t\t\t}\n\t\t}\n\t\tthrow new IllegalArgumentException(\"Concept not found: \" + name);\n\t}", "private ReportConcept mergeConcepts(ReportConcept previous, ReportConcept entry, ReportConcept next, Collection<ReportConcept> concepts){\n\t\tIClass pc = previous.getConceptClass();\n\t\tIClass ec = entry.getConceptClass();\n\t\tIClass nc = next.getConceptClass();\n\t\tIClass common = getDirectCommonChild(pc,ec,nc);\n\t\t\n\t\t// make sure that common ground is valid\n\t\tif(common != null){\n\t\t\t// we can't have two attributes s.a. 3 mm inferring a finding\n\t\t\tif(isFeature(common) && !isFeature(pc) && !isFeature(ec) && !isFeature(nc))\n\t\t\t\tcommon = null;\n\t\t\t\n\t\t\t// if previous concept is in fact more specific then current concept\n\t\t\tif(pc.hasSuperClass(ec)){\n\t\t\t\tif(isSubset(previous.getLabels(),entry.getLabels())){\n\t\t\t\t\tcommon = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t// common ground was found\n\t\tif(common != null){\n\t\t\tReportConcept ne = createReportConcept(common);\n\t\t\tne.addLabels(previous.getLabels());\n\t\t\tne.addLabels(entry.getLabels());\n\t\t\tne.addLabels(next.getLabels());\n\t\t\t\t\n\t\t\t// if new concept is just an old concept\n\t\t\t// then retain the old concept\n\t\t\tif(entry.equals(ne))\n\t\t\t\tne.setConceptEntry(entry.getConceptEntry());\n\t\t\tif(previous.equals(ne))\n\t\t\t\tne.setConceptEntry(previous.getConceptEntry());\n\t\t\tif(next.equals(ne))\n\t\t\t\tne.setConceptEntry(next.getConceptEntry());\n\t\t\t\n\t\t\t\n\t\t\t//CORRECTION: previous should take precedence, MAX was arbitrary\n\t\t\tif(previous.getConceptEntry().hasNumericValue())\n\t\t\t\tne.setNumericValue(previous.getNumericValue());\n\t\t\telse if(entry.getConceptEntry().hasNumericValue())\n\t\t\t\tne.setNumericValue(entry.getNumericValue());\n\t\t\telse if(next.getConceptEntry().hasNumericValue())\n\t\t\t\tne.setNumericValue(next.getNumericValue());\n\t\t\t\n\t\t\t// copy resource link\n\t\t\tif(previous.hasResourceLink())\n\t\t\t\tne.setResourceLink(previous.getResourceLink());\n\t\t\telse if(entry.hasResourceLink())\n\t\t\t\tne.setResourceLink(entry.getResourceLink());\n\t\t\telse if(next.hasResourceLink())\n\t\t\t\tne.setResourceLink(next.getResourceLink());\n\t\t\t\n\t\t\t// copy negation\n\t\t\tif(previous.isNegated())\n\t\t\t\tne.setNegation(previous.getNegation());\n\t\t\telse if(entry.isNegated())\n\t\t\t\tne.setNegation(entry.getNegation());\n\t\t\telse if(next.isNegated())\n\t\t\t\tne.setNegation(next.getNegation());\n\t\t\t\t\n\t\t\t// update list\n\t\t\tconcepts.remove(entry);\n\t\t\tconcepts.remove(previous);\n\t\t\tconcepts.remove(next);\n\t\t\tconcepts.add(ne);\n\t\t\n\t\t\treturn ne;\n\t\t}\n\t\treturn null;\n\t}", "private VEvent eventExists(VEvent testMe)\n {\n for (ComparableCalendar current : queue)\n {\n VEvent currEv = (VEvent) current.getComponent(\"VEVENT\");\n if (testMe.getSummary().equals(currEv.getSummary()))\n return testMe;\n }\n return null;\n }", "public T getFirst();", "public T getFirst();", "org.hl7.fhir.ResourceReference getSpecimen();", "@Test\n public void testFinaExperimentByTag() {\n ExperimentId experimentId1 = new ExperimentId();\n experimentId1.setServerTimestamp(System.currentTimeMillis());\n experimentId1.setId(1);\n\n Experiment experiment1 = new Experiment();\n experiment1.setSpec(spec);\n experiment1.setExperimentId(experimentId1);\n experiment1.rebuild(result);\n\n ExperimentId experimentId2 = new ExperimentId();\n experimentId2.setServerTimestamp(System.currentTimeMillis());\n experimentId2.setId(2);\n\n ExperimentEntity entity1 = new ExperimentEntity();\n entity1.setId(experiment1.getSpec().getMeta().getExperimentId());\n entity1.setExperimentSpec(new GsonBuilder().disableHtmlEscaping().create().toJson(experiment1.getSpec()));\n\n doReturn(Arrays.asList(entity1)).when(mockService).selectAll();\n\n when(mockSubmitter.findExperiment(any(ExperimentSpec.class))).thenReturn(experiment1);\n\n ExperimentManager spyExperimentManager = spy(experimentManager);\n // only the experiment1 object should be found with giving tag stable\n List<Experiment> foundExperiments = spyExperimentManager.listExperimentsByTag(\"stable\");\n assertEquals(1, foundExperiments.size());\n // no object should be found when we're searching with tag \"test\"\n List<Experiment> foundExperiments2 = spyExperimentManager.listExperimentsByTag(\"test\");\n assertEquals(0, foundExperiments2.size());\n }", "public Concept getConceptByIdentifier(Identifier identifier) throws OEClientException {\r\n\t\tlogger.info(\"getConceptByIdentifier entry: {}\", identifier);\r\n\r\n\t\tString url = getModelURL() + \"/skos:Concept/meta:transitiveInstance\";\r\n\r\n\t\tMap<String, String> queryParameters = new HashMap<String, String>();\r\n\t\tqueryParameters.put(\"properties\", basicProperties);\r\n\t\tqueryParameters.put(\"filters\", String.format(\"subject(exists %s \\\"%s\\\")\", getWrappedUri(identifier.getUri()), identifier.getValue()));\r\n\t\tInvocation.Builder invocationBuilder = getInvocationBuilder(url, queryParameters);\r\n\r\n\t\tDate startDate = new Date();\r\n\t\tlogger.info(\"getConceptByIdentifier making call : {}\", startDate.getTime());\r\n\t\tResponse response = invocationBuilder.get();\r\n\t\tlogger.info(\"getConceptByIdentifier call complete: {}\", startDate.getTime());\r\n\r\n\t\tlogger.info(\"getConceptByIdentifier - status: {}\", response.getStatus());\r\n\t\tif (response.getStatus() == 200) {\r\n\t\t\tString stringResponse = response.readEntity(String.class);\r\n\t\t\tif (logger.isDebugEnabled()) logger.debug(\"getConceptByIdentifier: jsonResponse {}\", stringResponse);\r\n\t\t\tJsonObject jsonResponse = JSON.parse(stringResponse);\r\n\t\t\treturn new Concept(this, jsonResponse.get(\"@graph\").getAsArray().get(0).getAsObject());\r\n\t\t} else {\r\n\t\t\tthrow new OEClientException(String.format(\"Error(%d) %s from server\", response.getStatus(), response.getStatusInfo().toString()));\r\n\t\t}\r\n\t}", "Question getFirstQuestion();", "@Override\n\tpublic Place find(Place obj) {\n\t\treturn null;\n\t}", "public Student searchStudent(String id) {\n\t\tfor (String key : list.keySet()) {\n\t\t\tif(id.equals(key))\n\t\t\t\treturn list.get(key);\n\t\t}\n\t\treturn null;\n\t}", "public interface IFlexoOntologyConcept<TA extends TechnologyAdapter<TA>> extends IFlexoOntologyObject<TA> {\n\t/**\n\t * Ontology of Concept.\n\t * \n\t * @return\n\t */\n\tpublic IFlexoOntology<TA> getOntology();\n\n\t/**\n\t * Annotation upon Concept.\n\t * \n\t * @return\n\t */\n\tpublic List<? extends IFlexoOntologyAnnotation> getAnnotations();\n\n\t/**\n\t * Container of Concept.\n\t * \n\t * @return\n\t */\n\tpublic IFlexoOntologyConceptContainer<TA> getContainer();\n\n\t/**\n\t * Association with structural features for Concept.\n\t * \n\t * @return\n\t */\n\tpublic List<? extends IFlexoOntologyFeatureAssociation<TA>> getStructuralFeatureAssociations();\n\n\t/**\n\t * Association with behavioural features for Concept.\n\t * \n\t * @return\n\t */\n\tpublic List<? extends IFlexoOntologyFeatureAssociation<TA>> getBehaviouralFeatureAssociations();\n\n\t/**\n\t * \n\t * Is this a Super Concept of concept.\n\t * \n\t * @return\n\t */\n\tpublic boolean isSuperConceptOf(IFlexoOntologyConcept<TA> concept);\n\n\t/**\n\t * \n\t * Is this a Sub Concept of concept.\n\t * \n\t * @return\n\t */\n\tpublic boolean isSubConceptOf(IFlexoOntologyConcept<TA> concept);\n\n\t/**\n\t * Visitor access.\n\t * \n\t * @param visitor\n\t * @return\n\t * \n\t * @pattern visitor\n\t */\n\tpublic <T> T accept(IFlexoOntologyConceptVisitor<T> visitor);\n\n\t/**\n\t * This equals has a particular semantics (differs from {@link #equals(Object)} method) in the way that it returns true only and only if\n\t * compared objects are representing same concept regarding URI. This does not guarantee that both objects will respond the same way to\n\t * some methods.<br>\n\t * This method returns true if and only if objects are same, or if one of both object redefine the other one (with eventual many levels)\n\t * \n\t * @param o\n\t * @return\n\t */\n\tpublic boolean equalsToConcept(IFlexoOntologyConcept<TA> concept);\n\n\t/**\n\t * Return all properties accessible in the scope of this ontology object, where declared domain is this object\n\t * \n\t * @return\n\t */\n\n}", "public Obs getObs() { return obs; }", "@XmlElement\n private Long getConceptId() {\n return concept != null ? concept.getId() : null;\n }", "public synchronized TimedVariable sampleAt( int idx )\n\t{\n\t\tif (idx >= 0 && idx < vars.size())\n\t\t\treturn vars.get(idx);\n\t\treturn null;\n\t}", "private Relationship findStatedRelationship(\n\t\t\tRelationship exampleRel, Concept c,\n\t\t\tActiveState active) {\n\t\tfor (Relationship r : c.getRelationships(CharacteristicType.STATED_RELATIONSHIP, exampleRel.getType(), active)) {\n\t\t\tif (r.getTarget().equals(exampleRel.getTarget())) {\n\t\t\t\treturn r;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private TestDevice searchTestDevice(final String deviceSerialNumber) {\n for (TestDevice td : mDevices) {\n if (td.getSerialNumber().equals(deviceSerialNumber)) {\n return td;\n }\n }\n return null;\n }", "List<String> getModalities(Observation obs);", "public Tour getFittest() {\n Tour fittest = tours[0];\n // Loop through individuals to find fittest\n for (int i = 1; i < populationSize(); i++) {\n if (fittest.getFitness() <= getTour(i).getFitness()) {\n fittest = getTour(i);\n }\n }\n return fittest;\n }", "com.google.ads.googleads.v13.common.ConceptGroupOrBuilder getConceptGroupOrBuilder();", "List<RepStuLearning> selectByExample(RepStuLearningExample example);", "static Item search(long sum) {\n int i = hash(sum);\n while (st[i] != null) {\n if (st[i].sum == sum) return st[i];\n i++;\n if (i >= st.length) i -= st.length;\n }\n return null;\n }", "char firstTermAvail(){\n\r\n boolean charGood =false;\r\n int i=0;\r\n char searchChar=gIndividualNames.charAt(i);\r\n\r\n if (fShapes.size() > 0) {\r\n while ( (!charGood) && (i < gIndividualNames.length())) {\r\n\r\n searchChar=gIndividualNames.charAt(i);\r\n\r\n charGood=true; // this character is good unless we can prove otherwise\r\n\r\n Iterator iter = fShapes.iterator();\r\n\r\n while (charGood&&iter.hasNext()) {\r\n TShape theShape = (TShape) iter.next();\r\n\r\n if (((theShape.fTypeID == TShape.IDIndividual)||\r\n (theShape.fTypeID == TShape.IDIdentity))&&\r\n (searchChar == theShape.fName|| // should switch from char to string\r\n (fSemantics.getCurrentIdentities())[i]!=chBlank)) // it's a unary function (fCurrentIdentities[firstchar] <> chBlank)\r\n\r\n charGood=false;\r\n }\r\n i++;\r\n }\r\n }\r\n else {\r\n charGood=true; //if there are no shapes the first character will do\r\n }\r\n\r\n if (charGood)\r\n return\r\n searchChar;\r\n else\r\n return\r\n chBlank;\r\n\r\n}", "public static URI findMostSpecificClass(Rdf2GoCore core, URI concept) {\n\t\treturn findMostSpecificClass(getClassHierarchy(core, concept));\n\t}", "@Override\n\tpublic T retrieveItem(T obj) {\n\t\tif(cache.contains(obj)) {\n\t\t\tfor (T objInSet : cache) {\n\t\t\t\tif (objInSet.equals(obj)) {\n\t\t\t\t\treturn objInSet;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public Tutorial getTutorial(final Student student) {\n Tutorial result = null;\n\n for (Tutorial t : tutorials) {\n if (t.contains(student)) {\n result = t;\n break;\n }\n }\n\n return result;\n }", "public Individual getIndividualByName(String name) throws ObjectNotFoundException{\n \t\n\t\tList<Individual> individualList = new ArrayList<>();\n\t\tindividualList = (new TeamsJsonReader()).getListOfIndividuals();\n\t\tIndividual individual = null;\n\t\tint size, counter = 0;\n\t\tfor (size = 0; size < individualList.size(); size++) {\n\t\t\tcounter = 0;\n\n\t\t\tindividual = individualList.get(size);\n\n\t\t\tif (individual.getName().equals(name)) {\n\t\t\t\tcounter = 1;\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (size == individualList.size() && counter == 0)\n\t\t\tthrow new ObjectNotFoundException(\"individual\", \"name\", name);\n\n\t\treturn individual;\n\n\n }", "public abstract SmartObject findIndividualName(String individualName);", "public Student getStudent(String match);", "public static int findConcept(int nid)\n\t{\n\t\tOptional<? extends ObjectChronology<? extends StampedVersion>> c = Get.identifiedObjectService().getIdentifiedObjectChronology(nid);\n\t\t\n\t\tif (c.isPresent())\n\t\t{\n\t\t\tif (c.get().getOchreObjectType() == OchreExternalizableObjectType.SEMEME)\n\t\t\t{\n\t\t\t\treturn findConcept(((SememeChronology<?>)c.get()).getReferencedComponentNid());\n\t\t\t}\n\t\t\telse if (c.get().getOchreObjectType() == OchreExternalizableObjectType.CONCEPT)\n\t\t\t{\n\t\t\t\treturn ((ConceptChronology<?>)c.get()).getConceptSequence();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlog.warn(\"Unexpected object type: \" + c.get().getOchreObjectType());\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "default List<String> assignedConcepts(Location locatedUnit, int topK){\n final UnitLocation unitLocation = (UnitLocation) Objects.requireNonNull(locatedUnit);\n final Set<Location> irrelevantSet = generateIrrelevantSet(unitLocation);\n\n return interestingConcepts(topK, unitLocation, irrelevantSet);\n }", "public Object getFirst()\n {\n if (first == null)\n {\n throw new NoSuchElementException();\n }\n else\n return first.getValue();\n }", "public String bestMatch(String prefix) {\n\t\tif(prefix != null){\n\t\t\tfor(int i = 0; i < data.getRawList().size();i++){\n\t\t\t\tif(data.getRawList().get(i).getWord().startsWith(prefix)){\n\t\t\t\t\treturn data.getRawList().get(i).getWord();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "Assessment getTest(Long assessmentId);", "@Override\n\tpublic String getName(ProgramWorkflow object) {\n\t\tif (object.getConcept() != null && object.getConcept().getName() != null) {\n\t\t\treturn object.getConcept().getName().getName();\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t}", "@Override\n\tpublic MedicalTest findTestById(String testId) {\n\n\t\tOptional<MedicalTest> optional = testDao.findById(testId);\n\t\tif (optional.isPresent()) {\n\t\t\tMedicalTest test = optional.get();\n\t\t\treturn test;\n\t\t}\n\t\tthrow new MedicalTestNotFoundException(\"Test not found for Test Id= \" + testId);\n\t}", "public Vehicle getMake(String make) {\n\t\tfor (int i = 0; i < vehicles.size(); i++) {\n\t\t\tVehicle temp = vehicles.get(i);\n\n\t\t\tif (temp.getMake().equals(make)) {\n\t\t\t\treturn temp;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public Tour getFittest() {\r\n\t\t Tour fittest=null;\r\n\t\t for(int nn=0; nn<tours.length;nn++) {\r\n\t\t\t if(tours[nn]!=null) {\r\n\t\t\t\r\n\t\t\t fittest = tours[nn];\r\n\t\t\t break;\r\n\t\t\t }\r\n\t\t }\r\n\t\t\r\n\t for (int i = 1; i < populationSize(); i++) {\r\n\t \t if(getTour(i)!=null) {\r\n\t \t\t if (fittest.getDuration() > getTour(i).getDuration()) {\r\n\t fittest = getTour(i);\r\n\t \t\t }\r\n\t }\r\n\t }\r\n\t\r\n\t return fittest;\r\n\t }" ]
[ "0.61701703", "0.58510864", "0.559697", "0.5406479", "0.50594085", "0.50572866", "0.50027233", "0.49168068", "0.48724988", "0.48717177", "0.4869902", "0.4834917", "0.4834917", "0.47615987", "0.4748868", "0.46369568", "0.45799226", "0.4560637", "0.455278", "0.45433682", "0.45369774", "0.45301756", "0.45222038", "0.45094103", "0.45022154", "0.4486077", "0.44840157", "0.4469715", "0.44654417", "0.445968", "0.4445111", "0.44253728", "0.44169623", "0.4394196", "0.4387602", "0.4383406", "0.434764", "0.43398783", "0.43373963", "0.43332863", "0.4311837", "0.43034744", "0.43000847", "0.429861", "0.42960584", "0.4294006", "0.42603397", "0.42593297", "0.42584586", "0.42580158", "0.42577478", "0.42212602", "0.42199638", "0.42169708", "0.4215001", "0.4210128", "0.42060113", "0.41951808", "0.41888693", "0.41888455", "0.41878554", "0.4186982", "0.41851708", "0.41848478", "0.4181555", "0.4178168", "0.4178168", "0.41684112", "0.4166223", "0.41637665", "0.41545725", "0.41545153", "0.41544393", "0.4151733", "0.41422895", "0.41400945", "0.41349474", "0.4127605", "0.41235122", "0.4121743", "0.41123864", "0.41117352", "0.41061884", "0.41045806", "0.40988103", "0.40940404", "0.40895575", "0.4077098", "0.40755767", "0.4074735", "0.40732357", "0.40727797", "0.40727374", "0.4066249", "0.40635428", "0.40596646", "0.4059557", "0.4058092", "0.4056746", "0.4052291" ]
0.6482924
0
Iterates through all the toplevel obs in the encounter and returns the first one that who concept matches the specified concept Returns null if obs not found
public static Obs getObsFromEncounter(Concept concept, Encounter encounter) { if (encounter.getObsAtTopLevel(false) != null) { for (Obs obs : encounter.getObsAtTopLevel(false)) { if (!obs.isVoided() && obs.getConcept().equals(concept)) { return obs; } } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private ReportConcept getRelatedConcept(ReportConcept entry) {\n\t\t// if completly removed, no point in searching\n\t\tif(entry.getLabels().isEmpty())\n\t\t\treturn null;\n\t\t\n\t\tfor (ReportConcept c : concepts) {\n\t\t\t// labels in the new concept are contained within the old concept label list\n\t\t\tif(Collections.indexOfSubList(entry.getLabels(),c.getLabels()) > -1 || Collections.indexOfSubList(c.getLabels(),entry.getLabels()) > -1){\n\t\t\t\t//if(entry.getName().contains(c.getName()) || c.getName().contains(entry.getName())){\n\t\t\t\treturn c;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public static Obs getObsFromObsGroup(Concept concept, Obs group) {\r\n \tif (group.getGroupMembers() != null) {\r\n \t\tfor(Obs obs : group.getGroupMembers()) {\r\n \t\t\t// need to check for voided obs here because getGroupMembers returns voided obs\r\n \t\t\tif (!obs.isVoided() && obs.getConcept().equals(concept)) {\r\n \t\t\t\treturn obs;\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n \treturn null;\r\n }", "Concept getConcept(String id);", "public static ISPObsComponent findAOSystem(ISPObservation obs) {\n if (obs != null) {\n Iterator iter = obs.getObsComponents().iterator();\n while (iter.hasNext()) {\n ISPObsComponent obsComp = (ISPObsComponent) iter.next();\n if (isAOInstrument(obsComp)) {\n return obsComp;\n }\n }\n }\n return null;\n }", "public static CalculationResultMap firstObs(Concept concept, Collection<Integer> cohort, PatientCalculationContext context) {\n ObsForPersonDataDefinition def = new ObsForPersonDataDefinition(\"first obs\", TimeQualifier.FIRST, concept, context.getNow(), null);\n return MentalHealthConfigCalculationUtils.evaluateWithReporting(def, cohort, null, null, context);\n }", "public final Concept getConcept(final String name) {\r\n Concept[] d;\r\n Concept s;\r\n\r\n d = this.m_data;\r\n\r\n for (s = d[name.hashCode() & (d.length - 1)]; s != null; s = s.m_next) {\r\n if (s.m_name.equals(name))\r\n return s;\r\n }\r\n\r\n return null;\r\n }", "protected Atom findAtom(String curAsymId, int curSeqId, String curAtomName, String curCompId, String curInsertionCode, String curAltId) {\n \t\tfor (Atom a: atomVector) {\n \t\t\tif (a.partialEquals(curAsymId, curSeqId, curAtomName, curCompId, curInsertionCode, curAltId)) {\n \t\t\t\treturn a;\n \t\t\t}\n \t\t}\n \t\treturn null;\n \t}", "public static void getRoomConcept(String concept)\n\t{\n\t\t\n\t}", "public VocabularyConcept getEditableConcept() {\r\n for (VocabularyConcept vc : vocabularyConcepts.getList()) {\r\n if (vc != null) {\r\n return vc;\r\n }\r\n }\r\n return null;\r\n }", "public org.hl7.fhir.ResourceReference getObservation()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.ResourceReference target = null;\n target = (org.hl7.fhir.ResourceReference)get_store().find_element_user(OBSERVATION$0, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }", "String getConcept();", "public O first()\r\n {\r\n if (isEmpty()) return null; \r\n return first.getObject();\r\n }", "private ReportConcept getReportConcept(Concept c) {\n\t\tfor (ReportConcept e : concepts) {\n\t\t\tif (c.getCode().endsWith(e.getName())) {\n\t\t\t\treturn e;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private static Integer findTermTypeConcept(int conceptModuleSequence)\n\t{\n\t\tOfInt parents = Get.taxonomyService().getTaxonomyParentSequences(conceptModuleSequence).iterator();\n\t\twhile (parents.hasNext())\n\t\t{\n\t\t\tint current = parents.next();\n\t\t\tif (current == MetaData.MODULE.getConceptSequence())\n\t\t\t{\n\t\t\t\treturn conceptModuleSequence;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn findTermTypeConcept(current);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "@Override\n\tpublic Place find(Place obj) {\n\t\treturn null;\n\t}", "private Pair getFirstOccurrence(Object o) {\n\t\tNode p;\n\t\tint k;\n\n\t\tif (o != null) {\n\t\t\tfor (k = 0, p = mHead.next; k < mSize; p = p.next, k++)\n\t\t\t\tif (o.equals(p.data))\n\t\t\t\t\treturn new Pair(p, k);\n\t\t} else {\n\t\t\tfor (k = 0, p = mHead.next; k < mSize; p = p.next, k++)\n\t\t\t\tif (p.data == null)\n\t\t\t\t\treturn new Pair(p, k);\n\t\t}\n\t\treturn new Pair(null, NOT_FOUND);\n\t}", "private List<ConceptSource> getConceptMapping(List<Obs> patientObsList){\n\t\tList<ConceptSource> conceptSourceList = new ArrayList<ConceptSource>();\n\t\tfor(Obs o : patientObsList){\n\t\t\tConcept c = o.getConcept();\n\t\t\tCollection<ConceptMap> conceptMap = c.getConceptMappings();\n\t\t\tIterator it;\n\t\t\tit = conceptMap.iterator();\n\t\t\twhile(it.hasNext()){\n\t\t\t\tConceptMap cm = (ConceptMap) it.next();\n\t\t\t\tInteger mapId = cm.getConceptMapId();\n\t\t\t\tConceptSource cs = cm.getSource();\n\t\t\t\tconceptSourceList.add(cs);\n\t\t\t}\n\t\t}\n\t\treturn conceptSourceList;\n\n\t}", "public String getConcept() {\n\t\treturn concept;\n\t}", "public Concept getConcept() {\n\t\treturn concept;\n\t}", "public Concept getConcept() {\n\t\treturn concept;\n\t}", "Concept getConceptName();", "public Individual getIndividual(int id){\n for(Individual individual : individuals){\n if(individual.getId() == id){\n return individual;\n }\n }\n return null;\n }", "private ReportConcept mergeConcepts(ReportConcept previous, ReportConcept entry, Collection<ReportConcept> concepts){\n\t\tIClass pc = previous.getConceptClass();\n\t\tIClass ec = entry.getConceptClass();\n\t\tIClass common = getDirectCommonChild(pc,ec);\n\t\t\n\t\t// make sure that common ground is valid\n\t\tif(common != null){\n\t\t\t// we can't have two attributes s.a. 3 mm inferring a finding\n\t\t\tif(isFeature(common) && !isFeature(pc) && !isFeature(ec))\n\t\t\t\tcommon = null;\n\t\t\t// check if we are doing the same to diagnosis\n\t\t\tif(isDisease(common) && !isDisease(pc) && !isDisease(ec))\n\t\t\t\tcommon = null;\n\t\t\t\n\t\t\t// if previous concept is in fact more specific then current concept\n\t\t\t//TODO: this breaks depth of invasion 1.3mm\n\t\t\tif(pc.hasSuperClass(ec)){\n\t\t\t\t/*\n\t\t\t\tint stp = previous.getOffset();\n\t\t\t\tint enp = stp+previous.getLength();\n\t\t\t\tint stc = entry.getOffset();\n\t\t\t\tint enc = stc+entry.getLength();\n\t\t\t\t// we only accept common if more specific encompas the more general\n\t\t\t\tif(!(stp <= stc && enc <= enp)){\n\t\t\t\t\tcommon = null;\n\t\t\t\t}*/\n\t\t\t\tif(isSubset(previous.getLabels(),entry.getLabels())){\n\t\t\t\t\tcommon = null;\n\t\t\t\t}\n\t\t\t}else if(pc.hasSubClass(ec)){\n\t\t\t\t/*int stp = pc.getConcept().getOffset();\n\t\t\t\tint enp = stp+pc.getConcept().getText().length();\n\t\t\t\tint stc = ec.getConcept().getOffset();\n\t\t\t\tint enc = stc+ec.getConcept().getText().length();\n\t\t\t\t// we only accept common if more specific encompas the more general\n\t\t\t\tif(!(stc <= stp && enp <= enc)){\n\t\t\t\t\tcommon = null;\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t// common ground was found\n\t\tif(common != null){\n\t\t\tReportConcept ne = createReportConcept(common);\n\t\t\tne.addLabels(previous.getLabels());\n\t\t\tne.addLabels(entry.getLabels());\n\t\t\t//ne.addComponent(previous);\n\t\t\t//ne.addComponent(entry);\n\t\t\t\n\t\t\t\n\t\t\t// if new concept is just an old concept\n\t\t\t// then retain the old concept\n\t\t\tif(entry.equals(ne))\n\t\t\t\tne.setConceptEntry(entry.getConceptEntry());\n\t\t\tif(previous.equals(ne))\n\t\t\t\tne.setConceptEntry(previous.getConceptEntry());\n\t\t\t\n\t\t\t\n\t\t\t//CORRECTION: previous should take precedence, MAX was arbitrary\n\t\t\tif(previous.getConceptEntry().hasNumericValue())\n\t\t\t\tne.setNumericValue(previous.getNumericValue());\n\t\t\telse if(entry.getConceptEntry().hasNumericValue())\n\t\t\t\tne.setNumericValue(entry.getNumericValue());\n\t\t\t\n\t\t\t// copy resource link\n\t\t\tif(previous.hasResourceLink())\n\t\t\t\tne.setResourceLink(previous.getResourceLink());\n\t\t\telse if(entry.hasResourceLink())\n\t\t\t\tne.setResourceLink(entry.getResourceLink());\n\t\t\t\n\t\t\t// copy negation\n\t\t\tif(previous.isNegated())\n\t\t\t\tne.setNegation(previous.getNegation());\n\t\t\telse if(entry.isNegated())\n\t\t\t\tne.setNegation(entry.getNegation());\n\t\t\t\t\n\t\t\t// update list\n\t\t\tconcepts.remove(entry);\n\t\t\tconcepts.remove(previous);\n\t\t\tconcepts.add(ne);\n\t\t\n\t\t\treturn ne;\n\t\t}\n\t\treturn null;\n\t}", "public static ConceptDeclarationContext getConceptDeclaration(String name, ParseTree tree) {\n\t\tParseTree root = getRoot(tree);\n\t\tif (!(root instanceof CompilationUnitContext)) {\n\t\t\tthrow new IllegalStateException(\"The Root is no compilationUnit\");\n\t\t}\n\t\tCompilationUnitContext ctx = (CompilationUnitContext) root;\n\t\tfor (ConceptDeclarationContext concept : ctx.conceptDeclaration()) {\n\t\t\tif (concept.Identifier().getText().equals(name)) {\n\t\t\t\treturn concept;\n\t\t\t}\n\t\t}\n\t\tthrow new IllegalArgumentException(\"Concept not found: \" + name);\n\t}", "public Optional<Term> getMatchingTerm(Term nextTerm) {\n\t\treturn Optional.ofNullable(terms.get(nextTerm.tag));\n\t}", "private Place getFromPlace(Element passageElement, ArrayList<Place> places) {\n Place start = null;\n for (int i = 0; i <= places.size() - 1; i++) {\n if (passageElement.getElementsByTagName(\"comeFrom\").item(0).getTextContent()\n .equals(places.get(i).getName())) {\n start = places.get(i);\n }\n }\n return start;\n }", "public static int findConcept(int nid)\n\t{\n\t\tOptional<? extends ObjectChronology<? extends StampedVersion>> c = Get.identifiedObjectService().getIdentifiedObjectChronology(nid);\n\t\t\n\t\tif (c.isPresent())\n\t\t{\n\t\t\tif (c.get().getOchreObjectType() == OchreExternalizableObjectType.SEMEME)\n\t\t\t{\n\t\t\t\treturn findConcept(((SememeChronology<?>)c.get()).getReferencedComponentNid());\n\t\t\t}\n\t\t\telse if (c.get().getOchreObjectType() == OchreExternalizableObjectType.CONCEPT)\n\t\t\t{\n\t\t\t\treturn ((ConceptChronology<?>)c.get()).getConceptSequence();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlog.warn(\"Unexpected object type: \" + c.get().getOchreObjectType());\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "char firstTermAvail(){\n\r\n boolean charGood =false;\r\n int i=0;\r\n char searchChar=gIndividualNames.charAt(i);\r\n\r\n if (fShapes.size() > 0) {\r\n while ( (!charGood) && (i < gIndividualNames.length())) {\r\n\r\n searchChar=gIndividualNames.charAt(i);\r\n\r\n charGood=true; // this character is good unless we can prove otherwise\r\n\r\n Iterator iter = fShapes.iterator();\r\n\r\n while (charGood&&iter.hasNext()) {\r\n TShape theShape = (TShape) iter.next();\r\n\r\n if (((theShape.fTypeID == TShape.IDIndividual)||\r\n (theShape.fTypeID == TShape.IDIdentity))&&\r\n (searchChar == theShape.fName|| // should switch from char to string\r\n (fSemantics.getCurrentIdentities())[i]!=chBlank)) // it's a unary function (fCurrentIdentities[firstchar] <> chBlank)\r\n\r\n charGood=false;\r\n }\r\n i++;\r\n }\r\n }\r\n else {\r\n charGood=true; //if there are no shapes the first character will do\r\n }\r\n\r\n if (charGood)\r\n return\r\n searchChar;\r\n else\r\n return\r\n chBlank;\r\n\r\n}", "private WordRecord lookUp(String word)\n {\n int contains = 0;\n boolean check = false;\n //loops through concordance\n for(int i = 0; i < this.concordance.size();i++)\n {\n //checks to see if the words are equal\n if(word.equalsIgnoreCase(this.concordance.get(i).getWord()))\n {\n //gets location of what position the word is true\n contains = i;\n check = true;\n }\n \n }\n //checks to see if it was found in concordance\n if(check)\n return this.concordance.get(contains);\n \n return null;\n }", "public Entry find(Object key) {\n int hashCode = key.hashCode();\n int index = compFunction(hashCode);\n\n if(defTable[index].isEmpty()) {\n return null;\n }\n\n Entry entry = new Entry();\n ListNode current = defTable[index].front();\n\n try{\n while(true) {\n if(((Entry) current.item()).key().equals(key)) {\n entry.key = key;\n entry.value = ((Entry) current.item()).value();\n return entry;\n }\n if(current==defTable[index].back()) {\n break;\n }\n current = current.next();\n }\n } catch(Exception err) {\n System.out.println(err);\n }\n return null;\n }", "private Composite seekLocalName(Composite composite, String name) {\n Optional<Composite> find = composite.find(childComposite -> {\n if (childComposite == null) {\n return false;\n }\n\n return childComposite.getName() != null && childComposite.getName().equals(name);\n }, FindMode.childrenOnly).stream().findFirst();\n\n if (find.isPresent()) {\n return find.get();\n } else {\n return null;\n }\n }", "default Concept getConcept(ConceptName conceptName) {return (Concept) conceptName;}", "public StringNode locate(String word) {\n StringNode current = first;\n while (true) {\n if (current == null) {\n return null;\n }\n if (current.getWord().equalsIgnoreCase(word)) {\n return current;\n }\n else {\n if (current.hasNext()) {\n current = current.getNext();\n }\n else {\n return null;\n }\n }\n }\n }", "@Override\n\tpublic <S extends Translator> Optional<S> findOne(Example<S> example) {\n\t\treturn null;\n\t}", "private CompartmentSBML findOutsideComp(Tissue tiss, CompartmentSBML compInside) {\n if(compInside.outside == null)\n {\n return null ;\n }\n \n ArrayList<CompartmentSBML> children = tiss.getInternVolumes();\n\n Iterator<CompartmentSBML> ishtar = children.iterator();\n\n while (ishtar.hasNext()) {\n CompartmentSBML leafComp = null;\n\n leafComp = ishtar.next();\n // Post processing for \"outside\" field\n String compId = leafComp.getIdentity();\n if (compInside.outside.contentEquals(compId)) {\n // we found it\n return leafComp;\n }\n }\n // we found nothing\n return null;\n }", "List<Concept2OntClassMapping> lookupConcept2OntClassMappingPairs(Concept concept);", "public Individual getFittest(){\n Individual fittest = individuals.get(0);\n for (Individual individual: individuals){\n if(fittest.equals(individual)){\n continue;\n }\n else if(fittest.getFitness() < individual.getFitness()){\n fittest = individual;\n }\n }\n return fittest;\n }", "public T caseObservation(Observation object) {\n\t\treturn null;\n\t}", "public Object getFirstObject()\n {\n \tcurrentObject = firstObject;\n\n if (firstObject == null)\n \treturn null;\n else\n \treturn AL.get(0);\n }", "GameObject findSeaweed(){\n\t\tIterator iterator = gc.getIterator();\r\n\t\twhile(iterator.hasNext()){\r\n\t\t\tGameObject g = iterator.getNext();\r\n\t\t\tif (g instanceof Seaweed)return g;\r\n\t\t}\r\n\treturn nullSeaweed;\r\n\t}", "public NodeP findPatient (String name){\r\n NodeP current = front;\r\n \r\n while (!current.getPatient().getName().trim().equalsIgnoreCase(name)){\r\n current = current.getNext();\r\n }\r\n return current;\r\n }", "public Object getObject()\n {\n if (currentObject == null)\n \t return null;\n else\n return AL.indexOf(currentObject);\n }", "private TType searchLabelInComposite(TInLabel inlabel) throws TamagoCCException {\n\t\tIterator<TRequire> requires = ((TComposite)entity).getRequires();\r\n\t\twhile(requires.hasNext()) {\r\n\t\t\tTRequire require = (TRequire)requires.next();\r\n\t\t\tif(require.getLabel().equals(((TVariable)inlabel.getTarget()).getVariable())) {\r\n\t\t\t\tTamagoCCSearchType searchtype = new TamagoCCSearchType(require.getService(),null,new Stack<TInLabel>(),inlabel.getSubTerm());\r\n\t\t\t\treturn searchtype.getType();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tIterator<TDefinition> definitions = ((TComposite)entity).getDefinitions();\r\n\t\twhile(definitions.hasNext()) {\r\n\t\t\tTDefinition definition = (TDefinition)definitions.next();\r\n\t\t\tif(definition.getComponentLabel().equals(((TVariable)inlabel.getTarget()).getVariable())) {\r\n\t\t\t\tTTamago component = TamagoCCPool.getDefaultPool().getTreeAbstractSyntax(definition.getComponentName(),definition.getComponentModule());\r\n\t\t\t\tTamagoCCSearchType searchtype = new TamagoCCSearchType(component,null,new Stack<TInLabel>(),inlabel.getSubTerm());\r\n\t\t\t\treturn searchtype.getType();\r\n\t\t\t}\r\n\t\t}\r\n\t\tthrow new TamagoCCException(\"TamagoCCSearchType<searchLabelInComposite> : unfind label in requires services and definitions (\"+inlabel.getTarget()+\")\");\r\n\t}", "java.lang.String getConceptId();", "public T get(String name) {\n for (int i = maps.size() - 1; i >= 0; i--) {\n HashMap<String, T> scope = maps.get(i);\n T t = scope.get(name);\n if (t != null) return t; // Found it!\n }\n return null; // Not found\n }", "@Override\n public E find(E obj) {\n if (isEmpty())\n return null;\n else {\n Node<E> currentNode = head;\n while (true) {\n if (currentNode.data.compareTo(obj) == 0) {\n return currentNode.data;\n } else if (currentNode.next == null)\n return null;\n else\n currentNode = currentNode.next;\n }\n }\n }", "public static CalculationResultMap firstObsOnOrAfter(Concept concept, Date onOrAfter, Collection<Integer> cohort, PatientCalculationContext context) {\n ObsForPersonDataDefinition def = new ObsForPersonDataDefinition(\"first obs on or after\", TimeQualifier.FIRST, concept, context.getNow(), onOrAfter);\n return MentalHealthConfigCalculationUtils.evaluateWithReporting(def, cohort, null, null, context);\n }", "@XmlElement\n private String getConceptPreferredName() {\n return concept != null ? concept.getDefaultPreferredName() : \"\";\n }", "public static Toy getThatToy(String nm) {\n\t\tfor (int i = 0; i < toyList.size(); i++) {\n\t\t\tif (toyList.get(i).getName().equals(nm)) {\n\t\t\t\treturn toyList.get(i);\n\t\t\t}\n\t\t\telse {\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public static FeatureNode getFirstWord(FeatureNode word)\n\t{\n\t\tFeatureNode fn = word.get(\"phr-head\");\n\t\twhile (fn != null)\n\t\t{\n\t\t\tFeatureNode wd = fn.get(\"phr-word\");\n\t\t\tif (wd != null) return wd;\n\n\t\t\tFeatureNode subf = fn.get(\"phr-head\");\n\t\t\tif (subf != null)\n\t\t\t{\n\t\t\t\twd = getFirstWord(fn);\n\t\t\t\tif (wd != null) return wd;\n\t\t\t}\n\t\t\tfn = fn.get(\"phr-next\");\n\t\t}\n\t\treturn null;\n\t}", "public Sequence getSequenceByFullName(String fullName) {\n return null;\n }", "public static SpInstObsComp findInstrument(SpItem spItem) {\n if (spItem instanceof SpInstObsComp) {\n return (SpInstObsComp) spItem;\n }\n\n SpItem parent = spItem.parent();\n SpItem searchItem;\n\n if (!(spItem instanceof SpObsContextItem)) {\n searchItem = parent;\n\n if (parent == null) {\n return null;\n }\n } else {\n searchItem = spItem;\n }\n\n Enumeration<SpItem> children = searchItem.children();\n\n while (children.hasMoreElements()) {\n SpItem child = children.nextElement();\n\n if (child instanceof SpInstObsComp) {\n return (SpInstObsComp) child;\n }\n }\n\n if (parent != null) {\n return findInstrument(parent);\n }\n\n return null;\n }", "public Card getCard(Card c){\n\t\tif(contains(c)){\n\t\t\tfor(int i = 0; i < hand.size(); i ++)\n\t\t\t{\n\t\t\t\tif(hand.get(i).getSuit().equals(c.getSuit()))\n\t\t\t\t{\n\t\t\t\t\thand.remove(i);\n\t\t\t\t\treturn c;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//else\n\t\treturn null;\n\t}", "private OntologyConcept getOntologyConcept(JCas jcas, LookupHit hit)\n {\n String codingScheme = this.properties.getProperty(CODING_SCHEME_PRP_KEY);\n String idname = this.properties.getProperty(ID_PRP_KEY);\n String labelName = this.properties.getProperty(LABEL_PRP_KEY);\n MetaDataHit mdh = hit.getDictMetaDataHit();\n String id = mdh.getMetaFieldValue(idname);\n OntologyConcept concept = new OntologyConcept(jcas);\n concept.setCode(id);\n /* I'm not sure what the oui is supposed to be, but it's not being used elsewhere in the pipeline */\n concept.setOui(mdh.getMetaFieldValue(labelName));\n concept.setCodingScheme(codingScheme);\n return concept;\n }", "@Override\n\tpublic String getName(ProgramWorkflow object) {\n\t\tif (object.getConcept() != null && object.getConcept().getName() != null) {\n\t\t\treturn object.getConcept().getName().getName();\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t}", "private Place getPlace(String identifierPlace) {\n\t\tPlace place = null;\n\t\tfor(Place p: places ){\n\t\t\tif(p.getName().equals(identifierPlace)){\n\t\t\t\tplace = p;\n\t\t\t}\n\t\t}\n\t\treturn place;\n\t}", "public Unit first()\n\t{\n\t\tif (size() == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\treturn iterator().next();\n\t}", "public Entry find(Object key) {\n int i = compFunction(key.hashCode());\n SList chain = buckets[i];\n try {\n for (SListNode n = (SListNode) chain.front(); n.isValidNode(); n = (SListNode) n.next()) {\n Entry e = (Entry) n.item();\n if (e.key.equals(key)) {\n return e;\n }\n }\n } catch(InvalidNodeException e) {\n System.out.println(e);\n }\n return null;\n }", "public Concept getConcept(Term term) {\r\n String n = term.getName();\r\n Concept concept = concepts.get(n);\r\n if (concept == null)\r\n concept = new Concept(term, this); // the only place to make a new Concept\r\n return concept;\r\n }", "private SymObject find(String name) {\n SymObject object = table.find(name);\n if (object == SymbolTable.OBJECT_NONE) {\n error(name + \" can't be resolved to a name\");\n }\n\n return object;\n }", "public Concept getConceptByIdentifier(Identifier identifier) throws OEClientException {\r\n\t\tlogger.info(\"getConceptByIdentifier entry: {}\", identifier);\r\n\r\n\t\tString url = getModelURL() + \"/skos:Concept/meta:transitiveInstance\";\r\n\r\n\t\tMap<String, String> queryParameters = new HashMap<String, String>();\r\n\t\tqueryParameters.put(\"properties\", basicProperties);\r\n\t\tqueryParameters.put(\"filters\", String.format(\"subject(exists %s \\\"%s\\\")\", getWrappedUri(identifier.getUri()), identifier.getValue()));\r\n\t\tInvocation.Builder invocationBuilder = getInvocationBuilder(url, queryParameters);\r\n\r\n\t\tDate startDate = new Date();\r\n\t\tlogger.info(\"getConceptByIdentifier making call : {}\", startDate.getTime());\r\n\t\tResponse response = invocationBuilder.get();\r\n\t\tlogger.info(\"getConceptByIdentifier call complete: {}\", startDate.getTime());\r\n\r\n\t\tlogger.info(\"getConceptByIdentifier - status: {}\", response.getStatus());\r\n\t\tif (response.getStatus() == 200) {\r\n\t\t\tString stringResponse = response.readEntity(String.class);\r\n\t\t\tif (logger.isDebugEnabled()) logger.debug(\"getConceptByIdentifier: jsonResponse {}\", stringResponse);\r\n\t\t\tJsonObject jsonResponse = JSON.parse(stringResponse);\r\n\t\t\treturn new Concept(this, jsonResponse.get(\"@graph\").getAsArray().get(0).getAsObject());\r\n\t\t} else {\r\n\t\t\tthrow new OEClientException(String.format(\"Error(%d) %s from server\", response.getStatus(), response.getStatusInfo().toString()));\r\n\t\t}\r\n\t}", "public ClinicPrefs find(String clinicIen, String facilityNo) {\r\n \t\r\n \tQuery query = super.entityManager.createNamedQuery(QUERY_FIND_PREFS);\r\n\t query.setParameter(\"clinicIen\", clinicIen);\r\n\t query.setParameter(\"facilityNo\", facilityNo);\r\n\r\n\t query.setMaxResults(1);\r\n\t \r\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t List<ClinicPrefs> list = query.getResultList();\r\n\r\n\t\tif (list == null || list.size() == 0) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\treturn list.get(0);\r\n\t}", "public static Object first(Object o) {\n log.finer(\"getting first of list expression: \" + o);\n validateType(o, SPair.class);\n return ((SPair)o).getCar();\n }", "private CAUEntry findElementWithTID(CAUList ulist, int tid){\n\t\tList<CAUEntry> list = ulist.CAUEntries;\n\t\t\n\t\t// perform a binary search to check if the subset appears in level k-1.\n int first = 0;\n int last = list.size() - 1;\n \n // the binary search\n while( first <= last )\n {\n \tint middle = ( first + last ) >>> 1; // divide by 2\n\n if(list.get(middle).tid < tid){\n \tfirst = middle + 1; // the itemset compared is larger than the subset according to the lexical order\n }\n else if(list.get(middle).tid > tid){\n \tlast = middle - 1; // the itemset compared is smaller than the subset is smaller according to the lexical order\n }\n else{\n \treturn list.get(middle);\n }\n }\n\t\treturn null;\n\t}", "public Symbol findEntryLocal(String name){\n\t\tList<SymbolEntry> l = symbolMap.get(name);\n\t\tif(l == null || (l.get(0).level < scopeLevel))\n\t\t\treturn null;\n\t\treturn l.get(0).symbol;\n\t}", "private Variable findVariable(String varToFind){\r\n\t\tScope curScope = this;\r\n\t\twhile (curScope!=null) {\r\n\t\t\tif(curScope.contains(varToFind)){\r\n\t\t\t\treturn curScope.getVariable(varToFind);\r\n\t\t\t}else{\r\n\t\t\t\tcurScope = curScope.parent;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "private Optional<String> getRDFSLabelnoPopup(OWLNamedObject oobj) {\n\t\tif (oobj == null) {\r\n\t\t\treturn Optional.empty();\r\n\t\t}\r\n\t\tif (topOrBot(oobj)) {\r\n\t\t\treturn Optional.of(oobj.getIRI().getShortForm());\t\t\t\r\n\t\t}\r\n\t\tif (ontology != null) {\r\n\t\t\tfor (OWLAnnotation annotation : annotationObjects(ontology.getAnnotationAssertionAxioms(oobj.getIRI()), ontology.getOWLOntologyManager().getOWLDataFactory()\r\n\t\t\t\t\t.getRDFSLabel())) {\r\n\t\t\t\tOWLAnnotationValue av = annotation.getValue();\r\n\t\t\t\tcom.google.common.base.Optional<OWLLiteral> ol = av.asLiteral();\r\n\t\t\t\tif (ol.isPresent()) {\r\n\t\t\t\t\treturn Optional.of(ol.get().getLiteral());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Optional.of(oobj.getIRI().getShortForm());\r\n\r\n\r\n\t}", "public SuspectCard findSuspectCard(String search) {\n for (SuspectCard card : this.getSuspectCards()) {\n if (card.getName().toLowerCase().equals(search.toLowerCase())) {\n return card;\n }\n }\n return null;\n }", "public static Team getSecondPlace() {\n\t\tif (matches != null && matches.length > 0 && matches[0] != null)\n\t\t\treturn matches[0].getLoser();\n\t\treturn null;\n\t}", "private ResourceLocation findMatchingEntry(String publicId) {\n return getElements().stream()\n .filter(e -> e.getPublicId().equals(publicId)).findFirst()\n .orElse(null);\n }", "public abstract SmartObject findIndividualName(String individualName);", "private Node find(Order ord){\n\t\tNode position=head;\n\t\tOrder ItemPosition;\n\t\twhile (position!=null){\n\t\t\tItemPosition = position.ord;\n\t\t\tif(ItemPosition.equals(ord)) {\n\t\t\t\tposition=bestBid;\n\t\t\t\treturn position;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public static LinkedList<Actor> natSearch(String nat) {\n //sets nat to lower case\n String hNat = nat.toLowerCase();\n //hashes the lower cased nat\n int hash = Math.abs(hNat.hashCode()) % ActorList.natHashlist.length;\n //finds the location that it should have been hashed to\n LinkedList<Actor> location = ActorList.natHashlist[hash];\n //sets head to head of the linked list\n LinkedList.DataLink head = location.header;\n\n\n while (head.nextDataLink != null) {\n //runs until next data link is null and gets each Actor\n Actor actor = (Actor) head.nextDataLink.data;\n //checks for a match\n if (actor.getNationality().toLowerCase().equals(hNat)) {\n //if it matches, return the location\n return location;\n //or else move on\n } else {\n head = head.nextDataLink;\n }\n }\n //if no match return null\n return null;\n\n\n }", "private Resolution getVocabularyConceptResolution() {\r\n HttpServletRequest httpRequest = getContext().getRequest();\r\n String url = httpRequest.getRequestURL().toString();\r\n // String query = httpRequest.getQueryString();\r\n \r\n String[] parameters = StringUtils.split(StringUtils.substringAfter(url, \"/vocabulary/\"), \"/\");\r\n \r\n if (parameters.length >= 2) {\r\n if (!RESERVED_VOCABULARY_EVENTS.contains(parameters[1])) {\r\n RedirectResolution resolution = new RedirectResolution(VocabularyConceptActionBean.class, \"view\");\r\n resolution.addParameter(\"vocabularyFolder.identifier\", parameters[0]);\r\n resolution.addParameter(\"vocabularyConcept.identifier\", parameters[1]);\r\n resolution.addParameter(\"vocabularyFolder.workingCopy\", vocabularyFolder.isWorkingCopy());\r\n \r\n return resolution;\r\n }\r\n }\r\n \r\n return null;\r\n }", "private void processConcept() {\r\n Concept currentConcept = (Concept) concepts.takeOut();\r\n if (currentConcept != null) {\r\n currentTerm = currentConcept.getTerm();\r\n concepts.putBack(currentConcept); // current Concept remains in the bag all the time\r\n currentConcept.fire(); // a working cycle\r\n }\r\n }", "public E first() {\n if (this.isEmpty()) return null;\r\n return this.head.getElement();\r\n }", "List<String> getModalities(Observation obs);", "public Optional<Scope<D>> findLatestScope(String symbol) {\n return stream()\n .filter(scope -> scope.contains(symbol))\n .findFirst();\n }", "public WorldObject getFirstObject(){\r\n\t\treturn this.firstObject;\r\n\t}", "public VectorItem<O> firstVectorItem()\r\n {\r\n if (isEmpty()) return null; \r\n return first;\r\n }", "@Override\n\tpublic Point3D findFirstIntersect(Ray3D ray) {\n\t\tPoint3D p = plane.findFirstIntersect(ray);\n\t\tif(isOnSurface(p))\n\t\t\treturn p;\n\t\telse\n\t\t\treturn Point3D.nullVal;\n\t}", "public static SpObsComp findConflictingObsComp(SpItem parent,\n SpObsComp spObsComp) {\n // See if this obs comp must be unique a scope.\n // If not, nothing can conflict with it.\n if (!spObsComp.mustBeUnique()) {\n return null;\n }\n\n // Evaluate the scope to see whether a component of the given subtype\n // already exists at this scope.\n SpType type = spObsComp.type();\n SpObsComp oc = SpTreeMan.findObsCompSubtype(parent, type);\n\n // If the component is the same object (identical object ref) as the\n // one being inserted, then there is no conflict.\n if (oc == spObsComp) {\n return null;\n }\n\n // If there already is a component of this exact subtype, then there\n // is a conflict.\n if (oc != null) {\n return oc;\n }\n\n // Now we know there was no component with the same subtype as the\n // new one. Unless the new component is an instrument, and there\n // is already an instrument in this scope, then there is no conflict.\n\n if (spObsComp instanceof SpInstObsComp) {\n return SpTreeMan.findInstrumentInContext(parent);\n }\n\n return null;\n }", "short qual_GetFirstOiList(short o)\r\n {\r\n if ((o & 0x8000) == 0)\r\n {\r\n qualOilPtr = -1;\r\n return (o);\r\n }\r\n if (o == -1)\r\n {\r\n return -1;\r\n }\r\n\r\n o &= 0x7FFF;\r\n qualOilPtr = o;\r\n qualOilPos = 0;\r\n return qual_GetNextOiList();\r\n }", "public Object getFirst()\n {\n if (first == null)\n {\n throw new NoSuchElementException();\n }\n else\n return first.getValue();\n }", "private AnnotationMirror findDependent(Element element) {\n List<TypeCompound> tas = ((Symbol) element).getRawTypeAttributes();\n for (TypeCompound ta : tas) {\n if (ta.getAnnotationType().toString().equals(Dependent.class.getCanonicalName())) {\n return ta;\n }\n }\n return null;\n }", "private List<ConceptMinimal> getConceptMinimalList(String id, Terminology terminology)\n throws JsonMappingException, JsonProcessingException {\n Optional<ElasticObject> esObject = getElasticObject(id, terminology);\n if (!esObject.isPresent()) {\n return Collections.<ConceptMinimal> emptyList();\n }\n\n return esObject.get().getConceptMinimals();\n }", "private Student getStudentByID(String sid) {\n\t\tfor(Student student: students) {\r\n\t\t\t//no need to check for null as Array list is dynamic and \r\n\t\t\tif(student.getStudentId().equals(sid)) {\r\n\t\t\t\treturn student;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//return null if sid was not found\r\n\t\treturn null;\r\n\t}", "public AnyType find(AnyType x) {\n\t\treturn elementAt(find(x, root));\n\t}", "public CourseReading get(String key) throws NoSuchElementException {\n\t\tif (containsKey(key) == true) {\r\n\t\t\tint HashKey = key.hashCode() % 31;\r\n\t\t\tif (HashKey > K.length - 1) {\r\n\t\t\t\twhile (HashKey > K.length - 1) {\r\n\t\t\t\t\tHashKey %= K.length;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (String c : K[HashKey]) {\r\n\t\t\t\tif (c.equals(key)) {\r\n\t\t\t\t\treturn V[HashKey].get(K[HashKey].indexOf(key));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public Set<Individual> getFiller(Role role, Concept concept, Individual ind) {\n\t\tTList<T> current = this.getRoot();\n\t\tSet<Individual> candidateRoles = new HashSet<>();\n\t\tSet<Individual> candidateInds = new HashSet<>();\n\t\twhile (current != null) {\n\t\t\tAssertion aValue = current.getValue();\n\t\t\tif (aValue instanceof RoleAssertion) {\n\t\t\t\tRoleAssertion ra = (RoleAssertion) aValue;\n\t\t\t\tDLElement el = ra.getElement();\n\t\t\t\tif (role.equals(el) && ind.equals(ra.getIndividualA()))\n\t\t\t\t\tcandidateRoles.add(ra.getIndividualB());\n\t\t\t} else if (aValue instanceof ConceptAssertion) {\n\t\t\t\tif (concept.equals(aValue.getElement()))\n\t\t\t\t\tcandidateInds.add(aValue.getIndividualA());\n\t\t\t}\n\t\t\tcurrent = current.getNext();\n\t\t}\n\t\t//find individuals\n\t\tcandidateInds.retainAll(candidateRoles);\n\t\treturn candidateInds;\n\t}", "default List<String> assignedConcepts(Location locatedUnit, int topK){\n final UnitLocation unitLocation = (UnitLocation) Objects.requireNonNull(locatedUnit);\n final Set<Location> irrelevantSet = generateIrrelevantSet(unitLocation);\n\n return interestingConcepts(topK, unitLocation, irrelevantSet);\n }", "Sym lookupLocal(String name) throws EmptySymTableException {\n\n\t\tfirstMap = list.getFirst(); // First hashmap in list\n\n\t\t// if SymTable's list empty, throw Empty\n\t\tif (list.isEmpty()) {\n\t\t\tthrow new EmptySymTableException();\n\t\t} else { // else, if the first HashMap in list contains name as key\n\t\t\tsym = firstMap.get(name);// return associated sym\n\t\t}\n\t\treturn sym;\n\t}", "public O get(int index)\r\n {\r\n if (index >= count || index < 0) return null;\r\n \r\n if (index > count/2)\r\n {\r\n //search from the end\r\n VectorItem<O> vi = last;\r\n for (int i=count-1;i>index;i--)\r\n {\r\n vi = vi.getPrevious();\r\n }\r\n return vi.getObject(); \r\n \r\n } else\r\n {\r\n //search from the beginning\r\n VectorItem<O> vi = first;\r\n \r\n for (int i=0;i<index;i++)\r\n {\r\n vi = vi.getNext();\r\n }\r\n return vi.getObject(); \r\n }\r\n }", "public Student searchStudent(String id) {\n\t\tfor (String key : list.keySet()) {\n\t\t\tif(id.equals(key))\n\t\t\t\treturn list.get(key);\n\t\t}\n\t\treturn null;\n\t}", "protected Relation findExistingRelation(String reqInfoId, String partyId, NbaTXLife nbaTXLife) {\n \tOLifE olife = nbaTXLife.getOLifE(); \n Relation relation = null;\n int relationCount = olife.getRelationCount();\n for (int index = 0; index < relationCount; index++) {\n relation = olife.getRelationAt(index);\n if (reqInfoId.equals(relation.getOriginatingObjectID()) && partyId.equals(relation.getRelatedObjectID())) {\n return relation;\n }\n }\n return null;\n }", "public static <T extends Annotation> Optional<T> findFirst(String annoTypeName,\n Collection<T> coll) {\n assert (!annoTypeName.isBlank());\n return coll.stream()\n .filter(it -> it.typeName().name().equals(annoTypeName))\n .findFirst();\n }", "public static CalculationResultMap lastObs(Concept concept, Collection<Integer> cohort, PatientCalculationContext context) {\n ObsForPersonDataDefinition def = new ObsForPersonDataDefinition(\"last obs\", TimeQualifier.LAST, concept, context.getNow(), null);\n return MentalHealthConfigCalculationUtils.evaluateWithReporting(def, cohort, null, null, context);\n }", "public Optional<Waste> getWasteById(String oid) {\n return Optional.fromNullable(wastes.get().findOne(new ObjectId(oid)).as(Waste.class));\n }", "Optional<CoreLabelSequence> getGroupedByFirstLabel(CoreLabel label);", "public E first() {\n\r\n if (head == null) {\r\n return null;\r\n } else {\r\n return head.getItem();\r\n }\r\n\r\n }" ]
[ "0.5761497", "0.5560187", "0.5521394", "0.5383434", "0.5360984", "0.5330298", "0.5288472", "0.51673263", "0.5161279", "0.5144387", "0.5140436", "0.50394946", "0.4998132", "0.49879074", "0.49787405", "0.49309", "0.4899175", "0.48889568", "0.48758575", "0.48758575", "0.48751277", "0.48265898", "0.48136532", "0.48123157", "0.48091775", "0.4790179", "0.4786852", "0.47829887", "0.47667557", "0.4762016", "0.4721329", "0.46985957", "0.4664434", "0.46607378", "0.46584934", "0.46540678", "0.46271342", "0.46250904", "0.46248794", "0.462338", "0.46045217", "0.4600269", "0.45947513", "0.4585578", "0.45842174", "0.4536358", "0.45355922", "0.45326287", "0.4525491", "0.45247298", "0.45237255", "0.4520667", "0.451797", "0.451615", "0.45154038", "0.4513618", "0.45112717", "0.447988", "0.44791618", "0.4478605", "0.44753724", "0.44721165", "0.44672847", "0.44628438", "0.4461009", "0.4459998", "0.44548246", "0.44503722", "0.44471982", "0.44377455", "0.44367155", "0.44366056", "0.44288337", "0.44262254", "0.441204", "0.44107893", "0.4408435", "0.44073722", "0.4406012", "0.4403461", "0.44032207", "0.4399239", "0.43971363", "0.4396818", "0.43896452", "0.43868923", "0.43757263", "0.4374929", "0.4369024", "0.43685347", "0.43684235", "0.43682095", "0.43661714", "0.43653163", "0.43609875", "0.4360135", "0.43586287", "0.43554893", "0.43554354", "0.43489733" ]
0.71822035
0
Gets the antiretroviral regimens for a current patient
public static List<Regimen> getAntiretroviralRegimens(Patient patient) { if (patient == null) { return null; } return RegimenUtils.getHivRegimenHistory(patient).getAllRegimens(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Ant> getAnts()\n {\n return ants;\n }", "@Override\n\tpublic List<Patientstreatments> getallpatienttreat() {\n\t\treturn patreatrep.findAll();\n\t}", "public ArrayList<Patient> getPatients() {\n return this.patients;\n }", "public Ant[] getAnts() {\n\t\treturn this.Ants;\n\t}", "public String[] getPatternsAnt() {\n return this.patternsAnt;\n }", "public List<Patient> listAllPatient() {\n\t\treturn null;\n\t}", "Reference getPatient();", "@Override\r\n\tpublic void getRegimeAlimentaire() {\n\t\t\r\n\t}", "public int[] getAttenuator() {\n return localAttenuator;\n }", "public List<Patient> getFHIR() {\n IGenericClient client;\n FhirContext ctx;\n ctx = FhirContext.forDstu3();\n ctx.setRestfulClientFactory(new OkHttpRestfulClientFactory(ctx));\n client = ctx.newRestfulGenericClient(\"http://fhirtest.uhn.ca/baseDstu3\");\n\n // .lastUpdated(new DateRangeParam(\"2011-01-01\",\"2018-11-25\")) - to get latest data\n // Not used since unable to get proper records with names\n Bundle bundle = client.search().forResource(Patient.class)\n .where(Patient.NAME.isMissing(false))\n .and(Patient.BIRTHDATE.isMissing(false))\n .and(Patient.GENDER.isMissing(false))\n .sort().ascending(Patient.NAME)\n .count(10)\n .returnBundle(Bundle.class)\n .execute();\n return BundleUtil.toListOfResourcesOfType(ctx, bundle, Patient.class);\n }", "public int antall() {\n return antall;\n }", "@SystemAPI\n\tPatient getPatient();", "public Reference patient() {\n return getObject(Reference.class, FhirPropertyNames.PROPERTY_PATIENT);\n }", "public void showAnts() {\n\t\tfor (int i = 0; i < this.getNumberOfAnts(); i++) {\n\t\t\tSystem.out.println(this.getAnt(i));\n\t\t}\n\t}", "public String getPatientResponses(){\n \treturn patientResponses;\n }", "@Override\n\tpublic long getRegantes() {\n\t\treturn model.getRegantes();\n\t}", "public List<AntCall> getAntCalls()\n {\n return antCalls;\n }", "public String[] getPatternsAntExc() {\n return this.patternsAntExc;\n }", "public abstract List<Patient> getAllPatientNode();", "public Ant getAnt()\r\n\t{\r\n\t\treturn ant;\r\n\t}", "public List<?> getAllPatientState()\n {\n return _patient.getPatientStates();\n }", "@GET(PATIENT_PATH)\n\tPatient getCurrentPatient();", "public IRAT getIraT() {\n\t\treturn iraT;\n\t}", "public Ant getAnt() {\r\n\t\treturn this.ant;\r\n\t}", "public void getAngajati() {\n\t\tList<Angajat> angajatiWithSalary = angajatOperations.getAngajatiBySalaryCondition();\n\t\tangajatOperations.printListOfAngajati(angajatiWithSalary);\n\t}", "public double[] getPrimaryReinforcements() { \r\n return r;\r\n }", "public String[] getAlergias() {\n return Alergias;\n }", "public Object[] getGlobalResourceARList() {\n return this.getList(AbstractGIS.INQUIRY_GLOBAL_RESOURCE_AR_LIST);\n }", "public ArrayList<Patient> getVerificationRequests()\n {\n return accountsToVerify;\n }", "@Override\n\tpublic List<Equipment> getAllAviableEquipmet() {\n\t\treturn dao.getAllAviableEquipmet();\n\t}", "public com.walgreens.rxit.ch.cda.POCDMT000040Guardian[] getGuardianArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n java.util.List targetList = new java.util.ArrayList();\n get_store().find_all_element_users(GUARDIAN$22, targetList);\n com.walgreens.rxit.ch.cda.POCDMT000040Guardian[] result = new com.walgreens.rxit.ch.cda.POCDMT000040Guardian[targetList.size()];\n targetList.toArray(result);\n return result;\n }\n }", "@Override\n\tpublic List<Etudiant> getAllEtudiants() {\n\t\treturn this.etudiantDao.getAllEtudiants();\n\t}", "public double getManaRegen() \r\n\t{\treturn this.manaRegen;\t}", "public com.vsp.bl.product.dto.coverage.v002.PatientRelationship[] getPatientRelationships() {\n return patientRelationships;\n }", "public List getGonePatients() {\n\t\treturn _gonePatients;\n\t}", "public static int[] guthansEquipment() {\n return new int[]{\n Items.GUTHANS_HELM_4724,\n Items.GUTHANS_HELM_100_4904,\n Items.GUTHANS_HELM_75_4905,\n Items.GUTHANS_HELM_50_4906,\n Items.GUTHANS_HELM_25_4907,\n Items.GUTHANS_PLATEBODY_4728,\n Items.GUTHANS_PLATEBODY_100_4916,\n Items.GUTHANS_PLATEBODY_75_4917,\n Items.GUTHANS_PLATEBODY_50_4918,\n Items.GUTHANS_PLATEBODY_25_4919,\n Items.GUTHANS_CHAINSKIRT_4730,\n Items.GUTHANS_CHAINSKIRT_100_4922,\n Items.GUTHANS_CHAINSKIRT_75_4923,\n Items.GUTHANS_CHAINSKIRT_50_4924,\n Items.GUTHANS_CHAINSKIRT_25_4925,\n Items.GUTHANS_WARSPEAR_4726,\n Items.GUTHANS_WARSPEAR_100_4910,\n Items.GUTHANS_WARSPEAR_75_4911,\n Items.GUTHANS_WARSPEAR_50_4912,\n Items.GUTHANS_WARSPEAR_25_4913,\n Items.BERSERKER_RING_I_11773\n };\n }", "private Access getAvailableReg(Var3 variable) {\n Integer index = getVarIndex(variable);\n HashSet<Integer> description = addrDescriptor.get(index);\n if(!description.isEmpty()) {\n //take the first good register\n for(Integer i : description)\n return new Reg(getArmRegNum(i));\n }\n return null;\n }", "public org.hl7.fhir.ResourceReference[] getDeviceArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n java.util.List targetList = new java.util.ArrayList();\n get_store().find_all_element_users(DEVICE$12, targetList);\n org.hl7.fhir.ResourceReference[] result = new org.hl7.fhir.ResourceReference[targetList.size()];\n targetList.toArray(result);\n return result;\n }\n }", "public java.util.Enumeration getAntennes() throws java.rmi.RemoteException, javax.ejb.FinderException, javax.naming.NamingException {\n\n instantiateEJB();\n return ejbRef().getAntennes();\n }", "public static int[][] antPositions()\r\n\t{\r\n\t\tint[][] positions = new int[Board.numberOfAnts][2];\r\n\t\t\r\n\t\tfor (int i = 0; i < Board.numberOfAnts; i++)\r\n\t\t{\r\n\t\t\tpositions[i] = Board.antScanner();\r\n\t\t}\r\n\t\tBoard.rowScan = 0;\r\n\t\tBoard.colScan = 0;\r\n\t\treturn positions;\r\n\t}", "public String getAnserTelphone() {\r\n return anserTelphone;\r\n }", "private String getReg ( String reg ) throws EVASyntaxException\r\n\t{\r\n\t\tString actual = reg;\r\n\t\tif ( reg.charAt(0) != '$' )\r\n\t\t{\r\n\t\t\t\t\t\tthrow ( new EVASyntaxException (\r\n\t\t\t\"Register must start with dollar sign\" ) );\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t//quitar el dolar\r\n\t\t\tactual = actual.substring(1,actual.length());\r\n\t\t}\r\n\t\tif ( actual.substring(0,2).equalsIgnoreCase(\"ra\") )\r\n\t\t{\r\n\t\t\treturn ra;\r\n\t\t}\r\n\t\telse if ( actual.charAt(0) == 'r' )\r\n\t\t{\r\n\t\t\t//quitar la r\r\n\t\t\tactual = actual.substring(1,actual.length());\r\n\t\t\t//a ve si es numero\r\n\t\t\tint regnum;\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tregnum = Integer.valueOf(actual).intValue();\r\n\t\t\t\treturn r[regnum];\r\n\t\t\t}\r\n\t\t\tcatch ( NumberFormatException NumExc )\r\n\t\t\t{\r\n\t\t\t\tthrow( new EVASyntaxException(\"Wrong register format\"));\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if ( actual.charAt(0) == 'v' )\r\n\t\t{\r\n\t\t\t//quitar la v\r\n\t\t\tactual = actual.substring(1,actual.length());\r\n\t\t\t//a ve si es numero\r\n\t\t\tint regnum;\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tregnum = Integer.valueOf(actual).intValue();\r\n\t\t\t\treturn v[regnum];\r\n\t\t\t}\r\n\t\t\tcatch ( NumberFormatException NumExc )\r\n\t\t\t{\r\n\t\t\t\tthrow( new EVASyntaxException(\"Wrong register format\"));\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if ( actual.charAt(0) == 'a' )\r\n\t\t{\r\n\t\t\t//quitar la r\r\n\t\t\tactual = actual.substring(1,actual.length());\r\n\t\t\t//a ve si es numero\r\n\t\t\tint regnum;\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tregnum = Integer.valueOf(actual).intValue();\r\n\t\t\t\treturn a[regnum];\r\n\t\t\t}\r\n\t\t\tcatch ( NumberFormatException NumExc )\r\n\t\t\t{\r\n\t\t\t\tthrow( new EVASyntaxException(\"Wrong register format\"));\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if ( actual.substring(0,3).equalsIgnoreCase(\"exc\") )\r\n\t\t{\r\n\t\t\treturn exc;\r\n\t\t}\r\n\t\telse if ( actual.substring(0,3).equalsIgnoreCase(\"obj\") )\r\n\t\t{\r\n\t\t\treturn obj;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow( new EVASyntaxException(\"Wrong register format\"));\r\n\t\t}\r\n\t}", "public List<ACR> getAcrs() {\n return acrs;\n }", "public ArrayList<String> getAnalytes() {\n ArrayList<String> analytes = new ArrayList<>();\n getData(analytes, \"getAnalytes\");\n return analytes;\n }", "public org.hl7.fhir.ResourceReference getPatient()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.ResourceReference target = null;\n target = (org.hl7.fhir.ResourceReference)get_store().find_element_user(PATIENT$2, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }", "public Ant getAnt(int i) {\n\t\treturn Ants[i];\n\t}", "public List<Patient> getPatients() {\n List<Patient> patients = new ArrayList<>();\n String query = \"SELECT * FROM PATIENTS\";\n try (PreparedStatement ps = this.transaction.prepareStatement(query); ResultSet rs = ps.executeQuery()) {\n while (rs.next()) {\n patients.add(new Patient(rs));\n }\n } catch (SQLException ex) {\n ex.printStackTrace(System.out);\n }\n\n return patients;\n }", "public List<Registery> getAllRegisteryItems() {\n\t\treturn allRegisteryItems;\n\t}", "public final FileMincAttElem[] getGattArray() {\r\n return gattArray;\r\n }", "public String[] getPatternsExc() {\n return getPatternType().equals(\"Ant\") ? this.patternsAntExc : this.patternsRegExExc;\n }", "public int getReg() {\n\t\treturn -1;\n\t}", "public byte getGoodPaternal() {\n if (paternal >= 0)\n return paternal; //not missing\n //missing\n //paternal genome does not have MT or X chromosome\n //works for male\n //TODO: for female, X is diploid, should not return -1\n if (chr.isMT() || chr.isX()) {\n return (byte) -1;\n }\n /*when Y or autosomal\n we try return a correct one\n however there is no guarantee that only one ALT is present\n */\n return (byte) (Math.min(1, alts.length));\n }", "public static ResultSet getPatientArtRegimen(Connection conn, Long patientId) throws ServletException {\r\n\t\tResultSet rs = null;\r\n\t\ttry {\r\n\t\t\t\tString sql = \"SELECT encounter.id AS id, regimen.code AS code, regimen.name AS name, regimen.id AS regimenId \"\r\n\t\t\t\t\t+ \"FROM art_regimen, encounter, regimen \"\r\n\t\t\t\t\t+ \"WHERE encounter.id = art_regimen.id \"\r\n\t\t\t\t\t+ \"AND art_regimen.regimen_1 = regimen.id \"\r\n\t\t\t\t\t+ \"AND encounter.patient_id = ? \"\r\n\t\t\t\t\t+ \"ORDER BY encounter.id DESC\";\r\n\t\t\t\tPreparedStatement ps = conn.prepareStatement(sql);\r\n\t\t\t\tps.setMaxRows(1);\r\n\t\t\t\tps.setLong(1, patientId);\r\n\t\t\t\trs = ps.executeQuery();\r\n\t\t} catch (Exception ex) {\r\n\t\t\tlog.error(ex);\r\n\t\t}\r\n\t\treturn rs;\r\n\t}", "public List<Etudiant> getEtudiants() {\n\t\treturn etudiants;\n\t}", "public Administrator[] getAllAdmin()\n {\n return admin;\n }", "public String[] disponibilidad(){\n\t\tString[] devolucion = null;\n\t\tdevolucion = new String[almacen.length];\n\t\t\n\t\tfor (int i = 0; i < devolucion.length; i++) {\n\t\t\tif(almacen[i]!=null){\n\t\t\t\tdevolucion[i]=almacen[i].getEtiqueta();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn devolucion;\n\t}", "@Override\n\tpublic List<Patient> listOfPatients() {\n\t\treturn null;\n\t}", "public List getReCaseReportRegs(ReCaseReportReg reCaseReportReg);", "@SuppressWarnings(\"unchecked\")\n @ModelAttribute(\"patientIdentifierTypesAutoAssigned\")\n\tpublic List<PatientIdentifierType> getPatientIdentifierTypesAutoAssigned() {\n\t\tif(!ModuleFactory.getStartedModulesMap().containsKey(\"idgen\")) {\n\t\t\treturn new LinkedList<PatientIdentifierType>(); // return an empty list\n\t\t}\n\t\telse {\n\t\t\t// access the idgen module via reflection\n\t\t\ttry {\n\t\t\t\tClass identifierSourceServiceClass = Context.loadClass(\"org.openmrs.module.idgen.service.IdentifierSourceService\");\n\t\t\t\tObject idgen = Context.getService(identifierSourceServiceClass);\n\t\t\t\tMethod getPatientIdentifierTypesByAutoGenerationOption = identifierSourceServiceClass.getMethod(\"getPatientIdentifierTypesByAutoGenerationOption\", Boolean.class, Boolean.class);\n\t\t\t\t\n\t\t\t\treturn (List<PatientIdentifierType>) getPatientIdentifierTypesByAutoGenerationOption.invoke(idgen, false, true);\n\t\t\t}\n\t\t\tcatch(Exception e) {\n\t\t\t\tlog.error(\"Unable to access IdentifierSourceService for automatic id generation. Is the Idgen module installed and up-to-date?\", e);\n\t\t\t\treturn new LinkedList<PatientIdentifierType>(); // return an empty list\n\t\t\t}\n\t\t}\n\t}", "public static ArrayList<Allergy> findAll(Context iContext) throws MapperException\n {\n try\n {\n ArrayList<ArrayList<String>> wValuesTable = AllergiesTDG.selectAll(iContext);\n ArrayList<Allergy> wStoredAllergies = new ArrayList<Allergy>(wValuesTable.size());\n for (int i = 0; i < wValuesTable.size(); ++i)\n {\n ArrayList<String> values = wValuesTable.get(i);\n Allergy storedAllergy;\n Long id = Long.valueOf(values.get(0));\n String allergy = values.get(1);\n String reaction = values.get(2);\n String severity = values.get(3);\n\n storedAllergy = new Allergy(id, allergy, reaction, severity);\n wStoredAllergies.add(storedAllergy);\n }\n return wStoredAllergies;\n } \n catch (PersistenceException e)\n {\n throw new MapperException(\n \"The Mapper failed to obtain the Allergy readings from the persistence layer. The TDG returned the following error: \"\n + e.getMessage());\n } \n catch (Exception e)\n {\n throw new MapperException(\n \"The mapper failed to complete an operation for the following unforeseen reason: \"\n + e.getMessage());\n }\n }", "List<Registration> allRegTrail(long idTrail);", "public java.lang.String getPatientID(){\n return localPatientID;\n }", "public java.lang.String getPatientID(){\n return localPatientID;\n }", "public String[] getPatterns() {\n return getPatternType().equals(\"Ant\") ? this.patternsAnt : this.patternsRegEx;\n }", "public java.lang.String getNum_ant() throws java.rmi.RemoteException;", "PatientInfo getPatientInfo(int patientId);", "public CWE getRxa14_AdministeredStrengthUnits() { \r\n\t\tCWE retVal = this.getTypedField(14, 0);\r\n\t\treturn retVal;\r\n }", "public static Set<AT> getGoldOnlyAts() {\n if (removeLatAts) {\n return QSets.union(getPredAts(), getLatAts());\n } else {\n log.warn(\"CAUTION: The latent variable annotations have NOT been removed.\");\n return getPredAts();\n }\n }", "protected float[] getGenes() {\n\t\t\treturn genes;\n\t\t}", "public CWE[] getSubstanceTreatmentRefusalReason() {\r\n \tCWE[] retVal = this.getTypedField(18, new CWE[0]);\r\n \treturn retVal;\r\n }", "public List<Entry> getAllLiterature() {\n List<Entry> allLiterature = new ArrayList<>();\n for (Entry l : litRegister) {\n allLiterature.add(l);\n }\n return allLiterature;\n }", "public List<Enseignant> getAllEnseignant() {\n\t\treturn (List<Enseignant>) enseignantRepository.findAll();\n\t}", "public FSArray getIndividualRec() {\n if (GEDCOMType_Type.featOkTst && ((GEDCOMType_Type)jcasType).casFeat_individualRec == null)\n jcasType.jcas.throwFeatMissing(\"individualRec\", \"net.myerichsen.gedcom.GEDCOMType\");\n return (FSArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((GEDCOMType_Type)jcasType).casFeatCode_individualRec)));}", "public String[] getRegisters() {\r\n return scope != null? scope.getRegisters() : null;\r\n }", "public String getRegBasedAuthority() {\n return m_regAuthority;\n }", "public String getPatientSex(){\n\t\treturn patientSex;\n\t}", "public String getPatientId()\n {\n return patientId;\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic List<TypeRia> touslesTypeRIA() {\n\t\tList<TypeRia> T = em.createQuery(\"from TypeRia t\").getResultList();\n\t\treturn T;\n\t}", "public int getPatientId() {\n\t\t\n\t\treturn this.patientId;\n\t}", "public String annulerRv(){\n\t\t// Traitement ici ... \n\t\treturn AFFICHER;\n\t}", "public String getPatientId(){\n\t\treturn patientId;\n\t}", "public String[] getAnweisung() {\n return anweisung;\n }", "public List<Residence> getAllResidence()\n {\n return em.createNamedQuery(FIND_ALL_RESIDENCE, Residence.class).getResultList();\n }", "public CWE[] getRxa18_SubstanceTreatmentRefusalReason() {\r\n \tCWE[] retVal = this.getTypedField(18, new CWE[0]);\r\n \treturn retVal;\r\n }", "public Set<ApptransRegRel> getApptransRegRel() {\n return apptransRegRel;\n }", "public Antecedent[] getAntecedents() {\n\t\treturn mAntecedents;\n\t}", "public BloodType getPatientBloodType() {\r\n\t\treturn bloodtype;\r\n\t}", "public final String[] getRiviAsteikko() {\r\n return riviAsteikko;\r\n }", "public int getNumberOfPatients() {\n return numberOfPatients;\n }", "public int GeneralRegCount() { return GENERAL_REG_COUNT; }", "public ArrayList<Human> getResidents(){\n return this.residents;\n }", "public static EList<PertussisTreatmentNotGivenSubstanceAdministration> getPertussisTreatmentNotGivenSubstanceAdministrations(PertussisTherapeuticRegimenAct pertussisTherapeuticRegimenAct) {\r\n\t\tif (GET_PERTUSSIS_TREATMENT_NOT_GIVEN_SUBSTANCE_ADMINISTRATIONS__EOCL_QRY == null) {\r\n\t\t\tOCL.Helper helper = EOCL_ENV.createOCLHelper();\r\n\t\t\thelper.setOperationContext(PertussisPackage.Literals.PERTUSSIS_THERAPEUTIC_REGIMEN_ACT, PertussisPackage.Literals.PERTUSSIS_THERAPEUTIC_REGIMEN_ACT.getEAllOperations().get(64));\r\n\t\t\ttry {\r\n\t\t\t\tGET_PERTUSSIS_TREATMENT_NOT_GIVEN_SUBSTANCE_ADMINISTRATIONS__EOCL_QRY = helper.createQuery(GET_PERTUSSIS_TREATMENT_NOT_GIVEN_SUBSTANCE_ADMINISTRATIONS__EOCL_EXP);\r\n\t\t\t}\r\n\t\t\tcatch (ParserException pe) {\r\n\t\t\t\tthrow new UnsupportedOperationException(pe.getLocalizedMessage());\r\n\t\t\t}\r\n\t\t}\r\n\t\tOCL.Query query = EOCL_ENV.createQuery(GET_PERTUSSIS_TREATMENT_NOT_GIVEN_SUBSTANCE_ADMINISTRATIONS__EOCL_QRY);\r\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t\tCollection<PertussisTreatmentNotGivenSubstanceAdministration> result = (Collection<PertussisTreatmentNotGivenSubstanceAdministration>) query.evaluate(pertussisTherapeuticRegimenAct);\r\n\t\treturn new BasicEList.UnmodifiableEList<PertussisTreatmentNotGivenSubstanceAdministration>(result.size(), result.toArray());\r\n\t}", "public Match[] getMale32Winners() {\n return thirt;\n }", "public int antall();", "public static EList<PertussisTreatmentGivenSubstanceAdministration> getPertussisTreatmentGivenSubstanceAdministrations(PertussisTherapeuticRegimenAct pertussisTherapeuticRegimenAct) {\r\n\t\tif (GET_PERTUSSIS_TREATMENT_GIVEN_SUBSTANCE_ADMINISTRATIONS__EOCL_QRY == null) {\r\n\t\t\tOCL.Helper helper = EOCL_ENV.createOCLHelper();\r\n\t\t\thelper.setOperationContext(PertussisPackage.Literals.PERTUSSIS_THERAPEUTIC_REGIMEN_ACT, PertussisPackage.Literals.PERTUSSIS_THERAPEUTIC_REGIMEN_ACT.getEAllOperations().get(63));\r\n\t\t\ttry {\r\n\t\t\t\tGET_PERTUSSIS_TREATMENT_GIVEN_SUBSTANCE_ADMINISTRATIONS__EOCL_QRY = helper.createQuery(GET_PERTUSSIS_TREATMENT_GIVEN_SUBSTANCE_ADMINISTRATIONS__EOCL_EXP);\r\n\t\t\t}\r\n\t\t\tcatch (ParserException pe) {\r\n\t\t\t\tthrow new UnsupportedOperationException(pe.getLocalizedMessage());\r\n\t\t\t}\r\n\t\t}\r\n\t\tOCL.Query query = EOCL_ENV.createQuery(GET_PERTUSSIS_TREATMENT_GIVEN_SUBSTANCE_ADMINISTRATIONS__EOCL_QRY);\r\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t\tCollection<PertussisTreatmentGivenSubstanceAdministration> result = (Collection<PertussisTreatmentGivenSubstanceAdministration>) query.evaluate(pertussisTherapeuticRegimenAct);\r\n\t\treturn new BasicEList.UnmodifiableEList<PertussisTreatmentGivenSubstanceAdministration>(result.size(), result.toArray());\r\n\t}", "public ArrayList<String> getAlllectureAttendance() {\n\t\tArrayList<String> attendance_lecture = new ArrayList<String>();\n\t\t// Select All Query\n\t\tString selectQuery = \"SELECT DISTINCT \" + KEY_LECTURE_NUM_ATTENDANCE\n\t\t\t\t+ \" FROM \" + TABLE_TEACHER_ATTENDANCE;\n\t\tCursor cursor = db.rawQuery(selectQuery, null);\n\n\t\t// looping through all rows and adding to list\n\t\tcursor.moveToFirst();\n\t\twhile (cursor.isAfterLast() == false) {// Adding contact to list\n\t\t\tattendance_lecture.add(cursor.getString(cursor\n\t\t\t\t\t.getColumnIndex(KEY_LECTURE_NUM_ATTENDANCE)));\n\t\t\tLog.d(\"lecture_num\", cursor.getString(cursor\n\t\t\t\t\t.getColumnIndex(KEY_LECTURE_NUM_ATTENDANCE)));\n\t\t\tcursor.moveToNext();\n\t\t}\n\t\tcursor.close();\n\t\t// return contact list\n\t\treturn attendance_lecture;\n\t}", "public java.lang.String getRegaddress() {\r\n return localRegaddress;\r\n }", "public Integer getRegbyid()\n {\n return regbyid; \n }", "@Override\n @Transactional\n public List<Patient> allPatients() {\n return patientDAO.allPatients();\n }", "public Turret[] getTurretsOnStage(){\n\t\treturn this.turrets;\n\t}" ]
[ "0.5772469", "0.5765891", "0.5590592", "0.5541417", "0.543835", "0.54057723", "0.53950775", "0.5346555", "0.5328192", "0.52412784", "0.52203745", "0.5206543", "0.5158511", "0.5151448", "0.5148062", "0.51128983", "0.51115316", "0.51029575", "0.5088516", "0.5076173", "0.5057593", "0.5044188", "0.50400174", "0.50362617", "0.5028483", "0.5004592", "0.49552852", "0.49360013", "0.49180147", "0.4878023", "0.48658052", "0.48550552", "0.48283863", "0.48168305", "0.48155135", "0.48062047", "0.48027736", "0.4800961", "0.47961852", "0.4792733", "0.4776233", "0.47672057", "0.47599438", "0.47564948", "0.47437105", "0.4741888", "0.47398096", "0.47343317", "0.47251874", "0.4711985", "0.47008783", "0.4683255", "0.46715826", "0.46387127", "0.4631104", "0.46235842", "0.4613598", "0.46017137", "0.45982546", "0.45965308", "0.45863333", "0.45821533", "0.45821533", "0.45718473", "0.4561105", "0.4550856", "0.4544689", "0.45434505", "0.4537291", "0.45234796", "0.4518407", "0.4510733", "0.4506652", "0.45035833", "0.44917876", "0.44906503", "0.44867417", "0.44855765", "0.44852936", "0.44844148", "0.44746786", "0.4469947", "0.44670388", "0.44633067", "0.44606915", "0.44514394", "0.4450346", "0.4444199", "0.44431657", "0.44427225", "0.4432526", "0.44316635", "0.4430846", "0.44258544", "0.44253534", "0.44247937", "0.44222853", "0.44217783", "0.44197553", "0.4414949" ]
0.7980375
0
Returns a set of all encounter types associated with the MDRTB Program
public static Set<EncounterType> getMdrtbEncounterTypes() { Set<EncounterType> types = new HashSet<EncounterType>(); types.add(Context.getEncounterService().getEncounterType(Context.getAdministrationService().getGlobalProperty("mdrtb.intake_encounter_type"))); types.add(Context.getEncounterService().getEncounterType(Context.getAdministrationService().getGlobalProperty("mdrtb.follow_up_encounter_type"))); types.add(Context.getEncounterService().getEncounterType(Context.getAdministrationService().getGlobalProperty("mdrtb.specimen_collection_encounter_type"))); return types; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Set<Type> getBiomeTypes() {\n\t\ttry {\n\t\t\tfinal Field accessor = ReflectionHelper.findField(BiomeDictionary.Type.class, \"byName\");\n\t\t\tif (accessor != null) {\n\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\tfinal Map<String, BiomeDictionary.Type> stuff = (Map<String, BiomeDictionary.Type>) accessor.get(null);\n\t\t\t\treturn new ReferenceOpenHashSet<>(stuff.values());\n\t\t\t}\n\n\t\t\treturn ImmutableSet.of();\n\n\t\t} catch (final Throwable t) {\n\t\t\tthrow new RuntimeException(\"Cannot locate BiomeDictionary.Type table!\");\n\t\t}\n\n\t}", "public Set getTypeSet()\n {\n Set set = new HashSet();\n\n Iterator it = attTypeList.keySet().iterator();\n while (it.hasNext())\n {\n // Get key\n Object attrName = it.next();\n Object type = attTypeList.get(attrName);\n set.add(type);\n }\n return set;\n }", "public synchronized static Set<String> getAvailableTypes() {\n populateCache();\n return Collections.unmodifiableSet(cache.keySet());\n }", "Set<String> getBaseTypes();", "public List<SecTyp> getAllTypes();", "public Type[] types();", "Map<ParameterInstance, SetType> getInstanceSetTypes();", "List<ReportType> findTypes();", "synchronized public Map<String, Set<String>> getTypes() {\n return Collections.unmodifiableMap(\n new HashSet<>(types.entrySet()).stream()\n .collect(Collectors.toMap(\n Map.Entry::getKey,\n e -> Collections.unmodifiableSet(new HashSet<>(e.getValue()))\n ))\n );\n }", "public List getCourseTypes() throws ULMSSysException\r\n {\r\n return codeMaintainDAO.getCourseTypes();\r\n }", "public List<ReportType> getEntries(){\n\t\tList<ReportType> reportTypes = new ArrayList<>(warningList);\n\t\treportTypes.addAll(errorList);\n\t\treturn reportTypes;\n\t}", "public List<ContestType> getAllContestTypes() throws ContestManagementException {\n return null;\r\n }", "public List<ContestType> getAllContestTypes() throws ContestManagementException {\n return null;\r\n }", "public String[] getTypes() {\n/* 388 */ return getStringArray(\"type\");\n/* */ }", "UsedTypes getTypes();", "public Set<ResourceType> getAllResourceTypes() {\n parseExternalResources();\n Set<ResourceType> resourceTypes = new HashSet<ResourceType>();\n for (DatacollectionGroup group : externalGroupsMap.values()) {\n for (ResourceType rt : group.getResourceTypeCollection()) {\n if (!contains(resourceTypes, rt))\n resourceTypes.add(rt);\n }\n }\n return resourceTypes;\n }", "public static synchronized Set getDescriptorClasses() {\n\tHashSet set = new HashSet();\n\n for (Enumeration e = registryModes.elements(); e.hasMoreElements();) {\n RegistryMode mode = (RegistryMode)e.nextElement();\n\n\t set.add(mode.descriptorClass);\n\t}\n\n\treturn set;\n }", "public Iterator getTypes() {\r\n\t\treturn types == null ? EmptyStructures.EMPTY_ITERATOR : new ReadOnlyIterator(types.values());\r\n\t}", "private RoomType[] getRoomTypeStrings()\r\n\t{\r\n\t\treturn bCtrl.getAllRoomTypes().stream().toArray(RoomType[]::new);\r\n\t}", "ImmutableList<SchemaOrgType> getEncodingsList();", "public Collection getIndividualTypes(OWLIndividual individual, ReasonerTaskListener taskListener) throws DIGReasonerException;", "private Collection<TypeDeclaration> getAllTypes() {\n if (allTypes != null) {\n return allTypes;\n }\n allTypes = new ArrayList<TypeDeclaration>();\n for (Symbol s : getMembers(false)) {\n allTypes.add(env.declMaker.getTypeDeclaration((ClassSymbol) s));\n }\n return allTypes;\n }", "public String[] getAcceptedTypes() {\n\t\tLinkedList<String> typelist = new LinkedList<String>(acceptedEventTypes.keySet());\n\t\tCollections.sort(typelist);\n\t\tString[] result = new String[typelist.size()];\n\t\tint c = 0;\n\t\tfor (String t : typelist) {\n\t\t\tresult[c] = t;\n\t\t\tc++;\n\t\t}\n\t\treturn result;\n\t}", "Collection<RecordType> getRecordTypes() throws TypeException, InterruptedException;", "public String[] getTypes() {\n return impl.getTypes();\n }", "public Set<AlfClass> getSpecializations()\r\n\t{\treturn Collections.unmodifiableSet(this.specializations);\t}", "ImmutableList<SchemaOrgType> getEncodingList();", "List<Type> getAllTypeList();", "public Collection<DasType> getTypes() throws DataSourceException {\n Collection<DasType> types = new ArrayList<DasType>(5);\n types.add(new DasType(\"gene\", \"gene\", \"Gene description\"));\n types.add(new DasType(\"efv\", \"efv\", \"Experiment factor value\"));\n types.add(new DasType(\"exp\", \"exp\", \"Experiment\"));\n return types;\n }", "ImmutableList<SchemaOrgType> getInteractivityTypeList();", "public List<__Type> getTypes() {\n return (List<__Type>) get(\"types\");\n }", "Set<TokenType> tokenTypes();", "RegSet[] used() {\r\n RegSet[] used = new RegSet[code.length];\r\n for (int i = 0; i < code.length; i++) \r\n\tused[i] = code[i].used();\r\n return used;\r\n }", "public int[] getTypes(){\n int[] types={TYPE_STRING,TYPE_STRING,TYPE_STRING,TYPE_INT};\n return types;\n }", "private Collection<String> getTypes(final Collection<Passenger> passengers)\r\n {\r\n final List<String> types = new ArrayList<String>();\r\n for (final Passenger passenger : passengers)\r\n {\r\n types.add(passenger.getType().toString());\r\n }\r\n return types;\r\n }", "public int[] exceptionTypes();", "public Set<Type> usedTypes() {\n Set<Type> types = new HashSet<Type>();\n for (DexlibAbstractInstruction i : instructions) {\n types.addAll(i.introducedTypes());\n }\n\n if (tries != null) {\n for (TryBlock<? extends ExceptionHandler> tryItem : tries) {\n List<? extends ExceptionHandler> hList = tryItem.getExceptionHandlers();\n for (ExceptionHandler handler : hList) {\n String exType = handler.getExceptionType();\n if (exType == null) {\n // Exceptions\n continue;\n }\n types.add(DexType.toSoot(exType));\n }\n }\n }\n\n return types;\n }", "public List<Type> getAll();", "public List<String> getAvailableDataTypes() {\n Set<String> typeSet = new TreeSet<String>();\n\n ITimer timer = TimeUtil.getTimer();\n timer.start();\n\n try {\n for (Provider provider : DataDeliveryHandlers.getProviderHandler()\n .getAll()) {\n\n for (ProviderType type : provider.getProviderType()) {\n typeSet.add(type.getDataType().toString());\n }\n }\n } catch (RegistryHandlerException e) {\n statusHandler.handle(Priority.PROBLEM,\n \"Unable to retrieve the provider list.\", e);\n }\n\n List<String> typeList = new ArrayList<String>(typeSet);\n timer.stop();\n\n return typeList;\n }", "@Override\n\tpublic List<Coursetype> getAllCourseType() {\n\t\treturn courseTypeDaoImpl.getAllCourseType();\n\t}", "ImmutableList<SchemaOrgType> getLearningResourceTypeList();", "public final ArrayList<Application.ApplicationType> getApplicationTypes() {\n\n\t\t// TODO - check if it works\n\t\tList<String> list = JsUtils.listFromJsArrayString(JsUtils.getNativePropertyArrayString(this, \"applicationTypes\"));\n\t\tArrayList<Application.ApplicationType> result = new ArrayList<Application.ApplicationType>();\n\t\tfor (String s : list) {\n\t\t\tresult.add(Application.ApplicationType.valueOf(s));\n\t\t}\n\t\treturn result;\n\n\t}", "ImmutableList<SchemaOrgType> getEducationalUseList();", "public Set<String> getAvailableTypes() {\n return ApiSpecificationFactory.getTypes();\n }", "<T> Set<T> lookupAll(Class<T> type);", "public List<EnvironmentTypes> selectEnvironmentTypes() {\n\n\t\tList<EnvironmentTypes> customers = new ArrayList<EnvironmentTypes>();\n\t\tConnection connection = null;\n\t\tPreparedStatement preparedStatement = null;\n\t\tResultSet resultSet = null;\n\n\t\ttry {\n\n\t\t\tconnection = (Connection) DBConnection.getConnection();\n\t\t\tString sql = \"select * from environment_types\";\n\t\t\tpreparedStatement = (PreparedStatement) connection.prepareStatement(sql);\n\t\t\tresultSet = preparedStatement.executeQuery();\n\n\t\t\tEnvironmentTypes customer = null;\n\t\t\twhile (resultSet.next()) {\n\n\t\t\t\tcustomer = new EnvironmentTypes();\n\n\t\t\t\tcustomer.setName(resultSet.getString(1));\n\t\t\t\tcustomer.setDescription(resultSet.getString(2));\n\t\t\t\tcustomer.setAccept_tag(resultSet.getString(3));\n\t\t\t\tcustomer.setPromote_tag(resultSet.getString(4));\n\t\t\t\tcustomer.setAction(resultSet.getString(5));\n\t\t\t\tcustomer.setRestart_interval(resultSet.getInt(6));\n\t\t\t\tcustomer.setQuiet_period(resultSet.getInt(7));\n\n\t\t\t\tcustomers.add(customer);\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\tLOGGER.error(e.getMessage());\n\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tresultSet.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\tLOGGER.error(e.getMessage());\n\t\t\t}\n\t\t}\n\n\t\treturn customers;\n\t}", "public void computeTypeIds() {\n classes.add(null);\n jsonObjects.add(new JsonObject(program));\n \n // Do java.lang.String first to reserve typeId 1 for the mashup case.\n computeSourceClass(program.getTypeJavaLangString());\n assert (classes.size() == 2);\n \n /*\n * Compute the list of classes than can successfully satisfy cast\n * requests, along with the set of types they can be successfully cast to.\n * Do it in super type order.\n */\n for (Iterator it = program.getDeclaredTypes().iterator(); it.hasNext();) {\n JReferenceType type = (JReferenceType) it.next();\n if (type instanceof JClassType) {\n computeSourceClass((JClassType) type);\n }\n }\n \n for (Iterator it = program.getAllArrayTypes().iterator(); it.hasNext();) {\n JArrayType type = (JArrayType) it.next();\n computeSourceClass(type);\n }\n \n // pass our info to JProgram\n program.initTypeInfo(classes, jsonObjects);\n program.recordQueryIds(queryIds);\n }", "@Override\r\n\tpublic Vector<Integer> getTypes() {\n\t\treturn this.types;\r\n\t}", "public static synchronized Set<Map.Entry<Class<?>, String>> entrySet() {\n\t\treturn ClassRegistry.dictionary.entrySet();\n\t}", "@Override\r\n\tpublic List getCodeType() throws Exception {\n\t\treturn codeMasterService.getCodeType();\r\n\t}", "public Vector<String> getTaskTypes() {\r\n\t\tVector<String> v = new Vector<String>();\r\n\r\n\t\tfor (TaskType tt : taskTypes) {\r\n\t\t\tv.add(tt.name);\r\n\t\t}\r\n\r\n\t\treturn v;\r\n\t}", "private HashSet<String> getEventTypes(HLPetriNet hlPN) {\n\t\tHashSet<String> returnEvtTypes = new HashSet<String>();\n\t\tIterator<Transition> transitionsIt = hlPN.getPNModel().getTransitions()\n\t\t\t\t.iterator();\n\t\twhile (transitionsIt.hasNext()) {\n\t\t\tTransition transition = transitionsIt.next();\n\t\t\tif (transition.getLogEvent() != null) {\n\t\t\t\treturnEvtTypes.add(transition.getLogEvent().getEventType());\n\t\t\t}\n\t\t}\n\t\treturn returnEvtTypes;\n\t}", "public static java.util.Iterator<org.semanticwb.model.ResourceType> listResourceTypes()\r\n {\r\n java.util.Iterator it=sclass.listInstances();\r\n return new org.semanticwb.model.GenericIterator<org.semanticwb.model.ResourceType>(it, true);\r\n }", "List<CmdType> getSupportedTypes();", "public static List<String> typeOfTeam() {\n String[] types = { \"Mens\", \"Womens\", \"Co-ed\" };\n return java.util.Arrays.asList(types);\n }", "@Secured({ \"IS_AUTHENTICATED_ANONYMOUSLY\", \"ACL_SECURABLE_READ\" })\n Collection<QuantitationType> getQuantitationTypes( ExpressionExperiment expressionExperiment,\n ubic.gemma.model.expression.arrayDesign.ArrayDesign arrayDesign );", "public Set<OntologyScope> getRegisteredScopes();", "public Iterator getPortTypes() {\r\n\t\treturn portTypes == null ? EmptyStructures.EMPTY_ITERATOR : new ReadOnlyIterator(portTypes.values());\r\n\t}", "public interface Program {\n\n\t/**\n\t * The name of the string class\n\t */\n\tpublic static final String STRING_CLASS = \"String\";\n\n\t/**\n\t * The name of the object class\n\t */\n\tpublic static final String OBJECT_CLASS = \"Object\";\n\n\t/**\n\t * Yields an unmodifiable view of all the methods and constructors that are part\n\t * of the program to analyze.\n\t * \n\t * @return the collection of method and constructors\n\t */\n\tCollection<MCodeMember> getAllCodeMembers();\n\n\t/**\n\t * Yields an unmodifiable view of all the methods and constructors that are part\n\t * of the program to analyze, excluding ones from the String and Object classes.\n\t * \n\t * @return the collection of method and constructors\n\t */\n\tCollection<MCodeMember> getAllSubmittedCodeMembers();\n}", "public List<TransactionType> listESETransactionTypes();", "ImmutableList<SchemaOrgType> getCharacterList();", "public ArrayList<String> getTypes(){\n return this.types;\n }", "public static Set<Class<? extends OWLAxiomHGDB>> getLogicalAxiomTypesHGDB() {\r\n\t\treturn logicalAxiomTypesHGDB;\r\n\t}", "public Set<PrepType> valid() {\n Set<PrepType> types = prep.types().stream()\n .filter(type -> !type.isEmpty())\n .map(PrepType::fromString)\n .collect(Collectors.toSet());\n if (types.contains(PrepType.TO)) {\n types.addAll(PrepType.to());\n }\n return types;\n }", "public List<TypeInfo> getTypes() {\r\n return types;\r\n }", "public List<String> getResourceTypes(){\n\t\treturn jtemp.queryForList(\"SELECT resource_type_id||' '||resource_type_name FROM resource_type\", String.class);\n\t}", "public String[] getInputTypes() {\n\t\tString[] types = {\"ncsa.d2k.modules.projects.mbabbar.optimize.ga.IGANsgaPopulation\"};\n\t\treturn types;\n\t}", "public static List<IEssence> getRegisteredEssences() {\n ArrayList<IEssence> essences = new ArrayList();\n MagicStaffs.ITEMS\n .stream()\n .filter(item -> item instanceof IEssence)\n .forEach(item -> essences.add((IEssence) item));\n return essences;\n }", "public static ArrayList<ExamType> getAllExamTypes() {\n String querySQL = \"select * from exam_type where status0 = 'Active'\";\n PreparedStatement pStmt = null;\n try {\n pStmt = globalCon.prepareStatement(querySQL);\n ResultSet result = pStmt.executeQuery();\n ArrayList<ExamType> examTypes = new ArrayList<>();\n while (result.next()) {\n String exam_name = result.getString(\"exam_type_name\");\n String desc = result.getString(\"description\");\n examTypes.add(new ExamType(exam_name, desc));\n System.out.println(exam_name + \" \" + desc);\n }\n return examTypes;\n } catch (SQLException e) {\n System.err.println(\"**MySQLException: \" + e.getMessage());\n return null;\n } catch (Exception e) {\n System.err.println(\"**MyException: \" + e.getMessage());\n return null;\n } finally {\n if (pStmt != null) {\n try {\n pStmt.close();\n } catch (SQLException ex) {\n System.out.println(\"pStmt.close() failed\");\n System.out.println(\"Error Type: \" + ex.getClass().getName());\n }\n }\n }\n }", "List<ResourceType> resourceTypes();", "ImmutableList<SchemaOrgType> getMentionsList();", "TypeList getExceptionTypes();", "Collection<ActivityType> getActivityTypes() throws DataAccessException;", "public static List<Terrain> getAllTerrainTypes(){\n\t\treturn new ArrayList<Terrain>(EnumSet.allOf(Terrain.class));\n\t}", "ImmutableList<SchemaOrgType> getInLanguageList();", "@Override\n\tpublic List<Facilities_type> getAllFacilitiesType() {\n\t\treturn this.facilitiesDao.getAllFacilitiesType();\n\t}", "@SuppressWarnings(\"unchecked\")\n @ModelAttribute(\"patientIdentifierTypesAutoAssigned\")\n\tpublic List<PatientIdentifierType> getPatientIdentifierTypesAutoAssigned() {\n\t\tif(!ModuleFactory.getStartedModulesMap().containsKey(\"idgen\")) {\n\t\t\treturn new LinkedList<PatientIdentifierType>(); // return an empty list\n\t\t}\n\t\telse {\n\t\t\t// access the idgen module via reflection\n\t\t\ttry {\n\t\t\t\tClass identifierSourceServiceClass = Context.loadClass(\"org.openmrs.module.idgen.service.IdentifierSourceService\");\n\t\t\t\tObject idgen = Context.getService(identifierSourceServiceClass);\n\t\t\t\tMethod getPatientIdentifierTypesByAutoGenerationOption = identifierSourceServiceClass.getMethod(\"getPatientIdentifierTypesByAutoGenerationOption\", Boolean.class, Boolean.class);\n\t\t\t\t\n\t\t\t\treturn (List<PatientIdentifierType>) getPatientIdentifierTypesByAutoGenerationOption.invoke(idgen, false, true);\n\t\t\t}\n\t\t\tcatch(Exception e) {\n\t\t\t\tlog.error(\"Unable to access IdentifierSourceService for automatic id generation. Is the Idgen module installed and up-to-date?\", e);\n\t\t\t\treturn new LinkedList<PatientIdentifierType>(); // return an empty list\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic List<PermitType> GetAllPermitTypes() {\n\t\tConnection connection = null;\n\t\tPreparedStatement preparedStatement = null;\n\t\tResultSet resultSet = null;\n\t\tint count=1;\n\t\ttry {\n\t\t\tconnection = dataSource.getConnection();\n\t\t\tpreparedStatement = connection\n\t\t\t\t\t.prepareStatement(Queryconstants.getPermitTypes);\n\t\t\tresultSet = preparedStatement.executeQuery();\n\t\t\tList<PermitType> permittypes = new ArrayList<PermitType>();\n\t\t\twhile (resultSet.next()) {\n\t\t\t\tPermitType permitType=new PermitType();\n\n\t\t\t\tpermitType.permitTypeId=resultSet.getInt(\"ID\");\n\t\t\t\tpermitType.permitTypeCode=resultSet.getString(\"permit_type_Code\");\n\t\t\t\tpermitType.permitTypeName=resultSet.getString(\"permit_type_Name\");\n\t\t\t\tpermitType.permitType=resultSet.getString(\"permit_type_code\");\n\t\t\t\tpermitType.permitFee=resultSet.getDouble(\"permit_fee\");\n\t\t\t\tpermitType.active=resultSet.getBoolean(\"active\");\n\t\t\t\tpermitType.respCode=200;\n\t\t\t\tpermitType.count=count;\n\t\t\t\tpermittypes.add(permitType);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\treturn permittypes;\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t\treturn null;\n\t\t} finally {\n\t\t\tDBOperations.DisposeSql(connection, preparedStatement, resultSet);\n\t\t}\n\t}", "public String[] getFfTypes(){\n return ffc.getFfTypes();\n }", "public List<Class<? extends Resource>> getAvailableTypes(OgemaLocale locale);", "public List<CWLType> getTypes() {\n return types;\n }", "private void getAgentTypesFromFile(){\n \t\tagentTypes= agentTypesProvider.GetAgentTypes();\n \t}", "public static synchronized Set<Class<?>> keySet() {\n\t\treturn ClassRegistry.dictionary.keySet();\n\t}", "@Override\n public Set<String> validTypes() {\n return factory.validTypes();\n }", "public Set<EntityType> getEntityTypes() {\n\t\ttry {\n\t\t\tSet<EntityType> entityTypes =\n\t\t\t\tnew HashSet<EntityType>(getWorkbench().getSearchableEntityTypes());\n\t\t\tentityTypes.add(EntityType.UNKNOWN);\n\t\t\treturn entityTypes;\n\t\t} catch (Throwable error) {\n\t\t\treportError(error, \"Error retrieving the set of searchable EntityTypes\");\n\t\t\treturn null;\n\t\t}\n\t}", "public final CompositeType[] getCompositeTypes()\n {\n CompositeType[] names = new CompositeType[listModel.size()];\n\tfor(int i=0; i<names.length; i++) {\n\t names[i] = (CompositeType) listModel.elementAt(i);\n\t}\n\treturn names;\n }", "public Collection<Integer> getIncludedTransportTypes();", "public List<Class<?>> getAllModelEnums() {\n\t\treturn ModelClasses.findModelEnums();\n\t}", "@External(readonly = true)\n\tpublic List<String> get_game_type(){\n\t\t\n\t\treturn this.GAME_TYPE;\n\t}", "public EdgeType[] getEdgeTypes()\n {\n final ArrayList<EdgeType> alist = new ArrayList<EdgeType>();\n for (final EdgeTypeHolder eth : ethMap.values())\n alist.add(eth.getEdgeType());\n return alist.toArray(new EdgeType[alist.size()]);\n }", "public java.util.List<String> getInstanceTypes() {\n if (instanceTypes == null) {\n instanceTypes = new com.amazonaws.internal.SdkInternalList<String>();\n }\n return instanceTypes;\n }", "public String[] getNodeTypes()\r\n {\r\n\treturn ntMap.keySet().toArray(new String[ntMap.size()]);\r\n }", "List<SpawnType> getSpawnTypes();", "java.util.List<? extends com.rpg.framework.database.Protocol.QuestOrBuilder> \n getQuestOrBuilderList();", "public Iterator<String> tagTypeIterator() { return tag_types.iterator(); }", "public PhaseType[] getAllPhaseTypes() throws PhaseManagementException {\r\n return this.delegate.getAllPhaseTypes();\r\n }", "public RegitemTypes getRegitemTypes() {\n return regitemTypes;\n }", "Collection<? extends Integer> getHasAlcoholSpecimanType();", "public static Cursor getWorkoutTypes(SQLiteDatabase db) {\n //grade type\n String[] projection = {\n DatabaseContract.WorkoutTypeEntry._ID,\n DatabaseContract.WorkoutTypeEntry.COLUMN_WORKOUTTYPENAME,\n DatabaseContract.WorkoutTypeEntry.COLUMN_DESCRIPTION};\n\n Cursor cursor = db.query(DatabaseContract.WorkoutTypeEntry.TABLE_NAME,\n projection,\n null,\n null,\n null,\n null,\n null);\n\n return cursor;\n }", "public Set<Entry> getSet() {\n Set<Entry> litSet = this.litRegister;\n return litSet;\n }" ]
[ "0.5809285", "0.5741359", "0.56826717", "0.5505921", "0.54804295", "0.5480162", "0.5469237", "0.5463696", "0.5461257", "0.5460286", "0.5458301", "0.54407686", "0.54407686", "0.5440561", "0.5417942", "0.54141533", "0.5410454", "0.5392001", "0.5388452", "0.5241188", "0.52121603", "0.51848996", "0.51841706", "0.51839703", "0.5182867", "0.5173026", "0.51660424", "0.5161435", "0.5156161", "0.5115877", "0.51003224", "0.50939614", "0.50846195", "0.5078648", "0.5060763", "0.50607413", "0.50604117", "0.5059656", "0.5050424", "0.5045413", "0.50170827", "0.5015376", "0.5013836", "0.50113285", "0.50085217", "0.4980577", "0.49804837", "0.49778026", "0.4971143", "0.49703652", "0.49573356", "0.49556583", "0.49543947", "0.49510032", "0.49488816", "0.49457374", "0.49453986", "0.49449533", "0.49438193", "0.49333015", "0.49211097", "0.49185467", "0.49156505", "0.4911899", "0.49096188", "0.4909012", "0.49067327", "0.4902917", "0.48991358", "0.4898268", "0.4893847", "0.48917982", "0.48870054", "0.4874454", "0.487254", "0.48664182", "0.48619395", "0.48600376", "0.48574108", "0.48568997", "0.48544905", "0.48402485", "0.48382038", "0.48282647", "0.48134452", "0.4811335", "0.4811267", "0.48087025", "0.48050854", "0.47992072", "0.4789768", "0.4784605", "0.47827387", "0.47766748", "0.4774559", "0.4771864", "0.4765826", "0.47550926", "0.47549537", "0.474932" ]
0.72085625
0
Returns all the concepts that represent positive results for a smear or culture
public static Set<Concept> getPositiveResultConcepts() { MdrtbService service = Context.getService(MdrtbService.class); // create a list of all concepts that represent positive results Set<Concept> positiveResults = new HashSet<Concept>(); positiveResults.add(service.getConcept(MdrtbConcepts.STRONGLY_POSITIVE)); positiveResults.add(service.getConcept(MdrtbConcepts.MODERATELY_POSITIVE)); positiveResults.add(service.getConcept(MdrtbConcepts.WEAKLY_POSITIVE)); positiveResults.add(service.getConcept(MdrtbConcepts.POSITIVE)); positiveResults.add(service.getConcept(MdrtbConcepts.SCANTY)); return positiveResults; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Integer [] getPositiveResultConceptIds() {\r\n \tSet<Concept> positiveConcepts = getPositiveResultConcepts();\r\n \tInteger [] positiveResultIds = new Integer[positiveConcepts.size()];\r\n \t\r\n \tint i = 0;\r\n \tfor (Concept positiveConcept : positiveConcepts) {\r\n \t\tpositiveResultIds[i] = positiveConcept.getConceptId();\r\n \t\ti++;\r\n \t}\r\n \t\r\n \treturn positiveResultIds;\r\n }", "@RequestMapping(value = \"/true-positive\", method = RequestMethod.GET)\r\n public ResponseEntity<?> getTruePositiveResult() {\r\n //TODO\r\n //covidAggregateService.getResult(ResultType.TRUE_POSITIVE);\r\n try {\r\n return new ResponseEntity<>(covidAggregateService.getResult(ResultType.TRUE_POSITIVE), HttpStatus.ACCEPTED);\r\n } catch (Exception e) {\r\n return new ResponseEntity<>(HttpStatus.NOT_FOUND);\r\n }\r\n }", "public ArrayList<Integer> getAnalysisGeneral(){\n resultListGeneral = null ;\n positiveResultGeneral = 0;\n negativeResultGeneral = 0;\n neutralResultGeneral = 0;\n try {\n IndexReader reader = DirectoryReader.open(FSDirectory.open(Paths.get(\"indice/\")));\n this.resultListGeneral = new ArrayList<>();\n\n for (int i = 0; i < reader.numDocs(); i++) {\n Document doc = reader.document(i);\n\n if((doc.get(\"analysis\")).equals(\"Positive\"))\n positiveResultGeneral++;\n else if((doc.get(\"analysis\")).equals(\"Negative\"))\n negativeResultGeneral++;\n else if((doc.get(\"analysis\")).equals(\"Neutral\"))\n neutralResultGeneral++;\n }\n reader.close();\n }\n catch(IOException ioe){\n System.out.println(\"Error\");\n }\n resultListGeneral.add(positiveResultGeneral);\n resultListGeneral.add(negativeResultGeneral);\n resultListGeneral.add(neutralResultGeneral);\n\n return resultListGeneral;\n }", "public ArrayList<Integer> getAnalysis(String Political)\n {\n resultList = null ;\n positiveResult = 0;\n negativeResult = 0;\n neutralResult = 0;\n try{\n IndexReader reader = DirectoryReader.open(FSDirectory.open(Paths.get(\"indice/\")));\n IndexSearcher searcher = new IndexSearcher(reader);\n Analyzer analyzer = new StandardAnalyzer();\n this.resultList = new ArrayList<>();\n QueryParser parser = new QueryParser(\"text\",analyzer);\n Query query = parser.parse(Political);\n TopDocs result = searcher.search(query,25000);\n ScoreDoc[] hits =result.scoreDocs;\n\n for (int i=0; i < hits.length; i++) {\n Document doc = searcher.doc(hits[i].doc);\n\n if((doc.get(\"analysis\")).equals(\"Positive\"))\n positiveResult++;\n else if((doc.get(\"analysis\")).equals(\"Negative\"))\n negativeResult++;\n else if((doc.get(\"analysis\")).equals(\"Neutral\"))\n neutralResult++;\n }\n reader.close();\n }\n catch(IOException | ParseException ex)\n {\n Logger.getLogger(Lucene.class.getName()).log(Level.SEVERE,null,ex);\n\n }\n resultList.add(positiveResult);\n resultList.add(negativeResult);\n resultList.add(neutralResult);\n\n return resultList;\n }", "EDataType getSusceptance();", "@Test \n\tpublic void baysNeverZeroResult() {\n\t\tboolean nil = false;\n\t\t//word ids are only positive so -1 is testing a \"word not found\" case\n\t\tfor(int i = -1; i< 100; i++) {\n\t\t\tfor(NewsGroup g: groups) {\n\t\t\t\tif(g.bayesianEstimator(i) == 0)\n\t\t\t\t\tnil = true;\n\t\t\t}\n\t\t}\n\t\tassertFalse(nil);\n\t}", "boolean getMissingResults();", "default public boolean getSoundness() {\n if (getValidity()) {\n for (Proposition premise : getPremises()) {\n if (!premise.determineTruth()) {\n return false;\n }\n }\n return true;\n } else {\n return false;\n }\n }", "public void calculateStastics() {\t\t\n\t\t\n\t\t/* remove verboten spectra */\n\t\tArrayList<String> verbotenSpectra = new ArrayList<String>();\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.7436.7436.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.5161.5161.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.4294.4294.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.4199.4199.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.5085.5085.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.4129.4129.2.dta\");\n\t\tfor (int i = 0; i < positiveMatches.size(); i++) {\n\t\t\tMatch match = positiveMatches.get(i);\n\t\t\tfor (String name: verbotenSpectra) {\n\t\t\t\tif (name.equals(match.getSpectrum().getFile().getName())) {\n\t\t\t\t\tpositiveMatches.remove(i);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < spectra.size(); i++) {\n\t\t\tSpectrum spectrum = spectra.get(i);\n\t\t\tfor (String name: verbotenSpectra) {\n\t\t\t\tif (name.equals(spectrum.getFile().getName())) {\n\t\t\t\t\tspectra.remove(i);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* finding how much time per spectrum */\n\t\tmilisecondsPerSpectrum = (double) timeElapsed / spectra.size();\n\n\n\t\tMatch.setSortParameter(Match.SORT_BY_SCORE);\n\t\tCollections.sort(positiveMatches);\n\t\t\n\t\t\n\t\t/* Identify if each match is true or false */\n\t\ttestedMatches = new ArrayList<MatchContainer>(positiveMatches.size());\n\t\tfor (Match match: positiveMatches) {\n\t\t\tMatchContainer testedMatch = new MatchContainer(match);\n\t\t\ttestedMatches.add(testedMatch);\n\t\t}\n\t\t\n\t\t/* sort the tested matches */\n\t\tCollections.sort(testedMatches);\n\t\t\n\t\t\n\n\t\t/*account for the fact that these results might have the wrong spectrum ID due to\n\t\t * Mascot having sorted the spectra by mass\n\t\t */\n\t\tif (Properties.scoringMethodName.equals(\"Mascot\")){\n\t\t\t\n\t\t\t/* hash of true peptides */\n\t\t\tHashtable<String, Peptide> truePeptides = new Hashtable<String, Peptide>();\n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tString truePeptide = mc.getCorrectAcidSequence();\n\t\t\t\ttruePeptides.put(truePeptide, mc.getTrueMatch().getPeptide());\n\t\t\t}\n\t\t\t\n\t\t\t/* making a hash of the best matches */\n\t\t\tHashtable<Integer, MatchContainer> bestMascotMatches = new Hashtable<Integer, MatchContainer>(); \n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tMatchContainer best = bestMascotMatches.get(mc.getMatch().getSpectrum().getId());\n\t\t\t\tif (best == null) {\n\t\t\t\t\tbestMascotMatches.put(mc.getMatch().getSpectrum().getId(), mc);\n\t\t\t\t} else {\n\t\t\t\t\tif (truePeptides.get(mc.getMatch().getPeptide().getAcidSequenceString()) != null) {\n\t\t\t\t\t\tbestMascotMatches.put(mc.getMatch().getSpectrum().getId(), mc);\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* need to set the peptide, because though it may have found a correct peptide, it might not be the right peptide for this particular spectrum */\n\t\t\t\t\t\tmc.getMatch().setPeptide(mc.getTrueMatch().getPeptide());\n\t\t\t\t\t\tmc.validate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttestedMatches = new ArrayList<MatchContainer>(bestMascotMatches.values());\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t/* reduce the tested matches to one per spectrum, keeping the one that is correct if there is a correct one \n\t\t * else keep the match with the best score */\n\t\tArrayList<MatchContainer> reducedTestedMatches = new ArrayList<MatchContainer>(testedMatches.size());\n\t\tfor (Spectrum spectrum: spectra) {\n\t\t\tMatchContainer toAdd = null;\n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tif (mc.getMatch().getSpectrum().getId() == spectrum.getId()) {\n\t\t\t\t\tif (toAdd == null) {\n\t\t\t\t\t\ttoAdd = mc; \n\t\t\t\t\t}\n\t\t\t\t\tif (toAdd.getMatch().getScore() < mc.getMatch().getScore()) {\n\t\t\t\t\t\ttoAdd = mc;\n\t\t\t\t\t}\n\t\t\t\t\tif (toAdd.getMatch().getScore() == mc.getMatch().getScore() && mc.isTrue()) {\n\t\t\t\t\t\ttoAdd = mc;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (toAdd != null) {\n\t\t\t\treducedTestedMatches.add(toAdd);\n\t\t\t}\n\t\t}\n\t\ttestedMatches = reducedTestedMatches;\n\t\t\n\t\t/* ensure the testedMatches are considering the correct peptide */\n\t\tif (Properties.scoringMethodName.equals(\"Peppy.Match_IMP\")){\n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tif (mc.getMatch().getScore() < mc.getTrueMatch().getScore()) {\n\t\t\t\t\tmc.getMatch().setPeptide(mc.getTrueMatch().getPeptide());\n\t\t\t\t\tmc.getMatch().calculateScore();\n\t\t\t\t\tmc.validate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t/* again sort the tested matches */\n\t\tCollections.sort(testedMatches);\n\t\n\t\t\n\t\t//count total true;\n\t\tfor (MatchContainer match: testedMatches) {\n\t\t\tif (match.isTrue()) {\n\t\t\t\ttrueTally++;\n\t\t\t} else {\n\t\t\t\tfalseTally++;\n\t\t\t}\n\t\t\tif ((double) falseTally / (trueTally + falseTally) <= 0.01) {\n\t\t\t\ttrueTallyAtOnePercentError = trueTally;\n\t\t\t\tpercentAtOnePercentError = (double) trueTallyAtOnePercentError / spectra.size();\n\t\t\t}\n\t\t\tif ((double) falseTally / (trueTally + falseTally) <= 0.05) {\n\t\t\t\ttrueTallyAtFivePercentError = trueTally;\n\t\t\t\tpercentAtFivePercentError = (double) trueTallyAtFivePercentError / spectra.size();\n\t\t\t}\n\t\t}\n\t\t\n\t\tgeneratePrecisionRecallCurve();\n\t}", "public ArrayList<Concept> getAllConcepts() {\n \treturn this.concepts.getAllContents();\n }", "void negarAnalise();", "public ArrayList NegativeSentenceDetection() {\n String phraseNotation = \"RB|CC\";//@\" + phrase + \"! << @\" + phrase;\n TregexPattern VBpattern = TregexPattern.compile(phraseNotation);\n TregexMatcher matcher = VBpattern.matcher(sTree);\n ArrayList negativeLists = new ArrayList();\n while (matcher.findNextMatchingNode()) {\n Tree match = matcher.getMatch();\n Tree[] innerChild = match.children();\n for (Tree inChild : innerChild) {\n negativeLists.add(inChild.getLeaves().get(0).yieldWords().get(0).word());\n }\n }\n return negativeLists;\n }", "public List getDonts() {\n\t\tif (donts == null) {\n\t\t\tdonts = getFormattedPractices(\"/metadataFieldInfo/field/bestPractices/donts\");\n\t\t}\n\t\treturn donts;\n\t}", "public Taxonomy getInterests();", "boolean hasHasAlcoholResult();", "Collection<? extends Object> getHasAlcoholResult();", "public java.util.List<CodeableConcept> specialCourtesy() {\n return getList(CodeableConcept.class, FhirPropertyNames.PROPERTY_SPECIAL_COURTESY);\n }", "public java.util.Set<java.lang.String> availableMeasures()\n\t{\n\t\tjava.util.Set<java.lang.String> setstrMeasures = new java.util.TreeSet<java.lang.String>();\n\n\t\tsetstrMeasures.add (\"AccrualCoupon\");\n\n\t\tsetstrMeasures.add (\"Accrued\");\n\n\t\tsetstrMeasures.add (\"Accrued01\");\n\n\t\tsetstrMeasures.add (\"CleanDV01\");\n\n\t\tsetstrMeasures.add (\"CleanPV\");\n\n\t\tsetstrMeasures.add (\"CompoundingAdjustedCleanDV01\");\n\n\t\tsetstrMeasures.add (\"CompoundingAdjustedCleanPV\");\n\n\t\tsetstrMeasures.add (\"CompoundingAdjustedDirtyDV01\");\n\n\t\tsetstrMeasures.add (\"CompoundingAdjustedDirtyPV\");\n\n\t\tsetstrMeasures.add (\"CompoundingAdjustedFairPremium\");\n\n\t\tsetstrMeasures.add (\"CompoundingAdjustedParRate\");\n\n\t\tsetstrMeasures.add (\"CompoundingAdjustedPV\");\n\n\t\tsetstrMeasures.add (\"CompoundingAdjustedRate\");\n\n\t\tsetstrMeasures.add (\"CompoundingAdjustedUpfront\");\n\n\t\tsetstrMeasures.add (\"CompoundingAdjustmentFactor\");\n\n\t\tsetstrMeasures.add (\"CompoundingAdjustmentPremium\");\n\n\t\tsetstrMeasures.add (\"CompoundingAdjustmentPremiumUpfront\");\n\n\t\tsetstrMeasures.add (\"CreditForwardConvexityAdjustedCleanDV01\");\n\n\t\tsetstrMeasures.add (\"CreditForwardConvexityAdjustedCleanPV\");\n\n\t\tsetstrMeasures.add (\"CreditForwardConvexityAdjustedDirtyDV01\");\n\n\t\tsetstrMeasures.add (\"CreditForwardConvexityAdjustedDirtyPV\");\n\n\t\tsetstrMeasures.add (\"CreditForwardConvexityAdjustedDV01\");\n\n\t\tsetstrMeasures.add (\"CreditForwardConvexityAdjustedFairPremium\");\n\n\t\tsetstrMeasures.add (\"CreditForwardConvexityAdjustedParRate\");\n\n\t\tsetstrMeasures.add (\"CreditForwardConvexityAdjustedPV\");\n\n\t\tsetstrMeasures.add (\"CreditForwardConvexityAdjustedRate\");\n\n\t\tsetstrMeasures.add (\"CreditForwardConvexityAdjustedUpfront\");\n\n\t\tsetstrMeasures.add (\"CreditForwardConvexityAdjustmentFactor\");\n\n\t\tsetstrMeasures.add (\"CreditForwardConvexityAdjustmentPremium\");\n\n\t\tsetstrMeasures.add (\"CreditForwardConvexityAdjustmentPremiumUpfront\");\n\n\t\tsetstrMeasures.add (\"CreditFundingConvexityAdjustedCleanDV01\");\n\n\t\tsetstrMeasures.add (\"CreditFundingConvexityAdjustedCleanPV\");\n\n\t\tsetstrMeasures.add (\"CreditFundingConvexityAdjustedDirtyDV01\");\n\n\t\tsetstrMeasures.add (\"CreditFundingConvexityAdjustedDirtyPV\");\n\n\t\tsetstrMeasures.add (\"CreditFundingConvexityAdjustedDV01\");\n\n\t\tsetstrMeasures.add (\"CreditFundingConvexityAdjustedFairPremium\");\n\n\t\tsetstrMeasures.add (\"CreditFundingConvexityAdjustedParRate\");\n\n\t\tsetstrMeasures.add (\"CreditFundingConvexityAdjustedPV\");\n\n\t\tsetstrMeasures.add (\"CreditFundingConvexityAdjustedRate\");\n\n\t\tsetstrMeasures.add (\"CreditFundingConvexityAdjustedUpfront\");\n\n\t\tsetstrMeasures.add (\"CreditFundingConvexityAdjustmentFactor\");\n\n\t\tsetstrMeasures.add (\"CreditFundingConvexityAdjustmentPremium\");\n\n\t\tsetstrMeasures.add (\"CreditFundingConvexityAdjustmentPremiumUpfront\");\n\n\t\tsetstrMeasures.add (\"CreditFXConvexityAdjustedCleanDV01\");\n\n\t\tsetstrMeasures.add (\"CreditFXConvexityAdjustedCleanPV\");\n\n\t\tsetstrMeasures.add (\"CreditFXConvexityAdjustedDirtyDV01\");\n\n\t\tsetstrMeasures.add (\"CreditFXConvexityAdjustedDirtyPV\");\n\n\t\tsetstrMeasures.add (\"CreditFXConvexityAdjustedDV01\");\n\n\t\tsetstrMeasures.add (\"CreditFXConvexityAdjustedFairPremium\");\n\n\t\tsetstrMeasures.add (\"CreditFXConvexityAdjustedParRate\");\n\n\t\tsetstrMeasures.add (\"CreditFXConvexityAdjustedPV\");\n\n\t\tsetstrMeasures.add (\"CreditFXConvexityAdjustedRate\");\n\n\t\tsetstrMeasures.add (\"CreditFXConvexityAdjustedUpfront\");\n\n\t\tsetstrMeasures.add (\"CreditFXConvexityAdjustmentFactor\");\n\n\t\tsetstrMeasures.add (\"CreditFXConvexityAdjustmentPremium\");\n\n\t\tsetstrMeasures.add (\"CreditFXConvexityAdjustmentPremiumUpfront\");\n\n\t\tsetstrMeasures.add (\"CumulativeConvexityAdjustedCleanDV01\");\n\n\t\tsetstrMeasures.add (\"CumulativeConvexityAdjustedCleanPV\");\n\n\t\tsetstrMeasures.add (\"CumulativeConvexityAdjustedDirtyDV01\");\n\n\t\tsetstrMeasures.add (\"CumulativeConvexityAdjustedDirtyPV\");\n\n\t\tsetstrMeasures.add (\"CumulativeConvexityAdjustedDV01\");\n\n\t\tsetstrMeasures.add (\"CumulativeConvexityAdjustedFairPremium\");\n\n\t\tsetstrMeasures.add (\"CumulativeConvexityAdjustedParRate\");\n\n\t\tsetstrMeasures.add (\"CumulativeConvexityAdjustedPV\");\n\n\t\tsetstrMeasures.add (\"CumulativeConvexityAdjustedRate\");\n\n\t\tsetstrMeasures.add (\"CumulativeConvexityAdjustedUpfront\");\n\n\t\tsetstrMeasures.add (\"CumulativeConvexityAdjustmentFactor\");\n\n\t\tsetstrMeasures.add (\"CumulativeConvexityAdjustmentPremium\");\n\n\t\tsetstrMeasures.add (\"CumulativeConvexityAdjustmentPremiumUpfront\");\n\n\t\tsetstrMeasures.add (\"CumulativeCouponAmount\");\n\n\t\tsetstrMeasures.add (\"CV01\");\n\n\t\tsetstrMeasures.add (\"DirtyDV01\");\n\n\t\tsetstrMeasures.add (\"DirtyPV\");\n\n\t\tsetstrMeasures.add (\"DV01\");\n\n\t\tsetstrMeasures.add (\"FairPremium\");\n\n\t\tsetstrMeasures.add (\"Fixing01\");\n\n\t\tsetstrMeasures.add (\"ForwardFundingConvexityAdjustedCleanDV01\");\n\n\t\tsetstrMeasures.add (\"ForwardFundingConvexityAdjustedCleanPV\");\n\n\t\tsetstrMeasures.add (\"ForwardFundingConvexityAdjustedDirtyDV01\");\n\n\t\tsetstrMeasures.add (\"ForwardFundingConvexityAdjustedDirtyPV\");\n\n\t\tsetstrMeasures.add (\"ForwardFundingConvexityAdjustedDV01\");\n\n\t\tsetstrMeasures.add (\"ForwardFundingConvexityAdjustedFairPremium\");\n\n\t\tsetstrMeasures.add (\"ForwardFundingConvexityAdjustedParRate\");\n\n\t\tsetstrMeasures.add (\"ForwardFundingConvexityAdjustedPV\");\n\n\t\tsetstrMeasures.add (\"ForwardFundingConvexityAdjustedRate\");\n\n\t\tsetstrMeasures.add (\"ForwardFundingConvexityAdjustedUpfront\");\n\n\t\tsetstrMeasures.add (\"ForwardFundingConvexityAdjustmentFactor\");\n\n\t\tsetstrMeasures.add (\"ForwardFundingConvexityAdjustmentPremium\");\n\n\t\tsetstrMeasures.add (\"ForwardFundingConvexityAdjustmentPremiumUpfront\");\n\n\t\tsetstrMeasures.add (\"ForwardFXConvexityAdjustedCleanDV01\");\n\n\t\tsetstrMeasures.add (\"ForwardFXConvexityAdjustedCleanPV\");\n\n\t\tsetstrMeasures.add (\"ForwardFXConvexityAdjustedDirtyDV01\");\n\n\t\tsetstrMeasures.add (\"ForwardFXConvexityAdjustedDirtyPV\");\n\n\t\tsetstrMeasures.add (\"ForwardFXConvexityAdjustedDV01\");\n\n\t\tsetstrMeasures.add (\"ForwardFXConvexityAdjustedFairPremium\");\n\n\t\tsetstrMeasures.add (\"ForwardFXConvexityAdjustedParRate\");\n\n\t\tsetstrMeasures.add (\"ForwardFXConvexityAdjustedPV\");\n\n\t\tsetstrMeasures.add (\"ForwardFXConvexityAdjustedRate\");\n\n\t\tsetstrMeasures.add (\"ForwardFXConvexityAdjustedUpfront\");\n\n\t\tsetstrMeasures.add (\"ForwardFXConvexityAdjustmentFactor\");\n\n\t\tsetstrMeasures.add (\"ForwardFXConvexityAdjustmentPremium\");\n\n\t\tsetstrMeasures.add (\"ForwardFXConvexityAdjustmentPremiumUpfront\");\n\n\t\tsetstrMeasures.add (\"FundingFXConvexityAdjustedCleanDV01\");\n\n\t\tsetstrMeasures.add (\"FundingFXConvexityAdjustedCleanPV\");\n\n\t\tsetstrMeasures.add (\"FundingFXConvexityAdjustedDirtyDV01\");\n\n\t\tsetstrMeasures.add (\"FundingFXConvexityAdjustedDirtyPV\");\n\n\t\tsetstrMeasures.add (\"FundingFXConvexityAdjustedDV01\");\n\n\t\tsetstrMeasures.add (\"FundingFXConvexityAdjustedFairPremium\");\n\n\t\tsetstrMeasures.add (\"FundingFXConvexityAdjustedParRate\");\n\n\t\tsetstrMeasures.add (\"FundingFXConvexityAdjustedPV\");\n\n\t\tsetstrMeasures.add (\"FundingFXConvexityAdjustedRate\");\n\n\t\tsetstrMeasures.add (\"FundingFXConvexityAdjustedUpfront\");\n\n\t\tsetstrMeasures.add (\"FundingFXConvexityAdjustmentFactor\");\n\n\t\tsetstrMeasures.add (\"FundingFXConvexityAdjustmentPremium\");\n\n\t\tsetstrMeasures.add (\"FundingFXConvexityAdjustmentPremiumUpfront\");\n\n\t\tsetstrMeasures.add (\"ParRate\");\n\n\t\tsetstrMeasures.add (\"PV\");\n\n\t\tsetstrMeasures.add (\"Rate\");\n\n\t\tsetstrMeasures.add (\"ResetDate\");\n\n\t\tsetstrMeasures.add (\"ResetRate\");\n\n\t\tsetstrMeasures.add (\"TotalCoupon\");\n\n\t\tsetstrMeasures.add (\"UnadjustedCleanDV01\");\n\n\t\tsetstrMeasures.add (\"UnadjustedCleanPV\");\n\n\t\tsetstrMeasures.add (\"UnadjustedDirtyDV01\");\n\n\t\tsetstrMeasures.add (\"UnadjustedDirtyPV\");\n\n\t\tsetstrMeasures.add (\"UnadjustedFairPremium\");\n\n\t\tsetstrMeasures.add (\"UnadjustedParRate\");\n\n\t\tsetstrMeasures.add (\"UnadjustedPV\");\n\n\t\tsetstrMeasures.add (\"UnadjustedRate\");\n\n\t\tsetstrMeasures.add (\"UnadjustedUpfront\");\n\n\t\tsetstrMeasures.add (\"Upfront\");\n\n\t\treturn setstrMeasures;\n\t}", "String getConcept();", "private void analyze() {\n\t\tdouble org = 0;\n\t\tdouble avgIndPerDoc = 0;\n\t\tdouble avgTotalPerDoc = 0;\n\n\t\tfor (Instance instance : instanceProvider.getInstances()) {\n\n\t\t\tint g = 0;\n\t\t\tSet<AbstractAnnotation> orgM = new HashSet<>();\n\n//\t\t\torgM.addAll(instance.getGoldAnnotations().getAnnotations());\n//\t\t\tg += instance.getGoldAnnotations().getAnnotations().size();\n\n\t\t\tfor (AbstractAnnotation instance2 : instance.getGoldAnnotations().getAnnotations()) {\n\n\t\t\t\tResult r = new Result(instance2);\n\n\t\t\t\t{\n////\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(r.getTrend());\n//\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(r.getInvestigationMethod());\n////\t\t\t\t\tList<AbstractAnnotation> aa = new ArrayList<>(\n////\t\t\t\t\t\t\tr.getDefinedExperimentalGroups().stream().map(a -> a.get()).collect(Collectors.toList()));\n//\n//\t\t\t\t\torgM.addAll(aa);\n//\t\t\t\t\tg += aa.size();\n\t\t\t\t}\n\n\t\t\t\t{\n\t\t\t\t\t/**\n\t\t\t\t\t * props of exp\n\t\t\t\t\t */\n\t\t\t\t\tfor (DefinedExperimentalGroup instance3 : r.getDefinedExperimentalGroups()) {\n\n//\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(instance3.getOrganismModel());\n//\t\t\t\t\tList<AbstractAnnotation> aa = new ArrayList<>(instance3.getTreatments());\n//\t\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(instance3.getInjury());\n\n\t\t\t\t\t\tList<AbstractAnnotation> ab = Arrays.asList(instance3.getInjury());\n\n\t\t\t\t\t\tList<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n\t\t\t\t\t\t\t\t.filter(i -> i != null).flatMap(i -> i.getDeliveryMethods().stream())\n\t\t\t\t\t\t\t\t.filter(i -> i != null).collect(Collectors.toList());\n\n\t\t\t\t\t\taa.addAll(instance3.getTreatments().stream().filter(i -> i != null)\n\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Treatment(et))\n\t\t\t\t\t\t\t\t.filter(i -> i != null).map(i -> i.getDeliveryMethod()).filter(i -> i != null)\n\t\t\t\t\t\t\t\t.collect(Collectors.toList()));\n\n//\t\t\t\t\t\tList<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).flatMap(i -> i.getAnaesthetics().stream())\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).collect(Collectors.toList());\n\n//\t\t\t\t\t\tList<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).map(i -> i.getInjuryDevice()).filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.collect(Collectors.toList());\n\n\t\t\t\t\t\t// List<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).map(i -> i.getInjuryLocation()).filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.collect(Collectors.toList());\n\n\t\t\t\t\t\torgM.addAll(aa);\n\t\t\t\t\t\tg += aa.size();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tavgIndPerDoc += orgM.size();\n\t\t\tavgTotalPerDoc += g;\n\n\t\t\torg += ((double) orgM.size()) / (g == 0 ? 1 : g);\n//\t\t\tSystem.out.println(((double) orgM.size()) / g);\n\n\t\t}\n\t\tSystem.out.println(\"avgTotalPerDoc = \" + avgTotalPerDoc / instanceProvider.getInstances().size());\n\t\tSystem.out.println(\"avgIndPerDoc = \" + avgIndPerDoc / instanceProvider.getInstances().size());\n\t\tSystem.out.println(\"org = \" + org);\n\t\tSystem.out.println(\"avg. org = \" + (org / instanceProvider.getInstances().size()));\n\t\tSystem.out.println(new DecimalFormat(\"0.00\").format(avgTotalPerDoc / instanceProvider.getInstances().size())\n\t\t\t\t+ \" & \" + new DecimalFormat(\"0.00\").format(avgIndPerDoc / instanceProvider.getInstances().size())\n\t\t\t\t+ \" & \" + new DecimalFormat(\"0.00\").format(org / instanceProvider.getInstances().size()));\n\t\tSystem.exit(1);\n\n\t\tStats.countVariables(0, instanceProvider.getInstances());\n\n\t\tint count = 0;\n\t\tfor (SlotType slotType : EntityType.get(\"Result\").getSlots()) {\n\n\t\t\tif (slotType.isExcluded())\n\t\t\t\tcontinue;\n\t\t\tcount++;\n\t\t\tSystem.out.println(slotType.name);\n\n\t\t}\n\t\tSystem.out.println(count);\n\t\tSystem.exit(1);\n\t}", "public static ArrayList<Krediti> trueScetKrediti() {\r\n\t\tArrayList<Krediti> foundKrediti = new ArrayList<Krediti>();\r\n\t\tint i = 0;\r\n\t\tfor (Krediti kredit : kred) {\r\n\t\t\tif (kredit.getStat() == true) {\r\n\t\t\t\tfoundKrediti.add(kredit);\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn foundKrediti;\r\n\t}", "public ArrayList<Integer> analyze() {\n\t\t//Clears the sentimentValues ArrayList to perform a new analysis.\n\t\tif (this.sentimentValues.size() > 0) {\n\t\t\tthis.sentimentValues = new ArrayList<>();\n\t\t}\n\t\t\n\t\tDocument speechDocument = new Document(this.speech);\t//Create a CoreNLP Document object with speech as input.\n\t\t\n\t\tfor (Sentence sentence : speechDocument.sentences()) {\n\t\t\tint rawSentimentValue = sentence.sentiment().ordinal();\t//Captures the raw, unnormalized sentiment value from sentence.\n\t\t\tthis.sentimentValues.add(normalize(rawSentimentValue));\t//Normalizes the sentiment value and pushes to ArrayList.\n\t\t}\n\t\t\n\t\treturn this.sentimentValues;\n\t}", "@Test\n\tvoid attributeCardinality() {\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING, BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..*]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING, BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..2]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[1..2]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[1..1]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, CLINICAL_FINDING, DISORDER, BLEEDING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..1]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..0]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[0..0]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[0..1]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[1..*]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"{\" +\n\t\t\t\t\t\t\t\t\"[1..1]\" + FINDING_SITE + \" != <<\" + PULMONARY_VALVE_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[1..*]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS + \"\" +\n\t\t\t\t\t\t\t\t\"}\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[0..0]\" + FINDING_SITE + \" != <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[1..*]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t}", "Collection<? extends Object> getHas_certainty();", "@Test\n void adjectivesScoring() {\n NLPAnalyser np = new NLPAnalyser();\n List<CoreMap> sentences = np.nlpPipeline(\"RT This made my day; glad @JeremyKappell is standing up against #ROC’s disgusting mayor. \"\n + \"Former TV meteorologist Jeremy Kappell suing Mayor Lovely Warren\"\n + \"https://t.co/rJIV5SN9vB (Via NEWS 8 WROC)\");\n HashMap<String, Double> as = np.adjectivesScoring(sentences);\n for (String key : as.keySet()) {\n Double value = as.get(key);\n assertTrue(value >= 0 && value <= 4);\n }\n }", "public List<String> extractIllnesses(String description) {\n\t\tList<String> newSentences = this.getSentences(description);\n\t\t\n\t\t// For each sentence, generate valid word sequences\n\t\tList<String> allValidWordSequences = new ArrayList<String>();\n\t\tnewSentences.forEach(s -> allValidWordSequences.addAll(this.getWordCombinations(s)));\n\n\t\tSicknessMap medicalRecords = SicknessMap.getInstance();\n\t\tList<String> results = allValidWordSequences.stream()\n\t\t\t\t.filter(potentialIllness -> medicalRecords.contains(potentialIllness))\n\t\t\t\t.map(actualIllness -> medicalRecords.getByKey(actualIllness))\n\t\t\t\t.collect(Collectors.toList());\n\t\treturn results;\n\t}", "Boolean getAccruedInterest();", "public static void resultOfPlayAllCorrect() {\n\t\tString mark=\"null\";\n\t\ttry {\n\t\t\tmark=PlayTrivia.playAllRightAnswers();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t\tif(mark==\"Sucsses\") {\n\t\t\tSystem.out.println(\"Test end page has:\" + mark + \" Test pass\");\n\t\t}else{\n\t\t\tSystem.out.println(\"Test end page - failed\");\n\t\t}\n\t}", "default List<String> assignedConcepts(Source code){\n return assignedConcepts(code, ImmutableSet.of());\n }", "boolean isSetScoreAnalysis();", "public ValueMeaning getValueMeaning(){\n return null;\n }", "public static ArrayList<Krediti> falseScetKrediti() {\r\n\t\tArrayList<Krediti> foundKrediti = new ArrayList<Krediti>();\r\n\t\tint i = 0;\r\n\t\tfor (Krediti kredit : kred) {\r\n\t\t\tif (kredit.getStat() == false) {\r\n\t\t\t\tfoundKrediti.add(kredit);\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn foundKrediti;\r\n\t}", "@Test\n\tpublic void priorsAreReasonable() {\n\t\tdouble tot = 0;\n\t\tboolean zeroPrior = false;\n\t\tfor(NewsGroup g: groups) {\n\t\t\tdouble p = g.getPrior();\n\t\t\ttot+=p;\n\t\t\tif(p == 0.0) {\n\t\t\t\tzeroPrior = true;\n\t\t\t}\n\t\t}\n\t\tassertTrue((tot == 1) && !zeroPrior);\n\t}", "public boolean hasSummary() {\n\tif (this.results == null) return false;\n\treturn ((ScenarioResults)this.results).hasSummary();\n}", "@Test\n\tpublic void testNoZeroGFnorm() {\n\t\t\n\t\tList<Term> terms = termino.getTerms().values().stream()\n\t\t\t\t.filter(t-> t.getGeneralFrequencyNorm() == 0)\n\t\t\t\t.collect(Collectors.toList());\n\n\t\tassertThat(terms).isEmpty();\n\t}", "public static CalculationResult thoracicResult()\n {\n\n final Calculation calc = Calculation.forPatient(dummyPatient(1));\n calc.setSpecialty(SampleModels.thoracicSpecialty());\n try\n {\n return calc.calculate(thoracicValues().values(), radiologistPerson());\n }\n catch (final MissingValuesException ex)\n {\n throw new RuntimeException(\"test data did not provide all values\", ex);\n }\n }", "public List<OWLObject> search(OWLObject queryObj) {\n\t\tList<OWLObject> hits = new ArrayList<OWLObject>(maxHits);\n\t\tSystem.out.println(\"gettings atts for \"+queryObj+\" -- \"+simEngine.comparisonProperty);\n\t\tSet<OWLObject> atts = simEngine.getAttributeClosureFor(queryObj);\n\t\tSystem.out.println(\"all atts: \"+atts.size());\n\t\tif (atts.size() == 0)\n\t\t\treturn hits;\n\t\t\n\t\t// only compare using significant atts;\n\t\t// we don't do the same test on candidates as these will be removed by the\n\t\t// intersection operation. they will have a small effect on the score, as\n\t\t// we don't divide by the union, but instead the sum of sizes\n\t\tatts = filterNonSignificantAttributes(atts);\n\t\tSystem.out.println(\"filtered atts: \"+atts.size());\n\n\t\t//bloomFilter = new BloomFilter<OWLObject>(0.05, atts.size());\n\t\t//bloomFilter.addAll(atts);\n\t\t\t\t\n\t\tSortedMap<Integer,Set<OWLObject>> scoreCandidateMap = new TreeMap<Integer,Set<OWLObject>>();\n\t\t\n\t\tfor (OWLObject candidate : getCandidates()) {\n\t\t\tif (candidate.equals(queryObj))\n\t\t\t\tcontinue;\n\t\t\tSet<OWLObject> iAtts = simEngine.getAttributeClosureFor(candidate);\n\t\t\t//Set<OWLObject> iAtts = simEngine.getGraph().getAncestors(candidate);\n\n\t\t\tif (iAtts.size() == 0)\n\t\t\t\tcontinue;\n\t\t\tint cAttsSize = iAtts.size();\n\t\n\t\t\tiAtts.retainAll(atts);\n\t\t\t//Collection<OWLObject> iAtts = bloomFilter.intersection(cAtts);\n\t\t\t\n\t\t\t// simJ, one-sided, scaled by 1000\n\t\t\t// negate to ensure largest first\n\t\t\t//Integer score = - (iAtts.size() * 1000 / cAttsSize);\n\t\t\t\n\t\t\t// this biases us towards genes with large numbers of annotations,\n\t\t\t// but it is better at finding the models that share all features\n\t\t\tInteger score = - iAtts.size();\n\t\t\tif (!scoreCandidateMap.containsKey(score)) \n\t\t\t\tscoreCandidateMap.put(score, new HashSet<OWLObject>());\n\t\t\tscoreCandidateMap.get(score).add(candidate);\n\t\t\treporter.report(this,\"query_candidate_overlap_total\",queryObj,candidate,iAtts.size(),cAttsSize);\n\t\t}\n\t\t\n\t\tint n = 0;\n\t\tfor (Set<OWLObject> cs : scoreCandidateMap.values()) {\n\t\t\tn += cs.size();\n\t\t\thits.addAll(cs);\n\t\t}\n\t\t\n\t\tn = 0;\n\t\tfor (OWLObject hit : hits) {\n\t\t\tn++;\n\t\t\treporter.report(this,\"query_hit_rank_threshold\",queryObj,hit,n,maxHits);\n\t\t}\n\t\tif (hits.size() > maxHits)\n\t\t\thits = hits.subList(0, maxHits);\n\t\t\n\n\n\t\treturn hits;\n\t}", "@Override\n\t\t\tpublic Collection<AnalysisResult> values() {\n\t\t\t\treturn null;\n\t\t\t}", "@Override\n public String toString() {\n if (tree != null) {\n\n String s = tree.render();\n\n s += \"\\n\\nNumber of positive rules: \"\n + getMeasure(\"measureNumPositiveRules\") + \"\\n\";\n s += \"Number of conditions in positive rules: \"\n + getMeasure(\"measureNumConditionsInPositiveRules\") + \"\\n\";\n\n return s;\n } else {\n return \"No model built yet!\";\n }\n }", "public void testDangerSigns() {\n \t// 1. Execute the Classification rule engine to determine patient classifications\n \t// 2. Execute the Treatment rule engine to determine patient treatments\n \texecuteRuleEngines();\n \n // 3. Has the correct number of classifications been determined?\n assertEquals(\"the actual number of patient classifications does not match the expected number\",\n \t\t 2, CcmRuleEngineUtilities.calculateStandardClassificationNumber(getPatientAssessment().getDiagnostics()));\n \n // 4. Have the correct classifications been determined?\n assertEquals(\"incorrect classification assessed\", true, CcmRuleEngineUtilities.classificationPresent(getPatientAssessment().getDiagnostics(), \"Cough for 21 Days or more\"));\n assertEquals(\"incorrect classification assessed\", true, CcmRuleEngineUtilities.classificationPresent(getPatientAssessment().getDiagnostics(), \"Not Able to Drink or Feed Anything\"));\n \n // 5. Have the correct treatments been determined?\n assertEquals(\"incorrect treatment assessed\", true, CcmRuleEngineUtilities.treatmentPresent(getPatientAssessment().getDiagnostics(), \"REFER URGENTLY to health facility\"));\n assertEquals(\"incorrect treatment assessed\", true, CcmRuleEngineUtilities.treatmentPresent(getPatientAssessment().getDiagnostics(), \"Explain why child needs to go to health facility\"));\n assertEquals(\"incorrect treatment assessed\", true, CcmRuleEngineUtilities.treatmentPresent(getPatientAssessment().getDiagnostics(), \"Advise to keep child warm, if 'child is NOT hot with fever'\"));\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n assertEquals(\"incorrect treatment assessed\", true, CcmRuleEngineUtilities.treatmentPresent(getPatientAssessment().getDiagnostics(), \"Write a referral note\"));\n assertEquals(\"incorrect treatment assessed\", true, CcmRuleEngineUtilities.treatmentPresent(getPatientAssessment().getDiagnostics(), \"Arrange transportation and help solve other difficulties in referral\"));\n }", "public Collection<ConceptLabel> processSentence(Sentence sentence, List messages) {\n\t\t// long time = System.currentTimeMillis();\n\t\t// search in lexicon\n\t\tList<Concept> keys = lookupConcepts(sentence);\n\t\t\t\n\t\t// filter out overlapping numbers\n\t\tfilterNumbers(keys);\n\t\tfilterOverlap(keys);\t\t\t\n\t\t\n\t\t// take out concepts that overlap with new concepts\n\t\tList<ReportConcept> reparsedConcepts = new ArrayList<ReportConcept>();\n\t\tfor (ReportConcept c : concepts) {\n\t\t\t// if existing concept intersects this sentence\n\t\t\tif (intersects(c,sentence.getSpan())) {\n\t\t\t\treparsedConcepts.add(c);\n\t\t\t}\n\t\t}\n\n\t\t// take out concepts that will be reparsed anyway\n\t\tconcepts.removeAll(reparsedConcepts);\n\n\t\t// process phrase\n\t\tList<ConceptLabel> labels = new ArrayList<ConceptLabel>();\n\n\t\tfor (Concept concept : keys) {\n\t\t\t// create new labels\n\t\t\tCollection<ConceptLabel> lbl = createConceptLabels(concept,sentence.getCharOffset());\n\t\t\tlabels.addAll(lbl);\n\n\t\t\t// get entry or create it\n\t\t\tReportConcept entry = createReportConcept(concept);\n\t\t\tentry.addLabels(lbl);\n\n\t\t\t// add to all concepts\n\t\t\tconcepts.add(entry);\n\t\t\t// negatedConcepts.remove(entry);\n\n\t\t\t// process numbers\n\t\t\tfor (ConceptLabel l : lbl)\n\t\t\t\tprocessNumericValues(entry, l);\n\t\t}\n\n\t\t// take care of negation\n\t\tnegex.clear();\n\t\tnegex.process(sentence, keys);\n\t\tlabels.addAll(processNegation(negex, messages));\n\n\t\t// backup concepts so that concepts that were merged outside of parsed\n\t\t// sentence could be removed after processing\n\t\tList<ReportConcept> backup = new ArrayList<ReportConcept>(concepts);\n\t\tbackup.removeAll(reparsedConcepts);\n\t\t\n\t\t// compact concepts to more specific constructs\n\t\tprocessConcepts(concepts);\n\t\n\t\t// at this point we can potentially have a situation where\n\t\t// one concept from this sentence subsumed another from the previous or next \n\t\t// sentence\n\t\tfor(ReportConcept c: backup){\n\t\t\tif(!concepts.contains(c))\n\t\t\t\tremovedConcepts.add(c);\n\t\t}\n\t\t\n\t\t// remove dangling digits and units, cause they are likely to be junk\n\t\tremoveDanglingAttributes();\t\t\n\t\t\n\t\t// now that we may have reparsed some concepts, lets\n\t\t// see if we can retain some of the old data\n\t\tfor (ReportConcept rc : reparsedConcepts) {\n\t\t\t// reparsed concept is in the list, then retain its data, if not\n\t\t\t// then it should be removed\n\t\t\tReportConcept nc = TextHelper.get(concepts, rc);\n\t\t\tif (nc != null) {\n\t\t\t\tnc.setConceptEntry(rc.getConceptEntry());\n\t\t\t} else {\n\t\t\t\tremovedConcepts.add(rc);\n\t\t\t}\n\t\t}\n\n\t\t// negate concepts and proces numbers\n\t\tfor (ReportConcept e : negatedConcepts) {\n\t\t\tReportConcept n = TextHelper.get(concepts, e);\n\t\t\tif (n != null) {\n\t\t\t\tn.setNegation(e.getNegation());\n\t\t\t}\n\t\t}\n\n\t\t// clear negation\n\t\tnegatedConcepts.clear();\n\n\t\t// do eggs\n\t\tEggs.processText(sentence.getOriginalString());\n\t\n\t\t// sync to interface\n\t\tsync();\n\t\t\n\t\treturn labels;\n\t}", "@GetMapping(\"/api/skos/concepts\")\n public ResponseEntity<List<Concept>> getSkosConcepts(@RequestParam(value = \"resultGraphIri\", required = false) String graphIri) throws LpAppsException {\n return ResponseEntity.ok(visualizationService.getSkosConcepts(graphIri));\n }", "public SortedSet<Example> getExamplesByQTL(List<String> positives,List<String> negatives,Set<String> questionWords)\n \t{\n \t\tlogger.info(\"getExamplesByQTL(\"+positives+\",\"+negatives+\",\"+questionWords+\")\");\n //\t\tCache cache = getCacheManager().getCache(\"qtl\");\n //\t\tList<Collection> parameters = new LinkedList<Collection>(Arrays.asList(new Collection[]{positives,negatives,questionWords}));\n //\t\t{\n //\t\t\tElement e;\n //\t\t\tif((e=cache.get(parameters))!=null) {return (SortedSet<Example>)e.getValue();}\n //\t\t}\n \t\tQTL qtl = new QTL(endpoint, selectCache);\n \t\tqtl.setExamples(positives, negatives);\n \t\tif(questionWords!=null) {qtl.addStatementFilter(new QuestionBasedStatementFilter(questionWords));}\n \t\tqtl.start();\n \t\t// TODO extract relevant words\n \t\t// behält nur die kanten wo die property mit einem wort oder das objekt ähnlichkeit hat\t\t\n \t\tString query = qtl.getBestSPARQLQuery();\n \t\t// get all triples belonging to the subjects\n \t\tquery = query.replace(\"SELECT ?x0 WHERE {\", \"SELECT ?x0 ?p ?o WHERE {?x0 ?p ?o. \");\n \t\tquery = query.replace(\"?x0\", \"?s\");\n \n \t\ttry\n \t\t{\n \t\t\tResultSet rs = SparqlQuery.convertJSONtoResultSet(selectCache.executeSelectQuery(endpoint, query));\n \t\t\tSortedSet<Example> examples = fillExamples(null, rs);\n \t\t\t//\t\t\tcache.put(new Element(parameters,examples));\n \t\t\t//\t\t\tcache.flush();\n \t\t\tif(examples.size()>MAX_NUMBER_OF_EXAMPLES) {return new TreeSet<Example>(new LinkedList<Example>(examples).subList(0, MAX_NUMBER_OF_EXAMPLES-1));}\n \t\t\treturn examples;\n \n \n \t\t\t//\t\t\tMap<String,Example> examples = new HashMap<String,Example>();\n \t\t\t//\t\t\tLanguageResolver resolver = new LanguageResolver();\n \t\t\t//\t\t\tfor(QuerySolution qs=rs.next(); rs.hasNext();qs=rs.next())\n \t\t\t//\t\t\t{\n \t\t\t//\t\t\t\tString property = qs.getResource(\"p\").getURI();\n \t\t\t//\t\t\t\tif(BlackList.dbpedia.contains(property)) {continue;}\n \t\t\t//\t\t\t\tString uri = qs.getResource(\"x0\").getURI();\n \t\t\t//\n \t\t\t//\t\t\t\tExample e=examples.containsKey(uri)?examples.get(uri):new Example(uri);\n \t\t\t//\t\t\t\texamples.put(uri,e);\n \t\t\t//\n \t\t\t//\t\t\t\tString object = qs.get(\"o\").toString();\n \t\t\t//\n \t\t\t//\t\t\t\tString oldObject=e.get(property);\n \t\t\t//\t\t\t\tif(oldObject!=null)\n \t\t\t//\t\t\t\t{\n \t\t\t//\t\t\t\t\te.set(property, resolver.resolve(oldObject, object));\n \t\t\t//\t\t\t\t}\n \t\t\t//\n \t\t\t//\t\t\t\te.set(property,object.toString());\n \t\t\t//\t\t\t}\n \t\t\t//\t\t\treturn new ArrayList<Example>(examples.values());\n \t\t}\n \t\tcatch(Exception e)\n \t\t{\n \t\t\tthrow new SPARQLException(e,query,endpoint.toString());\n \t\t}\n \t}", "public abstract void overallConcepts(long ms, int n);", "List<SecurityQuestion> getCustomerQuestions(String locale)throws EOTException;", "private void findConceptsForInstances() {\n\t\tSet<String> temp = new HashSet<String>();\n\n\t\tfor (String s : taskInput)\n\t\t\ttemp.add(taxonomyMap.get(s).parents.get(0).value);\n\t\ttaskInput.clear();\n\t\ttaskInput.addAll(temp);\n\n\t\ttemp.clear();\n\t\tfor (String s : taskOutput)\n\t\t\ttemp.add(taxonomyMap.get(s).parents.get(0).value);\n\t\ttaskOutput.clear();\n\t\ttaskOutput.addAll(temp);\n\n\t\tfor (Node s : serviceMap.values()) {\n\t\t\ttemp.clear();\n\t\t\tSet<String> inputs = s.getInputs();\n\t\t\tfor (String i : inputs)\n\t\t\t\ttemp.add(taxonomyMap.get(i).parents.get(0).value);\n\t\t\tinputs.clear();\n\t\t\tinputs.addAll(temp);\n\n\t\t\ttemp.clear();\n\t\t\tSet<String> outputs = s.getOutputs();\n\t\t\tfor (String o : outputs)\n\t\t\t\ttemp.add(taxonomyMap.get(o).parents.get(0).value);\n\t\t\toutputs.clear();\n\t\t\toutputs.addAll(temp);\n\t\t}\n\t}", "public int getCorrectans()\n\t{\n\t\treturn correctAns;\n\t}", "@SuppressWarnings({\n \"static-method\", \"unchecked\"\n })\n private ConceptList findAvailableEditingConcepts(Translation translation,\n PfsParameter pfs, WorkflowService service) throws Exception {\n\n // Cleanse PFS parameter to turn \"concept\" fields into concept refset member\n // fields\n final PfsParameter localPfs =\n pfs == null ? new PfsParameterJpa() : new PfsParameterJpa(pfs);\n if (localPfs.getSortField() != null\n && localPfs.getSortField().equals(\"name\")) {\n localPfs.setSortField(\"conceptName\");\n }\n if (localPfs.getSortField() != null\n && localPfs.getSortField().equals(\"terminologyId\")) {\n localPfs.setSortField(\"conceptId\");\n }\n if (localPfs.getSortField() != null\n && localPfs.getSortField().equals(\"workflowStatus\")) {\n localPfs.setSortField(null);\n }\n\n // Members of the refset\n // That do not have concepts in the translation\n String queryStr = \"select a from ConceptRefsetMemberJpa a, RefsetJpa b \"\n + \"where b.id = :refsetId and a.refset = b \" + \"and a.conceptId NOT IN \"\n + \"(select d.terminologyId from TranslationJpa c, ConceptJpa d \"\n + \" where c.refset = b AND d.translation = c AND c.id = :translationId )\";\n\n List<ConceptRefsetMember> results = null;\n final ConceptListJpa list = new ConceptListJpa();\n int totalCount = 0;\n // No need to use applyPfsToList if there is not a filter\n if (localPfs.getQueryRestriction() == null\n || localPfs.getQueryRestriction().isEmpty()) {\n\n Query ctQuery = ((RootServiceJpa) service).getEntityManager().createQuery(\n \"select count(*) from ConceptRefsetMemberJpa a, RefsetJpa b \"\n + \"where b.id = :refsetId and a.refset = b \"\n + \"and a.conceptId NOT IN \"\n + \"(select d.terminologyId from TranslationJpa c, ConceptJpa d \"\n + \" where c.refset = b AND d.translation = c AND c.id = :translationId )\");\n ctQuery.setParameter(\"refsetId\", translation.getRefset().getId());\n ctQuery.setParameter(\"translationId\", translation.getId());\n\n final Query query =\n ((RootServiceJpa) service).applyPfsToJqlQuery(queryStr, localPfs);\n query.setParameter(\"refsetId\", translation.getRefset().getId());\n query.setParameter(\"translationId\", translation.getId());\n results = query.getResultList();\n totalCount = ((Long) ctQuery.getSingleResult()).intValue();\n }\n\n // Use applyPfsToList if there is a filter\n else {\n\n // Remove query restriction, add it back in later.\n final Query query =\n ((RootServiceJpa) service).applyPfsToJqlQuery(queryStr, null);\n query.setParameter(\"refsetId\", translation.getRefset().getId());\n query.setParameter(\"translationId\", translation.getId());\n int[] totalCt = new int[1];\n results = query.getResultList();\n results = service.applyPfsToList(results, ConceptRefsetMember.class,\n totalCt, localPfs);\n totalCount = totalCt[0];\n }\n\n // Repackage as a concept list\n for (final ConceptRefsetMember member : results) {\n final Concept concept = new ConceptJpa();\n concept.setActive(member.isActive());\n concept.setModuleId(member.getModuleId());\n concept.setTerminologyId(member.getConceptId());\n concept.setName(member.getConceptName());\n list.getObjects().add(concept);\n }\n list.setTotalCount(totalCount);\n\n return list;\n\n }", "@Test\n void adjectivesCommonList() {\n //boolean flag = false;\n NLPAnalyser np = new NLPAnalyser();\n List<CoreMap> sentences = np.nlpPipeline(\"RT This made my day good; glad @JeremyKappell is standing up against bad #ROC’s disgusting mayor. \"\n + \"Former TV meteorologist Jeremy Kappell suing real Mayor Lovely Warren\"\n + \"https://t.co/rJIV5SN9vB worst(Via NEWS 8 WROC)\");\n ArrayList<String> adj = np.adjectives(sentences);\n for (String common : np.getCommonWords()) {\n assertFalse(adj.contains(common));\n }\n }", "Collection<? extends PM_Learning_Material> getHasRecommendation();", "public static void caso11(){\n\t\t\n FilterManager fm= new FilterManager(\"resources/stopWordsList.txt\",\"resources/useCaseWeight.properties\");\n\t\tQualityAttributeBelongable qualityAttributeBelongable = new OntologyManager(\"file:resources/caso1.owl\",\"file:resources/caso1.repository\",fm);\n\t\tMap<QualityAttributeInterface,Double> map = qualityAttributeBelongable.getWordPertenence(\"response\");\n\t\tMapUtils.imprimirMap(map);\n\t}", "public void testGetRelevantTerms422() throws IOException {\n String narr = \"Instances of stolen or forged art in any media are relevant. \\n\" +\n \"Stolen mass-produced things, even though they might be \\n\" +\n \"decorative, are not relevant (unless they are mass-\\n\" +\n \"produced art reproductions). Pirated software, music, movies, \\n\" +\n \"etc. are not relevant.\";\n ArrayList<ArrayList<String>> result = getRelevantTermsHelper(narr);\n assertTrue(result.get(0).toString().equals(\"[instances, stolen, forged, art, media, mass-produced, reproductions]\"));\n assertTrue(result.get(1).toString().equals(\"[decorative, pirated, software, music, movies]\"));\n }", "boolean hasSentimentAnalysis();", "public java.util.List<CodeableConcept> specialArrangement() {\n return getList(CodeableConcept.class, FhirPropertyNames.PROPERTY_SPECIAL_ARRANGEMENT);\n }", "public Vector<Rule> StemBase(){\r\n\t\t//Vector <Rule> rule=new Vector <Rule>();\r\n\t\tConceptLattice cp=new ConceptLattice(context);\r\n\t\tApproximationSimple ap=new ApproximationSimple(cp);\r\n\r\n\t\tBasicSet A=new BasicSet();\r\n\t\tBasicSet cnt=new BasicSet();\r\n\t\tBasicSet b=new BasicSet();\r\n\t\tcnt.addAll(context.getAttributes());\r\n\t\twhile(!A.equals(cnt)){\r\n\r\n\t\t\tif(A.isEmpty()){\r\n\t\t\t\tb =ap.CalculYsecondeNull(A, context);\r\n\t\t\t}else{\r\n\t\t\t\tb=ap.CalculYseconde(A, context);\r\n\t\t\t}\r\n\t\t\tif(!A.equals(b)){\r\n\t\t\t\tBasicSet diff=b.difference(A);\r\n\t\t\t\tBasicSet ant=(BasicSet) A.clone();\r\n\t\t\t\tdouble lift = 1;\r\n\t\t\t\tdouble confidence = 1;\r\n\t\t\t\tRule r=new Rule(ant,diff,context.support(ant.clone().union(diff)), confidence, lift );\r\n\t\t\t\t//int i=0;\r\n\t\t\t\tgetImp().add( r);\t\t\t\t\r\n\t\t\t}\r\n\t\t\tA=this.NextLClosure(cnt, A);\r\n\t\t}\r\n\r\n\t\treturn getImp();\r\n\r\n\t}", "public double calculateSatisfaction(){\n\n\t\tdouble satisfaction=0;\n\t\tif(calculateSurveyQuantity()>=10){\n\n\t\t\tfor(int i=0; i<surveys.length; i++){\n\n\t\t\t\tif(surveys[i]!=null){\n\n\t\t\t\t\tsatisfaction+=surveys[i].calculateSatisfaction();\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tsatisfaction/=calculateSurveyQuantity();\n\n\t\t}\n\n\t\treturn satisfaction;\n\n\t}", "@SuppressWarnings({\n \"static-method\", \"unchecked\"\n })\n private ConceptList findAvailableReview2Concepts(Translation translation,\n PfsParameter pfs, WorkflowService service) throws Exception {\n\n // Concepts of the translation with\n // workflow status in a certain state\n // that do not yet have tracking records\n\n final String queryStr =\n \"select a from ConceptJpa a, TranslationJpa b, TrackingRecordJpa c \"\n + \"where a.translation = b and c.translation = b \"\n + \"and a = c.concept and a.workflowStatus = :reviewDone \"\n + \"and b.id = :translationId and c in (select t from TrackingRecordJpa t join t.reviewers group by t having count(*) = 1)\";\n\n List<Concept> results = null;\n final ConceptListJpa list = new ConceptListJpa();\n int totalCount = 0;\n // No need to use applyPfsToList if there is not a filter\n if (pfs != null && (pfs.getQueryRestriction() == null\n || pfs.getQueryRestriction().isEmpty())) {\n\n final Query ctQuery =\n ((RootServiceJpa) service).getEntityManager().createQuery(\n \"select count(*) from ConceptJpa a, TranslationJpa b, TrackingRecordJpa c \"\n + \"where a.translation = b and c.translation = b \"\n + \"and a = c.concept and a.workflowStatus = :reviewDone \"\n + \"and b.id = :translationId and c in (select t from TrackingRecordJpa t join t.reviewers group by t having count(*) = 1)\");\n ctQuery.setParameter(\"reviewDone\", WorkflowStatus.REVIEW_DONE);\n ctQuery.setParameter(\"translationId\", translation.getId());\n\n final Query query =\n ((RootServiceJpa) service).applyPfsToJqlQuery(queryStr, pfs);\n query.setParameter(\"reviewDone\", WorkflowStatus.REVIEW_DONE);\n query.setParameter(\"translationId\", translation.getId());\n results = query.getResultList();\n totalCount = ((Long) ctQuery.getSingleResult()).intValue();\n }\n\n // Use applyPfsToList if there is a filter\n else {\n\n // Remove query restriction, add it back in later.\n final Query query =\n ((RootServiceJpa) service).applyPfsToJqlQuery(queryStr, null);\n query.setParameter(\"reviewDone\", WorkflowStatus.REVIEW_DONE);\n query.setParameter(\"translationId\", translation.getId());\n int[] totalCt = new int[1];\n results = query.getResultList();\n results = service.applyPfsToList(results, Concept.class, totalCt, pfs);\n totalCount = totalCt[0];\n }\n\n list.getObjects().addAll(results);\n list.setTotalCount(totalCount);\n\n return list;\n\n }", "public double calculateSpecificity() {\n final long divisor = trueNegative + falsePositive;\n if(divisor == 0) {\n return 0.0;\n } else {\n return trueNegative / (double)divisor;\n }\n }", "@Test\n public void Scenario2() {\n\n softAssert = new SoftAssert();\n\n Response resp = reqSpec.request().get();\n\n List<List<Number>> allPerc = resp.jsonPath().getList(\"data.regions.generationmix[0].perc\");\n\n LinkedList<String> regions = new LinkedList<>();\n regions.addAll(resp.jsonPath().getList(\"data.regions.shortname[0]\"));\n\n for (List<Number> perc : allPerc) {\n\n String name = regions.pop();\n\n float result = CalculationUtils.sumListElements(perc);\n\n System.out.println(name);\n System.out.println(\"Sum of perc equals: \" + result);\n System.out.println(\"------------\");\n\n softAssert.assertEquals(100.0, result, 0.1);\n }\n\n softAssert.assertAll();\n }", "boolean hasSuit();", "List<ExamPackage> getListIsComing();", "Collection<String> getPossibleDefeatConditions();", "@Test\n public void shouldGetLoveAll() {\n \n String expResult = \"Love - ALL \" ;\n String result = scoreService.get(nadale, federer) ;\n assertThat( expResult, is(result) ) ;\n }", "default List<String> interestingConcepts(int topK, UnitLocation located,\n Set<Location> irrelevantSet){\n // collect frequent words outside the blacklist of locations\n final TokenIterator extractor = new TokenIterator(irrelevantSet);\n located.getUnitNode().accept(extractor);\n\n final WordCounter wordCounter = new WordCounter(extractor.getItems());\n\n return wordCounter.mostFrequent(topK);\n }", "public abstract int getGuideSchematics();", "public BhiFeasibilityStudyExample() {\r\n\t\toredCriteria = new ArrayList<Criteria>();\r\n\t}", "Boolean getPartiallyCorrect();", "org.hl7.fhir.CodeableConcept getInterpretation();", "@Override\n public Set PatientsWithCaughingAndFever() {\n Set<Patient> patients = new HashSet<>();\n patientRepository.findAll().forEach(patients::add);\n Set<Patient>coughingAndFever = new HashSet<>();\n if(patients != null)\n {\n patients.forEach((patient) ->\n {\n if(patient.getPatientMedicalRecord().getSymptoms().equals(\"Coughing\") || patient.getPatientMedicalRecord().getSymptoms().equals(\"Fever\")){\n coughingAndFever.add(patient);\n }else {\n System.out.println(\"No older patients with symptoms such as caughing and fever\");\n }\n });\n }\n\n return coughingAndFever;\n }", "List<ChargeSummary> value();", "@Override\n\tpublic Collection<PossibleDisease> findPossible(Collection<Symptom> symptoms) {\n\t\tKieServices ks = KieServices.Factory.get();\n\t\tKieBaseConfiguration kbconf = ks.newKieBaseConfiguration();\n\t\tkbconf.setOption(EventProcessingOption.STREAM);\n\t\tKieBase kbase = kieContainer.newKieBase(kbconf);\n\n\t\tKieSession kieSession = kbase.newKieSession();\n\t\tCollection<Disease> all = diseaseRepository.findAll();\n\t\tfor (Disease d : all) {\n\t\t\tkieSession.insert(d);\n\t\t}\n\t\tQueryResults results = kieSession.getQueryResults(\"Bolesti koje sadrze simptome\", symptoms);\n\t\t\n\t\tArrayList<PossibleDisease> retVal = new ArrayList<>();\n\t\tfor(QueryResultsRow qrr : results) {\n\t\t\tDisease d = (Disease) qrr.get(\"$d\");\n\t\t\tlong num = (long) qrr.get(\"$nSymptoms\");\n\t\t\tretVal.add(new PossibleDisease(num, 0L, d));\n\t\t}\n\t\tkieSession.dispose();\n\t\tCollections.sort(retVal, new Comparator<PossibleDisease>() {\n\t\t\t\t\t\tpublic int compare(PossibleDisease o1, PossibleDisease o2) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn -Long.compare(o1.getNumSymptoms(), o2.getNumSymptoms());\n\t\t\t\t\t\t}\n \t\t\t} \n\t\t\t\t);\n\t\treturn retVal;\n\t}", "protected int getNegativeOnes() {\n Rating[] ratingArray = this.ratings;\n int negOneCount = 0;\n for(int i = 0; i < ratingArray.length; i++) {\n if(ratingArray[i] != null) {\n if(ratingArray[i].getScore() == -1) negOneCount++;\n }\n }\n return negOneCount;\n }", "public ConfidenceStatistic evaluateNullHypothesis(\n Collection<? extends Collection<? extends DataType>> treatments );", "public void calculate(Set<Article> articles) {\n \n Set<ArticleDocument> articleDocuments = new HashSet<>();\n for (Article article : articles) {\n articleDocuments.add(article.getDocument());\n }\n \n VSMDocument positiveWords = new TextDocument(\"positive_words.txt\");\n VSMDocument negativeWords = new TextDocument(\"negative_words.txt\");\n \n ArrayList<VSMDocument> documents = new ArrayList<VSMDocument>();\n documents.add(positiveWords);\n documents.add(negativeWords);\n documents.addAll(articleDocuments);\n \n Corpus corpus = new Corpus(documents);\n \n VectorSpaceModel vectorSpace = new VectorSpaceModel(corpus);\n \n double totalPositive = 0;\n double totalNegative = 0;\n \n \n for(ArticleDocument articleDoc : articleDocuments) {\n VSMDocument doc = (VSMDocument) articleDoc;\n System.out.println(\"\\nComparing to \" + doc);\n double positive = vectorSpace.cosineSimilarity(positiveWords, doc);\n double negative = vectorSpace.cosineSimilarity(negativeWords, doc);\n System.out.println(\"Positive: \" + positive);\n System.out.println(\"Negative: \" + negative);\n if (!Double.isNaN(positive)) {\n totalPositive += positive;\n }\n if (!Double.isNaN(negative)) {\n totalNegative += negative;\n }\n double difference = positive - negative;\n if (difference >= 0) {\n System.out.println(\"More positive by \" + difference);\n } else {\n System.out.println(\"More negative by \" + Math.abs(difference));\n }\n \n if (positive >= mostPositive) {\n mostPositive = positive;\n mostPositiveDoc = doc;\n }\n if (negative >= mostNegative) {\n mostNegative = negative;\n mostNegativeDoc = doc;\n }\n if (Math.abs(difference) >= Math.abs(biggestDifference)) {\n biggestDifference = difference;\n biggestDifferenceDoc = doc;\n }\n \n String publisher = articleDoc.getPublisher();\n String region = articleDoc.getRegion();\n LocalDate day = articleDoc.getDate().toLocalDate();\n DayOfWeek weekday = day.getDayOfWeek();\n if (!Double.isNaN(positive)) {\n if (publisherOptimism.containsKey(publisher)) {\n publisherOptimism.get(publisher).add(positive);\n } else {\n publisherOptimism.put(publisher, new LinkedList<Double>());\n publisherOptimism.get(publisher).add(positive);\n }\n \n if (publisherPessimism.containsKey(publisher)) {\n publisherPessimism.get(publisher).add(negative);\n } else {\n publisherPessimism.put(publisher, new LinkedList<Double>());\n publisherPessimism.get(publisher).add(negative);\n }\n \n if (regionOptimism.containsKey(region)) {\n regionOptimism.get(region).add(positive);\n } else {\n regionOptimism.put(region, new LinkedList<Double>());\n regionOptimism.get(region).add(positive);\n }\n \n if (regionPessimism.containsKey(region)) {\n regionPessimism.get(region).add(negative);\n } else {\n regionPessimism.put(region, new LinkedList<Double>());\n regionPessimism.get(region).add(negative);\n }\n \n if (dayOptimism.containsKey(day)) {\n dayOptimism.get(day).add(positive);\n } else {\n dayOptimism.put(day, new LinkedList<Double>());\n dayOptimism.get(day).add(positive);\n }\n \n if (dayPessimism.containsKey(day)) {\n dayPessimism.get(day).add(negative);\n } else {\n dayPessimism.put(day, new LinkedList<Double>());\n dayPessimism.get(day).add(negative);\n }\n \n if (weekdayOptimism.containsKey(weekday)) {\n weekdayOptimism.get(weekday).add(positive);\n } else {\n weekdayOptimism.put(weekday, new LinkedList<Double>());\n weekdayOptimism.get(weekday).add(positive);\n }\n \n if (weekdayPessimism.containsKey(weekday)) {\n weekdayPessimism.get(weekday).add(negative);\n } else {\n weekdayPessimism.put(weekday, new LinkedList<Double>());\n weekdayPessimism.get(weekday).add(negative);\n }\n }\n }\n \n size = articleDocuments.size();\n avgPositive = totalPositive / size;\n avgNegative = totalNegative / size;\n printInfo();\n }", "public static void caso12(){\n\n FilterManager fm= new FilterManager(\"resources/stopWordsList.txt\",\"resources/useCaseWeight.properties\");\n\t\tQualityAttributeBelongable qualityAttributeBelongable = new OntologyManager(\"file:resources/caso1.owl\",\"file:resources/caso1.repository\",fm);\n\t\tMap<QualityAttributeInterface,Double> map = qualityAttributeBelongable.getWordPertenence(\"pan\");\n\t\tif(map==null){\n\t\t\tSystem.out.println(\"El map es null\");\n\t\t}\n\t}", "private List<ConceptMinimal> getConceptMinimalList(String id, Terminology terminology)\n throws JsonMappingException, JsonProcessingException {\n Optional<ElasticObject> esObject = getElasticObject(id, terminology);\n if (!esObject.isPresent()) {\n return Collections.<ConceptMinimal> emptyList();\n }\n\n return esObject.get().getConceptMinimals();\n }", "List<Question> getQuestionsUsed();", "public void testGetRelevantTerms428() throws IOException {\n String narr = \"To be relevant, a document will name a country other than the U.S. \\n\" +\n \"or China in which the birth rate fell from the rate of the\\n\" +\n \"previous year. The decline need not have occurred in more\\n\" +\n \"than the one preceding year.\";\n ArrayList<ArrayList<String>> result = getRelevantTermsHelper(narr);\n assertTrue(result.get(0).toString().equals(\"[name, country, birth, rates, fell, previous, year]\"));\n assertTrue(result.get(1).toString().equals(\"[united, states, china]\"));\n }", "public float[] sense() {\r\n float[] ret = new float[landmarks.length];\r\n \r\n for(int i=0;i<landmarks.length;i++){\r\n float dist = (float) MathX.distance(x, y, landmarks[i].x, landmarks[i].y);\r\n ret[i] = dist + (float)random.nextGaussian() * senseNoise;\r\n } \r\n return ret;\r\n }", "public List<Flow.Significance> getSignificanceToTargetChoices() {\n List<Flow.Significance> significances = new ArrayList<Flow.Significance>();\n significances.add( Flow.Significance.Useful );\n significances.add( Flow.Significance.Critical );\n significances.add( Flow.Significance.Terminates );\n if ( !getFlow().isAskedFor() ) significances.add( Flow.Significance.Triggers );\n return significances;\n }", "@Ignore\n @Test\n public void shouldNotGiveQuestionIfAllQuestionsHaveBeenAnsweredWithInts() {\n attributes.put(FinancialPlanningSpeechlet.GOAL_AMOUNT_KEY, 1000);\n attributes.put(FinancialPlanningSpeechlet.MONTHLY_CONTRIBUTION_KEY, 1000);\n attributes.put(FinancialPlanningSpeechlet.GOAL_PERIOD_KEY, 1000);\n String question = NextQuestionFactory.get(session);\n\n assertThat(question, Is.is(\"\"));\n }", "public static int[] mucScore(LeanDocument key, LeanDocument response)\n{\n // System.out.println(\"==========================================================\");\n // System.out.println(\"Key:\\n\"+key.toStringNoSing()+\"\\n*************************\\nResponse:\\n\"+response.toStringNoSing());\n\n Iterator<TreeMap<Integer, Integer>> goldChains = key.chainIterator();\n // double mucRecall = 0.0;\n int mucRecallNom = 0;\n int mucRecallDenom = 0;\n while (goldChains.hasNext()) {\n TreeMap<Integer, Integer> keyChain = goldChains.next();\n if (keyChain.size() > 1) {\n int numInt = numIntersect(key, keyChain, response);\n\n // int numMatched = getNumMatched(key, keyChain);\n // if(numMatched>0){\n // mucRecallNom += numMatched-numInt;\n mucRecallNom += (keyChain.size() - numInt);\n // mucRecallDenom += numMatched-1;\n mucRecallDenom += keyChain.size() - 1;\n\n // System.out.println(keyChain+\"\\n\"+(keyChain.size() - numInt)+\"/\"+(keyChain.size()-1));\n // }\n }\n }\n int[] result = { mucRecallNom, mucRecallDenom };\n\n return result;\n}", "ArrayList<Float> pierwszaPredykcja()\n\t{\n\t\tif (Stale.scenariusz<100)\n\t\t{\n\t\t\treturn pierwszaPredykcjaNormal();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//dla scenariusza testowego cnea predykcji jest ustawiana na 0.30\n\t\t\tArrayList<Float> L1 = new ArrayList<>();\n\t\t\tL1.add(0.30f);\n\t\t\treturn L1;\n\t\t}\n\t}", "@Test\n public void shouldNotGiveQuestionIfAllQuestionsHaveBeenAnswered() {\n attributes.put(FinancialPlanningSpeechlet.GOAL_AMOUNT_KEY, 1000.0);\n attributes.put(FinancialPlanningSpeechlet.MONTHLY_CONTRIBUTION_KEY, 1000.0);\n attributes.put(FinancialPlanningSpeechlet.GOAL_PERIOD_KEY, 1000.0);\n String question = NextQuestionFactory.get(session);\n\n assertThat(question, Is.is(\"\"));\n }", "T negativeResult();", "public Match[] getMaleSemisWinners() {\n return semi;\n }", "public static void main(String... args) {\n\n Set<Long> As = new HashSet<>();\n int N = 100;\n for (long p = -N; p <= N; ++p) {\n for (long q = -N; q <= p; ++q) {\n for (long r = -N; r <= q; ++r) {\n if (r==0 || p==0 || q==0)\n continue;\n\n long nom = r*p*q;\n long den = r*p + r*q + p*q;\n\n if (den != 0 && nom % den==0 && (nom^den)>=0) {\n long A = nom/den;\n\n if (A==nom) {\n As.add(A);\n System.out.printf(\"A=%d (p=%d, q=%d, r=%d)\\n\", A, p, q, r);\n }\n }\n }\n }\n }\n Long[] aa = As.toArray(new Long[As.size()]);\n Arrays.sort(aa);\n System.out.printf(\"============\\n\");\n System.out.printf(\"A(%d)=%s\\n\", aa.length, Arrays.toString(aa));\n\n for (long a = 1; a < 100; ++a) {\n if (isAlexandrian(a))\n System.out.printf(\"A=%dn\", a);\n }\n }", "@Test\n void getSentimentScore() {\n NLPAnalyser np = new NLPAnalyser();\n List<CoreMap> sentences = np.nlpPipeline(\"RT This made my day; glad @JeremyKappell is standing up against #ROC’s disgusting mayor. \"\n + \"Former TV meteorologist Jeremy Kappell suing Mayor Lovely Warren\"\n + \"https://t.co/rJIV5SN9vB (Via NEWS 8 WROC)\");\n assertTrue(np.getSentimentScore(sentences) >= 0 && np.getSentimentScore(sentences) <=4);\n }", "public List getExamples() {\n\t\tif (examples == null) {\n\t\t\texamples = getFormattedPractices(\"/metadataFieldInfo/field/bestPractices/examples\");\n\t\t}\n\t\treturn examples;\n\t}", "ResultSummary getActualResultSummary();", "List<StadiumModel> getStadiums();", "protected void getEnsures() {\n System.out.println(\"\\nEnsures: \");\n /******************************************/\n String currToken = myIterator.next();\n while(!(currToken = myIterator.next()).equals(\"ensures\"));\n myEnsures = new Expression(myIterator, mye);\n /******************************************/\n System.out.println(\"\\n\");\n }", "public void xxtest_oh_01() {\n String NS = \"http://www.idi.ntnu.no/~herje/ja/\";\n Resource[] expected = new Resource[] {\n ResourceFactory.createResource( NS+\"reiseliv.owl#Reiseliv\" ),\n ResourceFactory.createResource( NS+\"hotell.owl#Hotell\" ),\n ResourceFactory.createResource( NS+\"restaurant.owl#Restaurant\" ),\n ResourceFactory.createResource( NS+\"restaurant.owl#UteRestaurant\" ),\n ResourceFactory.createResource( NS+\"restaurant.owl#UteBadRestaurant\" ),\n ResourceFactory.createResource( NS+\"restaurant.owl#UteDoRestaurant\" ),\n ResourceFactory.createResource( NS+\"restaurant.owl#SkogRestaurant\" ),\n };\n \n test_oh_01scan( OntModelSpec.OWL_MEM, \"No inf\", expected );\n test_oh_01scan( OntModelSpec.OWL_MEM_MINI_RULE_INF, \"Mini rule inf\", expected );\n test_oh_01scan( OntModelSpec.OWL_MEM_RULE_INF, \"Full rule inf\", expected );\n test_oh_01scan( OntModelSpec.OWL_MEM_MICRO_RULE_INF, \"Micro rule inf\", expected );\n }", "public void exercise() {\n List<Transaction> ex1 = transactions.stream()\n .filter(transaction -> transaction.getYear() == 2011)\n .sorted(Comparator.comparing(Transaction::getValue))\n .collect(Collectors.toList());\n System.out.println(ex1);\n\n //2 What are all the unique cities where the traders work?\n List<String> ex2 = transactions.stream()\n .map(transaction -> transaction.getTrader().getCity())\n .distinct()\n .collect(Collectors.toList());\n System.out.println(ex2);\n\n //alternative solution\n Set<String> ex2alt = transactions.stream()\n .map(transaction -> transaction.getTrader().getCity())\n .collect(Collectors.toSet());\n\n //3 Find all traders from Cambridge and sort them by name.\n List<Trader> ex3 = transactions.stream()\n .map(Transaction::getTrader)\n .distinct()\n .filter(trader -> trader.getCity() == \"Cambridge\")\n .sorted(Comparator.comparing(Trader::getName))\n .collect(Collectors.toList());\n System.out.println(ex3);\n\n //4 Return a string of all traders’ names sorted alphabetically.\n String ex4 = transactions.stream()\n .map(transaction -> transaction.getTrader().getName())\n .distinct()\n .sorted()\n .reduce(\"\", (n1, n2) -> n1 + n2);\n System.out.println(ex4);\n\n //alternative solution\n String ex4Alt = transactions.stream()\n .map(transaction -> transaction.getTrader().getName())\n .distinct()\n .sorted()\n .collect(Collectors.joining());\n System.out.println(ex4Alt);\n\n //5 Are any traders based in Milan?\n Boolean ex5 = transactions.stream()\n .anyMatch(transaction -> transaction.getTrader().getCity().equals(\"Milan\"));\n System.out.println(ex5);\n\n //6 Print the values of all transactions from the traders living in Cambridge.\n transactions.stream()\n .filter(transaction -> transaction.getTrader().getCity().equals(\"Cambridge\"))\n .forEach(System.out::println);\n\n //7 What’s the highest value of all the transactions?\n Optional<Integer> ex7 = transactions.stream()\n .map(Transaction::getValue)\n .reduce(Integer::max);\n System.out.println(ex7);\n\n //8 Find the transaction with the smallest value.\n Optional<Transaction> ex8 = transactions.stream()\n .reduce((t1, t2) -> t1.getValue() < t2.getValue() ? t1 : t2);\n System.out.println(ex8);\n\n //alternative solution\n Optional<Transaction> ex8Alt = transactions.stream()\n .min(Comparator.comparing(Transaction::getValue));\n System.out.println(ex8Alt);\n\n }", "public double[] returnAccuracy() throws FileNotFoundException {\n File folder = new File(SPAMTEST);\n File[] listOfFiles = folder.listFiles();\n double percentage = 0;\n double[] returnValue = new double[2];\n\n //CALCULATE THE ACCURACY OF SPAM\n for (File spamFile : listOfFiles) {\n if (IsSpam(spamFile)) {\n percentage++;\n }\n }\n\n percentage = percentage * 100 / listOfFiles.length;\n returnValue[0] = percentage;\n\n //CALCULATE THE ACCURACY OF HAM\n percentage = 0;\n folder = new File(HAMTEST);\n listOfFiles = folder.listFiles();\n for (File hamFile : listOfFiles) {\n if (!IsSpam(hamFile)) {\n percentage++;\n }\n }\n\n percentage = percentage * 100 / listOfFiles.length;\n returnValue[1] = percentage;\n\n return returnValue;\n }", "public abstract Collection<Interest> getInterests();", "public double getTrueAnamoly() {\n return trueAnamoly;\n }", "@Override\n public String[] getResults()\n {\n String[] guidelines = new String[RESULTS_ARRAY_SIZE];\n\n for (int i = 0; i < guidelines.length; i++)\n {\n guidelines[i] = \"\";\n }\n\n // tab position\n Tab currentTab = Tab.values()[mViewPager.getCurrentItem()];\n\n switch(currentTab)\n {\n case CT:\n\n String ct_legend4 = \"Follow up CT or MRI in 6 months. May need more frequent follow-up in some situations, such as a cirrhotic patient who is a liver transplant candidate.\";\n String ct_legend6 = \"Differential diagnosis for a benign-appearing low attenuation mass includes: cyst, hemangioma, hamartoma, bile duct hamartomas\";\n String nofollowup = \"No follow up required.\";\n\n String lowaveragerisk_nofollowup = \"In a patient with low to average risk, this is most likely benign.\";\n String highrisk_followup = \"In a patient with high risk, follow up is recommended.\";\n\n guidelines[0] = \"VALID\";\n\n if(size == 0)\n {\n if(risk_level == 0 || risk_level == 1)\n {\n guidelines[RESULTS_IMPRESSION] = \"There is a low-attenuating liver lesion smaller than 0.5 cm. \" + lowaveragerisk_nofollowup;\n guidelines[RESULTS_FOLLOWUP] = nofollowup;\n }\n else\n {\n guidelines[RESULTS_IMPRESSION] = \"There is a low-attenuating liver lesion smaller than 0.5 cm. \" + highrisk_followup;\n guidelines[RESULTS_FOLLOWUP] = ct_legend4;\n }\n }\n else if(size == 1)\n {\n if(attenuation == 0)\n {\n guidelines[RESULTS_IMPRESSION] = \"There is a benign appearing low-attenuating liver lesion between 0.5 cm and 1.5 cm. \" + ct_legend6;\n guidelines[RESULTS_FOLLOWUP] = nofollowup;\n }\n else if(attenuation == 1)\n {\n guidelines[RESULTS_IMPRESSION] = \"There is a suspicious appearing low-attenuating liver lesion between 0.5 cm and 1.5 cm. \";\n guidelines[RESULTS_FOLLOWUP] = ct_legend4;\n }\n else if(attenuation == 2)\n {\n if(risk_level == 0 || risk_level == 1)\n {\n guidelines[RESULTS_IMPRESSION] = \"There is a flash-filling robustly enhancing lesion between 0.5 cm and 1.5 cm. \" + \"8,9. \" + lowaveragerisk_nofollowup;\n guidelines[RESULTS_CLASSIFICATION] = ct_legend8 + \". \" + ct_legend9;\n guidelines[RESULTS_FOLLOWUP] = nofollowup;\n }\n else\n {\n guidelines[RESULTS_IMPRESSION] = \"There is a flash-filling robustly enhancing lesion between 0.5 cm and 1.5 cm. \" + highrisk_followup;\n guidelines[RESULTS_FOLLOWUP] = ct_legend4 + \"\\n\" + ct_legend7 + \" To evaluate, prefer multiphasic MRI\";\n }\n }\n\n\n }\n else if(size == 2)\n {\n if(attenuation == 0)\n {\n guidelines[RESULTS_IMPRESSION] = \"There is a benign appearing low-attenuating liver lesion larger than 1.5 cm.\";\n guidelines[RESULTS_CLASSIFICATION] = ct_legend6;\n guidelines[RESULTS_FOLLOWUP] = nofollowup;\n }\n else if(attenuation == 1)\n {\n if(risk_level == 0)\n {\n guidelines[RESULTS_IMPRESSION] = \"There is a suspicious appearing low-attenuating liver lesion larger than 1.5 cm in a low risk patient.\";\n guidelines[RESULTS_FOLLOWUP] = ct_legend4;\n }\n else if(risk_level == 1)\n {\n guidelines[RESULTS_IMPRESSION] = \"There is a suspicious appearing low-attenuating liver lesion larger than 1.5 cm in an average risk patient.\";\n guidelines[RESULTS_CLASSIFICATION] = ct_legend7;\n guidelines[RESULTS_FOLLOWUP] = \"Recommend multiphasic MRI for further evaluation.\";\n }\n else if(risk_level == 2)\n {\n guidelines[RESULTS_IMPRESSION] = \"There is a suspicious appearing low-attenuating liver lesion larger than 1.5 cm in a high risk patient.\";\n guidelines[RESULTS_FOLLOWUP] = \"Recommend core biopsy.\";\n }\n }\n else if(attenuation == 2)\n {\n if(features == 0)\n {\n guidelines[RESULTS_IMPRESSION] = \"There is a flash-filling robustly enhancing lesion larger than 1.5 cm with benign diagnostic features.\";\n guidelines[RESULTS_CLASSIFICATION] = ct_legend8 + \"\\n\" + ct_legend9;\n guidelines[RESULTS_FOLLOWUP] = \"Differentiation of FNH from adenoma may be important especially if larger than 4 cm and subcapsular.\";\n }\n else\n {\n guidelines[RESULTS_IMPRESSION] = \"There is a flash-filling robustly enhancing lesion larger than 1.5 cm without benign diagnostic features.\";\n guidelines[RESULTS_IMPRESSION] = \"Differential diagnosis includes hepatocellular or metastatic enhancing malignancy: islet cell, neuroendocrine, carcinoid, renal cell carcinoma, melanoma, choriocarcinoma, sarcoma, breast, some pancreatic lesions.\";\n guidelines[RESULTS_FOLLOWUP] = \"Consider further evaluation with multiphasic MRI or core biopsy. Otherwise \" + ct_legend4.substring(0,1).toLowerCase() + ct_legend4.substring(1);\n }\n }\n }\n\n guidelines[RESULTS_REFERENCE_TEXT] = \"Managing Incidental Findings on Abdominal CT: White Paper of the ACR Incidental Findings Committee\";\n guidelines[RESULTS_REFERENCE_LINK] = \"http://www.jacr.org/article/S1546-1440(10)00330-3/fulltext#sec12\";\n guidelines[RESULTS_REFERENCE_IMAGE] = \"drawable/liver_ct_mass_guidelines\";\n\n\n\n break;\n\n // LI-RADS\n case LIRADS:\n final String LR3 = \"LR-3: Intermediate probability for hepatocellular carcinoma\\n\\nObservation that does not meet criteria for other LI-RADS categories.\";\n final String LR4 = \"LR-4: Probably hepatocellular carcinoma\\n\\nObservation with imaging features suggestive but not diagnostic of HCC.\";\n final String LR5 = \"LR-5: Definitely hepatocellular carcinoma.\\n\\nObservation with imaging features diagnostic of HCC or proven to be HCC at histology.\";\n\n guidelines[0] = \"VALID\";\n\n if(initial_observation == 5)\n {\n\n String findings;\n String criteria_description = \"\";\n int score = washout + capsule;\n if(growth != 0)\n {\n score += 1;\n }\n\n if (washout == 0)\n {\n criteria_description += \", without washout\";\n }\n else\n {\n criteria_description += \", with washout\";\n }\n\n if (capsule == 0)\n {\n criteria_description += \", without capsule\";\n }\n else\n {\n criteria_description += \", with capsule\";\n }\n\n if (growth == 0)\n {\n criteria_description += \", without threshold growth\";\n }\n else\n {\n criteria_description += \", with threshold growth\";\n }\n\n if (arterial == 0)\n {\n // arterial hypo or iso-enhancement\n findings = \"There is an arterial hypoenhancing or isoenhancing lesion\";\n\n if (size == 0 || size == 1)\n {\n // size less than 2.0 cm\n guidelines[RESULTS_IMPRESSION] = findings + \" smaller than 2.0 cm\" + criteria_description + \".\";\n\n if (score == 0 || score == 1)\n {\n // LR3\n guidelines[RESULTS_CLASSIFICATION] = LR3;\n }\n else\n {\n // LR4\n guidelines[RESULTS_CLASSIFICATION] = LR4;\n }\n }\n if (size == 2)\n {\n // size more than 2.0 cm\n guidelines[RESULTS_IMPRESSION] = findings + \" at least 2.0 cm in size\" + criteria_description + \".\";\n\n if (score == 0)\n {\n // LR3\n guidelines[RESULTS_CLASSIFICATION] = LR3;\n }\n else\n {\n // LR4\n guidelines[RESULTS_CLASSIFICATION] = LR4;\n }\n }\n }\n else\n {\n // arterial hyperenhancement\n findings = \"There is an arterial hyperenhancing lesion\";\n\n if (size == 0)\n {\n // less than 1.0 cm\n guidelines[RESULTS_IMPRESSION] = findings + \" smaller than 1.0 cm\" + criteria_description + \".\";\n\n if (score == 0)\n {\n // LR3\n guidelines[RESULTS_CLASSIFICATION] = LR3;\n }\n else\n {\n // LR4\n guidelines[RESULTS_CLASSIFICATION] = LR4;\n }\n }\n else if (size == 1)\n {\n // size between 1.0 and 2.0 cm\n guidelines[RESULTS_IMPRESSION] = findings + \" measuring between 1.0 to 2.0 cm\" + criteria_description;\n\n if (score == 0)\n {\n // LR3\n guidelines[RESULTS_IMPRESSION] += \".\";\n guidelines[RESULTS_CLASSIFICATION] = LR3;\n }\n else if (score == 1)\n {\n // LR4/LR5\n // depending on 50% growth in less than 6 months (LR-5g), or washout and visibility on US (LR-5us)\n\n if(growth == 1 && growth_5g == 1)\n {\n\n guidelines[RESULTS_IMPRESSION] += \" of at least 50% increase in diameter within 6 months.\";\n guidelines[RESULTS_CLASSIFICATION] = LR5.substring(0,4) + \"g\" + LR5.substring(4);\n }\n else if(washout == 1 && ultrasound_5us == 1)\n {\n guidelines[RESULTS_IMPRESSION] += \". Antecedent surveillance ultrasound demonstrates a corresponding visible discrete nodule.\";\n guidelines[RESULTS_CLASSIFICATION] = LR5.substring(0,4) + \"us\" + LR5.substring(4);\n }\n else\n {\n guidelines[RESULTS_IMPRESSION] += \".\";\n guidelines[RESULTS_CLASSIFICATION] = LR4;\n }\n\n }\n else\n {\n // LR5\n guidelines[RESULTS_IMPRESSION] += \".\";\n guidelines[RESULTS_CLASSIFICATION] = LR5;\n }\n }\n else\n {\n // size larger than 2.0 cm\n guidelines[RESULTS_IMPRESSION] = findings + \" at least 2.0 cm in size\" + criteria_description + \".\";\n\n if (score == 0)\n {\n //LR4\n guidelines[RESULTS_CLASSIFICATION] = LR4;\n }\n else\n {\n //LR5\n guidelines[0] = \"VALID\";\n guidelines[RESULTS_CLASSIFICATION] = LR5;\n guidelines[RESULTS_FOLLOWUP] = \"\";\n }\n }\n\n }\n }\n else if(initial_observation == 0)\n {\n guidelines[RESULTS_IMPRESSION] = \"There is a treated liver observation.\";\n guidelines[RESULTS_CLASSIFICATION] = \"LR-Treated: Treated Observation\\n\\nObservation of any category that has undergone loco-regional treatment.\";\n }\n else if(initial_observation == 1)\n {\n guidelines[RESULTS_IMPRESSION] = \"There is a liver observation that is definitely benign.\";\n guidelines[RESULTS_CLASSIFICATION] = \"LR-1: Definitely Benign\\n\\nObersvation with imaging features diagnostic of a benign entity, or definite disappearance at follow up in absence of treatment.\";\n }\n else if(initial_observation == 2)\n {\n guidelines[RESULTS_IMPRESSION] = \"There is a liver observation that is probably benign.\";\n guidelines[RESULTS_CLASSIFICATION] = \"LR-2: Probably Benign\\n\\nObservation with imaging features suggestive but not diagnostic of a benign entity.\";\n }\n else if(initial_observation == 3)\n {\n guidelines[RESULTS_IMPRESSION] = \"There is a liver lesion of probable malignancy, but not specific for HCC.\";\n guidelines[RESULTS_CLASSIFICATION] = \"LR-M:Probably Malignant, not specific for hepatocellular carcinoma\\n\\nObservation with imaging features suggestive of non-HCC malignancy.\";\n }\n else if(initial_observation == 4)\n {\n guidelines[RESULTS_IMPRESSION] = \"There is a liver lesion with tumor in vein.\";\n guidelines[RESULTS_CLASSIFICATION] = \"LR-5V: Definitely hepatocellular carcinoma with Tumor in Vein\\n\\nObservation with imaging features diagnostic of HCC invading vein.\";\n }\n\n guidelines[RESULTS_REFERENCE_TEXT] = \"ACR LI-RADS v2014 for CT and MRI\";\n guidelines[RESULTS_REFERENCE_LINK] = \"https://www.acr.org/Quality-Safety/Resources/LIRADS\";\n\n break;\n\n default:\n break;\n }\n\n return guidelines;\n\n }", "boolean hasHas_certainty();", "public void testGetRelevantTerms408() throws IOException {\n String narr = \"The date of the storm, the area affected, and the extent of \\n\" +\n \"damage/casualties are all of interest. Documents that describe\\n\" +\n \"the damage caused by a tropical storm as \\\"slight\\\", \\\"limited\\\", or\\n\" +\n \"\\\"small\\\" are not relevant. \";\n ArrayList<ArrayList<String>> result = getRelevantTermsHelper(narr);\n assertTrue(result.get(0).toString().equals(\"[date, storm, area, affected, extent, damage, casualties, damage, caused, tropical, storm]\"));\n assertTrue(result.get(1).toString().equals(\"[slight, limited, small]\"));\n }" ]
[ "0.575063", "0.5566088", "0.5535189", "0.54106104", "0.5405572", "0.5388577", "0.5223758", "0.51491714", "0.509736", "0.5056353", "0.5056242", "0.50464314", "0.50459784", "0.5018289", "0.5017012", "0.50133663", "0.4954861", "0.49450648", "0.49338275", "0.4912781", "0.49108782", "0.48707822", "0.48657936", "0.4854864", "0.48215622", "0.4797046", "0.47647992", "0.47613278", "0.47542503", "0.47466806", "0.47433716", "0.47414893", "0.4728469", "0.47238052", "0.47113535", "0.47090197", "0.46986872", "0.46928453", "0.46804684", "0.4678199", "0.46739662", "0.46709487", "0.46662635", "0.4656942", "0.465235", "0.46506068", "0.46468353", "0.46441585", "0.46401203", "0.46266958", "0.46199438", "0.4619153", "0.4614638", "0.46012744", "0.46011156", "0.45943722", "0.4594251", "0.45871446", "0.45836088", "0.4582306", "0.45774907", "0.45753783", "0.4574151", "0.45739865", "0.45659024", "0.4562061", "0.45606738", "0.45568493", "0.45535123", "0.4551825", "0.45506033", "0.4549364", "0.45485663", "0.45453954", "0.45433736", "0.45414314", "0.45346373", "0.45338953", "0.45321348", "0.45289892", "0.45269996", "0.4525196", "0.4523112", "0.45230764", "0.4520705", "0.45159978", "0.45151895", "0.45111027", "0.45109695", "0.45083755", "0.45067218", "0.45054767", "0.45048693", "0.4504385", "0.44954434", "0.44952095", "0.44930604", "0.44905376", "0.4489035", "0.44836968" ]
0.7723358
0
Returns the concept ids of all the concepts that represent positive results for a smear or culture
public static Integer [] getPositiveResultConceptIds() { Set<Concept> positiveConcepts = getPositiveResultConcepts(); Integer [] positiveResultIds = new Integer[positiveConcepts.size()]; int i = 0; for (Concept positiveConcept : positiveConcepts) { positiveResultIds[i] = positiveConcept.getConceptId(); i++; } return positiveResultIds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Set<Concept> getPositiveResultConcepts() {\r\n \tMdrtbService service = Context.getService(MdrtbService.class);\r\n \t\r\n \t// create a list of all concepts that represent positive results\r\n \tSet<Concept> positiveResults = new HashSet<Concept>();\r\n \tpositiveResults.add(service.getConcept(MdrtbConcepts.STRONGLY_POSITIVE));\r\n \tpositiveResults.add(service.getConcept(MdrtbConcepts.MODERATELY_POSITIVE));\r\n \tpositiveResults.add(service.getConcept(MdrtbConcepts.WEAKLY_POSITIVE));\r\n \tpositiveResults.add(service.getConcept(MdrtbConcepts.POSITIVE));\r\n \tpositiveResults.add(service.getConcept(MdrtbConcepts.SCANTY));\r\n \t\r\n \treturn positiveResults;\r\n }", "public ArrayList<Integer> getAnalysisGeneral(){\n resultListGeneral = null ;\n positiveResultGeneral = 0;\n negativeResultGeneral = 0;\n neutralResultGeneral = 0;\n try {\n IndexReader reader = DirectoryReader.open(FSDirectory.open(Paths.get(\"indice/\")));\n this.resultListGeneral = new ArrayList<>();\n\n for (int i = 0; i < reader.numDocs(); i++) {\n Document doc = reader.document(i);\n\n if((doc.get(\"analysis\")).equals(\"Positive\"))\n positiveResultGeneral++;\n else if((doc.get(\"analysis\")).equals(\"Negative\"))\n negativeResultGeneral++;\n else if((doc.get(\"analysis\")).equals(\"Neutral\"))\n neutralResultGeneral++;\n }\n reader.close();\n }\n catch(IOException ioe){\n System.out.println(\"Error\");\n }\n resultListGeneral.add(positiveResultGeneral);\n resultListGeneral.add(negativeResultGeneral);\n resultListGeneral.add(neutralResultGeneral);\n\n return resultListGeneral;\n }", "public ArrayList<Integer> getAnalysis(String Political)\n {\n resultList = null ;\n positiveResult = 0;\n negativeResult = 0;\n neutralResult = 0;\n try{\n IndexReader reader = DirectoryReader.open(FSDirectory.open(Paths.get(\"indice/\")));\n IndexSearcher searcher = new IndexSearcher(reader);\n Analyzer analyzer = new StandardAnalyzer();\n this.resultList = new ArrayList<>();\n QueryParser parser = new QueryParser(\"text\",analyzer);\n Query query = parser.parse(Political);\n TopDocs result = searcher.search(query,25000);\n ScoreDoc[] hits =result.scoreDocs;\n\n for (int i=0; i < hits.length; i++) {\n Document doc = searcher.doc(hits[i].doc);\n\n if((doc.get(\"analysis\")).equals(\"Positive\"))\n positiveResult++;\n else if((doc.get(\"analysis\")).equals(\"Negative\"))\n negativeResult++;\n else if((doc.get(\"analysis\")).equals(\"Neutral\"))\n neutralResult++;\n }\n reader.close();\n }\n catch(IOException | ParseException ex)\n {\n Logger.getLogger(Lucene.class.getName()).log(Level.SEVERE,null,ex);\n\n }\n resultList.add(positiveResult);\n resultList.add(negativeResult);\n resultList.add(neutralResult);\n\n return resultList;\n }", "private List<ConceptMinimal> getConceptMinimalList(String id, Terminology terminology)\n throws JsonMappingException, JsonProcessingException {\n Optional<ElasticObject> esObject = getElasticObject(id, terminology);\n if (!esObject.isPresent()) {\n return Collections.<ConceptMinimal> emptyList();\n }\n\n return esObject.get().getConceptMinimals();\n }", "public ArrayList<Concept> getAllConcepts() {\n \treturn this.concepts.getAllContents();\n }", "default List<String> assignedConcepts(Source code){\n return assignedConcepts(code, ImmutableSet.of());\n }", "private List<String> getSpectrumIdsFound()\r\n\t{\r\n\t\treturn this.spectrumIdsFound;\r\n\t}", "java.util.List<java.lang.Integer> getRareIdList();", "java.util.List<java.lang.Integer> getRareIdList();", "@RequestMapping(value = \"/true-positive\", method = RequestMethod.GET)\r\n public ResponseEntity<?> getTruePositiveResult() {\r\n //TODO\r\n //covidAggregateService.getResult(ResultType.TRUE_POSITIVE);\r\n try {\r\n return new ResponseEntity<>(covidAggregateService.getResult(ResultType.TRUE_POSITIVE), HttpStatus.ACCEPTED);\r\n } catch (Exception e) {\r\n return new ResponseEntity<>(HttpStatus.NOT_FOUND);\r\n }\r\n }", "private void findConceptsForInstances() {\n\t\tSet<String> temp = new HashSet<String>();\n\n\t\tfor (String s : taskInput)\n\t\t\ttemp.add(taxonomyMap.get(s).parents.get(0).value);\n\t\ttaskInput.clear();\n\t\ttaskInput.addAll(temp);\n\n\t\ttemp.clear();\n\t\tfor (String s : taskOutput)\n\t\t\ttemp.add(taxonomyMap.get(s).parents.get(0).value);\n\t\ttaskOutput.clear();\n\t\ttaskOutput.addAll(temp);\n\n\t\tfor (Node s : serviceMap.values()) {\n\t\t\ttemp.clear();\n\t\t\tSet<String> inputs = s.getInputs();\n\t\t\tfor (String i : inputs)\n\t\t\t\ttemp.add(taxonomyMap.get(i).parents.get(0).value);\n\t\t\tinputs.clear();\n\t\t\tinputs.addAll(temp);\n\n\t\t\ttemp.clear();\n\t\t\tSet<String> outputs = s.getOutputs();\n\t\t\tfor (String o : outputs)\n\t\t\t\ttemp.add(taxonomyMap.get(o).parents.get(0).value);\n\t\t\toutputs.clear();\n\t\t\toutputs.addAll(temp);\n\t\t}\n\t}", "@GetMapping(\"/api/skos/concepts\")\n public ResponseEntity<List<Concept>> getSkosConcepts(@RequestParam(value = \"resultGraphIri\", required = false) String graphIri) throws LpAppsException {\n return ResponseEntity.ok(visualizationService.getSkosConcepts(graphIri));\n }", "public static Set<Integer> getParentConceptSequencesFromLogicGraph(LogicGraphSememe<?> logicGraph) {\n\t\tSet<Integer> parentConceptSequences = new HashSet<>();\n\t\tStream<LogicNode> isAs = logicGraph.getLogicalExpression().getNodesOfType(NodeSemantic.NECESSARY_SET);\n\t\tfor (Iterator<LogicNode> necessarySetsIterator = isAs.distinct().iterator(); necessarySetsIterator.hasNext();) {\n\t\t\tNecessarySetNode necessarySetNode = (NecessarySetNode)necessarySetsIterator.next();\n\t\t\tfor (AbstractLogicNode childOfNecessarySetNode : necessarySetNode.getChildren()) {\n\t\t\t\tif (childOfNecessarySetNode.getNodeSemantic() == NodeSemantic.AND) {\n\t\t\t\t\tAndNode andNode = (AndNode)childOfNecessarySetNode;\n\t\t\t\t\tfor (AbstractLogicNode childOfAndNode : andNode.getChildren()) {\n\t\t\t\t\t\tif (childOfAndNode.getNodeSemantic() == NodeSemantic.CONCEPT) {\n\t\t\t\t\t\t\tif (childOfAndNode instanceof ConceptNodeWithSequences) {\n\t\t\t\t\t\t\t\tConceptNodeWithSequences conceptNode = (ConceptNodeWithSequences)childOfAndNode;\n\t\t\t\t\t\t\t\tparentConceptSequences.add(conceptNode.getConceptSequence());\n\t\t\t\t\t\t\t} else if (childOfAndNode instanceof ConceptNodeWithUuids) {\n\t\t\t\t\t\t\t\tConceptNodeWithUuids conceptNode = (ConceptNodeWithUuids)childOfAndNode;\n\t\t\t\t\t\t\t\tparentConceptSequences.add(Get.identifierService().getConceptSequenceForUuids(conceptNode.getConceptUuid()));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Should never happen\n\t\t\t\t\t\t\t\tString msg = \"Logic graph for concept NID=\" + logicGraph.getReferencedComponentNid() + \" has child of AndNode logic graph node of unexpected type \\\"\" + childOfAndNode.getClass().getSimpleName() + \"\\\". Expected ConceptNodeWithSequences or ConceptNodeWithUuids in \" + logicGraph;\n\t\t\t\t\t\t\t\tlog.error(msg);\n\t\t\t\t\t\t\t\tthrow new RuntimeException(msg);\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} else if (childOfNecessarySetNode.getNodeSemantic() == NodeSemantic.CONCEPT) {\n\t\t\t\t\tif (childOfNecessarySetNode instanceof ConceptNodeWithSequences) {\n\t\t\t\t\t\tConceptNodeWithSequences conceptNode = (ConceptNodeWithSequences)childOfNecessarySetNode;\n\t\t\t\t\t\tparentConceptSequences.add(conceptNode.getConceptSequence());\n\t\t\t\t\t} else if (childOfNecessarySetNode instanceof ConceptNodeWithUuids) {\n\t\t\t\t\t\tConceptNodeWithUuids conceptNode = (ConceptNodeWithUuids)childOfNecessarySetNode;\n\t\t\t\t\t\tparentConceptSequences.add(Get.identifierService().getConceptSequenceForUuids(conceptNode.getConceptUuid()));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Should never happen\n\t\t\t\t\t\tString msg = \"Logic graph for concept NID=\" + logicGraph.getReferencedComponentNid() + \" has child of NecessarySet logic graph node of unexpected type \\\"\" + childOfNecessarySetNode.getClass().getSimpleName() + \"\\\". Expected ConceptNodeWithSequences or ConceptNodeWithUuids in \" + logicGraph;\n\t\t\t\t\t\tlog.error(msg);\n\t\t\t\t\t\tthrow new RuntimeException(msg);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tString msg = \"Logic graph for concept NID=\" + logicGraph.getReferencedComponentNid() + \" has child of NecessarySet logic graph node of unexpected type \\\"\" + childOfNecessarySetNode.getNodeSemantic() + \"\\\". Expected AndNode or ConceptNode in \" + logicGraph;\n\t\t\t\t\tlog.error(msg);\n\t\t\t\t\tthrow new RuntimeException(msg);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn parentConceptSequences;\n\t}", "public static ArrayList<Krediti> trueScetKrediti() {\r\n\t\tArrayList<Krediti> foundKrediti = new ArrayList<Krediti>();\r\n\t\tint i = 0;\r\n\t\tfor (Krediti kredit : kred) {\r\n\t\t\tif (kredit.getStat() == true) {\r\n\t\t\t\tfoundKrediti.add(kredit);\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn foundKrediti;\r\n\t}", "public int getCorrectans()\n\t{\n\t\treturn correctAns;\n\t}", "@Test\n\tvoid attributeCardinality() {\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING, BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..*]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING, BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..2]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[1..2]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[1..1]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, CLINICAL_FINDING, DISORDER, BLEEDING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..1]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(CLINICAL_FINDING, DISORDER, BLEEDING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[0..0]\" + FINDING_SITE + \"=*\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\"<<\" + CLINICAL_FINDING + \":[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[0..0]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(BLEEDING_SKIN, PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[0..1]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[1..2]\" + FINDING_SITE + \"= <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[1..*]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"{\" +\n\t\t\t\t\t\t\t\t\"[1..1]\" + FINDING_SITE + \" != <<\" + PULMONARY_VALVE_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[1..*]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS + \"\" +\n\t\t\t\t\t\t\t\t\"}\")));\n\n\t\tassertEquals(\n\t\t\t\tSets.newHashSet(PENTALOGY_OF_FALLOT, PENTALOGY_OF_FALLOT_INCORRECT_GROUPING),\n\t\t\t\tstrings(selectConceptIds(\n\t\t\t\t\t\t\"<<\" + CLINICAL_FINDING + \":\" +\n\t\t\t\t\t\t\t\t\"[0..0]\" + FINDING_SITE + \" != <<\" + BODY_STRUCTURE + \",\" +\n\t\t\t\t\t\t\t\t\"[1..*]\" + ASSOCIATED_MORPHOLOGY + \"= <<\" + STENOSIS)));\n\n\t}", "public ArrayList<Integer> analyze() {\n\t\t//Clears the sentimentValues ArrayList to perform a new analysis.\n\t\tif (this.sentimentValues.size() > 0) {\n\t\t\tthis.sentimentValues = new ArrayList<>();\n\t\t}\n\t\t\n\t\tDocument speechDocument = new Document(this.speech);\t//Create a CoreNLP Document object with speech as input.\n\t\t\n\t\tfor (Sentence sentence : speechDocument.sentences()) {\n\t\t\tint rawSentimentValue = sentence.sentiment().ordinal();\t//Captures the raw, unnormalized sentiment value from sentence.\n\t\t\tthis.sentimentValues.add(normalize(rawSentimentValue));\t//Normalizes the sentiment value and pushes to ArrayList.\n\t\t}\n\t\t\n\t\treturn this.sentimentValues;\n\t}", "@Test\n\tpublic void testValidateSurveyIds() {\n\t\ttry {\n\t\t\tfor(String emptyValue : ParameterSets.getEmptyValues()) {\n\t\t\t\tAssert.assertNull(SurveyResponseValidators.validateSurveyIds(emptyValue));\n\t\t\t}\n\t\t\t\n\t\t\tfor(String simpleValidList : ParameterSets.getSimpleValidLists()) {\n\t\t\t\ttry {\n\t\t\t\t\tSurveyResponseValidators.validateSurveyIds(simpleValidList);\n\t\t\t\t}\n\t\t\t\tcatch(ValidationException e) {\n\t\t\t\t\tfail(\"A valid list failed validation.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(ValidationException e) {\n\t\t\tfail(\"A validation exception was thrown: \" + e.getMessage());\n\t\t}\n\t}", "private void findConceptsForInstances() {\n\t\tfor (int i = 0; i < INPUT.length; i++)\n\t\t\tINPUT[i] = taxonomyMap.get(INPUT[i]).parent.value;\n\n\t\tfor (int i = 0; i < OUTPUT.length; i++)\n\t\t\tOUTPUT[i] = taxonomyMap.get(OUTPUT[i]).parent.value;\n\n\t\tavailableInputs = new HashSet<String>(Arrays.asList(INPUT));\n\t\trequiredOutputs = new HashSet<String>(Arrays.asList(OUTPUT));\n\n\t\tfor (ServiceNode s : serviceMap.values()) {\n\t\t\tSet<String> inputs = s.getInputs();\n\t\t\tSet<String> newInputs = new HashSet<String>();\n\n\t\t\tfor (String i : inputs)\n\t\t\t\tnewInputs.add(taxonomyMap.get(i).parent.value);\n\t\t\ts.setInputs(newInputs);\n\n\t\t\tSet<String> outputs = s.getOutputs();\n\t\t\tSet<String> newOutputs = new HashSet<String>();\n\n\t\t\tfor (String i : outputs)\n\t\t\t\tnewOutputs.add(taxonomyMap.get(i).parent.value);\n\t\t\ts.setOutputs(newOutputs);\n\t\t}\n\t}", "public ArrayList NegativeSentenceDetection() {\n String phraseNotation = \"RB|CC\";//@\" + phrase + \"! << @\" + phrase;\n TregexPattern VBpattern = TregexPattern.compile(phraseNotation);\n TregexMatcher matcher = VBpattern.matcher(sTree);\n ArrayList negativeLists = new ArrayList();\n while (matcher.findNextMatchingNode()) {\n Tree match = matcher.getMatch();\n Tree[] innerChild = match.children();\n for (Tree inChild : innerChild) {\n negativeLists.add(inChild.getLeaves().get(0).yieldWords().get(0).word());\n }\n }\n return negativeLists;\n }", "public List<String> extractIllnesses(String description) {\n\t\tList<String> newSentences = this.getSentences(description);\n\t\t\n\t\t// For each sentence, generate valid word sequences\n\t\tList<String> allValidWordSequences = new ArrayList<String>();\n\t\tnewSentences.forEach(s -> allValidWordSequences.addAll(this.getWordCombinations(s)));\n\n\t\tSicknessMap medicalRecords = SicknessMap.getInstance();\n\t\tList<String> results = allValidWordSequences.stream()\n\t\t\t\t.filter(potentialIllness -> medicalRecords.contains(potentialIllness))\n\t\t\t\t.map(actualIllness -> medicalRecords.getByKey(actualIllness))\n\t\t\t\t.collect(Collectors.toList());\n\t\treturn results;\n\t}", "public List<Integer> getCorrectAnswers() {\n return correctAnswers;\n }", "@Test\n public void testSpecies() throws IOException, UIMAException {\n /*String Text = \"In this text we talk about humans and mice. Because a mouse is no killifish nor a caenorhabditis elegans. Thus, c. elegans is now abbreviated as well as n. furzeri .\";\n\n JCas jCas = JCasFactory.createText(Text);\n\n //AnalysisEngineDescription engine = createEngineDescription(LinnaeusSpecies.class);\n AnalysisEngineDescription engine = createEngineDescription(LinnaeusSpecies.class);\n SimplePipeline.runPipeline(jCas, engine);\n\n String[] casSpecies = (String[]) JCasUtil.select(jCas, Organism.class).stream().map(a -> a.getCoveredText()).toArray(String[]::new);\n //String[] casID = (String[]) JCasUtil.select(jCas, Organism.class).stream().map(b -> b.getId()).toArray(String[]::new);\n\n String[] testSpecies = new String[] {\"humans\", \"mice\", \"mouse\", \"killifish\", \"caenorhabditis elegans\", \"c. elegans\", \"n. furzeri\"};\n //String[] testID = new String[] {\"9606\", \"10090\", \"10090\", \"34780\", \"6239\", \"6239\", \"105023\"};\n\n assertArrayEquals(testSpecies, casSpecies);*/\n //assertArrayEquals(testID, casID);\n }", "public java.util.List<CodeableConcept> specialCourtesy() {\n return getList(CodeableConcept.class, FhirPropertyNames.PROPERTY_SPECIAL_COURTESY);\n }", "private List<Concept> getConceptList(String id, Terminology terminology, IncludeParam ip)\n throws JsonMappingException, JsonProcessingException {\n Optional<ElasticObject> esObject = getElasticObject(id, terminology);\n if (!esObject.isPresent()) {\n return Collections.<Concept> emptyList();\n }\n\n List<Concept> concepts = esObject.get().getConcepts();\n return ConceptUtils.applyInclude(concepts, ip);\n }", "java.util.List<java.lang.Integer> getOtherIdsList();", "java.lang.String getConceptId();", "public abstract void overallConcepts(long ms, int n);", "private Collection<String[]> getPatientIds(String subjectCid) throws Throwable {\n\t\tXmlDocMaker doc = new XmlDocMaker(\"args\");\n\t\tdoc.add(\"size\", \"infinity\");\n\t\tdoc.add(\"action\", \"get-meta\");\n\t\tdoc.add(\"where\", \"cid starts with '\" + subjectCid\n\t\t\t\t+ \"' and model='om.pssd.study' and mf-dicom-study has value\");\n\t\tdoc.add(\"pdist\", 0); // Force local\n\t\tXmlDoc.Element r = executor().execute(\"asset.query\", doc.root());\n\t\tCollection<String> dicomStudyCids = r.values(\"asset/cid\");\n\t\tif (dicomStudyCids == null) {\n\t\t\treturn null;\n\t\t}\n\t\tVector<String[]> patientIds = new Vector<String[]>();\n\t\tfor (String dicomCid : dicomStudyCids) {\n\t\t\tString[] patientId = getPatientIdFromDicomStudy(dicomCid);\n\t\t\tif (patientId != null) {\n\t\t\t\tboolean exists = false;\n\t\t\t\tfor (String[] patientId2 : patientIds) {\n\t\t\t\t\tif (patientId2[0].equals(patientId[0])\n\t\t\t\t\t\t\t&& patientId2[1].equals(patientId[1])\n\t\t\t\t\t\t\t&& patientId2[2].equals(patientId[2])) {\n\t\t\t\t\t\texists = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!exists) {\n\t\t\t\t\tpatientIds.add(patientId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn patientIds;\n\n\t}", "public static ArrayList<Krediti> falseScetKrediti() {\r\n\t\tArrayList<Krediti> foundKrediti = new ArrayList<Krediti>();\r\n\t\tint i = 0;\r\n\t\tfor (Krediti kredit : kred) {\r\n\t\t\tif (kredit.getStat() == false) {\r\n\t\t\t\tfoundKrediti.add(kredit);\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn foundKrediti;\r\n\t}", "List<StadiumModel> getStadiums();", "protected int getNegativeOnes() {\n Rating[] ratingArray = this.ratings;\n int negOneCount = 0;\n for(int i = 0; i < ratingArray.length; i++) {\n if(ratingArray[i] != null) {\n if(ratingArray[i].getScore() == -1) negOneCount++;\n }\n }\n return negOneCount;\n }", "@XmlElement\n private Long getConceptId() {\n return concept != null ? concept.getId() : null;\n }", "static ArrayList<Integer> getAllQuestionIDs(Context context){\n JsonReader reader;\n ArrayList<Integer> questionIDs = new ArrayList<>();\n try {\n reader = readJSONFromAsset(context);\n reader.beginArray();\n while (reader.hasNext()) {\n questionIDs.add(readQuestion(reader).getQuestionID());\n }\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return questionIDs;\n }", "boolean hasResidues();", "public List<String> getSpectrumIdList()\r\n\t{\r\n\t\t/*\r\n\t\t * Return list of spectrum id values.\r\n\t\t */\r\n\t\treturn fetchSpectrumIds();\r\n\t}", "default List<String> assignedConcepts(List<Source> sources){\n return assignedConcepts(10, sources);\n }", "boolean getMissingResults();", "EDataType getSusceptance();", "Set<Concept> getSuperclasses(Concept concept);", "public org.hl7.fhir.CodeableConcept[] getReasonNotGivenArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n java.util.List targetList = new java.util.ArrayList();\n get_store().find_all_element_users(REASONNOTGIVEN$6, targetList);\n org.hl7.fhir.CodeableConcept[] result = new org.hl7.fhir.CodeableConcept[targetList.size()];\n targetList.toArray(result);\n return result;\n }\n }", "List<ExamPackage> getListIsComing();", "public List<Integer> getCorrectAnswers() {\n\t\treturn correctAnswers;\n\t}", "private static Integer[] listaCategoriasCadastradas() throws Exception {\r\n int count = 0;\r\n ArrayList<Categoria> lista = arqCategorias.toList();\r\n Integer[] idsValidos = null; //Lista retornando os ids de categorias validos para consulta\r\n if (!lista.isEmpty()) {\r\n idsValidos = new Integer[lista.size()];\r\n System.out.println(\"\\t** Lista de categorias cadastradas **\\n\");\r\n for (Categoria c : lista) {\r\n System.out.println(c);\r\n idsValidos[count] = c.getID();\r\n count++;\r\n }\r\n }\r\n return idsValidos;\r\n }", "@Override\n\tpublic Collection<PossibleDisease> findPossible(Collection<Symptom> symptoms) {\n\t\tKieServices ks = KieServices.Factory.get();\n\t\tKieBaseConfiguration kbconf = ks.newKieBaseConfiguration();\n\t\tkbconf.setOption(EventProcessingOption.STREAM);\n\t\tKieBase kbase = kieContainer.newKieBase(kbconf);\n\n\t\tKieSession kieSession = kbase.newKieSession();\n\t\tCollection<Disease> all = diseaseRepository.findAll();\n\t\tfor (Disease d : all) {\n\t\t\tkieSession.insert(d);\n\t\t}\n\t\tQueryResults results = kieSession.getQueryResults(\"Bolesti koje sadrze simptome\", symptoms);\n\t\t\n\t\tArrayList<PossibleDisease> retVal = new ArrayList<>();\n\t\tfor(QueryResultsRow qrr : results) {\n\t\t\tDisease d = (Disease) qrr.get(\"$d\");\n\t\t\tlong num = (long) qrr.get(\"$nSymptoms\");\n\t\t\tretVal.add(new PossibleDisease(num, 0L, d));\n\t\t}\n\t\tkieSession.dispose();\n\t\tCollections.sort(retVal, new Comparator<PossibleDisease>() {\n\t\t\t\t\t\tpublic int compare(PossibleDisease o1, PossibleDisease o2) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn -Long.compare(o1.getNumSymptoms(), o2.getNumSymptoms());\n\t\t\t\t\t\t}\n \t\t\t} \n\t\t\t\t);\n\t\treturn retVal;\n\t}", "static Set<String> determineCommonConcepts(HashMap<String, HashSet<String>> data) {\n HashSet<String> result = new HashSet<>();\n HashSet<String> alreadyProcessed = new HashSet<>();\n for (HashMap.Entry<String, HashSet<String>> entry : data.entrySet()) {\n for (String concept : entry.getValue()) {\n if (!alreadyProcessed.contains(concept)) {\n // now check whether the current concept is contained everywhere\n boolean isCommonConcept = true;\n for (HashMap.Entry<String, HashSet<String>> entry2 : data.entrySet()) {\n if (!entry2.getValue().contains(concept)) {\n // not a common concept -> leave for loop early\n isCommonConcept = false;\n break;\n }\n }\n if (isCommonConcept) {\n result.add(concept);\n }\n alreadyProcessed.add(concept);\n }\n }\n }\n return result;\n }", "@SuppressWarnings({\n \"static-method\", \"unchecked\"\n })\n private ConceptList findAvailableEditingConcepts(Translation translation,\n PfsParameter pfs, WorkflowService service) throws Exception {\n\n // Cleanse PFS parameter to turn \"concept\" fields into concept refset member\n // fields\n final PfsParameter localPfs =\n pfs == null ? new PfsParameterJpa() : new PfsParameterJpa(pfs);\n if (localPfs.getSortField() != null\n && localPfs.getSortField().equals(\"name\")) {\n localPfs.setSortField(\"conceptName\");\n }\n if (localPfs.getSortField() != null\n && localPfs.getSortField().equals(\"terminologyId\")) {\n localPfs.setSortField(\"conceptId\");\n }\n if (localPfs.getSortField() != null\n && localPfs.getSortField().equals(\"workflowStatus\")) {\n localPfs.setSortField(null);\n }\n\n // Members of the refset\n // That do not have concepts in the translation\n String queryStr = \"select a from ConceptRefsetMemberJpa a, RefsetJpa b \"\n + \"where b.id = :refsetId and a.refset = b \" + \"and a.conceptId NOT IN \"\n + \"(select d.terminologyId from TranslationJpa c, ConceptJpa d \"\n + \" where c.refset = b AND d.translation = c AND c.id = :translationId )\";\n\n List<ConceptRefsetMember> results = null;\n final ConceptListJpa list = new ConceptListJpa();\n int totalCount = 0;\n // No need to use applyPfsToList if there is not a filter\n if (localPfs.getQueryRestriction() == null\n || localPfs.getQueryRestriction().isEmpty()) {\n\n Query ctQuery = ((RootServiceJpa) service).getEntityManager().createQuery(\n \"select count(*) from ConceptRefsetMemberJpa a, RefsetJpa b \"\n + \"where b.id = :refsetId and a.refset = b \"\n + \"and a.conceptId NOT IN \"\n + \"(select d.terminologyId from TranslationJpa c, ConceptJpa d \"\n + \" where c.refset = b AND d.translation = c AND c.id = :translationId )\");\n ctQuery.setParameter(\"refsetId\", translation.getRefset().getId());\n ctQuery.setParameter(\"translationId\", translation.getId());\n\n final Query query =\n ((RootServiceJpa) service).applyPfsToJqlQuery(queryStr, localPfs);\n query.setParameter(\"refsetId\", translation.getRefset().getId());\n query.setParameter(\"translationId\", translation.getId());\n results = query.getResultList();\n totalCount = ((Long) ctQuery.getSingleResult()).intValue();\n }\n\n // Use applyPfsToList if there is a filter\n else {\n\n // Remove query restriction, add it back in later.\n final Query query =\n ((RootServiceJpa) service).applyPfsToJqlQuery(queryStr, null);\n query.setParameter(\"refsetId\", translation.getRefset().getId());\n query.setParameter(\"translationId\", translation.getId());\n int[] totalCt = new int[1];\n results = query.getResultList();\n results = service.applyPfsToList(results, ConceptRefsetMember.class,\n totalCt, localPfs);\n totalCount = totalCt[0];\n }\n\n // Repackage as a concept list\n for (final ConceptRefsetMember member : results) {\n final Concept concept = new ConceptJpa();\n concept.setActive(member.isActive());\n concept.setModuleId(member.getModuleId());\n concept.setTerminologyId(member.getConceptId());\n concept.setName(member.getConceptName());\n list.getObjects().add(concept);\n }\n list.setTotalCount(totalCount);\n\n return list;\n\n }", "private int[] consensusIds(MessageContext[] ctxs) {\n int[] cids = new int[ctxs.length];\n for (int i = 0; i < ctxs.length; i++) {\n cids[i] = ctxs[i].getConsensusId();\n }\n return cids;\n }", "@Ignore\n @Test\n public void shouldNotGiveQuestionIfAllQuestionsHaveBeenAnsweredWithInts() {\n attributes.put(FinancialPlanningSpeechlet.GOAL_AMOUNT_KEY, 1000);\n attributes.put(FinancialPlanningSpeechlet.MONTHLY_CONTRIBUTION_KEY, 1000);\n attributes.put(FinancialPlanningSpeechlet.GOAL_PERIOD_KEY, 1000);\n String question = NextQuestionFactory.get(session);\n\n assertThat(question, Is.is(\"\"));\n }", "private List<String> fetchSpectrumIds()\r\n\t\t\tthrows InvalidDataException\r\n\t{\r\n\t\t/*\r\n\t\t * Reset search items.\r\n\t\t */\r\n\t\tresetIdsToFind();\r\n\t\t/*\r\n\t\t * Reset spectrum id list data.\r\n\t\t */\r\n\t\tList<String> spectrumIdsFound = new ArrayList<String>();\r\n\t\tsetSpectrumIdsFound(spectrumIdsFound);\r\n\t\tInputStream iStream = getInputStream();\r\n\t\t/*\r\n\t\t * Process spectra in PKL file\r\n\t\t */\r\n\t\tint numberOfSpectra = 0;\r\n\t\t/*\r\n\t\t * Start of spectra reading\r\n\t\t */\r\n\t\ttry\r\n\t\t{\r\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(\r\n\t\t\t\tiStream));\r\n\t\t\tString line;\r\n\t\t\twhile ((line = in.readLine()) != null)\r\n\t\t\t{\r\n\t\t\t\t// Line with 3 columns (float, float, digit)\r\n\t\t\t\tif (line.matches(\"^\\\\d+\\\\.\\\\d*[ \\\\t]\\\\d+\\\\.?\\\\d*[ \\\\t]\\\\d\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t// New spectrum\r\n\t\t\t\t\tnumberOfSpectra++;\r\n\t\t\t\t\t// Use spectra order number as spectrum id value\r\n\t\t\t\t\tString currentSpectrumIdStr = Integer.toString(numberOfSpectra);\r\n\t\t\t\t\tgetSpectrumIdsFound().add(currentSpectrumIdStr);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (IOException exept)\r\n\t\t{\r\n\t\t\tString message = exept.getMessage();\r\n\t\t\tlog.warn(message);\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t/*\r\n\t\t * Return null if no items found.\r\n\t\t */\r\n\t\tif (getSpectrumIdsFound().size() == 0)\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t/*\r\n\t\t * Return result of search for spectrum id values.\r\n\t\t */\r\n\t\treturn getSpectrumIdsFound();\r\n\t}", "public void testRetrievePaymentTerms_IdsArrayContainsNonPositive() throws Exception {\r\n try {\r\n this.getManager().retrievePaymentTerms(new long[]{34, 45, 6, -43});\r\n fail(\"IllegalArgumentException is expected\");\r\n } catch (IllegalArgumentException e) {\r\n assertTrue(e.getMessage()\r\n .indexOf(\"The id of PaymentTerm to retrieve should be positive, but is '-43'\") >= 0);\r\n }\r\n }", "public ArrayList <Integer> detectNonWildcardedSpots () {\n \n ArrayList <Integer> res = new ArrayList (); \n \n for (int i = 0; i < this.getSuccessor().size(); i++) {\n \n if (this.getSuccessor().getToken(i).isNotWildcard())\n res.add(i);\n }\n \n return res; \n }", "@GetMapping(path = \"public/getInconsistentIdRelationsForServices\", produces = {MediaType.APPLICATION_JSON_VALUE})\n public void getInconsistentIdRelationsForServices() {\n FacetFilter ff = new FacetFilter();\n ff.setQuantity(10000);\n ff.addFilter(\"published\", true);\n List<ServiceBundle> allServices = resourceBundleService.getAll(ff, securityService.getAdminAccess()).getResults();\n for (ServiceBundle serviceBundle : allServices) {\n String serviceId = serviceBundle.getId();\n String catalogueId = serviceBundle.getService().getCatalogueId();\n String providerId = serviceBundle.getService().getResourceOrganisation();\n List<String> resourceProviders = serviceBundle.getService().getResourceProviders();\n List<String> relatedResources = serviceBundle.getService().getRelatedResources();\n List<String> requiredResources = serviceBundle.getService().getRequiredResources();\n\n logger.info(String.format(\"Service [%s] of the Provider [%s] of the Catalogue [%s] has the following related resources\",\n serviceId, providerId, catalogueId));\n if (!resourceProviders.isEmpty()) {\n logger.info(String.format(\"Resource Providers [%s]\", resourceProviders));\n }\n if (!relatedResources.isEmpty()) {\n logger.info(String.format(\"Related Resources [%s]\", relatedResources));\n }\n if (!requiredResources.isEmpty()) {\n logger.info(String.format(\"Required Resources [%s]\", requiredResources));\n }\n }\n }", "public List getDonts() {\n\t\tif (donts == null) {\n\t\t\tdonts = getFormattedPractices(\"/metadataFieldInfo/field/bestPractices/donts\");\n\t\t}\n\t\treturn donts;\n\t}", "public List<Concept> getDiagnoses(){\n \treturn diagnoses;\n }", "@SuppressWarnings({\n \"static-method\", \"unchecked\"\n })\n private ConceptList findAvailableReview2Concepts(Translation translation,\n PfsParameter pfs, WorkflowService service) throws Exception {\n\n // Concepts of the translation with\n // workflow status in a certain state\n // that do not yet have tracking records\n\n final String queryStr =\n \"select a from ConceptJpa a, TranslationJpa b, TrackingRecordJpa c \"\n + \"where a.translation = b and c.translation = b \"\n + \"and a = c.concept and a.workflowStatus = :reviewDone \"\n + \"and b.id = :translationId and c in (select t from TrackingRecordJpa t join t.reviewers group by t having count(*) = 1)\";\n\n List<Concept> results = null;\n final ConceptListJpa list = new ConceptListJpa();\n int totalCount = 0;\n // No need to use applyPfsToList if there is not a filter\n if (pfs != null && (pfs.getQueryRestriction() == null\n || pfs.getQueryRestriction().isEmpty())) {\n\n final Query ctQuery =\n ((RootServiceJpa) service).getEntityManager().createQuery(\n \"select count(*) from ConceptJpa a, TranslationJpa b, TrackingRecordJpa c \"\n + \"where a.translation = b and c.translation = b \"\n + \"and a = c.concept and a.workflowStatus = :reviewDone \"\n + \"and b.id = :translationId and c in (select t from TrackingRecordJpa t join t.reviewers group by t having count(*) = 1)\");\n ctQuery.setParameter(\"reviewDone\", WorkflowStatus.REVIEW_DONE);\n ctQuery.setParameter(\"translationId\", translation.getId());\n\n final Query query =\n ((RootServiceJpa) service).applyPfsToJqlQuery(queryStr, pfs);\n query.setParameter(\"reviewDone\", WorkflowStatus.REVIEW_DONE);\n query.setParameter(\"translationId\", translation.getId());\n results = query.getResultList();\n totalCount = ((Long) ctQuery.getSingleResult()).intValue();\n }\n\n // Use applyPfsToList if there is a filter\n else {\n\n // Remove query restriction, add it back in later.\n final Query query =\n ((RootServiceJpa) service).applyPfsToJqlQuery(queryStr, null);\n query.setParameter(\"reviewDone\", WorkflowStatus.REVIEW_DONE);\n query.setParameter(\"translationId\", translation.getId());\n int[] totalCt = new int[1];\n results = query.getResultList();\n results = service.applyPfsToList(results, Concept.class, totalCt, pfs);\n totalCount = totalCt[0];\n }\n\n list.getObjects().addAll(results);\n list.setTotalCount(totalCount);\n\n return list;\n\n }", "public abstract int getGuideSchematics();", "public static void main(String... args) {\n\n Set<Long> As = new HashSet<>();\n int N = 100;\n for (long p = -N; p <= N; ++p) {\n for (long q = -N; q <= p; ++q) {\n for (long r = -N; r <= q; ++r) {\n if (r==0 || p==0 || q==0)\n continue;\n\n long nom = r*p*q;\n long den = r*p + r*q + p*q;\n\n if (den != 0 && nom % den==0 && (nom^den)>=0) {\n long A = nom/den;\n\n if (A==nom) {\n As.add(A);\n System.out.printf(\"A=%d (p=%d, q=%d, r=%d)\\n\", A, p, q, r);\n }\n }\n }\n }\n }\n Long[] aa = As.toArray(new Long[As.size()]);\n Arrays.sort(aa);\n System.out.printf(\"============\\n\");\n System.out.printf(\"A(%d)=%s\\n\", aa.length, Arrays.toString(aa));\n\n for (long a = 1; a < 100; ++a) {\n if (isAlexandrian(a))\n System.out.printf(\"A=%dn\", a);\n }\n }", "public List<Integer> getSuccessors(int v);", "public int[] findAnyPairIndexesCoprime() {\n return findAnyPairIndexesCoprime(seq);\n }", "public Collection<ConceptLabel> processSentence(Sentence sentence, List messages) {\n\t\t// long time = System.currentTimeMillis();\n\t\t// search in lexicon\n\t\tList<Concept> keys = lookupConcepts(sentence);\n\t\t\t\n\t\t// filter out overlapping numbers\n\t\tfilterNumbers(keys);\n\t\tfilterOverlap(keys);\t\t\t\n\t\t\n\t\t// take out concepts that overlap with new concepts\n\t\tList<ReportConcept> reparsedConcepts = new ArrayList<ReportConcept>();\n\t\tfor (ReportConcept c : concepts) {\n\t\t\t// if existing concept intersects this sentence\n\t\t\tif (intersects(c,sentence.getSpan())) {\n\t\t\t\treparsedConcepts.add(c);\n\t\t\t}\n\t\t}\n\n\t\t// take out concepts that will be reparsed anyway\n\t\tconcepts.removeAll(reparsedConcepts);\n\n\t\t// process phrase\n\t\tList<ConceptLabel> labels = new ArrayList<ConceptLabel>();\n\n\t\tfor (Concept concept : keys) {\n\t\t\t// create new labels\n\t\t\tCollection<ConceptLabel> lbl = createConceptLabels(concept,sentence.getCharOffset());\n\t\t\tlabels.addAll(lbl);\n\n\t\t\t// get entry or create it\n\t\t\tReportConcept entry = createReportConcept(concept);\n\t\t\tentry.addLabels(lbl);\n\n\t\t\t// add to all concepts\n\t\t\tconcepts.add(entry);\n\t\t\t// negatedConcepts.remove(entry);\n\n\t\t\t// process numbers\n\t\t\tfor (ConceptLabel l : lbl)\n\t\t\t\tprocessNumericValues(entry, l);\n\t\t}\n\n\t\t// take care of negation\n\t\tnegex.clear();\n\t\tnegex.process(sentence, keys);\n\t\tlabels.addAll(processNegation(negex, messages));\n\n\t\t// backup concepts so that concepts that were merged outside of parsed\n\t\t// sentence could be removed after processing\n\t\tList<ReportConcept> backup = new ArrayList<ReportConcept>(concepts);\n\t\tbackup.removeAll(reparsedConcepts);\n\t\t\n\t\t// compact concepts to more specific constructs\n\t\tprocessConcepts(concepts);\n\t\n\t\t// at this point we can potentially have a situation where\n\t\t// one concept from this sentence subsumed another from the previous or next \n\t\t// sentence\n\t\tfor(ReportConcept c: backup){\n\t\t\tif(!concepts.contains(c))\n\t\t\t\tremovedConcepts.add(c);\n\t\t}\n\t\t\n\t\t// remove dangling digits and units, cause they are likely to be junk\n\t\tremoveDanglingAttributes();\t\t\n\t\t\n\t\t// now that we may have reparsed some concepts, lets\n\t\t// see if we can retain some of the old data\n\t\tfor (ReportConcept rc : reparsedConcepts) {\n\t\t\t// reparsed concept is in the list, then retain its data, if not\n\t\t\t// then it should be removed\n\t\t\tReportConcept nc = TextHelper.get(concepts, rc);\n\t\t\tif (nc != null) {\n\t\t\t\tnc.setConceptEntry(rc.getConceptEntry());\n\t\t\t} else {\n\t\t\t\tremovedConcepts.add(rc);\n\t\t\t}\n\t\t}\n\n\t\t// negate concepts and proces numbers\n\t\tfor (ReportConcept e : negatedConcepts) {\n\t\t\tReportConcept n = TextHelper.get(concepts, e);\n\t\t\tif (n != null) {\n\t\t\t\tn.setNegation(e.getNegation());\n\t\t\t}\n\t\t}\n\n\t\t// clear negation\n\t\tnegatedConcepts.clear();\n\n\t\t// do eggs\n\t\tEggs.processText(sentence.getOriginalString());\n\t\n\t\t// sync to interface\n\t\tsync();\n\t\t\n\t\treturn labels;\n\t}", "public Set<Integer> want() {\n Set<Integer> wanted = new HashSet<>();\n if (incomplete[0] == incomplete[1]) {\n wanted.add(incomplete[0]);\n } else if (Math.abs(incomplete[0] - incomplete[1]) == 1) {\n int left = Math.min(incomplete[0], incomplete[1]);\n if (left - 1 >= 0) wanted.add(left - 1);\n if (left + 2 <= 8) wanted.add(left + 2);\n } else if (Math.abs(incomplete[0] - incomplete[1]) == 2) {\n wanted.add(Math.min(incomplete[0], incomplete[1]) + 1);\n }\n return wanted;\n }", "org.hl7.fhir.CodeableConcept getInterpretation();", "public Taxonomy getInterests();", "public void cleanPrintSetOutWithDontCares(int formula){\n\t\t\n\t\t\n\t\tif(formula ==1){\n\t\t\tSystem.out.println(\"TRUE\");\n\t\t\treturn;\n\t\t}\n\t\t\n\n\t\tArrayList<String> minterms = BDDWrapper.mintermsWithDontCares(bdd, formula, variables);\n\t\tif(minterms == null){\n\t\t\tSystem.out.println(\"FALSE\");\n\t\t\treturn;\n\t\t}\n\t\tfor(String minterm : minterms ){\n//\t\t\tSystem.out.println(\"mintrem is \"+minterm);\n\t\t\tint index = 0;\n\t\t\t//print density vars\n\t\t\tSystem.out.print(\"densityVars: \");\n\t\t\tfor(int i=0; i<coordinationGameStructure.densityVars.size(); i++){\n\t\t\t\tString value = minterm.substring(index, index+coordinationGameStructure.densityVars.get(i).length);\n\t\t\t\tindex+=coordinationGameStructure.densityVars.get(i).length;\n\t\t\t\tSystem.out.print(value+\" \");\n\t\t\t}\n\t\t\t//tasks\n\t\t\tSystem.out.print(\"Tasks: \");\n\t\t\tString value = minterm.substring(index, index+coordinationGameStructure.taskVars.length);\n\t\t\tindex+= coordinationGameStructure.taskVars.length;\n\t\t\tSystem.out.print(value);\n\t\t\tSystem.out.print(\" Signals: \");\n\t\t\tString successSignalsValues = minterm.substring(index, index+coordinationGameStructure.successSignals.length);\n\t\t\tindex+=coordinationGameStructure.successSignals.length;\n\t\t\tSystem.out.print(successSignalsValues);\n\t\t\tSystem.out.print(\" Counter: \");\n\t\t\tString counterValue = minterm.substring(index);\n\t\t\tSystem.out.print(counterValue);\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "private void filterNumbers(List<Concept> concepts) {\n\t\t// make sure there are no overlaps in numbers\n\t\tConcept num = null;\n\n\t\t// find a general number\n\t\tfor (Concept c : concepts) {\n\t\t\tif (c.getConceptClass() != null && NUMERIC.equals(c.getConceptClass().getName())) {\n\t\t\t\tnum = c;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// if there is a number\n\t\tif (num != null) {\n\t\t\t// get number offsets\n\t\t\tint num_st = num.getOffset();\n\t\t\tint num_en = num_st + num.getText().length();\n\n\t\t\t// search all concepts for specific numbers\n\t\t\tList<Concept> torem = new ArrayList<Concept>();\n\t\t\tfor (Concept c : concepts) {\n\t\t\t\tIClass cls = c.getConceptClass();\n\t\t\t\t// if found a specific number, then\n\t\t\t\tif (cls != null && cls != num.getConceptClass() && isNumber(cls) && c.getText() != null) {\n\t\t\t\t\tint st = c.getOffset();\n\t\t\t\t\tint en = st + c.getText().length();\n\n\t\t\t\t\t// if this number is within bounds of general number, then\n\t\t\t\t\t// it is a repeat\n\t\t\t\t\tif (num_st <= st && en <= num_en) {\n\t\t\t\t\t\ttorem.add(c);\n\t\t\t\t\t\t// else if the other number is within bounds of previous\n\t\t\t\t\t\t// number, then discard that\n\t\t\t\t\t} else if (st <= num_st && num_en <= en) {\n\t\t\t\t\t\ttorem.add(num);\n\t\t\t\t\t\tnum = c;\n\t\t\t\t\t\tnum_st = st;\n\t\t\t\t\t\tnum_en = en;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if concept text is \"number\", it is too general to use\n\t\t\t\tif (NUMERIC.toLowerCase().equals(c.getText()))\n\t\t\t\t\ttorem.add(c);\n\t\t\t}\n\n\t\t\t// remove whatever\n\t\t\tfor (Concept r : torem) {\n\t\t\t\tfor (ListIterator<Concept> it = concepts.listIterator(); it.hasNext();) {\n\t\t\t\t\tConcept c = it.next();\n\t\t\t\t\tif (c.getText() != null && c.equals(r) && c.getText().equals(r.getText())) {\n\t\t\t\t\t\tit.remove();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}", "public java.lang.Long getApproxNumConcepts() {\n return approxNumConcepts;\n }", "List<Question> getQuestionsUsed();", "String getConcept();", "int getOtherIds(int index);", "public ArrayList<Integer> getStudentAnswer() {\r\n return this.studentAnswer;\r\n }", "public void testGetRejectReasonIds_Accuracy() {\r\n int[] rejectReasonIds = entry.getRejectReasonIds();\r\n assertEquals(\"The reject reason Ids should be got properly.\", 0, rejectReasonIds.length);\r\n\r\n ExpenseEntryRejectReason rejectReason = new ExpenseEntryRejectReason(1);\r\n entry.addRejectReason(rejectReason);\r\n\r\n rejectReasonIds = entry.getRejectReasonIds();\r\n assertEquals(\"The reject reason Ids should be got properly.\", 1, rejectReasonIds.length);\r\n assertEquals(\"The reject reason Ids should be got properly.\", 1, rejectReasonIds[0]);\r\n }", "List<Long> getBestSolIntersection();", "@SuppressWarnings({\n \"static-method\", \"unchecked\"\n })\n private ConceptList findAvailableReviewConcepts(Translation translation,\n PfsParameter pfs, WorkflowService service) throws Exception {\n\n // Concepts of the translation with\n // workflow status in a certain state\n // that do not yet have tracking records\n final String queryStr =\n \"select a from ConceptJpa a, TranslationJpa b, TrackingRecordJpa c \"\n + \"where a.translation = b and c.translation = b \"\n + \"and a = c.concept and a.workflowStatus = :editingDone \"\n + \"and b.id = :translationId\";\n\n /*\n * final String queryStr =\n * \"select a from ConceptJpa a, TranslationJpa b, TrackingRecordJpa c \" +\n * \"where a.translation = b and c.translation = b \" +\n * \"and a = c.concept and a.workflowStatus = :reviewDone \" +\n * \"and b.id = :translationId and c in (select t from TrackingRecordJpa t join t.reviewers group by t having count(*) = 1)\"\n * ;\n */\n List<Concept> results = null;\n final ConceptListJpa list = new ConceptListJpa();\n int totalCount = 0;\n // No need to use applyPfsToList if there is not a filter\n if (pfs != null && (pfs.getQueryRestriction() == null\n || pfs.getQueryRestriction().isEmpty())) {\n\n final Query ctQuery =\n ((RootServiceJpa) service).getEntityManager().createQuery(\n \"select count(*) from ConceptJpa a, TranslationJpa b, TrackingRecordJpa c \"\n + \"where a.translation = b and c.translation = b \"\n + \"and a = c.concept and a.workflowStatus = :editingDone \"\n + \"and b.id = :translationId\");\n ctQuery.setParameter(\"editingDone\", WorkflowStatus.EDITING_DONE);\n ctQuery.setParameter(\"translationId\", translation.getId());\n\n final Query query =\n ((RootServiceJpa) service).applyPfsToJqlQuery(queryStr, pfs);\n query.setParameter(\"editingDone\", WorkflowStatus.EDITING_DONE);\n query.setParameter(\"translationId\", translation.getId());\n results = query.getResultList();\n totalCount = ((Long) ctQuery.getSingleResult()).intValue();\n }\n\n // Use applyPfsToList if there is a filter\n else {\n\n // Remove query restriction, add it back in later.\n final Query query =\n ((RootServiceJpa) service).applyPfsToJqlQuery(queryStr, null);\n query.setParameter(\"editingDone\", WorkflowStatus.EDITING_DONE);\n query.setParameter(\"translationId\", translation.getId());\n int[] totalCt = new int[1];\n results = query.getResultList();\n results = service.applyPfsToList(results, Concept.class, totalCt, pfs);\n totalCount = totalCt[0];\n }\n\n list.getObjects().addAll(results);\n list.setTotalCount(totalCount);\n\n return list;\n\n }", "@Override\n\tpublic Set<OWLEntity> getAllConcepts() {\n\t\tSet<OWLEntity> result = new HashSet<OWLEntity>();\n\t\tresult.addAll(ontology.getClassesInSignature());\n\t\tresult.addAll(ontology.getIndividualsInSignature());\n\t\treturn result;\n\t}", "public ArrayList <Integer> getIntersection (RuleSet RS) {\n \n ArrayList <Integer> a = new ArrayList ();\n HashSet<Integer> map1 = new HashSet<>(this.indexesOfPrec);\n HashSet<Integer> map2 = new HashSet<>(RS.indexesOfPrec);\n \n map1.retainAll(map2);\n\n a.addAll(map1);\n return a;\n }", "@Test\n\tpublic void testValidatePromptIds() {\n\t\ttry {\n\t\t\tfor(String emptyValue : ParameterSets.getEmptyValues()) {\n\t\t\t\tAssert.assertNull(SurveyResponseValidators.validatePromptIds(emptyValue));\n\t\t\t}\n\t\t\t\n\t\t\tfor(String simpleValidList : ParameterSets.getSimpleValidLists()) {\n\t\t\t\ttry {\n\t\t\t\t\tSurveyResponseValidators.validatePromptIds(simpleValidList);\n\t\t\t\t}\n\t\t\t\tcatch(ValidationException e) {\n\t\t\t\t\tfail(\"A valid list failed validation.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(ValidationException e) {\n\t\t\tfail(\"A validation exception was thrown: \" + e.getMessage());\n\t\t}\n\t}", "java.util.List<java.lang.Integer> getListSnIdList();", "Collection<? extends Integer> getHasAlcoholSpecimanType();", "public Integer getIsspecific() {\n return isspecific;\n }", "@XmlElement\n private String getConceptTerminologyId() {\n return concept != null ? concept.getTerminologyId() : \"\";\n }", "java.lang.String getResidues();", "private void getCorrectAnswers() {\n\t\tfor(int i = 0; i < numberAmt; i++) {\n\t\t\tif(randomNumbers.get(i).equals(answers.get(i)))\n\t\t\t\tcorrectAnswers++;\n\t\t}\n\t}", "private List<Integer> processRelatedDocsQuery(String query) {\r\n List<Integer> result = new ArrayList<>();\r\n\r\n for(String term : this.preprocessor.processQuery(query).keySet()) {\r\n\r\n // skip unknown terms\r\n if (!this.index.getDict().containsKey(term)) continue;\r\n\r\n // for each occurrence\r\n for(TermFrequency tf : this.index.getDict().get(term)){\r\n int id = tf.getDocId();\r\n if(!result.contains(id))\r\n result.add(id);\r\n }\r\n }\r\n\r\n return result;\r\n }", "public ArrayList<Integer> courseIDs() {\r\n ArrayList<Integer> ids = new ArrayList<Integer>();\r\n for (Course course : getCourse()) {\r\n ids.add(course.getSubject().getID());\r\n }\r\n return ids;\r\n }", "public List<Integer> getShingles() {\n\t\tfor (Integer hash : hashes) { \n\t\t\tint minXor = Integer.MAX_VALUE; \n\t\t\tfor (String word : words) { \n\t\t\t\tint xorHash = word.hashCode() ^ hash; //Bitwise XOR the string hashCode with the hash \n\t\t\t\tif (xorHash < minXor) \n\t\t\t\t\tminXor = xorHash; \n\t\t\t} \n\t\t\tshingles.add(minXor); //Only store the shingle with the minimum hash for each hash function \n\t\t} \n\t\t\n\t\treturn shingles;\n\t}", "public List<String> getConceptSources(){\n \treturn conceptSources;\n }", "private int getScoreMultiple(MMObjectNode questionNode, MMObjectNode givenAnswer) {\n Vector givenAnswers = givenAnswer.getRelatedNodes(\"mcanswers\");\n Vector goodAnswers = questionNode.getRelatedNodes(\"mcanswers\");\n\n // First check if all the given answers are correct\n for (int i=0; i<givenAnswers.size(); i++) {\n if (((MMObjectNode)givenAnswers.get(i)).getIntValue(\"correct\") != 1) {\n return 0;\n }\n }\n\n // Secondly check if all the correct answers are given\n for (int i=0; i<goodAnswers.size(); i++) {\n if (((MMObjectNode)goodAnswers.get(i)).getIntValue(\"correct\") == 1) {\n if (!givenAnswers.contains(goodAnswers.get(i))) {\n return 0;\n }\n }\n }\n\n // ALl tests succeeded: answer is correct\n return 1;\n }", "private ArrayList<Integer> possibleScores() {\n return new ArrayList<Integer>();\n }", "public float[] sense() {\r\n float[] ret = new float[landmarks.length];\r\n \r\n for(int i=0;i<landmarks.length;i++){\r\n float dist = (float) MathX.distance(x, y, landmarks[i].x, landmarks[i].y);\r\n ret[i] = dist + (float)random.nextGaussian() * senseNoise;\r\n } \r\n return ret;\r\n }", "private static String numberOfViolatedRulesIn(GitHubProject project) {\n Optional<RatingValue> ratingValue = project.ratingValue();\n if (!ratingValue.isPresent()) {\n return \"UNKNOWN\";\n }\n\n int n = findViolatedRulesIn(ratingValue.get().scoreValue().usedValues()).size();\n\n if (n == 0) {\n return \"No violated rules\";\n }\n\n return String.format(\"%d violated rule%s\", n, n > 1 ? \"s\" : \"\");\n }", "public ArrayList<T> getNonZero() {\n\t\tArrayList<T> nonZeroes = new ArrayList<T>();\n\t\tfor (T element : itemProbs_.keySet()) {\n\t\t\tif (itemProbs_.get(element) > 0) {\n\t\t\t\tnonZeroes.add(element);\n\t\t\t}\n\t\t}\n\t\treturn nonZeroes;\n\t}", "private void filterOverlap(List<Concept> concepts) {\n\t\t// go over concepts in\n\t\tSet<Concept> torem = new HashSet<Concept>();\n\t\tConcept p = null;\n\t\tfor(Concept c : concepts){\n\t\t\tif(p != null){\n\t\t\t\tif(c.getCode().equals(p.getCode())){\n\t\t\t\t\tif(c.getText() != null && c.getText().contains(p.getText())){\n\t\t\t\t\t\ttorem.add(p);\n\t\t\t\t\t}else if(p.getText() != null && p.getText().contains(c.getText())){\n\t\t\t\t\t\ttorem.add(c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tp = c;\n\t\t}\n\t\t\n\t\t// remove whatever\n\t\tfor (Concept r : torem) {\n\t\t\tfor (ListIterator<Concept> it = concepts.listIterator(); it.hasNext();) {\n\t\t\t\tConcept c = it.next();\n\t\t\t\tif (c.equals(r) && c.getText().equals(r.getText())) {\n\t\t\t\t\tit.remove();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "boolean hasConceptGroup();", "private Map<String, Integer> identifyInputs(Bookshelf basis) {\n\n\tMap<String, Integer> idPairs = new HashMap<String, Integer>();\n\n\tmaxTagMag = 0;\n\n\tint i = 0;\n\n\tIterator<Book> books = basis.iterator();\n\n\twhile (books.hasNext()) {\n\t Book book = books.next();\n\t Iterator<Map.Entry<String, Integer>> tags = book.enumerateTags()\n\t\t .iterator();\n\n\t while (tags.hasNext()) {\n\n\t\tMap.Entry<String, Integer> tag = tags.next();\n\n\t\tmaxTagMag = Math.max(maxTagMag, Math.abs(tag.getValue()));\n\n\t\tif (!idPairs.containsValue(tag.getKey())) {\n\t\t idPairs.put(tag.getKey(), i);\n\t\t ++i;\n\t\t}\n\t }\n\t}\n\tidPairs.put(OTHER, i);\n\n\tnumTags = i + 1;\n\n\treturn idPairs;\n }", "public int getNumPositive() {\n int numPositive = 0;\n for (NucleiSelected n : nucleiSelected) {\n switch (n.getState()) {\n case POSITIVE:\n numPositive++;\n break;\n case NEGATIVE:\n // do nothing\n break;\n }\n }\n return numPositive;\n }", "default List<String> assignedConcepts(Source code, final Set<String> relevant){\n final Context context = Sources.from(code);\n\n final UnitLocation unit = relevant.isEmpty()\n ? locatedCompilationUnit(context)\n : locatedMethod(context, relevant);\n\n if(unit == null) return ImmutableList.of();\n\n return assignedConcepts(unit, 10);\n }", "public java.util.List<CodeableConcept> specialArrangement() {\n return getList(CodeableConcept.class, FhirPropertyNames.PROPERTY_SPECIAL_ARRANGEMENT);\n }", "public static List<YesNo> listAll() {\n return new ArrayList<YesNo>(Arrays.asList(values()));\n }", "public int getNumberOfValidatedSpectra() {\n int lCount = 0;\n for (Object lPeptideIdentification : iPeptideIdentifications) {\n // Raise the count if the identification is validated.\n if (((PeptideIdentification) lPeptideIdentification).isValidated()) {\n lCount++;\n }\n }\n return lCount;\n }" ]
[ "0.75711095", "0.5432642", "0.5181685", "0.5112589", "0.5110684", "0.5061149", "0.5050232", "0.5018231", "0.5018231", "0.49741885", "0.49317434", "0.49244174", "0.4901812", "0.4822839", "0.476017", "0.47549745", "0.47429666", "0.47226086", "0.47126785", "0.4674551", "0.4670401", "0.46638408", "0.4663158", "0.4654497", "0.46369427", "0.46347398", "0.46307203", "0.46246743", "0.4624619", "0.46174353", "0.46125716", "0.4604778", "0.45907047", "0.4583205", "0.45723256", "0.45492", "0.45481738", "0.45443442", "0.45368895", "0.45246336", "0.4517944", "0.4515994", "0.4513091", "0.45034444", "0.45018047", "0.44916722", "0.44746402", "0.4473445", "0.44728932", "0.44634178", "0.44594544", "0.44491023", "0.44400737", "0.44346848", "0.44298077", "0.44292495", "0.44249108", "0.4421554", "0.44183213", "0.44047117", "0.43988967", "0.43978485", "0.4395985", "0.43898505", "0.43896967", "0.4387055", "0.43859848", "0.4381133", "0.43808177", "0.43793753", "0.437116", "0.43695733", "0.43581665", "0.4357411", "0.4353763", "0.43502954", "0.43475223", "0.4343241", "0.43430156", "0.43429396", "0.434233", "0.43418983", "0.43405762", "0.4336373", "0.43284047", "0.43218565", "0.4311108", "0.43090138", "0.43034506", "0.43028754", "0.43027487", "0.4299933", "0.42950875", "0.42924732", "0.42895034", "0.42741045", "0.42718616", "0.4271153", "0.42696288", "0.42671072" ]
0.77154744
0
Loads and sorts the drugs stored in the global property mdtrb.defaultDstDrugs
public static List<List<Object>> getDefaultDstDrugs() { List<List<Object>> drugs = new LinkedList<List<Object>>(); String defaultDstDrugs = Context.getAdministrationService().getGlobalProperty("mdrtb.defaultDstDrugs"); if(StringUtils.isNotBlank(defaultDstDrugs)) { // split on the pipe for (String drugString : defaultDstDrugs.split("\\|")) { // now split into a name and concentration String drug = drugString.split(":")[0]; String concentration = null; if (drugString.split(":").length > 1) { concentration = drugString.split(":")[1]; } try { // see if this is a concept id Integer conceptId = Integer.valueOf(drug); Concept concept = Context.getConceptService().getConcept(conceptId); if (concept == null) { log.error("Unable to find concept referenced by id " + conceptId); } // add the concept/concentration pair to the list else { addDefaultDstDrugToMap(drugs, concept, concentration); } } catch (NumberFormatException e) { // if not a concept id, must be a concept map Concept concept = Context.getService(MdrtbService.class).getConcept(drug); if (concept == null) { log.error("Unable to find concept referenced by " + drug); } // add the concept to the list else { addDefaultDstDrugToMap(drugs, concept, concentration); } } } } return drugs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static List<Concept> sortMdrtbDrugs(List<Concept> drugs) {\r\n \treturn MdrtbUtil.sortDrugs(drugs, Context.getService(MdrtbService.class).getMdrtbDrugs());\r\n }", "private static void addDefaultDstDrugToMap(List<List<Object>> drugs, Concept concept, String concentration) {\r\n \tList<Object> data = new LinkedList<Object>();\r\n \tdata.add(concept);\r\n \tdata.add(concentration);\r\n \tdrugs.add(data);\r\n }", "public void sortDNAs() {\n DNAs = TLArrayList.sort(DNAs);\n }", "public static void sortByPopular(){\n SORT_ORDER = POPULAR_PATH;\n }", "public static List<Concept> sortAntiretrovirals(List<Concept> drugs) {\r\n \treturn MdrtbUtil.sortDrugs(drugs, Context.getService(MdrtbService.class).getAntiretrovirals());\r\n }", "public static void dimension_sort() { // sort the dimensions according to their effect to GCP\n\t\tfor (int i = 0;i < dims-1;i++) {\n\t\t\tdimension[i] = (byte) i;\n\t\t}\n\t\tboolean swapped = true;\n\t\tint i=0;\n\t\tbyte temp;\n\t\twhile (swapped) {\n\t\t\tswapped = false;\n\t\t\ti++;\n\t\t\tfor (int j = 0; j < dimension.length-i;j++) { // smaller range, put it the front\n\t\t\t\tif (cardinalities[dimension[j]] > cardinalities[dimension[j+1]]) {\n\t\t\t\t\ttemp = dimension[j];\n\t\t\t\t\tdimension[j] = dimension[j+1];\n\t\t\t\t\tdimension[j+1] = temp;\n\t\t\t\t\tswapped = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void sortDaysArray() {\n if (_savedDates.size() > 0) {\n Collections.sort(_savedDates, Collections.reverseOrder());\n }\n //Log.i(\"DailyLogFragment\", \"_savedDates after sort = \" + _savedDates);\n }", "private void shuffleDistricts(int maxDist) {\n\t\tRandom randGen = new Random();\n\t\tint rand = 0;\n\t\t\n\t\t// Reset String\n\t\tmDistDisp = \"\";\n\t\t\n\t\tfor (int i = 0; i<maxDist; i ++) {\n\t\t\trand = randGen.nextInt(Card.NUM_BONUS_DISTRICT);\n\t\t\tmDistDisp = mDistDisp + (i+1) + \". \" + mDistrictDB[rand].name;\n\t\t\tif (i<maxDist-1) mDistDisp = mDistDisp + \"\\n\";\n\t\t}\n\t\tupdateDisplayDistricts();\n\t}", "private void sort() {\n setFiles(getFileStreamFromView());\n }", "private void populateBasicLists() {\n // TODO chathuranga change following\n districtList = districtDAO.getDistrictNames(language, user);\n // TODO chathuranga when search by all district option\n /* if (districtId == 0) {\n if (!districtList.isEmpty()) {\n districtId = districtList.keySet().iterator().next();\n logger.debug(\"first allowed district in the list {} was set\", districtId);\n }\n }*/\n dsDivisionList = dsDivisionDAO.getDSDivisionNames(districtId, language, user);\n mrDivisionList = mrDivisionDAO.getMRDivisionNames(dsDivisionId, language, user);\n }", "@PostConstruct\r\n public void init() {\r\n all.addAll(allFromDB());\r\n Collections.sort(all);\r\n }", "public void setupDryadCloudDataSets(){\n\t\ttry{\n\t\t\t\n\t\t\t// A Dryad \n\t\t\tDryadDataSet ds = new DryadDataSet(_DRYAD_D1_TREEBASE);\n\t\t\tds.harvestMetadataToRDF();\n\t\t\tds.harvestDataToRDF(_DRYAD_D1_TREEBASE_F1);\n\t\t\t_datasets.add(ds);\n\t\t\tds = new DryadDataSet(_DRYAD_D3_POPULAR);\n\t\t\tds.harvestMetadataToRDF();\n\t\t\tds.harvestDataToRDF(_DRYAD_D3_POPULAR_F1);\n\t\t\t_datasets.add(ds);\n\t\t\tds = new DryadDataSet(_DRYAD_D4_CSV);\n\t\t\tds.harvestMetadataToRDF();\n\t\t\tds.harvestDataToRDF(_DRYAD_D4_CSV_F1);\n\t\t\tds.harvestDataToRDF(_DRYAD_D4_CSV_F2);\n\t\t\t_datasets.add(ds);\n\t\t\tds = new DryadDataSet(_DRYAD_D6_CSV);\n\t\t\tds.harvestMetadataToRDF();\n\t\t\tds.harvestDataToRDF(_DRYAD_D6_CSV_F1);\n\t\t\tds.harvestDataToRDF(_DRYAD_D6_CSV_F2);\n\t\t\t_datasets.add(ds);\n\t\t\tds = new DryadDataSet(_DRYAD_D2_GENBANK);\n\t\t\tds.harvestMetadataToRDF();\n\t\t\tds.harvestDataToRDF(_DRYAD_D2_GENBANK_F1);\t\n\t\t\tds.harvestDataToRDF(_DRYAD_D2_GENBANK_F2);\n\t\t\tds.harvestDataToRDF(_DRYAD_D2_GENBANK_F3);\n\t\t\tds.harvestDataToRDF(_DRYAD_D2_GENBANK_F4);\n\t\t\t_datasets.add(ds);\n\t\t\tds = new DryadDataSet(_DRYAD_D5_CSV);\n\t\t\tds.harvestMetadataToRDF();\n\t\t\tds.harvestDataToRDF(_DRYAD_D5_CSV_F1);\n\t\t\tds.harvestDataToRDF(_DRYAD_D5_CSV_F2);\n\t\t\t_datasets.add(ds);\n\t\t}\n\t\tcatch(Exception ex){\n\t\t\tSystem.out.println(\"ERROR: Exception \"+ex.getMessage());\n\t\t}\n\t}", "private void loadDays(){\n MyDBHandler db = new MyDBHandler(this);\n dayOfTheWeek.clear();\n dayOfTheWeek.addAll(db.getDaysOfTheWeek());\n }", "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 void ordenarEquipoPorCiudad(){\n Collections.sort(listaEquipos, Equipo.CompararPorCiudad);\n }", "public static void init_default_traffic() throws SQLException{\n\t\tint length = Common.roadlist.length;\n\t\tdefault_traffic = new double[length][(int)Common.max_seg + 1];\n\t\t//28 classes of road ,max id is 305, set 350 here\n\t\tdefault_class_traffic = new double [350][(int)Common.max_seg + 1];\n\t\t//start read traffic from database\n\t\tConnection con = Common.getConnection();\n\t\ttry{\n\t\t\t//read default road speed\n\t\t\tStatement stmt = con.createStatement();\n\t\t\t//read by period\n\t\t\tfor(int i=1; i<=Common.max_seg; i++){\n\t\t\t\tString traffic_table = Common.history_road_slice_table + i;\n\t\t\t\t//read data\n\t\t\t\tString sql = \"select * from \" + traffic_table + \";\";\n\t\t\t\tResultSet rs = stmt.executeQuery(sql);\n\t\t\t\tint[] class_id_counter = new int[350];\n\t\t\t\twhile(rs.next()){\n\t\t\t\t\tint gid = rs.getInt(\"gid\");\n\t\t\t\t\tint class_id = rs.getInt(\"class_id\");\n\t\t\t\t\tclass_id_counter[class_id]++;\n\t\t\t\t\t//Common.logger.debug(gid);\n\t\t\t\t\tdouble speed = rs.getDouble(\"average_speed\");\n\t\t\t\t\tdefault_traffic[gid][i] = speed;\n\t\t\t\t\tdefault_class_traffic[class_id][i] += speed;\n\t\t\t\t}\n\t\t\t\t//get average speed of roads in same class\n\t\t\t\tfor(int j=0; j<class_id_counter.length; j++){\n\t\t\t\t\tint counter = class_id_counter[j];\n\t\t\t\t\tif(counter > 0){\n\t\t\t\t\t\tdefault_class_traffic[j][i] /= counter;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tcon.rollback();\n\t\t}\n\t\tfinally{\n\t\t\tcon.commit();\n\t\t}\t\t\n\t}", "public void initializeAfterLoading() {\n sortMediaFiles();\n }", "public static void readGhostCases(String name, int limitSize) {\n\t\t\n\t\tArrayList<JSONObject> json=new ArrayList<JSONObject>();\n\t JSONObject obj;\n\t // The name of the file to open.\n\t String fileName = \"bin/es/ucm/fdi/ici/c1920/practica4/grupo04/data/\".replace(\"/\", java.io.File.separator) + name + \".json\";\n\n\t // This will reference one line at a time\n\t String line = null;\n\n\t try {\n\t // FileReader reads text files in the default encoding.\n\t FileReader fileReader = new FileReader(fileName);\n\n\t // Always wrap FileReader in BufferedReader.\n\t BufferedReader bufferedReader = new BufferedReader(fileReader);\n\n\t while((line = bufferedReader.readLine()) != null) {\n\t obj = (JSONObject) new JSONParser().parse(line);\n\t json.add(obj);\n\t }\n\t // Always close files.\n\t bufferedReader.close(); \n\t }\n\t catch(FileNotFoundException ex) {\n\t System.out.println(\"Unable to open file '\" + fileName + \"'\"); \n\t }\n\t catch(IOException ex) {\n\t System.out.println(\"Error reading file '\" + fileName + \"'\"); \n\t // Or we could just do this: \n\t // ex.printStackTrace();\n\t } catch (ParseException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t }\n\t \n\t \n\t // LECTURA INICIAL DE MAXIMA PARTIDA GUARDADA\n\t \n\t int maxMatch = -1;\n\t \n\t for(int j = 0; j< json.size(); j++) {\n\t \tJSONObject jo = json.get(j);\t \t\n\t \tlong match = (long) jo.get(\"match\");\n\t \t\n\t \tmaxMatch = Math.max(maxMatch, (int)match);\n\t }\n\t \n\t maxMatch++;\n\t \n\t int matchCont = GhostDataBase.getMatchCont();\n\t \n\t if (matchCont == -1)\n\t \tGhostDataBase.setMatchCont(maxMatch);\n\t \n\t int minMatch = maxMatch - (GhostDataBase.getMatchMaxSaved()-1);\n\t \n\t int cont = 0;\n\t \n\t for(int j = 0; j< json.size(); j++) {\n\t \t\n\t \tif(cont > limitSize)\n\t \t\tbreak;\n\t \t\n\t\t JSONObject jo = json.get(j);\n\t\t \n\t\t long match = (long) jo.get(\"match\");\n\t\t \n\t\t if((int)match < minMatch)\n\t\t \tcontinue;\n\t \t\n\t \tlong nearestPPillToPacman = (long) jo.get(\"nearestPPillToPacman\");\n\t\t\tlong move = (long) jo.get(\"move\");\n\t\t\t\n\t\t\t\n\t\t\tdouble[] distanceToPacman = new double[4];\t\t\t\n\t\t\tJSONArray lm = (JSONArray) jo.get(\"distanceToPacman\");\t\t\t\n\t\t\tfor(int p = 0; p < 4; p++) {\t\t\t\t \n\t\t\t\tdistanceToPacman[p] = (double) lm.get(p);\n\t\t\t}\n\t\t\t\n\t\t\tint[] characterIndex = new int[5];\t\t\t\n\t\t\tlm = (JSONArray) jo.get(\"characterIndex\");\t\t\t\n\t\t\tfor(int p = 0; p < 5; p++) {\n\t\t\t\tlong character = (long) lm.get(p);\n\t\t\t\tcharacterIndex[p] = (int) character;\n\t\t\t}\n\t\t\t\n\t \n\t\t\tboolean[] edibleGhosts = new boolean[4];\t\t\t\n\t\t\tlm = (JSONArray) jo.get(\"edibleGhosts\");\t\t\t\n\t\t\tfor(int p = 0; p < 4; p++) {\t\t\t\t \n\t\t\t\tedibleGhosts[p] = (boolean) lm.get(p);\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\tdouble [][] distanceToPPills = new double[4][4];\n\t\t\tlm = (JSONArray) jo.get(\"distanceToPPills\");\n\t\t\tfor(int p = 0; p < 4; p++) {\n\t\t\t\t\n\t\t\t\tJSONArray lm1 = (JSONArray) lm.get(p);\t\t\t\t\n\t\t\t\tfor(int q = 0; q < 4; q++) {\n\t\t\t\t\tdistanceToPPills[p][q] = (double)lm1.get(q);\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tdouble [] distancePCToPPills = new double[4];\n\t\t\tlm = (JSONArray) jo.get(\"distancePCToPPills\");\t\t\t\n\t\t\tfor(int p = 0; p < 4; p++) {\n\t\t\t\tdistancePCToPPills[p] = (double)lm.get(p);\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tboolean[] activePPills = new boolean[4];\n\t\t\tlm = (JSONArray) jo.get(\"activePPills\");\t\t\t\n\t\t\tfor(int p = 0; p < 4; p++) {\t\t\t\t \n\t\t\t\tactivePPills[p] = (boolean) lm.get(p);\n\t\t\t}\n\t\t\t\n\t\t\tGhostCase c = new GhostCase(distanceToPacman, edibleGhosts, \n\t\t\t\t\tdistanceToPPills, distancePCToPPills, activePPills, characterIndex, (int)nearestPPillToPacman, (int)move, (int)match);\n\t\t\t\n\t\t\tGhostDataBase.addCase(c);\n\t\t\t\n\t cont++;\n\t }\n\t \n\t GhostDataBase.increaseMatchCont();\n\t}", "private void sortDice() {\r\n for (int index = 0; index < dice.size(); index++) {\r\n for (int subIndex = index; subIndex < dice.size(); subIndex++) {\r\n if (dice.get(subIndex).compareTo((dice.get(index))) > 0) {\r\n final Integer temp = dice.get(index);\r\n dice.set(index, dice.get(subIndex));\r\n dice.set(subIndex, temp);\r\n }\r\n }\r\n }\r\n }", "private void sort() {\n final Comparator<Slave> c = Comparator.comparing(Slave::getNodeName);\n this.slaves.sort(c);\n }", "private void refreshList() {\n setTitle(this.path.get(this.path.size() - 1));\n\n // Read all files sorted into the values-array\n values.clear();\n File dir = new File(this.path.get(this.path.size() - 1));\n if (!dir.canRead()) {\n setTitle(getTitle() + \" (inaccessible)\");\n }\n String[] list = dir.list();\n if (list != null) {\n for (String file : list) {\n if (!file.startsWith(\".\")) {\n values.add(file);\n }\n }\n }\n Collections.sort(values);\n }", "public void sortBySize() {\n\t\tCollections.sort(animals);\n\t}", "private void initializeAndShuffle() {\r\n\t\t\tsuffixes = new byte[256];\r\n\t\t\tfor (int i = 0; i < ALL_BYTE_VALUES.length; i++) {\r\n\t\t\t\tint j = RAND.nextInt(i + 1);\r\n\t\t\t\tif (j != i) {\r\n\t\t\t\t\tsuffixes[i] = suffixes[j];\r\n\t\t\t\t}\r\n\t\t\t\tsuffixes[j] = ALL_BYTE_VALUES[i];\r\n\t\t\t}\r\n\t\t}", "public void loadDefaultValues() {\r\n\t}", "private void digcollect() {\r\n\t\tfor(int i=0; i<25;i++) {\r\n\t\t\tfor(int j=0; j<51; j++) {\r\n\t\t\t\tif(objects[i][j]!=null) {\r\n\t\t\t\tif(objects[i][j].getClass().toString().equals(new Ground().getClass().toString())) {\r\n\t\t\t\t\tif(objects[i][j].getX()==this.viewFrame.getRockford().getX() && objects[i][j].getY()==this.viewFrame.getRockford().getY()) {\r\n\t\t\t\t\t\tthis.tabGrounds.remove(objects[i][j]);\r\n\t\t\t\t\t\tobjects[i][j]= new DarkGround(j*32, i*32);\r\n\t\t\t \tthis.tabDarkGrounds.add((DarkGround) objects[i][j]);}\r\n\t\t\t\t}else if((objects[i][j].getClass().toString().equals(new Diamond().getClass().toString()))) {\r\n\t\t\t\t\tif(objects[i][j].getX()==this.viewFrame.getRockford().getX() && objects[i][j].getY()==this.viewFrame.getRockford().getY()) {\r\n\t\t\t\t\t\tthis.tabDiamonds.remove(objects[i][j]);\r\n\t\t\t\t\t\tobjects[i][j]= new DarkGround(j*32, i*32);\r\n\t\t\t\t\t\tthis.tabDarkGrounds.add((DarkGround) objects[i][j]);\r\n\t\t\t\t\t}}}}}}", "public HashSet<String> getAllDrugs(){\r\n\t\tlogger.info(\"* Get All PharmGKB Drugs... \");\t\t\r\n\t\tHashSet<String> drugList = new HashSet<String>();\r\n\t\tint nbAdded = 0;\r\n\t\ttry{\r\n\t\t\tGetPgkbDrugList myClientLauncher = new GetPgkbDrugList();\r\n\t\t\tdrugList = myClientLauncher.getList();\r\n\t\t}catch(Exception e){\r\n\t\t\tlogger.error(\"** PROBLEM ** Problem with PharmGKB web service specialSearch.pl 6\", e);\r\n\t\t}\r\n\t\tnbAdded = drugList.size();\r\n\t\tlogger.info((nbAdded)+\" drugs found.\");\r\n\t\treturn drugList;\r\n\t}", "@Override\n public void loadUsageRecipes(ItemStack ingredient)\n {\n DecomposerRecipe dr = DecomposerRecipeHandler.instance.getRecipe(ingredient);\n if (dr != null)\n {\n registerDecomposerRecipe(dr);\n }\n arecipes = sortList(arecipes);\n }", "@Override\n\tpublic void readAllAGBSources() {\n\t\t\n\t\tAPIController apic = new APIController();\n\t\t\n\t\tString s = apic.getAllAGBSources().toString();\n\t\t\n\t\tString [] sarray = s.split(\"],\");\n\t\t\n\t\tSystem.out.println(\"Alle AGBs der Datenbank: \");\n\t\tSystem.out.println(\" \");\n\t\t\n\t\tfor (int i=0; i<sarray.length; i++)\n\t\t{\n\t\t\tallAGBSources.add(sarray[i]);\n\t\t\t//System.out.println(sarray[i]);\n\t\t}\n\t\t\n\t\t\n\t\tIterator iter = allAGBSources.iterator();\n\t\t\n\t\twhile (iter.hasNext())\n\t\t{\n\t\t\tSystem.out.println(iter.next());\n\t\t}\n\n\t}", "public void ordenarComunidadCiudad() {\r\n Collections.sort(ciudades, new ComunidadCiudadComparator());\r\n }", "private static void populateArtworkSorts() {\r\n if (artworkSorts.isEmpty()) {\r\n artworkSorts.add(SORT_FAV_ASC);\r\n artworkSorts.add(SORT_FAV_DESC);\r\n artworkSorts.add(SORT_NAME_ASC);\r\n artworkSorts.add(SORT_NAME_DESC);\r\n }\r\n }", "private PerfectMergeSort() {}", "public void reloadDatasources(){\n refreshDataCache();\n refreshListbox();\n \n if (this.geselecteerdeStageplaats != null)\n { \n this.geselecteerdeStageplaats = this.dbFacade.getStageplaatsByID(this.geselecteerdeStageplaats.getId());\n }\n refreshDisplayedStageplaats();\n }", "public static void dutch_flag_sort(char[] balls)\n {\n int n = balls.length;\n\n int swapRedHere = 0;\n int swapBluHere = n-1;\n\n int cur = 0;\n while (cur <= swapBluHere)\n {\n // If current ball is red, swap with swapRedHere. We will get a green so move current.\n if (balls[cur] == 'R')\n {\n swap(balls, cur, swapRedHere++);\n cur++;\n }\n // If current ball is blue, move it to swapBluHere. But don't move current because it now has unknown ball..\n else if (balls[cur] == 'B')\n {\n swap(balls, cur, swapBluHere--);\n }\n // Otherwise we have a green. Leave it there because it will get pulled out when swapRedHere reaches it.\n else // 'G'\n {\n cur++;\n }\n }\n }", "private void scanAndSort(File targetDir, String finishDir){\n\t\tif (targetDir.getPath().endsWith(\"AppData\") || targetDir.getPath().endsWith(\"Sorted Music\")){\n\t\t\t//Application Data; Cookies\n\t\t\treturn;\n\t\t}\n\t\tFile[] dirContent = targetDir.listFiles();\n\t\ttry{\n\t\t\tfor (File f: dirContent){\n\t\t\t\tif (f.isDirectory()){//recursion is used to handle dirs\n\t\t\t\t\tscanAndSort(f, finishDir);\n\t\t\t\t}\n\t\t\t\telse if (isMp3(f)){\n\t\t\t\t\tmoveFile(f, finishDir, getArtist(f), getAlbum(f));\n\t\t\t\t}\n\t\t\t}\n\t\t}catch(NullPointerException e){\n\t\t\tSystem.out.println(targetDir.getPath());\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t}", "private void sorterOppgaver(String type)\r\n\t{\r\n\t\t int k;\r\n\t\t int j;\r\n\t\t//switch(type){\r\n\t\t\t//case\t\"random\":\r\n\r\n\t\t\t\tfor(int i=1;i>this.oppgaver.length;i++)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Loop og lag ei tilfeldig liste\r\n\t\t\t\t\tk = (int) Math.random()*this.oppgaver.length;\r\n\t\t\t\t\toppgaver[this.oppgaver.length]=this.oppgaver[i];\r\n\t\t\t\t\toppgaver[i]=oppgaver[k];\r\n\t\t\t\t\toppgaver[k]=oppgaver[this.oppgaver.length];\r\n\t\t\t\t}\r\n\t\t\t\t//break;\r\n\t\t\t//case \t\"alfabetisk\":\r\n\t\t\t\t// Sorter elementa i array alfabetisk.\r\n\t\t\t\t//break;\r\n\t\t\t//default:\r\n\t\t\t\t// Sorter elementa slik dei vart skrive inn av læraren, altså etter key i oppgave-arrayen.\r\n\t\t}", "public static void sortInputExternalMerge() {\r\n\t\tExternalMultiwayMerge merge = new ExternalMultiwayMerge();\r\n\t\tmerge.sort(inputFile, M, d);\r\n\t}", "public void sort() {\n Collections.sort(jumpers, new SortJumperByPoints()); \n }", "public void shuffle() {\n Collections.shuffle((List<Nummer>) this.albumNummers);\n }", "private synchronized void loadDrug() {\n\n LoadArrayList();\n if(searchquery.equals(\"all\")){\n result = drugModels;\n }else {\n result = new ArrayList<>();\n for (int i = 0; i < drugModels.size(); i++) {\n if (drugModels.get(i).getName().toLowerCase().contains(searchquery.toLowerCase())) {\n result.add(drugModels.get(i));\n }\n }\n }\n\n\n\n\n if(result==null || result.size()==0){\n tvNoDrug.setVisibility(View.VISIBLE);\n\n }else {\n pasteToRecyclerView();\n }\n\n progressBar.setVisibility(View.GONE);\n }", "public static void readfile(String FILENAME) {\n\t\tString[] parts = null;\n\t\t// Initialising s as 9100 since the cardinality for a src is 9060\n\t\tint s = 2500;\n\t\t// Choosing m\n\t\tint m = 500000000;\n\t\tArrayList<ArrayList<Integer>> UniversalHashList = new ArrayList<ArrayList<Integer>>();\n\t\tArrayList<ArrayList<Integer>> XsrcMasterList = new ArrayList<ArrayList<Integer>>();\n\t\tList masterDstList = new ArrayList<ArrayList<String>>();\n\t\tString[] BitArray = new String[m];\n\t\tPrintStream out = null;\n\t\ttry {\n\t\t\tout = new PrintStream(new FileOutputStream(\"output_virbitmap.csv\"));\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tString src = null;\n\t\tHashMap<String, List> srcDstMap = new HashMap<String, List>();\n\t\tArrayList<Integer> R = new ArrayList<Integer>();\n\t\tR = genRandomArray(s);\n\t\t// initializing bit array\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tBitArray[i] = \"False\";\n\t\t}\n\t\t// reading input file and writing to HashMap<src,dstlist>\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(FILENAME))) {\n\n\t\t\tString sCurrentLine;\n\t\t\twhile ((sCurrentLine = br.readLine()) != null) {\n\t\t\t\tparts = sCurrentLine.trim().split(\"\\\\s+\");\n\t\t\t\tsrc = parts[0];\n\t\t\t\tString dst = parts[1];\n\t\t\t\tif (!srcDstMap.containsKey(src)) {\n\t\t\t\t\tArrayList<String> dstList = new ArrayList<String>();\n\t\t\t\t\tdstList.add(dst);\n\t\t\t\t\tsrcDstMap.put(src, dstList);\n\t\t\t\t\t// hashing(B,convertIPAddress(tokens[0]));\n\t\t\t\t} else\n\t\t\t\t\tsrcDstMap.get(src).add(dst);\n\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfor (int i = 0; i < srcDstMap.size(); i++) {\n\t\t\tArrayList<Integer> masterHashList = new ArrayList<Integer>();\n\t\t\tArrayList<Integer> XsrcList = new ArrayList<Integer>();\n\t\t\tUniversalHashList.add(masterHashList);\n\t\t\tXsrcMasterList.add(XsrcList);\n\t\t\t// System.out.println(\"XsrcmasterList\" + XsrcList);\n\n\t\t}\n\t\tIterator srcDstMapIt = srcDstMap.entrySet().iterator();\n\t\tfor (int i = 0; i < srcDstMap.size(); i++) {\n\t\t\tArrayList<Integer> XsrcList = XsrcMasterList.get(i);\n\t\t\tArrayList<Integer> masterHashList = UniversalHashList.get(i);\n\t\t\twhile (srcDstMapIt.hasNext()) {\n\t\t\t\tMap.Entry pair = (Map.Entry) srcDstMapIt.next();\n\t\t\t\tsrc = pair.getKey().toString();\n\t\t\t\tList dstList = (List) pair.getValue();\n\t\t\t\tmasterDstList.add(dstList);\n\t\t\t\tIterator dstListIt = dstList.iterator();\n\t\t\t\twhile (dstListIt.hasNext()) {\n\t\t\t\t\tint hashedSrc = masterHashSetGen(src, dstListIt.next().toString(), s, R);\n\t\t\t\t\t// String[] partsGeneratedStuff =\n\t\t\t\t\t// generatedStuff.trim().split(\":\");\n\t\t\t\t\t// String generatedIndex = partsGeneratedStuff[0];\n\t\t\t\t\t// String hashedSrc = partsGeneratedStuff[1];\n\t\t\t\t\tmasterHashList.add(hashedSrc % BitArray.length);\n\t\t\t\t\t// System.out.println(masterHashList);\n\t\t\t\t\tXsrcList.add(hashedSrc);\n\t\t\t\t\t// System.out.println(XsrcList);\n\t\t\t\t\tBitArray[Math.abs(hashedSrc % (BitArray.length))] = \"True\";\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tdouble bitMapCount = BitMapCount(BitArray, BitArray.length, s);\n\t\t// System.out.println(\"bitMapCount\"+bitMapCount);\n\n\t\tint XsrcIndexperDst = 0;\n\t\tIterator srcDstMapItrecons = srcDstMap.entrySet().iterator();\n\t\twhile (srcDstMapItrecons.hasNext()) {\n\t\t\tdouble XsrcRatio;\n\t\t\tMap.Entry pair = (Map.Entry) srcDstMapItrecons.next();\n\t\t\tsrc = pair.getKey().toString();\n\t\t\t// System.out.println(\"src\" + src);\n\t\t\tList dstList = (List) pair.getValue();\n\t\t\tmasterDstList.add(dstList);\n\t\t\tIterator dstListIt = dstList.iterator();\n\t\t\tString[] srcArray = new String[s];\n\t\t\tdouble count = 0;\n\t\t\t\twhile(dstListIt.hasNext()) {\n\t\t\t\t\tXsrcIndexperDst = XsrcIndexperDst(XsrcMasterList, masterDstList, s, BitArray, src,dstListIt.next().toString(), R) % m;\n\t\t\t\t\t// System.out.println(\"Value\"+BitArray[XsrcIndexperDst]);\n\t\t\t\t\tif (BitArray[XsrcIndexperDst] == \"True\") {\n\t\t\t\t\t\tcount++;\n\t\t\t}\n\t\t\t\t}\n\t\t\t//System.out.println(\"count per source\" + count + \",\" + (s - count));\n\t\t\tXsrcRatio = -s * Math.log((s-count)/s);\n\t\t\tdouble estimatedSpread = -bitMapCount + XsrcRatio;\n\t\t\tif(estimatedSpread<=0)\n\t\t\t{\n\t\t\t\testimatedSpread=0;\n\t\t\t}\n\t\t\tout.println(dstList.size() + \",\" + estimatedSpread);\n\t\t}\n\n\t}", "public static void specialSets() {\n\t\tSystem.out.printf(\"%12s%15s%15s%10s%10s%10s%10s%n\",\"Size\",\"Range\",\"Pre-Sort Type\",\"Insertion\",\"Selectuon\",\"Quick\",\"Merge\");\n\t\tint[] array;\n\t\t//200K\n\t\tSystem.out.printf(\"%12d%15s%15s\",200000,\"1-200k\",\"N/A\");\n\t\tarray = generateArray(200000, 1, 200000);\n\t\tfourSorts(array);\n\t\tSystem.out.println();\n\t\t//Sorted array\n\t\tSystem.out.printf(\"%12d%15s%15s\",200000,\"1-200k\",\"Sorted\");\n\t\tfourSorts(array);\n\t\tSystem.out.println();\n\t\t//Reverse Sorted\n\t\tSystem.out.printf(\"%12d%15s%15s\",200000,\"1-200k\",\"Reverse Sorted\");\n\t\tint[] temp = new int[array.length];\n\t\tfor(int i = 0; i < array.length; i++) {\n\t\t\ttemp[i] = array[array.length -1 -i];\n\t\t}\n\t\tfourSorts(temp);\n\t\tSystem.out.println();\n\t\t//Range 1-20\n\t\tSystem.out.printf(\"%12d%15s%15s\",200000,\"1-20\",\"N/A\");\n\t\tarray = generateArray(200000, 1, 20);\n\t\tfourSorts(array);\n\t\tSystem.out.println();\n\t}", "private void convertCldrItems(String outDirname, String pathPrefix)\n throws IOException, ParseException {\n // zone and timezone items are queued for sorting first before they are\n // processed.\n\n for (JSONSection js : sections) {\n ArrayList<CldrItem> sortingItems = new ArrayList<CldrItem>();\n ArrayList<CldrItem> arrayItems = new ArrayList<CldrItem>();\n\n ArrayList<String> out = new ArrayList<String>();\n ArrayList<CldrNode> nodesForLastItem = new ArrayList<CldrNode>();\n String lastLeadingArrayItemPath = null;\n String leadingArrayItemPath = \"\";\n int valueCount = 0;\n String previousIdentityPath = null;\n List<CldrItem> theItems = sectionItems.get(js);\n if (theItems == null || theItems.size() == 0) {\n continue;\n }\n for (CldrItem item : theItems) {\n // items in the identity section of a file should only ever contain the lowest level, even if using\n // resolving source, so if we have duplicates ( caused by attributes used as a value ) then suppress\n // them here.\n if (item.getPath().contains(\"/identity/\")) {\n String[] parts = item.getPath().split(\"\\\\[\");\n if (parts[0].equals(previousIdentityPath)) {\n continue;\n } else {\n previousIdentityPath = parts[0];\n }\n }\n\n // some items need to be split to multiple item before processing. None\n // of those items need to be sorted.\n CldrItem[] items = item.split();\n if (items == null) {\n items = new CldrItem[1];\n items[0] = item;\n }\n valueCount += items.length;\n\n for (CldrItem newItem : items) {\n // alias will be dropped in conversion, don't count it.\n if (newItem.isAliasItem()) {\n valueCount--;\n }\n\n // Items like zone items need to be sorted first before write them out.\n if (newItem.needsSort()) {\n resolveArrayItems(out, nodesForLastItem, arrayItems);\n sortingItems.add(newItem);\n } else {\n Matcher matcher = LdmlConvertRules.ARRAY_ITEM_PATTERN.matcher(\n newItem.getPath());\n if (matcher.matches()) {\n resolveSortingItems(out, nodesForLastItem, sortingItems);\n leadingArrayItemPath = matcher.group(1);\n if (lastLeadingArrayItemPath != null &&\n !lastLeadingArrayItemPath.equals(leadingArrayItemPath)) {\n resolveArrayItems(out, nodesForLastItem, arrayItems);\n }\n lastLeadingArrayItemPath = leadingArrayItemPath;\n arrayItems.add(newItem);\n } else {\n resolveSortingItems(out, nodesForLastItem, sortingItems);\n resolveArrayItems(out, nodesForLastItem, arrayItems);\n outputCldrItem(out, nodesForLastItem, newItem);\n lastLeadingArrayItemPath = \"\";\n }\n }\n }\n }\n\n resolveSortingItems(out, nodesForLastItem, sortingItems);\n resolveArrayItems(out, nodesForLastItem, arrayItems);\n\n closeNodes(out, nodesForLastItem.size() - 2, 0);\n String outFilename;\n outFilename = js.section + \".json\";\n writeToFile(outDirname, outFilename, out);\n\n System.out.println(String.format(\" %s = %d values\", outFilename, valueCount));\n }\n }", "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 }", "private Collection<IndexedDiskElementDescriptor> createPositionSortedDescriptorList()\r\n {\r\n final List<IndexedDiskElementDescriptor> defragList = new ArrayList<>(keyHash.values());\r\n defragList.sort(Comparator.comparing(ded1 -> ded1.pos));\r\n\r\n return defragList;\r\n }", "public void sortByBreed() {\n\t\tAnimalCompare animalCompare = new AnimalCompare();\n\t\tCollections.sort(animals, animalCompare);\n\t}", "public void sort()\n\t{\n\t\tfor(int i=0;i<bowlers.size()-1;i++)\n\t\t{\n\t\t\tfor(int j=i+1;j<bowlers.size();j++)\n\t\t\t{\n\t\t\t\tif(bowlers.get(i).getBall()<bowlers.get(j).getBall())\n\t\t\t\t{\n\t\t\t\t\tBowler bowler=bowlers.get(i);\n\t\t\t\t\tbowlers.set(i,bowlers.get(j));\n\t\t\t\t\tbowlers.set(j,bowler);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<bowlers.size();i++)\n\t\t{\n\t\tSystem.out.println(bowlers.get(i).getBall());\n\t\t}\n\t}", "private static void stepSorter(String file, DataOutputStream d, int size) throws FileNotFoundException, IOException {\n\t\tDataInputStream inputA = new DataInputStream(new BufferedInputStream(new FileInputStream(new File(file))));\n\t\tDataInputStream inputB = new DataInputStream(new BufferedInputStream(new FileInputStream(new File(file))));\n\t\tint numDivisions = (int) Math.ceil(fileSize/((double) size));\n\t\tinputB.skip(size*4);\n\t\tfor (int j = 0; j < numDivisions/2; j++){\t\n\t\t\tint counterA = size;\n\t\t\tint counterB = Math.min(fileSize - j*size*2 - size, size);\n\t\t\tInteger a = inputA.readInt();\n\t\t\tInteger b = inputB.readInt();\n\t\t\twhile (counterA > 0 && counterB > 0){\n\t\t\t\tif (a < b){\n\t\t\t\t\td.writeInt(a);\n\t\t\t\t\tif (counterA > 1){\n\t\t\t\t\t\ta = inputA.readInt();\n\t\t\t\t\t}\n\t\t\t\t\tcounterA--;\n\t\t\t\t} else {\n\t\t\t\t\td.writeInt(b);\n\t\t\t\t\tif (counterB > 1){\n\t\t\t\t\t\tb = inputB.readInt();\n\t\t\t\t\t}\n\t\t\t\t\tcounterB--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (counterA == 0){\n\t\t\t\td.writeInt(b);\n\t\t\t\tcounterB--;\n\t\t\t\tfor (int i =0; i < counterB; i++){\n\t\t\t\t\td.writeInt(inputB.readInt());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\td.writeInt(a);\n\t\t\t\tcounterA--;\n\t\t\t\tfor (int i =0; i < counterA; i++){\n\t\t\t\t\td.writeInt(inputA.readInt());\n\t\t\t\t}\n\t\t\t}\n\t\t\tinputA.skip(size*4);\n\t\t\tinputB.skip(size*4);\n\t\t}\n\t\t\n\t\t//copy the excess\n\t\twhile (inputA.available()>0){\n\t\t\td.writeInt(inputA.readInt());\n\t\t}\n\t\tinputA.close();\n\t\tinputB.close();\n\t\td.flush();\n\t}", "private void setupDefaultDiceMap() {\n defaultDiceNumberMap.put(getHashCodeofPair(0,-2), 0);\n defaultDiceNumberMap.put(getHashCodeofPair(-7,1), 6);\n defaultDiceNumberMap.put(getHashCodeofPair(7,1), 8);\n defaultDiceNumberMap.put(getHashCodeofPair(-7,-1), 5);\n defaultDiceNumberMap.put(getHashCodeofPair(7,-1), 9);\n defaultDiceNumberMap.put(getHashCodeofPair(0,4), 4);\n defaultDiceNumberMap.put(getHashCodeofPair(2,4), 10);\n\n defaultDiceNumberMap.put(getHashCodeofPair(-3,-3), 6);\n defaultDiceNumberMap.put(getHashCodeofPair(-1,-3), 10);\n defaultDiceNumberMap.put(getHashCodeofPair(1,-3), 8);\n defaultDiceNumberMap.put(getHashCodeofPair(3,-3), 0);\n defaultDiceNumberMap.put(getHashCodeofPair(-4,-2), 5);\n defaultDiceNumberMap.put(getHashCodeofPair(-2,-2), 3);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(2,-2), 2);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(4,-2), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-5,-1), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-3,-1), 11);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-1,-1), 9);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(1,-1), 5);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(3,-1), 4);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(5,-1), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-6,0), 10);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-4,0), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-2,0), 8);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(0,0), 10);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(2,0), 6);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(4,0), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(6,0), 12);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-5,1), 8);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-3,1), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-1,1), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(1,1), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(3,1), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(5,1), 5);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-4,2), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-2,2), 4);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(0,2), 3);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(2,2), 4);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(4,2), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-3,3),0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-1,3), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(1,3), 9);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(3,3), 0);\n\t}", "private static void sortingArrayList() {\n Collections.sort(allMapData, new Comparator<MapDataModel>() {\n public int compare(MapDataModel d1, MapDataModel d2) {\n return valueOf(d1.getDateTime().compareTo(d2.getDateTime()));\n }\n });\n }", "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}", "@Override\r\n\tpublic List<DrankB> findDBByDaid(Integer daid) {\n\t\treturn pageMapper.findDBByDaid(daid);\r\n\t}", "private void sortIntoCars(ArrayList<FileEntry> batch) {\n ArrayList<FileEntry> res = new ArrayList<>(); // prevents ConcurrentModificationException\n for (FileEntry dir : batch) {\n try {\n res.addAll(CarSorterImpl.getInstance().sortIntoCars(dir));\n } catch (IOException e) {\n LOGGER.error(\"Failed to load images in FileEntry at \" + dir.getCarImages().get(0).getFilepath());\n e.printStackTrace();\n }\n }\n\n batch.clear();\n batch.addAll(res); // puts the new entries back to original ArrayList\n }", "public void addDefaultExcludes()\n {\n int excludesLength = excludes == null ? 0 : excludes.length;\n String[] newExcludes;\n newExcludes = new String[ excludesLength + DEFAULTEXCLUDES.length ];\n if( excludesLength > 0 )\n {\n System.arraycopy( excludes, 0, newExcludes, 0, excludesLength );\n }\n for( int i = 0; i < DEFAULTEXCLUDES.length; i++ )\n {\n newExcludes[ i + excludesLength ] = DEFAULTEXCLUDES[ i ].replace( '/', File.separatorChar ).replace( '\\\\', File.separatorChar );\n }\n excludes = newExcludes;\n }", "@Override\n \tpublic void sort() {\n \t\tArrays.sort(data);\n \t}", "public static void readDirectory(String dir){\n\t\tMap<Integer,Integer> catemap = new HashMap<Integer, Integer>();\r\n\t\tFile[] names = null;\r\n\t\tFile file = new File(dir);\r\n\t\tif(file.isFile())\r\n\t\t\tnames = new File[]{file};\r\n\t\telse\r\n\t\t\tnames = new File(dir).listFiles();\r\n\t\tList<String> lines = null;\r\n\t\tList<String> strs = null;\r\n\t\tList<Integer> keys = new ArrayList<Integer>();\r\n\t\tList<Integer> values = new ArrayList<Integer>();\r\n\t\tint v = 0;\r\n\t\tif(null!=names&&names.length>0){\r\n\t\t\tfor(File f:names){\r\n\t\t\t\tif(null!=lines)\r\n\t\t\t\t\tlines.clear();\r\n\t\t\t\tlines = readFile(f,\"utf-8\");\r\n\t\t\t\tif(null!=lines){\r\n\t\t\t\t\tint j = 0;\r\n\t\t\t\t\tint k=0;\r\n\t\t\t\t\tfor(String line:lines){\r\n\t\t\t\t\t\tstrs = parseStr2List(line, \"\\\\t\");\r\n//\t\t\t\t\t\tif(null!=strs&&strs.size()==7){\r\n//\t\t\t\t\t\t\tv = getPerValue(strs.get(3));\r\n//\t\t\t\t\t\t\tmaxmap.put(v, 1+DataFormat.parseInt(maxmap.get(v)));\r\n//\t\t\t\t\t\t\tv = getPerValue(strs.get(5));\r\n//\t\t\t\t\t\t\tcatemap.put(v, 1+DataFormat.parseInt(catemap.get(v)));\r\n//\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(null!=strs&&strs.size()==2){\r\n\t\t\t\t\t\t\tv = DataFormat.parseInt(strs.get(0));\r\n//\t\t\t\t\t\t\tif(v<=500){\r\n//\t\t\t\t\t\t\t\tv = j/5+1;\r\n//\t\t\t\t\t\t\t\tj = j+1;\r\n//\t\t\t\t\t\t\t}else{\r\n//\t\t\t\t\t\t\t\tv = 101;\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\tif(k>500) break;\r\n\t\t\t\t\t\t\tk++;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(j<20){\r\n\t\t\t\t\t\t\t\tkeys.add(v);\r\n\t\t\t\t\t\t\t\tvalues.add(DataFormat.parseInt(strs.get(1)));\r\n\t\t\t\t\t\t\t\tj++;\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tj=0;\r\n\t\t\t\t\t\t\t\tSystem.out.println(Arrays.toString(keys.toArray(new Integer[]{})));\r\n\t\t\t\t\t\t\t\tSystem.out.println(Arrays.toString(values.toArray(new Integer[]{})));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n//\t\t\t\t\t\t\tcatemap.put(v, DataFormat.parseInt(strs.get(1))+DataFormat.parseInt(catemap.get(v)));\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}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n//\t\tfor(Entry<Integer, Integer> entry:maxmap.entrySet()){\r\n//\t\t\tUtils.appendToFile(\"/vol/user_log/maxmap.txt\", entry.getKey()+\"\\t\"+entry.getValue());\r\n//\t\t}\r\n//\t\tfor(Entry<Integer, Integer> entry:catemap.entrySet()){\r\n//\t\t\tUtils.appendToFile(\"C:\\\\Program Files\\\\SecureCRT\\\\download\\\\map.txt\", entry.getKey()+\"\\t\"+entry.getValue());\r\n//\t\t}\r\n\t}", "private synchronized void init(){\n _2_zum_vorbereiten.addAll(spielzeilenRepo.find_B_ZurVorbereitung());\n _3_vorbereitet.addAll(spielzeilenRepo.find_C_Vorbereitet());\n _4_spielend.addAll(spielzeilenRepo.find_D_Spielend());\n }", "public LoadSeeds(File seedsfile, boolean acceptSeedsAsDanica) {\n this.seedsfile = seedsfile;\n this.daoFactory = DatabaseUtils.getDao();\n this.ingestAsDanica = acceptSeedsAsDanica;\n}", "private void setupDefaultHarbourMap() {\n defaultHarbourMap.put(getHashCodeofPair(-3,-11), HarbourKind.SPECIAL_BRICK);\n defaultHarbourMap.put(getHashCodeofPair(-2,-10), HarbourKind.SPECIAL_BRICK);\n defaultHarbourMap.put(getHashCodeofPair(0,-10), HarbourKind.GENERIC);\n defaultHarbourMap.put(getHashCodeofPair(1,-11), HarbourKind.GENERIC);\n defaultHarbourMap.put(getHashCodeofPair(2,-10), HarbourKind.SPECIAL_ORE);\n defaultHarbourMap.put(getHashCodeofPair(2,-8), HarbourKind.SPECIAL_ORE);\n defaultHarbourMap.put(getHashCodeofPair(-5,-7), HarbourKind.SPECIAL_WOOD);\n defaultHarbourMap.put(getHashCodeofPair(-4,-8), HarbourKind.SPECIAL_WOOD);\n defaultHarbourMap.put(getHashCodeofPair(-5,-5), HarbourKind.GENERIC);\n defaultHarbourMap.put(getHashCodeofPair(-4,-4), HarbourKind.GENERIC);\n defaultHarbourMap.put(getHashCodeofPair(3,-5), HarbourKind.SPECIAL_GRAIN);\n defaultHarbourMap.put(getHashCodeofPair(4,-4), HarbourKind.SPECIAL_GRAIN);\n defaultHarbourMap.put(getHashCodeofPair(-2,2), HarbourKind.SPECIAL_WOOL);\n defaultHarbourMap.put(getHashCodeofPair(-1,1), HarbourKind.SPECIAL_WOOL);\n defaultHarbourMap.put(getHashCodeofPair(1,1), HarbourKind.GENERIC);\n defaultHarbourMap.put(getHashCodeofPair(2,2), HarbourKind.GENERIC);\n }", "protected void sort() {\n\n\t\tCollections.sort(this.myRRList);\n\t}", "public static void main(String[] args) {\n Map<Integer, ArrayList<String>> citiesMap = new HashMap<>();\n\n CityDAO cityDAO = new CityDAO();\n CountryDAO countryDAO = new CountryDAO();\n\n ArrayList<City> cities = cityDAO.ReadCitiesFormCSV(\"src/main/resources/cities.csv\");\n Collections.sort(cities, Comparator.comparing(City::getPopulation));\n ArrayList<Country> countries = countryDAO.ReadCountriesFormCSV(\"src/main/resources/countries.csv\");\n\n //Add list of cities to their countries\n for (int countryIdx = 0; countryIdx < countries.size(); countryIdx++) {\n for (int cityIdx = 0; cityIdx < cities.size(); cityIdx++) {\n if (cities.get(cityIdx).getCode() == countries.get(countryIdx).getId())\n countries.get(countryIdx).addCityToCountry(cities.get(cityIdx));\n }\n }\n\n //Print list of cities in each country\n// for(Country country : countries) {\n// ArrayList<City> citiesL = country.getListOfCities();\n// for (City city : citiesL)\n// System.out.print(city.getCityName() + \" \");\n// System.out.println();\n// }\n\n for(City city : cities) {\n if (citiesMap.get(city.getCode()) == null)\n citiesMap.put(city.getCode(), new ArrayList<>());\n citiesMap.get(city.getCode()).add(city.getCityName());\n }\n System.out.println(\"Print List of cities sorted according to population sorted from lowest to highest\");\n citiesMap.forEach((k,v) -> System.out.println(\"Code: \" + k + \", List of cities: \" + v));\n\n System.out.println(\"\\n\");\n }", "public static boolean testSort() {\r\n Manager inst;\r\n try {\r\n inst = new PokemonTable();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n return false;\r\n }\r\n LinkedList<Pokemon> list;\r\n list = inst.sortByAttack(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getAttack() < list.get(i).getAttack()) {\r\n System.out.println(\"attack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByAttack(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getAttack() > list.get(i).getAttack()) {\r\n System.out.println(\"attack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByDefense(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getDefense() < list.get(i).getDefense()) {\r\n System.out.println(\"defense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByDefense(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getDefense() > list.get(i).getDefense()) {\r\n System.out.println(\"defense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByFavorite(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (!list.get(i - 1).getFavorite() && list.get(i).getFavorite()) {\r\n System.out.println(\"favorite sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByFavorite(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getFavorite() && !list.get(i).getFavorite()) {\r\n System.out.println(\"favorite sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByHp(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getHp() < list.get(i).getHp()) {\r\n System.out.println(\"hp sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByHp(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getHp() > list.get(i).getHp()) {\r\n System.out.println(\"hp sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByLegendary(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (!list.get(i - 1).isLegendary() && list.get(i).isLegendary()) {\r\n System.out.println(\"legendary sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByLegendary(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).isLegendary() && !list.get(i).isLegendary()) {\r\n System.out.println(\"legendary sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByName(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getName().compareTo(list.get(i).getName()) > 0) {\r\n System.out.println(\"name sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByName(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getName().compareTo(list.get(i).getName()) < 0) {\r\n System.out.println(\"name sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpAttack(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpAttack() < list.get(i).getSpAttack()) {\r\n System.out.println(\"spAttack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpAttack(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpAttack() > list.get(i).getSpAttack()) {\r\n System.out.println(\"spAttack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpDefense(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpDefense() < list.get(i).getSpDefense()) {\r\n System.out.println(\"spDefense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpDefense(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpDefense() > list.get(i).getSpDefense()) {\r\n System.out.println(\"spDefense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpeed(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpeed() < list.get(i).getSpeed()) {\r\n System.out.println(\"speed sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpeed(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpeed() > list.get(i).getSpeed()) {\r\n System.out.println(\"speed sort\");\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "public void listSort() {\n\t\tCollections.sort(cd);\n\t}", "@Override\r\n\t\t\tpublic int compare(BizDistrict o1, BizDistrict o2) {\n\t\t\t\tif (o1.getDistrictId() > o2.getDistrictId()) {\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t} else if (o1.getDistrictId() < o2.getDistrictId()) {\r\n\t\t\t\t\treturn -1;\r\n\t\t\t\t}\r\n\t\t\t\treturn 0;\r\n\t\t\t}", "protected void sortResources()\n {\n PriorityComparator priorityComparator = new PriorityComparator();\n List<Resource> resources = getResources();\n Collections.sort(resources, priorityComparator);\n }", "public void sortAndSave() {\n\t\tsort();\n\t\tShopIO.writeFile(ShopIO.getDataFile(), ShopIO.getGson().toJson(this));\n\t}", "public static void load() {\n for (DataSourceSwapper each : ServiceLoader.load(DataSourceSwapper.class)) {\n loadOneSwapper(each);\n }\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 sort() {\n\t\tArrayList<Medication> dayList = new ArrayList<Medication>();\n\t\tupcomingMedsLabel.setText(\"\");\n\t\tDate dt = new Date();\n\t\tDateFormat df = new SimpleDateFormat(\"EEEE\");\n\t\tString currentDay = df.format(dt);\n\t\t\n\t\t//Runs through all elements in the array\n\t\tfor(int i = 0; i < medList.size(); i++) {\n\t\t\t//Checks to see if the medication needs to be taken today\n\t\t\tif(medList.get(i).getMedDateTime().contains(currentDay)) {\n\t\t\t\tboolean added = false;\n\t\t\t\t//If no other element has been added, added the element\n\t\t\t\tif(dayList.size() == 0) {\n\t\t\t\t\tdayList.add(medList.get(i));\n\t\t\t\t} else {\n\t\t\t\t\t//Checks all other medications in the dayList to order them chronologicaly\n\t\t\t\t\tfor(int j = 0; j < dayList.size(); j++) {\n\t\t\t\t\t\t//Get the hour of element at j and compare it again element at i of medList\n\t\t\t\t\t\tint hour = Integer.parseInt(dayList.get(j).getHour());\n\t\t\t\t\t\t//If < add at j, if equal check minutes else add later\n\t\t\t\t\t\tif(Integer.parseInt(medList.get(i).getHour()) < hour) {\n\t\t\t\t\t\t\tdayList.add(j, medList.get(i));\n\t\t\t\t\t\t\tadded = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else if (Integer.parseInt(medList.get(i).getHour()) == hour) {\n\t\t\t\t\t\t\tadded = true;\n\t\t\t\t\t\t\t//Checks against minutes\n\t\t\t\t\t\t\tint minute = Integer.parseInt(dayList.get(j).getMinute());\n\t\t\t\t\t\t\tif(Integer.parseInt(medList.get(i).getMinute()) < minute) {\n\t\t\t\t\t\t\t\tdayList.add(j, medList.get(i));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif(dayList.size() > (j + 1)) {\n\t\t\t\t\t\t\t\t\tdayList.add(j+1, medList.get(i));\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tdayList.add(medList.get(i));\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}\n\t\t\t\t\tif(added == false) {\n\t\t\t\t\t\tdayList.add(medList.get(i));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Update the upcomingMedsLabel\n\t\tfor(int i = 0; i < dayList.size(); i++) {\n\t\t\tupcomingMedsLabel.setText(upcomingMedsLabel.getText() + \"\\n\\n\" + dayList.get(i));\n\t\t}\n\t}", "private HashMap<String, String> loadDistricts() {\n\t\tList<OrganizationUnitMaster> districts = districtsDao.getAllDistricts();\n\t\tHashMap<String, String> districtReference = new HashMap<String, String>();\n\t\tfor (OrganizationUnitMaster district : districts) {\n\t\t\tlogger.debug(\"Organizational Code \" + district.getOrganizationCode());\n\t\t\tlogger.debug(\"Organizational Name \" + district.getOrganizationName());\n\t\t\tdistrictReference.put(district.getOrganizationCode(), district.getOrganizationName());\n\t\t\t\n\t\t}\n\t\treturn districtReference;\n\t}", "public void sort() {\r\n // sort the process variables\r\n Arrays.sort(pvValues, categoryComparator);\r\n fireTableDataChanged();\r\n }", "@RequestLine(\"GET /zones/{zoneName}/rrsets/?q=kind:DIR_POOLS\")\n RRSetList getDirectionalPoolsOfZone(@Param(\"zoneName\") String zoneName);", "private void readGraphsFromFiles() {\n\n\n \t\ttry {\t\n\t\t\t// where to find SN files\n\t\t\tString fileName = \"./networks/SN_20000\";\n\t\t\tint numberSNs = 5;\n\t\t\t\n\t\t\t// TODO CHANGE! IT IS JUST FOR TESTING. OUT OF MEMORY\n\t\t\tfileNamesGraphs = new String[numberSNs];\n\t\t\tfileNamesGraphs [0]= fileName + \"_0.001.dgs\";\n\t\t\tfileNamesGraphs [1]= fileName + \"_0.002.dgs\";\n\t\t\tfileNamesGraphs [2]= fileName + \"_0.003.dgs\";\n\t\t\tfileNamesGraphs [3]= fileName + \"_0.004.dgs\";\n\t\t\tfileNamesGraphs [4]= fileName + \"_0.005.dgs\";\n\t\t\t//files [5]= fileName + \"_0.001.dgs\";\n\t\t\t//files [6]= fileName + \"_0.001.dgs\";\n\t\t\t//files [7]= fileName + \"_0.001.dgs\";\n\t\t\t//files [8]= fileName + \"_0.001.dgs\";\n\t\t\t//files [9]= fileName + \"_0.001.dgs\";\n\n\t long time1 = System.currentTimeMillis( );\n\n\t\t\t// first create a list of Graphs\n\t\t\tthis.graphsFromFiles = new ArrayList<Graph>();\t\n\t\t\t\n\t\t\tfor (int i = 0; i < numberSNs; i++) {\n\t\t\t\tGraph graphFromFile;\n\t\t\t\tgraphFromFile = new SingleGraph(\"SN\" + i);\n\t\t\t\tthis.graphsFromFiles.add(graphFromFile);\n\t\t\t}\n\t\t\n\t\t\tFileSourceDGS fileSource = new FileSourceDGS();\n\t\t\t\t\t\n\t\t\tfor (int i = 0; i < numberSNs; i++) {\n\t\t\t\tfileSource.addSink(this.graphsFromFiles.get(i));\t\t\t\t\n\t\t\t\tfileSource.readAll(fileNamesGraphs[i]);\n\t\t\t\tfileSource.removeSink(this.graphsFromFiles.get(i));\t\t\t\n\t\t\t}\t\t\n\t\t\t\n\t\t\tlong time2 = System.currentTimeMillis( );\n\t\t\tSystem.out.println(\"readGraphsFromFiles: \" + (double)(time2 - time1)/1000 \n\t\t\t\t\t+ \"s for reading the SN files\");\n\t \n\t\t\t\n\t\t} catch (IOException e) {\n\t\t \tSystem.out.println(\"Error when reading SN files\");\n\t\t}\n\t\t\t\t\t\n\t}", "private static void initTopologicalSortDFS(int V) {\r\n\t\t// // make sure that the given graph is DAG\r\n\t\tprintThis(\"Topological Sort (the input graph must be DAG)\");\r\n\t\ttopoSort = new ArrayList<Integer>();\r\n\t\ttopoSort.clear();\r\n\t\tdfs_num = new int[V];\r\n\t\tArrays.fill(dfs_num, DFS_WHITE);\r\n\r\n\t\tfor (int i = 0; i < V; i++)\r\n\t\t\t// this part is the same as finding CCs\r\n\t\t\tif (dfs_num[i] == DFS_WHITE)\r\n\t\t\t\t// asi se hace todo el topological\r\n\t\t\t\ttopologicalSortDFS(i);\r\n\t\tCollections.reverse(topoSort);\r\n\t\t// reverse topoSort\r\n\t\tfor (int i = 0; i < topoSort.size(); i++)\r\n\t\t\t// or you can simply read\r\n\t\t\tSystem.out.printf(\" %d\", topoSort.get(i));\r\n\t\t// the content of `topoSort' backwards\r\n\t\tSystem.out.printf(\"\\n\");\r\n\t}", "@Override\n public Sort getDefaultSort() {\n return Sort.add(SiteConfineArea.PROP_CREATE_TIME, Direction.DESC);\n }", "public void load (){\n load(MAX_PREZ);\n }", "public static void sortByFitlvl() {\n Collections.sort(Population);\n if (debug) {\n debugLog(\"\\nSorted: \");\n printPopulation();\n }\n }", "public static void gbpusdDEbest(String dir) {\n \n /**\n * Settings of the evolutionary algorithm - Differential Evolution\n */\n \n Algorithm de;\n int dimension = dim; //Length of an individual - when using functions in GFS with maximum number of required arguments max_arg = 2, 2/3 are designated for program, 1/3 for constant values - for 60 it is 40 and 20\n int NP = 75; //Size of the population - number of competitive solutions\n int generations = gen; //Stopping criterion - number of generations in evolution\n int MAXFES = generations * NP; //Number of fitness function evaluations\n double f = 0.5, cr = 0.8; //Scaling factor f and crossover rate cr\n AP.util.random.Random generator = new AP.util.random.UniformRandom(); //Random number generator\n \n /**\n * Symbolic regression part\n * \n * Settings of the dataset which is regressed\n * Example: Sextic problem\n */\n \n // 50 points from range <-1, 1>, another type of data providing is possible\n double[][] dataset_points = dataset;\n ArrayList<AP_object> GFS = new ArrayList<>();\n GFS.add(new AP_Plus()); //Addition\n GFS.add(new AP_Sub()); //Subtraction\n GFS.add(new AP_Multiply()); //Mulitplication\n GFS.add(new AP_Div()); //Divison\n GFS.add(new AP_Abs());\n GFS.add(new AP_Cos());\n GFS.add(new AP_Cubic());\n GFS.add(new AP_Exp());\n GFS.add(new AP_Ln());\n GFS.add(new AP_Log10());\n GFS.add(new AP_Mod());\n GFS.add(new AP_Quad());\n GFS.add(new AP_Sin());\n GFS.add(new AP_Sigmoid());\n GFS.add(new AP_Sqrt());\n GFS.add(new AP_Tan());\n GFS.add(new AP_aTOb());\n GFS.add(new AP_x1()); //Independent variable x1\n// GFS.add(new AP_Const_static()); //Constant object - value is evolved in the extension of the individuals\n //More functions and terminals for GFS can be found or added to model.ap.objects\n \n double const_min = -10; //Minimum value of constants\n double const_max = 10; //Maximum value of constants\n \n APtf tf = new APdataset(dataset_points, GFS, const_min, const_max); //Dataset constructor\n\n /**\n * Additional variables\n */\n \n int runs = run_count; //Number of runs of the regression\n \n double min; //Helping variable for best individual in terms of fitness function value\n double[] bestArray = new double[runs]; //Array for statistics\n int i, best; //Additional helping variables\n\n /**\n * Runs of the algorithm with statistical analysis\n */\n for (int k = 0; k < runs; k++) {\n\n best = 0;\n i = 0;\n min = Double.MAX_VALUE;\n \n de = new AP_DEbest(dimension, NP, MAXFES, tf, generator, f, cr, null);\n\n de.run();\n\n PrintWriter writer;\n\n try {\n writer = new PrintWriter(dir + tf.name() + \"-DEbest\" + k + \".txt\", \"UTF-8\");\n\n writer.print(\"{\");\n \n for (int ii = 0; ii < ((AP_DEbest)de).getBestHistory().size(); ii++) {\n\n writer.print(String.format(Locale.US, \"%.10f\", ((AP_DEbest)de).getBestHistory().get(ii).fitness));\n\n if (ii != ((AP_DEbest)de).getBestHistory().size() - 1) {\n writer.print(\",\");\n }\n\n }\n\n writer.print(\"}\");\n\n writer.close();\n\n } catch (FileNotFoundException | UnsupportedEncodingException ex) {\n Logger.getLogger(AP_LSHADE.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n bestArray[k] = de.getBest().fitness - tf.optimum();\n\n /**\n * AP best result value and equation.\n */\n\n System.out.println(\"=================================\");\n System.out.println(\"Best obtained fitness function value: \\n\" + (de.getBest().fitness - tf.optimum()));\n System.out.println(\"Equation: \\n\" + ((AP_Individual) de.getBest()).equation);\n System.out.println(\"Vector: \\n\" + Arrays.toString(((AP_Individual) de.getBest()).vector));\n System.out.println(\"=================================\");\n \n for(AP_Individual ind : ((AP_DEbest)de).getBestHistory()){\n i++;\n if(ind.fitness < min){\n min = ind.fitness;\n best = i;\n }\n if(ind.fitness == 0){\n System.out.println(\"Solution found in \" + i + \" CFE\");\n break;\n }\n }\n System.out.println(\"Best solution found in \" + best + \" CFE\");\n \n System.out.println(\"\\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\\n\");\n \n \n }\n\n System.out.println(\"=================================\");\n System.out.println(\"Min: \" + DoubleStream.of(bestArray).min().getAsDouble());\n System.out.println(\"Max: \" + DoubleStream.of(bestArray).max().getAsDouble());\n System.out.println(\"Mean: \" + new Mean().evaluate(bestArray));\n System.out.println(\"Median: \" + new Median().evaluate(bestArray));\n System.out.println(\"Std. Dev.: \" + new StandardDeviation().evaluate(bestArray));\n System.out.println(\"=================================\");\n \n }", "public void sortQueries(){\n\t\tif (queries == null || queries.isEmpty()) {\n\t\t\treturn;\n\t\t} else {\n\t\t Collections.sort(queries, new Comparator<OwnerQueryStatsDTO>() {\n @Override\n public int compare(OwnerQueryStatsDTO obj1, OwnerQueryStatsDTO obj2) {\n if(obj1.isArchived() && obj2.isArchived()) {\n return 0;\n } else if(obj1.isArchived()) {\n return 1;\n } else if(obj2.isArchived()) {\n return -1;\n } else {\n return 0;\n }\n }\n });\n\n\t }\n\t}", "public Map findAvailableSorters(INavigatorContentDescriptor theSource);", "private void setup() {\r\n final int gsz = _g.getNumNodes();\r\n if (_k==2) {\r\n\t\t\tNodeComparator2 comp = new NodeComparator2();\r\n\t\t\t_origNodesq = new TreeSet(comp);\r\n\t\t} else { // _k==1\r\n\t\t\tNodeComparator4 comp = new NodeComparator4();\r\n\t\t\t_origNodesq = new TreeSet(comp);\r\n\t\t}\r\n for (int i=0; i<gsz; i++) {\r\n _origNodesq.add(_g.getNodeUnsynchronized(i)); // used to be _g.getNode(i)\r\n }\r\n _nodesq = new TreeSet(_origNodesq);\r\n //System.err.println(\"done sorting\");\r\n }", "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}", "private List<Path> getChamberDirs() {\n try (Stream<Path> stream = Files.walk(chambersDir, 1)) {\n List<Path> dirs = stream.filter(path -> Files.isDirectory(path))\n .filter(path -> StringUtils.isNumeric(path.getFileName().toString()))\n .filter(path -> Files.exists(path.resolve(\"chamber.json\"))).collect(Collectors.toList());\n\n Collections.sort(dirs, new Comparator<Path>() {\n @Override\n public int compare(Path p1, Path p2) {\n int n1 = Integer.parseInt(p1.getFileName().toString());\n int n2 = Integer.parseInt(p2.getFileName().toString());\n return n1 - n2;\n }\n });\n\n return dirs;\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "private void loadData()\n {\n try\n {\n //Reads in the data from default file\n System.out.println(\"ATTEMPTING TO LOAD\");\n allGroups = (ArrayList<CharacterGroup>)serial.Deserialize(\"All-Groups.dat\");\n System.out.println(\"LOADED\");\n loadSuccessful = true;\n \n //If read is successful, save backup file in case of corruption\n try\n {\n System.out.println(\"SAVING BACKUP\");\n serial.Serialize(allGroups, \"All-Groups-backup.dat\");\n System.out.println(\"BACKUP SAVED\");\n } catch (IOException e)\n {\n System.out.println(\"FAILED TO WRITE BACKUP DATA\");\n }\n } catch (IOException e)\n {\n //If loading from default file fails, first try loading from backup file\n System.out.println(\"READING FROM DEFAULT FAILED\");\n try\n {\n System.out.println(\"ATTEMPTING TO READ FROM BACKUP\");\n allGroups = (ArrayList<CharacterGroup>)serial.Deserialize(\"All-Groups-backup\");\n System.out.println(\"READING FROM BACKUP SUCCESSFUL\");\n loadSuccessful = true;\n } catch (IOException ex)\n {\n //If reading from backup fails aswell generate default data\n System.out.println(\"READING FROM BACKUP FAILED\");\n allGroups = new ArrayList();\n } catch (ClassNotFoundException ex){}\n } catch (ClassNotFoundException e){}\n }", "public void readDrugs() {\n\t\tBufferedReader br;\n\t\tString s;\n\t\ttry {\n\t\t\tbr = new BufferedReader(new FileReader(\"drugs.txt\"));\n\n\t\t\twhile ((s = br.readLine()) != null) {\n\t\t\t\tString[] fields = s.split(\", \");\n\n\t\t\t\tString name = fields[0];\n\t\t\t\tString chemName = fields[1];\n\t\t\t\tString ingredients = fields[2];\n\t\t\t\tString manufComp = fields[3]; // manufacturing company\n\t\t\t\tString type = fields[4];\n\t\t\t\tString conditions = fields[5];\n\t\t\t\tString contra = fields[6]; // contraindications\n\t\t\t\tDrugs drug = new Drugs(name, chemName, ingredients, manufComp, type, conditions, contra);\n\t\t\t\tdrugs.add(drug);\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t}", "private void createGenres() {\n ArrayList<String> gen = new ArrayList<>();\n //\n for (Movie mov : moviedb.getAllMovies()) {\n for (String genre : mov.getGenre()) {\n if (!gen.contains(genre.toLowerCase()))\n gen.add(genre.toLowerCase());\n }\n }\n\n Collections.sort(gen);\n\n genres = gen;\n }", "public ArrayList<Dice> sortDiceArray() //sort the dice array by order of how you resolve\n {\n ArrayList<Dice> sortDiceArray = getDiceArray();\n for(int i = 0; i < sortDiceArray.size()-1; i++)\n {\n if(sortDiceArray.get(i).getDiceInt() > sortDiceArray.get(i+1).getDiceInt())\n {\n Collections.swap(sortDiceArray, i, i+1);\n i = 0;\n }\n }\n \n return diceArray;\n }", "private void loadDirectoryUp() {\n\t\tString s = pathDirsList.remove(pathDirsList.size() - 1);\n\t\t// path modified to exclude present directory\n\t\tpath = new File(path.toString().substring(0,\n\t\t\t\tpath.toString().lastIndexOf(s)));\n\t\tfileList.clear();\n\t}", "public void sort() {\r\n for (int i = 0; i < namesOfApp.length && i < runTimeOfApp.length; i++) {\r\n for (int j = 0; j < i; j++) {\r\n if (runTimeOfApp[j] < runTimeOfApp[i]) {\r\n String tempName = namesOfApp[i];\r\n long tempRunTime = runTimeOfApp[i];\r\n namesOfApp[i] = namesOfApp[j];\r\n runTimeOfApp[i] = runTimeOfApp[j];\r\n namesOfApp[j] = tempName;\r\n runTimeOfApp[j] = tempRunTime;\r\n }\r\n }\r\n }\r\n\r\n }", "public final void LoadData(ArrayList<Double> data, boolean sort)\r\n\t{\r\n\t\tbyKernels = (data.size() < maxForKernels);\r\n\t\tif (byKernels)\r\n\t\t{\r\n\t\t\tLoadKernels(data);\r\n\t\t\tdEst.SetPercentiles(false);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tArrayList<Double> robData = new ArrayList<Double>();\r\n\t\t\tif (windsor)\r\n\t\t\t{\r\n\t\t\t\trobData = stat.Windsor(data, cutoff, sort);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\trobData = stat.Trim(data, cutoff, sort);\r\n\t\t\t}\r\n\t\t\tmean = stat.Mean(robData);\r\n\t\t\tsd = stat.StDev(robData);\r\n\t\t}\r\n\t}", "private ArrayList<BoulderProblem> SortBps()\n {\n ArrayList<BoulderProblem> sortedBps = displayBps;\n if(sortOption.equals(\"name\"))\n {\n Collections.sort(sortedBps, bpNameComparator);\n }\n else if(sortOption.equals(\"grade\"))\n {\n Collections.sort(sortedBps, bpGradeComparator);\n }\n else\n {\n Collections.sort(sortedBps, bpSetterComparator);\n }\n return sortedBps;\n }", "private static Map<String, List<String>> loadCitiesByLanguage() {\n String resource = Config.get(\"generate.geography.foreign.birthplace.default_file\",\n \"geography/foreign_birthplace.json\");\n return loadCitiesByLanguage(resource);\n }", "public void PopulateRV()\n {\n //get the recycler view from the layout\n RecyclerView rv = (RecyclerView) view.findViewById(R.id.GeneralFragmentRV);\n rv.setHasFixedSize(true);\n rv.setLayoutManager(new LinearLayoutManager(view.getContext()));\n //pass the list of bps to the Recycler view via a custom adapter\n\n //get the list of bps sorted by user selected sort option\n ArrayList<BoulderProblem> sortedBps = SortBps();\n\n //return the list of bps in ascending or descending order based on user selected option\n ArrayList<BoulderProblem> displayedBps = new ArrayList<>();\n if(!ascendingOption)\n {\n for(int i = sortedBps.size(); i > 0; i--)\n {\n displayedBps.add(sortedBps.get(i-1));\n }\n }\n else\n {\n for(BoulderProblem bp : sortedBps)\n {\n displayedBps.add(bp);\n }\n }\n rv.setAdapter(new GeneralRVAdapter(displayedBps));\n }", "public LoadData(String db_dir, String data_dir) {\n this.db_dir = db_dir;\n this.data_dir = data_dir;\n this.sqlList = new ArrayList<String>();\n this.logger = Logger.getInstance();\n }", "public void init(){\n\t\tcontentInBank = new TreeMap<>();\n\t\tint bank=0;\n\t\tfor (int i = 0; i < MEMORY_ADDRESS_LIMIT; i++) {\n\t\t\tbank = i % numOfbank;\n\t\t\t\n\t\t\tif (contentInBank.get(bank) == null) {\n\t\t\t\tMap<Integer,Entry>con = new TreeMap<>();\n\t\t\t\tcon.put(i, new Entry(MemoryType.UNDEF,\"0\", i));\n\t\t\t\tcontentInBank.put(bank, con);\n\t\t\t} else {\n\t\t\t\tcontentInBank.get(bank).put(i, new Entry(MemoryType.UNDEF,\"0\", i));\t\n\t\t\t}\n\t\t}\n\t}", "private void sortArticleByViews() {\n final DatabaseReference database;\n database = FirebaseDatabase.getInstance().getReference();\n\n database.child(\"Views\").addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n Map<Integer,ArrayList<Article>> articlesTreeMap;\n articlesTreeMap = new TreeMap<>(Collections.reverseOrder());\n for(Article a : articles) {\n DataSnapshot viewArticleSnapShot = null;\n for (DataSnapshot snapshot : dataSnapshot.getChildren()) {\n if (a.getLink() != null && a.getLink() != \"\" && snapshot.child(\"Link\").getValue().equals(a.getLink())) {\n viewArticleSnapShot = snapshot;\n break;\n }\n }\n int views = 0;\n if (viewArticleSnapShot != null) {\n views = Integer.parseInt(viewArticleSnapShot.child(\"Count\").getValue().toString());\n }\n if(!articlesTreeMap.containsKey(views)) {\n articlesTreeMap.put(views, new ArrayList<Article>());\n }\n articlesTreeMap.get(views).add(a);\n }\n\n articles.clear();\n for(Map.Entry<Integer,ArrayList<Article>> entry : articlesTreeMap.entrySet()) {\n ArrayList<Article> list = entry.getValue();\n articles.addAll(list);\n }\n mSectionsPagerAdapter.notifyDataSetChanged();\n }\n\n @Override\n public void onCancelled(DatabaseError d) {\n Log.d(\"Login DbError Msg ->\", d.getMessage());\n Log.d(\"Login DbError Detail ->\", d.getDetails());\n }\n });\n }", "private DistanceObject[] sortDistanceObjects(DistanceObject[] dObj,\n\t\t\tint objCount) {\n\t\tArrays.sort(dObj, 0, objCount, new DistanceObjectComparator());\n\t\tlogger.info(\"\\n\\nSorted\\n\\n\");\n\t\tfor (int i = 0; i < objCount; i++) {\n\t\t\tlogger.info(dObj[i].getKey() + \"\\t\" + dObj[i].getValue());\n\t\t}\n\t\treturn dObj;\n\t}", "public static void produceFiles(DataLoaders d, double p, String corpus) throws CompressorException, IOException{\n//\t\tsort -t$'\\t' -k5 -nr conll.ambiverse.mappings > conll.ambiverse.mappings.sorted\n//\t\tsort -t$'\\t' -k5 -nr conll.babelfy.mappings > conll.babelfy.mappings.sorted\n//\t\tsort -t$'\\t' -k5 -nr conll.tagme.mappings > conll.tagme.mappings.sorted\n\t\t\n//\t\thead -n 23865 conll.tagme.mappings > conll_tagme_train.mappings\n\t\t\n\t\tdouble prop = 0;\n\n//\t\tTreeMap<String,String> ambiverseMap = new TreeMap<String, String>(); \n//\t\tTreeMap<String,String> babelfyMap = new TreeMap<String, String>();\n//\t\tTreeMap<String,String> tagmeMap = new TreeMap<String, String>();\n//\t\t\n\t\n\t\tOutputStreamWriter Ambp = new OutputStreamWriter(new FileOutputStream(\"./resources/ds/\"+corpus+\"/ds.amb.\"+p+\".txt\"), StandardCharsets.UTF_8);\n\t\tOutputStreamWriter Babp = new OutputStreamWriter(new FileOutputStream(\"./resources/ds/\"+corpus+\"/ds.bab.\"+p+\".txt\"), StandardCharsets.UTF_8);\n\t\tOutputStreamWriter Tagp = new OutputStreamWriter(new FileOutputStream(\"./resources/ds/\"+corpus+\"/ds.tag.\"+p+\".txt\"), StandardCharsets.UTF_8);\n\t\tCSVWriter csvWriterAmbp = new CSVWriter(Ambp, ',' , '\\'', '\\\\');\n\t\tCSVWriter csvWriterBabp = new CSVWriter(Babp, ',' , '\\'', '\\\\');\n\t\tCSVWriter csvWriterTagp = new CSVWriter(Tagp, ',' , '\\'', '\\\\');\n\t\t\n\t\tBufferedReader bffReaderAmbiverse = new BufferedReader(new InputStreamReader(new FileInputStream(\"/home/joao/datasets/\"+corpus+\"/mappings/\"+corpus+\".ambiverse.mappings.sorted\"),StandardCharsets.UTF_8));\n\t\tBufferedReader bffReaderBabelfy = new BufferedReader(new InputStreamReader(new FileInputStream(\"/home/joao/datasets/\"+corpus+\"/mappings/\"+corpus+\".babelfy.mappings.sorted\"),StandardCharsets.UTF_8));\n\t\tBufferedReader bffReaderTagme = new BufferedReader(new InputStreamReader(new FileInputStream(\"/home/joao/datasets/\"+corpus+\"/mappings/\"+corpus+\".tagme.mappings.sorted\"),StandardCharsets.UTF_8));\n\t\n\t\t\n\t\tString line=\"\";\n\t\tint countAmbiverse = 0;\n\t\twhile ((line = bffReaderAmbiverse.readLine()) != null) {\n\t\t\tString[] elements = line.split(\"\\t\");\n\t\t\tif(elements.length >=4){\n\t\t\t\tString docid = elements[0].toLowerCase();\n\t\t \tdocid = docid.replaceAll(\"\\'\", \"\");\n\t\t\t\tdocid = docid.replaceAll(\"\\\"\", \"\");\n\t\t\t\tString mention = elements[1].toLowerCase();\n\t\t\t\tString offset = elements[2];\n\t\t\t\tString entity = elements[3];\n\t\t\t\tif(entity.equalsIgnoreCase(\"null\")){ \n\t\t\t\t\tcontinue;\n\t\t\t\t}else{\n\t\t\t\t\tString confidence = elements[4];\n\t\t\t\t\tentity = entity.replaceAll(\"_\",\" \").toLowerCase();\n\t\t\t\t\tString key = docid+\"\\t\"+mention+\"\\t\"+offset;\n\t\t\t\t\tcountAmbiverse++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tline=\"\";\n\t\tint countBabelfy = 0;\n\t\twhile ((line = bffReaderBabelfy.readLine()) != null) {\n\t\t\tString[] elements = line.split(\"\\t\");\n\t\t\tif(elements.length >=4){\n\t\t\t\tString docid = elements[0].toLowerCase();\n\t\t \tdocid = docid.replaceAll(\"\\'\", \"\");\n\t\t\t\tdocid = docid.replaceAll(\"\\\"\", \"\");\n\t\t\t\tString mention = elements[1].toLowerCase();\n\t\t\t\tString offset = elements[2];\n\t\t\t\tString entity = elements[3];\n\t\t\t\tif(entity.equalsIgnoreCase(\"null\")){ \n\t\t\t\t\tcontinue;\n\t\t\t\t}else{\n\t\t\t\t\tString confidence = elements[4];\n\t\t\t\t\tentity = entity.replaceAll(\"_\",\" \").toLowerCase();\n\t\t\t\t\tString key = docid+\"\\t\"+mention+\"\\t\"+offset;\n\t\t\t\t\tcountBabelfy++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tline=\"\";\n\t\tint countTagme = 0;\n\t\twhile ((line = bffReaderTagme.readLine()) != null) {\n\t\t\tString[] elements = line.split(\"\\t\");\n\t\t\tif(elements.length >=4){\n\t\t\t\tString docid = elements[0].toLowerCase();\n\t\t \tdocid = docid.replaceAll(\"\\'\", \"\");\n\t\t\t\tdocid = docid.replaceAll(\"\\\"\", \"\");\n\t\t\t\tString mention = elements[1].toLowerCase();\n\t\t\t\tmention = mention.replaceAll(\"\\\"\", \" \");\n\t\t\t\tString offset = elements[2];\n\t\t\t\tString entity = elements[3];\n\t\t\t\tif(entity.equalsIgnoreCase(\"null\")){ \n\t\t\t\t\tcontinue;\n\t\t\t\t}else{\n\t\t\t\t\tString confidence = elements[4];\n\t\t\t\t\tentity = entity.replaceAll(\"_\",\" \").toLowerCase();\n\t\t\t\t\tString key = docid+\"\\t\"+mention+\"\\t\"+offset;\n\t\t\t\t\tcountTagme++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tbffReaderAmbiverse.close();\n\t\tbffReaderBabelfy.close();\n\t\tbffReaderTagme.close();\n\t\t\n/* End */\n\t\t\n\t\t\n//\t\t// *** Producing files ***//\n\t\tbffReaderAmbiverse = new BufferedReader(new InputStreamReader(new FileInputStream(\"/home/joao/datasets/\"+corpus+\"/mappings/\"+corpus+\".ambiverse.mappings.sorted\"),StandardCharsets.UTF_8));\n\t\n\t\tprop = ( p/100.0 )* countAmbiverse;\n\t\t\n\t\tint count = 0;\n\t\tline=\"\";\n\t\twhile ((line = bffReaderAmbiverse.readLine()) != null) {\n\t\t\tString[] elements = line.split(\"\\t\");\n\t\t\tif(elements.length >=4){\n\t\t\t\tString docid = elements[0].toLowerCase();\n\t\t \tdocid = docid.replaceAll(\"\\'\", \"\");\n\t\t\t\tdocid = docid.replaceAll(\"\\\"\", \"\");\n\t\t\t\tString mention = elements[1].toLowerCase();\n\t\t\t\tString offset = elements[2];\n\t\t\t\tString entity = elements[3];\n\t\t\t\tString confidence = elements[4];\n\t\t\t\tentity = entity.replaceAll(\"_\",\" \").toLowerCase();\n\t\t\t\tcount++;\n\t\t\t\tif(count <= prop ){\n\t\t\t\t\tAmbp.write(docid+\"\\t\"+mention+\"\\t\"+offset+\"\\t\"+entity+\"\\t\"+confidence+\"\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n//\t\tSystem.out.println(prop);\n\t\t\n\t\tbffReaderBabelfy = new BufferedReader(new InputStreamReader(new FileInputStream(\"/home/joao/datasets/\"+corpus+\"/mappings/\"+corpus+\".babelfy.mappings.sorted\"),StandardCharsets.UTF_8));\n\t\tprop = ( p/100.0 )* countBabelfy;\n\t\tcount = 0;\n\t\tline=\"\";\n\t\twhile ((line = bffReaderBabelfy.readLine()) != null) {\n\t\t\tString[] elements = line.split(\"\\t\");\n\t\t\tif(elements.length >=4){\n\t\t\t\tString docid = elements[0].toLowerCase();\n\t\t \tdocid = docid.replaceAll(\"\\'\", \"\");\n\t\t\t\tdocid = docid.replaceAll(\"\\\"\", \"\");\n\t\t\t\tString mention = elements[1].toLowerCase();\n\t\t\t\tString offset = elements[2];\n\t\t\t\tString entity = elements[3];\n\t\t\t\tString confidence = elements[4];\n\t\t\t\tentity = entity.replaceAll(\"_\",\" \").toLowerCase();\n\t\t\t\tcount++;\n\t\t\t\tif(count <= prop){\n\t\t\t\t\tBabp.write(docid+\"\\t\"+mention+\"\\t\"+offset+\"\\t\"+entity+\"\\t\"+confidence+\"\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n//\t\tSystem.out.println(prop);\n\t\t\n\t\tbffReaderTagme = new BufferedReader(new InputStreamReader(new FileInputStream(\"/home/joao/datasets/\"+corpus+\"/mappings/\"+corpus+\".tagme.mappings.sorted\"),StandardCharsets.UTF_8));\n\t\tprop = ( p/100.0 )* countTagme;\n\t\tcount = 0;\n\t\tline=\"\";\n\t\twhile ((line = bffReaderTagme.readLine()) != null) {\n\t\t\tString[] elements = line.split(\"\\t\");\n\t\t\tif(elements.length >=4){\n\t\t\t\tString docid = elements[0].toLowerCase();\n\t\t \tdocid = docid.replaceAll(\"\\'\", \"\");\n\t\t\t\tdocid = docid.replaceAll(\"\\\"\", \"\");\n\t\t\t\tString mention = elements[1].toLowerCase();\n\t\t\t\tString offset = elements[2];\n\t\t\t\tString entity = elements[3];\n\t\t\t\tString confidence = elements[4];\n\t\t\t\tentity = entity.replaceAll(\"_\",\" \").toLowerCase();\n\t\t\t\tcount++;\n\t\t\t\tif(count <= prop){\n\t\t\t\t\tTagp.write(docid+\"\\t\"+mention+\"\\t\"+offset+\"\\t\"+entity+\"\\t\"+confidence+\"\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n//\t\tSystem.out.println(prop);\n\t\t\n\t\tbffReaderAmbiverse.close();\n\t\tbffReaderBabelfy.close();\n\t\tbffReaderTagme.close();\n\t\t\n\t\tAmbp.close();\n\t\tBabp.close();\n\t\tTagp.close();\n\t\t\n\t\t\n\t}", "public void sortGlobalAccountBalances()\n\t{\n\t\tCollections.sort(globalAccountBalances, new GlobalAccountBalanceBean.GlobalAccountBalanceBeanComparator());\n\t}", "private void sortGallery_10_Runnable() {\r\n\r\n\t\tif (_allPhotos == null || _allPhotos.length == 0) {\r\n\t\t\t// there are no files\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tfinal GalleryMT20Item[] virtualGalleryItems = _galleryMT20.getAllVirtualItems();\r\n\t\tfinal int virtualSize = virtualGalleryItems.length;\r\n\r\n\t\tif (virtualSize == 0) {\r\n\t\t\t// there are no items\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// sort photos with new sorting algorithm\r\n\t\tArrays.sort(_sortedAndFilteredPhotos, getCurrentComparator());\r\n\r\n\t\tupdateUI_GalleryItems(_sortedAndFilteredPhotos, null);\r\n\t}", "public synchronized void sort()\n\t{\n\t\tCollections.sort(vars, tvComparator);\n\t}" ]
[ "0.5323872", "0.52932495", "0.52539563", "0.5066209", "0.5004715", "0.49762425", "0.48990893", "0.48736483", "0.486484", "0.48211503", "0.47279164", "0.4696114", "0.46821135", "0.46759748", "0.4660434", "0.46394292", "0.4616335", "0.46157032", "0.45707455", "0.45688966", "0.45424774", "0.45395476", "0.4530588", "0.45248657", "0.4524119", "0.45173004", "0.45141572", "0.45070413", "0.4492438", "0.44794655", "0.44748577", "0.446863", "0.44649372", "0.44469106", "0.44452447", "0.44316134", "0.4427345", "0.4421561", "0.43938342", "0.43889597", "0.4388", "0.438657", "0.43739736", "0.43625274", "0.43526906", "0.43431714", "0.43401894", "0.43366164", "0.43353117", "0.43327072", "0.4316699", "0.4316267", "0.43145373", "0.4312364", "0.43106943", "0.4307961", "0.43071857", "0.43026048", "0.42959628", "0.4295076", "0.42924803", "0.42908287", "0.42898375", "0.42896226", "0.4282187", "0.4281933", "0.42779928", "0.42741814", "0.4273209", "0.42664194", "0.42645425", "0.4257865", "0.4252289", "0.42495796", "0.424909", "0.42458716", "0.42355672", "0.4233919", "0.4228564", "0.422258", "0.42182305", "0.42174172", "0.42055598", "0.420347", "0.41994858", "0.4196888", "0.41966274", "0.41953883", "0.41941014", "0.4193855", "0.41895428", "0.41879693", "0.4183263", "0.4182657", "0.4176181", "0.41719595", "0.41681048", "0.4165022", "0.41637084", "0.4159184" ]
0.6669869
0
Private helper method used by getDefaultDstDrugs (Adds an element to the default dst drug map)
private static void addDefaultDstDrugToMap(List<List<Object>> drugs, Concept concept, String concentration) { List<Object> data = new LinkedList<Object>(); data.add(concept); data.add(concentration); drugs.add(data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static List<List<Object>> getDefaultDstDrugs() {\r\n \tList<List<Object>> drugs = new LinkedList<List<Object>>();\r\n \t\r\n \tString defaultDstDrugs = Context.getAdministrationService().getGlobalProperty(\"mdrtb.defaultDstDrugs\");\r\n \t\r\n \tif(StringUtils.isNotBlank(defaultDstDrugs)) {\r\n \t\t// split on the pipe\r\n \t\tfor (String drugString : defaultDstDrugs.split(\"\\\\|\")) {\r\n \t\t\t\r\n \t\t\t// now split into a name and concentration \r\n \t\t\tString drug = drugString.split(\":\")[0];\r\n \t\t\tString concentration = null;\r\n \t\t\tif (drugString.split(\":\").length > 1) {\r\n \t\t\t\tconcentration = drugString.split(\":\")[1];\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\ttry {\r\n \t\t\t\t// see if this is a concept id\r\n \t\t\t\tInteger conceptId = Integer.valueOf(drug);\r\n \t\t\t\tConcept concept = Context.getConceptService().getConcept(conceptId);\r\n \t\t\t\t\r\n \t\t\t\tif (concept == null) {\r\n \t\t\t\t\tlog.error(\"Unable to find concept referenced by id \" + conceptId);\r\n \t\t\t\t}\r\n \t\t\t\t// add the concept/concentration pair to the list\r\n \t\t\t\telse {\r\n \t\t\t\t\taddDefaultDstDrugToMap(drugs, concept, concentration);\r\n \t\t\t\t}\r\n \t\t\t} \t\r\n \t\t\tcatch (NumberFormatException e) {\r\n \t\t\t\t// if not a concept id, must be a concept map\r\n \t\t\t\tConcept concept = Context.getService(MdrtbService.class).getConcept(drug);\r\n \t\t\t\t\r\n \t\t\t\tif (concept == null) {\r\n \t\t\t\t\tlog.error(\"Unable to find concept referenced by \" + drug);\r\n \t\t\t\t}\r\n \t\t\t\t// add the concept to the list\r\n \t\t\t\telse {\r\n \t\t\t\t\taddDefaultDstDrugToMap(drugs, concept, concentration);\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n \t\r\n \treturn drugs;\r\n }", "@Override\n\tpublic void setDstId(String arg0) {\n\n\t}", "public void addEdgeTo(int dstId){\n\t\tcurrMethod.flowGraph.addEdge(vid, dstId);\r\n\t}", "@Override\n\tpublic void insertIntDst(IntDstDto intDst) throws Exception {\n\n\t}", "private Path2D destination(final Map<PolylineStage,Path2D> appendTo) {\n return appendTo.computeIfAbsent(this, (k) -> new Path2D.Float());\n }", "@Override\n\tpublic void addDept(DeptInf dept) {\n\t\tdeptMapper.insert(dept);\n\t}", "protected void addShiftToCache () {\n if (digitalShift == null)\n for (int j = 0; j < dimS; j++)\n cachedCurPoint[j] = 0;\n else\n for (int j = 0; j < dimS; j++)\n cachedCurPoint[j] = digitalShift[j];\n }", "public void addPassengerShip(Scanner sc){\n PassengerShip pShip = new PassengerShip(sc, portMap, shipMap, dockMap);\n if(hashMap.containsKey(pShip.getParent())){\n if(hashMap.get(pShip.getParent()).getIndex()>=10000 && hashMap.get(pShip.getParent()).getIndex() < 20000){\n currentPort = (SeaPort) hashMap.get(pShip.getParent());\n currentPort.setShips(pShip);\n currentPort.setAllShips(pShip);\n \n }\n else{\n currentDock = (Dock) hashMap.get(pShip.getParent());\n currentDock.addShip(pShip);\n currentPort = (SeaPort) hashMap.get(currentDock.getParent());\n currentPort.setAllShips(pShip);\n }\n \n \n }\n hashMap.put(pShip.getIndex(), pShip);\n shipMap.put(pShip.getIndex(), pShip);\n everything.add(pShip);\n }", "protected void addShiftToCache () {\n if (digitalShift == null)\n for (int j = 0; j <= dim; j++)\n cachedCurPoint[j] = 0;\n else\n for (int j = 0; j <= dim; j++)\n cachedCurPoint[j] = digitalShift[j];\n }", "protected void addToRecycleBin(final IndexedDiskElementDescriptor ded)\r\n {\r\n // reuse the spot\r\n if (ded != null)\r\n {\r\n storageLock.readLock().lock();\r\n\r\n try\r\n {\r\n adjustBytesFree(ded, true);\r\n\r\n if (doRecycle)\r\n {\r\n recycle.add(ded);\r\n log.debug(\"{0}: recycled ded {1}\", logCacheName, ded);\r\n }\r\n }\r\n finally\r\n {\r\n storageLock.readLock().unlock();\r\n }\r\n }\r\n }", "@Override\r\n\tpublic boolean gboardInsert(GroupBoardDto dto) {\n\t\treturn false;\r\n\t}", "@Override\n public void addDefaultElements() {\n addNearestNeighbours(getSoftwareSystem(), CustomElement.class);\n addNearestNeighbours(getSoftwareSystem(), Person.class);\n addNearestNeighbours(getSoftwareSystem(), SoftwareSystem.class);\n }", "default DiscreteDoubleMap2D plus(double value) {\r\n\t\treturn pushForward(d -> d + value);\r\n\t}", "private boolean addSuperNode(String sourceOrDestination, String[] sourceOrDestinationArray){\r\n boolean dsNotFound = false;\r\n Node superNode = new Node(sourceOrDestination, 0);\r\n for(int i = 0; i < sourceOrDestinationArray.length; i ++){\r\n //ds = find the node with the source/destination name\r\n Node ds = findNode(sourceOrDestinationArray[i]);\r\n //if destination and exists make edge from destination to \"superSink\"\r\n if(ds != null && sourceOrDestination.equals(\"superSink\")) {\r\n Edge newEdge = new Edge(ds, superNode, Integer.MAX_VALUE, 0);\r\n ds.addEdge(newEdge);\r\n }\r\n //if source and exists make edge from \"superSource\" to source\r\n else if(ds != null && sourceOrDestination.equals(\"superSource\")){\r\n Edge newEdge = new Edge(superNode, ds, Integer.MAX_VALUE, 0);\r\n superNode.addEdge(newEdge);\r\n }\r\n // either source or destination not found\r\n else {\r\n dsNotFound = true;\r\n }\r\n }\r\n //add new nodes at index 0;\r\n nodes.add(0, superNode);\r\n return dsNotFound;\r\n }", "public void addEdge(Node src, Node dest, int cost){\n if(nodes.containsKey(src) && nodes.containsKey(dest)){\n Edge newEdge = new Edge(src, dest, cost);\n nodes.get(src).add(dest);\n src.addNodeEdge(newEdge);\n\n Edge otherEdge = new Edge(dest, src, cost);\n nodes.get(dest).add(src);\n dest.addNodeEdge(otherEdge);\n\n\n }\n\n }", "@Test\n\tpublic void addRoadTest(){\n\t\tDjikstrasMap m = new DjikstrasMap();\t//Creates new DjikstrasMap object\n\t\tLocation l1 = new Location(\"Guildford\");\n\t\tLocation l2 = new Location(\"Portsmouth\");\n\t\t\n\t\tm.addRoad(\"Guildford\", \"Portsmouth\", 20.5, \"M3\");\t//Adds a road from Guildford to portsmouth to the map\n m.addRoad(\"Portsmouth\", \"Guildford\", 20.5, \"M3\");\n \n assertEquals(l1.getName(), m.getNode(\"Guildford\").getName());\t//Tests that the method added the roads correctly to teh map\n assertEquals(l2.getName(), m.getNode(\"Portsmouth\").getName());\n\t}", "@Override\n\tpublic void addEdge(Location src, Location dest, Path edge) {\n\t\tint i = locations.indexOf(src);\n\t\tpaths.get(locations.indexOf(src)).add(edge);\n\t}", "org.landxml.schema.landXML11.DecisionSightDistanceDocument.DecisionSightDistance addNewDecisionSightDistance();", "public void AddDVector(int id, HashMap<Integer,DVCell> dv) {\n for(Integer i: dv.keySet()) {\n SetCell(id,i, dv.get(i));\n }\n }", "D add(D dto);", "private ArrayList<Pair> getPossibleDestinations(int sourceRow, int sourceCol, int dr, int dc) {\n ArrayList<Pair> possibleDest = new ArrayList<>();\n\n for (int i = 1; i < 8; i++) {\n\n int destRow = sourceRow + dr * i;\n int destCol = sourceCol + dc * i;\n\n if (0 <= destRow && destRow < 8 && 0 <= destCol && destCol < 8)\n possibleDest.add(new Pair<>(destRow, destCol));\n else\n break;\n }\n\n return possibleDest;\n }", "protected void addOverride( int ovrTypId, ScheduleTransactionMapper stMapper, SkdData skdData )\n throws Exception {\n\n String ovrNewValue = getOvrNewValue( skdData );\n \n if (ovrNewValue == null) {\n if (logger.isEnabledFor(org.apache.log4j.Level.DEBUG)) {\n logger.debug( \"SLScheduleTransaction.addOverride: ovrNewValue is null, no override to add.\" );\n } \n return;\n }\n \n Date workDate = DateHelper.parseDate(skdData.skdDate, ovrDateFormat);\n \n OverrideData ovr = new OverrideData(); \n ovr.setEmpId( stMapper.getEmpId() );\n ovr.setOvrCreateDate( new java.util.Date() );\n ovr.setOvrStartDate( workDate );\n ovr.setOvrEndDate( workDate );\n ovr.setOvrStartTime( DateHelper.parseDate(skdData.skdStartTime1, inputDateFormat) );\n ovr.setOvrEndTime( DateHelper.parseDate(skdData.skdEndTime1, inputDateFormat) );\n ovr.setOvrStatus( OverrideData.PENDING );\n ovr.setOvrtypId( ovrTypId );\n ovr.setOvrNewValue( ovrNewValue);\n ovr.setWbuNameBoth( ovrWbuName, ovrWbuName );\n if (logger.isEnabledFor(org.apache.log4j.Level.DEBUG)) {\n logger.debug(\"Creating override with new value : \" + ovrNewValue);\n }\n \n new OverrideAccess(conn).insert( ovr , false);\n\n // Only recalculate overrides that are within the days limit \n if( !workDate.after(lastDateForscheduleAdjust) ) {\n addToEmpIdAndDates( stMapper.getEmpId(), workDate );\n }\n }", "protected void addEdge(int src, int dest) {\n\t\tthis.adjListArray[src].add(dest);\n\t}", "public void addVendor_Scheme_Plan_Map() {\n\t\tboolean flg = false;\n\n\t\ttry {\n\n\t\t\tvspmDAO = new Vendor_Scheme_Plan_MapDAO();\n\t\t\tflg = vspmDAO.saveVendor_Scheme_Plan_Map(vspm);\n\t\t\tif (flg) {\n\t\t\t\tvspm = new Vendor_Scheme_Plan_Map();\n\t\t\t\tMessages.addGlobalInfo(\"New mapping has been added!\");\n\t\t\t} else {\n\t\t\t\tMessages.addGlobalInfo(\"Failed to add new mapping! Please try again later.\");\n\t\t\t}\n\n\t\t} catch (Exception exception) {\n\t\t\texception.printStackTrace();\n\t\t} finally {\n\t\t\tvspmDAO = null;\n\t\t}\n\t}", "public void addToCache () {\n ArrayList <Location> gridCache = getGridCache();\n for (Location l : imageLocs) {\n gridCache.add (l);\n }\n }", "public void addDestination(ReplicaCatalogEntry rce) {\n List<ReplicaCatalogEntry> l = null;\n if (mDestMap.containsKey(rce.getResourceHandle())) {\n // add the url to the existing list\n l = (List) mDestMap.get(rce.getResourceHandle());\n // add the entry to the list\n l.add(rce);\n } else {\n // add a new list\n l = new ArrayList(3);\n l.add(rce);\n mDestMap.put(rce.getResourceHandle(), l);\n }\n }", "@RequiresLock(\"SeaLock\")\r\n private void addDeponent(Drop deponent) {\r\n if (!f_valid || deponent == null) {\r\n return;\r\n }\r\n if (deponent == this) {\r\n return;\r\n }\r\n f_deponents.add(deponent);\r\n }", "public void addDefaultExcludes()\n {\n int excludesLength = excludes == null ? 0 : excludes.length;\n String[] newExcludes;\n newExcludes = new String[ excludesLength + DEFAULTEXCLUDES.length ];\n if( excludesLength > 0 )\n {\n System.arraycopy( excludes, 0, newExcludes, 0, excludesLength );\n }\n for( int i = 0; i < DEFAULTEXCLUDES.length; i++ )\n {\n newExcludes[ i + excludesLength ] = DEFAULTEXCLUDES[ i ].replace( '/', File.separatorChar ).replace( '\\\\', File.separatorChar );\n }\n excludes = newExcludes;\n }", "public void addDrones(Collection<Drone> drones){\n\t\tMap<String, Drone> droneMap = this.getDroneMap();\n\t\t//add all the drones\n\t\tfor(Drone drone: drones){\n\t\t\tString ID =drone.getDroneID();\n\t\t\tdroneMap.put(ID, drone);\n\t\t}\n\t}", "default DiscreteDoubleMap2D plus(DiscreteDoubleMap2D other) {\r\n\t\treturn (x, y) -> this.getValueAt(x, y) + other.getValueAt(x, y);\r\n\t}", "public void addEdge(T source, T destination, boolean biDirectional) {\n\n if(!map.containsKey(source)) addVertex(source);\n if(!map.containsKey(destination)) addVertex(destination);\n\n map.get(source).add(destination);\n if(biDirectional) map.get(destination).add(source);\n }", "private void pathFill(Vertex<E> src, Vertex<E> dst, ArrayList<E> path) {\r\n\t\tif(src == dst) {\r\n\t\t\tpath.add(src.getElement());\r\n\t\t} else {\r\n\t\t\tpathFill(src, dst.getPredecessor(), path);\r\n\t\t\tpath.add(dst.getElement());\r\n\t\t}\r\n\t}", "public void addBankDDLocation() {\n\t\t System.out.println(\"the value of country\"+this.countryId);\n\t\t System.out.println(\"the map value is\"+mapCountryList.get(this.countryId));\n\t\t System.out.println(\"dDAgent :\"+ dDAgent +\"the map value is\"+mapAgentList.get(new BigDecimal(this.dDAgent)));\n\t\t try {\n\t\t AddBankDDPrintLocBean addBankDDPrintLocBean = new AddBankDDPrintLocBean(mapCountryList.get(this.countryId),this.dDAgent,this.dDPrintLocation,this.countryId,this.stateId,this.districtId,this.cityId,this.bankBranchId,mapAgentList.get(new BigDecimal(this.dDAgent)));\n\t\t bankDdPrintLocationList.add(addBankDDPrintLocBean);\n\t\t }catch(NullPointerException npexp) {\n\t\t\t System.out.println(\"null pointer exception is occured\");\n\t\t\t npexp.printStackTrace();\n\t\t }catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t \n\t\t setRenderDDDataTable(true);\n\t\t setBankBranchId(null);\n\t\t setBankId(null);\n\t\t setCountryId(null);\n\t\t setStateId(null);\n\t\t setDistrictId(null);\n\t\t setCityId(null);\n\t\t setdDAgent(\"\");\n\t\t setdDPrintLocation(\"\");\n\t\t setRenderDdprintLocation(false);\n\t }", "public void addBridgeEntryToCache(Uint64 dpnId, BridgeEntry bridgeEntry) {\n bridgeEntryMap.put(dpnId, bridgeEntry);\n }", "public boolean addEdge(Object src, Object dest, boolean direction)\n\t{\n\t\tif(!this.map.containsKey(src))\n\t\t\tthis.addVertex(src);\n\t\tif(!this.map.containsKey(dest))\n\t\t\tthis.addVertex(dest);\n\t\t\n\t\t// set the direction of the edge\n\t\tif(direction)\n\t\t{\n\t\t\t// only add the edge doesn't already exist\n\t\t\tif(!map.get(src).contains(dest))\n\t\t\t{\n\t\t\t\tmap.get(src).addNode(dest);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\telse\t\t\t\n\t\t{\n\t\t\tboolean edgeAdded = false;\n\t\t\t// only add the edge doesn't already exist\n\t\t\tif(!map.get(src).contains(dest))\n\t\t\t{\n\t\t\t\tmap.get(src).addNode(dest);\n\t\t\t\tedgeAdded = true;\n\t\t\t}\n\t\t\t// only add the edge doesn't already exist\n\t\t\tif(!map.get(dest).contains(dest))\n\t\t\t{\n\t\t\t\tmap.get(dest).addNode(src);\n\t\t\t\tedgeAdded = true;\n\t\t\t}\n\t\t\treturn edgeAdded;\n\t\t}\n\t}", "public void addGadgetAdminData(String gadgetUrl, GadgetAdminData toAdd) {\n if (gadgetUrl != null) {\n if (toAdd == null) {\n toAdd = new GadgetAdminData();\n }\n this.gadgetAdminMap.put(gadgetUrl, toAdd);\n }\n }", "@Override\r\n\tpublic void addToCost() {\n\t\t\r\n\t}", "int insertSelective(Destinations record);", "public void addDrone(Drone d) {\r\n\t\tthis.freeDrones.add(d);\r\n\t\t\r\n\t}", "private NetworkProfile getFinalDestination(NetworkProfile dst) {\n NetworkProfile fdst = null;\n// if (dst.isNameProfile()) {\n// //라우팅 스토어에서 검색\n// fdst = dst;\n// } else {\n fdst = dst;\n// }\n return fdst;\n }", "public void addDrone(Drone drone){\n\t Set<Drone> droneSet = this.getDroneSet();\n\t droneSet.add(drone);\n }", "public void addPixel(Pixel pix) throws DuplicatedKeyException {\n\t\tbst.put(bst.getRoot(), pix);\n\t}", "private void addDestinationButton() {\n try {\n Component lastComponent = destinationLabelPanel.getComponent(2);\n if (lastComponent == destinationTextLabel) {\n destinationLabelPanel.remove(destinationTextLabel);\n destinationLabelPanel.add(destinationButton);\n }\n }\n catch (ArrayIndexOutOfBoundsException e) {\n destinationLabelPanel.add(destinationButton);\n }\n }", "public void updateNodeBoundsChanges(Object src) {\n\t\t\n\t\tif (src == group) {\n\t\t\t\n\t\t\tint numToAdd = nodeAddList.size();\n\t\t\tif (numToAdd > 0) {\n\t\t\t\tfor (int i = 0; i < numToAdd; i++) {\n\t\t\t\t\tNode node = nodeAddList.get(i);\n\t\t\t\t\tgroup.addChild(node);\n\t\t\t\t}\n\t\t\t}\n\t\t\tint numToRemove = nodeRemoveList.size();\n\t\t\tif (numToRemove > 0) {\n\t\t\t\tfor (int i = 0; i < numToRemove; i++) {\n\t\t\t\t\tNode node = nodeRemoveList.get(i);\n\t\t\t\t\tgroup.removeChild(node);\n\t\t\t\t}\n\t\t\t\tnodeRemoveList.clear();\n\t\t\t}\n\t\t\t\n\t\t\tnodeRemoveList.addAll(nodeAddList);\n\t\t\tnodeAddList.clear();\n\t\t\t\n\t\t\tconfig = false;\n\t\t}\n\t}", "public void add(TeleportDestination warp) {\n\t\tremove(warp.getName());\n\t\tdestinations.add(warp);\n\t}", "private static <V, I> void dfsCopy(final DAG<V, I> srcDAG, final V src, final DAG<V, I> destDAG) {\n final Map<V, I> edges = srcDAG.getEdges(src);\n for (final Map.Entry<V, I> edge : edges.entrySet()) {\n final V nextVertex = edge.getKey();\n final boolean newVertexAdded = destDAG.addVertex(nextVertex);\n destDAG.addEdge(src, nextVertex, edge.getValue());\n if (newVertexAdded) {\n dfsCopy(srcDAG, nextVertex, destDAG);\n }\n }\n }", "private void setupDefaultHarbourMap() {\n defaultHarbourMap.put(getHashCodeofPair(-3,-11), HarbourKind.SPECIAL_BRICK);\n defaultHarbourMap.put(getHashCodeofPair(-2,-10), HarbourKind.SPECIAL_BRICK);\n defaultHarbourMap.put(getHashCodeofPair(0,-10), HarbourKind.GENERIC);\n defaultHarbourMap.put(getHashCodeofPair(1,-11), HarbourKind.GENERIC);\n defaultHarbourMap.put(getHashCodeofPair(2,-10), HarbourKind.SPECIAL_ORE);\n defaultHarbourMap.put(getHashCodeofPair(2,-8), HarbourKind.SPECIAL_ORE);\n defaultHarbourMap.put(getHashCodeofPair(-5,-7), HarbourKind.SPECIAL_WOOD);\n defaultHarbourMap.put(getHashCodeofPair(-4,-8), HarbourKind.SPECIAL_WOOD);\n defaultHarbourMap.put(getHashCodeofPair(-5,-5), HarbourKind.GENERIC);\n defaultHarbourMap.put(getHashCodeofPair(-4,-4), HarbourKind.GENERIC);\n defaultHarbourMap.put(getHashCodeofPair(3,-5), HarbourKind.SPECIAL_GRAIN);\n defaultHarbourMap.put(getHashCodeofPair(4,-4), HarbourKind.SPECIAL_GRAIN);\n defaultHarbourMap.put(getHashCodeofPair(-2,2), HarbourKind.SPECIAL_WOOL);\n defaultHarbourMap.put(getHashCodeofPair(-1,1), HarbourKind.SPECIAL_WOOL);\n defaultHarbourMap.put(getHashCodeofPair(1,1), HarbourKind.GENERIC);\n defaultHarbourMap.put(getHashCodeofPair(2,2), HarbourKind.GENERIC);\n }", "@Override\r\n\tpublic void addToMap(MapView arg0) {\n\t\tsuper.addToMap(arg0);\r\n\t}", "void addNeighbour(Territory neighbour) {\n\t\tneighbours.add(neighbour);\n\t}", "public void addPoints(String playerName, Integer pointsToAdd) {\r\n if (points.containsKey(playerName)) {\r\n points.put(playerName, points.get(playerName) + pointsToAdd);\r\n } else {\r\n points.put(playerName, pointsToAdd);\r\n }\r\n }", "public void add(DVDPackage dvd){\n\t\tqueue.addLast(dvd);\n\t}", "public void addEdge(int i, int j, double d) {\r\n\t\tWeightedNode first = nodeList.get(i-1);\r\n\t\tWeightedNode second = nodeList.get(j-1);\r\n\t\tfirst.neighbor.add(second);\r\n\t\tsecond.neighbor.add(first);\r\n\t\tfirst.weightMap.put(second,d);\r\n\t\tsecond.weightMap.put(first, d);\r\n\t}", "protected synchronized void addToPortMap(IOFSwitch sw, MacAddress mac, VlanVid vlan, OFPort portVal, IPv4Address ip) {\n\n\t\t//Tenant3 tenant = this.getTenantByMac(mac, vlan, this.environmentOfTenants.getIpFromMac(mac));\n\t\tTenant3 tenant = null;\n\t\ttry{\n\t\ttenant = this.getTenantByHostLocation(sw.getId(), portVal);\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\tVirtualNetwork virtualNetwork = this.getVirtualNetworkByHostLocation(sw.getId(), portVal);\n\t\tMap<Tenant3, Map<VirtualNetwork, Map<Host, OFPort>>> swMap = switchTenantVirtualNetworkMap.get(sw);\n\t\tMap<VirtualNetwork, Map<Host, OFPort>> tenantMap = null;\n\t\tMap<Host, OFPort> virtualNetworkMap = null;\n\n\t\tif (tenant != null && sw!= null && virtualNetwork != null && portVal != null){\n\t\t\tif (swMap == null) {\n\t\t\t\tswMap = Collections.synchronizedMap(new LRULinkedHashMap<Tenant3, Map<VirtualNetwork, Map<Host, OFPort>>>(MAX_MACS_PER_PHYSICAL_SWITCH));\n\t\t\t\tswitchTenantVirtualNetworkMap.put(sw, swMap);\n\t\t\t} \n\t\t\t\ttenantMap = switchTenantVirtualNetworkMap.get(sw).get(tenant);\n\t\t\t\tif(tenantMap == null){\n\t\t\t\t\ttenantMap = Collections.synchronizedMap(new LRULinkedHashMap<VirtualNetwork, Map<Host, OFPort>>(MAX_MACS_PER_PHYSICAL_SWITCH));\n\t\t\t\t\tswitchTenantVirtualNetworkMap.get(sw).put(tenant, tenantMap);\n\t\t\t\t} else{\n\t\t\t\t\tswitchTenantVirtualNetworkMap.get(sw).put(tenant,tenantMap);\n\t\t\t\t}\n\t\t\t\tvirtualNetworkMap = switchTenantVirtualNetworkMap.get(sw).get(tenant).get(virtualNetwork);\n\t\t\t\tif(virtualNetworkMap == null){\n\t\t\t\t\tvirtualNetworkMap = Collections.synchronizedMap(new LRULinkedHashMap<Host, OFPort>(MAX_MACS_PER_PHYSICAL_SWITCH));\n\t\t\t\t\tswitchTenantVirtualNetworkMap.get(sw).get(tenant).put(virtualNetwork, virtualNetworkMap);\n\t\t\t\t} else{\n\t\t\t\t\tswitchTenantVirtualNetworkMap.get(sw).get(tenant).put(virtualNetwork, virtualNetworkMap);\n\t\t\t\t}\n\t\t\t\tswitchTenantVirtualNetworkMap.get(sw).get(tenant).get(virtualNetwork).put(this.environmentOfServers.getHostLocationHostMap().get(new HostLocation(sw.getId(), portVal)), portVal);\n\t\t}\n\t}", "private void asignNeighbours(String split [], String planetName){\n\t\tdouble length = Double.parseDouble(split[1]);\n\t\tboolean danger = Boolean.parseBoolean(split[2]);\n\t\t\n\t\tif(factoryMap.containsKey(planetName)&&factoryMap.containsKey(split[0])){\n\t\t\tfactoryMap.get(planetName).addNeghbour(new Path(length, factoryMap.get(split[0]), danger));\t\n\t\t}\n\t\tif(factoryMap.containsKey(planetName) && galaxy.containsKey(split[0])){\n\t\t\tfactoryMap.get(planetName).addNeghbour(new Path(length, galaxy.get(split[0]), danger));\t\n\t\t}\n\t\tif(galaxy.containsKey(planetName) && factoryMap.containsKey(split[0])){\n\t\t\tgalaxy.get(planetName).addNeghbour(new Path(length, factoryMap.get(split[0]), danger));\t\n\t\t}\n\t\tif(galaxy.containsKey(planetName) && galaxy.containsKey(split[0])){\n\t\t\tgalaxy.get(planetName).addNeghbour(new Path(length, galaxy.get(split[0]), danger));\n\t\t}\n\t}", "public int addMap(NodePositionsSet otherMap, int otherID){\r\n\t\tif(otherMap.getMap() == null){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\tallMaps.put(otherID, otherMap);\r\n\t\tsynced = -1;\r\n\t\treturn 0;\r\n\t}", "@Override\n\tpublic void add(double dx, double dy) {\n\t\t\n\t}", "public void addReplacement(Replacement replacement) {\n replacements.add(replacement);\n sortedReplacements = null; // Invalidates cached sorted list\n }", "public void adopt(Dog d) {\r\n\t\tif (root != null) {\r\n\t\t\troot = root.adopt(d);\r\n\t\t\tsize--;\r\n\t\t}\r\n\t}", "private void setupDefaultDiceMap() {\n defaultDiceNumberMap.put(getHashCodeofPair(0,-2), 0);\n defaultDiceNumberMap.put(getHashCodeofPair(-7,1), 6);\n defaultDiceNumberMap.put(getHashCodeofPair(7,1), 8);\n defaultDiceNumberMap.put(getHashCodeofPair(-7,-1), 5);\n defaultDiceNumberMap.put(getHashCodeofPair(7,-1), 9);\n defaultDiceNumberMap.put(getHashCodeofPair(0,4), 4);\n defaultDiceNumberMap.put(getHashCodeofPair(2,4), 10);\n\n defaultDiceNumberMap.put(getHashCodeofPair(-3,-3), 6);\n defaultDiceNumberMap.put(getHashCodeofPair(-1,-3), 10);\n defaultDiceNumberMap.put(getHashCodeofPair(1,-3), 8);\n defaultDiceNumberMap.put(getHashCodeofPair(3,-3), 0);\n defaultDiceNumberMap.put(getHashCodeofPair(-4,-2), 5);\n defaultDiceNumberMap.put(getHashCodeofPair(-2,-2), 3);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(2,-2), 2);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(4,-2), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-5,-1), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-3,-1), 11);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-1,-1), 9);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(1,-1), 5);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(3,-1), 4);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(5,-1), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-6,0), 10);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-4,0), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-2,0), 8);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(0,0), 10);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(2,0), 6);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(4,0), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(6,0), 12);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-5,1), 8);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-3,1), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-1,1), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(1,1), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(3,1), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(5,1), 5);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-4,2), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-2,2), 4);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(0,2), 3);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(2,2), 4);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(4,2), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-3,3),0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(-1,3), 0);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(1,3), 9);\n\t\tdefaultDiceNumberMap.put(getHashCodeofPair(3,3), 0);\n\t}", "boolean addPortMapping(PortMappingInfo portMappingInfo) throws NotDiscoverUpnpGatewayException, UpnpException;", "void insertSelective(VRpDyLocationBh record);", "public void setDst(String endId) {\r\n\t\tdst = endId;\r\n\t}", "public void addDrink(Drink drink) {\n drinks.put(drink, false);\n }", "@Override\n public void add(Integer element) {\n if (this.contains(element) != -1) {\n return;\n }\n // when already in use\n int index = this.getIndex(element);\n if(this.data[index] != null && this.data[index] != this.thumbstone){\n int i = index + 1;\n boolean foundFreePlace = false;\n while(!foundFreePlace && i != index){\n if(this.data[i] == null && this.data[i] == this.thumbstone){\n foundFreePlace = true;\n }else{\n if(i == this.data.length - 1){\n // start at beginning.\n i = 0;\n }else{\n i++;\n }\n }\n }\n if(foundFreePlace){\n this.data[i] = element;\n }else{\n throw new IllegalStateException(\"Data Structre Full\");\n }\n }\n }", "private int updates(){\r\n\t\tint nbAdded = 0;\r\n\t\t\r\n\t\tElement myDrug;\r\n\t\t\r\n\t\t// get the list of element\r\n\t\tHashSet<String> drugList = this.getAllDrugs();\r\n\t\t\r\n\t\t// gets the elements already in the corresponding _ET and keeps only the difference\r\n\t\tHashSet<String> allElementsInET = resourceUpdateService.getAllLocalElementIDs();\r\n\t\tdrugList.removeAll(allElementsInET);\r\n\t\t\r\n\t\t// for each Drug element accessed by the tool\r\n\t\tfor (String localDrugID: drugList){\t\t\t\t\r\n\t\t\t\r\n\t\t\ttry{\r\n\t\t\t\t// populates OBR_PGDR_ET with each of these drugs\r\n\t\t\t\tmyDrug = this.getOneDrugData(localDrugID);\r\n\t\t\t\t//System.out.println(myDrug.getElementStructure().toString());\r\n\t\t\t\tif(!myDrug.getElementStructure().hasNullValues()){\r\n\t\t\t\t\tif(resourceUpdateService.addElement(myDrug)){\r\n\t\t\t\t\t\tnbAdded++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// System.out.println(myDrug.getDrugName()+\", \"+myDrug.getDrugAlternateNames()+\", \"+myDrug.getDrugRelatedPathways()+\", \"+myDrug.getDrugRelatedDrugs()+\", \"+myDrug.getDrugRelatedPhenotypeDatasets());\r\n\t\t\t\t\t/*if(toolPGDR_ET.addEntry(new DrugEntry(localDrugID, myDrug.getDrugName(), \r\n\t\t\t\t\t\t\tmyDrug.getDrugAlternateNames(), myDrug.getDrugRelatedGenes(), \r\n\t\t\t\t\t\t\tmyDrug.getDrugRelatedPathways(), myDrug.getDrugRelatedDiseases(), \r\n\t\t\t\t\t\t\tmyDrug.getDrugRelatedPhenotypeDatasets()))){\r\n\t\t\t\t\t\tnbAdded++;\r\n\t\t\t\t\t}*/\r\n\t\t\t\t}\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tlogger.error(\"** PROBLEM ** Problem with drug \"+ localDrugID +\" when populating the OBR_PGDR_ET table.\", e);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tlogger.info(nbAdded+\" drug added to the OBR_PGDR_ET table.\");\r\n\t\treturn nbAdded;\r\n\t}", "public void addPreferredDataSources(Collection<DataSource> sources) {\n if (containsDataSource(sources)) { // there are duplicates so trim the collection\n removeIdenticalDataSources(sources);\n } \n datasources.addAll(0,sources);\n }", "public static void registerDungeons()\r\n {\r\n if (!isLoaded || isLegacy)\r\n {\r\n return;// I supported this mod in older versions\r\n }\r\n\r\n try\r\n {\r\n Method addDungeonMob = Class.forName(\"com.evilnotch.dungeontweeks.main.world.worldgen.mobs.DungeonMobs\").getMethod(\"addDungeonMob\", ResourceLocation.class, ResourceLocation.class,\r\n int.class);\r\n for (AS_WorldGenTower.TowerTypes tower : AS_WorldGenTower.TowerTypes.values())\r\n {\r\n boolean nether = tower == TowerTypes.Netherrack;\r\n addDungeonMob.invoke(null, tower.getId(), new ResourceLocation(\"cave_spider\"), 100);\r\n addDungeonMob.invoke(null, tower.getId(), new ResourceLocation(\"spider\"), 90);\r\n addDungeonMob.invoke(null, tower.getId(), nether ? new ResourceLocation(\"wither_skeleton\") : new ResourceLocation(\"skeleton\"), 120);\r\n addDungeonMob.invoke(null, tower.getId(), new ResourceLocation(\"zombie\"), 120);\r\n\r\n if (nether)\r\n {\r\n addDungeonMob.invoke(null, tower.getId(), new ResourceLocation(\"blaze\"), 20);\r\n }\r\n }\r\n }\r\n catch (Exception e)\r\n {\r\n e.printStackTrace();\r\n }\r\n }", "public int addMap(GlobalMap otherMap){\r\n\t\tif(otherMap.getMap().size() < 3) return -1;\r\n\t\t/*map exists, but i need to re-mix it*/\r\n\t\tif(this.getCT() > (SimClock.getTime() - TIMEOUT)){\r\n\t\t\tthis.mapExists = false;\r\n\t\t}\r\n\t\tif(mapExists && synced == -1){\r\n\t\t\tlocalmix();\r\n\t\t}\t\r\n\t\t/*if i cant make a map yet, i use the one i got*/\r\n\t\telse if(!mapExists){\r\n\t\t\tint c = makeGlobal();\r\n\t\t\tif(c < 0){\r\n\t\t\t\tif(otherMap.getCT() > (SimClock.getTime() - TIMEOUT)){\r\n\t\t\t\t\tthis.globalMap = otherMap.globalMap;\r\n\t\t\t\t\tthis.myMapNodes = otherMap.myMapNodes;\r\n\t\t\t\t\tthis.synced = 1;\r\n\t\t\t\t\tthis.mapExists = true;\r\n\t\t\t\t\tthis.ref_id = otherMap.ref_id;\r\n\t\t\t\t\tthis.ref_c = otherMap.ref_c;\r\n\t\t\t\t\t//core.Debug.p(\"a\");\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tthis.synced = 0;\r\n\t\t\t\tthis.mapExists = true;\r\n\t\t\t\t//core.Debug.p(\"b\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t/*if i have an updated map, just join them preferring the one that used newer data*/\r\n\t\tif(mapExists && (synced == 0 || synced == 1)){\r\n\t\t\t//core.Debug.p(\"nene\");\r\n\t\t\tboolean newer = this.updateTime < otherMap.updateTime ? true : false;\r\n\t\t\t//have to be careful with shifted values!\r\n\t\t\tCoord c = new Coord(this.ref_c.getX() - otherMap.ref_c.getX(), this.ref_c.getY() - otherMap.ref_c.getY());\r\n\t\t\tMap<Integer, Coord> othershifted = shiftMap(otherMap.getMap(), c);\r\n\t\t\t\r\n\t\t\tfor(Map.Entry<Integer, Coord> node : othershifted.entrySet()){\r\n\t\t\t\tif(globalMap.containsKey(node.getKey())){\r\n\t\t\t\t\tif(newer) globalMap.replace(node.getKey(), node.getValue());\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tglobalMap.put(node.getKey(), node.getValue());\r\n\t\t\t\t\tmyMapNodes.add(node.getKey());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn myMapNodes.size();\r\n\t\t}\r\n\t\telse return -1;\r\n\t}", "@Override\n\tpublic int insertBoard(Map<String, Object> map) {\n\t\treturn 0;\n\t}", "private static RdvAdvertisement createRdvAdvertisement(PeerID pid, PeerGroupID gid, String addr) {\r\n\r\n try {\r\n // FIX ME: 10/19/2002 [email protected]. We need to properly set up the service ID. Unfortunately\r\n // this current implementation of the PeerView takes a String as a service name and not its ID.\r\n // Since currently, there is only PeerView per group (all peerviews share the same \"service\", this\r\n // is not a problem, but that will have to be fixed eventually.\r\n\r\n // create a new RdvAdvertisement\r\n RdvAdvertisement rdv = (RdvAdvertisement) AdvertisementFactory.newAdvertisement(RdvAdvertisement.getAdvertisementType());\r\n\r\n rdv.setPeerID(pid);\r\n rdv.setGroupID(gid); \r\n rdv.setName(\"RDV seed\");\r\n\r\n RouteAdvertisement ra = (RouteAdvertisement) \r\n AdvertisementFactory.newAdvertisement(RouteAdvertisement.getAdvertisementType());\r\n ra.setDestPeerID(pid);\r\n AccessPointAdvertisement ap = (AccessPointAdvertisement) \r\n AdvertisementFactory.newAdvertisement(AccessPointAdvertisement.getAdvertisementType());\r\n ap.addEndpointAddress(addr);\r\n ra.setDest(ap);\r\n // Insert it into the RdvAdvertisement.\r\n rdv.setRouteAdv(ra);\r\n\r\n return rdv;\r\n } catch (Exception ez) {\r\n if (LOG.isEnabledFor(Priority.WARN)) {\r\n LOG.warn(\"Cannot create Local RdvAdvertisement: \", ez);\r\n }\r\n return null;\r\n }\r\n }", "public void updatetosendmap_addnode(String id, HashMap<String, Object> att) {\n\t\t\tfor(String dest : this.toSendMap.keySet()) {\n\t\t\t\tGraph destmap = this.toSendMap.get(dest);\n\t\t\t\tNode newNode = destmap.getNode(id);\n\t\t\t\tif(newNode == null)\n\t\t\t\t\tnewNode = destmap.addNode(id);\n\t\t\t\tnewNode.addAttributes(att);\n\t\t\t}\n\t\t}", "public void createDebugMap(ArrayList<Station> stations) {\r\n\t\tStation stationValby = new Station(\"Valby\", 1);\r\n\t\tstations.add(stationValby);\r\n\r\n\t\tStation stationFrederiksund = new Station(\"Frederiksund\", 2);\r\n\t\tstations.add(stationFrederiksund);\r\n\r\n\t\tStation stationHerlev = new Station(\"Herlev\", 3);\r\n\t\tstations.add(stationHerlev);\r\n\r\n\t\tStation stationHvidovre = new Station(\"Hvidovre\", 4);\r\n\t\tstations.add(stationHvidovre);\r\n\r\n\t\tStation stationHumsum = new Station(\"Husum\", 5);\r\n\t\tstations.add(stationHumsum);\r\n\r\n\t\tStation stationIslev = new Station(\"Islev\", 6);\r\n\t\tstations.add(stationIslev);\r\n\r\n\t\tStation stationDanshoj = new Station(\"Danshoj\", 7);\r\n\t\tstations.add(stationDanshoj);\r\n\r\n\t\tStation stationSkovlunde = new Station(\"Skovlunde\", 8);\r\n\t\tstations.add(stationSkovlunde);\r\n\r\n\t\t// add neighbor connections\r\n\t\tstationValby.neighbors.add(new Neighbor(stationIslev, 4, 4));\r\n\r\n\t\tstationIslev.neighbors.add(new Neighbor(stationValby, 4, 4));\r\n\t\tstationIslev.neighbors.add(new Neighbor(stationHumsum, 8, 8));\r\n\t\tstationIslev.neighbors.add(new Neighbor(stationSkovlunde, 3, 3));\r\n\r\n\t\tstationHumsum.neighbors.add(new Neighbor(stationHerlev, 3, 3));\r\n\t\tstationHumsum.neighbors.add(new Neighbor(stationFrederiksund, 4, 4));\r\n\t\tstationHumsum.neighbors.add(new Neighbor(stationHvidovre, 2, 2));\r\n\t\tstationHumsum.neighbors.add(new Neighbor(stationDanshoj, 3, 3));\r\n\t\tstationHumsum.neighbors.add(new Neighbor(stationIslev, 8, 8));\r\n\r\n\t\tstationHerlev.neighbors.add(new Neighbor(stationHumsum, 3, 3));\r\n\t\tstationHerlev.neighbors.add(new Neighbor(stationFrederiksund, 2, 2));\r\n\r\n\t\tstationFrederiksund.neighbors.add(new Neighbor(stationHumsum, 4, 4));\r\n\t\tstationFrederiksund.neighbors.add(new Neighbor(stationHerlev, 2, 2));\r\n\t\tstationFrederiksund.neighbors.add(new Neighbor(stationHvidovre, 5, 5));\r\n\r\n\t\tstationHvidovre.neighbors.add(new Neighbor(stationHumsum, 2, 2));\r\n\t\tstationHvidovre.neighbors.add(new Neighbor(stationFrederiksund, 5, 5));\r\n\t\tstationHvidovre.neighbors.add(new Neighbor(stationDanshoj, 4, 4));\r\n\r\n\t\tstationDanshoj.neighbors.add(new Neighbor(stationHumsum, 3, 3));\r\n\t\tstationDanshoj.neighbors.add(new Neighbor(stationHvidovre, 5, 5));\r\n\t\tstationDanshoj.neighbors.add(new Neighbor(stationSkovlunde, 10, 10));\r\n\r\n\t\tstationSkovlunde.neighbors.add(new Neighbor(stationHumsum, 3, 3));\r\n\t\tstationSkovlunde.neighbors.add(new Neighbor(stationDanshoj, 10, 10));\r\n\t}", "public void addDrbdVolume(final DrbdVolumeInfo drbdVolume) {\n drbdVolumes.add(drbdVolume);\n }", "public void add(KnowledgeDTO dto) {\n //for this solution, we choose for each person in result only shortest path\n if (this.knowledgeDTOs.contains(dto)) {\n //Shorter path\n if (this.knowledgeDTOs.get(this.knowledgeDTOs.indexOf(dto)).getTransitiveConceptsURLs().size() > dto.getTransitiveConceptsURLs().size()) {\n //we want to add\n this.knowledgeDTOs.remove(dto);\n this.knowledgeDTOs.add(dto);\n }\n //Same path and lower weight\n if (this.knowledgeDTOs.get(this.knowledgeDTOs.indexOf(dto)).getTransitiveConceptsURLs().size() == dto.getTransitiveConceptsURLs().size()\n && this.knowledgeDTOs.get(this.knowledgeDTOs.indexOf(dto)).getWeightOfKnowledge() < dto.getWeightOfKnowledge()) {\n //we want to replace\n this.knowledgeDTOs.remove(dto);\n this.knowledgeDTOs.add(dto);\n }\n } else {\n this.knowledgeDTOs.add(dto);\n }\n }", "default <S, D> D copy(S src, D dist) {\n BeanUtils.copyProperties(src, dist);\n return dist;\n }", "public void addPixel(Pixel pix) throws DuplicatedKeyException {\n\t\t// Try to add the pixel\n\t\ttry {\n\t\t\tbst.put(bst.getRoot(), pix);\n\t\t} catch (Exception e) {\n\t\t\t// Throw an exception\n\t\t\tthrow new DuplicatedKeyException();\n\t\t}\n\t}", "public void addLocX (int adder)\n {\n locX += adder;\n }", "@Override\r\n\tpublic void assignSlots(Topologies topologies,\r\n\t\t\tMap<String, Collection<WorkerSlot>> newSlotsByTopologyId) {\n\r\n\t}", "private void addWater() {\n for (int i = 0; i < MAP_LENGTH; i++) {\n for (int j = 0; j < MAP_LENGTH; j++) {\n if (tileMap[i][j] == null) {\n tileMap[i][j] = new Space(new Water(i, j));\n }\n }\n }\n }", "public void addDest( int newDest ) {\n\t\t\n\t\tif (state == TODEFAULT)\n\t\t\tdestList.clear();\n\t\t\n\t\t\tif(newDest > maxFloors || newDest < 0) throw new IllegalArgumentException(\"newDest requires a value greater than 0 and less than \" + maxFloors+ \": \" + newDest);\n\t\t\n\t\tsynchronized (this) {\n\t\t\tif (newDest != currFloor && newDest > 0 && newDest <= maxFloors) {\n\t\t\t\tif (destList.isEmpty() && currFloor < newDest) {\n\t\t\t\t\tdestList = new PriorityQueue<Integer>();\n\t\t\t\t\ttravelDir = \"Up\";\n\t\t\t\t\tdestList.add(newDest);\n\t\t\t\t} else if (destList.isEmpty() && currFloor > newDest) {\n\t\t\t\t\tdestList = new PriorityQueue<Integer>(1, Collections.reverseOrder());\n\t\t\t\t\ttravelDir = \"Down\";\n\t\t\t\t\tdestList.add(newDest);\n\t\t\t\t} else if ( ((travelDir.equals(\"Up\") && newDest > currFloor) || (travelDir.equals(\"Down\") && newDest < currFloor)) && !destList.contains(newDest))\n\t\t\t\t\tdestList.add(newDest);\n\t\t\t\t\n\t\t\t\tSystem.out.println(dateFormat.format(new Date()) + \"\\tElevator \" + elevatorNum + \" added floor \" + newDest + \" to destination list\");\n\t\t\t} else if (newDest == currFloor && destList.isEmpty())\n\t\t\t\tdestList.add(newDest);\n\t\t}\n\t\t\n\t\tsynchronized (this) {\n\t\t\tthis.setState(TRAVELING);\n\t\t\tthis.notifyAll();\n\t\t}\n\t}", "public void add(Demographics d) {\n for(DemographicType demoType : DemographicType.values()) {\n //handle demographic population\n demographicPopulation.put(demoType, demographicPopulation.get(demoType) + d.getDemographicPopulation().get(demoType));\n }\n demVotes += d.demVotes;\n repVotes += d.repVotes;\n// System.out.println(\"\\t\\t\" + this);\n }", "void addEdge(String origin, String destination, double weight){\n\t\tadjlist.get(origin).addEdge(adjlist.get(destination), weight);\n\t\tedges++;\n\t}", "void addEdge(int source, int destination, int weight);", "void setDestBitDepth(Integer myDestBitDepth);", "@JsonProperty(PROP_DST_IPS)\n public IpSpace getDstIps() {\n return _dstIps;\n }", "public Edge dfsUtil(String unit) {\n\t\tif(visited.contains(unit))\n\t\t\treturn map.get(unit);\n\t\tvisited.add(unit);\n\t\tEdge trvEdge = dfsUtil(map.get(unit).node);\n\t\tif(trvEdge==null)\n\t\t\treturn null;\n\t\tmap.put(unit, new Edge(trvEdge.val*map.get(unit).val,trvEdge.node));\n\t\treturn map.get(unit);\n\t}", "public static void DWD(Demanda dR, GrafoMatriz G, ArrayList<ListaEnlazadaAsignadas> lea, int capacidad){\n \n int indexDem= Utilitarios.buscarDemandaLifetime(lea,dR, G);\n if (indexDem != -1){\n Demanda d = lea.get(indexDem).getDemanda();\n ListaEnlazada[] ksp=Utilitarios.KSP(G, d.getOrigen(), d.getDestino(), 5); \n Resultado rNueva = Utilitarios.buscarEspacio(ksp,d, G, capacidad);\n if (rNueva!=null){\n Utilitarios.asignarFS_saveRoute(ksp,rNueva,G,d,lea,-1);\n Utilitarios.limpiarCaminoAnterior(lea.get(indexDem),G,indexDem,capacidad, lea);\n \n }\n \n }\n \n }", "public void addEntry(String destinationString, String nextHopString) {\n IPv4Address destination = new IPv4Address(destinationString);\n IPv4Address nextHop = new IPv4Address(nextHopString);\n\n routingTable[destination.subnetMask - 1].put(destination, nextHop);\n bloomFilters[destination.subnetMask - 1].add(destination);\n }", "private void addToMaps(String name, UUID uuid) {\n\n Calendar calendar = Calendar.getInstance();\n calendar.add(Calendar.DAY_OF_MONTH, 3);\n\n // Create the entry and populate the local maps\n CachedUUIDEntry entry = new CachedUUIDEntry(name, uuid, calendar);\n nameToUuidMap.put(name.toLowerCase(), entry);\n uuidToNameMap.put(uuid, entry);\n }", "public void addPreferredDataSource(DataSource source) { \n if (!containsDataSource(source)) datasources.add(0,source);\n }", "private void addDefaultPerson() {\n personNames.add(\"you\");\n personIds.add(STConstants.PERSON_NULL_ID);\n personPhotos.add(null);\n personSelections.add(new HashSet<Integer>()); \n }", "private void addFragmentToListMapReplace(IAtomContainer frag, String currentSumFormula)\n {\n \t//add sum formula molecule comb. to map\n if(sumformulaToFragMap.containsKey(currentSumFormula))\n {\n \tList<IAtomContainer> tempList = sumformulaToFragMap.get(currentSumFormula);\n \ttempList.clear();\n \ttempList.add(frag);\n \tsumformulaToFragMap.put(currentSumFormula, tempList);\n }\n else\n {\n \tList<IAtomContainer> temp = new ArrayList<IAtomContainer>();\n \ttemp.add(frag);\n \tsumformulaToFragMap.put(currentSumFormula, temp);\n }\n }", "@Override\r\n\tpublic boolean add(GIS_layer e) {\n\r\n\t\treturn set.add(e);\r\n\t}", "public BackendAddress add(int serverId, String ip, int port) {\n \tif (configMap.containsKey(serverId)) {\n\t\t\treturn null;\n\t\t}\n return configMap.put(serverId, new BackendAddress(serverId, ip, port));\n }", "public void withdrawPath(AS peer, int dest) {\n this.incUpdateQueue.add(new BGPUpdate(dest, peer));\n }", "public void addLocY (int adder)\n {\n locY += adder;\n }", "@Override\n\t\t\tpublic boolean addDept(Dept dept) {\n\t\t\t\treturn false;\n\t\t\t}", "public void addOrUpdate(int source, NetworkDistancePair netDist, int nextHop)\n\t{\n\t\tRouteTableEntry RTE = new RouteTableEntry(source, netDist, nextHop);\n\t\taddEntry(RTE); // add if it does not exist\n\t\t\n\t\tfor (RouteTableEntry entry : table)\n\t\t{\n\t\t\tif (entry.equals(RTE))\n\t\t\t{\n\t\t\t\tentry.updateTime(); // update the time for the entry\n\t\t\t\tbreak; // exit the for each loop because we have done what we came to do\n\t\t\t} // end if\n\t\t} // end for each loop\n\t}", "@Override\r\n\tpublic double[] addAlpha(double[][] path, double[] drifts) {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic void addPiece(Piece piece){\n\t\tif(_endMap.containsKey(piece.getPlayer())){\n\t\t\tInteger value = _endMap.get(piece.getPlayer());\n\t\t\t_endMap.put(piece.getPlayer(), ++value);\t\t\t\n\t\t}\n\t\telse{\n\t\t\t_endMap.put(piece.getPlayer(), 1);\n\t\t}\n\t}" ]
[ "0.57005715", "0.52200043", "0.506573", "0.50398415", "0.4790402", "0.4752547", "0.4700067", "0.46857578", "0.4683986", "0.46728227", "0.46164107", "0.46111813", "0.45968208", "0.4581031", "0.45654708", "0.45609224", "0.4554941", "0.45516947", "0.45425946", "0.44994736", "0.44844076", "0.44789752", "0.44745716", "0.44643536", "0.44563714", "0.44555414", "0.44524398", "0.4446468", "0.44455945", "0.4430433", "0.44270173", "0.44102135", "0.44060504", "0.4405167", "0.437366", "0.43724194", "0.4365689", "0.4353468", "0.43418193", "0.43354276", "0.43345204", "0.43299663", "0.4312234", "0.43053094", "0.43027198", "0.42942435", "0.429043", "0.42843238", "0.42811492", "0.4280563", "0.4272242", "0.42718786", "0.42687613", "0.42642182", "0.42632246", "0.4262705", "0.4260997", "0.42609003", "0.4259735", "0.42595708", "0.42560408", "0.425536", "0.4253208", "0.42516556", "0.4246686", "0.42464936", "0.42445758", "0.4241", "0.42399818", "0.42390233", "0.4238843", "0.42340255", "0.42322472", "0.42312315", "0.422808", "0.4227301", "0.42266345", "0.42247027", "0.42170447", "0.42156443", "0.42098", "0.42078495", "0.42071843", "0.42053068", "0.42013058", "0.42004952", "0.41983086", "0.41960177", "0.41936705", "0.4190972", "0.41907635", "0.41906488", "0.419017", "0.4188999", "0.4187845", "0.4182938", "0.41822478", "0.41807115", "0.41793698", "0.41771626" ]
0.6447507
0
Given a list of concepts, sorts them in the same order as the list of MDRTB drugs (All nonMDRTB drugs are ignored) returns by getMdrtbDrugs(); all nonMDRTB drug are ignored
public static List<Concept> sortMdrtbDrugs(List<Concept> drugs) { return MdrtbUtil.sortDrugs(drugs, Context.getService(MdrtbService.class).getMdrtbDrugs()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static List<Concept> sortAntiretrovirals(List<Concept> drugs) {\r\n \treturn MdrtbUtil.sortDrugs(drugs, Context.getService(MdrtbService.class).getAntiretrovirals());\r\n }", "public static List<Concept> sortDrugs(List<Concept> drugsToSort, List<Concept> drugList) {\r\n \tList<Concept> sortedDrugs = new LinkedList<Concept>();\r\n \t\r\n \tfor (Concept drug : drugList) {\r\n \t\tif (drugsToSort.contains(drug)) {\r\n \t\t\tsortedDrugs.add(drug);\r\n \t\t}\r\n \t}\r\n \t\r\n \treturn sortedDrugs;\r\n }", "public static List<List<Object>> getDefaultDstDrugs() {\r\n \tList<List<Object>> drugs = new LinkedList<List<Object>>();\r\n \t\r\n \tString defaultDstDrugs = Context.getAdministrationService().getGlobalProperty(\"mdrtb.defaultDstDrugs\");\r\n \t\r\n \tif(StringUtils.isNotBlank(defaultDstDrugs)) {\r\n \t\t// split on the pipe\r\n \t\tfor (String drugString : defaultDstDrugs.split(\"\\\\|\")) {\r\n \t\t\t\r\n \t\t\t// now split into a name and concentration \r\n \t\t\tString drug = drugString.split(\":\")[0];\r\n \t\t\tString concentration = null;\r\n \t\t\tif (drugString.split(\":\").length > 1) {\r\n \t\t\t\tconcentration = drugString.split(\":\")[1];\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\ttry {\r\n \t\t\t\t// see if this is a concept id\r\n \t\t\t\tInteger conceptId = Integer.valueOf(drug);\r\n \t\t\t\tConcept concept = Context.getConceptService().getConcept(conceptId);\r\n \t\t\t\t\r\n \t\t\t\tif (concept == null) {\r\n \t\t\t\t\tlog.error(\"Unable to find concept referenced by id \" + conceptId);\r\n \t\t\t\t}\r\n \t\t\t\t// add the concept/concentration pair to the list\r\n \t\t\t\telse {\r\n \t\t\t\t\taddDefaultDstDrugToMap(drugs, concept, concentration);\r\n \t\t\t\t}\r\n \t\t\t} \t\r\n \t\t\tcatch (NumberFormatException e) {\r\n \t\t\t\t// if not a concept id, must be a concept map\r\n \t\t\t\tConcept concept = Context.getService(MdrtbService.class).getConcept(drug);\r\n \t\t\t\t\r\n \t\t\t\tif (concept == null) {\r\n \t\t\t\t\tlog.error(\"Unable to find concept referenced by \" + drug);\r\n \t\t\t\t}\r\n \t\t\t\t// add the concept to the list\r\n \t\t\t\telse {\r\n \t\t\t\t\taddDefaultDstDrugToMap(drugs, concept, concentration);\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n \t\r\n \treturn drugs;\r\n }", "private void sort(Metric metr, DoubleData dObj, DoubleData[] dObjects, int left, int right)\n {\n int p = left + RANDOM_GENERATOR.nextInt(right-left+1);\n DoubleData tmpObj = dObjects[right];\n dObjects[right] = dObjects[p];\n dObjects[p] = tmpObj;\n int l = left, r = right - 1;\n double dist = metr.dist(dObjects[right], dObj);\n while (l < r)\n if (dist >= metr.dist(dObjects[l], dObj)) l++;\n else if (dist < metr.dist(dObjects[r], dObj)) r--;\n else\n {\n tmpObj = dObjects[l];\n dObjects[l] = dObjects[r];\n dObjects[r] = tmpObj;\n l++;\n if (l < r) r--;\n }\n if (dist < metr.dist(dObjects[l], dObj))\n {\n tmpObj = dObjects[l];\n dObjects[l] = dObjects[right];\n dObjects[right] = tmpObj;\n }\n if (left < l) sort(metr, dObj, dObjects, left, l);\n if (l + 1 < right) sort(metr, dObj, dObjects, l + 1, right);\n }", "private void processConcepts(Collection<ReportConcept> concepts) {\n\t\t// compact concept list until it stops changing size\n\t\tint previousSize = 0;\n\t\twhile (concepts.size() != previousSize) {\n\t\t\tpreviousSize = concepts.size();\n\t\t\tList<ReportConcept> list = new ArrayList<ReportConcept>(concepts);\n\t\t\tReportConcept previous = list.get(0);\n\t\t\tfor(int i=1;i<list.size();i++){\n\t\t\t\tReportConcept entry = list.get(i);\n\t\t\t\tReportConcept next = ((i+1)<list.size())?list.get(i+1):null;\n\t\t\t\t\n\t\t\t\t// see if we can find a common concept for three entries\n\t\t\t\tReportConcept common = null;\n\t\t\t\tif(next != null)\n\t\t\t\t\tcommon = mergeConcepts(previous, entry, next,concepts);\n\t\t\t\t// if no luck try merge 2 \n\t\t\t\tif(common == null)\n\t\t\t\t\tcommon = mergeConcepts(previous, entry,concepts);\n\t\t\t\t\n\t\t\t\t// if common concept found, then make it a previous concept\n\t\t\t\tif (common != null) \n\t\t\t\t\tentry = common;\n\t\t\t\tprevious = entry;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "private void sortDialects()\n\t{\n\t\tif (dialects.size() > 1)\n\t\t{\n\t\t\tCollections.sort(dialects, new Comparator<RestDynamicSemanticVersion>()\n\t\t\t{\n\t\t\t\t@Override\n\t\t\t\tpublic int compare(RestDynamicSemanticVersion o1, RestDynamicSemanticVersion o2)\n\t\t\t\t{\n\t\t\t\t\t//This is a semantic with a single nid column, which represents preferred or acceptable. \n\t\t\t\t\t//The assemblage concept will be something like \"US English Dialect\"\n\t\t\t\t\t\n\t\t\t\t\t//If preferred / acceptable is the same, sort on the dialects...\n\t\t\t\t\tif (((RestDynamicSemanticNid)o1.dataColumns.get(0)).getNid() == ((RestDynamicSemanticNid)o2.dataColumns.get(0)).getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (o1.semanticChronology != null) //If one chronology is here, they both should be here\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (o1.semanticChronology.assemblage.nid.intValue() == MetaData.US_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o2.semanticChronology.assemblage.nid.intValue() == MetaData.US_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o1.semanticChronology.assemblage.nid.intValue() == MetaData.GB_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o2.semanticChronology.assemblage.nid.intValue() == MetaData.GB_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn 1;\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//Some other dialect... just sort on the dialect text\n\t\t\t\t\t\t\t\treturn AlphanumComparator.compare(Util.readBestDescription(o1.semanticChronology.assemblage.nid),\n\t\t\t\t\t\t\t\t\t\tUtil.readBestDescription(o2.semanticChronology.assemblage.nid), true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//If chronology isn't populated, I can't sort here\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (((RestDynamicSemanticNid)o1.dataColumns.get(0)).getNid() == MetaData.PREFERRED____SOLOR.getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t}\n\t\t\t\t\telse if (((RestDynamicSemanticNid)o2.dataColumns.get(0)).getNid() == MetaData.PREFERRED____SOLOR.getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//should be impossible - not the same, and neither is preferred - must be invalid data.\n\t\t\t\t\t\tLogManager.getLogger().warn(\"Unexpected sort case\");\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "public void sortCompetitors(){\n\t\t}", "private void sortMedApts(List<MedicationAppointment> medApts2) {\n \t}", "public void sortByBreed() {\n\t\tAnimalCompare animalCompare = new AnimalCompare();\n\t\tCollections.sort(animals, animalCompare);\n\t}", "private static void addDefaultDstDrugToMap(List<List<Object>> drugs, Concept concept, String concentration) {\r\n \tList<Object> data = new LinkedList<Object>();\r\n \tdata.add(concept);\r\n \tdata.add(concentration);\r\n \tdrugs.add(data);\r\n }", "private void sortEntities(){\n for (int i = 1; i < sorted.size; i++) {\n for(int j = i ; j > 0 ; j--){\n \tEntity e1 = sorted.get(j);\n \tEntity e2 = sorted.get(j-1);\n if(getRL(e1) < getRL(e2)){\n sorted.set(j, e2);\n sorted.set(j-1, e1);\n }\n }\n }\n }", "public void sortKnowledgeBase()\n {\n int i;\n Random random;\n String aPredicate;\n StringTokenizer tokenizer;\n //------------\n random = new Random();\n i = 0;\n while (i < knowledgeBase.size())\n {\n aPredicate = knowledgeBase.get(i).commitments.get(0).predicate;\n tokenizer = new StringTokenizer(aPredicate,\"(), \");\n if(tokenizer.nextToken().equals(\"secuencia\"))\n knowledgeBase.get(i).priority = random.nextInt(100);\n //end if\n else\n knowledgeBase.get(i).priority = random.nextInt(10000);\n //end else\n i = i + 1;\n }//end while\n Collections.sort(knowledgeBase);\n }", "public void sortManlist(){\r\n\t\tCollections.sort(Manlist, new MySort());\r\n\t}", "public void sort(Metric metr, DoubleData dObj, DoubleData[] dObjects)\n {\n sort(metr, dObj, dObjects, 0, dObjects.length-1);\n }", "public void sortDNAs() {\n DNAs = TLArrayList.sort(DNAs);\n }", "private void sync() {\n\t\t// stop sync time\n \t\tsyncTimer.stop();\n\n\t\t// long time = System.currentTimeMillis();\n\n\t\t// copy concept list\n\t\tList<ReportConcept> allConcepts = new ArrayList<ReportConcept>();\n\t\tsynchronized (concepts) {\n\t\t\tallConcepts.addAll(concepts);\n\t\t}\n\n\t\t// do sync\n\t\tsynchronized (removedConcepts) {\n\t\t\t// lets see if we can removed concepts\n\t\t\t// and refines\n\t\t\tfor (ReportConcept c : removedConcepts) {\n\t\t\t\tConceptEntry e = c.getConceptEntry();\n\t\t\t\t// if concept is not in interface, add it\n\t\t\t\tif (reportInterface.getConceptEntry(e) != null) {\n\t\t\t\t\t// see if removed concept was replace w/ new more\n\t\t\t\t\t// general/specific concept\n\t\t\t\t\t// if not, it is a simple remove, else it is a refine\n\t\t\t\t\tReportConcept n = getRelatedConcept(c);\n\t\t\t\t\tif (n == null) {\n\t\t\t\t\t\treportInterface.removeConceptEntry(e);\n\t\t\t\t\t} else \tif(n.isAttribute()){\n\t\t\t\t\t\t// if related concept is a left over attribute, then remove it\n\t\t\t\t\t\tconcepts.remove(n);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// when refining, we want to retain feature information\n\t\t\t\t\t\tn.getConceptEntry().setFeature(e.getFeature());\n\n\t\t\t\t\t\t// now do a refine\n\t\t\t\t\t\treportInterface.refineConceptEntry(e, n.getConceptEntry());\n\t\t\t\t\t\tallConcepts.remove(n);\n\t\t\t\t\t\trepaintConcept(n);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// clear removed concepts\n\t\t\tremovedConcepts.clear();\n\t\t}\n\n\t\t// lets see if we can add concepts\n\t\tfor (ReportConcept c : allConcepts) {\n\t\t\tConceptEntry e = c.getConceptEntry();\n\n\t\t\t// if concept is not in interface, add it\n\t\t\tConceptEntry o = reportInterface.getConceptEntry(e);\n\t\t\tif (o == null) {\n\t\t\t\t// add concept if not some stray attribute by itself\n\t\t\t\tif(!e.isAttribute())\n\t\t\t\t\treportInterface.addConceptEntry(e);\n\t\t\t} else {\n\t\t\t\tReportConcept or = ReportConcept.getReportConcept(o, reportInterface);\n\t\t\t\t// now lets check if negation status changed\n\t\t\t\tif ((c.isNegated() != or.isNegated())) {\n\t\t\t\t\t// if new concept is absent, add negation\n\t\t\t\t\tif (c.isNegated()) {\n\t\t\t\t\t\treportInterface.addConceptEntry(c.getNegation().getConceptEntry());\n\t\t\t\t\t\t// otherwise remove negation\n\t\t\t\t\t} else if (or.isNegated()) {\n\t\t\t\t\t\treportInterface.removeConceptEntry(or.getNegation().getConceptEntry());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// such concept does exist in\n\t\t\t\te.copyConceptStatus(o);\n\t\t\t}\n\t\t\trepaintConcept(c);\n\t\t}\n\n\t\treportInterface.debug(\"--\\nparsed concepts in document:\\t\" + concepts);\n\t\treportInterface.debug();\n\t\t// System.out.println(\"sync time \"+(System.currentTimeMillis()-time));\n\t}", "public List<Doctor> compareSpeciality (List<Doctor> dl, Doctor d)\n\t{\n\t\tList<Doctor> sp=new ArrayList<Doctor>();\n\t\tfor(Doctor ld: dl)\n\t\t{\n\t\t\tif(ld.getSpeciality().equals(d.getSpeciality()))\n\t\t\t\tsp.add(ld);\n\t\t\t\n\t\t}\n\t\treturn sp;\n\t}", "public void sortByFuelConsumption(){\n for (int d = carPark.getCars().size() / 2; d >= 1; d /= 2)\n for (int i = d; i < carPark.getCars().size(); i++)\n for (int j = i; j >= d && carPark.getCars().get(j-d).getFuelConsumption() > carPark.getCars().get(j).getFuelConsumption(); j -= d) {\n Car temp = carPark.getCars().get(j);\n carPark.getCars().remove(j);\n carPark.getCars().add(j - 1, temp);\n }\n }", "private ReportConcept mergeConcepts(ReportConcept previous, ReportConcept entry, ReportConcept next, Collection<ReportConcept> concepts){\n\t\tIClass pc = previous.getConceptClass();\n\t\tIClass ec = entry.getConceptClass();\n\t\tIClass nc = next.getConceptClass();\n\t\tIClass common = getDirectCommonChild(pc,ec,nc);\n\t\t\n\t\t// make sure that common ground is valid\n\t\tif(common != null){\n\t\t\t// we can't have two attributes s.a. 3 mm inferring a finding\n\t\t\tif(isFeature(common) && !isFeature(pc) && !isFeature(ec) && !isFeature(nc))\n\t\t\t\tcommon = null;\n\t\t\t\n\t\t\t// if previous concept is in fact more specific then current concept\n\t\t\tif(pc.hasSuperClass(ec)){\n\t\t\t\tif(isSubset(previous.getLabels(),entry.getLabels())){\n\t\t\t\t\tcommon = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t// common ground was found\n\t\tif(common != null){\n\t\t\tReportConcept ne = createReportConcept(common);\n\t\t\tne.addLabels(previous.getLabels());\n\t\t\tne.addLabels(entry.getLabels());\n\t\t\tne.addLabels(next.getLabels());\n\t\t\t\t\n\t\t\t// if new concept is just an old concept\n\t\t\t// then retain the old concept\n\t\t\tif(entry.equals(ne))\n\t\t\t\tne.setConceptEntry(entry.getConceptEntry());\n\t\t\tif(previous.equals(ne))\n\t\t\t\tne.setConceptEntry(previous.getConceptEntry());\n\t\t\tif(next.equals(ne))\n\t\t\t\tne.setConceptEntry(next.getConceptEntry());\n\t\t\t\n\t\t\t\n\t\t\t//CORRECTION: previous should take precedence, MAX was arbitrary\n\t\t\tif(previous.getConceptEntry().hasNumericValue())\n\t\t\t\tne.setNumericValue(previous.getNumericValue());\n\t\t\telse if(entry.getConceptEntry().hasNumericValue())\n\t\t\t\tne.setNumericValue(entry.getNumericValue());\n\t\t\telse if(next.getConceptEntry().hasNumericValue())\n\t\t\t\tne.setNumericValue(next.getNumericValue());\n\t\t\t\n\t\t\t// copy resource link\n\t\t\tif(previous.hasResourceLink())\n\t\t\t\tne.setResourceLink(previous.getResourceLink());\n\t\t\telse if(entry.hasResourceLink())\n\t\t\t\tne.setResourceLink(entry.getResourceLink());\n\t\t\telse if(next.hasResourceLink())\n\t\t\t\tne.setResourceLink(next.getResourceLink());\n\t\t\t\n\t\t\t// copy negation\n\t\t\tif(previous.isNegated())\n\t\t\t\tne.setNegation(previous.getNegation());\n\t\t\telse if(entry.isNegated())\n\t\t\t\tne.setNegation(entry.getNegation());\n\t\t\telse if(next.isNegated())\n\t\t\t\tne.setNegation(next.getNegation());\n\t\t\t\t\n\t\t\t// update list\n\t\t\tconcepts.remove(entry);\n\t\t\tconcepts.remove(previous);\n\t\t\tconcepts.remove(next);\n\t\t\tconcepts.add(ne);\n\t\t\n\t\t\treturn ne;\n\t\t}\n\t\treturn null;\n\t}", "private static void sortByVerified( ArrayList<Volunteer> list)\n {\n // Find the string reference that should go in each cell of\n // the array, from cell 0 to the end\n for ( int j = 0; j < list.size();j++ )\n {\n // Find min: the index of the string reference that should go into cell j.\n // Look through the unsorted strings (those at j or higher) for the one that is first in lexicographic order\n int min = j;\n for ( int k=j+1; k < list.size(); k++ ) {\n if (list.get(k).compareTo(list.get(min)) > 0) {\n min = k;\n }\n\n }\n\n // Swap the reference at j with the reference at min\n Collections.swap(list, j, min);\n }\n }", "public void sort(){\n Collections.sort(list, new SortBySpecies());\n }", "public static List<String> sortDNA(List<String> DNA) {\n\t\tfor(int i = 0; i < DNA.size(); i++) {\n\t\t\tint shortest = i;\n\t\t\tfor(int j = i + 1; j < DNA.size(); j++) {\n\t\t\t\tif(DNA.get(j).length() < DNA.get(i).length()) {\n\t\t\t\t\tshortest = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tString switching = DNA.get(shortest);\n\t\t\tDNA.set(shortest, DNA.get(i));\n\t\t\tDNA.set(i, switching);\n\t\t}\n\t\treturn DNA;\n\t}", "public void testGenreSort() {\n sorter.inssortGenre();\n list = sorter.getLibrary();\n assertEquals(list.get(0).getGenre(), \"Hip-Hop\");\n assertEquals(list.get(1).getGenre(), \"R&B\");\n assertEquals(list.get(2).getGenre(), \"Rock\");\n }", "public static <T extends Comparable <? super T>> void mysterySort3(List <T> list){\r\n\t\twhile (!isSorted(list)){ // O(n)\r\n\t\t\tCollections.shuffle(list); //O(n)\r\n\t\t}\r\n\t}", "protected void sort() {\n\n\t\tCollections.sort(this.myRRList);\n\t}", "List<SurveyQuestionDTO> getSortedDtos(List<SurveyQuestion> questions);", "private static void sortHelperMSD(String[] asciis, int start, int end, int index) {\n // Optional MSD helper method for optional MSD radix sort\n return;\n }", "public void listSort() {\n\t\tCollections.sort(cd);\n\t}", "public static void allDrugList() {\r\n\t\ttry {\r\n\t\t\tPreparedStatement ps = St_MaryConnection.getConnection()\r\n\t\t\t\t\t.prepareStatement(\"Select Distinct drugNameOrder\" + \" From\" + \" counterdrugordertable\");\r\n\t\t\tResultSet rs = ps.executeQuery();\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tString drugDescription = rs.getString(\"drugNameOrder\");\r\n\t\t\t\t// drugModel.removeAllElements();\r\n\t\t\t\tdrugModel.addElement(drugDescription);\r\n\t\t\t}\r\n\r\n\t\t} catch (SQLException ex) {\r\n\t\t\tSystem.out.println(\"Error in getting all drug list and set on drug box\\n\" + ex);\r\n\t\t}\r\n\t}", "public void sort()\n\t{\n\t\tfor(int i=0;i<bowlers.size()-1;i++)\n\t\t{\n\t\t\tfor(int j=i+1;j<bowlers.size();j++)\n\t\t\t{\n\t\t\t\tif(bowlers.get(i).getBall()<bowlers.get(j).getBall())\n\t\t\t\t{\n\t\t\t\t\tBowler bowler=bowlers.get(i);\n\t\t\t\t\tbowlers.set(i,bowlers.get(j));\n\t\t\t\t\tbowlers.set(j,bowler);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<bowlers.size();i++)\n\t\t{\n\t\tSystem.out.println(bowlers.get(i).getBall());\n\t\t}\n\t}", "private List<Article> orderArticles(List<Article> things){\n\t\t Comparator<Article> comparatorPrizes = new Comparator<Article>() {\n\t public int compare(Article x, Article y) {\n\t return (int) (x.getPrize() - y.getPrize());\n\t }\n\t };\n\t Collections.sort(things,comparatorPrizes); \n\t Collections.reverse(things);\n\t return things;\n\t }", "private List<Criterion> _sortCriterionList()\n {\n Collections.sort(_criterionList, _groupNameComparator);\n Collections.sort(_criterionList, _fieldOrderComparator);\n for(int count = 0 ; count < _criterionList.size() ; count++)\n {\n ((DemoAttributeCriterion)_criterionList.get(count)).setOrderDirty(false);\n }\n return _criterionList;\n }", "private void arrangeAttributes(List<IOutputAttribute> outputAttributesList,\r\n \t\tList<Object> list)\r\n {\r\n \tList<Object> oldList = new ArrayList<Object>();\r\n \toldList.addAll(list);\r\n \tfor(int counter = 0;counter < outputAttributesList.size();counter++)\r\n \t{\r\n \t\tAttributeInterface attribute = outputAttributesList.get(counter).getAttribute();\r\n \t\tString value = edu.wustl.query.util.global.Utility.getTagValue(attribute,Constants.TAGGED_VALUE_RESULTVIEW);\r\n \t\tif(attribute.getName().equals(Constants.ID)\r\n \t\t&& attribute.getEntity().getName().equals(Constants.MED_ENTITY_NAME))\r\n \t\t{\r\n \t\t\tString conceptName = \"\";\r\n \t\t\tif (oldList.get(counter) != null)\r\n \t\t\t{\r\n \t\t\t\tconceptName = MedLookUpManager.instance().\r\n \t\t\t\t\tgetConceptName( outputAttributesList.get(counter),(String)(oldList.get(counter)));\r\n \t\t\t}\r\n \t\t\toldList.set(counter,conceptName);\r\n \t\t\tvalue = edu.wustl.query.util.global.Utility.getTagValue(outputAttributesList.get(counter).getExpression().\r\n \t\t \tgetQueryEntity().getDynamicExtensionsEntity(),Constants.TAGGED_VALUE_RESULTORDER);\r\n \t\t}\r\n \t\tif(!value.equals(\"\"))\r\n \t\t{\r\n \t\t\tlist.set(Integer.valueOf(value).intValue(),oldList.get(counter));\r\n \t\t}\r\n \t}\r\n }", "private ReportConcept mergeConcepts(ReportConcept previous, ReportConcept entry, Collection<ReportConcept> concepts){\n\t\tIClass pc = previous.getConceptClass();\n\t\tIClass ec = entry.getConceptClass();\n\t\tIClass common = getDirectCommonChild(pc,ec);\n\t\t\n\t\t// make sure that common ground is valid\n\t\tif(common != null){\n\t\t\t// we can't have two attributes s.a. 3 mm inferring a finding\n\t\t\tif(isFeature(common) && !isFeature(pc) && !isFeature(ec))\n\t\t\t\tcommon = null;\n\t\t\t// check if we are doing the same to diagnosis\n\t\t\tif(isDisease(common) && !isDisease(pc) && !isDisease(ec))\n\t\t\t\tcommon = null;\n\t\t\t\n\t\t\t// if previous concept is in fact more specific then current concept\n\t\t\t//TODO: this breaks depth of invasion 1.3mm\n\t\t\tif(pc.hasSuperClass(ec)){\n\t\t\t\t/*\n\t\t\t\tint stp = previous.getOffset();\n\t\t\t\tint enp = stp+previous.getLength();\n\t\t\t\tint stc = entry.getOffset();\n\t\t\t\tint enc = stc+entry.getLength();\n\t\t\t\t// we only accept common if more specific encompas the more general\n\t\t\t\tif(!(stp <= stc && enc <= enp)){\n\t\t\t\t\tcommon = null;\n\t\t\t\t}*/\n\t\t\t\tif(isSubset(previous.getLabels(),entry.getLabels())){\n\t\t\t\t\tcommon = null;\n\t\t\t\t}\n\t\t\t}else if(pc.hasSubClass(ec)){\n\t\t\t\t/*int stp = pc.getConcept().getOffset();\n\t\t\t\tint enp = stp+pc.getConcept().getText().length();\n\t\t\t\tint stc = ec.getConcept().getOffset();\n\t\t\t\tint enc = stc+ec.getConcept().getText().length();\n\t\t\t\t// we only accept common if more specific encompas the more general\n\t\t\t\tif(!(stc <= stp && enp <= enc)){\n\t\t\t\t\tcommon = null;\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t// common ground was found\n\t\tif(common != null){\n\t\t\tReportConcept ne = createReportConcept(common);\n\t\t\tne.addLabels(previous.getLabels());\n\t\t\tne.addLabels(entry.getLabels());\n\t\t\t//ne.addComponent(previous);\n\t\t\t//ne.addComponent(entry);\n\t\t\t\n\t\t\t\n\t\t\t// if new concept is just an old concept\n\t\t\t// then retain the old concept\n\t\t\tif(entry.equals(ne))\n\t\t\t\tne.setConceptEntry(entry.getConceptEntry());\n\t\t\tif(previous.equals(ne))\n\t\t\t\tne.setConceptEntry(previous.getConceptEntry());\n\t\t\t\n\t\t\t\n\t\t\t//CORRECTION: previous should take precedence, MAX was arbitrary\n\t\t\tif(previous.getConceptEntry().hasNumericValue())\n\t\t\t\tne.setNumericValue(previous.getNumericValue());\n\t\t\telse if(entry.getConceptEntry().hasNumericValue())\n\t\t\t\tne.setNumericValue(entry.getNumericValue());\n\t\t\t\n\t\t\t// copy resource link\n\t\t\tif(previous.hasResourceLink())\n\t\t\t\tne.setResourceLink(previous.getResourceLink());\n\t\t\telse if(entry.hasResourceLink())\n\t\t\t\tne.setResourceLink(entry.getResourceLink());\n\t\t\t\n\t\t\t// copy negation\n\t\t\tif(previous.isNegated())\n\t\t\t\tne.setNegation(previous.getNegation());\n\t\t\telse if(entry.isNegated())\n\t\t\t\tne.setNegation(entry.getNegation());\n\t\t\t\t\n\t\t\t// update list\n\t\t\tconcepts.remove(entry);\n\t\t\tconcepts.remove(previous);\n\t\t\tconcepts.add(ne);\n\t\t\n\t\t\treturn ne;\n\t\t}\n\t\treturn null;\n\t}", "protected List<FoodType> orderFoodSandwichLast(List<FoodType> unordered) {\n ArrayList<FoodType> ordered = new ArrayList<>();\n ArrayList<Double> ord = new ArrayList<>();\n for (FoodType f : unordered) {\n if (f == FoodType.SANDWICH1) {\n ord.add(1.1);\n } else if (f == FoodType.SANDWICH2) {\n ord.add(1.2);\n } else if (f == FoodType.COOKIE) {\n ord.add(4.0);\n } else if (f == FoodType.FRUIT1) {\n ord.add(2.1);\n } else if (f == FoodType.FRUIT2) {\n ord.add(2.2);\n } else if (f == FoodType.EGG) {\n ord.add(2.0);\n } else {\n ord.add(1.0); //should never happen\n }\n }\n Collections.sort(ord, Collections.reverseOrder());\n //System.out.println(\"ordered \");\n for (Double d : ord) {\n if (d == 1.1) {\n ordered.add(FoodType.SANDWICH1);\n } else if (d == 1.2) {\n ordered.add(FoodType.SANDWICH2);\n } else if (d == 4.0) {\n ordered.add(FoodType.COOKIE);\n } else if (d == 2.1) {\n ordered.add(FoodType.FRUIT1);\n } else if (d == 2.2) {\n ordered.add(FoodType.FRUIT2);\n } else if (d == 2.0) {\n ordered.add(FoodType.EGG);\n } else {\n System.out.println(\"There is an error - this food type is invalid\");\n }\n }\n return ordered;\n }", "@Override\n public int compare(Suggestion sugg1, Suggestion sugg2) {\n int alteredGrammarWordsDifference = sugg1.getAlteredGrammarWordsCount()\n - sugg2.getAlteredGrammarWordsCount();\n\n if (alteredGrammarWordsDifference != 0) {\n return alteredGrammarWordsDifference;\n }\n\n //if tied: less added info first\n int additionalNamesDifference = sugg1.getAdditionalNamesCount() + sugg1.getAdditionalGrammarWords()\n - (sugg2.getAdditionalNamesCount() + sugg2.getAdditionalGrammarWords());\n\n if (additionalNamesDifference != 0) {\n return additionalNamesDifference;\n }\n\n //if tied: less words first\n int wordCountDifference = sugg1.getWordsCount() - sugg2.getWordsCount();\n\n if (wordCountDifference == 0) {\n return wordCountDifference;\n }\n\n //if tied: shortest text first\n return sugg1.getText().length() - sugg2.getText().length();\n }", "@Override\n public void sort() {\n\n List<Doctor> unsortedDocs = this.doctors;\n\n Collections.sort(unsortedDocs, new Comparator<Doctor>() {\n @Override\n public int compare(Doctor a, Doctor b) {\n //Compare first name for doctors and re-arrange list\n return a.getFirstName().compareTo(b.getFirstName());\n }\n });\n \n this.doctors = unsortedDocs;\n\n }", "public void step3(){\n\n Collections.sort(names,(String a, String b) -> a.compareTo(b));\n }", "@Test\n void queryWithMultipleSortersReturnsAppropriateOrder() {\n final RecordSorter<Munro> designationSorter = new RecordSorter<>(Munro::getDesignation,\n SortOrder.ASCENDING);\n final RecordSorter<Munro> heightSorter = new RecordSorter<>(Munro::getHeight,\n SortOrder.ASCENDING);\n\n final List<Comparator<Munro>> sorters =\n Arrays.asList(designationSorter, heightSorter);\n\n final List<Munro> munroes = this.store.query(\n new MunroQuerySpecification(null, null, null, null, sorters));\n\n // Tracking designation and last height across results.\n Designation currentType = Designation.MUN;\n double lastHeight = Double.MIN_VALUE;\n boolean isFirstOfNewType = true;\n\n for (final Munro munro : munroes) {\n if (currentType != munro.getDesignation()) {\n if (isFirstOfNewType) {\n // One swap of type is allowed. Any more swaps and they weren't sorted by type\n // first.\n currentType = munro.getDesignation();\n\n // Reset the last height when changing types, since height was a secondary\n // ordering.\n lastHeight = Double.MIN_VALUE;\n\n isFirstOfNewType = false;\n } else {\n // More than one swap, the sorting didn't work.\n Assertions.fail(\"Expected ordering by type\");\n }\n }\n\n Assertions.assertEquals(currentType, munro.getDesignation());\n Assertions.assertTrue(munro.getHeight() >= lastHeight);\n lastHeight = munro.getHeight();\n }\n }", "private List<Atom> sortAtoms(List<Atom> atoms) {\n\t\tfinal Set<SortingBodyComponent> components = new LinkedHashSet<>();\n\t\tfinal Set<ExternalAtom> builtinAtoms = new LinkedHashSet<>();\n\t\tfinal Set<IntervalAtom> intervalAtoms = new LinkedHashSet<>();\n\n\t\tfor (Atom atom : atoms) {\n\t\t\t// FIXME: The following case assumes that builtin predicates do not create bindings?!\n\t\t\tif (atom.getPredicate() instanceof BuiltinBiPredicate) {\n\t\t\t\t// Sort out builtin atoms (we consider them as not creating new bindings)\n\t\t\t\tbuiltinAtoms.add((ExternalAtom) atom);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (atom instanceof IntervalAtom) {\n\t\t\t\tintervalAtoms.add((IntervalAtom) atom);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfinal Set<SortingBodyComponent> hits = new LinkedHashSet<>();\n\n\t\t\t// For each variable\n\t\t\tfor (VariableTerm variableTerm : atom.getBindingVariables()) {\n\t\t\t\t// Find all components it also occurs and record in hitting components\n\t\t\t\tfor (SortingBodyComponent component : components) {\n\t\t\t\t\tif (component.occurringVariables.contains(variableTerm)) {\n\t\t\t\t\t\thits.add(component);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If no components were hit, create new component, else merge components\n\t\t\tif (hits.isEmpty()) {\n\t\t\t\tcomponents.add(new SortingBodyComponent(atom));\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If only one component hit, add atom to it\n\t\t\tif (hits.size() == 1) {\n\t\t\t\thits.iterator().next().add(atom);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Merge all components that are hit by the current atom\n\t\t\tSortingBodyComponent firstComponent = hits.iterator().next();\n\t\t\tfirstComponent.add(atom);\n\t\t\tfor (SortingBodyComponent hitComponent : hits) {\n\t\t\t\tif (hitComponent != firstComponent) {\n\t\t\t\t\tfirstComponent.merge(hitComponent);\n\t\t\t\t\t// Remove merged component from the set of available components\n\t\t\t\t\tcomponents.remove(hitComponent);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Components now contains all components that are internally connected but not connected to another component\n\t\tList<Atom> sortedPositiveBodyAtoms = new ArrayList<>(components.size());\n\t\tfor (SortingBodyComponent component : components) {\n\t\t\tsortedPositiveBodyAtoms.addAll(component.atomSequence);\n\t\t}\n\n\t\tsortedPositiveBodyAtoms.addAll(intervalAtoms); // Put interval atoms after positive literals generating their bindings and before builtin atom.\n\t\tsortedPositiveBodyAtoms.addAll(builtinAtoms);\t// Put builtin atoms after positive literals and before negative ones.\n\t\treturn sortedPositiveBodyAtoms;\n\t}", "@Override\n public int compareTo(final Ditch ditch) {\n if (!getFirst().equals(ditch.getFirst()))\n return getFirst().compareTo(ditch.getFirst());\n else\n return getSecond().getColumn() - ditch.getSecond()\n .getColumn();\n }", "@VTID(28)\n boolean getSortUsingCustomLists();", "private void filterOverlap(List<Concept> concepts) {\n\t\t// go over concepts in\n\t\tSet<Concept> torem = new HashSet<Concept>();\n\t\tConcept p = null;\n\t\tfor(Concept c : concepts){\n\t\t\tif(p != null){\n\t\t\t\tif(c.getCode().equals(p.getCode())){\n\t\t\t\t\tif(c.getText() != null && c.getText().contains(p.getText())){\n\t\t\t\t\t\ttorem.add(p);\n\t\t\t\t\t}else if(p.getText() != null && p.getText().contains(c.getText())){\n\t\t\t\t\t\ttorem.add(c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tp = c;\n\t\t}\n\t\t\n\t\t// remove whatever\n\t\tfor (Concept r : torem) {\n\t\t\tfor (ListIterator<Concept> it = concepts.listIterator(); it.hasNext();) {\n\t\t\t\tConcept c = it.next();\n\t\t\t\tif (c.equals(r) && c.getText().equals(r.getText())) {\n\t\t\t\t\tit.remove();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static Object sortDNA(List<String> unsortedSequences) {\n\t\treturn null;\n\t}", "void comparatorSort() {\n Collections.sort(vendor, Vendor.sizeVendor); // calling collection sort method and passing list and comparator variables\r\n for (HDTV item : vendor) { //looping arraylist\r\n System.out.println(\"Brand: \" + item.brandname + \" Size: \" + item.size);\r\n }\r\n }", "public static ArrayList<JsonNode> sortData(ArrayList<JsonNode> wordList) {\n Collections.sort( wordList, new Comparator<JsonNode>() {\n @Override\n public int compare(JsonNode a, JsonNode b) {\n int valA = Integer.parseInt(a.get(\"weight\").asText());\n int valB = Integer.parseInt(b.get(\"weight\").asText());\n return valB - valA; //Sort in order of largest to smallest\n }\n });\n\n return wordList;\n }", "@Override\r\n\t\t\tpublic int compare(T o1, T o2) {\n\t\t\t\tString s1 = ((OWLProperty)o1).getIRI().getShortForm();\r\n\t\t\t\tString s2 = ((OWLProperty)o2).getIRI().getShortForm();\r\n\t\t\t\tif (s1.startsWith(\"'\")) {\r\n\t\t\t\t\ts1 = s1.substring(1, s1.length() - 1);\r\n\t\t\t\t}\r\n\t\t\t\tif (s2.startsWith(\"'\")) {\r\n\t\t\t\t\ts2 = s2.substring(1, s2.length() - 1);\r\n\t\t\t\t}\r\n\t\t\t\treturn s1.compareTo(s2);\r\n\t\t\t}", "protected abstract void arrange(List<Skill> skills) throws SkillTreeException;", "public static void main(String[] args) {\n\n List<String> animals = new ArrayList <String>();\n\n animals.add(\"Elephatn\");\n animals.add(\"snake\");\n animals.add(\"Lion\");\n animals.add(\"Mongoose\");\n animals.add(\"Cat\");\n\n\n\n// Collections.sort(animals, new StringLengthComparator());\n// Collections.sort(animals, new AlphabeticalComparator());\n Collections.sort(animals, new ReverseAlphabeticalComparator());\n for(String animal:animals){\n System.out.println(animal);\n }\n\n//////////////Sorting Numbers ///////////\n List<Integer> numbers = new ArrayList <Integer>();\n\n numbers.add(54);\n numbers.add(1);\n numbers.add(36);\n numbers.add(73);\n numbers.add(9);\n\n Collections.sort(numbers, new Comparator <Integer>() {\n @Override\n public int compare(Integer num1, Integer num2) {\n return num1.compareTo(num2);\n }\n });\n\n for(Integer number: numbers){\n System.out.println(number);\n }\n\n\n///////////////Sorting Arbitrary objects////////\n\n\n List<Person> people = new ArrayList <Person>();\n\n people.add(new Person(1,\"Joe\"));\n people.add(new Person(5,\"Harry\"));\n people.add(new Person(2,\"Hermoine\"));\n people.add(new Person(4,\"Muffet\"));\n\n// Sort in order of ID\n Collections.sort(people, new Comparator <Person>() {\n @Override\n public int compare(Person p1, Person p2) {\n\n if(p1.getId()>p2.getId()){\n return 1;\n }else if(p1.getId()<p2.getId()){\n return -1;\n }\n return 0;\n\n }\n });\n\n\n // Sort in order of Name\n Collections.sort(people, new Comparator <Person>() {\n @Override\n public int compare(Person p1, Person p2) {\n\n return p1.getName().compareTo(p2.getName());\n\n\n }\n });\n\n for(Person person: people){\n System.out.println(person);\n\n }\n\n }", "default List<String> interestingConcepts(int topK, UnitLocation located,\n Set<Location> irrelevantSet){\n // collect frequent words outside the blacklist of locations\n final TokenIterator extractor = new TokenIterator(irrelevantSet);\n located.getUnitNode().accept(extractor);\n\n final WordCounter wordCounter = new WordCounter(extractor.getItems());\n\n return wordCounter.mostFrequent(topK);\n }", "public List<ValueType> sort() {\r\n // TODO\r\n return null;\r\n }", "public void sortMarc()\r\n {\r\n\t/* Make sure each element in marc_out is a complete string with more than 4 characters */\r\n\tfor(int a = 0; a < marc_out.size(); a++)\r\n\t {\r\n\t\tif(marc_out.get(a).length() < 5){\r\n\t\t System.out.println(\"Warning (sortMarc): marc line \" + marc_out.get(a) + \" too short, must have least 4 characters.\");\r\n\t\t return;\r\n\t\t}\r\n\t }\r\n\r\n\tfor(int a = 0; a < (marc_out.size() - 1); a++)\r\n\t {\r\n\t\tint field_a = 0;\r\n\t\tString value_a = (marc_out.get(a)).substring(1, 4);\r\n\t\ttry{\r\n\t\t field_a = (Integer.valueOf(value_a)).intValue();\r\n\t\t}\r\n\t\tcatch(NumberFormatException nfe) { }\r\n\r\n\t\tfor(int b = a + 1; b < marc_out.size(); b++)\r\n\t\t {\r\n\t\t\tint field_b = 0;\r\n\t\t\tString value_b = (marc_out.get(b)).substring(1, 4);\r\n\t\t\ttry{\r\n\t\t\t field_b = (Integer.valueOf(value_b)).intValue();\r\n\t\t\t}\r\n\t\t\tcatch(NumberFormatException nfe){ }\r\n\r\n\t\t\tif(field_b < field_a)\r\n\t\t\t {\r\n\t\t\t\tString temp_field = marc_out.get(b);\r\n\t\t\t\tmarc_out.set(b, marc_out.get(a));\r\n\t\t\t\tmarc_out.set(a, temp_field);\r\n\r\n\t\t\t\tfield_a = field_b;\r\n\t\t\t }\r\n\t\t }\r\n \t }\r\n }", "private Map<String,Map<String, String>> getConcepts(List<Concept> concepts){\n Map<String,Map<String, String>> result = new HashMap<String, Map<String, String>>();\n \n for (Concept concept : concepts) {\n Map<String, String> conceptProperties = this.getConceptProperties(concept);\n result.put(concept.getName(), conceptProperties);\n }\n \n return result;\n }", "public static boolean testSort() {\r\n Manager inst;\r\n try {\r\n inst = new PokemonTable();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n return false;\r\n }\r\n LinkedList<Pokemon> list;\r\n list = inst.sortByAttack(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getAttack() < list.get(i).getAttack()) {\r\n System.out.println(\"attack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByAttack(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getAttack() > list.get(i).getAttack()) {\r\n System.out.println(\"attack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByDefense(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getDefense() < list.get(i).getDefense()) {\r\n System.out.println(\"defense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByDefense(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getDefense() > list.get(i).getDefense()) {\r\n System.out.println(\"defense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByFavorite(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (!list.get(i - 1).getFavorite() && list.get(i).getFavorite()) {\r\n System.out.println(\"favorite sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByFavorite(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getFavorite() && !list.get(i).getFavorite()) {\r\n System.out.println(\"favorite sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByHp(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getHp() < list.get(i).getHp()) {\r\n System.out.println(\"hp sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByHp(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getHp() > list.get(i).getHp()) {\r\n System.out.println(\"hp sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByLegendary(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (!list.get(i - 1).isLegendary() && list.get(i).isLegendary()) {\r\n System.out.println(\"legendary sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByLegendary(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).isLegendary() && !list.get(i).isLegendary()) {\r\n System.out.println(\"legendary sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByName(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getName().compareTo(list.get(i).getName()) > 0) {\r\n System.out.println(\"name sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByName(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getName().compareTo(list.get(i).getName()) < 0) {\r\n System.out.println(\"name sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpAttack(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpAttack() < list.get(i).getSpAttack()) {\r\n System.out.println(\"spAttack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpAttack(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpAttack() > list.get(i).getSpAttack()) {\r\n System.out.println(\"spAttack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpDefense(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpDefense() < list.get(i).getSpDefense()) {\r\n System.out.println(\"spDefense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpDefense(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpDefense() > list.get(i).getSpDefense()) {\r\n System.out.println(\"spDefense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpeed(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpeed() < list.get(i).getSpeed()) {\r\n System.out.println(\"speed sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpeed(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpeed() > list.get(i).getSpeed()) {\r\n System.out.println(\"speed sort\");\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "private List<BeaconConcept> filterSemanticGroup(List<BeaconConcept> concepts, List<String> types) {\n\t\t\n\t\tif (types.isEmpty()) return concepts;\n\t\t\n\t\tPredicate<BeaconConcept> hasType = n -> !Collections.disjoint(types, n.getCategories());\n\t\tconcepts = Util.filter(hasType, concepts);\n\t\t\n\t\treturn concepts;\n\t}", "private static List<MoneyLoss> sortLosses(Collection<MoneyLoss> unsortedLosses)\n {\n //Sort budget items first on frequency and then alphabetically\n ArrayList<MoneyLoss> oneTimeItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> dailyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> weeklyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> biweeklyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> monthlyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> yearlyItems = new ArrayList<MoneyLoss>();\n\n for (MoneyLoss loss : unsortedLosses)\n {\n switch (loss.lossFrequency())\n {\n case oneTime:\n {\n oneTimeItems.add(loss);\n break;\n }\n case daily:\n {\n dailyItems.add(loss);\n break;\n }\n case weekly:\n {\n weeklyItems.add(loss);\n break;\n }\n case biWeekly:\n {\n biweeklyItems.add(loss);\n break;\n }\n case monthly:\n {\n monthlyItems.add(loss);\n break;\n }\n case yearly:\n {\n yearlyItems.add(loss);\n break;\n }\n }\n }\n\n Comparator<MoneyLoss> comparator = new Comparator<MoneyLoss>() {\n @Override\n public int compare(MoneyLoss lhs, MoneyLoss rhs) {\n return lhs.expenseDescription().compareTo(rhs.expenseDescription());\n }\n };\n\n Collections.sort(oneTimeItems, comparator);\n Collections.sort(dailyItems, comparator);\n Collections.sort(weeklyItems, comparator);\n Collections.sort(biweeklyItems, comparator);\n Collections.sort(monthlyItems, comparator);\n Collections.sort(yearlyItems, comparator);\n\n ArrayList<MoneyLoss> sortedItems = new ArrayList<MoneyLoss>();\n BadBudgetApplication.appendItems(sortedItems, oneTimeItems);\n BadBudgetApplication.appendItems(sortedItems, dailyItems);\n BadBudgetApplication.appendItems(sortedItems, weeklyItems);\n BadBudgetApplication.appendItems(sortedItems, biweeklyItems);\n BadBudgetApplication.appendItems(sortedItems, monthlyItems);\n BadBudgetApplication.appendItems(sortedItems, yearlyItems);\n\n return sortedItems;\n }", "private static void sortNoun() throws Exception{\r\n\t\tBufferedReader[] brArray = new BufferedReader[ actionNumber ];\r\n\t\tBufferedWriter[] bwArray = new BufferedWriter[ actionNumber ];\r\n\t\tString line = null;\r\n\t\tfor(int i = 0; i < actionNameArray.length; ++i){\r\n\t\t\tSystem.out.println(\"sorting for \" + actionNameArray[ i ]);\r\n\t\t\tbrArray[ i ] = new BufferedReader( new FileReader(TFIDF_URL + actionNameArray[ i ] + \".tfidf\"));\r\n\t\t\tHashMap<String, Double> nounTFIDFMap = new HashMap<String, Double>();\r\n\t\t\tint k = 0;\r\n\t\t\t// 1. Read tfidf data\r\n\t\t\twhile((line = brArray[ i ].readLine())!=null){\r\n\t\t\t\tnounTFIDFMap.put(nounList.get(k), Double.parseDouble(line));\r\n\t\t\t\tk++;\r\n\t\t\t}\r\n\t\t\tbrArray[ i ].close();\r\n\t\t\t// 2. Rank according to tfidf\r\n\t\t\tValueComparator bvc = new ValueComparator(nounTFIDFMap);\r\n\t\t\tTreeMap<String, Double> sortedMap = new TreeMap<String, Double>(bvc);\r\n\t\t\tsortedMap.putAll(nounTFIDFMap);\r\n\t\t\t\r\n\t\t\t// 3. Write to disk\r\n\t\t\tbwArray[ i ] = new BufferedWriter(new FileWriter( SORTED_URL + actionNameArray[ i ] + \".sorted\"));\r\n\t\t\tfor(String nounKey : sortedMap.keySet()){\r\n\t\t\t\tbwArray[ i ].append(nounKey + \"\\t\" + nounTFIDFMap.get(nounKey) + \"\\n\");\r\n\t\t\t}\r\n\t\t\tbwArray[ i ].close();\r\n\t\t}\r\n\t}", "private void sortCoreTypes() {\n\t\tArrays.sort(coreBuiltin, (o1, o2) -> Long.compare(o1.id, o2.id));\n\t}", "private List<Article> sortTopics(Article queryTopic, List<Article>relatedTopics) throws Exception {\n for (Article art:relatedTopics) \n art.setWeight(_comparer.getRelatedness(art, queryTopic)) ;\n\n //Now that the weight attribute is set, sorting will be in descending order of weight.\n //If weight was not set, it would be in ascending order of id. \n Collections.sort(relatedTopics) ;\n return relatedTopics ;\n }", "public void sortLibrary() {\n libraries.sort(Comparator.comparingLong(Library::getSignupCost));\n\n //J-\n// libraries.sort((o1, o2) -> Long.compare(\n// o2.getCurrentScore() - (2 * o2.getDailyShipCapacity() * o2.getSignupCost()),\n// o1.getCurrentScore() - (2 * o1.getDailyShipCapacity() * o1.getSignupCost())\n// ));\n\n// libraries.sort((o1, o2) -> Long.compare(\n// (o2.getBooksCount() + o2.getSignupCost()) * o2.getDailyShipCapacity(),\n// (o1.getBooksCount() + o1.getSignupCost()) * o1.getDailyShipCapacity()));\n //J+\n }", "public static WordFrq[] sort(WordFrq b[]){\n WordFrq temp;\n int i=0;\n while (i < 3) {\n for (i = 1; i < 3; i++) {\n if (b[i-1].count > b[i].count) {\n temp = b[i];\n b[i] = b[i-1];\n b[i-1] = temp;\n break;\n }\n }\n }\n\n\n return b;\n\n\n\n\n\n }", "public void sortVehicles() {\n\t\tCollections.sort(vehicles);\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tList<String> animal = new ArrayList<String>();\n\n\t\tanimal.add(\"Cat\");\n\t\tanimal.add(\"Mouse\");\n\t\tanimal.add(\"Lion\");\n\t\tanimal.add(\"Zeebra\");\n\t\tanimal.add(\"Bear\");\n\t\tanimal.add(\"Deer\");\n\n\t\t// Collections.sort(animal,new StringLengthComparator());\n\n\t\tCollections.sort(animal, new ReverseAlphabeticalComparator());\n\t\tfor (String animal1 : animal) {\n\n\t\t\tSystem.out.println(animal1);\n\t\t}\n\n\t\t/////////////////////////////// Sorting Numbers ////////////////////////////////\n\t\tList<Integer> numbers = new ArrayList<Integer>();\n\n\t\tnumbers.add(5);\n\t\tnumbers.add(31);\n\t\tnumbers.add(16);\n\t\tnumbers.add(605);\n\t\tnumbers.add(15);\n\n\t\tCollections.sort(numbers, new Comparator<Integer>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(Integer num1, Integer num2) {\n\n\t\t\t\treturn -num1.compareTo(num2);\n\t\t\t}\n\n\t\t});\n\n\t\tfor (Integer num1 : numbers) {\n\n\t\t\tSystem.out.println(num1);\n\t\t}\n\t\t///////////////////////////// Sorting Arbitrary Objects ////////////////////////////\n\n\t\tList<Person> people = new ArrayList<Person>();\n\n\t\tpeople.add(new Person(3, \"Ajeer\"));\n\t\tpeople.add(new Person(1, \"Sudeer\"));\n\t\tpeople.add(new Person(2, \"Sureash\"));\n\t\tpeople.add(new Person(4, \"Sam\"));\n\t\t\n\t\t// Sort in Order of ID\n\t\tCollections.sort(people, new Comparator<Person>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(Person p1, Person p2) {\n\t\t\t\tif (p1.getId() > p2.getId()) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\telse if (p1.getId()< p2.getId()) {\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t});\n\t\tfor (Person person1 : people) {\n\n\t\t\tSystem.out.println(person1);\n\t\t}\n\t\tSystem.out.println(\"\\n\");\n\t\t// Sort In Order of NAME....\n\t\tCollections.sort(people, new Comparator<Person>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(Person p1, Person p2) {\n\t\t\t\n\t\t\t\treturn p1.getName().compareTo(p2.getName());\n\t\t\t}\n\t\t});\n\t\tfor (Person person1 : people) {\n\n\t\t\tSystem.out.println(person1);\n\t\t}\n\t}", "public static <T extends Comparable <? super T>> void mysterySort1(List <T> list){\r\n\t\tfor (int i = 1; i < list.size(); i++){ //n\r\n\t\t\tint j = i; //1\r\n\t\t\t\r\n\t\t\t//list.get => O(1)\r\n\t\t\t\r\n\t\t\twhile (j > 0 && list.get(j - 1).compareTo(list.get(j)) > 0){ //\r\n\t\t\t\tswap(list, j, j - 1); //O(1)\r\n\t\t\t\tj --;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void sort() {\r\n\t\tCollections.sort(parts);\r\n\t}", "@Override\n\tpublic int compare(Concepto o1, Concepto o2) {\n\t\treturn o1.getFecha_Fin().compareTo(o2.getFecha_Fin());\n\t}", "public List<SigPair<C>> sortSigma(List<SigPair<C>> list) {\n //Comparator<SigPair<C>> sigcmp = Comparator.comparing(SigPair::getSigma::degree);\n ToLongFunction<SigPair<C>> function = new ToLongFunction<SigPair<C>>() {\n @Override\n public long applyAsLong(SigPair<C> cSigPair) {\n return cSigPair.getSigmaDegree();\n }\n };\n Comparator<SigPair<C>> sigcmp = DComparator.comparingLong(function);\n// List<SigPair<C>> ff = list.stream()\n// .sorted(sigcmp)\n// .collect(Collectors.toList());\n\n List<SigPair<C>> ff = new ArrayList<>(list);\n Collections.sort(ff, sigcmp);\n\n return ff;\n }", "private void arrangeFactors() {\n List<Condition> tempTrialConditions = new ArrayList<Condition>();\n List<Condition> tempStudyConditions = new ArrayList<Condition>();\n List<ibfb.domain.core.Factor> tempFactors = new ArrayList<ibfb.domain.core.Factor>();\n\n // conditions\n for (Condition cond : workbookStudy.getConditions()) {\n if (hasLabel(cond.getLabel(), Workbook.STUDY)) {\n cond.setLabel(Workbook.STUDY);\n tempStudyConditions.add(cond);\n }\n }\n for (Condition cond : workbookStudy.getStudyConditions()) {\n if (hasLabel(cond.getLabel(), Workbook.STUDY)) {\n cond.setLabel(Workbook.STUDY);\n tempStudyConditions.add(cond);\n }\n }\n\n // study conditions\n for (Condition cond : workbookStudy.getConditions()) {\n //if (hasLabel(cond.getLabel(), Workbook.TRIAL_LABEL)) {\n if (hasLabel(cond.getLabel(), workbookStudy.getTrialLabel())) {\n\n cond.setLabel(workbookStudy.getTrialLabel());\n tempTrialConditions.add(cond);\n }\n }\n for (Condition cond : workbookStudy.getStudyConditions()) {\n // if (hasLabel(cond.getLabel(), Workbook.TRIAL_LABEL)) {\n if (hasLabel(cond.getLabel(), workbookStudy.getTrialLabel())) {\n cond.setLabel(workbookStudy.getTrialLabel());\n tempTrialConditions.add(cond);\n }\n }\n\n // factors (ENTRY)\n for (Condition cond : workbookStudy.getStudyConditions()) {\n //if (hasLabel(cond.getLabel(), Workbook.TRIAL_LABEL)) {\n if (hasLabel(cond.getLabel(), workbookStudy.getTrialLabel())) {\n //tempFactors.add(getFactor(cond, Workbook.ENTRY_LABEL));\n tempFactors.add(getFactor(cond, workbookStudy.getTrialLabel()));\n }\n }\n\n for (Condition cond : workbookStudy.getConditions()) {\n //if (hasLabel(cond.getLabel(), Workbook.ENTRY_LABEL)) {\n if (hasLabel(cond.getLabel(), workbookStudy.getEntryLabel())) {\n //tempFactors.add(getFactor(cond, Workbook.ENTRY_LABEL));\n tempFactors.add(getFactor(cond, workbookStudy.getEntryLabel()));\n }\n }\n for (ibfb.domain.core.Factor factor : workbookStudy.getFactors()) {\n //if (hasLabel(factor.getLabel(), Workbook.ENTRY_LABEL)) {\n if (hasLabel(factor.getLabel(), workbookStudy.getEntryLabel())) {\n tempFactors.add(factor);\n }\n }\n\n // Factors (plot)\n for (Condition cond : workbookStudy.getStudyConditions()) {\n //if (hasLabel(cond.getLabel(), Workbook.PLOT_LABEL)) {\n if (hasLabel(cond.getLabel(), workbookStudy.getPlotLabel())) {\n //tempFactors.add(getFactor(cond, Workbook.PLOT_LABEL));\n tempFactors.add(getFactor(cond, workbookStudy.getPlotLabel()));\n }\n }\n for (Condition cond : workbookStudy.getConditions()) {\n //if (hasLabel(cond.getLabel(), Workbook.PLOT_LABEL)) {\n if (hasLabel(cond.getLabel(), workbookStudy.getPlotLabel())) {\n //tempFactors.add(getFactor(cond, Workbook.PLOT_LABEL));\n tempFactors.add(getFactor(cond, workbookStudy.getPlotLabel()));\n }\n }\n\n for (ibfb.domain.core.Factor factor : workbookStudy.getFactors()) {\n //if (hasLabel(factor.getLabel(), Workbook.PLOT_LABEL)) {\n if (hasLabel(factor.getLabel(), workbookStudy.getPlotLabel())) {\n tempFactors.add(factor);\n /*} else if (factor.getLabel() != null && workbookStudy.getOtherLabels().contains(factor.getLabel())) {\n tempFactors.add(factor);\n */\n }\n }\n\n for (ibfb.domain.core.Factor factor : workbookStudy.getFactors()) {\n //if (hasLabel(factor.getLabel(), Workbook.PLOT_LABEL)) {\n if (factor.getLabel() != null \n && !hasLabel(factor.getLabel(), Workbook.STUDY)\n && !hasLabel(factor.getLabel(), workbookStudy.getEntryLabel())\n && !hasLabel(factor.getLabel(), workbookStudy.getPlotLabel())\n && !hasLabel(factor.getLabel(), workbookStudy.getTrialLabel())) {\n tempFactors.add(factor);\n }\n }\n\n workbookStudy.setStudyConditions(tempStudyConditions);\n workbookStudy.setConditions(tempTrialConditions);\n workbookStudy.setFactors(tempFactors);\n }", "public java.util.List<CodeableConcept> specialArrangement() {\n return getList(CodeableConcept.class, FhirPropertyNames.PROPERTY_SPECIAL_ARRANGEMENT);\n }", "@Override\n\t\t\t\tpublic int compare(RestDynamicSemanticVersion o1, RestDynamicSemanticVersion o2)\n\t\t\t\t{\n\t\t\t\t\tif (((RestDynamicSemanticNid)o1.dataColumns.get(0)).getNid() == ((RestDynamicSemanticNid)o2.dataColumns.get(0)).getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (o1.semanticChronology != null) //If one chronology is here, they both should be here\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (o1.semanticChronology.assemblage.nid.intValue() == MetaData.US_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o2.semanticChronology.assemblage.nid.intValue() == MetaData.US_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o1.semanticChronology.assemblage.nid.intValue() == MetaData.GB_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o2.semanticChronology.assemblage.nid.intValue() == MetaData.GB_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn 1;\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//Some other dialect... just sort on the dialect text\n\t\t\t\t\t\t\t\treturn AlphanumComparator.compare(Util.readBestDescription(o1.semanticChronology.assemblage.nid),\n\t\t\t\t\t\t\t\t\t\tUtil.readBestDescription(o2.semanticChronology.assemblage.nid), true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//If chronology isn't populated, I can't sort here\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (((RestDynamicSemanticNid)o1.dataColumns.get(0)).getNid() == MetaData.PREFERRED____SOLOR.getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t}\n\t\t\t\t\telse if (((RestDynamicSemanticNid)o2.dataColumns.get(0)).getNid() == MetaData.PREFERRED____SOLOR.getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//should be impossible - not the same, and neither is preferred - must be invalid data.\n\t\t\t\t\t\tLogManager.getLogger().warn(\"Unexpected sort case\");\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}", "public MapList sortCRListByState(Context context, MapList mlCR) throws Exception {\n // TIGTK-13922 START\n\n MapList mlTempCRFinal = new MapList();\n MapList mlTempCRCreate = new MapList();\n MapList mlTempCRSubmit = new MapList();\n MapList mlTempCREvaluate = new MapList();\n MapList mlTempCRINReview = new MapList();\n MapList mlTempCRInProcess = new MapList();\n MapList mlTempCRComplete = new MapList();\n MapList mlTempCRRejected = new MapList();\n try {\n\n Iterator itr = mlCR.iterator();\n while (itr.hasNext()) {\n Map mpCRObj = (Map) itr.next();\n String strCRState = (String) mpCRObj.get(DomainConstants.SELECT_CURRENT);\n switch (strCRState) {\n case \"Create\":\n mlTempCRCreate.add(mpCRObj);\n break;\n\n case \"Submit\":\n mlTempCRSubmit.add(mpCRObj);\n\n break;\n case \"Evaluate\":\n mlTempCREvaluate.add(mpCRObj);\n break;\n case \"In Review\":\n mlTempCRINReview.add(mpCRObj);\n break;\n case \"In Process\":\n mlTempCRInProcess.add(mpCRObj);\n break;\n case \"Complete\":\n mlTempCRComplete.add(mpCRObj);\n break;\n case \"Rejected\":\n mlTempCRRejected.add(mpCRObj);\n break;\n default:\n break;\n\n }\n }\n mlTempCRFinal.addAll(mlTempCRCreate);\n mlTempCRFinal.addAll(mlTempCRSubmit);\n mlTempCRFinal.addAll(mlTempCREvaluate);\n mlTempCRFinal.addAll(mlTempCRINReview);\n mlTempCRFinal.addAll(mlTempCRInProcess);\n mlTempCRFinal.addAll(mlTempCRComplete);\n mlTempCRFinal.addAll(mlTempCRRejected);\n // TIGTK-13922 END\n\n } catch (Exception ex) {\n logger.error(\"Error in sortCRListByState: \", ex);\n throw ex;\n }\n return mlTempCRFinal;\n }", "public void sortByQnNum() {\r\n\t\tfor (int j = 0; j < displayingList.size() - 1; j++) {\r\n\t\t\tfor (int i = 0; i < displayingList.size() - j - 1; i++) {\r\n\t\t\t\tif (displayingList.get(i).getQnNum() > displayingList.get(i + 1).getQnNum()) {\r\n\t\t\t\t\tswapPosition(displayingList, i, i + 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void sort()\n {\n\tstrack.sort((Node n1, Node n2) ->\n\t{\n\t if (n1.getCost() < n2.getCost()) return -1;\n\t if (n1.getCost() > n2.getCost()) return 1;\n\t return 0;\n\t});\n }", "public static void main(String[] args) {\n\r\n\t\tList<Library> list=new ArrayList<Library>();\r\n\t\tlist.add(new Library(100, \"bhagyesh\"));\r\n\t\tlist.add(new Library(4, \"patel\"));\r\n\t\tlist.add(new Library(5, \"sid\"));\r\n\t\tlist.add(new Library(78, \"naitik\"));\r\n\t\tlist.add(new Library(39, \"amit\"));\r\n\t\t\r\n \tlist.stream().forEach(p -> System.out.println(p.getName()));\r\n \tlist.sort(Comparator.comparing(Library::getName));\r\n \tlist.stream().forEach(p -> System.out.println(p.getName()));\r\n \r\n \t\r\n \t\r\n \t\r\n\t}", "private List<PricingRule> orderPricingRules(Set<PricingRule> pricingRules) {\n \tList<PricingRule> pricingRulesList = pricingRules.stream().collect(Collectors.toList());\n \tCollections.sort(pricingRulesList, new Comparator<PricingRule>() {\n\t\t\tpublic int compare(PricingRule o1, PricingRule o2) {\n\t\t\t\treturn ((o2.getClass().getAnnotation(PricingRuleOrder.class).value()) - (o1.getClass().getAnnotation(PricingRuleOrder.class).value()));\n\t\t\t}\n\t\t});\n\t\treturn pricingRulesList;\n }", "private void sortRating()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getRating().compareTo(b.getRating());\n if(result < 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n else if(result == 0)\n {\n result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\n }\n }", "public static void dimension_sort() { // sort the dimensions according to their effect to GCP\n\t\tfor (int i = 0;i < dims-1;i++) {\n\t\t\tdimension[i] = (byte) i;\n\t\t}\n\t\tboolean swapped = true;\n\t\tint i=0;\n\t\tbyte temp;\n\t\twhile (swapped) {\n\t\t\tswapped = false;\n\t\t\ti++;\n\t\t\tfor (int j = 0; j < dimension.length-i;j++) { // smaller range, put it the front\n\t\t\t\tif (cardinalities[dimension[j]] > cardinalities[dimension[j+1]]) {\n\t\t\t\t\ttemp = dimension[j];\n\t\t\t\t\tdimension[j] = dimension[j+1];\n\t\t\t\t\tdimension[j+1] = temp;\n\t\t\t\t\tswapped = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void sortSongs(Context context)\n {\n boolean foundArtist;\n for (Song song : songs)\n {\n foundArtist = false;\n for (Artist artist : artists)\n {\n if (song.artistName.equals(artist.name))\n {\n artist.addSong(song);\n foundArtist = true;\n break;\n }\n }\n if (!foundArtist)\n artists.add(new Artist(song));\n }\n\n //sorts all songs\n sortSongs(songs);\n\n //sort artists\n sortArtists(artists);\n\n //sort albums, songs and set cover\n for (Artist artist : artists)\n {\n //albums\n sortAlbums(artist.albums);\n\n for (Album album : artist.albums)\n {\n //sort album songs\n sortSongs(album.songs);\n\n //set cover\n album.cover = ImageLoader.getAlbumart(context, album.songs.get(0).albumId);\n }\n }\n }", "public void weightedSearchByIngredients(List <Match> recipeDataList, int ingredients){\n for (Match recipe : recipeDataList){\n //recipe frequency + rating/10\n recipe.setWeight(((float)ingredients/((float)recipe.getIngredients().size()))+((float)recipe.getRating()/((float)10)));\n System.out.println(\"Recipe: \" + recipe.getRecipeName() + \"| Weight: \" + recipe.getWeight());\n }\n // Sorts the ArrayList based on weight score\n Collections.sort(recipeDataList, new Comparator<Match>() {\n @Override\n public int compare(Match recipe1, Match recipe2) {\n return Float.compare( recipe2.getWeight(),recipe1.getWeight());\n }\n });\n }", "private List<ConceptMinimal> getConceptMinimalList(String id, Terminology terminology)\n throws JsonMappingException, JsonProcessingException {\n Optional<ElasticObject> esObject = getElasticObject(id, terminology);\n if (!esObject.isPresent()) {\n return Collections.<ConceptMinimal> emptyList();\n }\n\n return esObject.get().getConceptMinimals();\n }", "public void sortChart() {\n\t\tPassengerTrain temp;\n\t\tGoodsTrain temp1;\n\n\t\tfor (int index = 0; index < TrainDetails.passengerList.size(); index++) {\n\t\t\tfor (int i = 0; i < TrainDetails.passengerList.size(); i++) {\n\t\t\t\tdouble totalTime1 = ((TrainDetails.passengerList).get(index).duration);\n\t\t\t\tdouble totalTime2 = (TrainDetails.passengerList.get(i).duration);\n\t\t\t\tif (totalTime1 < totalTime2) {\n\t\t\t\t\ttemp = TrainDetails.passengerList.get(index);\n\t\t\t\t\tTrainDetails.passengerList.set(index,\n\t\t\t\t\t\t\tTrainDetails.passengerList.get(i));\n\t\t\t\t\tTrainDetails.passengerList.set(i, temp);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (int index = 0; index < TrainDetails.goodsList.size(); index++) {\n\t\t\tfor (int i = 0; i < TrainDetails.goodsList.size(); i++) {\n\t\t\t\tdouble totalTime1 = ((TrainDetails.goodsList).get(index).duration);\n\t\t\t\tdouble totalTime2 = (TrainDetails.goodsList.get(i).duration);\n\t\t\t\tif (totalTime1 < totalTime2) {\n\t\t\t\t\ttemp1 = TrainDetails.goodsList.get(index);\n\t\t\t\t\tTrainDetails.goodsList.set(index,\n\t\t\t\t\t\t\tTrainDetails.goodsList.get(i));\n\t\t\t\t\tTrainDetails.goodsList.set(i, temp1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "public void sort(){\n ArrayList<Card> sortedCards = new ArrayList<Card>();\n ArrayList<Card> reds = new ArrayList<Card>();\n ArrayList<Card> yellows = new ArrayList<Card>();\n ArrayList<Card> greens = new ArrayList<Card>();\n ArrayList<Card> blues = new ArrayList<Card>();\n ArrayList<Card> specials = new ArrayList<Card>();\n for(int i = 0; i < cards.size(); i++){\n if(cards.get(i).getColor() == RED){\n reds.add(cards.get(i));\n }else if(cards.get(i).getColor() == YELLOW){\n yellows.add(cards.get(i));\n }else if(cards.get(i).getColor() == GREEN){\n greens.add(cards.get(i));\n }else if(cards.get(i).getColor() == BLUE){\n blues.add(cards.get(i));\n }else if(cards.get(i).getColor() == ALL){\n specials.add(cards.get(i));\n }\n }\n cards = new ArrayList<Card>();\n for(Card c: reds){\n sortedCards.add(c);\n }\n for(Card c: yellows){\n sortedCards.add(c);\n }\n for(Card c: greens){\n sortedCards.add(c);\n }\n for(Card c: blues){\n sortedCards.add(c);\n }\n for(Card c: specials){\n sortedCards.add(c);\n }\n for(Card c: sortedCards){\n cards.add(c);\n }\n }", "@Test\n public void testFail(){\n List<StoryPart> storyParts = new ArrayList<>();\n StoryPart a = new StoryPart(LocalTime.of(0, 2), null, null, StoryEvent.HALF_TIME_A_END, StoryTitle.create(\"halftime 1 end\"),\n StoryDescription.create(\"halftime 2 end\"));\n StoryPart b = new StoryPart(LocalTime.of(0, 3), null, GameMinute.create(\"2.\"), StoryEvent.GOAL, StoryTitle.create(\"Goal 2\"),\n StoryDescription.create(\"goal 2\"));\n StoryPart c = new StoryPart(LocalTime.of(0, 1), null, GameMinute.create(\"1.\"), StoryEvent.YELLOW_CARD,\n StoryTitle.create(\"yellow card 1\"), StoryDescription.create(\"yellow card 1\"));\n storyParts.add(a);\n storyParts.add(b);\n storyParts.add(c);\n\n Collections.shuffle(storyParts);\n storyParts.sort(new StoryPartTimeLineComparator());\n List<StoryPart> sortA = new ArrayList<>(storyParts);\n Collections.shuffle(storyParts);\n storyParts.sort(new StoryPartTimeLineComparator());\n List<StoryPart> sortB = new ArrayList<>(storyParts);\n Collections.shuffle(storyParts);\n storyParts.sort(new StoryPartTimeLineComparator());\n List<StoryPart> sortC = new ArrayList<>(storyParts);\n\n assertEquals(sortA.get(0), sortB.get(0));\n assertEquals(sortA.get(0), sortC.get(0));\n\n assertEquals(sortA.get(1), sortB.get(1));\n assertEquals(sortA.get(1), sortC.get(1));\n\n assertEquals(sortA.get(2), sortB.get(2));\n assertEquals(sortA.get(2), sortC.get(2));\n\n }", "public void sortRegions(List<Mdr13Record> list) {\n \t\tSort sort = getConfig().getSort();\n \t\tList<SortKey<Mdr13Record>> keys = new ArrayList<SortKey<Mdr13Record>>();\n \t\tfor (Mdr13Record reg : list) {\n \t\t\tSortKey<Mdr13Record> key = sort.createSortKey(reg, reg.getName(), reg.getMapIndex());\n \t\t\tkeys.add(key);\n \t\t}\n \n \t\tCollections.sort(keys);\n \n \t\tString lastName = \"\";\n \t\tint record = 0;\n \t\tMdr28Record mdr28 = null;\n \t\tfor (SortKey<Mdr13Record> key : keys) {\n \t\t\trecord++;\n \t\t\tMdr13Record reg = key.getObject();\n \n \t\t\t// If this is new name, then create a mdr28 record for it. This\n \t\t\t// will be further filled in when the other sections are prepared.\n \t\t\tString name = reg.getName();\n \t\t\tif (!name.equals(lastName)) {\n \t\t\t\tmdr28 = new Mdr28Record();\n \t\t\t\tmdr28.setName(name);\n \t\t\t\tmdr28.setStrOffset(reg.getStrOffset());\n \t\t\t\tmdr28.setMdr14(reg.getMdr14());\n \t\t\t\tmdr28.setMdr23(record);\n\t\t\t\tlastName = name;\n \t\t\t}\n \n \t\t\tassert mdr28 != null;\n \t\t\treg.setMdr28(mdr28);\n \n\t\t\tregions.add(reg);\n \t\t}\n \t}", "private static void SortHash(HashMap<String,ArrayList<input>> hashMap,Distribution list)\n\t{\n\t\tCollections.sort(list.First, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Second, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Third, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Fourth, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Fifth, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.reverse(list.First);\n\t\tCollections.reverse(list.Second);\n\t\tCollections.reverse(list.Third);\n\t\tCollections.reverse(list.Fourth);\n\t\tCollections.reverse(list.Fifth);\n\t\tputInHashMap(hashMap,list);\n\t}", "public void sort() {\n /*int jokers = this.getJokers();\n\t\tif (jokers > 0 && this.size() > 2) {\n\t\t\tArrayList<Tile> list = new ArrayList<>();\n for (int i=0; i<this.size(); i++) {\n\t\t\t\tif (this.get(i).getColour() == 'J') {\n\t\t\t\t\tTile joker = this.remove(this.get(i));\n\t\t\t\t\tlist.add(joker);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (Tile j : list) {\n\t\t\t\tthis.addInSort(j);\n\t\t\t}\n }*/\n \n\n //may need something in here to accomodate a joker changing its form\n\n if (tiles.size() > 1) { //will only sort a meld with any tiles in it\n //Override default comparator to compare by tile value (ints)\n Collections.sort(tiles, new Comparator<Tile>() {\n @Override \n public int compare(Tile t1, Tile t2) { \n if (t1.getColour() > t2.getColour()) {\n return 1;\n } else if (t1.getColour() < t2.getColour()) {\n return -1;\n }\n if (t1.getValue() > t2.getValue()) {\n return 1;\n } else if (t1.getValue() < t2.getValue()) {\n return -1;\n } else {\n return 0;\n }\n }\n });\n }\n\n }", "public List<Equipment> sortByEquipmentWeight(){\n List<Equipment> sortedEquipment = equipment;\n Collections.sort(sortedEquipment);\n return sortedEquipment;\n }", "public void sortByAndser() {\r\n\t\tQuestion[][] question2DArray = new Question[displayingList.size()][];\r\n\t\tfor (int i = 0; i < displayingList.size(); i++) {\r\n\t\t\tquestion2DArray[i] = new Question[1];\r\n\t\t\tquestion2DArray[i][0] = displayingList.get(i);\r\n\t\t}\r\n\r\n\t\twhile (question2DArray.length != 1) {\r\n\t\t\tquestion2DArray = (Question[][]) merge2DArray(question2DArray);\r\n\t\t}\r\n\t\tdisplayingList.removeAll(displayingList);\r\n\t\tfor (int i = 0; i < question2DArray[0].length; i++) {\r\n\t\t\tdisplayingList.add(question2DArray[0][i]);\r\n\t\t}\r\n\t}", "public void sortDescriptors() {\n\n XMLFieldDescriptor fieldDesc = null;\n NodeType nodeType = null;\n\n List remove = new List(3);\n for (int i = 0; i < attributeDescriptors.size(); i++) {\n fieldDesc = (XMLFieldDescriptor)attributeDescriptors.get(i);\n switch (fieldDesc.getNodeType().getType()) {\n case NodeType.ELEMENT:\n elementDescriptors.add(fieldDesc);\n remove.add(fieldDesc);\n break;\n case NodeType.TEXT:\n remove.add(fieldDesc);\n break;\n default:\n break;\n }\n }\n for (int i = 0; i < remove.size(); i++)\n attributeDescriptors.remove(remove.get(i));\n\n remove.clear();\n for (int i = 0; i < elementDescriptors.size(); i++) {\n fieldDesc = (XMLFieldDescriptor)elementDescriptors.get(i);\n switch (fieldDesc.getNodeType().getType()) {\n case NodeType.ATTRIBUTE:\n attributeDescriptors.add(fieldDesc);\n remove.add(fieldDesc);\n break;\n case NodeType.TEXT:\n remove.add(fieldDesc);\n break;\n default:\n break;\n }\n }\n for (int i = 0; i < remove.size(); i++)\n elementDescriptors.remove(remove.get(i));\n\n }", "void sort() {\n\t//\t... fill this in ...\n\t//how do I get teh next item? where is the reader in the interface that returns the next item??? \n\tif (sorter==null || sorter.nextItem()==false) \n\treturn ;\n\t while(sorter.nextItem())\n\t {\n\t /*Red, if the decoration is more than 35% red\nGreen, if the decoration is more than 30% green\nReject, if the decoration is both more than 35% red and 30% green - these are just too \"loud\". \n*/\n\t //ScannerAndSorter item=sorter.read();\n\t if (sorter.redPercentage()>35.00)\n\t if (sorter.greenPercentage()>30)\n\t sorter.reject();\n\t else\n\t sorter.sendToRed();\n\t else if (sorter.greenPercentage()>30)\n\t sorter.sendToGreen();\n\t }\n\t \n\t}", "public void sortMatches();", "public void testArtistSort() {\n sorter.inssortArtist();\n list = sorter.getLibrary();\n assertEquals(list.get(0).getArtist(), \"Hayley\");\n assertEquals(list.get(1).getArtist(), \"James\");\n assertEquals(list.get(2).getArtist(), \"Jason\");\n }", "public static void sortitems(ArrayList<item> svd)\n\t{\n\t\tCollections.sort(svd, new Comparator<item>(){\n\t\t public int compare(item o1, item o2){\n\t\t if(o1.density == o2.density)\n\t\t return 0;\n\t\t return o1.density > o2.density ? -1 : 1;\n\t\t }\n\t\t});\n\t\t\n\t\t\n\t}", "public void sortAuthor(){\r\n \r\n Book temp; // used for swapping books in the array\r\n for(int i=0; i<items.size(); i++) {\r\n\r\n\t // Check to see the item is a book. We will only\r\n //use books.\r\n\t if(items.get(i).getItemType() != Item.ItemTypes.BOOK)\r\n\t continue;\r\n\t\t\t\t\t\r\n\t for(int j=i+1; j<items.size(); j++) {\r\n\t\t // We consider only books\r\n\t // We consider only magazines\r\n\t if(items.get(j).getItemType() != Item.ItemTypes.BOOK)\r\n\t\t continue;\r\n\t\t // Compare the authors of the two books\r\n\t if(((Book)items.get(i)).getAuthor().compareTo(((Book)items.get(j)).getAuthor()) > 0) {\r\n\t\t // Swap the items\r\n\t\t temp = (Book)items.get(i);\r\n\t\t items.remove(i);\r\n\t\t items.add(i, items.get(j-1));\r\n\t\t items.remove(j);\r\n\t\t items.add(j, temp);\r\n\t }\r\n\t }\r\n\t }\r\n\t\t// Print the magazines\r\n for(int i=0; i<items.size(); i++)\r\n\t if(items.get(i).getItemType() == Item.ItemTypes.BOOK)\r\n\t\tSystem.out.println(items.get(i).toString());\r\n \t\r\n }", "@Test\n public void testSortVariantConsequenceDict() {\n final Map<String, Set<String>> before = new HashMap<>();\n SVAnnotateEngine.updateVariantConsequenceDict(before, GATKSVVCFConstants.LOF, \"NOC2L\");\n SVAnnotateEngine.updateVariantConsequenceDict(before, GATKSVVCFConstants.LOF, \"KLHL17\");\n SVAnnotateEngine.updateVariantConsequenceDict(before, GATKSVVCFConstants.LOF, \"PLEKHN1\");\n SVAnnotateEngine.updateVariantConsequenceDict(before, GATKSVVCFConstants.LOF, \"PERM1\");\n SVAnnotateEngine.updateVariantConsequenceDict(before, GATKSVVCFConstants.DUP_PARTIAL, \"SAMD11\");\n SVAnnotateEngine.updateVariantConsequenceDict(before, GATKSVVCFConstants.LOF, \"HES4\");\n SVAnnotateEngine.updateVariantConsequenceDict(before, GATKSVVCFConstants.TSS_DUP, \"ISG15\");\n\n final Map<String, Object> expectedAfter = new HashMap<>();\n expectedAfter.put(GATKSVVCFConstants.DUP_PARTIAL, Arrays.asList(\"SAMD11\"));\n expectedAfter.put(GATKSVVCFConstants.TSS_DUP, Arrays.asList(\"ISG15\"));\n expectedAfter.put(GATKSVVCFConstants.LOF, Arrays.asList(\"HES4\", \"KLHL17\", \"NOC2L\", \"PERM1\", \"PLEKHN1\"));\n\n Assert.assertEquals(SVAnnotateEngine.sortVariantConsequenceDict(before), expectedAfter);\n }", "public static void main(String[] args) {\n\t\tShirt r = new Shirt(\"Red\", 10);\r\n\t\tShirt b = new Shirt(\"Blue\", 465);\r\n\t\tShirt g = new Shirt(\"Green\", 3213456);\r\n\t\t// Creates some custom comparator object.\r\n\t\tSizeComp s = new SizeComp();\r\n\t\tColorComp c = new ColorComp();\r\n\t\t// Creates some tree sets using custom comparator. \r\n\t\tTreeSet<Shirt> mySizeSet = new TreeSet<>(s);\r\n\t\tmySizeSet.add(r);\r\n\t\tmySizeSet.add(g);\r\n\t\tmySizeSet.add(b);\r\n\t\tout.println(\"Sort by Size\");\r\n\t\tout.println(mySizeSet);\r\n\t\t\r\n\t\tTreeSet<Shirt> myCompSet = new TreeSet<>(c);\r\n\t\tmyCompSet.add(r);\r\n\t\tmyCompSet.add(g);\r\n\t\tmyCompSet.add(b);\r\n\t\tout.println(\"Sort by Color\");\r\n\t\tout.println(myCompSet);\r\n\t}", "public void sort_crystals() {\n\t\tArrays.sort(identifiedArray, new SortByRating()); \n\t}", "public void sortCompetitors(Athletes[] competitors){\n\t\tArrays.sort(competitors, new Comparator<Athletes>(){\n\t\t\tpublic int compare(Athletes ath1, Athletes ath2) {\n\t\t\t\tif (ath1 == null && ath2 == null) {\n\t return 0;\n\t }\n\t if (ath1 == null) {\n\t return 1;\n\t }\n\t if (ath2 == null) {\n\t return -1;\n\t }\n\t return ath1.compareTo(ath2);\n\t\t\t}});\n\t}", "public void sortToDo(){\n\t\tCollections.sort(allToDoLists);\n\t}", "public DynamicPart[] sortParts(DynamicPart[] parts) {\n Arrays.sort(parts, (DynamicPart a, DynamicPart b) -> {\n return a.dynamic.ordinal() - b.dynamic.ordinal();\n });\n return parts;\n }" ]
[ "0.7084605", "0.62652874", "0.53187037", "0.5162626", "0.5152054", "0.508789", "0.4973391", "0.49361765", "0.488646", "0.48667815", "0.48447508", "0.48097667", "0.47842604", "0.47695136", "0.4767664", "0.4751956", "0.47359872", "0.4705836", "0.47043777", "0.4695951", "0.46819243", "0.4666584", "0.4655059", "0.46507177", "0.46356326", "0.46276352", "0.46236023", "0.46021825", "0.45975122", "0.45901713", "0.45811185", "0.45811126", "0.45806947", "0.45756316", "0.4563398", "0.45508537", "0.45247233", "0.4515835", "0.45086053", "0.45045283", "0.4503399", "0.4499035", "0.44844115", "0.44813833", "0.44775122", "0.44632354", "0.44596744", "0.4457742", "0.445061", "0.44464907", "0.44326824", "0.44229192", "0.44223428", "0.4421568", "0.4421335", "0.44197127", "0.44178963", "0.44103903", "0.44091296", "0.44089225", "0.4406312", "0.4405203", "0.44001633", "0.43934995", "0.4370656", "0.43694857", "0.4360679", "0.43585238", "0.43522835", "0.4351148", "0.43503976", "0.43455443", "0.4340974", "0.43392023", "0.43306923", "0.4326264", "0.4301779", "0.4295865", "0.42946568", "0.42901498", "0.4283539", "0.4268692", "0.42680797", "0.42680404", "0.4261654", "0.42589152", "0.425867", "0.42571387", "0.42401877", "0.42385864", "0.423653", "0.42364693", "0.42347348", "0.42315894", "0.4231522", "0.42293355", "0.4224059", "0.42233586", "0.42214158", "0.42204309" ]
0.77176017
0
Given a list of concepts, sorts them in the same order as the list of antiretrovirals (All nonantiretrovirals are ignored)
public static List<Concept> sortAntiretrovirals(List<Concept> drugs) { return MdrtbUtil.sortDrugs(drugs, Context.getService(MdrtbService.class).getAntiretrovirals()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sortKnowledgeBase()\n {\n int i;\n Random random;\n String aPredicate;\n StringTokenizer tokenizer;\n //------------\n random = new Random();\n i = 0;\n while (i < knowledgeBase.size())\n {\n aPredicate = knowledgeBase.get(i).commitments.get(0).predicate;\n tokenizer = new StringTokenizer(aPredicate,\"(), \");\n if(tokenizer.nextToken().equals(\"secuencia\"))\n knowledgeBase.get(i).priority = random.nextInt(100);\n //end if\n else\n knowledgeBase.get(i).priority = random.nextInt(10000);\n //end else\n i = i + 1;\n }//end while\n Collections.sort(knowledgeBase);\n }", "private void sortEntities(){\n for (int i = 1; i < sorted.size; i++) {\n for(int j = i ; j > 0 ; j--){\n \tEntity e1 = sorted.get(j);\n \tEntity e2 = sorted.get(j-1);\n if(getRL(e1) < getRL(e2)){\n sorted.set(j, e2);\n sorted.set(j-1, e1);\n }\n }\n }\n }", "private List<Article> orderArticles(List<Article> things){\n\t\t Comparator<Article> comparatorPrizes = new Comparator<Article>() {\n\t public int compare(Article x, Article y) {\n\t return (int) (x.getPrize() - y.getPrize());\n\t }\n\t };\n\t Collections.sort(things,comparatorPrizes); \n\t Collections.reverse(things);\n\t return things;\n\t }", "public void sort(){\n Collections.sort(list, new SortBySpecies());\n }", "public void sortCompetitors(){\n\t\t}", "private static void sortByVerified( ArrayList<Volunteer> list)\n {\n // Find the string reference that should go in each cell of\n // the array, from cell 0 to the end\n for ( int j = 0; j < list.size();j++ )\n {\n // Find min: the index of the string reference that should go into cell j.\n // Look through the unsorted strings (those at j or higher) for the one that is first in lexicographic order\n int min = j;\n for ( int k=j+1; k < list.size(); k++ ) {\n if (list.get(k).compareTo(list.get(min)) > 0) {\n min = k;\n }\n\n }\n\n // Swap the reference at j with the reference at min\n Collections.swap(list, j, min);\n }\n }", "public static List<Concept> sortDrugs(List<Concept> drugsToSort, List<Concept> drugList) {\r\n \tList<Concept> sortedDrugs = new LinkedList<Concept>();\r\n \t\r\n \tfor (Concept drug : drugList) {\r\n \t\tif (drugsToSort.contains(drug)) {\r\n \t\t\tsortedDrugs.add(drug);\r\n \t\t}\r\n \t}\r\n \t\r\n \treturn sortedDrugs;\r\n }", "public void step3(){\n\n Collections.sort(names,(String a, String b) -> a.compareTo(b));\n }", "private List<Atom> sortAtoms(List<Atom> atoms) {\n\t\tfinal Set<SortingBodyComponent> components = new LinkedHashSet<>();\n\t\tfinal Set<ExternalAtom> builtinAtoms = new LinkedHashSet<>();\n\t\tfinal Set<IntervalAtom> intervalAtoms = new LinkedHashSet<>();\n\n\t\tfor (Atom atom : atoms) {\n\t\t\t// FIXME: The following case assumes that builtin predicates do not create bindings?!\n\t\t\tif (atom.getPredicate() instanceof BuiltinBiPredicate) {\n\t\t\t\t// Sort out builtin atoms (we consider them as not creating new bindings)\n\t\t\t\tbuiltinAtoms.add((ExternalAtom) atom);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (atom instanceof IntervalAtom) {\n\t\t\t\tintervalAtoms.add((IntervalAtom) atom);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfinal Set<SortingBodyComponent> hits = new LinkedHashSet<>();\n\n\t\t\t// For each variable\n\t\t\tfor (VariableTerm variableTerm : atom.getBindingVariables()) {\n\t\t\t\t// Find all components it also occurs and record in hitting components\n\t\t\t\tfor (SortingBodyComponent component : components) {\n\t\t\t\t\tif (component.occurringVariables.contains(variableTerm)) {\n\t\t\t\t\t\thits.add(component);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If no components were hit, create new component, else merge components\n\t\t\tif (hits.isEmpty()) {\n\t\t\t\tcomponents.add(new SortingBodyComponent(atom));\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If only one component hit, add atom to it\n\t\t\tif (hits.size() == 1) {\n\t\t\t\thits.iterator().next().add(atom);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Merge all components that are hit by the current atom\n\t\t\tSortingBodyComponent firstComponent = hits.iterator().next();\n\t\t\tfirstComponent.add(atom);\n\t\t\tfor (SortingBodyComponent hitComponent : hits) {\n\t\t\t\tif (hitComponent != firstComponent) {\n\t\t\t\t\tfirstComponent.merge(hitComponent);\n\t\t\t\t\t// Remove merged component from the set of available components\n\t\t\t\t\tcomponents.remove(hitComponent);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Components now contains all components that are internally connected but not connected to another component\n\t\tList<Atom> sortedPositiveBodyAtoms = new ArrayList<>(components.size());\n\t\tfor (SortingBodyComponent component : components) {\n\t\t\tsortedPositiveBodyAtoms.addAll(component.atomSequence);\n\t\t}\n\n\t\tsortedPositiveBodyAtoms.addAll(intervalAtoms); // Put interval atoms after positive literals generating their bindings and before builtin atom.\n\t\tsortedPositiveBodyAtoms.addAll(builtinAtoms);\t// Put builtin atoms after positive literals and before negative ones.\n\t\treturn sortedPositiveBodyAtoms;\n\t}", "private void processConcepts(Collection<ReportConcept> concepts) {\n\t\t// compact concept list until it stops changing size\n\t\tint previousSize = 0;\n\t\twhile (concepts.size() != previousSize) {\n\t\t\tpreviousSize = concepts.size();\n\t\t\tList<ReportConcept> list = new ArrayList<ReportConcept>(concepts);\n\t\t\tReportConcept previous = list.get(0);\n\t\t\tfor(int i=1;i<list.size();i++){\n\t\t\t\tReportConcept entry = list.get(i);\n\t\t\t\tReportConcept next = ((i+1)<list.size())?list.get(i+1):null;\n\t\t\t\t\n\t\t\t\t// see if we can find a common concept for three entries\n\t\t\t\tReportConcept common = null;\n\t\t\t\tif(next != null)\n\t\t\t\t\tcommon = mergeConcepts(previous, entry, next,concepts);\n\t\t\t\t// if no luck try merge 2 \n\t\t\t\tif(common == null)\n\t\t\t\t\tcommon = mergeConcepts(previous, entry,concepts);\n\t\t\t\t\n\t\t\t\t// if common concept found, then make it a previous concept\n\t\t\t\tif (common != null) \n\t\t\t\t\tentry = common;\n\t\t\t\tprevious = entry;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public static List<Concept> sortMdrtbDrugs(List<Concept> drugs) {\r\n \treturn MdrtbUtil.sortDrugs(drugs, Context.getService(MdrtbService.class).getMdrtbDrugs());\r\n }", "public static <T extends Comparable <? super T>> void mysterySort3(List <T> list){\r\n\t\twhile (!isSorted(list)){ // O(n)\r\n\t\t\tCollections.shuffle(list); //O(n)\r\n\t\t}\r\n\t}", "public void sortElements(Comparator<TLProperty> comparator);", "private void sort()\n {\n // This implements Shell sort.\n // Unfortunately we cannot use the sorting functions from the library\n // (e.g. java.util.Arrays.sort), since the ones that work on int\n // arrays do not accept a comparison function, but only allow\n // sorting into natural order.\n int jump = length;\n boolean done;\n \n while( jump>1 ){\n jump /= 2;\n \n do {\n done = true;\n \n for( int j = 0; j<(length-jump); j++ ){\n int i = j + jump;\n \n if( !areCorrectlyOrdered( indices[j], indices[i] ) ){\n // Things are in the wrong order, swap them and step back.\n int tmp = indices[i];\n indices[i] = indices[j];\n indices[j] = tmp;\n done = false;\n }\n }\n } while( !done );\n }\n \n // TODO: integrate this with the stuff above.\n for( int i=1; i<length; i++ ){\n commonality[i] = commonLength( indices[i-1], indices[i] );\n }\n commonality[0] = -1;\n }", "public void sort_crystals() {\n\t\tArrays.sort(identifiedArray, new SortByRating()); \n\t}", "private void sortMedApts(List<MedicationAppointment> medApts2) {\n \t}", "public void sortManlist(){\r\n\t\tCollections.sort(Manlist, new MySort());\r\n\t}", "protected void sortResources()\n {\n PriorityComparator priorityComparator = new PriorityComparator();\n List<Resource> resources = getResources();\n Collections.sort(resources, priorityComparator);\n }", "public static void main(String[] args) {\n\r\n\t\tList<Library> list=new ArrayList<Library>();\r\n\t\tlist.add(new Library(100, \"bhagyesh\"));\r\n\t\tlist.add(new Library(4, \"patel\"));\r\n\t\tlist.add(new Library(5, \"sid\"));\r\n\t\tlist.add(new Library(78, \"naitik\"));\r\n\t\tlist.add(new Library(39, \"amit\"));\r\n\t\t\r\n \tlist.stream().forEach(p -> System.out.println(p.getName()));\r\n \tlist.sort(Comparator.comparing(Library::getName));\r\n \tlist.stream().forEach(p -> System.out.println(p.getName()));\r\n \r\n \t\r\n \t\r\n \t\r\n\t}", "public static <T extends Comparable <? super T>> void mysterySort1(List <T> list){\r\n\t\tfor (int i = 1; i < list.size(); i++){ //n\r\n\t\t\tint j = i; //1\r\n\t\t\t\r\n\t\t\t//list.get => O(1)\r\n\t\t\t\r\n\t\t\twhile (j > 0 && list.get(j - 1).compareTo(list.get(j)) > 0){ //\r\n\t\t\t\tswap(list, j, j - 1); //O(1)\r\n\t\t\t\tj --;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void sortDialects()\n\t{\n\t\tif (dialects.size() > 1)\n\t\t{\n\t\t\tCollections.sort(dialects, new Comparator<RestDynamicSemanticVersion>()\n\t\t\t{\n\t\t\t\t@Override\n\t\t\t\tpublic int compare(RestDynamicSemanticVersion o1, RestDynamicSemanticVersion o2)\n\t\t\t\t{\n\t\t\t\t\t//This is a semantic with a single nid column, which represents preferred or acceptable. \n\t\t\t\t\t//The assemblage concept will be something like \"US English Dialect\"\n\t\t\t\t\t\n\t\t\t\t\t//If preferred / acceptable is the same, sort on the dialects...\n\t\t\t\t\tif (((RestDynamicSemanticNid)o1.dataColumns.get(0)).getNid() == ((RestDynamicSemanticNid)o2.dataColumns.get(0)).getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (o1.semanticChronology != null) //If one chronology is here, they both should be here\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (o1.semanticChronology.assemblage.nid.intValue() == MetaData.US_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o2.semanticChronology.assemblage.nid.intValue() == MetaData.US_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o1.semanticChronology.assemblage.nid.intValue() == MetaData.GB_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (o2.semanticChronology.assemblage.nid.intValue() == MetaData.GB_ENGLISH_DIALECT____SOLOR.getNid())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn 1;\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//Some other dialect... just sort on the dialect text\n\t\t\t\t\t\t\t\treturn AlphanumComparator.compare(Util.readBestDescription(o1.semanticChronology.assemblage.nid),\n\t\t\t\t\t\t\t\t\t\tUtil.readBestDescription(o2.semanticChronology.assemblage.nid), true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//If chronology isn't populated, I can't sort here\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (((RestDynamicSemanticNid)o1.dataColumns.get(0)).getNid() == MetaData.PREFERRED____SOLOR.getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t}\n\t\t\t\t\telse if (((RestDynamicSemanticNid)o2.dataColumns.get(0)).getNid() == MetaData.PREFERRED____SOLOR.getNid())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//should be impossible - not the same, and neither is preferred - must be invalid data.\n\t\t\t\t\t\tLogManager.getLogger().warn(\"Unexpected sort case\");\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "public void sortCompetitors(Athletes[] competitors){\n\t\tArrays.sort(competitors, new Comparator<Athletes>(){\n\t\t\tpublic int compare(Athletes ath1, Athletes ath2) {\n\t\t\t\tif (ath1 == null && ath2 == null) {\n\t return 0;\n\t }\n\t if (ath1 == null) {\n\t return 1;\n\t }\n\t if (ath2 == null) {\n\t return -1;\n\t }\n\t return ath1.compareTo(ath2);\n\t\t\t}});\n\t}", "public void triCollection(){\r\n Collections.sort(collection);\r\n }", "protected void sort() {\n\n\t\tCollections.sort(this.myRRList);\n\t}", "private List<PricingRule> orderPricingRules(Set<PricingRule> pricingRules) {\n \tList<PricingRule> pricingRulesList = pricingRules.stream().collect(Collectors.toList());\n \tCollections.sort(pricingRulesList, new Comparator<PricingRule>() {\n\t\t\tpublic int compare(PricingRule o1, PricingRule o2) {\n\t\t\t\treturn ((o2.getClass().getAnnotation(PricingRuleOrder.class).value()) - (o1.getClass().getAnnotation(PricingRuleOrder.class).value()));\n\t\t\t}\n\t\t});\n\t\treturn pricingRulesList;\n }", "public static void main(String[] args) {\n\t\tList<String> alist = new ArrayList<>();\n\t\talist.add(\"Virat\");\n\t\talist.add(\"ganesh\");\n\t\talist.add(\"Amol\");\n\t\talist.add(\"Ritesh\");\n\t\talist.add(\"deva\");\n\t\talist.add(\"sachin\");\n\t\talist.add(\"Xavier\");\n\t\t\n\t\tSystem.out.println(\"Arraylist before sorting: \");\n\t\tSystem.out.println(alist);\n\t\t\n\t\t//Collections.sort(alist);\n\t\tCollections.sort(alist,String.CASE_INSENSITIVE_ORDER);\n\t\t\n\t\tSystem.out.println(\"Arraylist after sorting: \");\n\t\tSystem.out.println(alist);\n\t\t\n\t\t\t\t\n\n\t}", "public void sortMatches();", "public static void sortCompilationProposal(List<ICompletionProposal> prop){\r\n\t\tCollections.sort(prop,new Comparator<ICompletionProposal>(){\r\n\t\t\tpublic int compare(ICompletionProposal o1, ICompletionProposal o2){\r\n\t\t\t\treturn o1.getDisplayString().compareTo(o2.getDisplayString());\r\n\t\t\t}\r\n\t\t});\r\n\t}", "public void sortDNAs() {\n DNAs = TLArrayList.sort(DNAs);\n }", "public static void main(String[] args) {\n\t\tList<String> animal = new ArrayList<String>();\n\n\t\tanimal.add(\"Cat\");\n\t\tanimal.add(\"Mouse\");\n\t\tanimal.add(\"Lion\");\n\t\tanimal.add(\"Zeebra\");\n\t\tanimal.add(\"Bear\");\n\t\tanimal.add(\"Deer\");\n\n\t\t// Collections.sort(animal,new StringLengthComparator());\n\n\t\tCollections.sort(animal, new ReverseAlphabeticalComparator());\n\t\tfor (String animal1 : animal) {\n\n\t\t\tSystem.out.println(animal1);\n\t\t}\n\n\t\t/////////////////////////////// Sorting Numbers ////////////////////////////////\n\t\tList<Integer> numbers = new ArrayList<Integer>();\n\n\t\tnumbers.add(5);\n\t\tnumbers.add(31);\n\t\tnumbers.add(16);\n\t\tnumbers.add(605);\n\t\tnumbers.add(15);\n\n\t\tCollections.sort(numbers, new Comparator<Integer>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(Integer num1, Integer num2) {\n\n\t\t\t\treturn -num1.compareTo(num2);\n\t\t\t}\n\n\t\t});\n\n\t\tfor (Integer num1 : numbers) {\n\n\t\t\tSystem.out.println(num1);\n\t\t}\n\t\t///////////////////////////// Sorting Arbitrary Objects ////////////////////////////\n\n\t\tList<Person> people = new ArrayList<Person>();\n\n\t\tpeople.add(new Person(3, \"Ajeer\"));\n\t\tpeople.add(new Person(1, \"Sudeer\"));\n\t\tpeople.add(new Person(2, \"Sureash\"));\n\t\tpeople.add(new Person(4, \"Sam\"));\n\t\t\n\t\t// Sort in Order of ID\n\t\tCollections.sort(people, new Comparator<Person>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(Person p1, Person p2) {\n\t\t\t\tif (p1.getId() > p2.getId()) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\telse if (p1.getId()< p2.getId()) {\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t});\n\t\tfor (Person person1 : people) {\n\n\t\t\tSystem.out.println(person1);\n\t\t}\n\t\tSystem.out.println(\"\\n\");\n\t\t// Sort In Order of NAME....\n\t\tCollections.sort(people, new Comparator<Person>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(Person p1, Person p2) {\n\t\t\t\n\t\t\t\treturn p1.getName().compareTo(p2.getName());\n\t\t\t}\n\t\t});\n\t\tfor (Person person1 : people) {\n\n\t\t\tSystem.out.println(person1);\n\t\t}\n\t}", "public static List<String> sortDNA(List<String> DNA) {\n\t\tfor(int i = 0; i < DNA.size(); i++) {\n\t\t\tint shortest = i;\n\t\t\tfor(int j = i + 1; j < DNA.size(); j++) {\n\t\t\t\tif(DNA.get(j).length() < DNA.get(i).length()) {\n\t\t\t\t\tshortest = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tString switching = DNA.get(shortest);\n\t\t\tDNA.set(shortest, DNA.get(i));\n\t\t\tDNA.set(i, switching);\n\t\t}\n\t\treturn DNA;\n\t}", "public static Object sortDNA(List<String> unsortedSequences) {\n\t\treturn null;\n\t}", "public List<String> prioritize(List<TestCase> tests, int typeOfTechnique) throws EmptySetOfTestCaseException{\n\t\tTechniqueCreator creator = new TechniqueCreator();\n\t\tTechnique technique = creator.create(typeOfTechnique);\n\t\treturn technique.prioritize(tests);\n\t}", "public void sortToDo(){\n\t\tCollections.sort(allToDoLists);\n\t}", "public void sortIntermediateNodes() {\n\t\tfor (FTNonLeafNode intermediateNode : intermediateNodes.values()) {\n\t\t\tdeclareBeforeUse(intermediateNode);\n\t\t}\n\t}", "public static void main(String[] args) {\n\n List<String> animals = new ArrayList <String>();\n\n animals.add(\"Elephatn\");\n animals.add(\"snake\");\n animals.add(\"Lion\");\n animals.add(\"Mongoose\");\n animals.add(\"Cat\");\n\n\n\n// Collections.sort(animals, new StringLengthComparator());\n// Collections.sort(animals, new AlphabeticalComparator());\n Collections.sort(animals, new ReverseAlphabeticalComparator());\n for(String animal:animals){\n System.out.println(animal);\n }\n\n//////////////Sorting Numbers ///////////\n List<Integer> numbers = new ArrayList <Integer>();\n\n numbers.add(54);\n numbers.add(1);\n numbers.add(36);\n numbers.add(73);\n numbers.add(9);\n\n Collections.sort(numbers, new Comparator <Integer>() {\n @Override\n public int compare(Integer num1, Integer num2) {\n return num1.compareTo(num2);\n }\n });\n\n for(Integer number: numbers){\n System.out.println(number);\n }\n\n\n///////////////Sorting Arbitrary objects////////\n\n\n List<Person> people = new ArrayList <Person>();\n\n people.add(new Person(1,\"Joe\"));\n people.add(new Person(5,\"Harry\"));\n people.add(new Person(2,\"Hermoine\"));\n people.add(new Person(4,\"Muffet\"));\n\n// Sort in order of ID\n Collections.sort(people, new Comparator <Person>() {\n @Override\n public int compare(Person p1, Person p2) {\n\n if(p1.getId()>p2.getId()){\n return 1;\n }else if(p1.getId()<p2.getId()){\n return -1;\n }\n return 0;\n\n }\n });\n\n\n // Sort in order of Name\n Collections.sort(people, new Comparator <Person>() {\n @Override\n public int compare(Person p1, Person p2) {\n\n return p1.getName().compareTo(p2.getName());\n\n\n }\n });\n\n for(Person person: people){\n System.out.println(person);\n\n }\n\n }", "private List<AccessTypeInjector> getAccessTypeOrderByPriority(boolean ascending) {\n List<AccessTypeInjector> list = new ArrayList<AccessTypeInjector>();\n for (AccessTypeInjector injector : accessTypeInjectors) {\n list.add(injector);\n }\n Collections.sort(list);\n if (!ascending) {\n Collections.reverse(list);\n }\n return list;\n }", "protected abstract void arrange(List<Skill> skills) throws SkillTreeException;", "@Override\n public void sortIt(final Comparable a[]) {\n }", "public void sortAuthority(List<Page> result) {\n\t\tCollections.sort(result, new Comparator<Page>() {\n\t\t\tpublic int compare(Page p1, Page p2) {\n\t\t\t\t// Sorts by 'TimeStarted' property\n\t\t\t\treturn p1.hub < p2.hub ? -1 : p1.hub > p2.hub ? 1 : secondaryOrderSort(p1, p2);\n\t\t\t}\n\n\t\t\t// If 'TimeStarted' property is equal sorts by 'TimeEnded' property\n\t\t\tpublic int secondaryOrderSort(Page p1, Page p2) {\n\t\t\t\treturn p1.getLocation().compareToIgnoreCase(p2.getLocation()) < 1 ? -1\n\t\t\t\t\t\t: p1.getLocation().compareToIgnoreCase(p2.getLocation()) > 1 ? 1 : 0;\n\t\t\t}\n\t\t});\n\t}", "public void sortVehicles() {\n\t\tCollections.sort(vehicles);\n\t\t\n\t}", "public static void main(String[] args) {\n sortGeneric list = new sortGeneric();\n list.add(100);\n list.add(7);\n list.add(6);\n list.add(20);\n list.add(1);\n list.add(15);\n System.out.print(\"trc khi sap xep : \");\n for (int i = 0; i < list.size(); i++) {\n System.out.print(list.get(i) + \" \");\n }\n System.out.println();\n list.sort();\n System.out.print(\"sau khi sap xep: \");\n for (int i = 0; i < list.size(); i++) {\n System.out.print(list.get(i) + \" \");\n }\n System.out.println();\n\n\n }", "private List<BeaconConcept> filterSemanticGroup(List<BeaconConcept> concepts, List<String> types) {\n\t\t\n\t\tif (types.isEmpty()) return concepts;\n\t\t\n\t\tPredicate<BeaconConcept> hasType = n -> !Collections.disjoint(types, n.getCategories());\n\t\tconcepts = Util.filter(hasType, concepts);\n\t\t\n\t\treturn concepts;\n\t}", "private void filterOverlap(List<Concept> concepts) {\n\t\t// go over concepts in\n\t\tSet<Concept> torem = new HashSet<Concept>();\n\t\tConcept p = null;\n\t\tfor(Concept c : concepts){\n\t\t\tif(p != null){\n\t\t\t\tif(c.getCode().equals(p.getCode())){\n\t\t\t\t\tif(c.getText() != null && c.getText().contains(p.getText())){\n\t\t\t\t\t\ttorem.add(p);\n\t\t\t\t\t}else if(p.getText() != null && p.getText().contains(c.getText())){\n\t\t\t\t\t\ttorem.add(c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tp = c;\n\t\t}\n\t\t\n\t\t// remove whatever\n\t\tfor (Concept r : torem) {\n\t\t\tfor (ListIterator<Concept> it = concepts.listIterator(); it.hasNext();) {\n\t\t\t\tConcept c = it.next();\n\t\t\t\tif (c.equals(r) && c.getText().equals(r.getText())) {\n\t\t\t\t\tit.remove();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void sort() {\n compares = 0;\n shuttlesort((int[]) indexes.clone(), indexes, 0, indexes.length);\n }", "@Override\n public void sort(List<T> items) {\n }", "private static void sortNoun() throws Exception{\r\n\t\tBufferedReader[] brArray = new BufferedReader[ actionNumber ];\r\n\t\tBufferedWriter[] bwArray = new BufferedWriter[ actionNumber ];\r\n\t\tString line = null;\r\n\t\tfor(int i = 0; i < actionNameArray.length; ++i){\r\n\t\t\tSystem.out.println(\"sorting for \" + actionNameArray[ i ]);\r\n\t\t\tbrArray[ i ] = new BufferedReader( new FileReader(TFIDF_URL + actionNameArray[ i ] + \".tfidf\"));\r\n\t\t\tHashMap<String, Double> nounTFIDFMap = new HashMap<String, Double>();\r\n\t\t\tint k = 0;\r\n\t\t\t// 1. Read tfidf data\r\n\t\t\twhile((line = brArray[ i ].readLine())!=null){\r\n\t\t\t\tnounTFIDFMap.put(nounList.get(k), Double.parseDouble(line));\r\n\t\t\t\tk++;\r\n\t\t\t}\r\n\t\t\tbrArray[ i ].close();\r\n\t\t\t// 2. Rank according to tfidf\r\n\t\t\tValueComparator bvc = new ValueComparator(nounTFIDFMap);\r\n\t\t\tTreeMap<String, Double> sortedMap = new TreeMap<String, Double>(bvc);\r\n\t\t\tsortedMap.putAll(nounTFIDFMap);\r\n\t\t\t\r\n\t\t\t// 3. Write to disk\r\n\t\t\tbwArray[ i ] = new BufferedWriter(new FileWriter( SORTED_URL + actionNameArray[ i ] + \".sorted\"));\r\n\t\t\tfor(String nounKey : sortedMap.keySet()){\r\n\t\t\t\tbwArray[ i ].append(nounKey + \"\\t\" + nounTFIDFMap.get(nounKey) + \"\\n\");\r\n\t\t\t}\r\n\t\t\tbwArray[ i ].close();\r\n\t\t}\r\n\t}", "public void sortAppointments() {\n reminders = sort(reminders);\n followup = sort(followup);\n }", "public void step4(){\n\n Collections.sort(names,(a,b)->b.compareTo(a));\n\n\n System.out.println(\"names sorted are :\"+names);\n }", "public void sort() {\r\n\t\tCollections.sort(parts);\r\n\t}", "private Rule[] sortRules(Rule[] rules){\n \t\t\n \t\tArrayList<Rule> temp = new ArrayList<Rule>();\n \t\t\n \t\tfor(int i = 0; i < rules.length; i++){\n \t\t\t\n \t\t\tif(!rules[i].isElseFilter()){\n \t\t\t\ttemp.add(rules[i]);\n \t\t\t}\n \t\t}\n \t\t\n \t\tfor(int i = 0; i < rules.length; i++){\n \t\t\t\n \t\t\tif(rules[i].isElseFilter()){\n \t\t\t\ttemp.add(rules[i]);\n \t\t\t}\n \t\t\t\n \t\t}\n \t\t\n \t\tRule[] newRules = new Rule[temp.size()];\t\t\n \t\treturn temp.toArray(newRules);\n \t}", "private void arrangeAttributes(List<IOutputAttribute> outputAttributesList,\r\n \t\tList<Object> list)\r\n {\r\n \tList<Object> oldList = new ArrayList<Object>();\r\n \toldList.addAll(list);\r\n \tfor(int counter = 0;counter < outputAttributesList.size();counter++)\r\n \t{\r\n \t\tAttributeInterface attribute = outputAttributesList.get(counter).getAttribute();\r\n \t\tString value = edu.wustl.query.util.global.Utility.getTagValue(attribute,Constants.TAGGED_VALUE_RESULTVIEW);\r\n \t\tif(attribute.getName().equals(Constants.ID)\r\n \t\t&& attribute.getEntity().getName().equals(Constants.MED_ENTITY_NAME))\r\n \t\t{\r\n \t\t\tString conceptName = \"\";\r\n \t\t\tif (oldList.get(counter) != null)\r\n \t\t\t{\r\n \t\t\t\tconceptName = MedLookUpManager.instance().\r\n \t\t\t\t\tgetConceptName( outputAttributesList.get(counter),(String)(oldList.get(counter)));\r\n \t\t\t}\r\n \t\t\toldList.set(counter,conceptName);\r\n \t\t\tvalue = edu.wustl.query.util.global.Utility.getTagValue(outputAttributesList.get(counter).getExpression().\r\n \t\t \tgetQueryEntity().getDynamicExtensionsEntity(),Constants.TAGGED_VALUE_RESULTORDER);\r\n \t\t}\r\n \t\tif(!value.equals(\"\"))\r\n \t\t{\r\n \t\t\tlist.set(Integer.valueOf(value).intValue(),oldList.get(counter));\r\n \t\t}\r\n \t}\r\n }", "private void sortCoreTypes() {\n\t\tArrays.sort(coreBuiltin, (o1, o2) -> Long.compare(o1.id, o2.id));\n\t}", "public void sortAttributes(Comparator<TLAttribute> comparator);", "public void sort()\n {\n\tstrack.sort((Node n1, Node n2) ->\n\t{\n\t if (n1.getCost() < n2.getCost()) return -1;\n\t if (n1.getCost() > n2.getCost()) return 1;\n\t return 0;\n\t});\n }", "public <T extends Comparable<? super T>> void sort (T[] a) {\n int n = a.length;\n for (int i = 0; i< n - 1; i++) {\n for (int j = 0; j < n -1 - i; j++) {\n if (a[j+1].compareTo(a[j]) < 0) \n {\n T tmp = a[j]; \n a[j] = a[j+1];\n a[j+1] = tmp;\n }\n }\n }\n }", "public DynamicPart[] sortParts(DynamicPart[] parts) {\n Arrays.sort(parts, (DynamicPart a, DynamicPart b) -> {\n return a.dynamic.ordinal() - b.dynamic.ordinal();\n });\n return parts;\n }", "public static void sort(Comparable[] a){\n for(int i=1;i<a.length;i++){\n // Insert a[i] among a[i-1],a[i-2],a[i-3]...\n for (int j=i;j>0&&less(a[j],a[j-1]);j--){\n exch(a,j,j-1);\n }\n }\n }", "@Test\r\n public void testGetShapesSortedByArea() {\r\n List<Shape> expectedOutput = new ArrayList<Shape>();\r\n expectedOutput.add(regularPolygon);\r\n expectedOutput.add(triangle);\r\n expectedOutput.add(rectangle);\r\n expectedOutput.add(square);\r\n expectedOutput.add(circle);\r\n List<Shape> actualOutput = screen.sortShape(SortType.AREA); \r\n assertEquals(expectedOutput, actualOutput);\r\n }", "@VTID(28)\n boolean getSortUsingCustomLists();", "private void sortCourses() {\n ctrl.sortCourses().forEach(System.out::println);\n }", "public SortingAlgorithmResult<E> sort(List<E> l);", "public void sortPassing(){\n\t\tpassing.sort(PlayingCard.PlayingCardComparator_ACEHIGH);\n\t}", "public void sortList() {\n Node3 current = front, index = null;\n student temp;\n\n if(front == null) {\n return;\n }\n else {\n while(current != null) {\n //Node index will point to node next to current\n index = current.getNext();\n\n while(index != null) {\n //If current node's data is greater than index's node data, swap the data between them\n if(current.getData().getRoll()> index.getData().getRoll()) {\n temp = current.getData();\n current.setData(index.getData());\n index.setData(temp);\n }\n index = index.getNext();\n }\n current = current.getNext();\n }\n }\n }", "public void sort(){\n\t\tCollections.sort(_ligacoes, (new Comparator<Ligacao>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Ligacao l1, Ligacao l2){\n\t\t\t\tint resultado = Integer.compare(l1.getCusto(), l2.getCusto());\n\t\t\t\tif (resultado == 0)\n\t\t\t\t\tresultado = Boolean.compare(l1.isAerea(), l2.isAerea());\n\t\t\t\treturn resultado;\n\t\t\t}\n\t\t}));\n\t}", "public static boolean testSort() {\r\n Manager inst;\r\n try {\r\n inst = new PokemonTable();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n return false;\r\n }\r\n LinkedList<Pokemon> list;\r\n list = inst.sortByAttack(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getAttack() < list.get(i).getAttack()) {\r\n System.out.println(\"attack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByAttack(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getAttack() > list.get(i).getAttack()) {\r\n System.out.println(\"attack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByDefense(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getDefense() < list.get(i).getDefense()) {\r\n System.out.println(\"defense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByDefense(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getDefense() > list.get(i).getDefense()) {\r\n System.out.println(\"defense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByFavorite(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (!list.get(i - 1).getFavorite() && list.get(i).getFavorite()) {\r\n System.out.println(\"favorite sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByFavorite(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getFavorite() && !list.get(i).getFavorite()) {\r\n System.out.println(\"favorite sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByHp(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getHp() < list.get(i).getHp()) {\r\n System.out.println(\"hp sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByHp(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getHp() > list.get(i).getHp()) {\r\n System.out.println(\"hp sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByLegendary(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (!list.get(i - 1).isLegendary() && list.get(i).isLegendary()) {\r\n System.out.println(\"legendary sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByLegendary(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).isLegendary() && !list.get(i).isLegendary()) {\r\n System.out.println(\"legendary sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByName(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getName().compareTo(list.get(i).getName()) > 0) {\r\n System.out.println(\"name sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByName(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getName().compareTo(list.get(i).getName()) < 0) {\r\n System.out.println(\"name sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpAttack(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpAttack() < list.get(i).getSpAttack()) {\r\n System.out.println(\"spAttack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpAttack(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpAttack() > list.get(i).getSpAttack()) {\r\n System.out.println(\"spAttack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpDefense(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpDefense() < list.get(i).getSpDefense()) {\r\n System.out.println(\"spDefense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpDefense(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpDefense() > list.get(i).getSpDefense()) {\r\n System.out.println(\"spDefense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpeed(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpeed() < list.get(i).getSpeed()) {\r\n System.out.println(\"speed sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpeed(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpeed() > list.get(i).getSpeed()) {\r\n System.out.println(\"speed sort\");\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "public static List<String> sortWords(List<String> words) {\n\t\tfor (int i = 0; i < words.size()-1; i++) {\n\t\tint worrds= \twords.get(i).compareTo(words.get(i+1));\n\t\t\tSystem.out.println(worrds);\n\t\t\tif (worrds<0) {\n\t\t\t\tString temp = words.get(i);\n\t\t\t\t\n\t\t\t\twords.set(i, words.get(i+1));\n\t\t\t\t\n\t\t\t\twords.set(i+1, temp);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\treturn words;\n\t}", "protected void sort(@NotNull ArrayList<Event<?>> events) {\n\t\tevents.sort(new Comparator<Event<?>>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Event<?> e1, Event<?> e2) {\n\t\t\t\tif (e1.getEnd() < e2.getStart())\n\t\t\t\t\treturn -1;\n\t\t\t\telse\n\t\t\t\t\treturn 1;\n\t\t\t}\n\t\t});\n\t\tsnap(this.events);\n\t}", "public void step2(){\n\n Collections.sort(names,(String a,String b) -> {\n return a.compareTo(b);\n });\n }", "public void sort() {\n documents.sort();\n }", "private static void SortHash(HashMap<String,ArrayList<input>> hashMap,Distribution list)\n\t{\n\t\tCollections.sort(list.First, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Second, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Third, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Fourth, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Fifth, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.reverse(list.First);\n\t\tCollections.reverse(list.Second);\n\t\tCollections.reverse(list.Third);\n\t\tCollections.reverse(list.Fourth);\n\t\tCollections.reverse(list.Fifth);\n\t\tputInHashMap(hashMap,list);\n\t}", "private void sortResults(List<String> results) {\r\n\t\tif (comparator == null) {\r\n\t\t\tCollections.sort(results);\r\n\t\t} else {\r\n\t\t\tCollections.sort(results, comparator);\r\n\t\t}\r\n\t}", "public synchronized void sort()\n\t{\n\t\tCollections.sort(vars, tvComparator);\n\t}", "public void step1(){\n\n Collections.sort(names, new Comparator<String>() {\n @Override\n public int compare(String a, String b) {\n return b.compareTo(a);\n }\n });\n }", "public void sortFinalsList() {\n \n Course course = null;\n int j = 0;\n for (int i = 1; i < finalsList.size(); i++) {\n\n j = i;\n // checks to see if the start time of the element j is less than the\n // previous element, and if j > 0\n while (j > 0) {\n\n // if the current element, is less than the previous, then....\n if (finalsList.get(j).getDate()\n .compareTo(finalsList.get(j - 1).getDate()) < 0) {\n\n // if so, swap the two\n course = finalsList.get(j);\n finalsList.set(j, finalsList.get(j - 1));\n finalsList.set(j - 1, course);\n }\n else if (finalsList.get(j).getDate()\n .compareTo(finalsList.get(j - 1).getDate()) == 0) {\n \n if (compareTimes(finalsList.get(j).getBeginTime(), finalsList.get(j - 1).getBeginTime()) < 0) {\n \n // if so, swap the two\n course = finalsList.get(j);\n finalsList.set(j, finalsList.get(j - 1));\n finalsList.set(j - 1, course);\n }\n }\n\n // decrement j\n j--;\n }\n }\n }", "public List<Train> sort(Collection<Train> trains) {\n List<Train> newTrains = new ArrayList<Train>(trains);\n Collections.sort(newTrains, comparator);\n return newTrains;\n }", "private void sortChannelsTypeFaculty(List<Channel> channels) {\n Collections.sort(channels, new Comparator<Channel>() {\n public int compare(Channel c1, Channel c2) {\n int res = c1.getType().compareTo(c2.getType());\n if (res != 0) {\n return res;\n }\n if (c1.getType().equals(ChannelType.LECTURE)) {\n res = ((Lecture) c1).getFaculty().compareTo(((Lecture) c2).getFaculty());\n if (res != 0) {\n return res;\n }\n }\n return c1.getName().compareToIgnoreCase(c2.getName());\n }\n });\n }", "@Test\n public void testFail(){\n List<StoryPart> storyParts = new ArrayList<>();\n StoryPart a = new StoryPart(LocalTime.of(0, 2), null, null, StoryEvent.HALF_TIME_A_END, StoryTitle.create(\"halftime 1 end\"),\n StoryDescription.create(\"halftime 2 end\"));\n StoryPart b = new StoryPart(LocalTime.of(0, 3), null, GameMinute.create(\"2.\"), StoryEvent.GOAL, StoryTitle.create(\"Goal 2\"),\n StoryDescription.create(\"goal 2\"));\n StoryPart c = new StoryPart(LocalTime.of(0, 1), null, GameMinute.create(\"1.\"), StoryEvent.YELLOW_CARD,\n StoryTitle.create(\"yellow card 1\"), StoryDescription.create(\"yellow card 1\"));\n storyParts.add(a);\n storyParts.add(b);\n storyParts.add(c);\n\n Collections.shuffle(storyParts);\n storyParts.sort(new StoryPartTimeLineComparator());\n List<StoryPart> sortA = new ArrayList<>(storyParts);\n Collections.shuffle(storyParts);\n storyParts.sort(new StoryPartTimeLineComparator());\n List<StoryPart> sortB = new ArrayList<>(storyParts);\n Collections.shuffle(storyParts);\n storyParts.sort(new StoryPartTimeLineComparator());\n List<StoryPart> sortC = new ArrayList<>(storyParts);\n\n assertEquals(sortA.get(0), sortB.get(0));\n assertEquals(sortA.get(0), sortC.get(0));\n\n assertEquals(sortA.get(1), sortB.get(1));\n assertEquals(sortA.get(1), sortC.get(1));\n\n assertEquals(sortA.get(2), sortB.get(2));\n assertEquals(sortA.get(2), sortC.get(2));\n\n }", "public void sort(){\n listOperation.sort(Comparator.comparingInt(Operation::getiStartTime));\n }", "public static void main(String[] args) {\n\t\tList<Integer> numbers = List.of(10,1, 2, 3, 3, 4, 4, 5, 6, 7, 8, 9);\n\t\tList<String> courses = List.of(\"Spring\", \"Spring Boot\", \"API\" , \"Microservices\",\"AWS\", \"PCF\",\"Azure\", \"Docker\", \"Kubernetes\");\n\n//01 distinct numbers in stream\t\t\n\t\tnumbers.stream().distinct()\n\t\t .forEach(System.out::println);\n\t\t System.out.println(\"---------------------------------------\");\n\n//02 sorted\n\t\tnumbers.stream().sorted()\n .forEach(System.out::println);\n\t\t System.out.println(\"---------------------------------------\");\n\t\t\n//03 sort Strings-- by default is natural order\t\t\n\t\tcourses.stream().sorted()\n .forEach(System.out::println);\n\t\t System.out.println(\"---------------------------------------\");\n\n//04 sort Strings- user Comparator--- sort(Comparator)\n\t/*Comparators can be passed to a sort method (such as Collections.\n\t * sort or Arrays.sort) to allow precise control over the sort order. \n\t */\t\n\t \tcourses.stream().sorted(Comparator.naturalOrder())\n\t .forEach(System.out::println);\n\t \t System.out.println(\"---------------------------------------\");\n\t \t\n//05 Comparator calss -Sort string reverse order \n\t \tcourses.stream().sorted(Comparator.reverseOrder())\n .forEach(System.out::println);\n\t \t System.out.println(\"---------------------------------------\");\n\t \t\n//06 Comparator(lambda)-Sort String- based on string length\n\t \t//05 Sort string reverse order \n\t \tcourses.stream().sorted(Comparator.comparing(x->x.length())).forEach(System.out::println);\n\t \t System.out.println(\"---------------------------------------\");\n\n//07 sort string - based on last char\t \t\n\t\tcourses.stream().\n\t\tsorted((str1, str2) -> \n\t\tCharacter.compare(str1.charAt(str1.length() - 1),str2.charAt(str2.length() - 1)))\n . forEach(System.out::println);\n\t\t System.out.println(\"---------------------------------------\");\n\t\n//08 sort Book list based on year of release\n\t\tBook book=new Book();\n\t\t Book.bookList.stream()\n\t\t\t\t .sorted(Comparator.comparingLong(Book::getReleaseYear)).forEach(System.out::println);\n\t\t \n\t\t // .sorted((o1, o2) -> (o1 - o2.getSalary())).collect(Collectors.toList());\n\t\t //.out.println(bookSortedList1);\n\t\t System.out.println(\"---------------------------------------\");\n\t\t \n\t\t \n //08 sort Book list based on year of release\n\t\t \n\t\t Book.bookList.stream()\n\t\t\t\t .sorted((o1, o2) -> (o1.getReleaseYear() - o2.getReleaseYear())).forEach(System.out::println); \n\n\t\t \n//Reversed order\n\t\t\t Comparator<Book> comparator_reversed_order = Comparator.comparingLong(Book::getReleaseYear).reversed();\n\t\t\tBook.bookList.stream()\n\t\t\t\t\t .sorted(comparator_reversed_order).forEach(System.out::println); \n//\t\tBook book=new Book();\n\t\t\t Book.bookList.stream()\n\t\t\t\t .sorted(Comparator.comparingLong(Book::getReleaseYear)).forEach(System.out::println);\n\t\n//\tIf this Comparator considers two elements equal, i.e. compare(a, b) == 0, other is used to determine the order. \n//comparator1.thenComparing(comparator2)\n\t\t\t \n\t}", "static List<AccessibleObject> orderFieldsAndMethodsByDependency(List<AccessibleObject> unorderedList, Map<String, AccessibleObject> propertiesMap) {\n Stack<AccessibleObject> stack = new Stack<AccessibleObject>();\n // the result list \n List<AccessibleObject> orderedList = new LinkedList<AccessibleObject>();\n // add the elements from the unordered list to the ordered list \n // any dependencies will be checked and added first, in recursive manner \n for (int i = 0; i < unorderedList.size(); i++) {\n AccessibleObject obj = unorderedList.get(i);\n addPropertyToDependencyList(orderedList, propertiesMap, stack, obj);\n }\n return orderedList;\n}", "@Override\n public void sort() {\n\n List<Doctor> unsortedDocs = this.doctors;\n\n Collections.sort(unsortedDocs, new Comparator<Doctor>() {\n @Override\n public int compare(Doctor a, Doctor b) {\n //Compare first name for doctors and re-arrange list\n return a.getFirstName().compareTo(b.getFirstName());\n }\n });\n \n this.doctors = unsortedDocs;\n\n }", "public static <T extends Comparable<T>> List<T> sort(List<T> a) {\r\n if (a.size() < 2) {\r\n return a;\r\n }\r\n\r\n final List<T> leftHalf = a.subList(0, a.size() / 2);\r\n final List<T> rightHalf = a.subList(a.size() / 2, a.size());\r\n\r\n return Helper.merge(sort(leftHalf), sort(rightHalf));\r\n }", "private void sort() {\n\t\tCollections.sort(this.entities, comparator);\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t\tList<Student> students = new ArrayList<>();\r\n\t\t\r\n\t\tstudents.add(new Student(23, \"Aryan\"));\r\n\t\tstudents.add(new Student(23, \"Jeet\"));\r\n\t\tstudents.add(new Student(83, \"Dhruv\"));\r\n\t\tstudents.add(new Student(13, \"Amit\"));\r\n\t\tstudents.add(new Student(65, \"Aditya\"));\r\n\t\tstudents.add(new Student(57, \"Jeet\"));\r\n\t\t\r\n//\t\tCollections.sort(students);\r\n\t\t\r\n//\t\tCollections.sort(students, new SortByNameThenMarks());\t// We passed our own comparator object.\r\n\t\t\r\n\t\t// We can have our own anonymous comparator without making a class. We can do that so by doing the following:\r\n\t\t\r\n//\t\tCollections.sort(students, new Comparator<Student>() {\r\n//\r\n//\t\t\t@Override\r\n//\t\t\tpublic int compare(Student obj1, Student obj2) {\r\n//\t\t\t\tif(obj1.name.equals(obj2)) return obj1.marks - obj2.marks;\r\n//\t\t\t\treturn obj1.name.compareTo(obj2.name);\r\n//\t\t\t}\r\n//\t\t\t\r\n//\t\t});\r\n\t\t\r\n\t\t// With the help of Lambda we could cut short the lines but we have to mention the sign \"->\".\r\n//\t\tCollections.sort(students,(Student obj1, Student obj2) -> {\r\n\t\t\r\n//\t\tCollections.sort(students,(obj1, obj2) -> {\r\n//\t\t\t\tif(obj1.name.equals(obj2)) return obj1.marks - obj2.marks;\r\n//\t\t\t\treturn obj1.name.compareTo(obj2.name);\r\n//\t\t\t});\r\n\t\t\r\n//\t\tCollections.sort(students, (obj1, obj2) -> obj1.name.compareTo(obj2.name));\r\n\t\t\r\n//\tThe comparator SortByNameThenMarks can be written in one line as follows. Also \".reversed()\" is used to reverse the order of comparison.\r\n\t\tCollections.sort(students, Comparator.comparing(Student::getName).thenComparing(Student::getMarks).reversed());\r\n\t\t\r\n\t\tstudents.forEach(System.out::println);\t// This is lambda expression to print \r\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tList<Card> listOfCards = new ArrayList<Card>();\n\t\tlistOfCards.add(new Card(SuitColor.RED, SuitType.DIAMOND, SuitValue.ACE));\n\t\tlistOfCards.add(new Card(SuitColor.BLACK, SuitType.CLUB, SuitValue.FIVE));\n\t\tlistOfCards.add(new Card(SuitColor.RED, SuitType.HEART, SuitValue.FOUR));\n\t\tlistOfCards.add(new Card(SuitColor.BLACK, SuitType.SPADE, SuitValue.THREE));\n\t\tlistOfCards.add(new Card(SuitColor.BLACK, SuitType.CLUB, SuitValue.TWO));\n\t\tlistOfCards.add(new Card(SuitColor.RED, SuitType.DIAMOND, SuitValue.JACK));\n\t\tSystem.out.println(listOfCards);\n\t\tCollections.sort(listOfCards, Card.ColorComparator);\n\t\tSystem.out.println(listOfCards);\n\t\tCollections.sort(listOfCards, Card.TypeComparator);\n\t\tSystem.out.println(listOfCards);\n\t\tCollections.sort(listOfCards, Card.ValueComparator);\n\t\tSystem.out.println(listOfCards);\n\t\tCollections.sort(listOfCards, Card.CardComparator);\n\t\tSystem.out.println(listOfCards);\n\t}", "private void sortRating()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getRating().compareTo(b.getRating());\n if(result < 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n else if(result == 0)\n {\n result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\n }\n }", "List<SurveyQuestion> sortByPageAndPosition(List<SurveyQuestion> questions);", "public static List<String> sortDNA(List<String> unsortedSequences) {\n\t\tfor (int i = 0; i < unsortedSequences.size()-1; i++) {\n\t\t\tif (unsortedSequences.get(i).length()>unsortedSequences.get(i+1).length()) {\n\t\t\t\t\n\t\t\t\tString temp = unsortedSequences.get(i);\n\t\t\t\t\n\t\t\t\tunsortedSequences.set(i, unsortedSequences.get(i+1));\n\t\t\t\t\n\t\t\t\tunsortedSequences.set(i+1, temp);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\treturn unsortedSequences;\n\t\t//return 0;\n\t}", "public void sortElements(){\n\t\tgetInput();\n\t\tPeople[] all = countAndSort(people, 0, people.length-1);\n\t\t//PrintArray(all);\n\t\tSystem.out.println(InversionCount);\n\t}", "private void sortAndSetExplanations(IExplanationSet explanationSet){\n\t\t\tList<IBasicExplanation> explanationList = explanationSet.getExplanations();\n\t\t\t\n\t\t\tCollections.sort(explanationList,\n\t\t\t\t\tRankerFactory.getScoreTotalOrderComparator(scoringFunction));\n\t\t\t\n\t\t\tfor (IBasicExplanation explanation : explanationList)\n\t\t\t\tput(explanation);\n\t\t\t\n\t\t\tsetMinMax(explanationList);\n\t\t}", "private void orderList() {\n Iterator<PlanarShape> sort = unorderedList.iterator();\n\n while(sort.hasNext()) {\n orderedList.insertInOrder(sort.next());\n }\n }", "default List<Event> sort(List<Event> events, Comparator<Event> cmp) {\n\t\tCollections.sort(events, cmp);\n\t\treturn events;\n\t}", "public void sortareDesc(List<Autor> autoriList){\n\t\tboolean ok;\t\t\t\t \n\t\tdo { \n\t\t ok = true;\n\t\t for (int i = 0; i < autoriList.size() - 1; i++)\n\t\t if (autoriList.get(i).getNrPublicatii() < autoriList.get(i+1).getNrPublicatii()){ \n\t\t \t Autor aux = autoriList.get(i);\t\t//schimbarea intre autori\n\t\t \t Autor aux1 = autoriList.get(i+1);\t\n\t\t \t try {\n\t\t \t\t \trepo.schimbareAutori(aux,aux1);\n\t\t\t } catch (Exception e) {\n\t\t\t System.out.println(e.getMessage());\n\t\t\t }\n\t\t\t\t ok = false;\n\t\t\t}\n\t\t}\n\t while (!ok);\n\t }", "public void sortDescriptors() {\n\n XMLFieldDescriptor fieldDesc = null;\n NodeType nodeType = null;\n\n List remove = new List(3);\n for (int i = 0; i < attributeDescriptors.size(); i++) {\n fieldDesc = (XMLFieldDescriptor)attributeDescriptors.get(i);\n switch (fieldDesc.getNodeType().getType()) {\n case NodeType.ELEMENT:\n elementDescriptors.add(fieldDesc);\n remove.add(fieldDesc);\n break;\n case NodeType.TEXT:\n remove.add(fieldDesc);\n break;\n default:\n break;\n }\n }\n for (int i = 0; i < remove.size(); i++)\n attributeDescriptors.remove(remove.get(i));\n\n remove.clear();\n for (int i = 0; i < elementDescriptors.size(); i++) {\n fieldDesc = (XMLFieldDescriptor)elementDescriptors.get(i);\n switch (fieldDesc.getNodeType().getType()) {\n case NodeType.ATTRIBUTE:\n attributeDescriptors.add(fieldDesc);\n remove.add(fieldDesc);\n break;\n case NodeType.TEXT:\n remove.add(fieldDesc);\n break;\n default:\n break;\n }\n }\n for (int i = 0; i < remove.size(); i++)\n elementDescriptors.remove(remove.get(i));\n\n }", "public void sort(){\n ArrayList<Card> sortedCards = new ArrayList<Card>();\n ArrayList<Card> reds = new ArrayList<Card>();\n ArrayList<Card> yellows = new ArrayList<Card>();\n ArrayList<Card> greens = new ArrayList<Card>();\n ArrayList<Card> blues = new ArrayList<Card>();\n ArrayList<Card> specials = new ArrayList<Card>();\n for(int i = 0; i < cards.size(); i++){\n if(cards.get(i).getColor() == RED){\n reds.add(cards.get(i));\n }else if(cards.get(i).getColor() == YELLOW){\n yellows.add(cards.get(i));\n }else if(cards.get(i).getColor() == GREEN){\n greens.add(cards.get(i));\n }else if(cards.get(i).getColor() == BLUE){\n blues.add(cards.get(i));\n }else if(cards.get(i).getColor() == ALL){\n specials.add(cards.get(i));\n }\n }\n cards = new ArrayList<Card>();\n for(Card c: reds){\n sortedCards.add(c);\n }\n for(Card c: yellows){\n sortedCards.add(c);\n }\n for(Card c: greens){\n sortedCards.add(c);\n }\n for(Card c: blues){\n sortedCards.add(c);\n }\n for(Card c: specials){\n sortedCards.add(c);\n }\n for(Card c: sortedCards){\n cards.add(c);\n }\n }", "@Override\n public void sort(IAlg algorithm, boolean decrescent){}", "public void sortByQnNum() {\r\n\t\tfor (int j = 0; j < displayingList.size() - 1; j++) {\r\n\t\t\tfor (int i = 0; i < displayingList.size() - j - 1; i++) {\r\n\t\t\t\tif (displayingList.get(i).getQnNum() > displayingList.get(i + 1).getQnNum()) {\r\n\t\t\t\t\tswapPosition(displayingList, i, i + 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public List<ValueType> sort() {\r\n // TODO\r\n return null;\r\n }", "public List<SigPair<C>> sortSigma(List<SigPair<C>> list) {\n //Comparator<SigPair<C>> sigcmp = Comparator.comparing(SigPair::getSigma::degree);\n ToLongFunction<SigPair<C>> function = new ToLongFunction<SigPair<C>>() {\n @Override\n public long applyAsLong(SigPair<C> cSigPair) {\n return cSigPair.getSigmaDegree();\n }\n };\n Comparator<SigPair<C>> sigcmp = DComparator.comparingLong(function);\n// List<SigPair<C>> ff = list.stream()\n// .sorted(sigcmp)\n// .collect(Collectors.toList());\n\n List<SigPair<C>> ff = new ArrayList<>(list);\n Collections.sort(ff, sigcmp);\n\n return ff;\n }" ]
[ "0.6189086", "0.57339853", "0.56990254", "0.5693796", "0.5677007", "0.5583864", "0.5566038", "0.54993033", "0.5496587", "0.54414606", "0.53280365", "0.531288", "0.5300183", "0.52893645", "0.52701825", "0.5268494", "0.52667356", "0.52587247", "0.5175317", "0.51711184", "0.51695484", "0.5162813", "0.5161498", "0.514483", "0.5138337", "0.5117588", "0.5110004", "0.5108246", "0.5100675", "0.5095795", "0.5090337", "0.5084743", "0.50792557", "0.5077967", "0.50727093", "0.50717247", "0.5057917", "0.505131", "0.5049395", "0.5048255", "0.50335616", "0.50303805", "0.502976", "0.50247157", "0.50159454", "0.50122476", "0.50110614", "0.50105697", "0.50046986", "0.49890596", "0.49875066", "0.4981347", "0.49755657", "0.49729493", "0.49708134", "0.49631342", "0.49619472", "0.49556294", "0.4947474", "0.49443936", "0.49270734", "0.49232388", "0.49225056", "0.49148974", "0.4901971", "0.48949087", "0.48879206", "0.48824966", "0.4879529", "0.4873326", "0.48617727", "0.4859466", "0.48515716", "0.48505762", "0.48460546", "0.48408526", "0.4838997", "0.48384696", "0.48376217", "0.48368338", "0.48333833", "0.48327368", "0.4832422", "0.48283818", "0.48281267", "0.4826843", "0.48257792", "0.48257223", "0.4825166", "0.48203295", "0.48180556", "0.48172677", "0.48154387", "0.48149464", "0.48116338", "0.4809599", "0.48080373", "0.48067427", "0.47892186", "0.47860888" ]
0.6885932
0
Given a list of drugs to sort and a drug list, sorts the first list so that the drugs are in the same order as the second list; any drugs in the list to sort not found in the drug list are discarded
public static List<Concept> sortDrugs(List<Concept> drugsToSort, List<Concept> drugList) { List<Concept> sortedDrugs = new LinkedList<Concept>(); for (Concept drug : drugList) { if (drugsToSort.contains(drug)) { sortedDrugs.add(drug); } } return sortedDrugs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static List<Concept> sortAntiretrovirals(List<Concept> drugs) {\r\n \treturn MdrtbUtil.sortDrugs(drugs, Context.getService(MdrtbService.class).getAntiretrovirals());\r\n }", "public static List<Concept> sortMdrtbDrugs(List<Concept> drugs) {\r\n \treturn MdrtbUtil.sortDrugs(drugs, Context.getService(MdrtbService.class).getMdrtbDrugs());\r\n }", "private void sortDice() {\r\n for (int index = 0; index < dice.size(); index++) {\r\n for (int subIndex = index; subIndex < dice.size(); subIndex++) {\r\n if (dice.get(subIndex).compareTo((dice.get(index))) > 0) {\r\n final Integer temp = dice.get(index);\r\n dice.set(index, dice.get(subIndex));\r\n dice.set(subIndex, temp);\r\n }\r\n }\r\n }\r\n }", "public static List<String> sortDNA(List<String> DNA) {\n\t\tfor(int i = 0; i < DNA.size(); i++) {\n\t\t\tint shortest = i;\n\t\t\tfor(int j = i + 1; j < DNA.size(); j++) {\n\t\t\t\tif(DNA.get(j).length() < DNA.get(i).length()) {\n\t\t\t\t\tshortest = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tString switching = DNA.get(shortest);\n\t\t\tDNA.set(shortest, DNA.get(i));\n\t\t\tDNA.set(i, switching);\n\t\t}\n\t\treturn DNA;\n\t}", "private static void sortByVerified( ArrayList<Volunteer> list)\n {\n // Find the string reference that should go in each cell of\n // the array, from cell 0 to the end\n for ( int j = 0; j < list.size();j++ )\n {\n // Find min: the index of the string reference that should go into cell j.\n // Look through the unsorted strings (those at j or higher) for the one that is first in lexicographic order\n int min = j;\n for ( int k=j+1; k < list.size(); k++ ) {\n if (list.get(k).compareTo(list.get(min)) > 0) {\n min = k;\n }\n\n }\n\n // Swap the reference at j with the reference at min\n Collections.swap(list, j, min);\n }\n }", "public ArrayList<Dice> sortDiceArray() //sort the dice array by order of how you resolve\n {\n ArrayList<Dice> sortDiceArray = getDiceArray();\n for(int i = 0; i < sortDiceArray.size()-1; i++)\n {\n if(sortDiceArray.get(i).getDiceInt() > sortDiceArray.get(i+1).getDiceInt())\n {\n Collections.swap(sortDiceArray, i, i+1);\n i = 0;\n }\n }\n \n return diceArray;\n }", "public void sort()\n\t{\n\t\tfor(int i=0;i<bowlers.size()-1;i++)\n\t\t{\n\t\t\tfor(int j=i+1;j<bowlers.size();j++)\n\t\t\t{\n\t\t\t\tif(bowlers.get(i).getBall()<bowlers.get(j).getBall())\n\t\t\t\t{\n\t\t\t\t\tBowler bowler=bowlers.get(i);\n\t\t\t\t\tbowlers.set(i,bowlers.get(j));\n\t\t\t\t\tbowlers.set(j,bowler);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<bowlers.size();i++)\n\t\t{\n\t\tSystem.out.println(bowlers.get(i).getBall());\n\t\t}\n\t}", "private void sort(Metric metr, DoubleData dObj, DoubleData[] dObjects, int left, int right)\n {\n int p = left + RANDOM_GENERATOR.nextInt(right-left+1);\n DoubleData tmpObj = dObjects[right];\n dObjects[right] = dObjects[p];\n dObjects[p] = tmpObj;\n int l = left, r = right - 1;\n double dist = metr.dist(dObjects[right], dObj);\n while (l < r)\n if (dist >= metr.dist(dObjects[l], dObj)) l++;\n else if (dist < metr.dist(dObjects[r], dObj)) r--;\n else\n {\n tmpObj = dObjects[l];\n dObjects[l] = dObjects[r];\n dObjects[r] = tmpObj;\n l++;\n if (l < r) r--;\n }\n if (dist < metr.dist(dObjects[l], dObj))\n {\n tmpObj = dObjects[l];\n dObjects[l] = dObjects[right];\n dObjects[right] = tmpObj;\n }\n if (left < l) sort(metr, dObj, dObjects, left, l);\n if (l + 1 < right) sort(metr, dObj, dObjects, l + 1, right);\n }", "public void sortByBreed() {\n\t\tAnimalCompare animalCompare = new AnimalCompare();\n\t\tCollections.sort(animals, animalCompare);\n\t}", "public static boolean testSort() {\r\n Manager inst;\r\n try {\r\n inst = new PokemonTable();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n return false;\r\n }\r\n LinkedList<Pokemon> list;\r\n list = inst.sortByAttack(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getAttack() < list.get(i).getAttack()) {\r\n System.out.println(\"attack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByAttack(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getAttack() > list.get(i).getAttack()) {\r\n System.out.println(\"attack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByDefense(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getDefense() < list.get(i).getDefense()) {\r\n System.out.println(\"defense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByDefense(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getDefense() > list.get(i).getDefense()) {\r\n System.out.println(\"defense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByFavorite(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (!list.get(i - 1).getFavorite() && list.get(i).getFavorite()) {\r\n System.out.println(\"favorite sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByFavorite(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getFavorite() && !list.get(i).getFavorite()) {\r\n System.out.println(\"favorite sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByHp(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getHp() < list.get(i).getHp()) {\r\n System.out.println(\"hp sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByHp(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getHp() > list.get(i).getHp()) {\r\n System.out.println(\"hp sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByLegendary(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (!list.get(i - 1).isLegendary() && list.get(i).isLegendary()) {\r\n System.out.println(\"legendary sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByLegendary(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).isLegendary() && !list.get(i).isLegendary()) {\r\n System.out.println(\"legendary sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByName(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getName().compareTo(list.get(i).getName()) > 0) {\r\n System.out.println(\"name sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByName(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getName().compareTo(list.get(i).getName()) < 0) {\r\n System.out.println(\"name sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpAttack(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpAttack() < list.get(i).getSpAttack()) {\r\n System.out.println(\"spAttack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpAttack(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpAttack() > list.get(i).getSpAttack()) {\r\n System.out.println(\"spAttack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpDefense(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpDefense() < list.get(i).getSpDefense()) {\r\n System.out.println(\"spDefense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpDefense(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpDefense() > list.get(i).getSpDefense()) {\r\n System.out.println(\"spDefense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpeed(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpeed() < list.get(i).getSpeed()) {\r\n System.out.println(\"speed sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpeed(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpeed() > list.get(i).getSpeed()) {\r\n System.out.println(\"speed sort\");\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "public static void main(String[] args) {\n\n List<String> animals = new ArrayList <String>();\n\n animals.add(\"Elephatn\");\n animals.add(\"snake\");\n animals.add(\"Lion\");\n animals.add(\"Mongoose\");\n animals.add(\"Cat\");\n\n\n\n// Collections.sort(animals, new StringLengthComparator());\n// Collections.sort(animals, new AlphabeticalComparator());\n Collections.sort(animals, new ReverseAlphabeticalComparator());\n for(String animal:animals){\n System.out.println(animal);\n }\n\n//////////////Sorting Numbers ///////////\n List<Integer> numbers = new ArrayList <Integer>();\n\n numbers.add(54);\n numbers.add(1);\n numbers.add(36);\n numbers.add(73);\n numbers.add(9);\n\n Collections.sort(numbers, new Comparator <Integer>() {\n @Override\n public int compare(Integer num1, Integer num2) {\n return num1.compareTo(num2);\n }\n });\n\n for(Integer number: numbers){\n System.out.println(number);\n }\n\n\n///////////////Sorting Arbitrary objects////////\n\n\n List<Person> people = new ArrayList <Person>();\n\n people.add(new Person(1,\"Joe\"));\n people.add(new Person(5,\"Harry\"));\n people.add(new Person(2,\"Hermoine\"));\n people.add(new Person(4,\"Muffet\"));\n\n// Sort in order of ID\n Collections.sort(people, new Comparator <Person>() {\n @Override\n public int compare(Person p1, Person p2) {\n\n if(p1.getId()>p2.getId()){\n return 1;\n }else if(p1.getId()<p2.getId()){\n return -1;\n }\n return 0;\n\n }\n });\n\n\n // Sort in order of Name\n Collections.sort(people, new Comparator <Person>() {\n @Override\n public int compare(Person p1, Person p2) {\n\n return p1.getName().compareTo(p2.getName());\n\n\n }\n });\n\n for(Person person: people){\n System.out.println(person);\n\n }\n\n }", "public void sort(){\n Collections.sort(list, new SortBySpecies());\n }", "private void sortRating()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getRating().compareTo(b.getRating());\n if(result < 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n else if(result == 0)\n {\n result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\n }\n }", "public void sortGivenArray_popularity() { \n int i, j, k; \n for(i = movieList.size()/2; i > 0; i /= 2) {\n for(j = i; j < movieList.size(); j++) {\n Movie key = movieList.get(j);\n for(k = j; k >= i; k -= i) {\n if(key.rents > movieList.get(k-i).rents) {\n movieList.set(k, movieList.get(k-i));\n } else {\n break; \n }\n }\n movieList.set(k, key);\n }\n } \n }", "public void sort(){\n ArrayList<Card> sortedCards = new ArrayList<Card>();\n ArrayList<Card> reds = new ArrayList<Card>();\n ArrayList<Card> yellows = new ArrayList<Card>();\n ArrayList<Card> greens = new ArrayList<Card>();\n ArrayList<Card> blues = new ArrayList<Card>();\n ArrayList<Card> specials = new ArrayList<Card>();\n for(int i = 0; i < cards.size(); i++){\n if(cards.get(i).getColor() == RED){\n reds.add(cards.get(i));\n }else if(cards.get(i).getColor() == YELLOW){\n yellows.add(cards.get(i));\n }else if(cards.get(i).getColor() == GREEN){\n greens.add(cards.get(i));\n }else if(cards.get(i).getColor() == BLUE){\n blues.add(cards.get(i));\n }else if(cards.get(i).getColor() == ALL){\n specials.add(cards.get(i));\n }\n }\n cards = new ArrayList<Card>();\n for(Card c: reds){\n sortedCards.add(c);\n }\n for(Card c: yellows){\n sortedCards.add(c);\n }\n for(Card c: greens){\n sortedCards.add(c);\n }\n for(Card c: blues){\n sortedCards.add(c);\n }\n for(Card c: specials){\n sortedCards.add(c);\n }\n for(Card c: sortedCards){\n cards.add(c);\n }\n }", "public void sortAlternate(int[] nums){\n Arrays.sort(nums);\n }", "List <Dish> getDishesSortedBy(String sortBy);", "public void sortDNAs() {\n DNAs = TLArrayList.sort(DNAs);\n }", "private void sort()\n {\n // This implements Shell sort.\n // Unfortunately we cannot use the sorting functions from the library\n // (e.g. java.util.Arrays.sort), since the ones that work on int\n // arrays do not accept a comparison function, but only allow\n // sorting into natural order.\n int jump = length;\n boolean done;\n \n while( jump>1 ){\n jump /= 2;\n \n do {\n done = true;\n \n for( int j = 0; j<(length-jump); j++ ){\n int i = j + jump;\n \n if( !areCorrectlyOrdered( indices[j], indices[i] ) ){\n // Things are in the wrong order, swap them and step back.\n int tmp = indices[i];\n indices[i] = indices[j];\n indices[j] = tmp;\n done = false;\n }\n }\n } while( !done );\n }\n \n // TODO: integrate this with the stuff above.\n for( int i=1; i<length; i++ ){\n commonality[i] = commonLength( indices[i-1], indices[i] );\n }\n commonality[0] = -1;\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}", "private static void SortHash(HashMap<String,ArrayList<input>> hashMap,Distribution list)\n\t{\n\t\tCollections.sort(list.First, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Second, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Third, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Fourth, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Fifth, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.reverse(list.First);\n\t\tCollections.reverse(list.Second);\n\t\tCollections.reverse(list.Third);\n\t\tCollections.reverse(list.Fourth);\n\t\tCollections.reverse(list.Fifth);\n\t\tputInHashMap(hashMap,list);\n\t}", "private void sortMedApts(List<MedicationAppointment> medApts2) {\n \t}", "public static void sortitems(ArrayList<item> svd)\n\t{\n\t\tCollections.sort(svd, new Comparator<item>(){\n\t\t public int compare(item o1, item o2){\n\t\t if(o1.density == o2.density)\n\t\t return 0;\n\t\t return o1.density > o2.density ? -1 : 1;\n\t\t }\n\t\t});\n\t\t\n\t\t\n\t}", "void sort();", "void sort();", "public static void sortitems(ArrayList<item> svd)\r\n{\n\r\n\tCollections.sort(svd, new Comparator<item>(){\r\n\t\tpublic int compare(item o1, item o2){\r\n\t\t\t\tif(o1.density == o2.density)\r\n\t\t\t\t\t\t\treturn 0;\r\n\t\t\t\t\t\t\t\t\treturn o1.density > o2.density ? -1 : 1;\r\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}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\r\n\r\n}", "public void stringSelectionSort() {\n int nextMin;\n\n for (int i = 0; i < StringList.length - 1; i++) {\n nextMin = i;\n for (int j = i + 1; j < StringList.length; j++) {\n if (StringList[j].compareTo(StringList[nextMin]) < 0)\n nextMin = j;\n }\n if (nextMin != i)\n swapSelectionStrings(StringList, i, nextMin);\n }\n }", "public static void main(String[] args) {\n\t\tList<String> animal = new ArrayList<String>();\n\n\t\tanimal.add(\"Cat\");\n\t\tanimal.add(\"Mouse\");\n\t\tanimal.add(\"Lion\");\n\t\tanimal.add(\"Zeebra\");\n\t\tanimal.add(\"Bear\");\n\t\tanimal.add(\"Deer\");\n\n\t\t// Collections.sort(animal,new StringLengthComparator());\n\n\t\tCollections.sort(animal, new ReverseAlphabeticalComparator());\n\t\tfor (String animal1 : animal) {\n\n\t\t\tSystem.out.println(animal1);\n\t\t}\n\n\t\t/////////////////////////////// Sorting Numbers ////////////////////////////////\n\t\tList<Integer> numbers = new ArrayList<Integer>();\n\n\t\tnumbers.add(5);\n\t\tnumbers.add(31);\n\t\tnumbers.add(16);\n\t\tnumbers.add(605);\n\t\tnumbers.add(15);\n\n\t\tCollections.sort(numbers, new Comparator<Integer>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(Integer num1, Integer num2) {\n\n\t\t\t\treturn -num1.compareTo(num2);\n\t\t\t}\n\n\t\t});\n\n\t\tfor (Integer num1 : numbers) {\n\n\t\t\tSystem.out.println(num1);\n\t\t}\n\t\t///////////////////////////// Sorting Arbitrary Objects ////////////////////////////\n\n\t\tList<Person> people = new ArrayList<Person>();\n\n\t\tpeople.add(new Person(3, \"Ajeer\"));\n\t\tpeople.add(new Person(1, \"Sudeer\"));\n\t\tpeople.add(new Person(2, \"Sureash\"));\n\t\tpeople.add(new Person(4, \"Sam\"));\n\t\t\n\t\t// Sort in Order of ID\n\t\tCollections.sort(people, new Comparator<Person>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(Person p1, Person p2) {\n\t\t\t\tif (p1.getId() > p2.getId()) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\telse if (p1.getId()< p2.getId()) {\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t});\n\t\tfor (Person person1 : people) {\n\n\t\t\tSystem.out.println(person1);\n\t\t}\n\t\tSystem.out.println(\"\\n\");\n\t\t// Sort In Order of NAME....\n\t\tCollections.sort(people, new Comparator<Person>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(Person p1, Person p2) {\n\t\t\t\n\t\t\t\treturn p1.getName().compareTo(p2.getName());\n\t\t\t}\n\t\t});\n\t\tfor (Person person1 : people) {\n\n\t\t\tSystem.out.println(person1);\n\t\t}\n\t}", "private ArrayList<String> sort(HashMap<String, Double> input){\n\n //initiate new array list from existing keys\n ArrayList<String> sortedCats = new ArrayList<>(input.keySet());\n\n //size of array list\n int n = sortedCats.size();\n\n //placeholder to replace category\n String temp;\n\n //bubble sort algorithm\n for(int i = 0; i < n; i++){\n for(int j = 1; j < (n-i); j++){\n if(input.get(sortedCats.get(j-1)) < input.get(sortedCats.get(j))){\n //swap elements\n temp = sortedCats.get(j-1);\n sortedCats.remove(j-1);\n sortedCats.add(j, temp);\n }\n }\n }\n return sortedCats;\n }", "public static void sort(int[] mergeList) {\n for(int i = 0; i < mergeList.length - 1; i++) { //iterate through mergeList \n int min = mergeList[i];\n int minIndex = i;\n \n\n for(int j = i + 1; j < mergeList.length; j++) { //swap current list item with smaller value \n if(mergeList[j] < min) { \n min = mergeList[j]; \n minIndex = j; \n \n }\t\t\t\t\t\n }\n \n \n if(minIndex != i) { //swap original list with sorted list\n mergeList[minIndex] = mergeList[i];\n mergeList[i] = min;\n \n }\n }\n }", "public void sort() {\n /*int jokers = this.getJokers();\n\t\tif (jokers > 0 && this.size() > 2) {\n\t\t\tArrayList<Tile> list = new ArrayList<>();\n for (int i=0; i<this.size(); i++) {\n\t\t\t\tif (this.get(i).getColour() == 'J') {\n\t\t\t\t\tTile joker = this.remove(this.get(i));\n\t\t\t\t\tlist.add(joker);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (Tile j : list) {\n\t\t\t\tthis.addInSort(j);\n\t\t\t}\n }*/\n \n\n //may need something in here to accomodate a joker changing its form\n\n if (tiles.size() > 1) { //will only sort a meld with any tiles in it\n //Override default comparator to compare by tile value (ints)\n Collections.sort(tiles, new Comparator<Tile>() {\n @Override \n public int compare(Tile t1, Tile t2) { \n if (t1.getColour() > t2.getColour()) {\n return 1;\n } else if (t1.getColour() < t2.getColour()) {\n return -1;\n }\n if (t1.getValue() > t2.getValue()) {\n return 1;\n } else if (t1.getValue() < t2.getValue()) {\n return -1;\n } else {\n return 0;\n }\n }\n });\n }\n\n }", "protected List<FoodType> orderFoodSandwichLast(List<FoodType> unordered) {\n ArrayList<FoodType> ordered = new ArrayList<>();\n ArrayList<Double> ord = new ArrayList<>();\n for (FoodType f : unordered) {\n if (f == FoodType.SANDWICH1) {\n ord.add(1.1);\n } else if (f == FoodType.SANDWICH2) {\n ord.add(1.2);\n } else if (f == FoodType.COOKIE) {\n ord.add(4.0);\n } else if (f == FoodType.FRUIT1) {\n ord.add(2.1);\n } else if (f == FoodType.FRUIT2) {\n ord.add(2.2);\n } else if (f == FoodType.EGG) {\n ord.add(2.0);\n } else {\n ord.add(1.0); //should never happen\n }\n }\n Collections.sort(ord, Collections.reverseOrder());\n //System.out.println(\"ordered \");\n for (Double d : ord) {\n if (d == 1.1) {\n ordered.add(FoodType.SANDWICH1);\n } else if (d == 1.2) {\n ordered.add(FoodType.SANDWICH2);\n } else if (d == 4.0) {\n ordered.add(FoodType.COOKIE);\n } else if (d == 2.1) {\n ordered.add(FoodType.FRUIT1);\n } else if (d == 2.2) {\n ordered.add(FoodType.FRUIT2);\n } else if (d == 2.0) {\n ordered.add(FoodType.EGG);\n } else {\n System.out.println(\"There is an error - this food type is invalid\");\n }\n }\n return ordered;\n }", "public void testSortAndDedup() {\n assertDeduped(List.<String>of(), Comparator.naturalOrder(), 0);\n // test no elements in an integer array\n assertDeduped(List.<Integer>of(), Comparator.naturalOrder(), 0);\n // test unsorted array\n assertDeduped(List.of(-1, 0, 2, 1, -1, 19, -1), Comparator.naturalOrder(), 5);\n // test sorted array\n assertDeduped(List.of(-1, 0, 1, 2, 19, 19), Comparator.naturalOrder(), 5);\n // test sorted\n }", "public Die[] sortDice(Die[] dice) {\n ArrayList<Die> newDice = new ArrayList<>(5);\n for (Die d : dice) {\n this.insertDie(newDice, d);\n }\n\n Die[] result = new Die[5];\n for (int i = 0; i < 5; i++) {\n result[i] = newDice.get(i);\n }\n\n return result;\n }", "private static void sort(String[] a, int lo, int hi, int d) { \n if (hi <= lo + CUTOFF) {\n insertion(a, lo, hi, d);\n return;\n }\n int lt = lo;\n int gt = hi;\n int v = charAt(a[lo], d);\n int i = lo + 1;\n while (i <= gt) {\n int t = charAt(a[i], d);\n if (t < v) {\n \texch(a, lt++, i++);\n }\n else if (t > v) {\n \texch(a, i, gt--);\n }\n else {\n \ti++;\n }\n }\n //a[lo..lt-1] < v = a[lt..gt] < a[gt+1..hi]. \n sort(a, lo, lt-1, d);\n if (v >= 0) sort(a, lt, gt, d+1);\n sort(a, gt+1, hi, d);\n }", "public void sort() {\r\n int k = start;\r\n for (int i = 0; i < size - 1; i++) {\r\n int p = (k + 1) % cir.length;\r\n for (int j = i + 1; j < size; j++) {\r\n if ((int) cir[p] < (int) cir[k % cir.length]) {\r\n Object temp = cir[k];\r\n cir[k] = cir[p];\r\n cir[p] = temp;\r\n }\r\n p = (p + 1) % cir.length;\r\n }\r\n k = (k + 1) % cir.length;\r\n }\r\n }", "private static void sortSlidesByNumberTags() {\n\t\tCollections.sort(slideList, new Comparator<Slide>() {\n\t\t\tpublic int compare(Slide s1, Slide s2) {\n\n\t\t\t\tInteger sS1 = s1.getTagList().size();\n\t\t\t\tInteger sS2 = s2.getTagList().size();\n\n\t\t\t\tint sComp = sS1.compareTo(sS2);\n\n\t\t\t\treturn -1 * sComp;\n\t\t\t}\n\t\t});\n\t}", "public static void FoodSorter(String food){\n\tString NewFood = food;\n\tString Foodbytime[]= {\"Breakfast\", \"Lunch\", \"Dinner\"};\n\t\n\tfor(int i =0;i<=Foodbytime.length-1;i++){\n\t\tif(NewFood.equals(Foodbytime[i])){\n\t\t\tif(Foodbytime[i].equals(Foodbytime[0])){\n\t\t\t\tBreakfast.BreakfastDecider();\n\t\t\t\t\t\t\t\t\t}\n\t\t\telse\t\t\t\t\t\t\t\n\t\t\tif(Foodbytime[i].equals(Foodbytime[1])){\n\t\t\t\tLunch.LunchDecider();\n\t\t\t\t\t\t\t\t\t}\n\t\t\telse\n\t\t\tif(Foodbytime[i].equals(Foodbytime[2])){\n\t\t\t\tDinner.DinnerDecider();\n\t\t\t\t\t\t\t\t\t}\t\n\t\t\n\t}\n\t\n}\n}", "public void sortSpeeds() {\n\n//\t\tSystem.out.println(\"BEGIN: SORT SPEEDS\");\n\t\tthis.printMoves();\n\n\t\tArrayList<Move> temp = new ArrayList<Move>();\n\t\tint i = 1;\n\t\tint x = 0;\n\t\tboolean y = true;\n\n\t\ttemp.add(niceMoves.get(0));\n\t\tint size = niceMoves.size();\n\n\t\twhile (i < niceMoves.size()) {\n\n//\t\t\tSystem.out.println(\"Reiterating.\");\n\t\t\ty = true;\n\n\t\t\twhile (y) {\n\n\t\t\t\t//System.out.println(\"I: \" + i + \" X: \" + x);\n\n\t\t\t\ttry {\n\n\t\t\t\t\tif (niceMoves.get(i).getSpeed() > temp.get(x).getCalcedSpeed()) {\n\n//\t\t\t\t\t\tSystem.out.println(\"Adding \" + niceMoves.get(i).getCaster() + \" to spot \" + x);\n\t\t\t\t\t\ttemp.add(x, niceMoves.get(i));\n\t\t\t\t\t\ty = false;\n\t\t\t\t\t}\n\t\t\t\t\t//X has cycled through temp, meaning nicemoves.i should be added to the end\n\t\t\t\t\t//The only way to check for this is to let it overflow lol\n\t\t\t\t} catch (Exception E) {\n//\t\t\t\t\tSystem.out.println(\"Adding \" + niceMoves.get(i).getCaster() + \" to spot \" + x);\n\t\t\t\t\ttemp.add(x, niceMoves.get(i));\n\t\t\t\t\ty = false;\n\n\t\t\t\t}\n\n\t\t\t\tx += 1;\n\t\t\t}\n\n\t\t\ti += 1;\n\t\t\tx = 0;\n\t\t}\n\n\t\tniceMoves = temp;\n\n//\t\tSystem.out.println();\n//\t\tSystem.out.println(\"Sorting Complete! New Order: \");\n//\t\tthis.printMoves();\n\t\t//end of sort speeds\n\t}", "public String doSort();", "private void sortHelper(Vector<Restaurant> vec) {\n for (int i = 1; i < vec.size(); i++) {\n int j = i - 1;\n Restaurant key = vec.get(i);\n while (j >= 0 && !vec.get(j).compareRating(key)) {\n Restaurant temp = vec.remove(j + 1);\n vec.add(j, temp);\n j--;\n }\n }\n }", "public static ArrayList<Pets> sortArrayList(ArrayList<Pets> input){\n\t\t// destination ArrayList\n\t\tArrayList<Pets> sortedPets = new ArrayList<Pets>();\n\t\t\n\t\t// for each element read from the input list, compare it to the values in the destination list\n\t\t// and insert it.\n\t\tfor (int inputIndex = 0; inputIndex < input.size(); inputIndex++){\n\t\t\tint addIndex = 0;\n\t\t\tfor (int spIndex = 0; spIndex < sortedPets.size(); spIndex++) {\n\t\t\t\tif (input.get(inputIndex).getId() > sortedPets.get(spIndex).getId()) {\n\t\t\t\t\taddIndex++;\n\t\t\t\t} \n\t\t\t}\n\t\t\tsortedPets.add(addIndex, input.get(inputIndex));\n\t\t}\n\t\treturn sortedPets;\n\t}", "private void sortDate()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getReleaseDate().compareTo(b.getReleaseDate());\n if( result < 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n else if(result == 0)\n {\n result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\n }\n }", "public void sortManlist(){\r\n\t\tCollections.sort(Manlist, new MySort());\r\n\t}", "private static void sortList(ArrayList<ArrayList<Integer>> list){\n for (int i = 0; i < list.size(); i++) {\n for (int j = list.size() - 1; j > i; j--) {\n if ( (getCustomerArrivalTime(list.get(i)) == getCustomerArrivalTime(list.get(j)) && getCustomerIndex(list.get(i)) > getCustomerIndex(list.get(j)))\n || getCustomerArrivalTime(list.get(i)) > getCustomerArrivalTime(list.get(j))) {\n\n ArrayList<Integer> tmp = list.get(i);\n list.set(i,list.get(j)) ;\n list.set(j,tmp);\n }\n }\n }\n }", "public 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 }", "public void sort(){\n ListNode t, x, b = new ListNode(null, null);\n while (firstNode != null){\n t = firstNode; firstNode = firstNode.nextNode;\n for (x = b; x.nextNode != null; x = x.nextNode) //b is the first node of the new sorted list\n if (cmp.compare(x.nextNode.data, t.data) > 0) break;\n t.nextNode = x.nextNode; x.nextNode = t;\n if (t.nextNode==null) lastNode = t;\n }\n firstNode = b.nextNode;\n }", "private void sortAlphabet()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\n }", "private DistanceObject[] sortDistanceObjects(DistanceObject[] dObj,\n\t\t\tint objCount) {\n\t\tArrays.sort(dObj, 0, objCount, new DistanceObjectComparator());\n\t\tlogger.info(\"\\n\\nSorted\\n\\n\");\n\t\tfor (int i = 0; i < objCount; i++) {\n\t\t\tlogger.info(dObj[i].getKey() + \"\\t\" + dObj[i].getValue());\n\t\t}\n\t\treturn dObj;\n\t}", "public void sortCompetitors(){\n\t\t}", "private static List<MoneyLoss> sortLosses(Collection<MoneyLoss> unsortedLosses)\n {\n //Sort budget items first on frequency and then alphabetically\n ArrayList<MoneyLoss> oneTimeItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> dailyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> weeklyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> biweeklyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> monthlyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> yearlyItems = new ArrayList<MoneyLoss>();\n\n for (MoneyLoss loss : unsortedLosses)\n {\n switch (loss.lossFrequency())\n {\n case oneTime:\n {\n oneTimeItems.add(loss);\n break;\n }\n case daily:\n {\n dailyItems.add(loss);\n break;\n }\n case weekly:\n {\n weeklyItems.add(loss);\n break;\n }\n case biWeekly:\n {\n biweeklyItems.add(loss);\n break;\n }\n case monthly:\n {\n monthlyItems.add(loss);\n break;\n }\n case yearly:\n {\n yearlyItems.add(loss);\n break;\n }\n }\n }\n\n Comparator<MoneyLoss> comparator = new Comparator<MoneyLoss>() {\n @Override\n public int compare(MoneyLoss lhs, MoneyLoss rhs) {\n return lhs.expenseDescription().compareTo(rhs.expenseDescription());\n }\n };\n\n Collections.sort(oneTimeItems, comparator);\n Collections.sort(dailyItems, comparator);\n Collections.sort(weeklyItems, comparator);\n Collections.sort(biweeklyItems, comparator);\n Collections.sort(monthlyItems, comparator);\n Collections.sort(yearlyItems, comparator);\n\n ArrayList<MoneyLoss> sortedItems = new ArrayList<MoneyLoss>();\n BadBudgetApplication.appendItems(sortedItems, oneTimeItems);\n BadBudgetApplication.appendItems(sortedItems, dailyItems);\n BadBudgetApplication.appendItems(sortedItems, weeklyItems);\n BadBudgetApplication.appendItems(sortedItems, biweeklyItems);\n BadBudgetApplication.appendItems(sortedItems, monthlyItems);\n BadBudgetApplication.appendItems(sortedItems, yearlyItems);\n\n return sortedItems;\n }", "public static void sort(java.util.List arg0)\n { return; }", "public static void sort(ArrayList<Number> list) {\r\n\t\t\t\t\tfor (int i = 0; i < list.size(); i++) {\r\n\t\t\t\t\t\tfor (int j = 0; j < list.size(); j++) {\r\n\t\t\t\t\t\t\t// Ako je vrijadnost elementa na idneksu i manja od vrijednosti\r\n\t\t\t\t\t\t\t// elementa na idneksu j, zamijeni im pozicije.\r\n\t\t\t\t\t\t\tif (list.get(i).doubleValue() < list.get(j).doubleValue()) {\r\n\t\t\t\t\t\t\t\t// Cuvamo elemenat sa drugog indeksa u temp varijabli.\r\n\t\t\t\t\t\t\t\tNumber temp = list.get(j);\r\n\t\t\t\t\t\t\t\t// Kopiramo elemenat sa prvog indeksa preko drugog elementa.\r\n\t\t\t\t\t\t\t\tlist.set(j, list.get(i));\r\n\t\t\t\t\t\t\t\t// Kopiramo temp (drugi elemenat) preko prvog elementa.\r\n\t\t\t\t\t\t\t\tlist.set(i, temp);\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\r\n\t\t}", "public void testGenreSort() {\n sorter.inssortGenre();\n list = sorter.getLibrary();\n assertEquals(list.get(0).getGenre(), \"Hip-Hop\");\n assertEquals(list.get(1).getGenre(), \"R&B\");\n assertEquals(list.get(2).getGenre(), \"Rock\");\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 void sort() {\n Collections.sort(jumpers, new SortJumperByPoints()); \n }", "public void fletteSort(ArrayList<Integer> list) {\n\t\tmergesort(list, 0, list.size() - 1);\n\t}", "void sortV();", "public void wiggleSortSubOptimal(int[] nums) {\n Arrays.sort(nums);\n \n for (int i = 1; i < nums.length - 1; i += 2)\n swap(nums, i, i + 1);\n }", "private void sortEntities(){\n for (int i = 1; i < sorted.size; i++) {\n for(int j = i ; j > 0 ; j--){\n \tEntity e1 = sorted.get(j);\n \tEntity e2 = sorted.get(j-1);\n if(getRL(e1) < getRL(e2)){\n sorted.set(j, e2);\n sorted.set(j-1, e1);\n }\n }\n }\n }", "public static void sortCountryList(int indicator, boolean sortingOrder){\n int size = countryList.size();\n \n // Sorts the list from greatest to least.\n for(int i = 0; i < size; i++) {\n // Assumes the ith entry is the greatest.\n int greatest = i;\n for(int j = i+1; j < size; j++) {\n // If any later entries are greater, update which entry is greatest.\n if (countryList.get(j).getIndicator(indicator) > countryList.get(greatest).getIndicator(indicator)){\n greatest = j;\n }\n }\n // Switches the ith and greatest entries.\n Country temp = countryList.get(i);\n countryList.set(i, countryList.get(greatest));\n countryList.set(greatest, temp);\n }\n // If the sorting order is leastToGreatest, this reverses the list.\n if (!sortingOrder){\n for (int i=0; i< size-1; i++){\n countryList.add(i, countryList.remove(size-1));\n }\n }\n // This sends all NaN values to the end of the list.\n for (int i = 0; i < size; i++){\n Double countryDouble = countryList.get(i).getIndicator(indicator);\n if (countryDouble.isNaN()){\n Country removed = countryList.remove(i);\n countryList.add(removed);\n }\n }\n }", "public void sortIncreasing()\n {\n int min;\n \n for (int i = 0; i < list.length - 1; i++)\n {\n min = i; \n for(int j = i+1; j < list.length; j++)\n {\n if(list[j] < list[min])\n min = j; \n }\n if(i != min && list[min] < list.length)\n {\n int temp = list[min];\n list[min] = list[i];\n list[i] = temp; \n }\n }\n }", "public static void main(String[] args) {\n ArrayList<Comparable> BestBubble = new ArrayList<Comparable>();\r\n ArrayList<Comparable> WorstBubble = new ArrayList<Comparable>();\r\n ArrayList<Comparable> BestSelection = new ArrayList<Comparable>();\r\n ArrayList<Comparable> WorstSelection = new ArrayList<Comparable>();\r\n ArrayList<Comparable> BestInsertion = new ArrayList<Comparable>();\r\n ArrayList<Comparable> WorstInsertion = new ArrayList<Comparable>();\r\n\r\n // Best and worst case bubbleSortV testing...\r\n for (int i = 0; i < 10; i++) {\r\n BestBubble.add(i * 2);\r\n } System.out.println(\"BestBubble in pre-sorted ascending order...\\n\" + BestBubble + \"\\n\");\r\n\r\n for (int x = 10; x > 0; x--) {\r\n WorstBubble.add(x);\r\n }\r\n System.out.println(\"WorstBubble in descending order...\\n\" + WorstBubble + \"\\n\");\r\n\r\n // Best and worst case selectionSortV testing...\r\n for (int i = 0; i < 10; i++) {\r\n BestSelection.add(i * 2);\r\n } System.out.println(\"BestSelection in pre-sorted ascending order...\\n\" + BestSelection + \"\\n\");\r\n\r\n for (int x = 10; x > 0; x--) {\r\n WorstSelection.add(x);\r\n }\r\n System.out.println(\"WorstSelection in descending order...\\n\" + WorstSelection + \"\\n\");\r\n\r\n // Best and worst case insertionSortV testing...\r\n for (int i = 0; i < 10; i++) {\r\n BestInsertion.add(i * 2);\r\n } System.out.println(\"BestInsertion in pre-sorted ascending order...\\n\" + BestInsertion + \"\\n\");\r\n\r\n for (int x = 10; x > 0; x--) {\r\n WorstInsertion.add(x);\r\n }\r\n System.out.println(\"WorstInsertion in descending order...\\n\" + WorstInsertion + \"\\n\");\r\n\r\n // Sort every single instantiation of ArrayList\r\n MySorts.bubbleSortV(BestBubble);\r\n MySorts.bubbleSortV(WorstBubble);\r\n\r\n MySorts.selectionSortV(BestSelection);\r\n MySorts.selectionSortV(WorstSelection);\r\n\r\n MySorts.insertionSortV(BestInsertion);\r\n MySorts.insertionSortV(WorstInsertion);\r\n\r\n // Prints all the instantiations of ArrayList\r\n System.out.println(\"Sorted BestBubble...\\n\" + BestBubble + \"\\n\");\r\n System.out.println(\"Sorted WorstBubble...\\n\" + WorstBubble + \"\\n\");\r\n\r\n System.out.println(\"Sorted BestSelection...\\n\" + BestSelection + \"\\n\");\r\n System.out.println(\"Sorted WorstSelection...\\n\" + WorstSelection + \"\\n\");\r\n\r\n System.out.println(\"Sorted BestInsertion...\\n\" + BestInsertion + \"\\n\");\r\n System.out.println(\"Sorted WorstInsertion...\\n\" + WorstInsertion + \"\\n\");\r\n }", "static List sort(String[] file){\n\t\tList main = new List();\n\t\t// appends the first item to the new list\n\t\tif(file.length > 0){\n\t\t\tmain.append(0);\t\n\t\t}\n\t\t// loops through input array\n\t\tfor(int i = 1; i<file.length; i++){\n\t\t\tString word = file[i];\n\t\t\tint cursor = i-1;\n\t\t\tmain.moveTo(cursor);\n\t\t\t// loops through each list and checks to see if the value is similar\n\t\t\twhile(cursor>-1 && word.compareTo(file[main.getElement()])<1){\n\t\t\t\tcursor--;\n\t\t\t\tmain.movePrev();\n\t\t\t}\n\t\t\t// if it makes it to the end of the list prepend it to the list, \n\t\t\t// but if it isn't insert it after the current element\n\t\t\tif(main.getIndex() == -1){\n\t\t\t\tmain.prepend(i);\n\t\t\t}else {\n\t\t\t\tmain.insertAfter(i);\n\t\t\t}\n\t\t}\n\t\t// returns the finished list\n\t\treturn main;\n\t}", "public void sortGivenArray_date(){\n movieList = mergeSort(movieList);\n }", "public static void selectionSort(double [] list1)\r\n\t{\r\n\t\tdouble temp= 0.0;\r\n\t\tint smallest=0;\r\n\t\r\n\t\tfor(int outside=0; outside<list1.length; outside++)\r\n\t\t{\r\n\t\t\t//System.out.println(\"Outside: \" + outside);\r\n\t\t\tsmallest=outside;\r\n\t\t\tfor(int inside=1+outside; inside<list1.length; inside++)\r\n\t\t\t{\r\n\t\t\t\tif(list1[inside]<list1[smallest])\r\n\t\t\t\t{\r\n\t\t\t\t\tsmallest = inside;\t\t\r\n\t\t\t\t\t//System.out.println(smallest);\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttemp=list1[smallest];\r\n\t\t\tlist1[smallest]=list1[outside];\r\n\t\t\tlist1[outside]=temp;\r\n\t\t}\r\n\t}", "public void sort()\n {\n\tstrack.sort((Node n1, Node n2) ->\n\t{\n\t if (n1.getCost() < n2.getCost()) return -1;\n\t if (n1.getCost() > n2.getCost()) return 1;\n\t return 0;\n\t});\n }", "public static ArrayList<FootballClub> sortClubsByGoals(ArrayList<FootballClub> guiSeasonFilteredClubs) {\n\n // comparator for sorting\n Comparator<FootballClub> comparator = (club1, club2) -> {\n\n if(club1.getTotalGoalsScored() < club2.getTotalGoalsScored()){\n return 1;\n }\n\n return -1;\n };\n\n // checks if clubs are present to sort\n if (guiSeasonFilteredClubs != null) {\n guiSeasonFilteredClubs.sort(comparator);\n\n }\n return guiSeasonFilteredClubs;\n }", "public void step3(){\n\n Collections.sort(names,(String a, String b) -> a.compareTo(b));\n }", "@Override\r\n\tpublic void sort() {\r\n\t\tint minpos;\r\n\t\tfor (int i = 0; i < elements.length-1; i++) {\r\n\t\t\tminpos=AuxMethods.minPos(elements, i);\r\n\t\t\telements=AuxMethods.swapElements(elements, i, minpos);\r\n\t\t\t\r\n\t\t}\r\n\t}", "public void arrange(Order order){\n for(int i=0; i<26; ++i){\n // arrange list of list; list by list\n ArrayList<Integer> list = check_list.get(i);\n for(int j=0; j<list.size(); ++j ){\n if(order == Order.ASCENDING){\n // ascending order\n for(int k=i; k<list.size()-1; ++k){\n int num1= list.get(k);\n int num2= list.get(k+1);\n // ascending order\n if(num2<num1){\n // swap\n list.set(k, num2);\n list.set(k+1, num1);\n }\n }\n }else if(order == Order.DESCENDING){\n // descending order\n for(int k=i; k<list.size()-1; ++k){\n int num1= list.get(k);\n int num2= list.get(k+1);\n // descending order\n if(num2>num1){\n // swap\n list.set(j, num2);\n list.set(k, num1);\n }\n }\n }\n }\n // put arranged list, back in its place\n check_list.set(i, list);\n }\n }", "public void sortMatches();", "public void sortCompetitors(Athletes[] competitors){\n\t\tArrays.sort(competitors, new Comparator<Athletes>(){\n\t\t\tpublic int compare(Athletes ath1, Athletes ath2) {\n\t\t\t\tif (ath1 == null && ath2 == null) {\n\t return 0;\n\t }\n\t if (ath1 == null) {\n\t return 1;\n\t }\n\t if (ath2 == null) {\n\t return -1;\n\t }\n\t return ath1.compareTo(ath2);\n\t\t\t}});\n\t}", "public void SortByPrice() {\n for (int i = 1; i < LastIndex; i++) {\n int x = i;\n while (x >= 1) {\n if (ForChild[x - 1].getPrice() > ForChild[x].getPrice()) {\n Confectionery sweets = ForChild[x - 1];\n ForChild[x - 1] = ForChild[x];\n ForChild[x] = sweets;\n\n }\n x -= 1;\n }\n }\n }", "@Override\n public void sort(List<Double> data, List<List<Double>> sortedData) {\n for (int i = 0; i < data.size() - 1; i++) {\n for (int j = 0; j < data.size() - i - 1; j++) {\n if (data.get(j) > data.get(j + 1)) {\n Double temp = data.get(j);\n data.set(j, data.get(j + 1));\n data.set(j + 1, temp);\n sortedData.add(new ArrayList<>(data));\n }\n }\n }\n }", "@Override\n\tpublic void sortDeck() {\n\t\tfor(int i = 0; i < getCount() - 1; i++) {\n\t\t\tfor(int j = i + 1; j < getCount(); j++) {\n\t\t\t\tif(aktuellesDeck[i].compareTo(aktuellesDeck[j]) == 1) {\n\t\t\t\t\tSkatCard speicherCard = new SkatCard(aktuellesDeck[i].getSuit(), aktuellesDeck[i].getRank());\n\t\t\t\t\taktuellesDeck[i] = null;\n\t\t\t\t\taktuellesDeck[i] = new SkatCard(aktuellesDeck[j].getSuit(), aktuellesDeck[j].getRank());\n\t\t\t\t\taktuellesDeck[j] = null;\n\t\t\t\t\taktuellesDeck[j] = new SkatCard(speicherCard.getSuit(), speicherCard.getRank());\n\t\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 int compareTo(final Ditch ditch) {\n if (!getFirst().equals(ditch.getFirst()))\n return getFirst().compareTo(ditch.getFirst());\n else\n return getSecond().getColumn() - ditch.getSecond()\n .getColumn();\n }", "public static void dutch_flag_sort(char[] balls)\n {\n int n = balls.length;\n\n int swapRedHere = 0;\n int swapBluHere = n-1;\n\n int cur = 0;\n while (cur <= swapBluHere)\n {\n // If current ball is red, swap with swapRedHere. We will get a green so move current.\n if (balls[cur] == 'R')\n {\n swap(balls, cur, swapRedHere++);\n cur++;\n }\n // If current ball is blue, move it to swapBluHere. But don't move current because it now has unknown ball..\n else if (balls[cur] == 'B')\n {\n swap(balls, cur, swapBluHere--);\n }\n // Otherwise we have a green. Leave it there because it will get pulled out when swapRedHere reaches it.\n else // 'G'\n {\n cur++;\n }\n }\n }", "public void SortDepartmentsAscending() {\n\t\tcurr = head;\n\t\twhile (curr.next != null) {\n\t\t\tif (curr.data.students.getStudentCount() > curr.next.data.students.getStudentCount()) {\n\t\t\t\tDepartment tempData = curr.data;\n\t\t\t\tcurr.data = curr.next.data;\n\t\t\t\tcurr.next.data = tempData;\n\t\t\t} curr = curr.next;\n\t\t}\n\t}", "public static void sortStringsDictionary( ArrayList<String> lst )\n {\n PredicateStringPair p = (a, b) -> {\n String[] newA = a.split(\"\");\n String[] newB = b.split(\"\");\n int min;\n boolean mismatch = false;\n String adif = \"\";\n String bdif = \"\";\n if (a.length() < b.length()) {\n min = a.length();\n } else {\n min = b.length();\n }\n\n for (int i = 0; i < min; i++) {\n if (!newA[i].equals(newB[i])) {\n mismatch = true;\n adif = newA[i];\n bdif = newB[i];\n break;\n\n }\n }\n if (mismatch == false) {\n if(a.length() < b.length()) {\n return true;\n }\n else{\n return false;\n }\n }\n else{\n if(adif.matches(\"[a-zA-Z]\") && !bdif.matches(\"[a-zA-Z]\")) {\n return true;\n }\n else if (bdif.matches(\"[a-zA-Z]\") && !adif.matches(\"[a-zA-Z]\")) {\n return false;\n }\n else if (adif.matches(\"[a-zA-Z]\") && bdif.matches(\"[a-zA-Z]\")){\n //Automates the creation of the custom alphabetical ordering\n ArrayList<String> alph = new ArrayList<String>();\n for (int i = 0; i < 26; i++){\n alph.add(Character.toString(97 + i));\n alph.add(Character.toString(65 + i));\n }\n if (alph.indexOf(adif) < alph.indexOf(bdif)){\n return true;\n }\n else {\n return false;\n }\n }\n else {\n if (adif.compareTo(bdif) > 1) {\n return false;\n }\n else{\n return true;\n }\n\n\n }\n\n }\n\n };\n sortStrings(lst, p);\n }", "public void step2(){\n\n Collections.sort(names,(String a,String b) -> {\n return a.compareTo(b);\n });\n }", "public void wiggleSort(int[] nums) {\n for (int i = 0; i < nums.length - 1; i++) {\n if ((i % 2 == 0 && nums[i] > nums[i + 1]) || (i % 2 == 1 && nums[i] < nums[i + 1])) swap(nums, i, i + 1);\n }\n }", "private List<Doctor> sortList(List<Doctor> l, Comparator<Doctor> c) {\n l.sort(c);\n return l;\n }", "public static List<String> sortOrders(List<String> orderList) {\n // Write your code here\n List<String> primeOrders = new ArrayList<>();\n LinkedHashSet<String> nonPrimeOrders = new LinkedHashSet<>();\n for (String order : orderList) {\n String orderType = order.split(\" \")[1];\n try {\n int orderNum = Integer.parseInt(orderType);\n nonPrimeOrders.add(order);\n } catch (Exception e) {\n primeOrders.add(order);\n }\n }\n Collections.sort(primeOrders, new Comparator<String>() {\n \n @Override\n public int compare(String s1, String s2) {\n String[] s1Elements = s1.split(\" \");\n String[] s2Elements = s2.split(\" \");\n int i = 1;\n while (i < s1Elements.length && i < s2Elements.length) {\n if (!s1Elements[i].equals(s2Elements[i])) {\n return s1Elements[i].compareTo(s2Elements[i]);\n }\n i++;\n }\n if (i < s1Elements.length) {\n return 1;\n }\n if (i < s2Elements.length) {\n return -1;\n }\n return s1Elements[0].compareTo(s2Elements[0]);\n }\n \n });\n for (String nonPrimeOrder : nonPrimeOrders) {\n primeOrders.add(nonPrimeOrder);\n }\n return primeOrders;\n }", "public void sortVehicles() {\n\t\tCollections.sort(vehicles);\n\t\t\n\t}", "public void sortPaths(List<String> paths){\n //System.out.println(\"Received LIST: \"+Arrays.toString(paths.toArray()));\n Collections.sort(paths, new Comparator<String>() {\n\n @Override\n public int compare(String o1, String o2) {\n int s1 = Integer.valueOf(o1.substring(1));\n int s2 = Integer.valueOf(o2.substring(1));\n return s2-s1;\n }\n\n });\n //System.out.println(\"AFTER SORTING LIST: \"+Arrays.toString(paths.toArray()));\n }", "public void listSort() {\n\t\tCollections.sort(cd);\n\t}", "public static List<String> sortWords(List<String> words) {\n\t\tfor (int i = 0; i < words.size(); i++) {\n\t\t\tint lowerOrder = i;\n\t\t\tfor (int j = i + 1; j < words.size(); j++) {\n\t\t\t\tif (words.get(j).compareTo(words.get(lowerOrder)) < 0) {\n\t\t\t\t\tlowerOrder = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tString switching = words.get(lowerOrder);\n\t\t\twords.set(lowerOrder, words.get(i));\n\t\t\twords.set(i, switching);\n\t\t}\n\t\treturn words;\n\t}", "ArrayList<String> sortFiles(String[] allFiles){\n\n ArrayList<String> tempArrayList = new ArrayList<String>();\n ArrayList<String> returnArrayList = new ArrayList<String>();\n String[] tempArray = allFiles;\n String[] returnArray;\n\n int numOfFiles = tempArray.length;\n\n //delete nonneeded files\n for(int k = 0; k < numOfFiles; k++){\n if (tempArray[k].startsWith(\"G-\") || tempArray[k].startsWith(\"M-\") || tempArray[k].startsWith(\"I-\")){\n tempArrayList.add(tempArray[k]);\n }\n }\n\n returnArray = new String[tempArrayList.size()];\n for(int i = 0; i < tempArrayList.size(); i++){\n returnArray[i] = tempArrayList.get(i);\n }\n\n //if 0 return empty array\n if (returnArray.length < 2){\n return returnArrayList;\n }\n\n //bubble sort\n for (int i = 0; i < returnArray.length-1; i++){\n for (int j = 0; j < returnArray.length-i-1; j++){\n //get string of full number from file\n String tempFirst = returnArray[j].split(\"_\")[2] + returnArray[j].split(\"_\")[3];\n String tempSecond = returnArray[j+1].split(\"_\")[2] + returnArray[j+1].split(\"_\")[3];\n //take out csv if it is not a subgraph\n if (!tempFirst.contains(\"_subgraph_\")){\n tempFirst = tempFirst.substring(0,14);\n }\n if (!tempSecond.contains(\"_subgraph_\")){\n tempSecond = tempSecond.substring(0,14);\n }\n //get int of string\n long tempFirstNum = Long.parseLong(tempFirst);\n long tempSecondNum = Long.parseLong(tempSecond);\n //compare and swap if bigger\n if (tempFirstNum >= tempSecondNum)\n {\n String temp = returnArray[j];\n returnArray[j] = returnArray[j+1];\n returnArray[j+1] = temp;\n }\n }\n }\n\n //add elements to arraylist with newest date being first\n for(int k = returnArray.length-1; k >= 0; k--){\n returnArrayList.add(returnArray[k]);\n System.out.println(allFiles[k]);\n }\n\n return returnArrayList;\n }", "@Override\r\n\tpublic List<T> sort(List<T> list) {\n\t\tassert list != null : \"list cannot be null\";\r\n\t\tfor(int i = 0; i < list.size() - 1; i ++){\r\n\t\t\tint min = i;\r\n\t\t\tfor(int j = i + 1; j < list.size(); j ++){\r\n\t\t\t\tint current = j;\r\n\t\t\t\tif(this.comparator.compare(list.get(min), list.get(current)) > 0){\r\n\t\t\t\t\tmin = current;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tswap(list, i, min);\r\n\t\t}\r\n\t\treturn list;\r\n\t}", "protected void sort() {\n\n\t\tCollections.sort(this.myRRList);\n\t}", "public static void dimension_sort() { // sort the dimensions according to their effect to GCP\n\t\tfor (int i = 0;i < dims-1;i++) {\n\t\t\tdimension[i] = (byte) i;\n\t\t}\n\t\tboolean swapped = true;\n\t\tint i=0;\n\t\tbyte temp;\n\t\twhile (swapped) {\n\t\t\tswapped = false;\n\t\t\ti++;\n\t\t\tfor (int j = 0; j < dimension.length-i;j++) { // smaller range, put it the front\n\t\t\t\tif (cardinalities[dimension[j]] > cardinalities[dimension[j+1]]) {\n\t\t\t\t\ttemp = dimension[j];\n\t\t\t\t\tdimension[j] = dimension[j+1];\n\t\t\t\t\tdimension[j+1] = temp;\n\t\t\t\t\tswapped = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static Person[] sortList(Person[] list) throws NullPointerException{\n if (list == null) {\n throw new NullPointerException(\"Error!!! array cannot be null.\");\n }else {\n // sorting by bubble sort algorithm\n for (int j = 0; j <( list.length); j++) {\n for (int i = 0; i < list.length-1; i++) {\n if (list[i].getNachname().compareTo(list[i+1].getNachname()) >= 0) {\n Person temp = list[i];\n list[i] = list[i+1];\n list[i+1] = temp;\n }\n }\n }\n }\n return list;\n }", "public void sortObjectList(){\n\t\tint counter = gameObjectsList.size() - 1;\n\t\tif (gameObjectsList == null || gameObjectsList.size() == 0){\n\t\t\treturn;\n\t\t}\n\t\tquicksort(0, counter);\n\t}", "@Override\n public void sort() {\n\n List<Doctor> unsortedDocs = this.doctors;\n\n Collections.sort(unsortedDocs, new Comparator<Doctor>() {\n @Override\n public int compare(Doctor a, Doctor b) {\n //Compare first name for doctors and re-arrange list\n return a.getFirstName().compareTo(b.getFirstName());\n }\n });\n \n this.doctors = unsortedDocs;\n\n }", "public static List<String> sortWords(List<String> words) {\n\t\tfor (int i = 0; i < words.size()-1; i++) {\n\t\tint worrds= \twords.get(i).compareTo(words.get(i+1));\n\t\t\tSystem.out.println(worrds);\n\t\t\tif (worrds<0) {\n\t\t\t\tString temp = words.get(i);\n\t\t\t\t\n\t\t\t\twords.set(i, words.get(i+1));\n\t\t\t\t\n\t\t\t\twords.set(i+1, temp);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\treturn words;\n\t}", "public static <T extends Comparable <? super T>> void mysterySort3(List <T> list){\r\n\t\twhile (!isSorted(list)){ // O(n)\r\n\t\t\tCollections.shuffle(list); //O(n)\r\n\t\t}\r\n\t}", "public void sortAuthor(){\r\n \r\n Book temp; // used for swapping books in the array\r\n for(int i=0; i<items.size(); i++) {\r\n\r\n\t // Check to see the item is a book. We will only\r\n //use books.\r\n\t if(items.get(i).getItemType() != Item.ItemTypes.BOOK)\r\n\t continue;\r\n\t\t\t\t\t\r\n\t for(int j=i+1; j<items.size(); j++) {\r\n\t\t // We consider only books\r\n\t // We consider only magazines\r\n\t if(items.get(j).getItemType() != Item.ItemTypes.BOOK)\r\n\t\t continue;\r\n\t\t // Compare the authors of the two books\r\n\t if(((Book)items.get(i)).getAuthor().compareTo(((Book)items.get(j)).getAuthor()) > 0) {\r\n\t\t // Swap the items\r\n\t\t temp = (Book)items.get(i);\r\n\t\t items.remove(i);\r\n\t\t items.add(i, items.get(j-1));\r\n\t\t items.remove(j);\r\n\t\t items.add(j, temp);\r\n\t }\r\n\t }\r\n\t }\r\n\t\t// Print the magazines\r\n for(int i=0; i<items.size(); i++)\r\n\t if(items.get(i).getItemType() == Item.ItemTypes.BOOK)\r\n\t\tSystem.out.println(items.get(i).toString());\r\n \t\r\n }", "public static void selectionSort(double[] list) {\r\n for (int i = 0; i < list.length - 1; i++) {\r\n // Find the minimum in the list[i..list.length-1]\r\n \t\tint min_index = i;\r\n \t\tfor(int k = i+1; k < list.length; k++) {\r\n \t\t if(list[k] < list[min_index]) {\r\n \t\t min_index = k;\r\n }\r\n }\r\n\r\n // Swap list[i] with list[currentMinIndex] if necessary;\r\n \t\tdouble temp = list[i];\r\n \t\tlist[i] = list[min_index];\r\n \t\tlist[min_index] = temp;\r\n }\r\n }", "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}" ]
[ "0.7007435", "0.7001435", "0.62898916", "0.62316185", "0.61154246", "0.5905174", "0.58473235", "0.5826852", "0.56608635", "0.55827636", "0.55643606", "0.55066496", "0.55050623", "0.5502904", "0.5497833", "0.5497535", "0.54966277", "0.54431874", "0.5436038", "0.5420828", "0.54111356", "0.54105854", "0.53719395", "0.5366963", "0.5366963", "0.53555226", "0.5341799", "0.5340357", "0.5327595", "0.5306796", "0.5302664", "0.5291175", "0.5268968", "0.52214044", "0.52094", "0.52075934", "0.5185823", "0.51749635", "0.5172896", "0.51718235", "0.51682216", "0.51578784", "0.5150276", "0.5144322", "0.51382494", "0.51338506", "0.51150274", "0.51104903", "0.5101147", "0.5097585", "0.50935376", "0.5090167", "0.50896686", "0.5082642", "0.50761956", "0.5071637", "0.5069351", "0.5068361", "0.50680405", "0.5067974", "0.50651014", "0.5056779", "0.50530326", "0.5051058", "0.5047476", "0.5035999", "0.50340575", "0.5031644", "0.50312513", "0.50270236", "0.5020916", "0.5020565", "0.50184697", "0.50179666", "0.5007739", "0.5005785", "0.50027156", "0.50010717", "0.49994916", "0.49978024", "0.49887803", "0.4987166", "0.49863717", "0.4985592", "0.49817336", "0.49777764", "0.49746206", "0.49727997", "0.49725026", "0.49704307", "0.49645904", "0.49633062", "0.49600208", "0.49564594", "0.49558735", "0.494854", "0.49481302", "0.49473494", "0.49456173", "0.49429283" ]
0.8213171
0
Gets a specific ProgramWorkflowState, given the concept associated with the state
public static ProgramWorkflowState getProgramWorkflowState(Concept programWorkflowStateConcept) { for (ProgramWorkflowState state : Context.getProgramWorkflowService().getStates()) { if (state.getConcept().equals(programWorkflowStateConcept)) { return state; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "State findByResource( int nIdResource, String strResourceType, int nIdWorkflow );", "State getState(Long stateId);", "public State getState(String stateName) {\r\n return processModel.getState(stateName);\r\n }", "public WorkflowConfig getWorkflow(String name) {\n if (!this.workflows.containsKey(name)) {\n throw new IllegalArgumentException(\"There is no workflow with name \" + name);\n }\n \n return this.workflows.get(name);\n }", "private TaskState getState(String type, String state) {\r\n\t\tTaskType tt = getType(type);\r\n\t\tif (tt != null) {\r\n\t\t\tfor (TaskState ts : tt.states) {\r\n\t\t\t\tif (ts.name.equals(state))\r\n\t\t\t\t\treturn ts;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "@NotNull\r\n State getState();", "StateT getState();", "State getInitialState( int nIdWorkflow );", "com.google.dataflow.v1beta3.ExecutionState getState();", "public State getState();", "public State getState();", "public int getStateId(Conversation conversation);", "public final S getState(int index) {\r\n\t\treturn states[index];\r\n\t}", "State getState();", "State getState();", "State getState();", "State getState();", "public IState getState();", "public MD2_ModelState getState(int stateNo){\n\t\tif(stateNo < 0 || stateNo >= state.length)\n\t\t\treturn null;\n\t\telse\n\t\t\treturn state[stateNo];\n\t}", "public static TopologyAPI.TopologyState getRuntimeTopologyState(\n String topologyName,\n SchedulerStateManagerAdaptor statemgr) {\n PhysicalPlans.PhysicalPlan plan = statemgr.getPhysicalPlan(topologyName);\n\n if (plan == null) {\n LOG.log(Level.SEVERE, \"Failed to get physical plan for topology {0}\", topologyName);\n return null;\n }\n\n return plan.getTopology().getState();\n }", "public Workflow getWorkflow(String identifier) throws PortalException;", "public static String getJobRunState(int state) {\n if (state < 1 || state >= RUNSTATES.length) {\n return UNKNOWN;\n }\n return RUNSTATES[state];\n }", "private StateVertex getStateInGraph(StateVertex state) {\n\t\tSet<StateVertex> states = getAllStates();\n\n\t\tfor (StateVertex st : states) {\n\t\t\tif (state.equals(st)) {\n\t\t\t\treturn st;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public String getConditionFromState(String state) {\n if (state2conditionMapping.containsKey(state)) {\n return state2conditionMapping.get(state);\n }\n return null;\n }", "long getWorkflowID();", "private static String getStateInput() {\n\t\treturn getQuery(\"Valid State\");\n\t}", "public S getState() {\r\n\t\treturn state;\r\n\t}", "public AeBpelState getState();", "public S getState() {\n return currentState;\n }", "public S getCurrentState();", "public State getState() {\n return state.get();\n }", "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 State getState() {\n return state;\n }", "public State getState() {\n return state;\n }", "public State getState() {\n return state;\n }", "public State getState() {\n return state;\n }", "public State getState() {\n return state;\n }", "public STATE getState() {\n\t\n\t\treturn state;\n\t}", "public Task getTask(String stateName) throws ProcessManagerException {\r\n Task[] tasks = getTasks();\r\n for (int i = 0; i < tasks.length; i++) {\r\n if (tasks[i].getState().getName().equals(stateName)) {\r\n return tasks[i];\r\n }\r\n }\r\n return null;\r\n }", "public Workflow getWorkflow() {\n\t\treturn workflow;\n\t}", "@Override\n\tpublic long getWorkflowId() {\n\t\treturn _scienceApp.getWorkflowId();\n\t}", "int getState();", "int getState();", "int getState();", "int getState();", "int getState();", "int getState();", "public State getState() {\n\t\treturn state;\n\t}", "public State getState() {\n\t\treturn state;\n\t}", "String getState();", "String getState();", "String getState();", "Object getState();", "public int getState();", "public int getState();", "public int getState();", "public int getState();", "public Long getWorkflowId() {\n return this.workflowId;\n }", "SentenceHMMState getState() {\n\treturn state;\n }", "public Long getState() {\n return state;\n }", "public int getState() {\n return state;\n }", "public int getState() {return state;}", "public int getState() {return state;}", "public int getState() {\n return this.state.ordinal();\n }", "public State getState()\r\n\t{\r\n\t\treturn this.state;\r\n\t}", "public int getState() {\n return state.getValue();\n }", "State findByPrimaryKey( int nIdState );", "public int getState() {\n return state;\n }", "public int getState() {\n return state;\n }", "java.lang.String getState();", "public ProgramScheduled getProgramScheduleById(int scheduleId);", "public Integer getState() {\r\n return state;\r\n }", "public Integer getState() {\r\n return state;\r\n }", "Long getStateId(String stateName);", "public State getState () {\n synchronized (this) {\n return state;\n }\n }", "public com.trg.fms.api.TripState getState() {\n return state;\n }", "public Integer getState() {\n return state;\n }", "public Integer getState() {\n return state;\n }", "public Integer getState() {\n return state;\n }", "public Integer getState() {\n return state;\n }", "public Integer getState() {\n return state;\n }", "public Integer getState() {\n return state;\n }", "public String getState() { return state; }", "public int getState() {\n\t\treturn state;\n\t}", "public GlobalState getState() throws IOException {\n StateReponse state = getRequest(\"/state?address=\" + stateAddress, StateReponse.class);\n if (state.getData().size() == 0) {\n // No data, return identity\n return new GlobalState();\n }\n String stateEntry = state.getData().get(0).getData();\n String base64 = new String(Base64.getDecoder().decode(stateEntry));\n return DataUtil.StringToGlobalState(base64);\n }", "public com.commercetools.api.models.state.StateReference getState() {\n return this.state;\n }", "public State getState() { return model.getState(); }", "public String getState() {\n Scanner scanner = new Scanner(System.in);\n\n // Tell User to enter two digit state\n System.out.println(\"Enter state name: \");\n\n // Get the two digit state\n String state = scanner.next();\n\n return state;\n }", "public String getState() {\n return state;\n }", "public java.lang.String getState() {\n return state;\n }", "public java.lang.String getState() {\n return state;\n }", "public com.trg.fms.api.TripState getState() {\n return state;\n }", "public State getState()\n\t{\n\t\treturn getState(conferenceInfo);\n\t}", "public T getState() {\r\n\t\treturn state;\r\n\t}", "public static States getState() {\r\n\t\treturn currentState;\r\n\t}", "public String getWorkflowName() {\r\n\t\treturn this.workflowName;\r\n\t}", "public int getState(){\n return state;\n }", "public int getState(){\n\t\treturn state;\n\t}", "public java.lang.String getState() {\r\n return state;\r\n }", "public State getParent();" ]
[ "0.62805223", "0.5768522", "0.56607926", "0.5518876", "0.55138713", "0.54240704", "0.54226387", "0.5371251", "0.5296612", "0.5273471", "0.5273471", "0.52330303", "0.52156115", "0.52084804", "0.52084804", "0.52084804", "0.52084804", "0.5206529", "0.51870215", "0.5177714", "0.5165357", "0.5145315", "0.5139754", "0.51137745", "0.5113351", "0.5099459", "0.50843954", "0.50790924", "0.50124055", "0.500987", "0.5009414", "0.50011325", "0.49919507", "0.49919507", "0.49919507", "0.49919507", "0.49919507", "0.49905315", "0.4988381", "0.49719727", "0.49711314", "0.49656114", "0.49656114", "0.49656114", "0.49656114", "0.49656114", "0.49656114", "0.49578378", "0.49578378", "0.4956477", "0.4956477", "0.4956477", "0.495531", "0.495063", "0.495063", "0.495063", "0.495063", "0.49456337", "0.4944723", "0.49354836", "0.4930144", "0.4908716", "0.4908716", "0.49052566", "0.4896962", "0.48807552", "0.48798692", "0.48777086", "0.48777086", "0.48769647", "0.4866413", "0.48627886", "0.48627886", "0.48617527", "0.48596704", "0.4859421", "0.4842473", "0.4842473", "0.4842473", "0.4842473", "0.4842473", "0.4842473", "0.48328763", "0.48252052", "0.48213622", "0.4816158", "0.4816023", "0.48138404", "0.48106626", "0.48105916", "0.48105916", "0.48019817", "0.479803", "0.47979173", "0.47971588", "0.4792462", "0.4786365", "0.47828487", "0.47774383", "0.4770905" ]
0.81735957
0
Autoassign a patient identifier for a specific identifier type, if required, if the idgen module is installed, using reflection Auto generated method comment
@SuppressWarnings("unchecked") public static String assignIdentifier(PatientIdentifierType type) { try { Class identifierSourceServiceClass = Context.loadClass("org.openmrs.module.idgen.service.IdentifierSourceService"); Object idgen = Context.getService(identifierSourceServiceClass); Method generateIdentifier = identifierSourceServiceClass.getMethod("generateIdentifier", PatientIdentifierType.class, String.class); // note that generate identifier returns null if this identifier type is not set to be auto-generated return (String) generateIdentifier.invoke(idgen, type, "auto-assigned during patient creation"); } catch (Exception e) { log.error("Unable to access IdentifierSourceService for automatic id generation. Is the Idgen module installed and up-to-date?", e); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void AutoID() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "public void setIdentifier(String value) {\n/* 214 */ setValue(\"identifier\", value);\n/* */ }", "protected abstract String getIdentifier();", "IdentifierType createIdentifierType();", "void addId(II identifier);", "I getIdentifier();", "org.hl7.fhir.Identifier addNewIdentifier();", "public interface Identifiable {\n\t\n\t/**\n * Gets the value of the id property.\n * \n * @return\n * possible object is\n * {@link String }\n * \n */\n public String getId();\n\n /**\n * Sets the value of the id property. The value must starts with \"[A-Za-z]\".\n * \n * @param value\n * allowed object is\n * {@link String }\n * \n */\n public void setId(String value);\n\n}", "public abstract void setIdpc(java.lang.String newIdpc);", "private <T> void setIdGeneration(DeployBeanDescriptor<T> desc) {\n if (desc.getIdGenerator() != null) {\n // already assigned (So custom or UUID)\n return;\n }\n if (desc.idProperty() == null) {\n return;\n }\n final DeployIdentityMode identityMode = desc.getIdentityMode();\n if (identityMode.isSequence() && !dbIdentity.isSupportsSequence()) {\n // explicit sequence but not supported by the DatabasePlatform\n log.log(INFO, \"Explicit sequence on {0} but not supported by DB Platform - ignored\", desc.getFullName());\n identityMode.setIdType(IdType.AUTO);\n }\n if (identityMode.isIdentity() && !dbIdentity.isSupportsIdentity()) {\n // explicit identity but not supported by the DatabasePlatform\n log.log(INFO, \"Explicit Identity on {0} but not supported by DB Platform - ignored\", desc.getFullName());\n identityMode.setIdType(IdType.AUTO);\n }\n\n if (identityMode.isAuto()) {\n if (desc.isPrimaryKeyCompoundOrNonNumeric()) {\n identityMode.setIdType(IdType.EXTERNAL);\n return;\n }\n if (desc.isIdGeneratedValue() || config.isIdGeneratorAutomatic()) {\n // use IDENTITY or SEQUENCE based on platform\n identityMode.setPlatformType(dbIdentity.getIdType());\n } else {\n // externally/application supplied Id values\n identityMode.setIdType(IdType.EXTERNAL);\n return;\n }\n }\n\n if (desc.getBaseTable() == null) {\n // no base table so not going to set Identity or sequence information\n return;\n }\n\n if (identityMode.isIdentity()) {\n // used when getGeneratedKeys is not supported (SQL Server 2000, SAP Hana)\n String selectLastInsertedId = dbIdentity.getSelectLastInsertedId(desc.getBaseTable());\n String selectLastInsertedIdDraft = (!desc.isDraftable()) ? selectLastInsertedId : dbIdentity.getSelectLastInsertedId(desc.getDraftTable());\n desc.setSelectLastInsertedId(selectLastInsertedId, selectLastInsertedIdDraft);\n return;\n }\n\n if (identityMode.isSequence()) {\n String seqName = identityMode.getSequenceName();\n if (seqName == null || seqName.isEmpty()) {\n String primaryKeyColumn = desc.getSinglePrimaryKeyColumn();\n seqName = namingConvention.getSequenceName(desc.getBaseTable(), primaryKeyColumn);\n }\n int stepSize = desc.setIdentitySequenceBatchMode(databasePlatform.sequenceBatchMode());\n desc.setIdGenerator(createSequenceIdGenerator(seqName, stepSize));\n }\n }", "@Override\r\n public AbstractType generateId(AbstractType abstractType) {\n\tClassInfo classInfo = (ClassInfo)abstractType;\r\n\tclassInfo.setClassId(classInfo.getPackageName()+\"_\"+classInfo.getClassName()+\"_\"+classNum++);\r\n\treturn classInfo;\r\n }", "public T getIdentifier();", "public native void setIdentifier (String identifier);", "public interface Identifier {\n\n public String getIdentifier();\n\n}", "IdentifiersType createIdentifiersType();", "@Override\n\t\tpublic void setId(final String identifier) {\n\t\t}", "java.lang.String getIdentifier();", "String getIdentifier();", "String getIdentifier();", "String getIdentifier();", "String getIdentifier();", "String getIdentifier();", "String getIdentifier();", "String getIdentifier();", "private Patient setPatientIdentifier(Patient patient){\n\t\tUUID u = new UUID(1,0);\n\t\ttry{\n\t\t\tUUID randomUUID = u.randomUUID();\n\t\t\tPatientIdentifier pi = new PatientIdentifier();\n\t\t\tpi.setIdentifier(randomUUID.toString());\n\t\t\tpatient.addIdentifier(pi);\n\t\t}\n\t\tcatch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn patient;\n\t}", "@UniqueID(\"ProvidedID\")\n\t\[email protected]\n\t\tprivate void uniqueIdAnnotation() {\n\t\t}", "Identifier getId();", "@Word(word = \"First\", value = 1) \n\t public static void newMethod(){ \n\t\t FullAnnotationProgram obj = new FullAnnotationProgram(); \n\n\t try{ \n\t Class<?> c = obj.getClass(); \n\n\t // Obtain the annotation for newMethod \n\t Method m = c.getMethod(\"newMethod\"); \n\t \n\t // Display the full annotation \n\t Annotation anno = m.getAnnotation(CustomRepeatAnnots.class); \n\t System.out.println(anno); \n\t }catch (NoSuchMethodException e){ \n\t System.out.println(e); \n\t } \n\t }", "public void registerPatientMethod1(Patient p);", "public int getIdentifier();", "String getIdentifierName(String name, String type);", "int getIdentifier();", "public String getIdentifier();", "public String getIdentifier();", "@DISPID(14) //= 0xe. The runtime will prefer the VTID if present\n @VTID(21)\n void templateID(\n int pVal);", "public String getIdentifierString();", "public void setIdentifier(FactIdentifier param) {\r\n localIdentifierTracker = true;\r\n\r\n this.localIdentifier = param;\r\n\r\n\r\n }", "public interface IIdOwner<ID>\n{\n /**\n * return id.<BR/>\n * @return id\n */\n ID getId();\n}", "protected abstract String getId();", "IDType getID();", "@DISPID(15) //= 0xf. The runtime will prefer the VTID if present\n @VTID(22)\n int reportID();", "public interface Identifiable {\n\n /**\n * @return entity id\n */\n long getId();\n\n /**\n * @param id entity id\n */\n void setId(long id);\n}", "public void setId_type(String id_type) {\n this.id_type = id_type;\n }", "public int identifier();", "public void setIdType(int idType) {\r\n this.idType = idType;\r\n }", "public void setTypeid(Long typeid) {\n this.typeid = typeid;\n }", "void setIdNumber(String idNumber);", "@SuppressWarnings(\"unchecked\")\n @ModelAttribute(\"patientIdentifierTypesAutoAssigned\")\n\tpublic List<PatientIdentifierType> getPatientIdentifierTypesAutoAssigned() {\n\t\tif(!ModuleFactory.getStartedModulesMap().containsKey(\"idgen\")) {\n\t\t\treturn new LinkedList<PatientIdentifierType>(); // return an empty list\n\t\t}\n\t\telse {\n\t\t\t// access the idgen module via reflection\n\t\t\ttry {\n\t\t\t\tClass identifierSourceServiceClass = Context.loadClass(\"org.openmrs.module.idgen.service.IdentifierSourceService\");\n\t\t\t\tObject idgen = Context.getService(identifierSourceServiceClass);\n\t\t\t\tMethod getPatientIdentifierTypesByAutoGenerationOption = identifierSourceServiceClass.getMethod(\"getPatientIdentifierTypesByAutoGenerationOption\", Boolean.class, Boolean.class);\n\t\t\t\t\n\t\t\t\treturn (List<PatientIdentifierType>) getPatientIdentifierTypesByAutoGenerationOption.invoke(idgen, false, true);\n\t\t\t}\n\t\t\tcatch(Exception e) {\n\t\t\t\tlog.error(\"Unable to access IdentifierSourceService for automatic id generation. Is the Idgen module installed and up-to-date?\", e);\n\t\t\t\treturn new LinkedList<PatientIdentifierType>(); // return an empty list\n\t\t\t}\n\t\t}\n\t}", "public void identify() {\n\n\t}", "void recallAutomatorTypeResource(String id, String resourceType, String resourceName, String version)\n throws IOException;", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "@Override\n public int loadAutoID() {\n return 0;\n }", "void id(int id) {}", "public String getIdentifier() {\n/* 222 */ return getValue(\"identifier\");\n/* */ }", "public void setIdpat(int idpat) {\r\n this.idpat = idpat;\r\n }", "@ApiModelProperty(required = true, value = \"The identifier of the PayID (dependent on type)\")\n @NotNull\n\n\n public String getIdentifier() {\n return identifier;\n }", "@DISPID(15) //= 0xf. The runtime will prefer the VTID if present\n @VTID(23)\n void reportID(\n int pVal);", "@Override\r\n\tpublic void setAddNewObjectIdentifier(String arg0, Long arg1)\r\n\t{\n\r\n\t}" ]
[ "0.6425427", "0.60381746", "0.60011107", "0.5962061", "0.595554", "0.59268934", "0.5890715", "0.58829325", "0.5872755", "0.5851047", "0.5836524", "0.5795335", "0.5743407", "0.5718336", "0.56960106", "0.56942445", "0.56764334", "0.56664896", "0.56664896", "0.56664896", "0.56664896", "0.56664896", "0.56664896", "0.56664896", "0.564946", "0.56443447", "0.5631543", "0.5597521", "0.558956", "0.55821675", "0.5549926", "0.55299395", "0.5526842", "0.5526842", "0.5507964", "0.5504472", "0.55013216", "0.5485913", "0.5438931", "0.54172754", "0.54157984", "0.53850067", "0.53792036", "0.5371385", "0.53644234", "0.53615093", "0.53567487", "0.53540236", "0.5347183", "0.5332439", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.53312135", "0.5330913", "0.5328122", "0.53269833", "0.5324051", "0.53212804", "0.5316153", "0.53054523" ]
0.7420709
0
Given a concept, locale, and a string that represents a concept name tag, returns the first concept name for that concept that matches the language and is tagged with the specified tag
public static ConceptName getConceptName(Concept concept, String language, String conceptNameTag) { if (concept == null) { log.error("No concept provided to findConceptName"); return null; } ConceptNameTag tag = Context.getConceptService().getConceptNameTagByName(conceptNameTag); if (tag == null) { log.warn("Invalid concept name tag parameter " + conceptNameTag + " passed to findConceptName"); } for (ConceptName name : concept.getNames()) { if ((language == null || name.getLocale() == null || name.getLocale().getLanguage() == null || name.getLocale().getLanguage().equals(language)) && ((tag == null) || (name.getTags().contains(tag)))) { return name; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Concept getConceptName();", "public static String getLabel(URI concept, Rdf2GoCore repo, String languageTag) {\n\n\t\t// try to find language specific label\n\t\tString label = getLanguageSpecificLabel(concept, repo, languageTag);\n\n\t\t// otherwise use standard label\n\t\tif (label == null) {\n\n\t\t\tString labelQuery = String.format(SPARQL_LABEL, concept.stringValue());\n\n\t\t\tString query = \"SELECT ?label WHERE { \"\n\t\t\t\t\t+ labelQuery\n\t\t\t\t\t+ \"}\";\n\t\t\tTupleQueryResult resultTable = repo.sparqlSelect(query);\n\t\t\tList<BindingSet> bindingSets = resultTable.getBindingSets();\n\t\t\tif (!bindingSets.isEmpty()) {\n\t\t\t\tValue node = bindingSets.iterator().next().getValue(\"label\");\n\t\t\t\tlabel = node.stringValue();\n\n\t\t\t}\n\t\t}\n\t\t// trim language tag if existing\n\t\tif (label != null && label.contains(\"@\")) {\n\t\t\tif (label.lastIndexOf('@') == label.length() - 3) {\n\t\t\t\tlabel = label.substring(0, label.length() - 3);\n\t\t\t}\n\t\t}\n\t\treturn label;\n\t}", "MetaTag findByName(String metaTagName) ;", "public String getName(Resource resource, OgemaLocale locale, boolean useRelativePathAsAlias, boolean useDefaultLanguage);", "org.hl7.fhir.CodeableConcept getName();", "public String getName(Class<? extends Resource> resourceType, OgemaLocale locale, boolean useDefaultLanguage);", "default Concept getConcept(ConceptName conceptName) {return (Concept) conceptName;}", "Tag findByName(String name);", "public static Locale forLanguageTag(String langtag) {\n LanguageTag tag = null;\n while (true) {\n try {\n tag = LanguageTag.parse(langtag);\n break;\n } catch (InvalidLocaleIdentifierException e) {\n // remove the last subtag and try it again\n int idx = langtag.lastIndexOf('-');\n if (idx == -1) {\n // no more subtags\n break;\n }\n langtag = langtag.substring(0, idx);\n }\n }\n if (tag == null) {\n return Locale.ROOT;\n }\n\n Builder bldr = new Builder();\n\n bldr.setLanguage(tag.getLanguage()).setScript(tag.getScript())\n .setRegion(tag.getRegion()).setVariant(tag.getVariant());\n\n Set<Extension> exts = tag.getExtensions();\n if (exts != null) {\n Iterator<Extension> itr = exts.iterator();\n while (itr.hasNext()) {\n Extension e = itr.next();\n bldr.setExtension(e.getSingleton(), e.getValue());\n }\n }\n\n return bldr.create();\n }", "public TagInfo getTag(String shortname) {\n/* 190 */ TagInfo[] tags = getTags();\n/* */ \n/* 192 */ if (tags == null || tags.length == 0) {\n/* 193 */ return null;\n/* */ }\n/* */ \n/* 196 */ for (int i = 0; i < tags.length; i++) {\n/* 197 */ if (tags[i].getTagName().equals(shortname)) {\n/* 198 */ return tags[i];\n/* */ }\n/* */ } \n/* 201 */ return null;\n/* */ }", "@XmlElement\n private String getConceptPreferredName() {\n return concept != null ? concept.getDefaultPreferredName() : \"\";\n }", "private String resolveLabel(String aLabel){\n\t\t// Pre-condition\n\t\tif(aLabel == null) return aLabel;\n\t\t// Main code\n\t\tif (aLabel == \"univ\") return null;\n\t\tString actualName = aLabel.contains(\"this/\")?aLabel.substring(\"this/\".length()):aLabel;\n\t\treturn actualName;\n\t}", "private String translateTags(final Tag tag) {\n switch (tag.getProprety()) {\n case caseNumber:\n return model.getCaseNumber();\n case clientName:\n // return model.getClient().getName();\n case clientFirstName:\n // return model.getClient().getFirstName();\n case currentDate:\n return Calendar.getInstance().getTime().toString();\n default:\n return null;\n }\n }", "private String getCasTypeName(String aTagName) {\n if (aTagName.indexOf(':') == -1 && aTagName.indexOf('-') == -1) {\n return aTagName;\n } else {\n // Note: This is really slow so we avoid if possible. -- RJB\n return StringUtils.replaceAll(StringUtils.replaceAll(aTagName, \":\", \"_colon_\"), \"-\",\n \"_dash_\");\n }\n }", "public String getTag(String tagName){\r\n \t\tfor (Enumeration<Tag> temp = tags.elements(); temp.hasMoreElements();){\r\n \t\t\tTag current = temp.nextElement();\r\n \t\t\tif(current.getName() == tagName){\r\n \t\t\t\treturn current.insertTag();\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn null;\t\r\n \t}", "@Nullable public static String consName(IStrategoTerm term) {\n if(TermUtils.isAppl(term)) {\n return ((IStrategoAppl) term).getConstructor().getName();\n } else {\n return null;\n }\n }", "TokenTypes.TokenName getName();", "public final Concept getConcept(final String name) {\r\n Concept[] d;\r\n Concept s;\r\n\r\n d = this.m_data;\r\n\r\n for (s = d[name.hashCode() & (d.length - 1)]; s != null; s = s.m_next) {\r\n if (s.m_name.equals(name))\r\n return s;\r\n }\r\n\r\n return null;\r\n }", "public interface NameService {\n \n\t/**\n\t * See {@link #getName(Class, OgemaLocale, boolean)}. Uses default setting\n\t * useDefaultLanguage = true, i.e. if a name in the language provided is not available, a default language is selected. \n\t * If no name could be determined, null is returned.\n\t */\n\tpublic String getName(Class<? extends Resource> resourceType, OgemaLocale locale);\n\t\n\t/**\n\t * Returns a human-friendly name of the resource type provided, in the given language.<br>\n\t * @param useDefaultLanguage \n\t * \t\ttrue: if a name is not found in the given language, a default name is provided (depends on implementation, English if available in default implementation)<br>\n\t * \t\tfalse: if a name is not found in the given language null is returned \n\t * @return either a name or null, if a name has not been registered for the given resource type\n\t */\n\tpublic String getName(Class<? extends Resource> resourceType, OgemaLocale locale, boolean useDefaultLanguage);\t\n\t\n\t/**\n\t * Get a list of resource types with available names.<br>\n\t * Return empty list if no dictionary for the requested language is available.\n\t */\n\tpublic List<Class<? extends Resource>> getAvailableTypes(OgemaLocale locale);\n\t\n\t/**\n\t * Check whether a name is available for the given type\n\t */\n\tpublic boolean isTypeAvailable(Class<? extends Resource> resourceType, OgemaLocale locale);\n\t\n\t/**\n\t * See {@link #getName(Resource, OgemaLocale, boolean, boolean)}. Default values useRelativePathAsAlias = false and \n\t * useDefaultLanguage = true are used.\n\t */\n\tpublic String getName(Resource resource, OgemaLocale locale);\t\n\t/**\n\t * Tries to determine a human-friendly name for the given resource with the strategy defined below.\n\t * If none can be determined, null is returned. \n\t * The strategy of the default name service is as follows:\n\t * <ul>\n\t * \t<li>If the resource has a <code>name()</code>-subresource of type StringResource, the value of the latter is returned.\n\t * So for resources having a direct name subresource the argument locale is irrelevant</li>\n\t * <li>If any parent resource has a <code>name()</code>-subresource, the returned String is a concatenation of this name\n\t * \tplus an alias for the relativ path from the parent to the original resource. If no alias is known for this, the behaviour \n\t * \tdepends on the flag useRelativePathAsAlias. If it is true, the relative resource path is appended, if it is false (default), null is returned.</li>\n\t * <li>otherwise null is returned</li>\t \n\t * </ul>\n\t * @param locale language for which the resource name shall be returned\n\t */\n\tpublic String getName(Resource resource, OgemaLocale locale, boolean useRelativePathAsAlias, boolean useDefaultLanguage);\t\n\t\n\t//would require much overhead to implement this\n// public List<OgemaLocale> getAvailableLanguages(Class<? extends Resource> resourceType);\n \n public String getServletUrl() throws UnsupportedOperationException;\n}", "String normalizeName(String tag) {\n\t\tStringBuffer buf = new StringBuffer();\n\t\t\n\t\tboolean newWord = true;\n\t\t// capitalize first letter of each word\n\t\t// remove -'s and _'s\n\t\tfor (int i = 0; i < tag.length(); i++) {\n\t\t\tchar c = tag.charAt(i);\n\t\t\tif (c == '-' || c == '_') {\n\t\t\t\tnewWord=true;\n\t\t\t} else if (newWord) {\n\t\t\t\tbuf.append(Character.toUpperCase(c));\n\t\t\t\tnewWord = false;\n\t\t\t} else {\n\t\t\t\tbuf.append(c);\n\t\t\t\tnewWord = false;\n\t\t\t}\n\t\t}\n\t\treturn buf.toString().trim();\n\t}", "String convertTag(String tag);", "public String getLabel(String uri){\n \n for(Iterator it = listOfLabels.iterator();it.hasNext();){\n SemanticConcept sc = (SemanticConcept) it.next();\n if(sc.getUrl().equals(uri))\n return sc.getName();\n }\n return \" \";\n }", "Language findByName(String name);", "public static String getLabel(String uri, Rdf2GoCore repo, String languageTag) {\n\t\ttry {\n\t\t\tnew java.net.URI(uri);\n\t\t}\n\t\tcatch (URISyntaxException e) {\n\t\t\tLog.severe(e.getMessage());\n\t\t\treturn uri;\n\t\t}\n\t\treturn getLabel(new URIImpl(uri), repo, languageTag);\n\t}", "String getLocalizedString(Locale locale);", "private String notationorlabel(Resource indiv) {\n\t\t\n\t\tString sNotation = concept2notation.get(indiv);\n\t\tif(sNotation != null && !sNotation.isEmpty()) {\n\t\t\treturn sNotation;\n\t\t}\n\t\t\t\n\t\tLiteral label = null;\n\t\t//1. Try to get a notation\n\t\tStatement notstmt = indiv.getProperty(notation); //TODO There might be more than one notation\n\t\tif(notstmt != null) {\n\t\t\tsNotation = ((Literal) notstmt.getObject().as(Literal.class)).getString();\n\t\t}\n\t\t//2. Try to get a skos-label in the preferred Language\n\t\tif(sNotation == null || sNotation.isEmpty())\t{\n\t\t\tlabel = null;\n\t\t\tStmtIterator iter = indiv.listProperties(preflabel);\n\t\t\twhile(iter.hasNext()) {\n\t\t\t\tRDFNode n = iter.nextStatement().getObject();\n\t\t\t\tlabel = (Literal) n.as(Literal.class);\t\t\n\t\t\t\tif(label.getLanguage().equalsIgnoreCase(loc.getLanguage())) {\n\t\t\t\t\tsNotation = label.getString();\n\t\t\t\t\tbreak;\n\t\t\t\t} else if(\"en\".equalsIgnoreCase(label.getLanguage())) {\n\t\t\t\t\tsNotation = label.getString();\n\t\t\t\t} else if(sNotation == null || sNotation.isEmpty()) {\n\t\t\t\t\tsNotation = label.getString();\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\t//3 Try to get a rdfs-label in the preferred Language\n\t\tif(sNotation == null || sNotation.isEmpty())\t{\n\t\t\tlabel = null;\n\t\t\tStmtIterator iter = indiv.listProperties(rdfslabel);\n\t\t\twhile(iter.hasNext()) {\n\t\t\t\tRDFNode n = iter.nextStatement().getObject();\n\t\t\t\tlabel = (Literal) n.as(Literal.class);\t\t\n\t\t\t\tif(label.getLanguage().equalsIgnoreCase(loc.getLanguage())) {\n\t\t\t\t\tsNotation = label.getString();\n\t\t\t\t\tbreak;\n\t\t\t\t} else if(\"en\".equalsIgnoreCase(label.getLanguage())) {\n\t\t\t\t\tsNotation = label.getString();\n\t\t\t\t} else if(sNotation == null || sNotation.isEmpty()) {\n\t\t\t\t\tsNotation = label.getString();\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\t\n\n\t\tif(sNotation == null || sNotation.isEmpty())\t{\n\t\t\tsNotation = indiv.getLocalName();\n\t\t}\n\t\tif(sNotation == null || sNotation.isEmpty())\t{\n\t\t\tsNotation = indiv.getURI();\n\t\t}\n\t\n\t\tconcept2notation.put(indiv, sNotation);\n\t\t\t\n\t\treturn sNotation;\n\t}", "String getConcept();", "public static void getRoomConcept(String concept)\n\t{\n\t\t\n\t}", "public static ConceptDeclarationContext getConceptDeclaration(String name, ParseTree tree) {\n\t\tParseTree root = getRoot(tree);\n\t\tif (!(root instanceof CompilationUnitContext)) {\n\t\t\tthrow new IllegalStateException(\"The Root is no compilationUnit\");\n\t\t}\n\t\tCompilationUnitContext ctx = (CompilationUnitContext) root;\n\t\tfor (ConceptDeclarationContext concept : ctx.conceptDeclaration()) {\n\t\t\tif (concept.Identifier().getText().equals(name)) {\n\t\t\t\treturn concept;\n\t\t\t}\n\t\t}\n\t\tthrow new IllegalArgumentException(\"Concept not found: \" + name);\n\t}", "private static String convertTag(final String src) {\n final String s = TAG_NAMES.get(src);\n return s != null ? s : src;\n }", "public String getWordNetTag(String tag) {\n if (tag.equals(\"N\") || tag.equals(\"O\") || tag.equals(\"^\") || tag.equals(\"S\")\n || tag.equals(\"Z\")) {\n return \"n\";\n } else if (tag.equals(\"V\") || tag.equals(\"L\") || tag.equals(\"M\")) {\n return \"v\";\n } else if (tag.equals(\"A\")) {\n return \"a\";\n } else {\n return \"r\";\n }\n }", "public String getName(String iso639code) \n\tthrows LanguageNotAvailableException;", "TemplateSpecifier getName();", "public static MElement createConcept(String concept) {\n System.out.println(\"Attempting to create Concept from string \" + concept);\n AbstractMFeature2 sf = AbstractMFeature2.getSemanticFeature(concept);\n return getInstance(sf, MFeatureType.CONCEPT);\n }", "java.lang.String getTag();", "java.lang.String getTag();", "String getTokenName(FederationElement fedElem);", "SimpleName getName();", "Astro namedTerm(String tagName, AstroArg args);", "MetaTag findByNameAndTask(String metaTagName, int taskId) ;", "public Concept nameToConcept(String name) {\r\n return concepts.get(name);\r\n }", "private Node getTagFromEntry(Node entryElem, String tagName) {\n\n\t\tString entryElemName = entryElem.getNodeName();\n\t\tif (ENTRY.equals(entryElemName)) {\n\t\t\tNode firstChild = entryElem.getFirstChild();\n\t\t\tif (LOCAL_VARIABLE_NAME.equals(firstChild.getNodeName())) {\n\t\t\t\tNodeList nodeList = ((Element) firstChild.getNextSibling()).getElementsByTagName(tagName);\n\t\t\t\tif (nodeList != null && nodeList.getLength() > 0) {\n\t\t\t\t\treturn nodeList.item(0);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tNodeList nodeList = ((Element) firstChild).getElementsByTagName(tagName);\n\t\t\t\tif (nodeList != null && nodeList.getLength() > 0) {\n\t\t\t\t\treturn nodeList.item(0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public String getName(Language lang) {\n return names.get(lang);\n }", "public String get_firstLinkedOpName() {\n Object obj = linkedOpList.get(0);\n\n if ((AsnValue.class).isInstance(obj)) {\n return \"isValue\";\n }\n else if ((AsnDefinedType.class).isInstance(obj)) {\n return ((AsnDefinedType) obj).typeName;\n }\n else {\n String nameoftype = null;\n\n try {\n Field nameField;\n Class c = obj.getClass();\n\n nameField = c.getField(\"name\");\n nameoftype = (String) nameField.get(obj);\n } catch (Exception e) {\n e.printStackTrace(System.err);\n }\n\n return nameoftype;\n }\n }", "public String getFromTag();", "public String getTagByName(String tagName) {\r\n\t\treturn dcmObj.getString(Tag.toTag(tagName));\r\n\t}", "public String getTitile(String language) {\n if (language.startsWith(\"e\")) {\n return enTitle;\n } else {\n return localTitle;\n }\n }", "Caseless getName();", "@Execute(urlPattern = \"{}/@word\")\n public JsonResponse<RoutingCheckResult> named(String first) {\n return asJson(new RoutingCheckResult(\"named()\", first, null));\n }", "private List<String> getNames(String tag) {\n List<String> names = new ArrayList<>();\n for (Map.Entry<String, Object> item : input.entrySet()) {\n if (item.getKey().startsWith(tag)) {\n names.add((String) item.getValue());\n }\n }\n return names;\n }", "String getPluralisedName();", "public static String getFullName(String baseName, String localeName)\n/* */ {\n/* 924 */ if ((baseName == null) || (baseName.length() == 0)) {\n/* 925 */ if (localeName.length() == 0) {\n/* 926 */ return localeName = ULocale.getDefault().toString();\n/* */ }\n/* 928 */ return localeName + \".res\";\n/* */ }\n/* 930 */ if (baseName.indexOf('.') == -1) {\n/* 931 */ if (baseName.charAt(baseName.length() - 1) != '/') {\n/* 932 */ return baseName + \"/\" + localeName + \".res\";\n/* */ }\n/* 934 */ return baseName + localeName + \".res\";\n/* */ }\n/* */ \n/* 937 */ baseName = baseName.replace('.', '/');\n/* 938 */ if (localeName.length() == 0) {\n/* 939 */ return baseName + \".res\";\n/* */ }\n/* 941 */ return baseName + \"_\" + localeName + \".res\";\n/* */ }", "public Term nameToListedTerm(String name) {\r\n Concept concept = concepts.get(name);\r\n if (concept != null)\r\n return concept.getTerm(); // Concept associated Term\r\n return operators.get(name);\r\n }", "EPREFIX_TYPE getName();", "String getName( String name );", "public String getLocalizedString( String name ) {\n\t\tString outString = \"\";\r\n\t\tint id = getResources().getIdentifier( name, \"string\", getPackageName() );\r\n\t\tif ( id == 0 )\r\n\t\t{\r\n\t\t\t// 0 is not a valid resource id\r\n\t\t\tLog.v(\"VrLocale\", name + \" is not a valid resource id!!\" );\r\n\t\t\treturn outString;\r\n\t\t} \r\n\t\tif ( id != 0 ) \r\n\t\t{\r\n\t\t\toutString = getResources().getText( id ).toString();\r\n\t\t\t//Log.v(\"VrLocale\", \"getLocalizedString resolved \" + name + \" to \" + outString);\r\n\t\t}\r\n\t\treturn outString;\r\n\t}", "public Concept getConcept(Term term) {\r\n String n = term.getName();\r\n Concept concept = concepts.get(n);\r\n if (concept == null)\r\n concept = new Concept(term, this); // the only place to make a new Concept\r\n return concept;\r\n }", "private Composite seekLocalName(Composite composite, String name) {\n Optional<Composite> find = composite.find(childComposite -> {\n if (childComposite == null) {\n return false;\n }\n\n return childComposite.getName() != null && childComposite.getName().equals(name);\n }, FindMode.childrenOnly).stream().findFirst();\n\n if (find.isPresent()) {\n return find.get();\n } else {\n return null;\n }\n }", "@SuppressWarnings(\"unused\")\n private void setConceptPreferredName(String name) {\n if (concept == null) {\n concept = new ConceptJpa();\n }\n concept.setDefaultPreferredName(name);\n }", "@Override\n\tpublic String getName(ProgramWorkflow object) {\n\t\tif (object.getConcept() != null && object.getConcept().getName() != null) {\n\t\t\treturn object.getConcept().getName().getName();\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t}", "public Concept termToConcept(Term term) {\r\n return nameToConcept(term.getName());\r\n }", "public static __Tag getTagSub(String tag) {\n\t return map.get(tag);\n\t}", "public static __Tag getTagSub(String tag) {\n\t return map.get(tag);\n\t}", "public Object getAdditionalTagValue(String tagId, Concept concept) {\n\n Collection additionalTags = this.assignedTag.getAdditionalTags();\n\n for (Iterator i = additionalTags.iterator(); i.hasNext();) {\n\n AssignedTag additionalTag = (AssignedTag) i.next();\n Tag tag = additionalTag.getTag();\n Concept[] concepts = (additionalTag.getTarget()).getConcepts();\n\n if (tag.getId() == tagId && Arrays.binarySearch(concepts, concept) >= 0) {\n\n return additionalTag.getValue();\n }\n }\n\n return null;\n }", "public TXSemanticTag getTopicAsSemanticTag(String si);", "Concept getConcept(String id);", "public static Resource_kind get(String literal) {\n\t\tfor (int i = 0; i < VALUES_ARRAY.length; ++i) {\n\t\t\tResource_kind 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 addTag(String tag, Pregunta p);", "public static ProgrammingLanguage get(String literal) {\n\t\tfor (int i = 0; i < VALUES_ARRAY.length; ++i) {\n\t\t\tProgrammingLanguage 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 static String getTag(String name) {\n\t\treturn tags.get(name);\n\t}", "public Object getTag(String tagName);", "protected String getRequiredLiteral(Node node, int idx, String argumentName)\n {\n if (!requireArgument(node, idx, argumentName)) {\n return null;\n }\n return node.jjtGetChild(idx).literal();\n }", "public static String getPathParameterConceptId(Locale locale, Request request) throws BadRequestException {\n\t\tString conceptId = request.params(\"conceptId\");\n\t\tif (conceptId == null || conceptId.isEmpty()) {\n\t\t\tString userMessage = TemplateFiller.fillTemplate(\n\t\t\t\t\tLanguageHandler.getWord(locale, \"ERROR_BAD_REQUEST_MISSING_URI_PATH_PARAMETER\"), \"conceptId\");\n\t\t\tthrow new BadRequestException(\"The uri path parameter conceptId is missing!\", null, userMessage);\n\t\t}\n\t\treturn conceptId;\n\t}", "public static String getLanguage(final String rfcLocale) {\n return rfcLocale.toLowerCase(Locale.ENGLISH).substring(0, 2);\n }", "private static ResourceBundle locateBundle(final String bundleName, final String lang) {\n \n /* Validate parameters. */\n if (bundleName == null || bundleName.equals(\"\")) { throw new IllegalArgumentException(\"bundleName must be a non-empty string.\"); }\n if (lang == null || lang.equals(\"\")) { throw new IllegalArgumentException(\"lang must be a non-empty string.\"); }\n \n /* Find fallback resource bundle. */\n ResourceBundle fallback;\n try {\n fallback = ResourceBundle.getBundle(bundleName, new Locale(\"bogus\"));\n } catch (MissingResourceException e) {\n fallback = null;\n }\n \n final Locale locale = new Locale(lang);\n ResourceBundle bundle = null;\n try {\n bundle = ResourceBundle.getBundle(bundleName, locale);\n } catch (MissingResourceException e) {\n /* No bundle was found, ignore and move on. */\n }\n \n if (bundle != fallback) { return bundle; }\n \n /* Check if the fallback is actually requested. */\n if (bundle != null && bundle == fallback && locale.getLanguage().equals(Locale.getDefault().getLanguage())) { return bundle; }\n \n /* No bundle found. */\n return null;\n }", "private ReportConcept getRelatedConcept(ReportConcept entry) {\n\t\t// if completly removed, no point in searching\n\t\tif(entry.getLabels().isEmpty())\n\t\t\treturn null;\n\t\t\n\t\tfor (ReportConcept c : concepts) {\n\t\t\t// labels in the new concept are contained within the old concept label list\n\t\t\tif(Collections.indexOfSubList(entry.getLabels(),c.getLabels()) > -1 || Collections.indexOfSubList(c.getLabels(),entry.getLabels()) > -1){\n\t\t\t\t//if(entry.getName().contains(c.getName()) || c.getName().contains(entry.getName())){\n\t\t\t\treturn c;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "@RDF(\"foaf:name\")\n\tString getName();", "Keyword findKeywordByName(String name);", "public static String[] getShortNames(String entityName,\r\n String conceptName) {\r\n return getShortNames(entityName, conceptName,\r\n ArchetypeServiceHelper.getArchetypeService());\r\n }", "@Override\r\n\tpublic Plate findByName(String nom) {\n\t\treturn null;\r\n\t}", "java.lang.String getConceptId();", "private String getName(final String name) {\n\t\treturn bundleI18N.getString(name);\n\t}", "public LanguageAssert hasTag(String tag) {\n\t\tassertThat(actual.getLanguageTag()).as(descriptionText() + \" tag\").isEqualTo(tag);\n\t\treturn this;\n\t}", "public String getName(Locale locale) {\n return Messages.getInstance().getText(locale, \"students.editStudent.breadcrumb\");\n }", "public String getShortTitle(Locale locale)\n {\n // return definition short title for preferred locale\n String title = definition.getShortTitle(locale);\n if (title != null)\n {\n return title;\n }\n\n // return node or default short title for preferred locale\n return super.getShortTitle(locale);\n }", "private static String resolveQualifierFromTypeName(IType sigInterfaceType, String typeName) {\n\n\t\ttry {\n\n\t\t\tString[][] types = sigInterfaceType.resolveType(typeName);\n\t\t\tif (types != null) {\n\t\t\t\t// Returns the first candidate\n\t\t\t\tString qualifier = types[0][0];\n\t\t\t\t//\t\t\t\tString name = types[0][1];\n\t\t\t\treturn qualifier;\n\t\t\t}\n\t\t}\n\t\tcatch (JavaModelException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn null;\n\t}", "public static PseudostateKind get(String literal) {\r\n\t\tfor (int i = 0; i < VALUES_ARRAY.length; ++i) {\r\n\t\t\tPseudostateKind result = VALUES_ARRAY[i];\r\n\t\t\tif (result.toString().equals(literal)) {\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "protected static String getConceptClassNameForCategory(Category category) {\n if (category == Category.CHIRURGIE) {\n return \"Procedure\";\n }\n if (category == Category.LABORATOIRE) {\n return \"Test\";\n }\n if (category == Category.MEDICAMENTS) {\n return \"Drug\";\n }\n return \"Misc\";\n }", "String getTag();", "public String getTitle(Locale locale)\n {\n // return definition short title for preferred locale\n String title = definition.getTitle(locale);\n if (title != null)\n {\n return title;\n }\n\n // return node or default title for preferred locale\n return super.getTitle(locale);\n }", "default void putConcept(ConceptName name, Concept concept) {}", "public final void insertConcept(final String name,\r\n final String generalization) {\r\n int c, l, i, hc;\r\n Concept[] d, dx;\r\n Concept c1, c2;\r\n\r\n d = this.m_data;\r\n l = d.length;\r\n hc = name.hashCode();\r\n\r\n dummy: {\r\n // look if we found a \"dummy concept\"\r\n i = (l - 1);\r\n for (c2 = d[hc & i]; c2 != null; c2 = c2.m_next) {\r\n if (c2.m_name.equals(name)) {\r\n l--;\r\n break dummy;\r\n }\r\n }\r\n\r\n c = this.m_count;\r\n // we need to insert at least one new concept -> update hash\r\n this.m_count = c + 1;\r\n\r\n if ((3 * c) >= (l << 1)) {\r\n i = l - 1;\r\n l <<= 1;\r\n dx = new Concept[l];\r\n\r\n for (--l; i >= 0; i--) {\r\n for (c1 = d[i]; c1 != null; c1 = c2) {\r\n c2 = c1.m_next;\r\n c = (c1.m_name.hashCode() & l);\r\n\r\n c1.m_next = dx[c];\r\n dx[c] = c1;\r\n }\r\n }\r\n\r\n this.m_data = d = dx;\r\n } else\r\n l--;\r\n\r\n // insert new concept.\r\n c = (hc & l);\r\n d[c] = c2 = new Concept(name, d[c], hc);\r\n }\r\n\r\n if (generalization == null)\r\n return;\r\n\r\n hc = generalization.hashCode();\r\n\r\n // search generalization\r\n for (c1 = d[hc & l]; c1 != null; c1 = c1.m_next) {\r\n if (c1.m_name.equals(generalization)) {\r\n c2.m_generalization = c1;\r\n c1.addConcept(c2);\r\n return;\r\n }\r\n }\r\n\r\n // generalization not found! -> insert dummy concept.\r\n\r\n c = (hc & l);\r\n d[c] = c2.m_generalization = new Concept(generalization, d[c], hc);\r\n c2.m_generalization.addConcept(c2);\r\n this.m_count++;\r\n }", "@Nullable\n\tpublic static PlayerIdName loadFromNBT(final NBTTagCompound tagCompound) {\n\t\tif (tagCompound == null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ( !tagCompound.getKeySet().contains(\"UUID\")\n\t\t || !tagCompound.getKeySet().contains(\"name\") ) {\n\t\t\treturn null;\n\t\t}\n\t\tfinal UUID uuid = UUID.fromString(tagCompound.getString(\"UUID\"));\n\t\tfinal String name = tagCompound.getString(\"name\");\n\t\treturn new PlayerIdName(uuid, name);\n\t}", "private Verbum findWordByNomForm(String nomForm, DSElement<Verbum> start){\r\n\t\tif(start == null)\r\n\t\t\treturn null;\t\t\r\n\t\tint cmp = start.getItem().nom.compareToIgnoreCase(nomForm);\r\n\t\tif(cmp == 0){\r\n\t\t\treturn start.getItem();\r\n\t\t}\r\n\t\tif(cmp < 0)\r\n\t\t\treturn findWordByNomForm(nomForm, start.getRight());\r\n\t\tif(cmp > 0)\r\n\t\t\treturn findWordByNomForm(nomForm, start.getLeft());\r\n\t\treturn null;\r\n\t}", "public GenericName getName() {\n return Names.parseGenericName(codeSpace, null, value);\n }", "private static String getTag(String s, ArrayList<Token>list) {\n\t\tfor(int i = 0; i<list.size(); i++){\n\t\t\tif(list.get(i).value.equals(s)){\n\t\t\t\treturn list.get(i).tag.toString();\n\t\t\t}\n\t\t}\n\t\treturn \"null\";\n\t}", "public Optional<Term> getMatchingTerm(Term nextTerm) {\n\t\treturn Optional.ofNullable(terms.get(nextTerm.tag));\n\t}", "String getUnlocalizedName();", "private String getSubstitute(String label) {\n\n\t\tassert !compendium_.getIsInvivo();\n\t\tint index = grn_.getIndexOfNode(label);\n\t\t\n\t\t// If the gene is not part of the compendium or is not a TF, randomly choose a TF \n\t\tString substitute = label;\n\t\t\n\t\tif ((index == -1) || !grn_.getGene(index).getIsTf()) {\n\t\t\tLinkedHashMap<String, String> substitutionLookup = ((CompendiumInsilico) compendium_).getSubstitutions();\n\t\t\tsubstitute = substitutionLookup.get(label);\n\t\t\t\n\t\t\tif (substitute == null) {\n\t\t\t\tindex = grn_.getRandomTf();\n\t\t\t\tsubstitute = grn_.getGene(index).getLabel();\n\t\t\t\tsubstitutionLookup.put(label, substitute);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn substitute;\n\t}", "private static String stripIRI (String inputConcept) {\n\n\t\tString returnedConceptName = null;\n\n\t\tif (inputConcept.contains(\"http://manusquare.project.eu/industrial-manusquare#\")) {\n\t\t\treturnedConceptName = inputConcept.replaceAll(\"http://manusquare.project.eu/industrial-manusquare#\", \"\");\n\t\t} else if (inputConcept.contains(\"http://manusquare.project.eu/core-manusquare#\")) {\n\t\t\treturnedConceptName = inputConcept.replaceAll(\"http://manusquare.project.eu/core-manusquare#\", \"\");\n\t\t} else {\n\t\t\treturnedConceptName = inputConcept;\n\t\t}\n\n\t\treturn returnedConceptName;\n\n\t}" ]
[ "0.60524654", "0.60172415", "0.5491103", "0.5382409", "0.5377872", "0.53664064", "0.5337004", "0.5269337", "0.51773316", "0.5174776", "0.51712507", "0.5065294", "0.49709713", "0.49574617", "0.49388912", "0.49292046", "0.49207643", "0.49120265", "0.49091554", "0.48961097", "0.48727813", "0.48645154", "0.48577124", "0.48530772", "0.48512807", "0.48049882", "0.4803878", "0.48037252", "0.47532868", "0.47478008", "0.4745982", "0.47458544", "0.47372437", "0.46848688", "0.46838197", "0.46838197", "0.46774805", "0.46640202", "0.46596596", "0.46565866", "0.46451244", "0.4639439", "0.46369573", "0.46246153", "0.46150202", "0.4612063", "0.46110806", "0.4565929", "0.45468622", "0.4539315", "0.45382965", "0.45292306", "0.4522292", "0.451218", "0.4509739", "0.45095944", "0.45061645", "0.4502724", "0.44996214", "0.4481135", "0.44751513", "0.4464602", "0.4464602", "0.44305277", "0.44207284", "0.4396945", "0.43948781", "0.43903348", "0.4389973", "0.43835887", "0.4383324", "0.43771806", "0.4372974", "0.43603092", "0.43571767", "0.43498895", "0.43434548", "0.43419906", "0.43416798", "0.43377173", "0.43291447", "0.43228316", "0.43195927", "0.43194854", "0.4312908", "0.43122116", "0.43064848", "0.43054125", "0.42977655", "0.42943144", "0.4292982", "0.42878318", "0.4278126", "0.4277291", "0.42625627", "0.42625305", "0.4261131", "0.42550108", "0.42457837", "0.42394924" ]
0.7300595
0
Configures the default values for a Test, based on the existing values for other tests in the specimen Implements the following rule: If this is the first test, and the specimen has a sample id, set the accession field with this sample id. If this is not the first test, then If the Accession on all the existing tests and the sample ID on the specimen are all the same, set the accession field with this number. If the Lab, Date Ordered, or Date Received on all the existing tests are identical, set these fields with these values.
public static void setTestDefaults(Specimen specimen, Test test) { Set<String> accessionNumberSet = new HashSet<String>(); Set<Date> dateOrderedSet = new HashSet<Date>(); Set<Date> dateReceivedSet = new HashSet<Date>(); Set<Location> labSet = new HashSet<Location>(); // first add the identifier of the sample to the accession number set accessionNumberSet.add(specimen.getIdentifier()); // now loop through all the tests for this sample, excluding the test we want to set the defaults for for (Test t : specimen.getTests()) { if (t != test) { accessionNumberSet.add(t.getAccessionNumber()); dateOrderedSet.add(t.getDateOrdered()); dateReceivedSet.add(t.getDateReceived()); labSet.add(t.getLab()); } } // test if any of are sets contain exactly one non-null member if (accessionNumberSet.size() == 1 && !accessionNumberSet.contains(null)) { test.setAccessionNumber(accessionNumberSet.iterator().next()); } if (dateOrderedSet.size() == 1 && !dateOrderedSet.contains(null)) { test.setDateOrdered(dateOrderedSet.iterator().next()); } if (dateReceivedSet.size() == 1 && !dateReceivedSet.contains(null)) { test.setDateReceived(dateReceivedSet.iterator().next()); } if (labSet.size() == 1 && !labSet.contains(null)) { test.setLab(labSet.iterator().next()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void fillDefaultValues() {\n checkUsingAdaptation();\n tfSemiSaturation.setText(Double.toString(prototypeRule\n .getSemiSaturationConstant()));\n tfSteepness.setText(Double.toString(prototypeRule.getSteepness()));\n tfTimeConstant\n .setText(Double.toString(prototypeRule.getTimeConstant()));\n tsNoise.setSelected(prototypeRule.getAddNoise());\n tsUseAdaptation.setSelected(prototypeRule.getUseAdaptation());\n tfAdaptationTime.setText(Double.toString(prototypeRule\n .getAdaptationTimeConstant()));\n tfAdaptationParam.setText(Double.toString(prototypeRule\n .getAdaptationParameter()));\n randTab.fillDefaultValues();\n }", "public void setTestId(Integer testId) {\n this.testId = testId;\n }", "private void setupInitialValues(){\n\t\tString testDir = getTestDir();\n\t\tsetDirectoryInfoLabel(testDir);\n\t\tlastChoosedDirectory = new File(testDir);\n\t\tregexFrom.setText(sampleRegexFrom);\n\t\tregexTo.setText(sampleRegexTo);\n\t}", "public void setTestValue(Integer testValue) {\n this.testValue = testValue;\n }", "public void setDefaultData()\n\t\t{\n\t\t\t\n\t\t\t//Creating demo/default ADMIN:\n\t\t\t\n\t\t\tUser testAdmin = new User(\"ADMIN\", \"YAGYESH\", \"123\", 123, Long.parseLong(\"7976648278\"));\n\t\t\tdata.userMap.put(testAdmin.getUserId(), testAdmin);\n\t\t\t\n\t\t\t//Creating demo/default CUSTOMER:\n\t\t\tUser tempCustomer = new User(\"CUSTOMER\", \"JOHN\", \"124\", 124, Long.parseLong(\"9462346459\"));\n\t\t\tdata.userMap.put(tempCustomer.getUserId(), tempCustomer);\n\t\t\t\n\t\t\t//Creating Airports:\n\t\t\tAirport airport1 = new Airport(\"Mumbai Chattrapathi Shivaji International Airport\",\n\t\t\t\t\t\t\t\t\t\t\t\"MUMBAI\", \"BOM\");\n\t\t\t\n\t\t\tAirport airport2 = new Airport(\"Bangalore Bengaluru International Airport \",\n\t\t\t\t\t\t\t\t\t\t\t\"Bangalore\", \"BLR\");\n\t\t\t\n\t\t\tAirport airport3 = new Airport(\"New Delhi Indira Gandhi International Airport\",\n\t\t\t\t\t\t\t\t\t\t\t\"New Delhi \", \"DEL\");\n\n\t\t\tAirport airport4 = new Airport(\"Hyderabad Rajiv Gandhi International Airport\",\n\t\t\t\t\t\t\t\t\t\t\t\"Hyderabad\", \"HYD\");\n\n\t\t\tdata.airportMap.put(airport1.getAirportCode(), airport1);\n\t\t\tdata.airportMap.put(airport2.getAirportCode(), airport2);\n\t\t\tdata.airportMap.put(airport3.getAirportCode(), airport3);\n\t\t\tdata.airportMap.put(airport4.getAirportCode(), airport4);\n\t\t\t\n\t\t\t//Creating DateTime Objects:\n\t\t\t\n\t\t\tDate dateTime1 = null;\n\t\t\tDate dateTime2 = null;\n\t\t\tDate dateTime3 = null;\n\t\t\tDate dateTime4 = null;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tdateTime1 = dateFormat.parse(\"12-01-2020 05:12:00\");\n\t\t\t\tdateTime2 = dateFormat.parse(\"02-02-2020 23:45:00\");\n\t\t\t\tdateTime3 = dateFormat.parse(\"12-01-2020 07:12:00\");\n\t\t\t\tdateTime4 = dateFormat.parse(\"03-02-2020 01:45:00\");\n\t\t\t}\n\t\t\tcatch (ParseException e) \n\t\t\t{\n\t\t\t\te.getMessage();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//Creating Schedules:\n\t\t\tSchedule schedule1 = new Schedule(airport1, airport2, dateTime3, dateTime1, dateFormat);\n\t\t\tSchedule schedule2 = new Schedule(airport2, airport3, dateTime3, dateTime1, dateFormat);\n\t\t\tSchedule schedule3 = new Schedule(airport4, airport1, dateTime4, dateTime2, dateFormat);\n\t\t\tSchedule schedule4 = new Schedule(airport3, airport4, dateTime4, dateTime2, dateFormat);\n\t\t\t\n\t\t\t//Creating Flights:\n\t\t\tFlight flight1 = new Flight(\"AB3456\", \"INDIGO\", \"A330\", 293);\n\t\t\tFlight flight2 = new Flight(\"BO6789\", \"JET AIRWAYS\", \"777\", 440);\n\t\t\tdata.flightMap.put(flight1.getFlightNumber(), flight1);\n\t\t\tdata.flightMap.put(flight2.getFlightNumber(), flight2);\n\t\t\t\n\t\t\t//Creating Scheduled Flights:\n\t\t\tScheduledFlight scheduledFlight1 = new ScheduledFlight(flight1, 293, schedule1);\n\t\t\tScheduledFlight scheduledFlight2 = new ScheduledFlight(flight2, 440, schedule2);\n\t\t\tScheduledFlight scheduledFlight3 = new ScheduledFlight(flight1, 293, schedule3);\n\t\t\tScheduledFlight scheduledFlight4 = new ScheduledFlight(flight2, 440, schedule4);\n\t\t\t\n\t\t\t//Creating List of Scheduled Flights:\n\t\t\tdata.listScheduledFlights.add(scheduledFlight1);\n\t\t\tdata.listScheduledFlights.add(scheduledFlight2);\n\t\t\tdata.listScheduledFlights.add(scheduledFlight3);\n\t\t\tdata.listScheduledFlights.add(scheduledFlight4);\n\n\t\t}", "public void setUpTestdata() {\n\t\tsetDefaultUserName(Config.getProperty(\"defaultUserName\"));\r\n\t\tsetDefaultPassword(Config.getProperty(\"defaultPassword\"));\r\n\t\tsetTestsiteurl(Config.getProperty(\"testsiteurl\"));\r\n\t\tsetChromeDriverPath(Config.getProperty(\"chromeDriverPath\"));\r\n\t\tsetGeckoDriverPath(Config.getProperty(\"geckoDriverPath\"));\r\n\t\tsetIeDriverPath(Config.getProperty(\"ieDriverPath\"));\r\n\t}", "public void setTestScore(int testNumber, int score) {\n\t if(testNumber == 1)\n\t\t test1 = score;\n\t else if(testNumber == 2)\n\t\t test2 = score;\n\t else\n\t\t test3 = score;\n }", "public void resetTestVars() {\n\t\tuser1 = new User();\n\t\tuser2 = new User();\n\t\tuser3 = new User();\n\t\tsn = new SocialNetwork();\n\t\tstatus = SocialNetworkStatus.DEFAULT;\n\t\tearly = new Date(25L);\n\t\tmid = new Date(50L);\n\t\tlate = new Date(75L);\n\t}", "private GridCoverageRequest setStandardReaderDefaults(GridCoverageRequest subsettingRequest) throws IOException {\n DateRange temporalSubset = subsettingRequest.getTemporalSubset();\n NumberRange<?> elevationSubset = subsettingRequest.getElevationSubset();\n Map<String, List<Object>> dimensionSubset = subsettingRequest.getDimensionsSubset();\n\n // Reader is not a StructuredGridCoverage2DReader instance. Set default ones with policy \"time = max, elevation = min\".\n\n // Setting default time\n if (temporalSubset == null) {\n // use \"max\" as the default\n Date maxTime = accessor.getMaxTime();\n if (maxTime != null) {\n temporalSubset = new DateRange(maxTime, maxTime);\n }\n }\n\n // Setting default elevation\n if (elevationSubset == null) {\n // use \"min\" as the default\n Number minElevation = accessor.getMinElevation();\n if (minElevation != null) {\n elevationSubset = new NumberRange(minElevation.getClass(), minElevation, minElevation);\n }\n }\n\n // Setting default custom dimensions\n final List<String> customDomains = accessor.getCustomDomains();\n int availableCustomDimensions = 0; \n int specifiedCustomDimensions = 0;\n if (customDomains != null && !customDomains.isEmpty()) {\n availableCustomDimensions = customDomains.size();\n specifiedCustomDimensions = dimensionSubset != null ? dimensionSubset.size() : 0; \n if (dimensionSubset == null) {\n dimensionSubset = new HashMap<String, List<Object>>();\n }\n }\n if (availableCustomDimensions != specifiedCustomDimensions) {\n setDefaultCustomDimensions(customDomains, dimensionSubset);\n }\n\n subsettingRequest.setDimensionsSubset(dimensionSubset);\n subsettingRequest.setTemporalSubset(temporalSubset);\n subsettingRequest.setElevationSubset(elevationSubset);\n return subsettingRequest;\n }", "public void initializeDefault() {\n\t\tthis.numAuthorsAtStart = 5;\n\t\tthis.numPublicationsAtStart = 20;\n\t\tthis.numCreationAuthors = 0;\n\t\tthis.numCreationYears = 10;\n\n\t\tyearInformation = new DefaultYearInformation();\n\t\tyearInformation.initializeDefault();\n\t\tpublicationParameters = new DefaultPublicationParameters();\n\t\tpublicationParameters.initializeDefault();\n\t\tpublicationParameters.setYearInformation(yearInformation);\n\t\tauthorParameters = new DefaultAuthorParameters();\n\t\tauthorParameters.initializeDefault();\n\t\ttopicParameters = new DefaultTopicParameters();\n\t\ttopicParameters.initializeDefault();\n\t}", "public void setTestTime(Integer testTime) {\n this.testTime = testTime;\n }", "@Override\n\t public String assignTest(BigInteger studentId,BigInteger testId)\n\t\t{\n\t\t\tOptional<Student>findById=studentrepo.findById(studentId);\n\t\t\tOptional<Test>test=testrepo.findById(testId);\n\t\t\tif(findById.isPresent()&& test.isPresent())\n\t\t\t{\n\t\t\t\tStudent student=findById.get();\n\t\t\t\tstudent.setTestId(testId);\n\t\t\t\tstudentrepo.save(student);\n\t\t\t\treturn \"Test Assigned\";\n\t\t\t\t\n\t\t\t}\n\t\t\treturn \"User or Test does not exist\";\n\t\t\t\n\t\t}", "public void testGetNewValue_Default_Accuracy() {\r\n assertEquals(\"The newValue value should be got properly.\", null, auditDetail.getNewValue());\r\n }", "@Override\r\n\t@Before\r\n\tpublic void testInit() {\t\r\n\t\tsuper.testInit();\r\n\t\tsessionController.login(testHospitalAdmin, getCampus(0));\r\n\t\tadminController.addDoctor(\"Frank\");\r\n\r\n\t\tsessionController.login(testC1Nurse1, getCampus(0));\r\n\t\ttestPatient2 = nurseController.registerNewPatient(\"Bob\");\r\n\t\ttestPatient3 = nurseController.registerNewPatient(\"Clair\");\r\n\t\ttestPatient4 = nurseController.registerNewPatient(\"Dennis\");\r\n\t\ttestPatient5 = nurseController.registerNewPatient(\"Eric\");\r\n\t\t\r\n\t}", "private void SetParameters(XmlTest test){\r\n\t\t for (Map.Entry<String,String> entry : TestsParamList.get(test.getName()).entrySet()){\r\n\t\t\t test.addParameter(entry.getKey(), entry.getValue());\r\n\t\t }\r\n\t}", "public void setDefaultSettings()\n {\n this.IndexerEffort = 0;\n this.indexZIPFiles = true;\n this.thumbnailsMatrix = \"64\";\n this.SaveThumbnails = false;\n }", "private DefaultSetting getSampleDefaultSetting() {\n DefaultSetting setting = new DefaultSetting(\"\",\n \"\",\n 5,\n Token.DIGIT,\n \"d\",\n 1,\n true,\n true,\n true);\n\n return setting;\n }", "public void initDefaultValues(PathologyReportReviewParameter t)\r\n\t{\n\r\n\t}", "private void setSWTTestIDs() {\n\t\t\n\t\tString label = \"General Settings\";\n\t\t\n\t\t//set keys for SWTBot testing\n\t\tresultFilepathField.setData(\"org.eclipse.swtbot.widget.key\", label+\".resultFilepathField\");\n\t\tdelimiterCombo.setData(\"org.eclipse.swtbot.widget.key\", label+\".delimiterCombo\");\n\t\tsortResultCheckbox.setData(\"org.eclipse.swtbot.widget.key\", label+\".sortResultCheckbox\");\n\t\tmakeUniqueCheckbox.setData(\"org.eclipse.swtbot.widget.key\", label+\".makeUniqueCheckbox\");\n\t\ttopLevelCheckbox.setData(\"org.eclipse.swtbot.widget.key\", label+\".topLevelCheckbox\");\n\t\tolderColumnCombo.getCombo().setData(\"org.eclipse.swtbot.widget.key\", label+\".olderColumnCombo\");\n\t\tyoungerColumnCombo.getCombo().setData(\"org.eclipse.swtbot.widget.key\", label+\".youngerColumnCombo\");\n\t\ttopLevelField.setData(\"org.eclipse.swtbot.widget.key\", label+\".topLevelField\");\n\t}", "public BloodTest() {\n setRedCellCount(0);\n setWhiteCellCount(0);\n setPlateletCount(0);\n setPatient(new Patient());\n setTestDate(LocalDate.now());\n setId(0);\n }", "protected void testInit() {\n this.auths = CitiesDataType.getTestAuths();\n this.documentKey = CityField.EVENT_ID.name();\n }", "protected void testInit() {\n this.auths = CitiesDataType.getTestAuths();\n this.documentKey = CityField.EVENT_ID.name();\n }", "public void setTestSettings(String testServerAddress) {\n INDEX_NAME = testServerAddress;\n }", "public void setTestNo(Long testNo) {\n this.testNo = testNo;\n }", "private void testSet() {\n init();\n assertTrue(\"l2.set(l2, 0, 39)\", \n FListInteger.get(l2.set(l2, 0, 39), 0) == 39);\n assertTrue(\"l2.set(l2, 0, 51)\", \n FListInteger.get(l2.set(l2, 0, 51), 0) == 51);\n assertTrue(\"l1.set(l1, 0, 10101)\",\n FListInteger.get(l1.set(l1, 0, 10101), 0) == 10101);\n }", "public void setTestId(Long testId) {\n this.testId = testId;\n }", "private void setValues() {\n //Calls for new assessment\n Assessment assessment = new Assessment();\n //Updates the local db assessmentDao with courseID and assessment ID\n assessment = db.assessmentDao().getAssessment(courseID, assessmentID);\n //Gets the assessment details name\n String name = assessment.getAssessment_name();\n //Gets the assessment details type\n String type = assessment.getAssessment_type();\n //Gets the assessment details status\n String status = assessment.getAssessment_status();\n //Gets the assessment details date\n String dDate = DateFormat.format(\"MM/dd/yyyy\", assessment.getAssessment_due_date()).toString();\n boolean alert1 = assessment.getAssessment_alert();\n //Gets the assessment details alert bar\n String alert = \"Off\";\n if (alert1) {\n alert = \"On\";\n }\n //Sets assessment details Name\n adName.setText(name);\n //Sets assessment details type\n adType.setText(type);\n //Sets assessment details status\n adStatus.setText(status);\n //Sets assessment details due date\n adDueDate.setText(dDate);\n //Sets assessment details alert\n adAlert.setText(alert);\n }", "public void initDefaultValues() {\n }", "public void setNumberTests(int numberTests) {\n this.numberTests = numberTests;\n }", "private void updateDefaultValues(DefaultValues defValue) throws NbaDataAccessException {\n setDefValuesKeys(defValue); //SPR2741\n nbaAcdb.updateDefaultValues(defValue);\n }", "@Test\n\tpublic void testPropertyDefaultValue() {\n\t\tfinal Base base = context.mock(Base.class);\n\t\tfinal String value = \"value\";\n\t\tcontext.checking(new PropertyEnabledExpectations() {\n\t\t\t{\n\t\t\t\tallowingProperty(base).getId();\n\t\t\t\twill(returnValue(INITIAL));\n\t\t\t}\n\t\t});\n\n\t\tassertEquals(\"Initial value not set\", INITIAL, base.getId());\n\t\tbase.setId(value);\n\t\tassertEquals(\"Initial value should be able to be changed\", value, base.getId());\n\t}", "private void setDefaultConfiguration(){\n\t\tthis.setProperty(\"DefaultNodeCapacity\", \"5\");\n\t\tthis.setProperty(\"ReplicaNumber\", \"3\");\n\t\tthis.setProperty(\"JobReattemptTimes\", \"2\");\n\t\tthis.setProperty(\"ReducerCount\", \"3\");\n\t}", "@Test\n public void test_CopyValuesFrom() {\n //This test uses specified values.\n System.out.println(\"Testing MeasuredRatioModel's copyValuesFrom(MeasuredRatioModel parent)\");\n MeasuredRatioModel instance0 = new MeasuredRatioModel(\"Specific\",new BigDecimal(\"12.34567890\"),\"ABS\",new BigDecimal(\"0.987654321\"),false,true);\n MeasuredRatioModel blank = new MeasuredRatioModel();\n\n /**Initializing a Variable to test if names are equal before or after\n * If this value is set to 1 in the following try catch block, then the\n * names were not equal beforehand and should not be equal afterwards.\n * If the variable remains at 0 then the names were equal beforehand and\n * therefore should remain the same afterwards.\n */\n \n int nameAfter=0;\n try{\n assertEquals(instance0.name,blank.name);\n }\n catch(org.junit.ComparisonFailure except1){\n nameAfter=1;\n }\n //Copying Values from Specific ValueModel to Default\n blank.copyValuesFrom(instance0);\n //Test if Expected is Equal to the Result\n assertEquals(instance0.value,blank.value);\n assertEquals(instance0.oneSigma,blank.oneSigma);\n assertEquals(instance0.uncertaintyType,blank.uncertaintyType);\n assertEquals(instance0.isFracCorr(),blank.isFracCorr());\n assertEquals(instance0.isOxideCorr(),blank.isOxideCorr());\n \n if(nameAfter==1){\n //The name field should not be equal between the two ValueModels.\n try{\n assertEquals(instance0.name,blank.name);\n //Fail if expected Exception not Thrown\n fail(\"org.junit.ComparisonFailure throwable not thrown - the Name Field is being copied!\");\n }\n catch(org.junit.ComparisonFailure except0){\n \n }\n }\n //This test uses default values.\n instance0 = new MeasuredRatioModel();\n blank = new MeasuredRatioModel();\n blank.copyValuesFrom(instance0);\n assertEquals(instance0.value,blank.value);\n assertEquals(instance0.oneSigma,blank.oneSigma);\n assertEquals(instance0.uncertaintyType,blank.uncertaintyType);\n assertEquals(instance0.name,blank.name);\n assertEquals(instance0.isFracCorr(),blank.isFracCorr());\n assertEquals(instance0.isOxideCorr(),blank.isOxideCorr());\n //This test uses default values, save for the name field.\n instance0 = new MeasuredRatioModel(\"Specific\",new BigDecimal(\"213\"),\"ABS\",new BigDecimal(\"0.4324\"),true,false);\n blank = new MeasuredRatioModel(\"Specific\",new BigDecimal(\"12.4332\"),\"ABS\",new BigDecimal(\"0.654654\"),false,true);\n \n /**Initializing a Variable to test if names are equal before or after\n If this value is set to 1 in the following try catch block, then the\n * names were not equal beforehand and should not be equal afterwards.\n * If the variable remains at 0 then the names were equal beforehand and\n * therefore should remain the same afterwards.\n */\n \n nameAfter=0;\n try{\n assertEquals(instance0.name,blank.name);\n }\n catch(org.junit.ComparisonFailure except1){\n nameAfter=1;\n }\n \n //Copying Values from Specific ValueModel to Default\n blank.copyValuesFrom(instance0);\n //Test if Expected is Equal to the Result\n assertEquals(instance0.value,blank.value);\n assertEquals(instance0.oneSigma,blank.oneSigma);\n assertEquals(instance0.uncertaintyType,blank.uncertaintyType);\n assertEquals(instance0.isFracCorr(),blank.isFracCorr());\n assertEquals(instance0.isOxideCorr(),blank.isOxideCorr());\n if(nameAfter==1){\n //The name field should not be equal between the two ValueModels.\n try{\n assertEquals(instance0.name,blank.name);\n //Fail if expected Exception not Thrown\n fail(\"org.junit.ComparisonFailure throwable not thrown - the Name Field is being copied!\");\n }\n catch(org.junit.ComparisonFailure except0){\n \n }\n }\n }", "@Override\n\tpublic void setTest() {\n\t}", "private void setDefaultValues()\r\n\t{\r\n\t\tif (m_receiverAddress == null || m_receiverAddress.equals(\"\") )\r\n\t\t{\r\n\t\t\tm_receiverAddress = \"[email protected]\";\r\n\t\t}\r\n\r\n\t\tif (m_replyAddress == null || m_replyAddress.equals(\"\") )\r\n\t\t{\r\n\t\t\tm_replyAddress = \"no return\";\r\n\t\t}\r\n\r\n\t\tif (m_senderName == null || m_senderName.equals(\"\") )\r\n\t\t{\r\n\t\t\tm_senderName = \"Unknown Sender\";\r\n\t\t}\r\n\r\n\t\tif (m_subject == null || m_subject.equals(\"\") )\r\n\t\t{\r\n\t\t\tm_subject = \"AN.ON support request\";\r\n\t\t}\r\n\r\n\t\tif (m_bodyText == null || m_bodyText.equals(\"\") )\r\n\t\t{\r\n\t\t\tm_bodyText = \"message is empty\";\r\n\t\t}\r\n\r\n\t}", "public void setTesting(double testing) {\r\n this.testing = testing;\r\n }", "@BeforeClass\n public static void initializeTestValues() throws IllegalValueException {\n greaterAmount = Amount.getSum(ParserUtil.parseAmount(DECIMAL_STRING), DECIMAL_OFFSET);\n lesserAmount = Amount.getDiff(ParserUtil.parseAmount(DECIMAL_STRING), DECIMAL_OFFSET);\n greaterPrice = new Price();\n greaterPrice.setCurrent(Amount.getSum(ParserUtil.parseAmount(DECIMAL_STRING), DECIMAL_OFFSET));\n lesserPrice = new Price();\n lesserPrice.setCurrent(Amount.getDiff(ParserUtil.parseAmount(DECIMAL_STRING), DECIMAL_OFFSET));\n ZERO_PRICE.setCurrent(new Amount(\"0\"));\n NEW_PRICE.setCurrent(new Amount(\"2.0\"));\n }", "public TestID(int testID, String testType, String testState)\n {\n this.m_testID = testID;\n this.m_testType = testType;\n this.m_testState = testState;\n this.m_testStatus = \"\";\n\n }", "public void initDefaultValues(SurgicalPathologyReport t)\r\n\t{\n\r\n\t}", "public static void generateDefaults() {\n Building temp = BuildingList.getBuilding(0);\n SubAreas temp2 = temp.getSubArea(1);\n temp2.createFireSensor();\n temp2.createMotionSensor();\n temp2 = temp.getSubArea(2);\n temp2.createMotionSensor();\n temp2 = temp.getSubArea(3);\n temp2.createMotionSensor();\n temp2.createFireSensor();\n temp2 = temp.getSubArea(5);\n temp2.createFireSensor();\n temp2 = temp.getSubArea(6);\n temp2.createFireSensor();\n temp2.createMotionSensor();\n }", "private void assignTests(Patient patient, String test) {\n patient.setTestToPass(test);\n }", "public void testGetOldValue_Default_Accuracy() {\r\n assertEquals(\"The oldValue value should be got properly.\", null, auditDetail.getOldValue());\r\n }", "public void setUp() {\r\n state1 = new DateState(new State(20200818, \"VM\", 110, 50, 123, 11, 19,\r\n 65, \"A+\", 15)); // root\r\n test1 = state1;\r\n state2 = new DateState(new State(20200818, \"VA\", 72, 43, 79, 12, 17, 33,\r\n \"B\", 9));\r\n state3 = new DateState(new State(20200817, \"VA\", 72, 43, 79, 12, 17, 33,\r\n \"B\", 9));\r\n state4 = new DateState(new State(20200817, \"VM\", 110, 50, 123, 11, 19,\r\n 65, \"A+\", 15));\r\n nullState = null;\r\n }", "@Test\n public void testDAM30103001() {\n // settings as done for testDAM30102001 are identical\n testDAM30102001();\n }", "public JTestDefinition allDefaults(){\n return JTestDefinition.builder(Id.of(\"all defaults\"), getEndpoints()).build();\n }", "@Test\n public void needSetACrowdTest() {\n // TODO: test needSetACrowd\n }", "@Before\n public void setUp() throws IllegalAccessException {\n FieldUtils.writeDeclaredField(dtoConverter,\n \"defaultUsername\", \"testinguser\", true);\n FieldUtils.writeDeclaredField(dtoConverter,\n \"defaultLatitude\", 52.31, true);\n FieldUtils.writeDeclaredField(dtoConverter,\n \"defaultLongitude\", 85.10, true);\n\n when(user.username()).thenReturn(\"tester\");\n when(user.id()).thenReturn(0);\n\n when(location.latitude()).thenReturn(51.28f);\n when(location.longitude()).thenReturn(0.0f);\n }", "@Override\n\tpublic MedicalTest modifyTest(MedicalTest test) {\n\n\t\tMedicalTestUtil.checkPresenceOfTest(test);\n return testDao.save(test);\n\t}", "void setTestDescription(TestDescription td) {\n if (td == null) {\n return;\n }\n\n String name = td.getRootRelativeURL();\n if (!testURL.equals(name)) {\n throw new IllegalStateException();\n }\n\n if (desc != null) { // compare if possible\n if (!desc.equals(td)) { // test descriptions are not the same\n // accept new TD, reset this TR\n // reset status to a special one\n execStatus = tdMismatch;\n desc = td;\n\n props = emptyStringArray;\n resultsFile = null;\n env = emptyStringArray;\n sections = emptySectionArray;\n\n if (isMutable()) {\n createSection(MSG_SECTION_NAME);\n }\n } else {\n // TDs are equal, no action, drop thru and return\n }\n } else {\n desc = td;\n }\n }", "public void testGetId_Default_Accuracy() {\r\n assertEquals(\"The id value should be got properly.\", -1, auditDetail.getId());\r\n }", "@Test\r\n public void test_getContestId_Accuracy() {\r\n instance = new GetDocumentFileContestAction();\r\n assertEquals(\"incorrect default value\", 0, instance.getContestId());\r\n instance.setContestId(1);\r\n assertEquals(\"incorrect value after setting\", 1, instance.getContestId());\r\n }", "public MTest(Properties ctx, String testString, int testNo) {\n\n super(ctx, 0, null);\n testString\t= testString + \"_\" + testNo;\n setName(testString);\n setDescription(testString + \" \" + testString + \" \" + testString);\n setHelp(getDescription() + \" - \" + getDescription());\n setT_Date(new Timestamp(System.currentTimeMillis()));\n setT_DateTime(new Timestamp(System.currentTimeMillis()));\n setT_Integer(testNo);\n setT_Amount(new BigDecimal(testNo));\n setT_Number(Env.ONE.divide(new BigDecimal(testNo), BigDecimal.ROUND_HALF_UP));\n\n //\n setC_Currency_ID(100);\t\t// USD\n setC_Location_ID(109);\t\t// Monroe\n setC_UOM_ID(100);\t\t// Each\n\n // setC_BPartner_ID(C_BPartner_ID);\n // setC_Payment_ID(C_Payment_ID);\n // setM_Locator_ID(M_Locator_ID);\n // setM_Product_ID(M_Product_ID);\n\n }", "@Test\n public void test_getAndSetFieldName_Methods() throws Exception {\n System.out.println(\"test_getAndSet_FieldName_Methods\");\n // FieldSet test values\n\n\n FieldSetTuple__net$__$unconventionalthinking$__$matrix$__$schema$_CC_$WEB$__$FORM$_S_$FORM$__$REQUIRED formRequired_FieldSet = new FieldSetTuple__net$__$unconventionalthinking$__$matrix$__$schema$_CC_$WEB$__$FORM$_S_$FORM$__$REQUIRED(executeInfo, null);\n\n formRequired_FieldSet.schemaInfo_Positioned = schemaInfoFieldSet_formRequired;\n\n\n\n\n // Test the Special Field-Value Get & Set methods______________________________________________________________\n\n\n\n FieldSet_TestUtilities.test_SetAndGetFieldName(executeInfo, formRequired_FieldSet, FieldSetTuple__net$__$unconventionalthinking$__$matrix$__$schema$_CC_$WEB$__$FORM$_S_$FORM$__$REQUIRED.class ,\n \"set_IsRequired\", Symbol.class, \"set_IsRequired__Special\", \"get_IsRequired\",\n notRequired, null, null, notRequired); // last 4 params: expected value, null expected value, unused expected value, default expected value \n\n\n FieldSet_TestUtilities.test_SetAndGetFieldName(executeInfo, formRequired_FieldSet, FieldSetTuple__net$__$unconventionalthinking$__$matrix$__$schema$_CC_$WEB$__$FORM$_S_$FORM$__$REQUIRED.class ,\n \"set_RequiredImagePath\", String.class, \"set_RequiredImagePath__Special\", \"get_RequiredImagePath\",\n \"\\test\\required.gif\", null, null, \"/images/required.gif\"); // last 4 params: expected value, null expected value, unused expected value, default expected value \n\n FieldSet_TestUtilities.test_SetAndGetFieldName(executeInfo, formRequired_FieldSet, FieldSetTuple__net$__$unconventionalthinking$__$matrix$__$schema$_CC_$WEB$__$FORM$_S_$FORM$__$REQUIRED.class ,\n \"set_ImageHeight\", Integer.TYPE, \"set_ImageHeight__Special\", \"get_ImageHeight\",\n 11, -1, -1, 6); // last 4 params: expected value, null expected value, unused expected value, default expected value \n\n FieldSet_TestUtilities.test_SetAndGetFieldName(executeInfo, formRequired_FieldSet, FieldSetTuple__net$__$unconventionalthinking$__$matrix$__$schema$_CC_$WEB$__$FORM$_S_$FORM$__$REQUIRED.class ,\n \"set_ImageWidth\", Integer.TYPE, \"set_ImageWidth__Special\", \"get_ImageWidth\",\n 12, -1, -1, 7); // last 4 params: expected value, null expected value, unused expected value, default expected value \n\n\n\n }", "protected void setUp() {\r\n auditDetail = new AuditDetail();\r\n }", "@Before\n public void init() {\n final Map<String, DataType> defaultTypes = new HashMap<>();\n defaultTypes.put(\"frieda\", StringCell.TYPE);\n defaultTypes.put(\"berta\", StringCell.TYPE);\n ReadAdapterFactory<String, String> readAdapterFactory = new ReadAdapterFactory<String, String>() {\n\n @Override\n public ReadAdapter<String, String> createReadAdapter() {\n return new TestReadAdapter();\n }\n\n @Override\n public ProducerRegistry<String, ? extends ReadAdapter<String, String>> getProducerRegistry() {\n return m_producerRegistry;\n }\n\n @Override\n public Map<String, DataType> getDefaultTypeMap() {\n return defaultTypes;\n }\n\n };\n m_testInstance = new DefaultTypeMappingFactory<>(readAdapterFactory);\n }", "private void setDefaultValues() {\r\n this.nodeDegreeSpinner.setValue(display_node_degree_default);\r\n this.displayEdgesSpinner.setValue(display_edges_default);\r\n this.scaleSpinner.setValue(scale_default);\r\n this.minweightSpinner.setValue(minweight_edges_default);\r\n this.iterationsSpinner.setValue(iterations_default);\r\n this.vote_value.setValue(vote_value_default);\r\n this.mut_value.setValue(mut_value_default);\r\n this.keep_value.setValue(keepclass_value_default);\r\n\r\n this.only_sub.setSelected(display_sub_default);\r\n this.top.setSelected(true);\r\n this.continuous.setSelected(true);\r\n this.dec.setSelected(true);\r\n this.vote_value.setEnabled(false);\r\n this.is_alg_started = false;\r\n }", "private void setDefaults() {\n\t\tequipActions = new String[] { \"Remove\", null, \"Operate\", null, null };\n\t\tmodelId = 0;\n\t\tname = null;\n\t\tdescription = null;\n\t\tmodifiedModelColors = null;\n\t\toriginalModelColors = null;\n\t\tmodifiedTextureColors = null;\n\t\toriginalTextureColors = null;\n\t\tmodelZoom = 2000;\n\t\tmodelRotation1 = 0;\n\t\tmodelRotation2 = 0;\n\t\tmodelRotationY = 0;\n\t\tmodelOffset1 = 0;\n\t\tmodelOffset2 = 0;\n\t\tstackable = false;\n\t\tvalue = 1;\n\t\tmembersObject = false;\n\t\tgroundOptions = new String[5];\n\t\tinventoryOptions = new String[5];\n\t\tmaleModel = -1;\n\t\tanInt188 = -1;\n\t\tmaleOffset = 0;\n\t\tfemaleModel = -1;\n\t\tanInt164 = -1;\n\t\tfemaleOffset = 0;\n\t\tanInt185 = -1;\n\t\tanInt162 = -1;\n\t\tanInt175 = -1;\n\t\tanInt166 = -1;\n\t\tanInt197 = -1;\n\t\tanInt173 = -1;\n\t\tstackIDs = null;\n\t\tstackAmounts = null;\n\t\tcertID = -1;\n\t\tcertTemplateID = -1;\n\t\tanInt167 = 128;\n\t\tanInt192 = 128;\n\t\tanInt191 = 128;\n\t\tanInt196 = 0;\n\t\tanInt184 = 0;\n\t\tteam = 0;\n\n\t\topcode140 = -1;\n\t\topcode139 = -1;\n\t\topcode148 = -1;\n\t\topcode149 = -1;\n\n\t\tsearchableItem = false;\n\t}", "public synchronized static void initConfig(ITestContext context) {\n SeLionLogger.getLogger().entering(context);\n Map<ConfigProperty, String> initialValues = new HashMap<>();\n Map<String, String> testParams = context.getCurrentXmlTest().getLocalParameters();\n if (!testParams.isEmpty()) {\n for (ConfigProperty prop : ConfigProperty.values()) {\n // Check if a selionConfig param resides in the <test>\n String newValue = testParams.get(prop.getName());\n // accept param values that are empty in initialValues.\n if (newValue != null) {\n initialValues.put(prop, newValue);\n }\n }\n }\n\n ConfigManager.addConfig(context.getCurrentXmlTest().getName(), new LocalConfig(initialValues));\n SeLionLogger.getLogger().exiting();\n }", "protected void preTest() {\n\t\tprintTestParmas();\n\t\tif (attenuatorSetUnderTest != null) {\n\t\t\tperipheralsConfig.setAttenuatorSetValue(attenuatorSetUnderTest,\n\t\t\t\t\tattenuatorSetUnderTest.getDefaultValueAttenuation());\n\t\t} else {\n\t\t\treport.report(\"There is no attenuator set \");\n\t\t}\n\t\tchangeOtherENBsToOOS();\n\n\t\t/*if (runWithDynamicCFI)\n\t\t\tenbConfig.enableDynamicCFI(this.dut);\n\t\telse\n\t\t\tenbConfig.disableDynamicCFI(this.dut);*/\n\t\t\n\t\tgetRadioProfile();\n\n\t\tprintResultsForTest = true;\n\t\tresetTestBol = false;\n\t\texceptionThrown = false;\n\t}", "public void setTestSetId(String testSetId) {\n this.testSetId = testSetId;\n }", "public void setTestSetId(String testSetId) {\n this.testSetId = testSetId;\n }", "@Test\n public void testDefaults() {\n context = new MockServletContext();\n configService = new ConfigServiceImpl(context);\n\n ValidYears years = configService.getValidYears();\n\n assertThat(years.getCurrent(), equalTo(LocalDate.now().getYear()));\n assertThat(years.getInterim(), nullValue());\n }", "public void setTestAmount(Integer testAmount) {\n this.testAmount = testAmount;\n }", "public void updateWithTestStats() {\n\t\tBasicDBObject updateQuery = new BasicDBObject(); \n\t\tBasicDBObject fieldSets = new BasicDBObject(); \n\t\tfieldSets.put(\"numFailedTests\", numFailedTests); \n\t\tfieldSets.put(\"numPassedTests\", numPassedTests); \n\t\tfieldSets.put(\"testSuiteName\", testSuiteName); \n\t\tfieldSets.put(\"testEndTime\", testEndTime); \n\t\tupdateQuery.put( \"$set\", fieldSets); \n\t\tappendData(updateQuery);\n\t}", "public void setCreationDefaultValues()\n {\n this.setDescription(this.getPropertyID()); // Warning: will be lower-case\n this.setDataType(\"\"); // defaults to \"String\"\n this.setValue(\"\"); // clear value\n //super.setRuntimeDefaultValues();\n }", "@Test\n public void testGetDefaultValues()\n { \n assertThat(m_SUT.getDefaultValues(), is(m_DefaultValues));\n }", "@Test(groups = {\"Sprint54\"}, description = \"'Reset all' should reset search conditions in default layout.\")\r\n\tpublic void SprintTest54_1_22_1() throws Exception {\r\n\r\n\t\tdriver = null; \r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConfigurationPage configurationPage = LoginPage.launchDriverAndLoginToConfig(driver, true); //Launched driver and logged in\r\n\r\n\t\t\t//Step-1 : Navigate to Vault in tree view\r\n\t\t\t//-----------------------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getPageName().toUpperCase().equalsIgnoreCase(testVault.toUpperCase())) //Checks if navigated to vault settings page\r\n\t\t\t\tthrow new Exception(\"Vault settings page in configuration is not opened.\");\r\n\r\n\t\t\tLog.message(\"1. Navigated to Vault settings page.\");\r\n\r\n\t\t\t//Step-2 : Select Default layout and save the settings\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_Default.Value); //Sets as default layout\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getLayout().equalsIgnoreCase(Caption.ConfigSettings.Config_Default.Value)) //Verifies if default layout is selected\r\n\t\t\t\tthrow new Exception(\"Default layout is not selected.\");\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings()) //Saves the settings\r\n\t\t\t\tthrow new Exception(\"Settings are not saved properly.\");\r\n\r\n\t\t\tif (!configurationPage.logOut()) //Logs out from configuration page\r\n\t\t\t\tthrow new Exception(\"Log out is not successful after saving the settings in configuration page.\");\r\n\r\n\t\t\tLog.message(\"2. Default layout is selected and settings are saved.\");\r\n\r\n\t\t\t//Step-3 : Login to the default page and change the search word\r\n\t\t\t//-------------------------------------------------------------\r\n\t\t\tHomePage homePage = LoginPage.launchDriverAndLogin(driver, false); //Launches and logs into the default page\r\n\r\n\t\t\tLog.message(\"3. Logged into the default page.\");\r\n\r\n\t\t\t//Step-4 : Change the search option to Any word\r\n\t\t\t//----------------------------------------------\r\n\t\t\thomePage.searchPanel.clickAdvancedSearch(true); //Clicks Advanced search button\r\n\t\t\tString prevOption = homePage.searchPanel.getSelectedSearchOption(); //Gets the selected search option\r\n\t\t\thomePage.searchPanel.setSearchOption(Caption.Search.SearchAnyWord.Value); //Sets Search option to Search any word\r\n\r\n\t\t\tLog.message(\"4. Search option is modified from '\" + prevOption + \"' to '\" + Caption.Search.SearchAnyWord.Value + \"'.\");\r\n\r\n\t\t\t//Step-5 : Click Reset all button\r\n\t\t\t//-------------------------------\r\n\t\t\thomePage.searchPanel.resetAll(); //Clicks Reset all button\r\n\r\n\t\t\tLog.message(\"5. Reset all button is clicked.\");\r\n\r\n\t\t\t//Verification : Verify if Reset all button reset the conditions\r\n\t\t\t//---------------------------------------------------------------\r\n\t\t\tif (homePage.searchPanel.getSelectedSearchOption().equalsIgnoreCase(prevOption)) //Verifies if reset all has reset the conditions\r\n\t\t\t\tLog.pass(\"Test case Passed. Reset all has reset the conditions in default layout.\");\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test case Failed. Reset all has not reset the conditions in default layout.\", driver);\r\n\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tConfigurationPage configurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\t\t\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_Default.Value);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\r\n\t\t} //End finally\r\n\r\n\t}", "public void setDefaultNumber(Integer defaultNumber) {\n this.defaultNumber = defaultNumber;\n }", "@Override\r\n\t@BeforeMethod\r\n\tpublic void initSetting() {\n\t\tSystem.out.println(\"start\");\r\n\t\toTest.initSetting();\r\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 }", "private void runPerViewSettingsTest(XWalkViewSettingsTestHelper helper0,\n XWalkViewSettingsTestHelper helper1) throws Throwable {\n helper0.ensureSettingHasInitialValue();\n helper1.ensureSettingHasInitialValue();\n\n helper1.setAlteredSettingValue();\n helper0.ensureSettingHasInitialValue();\n helper1.ensureSettingHasAlteredValue();\n\n helper1.setInitialSettingValue();\n helper0.ensureSettingHasInitialValue();\n helper1.ensureSettingHasInitialValue();\n\n helper0.setAlteredSettingValue();\n helper0.ensureSettingHasAlteredValue();\n helper1.ensureSettingHasInitialValue();\n\n helper0.setInitialSettingValue();\n helper0.ensureSettingHasInitialValue();\n helper1.ensureSettingHasInitialValue();\n\n helper0.setAlteredSettingValue();\n helper0.ensureSettingHasAlteredValue();\n helper1.ensureSettingHasInitialValue();\n\n helper1.setAlteredSettingValue();\n helper0.ensureSettingHasAlteredValue();\n helper1.ensureSettingHasAlteredValue();\n\n helper0.setInitialSettingValue();\n helper0.ensureSettingHasInitialValue();\n helper1.ensureSettingHasAlteredValue();\n\n helper1.setInitialSettingValue();\n helper0.ensureSettingHasInitialValue();\n helper1.ensureSettingHasInitialValue();\n }", "public final void setDefautlVals() {\n this.createTime = this.writeTime = GlobalMethods.getTimeStamp(null);\n this.createId = this.writeId = PackagingVars.context.getUser().getId();\n }", "public void setGroupValue(String testCaseID)\r\n\t{\r\n\t\tgroupTestID=testCaseID;\r\n\t\tgroupTestScenario=getTestScenario(testCaseID);\t\r\n\t\tLog.info(\"======== \"+groupTestID+\" : \"+groupTestScenario+\" ========\");\r\n\t}", "@Before\n public void setUp() {\n defaultColor1 = new Color(10, 10, 10);\n defaultPosition1 = new Position(0, 100);\n defaultSize1 = new Size(20, 20);\n defaultShape1 = new Rectangle(defaultColor1, defaultPosition1, defaultSize1);\n defaultColor2 = new Color(100, 100, 100);\n defaultPosition2 = new Position(50, 50);\n defaultSize2 = new Size(25, 25);\n defaultShape2 = new Oval(defaultColor2, defaultPosition2, defaultSize2);\n }", "public void setDefaultSampleName(String dName) {\n\t\tDEFAULT_NAME = dName;\n\t}", "protected void setIllustration(int illustrationId, int previewId) {\n mIllustrationId = illustrationId;\n mIllustrationPreviewId = previewId;\n }", "protected void setTestInfo(final String testInfo) {\n assertActivityNotNull();\n try {\n runTestOnUiThread(new Runnable() {\n @Override\n public void run() {\n mActivity.setTestInfo(testInfo);\n }\n });\n } catch (Throwable throwable) {\n throwable.printStackTrace();\n }\n }", "@Test\r\n public void test_getDocumentId_Accuracy() {\r\n instance = new GetDocumentFileContestAction();\r\n assertEquals(\"incorrect default value\", 0, instance.getDocumentId());\r\n instance.setDocumentId(1);\r\n assertEquals(\"incorrect value after setting\", 1, instance.getDocumentId());\r\n }", "@Before\r\n\tpublic void initializeDefaultMockObjects()\r\n\t{\r\n\t\tconfigs = new ArrayList<Config>();\r\n\t\tscreenshots = new ArrayList<Screenshot>();\r\n\t\tprocessedImages = new ArrayList<ProcessedImage>();\r\n\t\ttestExecutions = new ArrayList<TestExecution>();\r\n\t\ttestEnvironments = new ArrayList<TestEnvironment>();\r\n\r\n\t\tinitializeDefaultTestExecution();\r\n\t\tinitializeDefaultTestEnvironment();\r\n\t\tinitializeDefaultScreenshot();\r\n\t}", "@Override\n\tpublic void uiDecisionSetDefaultAttributes() {\n\t\t// Add default attributes for decisions related to UI elements access\n\t\tAuthentication auth = SecurityContextHolder.getContext().getAuthentication();\n\t\tattrCatAry.add(\"SUBJECT\");\n\t\tattrTypeAry.add(\"INTEGER\");\n\t\tattrIdAry.add(\"com.axiomatics.seniority\");\n\t\tInteger seniority = null;\n\t\ttry {\n\t\t\tseniority = userRepository.findByEmail(auth.getName()).getSeniority();\n\t\t} catch (Exception e) {\n\t\t\tlog.info(e.toString());\n\t\t}\n\t\tattrValAry.add(seniority);\n\t\tlog.info(\"UI DECISION SET DEFAULT ATTRIBUTE WORKING...\");\n\n\t}", "private void initContestData(IInternalContest contest) {\n\n // Add accounts\n contest.generateNewAccounts(ClientType.Type.TEAM.toString(), 1, true);\n contest.generateNewAccounts(ClientType.Type.TEAM.toString(), 1, true);\n \n contest.generateNewAccounts(ClientType.Type.JUDGE.toString(), 1, true);\n\n // Add scoreboard account and set the scoreboard account for this client (in contest)\n contest.setClientId(createBoardAccount (contest));\n \n // Add Problem\n Problem problem = new Problem(\"Problem One\");\n contest.addProblem(problem);\n \n // Add Language\n Language language = new Language(\"Language One\");\n contest.addLanguage(language);\n \n String[] judgementNames = { \"Yes\", \"No - compilation error\", \"No - incorrect output\", \"No - It's just really bad\",\n \"No - judges enjoyed a good laugh\", \"You've been bad - contact staff\", \"No - Illegal Function\" };\n \n String[] acronyms = { \"AC\", \"CE\", \"WA\", \"WA\", \"WA\", \"WA\", \"SV\" };\n \n for (int i = 0; i < judgementNames.length; i++) {\n Judgement judgement = new Judgement(judgementNames[i], acronyms[i]);\n contest.addJudgement(judgement);\n }\n \n checkForJudgeAndTeam(contest);\n }", "@Test(groups = {\"Sprint54\"}, description = \"'Reset all' should reset search conditions in Default and Navigation pane layout.\")\r\n\tpublic void SprintTest54_1_22_2() throws Exception {\r\n\r\n\t\tdriver = null; \r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConfigurationPage configurationPage = LoginPage.launchDriverAndLoginToConfig(driver, true); //Launched driver and logged in\r\n\r\n\t\t\t//Step-1 : Navigate to Vault in tree view\r\n\t\t\t//-----------------------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getPageName().toUpperCase().equalsIgnoreCase(testVault.toUpperCase())) //Checks if navigated to vault settings page\r\n\t\t\t\tthrow new Exception(\"Vault settings page in configuration is not opened.\");\r\n\r\n\t\t\tLog.message(\"1. Navigated to Vault settings page.\");\r\n\r\n\t\t\t//Step-2 : Select Default and navigation pane layout and save the settings\r\n\t\t\t//-------------------------------------------------------------------------\r\n\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_DefaultAndNavigation.Value); //Sets as Default and Navigation layout\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getLayout().equalsIgnoreCase(Caption.ConfigSettings.Config_DefaultAndNavigation.Value)) //Verifies if default layout is selected\r\n\t\t\t\tthrow new Exception(\"Default layout is not selected.\");\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings()) //Saves the settings\r\n\t\t\t\tthrow new Exception(\"Settings are not saved properly.\");\r\n\r\n\t\t\tif (!configurationPage.logOut()) //Logs out from configuration page\r\n\t\t\t\tthrow new Exception(\"Log out is not successful after saving the settings in configuration page.\");\r\n\r\n\t\t\tLog.message(\"2. \" + Caption.ConfigSettings.Config_DefaultAndNavigation.Value + \" layout is selected and settings are saved.\");\r\n\r\n\t\t\t//Step-3 : Login to the default page and change the search word\r\n\t\t\t//-------------------------------------------------------------\r\n\t\t\tHomePage homePage = LoginPage.launchDriverAndLogin(driver, false); //Launches and logs into the default page\r\n\r\n\t\t\tLog.message(\"3. Logged into the default page.\");\r\n\r\n\t\t\t//Step-4 : Change the search option to Any word\r\n\t\t\t//----------------------------------------------\r\n\t\t\thomePage.searchPanel.clickAdvancedSearch(true); //Clicks Advanced search button\r\n\t\t\tString prevOption = homePage.searchPanel.getSelectedSearchOption(); //Gets the selected search option\r\n\t\t\thomePage.searchPanel.setSearchOption(Caption.Search.SearchAnyWord.Value); //Sets Search option to Search any word\r\n\r\n\t\t\tLog.message(\"4. Search option is modified from '\" + prevOption + \"' to '\" + Caption.Search.SearchAnyWord.Value + \"'.\");\r\n\r\n\t\t\t//Step-5 : Click Reset all button\r\n\t\t\t//-------------------------------\r\n\t\t\thomePage.searchPanel.resetAll(); //Clicks Reset all button\r\n\r\n\t\t\tLog.message(\"5. Reset all button is clicked.\");\r\n\r\n\t\t\t//Verification : Verify if Reset all button reset the conditions\r\n\t\t\t//---------------------------------------------------------------\r\n\t\t\tif (homePage.searchPanel.getSelectedSearchOption().equalsIgnoreCase(prevOption)) //Verifies if reset all has reset the conditions\r\n\t\t\t\tLog.pass(\"Test case Passed. Reset all has reset the conditions in \" + Caption.ConfigSettings.Config_DefaultAndNavigation.Value + \" layout.\");\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test case Failed. Reset all has not reset the conditions in \" + Caption.ConfigSettings.Config_DefaultAndNavigation.Value + \" layout.\", driver);\r\n\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tConfigurationPage configurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\t\t\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_Default.Value);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\r\n\t\t} //End finally\r\n\r\n\t}", "public void setTestDB(TestRecordDaoImpl testDB) {\n\t\tthis.testDB = testDB;\n\t}", "@RegionEffects(\"writes other:publicField; reads other:defaultField\")\n private MoreTests(final MoreTests other) {\n // masked\n publicField = privateField;\n protectedField = defaultField;\n\n // not masked\n other.publicField = other.privateField;\n other.protectedField = other.defaultField;\n }", "@Test(groups ={Slingshot,Regression})\n\tpublic void EditViewLessthan15Accts() {\n\t\tReport.createTestLogHeader(\"MuMv\",\"Verify whether user is able to edit the existing view successfully and it gets reflected in the list\");\n\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMvTestdataforFAA\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t.ClickManageUserLink()\n\t\t.ManageViews()\n\t\t.VerifyEditviewname(userProfile) \t\t\t\t\t\t \t \t\t\n\t\t.EditViewNameforLessthan15Accts(userProfile)\n\t\t.ClickAddUserRHNLink()\n\t\t.StandardUser_Creation()\t\t\t\t\t\t \t \t\t\n\t\t.verifyEditedview(userProfile)\n\t\t.enterValidData_StandardUserforEditview(userProfile);\n\t\tnew BgbRegistrationAction()\n\t\t.AddNewStdUserdata(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t.verifyAuditTable(userProfile);\t\n\t}", "private static void populateContestType(ContestType contestType) {\r\n contestType.setDescription(\"description\");\r\n contestType.setRequirePreviewFile(true);\r\n contestType.setRequirePreviewImage(true);\r\n contestType.setContestType(1L);\r\n }", "public void updateTestCaseResult(String defName, String testcaseId,String workspaceId,\r\n\t\t\t\tString projId, String DefSeverity, String DefOwner,\r\n\t\t\t\tString DefNotes, String storyId) {\r\n\r\n\t\t\tlog.info(\"Start - create\");\r\n\t\t\t\r\n\t\ttry {\r\n\t\t\t\tcreateInstance();\r\n\t\t\t\tString workspaceRef = \"/\" + RallyConstants.WORKSPACE + \"/\" + workspaceId;\r\n\t\t\t String projectRef = \"/\" + RallyConstants.WORKSPACE + \"/\" + projId; \r\n //Read User\r\n QueryRequest userRequest = new QueryRequest(\"User\");\r\n userRequest.setFetch(new Fetch(\"UserName\", \"Subscription\", \"DisplayName\", \"SubscriptionAdmin\"));\r\n userRequest.setQueryFilter(new QueryFilter(\"UserName\", \"=\", rallyInfo.getUserName()));\r\n \r\n QueryResponse userQueryResponse = restApi.query(userRequest);\r\n JsonArray userQueryResults = userQueryResponse.getResults();\r\n JsonElement userQueryElement = userQueryResults.get(0);\r\n JsonObject userQueryObject = userQueryElement.getAsJsonObject();\r\n String userRef = userQueryObject.get(\"_ref\").getAsString();\r\n\t \r\n //to get tescase formatted ID \r\n QueryRequest request = new QueryRequest(\"TestCase\");\r\n request.setWorkspace(workspaceRef);\r\n request.setFetch(new Fetch(\"FormattedID\"));\r\n request.setQueryFilter(new QueryFilter(\"ObjectID\", \"=\", testcaseId)); \r\n QueryResponse response = restApi.query(request);\r\n String testcaseform = \"\";\r\n for (int j=0; j<response.getTotalResultCount();j++){\r\n JsonObject jsonObject = response.getResults().get(j).getAsJsonObject();\r\n JsonElement FormattedTestcaseId = jsonObject.get(\"FormattedID\"); \r\n testcaseform = FormattedTestcaseId.getAsString(); \r\n }\r\n \r\n // Query for Test Case to which we want to add results\r\n QueryRequest testCaseRequest = new QueryRequest(\"TestCase\");\r\n testCaseRequest.setFetch(new Fetch(\"FormattedID\",\"Name\"));\r\n testCaseRequest.setWorkspace(workspaceRef);\r\n testCaseRequest.setQueryFilter(new QueryFilter(\"FormattedID\", \"=\",testcaseform));\r\n \r\n QueryResponse testCaseQueryResponse = restApi.query(testCaseRequest);\r\n JsonObject testCaseJsonObject = testCaseQueryResponse.getResults().get(0).getAsJsonObject();\r\n String testCaseRef = testCaseQueryResponse.getResults().get(0).getAsJsonObject().get(\"_ref\").getAsString(); \r\n \r\n for (int i=0; i<1; i++) {\r\n \t\r\n\t //Add a Test Case Result \r\n \tlog.info(\"Creating Test Case Result..\");\r\n\t JsonObject newTestCaseResult = new JsonObject();\r\n\t newTestCaseResult.addProperty(\"Verdict\", RallyConstants.VERDICT);\r\n\t newTestCaseResult.addProperty(\"Date\",DateUtil.getCurrentDateTime(RallyConstants.CREATION_DATE_FORMAT));\r\n\t newTestCaseResult.addProperty(\"Notes\", DefNotes);\r\n\t newTestCaseResult.addProperty(\"Build\", TestBedManager.INSTANCE.getDefectConfig().getBuild());\r\n\t newTestCaseResult.addProperty(\"Tester\", userRef);\r\n\t newTestCaseResult.addProperty(\"TestCase\", testCaseRef);\r\n\t newTestCaseResult.addProperty(\"Workspace\", workspaceRef);\r\n\r\n\t CreateRequest createRequest = new CreateRequest(\"testcaseresult\", newTestCaseResult);\r\n\t CreateResponse createResponse = restApi.create(createRequest); \r\n\t if (createResponse.wasSuccessful()) {\r\n\r\n\t //Read Test Case\r\n\t String ref = Ref.getRelativeRef(createResponse.getObject().get(\"_ref\").getAsString());\r\n\t GetRequest getRequest = new GetRequest(ref);\r\n\t getRequest.setFetch(new Fetch(\"Date\", \"Verdict\"));\r\n\t GetResponse getResponse = restApi.get(getRequest);\r\n\t JsonObject obj = getResponse.getObject();\r\n\t System.out.println(String.format(\"my Read Test Case Result. Date = %s, Verdict = %s\",\r\n\t obj.get(\"Date\").getAsString(), obj.get(\"Verdict\").getAsString())); \r\n\t } else {\r\n\t String[] createErrors;\r\n\t createErrors = createResponse.getErrors();\r\n\t System.out.println(\"Error occurred creating Test Case Result: \");\r\n\t for (int k=0; i<createErrors.length;k++) {\r\n\t System.out.println(createErrors[k]);\r\n\t }\r\n\t }\r\n }\r\n \r\n } catch (DefectException e) {\r\n\t\t// TODO Auto-generated catch block\r\n\t\te.printStackTrace();\r\n\t} catch (IOException e) {\r\n\t\t// TODO Auto-generated catch block\r\n\t\te.printStackTrace();\r\n\t} finally {\r\n //Release all resources\r\n try {\r\n\t\t\trestApi.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n } \r\n\r\n}", "@BeforeEach\n\tpublic void setUpPerTest() {\n\t\tmockList = new ArrayList<>();\n\t\tPerson index0 = new Person(\"John\", \"Boyd\", \"1509 Culver St\", \"Culver\", \"97451\", \"841-874-6512\",\n\t\t\t\t\"[email protected]\");\n\t\tPerson index1 = new Person(\"Lily\", \"Cooper\", \"489 Manchester St\", \"Culver\", \"97451\", \"841-874-9845\",\n\t\t\t\t\"[email protected]\");\n\t\tPerson index2 = new Person(\"Tenley\", \"Boyd\", \"1509 Culver St\", \"Culver\", \"97451\", \"841-874-6512\",\n\t\t\t\t\"[email protected]\");\n\t\tPerson index3 = new Person(\"Jonanathan\", \"Marrack\", \"29 15th St\", \"Culver\", \"97451\", \"841-874-6513\",\n\t\t\t\t\"[email protected]\");\n\t\tmockList.add(index0);\n\t\tmockList.add(index1);\n\t\tmockList.add(index2);\n\t\tmockList.add(index3);\n\n\t\tmockListMedicalRecord = new ArrayList<>();\n\t\tMedicalRecord indexMedicalRecord0 = new MedicalRecord(\"John\", \"Boyd\", \"03/06/1984\",\n\t\t\t\tnew ArrayList<>(Arrays.asList(\"aznol:350mg\", \"hydrapermazol:100mg\")),\n\t\t\t\tnew ArrayList<>(Arrays.asList(\"nillacilan\")));\n\t\tMedicalRecord indexMedicalRecord1 = new MedicalRecord(\"Lily\", \"Cooper\", \"03/06/1994\", new ArrayList<>(),\n\t\t\t\tnew ArrayList<>());\n\t\tMedicalRecord indexMedicalRecord2 = new MedicalRecord(\"Tenley\", \"Boyd\", \"02/08/2012\",\n\t\t\t\tnew ArrayList<>(Arrays.asList()), new ArrayList<>(Arrays.asList(\"peanut\")));\n\t\tMedicalRecord indexMedicalRecord3 = new MedicalRecord(\"Jonanathan\", \"Marrack\", \"01/03/1989\",\n\t\t\t\tnew ArrayList<>(Arrays.asList()), new ArrayList<>(Arrays.asList()));\n\t\tmockListMedicalRecord.add(indexMedicalRecord0);\n\t\tmockListMedicalRecord.add(indexMedicalRecord1);\n\t\tmockListMedicalRecord.add(indexMedicalRecord2);\n\t\tmockListMedicalRecord.add(indexMedicalRecord3);\n\n\t\tpersonServiceTest = PersonService.builder().personDAO(personDAOMock).build();\n\t}", "@Test\r\n\tpublic void testSetId() {\r\n\t\tbreaku1.setId(5);\r\n\t\texternu1.setId(6);\r\n\t\tmeetingu1.setId(7);\r\n\t\tteachu1.setId(8);\r\n\r\n\t\tassertEquals(5, breaku1.getId());\r\n\t\tassertEquals(6, externu1.getId());\r\n\t\tassertEquals(7, meetingu1.getId());\r\n\t\tassertEquals(8, teachu1.getId());\r\n\t}", "@BeforeClass\n\tpublic void campaign_user_parameter_setup() throws URISyntaxException, ClientProtocolException, IOException, ParseException{\n\t\tMap<String, Object> confCampaignHierarchy = yamlReader.readCampaignInfo(Constants.GroupHierarchy.AGENCY);\n\t\tcampaign_id = confCampaignHierarchy.get(TestDataYamlConstants.CampaignConstants.CAMPAIGN_ID).toString();\n\t\tcampaign_owner_user_id = confCampaignHierarchy.get(TestDataYamlConstants.CampaignConstants.CAMPAIGN_OWNER_USER_ID).toString();\n\t\tgroup_id = confCampaignHierarchy.get(TestDataYamlConstants.CampaignConstants.GROUP_ID).toString();\n\t\tcampaign_ext_id = confCampaignHierarchy.get(TestDataYamlConstants.CampaignConstants.CAMPAIGN_EXT_ID).toString();\n\t\tcampaign_name = confCampaignHierarchy.get(TestDataYamlConstants.CampaignConstants.CAMPAIGN_NAME).toString();\n\t\tif (confCampaignHierarchy.get(TestDataYamlConstants.CampaignConstants.CAMPAIGN_CREATED) != null)\t\n\t\t campaign_end_date = confCampaignHierarchy.get(TestDataYamlConstants.CampaignConstants.CAMPAIGN_END_DATE).toString();\n\t\tif (confCampaignHierarchy.get(TestDataYamlConstants.CampaignConstants.CAMPAIGN_CREATED) != null)\n\t\t\tcampaign_created = confCampaignHierarchy.get(TestDataYamlConstants.CampaignConstants.CAMPAIGN_CREATED).toString();\n\t\tif (confCampaignHierarchy.get(TestDataYamlConstants.CampaignConstants.CAMPAIGN_START_DATE) != null)\n\t\t\tcamp_start_date = confCampaignHierarchy.get(TestDataYamlConstants.CampaignConstants.CAMPAIGN_START_DATE).toString();\n\t\t\n\t\tMap<String, Object> confUserHierarchy = yamlReader.readUserInfo(Constants.GroupHierarchy.AGENCY);\n\t\tfirst_name = confUserHierarchy.get(TestDataYamlConstants.UserConstants.FIRST_NAME).toString();\n\t\tlast_name = confUserHierarchy.get(TestDataYamlConstants.UserConstants.LAST_NAME).toString();\n\t\temail = confUserHierarchy.get(TestDataYamlConstants.UserConstants.EMAIL).toString();\n\t\tphone_number = confUserHierarchy.get(TestDataYamlConstants.UserConstants.PHONE_NUMBER).toString();\n\t\trole = confUserHierarchy.get(TestDataYamlConstants.UserConstants.ROLE).toString();\n\t\tuser_status = confUserHierarchy.get(TestDataYamlConstants.UserConstants.STATUS).toString();\n\t}", "public void setDefaultSettings() {\n boolean shouldRecord = sharedPreferences.getBoolean(record,true);\n if (shouldRecord) {\n radioOption.check(R.id.radioRecord);\n radioOptionButton = (RadioButton)findViewById(R.id.radioRecord);\n radioOptionButton.setEnabled(true);\n } else {\n radioOption.check(R.id.radioRecognize);\n radioOptionButton = (RadioButton)findViewById(R.id.radioRecognize);\n radioOptionButton.setEnabled(true);\n }\n\n // Set timer to previous value set by user\n int minuteValue = sharedPreferences.getInt(minuteTime, 0)/60000;\n minutePicker.setValue(minuteValue);\n\n int secondValue = sharedPreferences.getInt(secondTime, 5000)/1000;\n secondPicker.setValue(secondValue);\n }", "protected void performDefaults() {\r\n\t}", "@Override\n\tpublic void urlDecisionSetDefaultAttributes() {\n\t\t// TODO Add default attributes for decisions related to URL access\n\n\t}", "void testSetup() {\n\t\t// Delete any existing index\n\t\tdeleteIndex();\n\n\t\t// Create the index\n\t\tcreateIndex();\n\n\t\t// Apply mappings for type and subtypes\n\t\tBufferedReader br;\n\t\tString line;\n\t\tStringBuffer sb;\n\t\ttry {\n\t\t\t// Mappings for index + type\n\t\t\tbr = new BufferedReader(new FileReader(\n\t\t\t\t\t\"./data/mappings_domeo_v2.json\"));\n\t\t\tsb = new StringBuffer();\n\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\tsb.append(line + NEWLINE);\n\t\t\t}\n\t\t\tbr.close();\n\t\t\tdoMapping(sb.toString(), false, HTTP_POST);\n\n\t\t\t// Mappings for index + sub-type\n\t\t\tbr = new BufferedReader(new FileReader(\n\t\t\t\t\t\"./data/mappings_domeo_subtype_v2.json\"));\n\t\t\tsb = new StringBuffer();\n\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\tsb.append(line + NEWLINE);\n\t\t\t}\n\t\t\tbr.close();\n\t\t\tdoMapping(sb.toString(), true, HTTP_POST);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// Index a doc\n\t\ttry {\n\t\t\tbr = new BufferedReader(new FileReader(\"./data/sample_docs.json\"));\n\t\t\tif ((line = br.readLine()) != null) {\n\t\t\t\tinsertDocument(line);\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\trefreshIndex();\n\t}", "public void testSetAllFields_Behavior(String profileConf,String behaviorOfMandatory,String behaviorOfOptional) throws Exception{\r\n ProfileManagement instProfileManagement = new ProfileManagement(selenium);\r\n String arr[]={\"givenname\",\"lastname\",\"emailaddress\",\"nickname\",\"dob\",\"gender\",\"country\",\"streetaddress\",\"telephone\",\"mobile\",\"locality\",\"postalcode\",\"region\",\"role\",\"title\",\"url\",\"im\",\"organization\",\"otherphone\",\"fullname\",\"stateorprovince\"};\r\n int i=0;\r\n while(i<21){\r\n if((\"http://wso2.org/claims/\"+arr[i]).equals(\"http://wso2.org/claims/givenname\")||(\"http://wso2.org/claims/\"+arr[i]).equals(\"http://wso2.org/claims/lastname\")||(\"http://wso2.org/claims/\"+arr[i]).equals(\"http://wso2.org/claims/emailaddress\"))\r\n instProfileManagement.testUpdateDefaultProfile_Configuration(profileConf,\"http://wso2.org/claims/\"+arr[i],behaviorOfMandatory);\r\n else\r\n instProfileManagement.testUpdateDefaultProfile_Configuration(profileConf,\"http://wso2.org/claims/\"+arr[i],behaviorOfOptional);\r\n\r\n i=i+1;\r\n }\r\n }", "@Test\r\n\tpublic void testAddObstetricsRecord() {\r\n\t\t\r\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"yyy-MM-dd\");\r\n\t\tCalendar c = Calendar.getInstance();\r\n\t\tc.add(Calendar.MONTH, -1);\r\n\t\tString lmp = dateFormat.format(c.getTime());\t\r\n\t\t\r\n\t\toic.setLmp(lmp);\r\n\t\t\r\n\t\toic.setMultiplicity(\"1\");\r\n\t\tAssert.assertTrue(oic.getMultiplicity().equals(\"1\"));\r\n\t\toic.addObstetricsRecord();\r\n\t\t//LMP wasn't cleared, therefore it errored\r\n\t\tAssert.assertTrue(oic.getLmp().equals(lmp));\r\n\t\t\r\n\t\toic.setWeightGain(\"1\");\r\n\t\tAssert.assertTrue(oic.getWeightGain().equals(\"1\"));\r\n\t\toic.addObstetricsRecord();\r\n\t\t//LMP wasn't cleared, therefore it errored\r\n\t\tAssert.assertTrue(oic.getLmp().equals(lmp));\r\n\t\t\r\n\t\toic.setNumHoursInLabor(\"1\");\r\n\t\tAssert.assertTrue(oic.getNumHoursInLabor().equals(\"1\"));\r\n\t\toic.addObstetricsRecord();\r\n\t\t//LMP wasn't cleared, therefore it errored\r\n\t\tAssert.assertTrue(oic.getLmp().equals(lmp));\r\n\t\t\r\n\t\toic.setNumWeeksPregnant(\"39\");\r\n\t\tAssert.assertTrue(oic.getNumWeeksPregnant().equals(\"39\"));\r\n\t\toic.addObstetricsRecord();\r\n\t\t//LMP wasn't cleared, therefore it errored\r\n\t\tAssert.assertTrue(oic.getLmp().equals(lmp));\r\n\t\t\r\n\t\toic.setYearOfConception(\"2005\");\r\n\t\tAssert.assertTrue(oic.getYearOfConception().equals(\"2005\"));\r\n\t\toic.addObstetricsRecord();\r\n\t\t//LMP wasn't cleared, therefore it errored\r\n\t\tAssert.assertTrue(oic.getLmp().equals(lmp));\r\n\t\t\r\n\t\toic.setDeliveryType(\"Vaginal Delivery\");\t\t\r\n\t\toic.addPregnancyRecord();\r\n\t\t\r\n\t\toic.setYearOfConception(null);\r\n\t\toic.setNumWeeksPregnant(null);\r\n\t\toic.setNumHoursInLabor(null);\r\n\t\toic.setWeightGain(null);\r\n\t\toic.setMultiplicity(null);\r\n\t\toic.setLmp(\"\");\r\n\t\toic.addObstetricsRecord();\r\n\t\tAssert.assertTrue(oic.getLmp().equals(\"\"));\r\n\t\t\r\n\t\toic.setLmp(null);\r\n\t\toic.addObstetricsRecord();\r\n\t\tAssert.assertTrue(oic.getLmp() == null);\r\n\t\t\r\n\t\toic.setLmp(\"a\");\r\n\t\toic.addObstetricsRecord();\r\n\t\tAssert.assertTrue(oic.getLmp().equals(\"a\"));\r\n\t\t\r\n\t\toic.setLmp(lmp);\r\n\t\toic.addObstetricsRecord();\r\n\t\tAssert.assertTrue(oic.getLmp().equals(\"\"));\r\n\t}", "public void setStartTestNumber(int startTestNumber) {\n\t\tthis.nextTestNumber = startTestNumber;\n\t}", "public void setStartTestNumber(int startTestNumber) {\n\t\tthis.nextTestNumber = startTestNumber;\n\t}", "@Override\n\tdefault void testDef() {\n\t\tTest1.super.testDef();\n\t}", "@Test(groups ={Slingshot,Regression})\n\tpublic void VerifyStdSpecificacctsPrepopulatedUserdetails() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify the confirmation page of Add new user is getting displayed with prepopulated user details\");\n\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMVTestDatas\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t.ClickManageUserLink()\n\t\t.ClickAddNewUserLink()\n\t\t.AddUserRadioButton()\n\t\t.StandardUser_Creation()\n\t\t.VerifySpecificAccountsViewNames(userProfile);\t \t \t\t \t \t\t \t \t \t \t\t \t \t\t \t \t\t \t \t\t\n\t}" ]
[ "0.55674464", "0.526806", "0.52319765", "0.51640654", "0.5120461", "0.5100507", "0.5085248", "0.5081487", "0.508137", "0.5040002", "0.5036663", "0.50273293", "0.50135595", "0.49865097", "0.4981109", "0.49538532", "0.4941956", "0.4933536", "0.49128085", "0.49041435", "0.48848525", "0.48848525", "0.48795733", "0.48790294", "0.48690486", "0.48678964", "0.48363775", "0.48295453", "0.48144126", "0.479492", "0.47909185", "0.47808903", "0.47726172", "0.47693992", "0.47651717", "0.4757223", "0.47554162", "0.47497538", "0.47344175", "0.4719335", "0.4718521", "0.470957", "0.46943465", "0.4692318", "0.4692017", "0.46910548", "0.46879902", "0.4680967", "0.46809018", "0.46801955", "0.46774974", "0.46766174", "0.46699294", "0.46684888", "0.46673188", "0.46593535", "0.4655608", "0.46550736", "0.46382368", "0.46363527", "0.46363527", "0.46278465", "0.4627506", "0.46180895", "0.46158966", "0.46101168", "0.46098834", "0.4603257", "0.46008623", "0.45994008", "0.4599364", "0.45866373", "0.45827693", "0.4575045", "0.45746177", "0.45728615", "0.45643562", "0.45600015", "0.45594686", "0.45588148", "0.4557793", "0.455766", "0.4556893", "0.45523086", "0.45464095", "0.4542499", "0.45352042", "0.45337278", "0.45299214", "0.45256704", "0.452508", "0.4521493", "0.45214653", "0.4509814", "0.45081928", "0.4506264", "0.4505056", "0.4505056", "0.45031306", "0.4498239" ]
0.779335
0
Utility method to return patients matching passed criteria
public static Cohort getMdrPatients(String identifier, String name, String enrollment, Location location, List<ProgramWorkflowState> states) { Cohort cohort = Context.getPatientSetService().getAllPatients(); MdrtbService ms = (MdrtbService) Context.getService(MdrtbService.class); Date now = new Date(); Program mdrtbProgram = ms.getMdrtbProgram(); if ("current".equals(enrollment)) { Cohort current = Context.getPatientSetService().getPatientsInProgram(mdrtbProgram, now, now); cohort = Cohort.intersect(cohort, current); } else { Cohort ever = Context.getPatientSetService().getPatientsInProgram(mdrtbProgram, null, null); if ("previous".equals(enrollment)) { Cohort current = Context.getPatientSetService().getPatientsInProgram(mdrtbProgram, now, now); Cohort previous = Cohort.subtract(ever, current); cohort = Cohort.intersect(cohort, previous); } else if ("never".equals(enrollment)) { cohort = Cohort.subtract(cohort, ever); } else { cohort = Cohort.intersect(cohort, ever); } } if (StringUtils.isNotBlank(name) || StringUtils.isNotBlank(identifier)) { name = "".equals(name) ? null : name; identifier = "".equals(identifier) ? null : identifier; Cohort nameIdMatches = new Cohort(Context.getPatientService().getPatients(name, identifier, null, false)); cohort = Cohort.intersect(cohort, nameIdMatches); } // If Location is specified, limit to patients at this Location if (location != null) { CohortDefinition lcd = Cohorts.getLocationFilter(location, now, now); Cohort locationCohort; try { locationCohort = Context.getService(CohortDefinitionService.class).evaluate(lcd, new EvaluationContext()); } catch (EvaluationException e) { throw new MdrtbAPIException("Unable to evalute location cohort",e); } cohort = Cohort.intersect(cohort, locationCohort); } if (states != null) { Cohort inStates = Context.getPatientSetService().getPatientsByProgramAndState(null, states, now, now); cohort = Cohort.intersect(cohort, inStates); } return cohort; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<Patient> findPatients(Employee nurse_id);", "public Patient[] findID(String sv)\r\n\t{\r\n\t\tPatient[] foundPatients = new Patient[999];//Creates a blank array\r\n\t\tint count = 0;\r\n\r\n\t\tfor(int i=0; arrayPatients[i]!=null ;i++)//loops through the array\r\n\t\t{\r\n\t\t\tif(arrayPatients[i].forename.contains(sv)||arrayPatients[i].surname.contains(sv))//sees if either surname or firstname contain the search term allowing for partieal searching\r\n\t\t\t{\r\n\t\t\t\tfoundPatients[count] = arrayPatients[i];//if found it adds the patient to an array\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn foundPatients;//that array is then returned\r\n\t}", "@Override\r\n public ArrayList<Object> getRecords(String criteria) throws SQLException {\r\n\r\n ArrayList<Object> rows = new ArrayList<>();\r\n\r\n String sql = \"select * from patient\";\r\n\r\n //append any search criteria\r\n if (criteria != null) {\r\n sql += criteria;\r\n }\r\n \r\n logger.info(\"Search patient: \" + sql);\r\n \r\n try (PreparedStatement pStatement = connection.prepareStatement(sql);\r\n ResultSet resultSet = pStatement.executeQuery();) {\r\n while (resultSet.next()) {\r\n PatientBean pb = new PatientBean();\r\n pb.setPatientID(resultSet.getLong(\"PatientID\"));\r\n pb.setLastName(resultSet.getString(\"LastName\"));\r\n pb.setFirstName(resultSet.getString(\"FirstName\"));\r\n pb.setDiagnosis(resultSet.getString(\"Diagnosis\"));\r\n pb.setAdmissionDate(resultSet.getTimestamp(\"AdmissionDate\"));\r\n pb.setReleaseDate(resultSet.getTimestamp(\"ReleaseDate\"));\r\n\r\n ArrayList<Object> ib = inpatientDAOImpl.getRecords(\" where patientID = \" + pb.getPatientID());\r\n if (ib != null && ib.size() > 0) {\r\n pb.setIb(ib);\r\n }\r\n\r\n ArrayList<Object> sb = surgicalDAOImpl.getRecords(\" where patientID = \" + pb.getPatientID());\r\n if (sb != null && sb.size() > 0) {\r\n pb.setSb(sb);\r\n }\r\n\r\n ArrayList<Object> mb = medicationDAOImpl.getRecords(\" where patientID = \" + pb.getPatientID());\r\n if (mb != null && mb.size() > 0) {\r\n pb.setMb(mb);\r\n }\r\n\r\n rows.add(pb);\r\n }\r\n }\r\n\r\n logger.info(\"patient records have been saved to ArrayList, size: \" + rows.size());\r\n\r\n return rows;\r\n\r\n }", "public ArrayList<MedicalRecord> getPatientRecords(String patient) {\n if (database.containsKey(patient)) {\n return database.get(patient);\n } else {\n System.out.println(\"No such patient found\");\n return null;\n }\n }", "List<Admission> findPAdmissionBYpatientNumber(String patientNumber, Long hospitalId);", "ObservableList<Patient> getFilteredPatientList();", "public List<Patient> getPatients() {\n List<Patient> patients = new ArrayList<>();\n String query = \"SELECT * FROM PATIENTS\";\n try (PreparedStatement ps = this.transaction.prepareStatement(query); ResultSet rs = ps.executeQuery()) {\n while (rs.next()) {\n patients.add(new Patient(rs));\n }\n } catch (SQLException ex) {\n ex.printStackTrace(System.out);\n }\n\n return patients;\n }", "public List<Patient> getByName(String name) {\n\t\treturn getByCriterion(Restrictions.or(Restrictions.like(\"firstname\", name), Restrictions.like(\"lastname\", name)));\n\t}", "@Override\n public Set PatientsWithCaughingAndFever() {\n Set<Patient> patients = new HashSet<>();\n patientRepository.findAll().forEach(patients::add);\n Set<Patient>coughingAndFever = new HashSet<>();\n if(patients != null)\n {\n patients.forEach((patient) ->\n {\n if(patient.getPatientMedicalRecord().getSymptoms().equals(\"Coughing\") || patient.getPatientMedicalRecord().getSymptoms().equals(\"Fever\")){\n coughingAndFever.add(patient);\n }else {\n System.out.println(\"No older patients with symptoms such as caughing and fever\");\n }\n });\n }\n\n return coughingAndFever;\n }", "List<TypePatientPropertyCondition> search(String query);", "public Collection<IPatient> searchPatients(String svn, String fname, String lname){\n _model = Model.getInstance();\n Collection<IPatient> searchresults = null;\n\n try {\n searchresults = _model.getSearchPatientController().searchPatients(svn, fname, lname);\n } catch (BadConnectionException e) {\n e.printStackTrace();\n DialogBoxController.getInstance().showExceptionDialog(e, \"BadConnectionException - Please contact support\");\n } catch (at.oculus.teamf.persistence.exception.search.InvalidSearchParameterException e) {\n e.printStackTrace();\n DialogBoxController.getInstance().showExceptionDialog(e, \"FacadeException - Please contact support\");\n } catch (CriticalDatabaseException e) {\n e.printStackTrace();\n DialogBoxController.getInstance().showExceptionDialog(e, \"CriticalDatabaseException - Please contact support\");\n } catch (CriticalClassException e) {\n e.printStackTrace();\n DialogBoxController.getInstance().showExceptionDialog(e, \"CriticalClassException - Please contact support\");\n }\n\n return searchresults;\n }", "public abstract List<ClinicalDocument> findByPatientId(long patientId);", "public Collection<IPatient> searchPatients(String text) throws BadConnectionException, CriticalClassException, CriticalDatabaseException, InvalidSearchParameterException\n {\n _model = Model.getInstance();\n\n return _model.getSearchPatientController().searchPatients(text);\n }", "List<Patient> findAllPatients();", "public abstract List<ClinicalDocumentDto> findClinicalDocumentDtoByPatientId(Long patientId);", "public List<Doctor> acceptingNewPatients(String specialty);", "public Patient returnPatFromId(String id)\r\n\t{\r\n\t\tPatient foundPatient = null;// blank patient is made\r\n\r\n\t\tfor(int i=0; arrayPatients[i]!=null ;i++)//loops through the array\r\n\t\t{\r\n\t\t\tif(arrayPatients[i].patientID.equals(id))//if the id passed matches the id of that term in the array it will save that array term \r\n\t\t\t{\r\n\t\t\t\tfoundPatient = arrayPatients[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn foundPatient;// that saved array term is then returned\r\n\t}", "public String patientsOn10A(){\n String sql = \"SELECT a.patient_id \" +\n \" FROM orders a \" +\n \" JOIN drug_order b ON(a.order_id=b.order_id) \" +\n \" JOIN drug c ON(b.drug_inventory_id=c.drug_id) \" +\n \" JOIN cpad_regimen_drug d ON(c.drug_id=d.drug_id) \" +\n \" JOIN cpad_regimen e ON(d.regimen_id=e.regimen_id) \" +\n \" WHERE (e.name='10A=AZT(300)+DDL(125)+IDV/r (400/100)')\"+\n \" and a.date_created between (:startDate) and (:endDate) \";\n\n return sql;\n }", "@Override\n @Transactional\n public List<Patient> selectPatientsByAttendingDoctor(String doctorFullname) {\n return patientDAO.getByAttendingDoctor(doctorFullname);\n }", "Collection<Patient> findByName(String name, int id);", "@Override\n\tpublic List<Patients> findBy(Object... valrs) throws Exception {\n\t\treturn null;\n\t}", "private void searchPatient() {\r\n String lName, fName;\r\n lName = search_lNameField.getText();\r\n fName = search_fNameField.getText();\r\n // find patients with the Last & First Name entered\r\n patientsFound = MainGUI.pimsSystem.search_patient(lName, fName);\r\n\r\n // more than one patient found\r\n if (patientsFound.size() > 1) {\r\n\r\n // create String ArrayList of patients: Last, First (DOB)\r\n ArrayList<String> foundList = new ArrayList<String>();\r\n String toAdd = \"\";\r\n // use patient data to make patient options to display\r\n for (patient p : patientsFound) {\r\n toAdd = p.getL_name() + \", \" + p.getF_name() + \" (\" + p.getDob() + \")\";\r\n foundList.add(toAdd);\r\n }\r\n int length;\r\n // clear combo box (in case this is a second search)\r\n while ((length = selectPatient_choosePatientCB.getItemCount()) > 0) {\r\n selectPatient_choosePatientCB.removeItemAt(length - 1);\r\n }\r\n // add Patient Options to combo box\r\n for (int i = 0; i < foundList.size(); i++) {\r\n selectPatient_choosePatientCB.addItem(foundList.get(i));\r\n }\r\n\r\n // display whether patients found or not\r\n JOptionPane.showMessageDialog(this, \"Found More than 1 Result for Last Name, First Name: \" + lName + \", \" + fName\r\n + \".\\nPress \\\"Ok\\\" to select a patient.\",\r\n \"Search Successful\", JOptionPane.DEFAULT_OPTION);\r\n\r\n selectPatientDialog.setVisible(true);\r\n }\r\n\r\n // one patient found\r\n else if (patientsFound.size() == 1) {\r\n\r\n JOptionPane.showMessageDialog(this, \"Found one match for Last Name, First Name: \" + lName + \", \" + fName,\r\n \"Search Successful\", JOptionPane.DEFAULT_OPTION);\r\n // display patient data\r\n currentPatient = patientsFound.get(0);\r\n search_fillPatientFoundData(currentPatient);\r\n }\r\n // no patient found\r\n else {\r\n\r\n JOptionPane.showMessageDialog(this, \"No Results found for Last Name, First Name:\" + lName + \", \" + fName,\r\n \"Search Failed\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n }", "@Override\n\tpublic List<Patient> findAll() {\n\t\t// setting logger info\n\t\tlogger.info(\"Find the details of the patient\");\n\t\treturn patientRepo.findAll();\n\t}", "List<DeviceDetails> getDevices(Predicate<DeviceDetails> deviceFilter, Predicate<DeviceDetails> deviceFilter1);", "List<DeviceDetails> getDevices(Predicate<DeviceDetails> deviceFilter, Predicate<DeviceDetails> deviceFilter2, Predicate<DeviceDetails> deviceFilter3);", "PatientInfo getPatientInfo(int patientId);", "@Override\n public List<PatientCaseDto> getAllByPatient(Long patientId) {\n return null;\n }", "Collection<Patient> findAll();", "public Person[] getPatientsByHeartConditionCause(int cause) {\n int count = 0;\n for(int i = 0; i < listOfPatients.length; i++)\n {\n if(listOfPatients[i].getCause() == cause)\n count++;\n }\n \n if(count == 0)\n return null;\n\n int index = 0;\n Person[] patientsByHeartConditionCause = new Person[count];\n for(int i = 0; i < listOfPatients.length; i++)\n {\n if(listOfPatients[i].getCause() == cause)\n patientsByHeartConditionCause[index++] = listOfPatients[i];\n }\n\n return patientsByHeartConditionCause;\n }", "private Collection<String[]> getPatientIds(String subjectCid) throws Throwable {\n\t\tXmlDocMaker doc = new XmlDocMaker(\"args\");\n\t\tdoc.add(\"size\", \"infinity\");\n\t\tdoc.add(\"action\", \"get-meta\");\n\t\tdoc.add(\"where\", \"cid starts with '\" + subjectCid\n\t\t\t\t+ \"' and model='om.pssd.study' and mf-dicom-study has value\");\n\t\tdoc.add(\"pdist\", 0); // Force local\n\t\tXmlDoc.Element r = executor().execute(\"asset.query\", doc.root());\n\t\tCollection<String> dicomStudyCids = r.values(\"asset/cid\");\n\t\tif (dicomStudyCids == null) {\n\t\t\treturn null;\n\t\t}\n\t\tVector<String[]> patientIds = new Vector<String[]>();\n\t\tfor (String dicomCid : dicomStudyCids) {\n\t\t\tString[] patientId = getPatientIdFromDicomStudy(dicomCid);\n\t\t\tif (patientId != null) {\n\t\t\t\tboolean exists = false;\n\t\t\t\tfor (String[] patientId2 : patientIds) {\n\t\t\t\t\tif (patientId2[0].equals(patientId[0])\n\t\t\t\t\t\t\t&& patientId2[1].equals(patientId[1])\n\t\t\t\t\t\t\t&& patientId2[2].equals(patientId[2])) {\n\t\t\t\t\t\texists = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!exists) {\n\t\t\t\t\tpatientIds.add(patientId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn patientIds;\n\n\t}", "public ArrayList<Patient> chercherPatient(String recherche) {\r\n ArrayList<Patient> p=new ArrayList();\r\n for (int i = 0; i < patients.size(); i++) {\r\n if ((patients.get(i).getNomUsuel()+patients.get(i).getPrenom()).toLowerCase().contains(recherche.trim().toLowerCase())) {\r\n p.add(patients.get(i));\r\n }\r\n }\r\n return p;\r\n }", "@Override\r\n\tpublic List<Object[]> searchPlantDetails() {\n\t\tList<Object[]> list = null;\r\n\t\ttry {\r\n\t\t\tsql = \"select p.plantId ,p.plantName,p.add1,p.add2,p.add3,p.city,p.state,p.phone,p.fax,p.mobile,p.organization,p.countrysList from Plant p\";\r\n\t\t\tlist = getHibernateTemplate().find(sql);\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn list;\r\n\t}", "Appliance[] find(Criteria[] criteria);", "public void careForPatient(Patient patient);", "public Person[] getPatientsByStateOfHealth(int state) {\n int count = 0;\n for(int i = 0; i < listOfPatients.length; i++)\n {\n if(listOfPatients[i].getStateOfHealth() == state)\n count++;\n }\n \n if(count == 0)\n return null;\n\n int index = 0;\n Person[] patientsByStateOfHealth = new Person[count];\n for(int i = 0; i < listOfPatients.length; i++)\n {\n if(listOfPatients[i].getStateOfHealth() == state)\n patientsByStateOfHealth[index++] = listOfPatients[i];\n }\n\n return patientsByStateOfHealth;\n }", "List<Accessprofile> listWithCritera(SearchCriteria searchCriteria);", "public List<PrsMain> listPatients() {\n Log.info(LifeCARDAdmin.class.getName() + \":listPatients()\");\n\n List<PrsMain> list;\n String sql = \"SELECT p.* FROM prs_main p where p.prsid IN (SELECT l.prsid FROM lc_main l where l.prsid>0 and l.prsid is not null)\";\n Query query = em.createNativeQuery(sql, PrsMain.class);\n try {\n list = query.getResultList();\n } catch (PersistenceException pe) {\n Log.warning(LifeCARDAdmin.class.getName() + \":listPatients():\" + pe.getMessage());\n return null;\n }\n return list;\n }", "private ArrayList<Patient> getPatients(String key) {\n\n BlueCareApolloClient.getBlueCareApolloClient().query(GetPatientsQuery.builder()\n ._authKey(key)\n .build())\n .enqueue(new ApolloCall.Callback<GetPatientsQuery.Data>() {\n\n @Override\n public void onResponse(@Nonnull com.apollographql.apollo.api.Response<GetPatientsQuery.Data> response) {\n\n res1 = response.data().getPatients().toString();\n List res = response.data().getPatients().patientRecords();\n String name;\n String age;\n\n Log.d(\"staff res: \", res1);\n\n\n\n for(int i = 0; i != res.size(); i++) {\n Object obj = (Object) res.get(i);\n Gson gson = new Gson();\n String jsonString = gson.toJson(obj);\n\n try {\n JSONObject patientRecords = new JSONObject(jsonString);\n name = patientRecords.getString(\"name\");\n age = patientRecords.getString(\"age\");\n\n //JSONArray cond = patientRecords.getJSONArray(\"conditions\");\n Patient x = new Patient(name, age);\n\n //x.setCondition(cond);\n patientList.add(x);\n\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n\n\n\n StaffActivity.this.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n // patientList.add(new Patient(name, cName, cStatus));\n thisListView.setAdapter(thisAdapter);\n\n\n thisListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n Patient currentPatient = patientList.get(position);\n\n //Log.d(\"clicker: \", patientList.get(position).getCondition().toString());\n\n\n //thisIntent = new Intent(StaffActivity.this, SinglePatientView.class);\n //thisIntent.putExtra(\"patientName\", currentPatient.getpName());\n //thisIntent.putExtra(\"patientConditions\", currentPatient.getCondition().toString());\n //startActivity(thisIntent);\n\n }\n\n });\n\n }\n });\n\n\n }\n\n @Override\n public void onFailure(@Nonnull ApolloException e) {\n Log.d(\"onResponse\", e.toString());\n }\n });\n\n return patientList;\n }", "@Override\n\tpublic Collection<Patient> searchByName(String query) {\n\t\treturn null;\n\t}", "public PatientExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public static Patient find(int id) {\n\tPatient patient = null;\n\tfor (Patient a : patients) {\n\t if (a.getId() == id) {\n\t\tpatient = a;\n\t\tbreak;\n\t }\n\t}\t\n\t\n\treturn patient;\n }", "List<MedicalRecord> getAllPatientMedicalRecords(HttpSession session, int patientId);", "List<DeviceDetails> getDevices(Predicate<DeviceDetails> deviceFilter);", "@GET(DOCTOR_PATIENTS_PATH)\n\tCollection<Patient> getPatients(\n\t\t\t@Path(DOCTOR_ID_PARAM) long doctorId);", "public List<Patient> getFHIR() {\n IGenericClient client;\n FhirContext ctx;\n ctx = FhirContext.forDstu3();\n ctx.setRestfulClientFactory(new OkHttpRestfulClientFactory(ctx));\n client = ctx.newRestfulGenericClient(\"http://fhirtest.uhn.ca/baseDstu3\");\n\n // .lastUpdated(new DateRangeParam(\"2011-01-01\",\"2018-11-25\")) - to get latest data\n // Not used since unable to get proper records with names\n Bundle bundle = client.search().forResource(Patient.class)\n .where(Patient.NAME.isMissing(false))\n .and(Patient.BIRTHDATE.isMissing(false))\n .and(Patient.GENDER.isMissing(false))\n .sort().ascending(Patient.NAME)\n .count(10)\n .returnBundle(Bundle.class)\n .execute();\n return BundleUtil.toListOfResourcesOfType(ctx, bundle, Patient.class);\n }", "public List<Contact> searchContacts(Map<SearchTerm,String> criteria);", "public Map<String, Object> getPeople(Map<String, Object> conditions) {\n String dwdm = conditions.get(\"dwdm\").toString();\n StringBuffer sql = new StringBuffer(50);\n sql.append(\"select * from JM_DUTY a where 1 = 1 and xgsj in (select max(xgsj) from jm_duty where zbrbmbh='\" + dwdm + \"')\");\n//\t\tSet<Entry<String, Object>> set = conditions.entrySet();\n//\t\tIterator<Entry<String, Object>> it = set.iterator();\n//\t\t\tEntry<String, Object> entry = it.next();\n//\t\t\tString key = entry.getKey();\n//\t\t\tString value = (String) entry.getValue();\n Map<String, Object> map = findPageForMap(sql.toString(),\n Integer.parseInt(conditions.get(\"page\").toString()),\n Integer.parseInt(conditions.get(\"rows\").toString()));\n //Map<String, Object> map = findPageForMap(sql.toString(),1,20);\n return map;\n }", "@ApiOperation(value = \"Api Endpoint to search for the Patient record - Only using User name\")\n @GetMapping(\"search\")\n @LogExecutionTime\n public List<PatientDto> searchPatientRecords(@RequestParam(name = \"search\") String search,\n @RequestParam(name = \"page\", defaultValue = \"0\") int page,\n @RequestParam(name = \"limit\", defaultValue = \"10\") int limit,\n @RequestParam(name = \"orderBy\", defaultValue = \"asc\") String orderBy) {\n return patientService.searchPatientRecords(search, page, limit, orderBy);\n }", "public List<RecordDTO> selectAllRecord(Criteria criteria);", "public static ArrayList<Patient> getPatientsFromMedic(Medic medic) {\n ArrayList<Patient> tempPatientList = new ArrayList<>();\n for (Patient patient :\n patients\n ) {\n for (Consultation consultation :\n patient.getMedicalFile().getConsultationsList()\n ) {\n if (consultation.getMedicId() == medic.getMedicDetails().getMedicId()) {\n tempPatientList.add(patient);\n break;\n }\n }\n }\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(new Object() {\n }.getClass().getEnclosingMethod().getName()).append(\",\").append(new Timestamp(System.currentTimeMillis()));\n writeToAudit(stringBuilder);\n return tempPatientList;\n }", "public List<Patient> readParticularDoctorPatients(Doctor doctor) throws SystemException, BusinessException {\n\t\tList<Patient> patients = new ArrayList<>();\n\t\ttry {\n\n\t\t\tpatients = patientDb.readParticularDoctorPatients(doctor);\n\n\t\t} catch (SQLException | ClassNotFoundException e) {\n\t\t\tthrow new BusinessException(e);\n\t\t} catch (Exception e) {\n\t\t\tthrow new SystemException(e);\n\t\t}\n\t\t\n\t\treturn patients;\n\n\t}", "public static Patient[] getPatientListFromSequentialFile(String filename) throws IOException {\n\t\tPatient[] patientInfo = new Patient[150];\n\t\tScanner inputStream = null;\n\t\tint patientCounter = 0;\n\t\tString ramq;\n\t\tString firstName;\n\t\tString lastName;\n\t\tString telephone;\n\t\tString medScheme;\n\t\tString medNumber;\n\t\tString medName;\n\t\tString condition;\n\t\tMedication medication = null;\n\n\t\ttry {\n\t\t\t// If file is not found, throws IOException\n\t\t\tBufferedReader bufferedReader = new BufferedReader(\n\t\t\t\t\tnew InputStreamReader(new FileInputStream(filename), StandardCharsets.UTF_8));\n\n\t\t\tinputStream = new Scanner(bufferedReader);\n\t\t\tString record = null;\n\n\t\t\t// Loop for getting all the records.\n\t\t\twhile (inputStream.hasNext()) {\n\n\t\t\t\trecord = inputStream.nextLine().trim();\n\n\t\t\t\tif (!record.isEmpty()) {\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// Getting and splitting data from row\n\t\t\t\t\t\tString[] recordArray = record.split(\"\\\\*\");\n\n\t\t\t\t\t\t// If array has too little or too much data\n\t\t\t\t\t\t// skips over rest of current loop\n\t\t\t\t\t\tif ((recordArray.length < 3) || (recordArray.length > 8)) {\n\t\t\t\t\t\t\tthrow new IllegalArgumentException(\"The record contains too much or too little data.\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tramq = recordArray[0].trim();\n\t\t\t\t\t\tfirstName = recordArray[1].trim();\n\t\t\t\t\t\tlastName = recordArray[2].trim();\n\n\t\t\t\t\t\t// Attempting to create a patient using the data given.\n\t\t\t\t\t\t// Sets telephone, medication, etc if present.\n\n\t\t\t\t\t\tpatientInfo[patientCounter] = new ClinicPatient(firstName, lastName, ramq);\n\n\t\t\t\t\t\t// Checks if telephone number is present, sets it.\n\t\t\t\t\t\tif (recordArray.length >= 4) {\n\t\t\t\t\t\t\ttelephone = recordArray[3].trim();\n\t\t\t\t\t\t\tpatientInfo[patientCounter].setTelephoneNumber(Optional.of(telephone));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Checks if medication is present, sets it.\n\t\t\t\t\t\tif (recordArray.length >= 7) {\n\t\t\t\t\t\t\tmedScheme = recordArray[4].trim();\n\t\t\t\t\t\t\tmedNumber = recordArray[5].trim();\n\t\t\t\t\t\t\tmedName = recordArray[6].trim();\n\n\t\t\t\t\t\t\t// Checking to make sure all aspects of medication\n\t\t\t\t\t\t\t// exist, then set it.\n\t\t\t\t\t\t\tif ((!medScheme.equals(\"\")) && (!medNumber.equals(\"\")) && (!medName.equals(\"\"))) {\n\t\t\t\t\t\t\t\tif (medScheme.equalsIgnoreCase(\"DIN\")) {\n\t\t\t\t\t\t\t\t\tmedication = new DINMedication(medNumber, medName);\n\t\t\t\t\t\t\t\t\tpatientInfo[patientCounter].setMedication(Optional.of(medication));\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\telse if (medScheme.equalsIgnoreCase(\"NDC\")) {\n\t\t\t\t\t\t\t\t\tmedication = new NDCMedication(medNumber, medName);\n\t\t\t\t\t\t\t\t\tpatientInfo[patientCounter].setMedication(Optional.of(medication));\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\tif (recordArray.length == 8) {\n\t\t\t\t\t\t\tcondition = recordArray[7].trim();\n\n\t\t\t\t\t\t\t// if condition exists, set it\n\t\t\t\t\t\t\tif (!condition.equals(\"\")) {\n\t\t\t\t\t\t\t\tpatientInfo[patientCounter].setExistingConditions(Optional.of(condition));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Moves patient array index up.\n\t\t\t\t\t\tpatientCounter++;\n\n\t\t\t\t\t} // End of Try\n\t\t\t\t\tcatch (IllegalArgumentException iae) {\n\t\t\t\t\t\tSystem.out.println(\"The following record caused an error.\");\n\t\t\t\t\t\tSystem.out.println(record);\n\t\t\t\t\t\tSystem.out.println(iae.getMessage() + \"\\n\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t} // end of if statement is not empty\n\n\t\t\t} // end of while\n\n\t\t\t// } // end of if statement\n\n\t\t\tpatientInfo = resizePatient(patientInfo, patientCounter);\n\n\t\t\treturn patientInfo;\n\t\t} // end of try\n\t\tcatch (IOException e) {\n\t\t\tthrow new IOException(\"File not found.\\n\" + e.getMessage() + \"\\n\");\n\t\t} finally {\n\t\t\tif (inputStream != null)\n\t\t\t\tinputStream.close();\n\t\t}\n\n\t}", "@Search()\n\t\tpublic List<Patient> getResourceById(@RequiredParam(name = \"_id\") String theId) {\n\t\t\tPatient patient = getIdToPatient().get(theId);\n\t\t\tif (patient != null) {\n\t\t\t\treturn Collections.singletonList(patient);\n\t\t\t} else {\n\t\t\t\treturn Collections.emptyList();\n\t\t\t}\n\t\t}", "public ArrayList<NameRecord> getMatches(String partialName){\n\t\tpartialName=partialName.toLowerCase();\n\t\tArrayList<NameRecord> result = new ArrayList<NameRecord>();\n\t\tfor (int i = 0;i<names.size();i++){\n\t\t\tString s = names.get(i).toLowerCase();\n\t\t\tif (s.contains(partialName)){\n\t\t\t\tresult.add(list.get(i));\n\t\t\t}\n\t\t}\t\n\t\treturn result;\n\t}", "@Override\r\n\tpublic List<Person> meetCriteria(List<Person> persons) {\n\t\tList<Person> firstCriteriaItem = criteria.meetCriteria(persons);\r\n\t\tList<Person> otherCriteriaItem = otherCriteria.meetCriteria(persons);\r\n\t\t\r\n\t\tfor(Person person: otherCriteriaItem)\r\n\t\t{\r\n\t\t\tif(!(firstCriteriaItem.contains(person)))\r\n\t\t\t\tfirstCriteriaItem.add(person);\r\n\t\t}\r\n\t\t\r\n\t\treturn firstCriteriaItem;\r\n\t\t\r\n\t\t}", "public List<Measurement> findPatientMeasurements(int patientId) {\n return entityManager\n .createQuery(\"SELECT m from Measurement m \" +\n \"WHERE m.patientId.patientId = :patientId\", Measurement.class)\n .setParameter(\"patientId\", patientId)\n .getResultList();\n }", "@Override\n\tpublic void searchByID() {\n\t\tcount = 0;\n\t\tif (UtilityClinic.patFile == null) {\n\t\t\ttry {\n\t\t\t\tutil.accessExistingPatJson();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"File not found\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tutil.readFromPatJson(UtilityClinic.patFile);\n\t\tSystem.out.println(\"Enter search.....\");\n\t\tString search = UtilityClinic.readString();\n\t\tSystem.out.println(\"Showing search result(s).......\");\n\t\tfor (int i = 0; i < UtilityClinic.patJson.size(); i++) {\n\t\t\tJSONObject jsnobj = (JSONObject) UtilityClinic.patJson.get(i);\n\t\t\tif (jsnobj.get(\"Patient's ID\").toString().equals(search))\n\t\t\t\tSystem.out.print(\n\t\t\t\t\t\t++count + \" Name:\" + jsnobj.get(\"Patient's name\") + \" ID:\" + jsnobj.get(\"Patient's ID\")\n\t\t\t\t\t\t\t\t+ \" Mobile:\" + jsnobj.get(\"Mobile\") + \" Age:\" + jsnobj.get(\"Age\"));\n\t\t}\n\t\tif (count == 0) {\n\t\t\tSystem.out.println(\"No results found.....\");\n\t\t}\n\t\tSystem.out.println();\n\t}", "public Person[] getPatientsWithAgeAbove(int age) {\n int count = 0;\n for(int i = 0; i < listOfPatients.length; i++)\n {\n if(listOfPatients[i].getAge()> age)\n count++;\n }\n \n if(count == 0)\n return null;\n\n int index = 0;\n Person[] patientsWithAgeAbove = new Person[count];\n for(int i = 0; i < listOfPatients.length; i++)\n {\n if(listOfPatients[i].getAge()> age)\n patientsWithAgeAbove[index++] = listOfPatients[i];\n }\n\n return patientsWithAgeAbove;\n }", "public interface IPlantDAO {\n\n /**\n * Accept filter, text and return a collection of plants that contain that filter text\n * @param filter the text we want to match in our returned list of plants.\n * @return a list of plants that contain given filter text in either genus, species, cultivar or common name.\n */\n public List<PlantDTO> fetchPlants(String filter);\n\n\n}", "@Override\n\tpublic void searchByName() {\n\t\tcount = 0;\n\t\tif (UtilityClinic.patFile == null) {\n\t\t\ttry {\n\t\t\t\tutil.accessExistingPatJson();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"File not found\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tutil.readFromPatJson(UtilityClinic.patFile);\n\t\tSystem.out.println(\"Enter search.....\");\n\t\tString search = UtilityClinic.readString();\n\t\tSystem.out.println(\"Showing search result(s).......\");\n\t\tfor (int i = 0; i < UtilityClinic.patJson.size(); i++) {\n\t\t\tJSONObject jsnobj = (JSONObject) UtilityClinic.patJson.get(i);\n\t\t\tif (jsnobj.get(\"Patient's name\").toString().equals(search))\n\t\t\t\tSystem.out.print(\n\t\t\t\t\t\t++count + \" Name:\" + jsnobj.get(\"Patient's name\") + \" ID:\" + jsnobj.get(\"Patient's ID\")\n\t\t\t\t\t\t\t\t+ \" Mobile:\" + jsnobj.get(\"Mobile\") + \" Age:\" + jsnobj.get(\"Age\"));\n\t\t}\n\t\tif (count == 0) {\n\t\t\tSystem.out.println(\"No results found.....\");\n\t\t}\n\t}", "@Override\n\tpublic List<Patient> listOfPatients() {\n\t\treturn null;\n\t}", "public ResultSet getPatientDetailsByPatientId(int patientId) {\n\t\treturn dbObject.select(\"SELECT * FROM patients where patientId=\"+patientId);\n\n\t}", "public List getValidarSapExistencia(Map criteria);", "@Override\n public PatientCaseDto getByPatient(Long patientId) {\n return null;\n }", "@Override\n\tpublic void searchByMobile() {\n\t\tcount = 0;\n\t\tif (UtilityClinic.patFile == null) {\n\t\t\ttry {\n\t\t\t\tutil.accessExistingPatJson();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"File not found\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tutil.readFromPatJson(UtilityClinic.patFile);\n\t\tSystem.out.println(\"Enter search.....\");\n\t\tString search = UtilityClinic.readString();\n\t\tSystem.out.println(\"Showing search result(s).......\");\n\t\tfor (int i = 0; i < UtilityClinic.patJson.size(); i++) {\n\t\t\tJSONObject jsnobj = (JSONObject) UtilityClinic.patJson.get(i);\n\t\t\tif (jsnobj.get(\"Mobile\").toString().equals(search)) {\n\t\t\t\tpMob = jsnobj.get(\"Mobile\").toString();\n\t\t\t\tpName = jsnobj.get(\"Patient's name\").toString();\n\t\t\t\tpId = jsnobj.get(\"Patient's ID\").toString();\n\t\t\t\tSystem.out.print(++count + \" Name:\" + pName + \" ID:\" + pId + \" Mobile:\" + pMob + \" Age:\"\n\t\t\t\t\t\t+ jsnobj.get(\"Age\") + \"\\n\\n\");\n\t\t\t}\n\t\t}\n\t\tif (count == 0) {\n\t\t\tSystem.out.println(\"No results found.....\");\n\t\t}\n\t\tSystem.out.println();\n\t}", "List<Accessprofile> listWithCriteras(List<SearchCriteria> searchCriterias);", "public Person[] match(int numberOfHearts) {\n if(numberOfHearts == 0){\n return null;\n }\n if(numberOfHearts >= listOfPatients.length){\n return listOfPatients;\n }\n\n Person[] returnList = new Person[numberOfHearts];\n int i = 0;\n\n for(int j = 0 ; j < survivabilityByCause.length ; j++){\n SurvivabilityByCause c = survivabilityByCause[i];\n int pCount = 0;\n Person[] peeps = getPatientsByHeartConditionCause(c.getCause());\n\n while(i <= numberOfHearts && pCount < peeps.length){\n returnList[i] = peeps[pCount];\n pCount++;\n i++;\n }\n }\n \n return returnList;\n }", "List<Establishment> searchEstablishments(EstablishmentCriteria criteria, RangeCriteria rangeCriteria);", "public Person[] search(Predicate<Person> predicate) {\n\t\tPerson[] tempArr = new Person[nElems];\n\t\tint count = 0;\n\t\tfor(int i = 0; i < nElems; i++) {\n\t\t\tif(predicate.test(arr[i])) {\n\t\t\t\ttempArr[count++] = arr[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn Arrays.copyOf(tempArr, count);\n\t}", "@GET(PATIENT_BY_ID_PATH)\n\tPatient getPatient(\n\t\t\t@Path(PATIENT_ID_PARAM) long patientId);", "public UserPatientExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public ArrayList<Patient> getPatientList(String DocName)\r\n {\n\t ArrayList<Patient> names = new ArrayList<Patient>();\r\n\t \r\n\t try \r\n\t {\r\n\t\tResultSet rs = stmt.executeQuery( \"SELECT * FROM PATIENTDATA;\" );\r\n\t\tint i =0;\r\n\t\twhile (rs.next())\r\n\t\t{\r\n\t\t\tString fname = rs.getString(\"firstname\");\r\n\t\t\tString lname = rs.getString(\"lastname\");\r\n\t\t\tString userName = rs.getString(\"username\");\r\n\t\t\tString passWord = rs.getString(\"password\");\r\n\t\t\tString secAns = rs.getString(\"securityans\");\r\n\t\t\tString check = rs.getString(\"doctorsname\");\r\n\t\t\tint Notify = rs.getInt(\"notification\");\r\n\t\t\t// if the name matches the doctor's name, then Add to the Patient Arraylist.\r\n\t\t\tif (check.equals(DocName))\t\r\n\t\t\t{\r\n\t\t\t\tint symp[]= new int[7];\r\n\t\t\t\tint pr1[]=new int[7];\r\n\t\t\t\tint pr2[]=new int[7];\r\n\t\t\t\tint thrs[]=new int[7]; \r\n\t\t\t\t\r\n\t\t\t\tsymp[0] = rs.getInt(\"SYMPTOM1\");\r\n\t\t\t\tsymp[1] = rs.getInt(\"SYMPTOM2\");\r\n\t\t\t\tsymp[2] = rs.getInt(\"SYMPTOM3\");\r\n\t\t\t\tsymp[3] = rs.getInt(\"SYMPTOM4\");\r\n\t\t\t\tsymp[4] = rs.getInt(\"SYMPTOM5\");\r\n\t\t\t\tsymp[5] = rs.getInt(\"SYMPTOM6\");\r\n\t\t\t\tsymp[6] = rs.getInt(\"SYMPTOM7\");\r\n\t\t\t\t\r\n\t\t\t\tpr1[0] = rs.getInt(\"PrevSYMPTOM1_1\");\r\n\t\t\t\tpr1[1] = rs.getInt(\"PrevSYMPTOM1_2\");\r\n\t\t\t\tpr1[2] = rs.getInt(\"PrevSYMPTOM1_3\");\r\n\t\t\t\tpr1[3] = rs.getInt(\"PrevSYMPTOM1_4\");\r\n\t\t\t\tpr1[4] = rs.getInt(\"PrevSYMPTOM1_5\");\r\n\t\t\t\tpr1[5] = rs.getInt(\"PrevSYMPTOM1_6\");\r\n\t\t\t\tpr1[6] = rs.getInt(\"PrevSYMPTOM1_7\");\r\n\t\t\t\t\r\n\t\t\t\tpr2[0] = rs.getInt(\"PrevSYMPTOM2_1\");\r\n\t\t\t\tpr2[1] = rs.getInt(\"PrevSYMPTOM2_2\");\r\n\t\t\t\tpr2[2] = rs.getInt(\"PrevSYMPTOM2_3\");\r\n\t\t\t\tpr2[3] = rs.getInt(\"PrevSYMPTOM2_4\");\r\n\t\t\t\tpr2[4] = rs.getInt(\"PrevSYMPTOM2_5\");\r\n\t\t\t\tpr2[5] = rs.getInt(\"PrevSYMPTOM2_6\");\r\n\t\t\t\tpr2[6] = rs.getInt(\"PrevSYMPTOM2_7\");\r\n\r\n\t\t\t\t\r\n\t\t\t\tthrs[0] = rs.getInt(\"SYMPTOM1Thresh\");\r\n\t\t\t\tthrs[1] = rs.getInt(\"SYMPTOM2Thresh\");\r\n\t\t\t\tthrs[2] = rs.getInt(\"SYMPTOM3Thresh\");\r\n\t\t\t\tthrs[3] = rs.getInt(\"SYMPTOM4Thresh\");\r\n\t\t\t\tthrs[4] = rs.getInt(\"SYMPTOM5Thresh\");\r\n\t\t\t\tthrs[5] = rs.getInt(\"SYMPTOM6Thresh\");\r\n\t\t\t\tthrs[6] = rs.getInt(\"SYMPTOM7Thresh\");\r\n\t\t\t\t\r\n\t\t\t\t//make new Patient object with the patient informations.\r\n\t\t\t\tPatient P1 = new Patient(fname,lname,userName,passWord,secAns,DocName,symp,pr1,pr2,thrs);\r\n\t\t\t\tP1.setFlag(Notify);\r\n\t\t\t\tnames.add(P1); //Added to the Patient Arraylist\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn names; // Return list of patients\r\n\t\t\r\n\t\t\r\n\t } \r\n\t catch (SQLException e) \r\n\t {\r\n\t\t\r\n\t\te.printStackTrace();\r\n\t }\r\n\t \r\n\t return names;\r\n\t \r\n\t \r\n }", "public static com.statuspatients.plugins.model.Patients getPatients(\n long fooId)\n throws com.liferay.portal.kernel.exception.PortalException,\n com.liferay.portal.kernel.exception.SystemException {\n return getService().getPatients(fooId);\n }", "public List getValidarCuvExistencia(Map criteria);", "List<Student> selectByExample(StudentCriteria example);", "public void patientadder (String index, String email){\n String test2 = email;\n for(int i = 0; i < doctorsList.size(); i++){\n String test = doctorsList.get(i).getEmail();\n if(test.equals(test2)){\n patients.add(index);\n }\n }\n }", "@RequestMapping(method = RequestMethod.GET, path = \"/patients\")\n @Secured({\"ROLE_DOCTOR\"})\n @ResponseStatus(HttpStatus.OK)\n public List<User> fetchAllPatients(Principal principal) {\n log.info(\"Fetching all patients using user with Id [{}]\", principal.getName());\n return userService.fetchAllPatients(\"ROLE_PATIENT\");\n }", "VerificationToken findByPatient(Patient patient);", "public Patient getPatientBySsn(String ssn) {\n Patient pat = null;\n for (int i = 0; i < patients.size(); i++) {\n if (patients.get(i).getSsn().equals(ssn)) {\n pat = patients.get(i);\n }\n }\n return pat;\n }", "public static ResultSet getPatientInfo(int id) {\r\n\t\ttry{\r\n\t\t\tconnection = DriverManager.getConnection(connectionString);\r\n\t\t\tstmt = connection.prepareStatement(\"SELECT * FROM Patient WHERE ID =?;\");\r\n\t\t\tstmt.setString(1, String.valueOf(id));\r\n\t\t\tdata = stmt.executeQuery();\r\n\t\t}\r\n\t\tcatch (SQLException ex){\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t\treturn data;\r\n\t}", "public MusicData[] findOther(Long accountId, SearchCriteria criteria) throws MusicAppException;", "public List<Patient> listAllPatient() {\n\t\treturn null;\n\t}", "@RequestMapping(method = RequestMethod.GET, path = \"/patients/{userEmail}\")\n @Secured({\"ROLE_DOCTOR\"})\n @ResponseStatus(HttpStatus.OK)\n public List<Result> fetchPatientResults(\n @PathVariable(value = \"userEmail\") String userEmail) {\n log.info(\"Fetching results of patient with Id [{}]\", userEmail);\n return resultService.fetchResultsWithUserEmail(userEmail);\n }", "List<T> findByCriteria(Criteria criteria) ;", "@GET(PATIENT_BY_NAME_PATH)\n\tPatient findPatientByName(\n\t\t\t@Path(PATIENT_NAME_PARAM) String patientName);", "public PatientDetails getSinglePatientDetails(String searchString, EntityManagerFactory entityManagerFactory) {\n String ID = searchString.split(\",\")[0].trim();\n\n EntityManager entityManager = entityManagerFactory.createEntityManager();\n\n Query query_record = entityManager.createNamedQuery(PATIENT_PHR_QUERY);\n query_record.setParameter(\"id\",ID);\n\n long start = System.currentTimeMillis();\n PatientDetails healthRecord = (PatientDetails) query_record.getSingleResult();\n System.out.println(\"\\n** PHR generated in --> \" + (System.currentTimeMillis()-start) + \" msec\");\n\n entityManager.close();\n return healthRecord;\n }", "@Override public ArrayList<Sample> getAllPatientSamples(Patient patient)\n {\n try\n {\n return clientDoctor.getAllPatientSamples(patient);\n }\n catch (RemoteException e)\n {\n throw new RuntimeException(\"Error while fetching samples. Please try again.\");\n }\n }", "@Override\n\tpublic List<Applicant> getAllApplicantUsingRegex() {\n\t\tSystem.out.println(\"Fname Ending with a \");\n\t\tQuery query = new Query().addCriteria(Criteria.where(\"fname\").regex(\"a$\"));\n\t\treturn applicantMongoTemplate.find(query, Applicant.class);\n\t}", "public String[] findRecord(int happiness){\n\n String[] result = null;\n\n for (String[] record:records) {\n\n if (Integer.parseInt(record[1]) == happiness){\n result = record;\n break;\n }\n }\n\n return result;\n }", "@Override\n\tpublic List<Patientstreatments> getallpatienttreat() {\n\t\treturn patreatrep.findAll();\n\t}", "ObservableList<Doctor> getFilteredDoctorList();", "List<CustDataNotesResponseDTO> searchForCustDataNotes(CustDataNotesRequestDTO custDataNotesRequestDTO) throws Exception;", "@Transactional(readOnly = true)\n public List<Patient> search(String query) {\n log.debug(\"Request to search Patients for query {}\", query);\n List<Patient> result = StreamSupport\n .stream(patientSearchRepository.search(wrapperQuery(query)).spliterator(), false)\n .collect(Collectors.toList());\n return result;\n }", "Patient findByAccountId(int id, boolean b);", "@Override\r\n\tpublic List<Object[]> plantAdvanceSearch(String plant) {\n\t\tString hql=null;\r\n\t\tif(plant.equalsIgnoreCase(\"ALL\"))\r\n\t\t{\r\n\t\t\thql=\"select p.plantId ,p.plantName,p.add1,p.add2,p.add3,p.city,p.state,p.phone,p.fax,p.mobile,p.organization,p.countrysList from Plant p\";\r\n\t \r\n\t\t}\r\n\t\t\r\n\t\tif(!plant.equalsIgnoreCase(\"ALL\"))\r\n\t\t{\t\r\n\t\thql=\"select p.plantId ,p.plantName,p.add1,p.add2,p.add3,p.city,p.state,p.phone,p.fax,p.mobile,p.organization,p.countrysList from Plant p where \"+plant;\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t List<Object[]> list=getHibernateTemplate().find(hql);\r\n\t\r\n\t\t\treturn list;\t\r\n\t}", "public Patient chercherPatientId(int id_patient) {\r\n Patient p = null;\r\n int i = 0;\r\n while (i != patients.size() && patients.get(i).getIdPatient() != id_patient) {\r\n i++;\r\n }\r\n if (i != patients.size()) {\r\n p = patients.get(i);\r\n }\r\n return p;\r\n }", "@Override\n public PatientCaseDto getByDoctorPatient(Long patientId, Long doctorId) {\n return null;\n }", "@GetMapping(\"/patient\")\r\n\t@ApiOperation(value = \"To list Patient Directory\")\r\n\t// @Cacheable(value = \"getRecordWithDat\", key = \"#root.methodName\")\r\n\tpublic List<PatientRecord> getAllPatientRecords() {\r\n\t\tlogger.info(\"listAllPatient {}\", patientService.getAll());\r\n\t\t// kafkaTemplate.send(\"kafkaExample\",\r\n\t\t// patientService.getAll().stream().findAny());\r\n\t\treturn patientService.getAll();\r\n\t}", "public MedicalRecord getMedicalRecord(String patient, String index){\n int i = Integer.parseInt(index);\n if(database.containsKey(patient)){\n if(database.get(patient).size() > i){\n return database.get(patient).get(i);\n } else{\n System.out.println(\"No such Medical Records found for \" + patient);\n }\n } else {\n System.out.println(patient + \" Not found in database\");\n }\n return null;\n }", "@Override\n\tpublic Patients findById(Object... valrs) throws Exception {\n\t\treturn null;\n\t}", "public Patient getPatientByID(int pid) {\r\n\t\tPatient patient=null;\r\n\t\ttry {\r\n\t\t\tString query= \"SELECT * FROM patients WHERE id = ? \";\r\n\t\t\tPreparedStatement pStatement= super.getConnection().prepareStatement(query);\r\n\t\t\tpStatement.setInt(1, pid);\r\n\t\t\tResultSet results= pStatement.executeQuery();\r\n\t\t\twhile(results.next()) {\r\n\t\t\t\t//Patient table\r\n\t\t\t\tint idPatient= results.getInt(1);\r\n\t\t\t\tString fname= results.getString(2);\r\n\t\t\t\tString lname= results.getString(3);\r\n\t\t\t\tString gender= results.getString(4);\r\n\t\t\t\tint age= results.getInt(5);\r\n\t\t\t\tString phone= results.getString(6);\r\n\t\t\t\tString villege= results.getString(7);\r\n\t\t\t\tString commune= results.getString(8);\r\n\t\t\t\tString city= results.getString(9);\r\n\t\t\t\tString province= results.getString(10);\r\n\t\t\t\tString country= results.getString(11);\r\n\t\t\t\tAddress address= new Address(villege, commune, city, province, country);\r\n\t\t\t\tString type= results.getString(12);\r\n\t\t\t\t\r\n\t\t\t\tpatient= new Patient(idPatient, fname, lname, gender, age, phone, address, type);\r\n\t\t\t\tSystem.out.println(\"Get Patients succeed From DatabasePatient\");\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\t\r\n\t\treturn patient;\r\n\t}" ]
[ "0.6467302", "0.6292085", "0.62456286", "0.6084717", "0.6048174", "0.59881073", "0.5986975", "0.59810776", "0.5972641", "0.5896138", "0.58835876", "0.5861339", "0.5861288", "0.5860845", "0.5803742", "0.5790233", "0.5766299", "0.57403", "0.5702295", "0.56609243", "0.56541884", "0.5630782", "0.5624362", "0.5608658", "0.5597544", "0.5597327", "0.5596254", "0.5588703", "0.5575105", "0.55331767", "0.55260324", "0.55023164", "0.5497746", "0.5478784", "0.54524606", "0.5424585", "0.5386201", "0.5386169", "0.5383536", "0.53798884", "0.5374292", "0.5359404", "0.5356182", "0.5352038", "0.53478014", "0.5344414", "0.53411645", "0.53372705", "0.5336114", "0.53231543", "0.5311333", "0.53041387", "0.52679104", "0.52677834", "0.5266066", "0.52593535", "0.52573156", "0.5213281", "0.52064407", "0.5190889", "0.51790166", "0.51768154", "0.51694846", "0.5161192", "0.5156245", "0.51541775", "0.51459074", "0.5144951", "0.51449007", "0.5139371", "0.51302105", "0.51288784", "0.51277906", "0.51273185", "0.5125704", "0.5125223", "0.5124931", "0.51225466", "0.51213914", "0.5121345", "0.51094055", "0.51079154", "0.5106379", "0.5099972", "0.5078077", "0.5075797", "0.50757474", "0.50739855", "0.5056052", "0.50444466", "0.50443256", "0.5038655", "0.5037438", "0.50333947", "0.502365", "0.5021287", "0.5018772", "0.5018731", "0.50134575", "0.50127447", "0.5000918" ]
0.0
-1
Tests whether a String is parseable as an Integer
public static boolean isInteger(String string) { try { Integer.valueOf(string); return true; } catch (NumberFormatException e) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static boolean isInteger(String s) {\r\n try {\r\n Integer.parseInt(s);\r\n return true;\r\n } catch (Exception ex) {\r\n return false;\r\n }\r\n }", "public static boolean isInteger(String s) {\n\t try { \n\t Integer.parseInt(s); \n\t } catch(NumberFormatException e) { \n\t return false; \n\t }\n\t return true;\n\t}", "public boolean isAnInt(String str) {\r\n \ttry {\r\n \t\tInteger.parseInt(str);\r\n \t} catch (NumberFormatException e) {\r\n \t\treturn false;\r\n \t}\r\n \treturn true;\r\n }", "public static boolean isInteger(String s) {\n\t\ttry {\n\t\t\tInteger.parseInt(s);\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public static boolean isInteger(String s) {\n\t try { Integer.parseInt(s); }\n\t catch(NumberFormatException e) { return false; }\n\t catch(NullPointerException e) { return false; }\n\t // only gets here if the entered String is Integer:\n\t return true;\n\t}", "private boolean isStringAnInt(String s) {\n // false if string is null\n if (s == null) {\n return false;\n }\n // if scanner get parse string for int then return true\n try {\n Scanner sc = new Scanner(s);\n int num = sc.nextInt();\n }\n // return false if it throws an exception\n catch (Exception e) {\n return false;\n }\n return true;\n }", "public static boolean isInteger(String s) {\n\t\ttry { \n\t\t\tInteger.parseInt(s); \n\t\t} catch(NumberFormatException e) { \n\t\t\treturn false; \n\t\t} catch(NullPointerException e) {\n\t\t\treturn false;\n\t\t}\n\t\t// only got here if we didn't return false\n\t\treturn true;\n\t}", "public static boolean is_int(String s) {\n try {\n Integer.parseInt(s);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n }", "private boolean isInteger(String a) {\n try \n {\n Integer.parseInt(a);\n return true;\n }\n catch(Exception e) {\n return false;\n }\n }", "public static boolean isInteger(String s) {\r\n\t\ttry {\r\n\t\t\tInteger.parseInt(s);\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t\treturn false;\r\n\t\t} catch (NullPointerException e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public boolean isInt(String value) {\n try {\n Integer.parseInt(value);\n return true;\n } catch (Exception e) {\n return false;\n }\n }", "public static boolean isInteger(String s)\r\n {\r\n if (s == null || s.length() == 0)\r\n return false;\r\n \r\n //integer regular expression\r\n String regex = \"[-|+]?\\\\d+\";\r\n if (!s.matches(regex))\r\n return false;\r\n \r\n if (s.startsWith(\"+\"))\r\n s = s.substring(1);\r\n \r\n //try convert the string to an int\r\n //if it can not be converted, then return false\r\n try\r\n {\r\n Integer.parseInt(s);\r\n }catch(Exception e)\r\n {\r\n return false;\r\n }\r\n \r\n return true;\r\n }", "public static boolean isInteger(String value) {\n\t\ttry {\n\t\t\tInteger.parseInt(value);\n\t\t}\n\t\t \n\t\tcatch(NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "private boolean isInteger(String s)\n{\n\t boolean isNumber = true;\n\ttry{\n\t\t\tint n = Integer.parseInt(s);\n\t }catch(NumberFormatException n)\n\t {\n\t\t isNumber = false;\n\t }\n\n\treturn isNumber;\n}", "public static boolean isInteger(String value) {\n boolean valid = false;\n try {\n Integer.parseInt(value);\n valid = true;\n } catch (RuntimeException exc) {\n // could not parse into int, false will be returned\n }\n return valid;\n }", "public static boolean isInteger(String s) {\n try {\n Integer.parseInt(s);\n } catch(NumberFormatException e) {\n return false;\n } catch(NullPointerException e) {\n return false;\n }\n return true;\n }", "public static boolean isInteger(String str){\n try {\n int d = Integer.parseInt(str);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "public boolean isInteger(String x){\n try{\n Integer.parseInt(x);\n \n }\n catch(NumberFormatException e){\n return false;\n }\n return true;\n }", "public static boolean isInteger(String str) {\n\t\ttry {\n\t\t\tInteger.parseInt(str);\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private static boolean validateInteger(String intString) {\n try {\n Integer.parseInt(intString);\n } catch (NumberFormatException e) {\n // Not a valid integer\n return false;\n }\n return true;\n }", "private int isInteger(String s) {\r\n\t\t\tint retInt;\r\n\t\t try { \r\n\t\t \tretInt = Integer.parseInt(s); \r\n\t\t } catch(NumberFormatException e) { \r\n\t\t return -1; \r\n\t\t } catch(NullPointerException e) {\r\n\t\t return -1;\r\n\t\t }\r\n\t\t // only got here if we didn't return false\r\n\t\t return retInt;\r\n\t\t}", "private boolean isInt(String str) { \n\t try { \n\t int d = Integer.parseInt(str); \n\t } catch(NumberFormatException nfe) { \n\t return false; \n\t } \n\t return true; \n\t}", "public boolean isInteger(String sIntString) {\n int i = 0;\n try {\n i = Integer.parseInt(sIntString);\n return true;\n } catch (Exception e) {\n return false;\n }\n }", "private boolean tryParseInt(String str) {\n try {\n Integer.parseInt(str);\n } catch (Exception ex) {\n return false;\n }\n return true;\n }", "public static boolean isInteger(String s) {\n\t return isInteger(s,10);\n\t}", "public boolean isInt(String text)\r\n {\r\n try\r\n {\r\n int ans = Integer.parseInt(text);\r\n return true;\r\n }\r\n catch(NumberFormatException e)\r\n {\r\n return false;\r\n }\r\n }", "public boolean isInteger(String input){\r\n try{\r\n Integer.parseInt(input);\r\n } catch (NumberFormatException e){\r\n return false;\r\n } catch (NullPointerException e){\r\n return false;\r\n }\r\n return true;\r\n }", "public static boolean isInteger(String input) {\n try {\n Integer.parseInt(input);\n return true;\n } catch (Exception e) {\n return false;\n }\n\n }", "public static boolean isInt(String strNum) {\n try {\n int d = Integer.parseInt(strNum);\n } catch (NumberFormatException | NullPointerException nfe) {\n System.out.println(\"Invalid data format\");\n log.error(nfe);\n return false;\n }\n return true;\n }", "public static boolean isInteger(String s) {\n return isInteger(s,10);\n }", "public static boolean isIntValid (String str) {\r\n try {Integer.parseInt(str);} catch (NumberFormatException e) {return false;}\r\n return true;\r\n }", "private boolean isInt(String num) {\n boolean isInt;\n try {\n Integer.parseInt(num);\n isInt = true;\n } catch (Exception e) {\n isInt = false;\n }\n return isInt;\n }", "public static boolean isInteger(String str) {\n if (str == null || str.isEmpty() || str.equals(\"-\"))\n return false;\n\n int startIndex = str.startsWith(\"-\") ? 1 : 0;\n for (int i = startIndex; i < str.length(); i++)\n if (Character.digit(str.charAt(i), 10) < 0)\n return false;\n return true;\n }", "public static boolean isInt(String str) {\n\t\ttry {\n\t\t\tint f = Integer.parseInt(str);\n\t\t} catch (Exception e) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "private boolean isInt (String s) {\n\t\ttry {\n\t\t\tif(Integer.parseInt(s) < 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tcatch(NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t\tcatch(NullPointerException e) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "private static boolean isPositiveInteger(String s){\n\t\ttry{\n\t\t\t//If the token is an integer less than 0 return false\n\t\t\tif(Integer.parseInt(s) < 0){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t//If an exception occurs return false\n\t\tcatch(NumberFormatException e){\n\t\t\treturn false;\n\t\t}\n\t\t//otherwise return true\n\t\treturn true;\n\t}", "public static boolean isInt(String str)\r\n\t{\r\n\t\tif (str == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tint length = str.length();\r\n\t\tif (length == 0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tint i = 0;\r\n\t\tif (str.charAt(0) == '-') {\r\n\t\t\tif (length == 1) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\ti = 1;\r\n\t\t}\r\n\t\tfor (; i < length; i++) {\r\n\t\t\tchar c = str.charAt(i);\r\n\t\t\tif (c < '0' || c > '9') {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private boolean isInteger(String userInput){\n if (userInput.matches(\"[0-9]+\")) {\n return true;\n }\n return false;\n }", "private boolean isInteger(String str)\r\n {\r\n try\r\n {\r\n int i = Integer.parseInt(str);\r\n } catch (NumberFormatException nfe)\r\n {\r\n MyLogger.log(Level.INFO, LOG_CLASS_NAME + \"Non numeric value. Value was: {0}\", str);\r\n return false;\r\n }\r\n return true;\r\n }", "public static boolean isInteger(String str) {\n if (str == null || str.isEmpty()) {\n return false;\n }\n int length = str.length();\n if (length == 0) {\n return false;\n }\n int i = 0;\n if (str.charAt(0) == '-') {\n if (length == 1) {\n return false;\n }\n i = 1;\n }\n for (; i < length; i++) {\n char c = str.charAt(i);\n if (c <= '/' || c >= ':') {\n return false;\n }\n }\n return true;\n }", "public boolean isParsable(String input){\n boolean parsable = true;\n try{\n Integer.parseInt(input);\n }catch(NumberFormatException e){\n parsable = false;\n }\n return parsable;\n}", "private boolean isInteger(String element) {\r\n try {\r\n Integer.valueOf(element);\r\n } catch (NumberFormatException e) {\r\n return false;\r\n }\r\n return true;\r\n }", "public static boolean isInt(String s){\n boolean flag = true;\n flag = ((s.charAt(0) >= '0' && s.charAt(0) <= '9') || s.charAt(0) == '-' || s.charAt(0) == '+' );\n int i = 1;\n while(flag && i < s.length()){\n flag = (s.charAt(i) >= '0' && s.charAt(i) <= '9' );\n i++;\n }\n return flag;\n }", "public static boolean isInt(String val) {\n\t\ttry {\n\t\t\tInteger.parseInt(val);\n\t\t\treturn true;\n\t\t} catch (Exception e) { return false; }\n\t}", "private static boolean isParsable(String input) {\n try {\n Integer.parseInt(input);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n }", "public static boolean isInt(String val){\n\t try\n\t {\n\t Integer.parseInt(val);\n\t return true;\n\t } catch (NumberFormatException ex)\n\t {\n\t \tSystem.out.println(\"Please enter integer\");\n\t return false;\n\t }\n\t \n\t}", "private static boolean stringTest(String s){\n try{ //depending on whether this is successful or not will return the relevant value\n Integer.parseInt(s);\n return true;\n } catch (NumberFormatException ex){\n return false;\n }\n }", "public boolean isNumber(String sIn)\r\n {\r\n int parseNumber = -1;\r\n \r\n try{\r\n parseNumber = Integer.parseInt(sIn);\r\n }catch(Exception e){\r\n return false;\r\n }\r\n \r\n return true;\r\n }", "public static boolean IsInteger(String par_Number) {\n\n java.util.regex.Pattern p = java.util.regex.Pattern.compile(\"^[\\\\d|\\\\-]\\\\d*$\");\n java.util.regex.Matcher m = p.matcher(par_Number);\n\n return m.matches();\n\n }", "private boolean checkInteger(String str) {\n try {\n return Integer.parseInt(str) <= 30; // Check if the entered value is an Integer and <= 30;\n } catch (NumberFormatException e) {\n return false;\n }\n }", "public static boolean isValidInt(String s)\n {\n for (int i = 0; i < s.length(); i++)\n {\n if (!Character.isDigit(s.charAt(i)))\n {\n return false;\n }\n }\n return true;\n }", "public boolean checkInput(String str)\n {\n try\n {\n Integer.parseInt(str);\n } \n catch(NumberFormatException ex)\n {\n return false;\n } \n return true;\n }", "public boolean checkInt( String s ) {\n \tchar[] c = s.toCharArray();\n \tboolean d = true;\n\n \tfor ( int i = 0; i < c.length; i++ )\n \t // verifica se o char não é um dígito\n \t if ( !Character.isDigit( c[ i ] ) ) {\n \t d = false;\n \t break;\n \t }\n \treturn d;\n \t}", "public boolean isNumber(String in) \n\t{\n\t\ttry \n\t\t{\n\t\t\tInteger.parseInt(in);\n\t\t\treturn true;\n\t\t}\n\t\tcatch (Exception e) \n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public static boolean tryParse(String str) { \n try { \n Integer.parseInt(str); \n return true;\n } catch (NumberFormatException ex) {\n return false; \n } catch (Exception ex) {\n\t logError(ex);\n\t return false;\n }\n }", "public static boolean isNumber(String text)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tInteger.parseInt(text);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tcatch(NumberFormatException e)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public static boolean IS_INTEGER(String t) {\n\n return (t.equals(Feature.INTEGER));\n }", "public static boolean isNumber(String text) {\r\n\t\ttry {\r\n\t\t\tInteger.parseInt(text);\r\n\t\t} catch(NumberFormatException e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public static boolean isInt(String check) {\n\t\treturn check.matches(\"\\\\d+\");\n\t}", "private boolean checkInt(String str) {\n\t\ttry {\n\t\t\tint integer = Integer.parseInt(str);\n\t\t\tif(integer>=0&&integer<100000){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch(Exception e) {\n\t\t\treturn false;\n\t\t}\n\t}", "public static boolean isInt(String pram)\r\n {\r\n try{\r\n Integer.parseInt(pram);\r\n return true;\r\n }catch(NumberFormatException e){\r\n return false;\r\n }\r\n }", "public static boolean isINT(final String token) {\n\t\t// Check for empty or 1-size strings.\n\t\tif (token.length() < 2)\n\t\t\treturn false;\n\n\t\t// verify all chars are 0-9.\n\t\tfor (int i = 0; i < token.length(); i++) {\n\t\t\tif (!digits.contains(Character.toString(token.charAt(i)))) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Passes all tests!\n\t\treturn true;\n\t}", "public static boolean isParsable(String input) {\r\n\t\tboolean parsable = true;\r\n\t\ttry {\r\n\t\t\tInteger.parseInt(input);\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t\tparsable = false;\r\n\t\t}\r\n\t\treturn parsable;\r\n\t}", "public boolean isInteger();", "public boolean isInteger() {\n try {\n Integer.parseInt(txt.getText());\n return true;\n } catch (Exception e) {\n return error(\"El valor debe ser un numero entero!\");\n }\n }", "public boolean isNumeric(String str){\n try {\n int i = Integer.parseInt(str);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "public Integer tryIntParsing(String s) {\n try {\n int parsedInt = Integer.parseInt(s);\n return parsedInt;\n } catch (NumberFormatException e) {\n return 0;\n }\n }", "public static int parseInt(String value)\n\t{\n\t\treturn value.matches(\"-?\\\\d+\") ? Integer.parseInt(value) : 0;\n\t}", "public static Integer stringToInteger(String s) {\n\t Integer ret = null;\n\t if (!Controleur.isVide(s))\n\t try {\n ret = Integer.valueOf(s);\n } catch (NumberFormatException e) {\n }\n\t\treturn ret;\n\t}", "static boolean isInteger(char c) {\n\t\t\tswitch (c) {\n\t\t\t\tcase DECIMAL_INTEGER:\n\t\t\t\tcase OCTAL_INTEGER:\n\t\t\t\tcase HEXADECIMAL_INTEGER:\n\t\t\t\tcase HEXADECIMAL_INTEGER_UPPER:\n\t\t\t\t\treturn true;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public static boolean isNumeric(String string) { \r\n\t\ttry { \r\n\t\t\tint testNumber = Integer.parseInt(string); \r\n\t\t} catch(NumberFormatException e) { \r\n\t\t\treturn false; \r\n\t\t} \r\n\t\t\r\n\t\treturn true; \r\n\t}", "public static boolean isNumber(String str){\n try {\n Integer.parseInt(str);\n } catch(NumberFormatException e) {\n return false;\n } catch(NullPointerException e) {\n return false;\n }\n return true;\n }", "static Value<Integer> parseInteger(String value) {\n try {\n if (value == null || value.isEmpty()) return empty();\n return of(Integer.parseInt(value));\n } catch (NumberFormatException error) {\n return empty();\n }\n }", "static Integer parseInteger(String s) {\n try {\n return Integer.parseInt(s);\n } catch (NumberFormatException e) {\n return null;\n }\n }", "public static boolean isNumeric(String str) {\n try {\n Integer d = Integer.parseInt(str);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "private static Integer parseIntString( String valueString ) {\n return Integer.parseInt( valueString.replaceAll( \"[^0-9]\", \"\" ) );\n }", "public static boolean isNumber(String string) {\n\n\t\ttry {\n\t\t\tLong.parseLong(string);\n\t\t\treturn true;\n\t\t} catch (Exception e) {\n\t\t\treturn false;\n\t\t}\n\n\t}", "private boolean isInteger(String value){\n try{\n Integer.parseInt(value);\n }catch(NumberFormatException exc)\n {\n // Show the error message.\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Не верно указано затраченное время!\");\n alert.setHeaderText(null);\n alert.setContentText(\"Введите целое число затраченного времени!\\nЗатраченное время не может превышать 2147483647 (245000 лет)!\");\n alert.showAndWait();\n return false;\n }\n return true;\n }", "public static boolean isInt(char c) {\n\t\tif(c >= '0' && c <= '9') return true;\n\t\treturn false;\n\t}", "boolean isInt(TextField input);", "private static int tryParse(String number) {\r\n\t\ttry {\r\n\t\t\treturn Integer.parseInt(number);\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t\tthrow new java.lang.Error(\"Could not convert input to integer.\");\r\n\t\t}\r\n\t}", "boolean isNumericPubmed(String id){\n\t\t \n\t\t try{\n\t\t\t Integer.parseInt(id);\n\t\t }catch (Exception e){\n\t\t\t return false;\n\t\t }\n\t\t return true;\n\t }", "private static int parseInt(String s) {\n int value;\n try {\n value = Integer.parseInt(s);\n } catch (NumberFormatException e) {\n value = 0;\n }\n return value;\n }", "public boolean isNumber(String s)\r\n {\r\n if (s == null)\r\n {\r\n return false;\r\n }\r\n s = s.trim();\r\n ValidNumberStateMachine vnsm = new ValidNumberStateMachine(s);\r\n return vnsm.isValid();\r\n }", "public static Option<Integer> parseInt(final String str) {\n\t\ttry {\n\t\t\treturn Option.some(Integer.parseInt(str));\n\t\t} catch (final NumberFormatException e) {\n\t\t\treturn Option.none();\n\t\t}\n\t}", "public int parseNumber(String str) {\r\n \r\n try {\r\n int i = Integer.parseInt(str);\r\n return i;\r\n } catch (Exception e) {\r\n \r\n }\r\n \r\n return 0;\r\n }", "public static int getIntegerValue(String value)\n\t{\n\t\treturn Integer.parseInt(value);\n\t}", "public static int parseInt(String s){\r\n\t\tint a =0;\r\n\t\ttry {\r\n\t\t a = Integer.parseInt(s);\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t System.out.println(\"To use this function you have to enter string that is a number, otherwise it will return 0.\");\r\n\t\t}\r\n\t\treturn a;\r\n\t}", "@Override\n public Integer fromString(String value) {\n if (value == null) {\n return null;\n }\n\n // Take off the spaces\n value = value.trim();\n\n // If it's 0 (Was full of spaces) return 0\n if (value.length() < 1) {\n return null;\n }\n int valueConverted = 0;\n try {\n valueConverted = Integer.valueOf(value);\n } catch (NumberFormatException e) {\n System.err.println(\"[ERROR-INFO (IntegerString Converter)] - \" + e);\n }\n return valueConverted;\n }", "public static int validInt(String message){\n boolean success = false;\n int value = -1;\n do {\n try {\n value = (int)readNumber(message, \"int\");\n success = true;\n } catch (InputMismatchException e){\n System.out.println(\"Debe introducir un valor numérico... \");\n }\n } while(!success);\n return value;\n }", "public static boolean isNumber(String s, int radix) {\n try {\n new BigDecimal(new BigInteger(s, radix));\n\n return true;\n } catch (Exception e) {\n }\n\n return false;\n }", "public static Integer tryParseToInt(String str) {\n\t\ttry {\n\t\treturn Integer.parseInt(str);\t\n\t\t}\t\n\t\tcatch(NumberFormatException e) {\n\t\t\treturn null;\n\t\t}\n\t\t}", "private static boolean isNumeric(String cadena)\n\t {\n\t\t try \n\t\t {\n\t\t\t Integer.parseInt(cadena);\n\t\t\t return true;\n\t\t } catch (NumberFormatException nfe)\n\t\t {\n\t\t\t return false;\n\t\t }\n\t }", "private static int i(String s) {\n return Integer.parseInt(s);\n }", "public static Integer getIntegerFromString(String value) {\n\n if (value == null) {\n return null;\n }\n\n Integer intVal = null;\n\n try {\n intVal = Integer.parseInt(value);\n } catch (RuntimeException exc) {\n // could not parse into int, null will be returned\n }\n return intVal;\n }", "private static boolean isValidDigit(String strInput) {\n boolean isValid = true;\n if (isPrimitive(strInput)) {\n int input = Integer.parseInt(strInput);\n if (input < 1 || input > 255) {\n log.debug(\"Wrong config input value: {}\", strInput);\n isValid = false;\n } else {\n isValid = true;\n }\n\n } else {\n isValid = false;\n }\n\n return isValid;\n }", "public static Integer parseInt(String s){\n\t\ttry{\n\t\t\treturn Integer.parseInt(s);\n\t\t}catch(NumberFormatException e){\n\t\t\treturn null;\n\t\t}\n\t}", "public static int parseInt(String s){\r\n int v=-1;\r\n try{\r\n v = Integer.parseInt(s);\r\n }catch(NumberFormatException e){\r\n \r\n }\r\n return v;\r\n }", "public GdbIntValue parseInteger() throws GdbParseError {\n\t\ttry {\n\t\t\tString match = match(INT_HEX, true, \"hex\");\n\t\t\treturn GdbIntValue.valueOf(new BigInteger(match, 16));\n\t\t}\n\t\tcatch (GdbParseError e) {\n\t\t\t// Just try next match\n\t\t}\n\t\ttry {\n\t\t\tString match = match(INT_OCT, true, \"oct\");\n\t\t\treturn GdbIntValue.valueOf(new BigInteger(match, 8));\n\t\t}\n\t\tcatch (GdbParseError e) {\n\t\t\t// Just try next match\n\t\t}\n\t\ttry {\n\t\t\tString match = match(INT_DEC, true, \"dec\");\n\t\t\treturn GdbIntValue.valueOf(new BigInteger(match, 10));\n\t\t}\n\t\tcatch (GdbParseError e) {\n\t\t\t// Fall through to error report\n\t\t}\n\n\t\tthrow new GdbParseError(\"0x[hex], 0[oct], or [dec]\", buf);\n\t}", "public static boolean isNumeric(String strNum) {\n if (strNum == null) {\n return false;\n }\n try {\n Integer d = Integer.parseInt(strNum);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }" ]
[ "0.8072236", "0.805301", "0.8044199", "0.8023588", "0.7995572", "0.79865175", "0.7979776", "0.79611087", "0.7960647", "0.7956789", "0.79522365", "0.7940468", "0.7899568", "0.78832614", "0.7873818", "0.7859028", "0.78371793", "0.7829081", "0.77837056", "0.778021", "0.7775542", "0.7774739", "0.7756696", "0.7709272", "0.76978827", "0.76961386", "0.7687397", "0.7677829", "0.76767206", "0.766212", "0.76573426", "0.76411986", "0.7623074", "0.76178455", "0.7592763", "0.75789106", "0.7511965", "0.7490025", "0.7451581", "0.74389523", "0.7425109", "0.73974943", "0.73563296", "0.7352963", "0.7333298", "0.7327618", "0.7318002", "0.7259824", "0.7222639", "0.718029", "0.7175404", "0.7174336", "0.71618146", "0.71444255", "0.711545", "0.7055069", "0.70213324", "0.7007471", "0.70051867", "0.69904214", "0.69569206", "0.69310635", "0.69299656", "0.6913654", "0.6908514", "0.6867286", "0.6830837", "0.6774186", "0.67524207", "0.6742495", "0.6739157", "0.6736737", "0.6699313", "0.6695991", "0.6657672", "0.6651996", "0.6620347", "0.6615522", "0.6601466", "0.65777487", "0.6488585", "0.6474422", "0.64703983", "0.6464928", "0.64625454", "0.64624363", "0.64620256", "0.64396715", "0.64330006", "0.642124", "0.6408289", "0.63997865", "0.6394173", "0.6392201", "0.638448", "0.63807124", "0.6359677", "0.63550454", "0.6353773", "0.634324" ]
0.7723095
23
Returns true/false if all the fields in the address are empty or null
public static Boolean isBlank(PersonAddress address) { return StringUtils.isBlank(address.getAddress1()) && StringUtils.isBlank(address.getAddress2()) && StringUtils.isBlank(address.getCityVillage()) && StringUtils.isBlank(address.getStateProvince()) && StringUtils.isBlank(address.getCountry()) && StringUtils.isBlank(address.getCountyDistrict()) && StringUtils.isBlank(address.getNeighborhoodCell()) && StringUtils.isBlank(address.getPostalCode()) && StringUtils.isBlank(address.getTownshipDivision()) && StringUtils.isBlank(address.getLatitude()) && StringUtils.isBlank(address.getLongitude()) && StringUtils.isBlank(address.getRegion()) && StringUtils.isBlank(address.getSubregion()) && StringUtils.isBlank(address.getPostalCode()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean haveEmptyField() {\n return getTextID(FIRST_NAME).isEmpty() ||\n getTextID(LAST_NAME).isEmpty() ||\n getTextID(ADDRESS).isEmpty();\n }", "public boolean hasAddress() {\n return addressBuilder_ != null || address_ != null;\n }", "public boolean externalFilled() {\n return firstName != null && !firstName.isEmpty()\n || lastName != null && !lastName.isEmpty()\n || email != null && !email.isEmpty();\n }", "@java.lang.Override\n public boolean hasAddress() {\n return address_ != null;\n }", "public boolean isSetAddress() {\n\t\treturn this.address != null;\n\t}", "boolean hasHasAddress();", "private boolean validateAddress() {\n if (address==null) {\n tvAddress.setText(String.format(\"%s*\", getString(R.string.address_activity)));\n showToast(getString(R.string.error_address_required));\n return false;\n }\n return true;\n }", "public boolean isSetFromAddress()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(FROMADDRESS$6) != 0;\n }\n }", "boolean hasAddress();", "boolean hasAddress();", "private boolean checkEmpty(String name, String addr, String phno, String pass, String email) {\n\n if(name.isEmpty() || addr.isEmpty() || pass.isEmpty() || phno.isEmpty() || email.isEmpty())\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "boolean hasAddressList();", "public boolean isSetAddress()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(ADDRESS$2) != null;\n }\n }", "private boolean isAnyEmpty(){\n //get everything\n return (fname.getText().toString().trim().length() == 0)\n || (lname.getText().toString().trim().length() == 0)\n || (email.getText().toString().trim().length() == 0)\n || (password.getText().toString().trim().length() == 0);\n }", "private static boolean validateAddress(String address) {\n return !address.isEmpty();\n }", "public boolean isEmpty()\n {\n return !(((this.gatewayIPAddress != null && this.gatewayPort != null)\n || (this.serialParameters != null)) && (this.address >= 0)\n && (this.slaveId > 0) && (this.xlator != null));\n }", "private boolean noFieldsEmpty() {\n if ( nameField.getText().isEmpty()\n || addressField.getText().isEmpty()\n || cityField.getText().isEmpty()\n || countryComboBox.getSelectionModel().getSelectedItem() == null\n || divisionComboBox.getSelectionModel().getSelectedItem() == null\n || postalField.getText().isEmpty()\n || phoneField.getText().isEmpty() ) {\n errorLabel.setText(rb.getString(\"fieldBlank\"));\n return false;\n }\n return true;\n }", "private boolean isFormEmpty(){\n if(pickupLocationInput.getText().toString().length() != 0){\n return false;\n }\n\n if(destinationInput.getText().toString().length() != 0){\n return false;\n }\n\n if(notesInput.getText().toString().length() != 0){\n return false;\n }\n\n return true;\n }", "public boolean hasAddress() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public boolean hasAddress() {\n return ((bitField0_ & 0x00000008) == 0x00000008);\n }", "public boolean checkAllNull() {\n return (locationFilterCriteria == null || locationFilterCriteria.checkAllNull()) &&\n minPricePerM2 == null && maxPricePerM2 == null &&\n sizeInM2LowerBound == null &&\n sizeInM2UpperBound == null && roofed == null &&\n leasingTimeFrom == null && leasingTimeTo == null &&\n keywords == null && electricity == null && water == null &&\n high == null && glassHouse == null;\n }", "private boolean formComplete(){\r\n return NAME_FIELD.getLength()>0 && ADDRESS_1_FIELD.getLength()>0 &&\r\n CITY_FIELD.getLength()>0 && ZIP_FIELD.getLength()>0 && \r\n COUNTRY_FIELD.getLength()>0 && PHONE_FIELD.getLength()>0; \r\n }", "boolean hasQueryAddress();", "public boolean isEmpty()\n {\n return ( name == null ) && ( data == null ) && ( notes == null );\n }", "private boolean fieldsFilled(){\n return !editTextEmail.getText().toString().isEmpty() &&\n !editTextPassword.getText().toString().isEmpty();\n }", "private boolean emptyBoxes() {\n return (FirstName.getText().toString().isEmpty() || LastName.getText().toString().isEmpty() ||\n ID.getText().toString().isEmpty() || PhoneNumber.getText().toString().isEmpty() ||\n EmailAddress.getText().toString().isEmpty() || CreditCard.getText().toString().isEmpty() ||\n Password.getText().toString().isEmpty());\n }", "protected boolean areStrFieldsBlank(String password, String firstname,\n String midname, String lastname, String email,\n String profile, String educ, String expertise,\n String location) {\n if (password.isEmpty() || firstname.isEmpty() || midname.isEmpty()\n || lastname.isEmpty() || email.isEmpty() || profile.isEmpty() ||\n educ.isEmpty() || expertise.isEmpty() || location.isEmpty()) {\n Toast.makeText(FreelanceEditProfileActivity.this,\n \"ERROR: You may not leave any of the fields empty.\",\n Toast.LENGTH_SHORT).show();\n return true;\n }\n else\n return false;\n }", "public boolean fieldsAreFilled(){\r\n boolean filled = true;\r\n if(txtFName.getText().trim().isEmpty() | txtFEmail.getText().trim().isEmpty() | txtFPhone.getText().trim().isEmpty()){\r\n filled = false;\r\n }\r\n return filled;\r\n }", "public boolean isEmpty() {\n\t\treturn memberNo == 0 && (name == null || name.isEmpty()) && minTotalPrice == 0 && maxTotalPrice == 0\n\t\t && getBeginOrderDate() == null && getEndOrderDate() == null;\n\t}", "protected boolean isAllRequiredTxtFieldsFilled() {\r\n JTextField[] txtFields = {\r\n txtFieldFirstName, txtFieldLastName,\r\n txtFieldDateOfBirth, txtFieldIBAN,\r\n txtFieldState, txtFieldHouseNumber,\r\n txtFieldPostcode, txtFieldLocation,\r\n txtFieldCountry, txtFieldState\r\n };\r\n\r\n for (JTextField txtField : txtFields) {\r\n if (txtField.getText().equals(\"\")) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "public boolean isUndefined(Address start, Address end);", "private boolean isValidLocationFound() {\n return latitudeValue != null && longitudeValue != null;\n }", "private boolean isEmptyField (EditText editText){\n boolean result = editText.getText().toString().length() <= 0;\n if (result)\n Toast.makeText(UserSignUp.this, \"Fill all fields!\", Toast.LENGTH_SHORT).show();\n return result;\n }", "public boolean streetIsValid() {\n return street.length() > 0 && street.length() < MAX_STREET_LENGTH && street.indexOf(',') == -1;\n }", "private boolean isBuildingNumberNull() {\n return (buildingNumber == null || buildingNumber.isEmpty());\n }", "public boolean hasEmailAddresses()\n {\n return !StringTools.isBlank(this.emailAddresses);\n }", "private boolean checkAddrInputFields(){\n \tboolean same = textFieldCurrents.get(jTextFieldStart).equals(jTextFieldStart.getText()) &&\n\t\t\t\ttextFieldCurrents.get(jTextFieldEnd).equals(jTextFieldEnd.getText()) &&\n\t\t\t\tjComboBoxFormat.getSelectedIndex() == selectedFormat &&\n\t\t\t\tjCheckBoxQuickSearch.isSelected() == quickSearch;\n \t\n \tif(DEBUG){\n \t\toutputResults(\"lasts:\");\n \t\toutputResults(textFieldCurrents.get(jTextFieldStart));\n\t\t\toutputResults(textFieldCurrents.get(jTextFieldEnd));\n\t\t\toutputResults(\"\"+jComboBoxFormat.getSelectedIndex()); \n\t\t\toutputResults(\"nows:\");\n\t\t\toutputResults(jTextFieldEnd.getText());\n\t\t\toutputResults(jTextFieldStart.getText());\n\t\t\toutputResults(\"\"+selectedFormat);\n \t}\n \t\n \tif(!same){\n \t\tjButtonGetDirections.setText(\"Find Directions!\");\n \t}else{\n \t\tjButtonGetDirections.setText(\"Refresh Map\");\n \t}\n \treturn same;\n }", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn bnetMap.size() == 0;\n\t}", "private boolean isAddressValid(String s) {\n for (Property prt : propertyList) { //(String t : propertyAddrLine1s)\n if (prt.getAddrline1().matches(s)) {\n createdProperty = prt;\n return true;\n }\n }\n return false;\n }", "public boolean isNullRecord () {\n if ((latitude == FLOATNULL) &&\n (longitude == FLOATNULL) &&\n (depth == FLOATNULL) &&\n (temperatureMin == FLOATNULL) &&\n (temperatureMax == FLOATNULL) &&\n (salinityMin == FLOATNULL) &&\n (salinityMax == FLOATNULL) &&\n (oxygenMin == FLOATNULL) &&\n (oxygenMax == FLOATNULL) &&\n (nitrateMin == FLOATNULL) &&\n (nitrateMax == FLOATNULL) &&\n (phosphateMin == FLOATNULL) &&\n (phosphateMax == FLOATNULL) &&\n (silicateMin == FLOATNULL) &&\n (silicateMax == FLOATNULL) &&\n (chlorophyllMin == FLOATNULL) &&\n (chlorophyllMax == FLOATNULL)) {\n return true;\n } else {\n return false;\n } // if ...\n }", "public boolean verify(){\n return from != null && to != null && !to.isEmpty();\n }", "private Boolean isFieldEmpty(EditText field) {\n return field.getText().toString().trim().equals(\"\");\n }", "@XmlTransient\n\tpublic boolean isCandidateContactsEmpty() {\n\t\treturn (candidateContacts.isEmpty());\n\t}", "private boolean isFull() {\n for (int i = 0; i < 6; i++)\n for (int j = 0; j < 7; j++)\n if (cell[i][j] == ' ')\n return false; // At least one cell is not filled\n\n // All cells are filled\n return true;\n }", "private boolean checkfields() {\n try {\n Integer.parseInt(checknum.getText().toString());\n Integer.parseInt(banknum.getText().toString());\n Integer.parseInt(branchnum.getText().toString());\n Integer.parseInt(accountnum.getText().toString()); //was commented\n\n } catch (NumberFormatException e) { // at least one of these numbers is not Integer\n return false;\n }\n\n if (checknum.getText().toString().equals(null) || banknum.getText().toString().equals(null) ||branchnum.getText().toString().equals(null)|| accountnum.getText().toString().equals(null))\n return false; // At least one of the fields is empty\n\n return true;\n }", "private final static boolean isEmpty(String field) {\n return field == null || field.trim().length() == 0;\n }", "private boolean checkForEmptyString(Object value)\n\t{\n\t\tif (value == null || value.toString().isEmpty()) \n\t\t\treturn true;\n\t\treturn false;\n\t}", "boolean hasBitcoinAddress();", "private boolean isNotEmptyAndNotNull(final Node node)\r\n {\r\n if (\"null\".equals(node.getNodeValue()))\r\n {\r\n return false;\r\n }\r\n if (node.getNodeValue().trim().isEmpty())\r\n {\r\n return false;\r\n }\r\n return true;\r\n }", "public boolean isEmpty(Person person) {\n\t\tif(person.getName().equals(\"\")){\n\t\t\treturn true;\n\t\t}\n\t\tif(person.getSirName().equals(\"\")){\n\t\t\treturn true;\n\t\t}\n\t\tif(person.getCnp().equals(\"\")){\n\t\t\treturn true;\n\t\t}\n\t\tif(person.getCategory().equals(\"\")){\n\t\t\treturn true;\n\t\t}\n\t\tif(person.getPhoneNumber().equals(\"\")){\n\t\t\treturn true;\n\t\t}\n\t\tif(person.getEmail().equals(\"\")){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private void checkForEmptyFields() throws EmptyTextFieldException {\n\n if (date == null || title.equals(\"\") || function.equals(\"\") || protagonist.equals(\"\")\n || source.equals(\"\") || references.equals(\"\") || description.equals(\"\")) {\n throw new EmptyTextFieldException();\n }\n }", "@Override\n\tpublic boolean isEmpty() throws RemoteException {\n\t\treturn bnetMap.size() == 0;\n\t}", "public boolean isSetContractAddress() {\n return this.contractAddress != null;\n }", "public boolean isEmpty() {\n return (first == null || last == null);\n }", "public boolean hasADDRESSIND() {\n return fieldSetFlags()[8];\n }", "void isArrayEmpty(ArrayList<UserContactInfo> contactDeatailsList);", "public boolean hasQueryAddress() {\n return ((bitField0_ & 0x00000008) == 0x00000008);\n }", "public boolean hasQueryAddress() {\n return ((bitField0_ & 0x00000008) == 0x00000008);\n }", "public boolean validatePersonalData() {\n\t\tif (firstName == null)\n\t\t\treturn false;\n\t\tif (lastName == null)\n\t\t\treturn false;\n\t\tif (phoneNum == null)\n\t\t\treturn false;\n\t\tif (email == null)\n\t\t\treturn false;\n\n\t\treturn true;\n\t}", "private boolean fieldsAreFilled(){\n return !textboxName.isEnabled() && !textboxInitialValue.isEnabled();\n }", "public boolean isEmpty() {\n\t\tString v = getValue();\n\t\treturn v == null || v.isEmpty();\n\t}", "private boolean isParamsEmpty(String... params){\n for (String param : params) {\n if (param.isEmpty())\n return true;\n }\n return false;\n }", "@Override\n\tpublic boolean IsDeliveryaddressValid(String name, String street, String city, String province, String postalcode) {\n\t\t\n\t\tData data = new Data();\n\t\tList<Deliveryaddress> deliveryaddress = data.getDeliveryaddressData();\n\t\t\n\t\tfor(Deliveryaddress d: deliveryaddress) {\n\t\t\tif(name.equals(d.name) && street.equals(d.street) && city.equals(d.city) && province.equals(d.province) && postalcode.equals(d.postalcode)) {\n\t\t\t\treturn true;\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t\treturn false;\n\t}", "private void checkFieldsForEmptyValues() {\n String s1 = edtEmail.getText().toString();\n String s2 = edtDisplayName.getText().toString();\n String s3 = edtPaswd.getText().toString();\n\n if (s1.equals(\"\") || s2.equals(\"\") || s3.equals(\"\")) { //disables the button\n btnRegister.setEnabled(false);\n } else { //enables the button\n btnRegister.setEnabled(true);\n }\n }", "private boolean hayCamposVacios() {\r\n\t\tif(nomTextField.getText().isEmpty()\r\n\t\t\t|| claveTextField.getText().isEmpty()\r\n\t\t\t\t|| reingresoTextField.getText().isEmpty()\r\n\t\t\t\t\t|| preguntaTextField.getText().isEmpty()\r\n\t\t\t\t\t\t|| respuestaTextField.getText().isEmpty())\r\n\t\t\treturn true;\t\t\r\n\t\treturn false;\r\n\t}", "private boolean isValid(){\n if(txtFirstname.getText().trim().isEmpty() || txtLastname.getText().trim().isEmpty() ||\n txtEmailAddress.getText().trim().isEmpty() || dobPicker.getValue()==null\n || txtPNum.getText().trim().isEmpty()\n || txtDefUsername.getText().trim().isEmpty()\n || curPassword.getText().trim().isEmpty()){\n \n return false; // return false if one/more fields are not filled\n }else{\n if(!newPassword.getText().trim().isEmpty()){\n if(!confirmPassword.getText().trim().isEmpty()){\n return true;\n }else{\n return false;\n }\n }\n return true; // return true if all fields are filled\n }\n }", "public static boolean isEmpty(Object field) {\r\n\t\treturn (field == null) || field.toString().trim().isEmpty();\r\n\t}", "public boolean isFilled() {\n return(!this.getText().trim().equals(\"\"));\n }", "@Override\n public boolean isLocationEmpty(XYCoord coords)\n {\n return isLocationEmpty(null, coords.xCoord, coords.yCoord);\n }", "public boolean is_Empty(){\n \treturn this.ship==null;\n }", "private boolean hasValue (String s) { return s != null && s.length() != 0; }", "public boolean isEmpty() {\n\t\treturn person.isEmpty();\n\t}", "private boolean checkFields() {\n boolean test = true;\n if (fname.isEmpty()) {\n test = false;\n }\n if (lname.isEmpty()) {\n test = false;\n }\n if (cin.isEmpty()) {\n test = false;\n }\n if (typeCompte.equals(\"Bancaire\")) {\n if (decouvertNF.isEmpty())\n test = false;\n } else if (typeCompte.equals(\"Epargne\")) {\n if (tauxInteretNF.isEmpty())\n test = false;\n }\n if (s_datePK.getValue() == null) {\n s_datePK.setStyle(\"-fx-border-color:red;-fx-border-radius:3px;-fx-border-size: 1px;\");\n test = false;\n }\n\n return test;\n }", "public static boolean isNull_fields_allowed() {\n return null_fields_allowed;\n }", "public boolean isEmpty() {\r\n return (Double.isNaN(x) && Double.isNaN(y));\r\n }", "public Boolean getAllowEmptyFields() {\n return (Boolean) getExtProperty(\"allowEmptyFields\", DatabaseConfig.FEATURE_ALLOW_EMPTY_FIELDS);\n }", "public boolean isValidAddress(TextInputLayout tiAddress, EditText etAddress) {\n return (validAddress(tiAddress, etAddress) != null);\n }", "public final boolean hasAllRequiredField() {\n EditText editText = (EditText) _$_findCachedViewById(C2723R.C2726id.etUserName);\n Intrinsics.checkExpressionValueIsNotNull(editText, \"etUserName\");\n CharSequence obj = editText.getText().toString();\n int length = obj.length() - 1;\n int i = 0;\n boolean z = false;\n while (i <= length) {\n boolean z2 = obj.charAt(!z ? i : length) <= ' ';\n if (!z) {\n if (!z2) {\n z = true;\n } else {\n i++;\n }\n } else if (!z2) {\n break;\n } else {\n length--;\n }\n }\n String obj2 = obj.subSequence(i, length + 1).toString();\n EditText editText2 = (EditText) _$_findCachedViewById(C2723R.C2726id.etPassword);\n Intrinsics.checkExpressionValueIsNotNull(editText2, \"etPassword\");\n CharSequence obj3 = editText2.getText().toString();\n int length2 = obj3.length() - 1;\n int i2 = 0;\n boolean z3 = false;\n while (i2 <= length2) {\n boolean z4 = obj3.charAt(!z3 ? i2 : length2) <= ' ';\n if (!z3) {\n if (!z4) {\n z3 = true;\n } else {\n i2++;\n }\n } else if (!z4) {\n break;\n } else {\n length2--;\n }\n }\n String obj4 = obj3.subSequence(i2, length2 + 1).toString();\n if (TextUtils.isEmpty(obj2) || TextUtils.isEmpty(obj4)) {\n return false;\n }\n return true;\n }", "public boolean isEmpty() {\n\t\treturn (op == null && dval == null);\n\t}", "@Override\r\n\tpublic boolean isEmpty() {\r\n\r\n\t\treturn data.isEmpty();\r\n\t}", "private static boolean validAddressREST_Postman() throws JSONException, IOException {\n\t\tOkHttpClient client = new OkHttpClient();\n\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"IL\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"AccessRequest\\\": {\\r\\n\\t\\t\\\"UserId\\\": \\\"attarsaaniya\\\",\\r\\n\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\",\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Password\\\": \\\"Summer2017\\\"\\r\\n\\t},\\r\\n\\t\\\"AddressValidationRequest\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\\"Address\\\": {\\r\\n\\t\\t\\t\\\"StateProvinceCode\\\": \" + state + \",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"PostalCode\\\": \" + zip + \",\\r\\n\\t\\t\\t\\\"City\\\": \" + city + \"\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Request\\\": {\\r\\n\\t\\t\\t\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\": \"\n\t\t\t\t+ \"\\\"mycustomer\\\"\\r\\n\\t\\t\\t},\\r\\n\\t\\t\\t\\\"RequestAction\\\": \\\"AV\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://wwwcie.ups.com/rest/AV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\t\tJSONObject jResp = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResp);\n\t\t\n\t\t// there shoudl be a better way to parse through the tree tbh\n\t\t// but this seems intuitive enough to do (though so extra) \n\t\tJSONObject addrValResp = jResp.getJSONObject(\"AddressValidationResponse\");\n\t\tJSONObject addrVal = addrValResp.getJSONObject(\"AddressValidationResult\");\n\t\tJSONObject addr = addrVal.getJSONObject(\"Address\");\n\t\tString cityResponse = addr.getString(\"City\");\n\t\tString stateResponse = addr.getString(\"StateProvinceCode\");\n\t\t\n\t\tString zipResponse = addrVal.getString(\"PostalCodeLowEnd\");\n\t\t\n\t\t\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n//\t\tString success = addrVal\n\t\t\n\t\treturn false;\n\t}", "public final boolean empty() {\n return data == null;\n }", "public boolean isEmpty()\n {return data == null;}", "public boolean isEmpty() {\n\t\t\treturn properties.isEmpty();\n\t\t}", "public boolean isBlank() {\n return (tags.length() == 0);\n }", "public boolean isEmpty()\n\t{\n\t\tverifyParseState();\n\t\treturn values.isEmpty();\n\t}", "public boolean isEmpty()\r\n\t{\r\n\t\treturn start == null; // returns to null if true.\r\n\t}", "public boolean is_empty() {\n\t\treturn false;\n\t}", "@Override\r\n\tpublic boolean isEmpty() {\n\t\treturn data != null && data.list != null && data.list.isEmpty();\r\n\t}", "public boolean isEmptyComplexValue() {\r\n if(complexValue==null){\r\n return true;\r\n }\r\n return complexValue.isEmpty();\r\n }", "public boolean isEmpty() {\r\n\r\n\t\treturn data.isEmpty();\r\n\t}", "public boolean isEmpty() {\n return this.familyMembers.isEmpty();\n }", "boolean known() {\n\t\t\treturn !varAddress && !varMask;\n\t\t}", "private boolean canFindLocationAddress(){\n\n Geocoder geo = new Geocoder(this);\n\n //Get address provided for location as Address object\n try{\n List<Address> foundAddresses = geo.getFromLocationName(location.getAddress(),1);\n //Return true if an address is found\n return (foundAddresses.size() == 1);\n }\n catch(IOException e){\n e.printStackTrace();\n return false;\n }\n\n }", "protected boolean skipBlankValues() {\n return true;\n }", "boolean isEmpty() {\n return mapped_vms.isEmpty();\n }", "public boolean isValid() {\n return _id != null && !_id.isEmpty() &&\n _name != null && !_name.isEmpty() &&\n _created != null && !_created.isEmpty();\n }", "protected boolean checkEmpty(String[] parameters) {\n return parameters == null || parameters.length == 0;\n }", "public boolean isComplete()\n {\n return (name != null) && (spacecraft != null) &&\n (sensor != null) && (description != null);\n }", "public M csmiAddressNull(){if(this.get(\"csmiAddressNot\")==null)this.put(\"csmiAddressNot\", \"\");this.put(\"csmiAddress\", null);return this;}" ]
[ "0.772036", "0.74495894", "0.73163956", "0.71123296", "0.6968735", "0.6958734", "0.6902509", "0.68945926", "0.68897974", "0.68897974", "0.6842642", "0.6828396", "0.68033653", "0.6787164", "0.6776514", "0.67338157", "0.6697312", "0.66204125", "0.65937823", "0.65674025", "0.65344065", "0.6505035", "0.65025485", "0.6484649", "0.64706695", "0.64172703", "0.639457", "0.63862294", "0.6274912", "0.6265721", "0.62050635", "0.61573535", "0.61440575", "0.61372674", "0.61321014", "0.612204", "0.61133975", "0.6057828", "0.60526794", "0.60500205", "0.6049135", "0.60302436", "0.6018741", "0.6009083", "0.6002684", "0.5989655", "0.5983177", "0.5980276", "0.5955146", "0.59456986", "0.5934732", "0.5925226", "0.5913474", "0.5906457", "0.5891857", "0.5889284", "0.5885809", "0.58813435", "0.5878465", "0.5864212", "0.5862603", "0.58609545", "0.58576715", "0.5856405", "0.5846393", "0.5830454", "0.58270735", "0.58134246", "0.58114207", "0.58060163", "0.57923055", "0.5783021", "0.5779144", "0.57784736", "0.57767385", "0.5769615", "0.5761729", "0.5739856", "0.5734127", "0.5733591", "0.5733233", "0.5731906", "0.5728184", "0.5727971", "0.5720392", "0.57008123", "0.56947416", "0.56908566", "0.5676788", "0.56758577", "0.5666988", "0.5661225", "0.56580824", "0.5652454", "0.56516355", "0.56443006", "0.56408334", "0.5639039", "0.56389064", "0.56326175" ]
0.7231255
3
Utility method to return patients matching passed criteria. Difference between this and main method is that locations are matched by patient rayon
public static Cohort getMdrPatientsTJK(String identifier, String name, /*String enrollment,*/ Location location, String oblast, List<ProgramWorkflowState> states, Integer minage, Integer maxage, String gender, Integer year, String quarter, String month) { Cohort cohort = Context.getPatientSetService().getAllPatients(); MdrtbService ms = (MdrtbService) Context.getService(MdrtbService.class); Date now = new Date(); Program mdrtbProgram = ms.getMdrtbProgram(); Map<String, Date> dateMap = ReportUtil.getPeriodDates(year, quarter, month); Date startDate = (Date)(dateMap.get("startDate")); Date endDate = (Date)(dateMap.get("endDate")); CohortDefinition drtb = Cohorts.getEnrolledInMDRProgramDuring(startDate, endDate); try { Cohort enrollmentCohort = Context.getService(CohortDefinitionService.class).evaluate(drtb, new EvaluationContext()); cohort = Cohort.intersect(cohort, enrollmentCohort); } catch (EvaluationException e) { throw new MdrtbAPIException("Unable to evalute location cohort",e); } /*if ("current".equals(enrollment)) { Cohort current = Context.getPatientSetService().getPatientsInProgram(mdrtbProgram, now, now); cohort = Cohort.intersect(cohort, current); } else { Cohort ever = Context.getPatientSetService().getPatientsInProgram(mdrtbProgram, null, null); if ("previous".equals(enrollment)) { Cohort current = Context.getPatientSetService().getPatientsInProgram(mdrtbProgram, now, now); Cohort previous = Cohort.subtract(ever, current); cohort = Cohort.intersect(cohort, previous); } else if ("never".equals(enrollment)) { cohort = Cohort.subtract(cohort, ever); } else { cohort = Cohort.intersect(cohort, ever); } }*/ if (StringUtils.isNotBlank(name) || StringUtils.isNotBlank(identifier)) { name = "".equals(name) ? null : name; identifier = "".equals(identifier) ? null : identifier; Cohort nameIdMatches = new Cohort(Context.getPatientService().getPatients(name, identifier, null, false)); cohort = Cohort.intersect(cohort, nameIdMatches); } if (states != null) { Cohort inStates = Context.getPatientSetService().getPatientsByProgramAndState(null, states, now, now); cohort = Cohort.intersect(cohort, inStates); } Oblast o = null; if(!oblast.equals("") && location == null) o = Context.getService(MdrtbService.class).getOblast(Integer.parseInt(oblast)); List<Location> locList = new ArrayList<Location>(); if(o != null && location == null) locList = Context.getService(MdrtbService.class).getLocationsFromOblastName(o); else if (location != null) locList.add(location); CohortDefinition temp = null; CohortDefinition lcd = null; for(Location loc : locList) { temp = Cohorts.getLocationFilter(loc, null,null); if(lcd == null) lcd = temp; else lcd = ReportUtil.getCompositionCohort("OR", lcd, temp); } Cohort locationCohort; try { locationCohort = Context.getService(CohortDefinitionService.class).evaluate(lcd, new EvaluationContext()); } catch (EvaluationException e) { throw new MdrtbAPIException("Unable to evalute location cohort",e); } cohort = Cohort.intersect(cohort, locationCohort); // If Location is specified, limit to patients at this Location /*if (location != null) { CohortDefinition lcd = Cohorts.getLocationFilter(location, now, now); Cohort locationCohort; try { locationCohort = Context.getService(CohortDefinitionService.class).evaluate(lcd, new EvaluationContext()); } catch (EvaluationException e) { throw new MdrtbAPIException("Unable to evalute location cohort",e); } cohort = Cohort.intersect(cohort, locationCohort); }*/ /*// If Location is specified, limit to patients at this Location if (location != null) { //System.out.println("ENTERED!!!!!!!!!"); //System.out.println("L:" + location.getCountyDistrict()); Cohort fc = new Cohort(); Set<Integer> idSet = cohort.getMemberIds(); //System.out.println("SET SIZE:" + idSet.size()); Iterator<Integer> itr = idSet.iterator(); Integer idCheck = null; Patient patient = null; PersonAddress addr = null; PatientService ps = Context.getService(PatientService.class); while(itr.hasNext()) { idCheck = (Integer)itr.next(); patient = ps.getPatient(idCheck); addr = patient.getPersonAddress(); if(addr==null) continue; //System.out.println("A:"+ addr.getCountyDistrict()); if(areRussianStringsEqual(addr.getCountyDistrict(),location.getCountyDistrict())==true) fc.addMember(idCheck); } cohort = fc; }*/ if(minage != null || maxage != null) { Cohort ageCohort = new Cohort(); AgeAtMDRRegistrationCohortDefinition ageatEnrollmentCohort = new AgeAtMDRRegistrationCohortDefinition(); ageatEnrollmentCohort.setMaxAge(maxage); ageatEnrollmentCohort.setMinAge(minage); ageatEnrollmentCohort.setStartDate(startDate); ageatEnrollmentCohort.setEndDate(endDate); ; //eval.evaluate(ageatEnrollmentCohort, context) try { ageCohort = Context.getService(CohortDefinitionService.class).evaluate(ageatEnrollmentCohort, new EvaluationContext()); } catch (EvaluationException e) { throw new MdrtbAPIException("Unable to evalute age cohort",e); } /*Patient patient = null; Set<Integer> idSet = cohort.getMemberIds(); Iterator<Integer> itr = idSet.iterator(); Integer idCheck = null; PatientService ps = Context.getService(PatientService.class); boolean use = false; while(itr.hasNext()) { use = false; idCheck = (Integer)itr.next(); patient = ps.getPatient(idCheck); MdrtbService svc = Context.getService(MdrtbService.class); MdrtbPatientProgram mpp = svc.getMostRecentMdrtbPatientProgram(patient); Date tsd = mpp.getDateEnrolled(); //mpp.getTreatmentStartDateDuringProgram(); if(minage != null && maxage !=null ) { if(patient.getAge(tsd)>= minage.intValue() && patient.getAge(tsd)<= maxage.intValue() ) { use = true; } } else if(minage!=null) { if(patient.getAge(tsd)>= minage.intValue()) { use = true; } else use = false; } else if(maxage!=null) { if(patient.getAge(tsd)<= maxage.intValue()) { use = true; } else use = false; } if(use) { ageCohort.addMember(patient.getPatientId()); } }*/ cohort = Cohort.intersect(cohort, ageCohort); } if(gender!=null && gender.length()!=0) { Cohort genderCohort = new Cohort(); Patient patient = null; Set<Integer> idSet = cohort.getMemberIds(); Iterator<Integer> itr = idSet.iterator(); Integer idCheck = null; PatientService ps = Context.getService(PatientService.class); boolean use = false; while(itr.hasNext()) { use = false; idCheck = (Integer)itr.next(); patient = ps.getPatient(idCheck); if(patient.getGender().equalsIgnoreCase(gender)) { genderCohort.addMember(patient.getPatientId()); } } cohort = Cohort.intersect(cohort, genderCohort); } return cohort; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Patient[] findID(String sv)\r\n\t{\r\n\t\tPatient[] foundPatients = new Patient[999];//Creates a blank array\r\n\t\tint count = 0;\r\n\r\n\t\tfor(int i=0; arrayPatients[i]!=null ;i++)//loops through the array\r\n\t\t{\r\n\t\t\tif(arrayPatients[i].forename.contains(sv)||arrayPatients[i].surname.contains(sv))//sees if either surname or firstname contain the search term allowing for partieal searching\r\n\t\t\t{\r\n\t\t\t\tfoundPatients[count] = arrayPatients[i];//if found it adds the patient to an array\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn foundPatients;//that array is then returned\r\n\t}", "public Collection<IPatient> searchPatients(String svn, String fname, String lname){\n _model = Model.getInstance();\n Collection<IPatient> searchresults = null;\n\n try {\n searchresults = _model.getSearchPatientController().searchPatients(svn, fname, lname);\n } catch (BadConnectionException e) {\n e.printStackTrace();\n DialogBoxController.getInstance().showExceptionDialog(e, \"BadConnectionException - Please contact support\");\n } catch (at.oculus.teamf.persistence.exception.search.InvalidSearchParameterException e) {\n e.printStackTrace();\n DialogBoxController.getInstance().showExceptionDialog(e, \"FacadeException - Please contact support\");\n } catch (CriticalDatabaseException e) {\n e.printStackTrace();\n DialogBoxController.getInstance().showExceptionDialog(e, \"CriticalDatabaseException - Please contact support\");\n } catch (CriticalClassException e) {\n e.printStackTrace();\n DialogBoxController.getInstance().showExceptionDialog(e, \"CriticalClassException - Please contact support\");\n }\n\n return searchresults;\n }", "private void searchPatient() {\r\n String lName, fName;\r\n lName = search_lNameField.getText();\r\n fName = search_fNameField.getText();\r\n // find patients with the Last & First Name entered\r\n patientsFound = MainGUI.pimsSystem.search_patient(lName, fName);\r\n\r\n // more than one patient found\r\n if (patientsFound.size() > 1) {\r\n\r\n // create String ArrayList of patients: Last, First (DOB)\r\n ArrayList<String> foundList = new ArrayList<String>();\r\n String toAdd = \"\";\r\n // use patient data to make patient options to display\r\n for (patient p : patientsFound) {\r\n toAdd = p.getL_name() + \", \" + p.getF_name() + \" (\" + p.getDob() + \")\";\r\n foundList.add(toAdd);\r\n }\r\n int length;\r\n // clear combo box (in case this is a second search)\r\n while ((length = selectPatient_choosePatientCB.getItemCount()) > 0) {\r\n selectPatient_choosePatientCB.removeItemAt(length - 1);\r\n }\r\n // add Patient Options to combo box\r\n for (int i = 0; i < foundList.size(); i++) {\r\n selectPatient_choosePatientCB.addItem(foundList.get(i));\r\n }\r\n\r\n // display whether patients found or not\r\n JOptionPane.showMessageDialog(this, \"Found More than 1 Result for Last Name, First Name: \" + lName + \", \" + fName\r\n + \".\\nPress \\\"Ok\\\" to select a patient.\",\r\n \"Search Successful\", JOptionPane.DEFAULT_OPTION);\r\n\r\n selectPatientDialog.setVisible(true);\r\n }\r\n\r\n // one patient found\r\n else if (patientsFound.size() == 1) {\r\n\r\n JOptionPane.showMessageDialog(this, \"Found one match for Last Name, First Name: \" + lName + \", \" + fName,\r\n \"Search Successful\", JOptionPane.DEFAULT_OPTION);\r\n // display patient data\r\n currentPatient = patientsFound.get(0);\r\n search_fillPatientFoundData(currentPatient);\r\n }\r\n // no patient found\r\n else {\r\n\r\n JOptionPane.showMessageDialog(this, \"No Results found for Last Name, First Name:\" + lName + \", \" + fName,\r\n \"Search Failed\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n }", "@Override\n\tpublic void searchByMobile() {\n\t\tcount = 0;\n\t\tif (UtilityClinic.patFile == null) {\n\t\t\ttry {\n\t\t\t\tutil.accessExistingPatJson();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"File not found\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tutil.readFromPatJson(UtilityClinic.patFile);\n\t\tSystem.out.println(\"Enter search.....\");\n\t\tString search = UtilityClinic.readString();\n\t\tSystem.out.println(\"Showing search result(s).......\");\n\t\tfor (int i = 0; i < UtilityClinic.patJson.size(); i++) {\n\t\t\tJSONObject jsnobj = (JSONObject) UtilityClinic.patJson.get(i);\n\t\t\tif (jsnobj.get(\"Mobile\").toString().equals(search)) {\n\t\t\t\tpMob = jsnobj.get(\"Mobile\").toString();\n\t\t\t\tpName = jsnobj.get(\"Patient's name\").toString();\n\t\t\t\tpId = jsnobj.get(\"Patient's ID\").toString();\n\t\t\t\tSystem.out.print(++count + \" Name:\" + pName + \" ID:\" + pId + \" Mobile:\" + pMob + \" Age:\"\n\t\t\t\t\t\t+ jsnobj.get(\"Age\") + \"\\n\\n\");\n\t\t\t}\n\t\t}\n\t\tif (count == 0) {\n\t\t\tSystem.out.println(\"No results found.....\");\n\t\t}\n\t\tSystem.out.println();\n\t}", "List<Patient> findPatients(Employee nurse_id);", "public List<Contact> searchContacts(Map<SearchTerm,String> criteria);", "List<TypePatientPropertyCondition> search(String query);", "@Override\n\tpublic void searchByName() {\n\t\tcount = 0;\n\t\tif (UtilityClinic.patFile == null) {\n\t\t\ttry {\n\t\t\t\tutil.accessExistingPatJson();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"File not found\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tutil.readFromPatJson(UtilityClinic.patFile);\n\t\tSystem.out.println(\"Enter search.....\");\n\t\tString search = UtilityClinic.readString();\n\t\tSystem.out.println(\"Showing search result(s).......\");\n\t\tfor (int i = 0; i < UtilityClinic.patJson.size(); i++) {\n\t\t\tJSONObject jsnobj = (JSONObject) UtilityClinic.patJson.get(i);\n\t\t\tif (jsnobj.get(\"Patient's name\").toString().equals(search))\n\t\t\t\tSystem.out.print(\n\t\t\t\t\t\t++count + \" Name:\" + jsnobj.get(\"Patient's name\") + \" ID:\" + jsnobj.get(\"Patient's ID\")\n\t\t\t\t\t\t\t\t+ \" Mobile:\" + jsnobj.get(\"Mobile\") + \" Age:\" + jsnobj.get(\"Age\"));\n\t\t}\n\t\tif (count == 0) {\n\t\t\tSystem.out.println(\"No results found.....\");\n\t\t}\n\t}", "private void getMatches(){\r\n\t\tString cLong = commandList.get(2);//holds client's longitude in string form\r\n\t\tString cLat = commandList.get(3);//holds the client's latitude in String form\r\n\r\n\t\tArrayList<String> matchList = new ArrayList<>();//holds user names of found matches\r\n\t\t\r\n\t\tString[] clientPSliders = getPSliders(commandList.get(1));\r\n\r\n\t\t//load in SQL command to find matches using given client's min and max values\r\n\t\tcommand =\"SELECT location.userName FROM (location INNER JOIN users \"\r\n\t\t\t\t+ \"ON location.userName = users.userName) INNER JOIN personalSlider \"\r\n\t\t\t\t+ \"ON users.userName = personalSlider.userName WHERE (((location.longitude) <= \";\r\n\t\tcommand += roundLongUp(cLong) + \" And (location.longitude) >= \";\r\n\t\tcommand += roundLongDown(cLong) + \") AND ((location.latitude) <= \";\r\n\t\tcommand += roundLatUp(cLat) + \" And (location.latitude) >= \";\r\n\t\tcommand += roundLatDown(cLat) + \") AND ((personalSlider.pGender) >= \";\r\n\t\tcommand += commandList.get(4) + \" And (personalSlider.pGender) <= \" + commandList.get(5);\r\n\t\tcommand += \" AND ((personalSlider.pExpression) >= \" + commandList.get(6) +\r\n\t\t\t\t\" And (personalSlider.pExpression) <= \" + commandList.get(7) + \")\";\r\n\t\tcommand += \" AND ((personalSlider.pOrientation) >= \" + commandList.get(8) +\r\n\t\t\t\t\" And (personalSlider.pOrientation) <= \" + commandList.get(9) + \")));\";\r\n\r\n\t\t\r\n\t\ttry {//try block for sending SQL command\r\n\t\t\trs = stmt.executeQuery(command);//send command\r\n\r\n\t\t\twhile(rs.next()){//while there are matches\r\n\t\t\t\tmatchList.add(rs.getString(\"userName\"));//load userName\r\n\t\t\t}\r\n\r\n\t\t\t//each String[] is a match, 0 = userName, 1 = pGenderMin, .....6=pOrientationMax, 7=distance (used later)\r\n\t\t\tArrayList<String[]> fullMatches = getSeekingSlider(matchList);\r\n\r\n\t\t\t//remove the non-overlapping matches, pass clients ratings and the list of matches\r\n\t\t\tcrossMatch(strArrToIntArr(clientPSliders), fullMatches);\r\n\t\t\t\r\n\t\t\t//remove matches over 25 miles away\r\n\t\t\tlimitDistance(Double.valueOf(cLat), Double.valueOf(cLong), fullMatches);\r\n\t\t\t\r\n\t\t\trs = null;//null the result set\r\n\t\t\t\r\n\t\t\tString[] tempStrArr;//holds the personal slider for the current match\r\n\t\t\tfor(String[] currArr: fullMatches){//for all the remaining matches\r\n\t\t\t\ttempStrArr = getPSliders(currArr[0]);//get personal slider for current matches\r\n\t\t\t\tout.println(tempStrArr[0] + \", \" + tempStrArr[1] + \", \"//loads userName, pGen, pExpr, pOrient\r\n\t\t\t\t\t\t\t+ tempStrArr[2] + \", \" + tempStrArr[3] + \", \" + currArr[7]);//line 2\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\tout.println(e.getMessage());\r\n\t\t}\r\n\t}", "public ArrayList<NameRecord> getMatches(String partialName){\n\t\tpartialName=partialName.toLowerCase();\n\t\tArrayList<NameRecord> result = new ArrayList<NameRecord>();\n\t\tfor (int i = 0;i<names.size();i++){\n\t\t\tString s = names.get(i).toLowerCase();\n\t\t\tif (s.contains(partialName)){\n\t\t\t\tresult.add(list.get(i));\n\t\t\t}\n\t\t}\t\n\t\treturn result;\n\t}", "@Override\r\n public ArrayList<Object> getRecords(String criteria) throws SQLException {\r\n\r\n ArrayList<Object> rows = new ArrayList<>();\r\n\r\n String sql = \"select * from patient\";\r\n\r\n //append any search criteria\r\n if (criteria != null) {\r\n sql += criteria;\r\n }\r\n \r\n logger.info(\"Search patient: \" + sql);\r\n \r\n try (PreparedStatement pStatement = connection.prepareStatement(sql);\r\n ResultSet resultSet = pStatement.executeQuery();) {\r\n while (resultSet.next()) {\r\n PatientBean pb = new PatientBean();\r\n pb.setPatientID(resultSet.getLong(\"PatientID\"));\r\n pb.setLastName(resultSet.getString(\"LastName\"));\r\n pb.setFirstName(resultSet.getString(\"FirstName\"));\r\n pb.setDiagnosis(resultSet.getString(\"Diagnosis\"));\r\n pb.setAdmissionDate(resultSet.getTimestamp(\"AdmissionDate\"));\r\n pb.setReleaseDate(resultSet.getTimestamp(\"ReleaseDate\"));\r\n\r\n ArrayList<Object> ib = inpatientDAOImpl.getRecords(\" where patientID = \" + pb.getPatientID());\r\n if (ib != null && ib.size() > 0) {\r\n pb.setIb(ib);\r\n }\r\n\r\n ArrayList<Object> sb = surgicalDAOImpl.getRecords(\" where patientID = \" + pb.getPatientID());\r\n if (sb != null && sb.size() > 0) {\r\n pb.setSb(sb);\r\n }\r\n\r\n ArrayList<Object> mb = medicationDAOImpl.getRecords(\" where patientID = \" + pb.getPatientID());\r\n if (mb != null && mb.size() > 0) {\r\n pb.setMb(mb);\r\n }\r\n\r\n rows.add(pb);\r\n }\r\n }\r\n\r\n logger.info(\"patient records have been saved to ArrayList, size: \" + rows.size());\r\n\r\n return rows;\r\n\r\n }", "@Override\n\tpublic void searchByID() {\n\t\tcount = 0;\n\t\tif (UtilityClinic.patFile == null) {\n\t\t\ttry {\n\t\t\t\tutil.accessExistingPatJson();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"File not found\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tutil.readFromPatJson(UtilityClinic.patFile);\n\t\tSystem.out.println(\"Enter search.....\");\n\t\tString search = UtilityClinic.readString();\n\t\tSystem.out.println(\"Showing search result(s).......\");\n\t\tfor (int i = 0; i < UtilityClinic.patJson.size(); i++) {\n\t\t\tJSONObject jsnobj = (JSONObject) UtilityClinic.patJson.get(i);\n\t\t\tif (jsnobj.get(\"Patient's ID\").toString().equals(search))\n\t\t\t\tSystem.out.print(\n\t\t\t\t\t\t++count + \" Name:\" + jsnobj.get(\"Patient's name\") + \" ID:\" + jsnobj.get(\"Patient's ID\")\n\t\t\t\t\t\t\t\t+ \" Mobile:\" + jsnobj.get(\"Mobile\") + \" Age:\" + jsnobj.get(\"Age\"));\n\t\t}\n\t\tif (count == 0) {\n\t\t\tSystem.out.println(\"No results found.....\");\n\t\t}\n\t\tSystem.out.println();\n\t}", "public String patientsOn10A(){\n String sql = \"SELECT a.patient_id \" +\n \" FROM orders a \" +\n \" JOIN drug_order b ON(a.order_id=b.order_id) \" +\n \" JOIN drug c ON(b.drug_inventory_id=c.drug_id) \" +\n \" JOIN cpad_regimen_drug d ON(c.drug_id=d.drug_id) \" +\n \" JOIN cpad_regimen e ON(d.regimen_id=e.regimen_id) \" +\n \" WHERE (e.name='10A=AZT(300)+DDL(125)+IDV/r (400/100)')\"+\n \" and a.date_created between (:startDate) and (:endDate) \";\n\n return sql;\n }", "private Collection<String[]> getPatientIds(String subjectCid) throws Throwable {\n\t\tXmlDocMaker doc = new XmlDocMaker(\"args\");\n\t\tdoc.add(\"size\", \"infinity\");\n\t\tdoc.add(\"action\", \"get-meta\");\n\t\tdoc.add(\"where\", \"cid starts with '\" + subjectCid\n\t\t\t\t+ \"' and model='om.pssd.study' and mf-dicom-study has value\");\n\t\tdoc.add(\"pdist\", 0); // Force local\n\t\tXmlDoc.Element r = executor().execute(\"asset.query\", doc.root());\n\t\tCollection<String> dicomStudyCids = r.values(\"asset/cid\");\n\t\tif (dicomStudyCids == null) {\n\t\t\treturn null;\n\t\t}\n\t\tVector<String[]> patientIds = new Vector<String[]>();\n\t\tfor (String dicomCid : dicomStudyCids) {\n\t\t\tString[] patientId = getPatientIdFromDicomStudy(dicomCid);\n\t\t\tif (patientId != null) {\n\t\t\t\tboolean exists = false;\n\t\t\t\tfor (String[] patientId2 : patientIds) {\n\t\t\t\t\tif (patientId2[0].equals(patientId[0])\n\t\t\t\t\t\t\t&& patientId2[1].equals(patientId[1])\n\t\t\t\t\t\t\t&& patientId2[2].equals(patientId[2])) {\n\t\t\t\t\t\texists = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!exists) {\n\t\t\t\t\tpatientIds.add(patientId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn patientIds;\n\n\t}", "public Collection<IPatient> searchPatients(String text) throws BadConnectionException, CriticalClassException, CriticalDatabaseException, InvalidSearchParameterException\n {\n _model = Model.getInstance();\n\n return _model.getSearchPatientController().searchPatients(text);\n }", "@Override\r\n\tpublic List<Object[]> searchPlantDetails() {\n\t\tList<Object[]> list = null;\r\n\t\ttry {\r\n\t\t\tsql = \"select p.plantId ,p.plantName,p.add1,p.add2,p.add3,p.city,p.state,p.phone,p.fax,p.mobile,p.organization,p.countrysList from Plant p\";\r\n\t\t\tlist = getHibernateTemplate().find(sql);\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn list;\r\n\t}", "public Patient returnPatFromId(String id)\r\n\t{\r\n\t\tPatient foundPatient = null;// blank patient is made\r\n\r\n\t\tfor(int i=0; arrayPatients[i]!=null ;i++)//loops through the array\r\n\t\t{\r\n\t\t\tif(arrayPatients[i].patientID.equals(id))//if the id passed matches the id of that term in the array it will save that array term \r\n\t\t\t{\r\n\t\t\t\tfoundPatient = arrayPatients[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn foundPatient;// that saved array term is then returned\r\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic JSONArray findMatches(String query){\n\t\t\n\t\t// Increment the search tasks counter\n\t\t++numOfSearchTasks;\n\t\t\n\t\t// Start the timer for this task\n\t\tTimer.start();\n\t\t\n\t\t// Number of needed matches\n\t\tresultsToBeFound = 10;\n\t\t\n\t\t// Clear the matches list\n\t\tsetForTypeahead.clear();\n\t\t\n\t\t// The returned JSON array\n\t\tJSONArray arrayObj = new JSONArray();\n\t\t\n\t\t// Search in all predicates\n\t\tfor(int i = 0; i < predicatesList.size(); ++i){\n\t\t\tif(predicatesList.get(i).toLowerCase().contains(query.toLowerCase())){\n\t\t\t\tarrayObj.add(predicatesList.get(i));\n\t\t\t}\n\t\t\tArrayList<String> semanticRelations = semanticRelationsMap.get(query.toLowerCase());\n\t\t\tif(semanticRelations != null) {\n\t\t\t\tfor(String s : semanticRelations) {\n\t\t\t\t\tif(predicatesList.get(i).toLowerCase().contains(s.toLowerCase())){\n\t\t\t\t\t\tarrayObj.add(predicatesList.get(i));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Start the timer for this task\n\t\tTimer.start();\n\t\t\n\t\t// Search in index first\n\t\tCollection<Integer> list = in.search(query.toLowerCase());\n\t\tHashSet<Integer> output = null;\n\t\tif(list.size() > 0) {\n\t\t\toutput = (HashSet<Integer>) list;\n\t\t}\n\t\telse {\n\t\t\toutput = new HashSet<Integer>();\n\t\t}\n\n\t\t// If found a match, that's a hit\n\t\tif(output.size() > 0) {\n\t\t\t++numOfIndexHits;\n\t\t}\n\t\t\n\t\tfor(Integer index : output) {\n\t\t\tarrayObj.add(frequentLiteralsList.get(index));\n \t\t--resultsToBeFound;\n \t}\n\t\tdouble tempStopTime;\n\t\t// If all results were found in suffix tree\n\t\tif(resultsToBeFound < 0) {\n\t\t\tTimer.stop();\n\t\t\tsuffixTreeTime += Timer.getTimeInSeconds();\n\t\t\ttotalTime += Timer.getTimeInSeconds();\n\t\t\twriteStatsToFile();\n\t\t\treturn arrayObj;\n\t\t}\n\t\t\n\t\tTimer.stop();\n\t\tsuffixTreeTime += Timer.getTimeInSeconds();\n\t\ttempStopTime = Timer.getTimeInSeconds();\n\t\tTimer.start();\n\t\t// In length bins\n\t\t// Search in bins with a minimum length of the query\n\t\t// and a maximum of the query length + 10\n\t\tint minLength = query.length()-1;\n\t\tint maxLength = query.length() + 9;\n\t\t\n\t\tint minIndex = Integer.MAX_VALUE;\n\t\tint maxIndex = -1;\n\t\t\n\t\t// Determine which indices of the literals array\n\t\t// to search within\n\t\tfor(int i = 0; i < lengths.size(); ++i){\n\t\t\tif(lengths.get(i) > maxLength) {\n\t\t\t\tmaxIndex = indexes.get(i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(minLength >= lengths.get(i)) {\n\t\t\t\tminIndex = indexes.get(i);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpruningPercentage += 1 - (1.0 * (maxIndex - minIndex) / literalsList.size());\n\t\ttry{\n\t\tSystem.out.println(\"Searching for \" + query + \" between indeces: \" + minIndex + \n\t\t\t\t\" corresponding to length \" + (literalsList.get(minIndex).length()-5) +\n\t\t\t\t\" and \" + maxIndex + \" corresponding to length \" + \n\t\t\t\t(literalsList.get(maxIndex).length()-5));\n\t\t}\n\t\tcatch(IndexOutOfBoundsException e) {\n\t\t\tSystem.out.println(\"query = \" + query);\n\t\t\tSystem.out.println(\"minIndex = \" + minIndex);\n\t\t\tSystem.out.println(\"maxIndex = \" + maxIndex);\n\t\t}\n\t\t\n\t\t// Assign threads to search tasks\n\t\tint indexesPerThread = (maxIndex - minIndex) / (numOfCores);\n\t\t\n\t\t// Arraylist to keep track of threads\n\t\tArrayList<Thread> threads = new ArrayList<Thread>();\n\t\t\n\t\tfor(int i = minIndex; i < maxIndex; i += indexesPerThread) {\n\t\t\tthreads.add(new Thread(new SearchTask(i, i + indexesPerThread, query)));\n\t\t}\n\t\t\n\t\t// Start threads\n\t\tfor(int i = 0; i < threads.size(); ++i) {\n\t\t\tthreads.get(i).start();\n\t\t}\n\t\t\n\t\t// Join threads before continue\n\t\tfor(int i = 0; i < threads.size(); ++i) {\n\t\t\ttry {\n\t\t\t\tthreads.get(i).join();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Stop timer\n\t\tTimer.stop();\n\t\ttotalTime += tempStopTime + Timer.getTimeInSeconds();\n\t\t\n\t\t// Sort by length\n\t\tArrayList<String> tempList = new ArrayList<String>();\n\t\tfor(String string : setForTypeahead) {\n\t\t\tif(!arrayObj.contains(string))\n\t\t\t\ttempList.add(string);\n\t\t}\n\t\tjava.util.Collections.sort(tempList, new LengthComparator());\n\t\t\n\t\t// Fill the array\n\t\tfor(int i = 0; i < tempList.size() && resultsToBeFound > 0; ++i, --resultsToBeFound) {\n\t\t\tarrayObj.add(tempList.get(i));\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t// Update the stats file with number of tasks and hits\n\t\twriteStatsToFile();\n\t\t\n\t\treturn arrayObj;\n\t}", "public ArrayList<University> takeQuiz(String location, String characteristic, String control, String[] emphasis) {\n\t\tArrayList<University> personalMatches = new ArrayList<University>();\n\n\t\tif (location.equals(\"\") || control.equals(\"\") || characteristic.equals(\"\")) {\n\t\t\tthrow new IllegalArgumentException(\"Sorry, you must answer all questions\");\n\t\t} else {\n\t\t\tif (characteristic.equals(\"academic\")) {\n\n\t\t\t\tpersonalMatches = sfCon.search(\"\", \"-1\", location, -1, -1, (float) -1.0, (float) -1.0, -1, -1, -1, -1,\n\t\t\t\t\t\t-1, -1, (float) -1.0, (float) -1.0, -1, -1, (float) -1.0, (float) -1.0, (float) -1.0,\n\t\t\t\t\t\t(float) -1.0, 3, -1, -1, -1, -1, -1, emphasis, control);\n\t\t\t} else if (characteristic.equals(\"social\")) {\n\t\t\t\tpersonalMatches = sfCon.search(\"\", \"-1\", location, -1, -1, (float) -1.0, (float) -1.0, -1, -1, -1, -1,\n\t\t\t\t\t\t-1, -1, (float) -1.0, (float) -1.0, -1, -1, (float) -1.0, (float) -1.0, (float) -1.0,\n\t\t\t\t\t\t(float) -1.0, -1, -1, 3, -1, -1, -1, emphasis, control);\n\t\t\t} else if (characteristic.equals(\"qualityOfLife\")) {\n\t\t\t\tpersonalMatches = sfCon.search(\"\", \"-1\", location, -1, -1, (float) -1.0, (float) -1.0, -1, -1, -1, -1,\n\t\t\t\t\t\t-1, -1, (float) -1.0, (float) -1.0, -1, -1, (float) -1.0, (float) -1.0, (float) -1.0,\n\t\t\t\t\t\t(float) -1.0, -1, -1, -1, -1, 3, -1, emphasis, control);\n\t\t\t}\n\n\t\t}\n\n\t\tfor (int i = 0; i < personalMatches.size(); i++) {\n\t\t\tSystem.out.println(\"Match: \" + personalMatches.get(i).getName());\n\n\t\t}\n\t\treturn personalMatches;\n\t}", "public List<Doctor> acceptingNewPatients(String specialty);", "private SortedMap searchByPID(Person person, IcsTrace trace) {\n\t\tProfile.begin(\"PersonIdServiceBean.searchByPID\");\n\n\t\tTreeMap ret = new TreeMap();\n\t\tDatabaseServices dbServices = DatabaseServicesFactory.getInstance();\n\n\t\ttry {\n\t\t\tList matches = null;\n\n\t\t\tIterator ids = person.getPersonIdentifiers().iterator();\n\n\t\t\tQueryParamList params = new QueryParamList(QueryParamList.OR_LIST);\n\t\t\twhile (ids.hasNext()) {\n\t\t\t\tQueryParamList inner = new QueryParamList(\n\t\t\t\t\t\tQueryParamList.AND_LIST);\n\t\t\t\tPersonIdentifier pid = (PersonIdentifier) ids.next();\n\t\t\t\tinner.add(AttributeType.PERSON_IDENTIFIER, pid.getId());\n\t\t\t\tinner.add(AttributeType.AA_NAMESPACE_ID, pid\n\t\t\t\t\t\t.getAssigningAuthority().getNameSpaceID());\n\t\t\t\tinner.add(AttributeType.AF_NAMESPACE_ID, pid\n\t\t\t\t\t\t.getAssigningFacility().getNameSpaceID());\n\t\t\t\tparams.add(inner);\n\t\t\t}\n\t\t\tmatches = dbServices.query(params);\n\n\t\t\tif (trace.isEnabled()) {\n\t\t\t\ttrace.add(\"Persons that match PIDS:\");\n\t\t\t\tIterator i = matches.iterator();\n\t\t\t\twhile (i.hasNext())\n\t\t\t\t\ttrace.add((Person) i.next());\n\t\t\t}\n\n\t\t\tIterator i = matches.iterator();\n\t\t\twhile (i.hasNext()) {\n\t\t\t\tPerson match = (Person) i.next();\n\t\t\t\tret.put(new Double(1.0), match);\n\t\t\t}\n\t\t} catch (DatabaseException dbEx) {\n\t\t\tlog.error(dbEx, dbEx);\n\t\t} finally {\n\t\t\tProfile.end(\"PersonIdServiceBean.searchByPID\");\n\t\t}\n\n\t\treturn ret;\n\t}", "public static Cohort getMdrPatients(String identifier, String name, String enrollment, Location location, List<ProgramWorkflowState> states) {\r\n\t\t\r\n\t\tCohort cohort = Context.getPatientSetService().getAllPatients();\r\n\t\t\r\n\t\tMdrtbService ms = (MdrtbService) Context.getService(MdrtbService.class);\r\n\t\t\r\n\t\tDate now = new Date();\r\n\t\tProgram mdrtbProgram = ms.getMdrtbProgram();\r\n\t\t\r\n\t\tif (\"current\".equals(enrollment)) {\r\n\t\t\tCohort current = Context.getPatientSetService().getPatientsInProgram(mdrtbProgram, now, now);\r\n\t\t\tcohort = Cohort.intersect(cohort, current);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tCohort ever = Context.getPatientSetService().getPatientsInProgram(mdrtbProgram, null, null);\r\n\t\t\tif (\"previous\".equals(enrollment)) {\r\n\t\t\t\tCohort current = Context.getPatientSetService().getPatientsInProgram(mdrtbProgram, now, now);\r\n\t\t\t\tCohort previous = Cohort.subtract(ever, current);\r\n\t\t\t\tcohort = Cohort.intersect(cohort, previous); \t\t\t\r\n\t\t\t}\r\n\t\t\telse if (\"never\".equals(enrollment)) {\r\n\t\t\t\tcohort = Cohort.subtract(cohort, ever);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tcohort = Cohort.intersect(cohort, ever);\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t\r\n\t\tif (StringUtils.isNotBlank(name) || StringUtils.isNotBlank(identifier)) {\r\n\t\t\tname = \"\".equals(name) ? null : name;\r\n\t\t\tidentifier = \"\".equals(identifier) ? null : identifier;\r\n\t\t\tCohort nameIdMatches = new Cohort(Context.getPatientService().getPatients(name, identifier, null, false));\r\n\t\t\tcohort = Cohort.intersect(cohort, nameIdMatches);\r\n\t\t}\r\n\t\t\r\n\t\t// If Location is specified, limit to patients at this Location\r\n\t\tif (location != null) {\r\n\t\t\tCohortDefinition lcd = Cohorts.getLocationFilter(location, now, now);\r\n\t\t\tCohort locationCohort;\r\n try {\r\n\t locationCohort = Context.getService(CohortDefinitionService.class).evaluate(lcd, new EvaluationContext());\r\n }\r\n catch (EvaluationException e) {\r\n \t throw new MdrtbAPIException(\"Unable to evalute location cohort\",e);\r\n }\r\n\t\t\tcohort = Cohort.intersect(cohort, locationCohort);\r\n\t\t}\r\n\t\t\r\n\t\tif (states != null) {\r\n\t\t\tCohort inStates = Context.getPatientSetService().getPatientsByProgramAndState(null, states, now, now);\r\n\t\t\tcohort = Cohort.intersect(cohort, inStates);\r\n\t\t}\r\n\t\t\r\n\t\treturn cohort;\r\n\t}", "public PatientExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public Map<String, Object> getPeople(Map<String, Object> conditions) {\n String dwdm = conditions.get(\"dwdm\").toString();\n StringBuffer sql = new StringBuffer(50);\n sql.append(\"select * from JM_DUTY a where 1 = 1 and xgsj in (select max(xgsj) from jm_duty where zbrbmbh='\" + dwdm + \"')\");\n//\t\tSet<Entry<String, Object>> set = conditions.entrySet();\n//\t\tIterator<Entry<String, Object>> it = set.iterator();\n//\t\t\tEntry<String, Object> entry = it.next();\n//\t\t\tString key = entry.getKey();\n//\t\t\tString value = (String) entry.getValue();\n Map<String, Object> map = findPageForMap(sql.toString(),\n Integer.parseInt(conditions.get(\"page\").toString()),\n Integer.parseInt(conditions.get(\"rows\").toString()));\n //Map<String, Object> map = findPageForMap(sql.toString(),1,20);\n return map;\n }", "public ArrayList<MedicalRecord> getPatientRecords(String patient) {\n if (database.containsKey(patient)) {\n return database.get(patient);\n } else {\n System.out.println(\"No such patient found\");\n return null;\n }\n }", "public ArrayList<Patient> chercherPatient(String recherche) {\r\n ArrayList<Patient> p=new ArrayList();\r\n for (int i = 0; i < patients.size(); i++) {\r\n if ((patients.get(i).getNomUsuel()+patients.get(i).getPrenom()).toLowerCase().contains(recherche.trim().toLowerCase())) {\r\n p.add(patients.get(i));\r\n }\r\n }\r\n return p;\r\n }", "public void searchFlights();", "public Cursor[] search(String data[]) {\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor results[] = new Cursor[6];\n String innerProduct = TABLE_ORGANIZATION + \" O\";\n String whereClause = \"\";\n boolean hasLoc = false;\n// Log.e(\"Data Length\",String.valueOf(data.length));\n for (int i = 0; i < data.length; ++i) {\n Log.e(\"HERE\", \"HERE\");\n Log.e(\"Data[i]\", data.toString());\n if ((data[i].length() > 0)) {\n if (i == 1) {\n innerProduct = innerProduct + \", \" + TABLE_CATEGORY + \" C\";\n innerProduct = innerProduct + \", \" + TABLE_FALLS_IN + \" F\";\n whereClause = whereClause + \" AND O.\" + FIELD_ORG_OID + \" = \" + \" F.\" + RELATION_FALLS_IN_OID;\n whereClause = whereClause + \" AND F.\" + RELATION_FALLS_IN_CNAME + \" = \" + \" C.\" + FIELD_CAT_cName;\n whereClause = whereClause + \" AND C.\" + FIELD_CAT_cName + \" LIKE '%\" + data[i] + \"%'\";\n }\n if ((i >= 2) && (i <= 4) && (!hasLoc)) {\n whereClause = whereClause + \" AND O.\" + FIELD_ORG_OID + \" = \" + \" LOC.\" + FIELD_ORG_OID;\n innerProduct = innerProduct + \", \" + TABLE_LOCATION + \" LOC\";\n hasLoc = true;\n }\n if (i == 2) {\n whereClause = whereClause + \" AND LOC.\" + FIELD_LOC_ZIP + \" LIKE '%\" + data[i] + \"%'\";\n }\n if (i == 3) {\n whereClause = whereClause + \" AND LOC.\" + FIELD_LOC_CITY + \" LIKE '%\" + data[i] + \"%'\";\n }\n if (i == 4) {\n whereClause = whereClause + \" AND LOC.\" + FIELD_LOC_STATE + \" LIKE '%\" + data[i] + \"%'\";\n }\n if (i == 6) {\n innerProduct = innerProduct + \", \" + TABLE_POPULATION + \" P\";\n innerProduct = innerProduct + \", \" + TABLE_SERVES_PEOPLE + \" SP\";\n whereClause = whereClause + \" AND SP.\" + RELATION_SERVESP_OID + \" = \" + \" O.\" + FIELD_ORG_OID;\n whereClause = whereClause + \" AND SP.\" + RELATION_SERVESP_TYPE + \" = \" + \" P.\" + FIELD_POP_TYPE;\n whereClause = whereClause + \" AND P.\" + FIELD_POP_TYPE + \" LIKE '%\" + data[i] + \"%'\";\n }\n if (i == 7) {\n innerProduct = innerProduct + \", \" + TABLE_LANGUAGE + \" L\";\n innerProduct = innerProduct + \", \" + TABLE_SERVESL + \" SL\";\n whereClause = whereClause + \" AND SL.\" + RELATION_SERVES_LAN_OID + \" = \" + \" O.\" + FIELD_ORG_OID;\n whereClause = whereClause + \" AND SL.\" + RELATION_SERVES_LAN_LTYPE + \" = \" + \" L.\" + FIELD_LAN_LTYPE;\n whereClause = whereClause + \" AND L.\" + FIELD_LAN_LTYPE + \" LIKE '%\" + data[i] + \"%'\";\n }\n }\n }\n Log.e(\"Querry\", \"SELECT O.\" + FIELD_ORG_OID + \", O.\" + FIELD_ORG_NAME +\n \", O.\" + FIELD_ORG_EMAIL + \", O.\" + FIELD_ORG_WEBSITE +\n \", O.\" + FIELD_ORG_COST + \", O.\" + FIELD_ORG_ADDITIONAL\n + \", O.\" + FIELD_ORG_ASSISTANCE + \", O.\" + FIELD_ORG_OTHER\n + \" FROM \" + innerProduct + \" WHERE O.\"\n + FIELD_ORG_NAME + \" LIKE '%\" + data[0] + \"%'\" +\n \" AND O.\" + FIELD_ORG_COST + \" LIKE '%\" + data[5]\n + \"%'\" + whereClause + \";\");\n Cursor Organization = db.rawQuery(\"SELECT O.\" + FIELD_ORG_OID + \", O.\" + FIELD_ORG_NAME +\n \", O.\" + FIELD_ORG_EMAIL + \", O.\" + FIELD_ORG_WEBSITE +\n \", O.\" + FIELD_ORG_COST + \", O.\" + FIELD_ORG_ADDITIONAL\n + \", O.\" + FIELD_ORG_ASSISTANCE + \", O.\" + FIELD_ORG_OTHER\n + \" FROM \" + innerProduct + \" WHERE O.\"\n + FIELD_ORG_NAME + \" LIKE '%\" + data[0] + \"%'\" +\n \" AND O.\" + FIELD_ORG_COST + \" LIKE '%\" + data[5]\n + \"%'\" + whereClause + \";\", null);\n Cursor Language = null;\n Cursor Population = null;\n Cursor Category = null;\n Cursor Location = null;\n Cursor Phone = null;\n if (Organization.moveToFirst()) {\n Log.e(\"More\", \"stuff\");\n String sLang = \" SL.\" + RELATION_SERVES_LAN_OID + \" = \" + Organization.getString(0) +\n \" AND SL.\" + RELATION_SERVES_LAN_LTYPE + \" = \" + \" L.\" + FIELD_LAN_LTYPE;\n String sPop = \" SP.\" + RELATION_SERVESP_OID + \" = \" + Organization.getString(0) +\n \" AND SP.\" + RELATION_SERVESP_TYPE + \" = \" + \" P.\" + FIELD_POP_TYPE;\n String sCat = \" F.\" + RELATION_FALLS_IN_OID + \" = \" + Organization.getString(0) +\n \" AND F.\" + RELATION_FALLS_IN_CNAME + \" = \" + \" C.\" + FIELD_CAT_cName;\n String sLoc = \" LOC.\" + FIELD_LOC_OID + \" = \" + Organization.getString(0);\n String sPhone = \" P.\" + FIELD_ORG_OID + \" = \" + Organization.getString(0);\n Log.e(\"Die\", \"1\");\n while (Organization.move(1)) {\n Log.e(\"In\", \"While\");\n sCat = sCat + \" AND F.\" + RELATION_FALLS_IN_OID + \" = \" + Organization.getString(0) +\n \" AND F.\" + RELATION_FALLS_IN_CNAME + \" = \" + \" C.\" + FIELD_CAT_cName;\n sPop = sPop + \" AND SP.\" + RELATION_SERVESP_OID + \" = \" + Organization.getString(0) +\n \" AND SP.\" + RELATION_SERVESP_TYPE + \" = \" + \" P.\" + FIELD_POP_TYPE;\n sLang = sLang + \" AND SL.\" + RELATION_SERVES_LAN_OID + \" = \" + Organization.getString(0) +\n \" AND SL.\" + RELATION_SERVES_LAN_LTYPE + \" = \" + \" L.\" + FIELD_LAN_LTYPE;\n sLoc = sLoc + \" AND LOC.\" + FIELD_LOC_OID + \" = \" + Organization.getString(0);\n sPhone = sPhone + \" AND P.\" + FIELD_ORG_OID + \" = \" + Organization.getString(0);\n }\n Category = db.rawQuery(\"SELECT C.\" + FIELD_CAT_cName + \", F.\" + RELATION_FALLS_IN_OID + \" FROM \" + TABLE_FALLS_IN + \" F, \" +\n TABLE_CATEGORY + \" C WHERE\" + sCat, null);\n Population = db.rawQuery(\"SELECT P.\" + FIELD_POP_TYPE + \", SP.\" + RELATION_SERVESP_OID + \" FROM \" + TABLE_POPULATION + \" P, \" +\n TABLE_SERVES_PEOPLE + \" SP WHERE\" + sPop, null);\n Language = db.rawQuery(\"SELECT L.\" + FIELD_LAN_LTYPE + \", SL.\" + RELATION_SERVES_LAN_OID + \" FROM \" + TABLE_LANGUAGE + \" L, \" +\n TABLE_SERVESL + \" SL WHERE\" + sLang, null);\n Location = db.rawQuery(\"SELECT LOC.\" + FIELD_LOC_STREET + \", LOC.\" + FIELD_LOC_CITY + \", LOC.\" +\n FIELD_LOC_STATE + \", LOC.\" + FIELD_LOC_ZIP + \", LOC.\" + FIELD_LOC_OID + \" FROM \" + TABLE_LOCATION + \" LOC \" +\n \"WHERE\" + sLoc, null);\n Phone = db.rawQuery(\"SELECT P.\" + FIELD_PHONE_PHONENUM + \", P.\" + FIELD_ORG_OID + \" FROM \" + TABLE_PHONE + \" P WHERE\" + sPhone, null);\n\n }\n results[0] = Organization;\n results[1] = Category;\n results[2] = Population;\n results[3] = Language;\n results[4] = Location;\n results[5] = Phone;\n return results;\n }", "public List<OWLObject> search(OWLObject queryObj) {\n\t\tList<OWLObject> hits = new ArrayList<OWLObject>(maxHits);\n\t\tSystem.out.println(\"gettings atts for \"+queryObj+\" -- \"+simEngine.comparisonProperty);\n\t\tSet<OWLObject> atts = simEngine.getAttributeClosureFor(queryObj);\n\t\tSystem.out.println(\"all atts: \"+atts.size());\n\t\tif (atts.size() == 0)\n\t\t\treturn hits;\n\t\t\n\t\t// only compare using significant atts;\n\t\t// we don't do the same test on candidates as these will be removed by the\n\t\t// intersection operation. they will have a small effect on the score, as\n\t\t// we don't divide by the union, but instead the sum of sizes\n\t\tatts = filterNonSignificantAttributes(atts);\n\t\tSystem.out.println(\"filtered atts: \"+atts.size());\n\n\t\t//bloomFilter = new BloomFilter<OWLObject>(0.05, atts.size());\n\t\t//bloomFilter.addAll(atts);\n\t\t\t\t\n\t\tSortedMap<Integer,Set<OWLObject>> scoreCandidateMap = new TreeMap<Integer,Set<OWLObject>>();\n\t\t\n\t\tfor (OWLObject candidate : getCandidates()) {\n\t\t\tif (candidate.equals(queryObj))\n\t\t\t\tcontinue;\n\t\t\tSet<OWLObject> iAtts = simEngine.getAttributeClosureFor(candidate);\n\t\t\t//Set<OWLObject> iAtts = simEngine.getGraph().getAncestors(candidate);\n\n\t\t\tif (iAtts.size() == 0)\n\t\t\t\tcontinue;\n\t\t\tint cAttsSize = iAtts.size();\n\t\n\t\t\tiAtts.retainAll(atts);\n\t\t\t//Collection<OWLObject> iAtts = bloomFilter.intersection(cAtts);\n\t\t\t\n\t\t\t// simJ, one-sided, scaled by 1000\n\t\t\t// negate to ensure largest first\n\t\t\t//Integer score = - (iAtts.size() * 1000 / cAttsSize);\n\t\t\t\n\t\t\t// this biases us towards genes with large numbers of annotations,\n\t\t\t// but it is better at finding the models that share all features\n\t\t\tInteger score = - iAtts.size();\n\t\t\tif (!scoreCandidateMap.containsKey(score)) \n\t\t\t\tscoreCandidateMap.put(score, new HashSet<OWLObject>());\n\t\t\tscoreCandidateMap.get(score).add(candidate);\n\t\t\treporter.report(this,\"query_candidate_overlap_total\",queryObj,candidate,iAtts.size(),cAttsSize);\n\t\t}\n\t\t\n\t\tint n = 0;\n\t\tfor (Set<OWLObject> cs : scoreCandidateMap.values()) {\n\t\t\tn += cs.size();\n\t\t\thits.addAll(cs);\n\t\t}\n\t\t\n\t\tn = 0;\n\t\tfor (OWLObject hit : hits) {\n\t\t\tn++;\n\t\t\treporter.report(this,\"query_hit_rank_threshold\",queryObj,hit,n,maxHits);\n\t\t}\n\t\tif (hits.size() > maxHits)\n\t\t\thits = hits.subList(0, maxHits);\n\t\t\n\n\n\t\treturn hits;\n\t}", "Appliance[] find(Criteria[] criteria);", "public void showPatientList()\r\n\t{\n\t\tfor(int i=0; i<nextPatientLocation; i++)\r\n\t\t{\r\n\t\t\tString currentPositionPatientData = arrayPatients[i].toString();\r\n\t\t\tSystem.out.println(\"Patient \" + i + \" is \" + currentPositionPatientData);\r\n\t\t}\r\n\t}", "public Person[] match(int numberOfHearts) {\n if(numberOfHearts == 0){\n return null;\n }\n if(numberOfHearts >= listOfPatients.length){\n return listOfPatients;\n }\n\n Person[] returnList = new Person[numberOfHearts];\n int i = 0;\n\n for(int j = 0 ; j < survivabilityByCause.length ; j++){\n SurvivabilityByCause c = survivabilityByCause[i];\n int pCount = 0;\n Person[] peeps = getPatientsByHeartConditionCause(c.getCause());\n\n while(i <= numberOfHearts && pCount < peeps.length){\n returnList[i] = peeps[pCount];\n pCount++;\n i++;\n }\n }\n \n return returnList;\n }", "public abstract List<ClinicalDocumentDto> findClinicalDocumentDtoByPatientId(Long patientId);", "public static void main(String[] args) {\n String[] user0 = {\"/start\", \"/pink\", \"/register\", \"/orange\", \"/red\", \"a\"};\n String[] user1 = {\"/start\", \"/green\", \"/blue\", \"/pink\", \"/register\", \"/orange\", \"/one/two\"};\n String[] user2 = {\"a\", \"/one\", \"/two\"};\n String[] user3 = {\"/red\", \"/orange\", \"/yellow\", \"/green\", \"/blue\", \"/purple\", \"/white\", \"/amber\", \"/HotRodPink\", \"/BritishRacingGreen\"};\n String[] user4 = {\"/red\", \"/orange\", \"/amber\", \"/green\", \"/blue\", \"/purple\", \"/white\", \"/lavender\", \"/HotRodPink\", \"/BritishRacingGreen\"};\n String[] user5 = {\"a\"};\n\n// out.println(rawr(user0, user1));\n// out.println(rawr(user1, user2));\n// out.println(rawr(user2, user0));\n// out.println(rawr(user5, user2));\n out.println(rawr(user3, user4));\n// out.println(rawr(user4, user3));\n\n P1 c=new P1();\n c.findContiguousHistory(user0, user1);\n c.findContiguousHistory(user1, user2);\n c.findContiguousHistory(user2, user0);\n c.findContiguousHistory(user5, user2);\n c.findContiguousHistory(user3, user4);\n\n // below scenaro is tricky because amber match later and user3 string. We have to come back again.\n // String[] user4 = {\"/red\", \"/orange\", \"/amber\", \"/green\", \"/blue\", \"/purple\", \"/white\", \"/lavender\", \"/HotRodPink\", \"/BritishRacingGreen\"};\n // String[] user3 = {\"/red\", \"/orange\", \"/yellow\", \"/green\", \"/blue\", \"/purple\", \"/white\", \"/amber\", \"/HotRodPink\", \"/BritishRacingGreen\"};\n\n c.findContiguousHistory(user4, user3);\n }", "public void searchPerson() {\n\t\tSystem.out.println(\"*****Search a person*****\");\n\t\tSystem.out.println(\"Enter Phone Number to search: \");\n\t\tlong PhoneSearch = sc.nextLong();\n\t\tfor (int i = 0; i < details.length; i++) {\n\t\t\tif (details[i] != null && details[i].getPhoneNo() == PhoneSearch) {\n\t\t\t\tSystem.out.print(\"Firstname \\tLastname \\tAddress \\t\\tCity \\t\\tState \\t\\t\\tZIP \\t\\tPhone \\n\");\n\t\t\t\tSystem.out.println(details[i]);\n\t\t\t}\n\t\t}\n\t}", "private final List<Object> searchForResults(@Nullable String query)\n {\n ArrayList<Object> results = new ArrayList<>();\n try {\n results.addAll(crDao.getRecordsLike(query));\n } catch (Exception e) {\n Logger.error(\"Failed to search the cr dao for results.\", e);\n }\n\n try {\n results.addAll(customMonsterDao.getRecordsLike(query));\n } catch (Exception e) {\n Logger.error(\"Failed to search the custom monster dao for results.\", e);\n }\n\n try {\n results.addAll(monsterDao.getRecordsLike(query));\n } catch (Exception e) {\n Logger.error(\"Failed to search the standard monster dao for results.\", e);\n }\n\n return results;\n }", "public static void main(String[] args) {\n\n\t\tPerson P1 = new Person(\"18\",\"Jose\",\"SoftDev\");\n\t\tPerson P2 = new Person(\"20\",\"Kiki\",\"Cleaner\");\n\t\t\n\t\t\n\t\t//print results using the tostring method\n\t\t//System.out.println(P1.toString()) ;\n\t\t//System.out.println(P2.toString()) ; //no longer needed\n\t\t\n\t\t\n\t\t//add to arraylist\n//\t\tPerson.peopleinfo.add(P1); //no longer needed as its incorporated in person class\n//\t\tPerson.peopleinfo.add(P2);\n\t\t\n\t\t//using for loop to output people:\n\t\t\n\t\tfor(Person person:Person.peopleinfo) {// Person = data type, person: ref var (placeholder), \n\t\t\tSystem.out.println(person);// person.name if u onl want name\n\t\t}\n\n\t\t// no need for static methods\n\t\tRunner_Person l = new Runner_Person();// you do this to create an instance of search within the main so that static is not reqd\n\t\tSystem.out.println(l.search(\"Jose\"));\n\n\t}", "List<Establishment> searchEstablishments(EstablishmentCriteria criteria, RangeCriteria rangeCriteria);", "private SearchResult<ProviderProfile> getAllResults(HealthCareFacilitySearchCriteria criteria,\n String providerCatagory) throws URISyntaxException, IOException, ServiceException {\n DefaultHttpClient client = new DefaultHttpClient();\n client.setRedirectStrategy(new LaxRedirectStrategy());\n\n // we need to get a token from the start page, this will be stored in the client\n HttpGet getFrontPage = new HttpGet(new URIBuilder(getSearchURL()).build());\n HttpResponse response = client.execute(getFrontPage);\n verifyAndAuditCall(getSearchURL(), response);\n EntityUtils.consume(response.getEntity()); // releases the connection\n\n // our client is now valid, pass the criteria to the search page\n String postSearchURL = Util.replaceLastURLPart(getSearchURL(), \"showprovideroutput.cfm\");\n HttpPost searchPage = new HttpPost(new URIBuilder(postSearchURL).build());\n String whichArea = \"\", selectCounty = \"0\", cityToFind = \"\", providerToFind = \"\";\n if (\"county\".equals(criteria.getCriteria())) {\n whichArea = \"County\";\n selectCounty = criteria.getValue();\n } else if (\"city\".equals(criteria.getCriteria())) {\n whichArea = \"City\";\n cityToFind = criteria.getValue();\n } else if (\"provider\".equals(criteria.getCriteria())) {\n whichArea = \"Name\";\n providerToFind = criteria.getValue();\n }\n HttpEntity entity = postForm(postSearchURL, client, searchPage, new String[][] {\n { \"ProviderCatagory\", providerCatagory }, { \"WhichArea\", whichArea }, { \"Submit\", \"Submit\" },\n { \"SelectCounty\", selectCounty }, { \"CityToFind\", cityToFind },\n { \"ProviderToFind\", providerToFind } }, true);\n\n List<ProviderProfile> allProviders = new ArrayList<ProviderProfile>();\n // this now holds the search results, parse every row\n Document page = Jsoup.parse(EntityUtils.toString(entity));\n Elements rows = page.select(\"div#body table tbody tr:gt(0)\");\n for (Element row : rows) {\n ProviderProfile profile = parseProfile(row.children());\n if (profile != null) {\n allProviders.add(profile);\n }\n }\n\n SearchResult<ProviderProfile> results = new SearchResult<ProviderProfile>();\n results.setItems(allProviders);\n return results;\n }", "public abstract List<LocationDto> match_building(ScheduleDto schedule,SlotDto slot);", "private ArrayList<Patient> getPatients(String key) {\n\n BlueCareApolloClient.getBlueCareApolloClient().query(GetPatientsQuery.builder()\n ._authKey(key)\n .build())\n .enqueue(new ApolloCall.Callback<GetPatientsQuery.Data>() {\n\n @Override\n public void onResponse(@Nonnull com.apollographql.apollo.api.Response<GetPatientsQuery.Data> response) {\n\n res1 = response.data().getPatients().toString();\n List res = response.data().getPatients().patientRecords();\n String name;\n String age;\n\n Log.d(\"staff res: \", res1);\n\n\n\n for(int i = 0; i != res.size(); i++) {\n Object obj = (Object) res.get(i);\n Gson gson = new Gson();\n String jsonString = gson.toJson(obj);\n\n try {\n JSONObject patientRecords = new JSONObject(jsonString);\n name = patientRecords.getString(\"name\");\n age = patientRecords.getString(\"age\");\n\n //JSONArray cond = patientRecords.getJSONArray(\"conditions\");\n Patient x = new Patient(name, age);\n\n //x.setCondition(cond);\n patientList.add(x);\n\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n\n\n\n StaffActivity.this.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n // patientList.add(new Patient(name, cName, cStatus));\n thisListView.setAdapter(thisAdapter);\n\n\n thisListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n Patient currentPatient = patientList.get(position);\n\n //Log.d(\"clicker: \", patientList.get(position).getCondition().toString());\n\n\n //thisIntent = new Intent(StaffActivity.this, SinglePatientView.class);\n //thisIntent.putExtra(\"patientName\", currentPatient.getpName());\n //thisIntent.putExtra(\"patientConditions\", currentPatient.getCondition().toString());\n //startActivity(thisIntent);\n\n }\n\n });\n\n }\n });\n\n\n }\n\n @Override\n public void onFailure(@Nonnull ApolloException e) {\n Log.d(\"onResponse\", e.toString());\n }\n });\n\n return patientList;\n }", "private void search_fillPatientFoundData(patient toDisplay) {\r\n if (toDisplay != null) {\r\n JOptionPane.showMessageDialog(this, \"Filling in Information for Patient Found\",\r\n \"Filling in Info\", JOptionPane.DEFAULT_OPTION);\r\n\r\n // true = yes, false = no policy\r\n String policy;\r\n if (toDisplay.isPolicy())\r\n policy = \"Yes\";\r\n else\r\n policy = \"No\";\r\n\r\n // Appointment Tab\r\n app_lookUpAppointmentTextField.setText(MainGUI.pimsSystem.lookUpAppointmentDate(toDisplay));\r\n app_patientNameTextField.setText(toDisplay.getL_name() + \", \" + toDisplay.getF_name());\r\n\r\n // Patient Info Tab\r\n pInfo_lastNameTextField.setText(toDisplay.getL_name());\r\n pInfo_firstNameTextField.setText(toDisplay.getF_name());\r\n pInfo_middleNameTextField.setText(toDisplay.getM_name());\r\n pInfo_ssnTextField.setText(Integer.toString(toDisplay.getSSN()));\r\n pInfo_dobTextField.setText(toDisplay.getDob());\r\n pInfo_phoneNumberTextField.setText(toDisplay.getP_number());\r\n pInfo_addressTextField.setText(toDisplay.getAddress());\r\n pInfo_cityTextField.setText(toDisplay.getCity());\r\n pInfo_zipCodeTextField.setText(Integer.toString(toDisplay.getZip()));\r\n pInfo_stateComboBox.setSelectedItem(toDisplay.getState());\r\n pInfo_userField.setText(toDisplay.getUser_name());\r\n pInfo_pwField.setText(toDisplay.getPassword());\r\n pInfo_policyComboBox.setSelectedItem(policy);\r\n\r\n // Billing Tab\r\n billing_fullNameField.setText(toDisplay.getL_name() + \", \" + toDisplay.getF_name());\r\n billing_ssnField.setText(Integer.toString(toDisplay.getSSN()));\r\n billing_policyField.setText(policy);\r\n billing_policyField.setEditable(false);\r\n printHistory(toDisplay);\r\n\r\n selectPatientDialog.setVisible(false);\r\n\r\n repaint();\r\n revalidate();\r\n\r\n } else\r\n JOptionPane.showMessageDialog(this, \"No Patient to Select. Make a search first\",\r\n \"Filling in Info\", JOptionPane.DEFAULT_OPTION);\r\n\r\n }", "public abstract List<LocationDto> match_building_and_type(ScheduleDto schedule, SlotDto slot);", "List<Admission> findPAdmissionBYpatientNumber(String patientNumber, Long hospitalId);", "public interface IPlantDAO {\n\n /**\n * Accept filter, text and return a collection of plants that contain that filter text\n * @param filter the text we want to match in our returned list of plants.\n * @return a list of plants that contain given filter text in either genus, species, cultivar or common name.\n */\n public List<PlantDTO> fetchPlants(String filter);\n\n\n}", "public SearchPatientControl() {\r\n\t\tmasterData.add(new PatientForSearch(\"1000\",\"Neville\",\"Vance\",\"5 Ballymiscaw Road\",\"9733492995\",\"A\"));\r\n\t\tmasterData.add(new PatientForSearch(\"1001\",\"Patricia\",\"Vance\",\"32 Begny Road\",\"9863527465\",\"AB\"));\r\n\t\tmasterData.add(new PatientForSearch(\"1002\",\"Jennifer\",\"Lyttle\",\"21 Lenaghan Crescent\",\"9863549264\",\"B\"));\r\n\t\tmasterData.add(new PatientForSearch(\"1003\",\"Declan\",\"Cranberry\",\"10 Country Road\",\"9788853741\",\"A\"));\r\n\t\tmasterData.add(new PatientForSearch(\"1004\",\"Bryan\",\"Quinn\",\"12 Farmville Road\",\"9677728491\",\"AB\"));\r\n\t\tmasterData.add(new PatientForSearch(\"1005\",\"Amanda\",\"Tom\",\"21 Glenwood\",\"9866743952\",\"B\"));\r\n\t\tmasterData.add(new PatientForSearch(\"1006\",\"Chris\",\"Tom\",\"8 Shipquay Street\",\"9888885326\",\"AB\"));\r\n\t\tmasterData.add(new PatientForSearch(\"1007\",\"James\",\"Symth\",\"11 Cavehill road\",\"9733492995\",\"B\"));\r\n\t\tmasterData.add(new PatientForSearch(\"1008\",\"Stacey\",\"Monro\",\"21 Johnson drive\",\"9863789891\",\"A\"));\r\n\t\tmasterData.add(new PatientForSearch(\"1009\",\"Andrew\",\"Cusack\",\"54 Ulsterville Gardens\",\"9877738369\",\"O\"));\r\n\t\tmasterData.add(new PatientForSearch(\"1010\",\"Fiona\",\"Cusack\",\"19 Donnybrook Street\",\"9863584765\",\"A\"));\r\n\t\tmasterData.add(new PatientForSearch(\"1011\",\"Claire\",\"Hunter\",\"2 Strand road\",\"9872547665\",\"AB\"));\r\n\t\tmasterData.add(new PatientForSearch(\"1012\",\"Maria\",\"Stephenson\",\"8 Glenavy road\",\"9864763524\",\"AB\"));\r\n\t\tmasterData.add(new PatientForSearch(\"1013\",\"Andrew\",\"Simpson\",\"20 Stormount park\",\"9899763574\",\"B\"));\r\n\t\tmasterData.add(new PatientForSearch(\"1014\",\"Tony\",\"Andrews\",\"14 Spencer road\",\"9765112345\",\"A\"));\r\n\t\tmasterData.add(new PatientForSearch(\"1015\",\"Rachel\",\"Stevens\",\"30 Shankhill road\",\"9833274658\",\"O\"));\r\n\t\tmasterData.add(new PatientForSearch(\"1016\",\"Catherine\",\"Stevens\",\"29 Green grove\",\"9855524356\",\"AB\"));\r\n\t\tmasterData.add(new PatientForSearch(\"1017\",\"Timothy\",\"Stevens\",\"73 Meadow lane\",\"9844499998\",\"O\"));\r\n\t\tmasterData.add(new PatientForSearch(\"1018\",\"Allan\",\"Curry\",\"46 Castle muse\",\"9755375869\",\"B\"));\r\n\t\tmasterData.add(new PatientForSearch(\"1019\",\"Jordan\",\"Watson\",\"51 Grey crescent\",\"9863977648\",\"A\"));\r\n\t\tmasterData.add(new PatientForSearch(\"1020\",\"Agnes\",\"Brown\",\"41 Windview drive\",\"9863587654\",\"O\"));\r\n\t}", "private void lookThroughLocations(ArrayList<String> produced){\n int cnt = 0;\n for(int i = 0; i < locations.size(); i++){\n ArrayList<Artefacts> locationArtifacts = locations.get(i).getArtefacts();\n for(int j = 0; j < locationArtifacts.size(); j++){\n for(String k : produced){\n if(locationArtifacts.get(j).getName().equals(k)){\n currentLocation.addArtefactToCurrentLocation(locationArtifacts.get(j));\n locationArtifacts.remove(j);\n }\n }\n }\n }\n for(int i = 0; i < locations.size(); i++){\n ArrayList<Characters> locationCharacters = locations.get(i).getCharacters();\n for(int j = 0; j < locationCharacters.size(); j++){\n for(String k : produced){\n if(locationCharacters.get(j).getName().equals(k)){\n currentLocation.addCharacterToCurrentLocation(locationCharacters.get(j));\n locationCharacters.remove(j);\n }\n }\n }\n }\n }", "ObservableList<Patient> getFilteredPatientList();", "public static Map<String, Long> searchFirstName(){\n boolean keepLooping = true;\n Map<String, Long> outputMap;\n do{\n outputMap = new HashMap<>();\n myScanner.nextLine();\n System.out.println(\"\\nEnter your search string: \\n\");\n String searchTerm = myScanner.next();\n myScanner.nextLine();\n\n for(Contact result : contactObjList){\n String firstName = result.getFirstName();\n if(firstName.toLowerCase().contains(searchTerm.toLowerCase())){\n outputMap.put(result.toContactString(), result.getId());\n }\n }\n if(outputMap.size() == 0){\n System.out.println(\"\\nNo results found.\\n\");\n } else {\n System.out.println(\"\\nHere are your search results:\\n\");\n }\n for(Map.Entry<String, Long> entry : outputMap.entrySet()){\n System.out.println(entry.getKey());\n }\n System.out.println(\"\\n\");\n int userSelect = selectFromList(repeatAction);\n if (userSelect==1){\n keepLooping=false;\n }\n } while(keepLooping);\n return outputMap;\n }", "void findMatchings(boolean isProtein) {\n\n GraphDatabaseFactory dbFactory = new GraphDatabaseFactory();\n HashSet<String > searchSpaceList = new HashSet<>();\n GraphDatabaseService databaseService = dbFactory.newEmbeddedDatabase(graphFile);\n for (int id: queryGraphNodes.keySet()) {\n if(isProtein)\n searchSpaceList.add(queryGraphNodes.get(id).label);\n else\n searchSpaceList.add(String.valueOf(queryGraphNodes.get(id).labels.get(0)));\n }\n for(String x: searchSpaceList) {\n ResourceIterator<Node> xNodes;\n try(Transaction tx = databaseService.beginTx()) {\n xNodes = databaseService.findNodes(Label.label(x));\n tx.success();\n }\n\n while (xNodes.hasNext()) {\n Node node = xNodes.next();\n if (searchSpaceProtein.containsKey(x))\n searchSpaceProtein.get(x).add(node.getId());\n else {\n HashSet<Long> set = new HashSet<>();\n set.add(node.getId());\n searchSpaceProtein.put(x, set);\n }\n }\n\n }\n\n if(isProtein)\n search(0, databaseService, true);\n else\n search(0, databaseService, false);\n databaseService.shutdown();\n }", "List<DeviceDetails> getDevices(Predicate<DeviceDetails> deviceFilter, Predicate<DeviceDetails> deviceFilter2, Predicate<DeviceDetails> deviceFilter3);", "public abstract List<LocationDto> searchLocationType(int loc_type_id);", "public abstract List<LocationDto> searchBuilding(int Building_id);", "public List<Patient> getByName(String name) {\n\t\treturn getByCriterion(Restrictions.or(Restrictions.like(\"firstname\", name), Restrictions.like(\"lastname\", name)));\n\t}", "public UserPatientExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public ArrayList<Flight> SearchPreferFlight1(double maxprice,Date date, String depar,String arriv){\n ArrayList<Flight> result= new ArrayList<>();\n //System.out.println(\"in_search1\\n\");\n System.out.print(maxprice + \" \");\n System.out.print(date + \" \");\n System.out.print(depar + \" \");\n System.out.print(arriv + \"\\n\");\n for(Airliners airliner:airlDir.getAirlinersList()){\n //System.out.printf(\"result of if airls eaquals is:\"+airliner.equals(airls)+\"\\n\");\n for(Flight flyt:airliner.getFleetlist()){\n System.out.print(flyt.getPrice() + \" \");\n System.out.print(flyt.getDate() + \" \");\n System.out.print(flyt.getFromlocaltion() + \" \");\n System.out.print(flyt.getTolocation() + \"\\n\");\n if( (flyt.getPrice()<=maxprice || maxprice==-1) \n &&(depar.equals(\"\")||depar.equals(flyt.getFromlocaltion()))\n &&(arriv.equals(\"\")||arriv.equals(flyt.getTolocation()))\n &&(date==null || date.equals(flyt.getDate())) ) \n {\n result.add(flyt);\n }\n } \n \n }\n System.out.printf(\"resultlist size:%d\",result.size());\n return result;\n \n }", "public static void main(String[] args) throws RuntimeException, URISyntaxException\r\n {\n String latitude = \"53.3498\";\r\n String longitude = \"6.2603\";\r\n String radius = \"500\";\r\n int resultsPerPage = 50;\r\n\r\n try\r\n {\r\n // Perform the search by calling the searchTrips method\r\n LocationResultTrips resultSet = Nearby.searchTrips(latitude, longitude, radius, resultsPerPage);\r\n\r\n // Loop through the results and print each attribute of each individual result in the set\r\n for (int i = 0; i < resultSet.results.size(); i++)\r\n {\r\n System.out.println(\"ID: \"\r\n + resultSet.results.get(i).tripDetails.tripID);\r\n System.out.println(\"Name: \"\r\n + resultSet.results.get(i).tripDetails.tripName);\r\n System.out.println(\"URL: \"\r\n + resultSet.results.get(i).tripDetails.tripURL);\r\n System.out.println(\"Submitted: \" + resultSet.results\r\n .get(i).tripDetails.submittedDate);\r\n\r\n System.out.println(\"Start Date: \" + resultSet.results\r\n .get(i).tripSchedule.startDate);\r\n System.out.println(\"End Date: \"\r\n + resultSet.results.get(i).tripSchedule.endDate);\r\n\r\n System.out.println(\"User ID: \"\r\n + resultSet.results.get(i).user.userID);\r\n System.out.println(\"User Name: \"\r\n + resultSet.results.get(i).user.userName);\r\n System.out.println(\"User Profile Page: \"\r\n + resultSet.results.get(i).user.userURL);\r\n\r\n System.out.println(\"\\n\");\r\n }\r\n }\r\n\r\n catch (IllegalArgumentException | IllegalStateException | IOException e)\r\n {\r\n e.printStackTrace();\r\n }\r\n }", "List<DeviceDetails> getDevices(Predicate<DeviceDetails> deviceFilter, Predicate<DeviceDetails> deviceFilter1);", "Match getMatches();", "List<CustDataNotesResponseDTO> searchForCustDataNotes(CustDataNotesRequestDTO custDataNotesRequestDTO) throws Exception;", "PatientInfo getPatientInfo(int patientId);", "@ApiOperation(value = \"Api Endpoint to search for the Patient record - Only using User name\")\n @GetMapping(\"search\")\n @LogExecutionTime\n public List<PatientDto> searchPatientRecords(@RequestParam(name = \"search\") String search,\n @RequestParam(name = \"page\", defaultValue = \"0\") int page,\n @RequestParam(name = \"limit\", defaultValue = \"10\") int limit,\n @RequestParam(name = \"orderBy\", defaultValue = \"asc\") String orderBy) {\n return patientService.searchPatientRecords(search, page, limit, orderBy);\n }", "@Override\n\tpublic Collection<Patient> searchByName(String query) {\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n System.out.print(\"masukkan jumlah antenna= \");\n Integer countAntenna = input.nextInt();\n Antenna[] myAntenna = new Antenna[countAntenna];\n for(Integer i = 0; i<myAntenna.length;i++){\n System.out.print(\"point x antenna ke \"+ (i+1)+ \" = \");\n Integer pointX = input.nextInt();\n System.out.print(\"point y antenna ke \"+ (i+1)+ \" = \" );\n Integer pointY = input.nextInt();\n myAntenna[i] = new Antenna(pointX,pointY);\n }\n\n for (Integer i=0; i<myAntenna.length;i++){\n// System.out.println(myAntenna[i].radius.size());\n System.out.println(myAntenna[i].toString());\n }\n\n Set<String> intersection = myAntenna[0].radius;\n for(Integer i=0; i<myAntenna.length;i++){\n intersection.retainAll(myAntenna[i].radius);\n }\n\n System.out.print(\"hasil area irisan = \" + intersection);\n }", "List<Location> selectByExample(LocationExample example);", "@Override\n\tpublic List<AppointmentDto> getAppointmentForPhysician(String confirmationStatus1, String confirmationStatus2, int physicianId) {\n\t\t// TODO Auto-generated method stub\n\t\ttry{\n\t\t\treturn jdbcTemplate.query(FETCH_BY_PHYS, (rs, rownnum)->{\n\t\t\t\treturn new AppointmentDto(rs.getInt(\"appointmentId\"),rs.getTime(\"startTime\"), rs.getTime(\"endTime\"), rs.getDate(\"date\"), rs.getInt(\"physicianId\"), rs.getInt(\"userId\"), rs.getInt(\"productId\"),rs.getString(\"confirmationStatus\"), rs.getString(\"zip\"),rs.getString(\"cancellationReason\"), rs.getString(\"additionalNotes\"), rs.getBoolean(\"hasMeetingUpdate\"),rs.getBoolean(\"hasMeetingExperienceFromSR\"),rs.getBoolean(\"hasMeetingExperienceFromPH\"), rs.getBoolean(\"hasPitch\"));\n\t\t\t}, confirmationStatus1, confirmationStatus2, physicianId);\n\t\t}catch(DataAccessException e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "public static Patient[] getPatientListFromSequentialFile(String filename) throws IOException {\n\t\tPatient[] patientInfo = new Patient[150];\n\t\tScanner inputStream = null;\n\t\tint patientCounter = 0;\n\t\tString ramq;\n\t\tString firstName;\n\t\tString lastName;\n\t\tString telephone;\n\t\tString medScheme;\n\t\tString medNumber;\n\t\tString medName;\n\t\tString condition;\n\t\tMedication medication = null;\n\n\t\ttry {\n\t\t\t// If file is not found, throws IOException\n\t\t\tBufferedReader bufferedReader = new BufferedReader(\n\t\t\t\t\tnew InputStreamReader(new FileInputStream(filename), StandardCharsets.UTF_8));\n\n\t\t\tinputStream = new Scanner(bufferedReader);\n\t\t\tString record = null;\n\n\t\t\t// Loop for getting all the records.\n\t\t\twhile (inputStream.hasNext()) {\n\n\t\t\t\trecord = inputStream.nextLine().trim();\n\n\t\t\t\tif (!record.isEmpty()) {\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// Getting and splitting data from row\n\t\t\t\t\t\tString[] recordArray = record.split(\"\\\\*\");\n\n\t\t\t\t\t\t// If array has too little or too much data\n\t\t\t\t\t\t// skips over rest of current loop\n\t\t\t\t\t\tif ((recordArray.length < 3) || (recordArray.length > 8)) {\n\t\t\t\t\t\t\tthrow new IllegalArgumentException(\"The record contains too much or too little data.\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tramq = recordArray[0].trim();\n\t\t\t\t\t\tfirstName = recordArray[1].trim();\n\t\t\t\t\t\tlastName = recordArray[2].trim();\n\n\t\t\t\t\t\t// Attempting to create a patient using the data given.\n\t\t\t\t\t\t// Sets telephone, medication, etc if present.\n\n\t\t\t\t\t\tpatientInfo[patientCounter] = new ClinicPatient(firstName, lastName, ramq);\n\n\t\t\t\t\t\t// Checks if telephone number is present, sets it.\n\t\t\t\t\t\tif (recordArray.length >= 4) {\n\t\t\t\t\t\t\ttelephone = recordArray[3].trim();\n\t\t\t\t\t\t\tpatientInfo[patientCounter].setTelephoneNumber(Optional.of(telephone));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Checks if medication is present, sets it.\n\t\t\t\t\t\tif (recordArray.length >= 7) {\n\t\t\t\t\t\t\tmedScheme = recordArray[4].trim();\n\t\t\t\t\t\t\tmedNumber = recordArray[5].trim();\n\t\t\t\t\t\t\tmedName = recordArray[6].trim();\n\n\t\t\t\t\t\t\t// Checking to make sure all aspects of medication\n\t\t\t\t\t\t\t// exist, then set it.\n\t\t\t\t\t\t\tif ((!medScheme.equals(\"\")) && (!medNumber.equals(\"\")) && (!medName.equals(\"\"))) {\n\t\t\t\t\t\t\t\tif (medScheme.equalsIgnoreCase(\"DIN\")) {\n\t\t\t\t\t\t\t\t\tmedication = new DINMedication(medNumber, medName);\n\t\t\t\t\t\t\t\t\tpatientInfo[patientCounter].setMedication(Optional.of(medication));\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\telse if (medScheme.equalsIgnoreCase(\"NDC\")) {\n\t\t\t\t\t\t\t\t\tmedication = new NDCMedication(medNumber, medName);\n\t\t\t\t\t\t\t\t\tpatientInfo[patientCounter].setMedication(Optional.of(medication));\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\tif (recordArray.length == 8) {\n\t\t\t\t\t\t\tcondition = recordArray[7].trim();\n\n\t\t\t\t\t\t\t// if condition exists, set it\n\t\t\t\t\t\t\tif (!condition.equals(\"\")) {\n\t\t\t\t\t\t\t\tpatientInfo[patientCounter].setExistingConditions(Optional.of(condition));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Moves patient array index up.\n\t\t\t\t\t\tpatientCounter++;\n\n\t\t\t\t\t} // End of Try\n\t\t\t\t\tcatch (IllegalArgumentException iae) {\n\t\t\t\t\t\tSystem.out.println(\"The following record caused an error.\");\n\t\t\t\t\t\tSystem.out.println(record);\n\t\t\t\t\t\tSystem.out.println(iae.getMessage() + \"\\n\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t} // end of if statement is not empty\n\n\t\t\t} // end of while\n\n\t\t\t// } // end of if statement\n\n\t\t\tpatientInfo = resizePatient(patientInfo, patientCounter);\n\n\t\t\treturn patientInfo;\n\t\t} // end of try\n\t\tcatch (IOException e) {\n\t\t\tthrow new IOException(\"File not found.\\n\" + e.getMessage() + \"\\n\");\n\t\t} finally {\n\t\t\tif (inputStream != null)\n\t\t\t\tinputStream.close();\n\t\t}\n\n\t}", "@Override\n public Set PatientsWithCaughingAndFever() {\n Set<Patient> patients = new HashSet<>();\n patientRepository.findAll().forEach(patients::add);\n Set<Patient>coughingAndFever = new HashSet<>();\n if(patients != null)\n {\n patients.forEach((patient) ->\n {\n if(patient.getPatientMedicalRecord().getSymptoms().equals(\"Coughing\") || patient.getPatientMedicalRecord().getSymptoms().equals(\"Fever\")){\n coughingAndFever.add(patient);\n }else {\n System.out.println(\"No older patients with symptoms such as caughing and fever\");\n }\n });\n }\n\n return coughingAndFever;\n }", "public Match search(Fingerprint fpProbe, Fingerprint[] db) {\n FingerprintMatcher matcher = new FingerprintMatcher(\n new FingerprintTemplate(\n new FingerprintImage(\n fpProbe.getImg(),\n new FingerprintImageOptions()\n .dpi(500))));\n \n double highScore = 0;\n Match match = new Match(false);\n for (Fingerprint candidate : db) {\n double score = matcher.match(convertFingerprintToTemplate(candidate));\n if (score > highScore)\n {\n highScore = score;\n if (score > threshold) {\n match = new Match(true, candidate, highScore);\n }\n }\n }\n return match;\n }", "public MyStringBuilder2 [] regMatch(String [] pats)\n\t{\n\t\t//System.out.print(\"hi\");\n\t\t\tMyStringBuilder2[] answers = new MyStringBuilder2[pats.length];\n\t\t\tMyStringBuilder2[] finals = new MyStringBuilder2[pats.length];\n\t\t\tfinals = recursiveArrayAdd(finals, pats, 0);\n\t\t\tif(finals[0] == null) {\n\t\t\t\tfinals = null;\n\t\t\t}\n\t\t\treturn finals;\n\t\t\n\t}", "public abstract List<ClinicalDocument> findByPatientId(long patientId);", "public ArrayList<Literal> lookAround(String agName){\r\n\t\tperceptModel = MapEnv.model;\r\n\t\tArrayList<Literal> lookArr = new ArrayList<Literal>();\r\n\t\tint \t id \t \t = perceptModel.getAgentID(agName);\r\n\t\tLocation lplayer \t = perceptModel.getAgPos(id); \r\n\t\tif(agName != null){\r\n\t\t\t/** Searching direct neighbours to the Agent's location*/\r\n\t\t\tfor(int y = -1; y <= 1; y++){\r\n\t\t\t\tfor(int x = -1; x <= 1; x++){\r\n\t\t\t\t\tif(!(x == 0 && y == 0)){\r\n\t\t\t\t\t\tLocation l = new Location(lplayer.x + x, lplayer.y + y);\r\n//\t\t\t\t\t\tSystem.out.println(\"Player 1 Loc: (\" + lplayer.x + \",\" + lplayer.y + \"):: See Loc (\" + l.x + \",\" + l.y + \")\");\r\n\t\t\t\t\t\tif(perceptModel.getAgAtPos(l) != -1){\r\n\t\t\t\t\t\t\tint agt = perceptModel.getAgAtPos(l);\r\n\t\t\t\t\t\t\tString plyr = perceptModel.getAgName(agt);\r\n\t\t\t\t\t\t\t/** Detects and adds nearby agents flagholder status perception */\r\n\t\t\t\t\t\t\tif(perceptModel.flag.agentCarrying == perceptModel.getAgentID(plyr)){\r\n\t\t\t\t\t\t\t\tLiteral nfh = Literal.parseLiteral(\"flagholder(\" + plyr + \")\");\r\n\t\t\t\t\t\t\t\tlookArr.add(nfh);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tLiteral np = Literal.parseLiteral(\"close(\" + plyr + \")\"); \r\n\t\t\t\t\t\t\t\tlookArr.add(np);\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\t/** Searching an single space further in the cardinal directions*/\r\n\t\t\tfor(int y = -2; y <= 2; y+=4){\r\n\t\t\t\tfor(int x = -2; x <= 2; x+=4){\r\n\t\t\t\t\tLocation l = new Location(lplayer.x + x, lplayer.y + y);\r\n\t//\t\t\t\tSystem.out.println(\"Player Loc: (\" + lplayer.x + \",\" + lplayer.y + \"):: See Loc (\" + l.x + \",\" + l.y + \")\");\r\n\t\t\t\t\tif(perceptModel.getAgAtPos(l) != -1 ){\r\n\t\t\t\t\t\tint \tagt = perceptModel.getAgAtPos(l);\r\n\t\t\t\t\t\tString plyr = perceptModel.getAgName(agt);\r\n\t\t\t\t\t\t/** Detects and adds nearby agents flagholder status perception */\r\n\t\t\t\t\t\tif(perceptModel.flag.agentCarrying == perceptModel.getAgentID(plyr)){\r\n\t\t\t\t\t\t\tLiteral nfh = Literal.parseLiteral(\"flagholder(\" + plyr + \")\");\r\n\t\t\t\t\t\t\tlookArr.add(nfh);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tLiteral np = Literal.parseLiteral(\"close\" + plyr + \")\"); \r\n\t\t\t\t\t\t\tlookArr.add(np);\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\t/** Returns completed ArrayList */ \r\n\t\t\treturn lookArr;\r\n\t\t} else return null;\r\n\t}", "List<Location> getLocations(String coverageType);", "public PatientDetails getSinglePatientDetails(String searchString, EntityManagerFactory entityManagerFactory) {\n String ID = searchString.split(\",\")[0].trim();\n\n EntityManager entityManager = entityManagerFactory.createEntityManager();\n\n Query query_record = entityManager.createNamedQuery(PATIENT_PHR_QUERY);\n query_record.setParameter(\"id\",ID);\n\n long start = System.currentTimeMillis();\n PatientDetails healthRecord = (PatientDetails) query_record.getSingleResult();\n System.out.println(\"\\n** PHR generated in --> \" + (System.currentTimeMillis()-start) + \" msec\");\n\n entityManager.close();\n return healthRecord;\n }", "public ArrayList<Document> politicalSearch(String Politicals)\n {\n ArrayList<Document> users = new ArrayList<Document>();\n try{\n IndexReader reader = DirectoryReader.open(FSDirectory.open(Paths.get(\"indice/\")));\n IndexSearcher searcher = new IndexSearcher(reader);\n Analyzer analyzer = new StandardAnalyzer();\n QueryParser parser = new QueryParser(\"text\",analyzer);\n Query query = parser.parse(Politicals);\n TopDocs result = searcher.search(query,25000);\n ScoreDoc[] hits =result.scoreDocs;\n for (int i = 0; i < hits.length; i++){\n Document doc = searcher.doc(hits[i].doc);\n if(Integer.parseInt(doc.get(\"userFollowersCount\")) > 1000){\n users.add(doc);\n }\n }\n reader.close();\n }\n catch(IOException | ParseException ex){\n Logger.getLogger(Lucene.class.getName()).log(Level.SEVERE,null,ex);\n }\n return users;\n }", "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 }", "public Keeper[] searchByQualification(String qualification){\r\n ArrayList<Keeper> keeperList = new ArrayList<>();\r\n for(Keeper keeper:keepers){\r\n if(keeper.hasQualification(qualification)){\r\n keeperList.add(keeper);\r\n }\r\n }\r\n if(keeperList.isEmpty()){return null;}\r\n return keeperList.toArray(new Keeper[keeperList.size()]); \r\n }", "@Override\r\n\tpublic ArrayList<SchoolValue> getValuesFiltered(Boolean searchByPcode, String pCode, Double radius, Boolean searchByDistrict, String district, Boolean searchByString, String search, Boolean searchByClassSize, int minSize, int maxSize) {\r\n\t\t// 3 preps here, for defensive coding (not bothering to search for something if it's null) and to fill latitude, longitude\r\n\t\t// pCode prep\r\n\t\tLatLong aLatLong = null;\r\n\t\tDouble latitude = 0.0;\r\n\t\tDouble longitude = 0.0;\r\n\t\tif (pCode != null) {\r\n\t\t\taLatLong = findLatLong(pCode);\r\n\t\t\tif (aLatLong != null) {\r\n\t\t\t\tlatitude = aLatLong.getLatitude();\r\n\t\t\t\tlongitude = aLatLong.getLongitude();\r\n\t\t\t} else {\r\n\t\t\t\tsearchByPcode = false;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tsearchByPcode = false;\r\n\t\t}\r\n\t\t\r\n\t\t// district prep\r\n\t\tif (district == null)\r\n\t\t\tsearchByDistrict = false;\r\n\t\t\r\n\t\t// search prep\r\n\t\tif (search == null)\r\n\t\t\tsearchByString = false;\r\n\t\t\r\n\t\t// populate a list of districts \r\n\t\tArrayList<District> districts = BCDistricts.getInstance().getDistricts();\r\n\r\n\t\t// populate a list of schools from districts\r\n\t\tArrayList<School> schools = new ArrayList<School>();\r\n\t\tfor (int i = 0; i<districts.size();i++) {\r\n\t\t\tschools.addAll(districts.get(i).schools);\r\n\t\t}\r\n\t\t\r\n\t\t// populate a list of schoolvalues from schools, filtering\r\n\t\tArrayList<SchoolValue> schoolValues = new ArrayList<SchoolValue>();\r\n\t\t\r\n\t\tfor (int i = 0; i<schools.size();i++) {\r\n\t\t\tSchool school = schools.get(i);\r\n\t\t\t// (!searching || result) && (!searching || result) && (!searching || result)\r\n\t\t\t// T T => T, T F => F, F T => T, F F => T\r\n\t\t\t// for a filter component to pass, either we're not searching for something (ignore result)\r\n\t\t\t// or we are and result is true, thus (!searching || result) && (...) format\r\n\t\t\tif ((!searchByPcode || areWithinRange(latitude, longitude, school.getLat(), school.getLon(), radius)) && // TODO: EXTRACT TESTING METHOD\r\n\t\t\t\t(!searchByDistrict || stringMatchesTo(district, school.getDistrict().name)) &&\r\n\t\t\t\t(!searchByString || ( stringMatchesTo(search, school.getName()) ||\r\n\t\t\t\t\t\t\t\t\t\tstringMatchesTo(search, school.getLocation()) || \r\n\t\t\t\t\t\t\t\t\t\tstringMatchesTo(search, school.getDistrict().name))) &&\r\n\t\t\t\t(!searchByClassSize || ((school.getClassSize() >= minSize) && (school.getClassSize() <= maxSize)))) { \r\n\r\n\t\t\tschoolValues.add(school.getEquivSchoolValue());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// TODO: ADD SORTING\r\n\t\t}\r\n\t\t\r\n\t\treturn schoolValues;\r\n\t}", "public ArrayList<AddressEntry> searchByNote(String text) {\r\n ArrayList<AddressEntry> textMatches = new ArrayList<AddressEntry>();\r\n text = text.toLowerCase();\r\n for (AddressEntry current : contacts) {\r\n String currentname = current.getNote().toLowerCase();\r\n if (currentname.contains(text)) {\r\n textMatches.add(current);\r\n }\r\n }\r\n return textMatches;\r\n }", "public List<PrsMain> listPatients() {\n Log.info(LifeCARDAdmin.class.getName() + \":listPatients()\");\n\n List<PrsMain> list;\n String sql = \"SELECT p.* FROM prs_main p where p.prsid IN (SELECT l.prsid FROM lc_main l where l.prsid>0 and l.prsid is not null)\";\n Query query = em.createNativeQuery(sql, PrsMain.class);\n try {\n list = query.getResultList();\n } catch (PersistenceException pe) {\n Log.warning(LifeCARDAdmin.class.getName() + \":listPatients():\" + pe.getMessage());\n return null;\n }\n return list;\n }", "public void careForPatient(Patient patient);", "public List<Patient> getPatients() {\n List<Patient> patients = new ArrayList<>();\n String query = \"SELECT * FROM PATIENTS\";\n try (PreparedStatement ps = this.transaction.prepareStatement(query); ResultSet rs = ps.executeQuery()) {\n while (rs.next()) {\n patients.add(new Patient(rs));\n }\n } catch (SQLException ex) {\n ex.printStackTrace(System.out);\n }\n\n return patients;\n }", "@Override\n public Set<Restaurant> getMatches(String queryString) {\n\n /* Setup grammar listener */\n CharStream stream = new ANTLRInputStream(queryString);\n QueryLexer lexer = new QueryLexer(stream);\n TokenStream tokens = new CommonTokenStream(lexer);\n QueryParser parser = new QueryParser(tokens);\n ParseTree tree = parser.root();\n ParseTreeWalker walker = new ParseTreeWalker();\n\n // Setup custom walker\n QueryCreator creator = new QueryCreator();\n walker.walk(creator, tree);\n\n Set<Restaurant> matches = new HashSet<Restaurant>();\n RestaurantHandle rH = creator.getHandle();\n Expression expTree = creator.getExpression();\n\n // Look through every restaurant, if one matches query add it to the set\n for (Restaurant r : this.restaurantMap.values()) {\n rH.setRestaurant(r);\n if (expTree.eval()) {\n matches.add(r);\n }\n }\n\n return matches;\n }", "public static Visit[] getVisitListFromSequentialFile(String filename, Patient[] patientList)\n\t\t\tthrows IOException, IllegalArgumentException, NullPointerException {\n\t\tVisit[] visitInfo = new Visit[150];\n\t\tScanner inputStream = null;\n\t\tint visitCounter = 0;\n\t\tString ramq;\n\t\t\n\t\tint patientLocation;\n\t\tint year = 0;\n\t\tint month = 0;\n\t\tint day = 0;\n\t\tint hour = 0;\n\t\tint min = 0;\n\t\tint priorityCode;\n\t\tString yearStr;\n\t\tString monthStr;\n\t\tString dayStr;\n\t\tString hourStr;\n\t\tString minStr;\n\t\tString priorityCodeStr;\n\t\tString complaint;\n\n\t\ttry {\n\t\t\tBufferedReader bufferedReader = new BufferedReader(\n\t\t\t\t\tnew InputStreamReader(new FileInputStream(filename), StandardCharsets.UTF_8));\n\n\t\t\tinputStream = new Scanner(bufferedReader);\n\t\t\tString record = null;\n\n\t\t\t// Gets the RAMQ only from patient list\n\t\t\t// Will throw a NullPoiterException if patientList is null.\n\t\t\tif (patientList == null)\n\t\t\t{\n\t\t\t\tthrow new NullPointerException(\"Patient list is null.\");\n\t\t\t}\n\t\t\tString[] ramqArray = new String[patientList.length];\n\t\t\tfor (int i = 0; i < patientList.length; i++) {\n\t\t\t\tramqArray[i] = patientList[i].getRamq().getRamq();\n\t\t\t}\n\t\t\t\n\t\t\twhile (inputStream.hasNext()) {\n\n\t\t\t\trecord = inputStream.nextLine().trim();\n\n\t\t\t\tif (!record.isEmpty()) {\n\n\t\t\t\t\ttry {\n\n\t\t\t\t\t\tString[] recordArray = record.split(\"\\\\*\");\n\t\t\t\t\t\tif ((recordArray.length < 6) || (recordArray.length > 13)) {\n\t\t\t\t\t\t\tthrow new IllegalArgumentException(\"The record contains too much or too little data.\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tramq = recordArray[0];\n\n\t\t\t\t\t\t// Checks if RAMQ exists in patient file, gets location\n\t\t\t\t\t\tpatientLocation = ListUtilities.binarySearch(ramqArray, ramq);\n\n\t\t\t\t\t\tif (patientLocation == -1) {\n\t\t\t\t\t\t\tthrow new IllegalArgumentException(\"The record RAMQ is not a patient.\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Will be valid because patientList is valid\n\t\t\t\t\t\tvisitInfo[visitCounter] = new ClinicVisit(patientList[patientLocation]);\n\n\t\t\t\t\t\t// Represents the registration date\n\t\t\t\t\t\tyearStr = recordArray[1];\n\t\t\t\t\t\tmonthStr = recordArray[2];\n\t\t\t\t\t\tdayStr = recordArray[3];\n\t\t\t\t\t\thourStr = recordArray[4];\n\t\t\t\t\t\tminStr = recordArray[5];\n\n\t\t\t\t\t\tif ((!yearStr.equals(\"\")) && (!monthStr.equals(\"\")) && (!dayStr.equals(\"\"))\n\t\t\t\t\t\t\t\t&& (!hourStr.equals(\"\")) && (!minStr.equals(\"\"))) {\n\t\t\t\t\t\t\t// Attempting to parse ints for localdatetime\n\t\t\t\t\t\t\tyear = Integer.parseInt(yearStr);\n\t\t\t\t\t\t\tmonth = Integer.parseInt(monthStr);\n\t\t\t\t\t\t\tday = Integer.parseInt(dayStr);\n\t\t\t\t\t\t\thour = Integer.parseInt(hourStr);\n\t\t\t\t\t\t\tmin = Integer.parseInt(minStr);\n\n\t\t\t\t\t\t\tLocalDateTime registrationTime = LocalDateTime.of(year, month, day, hour, min);\n\t\t\t\t\t\t\tvisitInfo[visitCounter].setRegistrationDateAndTime(Optional.of(registrationTime));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Checks if triage date is present, sets it.\n\t\t\t\t\t\tif (recordArray.length >= 11) {\n\t\t\t\t\t\t\t// Represents the triage date\n\t\t\t\t\t\t\tyearStr = recordArray[6];\n\t\t\t\t\t\t\tmonthStr = recordArray[7];\n\t\t\t\t\t\t\tdayStr = recordArray[8];\n\t\t\t\t\t\t\thourStr = recordArray[9];\n\t\t\t\t\t\t\tminStr = recordArray[10];\n\n\t\t\t\t\t\t\tif ((!yearStr.equals(\"\")) && (!monthStr.equals(\"\")) && (!dayStr.equals(\"\"))\n\t\t\t\t\t\t\t\t\t&& (!hourStr.equals(\"\")) && (!minStr.equals(\"\"))) {\n\t\t\t\t\t\t\t\t// Attempting to parse ints for localdatetime\n\t\t\t\t\t\t\t\tyear = Integer.parseInt(yearStr);\n\t\t\t\t\t\t\t\tmonth = Integer.parseInt(monthStr);\n\t\t\t\t\t\t\t\tday = Integer.parseInt(dayStr);\n\t\t\t\t\t\t\t\thour = Integer.parseInt(hourStr);\n\t\t\t\t\t\t\t\tmin = Integer.parseInt(minStr);\n\n\t\t\t\t\t\t\t\tLocalDateTime triageTime = LocalDateTime.of(year, month, day, hour, min);\n\t\t\t\t\t\t\t\tvisitInfo[visitCounter].setTriageDateAndTime(Optional.of(triageTime));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Checks if priority is present, sets it.\n\t\t\t\t\t\tif (recordArray.length >= 12) {\n\t\t\t\t\t\t\tpriorityCodeStr = recordArray[11];\n\n\t\t\t\t\t\t\tif (!priorityCodeStr.equals(\"\")) {\n\t\t\t\t\t\t\t\tpriorityCode = Integer.parseInt(priorityCodeStr);\n\t\t\t\t\t\t\t\tvisitInfo[visitCounter].setPriority(Priority.getPriorityCode(priorityCode));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Checks if complaint is present, sets it.\n\t\t\t\t\t\tif (recordArray.length == 13) {\n\t\t\t\t\t\t\tcomplaint = recordArray[12];\n\t\t\t\t\t\t\tif (!complaint.equals(\"\")) {\n\t\t\t\t\t\t\t\tvisitInfo[visitCounter].setComplaint(Optional.of(complaint));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvisitCounter++;\n\t\t\t\t\t} catch (IllegalArgumentException iae) {\n\t\t\t\t\t\tSystem.out.println(\"The following record caused an error.\");\n\t\t\t\t\t\tSystem.out.println(record);\n\t\t\t\t\t\tSystem.out.println(iae.getMessage() + \"\\n\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} catch (DateTimeException dte) {\n\t\t\t\t\t\tSystem.out.println(\"The following record caused an error.\");\n\t\t\t\t\t\tSystem.out.println(record);\n\t\t\t\t\t\tSystem.out.println(dte.getMessage() + \"\\n\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t} // end if record is not empty\n\n\t\t\t} // end of while loop\n\t\t\tvisitInfo = resizeVisit(visitInfo, visitCounter);\n\n\t\t\treturn visitInfo;\n\t\t}\n\n\t\tcatch (IOException e) {\n\t\t\tthrow new IOException(\"File not found.\\n\" + e.getMessage());\n\t\t} catch (NullPointerException n) {\n\t\t\tthrow new NullPointerException(n.getMessage());\n\t\t} finally {\n\t\t\tif (inputStream != null)\n\t\t\t\tinputStream.close();\n\t\t}\n\n\t}", "static AnalysisResult analyseQueryComponents(ArrayList<String> components) {\n if (components != null && components.size() > 0) {\n for (int i = 0; i < components.size(); i++) {\n String component = components.get(i).toLowerCase();\n for (String attack : commonAttacks) {\n attack = attack.toLowerCase();\n if (trim(component).contains(trim(attack))) {\n return new AnalysisResult(true, i, attack, false);\n }\n }\n }\n }\n return new AnalysisResult(false, null, null, false);\n }", "public ArrayList<String> findCamps(String searchTerm) {\n if(searchTerm.equals(\"*\")) {\n return new ArrayList<>(landmarks.getCamps().keySet());\n }\n\n searchTerm = searchTerm.toLowerCase();\n ArrayList<String> results = new ArrayList<>();\n for(String campName : landmarks.getCamps().keySet()) {\n if(campName.toLowerCase().contains(searchTerm)) {\n results.add(campName);\n }\n }\n return results;\n }", "@Override\r\n\tpublic List<Object[]> plantAdvanceSearch(String plant) {\n\t\tString hql=null;\r\n\t\tif(plant.equalsIgnoreCase(\"ALL\"))\r\n\t\t{\r\n\t\t\thql=\"select p.plantId ,p.plantName,p.add1,p.add2,p.add3,p.city,p.state,p.phone,p.fax,p.mobile,p.organization,p.countrysList from Plant p\";\r\n\t \r\n\t\t}\r\n\t\t\r\n\t\tif(!plant.equalsIgnoreCase(\"ALL\"))\r\n\t\t{\t\r\n\t\thql=\"select p.plantId ,p.plantName,p.add1,p.add2,p.add3,p.city,p.state,p.phone,p.fax,p.mobile,p.organization,p.countrysList from Plant p where \"+plant;\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t List<Object[]> list=getHibernateTemplate().find(hql);\r\n\t\r\n\t\t\treturn list;\t\r\n\t}", "List<Corretor> search(String query);", "public List<Patient> getFHIR() {\n IGenericClient client;\n FhirContext ctx;\n ctx = FhirContext.forDstu3();\n ctx.setRestfulClientFactory(new OkHttpRestfulClientFactory(ctx));\n client = ctx.newRestfulGenericClient(\"http://fhirtest.uhn.ca/baseDstu3\");\n\n // .lastUpdated(new DateRangeParam(\"2011-01-01\",\"2018-11-25\")) - to get latest data\n // Not used since unable to get proper records with names\n Bundle bundle = client.search().forResource(Patient.class)\n .where(Patient.NAME.isMissing(false))\n .and(Patient.BIRTHDATE.isMissing(false))\n .and(Patient.GENDER.isMissing(false))\n .sort().ascending(Patient.NAME)\n .count(10)\n .returnBundle(Bundle.class)\n .execute();\n return BundleUtil.toListOfResourcesOfType(ctx, bundle, Patient.class);\n }", "public List<Location> searchLocations(String search) {\n Query query = entityManager.createQuery(\"select loc from Location loc where loc.code like :search or loc.name like :search or loc.shortName like :search order by loc.locationId\");\r\n query.setParameter(\"search\", \"%\" + search + \"%\");\r\n return query.getResultList();\r\n\t\t/*\r\n Session session = (Session) getEntityManager().getDelegate();\r\n Criteria crit = session.createCriteria(Location.class);\r\n // If this is not set in a hibernate many-to-many criteria query, we'll get multiple results of the same object\r\n crit.setResultTransformer(Criteria.ROOT_ENTITY);\r\n Criterion name = Restrictions.ilike(\"name\", \"%\" + search + \"%\");\r\n Criterion shortName = Restrictions.ilike(\"shortName\", \"%\" + search + \"%\");\r\n Criterion code = Restrictions.ilike(\"code\", \"%\" + search + \"%\");\r\n Criterion shortCode = Restrictions.ilike(\"shortCode\", \"%\" + search + \"%\");\r\n LogicalExpression orExpName = Restrictions.or(name,shortName);\r\n LogicalExpression orExpCode = Restrictions.or(code,shortCode);\r\n LogicalExpression orExpNameCode = Restrictions.or(orExpName,orExpCode);\r\n crit.add(orExpNameCode);\r\n return crit.list();\r\n */\r\n\t}", "@Override\r\n\tpublic List<Person> meetCriteria(List<Person> persons) {\n\t\tList<Person> firstCriteriaItem = criteria.meetCriteria(persons);\r\n\t\tList<Person> otherCriteriaItem = otherCriteria.meetCriteria(persons);\r\n\t\t\r\n\t\tfor(Person person: otherCriteriaItem)\r\n\t\t{\r\n\t\t\tif(!(firstCriteriaItem.contains(person)))\r\n\t\t\t\tfirstCriteriaItem.add(person);\r\n\t\t}\r\n\t\t\r\n\t\treturn firstCriteriaItem;\r\n\t\t\r\n\t\t}", "public static void main (String[] args) {\n\t\t\n\t\tint[] array = new int[] {2, 4, 1, 6, 5, 40, -1};\n\t\tint[] result = search(array);\n\t\t\n\t\tif (result != null) {\n\t\t\tfor (int i = 0; i < result.length; i++) {\n\t\t\t\tSystem.out.println(result[i]);\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"No results found\");\n\t\t}\n\t}", "public abstract List<LocationDto> search_type_building\n (BuildingDto building, LocationTypeDto type);", "List<Patient> findAllPatients();", "public static ArrayList<XYLocation> findPath2(String CHAR1, String CHAR2,CampusRouteFindingModel campusModel) {\n\t\t ArrayList<XYLocation> retrn = new ArrayList<XYLocation>();\n\t\t graph<String, Float> g = campusModel.getGraph();\n\t\t Map<String, String> idFirst = campusModel.getName();\n\t\t Map<String,String> nameFirst = campusModel.getID();\n\t\t Map<String, XYLocation> locations = campusModel.getLocations();\n\t\t if(!(nameFirst.containsKey(CHAR1))&&(!(idFirst.containsKey(CHAR1)))) { \n\t\t\t if(!(nameFirst.containsKey(CHAR2))&&(!(idFirst.containsKey(CHAR2)))) {\n\t\t\t\t if (CHAR1.equals(CHAR2)) {\n\t\t\t\t\t retrn.add(locations.get(CHAR1));\n\t\t\t\t\t return retrn;\n\t\t\t\t }\n\t\t\t\t retrn.add(locations.get(CHAR1));\n\t\t\t\t retrn.add(locations.get(CHAR2));\n\t\t\t\t return retrn;\n\t\t\t }\n\t\t\t retrn.add(locations.get(CHAR1));\n\t\t\t return retrn;\n\t\t\t}\n\t\t\tif(!(nameFirst.containsKey(CHAR2))&&(!(idFirst.containsKey(CHAR2)))) {\n\t\t\t\tretrn.add(locations.get(CHAR2));\n\t\t\t\treturn retrn;\n\t\t\t}\n\t\tif (nameFirst.containsKey(CHAR1)) {\n\t\t\tCHAR1 = nameFirst.get(CHAR1);\n\t\t}\n\t\tif (nameFirst.containsKey(CHAR2)) {\n\t\t\tCHAR2 = nameFirst.get(CHAR2);\n\t\t}\n\t\tretrn.add(locations.get(CHAR1));\n\t\tif (!(CHAR1.equals(CHAR2))) {\n\t\t\tArrayList<edges<String, Double>> tmp = Dijkstra(CHAR1,CHAR2,g);\n\t\t\tif (tmp==null) {\n\t\t\t\tretrn.add(locations.get(CHAR1));\n\t\t\t\tretrn.add(locations.get(CHAR1));\n\t\t\t\treturn retrn;\n\t\t\t}\n\t\t\tIterator<edges<String, Double>> print = tmp.iterator();\n\t\t\tprint.next();\n\t\t\twhile (print.hasNext()) {\n\t\t\t\tedges<String, Double> temp = print.next();\n\t\t\t\tretrn.add(locations.get(temp.getDest()));\n\t\t\t}\n\t\t}\n\t\treturn retrn;\n\t}", "public Person[] getPatientsByStateOfHealth(int state) {\n int count = 0;\n for(int i = 0; i < listOfPatients.length; i++)\n {\n if(listOfPatients[i].getStateOfHealth() == state)\n count++;\n }\n \n if(count == 0)\n return null;\n\n int index = 0;\n Person[] patientsByStateOfHealth = new Person[count];\n for(int i = 0; i < listOfPatients.length; i++)\n {\n if(listOfPatients[i].getStateOfHealth() == state)\n patientsByStateOfHealth[index++] = listOfPatients[i];\n }\n\n return patientsByStateOfHealth;\n }", "public static ArrayList<Result> search(HashMap<String,ArrayList<String>> map) {\n result = new ArrayList<>();\n finalResult = new ArrayList<>();\n \n String input = map.get(\"search\").get(0);\n searchByName(input);\n \n ArrayList<String> type = map.get(\"type\");\n if(type.isEmpty());\n else for(String t:type){\n searchByType(t);\n result = finalResult;\n }\n \n //<editor-fold defaultstate=\"collapsed\" desc=\"FILTERS\">\n ArrayList<ArrayList<String>> filters = new ArrayList<>();\n filters.add(map.get(\"brand\"));\n filters.add(map.get(\"price\"));\n filters.add(map.get(\"os\"));\n filters.add(map.get(\"memory\"));\n filters.add(map.get(\"storage\"));\n filters.add(map.get(\"numberOfSimSlots\"));\n filters.add(map.get(\"f_camera\"));\n filters.add(map.get(\"b_camera\"));\n /**\n * ArrayList of filters from Mobile Phone\n * 0 = Brand | brand\n * 1 = Price | price\n * 2 = OS | os\n * 3 = Memory | memory\n * 4 = Storage | storage\n * 5 = SIM slots | numberOfSimSlots\n * 6 = Camera front | f_camera\n * 7 = Camera back | b_camera\n */\n int filterMode = 0;\n while(filterMode<filters.size()){\n// for(Result r:result){\n// System.out.println(r.getMP().getFullName());\n// }\n// System.out.println(\"filtermode: \"+filterMode);\n finalResult = new ArrayList<>();\n if(filters.get(filterMode).isEmpty()||filters.get(filterMode).get(0).equals(\"\")){\n filterMode++;\n continue;\n }\n filter(filterMode,filters.get(filterMode++));\n result = finalResult;\n }\n //</editor-fold>\n return result;\n }", "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 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 }", "@Override public ArrayList<Sample> getAllPatientSamples(Patient patient)\n {\n try\n {\n return clientDoctor.getAllPatientSamples(patient);\n }\n catch (RemoteException e)\n {\n throw new RuntimeException(\"Error while fetching samples. Please try again.\");\n }\n }", "List<Accessprofile> listWithCritera(SearchCriteria searchCriteria);" ]
[ "0.56921357", "0.5653478", "0.5557091", "0.5504451", "0.5398518", "0.5328897", "0.52936584", "0.5252072", "0.52350986", "0.5226935", "0.52259034", "0.52126396", "0.5198702", "0.51922464", "0.51600516", "0.5154581", "0.50925267", "0.5078189", "0.50575805", "0.50433266", "0.5041498", "0.5035766", "0.50214416", "0.5020049", "0.501541", "0.5015342", "0.49799606", "0.49795735", "0.49741", "0.4962471", "0.49609366", "0.49534154", "0.4947384", "0.4946625", "0.4941618", "0.49388143", "0.4936037", "0.49350598", "0.49322262", "0.49236238", "0.49220788", "0.49103102", "0.49055046", "0.490188", "0.48947307", "0.48922968", "0.48515487", "0.48496574", "0.4845056", "0.4839359", "0.48316744", "0.4831135", "0.48296013", "0.48285198", "0.48214567", "0.48205224", "0.48158428", "0.48090023", "0.47986504", "0.47857523", "0.47755125", "0.47700247", "0.47699648", "0.47639057", "0.47633862", "0.47579303", "0.4751737", "0.47513092", "0.47482318", "0.47434297", "0.47432125", "0.47290444", "0.47139958", "0.47129592", "0.4708752", "0.47025508", "0.46991587", "0.4698365", "0.46960264", "0.46919206", "0.4691284", "0.46879822", "0.46866462", "0.46796325", "0.46776044", "0.46743593", "0.465899", "0.46538872", "0.46523395", "0.46501333", "0.46445227", "0.46438855", "0.4643652", "0.46360993", "0.46325934", "0.46307322", "0.46284497", "0.46280518", "0.46264714", "0.46226966", "0.46182945" ]
0.0
-1
Builds SessionFactory from database properties file.
private static SessionFactory buildSessionFactory() { try { Configuration configuration = new Configuration(); Properties properties = new Properties(); properties.load(AuthDao.class.getResourceAsStream("/db.properties")); configuration.setProperties(properties); // configuration.addAnnotatedClass(Driver.class); // configuration.addAnnotatedClass(DriverStatusChange.class); // configuration.addAnnotatedClass(Freight.class); // configuration.addAnnotatedClass(Location.class); configuration.addAnnotatedClass(Manager.class); // configuration.addAnnotatedClass(Order.class); // configuration.addAnnotatedClass(OrderDriver.class); // configuration.addAnnotatedClass(OrderWaypoint.class); // configuration.addAnnotatedClass(Truck.class); // configuration.addAnnotatedClass(Waypoint.class); ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()).build(); return configuration.buildSessionFactory(serviceRegistry); } catch (IOException e) { e.printStackTrace(); throw new ExceptionInInitializerError(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void createSessionFactory() {\n\t\ttry {\n\t\t\tif (sessionFactory == null) {\n\n\t\t\t\tProperties properties = new Properties();\n\t\t\t\tproperties.load(ClassLoader.getSystemResourceAsStream(\"hibernate.properties\"));\n\n\t\t\t\tConfiguration configuration = new Configuration();\n\t\t\t\tEntityScanner.scanPackages(\"musala.schoolapp.model\").addTo(configuration);\n\t\t\t\tconfiguration.mergeProperties(properties).configure();\n\t\t\t\tStandardServiceRegistry builder = new StandardServiceRegistryBuilder()\n\t\t\t\t\t\t.applySettings(configuration.getProperties()).build();\n\t\t\t\tsessionFactory = configuration.buildSessionFactory(builder);\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tSystem.out.println(\"Failed to create session factory object.\");\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "private static SessionFactory buildSessionFactory() {\n\t\t// Creating Configuration Instance & Passing Hibernate Configuration File\n\t\tConfiguration configObj = new Configuration();\n\t\tconfigObj.configure(\"hibernate.cfg.xml\");\n\n\t\t// Since Hibernate Version 4.x, ServiceRegistry Is Being Used\n\t\tServiceRegistry serviceRegistryObj = new StandardServiceRegistryBuilder()\n\t\t\t\t.applySettings(configObj.getProperties()).build();\n\n\t\t// Creating Hibernate SessionFactory Instance\n\t\tsessionFactoryObj = configObj.buildSessionFactory(serviceRegistryObj);\n\t\treturn sessionFactoryObj;\n\t}", "private static SessionFactory buildSessionFactory() {\n Configuration configObj = new Configuration();\n configObj.configure(\"hibernate.cfg.xml\");\n\n ServiceRegistry serviceRegistryObj = new StandardServiceRegistryBuilder().applySettings(configObj.getProperties()).build();\n\n // Creating Hibernate SessionFactory Instance\n sessionFactoryObj = configObj.buildSessionFactory(serviceRegistryObj);\n return sessionFactoryObj;\n }", "private static SessionFactory buildSessionFactory() {\n\t\ttry {\n\t\t\t// Create the SessionFactory from hibernate.cfg.xml\n\t\t\tConfiguration configuration = new Configuration().configure();\n\t\t\tServiceRegistry serviceRegistry = new ServiceRegistryBuilder()\n\t\t\t\t\t.applySettings(configuration.getProperties())\n\t\t\t\t\t.buildServiceRegistry();\n\t\t\tSessionFactory sessionFactory = configuration\n\t\t\t\t\t.buildSessionFactory(serviceRegistry);\n\t\t\treturn sessionFactory;\n\t\t} catch (Throwable ex) {\n\t\t}\n\t\treturn null;\n\t}", "private static SessionFactory buildSessionFact() {\n try {\n\n return new Configuration().configure(\"hibernate.cfg.xml\").buildSessionFactory();\n\n \n } catch (Throwable ex) {\n \n System.err.println(\"Initial SessionFactory creation failed.\" + ex);\n throw new ExceptionInInitializerError(ex);\n }\n }", "private static SessionFactory buildSessionFactory() {\n\t\ttry {\n\t\t\tConfiguration config = new Configuration().configure(); \n\t\t\tServiceRegistry serviceRegistry =\n\t\t\t\t\tnew StandardServiceRegistryBuilder()\n\t\t\t.applySettings(config.getProperties()).build();\n\n\t\t\tHibernatePBEEncryptorRegistry registry = HibernatePBEEncryptorRegistry.getInstance();\n\t\t\t\n\t\t\tStandardPBEStringEncryptor myEncryptor = new StandardPBEStringEncryptor();\n\t\t\t// FIXME : this is insecure and needs to be fixed\n\t\t\tmyEncryptor.setPassword(\"123\");\n\t\t\tregistry.registerPBEStringEncryptor(\"myHibernateStringEncryptor\", myEncryptor);\n\t\t\t\n\t\t\t\n\t\t\treturn config.buildSessionFactory(serviceRegistry); \n\t\t}\n\t\tcatch (Throwable ex) {\n\t\t\t// Make sure you log the exception, as it might be swallowed\n\t\t\tSystem.err.println(\"Initial SessionFactory creation failed.\" + ex);\n\t\t\tthrow new ExceptionInInitializerError(ex);\n\t\t}\n\t}", "protected abstract SessionFactory buildSessionFactory() throws Exception;", "private static SessionFactory buildSessionFactory() {\n\t\ttry {\r\n\t\t\tConfiguration config=new Configuration();\r\n\t\t\tconfig.addClass(Customer.class);\r\n\t\t\treturn config\r\n\t\t\t\t\t.buildSessionFactory(new StandardServiceRegistryBuilder().build());\r\n\t\t} catch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tthrow new RuntimeException(\"error building sessions\");\r\n\t\t}\r\n\t}", "public static SessionFactory getSessionFactory() {\n\t\tConfiguration configObj = new Configuration();\n\t\tconfigObj.addAnnotatedClass(com.training.org.User.class);\n\t\tconfigObj.configure(\"hibernate.cfg.xml\");\n\t\t\n\t\t\n\t\n\n\t\t// Since Hibernate Version 4.x, Service Registry Is Being Used\n\t\tServiceRegistry serviceRegistryObj = new StandardServiceRegistryBuilder().applySettings(configObj.getProperties()).build(); \n\n\t\t// Creating Hibernate Session Factory Instance\n\t\tSessionFactory factoryObj = configObj.buildSessionFactory(serviceRegistryObj);\t\t\n\t\treturn factoryObj;\n\t}", "public static SessionFactory getSessionFactory() {\r\n\t\tConfiguration configuration = new Configuration().configure();\r\n\t\tStandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder()\r\n\t\t\t\t.applySettings(configuration.getProperties());\r\n\t\tSessionFactory sessionFactory = configuration\r\n\t\t\t\t.buildSessionFactory(builder.build());\r\n\t\treturn sessionFactory;\r\n\t}", "public static SessionFactory getSessionFactory() {\n\n if(sessionFactory == null) {\n try {\n MetadataSources metadataSources = new MetadataSources(configureServiceRegistry());\n\n addEntityClasses(metadataSources);\n\n sessionFactory = metadataSources.buildMetadata()\n .getSessionFactoryBuilder()\n .build();\n\n } catch (Exception e) {\n e.printStackTrace();\n if(registry != null)\n StandardServiceRegistryBuilder.destroy(registry);\n }\n }\n\n return sessionFactory;\n }", "private SessionFactoryUtil() {\r\n try {\r\n LOG.info(\"Configurando hibernate.cfg.xml\");\r\n CfgFile cfgFile = new CfgFile();\r\n Configuration configure = new Configuration().configure(new File(cfgFile.getPathFile()));\r\n cfgFile.toBuildMetaData(configure);\r\n ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(configure.getProperties()).build();\r\n sessionFactory = configure.buildSessionFactory(serviceRegistry);\r\n LOG.info(\"Configuracion se cargo a memoria de forma correcta\");\r\n } // try\r\n catch (Exception e) {\r\n Error.mensaje(e);\r\n } // catch\r\n }", "@SuppressWarnings({ \"deprecation\"})\r\n\tpublic static SessionFactory getSessionFactory() \r\n\t{\r\n //configuration object\r\n Configuration configuration=new Configuration();\r\n //configuring xml file\r\n \tconfiguration.configure(\"hibernate.cfg.xml\");\r\n \t//SessionFactory object\r\n \tsessionFactory=configuration.buildSessionFactory();\r\n //returning sessonFactory+\r\n return sessionFactory;\r\n }", "public synchronized static SessionFactory createSessionFactory() {\r\n\r\n if (sessionFactory == null) {\r\n LOG.debug(MODULE + \"in createSessionFactory\");\r\n sessionFactory = new Configuration().configure().buildSessionFactory();\r\n// ApplicationContext appcontext = ApplicationContextProvider.getApplicationContext();\r\n// sessionFactory = (SessionFactory) appcontext.getBean(\"sessionFactory\");\r\n LOG.debug(MODULE + \"sessionFactory created\");\r\n }\r\n\r\n return sessionFactory;\r\n }", "static void initialize() {\n final StandardServiceRegistry registry = new StandardServiceRegistryBuilder()\r\n .configure() // configures settings from hibernate.cfg.xml\r\n .build();\r\n try {\r\n sessionFactory = new MetadataSources( registry ).buildMetadata().buildSessionFactory();\r\n }\r\n catch (Exception e) {\r\n StandardServiceRegistryBuilder.destroy( registry );\r\n }\r\n }", "static void initialize() {\n final StandardServiceRegistry registry = new StandardServiceRegistryBuilder()\n .configure() // configures settings from hibernate.cfg.xml\n .build();\n try {\n sessionFactory = new MetadataSources( registry ).buildMetadata().buildSessionFactory();\n }\n catch (Exception e) {\n StandardServiceRegistryBuilder.destroy( registry );\n }\n }", "public static SessionFactory getSessionFactory() {\n if (sessionFactory == null) sessionFactory = buildSessionFactory();\n return sessionFactory;\n }", "public static SessionFactory getSessionFactory() {\r\n\t\t/*\r\n\t\t * Instead of a static variable, use JNDI: SessionFactory sessions =\r\n\t\t * null; try { Context ctx = new InitialContext(); String jndiName =\r\n\t\t * \"java:hibernate/HibernateFactory\"; sessions =\r\n\t\t * (SessionFactory)ctx.lookup(jndiName); } catch (NamingException ex) {\r\n\t\t * throw new InfrastructureException(ex); } return sessions;\r\n\t\t */\r\n\t\treturn sessionFactory;\r\n\t}", "public DBCredentials() {\n try {\n // Get the inputStream\n InputStream inputStream = this.getClass().getClassLoader()\n .getResourceAsStream(file);\n\n Properties properties = new Properties();\n\n // load the inputStream using the Properties\n properties.load(inputStream);\n // get the value of the property\n this.dbUser = properties.getProperty(\"Username\");\n this.dbPassword = properties.getProperty(\"Password\");\n this.dbUrl = properties.getProperty(\"DataBase\");\n\n } catch (IOException e) {\n System.out.println(\"IOException\");\n e.printStackTrace();\n }\n }", "public static void rebuildSessionFactory() {\r\n\t\t\ttry {\r\n\t\t\t\t\r\n\t\t\t\tserviceRegistry = new ServiceRegistryBuilder().applySettings(\r\n\t\t\t\t\t\tcfg.getProperties()).buildServiceRegistry();\r\n\t\t\t\tsessionFactory = cfg.buildSessionFactory(serviceRegistry);\r\n\t\t\t\t\r\n\r\n\t\t\t} catch (Throwable ex) {\r\n\t\t\t\tSystem.err.println(\"Failed to create sessionFactory object.\" + ex);\r\n\t\t\t\tthrow new ExceptionInInitializerError(ex);\r\n\t\t\t}\r\n\t\t}", "@Inject\n private DataStore() {\n final StandardServiceRegistry registry = new StandardServiceRegistryBuilder()\n .configure()\n .build();\n try {\n sessionFactory = new MetadataSources(registry).buildMetadata().buildSessionFactory();\n } catch (Exception e) {\n LOGGER.error(\"Fehler beim initialisieren der Session\", e);\n StandardServiceRegistryBuilder.destroy(registry);\n }\n \n }", "@Profile(\"production\")\r\n @Bean\r\n @DependsOn(\"SessionFactory\") \r\n public EshopDAOImpl getLocaleDAO(SessionFactory sessionFactory, DataSource dataSource) { \r\n \r\n EshopDAOImpl instanceDAOImpl = new EshopDAOImpl();\r\n \r\n //Inject datasource for JDBC.\r\n// instanceDAOImpl.setDataSource(dataSource); \r\n \r\n //Initialize reference to a SessionFactoryBean for database's methods. \r\n instanceDAOImpl.setSessionFactory(sessionFactory);\r\n \r\n return instanceDAOImpl; \r\n }", "private ConnectionFactoryDefinition loadConnectionFactory(XMLStreamReader reader) throws XMLStreamException {\n\n ConnectionFactoryDefinition connectionFactory = new ConnectionFactoryDefinition();\n\n connectionFactory.setName(reader.getAttributeValue(null, \"name\"));\n\n String create = reader.getAttributeValue(null, \"create\");\n if (create != null) {\n connectionFactory.setCreate(CreateOption.valueOf(create));\n }\n loadProperties(reader, connectionFactory, \"connectionFactory\");\n\n return connectionFactory;\n\n }", "public void init() {\n\t\tProperties prop = new Properties();\n\t\tInputStream propStream = this.getClass().getClassLoader().getResourceAsStream(\"db.properties\");\n\n\t\ttry {\n\t\t\tprop.load(propStream);\n\t\t\tthis.host = prop.getProperty(\"host\");\n\t\t\tthis.port = prop.getProperty(\"port\");\n\t\t\tthis.dbname = prop.getProperty(\"dbname\");\n\t\t\tthis.schema = prop.getProperty(\"schema\");\n\t\t\tthis.passwd=prop.getProperty(\"passwd\");\n\t\t\tthis.user=prop.getProperty(\"user\");\n\t\t} catch (IOException e) {\n\t\t\tString message = \"ERROR: db.properties file could not be found\";\n\t\t\tSystem.err.println(message);\n\t\t\tthrow new RuntimeException(message, e);\n\t\t}\n\t}", "Database getDatabase(Properties properties, ApplicationContext applicationContext);", "@Autowired\n\t@Bean(name=\"sessionFactory\")\n\tpublic SessionFactory getSessionFactory(DataSource dataSource) {\n\t\tLocalSessionFactoryBuilder sessionBuilder = new LocalSessionFactoryBuilder(dataSource);\n\t\tsessionBuilder.addAnnotatedClasses(Korisnik.class, Rola.class, Predmet.class\n\t\t\t\t, PredmetKorisnika.class, Tema.class, Materijal.class, Komentar.class);\n\t\tsessionBuilder.addProperties(getHibernateProperties());\n\t\t\n\t\treturn sessionBuilder.buildSessionFactory();\n\t}", "public static SessionFactory getSessionFactory() {\n\t\tif (sessionFactory == null) {\n\t\t\tcreateSessionFactory();\n\t\t}\n\t\treturn sessionFactory;\n\t}", "private Properties getDbProperties() {\n if (dbProperties == null) {\n // like ~/Dropbox/ACM-UWR/config.properties\n File propertiesFile = getSandbox().inputFile(pathsProvider.getProgramConfigFile().toPath());\n if (propertiesFile.exists()) {\n try {\n BufferedInputStream in = new BufferedInputStream(\n new FileInputStream(propertiesFile));\n Properties props = new Properties();\n props.load(in);\n dbProperties = props;\n } catch (IOException e) {\n throw new RuntimeException(\"Unable to load configuration file: \"\n + propertiesFile.getName(), e);\n }\n }\n }\n return dbProperties;\n }", "private static List<Configuration> configure() {\n Map<String, Configuration> configurations = new HashMap<String, Configuration>();\n try {\n Enumeration<URL> resources = Thread.currentThread().getContextClassLoader().getResources(\"jorm.properties\");\n \n while (resources.hasMoreElements()) {\n URL url = resources.nextElement();\n \n Database.get().log.debug(\"Found jorm configuration @ \" + url.toString());\n \n Properties properties = new Properties();\n InputStream is = url.openStream();\n properties.load(is);\n is.close();\n \n String database = null;\n String destroyMethodName = null;\n String dataSourceClassName = null;\n Map<String, String> dataSourceProperties = new HashMap<String, String>();\n int priority = 0;\n \n for (Entry<String, String> property : new TreeMap<String, String>((Map) properties).entrySet()) {\n String[] parts = property.getKey().split(\"\\\\.\");\n if (parts.length < 3 || !parts[0].equals(\"database\")) {\n continue;\n }\n if (database != null && !parts[1].equals(database)) {\n try {\n Configuration conf = configurations.get(database);\n if (conf == null || conf.priority < priority) {\n conf = new Configuration(database, dataSourceClassName, dataSourceProperties, destroyMethodName, priority);\n configurations.put(database, conf);\n Database.get().log.debug(\"Configured \" + conf);\n }\n } catch (Exception ex) {\n Database.get().log.warn(\"Failed to configure database: \" + ex.getMessage());\n }\n database = parts[1];\n destroyMethodName = null;\n dataSourceClassName = null;\n dataSourceProperties = new HashMap<String, String>();\n priority = 0;\n }\n\n if (parts.length == 3 && parts[2].equals(\"destroyMethod\")) {\n destroyMethodName = property.getValue();\n } else if (parts.length == 3 && parts[2].equals(\"priority\")) {\n try {\n priority = Integer.parseInt(property.getValue().trim());\n } catch (Exception ex) {\n \n }\n } else if (parts[2].equals(\"dataSource\")) {\n if (parts.length == 3) {\n dataSourceClassName = property.getValue();\n } else if (parts.length == 4) {\n dataSourceProperties.put(parts[3], property.getValue());\n } else {\n Database.get().log.warn(\"Invalid DataSource property '\" + property.getKey() + \"'\");\n }\n } else {\n Database.get().log.warn(\"Invalid property '\" + property.getKey() + \"'\");\n }\n }\n \n if (database != null) {\n try {\n Configuration conf = configurations.get(database);\n if (conf == null || conf.priority < priority) {\n conf = new Configuration(database, dataSourceClassName, dataSourceProperties, destroyMethodName, priority);\n configurations.put(database, conf);\n Database.get().log.debug(\"Configured \" + conf);\n }\n } catch (Exception ex) {\n Database.get().log.warn(\"Failed to configure database: \" + ex.getMessage());\n }\n }\n }\n \n for (Entry<String, Configuration> entry : configurations.entrySet()) {\n entry.getValue().apply();\n Database.get().log.debug(\"Configured \" + configuration);\n }\n } catch (IOException ex) {\n Database.get().log.warn(\"Failed to configure database: \" + ex.getMessage()); \n }\n \n return new ArrayList<Configuration>(configurations.values());\n }", "@Profile(\"development\")\r\n @Bean\r\n @DependsOn(\"SessionFactory\") \r\n public EshopDAOImpl getDevLocaleDAO(SessionFactory sessionFactory, DataSource dataSource) { \r\n \r\n EshopDAOImpl instanceDAOImpl = new EshopDAOImpl(); \r\n \r\n //Initialize reference to a SessionFactoryBean for database's methods. \r\n instanceDAOImpl.setSessionFactory(sessionFactory);\r\n \r\n return instanceDAOImpl; \r\n }", "public static SessionFactory getSessionFactory() {\n\t\treturn sessionFactory;\r\n\t}", "public static SessionFactory getSessionFactory() {\n \t\n \treturn sessionFactory;\n }", "public static DAOFactory getInstance() throws DAOConfigurationException {\n\t\tProperties properties = new Properties();\n\t\tString url;\n\t\tString driver;\n\t\tString username;\n\t\tString password;\n\n\t\tClassLoader classLoader = Thread.currentThread().getContextClassLoader();\n\t\tInputStream PropertiesFile = classLoader.getResourceAsStream(DAOFactory.PROPERTIES_FILE);\n\n\t\tif (PropertiesFile == null) {\n\t\t\tthrow new DAOConfigurationException(\n\t\t\t\t\t\"The properties_file \" + DAOFactory.PROPERTIES_FILE + \" is nowhere to find.\");\n\t\t}\n\n\t\ttry {\n\t\t\tproperties.load(PropertiesFile);\n\t\t\turl = properties.getProperty(DAOFactory.PROPERTY_URL);\n\t\t\tdriver = properties.getProperty(DAOFactory.PROPERTY_DRIVER);\n\t\t\tusername = properties.getProperty(DAOFactory.PROPERTY_USERNAME);\n\t\t\tpassword = properties.getProperty(DAOFactory.PROPERTY_PASSWORD);\n\t\t} catch (IOException e) {\n\t\t\tthrow new DAOConfigurationException(\"Could not load properties_file \" + DAOFactory.PROPERTIES_FILE, e);\n\t\t}\n\n\t\ttry {\n\t\t\tClass.forName(driver);\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tthrow new DAOConfigurationException(\"The driver was not found in the classpath.\", e);\n\t\t}\n\t\tDAOFactory instance = new DAOFactory(url, username, password);\n\t\treturn instance;\n\t}", "@Bean\r\n\tpublic SessionFactory getSessionFactory(DataSource dataSource) {\r\n\t\tLocalSessionFactoryBuilder sessionBuilder = new LocalSessionFactoryBuilder(dataSource);\r\n\t\t// -> getting the properties for hibernate\r\n\t\tsessionBuilder.addProperties(getHibernateProperties());\r\n\t\t// -> fully qualified name of the package that contains entity\r\n\t\tsessionBuilder.scanPackages(packageToScan);\r\n\t\treturn sessionBuilder.buildSessionFactory();\r\n\t}", "private static synchronized void lazyinit()\n {\n try\n {\n if (sessionFactory == null)\n {\n System.out.println(\"Going to create SessionFactory \");\n sessionFactory = new Configuration().configure().buildSessionFactory();\n// sessionFactory.openSession();\n System.out.println(\"Hibernate could create SessionFactory\");\n }\n } catch (Throwable t)\n {\n System.out.println(\"Hibernate could not create SessionFactory\");\n t.printStackTrace();\n }\n }", "public void loadConfiguration() {\n Properties prop = new Properties();\n String propFileName = \".env_\" + this.dbmode.name().toLowerCase();\n InputStream inputStream = getClass().getClassLoader().getResourceAsStream(propFileName);\n try {\n if (inputStream != null) {\n prop.load(inputStream);\n } else {\n System.err.println(\"property file '\" + propFileName + \"' not found in the classpath\");\n }\n this.jdbc = prop.getProperty(\"jdbc\");\n this.host = prop.getProperty(\"host\");\n this.port = prop.getProperty(\"port\");\n this.database = prop.getProperty(\"database\");\n this.user = prop.getProperty(\"user\");\n this.password = prop.getProperty(\"password\");\n // this.sslFooter = prop.getProperty(\"sslFooter\");\n } catch (Exception e) {\n System.err.println(\"can't read property file\");\n }\n try {\n inputStream.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void setSessionFactory(SessionFactory sessionFactory) {\n template = new HibernateTemplate(sessionFactory);\n}", "public static void inicializarBD() {\n\t\ts = new StandardServiceRegistryBuilder().configure().build();\r\n\t\tsf = new MetadataSources(s).buildMetadata().buildSessionFactory();\r\n\t}", "public interface DatabaseFactory {\r\n\r\n Database makeDatabase();\r\n}", "private void createDbConfig (String address) {\n\t\tProperties dbConfig = new Properties();\n\t\t\n\t\t/*\n\t\t * Load any previous version of the property file at the address.\n\t\t */\n\t\tFile dbConfigFile = new File(address);\n\t\ttry {\n\t\t\t/*\n\t\t\t * Creates file/directory if it could not be found\n\t\t\t */\n\t\t\tif(dbConfigFile.getParentFile().mkdirs()) System.err.println(\"[WARNING] Database properties directory location was missing and has been created.\");\n\t\t\tif(dbConfigFile.createNewFile()) System.err.println(\"[WARNING] Database properties file was missing and has been created.\");\n\t\t\t\n\t\t\tFileReader dbConfigReader = new FileReader(dbConfigFile);\n\t\t\tdbConfig.load(dbConfigReader);\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"[ERROR]: Could not initialize database properties file: \" + address);\n\t\t\tSystem.err.println(e.getMessage());\n\t\t}\n\t\t\n\t\t/*\n\t\t * Check to see if any properties are missing.\n\t\t */\n\t\tif(!dbConfig.containsKey(\"useLocal\")) dbConfig.put(\"useLocal\", \"true\");\n\t\t\n\t\t//AWS DynamoDB settings\n\t\tif(!dbConfig.containsKey(\"dynamoDbAccessKey\")) dbConfig.put(\"dynamoDbAccessKey\", \"\");\n\t\tif(!dbConfig.containsKey(\"dynamoDbSecretKey\")) dbConfig.put(\"dynamoDbSecretKey\", \"\");\n\t\tif(!dbConfig.containsKey(\"dynamoDbEndpoint\")) dbConfig.put(\"dynamoDbEndpoint\", \"\");\n\t\tif(!dbConfig.containsKey(\"dynamoDbRegion\")) dbConfig.put(\"dynamoDbRegion\", \"\");\n\t\t\n\t\t//AWS KMS settings\n\t\tif(!dbConfig.containsKey(\"kmsAccessKey\")) dbConfig.put(\"kmsAccessKey\", \"\");\n\t\tif(!dbConfig.containsKey(\"kmsSecretKey\")) dbConfig.put(\"kmsSecretKey\", \"\");\n\t\tif(!dbConfig.containsKey(\"kmsEndpoint\")) dbConfig.put(\"kmsEndpoint\", \"\");\n\t\tif(!dbConfig.containsKey(\"kmsRegion\")) dbConfig.put(\"kmsRegion\", \"\");\n\t\t\n\t\t//Google Drive Settings\n\t\tif(!dbConfig.containsKey(\"driveClientId\")) dbConfig.put(\"driveClientId\", \"\");\n\t\tif(!dbConfig.containsKey(\"driveClientSecret\")) dbConfig.put(\"driveClientSecret\", \"\");\n\t\t\n\n\t\tthis.databaseConfig = dbConfig;\n\t\t\n\t\t/*\n\t\t * Save any changes\n\t\t */\n\t\tthis.saveDbConfig();\n\t}", "public static SessionFactory getSessionFactory() {\n\t\treturn sessionFactory;\n\t}", "public PensionParametersDAO(Configuration properties) {\n this.properties = properties;\n\n }", "private void buildDialectConfigurationMap() {\n Map dialectProperties = new HashMap();\r\n this.chainedProperties.mapStartsWith( dialectProperties,\r\n \"drools.dialect\",\r\n false );\r\n setDefaultDialect( (String) dialectProperties.remove( \"drools.dialect.default\" ) );\r\n\r\n ClassLoader classLoader = Thread.currentThread().getContextClassLoader();\r\n for ( Iterator it = dialectProperties.entrySet().iterator(); it.hasNext(); ) {\r\n Entry entry = (Entry) it.next();\r\n String str = (String) entry.getKey();\r\n String dialectName = str.substring( str.lastIndexOf( \".\" ) + 1 );\r\n String dialectClass = (String) entry.getValue();\r\n addDialect( dialectName,\r\n dialectClass );\r\n }\r\n }", "public NationalityDAO() {\n //sessionFactory = HibernateUtil.getSessionFactory();\n session=HibernateUtil.openSession();\n }", "private HibernateToListDAO(){\r\n\t\tfactory = new AnnotationConfiguration().addPackage(\"il.hit.model\") //the fully qualified package name\r\n .addAnnotatedClass(User.class).addAnnotatedClass(Items.class)\r\n .addResource(\"hibernate.cfg.xml\").configure().buildSessionFactory();\r\n\t}", "protected void populateExtranInfoAndCreateFactory() throws MessageBusException {\n\t\tString filePath = null;\n\n\t\tfilePath = locateFile(\"MessageBus.properties\");\n\t\tif (filePath != null) {\n\t\t\tFile propertyFile = new File(filePath);\n\t\t\tif (propertyFile.exists()) {\n\t\t\t\tProperties mbProperty = loadPropertiesFile(filePath);\n\t\t\t\tconnectionType = mbProperty.getProperty(\"connectionType\");\n\t\t\t\t// If not found in the property file then assume Queue\n\t\t\t\tif (null == connectionType) {\n\t\t\t\t\tconnectionType = IMessageBusConnection.DEFAULT_CONNECTION_TYPE;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tuserName = mbProperty.getProperty(\"userName\");\n\t\t\t\tpassword = mbProperty.getProperty(\"password\");\n\t\t\t\tcertPath = mbProperty.getProperty(\"certPath\");\n\t\t\t\tcertPassword = mbProperty.getProperty(\"certPassword\");\n\n\t\t\t\tif(certPath == null || certPassword == null){\n\t\t\t\t\tthrow new MessageBusException(\"ERROR :: certPath or certPassword is missing from MessageBus.properties\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tthrow new MessageBusException(\"ERROR :: MessageBus.properties is missing from Classapth\");\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new MessageBusException(\"ERROR :: MessageBus.properties is missing from Classapth\");\n\t\t}\n\t\tcreateFactory();\n\t}", "public static Dialect buildDialect(Properties properties, Connection connection) throws HibernateException {\n \t\tString dialectName = properties.getProperty( Environment.DIALECT );\n \t\tif ( dialectName == null ) {\n \t\t\treturn determineDialect( connection );\n \t\t}\n \t\telse {\n \t\t\treturn constructDialect( dialectName );\n \t\t}\n \t}", "public static Dialect getDialect(Properties props) throws HibernateException {\n \t\tString dialectName = props.getProperty( Environment.DIALECT );\n \t\tif ( dialectName == null ) {\n \t\t\treturn getDialect();\n \t\t}\n \t\treturn instantiateDialect( dialectName );\n \t}", "public void afterPropertiesSet() throws Exception {\n\t\tSessionFactory rawSf = buildSessionFactory();\n\t\tthis.sessionFactory = wrapSessionFactoryIfNecessary(rawSf);\n\t\tafterSessionFactoryCreation();\n\t}", "public static void readDBProps()\n throws Exception\n {\n BufferedReader br = new BufferedReader(new FileReader(\"/home/ujjwal/Rasp_Dev/Service/db_mdas.properties\"));\n\t \n Properties props = new Properties();\n props.load(br);\n targetDB = props.getProperty(\"target.db\").trim();\n System.out.println(\"Target DB :\" + getTargetDB());\n dbClass = props.getProperty(targetDB + \".\" + \"dbClass\").trim();\n dbURL = props.getProperty(targetDB + \".\" + \"dbURL\").trim();\n dbUser = props.getProperty(targetDB + \".\" + \"dbUser\").trim();\n dbPass = props.getProperty(targetDB + \".\" + \"dbPass\").trim();\n port = Integer.parseInt(props.getProperty(\"port\"));\n time = Integer.parseInt(props.getProperty(\"time\"));\n gt_cnt = Integer.parseInt(props.getProperty(\"gate_count\"));\n g1 = (props.getProperty(\"gate1\"));\n g2 = (props.getProperty(\"gate2\"));\n g3 = (props.getProperty(\"gate3\"));\n imei = (props.getProperty(\"imei\"));\n System.out.println(dbClass);\n System.out.println(dbURL);\n System.out.println(dbUser);\n Class.forName(dbClass);\n \n //Class.forName(\"com.mysql.jdbc.Driver\");\n }", "public void setupProp() {\r\n\t\tprop = new Properties();\r\n\t\tInputStream in = getClass().getResourceAsStream(\"C:/Users/Marcus/git/EmailProgram/EmailProgram/resources/config.properties\");\r\n\t\ttry {\r\n\t\t\tprop.load(in);\r\n\t\t\tFileInputStream fin = new FileInputStream(\"C:/Users/Marcus/git/EmailProgram/EmailProgram/resources/config.properties\");\r\n\t\t\tObjectInputStream ois = new ObjectInputStream(fin);\r\n\t\t\tdblogic = (PatronDBLogic) ois.readObject();\r\n\t\t\tois.close();\r\n\r\n\t\t} catch (IOException | ClassNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@PostConstruct\r\n public void init() {\n File database = new File(applicationProps.getGeodb());\r\n try {\r\n reader = new DatabaseReader.Builder(database).withCache(new CHMCache()).build();\r\n } catch (IOException e) {\r\n log.error(\"Error reading maxmind DB, \", e);\r\n }\r\n }", "private static DBConnectionFactory createDBConnectionFactory(ConfigurationObject config) {\r\n ConfigurationObject dbConnectionFactoryConfig = Helper.getChildConfig(config,\r\n DB_CONNECTION_FACTORY_CONFIG);\r\n\r\n // Create database connection factory using the extracted configuration\r\n try {\r\n return new DBConnectionFactoryImpl(dbConnectionFactoryConfig);\r\n } catch (UnknownConnectionException e) {\r\n throw new LateDeliverablesTrackerConfigurationException(\r\n \"Fails to create database connection factory.\", e);\r\n } catch (ConfigurationException e) {\r\n throw new LateDeliverablesTrackerConfigurationException(\r\n \"Fails to create database connection factory.\", e);\r\n }\r\n }", "Factory getFactory()\n {\n return configfile.factory;\n }", "@Autowired\n public UsuarioPerfilDaoHibernate(SessionFactory sessionFactory) {\n this.setSessionFactory(sessionFactory);\n }", "private static Properties getProperties() {\n Properties properties = new Properties();\n\n try {\n properties.load(new FileInputStream(\"src/main/resources/hibernate.properties\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n\n return properties;\n }", "public SessionFactory getSessionFactory()\n {\n return sessionFactory;\n }", "@Autowired\n public CuestionarioDaoHibernate(SessionFactory sessionFactory) {\n this.setSessionFactory(sessionFactory);\n }", "@Override\n public void initSessionFactories() {\n super.initSessionFactories();\n\n sessionFactories.put(EntityCache.class, new SessionFactory() {\n\n @Override\n public Class<?> getSessionType() {\n return EntityCache.class;\n }\n @Override\n public Session openSession(CommandContext commandContext) {\n return new EntityCacheImpl();\n }\n });\n }", "private DBManager() throws Exception {\n file = new File(\"pdfLibraryDB.mv.db\");\n if (!file.exists()) {\n conn = connect();\n stmt = conn.createStatement();\n query = \"CREATE TABLE user(username VARCHAR(30) PRIMARY KEY, password VARCHAR(32));\" +\n \"CREATE TABLE category(id VARCHAR(30) PRIMARY KEY, name VARCHAR(30), username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE);\"+\n \"CREATE TABLE favorite(id VARCHAR(30) PRIMARY KEY, path VARCHAR(500), keyword VARCHAR(200), searchType VARCHAR(10), category VARCHAR(30),username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE, FOREIGN KEY(category) REFERENCES category(id) ON UPDATE CASCADE ON DELETE CASCADE);\" +\n \"CREATE TABLE history(id VARCHAR(30) PRIMARY KEY, keyword VARCHAR(200), type VARCHAR(10), directory VARCHAR(500), username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE);\";\n stmt.executeUpdate(query);\n stmt.close();\n conn.close();\n System.out.println(\"DB created!\");\n }\n }", "protected static void setUp() throws Exception {\n // A SessionFactory is set up once for an application!\n final StandardServiceRegistry registry = new StandardServiceRegistryBuilder()\n .configure(\"conflict.cfg.xml\")\n .build();\n try {\n sessionFactory = new MetadataSources(registry).buildMetadata().buildSessionFactory();\n } catch (Exception e) {\n e.printStackTrace();\n StandardServiceRegistryBuilder.destroy(registry);\n }\n }", "protected SessionFactory getSessionFactory() {\n\t\treturn this.sessionFactory;\n\t}", "public static DataSource getMySQLDataSource() {\n\t\tProperties props = new Properties();\n\t\tFileInputStream fis = null;\n\t\tMysqlDataSource mysqlDS = null;\n\t\ttry {\n\t\t\tfis = new FileInputStream(\"db.properties\");\n\t\t\tprops.load(fis);\n\t\t\tmysqlDS = new MysqlDataSource();\n\t\t\tmysqlDS.setURL(props.getProperty(\"MYSQL_DB_URL\"));\n\t\t\tmysqlDS.setUser(props.getProperty(\"MYSQL_DB_USERNAME\"));\n\t\t\tmysqlDS.setPassword(props.getProperty(\"MYSQL_DB_PASSWORD\"));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"db.properties is not found\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn mysqlDS;\n\t}", "public DataSourceFactory getDataSourceFactory() {\n return database;\n }", "public FamilyTreeServer(Properties props) {\n\t\tlogger.debug(\"creating from properties [\" + props + \"]\");\n\t\tConfigurationSource source = new ConfigurationSource() {\n\t\t\t@Override\n\t\t\tpublic Properties properties() {\n\t\t\t\treturn props;\n\t\t\t}\n\t\t};\n\t\tcreateSession(source);\n\t}", "private DBManager() {\n SETTINGS.load(Settings.class.getClassLoader().getResourceAsStream(\"db.properties\"));\n this.dbUrl = SETTINGS.getProperty(\"DB_URL\");\n this.dbUser = SETTINGS.getProperty(\"DB_USER\");\n this.dbPassword = SETTINGS.getProperty(\"DB_PASSWORD\");\n try {\n Class.forName(SETTINGS.getProperty(\"DB_DRIVER\"));\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n }", "@Override\n\t\tpublic SessionFactoryImpl call() throws Exception {\n\t\t\tClassPathXmlApplicationContext applicationContext=new ClassPathXmlApplicationContext(\"spring-mybatis.xml\");\n\t\t\t\n\t\t\tSessionFactoryImpl sessionFactoryImpl=(SessionFactoryImpl) applicationContext.getBean(\"sessionFactory\");\n\n\t\t\treturn sessionFactoryImpl;\n\t\t}", "@Create\n public void init() throws IOException {\n\n final Map<String, String> persistenceProperties;\n try {\n persistenceProperties = getPersistenceProperties();\n } catch (Exception e) {\n\n // Mihai : I know, it is not elegant to cathc all the\n // exception but in this case the try/catch sequence\n // will be to big.\n log.error(e.getMessage(), e);\n throw new IOException(e);\n }\n\n final String dialect = persistenceProperties.get(HIBERNATE_DIALECT_KEY);\n if (dialect == null) {\n final String msg =\n \"The hibernate dialect is null prove your persistence.xml file\";\n final IllegalArgumentException exception =\n new IllegalArgumentException(msg);\n log.error(msg, exception);\n throw exception;\n }\n databaseSystem = DatabaseSystem.getDatabaseForDialect(dialect);\n if (databaseSystem == null) {\n final IllegalArgumentException illegalArgException =\n new IllegalArgumentException(\"The \" + dialect\n + \" is not supported.\");\n log.warn(illegalArgException.getMessage(), illegalArgException);\n throw illegalArgException;\n }\n }", "private Properties getHibernateProperties() {\n\t\tProperties properties = new Properties();\n\t\tproperties.put(\"hibernate.show_sql\", \"true\");\n\t\tproperties.put(\"hibernate.dialect\", \"org.hibernate.dialect.MySQLDialect\");\n\t\tproperties.put(\"hbm2ddl.auto\", \"create\");\n\t\tproperties.put(\"hibernate.id.new_generator_mappings\", \"false\");\n\t\t\n\t\treturn properties;\n\t}", "public IDataSource createDataSource(String initFileFullPath) throws Exception {\n\r\n\t\tProperties settings = new Properties();\r\n\t\ttry {\r\n\t\t\tFileInputStream sf = new FileInputStream(initFileFullPath);\r\n\t\t\tsettings.load(sf);\r\n\t\t} catch (Exception ex) {\r\n\t\t\tlogger.error(\"Exception during loading initialization file\");\r\n\t\t\tlogger.error(ex.toString());\r\n\t\t\tthrow ex;\r\n\t\t}\r\n\t\tString host = settings.getProperty(\"DBHOST\", \"\");\r\n\t\tString dbUser = settings.getProperty(\"USER\");\r\n\t\tString dbPassword = settings.getProperty(\"PWORD\", \"\");\r\n\t\tString sessionType = settings.getProperty(\"SESSIONTYPE\");\r\n\t\tClass.forName(\"com.mysql.jdbc.Driver\");\r\n\t\tlogger.info(\"BMIRDataSource args: \"+host+\" \"+dbUser+\" \"+ dbPassword);\r\n\t\tConnection con = DriverManager.getConnection (host, dbUser, dbPassword);\r\n\t\tif (sessionType.equals(\"Outpatient\")) { \r\n\t\t\treturn new BMIROutPatientDataSource(con, initFileFullPath) ;\r\n\t\t} else if (sessionType.equals(\"Inpatient\")) {\r\n\t\t\treturn new BMIRInPatientDataSource(con, initFileFullPath);\r\n\t\t}\r\n\t\telse \r\n\t\t\tlogger.error(\"No valid session type (must be inpatient or outpatient\");\r\n\t\treturn null;\r\n\t}", "public Configuration(File configFile) {\r\n \t\tproperties = loadProperties(configFile);\r\n \t}", "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 static Session createSession(SessionFactory factory){\n Session s;\n\n if((s = (Session) _sessionRef.get()) == null) {\n s = factory.openSession();\n _sessionRef.set(s);\n }\n else{\n if(!s.isConnected())s.reconnect();\n }\n\n return s; \n }", "private static EntityManagerFactory createNewEntityManagerFactory()\n\t\t\tthrows NamingException, PersistenceException, UnsupportedUserAttributeException {\n\n\t\tInitialContext ctx = new InitialContext();\n\t\tDataSource ds = (DataSource) ctx.lookup(DATA_SOURCE_NAME);\n\n\t\tMap<String, Object> properties = new HashMap<String, Object>();\n\t\tproperties.put(PersistenceUnitProperties.NON_JTA_DATASOURCE, ds);\n\n\t\t// As replication will change the underlying database without\n\t\t// notifying the hub the JPA cache needs to be disabled.\n\t\t// Else the hub might provide outdated data\n\t\tproperties.put(PersistenceUnitProperties.CACHE_SHARED_DEFAULT, \"false\");\n\n\t\treturn Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME, properties);\n\t}", "private DatabaseRepository() {\n try {\n // connect to database\n\n DB_URL = \"jdbc:sqlite:\"\n + this.getClass().getProtectionDomain()\n .getCodeSource()\n .getLocation()\n .toURI()\n .getPath().replaceAll(\"[/\\\\\\\\]\\\\w*\\\\.jar\", \"/\")\n + \"lib/GM-SIS.db\";\n connection = DriverManager.getConnection(DB_URL);\n mapper = ObjectRelationalMapper.getInstance();\n mapper.initialize(this);\n }\n catch (SQLException | URISyntaxException e) {\n System.out.println(e.toString());\n }\n }", "@Override\n public void loadFromProperties(PropertiesWrapper properties) {\n\n useForeignKeyPrefix = properties.getBoolean(\"namingConvention.useForeignKeyPrefix\", useForeignKeyPrefix);\n sequenceFormat = properties.get(\"namingConvention.sequenceFormat\", sequenceFormat);\n schema = properties.get(\"namingConvention.schema\", schema);\n }", "public interface PersistenceFactory {\n /* Fields */\n\n /**\n * The property name for all classes stored at the column:row level to introspect the entity that contains the\n * properties persisted in a row's columns\n */\n String CLASS_PROPERTY = \"___class\";\n\n /* Misc */\n\n /**\n * Deletes columns by name from column family\n *\n * @param columnFamily the column family\n * @param key the key\n * @param columns the columns to be deleted by name\n */\n void deleteColumns(String columnFamily, String key, String... columns);\n\n /**\n * Executes a query\n *\n * @param expectedResult the result expected from the query execution\n * @param query the query\n * @param <T> the result type\n * @return the result\n */\n <T> T executeQuery(Class<T> expectedResult, Query query);\n\n /**\n * @param entityClass the class\n * @param key the id\n * @param <T> the entity type\n * @return an entity from the data store looked up by its id\n */\n <T> T get(Class<T> entityClass, String key);\n\n /**\n * Fetch a map of columns and their values\n *\n * @param columnFamily the column family\n * @param key the column family key\n * @param reversed if the order should be reversed\n * @param columns the column names\n * @return a map of columns and their values\n */\n Map<String, ByteBuffer> getColumns(String columnFamily, String key, boolean reversed, String... columns);\n\n /**\n * Fetch a map of columns and their values\n *\n * @param columnFamily the column family\n * @param key the column family key\n * @param limit of columns\n * @param reversed if the order should be reversed\n * @param fromColumn from column\n * @param toColumn to column\n * @return a map of columns and their values\n */\n Map<String, ByteBuffer> getColumns(String columnFamily, String key, int limit, boolean reversed, String fromColumn, String toColumn);\n\n /**\n * @return the default consistency level\n */\n ConsistencyLevel getDefaultConsistencyLevel();\n\n /**\n * @return the default keyspace\n */\n String getDefaultKeySpace();\n\n /**\n * @param entityClass the class type for this instance\n * @param <T> the type of class to be returned\n * @return an instance of this type after transformation of its accessors to notify the persistence context that there are ongoing changes\n */\n <T> T getInstance(Class<T> entityClass);\n\n /**\n * Obtains an entity key\n *\n * @param entity the entity\n * @return the key\n */\n String getKey(Object entity);\n\n /**\n * The list of managed class by this factory\n *\n * @return The list of managed class by this factory\n */\n List<Class<?>> getManagedClasses();\n\n /**\n * Get a list of entities given a query\n *\n * @param type the type of objects to expect back\n * @param query the query\n * @param <T> the result type\n * @return the list of entities\n */\n <T> List<T> getResultList(Class<T> type, Query query);\n\n /**\n * Get a single result from a CQL query\n *\n * @param type the type of objects to expect back\n * @param query the query\n * @param <T> the entity type\n * @return the resulting entity\n */\n <T> T getSingleResult(Class<T> type, Query query);\n\n /**\n * Inserts columns based on a map representing keys with properties and their corresponding values\n *\n * @param columnFamily the column family\n * @param key the column family key\n * @param keyValuePairs the map with keys and values\n */\n void insertColumns(String columnFamily, String key, Map<String, Object> keyValuePairs);\n\n /**\n * Entry point method to persist and arbitrary list of objects into the datastore\n *\n * @param entities the entities to be persisted\n */\n <T> void persist(T... entities);\n\n /**\n * @param entities the entities to be removed from the data store\n */\n <T> void remove(T... entities);\n \n /**\n * return cluster\n */\n Cluster getCluster(); \n}", "public static void initialize()\n\t{\n\t\tProperties props = new Properties();\n\t\tFileInputStream in = new fileInputStream(\"database.properties\");\n\t\tprops.load(in);\n\t\tin.close();\n\t\tString drivers = props.getProperty(\"jdbc.drivers\");\n\t\tif (drivers != null)\n\t\t\tSystem.setProperty(\"jdbc.drivers\", drivers);\n\t\tString url = props.getProperty(\"jdbc.url\");\n\t\tString username = props.getProperty(\"jdbc.username\");\n\t\tString password = props.getProperty(\"jdbc.password\");\n\t\t\n\t\tSystem.out.println(\"url=\"+url+\" user=\"+username+\" password=\"+password);\n\n\t\tdbConnect = DriverManager.getConnection( url, username, password);\n\t\t\n\t\tinitializeDatabase();\n\t}", "public void readConfigFile() throws IOException {\r\n Wini iniFileParser = new Wini(new File(configFile));\r\n\r\n databaseDialect = iniFileParser.get(DATABASESECTION, \"dialect\", String.class);\r\n databaseDriver = iniFileParser.get(DATABASESECTION, \"driver\", String.class);\r\n databaseUrl = iniFileParser.get(DATABASESECTION, \"url\", String.class);\r\n databaseUser = iniFileParser.get(DATABASESECTION, \"user\", String.class);\r\n databaseUserPassword = iniFileParser.get(DATABASESECTION, \"userPassword\", String.class);\r\n\r\n repositoryName = iniFileParser.get(REPOSITORYSECTION, \"name\", String.class);\r\n\r\n partitions = iniFileParser.get(DEFAULTSECTION, \"partitions\", Integer.class);\r\n logFilename = iniFileParser.get(DEFAULTSECTION, \"logFilename\", String.class);\r\n logLevel = iniFileParser.get(DEFAULTSECTION, \"logLevel\", String.class);\r\n\r\n maxNGramSize = iniFileParser.get(FEATURESSECTION, \"maxNGramSize\", Integer.class);\r\n maxNGramFieldSize = iniFileParser.get(FEATURESSECTION, \"maxNGramFieldSize\", Integer.class);\r\n String featureGroupsString = iniFileParser.get(FEATURESSECTION, \"featureGroups\", String.class);\r\n\r\n if ( databaseDialect == null )\r\n throw new IOException(\"Database dialect not found in config\");\r\n if ( databaseDriver == null )\r\n throw new IOException(\"Database driver not found in config\");\r\n if ( databaseUrl == null )\r\n throw new IOException(\"Database URL not found in config\");\r\n if ( databaseUser == null )\r\n throw new IOException(\"Database user not found in config\");\r\n if ( databaseUserPassword == null )\r\n throw new IOException(\"Database user password not found in config\");\r\n\r\n if (repositoryName == null)\r\n throw new IOException(\"Repository name not found in config\");\r\n\r\n if (partitions == null)\r\n partitions = 250;\r\n if ( logFilename == null )\r\n logFilename = \"FeatureExtractor.log\";\r\n if ( logLevel == null )\r\n logLevel = \"INFO\";\r\n\r\n if ( featureGroupsString != null ) {\r\n featureGroups = Arrays.asList(featureGroupsString.split(\"\\\\s*,\\\\s*\"));\r\n }\r\n if (maxNGramSize == null)\r\n maxNGramSize = 5;\r\n if (maxNGramFieldSize == null)\r\n maxNGramFieldSize = 500;\r\n\r\n }", "public RegionDAO(SessionFactory factory) {\r\n this.factory = factory;\r\n }", "public DataSourceFactory() {}", "public SessionDao(Configuration configuration) {\n super(Session.SESSION, com.scratch.database.mysql.jv.tables.pojos.Session.class, configuration);\n }", "public void setSessionFactory(SessionFactory sessionFactory) {\r\n template = new HibernateTemplate(sessionFactory);\r\n }", "@Resource\n public void setSessionFactory(SessionFactory factory) {\n this.sessionFactory = factory;\n }", "private DataSource.Factory buildDataSourceFactory() {\n return ((DemoApplication) getApplication()).buildDataSourceFactory();\n }", "public SessionFactory getSessionFactory() {\r\n return sessionFactory;\r\n }", "ProfileFactory getProfileFactory( DataSourceMetadata dataSourceMetadata );", "protected ETLLogDAOImpl(Configuration config) {\r\n config.addClass(ETLLog.class);\r\n factory = config.buildSessionFactory();\r\n }", "public PaymentDAOImpl(SessionFactory sessionfactory)\n\t{\n\tthis.sessionFactory=sessionfactory; \n\tlog.debug(\"Successfully estblished connection\");\n\t}", "public SessionFactory getSessionFactory() {\n return sessionFactory;\n }", "protected void setUp() throws Exception {\n\t\tfinal StandardServiceRegistry registry = new StandardServiceRegistryBuilder().configure().build();\n\t\ttry {\n\t\t\tsessionFactory = new MetadataSources(registry).buildMetadata().buildSessionFactory();\n\t\t} catch (Exception e) {\n\t\t\tStandardServiceRegistryBuilder.destroy(registry);\n\t\t}\n\t}", "@Autowired\n\t public FlightSeatRepositoryImpl(EntityManagerFactory factory) {\n\t\t if(factory.unwrap(SessionFactory.class) == null){\n\t\t\t throw new NullPointerException(\"factory is not a hibernate factory\");\n\t\t }\n\t\t this.sessionFactory = factory.unwrap(SessionFactory.class);\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 Properties hibernateProperties() {\r\n\t\tProperties properties = new Properties();\r\n\t\tproperties.put(org.hibernate.cfg.Environment.DIALECT, \"org.hibernate.dialect.MySQL5Dialect\");\r\n\t\tproperties.put(org.hibernate.cfg.Environment.SHOW_SQL, true);\r\n properties.put(org.hibernate.cfg.Environment.FORMAT_SQL, true);\r\n properties.put(org.hibernate.cfg.Environment.HBM2DDL_AUTO, \"update\");\r\n return properties;\r\n\t}", "@Test\n public void testCreateFromProperties_Properties() throws Exception {\n System.out.println(\"createFromProperties\");\n Properties props = new Properties();\n props.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(propertiesName));\n EngineConfiguration result = EngineConfiguration.createFromProperties(props);\n assertProperties(result);\n }", "public XMLDatabaseConnector()\n\t{\n\t\t\n\t\tProperties prop = new Properties();\n\t\t\n\t\t InputStream inputStream = this.getClass().getClassLoader()\n\t .getResourceAsStream(\"config.properties\");\n\t\t \n \ttry {\n //load a properties file\n \t\tprop.load(inputStream);\n \n //get the property value and print it out\n \t\tsetURI(prop.getProperty(\"existURI\"));\n \t\tusername = prop.getProperty(\"username\");\n \t\tpassword = prop.getProperty(\"password\");\n \n \t} catch (IOException ex) {\n \t\tex.printStackTrace();\n }\n\t}", "public BlogDaoHibernateFactoryImpl() {\n\t\tsuper();\n\t}", "public static SessionFactory getSessionFactory(boolean bJournal) throws Exception {\r\n\t\tString domain = DomainOwner.getDomain();\r\n\t\tString configurationName = bJournal? EnvConstants.HB_CONFIG_CORE : // 获取bonita_journal库的连接\r\n\t\t\t\t\t\t\t\t\t\t\tEnvConstants.HB_CONFIG_HISTORY;//获取bonita_history库的连接\r\n\t\tfinal SessionFactory sessionFactory = getSessionFactory(domain,\r\n\t\t\t\tconfigurationName.replaceAll(\"-configuration\",\r\n\t\t\t\t\t\t\"-session-factory\"));\r\n\t\treturn sessionFactory;\r\n\t}", "public ETLLogDAOImpl(SessionFactory factory) {\r\n this.factory = factory;\r\n }", "public BLFacadeImplementation() {\t\t\r\n\t\tSystem.out.println(\"Creating BLFacadeImplementation instance\");\r\n\t\tConfigXML c=ConfigXML.getInstance();\r\n\t\t\r\n\t\tif (c.getDataBaseOpenMode().equals(\"initialize\")) {\r\n\t\t\tDataAccess dbManager=new DataAccess(c.getDataBaseOpenMode().equals(\"initialize\"));\r\n\t\t\tdbManager.initializeDB();\r\n\t\t\tdbManager.close();\r\n\t\t\t}\r\n\t\t\r\n\t}" ]
[ "0.71916634", "0.66934395", "0.6638468", "0.65104806", "0.64744693", "0.6459552", "0.6442098", "0.622725", "0.6067901", "0.60111", "0.5933493", "0.58111435", "0.5705095", "0.56751144", "0.56064314", "0.55843", "0.55510026", "0.550159", "0.54764575", "0.54671913", "0.5459965", "0.5458789", "0.5436112", "0.54337615", "0.53472704", "0.53340775", "0.5327939", "0.53213024", "0.5306135", "0.5297477", "0.5288499", "0.5284065", "0.5281419", "0.52752036", "0.527404", "0.52589333", "0.5258498", "0.52511406", "0.5246812", "0.524346", "0.5238653", "0.5211525", "0.5209232", "0.520451", "0.5188557", "0.51774687", "0.5162162", "0.51548135", "0.5098285", "0.5093979", "0.50875825", "0.50815654", "0.50723255", "0.5071441", "0.50544614", "0.5044029", "0.5039356", "0.5034651", "0.5032592", "0.5030757", "0.5029894", "0.50264806", "0.5005693", "0.4995717", "0.4993373", "0.49924076", "0.49855173", "0.4983937", "0.49808896", "0.49800995", "0.49674404", "0.4962863", "0.4952069", "0.49490246", "0.49437484", "0.49383786", "0.49305883", "0.4925917", "0.49231246", "0.49230897", "0.49072027", "0.490692", "0.49061376", "0.49015546", "0.48945788", "0.48927537", "0.48857728", "0.48785254", "0.4877422", "0.48760134", "0.4873599", "0.48496395", "0.484935", "0.48375887", "0.48300156", "0.48288107", "0.48191574", "0.48134112", "0.4810692", "0.48087728" ]
0.7495263
0
Provides SessionFactory or calls building if null.
public static SessionFactory getSessionFactory() { if (sessionFactory == null) sessionFactory = buildSessionFactory(); return sessionFactory; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static SessionFactory buildSessionFactory() {\n\t\ttry {\n\t\t\t// Create the SessionFactory from hibernate.cfg.xml\n\t\t\tConfiguration configuration = new Configuration().configure();\n\t\t\tServiceRegistry serviceRegistry = new ServiceRegistryBuilder()\n\t\t\t\t\t.applySettings(configuration.getProperties())\n\t\t\t\t\t.buildServiceRegistry();\n\t\t\tSessionFactory sessionFactory = configuration\n\t\t\t\t\t.buildSessionFactory(serviceRegistry);\n\t\t\treturn sessionFactory;\n\t\t} catch (Throwable ex) {\n\t\t}\n\t\treturn null;\n\t}", "public synchronized static SessionFactory createSessionFactory() {\r\n\r\n if (sessionFactory == null) {\r\n LOG.debug(MODULE + \"in createSessionFactory\");\r\n sessionFactory = new Configuration().configure().buildSessionFactory();\r\n// ApplicationContext appcontext = ApplicationContextProvider.getApplicationContext();\r\n// sessionFactory = (SessionFactory) appcontext.getBean(\"sessionFactory\");\r\n LOG.debug(MODULE + \"sessionFactory created\");\r\n }\r\n\r\n return sessionFactory;\r\n }", "private static SessionFactory buildSessionFactory() {\n\t\t// Creating Configuration Instance & Passing Hibernate Configuration File\n\t\tConfiguration configObj = new Configuration();\n\t\tconfigObj.configure(\"hibernate.cfg.xml\");\n\n\t\t// Since Hibernate Version 4.x, ServiceRegistry Is Being Used\n\t\tServiceRegistry serviceRegistryObj = new StandardServiceRegistryBuilder()\n\t\t\t\t.applySettings(configObj.getProperties()).build();\n\n\t\t// Creating Hibernate SessionFactory Instance\n\t\tsessionFactoryObj = configObj.buildSessionFactory(serviceRegistryObj);\n\t\treturn sessionFactoryObj;\n\t}", "public static SessionFactory getSessionFactory() {\n\n if(sessionFactory == null) {\n try {\n MetadataSources metadataSources = new MetadataSources(configureServiceRegistry());\n\n addEntityClasses(metadataSources);\n\n sessionFactory = metadataSources.buildMetadata()\n .getSessionFactoryBuilder()\n .build();\n\n } catch (Exception e) {\n e.printStackTrace();\n if(registry != null)\n StandardServiceRegistryBuilder.destroy(registry);\n }\n }\n\n return sessionFactory;\n }", "protected abstract SessionFactory buildSessionFactory() throws Exception;", "private static SessionFactory buildSessionFactory() {\n Configuration configObj = new Configuration();\n configObj.configure(\"hibernate.cfg.xml\");\n\n ServiceRegistry serviceRegistryObj = new StandardServiceRegistryBuilder().applySettings(configObj.getProperties()).build();\n\n // Creating Hibernate SessionFactory Instance\n sessionFactoryObj = configObj.buildSessionFactory(serviceRegistryObj);\n return sessionFactoryObj;\n }", "private static SessionFactory buildSessionFactory() {\n\t\ttry {\r\n\t\t\tConfiguration config=new Configuration();\r\n\t\t\tconfig.addClass(Customer.class);\r\n\t\t\treturn config\r\n\t\t\t\t\t.buildSessionFactory(new StandardServiceRegistryBuilder().build());\r\n\t\t} catch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tthrow new RuntimeException(\"error building sessions\");\r\n\t\t}\r\n\t}", "public static SessionFactory getSessionFactory() {\n\t\tif (sessionFactory == null) {\n\t\t\tcreateSessionFactory();\n\t\t}\n\t\treturn sessionFactory;\n\t}", "public static SessionFactory getSessionFactory() {\r\n\t\t/*\r\n\t\t * Instead of a static variable, use JNDI: SessionFactory sessions =\r\n\t\t * null; try { Context ctx = new InitialContext(); String jndiName =\r\n\t\t * \"java:hibernate/HibernateFactory\"; sessions =\r\n\t\t * (SessionFactory)ctx.lookup(jndiName); } catch (NamingException ex) {\r\n\t\t * throw new InfrastructureException(ex); } return sessions;\r\n\t\t */\r\n\t\treturn sessionFactory;\r\n\t}", "public static SessionFactory getSessionFactory() {\r\n\t\tConfiguration configuration = new Configuration().configure();\r\n\t\tStandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder()\r\n\t\t\t\t.applySettings(configuration.getProperties());\r\n\t\tSessionFactory sessionFactory = configuration\r\n\t\t\t\t.buildSessionFactory(builder.build());\r\n\t\treturn sessionFactory;\r\n\t}", "protected final SessionFactory getSessionFactory() {\n\t\tif (this.sessionFactory == null) {\n\t\t\tthrow new IllegalStateException(\"SessionFactory not initialized yet\");\n\t\t}\n\t\treturn this.sessionFactory;\n\t}", "public static SessionFactory getSessionFactory() {\n\t\treturn sessionFactory;\r\n\t}", "public static SessionFactory getSessionFactory() {\n\t\treturn sessionFactory;\n\t}", "public static SessionFactory getSessionFactory() {\n \t\n \treturn sessionFactory;\n }", "@SuppressWarnings({ \"deprecation\"})\r\n\tpublic static SessionFactory getSessionFactory() \r\n\t{\r\n //configuration object\r\n Configuration configuration=new Configuration();\r\n //configuring xml file\r\n \tconfiguration.configure(\"hibernate.cfg.xml\");\r\n \t//SessionFactory object\r\n \tsessionFactory=configuration.buildSessionFactory();\r\n //returning sessonFactory+\r\n return sessionFactory;\r\n }", "protected SessionFactory getSessionFactory() {\n\t\treturn this.sessionFactory;\n\t}", "public SessionFactory getSessionFactory()\n {\n return sessionFactory;\n }", "private static SessionFactory buildSessionFactory() {\n\n try {\n Configuration configuration = new Configuration();\n\n Properties properties = new Properties();\n properties.load(AuthDao.class.getResourceAsStream(\"/db.properties\"));\n configuration.setProperties(properties);\n\n// configuration.addAnnotatedClass(Driver.class);\n// configuration.addAnnotatedClass(DriverStatusChange.class);\n// configuration.addAnnotatedClass(Freight.class);\n// configuration.addAnnotatedClass(Location.class);\n configuration.addAnnotatedClass(Manager.class);\n// configuration.addAnnotatedClass(Order.class);\n// configuration.addAnnotatedClass(OrderDriver.class);\n// configuration.addAnnotatedClass(OrderWaypoint.class);\n// configuration.addAnnotatedClass(Truck.class);\n// configuration.addAnnotatedClass(Waypoint.class);\n\n ServiceRegistry serviceRegistry =\n new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()).build();\n\n return configuration.buildSessionFactory(serviceRegistry);\n\n } catch (IOException e) {\n e.printStackTrace();\n throw new ExceptionInInitializerError(e);\n }\n }", "private static SessionFactory buildSessionFact() {\n try {\n\n return new Configuration().configure(\"hibernate.cfg.xml\").buildSessionFactory();\n\n \n } catch (Throwable ex) {\n \n System.err.println(\"Initial SessionFactory creation failed.\" + ex);\n throw new ExceptionInInitializerError(ex);\n }\n }", "public static SessionFactory getSessionFactory() {\n\t\tConfiguration configObj = new Configuration();\n\t\tconfigObj.addAnnotatedClass(com.training.org.User.class);\n\t\tconfigObj.configure(\"hibernate.cfg.xml\");\n\t\t\n\t\t\n\t\n\n\t\t// Since Hibernate Version 4.x, Service Registry Is Being Used\n\t\tServiceRegistry serviceRegistryObj = new StandardServiceRegistryBuilder().applySettings(configObj.getProperties()).build(); \n\n\t\t// Creating Hibernate Session Factory Instance\n\t\tSessionFactory factoryObj = configObj.buildSessionFactory(serviceRegistryObj);\t\t\n\t\treturn factoryObj;\n\t}", "public SessionFactory getFactory() {\n\t\treturn factory;\n\t}", "public SessionFactory getSessionFactory() {\r\n return sessionFactory;\r\n }", "public SessionFactory getSessionFactory() {\n return sessionFactory;\n }", "public SessionFactory getSessionFactory() {\r\n\t\treturn sessionFactory;\r\n\t}", "public SqlSessionFactory get();", "public SessionFactory getSessionFactory() {\n\t\treturn sessionFactory;\n\t}", "public SessionFactory getSessionFactory() {\n\t\treturn sessionFactory;\n\t}", "protected Session buildOrObtainSession() {\r\n\t\tLOGGER.fine(\"Opening a new Session\");\r\n\t\tSession s = super.buildOrObtainSession();\r\n\r\n\t\tLOGGER.fine(\"Disabling automatic flushing of the Session\");\r\n\t\ts.setFlushMode(FlushMode.MANUAL);\r\n\r\n\t\treturn s;\r\n\t}", "public SessionFactory getHibernateSessionFactory() {\n if (_hibernateTemplate == null) {\n return null;\n }\n return _hibernateTemplate.getSessionFactory();\n }", "private static SessionFactory buildSessionFactory() {\n\t\ttry {\n\t\t\tConfiguration config = new Configuration().configure(); \n\t\t\tServiceRegistry serviceRegistry =\n\t\t\t\t\tnew StandardServiceRegistryBuilder()\n\t\t\t.applySettings(config.getProperties()).build();\n\n\t\t\tHibernatePBEEncryptorRegistry registry = HibernatePBEEncryptorRegistry.getInstance();\n\t\t\t\n\t\t\tStandardPBEStringEncryptor myEncryptor = new StandardPBEStringEncryptor();\n\t\t\t// FIXME : this is insecure and needs to be fixed\n\t\t\tmyEncryptor.setPassword(\"123\");\n\t\t\tregistry.registerPBEStringEncryptor(\"myHibernateStringEncryptor\", myEncryptor);\n\t\t\t\n\t\t\t\n\t\t\treturn config.buildSessionFactory(serviceRegistry); \n\t\t}\n\t\tcatch (Throwable ex) {\n\t\t\t// Make sure you log the exception, as it might be swallowed\n\t\t\tSystem.err.println(\"Initial SessionFactory creation failed.\" + ex);\n\t\t\tthrow new ExceptionInInitializerError(ex);\n\t\t}\n\t}", "@Override\n\t\tpublic SessionFactoryImpl call() throws Exception {\n\t\t\tClassPathXmlApplicationContext applicationContext=new ClassPathXmlApplicationContext(\"spring-mybatis.xml\");\n\t\t\t\n\t\t\tSessionFactoryImpl sessionFactoryImpl=(SessionFactoryImpl) applicationContext.getBean(\"sessionFactory\");\n\n\t\t\treturn sessionFactoryImpl;\n\t\t}", "public static Session createSession(SessionFactory factory){\n Session s;\n\n if((s = (Session) _sessionRef.get()) == null) {\n s = factory.openSession();\n _sessionRef.set(s);\n }\n else{\n if(!s.isConnected())s.reconnect();\n }\n\n return s; \n }", "public interface SessionFactory {\n /**\n * Retrieves a new session. If the session isn't closed, second call from the same thread would\n * result in retrieving the same session\n *\n * @return\n */\n Session getSession();\n\n /**\n * Closes the current session associated with this transaction if present\n */\n void closeSession();\n\n /**\n * Returns true if we have connected the factory to redis\n *\n * @return\n */\n boolean isConnected();\n\n /**\n * Closes the session factory which disposes of the underlying redis pool\n */\n void close();\n}", "private SessionFactoryUtil() {\r\n try {\r\n LOG.info(\"Configurando hibernate.cfg.xml\");\r\n CfgFile cfgFile = new CfgFile();\r\n Configuration configure = new Configuration().configure(new File(cfgFile.getPathFile()));\r\n cfgFile.toBuildMetaData(configure);\r\n ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(configure.getProperties()).build();\r\n sessionFactory = configure.buildSessionFactory(serviceRegistry);\r\n LOG.info(\"Configuracion se cargo a memoria de forma correcta\");\r\n } // try\r\n catch (Exception e) {\r\n Error.mensaje(e);\r\n } // catch\r\n }", "private static synchronized void lazyinit()\n {\n try\n {\n if (sessionFactory == null)\n {\n System.out.println(\"Going to create SessionFactory \");\n sessionFactory = new Configuration().configure().buildSessionFactory();\n// sessionFactory.openSession();\n System.out.println(\"Hibernate could create SessionFactory\");\n }\n } catch (Throwable t)\n {\n System.out.println(\"Hibernate could not create SessionFactory\");\n t.printStackTrace();\n }\n }", "private static void createSessionFactory() {\n\t\ttry {\n\t\t\tif (sessionFactory == null) {\n\n\t\t\t\tProperties properties = new Properties();\n\t\t\t\tproperties.load(ClassLoader.getSystemResourceAsStream(\"hibernate.properties\"));\n\n\t\t\t\tConfiguration configuration = new Configuration();\n\t\t\t\tEntityScanner.scanPackages(\"musala.schoolapp.model\").addTo(configuration);\n\t\t\t\tconfiguration.mergeProperties(properties).configure();\n\t\t\t\tStandardServiceRegistry builder = new StandardServiceRegistryBuilder()\n\t\t\t\t\t\t.applySettings(configuration.getProperties()).build();\n\t\t\t\tsessionFactory = configuration.buildSessionFactory(builder);\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tSystem.out.println(\"Failed to create session factory object.\");\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "public Object getObject() {\n\t\treturn this.sessionFactory;\n\t}", "public static DefaultSessionIdentityMaker newInstance() { return new DefaultSessionIdentityMaker(); }", "private Session getSession() {\n\t\treturn factory.getCurrentSession();\n\t}", "public static Session openSession() {\n \treturn sessionFactory.openSession();\n }", "static void initialize() {\n final StandardServiceRegistry registry = new StandardServiceRegistryBuilder()\n .configure() // configures settings from hibernate.cfg.xml\n .build();\n try {\n sessionFactory = new MetadataSources( registry ).buildMetadata().buildSessionFactory();\n }\n catch (Exception e) {\n StandardServiceRegistryBuilder.destroy( registry );\n }\n }", "static void initialize() {\n final StandardServiceRegistry registry = new StandardServiceRegistryBuilder()\r\n .configure() // configures settings from hibernate.cfg.xml\r\n .build();\r\n try {\r\n sessionFactory = new MetadataSources( registry ).buildMetadata().buildSessionFactory();\r\n }\r\n catch (Exception e) {\r\n StandardServiceRegistryBuilder.destroy( registry );\r\n }\r\n }", "private void getHibernateSession() {\n try {\n session = em.unwrap(Session.class)\n .getSessionFactory().openSession();\n\n } catch(Exception ex) {\n logger.error(\"Failed to invoke the getter to obtain the hibernate session \" + ex.getMessage());\n ex.printStackTrace();\n }\n\n if(session == null) {\n logger.error(\"Failed to find hibernate session from \" + em.toString());\n }\n }", "private Session openSession() {\n return sessionFactory.getCurrentSession();\n }", "public static Session currentSession() throws HibernateException {\n Session s = (Session) threadLocal.get();\n\n if (s == null) {\n try {\n\t\t\t\tif (getInterceptor() != null) {\n\t\t\t\t\tlog.debug(\"Using Interceptor: \" + getInterceptor().getClass());\n\t\t\t\t\ts = sessionFactory.openSession(getInterceptor());\n\t\t\t\t} else {\n\t\t\t\t\ts = sessionFactory.openSession();\n\t\t\t\t}\n }\n catch (HibernateException he) {\n System.err.println(\"%%%% Error Creating SessionFactory %%%%\");\n throw new RuntimeException(he);\n }\n }\n return s;\n }", "public Session createSession() {\n\t\treturn this.session;\n\t}", "public FuncaoCasoDAOImpl() {\n\t\tsetSession(HibernateUtil.getSessionFactory());\n\t}", "public static SessionStrategyBuilder usingHibernate() {\r\n return new PersistenceServiceBuilderImpl(PersistenceFlavor.HIBERNATE, persistenceModuleVisitor);\r\n }", "@Profile(\"development\")\r\n @Bean\r\n @DependsOn(\"SessionFactory\") \r\n public EshopDAOImpl getDevLocaleDAO(SessionFactory sessionFactory, DataSource dataSource) { \r\n \r\n EshopDAOImpl instanceDAOImpl = new EshopDAOImpl(); \r\n \r\n //Initialize reference to a SessionFactoryBean for database's methods. \r\n instanceDAOImpl.setSessionFactory(sessionFactory);\r\n \r\n return instanceDAOImpl; \r\n }", "public Session openSession() {\r\n return sessionFactory.openSession();\r\n }", "public static Session getSession() {\n if(sesh == null) {\n return sesh = sf.openSession();\n }\n\n return sesh;\n }", "public /*static*/ Session getSession() {\n return sessionFactory.getCurrentSession();\n }", "protected SessionFactory wrapSessionFactoryIfNecessary(SessionFactory rawSf) {\n\t\tif (isExposeTransactionAwareSessionFactory()) {\n\t\t\t return getTransactionAwareSessionFactoryProxy(rawSf);\n\t\t}\n\t\telse {\n\t\t\treturn rawSf;\n\t\t}\n\t}", "public SingleSessionFactory(Session session) {\n\t\tthis.session = session;\n\t}", "public static void rebuildSessionFactory() {\r\n\t\t\ttry {\r\n\t\t\t\t\r\n\t\t\t\tserviceRegistry = new ServiceRegistryBuilder().applySettings(\r\n\t\t\t\t\t\tcfg.getProperties()).buildServiceRegistry();\r\n\t\t\t\tsessionFactory = cfg.buildSessionFactory(serviceRegistry);\r\n\t\t\t\t\r\n\r\n\t\t\t} catch (Throwable ex) {\r\n\t\t\t\tSystem.err.println(\"Failed to create sessionFactory object.\" + ex);\r\n\t\t\t\tthrow new ExceptionInInitializerError(ex);\r\n\t\t\t}\r\n\t\t}", "public void setSessionFactory(SessionFactory sessionFactory) {\n template = new HibernateTemplate(sessionFactory);\n}", "@Override\n public void initSessionFactories() {\n super.initSessionFactories();\n\n sessionFactories.put(EntityCache.class, new SessionFactory() {\n\n @Override\n public Class<?> getSessionType() {\n return EntityCache.class;\n }\n @Override\n public Session openSession(CommandContext commandContext) {\n return new EntityCacheImpl();\n }\n });\n }", "public Session getSession(){\n\t\treturn sessionFactory.openSession();\n\t}", "public Session openSession() {\r\n\t\treturn sessionFactory.openSession();\r\n\t}", "protected Session getSession() {\n return sessionFactory.getCurrentSession();\n }", "private com.google.protobuf.SingleFieldBuilder<\n com.weizhu.proto.WeizhuProtos.Session, com.weizhu.proto.WeizhuProtos.Session.Builder, com.weizhu.proto.WeizhuProtos.SessionOrBuilder> \n getSessionFieldBuilder() {\n if (sessionBuilder_ == null) {\n sessionBuilder_ = new com.google.protobuf.SingleFieldBuilder<\n com.weizhu.proto.WeizhuProtos.Session, com.weizhu.proto.WeizhuProtos.Session.Builder, com.weizhu.proto.WeizhuProtos.SessionOrBuilder>(\n getSession(),\n getParentForChildren(),\n isClean());\n session_ = null;\n }\n return sessionBuilder_;\n }", "public Session getSession() {\n\t\tSession session = this.session;\r\n\t\tif (session == null) {\r\n\t\t\t// 2. altrimenti genera una nuova sessione utilizzando la factory (e.g. Spring MVC)\r\n\t\t\tsession = this.sessionFactory.getCurrentSession();\r\n\t\t}\r\n\t\treturn session;\r\n\t}", "private Session fetchSession()\n\t{\n\t\t\tlog.info (\"******Fetching Hibernate Session\");\n\n\t\t\tSession session = HibernateFactory.currentSession();\n\n\t\t\treturn session;\n\t \n\t}", "public Session createSession() {\n\t\tSession session = new Session();\n\t\tput(session.getId(), session);\n\t\treturn session;\n\t}", "public static Session register(SessionFactory factory) throws IllegalStateException {\n if(_sessionRef.get() != null) {\n throw new IllegalStateException(\n \"Thread already registered with a session\");\n }\n\n Session s = factory.openSession();\n _sessionRef.set(s);\n return s;\n }", "public NationalityDAO() {\n //sessionFactory = HibernateUtil.getSessionFactory();\n session=HibernateUtil.openSession();\n }", "@Resource\n public void setSessionFactory(SessionFactory factory) {\n this.sessionFactory = factory;\n }", "@Profile(\"production\")\r\n @Bean\r\n @DependsOn(\"SessionFactory\") \r\n public EshopDAOImpl getLocaleDAO(SessionFactory sessionFactory, DataSource dataSource) { \r\n \r\n EshopDAOImpl instanceDAOImpl = new EshopDAOImpl();\r\n \r\n //Inject datasource for JDBC.\r\n// instanceDAOImpl.setDataSource(dataSource); \r\n \r\n //Initialize reference to a SessionFactoryBean for database's methods. \r\n instanceDAOImpl.setSessionFactory(sessionFactory);\r\n \r\n return instanceDAOImpl; \r\n }", "@Override\n public Session getSession() throws HibernateException {\n Session session = threadLocal.get();\n\n if (session == null || !session.isOpen()) {\n session = (sessionFactory != null) ? sessionFactory.openSession()\n : null;\n threadLocal.set(session);\n }\n return session;\n }", "public SessionDao() {\n super(Session.SESSION, com.scratch.database.mysql.jv.tables.pojos.Session.class);\n }", "public AppEngineDataStoreFactory build() {\n return new AppEngineDataStoreFactory(this);\n }", "private static Session secondLevelCacheHibernate(SessionFactory factory,\n\t\t\tSession session) {\n\t\tsession.close();\n\t\tsession=factory.openSession();\n\t\tsession.get(Employee.class, Long.valueOf(7));\n\t\tsession.close();\n\t\tsession=factory.openSession();\n\t\tsession.get(Employee.class, Long.valueOf(7));\n\t\treturn session;\n\t}", "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 PaymentDAOImpl(SessionFactory sessionfactory)\n\t{\n\tthis.sessionFactory=sessionfactory; \n\tlog.debug(\"Successfully estblished connection\");\n\t}", "public static Session currentSession(SessionFactory fac)\n throws HibernateException {\n Session s;\n\n if((s = (Session) _sessionRef.get()) == null) {\n s = fac.openSession();\n _sessionRef.set(s);\n }\n else{\n if(!s.isConnected())s.reconnect();\n }\n\n return s;\n }", "public Session getSession() {\n\t\treturn sessionFactory.getCurrentSession();\r\n\t}", "public Session openSession() {\r\n //Interceptor interceptor= new Interceptor();\r\n //Session regresar = sessionFactory.withOptions().interceptor(interceptor).openSession();\r\n Session regresar = sessionFactory.openSession();\r\n //interceptor.setSession(regresar);\r\n return regresar;\r\n }", "public static Session openSession(SessionFactory sessionFactory)\r\n\t\t\tthrows HibernateException {\n\r\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\treturn session;\r\n\t}", "private Session getCurrentSession() {\n return sessionFactory.getCurrentSession();\n }", "public static synchronized DAOFactory getDAOFactory() {\r\n if (daof == null) {\r\n daoType = JDBCDAO;\r\n switch (daoType) {\r\n case JDBCDAO:\r\n daof = new JDBCDAOFactory();\r\n break;\r\n case DUMMY_DAO:\r\n daof = new InMemoryDAOFactory();\r\n break;\r\n default:\r\n daof = null;\r\n }\r\n }\r\n return daof;\r\n }", "private SessionFactoryUtil() {\r\n\t}", "public Session getSession() {\n if (this.session == null) {\n this.logger.error(\"Sessão não iniciada.\");\n throw new IllegalStateException(\"A sessão não foi criada antes do uso do DAO\");\n }\n return this.session;\n }", "@Autowired\r\n public void setSessionFactory(SessionFactory sessionFactory) {\r\n this.sessionFactory = sessionFactory;\r\n }", "public static DaoFactory getInstance(){\n\t\tif(daoFactory==null){\n\t\t\tdaoFactory = new DaoFactory();\n\t\t}\n\t\treturn daoFactory;\n\t}", "public Session() {\n\t\tLogger.log(\"Creating application session\");\n\t}", "protected SessionFactory getTransactionAwareSessionFactoryProxy(SessionFactory target) {\n\t\tClass sfInterface = SessionFactory.class;\n\t\tif (target instanceof SessionFactoryImplementor) {\n\t\t\tsfInterface = SessionFactoryImplementor.class;\n\t\t}\n\t\treturn (SessionFactory) Proxy.newProxyInstance(sfInterface.getClassLoader(),\n\t\t\t\tnew Class[] {sfInterface}, new TransactionAwareInvocationHandler(target));\n\t}", "DatastoreSession createSession();", "public SessionDao(Configuration configuration) {\n super(Session.SESSION, com.scratch.database.mysql.jv.tables.pojos.Session.class, configuration);\n }", "DefaultSession createSession(String id);", "public com.weizhu.proto.WeizhuProtos.Session.Builder getSessionBuilder() {\n bitField0_ |= 0x00000002;\n onChanged();\n return getSessionFieldBuilder().getBuilder();\n }", "@Override\n public SessionClient build() {\n Supplier<CompletableFuture<SessionClient>> proxyFactory = () -> CompletableFuture.completedFuture(\n new DefaultRaftSessionClient(\n primitiveName,\n primitiveType,\n serviceConfig,\n partitionId,\n DefaultRaftClient.this.protocol,\n selectorManager,\n sessionManager,\n readConsistency,\n communicationStrategy,\n threadContextFactory.createContext(),\n minTimeout,\n maxTimeout));\n\n SessionClient proxy;\n\n ThreadContext context = threadContextFactory.createContext();\n\n // If the recovery strategy is set to RECOVER, wrap the builder in a recovering proxy client.\n if (recoveryStrategy == Recovery.RECOVER) {\n proxy = new RecoveringSessionClient(\n clientId,\n partitionId,\n primitiveName,\n primitiveType,\n proxyFactory,\n context);\n } else {\n proxy = proxyFactory.get().join();\n }\n\n // If max retries is set, wrap the client in a retrying proxy client.\n if (maxRetries > 0) {\n proxy = new RetryingSessionClient(\n proxy,\n context,\n maxRetries,\n retryDelay);\n }\n return new BlockingAwareSessionClient(proxy, context);\n }", "@Inject\n private DataStore() {\n final StandardServiceRegistry registry = new StandardServiceRegistryBuilder()\n .configure()\n .build();\n try {\n sessionFactory = new MetadataSources(registry).buildMetadata().buildSessionFactory();\n } catch (Exception e) {\n LOGGER.error(\"Fehler beim initialisieren der Session\", e);\n StandardServiceRegistryBuilder.destroy(registry);\n }\n \n }", "public static Session getSession() throws HException {\r\n\t\tSession s = (Session) threadSession.get();\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tif (s == null) {\r\n\t\t\t\tlog.debug(\"Opening new Session for this thread.\");\r\n\t\t\t\tif (getInterceptor() != null) {\r\n\t\t\t\t\t\r\n\t\t\t\t\ts = getSessionFactory().withOptions().interceptor(getInterceptor()).openSession();\r\n\t\t\t\t} else {\r\n\t\t\t\t\ts = getSessionFactory().openSession();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthreadSession.set(s);\r\n\t\t\t\tsetConnections(1);\r\n\t\t\t}\r\n\t\t} catch (HibernateException ex) {\r\n\t\t\tthrow new HException(ex);\r\n\t\t}\r\n\t\treturn s;\r\n\t}", "public OBStoreFactory getFactory();", "public void setSessionFactory(SessionFactory sessionFactory) {\r\n template = new HibernateTemplate(sessionFactory);\r\n }", "@Autowired\n\t public FlightSeatRepositoryImpl(EntityManagerFactory factory) {\n\t\t if(factory.unwrap(SessionFactory.class) == null){\n\t\t\t throw new NullPointerException(\"factory is not a hibernate factory\");\n\t\t }\n\t\t this.sessionFactory = factory.unwrap(SessionFactory.class);\n\t }", "@Autowired\n\t@Bean(name=\"sessionFactory\")\n\tpublic SessionFactory getSessionFactory(DataSource dataSource) {\n\t\tLocalSessionFactoryBuilder sessionBuilder = new LocalSessionFactoryBuilder(dataSource);\n\t\tsessionBuilder.addAnnotatedClasses(Korisnik.class, Rola.class, Predmet.class\n\t\t\t\t, PredmetKorisnika.class, Tema.class, Materijal.class, Komentar.class);\n\t\tsessionBuilder.addProperties(getHibernateProperties());\n\t\t\n\t\treturn sessionBuilder.buildSessionFactory();\n\t}", "public Session getCurrentSession() {\r\n return sessionFactory.getCurrentSession();\r\n }", "@Autowired\n public CuestionarioDaoHibernate(SessionFactory sessionFactory) {\n this.setSessionFactory(sessionFactory);\n }", "public ObjectifyFactory factory() {\n return ofy().factory();\n }" ]
[ "0.7659082", "0.7306056", "0.7166389", "0.7160805", "0.71571684", "0.711056", "0.70543855", "0.7008249", "0.69902825", "0.6939603", "0.693418", "0.6877306", "0.6835945", "0.680851", "0.67939013", "0.67912", "0.67658305", "0.674921", "0.6744518", "0.6679184", "0.66707623", "0.66610867", "0.6637671", "0.6525854", "0.65252155", "0.6473227", "0.6473227", "0.6455275", "0.6446601", "0.64290166", "0.639292", "0.6288241", "0.61627316", "0.61194384", "0.60947144", "0.607972", "0.60236377", "0.5992783", "0.59918857", "0.59873337", "0.5922551", "0.59070534", "0.58419883", "0.5840175", "0.5825461", "0.5794451", "0.5790401", "0.5778108", "0.5753103", "0.57495874", "0.57465196", "0.5737579", "0.5735507", "0.5727677", "0.569335", "0.5690628", "0.5620834", "0.5613991", "0.5611413", "0.56085294", "0.5606176", "0.5588937", "0.5576789", "0.55728215", "0.5541279", "0.55330646", "0.5522184", "0.5522024", "0.55065614", "0.5495447", "0.5475002", "0.54507506", "0.54372233", "0.542758", "0.54234016", "0.5412863", "0.5412458", "0.5403441", "0.539836", "0.539429", "0.5385308", "0.53784955", "0.5378244", "0.5374654", "0.5371316", "0.53452617", "0.5337218", "0.5328189", "0.53279644", "0.5325216", "0.5312904", "0.53102225", "0.5299185", "0.52977765", "0.5293401", "0.5273979", "0.52703786", "0.5254523", "0.5251013", "0.524242" ]
0.72619224
2
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.band, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}", "public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}", "@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }" ]
[ "0.72473437", "0.7202402", "0.71960324", "0.7177793", "0.7108265", "0.7040525", "0.70388484", "0.70126176", "0.70101976", "0.6981143", "0.69461405", "0.694", "0.69346833", "0.69183874", "0.69183874", "0.6891571", "0.6884306", "0.68758994", "0.687534", "0.68627334", "0.68627334", "0.68627334", "0.68627334", "0.6853258", "0.6847784", "0.6820167", "0.68177783", "0.68134266", "0.68132955", "0.68132955", "0.6806282", "0.68011856", "0.6798178", "0.67916524", "0.67897713", "0.6788724", "0.6783952", "0.6759952", "0.6757919", "0.6748738", "0.67445415", "0.67445415", "0.6741439", "0.67401767", "0.6726359", "0.6724678", "0.6723058", "0.6723058", "0.6721303", "0.67123276", "0.670777", "0.67050874", "0.670039", "0.66992784", "0.6697299", "0.6695259", "0.6686728", "0.668404", "0.668404", "0.6683142", "0.668091", "0.66799283", "0.6677784", "0.6669004", "0.66677624", "0.66630834", "0.66577506", "0.66577506", "0.66577506", "0.6656902", "0.66553235", "0.66553235", "0.66553235", "0.66530025", "0.66522014", "0.6650771", "0.66497517", "0.6647805", "0.66470283", "0.66469866", "0.6646818", "0.6645723", "0.66454786", "0.66439635", "0.66434425", "0.6642393", "0.6639529", "0.6635146", "0.6634077", "0.6632954", "0.66327274", "0.66327274", "0.66327274", "0.66297686", "0.66288346", "0.66275346", "0.66271275", "0.6625066", "0.6621276", "0.6619167", "0.6619167" ]
0.0
-1
Created by damma on 19.11.2016.
public interface AdminDAO { boolean login(String mail, String password) throws SQLException; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "private void poetries() {\n\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "public final void mo51373a() {\n }", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "public void mo38117a() {\n }", "@Override\n protected void getExras() {\n }", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void interr() {\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo4359a() {\n }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n public int describeContents() { return 0; }", "@Override\n public void init() {\n }", "private void init() {\n\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "private void kk12() {\n\n\t}", "@Override\n void init() {\n }", "private void m50366E() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n protected void initialize() \n {\n \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 boolean func_70814_o() { return true; }", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "private void strin() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n public void init() {}", "@Override\n\tpublic void einkaufen() {\n\t}", "Petunia() {\r\n\t\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n protected void init() {\n }", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "public void mo6081a() {\n }", "private Rekenhulp()\n\t{\n\t}", "@Override\r\n\tpublic void init() {}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "private void init() {\n\n\n\n }", "@Override\n\tpublic void init() {\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\n public void initialize() { \n }", "public Pitonyak_09_02() {\r\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tprotected void initdata() {\n\n\t}", "public void mo21877s() {\n }" ]
[ "0.5959541", "0.5843183", "0.5771781", "0.5699807", "0.5692707", "0.5677689", "0.5677689", "0.5661249", "0.56606394", "0.5584698", "0.55720884", "0.55687016", "0.55680436", "0.55674297", "0.55667883", "0.55515325", "0.55361664", "0.5524856", "0.5497045", "0.5481775", "0.5479543", "0.5478181", "0.5463316", "0.54591674", "0.54579127", "0.54277736", "0.5423442", "0.54170215", "0.54170215", "0.54170215", "0.54170215", "0.54170215", "0.5412025", "0.5404959", "0.53962934", "0.5393722", "0.5383155", "0.5383155", "0.53813547", "0.5375625", "0.53743374", "0.5364924", "0.53573567", "0.5341873", "0.5340997", "0.5337875", "0.5320665", "0.5320551", "0.5320551", "0.5320551", "0.5320551", "0.5320551", "0.5320551", "0.53200746", "0.53200746", "0.5317115", "0.5310845", "0.5310845", "0.5310845", "0.5310845", "0.5310845", "0.5310845", "0.5310845", "0.5306485", "0.5302627", "0.5301896", "0.5301896", "0.52970254", "0.52967066", "0.52967066", "0.52967066", "0.52879536", "0.52879536", "0.52879536", "0.52751434", "0.52751434", "0.52751434", "0.52744526", "0.5272045", "0.5269537", "0.5266401", "0.52658963", "0.52627623", "0.52571046", "0.52513206", "0.5245601", "0.5244386", "0.5239084", "0.5236819", "0.52113426", "0.5210889", "0.5207846", "0.5201966", "0.5201749", "0.5199914", "0.5198669", "0.5198283", "0.5197201", "0.5190697", "0.51902544", "0.51807666" ]
0.0
-1
Returns the assigned name
public String getName() { return name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "public String getName() {\r\n\t\treturn name.get();\r\n\t}", "public String getName() { return name.get(); }", "public String getName()\r\n\t{\r\n\t\treturn name; // gives the value of the name to the caller\r\n\t}", "public final String getName() {\n\treturn name.getName();\n }", "final public Identifier getName ()\n {\n\treturn myName;\n }", "public String getName() {\n return name.get();\n }", "public java.lang.String getName();", "public String getName() {\n return name + \"\";\n }", "String getName() ;", "private String getName() {\n\t\treturn name;\n\t}", "public final String name ()\r\n {\r\n return _name;\r\n }", "public String getName()\n\t{\n\t\tString strName;\n\t\tstrName=this.name;\n\t\treturn strName;\n\t}", "public String name() {\n this.use();\n\n return name;\n }", "public String getName() {\n\t\treturn(name);\n\t}", "public String getName() {\r\n assert name != null;\r\n return name;\r\n }", "public Identifier getName();", "public String getName(){\n \treturn this.name().replace(\"_\", \" \");\n }", "public String getsName() {\n return sName;\n }", "protected String getName() {\n\t\treturn name;\n\t}", "protected String getName() {\n\t\treturn name;\n\t}", "public String getName()\n \t{\n \t\treturn name;\n \t}", "@Override\n\t\tfinal public String getName() {\n\t\t\treturn this.Name;\n\t\t}", "public String getTheName() {\n\t\treturn name.getText();\n\t}", "public String getName() \n {\n \treturn name;\n }", "public String getName()\n\t{\treturn name;\t}", "public String getName() {\r\n \t\t\treturn name;\r\n \t\t}", "public String getName()\n\t{ return name; }", "public String getName() {\r\n \treturn name;\r\n }", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();" ]
[ "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.7473182", "0.74537116", "0.7452006", "0.7395485", "0.7367816", "0.7365892", "0.73468995", "0.7339115", "0.73117113", "0.7275501", "0.7253939", "0.72273135", "0.72188246", "0.71996874", "0.7191787", "0.7189272", "0.71569234", "0.715113", "0.71447664", "0.7136404", "0.7136404", "0.7127233", "0.7126266", "0.712101", "0.71164656", "0.71153194", "0.7113186", "0.71062493", "0.7104701", "0.71003616", "0.71003616", "0.71003616", "0.71003616", "0.71003616", "0.71003616", "0.71003616", "0.71003616", "0.71003616", "0.71003616", "0.71003616", "0.71003616", "0.71003616", "0.71003616", "0.71003616", "0.71003616", "0.71003616", "0.71003616", "0.71003616", "0.71003616", "0.71003616" ]
0.0
-1
Returns the child expression
public CsdlExpression getValue() { return value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Operator getChild() {\r\n\t\treturn child;\r\n\t}", "Expression getExpression();", "Expression getExpression();", "Expression getExpression();", "Expression getExpression();", "DExpression getExpression();", "public Node getExpression() {\r\n return expression;\r\n }", "XExpression getExpression();", "public abstract XPathExpression getExpression();", "public Object getExpression();", "public Expression getExpression() {\r\n\t\treturn this.expression;\r\n\t}", "public Expr getExpression()\n {\n Parser.validateExpr(expression, analysis);\n return expression;\n }", "public XPathExpression getUnderlyingExpression() {\n return exp;\n }", "public List<Expression> getSubExpressions();", "public PrimaryExpression getExpression()\r\n {\r\n\treturn m_expression;\r\n }", "public N getChild() {\n\t\tcheckRep();\n\t\treturn this.child;\n\t}", "private Expression addChildToExpression(Node child, Expression exp) {\n \tType childType; // childType declared to be set depending on what the child node is\n\n \t// Adds the child to the appropriate part of the expression (left, right, operator)\n\n\t\t// If the child is an InternalNode, call traverseTree to determine its type.\n\t\tif (!child.isLeaf()) {\n \t\tchildType = traverseTree(child);\n \t}\n\n\t\t// If the child is an operator, add its corresponding connector to the expression\n \telse if (child.isOperator()) {\n \t exp.setExpressionSymbol((Connector)((LeafNode)child).getToken());\n \t\treturn exp;\n \t}\n\n \t// Ignore parenthesis\n \telse if (!TypeUtilities.isParenthesis(child)) {\n \t // Look up the variable in variableTypes to obtain its type\n \t\tchildType = this.variableTypes.variableType((Variable) ((LeafNode) child).getToken());\n \t if (childType == null) {\n \t \tthrow new UndeterminableTypeException(\"Variable could not be found in Variable Types\");\n\t\t\t}\n \t} else {\n \t return exp;\n \t}\n \treturn TypeUtilities.addTypeToExpression(childType, exp);\n }", "public Expression getExpression() {\n if (this.expression == null) {\n // lazy init must be thread-safe for readers\n synchronized (this) {\n if (this.expression == null) {\n preLazyInit();\n this.expression = new SimpleName(this.ast);\n postLazyInit(this.expression, EXPRESSION_PROPERTY);\n }\n }\n }\n return this.expression;\n }", "public IExpressionPart getExpressionPart()\r\n\t{\r\n\t\treturn expressionPart;\r\n\t}", "public String getExpression() {\n return _expression;\n }", "String getExpression();", "String getExpression();", "private Expr expression() {\n return assignment();\n }", "public ExpressionInterface getExpression() {\r\n\t\treturn this.expression;\r\n\t}", "LogicExpression getExpr();", "Expression getExp();", "public String getExpression() {\n return expression;\n }", "public String getExpression() {\n return expression;\n }", "public String getExpression() {\n return expression;\n }", "Expr getExpr();", "public CompoundExpression getParent (){\n return _parent;\n }", "public String getExpression() {\r\n return tree.infixExpression();\r\n }", "public Node expression()\r\n\t{\r\n\t\tNode lhs = term();\r\n\t\tif(lhs!=null)\r\n\t\t{\r\n\t\t\tint index = lexer.getPosition();\r\n\t\t\tLexer.Token token = lexer.getToken();\r\n\t\t\twhile(token == Lexer.Token.PLUS\r\n\t\t\t\t||token == Lexer.Token.MINUS)\r\n\t\t\t{\r\n\t\t\t\tNode rhs = term(); \r\n\t\t\t\tif(rhs!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(token == Lexer.Token.PLUS)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlhs = new Add(lhs,rhs);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(token == Lexer.Token.MINUS)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlhs = new Sub(lhs,rhs);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tindex = lexer.getPosition();\r\n\t\t\t\t\ttoken = lexer.getToken();\r\n\t\t\t\t}\r\n\t\t\t\telse break;\r\n\t\t\t}\r\n\t\t\tlexer.setPosition(index);\r\n\t\t}\r\n\t\treturn lhs;\r\n\t}", "private Expression toExpression() {\n Expression lhs = null, rhs = null;\n if (base instanceof DerefSymbol) {\n lhs = ((DerefSymbol)base).toExpression();\n } else if (base instanceof AccessSymbol) {\n lhs = ((AccessSymbol)base).toExpression();\n } else if (base instanceof Identifier) {\n lhs = new Identifier(base);\n } else {\n PrintTools.printlnStatus(0,\n \"[WARNING] Unexpected access expression type\");\n return null;\n }\n rhs = new Identifier(member);\n return new AccessExpression(lhs, AccessOperator.MEMBER_ACCESS, rhs);\n }", "public String getChild() {\n return child;\n }", "ArrayList<Expression> getChildren();", "public final int child ()\r\n {\r\n return _value.child();\r\n }", "public interface CompositeExpression extends Expression {\n\n\t/**\n\t * Returns the list of current subexpressions; null if none\n\t */\n\tArrayList<Expression> getChildren();\n\n\t/**\n\t * Adds a subexpression\n\t */\n\tExpression addChild(boolean composite);\n\n\t/**\n\t * Removes a subexpression\n\t */\n\tvoid removeChild(Expression e);\n}", "@Override\n\tpublic OpIterator[] getChildren() {\n\t\tOpIterator[] childOperators = new OpIterator[1];\n\t\tchildOperators[0] = childOperator;\n\t\treturn childOperators;\n\t}", "public child getChild() {\n return this.child;\n }", "@Override\n public String toString() {\n return \"Expression\";\n }", "public org.pentaho.pms.cwm.pentaho.meta.core.CwmExpression getExpression();", "public void expression(Node n_parent) {\r\n if(token.get(lookAheadPossition).contains(\"ident(\")||token.get(lookAheadPossition).contains(\"num(\")||token.get(lookAheadPossition).contains(\"boollit(\")||token.get(lookAheadPossition).equals(\"LP\")){\r\n System.out.println(\":: expression::if- \"+n_parent.getData());\r\n\r\n Node makeown = new Node (\"makeown\");\r\n Node n_factor = this.simpleExpression(makeown);\r\n\r\n //compNode = expressionNode.addChild(\"Compare\");\r\n //Node n_connect =\r\n this.restExpression(n_parent,n_factor);\r\n //n_parent.setNodeChild(n_connect);\r\n }\r\n }", "SubQueryOperand createSubQueryOperand();", "public static Expression VisitChildren(ExpressionVisitor visitor) { throw Extensions.todo(); }", "@Override\r\n public double eval() {\r\n return (this.child == null) ? 0.0 : this.child.eval();\r\n }", "protected Evaluable parseExpression() throws ParsingException {\n Evaluable sub = parseSubExpression();\n\n while (_token != null &&\n _token.type == TokenType.Operator &&\n \">=<==!=\".indexOf(_token.text) >= 0) {\n\n String op = _token.text;\n\n next(true);\n\n Evaluable sub2 = parseSubExpression();\n\n sub = new OperatorCallExpr(new Evaluable[] { sub, sub2 }, op);\n }\n\n return sub;\n }", "Expression createExpression();", "@Override public JannotTreeJCExpression getLeftOperand()\n{\n return createTree(getNode().getLeftOperand()); \n}", "public XbaseGrammarAccess.XParenthesizedExpressionElements getXParenthesizedExpressionAccess() {\r\n\t\treturn gaXbase.getXParenthesizedExpressionAccess();\r\n\t}", "public XbaseGrammarAccess.XParenthesizedExpressionElements getXParenthesizedExpressionAccess() {\n\t\treturn gaXbase.getXParenthesizedExpressionAccess();\n\t}", "public XbaseGrammarAccess.XParenthesizedExpressionElements getXParenthesizedExpressionAccess() {\n\t\treturn gaXbase.getXParenthesizedExpressionAccess();\n\t}", "Expression expression() throws SyntaxException {\r\n\t\tToken first = t;\r\n\t\tExpression e0 = orExpression();\r\n\t\tif (isKind(OP_QUESTION)) {\r\n\t\t\tconsume();\r\n\t\t\tExpression e1 = expression();\r\n\t\t\tmatch(OP_COLON);\r\n\t\t\tExpression e2 = expression();\r\n\t\t\te0 = new ExpressionConditional(first, e0, e1, e2);\r\n\t\t}\r\n\t\treturn e0;\r\n\t}", "ASTNode rebuild() {\n ASTNode child = null;\n switch (this.type) {\n case \"else if statement\":\n child = children.get(0);\n break;\n\n default:\n }\n\n return this;\n }", "public Node simpleExpression(Node n_parent) {\r\n\r\n if(token.get(lookAheadPossition).contains(\"ident(\")||token.get(lookAheadPossition).contains(\"num(\")||token.get(lookAheadPossition).contains(\"boollit(\")||token.get(lookAheadPossition).equals(\"LP\")){\r\n System.out.println(\":: simpleExpression::if \"+n_parent.getData());\r\n Node makeown = new Node (\"makeown\");\r\n Node n_factor = this.term(makeown);\r\n //if (!(n_parent==null)) {n_parent.setNodeChild(n_factor); }//simpleExpression(n_factor); }\r\n //if (n_parent.getData().contains(\"-\")) {n_parent.setNodeChild(n_factor); simpleExpression(n_factor); } /////////************add\r\n //addNode = simpleExpressionNode.addChild(\"Add\");\r\n return(this.restSimpleExpression(n_parent,n_factor ));\r\n }\r\n return(null);\r\n }", "Expr expr();", "Expression getValue();", "Expression getValue();", "com.google.type.Expr getCelExpression();", "ExpressionCalculPrimary getExpr();", "public String toString() {\n return m_expression;\n }", "public Expression asExpression() {\n switch (TYPE) {\n case EXPRESSION:\n return EXPRESSION;\n case IDENTIFIER:\n return new Variable(VALUE);\n case LITERAL:\n if (VALUE.matches(\"\\\\d+\")) {\n return new LInteger(Integer.parseInt(VALUE));\n } else if (VALUE.equals(\"true\") || VALUE.equals(\"false\")) {\n return LBoolean.resolve(VALUE.equals(\"true\"));\n } else if (VALUE.equals(\"null\")) {\n return LNull.NULL;\n } else {\n return new LString(VALUE);\n }\n default:\n throw ErrorLog.get(\"Unexpected symbol '%s'\", VALUE);\n }\n }", "public default Object expression() {\n\t\treturn info().values().iterator().next();\n\t}", "OclExpressionCS getBodyExpression();", "public abstract Expression generateExpression(GenerationContext context);", "@Override\r\n\tpublic String toString() {\r\n\t\tString string = \"\";\r\n\t\tif (expressionTree.getNumberOfChildren()==0)\r\n\t\t\treturn expressionTree.getValue();\r\n\t\telse{\r\n\t\t\tstring += \"(\";\r\n\t\t\tfor (int i = 0; i < expressionTree.getNumberOfChildren(); i++){\r\n\t\t\t\tTree<String> subtree = expressionTree.getChild(i);\r\n\t\t\t\tif (subtree.getNumberOfChildren()==0)\r\n\t\t\t\t\tstring += subtree.getValue();\r\n\t\t\t\telse\r\n\t\t\t\t\tstring += (new Expression(subtree.toString())).toString()+\" \";\r\n\t\t\t\tif (i < expressionTree.getNumberOfChildren()-1)\r\n\t\t\t\t\tstring += \" \" + expressionTree.getValue()+\" \";\r\n\t\t\t}\r\n\t\t\tstring += \")\";\r\n\t\t}\r\n\t\treturn string;\r\n\t}", "public CompoundExpression getParent()\r\n\t\t{\r\n\t\t\treturn _parent;\r\n\t\t}", "Expr expr() throws IOException {\n\t\tExpr e = term();\n\t\twhile (look.tag == '+' || look.tag == '-') {\n\t\t\tToken tok = look;\n\t\t\tmove();\n\t\t\te = new Arith(tok, e, term());\n\t\t}\n\t\treturn e;\n\t}", "public Figure getChild() {\n\t\treturn _child;\n\t}", "public IBiNode getChild() {\n return this.child;\n }", "public FcgLevel child() {\n\t\tif (direction == IN_AND_OUT) {\n\t\t\t// undefined--this node goes in both directions\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\"To get the child of the source level you \" + \"must use the constructor directly\");\n\t\t}\n\n\t\treturn child(direction);\n\t}", "public Node getChild();", "ParenthesisExpr createParenthesisExpr();", "@Override\n public IStatement getChild(int i) {\n\t return this._children.get(i);\n }", "public Expression getEndExpression() {\r\n\r\n\t\tint stack_size = 1;\r\n\t\tint end = size() - 1;\r\n\t\tfor (int n = end; n > 0; --n) {\r\n\t\t\tObject ob = elementAt(n);\r\n\t\t\tif (ob instanceof Operator) {\r\n\t\t\t\t++stack_size;\r\n\t\t\t} else {\r\n\t\t\t\t--stack_size;\r\n\t\t\t}\r\n\r\n\t\t\tif (stack_size == 0) {\r\n\t\t\t\t// Now, n .. end represents the new expression.\r\n\t\t\t\tExpression new_exp = new Expression();\r\n\t\t\t\tfor (int i = n; i <= end; ++i) {\r\n\t\t\t\t\tnew_exp.addElement(elementAt(i));\r\n\t\t\t\t}\r\n\t\t\t\treturn new_exp;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn new Expression(this);\r\n\t}", "public Element compileExpression() {\n\t\tElement ele = null;\n\t\tString token, tokenType;\n\t\tboolean op;\n\t\tboolean oper = false;\n\t\tString command = \"\";\n\t\tElement expressionParent = document.createElement(\"expression\");\n\n\t\t// if the term-op-term-op cycle breaks, that means its the end of the expression\n\t\tdo {\n\n\t\t\t// At least one term\n\t\t\texpressionParent.appendChild(compileTerm());\n\t\t\t\n\t\t\t//If an operand has been encountered, then can write the command as it is postfix\n\t\t\tif (oper) {\n\t\t\t\twriter.writeCommand(command);\n\t\t\t}\n\t\t\tjackTokenizer clone = new jackTokenizer(jTokenizer);\n\t\t\tclone.advance();\n\t\t\ttoken = clone.presentToken;\n\n\t\t\t// zero or more ops\n\t\t\tif (token.matches(\"\\\\+|-|\\\\*|/|\\\\&|\\\\||<|=|>|~\")) {\n\t\t\t\toper = true;\n\n\t\t\t\tswitch (token) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tcommand = \"add\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tcommand = \"sub\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tcommand = \"call Math.multiply 2\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"/\":\n\t\t\t\t\tcommand = \"call Math.divide 2\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"<\":\n\t\t\t\t\tcommand = \"lt\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \">\":\n\t\t\t\t\tcommand = \"gt\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"=\":\n\t\t\t\t\tcommand = \"eq\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"&\":\n\t\t\t\t\tcommand = \"and\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"|\":\n\t\t\t\t\tcommand = \"or\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tjTokenizer.advance();\n\t\t\t\ttokenType = jTokenizer.tokenType();\n\t\t\t\tele = createXMLnode(tokenType);\n\t\t\t\texpressionParent.appendChild(ele);\n\t\t\t\tjTokenizer.advance();\n\t\t\t\top = true;\n\t\t\t} else {\n\t\t\t\top = false;\n\t\t\t}\n\t\t} while (op);\n\n\t\treturn expressionParent;\n\t}", "public int getNumExpr() {\n return getExprList().getNumChild();\n }", "public Expression getExpression() {\n \treturn nullCheck;\n }", "CriteriaExpression<?> getRightHandOperand();", "Expression getRValue();", "public java.lang.CharSequence getSuboperation() {\n return suboperation;\n }", "public ExpressionNode getCondition();", "protected LambdaTerm getParent() { return parent; }", "public java.lang.CharSequence getSuboperation() {\n return suboperation;\n }", "protected Evaluable parseSubExpression() throws ParsingException {\n Evaluable sub = parseTerm();\n\n while (_token != null &&\n _token.type == TokenType.Operator &&\n \"+-\".indexOf(_token.text) >= 0) {\n\n String op = _token.text;\n\n next(true);\n\n Evaluable sub2 = parseTerm();\n\n sub = new OperatorCallExpr(new Evaluable[] { sub, sub2 }, op);\n }\n\n return sub;\n }", "@Override\n\tpublic WhereNode getRightChild() {\n\t\treturn null;\n\t}", "EolChainedFeatureCallPostfixExpression getChainedFeatureCallPostfixExpression();", "public XmuCoreCompositionChildStatementElements getXmuCoreCompositionChildStatementAccess() {\r\n\t\treturn pXmuCoreCompositionChildStatement;\r\n\t}", "final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) {\r\n\t\tif (property == EXPRESSION_PROPERTY) {\r\n\t\t\tif (get) {\r\n\t\t\t\treturn getExpression();\r\n\t\t\t} else {\r\n\t\t\t\tsetExpression((Expression) child);\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// allow default implementation to flag the error\r\n\t\treturn super.internalGetSetChildProperty(property, get, child);\r\n\t}", "ExpOperand createExpOperand();", "public Node getExpressionOrigin() {\n return element;\n }", "public abstract Expression getInitialExpression();", "final public ASTExpression Expression() throws ParseException {\r\n /*@bgen(jjtree) Expression */\r\n ASTExpression jjtn000 = new ASTExpression(JJTEXPRESSION);\r\n boolean jjtc000 = true;\r\n jjtree.openNodeScope(jjtn000);\r\n try {\r\n switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r\n case QUOTE:\r\n StringLiteral();\r\n jj_consume_token(61);\r\n jjtree.closeNodeScope(jjtn000, true);\r\n jjtc000 = false;\r\n {if (true) return jjtn000;}\r\n break;\r\n case IDENTIFIER:\r\n case INTEGER:\r\n case NOT:\r\n case SUB:\r\n case FLOATING_POINT_LITERAL:\r\n case 59:\r\n LogicalORExpression();\r\n jjtree.closeNodeScope(jjtn000, true);\r\n jjtc000 = false;\r\n {if (true) return jjtn000;}\r\n break;\r\n default:\r\n jj_la1[45] = jj_gen;\r\n jj_consume_token(-1);\r\n throw new ParseException();\r\n }\r\n } catch (Throwable jjte000) {\r\n if (jjtc000) {\r\n jjtree.clearNodeScope(jjtn000);\r\n jjtc000 = false;\r\n } else {\r\n jjtree.popNode();\r\n }\r\n if (jjte000 instanceof RuntimeException) {\r\n {if (true) throw (RuntimeException)jjte000;}\r\n }\r\n if (jjte000 instanceof ParseException) {\r\n {if (true) throw (ParseException)jjte000;}\r\n }\r\n {if (true) throw (Error)jjte000;}\r\n } finally {\r\n if (jjtc000) {\r\n jjtree.closeNodeScope(jjtn000, true);\r\n }\r\n }\r\n throw new Error(\"Missing return statement in function\");\r\n }", "@Override\n public NodeType ExecuteOperation()\n {\n //if the first child is an operator\n if(this.childNodes[0].isOperator==true)\n {\n BasicOperator basicOperator=(BasicOperator)this.childNodes[0]; \n if(basicOperator.operands==1)\n {\n UnaryOperator unaryOperator=(UnaryOperator)childNodes[0];\n return unaryOperator.PerformOperation(childNodes[1]);\n }\n else if(basicOperator.operands==2)\n {\n BinaryOperator binaryOperator=(BinaryOperator)childNodes[0];\n return binaryOperator.PerformOperation(childNodes[1], childNodes[2]);\n }\n else if(basicOperator.operands==3)\n {\n TernaryOperator ternaryOperator=(TernaryOperator)childNodes[0];\n return ternaryOperator.PerformOperation(childNodes[1], childNodes[2], childNodes[3]);\n }\n }\n //if not an operator\n else\n {\n return this.childNodes[0].ExecuteOperation();\n }\n return null;\n }", "@Override\n\tpublic ASTNode getRightChild() {\n\t\treturn this.rightChild ;\n\t}", "public Expression getExpression() {\n return optionalConditionExpression; }", "private Expr primary() {\n if(match(FALSE)) return new Expr.Literal(false);\n if(match(TRUE)) return new Expr.Literal(true);\n if(match(NIL)) return new Expr.Literal(null);\n\n if(match(NUMBER, STRING)) {\n // These values have already been parsed into Java values by the scanner\n return new Expr.Literal(previous().literal);\n }\n\n if(match(SUPER)) { // We hit super! Treat this much like \"get\".\n Token keyword = previous();\n consume(DOT, \"Expect '.' after 'super'.\");\n Token method = consume(IDENTIFIER, \"Expect superclass method name.\");\n return new Expr.Super(keyword, method);\n }\n\n if(match(THIS)) return new Expr.This(previous());\n\n if(match(IDENTIFIER)) {\n return new Expr.Variable(previous()); // This is what allows the use of variables\n }\n\n if(match(LEFT_PAREN)) {\n Expr expr = expression();\n consume(RIGHT_PAREN, \"Expect ')' after expression.\");\n return new Expr.Grouping(expr);\n }\n\n throw error(peek(), \"Expected expression.\");\n }", "public final ManchesterOWLSyntaxAutoComplete.expression_return expression() {\n ManchesterOWLSyntaxAutoComplete.expression_return retval = new ManchesterOWLSyntaxAutoComplete.expression_return();\n retval.start = input.LT(1);\n ManchesterOWLSyntaxAutoComplete.conjunction_return c = null;\n ManchesterOWLSyntaxAutoComplete.expression_return chainItem = null;\n ManchesterOWLSyntaxAutoComplete.conjunction_return conj = null;\n ManchesterOWLSyntaxAutoComplete.complexPropertyExpression_return cpe = null;\n try {\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:106:2:\n // ( ^( DISJUNCTION (c= conjunction )+ ) | ^( PROPERTY_CHAIN\n // (chainItem= expression )+ ) | conj= conjunction | cpe=\n // complexPropertyExpression )\n int alt4 = 4;\n switch (input.LA(1)) {\n case DISJUNCTION: {\n alt4 = 1;\n }\n break;\n case PROPERTY_CHAIN: {\n alt4 = 2;\n }\n break;\n case IDENTIFIER:\n case ENTITY_REFERENCE:\n case CONJUNCTION:\n case NEGATED_EXPRESSION:\n case SOME_RESTRICTION:\n case ALL_RESTRICTION:\n case VALUE_RESTRICTION:\n case CARDINALITY_RESTRICTION:\n case ONE_OF: {\n alt4 = 3;\n }\n break;\n case INVERSE_OBJECT_PROPERTY_EXPRESSION: {\n alt4 = 4;\n }\n break;\n default:\n if (state.backtracking > 0) {\n state.failed = true;\n return retval;\n }\n NoViableAltException nvae = new NoViableAltException(\"\", 4, 0, input);\n throw nvae;\n }\n switch (alt4) {\n case 1:\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:107:4:\n // ^( DISJUNCTION (c= conjunction )+ )\n {\n match(input, DISJUNCTION, FOLLOW_DISJUNCTION_in_expression226);\n if (state.failed) {\n return retval;\n }\n match(input, Token.DOWN, null);\n if (state.failed) {\n return retval;\n }\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:107:19:\n // (c= conjunction )+\n int cnt2 = 0;\n loop2: do {\n int alt2 = 2;\n int LA2_0 = input.LA(1);\n if (LA2_0 >= IDENTIFIER && LA2_0 <= ENTITY_REFERENCE\n || LA2_0 == CONJUNCTION || LA2_0 == NEGATED_EXPRESSION\n || LA2_0 >= SOME_RESTRICTION && LA2_0 <= ONE_OF) {\n alt2 = 1;\n }\n switch (alt2) {\n case 1:\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:107:21:\n // c= conjunction\n {\n pushFollow(FOLLOW_conjunction_in_expression235);\n c = conjunction();\n state._fsp--;\n if (state.failed) {\n return retval;\n }\n if (state.backtracking == 1) {\n ((ManchesterOWLSyntaxTree) retval.start)\n .setCompletions(c.node.getCompletions());\n }\n }\n break;\n default:\n if (cnt2 >= 1) {\n break loop2;\n }\n if (state.backtracking > 0) {\n state.failed = true;\n return retval;\n }\n EarlyExitException eee = new EarlyExitException(2, input);\n throw eee;\n }\n cnt2++;\n } while (true);\n match(input, Token.UP, null);\n if (state.failed) {\n return retval;\n }\n }\n break;\n case 2:\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:110:6:\n // ^( PROPERTY_CHAIN (chainItem= expression )+ )\n {\n match(input, PROPERTY_CHAIN, FOLLOW_PROPERTY_CHAIN_in_expression248);\n if (state.failed) {\n return retval;\n }\n match(input, Token.DOWN, null);\n if (state.failed) {\n return retval;\n }\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:110:24:\n // (chainItem= expression )+\n int cnt3 = 0;\n loop3: do {\n int alt3 = 2;\n int LA3_0 = input.LA(1);\n if (LA3_0 >= IDENTIFIER && LA3_0 <= ENTITY_REFERENCE\n || LA3_0 >= DISJUNCTION && LA3_0 <= NEGATED_EXPRESSION\n || LA3_0 >= SOME_RESTRICTION && LA3_0 <= ONE_OF\n || LA3_0 == INVERSE_OBJECT_PROPERTY_EXPRESSION) {\n alt3 = 1;\n }\n switch (alt3) {\n case 1:\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:110:25:\n // chainItem= expression\n {\n pushFollow(FOLLOW_expression_in_expression256);\n chainItem = expression();\n state._fsp--;\n if (state.failed) {\n return retval;\n }\n if (state.backtracking == 1) {\n ((ManchesterOWLSyntaxTree) retval.start)\n .setCompletions(chainItem.node\n .getCompletions());\n }\n }\n break;\n default:\n if (cnt3 >= 1) {\n break loop3;\n }\n if (state.backtracking > 0) {\n state.failed = true;\n return retval;\n }\n EarlyExitException eee = new EarlyExitException(3, input);\n throw eee;\n }\n cnt3++;\n } while (true);\n match(input, Token.UP, null);\n if (state.failed) {\n return retval;\n }\n }\n break;\n case 3:\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:114:5:\n // conj= conjunction\n {\n pushFollow(FOLLOW_conjunction_in_expression276);\n conj = conjunction();\n state._fsp--;\n if (state.failed) {\n return retval;\n }\n if (state.backtracking == 1) {\n ((ManchesterOWLSyntaxTree) retval.start).setCompletions(conj.node\n .getCompletions());\n }\n }\n break;\n case 4:\n // /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntaxAutoComplete.g:118:5:\n // cpe= complexPropertyExpression\n {\n pushFollow(FOLLOW_complexPropertyExpression_in_expression291);\n cpe = complexPropertyExpression();\n state._fsp--;\n if (state.failed) {\n return retval;\n }\n if (state.backtracking == 1) {\n ((ManchesterOWLSyntaxTree) retval.start).setCompletions(cpe.node\n .getCompletions());\n }\n }\n break;\n }\n if (state.backtracking == 1) {\n retval.node = (ManchesterOWLSyntaxTree) retval.start;\n }\n } catch (@SuppressWarnings(\"unused\") RecognitionException | RewriteEmptyStreamException exception) {}\n return retval;\n }", "public XPath getValue()\n {\n return m_valueExpr;\n }", "public Colourizer getChildColour() {\n return childLineColour;\n }", "@Override\n\tpublic String visitExpr(ExprContext ctx) {\n\t\t\t\t\n\t\t\tif(ctx.getChildCount()==1)\n\t\t\t{\n\t\t\t\treturn visitSubexpr(ctx.subexpr());\n\t\t\t}\n\t\t\telse\n\t\t\t\t\n\t\t\t{\n\t\t\t\tString result = \"\";\n\t\t\t\t\n\t\t\t\t\tresult = \"temp\"+ count.count++;\n\t\t\t\tif(ctx.getChild(1).getText().equals(\"+\"))\n\t\t\t\t{\n\t\t\t\t\tsb.append(\"ADD \"+visit(ctx.children.get(0))+\" \"+visitSubexpr(ctx.subexpr())+\" \"+result+\"\\n\");\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsb.append(\"SUB \"+visit(ctx.children.get(0))+\" \"+visitSubexpr(ctx.subexpr())+\" \"+ result+\"\\n\");\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\n\n\t\t\n\t}" ]
[ "0.7111226", "0.68571156", "0.68571156", "0.68571156", "0.68571156", "0.6719686", "0.6662705", "0.6617964", "0.6612416", "0.64333075", "0.64237994", "0.6372781", "0.6346082", "0.63329405", "0.630368", "0.6271644", "0.6230769", "0.62098897", "0.6130496", "0.61277944", "0.61261517", "0.61261517", "0.6112926", "0.6108034", "0.6089752", "0.6084862", "0.6077076", "0.6077076", "0.6077076", "0.60624933", "0.5970036", "0.5959541", "0.5951693", "0.59471905", "0.5908987", "0.58762085", "0.5857807", "0.58557576", "0.5831162", "0.5799439", "0.5797907", "0.5797614", "0.5794997", "0.57918876", "0.5787777", "0.57724434", "0.57720304", "0.5769998", "0.576523", "0.573711", "0.5735267", "0.5735267", "0.5729434", "0.5727122", "0.5720981", "0.5715673", "0.57130456", "0.57130456", "0.5709998", "0.5707526", "0.57045066", "0.5696172", "0.56774867", "0.5673564", "0.5662551", "0.5646668", "0.56443524", "0.560298", "0.55737656", "0.5572513", "0.5559995", "0.5553336", "0.553693", "0.5532502", "0.5528563", "0.55096334", "0.5504614", "0.54706705", "0.5468551", "0.54605764", "0.5450011", "0.54445946", "0.54383236", "0.54300237", "0.54268813", "0.54227126", "0.54164714", "0.54150283", "0.5412428", "0.539863", "0.5391638", "0.53782064", "0.5371337", "0.536347", "0.5361626", "0.53585863", "0.5348113", "0.53468335", "0.5336181", "0.53169495", "0.5316717" ]
0.0
-1
Get reference allele bases. Return null if there is a missing value.
public String getReferenceBases(VariantContext variantContext);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static byte[] getBasesCoveringRefInterval(final int refStart, final int refEnd, final byte[] bases, final int basesStartOnRef, final Cigar basesToRefCigar) {\n if ( refStart < 0 || refEnd < refStart ) throw new IllegalArgumentException(\"Bad start \" + refStart + \" and/or stop \" + refEnd);\n if ( basesStartOnRef < 0 ) throw new IllegalArgumentException(\"BasesStartOnRef must be >= 0 but got \" + basesStartOnRef);\n if ( bases == null ) throw new IllegalArgumentException(\"Bases cannot be null\");\n if ( basesToRefCigar == null ) throw new IllegalArgumentException(\"basesToRefCigar cannot be null\");\n if ( bases.length != basesToRefCigar.getReadLength() ) throw new IllegalArgumentException(\"Mismatch in length between reference bases \" + bases.length + \" and cigar length \" + basesToRefCigar);\n\n int refPos = basesStartOnRef;\n int basesPos = 0;\n int basesStart = -1;\n int basesStop = -1;\n boolean done = false;\n\n for ( int iii = 0; ! done && iii < basesToRefCigar.numCigarElements(); iii++ ) {\n final CigarElement ce = basesToRefCigar.getCigarElement(iii);\n switch ( ce.getOperator() ) {\n case I:\n basesPos += ce.getLength();\n break;\n case M: case X: case EQ:\n for ( int i = 0; i < ce.getLength(); i++ ) {\n if ( refPos == refStart )\n basesStart = basesPos;\n if ( refPos == refEnd ) {\n basesStop = basesPos;\n done = true;\n break;\n }\n refPos++;\n basesPos++;\n }\n break;\n case D:\n for ( int i = 0; i < ce.getLength(); i++ ) {\n if ( refPos == refEnd || refPos == refStart ) {\n // if we ever reach a ref position that is either a start or an end, we fail\n return null;\n }\n refPos++;\n }\n break;\n default:\n throw new IllegalStateException(\"Unsupported operator \" + ce);\n }\n }\n\n if ( basesStart == -1 || basesStop == -1 )\n throw new IllegalStateException(\"Never found start \" + basesStart + \" or stop \" + basesStop + \" given cigar \" + basesToRefCigar);\n\n return Arrays.copyOfRange(bases, basesStart, basesStop + 1);\n }", "public int variantBases() {\n int ret = referenceAlleleLength;\n for (Alt alt : alts) {\n if (referenceAlleleLength != alt.length()) {\n ret += alt.length();\n }\n }\n return ret;\n }", "String[] fixBases() {\r\n\t\tString[] bases = null;\r\n\t\tint numbases = 1;\r\n\t\tif (useNumbers.isChecked())\r\n\t\t\tnumbases++;\r\n\t\tif (useLetters.isChecked())\r\n\t\t\tnumbases++;\r\n\t\tif (useSentences.isChecked())\r\n\t\t\tnumbases++;\r\n\r\n\t\t// default if no check\r\n\t\tif (numbases == 0) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tbases = new String[numbases];\r\n\r\n\t\tint idx = 0;\r\n\t\tbases[idx] = SDCARD + \"/cakadidi\" + \"/hmm0\";\r\n\t\tidx++;\r\n\t\tif (useNumbers.isChecked()) {\r\n\t\t\tbases[idx] = SDCARD + \"/cakadidi\" + \"/hmm1\";\r\n\t\t\tidx++;\r\n\t\t}\r\n\r\n\t\tif (useLetters.isChecked()) {\r\n\t\t\tbases[idx] = SDCARD + \"/cakadidi\" + \"/hmm2\";\r\n\t\t\tidx++;\r\n\t\t}\r\n\r\n\t\tif (useSentences.isChecked()) {\r\n\t\t\tbases[idx] = SDCARD + \"/cakadidi\" + \"/hmm3\";\r\n\t\t\tidx++;\r\n\t\t}\r\n\r\n\t\treturn bases;\r\n\r\n\t}", "public Optional<String> getRefAllele() {\n return this.placement.getAlleles().stream()\n .map(p -> p.getAllele().getSpdi().getDeletedSequence())\n .findFirst();\n }", "public int getReferenceAlleleLength() {\n return referenceAlleleLength;\n }", "public Vector getRefBanks() {\r\n\treturn fxndf.getRefBanks();\r\n }", "org.hl7.fhir.ObservationReferenceRange[] getReferenceRangeArray();", "public org.dhis2.ns.schema.dxf2.IndicatorRefDocument.IndicatorRef[] getIndicatorRefArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n java.util.List targetList = new java.util.ArrayList();\n get_store().find_all_element_users(INDICATORREF$0, targetList);\n org.dhis2.ns.schema.dxf2.IndicatorRefDocument.IndicatorRef[] result = new org.dhis2.ns.schema.dxf2.IndicatorRefDocument.IndicatorRef[targetList.size()];\n targetList.toArray(result);\n return result;\n }\n }", "@Override\n\tpublic List<CreditAppBankReference> findAll() throws SystemException {\n\t\treturn findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);\n\t}", "Collection<Feature> getReference();", "public java.lang.Object[] getRelationsAsReference() {\n return relationsAsReference;\n }", "public List<Branch> getBranchs()\r\n\t{\t\r\n\t\tif (branchs.size() == 0)\r\n\t\t{\r\n\t\t\t//Lacos abertos carga x terra (redes radiais)\r\n\t\t\tbranchs.addAll(findBranchs());\t\t\r\n\t\t\r\n\t\t}\r\n\t\treturn branchs; \r\n\t}", "public Collection<Reference> getReferences();", "Variable getRefers();", "public abstract Set<Genome> getAvailableGenomes();", "public ReferenceList getRefList( )\n {\n return _refList;\n }", "double[] getReferenceValues();", "public List<String> getBaseDNs()\n {\n return baseDNs;\n }", "public Collection<UniqueID> getReferenceList() {\n return ObjectGraph.getReferenceList(this.id);\n }", "public java.util.List<ReferenceLine> getReferenceLines() {\n return referenceLines;\n }", "public double findReferenceArea() {\n\t\treturn Math.pow(findChordLength(), 2);\n\t}", "java.util.List getAlignmentRefs();", "public RealRange getReferenceRange(RealRange referenceRange);", "public com.walgreens.rxit.ch.cda.StrucDocBr[] getBrArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n java.util.List targetList = new java.util.ArrayList();\n get_store().find_all_element_users(BR$6, targetList);\n com.walgreens.rxit.ch.cda.StrucDocBr[] result = new com.walgreens.rxit.ch.cda.StrucDocBr[targetList.size()];\n targetList.toArray(result);\n return result;\n }\n }", "public ArrayList<Long> base() {\n\t\tint _size = this.members.size();\n\t\tArrayList<Long> _returns = new ArrayList<Long>(_size);\n\t\tfor (int _index = 0; _index < _size; _index++)\n\t\t\t_returns.add(this.members.get(_index).base());\n\t\treturn _returns;\n\t}", "private List<Reference> getReferences() {\n logger.debug(\"Get references\");\n\n List<Reference> references = new ArrayList<Reference>();\n\n String query = \"SELECT reference_line, pr.reference_id FROM pride_experiment pe, pride_reference pr, pride_reference_exp_link pl WHERE \" +\n \"pe.accession = ? AND pl.reference_id = pr.reference_id AND pl.experiment_id = pe.experiment_id\";\n\n List<Map<String, Object>> results = jdbcTemplate.queryForList(query, getForegroundExperimentAcc());\n for (Map<String, Object> result : results) {\n List<UserParam> userParams = getUserParams(\"pride_reference_param\", ((Long) result.get(\"reference_id\")).intValue());\n List<CvParam> cvParams = getCvParams(\"pride_reference_param\", ((Long) result.get(\"reference_id\")).intValue());\n references.add(new Reference((String) result.get(\"reference_line\"), new ParamGroup(cvParams, userParams)));\n }\n\n return references;\n }", "public abstract Value getReferenceValue();", "public ArrayList<String> getBges() {\n ArrayList<String> bges = new ArrayList<>();\n getData(bges, \"getBges\");\n return bges;\n }", "public ArrayList getBricks() {\r\n return totalBricks;\r\n }", "public static DatabaseReference getBase() {\n return FirebaseDatabase.getInstance().getReference();\n }", "public Cluster[] getReferences () {\n return references;\n }", "@Override\n public List<RefsetEntry> getRefsetEntries() {\n return refsetEntries;\n }", "public String getLBR_ICMS_TaxBaseType();", "public List<BitOrarioOraLezione> get() {\n List<BitOrarioOraLezione> ris = new ArrayList<>();\n for (ArrayList<BitOrarioOraLezione>[] riga : orario) {\n if (riga != null)\n for (ArrayList<BitOrarioOraLezione> v : riga) {\n if (v != null)\n for (BitOrarioOraLezione bitOrarioOraLezione : v) {\n if (bitOrarioOraLezione != null)\n ris.add(bitOrarioOraLezione);\n }\n }\n }\n return ris;\n }", "public int getAltoBotones() {\n\t\treturn this.altoBotones;\n\t}", "MolecularSequenceReferenceSeq getReferenceSeq();", "public int getNrBolasBrancasGanhas(){\n return jogo.getNrBolasBrancasGanhas();\n }", "public java.util.List<Reference> basedOn() {\n return getList(Reference.class, FhirPropertyNames.PROPERTY_BASED_ON);\n }", "public BigDecimal getLBR_TaxBase();", "public List<CellRef> getCellReferences()\n {\n return myCellReferences;\n }", "org.hl7.fhir.ObservationReferenceRange getReferenceRangeArray(int i);", "public BigDecimal getACC_BR() {\r\n return ACC_BR;\r\n }", "public final List<Element> getReferences() {\r\n return this.getReferences(true, true);\r\n }", "public String getBoundries() {\n return (String) getAttributeInternal(BOUNDRIES);\n }", "public List<Connection> getReferenceDataConnections()\n {\n if (referenceDataConnections == null)\n {\n return null;\n }\n else if (referenceDataConnections.isEmpty())\n {\n return null;\n }\n else\n {\n return referenceDataConnections;\n }\n }", "public com.redknee.util.crmapi.soap.subscriptions.xsd._2009._04.SubscriptionBundleBalance[] getBalances(){\n return localBalances;\n }", "public java.util.List<Reference> account() {\n return getList(Reference.class, FhirPropertyNames.PROPERTY_ACCOUNT);\n }", "private List<C4892c> m9768LA() {\n if (this.brz == null) {\n return new ArrayList();\n }\n if (this.brA != null && !this.brA.isEmpty()) {\n return this.brA;\n }\n C3981a aVar = new C3981a(new C3965h(this));\n C3982b bVar = new C3982b(new C3975i(this));\n C3987c cVar = new C3987c();\n UpgradeBroadcastReceiver cA = UpgradeBroadcastReceiver.m10244cA(VivaBaseApplication.m8749FZ());\n cA.getClass();\n this.brA = Arrays.asList(new C4892c[]{aVar, bVar, cVar, new C4128c(), new C3979a(new C3976j(this)), new HomeInterstitialPopF()});\n return this.brA;\n }", "public Position[] getConvientBaseBuildingLocations() {\n\t\treturn convientBaseLocations;\n\t}", "public AxisAlignedBB getBoundingBox()\r\n {\r\n return null;\r\n }", "AngleReference getAngRef();", "public Map<Integer, CorefChain> getCorefChains () {\n\t\treturn ccg;\n\t}", "public double getBrre() {\n return brre;\n }", "private List<BaseLocation> getExpectedBaseLocations() {\r\n final List<BaseLocation> baseLocations = new ArrayList<>();\r\n\r\n final Position position1 = new Position(3104, 3856, PIXEL);\r\n final Position center1 = new Position(3040, 3808, PIXEL);\r\n baseLocations.add(new BaseLocation(position1, center1, 13500, 5000, true, false, true));\r\n\r\n final Position position2 = new Position(2208, 3632, PIXEL);\r\n final Position center2 = new Position(2144, 3584, PIXEL);\r\n baseLocations.add(new BaseLocation(position2, center2, 9000, 5000, true, false, false));\r\n\r\n final Position position3 = new Position(640, 3280, PIXEL);\r\n final Position center3 = new Position(576, 3232, PIXEL);\r\n baseLocations.add(new BaseLocation(position3, center3, 13500, 5000, true, false, true));\r\n\r\n final Position position4 = new Position(2688, 2992, PIXEL);\r\n final Position center4 = new Position(2624, 2944, PIXEL);\r\n baseLocations.add(new BaseLocation(position4, center4, 9000, 5000, true, false, false));\r\n\r\n final Position position5 = new Position(1792, 2480, PIXEL);\r\n final Position center5 = new Position(1728, 2432, PIXEL);\r\n baseLocations.add(new BaseLocation(position5, center5, 12000, 0, true, true, false));\r\n\r\n final Position position6 = new Position(3200, 1776, PIXEL);\r\n final Position center6 = new Position(3136, 1728, PIXEL);\r\n baseLocations.add(new BaseLocation(position6, center6, 13500, 5000, true, false, true));\r\n\r\n final Position position7 = new Position(640, 1968, PIXEL);\r\n final Position center7 = new Position(576, 1920, PIXEL);\r\n baseLocations.add(new BaseLocation(position7, center7, 9000, 5000, true, false, false));\r\n\r\n final Position position8 = new Position(1792, 1808, PIXEL);\r\n final Position center8 = new Position(1728, 1760, PIXEL);\r\n baseLocations.add(new BaseLocation(position8, center8, 12000, 0, true, true, false));\r\n\r\n final Position position9 = new Position(2336, 560, PIXEL);\r\n final Position center9 = new Position(2272, 512, PIXEL);\r\n baseLocations.add(new BaseLocation(position9, center9, 13500, 5000, true, false, true));\r\n\r\n final Position position10 = new Position(3584, 720, PIXEL);\r\n final Position center10 = new Position(3520, 672, PIXEL);\r\n baseLocations.add(new BaseLocation(position10, center10, 9000, 5000, true, false, false));\r\n\r\n final Position position11 = new Position(544, 432, PIXEL);\r\n final Position center11 = new Position(480, 384, PIXEL);\r\n baseLocations.add(new BaseLocation(position11, center11, 13500, 5000, true, false, true));\r\n\r\n return baseLocations;\r\n }", "public List<Referee> findAllReferees(){\n\t\treturn refereeRepository.findAll();\n\t}", "public static int[] getGeqBandFrequencies()\n {\n return akParam_gebf_;\n }", "public java.util.List<teledon.network.protobuffprotocol.TeledonProtobufs.CazCaritabil.Builder>\n getCazuriBuilderList() {\n return getCazuriFieldBuilder().getBuilderList();\n }", "public int getRequiredBase() {\n return requiredBase;\n }", "@Override\n public String getReferenceInfo()\n {\n return \"\";\n }", "public BigDecimal getCOVERING_ACC_BR() {\r\n return COVERING_ACC_BR;\r\n }", "@PrivateAPI\n\tpublic int getReferenceCount() {\n\t\treturn this.referencesFromCapacityMap.get();\n\t}", "public PBounds getBoundsReference() {\n\t\tPBounds bds = super.getBoundsReference();\n\t\tgetUnionOfChildrenBounds(bds);\n\n\t\tcachedChildBounds.setRect(bds);\n\t\tdouble scaledIndent = INDENT/renderCamera.getViewScale();\t\t\n\t\tbds.setRect(bds.getX()-scaledIndent,bds.getY()-scaledIndent,bds.getWidth()+2*scaledIndent,bds.getHeight()+2*scaledIndent);\n\t\t\n\t\treturn bds;\n\t}", "public godot.wire.Wire.Basis.Builder getBasisValueBuilder() {\n return getBasisValueFieldBuilder().getBuilder();\n }", "static DatabaseReference getDBRef() {\n return mDBRef;\n }", "@Override\r\n\tpublic String getRefBillType() {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic String getRefBillType() {\n\t\treturn null;\r\n\t}", "public Set<String> branches() {\r\n\t\treturn branchesPartOf;\r\n\t}", "public String getLBR_ICMSST_TaxBaseType();", "public BigDecimal getLBR_ICMSST_TaxBase();", "public default List<InheritanceRelation> inheritanceRelations() throws LookupException {\n return nonMemberInheritanceRelations();\n }", "public gov.nih.nlm.ncbi.www.soap.eutils.efetch_seq.GBInterval_interbp_type0 getGBInterval_interbp(){\n return localGBInterval_interbp;\n }", "godot.wire.Wire.AABB getAabbValue();", "public java.util.List<com.lesen.rpc.protobuf.LesenRPCProto.LesenRPCResult.Builder> \n getReaultBuilderList() {\n return getReaultFieldBuilder().getBuilderList();\n }", "public String getBase()\n {\n return base;\n }", "Table getReferences();", "public Set<DependencyElement> getReferences() {\n\t\treturn Collections.unmodifiableSet(references);\n\t}", "java.lang.String getRef();", "public Double[] getBase() {\n\t\tDouble[] base = new Double[2];\n\t\tbase[0] = config[0];\n\t\tbase[1] = config[1];\n\t\treturn base;\n\t}", "public LocatorIF getBase() {\n return base_address;\n }", "public Reference getRootRef() {\n return this.rootRef;\n }", "public java.lang.String getReference() {\n return reference;\n }", "public Set<CompoundName> getResult() { return references; }", "@Override\n\tpublic String getReferenceFiles() {\n\t\treturn model.getReferenceFiles();\n\t}", "public static Currency getReferenceCurrency() {\n return REFERENCE.get();\n }", "public java.lang.String getBlh() {\r\n return localBlh;\r\n }", "public AtomicReference<LocatableInquiry> getReferenceGroundItemInquiry();", "String getReference();", "String getReference();", "public byte[][] getBiArray() {\n return mbarrayBiValues;\n }", "@Nullable\n String getRef();", "public org.hl7.fhir.ResourceReference[] getMemberArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n java.util.List targetList = new java.util.ArrayList();\n get_store().find_all_element_users(MEMBER$14, targetList);\n org.hl7.fhir.ResourceReference[] result = new org.hl7.fhir.ResourceReference[targetList.size()];\n targetList.toArray(result);\n return result;\n }\n }", "public ArrayList<Institution> getFinalBank() {\n\t\treturn Bank;\n\t}", "public java.util.List<String> getReferencedTables() {\n return referencedTables;\n }", "@Override\r\n\tpublic Ref getRef() {\n\t\treturn ref;\r\n\t}", "public static String GetBaseAddress() {\n\t\t// Load Projects Settings XML file\n\t\tDocument doc = Utilities.LoadDocumentFromFilePath(IDE.projectFolderPath + \"\\\\ProjectSettings.xml\");\n\t\tString baseAddress = \"\";\n\t\tif (doc != null) {\n\t\t\t// Get all \"files\"\n\t\t\tNodeList baseAddressNode = doc.getDocumentElement().getElementsByTagName(\"baseAddress\");\n\t\t\t// Handle result\n\t\t\tif (baseAddressNode.getLength() > 0) {\n\t\t\t\tbaseAddress = Utilities.getXmlNodeAttribute(baseAddressNode.item(0), \"value\");\n\t\t\t}\n\t\t}\n\t\treturn baseAddress;\n\t}", "public static final ULocale[] getAvailableULocales(String baseName) {\n return getAvailEntry(baseName).getULocaleList();\n }", "godot.wire.Wire.AABBOrBuilder getAabbValueOrBuilder();", "@java.lang.Override\n public godot.wire.Wire.BasisOrBuilder getBasisOrBuilder() {\n return getBasis();\n }", "public static int calcFirstBaseMatchingReferenceInCigar(final Cigar cigar, int readStartByBaseOfCigar) {\n if ( cigar == null ) throw new IllegalArgumentException(\"cigar cannot be null\");\n if ( readStartByBaseOfCigar >= cigar.getReadLength() ) throw new IllegalArgumentException(\"readStartByBaseOfCigar \" + readStartByBaseOfCigar + \" must be <= readLength \" + cigar.getReadLength());\n\n int hapOffset = 0, refOffset = 0;\n for ( final CigarElement ce : cigar.getCigarElements() ) {\n for ( int i = 0; i < ce.getLength(); i++ ) {\n switch ( ce.getOperator() ) {\n case M:case EQ:case X:\n if ( hapOffset >= readStartByBaseOfCigar )\n return refOffset;\n hapOffset++;\n refOffset++;\n break;\n case I: case S:\n hapOffset++;\n break;\n case D:\n refOffset++;\n break;\n default:\n throw new IllegalStateException(\"calcFirstBaseMatchingReferenceInCigar does not support cigar \" + ce.getOperator() + \" in cigar \" + cigar);\n }\n }\n }\n\n throw new IllegalStateException(\"Never found appropriate matching state for cigar \" + cigar + \" given start of \" + readStartByBaseOfCigar);\n }", "public List<String> getBcs() {\r\n\t\treturn bcs;\r\n\t}" ]
[ "0.60400814", "0.5845048", "0.5763207", "0.57165545", "0.5613893", "0.55103934", "0.54740614", "0.52987874", "0.5224707", "0.5156535", "0.51146764", "0.5098722", "0.50952584", "0.5090776", "0.50789297", "0.505635", "0.5054244", "0.5045322", "0.49672166", "0.49636588", "0.49612054", "0.49479407", "0.49428207", "0.49391723", "0.49290043", "0.49081856", "0.4897207", "0.4862752", "0.48396525", "0.48319146", "0.4821897", "0.48062083", "0.48045504", "0.47912297", "0.47666", "0.4748904", "0.4736763", "0.4727648", "0.47268224", "0.47242844", "0.47229645", "0.4713596", "0.47092924", "0.4705835", "0.46894377", "0.46831757", "0.46778616", "0.46504027", "0.46467668", "0.4635797", "0.46168202", "0.46124196", "0.46003285", "0.45969594", "0.45942393", "0.45834813", "0.45704186", "0.4565617", "0.45635322", "0.45618263", "0.45560524", "0.45542145", "0.4551506", "0.4550882", "0.45481536", "0.45481536", "0.45467627", "0.45432252", "0.4541325", "0.45385858", "0.45370215", "0.4536118", "0.4522911", "0.45206362", "0.4516423", "0.4509605", "0.4509156", "0.44971994", "0.44927034", "0.44886553", "0.44865263", "0.44807005", "0.44792262", "0.44765544", "0.4470789", "0.44703937", "0.44698933", "0.44698933", "0.44677487", "0.44617915", "0.44607443", "0.4458411", "0.4453952", "0.44487035", "0.44424647", "0.44373593", "0.44349283", "0.44339848", "0.44307357", "0.44306815" ]
0.6624555
0
Get names from VariantContext's ID field. It should be a semicolon separated list of unique identifiers where available. As names field is repeated, if the value is a missing value("."), return an empty list.
public List<String> getNames(VariantContext variantContext);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Set<String> getIdentifiers();", "public Vector<String> getIdentifiers()\n\t{\n\t\tfinal Vector<String> rets = new Vector<String>();\n\t\trets.add(identifier);\n\t\treturn rets;\n\t}", "@DISPID(10) //= 0xa. The runtime will prefer the VTID if present\r\n @VTID(17)\r\n java.lang.String[] getNames();", "@Override\n\tpublic String[] getIds() {\n\t\treturn null;\n\t}", "java.util.List<String>\n getPrimaryKeyNamesList();", "public java.util.List<String> getIds() {\n return ids;\n }", "Collection<?> idValues();", "String [] getPropertyNames(Long id) throws RemoteException;", "identifierList getIdentifierList();", "public String[] getIdsFromSmartKey(String value);", "Set<String> getIdentifiers() throws GuacamoleException;", "public List<Object[]> listAgentIdName();", "public Set<String> getFieldNames() {\n Set<String> names = new HashSet<String>();\n for (IdentifierProperties field : fields) {\n names.add(field.getName());\n }\n\n return names;\n }", "@DISPID(14) //= 0xe. The runtime will prefer the VTID if present\r\n @VTID(21)\r\n java.lang.String[] getNamesU();", "public Object[] getNameComponentIDs() {\n\t\tif (_nameComponentIDs != null)\n\t\t\treturn _nameComponentIDs.toArray();\n\t\telse\n\t\t\treturn null;\n\t}", "private String[] getNameParts() {\n return field.getName().split(\"_\");\n }", "public List<String> getListOfIds() {\n return listOfIds;\n }", "Enumeration getIds();", "public java.util.List<Identifier> identifier() {\n return getList(Identifier.class, FhirPropertyNames.PROPERTY_IDENTIFIER);\n }", "public java.util.List<Identifier> identifier() {\n return getList(Identifier.class, FhirPropertyNames.PROPERTY_IDENTIFIER);\n }", "public String getIds() {\n return ids;\n }", "public String getIds() {\n return ids;\n }", "public String[] getIDs() {\n return impl.getIDs();\n }", "public com.google.protobuf.ProtocolStringList\n getPrimaryKeyNamesList() {\n return primaryKeyNames_.getUnmodifiableView();\n }", "@Override\n\tpublic Object getId() {\n\t\treturn Arrays.asList(name, source);\n\t}", "public String getIds() {\n return this.ids;\n }", "private String[] createDvdListWithIds() {\n if (dao.listAll().size() > 0) {\n //create string array set to the size of the dvds that exist\n String[] acceptable = new String[dao.listAll().size()];\n //index counter\n int i = 0;\n //iterate through dvds that exist\n for (DVD currentDVD : dao.listAll()) {\n //at the index set the current Dvd's id, a delimeter, and the title\n acceptable[i] = currentDVD.getId() + \", \" + currentDVD.getTitle();\n //increase the index counter\n i++;\n }\n //return the string array\n return acceptable;\n }\n return null;\n }", "public Collection<String> getParameterIds();", "@Override\n\tpublic Object[] getIds() {\n\t\treturn null;\n\t}", "io.dstore.values.StringValue getPersonCharacteristicIds();", "java.util.List<String> getRepeatedStringFieldList();", "public static List<String> getDeviceList() {\n\t\tList<String> str = CommandRunner.exec(CMD_GET_DEVICE_ID);\n\t\tList<String> ids = new ArrayList<String>();\n\t\tfor (int i = 1; i < str.size(); i++) {\n\t\t\tString id = str.get(i).split(\" |\\t\")[0].trim();\n\t\t\tif (!id.isEmpty()) {\n\t\t\t\tids.add(id);\n\t\t\t}\n\t\t}\n\t\treturn ids;\n\t}", "public com.google.protobuf.ProtocolStringList\n getPrimaryKeyNamesList() {\n return primaryKeyNames_;\n }", "public ArrayList<String> getStatsIds() {\n\t\tArrayList<String> arr = new ArrayList<String>();\n\t\tNodeList nl = getStats();\n\t\tint len = nl.getLength();\n\t\tString str = \"\";\n\t\tfor (int i = 0; i < len; i++) {\n\t\t\tString id = ParserHelper.requiredAttributeGetter((Element) nl.item(i), \"id\");\n\t\t\tif (id != null) {\n\t\t\t\tarr.add(id);\n\t\t\t\tstr += (id + \"\\n\");\n\t\t\t}\n\t\t}\n\t\treturn arr;\n\t}", "List<String> findAllIds();", "public Vector getServiceIds() throws ServiceException {\n return namingService.getServiceIds();\n }", "String getId() {\r\n\t\treturn option.getId() + \".\" + field.getName();\r\n\t}", "public List<String> listSelectedSamithiById(Long id);", "public String getIDName();", "public static String[] getLangIDs() {\r\n\t\tHashMap<String, String> ges = getLangs();\r\n\r\n\t\tString[] names = new String[ges.size()];\r\n\t\tint i = 0;\r\n\t\t// add all\r\n\t\tfor (String key : ges.keySet()) {\r\n\t\t\tnames[i] = key;\r\n\t\t\ti++;\r\n\t\t}\r\n\r\n\t\treturn names;\r\n\t}", "public static ImmutableSet<Integer> getIds(){\n\t\t\treturn m_namesMap.rightSet();\n\t\t}", "public List<String> getIdList(RequestInfo requestInfo, String tenantId, String idName, String idformat, int count) {\n\t\t\n\t\tList<IdRequest> reqList = new ArrayList<>();\n\t\tfor (int i = 0; i < count; i++) {\n\t\t\treqList.add(IdRequest.builder().idName(idName).format(idformat).tenantId(tenantId).build());\n\t\t}\n\n\t\tIdGenerationRequest request = IdGenerationRequest.builder().idRequests(reqList).requestInfo(requestInfo).build();\n\t\tStringBuilder uri = new StringBuilder(configs.getIdGenHost()).append(configs.getIdGenPath());\n\t\tIdGenerationResponse response = mapper.convertValue(restRepo.fetchResult(uri, request).get(), IdGenerationResponse.class);\n\t\t\n\t\tList<IdResponse> idResponses = response.getIdResponses();\n\t\t\n if (CollectionUtils.isEmpty(idResponses))\n throw new CustomException(\"IDGEN ERROR\", \"No ids returned from idgen Service\");\n \n\t\treturn idResponses.stream().map(IdResponse::getId).collect(Collectors.toList());\n\t}", "public List<String> getDistinctResourceIdName(){\n\t\treturn jtemp.queryForList(\"SELECT DISTINCT resource_id||' '||resource_type_id||' '||resource_name FROM resources\", String.class);\n\t}", "public com.google.protobuf.ProtocolStringList\n getDatasetIdsList() {\n return datasetIds_;\n }", "public java.util.List<java.lang.String> getVariantSetIds() {\n return variantSetIds;\n }", "public List<String> getPlanItemIds();", "public Map<String, Object> getIds() {\n return ids;\n }", "Set<II> getIds();", "@Override\n\tpublic List<String> getTeamNames(Integer id) {\n\t\treturn null;\n\t}", "String[] extractIdPropertyNames(Object entity);", "public static String[] getAvailableIDs();", "public List<Long> getIdList(String key) throws IdentifierException {\n Object value = get(key);\n if (!(value instanceof List) || ((List)value).isEmpty() || !(((List)value).get(0) instanceof String))\n return emptyLongList;\n List<String> stringList = (List<String>)value;\n List<Long> longList = new ArrayList<>(stringList.size());\n for (String longString : stringList)\n longList.add(Utils.stringToId(longString));\n return longList;\n }", "public String[] getExtensionIds();", "public static String[] obtenerIds() throws IOException{\n\t\tint numOfLines=countLines(HOSPITALES_DATA_FILE) ;\n\t String[] idsArr = new String[numOfLines];\n\t BufferedReader fileReader = null;\n fileReader = new BufferedReader(new FileReader(HOSPITALES_DATA_FILE));\n String line = \"\";\n int counter = 0;\n while ((line = fileReader.readLine()) != null)\n {\n String[] tokens = line.split(DELIMITER);\n \n idsArr[counter] = tokens[0];\n counter++;\n }\t\t\t\n fileReader.close();\n\t\treturn idsArr; \n\t}", "public java.util.List<java.lang.String> getVariantSetIds() {\n return variantSetIds;\n }", "io.dstore.values.StringValueOrBuilder getPersonCharacteristicIdsOrBuilder();", "public com.google.protobuf.ProtocolStringList\n getInviteeIdsList() {\n return inviteeIds_;\n }", "public static java.lang.String[] getAvailableIDs() { throw new RuntimeException(\"Stub!\"); }", "public List<String> getFields() {\n if (!Strings.isNullOrEmpty(fields)) {\n return Arrays.asList(fields.split(\",\"));\n } else {\n return Collections.emptyList();\n }\n }", "@Transient\n @JsonProperty(\"symbols\")\n public List<Long> getSymbolsAsIds() {\n List<Long> ids = new LinkedList<>();\n symbols.stream().map(Symbol::getId).forEach(ids::add);\n return ids;\n }", "public String getIdentifiers() {\n return identifiers;\n }", "private List<String> getSqIds(String qid)\n\t{\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tList<Element> sq_list = sq_node.selectNodes(\"row[parent_qid=\" + qid + \"]/qid\");\n\t\treturn sq_list.stream()\n\t\t\t.map(e -> e.getText())\n\t\t\t.collect(Collectors.toList()); // Make a list of qid elements to a list of strings\n\t}", "public ArrayList<String> get_list_ids(){\n\t\t\treturn list_ids;\n\t\t\t\n\t\t}", "private static String formStringFromList(List<Long> ids)\n {\n if (ids == null || ids.size() == 0)\n return null;\n\n StringBuilder idsBuffer = new StringBuilder();\n for (Long id : ids)\n {\n idsBuffer.append(id).append(\",\");\n }\n\n return idsBuffer.toString().substring(0, idsBuffer.length() - 1);\n }", "public List getAllIds();", "public List<String > getNames(){\n List<String> names = new ArrayList<>();\n String fNameQuery = \"SELECT \" + _IDP + \",\" + COL_F_NAME + \",\" + COL_L_NAME + \" FROM \" + TPYTHONISTAS + \" ;\";\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor c = db.rawQuery(fNameQuery, null);\n String name;\n if (c.moveToFirst()) {\n do {\n // put together NameID#, period, Lastname, Firstname\n name = c.getString(0) + \". \" + c.getString(2) + \", \" + c.getString(1);\n names.add(name);\n } while (c.moveToNext());\n }\n c.close();\n db.close();\n return names;\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic List<DropDownModel> getPropertyId() {\n\t\tList<DropDownModel> propertyNameList = new ArrayList<DropDownModel>();\n\n\t\ttry {\n\t\t\tList<Object[]> x = em.createNamedStoredProcedureQuery(\"AssignmentOfSeatingPlan\")\n\t\t\t\t\t.setParameter(\"actionType\", \"getPropertyId\")\n\t\t\t\t\t.setParameter(\"actionValue\", \"\")\n\t\t\t\t\t.getResultList();\n\n\t\t\tfor (Object[] m : x) {\n\t\t\t\tDropDownModel dropDownModel = new DropDownModel(m[0], m[1]);\n\t\t\t\tpropertyNameList.add(dropDownModel);\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn propertyNameList;\n\t}", "private List<String> getTagNames() {\n String query = \"SELECT DISTINCT ?tagName WHERE { ?thing isa:tag [isa:tagName ?tagName; isa:tagDetail ?tagDetail]}\";\n List<Map<String, String>> results = moduleContext.getModel().executeSelectQuery(query);\n List<String> tags = new ArrayList<>();\n results.forEach(solution -> tags.add(solution.get(\"tagName\")));\n return tags;\n }", "public ArrayList<String> getAllVarNames() {\n\t\tArrayList<String> names = new ArrayList<String>();\n\t\tfor (NameSSA n : name.values()){\n\t\t\tString root = n.name();\n\t\t\tfor (int i=0;i<=n.cpt;i++)\n\t\t\t\tnames.add(root+\"_\"+i);\n\t\t}\n\t\treturn names;\n\t}", "public java.util.List<java.lang.String> getGeneIds() {\n return geneIds;\n }", "public static synchronized List getFieldNames()\n {\n if (fieldNames == null)\n {\n fieldNames = new ArrayList();\n fieldNames.add(\"NewsletterId\");\n fieldNames.add(\"NewsletterCode\");\n fieldNames.add(\"Status\");\n fieldNames.add(\"Priority\");\n fieldNames.add(\"IssuedDate\");\n fieldNames.add(\"ClosedDate\");\n fieldNames.add(\"SentTime\");\n fieldNames.add(\"EmailFormat\");\n fieldNames.add(\"LanguageId\");\n fieldNames.add(\"CustomerCatId\");\n fieldNames.add(\"CustomerType\");\n fieldNames.add(\"CustLanguageId\");\n fieldNames.add(\"CustCountryId\");\n fieldNames.add(\"RelDocument\");\n fieldNames.add(\"RelDocStatus\");\n fieldNames.add(\"RelProjectId\");\n fieldNames.add(\"RelProductId\");\n fieldNames.add(\"ProjectId\");\n fieldNames.add(\"ProductId\");\n fieldNames.add(\"Subject\");\n fieldNames.add(\"Body\");\n fieldNames.add(\"Notes\");\n fieldNames.add(\"Created\");\n fieldNames.add(\"Modified\");\n fieldNames.add(\"CreatedBy\");\n fieldNames.add(\"ModifiedBy\");\n fieldNames = Collections.unmodifiableList(fieldNames);\n }\n return fieldNames;\n }", "public com.google.protobuf.ProtocolStringList\n getDatasetIdsList() {\n return datasetIds_.getUnmodifiableView();\n }", "public io.dstore.values.StringValue getPersonCharacteristicIds() {\n if (personCharacteristicIdsBuilder_ == null) {\n return personCharacteristicIds_ == null ? io.dstore.values.StringValue.getDefaultInstance() : personCharacteristicIds_;\n } else {\n return personCharacteristicIdsBuilder_.getMessage();\n }\n }", "public String[] getExtResDepsID(){\n\n\t\tString[] depids = new String[extResDepsID.size()];\n\n\t\tint i = 0;\n\t\tfor(Enumeration en = extResDepsID.elements(); en.hasMoreElements(); ){\n\t\t\t\n\t\t\tdepids[i] = (String)en.nextElement();\n\t\t}\n\n\t\treturn depids;\n\n//\t\treturn (String[])extResDepsID.toArray();\n\t}", "public java.util.List<java.lang.String> getGeneIds() {\n return geneIds;\n }", "public io.dstore.values.StringValue getPersonCharacteristicIds() {\n return personCharacteristicIds_ == null ? io.dstore.values.StringValue.getDefaultInstance() : personCharacteristicIds_;\n }", "private ArrayList<String> obtenerIds(ArrayList<String> values){\n\t\tArrayList<String> ids = new ArrayList<>();\n\t\tfor(String valor : values){\n\t\t\tids.add(postresId.get(valor));\n\t\t}\n\t\treturn ids;\n\t}", "ArrayList<String> getAllDatatypeIds();", "public org.hl7.fhir.Identifier[] getIdentifierArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n java.util.List targetList = new java.util.ArrayList();\n get_store().find_all_element_users(IDENTIFIER$0, targetList);\n org.hl7.fhir.Identifier[] result = new org.hl7.fhir.Identifier[targetList.size()];\n targetList.toArray(result);\n return result;\n }\n }", "public List<String> getCustomerIds() {\r\n\t\treturn getSingleColWithMultipleRowsList(GET_CUSTOMER_IDS);\r\n\t}", "public List<String> getExpIdentifierList() {\r\n return expIdentifierList;\r\n }", "@AutoEscape\n\tpublic String getFieldId();", "public List<String> getSpectrumIdList()\r\n\t{\r\n\t\t/*\r\n\t\t * Return list of spectrum id values.\r\n\t\t */\r\n\t\treturn fetchSpectrumIds();\r\n\t}", "public String[] getFieldNames()\n {\n return this.fieldMap.keyArray(String.class);\n }", "public String getPartIdList() {\n return (String)ensureVariableManager().getVariableValue(\"PartIdList\");\n }", "@JsonProperty(\"variant_ids\")\n public List<Object> getVariantIds() {\n return variantIds;\n }", "public String [] _truncatable_ids()\r\n {\r\n return _ids_list;\r\n }", "public List<String> getSelectFields() {\n List<String> selectField = new ArrayList<>();\n for (SelectItem item : queryBody.getSelect().getSelectItems()) {\n if (item instanceof SingleColumn) {\n Expression expression = ((SingleColumn)item).getExpression();\n if (expression instanceof Identifier) {\n selectField.add(((Identifier)expression).getValue());\n }\n\n }\n }\n return selectField;\n }", "Collection<LocatorIF> getItemIdentifiers();", "@JsonValue\n\tpublic final String fieldId() {\n\t \treturn this.name().replace(\"_\", \".\");\n\t}", "private String getIds(List<UserTO> userList) {\r\n\t\tSet<String> idSet = new HashSet<String>();\r\n\t\tfor (UserTO user : userList) {\r\n\t\t\tidSet.add(user.getOrgNodeId());\r\n\t\t\tif (null != user.getOrgNodeCodePath()) {\r\n\t\t\t\tString[] orgHierarchy = user.getOrgNodeCodePath().split(\"~\");\r\n\t\t\t\tSet<String> orgHierarchySet = new HashSet<String>(Arrays.asList(orgHierarchy));\r\n\t\t\t\tidSet.addAll(orgHierarchySet);\r\n\t\t\t}\r\n\t\t}\r\n\t\tString ids = idSet.toString();\r\n\t\tids = ids.substring(1, ids.length() - 1);\r\n\t\treturn ids;\r\n\t}", "List<String> toList(Iterable<UUID> ids) {\n\t\tList<String> list = new ArrayList<String>();\n\t\tfor (UUID guid : ids) {\n\t\t\tlist.add(guid.toString());\n\t\t}\n\t\treturn list;\n\t}", "public java.util.List<IdentifierDt> getIdentifierElement() { \n\t\tif (myIdentifier == null) {\n\t\t\tmyIdentifier = new java.util.ArrayList<IdentifierDt>();\n\t\t}\n\t\treturn myIdentifier;\n\t}", "@Override\r\n\tpublic ArrayList<String> getValues(String key) {\r\n\t\tArrayList<String> vals = meta.get(key); \r\n\r\n\t\t// May be multiple sampleIDs per key separated by commas\r\n\t\tif (key.equals(\"sampleIDs\")) {\r\n\t\t\tArrayList<String> newVals = new ArrayList<String>();\r\n\t\t\tfor (String v: vals) {\r\n\t\t\t\tString[] parts = v.split(\",\");\r\n\t\t\t\tfor (String p: parts) {\r\n\t\t\t\t\t// Duplicates may occur\r\n\t\t\t\t\tString pt = p.trim();\r\n\t\t\t\t\tif (newVals.contains(pt) == false) {\r\n\t\t\t\t\t\tnewVals.add(pt);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn newVals;\r\n\t\t}\r\n\r\n\t\treturn vals;\r\n\t}", "public com.google.protobuf.ProtocolStringList\n getInviteeIdsList() {\n return inviteeIds_.getUnmodifiableView();\n }", "@Nonnull List<String> getNameList();", "public List<String> getOIDataFileIds() {\n return Identifiable.getIds(getOIDataFileList());\n }", "public String[] getFieldNames();", "LinkedHashSet<String> getOrderedBeanIds();", "public java.util.List<IdentifierDt> getIdentifier() { \n\t\tif (myIdentifier == null) {\n\t\t\tmyIdentifier = new java.util.ArrayList<IdentifierDt>();\n\t\t}\n\t\treturn myIdentifier;\n\t}" ]
[ "0.6307344", "0.62573737", "0.6147748", "0.6071034", "0.60244924", "0.6012562", "0.60001457", "0.5966074", "0.5946676", "0.5944957", "0.5908764", "0.5837209", "0.58072275", "0.57875484", "0.5731748", "0.57269746", "0.5722786", "0.571182", "0.56969804", "0.56969804", "0.56843793", "0.56843793", "0.56501025", "0.56498235", "0.5629784", "0.56093407", "0.5609", "0.5596862", "0.55343574", "0.54952306", "0.5494062", "0.5491525", "0.54725814", "0.54424155", "0.54326445", "0.541564", "0.53780365", "0.53693825", "0.53673625", "0.5358763", "0.5352554", "0.5342821", "0.53337336", "0.53332114", "0.5332971", "0.53324723", "0.5325669", "0.5325187", "0.53164303", "0.53104526", "0.53103405", "0.53032964", "0.5286683", "0.52861774", "0.5282721", "0.5272954", "0.5270536", "0.52672106", "0.52593064", "0.5238561", "0.52367324", "0.522394", "0.52212334", "0.52210957", "0.52163535", "0.52121043", "0.5205386", "0.52044314", "0.52030987", "0.5187235", "0.51781565", "0.51742697", "0.51717645", "0.5168586", "0.5152718", "0.5149935", "0.5144628", "0.5143173", "0.514162", "0.5140239", "0.51389784", "0.5135959", "0.5128894", "0.5121857", "0.5121641", "0.51204467", "0.51132905", "0.5108827", "0.5108788", "0.5108525", "0.50959045", "0.5095605", "0.5091027", "0.5087843", "0.5083667", "0.5080976", "0.50808144", "0.50805587", "0.5078558", "0.5069362" ]
0.62740827
1
Add variant Info field into BQ table row. Iterate each field in the VCFHeader, check if the field is presented. If the field type is `Flag` but not presented, it will set `false` in the corresponding row field. And the row field name should match the schema format. If the attribute name does not match the schema format, we will get the sanitized field name and set the row value in the sanitized field. Also check if the field value size matches the count defined by VCFHeader and convert each value to the defined type. If the info field number in the VCF header is `A`, add it to the ALT sub field. The size for this field should be equal to the expected alternate bases count, which is the size of the alternate bases value.
public void addInfo(TableRow row, VariantContext variantContext, List<TableRow> altMetadata, VCFHeader vcfHeader, int expectedAltCount);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String makeAltVcfField(BreakendVariant variant) {\n String alt = toPositiveStrand(variant.strand(), variant.alt());\n String ref = toPositiveStrand(variant.strand(), variant.ref());\n return makeAltVcfField(variant.left(), variant.right(), ref, alt);\n }", "InstrumentedType withAuxiliaryField(FieldDescription.Token token, Object value);", "protected String handleDataFieldInRow(Component item, Object obj, String row, int index, String originalId) {\r\n if (!(item instanceof DataField)) {\r\n return row;\r\n }\r\n\r\n String currentValue = ObjectPropertyUtils.getPropertyValueAsText(obj, ((DataField) item).getPropertyName());\r\n\r\n if (currentValue == null) {\r\n currentValue = \"\";\r\n }\r\n\r\n //for readOnly DataFields replace the value marked with the value on the current object\r\n row = row.replaceAll(VALUE_TOKEN + originalId + VALUE_TOKEN, currentValue);\r\n currentColumnValue = currentValue;\r\n\r\n Inquiry dataFieldInquiry = ((DataField) item).getInquiry();\r\n if (dataFieldInquiry != null && dataFieldInquiry.getInquiryParameters() != null\r\n && dataFieldInquiry.getInquiryLink() != null) {\r\n\r\n String inquiryLinkId = dataFieldInquiry.getInquiryLink().getId().replace(ID_TOKEN, \"\")\r\n + UifConstants.IdSuffixes.LINE + index;\r\n\r\n // process each Inquiry link parameter by replacing each in the inquiry url with their current value\r\n for (String key : dataFieldInquiry.getInquiryParameters().keySet()) {\r\n String name = dataFieldInquiry.getInquiryParameters().get(key);\r\n\r\n //omit the binding prefix from the key to get the path relative to the current object\r\n key = key.replace(((DataField) item).getBindingInfo().getBindByNamePrefix() + \".\", \"\");\r\n\r\n if (ObjectPropertyUtils.isReadableProperty(obj, key)) {\r\n String value = ObjectPropertyUtils.getPropertyValueAsText(obj, key);\r\n row = row.replaceFirst(\"(\" + inquiryLinkId + \"(.|\\\\s)*?\" + name + \")=.*?([&|\\\"])\",\r\n \"$1=\" + value + \"$3\");\r\n }\r\n }\r\n }\r\n\r\n return row;\r\n }", "private void updateVslaInformation() {\n VslaInfo vslaInfo = new VslaInfo();\n vslaInfo.setGroupName(vslaName);\n vslaInfo.setMemberName(representativeName);\n vslaInfo.setMemberPost(representativePost);\n vslaInfo.setMemberPhoneNumber(repPhoneNumber);\n vslaInfo.setGroupAccountNumber(grpBankAccount);\n vslaInfo.setPhysicalAddress(physAddress);\n vslaInfo.setRegionName(regionName);\n vslaInfo.setLocationCordinates(locCoordinates);\n vslaInfo.setIssuedPhoneNumber(grpPhoneNumber);\n vslaInfo.setIsDataSent(\"1\");\n vslaInfo.setSupportType(grpSupportType);\n vslaInfo.setNumberOfCycles(numberOfCycles);\n databaseHandler.upDateGroupData(vslaInfo, currentDatabaseId);\n }", "private void addBasicInfo(ArrayList<Object> libValues, Apk apk, Map<String, Object> apkBasicInfoMap) {\n\t\t// add column1: Apk Name\n//\t\tString apkName = apkReadUtils.getApkName(apkFile);\n\t\tString apkName = apk.getShortName();\n\t\tlibValues.add(apkName); \n\t\t// add column2: Apk Version\n\t\tlibValues.add(apkBasicInfoMap.get(\"versionName\")); \n\t\t// add column3: Package Name\n\t\tlibValues.add(apkBasicInfoMap.get(\"package\")); \n\t\t// add column4: NDK Type\n\t\tlibValues.add(apk.getApkType()); \n\t}", "public void addExtraField(final ZipExtraField ze) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"04a0a86a-8034-4044-aeed-cebe7016e2d1\");\n if (ze instanceof UnparseableExtraFieldData) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"6b9a9172-8ea2-4aed-8433-17b19d1a9891\");\n unparseableExtra = (UnparseableExtraFieldData) ze;\n } else {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"c4c62a77-912a-4047-b4bc-d8a05e95bc86\");\n if (extraFields == null) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"450fc98b-d668-4300-b141-2c5907baab75\");\n extraFields = new ZipExtraField[] { ze };\n } else {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"5d8f1c11-1f27-4f98-923b-c42685d35e95\");\n if (getExtraField(ze.getHeaderId()) != null) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"7cc8a651-6175-4ec7-ab56-688a497910a8\");\n removeExtraField(ze.getHeaderId());\n }\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"aa062502-071a-4ff6-8692-1c1202b14fec\");\n final ZipExtraField[] zipExtraFields = copyOf(extraFields, extraFields.length + 1);\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"e30c5825-289a-4c05-a5ec-8c2d6bec09e8\");\n zipExtraFields[zipExtraFields.length - 1] = ze;\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"3f326300-d61d-4afa-ae59-fe45855b45a6\");\n extraFields = zipExtraFields;\n }\n }\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"944dff45-ab9b-4e44-b913-045a4e38da7a\");\n setExtra();\n }", "@Override\n public void update(DataAdaptor daptSrc) {\n// DataAdaptor daptDev = daptSrc.childAdaptor(this.dataLabel());\n DataAdaptor daptDev = daptSrc;\n \n this.strDevId = daptDev.stringValue(STR_ATTR_DEVID);\n \n long lngFmtVer = daptDev.longValue(STR_ATTR_FMTVER);\n \n if (lngFmtVer >= 1) {\n \n this.cfgDevice.update(daptDev);\n \n this.datRaw.update(daptDev);\n this.datFit.update(daptDev);\n \n this.sigFitAttrs.update(daptDev);\n \n } else {\n \n MainApplication.getEventLogger().logError(this.getClass(), \"Data unreadable, has bad version format.\");\n\n }\n\n if (lngFmtVer >= 2) \n this.strTypId = daptDev.stringValue(STR_ATTR_TYPID);\n else\n this.strTypId = \"unknown\";\n \n }", "public static StringBuffer writeXML_DBField(StringBuffer sb, int indent, DBField fld, boolean inclInfo, String value, boolean soapXML)\n {\n // -- <Field name=\"NAME\" primaryKey=\"true\" alternateKeys=\"A,B,C\" type=\"DATATYPE\", title=\"TITLE\">VALUE</FIELD>\n\n /* begin Field tag */\n sb.append(XMLTools.PREFIX(soapXML,indent)); \n sb.append(XMLTools.startTAG(soapXML,TAG_Field,\n XMLTools.ATTR(ATTR_name,fld.getName()) +\n (fld.isPrimaryKey()? XMLTools.ATTR(ATTR_primaryKey,\"true\") : \"\") + \n (fld.isAlternateKey()? XMLTools.ATTR(ATTR_alternateKeys,StringTools.join(fld.getAlternateIndexes(),',')) : \"\") + \n (inclInfo? (XMLTools.ATTR(ATTR_type,fld.getDataType()) + XMLTools.ATTR(ATTR_title,fld.getTitle(null))) : \"\"),\n (value == null), (value == null)));\n\n /* valid */\n if (value != null) {\n\n /* value */\n if (fld.isBoolean()) {\n // \"true\" / \"false\"\n sb.append(StringTools.parseBoolean(value,false));\n } else\n if (fld.isNumeric()) {\n // numeric value\n sb.append(value);\n } else\n if (fld.isBinary()) {\n // displayed in hex\n sb.append(value);\n } else { \n // String\n if (!StringTools.isBlank(value)) {\n sb.append(XMLTools.CDATA(soapXML,value));\n }\n }\n \n /* end Field tag */\n sb.append(XMLTools.endTAG(soapXML,TAG_Field,true));\n \n }\n \n /* field xml */\n //Print.logInfo(\"==> \" + sb.toString());\n return sb;\n\n }", "com.google.protobuf.ByteString\n getField1712Bytes();", "public Vector addSuperFields(AClass c, Vector v) {\n\t\tEnumeration e = getFields();\n\t\twhile (e.hasMoreElements()) {\n\t\t\tAField f = (AField) e.nextElement();\n\t\t\tif (f.isVisibleFrom(c))\n\t\t\t\tv.add(f);\n\t\t}\n\t\tif (!isObject())\n\t\t\tv = getSuperClass().addSuperFields(c, v);\n\t\treturn v;\n\t}", "public void addAsFirstExtraField(final ZipExtraField ze) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"4c28d4a6-8986-40c6-b210-d044aab8251a\");\n if (ze instanceof UnparseableExtraFieldData) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"3d9f9c08-e83a-436a-a8e6-86f86bd970af\");\n unparseableExtra = (UnparseableExtraFieldData) ze;\n } else {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"c35acbb6-3608-4438-9a3b-2e13d04a75a3\");\n if (getExtraField(ze.getHeaderId()) != null) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"11874c15-028a-440f-8a51-54f6de7d8834\");\n removeExtraField(ze.getHeaderId());\n }\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"1eda37ab-9698-47a7-98da-b090770a9fd5\");\n final ZipExtraField[] copy = extraFields;\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"52861454-df58-45a4-a4ea-fadccf33506e\");\n final int newLen = extraFields != null ? extraFields.length + 1 : 1;\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"bd7052b3-7eb3-4bec-8203-290549716189\");\n extraFields = new ZipExtraField[newLen];\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"f4f61f84-b9ec-4ec0-b697-37d032a7a8fb\");\n extraFields[0] = ze;\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"86004d7e-add5-4495-b688-e71892b6f3ee\");\n if (copy != null) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"4e30f42c-8c61-4810-b892-2d8b24ce71f8\");\n System.arraycopy(copy, 0, extraFields, 1, extraFields.length - 1);\n }\n }\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"74b18f9f-5af2-497f-a1b9-1aaa00af7a4f\");\n setExtra();\n }", "public void acceptRow( Object[] row ) {\n nrow_++;\n\n /* Get values using the column lookup table.\n * In fact we know what sequence the columns are in so we could\n * hard code the colum indices in here, but doing it like this\n * reduces the chance of programming error. */\n final String ivoid = getString( row, \"ivoid\" );\n final String shortName = getString( row, \"short_name\" );\n final String title = getString( row, \"res_title\" );\n final String refUrl = getString( row, \"reference_url\" );\n final String baseRole = getString( row, \"base_role\" );\n final String roleName = getString( row, \"role_name\" );\n final String email = getString( row, \"email\" );\n final Object intfIndex = getEntry( row, \"intf_index\" );\n final String accessUrl = getString( row, \"access_url\" );\n final String standardId = getString( row, \"standard_id\" );\n final String capType = getString( row, \"cap_type\" );\n final String capDescription = getString( row, \"cap_description\" );\n final String stdVersion = getString( row, \"std_version\" );\n final String subjectTxt = getString( row, \"res_subjects\" );\n\n /* Update this object's data structures in accordance with the\n * information received from this row. */\n if ( ! resMap_.containsKey( ivoid ) ) {\n String[] subjects = subjectTxt == null\n ? new String[ 0 ]\n : subjectTxt.split( SUBJECT_DELIM );\n resMap_.put( ivoid,\n new RegTapResource( ivoid, shortName, title,\n refUrl, subjects ) );\n }\n RegTapResource resource = resMap_.get( ivoid );\n if ( \"contact\".equals( baseRole ) ) {\n resource.contactName_ = roleName;\n resource.contactEmail_ = email;\n }\n else if ( \"publisher\".equals( baseRole ) ) {\n resource.publisherName_ = roleName;\n }\n if ( intfIndex != null ) {\n if ( ! resource.capMap_.containsKey( intfIndex ) ) {\n resource.capMap_.put( intfIndex,\n new RegCapabilityInterface() {\n public String getAccessUrl() {\n return accessUrl;\n }\n public String getStandardId() {\n return standardId;\n }\n public String getXsiType() {\n return capType;\n }\n public String getDescription() {\n return capDescription;\n }\n public String getVersion() {\n return stdVersion;\n }\n } );\n }\n }\n }", "private byte[] encodeFieldTypeEntry(FieldTypeEntry fieldTypeEntry) {\n byte[] bytes = new byte[0];\n bytes = Bytes.add(bytes, Bytes.toBytes(fieldTypeEntry.isMandatory()));\n return EncodingUtil.prefixValue(bytes, EXISTS_FLAG);\n }", "public void subfield(char identifier, char[] data) {\n \t datafield.add(new Subfield(identifier, data));\n }", "public void addVariant(Feature feature){\r\n\t\tthis.alternativeFeatureGroup.get(0).addFeature(feature);\r\n\t}", "com.google.protobuf.ByteString\n getField1216Bytes();", "public void setupFields()\n {\n FieldInfo field = null;\n field = new FieldInfo(this, \"ID\", Constants.DEFAULT_FIELD_LENGTH, null, null);\n field.setDataClass(Integer.class);\n field.setHidden(true);\n field = new FieldInfo(this, \"LastChanged\", Constants.DEFAULT_FIELD_LENGTH, null, null);\n field.setDataClass(Date.class);\n field.setHidden(true);\n field = new FieldInfo(this, \"Deleted\", 10, null, new Boolean(false));\n field.setDataClass(Boolean.class);\n field.setHidden(true);\n field = new FieldInfo(this, \"Description\", 25, null, null);\n field = new FieldInfo(this, \"CurrencyCode\", 3, null, null);\n field = new FieldInfo(this, \"LastRate\", 10, null, null);\n field.setDataClass(Double.class);\n field.setScale(-1);\n field = new FieldInfo(this, \"RateChangedDate\", 12, null, null);\n field.setDataClass(Date.class);\n field.setScale(Constants.DATE_ONLY);\n field = new FieldInfo(this, \"RateChangedBy\", 16, null, null);\n field.setDataClass(Integer.class);\n field = new FieldInfo(this, \"CostingRate\", 10, null, null);\n field.setDataClass(Double.class);\n field.setScale(-1);\n field = new FieldInfo(this, \"CostingChangedDate\", 12, null, null);\n field.setDataClass(Date.class);\n field.setScale(Constants.DATE_ONLY);\n field = new FieldInfo(this, \"CostingChangedBy\", 16, null, null);\n field.setDataClass(Integer.class);\n field = new FieldInfo(this, \"RoundAt\", 1, null, null);\n field.setDataClass(Short.class);\n field = new FieldInfo(this, \"IntegerDesc\", 20, null, \"Dollar\");\n field = new FieldInfo(this, \"FractionDesc\", 20, null, null);\n field = new FieldInfo(this, \"FractionAmount\", 10, null, new Integer(100));\n field.setDataClass(Integer.class);\n field = new FieldInfo(this, \"Sign\", 3, null, \"$\");\n field = new FieldInfo(this, \"LanguageID\", Constants.DEFAULT_FIELD_LENGTH, null, null);\n field.setDataClass(Integer.class);\n field = new FieldInfo(this, \"NaturalInteger\", 20, null, null);\n field = new FieldInfo(this, \"NaturalFraction\", 20, null, null);\n }", "private void populateFieldArray() \r\n\t{\r\n\t\tInteger fieldId;\r\n\t\t/** get input column names which is populated based on the input file\r\n\t\t * format specified in the command file */\r\n\t\tString [] inputColNames = getInputColNames();\r\n\t\tint arrLength; /** Number of columns in the input file*/\r\n\t\tif (null == inputColNames)\r\n\t\t{\r\n\t\t\t/** set array length 2 for two default columns (probeset and chip description)*/\r\n\t\t\tarrLength = 2; \r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t/** Basic Probeset ID and description fields are present for all files \r\n\t\t\t * but the other supplementary information like accession number, unigene and\r\n\t\t\t * entrezgene ids may be present one or many based on the file format */\r\n\t\t\tarrLength = 2 + inputColNames.length; /** add other columns*/\r\n\t\t}\r\n\t\t/** Field array base elements are Probeset and Chip_Desc plus any of acc_no, ugid, & locusid/organism */\r\n\t\tfieldIndexArray = new int [arrLength];\r\n\t\t\r\n\t\t/** Now 0th field in input file is probeset*/\r\n\t\tfieldIndexArray[0] = ((Integer) fieldIdTable.get(\"CIN_PROBESET\")).intValue();\r\n\t\t\r\n\t\tif (inputColNames != null) \r\n\t\t{\r\n\t\t\t/** get the field ids for all column names*/\r\n\t\t\tfor (int i=0; i< inputColNames.length; i++)\r\n\t\t\t{\r\n\t\t\t\t/** Pick up the column from the list of inout columns as obtained based on\r\n\t\t\t\t * the input file format. Then fetch its ID from the FieldIdTable */\r\n\t\t\t\tfieldId = (Integer) fieldIdTable.get(inputColNames[i].toUpperCase());\r\n\t\t\t\tif (null == fieldId)\r\n\t\t\t\t{\r\n\t\t\t\t\t/** no such column name allowed*/\r\n\t\t\t\t\tLogger.log(\"Column name \" + inputColNames[i] + \" is not a valid name\",Logger.WARNING);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t/** add the field id to the index array. Thus fieldIndexArray will have all the \r\n\t\t\t\t\t * column names depending on the file format*/\r\n\t\t\t\t\tfieldIndexArray[1+i] = fieldId.intValue();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t/** ChipDesc field is the last column in the input file. First we have added the default first field\r\n\t\t * as probeset id , then all the middle fields based on the file format and now the last default\r\n\t\t * field which is chipdescription */\r\n\t\tfieldIndexArray[fieldIndexArray.length-1] = ((Integer) fieldIdTable.get(\"CIN_CHIP_DESCRIPTION\")).intValue();\r\n\t\tLogger.log(\"populateFieldArray complete \",Logger.DEBUG);\r\n\t}", "@Override\n\tpublic void setupAddFields(EquationStandardTransaction transaction)\n\t{\n\t\ttransaction.setFieldValue(\"GZBRNM\", \"LOND\"); // Branch mnemonic (4A)\n\t\ttransaction.setFieldValue(\"GZPBR\", \"IPS2\"); // Posting group id or user id, and group level (5A)\n\t\ttransaction.setFieldValue(\"GZVFR\", \"1000106\"); // Value from date (7S,0)\n\t\ttransaction.setFieldValue(\"GZBRND\", \"LOND\"); // Branch mnemonic (4A)\n\t\ttransaction.setFieldValue(\"GZDRF\", \"0014620010\"); // Users own reference for deals, reconciliation etc (16A)\n\t\ttransaction.setFieldValue(\"GZAMA\", \"1500-\"); // Ordinary amount in minor currency units (15P,0)\n\t\ttransaction.setFieldValue(\"GZCCY\", \"PHP\"); // Currency mnemonic (3A)\n\t\ttransaction.setFieldValue(\"GZNPE\", \"1\"); // Number of posting entries (5P,0)\n\t\ttransaction.setFieldValue(\"GZNR1\", \"STOP\"); // Narrative line 1 (35A)\n\t\ttransaction.setFieldValue(\"GZRFR\", \"N\"); // Referred item? (1A)\n\t\ttransaction.setFieldValue(\"GZAUT\", \"Y\"); // Authorised item? (1A)\n\t\ttransaction.setFieldValue(\"GZSSI\", \"N\"); // Special item? (1A)\n\t\ttransaction.setFieldValue(\"GZTTP\", \"C\"); // Transaction type (1A)\n\t\ttransaction.setFieldValue(\"GZHSRL\", \"0014620010\"); // Serial \"number\" forming the key to a stop order (16A)\n\t\ttransaction.setFieldValue(\"GZHAMT\", \"1500-\"); // Stop order amount (15P,0)\n\t\ttransaction.setFieldValue(\"GZAUTC\", \"MASSEYR1\"); // Referred item authorisation code (12A)\n\t\ttransaction.setFieldValue(\"GZCED\", \"2\"); // Currency edit field (1A)\n\t\ttransaction.setFieldValue(\"GZCHQ\", \"N\"); // Cheque item? (1A)\n\t\ttransaction.setFieldValue(\"GZDRFN\", \"0\"); // Cheque serial number (16P,0)\n\t\ttransaction.setFieldValue(\"GZTCCY\", \"PHP\"); // Transaction currency (3A)\n\t\ttransaction.setFieldValue(\"GZTAMA\", \"1500\"); // Transaction amount (15P,0)\n\t\ttransaction.setFieldValue(\"GZHCCY\", \"PHP\"); // Stop order currency (3A)\n\t\ttransaction.setFieldValue(\"GZPSQ7\", \"0000182\"); // 7 Long posting sequence number (7P,0)\n\t}", "com.google.protobuf.ByteString\n getField1618Bytes();", "CharacterTypeInItemVariant getAttribute(Integer id);", "private String create_amplicon_variant_40columns() {\n String outputVariant;\n String hifreq_f = hifreq == 0\n ? \"0\"\n : new DecimalFormat(\"0.0000\").format(hifreq);\n nm = nm > 0 ? nm : 0;\n String nm_f = nm == 0\n ? \"0\"\n : new DecimalFormat(\"0.0\").format(nm);\n\n outputVariant = join(delimiter,\n sample,\n gene,\n chr,\n startPosition,\n endPosition,\n refAllele,\n varAllele,\n\n totalCoverage,\n variantCoverage,\n referenceForwardCount,\n referenceReverseCount,\n variantForwardCount,\n variantReverseCount,\n genotype,\n getRoundedValueToPrint(\"0.0000\", frequency),\n bias,\n getRoundedValueToPrint(\"0.0\", pmean),\n pstd,\n getRoundedValueToPrint(\"0.0\", qual),\n qstd,\n\n getRoundedValueToPrint(\"0.00000\", pvalue),\n oddratio,\n\n getRoundedValueToPrint(\"0.0\", mapq),\n getRoundedValueToPrint(\"0.000\", qratio),\n hifreq_f,\n getRoundedValueToPrint(\"0.0000\", extrafreq),\n\n shift3,\n getRoundedValueToPrint(\"0.000\", msi),\n msint,\n nm_f,\n hicnt,\n hicov,\n leftSequence, rightSequence,\n region,\n varType,\n goodVariantsCount,\n totalVariantsCount,\n noCoverage,\n ampliconFlag\n );\n return outputVariant;\n }", "com.google.protobuf.ByteString\n getField1716Bytes();", "AlgOptTable extend( List<AlgDataTypeField> extendedFields );", "com.google.protobuf.ByteString\n getField1816Bytes();", "protected String handleInputFieldInRow(Component item, Object obj, String row, int index, String originalId) {\r\n if (!(item instanceof InputField) || ((InputField) item).getControl() == null) {\r\n return row;\r\n }\r\n\r\n Control control = ((InputField) item).getControl();\r\n\r\n //updates the name path to the current path for any instance this item's propertyName with\r\n //a collection binding prefix\r\n row = row.replace(\"name=\\\"\" + ((InputField) item).getBindingInfo().getBindingPath() + \"\\\"\",\r\n \"name=\\\"\" + this.getBindingInfo().getBindingPath() + \"[\" + index + \"].\" + ((InputField) item)\r\n .getPropertyName() + \"\\\"\");\r\n\r\n Object value = ObjectPropertyUtils.getPropertyValue(obj, ((InputField) item).getPropertyName());\r\n String stringValue = \"\";\r\n\r\n if (value == null) {\r\n stringValue = \"\";\r\n } else if (value.getClass().isAssignableFrom(boolean.class)) {\r\n stringValue = \"\" + value;\r\n } else if (!(value instanceof Collection)) {\r\n stringValue = ObjectPropertyUtils.getPropertyValueAsText(obj, ((InputField) item).getPropertyName());\r\n }\r\n\r\n String controlId = originalId + \"_line\" + index + UifConstants.IdSuffixes.CONTROL;\r\n\r\n if (control instanceof CheckboxControl && stringValue.equalsIgnoreCase(\"true\")) {\r\n //CheckboxControl handling - only replace if true with a checked attribute appended\r\n row = row.replaceAll(\"(id(\\\\s)*?=(\\\\s)*?\\\"\" + controlId + \"\\\")\", \"$1 checked=\\\"checked\\\" \");\r\n } else if (control instanceof TextControl) {\r\n //TextControl handling - replace with\r\n row = row.replaceAll(\"(id(\\\\s)*?=(\\\\s)*?\\\"\" + controlId + \"\\\"(.|\\\\s)*?value=\\\")(.|\\\\s)*?\\\"\",\r\n \"$1\" + stringValue + \"\\\"\");\r\n } else if (control instanceof SelectControl && !((SelectControl) control).isMultiple()) {\r\n //SelectControl handling (single item only)\r\n Pattern pattern = Pattern.compile(\"<select(\\\\s)*?id(\\\\s)*?=(\\\\s)*?\\\"\" + controlId + \"\\\"(.|\\\\s)*?</select>\");\r\n Matcher matcher = pattern.matcher(row);\r\n String replacement = \"\";\r\n\r\n if (matcher.find()) {\r\n //remove selected from select options\r\n String selected = \"selected=\\\"selected\\\"\";\r\n replacement = matcher.group().replace(selected, \"\");\r\n\r\n //put selected on only the selected option\r\n String selectedValue = \"value=\\\"\" + stringValue + \"\\\"\";\r\n replacement = replacement.replace(selectedValue, selectedValue + \" \" + selected);\r\n }\r\n\r\n //replace the old select tag with the old one\r\n if (StringUtils.isNotBlank(replacement)) {\r\n row = matcher.replaceAll(replacement);\r\n }\r\n }\r\n\r\n currentColumnValue = stringValue;\r\n\r\n return row;\r\n }", "com.microsoft.schemas.xrm._2013.metadata.AttributeTypeDisplayName addNewAttributeTypeDisplayName();", "public Builder setField1816Bytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n field1816_ = value;\n onChanged();\n return this;\n }", "@Override\n\tpublic void setupAddFields(EquationStandardTransaction transaction)\n\t{\n\t\ttransaction.setFieldValue(\"GZCCD\", \"B1\"); // Charge code (2A)\n\t\ttransaction.setFieldValue(\"GZAMT\", \"5000\"); // Charge amount (15P,0)\n\t\ttransaction.setFieldValue(\"GZWMN\", \"KSM2020\"); // Warning message (7A)\n\t\ttransaction.setFieldValue(\"GZFLG\", \"N\"); // Stop chqbook issue? (1A)\n\t}", "com.google.protobuf.ByteString\n getField1606Bytes();", "com.google.protobuf.ByteString\n getField1316Bytes();", "java.lang.String getField1716();", "String getFieldString(VcfEntry vcfEntry) {\n\t\t// Field from first 10 columns\n\t\t// if (name.equals(\"CHROM\")) return vcfEntry.getChromosomeName();\n\t\tif (name.equals(\"CHROM\")) return vcfEntry.getChromosomeNameOri();\n\t\tif (name.equals(\"ID\")) return vcfEntry.getId();\n\t\tif (name.equals(\"REF\")) return vcfEntry.getRef();\n\t\tif (name.equals(\"ALT\")) return vcfEntry.getAltsStr();\n\t\tif (name.equals(\"FILTER\")) return vcfEntry.getFilter();\n\t\tif (name.equals(\"FORMAT\")) return vcfEntry.getFormat();\n\t\tif (name.equals(\"POS\")) return \"\" + (vcfEntry.getStart() + 1);\n\t\tif (name.equals(\"QUAL\")) return \"\" + vcfEntry.getQuality();\n\n\t\t// Is there a filed 'name'\n\t\tif (vcfInfo == null) {\n\t\t\tvcfInfo = vcfEntry.getVcfFileIterator().getVcfHeader().getVcfHeaderInfo(name);\n\t\t\tif (vcfInfo == null) return (String) fieldHeaderNotFound(vcfEntry);\n\t\t}\n\n\t\t// Get field value\n\t\tString value = vcfEntry.getInfo(name);\n\t\tif (value == null) return (String) fieldNotFound(vcfEntry);\n\n\t\treturn value;\n\t}", "java.lang.String getField1618();", "void insertVariableFields(String streamColumnFamily, String rowKey,\n Mutator<String> mutator,\n Map<String, String> customKeyValuePairs) {\n for (Map.Entry<String, String> stringStringEntry : customKeyValuePairs.entrySet()) {\n mutator.addInsertion(rowKey, streamColumnFamily,\n HFactory.createStringColumn(stringStringEntry.getKey(),\n stringStringEntry.getValue()));\n }\n }", "protected void addRowAttributes(TableRowBuilder row, T rowValue) {\n addRowAttributes(row);\n }", "java.lang.String getField1615();", "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}", "com.google.protobuf.ByteString\n getField1613Bytes();", "com.google.protobuf.ByteString\n getField1617Bytes();", "public synchronized void setAllVariantInfo(int tagIndex, byte[][] defAndOffset) {\n myHDF5.writeByteMatrixBlockWithOffset(GBSHDF5Constants.VARIANTDEF, new byte[][]{defAndOffset[0]}, tagIndex, 0);\n myHDF5.writeByteMatrixBlockWithOffset(GBSHDF5Constants.VARIANTPOSOFF, new byte[][]{defAndOffset[1]}, tagIndex, 0);\n variantDefs[tagIndex]=defAndOffset[1];\n variantOffsets[tagIndex]=defAndOffset[1];\n }", "com.google.protobuf.ByteString\n getField1724Bytes();", "com.google.protobuf.ByteString\n getField1616Bytes();", "java.lang.String getField1816();", "java.lang.String getField1632();", "java.lang.String getField1617();", "private void handleFeature(final Type type, TOP fs, String featName, String featValIn,\n boolean lenient) throws SAXParseException {\n final String featVal = (featName.equals(\"sofa\") && ((TypeImpl) type).isAnnotationBaseType())\n ? Integer.toString(this.sofaRefMap\n .get(((Sofa) fsTree.get(Integer.parseInt(featValIn)).fs).getSofaNum()))\n : featValIn;\n\n // handle v1.x sofanum values, remapping so that _InitialView always == 1\n // Bypassed in v3 of UIMA because sofa was already created with the right sofanum\n // if (featName.equals(CAS.FEATURE_BASE_NAME_SOFAID) && (fs instanceof Sofa)) {\n // Sofa sofa = (Sofa) fs;\n // int sofaNum = sofa.getSofaNum();\n // sofa._setIntValueNcNj(Sofa._FI_sofaNum, this.indexMap.get(sofaNum));\n //\n //// Type sofaType = ts.sofaType;\n //// final FeatureImpl sofaNumFeat = (FeatureImpl) sofaType\n //// .getFeatureByBaseName(CAS.FEATURE_BASE_NAME_SOFANUM);\n //// int sofaNum = cas.getFeatureValue(addr, sofaNumFeat.getCode());\n //// cas.setFeatureValue(addr, sofaNumFeat.getCode(), this.indexMap.get(sofaNum));\n // }\n\n String realFeatName = getRealFeatName(featName);\n\n final FeatureImpl feat = (FeatureImpl) type.getFeatureByBaseName(realFeatName);\n if (feat == null) { // feature does not exist in typesystem\n if (outOfTypeSystemData != null) {\n // Add to Out-Of-Typesystem data (APL)\n List<Pair<String, Object>> ootsAttrs = outOfTypeSystemData.extraFeatureValues\n .computeIfAbsent(fs, k -> new ArrayList<>());\n ootsAttrs.add(new Pair(featName, featVal));\n } else if (!lenient) {\n throw createException(XCASParsingException.UNKNOWN_FEATURE, featName);\n }\n } else {\n // feature is not null\n if (feat.getRangeImpl().isRefType) {\n // queue up a fixup action to be done\n // after the external ids get properly associated with\n // internal ones.\n\n fixupToDos.add(() -> finalizeRefValue(Integer.parseInt(featVal), fs, feat));\n } else { // is not a ref type.\n CASImpl.setFeatureValueFromStringNoDocAnnotUpdate(fs, feat, featVal);\n }\n\n }\n }", "private static void insertRow(HTable htable, byte[] rowKey, byte[] family, Map<byte[], byte[]> qualifierValueMap)\n throws IOException {\n Put put = new Put(rowKey);\n for (Map.Entry<byte[], byte[]> entry : qualifierValueMap.entrySet()) {\n int key = Bytes.toInt(entry.getKey());\n int value = Bytes.toInt(entry.getValue());\n//System.out.println(\"In Map, the key = \"+key+\", the value = \"+value);\n put.add(family, entry.getKey(), entry.getValue());\n }\n for (Map.Entry<byte[], List<KeyValue>> entry : (Set<Map.Entry<byte[], List<KeyValue>>>) put.getFamilyMap().entrySet()) {\n byte[] keyBytes = entry.getKey();\n String familyString = Bytes.toString(keyBytes);\n//System.out.println(\"Family: \"+familyString+\"\\n\");\n List<KeyValue> list = entry.getValue();\n for (KeyValue kv : list) {\n byte[] kkk = kv.getQualifier();\n byte[] vvv = kv.getValue();\n int index = Bytes.toInt(kkk);\n int fid = Bytes.toInt(vvv);\n//System.out.println(\" (\"+index+\"th FID) = \"+fid);\n }\n }\n htable.put(put);\n }", "java.lang.String getField1612();", "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 }", "public Builder setField1606Bytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n field1606_ = value;\n onChanged();\n return this;\n }", "protected void addAttribute(AttributeField af) { \n\tthis.attributeFields.addElement(af);\n }", "public void addField()\n {\n DefaultMutableTreeNode node = (DefaultMutableTreeNode) availableFieldsComp.getTree().getLastSelectedPathComponent();\n if (node == null || !node.isLeaf() || !(node.getUserObject() instanceof DataObjDataFieldWrapper) )\n {\n return; // not really a field that can be added, just empty or a string\n }\n\n Object obj = node.getUserObject();\n if (obj instanceof DataObjDataFieldWrapper)\n {\n DataObjDataFieldWrapper wrapper = (DataObjDataFieldWrapper) obj;\n String sep = sepText.getText();\n if (StringUtils.isNotEmpty(sep))\n {\n try\n {\n DefaultStyledDocument doc = (DefaultStyledDocument) formatEditor.getStyledDocument();\n if (doc.getLength() > 0)\n {\n doc.insertString(doc.getLength(), sep, null);\n }\n }\n catch (BadLocationException ble) {}\n \n }\n insertFieldIntoTextEditor(wrapper);\n setHasChanged(true);\n }\n }", "public BaseField setupField(int iFieldSeq)\n {\n BaseField field = null;\n if (iFieldSeq == 0)\n field = new HotelField(this, PRODUCT_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 1)\n // field = new DateField(this, START_DATE, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 2)\n // field = new DateField(this, END_DATE, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 3)\n // field = new StringField(this, DESCRIPTION, 10, null, null);\n //if (iFieldSeq == 4)\n // field = new CityField(this, CITY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 5)\n // field = new CityField(this, TO_CITY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 6)\n // field = new ContinentField(this, CONTINENT_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 7)\n // field = new RegionField(this, REGION_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 8)\n // field = new CountryField(this, COUNTRY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 9)\n // field = new StateField(this, STATE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 10)\n // field = new VendorField(this, VENDOR_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n if (iFieldSeq == 11)\n field = new HotelRateField(this, RATE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n if (iFieldSeq == 12)\n field = new HotelClassField(this, CLASS_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 13)\n // field = new DateField(this, DETAIL_DATE, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 14)\n // field = new ShortField(this, PAX, Constants.DEFAULT_FIELD_LENGTH, null, new Short((short)2));\n //if (iFieldSeq == 15)\n // field = new HotelScreenRecord_LastChanged(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 16)\n // field = new BooleanField(this, REMOTE_QUERY_ENABLED, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 17)\n // field = new ShortField(this, BLOCKED, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 18)\n // field = new ShortField(this, OVERSELL, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 19)\n // field = new BooleanField(this, CLOSED, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 20)\n // field = new BooleanField(this, DELETE, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 21)\n // field = new BooleanField(this, READ_ONLY, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 22)\n // field = new ProductSearchTypeField(this, PRODUCT_SEARCH_TYPE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 23)\n // field = new ProductTypeField(this, PRODUCT_TYPE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n if (iFieldSeq == 24)\n field = new PaxCategorySelect(this, PAX_CATEGORY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n if (field == null)\n field = super.setupField(iFieldSeq);\n return field;\n }", "private void parseField(String line){\n List<Integer> commaPos = ParserUtils.getCommaPos(line);\n int size = commaPos.size();\n // parse field\n String zip = line.substring(commaPos.get(size-ZIP_CODE_POS-1)+1, commaPos.get(size-ZIP_CODE_POS));\n // if zip is not valid return\n zip = zip.trim();\n if(zip==null || zip.length()<5){\n return;\n }\n // only keep the first 5 digits\n zip = zip.substring(0,5);\n String marketVal = line.substring(commaPos.get(MARKET_VALUE_POS-1)+1, commaPos.get(MARKET_VALUE_POS));\n String liveableArea = line.substring(commaPos.get(size-TOTAL_LIVEABLE_AREA_POS-1)+1, commaPos.get(size-TOTAL_LIVEABLE_AREA_POS));\n // cast those value to Long Double\n Long lZip = ParserUtils.tryCastStrToLong(zip);\n Double DMarketVal = ParserUtils.tryCastStrToDouble(marketVal);\n Double DLiveableArea = ParserUtils.tryCastStrToDouble(liveableArea);\n // update those field into the map\n updatePropertyInfo(lZip,DMarketVal, DLiveableArea);\n }", "public Builder setField1618Bytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n field1618_ = value;\n onChanged();\n return this;\n }", "private void updateBundleLabelList() {\n List<String> selection = Utils.jListGetValuesWrapper(bundle_label_list);\n List<String> items = new ArrayList<String>();\n // Go through all of the header fields and add them with their variations\n boolean tags_present = false;\n BundlesG globals = getRTParent().getRootBundles().getGlobals();\n Iterator<String> it = globals.fieldIterator();\n while (it.hasNext()) {\n String fld = it.next(); int fld_i = globals.fieldIndex(fld);\n if (globals.isScalar(fld_i)) {\n items.add(fld + SIMPLESTAT_LM);\n\titems.add(fld + COMPLEXSTAT_LM);\n } else if (fld.equals(\"tags\")) {\n tags_present = true;\n } else {\n items.add(fld + ITEMS_LM);\n\titems.add(fld + COUNT_LM);\n }\n BundlesDT.DT datatype = globals.getFieldDataType(fld_i);\n if (globals.isScalar(fld_i) == false && datatype == BundlesDT.DT.INTEGER) datatype = null;\n if (datatype != null) {\n String appends[] = BundlesDT.dataTypeVariations(datatype, globals);\n\tfor (int i=0;i<appends.length;i++) items.add(fld + BundlesDT.DELIM + appends[i]);\n }\n }\n Collections.sort(items, new CaseInsensitiveComparator());\n // Add the tag options at the end\n if (tags_present) {\n items.add(\"tags\" + ITEMS_LM);\n items.add(\"tags\" + BundlesDT.MULTI + ITEMS_LM);\n items.add(\"tags\" + BundlesDT.MULTI + COUNT_LM);\n Iterator<String> it2 = globals.tagTypeIterator();\n while (it2.hasNext()) {\n String tag_type = it2.next();\n items.add(\"tags\" + BundlesDT.MULTI + BundlesDT.DELIM + tag_type + ITEMS_LM);\n items.add(\"tags\" + BundlesDT.MULTI + BundlesDT.DELIM + tag_type + COUNT_LM);\n }\n }\n // Insert the default items\n items.add(0, TIMEFRAME_LM);\n items.add(0, LASTHEARD_LM);\n items.add(0, FIRSTHEARD_LM);\n items.add(0, BUNDLECOUNT_LM);\n // Convert and update the list\n setListAndResetSelection(bundle_label_list, items, selection);\n }", "com.google.protobuf.ByteString\n getField1362Bytes();", "protected void addRowAttributes(TableRowBuilder row) {\n }", "void format06(String line, int lineCount) {\n\n // is this the first record in the file?\n checkFirstRecord(code, lineCount);\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 int subCode = 0;\n if (dataType == WATERWOD) {\n if (t.hasMoreTokens()) subCode = toInteger(t.nextToken());\n switch (subCode) {\n case 1: if (t.hasMoreTokens()) watProfQC.setStationId(toString(t.nextToken()));\n if (t.hasMoreTokens()) t.nextToken(); // is no profile no2 quality flag\n if (t.hasMoreTokens()) //set profile no3 quality flag\n watProfQC.setNo3((toInteger(t.nextToken())));\n if (t.hasMoreTokens()) //set profile po4 quality flag\n watProfQC.setPo4((toInteger(t.nextToken())));\n if (t.hasMoreTokens()) t.nextToken(); // is no profile ptot quality flag\n if (t.hasMoreTokens()) t.nextToken(); // is no profile sio3 quality flag\n if (t.hasMoreTokens()) //set profile sio4 quality flag\n watProfQC.setSio3((toInteger(t.nextToken())));\n if (t.hasMoreTokens()) //set profile chla quality flag\n watProfQC.setChla((toInteger(t.nextToken())));\n if (t.hasMoreTokens()) t.nextToken(); // is no profile chlb quality flag\n if (t.hasMoreTokens()) t.nextToken(); // is no profile chlc quality flag\n break;\n } // switch (subCode)\n } // if (dataType = WATERWOD)\n\n\n // there can only be one code 06 record per substation\n if (subCode != 1) code06Count++; // ignore WATERWOD code 1\n if (code06Count > 1) {\n outputError(lineCount + \" - Fatal - \" +\n \"More than 1 code 06 record in substation\");\n } // if (code06Count > 1)\n\n if (dataType == SEDIMENT) {\n\n //01 a2 format code always “06\" n/a/a\n //02 a12 stnid station id: composed as for format 03 sedphyhy\n //03 f4.1 pctsat percent sedphywatnut\n //04 f4.1 pctsil percent sedphywatnut\n //05 i5 permty seconds sedphyM watnut\n //06 f4.1 porsty percent sedphyM watnut\n //07 f5.1 splvol litre sedphy = µM watnut\n //08 i3 spldis sedphytre watchl\n //09 f8.1 sievsz sedphywatchl\n\n if (t.hasMoreTokens()) sedphy.setStationId(toString(t.nextToken()));\n if (t.hasMoreTokens()) sedphy.setPctsat(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) sedphy.setPctsil(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) sedphy.setPermty(toInteger(t.nextToken()));\n if (t.hasMoreTokens()) sedphy.setPorsty(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) sedphy.setSplvol(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) sedphy.setSpldis(toInteger(t.nextToken())); // ub07\n if (t.hasMoreTokens()) sedphy.setSievsz(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(\"format06: sedphy = \" + sedphy);\n\n } else if ((dataType == WATER) || (dataType == WATERWOD)) {\n\n //01 a2 format code always \"06\" n/a\n //02 a12 stnid station id: composed as for format 03 watphy\n //03 f6.2 NO2 µgm atom / litre = uM watnut\n //04 f6.2 NO3 µgm atom / litre = uM watnut\n //05 f6.2 PO4 µgm atom / litre = uM watnut\n //06 f7.3 Ptot µgm atom / litre = µM watnut\n //07 f7.2 SIO3 µgm atom / litre = µM watnut\n //08 f7.2 SIO4 µgm atom / litre = µM watnut\n //09 f7.3 chla µgm / litre watchl\n //10 f7.3 chlb µgm / litre watchl\n //11 f7.3 chlc µgm / litre watchl\n\n\n // subCode = 1 - ignore\n // subCode = 0 (WATER) or subCode = 2 (WATERWOD)\n if (subCode != 1) {\n if (t.hasMoreTokens()) watphy.setStationId(toString(t.nextToken()));\n\n if (t.hasMoreTokens()) watnut.setNo2(toFloat(t.nextToken(), 1f));\n if ((dataType == WATERWOD) && (t.hasMoreTokens())) t.nextToken(); // is no profile no2 quality flag\n\n if (t.hasMoreTokens()) watnut.setNo3(toFloat(t.nextToken(), 1f));\n if ((dataType == WATERWOD) && (t.hasMoreTokens())) // set No3 quality flag\n watQC.setNo3((toInteger(t.nextToken())));\n\n if (t.hasMoreTokens()) watnut.setPo4(toFloat(t.nextToken(), 1f));\n if ((dataType == WATERWOD) && (t.hasMoreTokens())) // set Po4 quality flag\n watQC.setPo4((toInteger(t.nextToken())));\n\n if (t.hasMoreTokens()) watnut.setP(toFloat(t.nextToken(), 1f));\n if ((dataType == WATERWOD) && (t.hasMoreTokens())) t.nextToken(); // is no profile ptot quality flag\n\n if (t.hasMoreTokens()) watnut.setSio3(toFloat(t.nextToken(), 1f));\n if ((dataType == WATERWOD) && (t.hasMoreTokens())) t.nextToken(); // is no profile Sio3 quality flag\n\n if (t.hasMoreTokens()) watnut.setSio3(toFloat(t.nextToken(), 1f)); // ub07\n if ((dataType == WATERWOD) && (t.hasMoreTokens())) // set Sio4 quality flag\n watQC.setSio3((toInteger(t.nextToken())));\n\n if (t.hasMoreTokens()) watchl.setChla(toFloat(t.nextToken(), 1f));\n if ((dataType == WATERWOD) && (t.hasMoreTokens())) // set chla quality flag\n watQC.setChla((toInteger(t.nextToken())));\n\n if (t.hasMoreTokens()) watchl.setChlb(toFloat(t.nextToken(), 1f));\n if ((dataType == WATERWOD) && (t.hasMoreTokens())) t.nextToken(); // is no profile chlb quality flag\n\n if (t.hasMoreTokens()) watchl.setChlc(toFloat(t.nextToken(), 1f));\n if ((dataType == WATERWOD) && (t.hasMoreTokens())) t.nextToken(); // is no profile chlc quality flag\n\n // station Id must match that of previous station record\n checkStationId(lineCount, watphy.getStationId(\"\"));\n\n if (dbg) System.out.println(\"format06: watnut = \" + watnut);\n if (dbg) System.out.println(\"format06: watchl = \" + watchl);\n\n } // if (subCode != 1)\n\n } // if (dataType == SEDIMENT)\n\n }", "com.google.protobuf.ByteString\n getField1116Bytes();", "@SuppressWarnings(value=\"unchecked\")\n public void put(int field$, java.lang.Object value$) {\n switch (field$) {\n case 0: specificDiseaseTitle = (java.lang.String)value$; break;\n case 1: panelVersion = (java.lang.String)value$; break;\n case 2: ensemblVersion = (java.lang.String)value$; break;\n case 3: dataModelCatalogueVersion = (java.lang.String)value$; break;\n case 4: geneIds = (java.util.List<java.lang.String>)value$; break;\n case 5: Transcripts = (java.util.List<java.lang.String>)value$; break;\n case 6: relevantRegions = (Gel_BioInf_Models.File)value$; break;\n case 7: clinicalRelevantVariants = (Gel_BioInf_Models.File)value$; break;\n default: throw new org.apache.avro.AvroRuntimeException(\"Bad index\");\n }\n }", "com.google.protobuf.ByteString\n getField1611Bytes();", "private void checkValue(int fiFieldType, String fsValue, int fiIndex)\n {\n switch ( fiFieldType )\n {\n // text fields\n case DataConst.CHAR :\n case DataConst.VARCHAR :\n case DataConst.LONGVARCHAR :\n {\n try\n {\n // check if first and last characters on are quotes.\n String lsRHS = fsValue.trim();\n char [] lcChar = lsRHS.toCharArray();\n\n if ((lcChar[0] == '\"') && (lcChar[lsRHS.length() - 1] == '\"'))\n {\n return ;\n } /* end if ((lcChar[0] == '\"') && ... */\n else\n {\n raiseException( \"%c:Q0079%\" ) ;\n } /* end else */\n } /* end try */\n catch (RuntimeException loException)\n {\n raiseException( \"%c:Q0079%\" ) ;\n } /* end catch */\n break ;\n } /* case DataConst.CHAR */\n case DataConst.INTEGER :\n {\n try\n {\n Integer loInt = new Integer(fsValue);\n return ;\n }\n catch (NumberFormatException loException)\n {\n raiseException( \"%c:Q0080,v: \" + Integer.MIN_VALUE +\n \",v:\" + Integer.MAX_VALUE + \"%\" ) ;\n }\n break ;\n } /* case DataConst.INTEGER */\n case DataConst.BIGINT :\n {\n try\n {\n Long loLong = new Long(fsValue);\n return ;\n }\n catch (NumberFormatException loException)\n {\n raiseException( \"%c:Q0081,v: \" + Long.MIN_VALUE +\n \",v:\" + Long.MAX_VALUE + \"%\" ) ;\n }\n break ;\n } /* case DataConst.BIGINT */\n case DataConst.SMALLINT :\n case DataConst.TINYINT :\n {\n try\n {\n Byte loByte = new Byte(fsValue);\n return ;\n }\n catch (NumberFormatException loException)\n {\n raiseException( \"%c:Q0082,v: \"+ Byte.MIN_VALUE +\n \",v:\" + Byte.MAX_VALUE + \"%\" ) ;\n }\n break ;\n } /* case DataConst.SMALLINT */\n case DataConst.REAL :\n {\n try\n {\n Float loFloat = new Float(fsValue);\n return ;\n }\n catch (NumberFormatException loException)\n {\n raiseException( \"%c:Q0083,v: \" + Float.MIN_VALUE +\n \",v:\" + Float.MAX_VALUE + \"%\" ) ;\n }\n break ;\n } /* case DataConst.REAL */\n case DataConst.DOUBLE :\n case DataConst.FLOAT :\n case DataConst.DECIMAL :\n {\n try\n {\n Double loDouble = new Double(fsValue);\n return ;\n }\n catch (NumberFormatException loException)\n {\n raiseException( \"%c:Q0084,v: \" + Double.MIN_VALUE +\n \",v:\" + Double.MAX_VALUE + \"%\" ) ;\n }\n break ;\n } /* case DataConst.DOUBLE */\n case DataConst.NUMERIC :\n {\n try\n {\n BigDecimal loBigDec = new BigDecimal(fsValue);\n return ;\n }\n catch (NumberFormatException loException)\n {\n raiseException( \"%c:Q0085%\" ) ;\n }\n break ;\n } /* case DataConst.NUMERIC */\n case DataConst.BIT :\n {\n String lsRHS = fsValue.trim();\n if (lsRHS.equalsIgnoreCase(\"\\\"true\\\"\") ||\n lsRHS.equalsIgnoreCase(\"\\\"false\\\"\"))\n {\n if ( !( lsRHS.equals(\"\\\"true\\\"\") ) || !( lsRHS.equals(\"\\\"false\\\"\") ) )\n {\n\n Data loNewData = getData(\"AND_COND_RHS_\" + fiIndex ) ;\n\n if ( lsRHS.equalsIgnoreCase(\"\\\"true\\\"\") )\n {\n loNewData.setString(\"\\\"true\\\"\") ;\n raiseException( \"Value \" + lsRHS + \" has been modified to \\\"true\\\"\",\n AMSMsgUtil.SEVERITY_LEVEL_WARNING ) ;\n } /* end if ( lsRHS.equalsIgnoreCase(\"\\\"true\\\"\") ) */\n else\n {\n loNewData.setString(\"\\\"false\\\"\") ;\n raiseException( \"Value \" + lsRHS + \" has been modified to \\\"false\\\"\",\n AMSMsgUtil.SEVERITY_LEVEL_WARNING ) ;\n } /* end else */\n\n } /* end if ( !( lsRHS.equals(\"\\\"true\\\"\") ) || !( lsRHS.equals(\"\\\"false\\\"\") ) ) */\n return ;\n }\n else\n {\n raiseException( \"%c:Q0086%\" ) ;\n }\n break ;\n } /* case DataConst.BIT */\n case DataConst.TIMESTAMP :\n case DataConst.DATE :\n {\n // date must be in format \"MM/dd/yyyy\" - within quotes\n try\n {\n // check if first and last characters on are quotes.\n String lsRHS = fsValue.trim();\n char [] lcChar = lsRHS.toCharArray();\n\n if ( ( lcChar[0] == '\"' ) &&\n ( lcChar[lsRHS.length() - 1] == '\"' ) )\n {\n SimpleDateFormat loDateFormat = new SimpleDateFormat( \"\\\"MM/dd/yyyy\\\"\" ) ;\n\n // create the Date object\n Date loJavaDate = loDateFormat.parse( lsRHS, new ParsePosition( 0 ) ) ;\n\n if ( loJavaDate == null )\n {\n raiseException( \"%c:Q0087%\" ) ;\n }\n\n VSDate loDate = new VSDate( loJavaDate ) ;\n return ;\n }\n else\n {\n raiseException( \"%c:Q0087%\" ) ;\n }\n }\n catch (RuntimeException loException)\n {\n raiseException( \"%c:Q0087%\" ) ;\n }\n break ;\n\n } /* case DataConst.TIMESTAMP */\n default :\n {\n raiseException( \"%c:Q0088%\" ) ;\n return ;\n } /* end default */\n\n } /* end switch ( fiFieldType ) */\n }", "public void removeExtraField(final ZipShort type) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"70852260-a6a7-4a20-80e7-2845726cb793\");\n if (extraFields == null) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"1cdd41c5-cc00-4c20-a3c8-6a48c9b2e38f\");\n throw new java.util.NoSuchElementException();\n }\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"2fbc1b80-8711-4927-9154-0594662dc65e\");\n final List<ZipExtraField> newResult = new ArrayList<ZipExtraField>();\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"8b80c44d-009c-4470-aff3-4763097b9f9a\");\n for (final ZipExtraField extraField : extraFields) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"6be62b96-f85a-4404-b95f-7cac16120acf\");\n if (!type.equals(extraField.getHeaderId())) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"6215ed97-256f-4341-8f39-b74bd2fe2749\");\n newResult.add(extraField);\n }\n }\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"189c7f29-fa24-4106-be1a-8b02c592ebaa\");\n if (extraFields.length == newResult.size()) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"c986e14c-19c0-4d38-9f2d-d08e6c1c6f1b\");\n throw new java.util.NoSuchElementException();\n }\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"f10934cb-d037-4768-bb8a-7ad1da158142\");\n extraFields = newResult.toArray(new ZipExtraField[newResult.size()]);\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"7235b8ea-0326-4ddb-afac-2da6c4483bd7\");\n setExtra();\n }", "public void updateBannerDisplayDataFlag(String banner_id, String flag) {\n SQLiteDatabase db = null;\n\n try {\n db = this.getWritableDatabase();\n\n\n ContentValues values = new ContentValues();\n\n values.put(SYCHRONIZED, flag); // Name\n\n // Inserting Row\n db.update(TABLE_BANNER_DISPLAY, values, KEY_ID + \"=\" + banner_id, null);\n\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n if (db != null) {\n db.close();\n }\n }\n\n }", "java.lang.String getField1648();", "public boolean hasInfo() {\n return fieldSetFlags()[6];\n }", "private void mergeExtraFields(final ZipExtraField[] f, final boolean local) throws ZipException {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"4660ef72-97af-4c77-a8c0-451c0176ea1f\");\n if (extraFields == null) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"fc349413-df04-4074-b3da-fdacb54199ad\");\n setExtraFields(f);\n } else {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"4b996740-6cfc-4dbf-b3af-764a31cbfe77\");\n for (final ZipExtraField element : f) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"bacdc8b5-2a38-484f-aa61-b042212a08c4\");\n ZipExtraField existing;\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"d08c42a0-26d8-46ea-bb0e-aa534ce634f2\");\n if (element instanceof UnparseableExtraFieldData) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"e96717ff-128b-4b11-aa83-243e5cdd44ba\");\n existing = unparseableExtra;\n } else {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"611a8005-5c56-445f-b013-ae0feef0b77f\");\n existing = getExtraField(element.getHeaderId());\n }\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"cc9ae2dd-d591-403f-bfc0-3565f7413957\");\n if (existing == null) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"b3059034-a6ec-4f5c-92ab-02329c1e2936\");\n addExtraField(element);\n } else {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"9cf4a3a6-31a3-468f-b1d1-797ef9894394\");\n if (local) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"32f3d1f3-8ae4-4c18-8839-1c1fb6a4aaa5\");\n final byte[] b = element.getLocalFileDataData();\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"532ad3fc-c060-4f5d-9f0e-6b3aca602760\");\n existing.parseFromLocalFileData(b, 0, b.length);\n } else {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"31ca8fd7-a4ff-49df-88a1-30617762fb79\");\n final byte[] b = element.getCentralDirectoryData();\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"f2794a07-51ae-4509-8ae5-c37f1cff97cd\");\n existing.parseFromCentralDirectoryData(b, 0, b.length);\n }\n }\n }\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"0f523d07-2102-4c81-b83c-cf863a880764\");\n setExtra();\n }\n }", "public abstract void subfield(char identifier, String data);", "private void addColumnDetails()\n {\n Vector cols = m_recProf.getColumnProfiles();\n for (int i = 0 ; i < cols.size() ; i++)\n {\n ColumnProfile c = (ColumnProfile)cols.elementAt(i);\n addColumnDetail(c, i);\n }\n }", "public static void updateField() {\r\n\t\tfor (int i = 0; i < ROWS; i++) {\r\n\t\t\tfor (int j = 0; j < COLUMNS; j++) {\r\n\t\t\t\tfield[i][j] = EMPTY;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i < food.size(); i++) {\r\n\t\t\tfield[food.get(i)[1]][food.get(i)[2]] = food.get(i)[0];\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i < snake.size(); i++) {\r\n\t\t\tfield[snake.get(i)[0]][snake.get(i)[1]] = SNAKE;\r\n\t\t}\r\n\t}", "com.google.protobuf.ByteString\n getField1702Bytes();", "@Override\n\tpublic void setupAddFields(EquationStandardTransaction transaction)\n\t{\n\t\ttransaction.setFieldValue(\"GZCNEW\", \"Y\"); // Generate new card?\n\t\ttransaction.setFieldValue(\"GZCMOD\", \"A\"); // Mode - this must be 'A' when adding\n\t\ttransaction.setFieldValue(\"GZCNM1\", \"TEST AUTO\"); // Card name 1\n\t}", "public Builder setField1716Bytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n field1716_ = value;\n onChanged();\n return this;\n }", "public Builder setField1916Bytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n field1916_ = value;\n onChanged();\n return this;\n }", "public int[] getVariantMeta() { return new int[] { 0 }; }", "com.google.protobuf.ByteString\n getField1603Bytes();", "public AttribInfo(){\n m_deprecated = false;\n m_hidden = false;\n m_multipleSelection = false;\n m_attributeValues = null;\n m_attributeValueMap = null;\n m_description = null;\n m_labelName = null;\n m_defaultValue = null;\n m_propertyMapKeyName = null;\n m_mapComponentClassName = null;\n m_preferredType = null;\n }", "java.lang.String getField1616();", "public void setup(VectorAccessible incoming) {\n IcebergTableProps icebergTableProps = config.getIcebergTableProps();\n\n final IcebergModel icebergModel;\n final IcebergTableIdentifier icebergTableIdentifier;\n final SupportsIcebergMutablePlugin icebergMutablePlugin = (SupportsIcebergMutablePlugin)config.getPlugin();\n icebergModel = icebergMutablePlugin.getIcebergModel(icebergTableProps, config.getProps().getUserName(), context, null);\n icebergTableIdentifier = icebergModel.getTableIdentifier(icebergMutablePlugin.getTableLocation(icebergTableProps));\n\n TypedFieldId metadataFileId = RecordWriter.SCHEMA.getFieldId(SchemaPath.getSimplePath(RecordWriter.ICEBERG_METADATA_COLUMN));\n TypedFieldId operationTypeId = RecordWriter.SCHEMA.getFieldId(SchemaPath.getSimplePath(RecordWriter.OPERATION_TYPE_COLUMN));\n TypedFieldId pathId = RecordWriter.SCHEMA.getFieldId(SchemaPath.getSimplePath(RecordWriter.PATH_COLUMN));\n icebergMetadataVector = incoming.getValueAccessorById(VarBinaryVector.class, metadataFileId.getFieldIds()).getValueVector();\n operationTypeVector = incoming.getValueAccessorById(IntVector.class, operationTypeId.getFieldIds()).getValueVector();\n pathVector = incoming.getValueAccessorById(VarCharVector.class, pathId.getFieldIds()).getValueVector();\n partitionDataVector = (ListVector) VectorUtil.getVectorFromSchemaPath(incoming, RecordWriter.PARTITION_DATA_COLUMN);\n\n switch (icebergTableProps.getIcebergOpType()) {\n case CREATE:\n icebergOpCommitter = icebergModel.getCreateTableCommitter(\n icebergTableProps.getTableName(),\n icebergTableIdentifier,\n icebergTableProps.getFullSchema(),\n icebergTableProps.getPartitionColumnNames(),\n context.getStats(),\n icebergTableProps.getPartitionSpec() != null ?\n IcebergSerDe.deserializePartitionSpec(deserializedJsonAsSchema(icebergTableProps.getIcebergSchema()),\n icebergTableProps.getPartitionSpec().toByteArray()) : null\n );\n break;\n case INSERT:\n icebergOpCommitter = icebergModel.getInsertTableCommitter(\n icebergModel.getTableIdentifier(icebergTableProps.getTableLocation()),\n context.getStats()\n );\n break;\n case UPDATE:\n case DELETE:\n case MERGE:\n icebergOpCommitter = icebergModel.getDmlCommitter(\n context.getStats(),\n icebergModel.getTableIdentifier(icebergTableProps.getTableLocation()),\n config.getDatasetConfig().get());\n break;\n case FULL_METADATA_REFRESH:\n createReadSignProvider(icebergTableProps, true);\n icebergOpCommitter = icebergModel.getFullMetadataRefreshCommitter(\n icebergTableProps.getTableName(),\n config.getDatasetPath().getPathComponents(),\n icebergTableProps.getDataTableLocation(),\n icebergTableProps.getUuid(),\n icebergModel.getTableIdentifier(icebergTableProps.getTableLocation()),\n icebergTableProps.getFullSchema(),\n icebergTableProps.getPartitionColumnNames(),\n config.getDatasetConfig().get(),\n context.getStats(),\n null\n );\n break;\n case INCREMENTAL_METADATA_REFRESH:\n createReadSignProvider(icebergTableProps, false);\n icebergOpCommitter = icebergModel.getIncrementalMetadataRefreshCommitter(\n context,\n icebergTableProps.getTableName(),\n config.getDatasetPath().getPathComponents(),\n icebergTableProps.getDataTableLocation(),\n icebergTableProps.getUuid(),\n icebergModel.getTableIdentifier(icebergTableProps.getTableLocation()),\n icebergTableProps.getPersistedFullSchema(),\n icebergTableProps.getPartitionColumnNames(),\n false,\n config.getDatasetConfig().get()\n );\n icebergOpCommitter.updateSchema(icebergTableProps.getFullSchema());\n break;\n }\n }", "java.lang.String getField1613();", "private FixedField getFixedField(final StorageService storageService,\n final int headerTypeCode,\n final String code,\n final String leader,\n String valueField,\n final String lang,\n final Map<String, String> serviceConfiguration) {\n\n\n FixedField fixedField = null;\n if (isFixedField(code) && checkParameters(code, headerTypeCode, leader)){\n fixedField = new FixedField();\n fixedField.setCode(code);\n fixedField.setCategoryCode(Global.INT_CATEGORY);\n fixedField.setHeaderTypeCode(headerTypeCode);\n\n valueField = F.isNotNullOrEmpty(valueField) ?valueField :null;\n\n GeneralInformation generalInformation = null;\n\n if (code.equals(Global.LEADER_TAG_NUMBER)){\n final String description = storageService.getHeadingTypeDescription(headerTypeCode, lang, Global.INT_CATEGORY);\n fixedField.setDescription(description);\n fixedField.setDisplayValue(ofNullable(valueField).orElse(getLeaderValue()));\n setLeaderValues(fixedField);\n\n } else if (code.equals(Global.MATERIAL_TAG_CODE)) {\n generalInformation = new GeneralInformation();\n generalInformation.setDefaultValues(serviceConfiguration);\n final Map<String, Object> mapRecordTypeMaterial = storageService.getMaterialTypeInfosByLeaderValues(leader.charAt(6), leader.charAt(7), code);\n final int headerTypeCalculated = (int) mapRecordTypeMaterial.get(Global.HEADER_TYPE_LABEL);\n\n generalInformation.setFormOfMaterial((String) mapRecordTypeMaterial.get(Global.FORM_OF_MATERIAL_LABEL));\n generalInformation.setHeaderType(headerTypeCalculated);\n generalInformation.setMaterialDescription008Indicator(\"1\");\n\n //header type code doesn't match with leader value\n if (headerTypeCode != headerTypeCalculated) { valueField = null; }\n\n } else if (code.equals(Global.OTHER_MATERIAL_TAG_CODE)) {\n generalInformation = new GeneralInformation();\n generalInformation.setDefaultValues(serviceConfiguration);\n\n generalInformation.setHeaderType(headerTypeCode);\n final Map<String, Object> mapRecordTypeMaterial = storageService.getMaterialTypeInfosByHeaderCode(headerTypeCode, code);\n generalInformation.setMaterialTypeCode((String) mapRecordTypeMaterial.get(Global.MATERIAL_TYPE_CODE_LABEL));\n generalInformation.setFormOfMaterial((String) mapRecordTypeMaterial.get(Global.FORM_OF_MATERIAL_LABEL));\n generalInformation.setMaterialDescription008Indicator(\"0\");\n\n } else if (code.equals(Global.PHYSICAL_DESCRIPTION_TAG_CODE)){\n final String categoryOfMaterial = ofNullable(Global.PHYSICAL_TYPES_MAP.get(headerTypeCode)).orElse(Global.UNSPECIFIED);\n fixedField.setHeaderTypeCode( (categoryOfMaterial.equals(Global.UNSPECIFIED)) ? Global.PHYSICAL_UNSPECIFIED_HEADER_TYPE : headerTypeCode);\n fixedField.setDescription(storageService.getHeadingTypeDescription(fixedField.getHeaderTypeCode(), lang, Global.INT_CATEGORY));\n fixedField.setDisplayValue(valueField);\n fixedField.setCategoryOfMaterial(categoryOfMaterial);\n setPhysicalInformationValues(fixedField, valueField);\n\n } else if (code.equals(Global.DATETIME_TRANSACION_TAG_CODE)){\n fixedField.setDescription(storageService.getHeadingTypeDescription(\n headerTypeCode, lang, Global.INT_CATEGORY));\n fixedField.setDisplayValue(F.getFormattedToday(\"yyyyMMddHHmmss.\"));\n }\n\n if (code.equals(Global.MATERIAL_TAG_CODE) || code.equals(Global.OTHER_MATERIAL_TAG_CODE)) {\n if (generalInformation != null) {\n if (valueField == null) {\n if (\"1\".equals(generalInformation.getMaterialDescription008Indicator())) {\n generalInformation.setEnteredOnFileDateYYMMDD(F.getFormattedToday(\"yyMMdd\"));\n }\n valueField = generalInformation.getValueString();\n }\n\n fixedField.setHeaderTypeCode(generalInformation.getHeaderType());\n fixedField.setDescription(storageService.getHeadingTypeDescription(generalInformation.getHeaderType(), lang, Global.INT_CATEGORY));\n fixedField.setDisplayValue(valueField);\n setMaterialValues(fixedField, generalInformation);\n }\n }\n }\n\n return fixedField;\n }", "java.lang.String getField1712();", "com.google.protobuf.ByteString\n getField1152Bytes();", "public void setAddTypeInfo(boolean addTypeInfo) {\n\t\tthis.addTypeInfo = addTypeInfo;\n\t}", "@Override\n public String getFieldDefinition( ValueMetaInterface v, String tk, String pk, boolean use_autoinc,\n boolean add_fieldname, boolean add_cr ) {\n String retval = \"\";\n\n String fieldname = v.getName();\n int length = v.getLength();\n int precision = v.getPrecision();\n\n if ( add_fieldname ) {\n retval += fieldname + \" \";\n }\n\n int type = v.getType();\n switch ( type ) {\n case ValueMetaInterface.TYPE_DATE:\n retval += \"TIMESTAMP\";\n break;\n case ValueMetaInterface.TYPE_BOOLEAN:\n if ( supportsBooleanDataType() ) {\n retval += \"BOOLEAN\";\n } else {\n retval += \"CHAR(1)\";\n }\n break;\n case ValueMetaInterface.TYPE_NUMBER:\n case ValueMetaInterface.TYPE_INTEGER:\n case ValueMetaInterface.TYPE_BIGNUMBER:\n if ( fieldname.equalsIgnoreCase( tk ) || // Technical key\n fieldname.equalsIgnoreCase( pk ) // Primary key\n ) {\n retval += \"BIGSERIAL\";\n } else {\n if ( length > 0 ) {\n if ( precision > 0 || length > 18 ) {\n // Numeric(Precision, Scale): Precision = total length; Scale = decimal places\n retval += \"NUMERIC(\" + ( length + precision ) + \", \" + precision + \")\";\n } else {\n if ( length > 9 ) {\n retval += \"BIGINT\";\n } else {\n if ( length < 5 ) {\n retval += \"SMALLINT\";\n } else {\n retval += \"INTEGER\";\n }\n }\n }\n\n } else {\n retval += \"DOUBLE PRECISION\";\n }\n }\n break;\n case ValueMetaInterface.TYPE_STRING:\n if ( length < 1 || length >= DatabaseMeta.CLOB_LENGTH ) {\n retval += \"TEXT\";\n } else {\n retval += \"VARCHAR(\" + length + \")\";\n }\n break;\n default:\n retval += \" UNKNOWN\";\n break;\n }\n\n if ( add_cr ) {\n retval += Const.CR;\n }\n\n return retval;\n }", "com.google.protobuf.ByteString\n getField1916Bytes();", "java.lang.String getField1624();", "java.lang.String getField1611();", "private MadisRecord processTypeF(String line, String[] headerType) {\n\n MadisRecord rec = null;\n String stationId = STRING_NULL; // 0\n String obsDate = null; // 1\n String obsTime = null; // 2\n String provider = STRING_NULL; // 3\n String sub_provider = STRING_NULL; // 4\n int dataset = MISSING_INT; // 5\n int restriction = MISSING_INT; // 6\n float td = MISSING_FLOAT; // 7\n QCD td_qcd = QCD.MISSING; // 8\n int td_qca = MISSING_INT; // 9\n int td_qcr = MISSING_INT; // 10\n float rh = MISSING_FLOAT; // 11\n QCD rh_qcd = QCD.MISSING; // 12\n int rh_qca = MISSING_INT; // 13\n int rh_qcr = MISSING_INT; // 14\n float altimeter = MISSING_FLOAT; // 15\n QCD altimeter_qcd = QCD.MISSING; // 16\n int altimeter_qca = MISSING_INT; // 17\n int altimeter_qcr = MISSING_INT; // 18\n float temperature = MISSING_FLOAT; // 19\n QCD temperature_qcd = QCD.MISSING; // 20\n int temperature_qca = MISSING_INT; // 21\n int temperature_qcr = MISSING_INT; // 22\n int windDirection = MISSING_INT; // 23\n QCD windDirection_qcd = QCD.MISSING; // 24\n int windDirection_qca = MISSING_INT; // 25\n int windDirection_qcr = MISSING_INT; // 26\n float windSpeed = MISSING_FLOAT; // 27\n QCD windSpeed_qcd = QCD.MISSING; // 28\n int windSpeed_qca = MISSING_INT; // 29\n int windSpeed_qcr = MISSING_INT; // 30\n int elevation = MISSING_INT; // 31\n QCD elevation_qcd = QCD.MISSING; // 32\n int elevation_qca = MISSING_INT; // 33\n int elevation_qcr = MISSING_INT; // 34\n float latitude = MISSING_FLOAT; // 35\n QCD latitude_qcd = QCD.MISSING; // 36\n int latitude_qca = MISSING_INT; // 37\n int latitude_qcr = MISSING_INT; // 38\n float longitude = MISSING_FLOAT; // 39\n QCD longitude_qcd = QCD.MISSING; // 40\n int longitude_qca = MISSING_INT; // 41\n int longitude_qcr = MISSING_INT; // 42\n float precipRate = MISSING_FLOAT; // 43\n QCD precipRate_qcd = QCD.MISSING; // 44\n int precipRate_qca = MISSING_INT; // 45\n int precipRate_qcr = MISSING_INT; // 46\n float windGust = MISSING_FLOAT; // 47\n QCD windGust_qcd = QCD.MISSING; // 48\n int windGust_qca = MISSING_INT; // 49\n int windGust_qcr = MISSING_INT; // 50\n float precipitalWater = MISSING_FLOAT;// 51\n QCD precipitalWater_qcd = QCD.MISSING;// 52\n int precipitalWater_qca = MISSING_INT; // 53\n int precipitalWater_qcr = MISSING_INT; // 54\n float pressure = MISSING_FLOAT;// 55\n QCD pressure_qcd = QCD.MISSING;// 56\n int pressure_qca = MISSING_INT; // 57\n int pressure_qcr = MISSING_INT; // 58\n\n String[] commaSepList = null;\n\n try {\n\n commaSepList = regex.split(line);\n\n if (commaSepList.length == typeFHeader.length) {\n\n rec = new MadisRecord();\n int i = 0;\n // get STAID\n stationId = trimQuotes(commaSepList[i++]).trim();\n\n // get OBSDATE\n obsDate = trimQuotes(commaSepList[i++]).trim();\n\n // get OBSTIME\n obsTime = trimQuotes(commaSepList[i++]).trim();\n\n // if these don't work, no use in going forward\n rec = setTimeObs(obsDate, obsTime, rec, headerType);\n // get PVDR\n provider = trimQuotes(commaSepList[i++]).trim();\n rec.setProvider(provider);\n\n // get SUBPVDR\n sub_provider = trimQuotes(commaSepList[i++]).trim();\n if (sub_provider.equals(BLANK)) {\n rec.setSubProvider(STRING_NULL);\n } else {\n rec.setSubProvider(sub_provider);\n }\n\n // the Dataset value\n dataset = new Integer(trimQuotes(commaSepList[i++]).trim())\n .intValue();\n rec.setDataset(dataset);\n // the Restriction value\n restriction = new Integer(trimQuotes(commaSepList[i++]).trim())\n .intValue();\n rec.setRestriction(restriction);\n // get TD\n td = new Float(trimQuotes(commaSepList[i++]).trim())\n .floatValue();\n rec.setDewpoint(td);\n // get TD QCD\n td_qcd = QCD.fromString(trimQuotes(commaSepList[i++]).trim());\n rec.setDewpoint_qcd(td_qcd);\n // get TD QCA\n td_qca = new Integer(trimQuotes(commaSepList[i++]).trim())\n .intValue();\n rec.setDewpoint_qca(td_qca);\n // get TD QCR\n td_qcr = new Integer(trimQuotes(commaSepList[i++]).trim())\n .intValue();\n rec.setDewpoint_qcr(td_qcr);\n // get RH\n rh = new Float(trimQuotes(commaSepList[i++]).trim())\n .floatValue();\n rec.setRh(rh);\n // get RH QCD\n rh_qcd = QCD.fromString(trimQuotes(commaSepList[i++]).trim());\n rec.setRh_qcd(rh_qcd);\n // get RH QCA\n rh_qca = new Integer(trimQuotes(commaSepList[i++]).trim())\n .intValue();\n rec.setRh_qca(rh_qca);\n // get RH QCR\n rh_qcr = new Integer(trimQuotes(commaSepList[i++]).trim())\n .intValue();\n rec.setRh_qcr(rh_qcr);\n // altimeter\n altimeter = new Float(trimQuotes(commaSepList[i++]).trim())\n .floatValue();\n rec.setAltimeter(altimeter);\n // get Altimeter QCD\n altimeter_qcd = QCD.fromString(trimQuotes(commaSepList[i++])\n .trim());\n rec.setAltimeter_qcd(altimeter_qcd);\n // get Altimeter QCA\n altimeter_qca = new Integer(trimQuotes(commaSepList[i++])\n .trim()).intValue();\n rec.setAltimeter_qca(altimeter_qca);\n // get Altimeter QCR\n altimeter_qcr = new Integer(trimQuotes(commaSepList[i++])\n .trim()).intValue();\n rec.setAltimeter_qcr(altimeter_qcr);\n // get Temperature\n temperature = new Float(trimQuotes(commaSepList[i++]).trim())\n .floatValue();\n rec.setTemperature(temperature);\n // get Temperature QCD\n temperature_qcd = QCD.fromString(trimQuotes(commaSepList[i++])\n .trim());\n rec.setTemperature_qcd(temperature_qcd);\n // get Temperature QCA\n temperature_qca = new Integer(trimQuotes(commaSepList[i++])\n .trim()).intValue();\n rec.setTemperature_qca(temperature_qca);\n // get Temperature QCR\n temperature_qcr = new Integer(trimQuotes(commaSepList[i++])\n .trim()).intValue();\n rec.setTemperature_qcr(temperature_qcr);\n // get Wind Direction\n windDirection = new Float(trimQuotes(commaSepList[i++]).trim())\n .intValue();\n rec.setWindDirection(windDirection);\n // get Wind Direction QCD\n windDirection_qcd = QCD\n .fromString(trimQuotes(commaSepList[i++]).trim());\n rec.setWindDirection_qcd(windDirection_qcd);\n // get WindDirection QCA\n windDirection_qca = new Integer(trimQuotes(commaSepList[i++])\n .trim()).intValue();\n rec.setWindDirection_qca(windDirection_qca);\n // get WindDirection QCR\n windDirection_qcr = new Integer(trimQuotes(commaSepList[i++])\n .trim()).intValue();\n rec.setWindDirection_qcr(windDirection_qcr);\n // wind speed\n windSpeed = new Float(trimQuotes(commaSepList[i++]).trim())\n .intValue();\n rec.setWindSpeed(windSpeed);\n // get Wind Speed QCD\n windSpeed_qcd = QCD.fromString(trimQuotes(commaSepList[i++])\n .trim());\n rec.setWindSpeed_qcd(windSpeed_qcd);\n // get WindSpeed QCA\n windSpeed_qca = new Integer(trimQuotes(commaSepList[i++])\n .trim()).intValue();\n rec.setWindSpeed_qca(windSpeed_qca);\n // get WindSpeed QCR\n windSpeed_qcr = new Integer(trimQuotes(commaSepList[i++])\n .trim()).intValue();\n rec.setWindSpeed_qcr(windSpeed_qcr);\n // get Elevation\n elevation = new Float(trimQuotes(commaSepList[i++]).trim())\n .intValue();\n // get Elevation QCD\n elevation_qcd = QCD.fromString(trimQuotes(commaSepList[i++])\n .trim());\n rec.setElevation_qcd(elevation_qcd);\n // get Elevation QCA\n elevation_qca = new Integer(trimQuotes(commaSepList[i++])\n .trim()).intValue();\n rec.setElevation_qca(elevation_qca);\n // get Elevation QCR\n elevation_qcr = new Integer(trimQuotes(commaSepList[i++])\n .trim()).intValue();\n rec.setElevation_qcr(elevation_qcr);\n // get Latitude\n latitude = new Float(trimQuotes(commaSepList[i++]).trim())\n .floatValue();\n // get Latitude QCD\n latitude_qcd = QCD.fromString(trimQuotes(commaSepList[i++])\n .trim());\n rec.setLatitude_qcd(latitude_qcd);\n // get latitude QCA\n latitude_qca = new Integer(trimQuotes(commaSepList[i++]).trim())\n .intValue();\n rec.setElevation_qca(latitude_qca);\n // get latitude QCR\n latitude_qcr = new Integer(trimQuotes(commaSepList[i++]).trim())\n .intValue();\n rec.setElevation_qcr(latitude_qcr);\n // get Longitude\n longitude = new Float(trimQuotes(commaSepList[i++]).trim())\n .floatValue();\n // get Longitude QCD\n longitude_qcd = QCD.fromString(trimQuotes(commaSepList[i++])\n .trim());\n rec.setLongitude_qcd(longitude_qcd);\n // get longitude QCA\n longitude_qca = new Integer(trimQuotes(commaSepList[i++])\n .trim()).intValue();\n rec.setLongitude_qca(longitude_qca);\n // get longitude QCR\n longitude_qcr = new Integer(trimQuotes(commaSepList[i++])\n .trim()).intValue();\n rec.setLongitude_qcr(longitude_qcr);\n // get precipRate\n precipRate = new Float(trimQuotes(commaSepList[i++]).trim())\n .floatValue();\n rec.setPrecipRate(precipRate);\n // get precipRate QCD\n precipRate_qcd = QCD.fromString(trimQuotes(commaSepList[i++])\n .trim());\n rec.setPrecipRate_qcd(precipRate_qcd);\n // precipRate QCA\n precipRate_qca = new Integer(trimQuotes(commaSepList[i++])\n .trim()).intValue();\n rec.setPrecipRate_qca(precipRate_qca);\n // precipRate QCR\n precipRate_qca = new Integer(trimQuotes(commaSepList[i++])\n .trim()).intValue();\n rec.setPrecipRate_qca(precipRate_qcr);\n // get Wind Gust\n windGust = new Float(trimQuotes(commaSepList[i++]).trim())\n .floatValue();\n rec.setWindGust(windGust);\n // get Wind Gust QCD\n windGust_qcd = QCD.fromString(trimQuotes(commaSepList[i++])\n .trim());\n rec.setWindGust_qcd(windGust_qcd);\n // get Wind Gust QCA\n windGust_qca = new Integer(trimQuotes(commaSepList[i++]).trim())\n .intValue();\n rec.setPrecipRate_qca(windGust_qca);\n // get Wind Gust QCR\n windGust_qcr = new Integer(trimQuotes(commaSepList[i++]).trim())\n .intValue();\n rec.setPrecipRate_qcr(windGust_qcr);\n // get precipitalWater\n precipitalWater = new Float(trimQuotes(commaSepList[i++])\n .trim()).floatValue();\n rec.setPrecipitalWater(precipitalWater);\n // get precipitalWater QCD\n precipitalWater_qcd = QCD.fromString(trimQuotes(\n commaSepList[i++]).trim());\n rec.setPrecipitalWater_qcd(precipitalWater_qcd);\n // get precipitalWater QCA\n precipitalWater_qca = new Integer(trimQuotes(commaSepList[i++])\n .trim()).intValue();\n rec.setPrecipitalWater_qca(precipitalWater_qca);\n // get precipitalWater QCR\n precipitalWater_qcr = new Integer(trimQuotes(commaSepList[i++])\n .trim()).intValue();\n rec.setPrecipitalWater_qcr(precipitalWater_qcr);\n // get pressure\n pressure = new Float(trimQuotes(commaSepList[i++]).trim())\n .floatValue();\n rec.setPressure(pressure);\n // get pressure QCD\n pressure_qcd = QCD.fromString(trimQuotes(commaSepList[i++])\n .trim());\n rec.setPressure_qcd(pressure_qcd);\n // get pressure QCA\n pressure_qca = new Integer(trimQuotes(commaSepList[i++]).trim())\n .intValue();\n rec.setPressure_qca(pressure_qca);\n // get pressure QCR\n pressure_qcr = new Integer(trimQuotes(commaSepList[i++]).trim())\n .intValue();\n rec.setPressure_qcr(pressure_qcr);\n // Take care of creating the station\n rec = setObsLocation(stationId, latitude, longitude, elevation,\n rec);\n rec = setRecordTime(rec);\n }\n\n } catch (Exception e) {\n statusHandler.handle(Priority.PROBLEM,\n \"Couldn't parse F file row. \" + stationId + e);\n }\n\n return rec;\n\n }", "@Beta\npublic interface FieldInfo {\n\n /** Returns the name of this field or field set. */\n String name();\n\n Field.Type type();\n\n /** Returns whether this field or field set is attribute(s), i.e. does indexing: attribute. */\n boolean isAttribute();\n\n /** Returns whether this field is index(es), i.e. does indexing: index. */\n boolean isIndex();\n\n}", "public Builder setField1116Bytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n field1116_ = value;\n onChanged();\n return this;\n }", "public void putAssetInvoiceDimensionColumnDetails(JSONObject params, JSONObject reqParams)throws ServiceException, JSONException{\n String companyId = params.optString(\"companyid\");\n int colnum = 0;\n HashMap fieldparams = new HashMap<>();\n fieldparams.put(Constants.filter_names, Arrays.asList(Constants.companyid, Constants.moduleid, \"fieldname\"));\n fieldparams.put(Constants.filter_values, Arrays.asList(companyId, Constants.Acc_FixedAssets_AssetsGroups_ModuleId, \"Custom_\" + Constants.HSN_SACCODE));\n\n KwlReturnObject kwlReturnObjectGstCust = fieldManagerDAOobj.getFieldParams(fieldparams);\n List<FieldParams> fieldParamses = kwlReturnObjectGstCust.getEntityList();\n for (FieldParams fieldParams : fieldParamses) {\n colnum = fieldParams.getColnum();\n }\n reqParams.put(GSTRConstants.ASSET_HSNCOLUMN, colnum);\n params.put(GSTRConstants.ASSET_HSNCOLUMN, colnum);\n fieldparams.put(Constants.filter_names, Arrays.asList(Constants.companyid, Constants.moduleid, \"fieldname\"));\n fieldparams.put(Constants.filter_values, Arrays.asList(companyId, Constants.Acc_FixedAssets_AssetsGroups_ModuleId, \"Custom_\" + Constants.GSTProdCategory));\n kwlReturnObjectGstCust = fieldManagerDAOobj.getFieldParams(fieldparams);\n fieldParamses = kwlReturnObjectGstCust.getEntityList();\n for (FieldParams fieldParams : fieldParamses) {\n colnum = fieldParams.getColnum();\n }\n reqParams.put(GSTRConstants.ASSET_TAXCLASSCOLUMN, colnum);\n params.put(GSTRConstants.ASSET_TAXCLASSCOLUMN, colnum);\n /*\n To get Unit Quantity Code column number asset Group\n */\n fieldparams.put(Constants.filter_names, Arrays.asList(Constants.companyid, Constants.moduleid, \"fieldname\"));\n fieldparams.put(Constants.filter_values, Arrays.asList(companyId, Constants.Acc_FixedAssets_AssetsGroups_ModuleId, \"Custom_\" + Constants.GST_UNIT_QUANTITY_CODE));\n kwlReturnObjectGstCust = fieldManagerDAOobj.getFieldParams(fieldparams);\n fieldParamses = kwlReturnObjectGstCust.getEntityList();\n for (FieldParams fieldParams : fieldParamses) {\n colnum = fieldParams.getColnum();\n }\n reqParams.put(GSTRConstants.ASSET_UQCCOLUMN, colnum);\n params.put(GSTRConstants.ASSET_UQCCOLUMN, colnum);\n /**\n * get State column no for asset Sales Invoice module\n */\n int colnumforstate = fieldManagerDAOobj.getColumnFromFieldParams(Constants.STATE, companyId, Constants.Acc_FixedAssets_DisposalInvoice_ModuleId, 0);\n reqParams.put(GSTRConstants.ASSET_STATE_SALES_COLUMN, colnumforstate);\n params.put(GSTRConstants.ASSET_STATE_SALES_COLUMN, colnumforstate);\n /**\n * get State column no for asset Purchase Invoice module\n */\n colnumforstate = fieldManagerDAOobj.getColumnFromFieldParams(Constants.STATE, companyId, Constants.Acc_FixedAssets_PurchaseInvoice_ModuleId, 0);\n reqParams.put(GSTRConstants.ASSET_STATE_PURCHASE_COLUMN, colnumforstate);\n params.put(GSTRConstants.ASSET_STATE_PURCHASE_COLUMN, colnumforstate);\n \n /**\n * Get Entity Value and its column no for asset Sales invoice\n */\n fieldparams.put(Constants.filter_names, Arrays.asList(Constants.companyid, Constants.moduleid, \"fieldname\"));\n fieldparams.put(Constants.filter_values, Arrays.asList(companyId, Constants.Acc_FixedAssets_DisposalInvoice_ModuleId, \"Custom_\" + Constants.ENTITY));\n String fieldid = \"\";\n kwlReturnObjectGstCust = fieldManagerDAOobj.getFieldParams(fieldparams);\n fieldParamses = kwlReturnObjectGstCust.getEntityList();\n for (FieldParams fieldParams : fieldParamses) {\n colnum = fieldParams.getColnum();\n fieldid = fieldParams.getId();\n }\n String entityValue = params.optString(\"entity\");\n String ids = fieldManagerDAOobj.getIdsUsingParamsValueWithoutInsert(fieldid, entityValue);\n reqParams.put(GSTRConstants.ASSET_SALES_INVOICE_ENTITYCOLUMN, colnum);\n params.put(GSTRConstants.ASSET_SALES_INVOICE_ENTITYCOLUMN, colnum);\n reqParams.put(GSTRConstants.ASSET_SALES_INVOICE_ENTIYVALUE, ids);\n params.put(GSTRConstants.ASSET_SALES_INVOICE_ENTIYVALUE, ids);\n /**\n * Get Entity Value and its column no for asset Purchase invoice\n */\n fieldparams.put(Constants.filter_names, Arrays.asList(Constants.companyid, Constants.moduleid, \"fieldname\"));\n fieldparams.put(Constants.filter_values, Arrays.asList(companyId, Constants.Acc_FixedAssets_PurchaseInvoice_ModuleId, \"Custom_\" + Constants.ENTITY));\n fieldid = \"\";\n kwlReturnObjectGstCust = fieldManagerDAOobj.getFieldParams(fieldparams);\n fieldParamses = kwlReturnObjectGstCust.getEntityList();\n for (FieldParams fieldParams : fieldParamses) {\n colnum = fieldParams.getColnum();\n fieldid = fieldParams.getId();\n }\n entityValue = params.optString(\"entity\");\n ids = fieldManagerDAOobj.getIdsUsingParamsValueWithoutInsert(fieldid, entityValue);\n reqParams.put(GSTRConstants.ASSET_PURCHASE_INVOICE_ENTITYCOLUMN, colnum);\n params.put(GSTRConstants.ASSET_PURCHASE_INVOICE_ENTITYCOLUMN, colnum);\n reqParams.put(GSTRConstants.ASSET_PURCHASE_INVOICE_ENTIYVALUE, ids);\n params.put(GSTRConstants.ASSET_PURCHASE_INVOICE_ENTIYVALUE, ids);\n }", "java.lang.String getField1633();", "@Test\n public void fieldInfo() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n // Set a value for the \"Comments\" built-in property and then insert an INFO field to display that property's value.\n doc.getBuiltInDocumentProperties().setComments(\"My comment\");\n FieldInfo field = (FieldInfo) builder.insertField(FieldType.FIELD_INFO, true);\n field.setInfoType(\"Comments\");\n field.update();\n\n Assert.assertEquals(field.getFieldCode(), \" INFO Comments\");\n Assert.assertEquals(field.getResult(), \"My comment\");\n\n builder.writeln();\n\n // Setting a value for the field's NewValue property and updating\n // the field will also overwrite the corresponding built-in property with the new value.\n field = (FieldInfo) builder.insertField(FieldType.FIELD_INFO, true);\n field.setInfoType(\"Comments\");\n field.setNewValue(\"New comment\");\n field.update();\n\n Assert.assertEquals(\" INFO Comments \\\"New comment\\\"\", field.getFieldCode());\n Assert.assertEquals(\"New comment\", field.getResult());\n Assert.assertEquals(\"New comment\", doc.getBuiltInDocumentProperties().getComments());\n\n doc.save(getArtifactsDir() + \"Field.INFO.docx\");\n //ExEnd\n\n doc = new Document(getArtifactsDir() + \"Field.INFO.docx\");\n\n Assert.assertEquals(\"New comment\", doc.getBuiltInDocumentProperties().getComments());\n\n field = (FieldInfo) doc.getRange().getFields().get(0);\n\n TestUtil.verifyField(FieldType.FIELD_INFO, \" INFO Comments\", \"My comment\", field);\n Assert.assertEquals(\"Comments\", field.getInfoType());\n\n field = (FieldInfo) doc.getRange().getFields().get(1);\n\n TestUtil.verifyField(FieldType.FIELD_INFO, \" INFO Comments \\\"New comment\\\"\", \"New comment\", field);\n Assert.assertEquals(\"Comments\", field.getInfoType());\n Assert.assertEquals(\"New comment\", field.getNewValue());\n }", "private void updateNutritionRecord(Context ctx, ResultSet rs) throws SQLException, ParseException {\r\n Date timestamp = ctx.getTimestamp(\"date\", \"time\");\r\n String item = ctx.getParameter(\"item\");\r\n String source = ctx.getParameter(\"source\");\r\n String quantity = ctx.getParameter(\"quantity\");\r\n String abv = ctx.getParameter(\"abv\");\r\n \r\n if (rs.next()) {\r\n if (ctx.getAppDb().getProtocol().equalsIgnoreCase(\"sqlserver\")) {\r\n rs.moveToCurrentRow();\r\n rs.updateString(\"Quantity\", quantity);\r\n\r\n if (abv.length() != 0) rs.updateString(\"ABV\", abv);\r\n \r\n rs.updateRow(); \r\n } else {\r\n SQLUpdateBuilder sql = ctx.getUpdateBuilder(\"NutritionRecord\");\r\n \r\n sql.addField(\"Quantity\", quantity);\r\n \r\n if (abv.length() != 0) sql.addField(\"ABV\", abv);\r\n \r\n sql.addAnd(\"Timestamp\", \"=\", timestamp);\r\n sql.addAnd(\"Item\", \"=\", item);\r\n sql.addAnd(\"Source\", \"=\", source);\r\n executeUpdate(ctx, sql);\r\n }\r\n } else {\r\n rs.moveToInsertRow();\r\n rs.updateString(\"Timestamp\", ctx.getDbTimestamp(timestamp));\r\n rs.updateString(\"Item\", ctx.getParameter(\"item\"));\r\n rs.updateString(\"Source\", ctx.getParameter(\"source\"));\r\n rs.updateString(\"Quantity\", quantity);\r\n rs.updateString(\"IsComposite\", ctx.getParameter(\"simple\").equalsIgnoreCase(\"c\") ? \"Y\" : \"N\");\r\n\r\n if (abv.length() != 0) rs.updateString(\"ABV\", abv);\r\n \r\n rs.insertRow();\r\n }\r\n }", "private static int \n extraCount (final Map.Entry <String, VersionedValue> entry)\n {\n return entry.getKey ().length () + 1 + 4 + entry.getValue ().getValue ().length () + 1;\n }", "private QuotationDetailsDTO createQuotationDetailsForMixedArticle(QuotationDetailsDTO detail, TableItem item) {\n\t\t\n\t\tdetail.setArticleName(item.getText(0));\n\t\tdetail.setChargedWeight(Float.parseFloat(item.getText(1)));\n\n\t\tif (item.getText(2).equalsIgnoreCase(optionB[0])) {\n\t\t\tdetail.setCcchargeType((byte) 0);\n\t\t} else if (item.getText(2).equalsIgnoreCase(optionB[1])) {\n\t\t\tdetail.setCcchargeType((byte) 1);\n\t\t} else if (item.getText(2).equalsIgnoreCase(optionB[2])) {\n\t\t\tdetail.setCcchargeType((byte) 2);\n\t\t} else if (item.getText(2).equalsIgnoreCase(optionB[3])) {\n\t\t\tdetail.setCcchargeType((byte) 3);\n\t\t}\n\t\tif (!item.getText(3).equals(EMPTYSTRING))\n\t\t\tdetail.setCcchargeValue(Float.parseFloat(item.getText(3)));\n\n\t\tif (item.getText(4).equalsIgnoreCase(optionB[0])) {\n\t\t\tdetail.setDcchargeType((byte) 0);\n\t\t} else if (item.getText(4).equalsIgnoreCase(optionB[1])) {\n\t\t\tdetail.setDcchargeType((byte) 1);\n\t\t} else if (item.getText(4).equalsIgnoreCase(optionB[2])) {\n\t\t\tdetail.setDcchargeType((byte) 2);\n\t\t} else if (item.getText(4).equalsIgnoreCase(optionB[3])) {\n\t\t\tdetail.setDcchargeType((byte) 3);\n\t\t}\n\t\tif (!item.getText(5).equals(EMPTYSTRING))\n\t\t\tdetail.setDcchargeValue(Float.parseFloat(item.getText(5)));\n\n\t\tif (item.getText(6).equalsIgnoreCase(optionB[0])) {\n\t\t\tdetail.setIechargeType((byte) 0);\n\t\t} else if (item.getText(6).equalsIgnoreCase(optionB[1])) {\n\t\t\tdetail.setIechargeType((byte) 1);\n\t\t} else if (item.getText(6).equalsIgnoreCase(optionB[3])) {\n\t\t\tdetail.setIechargeType((byte) 3);\n\t\t}\n\t\tif (!item.getText(7).equals(EMPTYSTRING))\n\t\t\tdetail.setIechargeValue(Float.parseFloat(item.getText(7)));\n\n\t\tif (item.getText(8).equalsIgnoreCase(optionB[0])) {\n\t\t\tdetail.setLcchargeType((byte) 0);\n\t\t} else if (item.getText(8).equalsIgnoreCase(optionB[1])) {\n\t\t\tdetail.setLcchargeType((byte) 1);\n\t\t}else if (item.getText(8).equalsIgnoreCase(optionB[3])) {\n\t\t\tdetail.setLcchargeType((byte) 3);\n\t\t}\n\t\tif (!item.getText(9).equals(EMPTYSTRING))\n\t\t\tdetail.setLcchargeValue(Float.parseFloat(item.getText(9)));\n\n\t\tif (item.getText(10).equalsIgnoreCase(optionC[0])) {\n\t\t\tdetail.setDdchargeType((byte) 0);\n\t\t} else if (item.getText(10).equalsIgnoreCase(optionC[1])) {\n\t\t\tdetail.setDdchargeType((byte) 1);\n\t\t} else if (item.getText(10).equalsIgnoreCase(optionC[2])) {\n\t\t\tdetail.setDdchargeType((byte) 2);\n\t\t}\n\t\tif (!item.getText(11).equals(EMPTYSTRING))\n\t\t\tdetail.setMinDdchargeValue(Float.parseFloat(item.getText(11)));\n\t\tif (!item.getText(12).equals(EMPTYSTRING))\n\t\t\tdetail.setDdchargeArticle(Float.parseFloat(item.getText(12)));\n\n\t\treturn detail;\n\t}", "java.lang.String getField1628();" ]
[ "0.49575895", "0.45914707", "0.45409963", "0.45352378", "0.4491365", "0.44020343", "0.43606308", "0.43511078", "0.43171054", "0.4212545", "0.42095956", "0.4196829", "0.41638684", "0.4151568", "0.414572", "0.41385326", "0.4135655", "0.41350752", "0.4124459", "0.4117128", "0.41066745", "0.41066086", "0.41054848", "0.40874955", "0.40744248", "0.40705183", "0.40617082", "0.40571263", "0.40561885", "0.40525267", "0.40492067", "0.4041836", "0.40405118", "0.403839", "0.4037576", "0.40371948", "0.403707", "0.4033869", "0.4033053", "0.4028014", "0.40238902", "0.40227258", "0.40207487", "0.4017717", "0.40079296", "0.40065843", "0.40041053", "0.40036073", "0.40020326", "0.39908797", "0.39877746", "0.398201", "0.39741734", "0.39710268", "0.39692062", "0.39655623", "0.3965112", "0.3951514", "0.39459383", "0.3945743", "0.3939688", "0.39239097", "0.39233", "0.39214435", "0.39208353", "0.39205357", "0.39138696", "0.39115876", "0.39083496", "0.39080924", "0.39054736", "0.39025587", "0.3895822", "0.389189", "0.38875616", "0.38874277", "0.3885626", "0.3882817", "0.38805547", "0.38804328", "0.3878468", "0.38772902", "0.3873598", "0.38724694", "0.3870853", "0.38700485", "0.38647765", "0.3863587", "0.38625363", "0.3859846", "0.38528305", "0.3852669", "0.38500947", "0.38410786", "0.38407344", "0.38349107", "0.3833926", "0.38320416", "0.3831264", "0.38293052" ]
0.69926286
0
If the value is a missing value("."), we need to replace it with null in BQ row, which refers to `unknown`.
public String replaceMissingWithNull(String value);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void replaceBlanks(String[] row) {\n for(int i = 0; i < row.length; i++) {\n if(row[i] == null || row[i].isEmpty()) {\n row[i] = \"b\";\n }\n }\n }", "private String notNull(String value) {\n return value != null ? value : \"\";\n }", "private String getStringOrNull (String value) {\n if (value == null || value.isEmpty()) value = null;\n return value;\n }", "private void replaceNullKeyWithEmptyString(PFXExtensionType extensionType, ObjectNode node) {\n Set<String> existingFields = getExistingFields(node);\n\n Set<String> missingFields = extensionType.getBusinessKeys();\n missingFields.removeAll(existingFields);\n\n for (String missingField : missingFields) {\n if (node.get(missingField) == null || node.get(missingField).isMissingNode() ||\n node.get(missingField).textValue() == null) {\n node.put(missingField, StringUtils.EMPTY);\n }\n }\n }", "public void setValueNull()\n\t{\n\t\tallValues.clear();\n\t}", "@Override\n protected <T> T replaceIfNotNull(T previousVal, T newVal) {\n return newVal;\n }", "public static String removeNullString(String value) {\r\n if(value == null) {\r\n value = NULL_STRING_INDICATOR;\r\n }\r\n\r\n /*else\r\n if(value.trim().equals(\"\")) {\r\n value = EMPTY_STRING_INDICATOR;\r\n }*/\r\n return value;\r\n }", "private void setColumnNullInternal(String column)\n {\n data.put(canonicalize(column), NULL_OBJECT);\n }", "@Override\n\tpublic void replaceMissingValues(final double[] array) {\n\n\t}", "private static String null2unknown(String in) {\r\n\t\tif (in == null || in.length() == 0) {\r\n\t\t\treturn null;\r\n\t\t} else {\r\n\t\t\treturn in;\r\n\t\t}\r\n\t}", "public static String nullConv(String value){\r\n\t\tif(value==null){\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t\treturn value;\r\n\t}", "@Test(expected = NullPointerException.class)\n public void givenNullValueShouldReturnNullPointerException() {\n transpose.setString(null);\n }", "public static BigDecimal nullEmptyToValue(BigDecimal b,BigDecimal theValue)\n {\n if(isEmptyDecimal(b))\n {\n\t return theValue;\n }\n else\n {\n\t return b;\n }\n }", "@Override\n\tpublic void visit(NullValue arg0) {\n\t\t\n\t}", "protected void changeNulls(String[] line) {\n if (line[airlineID].equals(\"\\\\N\")) {\n line[airlineID] = \"0\";\n }\n\n if (line[sourceAirportID].equals(\"\\\\N\")) {\n line[sourceAirportID] = \"0\";\n }\n\n if (line[destinationAirportID].equals(\"\\\\N\")) {\n line[destinationAirportID] = \"0\";\n }\n }", "@Override\n\tpublic void visit(NullValue arg0) {\n\n\t}", "@Override\n\tpublic boolean hasMissingValue() {\n\t\treturn false;\n\t}", "@Override\n public String Inject(String value, SchemaBuilder schema)\n {\n return \"ReplaceWithNull\";\n }", "private static void checkForNullValue(String value) {\n if ( value == null ) {\n throw new NullPointerException();\n }\n }", "@Override\n\tpublic Value apprise() {\n\t\treturn null;\n\t}", "void setNilValue();", "@Test void testInterpretNullif() {\n final String sql = \"select nullif(x, 2), x\\n\"\n + \"from (values (1, 'a'), (2, 'b'), (3, 'c')) as t(x, y)\";\n sql(sql).returnsRows(\"[1, 1]\", \"[null, 2]\", \"[3, 3]\");\n }", "private V isertNullKey(K key, V value) {\n return value;\n }", "private void checkLabelValue()\n\t{\n\t\tif(labelValue != null && !\"\".equals(labelValue))\n\t\t{\n\t\t\tlabelValue += \": \";\n\t\t}\n\t}", "@Test public void testEmptyColumnValues() {\n String data[] = {\n \"1,2,3,foo\\n\"\n + \"4,5,6,bar\\n\"\n + \"7,,8,\\n\"\n + \",9,10\\n\"\n + \"11,,,\\n\"\n + \"0,0,0,z\\n\"\n + \"0,0,0,z\\n\"\n + \"0,0,0,z\\n\"\n + \"0,0,0,z\\n\"\n + \"0,0,0,z\\n\"\n };\n double[][] expDouble = new double[][] {\n ard(1, 2, 3, 1),\n ard(4, 5, 6, 0),\n ard(7, NaN, 8, NaN),\n ard(NaN, 9, 10, NaN),\n ard(11, NaN, NaN, NaN),\n ard(0, 0, 0, 2),\n ard(0, 0, 0, 2),\n ard(0, 0, 0, 2),\n ard(0, 0, 0, 2),\n ard(0, 0, 0, 2),\n };\n\n final char separator = ',';\n\n String[] dataset = getDataForSeparator(separator, data);\n Key key = FVecFactory.makeByteVec(dataset);\n Key r = Key.make();\n ParseDataset.parse(r, key);\n Frame fr = DKV.get(r).get();\n String[] cd = fr.vecs()[3].domain();\n Assert.assertEquals(\"bar\",cd[0]);\n Assert.assertEquals(\"foo\",cd[1]);\n testParsed(r, expDouble);\n }", "static String emptyToNull(String value) {\n if (value == null || value.trim().isEmpty())\n return null;\n return value.trim();\n }", "NullValue createNullValue();", "NullValue createNullValue();", "@Test(expected = SuperCsvCellProcessorException.class)\n\tpublic void testWithNull() {\n\t\tprocessor.execute(null, ANONYMOUS_CSVCONTEXT);\n\t}", "T getNullValue();", "@Override\n public abstract Object getEmptyValue(DeserializationContext ctxt) throws JsonMappingException;", "protected boolean skipBlankValues() {\n return true;\n }", "public void fillInMissingValue(String tableName, List<String> colList,\n\t\t\tList<String> valueList) {\n\n\t\tSet<String> missFields = findMissingDataFields(tableName, colList,\n\t\t\t\tvalueList);\n\n\t\tDatabaseTable dbT = annotatedTableSchema.get(tableName);\n\t\tfor (int i = 0; i < valueList.size(); i++) {\n\t\t\tDataField dF = null;\n\t\t\tif (colList != null && colList.size() > 0) {\n\t\t\t\tdF = dbT.get_Data_Field(colList.get(i));\n\t\t\t} else {\n\t\t\t\tdF = dbT.get_Data_Field(i);\n\t\t\t}\n\t\t\tString expStr = valueList.get(i).toString().trim();\n\t\t\tif (expStr.equalsIgnoreCase(\"NOW()\")\n\t\t\t\t\t|| expStr.equalsIgnoreCase(\"NOW\")\n\t\t\t\t\t|| expStr.equalsIgnoreCase(\"CURRENT_TIMESTAMP\")\n\t\t\t\t\t|| expStr.equalsIgnoreCase(\"CURRENT_TIMESTAMP()\")\n\t\t\t\t\t|| expStr.equalsIgnoreCase(\"CURRENT_DATE\")) {\n\t\t\t\tvalueList.set(i, \"'\" + DatabaseFunction.CURRENTTIMESTAMP(this.getDateFormat()) + \"'\");\n\t\t\t}\n\t\t}\n\n\t\t// fill in the missing tuples\n\t\tif (missFields != null) {\n\t\t\tfor (String missingDfName : missFields) {\n\t\t\t\tcolList.add(missingDfName);\n\t\t\t\tDataField dF = dbT.get_Data_Field(missingDfName);\n\t\t\t\tif (dF.is_Primary_Key()) {\n\t\t\t\t\tif (dF.is_Foreign_Key()) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\t\t\t\t\"Foreign primary key must be specified \"\n\t\t\t\t\t\t\t\t\t\t\t+ missingDfName + \"!\");\n\t\t\t\t\t\t} catch (RuntimeException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\tSystem.exit(RuntimeExceptionType.FOREIGNPRIMARYKEYMISSING);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/*valueList.add(Integer.toString(iDFactory.getNextId(\n\t\t\t\t\t\t\t\ttableName, dF.get_Data_Field_Name())));*/\n\t\t\t\t\t\tthrow new RuntimeException(\"The primary keys' values should not be missing\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (dF.get_Default_Value() == null) {\n\t\t\t\t\t\tvalueList.add(CrdtFactory.getDefaultValueForDataField(this.getDateFormat(), dF));\n\t\t\t\t\t}else {\n\t\t\t\t\t\tif (dF.get_Default_Value().equalsIgnoreCase(\n\t\t\t\t\t\t\t\t\"CURRENT_TIMESTAMP\")) {\n\t\t\t\t\t\t\tvalueList.add(\"'\" + DatabaseFunction.CURRENTTIMESTAMP(this.getDateFormat()) + \"'\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvalueList.add(dF.get_Default_Value());\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 static String removeNull(Object value) {\r\n String valueToReturn = EMPTY_STRING_INDICATOR;\r\n\r\n if(value instanceof String) {\r\n valueToReturn = removeNullString((String) value);\r\n } else if(value instanceof Integer) {\r\n valueToReturn = removeNullInteger((Integer) value);\r\n } else if(value instanceof Date) {\r\n valueToReturn = removeNullDate((Date) value);\r\n } else if(value instanceof Boolean) {\r\n valueToReturn = removeNullBoolean((Boolean) value);\r\n } else if(value instanceof BigDecimal) {\r\n valueToReturn = removeNullBigDecimal((BigDecimal) value);\r\n } else if(value instanceof Long) {\r\n valueToReturn = removeNullLong((Long) value);\r\n }\r\n\r\n return valueToReturn;\r\n }", "@Override\r\n\tpublic Value interpret() {\n\t\treturn null;\r\n\t}", "@Override\n public void setNull() {\n\n }", "public void setNull (JaqyPreparedStatement stmt, int column, ParameterInfo paramInfo) throws Exception;", "private Optional() {\r\n\t\tthis.value = null;\r\n\t}", "@Test\r\n public void testParseCloudNullCloudQuantity() {\r\n String cloud = \"AZE015\";\r\n\r\n Cloud res = getSut().parseCloud(cloud);\r\n\r\n assertNull(res);\r\n }", "@Override\n public Object getEmptyValue(DeserializationContext ctxt) throws JsonMappingException {\n return getNullValue(ctxt);\n }", "@Test(expected = SuperCsvCellProcessorException.class)\n\tpublic void testWithEmptyString() {\n\t\tprocessor.execute(\"\", ANONYMOUS_CSVCONTEXT);\n\t}", "@Override\n\tpublic String getValue() {\n\t\treturn null;\n\t}", "@Override\n\tpublic String getValue() {\n\t\treturn null;\n\t}", "@Override\n\tpublic String getValue() {\n\t\treturn null;\n\t}", "public static String dispNull (String input) {\n //because of short circuiting, if it's null, it never checks the length.\n if (input == null || input.length() == 0)\n return \"N/A\";\n else\n return input;\n }", "Object setValue(Object value) throws NullPointerException;", "private static String getPropertyValueOrDefault(String value) {\n return value != null ? value : \"\";\n }", "public void updateNull(int columnIndex) throws SQLException {\n\n try {\n debugCodeCall(\"updateNull\", columnIndex);\n update(columnIndex, ValueNull.INSTANCE);\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public void updateNull(String columnName) throws SQLException {\n\n try {\n debugCodeCall(\"updateNull\", columnName);\n update(columnName, ValueNull.INSTANCE);\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "@Override\n\tpublic Object getValue() {\n\t\treturn null;\n\t}", "public static String dispNull (String input) {\n //because of short circuiting, if it's null, it never checks the length.\n if (input == null || input.length() == 0)\n return \"N/A\";\n else\n return input;\n }", "public static String dispNull (String input) {\n //because of short circuiting, if it's null, it never checks the length.\n if (input == null || input.length() == 0)\n return \"N/A\";\n else\n return input;\n }", "@Override\r\n\t\t\tpublic Object getValue() {\n\t\t\t\treturn null;\r\n\t\t\t}", "@Nullable\n protected abstract T substituteDefault(@Nullable T value);", "@Test\n public void gbInfectiousNaN() throws Exception {\n setup(BASE_TS, BASE_TS + 3600 * 2, \"5m\", \"avg\", null, false, \"sum\", true, null, \"host\");\n dataSetup(2, 42L, 2, new Answer[] {\n new OneMinuteRateDataIntervalMissing(1),\n new OneMinuteConsistent(2) });\n AerospikeGBTimeSeries ts = new AerospikeGBTimeSeries(queryResult, groupResult);\n ts.process();\n\n TypedTimeSeriesIterator<NumericArrayType> it =\n (TypedTimeSeriesIterator<NumericArrayType>) ts.iterator(NumericArrayType.TYPE).get();\n assertTrue(it.hasNext());\n TimeSeriesValue<NumericArrayType> tsv = it.next();\n assertEquals(0, tsv.value().offset());\n assertEquals(24, tsv.value().end());\n double[] expected = new double[24];\n Arrays.fill(expected, 3);\n expected[2] = 2;\n expected[3] = 2;\n expected[4] = 2;\n// expected[2] = Double.NaN;\n// expected[3] = Double.NaN;\n// expected[4] = Double.NaN;\n assertWithNans(expected, tsv.value().doubleArray());\n }", "@Override\n public Object getValue(String key) {\n return null;\n }", "@Test(expected = NullPointerException.class)\n public void testNullPut() throws IOException {\n putRowInDB(table, null);\n }", "public SpreadsheetFormula replaceErrorWithValueIfPossible(final SpreadsheetEngineContext context) {\n Objects.requireNonNull(context, \"context\");\n\n final SpreadsheetError error = this.error()\n .orElse(null);\n return null == error ?\n this :\n this.setValue(\n Optional.of(\n error.replaceWithValueIfPossible(context)\n )\n );\n }", "String toString(String value) {\n value = value.trim();\n if (\".\".equals(value)) value = \"\";\n if (\"n/a\".equals(value)) value = \"\";\n return (!\"\".equals(value) ? value : Tables.CHARNULL);\n }", "protected Object atInsert(Object value) {\n return null;\n }", "public void setValue(String value) {\n this.value = value == null ? null : value.trim();\n }", "public void setValue(String value) {\n this.value = value == null ? null : value.trim();\n }", "public void setValue(String value) {\n this.value = value == null ? null : value.trim();\n }", "private void nullColumns(List columns)\n {\n for (Iterator iterator = columns.iterator(); iterator.hasNext(); )\n {\n setColumnNullInternal((String) iterator.next());\n }\n }", "private static float checkNull(String current) {\n if (current.equals(NULLSTR)) {\n return ZERO;\n } else {\n return Float.parseFloat(current);\n }\n }", "public M csmiBirthdayNull(){if(this.get(\"csmiBirthdayNot\")==null)this.put(\"csmiBirthdayNot\", \"\");this.put(\"csmiBirthday\", null);return this;}", "@Override\r\n\tpublic String getValue() {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic String getValue() {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic String getValue() {\n\t\treturn null;\r\n\t}", "public void setValueToMissing(boolean b, int row, int col) {\n columns[col].setValueToMissing(b, row);\n }", "@Test\n public void testNotNullValues() throws Throwable {\n final byte[] rawFooValue = Tools.getBytesUtf8(\"Hello foo!\");\n final byte[] rawBarValue = Tools.getBytesUtf8(\"Hello bar!\");\n\n AsyncConsistentMap<String, byte[]> map =\n DistributedPrimitives.newNotNullMap(newPrimitive(\"testNotNullValues\"));\n\n map.get(\"foo\")\n .thenAccept(v -> assertNull(v)).join();\n map.put(\"foo\", null)\n .thenAccept(v -> assertNull(v)).join();\n map.put(\"foo\", rawFooValue).thenAccept(v -> assertNull(v)).join();\n map.get(\"foo\").thenAccept(v -> {\n assertNotNull(v);\n assertTrue(Arrays.equals(v.value(), rawFooValue));\n }).join();\n map.put(\"foo\", null).thenAccept(v -> {\n assertNotNull(v);\n assertTrue(Arrays.equals(v.value(), rawFooValue));\n }).join();\n map.get(\"foo\").thenAccept(v -> assertNull(v)).join();\n map.replace(\"foo\", rawFooValue, null)\n .thenAccept(replaced -> assertFalse(replaced)).join();\n map.replace(\"foo\", null, rawBarValue)\n .thenAccept(replaced -> assertTrue(replaced)).join();\n map.get(\"foo\").thenAccept(v -> {\n assertNotNull(v);\n assertTrue(Arrays.equals(v.value(), rawBarValue));\n }).join();\n map.replace(\"foo\", rawBarValue, null)\n .thenAccept(replaced -> assertTrue(replaced)).join();\n map.get(\"foo\").thenAccept(v -> assertNull(v)).join();\n }", "public String notNull(String text)\n {\n return text == null ? \"\" : text;\n }", "private String getNullValueText() {\n return getNull();\n }", "private String setNullIfEmpty(String in) {\n if (in != null && in.trim().length() == 0) {\n return null;\n }\n return in;\n }", "protected boolean skipNullValues() {\n return true;\n }", "@Override\n public Optional<?> getNullValue(DeserializationContext ctxt) throws JsonMappingException {\n return Optional.ofNullable(_valueDeserializer.getNullValue(ctxt));\n }", "public void fill() {\n throw null;\n }", "@Override\n public void writeNull(FieldDefinition di) {\n if (inArray) {\n arr.addNull();\n } else if (writeNulls) {\n obj.putNull(di.getName());\n }\n }", "private String replaceNull(Time s) {\n\t\treturn s == null ? \"--\" : s.toString();\n\t}", "protected void writeNullValue() throws IOException {\n _generator.writeNull();\n }", "@Override\n\tpublic void fillDefault(Value v) {\n\n\t}", "private void setValuesIfNoData(TaxChallan taxChallan) {\r\n\t\ttaxChallan.setTax(\"0.00\");\r\n\t\ttaxChallan.setSurcharge(\"0.00\");\r\n\t\ttaxChallan.setEduCess(\"0.00\");\r\n\t\ttaxChallan.setTotalTax(\"0.00\");\r\n\t\ttaxChallan.setIntAmt(\"0.00\");\r\n\t\ttaxChallan.setOthrAmt(\"0.00\");\r\n\t\ttaxChallan.setNoData(\"true\");\r\n\t}", "@Override\n\tpublic void visit(Null n) {\n\t\t\n\t}", "public Builder clearNilValue() {\n if (typeCase_ == 1) {\n typeCase_ = 0;\n type_ = null;\n onChanged();\n }\n return this;\n }", "private String bindNull() {\n String op;\n \n if (operator == null) {\n op = null;\n } else if (operator.equals(\"=\")) {\n op = \"IS\";\n } else if (operator.equals(\"!=\")) {\n op = \"IS NOT\";\n } else {\n op = operator;\n }\n if (column != null && skipNulls) {\n return \"1 = 1\";\n } else {\n return cond(column, op, \"NULL\");\n }\n }", "@Test(timeout = 4000)\n public void test008() throws Throwable {\n String string0 = SQLUtil.renderValue((Object) null);\n assertEquals(\"null\", string0);\n }", "static public void emitNullableString(RowEmitter outputEmitter, String value) {\r\n\t\tif(value != null)\r\n\t\t\toutputEmitter.addString(value);\r\n\t\telse\r\n\t\t\toutputEmitter.addNull();\r\n\t}", "public M csmiNationNull(){if(this.get(\"csmiNationNot\")==null)this.put(\"csmiNationNot\", \"\");this.put(\"csmiNation\", null);return this;}", "private void setValue(int columnIndex, String value) throws Exception {\n //TODO Take into account the possiblity of a collision, and notify listeners if necessary\n if (wasNull || value == null) {\n rowValues[columnIndex - 1] = null;\n } else {\n switch (metaData.getColumnType(columnIndex)) {\n case Types.TINYINT:\n rowValues[columnIndex - 1] = Byte.valueOf(value.trim());\n break;\n case Types.SMALLINT:\n rowValues[columnIndex - 1] = Short.valueOf(value.trim());\n break;\n case Types.INTEGER:\n rowValues[columnIndex - 1] = Integer.valueOf(value.trim());\n break;\n case Types.BIGINT:\n rowValues[columnIndex - 1] = Long.valueOf(value.trim());\n break;\n case Types.REAL:\n rowValues[columnIndex - 1] = Float.valueOf(value.trim());\n break;\n case Types.FLOAT:\n case Types.DOUBLE:\n rowValues[columnIndex - 1] = Double.valueOf(value.trim());\n break;\n case Types.DECIMAL:\n case Types.NUMERIC:\n rowValues[columnIndex - 1] = new BigDecimal(value.trim());\n break;\n case Types.BOOLEAN:\n case Types.BIT:\n rowValues[columnIndex - 1] = Boolean.valueOf(value.trim());\n break;\n case Types.CHAR:\n case Types.VARCHAR:\n case Types.LONGVARCHAR:\n rowValues[columnIndex - 1] = value;\n break;\n case Types.VARBINARY:\n case Types.LONGVARBINARY:\n case Types.BINARY:\n byte[] bytes = Base64.decode(value);\n rowValues[columnIndex - 1] = bytes;\n break;\n case Types.DATE:\n case Types.TIME:\n case Types.TIMESTAMP:\n rowValues[columnIndex - 1] = new Timestamp(Long.parseLong(value.trim()));\n break;\n case Types.ARRAY:\n case Types.BLOB:\n case Types.CLOB:\n case Types.DATALINK:\n case Types.DISTINCT:\n case Types.JAVA_OBJECT:\n case Types.OTHER:\n case Types.REF:\n case Types.STRUCT:\n //what to do with this?\n break;\n default :\n //do nothing\n }\n }\n }", "public void testGetNullValue() {\n ValueString vs = new ValueString();\n\n assertNull(vs.getString());\n assertEquals(0.0D, vs.getNumber(), 0.0D);\n assertNull(vs.getDate());\n assertEquals(false, vs.getBoolean());\n assertEquals(0, vs.getInteger());\n assertEquals(null, vs.getBigNumber());\n assertNull(vs.getSerializable());\n }", "public void setUnknownDataValueMode(int mode) {\r\n dataBinder.setUnknownDataValueMode(mode);\r\n }", "private void checkNotUnknown() {\n if (isUnknown())\n throw new AnalysisException(\"Unexpected 'unknown' value!\");\n }", "static Object missingValue(Class type) {\n if (!OptionalParameter.class.isAssignableFrom(type)) {\n return null;\n } else if (type == OptString.class) {\n return OptString.theMissingValue;\n } else if (type == OptBoolean.class) {\n return OptBoolean.theMissingValue;\n } else if (type == OptInteger.class) {\n return OptInteger.theMissingValue;\n } else if (type == OptDouble.class) {\n return OptDouble.theMissingValue;\n } else {\n return null;\n }\n }", "public void updateNull(int columnIndex) throws SQLException\n {\n m_rs.updateNull(columnIndex);\n }", "public static String displayNull (String input)\r\n {\r\n //because of short circuiting, if it's null, it never checks the length.\r\n if (input == null || input.length() == 0)\r\n return \"N/A\";\r\n else\r\n return input;\r\n }", "private void throwIfNullValue(final V value) {\n if (value == null) {\n throw new IllegalArgumentException(\"null values are not supported\");\n }\n }", "@Deprecated\n @InlineMe(replacement = \"null\")\n @Override\n public final Object getValue(final String arg0) {\n return null;\n }", "public M csmiPlaceNull(){if(this.get(\"csmiPlaceNot\")==null)this.put(\"csmiPlaceNot\", \"\");this.put(\"csmiPlace\", null);return this;}", "public static ConfigurationSetting normalizeNullLabel(ConfigurationSetting setting) {\n return setting.getLabel() == null ? setting.setLabel(EMPTY_LABEL) : setting;\n }", "public void testNullEnum () {\n\t\tString example = null;\n\t\ttry {\n\t\t\tRadioBand temp = RadioBand.valueForString(example);\n assertNull(\"Result of valueForString should be null.\", temp);\n\t\t}\n\t\tcatch (NullPointerException exception) {\n fail(\"Null string throws NullPointerException.\");\n\t\t}\n\t}" ]
[ "0.63281316", "0.6042675", "0.59310186", "0.59016824", "0.58800495", "0.5662429", "0.5634427", "0.56126094", "0.56006527", "0.55845743", "0.55752677", "0.551073", "0.5506946", "0.54111934", "0.5407738", "0.54060954", "0.53725755", "0.53436255", "0.53253657", "0.53141445", "0.53081435", "0.52942765", "0.5283805", "0.5259549", "0.525511", "0.52458274", "0.52407557", "0.52407557", "0.52281153", "0.52180874", "0.51954156", "0.51624054", "0.5160042", "0.5129882", "0.5128842", "0.511613", "0.50863653", "0.507917", "0.50779766", "0.5075341", "0.5066953", "0.5047831", "0.5047831", "0.5047831", "0.5047186", "0.5017104", "0.50132304", "0.49908513", "0.49888083", "0.49849123", "0.49791515", "0.49791515", "0.49561867", "0.4944439", "0.49416456", "0.49385604", "0.49352843", "0.4931122", "0.4928341", "0.49267557", "0.49186084", "0.49186084", "0.49186084", "0.49174255", "0.49168152", "0.49139157", "0.49093902", "0.49093902", "0.49093902", "0.4898594", "0.48961833", "0.48924202", "0.4889922", "0.48857945", "0.48809278", "0.48770732", "0.4867195", "0.48652545", "0.4861223", "0.48452166", "0.4838047", "0.48379844", "0.48227692", "0.4819683", "0.48190552", "0.47988227", "0.47905275", "0.47866702", "0.47764435", "0.47738624", "0.4773305", "0.47709227", "0.47565272", "0.47526607", "0.474648", "0.4740507", "0.4735363", "0.47345552", "0.47319433", "0.4729282" ]
0.729647
0
Instantiates a new Guided mutation coordinator that selects trees to mutate and applies one of a given set of (weighted) mutators. Also distinguishes between guided mutators and random/stupid mutators.
public GuidedTreeMutationCoordinator(CentralRegistry registry, double chanceOfRandomMutation, boolean preventDuplicates, LinkedHashMap<TreeMutationAbstract, Double> smartMutators, TreeMutationCoordinator dumbCoordinator) { this.registry = registry; this.chanceOfRandomMutation = chanceOfRandomMutation; this.preventDuplicates = preventDuplicates; this.smartMutators = smartMutators; this.dumbCoordinator = dumbCoordinator; calculateTotalChance(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void mutateHelper() {\n\t\tsynchronized (this) {\n\t\t\tRandom rand = new Random();\n\t\t\tint mutateType = rand.nextInt(5);\n\t\t\tif (rules.size() >= 14) {\n\t\t\t\tmutateType = rand.nextInt(6);\n\t\t\t}\n\t\t\tint index = rand.nextInt(rules.size());\n\t\t\tMutation m = null;\n\t\t\tswitch (mutateType) {\n\t\t\tcase 0:\n\t\t\t\tm = MutationFactory.getDuplicate();\n\t\t\t\tm.addRules(rules.root);\n\t\t\t\tm.mutate(index);\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tm = MutationFactory.getInsert();\n\t\t\t\tm.addRules(rules.root);\n\t\t\t\tm.mutate(index);\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\tm = MutationFactory.getRemove();\n\t\t\t\tm.addRules(rules.root);\n\t\t\t\tm.mutate(index);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tm = MutationFactory.getReplace();\n\t\t\t\tm.addRules(rules.root);\n\t\t\t\tm.mutate(index);\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tm = MutationFactory.getSwap();\n\t\t\t\tm.addRules(rules.root);\n\t\t\t\tm.mutate(index);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tm = MutationFactory.getTransform();\n\t\t\t\tm.addRules(rules.root);\n\t\t\t\tm.mutate(index);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "private Mutater createMutater(int mutationpoint) {\n final Mutater m = new Mutater(mutationpoint);\n m.setIgnoredMethods(mExcludeMethods);\n m.setMutateIncrements(mIncrements);\n m.setMutateInlineConstants(mInlineConstants);\n m.setMutateReturnValues(mReturnVals);\n return m;\n }", "public Chromosome doExchangeMutation(){\n for(int i = 0; i < PopulationConfiguration.MUTATION_ATTEMPTS; i++){\n ArrayList<Boolean> newSelection = copyBoolArrayList(this.knapsackSelection);\n\n int allele1 = Configuration.RANDOM_GENERATOR.nextInt(newSelection.size());\n int allele2 = Configuration.RANDOM_GENERATOR.nextInt(newSelection.size());\n Collections.swap(newSelection, allele1, allele2);\n\n Chromosome mutatedKnapsack = new Chromosome(newSelection).withFitnessCalculated();\n if(mutatedKnapsack.isValid())\n return mutatedKnapsack;\n }\n return this;\n }", "public Chromosome doInsertionMutation(){\n for(int i = 0; i < PopulationConfiguration.MUTATION_ATTEMPTS; i++){\n ArrayList<Boolean> newSelection = copyBoolArrayList(this.knapsackSelection);\n\n int allele1 = Configuration.RANDOM_GENERATOR.nextInt(newSelection.size());\n int allele2 = Configuration.RANDOM_GENERATOR.nextInt(newSelection.size());\n boolean value = newSelection.get(allele2);\n\n newSelection.remove(allele2);\n try{\n newSelection.add(allele1 + 1, value);\n }\n catch(IndexOutOfBoundsException e){\n newSelection.add(value);\n }\n \n Chromosome mutatedKnapsack = new Chromosome(newSelection).withFitnessCalculated();\n if(mutatedKnapsack.isValid())\n return mutatedKnapsack;\n }\n return this;\n }", "public Chromosome doDisplacementMutation(){\n for(int i = 0; i < PopulationConfiguration.MUTATION_ATTEMPTS; i++){\n ArrayList<Boolean> newSelection = copyBoolArrayList(this.knapsackSelection);\n\n int allele1 = Configuration.RANDOM_GENERATOR.nextInt(newSelection.size());\n int allele2 = Configuration.RANDOM_GENERATOR.nextInt(newSelection.size());\n\n int leftAllele = Math.min(allele1, allele2);\n int rightAllele = Math.max(allele1, allele2);\n\n var selectionSublist = new ArrayList<Boolean>(newSelection.subList(leftAllele, rightAllele));\n for(int j = leftAllele; j < rightAllele + 1; j++){\n newSelection.remove(leftAllele);\n }\n\n int index = Configuration.RANDOM_GENERATOR.nextInt(newSelection.size()+1);\n newSelection.addAll(index, selectionSublist);\n\n Chromosome mutatedKnapsack = new Chromosome(newSelection).withFitnessCalculated();\n if(mutatedKnapsack.isValid())\n return mutatedKnapsack;\n }\n return this;\n }", "@Override\n\t public Node apply(Node gen) {\n\t\t gen = gen.clone(null);\n\t\t int n = gen.weight();\n\t\t int m = (int)(Math.random()*n);\n\t\t Node mutate_node = gen.get(m);\n\t\t int x = (int)(Math.random()*codes.length);\n\t\t mutate_node.oper = codes[x];\n\t\t return gen;\n\t }", "protected void mutateWeights() {\n\t\t// TODO: Change the way weight mutation works\n\t\tif (Braincraft.gatherStats) {\n\t\t\tArrayList<Integer> mutatedgenes = new ArrayList<Integer>();\n\t\t\tfor (Gene g : genes.values()) {\n\t\t\t\tif (Braincraft.randomChance(population.perWeightMutationRate)) {\n\t\t\t\t\tg.weight = Braincraft.randomWeight();\n\t\t\t\t\tmutatedgenes.add(g.innovation);\n\t\t\t\t}\n\t\t\t}\n\t\t\tString output = \"weight mutation \" + ID;\n\t\t\tfor (Integer i : mutatedgenes) {\n\t\t\t\toutput += \" \" + i;\n\t\t\t}\n\t\t\tBraincraft.genetics.add(output);\n\t\t} else {\n\t\t\tfor (Gene g : genes.values()) {\n\t\t\t\tif (Braincraft.randomChance(population.perWeightMutationRate))\n\t\t\t\t\tg.weight = Braincraft.randomWeight();\n\t\t\t}\n\t\t}\n\t\t// TODO: Report weight mutations to stats\n\t}", "public interface IMutationOperator extends IDescriptable, Opcodes {\n\t/**\n\t * Gets all possible points in given class (bytecode) where different\n\t * mutants can be produced.\n\t *\n\t * @param bytecode bytecode to be analyzed\n\t * @return list of mutation points witihn given class (bytecode)\n\t */\n\tList<IMutationPoint> getMutationPoints(byte[] bytecode);\n\n\t/**\n\t * Mutate given bytecode to create mutants with given mutation points.\n\t *\n\t * @param bytecode bytecode to be mutated\n\t * @param mutationPoint mutation point in given class (bytecode)\n\t * @return list of mutants created within given point\n\t */\n\tList<IMutantBytecode> mutate(byte[] bytecode, IMutationPoint mutationPoint);\n\n\t/**\n\t * @param bytecode bytecode to be mutated\n\t * @param mutationPointIndex mutation point in given class (bytecode)\n\t * @param mutantIndex specific mutant index within given point\n\t * @return mutated bytecode - mutant\n\t */\n\tIMutantBytecode mutate(byte[] bytecode, int mutationPointIndex, int mutantIndex);\n}", "private void introduceMutations() {\n }", "private void uniformMutation(){\n Random random = new Random();\n double newValue = random.nextGaussian()*16.6 + 50.0;\n if(newValue < 0) newValue = 0;\n if(newValue > 100) newValue = 100;\n int gene = random.nextInt(6);\n switch (gene){\n case 0 : this.x1 = newValue; break;\n case 1 : this.x2 = newValue; break;\n case 2 : this.x3 = newValue; break;\n case 3 : this.y1 = newValue; break;\n case 4 : this.y2 = newValue; break;\n case 5 : this.y3 = newValue; break;\n }\n }", "public NAryTree apply(NAryTree tree, Random rng) {\n\t\tif (rng.nextDouble() > chanceOfRandomMutation) {\n\t\t\t//DO A SMART MUTATION\n\t\t\tNAryTree mutatedTree;\n\t\t\tboolean changed = false;\n\t\t\tint nrTries = 0;\n\t\t\tTreeMutationAbstract mutator;\n\t\t\tdo {\n\t\t\t\tmutator = getSmartMutatorForChance(rng.nextDouble() * totalChanceSmart);\n\n\t\t\t\tmutatedTree = mutator.mutate(tree);\n\n\t\t\t\tchanged = mutator.changedAtLastCall();\n\t\t\t\tnrTries++;\n\n\t\t\t\tthis.locationOfLastChange = mutator.locationOfLastChange;\n\t\t\t\tthis.typeOfChange = mutator.typeOfChange;\n\n\t\t\t\t//FIXME problem with the smart mutator, it always says that the individual changed, even when it didn't.\n\t\t\t\tif (nrTries > 2 && changed == false) {\n\t\t\t\t\t//Going dumb... We tried to be smart long enough\n\t\t\t\t\treturn applyDumb(tree, rng);\n\t\t\t\t}\n\t\t\t} while (!changed);\n\n\t\t\tassert mutatedTree.isConsistent();\n\t\t\treturn mutatedTree;\n\t\t} else {\n\t\t\t//DELEGATE TO DUMB COORDINATOR\n\t\t\treturn applyDumb(tree, rng);\n\t\t}\n\t}", "public Chromosome doInversionMutation(){\n for(int i = 0; i < PopulationConfiguration.MUTATION_ATTEMPTS; i++){\n ArrayList<Boolean> newSelection = copyBoolArrayList(this.knapsackSelection);\n\n int allele1 = Configuration.RANDOM_GENERATOR.nextInt(newSelection.size());\n int allele2 = Configuration.RANDOM_GENERATOR.nextInt(newSelection.size());\n Collections.reverse(newSelection.subList(Math.min(allele1, allele2), Math.max(allele1, allele2)));\n\n Chromosome mutatedKnapsack = new Chromosome(newSelection).withFitnessCalculated();\n if(mutatedKnapsack.isValid())\n return mutatedKnapsack;\n }\n return this;\n }", "protected void mutateAddNode() {\n\t\t// Test if genome is fully disabled\n\t\tboolean fullydisabled = true;\n\t\tfor (Gene g : genes.values()) {\n\t\t\tif (g.enabled) {\n\t\t\t\tfullydisabled = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (fullydisabled)\n\t\t\treturn;\n\n\t\t// Select the gene to be split\n\t\tGene mutated;\n\t\tdo {\n\t\t\tmutated = getRandomGene();\n\t\t} while (!mutated.enabled);\n\n\t\t// Create the new structure\n\t\tNNode addition = new NNode(population.getNewNodeID(), NNode.HIDDEN);\n\t\tpopulation.registerNode(addition);\n\n\t\tint earlystart = mutated.start;\n\t\tint earlyend = addition.ID;\n\t\tint earlyinnov = population.getInnovation(earlystart, earlyend);\n\t\tGene early = new Gene(earlyinnov, earlystart, earlyend, 1, true);\n\t\tpopulation.registerGene(early);\n\n\t\tint latestart = addition.ID;\n\t\tint lateend = mutated.end;\n\t\tint lateinnov = population.getInnovation(latestart, lateend);\n\t\tGene late = new Gene(lateinnov, latestart, lateend, mutated.weight,\n\t\t\t\ttrue);\n\t\tpopulation.registerGene(late);\n\n\t\t// Disable old gene\n\t\tmutated.enabled = false;\n\n\t\t// Submit new node\n\t\tsubmitNewNode(addition);\n\n\t\t// Submit new genes\n\t\tsubmitNewGene(early);\n\t\tsubmitNewGene(late);\n\n\t\tif (Braincraft.gatherStats)\n\t\t\tBraincraft.genetics.add(\"node mutation \" + ID + \" \"\n\t\t\t\t\t+ mutated.innovation + \" \" + early.innovation + \" \"\n\t\t\t\t\t+ late.innovation + \" \" + addition.ID);\n\t}", "public void mutate(float mutationProbability, float connectionMutationProbability, float mutationFactor) {\r\n for (int i = 1; i < neurons.length; i++) // layers (skip input layer)\r\n {\r\n for (int j = 0; j < neurons[i].length; j++) // neurons per layer\r\n {\r\n if (Math.random() <= mutationProbability) {\r\n neurons[i][j].setWeights(neurons[i][j].getMutatedWeights(connectionMutationProbability, mutationFactor));\r\n }\r\n }\r\n }\r\n }", "public Chromosome doBitFlipMutation(){\n for(int i = 0; i < PopulationConfiguration.MUTATION_ATTEMPTS; i++){\n ArrayList<Boolean> newSelection = copyBoolArrayList(this.knapsackSelection);\n int itemToMutate = Configuration.RANDOM_GENERATOR.nextInt(newSelection.size());\n newSelection.set(itemToMutate, !newSelection.get(itemToMutate));\n\n Chromosome mutatedKnapsack = new Chromosome(newSelection).withFitnessCalculated();\n if(mutatedKnapsack.isValid())\n return mutatedKnapsack;\n }\n return this;\n }", "public void genMutants(ModifierList mod) {\r\n\t\tif (mod.contains(ModifierList.PRIVATE)) {\r\n\t\t\tchangeModifier(mod, ModifierList.PRIVATE, -1);\r\n\t\t\tchangeModifier(mod, ModifierList.PRIVATE, ModifierList.PROTECTED);\r\n\t\t\tchangeModifier(mod, ModifierList.PRIVATE, ModifierList.PUBLIC);\r\n\r\n\t\t} else if (mod.contains(ModifierList.PROTECTED)) {\r\n\t\t\tchangeModifier(mod, ModifierList.PROTECTED, -1);\r\n\t\t\tchangeModifier(mod, ModifierList.PROTECTED, ModifierList.PRIVATE);\r\n\t\t\tchangeModifier(mod, ModifierList.PROTECTED, ModifierList.PUBLIC);\r\n\t\t} else if (mod.contains(ModifierList.PUBLIC)) {\r\n\t\t\tchangeModifier(mod, ModifierList.PUBLIC, -1);\r\n\t\t\tchangeModifier(mod, ModifierList.PUBLIC, ModifierList.PRIVATE);\r\n\t\t\tchangeModifier(mod, ModifierList.PUBLIC, ModifierList.PROTECTED);\r\n\t\t} else { // Friendly\r\n\t\t\tchangeModifier(mod, -1, ModifierList.PRIVATE);\r\n\t\t\tchangeModifier(mod, -1, ModifierList.PROTECTED);\r\n\t\t\tchangeModifier(mod, -1, ModifierList.PUBLIC);\r\n\t\t}\r\n\t}", "void genClassMutants2(ClassDeclarationList cdecls) {\n\tfor (int j = 0; j < cdecls.size(); ++j) {\n\t ClassDeclaration cdecl = cdecls.get(j);\n\t if (cdecl.getName().equals(MutationSystem.CLASS_NAME)) {\n\t\tDeclAnalyzer mutant_op;\n\n\t\tif (hasOperator(classOp, \"IHD\")) {\n\t\t Debug.println(\" Applying IHD ... ... \");\n\t\t mutant_op = new IHD(file_env, null, cdecl);\n\t\t generateMutant(mutant_op);\n\n\t\t if (((IHD) mutant_op).getTotal() > 0)\n\t\t\texistIHD = true;\n\t\t}\n\n\t\tif (hasOperator(classOp, \"IHI\")) {\n\t\t Debug.println(\" Applying IHI ... ... \");\n\t\t mutant_op = new IHI(file_env, null, cdecl);\n\t\t generateMutant(mutant_op);\n\t\t}\n\n\t\tif (hasOperator(classOp, \"IOD\")) {\n\t\t Debug.println(\" Applying IOD ... ... \");\n\t\t mutant_op = new IOD(file_env, null, cdecl);\n\t\t generateMutant(mutant_op);\n\t\t}\n\n\t\tif (hasOperator(classOp, \"OMR\")) {\n\t\t Debug.println(\" Applying OMR ... ... \");\n\t\t mutant_op = new OMR(file_env, null, cdecl);\n\t\t generateMutant(mutant_op);\n\t\t}\n\n\t\tif (hasOperator(classOp, \"OMD\")) {\n\t\t Debug.println(\" Applying OMD ... ... \");\n\t\t mutant_op = new OMD(file_env, null, cdecl);\n\t\t generateMutant(mutant_op);\n\t\t}\n\n\t\tif (hasOperator(classOp, \"JDC\")) {\n\t\t Debug.println(\" Applying JDC ... ... \");\n\t\t mutant_op = new JDC(file_env, null, cdecl);\n\t\t generateMutant(mutant_op);\n\t\t}\n\t }\n\t}\n }", "public interface Mutator {\n\n /**\n * Applies this mutation to the given graph.\n *\n * @param graph The graph to be mutated\n * @throws IllegalArgumentException If the given graph is null\n */\n void apply(GraphOfPixels graph) throws IllegalArgumentException;\n\n /**\n * Represents a filter applied to sharpen a pixel.\n */\n class SharpenFilter extends AbstractFilter {\n\n private static final Matrix kernel =\n new MatrixImpl(new ArrayList<Double>(Arrays.asList(\n -0.125, -0.125, -0.125, -0.125, -0.125,\n -0.125, 0.25, 0.25, 0.25, -0.125,\n -0.125, 0.25, 1.0, 0.25, -0.125,\n -0.125, 0.25, 0.25, 0.25, -0.125,\n -0.125, -0.125, -0.125, -0.125, -0.125)),\n 5, 5);\n\n\n @Override\n protected PixelAsColors applyToPixel(Node n) throws IllegalArgumentException {\n if (n == null) {\n throw new IllegalArgumentException(\"Given node is null.\");\n }\n\n double newRed = 0.0;\n double newGreen = 0.0;\n double newBlue = 0.0;\n\n for (int i = -2; i <= 2; i += 1) {\n for (int j = 2; j >= -2; j -= 1) {\n double kernelValue = kernel.getValue(i + 2, Math.abs(j - 2));\n newRed += kernelValue * n.getNearby(i, j).getRed();\n newGreen += kernelValue * n.getNearby(i, j).getGreen();\n newBlue += kernelValue * n.getNearby(i, j).getBlue();\n }\n }\n\n return new SimplePixel(Utils.roundDouble(newRed), Utils.roundDouble(newGreen),\n Utils.roundDouble(newBlue));\n }\n }\n\n /**\n * Represents a filter which can be applied to a graph of pixels to alter an image.\n */\n interface Filter extends Mutator {\n\n }\n\n /**\n * Represents a filter applied to blur a pixel.\n */\n class BlurFilter extends AbstractFilter {\n\n private static final Matrix kernel =\n new MatrixImpl(new ArrayList<Double>(Arrays.asList(\n 0.0625, 0.125, 0.0625,\n 0.125, 0.25, 0.125,\n 0.0625, 0.125, 0.0625)),\n 3, 3);\n\n\n @Override\n protected PixelAsColors applyToPixel(Node n) throws IllegalArgumentException {\n if (n == null) {\n throw new IllegalArgumentException(\"Given node is null.\");\n }\n\n double newRed = 0.0;\n double newGreen = 0.0;\n double newBlue = 0.0;\n\n for (int i = -1; i <= 1; i += 1) {\n for (int j = 1; j >= -1; j -= 1) {\n double kernelValue = kernel.getValue(i + 1, Math.abs(j - 1));\n newRed += kernelValue * n.getNearby(i, j).getRed();\n newGreen += kernelValue * n.getNearby(i, j).getGreen();\n newBlue += kernelValue * n.getNearby(i, j).getBlue();\n }\n }\n\n return new SimplePixel(Utils.roundDouble(newRed), Utils.roundDouble(newGreen),\n Utils.roundDouble(newBlue));\n }\n }\n\n /**\n * Represents an abstraction of a image filter.\n */\n abstract class AbstractFilter implements Filter {\n\n /**\n * Applies this filter to the given pixel.\n *\n * @param n represents a node in the graph for an image in a pixel\n * @return PixelAsColors representing new color of pixel\n * @throws IllegalArgumentException if node given is null\n */\n protected abstract PixelAsColors applyToPixel(Node n) throws IllegalArgumentException;\n\n @Override\n public void apply(GraphOfPixels graph) throws IllegalArgumentException {\n if (graph == null) {\n throw new IllegalArgumentException(\"Null graph given.\");\n }\n\n ArrayList<PixelAsColors> updatedColors = new ArrayList<PixelAsColors>();\n\n for (Node n : graph) {\n updatedColors.add(this.applyToPixel(n));\n }\n\n int counter = 0;\n for (Node n : graph) {\n n.updateColors(updatedColors.get(counter));\n counter += 1;\n }\n }\n }\n\n /**\n * Represents a color transformation to Sepia tone.\n */\n class SepiaTransform extends AbstractColorTransformation {\n\n private static final Matrix baseMatrix =\n new MatrixImpl(new ArrayList<Double>(Arrays.asList(\n 0.393, 0.769, 0.189,\n 0.349, 0.686, 0.168,\n 0.272, 0.534, 0.131)),\n 3, 3);\n\n @Override\n protected Matrix generateNewColorMatrix(Matrix rgb) throws IllegalArgumentException {\n return baseMatrix.matrixMultiply(rgb);\n }\n\n }\n\n /**\n * Represents a color transformation to Greyscale.\n */\n class GreyscaleTransform extends AbstractColorTransformation {\n\n private static final Matrix baseMatrix =\n new MatrixImpl(new ArrayList<Double>(Arrays.asList(\n 0.2126, 0.7152, 0.0722,\n 0.2126, 0.7152, 0.0722,\n 0.2126, 0.7152, 0.0722)),\n 3, 3);\n\n @Override\n protected Matrix generateNewColorMatrix(Matrix rgb) throws IllegalArgumentException {\n return baseMatrix.matrixMultiply(rgb);\n }\n }\n\n /**\n * Represents an abstraction of possible color transformations.\n */\n abstract class AbstractColorTransformation implements ColorTransformation {\n\n /**\n * Gets a new Matrix representing the new transformed colors of a pixel.\n *\n * @param rgb represents the original colors of the pixel\n * @return the transformed colors of the pixel\n * @throws IllegalArgumentException if rgb is null.\n */\n protected abstract Matrix generateNewColorMatrix(Matrix rgb) throws IllegalArgumentException;\n\n /**\n * Applies this color transformation to the given pixel.\n *\n * @param n represents a node in the graph for an image in a pixel\n */\n protected void applyToPixel(Node n) throws IllegalArgumentException {\n if (n == null) {\n throw new IllegalArgumentException(\"Null node given.\");\n }\n ArrayList<Double> nodeRGB = new ArrayList<Double>(\n Arrays.asList(n.getRed() + 0.0, n.getGreen() + 0.0, n.getBlue() + 0.0));\n Matrix ogRGB = new MatrixImpl(nodeRGB, 1, 3);\n\n Matrix newRGB = this.generateNewColorMatrix(ogRGB);\n\n n.updateColors(new SimplePixel(\n Utils.roundDouble(newRGB.getValue(0, 0)),\n Utils.roundDouble(newRGB.getValue(0, 1)),\n Utils.roundDouble(newRGB.getValue(0, 2))));\n }\n\n @Override\n public void apply(GraphOfPixels graph) throws IllegalArgumentException {\n if (graph == null) {\n throw new IllegalArgumentException(\"Null graph given.\");\n }\n\n for (Node n : graph) {\n this.applyToPixel(n);\n }\n }\n }\n\n /**\n * Represents a color transformation to mutate an image.\n */\n interface ColorTransformation extends Mutator {\n\n }\n}", "public void mutation(){\n \n \tfor (int[] temp : wallpapers) {\n \t\tint e = random.nextInt(20);\n \t\tfor (int y = 0; y < e; y++){\n \t\t\tint h = random.nextInt(temp.length);\n \t\t\t//Log.d(\"MUT\", \"selected index \" + h);\n \t\t\tif (h == temp.length - 1 || h == temp.length - 2 || h == temp.length - 3){\n \t\t\t\tint newrgb = random.nextInt(NODELENGTH) + 2;\n \t\t\t\t//Log.d(\"MUT\", \"Picking new node \" + newrgb);\n \t\t\t\ttemp[h] = newrgb;\n \t\t\t} else if (((h + 1) % 3) == 0){\n \t\t\t\tint newfunction = random.nextInt(NUM_FUNCTIONS);\n \t\t\t\t//Log.d(\"MUT\", \"Picking new function \" + newfunction);\n \t\t\t\ttemp[h] = newfunction;\n \t\t\t} else {\n \t\t\t\tint newinput = random.nextInt(h / 3 +1);\n \t\t\t\ttemp[h] = newinput;\n \t\t\t\t//Log.d(\"MUT\", \"Picking new input \" + newinput);\n \t\t\t}\n \t\t}\n \t}\n }", "void genMutants() {\n\tif (comp_unit == null) {\n\t System.err.println(original_file + \" is skipped.\");\n\t}\n\tClassDeclarationList cdecls = comp_unit.getClassDeclarations();\n\n\tif (cdecls == null || cdecls.size() == 0)\n\t return;\n\n\tif (classOp != null && classOp.length > 0) {\n\t Debug.println(\"* Generating class mutants\");\n\t MutationSystem.clearPreviousClassMutants();\n\t MutationSystem.MUTANT_PATH = MutationSystem.CLASS_MUTANT_PATH;\n\t CodeChangeLog.openLogFile();\n\t genClassMutants(cdecls);\n\t CodeChangeLog.closeLogFile();\n\t}\n }", "public static void setMutationProbability(double value) { mutationProbability = value; }", "@SuppressWarnings({ \"unchecked\", \"deprecation\" })\n\tprivate static NeuralNetwork mutate(NeuralNetwork newnn, Singleton s1) throws NoSuchMethodException, SecurityException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {\n\t\tEvolveSingleton s = (EvolveSingleton) s1;\n\t\tNeuralNetManager.Neuraltracker(newnn);\n\t\t//determines type of mutation\n\t\tdouble selector = Math.random();\n\t\t//creates an arraylist of all genes\n\t\tArrayList<Gene> genes = new ArrayList<Gene>();\n\t\tfor (Layer l : newnn.getLayers()){\n\t\t\t\tfor (Neuron n : l.getNeurons()){\t\t\t\t\t\t\n\t\t\t\t\tfor (Gene g : n.getGenes())genes.add(g);\t\t\t\t\t\n\t\t\t\t}\n\t\t}\n\t\t// gene mutation\n\t\tif (selector < s.getDisableProbability()&& genes.size() > 0){\t\t\t\t\n\t\t\tGene gene= genes.get(0);\n\t\t\tif(genes.size() > 1) gene= genes.get(rand.nextInt(genes.size()-1));\n\t\t\tif(selector < s.getAdjustProbability()) {\n\t\t\t\t//adjust weight\n\t\t\t\tgene.setWeight(gene.getWeight()*(1+(Math.random()*.1)));\n\t\t\t}\n\t\t\telse if (selector < s.getRandomProbability()){\n\t\t\t\t// new random weight\n\t\t\t\tgene.setWeight(Math.random()*2 - 1);\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//disable/enable gene\n\t\t\t\tgene.toggle();\t\n\t\t\t}\n\t\t\n\t\t}\n\t\telse if (selector < s.getNewGeneProbability() || genes.size() == 0){\n\t\t\t// new gene\n\t\t\tint layer = 0;\n\t\t\tif (newnn.getLayers().size() > 2) layer = rand.nextInt(newnn.getLayers().size()-2);\n\t\t\tint neuron = 0;\n\t\t\tif (newnn.getLayers().get(layer).getNeurons().size() > 1){\n\t\t\t\t\tneuron = rand.nextInt(newnn.getLayers().get(layer).getNeurons().size()-1);\n\t\t\t}\n\t\t\tint layer2 = newnn.getLayers().size()-1;\n\t\t\tif (newnn.getLayers().size()-2-layer > 0) layer2 = layer + 1 + rand.nextInt(newnn.getLayers().size()-2-layer);\n\t\t\tint neuron2 = 0;\n\t\t\tif (newnn.getLayers().get(layer2).getNeurons().size() > 1){\n\t\t\t\t\tneuron2 = rand.nextInt(newnn.getLayers().get(layer2).getNeurons().size()-1);\n\t\t\t}\n \t\t\tdouble weight = Math.random()*2 - 1;\n \t\t\tNeuron in = newnn.getLayers().get(layer).getNeurons().get(neuron);\n \t\t\tGene g = new Gene(newnn.getLayers().get(layer2).getNeurons().get(neuron2), weight);\n \t\t\tnewnn.getLayers().get(layer2).getNeurons().get(neuron2).addInput(g);\n \t\t\tfor(int i = 0; i < in.getGenes().size();i++){\n \t \t\t\tif (newnn.getLayers().get(layer).getNeurons().get(neuron).getGenes().get(i).getConnection().getLayernumber() == layer2 &&newnn.getLayers().get(layer).getNeurons().get(neuron).getGenes().get(i).getConnection().getNumber() == neuron2){\n \t \t\t\t\tin.RemoveGenes(in.getGenes().get(i));\n \t \t\t\t\ti--;\n \t \t\t\t}\n \t \t\t}\n \t\t\tin.AddGenes(g);\n\t\t}\n\t\telse{\n\t\t\tClass<? extends Layer> layerClass = (Class<? extends Layer>) Class.forName(\"BackEvolution.\"+s.getType()+\".\"+s.getType()+\"Layer\");\n\t\t\tClass<? extends Neuron> neuronClass = (Class<? extends Neuron>) Class.forName(\"BackEvolution.\"+s.getType()+\".\"+s.getType()+\"Neuron\");\n\t\t\tif (newnn.getLayers().size() == 2 || selector > s.getExistingLayerProbability()){\n\t\t\t\t//new neuron in new layer\n\t\t\t\tClass<?>[] types = {boolean.class,boolean.class};\n\t\t\t\tConstructor<? extends Layer> con = layerClass.getConstructor(types);\n\t\t\t\tLayer l = con.newInstance(false,false);\n\n\t\t\t\tnewnn.addLayer(l);\n\t\t\t\tl.setNumber(newnn.getLayers().size()-1);\n\t\t\t\tNeuron n = neuronClass.newInstance();\n\t\t\t\tl.addNeuron(n);\n\t\t\t\tn.setNumber(1);\n\t\t\t\tn.setLayernumber(newnn.getLayers().size()-1);\n\t\t\t\tLayer outputlayer = newnn.getLayers().get(newnn.getLayers().size()-1);\n\t\t\t\toutputlayer.setNumber(newnn.getLayers().size());\n\n\t\t\t\t\n\t\t\t\tArrayList<Gene> genes2 = new ArrayList<Gene>();\n\t\t\t\tfor (Gene g : genes){\n\t\t\t\t\tif (newnn.getLayers().get(g.getConnection().getLayernumber()-1).isOutput()) genes2.add(g);\n\t\t\t\t}\n\t\t\t\tif (genes2.size() > 0){\n\t\t\t\t\tGene gene= genes2.get((int) ((genes2.size()-1)*Math.random()));\n\t\t\t\t\tNeuron out = gene.getConnection();\n\t\t\t\t\tgene.setConnection(n);\n\t\t\t\t\tn.AddGenes(new Gene(out, Math.random()*2 -1));\n\t\t\t\t\tgene.setInput(n);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tArrayList<Neuron> ns = new ArrayList<Neuron>();\n\t\t\t\t\tfor (Gene g : genes){\n\t\t\t\t\t\tns.add(g.getConnection());\n\t\t\t\t\t}\n\t\t\t\t\tGene gene = new Gene(n, Math.random()*2-1);\n\t\t\t\t\tn.addInput(gene);\n\t\t\t\t\tGene gene2 = new Gene(outputlayer.getNeurons().get(0), Math.random()*2-1);\n\t\t\t\t\tif(outputlayer.getNeurons().size()-1 > 0) gene2 = new Gene(outputlayer.getNeurons().get(rand.nextInt(outputlayer.getNeurons().size()-1)), Math.random()*2-1);\n\t\t\t\t\ttry{\n\t\t\t\t\t\tNeuron in = ns.get(rand.nextInt(ns.size()-1));\n\t\t\t\t\t\tin.AddGenes(gene);\n\t\t\t\t\t\tgene.setInput(in);\n\t\t\t\t\t\tgene.getConnection().addInput(gene);\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\tns.get(0).AddGenes(gene);\n\t\t\t\t\t\tgene.setInput(ns.get(0));\n\t\t\t\t\t\tgene.getConnection().addInput(gene);\n\t\t\t\t\t}\n\t\t\t\t\tn.AddGenes(gene2);\n\t\t\t\t\tgene2.setInput(n);\n\t\t\t\t\tgene2.getConnection().addInput(gene2);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\telse{\n\t\t\t\t//new node in existing layer\n\t\t\t\tArrayList<Layer> layers = new ArrayList<Layer>();\n\t\t\t\tfor (Layer l : newnn.getLayers()){\n\t\t\t\t\tif (!l.isInput()&&!l.isOutput()){\n\t\t\t\t\t\tlayers.add(l);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tLayer selected = null;\n\t\t\t\ttry{\n\t\t\t\t\tselected = layers.get(rand.nextInt(layers.size()-1));\n\t\t\t\t}\n\t\t\t\tcatch(Exception e){\n\t\t\t\t\tselected = layers.get(0);\n\t\t\t\t}\n\t\t\t\tArrayList<Gene> genes2 = new ArrayList<Gene>();\n\t\t\t\tfor (int i = 0 ; i < selected.getNumber()-1; i++){\n\t\t\t\t\tLayer l = newnn.getLayers().get(i);\t\n\t\t\t\t\tfor (Neuron n : l.getNeurons()){\n\t\t\t\t\t\tfor(Gene g : n.getGenes()){\n\t\t\t\t\t\t\tif (g.getConnection().getLayernumber() > selected.getNumber() && n.getLayernumber() < selected.getNumber())genes2.add(g);\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\ttry{\n\t\t\t\t\tGene gene = null;\n\t\t\t\t\ttry{\n\t\t\t\t\t\tgene = genes2.get(rand.nextInt(genes2.size()-1));\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\tgene = genes2.get(0);\n\t\t\t\t\t}\n\t\t\t\t\tNeuron n = neuronClass.newInstance();\n\t\t\t\t\t\n\t\t\t\t\tn.setLayernumber(selected.getNumber());\t\t\t\t\n\t\t\t\t\tselected.addNeuron(n);\n\t\t\t\t\tn.setNumber(selected.getNeurons().size());\n\t\t\t\t\tNeuron out = gene.getConnection();\n\t\t\t\t\tgene.setConnection(n);\n\t\t\t\t\tGene gene2 = new Gene(out, Math.random()*2-1);\n\t\t\t\t\tn.AddGenes(gene2);\n\t\t\t\t\tgene2.setInput(n);\n\t\t\t\t}\n\t\t\t\tcatch(Exception e){\n\t\t\t\t\tArrayList<Neuron> ns = newnn.getLayers().get(0).getNeurons();\n\t\t\t\t\tNeuron in = null;\n\t\t\t\t\ttry{\n\t\t\t\t\t\tin = ns.get(rand.nextInt(ns.size()-1));\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception f){\n\t\t\t\t\t\tin = ns.get(0);\n\t\t\t\t\t}\n\t\t\t\t\tArrayList<Neuron> ns2 = ((Layer) newnn.getLayers().get(newnn.getLayers().size()-1)).getNeurons();\n\t\t\t\t\tNeuron on = null;\n\t\t\t\t\ttry{\n\t\t\t\t\t\ton = ns2.get(rand.nextInt(ns2.size()-1));\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception f){\n\t\t\t\t\t\ton = ns2.get(0);\n\t\t\t\t\t}\n\t\t\t\t\tNeuron n = neuronClass.newInstance();\n\t\t\t\t\tGene gene1 = new Gene(n, Math.random()*2-1);\n\t\t\t\t\tin.AddGenes(gene1);\n\t\t\t\t\tgene1.setInput(in);\n\t\t\t\t\tGene gene2 =new Gene(on,Math.random()*2-1);\n\t\t\t\t\tgene2.setInput(n);\n\t\t\t\t\tn.AddGenes(gene2);\n\t\t\t\t\tselected.addNeuron(n);\n\t\t\t\t\tn.setNumber(selected.getNeurons().size());\n\t\t\t\t\tn.setLayernumber(selected.getNumber());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn newnn;\n\t}", "public static int createnumOfMutationss(){\n\t\tint totalMut = 0;\n\t\t\n\t\tint[] gen0 = new int[(int) Math.pow(2,0)]; //size of numOfMutations is based on exponential growth by generation number\n\t\t\tmutate(gen0); //function to mutate\n\t\t\ttotalMut = totalMut + totalMutations(gen0);\n\t\tint[] gen1 = new int[(int) Math.pow(2,1)];\n\t\t\tcheckMutations(gen0, gen1); //checks for previous generation mutations\n\t\t\tmutate(gen1);\n\t\t\ttotalMut = totalMut + totalMutations(gen1);\n\t\tint[] gen2 = new int[(int) Math.pow(2,2)];\n\t\t\tcheckMutations(gen1, gen2);\n\t\t\tmutate(gen2);\n\t\t\ttotalMut = totalMut + totalMutations(gen2);\n\t\tint[] gen3 = new int[(int) Math.pow(2,3)];\n\t\t\tcheckMutations(gen2, gen3);\n\t\t\tmutate(gen3);\n\t\t\ttotalMut = totalMut + totalMutations(gen3);\n\t\tint[] gen4 = new int[(int) Math.pow(2,4)];\n\t\t\tcheckMutations(gen3, gen4);\n\t\t\tmutate(gen4);\n\t\t\ttotalMut = totalMut + totalMutations(gen4);\n\t\tint[] gen5 = new int[(int) Math.pow(2,5)];\n\t\t\tcheckMutations(gen4, gen5);\n\t\t\tmutate(gen5);\n\t\t\ttotalMut = totalMut + totalMutations(gen5);\n\t\tint[] gen6 = new int[(int) Math.pow(2,6)];\n\t\t\tcheckMutations(gen5, gen6);\n\t\t\tmutate(gen6);\n\t\t\ttotalMut = totalMut + totalMutations(gen6);\n\t\tint[] gen7 = new int[(int) Math.pow(2,7)];\n\t\t\tcheckMutations(gen6, gen7);\n\t\t\tmutate(gen7);\n\t\t\ttotalMut = totalMut + totalMutations(gen7);\n\t\tint[] gen8 = new int[(int) Math.pow(2,8)];\n\t\t\tcheckMutations(gen7, gen8);\n\t\t\tmutate(gen8);\n\t\t\ttotalMut = totalMut + totalMutations(gen8);\n\t\tint[] gen9 = new int[(int) Math.pow(2,9)];\n\t\t\tcheckMutations(gen8, gen9);\n\t\t\tmutate(gen9);\n\t\t\ttotalMut = totalMut + totalMutations(gen9);\n\t\tint[] gen10 = new int[(int) Math.pow(2,10)];\n\t\t\tcheckMutations(gen9, gen10);\n\t\t\tmutate(gen10);\n\t\t\ttotalMut = totalMut + totalMutations(gen10);\n\t\t\t\n\t\t\treturn totalMut;\n\t\n\t}", "private static void mating() {\n\t\tint getRand = 0;\n\t\tint parentA = 0;\n\t\tint parentB = 0;\n\t\tint newIndex1 = 0;\n\t\tint newIndex2 = 0;\n\t\tChromosome newChromo1 = null;\n\t\tChromosome newChromo2 = null;\n\n\t\tfor (int i = 0; i < OFFSPRING_PER_GENERATION; i++) {\n\t\t\tparentA = chooseParent();\n\t\t\t// Test probability of mating.\n\t\t\tgetRand = getRandomNumber(0, 100);\n\t\t\tif (getRand <= MATING_PROBABILITY * 100) {\n\t\t\t\tparentB = chooseParent(parentA);\n\t\t\t\tnewChromo1 = new Chromosome();\n\t\t\t\tnewChromo2 = new Chromosome();\n\t\t\t\tpopulation.add(newChromo1);\n\t\t\t\tnewIndex1 = population.indexOf(newChromo1);\n\t\t\t\tpopulation.add(newChromo2);\n\t\t\t\tnewIndex2 = population.indexOf(newChromo2);\n\n\t\t\t\t// Choose either, or both of these:\n\t\t\t\tpartiallyMappedCrossover(parentA, parentB, newIndex1, newIndex2);\n\t\t\t\t// positionBasedCrossover(parentA, parentB, newIndex1, newIndex2);\n\n\t\t\t\tif (childCount - 1 == nextMutation) {\n\t\t\t\t\texchangeMutation(newIndex1, 1);\n\t\t\t\t} else if (childCount == nextMutation) {\n\t\t\t\t\texchangeMutation(newIndex2, 1);\n\t\t\t\t}\n\n\t\t\t\tpopulation.get(newIndex1).computeConflicts();\n\t\t\t\tpopulation.get(newIndex2).computeConflicts();\n\n\t\t\t\tchildCount += 2;\n\n\t\t\t\t// Schedule next mutation.\n\t\t\t\tif (childCount % (int) Math.round(1.0 / MUTATION_RATE) == 0) {\n\t\t\t\t\tnextMutation = childCount + getRandomNumber(0, (int) Math.round(1.0 / MUTATION_RATE));\n\t\t\t\t}\n\t\t\t}\n\t\t} // i\n\t\treturn;\n\t}", "public void compileMutants() {\n\tif (classOp != null && classOp.length > 0) {\n\t Debug.println(\"* Compiling class mutants into bytecode\");\n\t MutationSystem.MUTANT_PATH = MutationSystem.CLASS_MUTANT_PATH;\n\t super.compileMutants();\n\t}\n }", "private void generateMutants(BlockStmt blockStmt)\n {\n List<BlockStmt> targets = new ArrayList<>();\n blockStmt.walk(Node.TreeTraversal.BREADTHFIRST, n -> loadTargets(n, targets));\n if (targets.isEmpty())\n return;\n\n // Generate mutants\n for (BlockStmt t : targets)\n {\n generateMutant(blockStmt, t);\n }\n }", "public static void mutation(Individual[] individuals) {\n for (int i = 0; i < POP_SIZE; i++) {\n for (int j = 0; j < GENE_SIZE; j++) {\n double randomNum = Math.random();\n if (randomNum < MUTATION_RATE) {\n randomNum = Math.random();\n ArrayList<String> bitsList = (ArrayList<String>) bits.clone();\n for (int g = 0; g < bitsList.size(); g++) {\n if (individuals[i].gene[j].equals(bitsList.get(g))) {\n String bit = bitsList.get(g);\n bitsList.remove(g);\n int index;\n if (randomNum < 0.5) {\n index = 0;\n } else {\n index = 1;\n }\n individuals[i].gene[j] = bitsList.get(new Random().nextInt(2));\n bitsList.add(bit);\n }\n }\n }\n }\n individuals[i].generateRulebase();\n }\n matingPool = Arrays.copyOf(individuals, individuals.length);\n }", "public static double getMutationProbability() { return mutationProbability; }", "private int[] mutationSingleMove(int[] mutant) {\n\t\tint pairPoint1 = rand.nextInt(mutant.length);\n\t\tint newBin = mutant[pairPoint1];\n\t\twhile (newBin == mutant[pairPoint1]) {\n\t\t\tnewBin = rand.nextInt(binCount);\n\t\t}\n\t\tmutant[pairPoint1] = newBin; //swap to a different bucket\n\t\treturn mutant;\n\t}", "private void storeMutantShared(BlockStmt original, BlockStmt modified)\n {\n if (modified.equals(original))\n return;\n\n // Add Mutant\n addMutant(new ASTMutant(\n this.getOriginal().getCompilationUnit(),\n original,\n modified,\n this.getType()\n ));\n\n }", "MutateNda<V> getMut();", "default MutateNda<V> mut() { return getMut(); }", "public void mutate(NeuralPlayer p)\n\t{\n\t\tdouble[] genome = NetworkCODEC.networkToArray(p.net);\n\t\tRandom g = new Random();\n\t\tfor (int i = 0; i< genome.length; i++)\n\t\t{\n\t\t\tif (g.nextDouble() <= mutationPer)\n\t\t\t\tgenome[i] = randomNum(g) + genome[i];\n\t\t}\n\t\tNetworkCODEC.arrayToNetwork(genome, p.net);\n\t}", "private int[] mutationPairwiseExchange(int[] mutant) {\n\t\tint pairPoint1 = rand.nextInt(mutant.length);\n\t\tint pairPoint2 = pairPoint1;\n\t\twhile (mutant[pairPoint2] == mutant[pairPoint1]) {\n\t\t\tpairPoint2 = rand.nextInt(mutant.length); //find element in different bucket\n\t\t}\n\t\tint temp = mutant[pairPoint1];\n\t\tmutant[pairPoint1] = mutant[pairPoint2];\n\t\tmutant[pairPoint2] = temp;\n\t\treturn mutant;\n\t}", "@Override\n\tpublic void applyMutation(int index, double a_percentage) {\n\n\t}", "void genClassMutants1(ClassDeclarationList cdecls) {\n\n\tfor (int j = 0; j < cdecls.size(); ++j) {\n\t ClassDeclaration cdecl = cdecls.get(j);\n\n\t if (cdecl.getName().equals(MutationSystem.CLASS_NAME)) {\n\t\tString qname = file_env.toQualifiedName(cdecl.getName());\n\t\ttry {\n\t\t mujava.op.util.Mutator mutant_op;\n\n\t\t if (hasOperator(classOp, \"AMC\")) {\n\t\t\tDebug.println(\" Applying AMC ... ... \");\n\t\t\tmutant_op = new AMC(file_env, cdecl, comp_unit);\n\t\t\tcomp_unit.accept(mutant_op);\n\t\t }\n\n\t\t if (hasOperator(classOp, \"IOR\")) {\n\t\t\tDebug.println(\" Applying IOR ... ... \");\n\t\t\ttry {\n\t\t\t Class parent_class = Class.forName(qname).getSuperclass();\n\t\t\t if (!(parent_class.getName().equals(\"java.lang.Object\"))) {\n\t\t\t\tString temp_str = parent_class.getName();\n\t\t\t\tString result_str = \"\";\n\n\t\t\t\tfor (int k = 0; k < temp_str.length(); k++) {\n\t\t\t\t char c = temp_str.charAt(k);\n\t\t\t\t if (c == '.') {\n\t\t\t\t\tresult_str = result_str + \"/\";\n\t\t\t\t } else {\n\t\t\t\t\tresult_str = result_str + c;\n\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\tFile f = new File(MutationSystem.SRC_PATH, result_str + \".java\");\n\t\t\t\tif (f.exists()) {\n\t\t\t\t CompilationUnit[] parent_comp_unit = new CompilationUnit[1];\n\t\t\t\t FileEnvironment[] parent_file_env = new FileEnvironment[1];\n\t\t\t\t this.generateParseTree(f, parent_comp_unit, parent_file_env);\n\t\t\t\t this.initParseTree(parent_comp_unit, parent_file_env);\n\t\t\t\t mutant_op = new IOR(file_env, cdecl, comp_unit);\n\t\t\t\t ((IOR) mutant_op).setParentEnv(parent_file_env[0], parent_comp_unit[0]);\n\t\t\t\t comp_unit.accept(mutant_op);\n\t\t\t\t}\n\t\t\t }\n\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t System.out\n\t\t\t\t .println(\" Exception at generating IOR mutant. file : AllMutantsGenerator.java \");\n\t\t\t} catch (NullPointerException e1) {\n\t\t\t System.out.print(\" IOP ^^; \");\n\t\t\t}\n\t\t }\n\n\t\t if (hasOperator(classOp, \"ISD\")) {\n\t\t\tDebug.println(\" Applying ISD ... ... \");\n\t\t\tmutant_op = new ISD(file_env, cdecl, comp_unit);\n\t\t\tcomp_unit.accept(mutant_op);\n\t\t }\n\n\t\t if (hasOperator(classOp, \"IOP\")) {\n\t\t\tDebug.println(\" Applying IOP ... ... \");\n\t\t\tmutant_op = new IOP(file_env, cdecl, comp_unit);\n\t\t\tcomp_unit.accept(mutant_op);\n\t\t }\n\n\t\t if (hasOperator(classOp, \"IPC\")) {\n\t\t\tDebug.println(\" Applying IPC ... ... \");\n\t\t\tmutant_op = new IPC(file_env, cdecl, comp_unit);\n\t\t\tcomp_unit.accept(mutant_op);\n\t\t }\n\n\t\t if (hasOperator(classOp, \"PNC\")) {\n\t\t\tDebug.println(\" Applying PNC ... ... \");\n\t\t\tmutant_op = new PNC(file_env, cdecl, comp_unit);\n\t\t\tcomp_unit.accept(mutant_op);\n\t\t }\n\n\t\t if (hasOperator(classOp, \"PMD\")) {\n\t\t\tDebug.println(\" Applying PMD ... ... \");\n\t\t\t// if(existIHD){\n\t\t\tmutant_op = new PMD(file_env, cdecl, comp_unit);\n\t\t\tcomp_unit.accept(mutant_op);\n\t\t\t// }\n\t\t }\n\n\t\t if (hasOperator(classOp, \"PPD\")) {\n\t\t\tDebug.println(\" Applying PPD ... ... \");\n\t\t\t// if(existIHD){\n\t\t\tmutant_op = new PPD(file_env, cdecl, comp_unit);\n\t\t\tcomp_unit.accept(mutant_op);\n\t\t\t// }\n\t\t }\n\n\t\t if (hasOperator(classOp, \"PRV\")) {\n\t\t\tDebug.println(\" Applying PRV ... ... \");\n\t\t\tmutant_op = new PRV(file_env, cdecl, comp_unit);\n\t\t\tcomp_unit.accept(mutant_op);\n\t\t }\n\n\t\t if (hasOperator(classOp, \"PCI\")) {\n\t\t\tDebug.println(\" Applying PCI ... ... \");\n\t\t\tmutant_op = new PCI(file_env, cdecl, comp_unit);\n\t\t\tcomp_unit.accept(mutant_op);\n\t\t }\n\n\t\t if (hasOperator(classOp, \"PCC\")) {\n\t\t\tDebug.println(\" Applying PCC ... ... \");\n\t\t\tmutant_op = new PCC(file_env, cdecl, comp_unit);\n\t\t\tcomp_unit.accept(mutant_op);\n\t\t }\n\n\t\t if (hasOperator(classOp, \"PCD\")) {\n\t\t\tDebug.println(\" Applying PCD ... ... \");\n\t\t\tmutant_op = new PCD(file_env, cdecl, comp_unit);\n\t\t\tcomp_unit.accept(mutant_op);\n\t\t }\n\n\t\t if (hasOperator(classOp, \"JSD\")) {\n\t\t\tDebug.println(\" Applying JSC ... ... \");\n\t\t\tmutant_op = new JSD(file_env, cdecl, comp_unit);\n\t\t\tcomp_unit.accept(mutant_op);\n\t\t }\n\n\t\t if (hasOperator(classOp, \"JSI\")) {\n\t\t\tDebug.println(\" Applying JSI ... ... \");\n\t\t\tmutant_op = new JSI(file_env, cdecl, comp_unit);\n\t\t\tcomp_unit.accept(mutant_op);\n\t\t }\n\n\t\t if (hasOperator(classOp, \"JTD\")) {\n\t\t\tDebug.println(\" Applying JTD ... ... \");\n\t\t\tmutant_op = new JTD(file_env, cdecl, comp_unit);\n\t\t\tcomp_unit.accept(mutant_op);\n\t\t }\n\n\t\t if (hasOperator(classOp, \"JTI\")) {\n\t\t\tDebug.println(\" Applying JTI ... ... \");\n\t\t\tmutant_op = new JTI(file_env, cdecl, comp_unit);\n\t\t\tcomp_unit.accept(mutant_op);\n\t\t }\n\n\t\t if (hasOperator(classOp, \"JID\")) {\n\t\t\tDebug.println(\" Applying JID ... ... \");\n\t\t\tmutant_op = new JID(file_env, cdecl, comp_unit);\n\t\t\tcomp_unit.accept(mutant_op);\n\t\t }\n\n\t\t if (hasOperator(classOp, \"OAN\")) {\n\t\t\tDebug.println(\" Applying OAN ... ... \");\n\t\t\tmutant_op = new OAN(file_env, cdecl, comp_unit);\n\t\t\tcomp_unit.accept(mutant_op);\n\t\t }\n\n\t\t if (hasOperator(classOp, \"EOA\")) {\n\t\t\tDebug.println(\" Applying EOA ... ... \");\n\t\t\tmutant_op = new EOA(file_env, cdecl, comp_unit);\n\t\t\tcomp_unit.accept(mutant_op);\n\t\t }\n\n\t\t if (hasOperator(classOp, \"EOC\")) {\n\t\t\tDebug.println(\" Applying EOC ... ... \");\n\t\t\tmutant_op = new EOC(file_env, cdecl, comp_unit);\n\t\t\tcomp_unit.accept(mutant_op);\n\t\t }\n\n\t\t if (hasOperator(classOp, \"EAM\")) {\n\t\t\tDebug.println(\" Applying EAM ... ... \");\n\t\t\tmutant_op = new EAM(file_env, cdecl, comp_unit);\n\t\t\tcomp_unit.accept(mutant_op);\n\t\t }\n\n\t\t if (hasOperator(classOp, \"EMM\")) {\n\t\t\tDebug.println(\" Applying EMM ... ... \");\n\t\t\tmutant_op = new EMM(file_env, cdecl, comp_unit);\n\t\t\tcomp_unit.accept(mutant_op);\n\t\t }\n\n\t\t} catch (ParseTreeException e) {\n\t\t System.err.println(\"Encountered errors during generating mutants.\");\n\t\t e.printStackTrace();\n\t\t}\n\t }\n\t}\n }", "private ASMInstrumenter() {\n insertMutationProbes = SmartSHARKAdapter.getInstance().getMutationsWithLines();\n\n /*\n insertMutationProbes.put(\"de.ugoe.cs.testproject.A.<init>\", new TreeSet<Integer>(){{add(2);}});\n insertMutationProbes.put(\"de.ugoe.cs.testproject.A.method1\", new TreeSet<Integer>(){{add(25); add(29);}});\n insertMutationProbes.put(\"de.ugoe.cs.testproject.A.method2\", new TreeSet<Integer>(){{add(44);}});\n insertMutationProbes.put(\"de.ugoe.cs.testproject.A.metho5\", new TreeSet<Integer>(){{add(59);}});\n insertMutationProbes.put(\"de.ugoe.cs.testproject.B.method1\", new TreeSet<Integer>(){{add(25);}});\n */\n //System.out.println(insertMutationProbes);\n }", "private Mutation mutationFromTuple(Tuple t) throws IOException\n {\n Mutation mutation = new Mutation();\n if (t.get(1) == null)\n {\n if (allow_deletes)\n {\n mutation.deletion = new Deletion();\n mutation.deletion.predicate = new org.apache.cassandra.thrift.SlicePredicate();\n mutation.deletion.predicate.column_names = Arrays.asList(objToBB(t.get(0)));\n mutation.deletion.setTimestamp(FBUtilities.timestampMicros());\n }\n else\n throw new IOException(\"null found but deletes are disabled, set \" + PIG_ALLOW_DELETES +\n \"=true in environment or allow_deletes=true in URL to enable\");\n }\n else\n {\n org.apache.cassandra.thrift.Column column = new org.apache.cassandra.thrift.Column();\n column.setName(objToBB(t.get(0)));\n column.setValue(objToBB(t.get(1)));\n column.setTimestamp(FBUtilities.timestampMicros());\n mutation.column_or_supercolumn = new ColumnOrSuperColumn();\n mutation.column_or_supercolumn.column = column;\n }\n return mutation;\n }", "private NAryTree applyDumb(NAryTree tree, Random rng) {\n\t\tNAryTree mutatedTree = dumbCoordinator.apply(tree, rng);\n\t\tthis.locationOfLastChange = dumbCoordinator.locationOfLastChange;\n\t\tthis.typeOfChange = dumbCoordinator.typeOfChange;\n\t\treturn mutatedTree;\n\t}", "private static Set<Chromosome> mutatePopulation(Set<Chromosome> population, double mutationRate) {\n Set<Chromosome> mutatedChromosomes = new HashSet<>(population);\n\n for (Chromosome path : mutatedChromosomes) {\n double mutationProbability = ThreadLocalRandom.current().nextDouble();\n if (mutationProbability > (1-mutationRate)) {\n // mutate the path using the RSM mutation operator\n mutateRoute(path);\n // indicate that the fitness of this path needs to be recalculated\n path.fitness = -1;\n }\n }\n\n // The set will most probably include certain chromosomes which are already present in the set of children\n // however, given that both are sets, any duplicates will be discarded\n return mutatedChromosomes;\n }", "private static void mutate(Tour tour) {\n // Loop through tour cities\n for(int tourPos1=0; tourPos1 < tour.tourSize(); tourPos1++){\n // Apply mutation rate\n if(Math.random() < mutationRate){\n // Get a second random position in the tour\n int tourPos2 = (int) (tour.tourSize() * Math.random());\n\n // Get the cities at target position in tour\n City city1 = tour.getCity(tourPos1);\n City city2 = tour.getCity(tourPos2);\n\n // Swap them around\n tour.setCity(tourPos2, city1);\n tour.setCity(tourPos1, city2);\n }\n }\n }", "private int getNextMutator()\n\t{\n\t\t\n\t\tif (mutatingHeuristics.size()==0)\n\t\t\treturn -1;\n\t\telse\n\t\t\treturn mutatingHeuristics.get(rng.nextInt(mutatingHeuristics.size()));\n\t}", "@Test\n public void syntheticSimple() {\n ConfigurableOperator cnb = new ConfigurableOperator(OpProps.prototype(1, Long.MAX_VALUE).cloneWithMemoryExpensive(true).cloneWithBound(false).cloneWithMemoryFactor(2.0d), ARBTRIARY_LEAF);\n ConfigurableOperator cb = new ConfigurableOperator(OpProps.prototype(1, Long.MAX_VALUE).cloneWithMemoryExpensive(true).cloneWithBound(true).cloneWithMemoryFactor(1.0d), cnb);\n Fragment f1 = new Fragment();\n f1.addOperator(cb);\n Wrapper w1 = new Wrapper(f1, 0);\n w1.overrideEndpoints(Collections.singletonList(N1));\n\n MemoryAllocationUtilities.setMemory(options, ImmutableMap.of(f1, w1), 10 + adjustReserve);\n assertEquals(Long.MAX_VALUE, cnb.getProps().getMemLimit());\n assertEquals(3, cb.getProps().getMemLimit());\n }", "public void setUniformMutationRatio(double delta){\n this.delta = delta;\n }", "public Individual mutate(Config config)\r\n\t{\r\n\t\tIndividual ind;\r\n\r\n\t\tif (isBinaryEncoding())\r\n\t\t{\r\n\t\t\t// Create a new binary individual\r\n\t\t\tind = new Individual(intSize, intCount, signedInt);\r\n\r\n\t\t\t// Copy our genes to other individual\r\n\t\t\tfor (int i = 0; i < binary.length; i++)\r\n\t\t\t\tind.binary[i] = binary[i];\r\n\r\n\t\t\t// Mutate\r\n\t\t\tint mutatedBits = (int) (Math.random() * config.mutationStrength) + 1;\r\n\t\t\tfor (int i = 0; i < mutatedBits; i++)\r\n\t\t\t{\r\n\t\t\t\tint bitIndex = (int) (Math.random() * binary.length);\r\n\t\t\t\tind.binary[bitIndex] = !ind.binary[bitIndex];\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// Create a new float individual\r\n\t\t\tind = new Individual();\r\n\r\n\t\t\t// Copy our genes\r\n\t\t\tind.realValue = realValue;\r\n\r\n\t\t\t// Mutate\r\n\t\t\tind.realValue += (Math.random() * 2f - 1f) * config.mutationStrength;\r\n\t\t}\r\n\r\n\t\treturn ind;\r\n\t}", "private void mutate(float probability) {\r\n\r\n individual[] temp_pop = new individual[this.pop_size];\r\n\r\n for (int i = 0; i < this.pop_size; i++) {\r\n\r\n float temp_genes[] = this.offspring_population.getPopulation()[i].getGenes();\r\n\r\n // mutation can now mutate wild cards\r\n for (int j = 0; j < temp_genes.length; j++) {\r\n float k = new Random().nextFloat();\r\n\r\n if (k <= probability) {\r\n float temp = new Random().nextFloat();\r\n temp_genes[j] = temp; // add a float between 0-1 // just mutate a new float\r\n }\r\n }\r\n individual child = new individual(temp_genes, solutions, output);\r\n temp_pop[i] = child;\r\n }\r\n this.main_population.setPopulation(temp_pop);\r\n this.main_population.update_population();\r\n }", "public Population mutatePopulation(Population population, List<FogDevice> fogDevices, List<? extends Cloudlet> cloudletList) {\n\n // Loop over current population by fitness\n for (int populationIndex = 1; populationIndex < population.size(); populationIndex++) {\n // if the current individual is selected to mutation phase\n if (this.mutationRate > Math.random()) {\n Individual individual = population.getFittest(populationIndex);\n individual = this.mutateIndividual(individual);\n }\n }\n // Return mutated population\n return population;\n }", "public Specimen mutate(Specimen specimen) {\n\t\tMap<String, Double> weights = WeightUtil.extractWeights(specimen.getWeights());\n\n\t\t// Now, with a certain probabiliy mutate each weight.\n\t\tfor (Map.Entry<String, Double> entry : weights.entrySet()) {\n\t\t\tif (random.nextDouble() <= mutateProbability) {\n\t\t\t\tentry.setValue(mutate(entry.getValue()));\n\t\t\t}\n\t\t}\n\n\t\t// Create a new specimen.\n\t\treturn new Specimen(specimen.getName(), generation, WeightUtil.createWeights(weights));\n\t}", "public void mutate() {\n\t\tsynchronized (this) {\n\t\t\tRandom rand = new Random();\n\t\t\tint mutate = rand.nextInt(4);\n\t\t\twhile (mutate == 0) {\n\t\t\t\tmutateHelper();\n\t\t\t\tmutate = rand.nextInt(4);\n\t\t\t}\n\t\t}\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic void mutation() {\r\n\t\tfinal double MUTATION_PROB = 0.1;\r\n\t\tfor (int i=0; i<this.nChromosomes; i++) {\r\n\t\t\tArrayList<Integer> chr = (ArrayList<Integer>) this.chromosomes.get(i);\r\n\t\t\tfor (int j=0; j<this.nViaPoints; j++) {\r\n\t\t\t\tdouble rand = Math.random();\r\n\t\t\t\tif (rand < MUTATION_PROB) {\r\n\t\t\t\t\t// change the sign\r\n\t\t\t\t\tInteger vPoint = chr.get(j);\r\n\t\t\t\t\tchr.remove(j);\r\n\t\t\t\t\tchr.add(j, new Integer(- (vPoint.intValue()%100)));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.printChromosomes(\"After Mutation\");\r\n\t}", "public void setMutationMethod(Mutation m){\n mutationType = m;\n }", "private void mutation() {\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tint num = (int) (Math.random() * GENE * ChrNum + 1);\n\t\t\tint chromosomeNum = (int) (num / GENE) + 1;\n\n\t\t\tint mutationNum = num - (chromosomeNum - 1) * GENE; \n\t\t\tif (mutationNum == 0) \n\t\t\t\tmutationNum = 1;\n\t\t\tchromosomeNum = chromosomeNum - 1;\n\t\t\tif (chromosomeNum >= ChrNum)\n\t\t\t\tchromosomeNum = 9;\n\t\t\tString temp;\n\t\t\tString a; \n\t\t\tif (ipop[chromosomeNum].charAt(mutationNum - 1) == '0') { \n a = \"1\";\n\t\t\t} else { \n\t\t\t\ta = \"0\";\n\t\t\t}\n\t\t\t\n\t\t\tif (mutationNum == 1) {\n\t\t\t\ttemp = a + ipop[chromosomeNum].substring(mutationNum);\n\t\t\t} else {\n\t\t\t\tif (mutationNum != GENE) {\n\t\t\t\t\ttemp = ipop[chromosomeNum].substring(0, mutationNum -1) + a \n\t\t\t\t\t\t\t+ ipop[chromosomeNum].substring(mutationNum);\n\t\t\t\t} else {\n\t\t\t\t\ttemp = ipop[chromosomeNum].substring(0, mutationNum - 1) + a;\n\t\t\t\t}\n\t\t\t}\n \tipop[chromosomeNum] = temp;\n\t\t}\n\t}", "public MetricOuterClass.Metric.Builder getMetricTreatmentBuilder() {\n \n onChanged();\n return getMetricTreatmentFieldBuilder().getBuilder();\n }", "public void setMutationRate(double rate) { this.exec = this.exec.withProperty(\"svum.rate\", rate); }", "public void mutation(Graph_GA obj, float mutation_index)\r\n\t{\r\n\t\t\r\n\t\tList<Integer> list_num = new ArrayList<Integer>();\r\n\t\tInteger[] shuffled_list = null;\r\n\t\tList<Integer> mutation_vertex = new ArrayList<Integer>();\r\n\t\t\r\n\t\tfor(int i=0;i<chromosome_size;i++)\r\n\t\t{\r\n\t\t\tlist_num.add(i+1);\r\n\t\t}\r\n\t\tjava.util.Collections.shuffle(list_num);\r\n\t\tshuffled_list = list_num.toArray(new Integer[list_num.size()]);\r\n\t\t\r\n\t\tfor(int i=0;i<(chromosome_size*mutation_index);i++)\r\n\t\t{\r\n\t\t\tmutation_vertex.add(shuffled_list[i]);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tRandom random_generator = new Random();\r\n\t\t\r\n\t\tGA_Graph_Node vertex_container[] = obj.getNodes();\r\n\t\t\r\n\t\tfor(int i=0;i<obj.num_vertex;i++)\r\n\t\t{\r\n\t\t\tInteger[] valid_colors = null;\r\n\t\t\tList<Integer> adjacent_vertex_color = new LinkedList<Integer>();\r\n\t\t\tSet<DefaultEdge> adjacent_edges = obj.graph_inp.edgesOf(vertex_container[i]);\r\n\t\t\tIterator<DefaultEdge> adj_edge_list = adjacent_edges.iterator();\r\n\t\t\t\r\n\t\t\twhile(adj_edge_list.hasNext())\r\n\t\t\t{\r\n\t\t\t\tDefaultEdge adj_edge = adj_edge_list.next();\r\n\t\t\t\tGA_Graph_Node adj_node = null;\r\n\t\t\t\tadj_node = obj.graph_inp.getEdgeSource(adj_edge);\r\n\t\t\t\tif(adj_node==null||adj_node==vertex_container[i])\r\n\t\t\t\t{\r\n\t\t\t\t\tadj_node = obj.graph_inp.getEdgeTarget(adj_edge);\r\n\t\t\t\t}\r\n\t\t\t\tadjacent_vertex_color.add(chromosome[adj_node.numID-1]);\r\n\t\t\t}\r\n\t\t\tif(adjacent_vertex_color.contains(chromosome[i])&&mutation_vertex.contains(i+1))\r\n \t{\r\n\t\t\t\tList<Integer> valid_color_list = new LinkedList<Integer>();\r\n \t\tfor(int j=0;j<num_colors;j++)\r\n \t\t{\r\n \t\t\tif(adjacent_vertex_color.contains(j+1) == false)\r\n \t\t\t\tvalid_color_list.add(j+1);\t\r\n \t}\r\n \t\t\r\n \t\tvalid_colors = valid_color_list.toArray(new Integer[valid_color_list.size()]);\r\n \t\t\r\n// \t\tSystem.out.println(valid_colors.toString());\r\n \t\tif(valid_colors.length> 0)\r\n \t\t{\r\n\t \t\tint rand_num = random_generator.nextInt(valid_colors.length);\r\n\t \t\t\tint new_color = valid_colors[rand_num];\r\n\t \t\t\t\r\n\t \t\t\tchromosome[i] = new_color;\r\n \t\t}\r\n \t}\r\n\t\t\t\r\n }\r\n\t}", "public abstract void mutate();", "public MutationReproducer(\n Perturber<GenomeType> perturber,\n Selector<GenomeType> selector)\n {\n super();\n this.setPerturber(perturber);\n this.setSelector(selector);\n }", "public interface Mutation {\n void apply(Collection<PartType> parts);\n}", "public abstract Chromosome mutation(Chromosome child);", "public void defaultMutate() {\n int mutationIndex = RNG.randomInt(0, this.m_GenotypeLength);\n //if (mutationIndex > 28) System.out.println(\"Mutate: \" + this.getSolutionRepresentationFor());\n if (this.m_Genotype.get(mutationIndex)) this.m_Genotype.clear(mutationIndex);\n else this.m_Genotype.set(mutationIndex);\n //if (mutationIndex > 28) System.out.println(this.getSolutionRepresentationFor());\n }", "protected void apply(EventLog.Mutator mutator, Game game) {\n\t\tif (executed) {\n\t\t\tthrow new IllegalArgumentException(\"already applied\");\n\t\t}\n\t\tapplier.accept(mutator, game);\n\t\texecuted = true;\n\t}", "Affectation createAffectation();", "private void mutate(Chromosome c){\n for(double[] gene:c.getGeneData()){\n for(int i=0; i<gene.length; i++){\n if(Math.random()<mutationRate){\n //Mutate the data\n gene[i] += (Math.random()-Math.random())*maxPerturbation;\n }\n }\n }\n }", "public int mutateGene(int gene);", "public void runGenerational() {\n\n\t\tSystem.out.println(\"Runing pure generational demo.\");\n\t\tFunction<BitSet, Double> knapsackFitnessFunction = new KnapsackFitness(capacity, parseElements());\n\t\tSpace<BitSet> space = new BitSetSpace(weights.length);\n\n\t\tGeneticSelector<BitSet, Double> rouletteSelector = new RouletteGeneticSelector<>(POP_SIZE);\n\t\tGeneticCrossover<BitSet, Double> crossover = new BinaryCrossover<>(0.9);\n\t\tGeneticOperator<BitSet, Double> geneticOperator = new CustomGeneticOperator<>(crossover);\n\t\tGeneticReplacement<BitSet, Double> replacement = new GenerationalReplacement<>();\n\t\tTracer.add(Population.class);\n\t\tTracer.start();\n\n\t\tSearch<BitSet, Double> search = new GeneticAlgorithm<>(POP_SIZE, NUM_ITER, rouletteSelector, geneticOperator,\n\t\t\t\treplacement);\n\t\tOptimizationProblem<BitSet, Double> problem = new OptimizationProblem<>(space, knapsackFitnessFunction,\n\t\t\t\tComparator.reverseOrder());\n\t\tSolution<BitSet, Double> foundSolution = search.solve(problem);\n\n\t\tSystem.out.println(String.format(\"Best found solution: %f, bitset: %s\",\n\t\t\t\tknapsackFitnessFunction.calculate(foundSolution.getSolution()), foundSolution.getSolution()));\n\n\t\tBitSet optimalBitSet = parseOptimalBitSet();\n\t\tSystem.out.println(String.format(\"Optimal solution: %f, bitset: %s\",\n\t\t\t\tknapsackFitnessFunction.calculate(optimalBitSet), optimalBitSet));\n\t\tKnapsackMetric metric = new KnapsackMetric();\n\t\tmetric.putDataOfBestInFile(1);\n\t}", "void genClassMutants(ClassDeclarationList cdecls) {\n\tgenClassMutants1(cdecls);\n\tgenClassMutants2(cdecls);\n }", "public static Operator giveOperator(Actor self, Actor recipient, Prop prop) {\n\n\t\t// Set conditions that must be true\n\t\tArrayList<ICondition> beTrue = new ArrayList<ICondition>();\n\t\tbeTrue.add(new LivesCondition(self));\n\t\tbeTrue.add(new LivesCondition(recipient));\n\t\tbeTrue.add(new SamePlaceCondition(self, recipient));\n\t\tbeTrue.add(new BelongsToCondition(prop, self));\n\n\t\t// Set conditions that must be false\n\t\tArrayList<ICondition> beFalse = new ArrayList<ICondition>();\n\n\t\t// Set conditions that will be set true\n\t\tArrayList<ICondition> setTrue = new ArrayList<ICondition>();\n\t\tsetTrue.add(new BelongsToCondition(prop, recipient));\n\n\t\t// Set conditions that will be set false\n\t\tArrayList<ICondition> setFalse = new ArrayList<ICondition>();\n\n\t\t// Add the corresponding action to the operator\n\t\tAction action = new Action(Action.ActionType.GIVE, self, recipient, prop);\n\t\t\n\t\t// The weight for giving actions\n\t\tint weight = 5;\n\t\t\n\t\treturn new Operator(beTrue, beFalse, setTrue, setFalse, action, weight);\n\t}", "@Test\r\n\tpublic final void testCross() throws GeneticProgrammingException {\r\n\t\tfinal int[] training = TestHelper.genertateTrainingDataSet(-100, 100);\r\n\t\tfinal double[] targetValues = TestHelper.calculateTargetValues(\r\n\t\t\t\t\"x*2-1/2\", training);\r\n\t\tfinal Node root = new Node(null, \"/\", null, Node.OPERATOR);\r\n\t\tfinal Tree newTree = new Tree(root, new TerminalSet(),\r\n\t\t\t\tnew FunctionalSet());\r\n\t\tfinal Node minusOperator = new Node(root, \"-\", Node.LEFT, Node.OPERATOR);\r\n\t\tnewTree.addNode(minusOperator);\r\n\t\tfinal Node multiOperator = new Node(root, \"*\", Node.RIGHT,\r\n\t\t\t\tNode.OPERATOR);\r\n\t\tnewTree.addNode(multiOperator);\r\n\t\tnewTree.addNode(new Node(minusOperator, \"1\", Node.LEFT, Node.OPERAND));\r\n\t\tnewTree.addNode(new Node(minusOperator, \"3\", Node.RIGHT, Node.OPERAND));\r\n\t\tnewTree.addNode(new Node(multiOperator, \"x\", Node.LEFT, Node.OPERAND));\r\n\t\tnewTree.addNode(new Node(multiOperator, \"5\", Node.RIGHT, Node.OPERAND));\r\n\t\tassertEquals(\"Tree did not get generated corectly\", \"(1-3)/(x*5)\",\r\n\t\t\t\tnewTree.getEquation().toString());\r\n\t\tfinal Node root2 = new Node(null, \"/\", null, Node.OPERATOR);\r\n\t\tfinal Tree newTree2 = new Tree(root2, new TerminalSet(),\r\n\t\t\t\tnew FunctionalSet());\r\n\t\tfinal Node minusOperator2 = new Node(root2, \"-\", Node.LEFT,\r\n\t\t\t\tNode.OPERATOR);\r\n\t\tnewTree2.addNode(minusOperator2);\r\n\t\tfinal Node multiOperator2 = new Node(root2, \"*\", Node.RIGHT,\r\n\t\t\t\tNode.OPERATOR);\r\n\t\tnewTree2.addNode(multiOperator2);\r\n\t\tnewTree2\r\n\t\t\t\t.addNode(new Node(minusOperator2, \"x\", Node.LEFT, Node.OPERAND));\r\n\t\tnewTree2\r\n\t\t\t\t.addNode(new Node(minusOperator2, \"7\", Node.RIGHT, Node.OPERAND));\r\n\t\tnewTree2\r\n\t\t\t\t.addNode(new Node(multiOperator2, \"8\", Node.LEFT, Node.OPERAND));\r\n\t\tnewTree2\r\n\t\t\t\t.addNode(new Node(multiOperator2, \"9\", Node.RIGHT, Node.OPERAND));\r\n\t\tassertEquals(\"Tree did not get generated corectly\", \"(x-7)/(8*9)\",\r\n\t\t\t\tnewTree2.getEquation().toString());\r\n\r\n\t\tfinal Node root3 = new Node(null, \"/\", null, Node.OPERATOR);\r\n\t\tfinal Tree newTree3 = new Tree(root3, new TerminalSet(),\r\n\t\t\t\tnew FunctionalSet());\r\n\t\tfinal Node minusOperator3 = new Node(root3, \"-\", Node.LEFT,\r\n\t\t\t\tNode.OPERATOR);\r\n\t\tnewTree3.addNode(minusOperator3);\r\n\t\tfinal Node multiOperator3 = new Node(root3, \"*\", Node.RIGHT,\r\n\t\t\t\tNode.OPERATOR);\r\n\t\tnewTree3.addNode(multiOperator3);\r\n\t\tfinal Node multiOperator4 = new Node(multiOperator3, \"*\", Node.LEFT,\r\n\t\t\t\tNode.OPERATOR);\r\n\t\tnewTree3.addNode(multiOperator4);\r\n\t\tfinal Node multiOperator5 = new Node(multiOperator3, \"*\", Node.RIGHT,\r\n\t\t\t\tNode.OPERATOR);\r\n\t\tnewTree3.addNode(multiOperator5);\r\n\t\tnewTree3\r\n\t\t\t\t.addNode(new Node(minusOperator3, \"x\", Node.LEFT, Node.OPERAND));\r\n\t\tnewTree3\r\n\t\t\t\t.addNode(new Node(minusOperator3, \"7\", Node.RIGHT, Node.OPERAND));\r\n\t\tnewTree3\r\n\t\t\t\t.addNode(new Node(multiOperator4, \"1\", Node.LEFT, Node.OPERAND));\r\n\t\tnewTree3\r\n\t\t\t\t.addNode(new Node(multiOperator4, \"2\", Node.RIGHT, Node.OPERAND));\r\n\t\tnewTree3\r\n\t\t\t\t.addNode(new Node(multiOperator5, \"3\", Node.LEFT, Node.OPERAND));\r\n\t\tnewTree3\r\n\t\t\t\t.addNode(new Node(multiOperator5, \"4\", Node.RIGHT, Node.OPERAND));\r\n\t\tassertEquals(\"Tree did not get generated corectly\",\r\n\t\t\t\t\"(x-7)/(1*2)*(3*4)\", newTree3.getEquation().toString());\r\n\t\tfinal ArrayList<Tree> newTrees = new ArrayList<Tree>();\r\n\t\tnewTrees.add(newTree3);\r\n\t\tnewTrees.add(newTree2);\r\n\t\tnewTrees.add(newTree);\r\n\t\tassertEquals(\"Tree should have a size of 3 before the cross\", 3,\r\n\t\t\t\tnewTrees.size());\r\n\t\tCrossover.cross(newTrees, 1, 100, training, targetValues);\r\n\t\tfinal Iterator<Tree> iterator = newTrees.iterator();\r\n\t\twhile (iterator.hasNext()) {\r\n\t\t\t// All five trees should be different\r\n\t\t\tfinal String firstTree = iterator.next().toString();\r\n\t\t\tassertNotSame(\"Cross should change the tree but did not 1\",\r\n\t\t\t\t\tfirstTree, iterator.next().toString());\r\n\t\t\tassertNotSame(\"Cross should change the tree but did not 2\",\r\n\t\t\t\t\tfirstTree, iterator.next().toString());\r\n\t\t\tassertNotSame(\"Cross should change the tree but did not 3\",\r\n\t\t\t\t\tfirstTree, iterator.next().toString());\r\n\t\t\tassertNotSame(\"Cross should change the tree but did not 4\",\r\n\t\t\t\t\tfirstTree, iterator.next().toString());\r\n\t\t}\r\n\t\t// should be 5 trees after the crossover\r\n\t\tassertEquals(\"Tree should have a size of 5 but was not\", 5, newTrees\r\n\t\t\t\t.size());\r\n\t}", "public void setProbMut(double d){\n if ((d < 0) || (d > 1)){\n throw new IllegalArgumentException(\"Mutation probability cannot be less than 0 or greater than 1.\");\n }\n mutationProb = d;\n }", "protected abstract void createInnerEstimatorsIfNeeded();", "Builder withTreatment(TrafficTreatment treatment);", "public static Graph createAcyclicGraph(int V, int E, boolean weighted, int[] perm) {\r\n\t\tif (E > (V*(V-1)) || E < V) {\r\n\t\t\tthrow new IllegalArgumentException(\"To many/few edges\");\r\n\t\t}\r\n\t\t\r\n\t\tRandom rand = new Random();\r\n\t\tArrayList<Integer> permutation = new ArrayList<Integer>();\r\n\t\t\r\n\t\tGraph g = new Graph(V);\r\n\t\t\r\n\t\t/* Create a random permutation if the user did not specify a permutation, otherwise it uses\r\n\t\t * the permutation of the user as permutation*/\r\n\t\tif (perm == null) {\r\n\t\t\tfor (int i = 0; i < V; i++) {\r\n\t\t\t\tpermutation.add(i);\r\n\t\t\t}\t\t\r\n\t\t\tCollections.shuffle(permutation);\t\t\t\r\n\t\t} else {\r\n\t\t\tfor (int i = 0; i < V; i++) {\r\n\t\t\t\tpermutation.add(perm[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(permutation.toString());\r\n\t\t\r\n\t\t/* This will create an unweighted graph*/\r\n\t\tif (weighted == false) {\r\n\t\t\tfor (int i = 0; i < V-1; i++) {\r\n\t\t\t\tint pos = i;\r\n\t\t\t\tif (!g.addRandomEdge(permutation.get(pos), permutation.get(rand.nextInt(V - pos) + pos), 1)) {i--;} \r\n\t\t\t\telse {E--;}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twhile (E > 0) {\r\n\t\t\t\tint srcIndex = rand.nextInt(V-1);\r\n\t\t\t\tint destIndex = rand.nextInt((V-1) - srcIndex) + srcIndex;\r\n\t\t\t\t\r\n\t\t\t\tif (g.addRandomEdge(permutation.get(srcIndex), permutation.get(destIndex), 1)) {E--;}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t/* This will create a weighted graph*/\r\n\t\t} else {\r\n\t\t\tfor (int i = 0; i < V-1; i++) {\r\n\t\t\t\tint pos = i;\r\n\t\t\t\tif (!g.addRandomEdge(permutation.get(pos), permutation.get(rand.nextInt(V - pos) + pos), rand.nextInt(20))) {i--;} \r\n\t\t\t\telse {E--;}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twhile (E > 0) {\r\n\t\t\t\tint srcIndex = rand.nextInt(V-1);\r\n\t\t\t\tint destIndex = rand.nextInt((V-1) - srcIndex) + srcIndex;\r\n\t\t\t\t\r\n\t\t\t\tif (g.addRandomEdge(permutation.get(srcIndex), permutation.get(destIndex), rand.nextInt(20))) {E--;}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn g;\r\n\t\t\r\n\t}", "abstract SharedBuilder<B, C, M1, M2> setM2(M2 m2);", "abstract SharedBuilder<B, C, M1, M2> setM2(M2 m2);", "private TraceableFloat mutateGene(TraceableFloat a, float new_a_value, EvolutionState state){\n\n if(a.getValue() == new_a_value)//return the original gene if the value was not altered\n return a;\n\n double influence_factor_mut = Math.abs(a.getValue() - new_a_value) / (Math.abs(a.getValue()) + Math.abs(a.getValue() - new_a_value));\n double influence_factor_old = 1 - influence_factor_mut;\n\n List<TraceTuple> a_traceVector = new ArrayList<TraceTuple>();\n\n int i = 0; //index for this traceVector\n\n //check if we accumulate and the first element is already the mutation\n if(state.getAccumulateMutatioImpact() && a.getTraceVector().get(0).getTraceID() == state.getMutationCounter()){//if we accumulate mutation and the gene is influenced by mutation, accumulate that\n double oldScaledMutImpact = a.getTraceVector().get(0).getImpact() * influence_factor_old;\n a_traceVector.add(new TraceTuple(state.getMutationCounter(), influence_factor_mut + oldScaledMutImpact));\n i++; //increment i, as the first element of the traceList from a is already added\n } else { //add the new mutation ID if we don't accumulate or there is no mutation present bevore\n a_traceVector.add(new TraceTuple(state.getMutationCounter(), influence_factor_mut));\n }\n\n while(i < a.getTraceVector().size()){ //this iterates over the traceVector of this individual\n int currentAID = a.getTraceVector().get(i).getTraceID();\n double currentAImpact = a.getTraceVector().get(i).getImpact();\n\n a_traceVector.add(new TraceTuple(currentAID, influence_factor_old * currentAImpact));\n i++;\n }\n\n return new TraceableFloat(new_a_value, a_traceVector);\n }", "private void processMutations(VertexResolver vertexResolver)\n throws IOException {\n for (Worker worker : mWorkers) {\n worker.processWorkerMutations(vertexResolver);\n }\n\n totalVertex = 0;\n totalEdge = 0;\n for (Worker w : mWorkers) {\n totalVertex += w.getVertexNumber();\n totalEdge += w.getEgeNumber();\n }\n\n for (Worker w : mWorkers) {\n w.setTotalNumVerticesAndEdges(totalVertex, totalEdge);\n }\n }", "public FeedForwardNeuralNetwork mutate(FeedForwardNeuralNetwork net)\n\t{\n // Copies the net\n FeedForwardNeuralNetwork newNetwork = new FeedForwardNeuralNetwork(net);\n newNetwork.setWeightVector((Vector<Double>)net.getWeightVector().clone());\n\n Vector<Double> newWeights = new Vector<Double>();\n\t\tRandom gen = new Random();\n int mc = gen.nextInt(100), slSize;\n\n if (mc <= 10) { // all the weights in the network\n for(SynapseLayer sl: newNetwork.synapse_layers) {\n slSize = sl.getWeightVector().size() / 20;\n for (Double weight: sl.getWeightVector())\n newWeights.add(weight + gen.nextGaussian()*Math.sqrt(slSize));\n }\n newNetwork.setWeightVector(newWeights);\n }\n else if (mc <= 37) { // all the weights in a randomly selected layer\n SynapseLayer sl = newNetwork.synapse_layers.get(gen.nextInt(newNetwork.synapse_layers.size()));\n for (Double weight: sl.getWeightVector())\n newWeights.add(weight + gen.nextGaussian() * Math.sqrt(sl.getWeightVector().size()/20));\n sl.setWeightVector(newWeights);\n }\n else if (mc <= 64) { // all the weights going into a randomly selecte layer, i can't tell the difference between this and the last one\n SynapseLayer sl = newNetwork.synapse_layers.get(gen.nextInt(newNetwork.synapse_layers.size()));\n for (Double weight: sl.getWeightVector())\n newWeights.add(weight + gen.nextGaussian() * Math.sqrt(sl.getWeightVector().size()/20));\n sl.setWeightVector(newWeights);\n }\n else {\n newWeights = newNetwork.getWeightVector();\n int rInd = gen.nextInt(newWeights.size());\n newWeights.set(rInd, newWeights.get(rInd) + Math.sqrt(gen.nextGaussian()*14));\n newNetwork.setWeightVector(newWeights);\n }\n\t\treturn newNetwork;\n\t}", "protected GenTreeOperation() {}", "public void setSmartMutationRate(double rate) { this.exec = this.exec.withProperty(\"sm.rate\", rate); }", "public LinearGenomeShrinkMutation(){\n\t\tnumberGenesToRemove = 1;\n\t}", "@Override\n protected void registerGoals() {\n this.eatBlockGoal = new EatBlockGoal(this); //changed field eatGrassGoal in accesstransformer.cfg\n this.eatMyceliumGoal = new EatMyceliumGoal(this);\n this.goalSelector.addGoal(0, new FloatGoal(this));\n this.goalSelector.addGoal(1, new PanicGoal(this, 1.25D));\n this.goalSelector.addGoal(2, new BreedGoal(this, 1.0D));\n //add temptGoal for each mushroom\n Objects.requireNonNull(ForgeRegistries.ITEMS.tags()).getTag(Tags.Items.MUSHROOMS).forEach(mushroom ->\n this.goalSelector.addGoal(3, new TemptGoal(this, 1.1D, Ingredient.of(mushroom), false))\n );\n this.goalSelector.addGoal(4, new FollowParentGoal(this, 1.1D));\n this.goalSelector.addGoal(5, this.eatMyceliumGoal);\n // EatMushroomGoal is added via LivingSpawnEvent.EnteringChunk event!\n this.goalSelector.addGoal(6, new WaterAvoidingRandomStrollGoal(this, 1.0D));\n this.goalSelector.addGoal(7, new LookAtPlayerGoal(this, Player.class, 6.0F));\n this.goalSelector.addGoal(8, new RandomLookAroundGoal(this));\n }", "public MutableNodeSet(Graph graph) {\n\t\tsuper(graph);\n\t\tthis.members = new TreeSet<Integer>();\n\t\tinitializeInOutWeights();\n\t}", "public boolean isEnabled(Mutation m);", "public Watset(Graph<V, E> graph, ClusteringAlgorithmBuilder<V, E, ?> local, ClusteringAlgorithmBuilder<Sense<V>, DefaultWeightedEdge, ?> global) {\n this.graph = requireUndirected(graph);\n this.inducer = new SenseInduction<>(graph, requireNonNull(local));\n this.global = requireNonNull(global);\n }", "@Test\n public void testMutateTrue() throws Exception {\n final TranslationUnit tu = ParseHelper.parse(\"#version 310 es\\n\"\n + \"precision highp float;\\n\"\n + \"void foo() {\"\n + \" true;\"\n + \"}\"\n + \"void main() {\"\n + \" true;\"\n + \"}\");\n final List<Expr2ExprMutation> mutations =\n new IdentityMutationFinder(tu, new RandomWrapper(0),\n GenerationParams.normal(ShaderKind.FRAGMENT, false, false))\n .findMutations();\n assertEquals(2, mutations.size());\n mutations.get(0).apply();\n assertEquals(\"void main()\\n{\\n true;\\n}\\n\",\n PrettyPrinterVisitor.prettyPrintAsString(tu.getMainFunction()));\n\n }", "@Override\n public void mutate(Chromosome c) {\n if (c.getFitness() == 0) return;\n\n boolean[] genes = c.getGenes();\n int weight = c.getWeight();\n\n for (int i = 0; i < genes.length; i++) {\n if (weight == Config.CAPACITY) break;\n\n if (!genes[i]) {\n if (weight + Config.ITEMS[i].getWeight() <= Config.CAPACITY) {\n c.flipGene(i);\n }\n }\n }\n \n }", "SharedBuilder<B, C, M1, M2> setM2(M2 m2);", "SharedBuilder<B, C, M1, M2> setM2(M2 m2);", "@Override\n\tpublic List<MutantCtElement> execute(CtElement toMutate) {\n\t\tList<MutantCtElement> result = new ArrayList<MutantCtElement>();\n\n\t\tif (toMutate instanceof CtUnaryOperator<?>) {\n\t\t\tCtUnaryOperator<?> unary = (CtUnaryOperator<?>) toMutate;\n\t\t\tif (unary.getKind() == UnaryOperatorKind.NOT) {\n\t\t\t\tCtExpression expIF = factory.Core().clone(unary.getOperand());\n\t\t\t\tMutantCtElement mutatn = new MutantCtElement(expIF,0.3);\n\t\t\t\t//result.add(expIF);\n\t\t\t\tresult.add(mutatn);\n\t\t\t}\n\t\t} else {\n\t\t\tif (toMutate instanceof CtTypedElement<?>) {\n\t\t\t\tCtExpression<?> inv = (CtExpression<?>) toMutate;\n\t\t\t\tif (inv.getType()!= null && inv.getType().getSimpleName().equals(boolean.class.getSimpleName())) {\n\t\t\t\t\tCtExpression<?> invClone = factory.Core().clone(inv);\n\t\t\t\t\tCtUnaryOperator unary = factory.Core().createUnaryOperator();\n\t\t\t\t\tunary.setOperand(invClone);\n\t\t\t\t\tunary.setKind(UnaryOperatorKind.NOT);\n\t\t\t\t\t//result.add(unary);\n\t\t\t\t\tMutantCtElement mutatn = new MutantCtElement(unary,3);\n\t\t\t\t\t//result.add(expIF);\n\t\t\t\t\tresult.add(mutatn);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "public void MutationCAN (TableVar Variables) {\r\n\r\n int posiciones, i, j, h, eliminar;\r\n float m;\r\n\r\n posiciones = Variables.getNVars()*long_poblacion;\r\n\r\n if (mut_prob > 0)\r\n while (Mu_next < posiciones) {\r\n // Determine the chromosome and gene to be muted\r\n i = Mu_next/Variables.getNVars();\r\n j = Mu_next%Variables.getNVars();\r\n\r\n // Copy the chromosome\r\n for (h=0; h<Variables.getNVars(); h++) {\r\n Des.setCromElem(descendientes, h, Inter.getCromElem(i,h));\r\n }\r\n\r\n // Make the mutation\r\n // Half the mutations eliminates the variable from the rule\r\n // The others sets a random value (including the elimination)\r\n eliminar = Randomize.Randint (0,10);\r\n if (eliminar <=5){\r\n if (!Variables.getContinuous(j))\r\n Des.setCromElem(descendientes, j, (int)Variables.getMax(j)+1);\r\n else\r\n Des.setCromElem(descendientes, j, Variables.getNLabelVar(j));\r\n }\r\n else {\r\n if (!Variables.getContinuous(j))\r\n Des.setCromElem(descendientes, j, Randomize.Randint((int)Variables.getMin(j), (int)Variables.getMax(j)));\r\n else\r\n Des.setCromElem(descendientes, j, Randomize.Randint(0,(Variables.getNLabelVar(j)-1)));\r\n }\r\n descendientes++;\r\n\r\n // Marks the chromosome as no evaluated\r\n Des.setIndivEvaluated(i,false);\r\n\r\n // Compute next position to be muted\r\n if (mut_prob<1) {\r\n m = (float) Randomize.Rand();\r\n Mu_next += Math.ceil (Math.log(m) / Math.log(1.0 - mut_prob));\r\n }\r\n else\r\n Mu_next += 1;\r\n\r\n }\r\n Mu_next -= posiciones;\r\n\r\n }", "public void MutationDNF (TableVar Variables) {\r\n\r\n int posiciones, interv, i, j, l, h, eliminar;\r\n float m;\r\n \r\n posiciones = Variables.getNVars()*long_poblacion;\r\n \r\n if (mut_prob > 0)\r\n while (Mu_next < posiciones) {\r\n // Determine the chromosome and gene to be muted\r\n i = Mu_next/Variables.getNVars();\r\n j = Mu_next%Variables.getNVars();\r\n \r\n // Copy the chromosome\r\n for (h=0; h<Variables.getNVars(); h++) {\r\n for (l=0; l<=Variables.getNLabelVar(h); l++)\r\n Des.setCromElemGene(descendientes, h, l, Inter.getCromElemGene(i,h,l));\r\n }\r\n \r\n // Make the mutation\r\n // Half the mutations eliminates the variable from the rule\r\n // The others sets a random value (including the elimination)\r\n eliminar = Randomize.Randint (0,10);\r\n if (eliminar <=5){\r\n for (l=0; l<=Variables.getNLabelVar(j); l++)\r\n Des.setCromElemGene(descendientes, j, l, 0);\r\n }\r\n else {\r\n interv = 0;\r\n for (l=0; l<Variables.getNLabelVar(j); l++) {\r\n Des.setCromElemGene(descendientes, j, l, Randomize.Randint(0,1));\r\n if (Des.getCromElemGene(descendientes, j, l)==1)\r\n interv ++;\r\n }\r\n // si no interviene ningún valor o intervienen todos, la variable no interviene\r\n if (interv==0 || interv==Variables.getNLabelVar(j))\r\n Des.setCromElemGene(descendientes, j, Variables.getNLabelVar(j), 0);\r\n else\r\n Des.setCromElemGene(descendientes, j, Variables.getNLabelVar(j), 1);\r\n }\r\n descendientes++;\r\n\r\n // Marks the chromosome as no evaluated\r\n Des.setIndivEvaluated(i,false);\r\n\r\n // Compute next position to be muted\r\n if (mut_prob<1) {\r\n m = (float) Randomize.Rand();\r\n Mu_next += Math.ceil (Math.log(m) / Math.log(1.0 - mut_prob));\r\n }\r\n else\r\n Mu_next += 1;\r\n\r\n }\r\n Mu_next -= posiciones;\r\n \r\n }", "public static void updateMutationRate(KNode oldBest, KNode gBest)\r\n {\r\n if(oldBest.fitness() == gBest.fitness())\r\n {\r\n if(Constants.MUTATION_PROBABILITY < Constants.MAX_MUTATION_PROBABILITY)\r\n {\r\n Constants.MUTATION_PROBABILITY+=Constants.MUTATION_INCREMENT;\r\n }\r\n }\r\n else\r\n {\r\n Constants.MUTATION_PROBABILITY = Constants.MUTATION_INCREMENT;\r\n }\r\n }", "public void MutatePlayer(int PercentOfMutation) {\n\t\tint NoOfMutations = CalculateGeneModifications(PercentOfMutation);\n\t\tRandom mutate = new Random();\n\t\tfor (int i = 0; i < NoOfMutations; i++) {\n\t\t\tmoveOrder[mutate.nextInt(moveOrder.length)] = r.nextInt(3);\n\t\t}\n\t\tthis.ResetPlayer();\n\t}", "public static MetricTransformation2DRobustEstimator create(\n MetricTransformation2DRobustEstimatorListener listener, \n boolean weakMinimumSizeAllowed, RobustEstimatorMethod method) {\n switch (method) {\n case LMedS:\n return new LMedSMetricTransformation2DRobustEstimator(\n listener, weakMinimumSizeAllowed);\n case MSAC:\n return new MSACMetricTransformation2DRobustEstimator(\n listener, weakMinimumSizeAllowed);\n case PROSAC:\n return new PROSACMetricTransformation2DRobustEstimator(\n listener, weakMinimumSizeAllowed);\n case PROMedS:\n return new PROMedSMetricTransformation2DRobustEstimator(\n listener, weakMinimumSizeAllowed);\n case RANSAC:\n default:\n return new RANSACMetricTransformation2DRobustEstimator(\n listener, weakMinimumSizeAllowed);\n }\n }", "public static void mutate(Chromosome chrome) {\n \n // Loop through tour cities\n for(int rosterNursePos1=0; rosterNursePos1 < chrome.ChromosomeRowSize(); rosterNursePos1++){\n for (int rosterDayPos1=0; rosterDayPos1<chrome.chromosomeColumnCount();rosterDayPos1++){\n if(RosterManager.isPreviousShift(chrome.getShift(rosterNursePos1, rosterDayPos1))==false || RosterManager.isNextShift(chrome.getShift(rosterNursePos1, rosterDayPos1))==false || chrome.getShift(rosterNursePos1, rosterDayPos1).getHours()!=0 ){\n if(Math.random() < mutationRate){\n // Get a second random position in the tour\n int rosterNursePos2= rosterNursePos1;\n int rosterDayPos2 = returnValidPos(rosterNursePos2, randomizeShiftGeneration(chrome), chrome );\n\n // Get the cities at target position in tour\n Gene gene1 = chrome.retrieveGene(rosterNursePos1, rosterDayPos1);\n Gene gene2 = chrome.retrieveGene(rosterNursePos2, rosterDayPos2);\n\n // Swap them around\n chrome.saveGene(rosterNursePos1, rosterDayPos1, gene2);\n chrome.saveGene(rosterNursePos2, rosterDayPos2, gene1);\n \n }\n \n \n } \n // Apply mutation rate\n \n }\n \n }\n \n \n }", "public interface Propagator extends PVCoordinatesProvider {\n\n /** Default mass. */\n double DEFAULT_MASS = 1000.0;\n\n /** Default attitude provider. */\n AttitudeProvider DEFAULT_LAW = InertialProvider.EME2000_ALIGNED;\n\n /** Indicator for slave mode. */\n int SLAVE_MODE = 0;\n\n /** Indicator for master mode. */\n int MASTER_MODE = 1;\n\n /** Indicator for ephemeris generation mode. */\n int EPHEMERIS_GENERATION_MODE = 2;\n\n /** Get the current operating mode of the propagator.\n * @return one of {@link #SLAVE_MODE}, {@link #MASTER_MODE},\n * {@link #EPHEMERIS_GENERATION_MODE}\n * @see #setSlaveMode()\n * @see #setMasterMode(double, OrekitFixedStepHandler)\n * @see #setMasterMode(OrekitStepHandler)\n * @see #setEphemerisMode()\n */\n int getMode();\n\n /** Set the propagator to slave mode.\n * <p>This mode is used when the user needs only the final orbit at the target time.\n * The (slave) propagator computes this result and return it to the calling\n * (master) application, without any intermediate feedback.\n * <p>This is the default mode.</p>\n * @see #setMasterMode(double, OrekitFixedStepHandler)\n * @see #setMasterMode(OrekitStepHandler)\n * @see #setEphemerisMode()\n * @see #getMode()\n * @see #SLAVE_MODE\n */\n void setSlaveMode();\n\n /** Set the propagator to master mode with fixed steps.\n * <p>This mode is used when the user needs to have some custom function called at the\n * end of each finalized step during integration. The (master) propagator integration\n * loop calls the (slave) application callback methods at each finalized step.</p>\n * @param h fixed stepsize (s)\n * @param handler handler called at the end of each finalized step\n * @see #setSlaveMode()\n * @see #setMasterMode(OrekitStepHandler)\n * @see #setEphemerisMode()\n * @see #getMode()\n * @see #MASTER_MODE\n */\n void setMasterMode(double h, OrekitFixedStepHandler handler);\n\n /** Set the propagator to master mode with variable steps.\n * <p>This mode is used when the user needs to have some custom function called at the\n * end of each finalized step during integration. The (master) propagator integration\n * loop calls the (slave) application callback methods at each finalized step.</p>\n * @param handler handler called at the end of each finalized step\n * @see #setSlaveMode()\n * @see #setMasterMode(double, OrekitFixedStepHandler)\n * @see #setEphemerisMode()\n * @see #getMode()\n * @see #MASTER_MODE\n */\n void setMasterMode(OrekitStepHandler handler);\n\n /** Set the propagator to ephemeris generation mode.\n * <p>This mode is used when the user needs random access to the orbit state at any time\n * between the initial and target times, and in no sequential order. A typical example is\n * the implementation of search and iterative algorithms that may navigate forward and\n * backward inside the propagation range before finding their result.</p>\n * <p>Beware that since this mode stores <strong>all</strong> intermediate results,\n * it may be memory intensive for long integration ranges and high precision/short\n * time steps.</p>\n * @see #getGeneratedEphemeris()\n * @see #setSlaveMode()\n * @see #setMasterMode(double, OrekitFixedStepHandler)\n * @see #setMasterMode(OrekitStepHandler)\n * @see #getMode()\n * @see #EPHEMERIS_GENERATION_MODE\n */\n void setEphemerisMode();\n\n /**\n * Set the propagator to ephemeris generation mode with the specified handler for each\n * integration step.\n *\n * <p>This mode is used when the user needs random access to the orbit state at any\n * time between the initial and target times, as well as access to the steps computed\n * by the integrator as in Master Mode. A typical example is the implementation of\n * search and iterative algorithms that may navigate forward and backward inside the\n * propagation range before finding their result.</p>\n *\n * <p>Beware that since this mode stores <strong>all</strong> intermediate results, it\n * may be memory intensive for long integration ranges and high precision/short time\n * steps.</p>\n *\n * @param handler handler called at the end of each finalized step\n * @see #setEphemerisMode()\n * @see #getGeneratedEphemeris()\n * @see #setSlaveMode()\n * @see #setMasterMode(double, OrekitFixedStepHandler)\n * @see #setMasterMode(OrekitStepHandler)\n * @see #getMode()\n * @see #EPHEMERIS_GENERATION_MODE\n */\n void setEphemerisMode(OrekitStepHandler handler);\n\n /** Get the ephemeris generated during propagation.\n * @return generated ephemeris\n * @exception IllegalStateException if the propagator was not set in ephemeris\n * generation mode before propagation\n * @see #setEphemerisMode()\n */\n BoundedPropagator getGeneratedEphemeris() throws IllegalStateException;\n\n /** Get the propagator initial state.\n * @return initial state\n * @exception OrekitException if state cannot be retrieved\n */\n SpacecraftState getInitialState() throws OrekitException;\n\n /** Reset the propagator initial state.\n * @param state new initial state to consider\n * @exception OrekitException if initial state cannot be reset\n */\n void resetInitialState(SpacecraftState state)\n throws OrekitException;\n\n /** Add a set of user-specified state parameters to be computed along with the orbit propagation.\n * @param additionalStateProvider provider for additional state\n * @exception OrekitException if an additional state with the same name is already present\n */\n void addAdditionalStateProvider(AdditionalStateProvider additionalStateProvider)\n throws OrekitException;\n\n /** Get an unmodifiable list of providers for additional state.\n * @return providers for the additional states\n */\n List<AdditionalStateProvider> getAdditionalStateProviders();\n\n /** Check if an additional state is managed.\n * <p>\n * Managed states are states for which the propagators know how to compute\n * its evolution. They correspond to additional states for which an\n * {@link AdditionalStateProvider additional state provider} has been registered\n * by calling the {@link #addAdditionalStateProvider(AdditionalStateProvider)\n * addAdditionalStateProvider} method. If the propagator is an {@link\n * org.orekit.propagation.integration.AbstractIntegratedPropagator integrator-based\n * propagator}, the states for which a set of {@link\n * org.orekit.propagation.integration.AdditionalEquations additional equations} has\n * been registered by calling the {@link\n * org.orekit.propagation.integration.AbstractIntegratedPropagator#addAdditionalEquations(\n * org.orekit.propagation.integration.AdditionalEquations) addAdditionalEquations}\n * method are also counted as managed additional states.\n * </p>\n * <p>\n * Additional states that are present in the {@link #getInitialState() initial state}\n * but have no evolution method registered are <em>not</em> considered as managed states.\n * These unmanaged additional states are not lost during propagation, though. Their\n * value will simply be copied unchanged throughout propagation.\n * </p>\n * @param name name of the additional state\n * @return true if the additional state is managed\n */\n boolean isAdditionalStateManaged(String name);\n\n /** Get all the names of all managed states.\n * @return names of all managed states\n */\n String[] getManagedAdditionalStates();\n\n /** Add an event detector.\n * @param detector event detector to add\n * @see #clearEventsDetectors()\n * @see #getEventsDetectors()\n * @param <T> class type for the generic version\n */\n <T extends EventDetector> void addEventDetector(T detector);\n\n /** Get all the events detectors that have been added.\n * @return an unmodifiable collection of the added detectors\n * @see #addEventDetector(EventDetector)\n * @see #clearEventsDetectors()\n */\n Collection<EventDetector> getEventsDetectors();\n\n /** Remove all events detectors.\n * @see #addEventDetector(EventDetector)\n * @see #getEventsDetectors()\n */\n void clearEventsDetectors();\n\n /** Get attitude provider.\n * @return attitude provider\n */\n AttitudeProvider getAttitudeProvider();\n\n /** Set attitude provider.\n * @param attitudeProvider attitude provider\n */\n void setAttitudeProvider(AttitudeProvider attitudeProvider);\n\n /** Get the frame in which the orbit is propagated.\n * <p>\n * The propagation frame is the definition frame of the initial\n * state, so this method should be called after this state has\n * been set, otherwise it may return null.\n * </p>\n * @return frame in which the orbit is propagated\n * @see #resetInitialState(SpacecraftState)\n */\n Frame getFrame();\n\n /** Propagate towards a target date.\n * <p>Simple propagators use only the target date as the specification for\n * computing the propagated state. More feature rich propagators can consider\n * other information and provide different operating modes or G-stop\n * facilities to stop at pinpointed events occurrences. In these cases, the\n * target date is only a hint, not a mandatory objective.</p>\n * @param target target date towards which orbit state should be propagated\n * @return propagated state\n * @exception OrekitException if state cannot be propagated\n */\n SpacecraftState propagate(AbsoluteDate target) throws OrekitException;\n\n /** Propagate from a start date towards a target date.\n * <p>Those propagators use a start date and a target date to\n * compute the propagated state. For propagators using event detection mechanism,\n * if the provided start date is different from the initial state date, a first,\n * simple propagation is performed, without processing any event computation.\n * Then complete propagation is performed from start date to target date.</p>\n * @param start start date from which orbit state should be propagated\n * @param target target date to which orbit state should be propagated\n * @return propagated state\n * @exception OrekitException if state cannot be propagated\n */\n SpacecraftState propagate(AbsoluteDate start, AbsoluteDate target) throws OrekitException;\n\n}", "public double getUniformMutationRatio(){\n return delta;\n }", "private void mutate() {\n\t\tfor (int i = 0; i < population; ++i) {\n\t\t\tpopulationArray.set(i, populationArray.get(i).generateNeighbor());\n\t\t}\n\t}", "void mutate() {\r\n\t\tif (Math.random() < TSP.p_mutate) {\r\n\t\t\t// randomly flip two cities\r\n\t\t\trndSwapTwo();\r\n\t\t\tthis.distance = distance();\r\n\t\t}\r\n\t}", "static private DecisionTree buildTree(ItemSet learningSet, \n\t\t\t\t\t AttributeSet testAttributes, \n\t\t\t\t\t SymbolicAttribute goalAttribute) {\n\tDecisionTreeBuilder builder = \n\t new DecisionTreeBuilder(learningSet, testAttributes,\n\t\t\t\t goalAttribute);\n\t\n\treturn builder.build();\n }" ]
[ "0.5898118", "0.5822275", "0.56864727", "0.5656126", "0.5629546", "0.5531276", "0.5492567", "0.5411089", "0.5315542", "0.518904", "0.51503253", "0.51279974", "0.50441074", "0.4973278", "0.4948759", "0.49392736", "0.4928467", "0.49180517", "0.4910082", "0.48961246", "0.48524657", "0.48115653", "0.48103273", "0.48057908", "0.47871897", "0.47688255", "0.47622827", "0.46530277", "0.46115273", "0.45982745", "0.45793083", "0.4568599", "0.45573765", "0.454815", "0.45403722", "0.45106906", "0.45102897", "0.4487444", "0.4454725", "0.44384047", "0.4427822", "0.4422419", "0.4417601", "0.44123733", "0.44084138", "0.43770456", "0.43735763", "0.4372339", "0.43693763", "0.4350394", "0.43319356", "0.4325207", "0.43160138", "0.43126053", "0.42919895", "0.42794636", "0.4272981", "0.42691708", "0.4255952", "0.42265147", "0.42086697", "0.42003483", "0.41808107", "0.41788107", "0.41760987", "0.41679126", "0.41656747", "0.41629362", "0.41497838", "0.4146116", "0.41427892", "0.413366", "0.41203636", "0.41203636", "0.41156942", "0.41129243", "0.41121465", "0.41064513", "0.40951145", "0.40940377", "0.409326", "0.40913075", "0.4081348", "0.40763834", "0.40698138", "0.40663335", "0.40558016", "0.40558016", "0.40503526", "0.40493158", "0.40477175", "0.40444195", "0.4026334", "0.40216288", "0.4019591", "0.40142992", "0.400616", "0.39961112", "0.39939347", "0.39788404" ]
0.60760254
0
Applies mutation functions to the tree, depending on the tree's fitness characteristics and the provided probabilities
public NAryTree apply(NAryTree tree, Random rng) { if (rng.nextDouble() > chanceOfRandomMutation) { //DO A SMART MUTATION NAryTree mutatedTree; boolean changed = false; int nrTries = 0; TreeMutationAbstract mutator; do { mutator = getSmartMutatorForChance(rng.nextDouble() * totalChanceSmart); mutatedTree = mutator.mutate(tree); changed = mutator.changedAtLastCall(); nrTries++; this.locationOfLastChange = mutator.locationOfLastChange; this.typeOfChange = mutator.typeOfChange; //FIXME problem with the smart mutator, it always says that the individual changed, even when it didn't. if (nrTries > 2 && changed == false) { //Going dumb... We tried to be smart long enough return applyDumb(tree, rng); } } while (!changed); assert mutatedTree.isConsistent(); return mutatedTree; } else { //DELEGATE TO DUMB COORDINATOR return applyDumb(tree, rng); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void mutate(float probability) {\r\n\r\n individual[] temp_pop = new individual[this.pop_size];\r\n\r\n for (int i = 0; i < this.pop_size; i++) {\r\n\r\n float temp_genes[] = this.offspring_population.getPopulation()[i].getGenes();\r\n\r\n // mutation can now mutate wild cards\r\n for (int j = 0; j < temp_genes.length; j++) {\r\n float k = new Random().nextFloat();\r\n\r\n if (k <= probability) {\r\n float temp = new Random().nextFloat();\r\n temp_genes[j] = temp; // add a float between 0-1 // just mutate a new float\r\n }\r\n }\r\n individual child = new individual(temp_genes, solutions, output);\r\n temp_pop[i] = child;\r\n }\r\n this.main_population.setPopulation(temp_pop);\r\n this.main_population.update_population();\r\n }", "public static void setMutationProbability(double value) { mutationProbability = value; }", "@Override\n\t public Node apply(Node gen) {\n\t\t gen = gen.clone(null);\n\t\t int n = gen.weight();\n\t\t int m = (int)(Math.random()*n);\n\t\t Node mutate_node = gen.get(m);\n\t\t int x = (int)(Math.random()*codes.length);\n\t\t mutate_node.oper = codes[x];\n\t\t return gen;\n\t }", "public void setProbabilites(String name, double[] probabilities) \r\n\t\t\tthrows JayesException{\r\n\t\t// checks if new node\r\n\t\tif (! nodeExists(name)) {\r\n\t\t\tthrow new JayesException(\"Node '\" + name + \"' does not exist.\");\r\n\t\t}\r\n\t\tBayesNode node = getNode(name);\r\n\t\tint prob = probabilities.length;\r\n\t\tint expected = node.getOutcomeCount();\r\n\t\tfor (BayesNode n:node.getParents()){\t\t\t\r\n\t\t\texpected *= n.getOutcomeCount();\r\n\t\t}\r\n\t\tif (expected != prob) {\r\n\t\t\tthrow new JayesException(\"Incorrect number of probabilities for '\" + name + \r\n\t\t\t\t\t\"' (Expected \" + expected + \", Given \" + prob + \").\");\r\n\t\t}\r\n\t\t// save the cpt\r\n\t\tnode.setProbabilities(probabilities);\r\n\t}", "public void fitnessFunction()\n\t{\n\t\t\n\t}", "@Override\n public double proposal() {\n Tree tree = treeInput.get();\n\n Node node;\n if (useNodeNumbers) {\n int leafNodeCount = tree.getLeafNodeCount();\n int i = Randomizer.nextInt(leafNodeCount);\n node = tree.getNode(i);\n } else {\n int i = Randomizer.nextInt(taxonIndices.length);\n node = tree.getNode(taxonIndices[i]);\n }\n\n double value = node.getHeight();\n\n if (value == 0.0) {\n return Double.NEGATIVE_INFINITY;\n }\n double newValue = value;\n\n boolean drawFromDistribution = samplingDateTaxonNames.contains(node.getID());\n if (drawFromDistribution) {\n SamplingDate taxonSamplingDate = samplingDatesInput.get().get(samplingDateTaxonNames.indexOf(node.getID()));\n double range = taxonSamplingDate.getUpper() - taxonSamplingDate.getLower();\n newValue = taxonSamplingDate.getLower() + Randomizer.nextDouble() * range;\n } else {\n if (useGaussian) {\n newValue += Randomizer.nextGaussian() * windowSize;\n } else {\n newValue += Randomizer.nextDouble() * 2 * windowSize - windowSize;\n }\n }\n\n\n Node fake = null;\n double lower, upper;\n\n if (((ZeroBranchSANode)node).isDirectAncestor()) {\n fake = node.getParent();\n lower = getOtherChild(fake, node).getHeight();\n if (fake.getParent() != null) {\n upper = fake.getParent().getHeight();\n } else upper = Double.POSITIVE_INFINITY;\n } else {\n //lower = Double.NEGATIVE_INFINITY;\n lower = 0.0;\n upper = node.getParent().getHeight();\n }\n\n if (newValue < lower || newValue > upper) {\n return Double.NEGATIVE_INFINITY;\n }\n\n if (newValue == value) {\n // this saves calculating the posterior\n return Double.NEGATIVE_INFINITY;\n }\n\n if (fake != null) {\n fake.setHeight(newValue);\n }\n node.setHeight(newValue);\n\n if (newValue < 0) {\n for (int i=0; i<tree.getNodeCount(); i++){\n double oldHeight = tree.getNode(i).getHeight();\n tree.getNode(i).setHeight(oldHeight-newValue);\n }\n } else {\n boolean dateShiftDown = true;\n for (int i=0; i< tree.getLeafNodeCount(); i++){\n if (tree.getNode(i).getHeight() == 0){\n dateShiftDown = false;\n break;\n }\n }\n if (dateShiftDown) {\n ArrayList<Double> tipNodeHeights= new ArrayList<Double>();\n for (int i=0; i<tree.getLeafNodeCount(); i++){\n tipNodeHeights.add(tree.getNode(i).getHeight());\n }\n Collections.sort(tipNodeHeights);\n double shiftDown = tipNodeHeights.get(0);\n for (int i=0; i<tree.getNodeCount(); i++){\n double oldHeight = tree.getNode(i).getHeight();\n tree.getNode(i).setHeight(oldHeight-shiftDown);\n }\n }\n }\n\n boolean check = true;\n for (int i=0; i<tree.getNodeCount(); i++){\n if (tree.getNode(i).getHeight() < 0) {\n System.out.println(\"Negative height found\");\n System.exit(0);\n }\n if (tree.getNode(i).getHeight() == 0) {\n check = false;\n }\n }\n if (check) {\n System.out.println(\"There is no 0 height node\");\n System.exit(0);\n }\n\n //tree.setEverythingDirty(true);\n\n return 0.0;\n }", "public void doMutation(double probability, Solution solution) throws JMException {\n try {\n //Gene part\n int length = ((Binary) solution.getDecisionVariables()[0]).getNumberOfBits();\n for (int j = 0; j < length - 12; j++) {\n if (PseudoRandom.randDouble() < probability) {\n ((Binary) solution.getDecisionVariables()[0]).bits_.flip(j);\n }\n }\n //Condition Part\n if (PseudoRandom.randDouble() < 0.1) {\n for (int j = length - 12; j < length; j++) {\n int c = 0;\n for (int i = length - 12; i < length; i++) {\n if (((Binary) solution.getDecisionVariables()[0]).bits_.get(i) ) {\n c++;\n }\n }\n if (c > 1)\n ((Binary) solution.getDecisionVariables()[0]).bits_.flip(j);\n }\n }\n\n for (int i = 0; i < solution.getDecisionVariables().length; i++) {\n ((Binary) solution.getDecisionVariables()[i]).decode();\n }\n } catch (ClassCastException e1) {\n Configuration.logger_.severe(\"BitFlipMutation.doMutation: \" +\n \"ClassCastException error\" + e1.getMessage());\n Class cls = java.lang.String.class;\n String name = cls.getName();\n throw new JMException(\"Exception in \" + name + \".doMutation()\");\n }\n }", "private void modifyIndividuals(){\n for(AbstractBehaviour behaviour: entityBehaviours){\n JSONObject jsonPop = null;\n GeneticInterface gi = interfaceMap.get(behaviour);\n try {\n jsonPop = gi.receiveNewPopulation();\n } catch (IOException e) {\n e.printStackTrace();\n }\n for(String key: jsonPop.keySet()){\n JSONArray funArray = jsonPop.getJSONObject(key).getJSONArray(\"functions\");\n List<Function> functions = new LinkedList<>();\n for(int a = 0; a <funArray.length(); a++){\n String tree = funArray.getString(a);\n Function functionTree = Node.treeFromString(tree, behaviour.getNumberOfInputs());\n functions.add(functionTree);\n }\n behaviour.setEntityByName(key, functions);\n }\n behaviour.resetEntities();\n }\n }", "private void uniformMutation(){\n Random random = new Random();\n double newValue = random.nextGaussian()*16.6 + 50.0;\n if(newValue < 0) newValue = 0;\n if(newValue > 100) newValue = 100;\n int gene = random.nextInt(6);\n switch (gene){\n case 0 : this.x1 = newValue; break;\n case 1 : this.x2 = newValue; break;\n case 2 : this.x3 = newValue; break;\n case 3 : this.y1 = newValue; break;\n case 4 : this.y2 = newValue; break;\n case 5 : this.y3 = newValue; break;\n }\n }", "public void mutate(float mutationProbability, float connectionMutationProbability, float mutationFactor) {\r\n for (int i = 1; i < neurons.length; i++) // layers (skip input layer)\r\n {\r\n for (int j = 0; j < neurons[i].length; j++) // neurons per layer\r\n {\r\n if (Math.random() <= mutationProbability) {\r\n neurons[i][j].setWeights(neurons[i][j].getMutatedWeights(connectionMutationProbability, mutationFactor));\r\n }\r\n }\r\n }\r\n }", "private void evaluateProbabilities()\n\t{\n\t}", "public static void mutation(Individual[] individuals) {\n for (int i = 0; i < POP_SIZE; i++) {\n for (int j = 0; j < GENE_SIZE; j++) {\n double randomNum = Math.random();\n if (randomNum < MUTATION_RATE) {\n randomNum = Math.random();\n ArrayList<String> bitsList = (ArrayList<String>) bits.clone();\n for (int g = 0; g < bitsList.size(); g++) {\n if (individuals[i].gene[j].equals(bitsList.get(g))) {\n String bit = bitsList.get(g);\n bitsList.remove(g);\n int index;\n if (randomNum < 0.5) {\n index = 0;\n } else {\n index = 1;\n }\n individuals[i].gene[j] = bitsList.get(new Random().nextInt(2));\n bitsList.add(bit);\n }\n }\n }\n }\n individuals[i].generateRulebase();\n }\n matingPool = Arrays.copyOf(individuals, individuals.length);\n }", "protected void mutateWeights() {\n\t\t// TODO: Change the way weight mutation works\n\t\tif (Braincraft.gatherStats) {\n\t\t\tArrayList<Integer> mutatedgenes = new ArrayList<Integer>();\n\t\t\tfor (Gene g : genes.values()) {\n\t\t\t\tif (Braincraft.randomChance(population.perWeightMutationRate)) {\n\t\t\t\t\tg.weight = Braincraft.randomWeight();\n\t\t\t\t\tmutatedgenes.add(g.innovation);\n\t\t\t\t}\n\t\t\t}\n\t\t\tString output = \"weight mutation \" + ID;\n\t\t\tfor (Integer i : mutatedgenes) {\n\t\t\t\toutput += \" \" + i;\n\t\t\t}\n\t\t\tBraincraft.genetics.add(output);\n\t\t} else {\n\t\t\tfor (Gene g : genes.values()) {\n\t\t\t\tif (Braincraft.randomChance(population.perWeightMutationRate))\n\t\t\t\t\tg.weight = Braincraft.randomWeight();\n\t\t\t}\n\t\t}\n\t\t// TODO: Report weight mutations to stats\n\t}", "private static void mating() {\n\t\tint getRand = 0;\n\t\tint parentA = 0;\n\t\tint parentB = 0;\n\t\tint newIndex1 = 0;\n\t\tint newIndex2 = 0;\n\t\tChromosome newChromo1 = null;\n\t\tChromosome newChromo2 = null;\n\n\t\tfor (int i = 0; i < OFFSPRING_PER_GENERATION; i++) {\n\t\t\tparentA = chooseParent();\n\t\t\t// Test probability of mating.\n\t\t\tgetRand = getRandomNumber(0, 100);\n\t\t\tif (getRand <= MATING_PROBABILITY * 100) {\n\t\t\t\tparentB = chooseParent(parentA);\n\t\t\t\tnewChromo1 = new Chromosome();\n\t\t\t\tnewChromo2 = new Chromosome();\n\t\t\t\tpopulation.add(newChromo1);\n\t\t\t\tnewIndex1 = population.indexOf(newChromo1);\n\t\t\t\tpopulation.add(newChromo2);\n\t\t\t\tnewIndex2 = population.indexOf(newChromo2);\n\n\t\t\t\t// Choose either, or both of these:\n\t\t\t\tpartiallyMappedCrossover(parentA, parentB, newIndex1, newIndex2);\n\t\t\t\t// positionBasedCrossover(parentA, parentB, newIndex1, newIndex2);\n\n\t\t\t\tif (childCount - 1 == nextMutation) {\n\t\t\t\t\texchangeMutation(newIndex1, 1);\n\t\t\t\t} else if (childCount == nextMutation) {\n\t\t\t\t\texchangeMutation(newIndex2, 1);\n\t\t\t\t}\n\n\t\t\t\tpopulation.get(newIndex1).computeConflicts();\n\t\t\t\tpopulation.get(newIndex2).computeConflicts();\n\n\t\t\t\tchildCount += 2;\n\n\t\t\t\t// Schedule next mutation.\n\t\t\t\tif (childCount % (int) Math.round(1.0 / MUTATION_RATE) == 0) {\n\t\t\t\t\tnextMutation = childCount + getRandomNumber(0, (int) Math.round(1.0 / MUTATION_RATE));\n\t\t\t\t}\n\t\t\t}\n\t\t} // i\n\t\treturn;\n\t}", "public static double getMutationProbability() { return mutationProbability; }", "private static Set<Chromosome> mutatePopulation(Set<Chromosome> population, double mutationRate) {\n Set<Chromosome> mutatedChromosomes = new HashSet<>(population);\n\n for (Chromosome path : mutatedChromosomes) {\n double mutationProbability = ThreadLocalRandom.current().nextDouble();\n if (mutationProbability > (1-mutationRate)) {\n // mutate the path using the RSM mutation operator\n mutateRoute(path);\n // indicate that the fitness of this path needs to be recalculated\n path.fitness = -1;\n }\n }\n\n // The set will most probably include certain chromosomes which are already present in the set of children\n // however, given that both are sets, any duplicates will be discarded\n return mutatedChromosomes;\n }", "@Override\r\n public Pair<DeepTree, DeepTree> process(Tree tree) {\n\r\n IdentityHashMap<Tree, SimpleMatrix> goldVectors = new IdentityHashMap<Tree, SimpleMatrix>();\r\n double scoreGold = score(tree, goldVectors);\r\n DeepTree bestTree = getHighestScoringTree(tree, TRAIN_LAMBDA);\r\n DeepTree goldTree = new DeepTree(tree, goldVectors, scoreGold);\r\n return Pair.makePair(goldTree, bestTree);\r\n }", "public void calculateProbabilities(){\n\t}", "void setFitness(double fitness) throws UnsupportedOperationException;", "private static void calculateFitnessOfPopulation(ArrayList<Chromosome> population) {\n for (Chromosome chromosome : population) {\n // if the fitness of the chromosome has not yet been calculated (i.e. is still -1)\n fitnessFunction(chromosome);\n }\n }", "public static <T>void pruning(Individual<String, T> individual, GEMapper mapper, double pruningProbability) {\n\t\t\n\t\tStringBuilder genome = new StringBuilder(individual.getGenotype().value());\n\t\tpruning(genome, mapper, pruningProbability);\n\t\tindividual.getGenotype().setValue(genome.toString());\t\t\t\n\t\t\n\t}", "@Override\n\tpublic void applyMutation(int index, double a_percentage) {\n\n\t}", "public void setProbMut(double d){\n if ((d < 0) || (d > 1)){\n throw new IllegalArgumentException(\"Mutation probability cannot be less than 0 or greater than 1.\");\n }\n mutationProb = d;\n }", "private static double fitness(PMCGenotype gene, int trials)\n\t{\n\t\tController<MOVE> btc = new PacManBTController(decode(gene));\n\t\treturn runExperiment(btc, ghostController, trials);\n\t}", "private void mutateHelper() {\n\t\tsynchronized (this) {\n\t\t\tRandom rand = new Random();\n\t\t\tint mutateType = rand.nextInt(5);\n\t\t\tif (rules.size() >= 14) {\n\t\t\t\tmutateType = rand.nextInt(6);\n\t\t\t}\n\t\t\tint index = rand.nextInt(rules.size());\n\t\t\tMutation m = null;\n\t\t\tswitch (mutateType) {\n\t\t\tcase 0:\n\t\t\t\tm = MutationFactory.getDuplicate();\n\t\t\t\tm.addRules(rules.root);\n\t\t\t\tm.mutate(index);\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tm = MutationFactory.getInsert();\n\t\t\t\tm.addRules(rules.root);\n\t\t\t\tm.mutate(index);\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\tm = MutationFactory.getRemove();\n\t\t\t\tm.addRules(rules.root);\n\t\t\t\tm.mutate(index);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tm = MutationFactory.getReplace();\n\t\t\t\tm.addRules(rules.root);\n\t\t\t\tm.mutate(index);\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tm = MutationFactory.getSwap();\n\t\t\t\tm.addRules(rules.root);\n\t\t\t\tm.mutate(index);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tm = MutationFactory.getTransform();\n\t\t\t\tm.addRules(rules.root);\n\t\t\t\tm.mutate(index);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic void mutation() {\r\n\t\tfinal double MUTATION_PROB = 0.1;\r\n\t\tfor (int i=0; i<this.nChromosomes; i++) {\r\n\t\t\tArrayList<Integer> chr = (ArrayList<Integer>) this.chromosomes.get(i);\r\n\t\t\tfor (int j=0; j<this.nViaPoints; j++) {\r\n\t\t\t\tdouble rand = Math.random();\r\n\t\t\t\tif (rand < MUTATION_PROB) {\r\n\t\t\t\t\t// change the sign\r\n\t\t\t\t\tInteger vPoint = chr.get(j);\r\n\t\t\t\t\tchr.remove(j);\r\n\t\t\t\t\tchr.add(j, new Integer(- (vPoint.intValue()%100)));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.printChromosomes(\"After Mutation\");\r\n\t}", "private void buildProbTree() {\n\t\tif (probArray_ == null)\n\t\t\tprobArray_ = new double[elementArray_.length];\n\t\t// Iterate through the items\n\t\tdouble sumProb = 0;\n\t\tfor (int i = 0; i < elementArray_.length; i++) {\n\t\t\tif (sumProb >= 1)\n\t\t\t\tbreak;\n\n\t\t\tsumProb += itemProbs_.get(elementArray_[i]);\n\t\t\tprobArray_[i] = sumProb;\n\t\t}\n\t\trebuildProbs_ = false;\n\t}", "public SO_Mutation(HashMap<String, Object> parameters) {\n super(parameters);\n if (parameters.get(\"probability\") != null)\n mutationProbability_ = (Double) parameters.get(\"probability\");\n }", "public abstract Chromosome mutation(Chromosome child);", "@Override\n public void mutate(Chromosome c) {\n if (c.getFitness() == 0) return;\n\n boolean[] genes = c.getGenes();\n int weight = c.getWeight();\n\n for (int i = 0; i < genes.length; i++) {\n if (weight == Config.CAPACITY) break;\n\n if (!genes[i]) {\n if (weight + Config.ITEMS[i].getWeight() <= Config.CAPACITY) {\n c.flipGene(i);\n }\n }\n }\n \n }", "@Test\r\n\tpublic final void testCross() throws GeneticProgrammingException {\r\n\t\tfinal int[] training = TestHelper.genertateTrainingDataSet(-100, 100);\r\n\t\tfinal double[] targetValues = TestHelper.calculateTargetValues(\r\n\t\t\t\t\"x*2-1/2\", training);\r\n\t\tfinal Node root = new Node(null, \"/\", null, Node.OPERATOR);\r\n\t\tfinal Tree newTree = new Tree(root, new TerminalSet(),\r\n\t\t\t\tnew FunctionalSet());\r\n\t\tfinal Node minusOperator = new Node(root, \"-\", Node.LEFT, Node.OPERATOR);\r\n\t\tnewTree.addNode(minusOperator);\r\n\t\tfinal Node multiOperator = new Node(root, \"*\", Node.RIGHT,\r\n\t\t\t\tNode.OPERATOR);\r\n\t\tnewTree.addNode(multiOperator);\r\n\t\tnewTree.addNode(new Node(minusOperator, \"1\", Node.LEFT, Node.OPERAND));\r\n\t\tnewTree.addNode(new Node(minusOperator, \"3\", Node.RIGHT, Node.OPERAND));\r\n\t\tnewTree.addNode(new Node(multiOperator, \"x\", Node.LEFT, Node.OPERAND));\r\n\t\tnewTree.addNode(new Node(multiOperator, \"5\", Node.RIGHT, Node.OPERAND));\r\n\t\tassertEquals(\"Tree did not get generated corectly\", \"(1-3)/(x*5)\",\r\n\t\t\t\tnewTree.getEquation().toString());\r\n\t\tfinal Node root2 = new Node(null, \"/\", null, Node.OPERATOR);\r\n\t\tfinal Tree newTree2 = new Tree(root2, new TerminalSet(),\r\n\t\t\t\tnew FunctionalSet());\r\n\t\tfinal Node minusOperator2 = new Node(root2, \"-\", Node.LEFT,\r\n\t\t\t\tNode.OPERATOR);\r\n\t\tnewTree2.addNode(minusOperator2);\r\n\t\tfinal Node multiOperator2 = new Node(root2, \"*\", Node.RIGHT,\r\n\t\t\t\tNode.OPERATOR);\r\n\t\tnewTree2.addNode(multiOperator2);\r\n\t\tnewTree2\r\n\t\t\t\t.addNode(new Node(minusOperator2, \"x\", Node.LEFT, Node.OPERAND));\r\n\t\tnewTree2\r\n\t\t\t\t.addNode(new Node(minusOperator2, \"7\", Node.RIGHT, Node.OPERAND));\r\n\t\tnewTree2\r\n\t\t\t\t.addNode(new Node(multiOperator2, \"8\", Node.LEFT, Node.OPERAND));\r\n\t\tnewTree2\r\n\t\t\t\t.addNode(new Node(multiOperator2, \"9\", Node.RIGHT, Node.OPERAND));\r\n\t\tassertEquals(\"Tree did not get generated corectly\", \"(x-7)/(8*9)\",\r\n\t\t\t\tnewTree2.getEquation().toString());\r\n\r\n\t\tfinal Node root3 = new Node(null, \"/\", null, Node.OPERATOR);\r\n\t\tfinal Tree newTree3 = new Tree(root3, new TerminalSet(),\r\n\t\t\t\tnew FunctionalSet());\r\n\t\tfinal Node minusOperator3 = new Node(root3, \"-\", Node.LEFT,\r\n\t\t\t\tNode.OPERATOR);\r\n\t\tnewTree3.addNode(minusOperator3);\r\n\t\tfinal Node multiOperator3 = new Node(root3, \"*\", Node.RIGHT,\r\n\t\t\t\tNode.OPERATOR);\r\n\t\tnewTree3.addNode(multiOperator3);\r\n\t\tfinal Node multiOperator4 = new Node(multiOperator3, \"*\", Node.LEFT,\r\n\t\t\t\tNode.OPERATOR);\r\n\t\tnewTree3.addNode(multiOperator4);\r\n\t\tfinal Node multiOperator5 = new Node(multiOperator3, \"*\", Node.RIGHT,\r\n\t\t\t\tNode.OPERATOR);\r\n\t\tnewTree3.addNode(multiOperator5);\r\n\t\tnewTree3\r\n\t\t\t\t.addNode(new Node(minusOperator3, \"x\", Node.LEFT, Node.OPERAND));\r\n\t\tnewTree3\r\n\t\t\t\t.addNode(new Node(minusOperator3, \"7\", Node.RIGHT, Node.OPERAND));\r\n\t\tnewTree3\r\n\t\t\t\t.addNode(new Node(multiOperator4, \"1\", Node.LEFT, Node.OPERAND));\r\n\t\tnewTree3\r\n\t\t\t\t.addNode(new Node(multiOperator4, \"2\", Node.RIGHT, Node.OPERAND));\r\n\t\tnewTree3\r\n\t\t\t\t.addNode(new Node(multiOperator5, \"3\", Node.LEFT, Node.OPERAND));\r\n\t\tnewTree3\r\n\t\t\t\t.addNode(new Node(multiOperator5, \"4\", Node.RIGHT, Node.OPERAND));\r\n\t\tassertEquals(\"Tree did not get generated corectly\",\r\n\t\t\t\t\"(x-7)/(1*2)*(3*4)\", newTree3.getEquation().toString());\r\n\t\tfinal ArrayList<Tree> newTrees = new ArrayList<Tree>();\r\n\t\tnewTrees.add(newTree3);\r\n\t\tnewTrees.add(newTree2);\r\n\t\tnewTrees.add(newTree);\r\n\t\tassertEquals(\"Tree should have a size of 3 before the cross\", 3,\r\n\t\t\t\tnewTrees.size());\r\n\t\tCrossover.cross(newTrees, 1, 100, training, targetValues);\r\n\t\tfinal Iterator<Tree> iterator = newTrees.iterator();\r\n\t\twhile (iterator.hasNext()) {\r\n\t\t\t// All five trees should be different\r\n\t\t\tfinal String firstTree = iterator.next().toString();\r\n\t\t\tassertNotSame(\"Cross should change the tree but did not 1\",\r\n\t\t\t\t\tfirstTree, iterator.next().toString());\r\n\t\t\tassertNotSame(\"Cross should change the tree but did not 2\",\r\n\t\t\t\t\tfirstTree, iterator.next().toString());\r\n\t\t\tassertNotSame(\"Cross should change the tree but did not 3\",\r\n\t\t\t\t\tfirstTree, iterator.next().toString());\r\n\t\t\tassertNotSame(\"Cross should change the tree but did not 4\",\r\n\t\t\t\t\tfirstTree, iterator.next().toString());\r\n\t\t}\r\n\t\t// should be 5 trees after the crossover\r\n\t\tassertEquals(\"Tree should have a size of 5 but was not\", 5, newTrees\r\n\t\t\t\t.size());\r\n\t}", "private Vector step(){\n// System.out.println();\n// System.out.println(generationCount);\n// System.out.println(\"The Population is:\");\n// System.out.println(population);\n \n //DETERMINE WHO SURVIVES INTO NEXT GENERATION\n Vector nextGeneration = surviveType.run(population, fitnessArray);\n\n //DO THE CROSSOVER PROCESS\n //WHILE THE NEXT GENERATION ISN'T FULL\n while (nextGeneration.size() < (populationSize - randGenes)){\n //FIND PARENTS\n Gene parentOne, parentTwo;\n do {\n Gene[] parents = selectType.run(population, fitnessArray);\n parentOne = parents[0];\n parentTwo = parents[1];\n } while (selectPairs && (! closeEnough(parentOne, parentTwo)));\n //ADD CHILDREN\n Gene[] kids = crossType.children(parentOne, parentTwo);\n\n nextGeneration.add(kids[0]);\n if (nextGeneration.size() < (populationSize - randGenes)){\n nextGeneration.add(kids[1]);\n }\n }\n //ADD RANDOM GENES TO THE POPULATION\n while (nextGeneration.size() < populationSize){\n nextGeneration.add(initializer.createRandomGene(fitnessFunction, minRadius, maxRadius));\n }\n //MUTATE THE NEXT GENERATION\n for (int j = 0; j < populationSize; j++){\n if (Math.random() < mutationProb){\n nextGeneration.set(j, mutationType.run((Gene) nextGeneration.get(j)));\n }\n }\n\n //COMPUTE FITNESSES AND RELOCATE IF NECESSARY\n Gene bestGene = (Gene) nextGeneration.get(0);\n int bestX = 0;\n for (int x = 0; x < populationSize; x++){\n Gene next = (Gene) nextGeneration.get(x);\n while (relocationType.move(bannedList, next)){\n Gene newGene = initializer.createRandomGene(fitnessFunction, minRadius, maxRadius);\n next = newGene;\n nextGeneration.set(x, next);\n }\n fitnessArray[x] = next.getFitness();\n\n //FOR THE PURPOSES OF UPDATING THE BANNED LIST\n if (next.getFitness() > bestGene.getFitness()){\n bestGene = next;\n bestX = x;\n }\n } //End for (int x = 0;...\n\n Arrays.sort(fitnessArray);\n\n //UPDATE THE BANNED LIST BY ADDING THE BEST GENE IN THE NEXT GENERATION IF IT'S ABOVE minAccepted AND CONTAINS MORE THAN minPoints POINTS\n if (useList){\n if ((generationCount >= firstAdd) &&\n (solutionCounter >= countNum) &&\n (bestGene.getFitness() >= minAccepted) &&\n (bestGene.getCount() >= minPoints)){\n solutionCounter = 0;\n// System.out.println(bestGene);\n Gene bestClone = new Gene (bestGene.getMajorAxisRadius(), //THIS KLUDGE IS DONE B/C .clone() IS\n bestGene.getMinorAxisRadius(), //PROTECTED, AND I CAN'T UNPROTECT IT.\n bestGene.getX(), //I USE A CLONED GENE TO PREVENT A MUTATION\n bestGene.getY(), //IN THE NEXT GENERATION FROM ALTERING bannedList\n bestGene.getOrientation(),\n bestGene.getFunction());\n bannedList = relocationType.updateBannedList(bannedList, bestClone);\n\n\n //IF NECESSARY, UPDATE THE SOLUTION LIST BY ADDING ALL CLUSTERS WITH MORE THAN minPoints POINTS AND A FITNESS OF AT LEAST minAccepted\n if (returnAllSolutions){\n for (int i = 0; i < populationSize; i++){\n Gene next = (Gene) nextGeneration.get(i);\n if ((next.getFitness() >= minAccepted) && (next.getCount() >= minPoints)){\n solutionList.add(next);\n }\n }//End for (int i = 0...\n } else {\n solutionList = bannedList;\n } //End if (returnAllSolutions){...}else{\n } //End if (generationCount > 4...\n } //End if (useList){\n\n generationCount = generationCount + 1;\n solutionCounter = solutionCounter + 1;\n\n //IF AVOIDING CONVERGENCE, AND IT HAS CONVERGED, START OVER WITH RANDOM GENES\n\n double bestFitness = bestGene.getFitness();\n double medianFitness = roundToHundredths((double) fitnessArray[(int) Math.floor(populationSize / 2)]);\n\n// System.out.println(bestFitness);\n// System.out.println(medianFitness);\n\n if ((antiConvergence) &&\n ((bestFitness - medianFitness) < (0.01 * bestFitness)) &&\n (generationCount > firstAdd)){\n nextGeneration = initializer.getGenes(populationSize, fitnessFunction, minRadius, maxRadius);\n// System.out.println(\"EXPLODED CONVERGENCE!\");\n for (int x = 0; x < populationSize; x++){\n Gene next = (Gene) nextGeneration.get(x);\n fitnessArray[x] = next.getFitness();\n }\n Arrays.sort(fitnessArray);\n }\n\n return nextGeneration;\n }", "public static int createnumOfMutationss(){\n\t\tint totalMut = 0;\n\t\t\n\t\tint[] gen0 = new int[(int) Math.pow(2,0)]; //size of numOfMutations is based on exponential growth by generation number\n\t\t\tmutate(gen0); //function to mutate\n\t\t\ttotalMut = totalMut + totalMutations(gen0);\n\t\tint[] gen1 = new int[(int) Math.pow(2,1)];\n\t\t\tcheckMutations(gen0, gen1); //checks for previous generation mutations\n\t\t\tmutate(gen1);\n\t\t\ttotalMut = totalMut + totalMutations(gen1);\n\t\tint[] gen2 = new int[(int) Math.pow(2,2)];\n\t\t\tcheckMutations(gen1, gen2);\n\t\t\tmutate(gen2);\n\t\t\ttotalMut = totalMut + totalMutations(gen2);\n\t\tint[] gen3 = new int[(int) Math.pow(2,3)];\n\t\t\tcheckMutations(gen2, gen3);\n\t\t\tmutate(gen3);\n\t\t\ttotalMut = totalMut + totalMutations(gen3);\n\t\tint[] gen4 = new int[(int) Math.pow(2,4)];\n\t\t\tcheckMutations(gen3, gen4);\n\t\t\tmutate(gen4);\n\t\t\ttotalMut = totalMut + totalMutations(gen4);\n\t\tint[] gen5 = new int[(int) Math.pow(2,5)];\n\t\t\tcheckMutations(gen4, gen5);\n\t\t\tmutate(gen5);\n\t\t\ttotalMut = totalMut + totalMutations(gen5);\n\t\tint[] gen6 = new int[(int) Math.pow(2,6)];\n\t\t\tcheckMutations(gen5, gen6);\n\t\t\tmutate(gen6);\n\t\t\ttotalMut = totalMut + totalMutations(gen6);\n\t\tint[] gen7 = new int[(int) Math.pow(2,7)];\n\t\t\tcheckMutations(gen6, gen7);\n\t\t\tmutate(gen7);\n\t\t\ttotalMut = totalMut + totalMutations(gen7);\n\t\tint[] gen8 = new int[(int) Math.pow(2,8)];\n\t\t\tcheckMutations(gen7, gen8);\n\t\t\tmutate(gen8);\n\t\t\ttotalMut = totalMut + totalMutations(gen8);\n\t\tint[] gen9 = new int[(int) Math.pow(2,9)];\n\t\t\tcheckMutations(gen8, gen9);\n\t\t\tmutate(gen9);\n\t\t\ttotalMut = totalMut + totalMutations(gen9);\n\t\tint[] gen10 = new int[(int) Math.pow(2,10)];\n\t\t\tcheckMutations(gen9, gen10);\n\t\t\tmutate(gen10);\n\t\t\ttotalMut = totalMut + totalMutations(gen10);\n\t\t\t\n\t\t\treturn totalMut;\n\t\n\t}", "public void modifyFitness(Population population) {\n // prepare the calculation\n double[][] data = new double[population.size()][];\n for (int i = 0; i < data.length; i++) {\n data[i] = ((AbstractEAIndividual)population.get(i)).getFitness();\n }\n double min = Double.POSITIVE_INFINITY, fitnessSharing;\n double[] result = new double[data.length];\n AbstractEAIndividual tmpIndy;\n\n for (int x = 0; x < data[0].length; x++) {\n for (int i = 0; i < data.length; i++) data[i][x] = -data[i][x];\n for (int i = 0; i < data.length; i++) {\n if (data[i][x] < min) min = data[i][x];\n }\n\n for (int i = 0; i < data.length; i++) {\n // This will cause the worst individual to have no chance of being selected\n // also note that if all individual achieve equal fitness the sum will be zero\n result[i] = data[i][x] -min + 0.1;\n }\n\n for (int i = 0; i < population.size(); i++) {\n tmpIndy = (AbstractEAIndividual)population.get(i);\n fitnessSharing = 0;\n for (int j = 0; j < population.size(); j++) {\n if (this.m_SharingDistance < this.m_Metric.distance(tmpIndy, (AbstractEAIndividual)population.get(j))) {\n fitnessSharing += 1 - (this.m_Metric.distance(tmpIndy, (AbstractEAIndividual)population.get(j))/this.m_SharingDistance);\n }\n }\n result[i] = result[i]/fitnessSharing;\n }\n\n for (int i = 0; i < population.size(); i++) {\n ((AbstractEAIndividual)population.get(i)).SetFitness(x, result[i]);\n }\n }\n }", "private void mutate(Chromosome c){\n for(double[] gene:c.getGeneData()){\n for(int i=0; i<gene.length; i++){\n if(Math.random()<mutationRate){\n //Mutate the data\n gene[i] += (Math.random()-Math.random())*maxPerturbation;\n }\n }\n }\n }", "private void mutation() {\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tint num = (int) (Math.random() * GENE * ChrNum + 1);\n\t\t\tint chromosomeNum = (int) (num / GENE) + 1;\n\n\t\t\tint mutationNum = num - (chromosomeNum - 1) * GENE; \n\t\t\tif (mutationNum == 0) \n\t\t\t\tmutationNum = 1;\n\t\t\tchromosomeNum = chromosomeNum - 1;\n\t\t\tif (chromosomeNum >= ChrNum)\n\t\t\t\tchromosomeNum = 9;\n\t\t\tString temp;\n\t\t\tString a; \n\t\t\tif (ipop[chromosomeNum].charAt(mutationNum - 1) == '0') { \n a = \"1\";\n\t\t\t} else { \n\t\t\t\ta = \"0\";\n\t\t\t}\n\t\t\t\n\t\t\tif (mutationNum == 1) {\n\t\t\t\ttemp = a + ipop[chromosomeNum].substring(mutationNum);\n\t\t\t} else {\n\t\t\t\tif (mutationNum != GENE) {\n\t\t\t\t\ttemp = ipop[chromosomeNum].substring(0, mutationNum -1) + a \n\t\t\t\t\t\t\t+ ipop[chromosomeNum].substring(mutationNum);\n\t\t\t\t} else {\n\t\t\t\t\ttemp = ipop[chromosomeNum].substring(0, mutationNum - 1) + a;\n\t\t\t\t}\n\t\t\t}\n \tipop[chromosomeNum] = temp;\n\t\t}\n\t}", "public double fitness()\n/* */ {\n/* 40 */ return 1.0D / (1.0D + this.distance);\n/* */ }", "static void generateNodesAndEdges(ArrayList<Node> nodes, StringBuilder graphVis,\n\t\t\tfloat edgeProbability,\n\t\t\tint nodeLevelDistance, float function) {\n\t\tint numberOfNodes = 1;\n\t\tgraphVis.append(\"digraph {\\n\");\n\t\tint numberOfEdges = 0;\n\t\tfor (int i = 0; i < GraphConfig.NUMBER_OF_LEVELS; i++) {\n\t\t\tint numberOfNewNodes = Util.intFromRange(GraphConfig.MIN_PER_LEVEL, GraphConfig.MAX_PER_LEVEL);\n\t\t\tSet<Node> newNodes = new HashSet<Node>();\n\t\t\tfor (int j = 0; j < numberOfNewNodes; j++) {\n\t\t\t\tNode newNode = new Node(numberOfNodes, \"\");\n\t\t\t\tnewNodes.add(newNode);\n\t\t\t\tnewNode.level = i;\n\t\t\t\tnumberOfNodes++;\n\t\t\t\tfor (Node node : nodes) {\n\t\t\t\t\t// Knoten sind auf level beschränkt, nicht sehr dicht\n\t\t\t\t\t// compute prohability differently\n\t\t\t\t\tif (function > 0) {\n\t\t\t\t\t\tif (Math.random() < 1 / Math.pow(function, (i - node.level)) * edgeProbability) {\n\t\t\t\t\t\t\t// System.out.println(1/Math.pow(function,(i -\n\t\t\t\t\t\t\t// node.level)) * edgeProbability);\n\t\t\t\t\t\t\tnode.getOutgoingNodes().add(newNode);\n\t\t\t\t\t\t\tnewNode.getIncomingNodes().add(node);\n\t\t\t\t\t\t\tif (shallCreateGraphVisualization) {\n\t\t\t\t\t\t\t\tgraphVis.append(\" \" + node.getId() + \"->\" + newNode.getId() + \";\\n\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tnumberOfEdges ++;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (Math.random() < edgeProbability) {\n\t\t\t\t\t\t\tif (nodeLevelDistance < 0 || (i - node.level < nodeLevelDistance)) {\n\t\t\t\t\t\t\t\tnode.getOutgoingNodes().add(newNode);\n\t\t\t\t\t\t\t\tnewNode.getIncomingNodes().add(node);\n\t\t\t\t\t\t\t\tif (shallCreateGraphVisualization) {\n\t\t\t\t\t\t\t\t\tgraphVis.append(\" \" + node.getId() + \"->\" + newNode.getId() + \";\\n\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tnumberOfEdges ++;\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\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// only add nodes with input\n\t\t\t\tif (newNode.getIncomingNodes().size() == 0) {\n\t\t\t\t\t// sink.getOutgoingNodes().add(newNode);\n\t\t\t\t\t// newNode.getIncomingNodes().add(sink);\n\t\t\t\t\t// graphVis.append(\" \" + sink.getId() + \"->\"+\n\t\t\t\t\t// newNode.getId() +\";\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(i + \" \" + nodes.size());\n\t\t\tnodes.addAll(newNodes);\n\t\t}\n\t\t\n\t\t//count how many edges are computed and add percentage of long range vertices\n\t\t//add long range edges\n\t\tSystem.out.println(\"NumberOfEdgesWithoutLongRange:\" + numberOfEdges);\n\t\tint longRangeEdges = 0;\n\t\tfor(int i = 0; i< GraphConfig.PERCENTAGE_OF_LONG_RANGE_EDGES * numberOfEdges; i++){\n\t\t\tint firstIndex = (int) (Math.random() * nodes.size());\n\t\t\tint secondIndex = (int) (Math.random() * nodes.size());\n\t\t\tif(firstIndex != secondIndex && nodes.get(firstIndex).level != nodes.get(secondIndex).level){\n\t\t\t\tNode firstNode = null;\n\t\t\t\tNode secondNode = null;\n\t\t\t\tif(firstIndex > secondIndex){\n\t\t\t\t\tint temp = firstIndex;\n\t\t\t\t\tfirstIndex = secondIndex;\n\t\t\t\t\tsecondIndex = temp;\n\t\t\t\t}\n\t\t\t\tfirstNode = nodes.get(firstIndex);\n\t\t\t\tsecondNode = nodes.get(secondIndex);\n\t\t\t\t//und nicht Kante schon existiert\n\t\t\t\tif(!firstNode.getOutgoingNodes().contains(secondNode)){\n\t\t\t\tfirstNode.getOutgoingNodes().add(secondNode);\n\t\t\t\tsecondNode.getIncomingNodes().add(firstNode);\n\t\t\t\tif (shallCreateGraphVisualization) {\n\t\t\t\t\tgraphVis.append(\" \" + firstNode.getId() + \"->\" + secondNode.getId() + \";\\n\");\n\t\t\t\t}\n\t\t\t\tnumberOfEdges ++;\n\t\t\t\tlongRangeEdges++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\tSystem.out.println(\"numberOfNodes:\" + numberOfNodes);\n\t\tSystem.out.println(\"NumberOfEdgesLongRange:\" + longRangeEdges);\n\t\tSystem.out.println(\"NumberOfEdges:\" + numberOfEdges);\n\t\tm = numberOfEdges;\n\n\t\t\n\t\t// add sink node after, that no edge from sink node a generated\n\t\t// nodes.add(sink);\n\t\tgraphVis.append(\"}\\n\");\n\t}", "public Chromosome doDisplacementMutation(){\n for(int i = 0; i < PopulationConfiguration.MUTATION_ATTEMPTS; i++){\n ArrayList<Boolean> newSelection = copyBoolArrayList(this.knapsackSelection);\n\n int allele1 = Configuration.RANDOM_GENERATOR.nextInt(newSelection.size());\n int allele2 = Configuration.RANDOM_GENERATOR.nextInt(newSelection.size());\n\n int leftAllele = Math.min(allele1, allele2);\n int rightAllele = Math.max(allele1, allele2);\n\n var selectionSublist = new ArrayList<Boolean>(newSelection.subList(leftAllele, rightAllele));\n for(int j = leftAllele; j < rightAllele + 1; j++){\n newSelection.remove(leftAllele);\n }\n\n int index = Configuration.RANDOM_GENERATOR.nextInt(newSelection.size()+1);\n newSelection.addAll(index, selectionSublist);\n\n Chromosome mutatedKnapsack = new Chromosome(newSelection).withFitnessCalculated();\n if(mutatedKnapsack.isValid())\n return mutatedKnapsack;\n }\n return this;\n }", "public Chromosome doInsertionMutation(){\n for(int i = 0; i < PopulationConfiguration.MUTATION_ATTEMPTS; i++){\n ArrayList<Boolean> newSelection = copyBoolArrayList(this.knapsackSelection);\n\n int allele1 = Configuration.RANDOM_GENERATOR.nextInt(newSelection.size());\n int allele2 = Configuration.RANDOM_GENERATOR.nextInt(newSelection.size());\n boolean value = newSelection.get(allele2);\n\n newSelection.remove(allele2);\n try{\n newSelection.add(allele1 + 1, value);\n }\n catch(IndexOutOfBoundsException e){\n newSelection.add(value);\n }\n \n Chromosome mutatedKnapsack = new Chromosome(newSelection).withFitnessCalculated();\n if(mutatedKnapsack.isValid())\n return mutatedKnapsack;\n }\n return this;\n }", "void CalculateProbabilities()\n\t{\n\t int i;\n\t double maxfit;\n\t maxfit=fitness[0];\n\t for (i=1;i<FoodNumber;i++)\n\t {\n\t if (fitness[i]>maxfit)\n\t maxfit=fitness[i];\n\t }\n\n\t for (i=0;i<FoodNumber;i++)\n\t {\n\t prob[i]=(0.9*(fitness[i]/maxfit))+0.1;\n\t }\n\n\t}", "public Lambda_phage(double prob_surface, double prob_enzymes) {\n\t\t\n\t\tcurrent_ba = null;\n\t\t\n\t\t/* check for mutation probability */\n\t\tif (mutate_prob >= Sim.randy.nextDouble()) { \n\t\t\tdouble new_prob_surface, new_prob_enzymes;\n\t\t\t\n\t\t\t/* check for helpful mutation probability */\n\t\t\tif (Sim.randy.nextDouble() > mutate_helps) {\n\t\t\t\tnew_prob_surface = prob_surface + Sim.randy.nextDouble()\n\t\t\t\t\t\t* mutate_amount * (1 - prob_surface);\n\t\t\t\tnew_prob_enzymes = prob_enzymes + Sim.randy.nextDouble()\n\t\t\t\t\t\t* mutate_amount * (prob_surface);\n\t\t\t\n\t\t\t/* check for harmful mutation probability */\n\t\t\t} else { // If mutation hurts\n\t\t\t\tnew_prob_surface = prob_surface - Sim.randy.nextDouble()\n\t\t\t\t\t\t* mutate_amount * (1 - prob_enzymes);\n\t\t\t\tnew_prob_enzymes = prob_enzymes - Sim.randy.nextDouble()\n\t\t\t\t\t\t* mutate_amount * (prob_enzymes);\n\t\t\t}\n\t\t\tthis.prob_surface = new_prob_surface;\n\t\t\tthis.prob_enzymes = new_prob_enzymes;\n\t\t\t\n\t\t/* mutation does not occur */\n\t\t} else { \n\t\t\tthis.prob_surface = prob_surface;\n\t\t\tthis.prob_enzymes = prob_enzymes;\n\t\t}\n\n\t\t/* add events */\n\t\tSim.events.add(new Event(this, rate_denature, EVENT_TYPE.DENATURE)); \n\t\tSim.events.add(new Event(this, rate_infection,EVENT_TYPE.INFECT)); \n\n\t\t/* update simulation counters */\n\t\tSim.lps_sum_sr += this.prob_surface;\n\t\tSim.lps_sum_enz += this.prob_enzymes;\n\t}", "public void mutate(NeuralPlayer p)\n\t{\n\t\tdouble[] genome = NetworkCODEC.networkToArray(p.net);\n\t\tRandom g = new Random();\n\t\tfor (int i = 0; i< genome.length; i++)\n\t\t{\n\t\t\tif (g.nextDouble() <= mutationPer)\n\t\t\t\tgenome[i] = randomNum(g) + genome[i];\n\t\t}\n\t\tNetworkCODEC.arrayToNetwork(genome, p.net);\n\t}", "public static double[] getProbDistribution(List<Double> xValues, List<Double> yValues, Tree[] trees){\n double fitnessSum = 0;\n double[] fitnessLst = new double[trees.length];\n for (int i = 0; i < trees.length; i++){\n double fitness = 1.0 / (getFitness(xValues, yValues, trees[i])) ;\n fitnessLst[i] = fitness;\n //System.out.println(fitness);\n fitnessSum += fitness;\n }\n double[] distribution = new double[trees.length];\n for (int i = 0; i < trees.length; i++){\n if (i == 0){\n distribution[i] = fitnessLst[i] / fitnessSum;\n }\n else {\n distribution[i] = distribution[i - 1] + (fitnessLst[i] / fitnessSum);\n }\n }\n return distribution;\n \n \n }", "public void setProbMut (float value) {\r\n mut_prob= value;\r\n }", "@Override\r\n\tpublic Population<BinaryStringChromosome> operate(\r\n\t\t\tPopulation<BinaryStringChromosome> population) {\n\t\tIterator<BinaryStringChromosome> iterator = population\r\n\t\t\t\t.getAllChromosomes().iterator();\r\n\t\tPopulation<BinaryStringChromosome> output = new Population<BinaryStringChromosome>();\r\n\t\tBinaryStringChromosome chromosome;\r\n\t\tRandom random = new Random(System.nanoTime());\r\n\t\twhile (iterator.hasNext()) {\r\n\t\t\tchromosome = iterator.next();\r\n\t\t\tif (random.nextDouble() < probability) {\r\n\t\t\t\tCommonGA.logger.info(\"Mutating chromosome \" + chromosome.toString());\r\n\t\t\t\tchromosome.mutateGene(random.nextInt(chromosome.getSize() - 1));\r\n\t\t\t\tCommonGA.logger.info(\"Mutated chromosome to \" + chromosome.toString());\r\n\t\t\t}\r\n\t\t\toutput.addChromosome(chromosome);\r\n\t\t}\r\n\t\treturn output;\r\n\t}", "public GuidedTreeMutationCoordinator(CentralRegistry registry, double chanceOfRandomMutation,\n\t\t\tboolean preventDuplicates, LinkedHashMap<TreeMutationAbstract, Double> smartMutators,\n\t\t\tTreeMutationCoordinator dumbCoordinator) {\n\t\tthis.registry = registry;\n\t\tthis.chanceOfRandomMutation = chanceOfRandomMutation;\n\t\tthis.preventDuplicates = preventDuplicates;\n\t\tthis.smartMutators = smartMutators;\n\t\tthis.dumbCoordinator = dumbCoordinator;\n\t\tcalculateTotalChance();\n\t}", "@Override\r\n\tpublic void setProbability(double probability) {\n\t\tthis.probability = probability;\r\n\t}", "public void mutate() {\n if (this.offspring != null) {\n for (int i = 0; i < this.offspring.size(); i++) {\n\n if (Defines.probMutate > Math.random()) {\n // OK, choose two genes to switch\n int nGene1 = Defines.randNum(0, Defines.chromosomeSize - 1);\n int nGene2 = nGene1;\n // Make sure gene2 is not the same gene as gene1\n while (nGene2 == nGene1) {\n nGene2 = Defines.randNum(0, Defines.chromosomeSize - 1);\n }\n\n // Switch two genes\n String temp = this.offspring.get(i).getGene(nGene1);\n\n this.offspring.get(i).setGene(nGene1, this.offspring.get(i).getGene(nGene2));\n this.offspring.get(i).setGene(nGene2, temp);\n }\n // Regenerate the chromosome\n ChromosomeGenerator chromoGen = new ChromosomeGenerator();\n chromoGen.update(this.offspring.get(i));\n }\n\n }\n\n }", "public static List<Heuristic> nextGeneration(List<Heuristic> parents, int populationSize, double mutationProb) {\n\t\tif(parents.size() % 2 != 0 || parents.size() < 2)\n\t\t\tthrow new IllegalArgumentException(\"Must be an even number of parents\");\n\t\t\t\t\n\t\tList<Heuristic> ret = new ArrayList<>();\n\t\t\n\t\tfor(Heuristic par : parents)\n\t\t\tret.add(par.copy());\n\t\t\n\t\tfor(int i=0; i<parents.size(); i+=2) {\n\t\t\tList<Heuristic> children = parents.get(i).crossover(parents.get(i+1));\n\t\t\t\n\t\t\tfor(Heuristic child : children)\n\t\t\t\tret.add(child.copy());\n\t\t\t\n\t\t\twhile(ret.size() < (i+2)/parents.size() * populationSize)\n\t\t\t\tfor(Heuristic child : children) {\n\t\t\t\t\tret.add(child.copy().mutate(mutationProb));\n\t\t\t\t\tif(ret.size() == populationSize) return ret;\n\t\t\t\t}\n\t\t}\n\t\t\n\t\treturn ret;\n\t}", "public void sample(RandomGenerator rng) {\n\t\tdouble rate = priorRate;\n\t\tint sumTk = 0;\n\t\tfor (ProbabilityNode node : tiedNodes) {\n\t\t\tBetaDistribution betaD = new BetaDistribution(rng, this.c, node.marginal_nk);\n\t\t\tdouble q = Math.max(1e-75, betaD.sample());\n\t\t\trate += FastMath.log(1.0 / q);\n\t\t\tsumTk += node.marginal_tk;\n\t\t}\n\t\tdouble scale = 1.0 / rate;\n\t\t// marginal nk here is \\sum_{child}child.marginal_tk\n\t\tGammaDistribution gammaD = new GammaDistribution(rng, sumTk + priorShape, scale);\n\t\tthis.setConcentration(gammaD.sample());\n\t}", "private static void mutate(IndividualList offspring) {\n for (Individual individual : offspring) {\n for (byte b : individual.getDNA()) {\n int i = Util.rand((int) Math.ceil(1 / mutaRate));\n if (i == 0) { //1 in x chance to randomly generate 0, therefore 1/x chance to mutate\n b = swap(b);\n }\n }\n individual.setFitness(individual.currentFitness());\n }\n }", "public void runGenerational() {\n\n\t\tSystem.out.println(\"Runing pure generational demo.\");\n\t\tFunction<BitSet, Double> knapsackFitnessFunction = new KnapsackFitness(capacity, parseElements());\n\t\tSpace<BitSet> space = new BitSetSpace(weights.length);\n\n\t\tGeneticSelector<BitSet, Double> rouletteSelector = new RouletteGeneticSelector<>(POP_SIZE);\n\t\tGeneticCrossover<BitSet, Double> crossover = new BinaryCrossover<>(0.9);\n\t\tGeneticOperator<BitSet, Double> geneticOperator = new CustomGeneticOperator<>(crossover);\n\t\tGeneticReplacement<BitSet, Double> replacement = new GenerationalReplacement<>();\n\t\tTracer.add(Population.class);\n\t\tTracer.start();\n\n\t\tSearch<BitSet, Double> search = new GeneticAlgorithm<>(POP_SIZE, NUM_ITER, rouletteSelector, geneticOperator,\n\t\t\t\treplacement);\n\t\tOptimizationProblem<BitSet, Double> problem = new OptimizationProblem<>(space, knapsackFitnessFunction,\n\t\t\t\tComparator.reverseOrder());\n\t\tSolution<BitSet, Double> foundSolution = search.solve(problem);\n\n\t\tSystem.out.println(String.format(\"Best found solution: %f, bitset: %s\",\n\t\t\t\tknapsackFitnessFunction.calculate(foundSolution.getSolution()), foundSolution.getSolution()));\n\n\t\tBitSet optimalBitSet = parseOptimalBitSet();\n\t\tSystem.out.println(String.format(\"Optimal solution: %f, bitset: %s\",\n\t\t\t\tknapsackFitnessFunction.calculate(optimalBitSet), optimalBitSet));\n\t\tKnapsackMetric metric = new KnapsackMetric();\n\t\tmetric.putDataOfBestInFile(1);\n\t}", "public int mutateGene(int gene);", "public void update (int trees, int bushes, int prey, int predators){\n numTrees = trees;\n numBushes = bushes;\n numPrey = prey;\n numPredators = predators;\n this.update();\n }", "public void mutate(float p)\n {\n int regCount = this.registers.size();\n\n /**\n * Parameter mutation replace parameters by random terminals\n */\n for (int i = 0; i < registers.size(); i++)\n {\n LinearRegister reg = this.registers.get(i);\n \n if (1 - GPRunner.RANDOM.nextFloat() <= p)\n {\n if (reg.parameters.length == 0)\n {\n /**\n * Mutate whole register\n */\n this.registers.set(i, randomRegister());\n }\n else\n {\n int parameter = GPRunner.RANDOM\n .nextInt(reg.parameters.length + 1);\n \n if (parameter >= reg.parameters.length)\n {\n /**\n * Mutate whole register\n */\n this.registers.set(i, randomRegister());\n }\n else\n {\n /**\n * Mutate parameter\n */\n reg.parameters[parameter] = randomTerminal();\n }\n }\n }\n }\n\n /**\n * Mutate output register\n */\n\t\t// if(1 - Register.RANDOM.nextFloat() <= p)\n // {\n // this.outputRegister = Register.RANDOM.nextInt(registers.size());\n // }\n }", "public void computeUtility(Tile[] tile, double[] probability, double r, double g) {\n }", "public Specimen mutate(Specimen specimen) {\n\t\tMap<String, Double> weights = WeightUtil.extractWeights(specimen.getWeights());\n\n\t\t// Now, with a certain probabiliy mutate each weight.\n\t\tfor (Map.Entry<String, Double> entry : weights.entrySet()) {\n\t\t\tif (random.nextDouble() <= mutateProbability) {\n\t\t\t\tentry.setValue(mutate(entry.getValue()));\n\t\t\t}\n\t\t}\n\n\t\t// Create a new specimen.\n\t\treturn new Specimen(specimen.getName(), generation, WeightUtil.createWeights(weights));\n\t}", "@SuppressWarnings({ \"unchecked\", \"deprecation\" })\n\tprivate static NeuralNetwork mutate(NeuralNetwork newnn, Singleton s1) throws NoSuchMethodException, SecurityException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {\n\t\tEvolveSingleton s = (EvolveSingleton) s1;\n\t\tNeuralNetManager.Neuraltracker(newnn);\n\t\t//determines type of mutation\n\t\tdouble selector = Math.random();\n\t\t//creates an arraylist of all genes\n\t\tArrayList<Gene> genes = new ArrayList<Gene>();\n\t\tfor (Layer l : newnn.getLayers()){\n\t\t\t\tfor (Neuron n : l.getNeurons()){\t\t\t\t\t\t\n\t\t\t\t\tfor (Gene g : n.getGenes())genes.add(g);\t\t\t\t\t\n\t\t\t\t}\n\t\t}\n\t\t// gene mutation\n\t\tif (selector < s.getDisableProbability()&& genes.size() > 0){\t\t\t\t\n\t\t\tGene gene= genes.get(0);\n\t\t\tif(genes.size() > 1) gene= genes.get(rand.nextInt(genes.size()-1));\n\t\t\tif(selector < s.getAdjustProbability()) {\n\t\t\t\t//adjust weight\n\t\t\t\tgene.setWeight(gene.getWeight()*(1+(Math.random()*.1)));\n\t\t\t}\n\t\t\telse if (selector < s.getRandomProbability()){\n\t\t\t\t// new random weight\n\t\t\t\tgene.setWeight(Math.random()*2 - 1);\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//disable/enable gene\n\t\t\t\tgene.toggle();\t\n\t\t\t}\n\t\t\n\t\t}\n\t\telse if (selector < s.getNewGeneProbability() || genes.size() == 0){\n\t\t\t// new gene\n\t\t\tint layer = 0;\n\t\t\tif (newnn.getLayers().size() > 2) layer = rand.nextInt(newnn.getLayers().size()-2);\n\t\t\tint neuron = 0;\n\t\t\tif (newnn.getLayers().get(layer).getNeurons().size() > 1){\n\t\t\t\t\tneuron = rand.nextInt(newnn.getLayers().get(layer).getNeurons().size()-1);\n\t\t\t}\n\t\t\tint layer2 = newnn.getLayers().size()-1;\n\t\t\tif (newnn.getLayers().size()-2-layer > 0) layer2 = layer + 1 + rand.nextInt(newnn.getLayers().size()-2-layer);\n\t\t\tint neuron2 = 0;\n\t\t\tif (newnn.getLayers().get(layer2).getNeurons().size() > 1){\n\t\t\t\t\tneuron2 = rand.nextInt(newnn.getLayers().get(layer2).getNeurons().size()-1);\n\t\t\t}\n \t\t\tdouble weight = Math.random()*2 - 1;\n \t\t\tNeuron in = newnn.getLayers().get(layer).getNeurons().get(neuron);\n \t\t\tGene g = new Gene(newnn.getLayers().get(layer2).getNeurons().get(neuron2), weight);\n \t\t\tnewnn.getLayers().get(layer2).getNeurons().get(neuron2).addInput(g);\n \t\t\tfor(int i = 0; i < in.getGenes().size();i++){\n \t \t\t\tif (newnn.getLayers().get(layer).getNeurons().get(neuron).getGenes().get(i).getConnection().getLayernumber() == layer2 &&newnn.getLayers().get(layer).getNeurons().get(neuron).getGenes().get(i).getConnection().getNumber() == neuron2){\n \t \t\t\t\tin.RemoveGenes(in.getGenes().get(i));\n \t \t\t\t\ti--;\n \t \t\t\t}\n \t \t\t}\n \t\t\tin.AddGenes(g);\n\t\t}\n\t\telse{\n\t\t\tClass<? extends Layer> layerClass = (Class<? extends Layer>) Class.forName(\"BackEvolution.\"+s.getType()+\".\"+s.getType()+\"Layer\");\n\t\t\tClass<? extends Neuron> neuronClass = (Class<? extends Neuron>) Class.forName(\"BackEvolution.\"+s.getType()+\".\"+s.getType()+\"Neuron\");\n\t\t\tif (newnn.getLayers().size() == 2 || selector > s.getExistingLayerProbability()){\n\t\t\t\t//new neuron in new layer\n\t\t\t\tClass<?>[] types = {boolean.class,boolean.class};\n\t\t\t\tConstructor<? extends Layer> con = layerClass.getConstructor(types);\n\t\t\t\tLayer l = con.newInstance(false,false);\n\n\t\t\t\tnewnn.addLayer(l);\n\t\t\t\tl.setNumber(newnn.getLayers().size()-1);\n\t\t\t\tNeuron n = neuronClass.newInstance();\n\t\t\t\tl.addNeuron(n);\n\t\t\t\tn.setNumber(1);\n\t\t\t\tn.setLayernumber(newnn.getLayers().size()-1);\n\t\t\t\tLayer outputlayer = newnn.getLayers().get(newnn.getLayers().size()-1);\n\t\t\t\toutputlayer.setNumber(newnn.getLayers().size());\n\n\t\t\t\t\n\t\t\t\tArrayList<Gene> genes2 = new ArrayList<Gene>();\n\t\t\t\tfor (Gene g : genes){\n\t\t\t\t\tif (newnn.getLayers().get(g.getConnection().getLayernumber()-1).isOutput()) genes2.add(g);\n\t\t\t\t}\n\t\t\t\tif (genes2.size() > 0){\n\t\t\t\t\tGene gene= genes2.get((int) ((genes2.size()-1)*Math.random()));\n\t\t\t\t\tNeuron out = gene.getConnection();\n\t\t\t\t\tgene.setConnection(n);\n\t\t\t\t\tn.AddGenes(new Gene(out, Math.random()*2 -1));\n\t\t\t\t\tgene.setInput(n);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tArrayList<Neuron> ns = new ArrayList<Neuron>();\n\t\t\t\t\tfor (Gene g : genes){\n\t\t\t\t\t\tns.add(g.getConnection());\n\t\t\t\t\t}\n\t\t\t\t\tGene gene = new Gene(n, Math.random()*2-1);\n\t\t\t\t\tn.addInput(gene);\n\t\t\t\t\tGene gene2 = new Gene(outputlayer.getNeurons().get(0), Math.random()*2-1);\n\t\t\t\t\tif(outputlayer.getNeurons().size()-1 > 0) gene2 = new Gene(outputlayer.getNeurons().get(rand.nextInt(outputlayer.getNeurons().size()-1)), Math.random()*2-1);\n\t\t\t\t\ttry{\n\t\t\t\t\t\tNeuron in = ns.get(rand.nextInt(ns.size()-1));\n\t\t\t\t\t\tin.AddGenes(gene);\n\t\t\t\t\t\tgene.setInput(in);\n\t\t\t\t\t\tgene.getConnection().addInput(gene);\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\tns.get(0).AddGenes(gene);\n\t\t\t\t\t\tgene.setInput(ns.get(0));\n\t\t\t\t\t\tgene.getConnection().addInput(gene);\n\t\t\t\t\t}\n\t\t\t\t\tn.AddGenes(gene2);\n\t\t\t\t\tgene2.setInput(n);\n\t\t\t\t\tgene2.getConnection().addInput(gene2);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\telse{\n\t\t\t\t//new node in existing layer\n\t\t\t\tArrayList<Layer> layers = new ArrayList<Layer>();\n\t\t\t\tfor (Layer l : newnn.getLayers()){\n\t\t\t\t\tif (!l.isInput()&&!l.isOutput()){\n\t\t\t\t\t\tlayers.add(l);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tLayer selected = null;\n\t\t\t\ttry{\n\t\t\t\t\tselected = layers.get(rand.nextInt(layers.size()-1));\n\t\t\t\t}\n\t\t\t\tcatch(Exception e){\n\t\t\t\t\tselected = layers.get(0);\n\t\t\t\t}\n\t\t\t\tArrayList<Gene> genes2 = new ArrayList<Gene>();\n\t\t\t\tfor (int i = 0 ; i < selected.getNumber()-1; i++){\n\t\t\t\t\tLayer l = newnn.getLayers().get(i);\t\n\t\t\t\t\tfor (Neuron n : l.getNeurons()){\n\t\t\t\t\t\tfor(Gene g : n.getGenes()){\n\t\t\t\t\t\t\tif (g.getConnection().getLayernumber() > selected.getNumber() && n.getLayernumber() < selected.getNumber())genes2.add(g);\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\ttry{\n\t\t\t\t\tGene gene = null;\n\t\t\t\t\ttry{\n\t\t\t\t\t\tgene = genes2.get(rand.nextInt(genes2.size()-1));\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\tgene = genes2.get(0);\n\t\t\t\t\t}\n\t\t\t\t\tNeuron n = neuronClass.newInstance();\n\t\t\t\t\t\n\t\t\t\t\tn.setLayernumber(selected.getNumber());\t\t\t\t\n\t\t\t\t\tselected.addNeuron(n);\n\t\t\t\t\tn.setNumber(selected.getNeurons().size());\n\t\t\t\t\tNeuron out = gene.getConnection();\n\t\t\t\t\tgene.setConnection(n);\n\t\t\t\t\tGene gene2 = new Gene(out, Math.random()*2-1);\n\t\t\t\t\tn.AddGenes(gene2);\n\t\t\t\t\tgene2.setInput(n);\n\t\t\t\t}\n\t\t\t\tcatch(Exception e){\n\t\t\t\t\tArrayList<Neuron> ns = newnn.getLayers().get(0).getNeurons();\n\t\t\t\t\tNeuron in = null;\n\t\t\t\t\ttry{\n\t\t\t\t\t\tin = ns.get(rand.nextInt(ns.size()-1));\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception f){\n\t\t\t\t\t\tin = ns.get(0);\n\t\t\t\t\t}\n\t\t\t\t\tArrayList<Neuron> ns2 = ((Layer) newnn.getLayers().get(newnn.getLayers().size()-1)).getNeurons();\n\t\t\t\t\tNeuron on = null;\n\t\t\t\t\ttry{\n\t\t\t\t\t\ton = ns2.get(rand.nextInt(ns2.size()-1));\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception f){\n\t\t\t\t\t\ton = ns2.get(0);\n\t\t\t\t\t}\n\t\t\t\t\tNeuron n = neuronClass.newInstance();\n\t\t\t\t\tGene gene1 = new Gene(n, Math.random()*2-1);\n\t\t\t\t\tin.AddGenes(gene1);\n\t\t\t\t\tgene1.setInput(in);\n\t\t\t\t\tGene gene2 =new Gene(on,Math.random()*2-1);\n\t\t\t\t\tgene2.setInput(n);\n\t\t\t\t\tn.AddGenes(gene2);\n\t\t\t\t\tselected.addNeuron(n);\n\t\t\t\t\tn.setNumber(selected.getNeurons().size());\n\t\t\t\t\tn.setLayernumber(selected.getNumber());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn newnn;\n\t}", "void ComputeFitness(){\n\t\tint i, pos;\n\t\t// individual t;\n\t\tdouble min, sum = 0, sumSize = 0, tm;\n\t\t// First Compute Raw fitness\n\t\tfor(i = 0; i < poplen; i++)\n\t\t{\n\t\t\tif(oldpop[i].evaluated==FALSE)\n\t\t\t{ tm=ComputeRF(oldpop[i]);\n\t\t\t\toldpop[i].fitness = tm;\n\t\t\t\toldpop[i].oldfitness = tm;\n\t\t\t\toldpop[i].evaluated=TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\toldpop[i].fitness=oldpop[i].oldfitness;\n\t\t\t}\n\t\t\t\n\t\t\t//oldpop[i].DisplayIndividual();\n\t\t\t//System.out.println(oldpop[i].fitness);\n\t\t}\n\t\t//tim individual co fitness be nhat\n\t\tmin = oldpop[0].fitness;\n\t\tpos = 0;\n\t\tsum = oldpop[0].fitness;\n\t\tsumSize = oldpop[0].size;\n\t\t\n\t\tfor(i = 1; i < poplen; i++) {\n\t\t\tif(oldpop[i].fitness < min) {\n\t\t\t\tmin = oldpop[i].fitness;\n\t\t\t\tpos = i;\n\t\t\t}\n\t\t\tsum += oldpop[i].fitness;\n\t\t\tsumSize += oldpop[i].size;\n//\t\t\tpopSize[gen][i]= oldpop[i].size;\n\t\t}\n\t\t// copy the best and average\n\t\tbestcurrent[gen] = new individual();\n\t\tbestcurrent[gen].CopyIndividual(oldpop[pos], TRUE);\n\t\taverage[gen] = sum /poplen;\n\t\taverageSize[gen] = sumSize /poplen;\n\t\t// Third Compute Adjusted fitness\n\t\tAdjustFitness();\n\t\t// Finally Compute nomarlized fitness\n \t\tNormalizeFitness();\n\t}", "public interface Heuristic extends Serializable {\n\tpublic final String PATH = \"heuristic\";\n\tpublic final String BEST = \"CNN_f2_p8_m100_o50_t20_99\";\n\t\n\tpublic Heuristic copy();\n\tpublic double evaluate(State state);\n\tpublic void save(String name);\n\tpublic Heuristic mutate(double mutationProb);\n\tpublic List<Heuristic> crossover(Heuristic other);\n\t\n\t/**\n\t * perform crossover between pairs of parents, and return a new population with:\n\t * \t- All the parents\n\t * \t- All the crossover\n\t * - Mutation of the crossover\t\n\t * @param parents : List of parents. They must be an even number\n\t * @param populationSize : size of the population to return. It must be at least twice the number of parents\n\t * @param mutationProb : the probability to mutate a parameter\n\t * @param mutationScale : the scale that multiply the random number that will be summed to the parameter to modify\n\t * @return A list of new Heuristic that must be put into the existing brains for the new Tournament\n\t */\n\tpublic static List<Heuristic> nextGeneration(List<Heuristic> parents, int populationSize, double mutationProb) {\n\t\tif(parents.size() % 2 != 0 || parents.size() < 2)\n\t\t\tthrow new IllegalArgumentException(\"Must be an even number of parents\");\n\t\t\t\t\n\t\tList<Heuristic> ret = new ArrayList<>();\n\t\t\n\t\tfor(Heuristic par : parents)\n\t\t\tret.add(par.copy());\n\t\t\n\t\tfor(int i=0; i<parents.size(); i+=2) {\n\t\t\tList<Heuristic> children = parents.get(i).crossover(parents.get(i+1));\n\t\t\t\n\t\t\tfor(Heuristic child : children)\n\t\t\t\tret.add(child.copy());\n\t\t\t\n\t\t\twhile(ret.size() < (i+2)/parents.size() * populationSize)\n\t\t\t\tfor(Heuristic child : children) {\n\t\t\t\t\tret.add(child.copy().mutate(mutationProb));\n\t\t\t\t\tif(ret.size() == populationSize) return ret;\n\t\t\t\t}\n\t\t}\n\t\t\n\t\treturn ret;\n\t}\n\t\n\t/**\n\t * Return an heuristic from the file <filename>. if <filename> == \"new\" it will return a new Heuristic\n\t * @param filename. Name of the file to load. NO need to include the extension\n\t * @return\n\t */\n\tpublic static Heuristic of(String filename) {\n\t\tif(filename.equalsIgnoreCase(\"new\"))\n\t\t\treturn new HeuristicNN(64, 32, 16);\n\t\treturn HeuristicNN.load(filename);\n\t}\n}", "public Object eval(Individual ind)\r\n {\r\n BinaryIndividual bi = (BinaryIndividual)ind;\r\n int partialFitness = 0;\r\n int distance = 0;\r\n double fitness = 0.0;\r\n\r\n\t for (int i=0; i<100; i++){\r\n\r\n\t distance = 0;\r\n\r\n\t for (int j=0; j<100; j++){\r\n\t if (!((BinaryIndividual)target[i]).getBooleanAllele(j)^bi.getBooleanAllele(j)) { \r\n\t\t distance++;\r\n\t }\r\n \r\n\t if (distance > partialFitness) {\r\n\t partialFitness = distance;\r\n\t }\r\n\t }\r\n }\r\n\r\n fitness = (double)partialFitness/100.0;\r\n return new Double(fitness);\r\n \r\n\r\n }", "public Population mutatePopulation(Population population, List<FogDevice> fogDevices, List<? extends Cloudlet> cloudletList) {\n\n // Loop over current population by fitness\n for (int populationIndex = 1; populationIndex < population.size(); populationIndex++) {\n // if the current individual is selected to mutation phase\n if (this.mutationRate > Math.random()) {\n Individual individual = population.getFittest(populationIndex);\n individual = this.mutateIndividual(individual);\n }\n }\n // Return mutated population\n return population;\n }", "public static void updateMutationRate(KNode oldBest, KNode gBest)\r\n {\r\n if(oldBest.fitness() == gBest.fitness())\r\n {\r\n if(Constants.MUTATION_PROBABILITY < Constants.MAX_MUTATION_PROBABILITY)\r\n {\r\n Constants.MUTATION_PROBABILITY+=Constants.MUTATION_INCREMENT;\r\n }\r\n }\r\n else\r\n {\r\n Constants.MUTATION_PROBABILITY = Constants.MUTATION_INCREMENT;\r\n }\r\n }", "public abstract List<Double> updatePopulations();", "protected void mutateAddNode() {\n\t\t// Test if genome is fully disabled\n\t\tboolean fullydisabled = true;\n\t\tfor (Gene g : genes.values()) {\n\t\t\tif (g.enabled) {\n\t\t\t\tfullydisabled = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (fullydisabled)\n\t\t\treturn;\n\n\t\t// Select the gene to be split\n\t\tGene mutated;\n\t\tdo {\n\t\t\tmutated = getRandomGene();\n\t\t} while (!mutated.enabled);\n\n\t\t// Create the new structure\n\t\tNNode addition = new NNode(population.getNewNodeID(), NNode.HIDDEN);\n\t\tpopulation.registerNode(addition);\n\n\t\tint earlystart = mutated.start;\n\t\tint earlyend = addition.ID;\n\t\tint earlyinnov = population.getInnovation(earlystart, earlyend);\n\t\tGene early = new Gene(earlyinnov, earlystart, earlyend, 1, true);\n\t\tpopulation.registerGene(early);\n\n\t\tint latestart = addition.ID;\n\t\tint lateend = mutated.end;\n\t\tint lateinnov = population.getInnovation(latestart, lateend);\n\t\tGene late = new Gene(lateinnov, latestart, lateend, mutated.weight,\n\t\t\t\ttrue);\n\t\tpopulation.registerGene(late);\n\n\t\t// Disable old gene\n\t\tmutated.enabled = false;\n\n\t\t// Submit new node\n\t\tsubmitNewNode(addition);\n\n\t\t// Submit new genes\n\t\tsubmitNewGene(early);\n\t\tsubmitNewGene(late);\n\n\t\tif (Braincraft.gatherStats)\n\t\t\tBraincraft.genetics.add(\"node mutation \" + ID + \" \"\n\t\t\t\t\t+ mutated.innovation + \" \" + early.innovation + \" \"\n\t\t\t\t\t+ late.innovation + \" \" + addition.ID);\n\t}", "double fitness(int gene) {\r\n \tint sum = 0;\r\n \tint prod= 1;\r\n \tfor (int j=0; j<LEN; j++) {\r\n \t\tif (oldpop[gene][j]==0) {\r\n \t\t\tsum += (j+1);\r\n \t\t} else {\r\n \t\t\tprod *= (j+1);\r\n \t\t}\r\n \t}\r\n \treturn Math.abs(sum - SUMTARG)/SUMTARG \r\n \t + Math.abs(prod - PRODTARG)/PRODTARG;\r\n }", "public abstract double evaluateFitness();", "public ProbabilityDistribution(Random random) {\n\t\trandom_ = random;\n\t\titemProbs_ = new MutableKeyMap<T, Double>();\n\t}", "public BTEvolver(int popSize, int parents, int children, int generations, int trials)\n\t{\n\t\tr = new Random();\n\n\t\tpopulation = new PMCGenotype[popSize];\n\t\tthis.parentsToSelect = parents;\n\t\tthis.trials = trials;\n\t\tthis.childrenPerGeneration = children;\n\n\t\tSystem.out.println(\"-------Generation \" + 0 + \"-------\");\n\t\t\n\t\t// Generate initial population and calculate their fitness\n\t\tfor (int i = 0; i < popSize; i++)\n\t\t{\n\t\t\tPMCGenotype pmcg = PMCGenotype.generateRandom(r);\n\t\t\tpmcg.setFitness(fitness(pmcg, this.trials));\n\t\t\tpopulation[i] = pmcg;\n\t\t\tSystem.out.println(pmcg.getFitness() + \" - \" + pmcg.minimumDistance + \" - \" + pmcg.fleeDistance + \" - \" + pmcg.eatDistance);\n\t\t}\n\n\t\t// Advance generation\n\t\tfor (int i = 0; i < generations; i++)\n\t\t{\n\t\t\tthis.population = this.advanceGeneration();\n\n\t\t\tSystem.out.println(\"-------Generation \" + (i + 1) + \"-------\");\n\t\t\t\n\t\t\tfor (PMCGenotype g : population)\n\t\t\t{\n\t\t\t\tSystem.out.println(g.getFitness() + \" - \" + g.minimumDistance + \" - \" + g.fleeDistance + \" - \" + g.eatDistance);\n\t\t\t}\n\t\t}\n\t}", "private void buildTree(int random_attr){\n String[] schema = new String[]{\"min, max, avg, label\"};\n CassandraDriver driver = CassandraDriver.getInstance();\n ArrayList<int[]> train = driver.queryData(\"data\", schema);\n RandomForest forest = new RandomForest();\n forest.numAttr = RandomForestTrainingMapReduce.N;\n forest.numAttrRandom = random_attr;\n RealDecisionTree tree = new RealDecisionTree(train, forest, RandomForestTrainingMapReduce.N);\n\n // serialize this tree and write to Cassandra.\n byte[] t = serialize(tree);\n try {\n driver.insertData(t, \"Forest\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public Chromosome doExchangeMutation(){\n for(int i = 0; i < PopulationConfiguration.MUTATION_ATTEMPTS; i++){\n ArrayList<Boolean> newSelection = copyBoolArrayList(this.knapsackSelection);\n\n int allele1 = Configuration.RANDOM_GENERATOR.nextInt(newSelection.size());\n int allele2 = Configuration.RANDOM_GENERATOR.nextInt(newSelection.size());\n Collections.swap(newSelection, allele1, allele2);\n\n Chromosome mutatedKnapsack = new Chromosome(newSelection).withFitnessCalculated();\n if(mutatedKnapsack.isValid())\n return mutatedKnapsack;\n }\n return this;\n }", "public void MutationDNF (TableVar Variables) {\r\n\r\n int posiciones, interv, i, j, l, h, eliminar;\r\n float m;\r\n \r\n posiciones = Variables.getNVars()*long_poblacion;\r\n \r\n if (mut_prob > 0)\r\n while (Mu_next < posiciones) {\r\n // Determine the chromosome and gene to be muted\r\n i = Mu_next/Variables.getNVars();\r\n j = Mu_next%Variables.getNVars();\r\n \r\n // Copy the chromosome\r\n for (h=0; h<Variables.getNVars(); h++) {\r\n for (l=0; l<=Variables.getNLabelVar(h); l++)\r\n Des.setCromElemGene(descendientes, h, l, Inter.getCromElemGene(i,h,l));\r\n }\r\n \r\n // Make the mutation\r\n // Half the mutations eliminates the variable from the rule\r\n // The others sets a random value (including the elimination)\r\n eliminar = Randomize.Randint (0,10);\r\n if (eliminar <=5){\r\n for (l=0; l<=Variables.getNLabelVar(j); l++)\r\n Des.setCromElemGene(descendientes, j, l, 0);\r\n }\r\n else {\r\n interv = 0;\r\n for (l=0; l<Variables.getNLabelVar(j); l++) {\r\n Des.setCromElemGene(descendientes, j, l, Randomize.Randint(0,1));\r\n if (Des.getCromElemGene(descendientes, j, l)==1)\r\n interv ++;\r\n }\r\n // si no interviene ningún valor o intervienen todos, la variable no interviene\r\n if (interv==0 || interv==Variables.getNLabelVar(j))\r\n Des.setCromElemGene(descendientes, j, Variables.getNLabelVar(j), 0);\r\n else\r\n Des.setCromElemGene(descendientes, j, Variables.getNLabelVar(j), 1);\r\n }\r\n descendientes++;\r\n\r\n // Marks the chromosome as no evaluated\r\n Des.setIndivEvaluated(i,false);\r\n\r\n // Compute next position to be muted\r\n if (mut_prob<1) {\r\n m = (float) Randomize.Rand();\r\n Mu_next += Math.ceil (Math.log(m) / Math.log(1.0 - mut_prob));\r\n }\r\n else\r\n Mu_next += 1;\r\n\r\n }\r\n Mu_next -= posiciones;\r\n \r\n }", "public void mutation(){\n \n \tfor (int[] temp : wallpapers) {\n \t\tint e = random.nextInt(20);\n \t\tfor (int y = 0; y < e; y++){\n \t\t\tint h = random.nextInt(temp.length);\n \t\t\t//Log.d(\"MUT\", \"selected index \" + h);\n \t\t\tif (h == temp.length - 1 || h == temp.length - 2 || h == temp.length - 3){\n \t\t\t\tint newrgb = random.nextInt(NODELENGTH) + 2;\n \t\t\t\t//Log.d(\"MUT\", \"Picking new node \" + newrgb);\n \t\t\t\ttemp[h] = newrgb;\n \t\t\t} else if (((h + 1) % 3) == 0){\n \t\t\t\tint newfunction = random.nextInt(NUM_FUNCTIONS);\n \t\t\t\t//Log.d(\"MUT\", \"Picking new function \" + newfunction);\n \t\t\t\ttemp[h] = newfunction;\n \t\t\t} else {\n \t\t\t\tint newinput = random.nextInt(h / 3 +1);\n \t\t\t\ttemp[h] = newinput;\n \t\t\t\t//Log.d(\"MUT\", \"Picking new input \" + newinput);\n \t\t\t}\n \t\t}\n \t}\n }", "public void grow(Grid[][] map) {\n\t\tBranchNode parent = root;\r\n\t\twhile (parent.children.size() > 0) {\r\n\t\t\tif (parent.children.size() >= max_branch_per_node) {\r\n\t\t\t\t// if no more room at this branch\r\n\t\t\t\tparent = parent.children\r\n\t\t\t\t\t\t.get((int) (Math.random() * parent.children.size()));\r\n\t\t\t} else if (Math.random() < 0.5) {\r\n\t\t\t\t// if there is still room, picks randomly\r\n\t\t\t\tparent = parent.children\r\n\t\t\t\t\t\t.get((int) (Math.random() * parent.children.size()));\r\n\t\t\t} else {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tint newX, newY; // X and Y coordinates for the new node.\r\n\t\tint r = (int) (Math.random() * GENE_TOTAL);\r\n\t\tint gene_count = width_gene[0];\r\n\t\tint width_select = 0;\r\n\t\twhile (r > gene_count) {\r\n\t\t\twidth_select += 1;\r\n\t\t\tgene_count += width_gene[width_select];\r\n\t\t}\r\n\t\tr = (int) (Math.random() * WIDTH_VARIATION);\r\n\t\tnewX = parent.x - WIDTH_VARIATION / 2 + (width_select - 2)\r\n\t\t\t\t* WIDTH_VARIATION + r;\r\n\t\tif (newX < 0) {// if goes off the grid, push back.\r\n\t\t\tnewX = 0;\r\n\t\t} else if (newX >= World.WORLD_WIDTH) {\r\n\t\t\tnewX = World.WORLD_WIDTH - 1;\r\n\t\t}\r\n\r\n\t\tr = (int) (Math.random() * GENE_TOTAL);\r\n\t\tgene_count = height_gene[0];\r\n\t\tint height_select = 0;\r\n\t\twhile (r > gene_count) {\r\n\t\t\theight_select += 1;\r\n\t\t\tgene_count += height_gene[height_select];\r\n\t\t}\r\n\t\tr = (int) (Math.random() * HEIGHT_VARIATION);\r\n\t\tnewY = parent.y + height_select * HEIGHT_VARIATION + r;\r\n\t\tif (newY >= World.WORLD_HEIGHT) {\r\n\t\t\tnewY = World.WORLD_HEIGHT - 1;\r\n\t\t}\r\n\r\n\t\t// add the branch to the total body.\r\n\t\tamount_of_tree += (int) Math.sqrt((newX - parent.x) * (newX - parent.x)\r\n\t\t\t\t+ (newY - parent.y) * (newY - parent.y));\r\n\t\tBranchNode child = new BranchNode(parent, newX, newY);\r\n\t\tparent.children.add(child);\r\n\r\n\t\tif (parent.leaf_alive) {\r\n\t\t\t// kill leaf, because branch is growing off of it\r\n\t\t\tparent.killLeaf(this, map);\r\n\t\t}\r\n\r\n\t\t// make new leaf on new branch\r\n\t\tchild.addLeaf(this, map);\r\n\t}", "public void processTree(Grid[][] map, ArrayList<Tree> trees) {\n\t\tif (age % COLOR_CHANGE_TIME == 0 && color > 0) {\r\n\t\t\tcolor -= 1;\r\n\t\t}\r\n\r\n\t\t// /////////////I don't like it growing on timer////////////////////\r\n\t\tif (age % grow_time == 0) {\r\n\t\t\tgrow(map);\r\n\t\t}\r\n\t\tif (age % reproduce_time == 0) {\r\n\t\t\treproduce(map, trees);\r\n\t\t}\r\n\r\n\t\t// update health based on how big the tree is, and how much light the\r\n\t\t// leaves are getting\r\n\t\tprocessNode(root, map);\r\n\t\thealth -= amount_of_tree;\r\n\t\thealth -= age / OLD_AGE_FACTOR;\r\n\r\n\t\tage += 1;\r\n\t}", "private void gameTree(MinimaxNode<GameState> currentNode, int depth, int oIndex){\n currentNode.setNodeIndex(oIndex); \n if (depth == 0) {\n return;\n }\n else{\n if (currentNode.getState().isDead(oIndex)){ //checks to see if current player is dead, if so, just skips their moves\n int newIndex = (oIndex + 1) % currentNode.getState().getNrPlayers();\n/* if(oIndex == 3){\n newIndex = 0;\n }\n else{\n newIndex = oIndex + 1;\n }*/\n gameTree(currentNode, depth-1, newIndex);\n }\n else{\n //this if statement sets up chance nodes, if the target has been met it will create 5 children nodes with randomly generated new target postitions \n if(!currentNode.getState().hasTarget()){\n currentNode.setChanceNode();\n for(int i = 1; i <= 5; i++){\n try{\n GameState newState = (GameState)currentNode.getState().clone();\n newState.chooseNextTarget();\n MinimaxNode<GameState> childNode = new MinimaxNode(newState);\n childNode.setProbability(0.2);\n currentNode.addChild(childNode); \n }\n catch (CloneNotSupportedException e){\n System.out.println(\"Clone not excepted\");\n }\n \n }\n for (int i = 0; i < currentNode.getNumberOfChildren(); i++){\n gameTree(currentNode.getChildren().get(i), depth, oIndex);\n }\n\n }\n else{\n List<Integer> options = new ArrayList();\n for (int i = 1; i <= 4; i++) {\n if (currentNode.getState().isLegalMove(oIndex, i)){\n options.add(i);\n }\n }\n for (int i = 0; i < options.size(); i++){\n try{\n GameState newState = (GameState)currentNode.getState().clone();\n newState.setOrientation(oIndex, options.get(i));\n newState.updatePlayerPosition(oIndex);\n MinimaxNode<GameState> childNode = new MinimaxNode(newState);\n currentNode.addChild(childNode);\n }\n catch (CloneNotSupportedException e){\n System.out.println(\"Clone not excepted\");\n }\n }\n int newIndex = (oIndex + 1) % currentNode.getState().getNrPlayers();\n /* if(oIndex == 3){\n newIndex = 0;\n }\n else{\n newIndex = oIndex + 1;\n }*/\n for (int i = 0; i < currentNode.getNumberOfChildren(); i++){\n gameTree(currentNode.getChildren().get(i), depth-1, newIndex);\n }\n } \n } \n }\n }", "public void setTreeSearch(Player tree){\n t = tree;\n\n // e = new EvaluationFunction1(t);\n }", "public int fitness() {\n\t\t//System.out.println(\"/!\\\\ WARNING: Full fitness() called!\");\n\t\tint fitness = 0;\n\t\tint fitnessCases = (int) Math.pow(2, circuit.order);\n\t\tfor (int i=0; i<fitnessCases; i++) {\n\t\t\tValuation v = new Valuation(i, circuit.order);\n\t\t\tboolean actualOutput = tree.evaluate(v);\n\t\t\tboolean correctOutput = v.correctOutput();\n\t\t\t\n\t\t\tif (actualOutput == correctOutput) fitness++;\n\t\t}\n\t\t\n\t\tthis.fitness = fitness;\n\t\tthis.fitnessCases = null;\n\t\t\n\t\treturn fitness;\n\t}", "public static void simulate(BinarySearchTree tree)\n {\n String data = \"\";\n\n //populateTree(tree);\n\n populateTreeRandom(tree);\n\n data = tree.breadthFirstTraversal();\n\n System.out.println(\"RANDOM DATA POST POPULATION: \\n\" + data);\n }", "public Chromosome doInversionMutation(){\n for(int i = 0; i < PopulationConfiguration.MUTATION_ATTEMPTS; i++){\n ArrayList<Boolean> newSelection = copyBoolArrayList(this.knapsackSelection);\n\n int allele1 = Configuration.RANDOM_GENERATOR.nextInt(newSelection.size());\n int allele2 = Configuration.RANDOM_GENERATOR.nextInt(newSelection.size());\n Collections.reverse(newSelection.subList(Math.min(allele1, allele2), Math.max(allele1, allele2)));\n\n Chromosome mutatedKnapsack = new Chromosome(newSelection).withFitnessCalculated();\n if(mutatedKnapsack.isValid())\n return mutatedKnapsack;\n }\n return this;\n }", "public void setProbability(double v) {\n probability = v;\n }", "abstract double rightProbability();", "public static void pruning(StringBuilder binaryGenome, GEMapper mapper, double pruningProbability) {\n\t\t\n\t\tGenotype<String> genotype = new Genotype<String>(binaryGenome.toString());\n\t\t\n\t\tif (MathUtil.flip(pruningProbability)) {\t\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tmapper.getPhenotype(genotype);\n\t\t\t\t\n\t\t\t\tString usable = null;\n\t\t\t\tint codonSize = mapper.getCodonSize();\n\t\t\t\tint lastRunCodonIndex = mapper.lastRunCodonIndex();\n\t\t\t\tint lastRunWraps = mapper.lastRunWraps();\t\t\t\n\t\t\t\t// Calculate the number of codons in the genotype string\n\t\t\t\t// Note: It is possible the last codon to have less than codonSize bits\n\t\t\t\tint codonsNum = (int) Math.ceil((double) binaryGenome.length() / (double) codonSize);\n\t\t\t\t\n\t\t\t\tif (lastRunWraps > 0) // Genotype Wrapping occured which means that all codons where used\n\t\t\t\t\treturn;\n\t\t\t\tif (lastRunCodonIndex == codonsNum - 1) // Last codon of the genome was used\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\t// Keep only the used codons\n\t\t\t\tusable = binaryGenome.substring(0, (lastRunCodonIndex + 1) * codonSize);\n\t\t\t\t\n\t\t\t\tbinaryGenome.delete(0, binaryGenome.length());\n\t\t\t\tbinaryGenome.append(usable);\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(InvalidPhenotypeException ipe) {\n\t\t\t\t//System.out.println(ipe.getMessage());\t\t\t\t\n\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "double getBranchProbability();", "public static void main(String[] args) {\n\t\tTree tree = null;\n\t\tdouble totalrounds = 0;\n\t\tdouble average = 0;\n\t\t// rand = new Random();\n\t\tInputList inputs;\n\t\tRandom rand = new Random();\n\t\tdouble varSum = 0;\n\t\tdouble[] var = new double[(int) iterations];\n\t\tswitch (CHOICE) {\n\t\tcase 1:\n\n\t\t\tfor (int i = 0; i < iterations; i++) {\n\t\t\t\tint rounds = 0;\n\t\t\t\ttree = new Tree(N);\n\t\t\t\twhile (tree.markedNodes() < N) {\n\t\t\t\t\trounds++;\n\t\t\t\t\ttree.markNode((int) (Math.random() * N), rounds);\n\t\t\t\t}\n\t\t\t\tvar[i] = rounds;\n\t\t\t\ttotalrounds += rounds;\n\t\t\t}\n\t\t\taverage = totalrounds / iterations;\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Average: \" + average);\n\n\t\t\t\n\t\t\t\n\t\t\tvarSum = 0;\n\t\t\tfor (int i = 0; i < iterations; i++) {\n\t\t\t\tvar[i] = Math.pow(var[i] - average, 2);\n\t\t\t\tvarSum += var[i];\n\t\t\t}\n\t\t\tvarSum = varSum / iterations;\n\t\t\tSystem.out.println(\"Deviation: \" + Math.sqrt(varSum));\n\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tfor (int i = 0; i < iterations; i++) {\n\t\t\t\tint rounds = 0;\n\t\t\t\ttree = new Tree(N);\n\t\t\t\tinputs = new InputList(N);\n\t\t\t\tint index = 0;\n\t\t\t\twhile (tree.markedNodes() < N) {\n\t\t\t\t\trounds++;\n\t\t\t\t\tint s = inputs.pop(index);\n\t\t\t\t\ttree.markNode(s, rounds);\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t\tvar[i] = rounds;\n\t\t\t\ttotalrounds += rounds;\n\t\t\t}\n\t\t\taverage = totalrounds / iterations;\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Average: \" + average);\n\n\t\t\t\n\t\t\t\n\t\t\tvarSum = 0;\n\t\t\tfor (int i = 0; i < iterations; i++) {\n\t\t\t\tvar[i] = Math.pow(var[i] - average, 2);\n\t\t\t\tvarSum += var[i];\n\t\t\t}\n\t\t\tvarSum = varSum / iterations;\n\t\t\tSystem.out.println(\"Deviation: \" + Math.sqrt(varSum));\n\t\t\tbreak;\n\t\t/*\n\t\t * case 3: for (int i = 0; i < iterations; i++) { int rounds = 0; tree =\n\t\t * new Tree(N); Integer[] nodeSelect; while (tree.markedNodes() < N) {\n\t\t * rounds++; nodeSelect = tree.unmarkedArray(); int select =\n\t\t * rand.nextInt(nodeSelect.length);\n\t\t * tree.markNode(nodeSelect[select].intValue(), rounds); } totalrounds\n\t\t * += rounds; } average = totalrounds / iterations; System.out.println(\n\t\t * \"Average: \" + average);\n\t\t * \n\t\t * \n\t\t * break;\n\t\t */\n\t\tcase 3:\n\t\t\tfor (int i = 0; i < iterations; i++) {\n\t\t\t\tint rounds = 0;\n\t\t\t\tTreeR3 treeR3 = new TreeR3(N);\t\t\t\t\n\t\t\t\tInputList2 input = new InputList2(treeR3, N);\n\t\t\t\twhile (treeR3.markedNodes() < N) {\t\t\t\t\t\n\t\t\t\t\trounds++;\n\t\t\t\t\ttreeR3.markNode(input.pop(), rounds);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tvar[i] = rounds;\n\t\t\t\ttotalrounds += rounds;\n\t\t\t}\n\t\t\taverage = totalrounds / iterations;\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Average: \" + average);\n\n\t\t\t\n\t\t\t\n\t\t\tvarSum = 0;\n\t\t\tfor (int i = 0; i < iterations; i++) {\n\t\t\t\tvar[i] = Math.pow(var[i] - average, 2);\n\t\t\t\tvarSum += var[i];\n\t\t\t}\n\t\t\tvarSum = varSum / iterations;\n\t\t\tSystem.out.println(\"Deviation: \" + Math.sqrt(varSum));\n\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t}", "public void setActionProbability(final State state, final Action action, final double probability) {\r\n getProperties(state).setActionProbability(action, probability);\r\n }", "public void addValues(Vector potentials, ProbabilityTree pTree){\n FiniteStates transVar;\n ProbabilityTree pNewTree,finalTree;\n FiniteStates mainVar=(FiniteStates)getVariables().elementAt(0); \n Vector vars;\n Configuration conf;\n Potential pot;\n int i,j;\n \n // First at all, add a new transparent variable to the object. The number\n // of values for this transparent variable will be the same as the size\n // of potentials vector. Every potential will be used for a value of the\n // transparent variable\n transVar=appendTransparentVariable(potentials.size());\n\n // This variable must be assignet to the probabilityTree\n pTree.assignVar(transVar);\n\n // Consider one by one the branches for this new variable\n for(i=0; i < potentials.size(); i++){\n\n // Get the tree related to this value of the transparent variable\n pNewTree=pTree.getChild(i);\n\n // In this branch we must begin adding the variable owning the relation\n // which values are under consideration\n pNewTree.assignVar(mainVar);\n\n // Get the potential for this value of the transparent var\n pot=(Potential)potentials.elementAt(i);\n\n // Make a configuration to get the values of the potential\n vars=new Vector();\n vars.addElement(mainVar);\n conf=new Configuration(vars);\n\n // Assign the extreme points\n for(j=0; j < mainVar.getNumStates(); j++){\n // Get the tree where the value must be assigned\n finalTree=pNewTree.getChild(j);\n finalTree.assignProb(pot.getValue(conf));\n conf.nextConfiguration();\n }\n }\n }", "private void introduceMutations() {\n }", "private static HashMap<Method, Double> getActivableActions(FsmModel fsm, HashMap<Method, Double> actionsAndProbabilities) {\n // computation of activable methods\n HashMap<Method, Double> activableOnes = new HashMap<Method, Double>();\n double sum = 0;\n for (Method act : actionsAndProbabilities.keySet()) {\n try {\n Method actGuard = fsm.getClass().getDeclaredMethod(act.getName() + \"Guard\");\n if ((Boolean) actGuard.invoke(fsm)) {\n Method actProba = fsm.getClass().getDeclaredMethod(act.getName() + \"Proba\");\n double proba = (Double) actProba.invoke(fsm);\n activableOnes.put(act, proba);\n sum += proba; // checksum\n }\n } catch (NoSuchMethodException e) {\n System.err.println(\"Warning: method \" + act.getName() + \" is not guarded.\");\n System.err.println(\"Will be ignored. \");\n } catch (IllegalAccessException e) {\n System.err.println(\"Illegal access to \" + act.getName());\n System.err.println(\"Shouldn't have happened\");\n // e.printStackTrace(System.err);\n } catch (InvocationTargetException e) {\n System.err.println(\"Exception on target invocation on \" + act.getName());\n System.err.println(\"Shouldn't have happened\");\n // e.printStackTrace(System.err);\n } \n if (sum > 1) {\n System.err.println(\"Warning: sum of probabilities of activable actionsAndProbabilities is > 1 !\\n\" + activableOnes);\n }\n }\n return activableOnes;\n }", "public void mutateNonterminalNode() {\n Node[] nodes = getRandomNonterminalNode(false);\n if (nodes != null)\n ((CriteriaNode) nodes[1]).randomizeIndicator();\n }", "protected void initializeUniformWeight() {\n\n if(CrashProperties.fitnessFunctions.length == 2){\n for (int n = 0; n < populationSize; n++) {\n double a = 1.0 * n / (populationSize - 1);\n lambda[n][0] = a;\n lambda[n][1] = 1 - (a);\n }\n }else {\n for (int n = 0; n < populationSize; n++) {\n double a = 1.0 * n / (populationSize - 1);\n lambda[n][0] = a;\n lambda[n][1] = (1 - (a))/2;\n lambda[n][2] = (1 - (a))/2;\n }\n }\n\n }", "public void incrementFitness()\n {\n this.fitness++;\n }", "public static void GA(ArrayList<City> cities){\n int pathLength = cities.size();\n // the number of chromosomes which will be generated\n int populationSize = 100;\n // the number of chromosomes that will be generated from crossover as a percentage of the population\n double crossoverRate = 0.8;\n // the number of chromosomes that will be generated from crossover\n int crossoverSize = (int) (populationSize * crossoverRate);\n // the probability that a chromosome can have a random mutation\n double mutationRate = 0.05;\n // the number of generations\n int generations = 5000;\n\n // Initialising the distance matrix using the initialiseDistanceMatrix method\n initialiseDistanceMatrix(cities);\n\n // Generating the Initial Population\n ArrayList<Chromosome> population = generatePopulation(cities, pathLength, populationSize);\n\n // The following is done for each generation of the population\n for (int i = 0; i < generations; i++) {\n // calculating the fitness of every chromosome in the current generation\n calculateFitnessOfPopulation(population);\n // sort the population so that the chromosomes with the highest fitness are at the start of the list\n Collections.sort(population);\n // call the method which performs crossover on the population\n Set<Chromosome> children = crossoverPopulation(population, populationSize, crossoverSize);\n // carry out mutation on the children of the current population\n children.addAll( mutatePopulation(children, mutationRate) );\n\n // evolve the population\n population.addAll(children);\n ArrayList<Chromosome> currentGeneration = new ArrayList<>(population);\n ArrayList<Chromosome> nextGeneration = evolvePopulation(currentGeneration, populationSize, cities, pathLength);\n population = new ArrayList<>(nextGeneration);\n }\n\n // find the fittest chromosome\n Chromosome fittestChromosome = population.get(0);\n double maxFitness = population.get(0).fitness;\n for (Chromosome c : population) {\n if (c.fitness > maxFitness) {\n maxFitness = c.fitness;\n fittestChromosome = c;\n }\n }\n // display the path and distance of the fittest chromosome\n System.out.println(fittestChromosome.getPath());\n System.out.println(\"Total Route Distance: \" + routeDistance(fittestChromosome));\n\n //printPopulation(population);\n }", "public void setMutationRate(double rate) { this.exec = this.exec.withProperty(\"svum.rate\", rate); }", "@Override\r\n public void doEdit ()\r\n throws DoEditException\r\n {\n List<StringWithProperties> criteria = probNet.getDecisionCriteria ();\r\n StringWithProperties criterion = null;\r\n switch (stateAction)\r\n {\r\n case ADD :\r\n if (criteria == null)\r\n {\r\n // agents = new StringsWithProperties();\r\n criteria = new ArrayList<StringWithProperties> ();\r\n }\r\n criterion = new StringWithProperties (criterionName);\r\n // agents.put(agentName);\r\n criteria.add (criterion);\r\n probNet.setDecisionCriteria2 (criteria);\r\n break;\r\n case REMOVE :\r\n for (StringWithProperties criterio : criteria)\r\n {\r\n if (criterio.getString ().equals (criterionName))\r\n {\r\n criterion = criterio;\r\n }\r\n }\r\n criteria.remove (criterion);\r\n // TODO assign criteria to node\r\n // it is also necessary to delete this criteria from the node it\r\n // was assigned to\r\n /*\r\n * if (criteria != null) { for (ProbNode node :\r\n * probNet.getProbNodes()) { if\r\n * (node.getVariable().getDecisionCriteria\r\n * ().getString().equals(criteriaName)) {\r\n * node.getVariable().setDecisionCriteria(null); } } }\r\n */\r\n if (criteria.size () == 0)\r\n {\r\n criteria = null;\r\n }\r\n probNet.setDecisionCriteria2 (criteria);\r\n break;\r\n case DOWN :\r\n // StringsWithProperties newAgentsDown = new\r\n // StringsWithProperties();\r\n ArrayList<StringWithProperties> newCriteriasDown = new ArrayList<StringWithProperties> ();\r\n for (int i = 0; i < dataTable.length; i++)\r\n {\r\n // newAgentsDown.put((String)dataTable[i][0]);\r\n newCriteriasDown.add (new StringWithProperties ((String) dataTable[i][0]));\r\n }\r\n probNet.setDecisionCriteria2 (newCriteriasDown);\r\n break;\r\n case UP :\r\n // StringsWithProperties newAgentsUp = new\r\n // StringsWithProperties();\r\n ArrayList<StringWithProperties> newCriteriasUp = new ArrayList<StringWithProperties> ();\r\n for (int i = 0; i < dataTable.length; i++)\r\n {\r\n // newAgentsUp.put((String)dataTable[i][0]);\r\n newCriteriasUp.add (new StringWithProperties ((String) dataTable[i][0]));\r\n }\r\n probNet.setDecisionCriteria2 (newCriteriasUp);\r\n break;\r\n case RENAME :\r\n // agents.rename(agentName, newName);\r\n // StringsWithProperties newAgentsRename = new\r\n // StringsWithProperties();\r\n ArrayList<StringWithProperties> newCriteriasRename = new ArrayList<StringWithProperties> ();\r\n for (int i = 0; i < dataTable.length; i++)\r\n {\r\n // newAgentsRename.put((String)dataTable[i][0]);\r\n newCriteriasRename.add (new StringWithProperties ((String) dataTable[i][0]));\r\n }\r\n probNet.setDecisionCriteria2 (newCriteriasRename);\r\n break;\r\n }\r\n }", "public void setFitness(float fitness)\r\n\t{\r\n\t\tthis.fitness = fitness;\r\n\t}", "public void computeExpectedChildrenProperties() {\n\t\t\n\t\tSet<Attribute<? extends IValue>> parentAttributes = new HashSet<>(popParents.getPopulationAttributes());\n\t\tparentAttributes.retainAll(pMatching.getDimensions());\n\t\t\n\t\tlogger.info(\"computing for the dimensions: {}\", parentAttributes);\n\t\t\n\t\t/*\n\t\t * \n\t\tMap<Set<Attribute<? extends IValue>>,Integer> parents2matchingCandidates = new HashMap<>();\n\t\tfor (Entry<ACoordinate<Attribute<? extends IValue>, IValue>, AControl<Double>> e: \n\t\t\tpMatching.getMatrix().entrySet()) {\n\t\t\t\n\t\t}\n\t\t\n\t\tGosplContingencyTable c = new GosplContingencyTable(pMatching.getDimensions());\n\t\t// for each coordinate of the probabilities table \n\t\t// 1) compute the \n\t\t * \n\t\t */\n\n\t\t\n\t}", "public void applyMutation(int index, double a_percentage) {\n double range = (m_upperBound - m_lowerBound) * a_percentage;\n double newValue = floatValue() + range;\n setAllele(new Float(newValue));\n }", "public void assignMatingProportions() {\n\t\tdouble totalAverageSpeciesFitness = 0.0;\r\n\r\n\t\t// hold the proportion of offspring each species should generate\r\n\r\n\t\tfor (Species s : speciesList) {\r\n\r\n\t\t\ttotalAverageSpeciesFitness += s.getAverageAdjustedFitness();\r\n\t\t}\r\n\r\n\t\t// set map values to be a proportion of the total adjusted\r\n\t\t// fitness\r\n\t\tfor (Species s : speciesList) {\r\n\r\n\t\t\ts.assignProp(totalAverageSpeciesFitness);\r\n\t\t}\r\n\t}" ]
[ "0.69160575", "0.61905533", "0.5874875", "0.5611543", "0.5480231", "0.54259056", "0.54058814", "0.5402939", "0.53833354", "0.5369595", "0.5364167", "0.5359782", "0.5349244", "0.5347801", "0.53328276", "0.53022426", "0.5217014", "0.5200264", "0.5184167", "0.5177045", "0.5171229", "0.5163644", "0.51632214", "0.5162829", "0.5157273", "0.5156392", "0.5132057", "0.5130623", "0.5085259", "0.5082505", "0.50398", "0.50358164", "0.50256664", "0.50072783", "0.50064", "0.50048554", "0.4997627", "0.4981781", "0.49759638", "0.49744323", "0.49574187", "0.49534005", "0.49391112", "0.48867074", "0.48815417", "0.48724908", "0.48700547", "0.48680404", "0.48675886", "0.4814747", "0.48090234", "0.4806658", "0.47916847", "0.47883576", "0.47671232", "0.4766503", "0.47586122", "0.4749044", "0.47339013", "0.47322643", "0.47105834", "0.4690288", "0.46788394", "0.46786067", "0.46639648", "0.46542722", "0.4654257", "0.46487015", "0.46484026", "0.46414965", "0.46329102", "0.4630453", "0.4617505", "0.46146524", "0.46146014", "0.46076882", "0.45955107", "0.45920315", "0.45806876", "0.457721", "0.4575017", "0.45712948", "0.45677927", "0.4564341", "0.4557858", "0.45568576", "0.45499474", "0.45379624", "0.45346746", "0.45235363", "0.4520747", "0.45122796", "0.44935295", "0.44909838", "0.44885328", "0.44846877", "0.44841185", "0.44823048", "0.44806957", "0.4465729" ]
0.5434529
5
encapsulate the process of calling the dumb coordinator and saving the mutation point.
private NAryTree applyDumb(NAryTree tree, Random rng) { NAryTree mutatedTree = dumbCoordinator.apply(tree, rng); this.locationOfLastChange = dumbCoordinator.locationOfLastChange; this.typeOfChange = dumbCoordinator.typeOfChange; return mutatedTree; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void signalAndCreateCoordinator(Cluster pCluster)\n \t{\n \t\tRandom tRandom = new Random(System.currentTimeMillis());\n \t\tHRMController tHRMController = pCluster.getHRMController();\n \t\tNode tNode = tHRMController.getPhysicalNode();\n \t\tint tToken = tRandom.nextInt();\n \t\t\n \t\tpCluster.setToken(tToken);\n \t\tLogging.log(this, \"INIT COORDINATOR functions for cluster \" + pCluster);\n \n \t\tif(pCluster.getHRMController().getIdentity() == null) {\n \t\t\tString tName = tNode.getName();\n \t\t\tHRMIdentity tIdentity= new HRMIdentity(tName);\n \t\t\tpCluster.getHRMController().setIdentity(tIdentity);\n \t\t}\n \t\t\n \n \t\t/**\n \t\t * Create signature of cluster\n \t\t */\n \t\tHRMSignature tSignature = null;\n \t\ttry {\n \t\t\ttSignature = tHRMController.getIdentity().createSignature(tNode.toString(), null, pCluster.getHierarchyLevel());\n \t\t} catch (AuthenticationException tExc) {\n \t\t\tpCluster.getHRMController().getLogger().err(this, \"Unable to create signature for coordinator\", tExc);\n \t\t}\n \t\t\n \t\t/**\n \t\t * Send BULLY ANNOUNCE in order to signal that we are the coordinator\n \t\t */\n \t\tBullyAnnounce tAnnounce = new BullyAnnounce(tNode.getCentralFN().getName(), pCluster.getBullyPriority(), tSignature, pCluster.getToken());\n \t\tfor(CoordinatorCEPChannel tCEP : pCluster.getParticipatingCEPs()) {\n \t\t\ttAnnounce.addCoveredNode(tCEP.getPeerName());\n \t\t}\n \t\tif(tAnnounce.getCoveredNodes() == null || (tAnnounce.getCoveredNodes() != null && tAnnounce.getCoveredNodes().isEmpty())) {\n \t\t\tpCluster.getHRMController().getLogger().log(this, \"Sending announce that does not cover anyhting\");\n \t\t}\n \t\tpCluster.sendClusterBroadcast(tAnnounce, null);\n \t\tName tAddress = tNode.getRoutingService().getNameFor(tNode.getCentralFN());; \n \t\tpCluster.setCoordinatorCEP(null, tSignature, tNode.getCentralFN().getName(), (L2Address)tAddress);\n \t\tLinkedList<HRMSignature> tSignatures = tHRMController.getApprovedSignatures();\n \t\ttSignatures.add(tSignature);\n \t\tif(getHierarchLevel().isHigherLevel()) {\n \t\t\tpCluster.getHRMController().getLogger().log(pCluster, \"has the coordinator and will now announce itself\");\n \t\t\tfor(ICluster tToAnnounce : pCluster.getNeighbors()) {\n //\t\t\t\t\tList<VirtualNode> tNodesBetween = pCluster.getCoordinator().getClusterMap().getIntermediateNodes(pCluster, tToAnnounce);\n \t\t\t\t/*\n \t\t\t\t * OK: Because of the formerly sent \n \t\t\t\t */\n \t\t\t\tif(tToAnnounce instanceof NeighborCluster) {\n \t\t\t\t\tBullyAnnounce tBullyAnnounce = new BullyAnnounce(tNode.getCentralFN().getName(), pCluster.getBullyPriority(), tSignature, pCluster.getToken());\n \t\t\t\t\tfor(CoordinatorCEPChannel tCEP: pCluster.getParticipatingCEPs()) {\n \t\t\t\t\t\ttBullyAnnounce.addCoveredNode(tCEP.getPeerName());\n \t\t\t\t\t}\n \t\t\t\t\tfor(CoordinatorCEPChannel tCEP : ((NeighborCluster)tToAnnounce).getAnnouncedCEPs()) {\n \t\t\t\t\t\ttCEP.sendPacket(tBullyAnnounce);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\t\n \t\tif(!mPleaseInterrupt) {\n \t\t\t/*\n \t\t\t * synchronized(mPleaseInterrupt) {\n \t\t\t *\n \t\t\t\ttry {\n \t\t\t\t\tmPleaseInterrupt.wait(WAIT_BEFORE_ADDRESS_DISTRIBUTION);\n \t\t\t\t} catch (InterruptedException tExc) {\n \t\t\t\t\tLogging.trace(this, \"interrupted before address distribution\");\n \t\t\t\t}\n \t\t\t}\n \t\t\t */\n \t\t\t\n \t\t\t\n \t\t\tCoordinator tElectedCoordinator = new Coordinator(pCluster, pCluster.getHierarchyLevel(), pCluster.getHrmID());\n \t\t\tint tClusterHierLvl = pCluster.getHierarchyLevel().getValue() + 1;\n \t\t\t\n \t\t\tpCluster.setCoordinator(tElectedCoordinator);\n \t\t\tpCluster.getHRMController().setSourceIntermediateCluster(tElectedCoordinator, pCluster);\n \t\t\ttElectedCoordinator.setPriority(pCluster.getBullyPriority());\n \t\t\tpCluster.getHRMController().addCluster(tElectedCoordinator);\n \t\t\tif(tClusterHierLvl != HRMConfig.Hierarchy.HEIGHT) {\n \t\t\t\t// stepwise hierarchy creation\n \t\t\t\tLogging.log(this, \"Will now wait because hierarchy build up is done stepwise\");\n \t\t\t\tmWillInitiateManager = true;\n \t\t\t\tLogging.log(this, \"Reevaluating whether other processes settled\");\n \t\t\t\tElectionManager.getElectionManager().reevaluate(pCluster.getHierarchyLevel().getValue());\n \t\t\t\tsynchronized(this) {\n \t\t\t\t\ttry {\n \t\t\t\t\t\twait();\n \t\t\t\t\t} catch (InterruptedException tExc) {\n \t\t\t\t\t\tLogging.err(this, \"Unable to fulfill stepwise hierarchy preparation\", tExc);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\ttElectedCoordinator.prepareAboveCluster(tClusterHierLvl);\n \t\t\t} else {\n \t\t\t\tLogging.log(this, \"Beginning address distribution\");\n \t\t\t\ttry {\n \t\t\t\t\ttElectedCoordinator.setHRMID(new HRMID(0));\n \t\t\t\t\tsynchronized(mPleaseInterrupt) {\n \t\t\t\t\t\tLogging.log(this, \"ACTIVE WAITING (init) - \" + WAIT_BEFORE_ADDRESS_DISTRIBUTION);\n \t\t\t\t\t\tmPleaseInterrupt.wait(WAIT_BEFORE_ADDRESS_DISTRIBUTION);\n \t\t\t\t\t}\n \t\t\t\t\ttElectedCoordinator.distributeAddresses();\n \t\t\t\t} catch (RemoteException tExc) {\n \t\t\t\t\tLogging.err(this, \"Remoe problem - error when trying to distribute addresses\", tExc);\n \t\t\t\t} catch (RoutingException tExc) {\n \t\t\t\t\tLogging.err(this, \"Routing problem - error when trying to distribute addresses\", tExc);\n \t\t\t\t} catch (RequirementsException tExc) {\n \t\t\t\t\tLogging.err(this, \"Requirements problem - error when trying to distribute addresses\", tExc);\n \t\t\t\t} catch (InterruptedException tExc) {\n \t\t\t\t\tLogging.err(this, \"interrupt problem - error when trying to distribute addresses\", tExc);\n \t\t\t\t}\n \t\t\t}\n \t\t}\t\n \t}", "@Override\n public void execute() {\n ImmutableVector loc = translationalLocationEstimator.estimateLocation();\n ImmutableVector goalPoint = purePursuitMovementStrategy.update(loc, lookahead.getLookahead());\n\n Path path = purePursuitMovementStrategy.getPath();\n PathSegment current = path.getCurrent();\n ImmutableVector closestPoint = current.getClosestPoint(loc);\n absoluteDistanceUsed = current.getAbsoluteDistance(closestPoint);\n speedUsed = current.getSpeed(absoluteDistanceUsed);\n translationalLocationDriveable.driveTowardTransLoc(speedUsed, goalPoint);\n }", "@Override\n public void unexecute()\n {\n if(layer.removeMeasurementPointByPosition(measurementPoint.getPosition()))\n {\n //remove local reference to the measurement point\n measurementPoint = null;\n //remove marker\n if(mapCanvas.removeMarkerFromMap(markerPositionOnMap))\n {\n markerPositionOnMap = null;\n }\n else\n {\n Log.d(DEBUGTAG, \"Error: While undoing 'add measurement point' could not remove the marker\");\n }\n\n }\n else\n {\n Log.d(DEBUGTAG, \"Error: MeasurementPoint not found in layer!\");\n }\n Log.d(DEBUGTAG, \"Command AddMeasurement Point Unexecuted\");\n }", "@Override\n public void execute()\n {\n measurementPoint = new MeasurementPoint(position);\n // Add marker to map and get the position of the marker on the map\n markerPositionOnMap = mapCanvas.addMarker(position, layer.getLayerName(), \"\", layer.getColor());\n // Add marker position to measurementPoint\n measurementPoint.setMarkerPositionOnMap(markerPositionOnMap);\n // Add measurementPoint to layerManager\n layer.addMeasurementPoint(measurementPoint);\n }", "@Override\n public void persistFlowUnit(FlowUnitOperationArgWrapper args) {}", "@Override\n public void execute() {\n\n\n /* container.swerveControllerCommand =\n new SwerveControllerCommand(\n trajectory,\n drivetrain::getCurrentPose, \n DrivetrainConstants.DRIVE_KINEMATICS,\n\n // Position controllers\n new PIDController(DrivetrainConstants.P_X_Controller, 0, 0),\n new PIDController(DrivetrainConstants.P_Y_Controller, 0, 0),\n container.thetaController,\n drivetrain::setModuleStates, //Not sure about setModuleStates\n drivetrain);*/\n\n// Reset odometry to the starting pose of the trajectory.\ndrivetrain.resetOdometry(trajectory.getInitialPose());\n\n\n}", "public void commitExploration() {\n watermarkCommittedTick = watermarkGoalTick;\n }", "private void introduceMutations() {\n }", "@Override\n\tpublic void execute(Frame frame) {\n\t\tDSTORE._dstore(frame, 1);\n\t}", "@Override\n protected void execute() {\n if(isBackwards) {\n exeBackwards();\n } else {\n exeForwards();\n }\n\n SmartDashboard.putNumber(\"DrivePath/SegmentX\", m_left_follower.getSegment().x);\n SmartDashboard.putNumber(\"DrivePath/SegmentVelocity\", m_left_follower.getSegment().velocity);\n }", "@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic void mutation() {\r\n\t\tfinal double MUTATION_PROB = 0.1;\r\n\t\tfor (int i=0; i<this.nChromosomes; i++) {\r\n\t\t\tArrayList<Integer> chr = (ArrayList<Integer>) this.chromosomes.get(i);\r\n\t\t\tfor (int j=0; j<this.nViaPoints; j++) {\r\n\t\t\t\tdouble rand = Math.random();\r\n\t\t\t\tif (rand < MUTATION_PROB) {\r\n\t\t\t\t\t// change the sign\r\n\t\t\t\t\tInteger vPoint = chr.get(j);\r\n\t\t\t\t\tchr.remove(j);\r\n\t\t\t\t\tchr.add(j, new Integer(- (vPoint.intValue()%100)));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.printChromosomes(\"After Mutation\");\r\n\t}", "public abstract void mutate();", "@Override\n\tpublic void commitInmate(InmateData inmate) {\n\t\t\n\t}", "@Override\n public final void updateOrigin() {\n }", "protected void execute() {\n this.setSetpoint(OI.getAdjustedThrottle()*RobotMap.maxRPM);\n ScraperBike.debugToTable(\"PIDSetpoint\", OI.getAdjustedThrottle()*RobotMap.maxRPM);\n \n }", "void execute()\n\t{\n\t\tVM.top++;\n\t\tVM.opStack[VM.top] = arg();\n\t\tVM.pc++;\n\t}", "private int electCoordinator(int[] processes, int elector) {\r\n int newCoord = processes[0];\r\n //Check the first process number and compare with other live processes and elect Coordinator with highest process number\r\n for(int i = 1; i<processes.length; i++) {\r\n if(processes[i]>newCoord) {\t\t\t\t\t\r\n \tnewCoord = processes[i];\r\n }\r\n } \r\n \r\n // assign the variables with the new coordinator value\r\n ring.coordinator = newCoord;\r\n coordinator = newCoord;\r\n ring.messageArea.append(\"\\nNew Co-ordinator : \" + ring.coordinator);\r\n if(ring.coordinator != 0) {\r\n \t// Announce the coordinator to other processes\r\n \r\n \tinformCoordinator(newCoord, processNo+1, elector);\r\n }\r\n return newCoord;\r\n}", "@Override\r\n\tpublic void execute( Object obj ) throws Exception {\r\n\t\tTuple t = ( Tuple ) obj;\r\n\t\tif ( t.getType() == TupleType.TRIPLET ) saveEntity( obj );\r\n\t\tif ( t.getType() == TupleType.QUARTET ) saveAncestorAndHistory( obj );\r\n\t}", "@Suspendable\n @Override\n public StateAndRef<SanctionedEntities> call() throws FlowException {\n // Obtain a reference to the notary we want to use.\n Party notary = getServiceHub().getNetworkMapCache().getNotaryIdentities().get(0);\n\n // Stage 1\n progressTracker.setCurrentStep(GENERATING_TRANSACTION);\n // Generate an unsigned transaction.\n SanctionedEntities state = new SanctionedEntities(Collections.emptyList(), getServiceHub().getMyInfo().getLegalIdentities().get(0));\n Command txCommand = new Command(new SanctionedEntitiesContract.Commands.Create(), getServiceHub().getMyInfo().getLegalIdentities().get(0).getOwningKey());\n TransactionBuilder txBuilder = new TransactionBuilder(notary)\n .addOutputState(state, SanctionedEntitiesContract.SANCTIONS_CONTRACT_ID)\n .addCommand(txCommand);\n txBuilder.verify(getServiceHub());\n\n // Stage 2\n progressTracker.setCurrentStep(SIGNING_TRANSACTION);\n // Sign the transaction\n SignedTransaction partSignedTx = getServiceHub().signInitialTransaction(txBuilder);\n\n // Stage 3\n progressTracker.setCurrentStep(FINALISING_TRANSACTION);\n // Notarise and record the transaction in both parties' vaults.\n return subFlow(\n new FinalityFlow(\n partSignedTx,\n Collections.emptyList(),\n FINALISING_TRANSACTION.childProgressTracker()\n )\n ).getTx().outRefsOfType(SanctionedEntities.class).get(0);\n }", "public long flushCheckpoint()\r\n/* 119: */ {\r\n/* 120:150 */ return this.checkpoint;\r\n/* 121: */ }", "protected abstract void commitIndividualTrx();", "public void commitMeasurements() {\n\tsuper.commitMeasurements();\n}", "protected void execute() {\n \tif (setPoint != 0)\n \t\tshooterWheel.shooterWheelSpeedControllerAft.setSetPoint(setPoint);\n \tshooterWheel.driveAftWheel(shooterWheel.shooterWheelSpeedControllerAft.getControlOutput());\n \t\n }", "@Override\n public void execute() {\n vars.setState(\"Teleporting...\");\n Methods.teleToFlameKing();\n }", "public boolean SavePoint() {\n\t\tcmds.clear();\n\t\treturn true;\n\t}", "public void overflowNotification(RecordLocation safeLocation) {\n checkpoint(false, true);\n }", "public static void sendCoordinatorMsg() {\n int numberOfRequestsNotSent = 0;\n for ( int key : ServerState.getInstance().getServers().keySet() ) {\n if ( key != ServerState.getInstance().getSelfID() ){\n Server destServer = ServerState.getInstance().getServers().get(key);\n\n try {\n MessageTransfer.sendServer(\n ServerMessage.getCoordinator( String.valueOf(ServerState.getInstance().getSelfID()) ),\n destServer\n );\n System.out.println(\"INFO : Sent leader ID to s\"+destServer.getServerID());\n }\n catch(Exception e) {\n numberOfRequestsNotSent += 1;\n System.out.println(\"WARN : Server s\"+destServer.getServerID()+\n \" has failed, it will not receive the leader\");\n }\n }\n }\n if( numberOfRequestsNotSent == ServerState.getInstance().getServers().size()-1 ) {\n // add self clients and chat rooms to leader state\n List<String> selfClients = ServerState.getInstance().getClientIdList();\n List<List<String>> selfRooms = ServerState.getInstance().getChatRoomList();\n\n for( String clientID : selfClients ) {\n LeaderState.getInstance().addClientLeaderUpdate( clientID );\n }\n\n for( List<String> chatRoom : selfRooms ) {\n LeaderState.getInstance().addApprovedRoom( chatRoom.get( 0 ),\n chatRoom.get( 1 ), Integer.parseInt(chatRoom.get( 2 )) );\n }\n\n leaderUpdateComplete = true;\n }\n }", "@Override\n\tpublic void posSave() {\n\t\t\n\t}", "@Override\n\tpublic void posSave() {\n\t\t\n\t}", "@Override\n\tprotected void execute() {\n\t\tRobot.collector.setMawOpen(Robot.oi.getCollectorOpen());\n\t\tRobot.collector.setIntakeSpeed(Robot.oi.getCollectorSpeed());\n\t\tRobot.collector.setWristStageOneRetracted(Robot.oi.getWristStageOneRetracted());\n\t\tRobot.collector.setWristStageTwoRetracted(Robot.oi.getWristStageTwoRetracted());\n\t}", "private Coordinator(File baseDirectory) throws IOException {\n super(baseDirectory);\n\n coordinatorOutput = new MessageOutput<ClusterState.Assignment>(new File(getBaseDirectory(), Constants.getCoordinatorLock()).toPath()) {\n @Override\n public void writeDelimitedTo(OutputStream stream, ClusterState.Assignment v) throws IOException {\n v.writeDelimitedTo(stream);\n }\n };\n }", "private Object mutation(Individual child){\n\t\treturn problem.improve(child.getId());\r\n\t}", "protected void execute() {\n drivebase.setCheesySensetivity(1.32);\n if(rot != 0.0)\n drivebase.setCheesyDrive(0, rot, true);\n else\n drivebase.setCheesyDrive(0, inverse*SmartDashboard.getNumber(key), true);\n }", "protected void execute() {\r\n OI.printToDS(0, \"Pos SetPoint: \" + driveTrain.getLeftPosSetpoint());\r\n OI.printToDS(1, \"Pos: \" + driveTrain.getLeftPos());\r\n //OI.printToDS(2, \"Gyro: \" + driveTrain.getGyro().getAngle());\r\n if (oi.getDriver().getRawAxis(6) > 0.5 && !dPadUp) {\r\n y += 0.25;\r\n dPadUp = true;\r\n } else if (oi.getDriver().getRawAxis(6) < - 0.5 && !dPadDown) {\r\n y -= 0.25;\r\n dPadDown = true;\r\n }else if(Math.abs(oi.getDriver().getRawAxis(6)) < 0.5 ){\r\n dPadUp = false;\r\n dPadDown = false;\r\n }\r\n if (oi.getDriver().getRawAxis(6) > 0.5) {\r\n y += 0.1;\r\n } else if (oi.getDriver().getRawAxis(6) < -0.5) {\r\n y -= 0.1;\r\n } else if (oi.getDriver().getRawAxis(5) < -0.5) {\r\n x += 0.05;\r\n } else if (oi.getDriver().getRawAxis(5) > 0.5) {\r\n x -= 0.05;\r\n }\r\n driveTrain.setRightPos(y - x);\r\n driveTrain.setLeftPos(y + x);\r\n }", "public void startExploration() {\n watermarkGoalTick = currentTick;\n }", "public interface Constellation {\n\n /**\n * Submit an activity.\n *\n * The submitted Activity will be inserted into Constellation and executed if and when a suitable Executor is found. An\n * ActivityIdentifier is returned that can be used to refer to this submitted Activity at a later moment in time.\n *\n * It is up to the user to make sure that this constellation instance has a suitable executor, or, if the contexts don't\n * match, an executor that can be stolen from. In some cases, the system can detect that no suitable executor can be found. In\n * those cases, it throws an exception.\n *\n * @param activity\n * the Activity to submit\n * @exception NoSuitableExecutorException\n * is thrown when the system has detected that no suitable executor can be found.\n * @return ActivityIdentifier that can be used to refer to the submitted Activity.\n */\n public ActivityIdentifier submit(Activity activity) throws NoSuitableExecutorException;\n\n /**\n * Send an event.\n *\n * @param e\n * the Event to send.\n */\n public void send(Event e);\n\n /**\n * Activate this Constellation implementation.\n *\n * Constellation instances start out in in inactive state when they are created. This allows the application to configure\n * Constellation (for example, by setting up the desired combination of distributed and local constellation instances).\n *\n * Upon activation, the Constellation instance will activate all sub-constellations, and activate its own executors, steal\n * pools, event queues, etc.\n *\n * @return if the Constellation was activated.\n */\n public boolean activate();\n\n /**\n * Terminate Constellation.\n *\n * When terminating all sub-constellations will be terminated. Termination may also block until all other running\n * constellation instances in a Pool have also decided to terminate.\n */\n public void done();\n\n /**\n * Returns <code>true</code> if this Constellation instance is the master, <code>false</code> otherwise.\n *\n * @return whether this Constellation instance is the master.\n */\n public boolean isMaster();\n\n /**\n * Returns a unique identifier for this Constellation instance.\n *\n * This identifier can be used to uniquely refer to a running Constellation instance.\n *\n * @return a string that uniquely identifies this Constellation instance.\n */\n public ConstellationIdentifier identifier();\n\n /**\n * Creates a {@link Timer} with the specified device, thread, and action name.\n *\n * @param device\n * the device name\n * @param thread\n * the thread name\n * @param action\n * the action name\n * @return the Timer object\n */\n public Timer getTimer(String device, String thread, String action);\n\n /**\n * Creates a {@link Timer} without device, thread, or action name.\n *\n * @return the Timer object\n */\n public Timer getTimer();\n\n /**\n * Returns the overall timer.\n *\n * This timer needs to be started and stopped by the main program.\n *\n * @return the overall timer.\n */\n public Timer getOverallTimer();\n}", "protected void executionSuccess() {\n this.isUndoable = true;\n }", "@Override\r\n\tpublic void placeSettlement(VertexLocation vertLoc) {\n\t\t\r\n\t}", "public interface IMutationOperator extends IDescriptable, Opcodes {\n\t/**\n\t * Gets all possible points in given class (bytecode) where different\n\t * mutants can be produced.\n\t *\n\t * @param bytecode bytecode to be analyzed\n\t * @return list of mutation points witihn given class (bytecode)\n\t */\n\tList<IMutationPoint> getMutationPoints(byte[] bytecode);\n\n\t/**\n\t * Mutate given bytecode to create mutants with given mutation points.\n\t *\n\t * @param bytecode bytecode to be mutated\n\t * @param mutationPoint mutation point in given class (bytecode)\n\t * @return list of mutants created within given point\n\t */\n\tList<IMutantBytecode> mutate(byte[] bytecode, IMutationPoint mutationPoint);\n\n\t/**\n\t * @param bytecode bytecode to be mutated\n\t * @param mutationPointIndex mutation point in given class (bytecode)\n\t * @param mutantIndex specific mutant index within given point\n\t * @return mutated bytecode - mutant\n\t */\n\tIMutantBytecode mutate(byte[] bytecode, int mutationPointIndex, int mutantIndex);\n}", "@Override public final void dinvoke(H2ONode sender) {\n setupLocal(); // Local setup\n compute2(); // Do The Main Work\n // nothing here... must do any post-work-cleanup in onCompletion\n }", "protected void checkpoint(S state) {\n checkpoint();\n state(state);\n }", "@Override public final void dinvoke(H2ONode sender) {\n setupLocal0(); // Local setup\n compute2(); // Do The Main Work\n // nothing here... must do any post-work-cleanup in onCompletion\n }", "public interface Propagator extends PVCoordinatesProvider {\n\n /** Default mass. */\n double DEFAULT_MASS = 1000.0;\n\n /** Default attitude provider. */\n AttitudeProvider DEFAULT_LAW = InertialProvider.EME2000_ALIGNED;\n\n /** Indicator for slave mode. */\n int SLAVE_MODE = 0;\n\n /** Indicator for master mode. */\n int MASTER_MODE = 1;\n\n /** Indicator for ephemeris generation mode. */\n int EPHEMERIS_GENERATION_MODE = 2;\n\n /** Get the current operating mode of the propagator.\n * @return one of {@link #SLAVE_MODE}, {@link #MASTER_MODE},\n * {@link #EPHEMERIS_GENERATION_MODE}\n * @see #setSlaveMode()\n * @see #setMasterMode(double, OrekitFixedStepHandler)\n * @see #setMasterMode(OrekitStepHandler)\n * @see #setEphemerisMode()\n */\n int getMode();\n\n /** Set the propagator to slave mode.\n * <p>This mode is used when the user needs only the final orbit at the target time.\n * The (slave) propagator computes this result and return it to the calling\n * (master) application, without any intermediate feedback.\n * <p>This is the default mode.</p>\n * @see #setMasterMode(double, OrekitFixedStepHandler)\n * @see #setMasterMode(OrekitStepHandler)\n * @see #setEphemerisMode()\n * @see #getMode()\n * @see #SLAVE_MODE\n */\n void setSlaveMode();\n\n /** Set the propagator to master mode with fixed steps.\n * <p>This mode is used when the user needs to have some custom function called at the\n * end of each finalized step during integration. The (master) propagator integration\n * loop calls the (slave) application callback methods at each finalized step.</p>\n * @param h fixed stepsize (s)\n * @param handler handler called at the end of each finalized step\n * @see #setSlaveMode()\n * @see #setMasterMode(OrekitStepHandler)\n * @see #setEphemerisMode()\n * @see #getMode()\n * @see #MASTER_MODE\n */\n void setMasterMode(double h, OrekitFixedStepHandler handler);\n\n /** Set the propagator to master mode with variable steps.\n * <p>This mode is used when the user needs to have some custom function called at the\n * end of each finalized step during integration. The (master) propagator integration\n * loop calls the (slave) application callback methods at each finalized step.</p>\n * @param handler handler called at the end of each finalized step\n * @see #setSlaveMode()\n * @see #setMasterMode(double, OrekitFixedStepHandler)\n * @see #setEphemerisMode()\n * @see #getMode()\n * @see #MASTER_MODE\n */\n void setMasterMode(OrekitStepHandler handler);\n\n /** Set the propagator to ephemeris generation mode.\n * <p>This mode is used when the user needs random access to the orbit state at any time\n * between the initial and target times, and in no sequential order. A typical example is\n * the implementation of search and iterative algorithms that may navigate forward and\n * backward inside the propagation range before finding their result.</p>\n * <p>Beware that since this mode stores <strong>all</strong> intermediate results,\n * it may be memory intensive for long integration ranges and high precision/short\n * time steps.</p>\n * @see #getGeneratedEphemeris()\n * @see #setSlaveMode()\n * @see #setMasterMode(double, OrekitFixedStepHandler)\n * @see #setMasterMode(OrekitStepHandler)\n * @see #getMode()\n * @see #EPHEMERIS_GENERATION_MODE\n */\n void setEphemerisMode();\n\n /**\n * Set the propagator to ephemeris generation mode with the specified handler for each\n * integration step.\n *\n * <p>This mode is used when the user needs random access to the orbit state at any\n * time between the initial and target times, as well as access to the steps computed\n * by the integrator as in Master Mode. A typical example is the implementation of\n * search and iterative algorithms that may navigate forward and backward inside the\n * propagation range before finding their result.</p>\n *\n * <p>Beware that since this mode stores <strong>all</strong> intermediate results, it\n * may be memory intensive for long integration ranges and high precision/short time\n * steps.</p>\n *\n * @param handler handler called at the end of each finalized step\n * @see #setEphemerisMode()\n * @see #getGeneratedEphemeris()\n * @see #setSlaveMode()\n * @see #setMasterMode(double, OrekitFixedStepHandler)\n * @see #setMasterMode(OrekitStepHandler)\n * @see #getMode()\n * @see #EPHEMERIS_GENERATION_MODE\n */\n void setEphemerisMode(OrekitStepHandler handler);\n\n /** Get the ephemeris generated during propagation.\n * @return generated ephemeris\n * @exception IllegalStateException if the propagator was not set in ephemeris\n * generation mode before propagation\n * @see #setEphemerisMode()\n */\n BoundedPropagator getGeneratedEphemeris() throws IllegalStateException;\n\n /** Get the propagator initial state.\n * @return initial state\n * @exception OrekitException if state cannot be retrieved\n */\n SpacecraftState getInitialState() throws OrekitException;\n\n /** Reset the propagator initial state.\n * @param state new initial state to consider\n * @exception OrekitException if initial state cannot be reset\n */\n void resetInitialState(SpacecraftState state)\n throws OrekitException;\n\n /** Add a set of user-specified state parameters to be computed along with the orbit propagation.\n * @param additionalStateProvider provider for additional state\n * @exception OrekitException if an additional state with the same name is already present\n */\n void addAdditionalStateProvider(AdditionalStateProvider additionalStateProvider)\n throws OrekitException;\n\n /** Get an unmodifiable list of providers for additional state.\n * @return providers for the additional states\n */\n List<AdditionalStateProvider> getAdditionalStateProviders();\n\n /** Check if an additional state is managed.\n * <p>\n * Managed states are states for which the propagators know how to compute\n * its evolution. They correspond to additional states for which an\n * {@link AdditionalStateProvider additional state provider} has been registered\n * by calling the {@link #addAdditionalStateProvider(AdditionalStateProvider)\n * addAdditionalStateProvider} method. If the propagator is an {@link\n * org.orekit.propagation.integration.AbstractIntegratedPropagator integrator-based\n * propagator}, the states for which a set of {@link\n * org.orekit.propagation.integration.AdditionalEquations additional equations} has\n * been registered by calling the {@link\n * org.orekit.propagation.integration.AbstractIntegratedPropagator#addAdditionalEquations(\n * org.orekit.propagation.integration.AdditionalEquations) addAdditionalEquations}\n * method are also counted as managed additional states.\n * </p>\n * <p>\n * Additional states that are present in the {@link #getInitialState() initial state}\n * but have no evolution method registered are <em>not</em> considered as managed states.\n * These unmanaged additional states are not lost during propagation, though. Their\n * value will simply be copied unchanged throughout propagation.\n * </p>\n * @param name name of the additional state\n * @return true if the additional state is managed\n */\n boolean isAdditionalStateManaged(String name);\n\n /** Get all the names of all managed states.\n * @return names of all managed states\n */\n String[] getManagedAdditionalStates();\n\n /** Add an event detector.\n * @param detector event detector to add\n * @see #clearEventsDetectors()\n * @see #getEventsDetectors()\n * @param <T> class type for the generic version\n */\n <T extends EventDetector> void addEventDetector(T detector);\n\n /** Get all the events detectors that have been added.\n * @return an unmodifiable collection of the added detectors\n * @see #addEventDetector(EventDetector)\n * @see #clearEventsDetectors()\n */\n Collection<EventDetector> getEventsDetectors();\n\n /** Remove all events detectors.\n * @see #addEventDetector(EventDetector)\n * @see #getEventsDetectors()\n */\n void clearEventsDetectors();\n\n /** Get attitude provider.\n * @return attitude provider\n */\n AttitudeProvider getAttitudeProvider();\n\n /** Set attitude provider.\n * @param attitudeProvider attitude provider\n */\n void setAttitudeProvider(AttitudeProvider attitudeProvider);\n\n /** Get the frame in which the orbit is propagated.\n * <p>\n * The propagation frame is the definition frame of the initial\n * state, so this method should be called after this state has\n * been set, otherwise it may return null.\n * </p>\n * @return frame in which the orbit is propagated\n * @see #resetInitialState(SpacecraftState)\n */\n Frame getFrame();\n\n /** Propagate towards a target date.\n * <p>Simple propagators use only the target date as the specification for\n * computing the propagated state. More feature rich propagators can consider\n * other information and provide different operating modes or G-stop\n * facilities to stop at pinpointed events occurrences. In these cases, the\n * target date is only a hint, not a mandatory objective.</p>\n * @param target target date towards which orbit state should be propagated\n * @return propagated state\n * @exception OrekitException if state cannot be propagated\n */\n SpacecraftState propagate(AbsoluteDate target) throws OrekitException;\n\n /** Propagate from a start date towards a target date.\n * <p>Those propagators use a start date and a target date to\n * compute the propagated state. For propagators using event detection mechanism,\n * if the provided start date is different from the initial state date, a first,\n * simple propagation is performed, without processing any event computation.\n * Then complete propagation is performed from start date to target date.</p>\n * @param start start date from which orbit state should be propagated\n * @param target target date to which orbit state should be propagated\n * @return propagated state\n * @exception OrekitException if state cannot be propagated\n */\n SpacecraftState propagate(AbsoluteDate start, AbsoluteDate target) throws OrekitException;\n\n}", "public void goToLocation (Locator checkpoint) { //Patrolling Guard and Stationary Guard\r\n\t\tVector2i start = new Vector2i((int)(creature.getXlocation()/Tile.TILEWIDTH), (int)(creature.getYlocation()/Tile.TILEHEIGHT));\r\n\t\tint destx = (int)(checkpoint.getX()/Tile.TILEWIDTH);\r\n\t\tint desty = (int)(checkpoint.getY()/Tile.TILEHEIGHT);\r\n\t\tif (!checkCollision(destx, desty)) {\r\n\t\tVector2i destination = new Vector2i(destx, desty);\r\n\t\tpath = pf.findPath(start, destination);\r\n\t\tfollowPath(path);\r\n\t\t}\r\n\t\tarrive();\r\n\t}", "protected void execute() {\n \t\n \tdouble angleDifference;\n \t\n \tif (useTargetAngle) {\n \t\tangleDifference = Math.abs(Gyroscope.simplifyAngle(Robot.gyroscope.getGlobalRotation()) - Gyroscope.simplifyAngle(targetAngle));\n \t}\n \telse {\n \t\tangleDifference = Math.abs(Robot.gyroscope.getRotation());\n \t}\n \t\n \tif (angleDifference > ROTATION_THRESHOLD) {\n \t\tif (Robot.gyroscope.getRotation() > 0) {\n \t\t\tadjustPercentRight = ROTATION_PERCENT;\n \t\t\tadjustPercentLeft = 1;\n \t\t}\n \t\telse {\n \t\t\tadjustPercentRight = 1;\n \t\t\tadjustPercentLeft = ROTATION_PERCENT;\n \t\t}\n \t}\n \t\n \trightEncoderPID.setSetpoint(getVelocity() * adjustPercentRight);\n \tleftEncoderPID.setSetpoint(getVelocity() * adjustPercentLeft);\n \t\n \t//print out debug data to smartdash\n \tSmartDashboard.putNumber(\"Left Encoder Vel:\", Robot.drive.leftEncoder.getRate());\n \tSmartDashboard.putNumber(\"Right Encoder Vel\", Robot.drive.rightEncoder.getRate());\n \t\n \tSmartDashboard.putNumber(\"Left Encoder Dist\", Robot.drive.leftEncoder.getDistance());\n \tSmartDashboard.putNumber(\"Right Encoder Dist\", Robot.drive.leftEncoder.getDistance());\n \t\n \tupdateState();\n \t\n \t//keep at low speed if decelerating period is up\n \tif (currentState == DriveState.decelerating && (timer.get() > tAccelerating)) {\n \trightEncoderPID.setSetpoint(FINAL_ADJUST_SPEED);\n \tleftEncoderPID.setSetpoint(FINAL_ADJUST_SPEED);\n \t}\n }", "@Override\n public void execute() {\n\n angleCorrection = pidAngle.run(drivetrain.getGyroAngle(), targetAngle);\n \n speedCorrection = pidSpeed.run(distanceTraveled, targetDistance);\n \n if (speedCorrection > 1.0) {\n speedCorrection = 1.0;\n } else if (speedCorrection < -1.0) {\n speedCorrection = -1.0;\n }\n drivetrain.autoDrive(speedCorrection * direction * kAutoDriveSpeed + angleCorrection, speedCorrection * direction*kAutoDriveSpeed - angleCorrection);\n SmartDashboard.putNumber(\"Angle Correction\", angleCorrection);\n SmartDashboard.putNumber(\"Speed Correction\", speedCorrection);\n\n double totalRotationsRight = Math.abs((drivetrain.getMasterRightEncoderPosition() - rightEncoderStart));\n double totalRotationsLeft = Math.abs((drivetrain.getMasterLeftEncoderPosition() - leftEncoderStart));\n\n distanceTraveled = (kWheelDiameter * Math.PI * (totalRotationsLeft + totalRotationsRight) / 2.0) / AUTO_ENCODER_REVOLUTION_FACTOR;\n }", "public Object call() throws Exception {\n player.setX(sendPosition.getX());\r\n player.setY(sendPosition.getY());\r\n return null;\r\n }", "void applyToComputationState();", "protected void sendEstimatedPositionToTracker(int x, int y, int angle) {\n\t\thandler.sendEstimatedPositionToTracker(x, y, angle);\n\t}", "public TransitionCoordinator(\n final MiningCoordinator miningCoordinator, final MiningCoordinator mergeCoordinator) {\n super(miningCoordinator, mergeCoordinator, PostMergeContext.get());\n this.miningCoordinator = miningCoordinator;\n this.mergeCoordinator = (MergeMiningCoordinator) mergeCoordinator;\n }", "void registerCommandCoordinator(@NonNull ICommandCoordinator coordinator);", "@Override\n\tpublic void execute() {\n\t\tmoteur.couper();\n\t}", "protected void commitTask(final ManifestCommitter committer,\n final TaskAttemptContext tContext) throws IOException {\n committer.commitTask(tContext);\n }", "@Override\r\n\tpublic boolean savePosition(Position post) throws Exception {\n\t\treturn false;\r\n\t}", "public void coordinate(final Command command) \n\t\t\t\tthrows PersistenceException{\n CommandExecuter4Public executer;\n\t\tif (!this.getExecuter().iterator().hasNext()){\n\t\t\texecuter = CommandExecuter.createCommandExecuter();\n\t\t\tthis.getExecuter().add(executer);\n\t\t\t\n\t\t}\n\t\texecuter = this.getExecuter().iterator().next();\n\t\tif (!executer.isAlive()) throw new PersistenceException(\"Fatal error: Transaction executer has terminated!\", 0);\n\t\texecuter.commandPut(command);\n }", "@Override\n protected void execute() {\n sClimber.setMotorSpeed(-stick.getRawAxis(1));\n //sIntake.WristMove(mWristAngle);\n //sElevator.setPositionLowGear(mElevatorHieght);\n // SmartDashboard.putNumber(\"Wrist Volts\", RobotMap.WristMotor.getMotorOutputVoltage());\n }", "public void doCall(){\n CalculatorPayload operation = newContent();\n\n ((PBFTClient)getProtocol()).syncCall(operation);\n }", "@Override\n public void execute() {\n var swerveModuleStates = calcDrive(//\n xSmooth.calc(xSpd.get() * DriveConstants.kTeleDriveMaxSpeedMetersPerSecond), //\n ySmooth.calc(ySpd.get() * DriveConstants.kTeleDriveMaxSpeedMetersPerSecond), //\n rotSmooth.calc(rotSpd.get() * DriveConstants.kTeleDriveMaxAngularSpeedRadiansPerSecond), //\n fieldOriented);\n swerveDrivetrain.setModuleStates(swerveModuleStates);\n }", "public void execute() {\n\t\t\n\t\tdrivetrain.updateAnglePID();\n\t\t\n//\t\tif (drivetrain.currentControl()) {\n//\t\t\tdrivetrain.shiftGears();\n//\t\t}\n\t}", "public GridPosition run(){\n\t\t\n\t\tinstructions.forEach(i -> {\n\t\t\tGridPosition newPosition = i.nextPosition(position);\n\t\t\tlogger.fine(\"new position is \"+newPosition.toString());\n\t\t\tif(validator.validate(position, newPosition)){\n\t\t\t\tvalidator.addUsedCoordinate(newPosition);\n\t\t\t\tGridPosition oldPosition = position;\n\t\t\t\tposition = newPosition;\n\t\t\t\tvalidator.removeUnusedCoordinate(oldPosition);\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tlogger.warning(\"The new position \"+newPosition.toString()+\" is not valid, the lawn mower remain on the current position\");\n\t\t\t\t//if position is not valid, mower keep at the current position and execute next instruction\n\t\t\t}\n\t\t});\n\t\t\n\t\treturn position;\n\t}", "@Override\n public int save( Mention obj ) {\n return 0;\n }", "@Override\n protected void execute() {\n System.out.println(\"Elevator PID Loop:\");\n System.out.println(\"\\t - Current Position: \" + Robot.m_elevator.getEncoder().getPosition());\n \n SmartDashboard.putNumber(\"elevator/pos\", Robot.m_elevator.getEncoder().getPosition());\n // SmartDashboard.putNumber(\"elevator/target\", pos);\n //SmartDashboard.putNumber(\"elevator/error\", Math.abs(Robot.m_elevator.getEncoder().getPosition() - pos));\n // System.out.println(\"\\t - Error: \" + Robot.m)\n }", "private Mutater createMutater(int mutationpoint) {\n final Mutater m = new Mutater(mutationpoint);\n m.setIgnoredMethods(mExcludeMethods);\n m.setMutateIncrements(mIncrements);\n m.setMutateInlineConstants(mInlineConstants);\n m.setMutateReturnValues(mReturnVals);\n return m;\n }", "public void sync()\n {\n setAutoSync(false);\n // simply send sync command\n super.executionSync(Option.SYNC);\n }", "@Override\n\t\t\tpublic void insertFriendPreExecute() {\n\t\t\t\t\n\t\t\t}", "@Override\n public void execute() {\n node.toggleBoundaryMarker();\n }", "private void doPoint()\n\t{\n\t\tubisenseData = new UbisenseMockupData();\n\n\t\telapsedTime = 0;\n\t\t\n\t\tubisenseData.setTagID(Helper.DEFAULT_TAG_ID);\n\t\tubisenseData.setUnit(Helper.UBISENSE_UNIT);\n\t\tubisenseData.setOntology(Helper.LP_ONTOLOGY_URL);\n\t\tubisenseData.setVersion(Helper.UBISENSE_VERSION);\n\t\tubisenseData.setId(\"\");\n\t\tubisenseData.setSendTime(sendTime);\n\t\tubisenseData.setPosition(new Point3D(\tx1/100,\n\t\t\t\t\t\t\t\t\t\t\t\ty1/100,\n\t\t\t\t\t\t\t\t\t\t\t\t1.6));\n\t\tlong millis = startDate.getMillis();\n\t\tmillis += offset.toStandardDuration().getMillis();\n//\t\tmillis += parentOffset.toStandardDuration().getMillis();\n\n\t\twhile (elapsedTime < toolDuration && !this.terminate)\n\t\t{\n\t\t\tubisenseData.setId(String.valueOf(Helper.getRandomInt()));\n\t\t\tubisenseData.setTime(millis + (long)(elapsedTime*SLEEP_INTERVAL));\n\t\t\tEntryEvent event = new EntryEvent(this);\n\t\t\tthis.notifyListeners(event);\n\t\t\telapsedTime++;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (speed > 0)\n\t\t\t\t\tThread.sleep(SLEEP_INTERVAL/speed);\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\n\t}", "public ExecuteState() {\r\n PrevPC = 0;\r\n ChangedLoc = -1;\r\n OldInst = new CodeBlueInstruction();\r\n }", "protected void execute() {\r\n \tmanipulator.moveElevator(speed);\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}", "@Override\n protected void execute() {\n SmartDashboard.putNumber(\"Encoder Value: \", encoderMotor.getSelectedSensorPosition());\n }", "private void update_location() throws Exception {\r\n\t\tif (children.size() == 1) {\r\n\t\t\tCLocation bloc = children.get(0).get_location();\r\n\t\t\tthis.location = bloc.get_source().get_location(bloc.get_bias(), bloc.get_length());\r\n\t\t} else if (children.size() > 1) {\r\n\t\t\tCLocation eloc = children.get(children.size() - 1).get_location();\r\n\t\t\tint beg = this.location.get_bias(), end = eloc.get_bias() + eloc.get_length();\r\n\t\t\tthis.location.set_location(beg, end - beg);\r\n\t\t}\r\n\t}", "@Override\n\tpublic void commitOffsets() {\n\n\t}", "public void moveTo(Point point){\n updateUndoBuffers(new LinkedList<>());\n xPos = point.getMyX()+myGrid.getWidth()/ HALF;\n yPos = myGrid.getHeight()/ HALF-point.getMyY();\n }", "public abstract Chromosome mutation(Chromosome child);", "@Test\n\tpublic void testBug421487() throws Exception {\n\t\tCoordination c1 = coordinator.begin(\"c1\", 0); //$NON-NLS-1$\n\t\t// Begin a second thread coordination on this thread.\n\t\tCoordination c2 = coordinator.begin(\"c2\", 0); //$NON-NLS-1$\n\t\t// c2's enclosing coordination will be c1.\n\t\tassertEquals(\"Wrong enclosing coordination\", c1, c2.getEnclosingCoordination()); //$NON-NLS-1$\n\t\tWeakReference<Coordination> reference = new WeakReference<Coordination>(c1);\n\t\t// Set c1 to null so it will become weakly reachable and enqueued.\n\t\tc1 = null;\n\t\t// Ensure c1 becomes weakly reachable.\n\t\tfor (int i = 0; i < 100 && reference.get() != null; i++)\n\t\t\t// Force garbage collection.\n\t\t\tSystem.gc();\n\t\tassertNull(\"The enclosing coordination never became weakly reachable\", reference.get()); //$NON-NLS-1$\n\t\t// For some reason, this delay is necessary to force the failure \n\t\t// condition to occur when running \"normally\". The failure will occur\n\t\t// without this delay when running in debug mode with or without \n\t\t// breakpoints.\n\t\tThread.sleep(1000);\n\t\ttry {\n\t\t\t// End the enclosed coordination.\n\t\t\tc2.end();\n\t\t} catch (CoordinationException e) {\n\t\t\t// A CoordinationException of type ALREADY_ENDED is expected since \n\t\t\t// the coordination was failed.\n\t\t\tassertEquals(\"Wrong type\", CoordinationException.ALREADY_ENDED, e.getType()); //$NON-NLS-1$\n\t\t} catch (NullPointerException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail(\"Received NPE while ending the coordination\"); //$NON-NLS-1$\n\t\t}\n\t}", "public void callOnTeleport() {\n\t\tif (summonedFamiliar != null && c.getInstance().summoned != null) {\n\t\t\tc.getInstance().summoned.killerId = 0;\n\t\t\tc.getInstance().summoned.underAttackBy = 0;\n\t\t\tc.getInstance().summoned.npcTeleport(0, 0, 0);\n\t\t\tc.getInstance().summoned.updateRequired = true;\n\t\t\tc.getInstance().summoned = Server.npcHandler.summonNPC(c, summonedFamiliar.npcId, c.getX(),\n\t\t\t\t\tc.getY() + (summonedFamiliar.large ? 2 : 1), c.heightLevel, 0, c.getInstance().summoned.HP, 1, 1,\n\t\t\t\t\t1);\n\t\t\tcallFamiliar();\n\t\t} else {\n\t\t\tc.getPA().sendSummOrbDetails(false, \"\");\n\t\t}\n\t}", "@Override\n\tprotected OperationResult persistResult() throws IOException {\n\t\treturn App.getState().get(processInput());\n\t}", "public void Mirror() {\n\t\t\r\n\t}", "@Override\n public void execute() {\n double output = controller.calculate(driveSubsystem.getHeading(), setPoint);\n driveSubsystem.driveCartesan(0.0, 0.0, output / 180);\n }", "@Override\r\n protected void computeReferencePoint ()\r\n {\r\n setReferencePoint(getHeadLocation());\r\n }", "@Override\n\tpublic void execute() {\n\t\tthis.receiver.add(this.question, 42);\n\t}", "protected void execute() {\n \tdouble currentAngle = driveTrain.gyro.getYaw();\n \tdriveTrain.drive.arcadeDrive(speed, 0);\n }", "private void performDirectEdit() {\n\t}", "protected void elementInstered(MutationEvent evt) throws MelodyException {\r\n\t\tsuper.elementInstered(evt);\r\n\t\t// the inserted node\r\n\t\tElement t = (Element) evt.getTarget();\r\n\t\t// its next sibling\r\n\t\tNode s = t.getNextSibling();\r\n\t\twhile (s != null && s.getNodeType() != Node.ELEMENT_NODE) {\r\n\t\t\ts = s.getNextSibling();\r\n\t\t}\r\n\t\tDUNID sdunid = DUNIDDocHelper.getDUNID((Element) s);\r\n\t\t// its parent node\r\n\t\tElement p = (Element) t.getParentNode();\r\n\t\tDUNID pdunid = DUNIDDocHelper.getDUNID(p);\r\n\t\t// Modify the DUNIDDoc\r\n\t\tDocument d = getOwnerDUNIDDoc(p).getDocument();\r\n\t\tElement pori = DUNIDDocHelper.getElement(d, pdunid);\r\n\t\tpori.insertBefore(d.importNode(t, true),\r\n\t\t\t\tDUNIDDocHelper.getElement(d, sdunid));\r\n\t\t// Modify the targets descriptor\r\n\t\tif (!areTargetsFiltersDefined()) {\r\n\t\t\t/*\r\n\t\t\t * If there is no targets filters defined, there's no need to modify\r\n\t\t\t * the targets descriptor.\r\n\t\t\t */\r\n\t\t\treturn;\r\n\t\t}\r\n\t\td = getTargetsDescriptor().getDocument();\r\n\t\tpori = DUNIDDocHelper.getElement(d, pdunid);\r\n\t\tif (pori != null) { // inserted node parent is in the targets descriptor\r\n\t\t\tpori.insertBefore(d.importNode(t, true),\r\n\t\t\t\t\tDUNIDDocHelper.getElement(d, sdunid));\r\n\t\t}\r\n\t}", "public void commitOffset() {\n if (!manualCommit) {\n consumer.commitAsync(new OffsetCommitCallback() {\n @Override\n public void onComplete(Map<TopicPartition, OffsetAndMetadata> offsets, Exception exception) {\n if (exception != null) {\n for (Map.Entry<TopicPartition, OffsetAndMetadata> entry : offsets.entrySet()) {\n log.warn(\"Commit offset fail: {}, {}\", entry.getValue().metadata(), entry.getValue().offset());\n }\n throw new KafkaProxyRuntimeException(\"Fail to commit offset\", exception);\n } else {\n for (Map.Entry<TopicPartition, OffsetAndMetadata> entry : offsets.entrySet()) {\n log.debug(\"Commit offset : {}, {}\", entry.getValue().metadata(), entry.getValue().offset());\n }\n }\n }\n });\n }\n }", "public void execute() throws ActionExecutionException {\n // perform the update operation\n CompartmentExtractor extractor = this.getExtractor();\n savedValue = extractor.extractFirstAssociationEnd();\n extractor.updateFirstAssociationEnd((GraphElement) executeValue);\n\n // identify the action can be undo\n this.executionSuccess();\n }", "public synchronized void setAgentCoordinate() {\n agentCoordinate = getCoordinate(agentState);\n }", "@Override\n\tpublic String ProcessMsg(InProcessFrame frame, MsgBean msgBean) {\n\t\tKVContainer kvContainer = ConfirmOrder.GetKeyFromMsg(msgBean.Msg);\n\t\tCfgBean cfgbean = NodeDictionary.GetResponser((String) kvContainer\n\t\t\t\t.getKey());\n\t\t// 如果本届点就是存储该数据的节点的话\n\t\tSystem.err.println(\"target sign:\" + cfgbean.sign + \"---------->now get:\" + CfgCenter.selfbean.sign);\n//\t\tSystem.exit(0);\n\t\tif (cfgbean.sign.equals(CfgCenter.selfbean.sign)\n\t\t\t\t|| SINGLEDEBUG) {\n\t\t\t// 设置值\n\t\t\tthis.SetKVToStore((String) kvContainer.getKey(),\n\t\t\t\t\t(String) kvContainer.getValue(), CfgCenter.selfbean);\n\t\t\t// 更新 frame\n\t\t\t// CfgBean cfgOpposite = frame.OppositeSide; //\n\t\t\t// 发起确认相应\n\t\t\tif (msgBean.isOrigin.equals(\"0\")) {//判断是否是需要像client回复的msg\n\t\t\t\t/*\n\t\t\t\t * TODO 客户端也必须将客户端自己的transactionNo和处理事务关联起来,否则无法确认\n\t\t\t\t */\n\t\t\t\tMsgAsile.addSendBean(new MsgBean(CfgCenter.selfbean,\n\t\t\t\t\t\tmsgBean.TransactionSerialNo.toString(),\n\t\t\t\t\t\tCfgCenter.selfbean.voteSeriNo, \"Confirm\",\n\t\t\t\t\t\tmsgBean.Msg));\n\t\t\t}\n\t\t\t// 本次处理已经结束\n\t\t\tProcessWindow.FrameFinish(frame);\n\t\t} else {\n\t\t\tSPSDebugHelper.Speaker(\"非本节点处理该数据,该请求将被转发\", 1);\n\t\t\t/*\n\t\t\t * 规划 1,sign被替换 2,transactionNo被替换为本届点的TransactioinNo 3,放入发送队列\n\t\t\t * \n\t\t\t * TODO 要想建立transactionNo和frame之间的关系,还需要对processwindow进行更改,\n\t\t\t * 必须存在一个缓冲区从transactionNo映射到frame 为了达到这个目的缓冲区的删除等逻辑需要更改\n\t\t\t */\n\t\t\tsynchronized (CfgCenter.TransanctionNo) {\n\n\t\t\t\tMsgAsile.addSendBean(super.ChangeToThisNode(msgBean));\n\t\t\t}\n\n\t\t}\n\t\treturn null;\n\t}", "@Override\n public double calculate(double measurement, double setpoint) {\n // Set setpoint to provided value\n setSetpoint(setpoint);\n return calculate(measurement);\n }", "public void flushCheckpoint(long checkpoint)\r\n/* 124: */ {\r\n/* 125:155 */ this.checkpoint = checkpoint;\r\n/* 126: */ }", "@Override\n\tvoid make_deposit(DataStore ds){\n\tds.setbalancedepositAccount1(ds.getbalanceAccount1_temp()+ds.getdepositAccount1());\n\t}", "static synchronized void makeNewCheckpoint() {\n HashMap<String, String> newCheckpoint = new HashMap<>(localState);\n checkpoints.put(Thread.currentThread(), newCheckpoint);\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\ta1.deposit(1000);\n\t\t\t}", "@Override\n\tpublic void commit() throws Throwable {\n\t\tthrow new Warning(\"please use commit(context)\");\n\t}", "public boolean activate()\n {\n boolean result = super.activate();\n\n // if we cannot activate we want the participant which was registered on behalf of this\n // coordinator to produce a heuristic result for the transaction. it will do this if it\n // finds no entry for the coordinate in the subordinate coordinators list. in this case\n // the subordinate transaction record needs to left as is awaiting manual intervention.\n\n if (result) {\n // record that the activation worked\n setActivated();\n\n int status = status();\n\n if (status == ActionStatus.PREPARED || status == ActionStatus.COMMITTING) {\n // we need to install this coordinator in a global table so that the participant which\n // was driving it will know that it has been recovered but not yet committed\n\n SubordinateBACoordinator.addRecoveredCoordinator(this);\n }\n }\n return result;\n }", "public void execute() {\n for (CoordAction<PCEData,PCEData> pce : this) {\n pce.setRequestData(this.getRequestData());\n // Aggregators trigger the execution of its children PCE's before they are\n // executed themselves.\n pce.process();\n }\n }", "@Suspendable\n @Override\n public Void call() throws FlowException {\n // We retrieve the notary identity from the network map.\n final Party notary = getServiceHub().getNetworkMapCache().getNotaryIdentities().get(0);\n QueryCriteria queryCriteria = new QueryCriteria.LinearStateQueryCriteria(null, ImmutableList.of(this.linearId),\n Vault.StateStatus.UNCONSUMED, null);\n List<StateAndRef<NDAState>> ndaStates = getServiceHub().getVaultService().queryBy(NDAState.class, queryCriteria).getStates();\n\n // We create the transaction components.\n NDAState outputState = new NDAState(getOurIdentity(), crmParty, \"APPROVED\");\n StateAndContract outputStateAndContract = new StateAndContract(outputState, LEGAL_CONRACT_ID);\n List<PublicKey> requiredSigners = ImmutableList.of(getOurIdentity().getOwningKey(), crmParty.getOwningKey());\n Command cmd = new Command<>(new LegalContract.Approve(), requiredSigners);\n\n // We create a transaction builder and add the components.\n final TransactionBuilder txBuilder = new TransactionBuilder();\n txBuilder.addInputState(ndaStates.get(0));\n txBuilder.setNotary(notary);\n txBuilder.withItems(outputStateAndContract, cmd);\n\n // Signing the transaction.\n final SignedTransaction signedTx = getServiceHub().signInitialTransaction(txBuilder);\n // Creating a session with the other party.\n FlowSession otherpartySession = initiateFlow(crmParty);\n // Obtaining the counterparty's signature.\n SignedTransaction fullySignedTx = subFlow(new CollectSignaturesFlow(\n signedTx, ImmutableList.of(otherpartySession), CollectSignaturesFlow.tracker()));\n // Finalising the transaction.\n subFlow(new FinalityFlow(fullySignedTx));\n return null;\n }", "public GuidedTreeMutationCoordinator(CentralRegistry registry, double chanceOfRandomMutation,\n\t\t\tboolean preventDuplicates, LinkedHashMap<TreeMutationAbstract, Double> smartMutators,\n\t\t\tTreeMutationCoordinator dumbCoordinator) {\n\t\tthis.registry = registry;\n\t\tthis.chanceOfRandomMutation = chanceOfRandomMutation;\n\t\tthis.preventDuplicates = preventDuplicates;\n\t\tthis.smartMutators = smartMutators;\n\t\tthis.dumbCoordinator = dumbCoordinator;\n\t\tcalculateTotalChance();\n\t}", "@Override\n public void execute() {\n drivetrain.set(ControlMode.MotionMagic, targetDistance, targetDistance);\n }" ]
[ "0.5530032", "0.5430956", "0.5352332", "0.5251477", "0.5241299", "0.5234769", "0.505578", "0.50456274", "0.49634022", "0.49331242", "0.49225426", "0.4896947", "0.48937696", "0.48650432", "0.48545378", "0.48506504", "0.48418695", "0.48312375", "0.4805957", "0.47986406", "0.47867933", "0.4777244", "0.4771407", "0.47658062", "0.4755395", "0.47306737", "0.4718598", "0.47010338", "0.47010338", "0.46862048", "0.46849597", "0.4670088", "0.46635342", "0.4661257", "0.46528253", "0.46384713", "0.4637377", "0.4635111", "0.4623985", "0.46178514", "0.46085414", "0.46071982", "0.46071506", "0.46052447", "0.46031588", "0.4599447", "0.4593448", "0.45922035", "0.45850605", "0.45843798", "0.45776606", "0.45697808", "0.45516604", "0.45483083", "0.45408767", "0.45407632", "0.45330003", "0.45329204", "0.45305014", "0.45293415", "0.452375", "0.45223388", "0.45216534", "0.45201868", "0.45185798", "0.451806", "0.45173222", "0.45147562", "0.45145988", "0.45104682", "0.45100987", "0.4508152", "0.45034692", "0.45013934", "0.4498474", "0.44915056", "0.44901514", "0.4483781", "0.4482304", "0.44794306", "0.44743225", "0.4470839", "0.4470207", "0.44691297", "0.4463766", "0.4461978", "0.446006", "0.44571754", "0.44537887", "0.4452661", "0.44490126", "0.444503", "0.44427612", "0.44378304", "0.443686", "0.44339457", "0.4433145", "0.44243914", "0.44240427", "0.44235674" ]
0.44438407
92
May return no FlowState if the FlowState represented by the lookupKey was already completed.
@Override public FlowState call() { // TODO: We should not need? to pass the flowState because this flow is already known (reapplying same values???) FlowState flowState = getFlowState(); if ( flowState == null ) { throw new FlowException("No flowState with id:", getExistingFlowStateLookupKey()); } else { return getFlowManagementWithCheck().continueFlowState(getExistingFlowStateLookupKey(), true, this.getInitialFlowState()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String lookupKey(String key) throws CommunicationFailureException, TimeoutReachedException, NoSuccessorsExceptions;", "@Override\n public void checkDone() throws IllegalStateException {\n if (NO_KEYS.equals(range)\n || (!range.getEndKey().isEmpty() && range.getStartKey().equals(range.getEndKey()))) {\n return;\n }\n\n checkState(\n lastAttemptedKey != null,\n \"Key range is non-empty %s and no keys have been attempted.\",\n range);\n\n // Return if the last attempted key was the empty key representing the end of range for\n // all ranges.\n if (lastAttemptedKey.isEmpty()) {\n return;\n }\n\n // The lastAttemptedKey is the last key of current restriction.\n if (!range.getEndKey().isEmpty() && next(lastAttemptedKey).compareTo(range.getEndKey()) >= 0) {\n return;\n }\n\n // If the last attempted key was not at or beyond the end of the range then throw.\n if (range.getEndKey().isEmpty() || range.getEndKey().compareTo(lastAttemptedKey) > 0) {\n ByteKey nextKey = next(lastAttemptedKey);\n throw new IllegalStateException(\n String.format(\n \"Last attempted key was %s in range %s, claiming work in [%s, %s) was not attempted\",\n lastAttemptedKey, range, nextKey, range.getEndKey()));\n }\n }", "@Override\n public String findState(String name) {\n int hash = getHash(name); // Calculate the hash for the input value \n String message;\n int pos = 1;\n Node temp = hashTable[hash]; // Go to the first node in the appropriate linked list\n\n // Traverse the linked list until the value is found or the end of the list is reached\n while (temp != null && name.compareTo(temp.getState().getName()) != 0) {\n temp = temp.getNext();\n pos++;\n }\n if (temp == null) { // Was the end of the list reached\n message = String.format(\"%s was not found\", name);\n } else {\n message = String.format(\"%s is located at Hash: %d Position: %d\", name, hash, pos);\n }\n return message;\n }", "private int probe(Random generator, K key) {\n boolean found = false;\n\n int index = generator.nextInt(hashTable.length);\n\n int removedStateIndex = -1; // Index of first location in\n // removed state\n\n while (!found && (hashTable[index] != null)) {\n if (hashTable[index].isIn()) {\n if (key.equals(hashTable[index].getKey())) {\n found = true; // Key found\n } else // Follow probe sequence\n {\n index = generator.nextInt(hashTable.length); // Linear probing\n }\n } else // Skip entries that were removed\n {\n // Save index of first location in removed state\n if (removedStateIndex == -1) {\n removedStateIndex = index;\n }\n index = generator.nextInt(hashTable.length); // Linear probing\n } // end if\n totalProbes++;\n } // end while\n\n\n // Assertion: Either key or null is found at hashTable[index]\n if (found || (removedStateIndex == -1) )\n return index; // Index of either key or null\n else\n return removedStateIndex; // Index of an available location\n }", "String getLookupKey();", "void actionCompleted(ActionLookupData actionLookupData);", "public Object getState(String key) {\n\t\treturn null;\n\t}", "@Override\n public State getState(String key) {\n\n CompositeKey ledgerKey = this.ctx.getStub().createCompositeKey(this.name, State.splitKey(key));\n\n byte[] data = this.ctx.getStub().getState(ledgerKey.toString());\n if (data != null) {\n State state = this.deserializer.deserialize(data);\n return state;\n } else {\n return null;\n }\n }", "public abstract boolean lookup(Key key);", "private int waitUntilReady()\r\n {\r\n int rc = 0;\r\n // If a stock Item is in the Table, We do not want to start\r\n // The Lookup, if the name of the stock has not been identified.\r\n // here we will wait just a couple a second at a time.\r\n // until, the user has entered the name of the stock.\r\n // MAXWAIT is 20 minutes, since we are 1 second loops.\r\n // 60 loops is 1 minute and 20 of those is 20 minutes\r\n final int MAXWAIT = 60 * 20;\r\n int counter = 0;\r\n do\r\n {\r\n try\r\n {\r\n Thread.currentThread().sleep(ONE_SECOND);\r\n }\r\n catch (InterruptedException exc)\r\n {\r\n // Do Nothing - Try again\r\n }\r\n if (counter++ > MAXWAIT)\r\n { // Abort the Lookup for historic data\r\n this.cancel();\r\n return -1;\r\n }\r\n }\r\n while (\"\".equals(sd.getSymbol().getDataSz().trim()));\r\n\r\n return 0;\r\n }", "private NFAState checkIfExists(String name) {\n\t\tNFAState ret = null;\n\t\tfor(NFAState s : states){\n\t\t\tif(s.getName().equals(name)){\n\t\t\t\tret = s;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}", "private NFAState checkIfExists(String name) {\r\n\t\tNFAState ret = null;\r\n\t\tfor (NFAState s : states) {\r\n\t\t\tif (s.getName().equals(name)) {\r\n\t\t\t\tret = s;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ret;\r\n\t}", "Object getAfterMiss(ThreadLocal<?> key) {\n Object[] table = this.table;\n int index = key.hash & mask;\n\n // If the first slot is empty, the search is over.\n if (table[index] == null) {\n Object value = key.initialValue();\n\n // If the table is still the same and the slot is still empty...\n if (this.table == table && table[index] == null) {\n table[index] = key.reference;\n table[index + 1] = value;\n size++;\n\n cleanUp();\n return value;\n }\n\n // The table changed during initialValue().\n put(key, value);\n return value;\n }\n\n // Keep track of first tombstone. That's where we want to go back\n // and add an entry if necessary.\n int firstTombstone = -1;\n\n // Continue search.\n for (index = next(index);; index = next(index)) {\n Object reference = table[index];\n if (reference == key.reference) {\n return table[index + 1];\n }\n\n // If no entry was found...\n if (reference == null) {\n Object value = key.initialValue();\n\n // If the table is still the same...\n if (this.table == table) {\n // If we passed a tombstone and that slot still\n // contains a tombstone...\n if (firstTombstone > -1\n && table[firstTombstone] == TOMBSTONE) {\n table[firstTombstone] = key.reference;\n table[firstTombstone + 1] = value;\n tombstones--;\n size++;\n\n // No need to clean up here. We aren't filling\n // in a null slot.\n return value;\n }\n\n // If this slot is still empty...\n if (table[index] == null) {\n table[index] = key.reference;\n table[index + 1] = value;\n size++;\n\n cleanUp();\n return value;\n }\n }\n\n // The table changed during initialValue().\n put(key, value);\n return value;\n }\n\n if (firstTombstone == -1 && reference == TOMBSTONE) {\n // Keep track of this tombstone so we can overwrite it.\n firstTombstone = index;\n }\n }\n }", "public boolean nextState() {\n\t\treturn false;\n\t}", "private int get(Map<T, Integer> state, T key) {\n return state.getOrDefault(key, 0);\n }", "String lookupKeyBasic(String key) throws CommunicationFailureException, TimeoutReachedException, NoSuccessorsExceptions;", "@Override\r\n public ValueType get(KeyType key) throws NoSuchElementException {\r\n // if capacity is 0, throw an exception\r\n if (capacity == 0) {\r\n throw new NoSuchElementException(\"No Match Found\");\r\n }\r\n\r\n int index = hashFunction(key); // the index of the pair in the hashTable\r\n\r\n // If the linked list at the index is null, target is not exist, and throw an exception.\r\n if (hashTable[index] == null) {\r\n throw new NoSuchElementException(\"No Match Found\");\r\n }\r\n\r\n // Find the target in the linked list. If found, return the value, if not found, throw an exception.\r\n for (HashNode node : hashTable[index]) {\r\n if (node.key.equals(key)) {\r\n return node.value;\r\n }\r\n }\r\n throw new NoSuchElementException(\"No Match Found\");\r\n }", "@Override\n public common.FileLocation lookup(int key) throws RemoteException {\n common.FileLocation fl = map.get(key);\n if (fl == null) {\n printAct(\">requested of key: \" + key + \", returned null\");\n } else {\n printAct(\">requested of key: \" + key + \", returned: \" + fl);\n }\n return fl;\n }", "private StatusEnum stepInternal()\n {\n if (initialStep)\n {\n this.tail = map.getStart();\n this.openSet.push(map.getStart());\n initialStep = false;\n }\n\n if (status != StatusEnum.RUNNING)\n return status;\n\n cursor = openSet.pop(); // Pull the cursor off the open set min-heap\n if (cursor == null)\n {\n // The open set was empty, so although we have not reached the goal, there are no more points to investigate\n return StatusEnum.COMPLETED_NOT_FOUND;\n }\n\n while (closedSet.contains(cursor) || !map.isTraversable(cursor))\n {\n // The cursor is in the closed set (meaning it was already investigated) or the cursor point is non traversable on the map\n cursor = openSet.pop();\n if (cursor == null)\n {\n return StatusEnum.COMPLETED_NOT_FOUND;\n }\n }\n\n // The goal has been reached, the path is complete\n if (cursor.equals(map.getGoal()))\n {\n tail = cursor; // Set the member tail to be used in the reconstruction done in getPath()\n return StatusEnum.COMPLETED_FOUND;\n }\n\n // Add the cursor point to the closed set\n closedSet.add(cursor);\n\n // Get the list of neighboring points\n List<WeightedPoint> neighbors = neighborSelector.getNeighbors(map, cursor, heuristic);\n\n // Link the neighbors to the cursor (for backtracking the path when the goal is reached) and calculate their weight\n for (WeightedPoint wp : neighbors)\n {\n if (map.isTraversable(wp.getRow(), wp.getCol()) && !closedSet.contains(wp))\n {\n wp.setFromCost(cursor.getFromCost() + heuristic.distance(cursor, wp));\n\n if (dijkstra)\n {\n wp.setToCost(0);\n }\n else\n {\n wp.setToCost(heuristic.distance(wp, map.getGoal()));\n }\n wp.setPrev(cursor);\n }\n }\n\n if (shuffle)\n {\n // Shuffle the neighbors to randomize the order of testing nodes with the same cost value\n Collections.shuffle( neighbors );\n }\n Collections.sort( neighbors );\n\n // Put the neighbors on the open set\n for (WeightedPoint wp : neighbors)\n {\n if (!openSet.contains(wp))\n openSet.push(wp);\n }\n\n return StatusEnum.RUNNING;\n }", "private int locate(Random generator, K key)\n {\n boolean found = false;\n\n int index = generator.nextInt(hashTable.length);\n\n while ( !found && (hashTable[index] != null) )\n {\n if ( hashTable[index].isIn() &&\n key.equals(hashTable[index].getKey()) )\n found = true; // key found\n else // follow probe sequence\n index = generator.nextInt(hashTable.length); // Linear probing\n totalProbes++;\n } // end while\n\n // Assertion: Either key or null is found at hashTable[index]\n int result = -1;\n\n if (found)\n result = index;\n\n return result;\n }", "private void doLookup(int key)\n {\n String value = getLocalValue(key);\n if (value != null)\n {\n display(key, value);\n }\n else\n {\n getValueFromDB(key);\n } \n }", "public Optional<V> lookup(K key) {\n Optional<V> mt = Optional.empty();\n return this.entries.foldr(((kvp, o)-> kvp.left.equals(key) ? Optional.of(kvp.right) : o) , mt);\n }", "public StatusEnum solve()\n {\n while (status == StatusEnum.RUNNING)\n {\n step();\n }\n return status;\n }", "public MoveEvaluation alreadyDetermined(IGameState state) {\n\t\tNode<Pair> node = list.head();\n\t\t\n\t\twhile (node != null) {\n\t\t\tPair p = node.value();\n\t\t\tif (state.equivalent(p.state)) {\n\t\t\t\treturn p.move;\n\t\t\t}\n\t\t\t\n\t\t\tnode = node.next();\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "protected boolean isLookupDataFound() {\n return lookupDataFound;\n }", "@Step(\"Work Order Sub State Search Lookup\")\n public boolean lookupWorkOrderSubStateSearch(String searchText) {\n boolean flag = false;\n pageActions.clickAt(workOrderSubStateLookup, \"Clicking on Work Order Sub State Look Up Search\");\n try {\n SeleniumWait.hold(GlobalVariables.ShortSleep);\n functions.switchToWindow(driver, 1);\n pageActions.typeAndPressEnterKey(wrkOrdLookupSearch, searchText,\n \"Searching in the lookUp Window\");\n pageActions.typeAndPressEnterKey(searchInSubStateGrid, searchText,\n \"Searching in the lookUp Window Grid\");\n new WebDriverWait(driver, 20).until(ExpectedConditions\n .elementToBeClickable(By.xpath(\"//a[contains(text(),'\" + searchText + \"')]\")));\n flag =\n driver.findElement(By.xpath(\"//a[contains(text(),'\" + searchText + \"')]\")).isDisplayed();\n } catch (Exception e) {\n e.printStackTrace();\n logger.error(e.getMessage());\n }\n finally {\n functions.switchToWindow(driver, 0);\n }\n return flag;\n }", "private void foundNonExistent() {\n\t\tstate = BridgeState.NON_EXISTENT;\n\t}", "E find(KeyType key) {\n int position = findPosKey(key);\n if (mArray[position].state == FHhashQP.ACTIVE) {\n return mArray[findPosKey(key)].data;\n } else {\n throw new NoSuchElementException();\n }\n }", "private void eventLookupCompleted() {\n\t\tsynchronized(lookupCounterMutex) {\n\t\t\tlookupCounter--;\n\t\t\tif (lookupCounter == 0)\n\t\t\t\tlookupCounterMutex.notifyAll();\n\t\t}\n\t}", "@Test\n public void testSuccessFailsToResolve() throws NoSuchAlgorithmException, ComponentInitializationException {\n resolver.resolve = false;\n resolver.optional = true;\n\n ActionTestingSupport.assertProceedEvent(action.execute(requestCtx));\n Assert.assertNull(profileRequestCtx.getSubcontext(RelyingPartyContext.class)\n .getSubcontext(EncryptionContext.class).getAssertionEncryptionParameters());\n }", "public Place follow() {\n\t\t// Confirm this works...\n\t\tif (this.locked == false)\t\t\t\n\t\t\treturn to;\n\t\t// Locked, return original\n\t\t//System.out.println(\"\\nThat direction is locked. Find the key and use it!\");\n\t\tNetwork.netPrintln(\"\\nThat direction is locked. Find the key and use it!\");\n\t\treturn from;\n\t}", "abstract void waitForRehashCompletion();", "public STATE waitForStateNot(STATE notTargetState) {\n\t\n\t\tSTATE finalState;\n\t\tsynchronized (stateLock) {\n\t\t\twhile ((finalState = state) == notTargetState)\n\t\t\t\ttry {\n\t\t\t\t\tstateLock.wait();\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t}\n\t\t}\n\t\treturn finalState;\n\t}", "public DataValue lookup(String key) {\n if (validateKey(key)) {\n return getValueForKey(key);\n } else {\n return DataValue.NO_VALUE;\n }\n }", "public State next () { return nextState(); }", "public boolean getKeyState(InputKey key) {\n Boolean state = keyStates.get(key);\n return state != null && state;\n }", "public LookupInterimResult getLookupInterimResult() {\n return lookupInterimResult;\n }", "@Override\n public final SoyValue resolve() {\n SoyValue localResolvedValue = resolvedValue;\n if (localResolvedValue == null) {\n localResolvedValue = compute();\n for (ValueAssertion curr = valueAssertion; curr != null; curr = curr.next) {\n curr.check(localResolvedValue);\n }\n resolvedValue = localResolvedValue;\n valueAssertion = null;\n }\n return localResolvedValue;\n }", "@Override // io.reactivex.functions.Function\n public LoadingState<? super DeepLinkResponse> apply(TypedResult<DeepLinkResponse> typedResult) {\n TypedResult<DeepLinkResponse> typedResult2 = typedResult;\n Intrinsics.checkNotNullParameter(typedResult2, \"it\");\n if (typedResult2 instanceof TypedResult.OfResult) {\n return new LoadingState.Loaded(((TypedResult.OfResult) typedResult2).getResult());\n }\n if (typedResult2 instanceof TypedResult.OfError) {\n return new LoadingState.Error(((TypedResult.OfError) typedResult2).getError());\n }\n throw new NoWhenBranchMatchedException();\n }", "@Override // io.reactivex.functions.Function\n public LoadingState<? super DeepLinkResponse> apply(TypedResult<DeepLinkResponse> typedResult) {\n TypedResult<DeepLinkResponse> typedResult2 = typedResult;\n Intrinsics.checkNotNullParameter(typedResult2, \"it\");\n if (typedResult2 instanceof TypedResult.OfResult) {\n return new LoadingState.Loaded(((TypedResult.OfResult) typedResult2).getResult());\n }\n if (typedResult2 instanceof TypedResult.OfError) {\n return new LoadingState.Error(((TypedResult.OfError) typedResult2).getError());\n }\n throw new NoWhenBranchMatchedException();\n }", "@Test\n public void testFailureFailsToResolve() throws NoSuchAlgorithmException, ComponentInitializationException {\n resolver.resolve = false;\n ActionTestingSupport.assertEvent(action.execute(requestCtx), EventIds.INVALID_SEC_CFG);\n }", "State getState(Long stateId);", "int getSuccessor(int key)\n\t\tthrows IllegalArgumentException;", "final IntHashMapEntry lookupEntry(int par1)\n {\n int j = computeHash(par1);\n\n for (IntHashMapEntry inthashmapentry = this.slots[getSlotIndex(j, this.slots.length)]; inthashmapentry != null; inthashmapentry = inthashmapentry.nextEntry)\n {\n if (inthashmapentry.hashEntry == par1)\n {\n return inthashmapentry;\n }\n }\n\n return null;\n }", "@Nullable\n default StateHolder getAlternateStateHolder() {\n return null;\n }", "com.google.dataflow.v1beta3.ExecutionState getState();", "public Object lookup(String key){\n ListNode<String,Object> temp = getNode(key);\n if(temp != null)\n return temp.value;\n else\n return null;\n }", "public STATE_KEY eventRemoteStateInvalid() {\n\t\treturn STATE_KEY.NOT_CHANGE;\n\t}", "public boolean getContainsKey(String state) {\r\n boolean result = table.containsKey(state);//calling containsKey method to check is required \r\n //state is present\r\n return result;\r\n }", "public SLR1_automat.State next_state(String symbol) throws Exception;", "@Override\n public void onCompleted(Flow flow) {}", "public PDFObject getUnresolved (String key)\n {\n use (key);\n return map.get (key);\n }", "boolean containsObjectFlowState(ObjectFlowState objectFlowState);", "private Optional<Node> getFirstAvailableRollbackNode(Node state) {\n return StreamSupport.stream(state.getRelationships(RelationshipType.withName(Utility.ROLLBACK_TYPE), Direction.OUTGOING).spliterator(), false).findFirst()\n // Recursive iteration for ROLLBACKed State node\n .map(e -> getFirstAvailableRollbackNode(e.getEndNode()))\n // No ROLLBACK relationship found\n .orElse(StreamSupport.stream(state.getRelationships(RelationshipType.withName(Utility.PREVIOUS_TYPE), Direction.OUTGOING).spliterator(), false)\n .findFirst().map(Relationship::getEndNode));\n }", "public ValueWrapper peek(String keyName) {\n\t\tif (!map.containsKey(keyName)) {\n\t\t\tthrow new NoSuchElementException(\"Empty stack for this key.\");\n\t\t}\n\t\treturn map.get(keyName).value;\n\t}", "public void flowAbrupted() {\n prevInstruction = null;\n }", "public CompletionState\n getCompletionState() \n {\n return CompletionState.Unfinished;\n }", "public String getFoundKey(){\n return _key + \"Found?\";\n }", "public E finishedState() {\r\n\t\treturn this.values[this.values.length - 1];\r\n\t}", "private DependResult getDependResultByState(TaskExecutionStatus state) {\n\n if (!state.isFinished()) {\n return DependResult.WAITING;\n } else if (state.isSuccess()) {\n return DependResult.SUCCESS;\n } else {\n return DependResult.FAILED;\n }\n }", "@Nullable\n @Override\n public MealyTransition<State<I, S>, O> getTransition(@Nonnull State<I, S> currentState, @Nullable I input) {\n if (input == null) {\n return null;\n }\n if (!this.isValidSPMM()) {\n return initialProcedure.globalErrorTransition;\n\n } else if (initialProcedure.containsState(currentState)) {\n if (initialProcedure.initialState.equals(currentState)) {\n if (initialProcedure.callSymbol.equals(input)) {\n final MealyMachine<S, I, ?, O> calledMM = this.procedures.get(input);\n\n final S nextState = calledMM.getInitialState();\n final Stack<State<I, S>> stack = new Stack<>();\n stack.add(initialProcedure.initialState);\n\n return new MealyTransition<>(\n new State<>(initialProcedure.callSymbol, nextState, stack),\n outputAlphabet.getProcedureStart());\n }\n }\n return initialProcedure.globalErrorTransition;\n\n\n // current state is NOT a state of initial procedure\n } else {\n if (inputAlphabet.isInternalSymbol(input)) {\n return getTransitionInsideProcedure(currentState, input);\n\n } else if (inputAlphabet.isCallSymbol(input)) {\n return getTransitionProcedureCall(currentState, input);\n\n } else if (inputAlphabet.isReturnSymbol(input)) {\n return getTransitionProcedureReturn(currentState, input);\n }\n }\n\n //return initialProcedure.globalErrorTransition;\n throw new IllegalStateException(\"could not find transition for given state and input\");\n }", "public State<S, T> getNextState(T transition) {\n\t\tState<S, T> nextState = null;\n\t\tif (transitions.containsKey(transition)) {\n\t\t\tnextState = transitions.get(transition);\n\t\t}\n\t\treturn nextState;\n\n\t}", "void determineNextAction();", "protected Ticket checkNextCompletedTicket()\n\t{\n\t\treturn tickets.peek();\n\t}", "public StateName getCurrentState() {\n for (Map.Entry<StateName, StateI> entry : availableStates.entrySet()) {\n if (entry.getValue().equals(curState)) {\n return entry.getKey();\n }\n }\n return null;\n }", "private void ensureFinalState() {\n if (!isComplete() && !isPaused() && getInternalState() != INTERNAL_STATE_QUEUED) {\n // we first try to complete a cancel operation and if that fails, we just fail\n // the operation.\n if (!tryChangeState(INTERNAL_STATE_CANCELED, false)) {\n tryChangeState(INTERNAL_STATE_FAILURE, false);\n }\n }\n }", "public ListNode processGet(int key) {\n if (isAlreadyPresent(key)) {\n ListNode node = removeCurrentListNode(cacheMap.get(key), cacheMap.get(key).freq);\n node.freq += 1;\n insertCurrentListNode(node, node.freq);\n updateFList(frequencyMap.get(node.freq - 1));\n return node;\n } else {\n return null;\n }\n }", "@Override\r\n\tpublic int resolveActions() {\n\t\treturn 0;\r\n\t}", "public V lookup(K key);", "@Then(\"^I get the same item back$\")\n\tpublic void i_get_the_same_item_back() throws Throwable {\n\t throw new PendingException();\n\t}", "public boolean complete() {\n return previousLink().isPresent();\n }", "Optional<V> lookup(K k);", "@SuppressWarnings(\"SynchronizeOnNonFinalField\")\n ActionExecutionValue executeAction(\n Environment env,\n Action action,\n ActionMetadataHandler metadataHandler,\n long actionStartTime,\n ActionLookupData actionLookupData,\n ArtifactExpander artifactExpander,\n ImmutableMap<Artifact, ImmutableList<FilesetOutputSymlink>> expandedFilesets,\n ImmutableMap<Artifact, ImmutableList<FilesetOutputSymlink>> topLevelFilesets,\n @Nullable FileSystem actionFileSystem,\n @Nullable Object skyframeDepsResult,\n ActionPostprocessing postprocessing,\n boolean hasDiscoveredInputs)\n throws ActionExecutionException, InterruptedException {\n if (actionFileSystem != null) {\n updateActionFileSystemContext(\n action, actionFileSystem, env, metadataHandler, expandedFilesets);\n }\n\n ActionExecutionContext actionExecutionContext =\n getContext(\n env,\n action,\n metadataHandler,\n metadataHandler,\n artifactExpander,\n topLevelFilesets,\n actionFileSystem,\n skyframeDepsResult,\n actionLookupData);\n\n if (actionCacheChecker.isActionExecutionProhibited(action)) {\n // We can't execute an action (e.g. because --check_???_up_to_date option was used). Fail the\n // build instead.\n String message = action.prettyPrint() + \" is not up-to-date\";\n DetailedExitCode code = createDetailedExitCode(message, Code.ACTION_NOT_UP_TO_DATE);\n ActionExecutionException e = new ActionExecutionException(message, action, false, code);\n Event error = Event.error(e.getMessage());\n synchronized (reporter) {\n reporter.handle(error);\n }\n throw e;\n }\n\n // Use computeIfAbsent to handle concurrent attempts to execute the same shared action.\n ActionExecutionState activeAction =\n buildActionMap.computeIfAbsent(\n new OwnerlessArtifactWrapper(action.getPrimaryOutput()),\n (unusedKey) ->\n new ActionExecutionState(\n actionLookupData,\n new ActionRunner(\n action,\n metadataHandler,\n actionStartTime,\n actionExecutionContext,\n actionLookupData,\n postprocessing)));\n\n SharedActionCallback callback =\n getSharedActionCallback(env.getListener(), hasDiscoveredInputs, action, actionLookupData);\n\n ActionExecutionValue result = null;\n ActionExecutionException finalException = null;\n\n if (actionExecutionSemaphore != null) {\n actionExecutionSemaphore.acquire();\n }\n try {\n result = activeAction.getResultOrDependOnFuture(env, actionLookupData, action, callback);\n } catch (ActionExecutionException e) {\n finalException = e;\n } finally {\n if (actionExecutionSemaphore != null) {\n actionExecutionSemaphore.release();\n }\n }\n\n if (result != null || finalException != null) {\n closeContext(actionExecutionContext, action, finalException);\n }\n return result;\n }", "@Override\n\tpublic void bibliographyObjectNotFound() {\n\t\t_completionCallback.notifyStageCompletion();\n\t}", "@Nullable IStrongSlot find(LuaValue key);", "public abstract ALRState<I> goTo(Symbol symbol);", "public void untilDone() throws IllegalStateException {\n\n if (!this.isActive()) {\n throw new IllegalStateException(\"Selector is closed\");\n }\n\n while (this.isActive()) {\n try {\n String chanId = this.selectorChannel.read();\n if (chanId.startsWith(CLOSE_CHAN_PREFIX)) {\n closeChannel(chanId.replace(CLOSE_CHAN_PREFIX, EMPTY));\n continue;\n }\n ChannelAction ca = this.channelActions.get(chanId);\n Preconditions.checkNotNull(ca);\n Preconditions.checkNotNull(ca.getChannel());\n Preconditions.checkNotNull(ca.getAction());\n\n Object msg = ca.getChannel().tryRead();\n if (msg == null) {\n continue;\n } else if (ca.getAction() == BREAK_ACTION) {\n this.close();\n break;\n } else if (ca.getAction() == CONTINUE_ACTION) {\n continue;\n } else {\n ca.getAction().accept(msg);\n }\n } catch (NullPointerException ex) {\n throw new IllegalStateException(ex);\n } catch (NoSuchChannelElementException | ClosedChannelException ex) {\n log.warn(\"Unexpected channel exception - {}\", ex.getMessage());\n }\n }\n }", "private Transition findTransitionByNameAndEvent(PetriNet sourcePN,\n\t\t\tString name, String event) {\n\t\tTransition noTransition = null;\n\t\t// get the petrinet of the input simulation model\n\t\tIterator<Transition> transitions = sourcePN.getTransitions().iterator();\n\t\twhile (transitions.hasNext()) {\n\t\t\tTransition transition = transitions.next();\n\t\t\tLogEvent le = transition.getLogEvent();\n\n\t\t\t// ignore invisible tasks\n\t\t\tif (le != null) {\n\t\t\t\tString leName = le.getModelElementName();\n\t\t\t\tString leType = le.getEventType();\n\t\t\t\t// return the first matching transition found in the model\n\t\t\t\tif (leName.equals(name) && leType.equals(event)) {\n\t\t\t\t\treturn transition;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn noTransition;\n\t}", "protected void succeed() throws InvalidKeyException {\n task.succeed();\n }", "@Override\n public void taskIsUncompleted(final String processInstanceId, final String taskDefinitionKey) {\n new ProcessInstanceAssert(getConfiguration()).processIsActive(processInstanceId);\n\n // Assert a task exists\n trace(LogMessage.TASK_4, taskDefinitionKey, processInstanceId);\n final List<Task> tasks = getTaskService().createTaskQuery().processInstanceId(processInstanceId).taskDefinitionKey(taskDefinitionKey).active().list();\n\n assertThat(tasks, is(notNullValue()));\n assertThat(tasks.isEmpty(), is(false));\n\n }", "public FlowEventOccurrence step(FlowNodeBase flowNode, FlowEventOccurrence occurrence, FlowContext context) {\r\n\t\tFlowEdge edge = findEdge(flowNode, occurrence);\r\n\t\tif (edge==null) { // No edge at this level, pop to the flow above and check again\r\n\t\t\tcontext.popFlowContext();\r\n\t\t\treturn occurrence;\r\n\t\t}\r\n\t\treturn reach(edge.getEndNode(), occurrence, context);\r\n\t}", "public DataItem find(int key){\n\t\tint hashVal = hashFunc(key);\n\t\tint stepSize = hashFunc2(key);\n\t\twhile(hashArray[hashVal] != null){\n\t\t\tif(hashArray[hashVal].getKey() == key){\n\t\t\t\tDataItem temp = hashArray[hashVal]; //find the item\n\t\t\t\treturn temp;\n\t\t\t}\n\t\t\thashVal += stepSize;\n\t\t\thashVal %= arraySize;\n\t\t}\n\t\treturn null;\n\t}", "private GlobalState search(Map<String,String> stateMapping) {\n GlobalState desired = new GlobalState(nodes,binding);\n desired.addMapping(stateMapping);\n for(GlobalState g : globalStates) {\n if(g.equals(desired))\n return g;\n }\n return null;\n }", "@Override\r\n\tpublic void nextState() {\n\t\t\r\n\t}", "public abstract State getSourceState ();", "public Step exitSubflow() {\n m_level--;\n m_activeFlows.remove(m_activeFlows.size() - 1);\n return m_suspendedSteps.remove(m_suspendedSteps.size() - 1);\n }", "@Override\r\n public V get(K key) {\r\n int index = getIndex(key);\r\n IDictionary<K, V> dict = chains[index];\r\n if (dict!=null) {\r\n if (dict.containsKey(key)) {\r\n return dict.get(key);\r\n }\r\n } \r\n throw new NoSuchKeyException();\r\n }", "protected WorkingMemoryAddress getReferredBelief(\n\t\t\tContentMatchingFunction<? super To> contentMatchingFunction)\n\t\t\tthrows InterruptedException {\n\t\tgetLogger().debug(\"trying to find referred belief\");\n\t\tEntry<WorkingMemoryAddress, To> entry = waitingBeliefReader\n\t\t\t\t.read(contentMatchingFunction);\n\t\tgetLogger().debug(\"got it: \" + entry.getKey().id);\n\t\treturn entry.getKey();\n\t}", "public ElectionTable.ElectionNode searchElection(String key){\n int chain=hashFunction(key);\r\n if (electionTable[chain] !=null) {\r\n System.out.println(\"found Election!!!\");\r\n return electionTable[chain];\r\n } else {\r\n System.out.println(\"not found Election!!!\");\r\n return null;\r\n }\r\n }", "@Override\n protected int nextIndex() {\n if (_expectedSize != _hash.size()) {\n throw new ConcurrentModificationException();\n }\n\n byte[] states = _hash._states;\n int i = _index;\n while (i-- > 0 && (states[i] != TPrimitiveHash.FULL)) ;\n return i;\n }", "public boolean hasKey() {\n return result.hasKey();\n }", "public boolean hasKey() {\n return result.hasKey();\n }", "public boolean hasKey() {\n return result.hasKey();\n }", "public boolean hasKey() {\n return result.hasKey();\n }", "public boolean hasKey() {\n return result.hasKey();\n }", "public boolean hasKey() {\n return result.hasKey();\n }", "public void waitForState(STATE targetState) {\n\t\n\t\tsynchronized (stateLock) {\n\t\t\twhile (state != targetState)\n\t\t\t\ttry {\n\t\t\t\t\tstateLock.wait();\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t}\n\t\t}\n\t}", "public String getNextState() {\n return nextState;\n }", "private int enterHistory(int state) {\n\t\tboolean skip_entry = false;\n\t\tif (state >= STATE_MAX) {\n\t\t\tstate = (state - STATE_MAX);\n\t\t\tskip_entry = true;\n\t\t}\n\t\twhile (true) {\n\t\t\tswitch (state) {\n\t\t\t\tcase STATE_Ready:\n\t\t\t\t\t/* in leaf state: return state id */\n\t\t\t\t\treturn STATE_Ready;\n\t\t\t\tcase STATE_TOP:\n\t\t\t\t\tstate = this.history[STATE_TOP];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t/* should not occur */\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tskip_entry = false;\n\t\t}\n\t\t/* return NO_STATE; // required by CDT but detected as unreachable by JDT because of while (true) */\n\t}", "public Object lookup(int par1)\n {\n int j = computeHash(par1);\n\n for (IntHashMapEntry inthashmapentry = this.slots[getSlotIndex(j, this.slots.length)]; inthashmapentry != null; inthashmapentry = inthashmapentry.nextEntry)\n {\n if (inthashmapentry.hashEntry == par1)\n {\n return inthashmapentry.valueEntry;\n }\n }\n\n return null;\n }" ]
[ "0.50311565", "0.49909222", "0.49861708", "0.4825279", "0.48147383", "0.4732663", "0.46955568", "0.4695421", "0.4687391", "0.4642646", "0.46063417", "0.45885515", "0.45752573", "0.4559339", "0.45561036", "0.4544524", "0.45282185", "0.4463949", "0.44523233", "0.4443155", "0.44417667", "0.4422113", "0.44191048", "0.43980062", "0.43901265", "0.43862277", "0.43811938", "0.43475202", "0.43197927", "0.43188444", "0.43049765", "0.43043885", "0.42984074", "0.42916548", "0.429091", "0.4289466", "0.42867717", "0.42802623", "0.4249585", "0.4249585", "0.4245751", "0.4244607", "0.42431518", "0.42351317", "0.42291704", "0.42209902", "0.42173535", "0.42167908", "0.42120704", "0.42100212", "0.42050484", "0.4204372", "0.42027247", "0.41931823", "0.41883025", "0.41880146", "0.418326", "0.4178312", "0.41740403", "0.41623852", "0.41620177", "0.41585898", "0.41573432", "0.41559505", "0.41543156", "0.41522822", "0.414758", "0.41462564", "0.41410205", "0.41388294", "0.41217268", "0.41212597", "0.41171777", "0.41169405", "0.41160506", "0.41130134", "0.4111047", "0.41065177", "0.41055143", "0.4104534", "0.4100806", "0.4094083", "0.40917617", "0.40903446", "0.40876245", "0.4087528", "0.40806565", "0.40798077", "0.4074136", "0.40700412", "0.40685958", "0.40685958", "0.40685958", "0.40685958", "0.40685958", "0.40685958", "0.4064985", "0.4063755", "0.40624997", "0.40516123" ]
0.6424611
0
Magic types are types that may appear in the replacement and will need to find their corresponding entry in the list of matches.
public interface MagicType extends Type { /** * Given that we are a type specified in a replacement rule (e.g. a Var or * Atom), can we consume a submatch of the given type in the match? * * Alternatively, we could have overriden .equals(). */ boolean replacementfor(Type o); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean replacementfor(Type o);", "public void matchType()\n {\n if(this.getGameType() == 1)\n {\n this.setType(\"s\");\n }\n else if(this.getGameType() == 2)\n {\n this.setType(\"r\");\n }\n else if(this.getGameType() == 3)\n {\n this.setType(\"c\");\n }\n }", "private void initMimeTypes() {\n\n\t\tint listOffset = getAliasListOffset();\n\t\tint numAliases = content.getInt(listOffset);\n\n\t\tfor (int i = 0; i < numAliases; i++) {\n\t\t\tMimeUtil.addKnownMimeType(getString(content.getInt((listOffset + 4)\n\t\t\t\t\t+ (i * 8)))); //\n\t\t\tMimeUtil.addKnownMimeType(getString(content.getInt((listOffset + 8)\n\t\t\t\t\t+ (i * 8))));\n\t\t}\n\t}", "@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 void finalizeOutOfTypeSystemFeatures() {\n // remap ref features\n for (List<Pair<String, Object>> attrs : outOfTypeSystemData.extraFeatureValues.values()) {\n for (Pair<String, Object> p : attrs) {\n String sv = (p.u instanceof String) ? (String) p.u : \"\";\n if (p.t.startsWith(\"_ref_\")) {\n int val = Integer.parseInt(sv);\n if (val >= 0) // negative numbers represent null and are left unchanged\n {\n // attempt to locate target in type system\n FSInfo fsValInfo = fsTree.get(val);\n if (fsValInfo != null) {\n p.u = fsValInfo.fs;\n } else\n // out of type system - remap by prepending letter\n {\n p.u = \"a\" + val;\n }\n }\n }\n }\n }\n }", "public void setReplacementType(java.lang.Short replacementType) {\r\n this.replacementType = replacementType;\r\n }", "Object isMatch(Object arg, String wantedType);", "public java.lang.Short getReplacementType() {\r\n return replacementType;\r\n }", "public static void matchMaker()\n {\n \n }", "public synchronized static void internal_updateKnownTypes() {\r\n Set<ChangeLogType> changeLogTypes = GrouperDAOFactory.getFactory().getChangeLogType().findAll();\r\n GrouperCache<MultiKey, ChangeLogType> newTypes = new GrouperCache<MultiKey, ChangeLogType>(\r\n ChangeLogTypeFinder.class.getName() + \".typeCache\", 10000, false, 60*10, 60*10, false);\r\n \r\n Map<String, ChangeLogType> newTypesById = new HashMap<String, ChangeLogType>();\r\n \r\n for (ChangeLogType changeLogType : GrouperUtil.nonNull(changeLogTypes)) {\r\n newTypes.put(new MultiKey(changeLogType.getChangeLogCategory(), changeLogType.getActionName()), changeLogType);\r\n newTypesById.put(changeLogType.getId(), changeLogType);\r\n }\r\n \r\n //add builtins if necessary\r\n internal_updateBuiltinTypesOnce(newTypes, newTypesById);\r\n \r\n types = newTypes;\r\n typesById = newTypesById;\r\n }", "void addTypes(EntryRep bits) {\n\tString classFor = bits.classFor();\n\tString[] superclasses = bits.superclasses();\n\n\t//The given EntryRep will add its className to the\n\t//subtype list of all its supertypes.\n\n\tString prevClass = classFor;\n\tfor (int i = 0; i < superclasses.length; i++) {\n\t if (!addKnown(superclasses[i], prevClass)) {\n\t\treturn;\n\t }\n\t prevClass = superclasses[i];\n\t}\n\n\t// If we are here prevClass must have java.Object as its\n\t// direct superclass (we don't store \"java.Object\" in\n\t// EntryRep.superclasses since that would be redundant) and\n\t// prevClass is not already in the the tree. Place it in the\n\t// \"net.jini.core.entry.Entry\" bucket so it does not get lost\n\t// if it does not have any sub-classes.\n\t//\n\t// Fix suggested by Lutz Birkhahn <[email protected]>\n\taddKnown(ROOT, prevClass);\n }", "private void registerTypes(ITypeManager typeManager) {\n\t\ttypeManager.registerType(BsonString.class, StdTypeManagerPlugin.STRING_NATURE);\n\t\ttypeManager.registerType(BsonInt32.class, StdTypeManagerPlugin.INTEGER_NATURE);\n\t\ttypeManager.registerType(BsonInt64.class, StdTypeManagerPlugin.INTEGER_NATURE);\n\t\ttypeManager.registerType(BsonDouble.class, StdTypeManagerPlugin.DECIMAL_NATURE);\n\t\ttypeManager.registerType(BsonNumber.class, StdTypeManagerPlugin.DECIMAL_NATURE);\n\t\ttypeManager.registerType(BsonDateTime.class, StdTypeManagerPlugin.DATETIME_NATURE);\n\t\ttypeManager.registerType(BsonBoolean.class, StdTypeManagerPlugin.BOOLEAN_NATURE);\n\t\ttypeManager.registerType(BsonBinary.class, StdTypeManagerPlugin.BINARY_NATURE);\n\t\ttypeManager.registerType(BsonDocument.class, StdTypeManagerPlugin.COMPOSITE_NATURE);\n\t}", "private void fixType(NameInfo name1Info, NameInfo name2Info) {\n\t\tString type1 = name1Info.getType();\n\t\tString type2 = name2Info.getType();\n//\t\tString name1 = name1Info.getName();\n//\t\tString name2 = name2Info.getName();\n\t\t\n\t\tif (!name1Info.isEnforced() && !name2Info.isEnforced()) {\n\t\t\tfixLoc(name1Info);\n\t\t\tfixLoc(name2Info);\n\t\t\tfixOrg(name1Info);\n\t\t\tfixOrg(name2Info);\n\t\t\tfixPeople(name1Info);\n\t\t\tfixPeople(name2Info);\n\t\t\tString longName = \"\";\n\t\t\tString shortName = \"\";\n\t\t\tif ((name1Info.getName()).length() >= (name2Info.getName()).length()) {\n\t\t\t\tlongName = name1Info.getName();\n\t\t\t\tshortName = name2Info.getName();\n\t\t\t} else {\n\t\t\t\tlongName = name2Info.getName();\n\t\t\t\tshortName = name1Info.getName();\n\t\t\t}\n\t\t\tif (acroMan.isAcronymFirstLetters(shortName, longName)) {\n\t\t\t\tname1Info.setType(\"ORG\");\n\t\t\t\tname2Info.setType(\"ORG\");\n\t\t\t}\n\t\t}\n\t\t\n\t\ttype1 = name1Info.getType();\n\t\ttype2 = name2Info.getType();\n\t\t\n\t\tif (!type1.equals(NameInfo.GENERIC_TYPE) && !type2.equals(NameInfo.GENERIC_TYPE) && !type1.equals(type2)){\n\t\t\tscoreShingle = 0.0f;\n\t\t\tscore = 0.0f;\n\t\t\treason = \"Types \" + type1 + \" and \" + type2 + \" cannot be compared\";\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (type1.equals(NameInfo.GENERIC_TYPE) && !type2.equals(NameInfo.GENERIC_TYPE)) {\n\t\t\ttype1 = type2;\n\t\t\tname1Info.setType(type1);\n\t\t} else if (type2.equals(NameInfo.GENERIC_TYPE) && !type1.equals(NameInfo.GENERIC_TYPE)) {\n\t\t\ttype2 = type1;\n\t\t\tname2Info.setType(type2);\n\t\t}\n\t}", "gov.nih.nlm.ncbi.www.MedlineSiDocument.MedlineSi.Type addNewType();", "public interface ReplacerType {\n\n String getPrefix();\n\n String getName();\n}", "void writeTypeRestrictions(DBObject result, Set<Class<?>> restrictedTypes);", "public Matcher forType(String typeOf) {\n\t\tMatcher matcher = new Matcher(jCas, typeOf);\n\t\tthis.matchers.add(matcher);\n\t\treturn matcher;\n\t}", "public String replaceFieldTypes(String string, String string2, int n) {\n synchronized (this) {\n PatternWithMatcher patternWithMatcher = new PatternWithMatcher(string, null);\n return this.adjustFieldTypes(patternWithMatcher, this.current.set(string2, this.fp, false), EnumSet.noneOf(DTPGflags.class), n);\n }\n }", "protected void deduceAndSetTypeOfFile(TypedFile f) {\r\n\t// Look, a file typing loop. I am in hell.\r\n\t// We'd much rather, of course, have access to the\r\n\t// native system's file typing scheme. But we don't. Maybe\r\n\t// someday.\r\n\r\n\tboolean foundOne = false;\r\n\r\n\t// These types take precedence over everything else, for files\r\n\t// that must not be typed as anything else. They are\r\n\t// always shown. So far only faked windows drive entries\r\n\t// match this description\r\n\t//\r\n\tif (overrideTypes != null) {\r\n\t int overrideCount = overrideTypes.length;\r\n\t for (int j = 0; j < overrideCount && !foundOne; j++) {\r\n\t\tif (applyTypeToFile(overrideTypes[j], f)) {\r\n\t\t foundOne = true;\r\n\t\t}\r\n\t }\r\n\t}\r\n\r\n\t// Apply general types\r\n\t// \r\n\tif (!foundOne) {\r\n\t Enumeration e = knownTypes.elements();\r\n\t while (e.hasMoreElements() && !foundOne) {\r\n\t\tFileType t = (FileType)e.nextElement();\r\n\t\tif (applyTypeToFile(t, f)) {\r\n\t\t foundOne = true;\r\n\t\t}\r\n\t }\r\n\t}\r\n\r\n\t// Cleanup. Everybody must get typed!\r\n\t// \r\n\tif (!foundOne && cleanupTypes != null) {\r\n\t int cleanupCount = cleanupTypes.length;\r\n\t for (int j = 0; j < cleanupCount && !foundOne; j++) {\r\n\t\tif (applyTypeToFile(cleanupTypes[j], f)) {\r\n\t\t foundOne = true;\r\n\t\t}\r\n\t }\r\n\t}\r\n\r\n\t// Throws a run time error if no type was set\r\n\tf.getType();\r\n }", "UsedTypes getTypes();", "public static void type(Scene s) {\n // Pre processing steps of adding Java 1.5 types to all\n // references\n TypeInitializer.loadSignatures(s);\n printNonQuiet(\"TypeInitializer finished.\");\n\n OwnerAdder.addOwners(Scene.v());\n printNonQuiet(\"OwnerAdder finished.\");\n\n RawTypeWildcardifier.wildcardifyRawTypes(s);\n printNonQuiet(\"RawTypeWildcardifier finished.\");\n\n TypeIndexer.index(Scene.v());\n printNonQuiet(\"TypeIndexer finished.\");\n\n TypeInferencer.infer(Scene.v());\n printNonQuiet(\"TypeInferencer finished.\");\n\n RepChecker.checkRep(Scene.v());\n printNonQuiet(\"RepChecker finished.\");\n }", "void processType(@Observes ProcessAnnotatedType<?> pat) throws InvalidAnnotationException {\n par.checkAnnotatedType(pat);\n MvcExtension.processAnnotatedType(pat);\n }", "public List<? extends TypeMirror> getTypeMirrors() {\n/* 83 */ return this.types;\n/* */ }", "private void processTypes(Object value, ProcessorContext<T> processorContext)\r\n {\r\n CustomFieldProcessor cfp = getTypeProcessor(processorContext.getField().getType());\r\n LOG.debug(\"processTypes() - CustomFieldProcessor: \" + cfp);\r\n if (cfp == null) {\r\n cfp = getTypeProcessor(Object.class);\r\n }\r\n cfp.processCustomField(value, processorContext);\r\n }", "public String getMatchType() {\n return getStringProperty(\"MatchType\");\n }", "public void setType(String newVal) {\n if ((newVal != null && this.type != null && (newVal.compareTo(this.type) == 0)) || \n (newVal == null && this.type == null && type_is_initialized)) {\n return; \n } \n this.type = newVal; \n\n type_is_modified = true; \n type_is_initialized = true; \n }", "void replaceClasses(Class current, Class replacement);", "static Collection readMatches(Node nMagic, MagicImpl magic) {\n\t\t// get match nodes\n\t\tNode[] matches = getChildNodes(nMagic, \"match\");\n\t\tArrayList ret = new ArrayList(matches.length);\n\t\tfor (int i = 0; i < matches.length; i++) {\n\t\t\t// get attributes from match\n\t\t\tNode nMatch = matches[i];\n\t\t\tNamedNodeMap attrs = nMatch.getAttributes();\n\t\t\tNode nAttr = attrs.getNamedItem(\"type\");\n\t\t\tError.assertTrue(nAttr != null, \"Match does not contain type!\" + nMagic);\n\t\t\tString sType = nAttr.getNodeValue();\n\t\t\tint type = magic.typeToType(sType);\n\n\t\t\tnAttr = attrs.getNamedItem(\"offset\");\n\t\t\tError.assertTrue(nAttr != null, \"Match does not contain offset!\" + nMagic);\n\t\t\tString offset = nAttr.getNodeValue();\n\t\t\tint pos = offset.indexOf(':');\n\t\t\tint offsetStart = 0, offsetEnd = 0;\n\t\t\tif(pos < 0) {\n\t\t\t\toffsetStart = Integer.parseInt(offset);\n\t\t\t\toffsetEnd = offsetStart;\n\t\t\t} else {\n\t\t\t\toffsetStart = Integer.parseInt(offset.substring(0, pos));\t\t\t\t\n\t\t\t\toffsetEnd = Integer.parseInt(offset.substring(pos + 1));\n\t\t\t}\n\t\t\t\t \n\t\t\tnAttr = attrs.getNamedItem(\"value\");\n\t\t\tError.assertTrue(nAttr != null, \"Match does not contain value!\" + nMagic);\n\t\t\tString sValue = nAttr.getNodeValue();\n\t\t\tbyte[] value = ByteHelper.decode(-1, sValue, BIGENDIAN); \n\t\t\t\n\t\t\tnAttr = attrs.getNamedItem(\"mask\");\n\t\t\tString sMask = null;\n\t\t\tbyte[] mask = null;\n\t\t\tif(nAttr != null) {// mask is optional\n\t\t\t\tsMask = nAttr.getNodeValue();\n\t\t\t\tmask = ByteHelper.decode(-1, sMask, BIGENDIAN);\n\t\t\t}\n\t\t\t\n\t\t\tMatchImpl match = magic.addMatchImpl(type, offsetStart, offsetEnd, value, mask);\n\t\t\t// read sub matches\n\t\t\treadMatches(nMatch, match);\n\t\t}\n\t\t\n\t\treturn ret;\n\t}", "public static void bindTypes(Binder binder) {\n //array converter\n binder.convertToTypes(new ArrayMatcher(String.class), STRING_ARRAY_CONVERTER);\n binder.convertToTypes(new ArrayMatcher(int.class), INT_ARRAY_CONVERTER);\n binder.convertToTypes(new ArrayMatcher(boolean.class), BOOLEAN_ARRAY_CONVERTER);\n binder.convertToTypes(new ArrayMatcher(double.class), DOUBLE_ARRAY_CONVERTER);\n //files\n binder.convertToTypes(new ClazzMatcher(File.class), new FileTypeConverter());\n //URL\n binder.convertToTypes(new ClazzMatcher(URL.class), new URLTypeConverter());\n //URI\n binder.convertToTypes(new ClazzMatcher(URI.class), new URITypeConverter());\n //DateFormat\n binder.convertToTypes(new ClazzMatcher(DateFormat.class), new DateFormatTypeConverter());\n //Date\n binder.convertToTypes(new ClazzMatcher(Date.class), new DateTypeConverter());\n }", "boolean hasMagic();", "@Test\r\n\tpublic void ReplaceTypesTest() throws Exception {\r\n\t\t// Given - controllers, project and unmanaged library\r\n\t\tLibraryNode ln = ml.createNewLibrary(defaultProject.getNSRoot(), \"test\", defaultProject);\r\n\r\n\t\t// Given - one of each object type\r\n\t\tml.addOneOfEach(ln, \"RTT\");\r\n\t\tml.check(ln);\r\n\r\n\t\t// Given - local variables for different object types\r\n\t\tSimpleTypeNode simple = null;\r\n\t\tVWA_Node vwa = null;\r\n\t\tCoreObjectNode core = null, core2 = null;\r\n\t\tBusinessObjectNode bo = null, bo2 = null;\r\n\t\tfor (LibraryMemberInterface n : ln.getDescendants_LibraryMembers()) {\r\n\t\t\tif (n instanceof SimpleTypeNode)\r\n\t\t\t\tsimple = (SimpleTypeNode) n;\r\n\t\t\telse if (n instanceof VWA_Node)\r\n\t\t\t\tvwa = (VWA_Node) n;\r\n\t\t\telse if (n instanceof CoreObjectNode)\r\n\t\t\t\tcore = (CoreObjectNode) n;\r\n\t\t\telse if (n instanceof BusinessObjectNode)\r\n\t\t\t\tbo = (BusinessObjectNode) n;\r\n\t\t}\r\n\t\tassertNotNull(core);\r\n\t\tassertNotNull(bo);\r\n\t\tassertNotNull(simple);\r\n\t\tassertNotNull(vwa);\r\n\r\n\t\t// Given - clone made of core\r\n\t\tcore2 = (CoreObjectNode) core.clone(core.getLibrary(), null);\r\n\t\tcore2.setName(\"core2\");\r\n\t\tml.check(core2);\r\n\r\n\t\t// Given - clone made of bo\r\n\t\tbo2 = (BusinessObjectNode) bo.clone(bo.getLibrary(), null);\r\n\t\tbo2.setName(\"bo2\");\r\n\t\tml.check(bo2);\r\n\r\n\t\treplaceProperties(bo, core2, core);\r\n\t\treplaceProperties(bo2, core, core2);\r\n\r\n\t\treplaceProperties(bo, simple, core);\r\n\t\treplaceProperties(core, simple, core2);\r\n\t\treplaceProperties(vwa, simple, core);\r\n\t}", "public void setReplacementType2(java.lang.Short replacementType2) {\r\n this.replacementType2 = replacementType2;\r\n }", "private void replaceMembers(LibraryNode ls, LibraryNode lt) {\r\n\t\t// Sort the list so that the order is consistent with each test.\r\n\t\tList<TypeProvider> targets = lt.getDescendants_TypeProviders();\r\n\t\tCollections.sort(targets, lt.new TypeProviderComparable());\r\n\t\tList<TypeProvider> sources = ls.getDescendants_TypeProviders();\r\n\t\tCollections.sort(sources, ls.new TypeProviderComparable());\r\n\t\tint cnt = sources.size();\r\n\r\n\t\t// Replace types with one pseudo-randomly selected from target library.\r\n\t\tfor (TypeProvider n : targets) {\r\n\t\t\tif (n.getWhereAssigned().size() > 0) {\r\n\t\t\t\t// Note - many of these will not be allowed.\r\n\t\t\t\t((Node) n).replaceTypesWith(sources.get(--cnt), null);\r\n\t\t\t\t// LOGGER.debug(\" replaced \" + n + \" with \" + sources.get(cnt));\r\n\t\t\t\tAssert.assertTrue(sources.get(cnt).getLibrary() != null);\r\n\t\t\t\tAssert.assertTrue(n.getLibrary() != null);\r\n\t\t\t}\r\n\t\t\tif (cnt <= 0)\r\n\t\t\t\tcnt = sources.size();\r\n\t\t}\r\n\t\t// LOGGER.debug(\"Replaced \" + sources.size() + \" - \" + cnt);\r\n\t}", "public static void magicWord(){\n\t\tmagic_str = words.getMagicWord().toLowerCase();\n\t\tmagic_len = magic_str.length();\n\t\tmagic = new char[magic_len];\n\n\t\t// Iterates through word and stores in char magic[]\n\t\tfor(int i = 0; i < magic_len; i++){\n\t\t\tmagic[i] = magic_str.charAt(i);\n\t\t}\n\n\t}", "@Override\n public boolean matches(ReferenceType refType) {\n if (isWild) {\n return refType.name().endsWith(classId);\n } else {\n return refType.name().equals(classId);\n }\n }", "public void restoreWildType() {\n\t\t\n\t\tfor (int i=0; i<numGenes_; i++) {\n\t\t\tgrn_.getGene(i).setMax( wildType_.get(i) );\n\t\t\tgrn_.getGene(i).restoreWildTypeBasalActivation();\n\t\t}\n\t}", "public Class<?> loadMagic() {\n ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);\n cw.visit(Opcodes.V1_4, Opcodes.ACC_PUBLIC, \"sun/reflect/GroovyMagic\", null, \"java/lang/Object\", null);\n MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, \"<init>\", \"()V\", null, null);\n mv.visitCode();\n mv.visitMaxs(0,0);\n mv.visitEnd();\n cw.visitEnd();\n\n byte[] bytes = cw.toByteArray();\n\t return defineClass(\"sun.reflect.GroovyMagic\", bytes, 0, bytes.length);\n }", "private void validateTypes() {\r\n\t\tfor (int i = 0; i < types.length; i++) {\r\n\t\t\tString type = types[i];\r\n\t\t\tif (!TypedItem.isValidType(type))\r\n\t\t\t\tthrow new IllegalArgumentException(String.format(\"The monster type %s is invalid\", type));\r\n\t\t\tfor (int j = i + 1; j < types.length; j++) {\r\n\t\t\t\tif (type.equals(types[j])) {\r\n\t\t\t\t\tthrow new IllegalArgumentException(\"The monster cant have two similar types..\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public interface MongoTypeMapper extends TypeMapper<DBObject> {\r\n\r\n\t/**\r\n\t * Returns whether the given key is the type key.\r\n\t * \r\n\t * @param key\r\n\t * @return\r\n\t */\r\n\tboolean isTypeKey(String key);\r\n\r\n\t/**\r\n\t * Writes type restrictions to the given DBObject. This usually results in\r\n\t * an $in-clause to be generated that restricts the type-key (e.g. _class)\r\n\t * to be in the set of type aliases for the given restrictedTypes.\r\n\t * \r\n\t * @param result\r\n\t * @param restrictedTypes\r\n\t */\r\n\tvoid writeTypeRestrictions(DBObject result, Set<Class<?>> restrictedTypes);\r\n\r\n}", "private boolean match(Type t, Type original) {\n\t\t\t\treturn original.getSort() == Type.METHOD && original.getSort() == t.getSort();\n\t\t\t}", "@org.junit.Test(timeout = 10000)\n public void annotatedWildcardTypeNameWithExtends_cf27968() {\n java.lang.String expected = (\"? extends @\" + (com.squareup.javapoet.AmplAnnotatedTypeNameTest.NN)) + \" java.lang.String\";\n com.squareup.javapoet.TypeName type = com.squareup.javapoet.TypeName.get(java.lang.String.class).annotated(NEVER_NULL);\n java.lang.String actual = com.squareup.javapoet.WildcardTypeName.subtypeOf(type).toString();\n // AssertGenerator replace invocation\n boolean o_annotatedWildcardTypeNameWithExtends_cf27968__8 = // StatementAdderMethod cloned existing statement\n type.isBoxedPrimitive();\n // AssertGenerator add assertion\n org.junit.Assert.assertFalse(o_annotatedWildcardTypeNameWithExtends_cf27968__8);\n org.junit.Assert.assertEquals(expected, actual);\n }", "private String prepareType(String smaliType) {\n int arrayDimensions = 0;\n \n String typeWithoutBrackets = smaliType;\n \n while (typeWithoutBrackets.startsWith(\"[\")) {\n arrayDimensions++;\n typeWithoutBrackets = typeWithoutBrackets.substring(1);\n }\n \n if(SmaliNameConverter.isPrimitiveSmaliType(typeWithoutBrackets)) {\n return (typeWithoutBrackets.equals(\"V\")) ? \"\" : smaliType ; \n }\n \n String classOfType = SmaliNameConverter.convertTypeFromSmali(typeWithoutBrackets);\n String packageOfType = SmaliNameConverter.extractPackageNameFromClassName(classOfType);\n\n StringBuilder type = new StringBuilder();\n\n for(int i = 0; i < arrayDimensions; i++) {\n type.append(\"[\");\n }\n\n boolean isCurrentClassObject = (classOfType.equals(currentClassType)); \n boolean isInternalObject = (packageOfType.equals(currentPackage)); \n \n char typeChar = isCurrentClassObject? 'T' : \n isInternalObject? 'O' : 'E' ;\n \n type.append(typeChar);\n\n return type.toString();\n }", "public static void registerRtTypes(List<Class<?>> types) throws VilException {\n List<Class<?>> classes = new ArrayList<Class<?>>();\n classes.addAll(types);\n ReflectionTypeResolver resolver = new ReflectionTypeResolver(classes);\n INSTANCE.addTypeResolver(resolver);\n for (int t = 0; t < classes.size(); t++) {\n Class<?> cls = classes.get(t);\n if (null != cls) {\n resolver.inProcess(cls);\n try {\n registerRtType(cls);\n } catch (NoClassDefFoundError e) { \n // dependent class not found, may not be important, use @QMInternal, but just in case...\n EASyLoggerFactory.INSTANCE.getLogger(RtVilTypeRegistry.class, Bundle.ID).error(\n \"While registering \" + cls.getName() + \":\" + e.getMessage()); \n }\n resolver.done(cls);\n }\n }\n INSTANCE.removeTypeResolver(resolver);\n }", "@Nullable\n protected Object handleSpecialTypes(MappingContext context, Object value) {\n final Class<?> rawClass = context.getTypeInformation().getSafeToWriteClass();\n if (Collection.class.isAssignableFrom(rawClass)) {\n return createCollection(context, value);\n } else if (Map.class.isAssignableFrom(rawClass)) {\n return createMap(context, value);\n } else if (Optional.class.isAssignableFrom(rawClass)) {\n return createOptional(context, value);\n }\n return null;\n }", "public void markEnodebTypeReplace() throws JNCException {\n markLeafReplace(\"enodebType\");\n }", "int getMagic();", "@Override\n public Set<String> validTypes() {\n return factory.validTypes();\n }", "private static Type matchType(String type) {\n if (type == null) {\n return VarcharType.VARCHAR;\n }\n\n switch (type.toLowerCase()) {\n case \"string\":\n return VarcharType.VARCHAR;\n case \"int\":\n return IntegerType.INTEGER;\n case \"bigint\":\n return BigintType.BIGINT;\n case \"double\":\n return DoubleType.DOUBLE;\n case \"boolean\":\n return BooleanType.BOOLEAN;\n case \"array<string>\":\n return new ArrayType(VarcharType.VARCHAR);\n case \"timestamp\":\n return TimestampType.TIMESTAMP;\n case \"datetime\":\n return TimestampType.TIMESTAMP;\n case \"number\":\n return DecimalType.createDecimalType(DECIMAL_DEFAULT_PRECISION, DECIMAL_DEFAULT_SCALE);\n default:\n return VarcharType.VARCHAR;\n }\n }", "private String replaceNamesWithType(String filter, String name, String type) {\r\n int pos = filter.indexOf(ALIAS_PREFIX + name);\r\n int lastPos = 0;\r\n StringBuffer sb = new StringBuffer();\r\n\r\n while (pos > -1) {\r\n sb.append(filter.substring(lastPos, pos));\r\n sb.append(\"/\" + type);\r\n lastPos = pos + (ALIAS_PREFIX + name).length();\r\n pos = filter.indexOf(ALIAS_PREFIX + name, lastPos);\r\n }\r\n\r\n sb.append(filter.substring(lastPos));\r\n\r\n return sb.toString();\r\n }", "protected static DangerousFileType[] getKnownTypes() {\n return new DangerousFileType[] {\n // Add known file types here\n new DangerousFileType(ASF_TYPE, ASF_EXTENSIONS),\n new DangerousFileType(EXE_TYPE, EXE_EXTENSIONS)\n };\n }", "@Override\n public ImmutableList<String> getTypeParts() {\n return types.toImmutable();\n }", "@Override\n\tpublic boolean checkTypes() {\n\t\treturn false;\n\t}", "private void updateFieldsWithUnresolvedTypes(Environment result,\n \t\t\tEnvironment ext, Environment base) throws AstCreatorException {\n \t\t// Path node, token, inode and itoken\n \t\tfor(IInterfaceDefinition def : result.getAllDefinitions())\n \t\t{\n \t\t\tif (def instanceof BaseClassDefinition)\n \t\t\t{\n \t\t\t\tBaseClassDefinition bcdef = (BaseClassDefinition)def;\n \n \t\t\t\tfor(Field f : bcdef.getFields())\n \t\t\t\t{\n \t\t\t\t\tif (f.type == null)\n \t\t\t\t\t{\n \t\t\t\t\t\tIInterfaceDefinition type = base.lookupByTag(f.getUnresolvedType());\n \t\t\t\t\t\tif (type == null) type = ext.lookupByTag(f.getUnresolvedType());\n \t\t\t\t\t\tif (type != null)\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\tf.type = type;\n \t\t\t\t\t\t\tif (type instanceof ExternalJavaClassDefinition)\n \t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\tExternalJavaClassDefinition ejcd = (ExternalJavaClassDefinition)type;\n \t\t\t\t\t\t\t\tif (ejcd.getFields() != null && ejcd.getFields().size() > 0 && ejcd.getFields().get(0).isTokenField)\n \t\t\t\t\t\t\t\t\tf.isTokenField = true;\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}\n \t\t\t\t\t\telse\n \t\t\t\t\t\t\tthrow new AstCreatorException(\"The extension points to production: \"+f.getUnresolvedType()+\" in alternative \"+def.getName().getName()+\" which does not exists.\",null,true);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \n \t\t}\n \t}", "public String[] getMimeTypes() {\n/* 187 */ Set types = new HashSet(this.type_hash.keySet());\n/* 188 */ types.addAll(this.fallback_hash.keySet());\n/* 189 */ types.addAll(this.native_commands.keySet());\n/* 190 */ String[] mts = new String[types.size()];\n/* 191 */ mts = (String[])types.toArray((Object[])mts);\n/* 192 */ return mts;\n/* */ }", "public abstract List<QualifiedName> getAffectedFeatureTypes();", "public void setTypes(ArrayList<String> types){\n this.types = types;\n }", "public void setContentType(MediaType mediaType)\r\n/* 186: */ {\r\n/* 187:278 */ Assert.isTrue(!mediaType.isWildcardType(), \"'Content-Type' cannot contain wildcard type '*'\");\r\n/* 188:279 */ Assert.isTrue(!mediaType.isWildcardSubtype(), \"'Content-Type' cannot contain wildcard subtype '*'\");\r\n/* 189:280 */ set(\"Content-Type\", mediaType.toString());\r\n/* 190: */ }", "private Collection<ServiceReference> getTypeWriters(\n Map<MediaType,List<ServiceReference>> typeWriters, MediaType mediaType) {\n Collection<ServiceReference> refs = new LinkedHashSet<ServiceReference>();\n boolean wildcard = mediaType.isWildcardSubtype() || mediaType.isWildcardType();\n lock.readLock().lock();\n try {\n if(!wildcard){\n //add writer that explicitly mention this type first\n List<ServiceReference> l = typeWriters.get(mediaType);\n if(l != null){\n refs.addAll(l);\n }\n }\n List<ServiceReference> wildcardMatches = null;\n int count = 0;\n for(Entry<MediaType,List<ServiceReference>> entry : typeWriters.entrySet()){\n MediaType mt = entry.getKey();\n if(mt.isCompatible(mediaType) &&\n //ignore exact matches already treated above\n (wildcard || !mt.equals(mediaType))){\n if(count == 0){\n wildcardMatches = entry.getValue();\n } else {\n if(count == 1){\n wildcardMatches = new ArrayList<ServiceReference>(wildcardMatches); \n }\n wildcardMatches.addAll(entry.getValue());\n }\n }\n }\n if(count > 1){ //sort matches for different media types\n Collections.sort(wildcardMatches);\n }\n //add wildcard matches to the linked has set\n if(count > 0){\n refs.addAll(wildcardMatches);\n }\n } finally {\n lock.readLock().unlock();\n }\n return refs;\n }", "private void suggestsChangingTheFieldOrVariableType(final AnotherClass target) {\n target.transform(stringValue);\n }", "public final void entryRuleJvmWildcardTypeReference() throws RecognitionException {\n try {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:1676:1: ( ruleJvmWildcardTypeReference EOF )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:1677:1: ruleJvmWildcardTypeReference EOF\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getJvmWildcardTypeReferenceRule()); \n }\n pushFollow(FOLLOW_ruleJvmWildcardTypeReference_in_entryRuleJvmWildcardTypeReference3513);\n ruleJvmWildcardTypeReference();\n\n state._fsp--;\n if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getJvmWildcardTypeReferenceRule()); \n }\n match(input,EOF,FOLLOW_EOF_in_entryRuleJvmWildcardTypeReference3520); if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }", "protected TypeMapper<?> normalizeSemantics() {\n\t\tEvent event = SpeedTracerLogger\n\t\t\t\t.start(CompilerEventType.JAVA_NORMALIZERS);\n\t\ttry {\n\t\t\tDevirtualizer.exec(jprogram);\n\t\t\tCatchBlockNormalizer.exec(jprogram);\n\t\t\tPostOptimizationCompoundAssignmentNormalizer.exec(jprogram);\n\t\t\tLongCastNormalizer.exec(jprogram);\n\t\t\tLongEmulationNormalizer.exec(jprogram);\n\t\t\tTypeCoercionNormalizer.exec(jprogram);\n\t\t\tif (options.isIncrementalCompileEnabled()) {\n\t\t\t\t// Per file compilation reuses type JS even as references (like\n\t\t\t\t// casts) in other files\n\t\t\t\t// change, which means all legal casts need to be allowed now\n\t\t\t\t// before they are actually\n\t\t\t\t// used later.\n\t\t\t\tComputeExhaustiveCastabilityInformation.exec(jprogram);\n\t\t\t} else {\n\t\t\t\t// If trivial casts are pruned then one can use smaller runtime\n\t\t\t\t// castmaps.\n\t\t\t\tComputeCastabilityInformation.exec(jprogram,\n\t\t\t\t\t\t!shouldOptimize() /* recordTrivialCasts */);\n\t\t\t}\n\t\t\tImplementCastsAndTypeChecks.exec(jprogram,\n\t\t\t\t\tshouldOptimize() /* pruneTrivialCasts */);\n\t\t\tImplementJsVarargs.exec(jprogram);\n\t\t\tArrayNormalizer.exec(jprogram);\n\t\t\tEqualityNormalizer.exec(jprogram);\n\t\t\tTypeMapper<?> typeMapper = getTypeMapper();\n\t\t\tResolveRuntimeTypeReferences.exec(jprogram, typeMapper,\n\t\t\t\t\tgetTypeOrder());\n\t\t\treturn typeMapper;\n\t\t} finally {\n\t\t\tevent.end();\n\t\t}\n\t}", "public MirroredTypesException(List<? extends TypeMirror> paramList) {\n/* 69 */ super(\"Attempt to access Class objects for TypeMirrors \" + (paramList = new ArrayList<>(paramList))\n/* */ \n/* 71 */ .toString());\n/* 72 */ this.types = Collections.unmodifiableList(paramList);\n/* */ }", "public ArrayList < TypeSubstitution > getSubstitution ( ) ;", "private String compareToMagicData(int offset, byte[] data) {\n\t\tint mimeOffset = content.getInt(offset + 4);\n\t\tint numMatches = content.getInt(offset + 8);\n\t\tint matchletOffset = content.getInt(offset + 12);\n\n\t\tfor (int i = 0; i < numMatches; i++) {\n\t\t\tif (matchletMagicCompare(matchletOffset + (i * 32), data)) {\n\t\t\t\treturn getMimeType(mimeOffset);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private TYPE getType(final String type) {\n String temp = type.replaceAll(\"-\", \"_\");\n TYPE answer = Arrays.stream(\n TYPE.values()\n )\n .filter(value -> value.name().equals(temp))\n .findFirst()\n .orElse(TYPE.unknown);\n return answer;\n }", "private void updateFieldsWithUnresolvedTypes(Environment result,\n\t\t\tEnvironment ext, Environment base) throws AstCreatorException\n\t{\n\t\t// Path node, token, inode and itoken\n\t\tfor (IInterfaceDefinition def : result.getAllDefinitions())\n\t\t{\n\n\t\t\tif (def instanceof InterfaceDefinition)\n\t\t\t\t((InterfaceDefinition) def).setExtJavaDoc(COMPASS_JAVA_DOC_STRING);\n\n\t\t\tif (def instanceof BaseClassDefinition)\n\t\t\t{\n\t\t\t\tBaseClassDefinition bcdef = (BaseClassDefinition) def;\n\t\t\t\tfor (Field f : bcdef.getFields())\n\t\t\t\t{\n\t\t\t\t\tString rawTypeToResolved = f.getUnresolvedType();\n\t\t\t\t\tIInterfaceDefinition type = null;\n\t\t\t\t\tif (f.type != null)\n\t\t\t\t\t\ttype = f.type;\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\ttype = result.lookupTagPath(rawTypeToResolved, false);\n\t\t\t\t\t\tif (type == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(\"\" + rawTypeToResolved\n\t\t\t\t\t\t\t\t\t+ \" cannot be found\");\n\t\t\t\t\t\t\tSystem.exit(-1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.treeNodeInterfaces.containsKey(type))\n\t\t\t\t\t\t\ttype = result.treeNodeInterfaces.get(type);\n\t\t\t\t\t}\n\t\t\t\t\tif (result.treeNodeInterfaces.containsKey(type))\n\t\t\t\t\t\ttype = result.treeNodeInterfaces.get(type);\n\n\t\t\t\t\tif (type != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tf.type = type;\n\t\t\t\t\t\tif (type instanceof ExternalJavaClassDefinition)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tExternalJavaClassDefinition ejcd = (ExternalJavaClassDefinition) type;\n\t\t\t\t\t\t\tif (ejcd.getFields() != null\n\t\t\t\t\t\t\t\t\t&& ejcd.getFields().size() > 0\n\t\t\t\t\t\t\t\t\t&& ejcd.getFields().get(0).isTokenField)\n\t\t\t\t\t\t\t\tf.isTokenField = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\tthrow new AstCreatorException(\"Field '\" + f.toString()\n\t\t\t\t\t\t\t\t+ \"' has unresolved type: \\\"\"\n\t\t\t\t\t\t\t\t+ f.getUnresolvedType() + \"\\\" in alternative \"\n\t\t\t\t\t\t\t\t+ def.getName().getName() + \".\", null, true);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}", "public void visit(BinCITypesDefStatement x) {\n }", "public static int replaceOtherDataType(TableColumnInfo colInfo) \n \tthrows MappingException \n {\n \tint colJdbcType = colInfo.getDataType();\n if (colJdbcType == java.sql.Types.OTHER) {\n String typeName = colInfo.getTypeName().toUpperCase();\n int parenIndex = typeName.indexOf(\"(\");\n if (parenIndex != -1) {\n typeName = typeName.substring(0,parenIndex);\n }\n colJdbcType = JDBCTypeMapper.getJdbcType(typeName);\n if (colJdbcType == Types.NULL) {\n throw new MappingException(\n \"Encoutered jdbc type OTHER (1111) and couldn't map \"+\n \"the database-specific type name (\"+typeName+\n \") to a jdbc type\");\n }\n }\n return colJdbcType;\n }", "public Collection getMimeTypesInputStream(InputStream in)\n\t\t\tthrows UnsupportedOperationException {\n\t\treturn lookupMimeTypesForMagicData(in);\n\t}", "public void findByType(String type)\n {\n boolean found = false;\n for(KantoDex entry : entries)\n {\n if(entry.getTypes1().contains(type) && !type.equals(\"\"))\n {\n found = true;\n } \n }\n if(!found)\n {\n System.out.println(\"You have input a nonexistent type, or the type was not applicable to this entry.\"); \n }\n else\n {\n System.out.println(\"All Pokedex entries of type \" + type + \":\");\n for(KantoDex entry : entries)\n {\n if(entry.getType1().equals(type) || entry.getType2().equals(type))\n {\n entry.display();\n }\n }\n }\n }", "private List<Type> getTypes(final String name) {\n\t\tfinal List<String> baseTypes = new ArrayList<>();\n\t\tfinal String typeOrTypes = bundleConstants.getString(name + SEPERATOR + TYPES);\n\t\tif (typeOrTypes.contains(\" \")) {\n\t\t\t// has more then one type!\n\t\t\tbaseTypes.addAll(Arrays.asList(typeOrTypes.split(\" \")));\n\t\t} else {\n\t\t\t// has only one type\n\t\t\tbaseTypes.add(typeOrTypes);\n\t\t}\n\n\t\t// Convert type as String to type as Type\n\t\treturn baseTypes.stream().map(typeName -> Type.valueOf(typeName.toUpperCase())).collect(Collectors.toList());\n\t}", "public static void setMimeTypes(ServletContextHandler context) {\n MimeTypes mimeTypes = new MimeTypes();\n // RDF syntax\n mimeTypes.addMimeMapping(\"nt\", WebContent.contentTypeNTriples);\n mimeTypes.addMimeMapping(\"nq\", WebContent.contentTypeNQuads);\n mimeTypes.addMimeMapping(\"ttl\", WebContent.contentTypeTurtle+\";charset=utf-8\");\n mimeTypes.addMimeMapping(\"trig\", WebContent.contentTypeTriG+\";charset=utf-8\");\n mimeTypes.addMimeMapping(\"rdf\", WebContent.contentTypeRDFXML);\n mimeTypes.addMimeMapping(\"jsonld\", WebContent.contentTypeJSONLD);\n mimeTypes.addMimeMapping(\"rj\", WebContent.contentTypeRDFJSON);\n mimeTypes.addMimeMapping(\"rt\", WebContent.contentTypeRDFThrift);\n mimeTypes.addMimeMapping(\"trdf\", WebContent.contentTypeRDFThrift);\n\n // SPARQL syntax\n mimeTypes.addMimeMapping(\"rq\", WebContent.contentTypeSPARQLQuery);\n mimeTypes.addMimeMapping(\"ru\", WebContent.contentTypeSPARQLUpdate);\n\n // SPARQL Result set\n mimeTypes.addMimeMapping(\"rsj\", WebContent.contentTypeResultsJSON);\n mimeTypes.addMimeMapping(\"rsx\", WebContent.contentTypeResultsXML);\n mimeTypes.addMimeMapping(\"srt\", WebContent.contentTypeResultsThrift);\n mimeTypes.addMimeMapping(\"srt\", WebContent.contentTypeResultsProtobuf);\n\n // Other\n mimeTypes.addMimeMapping(\"txt\", WebContent.contentTypeTextPlain);\n mimeTypes.addMimeMapping(\"csv\", WebContent.contentTypeTextCSV);\n mimeTypes.addMimeMapping(\"tsv\", WebContent.contentTypeTextTSV);\n context.setMimeTypes(mimeTypes);\n }", "private String getAltRegType() { // TODO - fix Register reference hardcoded in reg defines parm default?\n\t\tString firstChar = regProperties.getId().substring(0, 1);\n\t\t// change case of first character in name to create type\n\t\tString regTypeParam;\n\t\tif (firstChar.equals(firstChar.toUpperCase()))\n\t\t regTypeParam = regProperties.getId().replaceFirst(firstChar, firstChar.toLowerCase()); // change to lc\n\t\telse\n\t\t regTypeParam = regProperties.getId().replaceFirst(firstChar, firstChar.toUpperCase()); // change to uc \n\t\tString regBaseType = regProperties.isReplicated()? \"RegisterArray\" : \"Register\";\n\t\treturn regBaseType + \" #(\" + getAltBlockType() + \"::\" + regTypeParam + \")\"; // TODO - make parameterizable, getAddressMapName() + \"_\" + regProperties.getBaseName() + \"_t\" \n\t}", "@org.junit.Test(timeout = 10000)\n public void annotatedWildcardTypeNameWithExtends_cf27961() {\n java.lang.String expected = (\"? extends @\" + (com.squareup.javapoet.AmplAnnotatedTypeNameTest.NN)) + \" java.lang.String\";\n com.squareup.javapoet.TypeName type = com.squareup.javapoet.TypeName.get(java.lang.String.class).annotated(NEVER_NULL);\n java.lang.String actual = com.squareup.javapoet.WildcardTypeName.subtypeOf(type).toString();\n // StatementAdderOnAssert create random local variable\n java.lang.Object vc_12387 = new java.lang.Object();\n // AssertGenerator replace invocation\n boolean o_annotatedWildcardTypeNameWithExtends_cf27961__10 = // StatementAdderMethod cloned existing statement\n type.equals(vc_12387);\n // AssertGenerator add assertion\n org.junit.Assert.assertFalse(o_annotatedWildcardTypeNameWithExtends_cf27961__10);\n org.junit.Assert.assertEquals(expected, actual);\n }", "public void magicTeleported(int type) {\n\n }", "boolean matchesType( Name primaryType,\n Set<Name> mixinTypes );", "@Override\n public void setTemplateArgumentTypes(List<Type> argsTypes) {\n // System.out.println(\"ARRIVED AT TEMPLATE ARGS\");\n // System.out.println(\n // \"SETTING TYPES:\" + argsTypes.stream().map(Type::getCode).collect(Collectors.joining(\"\\n\")));\n // System.out.println(\"ARGS BEFORE:\" + getTemplateArgumentStrings(null));\n setInPlace(TEMPLATE_ARGUMENTS, argsTypes.stream()\n .map(TemplateArgumentType::new)\n .collect(Collectors.toList()));\n // System.out.println(\"ARGS AFTER:\" + getTemplateArgumentStrings(null));\n // setTemplateArgumentTypes(argsTypes, true);\n\n hasUpdatedArgumentTypes = true;\n }", "public void setMatchAny() {\n this.value = ANY;\n }", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "private static String mapType(final FieldType.Type type) {\n switch (type) {\n case DATE:\n return \"Date\";\n case INTEGER:\n return \"Integer\";\n case REAL:\n return \"Double\";\n case STRING:\n return \"String\";\n default:\n return null;\n }\n }", "private static void parseMimeTypes(Set<MediaType> result, NodeList mimes) {\n for (int j = 0; j < mimes.getLength(); j++) {\n Node mime = mimes.item(j);\n if (mime instanceof Element) {\n String mimeValue = mime.getTextContent();\n mimeValue = Strings.emptyToNull(mimeValue);\n if (mimeValue != null) {\n MediaType mediaType = MediaType.parse(mimeValue.trim());\n if (mediaType != null) {\n result.add(mediaType);\n }\n }\n }\n }\n }", "Type_use getType_use();", "public Collection getMimeTypesByteArray(byte[] data)\n\t\t\tthrows UnsupportedOperationException {\n\t\treturn lookupMagicData(data);\n\t}", "@org.junit.Test(timeout = 10000)\n public void annotatedWildcardTypeNameWithExtends_cf28040_failAssert29() {\n // AssertGenerator generate try/catch block with fail statement\n try {\n java.lang.String expected = (\"? extends @\" + (com.squareup.javapoet.AmplAnnotatedTypeNameTest.NN)) + \" java.lang.String\";\n com.squareup.javapoet.TypeName type = com.squareup.javapoet.TypeName.get(java.lang.String.class).annotated(NEVER_NULL);\n java.lang.String actual = com.squareup.javapoet.WildcardTypeName.subtypeOf(type).toString();\n // StatementAdderMethod cloned existing statement\n type.unbox();\n org.junit.Assert.fail(\"annotatedWildcardTypeNameWithExtends_cf28040 should have thrown UnsupportedOperationException\");\n } catch (java.lang.UnsupportedOperationException eee) {\n }\n }", "@Test\n public void getTypeArguments() {\n List<String> target=new ArrayList<String>() {{\n add(\"thimble\");\n }};\n\n Type[] arguments= TypeDetective.sniffTypeParameters(target.getClass(), ArrayList.class);\n assertEquals(1, arguments.length);\n assertEquals(String.class,arguments[0]);\n }", "public void addSubstitute(String match, String replace) {\n/* 206 */ if (!this.substitutes.containsKey(match))\n/* */ {\n/* 208 */ this.substitutes.put(match, new ArrayList<String>());\n/* */ }\n/* 210 */ ((List<String>)this.substitutes.get(match)).add(replace);\n/* */ }", "protected abstract String getType();", "@Test\n public void checkCharacterTypesRuleUnknownType() {\n final String[] original = { \"fooBAR\" };\n final String[] pass_types = { \"some_unknown_keyword\" };\n exception.expect(ConfigException.class);\n // TODO(dmikurube): Except \"Caused by\": exception.expectCause(instanceOf(JsonMappingException.class));\n // Needs to import org.hamcrest.Matchers... in addition to org.junit...\n checkCharacterTypesRuleInternal(original, original, pass_types, \"\");\n }" ]
[ "0.5475074", "0.5438148", "0.5237428", "0.5221895", "0.51448196", "0.51117206", "0.50630236", "0.5002596", "0.4935949", "0.4931132", "0.49262422", "0.49251845", "0.4859302", "0.48453128", "0.48402086", "0.4835488", "0.48306167", "0.48237333", "0.48119196", "0.48076606", "0.4807151", "0.47990698", "0.47778916", "0.47567493", "0.4749787", "0.47128734", "0.4698823", "0.4696874", "0.46716326", "0.46517703", "0.46509475", "0.46468085", "0.46463794", "0.46389282", "0.46373305", "0.4636246", "0.46341115", "0.46324146", "0.46236178", "0.46226475", "0.4619561", "0.46186796", "0.46174547", "0.4611815", "0.46056798", "0.46040145", "0.4600021", "0.45932883", "0.4588556", "0.45844316", "0.45821893", "0.45748973", "0.45578653", "0.45466664", "0.45448256", "0.45440903", "0.4519227", "0.45056987", "0.4504864", "0.44989917", "0.4492787", "0.44840956", "0.44831535", "0.4482866", "0.4479755", "0.44790056", "0.44773835", "0.44765967", "0.44755423", "0.44751966", "0.44670883", "0.4465021", "0.44631928", "0.44555023", "0.44525823", "0.44484147", "0.44479513", "0.4441946", "0.4440135", "0.4440135", "0.4440135", "0.4440135", "0.4440135", "0.4440135", "0.4440135", "0.4440135", "0.4440135", "0.4440135", "0.4440135", "0.4440135", "0.4440135", "0.44379827", "0.44274127", "0.44273818", "0.44258693", "0.4409878", "0.4406444", "0.44052118", "0.44008774", "0.4399492" ]
0.6892851
0
Given that we are a type specified in a replacement rule (e.g. a Var or Atom), can we consume a submatch of the given type in the match? Alternatively, we could have overriden .equals().
boolean replacementfor(Type o);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface MagicType extends Type {\n\n\t/**\n\t * Given that we are a type specified in a replacement rule (e.g. a Var or\n\t * Atom), can we consume a submatch of the given type in the match?\n\t *\n\t * Alternatively, we could have overriden .equals().\n\t */\n\tboolean replacementfor(Type o);\n}", "Object isMatch(Object arg, String wantedType);", "public static <T extends Enum<T>> T findMatch(Class<T> type, CharSequence input) {\n return literalMatcher(type).apply(input);\n }", "private static boolean matchParameter(IType type, @NotNull PsiType candidate, @NotNull Map<String, IType> typeVarMap, @Nullable PsiSubstitutor substitutor, boolean isStatic) {\n boolean result = false;\n\n if (type instanceof IMetaType) {\n type = ((IMetaType) type).getType();\n }\n\n IType basicPattern = type.isParameterizedType() ? type.getGenericType() : type;\n String patternName = basicPattern.getName();\n IType candidateType;\n\n if( candidate instanceof PsiEllipsisType ) {\n candidate = ((PsiEllipsisType)candidate).toArrayType();\n }\n\n if( candidate instanceof PsiArrayType && type.isArray() ) {\n return matchParameter( type.getComponentType(), ((PsiArrayType)candidate).getComponentType(), typeVarMap, substitutor, isStatic );\n }\n\n if (candidate instanceof PsiClassType) {\n PsiClassType candidateAsPsiClass = (PsiClassType) candidate;\n PsiClass resolvedCandidate = candidateAsPsiClass.resolve();\n String candidateName;\n if (resolvedCandidate != null) {\n if (resolvedCandidate instanceof PsiTypeParameter && substitutor != null) {\n resolvedCandidate = maybeSubstituteType(resolvedCandidate, substitutor);\n if (isStatic) {\n resolvedCandidate = stripToBoundingType((PsiTypeParameter) resolvedCandidate);\n }\n }\n if (resolvedCandidate instanceof PsiTypeParameter) {\n candidateName = resolvedCandidate.getName();\n } else {\n candidateName = resolvedCandidate.getQualifiedName();\n }\n } else {\n candidateName = candidate.getCanonicalText();\n }\n candidateType = typeVarMap.get(candidateName);\n if (candidateType != null) {\n result = type.equals(candidateType);\n }\n if( !result ) {\n result = candidateName.equals(patternName);\n if (result) {\n if( type instanceof ITypeVariableType && resolvedCandidate instanceof PsiTypeParameter ) {\n PsiClassType boundingType = JavaPsiFacadeUtil.getElementFactory( resolvedCandidate.getProject() ).createType( stripToBoundingType( (PsiTypeParameter)resolvedCandidate ) );\n result = matchParameter( TypeLord.getPureGenericType( ((ITypeVariableType)type).getBoundingType() ), boundingType, typeVarMap, substitutor, isStatic ) ||\n matchParameter( ((ITypeVariableType)type).getBoundingType(), boundingType, typeVarMap, substitutor, isStatic );\n }\n else {\n PsiType[] candidateTypeParams = candidateAsPsiClass.getParameters();\n IType[] patternTypeParams = type.getTypeParameters();\n int candidateTypeParamLength = candidateTypeParams != null ? candidateTypeParams.length : 0;\n int patternTypeParamLength = patternTypeParams != null ? patternTypeParams.length : 0;\n if (patternTypeParamLength == candidateTypeParamLength) {\n for (int i = 0; i < patternTypeParamLength; i++) {\n if (!matchParameter(patternTypeParams[i], candidateTypeParams[i], typeVarMap, substitutor, isStatic)) {\n result = false;\n break;\n }\n }\n } else {\n result = false;\n }\n }\n }\n }\n } else {\n PsiType unboundedCandidate = removeBounds(candidate);\n candidateType = typeVarMap.get(unboundedCandidate.getCanonicalText());\n if (candidateType != null) {\n result = type.equals(candidateType);\n } else {\n result = unboundedCandidate.equalsToText(patternName);\n }\n }\n if (!result && type instanceof IShadowingType) {\n return matchShadowedTypes((IShadowingType) type, candidate, typeVarMap, substitutor, isStatic);\n }\n return result;\n }", "public interface NodeTypeMatcher {\n /**\n * Determines whether two Nodes are eligible for comparison\n * based on their node type.\n */\n boolean canBeCompared(short controlType, short testType);\n }", "public Verification verifySubtypeOf(Type type, String meaningThisType, String meaningOtherType, Element cause);", "static void match(TokenType ttype) throws IOException {\n if(ttype == curr_type) {\n getToken();\n }\n else {\n cout.println(\"Match Error: \" + ttype);\n System.exit(1);\n }\n }", "public void matchType()\n {\n if(this.getGameType() == 1)\n {\n this.setType(\"s\");\n }\n else if(this.getGameType() == 2)\n {\n this.setType(\"r\");\n }\n else if(this.getGameType() == 3)\n {\n this.setType(\"c\");\n }\n }", "public DebugRuleElementMatch(int addr, TOP_Type type) {\n super(addr, type);\n readObject();\n }", "@Override\n public boolean matches(ReferenceType refType) {\n if (isWild) {\n return refType.name().endsWith(classId);\n } else {\n return refType.name().equals(classId);\n }\n }", "boolean contains(Pattern type) {\n for (ASTNode child : children) {\n if (type.matcher(child.getType()).find()) return true;\n }\n \n return false;\n }", "public Matcher forType(String typeOf) {\n\t\tMatcher matcher = new Matcher(jCas, typeOf);\n\t\tthis.matchers.add(matcher);\n\t\treturn matcher;\n\t}", "boolean matchesType( Name primaryType,\n Set<Name> mixinTypes );", "boolean containsAll(Pattern type) {\n boolean matchesType = contains(type);\n if (!matchesType) {\n for (ASTNode child : children) {\n matchesType = child.containsAll(type);\n if (matchesType) return true;\n }\n\n // should be false\n return matchesType;\n } else return true;\n }", "private boolean match(Type t, Type original) {\n\t\t\t\treturn original.getSort() == Type.METHOD && original.getSort() == t.getSort();\n\t\t\t}", "private void match(TokenType tokType) {\r\n if(tokens.get(position).returnType() != tokType) {\r\n \t\tSystem.out.println(position);\r\n parseError();\r\n }\r\n position++;\r\n }", "@Override\n\tpublic void visit(RegExpMatchOperator arg0) {\n\t\t\n\t}", "boolean matched(int index, String pattern, T value);", "public static boolean simplyContains(Regexp container, Variable contained) {\n\t\tif ((container instanceof Variable) && contained.equals(container)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tif (container instanceof Alternation) {\n\t\t\t\tfor (Regexp exp : ((Alternation)container).getExp()) {\n\t\t\t\t\tif(exp instanceof Concatenation) {\n\t\t\t\t\t\t//last one\n\t\t\t\t\t\tList<Regexp> list = ((Concatenation)exp).getExp();\n\t\t\t\t\t\tRegexp last = list.get(list.size()-1);\n\t\t\t\t\t\tif (last instanceof Variable) {\n\t\t\t\t\t\t\tif (((Variable)last).equals(contained))\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(exp instanceof Alternation) {//TODO test\n\t\t\t\t\t\tSystem.out.println(\"Not possible: alt in alt :RegexpUtil\");\n\t\t\t\t\t} else if(exp instanceof Variable) {\n\t\t\t\t\t\tif(contained.equals(exp)) \n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else if(exp instanceof KleeneStar) {//TODO test\n\t\t\t\t\t\tif(((KleeneStar) exp).getExp() instanceof Variable)\n\t\t\t\t\t\t\tSystem.out.println(\"Not possible: var in star :RegexpUtil\");\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t} else if (container instanceof Concatenation) {\n\t\t\t\t//last one\n\t\t\t\tList<Regexp> list = ((Concatenation)container).getExp();\n\t\t\t\tRegexp last = list.get(list.size()-1);\n\t\t\t\tif (last instanceof Variable) {\n\t\t\t\t\tif (((Variable)last).equals(contained))\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else if (container instanceof KleeneStar) {//impossible\n\t\t\t\tif(((KleeneStar) container).getExp() instanceof Variable) {\n\t\t\t\t\tSystem.out.println(\"BIG PB: KLEENESTAR CONTAINS VARIABLE when compare simplyContains :RegexpUtil\");//TODO\n\t\t\t\t\treturn contained.equals(((KleeneStar)container).getExp());\n\t\t\t\t}\n\n\t\t\t} \t\t\t\n\t\t}\t\t\n\t\t\n\t\treturn false;\n\t}", "public boolean accept(T object, String pattern);", "public boolean evaluate(Substitution sub);", "public void setMatch(OFMatch mt) {\n\t\tthis.match = mt;\r\n\t}", "@Override\n\t\t\t\tpublic boolean accept(Match a) {\n\t\t\t\t\treturn false;\n\t\t\t\t}", "public abstract Match match();", "public void process(ESLParser.UnprocessedMatchEvent ume) {\r\n\t\tESL.Match match = new ESL.Match();\r\n\t\tmatch.policy = ume.policy;\r\n\t\tmatch.evtName = ume.event.name;\r\n\t\tmatch.cexprs = new ESL.CExpr[ume.cexprs.size()];\r\n\t\tif (ume.ablock != null) {\r\n\t\t\tString abstr = ume.ablock.str.trim();\r\n\t\t\tif (!abstr.endsWith(\";\")) {\r\n\t\t\t\tabstr += \";\";\r\n\t\t\t}\r\n\t\t\tmatch.ablock = new ESL.CExpr(abstr);\r\n\r\n\t\t}\r\n\t\tfor (int i = 0; i < match.cexprs.length; ++i) {\r\n\t\t\tmatch.cexprs[i] =\r\n\t\t\t\tnew ESL.CExpr(((Tokenizer.Token) ume.cexprs.get(i)).str);\r\n\t\t}\r\n\t\tmatch.argrules = new ESL.Rule[ume.args.size()];\r\n\t\tfor (int i = 0; i < match.argrules.length; ++i) {\r\n\t\t\tTokenizer.Token tok = (Tokenizer.Token) ume.args.get(i);\r\n\t\t\tEDL.Type declaredtype = ume.event.args[i].type;\r\n\r\n\t\t\tif (tok.type == TOK_STRING) {\r\n\t\t\t\t//\tassume regex\r\n\t\t\t\tmatch.argrules[i] = new ESL.RegexRule(tok.str, false);\r\n\t\t\t} else if (tok.type == TOK_IDENT) {\r\n\t\t\t\tEDL.Type expectedtype = edl.getType(tok.str);\r\n\r\n\t\t\t\tif (expectedtype != null) {\r\n\t\t\t\t\t// expectedtype better be a subtype of the\r\n\t\t\t\t\t// declaredtype\r\n\t\t\t\t\tif (!EDL.isSubtype(declaredtype, expectedtype)) {\r\n\t\t\t\t\t\tthrow new ESLSemanticError(\r\n\t\t\t\t\t\t\t\"type \"\r\n\t\t\t\t\t\t\t\t+ expectedtype.getName()\r\n\t\t\t\t\t\t\t\t+ \" is not of type \"\r\n\t\t\t\t\t\t\t\t+ declaredtype.getName());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// do an instanceof type check\r\n\t\t\t\t\tmatch.argrules[i] = new ESL.TypeRule(expectedtype);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// maybe its a variable\r\n\t\t\t\t\tESL.VarDecl var = (ESL.VarDecl) esl.vars.get(tok.str);\r\n\t\t\t\t\tif (var != null) {\r\n\t\t\t\t\t\tif (EDL.isSubtype(var.type.getEDL().typeString, var.type)) {\r\n\t\t\t\t\t\t\tmatch.argrules[i] =\r\n\t\t\t\t\t\t\t\tnew ESL.RegexRule(var.name, true);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthrow new ESLSemanticError(\r\n\t\t\t\t\t\t\t\t\"don't (yet) know how to match type \"\r\n\t\t\t\t\t\t\t\t\t+ var.type.getName());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// TODO: maybe this could be legal in some circumstance?\r\n\t\t\t\t\t\tthrow new ESLSemanticError(\r\n\t\t\t\t\t\t\t\"unknown type or variable\" + tok.str);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"Unknown token \" + tok);\r\n\t\t\t\tmatch.argrules[i] = new ESL.TrueRule();\r\n\t\t\t}\r\n\t\t}\r\n\t\tesl.evmap.add(match.evtName, match);\r\n\t}", "public interface PacketMatcher {\n public boolean matches(ChatPacket packet);\n\n /**\n * Simple matcher for basing selection on PacketType\n * \n * @author Aaron Rosenfeld <[email protected]>\n * \n */\n public static class TypeMatcher implements PacketMatcher {\n private PacketType[] types;\n\n public TypeMatcher(PacketType... types) {\n this.types = types;\n }\n\n @Override\n public boolean matches(ChatPacket packet) {\n for (PacketType t : types) {\n if (packet.getType() == t) {\n return true;\n }\n }\n return false;\n }\n }\n}", "public boolean match(MindObject other){\n return other.isSubtypeOf(this) || isSubtypeOf(other);\n }", "Match getPartialMatch();", "protected abstract void onMatch(String value, Label end);", "private int matchLevel(QualifiedTypeReference typeRef, boolean resolve) {\n if (!resolve) {\n if (this.pkgName == null) {\n return this.needsResolve ? POSSIBLE_MATCH : ACCURATE_MATCH;\n } else {\n switch (this.matchMode) {\n case EXACT_MATCH:\n case PREFIX_MATCH:\n if (CharOperation.prefixEquals(this.pkgName, CharOperation.concatWith(typeRef.tokens, '.'), this.isCaseSensitive)) {\n return this.needsResolve ? POSSIBLE_MATCH : ACCURATE_MATCH;\n } else {\n return IMPOSSIBLE_MATCH; }\n case PATTERN_MATCH:\n char[] pattern = this.pkgName[this.pkgName.length-1] == '*' ? this.pkgName : CharOperation.concat(this.pkgName, \".*\".toCharArray()); //$NON-NLS-1$\n if (CharOperation.match(pattern, CharOperation.concatWith(typeRef.tokens, '.'), this.isCaseSensitive)) {\n return this.needsResolve ? POSSIBLE_MATCH : ACCURATE_MATCH;\n } else {\n return IMPOSSIBLE_MATCH; }\n default:\n return IMPOSSIBLE_MATCH; } }\n } else {\n TypeBinding typeBinding = typeRef.binding;\n if (typeBinding == null) {\n return INACCURATE_MATCH;\n } else {\n if (typeBinding instanceof ArrayBinding) {\n typeBinding = ((ArrayBinding)typeBinding).leafComponentType; }\n if (typeBinding == null) {\n return INACCURATE_MATCH;\n } else if (typeBinding instanceof ReferenceBinding) {\n PackageBinding pkgBinding = ((ReferenceBinding)typeBinding).fPackage;\n if (this.matches(pkgBinding.compoundName)) {\n return ACCURATE_MATCH;\n } else {\n return IMPOSSIBLE_MATCH; }\n } else {\n return IMPOSSIBLE_MATCH; } } } }", "public boolean match( DataExp p ) { return false; }", "protected abstract Matcher<? super ExpressionTree> specializedMatcher();", "abstract protected boolean checkType(String myType);", "Match getResultMatch();", "interface Matcher<R extends OWLPropertyRange, F extends R, P extends OWLPropertyExpression<R, P>> {\n boolean isMatch(OWLClassExpression c, P p, R f);\n\n boolean isMatch(OWLClassExpression c, P p, R f, boolean direct);\n\n /** Perform a recursive search, adding nodes that match. If direct is true\n * only add nodes if they have no subs that match\n * \n * @param c\n * class\n * @param p\n * property\n * @param start\n * start\n * @param direct\n * direct\n * @return set of leave nodes */\n NodeSet<F> getLeaves(OWLClassExpression c, P p, R start, boolean direct);\n\n /** Perform a search on the direct subs of start, adding nodes that match. If\n * direct is false then recurse into descendants of start\n * \n * @param c\n * class\n * @param p\n * property\n * @param start\n * start\n * @param direct\n * direct\n * @return set of root nodes */\n NodeSet<F> getRoots(OWLClassExpression c, P p, R start, boolean direct);\n}", "public static Typematch type(String byTypeURI) {\n\t\treturn new Typematch(byTypeURI);\n\t}", "public boolean matches(String value, TokenType type) {\n return TYPE == type && VALUE.equals(value);\n }", "public boolean match( ElementExp p ) { return false; }", "private static boolean accepts(Automaton type, Automaton.Term tState, Automaton actual, Automaton.Term aTerm,\n\t\t\tSchema schema, BinaryMatrix assumptions) {\n\t\tAutomaton.List list = (Automaton.List) type.get(tState.contents);\n\t\tString expectedName = ((Automaton.Strung) type.get(list.get(0))).value;\n\t\tString actualName = schema.get(aTerm.kind).name;\n\t\tif (!expectedName.equals(actualName)) {\n\t\t\treturn false;\n\t\t} else if (list.size() == 1) {\n\t\t\treturn aTerm.contents == Automaton.K_VOID;\n\t\t} else {\n\t\t\treturn accepts(type, list.get(1), actual, aTerm.contents, schema, assumptions);\n\t\t}\n\t}", "@Override\n public MatchElement apply(Pair<Satisfaction, InjectionPoint> n) {\n Satisfaction sat = n.getLeft();\n boolean typeMatches;\n if (type == null) {\n typeMatches = sat == null\n || sat.getErasedType() == null\n || sat.getType().equals(Void.TYPE);\n } else {\n typeMatches = sat != null && sat.getErasedType() != null &&\n type.isAssignableFrom(sat.getErasedType());\n }\n\n if (typeMatches && qualifier.matches(n.getRight().getQualifier())) {\n return new MatchElem(sat == null ? null : sat.getErasedType(),\n type, qualifier);\n } else {\n return null;\n }\n }", "public boolean testsSubtypeSensitiveVars()\n/* */ {\n/* 100 */ return (this.runtimeTest != null) && \n/* 101 */ (new SubtypeSensitiveVarTypeTestVisitor(null).testsSubtypeSensitiveVars(this.runtimeTest));\n/* */ }", "private boolean resolveType(SearchedItem item,Ancestor ancestor) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {\n Object o = ancestor.getObject();\n if (o instanceof Jenkins){\n return _resolveType((Jenkins)o, item);\n }\n item.setType(Type.OTHER);\n return true;\n }", "private static Object referenceValue(IDatatype type, Object value) {\n if (Reference.TYPE.isAssignableFrom(type)) {\n DisplayNameProvider nameProvider = DisplayNameProvider.getInstance();\n List<AbstractVariable> possibleDecls = ReferenceValuesFinder.findPossibleValues(\n de.uni_hildesheim.sse.qmApp.model.VariabilityModel.Configuration.INFRASTRUCTURE.getConfiguration()\n .getProject(), (Reference) type);\n for (int i = 0; i < possibleDecls.size(); i++) {\n AbstractVariable declaration = possibleDecls.get(i);\n String name = nameProvider.getDisplayName(declaration);\n if (name.equals(value)) {\n value = declaration;\n break;\n }\n }\n } \n return value;\n }", "public static TypeBinaryExpression typeEqual(Expression expression, Class type) { throw Extensions.todo(); }", "public static Typematch type(Object byValue) {\n\t\treturn new Typematch(byValue);\n\t}", "public boolean assignableTo(Type other) throws LookupException;", "boolean contains(String type) {\n for (ASTNode child : children) {\n if (child.getType().equals(type)) return true;\n }\n\n return false;\n }", "public int match(TypeDeclaration node, MatchingNodeSet nodeSet) {\n if (!this.pattern.findReferences)\n return IMPOSSIBLE_MATCH;\n if (this.pattern.fineGrain != 0 && (this.pattern.fineGrain & ~IJavaSearchConstants.METHOD_REFERENCE_EXPRESSION) == 0)\n return IMPOSSIBLE_MATCH;\n // need to look for a generated default constructor\n return nodeSet.addMatch(node, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH);\n }", "public static boolean match(\n String fixedOp, String varOp, Parameter.Operator op, Parameter.ParameterDataType type) {\n // If fixedOp == null, varOp can match only if null and operator is EQ, or the opposite.\n if (fixedOp == null) {\n return (Parameter.Operator.EQ.equals(op) && varOp == null)\n || ((!Parameter.Operator.EQ.equals(op) || varOp == null)\n && (!Parameter.Operator.NE.equals(op) || varOp != null)\n && Parameter.Operator.NE.equals(op)\n && varOp != null);\n }\n // If varOp == null, fixedOp can match only if operator is NE (since fixedOp cannot be null).\n if (varOp == null) {\n return Parameter.Operator.NE.equals(op);\n }\n switch (type) {\n case NUMBER:\n // Neither varOp nor fixedOp can be NULL here.\n try {\n Long operandL = Long.valueOf(varOp);\n Long ppL = Long.valueOf(fixedOp);\n return (Parameter.Operator.EQ.equals(op) && ppL.longValue() == operandL.longValue())\n || (Parameter.Operator.NE.equals(op) && ppL.longValue() != operandL.longValue())\n || (Parameter.Operator.LT.equals(op) && ppL < operandL)\n || (Parameter.Operator.LE.equals(op) && ppL <= operandL)\n || (Parameter.Operator.GE.equals(op) && ppL >= operandL)\n || (Parameter.Operator.GT.equals(op) && ppL > operandL);\n } catch (NumberFormatException ignored) {\n }\n return false;\n case TEXT:\n if (Parameter.Operator.EQ.equals(op)) {\n if (varOp.contains(\"_\") || varOp.contains(\"%\")) {\n return matchWildcardString(fixedOp, varOp);\n }\n return fixedOp.equals(varOp);\n }\n if (Parameter.Operator.NE.equals(op)) {\n if (varOp.contains(\"_\") || varOp.contains(\"%\")) {\n return !matchWildcardString(fixedOp, varOp);\n }\n return !fixedOp.equalsIgnoreCase(varOp);\n }\n int compareInt = fixedOp.compareToIgnoreCase(varOp);\n return (Parameter.Operator.LT.equals(op) && compareInt < 0)\n || (Parameter.Operator.LE.equals(op) && compareInt <= 0)\n || (Parameter.Operator.GE.equals(op) && compareInt >= 0)\n || (Parameter.Operator.GT.equals(op) && compareInt > 0);\n default:\n return false;\n }\n }", "protected abstract <T> T match(SelectorModel<T> model, T element);", "public boolean contains(Type item);", "@Override\n public abstract boolean isAssignableBy(TypeUsage other);", "final protected boolean match( Token T, String token )\n {\n return match( T, token, 0, false );\n }", "public final boolean isEqualTo (Type type)\n {\n if (this == type)\n return true;\n\n if (!(type instanceof TypeTerm))\n return false;\n\n TypeTerm typeTerm = (TypeTerm)type;\n \n if (kind() != typeTerm.kind() || name() != typeTerm.name() || arity() != typeTerm.arity())\n return false;\n\n for (int i=arity(); i-->0;)\n if (!argument(i).isEqualTo(typeTerm.argument(i)))\n return false;\n\n return true;\n }", "boolean exactMatch(FlowRule rule);", "private Token match(Kind kind) throws SyntaxException {\n\t\tif (t.kind.equals(kind)) {\n\t\t\treturn consume();\n\t\t}\n\t\tthrow new SyntaxException(\"saw \" + t.kind + \"expected \" + kind);\n\t}", "@Override\r\n\t\tprotected boolean visit(final Type type) {\r\n\t\t\tChecker.notNull(\"parameter:type\", type);\r\n\r\n\t\t\tfinal Method method = type.findMethod(this.getMethodName(), this.getParameterTypes());\r\n\t\t\tfinal boolean skipRemaining = method != null;\r\n\t\t\tif (skipRemaining) {\r\n\t\t\t\tthis.setFound(method);\r\n\t\t\t}\r\n\t\t\treturn skipRemaining;\r\n\t\t}", "protected abstract boolean matches(String paramString, int paramInt);", "public <E> E check(final E argument, final SType type) {\n if (VmSettings.COLLECT_TYPE_STATS) {\n ++numSubclassChecks;\n }\n\n // Check the cache\n if (VmSettings.USE_SUBTYPE_TABLE) {\n E result = checkTable(isSub, expected, argument, type, sourceSection, exception);\n if (result != null) {\n return result;\n }\n }\n\n if (VmSettings.COLLECT_TYPE_STATS) {\n ++numTypeCheckExecutions;\n }\n\n // Otherwise check if type check passes\n boolean result;\n if (argument == Nil.nilObject) {\n // Force nil object to subtype\n result = true;\n } else {\n result = expected.isSuperTypeOf(type, argument);\n }\n // Add the result to the cache\n if (isSub != null) {\n isSub[type.id] = result ? SUBTYPE : FAIL;\n }\n // Throw an error if the check didn't pass\n if (!result) {\n throwTypeError(argument, type, expected, sourceSection, exception);\n }\n // Otherwise return the argument\n return argument;\n }", "public String getMatchType() {\n return getStringProperty(\"MatchType\");\n }", "Object visitSubtype(SubtypeNode node, Object state);", "public abstract boolean isTypeOf(ItemType type);", "public static boolean IsA(VariableType type1, VariableType type2, SymbolTable symbolTable) {\n\t\t// TODO Auto-generated method stub\n\t\tif(type1.type==FourType.Boolean || type1.type==FourType.Integer || type1.type==FourType.IntegerArray)\n\t\t\treturn type1.type==type2.type;\n\t\tif(type1.type==FourType.Object)\n\t\t{\n\t\t\tif(type2.type!=FourType.Object)\n\t\t\t\treturn false;\n\t\t\tif(type1.name==type2.name)\n\t\t\t\treturn true;\n\t\t\tClassItem classItem=symbolTable.SearchClass(type1.name);\n\t\t\tif(classItem==null)\n\t\t\t\treturn false;\n\t\t\treturn IsA(new VariableType(FourType.Object,classItem.parentName),type2,symbolTable);\n\t\t}\n\t\treturn false;\n\t}", "public List findMatchingTypes(\n String typeField, String toMatch, DatasetItem dataset, boolean matchAny) {\n\n String query = null;\n if (typeField.equals(\"transactionTypeTool\")) {\n query = FIND_TOOL_TYPES;\n } else if (typeField.equals(\"transactionTypeTutor\")) {\n query = FIND_TUTOR_TYPES;\n } else if (typeField.equals(\"transactionSubtypeTool\")) {\n query = FIND_TOOL_SUBTYPES;\n } else if (typeField.equals(\"transactionSubtypeTutor\")) {\n query = FIND_TUTOR_SUBTYPES;\n } else {\n throw new IllegalArgumentException(\"typeField does not match any expected values. \"\n + \"'\" + typeField + \"'\");\n }\n\n toMatch = matchAny ? \"%\" + toMatch.toUpperCase() + \"%\" : toMatch.toUpperCase() + \"%\";\n\n Object[] paramArray = new Object[2];\n paramArray[0] = dataset.getId();\n paramArray[1] = toMatch;\n\n return getHibernateTemplate().find(\n query, paramArray);\n }", "public static boolean containsVar(Regexp container) {\n\t\tif(container instanceof Alternation) {\n\t\t\tList<Regexp> exps = ((Alternation) container).getExp();\n\t\t\tfor(Regexp exp: exps) {\n\t\t\t\tif (exp instanceof Variable) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else if(exp instanceof Concatenation) {\n\t\t\t\t\t//verify the last one\n\t\t\t\t\tRegexp last = ((Concatenation) exp).getExp().get(((Concatenation) exp).getExp().size()-1);\n\t\t\t\t\tif(last instanceof Variable) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t} else if(exp instanceof KleeneStar) {\n\t\t\t\t\tRegexp cexp = ((KleeneStar) exp).getExp();\n\n\t\t\t\t\tif(cexp instanceof Variable) {\n\t\t\t\t\t\tSystem.out.println(\"==IMPOSSIBLE: a Variable was found in Star!!!!!!!!!!== :RegexpUtil\");\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if(container instanceof Concatenation) {\n\t\t\tList<Regexp> exps = ((Concatenation) container).getExp();\n\n\t\t\t//verify the last one\n\t\t\tRegexp last = exps.get(exps.size()-1);\n\t\t\tif(last instanceof Variable) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else if(container instanceof KleeneStar) {\n\t\t\tRegexp exp = ((KleeneStar) container).getExp();\n\n\t\t\tif(exp instanceof Variable) {\n\t\t\t\tSystem.out.println(\"==IMPOSSIBLE: a Variable was found in Star!!!!!!!!!!== :RegexpUtil\");\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public int indexOf(Type t);", "@Override\n\tpublic boolean test(MyRegex t) {\n\t\treturn false;\n\t}", "boolean containsAll(String type) {\n boolean containsType = contains(type);\n if (!containsType) {\n for (ASTNode child : children) {\n containsType = child.containsAll(type);\n if (containsType) return true;\n }\n\n // should be false\n return containsType;\n } else return true;\n }", "protected interface TypeCheckingNode {\n /**\n * Checks whether an object is known to be subtype in the cache.\n *\n * @param isSub - the cache of subtypes\n * @param expected - the expected type\n * @param argument - the object being checked\n * @param type - the type of the argument\n * @param sourceSection - the location in source of the type check\n * @param exception - the node used to throw errors\n * @return The argument if it is a subtype. Null if it wasn't in the cache. Otherwise an\n * error is thrown.\n */\n default <E> E checkTable(final byte[] isSub,\n final SObjectWithClass expected, final E argument, final SType type,\n final SourceSection sourceSection, final ExceptionSignalingNode exception) {\n byte sub = isSub[type.id];\n if (sub == SUBTYPE) {\n return argument;\n } else if (sub == FAIL) {\n reportError(argument, type, expected, sourceSection, exception);\n }\n return null;\n }\n\n /**\n * The method that should call throwTypeError.\n */\n void reportError(Object argument, Object type, Object expected,\n SourceSection sourceSection, ExceptionSignalingNode exception);\n\n /**\n * Checks whether an object is Nil.\n */\n default boolean isNil(final SObjectWithoutFields obj) {\n return obj == Nil.nilObject;\n }\n }", "public void setMatchAny() {\n this.value = ANY;\n }", "private static Type matchType(String type) {\n if (type == null) {\n return VarcharType.VARCHAR;\n }\n\n switch (type.toLowerCase()) {\n case \"string\":\n return VarcharType.VARCHAR;\n case \"int\":\n return IntegerType.INTEGER;\n case \"bigint\":\n return BigintType.BIGINT;\n case \"double\":\n return DoubleType.DOUBLE;\n case \"boolean\":\n return BooleanType.BOOLEAN;\n case \"array<string>\":\n return new ArrayType(VarcharType.VARCHAR);\n case \"timestamp\":\n return TimestampType.TIMESTAMP;\n case \"datetime\":\n return TimestampType.TIMESTAMP;\n case \"number\":\n return DecimalType.createDecimalType(DECIMAL_DEFAULT_PRECISION, DECIMAL_DEFAULT_SCALE);\n default:\n return VarcharType.VARCHAR;\n }\n }", "private boolean check(TokenType type) {\n return !isAtEnd() && peek().type == type;\n }", "public <E> E check(final E argument, final SType type) {\n if (VmSettings.COLLECT_TYPE_STATS) {\n ++numSubclassChecks;\n }\n\n // Check the cache\n if (VmSettings.USE_SUBTYPE_TABLE) {\n byte sub = isSub[type.id];\n if (sub == SUBTYPE) {\n return argument;\n } else if (sub == FAIL) {\n throwTypeError(argument, type, expected, sourceSection, exception);\n }\n }\n\n if (VmSettings.COLLECT_TYPE_STATS) {\n ++numTypeCheckExecutions;\n }\n\n // Otherwise check if type check passes\n boolean result;\n if (argument == Nil.nilObject) {\n // Force nil object to subtype\n result = true;\n } else {\n result = expected.isSuperTypeOf(type, argument);\n }\n // Add the result to the cache\n if (isSub != null) {\n isSub[type.id] = result ? SUBTYPE : FAIL;\n }\n // Throw an error if the check didn't pass\n if (!result) {\n throwTypeError(argument, type, expected, sourceSection, exception);\n }\n // Otherwise return the argument\n return argument;\n }", "public boolean isSubstitute();", "public boolean matches(String arg) {\n switch (this.type) {\n case STRING:\n return true;\n case INTEGER:\n return arg.matches(\"\\\\d+\");\n default:\n /* The following default block can never be executed (because all Types are covered), but it must be\n * added, because otherwise I would get a VSCode error (saying that this method must return a boolean).\n */\n throw new IllegalArgumentException(\"The developer made a mistake. Please contact him to solve this\"\n + \" problem.\");\n }\n }", "public boolean match( ListExp p ) { return false; }", "private static boolean isTypeMatch(String s) {\n s = s.substring(1, s.length() - 1); \n /*\n * input is \n * case1: \"abc\", +3, -7.5, -7.5f, 2e3\n * case2: ?i:int, ?f:float, ?s:string\n * \n * 1. split by \",\" , get field [\" ?i:int \", \" 3\"]\n * 2. check whether is type match\n */\n String[] ss = s.split(\",\"); // [\" ?i:int \", \" 3\"]\n for (int i = 0; i < ss.length; i++) {\n String temp = ss[i].trim(); // \"abc\" +3 -7.5f 2e3\n // type match\n if (temp.charAt(0) == '?' && temp.indexOf(':') != -1) {\n return true;\n }\n }\n return false;\n }", "private boolean match(TokenType... types) {\n for (TokenType type : types) {\n if(check(type)) { // Hit! consume token and step forward\n advance();\n return true;\n }\n }\n return false; // This was a dud, don't consume any tokens\n }", "public T getExactMatch(String arg)\n\t{\n\t\treturn null;\n\t}", "public RegExp (final int type)\n {\n this.type = type;\n }", "private void assertType(String snippet, Class<? extends Object> type) {\n try {\n Lexer lexer = new Lexer(new StringReader(snippet));\n Parser parser = new Parser(lexer);\n RootNode node = parser.program();\n AssignNode assignment = (AssignNode) node.get(0);\n assertTrue(assignment.getRight().getClass() == type);\n } catch (IOException e) {\n fail(e.getMessage());\n }\n }", "boolean match(String mnemonic, ParameterType[] parameters);", "@Override\n protected boolean matchesSafely(T actualValue) {\n return this.matchFn.test(actualValue);\n }", "public void setSubtype (String subtype) {\n this.subtype = subtype;\n }", "void setPartialMatch(Match partialMatch);", "public void visit(BaseNode node) {\n String type = node.getTypeName();\n if (!nodeToSearch.contains(type))\n return;\n\n if (subRule.equals(\"wsdl\") || subRule.equals(\"xsd\")) {\n validWsdl(node, ctx);\n } else if (subRule.equals(\"process\")) {\n validProcess(node, ctx);\n }\n\n }", "public static <T extends Enum<T>> T findMatch(Map<T, CharSequence> map, CharSequence input) {\n return literalMatcher(map).apply(input);\n }", "public T[] matches(T element);", "public void matchreplace(List<PatternItem> pattern, List<TemplItem> template) {\n int i = 0;\n int ndx = 0;\n int srch = 0;\n Rope matched;\n List<Rope> env = new ArrayList<>();\n Stack<Integer> c = new Stack<>();\n\n for (PatternItem item : pattern) {\n switch (item.getType()) {\n case BASE:\n if (dna.get(i) == item.getValue()) {\n i += 1;\n } else {\n return;\n }\n break;\n case JUMP:\n i += item.getValue();\n if (!dna.isValidIndex(i - 1)) {\n return;\n }\n break;\n case OPEN:\n c.push(i);\n break;\n case CLOSE:\n ndx = c.pop();\n matched = dna.substring(ndx, i);\n env.add(matched);\n break;\n case SEARCH:\n srch = dna.search(item.getSearch());\n i = srch;\n break;\n default:\n // The docs don't say what to do here, so bail out\n throw new RuntimeException(\"matchreplace unhandled pattern \" + item.getType());\n }\n }\n\n dna.trunc(i);\n replace(template, env);\n }", "@Override\n public abstract boolean isAssignableBy(ResolvedType other);", "@And(\"^I go to \\\"([^\\\"]*)\\\" type and select \\\"([^\\\"]*)\\\"$\") //Selecting Type & sub-Type in Create form\r\n\tpublic void selectFormType(String type,String subtype) {\r\n\t\r\n\tenduser.selectFormType(type,subtype);\r\n\t}", "private boolean tagsMatch(Tag target, Tag test) {\n\t\tboolean checkValue = target.getValue() != null;\n\n\t\tif (checkValue) {\n\t\t\tif (test.equalsTypeValue(target))\n\t\t\t\treturn true;\n\n\t\t} else if (test.equalsType(target))\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "public void setSubtype (String subtype) {\n this.subtype = subtype;\n }", "public boolean match(ReflectClass classReflector);", "@Pure\n\tprotected boolean isSubTypeOf(EObject context, JvmTypeReference subType, JvmTypeReference superType) {\n\t\tif (isTypeReference(superType) && isTypeReference(subType)) {\n\t\t\tStandardTypeReferenceOwner owner = new StandardTypeReferenceOwner(services, context);\n\t\t\tLightweightTypeReferenceFactory factory = new LightweightTypeReferenceFactory(owner, false);\n\t\t\tLightweightTypeReference reference = factory.toLightweightReference(subType);\n\t\t\treturn reference.isSubtypeOf(superType.getType());\n\t\t}\n\t\treturn false;\n\t}", "private static void validate(int type, int field, int match, String value) {\n if ((type != Type.SONG) && (field == Field.PLAY_COUNT || field == Field.SKIP_COUNT)) {\n throw new IllegalArgumentException(type + \" type does not have field \" + field);\n }\n // Only Songs have years\n if (type != Type.SONG && field == Field.YEAR) {\n throw new IllegalArgumentException(type + \" type does not have field \" + field);\n }\n // Only Songs have dates added\n if (type != Type.SONG && field == Field.DATE_ADDED) {\n throw new IllegalArgumentException(type + \" type does not have field \" + field);\n }\n\n if (field == Field.ID) {\n // IDs can only be compared by equals or !equals\n if (match == Match.CONTAINS || match == Match.NOT_CONTAINS\n || match == Match.LESS_THAN || match == Match.GREATER_THAN) {\n throw new IllegalArgumentException(\"ID cannot be compared by method \" + match);\n }\n // Make sure the value is actually a number\n try {\n //noinspection ResultOfMethodCallIgnored\n Long.parseLong(value);\n } catch (NumberFormatException e) {\n Crashlytics.logException(e);\n throw new IllegalArgumentException(\"ID cannot be compared to value \" + value);\n }\n } else if (field == Field.NAME) {\n // Names can't be compared by < or >... that doesn't even make sense...\n if (match == Match.GREATER_THAN || match == Match.LESS_THAN) {\n throw new IllegalArgumentException(\"Name cannot be compared by method \"\n + match);\n }\n } else if (field == Field.SKIP_COUNT || field == Field.PLAY_COUNT\n || field == Field.YEAR || field == Field.DATE_ADDED) {\n // Numeric values can't be compared by contains or !contains\n if (match == Match.CONTAINS || match == Match.NOT_CONTAINS) {\n throw new IllegalArgumentException(field + \" cannot be compared by method \"\n + match);\n }\n // Make sure the value is actually a number\n try {\n //noinspection ResultOfMethodCallIgnored\n Long.parseLong(value);\n } catch (NumberFormatException e) {\n Crashlytics.logException(e);\n throw new IllegalArgumentException(\"ID cannot be compared to value \" + value);\n }\n }\n }", "private static boolean shouldStop(AnnotatedTypeMirror sup, AnnotatedTypeMirror sub) {\n // Check if it's the same type\n // if sup is primitive, but not sub\n if (sup.getKind().isPrimitive() && !sub.getKind().isPrimitive()) {\n /// XXX shouldn't this be \"return false\"?\n return true;\n }\n if (sup.getKind().isPrimitive() && sub.getKind().isPrimitive()) {\n return sup.getKind() == sub.getKind();\n }\n // if both are declared\n if (sup.getKind() == TypeKind.DECLARED && sub.getKind() == TypeKind.DECLARED) {\n AnnotatedDeclaredType supdt = (AnnotatedDeclaredType) sup;\n AnnotatedDeclaredType subdt = (AnnotatedDeclaredType) sub;\n\n // Check if it's the same name\n if (!supdt.getUnderlyingType().asElement().equals(\n subdt.getUnderlyingType().asElement()))\n return false;\n\n return true;\n }\n\n if (sup.getKind() == TypeKind.ARRAY && sub.getKind() == TypeKind.ARRAY) {\n AnnotatedArrayType supat = (AnnotatedArrayType) sup;\n AnnotatedArrayType subat = (AnnotatedArrayType) sub;\n return shouldStop(supat.getComponentType(), subat.getComponentType());\n }\n // horrible horrible hack\n // Types.isSameType() doesn't work for type variables or wildcards\n return sup.getUnderlyingType().toString().equals(sub.getUnderlyingType().toString());\n }", "public void setSubtype(typekey.LocationNamedInsured value);", "static void perform_sub(String passed){\n\t\tint type = type_of_sub(passed);\n\t\tswitch(type){\n\t\tcase 1:\n\t\t\tsub_with_reg(passed);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tsub_with_mem(passed);\n\t\t\tbreak;\n\t\t}\n\t}", "@Override\n\tpublic void visit(Matches arg0) {\n\t\t\n\t}" ]
[ "0.7248663", "0.69790435", "0.57939506", "0.575197", "0.56018263", "0.56010956", "0.55877167", "0.5543815", "0.5535773", "0.5528807", "0.54561627", "0.53328353", "0.5331318", "0.53256595", "0.531766", "0.53085744", "0.52801746", "0.5275025", "0.52310324", "0.51417863", "0.5132914", "0.51152235", "0.51140004", "0.51027495", "0.5064452", "0.5062829", "0.5025447", "0.5016664", "0.50145745", "0.5006279", "0.50056934", "0.5001663", "0.4983904", "0.49804628", "0.49622163", "0.4960774", "0.4952782", "0.4946444", "0.49423298", "0.4932963", "0.49209502", "0.4920584", "0.49132383", "0.4907572", "0.48904812", "0.48882467", "0.488574", "0.48747647", "0.48352385", "0.48226622", "0.48089007", "0.48049375", "0.48033834", "0.4801271", "0.48010814", "0.48004183", "0.47893924", "0.47766596", "0.47738957", "0.47684833", "0.47656292", "0.47588253", "0.4755632", "0.47478196", "0.47442034", "0.47436196", "0.4742054", "0.4738869", "0.47339636", "0.47255433", "0.4720177", "0.47165996", "0.4707074", "0.47061226", "0.47044912", "0.47006378", "0.46915147", "0.46816096", "0.46789542", "0.466704", "0.46570757", "0.46546432", "0.464889", "0.46421614", "0.46341154", "0.46326426", "0.46284944", "0.4628201", "0.46248722", "0.46174207", "0.46143946", "0.46023417", "0.45979702", "0.4591373", "0.4587917", "0.45708537", "0.45705688", "0.45647612", "0.45624322", "0.45589596" ]
0.6019482
2
Check if the player is colliding with the mob, if so initiate a time for the mob to start hitting If the timer has passed, the mob can hit the player
@Override public boolean checkCollideSingle(GameObject gameObject, int x, int y) { if (!(gameObject instanceof Player) || !isAlive()) return false; boolean result = super.withinRange(x, y); if (result) { if (prev + (hitInterval * 10) < System.currentTimeMillis()) { prev = System.currentTimeMillis(); startHitTime = prev + 300; startHit = true; } } if (result) { if (startHitTime < System.currentTimeMillis() && startHit) { HUD.getInstance().removeHealth(getDamage()); setStatus(PlayerStatus.FIGHTING); startHit = false; } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int aggroHitTimer(IGeneticMob geneticMob, EntityLiving attacker);", "private void updateTileCollisions(Mob mob) {\n\t\tif (mob instanceof Player) {\r\n\t\t\tmob.setScreenPosition(\r\n\t\t\t\t\tnew Point(\r\n\t\t\t\t\t\t\tMath.max(mob.getScreenPosition().x, mob.getWidth() / 2), \r\n\t\t\t\t\t\t\tMath.max(mob.getScreenPosition().y, mob.getHeight() / 2)));\r\n\t\t\tmob.setScreenPosition(\r\n\t\t\t\t\tnew Point(\r\n\t\t\t\t\t\t\tMath.min(mob.getScreenPosition().x, Display.getWidth() - mob.getWidth() / 2), \r\n\t\t\t\t\t\t\tMath.min(mob.getScreenPosition().y, Display.getHeight() - mob.getHeight() / 2)));\n\r\n\t\t\tmob.setAbsPosition(\r\n\t\t\t\t\tnew Point(\r\n\t\t\t\t\t\t\tMath.max(mob.getAbsPosition().x, mob.getWidth() / 2), \r\n\t\t\t\t\t\t\tMath.max(mob.getAbsPosition().y, mob.getHeight() / 2)));\r\n\t\t\tmob.setAbsPosition(\r\n\t\t\t\t\tnew Point(\r\n\t\t\t\t\t\t\tMath.min(mob.getAbsPosition().x, tilemap.getWidth() - mob.getWidth() / 2), \r\n\t\t\t\t\t\t\tMath.min(mob.getAbsPosition().y, tilemap.getHeight()) - mob.getHeight() / 2));\r\n\t\t}\r\n\r\n\t\tPoint center = mob.getScreenPosition().add(offset);\r\n\r\n\t\tboolean hitGround = false; // used to check for vertical collisions and determine \r\n\t\t// whether or not the mob is in the air\r\n\t\tboolean hitWater = false;\r\n\r\n\t\t//update mob collisions with tiles\r\n\t\tfor (int i = 0; i < tilemap.grid.length; i++) {\r\n\t\t\tfor (int j = 0; j < tilemap.grid[0].length; j++) {\r\n\r\n\t\t\t\tif (tilemap.grid[i][j] != null &&\r\n\t\t\t\t\t\ttilemap.grid[i][j].getAbsPosition().x > center.x - (250) &&\r\n\t\t\t\t\t\ttilemap.grid[i][j].getAbsPosition().x < center.x + (250) &&\r\n\t\t\t\t\t\ttilemap.grid[i][j].getAbsPosition().y > center.y - (250) &&\r\n\t\t\t\t\t\ttilemap.grid[i][j].getAbsPosition().y < center.y + (250)) {\r\n\r\n\t\t\t\t\tRectangle mobRect = mob.getBounds();\r\n\t\t\t\t\tRectangle tileRect = tilemap.grid[i][j].getBounds();\r\n\r\n\t\t\t\t\t// if mob intersects a tile\r\n\t\t\t\t\tif (mobRect.intersects(tileRect)) {\r\n\r\n\t\t\t\t\t\t// get the intersection rectangle\r\n\t\t\t\t\t\tRectangle rect = mobRect.intersection(tileRect);\r\n\r\n\t\t\t\t\t\t// if the mob intersects a water tile, adjust its movement accordingly\r\n\t\t\t\t\t\tif (tilemap.grid[i][j].type == TileMap.WATER) { \r\n\r\n\t\t\t\t\t\t\tmob.gravity = mob.defaultGravity * 0.25f;\r\n\t\t\t\t\t\t\tmob.jumpSpeed = mob.defaultJumpSpeed * 0.35f;\r\n\t\t\t\t\t\t\tmob.moveSpeed = mob.defaultMoveSpeed * 0.7f;\r\n\r\n\t\t\t\t\t\t\tif (!mob.inWater) { \r\n\t\t\t\t\t\t\t\tmob.velocity.x *= 0.2;\r\n\t\t\t\t\t\t\t\tmob.velocity.y *= 0.2;\r\n\t\t\t\t\t\t\t\tmob.inWater = true;\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\thitWater = true;\r\n\t\t\t\t\t\t\tmob.jumping = false;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\t// if intersection is vertical (and underneath player)\r\n\t\t\t\t\t\t\tif (rect.getHeight() < rect.getWidth()) {\r\n\r\n\t\t\t\t\t\t\t\t// make sure the intersection isn't really horizontal\r\n\t\t\t\t\t\t\t\tif (j + 1 < tilemap.grid[0].length && \r\n\t\t\t\t\t\t\t\t\t\t(tilemap.grid[i][j+1] == null || \r\n\t\t\t\t\t\t\t\t\t\t!mobRect.intersects(tilemap.grid[i][j+1].getBounds()))) {\r\n\r\n\t\t\t\t\t\t\t\t\t// only when the mob is falling\r\n\t\t\t\t\t\t\t\t\tif (mob.velocity.y <= 0) {\r\n\t\t\t\t\t\t\t\t\t\tmob.velocity.y = 0;\r\n\t\t\t\t\t\t\t\t\t\tmob.setAbsPosition(new Point(\r\n\t\t\t\t\t\t\t\t\t\t\t\tmob.getAbsPosition().x, \r\n\t\t\t\t\t\t\t\t\t\t\t\t(float)(mob.getAbsPosition().y + rect.getHeight() - 1)));\r\n\t\t\t\t\t\t\t\t\t\tmob.setScreenPosition(new Point(\r\n\t\t\t\t\t\t\t\t\t\t\t\tmob.getScreenPosition().x, \r\n\t\t\t\t\t\t\t\t\t\t\t\t(float)(mob.getScreenPosition().y + rect.getHeight() - 1)));\r\n\t\t\t\t\t\t\t\t\t\tmob.inAir = false;\t\r\n\t\t\t\t\t\t\t\t\t\tmob.jumping = false;\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\t// if intersection is horizontal\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tmob.velocity.x = 0;\r\n\r\n\t\t\t\t\t\t\t\tif (mobRect.getCenterX() < tileRect.getCenterX()) {\r\n\t\t\t\t\t\t\t\t\tmob.setAbsPosition(new Point(\r\n\t\t\t\t\t\t\t\t\t\t\t(float)(mob.getAbsPosition().x - rect.getWidth()), \r\n\t\t\t\t\t\t\t\t\t\t\tmob.getAbsPosition().y));\r\n\t\t\t\t\t\t\t\t\tmob.setScreenPosition(new Point(\r\n\t\t\t\t\t\t\t\t\t\t\t(float)(mob.getScreenPosition().x - rect.getWidth()), \r\n\t\t\t\t\t\t\t\t\t\t\tmob.getScreenPosition().y));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tmob.setAbsPosition(new Point(\r\n\t\t\t\t\t\t\t\t\t\t\t(float)(mob.getAbsPosition().x + rect.getWidth()), \r\n\t\t\t\t\t\t\t\t\t\t\tmob.getAbsPosition().y));\r\n\t\t\t\t\t\t\t\t\tmob.setScreenPosition(new Point(\r\n\t\t\t\t\t\t\t\t\t\t\t(float)(mob.getScreenPosition().x + rect.getWidth()), \r\n\t\t\t\t\t\t\t\t\t\t\tmob.getScreenPosition().y));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tfloat xToCenter = Math.abs((float)(mobRect.getCenterX() - tileRect.getCenterX()));\r\n\t\t\t\t\t\t\tfloat yToCenter = Math.abs((float)(mobRect.getCenterY() - tileRect.getCenterY())); \r\n\r\n\t\t\t\t\t\t\t// Check under the mob to see if it touches a tile. If so, hitGround = true\r\n\t\t\t\t\t\t\tif (yToCenter <= (mobRect.getHeight() / 2 + tileRect.getHeight() / 2) && \r\n\t\t\t\t\t\t\t\t\txToCenter <= (mobRect.getWidth() / 2 + tileRect.getWidth() / 2))\r\n\t\t\t\t\t\t\t\thitGround = true;\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// if mob doesn't intersect a tile vertically, they are in the air\r\n\t\tif (!hitGround) {\r\n\t\t\tmob.inAir = true;\r\n\t\t}\r\n\t\t// if the mob is not in the water, restore its default movement parameters\r\n\t\tif (!hitWater) {\r\n\t\t\tmob.gravity = mob.defaultGravity;\r\n\t\t\tmob.moveSpeed = mob.defaultMoveSpeed;\r\n\t\t\tmob.jumpSpeed = mob.defaultJumpSpeed;\r\n\t\t\tmob.inWater = false;\r\n\t\t}\r\n\t}", "protected void onPlayerCollide(long time) {\n\t\tspecialMovement(player1, GameMap.WALL);\n\t\tspecialMovement(player2, GameMap.WALL);\n\t}", "void collide() {\n for (Target t : this.helicopterpieces) {\n if (!t.isHelicopter && ((t.x == this.player.x && t.y == this.player.y)\n || (t.x == this.player2.x && t.y == this.player2.y))) {\n this.collected--;\n t.isCollected = true;\n }\n if (t.isHelicopter && this.collected == 1\n && ((t.x == this.player.x && t.y == this.player.y) || (t.isHelicopter\n && this.collected == 1 && t.x == this.player2.x && t.y == this.player2.y))) {\n this.collected = 0;\n this.helicopter.isCollected = true;\n }\n }\n }", "private void checkMovement()\n {\n if (frames % 600 == 0)\n {\n \n ifAllowedToMove = true;\n \n \n }\n \n }", "@Override\r\n public void tick() {\n playerNextTo();\r\n if (playerContact() && isCollisioned()) {\r\n if (!((GameState) game.getGameState()).getWorld().getTile((int) (x + xMove), (int) (y + yMove)).isSolid()\r\n && isValidMove(xMove, yMove)) {\r\n x += xMove;\r\n y += yMove;\r\n }\r\n }\r\n }", "public boolean shoot() {\n if (!isReloading && System.currentTimeMillis() - previousShotTime > shootInterval * 1000 && ammoRemaining > 0) {\n\n previousShotTime = System.currentTimeMillis();\n\n ammoRemaining--;\n audioPlayer.setSpatial(holder);\n audioPlayer.playOnce();\n // score -= 50;\n Vec2 angle = Vec2\n .Vector2FromAngleInDegrees(transform.getGlobalRotation().getAngleInDegrees() - 90 + (Math.random() * spread * 2 - spread));\n\n Vec2 spawnPosition = transform.getWorldPosition();\n\n Projectile p = new Projectile(spawnPosition,\n Vec2\n .Vector2FromAngleInDegrees(\n transform.getGlobalRotation().getAngleInDegrees() - 90 + (Math.random() * spread * 2 - spread)),\n new Sprite(projectilePath));\n p.setSpeed(speed);\n p.setSource(holder);\n p.getCollider().addInteractionLayer(\"Block\");\n p.getCollider().addInteractionLayer(\"Hittable\");\n p.getCollider().addInteractionLayer(\"Walk\");\n p.setOnCollisionListener(other -> {\n if (other.getGameObject() instanceof Player && other.getGameObject() != holder) {\n Player player = (Player) other.getGameObject();\n player.hit(alteredDmg);\n if (GameEngine.DEBUG) {\n System.out.println(\"Bullet Hit \" + other.getName());\n }\n p.destroy();\n\n// player.destroy();\n } else if (other.getGameObject() instanceof Enemy) {\n Enemy e = ((Enemy) other.getGameObject());\n e.hit(alteredDmg);\n if (!e.isAlive()) { // CHeck if enemy survived\n ((Player) p.getSource()).killedEnemy();\n }\n p.destroy();\n } else if (other.getTag() == \"Block\") {\n p.destroy();\n }\n\n });\n return true;\n } else if(ammoRemaining <= 0){\n reloadWeapon();\n return false;\n }else\n return false;\n }", "private void tick() {\n\n if (StateManager.getState() != null) {\n StateManager.getState().tick();\n }\n this.backgroundFrames--;\n if (this.backgroundFrames == 0) {\n this.backgroundFrames = Const.TOTAL_BACKGROUND_FRAMES;\n }\n//Check all changed variables for the player\n player.tick();\n long elapsed = (System.nanoTime() - time) / (Const.DRAWING_DELAY - (4000 * Enemy.getDifficulty()));\n//Check if enough time is passed to add new enemy or if spawnSpot is available\n if (elapsed > (this.delay - Enemy.getDifficulty() * 300)&& Road.isSpotAvailable()) {\n enemies.add(new Enemy());\n time = System.nanoTime();\n }\n//Loop for checking all changed variables for the enemies and check if they intersects with the player\n for (int j = 0; j < enemies.size(); j++) {\n enemies.get(j).tick();\n if(enemies.get(j).getY() > Const.ROAD_BOTTOM_BORDER + 200){\n Road.getOccupiedSpawnPoints()[Const.SPAWN_POINTS.indexOf(enemies.get(j).getX())] = false;\n player.setScore(player.getScore() + 50);\n enemies.remove(j);\n continue;\n }\n enemyBoundingBox = enemies.get(j).getEnemyRectangle();\n if (player.getBoundingBox().intersects(enemyBoundingBox)) {\n reset();\n if(player.getLives() == 0){\n gameOver();\n }\n break;\n }\n }\n }", "private void attackPlayer()\n\t{\n\t\tif(shootTimer.done())\n\t\t{\n\t\t\tProjectile spiderWeb = new SpiderWeb(x, y);\n\t\t\tGame.objectWaitingRoom.add(spiderWeb);\n\t\t\tspiderWeb.shoot();\n\t\t\tshootTimer.setTime(200);\n\t\t}\n\t}", "public void Update() {\r\n\t\t//if player is near and haven't fired in a while, fire a projectile\r\n\t\tif(!playerNear().equals(\"n\") && j > 250){\r\n\t\t\tfireProjectile(playerNear());\r\n\t\t\tj = 0;\r\n\t\t}\r\n\t\tj++;\r\n\r\n\t\t//COLLISION\r\n\t\tfor(int i = 0; i < AdventureManager.currentRoom.projectiles.size(); i++){ //Checks for collision with player projectiles\r\n\t\t\tif(((AdventureManager.currentRoom.projectiles.get(i).x + 50 > x) && (AdventureManager.currentRoom.projectiles.get(i).x + 50 < x+50) &&(AdventureManager.currentRoom.projectiles.get(i).y + 50> y) &&(AdventureManager.currentRoom.projectiles.get(i).y + 50< y+98) )\r\n\t\t\t\t\t|| ((AdventureManager.currentRoom.projectiles.get(i).x > x) && (AdventureManager.currentRoom.projectiles.get(i).x < x+50) &&(AdventureManager.currentRoom.projectiles.get(i).y + 50> y) &&(AdventureManager.currentRoom.projectiles.get(i).y + 50< y+98) )\r\n\r\n\t\t\t\t\t\t) {\r\n\r\n\t\t\t\t\tswitch(AdventureManager.currentRoom.projectiles.get(i).type) {\r\n\t\t\t\t\tcase \"fireball\": health -= AdventureManager.toon.intelligence; break;\r\n\t\t\t\t\tcase \"sword\": health -= AdventureManager.toon.strength;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tAdventureManager.currentRoom.projectiles.get(i).kill();\r\n\t\t\t\t}\r\n\t\t}\r\n\t\tif((AdventureManager.toon.y < y+50) && (AdventureManager.toon.y > y+40) && //Checks for collision with player\r\n\t\t\t\t(((AdventureManager.toon.x > x) && (AdventureManager.toon.x < x+50))\r\n\t\t\t\t|| ((AdventureManager.toon.x+50 > x) && AdventureManager.toon.x+50 < x+50))) {\r\n\t\t\tAdventureManager.toon.y = y+55; AdventureManager.toon.repaint();\r\n\t\t\tif(contact <= 0){\r\n\t\t\t\tAdventureManager.toon.damage(1);\r\n\t\t\t\tcontact = 50;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if((AdventureManager.toon.y+100 < y) && (AdventureManager.toon.y+100 > y-5) && (((AdventureManager.toon.x >= x) && (AdventureManager.toon.x <= x+50)) //Checks for collision with player\r\n\t\t\t\t|| ((AdventureManager.toon.x+50 >= x) && (AdventureManager.toon.x+50 <= x+50))\r\n\t\t\t\t|| ((AdventureManager.toon.x+25 >= x) && AdventureManager.toon.x+25 <= x+50))) {\r\n\t\t AdventureManager.toon.y = y-105; AdventureManager.toon.repaint();\r\n\t\t AdventureManager.toon.jumpCount = 25;\r\n\t\t if(contact <= 0){\r\n\t\t\t AdventureManager.toon.damage(1);\r\n\t\t\t contact = 50;\r\n\t\t }\r\n\t\t}\r\n\t\telse if(((AdventureManager.toon.x + 50) > x) && ((AdventureManager.toon.x+50)<x+20) && ( //Left Collision\r\n\t\t\t\t((AdventureManager.toon.y > y) && (AdventureManager.toon.y < y+50)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 25 > y) && (AdventureManager.toon.y + 25 < y+45)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 50 > y) && (AdventureManager.toon.y + 50 < y+45)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 75 > y) && (AdventureManager.toon.y + 75 < y+45)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 100 > y) && (AdventureManager.toon.y + 100 < y+45))\r\n\r\n\r\n\t\t\t\t) ) {\r\n\t\t\tAdventureManager.toon.x = x-51; AdventureManager.toon.repaint();\r\n\t\t\tif(contact <= 0){\r\n\t\t\t\tAdventureManager.toon.damage(1);\r\n\t\t\t\tcontact = 50;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(((AdventureManager.toon.x) > x+40) && ((AdventureManager.toon.x)<x+50) && ( //Right Collision\r\n\t\t\t\t((AdventureManager.toon.y > y) && (AdventureManager.toon.y < y+50)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 25 > y) && (AdventureManager.toon.y + 25 < y+50)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 50 > y) && (AdventureManager.toon.y + 50 < y+50)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 75 > y) && (AdventureManager.toon.y + 75 < y+50)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 100 > y) && (AdventureManager.toon.y + 100 < y+50))\r\n\r\n\r\n\t\t\t\t) ) {\r\n\t\t\tAdventureManager.toon.x = x+51; AdventureManager.toon.repaint();\r\n\t\t\tif(contact <= 0){\r\n\t\t\t\tAdventureManager.toon.damage(1);\r\n\t\t\t\tcontact = 50;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcontact--;\r\n\t\tif(health<=0){\r\n\t\t\tsetVisible(false);\r\n\t\t\talive = false;\r\n\t\t\tAdventureManager.currentRoom.enemies.remove(this);\r\n\t\t}\r\n\r\n\r\n\r\n\t\t\tif((y+100)>=AdventureManager.floorHeight) {\r\n\t\t\t\ty= AdventureManager.floorHeight -100;\r\n\t\t\t\tgravity *= 0;\r\n\r\n\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tgravity = 3;}\r\n\r\n\t\t\ty += gravity; setLocation(x,y);\r\n\r\n\t\t\tswitch(movetype) {\r\n\t\t\tcase 0: chasePlayer(); break;\r\n\t\t\tcase 1: randomMove(); break;\r\n\t\t\tcase 2: dontMove(); break;\r\n\t\t\t}\r\n\r\n\t\t\t}", "void playerHit() {\n if (lives == 0) {//if no lives left\n isDead = true;\n } else {//remove a life and reset positions\n lives -=1;\n immortalityTimer = 100;\n resetPositions();\n }\n }", "public void playerCollision(TileMap map, Creature creature){\n\t\t// only check collision of creatures with this that are not sleeping, are on the screen, and are collidable\n\t\tif(!creature.isPlatform() && creature.isCollidable()){\n\t\t\tboolean collision = isCollision(this, creature);\n\t\t\tif(collision && !(creature instanceof Score)){ //#check\n\t\t\t\t//A lot of work Creature related.\n\t\t\t\tif(creature instanceof Coin){\n\t\t\t\t\tcreature.kill();\n\t\t\t\t\tpoint++;\n\t\t\t\t\tmap.creaturesToAdd().add(new Score(Math.round(creature.getX()), Math.round(creature.getY() - 16)));\n\t\t\t\t}else if(creature instanceof Mushroom) {\n\t\t\t\t\tcreature.kill();\n\t\t\t\t\tif(health > 2) {\n\t\t\t\t\tmap.creaturesToAdd().add(new Score(Math.round(creature.getX()), Math.round(creature.getY()+13)));\n\t\t\t\t\tpoint += 10;\n\t\t\t\t\t} else {\n\t\t\t\t\t\thealth++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(creature instanceof Penguin && isJumping() && getdY() > 0) {\n\t\t\t\t\tSystem.out.println(\"OK\");\n\t\t\t\t\t((Penguin) creature).jumpedOn(); // kill\n\t\t\t\t\tthis.creatureHop();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tgetDamaged();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\twhile ((System.nanoTime() - startTime) / 1000000000 < Server.START_DELAY) {\r\n\r\n\t\t\t\t\t\t\t// Cancel the timer if the number of players ready\r\n\t\t\t\t\t\t\t// changes\r\n\t\t\t\t\t\t\tif (Server.this.playersReady == 0\r\n\t\t\t\t\t\t\t\t\t|| Server.this.playersReady != Server.this.players\r\n\t\t\t\t\t\t\t\t\t\t\t.size()\r\n\t\t\t\t\t\t\t\t\t|| this.value != Server.this.currentTimerNo) {\r\n\t\t\t\t\t\t\t\tServer.this.println(\"Cancelled timer\");\r\n\t\t\t\t\t\t\t\tServer.this.lobbyTimerActive = false;\r\n\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tThread.sleep(10);\r\n\t\t\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tServer.this.startGame();\r\n\t\t\t\t\t}", "protected void attack(){\n\t\tif(reloadTime-- <= 0){\n\t\t\treloadTime = 0;\n\t\t}\n\t\tif(!hostileInRange())\n\t\t\treturn;\n\t\tif(!rotate()){\n\t\t\tif(reloadTime <= 0){\n\t\t\t\tshotAt(this.target);\n\t\t\t}\n\t\t}\n\t}", "public boolean CheckTimeInLevel(){\n \n Long comparetime = ((System.nanoTime() - StartTimeInLevel)/1000000000);\n \n return (comparetime>TILData.critpoints.get((int)speed));\n // stop tetris because this subject is an outlier for this level\n \n \n }", "public void hit() {\n if (explodeTime == 0) {\n if (isExplosive) {\n region = explodeAnimation.getKeyFrame(explodeTime, false);\n explodeTime += Gdx.graphics.getDeltaTime();\n width = region.getRegionWidth();\n height = region.getRegionHeight();\n position.sub(width / 2, height / 2);\n direction = new Vector2(1, 0);\n explosionSound.play();\n } else {\n impactSound.play();\n active = false;\n }\n }\n }", "protected void checkEntityCollisions(long time) {\n\t\tRectangle2D.Float pla1 = player1.getLocationAsRect();\n\t\tRectangle2D.Float pla2 = player2.getLocationAsRect();\n\t\tfor(int i = 0; i < ghosts.length; i++)\n\t\t{\n\t\t\tGhost g = ghosts[i];\n\t\t\t\n\t\t\tif(g.isDead())\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\tRectangle2D.Float ghRect = g.getLocationAsRect();\n\t\t\t\n\t\t\tif(ghRect.intersects(pla1))\n\t\t\t\tonPlayerCollideWithGhost(time, player1, i);\n\t\t\t\n\t\t\tif(ghRect.intersects(pla2))\n\t\t\t\tonPlayerCollideWithGhost(time, player2, i);\n\t\t}\n\t}", "@Override\n public void update() {\n if(alive==false){\n afterBeKilled();\n return;\n }\n animate();\n chooseState();\n checkBeKilled();\n if(attack){\n if(timeBetweenShot<0){\n chooseDirection();\n attack();\n timeBetweenShot=15;\n }\n else{\n timeBetweenShot--;\n }\n\n }\n else{\n calculateMove();\n setRectangle();\n }\n }", "@Override\n public boolean act() {\n float variation = (random.nextFloat() / 2f) - 1;\n\n // Reconfigure the time to wait before spawning another enemy.\n this.deltaLimit = Math.max(100, INITIAL_SPAWN_TIME + variation - (100 * round));\n\n spawnEnemy();\n return false;\n }", "private void tick() {\n keyManager.tick();\n if (keyManager.pause == false) {\n if (gameOver) {\n\n // advancing player with colision\n player.tick();\n //if there's a shot.\n\n int alienBombIndex = (int) (Math.random() * aliens.size());\n for (int i = 0; i < aliens.size(); i++) {\n Alien alien = aliens.get(i);\n alien.tick();\n if (shotVisible && shot.intersectAlien(alien)) {\n Assets.hitSound.play();\n alien.setDying(true);\n alien.setDeadCounter(6);\n shotVisible = false;\n }\n \n if(alien.isDead()){\n aliens.remove(i);\n if (aliens.size() == 0) {\n gameOver = false;\n }\n }\n\n alien.act(direction);\n }\n\n //Controlar el movimiento de los aliens\n for (Alien alien : aliens) {\n int x = alien.getX();\n if (x >= getWidth() - 30 && direction != -1) {\n direction = -1;\n alien.setDirection(-1);\n Iterator i1 = aliens.iterator();\n while (i1.hasNext()) {\n Alien a2 = (Alien) i1.next();\n a2.setY(a2.getY() + 15);\n }\n }\n if (x <= 5 && direction != 1) {\n direction = 1;\n alien.setDirection(1);\n Iterator i2 = aliens.iterator();\n while (i2.hasNext()) {\n Alien a = (Alien) i2.next();\n a.setY(a.getY() + 15);\n }\n }\n }\n\n //Controlar el spawning de las bombas\n Random generator = new Random();\n for (Alien alien : aliens) {\n int num = generator.nextInt(15);\n Bomb b = alien.getBomb();\n\n if (num == CHANCE && b.isDestroyed()) {\n b.setDestroyed(false);\n b.setX(alien.getX());\n b.setY(alien.getY());\n }\n\n b.tick();\n if (b.intersecta(player)) {\n Assets.deathSound.play();\n player.die();\n gameOver = false;\n }\n\n }\n\n if (shotVisible) {\n shot.tick();\n }\n if (!player.isDead() && keyManager.spacebar) {\n shoot();\n Assets.shotSound.play();\n }\n for (int i = 0; i < aliens.size(); i++) {\n if (aliens.get(i).getY() > 500) {\n gameOver = false;\n }\n }\n\n }\n }\n /// Save game in file\n if (keyManager.save) {\n try {\n\n vec.add(player);\n vec.add(shot);\n if(keyManager.pause){\n vec.add(new String(\"Pause\")); \n } else if (!gameOver){\n vec.add(new String(\"Game Over\"));\n } else {\n vec.add(new String(\"Active\"));\n }\n for (Alien alien : aliens) {\n vec.add(alien);\n }\n //Graba el vector en el archivo.\n grabaArchivo();\n } catch (IOException e) {\n System.out.println(\"Error\");\n }\n }\n /// Load game\n if (keyManager.load == true) {\n try {\n //Graba el vector en el archivo.\n leeArchivo();\n } catch (IOException e) {\n System.out.println(\"Error en cargar\");\n }\n }\n\n }", "public boolean timeUp(){\n return timeAlive == pok.getSpawnTime(); \n }", "public void tick() {\n if (ShulkerEntity.this.world.getDifficulty() != Difficulty.PEACEFUL) {\n --this.attackTime;\n LivingEntity livingentity = ShulkerEntity.this.getAttackTarget();\n ShulkerEntity.this.getLookController().setLookPositionWithEntity(livingentity, 180.0F, 180.0F);\n double d0 = ShulkerEntity.this.getDistanceSq(livingentity);\n if (d0 < 400.0D) {\n if (this.attackTime <= 0) {\n this.attackTime = 20 + ShulkerEntity.this.rand.nextInt(10) * 20 / 2;\n ShulkerEntity.this.world.addEntity(new ShulkerBulletEntity(ShulkerEntity.this.world, ShulkerEntity.this, livingentity, ShulkerEntity.this.getAttachmentFacing().getAxis()));\n ShulkerEntity.this.playSound(SoundEvents.ENTITY_SHULKER_SHOOT, 2.0F, (ShulkerEntity.this.rand.nextFloat() - ShulkerEntity.this.rand.nextFloat()) * 0.2F + 1.0F);\n }\n } else {\n ShulkerEntity.this.setAttackTarget((LivingEntity)null);\n }\n\n super.tick();\n }\n }", "public boolean collision(GameObject initial, GameObject secondary){\n\n if (Rect.intersects(initial.getHitbox(),secondary.getHitbox())){\n MediaPlayer myplayer = MediaPlayer.create(getContext(), R.raw.robloxdeath);\n myplayer.start();\n return true;\n }\n return false;\n\n }", "float shouldAggroOnHit(IGeneticMob geneticMob, EntityLiving attacker);", "abstract public double timeUntilCollision(Ball ball);", "@Override\n public void interact(){\n if(System.currentTimeMillis() - lastInteraction < 200){\n return;\n }\n\n // Set new lastInterTime\n lastInteraction = System.currentTimeMillis();\n\n // Code\n try {\n System.out.println(getPlayer().getJoueur().getPosition());\n getPlayer().getCollisionner().getInteractiveObject(getPlayer().getJoueur().getVisual()).interact(getPlayer());\n } catch (InstanceNotFoundException e) {\n System.out.println(e.getMessage());\n return;\n }\n }", "public boolean playerCollideTest(PlayerObject player)\n {\n if (this.isTouchable)\n {\n return true;\n\n }\n else return false;\n }", "public static void hit_sound() {\n\t\tif (!hit1) {\n\t\t\thit1 = true;\n\t\t\tm_player_hit.setMediaTime(new Time(0));\n\t\t\tm_player_hit.start();\n\t\t} else if (!hit2) {\n\t\t\thit2 = true;\n\t\t\tm_player_hit2.setMediaTime(new Time(0));\n\t\t\tm_player_hit2.start();\n\t\t} else if (!hit3) {\n\t\t\thit3 = true;\n\t\t\tm_player_hit3.setMediaTime(new Time(0));\n\t\t\tm_player_hit3.start();\n\t\t} else if (!hit4) {\n\t\t\thit4 = true;\n\t\t\tm_player_hit4.setMediaTime(new Time(0));\n\t\t\tm_player_hit4.start();\n\t\t} else if (!hit5) {\n\t\t\thit5 = true;\n\t\t\tm_player_hit5.setMediaTime(new Time(0));\n\t\t\tm_player_hit5.start();\n\t\t} else {\n\t\t\thit1 = hit2 = hit3 = hit4 = hit5 = false;\n\t\t\tm_player_hit6.setMediaTime(new Time(0));\n\t\t\tm_player_hit6.start();\n\t\t}\n\n\t}", "private void checkRegTileCollisions(float deltaTime) {\n\t\tint len = regTiles.size();\n\t\tfor(int i = 0; i < len; i ++) {\n\t\t\tRegTile tile = regTiles.get(i);\n\t\t\t\n\t\t\t//overlap between player and tile\n\t\t\t\n\t\t\t//experiment with these values to get close to perfect collisions *************************\n\t\t\ttry {\n\t\t\t\tif(OverlapTester.overlapRectangles(player.bounds, tile.bounds)) {\n\t\t\t\t\t\n\t\t\t\t\t//check y - collisions\n\t\t\t\t\tif(player.position.y > tile.position.y + (tile.bounds.height / 2) && player.position.x - (player.bounds.width / 2) + correctionFactor < tile.position.x + (tile.bounds.width / 2) && player.position.x + (player.bounds.width / 2) - correctionFactor > tile.position.x - (tile.bounds.width / 2)) {\n\t\t\t\t\t\tplayer.velocity.y = 0;\n\t\t\t\t\t\tplayer.position.y = tile.position.y + 1;\n\t\t\t\t\t\tif(player.velocity.x > 3) {\n\t\t\t\t\t\t\tplayer.velocity.x -= 0.2f; //prev. optimal was .3\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(player.position.y < tile.position.y - (tile.bounds.height / 2) && player.position.x - (player.bounds.width / 2) + correctionFactor < tile.position.x + (tile.bounds.width / 2) && player.position.x + (player.bounds.width / 2) - correctionFactor > tile.position.x - (tile.bounds.width / 2)) {\n\t\t\t\t\t\tplayer.velocity.y = 0;\n\t\t\t\t\t\tplayer.position.y = tile.position.y - 1;\n\t\t\t\t\t\tif(player.velocity.x > 3) {\n\t\t\t\t\t\t\tplayer.velocity.x -= 0.2f;\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//check x - collision\n\t\t\t\t\tif(player.position.x > tile.position.x + (tile.bounds.width / 2) + correctionFactor && player.position.y - (player.bounds.height / 2) + correctionFactor < tile.position.y + (tile.bounds.height / 2) && player.position.y + (player.bounds.height / 2) - correctionFactor > tile.position.y - (tile.bounds.height / 2)) {\n\t\t\t\t\t\tplayer.velocity.x = 0;\n\t\t\t\t\t\txColliding = true;\n\t\t\t\t\t\tplayer.position.x = tile.position.x + 1; //animate possibly\n\t\t\t\t\t\tif(player.velocity.y > 0) {\n\t\t\t\t\t\t\t//player.velocity.y -= 0.2f;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(player.position.x < tile.position.x - (tile.bounds.width / 2) - correctionFactor && player.position.y - (player.bounds.height / 2) + correctionFactor < tile.position.y + (tile.bounds.height / 2) && player.position.y + (player.bounds.height / 2) - correctionFactor > tile.position.y - (tile.bounds.height / 2)) {\n\t\t\t\t\t\tplayer.velocity.x = 0;\n\t\t\t\t\t\txColliding = true;\n\t\t\t\t\t\tplayer.position.x = tile.position.x - 1; //animate possibly\n\t\t\t\t\t\tif(player.velocity.y > 0) {\n\t\t\t\t\t\t\t//player.velocity.y -= 0.2f;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t} catch (Exception e) {}\n\t\t}\n\t\trecheckTileCollisions(); //fix frame-skipping \n\t}", "public void tick() {\n\t\tif (mainRef.player().getPos()[1] <= lastEnd.getPos()[1] + 2000)\r\n\t\t\tloadNextMap();\r\n\r\n\t\tfor (GameObject go : gameObjects)\r\n\t\t\tgo.tick();\r\n\r\n\t\t// Check Player Collision\r\n\t\t// Top-Left\r\n\t\tPointColObj cTL = new PointColObj(mainRef.player().getPos()[0] + mainRef.player().getCol()[2],\r\n\t\t\t\tmainRef.player().getPos()[1] + mainRef.player().getCol()[3]);\r\n\t\t// Top-Right\r\n\t\tPointColObj cTR = new PointColObj(mainRef.player().getPos()[0] + mainRef.player().getCol()[2],\r\n\t\t\t\tmainRef.player().getPos()[1] + mainRef.player().getCol()[3] + mainRef.player().getCol()[1]);\r\n\t\t// Bottom-Left\r\n\t\tPointColObj cBL = new PointColObj(\r\n\t\t\t\tmainRef.player().getPos()[0] + mainRef.player().getCol()[2] + mainRef.player().getCol()[0],\r\n\t\t\t\tmainRef.player().getPos()[1] + mainRef.player().getCol()[3]);\r\n\t\t// Bottom-Right\r\n\t\tPointColObj cBR = new PointColObj(\r\n\t\t\t\tmainRef.player().getPos()[0] + mainRef.player().getCol()[2] + mainRef.player().getCol()[0],\r\n\t\t\t\tmainRef.player().getPos()[1] + mainRef.player().getCol()[3] + mainRef.player().getCol()[1]);\r\n\r\n\t\t// Inverse Collision, no part of the player's ColBox should be not\r\n\t\t// colliding...\r\n\t\tif (checkCollisionWith(cTL).size() == 0 || checkCollisionWith(cTR).size() == 0\r\n\t\t\t\t|| checkCollisionWith(cBL).size() == 0 || checkCollisionWith(cBR).size() == 0) {\r\n\t\t\t// If it would have left the bounding box of the floor, reverse the\r\n\t\t\t// player's posiiton\r\n\t\t\tmainRef.player().setMoveBack(true);\r\n\t\t} else\r\n\t\t\tmainRef.player().setMoveBack(false);\r\n\r\n\t\t// Check General Collision\r\n\t\tArrayList<GameObject> allCol = checkCollisionWith(mainRef.player());\r\n\t\tfor (GameObject go : allCol) {\r\n\t\t\tif (go instanceof Tile) {\r\n\t\t\t\tTile gameTile = (Tile) go;\r\n\t\t\t\tif (gameTile.getType() == GameObjectRegistry.TILE_WALL\r\n\t\t\t\t\t\t|| gameTile.getType() == GameObjectRegistry.TILE_BASE\r\n\t\t\t\t\t\t|| gameTile.getType() == GameObjectRegistry.TILE_DOOR\r\n\t\t\t\t\t\t|| gameTile.getType() == GameObjectRegistry.TILE_SEWER\r\n\t\t\t\t\t\t|| (gameTile.getType() == GameObjectRegistry.TILE_WATERFALL && gameTile.getVar() == 0)) {\r\n\t\t\t\t\tmainRef.player().setMoveBack(true);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t} else if (go instanceof LineColObjHor || go instanceof LineColObjVert) {\r\n\t\t\t\tmainRef.player().setMoveBack(true);\r\n\t\t\t\tbreak;\r\n\t\t\t} else if (go instanceof SkillDrop) {\r\n\t\t\t\tSkillDrop d = (SkillDrop) go;\r\n\t\t\t\tmainRef.player().getInv()[d.getVariation()]++;\r\n\t\t\t\tremoveGameObject(go);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}", "public void startWait() {\n\t\tTimer timer = new Timer();\n\t\ttimer.schedule(new TimerTask() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tif (server.getNumberOfPlayers() > 0 && !server.gameStartFlag) {\n\t\t\t\t\tserver.runGame();\n\t\t\t\t}\n\t\t\t}\n\t\t}, 120000);\n\t\t// 2min(2*60*1000)\n\t\tsendMessage(\"The game will start 2 minute late\");\n\t}", "public void tick() {\n\t\tif (Math.abs(disToPlayerX()) > Math.abs(disToPlayerY())) {\r\n\t\t\tif (disToPlayerX()<0) {\r\n\t\t\t\tx -= speed;\t//moves enemy to the left\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tx += speed; //moves enemy to the right\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (disToPlayerY()<0) {\r\n\t\t\t\ty-=speed; //moves enemy up\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ty+=speed; //moves enemy down\r\n\t\t\t}\r\n\t\t}\r\n\t\tenemyRectangle.setLocation((int)x,(int) y); //updates hitbox of enemy\r\n\r\n\t\t//checks all enemies and see if they run into player\r\n\t\tfor (int i=0;i<c.getEnemys().size();i++) {\r\n\t\t\tif (enemyRectangle.getBounds().intersects(player.getRectangle().getBounds())) {\r\n\t\t\t\tkillEnemy(); //removes the enemy\r\n\t\t\t\tPlayer.health -=10; //removes 10 health\r\n\t\t\t\tbreak; //doesn't work without this BREAK. DO NOT REMOVE\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//checks all bullets if they hit an enemy\r\n\t\tfor (int i = 0;i<c.getBullets().size();i++) {\r\n\t\t\tif (enemyRectangle.getBounds().intersects(c.getBullets().get(i).getRect().getBounds())) {\r\n\t\t\t\tkillEnemy(); //removes enemy\r\n\t\t\t\tc.removeBullet(c.getBullets().get(i)); //removes the bullet\r\n\t\t\t\tPlayer.score += 50; //adds 50 to the score\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void act() \n {\n updateTimerDisplay();\n if(timeCounter < 3600){\n timeCounter++;\n \n }else{\n timeElapsed++;\n timeCounter = 0;\n }\n checkHighScore();\n checkRegScore();\n\n }", "public void timer()\n {\n if(exists == true)\n { \n if(counter < 500) \n { \n counter++; \n } \n else \n { \n Greenfoot.setWorld(new Test()); \n exists = false; \n } \n } \n }", "public static long checkCollision(Asteroid a1, Asteroid a2, long expected_time_of_collision, long time, long time_limit) {\n Point p1 = new Point(), p2 = new Point();\n // search for collision with other asteroids\n double r = a1.radius() + a2.radius();\n final int EPSILON_TIME = 720;\n for (long ft = -EPSILON_TIME; ft <= EPSILON_TIME; ++ft) {\n long t = time + expected_time_of_collision + ft;\n if (t <= time) continue;\n if (time_limit != -1 && t >= time_limit) break;\n\n int[][] collisions = Asteroid.test_collision(new Asteroid[]{a1, a2}, t);\n // if collision, return push to the simulator\n if (collisions.length > 0) {\n return t;\n }\n }\n return -1; // No collision within deadline\n }", "@Override\n public void update() {\n if (!myNPC.isAlive()) {\n myNPC.setState(MovingState.DEATH);\n }\n\n if (isAttacking()) {\n if (attackCounter > 300) {\n myNPC.setState(MovingState.IDLE);\n attackCounter = 0;\n } else {\n attackCounter++;\n }\n return;\n }\n\n// randomMove();\n }", "@Override\n\tpublic boolean checkCollision() {\n\t\treturn true;\n\t}", "public TimerCheck() {\n super(\"timer_check\");\n PlayerMovementListener.EVENT.register(this);\n }", "private void checkForBulletCollisions() {\r\n\t\tbulletMoveOffScreen();\r\n\t\tbulletCollisionWithObject();\r\n\t}", "private void inGame() {\n\n if (!ingame) {\n timer.stop();\n\n }\n }", "@Override\r\n\tpublic boolean collides (Entity other)\r\n\t{\r\n\t\tif (other == owner || other instanceof Missile)\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t\treturn super.collides(other);\r\n\t}", "public void trackAndFire() {\n \t \tdouble theta;\n double distanciaObjetivo = myPos.distance(objetivo.pos);\n //Hallar el proximo punto en un perímetro definido\n \t\t//(30,30) elimina bordes y despues el -60 para la longitud de los dados\n Rectangle2D.Double perimetro = new Rectangle2D.Double(30, 30, getBattleFieldWidth() - 60, getBattleFieldHeight() - 60);\n \n \n \n //if my cannon is locked and ready and i got some energy left fire with\n //appropiate energy to not get stuck, fire in the execute rather than now\n \n if(getGunTurnRemaining() == 0 && myEnergy > 1) {\n setFire( Math.min(Math.min(myEnergy/6.0, 1000/distanciaObjetivo), objetivo.energy/3.0) );\n }\n \n //any other case, ill get aim lock with this function\n //normalize sets between pi -pi\n setTurnGunRightRadians(Utils.normalRelativeAngle(angulo(objetivo.pos, myPos) - getGunHeadingRadians()));\n \n\n double distNextPunto = myPos.distance(futurePos);\n \n \n if(distNextPunto > 20) {\n \t//aun estamos lejos\n \n \t\t\n \t\t//theta es el angulo que hemos de cortar para ponernos \"encarando\" bien\n theta = angulo(futurePos, myPos) - getHeadingRadians();\n \n \n double sentido = 1;\n \n if(Math.cos(theta) < 0) {\n theta += Math.PI;\n sentido = -1;\n }\n \n setAhead(distNextPunto * sentido);\n theta = Utils.normalRelativeAngle(theta);\n setTurnRightRadians(theta);\n \n if(theta > 1)setMaxVelocity(0.0);\n else setMaxVelocity(8.0); // max\n \n \t\n \n } else {\n \t //ENTRO AQUI SI ME QUEDA POCO PARA LLEGAR, SMOOTH CORNERING\n\n \t\t\n //probar 1000 coordenadas\n int iterNum = 1000;\n Point2D.Double cand;\n for(int i =0; i < iterNum; i++){\n \n //i dont want it to be close to another bot, thats the meaning of distanciaObjetivo*0.8\n cand = hallarPunto(myPos, Math.min(distanciaObjetivo*0.8, 100 + iterNum*Math.random()), 2*Math.PI*Math.random());\n if(perimetro.contains(cand) && evalHeuristic(cand) < evalHeuristic(futurePos)) {\n futurePos = cand;\n }\n \n \n } \n \n prevPos = myPos;\n \n }\n }", "private void checkCollision()\n {\n if(isTouching(Rocket.class))\n {\n removeTouching(Rocket.class);\n Level1 level1 = (Level1)getWorld(); \n isSwordscore = false;\n notifyObservers(-20);\n }\n else if(isTouching(Fire.class))\n {\n removeTouching(Fire.class);\n Level1 level1 = (Level1)getWorld(); \n isSwordscore = false;\n notifyObservers(-20);\n }\n else if(isTouching(Sword.class))\n { \n removeTouching(Sword.class);\n Level1 level1 = (Level1)getWorld();\n isSwordscore = false;\n notifyObservers(-20);\n }\n \n else if(isTouching(Star.class))\n { \n removeTouching(Star.class);\n Level1 level1 = (Level1)getWorld();\n isSwordscore = false;\n count++;\n boost();\n }\n }", "@Override\r\n\tpublic void Collision(Entity e)\r\n\t{\r\n\t\tthis.isAlive = false;\r\n\t}", "@Override\n public boolean isCollided(gameObject obj){\n return Rect.intersects(obj.getastRect(), getRectplayer1())||\n Rect.intersects(obj.getastRect(), getRectplayer2()) ||\n Rect.intersects(obj.getastRect(), getRectplayer3()) ||\n Rect.intersects(obj.getastRect(), getRectplayer4());\n }", "public boolean checkHit(Rectangle r){\n\t\t\tif (exists){\n\t\t\t\tif(this.intersects(r) || this.contains(r)){\n\t\t\t\t\thealth -= 1; //reduces the curret health\n\t\t\t\t\tif (health == 0) {\n\t\t\t\t\t\texists = false;\n\t\t\t\t\t\tstartboomtimer = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tstartredtimer = true; //starts the red animation\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse return false;\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "public void tick() {\n\t\tif (timer!=Game.timeCount)\n\t\t\thandler.addObject(new EnemyPlane(Game.WIDTH-38,r.nextInt(Game.HEIGHT-50), ID.Enemy, handler));\n\t\t\ttimer = Game.timeCount;\n\t}", "public void unitCollision() {\n\t}", "@Test\n\tpublic void testCollideMeteorWithBullet() {\n\t\tfinal MeteorImpl meteorimpl = new MeteorImpl(new Pair<>(0,0), 1, 1, LENGTH, ID.METEOR);\n\t\tfinal BulletImpl bulletplayer = new BulletImpl(0, 0, ID.PLAYER_BULLET);\n\t\tmeteorimpl.collide(bulletplayer);\n\t\tassertFalse(meteorimpl.isDead());\n\t\tmeteorimpl.collide(bulletplayer);\n\t\tmeteorimpl.collide(bulletplayer);\n\t\tassertTrue(meteorimpl.isDead());\t\n\t}", "public abstract int doDamage(int time, GenericMovableUnit unit, Unit target);", "public void act() \n {\n \n checkKey();\n platformAbove();\n \n animationCounter++;\n checkFall();\n }", "@Override\n public boolean collide(Entity e) {\n if (e.isExplosion() || (e.isBomb() && (((Bomb) e).isMissile()))) {\n kill();\n ArrayList<Mob> m = Board.getInstance().getMobsAtExcluding(this.getXTile(), this.getYTile(), this);\n for (Mob mob1 : m) {\n if (mob1.isAlive()) {\n mob1.kill();\n }\n }\n return true;\n }\n return false;\n }", "@Override\r\n public void run() {\n if (start == true && player.getX() > 0) {\r\n //Updates objects\r\n for (Terrain t: terrain) {\r\n t.update();\r\n }\r\n for (Barrier b: barriers) {\r\n b.update();\r\n }\r\n for (Platform p: platforms) {\r\n p.update();\r\n }\r\n for (Bird bi: birds) {\r\n bi.update();\r\n }\r\n for (Bomb bo: bombs) {\r\n bo.update();\r\n bo.grav();\r\n }\r\n player.grav();\r\n playerTwo.grav();\r\n playerTwo.update();\r\n \r\n //Controls when bombs drop\r\n if (bombAct % 150 == 0 && score > 2500) {\r\n bombs.add(new Bomb((int) (Math.random() * 1000), (int) (Math.random() * 100)));\r\n }\r\n \r\n //Sets pace of the game\r\n if (tempo % 1500 == 0) {\r\n for (Terrain t: terrain) {\r\n t.setDX(t.getDX() + 1);\r\n }\r\n for (Barrier b: barriers) {\r\n b.setDX(b.getDX() + 1);\r\n }\r\n for (Platform p: platforms) {\r\n p.setDX(p.getDX() + 1);\r\n }\r\n for (Bird bi: birds) {\r\n bi.setDX(bi.getDX() - 1);\r\n }\r\n }\r\n \r\n //Timers\r\n tempo++;\r\n bombAct++;\r\n score++;\r\n }\r\n\r\n //Always runs\r\n player.update();\r\n \r\n \r\n collision(player);\r\n collision(playerTwo);\r\n borderCollision(player);\r\n borderCollision(playerTwo);\r\n \r\n repaint();\r\n }", "public void checkFirePlayer() {\n if (up > 0) {\r\n if (up == 1) {\r\n\r\n if (CollisionsManager.checkPlayerSingleCollision(player, fire.getX(), fire.getY() - 50, 50, 50)) {\r\n player.setLife(player.getLife() - 1);\r\n SoundManager.musicClipStart(SoundManager.lifeLostMusic());\r\n\r\n if (player.getLife() <= 0) {\r\n GameManager.GAME_OVER = true;\r\n }\r\n }\r\n if (up == 2) {\r\n if (CollisionsManager.checkPlayerSingleCollision(player, fire.getX(), fire.getY() - 50, 50, 50)) {\r\n player.setLife(player.getLife() - 1);\r\n SoundManager.musicClipStart(SoundManager.lifeLostMusic());\r\n\r\n if (player.getLife() <= 0) {\r\n GameManager.GAME_OVER = true;\r\n }\r\n }\r\n if (CollisionsManager.checkPlayerSingleCollision(player, fire.getX(), fire.getY() - 100, 50, 50)) {\r\n player.setLife(player.getLife() - 1);\r\n SoundManager.musicClipStart(SoundManager.lifeLostMusic());\r\n\r\n if (player.getLife() <= 0) {\r\n GameManager.GAME_OVER = true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (down > 0) {\r\n if (down == 1) {\r\n if (CollisionsManager.checkPlayerSingleCollision(player, fire.getX(), fire.getY() + 50, 50, 50)) {\r\n player.setLife(player.getLife() - 1);\r\n SoundManager.musicClipStart(SoundManager.lifeLostMusic());\r\n\r\n if (player.getLife() <= 0) {\r\n GameManager.GAME_OVER = true;\r\n }\r\n }\r\n }\r\n if (down == 2) {\r\n if (CollisionsManager.checkPlayerSingleCollision(player, fire.getX(), fire.getY() + 50, 50, 50)) {\r\n player.setLife(player.getLife() - 1);\r\n SoundManager.musicClipStart(SoundManager.lifeLostMusic());\r\n\r\n if (player.getLife() <= 0) {\r\n GameManager.GAME_OVER = true;\r\n }\r\n }\r\n if (CollisionsManager.checkPlayerSingleCollision(player, fire.getX(), fire.getY() + 100, 50, 50)) {\r\n player.setLife(player.getLife() - 1);\r\n SoundManager.musicClipStart(SoundManager.lifeLostMusic());\r\n\r\n if (player.getLife() <= 0) {\r\n GameManager.GAME_OVER = true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (left > 0) {\r\n if (left == 1) {\r\n if (CollisionsManager.checkPlayerSingleCollision(player, fire.getX() - 50, fire.getY(), 50, 50)) {\r\n player.setLife(player.getLife() - 1);\r\n SoundManager.musicClipStart(SoundManager.lifeLostMusic());\r\n\r\n if (player.getLife() <= 0) {\r\n GameManager.GAME_OVER = true;\r\n }\r\n }\r\n }\r\n if (left == 2) {\r\n if (CollisionsManager.checkPlayerSingleCollision(player, fire.getX() - 50, fire.getY(), 50, 50)) {\r\n player.setLife(player.getLife() - 1);\r\n SoundManager.musicClipStart(SoundManager.lifeLostMusic());\r\n\r\n if (player.getLife() <= 0) {\r\n GameManager.GAME_OVER = true;\r\n }\r\n }\r\n if (CollisionsManager.checkPlayerSingleCollision(player, fire.getX() - 100, fire.getY(), 50, 50)) {\r\n player.setLife(player.getLife() - 1);\r\n SoundManager.musicClipStart(SoundManager.lifeLostMusic());\r\n\r\n if (player.getLife() <= 0) {\r\n GameManager.GAME_OVER = true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (right > 0) {\r\n if (right == 1) {\r\n if (CollisionsManager.checkPlayerSingleCollision(player, fire.getX() + 50, fire.getY(), 50, 50)) {\r\n player.setLife(player.getLife() - 1);\r\n SoundManager.musicClipStart(SoundManager.lifeLostMusic());\r\n\r\n if (player.getLife() <= 0) {\r\n GameManager.GAME_OVER = true;\r\n }\r\n }\r\n }\r\n if (right == 2) {\r\n if (CollisionsManager.checkPlayerSingleCollision(player, fire.getX() + 50, fire.getY(), 50, 50)) {\r\n player.setLife(player.getLife() - 1);\r\n SoundManager.musicClipStart(SoundManager.lifeLostMusic());\r\n\r\n if (player.getLife() <= 0) {\r\n GameManager.GAME_OVER = true;\r\n }\r\n }\r\n if (CollisionsManager.checkPlayerSingleCollision(player, fire.getX() + 100, fire.getY(), 50, 50)) {\r\n player.setLife(player.getLife() - 1);\r\n SoundManager.musicClipStart(SoundManager.lifeLostMusic());\r\n\r\n if (player.getLife() <= 0) {\r\n GameManager.GAME_OVER = true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n //Controllo per il blocco di fuoco centrale\r\n if (CollisionsManager.checkPlayerSingleCollision(player, fire.getX(), fire.getY(), 50, 50)) {\r\n player.setLife(player.getLife() - 1);\r\n SoundManager.musicClipStart(SoundManager.lifeLostMusic());\r\n\r\n if (player.getLife() <= 0) {\r\n GameManager.GAME_OVER = true;\r\n }\r\n }\r\n\r\n }\r\n\r\n }", "void checkHandleContactWithPlayer() {\n Player curPlayer = this.mainSketch.getCurrentActivePlayer();\n\n if (this.doesAffectPlayer) {\n // boundary collision for player\n if (contactWithCharacter(curPlayer)) { // this has contact with non-player\n if (!this.charactersTouchingThis.contains(curPlayer)) { // new collision detected\n curPlayer.changeNumberOfVerticalBoundaryContacts(1);\n this.charactersTouchingThis.add(curPlayer);\n }\n curPlayer.handleContactWithVerticalBoundary(this.startPoint.x);\n\n } else { // this DOES NOT have contact with player\n if (this.charactersTouchingThis.contains(curPlayer)) {\n curPlayer.setAbleToMoveRight(true);\n curPlayer.setAbleToMoveLeft(true);\n curPlayer.changeNumberOfVerticalBoundaryContacts(-1);\n this.charactersTouchingThis.remove(curPlayer);\n }\n }\n }\n }", "int checkCollision(Tumbleweed tumbleweed) {\n int retVal = 0;\n if (collidesWith(tumbleweed, true)) {\n retVal = 1;\n // once the cowboy has collided with the tumbleweed,\n // that tumbleweed is done for now, so we call reset\n // which makes it invisible and ready to be reused.\n tumbleweed.reset();\n }\n return (retVal);\n }", "void collisionDetection() {\n\t\tfor (int a = 0; a < botsList.size(); a++) {\r\n\t\t\tfor (int b = 0; b < botsList.size(); b++) {\r\n\r\n\t\t\t\tif (a == b) // Avoid checking if bot hits itself.\r\n\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\ttime = System.currentTimeMillis();\r\n\t\t\t\tif (time - botsList.get(a).enemy_last_detected > botsList.get(a).enemy_detect_timeout) {\r\n\t\t\t\t\tfor (int i = 0; i > botsList.get(b).bullets.size(); i++) {\r\n\t\t\t\t\t\tif (colides(botsList.get(a), botsList.get(b).bullets.get(i)))\r\n\t\t\t\t\t\t\tbotsList.get(a).loseLife();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (botsList.get(0).detect.intersects(botsList.get(1).body.getFrame())) {\r\n\t\t\tbotsList.get(0).enemyDetected(botsList.get(1).body);\r\n\t\t\tbot_1_detect = false;\r\n\t\t\tbot_1_detected = System.currentTimeMillis();\r\n\t\t}\r\n\t\tif (System.currentTimeMillis() - bot_1_detected > bot_1_detect_timeout)\r\n\t\t\tbot_1_detect = true;\r\n\t\t// and now same for bot 2\r\n\t\tif (botsList.get(1).detect.intersects(botsList.get(0).body.getFrame())) {\r\n\t\t\tbotsList.get(1).enemyDetected(botsList.get(0).body);\r\n\t\t\tbot_2_detect = false;\r\n\t\t\tbot_2_detected = System.currentTimeMillis();\r\n\t\t}\r\n\t\tif (System.currentTimeMillis() - bot_2_detected > bot_2_detect_timeout)\r\n\t\t\tbot_2_detect = true;\r\n\r\n\t\t// Bullets collision\r\n\t\t// See if bot_n hits the other bot with a bullet\r\n\t\tfor (int mainB = 0; mainB < botsList.size(); mainB++) {\r\n\t\t\tfor (int secB = 0; secB < botsList.size(); secB++) {\r\n\r\n\t\t\t\tif (secB == mainB)\r\n\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t// if player_2 collides with player 1's bullets\r\n\t\t\t\tfor (int i = 0; i < botsList.get(mainB).bullets.size(); i++) {\r\n\t\t\t\t\tif (colides(botsList.get(secB), botsList.get(mainB).bullets.get(i))) {\r\n\t\t\t\t\t\tSystem.out.println(\"Bot \" + 2 + \" intersects bullet nš \" + i);\r\n\t\t\t\t\t\tbotsList.get(mainB).bullets.remove(i);\r\n\t\t\t\t\t\tbotsList.get(secB).loseLife();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// if player_1 collides with player 2's bullets\r\n\t\tfor (int i = 0; i < botsList.get(1).bullets.size(); i++) {\r\n\t\t\tif (colides(botsList.get(0), botsList.get(1).bullets.get(i))) {\r\n\t\t\t\tSystem.out.println(\"Bot \" + 2 + \" intersects bullet nš \" + i);\r\n\t\t\t\tbotsList.get(1).bullets.remove(i);\r\n\t\t\t\tbotsList.get(0).loseLife();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "@Override\n public void onBodyHit () {\n Gdx.app.log(\"Token\", \"Collision\");\n\n if(getCell().getTile().getId() == BLANK_COIN)\n MyGdxGame.manager.get(\"audio/sounds/bump.wav\", Sound.class).play();\n else\n MyGdxGame.manager.get(\"audio/sounds/coin.wav\", Sound.class).play();\n\n\n setCategoryFilter(MyGdxGame.DESTROYED_BIT);\n //tile where Token is located is set to \"null\".\n getCell().setTile(tileSet.getTile(BLANK_COIN));\n Hud.addScore(100);\n }", "@Override\n\tpublic void onUpdate()\n\t{\n\t\tthis.lastTickPosX = this.posX;\n\t\tthis.lastTickPosY = this.posY;\n\t\tthis.lastTickPosZ = this.posZ;\n\t\tsuper.onUpdate();\n\n\t\tif (this.throwableShake > 0)\n\t\t{\n\t\t\t--this.throwableShake;\n\t\t}\n\n\t\tif (this.inGround)\n\t\t{\n\t\t\tif (this.worldObj.getBlockState(this.getPosition()).getBlock() == this.inTile)\n\t\t\t{\n\t\t\t\t++this.ticksInGround;\n\n\t\t\t\tif (this.ticksInGround == 1200)\n\t\t\t\t{\n\t\t\t\t\tthis.setDead();\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.inGround = false;\n\t\t\tthis.motionX *= this.rand.nextFloat() * 0.2F;\n\t\t\tthis.motionY *= this.rand.nextFloat() * 0.2F;\n\t\t\tthis.motionZ *= this.rand.nextFloat() * 0.2F;\n\t\t\tthis.ticksInGround = 0;\n\t\t\tthis.ticksInAir = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t++this.ticksInAir;\n\t\t}\n\n\t\tVec3 vec3 = new Vec3(this.posX, this.posY, this.posZ);\n\t\tVec3 vec31 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);\n\t\tMovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31);\n\t\tvec3 = new Vec3(this.posX, this.posY, this.posZ);\n\t\tvec31 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);\n\n\t\tif (movingobjectposition != null)\n\t\t{\n\t\t\tvec31 = new Vec3(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);\n\t\t}\n\n\t\tif (!this.worldObj.isRemote)\n\t\t{\n\t\t\tEntity entity = null;\n\t\t\tList list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this,\n\t\t\t\t\tthis.getEntityBoundingBox().addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));\n\t\t\tdouble d0 = 0.0D;\n\t\t\tEntityLivingBase entitylivingbase = this.getThrower();\n\n\t\t\tfor (Object obj : list)\n\t\t\t{\n\t\t\t\tEntity entity1 = (Entity) obj;\n\n\t\t\t\tif (entity1.canBeCollidedWith() && ((entity1 != entitylivingbase) || (this.ticksInAir >= 5)))\n\t\t\t\t{\n\t\t\t\t\tfloat f = 0.3F;\n\t\t\t\t\tAxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().expand(f, f, f);\n\t\t\t\t\tMovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);\n\n\t\t\t\t\tif (movingobjectposition1 != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble d1 = vec3.distanceTo(movingobjectposition1.hitVec);\n\n\t\t\t\t\t\tif ((d1 < d0) || (d0 == 0.0D))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tentity = entity1;\n\t\t\t\t\t\t\td0 = d1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (entity != null)\n\t\t\t{\n\t\t\t\tmovingobjectposition = new MovingObjectPosition(entity);\n\t\t\t}\n\t\t}\n\n\t\tif (movingobjectposition != null)\n\t\t{\n\t\t\tif ((movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)\n\t\t\t\t\t&& (this.worldObj.getBlockState(movingobjectposition.getBlockPos()).getBlock() == Blocks.portal))\n\t\t\t{\n\t\t\t\tthis.inPortal = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.onImpact(movingobjectposition);\n\t\t\t}\n\t\t}\n\n\t\tthis.posX += this.motionX;\n\t\tthis.posY += this.motionY;\n\t\tthis.posZ += this.motionZ;\n\t\tfloat f1 = MathHelper.sqrt_double((this.motionX * this.motionX) + (this.motionZ * this.motionZ));\n\t\tthis.rotationYaw = (float) ((Math.atan2(this.motionX, this.motionZ) * 180.0D) / Math.PI);\n\n\t\tfor (this.rotationPitch = (float) ((Math.atan2(this.motionY, f1) * 180.0D) / Math.PI); (this.rotationPitch\n\t\t\t\t- this.prevRotationPitch) < -180.0F; this.prevRotationPitch -= 360.0F)\n\t\t{\n\t\t}\n\n\t\twhile ((this.rotationPitch - this.prevRotationPitch) >= 180.0F)\n\t\t{\n\t\t\tthis.prevRotationPitch += 360.0F;\n\t\t}\n\n\t\twhile ((this.rotationYaw - this.prevRotationYaw) < -180.0F)\n\t\t{\n\t\t\tthis.prevRotationYaw -= 360.0F;\n\t\t}\n\n\t\twhile ((this.rotationYaw - this.prevRotationYaw) >= 180.0F)\n\t\t{\n\t\t\tthis.prevRotationYaw += 360.0F;\n\t\t}\n\n\t\tthis.rotationPitch = this.prevRotationPitch + ((this.rotationPitch - this.prevRotationPitch) * 0.2F);\n\t\tthis.rotationYaw = this.prevRotationYaw + ((this.rotationYaw - this.prevRotationYaw) * 0.2F);\n\t\tfloat f2 = 0.99F;\n\t\tfloat f3 = this.getGravityVelocity();\n\n\t\tif (this.isInWater())\n\t\t{\n\t\t\tfor (int i = 0; i < 4; ++i)\n\t\t\t{\n\t\t\t\tfloat f4 = 0.25F;\n\t\t\t\tthis.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX - (this.motionX * f4), this.posY - (this.motionY * f4),\n\t\t\t\t\t\tthis.posZ - (this.motionZ * f4), this.motionX, this.motionY, this.motionZ);\n\t\t\t}\n\n\t\t\tf2 = 0.8F;\n\t\t}\n\n\t\tthis.motionX *= f2;\n\t\tthis.motionY *= f2;\n\t\tthis.motionZ *= f2;\n\t\tthis.motionY -= f3;\n\t\tthis.setPosition(this.posX, this.posY, this.posZ);\n\t}", "private void checkIsAbleToFire() {\n\n\t\tif (ticksToNextFire <= currentTickCount) {\n\t\t\tisAbleToFire = true;\n\t\t} else {\n\t\t\tisAbleToFire = false;\n\t\t}\n\t}", "@Override\n\tpublic void onUpdate() {\n\t\tif (this.isEntityAlive()) {\n\t\t\tthis.lastActiveTime = this.timeSinceIgnited;\n\t\t\tint i = this.getCreeperState();\n\t\t\tif (i > 0 && this.timeSinceIgnited == 0) {\n\t\t\t\tthis.playSound(\"random.fuse\", 1.0F, 0.5F);\n\t\t\t}\n\t\t\tthis.timeSinceIgnited += i;\n\t\t\tif (this.timeSinceIgnited < 0) {\n\t\t\t\tthis.timeSinceIgnited = 0;\n\t\t\t}\n\t\t\tif (this.timeSinceIgnited >= this.fuseTime) {\n\t\t\t\tthis.timeSinceIgnited = this.fuseTime;\n\t\t\t\tif (!this.worldObj.isRemote) {\n\t\t\t\t\tthis.worldObj.spawnParticle(\"portal\", this.posX, this.posY,\n\t\t\t\t\t\t\tthis.posZ, 4D, 4D, 4D);\n\t\t\t\t\tthis.worldObj.playSoundEffect(this.posX, this.posY,\n\t\t\t\t\t\t\tthis.posZ, \"mob.endermen.portal\", 2.0F,\n\t\t\t\t\t\t\tthis.worldObj.rand.nextFloat() * 0.1F + 0.9F);\n\t\t\t\t\tList players = worldObj.getEntitiesWithinAABB(\n\t\t\t\t\t\t\tEntityPlayer.class, this.boundingBox.expand(\n\t\t\t\t\t\t\t\t\t3 + Math.floor(this.ticksExisted / 50), 2,\n\t\t\t\t\t\t\t\t\t3 + Math.floor(this.ticksExisted / 50)));\n\t\t\t\t\tObject[] playerArray = players.toArray();\n\t\t\t\t\tfor (Object o : playerArray) {\n\t\t\t\t\t\tEntityPlayer e = (EntityPlayer) o;\n\t\t\t\t\t\tint entityId = e.getEntityId();\n\t\t\t\t\t\tif (!this.worldObj.isRemote) {\n\t\t\t\t\t\t\tint dimensionId = e.dimension == 0 ? 1 : 0;\n\t\t\t\t\t\t\tPacketDispatcher.getSimpleNetworkWrapper()\n\t\t\t\t\t\t\t.sendToServer(\n\t\t\t\t\t\t\t\t\tnew MessageTeleportToDimension(\n\t\t\t\t\t\t\t\t\t\t\t\t\tdimensionId, entityId));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.setDead();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsuper.onUpdate();\n\t}", "private void checkCollision()\n {\n if (gameOverBool==false)\n { \n Actor a = getOneIntersectingObject(Wall.class);\n if (a != null||isAtEdge())\n {\n setImage(\"gone.png\");//laat de helicopter verdwijnen\n //greenfoot.GreenfootSound.stop(\"helisound.wav\");\n World world = getWorld();\n world.addObject(new Explosion(), getX(), getY());\n Greenfoot.playSound(\"heliExplosion.wav\");\n world.addObject( new Gameover(), 600, 300 );\n gameOverBool = true; \n }\n } \n }", "public void checkCollision() {}", "@Override\n public void onUpdate(double tpf) {\n int x = (int)((entity.getX() + 30/2 ) / 30);\n int y = (int)((entity.getY() + 30/2 ) / 30);\n\n int px = (int)((player.getX() + 30/2 ) / 30);\n int py = (int)((player.getY() + 30/2 ) / 30);\n\n if (x == px || y == py) {\n shoot();\n }\n }", "public void checkCollision(){\n\r\n for(int i = 0; i < enemies.size(); i++){\r\n \r\n // Player and Enemy collision\r\n \r\n if(collide(this.player, enemies.get(i)) && this.player.isVisible() && enemies.get(i).isVisible()){\r\n System.out.println(\"Collide\");\r\n this.player.setHealth(this.player.getHealth() - 100);\r\n }\r\n\r\n // Player and Enemy bullet collision\r\n \r\n for(int j =0; j < enemies.get(i).getBullets().size(); j++){\r\n\r\n if(collide(this.player, enemies.get(i).getBullets().get(j)) && this.player.isVisible() && enemies.get(i).getBullets().get(j).isVisible()){\r\n\r\n enemies.get(i).getBullets().get(j).setVisible(false);\r\n this.player.setHealth(this.player.getHealth() - enemies.get(i).getBullets().get(j).getDamage());\r\n\r\n }\r\n }\r\n\r\n }\r\n //time = DEFAULT_TIME_DELAY;\r\n// }\r\n\r\n\r\n\r\n for(int i = 0; i < player.getBullets().size(); i++){\r\n\r\n\r\n // Player bullet and enemy collision\r\n\r\n for(int j = 0; j < enemies.size(); j++) {\r\n if (collide(enemies.get(j), player.getBullets().get(i)) && enemies.get(j).isVisible() && player.getBullets().get(i).isVisible()) {\r\n\r\n if (enemies.get(j).getHealth() < 0) {\r\n enemies.get(j).setVisible(false);\r\n score.addScore(100);\r\n }\r\n\r\n enemies.get(j).setHealth(enemies.get(j).getHealth() - player.getBullets().get(i).getDamage());\r\n // enemies.get(j).setColor(Color.RED);\r\n player.getBullets().get(i).setVisible(false);\r\n\r\n\r\n }\r\n }\r\n\r\n\r\n // Boss collision & player bullet collision\r\n\r\n if(collide(player.getBullets().get(i), this.boss1) && player.getBullets().get(i).isVisible() && boss1.isVisible()){\r\n\r\n if(boss1.getHealth() < 0){\r\n boss1.setVisible(false);\r\n score.addScore(1000);\r\n state = STATE.WIN;\r\n }\r\n this.boss1.setHealth(this.boss1.getHealth() - player.getBullets().get(i).getDamage());\r\n // this.boss1.setHealth(0);\r\n player.getBullets().get(i).setVisible(false);\r\n\r\n }\r\n\r\n }\r\n\r\n // Bullet vs Bullet Collision\r\n\r\n for(int k = 0 ; k < player.getBullets().size(); k++){\r\n\r\n if(player.getBullets().get(k).isVisible()) {\r\n for (int i = 0; i < enemies.size(); i++) {\r\n\r\n if(enemies.get(i).isVisible()) {\r\n for (int j = 0; j < enemies.get(i).getBullets().size(); j++) {\r\n\r\n if (collide(player.getBullets().get(k), enemies.get(i).getBullets().get(j)) && enemies.get(i).getBullets().get(j ).isVisible()) {\r\n\r\n\r\n System.out.println(\"bullets colliding\");\r\n\r\n player.getBullets().get(k).setVisible(false);\r\n enemies.get(i).getBullets().get(j).setColor(Color.yellow);\r\n enemies.get(i).getBullets().get(j).deflect(this.player.getX() + this.player.getW()/2, this.player.getY() + this.player.getH()/2);\r\n\r\n player.getBullets().add(enemies.get(i).getBullets().get(j));\r\n\r\n enemies.get(i).getBullets().remove(enemies.get(i).getBullets().get(j)); //removes bullet\r\n\r\n\r\n k++;\r\n j--;\r\n //enemies.get(i).getBullets().get(j).setVisible(false);\r\n }\r\n }\r\n }\r\n }\r\n\r\n\r\n for(int i = 0; i < boss1.getBullets().size(); i++) {\r\n\r\n\r\n if (collide(player.getBullets().get(k), boss1.getBullets().get(i)) && boss1.getBullets().get(i).isVisible()) {\r\n\r\n System.out.println(\"boss bullets colliding\");\r\n player.getBullets().get(k).setVisible(false);\r\n boss1.getBullets().get(i).setColor(Color.yellow);\r\n boss1.getBullets().get(i).deflect(this.player.getX() + this.player.getW()/2, this.player.getY() + this.player.getH()/2);\r\n player.getBullets().add(boss1.getBullets().get(i));\r\n boss1.getBullets().remove(boss1.getBullets().get(i));\r\n k++;\r\n i--;\r\n\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Boss bullet and player collision\r\n\r\n for(Bullet b : boss1.getBullets() ){\r\n\r\n\r\n if(collide(player, b) && player.isVisible() && b.isVisible()){\r\n b.setVisible(false);\r\n player.setHealth(player.getHealth() - b.getDamage());\r\n }\r\n }\r\n\r\n\r\n // Power up collision\r\n\r\n for(PowerUp p : powerUps){\r\n\r\n if(collide(player, p) && p.isVisible()){\r\n\r\n p.executeEffect(this.player);\r\n p.setVisible(false);\r\n }\r\n }\r\n\r\n\r\n\r\n // Deleting out of bound bullets\r\n for(int i = 0; i < player.getBullets().size(); i++){\r\n if(player.getBullets().get(i).getY() < 0 || player.getBullets().get(i).getY() > GameWorld.SCREEN_H ||\r\n player.getBullets().get(i).getX()< 0 || player.getBullets().get(i).getX() > GameWorld.SCREEN_W) {\r\n\r\n player.getBullets().remove(player.getBullets().get(i));\r\n }\r\n }\r\n\r\n }", "@Override\n \tpublic void update(double ticksPassed) {\n \t\tdouble dx = this.velocity.getX() * ticksPassed;\n \t\tdouble dy = this.velocity.getY() * ticksPassed;\n \t\t//check boundaries first\n \t\tif ((this.position.getX() + dx) < 0) { //off left\n \t\t\tdx = this.position.getX();\n \t\t\tthis.velocity.setX(0);\n \t\t}\n \t\telse if ((this.position.getX() + dx > App.WIDTH)) { //off right\n \t\t\tdx = (App.WIDTH - this.position.getX());\n \t\t\tthis.velocity.setX(0);\n \t\t}\n \t\tif ((this.position.getY() + dy) < 0) { //off top\n \t\t\tdy = this.position.getY();\n \t\t\tthis.velocity.setY(0);\n \t\t}\n \t\telse if ((this.position.getY() + dy) > App.HEIGHT) { //off bottom\n \t\t\tdy = (App.HEIGHT - this.position.getY());\n \t\t\tthis.velocity.setY(0);\n \t\t}\n \t\tthis.position.setX(this.position.getX() + dx);\n \t\tthis.position.setY(this.position.getY() + dy);\n \t\t//move the hitbox too\n \t\tthis.hitBox.move(dx, dy);\n \t\t//slow velocity due to drag\n \t\tdouble xDrag = this.drag * ticksPassed *\n \t\t\tMath.abs(this.direction.getX());\n \t\tdouble yDrag = this.drag * ticksPassed *\n \t\t\tMath.abs(this.direction.getY());\n \t\tdx = (this.velocity.getX() > 0) ?\n \t\t\t-Math.min(xDrag, this.velocity.getX()) :\n \t\t\tMath.min(xDrag, -this.velocity.getX());\n \t\tdy = (this.velocity.getY() > 0) ?\n \t\t\t-Math.min(yDrag, this.velocity.getY()) :\n \t\t\tMath.min(yDrag, -this.velocity.getY());\n \t\tthis.velocity.setX(this.velocity.getX() + dx);\n \t\tthis.velocity.setY(this.velocity.getY() + dy);\n \t\t//try to face the player\n \t\tDoubleVec2D toPlayer =\n \t\t\tthis.player.getPosition().subtract(this.position);\n \t\tDoubleVec2D toPlayerNorm = toPlayer.normalized();\n\t\t//perpdot = sin_theta, dot = cos_theta, negative y is up\n\t\tdouble angleBetween = -Math.atan2(toPlayerNorm.perpDot(this.direction),\n\t\t\t\ttoPlayerNorm.dot(this.direction));\n \t\tdouble rot = (angleBetween > 0) ? \n \t\t\t\tMath.min(this.maxRot, angleBetween) * ticksPassed:\n \t\t\t\tMath.max(-this.maxRot, angleBetween) * ticksPassed;\n \t\tdouble cosTheta = Math.cos(rot);\n \t\tdouble sinTheta = Math.sin(rot);\n \t\tdouble xPrime = (this.direction.getX() * cosTheta) - \n \t\t\t(this.direction.getY() * sinTheta);\n \t\tdouble yPrime = (this.direction.getX() * sinTheta) + \n \t\t\t(this.direction.getY() * cosTheta);\n \t\tthis.direction = new DoubleVec2D(xPrime, yPrime);\n \t\t//modify velocity for controls\n \t\t//TODO maybe modify for angle from player\n \t\tdx = this.direction.getX() * this.acceleration * ticksPassed;\n \t\tdy = this.direction.getY() * this.acceleration * ticksPassed;\n \t\tif (toPlayer.magnitude() > 1.0) {\n \t\t\tthis.velocity.setX(this.velocity.getX() + dx);\n \t\t\tthis.velocity.setY(this.velocity.getY() + dy);\n \t\t}\n \t\t//spawn bullet, considering cooldown\n \t\t//only shoot when facing the player and near the player\n \t\tthis.ticksSinceBullet += ticksPassed;\n \t\tif ((Math.abs(angleBetween) < this.maxAngleToFire) &&\n \t\t\t\t(Math.abs(toPlayer.magnitude()) < this.maxDistanceToFire) &&\n \t\t\t\t(this.ticksSinceBullet >= this.bulletCooldown)) {\n \t\t\tDoubleVec2D position = new DoubleVec2D(this.position.getX(),\n \t\t\t\t\tthis.position.getY());\n \t\t\tDoubleVec2D direction = new DoubleVec2D(this.direction.getX(),\n \t\t\t\t\tthis.direction.getY());\n \t\t\tthis.firedBullet = new Bullet(position, direction, false);\n \t\t\tthis.ticksSinceBullet = 0;\n \t\t}\n \t}", "void collision(float x_a,float y_a,float x_b,float y_b){\n float dy = y_a - y_b;\r\n float dx = x_a - x_b;\r\n float distance12 = dy * dy + dx * dx;\r\n\r\n if (distance12 < ((2 * ballRadius) * (2 * ballRadius))) {\r\n\r\n ((GameActivity)mActivity).mTimer.cancel();\r\n ((GameActivity)mActivity).layout.removeAllViews();\r\n new AlartMessage(mActivity);\r\n }\r\n\r\n }", "@Test\n public void testTimeOutOn() {\n // set up the world\n World world = makeWorld();\n \n // make the projectile\n ProjectileDefinition projectileDefinition = new ProjectileDefinition(0,\n \"testProjectileBaseCase\", \"resources/projectiles/test.png\", 0,\n 0, 1, 30, true, 10000, false, 0);\n\n Entity projectile = ProjectileEntities.createProjectile(world,\n projectileDefinition, 30, 30, null);\n \n ProjectileComponent pc = world.getComponent(projectile, ProjectileComponent.class).get();\n \n // Go just below the 10\n for (double total = 0; Math.abs(total - 10) > 0.01; total += 0.2) {\n // run the world\n world.process(total, 0.2);\n \n // the projectile should be there\n assertTrue(\"There should be a projectile that's alive\", \n isProjectileAlive(world, projectile));\n }\n \n world.process(10, 0.2);\n \n assertTrue(\"The projectile should be destroyed\", \n isProjectileDestroyed(world, projectile));\n }", "@Override\n\tpublic void update(double dt) {\n\t\tprocessLaserCollisions();\n\n\t\t// Then we spawn a new asteroid if we need to.\n\t\ttimeToNextAsteroid -= dt;\n\t\tif (timeToNextAsteroid <= 0) {\n\t\t\ttimeToNextAsteroid += asteroidDelay;\n\t\t\tspawnRandomAsteroid();\n\t\t}\n\n\t\t// If the player is dead, we just process the time left. If they need to respawn, we call\n\t\t// that.\n\t\tif (playerDead) {\n\t\t\tplayerDeadTimeLeft -= dt;\n\t\t\tif (playerDeadTimeLeft < 0) {\n\t\t\t\t// TODO: This might be a problem if an asteroid is on top of the player when they spawn.\n\t\t\t\tspawnPlayer();\n\t\t\t}\n\t\t} else {\n\t\t\t// Otherwise, they need to collide with things.\n\t\t\tprocessPlayerCollision();\n\t\t}\n\t}", "@Override\n public void start() {\n final LivingEntity target = mob.getTarget();\n if( target == null )\n return;\n \n // Perform the jump\n mob.getLookControl().setLookAt( target, 180.0F, 0.0F );\n final Vector3d jumpXZ = new Vector3d( target.getX() - mob.getX(), 0.0, target.getZ() - mob.getZ() )\n .normalize().scale( Config.ELITE_AI.JUMP.jumpSpeedForward.get() ).add( mob.getDeltaMovement().scale( 0.2 ) );\n mob.setDeltaMovement( jumpXZ.x, Config.ELITE_AI.JUMP.jumpSpeedUpward.get(), jumpXZ.z );\n \n // Start the cooldown (this won't tick down until the entity has landed)\n cooldownTimer = Config.ELITE_AI.JUMP.cooldown.next( mob.getRandom() );\n }", "@Override\r\n public void update() {\r\n super.update();\r\n hero.checkForTileCollision(getXOverlap(hero.oldx,hero.oldx+width,hero.x,hero.x+width), getYOverlap(hero.oldy,hero.oldy+hero.height,hero.y, hero.y+hero.height));\r\n int i = 0;\r\n\r\n while (turningPoints[i]!= null)\r\n {\r\n if (intersects(turningPoints[i].x,turningPoints[i].y, turningPoints[i].width,turningPoints[i].height))\r\n {\r\n vx = -vx;\r\n vy = -vy;\r\n }\r\n i++;\r\n }\r\n }", "public void checkHits() {\n\t\t// your code here\n\t\tfor (int i = 0; i < enemyX.length; i++) {\n\t\t\tif (distance((int)xI, (int)yI, enemyX[i], enemyY[i]) <= DIAM_ENEMY/2 + DIAM_LAUNCHER/2) {\n\t\t\t}\n\t\t}\n\t}", "public abstract void interactionStarts(long ms);", "public void act() \r\n {\n if(getOneIntersectingObject(Player.class)!=null)\r\n {\r\n if(MenuWorld.gamemode == 1)\r\n //marcheaza regenerarea labirintului(trecere la nivelul urmator in Modul Contra Timp)\r\n TAworld.shouldRegen=true;\r\n else\r\n { \r\n //reseteaza variabilele care tin de modul de joc\r\n MenuWorld.gamemode=-1;\r\n MenuWorld.isPlaying=false;\r\n for(int i=0;i<4;i++)\r\n ItemCounter.gems_taken[i]=0;\r\n \r\n //arata fereastra de castig \r\n PMworld.shouldShowVictoryWindow=true;\r\n }\r\n \r\n }\r\n \r\n }", "public void collide(){\n hp -= 10;\n resetPos();\n //canMove = false;\n }", "private void checkPlayerCollisions() {\r\n\t\tGObject left = getElementAt(player.getX() - 1, player.getY() + player.getHeight() / 2.0);\r\n\t\tGObject right = getElementAt(player.getX() + player.getWidth() + 1, player.getY() + player.getHeight() / 2.0);\r\n\t\tif(dragon1 != null && (left == dragon1 || right == dragon1)) {\r\n\t\t\tremove(lifeBar);\r\n\t\t\tlifeBar = null;\r\n\t\t}\r\n\t\tif(dragon2 != null && (left == dragon2 || right == dragon2)) {\r\n\t\t\tremove(lifeBar);\r\n\t\t\tlifeBar = null;\r\n\t\t}\r\n\t}", "@Override\n\t\tpublic void run() {\n\n\n\t\t\tif (((CitizensNPC)myNPC).getHandle() == null ) sentryStatus = Status.isDEAD; // incase it dies in a way im not handling.....\n\n\t\t\tif (sentryStatus != Status.isDEAD && System.currentTimeMillis() > oktoheal && HealRate > 0) {\n\t\t\t\tif (myNPC.getBukkitEntity().getHealth() < sentryHealth) {\n\t\t\t\t\tmyNPC.getBukkitEntity().setHealth(myNPC.getBukkitEntity().getHealth() + 1);\n\t\t\t\t\tif (healanim!=null)net.citizensnpcs.util.Util.sendPacketNearby(myNPC.getBukkitEntity().getLocation(),healanim , 64);\n\n\t\t\t\t\tif (myNPC.getBukkitEntity().getHealth() >= sentryHealth) _myDamamgers.clear(); //healed to full, forget attackers\n\n\t\t\t\t}\n\t\t\t\toktoheal = (long) (System.currentTimeMillis() + HealRate * 1000);\n\t\t\t}\n\n\t\t\tif (sentryStatus == Status.isDEAD && System.currentTimeMillis() > isRespawnable && RespawnDelaySeconds != 0) {\n\t\t\t\t// Respawn\n\n\t\t\t\t// Location loc =\n\t\t\t\t// myNPC.getTrait(CurrentLocation.class).getLocation();\n\t\t\t\t// if (myNPC.hasTrait(Waypoints.class)){\n\t\t\t\t// Waypoints wp = myNPC.getTrait(Waypoints.class);\n\t\t\t\t// wp.getCurrentProvider()\n\t\t\t\t// }\n\n\t\t\t\t// plugin.getServer().broadcastMessage(\"Spawning...\");\n\t\t\t\tif (guardEntity == null) {\n\t\t\t\t\tmyNPC.spawn(Spawn);\n\t\t\t\t} else {\n\t\t\t\t\tmyNPC.spawn(guardEntity.getLocation().add(2, 0, 2));\n\t\t\t\t}\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\telse if (sentryStatus == Status.isHOSTILE && myNPC.isSpawned()) {\n\n\t\t\t\tif (projectileTarget != null && !projectileTarget.isDead()) {\n\t\t\t\t\tif (_projTargetLostLoc == null)\n\t\t\t\t\t\t_projTargetLostLoc = projectileTarget.getLocation();\n\n\t\t\t\t\tfaceEntity(myNPC.getBukkitEntity(), projectileTarget);\n\n\t\t\t\t\tif (System.currentTimeMillis() > oktoFire) {\n\t\t\t\t\t\t// Fire!\n\t\t\t\t\t\toktoFire = (long) (System.currentTimeMillis() + AttackRateSeconds * 1000.0);\n\t\t\t\t\t\tFire(projectileTarget);\n\t\t\t\t\t}\n\t\t\t\t\tif (projectileTarget != null)\n\t\t\t\t\t\t_projTargetLostLoc = projectileTarget.getLocation();\n\n\t\t\t\t\treturn; // keep at it\n\n\t\t\t\t}\n\n\t\t\t\telse if (meleeTarget != null && !meleeTarget.isDead()) {\n\t\t\t\t\t// Did it get away?\n\t\t\t\t\tif (meleeTarget.getLocation().distance(myNPC.getBukkitEntity().getLocation()) > sentryRange) {\n\t\t\t\t\t\t// it got away...\n\t\t\t\t\t\tsetTarget(null);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\t// target died or null\n\t\t\t\t\tsetTarget(null);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telse if (sentryStatus == Status.isLOOKING && myNPC.isSpawned()) {\n\n\t\t\t\tif (guardTarget != null && guardEntity == null) {\n\t\t\t\t\t// daddy? where are u?\n\t\t\t\t\tsetGuardTarget(guardTarget);\n\t\t\t\t}\n\n\t\t\t\tLivingEntity target = findTarget(sentryRange);\n\n\t\t\t\tif (target != null) {\n\t\t\t\t\t// plugin.getServer().broadcastMessage(\"Target selected: \" +\n\t\t\t\t\t// target.toString());\n\t\t\t\t\tsetTarget(target);\n\t\t\t\t} else\n\t\t\t\t\tsetTarget(null);\n\n\t\t\t}\n\n\t\t}", "private void CheckWorldCollision() {\n\t\tfor(WorldObj obj : World.CurrentWorld.SpawnedObjects) {\n\t\t\tif(bounds.overlaps(obj.bounds))\n\t\t\t\tobj.OnCollision(this);\n\t\t\tif(MapRenderer.CurrentRenderer.ItemAnimation != null) {\n\t\t\t\tif(obj.ai != null) {\n\t\t\t\t\tif(dir == LEFT)\n\t\t\t\t\tAttackBounds.set(pos.x+(dir*1.35f)+0.5f,pos.y,1.35f,1);\n\t\t\t\t\telse\n\t\t\t\t\t\tAttackBounds.set(pos.x+0.5f,pos.y,1.35f,1);\n\t\t\t\t\tif(obj.healthBarTimer > 0.4f)\n\t\t\t\tif(AttackBounds.overlaps(obj.bounds)) {\n\t\t\t\t\tif(!Terrain.CurrentTerrain.isSolid((int)(pos.x+0.5f+(0.3f*dir)), (int)(pos.y+0.5f)))\n\t\t\t\t\tobj.ai.onDamaged(this, UsedItem, GetATK());\n\t\t\t\t\tHitTimer = 0;\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(obj.damageable) {\n\t\t\t\t\tif(AttackBounds.overlaps(obj.bounds)) {\n\t\t\t\t\t\tobj.onDamaged(this, UsedItem, GetATK());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void collide(ScreenObject other) {\n switch (other.getType()) {\n case ASTEROID:\n hp -= other.dealDamage();\n break;\n case ENEMY:\n hp -= other.dealDamage();\n break;\n case ENEMYBULLET:\n hp -= other.dealDamage();\n break;\n case MACGUFFIN:\n macguffinsCollected++;\n break;\n case PORT:\n if (macguffinsCollected >= level.getMacguffinCount()\n && boundingCircle.contains(other.getPosition())) {\n Gdx.app.log(\"Ship\", \"level over\");\n //ends level\n }\n break;\n }\n }", "protected boolean canFire()\n\t\t{\n\t\treturn ( TimeUtils.timeSinceMillis(startTime) > this.fireDelay );\n\t\t}", "@Override\n synchronized public void run() {\n if (gameBoard.wasCollisionDetected()) {\n Point collisionPoint = gameBoard.getLastCollision();\n if (collisionPoint.x >= 0) {\n dummyText.setText(\"Last Collision XY (\" + Integer.toString(collisionPoint.x) + \",\" + Integer.toString(collisionPoint.y) + \")\");\n score++;\n }\n //turn off the animation until reset gets pressed\n //return;\n }\n frame.removeCallbacks(frameUpdate);\n\n Point playerNewPosition = new Point(gameBoard.getPlayerX(), gameBoard.getPlayerY());\n Point targetNewPosition = new Point(gameBoard.getTargetX(), gameBoard.getTargetY());\n Point obstacle1NewPosition = new Point(gameBoard.getObstacle1X(), gameBoard.getObstacle1Y());\n Point obstacle2NewPosition = new Point(gameBoard.getObstacle2X(), gameBoard.getObstacle2Y());\n\n updatePlayerVelocity();\n playerNewPosition.y = playerNewPosition.y + playerVelocity.y;\n if (playerNewPosition.y > playerMaxY) {\n // return doge to original position if it overshoots\n playerNewPosition.y = playerMaxY;\n performJump = false;\n button.setEnabled(true);\n }\n\n targetNewPosition.x = targetNewPosition.x + targetVelocity.x;\n if (targetNewPosition.x > memeMaxX || targetNewPosition.x < 5) {\n targetVelocity.x *= -1;\n }\n targetNewPosition.y = targetNewPosition.y + targetVelocity.y;\n if (targetNewPosition.y > memeMaxY || targetNewPosition.y < 5) {\n targetVelocity.y *= -1;\n }\n\n obstacle1NewPosition.x = obstacle1NewPosition.x + obstacle1Velocity.x;\n if (obstacle1NewPosition.x > memeMaxX || obstacle1NewPosition.x < 5) {\n obstacle1Velocity.x *= -1;\n }\n obstacle1NewPosition.y = obstacle1NewPosition.y + obstacle1Velocity.y;\n if (obstacle1NewPosition.y > memeMaxY || obstacle1NewPosition.y < 5) {\n obstacle1Velocity.y *= -1;\n }\n\n obstacle2NewPosition.x = obstacle2NewPosition.x + obstacle2Velocity.x;\n if (obstacle2NewPosition.x > memeMaxX || obstacle2NewPosition.x < 5) {\n obstacle2Velocity.x *= -1;\n }\n obstacle2NewPosition.y = obstacle2NewPosition.y + obstacle2Velocity.y;\n if (obstacle2NewPosition.y > memeMaxY || obstacle2NewPosition.y < 5) {\n obstacle2Velocity.y *= -1;\n }\n\n gameBoard.setPlayerPosition(playerNewPosition.x, playerNewPosition.y);\n gameBoard.setTargetPosition(targetNewPosition.x, targetNewPosition.y);\n gameBoard.setObstacle1Position(obstacle1NewPosition.x, obstacle1NewPosition.y);\n gameBoard.setObstacle2Position(obstacle2NewPosition.x, obstacle2NewPosition.y);\n gameBoard.invalidate();\n frame.postDelayed(frameUpdate, getFrameRate());\n }", "public void act() { \n check = borde(flag);\n if(check == true )\n restaura();\n moveRandom(move);\n if(animationE % 3 == 0){\n checkanimation();\n } \n animationE++; \n alive=checkfire();\n if(alive == true){\n enemyoff();\n } \n \n }", "public void handleJumping(){\r\n\r\n if ( !collide) {\r\n speedY += 1;\r\n if ((centerY + speedY >= 630 || collide )) {\r\n centerY = 630;\r\n speedY = 0;\r\n jumped = false;\r\n }\r\n }\r\n }", "public void tick(){\n camera.tick(player);\n handler.tick();\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n timer.start();\n if (!gameOver) {\n checkApple();\n checkCollision();\n move();\n }\n repaint();\n\n }", "public void timeToCheckWorker() {\n notifyCanMove(this.getCurrentTurn().getCurrentPlayer());\n }", "@Override\r\n\tpublic void tick(){\n\t\tif(!alert){\r\n\t\t\tif(hostileToPlayer&&closeEnoughToAlert(World.player))\r\n\t\t\t\t{alert=true;target=World.player;}\r\n\t\t}\r\n\t\t\r\n\t\tif(alert&&null!=target){\r\n\t\t\t//For now, advance towards the player\r\n\t\t\tPathfinder.moveTowards(this, target);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//If within attacking range but not yet attacking, and not stunned, do so.\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "protected void attackEntity(Entity var1, float var2)\n {\n if (this.attackTime <= 0 && var2 < 2.0F && var1.boundingBox.maxY > this.boundingBox.minY && var1.boundingBox.minY < this.boundingBox.maxY)\n {\n this.attackTime = 20;\n this.attackEntityAsMob(var1);\n }\n }", "public void defensive_act()\r\n\t{\r\n\t\tBullet closestBullet = IMAGINARY_BULLET;\r\n\t//\tBullet secondClosestBullet = IMAGINARY_BULLET;\r\n\t\t\r\n\t\tActor machines;\r\n\t\tEnumeration<Actor> opponent = ((MachineInfo)data.get(TankFrame.PLAYER_1)).getHashtable().elements();\r\n\t\twhile(opponent.hasMoreElements())\r\n\t\t{\r\n\t\t\tmachines = (Actor) opponent.nextElement();\r\n\t\t\tif(machines instanceof Bullet)\r\n\t\t\t{\r\n\t\t\t\tif(machines.getPoint().distance(getPoint()) < MIN_SHOOT_DISTANCE)\r\n\t\t\t\t{\r\n\t\t\t\t\tclosestBullet = (Bullet)machines;\r\n\t\t\t\t\tLine2D aim = new Line2D.Double(getCenterX(), getCenterY(), closestBullet.getPosX(), closestBullet.getPosY() );\r\n\t\t\t\t\tSystem.out.println(aim.getP1().distance(aim.getP2()));\r\n\t\t\t\t\tif(hasClearPath(aim) && aim.getP1().distance(aim.getP2()) < MIN_SHOOT_DISTANCE)\r\n\t\t\t\t\t\taimAndShoot(aim);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t/*\tif(machines.getPoint().distance(getPoint()) > secondClosestBullet.getPoint().distance(getPoint()) \r\n\t\t\t\t\t&& machines.getPoint().distance(getPoint()) < closestBullet.getPoint().distance(getPoint()))\r\n\t\t\t\t\tsecondClosestBullet = (Bullet)machines;*/\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t/*\r\n\t\t * Find the line\r\n\t\t */\r\n\t\t/*if(!closestBullet.equals(IMAGINARY_BULLET))\r\n\t\t{\r\n\t\t\tLine2D bulletPath = new Line2D(getLeftPoint(), closestBullet.getPoint());\r\n\t\t\tLine2D aim = new Line2D(getCenterX(), getCenterY(), (bulletPath.getX2()+bulletPath.getX1())/2,(bulletPath.getY2()+bulletPath.getY1())/2 );\r\n\t\t\tif(hasClearPath(aim) && aim.getP1().distance(aim.getP2()) < MIN_SHOOT_DISTANCE)\r\n\t\t\t\taimAndShoot(aim);\r\n\t\t\t/*bulletPath = new Line2D(getRightPoint(), closestBullet.getPoint());\r\n\t\t\taim = new Line2D(posX, posY, (bulletPath.getX2()+bulletPath.getX1())/2,(bulletPath.getY2()+bulletPath.getY1())/2 );\r\n\t\t\tif(hasClearPath(aim))\r\n\t\t\t\taimAndShoot(aim);\r\n\t\t\tbulletPath = new Line2D(getPoint(), closestBullet.getPoint());\r\n\t\t\taim = new Line2D(posX, posY, (bulletPath.getX2()+bulletPath.getX1())/2,(bulletPath.getY2()+bulletPath.getY1())/2 );\r\n\t\t\tif(hasClearPath(aim))\r\n\t\t\t\taimAndShoot(aim);*/\r\n\t\t\t\r\n\t\t//}\r\n\t/*\tif(!secondClosestBullet.equals(IMAGINARY_BULLET))\r\n\t\t{\r\n\t\t\tLine2D bulletPath = new Line2D(getLeftPoint(), secondClosestBullet.getPoint());\r\n\t\t\tLine2D aim = new Line2D(posX, posY, (bulletPath.getX2()+bulletPath.getX1())/2,(bulletPath.getY2()+bulletPath.getY1())/2 );\r\n\t\t\tif(hasClearPath(aim))\r\n\t\t\t\taimAndShoot(aim);\r\n\t\t}*/\r\n\r\n\t}", "private void checkChargeTime() {\n\t\tif (elapsedTimeSeconds > chargeTimeP1) {\n\t\t\tplayerCharge.put(dolphinNodeOne, false);\n\t\t}\n\t}", "public void tick(){\n if(healthPoints <= 0){\n sprite.setVisible(false);\n }\n if(isInvulnerable){\n invulnTimer++;\n }\n if(invulnTimer >= invulnTicks){\n setInvulnerable(false);\n invulnTimer = 0;\n }\n //System.out.println(stuckCounter);\n //System.out.println(isStuck);\n\n if(isStuck){\n stuckCounter++;\n }\n else{\n stuckCounter = 0;\n }\n\n x += dx;\n\n y += dy;\n sprite.setY((int) y);\n sprite.setX((int) x);\n }", "public void tick(){\r\n if(timer != 0)\r\n timer++;\r\n }", "public void onShootPressed(){\n if(player.getRechargeTimer()<=0) {\n playShootingSound();\n Bullet bullet = new Bullet();\n player.setRechargeTimer(shotRechargeTime);\n bullet.moveCentreTo(player.getCentreX(), player.getCentreY());\n bullet.setRotation(player.getRotation());\n bullet.setSpeed(new Point2D(15 * Math.cos(Math.toRadians(bullet.getRotation() - 90)), 15 * Math.sin(Math.toRadians(bullet.getRotation() - 90))));\n if(player.getTripleShotTimer()>0){\n Bullet bullet1 = new Bullet();\n bullet1.moveCentreTo(player.getCentreX(), player.getCentreY());\n bullet1.setRotation(player.getRotation()+15);\n bullet1.setSpeed(new Point2D(15 * Math.cos(Math.toRadians(bullet1.getRotation() - 90)), 15 * Math.sin(Math.toRadians(bullet1.getRotation() - 90))));\n Bullet bullet2 = new Bullet();\n bullet2.moveCentreTo(player.getCentreX(), player.getCentreY());\n bullet2.setRotation(player.getRotation()-15);\n bullet2.setSpeed(new Point2D(15 * Math.cos(Math.toRadians(bullet2.getRotation() - 90)), 15 * Math.sin(Math.toRadians(bullet2.getRotation() - 90))));\n }\n }\n }", "@Override\n public void onEntityUpdate() {\n if (!(world.provider instanceof WorldProviderLimbo || world.provider instanceof WorldProviderDungeonPocket)) {\n setDead();\n super.onEntityUpdate();\n return;\n }\n\n super.onEntityUpdate();\n\n // Check for players and update aggro levels even if there are no players in range\n EntityPlayer player = world.getClosestPlayerToEntity(this, MAX_AGGRO_RANGE);\n boolean visibility = player != null && player.canEntityBeSeen(this);\n updateAggroLevel(player, visibility);\n\n // Change orientation and face a player if one is in range\n if (player != null) {\n facePlayer(player);\n if (!world.isRemote && isDangerous()) {\n // Play sounds on the server side, if the player isn't in Limbo.\n // Limbo is excluded to avoid drowning out its background music.\n // Also, since it's a large open area with many Monoliths, some\n // of the sounds that would usually play for a moment would\n // keep playing constantly and would get very annoying.\n playSounds(player.getPosition());\n }\n\n if (visibility) {\n // Only spawn particles on the client side and outside Limbo\n if (world.isRemote && isDangerous()) {\n spawnParticles(player);\n }\n\n // Teleport the target player if various conditions are met\n if (aggro >= MAX_AGGRO && !world.isRemote && ModConfig.monoliths.monolithTeleportation && !player.isCreative() && isDangerous()) {\n aggro = 0;\n Location destination = WorldProviderLimbo.getLimboSkySpawn(player);\n TeleportUtils.teleport(player, destination, 0, 0);\n player.world.playSound(null, player.getPosition(), ModSounds.CRACK, SoundCategory.HOSTILE, 13, 1);\n }\n }\n }\n }", "public void checkCollision()\r\n\t{\r\n\t\t//for Bullets against Avatar and Enemy\r\n\t\tfor(int bulletIndex = 0; bulletIndex < bullets.size(); bulletIndex++)\r\n\t\t{\r\n\t\t\tBullet b = bullets.get(bulletIndex);\r\n\t\t\tif (b instanceof AvatarBullet)\r\n\t\t\t{\r\n\t\t\t\t@SuppressWarnings(\"unused\")\r\n\t\t\t\tboolean collided = false;\r\n\t\t\t\tfor (int enemyIndex = 0; enemyIndex < enemy.size(); enemyIndex++)\r\n\t\t\t\t{\r\n\t\t\t\t\tEnemy e = enemy.get(enemyIndex);\r\n\t\t\t\t\tif(((AvatarBullet) b).collidedWith(e))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tbullets.remove(bulletIndex);\r\n\t\t\t\t\t\tbulletIndex--;\r\n\t\t\t\t\t\tenemy.remove(enemyIndex);\r\n\t\t\t\t\t\tenemyIndex --;\r\n\t\t\t\t\t\tcollided = true;\r\n\t\t\t\t\t\tint score = getScore()+1;\r\n\t\t\t\t\t\tsetScore(score);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if (b instanceof EnemyBullet)\r\n\t\t\t{\r\n\t\t\t\tif (((EnemyBullet) b).collidedWith(avatar))\r\n\t\t\t\t{\r\n\t\t\t\t\tbullets.remove(bulletIndex);\r\n\t\t\t\t\tbulletIndex--;\r\n\t\t\t\t\tint health = Avatar.getLives()-1;\r\n\t\t\t\t\tavatar.setLives(health);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int platformIndex = 0; platformIndex < platforms.size(); platformIndex++)\r\n\t\t{\r\n\t\t\tPlatforms p = platforms.get(platformIndex);\r\n\t\t\tif (p instanceof Platforms)\r\n\t\t\t{\r\n\t\t\t\t//boolean collided = false;\r\n\t\t\t\t//Avatar a = avatar.get(enemyIndex);\r\n\t\t\t\tif(((Platforms) p).collidedWith(avatar))\r\n\t\t\t\t{\r\n\t\t\t\t\tsetAlive(true);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tsetAlive(false);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void checkCollisionwithMonster() {\n\t\tr1.set(this.getX(),this.getY(),this.getWidth(),this.getHeight());\r\n\t\t\r\n\t\t//check collision with monsters\t\t\r\n\t\tif(Math.ceil(this.getColor().a) == 1 && System.nanoTime() - oldTime >= cdTime){\r\n\t\t\tfor(TreeMonster treeMon : treeMonArray){\r\n\t\t\t\tif(treeMon.isVisible()){\r\n\t\t\t\t\tr2.set(treeMon.getCollisionBox());\r\n\t\t\t\t\tif (!r1.overlaps(r2)) continue;\r\n\t\t\t\t\toldTime = System.nanoTime();\r\n\t\t\t\t\tsetHealth(health-1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(Math.ceil(this.getColor().a) == 1 && System.nanoTime() - oldTime >= cdTime){\r\n\t\t\tfor(SlimeMonster slimeMon : slimeMonArray){\r\n\t\t\t\tif(slimeMon.isVisible()){\r\n\t\t\t\t\tr2.set(slimeMon.getCollisionBox());\r\n\t\t\t\t\tif (!r1.overlaps(r2)) continue;\r\n\t\t\t\t\toldTime = System.nanoTime();\r\n\t\t\t\t\tsetHealth(health-1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(Math.ceil(this.getColor().a) == 1 && System.nanoTime() - oldTime >= cdTime){\r\n\t\t\tfor(FireMonster fireMon : fireMonArray){\r\n\t\t\t\tif(fireMon.isVisible()){\r\n\t\t\t\t\tr2.set(fireMon.getCollisionBox());\r\n\t\t\t\t\tif (!r1.overlaps(r2)) continue;\r\n\t\t\t\t\toldTime = System.nanoTime();\r\n\t\t\t\t\tsetHealth(health-1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\t\t\tpublic void handle(long now) {\n\t\t\t\tif(flagD && !flagA) {\n\t\t\t\t\tplayer.velocityX = 1;\n\t\t\t\t} else if(flagA && !flagD) {\n\t\t\t\t\tplayer.velocityX = -1;\n\t\t\t\t} else if(flagD && flagA) {\n\t\t\t\t\tplayer.velocityX = 1;\n\t\t\t\t} else if(!flagA && !flagD) {\n\t\t\t\t\tplayer.velocityX = 0;\n\t\t\t\t}\n\t\t\t\t//Flags W & S\n\t\t\t\tif(flagS && !flagW) {\n\t\t\t\t\tplayer.velocityY = 1;\n\t\t\t\t} else if(flagW && !flagS) {\n\t\t\t\t\tplayer.velocityY = -1;\n\t\t\t\t} else if(flagS && flagW) {\n\t\t\t\t\tplayer.velocityY = 1;\n\t\t\t\t} else if(!flagW && !flagS) {\n\t\t\t\t\tplayer.velocityY = 0;\n\t\t\t\t} \n\t\t\t\telse {\n\t\t\t\t\tplayer.velocityX = 0;\n\t\t\t\t\tplayer.velocityY = 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tplayer.setTranslateX(player.getTranslateX() + player.velocityX);\n\t\t\t\tplayer.setTranslateY(player.getTranslateY() + player.velocityY);\n\t\t\t\t\n\t\t\t\tif(collision(player, player2)) {\n\t\t\t\t\tplayer.setFill(Color.YELLOW);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayer.setFill(Color.BLACK);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}", "public void tick() {\n if (!isActive || !entities[0].canCollide || !entities[1].canCollide) {\n return;\n }\n\n rectangles[0].x = boundaries[0].x - 1;\n rectangles[1].x = boundaries[1].x - 1;\n rectangles[0].y = boundaries[0].y - 1;\n rectangles[1].y = boundaries[1].y - 1;\n\n isCollided = rectangles[0].intersects(rectangles[1]);\n\n if (isCollided && !firedEvent) {\n lastEvent = new EntityEntityCollisionEvent(this);\n onCollide();\n start(lastEvent);\n firedEvent = true;\n }\n if (!isCollided && firedEvent) {\n onCollisionEnd();\n end(lastEvent);\n firedEvent = false;\n }\n if (previouslyCollided != isCollided) {\n setBoundaryColors();\n }\n\n previouslyCollided = isCollided;\n }", "public void act() \r\n {\r\n if ( Greenfoot.isKeyDown( \"left\" ) )\r\n {\r\n turn( -5 );\r\n }\r\n\r\n else if ( Greenfoot.isKeyDown( \"right\" ) )\r\n {\r\n turn( 5 );\r\n }\r\n if ( Greenfoot.isKeyDown(\"up\") )\r\n {\r\n move(10);\r\n }\r\n else if ( Greenfoot.isKeyDown( \"down\") )\r\n {\r\n move(-10);\r\n }\r\n if ( IsCollidingWithGoal() )\r\n {\r\n getWorld().showText( \"You win!\", 300, 200 );\r\n Greenfoot.stop();\r\n }\r\n }", "boolean isAlive(Unit unit);" ]
[ "0.6581047", "0.6133172", "0.60728794", "0.5982372", "0.59459984", "0.58908105", "0.5873248", "0.58449006", "0.5816039", "0.5780242", "0.5778615", "0.575816", "0.5758015", "0.5754814", "0.5712857", "0.56850696", "0.5679978", "0.5679918", "0.56459326", "0.5629719", "0.56178945", "0.5611994", "0.560321", "0.55699426", "0.55677265", "0.55602974", "0.5559144", "0.5551103", "0.5537927", "0.552078", "0.5520091", "0.5519106", "0.5516696", "0.55117065", "0.55022156", "0.54983133", "0.5480472", "0.5480039", "0.5470277", "0.5469445", "0.5467585", "0.5434039", "0.5421625", "0.54190975", "0.5412153", "0.54115266", "0.54056597", "0.5404455", "0.54041785", "0.5399525", "0.539886", "0.53944236", "0.5390911", "0.53888446", "0.53860337", "0.53785306", "0.53760487", "0.536828", "0.5353556", "0.534597", "0.53447837", "0.53417265", "0.53389525", "0.53388387", "0.5325345", "0.53244066", "0.5312406", "0.53096086", "0.5307508", "0.5306537", "0.5306459", "0.52998763", "0.5299396", "0.52959186", "0.52826893", "0.528204", "0.52807826", "0.52771795", "0.5273385", "0.52731436", "0.527022", "0.52582264", "0.5257721", "0.52564615", "0.52548534", "0.52538514", "0.5252469", "0.5250555", "0.5248527", "0.52472746", "0.5247009", "0.5244027", "0.52434856", "0.5242452", "0.52399635", "0.52361584", "0.52355194", "0.52315843", "0.5225707", "0.5222644" ]
0.637432
1
Get the LevelEditorSpecs for Orc
public static LevelEditor.LevelEditorItem getLevelEditorSpecs() { return new LevelEditor.LevelEditorItem(Orc.class, FileLoader.getInstance().getOrcImage(PlayerStatus.IDLE, PlayerStatus.Direction.RIGHT, 0)) { @Override public void onPlace(int mouseX, int mouseY) { super.onPlace(mouseX, mouseY); Level level = LevelEditor.getInstance().getLevel(); if (!this.allowedToPlace(mouseX, mouseY)) return; level.addGameObject(new Orc(gridX, gridY)); } }.setRequireGround(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ImmutableList<SchemaOrgType> getEditorList();", "@NotNull\n List<NlComponentEditor> getEditors();", "@Override\n\tpublic java.lang.String getEditorType() {\n\t\treturn _scienceApp.getEditorType();\n\t}", "public List<String> getSpecifications() {\n\t\tString sql =\"select specification from specifications\";\n\t\tList<String> res = jdbcTemplate.queryForList(sql, String.class);\n\t\treturn res;\n\t}", "@Override\n public Set<Committee> getAllCommittee(Editor editor) {\n Set<Committee> committeeSet = new HashSet<>();\n\n\n return committeeSet;\n }", "public Map<String, NGPackageSpecification<WebObjectSpecification>> getWebComponentSpecifications()\n\t{\n\t\treturn reader.getWebComponentSpecifications();\n\t}", "public java.util.List<hr.domain.ResumeDBOuterClass.Education.Builder> \n getEducationsBuilderList() {\n return getEducationsFieldBuilder().getBuilderList();\n }", "public List<DeptAdminUnitEntity> getUnityEntityByParentLevelForDraft(Integer slc,int levelCode, int entityCode) throws Exception {\n\t\treturn organizationDAO.getUnityEntityByParentLevelForDraft(slc, levelCode, entityCode);\n\t}", "public Collection getLevels(){\n List<String> levels = new ArrayList<>();\n File directoryPath = new File(DATA_PATH+gameName+\"/\");\n for (String s : directoryPath.list()) {\n if (isLevelFile(s)){\n levels.add(getLevelName(s));\n }\n }\n Collections.sort(levels);\n return Collections.unmodifiableList(levels);\n }", "public Map<Class, Erector> getErectors() {\n return erectors;\n }", "public LevelEditorView getLvle() {\r\n\t\treturn lvle;\r\n\t}", "public Object getMSecLevelDefs(Map params) {\r\n\t\treturn dhh.getMSecLevelDefs(null);\r\n\t}", "public WebObjectSpecification[] getAllWebComponentSpecifications()\n\t{\n\t\treturn reader.getAllWebComponentSpecifications();\n\t}", "public MapEditor getMapEditor() {\n\t\treturn mapEditor;\n\t}", "public static int getRegisteredEditorCount ()\n {\n return _editors.size();\n }", "public String getEditor() {\n return (String)getAttributeInternal(EDITOR);\n }", "public String getEditor() {\n return (String)getAttributeInternal(EDITOR);\n }", "public Editor getEditor() { return editor; }", "public RiskLevelSelectionModel() {\n\n // get the risk levels\n Set<RiskLevel> riskLevelSet = AgilePlanningObjectFactory.getStoryService().findAllRiskLevel();\n \n // put the risk levels in a list\n riskLevels = new ArrayList<RiskLevel>(riskLevelSet);\n \n }", "public int levelSpec() {\n int avg = 0;\n for (int i = 0; i < spec.length; i++) {\n avg += (int) spec[i];\n }\n return avg / 8192;\n }", "ImmutableList<SchemaOrgType> getEducationalUseList();", "public List<Level> getLevels() {\n return levels;\n }", "@Override\r\n\tpublic GridRecordEditor getGridRecordEditor(String sectionName, ListGrid grid) {\n\t\treturn null;\r\n\t}", "public interface ComboPropertiesEditionPart {\n\n\t/**\n\t * @return the combo\n\t */\n\tpublic Object getCombo();\n\n\t/**\n\t * Init the combo\n\t * @param eClass the eClass to manage\n\t * @param current the current value\n\t */\n\tpublic void initCombo(ResourceSet allResources, EObject current);\n\n\t/**\n\t * Defines a new combo\n\t * @param newValue the new combo to set\n\t */\n\tpublic void setCombo(Object newValue);\n\n\t/**\n\t * Adds the given filter to the combo edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t */\n\tpublic void addFilterToCombo(ViewerFilter filter);\n\n\n\n\n\n\n\t/**\n\t * @return the comboRO\n\t */\n\tpublic Object getComboRO();\n\n\t/**\n\t * Init the comboRO\n\t * @param eClass the eClass to manage\n\t * @param current the current value\n\t */\n\tpublic void initComboRO(ResourceSet allResources, EObject current);\n\n\t/**\n\t * Defines a new comboRO\n\t * @param newValue the new comboRO to set\n\t */\n\tpublic void setComboRO(Object newValue);\n\n\t/**\n\t * Adds the given filter to the comboRO edition editor.\n\t * \n\t * @param filter\n\t * a viewer filter\n\t * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(ViewerFilter)\n\t */\n\tpublic void addFilterToComboRO(ViewerFilter filter);\n\n\n\n\n\n\n\n\n\n\n\t/**\n\t * Returns the internationalized title text.\n\t * \n\t * @return the internationalized title text.\n\t */\n\tpublic String getTitle();\n\n\t// Start of user code for additional methods\n\t\n\t// End of user code\n\n}", "public Component getEditorComponent ()\r\n {\r\n return editor;\r\n }", "java.util.List<org.stu.projector.Orientation> \n getOrientationsList();", "public PetalEditor getEditor() {\n return petal_editor;\n }", "@Override\n public String getEntLS() {\n return \"Enemies\";\n }", "public static ArrayList<PCSpec> getEnaSpec() {\r\n return enaSpec;\r\n }", "public Lecturers getLecTable();", "public List<LevelProduct> getLevelProductList() {\n return productToolOperation.getConfiguredProductLevel(planConfigBehavior.getTemplatePlanLevelSet());\n }", "protected abstract Level[] getLevelSet();", "@Override\n\tpublic String specs() {\n\t\treturn \"Sedan from Toyota with engine verion \"+engine.type();\n\t}", "public TopEntityEditor getTopEditor() {\n if (topEditor == null) {\n try {\n if (entity == null) {\n entity = createEntity();\n }\n if (entity == null) {\n return null;\n }\n topEditor = new TopEntityEditor(entity, getEditorDao());\n currentEditor = topEditor;\n } catch (InvalidEntityBeanPropertyException iepex) {\n throw new RuntimeException(\"Failed to instantiate EntityEditorManager topEditor - invalid entity bean property exception thrown while creating TopEntityEditor\", iepex);\n } catch (Exception ex) {\n throw new RuntimeException(\"Exception while creating a new entity in EntityEditorManager.createEntity()\", ex);\n }\n }\n return topEditor;\n }", "@Override\n\tpublic java.lang.String getOpenLevel() {\n\t\treturn _scienceApp.getOpenLevel();\n\t}", "private MenuManager createEditMenu() {\n\t\tMenuManager menu = new MenuManager(\"&Edition\", Messages.getString(\"IU.Strings.40\")); //$NON-NLS-1$ //$NON-NLS-2$\n\t\tmenu.add(new GroupMarker(Messages.getString(\"IU.Strings.41\"))); //$NON-NLS-1$\n\n\t\tmenu.add(getAction(ActionFactory.UNDO.getId()));\n\t\tmenu.add(getAction(ActionFactory.REDO.getId()));;\n\n\t\tmenu.add(new GroupMarker(IWorkbenchActionConstants.UNDO_EXT));\n\t\tmenu.add(new Separator());\n\t\tmenu.add(getAction(ActionFactory.CUT.getId()));\n\t\tmenu.add(getAction(ActionFactory.COPY.getId()));\n\t\tmenu.add(getAction(ActionFactory.PASTE.getId()));\n\t\tmenu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT));\n\t\tmenu.add(new Separator());\n\t\tmenu.add(getAction(ActionFactory.DELETE.getId()));\n\t\tmenu.add(getAction(ActionFactory.SELECT_ALL.getId()));\n\t\tmenu.add(getAction(ActionFactory.FIND.getId()));\n\t\tmenu.add(new Separator());\n\t\tmenu.add(getAction(ActionFactory.PREFERENCES.getId()));\n\t\treturn menu;\n\t}", "@Override\n public List<UnitModifier> getModifiers()\n {\n ArrayList<UnitModifier> output = new ArrayList<>();\n output.addAll(model.getModifiers());\n output.addAll(CO.getModifiers());\n output.addAll(unitMods);\n return output;\n }", "public RenderObject[] getRenderObjects(){\n\t\tRenderObject[] objects = new RenderObject[sectors.length * sectors[0].length];\n\t\tfor(int i = 0; i < sectors.length; i++){\n\t\t\tfor(int j = 0 ; j < sectors[0].length; j++){\n\t\t\t\tobjects[i * sectors.length + j] = sectors[j][i].getRenderObject();\n\t\t\t}\n\t\t}\n\t\treturn objects;\n\t}", "public InitialValueEditor getInitEditor() {\n return initEditor;\n }", "public Map<SkillType, Integer> getLevels() {\n return levels;\n }", "public TournamentEditorConstraints getTournamentEditorConstraints();", "public String getLevels() {\r\n\t\treturn levels;\r\n\t}", "public ArrayList<Entity> getComponents(int levelNum) {\n\n\t\tArrayList<Entity> entities = new ArrayList<Entity>();\n\n\t\tScanner scnr = TextFileReader.getScannedFile(\"LH_Level\" + levelNum, directory);\n\n\t\tif (scnr == null) {\n\t\t\tSystem.out.println(\"Failed to find level\" + levelNum);\n\t\t\treturn null;\n\t\t}\n\n\t\twhile (scnr.hasNextLine()) {\n\n\t\t\tString line = scnr.nextLine();\n\t\t\tString[] details = line.split(\",\");\n\n\t\t\tString type = details[0];\n\t\t\tString detail1 = details[1];\n\n\t\t\tif (type.equals(\"component\")) {\n\t\t\t\tif (detail1.equals(\"rectangle\")) {\n\t\t\t\t\tentities.add(addRectangle(details, 2));\n\t\t\t\t}\n\t\t\t\tif (detail1.equals(\"floor\")) {\n\t\t\t\t\tentities.add(addFloor(details, 2));\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn entities;\n\t}", "public Integer geteLevel() {\n return eLevel;\n }", "public Set<AlfClass> getSpecializations()\r\n\t{\treturn Collections.unmodifiableSet(this.specializations);\t}", "public double[][] getLevelSet() {\r\n\t\treturn _levelSet;\r\n\t}", "ImmutableList<SchemaOrgType> getMainEntityList();", "public java.beans.PropertyDescriptor[] getPropertyDescriptors()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tfinal java.beans.PropertyDescriptor[] res =\n\t\t\t\t{ prop(\"TargetType\", \"the type of vessel this model is evading\"),\n\t\t\t\t\t\tprop(\"Name\", \"the name of this detonation model\"),\n\t\t\t\t\t\tprop(\"DetectionLevel\", \"the name of this detonation model\"), };\n\t\t\t\tres[2]\n\t\t\t\t\t\t.setPropertyEditorClass(DetectionEvent.DetectionStatePropertyEditor.class);\n\t\t\t\treturn res;\n\t\t\t}\n\t\t\tcatch (java.beans.IntrospectionException e)\n\t\t\t{\n\t\t\t\treturn super.getPropertyDescriptors();\n\t\t\t}\n\t\t}", "public static String[] getLevels() {\n\t\treturn levels;\n\t}", "public List<OasisEditIF> getEditIdsUsed() {\n return super.getEditIdsUsed_base(OasisEditsEN.EDIT_3060, OasisEditsEN.EDIT_3880, OasisEditsEN.EDIT_3890);\n }", "public List<HealthInspectorsInfo> availableInspectors() {\n return INSPECTORS.stream().map(HealthInspectorsInfo::new).collect(Collectors.toList());\n }", "public List getOredCriteria() {\n\t\treturn oredCriteria;\n\t}", "private String getLevelChars(int level){\t\t\t\n\t\tFileHandle levelFile = Gdx.files.internal(\"levels/level_\" + level);\t\t\t\n\t\treturn levelFile.readString();\n\t}", "public short getElmLevel() {\r\n return elmLevel;\r\n }", "public OtlSourcesImpl getOtlSources() {\r\n return (OtlSourcesImpl)getEntity(0);\r\n }", "public List<EnumerationValue> getGenders()\r\n\t{\r\n\t\treturn getGenders( getSession().getSessionContext() );\r\n\t}", "public TreeTableCellEditor getEditor() {\n return treeTableCellEditor;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.String getBookEdition();", "public BaseEditorPanel getEditorPanel ()\n {\n return _epanel;\n }", "public Component getCustomEditor() {\n\t\treturn mEditor;\n\t}", "public List<ColumnSpec> getColumnSpecs() {\n\t\treturn columnSpecs;\n\t}", "public List<Developer> getAll2(String edition) {\n\t\t\tDeveloperExample example=new DeveloperExample();\n\t\t\tcom.wdc.bean.DeveloperExample.Criteria criteria = example.createCriteria();\n\t\t\tcriteria.andEditionEqualTo(edition);\n\t\t\treturn developerMapper.selectByExample(example);\n\t\t}", "private static Loot choosespecialedition() {\r\n final List<Loot> suitableLoot = new ArrayList<Loot>();\r\n // FIND ALL LOOT TYPES\r\n for (final Location loc : i.location) {\r\n if (loc.renting() == null) {\r\n continue;\r\n }\r\n for (final AbstractItem<? extends AbstractItemType> l : loc.lcs().loot) {\r\n if (!(l instanceof Loot)) {\r\n continue;\r\n }\r\n // Temporary, maybe put special edition definition into an xml\r\n // file. -XML\r\n if (l.id().equals(\"LOOT_CEOPHOTOS\") || l.id().equals(\"LOOT_CEOLOVELETTERS\")\r\n || l.id().equals(\"LOOT_CEOTAXPAPERS\") || l.id().equals(\"LOOT_INTHQDISK\")\r\n || l.id().equals(\"LOOT_CORPFILES\") || l.id().equals(\"LOOT_JUDGEFILES\")\r\n || l.id().equals(\"LOOT_RESEARCHFILES\") || l.id().equals(\"LOOT_PRISONFILES\")\r\n || l.id().equals(\"LOOT_CABLENEWSFILES\") || l.id().equals(\"LOOT_AMRADIOFILES\")\r\n || l.id().equals(\"LOOT_SECRETDOCUMENTS\") || l.id().equals(\"LOOT_POLICERECORDS\")) {\r\n continue;\r\n }\r\n suitableLoot.add((Loot) l);\r\n }\r\n }\r\n for (final Squad sq : i.squad) {\r\n for (final AbstractItem<? extends AbstractItemType> l : sq.loot()) {\r\n if (!(l instanceof Loot)) {\r\n continue;\r\n }\r\n // Temporary, maybe put special edition definition into an xml\r\n // file. -XML\r\n if (l.id().equals(\"LOOT_CEOPHOTOS\") || l.id().equals(\"LOOT_CEOLOVELETTERS\")\r\n || l.id().equals(\"LOOT_CEOTAXPAPERS\") || l.id().equals(\"LOOT_INTHQDISK\")\r\n || l.id().equals(\"LOOT_CORPFILES\") || l.id().equals(\"LOOT_JUDGEFILES\")\r\n || l.id().equals(\"LOOT_RESEARCHFILES\") || l.id().equals(\"LOOT_PRISONFILES\")\r\n || l.id().equals(\"LOOT_CABLENEWSFILES\") || l.id().equals(\"LOOT_AMRADIOFILES\")\r\n || l.id().equals(\"LOOT_SECRETDOCUMENTS\") || l.id().equals(\"LOOT_POLICERECORDS\")) {\r\n continue;\r\n }\r\n suitableLoot.add((Loot) l);\r\n }\r\n }\r\n if (suitableLoot.size() == 0) {\r\n return new Loot(\"LOOT_DIRTYSOCK\");\r\n }\r\n // PICK ONE\r\n do {\r\n ui().text(\"Do you want to run a special edition?\").bold().add();\r\n int y = 'a';\r\n for (final Loot l : suitableLoot) {\r\n ui(R.id.gcontrol).button(y++).text(l.toString()).add();\r\n }\r\n ui(R.id.gcontrol).button(10).text(\"Not in this month's Liberal Guardian\").add();\r\n final int c = getch();\r\n if (c == 10) {\r\n return null;\r\n }\r\n if (c >= 'a') {\r\n final Loot rval = suitableLoot.get(c - 'a');\r\n for (final Squad sq : i.squad) {\r\n sq.loot().remove(rval);\r\n }\r\n for (final Location loc : i.location) {\r\n loc.lcs().loot.remove(rval);\r\n }\r\n return rval;\r\n }\r\n } while (true);\r\n }", "public String getChiefEditor() {\n return (String)getAttributeInternal(CHIEFEDITOR);\n }", "public java.util.ArrayList getEditRoles() {\n\tjava.util.ArrayList roles = new java.util.ArrayList();\n\troles.add(\"administrator\");\n\troles.add(\"StorageManager\");\n\treturn roles;\n}", "protected ITextEditor getEditor() {\n return editor;\n }", "public List<Criteria> getOredCriteria() {\n\t\treturn oredCriteria;\n\t}", "public List<Criteria> getOredCriteria() {\n\t\treturn oredCriteria;\n\t}", "public List<Criteria> getOredCriteria() {\n\t\treturn oredCriteria;\n\t}", "public List<Criteria> getOredCriteria() {\n\t\treturn oredCriteria;\n\t}", "public List<Criteria> getOredCriteria() {\n\t\treturn oredCriteria;\n\t}", "public List<Criteria> getOredCriteria() {\n\t\treturn oredCriteria;\n\t}", "public List<Criteria> getOredCriteria() {\n\t\treturn oredCriteria;\n\t}", "public List<Criteria> getOredCriteria() {\n\t\treturn oredCriteria;\n\t}", "public List<Criteria> getOredCriteria() {\n\t\treturn oredCriteria;\n\t}", "public List<Criteria> getOredCriteria() {\n\t\treturn oredCriteria;\n\t}", "public List<Criteria> getOredCriteria() {\n\t\treturn oredCriteria;\n\t}", "public List<Criteria> getOredCriteria() {\n\t\treturn oredCriteria;\n\t}", "ImmutableList<SchemaOrgType> getCharacterList();", "public List<Criteria> getOredCriteria() {\n return oredCriteria;\n }", "public List<Criteria> getOredCriteria() {\n return oredCriteria;\n }", "public List<Criteria> getOredCriteria() {\n return oredCriteria;\n }", "public List<Criteria> getOredCriteria() {\n return oredCriteria;\n }", "public List<Criteria> getOredCriteria() {\n return oredCriteria;\n }", "public List<Criteria> getOredCriteria() {\n return oredCriteria;\n }", "public List<Criteria> getOredCriteria() {\n return oredCriteria;\n }", "public List<Criteria> getOredCriteria() {\n return oredCriteria;\n }", "public List<Criteria> getOredCriteria() {\n return oredCriteria;\n }", "public List<Criteria> getOredCriteria() {\n return oredCriteria;\n }", "public List<Criteria> getOredCriteria() {\n return oredCriteria;\n }", "public List<Criteria> getOredCriteria() {\n return oredCriteria;\n }", "public List<Criteria> getOredCriteria() {\n return oredCriteria;\n }", "public List<Criteria> getOredCriteria() {\n return oredCriteria;\n }", "public List<Criteria> getOredCriteria() {\n return oredCriteria;\n }", "public List<Criteria> getOredCriteria() {\n return oredCriteria;\n }", "public List<Criteria> getOredCriteria() {\n return oredCriteria;\n }", "public List<Criteria> getOredCriteria() {\n return oredCriteria;\n }", "public List<Criteria> getOredCriteria() {\n return oredCriteria;\n }", "public List<Criteria> getOredCriteria() {\n return oredCriteria;\n }", "public List<Criteria> getOredCriteria() {\n return oredCriteria;\n }" ]
[ "0.59610206", "0.5732508", "0.48487622", "0.4828527", "0.4823871", "0.47986415", "0.4790784", "0.47489178", "0.47102708", "0.46962327", "0.46840787", "0.46634898", "0.46567455", "0.46473467", "0.46429074", "0.4627899", "0.4627899", "0.46164972", "0.46161", "0.45865116", "0.45842177", "0.4578387", "0.45653802", "0.4565204", "0.45418036", "0.45288444", "0.45236614", "0.4522477", "0.44986266", "0.4490289", "0.44647044", "0.44602463", "0.44526193", "0.44335294", "0.4430573", "0.44142315", "0.43784148", "0.43598077", "0.43575943", "0.43555436", "0.43381512", "0.43285722", "0.4321558", "0.43211943", "0.43158883", "0.431257", "0.43116054", "0.43102348", "0.4307013", "0.43014324", "0.43010312", "0.42856154", "0.4282645", "0.42825824", "0.42820784", "0.42819026", "0.42780876", "0.4273379", "0.4260906", "0.4259989", "0.425787", "0.42486495", "0.4247475", "0.42462194", "0.42459813", "0.42445207", "0.42440018", "0.42440018", "0.42440018", "0.42440018", "0.42440018", "0.42440018", "0.42440018", "0.42440018", "0.42440018", "0.42440018", "0.42440018", "0.42440018", "0.42434096", "0.42379552", "0.42379552", "0.42379552", "0.42379552", "0.42379552", "0.42379552", "0.42379552", "0.42379552", "0.42379552", "0.42379552", "0.42379552", "0.42379552", "0.42379552", "0.42379552", "0.42379552", "0.42379552", "0.42379552", "0.42379552", "0.42379552", "0.42379552", "0.42379552" ]
0.79372805
0
TODO Autogenerated method stub
@Override public void actionPerformed(ActionEvent e) { if(e.getSource() == this.btn){ if(!this.txtf2.getText().equals(null) && !this.txtf1.getText().equals(null)){ Modele.ajouteDestination(this.txtf1.getText(),this.txtf2.getText()); this.txt3 = new JLabel("Votre Destination a bien été ajouter a la base de donnee."); this.add(this.txt3); revalidate(); }else{ this.txt3 = new JLabel("Veuillez saisir tout les champs."); this.add(this.txt3); revalidate(); } } }
{ "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
This assigns the recyclerviewAdapter to the recycler view
@Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); // Set the Recycler View Adapter Context context = view.getContext(); mRecyclerView.setLayoutManager(new LinearLayoutManager(context)); mRecyclerView.setAdapter(moviesRViewAdapter); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setRecyclerAdapter() {\n if (mRecyclerAdapter == null) {\n mRecyclerAdapter = new IssueResultsRecyclerAdapter(this, issueResult, mNation);\n mRecyclerView.setAdapter(mRecyclerAdapter);\n } else {\n ((IssueResultsRecyclerAdapter) mRecyclerAdapter).setContent(issueResult, mNation);\n }\n }", "private void populateAdapter(){\n mAdapter = new MovieRecyclerAdapter(context, moviesList, this);\n mRecyclerView.setAdapter(mAdapter);\n }", "private void setDataInRecyclerView() {\n LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());\n recyclerView.setLayoutManager(linearLayoutManager);\n // call the constructor of UsersAdapter to send the reference and data to Adapter\n ReviewAdapter reviewAdapter = new ReviewAdapter(reviewListResponseData, this);\n recyclerView.setAdapter(reviewAdapter); // set the Adapter to RecyclerView\n }", "private void setAdapter() {\n adapter = new MessageAdapter(messages);\n RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());\n recyclerView.setLayoutManager(mLayoutManager);\n recyclerView.setItemAnimator(new DefaultItemAnimator());\n recyclerView.setAdapter(adapter);\n }", "private void setAdapter() {\n resultsRv.setLayoutManager(new LinearLayoutManager(getActivity()));\n resultsRv.setHasFixedSize(true);\n resultsRv.setItemAnimator(new DefaultItemAnimator());\n resultsRv.setAdapter(resultsListAdapter);\n }", "private void initRecyclerview() {\n RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this);\n recyclerView.setLayoutManager(layoutManager);\n\n mAdapter = new MovieAdapter(this);\n recyclerView.setAdapter(mAdapter);\n }", "private void setUpRecycler() {\n recyclerView = (RecyclerView) findViewById(R.id.recycler_view);\n mAdapter = new ConverterAdapter(this, currencyList);\n RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());\n recyclerView.setLayoutManager(mLayoutManager);\n recyclerView.setItemAnimator(new DefaultItemAnimator());\n ItemTouchHelper.Callback callback =\n new ItemMoveCallback(mAdapter);\n ItemTouchHelper touchHelper = new ItemTouchHelper(callback);\n touchHelper.attachToRecyclerView(recyclerView);\n recyclerView.setAdapter(mAdapter);\n }", "private void configureRecyclerView(){\r\n // - Reset list\r\n this.users = new ArrayList<>();\r\n // - Create adapter passing the list of Restaurants\r\n this.mCoworkerAdapter = new CoWorkerAdapter(this.users, Glide.with(this), true);\r\n // - Attach the adapter to the recyclerview to populate items\r\n this.recyclerView.setAdapter(this.mCoworkerAdapter);\r\n // - Set layout manager to position the items\r\n this.recyclerView.setLayoutManager(new LinearLayoutManager(RestaurantDetailActivity.this));\r\n }", "private void setupRecyclerView(@NonNull RecyclerView recyclerView) {\r\n myAdapter = new SimpleItemRecyclerViewAdapter(model.getShelters());\r\n recyclerView.setAdapter(myAdapter);\r\n }", "private void setDataInRecyclerView() {\n LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());\n recyclerView.setLayoutManager(linearLayoutManager);\n // call the constructor of UsersAdapter to send the reference and data to Adapter\n UsersAdapter usersAdapter = new UsersAdapter(getActivity(), userListResponseData);\n recyclerView.setAdapter(usersAdapter); // set the Adapter to RecyclerView\n }", "private void setDataInRecyclerView(){\n KorisniciAdapter adapter = new KorisniciAdapter(this, korisniciList);\n recyclerView.setAdapter(adapter); // set the Adapter to RecyclerView\n }", "public void setupAdapter() {\n recyclerAdapter = new PhotosAdapter(this);\n recyclerViewPhotos.setAdapter(recyclerAdapter);\n }", "public void initRecyclerView() {\n\r\n\r\n recyclerView.setHasFixedSize(true);\r\n recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));\r\n\r\n\r\n adapter = new LokerAdapter(getContext(), itemList);\r\n recyclerView.setAdapter(adapter);\r\n\r\n }", "public void setRecyclerView(){\n recyclerView.setLayoutManager(new LinearLayoutManager(this));\n RealmResults<TodoItemModel> toDoItems = realm.where(TodoItemModel.class).findAllAsync();\n TodoItemAdapter adapter = new TodoItemAdapter(this, toDoItems);\n recyclerView.setHasFixedSize(true);\n recyclerView.addItemDecoration(new SimpleDividerItemDecoration(this));\n recyclerView.setAdapter(adapter);\n }", "private void setAdapter(){\n ArrayList<Veranstaltung>ver = new ArrayList<>(studium.getLVS());\n recyclerView = findViewById(R.id.rc);\n LinearLayoutManager manager = new LinearLayoutManager(this);\n recyclerView.setLayoutManager(manager);\n recyclerView.setHasFixedSize(true);\n adapter = new StudiumDetailsRecylerAdapter(ver);\n recyclerView.setAdapter(adapter);\n }", "@Override\n public void setRecyclerViewAdapter() {\n recyclerView.setAdapter(favouritePageRecyclerViewAdapter);\n\n }", "private void configureRecyclerView(){\n this.postAdapter = new PostAdapter(generateOptionsForAdapter(PostHelper.getAllMyPosts(BaseActivity.getUid())),\n Glide.with(this), this,false, false);\n\n\n recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));\n recyclerView.setAdapter(this.postAdapter);\n }", "private void setupRecyclerView() {\r\n\r\n LinearLayoutManager layoutManager = new LinearLayoutManager\r\n (getContext(), LinearLayoutManager.VERTICAL, false);\r\n if (adapter == null) {\r\n adapter = new SchoolAdapter(getContext(), schoolList);\r\n recyclerView.setLayoutManager(layoutManager);\r\n recyclerView.setAdapter(adapter);\r\n recyclerView.setItemAnimator(new DefaultItemAnimator());\r\n recyclerView.setNestedScrollingEnabled(true);\r\n } else {\r\n adapter.notifyDataSetChanged();\r\n }\r\n }", "private void iniRecyclerView() {\n// RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view);\n// recyclerView.setHasFixedSize(true);\n recyclerView.setLayoutManager(new LinearLayoutManager(this));\n recyclerView.setAdapter(presAdapter);\n }", "private void setupRecyclerView() {\r\n recyclerView = rootView.findViewById(R.id.recycler_view);\r\n animeAdapter = new AnimeAdapter(this, this);\r\n recyclerView.setAdapter(animeAdapter);\r\n recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));\r\n }", "private void setupRecyclerView(@NonNull RecyclerView recyclerView) {\n if(mForumList != null) {\n recyclerView.setAdapter(new SimpleItemRecyclerViewAdapter((HomeActivity) getActivity(), mForumList, mTwoPane));\n }\n }", "private void setRecycleView(){\n\n RecyclerView recyclerView = findViewById(R.id.recycler_view);\n RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());\n recyclerView.setLayoutManager(mLayoutManager);\n recyclerView.setItemAnimator(new DefaultItemAnimator());\n recyclerView.setAdapter(multiViewAdapter);\n }", "private void setUpRecyclerView() {\n\n if (listOfPlants.size() == 0) {\n populatePlantList();\n }\n\n mRecyclerView.setHasFixedSize(true);\n mLayoutManager = new LinearLayoutManager(getContext());\n mAdapter = new RecyclerViewAdapter(listOfPlants, getActivity());\n mRecyclerView.setLayoutManager(mLayoutManager);\n mRecyclerView.setAdapter(mAdapter);\n }", "private void initRecyclerView(){\n facility_RCV_result.setHasFixedSize(true);\n layoutManager = new LinearLayoutManager(this.getContext());\n facility_RCV_result.setLayoutManager(layoutManager);\n mAdapter = new FacilityRecyclerViewAdapter(facilityArrayList);\n facility_RCV_result.setAdapter(mAdapter);\n }", "private void setRecyclerViewData() {\n }", "private void setRecyclerViewData() {\n\n itemList = new ArrayList<ListItem>();\n itemList.add(new RememberCardView(\"Du musst 12€ zahlen\"));\n itemList.add(new DateCardItem(\"Mo\", \"29.07.\", \"Training\", \"20:00\", \"21:45\"));\n itemList.add(new VoteCardItem(\"Welche Trikotfarbe ist besser?\"));\n }", "@Override\n public void run() {\n\n\n RecyclerView.Adapter adapter = new RecyclerViewAdapter(aa,aa1,aa4,aa5,aa6,aa7,aa8,aa9);\n\n recyclerview.setAdapter(adapter);\n\n\n\n }", "private void prepareRecyclerView() {\n equipmentInventoryListAdapter = new EquipmentInventoryListAdapter_v2(equipmentInventoryAvailableCallback, equipmentInventoryMissingCallback);\n GridLayoutManager layoutManager = new GridLayoutManager(getContext(), 2);\n binding.equipmentInventoryList.setLayoutManager(layoutManager);\n binding.equipmentInventoryList.setAdapter(equipmentInventoryListAdapter);\n //binding.equipmentInventoryList.addItemDecoration(new DividerItemDecoration(binding.equipmentInventoryList.getContext(), DividerItemDecoration.HORIZONTAL));\n }", "public void setRecyclerView() {\n mRecyclerView = view.findViewById(R.id.fragment_notifications_today_rv); //instantiating the recyclerview\n mRecyclerView.setHasFixedSize(true); //\n\n // Setting the layout manager for the recycler view\n mLayoutManager = new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false); //instantiates how the layout should look like for recyclerview\n mRecyclerView.setLayoutManager(mLayoutManager); //sets the layout manager to one chosen\n\n // Setting the custom adapter for the recycler view\n mAdapter = new NotificationsTodayAdapter(this,\n (NotificationsTodayContract.Presenter.AdapterAPI) mPresenter); //instantiates the adapter\n mRecyclerView.setAdapter(mAdapter); //sets the adapter\n //notificationsScreenController.listenTodayRecyclerView(mRecyclerView, notificationResponse);\n// mPresenter.listenTodayRecyclerView(mRecyclerView, notificationResponse);\n }", "private void setupRecycler() {\n final LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());\n RecyclerView attractionsRecycler = (RecyclerView) getActivity().findViewById(R.id.contentMain_attractionsRecycler);\n attractionsRecycler.setLayoutManager(linearLayoutManager);\n\n attractionsAdapter = new AttractionRowAdapter(getActivity(), FavouritesListFragment.this, DataManager.currentFavouritesList);\n attractionsRecycler.setAdapter(attractionsAdapter);\n }", "private void setUpRecyclerview(){\r\n mRecyclerview = (RecyclerView) findViewById(R.id.roomRecView);\r\n LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);\r\n mRecyclerview.setLayoutManager(linearLayoutManager);\r\n mRecyclerview.setHasFixedSize(true);\r\n mRoomRecyclerview = new RoomRecyclerview(this,mQuery,mAdapterItems,mAdapterKeys);\r\n mRecyclerview.setAdapter(mRoomRecyclerview);\r\n RecyclerView.ItemAnimator itemAnimator = new DefaultItemAnimator();\r\n itemAnimator.setAddDuration(1000);\r\n itemAnimator.setRemoveDuration(1000);\r\n itemAnimator.setChangeDuration(1000);\r\n itemAnimator.setMoveDuration(1000);\r\n mRecyclerview.setItemAnimator(itemAnimator);\r\n\r\n }", "private void setUpRecycler() {\n Log.d(\"MainActivity\", \"setUpRecycler : start\");\n // Connecting the recyclerview to the view in the layout\n prayerRecyclerView = findViewById(R.id.recycler_main_movie);\n\n // Creating our custom adapter\n prayerRecyclerAdapter = new PrayerRecyclerAdapter(this, prayerList);\n Log.d(\"MainActivity\", \"setUpRecycler : prayerList = \" + prayerList.size());\n // Setting the adapter to our recyclerview\n prayerRecyclerView.setAdapter(prayerRecyclerAdapter);\n\n // Creating and setting a layout manager.\n // Note that the manager is VERTICAL, thus a vertical list\n LinearLayoutManager layout = new LinearLayoutManager(\n this, LinearLayoutManager.VERTICAL, false);\n prayerRecyclerView.setLayoutManager(layout);\n Log.d(\"MainActivity\", \"setUpRecycler : stop\");\n }", "private void setUpRecycler(RecyclerView recyclerView) {\n\n recyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));\n FirebaseRecyclerOptions<Post> options = new FirebaseRecyclerOptions.Builder<Post>()\n .setQuery(DBUtils.getReferencePost(), Post.class).build();\n adapter = new PostAdapter(options, requireContext());\n recyclerView.setAdapter(adapter);\n }", "public void initRecyclerView() {\n rvTodos = (RecyclerView) findViewById(R.id.rvTodos);\n\n // Create adapter passing in the sample user data\n TodoAdapter adapter = new TodoAdapter(todos, this);\n // Attach the adapter to the recyclerview to populate items\n rvTodos.setAdapter(adapter);\n // Set layout manager to position the items\n LinearLayoutManager mLayoutManager = new LinearLayoutManager(this);\n mLayoutManager.setReverseLayout(true);\n mLayoutManager.setStackFromEnd(true);\n rvTodos.setLayoutManager(mLayoutManager);\n // That's all!\n }", "private void initRecyclerView() {\n RecyclerView recyclerview = findViewById(R.id.projectList);\n RecyclerViewAdapter adapter = new RecyclerViewAdapter(projectNames, this);\n recyclerview.setAdapter(adapter);\n final LinearLayoutManager layoutManager = new LinearLayoutManager(this);\n layoutManager.setOrientation(LinearLayoutManager.VERTICAL);\n recyclerview.setLayoutManager(layoutManager);\n }", "@Override\n public void onAttachedToRecyclerView(RecyclerView recyclerView) {\n super.onAttachedToRecyclerView(recyclerView);\n\n this.recyclerView =recyclerView;\n }", "private void setupRecycler() {\n realmRecycler.setHasFixedSize(true);\n // use a linear layout manager since the cards are vertically scrollable\n //final LinearLayoutManager layoutManager = new LinearLayoutManager(this);\n final LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());\n layoutManager.setOrientation(LinearLayoutManager.VERTICAL);\n realmRecycler.setLayoutManager(layoutManager);\n // create an empty adapter and add it to the recycler view\n //realmJarsAdapter = new JarsAdapter(this);\n realmJarsAdapter = new JarsAdapter(getContext());\n realmRecycler.setAdapter(realmJarsAdapter);\n }", "private void initRecyclerView() {\n Log.d(TAG, \"initRecyclerView: init recyclerView.\");\n RecyclerView recyclerView = findViewById(R.id.homepage_recycview);\n\n //Create an adapter to display the groups' information in a recyclerview\n GroupRVA adapter = new GroupRVA(this, results, GroupProfile.class);\n recyclerView.setAdapter(adapter);\n recyclerView.setLayoutManager(new LinearLayoutManager(this));\n }", "public void setRecycler(){\n GridLayoutManager manager=new GridLayoutManager(context,2,LinearLayoutManager.HORIZONTAL,\n false);\n\n recyclerView.setLayoutManager(manager);\n recyclerView.setHasFixedSize(true);\n MainMenuAdapter mainMenuAdapter=new MainMenuAdapter(menuRows,context,true);\n recyclerView.setAdapter(mainMenuAdapter);\n }", "private void initRecyclerView() {\r\n visitsViewModel.setPlaceholderText(true);\r\n\r\n RecyclerView mRecyclerView = binding.gridRecyclerView;\r\n mRecyclerView.setHasFixedSize(true);\r\n mRecyclerView.setLayoutManager(new LinearLayoutManager(activity));\r\n\r\n visitsAdapter = new VisitsAdapter();\r\n mRecyclerView.setAdapter(visitsAdapter);\r\n\r\n visitsViewModel.visits.observe(getViewLifecycleOwner(), this::resetRecycler);\r\n }", "private void setAdapter() {\n AdapterSymptomList adapter = new AdapterSymptomList(allSymptomsList, ActivityRecordsListSymptoms.this);\n RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(ActivityRecordsListSymptoms.this);\n symptomRecyclerView.setLayoutManager(layoutManager);\n symptomRecyclerView.setItemAnimator(new DefaultItemAnimator());\n symptomRecyclerView.setAdapter(adapter);\n }", "private void setRecyclerViewAdapter(List<Task> tasks){\n adapter = new DataAdapter(ViewTaskActivity.this, tasks);\n recyclerView.setAdapter(adapter);\n recyclerView.setLayoutManager(layoutManager);\n }", "private void setUpRecyclerView() {\n ItemTouchHelper itemTouchHelper = new ItemTouchHelper(new SwipeToDeleteCallback(this));\n itemTouchHelper.attachToRecyclerView(recyclerView);\n }", "@Override\n public void run() {\n myAdapter = new MyAdapter(thisCnxt, data);\n recyclerView.setAdapter(myAdapter);\n }", "private void setupRecyclerView() {\n recyclerView.setRecycledViewPool(recycledViewPool);\n\n // We are using a multi span grid to allow two columns of buttons. To set this up we need\n // to set our span count on the controller and then get the span size lookup object from\n // the controller. This look up object will delegate span size lookups to each model.\n controller.setSpanCount(SPAN_COUNT);\n// GridLayoutManager gridLayoutManager = new GridLayoutManager(this.getContext(),SPAN_COUNT);\n StaggeredGridLayoutManager gridLayoutManager = new StaggeredGridLayoutManager(SPAN_COUNT, StaggeredGridLayoutManager.VERTICAL);\n// gridLayoutManager.setSpanSizeLookup(controller.getSpanSizeLookup());\n recyclerView.setLayoutManager(gridLayoutManager);\n\n recyclerView.setHasFixedSize(true);\n// recyclerView.addItemDecoration(new VerticalGridCardSpacingDecoration());\n recyclerView.setItemAnimator(new SampleItemAnimator());\n recyclerView.setAdapter(controller.getAdapter());\n }", "private void llenaRecyclerView() {\n // De manera temporal muestra datos generados manualmente\n generaDatos();\n adapterInst = new InstitucionRecyclerViewAdapter(ListInstitucionActivity.this, mDatos);\n recyclerView.setAdapter(adapterInst);\n progressBar.setVisibility(View.GONE);\n }", "private void ConfigRecyclerMovies(){\n movieRecyclerAdapter = new MovieRecyclerAdapter(this);\n popularMovieRecycler.setAdapter(movieRecyclerAdapter);\n popularMovieRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));\n }", "private void initRecyclerView() {\n mAdapter = new FriendAdapter(new ClickHandler<Author>() {\n @Override\n public void onClick(Author clickedItem) {\n\n // Start the UserActivity for the clicked user to allow the user to confirm this\n // is the person they are trying to connect with\n Intent intent = new Intent(SearchUserActivity.this, UserActivity.class);\n intent.putExtra(AUTHOR_KEY, clickedItem.firebaseId);\n\n startActivity(intent);\n }\n });\n mAdapter.showAddSocialButton(true);\n\n mBinding.searchUserLayout.searchUserRv.setLayoutManager(new LinearLayoutManager(this));\n mBinding.searchUserLayout.searchUserRv.setAdapter(mAdapter);\n }", "private void InitializeAdapter() {\n arrayAdapter = new PlanListRVArrayAdapter(mPlanList);\n recyclerView.setAdapter(arrayAdapter);\n /* arrayAdapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {\n @Override\n public void onChanged() {\n super.onChanged();\n //arrayAdapter.notifyDataSetChanged();\n }\n\n @Override\n public void onItemRangeChanged(int positionStart, int itemCount) {\n // arrayAdapter.notifyItemRangeChanged(positionStart,itemCount);\n }\n\n @Override\n public void onItemRangeInserted(int positionStart, int itemCount) {\n // arrayAdapter.notifyItemRangeRemoved(positionStart,itemCount);\n }\n\n @Override\n public void onItemRangeRemoved(int positionStart, int itemCount) {\n // arrayAdapter.notifyItemRangeRemoved(positionStart,itemCount);\n }\n\n @Override\n public void onItemRangeMoved(int fromPosition, int toPosition, int itemCount) {\n // arrayAdapter.notifyItemMoved(fromPosition,toPosition);\n // TODO itemcount가 1일 경우이므로 1보다 크면 제대로 동작하지 않는다.\n }\n });\n*/\n\n }", "private void setUpBookingRecycler() {\n LinearLayoutManager linearLayoutManager1 = new LinearLayoutManager(mThis);\n linearLayoutManager1.setOrientation(LinearLayoutManager.VERTICAL);\n mBinding.requestRv.setLayoutManager(linearLayoutManager1);\n\n }", "private void initRecyclerView(android.view.View view){\n mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);\n mRecyclerView.setHasFixedSize(true);\n mLayoutManager = new LinearLayoutManager(MainActivity.sContext);\n mRecyclerView.setLayoutManager(mLayoutManager);\n mAdapter = new TopicRecyclerViewAdapter( mPresenter.getDataSet() );\n mRecyclerView.setAdapter(mAdapter);\n\n // Code to Add an item with default animation\n //((TopicRecyclerViewAdapter) mAdapter).addItem(obj, index);\n\n // Code to remove an item with default animation\n //((TopicRecyclerViewAdapter) mAdapter).deleteItem(index);\n }", "private void buildRecyclerView() {\n\n movieRecyclerView = findViewById(R.id.movieRecyclerView);\n\n customAdapter = new CustomAdapter(MovieActivity.this,movieLists);\n movieRecyclerView.setAdapter(customAdapter);\n layoutManager = new GridLayoutManager(this,1);\n movieRecyclerView.setLayoutManager(layoutManager);\n\n }", "private void initRecyclerView(View view) {\n recyclerView = view.findViewById(R.id.lista_regali);\n recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));\n contactGiftAdapter = new ContactGiftAdapter(contacts, getContext(), ShowListFragment.this, this);\n recyclerView.setAdapter(contactGiftAdapter);\n }", "public void setUpRecycler() {\n StaggeredGridLayoutManager gridManager = new StaggeredGridLayoutManager(3,StaggeredGridLayoutManager.VERTICAL);\n gvResults.setLayoutManager(gridManager);\n gvResults.addOnScrollListener(new EndlessRecyclerViewScrollListener(gridManager) {\n @Override\n public void onLoadMore(int page, int totalItemsCount) {\n fetchArticles(page,false);\n }\n });\n }", "private void setRecyclerView(List<StockModel> filterviewStockList) {\n recyclerAdapter = new MarketWatcheRecyclerViewAdapter(getActivity(), filterviewStockList);\n LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false);\n mBinding.RvFeedback.setLayoutManager(linearLayoutManager);\n mBinding.RvFeedback.setAdapter(recyclerAdapter);\n\n }", "private void setAdapter(List<MovieList> listMovies) {\n adapter = new CardAdapter(listMovies, this);\n //Adding adapter to recyclerview\n AlphaInAnimationAdapter alphaAdapter = new AlphaInAnimationAdapter(adapter);\n alphaAdapter.setFirstOnly(false);\n recyclerView.setAdapter(alphaAdapter);\n// recyclerView.setAdapter(adapter);\n }", "private void setupRecyclerview() {\n mQuery = FirebaseDatabase.getInstance().getReference(\"reports\").limitToLast(50).orderByKey();\n RecyclerView recyclerView = (RecyclerView) findViewById(R.id.sightings_master_recyclerview);\n mMyAdapter = new MyAdapter(mQuery, mAdapterItems, mAdapterKeys);\n recyclerView.setLayoutManager(new LinearLayoutManager(this));\n recyclerView.setAdapter(mMyAdapter);\n }", "private void initView() {\n // set layout for recycle view\n //hasFixedSize true if adapter changes cannot affect the size of the RecyclerView\n recyclerView.setHasFixedSize(true);\n // this layout can be vertical or horizontal by change the second param\n // of LinearLayoutManager, and display up to down by set the third param false\n LinearLayoutManager layoutManager = new LinearLayoutManager(this,\n LinearLayoutManager.VERTICAL, false);\n\n recyclerView.setLayoutManager(layoutManager);\n importData();\n // set adapter for recycle view\n recyclerView.setAdapter(alarmAdapter);\n }", "private void setUpRecyclerView() {\n noDataAvailableTextView = (TextView) findViewById(R.id.videoNoDataAvailableTextView);\n videoRecyclerView = (RecyclerView) findViewById(R.id.VideoRecyclerView);\n videoRecyclerView.setHasFixedSize(true);\n LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);\n videoRecyclerView.setLayoutManager(linearLayoutManager);\n }", "public void buildRecyclerView(){\n setOnClickListener();\n RecyclerView reminderRecycler = findViewById(R.id.reminderRecycler);\n reminderRecycler.setHasFixedSize(false);\n RecyclerView.LayoutManager reminderLayoutManager = new LinearLayoutManager(this);\n recyclerAdapter = new RecyclerAdapter(reminderItems, listener);\n reminderRecycler.setLayoutManager(reminderLayoutManager);\n reminderRecycler.setAdapter(recyclerAdapter);\n reminderRecycler.addItemDecoration(new MemberItemDecoration(300));\n }", "protected void setUpListOfImageRecyclerView() {\n try {\n\n content_layout.removeAllViews();\n RecyclerView recyclerView = new RecyclerView(getApplicationContext());\n recyclerView.setLayoutParams(\n new ViewGroup.LayoutParams(\n // or ViewGroup.LayoutParams.WRAP_CONTENT\n ViewGroup.LayoutParams.MATCH_PARENT,\n // or ViewGroup.LayoutParams.WRAP_CONTENT,\n ViewGroup.LayoutParams.MATCH_PARENT));\n\n LinearLayoutManager layoutManager\n = new LinearLayoutManager(getApplicationContext(), LinearLayoutManager.HORIZONTAL, false);\n\n // set main_logo LinearLayoutManager with HORIZONTAL orientation\n recyclerView.setLayoutManager(layoutManager);\n\n // call the constructor of CustomAdapter to send the reference and data to Adapter\n recyclerView.setAdapter(mSelectedImageAdapter); // set the Adapter to RecyclerView\n\n\n content_layout.addView(recyclerView);\n\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "private void setupReviewsList() {\n LinearLayoutManager linearLayoutManager = new LinearLayoutManager(DetailActivity.this, RecyclerView.VERTICAL, false);\n reviewsRecyclerView.setLayoutManager(linearLayoutManager);\n reviewsRecyclerView.setHasFixedSize(true);\n\n //setting up adapter\n ReviewAdapter reviewAdapter = new ReviewAdapter(DetailActivity.this, reviewArrayList);\n reviewsRecyclerView.setAdapter(reviewAdapter);\n }", "private void setCommentRecyclerView(final ArrayList<JsonResponseComment> heritageList){\n final RecyclerView heritageRecyclerView = (RecyclerView) findViewById(R.id.comment_recycler_view);\n final CommentAdapter heritageAdapter = new CommentAdapter(getApplicationContext(),heritageList);\n\n RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());\n heritageRecyclerView.setLayoutManager(mLayoutManager);\n heritageRecyclerView.setItemAnimator(new DefaultItemAnimator());\n heritageRecyclerView.setAdapter(heritageAdapter);\n heritageAdapter.notifyDataSetChanged();\n }", "private void setUpAdapter(){\n customMovieAdapter= new CustomMovieAdapter(getActivity(),R.layout.list_movie_forecast,movieRowItemsList);\n gridView.setAdapter(customMovieAdapter);\n }", "public void setAdapter() {\n datalist = new ArrayList<>();\n\n adapter = new SoundListAdapter(context, datalist, new AdapterClickListener() {\n @Override\n public void onItemClick(View view, int pos, Object object) {\n\n SoundsModel item = (SoundsModel) object;\n\n if (view.getId() == R.id.done) {\n stopPlaying();\n downLoadMp3(item.id, item.sound_name, item.acc_path);\n } else if (view.getId() == R.id.fav_btn) {\n callApiForFavSound(pos, item);\n } else {\n if (thread != null && !thread.isAlive()) {\n stopPlaying();\n playaudio(view, item);\n } else if (thread == null) {\n stopPlaying();\n playaudio(view, item);\n }\n }\n }\n });\n\n recyclerView.setAdapter(adapter);\n\n\n }", "public void configs() {\n adaptadorRecyclerView = new AdaptadorRecyclerView(new ArrayList<>(), this);//configuramos el adaptador; necesitamos implementar interfaz OnItemClickListener y sobreescribir sus metodos\n recyclerView.setLayoutManager(new LinearLayoutManager(this));//configuramos la recyclerView\n recyclerView.setAdapter(adaptadorRecyclerView);\n }", "public void initialiseRecycler(ArrayList<String> deviceID, ArrayList<String>deviceNames){\r\n\r\n\r\n RecyclerView recyclerView = findViewById(R.id.recyclerView);\r\n\r\n\r\n adapterDevices= new MyDevicesAdapterView(this, deviceID, deviceNames);\r\n\r\n recyclerView.setAdapter(adapterDevices);\r\n\r\n recyclerView.setLayoutManager(new LinearLayoutManager(this));\r\n\r\n\r\n }", "private void setDataListReminder() {\n mReminderAdapter = new ReminderAdapter(mReminderDtoList, BaseActivity.this);\n RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(BaseActivity.this, LinearLayoutManager.VERTICAL, false);\n mRecyclerViewReminder.setLayoutManager(mLayoutManager);\n mReminderAdapter.notifyDataSetChanged();\n mRecyclerViewReminder.setAdapter(mReminderAdapter);\n }", "private void setupCategoryRecycler() {\n\t\t// Keep reference of the dataset (arraylist here) in the adapter\n\t\tcategoryRecyclerAdapter = new CategoryRecyclerAdapter(this, categories, this::onCategoryClick);\n\n\t\t// set up the RecyclerView for the categories of team\n\t\tRecyclerView categoryRecycler = findViewById(R.id.categoryRecycler);\n\t\tcategoryRecycler.setAdapter(categoryRecyclerAdapter);\n\t}", "public void setAdapter() {\n binding.RvwalletAmount.setLayoutManager(new GridLayoutManager(getActivity(), 2));\n binding.RvwalletAmount.setHasFixedSize(true);\n WalletAdapter kyCuploadAdapter = new WalletAdapter(getActivity(), getListWallet(), this);\n binding.RvwalletAmount.setAdapter(kyCuploadAdapter);\n }", "private void initDashboardListRecyclerView() {\n GridLayoutManager gridLayoutManager;\n if (AppUtils.isTablet()) {\n gridLayoutManager = new GridLayoutManager(this, 3);\n } else {\n gridLayoutManager = new GridLayoutManager(this, 1);\n\n }\n /* setLayoutManager associates the gridLayoutManager with our RecyclerView */\n mDashboardList.setLayoutManager(gridLayoutManager);\n\n mDashboardList.setItemAnimator(new DefaultItemAnimator());\n\n /*\n * Use this setting to improve performance if you know that changes in content do not\n * change the child layout size in the RecyclerView\n */\n mDashboardList.setHasFixedSize(true);\n\n /*\n * The RecipesListAdapter is responsible for linking our recipes' data with the Views that\n * will end up displaying our recipe data.\n */\n mDashboardListAdapter = new DashboardListAdapter(this);\n\n /* Setting the adapter attaches it to the RecyclerView in our layout. */\n mDashboardList.setAdapter(mDashboardListAdapter);\n\n }", "private void setupMemberRecycler() {\n\t\tRecyclerView memberRecycler = findViewById(R.id.memberRecycler);\n\n\t\t// Keep reference of the dataset (arraylist here) in the adapter\n\t\tmemberRecyclerAdapter = new MemberRecyclerAdapter(this, entity.getMembers());\n\t\tmemberRecyclerAdapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {\n\t\t\t@Override\n\t\t\tpublic void onItemRangeInserted(int positionStart, int itemCount) {\n\t\t\t\tmemberRecycler.getLayoutManager().smoothScrollToPosition(memberRecycler, null, memberRecyclerAdapter.getItemCount());\n\t\t\t}\n\t\t});\n\n\t\tmemberRecycler.setAdapter(memberRecyclerAdapter);\n\t}", "private void bindView() {\n mToolbar = (Toolbar) findViewById(R.id.tb_main);\n mMainLayout = (CoordinatorLayout) findViewById(R.id.crdl_main);\n mProgressDialog = (AVLoadingIndicatorView) findViewById(R.id.avi_progress_dialog);\n mPersonsView = (RecyclerView) findViewById(R.id.rv_persons);\n mPersonsView.setLayoutManager(new LinearLayoutManager(context));\n }", "private void setupMealsRecycler() {\n RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getBaseActivity());\n mViewBinding.mMealsRec.setLayoutManager(layoutManager);\n mViewBinding.mMealsRec.setHasFixedSize(true);\n mViewBinding.mMealsRec.setAdapter(mMealsAdapter);\n mMealsAdapter.setListener(this);\n }", "protected void onCreateRecyclerView(View view){\n // Obtener listado\n mRecyclerView = view.findViewById(R.id.list);\n // Configurar listado\n mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));\n // Asignar view de loading\n mRecyclerView.setLoadingView(R.layout.partial_loading);\n }", "protected void init_adapter()\n {\n manager = new GridLayoutManager(this, 2);\n recycler_view.setLayoutManager(manager);\n //recycler_view.setit\n\n adapter = new NasaApodAdapter();\n\n adapter.setOnItemClickListener(new NasaApodAdapter.OnItemClickListener()\n {\n @Override\n public void onItemClick(Photo photo)\n {\n Log.d(\"APOD\", photo.getImgSrc());\n\n intent = new Intent(getApplicationContext(), DetailActivity.class);\n intent.putExtra(\"photo\", photo);\n\n startActivity(intent);\n }\n });\n }", "private void loadRecyclerViewItem() {\n for (int i = 0; i < mySongs.size(); i++) {\n Song song = new Song(\n mySongs.get(i),\n mySongs.get(i).getName(),\n getTimeSong(mySongs.get(i))\n );\n songsList.add(song);\n }\n songAdapter = new TheAdapter(songsList,this);\n recyclerView.setAdapter(songAdapter);\n songAdapter.notifyDataSetChanged();\n\n }", "public void initiliseRecyclerView(View view){\n // mSwipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.swipe_to_refresh_layout);\n mTrackRecyclerView = (RecyclerView) view.findViewById(R.id.track_recycler_view);\n mTrackRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));\n }", "public ParticipantRecyclerViewAdapter() {\n mMeetingSelected = sApiService.getMeetingSelected();\n }", "public ReviewsAdapter() {\n\t\tmovieReviews = new ArrayList<MovieReview>();\n\t}", "private void setUpBookingAdapter() {\n// mBinding.swipeRefresh.setRefreshing(false);\n if (null == mRequestAdapter) {\n mRequestAdapter = new RequestAdapter(mThis, mRequestModelList, this);\n mBinding.requestRv.setAdapter(mRequestAdapter);\n } else {\n mRequestAdapter.setmBooking_itemModelList(mRequestModelList);\n mRequestAdapter.notifyDataSetChanged();\n }\n }", "@Override\n public void run() {\n adapter = new DatabaseCitiesAdapter(getApplicationContext(), activity ,dbCities);\n recyclerView.setAdapter(adapter);\n recyclerView.invalidate();\n }", "protected void setUpRecyclerView() {\n setVerticalScrollBarEnabled(false);\n setFadingEdgeLength(0);\n int gravity = mController.getScrollOrientation() == DatePickerDialog.ScrollOrientation.VERTICAL\n ? Gravity.TOP\n : Gravity.START;\n GravitySnapHelper helper = new GravitySnapHelper(gravity, new GravitySnapHelper.SnapListener() {\n @Override\n public void onSnap(int position) {\n // Leverage the fact that the SnapHelper figures out which position is shown and\n // pass this on to our PageListener after the snap has happened\n if (pageListener != null) pageListener.onPageChanged(position);\n }\n });\n helper.attachToRecyclerView(this);\n }", "private void setupBasketList(){\n LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());\n linearLayoutManager.setOrientation(RecyclerView.VERTICAL);\n binding.recyclerViewVirtualBasket.setLayoutManager(linearLayoutManager);\n binding.recyclerViewVirtualBasket.setHasFixedSize(true);\n basketListAdapter = new BasketListAdapter();\n binding.recyclerViewVirtualBasket.setAdapter(basketListAdapter);\n binding.recyclerViewVirtualBasket.setItemAnimator(new DefaultItemAnimator());\n bindSwipeToDelete();\n }", "private void initFAQRecyclerView() {\n mFaqAdapter = new FAQAdapter(mFaqs, this);\n mFAQRecyclerView.setAdapter(mFaqAdapter);\n }", "private void renderer(int rv, ArrayList<ItemBox> list){\n recyclerView = findViewById(rv);\r\n recyclerView.setHasFixedSize(true);\r\n RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);\r\n RecyclerView.Adapter adapter = new Itembox_Adapter(list, this, 1);\r\n recyclerView.setLayoutManager(layoutManager);\r\n recyclerView.setAdapter(adapter);\r\n }", "private void init() {\n articleList = new ArrayList<>();\n newsAdapter = new NewsAdapter(getContext(), articleList, mListener, this);\n\n recyclerViewNews.setHasFixedSize(false);\n RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getContext());\n\n recyclerViewNews.setLayoutManager(layoutManager);\n recyclerViewNews.setAdapter(newsAdapter);\n }", "public void cargarAdaptador(){\n gridLayoutManager = new GridLayoutManager(getContext(), 2);\n recyclerView.setLayoutManager(gridLayoutManager);\n adapterRecetas = new AdapterRecetas(getContext());\n recyclerView.setAdapter(adapterRecetas);\n }", "private void initializeViewHolder() {\n mCommon.findControls(this);\n\n mViewHolder = new RecurringTransactionViewHolder();\n\n // Due Date = date\n mCommon.initDateSelector();\n\n // Payment Date, next occurrence\n mViewHolder.paymentDateTextView = (TextView) findViewById(R.id.paymentDateTextView);\n\n // Previous/Next day adjustment buttons for the Payment Day\n mViewHolder.paymentPreviousDayButton = (FontIconView) findViewById(R.id.paymentPreviousDayButton);\n mViewHolder.paymentNextDayButton = (FontIconView) findViewById(R.id.paymentNextDayButton);\n\n // Recurrence label\n mViewHolder.recurrenceLabel = (TextView) findViewById(R.id.recurrenceLabel);\n\n // Payments Left label\n mViewHolder.paymentsLeftTextView = (TextView) findViewById(R.id.textViewTimesRepeated);\n\n // Payments Left text input\n mViewHolder.paymentsLeftEditText = (EditText) findViewById(R.id.editTextTimesRepeated);\n }", "private void setUpFoodItemsRView(String category, View view){\n //Log.d(TAG, \"setUpFoodItemsRView: Category: \"+category+\" View :\"+view);\n // TextView mFoodCategoryHeadingText = view.findViewById(R.id.menuItemHeading);\n // mFoodCategoryHeadingText.setText(category+\"'s\");\n // shimmerFrameLayout.startShimmer();\n RecyclerView mFoodItemsRecycler = view.findViewById(R.id.foodItemsRecyclerView);\n LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity(),LinearLayoutManager.HORIZONTAL,false);\n mFoodItemsRecycler.setHasFixedSize(true);\n mFoodItemsRecycler.setLayoutManager(linearLayoutManager);\n\n // adapter = new FoodItemAdapter(mFoodItems,mContext,this);\n foodAdapter = new FoodItemAdapter(mSelectedCategoryFoodItem,getActivity(),this);\n mFoodItemsRecycler.setAdapter(foodAdapter);\n\n //Getting the data from firebase\n loadRecyclerViewData(category);\n\n\n }", "private void setupViews() {\n this.rvArticles = (RecyclerView) findViewById(R.id.rvArticles);\n this.articles = new ArrayList<>();\n this.articleArrayAdapter = new ArticleArrayAdapter(this, this.articles);\n this.rvArticles.setAdapter(this.articleArrayAdapter);\n StaggeredGridLayoutManager gridLayoutManager =\n new StaggeredGridLayoutManager(GRID_NUM_COLUMNS,\n StaggeredGridLayoutManager.VERTICAL);\n this.rvArticles.setLayoutManager(gridLayoutManager);\n ItemClickSupport.addTo(this.rvArticles).setOnItemClickListener(\n (recyclerView, position, v) -> launchArticleView(position)\n );\n SpacesItemDecoration decoration = new SpacesItemDecoration(GRID_SPACE_SIZE);\n this.rvArticles.addItemDecoration(decoration);\n this.rvArticles.addOnScrollListener(\n new EndlessRecyclerViewScrollListener(gridLayoutManager) {\n @Override\n public void onLoadMore(int page, int totalItemsCount) {\n articleSearch(searchView.getQuery().toString(), page);\n }\n });\n }", "private void firebaseReyclerViewAdapter() {\n options = new FirebaseRecyclerOptions.Builder<DataModels>()\n // Referensi Database yang akan digunakan beserta data Modelnya\n .setQuery(reference.child(\"KucingPutih\"), DataModels.class)\n .setLifecycleOwner((LifecycleOwner) getActivity()) //Untuk menangani perubahan siklus hidup pada Activity/Fragment\n .build();\n\n // Digunakan untuk menghubungkan View dengan data Models\n recyclerAdapter = new FirebaseRecyclerAdapter<DataModels, RecyclerAdapter>(options) {\n\n @Override\n protected void onBindViewHolder(@NonNull RecyclerAdapter holder, int position, @NonNull DataModels model) {\n //Mendapatkan data dari Database yang akan ditampilkan pada RecyclerView\n holder.setDisplayImage(model.getImage_url(), getActivity());\n\n progressBar.setVisibility(View.GONE);\n }\n\n @NonNull\n @Override\n public RecyclerAdapter onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {\n //Mengubungkan adapter dengan Layout yang akan digunakan\n return new RecyclerAdapter(LayoutInflater.from(parent.getContext())\n .inflate(R.layout.recycler_layout, parent, false));\n }\n };\n recyclerView.setAdapter(recyclerAdapter);\n }", "private void setUpRecycler(int itemSize) {\n ArrayList<Seat> seats = new ArrayList<>();\n for (int i = 0; i < 40; i++) seats.add(new Seat());\n SeatListAdapter adapter = new SeatListAdapter(itemSize, seats, this);\n seatStatusListView.setLayoutManager(new GridLayoutManager(this, 4));\n seatStatusListView.setAdapter(adapter);\n }", "private void initializeReviewsAdapter() {\n mReviewsAdapter = new ReviewsAdapter(mUserReviewDataArrayList, this, this, TRUE);\n mBinding.rvPdpProductReviews.setAdapter(mReviewsAdapter);\n }", "@Override\n public void setUpAdapterAndView(List<ListItem> listOfData) {\n this.listOfData = listOfData;\n LinearLayoutManager layoutManager = new LinearLayoutManager(this);\n\n recyclerView.setLayoutManager(layoutManager);\n\n adapter = new CustomAdapter();\n recyclerView.setAdapter(adapter);\n\n DividerItemDecoration itemDecoration = new DividerItemDecoration(\n recyclerView.getContext(),\n layoutManager.getOrientation()\n );\n\n itemDecoration.setDrawable(\n ContextCompat.getDrawable(\n ListActivity.this,\n R.drawable.divider_white\n )\n );\n\n recyclerView.addItemDecoration(\n itemDecoration\n );\n\n ItemTouchHelper itemTouchHelper = new ItemTouchHelper(createHelperCallback());\n itemTouchHelper.attachToRecyclerView(recyclerView);\n\n\n }", "MyRecyclerViewAdapter(Context context, ArrayList<Answer> answers) {\n this.mInflater = LayoutInflater.from(context);\n this.answers=answers;\n }", "private void initLabelRecycler() {\n\n id_flowlayout.setAdapter(new TagAdapter<ServerLabelEntity>(serverLabelEntityArrayList) {\n @Override\n public View getView(FlowLayout parent, int position, ServerLabelEntity serverLabelEntity) {\n TextView server_label_name_tv = (TextView) LayoutInflater.from(getContext()).inflate(R.layout.server_details_label_item,\n id_flowlayout, false);\n server_label_name_tv.setText(serverLabelEntity.getName());\n return server_label_name_tv;\n }\n });\n\n }", "public void bindToRecyclerView(RecyclerView recyclerView) {\n if (getRecyclerView() != null) {\n throw new RuntimeException(\"Don't bind twice\");\n }\n setRecyclerView(recyclerView);\n getRecyclerView().setAdapter(this);\n }", "private void initAdapter() {\n GridLayoutManager layoutManager = new GridLayoutManager(this, 3);\n //设置布局管理器\n rv.setLayoutManager(layoutManager);\n //设置为垂直布局,这也是默认的\n layoutManager.setOrientation(OrientationHelper.VERTICAL);\n\n adapter1 = new CommomRecyclerAdapter(ChoiceCityActivity.this, stringList, R.layout.recy_country, new CommomRecyclerAdapter.OnItemClickListener() {\n @Override\n public void onItemClick(CommonRecyclerViewHolder holder, int postion) {\n //热门城市点击\n Map map = new HashMap();\n map.put(\"p1\",stringList.get(postion).getHotCity() );\n StatisticsManager.getInstance(mContext).addEventAidl(1812,map);\n\n Intent intent = new Intent(ChoiceCityActivity.this, MainActivity.class);\n intent.putExtra(\"country\", stringList.get(postion).getHotCountry());\n intent.putExtra(\"city\", stringList.get(postion).getHotCity());\n Constans.CITY = stringList.get(postion).getHotCity();\n Constans.COUNTRY = stringList.get(postion).getHotCountry();\n if (isFirst == 1) {\n isFirst=0;\n startActivity(intent);\n } else {\n setResult(RESULT_OK, intent);\n }\n finish();\n }\n }, null) {\n @Override\n public void convert(CommonRecyclerViewHolder holder, Object o, int position) {\n TextView tv_country_name = holder.getView(R.id.tv);\n tv_country_name.setText(stringList.get(position).getHotCity());\n }\n };\n rv.setAdapter(adapter1);\n\n\n }", "MyRecyclerViewAdapter(Context context, List<String> data,List<String> giorno,List<String> primo,List<String> secondo,List<String> contorno,List<String> dolce) {\n this.mInflater = LayoutInflater.from(context);\n this.mdata = data;\n this.mgiorno = giorno;\n this.mprimo = primo;\n this.msecondo = secondo;\n this.mcontorno = contorno;\n this.mdolce = dolce;\n\n\n\n }", "private void setAdapter(ArrayList<Record> allRecordItems) {\n AllRecordsAdapter allRecordsAdapter;\n if (allRecordItems.size() <=0 ){\n noBudgetData.setVisibility(View.VISIBLE);\n noDataGif.setVisibility(View.VISIBLE);\n }\n else {\n allRecordsAdapter = new AllRecordsAdapter(allRecordItems, this);\n allRecordsAdapter.onItemClickListener(new AllRecordsAdapter.onItemClick() {\n @Override\n public void itemClick(Record record) {\n ux.showRecordDetailsDialog(R.layout.dialog_record_short_details, record, new UX.onDialogOkListener() {\n @Override\n public void onClick() {\n }\n });\n }\n });\n recyclerView.setLayoutManager(new LinearLayoutManager(this));\n recyclerView.setAdapter(allRecordsAdapter);\n allRecordsAdapter.notifyDataSetChanged();\n }\n }" ]
[ "0.8090261", "0.77823126", "0.7600877", "0.7586872", "0.75855565", "0.7569657", "0.7550726", "0.7539602", "0.7512044", "0.7506464", "0.7501387", "0.74992126", "0.7498272", "0.74861586", "0.74756634", "0.7444968", "0.74359953", "0.74037236", "0.7335241", "0.73185384", "0.73153555", "0.73092574", "0.72847736", "0.7282808", "0.72794795", "0.724025", "0.7231973", "0.72038645", "0.72035104", "0.71808505", "0.7171993", "0.7132637", "0.71280104", "0.71159226", "0.71081156", "0.7106569", "0.71056825", "0.70235926", "0.69814235", "0.6980629", "0.6961122", "0.6939338", "0.6934559", "0.6924541", "0.6898806", "0.6888914", "0.68883336", "0.6874576", "0.6869193", "0.68646634", "0.6852705", "0.68451726", "0.68434143", "0.68309546", "0.6811397", "0.6802605", "0.6777708", "0.6773714", "0.6747719", "0.67232835", "0.6707155", "0.6687392", "0.66872823", "0.6677229", "0.6677042", "0.6675026", "0.6663598", "0.6663414", "0.6646886", "0.66442716", "0.6630896", "0.6615324", "0.65914047", "0.65879834", "0.6551417", "0.65454865", "0.6537328", "0.6536054", "0.65288043", "0.6526635", "0.651579", "0.65133536", "0.6510628", "0.6492297", "0.64890075", "0.64848566", "0.64802796", "0.64693236", "0.64684063", "0.6466681", "0.6464417", "0.64531386", "0.64404017", "0.64380485", "0.64379036", "0.64369977", "0.64253896", "0.64251244", "0.64233136", "0.64161795", "0.6410053" ]
0.0
-1
This takes a list of Movies, checks for duplicates and then adds each new Movie to teh ArrayList. It hsould also notify the Recycler View Adapter that a new item has been inserted.
public void setMovies(List<Movies> mvoies) { for ( Movies movie: mvoies) { if (!mMovies.contains(movie)) { mMovies.add(movie); moviesRViewAdapter.notifyItemInserted(mMovies.indexOf(movie)); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addData(Movie movieToAdd, View view)\n {\n /* Creating a DatabaseHelper Instance to access the getData Method in order to get the\n * Title (Index 1 in terms of Columns) of all the saved Movies in the Database and to make\n * sure that the Title of the Movie to be registered isn't equals to any of the existing movies\n */\n DatabaseHelper databaseHelper = new DatabaseHelper(context);\n Cursor c = databaseHelper.getData();\n\n ArrayList<String> listLabels = new ArrayList<>();\n\n while(c.moveToNext())\n {\n //get the value from the database in column 1\n //then add it to the ArrayList\n listLabels.add(c.getString(1));\n }\n\n // Error Message if the Title of the Movie to Add Already is found\n if (listLabels.contains(movieToAdd.getTitle()))\n\n Snackbar.make(view, \"Movie Already has already been Registered !!!\",Snackbar.LENGTH_SHORT)\n .setBackgroundTint(context.getResources().getColor(R.color.transparent_yellow))\n .setTextColor(context.getResources().getColor(R.color.grey_black))\n .show();\n\n else\n {\n int favorite = 0;\n\n if (movieToAdd.isFavorite())\n\n favorite = 1;\n\n /* the execSQL Method simply executes this query on the Database, in this Query UPDATE is\n * used to specify the Table Name to Update, SET specifies the Column name to Update in this\n * case COL8 contains favorites and WHERE is the condition in this case it is to make sure\n * that the Movie Title Matches with the given title\n */\n this.getWritableDatabase().execSQL(\n \"INSERT INTO \" + TABLE_NAME +\n \" (title, year, director, actor_actress, rating, review, favorite)\" +\n \" values('\"\n + movieToAdd.getTitle() + \"', '\" + movieToAdd.getYear() + \"', '\"\n + movieToAdd.getDirector() + \"', '\" + movieToAdd.getActorActress() + \"', \"\n + movieToAdd.getRating() + \", '\" + movieToAdd.getReview() + \"', \" + favorite\n + \")\");\n\n Snackbar.make(view, \"Successfully Registered !\",Snackbar.LENGTH_SHORT)\n .setBackgroundTint(context.getResources().getColor(R.color.transparent_yellow))\n .setTextColor(context.getResources().getColor(R.color.grey_black))\n .show();\n }\n }", "public static void addResults(ArrayList<MovieInfoObject> moviesInfo) {\n mCurrentMovies.clear();\n for (MovieInfoObject mi : moviesInfo) {\n mCurrentMovies.add(mi);\n }\n if (mMovies.size() == 0) {\n for (MovieInfoObject mi : moviesInfo) {\n mMovies.add(mi);\n keywords.add(mi.getTitle());\n }\n return;\n }\n HashMap<Long, Integer> movieDup = new HashMap<Long, Integer>();\n for (MovieInfoObject a : mMovies) {\n movieDup.put(a.getId(), new Integer(1));\n }\n for (MovieInfoObject e : moviesInfo) {\n if (movieDup.get(e.getId()) == null) {\n mMovies.add(e);\n keywords.add(e.getTitle());\n }\n }\n\n }", "public void addMovie(ArrayList<Movie> movies)\n {\n String title = \"\";\n String director = \"\";\n String actor1 = \"\";\n String actor2 = \"\";\n String actor3 = \"\";\n int rating = 0;\n \n title = insertTitle();\n boolean checkResult = checkMovieRedundancyByTitle(movies, title);\n if (checkResult == true)\n return;\n \n director = insertDirector();\n actor1 = insertActor(1);\n actor2 = insertActor(2);\n if (actor2.length() != 0)\n actor3 = insertActor(3);\n \n rating = insertRating();\n \n Movie film = createNewMovie(title,director,actor1,actor2,actor3,rating);\n movies.add(film);\n displayOneFilm(film);\n System.out.println(\"\\n\\t\\t\\t >>>>> Yeayy, \" + title.toUpperCase() + \" successfully ADD to database! <<<<< \");\n }", "private boolean checkMovieRedundancyByTitle(ArrayList<Movie> movies, String title)\n { \n for (Movie film : movies)\n {\n String head = film.getTitle();\n \n if (head.equalsIgnoreCase(title))\n {\n System.out.println(\"\\n\\t\\t >>>>> Sorry, \" + title.toUpperCase() + \" is already EXIST in database <<<<< \");\n displayOneFilm(film);\n return true;\n }\n }\n \n return false;\n }", "public List<MovieModel> addFavData(Cursor c) {\n\n if (c == null)\n return null;\n List<MovieModel> temp = new ArrayList<>();\n if (c.moveToFirst()) {\n while (c.moveToNext()) {\n MovieModel movieModel = new MovieModel();\n movieModel.setId(c.getLong(c.getColumnIndex(MovieColumns._ID)));\n movieModel.setTitle(c.getString(c.getColumnIndex(MovieColumns.NAME_TITLE)));\n movieModel.setOverView(c.getString(c.getColumnIndex(MovieColumns.NAME_OVERVIEW)));\n movieModel.setPosterPath(c.getString(c.getColumnIndex(MovieColumns.NAME_POSTERPATH)));\n movieModel.setVote_average(c.getDouble(c.getColumnIndex(MovieColumns.NAME_VOTE_AVERAGE)));\n movieModel.setReleaseDate(c.getString(c.getColumnIndex(MovieColumns.NAME_RELEASE_DATE)));\n movieModel.setFav(true);\n temp.add(movieModel);\n }\n }\n List<MovieModel> tempReturn = movieModelList;\n this.movieModelList = temp;\n\n /* if(movieModelList==null)\n movieModelList=temp;\n else {\n movieModelList.addAll(temp);\n }*/\n this.notifyDataSetChanged();\n return tempReturn;\n }", "private void addMovieToArray(ArrayList<Movie> movies, String movieName, String directorName, String act1, String act2, String act3, int star)\n {\n Movie clip = new Movie(movieName, directorName, act1, act2, act3, star);\n movies.add(clip);\n }", "@Override\n public void onResponse(JSONArray response) {\n List<Movie> tmp = new ArrayList<>();\n for (int i = 0; i < response.length(); i++) {\n try {\n JSONObject mov = response.getJSONObject(i);\n// Toast.makeText(MainActivity.this, mov.toString(), Toast.LENGTH_LONG).show();\n tmp.add(new Movie(mov.getString(\"title\"), \"15_12_2018\", mov.getString(\"Image\")));\n Toast.makeText(MainActivity.this, \"added!\", Toast.LENGTH_SHORT).show();\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n// tmp.add(new MovieInfo(\"Harry Potter and test\", \"15_12_2018\", Arrays.asList(\"13:00\",\"16:00\",\"18:00\",\"21:00\",\"22:00\",\"23:00\")));\n populateMovieList(tmp, \"15_12_2018\"); //TODO: REMOVE\n }", "private void getMovies() {\n\n database = FirebaseDatabase.getInstance();\n reference = database.getReference().child(userId).child(\"movies\");\n reference.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n movieList.clear();\n baseMovieList.clear();\n i = (int) dataSnapshot.getChildrenCount();\n for (final DataSnapshot child : dataSnapshot.getChildren())\n {\n String id = child.getKey();\n Client Client = new Client();\n Service apiService =\n Client.getClient().create(Service.class);\n Call<Movie> call;\n call = apiService.getDetails(id, BuildConfig.THE_MOVIE_DB_API_TOKEN);\n\n call.enqueue(new Callback<Movie>() {\n @Override\n public void onResponse(Call<Movie> call, Response<Movie> response) {\n Movie info;\n info = response.body();\n if(child.child(\"watched\").getValue().equals(\"true\"))\n info.setWatched(true);\n\n baseMovieList.add(info);\n\n i = i -1;\n if(i <= 0) {\n pd.dismiss();\n progressBar();\n sort();\n }\n }\n\n @Override\n public void onFailure(Call<Movie> call, Throwable t) {\n Toast.makeText(MyWatchlist.this, \"Error Fetching Data!\", Toast.LENGTH_SHORT).show();\n }\n } );\n\n }\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n\n }", "private void getAllFavorite(){\n\n\n MainViewModel viewModel = ViewModelProviders.of(this).get(MainViewModel.class);\n viewModel.getFavorite().observe(this, new Observer<List<FavoriteEntry>>() {\n @Override\n public void onChanged(@Nullable List<FavoriteEntry> imageEntries) {\n List<Movie> movies = new ArrayList<>();\n for (FavoriteEntry entry : imageEntries){\n Movie movie = new Movie();\n movie.setId(entry.getMovieid());\n movie.setOverview(entry.getOverview());\n movie.setOriginalTitle(entry.getTitle());\n movie.setPosterPath(entry.getPosterpath());\n movie.setVoteAverage(entry.getUserrating());\n movie.setReleaseDate(entry.getReleasedate());\n movies.add(movie);\n }\n\n adapter.setMovies(movies);\n }\n });\n }", "public void updateData(List<Movie> movies) {\n mMovies = movies;\n notifyDataSetChanged();\n }", "public void addSimilarMovie(Movie movie){\n\t \tsimilarMovies.add(movie);\n\t }", "private void searchedByTitle(ArrayList<Movie> movies)\n {\n ArrayList<Movie> searchResult = new ArrayList<Movie>();\n \n String title = insertTitle();\n searchResult = checkExistence(movies, title);\n displayExistanceResult(searchResult, title);\n }", "private void loadRecyclerViewWithMovies(ArrayList<Movie> recyclerViewList){\n GridLayoutManager gridLayoutManager;\n if(getResources().getConfiguration().orientation == ORIENTATION_PORTRAIT)\n gridLayoutManager = new GridLayoutManager(getApplicationContext(), COLUMNS_IN_PORTRAIT);\n else\n gridLayoutManager = new GridLayoutManager(getApplicationContext(), COLUMNS_IN_LANDSCAPE);\n recyclerView.setLayoutManager(gridLayoutManager);\n recyclerView.setHasFixedSize(true);\n\n MovieAdapter movieAdapter = new MovieAdapter(recyclerViewList.size(), recyclerViewList,\n getApplicationContext(), clickListener);\n movieAdapter.notifyDataSetChanged();\n\n recyclerView.setAdapter(movieAdapter);\n }", "@Override\n public void onChanged(List<Movie> movies) {\n List<MovieListItem> movieListItems = new ArrayList<>();\n for (Movie movie : movies){\n movieListItems.add(\n new MovieListItem(\n movie,\n glide,\n context\n ).addListener(MovieCategoryListItem.this) // Add listener for click events\n );\n }\n\n\n\n\n }", "@Override\n public void onResponse(Call<List<Movie>> call, Response<List<Movie>> response) {\n List<Movie> gotFromRetrofit = response.body();\n if(gotFromRetrofit!=null){\n for(Movie movie : gotFromRetrofit) {\n movies.add(movie);\n }\n }\n recyclerViewAdapter.notifyDataSetChanged();\n }", "private ArrayList<Movie> checkExistence(ArrayList<Movie> movies, String title)\n {\n ArrayList<Movie> result = new ArrayList<Movie>();\n \n for (Movie film : movies)\n {\n String head = film.getTitle().trim().toLowerCase();\n \n if (head.contains(title))\n result.add(film);\n }\n \n return result;\n }", "private void loadMovies() {\n try {\n SharedPreferences prefs = getActivity().getSharedPreferences(\n PREFS_NAME, 0);\n if (prefs.contains(SP_FEED)) {\n\n JSONObject jsonObject = new JSONObject(prefs.getString(SP_FEED,\n \"\"));\n\n JSONArray jsonMovieArray;\n jsonMovieArray = (JSONArray) ((JSONObject) jsonObject\n .get(\"feed\")).get(\"entry\");\n\n if (jsonMovieArray != null) {\n int len = jsonMovieArray.length();\n for (int i = 0; i < len; i++) {\n JSONObject jsonMovie = (JSONObject) jsonMovieArray\n .get(i);\n mList.add(new Movie(jsonMovie));\n }\n }\n }\n\n } catch (JSONException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n // Update adapter\n mArrayAdapter.notifyDataSetChanged();\n }", "public boolean add(Movie a)\n\t{\n\t\tfor (Movie b:this){\n\t\t\tif(a.equals(b)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn super.add(a);\n\t}", "public MovieAdapter(Context context, ArrayList<Movie> movie) {\n mContext = context;\n mMovie = movie;\n if (movie == null) {\n Log.v(LOG_TAG, \"null movie on MovieAdapter creation\");\n } else {\n Log.v(LOG_TAG, \"Created MovieAdapter (entry count = \" + mMovie.size() + \")\");\n }\n }", "public void saveMovieToFavorites() {\n Cursor moviecursor = this.getContentResolver().query(MovieContract.MovieEntry.CONTENT_URI, null, MovieContract.MovieEntry.COLUMN_NAME_MOVIE_ID + \" = \" + mMovie.getID(), null, null, null);\n if(moviecursor.getCount() == 0) { // first time this movie has been favorited insert record\n Uri movieUri = this.getContentResolver().insert(MovieContract.MovieEntry.CONTENT_URI, Constants.createMovieRecord(mMovie));\n long movieid = ContentUris.parseId(movieUri);\n int insertedTrailerCount = this.getContentResolver().bulkInsert(MovieContract.TrailerEntry.CONTENT_URI, Constants.createBulkTrailerValues(Constants.mTrailers, movieid));\n int insertedReviewCount = this.getContentResolver().bulkInsert(MovieContract.ReviewEntry.CONTENT_URI, Constants.createBulkReviewValues(Constants.mReviews, movieid));\n\n if(insertedTrailerCount < 1)\n Log.e(TAG,\"Trailer failed to insert\");\n\n if(insertedReviewCount < 1)\n Log.e(TAG, \" Review failed to insert\");\n }\n }", "private void populateAdapter(){\n mAdapter = new MovieRecyclerAdapter(context, moviesList, this);\n mRecyclerView.setAdapter(mAdapter);\n }", "public void addMovie(final Movie movie) {\n if (!this.getMovieNames().contains(movie.getName())) {\n this.movies.add(movie);\n }\n }", "public long addMovieToWatchlist(long movieId) {\n if (!isMovieInWatchlist(movieId)) {\n SQLiteDatabase database = this.getWritableDatabase();\n ContentValues values = insertMovieInWatchlist(movieId);\n long rowId = database.insert(WatchlistMoviesEntry.TABLE_NAME, null, values);\n database.close();\n return rowId;\n } else return 0;\n }", "private void updateReviews() {\n ArrayList<MovieReview> movieReviewArrayList = new ArrayList<>();\n reviewRecyclerView = findViewById(R.id.reviews_recycler_view);\n reviewRecyclerView.setLayoutManager(new LinearLayoutManager(this));\n movieReviewAdapter = new MovieReviewAdapter(movieReviewArrayList, MovieDetailActivity.this);\n reviewRecyclerView.setAdapter(movieVideoAdapter);\n }", "private long addMovie(String cp_id, String title, String status, Integer year, String quality, String tagline, String plot, String imdb, String runtime, String poster_original, String backdrop_original, ArrayList<String> genreStringArray) {\r\n\r\n // First, check if the location with this city name exists in the db\r\n Cursor cursor = mContext.getContentResolver().query(\r\n MovieContract.WantedEntry.CONTENT_URI,\r\n new String[]{MovieContract.WantedEntry.COLUMN_CP_ID},\r\n MovieContract.WantedEntry.COLUMN_CP_ID + \" = ?\",\r\n new String[]{cp_id},\r\n null);\r\n\r\n if (cursor.moveToFirst()) {\r\n\r\n int wantedMovieIdIndex = cursor.getColumnIndex(MovieContract.WantedEntry.COLUMN_CP_ID);\r\n Log.v(LOG_TAG, \"Found \" + title + \" in the database!\" );\r\n return cursor.getLong(wantedMovieIdIndex);\r\n } else {\r\n Log.v(LOG_TAG, \"Didn't find it in the database, inserting now!\");\r\n ContentValues wantedMovieValues = new ContentValues();\r\n wantedMovieValues.put(MovieContract.WantedEntry.COLUMN_CP_ID, cp_id);\r\n wantedMovieValues.put(MovieContract.WantedEntry.COLUMN_TITLE, title);\r\n wantedMovieValues.put(MovieContract.WantedEntry.COLUMN_YEAR, year);\r\n wantedMovieValues.put(MovieContract.WantedEntry.COLUMN_STATUS, status);\r\n wantedMovieValues.put(MovieContract.WantedEntry.COLUMN_QUALITY, quality);\r\n wantedMovieValues.put(MovieContract.WantedEntry.COLUMN_RUNTIME, runtime);\r\n wantedMovieValues.put(MovieContract.WantedEntry.COLUMN_TAGLINE, tagline);\r\n wantedMovieValues.put(MovieContract.WantedEntry.COLUMN_PLOT, plot);\r\n wantedMovieValues.put(MovieContract.WantedEntry.COLUMN_IMDB, imdb);\r\n wantedMovieValues.put(MovieContract.WantedEntry.COLUMN_POSTER_ORIGINAL, poster_original);\r\n wantedMovieValues.put(MovieContract.WantedEntry.COLUMN_BACKDROP_ORIGINAL, backdrop_original);\r\n wantedMovieValues.put(MovieContract.WantedEntry.COLUMN_GENRES, Utility.convertArrayToString(genreStringArray));\r\n\r\n Uri wantedMovieInsertUri = mContext.getContentResolver()\r\n .insert(MovieContract.WantedEntry.CONTENT_URI, wantedMovieValues);\r\n\r\n Bitmap mIcon11 = null;\r\n String thumbnailFilename;\r\n String fullsizeFilename;\r\n if(poster_original != null) {\r\n try {\r\n InputStream in = new java.net.URL(poster_original).openStream();\r\n mIcon11 = BitmapFactory.decodeStream(in);\r\n Bitmap thumbnail = Bitmap.createScaledBitmap(mIcon11, 160, 240, false);\r\n thumbnailFilename = cp_id+\"_thumb\";\r\n fullsizeFilename = cp_id+\"_full\";\r\n String path = saveToInternalStorage(thumbnail, thumbnailFilename);\r\n String fullsizePath = saveToInternalStorage(mIcon11, fullsizeFilename);\r\n } catch (Exception e) {\r\n Log.e(\"Error\", e.getMessage());\r\n// e.printStackTrace();\r\n }\r\n }\r\n else{\r\n mIcon11 = BitmapFactory.decodeResource(mContext.getResources(),\r\n R.drawable.movie_placeholder);\r\n Bitmap thumbnail = Bitmap.createScaledBitmap(mIcon11, 160, 240, false);\r\n thumbnailFilename = cp_id+\"_thumb\";\r\n fullsizeFilename = cp_id+\"_full\";\r\n String thumbPath = saveToInternalStorage(thumbnail, thumbnailFilename);\r\n String fullsizePath = saveToInternalStorage(mIcon11, fullsizeFilename);\r\n }\r\n\r\n\r\n return ContentUris.parseId(wantedMovieInsertUri);\r\n }\r\n }", "public void addMovieToFavorites(Movie movie) {\n movie.setFavorite(true);\n isFavorite = true;\n //change the star from gray to yellow\n star.setImageResource(R.drawable.ic_grade_yellow_36px);\n //save the poster in local storage\n String imageName = saveMoviePoster();\n\n //load the necessary movie fields into the ContentValues object\n ContentValues values = new ContentValues();\n values.put(FavoriteMoviesContract.MovieEntry.MOVIEDB_ID, movie.getId());\n values.put(FavoriteMoviesContract.MovieEntry.AVERAGE_VOTE, movie.getVoteAverage());\n values.put(FavoriteMoviesContract.MovieEntry.ORIGINAL_TITLE, movie.getOriginalTitle());\n values.put(FavoriteMoviesContract.MovieEntry.RELEASE_YEAR, movie.getReleaseYear());\n values.put(FavoriteMoviesContract.MovieEntry.RUNTIME, movie.getRuntime());\n values.put(FavoriteMoviesContract.MovieEntry.SYNOPSIS, movie.getSynopsis());\n values.put(FavoriteMoviesContract.MovieEntry.POSTER_IMAGE_NAME, imageName);\n\n //insert the movie into the Favorites db\n Uri uri = getActivity().getContentResolver().\n insert(FavoriteMoviesContract.MovieEntry.CONTENT_URI, values);\n\n if (uri != null) {\n String successMessage = \"You have successfully added \" + movie.getOriginalTitle() +\n \" to the Favorites collection\";\n Toast.makeText(getActivity(), successMessage, Toast.LENGTH_LONG).show();\n }\n }", "public void addUnseen(Movie m) {\n for (Rating r : ratings) {\n if (r.movie() == m) return;\n }\n\n if (!unseen.contains(m)) unseen.add(m);\n }", "private void addItem(Movie item) {\n mDataset.add(item);\n notifyItemInserted(mDataset.size() );\n notifyDataSetChanged();\n }", "private void ObserveAnyChange(){\n movieListViewModel.getMovies().observe(getViewLifecycleOwner(), new Observer<List<MovieModel>>() {\n @Override\n public void onChanged(List<MovieModel> movieModels) {\n\n if (movieModels != null){\n for (MovieModel movieModel: movieModels){\n // get data in Log\n Log.v(TAG, \" onChanged: \"+ movieModel.getTitle());\n movieRecyclerAdapter.setmMovieModels(movieModels);\n }\n }\n\n }\n });\n }", "public static void checkMovieForAdd(MovieInfoObject movie, Playlist playlist) throws PlaylistExceptions {\n boolean flag = false;\n for (PlaylistMovieInfoObject log : playlist.getMovies()) {\n if (movie.getID() == log.getID()) {\n flag = true;\n break;\n }\n }\n if (flag) {\n throw new PlaylistExceptions(\"ohno the movie < \" + movie.getMovieTitle()\n + \" > has already been added to this playlist :( pls try again with another movie\");\n }\n }", "public void setMovieArrayList(MovieClass newMovieObject)\n {\n movieArrayList.add(newMovieObject);\n }", "public void addMovieDetails(MovieDetails movieDetails) {\n if (movieDetails != null) {\n if (!isMovieDetailsExists(movieDetails.getId())) {\n SQLiteDatabase sqLiteDatabase = this.getWritableDatabase();\n // Insert movie details data\n ContentValues values = insertMovieDetailsInCntnValues(movieDetails);\n sqLiteDatabase.insert(MoviesDetailsEntry.TABLE_NAME, null, values);\n // Insert genres data into genres table\n for (int i = 0; i < movieDetails.getGenres().size(); i++) {\n // If such genre doesn't exist, put into database\n if (!isGenreExist(movieDetails.getGenres().get(i).getGenreId())) {\n ContentValues genreValues = insertMovieGenresInCntnValues(movieDetails.getGenres().get(i));\n sqLiteDatabase.insert(GenreEntry.TABLE_NAME, null, genreValues);\n }\n // Insert genre_id and movie_id into movie_genre table\n ContentValues movieGenreValues = insertMovieGenreValues(movieDetails.getId(), movieDetails.getGenres().get(i).getGenreId());\n sqLiteDatabase.insert(MovieGenreEntry.TABLE_NAME, null, movieGenreValues);\n }\n sqLiteDatabase.close();\n }\n } else {\n throw new IllegalArgumentException(\"Passed movie object is null or already exist\");\n }\n }", "public static void addMovie(String id, String title, MovieCode code) {\n\t\tif (movieList.stream().noneMatch(movie -> movie.getId().equals(id))) {\n\t\t\tmovieList.add(new Movie(id, title, code));\n\t\t}\n\t}", "private void addMovieToDb() {\n ContentValues contentValues = new ContentValues();\n\n contentValues.put(MovieColumns.ADULT,mMovie.getAdult());\n contentValues.put(MovieColumns.BACKDROP_PATH,mMovie.getBackdropPath());\n contentValues.put(MovieColumns.GENRE,Utils.arrayToString(mMovie.getGenreIds()));\n contentValues.put(MovieColumns.MOV_ID,mMovie.getMovieId());\n contentValues.put(MovieColumns.ORIGINAL_LANGUAGE,mMovie.getOrigLanguage());\n contentValues.put(MovieColumns.ORIGINAL_TITLE,mMovie.getOrigTitle());\n contentValues.put(MovieColumns.OVERVIEW,mMovie.getOverview());\n contentValues.put(MovieColumns.RELEASE_DATE,mMovie.getReleaseDate());\n contentValues.put(MovieColumns.POSTER_PATH,mMovie.getPosterPath());\n contentValues.put(MovieColumns.POPULARITY,mMovie.getPopularity());\n contentValues.put(MovieColumns.TITLE,mMovie.getTitle());\n contentValues.put(MovieColumns.VIDEO, mMovie.getVideo());\n contentValues.put(MovieColumns.VOTE_AVERAGE, mMovie.getVoteAverage());\n contentValues.put(MovieColumns.VOTE_COUNT, mMovie.getVoteCount());\n\n try {\n getActivity().getContentResolver().insert(MoviesProvider.Movies.MOVIES_URI, contentValues);\n Toast.makeText(getContext(),getString(R.string.movie_added_as_favorite),Toast.LENGTH_SHORT).show();\n }catch (Exception ex){\n if(ex instanceof SQLiteConstraintException){\n Toast.makeText(getContext(), getString(R.string.movie_already_added_as_favorite), Toast.LENGTH_SHORT).show();\n }else {\n Toast.makeText(getContext(), getString(R.string.movie_added_as_favorite_problem), Toast.LENGTH_SHORT).show();\n }\n }\n }", "private void updateVideo() {\n ArrayList<String> movieVideoArrayList = new ArrayList<String>();\n videoRecyclerView = findViewById(R.id.trailer_recycler_view);\n videoRecyclerView.setLayoutManager(new GridLayoutManager(this, 4));\n movieVideoAdapter = new MovieVideoAdapter(movieVideoArrayList, MovieDetailActivity.this);\n videoRecyclerView.setAdapter(movieVideoAdapter);\n }", "private void setAdapter(List<MovieList> listMovies) {\n adapter = new CardAdapter(listMovies, this);\n //Adding adapter to recyclerview\n AlphaInAnimationAdapter alphaAdapter = new AlphaInAnimationAdapter(adapter);\n alphaAdapter.setFirstOnly(false);\n recyclerView.setAdapter(alphaAdapter);\n// recyclerView.setAdapter(adapter);\n }", "private void buildRecyclerView() {\n\n movieRecyclerView = findViewById(R.id.movieRecyclerView);\n\n customAdapter = new CustomAdapter(MovieActivity.this,movieLists);\n movieRecyclerView.setAdapter(customAdapter);\n layoutManager = new GridLayoutManager(this,1);\n movieRecyclerView.setLayoutManager(layoutManager);\n\n }", "public void addDataSet(List<Movie> items){\n mValues.addAll(items);\n notifyDataSetChanged();\n }", "public static ArrayList<String> saveDuplicates(ArrayList<String> arlList) {\n // this functions save all duplicated in an Array.\n\n Set<String> set = new HashSet<String>();\n List<String> newList = new ArrayList<String>();\n List<String> newListDuplicates = new ArrayList<String>();\n for (Iterator<String> iter = arlList.iterator(); iter.hasNext();) {\n String element = iter.next();\n if (set.add(element))\n newList.add(element);\n else {\n newListDuplicates.add(element);\n }\n }\n arlList.clear();\n arlList.addAll(newListDuplicates);\n return arlList;\n }", "public void addMovieListing(MovieListing listing) {\n movieListings.add(listing);\n notifyItemInserted(movieListings.size() - 1);\n if (MoviesApplication.getApp().isLargeLayout() && movieListings.size() == 1) {\n selectMovie(0);\n }\n }", "private void populateListView() {\n ((MovieAdapter)((HeaderViewListAdapter)myListView.getAdapter()).getWrappedAdapter()).notifyDataSetChanged();\n\n // Check if the user selected a specific movie and start a new activity with only that movie's information.\n myListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Movie selectedMovie = movies.get(position);\n\n Intent intent = new Intent(MovieListActivity.this, MovieOverviewActivity.class);\n intent.putExtra(TITLE_KEY, selectedMovie.getTitle());\n intent.putExtra(RELEASE_DATE_KEY, selectedMovie.getReleaseDate());\n intent.putExtra(RATING_KEY, selectedMovie.getRating());\n intent.putExtra(OVERVIEW_KEY, selectedMovie.getOverview());\n intent.putExtra(POSTER_PATH_KEY, selectedMovie.getPosterURL());\n startActivity(intent);\n }\n });\n }", "private void addSelectedtoFavorites(){\n\t\t\n\t\tCursor c=getContentResolver().query(Uri.parse(Const.URI_STRING+\"/videolist/\"+mPlayListId), null, null, null, null);\n\t\tif(mCheckData==null || c==null){\n\t\t\tLogging.e(\"Error Data NULL\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(mCheckData.size()!=c.getCount()){\n\t\t\tLogging.e(\"Error Data and Cursor count has different value\");\n\t\t}\n\t\t\n\t\tif(c!=null){\n\t\t\tLogging.d(\"Insert Start\");\n\t\t \tfor(int i=0;i<c.getCount();i++){\n\t \t\tBoolean tagged=mCheckData.get(i);\n\t \t\tif(tagged){\n\t \t\t\tc.moveToPosition(i);\n\t \t\t\tContentValues cv=new ContentValues();\n\t \t\t\tcv.put(MyList.PRJ_TITLE, c.getString(c.getColumnIndex(PlayList.PRJ_TITLE)));\n\t \t\t\tcv.put(MyList.PRJ_PLAYLIST_ID, mTitle);\n\t \t\t\tcv.put(MyList.PRJ_DESCRIPTION, c.getString(c.getColumnIndex(PlayList.PRJ_DESCRIPTION)));\n\t \t\t\tcv.put(MyList.PRJ_DURATION, c.getString(c.getColumnIndex(PlayList.PRJ_DURATION)));\n\t \t\t\tcv.put(MyList.PRJ_THUMNAIL, c.getString(c.getColumnIndex(PlayList.PRJ_THUMNAIL)));\n\t \t\t\tcv.put(MyList.PRJ_VIDEO_ID, c.getString(c.getColumnIndex(PlayList.PRJ_VIDEO_ID)));\n\t \t\t\t\n\t \t\t\tgetContentResolver().insert(Uri.parse(\"content://\"+Const.MYLIST_AUTHORITY+\"/videolist\"), cv);\n\t \t\t\tLogging.d(\"Insert \"+i);\n\t \t\t}\n\t \t}\n\t\t \tc.close();\n\t\t \tLogging.d(\"Insert End\");\n\t\t}\n\t}", "@Override\n public void onClick(View view) {\n for (int m = 0; m < itemsOnlyList.length; m++){\n\n if(searchBar.getText().toString().equals(itemArray[m].getCardName().intern())){\n //Add the new card to the player hand array??\n playerCards.add(itemArray[m]);\n\n //Add the one card in question to this variable.\n playerCard = itemArray[m];\n\n //Leave the loop if a match is found\n break;\n }\n }\n\n updateListView(playerCards);\n }", "private void updateListView(ArrayList<MovieAPI> allmovies_list){\n\n moviesAPI_list = allmovies_list;\n\n mtitles_array = new String[allmovies_list.size()];\n\n for(int m=0; m<allmovies_list.size();m++){\n\n mtitles_array[m]=allmovies_list.get(m).getTitle();\n\n }\n\n\n final ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, android.R.id.text1, mtitles_array);\n\n\n runOnUiThread(new Runnable() {\n public void run() {\n apiMoviesListview_m.setAdapter(adapter);\n }\n });\n\n\n apiMoviesListview_m.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {\n // TODO Auto-generated method stub\n\n String value = adapter.getItem(position);\n\n switchToSingleRatingActivity(position);\n\n }\n });\n\n }", "@Override\n public void success(Movie.MovieResult movieResult, Response response) {\n mAdapter.setmMovieList(movieResult.getResults());\n }", "public boolean insertItem(MoviePanelBasicView item) {\r\n if (!this.contains(item)) {\r\n this.list.add(item);\r\n return true;\r\n } else {\r\n logger.debug(\"File \" + item.getFile() + \" is already in list!\");\r\n return false;\r\n }\r\n \r\n }", "private ArrayList<MovieItem> getFavoriteMovies(){\n //get list of favorite movies from buffer\n ArrayList<MovieItem> movies = mMovieStaff.getMovies(PosterHelper.NAME_ID_FAVORITE);\n\n //check if favorite movie list has changed\n if(mFavoriteChanged){\n //list has changed, show new movie list\n showMovieList(movies, PosterHelper.NAME_ID_FAVORITE);\n }\n\n //return movie list\n return movies;\n }", "private void ConfigRecyclerMovies(){\n movieRecyclerAdapter = new MovieRecyclerAdapter(this);\n popularMovieRecycler.setAdapter(movieRecyclerAdapter);\n popularMovieRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));\n }", "public void updateCardList(List<Entry> activityFeed) {\n\n List<Entry> newEntrytoAddList = new ArrayList<>();\n List<Entry> entriesToRemove = new ArrayList<>();\n\n //check if it is first run or refreshing list\n\n\n if (messagesHistory != null) {\n //remove deleted projects\n for (Entry entry : messagesHistory) {\n boolean stillExist = false;\n for (Entry entryFeed : activityFeed) {\n\n if (Objects.equals(entryFeed.getUpdated(), entry.getUpdated())) {\n stillExist = true;\n }\n }\n if (!stillExist) {\n entriesToRemove.add(entry);\n }\n }\n\n //add only new project\n for (Entry newEntry : activityFeed) {\n boolean duplicate = false;\n for (Entry currentEntry : messagesHistory) {\n if (Objects.equals(currentEntry.getUpdated(), newEntry.getUpdated())) {\n duplicate = true;\n }\n }\n if (!duplicate) {\n newEntrytoAddList.add(newEntry);\n }\n }\n\n\n //delete entries\n for (Entry toDelete : entriesToRemove) {\n cardView.remove(toDelete);\n }\n //add new entries\n for (Entry item : newEntrytoAddList) {\n cardView.add(0, item);\n new Handler().postDelayed(() -> {\n cardView.notifyInserted(0);\n rv.scrollToPosition(0);\n }, 500);\n\n }\n\n\n }\n boolean toNotify = false;\n if (cardView.getItemCount() == 0) {\n\n toNotify = true;\n messages.addAll(activityFeed);\n }\n\n //save cards history for later comparing if old entry were deleted or new were added\n messagesHistory = new ArrayList<>(messages);\n Handler handler = new Handler();\n boolean finalToNotify = toNotify;\n handler.postDelayed(() -> {\n if (finalToNotify) {\n cardView.notifyDataSetChanged();\n }\n AnimationUtil.stopRefreshAnimation(swipeRefreshLayout);\n }, 1000);\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Movies)) {\r\n return false;\r\n }\r\n Movies other = (Movies) object;\r\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n MovieWithDetails movie = movies.get((NUM_ITEMS_PER_PAGE * increment) + position);\n Intent singleMovie = new Intent(ListViewActivity.this, SingleMovieActivity.class);\n singleMovie.putExtra(\"title\", movie.getMovie().getTitle());\n singleMovie.putExtra(\"year\", String.valueOf(movie.getMovie().getYear()));\n singleMovie.putExtra(\"director\", movie.getMovie().getDirector());\n ArrayList<String> genres = new ArrayList<>();\n ArrayList<String> stars = new ArrayList<>();\n for (Genre g : movie.getGenres()) {\n genres.add(g.getName());\n }\n for (Star s : movie.getStars()) {\n stars.add(s.getName());\n }\n singleMovie.putStringArrayListExtra(\"genres\", genres);\n singleMovie.putStringArrayListExtra(\"stars\", stars);\n\n startActivity(singleMovie);\n }", "private void storeFilesToCollection(String movieDetails, ArrayList<Movie> movies) \n {\n String[] allMovieInfo = movieDetails.split(\";\");\n \n for (int line = 0; line < allMovieInfo.length ; line++)\n {\n String[] details = allMovieInfo[line].split(\",\");\n String title = details[0];\n String director = details[1];\n String actorOne = details[2];\n String actorTwo = details[3];\n String actorThree = details[4];\n int rating = Integer.parseInt(details[5]);\n addMovieToArray(movies,title, director, actorOne, actorTwo, actorThree, rating);\n }\n }", "public void addToFavorites() {\n\n // Create new content values object\n ContentValues contentValues = new ContentValues();\n\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_ID, sMovie.getMovieId());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_TITLE, sMovie.getMovieTitle());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_ORIGINAL_TITLE, sMovie.getMovieOriginalTitle());\n contentValues.put(FavMovieEntry.COLUMN_POSTER_PATH, sMovie.getPoster());\n contentValues.put(FavMovieEntry.COLUMN_BACKDROP_PATH, sMovie.getMovieBackdrop());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_RELEASE_DATE, sMovie.getReleaseDate());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_RATING, sMovie.getVoteAverage());\n contentValues.put(FavMovieEntry.COLUMN_MOVIE_SYNOPSIS, sMovie.getPlotSynopsis());\n\n try {\n mCurrentMovieUri = getContentResolver().insert(FavMovieEntry.CONTENT_URI,\n contentValues);\n } catch (IllegalArgumentException e) {\n mCurrentMovieUri = null;\n Log.v(LOG_TAG, e.toString());\n }\n\n if (mCurrentMovieUri != null) {\n isAddedToFavorites();\n }\n\n }", "@Override\n protected void populateViewHolder(final MyMovieViewHolder viewHolder, final MovieResultsRepresentation model, final int position) {\n Picasso.with(getApplicationContext()).load(\"http://image.tmdb.org/t/p/w185/\" + model.getMoviePoster()).resize(width, (int) (width * 1.5)).into(viewHolder.moviePicture);\n\n\n viewHolder.moviePicture.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n //When user clicks on movie for more details, it passes the data to the details activity\n Intent intent = new Intent(getApplicationContext(), DetailActivity.class)\n .putExtra(\"title\", model.getMovieName())\n .putExtra(\"vote_average\", model.getVotes() + \"\")\n .putExtra(\"overview\", model.getMovieOverview())\n .putExtra(\"popularity\", model.getMoviePopularity() + \"\")\n .putExtra(\"release_date\", model.getMovieReleaseDate())\n .putExtra(\"vote_count\", model.getMovieVoteCount())\n .putExtra(\"Picture\", model.getMoviePoster());\n\n startActivity(intent);\n\n }\n });\n\n\n viewHolder.movieName.setText(model.getMovieName());\n\n\n viewHolder.movieRating.setText(\"Rating: \" + model.getVotes() + \"\");\n\n viewHolder.moviePopularity.setText(\"Popularity: \" + new DecimalFormat(\"#\").format(model.getMoviePopularity()));\n\n viewHolder.movieDelete.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n //Deletes movie from myWatchLater list and from the cloud\n\n getRef(viewHolder.getAdapterPosition()).removeValue();\n\n adapter.notifyDataSetChanged();\n\n toastMessage(\"Movie removed\");\n }\n });\n }", "@Override\r\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\r\n setContentView(R.layout.activity_saved);\r\n Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);\r\n setSupportActionBar(toolbar);\r\n //endregion\r\n\r\n //region Get Index From Main Activity\r\n if(checked) {\r\n\r\n } else {\r\n Intent mIntent = getIntent();\r\n index = mIntent.getIntExtra(\"index\", 0);\r\n }\r\n //endregion\r\n\r\n //region Variables\r\n\r\n ListView listview = (ListView) findViewById(R.id.listView);\r\n final ArrayList<String> movieData = new ArrayList<String>();\r\n final ArrayList<String> tvData = new ArrayList<String>();\r\n ArrayList<String> dataArray = new ArrayList<String>();\r\n Button tvShows = (Button) findViewById(R.id.addTV);\r\n Button movies = (Button) findViewById(R.id.addMovie);\r\n\r\n //endregion\r\n\r\n if(index==1){\r\n title = \"Movie\";\r\n counterTitle = \"movie\";\r\n dataArray = movieData;\r\n } else {\r\n title=\"TVShow\";\r\n counterTitle = \"tv\";\r\n dataArray = tvData;\r\n }\r\n\r\n final String DeviceID = Settings.Secure.getString(getApplicationContext().getContentResolver(),Settings.Secure.ANDROID_ID);\r\n FirebaseDatabase database = FirebaseDatabase.getInstance();\r\n final DatabaseReference myRef = database.getReference(DeviceID).child(title);\r\n\r\n final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,dataArray);\r\n listview.setAdapter(arrayAdapter);\r\n\r\n //region Update ListView with all items\r\n myRef.addChildEventListener(new ChildEventListener() {\r\n @Override\r\n public void onChildAdded(DataSnapshot dataSnapshot, String s) {\r\n Map<String, HashMap> objectMap = (HashMap<String, HashMap>) dataSnapshot.getValue();\r\n Object mapToObject = objectMap.values();\r\n String objectToString = mapToObject.toString();\r\n if(index ==1) {\r\n movieData.add(objectToString);\r\n } else {\r\n tvData.add(objectToString);\r\n }\r\n arrayAdapter.notifyDataSetChanged();\r\n }\r\n\r\n @Override\r\n public void onChildChanged(DataSnapshot dataSnapshot, String s) {\r\n\r\n }\r\n\r\n @Override\r\n public void onChildRemoved(DataSnapshot dataSnapshot) {\r\n\r\n }\r\n\r\n @Override\r\n public void onChildMoved(DataSnapshot dataSnapshot, String s) {\r\n\r\n }\r\n\r\n @Override\r\n public void onCancelled(DatabaseError databaseError) {\r\n\r\n }\r\n });\r\n //endregion\r\n\r\n //region Change Button Index\r\n movies.setOnClickListener(new View.OnClickListener() {\r\n @Override\r\n public void onClick(View view) {\r\n finish();\r\n startActivity(getIntent());\r\n index = 1;\r\n arrayAdapter.notifyDataSetChanged();\r\n checked = true;\r\n }\r\n });\r\n\r\n tvShows.setOnClickListener(new View.OnClickListener() {\r\n @Override\r\n public void onClick(View view) {\r\n finish();\r\n startActivity(getIntent());\r\n index = 2;\r\n arrayAdapter.notifyDataSetChanged();\r\n checked = true;\r\n }\r\n });\r\n //endregion\r\n\r\n listview.setOnItemClickListener(new android.widget.AdapterView.OnItemClickListener() {\r\n @Override\r\n public void onItemClick(AdapterView<?> parent, View view,int position, long id) {\r\n int counter = 0;\r\n counter = position +1;\r\n Map<String,Object> taskMap = new HashMap<>();\r\n myRef.child(title + counter).removeValue();\r\n myRef.child(title + counter).updateChildren(taskMap);\r\n finish();\r\n startActivity(getIntent());\r\n }\r\n });\r\n\r\n }", "public static void watchMovie(){\r\n System.out.println('\\n'+\"Which movie would you like to watch?\");\r\n String movieTitle = s.nextLine();\r\n boolean movieFound = false;\r\n //Searching for the name of the movie in the list\r\n for(Movie names:movies ){\r\n //If movie is found in the list\r\n if (movieTitle.equals(names.getName())){\r\n names.timesWatched += 1;\r\n System.out.println(\"Times Watched for \"+ names.getName()+ \" has been increased to \"+ names.timesWatched);\r\n movieFound = true;\r\n break;\r\n }\r\n }\r\n\r\n // If movie not found do the other case\r\n if (!movieFound){\r\n System.out.println(\"This moves is not one you have previously watched. Please add it first.\");\r\n }\r\n }", "private void setupMovies() {\n mMovieAdapter = new MovieArrayAdapter(this, this);\n mMoviesRecyclerView.setHasFixedSize(true);\n mMoviesRecyclerView.setAdapter(mMovieAdapter);\n GridLayoutManager gridLayoutManager = new GridLayoutManager(\n this,\n 3,\n GridLayoutManager.VERTICAL,\n false\n );\n mMoviesRecyclerView.setLayoutManager(gridLayoutManager);\n }", "public void setAdapter(ArrayList<MovieModel> moviesList) {\n this.moviesList = moviesList;\n movieAdapter = new MovieAdapter(getActivity(), R.layout.castdetailscredits_row, this.moviesList);\n listView.setAdapter(movieAdapter);\n }", "public void fetchFavoritedMovies() {\n favoritesSelected = true;\n Cursor cursor =\n getActivity().getContentResolver().query(MovieContract.FavoriteMovieEntry.CONTENT_URI,\n null,\n null,\n null,\n null);\n ArrayList<MovieModel> movieModels = new ArrayList<>();\n if (cursor != null) {\n while (cursor.moveToNext()) {\n MovieModel movieModel = new MovieModel(getActivity(), cursor);\n // Get the trailers and reviews\n String movieId = cursor.getString(cursor.getColumnIndex(MovieContract.FavoriteMovieEntry._ID));\n Cursor trailerCursor =\n getActivity().getContentResolver().query(MovieContract.TrailerEntry.CONTENT_URI,\n null,\n MovieContract.TrailerEntry.COLUMN_MOVIE_KEY + \" = ?\",\n new String[]{movieId},\n null);\n Cursor reviewCursor =\n getActivity().getContentResolver().query(MovieContract.ReviewEntry.CONTENT_URI,\n null,\n MovieContract.ReviewEntry.COLUMN_MOVIE_KEY + \" = ?\",\n new String[]{movieId},\n null);\n ArrayList<MovieTrailerModel> movieTrailerModels = new ArrayList<>();\n ArrayList<MovieReviewModel> movieReviewModels = new ArrayList<>();\n if (trailerCursor != null) {\n while (trailerCursor.moveToNext()) {\n movieTrailerModels.add(new MovieTrailerModel(getActivity(), trailerCursor));\n }\n trailerCursor.close();\n }\n if (reviewCursor != null) {\n while (reviewCursor.moveToNext()) {\n movieReviewModels.add(new MovieReviewModel(getActivity(), reviewCursor));\n }\n reviewCursor.close();\n }\n movieModel.setReviews(movieReviewModels);\n movieModel.setTrailers(movieTrailerModels);\n movieModels.add(movieModel);\n }\n cursor.close();\n }\n movieGridAdapter.setMovieModels(movieModels);\n }", "private ArrayList<MovieItem> requestMovieList(int movieType){\n\n //create array list buffer\n ArrayList<MovieItem> movies = new ArrayList<>();\n\n //check if the movie list type needs to be refreshed\n if(mRefreshStaff.needToRefresh(movieType)){\n //need to refresh movie list, make an API call to TheMovieDB API\n mMoviesButler.requestMovies(movieType);\n\n //send toast message to user\n Toast.makeText(mActivityContext, getString(R.string.str_api_call),\n Toast.LENGTH_SHORT).show();\n }\n else{\n //do NOT need to refresh list, check if movie list is in buffer\n movies = mMovieStaff.getMovies(movieType);\n\n //check size of list from buffer\n if (movies.size() == 0) {\n //list is zero, retrieve movie list from database\n mMovieValet.requestMovies(movieType);\n\n //send toast message to user\n Toast.makeText(mActivityContext, getString(R.string.str_retrieve_from_db),\n Toast.LENGTH_SHORT).show();\n }\n }\n\n //return poster items\n return movies;\n\n }", "@Test\n public void testAddMovieActor() {\n final ArrayList<Actor> expectedList1 = new ArrayList<>();\n final ArrayList<Actor> expectedList2 = new ArrayList<>();\n final ArrayList<Actor> expectedList3 = new ArrayList<>();\n Actor actor1 = new Actor(actorMacchio);\n Actor actor2 = new Actor(actorFreeman);\n\n movie1.addActor(actor1);\n movie1.addActor(actor2);\n movie1.addActor(actor1);\n expectedList1.add(actor1);\n expectedList1.add(actor2);\n movie2.addActor(actor1);\n expectedList2.add(actor1);\n movie3.addActor(actor2);\n expectedList3.add(actor2);\n movie4.addActor(actor1);\n movie4.addActor(actor2);\n\n assertEquals(expectedList1, movie1.getActors());\n assertEquals(expectedList2, movie2.getActors());\n assertEquals(expectedList3, movie3.getActors());\n assertEquals(expectedList1, movie4.getActors());\n }", "@Override\n\tpublic void addShowTime(ShowTime movieShowTimes) {\n\t\tif(this.moviesListed == null) {\n\t\t\tthis.moviesListed = new ArrayList<ShowTime>();\n\t\t}\n\t\tthis.moviesListed.add(movieShowTimes);\n\t}", "public long addMovieToFavorites(long movieId) {\n if (!isMovieIsFavorite(movieId)) {\n SQLiteDatabase database = this.getWritableDatabase();\n ContentValues values = insertFavoriteMovieIntoContentValues(movieId);\n long rowId = database.insert(FavoriteMoviesEntry.TABLE_NAME, null, values);\n database.close();\n return rowId;\n } else return 0;\n }", "@Override\n public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {\n super.onViewCreated(view, savedInstanceState);\n\n final EditText etInput = view.findViewById(R.id.etInput);\n Button searchBtn = view.findViewById(R.id.searchBtn);\n RecyclerView rvSearchRes = view.findViewById(R.id.rvSearchResults);\n\n searchResults = new ArrayList<>();\n\n // Create the adapter\n final MovieSearchAdapter movieAdapter = new MovieSearchAdapter(getContext(), searchResults);\n\n // Set the adapter on the recycler view\n rvSearchRes.setAdapter(movieAdapter);\n\n // Set a Layout Manager\n rvSearchRes.setLayoutManager(new LinearLayoutManager(getContext()));\n\n searchBtn.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n String query = etInput.getText().toString();\n if (query.isEmpty()) {\n Toast.makeText(getContext(), \"Empty Field\", Toast.LENGTH_SHORT).show();\n return;\n }\n\n Toast.makeText(getContext(), query, Toast.LENGTH_SHORT).show();\n\n String URL = String.format(\"https://api.themoviedb.org/3/search/movie?api_key=%s&language=en-US&query=%s&page=1&include_adult=false\", KEY, query);\n\n final AsyncHttpClient client = new AsyncHttpClient();\n client.get(URL, new JsonHttpResponseHandler() {\n @Override\n public void onSuccess(int i, Headers headers, JSON json) {\n Log.d(TAG, \"onSuccess\");\n JSONObject jsonObject = json.jsonObject;\n try {\n JSONArray results = jsonObject.getJSONArray(\"results\");\n Log.i(TAG, \"Releases: \" + results.toString());\n\n searchResults.addAll(Movie.fromJsonArray(results));\n movieAdapter.notifyDataSetChanged();\n Log.i(TAG, \"Movies: \" + searchResults.size());\n } catch (JSONException e) {\n Log.e(TAG, \"Hit JSON Exception\", e);\n }\n }\n\n @Override\n public void onFailure(int i, Headers headers, String s, Throwable throwable) {\n Log.d(TAG, \"onFailure\" + i);\n }\n });\n }\n });\n\n }", "public void addFilm(Film film){\r\n this.cinema_film_list.add(film);\r\n }", "Movie addMovie(final Movie movie);", "@SuppressWarnings(\"ConstantConditions\")\n //private final String uid = firebaseAuth.getCurrentUser().getUid();\n //private String current_subject_Selected;\n\n\n @Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_watch_later_list);\n\n\n Context context = getApplicationContext();\n\n progressBar = (ProgressBar) findViewById(R.id.progressBar);\n noMoviesSaved = (TextView) findViewById(R.id.noMovieSaved);\n //Initializing our Recyclerview\n mRecyclerView = (RecyclerView) findViewById(R.id.myMovieList);\n\n if (mRecyclerView != null) {\n //to enable optimization of recyclerview\n mRecyclerView.setHasFixedSize(true);\n }\n\n //This determines the number of movie results in a row\n width = screenMangement();\n\n LinearLayoutManager mLayoutManager = new LinearLayoutManager(context);\n mLayoutManager.setStackFromEnd(true);\n mLayoutManager.setReverseLayout(true);\n mRecyclerView.setLayoutManager(mLayoutManager);\n\n //Gets current logged in user\n FirebaseAuth user = FirebaseAuth.getInstance();\n\n adapter = new FirebaseRecyclerAdapter<MovieResultsRepresentation, MyMovieViewHolder>(\n MovieResultsRepresentation.class,\n R.layout.movieitem,\n MyMovieViewHolder.class,\n //referencing the node where we want the database to store the data from our Object\n myAccountReference.child(user.getUid()).getRef()\n ) {\n\n @Override\n public MyMovieViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.movieitem, parent, false);\n return new MyMovieViewHolder(view);\n }\n\n\n @Override\n public DatabaseReference getRef(int position) {\n return super.getRef(position);\n }\n\n\n @Override\n protected void populateViewHolder(final MyMovieViewHolder viewHolder, final MovieResultsRepresentation model, final int position) {\n\n //Loads movie poster into imageview\n Picasso.with(getApplicationContext()).load(\"http://image.tmdb.org/t/p/w185/\" + model.getMoviePoster()).resize(width, (int) (width * 1.5)).into(viewHolder.moviePicture);\n\n\n viewHolder.moviePicture.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n //When user clicks on movie for more details, it passes the data to the details activity\n Intent intent = new Intent(getApplicationContext(), DetailActivity.class)\n .putExtra(\"title\", model.getMovieName())\n .putExtra(\"vote_average\", model.getVotes() + \"\")\n .putExtra(\"overview\", model.getMovieOverview())\n .putExtra(\"popularity\", model.getMoviePopularity() + \"\")\n .putExtra(\"release_date\", model.getMovieReleaseDate())\n .putExtra(\"vote_count\", model.getMovieVoteCount())\n .putExtra(\"Picture\", model.getMoviePoster());\n\n startActivity(intent);\n\n }\n });\n\n\n viewHolder.movieName.setText(model.getMovieName());\n\n\n viewHolder.movieRating.setText(\"Rating: \" + model.getVotes() + \"\");\n\n viewHolder.moviePopularity.setText(\"Popularity: \" + new DecimalFormat(\"#\").format(model.getMoviePopularity()));\n\n viewHolder.movieDelete.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n //Deletes movie from myWatchLater list and from the cloud\n\n getRef(viewHolder.getAdapterPosition()).removeValue();\n\n adapter.notifyDataSetChanged();\n\n toastMessage(\"Movie removed\");\n }\n });\n }\n };\n\n RecyclerView.AdapterDataObserver mObserver = new RecyclerView.AdapterDataObserver() {\n @Override\n public void onItemRangeInserted(int positionStart, int itemCount) {\n if (adapter.getItemCount() > 0) {\n noMoviesSaved.setVisibility(View.GONE);\n mRecyclerView.setVisibility(View.VISIBLE);\n mRecyclerView.smoothScrollToPosition(adapter.getItemCount() - 1);\n adapter.notifyDataSetChanged();\n\n\n } else {\n noMoviesSaved.setVisibility(View.VISIBLE);\n mRecyclerView.setVisibility(View.INVISIBLE);\n\n\n }\n }\n\n @Override\n public void onItemRangeRemoved(int positionStart, int itemCount) {\n if (adapter.getItemCount() > 0) {\n noMoviesSaved.setVisibility(View.GONE);\n mRecyclerView.setVisibility(View.VISIBLE);\n\n\n } else {\n mRecyclerView.setVisibility(View.INVISIBLE);\n noMoviesSaved.setVisibility(View.VISIBLE);\n }\n }\n };\n adapter.registerAdapterDataObserver(mObserver);\n\n mRecyclerView.setAdapter(adapter);\n\n\n myAccountReference.child(user.getUid()).addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n progressBar.setVisibility(View.GONE);\n\n if (dataSnapshot.hasChildren()) {\n mRecyclerView.setVisibility(View.VISIBLE);\n\n } else {\n mRecyclerView.setVisibility(View.INVISIBLE);\n noMoviesSaved.setVisibility(View.VISIBLE);\n }\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n toastMessage(\"Error occured\");\n\n }\n });\n\n }", "@Override public void refresh() {\n if (search == null) {\n movies = new ArrayList<Movie>(getService().getMovies());\n }\n \n if (movies == null) {\n movies = new ArrayList<Movie>();\n }\n // sort movies according to the default sort preference.\n final Comparator<Movie> comparator = MOVIE_ORDER.get(getService().getAllMoviesSelectedSortIndex());\n if (movies != null && comparator != null) {\n Collections.sort(movies, comparator);\n }\n super.refresh();\n }", "private void showMovieList(ArrayList<MovieItem> movies, int request){\n //instantiate HouseKeeper that is in charge of displaying the movie list\n SwipeKeeper swipe = (SwipeKeeper)mKeeperStaff.getHouseKeeper(SwipeHelper.NAME_ID);\n\n //notify houseKeeper to update movie list\n swipe.updateMovieList(movies, request);\n }", "private List<MovieDetails> movieList() {\n List<MovieDetails> movieDetailsList = new ArrayList<>();\n movieDetailsList.add(new MovieDetails(1, \"Movie One\", \"Movie One Description\"));\n movieDetailsList.add(new MovieDetails(2, \"Movie Two\", \"Movie Two Description\"));\n movieDetailsList.add(new MovieDetails(2, \"Movie Two - 1 \", \"Movie Two Description - 1 \"));\n\n return movieDetailsList;\n }", "@Override\n public void addItem(int position) {\n // Getting the auto complete input field\n AutoCompleteTextView source = (AutoCompleteTextView) v.findViewById(R.id.auto_complete_input);\n // Getting the Title of the ingredient\n String title = source.getText().toString();\n // Check if we have already added this ingredient\n boolean item_seen = false;\n\n // Creating a new object for the recyclerview that can later be displayed\n IngredientItem temp = new IngredientItem(R.drawable.ic_restaurant_menu_green_24dp, source.getText().toString(), all_ingredients.get(title).get(1), all_ingredients.get(title).get(2), all_ingredients.get(title).get(3));\n\n // For every item in our recyclerview ...\n for (int i = 0; i < rv_adapt.getItemCount(); i++)\n // ... if the ingredient we want to add equals the item we recognize as it is already present within\n // our list of ingredients, then we set the item as already seen, so it does not get added again\n if (ingredients.get(i).getTitle().equals(title)) {\n // This log can be uncommented to check if the item is known yet\n // Log.d(\"Debug\", ingredients.get(i).getTitle() + \" \" + title + \" \" + rv_adapt.getItemCount());\n item_seen = true;\n }\n\n // If we recognize the item which should be added as a valid item and we haven't added it\n // yet, then we can add it now to our list of ingredients and notify our adaptor to refresh.\n if (all_ingredients.containsKey(title) && !item_seen) {\n // Notification in Logcat that item xyz has been added\n Log.d(\"Debug\", \"Adding \" + title + \" \" + all_ingredients.get(title));\n ingredients.add(temp);\n rv_adapt.notifyItemInserted(position);\n }\n\n // After adding an item the auto complete input field is getting emptied again, so\n // a new item can be added. Further the add button is being disabled for cosmetic purposes.\n source.setText(\"\");\n v.findViewById(R.id.button_add).setEnabled(false);\n\n // If we have 1+ Items in the recyclerview then the search is being enabled, as\n // it makes no sense to search for 0 items\n if (rv_adapt.getItemCount() > 0)\n v.findViewById(R.id.button_search).setEnabled(true);\n\n // Just a quick log to see which ingredients are present in our list\n // (Debugging purposes)\n Log.d(\"Debug\", ingredients.toString());\n\n // Notifying the adapter to refresh\n rv_adapt.notifyDataSetChanged();\n }", "@Override\n protected void onPostResume() {\n super.onPostResume();\n if (movieList != null){movieList.clear();}\n movieList.addAll((ArrayList<DbMovie>) db.getAllFavouritesList());\n if (favouritesRecyclerViewAdapter != null) {\n favouritesRecyclerViewAdapter.notifyDataSetChanged();\n }\n if (db.getMoviesCount() == 0) {\n noResultTextView.setText(\"No results found!!!\");\n }\n }", "public void addMovie(String name, String[] actors) {\n\t\t\n\t\tArrayList<Actor> movieActors = new ArrayList<>(); // list of actors in the movie\n\t\tMovie newMovie = new Movie(name, movieActors);\n\t\tboolean addedMovie = false;\n\t\tfor(Movie movie : this.movieList) {\n\t\t\tif(movie.getName().equals(newMovie.getName())) {\n\t\t\t\taddedMovie = true;\n\t\t\t}\n\t\t}\n\t\tif(addedMovie == false) {\n\t\t\tArrayList<Movie> actorMovies = new ArrayList<>(); //list of movies with actor in\n\t\t\tthis.movieList.add(newMovie);\n\t\t\tactorMovies.add(newMovie);\n\t\t\tfor(String actorName: actors) {\n\t\t\t\tActor newActor = new Actor(actorName, actorMovies);\n\t\t\t\tmovieActors.add(newActor);\n\t\t\t\tboolean added = false;\n\t\t\t\tfor(Actor actor : this.actorList) {\n\t\t\t\t\tif (actor.getName().equals(newActor.getName())) {\n\t\t\t\t\t\tadded = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(added == false) this.actorList.add(newActor);\n\t\t\t}\n\t\t}\n\t}", "public void onMoviesReceive(ObservableList<Movie> movieList) {\n\n // Set table's data source\n movieTable.setItems(movieList);\n\n // Initialize columns\n titleColumn.setCellValueFactory(new PropertyValueFactory<>(\"movieTitle\"));\n yearColumn.setCellValueFactory(new PropertyValueFactory<>(\"releaseDate\"));\n\n // Hide progress indicator\n resultsProgressIndicator.setVisible(false);\n\n Platform.runLater(() -> {\n\n setLblStatus(\"Search results fetched successfully.\");\n });\n }", "static void mysteryInsert(String name, movieNode movieNode) {\n if (flag == 1) {\n actorList actorlist = new actorList();\n holder_actorList = actorlist; //so that it can be accessed outside the if block\n actorlist.insertAtFront(name, movieNode);\n flag++;\n }\n else {\n\n holder_actorList.insertAtFront(name, movieNode);\n }\n }", "public List<String> getMovieList(){\n Set<String> movieList= new HashSet<String>();\n List<MovieListing> showtimes= ListingManager.getShowtimes();\n for(int i=0;i<history.size();i++){\n CustomerTransaction curr= history.get(i);\n for(int j=0;j<showtimes.size(); j++){\n MovieListing show = showtimes.get(j);\n if (show.sameListing(curr.getListingID())){\n movieList.add(show.getTitle());\n\n }\n }\n }\n return new ArrayList<>(movieList);\n }", "public void onClicked() {\n mypreference = PreferenceManager.getDefaultSharedPreferences(getContext());\n SharedPreferences.Editor editorpref = mypreference.edit();\n Gson gson = new Gson();\n //retrieve the stored ArrayList of fovorite movies as json format\n String storedJsonList = mypreference.getString(\"storedjsonList\", \"\");\n // get the type of this json format\n Type type = new TypeToken<ArrayList<ItemsClass>>() {\n }.getType();\n ArrayList<ItemsClass> movieArrayList = new ArrayList<ItemsClass>();\n //create array list of the retrieved json\n // store it in my Arraylist\n movieArrayList = gson.fromJson(storedJsonList, type);\n\n// favo.setSelected(va[0]);\n ischecked = va[0];\n if (va[0] == true) {\n\n if (movieArrayList == null) {\n\n favoImageButton.setImageResource(R.drawable.liked);\n\n String loadedPosterString = encodeTobase64(theposterImage);\n\n\n serItems.add(new ItemsClass(loadedPosterString, title, releaseDate, overview, rate, id));\n\n Toast.makeText(getContext(), \"you have favo this movie with id of \" + id + \"and you list size is\" + serItems.size(), Toast.LENGTH_SHORT).show();\n //convert all the arraylist with the old and new Items to Json format\n String jsonList = gson.toJson(serItems);\n //save to sharedPreference\n editorpref.putString(\"storedjsonList\", jsonList);\n editorpref.commit();\n va[0] = !va[0];\n\n } else if (movieArrayList != null) {\n serItems = movieArrayList;\n for (int i = 0; i < serItems.size(); i++) {\n int detectId = serItems.get(i).getId();\n if (serItems.size() > 0 && detectId == id) {\n Toast.makeText(getContext(), \"you already have this movie in favorite list \", Toast.LENGTH_SHORT).show();\n favoImageButton.setImageResource(R.drawable.liked);\n break;\n } else if (serItems.size() > 0 && detectId != id && i < serItems.size() - 1) {\n\n continue;\n\n } else if (detectId != id && i == serItems.size() - 1 && i > serItems.size() - 2) {\n Toast.makeText(getContext(), \"you have favo this movie with id of \" + id, Toast.LENGTH_SHORT).show();\n favoImageButton.setImageResource(R.drawable.like);\n serItems.add(new ItemsClass(storedPoster, title, releaseDate, overview, rate, id));\n serItems.size();\n //convert all the arraylist with the old and new Items to Json format\n String jsonList = gson.toJson(serItems);\n //save to sharedPreference\n editorpref.putString(\"storedjsonList\", jsonList);\n editorpref.commit();\n va[0] = !va[0];\n break;\n }\n\n }\n }\n\n } else {\n if (movieArrayList != null) {\n serItems = movieArrayList;\n for (int i = 0; i < serItems.size(); i++) {\n\n int detectId = serItems.get(i).getId();\n if (i < serItems.size() && serItems.size() > 0 && detectId == id) {\n Toast.makeText(getContext(), \"you have deleted this movie this movie with id of \" + id, Toast.LENGTH_SHORT).show();\n favoImageButton.setImageResource(R.drawable.like);\n mypreference = getContext().getSharedPreferences(\"moviepref\", Context.MODE_PRIVATE);\n editorpref.putString(\"storedPoster\", \"\");\n editorpref.putString(\"storedTitle\", \"\");\n editorpref.putString(\"storedOverview\", \"\");\n editorpref.putString(\"storedDate\", \"\");\n editorpref.putFloat(\"storedrating\", (float) 0.0);\n editorpref.commit();\n va[0] = !va[0];\n//\n break;\n } else if (detectId != id && i < serItems.size() - 1) {\n continue;\n } else if (detectId == id && i == serItems.size() - 1) {\n Toast.makeText(getContext(), \" actually you don't have this movie in your favorite list \", Toast.LENGTH_SHORT).show();\n }\n\n }\n }\n }\n }", "@Override\n public boolean hasDuplicates() {\n ArrayList<String> itemList = new ArrayList(Arrays.asList(\"\"));\n Node currNode = this.head;\n while(true){\n if(itemList.contains(currNode.getItem())){ // need to edit\n return true;\n }else{\n itemList.add(currNode.getItem());\n }\n if(currNode.getNextNode() == null){\n break;\n }\n currNode = currNode.getNextNode();\n }\n return false;\n }", "public void insertTrendingVideosInDatabase(ArrayList<VideoDTO> listVideos) {\n try {\n SQLiteDatabase database = this.getReadableDatabase();\n database.enableWriteAheadLogging();\n ContentValues initialValues;\n for (VideoDTO videoDTO : listVideos) {\n //if video is not available in database, execute INSERT\n if (!isTrendingVideoAvailableInDB(videoDTO.getVideoId())) {\n if(videoDTO.getVideoShortDescription() != null && videoDTO.getVideoName() != null) {\n initialValues = new ContentValues();\n initialValues.put(TrendingVideoTable.KEY_VIDEO_ID, videoDTO.getVideoId());\n initialValues.put(TrendingVideoTable.KEY_VIDEO_NAME, videoDTO.getVideoName());\n initialValues.put(TrendingVideoTable.KEY_VIDEO_SHORT_DESC, videoDTO.getVideoShortDescription());\n initialValues.put(TrendingVideoTable.KEY_VIDEO_LONG_DESC, videoDTO.getVideoLongDescription());\n initialValues.put(TrendingVideoTable.KEY_VIDEO_SHORT_URL, videoDTO.getVideoShortUrl());\n initialValues.put(TrendingVideoTable.KEY_VIDEO_LONG_URL, videoDTO.getVideoLongUrl());\n initialValues.put(TrendingVideoTable.KEY_VIDEO_THUMB_URL, videoDTO.getVideoThumbnailUrl());\n initialValues.put(TrendingVideoTable.KEY_VIDEO_STILL_URL, videoDTO.getVideoStillUrl());\n initialValues.put(TrendingVideoTable.KEY_VIDEO_COVER_URL, videoDTO.getVideoCoverUrl());\n initialValues.put(TrendingVideoTable.KEY_VIDEO_WIDE_STILL_URL, videoDTO.getVideoWideStillUrl());\n initialValues.put(TrendingVideoTable.KEY_VIDEO_BADGE_URL, videoDTO.getVideoBadgeUrl());\n initialValues.put(TrendingVideoTable.KEY_VIDEO_DURATION, videoDTO.getVideoDuration());\n initialValues.put(TrendingVideoTable.KEY_VIDEO_TAGS, videoDTO.getVideoTags());\n if (videoDTO.isVideoIsFavorite())\n initialValues.put(TrendingVideoTable.KEY_VIDEO_IS_FAVORITE, 1);\n else\n initialValues.put(TrendingVideoTable.KEY_VIDEO_IS_FAVORITE, 0);\n initialValues.put(TrendingVideoTable.KEY_VIDEO_INDEX, videoDTO.getVideoIndex());\n initialValues.put(TrendingVideoTable.KEY_VIDEO_SOCIAL_URL, videoDTO.getVideoSocialUrl());\n database.insert(TrendingVideoTable.TRENDING_VIDEO_TABLE, null, initialValues);\n }\n }else{ // Perform UPDATE query on available record\n ContentValues updateExistingVideo = new ContentValues();\n updateExistingVideo.put(TrendingVideoTable.KEY_VIDEO_ID, videoDTO.getVideoId());\n updateExistingVideo.put(TrendingVideoTable.KEY_VIDEO_NAME, videoDTO.getVideoName());\n updateExistingVideo.put(TrendingVideoTable.KEY_VIDEO_SHORT_DESC, videoDTO.getVideoShortDescription());\n updateExistingVideo.put(TrendingVideoTable.KEY_VIDEO_LONG_DESC, videoDTO.getVideoLongDescription());\n updateExistingVideo.put(TrendingVideoTable.KEY_VIDEO_SHORT_URL, videoDTO.getVideoShortUrl());\n updateExistingVideo.put(TrendingVideoTable.KEY_VIDEO_LONG_URL, videoDTO.getVideoLongUrl());\n updateExistingVideo.put(TrendingVideoTable.KEY_VIDEO_THUMB_URL, videoDTO.getVideoThumbnailUrl());\n updateExistingVideo.put(TrendingVideoTable.KEY_VIDEO_STILL_URL, videoDTO.getVideoStillUrl());\n updateExistingVideo.put(TrendingVideoTable.KEY_VIDEO_COVER_URL, videoDTO.getVideoCoverUrl());\n updateExistingVideo.put(TrendingVideoTable.KEY_VIDEO_WIDE_STILL_URL, videoDTO.getVideoWideStillUrl());\n updateExistingVideo.put(TrendingVideoTable.KEY_VIDEO_BADGE_URL, videoDTO.getVideoBadgeUrl());\n updateExistingVideo.put(TrendingVideoTable.KEY_VIDEO_DURATION, videoDTO.getVideoDuration());\n updateExistingVideo.put(TrendingVideoTable.KEY_VIDEO_TAGS, videoDTO.getVideoTags());\n if (videoDTO.isVideoIsFavorite())\n updateExistingVideo.put(TrendingVideoTable.KEY_VIDEO_IS_FAVORITE, 1);\n else\n updateExistingVideo.put(TrendingVideoTable.KEY_VIDEO_IS_FAVORITE, 0);\n// updateExistingVideo.put(VideoTable.KEY_VIDEO_INDEX, videoDTO.getVideoIndex());\n\n updateExistingVideo.put(TrendingVideoTable.KEY_VIDEO_SOCIAL_URL, videoDTO.getVideoSocialUrl());\n\n database.update(TrendingVideoTable.TRENDING_VIDEO_TABLE, updateExistingVideo, TrendingVideoTable.KEY_VIDEO_ID + \"=?\", new String[]{\"\" + videoDTO.getVideoId()});\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "@Override\r\n\tpublic boolean addMovie(String actor1, String actor2, String movieName)\r\n\t{\r\n\t\tActor act1 = new Actor(actor1);\r\n\t\tActor act2 = new Actor(actor2);\r\n\t\t\r\n\t\tif(graph.containsVertex(act1) && graph.containsVertex(act2))\r\n\t\t{\r\n\t\t\tif(graph.containsEdge(act1,act2 ) == false)\r\n\t\t\t{\r\n\t\t\t\tgraph.addEdge(act1, act2, 1, movieName);\r\n\t\t\t\t\r\n\t\t\t\tMovieEdge movieTitle = graph.addEdge(act1, act2, 1, movieName);\r\n\r\n\t\t\t\tmovieTitles.add(movieTitle.getMovieName());\r\n\t\t\t\t\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\n final View rootView = inflater.inflate(R.layout.fragment_recycler_view, container, false);\n\n mRecyclerView = (RecyclerView) rootView.findViewById(R.id.cardList);\n\n mRecyclerView.setHasFixedSize(true);\n\n mLayoutManager = new LinearLayoutManager(getActivity());\n\n mRecyclerView.setLayoutManager(mLayoutManager);\n\n mRecyclerViewAdapter = new MyRecyclerViewAdapter(getActivity(), movieData.getMoviesList());\n mRecyclerView.setAdapter(mRecyclerViewAdapter);\n\n// mRecyclerViewAdapter.SetOnItemClickListener(new MyRecyclerViewAdapter.OnItemClickListener() {\n mRecyclerViewAdapter.SetOnItemClickListener(new MyRecyclerViewAdapter.OnItemClickListener() {\n @Override\n public void onItemClick(View view, int position) {\n HashMap<String, ?> movie = (HashMap<String, ?>) movieData.getItem(position);\n mListener.onListItemSelected(position, movie);\n /*getFragmentManager().beginTransaction()\n .replace(R.id.frag ment_recycler_view, Fragment_PageDetail.newInstance(movie))\n .addToBackStack(null)\n .commit();*/\n }\n\n @Override\n public void onItemLongClick(View view, int position) {\n movieData.addItem(position, (HashMap) ((HashMap) movieData.getItem(position)).clone());\n mRecyclerViewAdapter.notifyItemInserted(position + 1);\n }\n\n\n });\n\n\n //Item Animation\n itemAnimation();\n //Adapter Animation\n adapterAnimation();\n\n Button clearAll = (Button) rootView.findViewById(R.id.buttonClearAll);\n clearAll.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n for (int i = 0; i < mRecyclerViewAdapter.getItemCount(); i++) {\n HashMap<String, Boolean> item = (HashMap<String, Boolean>) movieData.getItem(i);\n item.put(\"selection\", false);\n }\n mRecyclerViewAdapter.notifyDataSetChanged();\n }\n });\n\n Button selectAll = (Button) rootView.findViewById(R.id.buttonSelectAll);\n selectAll.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n for (int i = 0; i < mRecyclerViewAdapter.getItemCount(); i++) {\n HashMap<String, Boolean> item = (HashMap<String, Boolean>) movieData.getItem(i);\n item.put(\"selection\", true);\n }\n mRecyclerViewAdapter.notifyDataSetChanged();\n }\n });\n\n Button delete = (Button) rootView.findViewById(R.id.buttonDelete);\n delete.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n for (int i = mRecyclerViewAdapter.getItemCount() - 1; i >=0; i--) {\n HashMap<String, Boolean> item = (HashMap<String, Boolean>) movieData.getItem(i);\n boolean selection = item.get(\"selection\");\n if (selection == true) {\n movieData.removeItem(i);\n mRecyclerViewAdapter.notifyItemRemoved(i);\n }\n }\n }\n });\n\n Button sort = (Button) rootView.findViewById(R.id.buttonSort);\n sort.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n Collections.sort(movieData.getMoviesList(), new Comparator<Map<String, ?>>() {\n @Override\n public int compare(Map<String, ?> map, Map<String, ?> t1) {\n HashMap<String, String> item1 = (HashMap<String, String>) map;\n HashMap<String, String> item2 = (HashMap<String, String>) t1;\n return Integer.valueOf(item2.get(\"year\")) - Integer.valueOf(item1.get(\"year\"));\n }\n });\n for (int i = mRecyclerViewAdapter.getItemCount() - 1; i >=0; i--) {\n HashMap<String, Boolean> item = (HashMap<String, Boolean>) movieData.getItem(i);\n if (i < 3) {\n\n }\n }\n mRecyclerViewAdapter.notifyDataSetChanged();\n }\n });\n\n\n return rootView;\n }", "public ArrayList<VideoDTO> getFavouriteVideosArrayList() {\n try {\n ArrayList<VideoDTO> arrayListNewVideoDTOs = new ArrayList<VideoDTO>();\n SQLiteDatabase database = this.getWritableDatabase();\n database.enableWriteAheadLogging();\n String getFavoutiteVideosListQuery = \"SELECT * FROM \" + VideoTable.VIDEO_TABLE + \" WHERE \" + VideoTable.KEY_VIDEO_IS_FAVORITE + \"=1 \" + \" GROUP BY \" + VideoTable.KEY_VIDEO_ID + \" ORDER BY \" + VideoTable.KEY_VIDEO_NAME + \" ASC\";\n Cursor cursor = database.rawQuery(getFavoutiteVideosListQuery, null);\n if (cursor.moveToFirst()) {\n do {\n VideoDTO videoDTO = new VideoDTO();\n videoDTO.setVideoId(cursor.getLong(cursor.getColumnIndex(VideoTable.KEY_VIDEO_ID)));\n videoDTO.setVideoName(cursor.getString(cursor.getColumnIndex(VideoTable.KEY_VIDEO_NAME)));\n videoDTO.setVideoShortDescription(cursor.getString(cursor.getColumnIndex(VideoTable.KEY_VIDEO_SHORT_DESC)));\n videoDTO.setVideoLongDescription(cursor.getString(cursor.getColumnIndex(VideoTable.KEY_VIDEO_LONG_DESC)));\n videoDTO.setVideoShortUrl(cursor.getString(cursor.getColumnIndex(VideoTable.KEY_VIDEO_SHORT_URL)));\n videoDTO.setVideoLongUrl(cursor.getString(cursor.getColumnIndex(VideoTable.KEY_VIDEO_LONG_URL)));\n videoDTO.setVideoThumbnailUrl(cursor.getString(cursor.getColumnIndex(VideoTable.KEY_VIDEO_THUMB_URL)));\n videoDTO.setVideoStillUrl(cursor.getString(cursor.getColumnIndex(VideoTable.KEY_VIDEO_STILL_URL)));\n videoDTO.setVideoCoverUrl(cursor.getString(cursor.getColumnIndex(VideoTable.KEY_VIDEO_COVER_URL)));\n videoDTO.setVideoWideStillUrl(cursor.getString(cursor.getColumnIndex(VideoTable.KEY_VIDEO_WIDE_STILL_URL)));\n videoDTO.setVideoBadgeUrl(cursor.getString(cursor.getColumnIndex(VideoTable.KEY_VIDEO_BADGE_URL)));\n videoDTO.setVideoDuration(cursor.getLong(cursor.getColumnIndex(VideoTable.KEY_VIDEO_DURATION)));\n videoDTO.setVideoTags(cursor.getString(cursor.getColumnIndex(VideoTable.KEY_VIDEO_TAGS)));\n if (cursor.getInt(cursor.getColumnIndex(VideoTable.KEY_VIDEO_IS_FAVORITE)) == 0)\n videoDTO.setVideoIsFavorite(false);\n else\n videoDTO.setVideoIsFavorite(true);\n\n videoDTO.setVideoIndex(cursor.getInt(cursor.getColumnIndex(VideoTable.KEY_VIDEO_INDEX)));\n videoDTO.setPlaylistName(cursor.getString(cursor.getColumnIndex(VideoTable.KEY_PLAYLIST_NAME)));\n videoDTO.setPlaylistId(cursor.getLong(cursor.getColumnIndex(VideoTable.KEY_PLAYLIST_ID)));\n videoDTO.setPlaylistThumbnailUrl(cursor.getString(cursor.getColumnIndex(VideoTable.KEY_PLAYLIST_THUMB_URL)));\n videoDTO.setPlaylistShortDescription(cursor.getString(cursor.getColumnIndex(VideoTable.KEY_PLAYLIST_SHORT_DESC)));\n videoDTO.setPlaylistLongDescription(cursor.getString(cursor.getColumnIndex(VideoTable.KEY_PLAYLIST_LONG_DESC)));\n videoDTO.setPlaylistTags(cursor.getString(cursor.getColumnIndex(VideoTable.KEY_PLAYLIST_TAGS)));\n videoDTO.setPlaylistReferenceId(cursor.getString(cursor.getColumnIndex(VideoTable.KEY_PLAYLIST_REFERENCE_ID)));\n videoDTO.setVideoSocialUrl(cursor.getString(cursor.getColumnIndex(VideoTable.KEY_VIDEO_SOCIAL_URL)));\n\n arrayListNewVideoDTOs.add(videoDTO);\n } while (cursor.moveToNext());\n }\n\n cursor.close();\n return arrayListNewVideoDTOs;\n } catch (Exception e) {\n e.printStackTrace();\n return new ArrayList<VideoDTO>();\n }\n\n }", "private void retrieveFavoritesCompleted(ArrayList<MovieItem> movies){\n //get number of favorite movies in the list\n int count = movies.size();\n\n //check if there are any movies\n if(count > 0){\n //save movies to buffer\n mMovieStaff.setMovies(movies, PosterHelper.NAME_ID_FAVORITE);\n }\n\n //check if the current poster fragment is displaying the user favorite list\n if(mMovieType == PosterHelper.NAME_ID_FAVORITE){\n //yes, show new movie list\n showMovieList(movies, PosterHelper.NAME_ID_FAVORITE);\n }\n }", "public void addReviews(List<Review> reviewsLoaded){\n\n if(reviewsLoaded==null)\n return;\n\n reviews.addAll(reviewsLoaded);\n notifyDataSetChanged();\n }", "public static void parseMovieJSONResult( String jsonResult, ArrayList<Movie> moviesList) {\n\n Movie newMovie;\n try {\n // Create the root JSONObject from the JSON string.\n JSONObject jsonRootObject = new JSONObject(jsonResult);\n Log.d(TAG, \".parseMovieJSONResult(): object parsed from JSON: \" + jsonRootObject.toString());\n\n //Get the instance of JSONArray that contains JSONObjects\n JSONArray jsonArray = jsonRootObject.optJSONArray(RESULT_ARRAY);\n\n //Iterate the jsonArray and print the info of JSONObjects\n for(int i=0; i < jsonArray.length(); i++){\n JSONObject jsonObject = jsonArray.getJSONObject(i);\n\n // parse all elements of JSON object we are interested in\n int id = Integer.parseInt(jsonObject.optString(ID).toString());\n String posterPath = jsonObject.optString(POSTER_PATH).toString();\n String plotSynopsis = jsonObject.optString(PLOT_SYNOPSIS).toString();\n String title = jsonObject.optString(TITLE).toString();\n float rating = Float.parseFloat(jsonObject.optString(RATING).toString());\n String releaseDate = jsonObject.optString(RELEASE_DATE).toString();\n\n newMovie = new Movie(id, title, posterPath, plotSynopsis, rating, releaseDate);\n moviesList.add(newMovie);\n }\n Log.d(TAG, \".parseMovieJSONResult(): JSON parsed to movie array of length\" + moviesList.size());\n } catch (JSONException e) {\n Log.e(TAG, \".parseMovieJSONResult(): JSON parsing failed: \" + e.getMessage());\n e.printStackTrace();\n }\n }", "private void Query() {\n\t\tCursor cursor = db.query(\"movie\", null, null, null, null, null, null); \n while (cursor.moveToNext()) { \n String moviename = cursor.getString(0); \n String moviejianjie = cursor.getString(10);\n Movie movie = new Movie(moviename,R.drawable.poster,moviejianjie); \n\t//\t\t Toast.makeText(getActivity(), moviejianjie, Toast.LENGTH_SHORT).show();\n if(cursor.getInt(11)==2)\n \tmovieList.add(movie); \n }\n cursor.close();\n\t}", "public void Adding(String t, int y, int d, double r){\n\t//checks if all parameters are valid. If not, throws exception\n\ttry{\n\t//if needed increases then movie already exists and if statement to add movie won't be valid\n\tint needed = 0;\n\t//for loop to compare all movie titles and years of release in the list\n\tfor(int x=0; x < list.size();x++){\n\t//if title and year of release already exist in inventory\n\tif (list.get(x).getTitle().equals(t) && list.get(x).getYearReleased() == y) {\n\tneeded=1;\n\t//get old quantity \n\tint newQuantity = list.get(x).getQuantity();\n\t//increase it's value by one\n\tnewQuantity++;\n\t//update quantity for that movie by one\n\tlist.get(x).setQuantity(newQuantity);\n\t//update rating of movie to new one\n\tlist.get(x).setRating(r);\n\t} \n\t}\n\t//if needed is still 0\n\tif(needed == 0){\n\t//add new movie with all the parameters provided\n\tMovie movie = new Movie(t,y,r,d);\t\n\t//location of arraylist where movie is added\n\tlist.add(list.size(),movie);\n\t//since it's a new movie quantity is set to 1\n\tlist.get((list.size())-1).setQuantity(1);\n\t}\n\t}\n\t// \n\tcatch(IllegalArgumentException e){\n \tSystem.out.println(\"One of the parameters is invalid so the film was not added to the inventory! \\n\");\n\t}\n\t}", "@Dao\npublic interface MovieDetailVideoListDao {\n @Insert(onConflict = OnConflictStrategy.REPLACE)\n void insertAllVideos(List<MovieDetailVideoListEntity> list);\n\n @Query(\"DELETE FROM movie_detail_video_list WHERE movie_id = :movieId\")\n void deleteAllVideos (int movieId);\n\n @Query(\"SELECT EXISTS (SELECT 1 FROM movie_detail_video_list WHERE movie_id = :movieId LIMIT 1)\")\n boolean isVideos(int movieId);\n\n @Query(\"SELECT * FROM movie_detail_video_list WHERE movie_id = :movieId ORDER BY video_list_key ASC\")\n List<MovieDetailVideoListEntity> getAllVideos(int movieId);\n}", "void putSuggestions(Context context, @NonNull List<BaseMovie> suggestions) {\n Log.d(Constants.TAG, \"[FirestorePersistentCache]::putSuggestions: adding new suggestions\");\n\n // Add missing suggestions to the SharedPreferences\n PersistentCache<BaseMovie> cache = new PersistentCache<>(context);\n Map<String, BaseMovie> missingMovies = new HashMap<>();\n for (BaseMovie suggestion : suggestions) {\n String key = SUGGESTIONS_PREFIX + suggestion.getId();\n if (cache.get(key, BaseMovie.class) == null) {\n Log.d(Constants.TAG,\n \"[FirestorePersistentCache]::putSuggestions: suggestion misssing, adding movie (\" + suggestion.getTitle() + \")\");\n missingMovies.put(key, suggestion);\n\n } else {\n Log.d(Constants.TAG,\n \"[FirestorePersistentCache]::putSuggestions: suggestion already present, skipping movie (\" + suggestion.getTitle() + \")\");\n }\n }\n\n cache.putObjects(missingMovies);\n }", "private void addToList(Place place) {\n if(!checkDuplicates(place.placeid))\n restaurantsList.add(place);\n\n\n Collections.sort(restaurantsList, new Comparator<Place>() {\n @Override\n public int compare(Place lhs, Place rhs) {\n return lhs.distance.compareTo(rhs.distance);\n }\n });\n HomepageAdapter adapterStores = new HomepageAdapter(activity, restaurantsList, mAddressOutput);\n adapterStores.setOnClickListener(new HomepageAdapter.onClickListener() {\n @Override\n public void OnClick(int position) {\n Bundle args = new Bundle();\n args.putString(\"placeid\", restaurantsList.get(position).placeid);\n activity.replaceFragments(RestaurantDetailsFragment.class, args);\n }\n });\n shimmerRecycler.setAdapter(adapterStores);\n }", "private void addDataToRv() {\n RealmResults<NewsModel> newsModels = realm.where(NewsModel.class).findAll();\n //initialize our adapter\n adapter = new NewsAdapter(new ArrayList<>(newsModels), this);\n mRvNewsList.setLayoutManager(new LinearLayoutManager(this));\n mRvNewsList.setAdapter(adapter);\n //notify the adapter that we have new data\n adapter.notifyDataSetChanged();\n }", "private void updateView(ArrayList<MovieDetails> movieData){\n movieDetailsAdapter = new MovieDetailsAdapter(this, movieData);\n //Get a reference to the gridView and attach the adapter to it\n GridView mGridView = (GridView) findViewById(R.id.movies_grid);\n mGridView.setAdapter(movieDetailsAdapter);\n //Set a OnItemClickListener for the GridView attached to the Adapter\n mGridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {\n //Get the MovieDetails Object and pass it to the new activity as parcelable object\n MovieDetails movieDetails = movieDetailsAdapter.getItem(i);\n Intent intent = new Intent(MainActivity.this,MovieDetailActivity.class);\n intent.putExtra(\"movieDetails\",movieDetails);\n startActivity(intent);\n }\n });\n }", "public static void syncItems() {\n ArrayList<Contest> keep = null;\n if (contestItems.size() > CONTEST_LIST_SIZE) {\n keep = new ArrayList<>(contestItems.subList(0, CONTEST_LIST_SIZE));\n keep = removeDups(keep);\n // sort and redraw\n Collections.sort(keep, new ContestComparator());\n adapter.clear();\n adapter.addAll(keep);\n //adapter = new ContestItemsAdapter(mCtx, keep);\n }\n\n adapter.notifyDataSetChanged();\n }", "void addLaptop(ArrayList list){\n System.out.println(\"Enter ID\");\r\n int id = sc.nextInt();\r\n System.out.println(\"Enter ram size\");\r\n int ram = sc.nextInt();\r\n System.out.println(\"Enter HDD size\");\r\n int hdd = sc.nextInt();\r\n sc.nextLine();\r\n System.out.println(\"Enter brand name\");\r\n String brand = sc.nextLine();\r\n \r\n \r\n int idVal = 1;\r\n for (Object obj : list) {\r\n //Checking for valid id\r\n if(((Laptop)obj).getId() == id){\r\n idVal = 0;\r\n break;\r\n }\r\n }\r\n if (idVal == 1) {\r\n //adding a new element/row in the existing list\r\n list.add(new Laptop(id, ram, hdd, brand));\r\n System.out.println(\"Element added successfully!\");\r\n } else {\r\n System.out.println(\"Entered id already exist!\");\r\n }\r\n\r\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Movie)) {\n return false;\n }\n Movie other = (Movie) object;\n if ((this.idMovie == null && other.idMovie != null) || (this.idMovie != null && !this.idMovie.equals(other.idMovie))) {\n return false;\n }\n return true;\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Movie)) {\n return false;\n }\n Movie other = (Movie) object;\n if ((this.movieId == null && other.movieId != null) || (this.movieId != null && !this.movieId.equals(other.movieId))) {\n return false;\n }\n return true;\n }", "public ArrayList<MovieItem> getMovieList(int movieType){\n //save movie type\n mMovieType = movieType;\n\n //check movie type being requested\n if(movieType == PosterHelper.NAME_ID_FAVORITE){\n //mark favorite movie list has changed as true\n mFavoriteChanged = true;\n\n //if favorite, return list of favorite movies\n return getFavoriteMovies();\n }\n else{\n //if any other movie type, request list of movies\n return requestMovieList(movieType);\n }\n }", "public void update()\n\t{\n\t\t//update the view's list of movies...\n\t\tthis.getRemoveButton().setEnabled((this.database.getNumberOfMovies()>0));\n\t\tthis.movieList.setListData(this.database.toList());\n\t}", "public void validateAdd(Stock s){\n Set<String> stock_symbols_set = new HashSet<>();\n for(Stock stock: stockList){\n stock_symbols_set.add(stock.getStockSymbol());\n }\n if(stock_symbols_set.contains(s.getStockSymbol())){\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setIcon(R.drawable.baseline_warning_black_36);\n builder.setMessage(\"Stock Symbol \" + s.getStockSymbol() + \" is already displayed. \");\n builder.setTitle(\"Duplicate Stock\");\n AlertDialog dialog = builder.create();\n dialog.show();\n }\n else{\n stockList.add(s);\n //keep the list in alphabetical order\n Collections.sort(stockList, new Comparator<Stock>() {\n @Override\n public int compare(Stock t1, Stock t2) {\n return t1.getStockSymbol().compareTo(t2.getStockSymbol());\n }\n });\n\n writeJSONData();\n myAdapter.notifyDataSetChanged();\n }\n }", "public static ArrayList<Movie> getMoviesList(){\n\t\treturn movieInfo;\n\t}" ]
[ "0.65960836", "0.6505999", "0.6418075", "0.60810155", "0.59902006", "0.58934635", "0.5892583", "0.588441", "0.585647", "0.5839842", "0.5816927", "0.58001363", "0.5736286", "0.5676842", "0.56577235", "0.56448376", "0.5606184", "0.5606166", "0.56040716", "0.55994785", "0.5572841", "0.5563611", "0.54949003", "0.5489994", "0.5481129", "0.54788977", "0.5475527", "0.54663765", "0.5462995", "0.5456132", "0.5450335", "0.5327514", "0.5291405", "0.5289053", "0.52860343", "0.52789253", "0.52591133", "0.5241342", "0.5233712", "0.5227819", "0.5222278", "0.5211808", "0.5206082", "0.5193087", "0.51883346", "0.5188221", "0.51870435", "0.5177531", "0.5174529", "0.5165237", "0.5163548", "0.5158815", "0.5156143", "0.51553726", "0.5154055", "0.51469755", "0.5141687", "0.5130295", "0.5126788", "0.5126418", "0.5118167", "0.5112934", "0.5098782", "0.50968325", "0.5093609", "0.50840104", "0.5073501", "0.507241", "0.50669986", "0.5056142", "0.5052827", "0.5048392", "0.50431406", "0.50384754", "0.5021858", "0.5011792", "0.5007294", "0.5003575", "0.5002886", "0.49990833", "0.49916586", "0.49895272", "0.49884814", "0.4987799", "0.4982363", "0.49771675", "0.49759996", "0.49704057", "0.49667707", "0.4965952", "0.49649996", "0.4961167", "0.49492583", "0.49440625", "0.4940856", "0.4937913", "0.49374637", "0.4925311", "0.492472", "0.4913615" ]
0.66815335
0
write your code in Java SE 8 OR you can calculate sumRange as (N+1)(N+2)/2 according to summation rules
public int solution(int[] A) { int sumRange = 0; for (int i = 1; i <= A.length+1; i++){ sumRange+=i; } int sumArray = 0; for(int a : A) { sumArray+=a; } //Take the total without the missing number, and subtract the total with the missing number return sumRange-sumArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static int findSum(int[] nums, int start, int end) {\n int sum = 0;\n for ( int i = start ; i < end ; i++ ) {\n sum = sum + nums[i];\n }\n return sum;\n }", "public static int sumRange(int a, int b) {\r\n int sum = 0;\r\n int big = 0;\r\n int small = 0;\r\n \r\n if (a > b) {\r\n big = a;\r\n small = b;\r\n } else {\r\n big = b;\r\n small = a;\r\n }\r\n for(int i = small; i <= big; i++) {\r\n //System.out.println( i );\r\n sum += i;\r\n }\r\n return sum;\r\n }", "void calculateRange() {\n //TODO: See Rules\n }", "public int sumRange(int l, int r) {\n l += n;\n // get leaf with value 'r'\n r += n;\n int sum = 0;\n while (l <= r) {\n if ((l % 2) == 1) {\n sum += tree[l];\n l++;\n }\n if ((r % 2) == 0) {\n sum += tree[r];\n r--;\n }\n l /= 2;\n r /= 2;\n }\n return sum;\n }", "public int rangeSum(int L, int R)\r\n {\r\n int sum;\r\n return sum = rangeSum(root, L, R);\r\n\r\n }", "static long sumOfGroup(int k) {\n long start = 1;\n long sum = 0;\n for(int i=1;i<=k;i++){\n long count = 0;\n sum = 0;\n while(count<i){\n if(start%2 == 1){\n sum = sum+start;\n count++;\n }\n start++;\n }\n }\n return sum;\n }", "public static int sumRange(int c) {\r\n int sum = 0;\r\n for(int i = 0; i <= c; i++) {\r\n //System.out.println( i );\r\n sum += i;\r\n } \r\n return sum;\r\n }", "public static void main(String[] args) {\n range(1, 1000).sum();\n range(1, 1000).reduce(0, Integer::sum);\n Stream.iterate(0, i -> i + 1).limit(1000).reduce(0, Integer::sum);\n IntStream.iterate(0, i -> i + 1).limit(1000).reduce(0, Integer::sum);\n }", "public int sumRange(int i, int j) {\n return sum[j + 1] - sum[i];\n }", "private static BigInteger findSum(BigInteger start, BigInteger end) {\n return start.add(end).multiply(end.subtract(start).add(new BigInteger(\"1\"))).divide(new BigInteger(\"2\"));\n }", "public int robTotal(int[] nums, int sums[],int start, int end) {\n\t\tfor (int i = start; i< end+1; i++) {\n\t\t\trobRecAtIndex(i, nums, sums);\n\t\t}\n\t\treturn sums[end];\n\t}", "public void sum(int n) {\n int sum = 0;\n for (int j = 0; j < n; j++) // 2n+2\n sum += j;\n for (int k = 0; k < n; k++) // 2n+2\n sum += k;\n for (int l = 0; l < n; l++) //2n+2\n sum += l;\n }", "static int sumOf1To100nos() {\r\n\t\t \r\n\t\t int sum =0;\r\n\t\t \r\n\t\t for(int i=1; i<=100;i++) {\r\n\t\t\t sum+=i;\r\n\t\t }\r\n\t\t \r\n\t\t return sum;\r\n\t }", "private static long calc1()\n {\n final int min = 1000;\n final int max = 10000;\n\n // initialize\n List<List<Integer>> m = new ArrayList<>();\n for (int k = 0; k < end; k++) {\n List<Integer> list = new ArrayList<Integer>();\n int n = 1;\n while (k >= start) {\n int p = pkn(k, n);\n if (p >= max) {\n break;\n }\n if (p >= min) {\n list.add(p);\n }\n n++;\n }\n m.add(list);\n }\n\n boolean[] arr = new boolean[end];\n arr[start] = true;\n\n List<Integer> solutions = new ArrayList<>();\n List<Integer> list = m.get(start);\n for (Integer first : list) {\n LinkedList<Integer> values = new LinkedList<>();\n values.add(first);\n f(m, arr, values, 1, solutions);\n // we stop at the first solution found\n if (!solutions.isEmpty()) {\n break;\n }\n }\n\n // solutions.stream().forEach(System.out::println);\n int res = solutions.stream().reduce(0, Integer::sum);\n return res;\n }", "long getRsum(int n, int i, int k){\r\n return n-i>=k ? (n-i-k)+ssum(k-1): ssum(k-1) - ssum(k-n+i);\r\n }", "double getSum();", "double getSum();", "public static int calculateSum(int n)\n {\n int sum =0 ;\n for(int i = 3;i <= n; i++ )\n {\n if(i%3 == 0 || i%5 == 0)\n {\n sum += i;\n }\n }\n return sum;\n }", "public static int countRangeSum(int[] nums, int lower, int upper){\n\t\tint acc = 0;\n\t\tint count = 0;\n\t\tfor(int i = 0; i<nums.length; i++){\n\t\t\tacc += nums[i];\n\t\t\tnums[i] = acc;\n\t\t\tif(nums[i] >= lower && nums[i] <= upper)\n\t\t\t\tcount++;\n\t\t}\n\t\tcount = count + msort(nums, 0, nums.length-1, lower, upper);\n\t\treturn count;\n\t}", "static ArrayList<Integer> subarraySum(int[] arr, int n, int S){\r\n \r\n ArrayList<Integer> list = new ArrayList<>();\r\n \r\n int first = 0;\r\n int last = 0;\r\n int sum = 0;\r\n \r\n while(last < n || first < n){\r\n \r\n if(sum < S && last < n){\r\n sum = sum + arr[last]; \r\n ++last;\r\n }\r\n else if(sum == S){\r\n list.add(first+1);\r\n list.add(last);\r\n return list;\r\n }\r\n else if(first < n){\r\n sum = sum - arr[first];\r\n ++first;\r\n }\r\n }\r\n \r\n if(list.isEmpty()){\r\n list.add(-1);\r\n }\r\n return list;\r\n \r\n }", "public static int getSumFrom1toX (int x){\n int sum = 0 ;\n for (int i = 1; i <=x ; i++) {\n sum += i ;\n\n }\n return sum ;\n\n }", "public static void main(String[] args) {\n System.out.println(sumBetween(1, 0)); // testing sumBetween\n System.out.println(sumBetween(0, 0));\n System.out.println(sumBetween(26, 31));\n System.out.println(sumBetween(-16, 1));\n }", "public static int getSumFrom1toX(int num ){\n int sum = 0;\n for (int x=1; x<=num; x++){\n sum+= x;\n }\n return sum;\n }", "private static int sum(int[] coins,int coinsCount,int startIndex){\n int sum = 0;\n for(int c1=startIndex;c1<startIndex+coinsCount;c1++){\n sum += coins[c1];\n }\n return sum;\n }", "static long findSum(int N)\n\t{\n\t\tif(N==0) return 0;\n\t\treturn (long)((N+1)>>1)*((N+1)>>1)+findSum((int)N>>1);\n\t\t\n\t}", "public static int sum(int begin, int end) {\n\t\tif (begin == end)\n\t\t\treturn begin;\n\t\tint mid = (begin + end) / 2;\n\t\treturn sum(begin, mid) + sum(mid + 1, end);\n\n\t}", "public static int sumUsingStreams(int []arr)\n{\n //Your code here\n //using stream.sum()\n return Arrays.stream( arr)\n .sum(); \n \n}", "public int sumRange(SegmentTreeNode root, int i, int j) {\n\t\tif (root == null) return 0;\n\t\t\n\t\tif (root.start == i && root.end == j) {\n\t\t\treturn root.sum;\n\t\t}\n\t\tint mid = root.start + (root.end - root.start) / 2;\n\t\tif (j <= mid) {\n\t\t\treturn sumRange(root.left, i, j);\n\t\t} else if (i > mid) {\n\t\t\treturn sumRange(root.right, i, j);\n\t\t} else {\n\t\t\treturn sumRange(root.left, i, mid) + sumRange(root.right, mid + 1, j);\n\t\t}\n\t}", "public static int rangeQuerySum(int arr[], int i, int j) {\n if (i == 0)\n return arr[j];\n else\n return (arr[j] - arr[i - 1]);\n }", "int maxSubarraySum(int arr[], int n){\n \n // Your code here\n int cursum = arr[0];\n int osum = arr[0];\n \n for(int i=1;i<n;i++){\n if(cursum>=0){\n cursum+=arr[i];\n }else{\n cursum=arr[i];\n }\n if(cursum>osum){\n osum=cursum;\n }\n }\n return osum;\n \n }", "public static double sum(double n) {\n\t\tdouble sum = 0;\t// Sum of the series\n\t\tfor (double i = 1; i <= n; i++) {\n\t\t\tsum += i / (i + 1);\n\t\t}\n\t\treturn sum;\n\t}", "public long iterativeSum(long n){\n long result = 0;\n for(long i = 1L; i <= n; i++){\n result += i;\n }\n return result;\n }", "static ArrayList<Integer> subarraySum(int[] arr, int n, int s) {\n ArrayList<Integer> res = new ArrayList<>();\n int i = 0;\n int j = 1;\n int sum = arr[0];\n while(i < n) {\n if(sum < s && j < n) {\n sum += arr[j++];\n }\n else if(sum == s) {\n res.add(i + 1);\n res.add(j);\n return res;\n }\n else {\n sum -= arr[i++];\n }\n }\n res.add(-1);\n return res;\n }", "public static void main(String[] args) {\n\t\tint start,end;\r\n\t\tint sum=0;\r\n\t\tScanner scan = new Scanner(System.in);\r\n\t\t\r\n\t\tSystem.out.println(\"enter the start number\");\r\n\t\tstart = scan.nextInt();\r\n\t\t\r\n\t\tSystem.out.println(\"enter the end number\");\r\n\t\tend = scan.nextInt();\r\nfor(int i=start;i<=end;i++)\r\n\t{\r\n\t\tfor(int j=1;j<i;j++)\r\n\t\t{\r\n\t\tsum = sum+j;\r\n\t\t}\r\n\t\t\r\n\t}\r\n\tif (sum==start)\r\n\t\r\n\t\tSystem.out.println(sum);\r\n\t\r\n\t\r\n}", "public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\r\n long[] arr = new long[5];\r\n for(int arr_i=0; arr_i < 5; arr_i++){\r\n arr[arr_i] = in.nextInt();\r\n }\r\n \r\n long min_sum, max_sum, aux_sum = 0;\r\n int indice_out = 0;\r\n min_sum = arr[0] + arr[1] + arr[2] + arr[3];\r\n max_sum = arr[0] + arr[1] + arr[2] + arr[3];\r\n \r\n for(int arr_i = 0; arr_i < 5; arr_i++){\r\n \taux_sum = 0;\r\n \tfor(int i = 0; i < 5; i++){\r\n \t\tif(i != indice_out){\r\n \t\t\taux_sum += arr[i];\r\n \t\t}\r\n \t}\r\n \t\r\n \tif(aux_sum > max_sum){\r\n \t\tmax_sum = aux_sum;\r\n \t}\r\n \t\r\n \tif(aux_sum < min_sum){\r\n \t\tmin_sum = aux_sum;\r\n \t}\r\n \tindice_out++;\r\n }\r\n \r\n System.out.println(min_sum+\" \"+max_sum);\r\n in.close();\r\n\t}", "static int sum(int n) {\n\t\tif(n==1) \n\t\t\treturn 1;\n\t\treturn n+sum(n-1);\n\t}", "public static int sumRange(int[] a, int min, int max) {\r\n\t\t\tint result = 0;\r\n\t\t\tfor (int i = min; i < max; i++) {\r\n\t\t\t\tresult += a[i];\r\n\t\t\t}\r\n\t\t\treturn result;\r\n\t\t}", "public int sumRange0(int i, int j) {\n\t\t\treturn map.get(i) - map.get(j) + nums[j];\n\t\t}", "static double geometricSum(int k) {\n\t\tif (k==0) \n\t\t\treturn 1; // Endpoint\n\t\telse \n\t\t\treturn 1/Math.pow(2,k) + geometricSum(k-1); \n\t}", "long getLsum(int n, int i, int k){ \r\n return (i-k+1)>=0 ? (i-k+1) + ssum(k) : ssum(k) - ssum(k-i-1);\r\n }", "private static int sum(List<Integer> counts) {\n int total = 0;\n for (int count : counts) {\n total += count;\n }\n return total;\n }", "public void sum2(int n){\n int sum =0; //1\n for (int j = 0; j < n; j++) //2n+2\n for (int k = 0; k < n; k++) //2n+2\n sum += k + j; //1\n for (int l = 0; l < n; l++) //2n+2\n sum += l; //1\n }", "static void twoPointer(int arr[], int n, int sum) {\n\n int start = 0;\n int end = 1;\n\n int array_sum = arr[start];\n\n while (start < end || end < n) {\n\n if(array_sum < sum && end < n) {\n array_sum += arr[end];\n end++;\n }else if(array_sum == sum) {\n System.out.println(\"found at \" + start +\" \" + (end - 1) + \" position\");\n return;\n }else if(array_sum > sum && start < end) {\n array_sum -= arr[start];\n start++;\n }\n\n }\n\n System.out.println((start) +\" \" + (end) + \" array sum = \" + array_sum);\n System.out.println(\"No Sum found\");\n\n }", "int subArraySum(int arr[], int n, int sum) \r\n { \r\n int curr_sum, i, j; \r\n \r\n // Pick a starting point \r\n for (i = 0; i < n; i++) \r\n { \r\n curr_sum = arr[i]; \r\n \r\n // try all subarrays starting with 'i' \r\n for (j = i + 1; j <= n; j++) \r\n { \r\n if (curr_sum == sum) \r\n { \r\n int p = j - 1; \r\n System.out.println(\"Sum found between indexes \" + i \r\n + \" and \" + p); \r\n return 1; \r\n } \r\n if (curr_sum > sum || j == n) \r\n break; \r\n curr_sum = curr_sum + arr[j]; \r\n } \r\n } \r\n \r\n System.out.println(\"No subarray found\"); \r\n return 0; \r\n }", "public static int p_sum(){\n Scanner keyboard = new Scanner(System.in);\n System.out.println(\"please put the how many numbers you want to sum:\");\n int v_sum_numbers = keyboard.nextInt();\n int v_total_sum= 0;\n for (int i=1; i<=v_sum_numbers;i=i+1){\n System.out.println(\"please input the \"+i+\" number: \");\n int v_sum_num = keyboard.nextInt();\n v_total_sum= v_total_sum+v_sum_num;\n }\n return v_total_sum;\n }", "public Integer sumNumbers(List<Integer> numbers) throws Exception;", "int maxSubarraySum(int arr[], int n){\n \n // Your code here\n int max = Integer.MIN_VALUE, curr = 0; \n \n for (int i = 0; i < n; i++) { \n curr = curr + arr[i]; \n if (max < curr) \n max = curr; \n if (curr < 0) \n curr = 0; \n } \n return max;\n }", "public static void main(String[] args) {\n\t\tint a[]= {15,3,7,1,9,2};\n\t\tsubarraysum(a,11);//Time complexity O(n^2) space O(1)\n\n\t\tsubarraysum_reducecomplexity(a,11,a.length); //Time complexity O(n) space O(1)\n\n\t}", "public static void main(String[] args) {\n System.out.println(IntStream.rangeClosed(1, 70).filter(t->t%7==0).sum());\n\n\t\t\n\t\t//2.yol\n\t\tSystem.out.println(IntStream.iterate(7, t->t+7).limit(10).sum());\n\t\t\n\t}", "public long parallelSum(long n) {\n //better use long int double rangeclosed instead of iterate\n return Stream.iterate(1L, i -> i + 1)\n .limit(n)\n .parallel()\n .reduce(0L, Long::sum);\n }", "private static long countSummations(int target, int currSum, int lastVal){\n if (currSum == target){\n return 1;\n }\n\n long numSummations = 0;\n\n for (int i = 1; i <= lastVal; i++){\n if (i + currSum > target){\n return numSummations;\n }\n currSum += i;\n numSummations += countSummations(target, currSum, i);\n currSum -= i;\n }\n return numSummations;\n }", "public static int getSum(int arr[], int n)\n{\n\tint total = 0;\n\tfor (int i = 0; i < n; i++)\n\t\ttotal += arr[i];\n\treturn total;\n}", "public static int sumAll(int n1,int n2) {\n int sum=0;\n for(int i=0;i<12;sum+=weights[n1][n2][i],i++);\n return sum;\n }", "public static void main(String[] args) {\n\t\tint []nums = {-2,0,3,-5,2,-1};\n\t\tNumArray obj = new NumArray(nums);\n\t\tSystem.out.println(obj.sumRange(0, 2));\n\t}", "private Rational computeDirectly() {\n BigInteger _26390k = _26390.multiply(BigInteger.valueOf(start));\n BigInteger _24591257856pk = _24591257856.pow(start);\n\n Rational sum = Rational.ZERO;\n\n for (int k = start; k < end; k++) {\n BigInteger num = Factorial.verified(BigInteger.valueOf(k << 2));\n num = num.multiply(_1103.add(_26390k));\n\n BigInteger den = Factorial.verified(BigInteger.valueOf(k)).pow(4);\n den = den.multiply(_24591257856pk);\n\n _26390k = _26390k.add(_26390);\n _24591257856pk = _24591257856pk.multiply(_24591257856);\n\n sum = sum.add(Rational.valueOf(num, den).dropTo(context));\n sum = sum.dropTo(context);\n }\n return sum;\n }", "public static void main(String[] args) {\n\n int sum = 0;\n int n = 5;\n\n for (int i = 0; i < n; i++) {\n sum = sum + (2 * i);\n }\n System.out.println(sum);\n // prints 20 which is sum of 1st 5 even numbers (0,2,4,6,8)\n }", "public Integer sumLogic(int startingNumber, int endingNumber){\n\t\tSystem.out.println(\"Print Sum from this number\");\n\t\tint sum = 0;\n\t\tfor(int x = startingNumber; x <= endingNumber; x++){\n\t\t\tsum = sum + x;\n\t\t\tSystem.out.println(\"New number is: \" + x + \" sum: \" + sum);\n\t\t}\n\t\treturn 0;\n\t}", "private static int sum1DArrRecursive(int[] myArr1D, int min, int max)\n {\n int sum = 0;\n if(min==max)\n { \n sum += myArr1D[max];\n return sum;\n }\n else\n {\n sum += myArr1D[min] + sum1DArrRecursive(myArr1D, min+1, max);\n return sum;\n }\n }", "boolean SubArraySum( int arr[] , int n , int sum ){\n HashSet<Integer> s = new HashSet<Integer>();\n int pre_sum = 0 ;\n for( int i = 0 ; i < n ; i++ ){\n pre_sum += arr[i];\n if( pre_sum == sum ) // Corner case if pre-sum is equal to sum.\n return true;\n if( s.contains(pre_sum - sum))\n return true;\n s.add(pre_sum);\n }\n return false;\n }", "private static void findNumbers(int[] candidates, int sum,\n List<List<Integer>> res, List<Integer> r, int i) {\n if (sum < 0) {\n return;\n }\n\n // if we get exact answer\n if (sum == 0) {\n List<Integer> r2 = new ArrayList<>(r);\n if (!res.contains(r2)) {\n res.add(r2);\n }\n return;\n }\n\n // Recur for all remaining elements that have value smaller than sum.\n while (i < candidates.length - 1) {\n i++;\n\n // Till every element in the array starting from i which can contribute to the sum\n r.add(candidates[i]); // add them to list\n\n // recur for next numbers\n findNumbers(candidates, sum - candidates[i], res, r, i);\n\n // remove number from list (backtracking)\n r.remove(r.size() - 1);\n }\n }", "int countSusbset(int n, int w){\n //i.e target sum achieved\n if(w == 0){\n return 1;\n }\n \n //if sum not achieved and no items left\n if(n == 0){\n return 0;\n }\n \n //if item is gretart than target weight, we have to exclude it\n if(arr[n-1] > w){\n return countSusbset(n-1, w)\n }else{ \n return countSusbset(n-1, w) + countSusbset(n-1, w - arr[n-1]);\n }\n}", "public static int sumElementsUpTo(int[] arr, int n) {\n int i = 0;\n int res = 0;\n\n while (i <= n) {\n res += arr[i];\n i++;\n }\n\n return res;\n }", "static int countOfSubsetsOfSum(int[] arr,int sum){\n int n = arr.length;\n int[][] dp = new int[n + 1][sum + 1];\n\n for (int j = 0;j<=sum; j++){\n dp[0][j] = 0;\n }\n\n for (int i = 0;i<=n;i++){\n dp[i][0] = 1;\n }\n\n for (int i=1;i<=n;i++){\n for (int j = 1;j<=sum;j++){\n if (arr[i-1] <= j){\n dp[i][j] = dp[i-1][j] + dp[i-1][j - arr[i-1]];\n }else{\n dp[i][j] = dp[i-1][j];\n }\n }\n }\n return dp[n][sum];\n }", "public static void main(String[] args) {\n\t\tint [][]nums = {{3, 0, 1, 4, 2},\n\t\t\t {5, 6, 3, 2, 1},\n\t\t\t {1, 2, 0, 1, 5},\n\t\t\t {4, 1, 0, 1, 7},\n\t\t\t {1, 0, 3, 0, 5}};\n\t\tRangeSumQuery2DMutable308_BIT rr = new RangeSumQuery2DMutable308_BIT(nums);\n\t\tSystem.out.println(rr.sumRange(2, 1, 4, 3));\n\t}", "public static void main(String[] args) {\nint array[]= {13, 25, 9,56,54,89,17};\r\nint sum =0;\r\n\r\nfor (int i=0; i<=6; i++) {\r\n\tsum = sum + array[i];\r\n}\r\nSystem.out.println(\"the sume of the numbers is \" +sum);\r\n\t}", "public static void solve(int n, List<Integer> a) {\n Collections.sort(a);\n Collections.reverse(a);\n double sum = a.stream().mapToDouble(num -> Double.valueOf(num)).sum();\n double currentN = Double.valueOf(n);\n double currentSum = sum;\n for(Integer next : a)\n {\n double nextDouble = Double.valueOf(next);\n if(nextDouble<=currentSum/currentN)\n {\n break;\n }\n currentSum -= nextDouble;\n currentN--;\n }\n System.out.println(currentSum/currentN);\n\n\n }", "public int sum(int array[], int start, int finish) {\r\n\t\tint sum = 0;\r\n\t\tint i = 0;\r\n\t\tfor (i = start; i < finish; i++) {\r\n\t\t\tsum += array[i];\r\n\t\t}\r\n\t\treturn sum;\r\n\t}", "public static int sumBetween(int a, int b) {\n // find the larger and the smaller of a and b\n// int max = (a > b) ? a : b;\n// int min = (a < b) ? a : b;\n int max;\n int min;\n if (a < b) {\n max = b;\n min = a;\n } else {\n min = b;\n max = a;\n }\n\n // loop from the smaller to the larger, and sum all the numbers in between\n int sum = 0;\n for(int i = min; i <= max; i++) {\n sum += i;\n }\n\n return sum;\n }", "private Proof sumDistr(int n, int m) {\n if (m == 0) {\n return faxm6Gen(intToLit(n));\n }\n m = m - 1;\n Proof sucResp1 = faxm1Convert(sumDistr(n, m));\n return equalityRightConvert(equalitySymConvert(faxm5Gen(intToLit(n), intToLit(m))), sucResp1);\n }", "private static int sum(List<Integer> L, int i,int j) {\n\t\tSystem.out.println(L+\"\\n\"+\"index i = \"+i+\"\\n\"+\"index j = \"+j);\n\t\tList<Integer> subListToSum = new ArrayList<Integer>();\n\t\t\n\t\tif (i <= j) { //make sure that i is less than j so we have a sublist of at least one\n\t\t\tsubListToSum.addAll(L.subList(i, j));\n\t\t\t\n\t\t}\n\t\t\n\t\telse if (i > j) { //print out a error so the user knows what they did wrong\n\t\t\tSystem.out.println(\"index 'i' is more than index 'j'\");\n\t\t}\n\t\t\n\t\tint sizeList = L.size(); //only reaches here if i <= j\n\t\tSystem.out.println(\"size of list is: \" + sizeList);\n\t\tif (j <= sizeList & i <= sizeList) { //check to account for out of bounds and negatives\n\t\t\tint result = 0;\n\t\t\t\n\t\t\tfor (int allInts : subListToSum) {\n\t\t\t\tresult += allInts;\n\t\t\t};\n\t\t\t\n\t\t\tSystem.out.println(\"Sum(\" + i + \", \" + j + \")\" + \" = \" + result);\n\t\t}\n\t\t\n\t\treturn 0;\n\t}", "static int subArraySum(int arr[], int sum) {\n int n = arr.length;\n int curr_sum = arr[0], start = 0, i;\n\n // Pick a starting point\n for (i = 1; i <= n; i++) {\n // If curr_sum exceeds the sum, then remove the starting elements\n while (curr_sum > sum && start < i - 1) {\n curr_sum = curr_sum - arr[start];\n start++;\n }\n\n // If curr_sum becomes equal to sum, then return true\n if (curr_sum == sum) {\n int p = i - 1;\n System.out.println(\"Sum found between indexes \" + start\n + \" and \" + p);\n return 1;\n }\n\n // Add this element to curr_sum\n if (i < n)\n curr_sum = curr_sum + arr[i];\n\n }\n\n System.out.println(\"No subarray found\");\n return 0;\n }", "public static long sequentialSum(long n) {\n return Stream.iterate(1L, num -> num + 1)\n .limit(n)\n .reduce(0L, Long::sum);\n }", "public void sumValues(){\n\t\tint index = 0;\n\t\tDouble timeIncrement = 2.0;\n\t\tDouble timeValue = time.get(index);\n\t\tDouble packetValue;\n\t\twhile (index < time.size()){\n\t\t\tDouble packetTotal = 0.0;\n\t\t\twhile (timeValue < timeIncrement && index < packets.size()){\n\t\t\t\ttimeValue = time.get(index);\n\t\t\t\tpacketValue = packets.get(index);\n\t\t\t\tpacketTotal= packetTotal + packetValue;\n\t\t\t\tindex = index + 1;\n\t\t\t}\n\t\t\tArrayList<Double> xy = new ArrayList<Double>();\n\t\t\txy.add(timeIncrement);\n\t\t\txy.add(packetTotal);\n\t\t\ttotalIncrements.add(xy);\n\t\t\t// to get max and min need separate arrays\n\t\t\ttimeIncrements.add(timeIncrement);\n\t\t\tbyteIncrements.add(packetTotal);\n\t\t\ttimeIncrement = timeIncrement + 2.0;\t\n\t\t}\n\t\treturn;\n\n\t}", "static void subsetSums(int arr[], int n)\n {\n \n // There are totoal 2^n subsets\n int total = 1 << n;\n \n // Consider all numbers from 0 to 2^n - 1\n for (int i = 0; i < total; i++) {\n int sum = 0;\n \n // Consider binary reprsentation of\n // current i to decide which elements\n // to pick.\n for (int j = 0; j < n; j++)\n if ((i & (1 << j)) != 0)\n sum += arr[j];\n \n // Print sum of picked elements.\n System.out.print(sum + \" \");\n }\n }", "static void miniMaxSum(int[] arr) {\n int min=arr[0];\n int max=0;\n long maxsum=0,minsum=0;\n for(int i:arr)\n {\n if(i<min)\n {\n min=i;\n }\n if(i>max)\n {\n max=i;\n }\n }\n for(int i:arr)\n {\n if(i==max)\n {\n max=0;\n continue;\n }\n else\n {\n minsum+=i;\n }\n }\n for(int i:arr)\n {\n if(i==min)\n {\n min=0;\n continue;\n }\n else\n {\n maxsum+=i;\n }\n }\n System.out.println(minsum+\" \"+maxsum);\n }", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n System.out.println(\"First: \");\n int firstNumber = scanner.nextInt();\n System.out.println(\"Last: \");\n int lastNumber = scanner.nextInt();\n int sum = 0;\n\n for( int i = firstNumber; i<= lastNumber; i++){\n sum +=i;\n\n }\n System.out.println(\"The sum is \" + sum);\n }", "public int sumSubarrayMins2(int[] nums) \n {\n if (nums == null || nums.length == 0)\n {\n return 0;\n }\n \n int size = nums.length;\n int result = 0;\n int mod = 1_000_000_000 + 7;\n \n for (int i = 0; i < size; i++)\n {\n int min = Integer.MAX_VALUE;\n \n for (int j = i; j < size; j++)\n {\n min = Math.min(min, nums[j]);\n result = (result + min) % mod;\n result %= mod;\n }\n }\n \n return result;\n }", "public static void main(String[] args) {\n\n System.out.println(sumInBetween(-4, 4));\n\n }", "public static void main(String[] args)\r\n {\n int sum=0;\r\n for (int i=1; i<=10; i++)\r\n sum += i;\r\n System.out.printf(\"The sum was: %d%n\", sum);\r\n \r\n //new way using Streams\r\n System.out.printf(\"The sum with streams is: %d%n\", IntStream.rangeClosed(1,10)\r\n .sum());\r\n \r\n \r\n }", "public static int sumUpTo(Integer num)\n {\n int total = 0;\n for(int i = 0; i < num + 1; i++)\n total += i;\n return total;\n }", "private int numOfPairs(int[] nums, int start, int end, int target){\n int res = 0;\n while(start < end){\n int sum = nums[start] + nums[end];\n if(sum < target){\n res += end - start;\n start++;\n }\n else{\n end--;\n }\n }\n return res;\n }", "public static void main(String[] args) {\n\t\tint[] arr = { 2, 3, 5, 6, 10, 14, 17, 20, 23 };\n\t\tfindingSum(arr, 28);\n\t\tfindingSum(arr, 11);\n\t\tfindingSum(arr, 10);\n\t}", "void sumProd(int n) {\n\t\tdouble sum = 0.0;//C1\n\t\tdouble prod = 1.0;\n\t\tfor (int i = 1; i <= n; i++)\n\t\t\t{ if (i%2 == 0) sum += i;\n\t\t\tprod = prod * i;\n\t\t\tUtil.foo(sum, prod); }}", "public static void main(String[] args) {\n\t\t\n\t\t int a[]= {1,2,3,4,6};\n\t int sum = 0;\n\t for(int i =0; i<a.length; i++){\n System.out.println(sum);\n\t sum = sum + a[i];\n\t int sum1= 0;\n\t for(int j=1; j<=6; j++) {\n\t \t\n\t }\n\t \n\t }\n\t\t\n\n\t}", "public static int fibSum(int n) {\n int sum = 0;\n int fib1 = 1;\n int fib2 = 1;\n for (int i = 3; fib2 < n; i++) {\n int x = fib1 + fib2;\n fib1 = fib2;\n fib2 = x;\n if (fib2 % 2 == 0) sum += fib2;\n }\n return sum;\n }", "public static void main(String[] args) {\n Scanner keyboard = new Scanner(System.in);\n System.out.println(\"Enter a number greater than 1 and less than 100\");\n int num = keyboard.nextInt();\n int sum = 0;\n // sum is set to 0 index set to equal to or less than user input. sum increases with each pass with index plus current sum\n for (int i = 1; i <= num; i++) {\n sum += i;\n System.out.println(sum);\n }\n }", "static BigInteger findSum(BigInteger n) {\n if (n.equals(BigInteger.ZERO))\n return BigInteger.ZERO;\n BigInteger TWO = BigInteger.valueOf(2);\n\n BigInteger sum = BigInteger.ZERO;\n sum = sum.add(\n n.multiply(n.add(BigInteger.ONE))\n .divide(TWO)\n );\n\n BigInteger flooredN = findFraction(n);\n sum = sum.add(\n n.multiply(flooredN)\n );\n\n sum = sum.subtract(\n flooredN.multiply(flooredN.add(BigInteger.ONE))\n .divide(TWO)\n );\n\n sum = sum.subtract(findSum(flooredN));\n\n return sum;\n }", "public static void main(String[] args) {\n// TreeNode root = TreeNode.getTreeNode(new Integer[]{10, 5, 15, 3, 7, null, 18});\n// NineThreeEight nineThreeEight = new NineThreeEight();\n// System.out.println(nineThreeEight.rangeSumBST(root, 7, 15));\n//\n\n TreeNode root = TreeNode.getTreeNode(new Integer[]{18,9,27,6,15,24,30,3,null,12,null,21});\n NineThreeEight nineThreeEight = new NineThreeEight();\n System.out.println(nineThreeEight.rangeSumBST(root, 18, 24));\n\n }", "@Test\n\tpublic void testSumOverRealIntervalsDomainSampleBecauseDomainContinuous() {\t\t\n\t\trunTest(2, false, \"sum({{(on R in [1;5]) 2 : true }})\", \"8\");\n\t\trunTest(2, false, \"sum({{(on R in [1;5]) 2 : R != 3}})\", \"8\");\n\t\t\n\t\t// NOTE: picks 1.255232, 4.259308, 3.01488\n\t\trunTest(3, false, \"sum({{(on R in [1;5]) R : true }})\", \"11.37256\");\n\t}", "public static void main(String[] args) {\nScanner s=new Scanner(System.in);\nint n=s.nextInt();\nint a[]=new int[n];\nint x=0;\nfor(int i=1;i<=n;i++)\n{\n\tif(i%2!=0)\n\t{\n\t\ta[x++]=i;\n\t}\n}\nint sum=0;\nsum=a[0];\nfor(int i=0;i<x;i++)\n{\n\tif((i+1)<x)\n\t{\n\tif(i%2==0)\n\t\tsum=sum+a[i+1];\n\telse\n\t\tsum=sum-a[i+1];\n\t}\n}\nSystem.out.println(sum);\n\t}", "public static double[] nSumTo1(int n) {\n Random r = new Random();\n double[] nums = new double[n];\n int sum = 100;\n\n for (int i = 0; i < nums.length-1; i++) {\n int randInt = r.nextInt(200);\n int num = randInt % (sum + 1);\n sum -= num;\n nums[i] = num / 100.0;\n }\n nums[nums.length-1] = sum / 100.0;\n\n return nums;\n }", "public List<List<Integer>> getCandidateA(int nStartVal, int k, int n) {\n \tint nMin; \r\n \tint nMax; \r\n \tint i;\r\n \tList<List<Integer>> lstlstCombSum = new ArrayList<List<Integer>>();\r\n List<Integer> lstResult = new ArrayList<Integer>();\r\n \t\r\n \tif (nStartVal > n || k == 0) return lstlstCombSum;\r\n \t\r\n \tif (k == 1) {\r\n \t\tif (n > 9) return lstlstCombSum;\r\n \t\tlstResult.add(n);\r\n \t\tlstlstCombSum.add(lstResult);\r\n \t\treturn lstlstCombSum;\r\n \t}\r\n \t\r\n \tnMin = nStartVal;\r\n \tnMax = (int) (n - (k-1)*k/2)/k; //Max value occurs when the remaining numbers are: x (the maxvalue), x+1, x+2 ... x+k-1 (the sum should be n)\r\n \t\r\n \tfor (i = nMin; i <= nMax; i++) { //Possible value of the first\r\n \t\tList<List<Integer>> lstlstCombSumTmp = new ArrayList<List<Integer>>();\r\n \t\tlstlstCombSumTmp = getCandidateA(i+1, k-1, n-i);\r\n \t\t\r\n \t\tif (lstlstCombSumTmp.isEmpty()) continue;\r\n \t\t\r\n \t\tfor (List<Integer> lstOneCombSum:lstlstCombSumTmp) {\r\n \t\t\tlstOneCombSum.add(0, i);\r\n \t\t\tlstlstCombSum.add(lstOneCombSum);\r\n \t\t}\r\n \t\t\r\n \t}\r\n \t\r\n \treturn lstlstCombSum;\r\n }", "public static int sumWays(int sum, int[] nums) {\n if (sum == 0)\n return 0;\n //find sum for all the numbers from 0- sum\n int[] sumCount = new int[sum + 1];\n for (int i = 0; i < sumCount.length; i++) {\n sumCount[i] = -1;\n }\n // assuming nums in sum are ordered\n // number of ways to sum the smallest number is num is 1.\n sumCount[nums[0]] = 1;\n for (int currSum = nums[0] + 1; currSum <= sum; currSum++) {\n int currSumCnt = 0;\n for (int i = 0; i < nums.length; i++) {\n // number of ways to sum the number nums[i] is sumCount[nums[i]]\n // number of ways to sum the number sum - nums[i] is sumCount[sum- nums[i]]\n int diff = currSum - nums[i];\n if ((diff > 0) && (diff < sum) && (sumCount[diff]) > 0) {\n currSumCnt += sumCount[diff];\n }\n }\n sumCount[currSum] = currSumCnt;\n }\n System.out.println(\"Num of ways: \");\n printArr(sumCount, \"Ways to get %d is %d\");\n return sumCount[sum];\n }", "public static void main(String[] args) {\n\n int n = 3;\n int sum = 0;\n for (int i = 1; i <= n; i++) {\n sum = sum + i;\n }\n\n System.out.println(\"The sum from 1 to \" + n + \" is: \" + sum);\n }", "static long subArraySum(int[] data) {\n\n long result = 0;\n\n // computing sum of sub array using formula\n int n = data.length;\n for (int i = 0; i < n; i++) {\n // x * (x at first index) + (x at other indices)\n result += (data[i] * (i * (n - i) + (n - i)));\n//\t\t\tresult += (data[i] * (i + 1) * (n - i));\n }\n\n // return all sub array sum\n return result;\n }", "public static void main(String[] args) {\n int arr[] = {2, 3, 7, 8};\n System.out.println(\"Ans->\"+subsetSum(arr, 11));\n\t}", "public static void main(String[] args) {\n int arr[] = {479,758,315,472,730,101,460,619,510,612,8};\n System.out.println(\"find subset sum Top down: \"+findEqualSumSubsetTopDown(arr,arr.length));\n System.out.println(\"find subset sum Bottom Up: \"+findEqualSumSubsetBottomUp(arr,arr.length));\n\t}", "protected int sumIterative(int a, int b){\n int result = a;\n while (b != 0){\n if (b > 0){\n result++;\n b--;\n } else {\n result--;\n b++;\n }\n }\n return result;\n }", "@Test\n\tpublic void testSumOverFunctionV2() {\n\t\trunTest(2, true, \"sum({{(on f in Boolean -> 0..3) f(true) : true }})\", \"24\");\n\t}", "public void exercise_4_31()\n {\n int index = 0;\n int sum = 0;\n \n while (index < 10) {\n index++;\n sum += index;\n }\n System.out.println(sum);\n }", "private int sum(AFormula o1){\n\t\t\t\t\n\t\t\t\treturn o1.calculate(customerType, weekdayCount, weekendCount);\n\t\t\t\t\n\t\t\t}" ]
[ "0.6603667", "0.6490593", "0.64732844", "0.64165825", "0.63511467", "0.6263571", "0.6235804", "0.61847264", "0.60791594", "0.6055819", "0.60097", "0.5990571", "0.59865916", "0.59838855", "0.5983107", "0.5965871", "0.5965871", "0.5924753", "0.59184426", "0.59157896", "0.590866", "0.5871151", "0.58614564", "0.5860366", "0.5860095", "0.58556044", "0.5846624", "0.583811", "0.5830893", "0.58213866", "0.5809707", "0.5783258", "0.5776823", "0.5749369", "0.57440805", "0.5735464", "0.57301044", "0.5718272", "0.5714929", "0.5706708", "0.57020843", "0.5701263", "0.5675221", "0.56591696", "0.5646797", "0.5632225", "0.5631483", "0.56309634", "0.5624562", "0.5622972", "0.56170624", "0.561527", "0.56049854", "0.5598752", "0.5587027", "0.5564664", "0.55589205", "0.55578876", "0.5528317", "0.5525308", "0.55231524", "0.55225897", "0.55126256", "0.54915476", "0.5485538", "0.5477925", "0.54720056", "0.54655766", "0.5464348", "0.5460986", "0.5460868", "0.54560274", "0.5454407", "0.54533803", "0.5444727", "0.54341197", "0.54300416", "0.5428926", "0.54267955", "0.5415177", "0.54071015", "0.54046077", "0.5394987", "0.53902704", "0.53771156", "0.53694737", "0.5365487", "0.5363501", "0.5357818", "0.5356956", "0.5353067", "0.5352916", "0.53483", "0.53412914", "0.533723", "0.5334956", "0.53318876", "0.5328828", "0.5327646", "0.5326654", "0.5325391" ]
0.0
-1
Initializes this 'StorageLoader' by connecting 'Storages' with given paths. Once this is called, the same 'StorageLoader' is not allowed to call this twice.
public static StorageLoader initialize(String... paths) throws LoaderInitializationFailureException {// TODO: 16. 10. 17 Not Nomalize uri yet. StorageLoader loader; URI uri; HashMap<String, Storage> tempStorages =new HashMap<>(); Storage storage; for (String path: paths){ try{ uri =new URI(path); storage= Contexts.generateStorageConnection(uri.getScheme(), path); tempStorages.putIfAbsent(path, storage); // TODO: 16. 10. 17 Log metadata of Storage Instances. }catch (URISyntaxException e) {continue;} catch (InvaildStorageException e) {continue;} } if (tempStorages.isEmpty()) new LoaderInitializationFailureException(); loader = new StorageLoader(tempStorages); return loader; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void init() {\n LOG.info(\"Initializing side input stores.\");\n\n initializeStoreDirectories();\n }", "public void initialize(final List<Guild> guilds, final StorageManager storage) {\n this.commands.forEach((ChatCommand t) -> {\n t.initialize(guilds, storage);\n });\n }", "private void initializeStorageProxies()\n {\n Vector deviceList = new Vector();\n nGetDevices(deviceList);\n int handle = 0;\n int status = 0;\n int deviceCount = deviceList.size();\n if (log.isDebugEnabled())\n {\n log.debug(\" Device List Count :\" + deviceCount);\n }\n for (int deviceListCount = 0; deviceListCount < deviceCount; deviceListCount++)\n {\n handle = ((Integer) deviceList.elementAt(deviceListCount)).intValue();\n status = nGetStatus(handle);\n StorageProxy storageProxy = createStorageProxy(handle, status);\n storageProxyHolder.put(new Integer(handle), storageProxy);\n }\n }", "private void initializeStoreDirectories() {\n LOG.info(\"Initializing side input store directories.\");\n\n stores.keySet().forEach(storeName -> {\n File storeLocation = getStoreLocation(storeName);\n String storePath = storeLocation.toPath().toString();\n if (!isValidSideInputStore(storeName, storeLocation)) {\n LOG.info(\"Cleaning up the store directory at {} for {}\", storePath, storeName);\n new FileUtil().rm(storeLocation);\n }\n\n if (isPersistedStore(storeName) && !storeLocation.exists()) {\n LOG.info(\"Creating {} as the store directory for the side input store {}\", storePath, storeName);\n storeLocation.mkdirs();\n }\n });\n }", "protected void initStorageDevices() throws OBStorageException, OBException {\r\n OBStorageConfig conf = new OBStorageConfig();\r\n conf.setTemp(false);\r\n conf.setDuplicates(false);\r\n conf.setBulkMode(! isFrozen());\r\n conf.setIndexType(IndexType.HASH);\r\n this.A = fact.createOBStoreLong(\"A\", conf );\r\n if (!this.isFrozen()) {\r\n conf = new OBStorageConfig();\r\n conf.setTemp(false);\r\n conf.setDuplicates(false);\r\n conf.setBulkMode(false);\r\n conf.setRecordSize(fixedRecordSize);\r\n if(fixedRecord){\r\n conf.setIndexType(IndexType.FIXED_RECORD);\r\n }\r\n this.preFreeze = fact.createOBStore(\"pre\", conf);\r\n }\r\n }", "public StorageManager() {\n makeDirectory();\n }", "public ImageAdapter(Activity localContext, ArrayList<String> paths) {\n context = localContext;\n images = paths;\n }", "public final void load(String... paths){\n\t\tload(null,paths);\n\t}", "public void initialize(Collection<CartridgeClasspathData> aCartridges) {\n\t\tthis.selectedTemplates.clear();\n\t\tTemplatesStore.getInstance().clear();\n\n\t\tif (this.cartridgeClassPaths == null) {\n\t\t\tthis.setupCartridgeClassPaths();\n\t\t}\n\n\t\tif (this.cartridgeClassPaths != null) {\n\t\t\tthis.initializeCartridgeClasspaths(aCartridges);\n\t\t} else {\n\t\t\tlogger.error(\"cartridgeClassPaths is null??\");\n\t\t\tthrow new RuntimeException(\"cartridge classpaths are null\");\n\t\t}\n\n\t\tthis.storeCartridgeDir();\n\t\tProjectInstanceHelper.getInstance().refresh();\n\t}", "private void initClassloaders() {\n\t\tthis.commonloader = createClassloader(\"common\",null);\n\t\tthis.sharedloader = createClassloader(\"shared\", commonloader);\n\t\tthis.catalinaloader = createClassloader(\"server\", commonloader);\n\t}", "private static void initDirectories() {\n String storeName = System.getProperty(USER_DIR)\n + File.separator\n + QVCSConstants.QVCS_META_DATA_DIRECTORY\n + File.separator\n + QVCSConstants.QVCS_FILEID_STORE_NAME\n + \".dat\";\n File storeFile = new File(storeName);\n if (storeFile.exists()) {\n storeFile.delete();\n }\n deleteAuthenticationStore();\n initAuthenticationStore();\n\n deleteRoleProjectViewStore();\n initRoleProjectViewStore();\n\n initProjectProperties();\n }", "public Storage() {\n\t\tstorageReader = new StorageReader();\n\t\tstorageWriter = new StorageWriter();\n\t\tdirectoryManager = new DirectoryManager();\n\n\t\tFile loadedDirectory = storageReader.loadDirectoryConfigFile(FILENAME_DIRCONFIG);\n\t\tif (loadedDirectory != null) {\n\t\t\tif (directoryManager.createDirectory(loadedDirectory) == true) {\n\t\t\t\tdirectory = loadedDirectory;\n\t\t\t\tSystem.out.println(\"{Storage} Directory loaded | \" + directory.getAbsolutePath());\n\t\t\t} else { //loaded directory was invalid or could not be created\n\t\t\t\tdirectoryManager.createDirectory(DEFAULT_DIRECTORY);\n\t\t\t\tdirectory = DEFAULT_DIRECTORY;\n\t\t\t}\n\t\t} else { //directory config file was not found\n\t\t\tdirectoryManager.createDirectory(DEFAULT_DIRECTORY);\n\t\t\tdirectory = DEFAULT_DIRECTORY;\n\t\t}\n\t}", "protected void init(Iterable<String> servers) {}", "TestStorage initializeSourceStorage(SyncOptions options, boolean addMappingMetadata) {\n TestStorage storage = new TestStorage();\n storage.withConfig(testConfig).withOptions(options);\n for (String key : pathMap.keySet()) {\n boolean directory = directories.contains(key);\n ObjectMetadata meta = new ObjectMetadata().withContentLength(0).withDirectory(directory);\n // add mapping metadata if necessary\n if (addMappingMetadata) meta.setUserMetadataValue(mappingMetadataName, pathMap.get(key));\n SyncObject syncObject = new SyncObject(this.storage, key, meta, new ByteArrayInputStream(new byte[0]), new ObjectAcl());\n // updateObject expects a storage identifier (absolute path), so here we have to add the\n // internal path prefix that it uses\n storage.updateObject(testStoragePrefix + key, syncObject);\n }\n return storage;\n }", "@Override\n public void initialize(Map<String, Param> params) throws TikaConfigException {\n //params have already been set...ignore them\n //TODO -- add other params to the builder as needed\n storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService();\n }", "private void loadBasePaths() {\n\n Log.d(TAG, \"****loadBasePaths*****\");\n List<FileInfo> paths = BaseMediaPaths.getInstance().getBasePaths();\n for (FileInfo path : paths) {\n\n }\n }", "public DefaultStorage() {\n }", "private void initializeStore()\r\n {\r\n log.debug(\"initializing MongoStore\");\r\n try (InputStream is = getClass().getClassLoader().getResourceAsStream(\"visualharvester.properties\"))\r\n {\r\n final Properties properties = new Properties();\r\n properties.load(is);\r\n\r\n host = properties.get(\"mongo.host\").toString();\r\n final String portString = properties.get(\"mongo.port\").toString();\r\n port = Integer.valueOf(portString).intValue();\r\n database = properties.get(\"mongo.database\").toString();\r\n collection = properties.get(\"mongo.collection\").toString();\r\n\r\n }\r\n catch (final IOException e)\r\n {\r\n log.error(\"Could not open properties file, using defaults\", e);\r\n host = \"localhost\";\r\n port = 27017;\r\n database = \"visualdb\";\r\n collection = \"visualcollection\";\r\n }\r\n\r\n store = new MongoStorage(host, port, database, collection);\r\n\r\n }", "@WorkerThread\n public void initStorage() {\n // Read some value from the Preferences to ensure it's in memory.\n getStoredOrigins();\n }", "public void init() {\n // the config string contains just the asset store directory path\n //set baseDir?\n this.initialized = true;\n }", "Storage(String filepath) {\n this.filepath = filepath;\n tasks = new ArrayList<>();\n parser = new Parser();\n }", "public Storage(String s){\n this.path=s;\n }", "private void initializeStoreFromPersistedData() throws IOException\r\n {\r\n loadKeys();\r\n\r\n if (keyHash.isEmpty())\r\n {\r\n dataFile.reset();\r\n }\r\n else\r\n {\r\n final boolean isOk = checkKeyDataConsistency(false);\r\n if (!isOk)\r\n {\r\n keyHash.clear();\r\n keyFile.reset();\r\n dataFile.reset();\r\n log.warn(\"{0}: Corruption detected. Resetting data and keys files.\", logCacheName);\r\n }\r\n else\r\n {\r\n synchronized (this)\r\n {\r\n startupSize = keyHash.size();\r\n }\r\n }\r\n }\r\n }", "private void initStorage() {\n storageList = new ItemsList();\n storageList.add(new StorageItem(1, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\pen.png\", \"pen\", 3));\n storageList.add(new StorageItem(2, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\pencil.png\", \"pencil\", 2));\n storageList.add(new StorageItem(3, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\book.jpg\", \"book\", 21));\n storageList.add(new StorageItem(4, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\rubber.png\", \"rubber\", 1));\n storageList.add(new StorageItem(5, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\calculator.png\", \"calculator\", 15));\n storageList.add(new StorageItem(6, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\cover.jpg\", \"cover\", 4));\n storageList.add(new StorageItem(7, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\globe.png\", \"globe\", 46));\n storageList.add(new StorageItem(8, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\map.jpg\", \"map\", 10));\n storageList.add(new StorageItem(9, \"G:\\\\Lukasz\\\\Desktop\\\\PWR\\\\semestr_6\\\\java\\\\netbans\\\\lab2_InternationalizedWarehouse\\\\marker.png\", \"marker\", 6));\n\n }", "@Override\n public void init() {\n this.shapes = new DatabaseShape();\n }", "@Override\r\n\tpublic void init() {\n\t\tint numOfItems = loader.getNumOfItems();\r\n\t\tsetStoreSize(numOfItems);\r\n\r\n\t\tfor (int i = 0; i < numOfItems; i++) {\r\n DrinksStoreItem item = (DrinksStoreItem) loader.getItem(i);\r\n\t\t\tStoreObject brand = item.getContent();\r\n\t\t\tStoreObject existingBrand = findObject(brand.getName());\r\n\t\t\tif (existingBrand != null) {\r\n\t\t\t item.setContent(existingBrand);\r\n\t\t\t}\r\n\t\t\taddItem(i, item);\t\r\n\t\t}\r\n\t}", "private void initImageLoader() {\n ImageLoaderConfiguration.Builder config = new ImageLoaderConfiguration.Builder(this);\n config.threadPriority(Thread.NORM_PRIORITY - 2);\n config.denyCacheImageMultipleSizesInMemory();\n config.diskCacheFileNameGenerator(new Md5FileNameGenerator());\n config.diskCacheSize(50 * 1024 * 1024); // 50 MiB\n config.tasksProcessingOrder(QueueProcessingType.LIFO);\n // Initialize ImageLoader with configuration.\n ImageLoader.getInstance().init(config.build());\n }", "@Override\n protected void initialize() {\n mDrive.resetGyroPosition();\n try {\n Trajectory left_trajectory = PathfinderFRC.getTrajectory(pathName + \".left\");\n Trajectory right_trajectory = PathfinderFRC.getTrajectory(pathName + \".right\");\n\n m_left_follower = new EncoderFollower(left_trajectory);\n m_right_follower = new EncoderFollower(right_trajectory);\n\n if(isBackwards) {\n initBackwards();\n } else {\n initForwards();\n }\n } catch (IOException e) {\n\t\t e.printStackTrace();\n\t }\n }", "@Override\n public void Init() {\n strRemoteDownloadPath = strBasePath + (\"serialize/to/\");\n strRemoteUploadPath = strBasePath + (\"serialize/from/\");\n new File(strRemoteDownloadPath).mkdirs();\n new File(strRemoteUploadPath).mkdirs();\n }", "public void initialize() {\n this.loadDownloadList();\n }", "private void initialize() throws IOException {\n // All of this node's files are kept in this directory.\n File dir = new File(localDir);\n if (!dir.exists()) {\n if (!dir.mkdirs()) {\n throw new IOException(\"Unable to create directory: \" +\n dir.toString());\n }\n }\n\n Collection<File> data = FileUtils.listFiles(dir,\n FileFilterUtils.trueFileFilter(),\n FileFilterUtils.trueFileFilter());\n String[] files = new String[data.size()];\n Iterator<File> it = data.iterator();\n for (int i = 0; it.hasNext(); i++) {\n files[i] = it.next().getPath().substring(dir.getPath().length() + 1);\n }\n\n StartupMessage msg = new StartupMessage(InetAddress.getLocalHost()\n .getHostName(), port, id, files);\n msg.send(nameServer, namePort);\n }", "private void configurePhotoLoaders() {\n String themePhotosUrl = null;\n String myPhotosUrl = null;\n String friendPhotosUrl = null;\n\n if (mTheme != null) {\n themePhotosUrl = String.format(Endpoints.THEME_PHOTO_LIST, mTheme.id);\n\n if (!isAuthenticating() && mPhotoUser != null) {\n myPhotosUrl = String.format(Endpoints.USER_THEME_PHOTO_LIST, Endpoints.ME_ID,\n mTheme.id);\n\n friendPhotosUrl = String.format(Endpoints.FRIENDS_PHOTO_LIST, Endpoints.ME_ID,\n mTheme.id);\n }\n }\n\n mThemePhotosLoader = restartLoader(mLoaderMgr, THEME_PHOTOS_ID, mThemePhotosLoader,\n new PhotoCallbacks(THEME_PHOTOS_ID, mThemePhotos), themePhotosUrl);\n mMyPhotosLoader = restartLoader(mLoaderMgr, MY_PHOTOS_ID, mMyPhotosLoader,\n new PhotoCallbacks(MY_PHOTOS_ID, mMyPhotos), myPhotosUrl);\n mFriendPhotosLoader = restartLoader(mLoaderMgr, FRIEND_PHOTOS_ID, mFriendPhotosLoader,\n new PhotoCallbacks(FRIEND_PHOTOS_ID, mFriendPhotos), friendPhotosUrl);\n }", "public StorageManagerImpl()\n {\n if (log.isDebugEnabled())\n {\n log.debug(\"Creating Instance of StorageManagerImpl\");\n }\n storageProxyHolder = new Hashtable();\n\n try\n {\n initializeStorageProxies();\n nRegister();\n }\n catch (Throwable throwable)\n {\n if (log.isErrorEnabled())\n {\n log.error(\"Failed to create StorageManager object\", throwable);\n }\n throwable.printStackTrace();\n }\n }", "private void init() {\n\n\t\tinitializeLists();\n\t\tcreateTiles();\n\t\tcreateTileViews();\n\t\tshuffleTiles();\n\n\t}", "@Override protected void pathInit() {\r\n\r\n // place any initialization code here\r\n\r\n }", "private void init() {\n\n File folder = new File(MAP_PATH);\n File[] listOfFiles = folder.listFiles();\n\n for (int i = 0; i < Objects.requireNonNull(listOfFiles).length; i++) {\n this.mapFiles.add(new File(MAP_PATH + listOfFiles[i].getName()));\n }\n }", "private void manageLoaders() {\n\n // note: null is used in place of a Bundle object since all additional\n // parameters for Loader are global variables\n\n // get LoaderManager and initialise the loader\n if (getSupportLoaderManager().getLoader(LOADER_ID_01) == null) {\n getSupportLoaderManager().initLoader(LOADER_ID_01, null, this);\n } else {\n getSupportLoaderManager().restartLoader(LOADER_ID_01, null, this);\n }\n }", "public AccountStorage() {\n accounts = new ConcurrentHashMap<>();\n minerMap = new ConcurrentHashMap<>();\n blockMap = new ConcurrentHashMap<>();\n initAccounts();\n logger.info(\"AccountStorage: New AccountStorage created.\");\n }", "public ClassPathManager() {\n projectCP = new LinkedList<File>();\n buildCP = new LinkedList<File>();\n projectFilesCP = new LinkedList<File>();\n externalFilesCP = new LinkedList<File>();\n extraCP = new LinkedList<File>();\n// systemCP = new LinkedList<File>();\n// openFilesCP = new LinkedList<File>();\n }", "public void init(){\n\t\tm_Folders = new ArrayList<Folder>();\n\t\n\t\tm_Folders.add(new Folder(\"Inbox\"));\n\t\tm_Folders.add(new Folder(\"Today\"));\n\t\tm_Folders.add(new Folder(\"Next\"));\n\t\tm_Folders.add(new Folder(\"Someday/Maybe\"));\t\t\n\t}", "public void initClassLoader() {\n FileClassLoadingService classLoader = new FileClassLoadingService();\n\n // init from preferences...\n Domain classLoaderDomain = getPreferenceDomain().getSubdomain(\n FileClassLoadingService.class);\n\n Collection details = classLoaderDomain.getPreferences();\n if (details.size() > 0) {\n\n // transform preference to file...\n Transformer transformer = new Transformer() {\n\n public Object transform(Object object) {\n DomainPreference pref = (DomainPreference) object;\n return new File(pref.getKey());\n }\n };\n\n classLoader.setPathFiles(CollectionUtils.collect(details, transformer));\n }\n\n this.modelerClassLoader = classLoader;\n }", "public void initPath() {\r\n\t\tpath = new Path();\r\n\t}", "protected void initialize() {\n Robot.m_drivetrain.resetPath();\n Robot.m_drivetrain.addPoint(0, 0);\n Robot.m_drivetrain.addPoint(3, 0);\n Robot.m_drivetrain.generatePath();\n \n\t}", "private void initDataLoader() {\n\t}", "@Before\n public void init(){\n spaceCapacity = 20;\n fileSystem = new FileSystem(spaceCapacity);\n }", "public StorageConfig() {\n }", "public Storage(int storageSize) {\n\t\tstorageSpace = new Block[storageSize];\n\t}", "@Override\n public DataStore initialize(Map<String, Object> dsInfos) {\n final String CAPACITY_IOPS = \"capacityIops\";\n\n String url = (String)dsInfos.get(\"url\");\n Long zoneId = (Long)dsInfos.get(\"zoneId\");\n Long podId = (Long)dsInfos.get(\"podId\");\n Long clusterId = (Long)dsInfos.get(\"clusterId\");\n String storagePoolName = (String)dsInfos.get(\"name\");\n String providerName = (String)dsInfos.get(\"providerName\");\n Long capacityBytes = (Long)dsInfos.get(\"capacityBytes\");\n Long capacityIops = (Long)dsInfos.get(CAPACITY_IOPS);\n String tags = (String)dsInfos.get(\"tags\");\n @SuppressWarnings(\"unchecked\")\n Map<String, String> details = (Map<String, String>)dsInfos.get(\"details\");\n\n if (podId == null) {\n throw new CloudRuntimeException(\"The Pod ID must be specified.\");\n }\n\n if (clusterId == null) {\n throw new CloudRuntimeException(\"The Cluster ID must be specified.\");\n }\n\n String storageVip = SolidFireUtil.getStorageVip(url);\n int storagePort = SolidFireUtil.getStoragePort(url);\n\n if (capacityBytes == null || capacityBytes <= 0) {\n throw new IllegalArgumentException(\"'capacityBytes' must be present and greater than 0.\");\n }\n\n if (capacityIops == null || capacityIops <= 0) {\n throw new IllegalArgumentException(\"'capacityIops' must be present and greater than 0.\");\n }\n\n HypervisorType hypervisorType = getHypervisorTypeForCluster(clusterId);\n\n if (!isSupportedHypervisorType(hypervisorType)) {\n throw new CloudRuntimeException(hypervisorType + \" is not a supported hypervisor type.\");\n }\n\n String datacenter = SolidFireUtil.getValue(SolidFireUtil.DATACENTER, url, false);\n\n if (HypervisorType.VMware.equals(hypervisorType) && datacenter == null) {\n throw new CloudRuntimeException(\"'Datacenter' must be set for hypervisor type of \" + HypervisorType.VMware);\n }\n\n PrimaryDataStoreParameters parameters = new PrimaryDataStoreParameters();\n\n parameters.setType(getStorageType(hypervisorType));\n parameters.setZoneId(zoneId);\n parameters.setPodId(podId);\n parameters.setClusterId(clusterId);\n parameters.setName(storagePoolName);\n parameters.setProviderName(providerName);\n parameters.setManaged(false);\n parameters.setCapacityBytes(capacityBytes);\n parameters.setUsedBytes(0);\n parameters.setCapacityIops(capacityIops);\n parameters.setHypervisorType(hypervisorType);\n parameters.setTags(tags);\n parameters.setDetails(details);\n\n String managementVip = SolidFireUtil.getManagementVip(url);\n int managementPort = SolidFireUtil.getManagementPort(url);\n\n details.put(SolidFireUtil.MANAGEMENT_VIP, managementVip);\n details.put(SolidFireUtil.MANAGEMENT_PORT, String.valueOf(managementPort));\n\n String clusterAdminUsername = SolidFireUtil.getValue(SolidFireUtil.CLUSTER_ADMIN_USERNAME, url);\n String clusterAdminPassword = SolidFireUtil.getValue(SolidFireUtil.CLUSTER_ADMIN_PASSWORD, url);\n\n details.put(SolidFireUtil.CLUSTER_ADMIN_USERNAME, clusterAdminUsername);\n details.put(SolidFireUtil.CLUSTER_ADMIN_PASSWORD, clusterAdminPassword);\n\n if (capacityBytes < SolidFireUtil.MIN_VOLUME_SIZE) {\n capacityBytes = SolidFireUtil.MIN_VOLUME_SIZE;\n }\n\n long lMinIops = 100;\n long lMaxIops = 15000;\n long lBurstIops = 15000;\n\n try {\n String minIops = SolidFireUtil.getValue(SolidFireUtil.MIN_IOPS, url);\n\n if (minIops != null && minIops.trim().length() > 0) {\n lMinIops = Long.parseLong(minIops);\n }\n } catch (Exception ex) {\n LOGGER.info(\"[ignored] error getting Min IOPS: \" + ex.getLocalizedMessage());\n }\n\n try {\n String maxIops = SolidFireUtil.getValue(SolidFireUtil.MAX_IOPS, url);\n\n if (maxIops != null && maxIops.trim().length() > 0) {\n lMaxIops = Long.parseLong(maxIops);\n }\n } catch (Exception ex) {\n LOGGER.info(\"[ignored] error getting Max IOPS: \" + ex.getLocalizedMessage());\n }\n\n try {\n String burstIops = SolidFireUtil.getValue(SolidFireUtil.BURST_IOPS, url);\n\n if (burstIops != null && burstIops.trim().length() > 0) {\n lBurstIops = Long.parseLong(burstIops);\n }\n } catch (Exception ex) {\n LOGGER.info(\"[ignored] error getting Burst IOPS: \" + ex.getLocalizedMessage());\n }\n\n if (lMinIops > lMaxIops) {\n throw new CloudRuntimeException(\"The parameter '\" + SolidFireUtil.MIN_IOPS + \"' must be less than or equal to the parameter '\" + SolidFireUtil.MAX_IOPS + \"'.\");\n }\n\n if (lMaxIops > lBurstIops) {\n throw new CloudRuntimeException(\"The parameter '\" + SolidFireUtil.MAX_IOPS + \"' must be less than or equal to the parameter '\" + SolidFireUtil.BURST_IOPS + \"'.\");\n }\n\n if (lMinIops != capacityIops) {\n throw new CloudRuntimeException(\"The parameter '\" + CAPACITY_IOPS + \"' must be equal to the parameter '\" + SolidFireUtil.MIN_IOPS + \"'.\");\n }\n\n if (lMinIops > SolidFireUtil.MAX_MIN_IOPS_PER_VOLUME) {\n throw new CloudRuntimeException(\"This volume's Min IOPS cannot exceed \" + NumberFormat.getInstance().format(SolidFireUtil.MAX_MIN_IOPS_PER_VOLUME) + \" IOPS.\");\n }\n\n if (lMaxIops > SolidFireUtil.MAX_IOPS_PER_VOLUME) {\n throw new CloudRuntimeException(\"This volume's Max IOPS cannot exceed \" + NumberFormat.getInstance().format(SolidFireUtil.MAX_IOPS_PER_VOLUME) + \" IOPS.\");\n }\n\n if (lBurstIops > SolidFireUtil.MAX_IOPS_PER_VOLUME) {\n throw new CloudRuntimeException(\"This volume's Burst IOPS cannot exceed \" + NumberFormat.getInstance().format(SolidFireUtil.MAX_IOPS_PER_VOLUME) + \" IOPS.\");\n }\n\n details.put(SolidFireUtil.MIN_IOPS, String.valueOf(lMinIops));\n details.put(SolidFireUtil.MAX_IOPS, String.valueOf(lMaxIops));\n details.put(SolidFireUtil.BURST_IOPS, String.valueOf(lBurstIops));\n\n SolidFireUtil.SolidFireConnection sfConnection = new SolidFireUtil.SolidFireConnection(managementVip, managementPort, clusterAdminUsername, clusterAdminPassword);\n\n SolidFireCreateVolume sfCreateVolume = createSolidFireVolume(sfConnection, storagePoolName, capacityBytes, lMinIops, lMaxIops, lBurstIops);\n\n SolidFireUtil.SolidFireVolume sfVolume = sfCreateVolume.getVolume();\n\n String iqn = sfVolume.getIqn();\n\n details.put(SolidFireUtil.VOLUME_ID, String.valueOf(sfVolume.getId()));\n\n parameters.setUuid(iqn);\n\n if (HypervisorType.VMware.equals(hypervisorType)) {\n String datastore = iqn.replace(\"/\", \"_\");\n String path = \"/\" + datacenter + \"/\" + datastore;\n\n parameters.setHost(\"VMFS datastore: \" + path);\n parameters.setPort(0);\n parameters.setPath(path);\n\n details.put(SolidFireUtil.DATASTORE_NAME, datastore);\n details.put(SolidFireUtil.IQN, iqn);\n details.put(SolidFireUtil.STORAGE_VIP, storageVip);\n details.put(SolidFireUtil.STORAGE_PORT, String.valueOf(storagePort));\n }\n else {\n parameters.setHost(storageVip);\n parameters.setPort(storagePort);\n parameters.setPath(iqn);\n }\n\n ClusterVO cluster = clusterDao.findById(clusterId);\n\n GlobalLock lock = GlobalLock.getInternLock(cluster.getUuid());\n\n if (!lock.lock(SolidFireUtil.LOCK_TIME_IN_SECONDS)) {\n String errMsg = \"Couldn't lock the DB on the following string: \" + cluster.getUuid();\n\n LOGGER.debug(errMsg);\n\n throw new CloudRuntimeException(errMsg);\n }\n\n DataStore dataStore = null;\n\n try {\n // this adds a row in the cloud.storage_pool table for this SolidFire volume\n dataStore = primaryDataStoreHelper.createPrimaryDataStore(parameters);\n\n // now that we have a DataStore (we need the id from the DataStore instance), we can create a Volume Access Group, if need be, and\n // place the newly created volume in the Volume Access Group\n List<HostVO> hosts = hostDao.findByClusterId(clusterId);\n\n String clusterUuId = clusterDao.findById(clusterId).getUuid();\n\n SolidFireUtil.placeVolumeInVolumeAccessGroups(sfConnection, sfVolume.getId(), hosts, clusterUuId);\n\n SolidFireUtil.SolidFireAccount sfAccount = sfCreateVolume.getAccount();\n Account csAccount = CallContext.current().getCallingAccount();\n\n SolidFireUtil.updateCsDbWithSolidFireAccountInfo(csAccount.getId(), sfAccount, dataStore.getId(), accountDetailsDao);\n } catch (Exception ex) {\n if (dataStore != null) {\n primaryDataStoreDao.expunge(dataStore.getId());\n }\n\n throw new CloudRuntimeException(ex.getMessage());\n }\n finally {\n lock.unlock();\n lock.releaseRef();\n }\n\n return dataStore;\n }", "public static void initialize(final URL[] jars) {\n\n GUIResources.addResourcesFromURLs(jars);\n _initialize();\n\n }", "protected Splitter(Collection<SampleDescriptor> samples) {\n this.samples = new ArrayList<SampleDescriptor>(samples);\n this.setup();\n }", "public void init()\n {\n this.tripDict = new HashMap<String, Set<Trip>>();\n this.routeDict = new HashMap<String, Double>();\n this.tripList = new LinkedList<Trip>();\n this.computeAllPaths();\n this.generateDictionaries();\n }", "public void initializeMixer() {\n\t\tinitializeSlidersAndTextFields();\n\t\tinitializeTooltips();\n\t\tinitializeRecorderListener();\n\t}", "public void initConfigurations() {\r\n for (int configId = 0; configId < savedConfigurations.length; configId++) {\r\n if (configId == InterfaceConfiguration.HD_TEXTURES.getId()) {\r\n continue;\r\n }\r\n int value = savedConfigurations[configId];\r\n if (value != 0) {\r\n set(configId, value, false);\r\n }\r\n }\r\n }", "private void initBroker() throws URISyntaxException, IOException {\n\n ClassLoader classloader = Thread.currentThread().getContextClassLoader();\n\n // InputStream is = classloader.getResourceAsStream(\"data/merchant.csv\");\n\n URL brokerURL = classloader.getResource(\"data/broker/\");\n String[] merchantFiles = new File(brokerURL.toURI()).list();\n\n int j = 0;\n while (j < merchantFiles.length) {\n InputStream is = classloader.getResourceAsStream(\"data/broker/\" + merchantFiles[j]);\n CSVReader reader = new CSVReader(new InputStreamReader(is, \"UTF-8\"));\n String[] nextLine;\n while ((nextLine = reader.readNext()) != null) {\n String tradeName = nextLine[FORENAME];\n if (StringUtils.isBlank(tradeName)) {\n continue;\n }\n brokerImportService.saveOrUpdateBroker(fillUpBrokerImportVO(nextLine));\n }\n j++;\n }\n\n }", "public void setPaths(@NonNull List<String> paths) {\n Parameters.notNull(\"paths\", paths);\n\n synchronized (this) {\n this.paths.clear();\n this.paths.addAll(paths);\n }\n }", "public Storage(String filePath) {\n this.filePath = filePath;\n }", "public Storage(String filePath) {\n this.filePath = filePath;\n }", "public void initialize(S3HandlerDescriptor desc) throws NuxeoException;", "public synchronized void start(String hostname, Registration naming_server)\n throws RMIException, UnknownHostException, FileNotFoundException\n {\n if( !root.isDirectory() || !root.exists() ) {\n throw new FileNotFoundException(\"Server root not found or is not a directory\");\n }\n storage.start();\n command.start();\n \n // Wait for it to start?\n\n Path[] serverFiles = naming_server.register(\n Stub.create(Storage.class, storage, hostname),\n Stub.create(Command.class, command, hostname),\n Path.list(root));\n\n // Storage Server startup deletes all duplicate files on server.\n for(Path p : serverFiles) {\n p.toFile(root).delete();\n File parent = new File(p.toFile(root).getParent());\n \n while(!parent.equals(root)) {\n if(parent.list().length == 0) {\n parent.delete();\n } else {\n break;\n }\n parent = new File(parent.getParent());\n }\n } \n }", "public static void init()\n\t{\n\t\tusername2accesses.clear();\n\t\t//--- adds info.json in ./Home/Administrator for the system admin ---//\n\t\tfinal String adminAccessPath = Hierarchies.getSectionDir() + \"/\" + Hierarchies.getInfoFileName() + \".\" + Directories.getFileExt();\n\t\tfinal File adminAccessFile = new File(adminAccessPath);\n\t\tif (!adminAccessFile.exists())\n\t\t{\n\t\t\tfinal Access[] accesses = new Access[1];\n\t\t\taccesses[0] = new Access(\"admin\", Role.ADMINISTRATOR, null);\n\t\t\tfinal HierarchyItem hierarchyItem = new HierarchyItem(null, null, null, accesses);\n\t\t\tfinal String hierarchyItemAsJson = new Gson().toJson(hierarchyItem);\n\t\t\tFileIO.writeToFile(adminAccessPath, hierarchyItemAsJson);\n\t\t}\n\t\t//--- reads all JSON files recursively in ./Home/Administrator ---//\n\t\t//--- contents of JSON files will be processed to be cached in hash map username2accesses ---//\n\t\tfinal File file = new File(Hierarchies.getSectionDir());\n\t\tfinal Collection<File> jsonFiles = FileUtils.listFiles(file, new String[]{Directories.getFileExt()}, true);\n\t\tfor (File infoFile : jsonFiles) manage(infoFile, Op.STORE);\n\t}", "public StorageConfiguration() {\n }", "private void initClass() {\r\n sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);\r\n secureMediaFileDb = MediaVaultLocalDb.getMediaVaultDatabaseInstance(this);\r\n mediaFileDuration = MediaFileDuration.getDatabaseInstance(this);\r\n }", "public Storage(String filePath) {\n this.filePath = filePath;\n this.ui = new Ui();\n }", "private void initialize() {\r\n\r\n\t\tserverNode = new TreeParent(\"Servers\", \"Servers\", \"AA\", this);\r\n\t\tserverNode.setImageKey(\"System.gif\");\r\n\r\n\t\tnewServerNode = new TreeParent(\"NewServerWizard\", \"New Server\", \"AA\", this);\r\n\t\tnewServerNode.setImageKey(\"ApplicationFilter.gif\");\r\n\t\tnewServerNode.setExpandable(false);\r\n\t\tserverNode.addChild(newServerNode);\r\n\t\tnewServerNode.addChild(new TreeObject(\"Dummy\"));\r\n\t\r\n\t\tloadServers(serverNode);\r\n\r\n\t\tpreferenceNode = new TreeParent(\"Systems\", \"Preferences\", \"BB\", this);\r\n\t\tpreferenceNode.setImageKey(\"preference_page.gif\");\r\n\t\tpreferenceNode.addChild(new TreeObject(\"Dummy\"));\r\n\r\n\t\tinvisibleRoot = new TreeParent(\"\", \"InvisibleRoot\", \"AA\", this);\r\n\t\tinvisibleRoot.addChild(serverNode);\r\n\t\tinvisibleRoot.addChild(preferenceNode);\r\n\r\n\t}", "public abstract FlowNodeStorage instantiateStorage(MockFlowExecution exec, File storageDirectory);", "private void init() {\n\t\tinitProtocol();\n\t\tinitResultStorage();\n\t}", "public void initFromClasspath() throws IOException {\n \t\tcontactNames = loadFromClassPath(\"contactNames\");\n \t\tgroupNames = loadFromClassPath(\"groupNames\");\n \t\tmessageWords = loadFromClassPath(\"messageWords\");\n \t}", "private void init()\n\t{\n\t\tif (_invData == null)\n\t\t\t_invData = new InvestigateStore.MappedStores();\n\t}", "@Override\n\tpublic void initialize() {\n\t\ttransportManager = newServerTransportManager();\n\t\ttransportServer = newTransportServer();\n\t\tserverStateMachine = newTransportServerStateMachine();\n\n\t\tserverStateMachine.setServerTransportComponentFactory(this);\n\t\ttransportManager.setServerTransportComponentFactory(this);\n\t\ttransportServer.setServerTransportComponentFactory(this);\n\t\ttransportServer.setServerHostConfig(getServerHostConfig());\n\n\t\tsetInitialized(true);\n\t}", "public void init() {\n\t\t\tfor(int i=0; i<DBDef.getINSTANCE().getListeRelDef().size(); i++) {\n\t\t\t\tDBDef.getINSTANCE().getListeRelDef().get(i);\n\t\t\t\tHeapFile hp = new HeapFile(DBDef.getINSTANCE().getListeRelDef().get(i));\n\t\t\t\tthis.heapFiles.add(hp);\n\t\t\t}\n\t\t}", "public FileStorage(File path) {\n dataFolder = path;\n }", "private void initializeControllerPaths() throws ResourceHandlerException {\n\n Map<String, Set<String>> newMtab = null;\n Map<CGroupController, String> cPaths;\n try {\n if (this.cGroupsMountConfig.mountDisabledButMountPathDefined()) {\n newMtab = ResourceHandlerModule.\n parseConfiguredCGroupPath(this.cGroupsMountConfig.getMountPath());\n }\n\n if (newMtab == null) {\n // parse mtab\n newMtab = parseMtab(mtabFile);\n }\n\n // find cgroup controller paths\n cPaths = initializeControllerPathsFromMtab(newMtab);\n } catch (IOException e) {\n LOG.warn(\"Failed to initialize controller paths! Exception: \" + e);\n throw new ResourceHandlerException(\n \"Failed to initialize controller paths!\");\n }\n\n // we want to do a bulk update without the paths changing concurrently\n rwLock.writeLock().lock();\n try {\n controllerPaths = cPaths;\n parsedMtab = newMtab;\n } finally {\n rwLock.writeLock().unlock();\n }\n }", "public final void init() {\r\n GroundItemManager.create(this);\r\n SPAWNS.add(this);\r\n }", "public Classpath() {\n _thePaths = new ArrayList<Path>();\n }", "private void initShortestPaths() {\n\t\tcosts = new HashMap<Arc, Integer>();\n\t\tshortestPaths = new HashMap<Arc, List<Arc>>();\n\n\t\tinitShortestPathsFromRoot();\n\t\tinitShortestPathsToRequiredVertices();\n\t}", "public UserStorage(User[] users) {\n this();\n addAll(users);\n }", "public ChassisStashStorage() {\n super();\n }", "public void initialize() {\n\t\tDynamoConfig config = new DynamoConfig();\n\t\tthis.setup(config);\n\t}", "@Override\n public void initialize() {\n for (final PluginInfo<AbstractVolumeManagerPlugin> info : getPlugins()) {\n String name = info.getName();\n if (name == null || name.isEmpty()) {\n name = info.getClassName();\n }\n // Add the plugin to the list of known animals.\n plugins.put(name, info);\n }\n }", "public StorageServer(File root)\n {\n this(root, 0, 0);\n }", "@PostConstruct\n\tprotected void init() {\n\t\tLOGGER.info(\"GalleryModel init Start\");\n\t\tcharacterList.clear();\n\t\ttry {\n\t\t\tif (resource != null && !resource.getPath().contains(\"conf\")) {\n\t\t\t\t\tresolver = resource.getResourceResolver();\n\t\t\t\t\thomePagePath=TrainingHelper.getHomePagePath(resource);\n\t\t\t\t\tif(homePagePath!=null){\n\t\t\t\t\tlandinggridPath = homePagePath;\n\t\t\t\t\tif (!linkNavigationCheck) {\n\t\t\t\t\t\tlinkNavOption = \"\";\n\t\t\t\t\t}\n\t\t\t\t\tcheckLandingGridPath();\n\t\t\t\t\tif (!\"products\".equals(galleryFor)) {\n\t\t\t\t\t\tcharacterList = tileGalleryAndLandingService.getAllTiles(landinggridPath, galleryFor, \"landing\",\n\t\t\t\t\t\t\t\ttrue);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLOGGER.error(\"Exception Occured\", e);\n\t\t}\n\t\tLOGGER.info(\"GalleryModel init End\");\n\t}", "@Override\r\n\tpublic void initTripPicture(Set<Trippicture> pictures, String basePath) {\n\t\tfor (Trippicture tp : pictures) {\r\n\t\t\tString path = basePath + \"image_cache\\\\\" + tp.getName();\r\n\t\t\tif (!new File(path).exists()) {\r\n\t\t\t\tUtils.getFile(tp.getData(), path);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n public void init() {\n leftDrive = hardwareMap.get(DcMotor.class, \"left_drive\");\n rightDrive = hardwareMap.get(DcMotor.class, \"right_drive\");\n }", "public Storage() {\n\n }", "@Override\n\tpublic void init(Config config, Locker locker) throws Exception\n\t{\n\t\tsuper.init(config, locker);\n\n\t\t// Instantiates the database connection pool.\n\t\tWorkbench.getInstance();\n\n\t\tLong l;\n\t\tString s;\n\n\t\tl = config.getLongValue(\"dbdatastore.poolSize\");\n\t\tpoolsize = (l == null) ? POOL_SIZE : (int)l.longValue();\n\n\t\ts = config.getStringValue(\"dbdatastore.importFolder\");\n\t\timportFolder = (s == null) ? IMPORT_FOLDER : s;\n\n\t\tlog.debug(\"threadpoolsize=\" + poolsize + \", importFolder=\" + importFolder);\n\n\t\t// This would be a good place to remove uploads older than 2 weeks?\n\n\t\tpool = (ThreadPoolExecutor)Executors.newFixedThreadPool(poolsize);\n\t\tenqueueFinishedUploads();\n\t}", "protected void setPaths(Double[][] paths){\n this.paths=paths;\n }", "private void initializeFileSystem(final IndexedDiskCacheAttributes cattr)\r\n {\r\n this.rafDir = cattr.getDiskPath();\r\n log.info(\"{0}: Cache file root directory: {1}\", logCacheName, rafDir);\r\n }", "protected void initializeInstances() {\n if (mUser == null) {\n mUser = new User(getApplicationContext());\n }\n if (mUserCache == null) {\n mUserCache = new UserCache();\n }\n if(mGlobalGroupContainer == null) {\n mGlobalGroupContainer = new GroupContainer(getApplicationContext());\n }\n if(mGlobalHistoryContainer == null) {\n mGlobalHistoryContainer = new HistoryContainer(getApplicationContext());\n }\n\n if(mGlobalContactContainer == null) {\n mGlobalContactContainer = new ContactContainer(getApplicationContext());\n mGlobalContactContainer.setContactSortKey(Contact.UserSortKey.USER_FIRST_NAME);\n }\n }", "public TestClassLoader(URL[] urls) {\n super(new URL[0]);\n this.urls = urls;\n }", "public void initPath() {\n\t//path = new SplinePath2D();\n\tpath = newSplinePath2D();\n\tcplist.clear();\n }", "public static void initialize()\n {\n CHUNK_LOADER = new ChunkLoader();\n //VILLAGE_INDICATOR = new VillageIndicator();\n\n BLOCK_LIST.add(CHUNK_LOADER);\n //BLOCK_LIST.add(VILLAGE_INDICATOR);\n Log.info(\"=========================================================> Initialized Blocks\");\n }", "public TaskList(Storage stores) {\n storage = new ArrayList<>();\n dateStorage = new HashMap<>();\n stores.load(this);\n }", "public void initDevices() {\n for (Device device: deviceList) {\n device.init(getCpu().getTime());\n }\n }", "public Storage() {\n this(null, DEFAULT_MAX, DEFAULT_MAX_SIZE);\n }", "private void setupLoadManagers() {\r\n\t mAdapter = new SimpleCursorAdapter(this, \r\n\t \t\tandroid.R.layout.two_line_list_item,\t\t\t\t// Specify used row template\r\n\t \t\tnull, \t\t\t\t\t\t\t\t\t\t\t\t// Pass in the cursor to bind to.\r\n\t \t\tdataColumns, \t\t\t\t\t\t\t\t\t\t// Array of cursor columns to bind to.\r\n\t \t\tviewIDs, \t\t\t\t\t\t\t\t\t\t\t// Which layout objects to bind to those columns\r\n\t \t\t0);\r\n\t \t\t\r\n\t // Associate the (now empty) adapter with the ListView.\r\n\t setListAdapter(mAdapter);\r\n\r\n\t /* The Activity (which implements the LoaderCallbacks<Cursor> interface) is the callbacks object \r\n\t * through which we will interact with the LoaderManager. The LoaderManager uses this object to\r\n\t * instantiate the Loader and to notify the client when data is made available/unavailable */\r\n\t mCallbacks = this;\r\n\r\n\t /* Initialize the Loader with id '1' and callbacks 'mCallbacks'. If the loader doesn't already exist, \r\n\t * one is created. Otherwise, the already created Loader is reused. In either case, the LoaderManager will \r\n\t * manage the Loader across the Activity/Fragment lifecycle, will receive any new loads once they have completed,\r\n\t * and will report this new data back to the 'mCallbacks' object. */\r\n\t LoaderManager lm = getLoaderManager();\r\n\t lm.initLoader(LOADER_ID, null, mCallbacks);\t\t\r\n\t}", "private void initTrees() {\n // My machine tree init code\n myMachineTree = new FileTree(fileDomainModel);\n myMachineScrollPane.add(myMachineTree);\n // Connected machine tree init code\n connectedMachineTree = new FileTree(fileDomainModel);\n connectedMachineScrollPane.add(connectedMachineTree);\n }", "public void init() {\n\t\tfor (Node node : nodes)\n\t\t\tnode.init();\n\t}", "protected void internalSetUris(String[] uris) {\n m_uris = uris;\n m_prefixes = new String[uris.length];\n m_prefixes[0] = \"\";\n m_prefixes[1] = \"xml\";\n }", "private void initializeEmptyStore() throws IOException\r\n {\r\n this.keyHash.clear();\r\n\r\n if (!dataFile.isEmpty())\r\n {\r\n dataFile.reset();\r\n }\r\n }", "public void init(){\n\t\tmultiplexingClientServer = new MultiplexingClientServer(selectorCreator);\n\t}" ]
[ "0.6142194", "0.60665894", "0.5892338", "0.58060217", "0.5663908", "0.5530746", "0.54715335", "0.5459804", "0.54212195", "0.53720844", "0.5356473", "0.5354963", "0.533948", "0.52930844", "0.5282096", "0.52186036", "0.5186597", "0.51807106", "0.51697415", "0.51658773", "0.51633173", "0.516086", "0.5138159", "0.50954264", "0.50799394", "0.50785446", "0.5075851", "0.50565207", "0.5047976", "0.50412405", "0.50406355", "0.5037395", "0.5034269", "0.500859", "0.49957955", "0.49950132", "0.49913397", "0.49609083", "0.4959661", "0.49470347", "0.49398792", "0.49224767", "0.49126154", "0.49004158", "0.48985842", "0.4890063", "0.48866966", "0.4884828", "0.4880511", "0.48791105", "0.4861165", "0.48581457", "0.48573348", "0.48489177", "0.4835857", "0.48355713", "0.48355713", "0.48334363", "0.48303533", "0.4829195", "0.48232755", "0.4820092", "0.4820088", "0.4817133", "0.48158544", "0.48094887", "0.47964114", "0.4793198", "0.47910094", "0.4785301", "0.4783747", "0.4780611", "0.4779265", "0.4777551", "0.4776158", "0.47708815", "0.47603375", "0.47599572", "0.47556925", "0.47555918", "0.47512513", "0.47440454", "0.47411668", "0.47406164", "0.47383505", "0.47347602", "0.47308367", "0.4729426", "0.47291926", "0.47243303", "0.47122914", "0.47106728", "0.47102904", "0.4707869", "0.47069147", "0.4703287", "0.4678346", "0.46737096", "0.46660247", "0.46652067" ]
0.7497944
0
Constructor. Set outlets to the itemView.
public PlaylistViewHolder(View itemView) { super(itemView); this.imageView1 = itemView.findViewById(R.id.imageView1); this.imageView2 = itemView.findViewById(R.id.imageView2); this.imageView3 = itemView.findViewById(R.id.imageView3); this.imageView4 = itemView.findViewById(R.id.imageView4); this.imageView5 = itemView.findViewById(R.id.imageView5); this.imageView6 = itemView.findViewById(R.id.imageView6); this.imageViews = new ImageView[] {imageView1, imageView2, imageView3, imageView4, imageView5, imageView6}; this.playlistTitleTextView = itemView.findViewById(R.id.playlistTitleTextView); this.playlistDescriptionTextView = itemView.findViewById(R.id.playlistDescriptionTextView); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n\n nameTextView = (TextView) itemView.findViewById(R.id.torrent_name);\n movieImageView = (ImageView) itemView.findViewById(R.id.movie_image);\n }", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n\n breweryImage = (ImageView) itemView.findViewById(R.id.brewery_image);\n breweryName = (TextView) itemView.findViewById(R.id.brewery_name);\n }", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n\n tvTitle = itemView.findViewById(R.id.tvTitle);\n tvBody = itemView.findViewById(R.id.tvDescription);\n tvDueDate = itemView.findViewById(R.id.tvDueDate);\n content = itemView.findViewById(R.id.cardViewToDo);\n details = itemView.findViewById(R.id.rlToDoDetails);\n ivDropDown = itemView.findViewById(R.id.ivDropDown);\n }", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n\n nameTextView = (TextView) itemView.findViewById(R.id.user_name);\n startTextView = (TextView) itemView.findViewById(R.id.start_date);\n }", "public MyViewHolder(View itemView) {\n super(itemView);\n\n // get the reference of item view's\n exercise = itemView.findViewById(R.id.exercise);\n }", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n\n EmpirePortrait= (ImageView) itemView.findViewById(R.id.EmpirePortrait);\n nameTextView = (TextView) itemView.findViewById(R.id.EmpireName);\n deleteButton = (ImageButton) itemView.findViewById(R.id.EmpireDelete);\n FlagView = (ImageView) itemView.findViewById(R.id.EmpireFlag);\n ViewButton = (Button) itemView.findViewById(R.id.viewButton);\n }", "public AddItem() {\n initComponents();\n }", "public ItemsAdapter() {\n\n\n }", "public SellItem() {\n initComponents();\n }", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n }", "public TreasureView() {\n initComponents();\n }", "public TreasureView() {\n initComponents();\n }", "ItemViewHolder(View itemView)\n {\n super(itemView);\n _cardView = (CardView)itemView.findViewById(R.id.exercise_cardView);\n _exerciseName = (TextView)itemView.findViewById(R.id.exercise_headingText);\n _reps = (TextView)itemView.findViewById(R.id.exercise_repsText);\n _image = (ImageView)itemView.findViewById(R.id.exercise_image);\n }", "public RecipeViewHolder(View itemView) {\n super(itemView);\n\n imageView = itemView.findViewById(R.id.image);\n nameView = itemView.findViewById(R.id.name);\n itemView.setOnClickListener(this);\n }", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n int position = getAdapterPosition();\n\n\n nameTextView = (TextView) itemView.findViewById(R.id.contact_name);\n messageButton = (Button) itemView.findViewById(R.id.message_button);\n messageButton.setOnClickListener(new ButtonClick(this));\n itemView.setOnClickListener(this);\n\n }", "public Viewholder(@NonNull View itemView)\n {\n super(itemView);\n btnReadMore = itemView.findViewById(R.id.btn_read_more);\n sqView = itemView.findViewById(R.id.sqView);\n title = itemView.findViewById(R.id.textTitle);\n body = itemView.findViewById(R.id.textBody);\n }", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n imageView1 = itemView.findViewById(R.id.item_health_center_first_photo);\n imageView2 = itemView.findViewById(R.id.item_health_center_second_photo);\n imageView3 = itemView.findViewById(R.id.item_health_center_third_photo);\n imageView4 = itemView.findViewById(R.id.item_health_center_forth_photo);\n }", "public ViewHolder(View itemView) {\n tvGrupo = (TextView) itemView.findViewById(R.id.tvGrupo);\n tvNCD = (TextView) itemView.findViewById(R.id.tvNCD);\n tvACD = (TextView) itemView.findViewById(R.id.tvACD);\n ivCD = (ImageView) itemView.findViewById(R.id.ivCD);\n }", "public ItemMenu() {\n super(null, null);\n }", "public Item()\r\n {\r\n // Initialize instance variables\r\n \r\n }", "public ViewHolder(@NonNull View itemView) {\n super(itemView);\n txvNombreMascotaDesparasitante = itemView.findViewById(R.id.txvNombreMascotaDesparasitante);\n txvNombreDesparasitante = itemView.findViewById(R.id.txvNombreDesparasitante);\n txvPesoDesparasitante = itemView.findViewById(R.id.txvPesoDesparasitante);\n txvFechaAplicacionDesparasitante = itemView.findViewById(R.id.txvFechaAplicacionDesparasitante);\n \n }", "@Override\n public void init() // set up GUI\n {\n setLayout(new FlowLayout());\n\n customerView = new CustomerView(); // initialize customerView\n \n add(customerView); // add customerView to the GUI\n }", "public AddItems() {\n initComponents();\n \n }", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n\n /* designation_txt = (TextView) itemView.findViewById(R.id.designation_txt);\n name_txt = (TextView) itemView.findViewById(R.id.name_txt);\n number_txt = (TextView) itemView.findViewById(R.id.number_txt);*/\n\n }", "public ItemsControl() {\t\t\t\t\n\t\tlistListener = new SourceListChangeListener();\n\n\t\tBoxLayout boxLayout = new BoxLayout(this, BoxLayout.Y_AXIS);\n\t\tsetLayout(boxLayout);\t\t\t\t\n\t\tif (Beans.isDesignTime()) {\t\t\t\n\t\t\tJLabel designTimeCaptionLbl = new JLabel(\"<ItemsControl>\");\t\t\t\t\t\t\n\t\t\tthis.add(designTimeCaptionLbl);\n\t\t}\n\t}", "public ItemViewHolder(View itemView) {\n super(itemView);\n iv_image = (RoundedImageView)itemView.findViewById(R.id.item_photo);\n tv_title = (TextView)itemView.findViewById(R.id.item_title);\n tv_subtitle = (TextView)itemView.findViewById(R.id.item_subtitle);\n iv_image2 = (ImageView)itemView.findViewById(R.id.imageView1);\n }", "public ModifyItem() {\n initComponents();\n }", "public FoodHolder(@NonNull View itemView) {\n super(itemView);\n name = itemView.findViewById(R.id.textview_food_name);\n sugars = itemView.findViewById(R.id.textview_food_grams_sugar);\n foodType = itemView.findViewById(R.id.textview_food_foodtype);\n viewBackground = itemView.findViewById(R.id.layout_single_food_background);\n viewForeground = itemView.findViewById(R.id.layout_single_food_foreground);\n }", "CardViewHolder(View itemView) {\n\t\t\tsuper(itemView);\n\n\t\t\t// Find the {@ink ImageView} for the thumbnail\n\t\t\tnewsThumbnail = itemView.findViewById(R.id.story_image);\n\n\t\t\t// Find the {@link TextView} for the news title\n\t\t\tnewsTitleTextView = itemView.findViewById(R.id.news_title_text);\n\n\t\t\t// Find the {@link TextView} for the section of the news story\n\t\t\tsectionNameTextView = itemView.findViewById(R.id.section_name_text);\n\n\t\t\t// Find the {@link TextView} for the published date\n\t\t\tdatePublishedTextView = itemView\n\t\t\t\t\t.findViewById(R.id.date_published_text);\n\n\t\t\t// Find the {@link CardView} for each news story\n\t\t\tstoryCard = itemView.findViewById(R.id.story_card);\n\t\t}", "public ViewHolder(View itemView) {\n super(itemView);\n tvNature = (TextView)itemView.findViewById(R.id.item_name);\n tvAmountNature = (TextView)itemView.findViewById(R.id.item_amount);\n }", "private void initViews() {\n\n button_addCart = (Button) view.findViewById(R.id.addcart_btn);\n label_itemName = (TextView) view.findViewById(R.id.textView_itemname);\n label_itemPrice = (TextView) view.findViewById(R.id.textView_itemPrice);\n label_incrementQuantity = (TextView) view.findViewById(R.id.add_txtview);\n label_decrementQuantity = (TextView) view.findViewById(R.id.subtract_txtview);\n label_totalPrice = (TextView) view.findViewById(R.id.total_price);\n label_quantity = (TextView) view.findViewById(R.id.itemquantity_txtview);\n selectedItemQuantity= checkItemQuantity();\n label_quantity.setText(\"Quantity: \"+selectedItemQuantity);\n\n\n label_itemName.setText(itemname);\n label_itemPrice.setText(\"Rs: \"+ String.valueOf(itemPrice));\n totalprice= itemPrice;\n\n menusItem.setDesiredQuantity(selectedItemQuantity);\n\n\n //setHomeButton();\n\n setInitial_itemPrice();\n\n setListeners();\n\n\n }", "public Items()\r\n\t{\r\n\t\t//create the window/panel\r\n\t\tsuper( \"Swing Window\" );\r\n\t\tsetSize( 500,200 );\r\n\t\tsetDefaultCloseOperation( EXIT_ON_CLOSE );\r\n\t\tadd(pnl);\r\n\t\t\r\n\r\n\t\t//add the different checkboxes to the panel\r\n\t\tpnl.add( chk1 ) ;\r\n\t\tpnl.add( chk2 ) ;\r\n\t\tpnl.add( chk3 ) ;\r\n\t\tpnl.add( chk4 ) ;\r\n\t\t\r\n\t\t//pnl.add( chk5 ) ;\r\n\t\t//pnl.add( chk6 ) ;\r\n\t\t//pnl.add( chk7 ) ;\r\n\t\t//add the combobox\r\n\t\tbox1.setSelectedIndex(0);\r\n\t\tpnl.add( box1 ) ;\r\n\t\t\r\n\t\tbox2.setSelectedIndex(0);\r\n\t\tpnl.add( box2 ) ;\r\n\t\t\r\n\t\tpnl.add( lst1 ) ; \r\n\t\tpnl.add( lst2 ) ; \r\n\t\tsetVisible( true );\r\n\t}", "public ListItems() {\n itemList = new ArrayList();\n }", "public ContractView() {\n initComponents();\n }", "public ViewHolder(View itemView) {\n super(itemView);\n ButterKnife.bind(this, itemView);\n\n }", "public ViewHolder(Context context, View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n this.context = context;\n profilePicture = itemView.findViewById(R.id.person_picture);\n nameTextView = itemView.findViewById(R.id.person_name);\n itemView.setOnClickListener(this);\n }", "private void setupItemView(View view, NewCollectedItem item) {\n if (item != null) {\n TextView nameText = view.findViewById(R.id.collected_name);\n TextView heightText = view.findViewById(R.id.collected_height);\n TextView pointsText = view.findViewById(R.id.collected_points);\n TextView positionText = view.findViewById(R.id.collected_position);\n TextView dateText = view.findViewById(R.id.collected_date);\n\n nameText.setText(item.getName());\n heightText.setText(mContext.getResources().getString(R.string.height_display,\n UIUtils.IntegerConvert(item.getHeight())));\n positionText.setText(mContext.getResources().getString(R.string.position_display,\n item.getLongitude(), item.getLatitude()));\n pointsText.setText(mContext.getResources().getString(R.string.points_display,\n UIUtils.IntegerConvert(item.getPoints())));\n dateText.setText(mContext.getResources().getString(R.string.date_display,\n item.getDate()));\n\n if (item.isTopInCountry()) {\n view.findViewById(R.id.collected_trophy).setVisibility(View.VISIBLE);\n }\n else {\n view.findViewById(R.id.collected_trophy).setVisibility(View.INVISIBLE);\n }\n\n positionText.setVisibility(View.GONE);\n dateText.setVisibility(View.GONE);\n setCountryFlag(view, item.getCountry());\n }\n }", "public ItemSummeryLVUI() {\n super();\n List<PTableColumn> tblCols = new ArrayList();\n// tblCols.add(new PTableColumn(String.class, \"empty\"));\n tblCols.add(new PTableColumn(String.class, \"SKU\"));\n tblCols.add(new PTableColumn(String.class, \"UOM\"));\n tblCols.add(new PTableColumn(String.class, \"QTY\"));\n\n getTable().init(InventoryJournalLine.class, tblCols);\n \n }", "public BookViewHolder(View itemView) {\n super(itemView);\n tvTitle = (TextView) itemView.findViewById(R.id.tvTitle);\n tvAuthors = (TextView) itemView.findViewById(R.id.tvAuthors);\n tvDate = (TextView) itemView.findViewById(R.id.tvPublishedDate);\n tvPublisher = (TextView) itemView.findViewById(R.id.tvPublisher);\n itemView.setOnClickListener(this);\n }", "public ViewHolder(View itemView) {\n super(itemView);\n imageView = itemView.findViewById(R.id.ivSomeImage);\n textView = itemView.findViewById(R.id.tvSomeText);\n }", "ViewHolder(View itemView) {\n super(itemView);\n\n // Initialize the views\n mSportsImage = itemView.findViewById(R.id.Imagen_Noticia);\n\n // Set the OnClickListener to the entire view.\n// itemView.setOnClickListener(this);\n }", "public MantClientesView() {\n initComponents();\n }", "public ItemPro() {\n initComponents();\n comboFill();\n }", "public View() {\n initComponents();\n }", "public ViewProperty() {\n initComponents();\n }", "ViewHolder(View itemView) {\n super(itemView);\n // Initialize the views.\n titleTemaText = itemView.findViewById(R.id.titleDetail);\n userTemaText = itemView.findViewById(R.id.userDetail);\n cuerpoTemaText = itemView.findViewById(R.id.cuerpoTema);\n userRespuestaText = itemView.findViewById(R.id.usuarioRespuesta);\n cuerpoRespuestaText = itemView.findViewById(R.id.cuerpoRespuesta);\n ctgBackground = itemView.findViewById(R.id.ctgBackground);\n fondoRespuesta = itemView.findViewById(R.id.fondoRespuesta);\n }", "public Item()\n {\n super();\n }", "public JobViewHolder(@NonNull View itemView) {\n super(itemView);\n\n Log.d(\"Testing\", \"JobViewHolder: \");\n mlogo = (ImageView) itemView.findViewById(R.id.job_logo);\n mBewerber_Kontakt = (TextView) itemView.findViewById(R.id.bewerber);\n mBundesland = (TextView) itemView.findViewById(R.id.bundesland);\n mEinsatzort = (TextView) itemView.findViewById(R.id.einsatzort);\n mStelle_Aktiv_bis = (TextView) itemView.findViewById(R.id.activbis);\n relativeLayout = itemView.findViewById(R.id.recycle_view);\n\n }", "private void inflateViewForItem(Item item) {\n\n //Inflate Layout\n ItemCardBinding binding = ItemCardBinding.inflate(getLayoutInflater());\n\n //Bind Data\n binding.imageView.setImageBitmap(item.bitmap);\n binding.title.setText(item.label);\n binding.title.setBackgroundColor(item.color);\n\n //Add it to the list\n b.list.addView(binding.getRoot());\n }", "ViewHolder(final View itemView) {\n super(itemView);\n name = (TextView) itemView.findViewById(R.id.Name);\n// address = (TextView) itemView.findViewById(R.id.Address);\n// phone = (TextView) itemView.findViewById(R.id.phone);\n// OrderId = (TextView) itemView.findViewById(R.id.OrderId);\n//// b = (Button) itemView.findViewById(R.id.close);\n//\n itemView.setOnClickListener(this);\n }", "public ItemMenu(JDealsController sysCtrl) {\n super(\"Item Menu\", sysCtrl);\n\n this.addItem(\"Add general good\", new Callable() {\n @Override\n public Object call() throws Exception {\n return addItem(ProductTypes.GOODS);\n }\n });\n this.addItem(\"Restourant Event\", new Callable() {\n @Override\n public Object call() throws Exception {\n return addItem(ProductTypes.RESTOURANT);\n }\n });\n this.addItem(\"Travel Event\", new Callable() {\n @Override\n public Object call() throws Exception {\n return addItem(ProductTypes.TRAVEL);\n }\n });\n }", "ViewHolder(View itemView) {\n super(itemView);\n\n //Finding the Views needed\n mEditTextAttrName = itemView.findViewById(R.id.edittext_item_product_config_attr_name);\n mEditTextAttrValue = itemView.findViewById(R.id.edittext_item_product_config_attr_value);\n mImageButtonRemoveAction = itemView.findViewById(R.id.imgbtn_item_product_config_attr_remove);\n\n //Registering Focus Change Listeners on TextInput Fields to capture the updated value\n mEditTextAttrName.setOnFocusChangeListener(this);\n mEditTextAttrValue.setOnFocusChangeListener(this);\n\n //Setting Click Listener on ImageButton\n mImageButtonRemoveAction.setOnClickListener(this);\n }", "ViewHolder(View placeView) {\n super(placeView);\n\n // Initialize the views.\n mTitleText = placeView.findViewById(R.id.itemTitle);\n mSubtitleText = placeView.findViewById(R.id.itemSubtitle);\n mRoutesImage = placeView.findViewById(R.id.itemImage);\n\n placeView.setOnClickListener(this);\n }", "public ShoppingCartItemViewHolder(View itemView) {\n super(itemView);\n\n this.tv_seller = (TextView) itemView.findViewById(R.id.seller_shopping_cart_list_item);\n this.tv_price = (TextView) itemView.findViewById(R.id.price_shopping_cart_list_view);\n this.tv_title = (TextView) itemView.findViewById(R.id.title_shopping_cart_list);\n this.tv_location = (TextView) itemView.findViewById(R.id.location_shopping_cart_list_item);\n this.img_portrait = (ImageView) itemView.findViewById(R.id.img_shopping_cart_list);\n// this.btn_cancel = (Button) itemView.findViewById(R.id.btn_submit_shopping_cart_list);\n// this.btn_submit = (Button) itemView.findViewById(R.id.btn_submit_shopping_cart_list);\n }", "public TaskViewHolder(View itemView) {\n super(itemView);\n\n taskDescriptionView = (TextView) itemView.findViewById(R.id.taskDescription);\n\n }", "public TaskViewHolder(View itemView) {\n super(itemView);\n\n taskDescriptionView = itemView.findViewById(R.id.taskDescription);\n updatedAtView = itemView.findViewById(R.id.taskUpdatedAt);\n priorityView = itemView.findViewById(R.id.priorityTextView);\n itemView.setOnClickListener(this);\n }", "public ManipularView() {\n initComponents();\n }", "public ItemHolder(@NonNull View itemView) {\n super(itemView);\n /*tvNombre=itemView.findViewById(R.id.tvNombre);\n tvCiudad=itemView.findViewById(R.id.etCiudad);\n btBorrar=itemView.findViewById(R.id.btBorrar);\n btEditar=itemView.findViewById(R.id.btEditar);\n cl = itemView.findViewById(R.id.cl);\n ivImagen = itemView.findViewById(R.id.ivImagen);*/\n }", "public MenuItemView(float x, float y, float width, float height,\n\t\t\tApplication app, MenuItem menuItem, int indexInArray) {\n\t\tsuper(app);\n\t\t\n\t\tthis.translate(new Vector3D(x,y));\n\t\tmenuItemView = new MTRectangle(width, height, app);\n\t\tbgImage = app.loadImage(menuItem.getImgPath());\n\t\tmenuItemView.setTexture(bgImage);\n\t\tmenuItemView.setNoStroke(true);\n\t\tthis.addChild(menuItemView);\n\t\t\n\t\tmenuItemViewColored = new MTRectangle(width, height, app);\n\t\tbgImageColor = app.loadImage(menuItem.getMenuImgPathColor());\n\t\tmenuItemViewColored.setTexture(bgImageColor);\n\t\tmenuItemViewColored.setFillColor(new MTColor(255, 255, 255, 0));\n\t\tmenuItemViewColored.setNoStroke(true);\n\t\tthis.addChild(menuItemViewColored);\n\t\tcolored = false;\n\t\t\n\t\tMTRectangle transBox = new MTRectangle(0, height / 15 * 11, width,\n\t\t\t\theight / 15 * 4, app);\n\t\ttransBox.setFillColor(app.getTransparantBlack());\n\t\ttransBox.setNoStroke(true);\n\t\tthis.addChild(transBox);\n\t\t\n\t\tMTTextArea textBox = new MTTextArea(app, app.getFontTitle());\n\t\tthis.addChild(textBox);\n\n\t\ttextBox.setNoFill(true);\n\t\ttextBox.setNoStroke(true);\n\t\ttextBox.setText(menuItem.getName());\n\t\ttextBox.setPositionRelativeToParent(new Vector3D(width / 2,\n\t\t\t\theight/10 * 8.5f));\n\t\t\n\t\tfinal MTComponent component = this;\n\t\tfor (MTComponent comp : this.getChildren()) {\n\t\t\tcomp.removeAllGestureEventListeners();\n\t\t\tcomp.addGestureListener(DragProcessor.class,\n\t\t\t\t\tnew IGestureEventListener() {\n\t\t\t\t\n\t\t\t\t@Override\n\t\t\t\tpublic boolean processGestureEvent(MTGestureEvent ge) {\n\t\t\t\t\tge.setTargetComponent(component);\n\t\t\t\t\tcomponent.processGestureEvent(ge);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\t\t\tcomp.registerInputProcessor(new TapProcessor(app));\n\t\t\tcomp.addGestureListener(TapProcessor.class, \n\t\t\t\t\tnew IGestureEventListener() {\n\t\t\t\t\n\t\t\t\t@Override\n\t\t\t\tpublic boolean processGestureEvent(MTGestureEvent ge) {\n\t\t\t\t\tcomponent.processGestureEvent(ge);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t\n\t\tarrow = new ArrowUp(app);\n\t\tthis.addChild(arrow);\n\t\tarrow.setPositionRelativeToParent(new Vector3D(width / 2,\n\t\t\t\tapp.height / 20 * 19));\n\t\t\n\t}", "public OrderItem_ViewHolder(@NonNull View itemView) {\n super(itemView);\n itemsDate = itemView.findViewById(R.id.oh_date);\n itemsAddress = itemView.findViewById(R.id.address_id);\n itemsTotal = itemView.findViewById(R.id.total_id);\n NoItems = itemView.findViewById(R.id.NoItems_id);\n order_item = itemView.findViewById(R.id.orderTab);\n }", "public ClientView() {\n initComponents();\n }", "public ItemListFragment() {\n }", "public CommonHolder_Recycler_beauty_adapter(View itemView) {\n super(itemView);\n\n\n\n }", "ViewHolder(final View view) {\n\n super();\n\n m_platilloView = (TextView) view.findViewById(R.id.list_item_platillo_textview);\n m_precioView =\n (TextView) view.findViewById(R.id.list_item_precio_textview);\n m_restaurantView = (TextView)\n view.findViewById(R.id.list_item_restaurant_platillo_textview);\n\n }", "public LoreBookSelectionViewHolder(View itemView) {\n super(itemView);\n itemView.setOnClickListener(this);\n bookIcon = itemView.findViewById(R.id.bookIcon);\n bookName = itemView.findViewById(R.id.selectionName);\n }", "public InventoryGUI() {\n initComponents();\n }", "public EntrepriseHolder(@NonNull View itemView) {\n super(itemView);\n nom = itemView.findViewById(R.id.afficheNom);\n adresse = itemView.findViewById(R.id.afficheAdresse);\n ville = itemView.findViewById(R.id.afficheVille);\n nature = itemView.findViewById(R.id.afficheNature);\n }", "ViewHolder(View itemView) {\n super(itemView);\n alphabetText = (TextView) itemView.findViewById(R.id.text_view_all_user_alphabet);\n usernameText = (TextView) itemView.findViewById(R.id.text_view_username);\n\n }", "public CandyViewHolder(View itemView, CandyListAdapter adapter) {\n super(itemView);\n candyItemView = (TextView) itemView.findViewById(R.id.jar_item_textView);\n candyColorView = itemView.findViewById(R.id.jar_item_colorView);\n this.mAdapter = adapter;\n itemView.setOnClickListener(this);\n itemView.setOnLongClickListener(this);\n\n // initialise isPrompt\n isPrompt = true;\n }", "public InventoryPanel(InventoryState inventoryState) {\n this.inventoryState = inventoryState;\n\n setLayout(new BorderLayout());\n Border inventoryBorder = new EmptyBorder(20, 20, 20, 20);\n Border inventoryTitle = new TitledBorder(\"Inventory List\");\n setBorder(new CompoundBorder(inventoryTitle, inventoryBorder));\n setPreferredSize(new Dimension(425, 400));\n\n this.itemScroll = new JScrollPane();\n this.itemList = new JList(inventoryState);\n itemScroll.setViewportView(itemList);\n\n add(itemScroll);\n }", "public DrugsViewHolder(View itemView) {\n super(itemView);\n\n tv_drug_c_name = (TextView) itemView.findViewById(R.id.tvDrugCName);\n tv_drug_s_name = (TextView) itemView.findViewById(R.id.tvDrugSName);\n tv_concentration = (TextView) itemView.findViewById(R.id.tvDrugC);\n\n itemView.setOnClickListener(this);\n\n }", "public QS001OtherItemListBox(Component view) {\r\n super(view);\r\n }", "public VendaView() {\n initComponents();\n }", "public void init(){\n\t\tthis.removeAll();\n\t\tthis.setLayout(null);//not using layout manager, placing components.\n\t\tcart = new Cart();//instantiate the shopping cart.\n\t\t\n\t\t//Sets up 'add item' label.\n\t\tJLabel addLabel = new JLabel(\"Add Item:\");\n\t\taddLabel.setBounds(10, 0, 75, 20);\n\t\tadd(addLabel);\n\n\t\tinitializeButtons();\n\t\t\n\t\t//Sets up the cart label, this will display how many items are currently in your cart.\n\t\tcartLabel = new JLabel(cart.size() + \" items in your cart\");\n\t\tcartLabel.setBounds(10, 200, 150, 20);\n\t\tadd(cartLabel);\n\n\t\t//Sets up the checkout button. calls the checkOut() method when clicked.\n\t\tJButton checkoutButton = new JButton(\"CHECKOUT\");\n\t\tcheckoutButton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tcheckOut(true);\n\t\t\t}\n\t\t});\n\t\tcheckoutButton.setBounds(10, 225, 100, 20);\n\t\tadd(checkoutButton);\n\t\t\n\t}", "public ViewHolder(View itemView) {\n super(itemView);\n\n listName = (TextView) itemView.findViewById(R.id.listName);\n remainingItems = (TextView) itemView.findViewById(R.id.remainingItems);\n listButtonLayout = (LinearLayout) itemView.findViewById(R.id.listButtonLayout);\n btnView = (Button) listButtonLayout.findViewById(R.id.btnEditList);\n btnDeleteList = (Button) listButtonLayout.findViewById(R.id.btnDeleteList);\n\n\n }", "public orderView() {\n initComponents();\n }", "public MyViewHolder(final View itemView) {\n super(itemView);\n\n\n title = (TextView) itemView.findViewById(R.id.title_play_list);\n thumbnail = (ImageView) itemView.findViewById(R.id.thumbnail_play_list);\n\n\n }", "public ViewProductInfo() {\n initComponents();\n }", "public ItemMenu(AbstractInMenu source, Item item, int x, int y) {\n super(source.getEntity(), source.getInput());\n this.sourceMenu = source;\n this.item = item;\n this.activated = false; \n this.xPos = x - width;\n this.yPos = y;\n \n setItemMenu();\n setGraphics();\n }", "private View setupView(View v)\n {\n\n TextView item_name = (TextView)v.findViewById(R.id.item_name);\n TextView item_price = (TextView)v.findViewById(R.id.item_price);\n TextView item_description = (TextView)v.findViewById(R.id.item_description);\n\n add = (Button) v.findViewById(R.id.fabCart);\n add.setOnClickListener(this);\n mlike = (ImageView) v.findViewById(R.id.btnLike);\n mlike.setOnClickListener(this);\n\n if(mDescription != null) {\n item_name.setText(mDescription[Data.UzaData.NAME.ordinal()] + \" | \" + mDescription[Data.UzaData.SELLER.ordinal()]);\n item_price.setText(mDescription[Data.UzaData.PRICE.ordinal()]);\n item_description.setText(mDescription[Data.UzaData.DESCRIPTION.ordinal()]);\n }\n\n initPager(v);\n\n //TODO \"Show more pictures\" button\n //TODO \"Message\" button\n\n return v;\n }", "public ProductListJPanel() {\n initComponents();\n }", "public void setItemView(ItemView itemView){\n listOfTiles.get(listOfTiles.size() - 1).addItemView(itemView);\n }", "public NapakalakiView() {\n initComponents();\n }", "public Items(String image, int y, int x) {\r\n\t\tsuper(image, y, x);\r\n\t}", "public ItemFragment() {\n }", "public UserViewHolder(View itemView) {\n super(itemView);\n imageViewProfile = (ImageView) itemView.findViewById(R.id.circle_avatar_workmates);\n textViewMessage = (TextView) itemView.findViewById(R.id.name_worker);\n }", "public Item() {\n\t}", "public Item() {\n\t}", "public CutiView() {\n initComponents();\n this.cutiController = new CutiController(new MyConnection().getConnection());\n bindingTable();\n reset();\n }", "public ChatViewHolder(View itemView) {\r\n super(itemView);\r\n\r\n mView = itemView;\r\n }", "public ViewHolder(View itemView, ItemClickListener listener) {\n super(itemView);\n this.listener = listener;\n\n layout = (LinearLayout) itemView.findViewById(R.id.oneAlbum_brief);\n imgAlbumCover = (ImageView) itemView.findViewById(R.id.draw_albumcover);\n tvArtist = (TextView) itemView.findViewById(R.id.tv_artistName);\n tvAlbum = (TextView) itemView.findViewById(R.id.tv_albumName);\n\n layout.setOnClickListener(this);\n // tvArtist.setOnClickListener(this);\n // tvAlbum.setOnClickListener(this);\n }", "public OrderItemHolder(MyAdapter myAdapter) {\n super(myAdapter, R.layout.delivered_order_item);\n ButterKnife.bind(this, itemView);\n }", "public Item()\r\n {\r\n gen = new Random();\r\n color = new Color(gen.nextInt());\r\n x = 200;\r\n w = 100;\r\n h = 18;\r\n }", "public MemberPickListView() {\r\n initComponents();\r\n initOtherComponents();\r\n addMouseListener(new MemberPickListView.CommonMouseAdapter());\r\n }", "private void init() {\n\t\tcreateSubjectField();\n\t\tcreateTextField();\n\t\tcreateButton();\n\t\tsetupSubjectPanel();\n\t\tsetupToDoPanel();\n\n\t\tsetBorder(BorderFactory.createTitledBorder(\"To Do List\"));\n\t\tsetLayout(new BorderLayout());\n\t\tadd(pnlSubject, BorderLayout.NORTH);\n\t\tadd(scroll, BorderLayout.CENTER);\n\t\tadd(pnlButton, BorderLayout.SOUTH);\n\t}", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n\n super(itemView);\n this.context = context;\n\n\n messageButton = (Button) itemView.findViewById(R.id.message_button);\n\n date_created=(TextView)itemView.findViewById(R.id.date_created);\n volume=(TextView)itemView.findViewById(R.id.volume);\n itemView.setOnClickListener(this);\n\n\n\n }", "public CountryViewHolder(@NonNull View itemView) {\n super(itemView);\n textViewCountryName = itemView.findViewById(R.id.item_country_view_tv_country_name);\n textViewCountryCapital = itemView.findViewById(R.id.item_country_view_tv_country_capital);\n\n }", "public void init()\n\t{\n\t\tadd(onloadItem = newOnloadItem(\"onload_item\"));\n\t\tadd(mouseoverItem = newMouseoverItem(\"mouseover_item\"));\n\t\tadd(onclickItem = newOnclickItem(\"onclick_item\"));\n\n\t\t// animation\n\t\tmouseoverItem.add(new YuiAnimation(OnEvent.mouseover, onloadItem)\n\t\t\t\t.addEffect(mouseoverEffect()));\n\t\tmouseoverItem.add(new YuiAnimation(OnEvent.mouseout, mouseoverItem)\n\t\t\t\t.addEffect(mouseoutEffect()));\n\n\t\t// this is the \"select\"\n\t\tonclickItem.add(new YuiAnimation(OnEvent.click, mouseoverItem, getElement(),\n\t\t\t\tgetSelectValue()).addEffect(onselectEffect()));\n\n\t\t// this is the \"unselect\"\n\t\tonclickItem.add(onunselectAnimation = new YuiAnimation(OnEvent.click, onclickItem,\n\t\t\t\tgetElement(), getUnselectValue()).addEffect(onunselectEffect()));\n\t}", "Item(){\r\n\t\tthis(0, new Weight(5), new DukatAmount(0));\r\n\t}", "private void initialize() {\r\n \r\n // Set style\r\n setStroke(Color.BLACK);\r\n \r\n // Bind position to model.\r\n model.xProperty().addListener(new ChangeListener<Number>() {\r\n @Override\r\n public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {\r\n if (newValue.doubleValue() == 1000) {\r\n setVisible(false);\r\n }\r\n else {\r\n setVisible(true);\r\n setCenterX(ShoeView.shoeToViewX(newValue.doubleValue(), model.getSide()));\r\n }\r\n }\r\n });\r\n model.yProperty().addListener(new ChangeListener<Number>() {\r\n @Override\r\n public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {\r\n if (newValue.doubleValue() == 1000) {\r\n setVisible(false);\r\n }\r\n else {\r\n setVisible(true);\r\n setCenterY(ShoeView.shoeToViewY(newValue.doubleValue(), model.getSide()));\r\n }\r\n }\r\n });\r\n }" ]
[ "0.6639047", "0.66074127", "0.6554218", "0.6410656", "0.6363896", "0.6336243", "0.62820905", "0.62417966", "0.6238995", "0.62243545", "0.6222466", "0.6222466", "0.6213682", "0.6209274", "0.61951476", "0.6187174", "0.6165233", "0.6149182", "0.6146159", "0.6135646", "0.6094332", "0.6092637", "0.6088992", "0.60752714", "0.60648847", "0.60475636", "0.6046283", "0.6040692", "0.60143226", "0.600421", "0.5982291", "0.59799314", "0.59795284", "0.59615755", "0.5959427", "0.5957016", "0.5955291", "0.59435844", "0.5939398", "0.59286016", "0.59203494", "0.5919658", "0.59078926", "0.58936054", "0.58929235", "0.58905065", "0.58667207", "0.58662283", "0.58598244", "0.5856236", "0.5847961", "0.58298534", "0.58263177", "0.58256984", "0.5818204", "0.58046204", "0.57864356", "0.5779629", "0.57732856", "0.5769531", "0.57684356", "0.57383627", "0.57312286", "0.57234335", "0.5718792", "0.5701582", "0.56989783", "0.5698491", "0.56937563", "0.5690249", "0.5689325", "0.56825423", "0.56775326", "0.567565", "0.567334", "0.5672903", "0.56681997", "0.56679875", "0.56651634", "0.5661534", "0.56598073", "0.56585395", "0.56521314", "0.564552", "0.564349", "0.564166", "0.5638048", "0.5638048", "0.5633992", "0.56277496", "0.5622874", "0.56115454", "0.560513", "0.5603515", "0.56033677", "0.5603337", "0.55978787", "0.559221", "0.55899847", "0.5588515" ]
0.605167
25
Set the playlist's images/title/description in UI.
public void updateUI(Playlist playlist) { this.playlistTitleTextView.setText(playlist.getName()); this.playlistDescriptionTextView.setText(playlist.getDescription()); ArrayList<String> imageURIs = playlist.getImageURIs(); int currIndex = 0; for (String uri : imageURIs) { ImageView currImageView = imageViews[currIndex]; int resourceID = currImageView.getResources().getIdentifier(uri, null, currImageView.getContext().getPackageName()); currImageView.setImageResource(resourceID); currIndex++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createDefaultPlayLists() {\n try {\n BufferedImage favoriteSongsImage = ImageIO.read(new File(\"Images/FavoriteSong.png\"));\n PlayListPanel favoriteSongs = new PlayListPanel(favoriteSongsImage, \"Favorite Songs\", \"Favorite albumSongs chosen by user\", this, this);\n playListPanels.put(\"Favorite Songs\", favoriteSongs);\n } catch (IOException e) {\n JOptionPane.showMessageDialog(null, \"Error reading favorite albumSongs image\", \"An Error Occurred\", JOptionPane.ERROR_MESSAGE);\n }\n try {\n BufferedImage sharedSongImage = ImageIO.read(new File(\"Images/SharedSongs.jpg\"));\n PlayListPanel sharedSongs = new PlayListPanel(sharedSongImage, \"Shared Songs\", \"Shared albumSongs between users\", this, this);\n playListPanels.put(\"Shared Songs\", sharedSongs);\n } catch (IOException e) {\n JOptionPane.showMessageDialog(null, \"Error reading shared albumSongs image\", \"An Error Occurred\", JOptionPane.ERROR_MESSAGE);\n }\n }", "public void setPlaylist(Playlist playlist) {\n // store playlist and the mode that we are now having\n data.put(Variable.TEMP_PLAYLIST, playlist);\n // store the mode and the playlist in the data as well\n data.put(Variable.MODE, Mode.ProvidedPlaylist);\n data.put(Variable.ITEM, playlist.getName());\n }", "public void addSongToPlayList(String playListTitle, String description, String songDirectory) {\n if (!playListPanels.containsKey(playListTitle)) {//if this playlist doesn't exist.\n createPlayList(playListTitle, description);//creating new one\n }\n try {//adding song to playlist\n MP3Info currentSong = new MP3Info(songDirectory);//creating mp3 info file\n AlbumPanel songAlbum = albumPanels.get(currentSong.getAlbum());//getting song's album\n for (SongPanel songPanel : songAlbum.getSongPanels()) {\n if (songPanel.getMp3Info().getTitle().equals(currentSong.getTitle())) {//if we found that song\n playListPanels.get(playListTitle).getPlayListSongs().add(songPanel);//adding to given playlist\n playListPanels.get(playListTitle).updateImage();//updating playlist image\n break;\n }\n }\n } catch (IOException | NoSuchFieldException e) {\n JOptionPane.showMessageDialog(null, \"Error reading mp3 file\", \"An Error Occurred\", JOptionPane.ERROR_MESSAGE);\n }\n }", "public void createPlayList(String title, String description) {\n if (!playListPanels.containsKey(title)) {//if this playlist doesn't exist.\n PlayListPanel newPlayListPanel = new PlayListPanel(emptyPlayListImage, title, description, this, this);\n playListPanels.put(title, newPlayListPanel);\n }\n }", "private void initializeUI() {\n MedUtils.displayMedInfo(coverArt, playBinding.thumbIv, playBinding.titleTv,\n playBinding.subtitleTv, selectedMed);\n\n playBinding.playPauseBt.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n switch (MediaPlayerService.getState()) {\n case Constants.STATE_PLAY:\n mediaPlayerService.pauseAction();\n break;\n case Constants.STATE_PAUSE:\n mediaPlayerService.playAction();\n break;\n case Constants.STATE_NOT_INIT:\n startMediaPlayerService();\n break;\n }\n }\n });\n\n playBinding.stopBt.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n mediaPlayerService.stopAction();\n }\n });\n }", "private void setUIFields(){\n setImage();\n setTitle();\n setLocation();\n setRatingBar();\n setDate();\n setISBN();\n setDescription();\n setPageCount();\n setNumRatings();\n }", "private void initPlayerUI() {\n if (playableMediaItem instanceof Podcast) {\n tvPlayerTitle.setText(((Podcast) playableMediaItem).getSelectedTrack().getTitle().trim());\n } else {\n tvPlayerTitle.setText(playableMediaItem.getName().trim());\n }\n tvPlayserSubtitle.setText(playableMediaItem.getSubHeader().trim());\n if (playableMediaItem.getCoverImageUrl() == null) {\n final LetterBitmap letterBitmap = new LetterBitmap(getActivity());\n Bitmap letterTile = letterBitmap.getLetterTile(playableMediaItem.getName(), playableMediaItem.getName(), COVER_IMAGE_SIZE, COVER_IMAGE_SIZE);\n imgPlayerCover.setImageBitmap(letterTile);\n int dominantColor = UIHelper.getDominantColor(letterTile);\n rlTopSectionBckg.setBackgroundColor(dominantColor);\n } else {\n Glide.with(getActivity()).load(playableMediaItem.getCoverImageUrl()).crossFade().into(new GlideDrawableImageViewTarget(imgPlayerCover) {\n @Override\n public void onResourceReady(GlideDrawable drawable, GlideAnimation anim) {\n super.onResourceReady(drawable, anim);\n Bitmap bitmap = ((GlideBitmapDrawable) drawable).getBitmap();\n int dominantColor = UIHelper.getDominantColor(bitmap);\n rlTopSectionBckg.setBackgroundColor(dominantColor);\n }\n });\n }\n if (playableMediaItem instanceof Podcast) {\n Track selectedTrack = ((Podcast) playableMediaItem).getSelectedTrack();\n tvTrackDuration.setText(selectedTrack.getDuration());\n sbPlayerProgress.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {\n @Override\n public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n\n }\n\n @Override\n public void onStartTrackingTouch(SeekBar seekBar) {\n isChangingProgress = true;\n }\n\n @Override\n public void onStopTrackingTouch(SeekBar seekBar) {\n isChangingProgress = false;\n int progress = seekBar.getProgress();\n int position = (int) ((maxDuration * progress) / 100);\n seekBar.setProgress(progress);\n universalPlayer.seekTo(position);\n }\n });\n }\n if (playableMediaItem instanceof RadioItem) {\n sbPlayerProgress.setOnTouchListener(new View.OnTouchListener() {\n @Override\n public boolean onTouch(View v, MotionEvent event) {\n return true;\n }\n });\n }\n\n //playableMediaItem.syncWithDB();\n if (playableMediaItem.isSubscribed) {\n itemFavorites.setIcon(getResources().getDrawable(R.drawable.ic_heart_black_24dp));\n } else {\n itemFavorites.setIcon(getResources().getDrawable(R.drawable.ic_heart_white_24dp));\n }\n }", "public void configureGallery(T aView)\n {\n aView.setText(\"Title\"); aView.setFont(Font.Arial10);\n Label label = new Label(\"TitleView\"); label.setPadding(0,40,8,40); label.setTextFill(Color.GRAY);\n aView.setContent(label);\n }", "public void addToMusicContents(JLabel image, String trackTitle, String singer) {\n\t\tJPanel individualMusicPanel = createIndividualPanel(image, trackTitle, singer);\n\t\tmusicContents.add(individualMusicPanel);\t\n\t}", "public void onUpdatedPlaylist() {\n setCurrentTrack();\n //this was implemented so this device could have a view of the playlist\n }", "protected void setPic() {\n }", "private void setPlayList() {\n int[] rawValues = {\n R.raw.bensoundbrazilsamba,\n R.raw.bensoundcountryboy,\n R.raw.bensoundindia,\n R.raw.bensoundlittleplanet,\n R.raw.bensoundpsychedelic,\n R.raw.bensoundrelaxing,\n R.raw.bensoundtheelevatorbossanova\n };\n String[] countryList = {\n \"Brazil\",\n \"USA\",\n \"India\",\n \"Iceland\",\n \"South Korea\",\n \"Indonesia\",\n \"Brazil\"\n };\n String [] descriptions = {\n \"Samba is a Brazilian musical genre and dance style, with its roots in Africa via the West African slave trade religious particularly of Angola and African traditions.\",\n \"Country music is a genre of American popular originated Southern States in the 1920s music that in the United\",\n \"The music of India includes multiple varieties of folk music, pop, and Indian classical music. India's classical music tradition, including Hindustani music and Carnatic, has a history spanning millennia and developed over several eras\",\n \"The music of Iceland includes vibrant folk and pop traditions. Well-known artists from Iceland include medieval music group Voces Thules, alternative rock band The Sugarcubes, singers Björk and Emiliana Torrini, post- rock band Sigur Rós and indie folk/indie pop band Of Monsters and Men\",\n \"The Music of South Korea has evolved over the course of the decades since the end of the Korean War, and has its roots in the music of the Korean people, who have inhabited the Korean peninsula for over a millennium. Contemporary South Korean music can be divided into three different categories: Traditional Korean folk music, popular music, or K- pop, and Western- influenced non-popular music\",\n \"The music of Indonesia demonstrates its cultural diversity, the local musical creativity, as well as subsequent foreign musical influences that shaped contemporary music scenes of Indonesia. Nearly thousands Indonesian having its own cultural and artistic history and character Nearly of islands\",\n \"Samba is a Brazilian musical genre and dance style, with its roots in Africa via the West African slave trade religious particularly of Angola\"\n };\n\n for (int i = 0; i < rawValues.length; i++) {\n this.mPlayList.add(rawValues[i]);\n this.mTrackList.add(new Track(this.getResources().getResourceEntryName(rawValues[i]),\n countryList[i],descriptions[i],rawValues[i]));\n }\n }", "public void setName(String username) {\n\t\tthis.playlistName = username;\n\t}", "private void setUpPanel() {\n\n this.add(nameLabel);\n this.add(showMetadataButton);\n this.add(compressFilesButton);\n this.add(decompressFilesButton);\n this.add(compressionResultLabel);\n this.add(messageShorteningButton);\n this.add(messageShorteningResultLabel);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n \t//requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);\n super.onCreate(savedInstanceState);\n setContentView(R.layout.video_list);\n \n mPreference =getSharedPreferences(Const.PREF_SETTING_FILE_NAME, 0);\n mShowIcon=mPreference.getBoolean(PREF_KEY_SHOW_ICON, false);\n mPreference.registerOnSharedPreferenceChangeListener(this);\n View v=findViewById(R.id.title_button_thumb);\n v.setSelected(mShowIcon);\n \n //mPlayListId=getIntent().getExtras().getString(Const.EXTRA_PLAYLIST_ID);\n //mTitle=getIntent().getExtras().getString(Const.EXTRA_TITLE);\n ContentValues cv=getIntent().getParcelableExtra(Const.EXTRA_PLAYLIST_PARCEL);\n mPlayListId=cv.getAsString(YT.PRJ_PLAYLIST_ID);\n mTitle=cv.getAsString(YT.PRJ_TITLE);\n ((TextView)findViewById(R.id.title_text)).setText(mTitle);\n Logging.d(\"playlistId=\"+mPlayListId);\n\n findViewById(R.id.title_button_refresh).setVisibility(View.VISIBLE);\n findViewById(R.id.title_button_thumb).setVisibility(View.VISIBLE);\n\n //initButtonLayout();\n \n mListView=getListView();\n \n mAdapter= new SimpleCursorAdapter(\n this, \n R.layout.main_list_item,\n mCursor,\n new String[]{ YT.PRJ_TITLE,},// YT.PRJ_DURATION}, \n new int[] {R.id.main_list_text,},// R.id.main_list_text_desc }\n SimpleCursorAdapter.FLAG_REGISTER_CONTENT_OBSERVER\n ){\n \t@Override\n \tpublic View \t\n \tgetView(int position, View convertView, ViewGroup parent){\n \t\tView v= super.getView(position, convertView, parent);\n \t\t\n \t\tmCursor.moveToPosition(position);\n \t\tint i=mCursor.getInt(mCursor.getColumnIndex(YT.PRJ_DURATION));\n \t\t\n \t\tTextView tv=(TextView)v.findViewById(R.id.main_list_text_small);\n \t\tString time=timeToString(i);\n \t\ttv.setText(time);\n \t\ttv.setVisibility(View.VISIBLE);\n \t\t//tv.setGravity()\n \t\t\n \t\tif(mSelectMode){\n \t\tImageView check=(ImageView)v.findViewById(R.id.main_list_check);\n \t\t\tcheck.setVisibility(View.VISIBLE);\n \t\t\t\tboolean next=mCheckData.get(position);\n \t\t\t\tDrawable d=getResources().getDrawable(android.R.drawable.checkbox_off_background);\n \t\t\t\tif(next){\n \t\t\t\t\td=getResources().getDrawable(android.R.drawable.checkbox_on_background);\n \t\t\t\t}\n \t\t\t\tcheck.setImageDrawable(d); \t\t\t\n \t\t}else{\n \t\tImageView check=(ImageView)v.findViewById(R.id.main_list_check);\n \t\t\tcheck.setVisibility(View.GONE); \t\t\t\n \t\t}\n \t\t\n \t\tImageView iv=(ImageView)v.findViewById(R.id.main_list_image);\n \t\tif(mShowIcon){\n \t\t\tAQuery aq=new AQuery(iv);\n \t\t\taq.image(mCursor.getString(mCursor.getColumnIndex(YT.PRJ_SQDEFAULT))).visible();\n \t\t}else{\n \t\t\tiv.setVisibility(View.GONE);\n \t\t}\n\n\t\t\t\t\n \t\treturn v;\n \t}\n \t\n \t@Override\n \tpublic void bindView(View view, Context context, Cursor cursor) {\n \t\tsuper.bindView(view, context, cursor);\n \t\t//Logging.d(\"Video List Bind View Called\");\n \t} \t\n \t\n }; \n \n mListView.setOnItemClickListener(new OnItemClickListener(){\n\n\t\t\t@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long id) {\n\t\t\t\tif(mSelectMode){\n\t\t\t\t\tboolean prev=mCheckData.get(position);\n\t\t\t\t\tmCheckData.set(position, !prev);\n\t\t\t\t\t\n\t\t\t\t\tboolean next=mCheckData.get(position);\n\t\t\t\t\tImageView iv=(ImageView)view.findViewById(R.id.main_list_check);\n\t\t\t\t\tDrawable d=getResources().getDrawable(android.R.drawable.checkbox_off_background);\n\t\t\t\t\tif(next){\n\t\t\t\t\t\td=getResources().getDrawable(android.R.drawable.checkbox_on_background);\n\t\t\t\t\t}\n\t\t\t\t\tiv.setImageDrawable(d);\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\tmCursor.moveToPosition(position);\n\t\t\t\t\tString videoId=mCursor.getString(mCursor.getColumnIndex(YT.PRJ_VIDEO_ID));\n\t\t\t\t\t\n\t\t\t\t\tString url=\"http://www.youtube.com/watch?v=\"+videoId;\n\t\t\t\t\tIntent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(\"vnd.youtube:\" + videoId)); \n\t\t\t\t\tList<ResolveInfo> list = getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); \n\t\t\t\t\tif (list.size() == 0) {\n\t\t\t\t\t\tintent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));\n\t\t\t\t\t\tintent=new Intent(Intent.ACTION_VIEW);\n\t\t\t\t\t\tintent.setData(Uri.parse((String)url));\n\t\t\t\t\t\tLogging.d(\"Watching :\"+url);\n\t\t\t\t\t}\n\n\t\t\t\t\tstartActivity(intent);\t\t\t\t\t\n\t\t\t\t}\t\n\t\t\t}\n });\n \n startProgress();\n mQueryHandler=new QueryHandler(getContentResolver()){\n \t\n };\n //Uri uri=Uri.parse(Const.URI_STRING+\"/videolist/\"+mPlayListId);\n Uri uri=Uri.parse(\"content://\"+getPackageName()+\".YouTubeProvider/\"+YT.TABLE_PLAYLIST+\"/\"+mPlayListId);\n mQueryHandler.startQuery(0, null, uri, null, null, null, null);\n \n \n invalidateImportantButton();\n \n }", "private void populatePlayList()\r\n {\r\n \tCursor songs = playlist.getSongs();\r\n \tcurAdapter = new SimpleCursorAdapter(this, R.layout.song_item, songs, new String[]{Library.KEY_ROWID}, new int[] {R.id.SongText});\r\n \tcurAdapter.setViewBinder(songViewBinder);\r\n \tsetListAdapter(curAdapter);\r\n }", "public Playlist(String titel) {\n this.titel = titel;\n }", "private void initPlayModeView() {\n playMode = new Label(\"PLAY\");\n playMode.setPrefSize(200,100);\n playMode.setFont(Font.font(null, FontWeight.BOLD, 30));\n playMode.setTextFill(Color.BLUE);\n playMode.setEffect(getDropShadow());\n }", "public static void loadPlaylist()\n {\n if (JSoundsMainWindowViewController.alreadyPlaying)\n JSoundsMainWindowViewController.stopSong();\n \n JSoundsMainWindowViewController.shutDownPlayer();\n JSoundsMainWindowViewController.isPlaylist=true;\n JSoundsMainWindowViewController.playlistOrderBy(true, false, false);\n }", "public void setupUI() {\r\n\t\t\r\n\t\tvPanel = new VerticalPanel();\r\n\t\thPanel = new HorizontalPanel();\r\n\t\t\r\n\t\titemName = new Label();\r\n\t\titemName.addStyleName(Styles.page_title);\r\n\t\titemDesc = new Label();\r\n\t\titemDesc.addStyleName(Styles.quest_desc);\r\n\t\titemType = new Label();\r\n\t\titemType.addStyleName(Styles.quest_lvl);\r\n\t\t\r\n\t\tVerticalPanel img = new VerticalPanel();\r\n\t\timg.add(new Image(imgDir));\r\n\t\t\r\n\t\tvPanel.add(itemName);\r\n\t\tvPanel.add(itemDesc);\r\n\t\tvPanel.add(img);\r\n\t\tvPanel.add(hPanel);\r\n\t\t\r\n\t\tVerticalPanel mainPanel = new VerticalPanel();\r\n\t\tmainPanel.setWidth(\"100%\");\r\n\t\tvPanel.addStyleName(NAME);\r\n\t\t\r\n\t\tmainPanel.add(vPanel);\r\n \tinitWidget(mainPanel);\r\n }", "private void setListener() {\n\n mManagerPlay.setmOnSuccessPlayer(new ManagerPlay.OnSuccessPlayer() {\n @Override\n public void onSuccess(Tracks tracks) {\n\n mTxtNameMediaPlayer.setText(checkLimitText(tracks.getTitle(), 15));\n mTxtArtistMediaPlayer.setText(checkLimitText(tracks.getArtist(), 20));\n mManagerPlay.setIsPause(false);\n mImgPause.setImageResource(R.drawable.ic_pause);\n\n if(mManagerPlay.isRepeat()) {\n mImgRepeat.setImageResource(R.drawable.icon_repeat_selected);\n\n } else {\n mImgRepeat.setImageResource(R.drawable.ic_repeat);\n }\n\n if (tracks.getArtwork_url() != null) {\n ImageLoader.getInstance().displayImage(tracks.getArtwork_url(), mImgMediaPlayer);\n }\n }\n });\n\n mViewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {\n @Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n\n }\n\n @Override\n public void onPageSelected(int position) {\n mTabBar.clickTab(position);\n }\n\n @Override\n public void onPageScrollStateChanged(int state) {\n\n }\n });\n\n mTabBar.setOnClickTabBar(new TabBar.OnClickTabBar() {\n @Override\n public void onClick(int position) {\n mViewPager.setCurrentItem(position);\n }\n });\n }", "public JPanelUpload() {\n initComponents();\n JPanelTrack.setBase(tracksStart);\n updateTrackList();\n }", "public void setAlbumTiltle(String title){\n \tandroid.util.Log.d(TAG, \"setAlbumSetTiltle *** title = \" + title);\n\tif(title != null){\n \t\tmAlbumTitle.setText(title);\n\t}\n }", "private void populateUI() {\n\n Picasso.get()\n .load(Codes.BACKDROP_URL + movie.backdropPath)\n .error(R.drawable.error)\n .into(mBinding.backdrop);\n\n Picasso.get()\n .load(Codes.POSTER_URL + movie.posterPath)\n .error(R.drawable.error)\n .into(mBinding.movieDetails.poster);\n\n diskIO.execute(new Runnable() {\n @Override\n public void run() {\n MiniMovie miniMovie = mDatabase.movieDao().getMovieById(movie.movieId);\n\n if (miniMovie != null) {\n isFavorite = true;\n mBinding.favoriteButton.setImageResource(R.drawable.ic_star_white_24px);\n } else {\n isFavorite = false;\n mBinding.favoriteButton.setImageResource(R.drawable.ic_star_border_white_24px);\n }\n }\n });\n }", "private void populateUserPlaylitstsSection() {\n \tPlaylist dumyPlaylist = new Playlist();\n \tMap<Long, Playlist> playlistsMap = mDataManager.getStoredPlaylists();\n \tList<Playlist> playlists = new ArrayList<Playlist>();\n \t\n \t// Convert from Map<Long, Playlist> to List<Itemable> \n \tif (playlistsMap != null && playlistsMap.size() > 0) {\n \t\tfor(Map.Entry<Long, Playlist> p : playlistsMap.entrySet()){\n \t\t\tplaylists.add(p.getValue());\n \t\t}\n \t}\n\t\t\n \t// populates the favorite playlists.\n \tif (!Utils.isListEmpty(playlists)) {\n \t\tmContainerMyPlaylists.setVisibility(View.VISIBLE);\n \t\t// shows any internal component except the empty text.\n \t\tmTextMyPlaylist1Name.setVisibility(View.VISIBLE);\n \t\tmTextMyPlaylist2Name.setVisibility(View.VISIBLE);\n \t\tmTextMyPlaylist3Name.setVisibility(View.VISIBLE);\n \t\tmImageMoreIndicator.setVisibility(View.VISIBLE);\n \t\tmTextMyPlaylistEmpty.setVisibility(View.GONE);\n \t\t\n \t\tmTextMyPlaylistsValue.setText(Integer.toString(playlists.size()));\n \t\t\n \t\tStack<TextView> playlistsNames = new Stack<TextView>();\n \t\tplaylistsNames.add(mTextMyPlaylist3Name);\n \t\tplaylistsNames.add(mTextMyPlaylist2Name);\n \t\tplaylistsNames.add(mTextMyPlaylist1Name);\n\n \t\tTextView songName = null;\n \t\t\n \t\tfor (Playlist playlist : playlists) {\n \t\t\tif (playlistsNames.isEmpty())\n \t\t\t\tbreak;\n \t\t\t\n \t\t\tsongName = playlistsNames.pop();\n \t\t\tsongName.setText(playlist.getName());\n\t\t\t}\n \t\t\n \t} else {\n \t\tmContainerMyPlaylists.setVisibility(View.GONE);\n \t}\n\t}", "public void setTitleImage(String titleImage) {\n this.titleImage = titleImage;\n }", "@Override\n public void onBindViewHolder(@NonNull ViewHolder viewHolder, int i ) {\n\n String title = items.get(i);\n String description = descr.get(i);\n\n viewHolder.textTitle.setText(title);\n viewHolder.textDescription.setText(description);\n\n\n\n // similarly you can set new image for each card and descriptions\n\n\n\n }", "void infoSetUp() {\r\n\t\tJPanel imageInfo = new JPanel();\r\n\t\timageInfo.setLayout(new GridLayout(2, 0));\r\n\t\tJPanel mButtons = new JPanel();\r\n\r\n\t\tJButton save = new JButton(\"save\");\r\n\t\tJButton upload = new JButton(\"upload\");\r\n\t\tJButton delete = new JButton(\"delete\");\r\n\t\tJButton view = new JButton(\"open\");\r\n\r\n\t\tupload.setActionCommand(\"upload\");\r\n\t\tview.setActionCommand(\"view\");\r\n\t\tActionListener upList = new UpList();\r\n\t\tupload.addActionListener(upList);\r\n\t\tview.addActionListener(upList);\r\n\t\tmButtons.add(save);\r\n\t\tmButtons.add(upload);\r\n\t\tmButtons.add(delete);\r\n\t\tmButtons.add(view);\r\n\r\n\t\tJTextArea info = new JTextArea(\"Path: \");\r\n\t\tinfo.setEditable(false);\r\n\t\timageInfo.add(info);\r\n\t\timageInfo.add(mButtons);\r\n\t\tmainFrame.add(imageInfo);\r\n\t\tinfoText = info;\r\n\t}", "public void setLabel(JLabel label) {\n\t\tswitch (label.getName()) {\t\t\t// the three labels are named via label.setName(labelName)\n\t\tcase \"title\": \t\ttitleLabel = label; break;\n\t\tcase \"artist(s)\": \tartistLabel = label; break;\n\t\tcase \"album\": \t\talbumLabel = label; break;\n\t\t}\n\t}", "private void updateViews() {\n titleTextView.setText(currentVolume.getTitle());\n descTextView.setText(Html.fromHtml(currentVolume.getDesc(), Html.FROM_HTML_MODE_COMPACT));\n authorsTextView.setText(currentVolume.getAuthors());\n\n retrieveImage();\n }", "public void updateMini(String title, String artist, Bitmap albumArt) {\n\n songMiniText.setText(title);\n artistMiniText.setText(artist);\n\n if (albumArt != null) {\n albumMiniArt.setImageBitmap(albumArt);\n } else {\n albumMiniArt.setImageResource(R.drawable.album);\n }\n }", "private void populateViews() {\n TextView songName = findViewById(R.id.songName);\n songName.setText(songs.getSongName());\n TextView albumName = findViewById(R.id.albumPlayerAlbumName);\n albumName.setText(songs.getAlbumName());\n TextView artistName = findViewById(R.id.albumPlayerArtistName);\n artistName.setText(songs.getArtistName());\n ImageView albumCover = findViewById(R.id.albumPlayerImage);\n albumCover.setImageResource(songs.getId());\n\n }", "private void updateTitle() {\n\t\tAbstractFolderModel folderModel = FolderModelManager.getInstance().getCurrentModel();\n\t\tTextView titleTV = (TextView) findViewById(R.id.title);\n\t\ttitleTV.setText(folderModel.title());\n\n\t\t\t\t\n\t\tint imgCount=FolderModelManager.getInstance().getCurrentModel().files().length;\n\t\tint folderCount=FolderModelManager.getInstance().getCurrentModel().subfolders().length-1;\n\t\t\n\t\tStringBuilder sb=new StringBuilder(); \n\t\tif (imgCount>0){\n\t\t\tsb.append(Utility.getResourceString(R.string.IMAGE));\n\t\t\tsb.append(\":\");\n\t\t\tsb.append(imgCount);\n\t\t}\n\t\tsb.append(' ');\n\t\tif (folderCount>0){\n\t\t\tsb.append(Utility.getResourceString(R.string.SUBFOLDER));\n\t\t\tsb.append(\":\");\n\t\t\tsb.append(folderCount);\n\t\t}\n\t\t\n\t\tTextView titleRight = (TextView) findViewById(R.id.title_right);\n\t\ttitleRight.setText(sb);\n\t\tsb=null;\t\n\t}", "public void setPlaybackInfo(Track track) {\n RelativeLayout playbackInfoTop = (RelativeLayout) findViewById(R.id.playback_info_top);\n LinearLayout playbackInfoBottom = (LinearLayout) findViewById(R.id.playback_info_bottom);\n if (playbackInfoTop != null)\n playbackInfoTop.setClickable(false);\n if (playbackInfoBottom != null)\n playbackInfoBottom.setClickable(false);\n\n if (track != null) {\n ImageView playbackInfoAlbumArtTop = (ImageView) findViewById(R.id.playback_info_album_art_top);\n TextView playbackInfoArtistTop = (TextView) findViewById(R.id.playback_info_artist_top);\n TextView playbackInfoTitleTop = (TextView) findViewById(R.id.playback_info_title_top);\n ImageView playbackInfoAlbumArtBottom = (ImageView) findViewById(R.id.playback_info_album_art_bottom);\n TextView playbackInfoArtistBottom = (TextView) findViewById(R.id.playback_info_artist_bottom);\n TextView playbackInfoTitleBottom = (TextView) findViewById(R.id.playback_info_title_bottom);\n Bitmap albumArt = null;\n if (track.getAlbum() != null)\n albumArt = track.getAlbum().getAlbumArt();\n if (playbackInfoAlbumArtTop != null && playbackInfoArtistTop != null && playbackInfoTitleTop != null) {\n if (albumArt != null)\n playbackInfoAlbumArtTop.setImageBitmap(albumArt);\n else\n playbackInfoAlbumArtTop.setImageDrawable(getResources().getDrawable(\n R.drawable.no_album_art_placeholder));\n playbackInfoArtistTop.setText(track.getArtist().toString());\n playbackInfoTitleTop.setText(track.getTitle());\n playbackInfoTop.setClickable(true);\n }\n if (playbackInfoAlbumArtBottom != null && playbackInfoArtistBottom != null && playbackInfoTitleBottom != null) {\n if (albumArt != null)\n playbackInfoAlbumArtBottom.setImageBitmap(albumArt);\n else\n playbackInfoAlbumArtBottom.setImageDrawable(getResources().getDrawable(\n R.drawable.no_album_art_placeholder));\n playbackInfoArtistBottom.setText(track.getArtist().toString());\n playbackInfoTitleBottom.setText(track.getTitle());\n playbackInfoBottom.setClickable(true);\n }\n } else\n return;\n }", "private void init() {\n if (mHeadline != null) {\n mHeadlingString = StringEscapeUtils.unescapeHtml4(mHeadline.getMain());\n }\n\n for (ArticleMultimedia multimedia : mMultimedia) {\n if (multimedia.getSubtype().equals(\"thumbnail\")) {\n mThumbnail = getMultimediaUrl(multimedia);\n }\n }\n }", "private void setupPlayerUI() {\r\n // for now hide the player\r\n setPlayerVisible(false);\r\n\r\n // disable unnecesary buttons\r\n setButtonEnabled(mButtonPlayerSeekBackward, false);\r\n setButtonEnabled(mButtonPlayerSeekForward, false);\r\n setButtonEnabled(mButtonPlayerSkipBackward, false);\r\n\r\n setButtonEnabled(mButtonPlayerRepeat, false);\r\n }", "public PlayListDialog( Frame owner ) {\n\t\tsuper(owner);\n\t\tinitialize();\n\t}", "@Override\n public void onBindViewHolder(final MyViewHolder holder, final int position) {\n\n final Playlist playlist = mPlayListData.get(position);\n\n // holder.title.setText(playlist.getTitle());\n // loading album cover using Glide library\n\n\n if (pos == 0) {\n holder.thumbnail.setImageDrawable(ContextCompat.getDrawable(mContext,R.drawable.im_ano_2017));\n pos++;\n } else if (pos == 1) {\n holder.thumbnail.setImageDrawable(ContextCompat.getDrawable(mContext,R.drawable.im_ano_2016));\n\n pos++;\n } else if (pos == 2) {\n holder.thumbnail.setImageDrawable(ContextCompat.getDrawable(mContext,R.drawable.im_ano_2015));\n\n pos++;\n }\n\n\n }", "@Override\n\tpublic void setupUI() {\n\n\t\tprogressDialog = new ProgressDialog(this);\n\t\trecyclerView = findViewById(R.id.recycler_view);\n\n\t\tmovieList = new ArrayList<>();\n\t\tmoviesAdapter = new MoviesAdapter(movieList);\n\n\t\trecyclerView.setLayoutManager(new GridLayoutManager(this, 2));\n\t\trecyclerView.setAdapter(moviesAdapter);\n\n\t}", "private void setupGUI(){\r\n\t\t\r\n\t\tfinal GUIFactory guifactory = GUIFactory.instance();\r\n\t\tfinal MTApplication app = (MTApplication)item.getView().getRenderer();\r\n\t\tfinal float leftiness = app.getWidth()*5/6;\r\n\t\tfinal float xPos = leftiness + 5;\r\n\t\t\r\n\t\t\r\n\t\toverlay = new MTOverlayContainer( app);\r\n\t\titem.getView().getRoot().addChild( overlay);\r\n\t\t\r\n\t\t// _THE_ PANEL \r\n\t\t\r\n\t\tpnlPanel = guifactory.createPanel( leftiness, 0, app.getWidth()-leftiness, app.getHeight(),\"pnlPanel\", overlay);\t\t\t\r\n\t\t\r\n\t\t// INTERACTION PANEL\r\n\t\t\r\n\t\tpnlInteraction = guifactory.createPanel(\r\n\t\t\t\tpnlPanel.getPosition( TransformSpace.GLOBAL),\r\n\t\t\t\tpnlPanel.getWidthXY( TransformSpace.GLOBAL),\r\n\t\t\t\tpnlPanel.getHeightXY( TransformSpace.GLOBAL),\r\n\t\t\t\t\"pnlInteraction\",\r\n\t\t\t\tpnlPanel);\r\n\t\tpnlInteraction.setNoFill( true);\r\n\t\t\r\n\t\t// EDIT PANEL\r\n\t\t\r\n\t\tpnlEdit = guifactory.createPanel(\r\n\t\t\t\tpnlPanel.getPosition( TransformSpace.GLOBAL),\r\n\t\t\t\tpnlPanel.getWidthXY( TransformSpace.GLOBAL),\r\n\t\t\t\tpnlPanel.getHeightXY( TransformSpace.GLOBAL),\r\n\t\t\t\t\"pnlEdit\",\r\n\t\t\t\tpnlPanel);\r\n\t\tpnlEdit.setVisible( false);\r\n\t\tpnlEdit.setNoFill( true);\r\n\t\t\r\n\t\t\r\n\t\t// ITEM NAME TEXTAREA\r\n\t\t\r\n\t\tString itemName = item.getName();\r\n\t\tif(itemName == null || itemName.equals( \"\"))\r\n\t\t\titemName = item.getID();\r\n\t\ttxtItemName = guifactory.createTextArea(itemName, \"txtItemName\", pnlPanel);\r\n\t\ttxtItemName.setPositionGlobal(\r\n\t\t\t\tnew Vector3D(\r\n\t\t\t\t\t\txPos,\r\n\t\t\t\t\t\tpnlPanel.getPosition( TransformSpace.GLOBAL).getY() + 10\t\r\n\t\t\t\t));\r\n\r\n\r\n\t\t// PANEL PICTURE\r\n\r\n\t\tVector3D pnlInteractionPos = pnlInteraction.getPosition( TransformSpace.GLOBAL);\r\n\t\tpnlPicture = guifactory.createPanel( pnlInteractionPos.getX()+50, pnlInteractionPos.getY()+50, 100, 100, \"pnlPicture\", pnlInteraction);\r\n\t\tpnlPicture.setAnchor( PositionAnchor.CENTER);\r\n\t\tpnlPicture.setPositionGlobal(\r\n\t\t\t\tnew Vector3D(\r\n\t\t\t\t\t\tpnlInteractionPos.getX() + pnlInteraction.getWidthXY( TransformSpace.GLOBAL)/2,\r\n\t\t\t\t\t\tpnlInteractionPos.getY() + 50 + pnlPicture.getHeightXY( TransformSpace.GLOBAL)/2\r\n\t\t\t\t));\r\n\t\tpnlPicture.setTexture( GUITextures.instance().getByDevice( DeviceType.getDeviceType( device)));\r\n\t\t\r\n\t\t\r\n\t\t// POWER USAGE TEXTAREA\r\n\t\t\r\n\t\tString powerUsage = \"n/a\";\r\n\t\tif( device.getPowerUsage() != null && device.getPowerUsage().getValue() != null){\r\n\t\t\tpowerUsage = device.getPowerUsage().getValue().toString();\r\n\t\t}\r\n\t\t\r\n\t\ttxtPowerUsage = guifactory.createTextArea( \"Power usage: \" + powerUsage + \" Watts\", \"txtPowerUsage\", pnlInteraction);\r\n\t\ttxtPowerUsage.setPositionGlobal(\r\n\t\t\t\tnew Vector3D(\r\n\t\t\t\t\t\txPos,\r\n\t\t\t\t\t\tpnlInteractionPos.getY() + 140\t\t\r\n\t\t\t\t\t\t));\r\n\t\ttxtPowerUsage.setVisible( false);\r\n\t\t\r\n\t\t\r\n\t\t// ON/OFF BUTTON\r\n\t\t\r\n\t\tbtnOnOff = guifactory.createButton( \"Turn device On/Off\", \"btnOnOff\", pnlInteraction);\r\n\t\tbtnOnOff.setPosition( txtPowerUsage.getPosition( TransformSpace.GLOBAL));\r\n\t\tbtnOnOff.addGestureListener( TapProcessor.class, new BtnOnOffListener());\r\n\t\t\r\n\t\t\r\n\t\t// SUBDEVICE BUTTON PANEL\r\n\t\t\r\n\t\tpnlSubDeviceButtons = guifactory.createPanel(\r\n\t\t\t\tpnlPanel.getPosition( TransformSpace.GLOBAL).getX(),\r\n\t\t\t\tbtnOnOff.getVectorNextToComponent( 10, false).getY(),\r\n\t\t\t\tpnlPanel.getWidthXY( TransformSpace.GLOBAL),\r\n\t\t\t\tdevice.getSubDevice().size() * (btnOnOff.getHeight()+10),\r\n\t\t\t\t\"pnlSubDeviceButtons\",\r\n\t\t\t\tpnlInteraction);\r\n\t\t\r\n\t\t// SUB DEVICE BUTTONS\r\n\t\t\r\n\t\tsubDeviceButtons = new LinkedList<MTButton>();\r\n\t\tfor( int i = 0; i < device.getSubDevice().size(); i++){\r\n\t\t\t\r\n\t\t\tPhysicalDevice subDevice = device.getSubDevice().get( i);\r\n\t\t\t\r\n\t\t\t// get button's caption\r\n\t\t\tString caption = subDevice.getName();\r\n\t\t\tif(caption == null || caption.equals( \"\"))\r\n\t\t\t\tcaption = subDevice.getId();\r\n\t\t\t\r\n\t\t\tMTButton btnSubDevice = guifactory.createButton( caption, \"btnSubDevice_\" + subDevice.getId(), pnlSubDeviceButtons);\r\n\t\t\tbtnSubDevice.setPosition(\r\n\t\t\t\t\tnew Vector3D(\r\n\t\t\t\t\t\txPos,\t\r\n\t\t\t\t\t\tpnlSubDeviceButtons.getPosition( TransformSpace.GLOBAL).getY() + i*(btnSubDevice.getHeight() + 10)\r\n\t\t\t\t\t));\r\n\t\t\t\r\n\t\t\tsubDeviceButtons.add( btnSubDevice);\r\n\t\t\tbtnSubDevice.addGestureListener( TapProcessor.class, new BtnSubDeviceListener( subDevice));\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t// EDIT BUTTON\r\n\t\t\r\n\t\tbtnEdit = guifactory.createButton( \"Edit\", \"btnEdit\", pnlInteraction);\r\n\t\tbtnEdit.setPosition( new Vector3D( xPos, app.getHeight() - 2*btnEdit.getHeight() - 30));\r\n\t\tbtnEdit.addGestureListener( TapProcessor.class, new BtnEditListener());\r\n\t\t\r\n\t\t\r\n\t\t// BUTTON HIDE\r\n\t\t\r\n\t\tbtnHide = guifactory.createButton( \"Hide menu\", \"btnHide\", pnlPanel);\r\n\t\tbtnHide.setPosition( new Vector3D( xPos, app.getHeight() - btnHide.getHeight() - 20));\r\n\t\tbtnHide.addGestureListener( TapProcessor.class, new BtnHideListener());\r\n\t\t\r\n\t\t\r\n\t\t///// EDIT-ELEMENTS /////\r\n\r\n\t\tchkMovePlanar = guifactory.createCheckButton( \"Move planar\", \"chkMovePlanar\", pnlEdit);\r\n\t\tchkMovePlanar.setPosition(\r\n\t\t\t\tnew Vector3D(\r\n\t\t\t\t\t\txPos,\r\n\t\t\t\t\t\ttxtItemName.getPosition( TransformSpace.GLOBAL).getY() + txtItemName.getHeightXY( TransformSpace.GLOBAL)+ 20\t\r\n\t\t\t\t));\r\n\t\tchkMovePlanar.addGestureListener( TapProcessor.class, new ChkMovePlanarListener());\r\n\r\n\t\t\r\n\t\tchkMoveY = guifactory.createCheckButton( \"Move up/down\", \"chkMoveY\", pnlEdit);\r\n\t\tchkMoveY.setPosition( chkMovePlanar.getVectorNextToComponent( 10, false));\r\n\t\tchkMoveY.addGestureListener( TapProcessor.class, new ChkMoveYListener());\r\n\r\n\t\t\r\n\t\tchkRotate = guifactory.createCheckButton( \"Rotate\", \"chkRotate\", pnlEdit);\r\n\t\tchkRotate.setPosition( chkMoveY.getVectorNextToComponent( 10, false));\r\n\t\tchkRotate.addGestureListener( TapProcessor.class, new ChkRotateListener());\r\n\r\n\t\t\r\n\t\tchkScale = guifactory.createCheckButton( \"Scale\", \"chkScale\", pnlEdit);\r\n\t\tchkScale.setPosition( chkRotate.getVectorNextToComponent( 10, false));\r\n\t\tchkScale.addGestureListener( TapProcessor.class, new ChkScaleListener());\r\n\r\n\t\t\r\n\t\tbtnChangeVisualisation = guifactory.createButton( \"Change Style\", \"btnChangeVisualisation\", pnlEdit);\r\n\t\tbtnChangeVisualisation.setPosition( chkScale.getVectorNextToComponent( 10, false));\r\n\t\tbtnChangeVisualisation.addGestureListener( TapProcessor.class, new BtnChangeVisualisationListener());\r\n\t\t\r\n\t\t\r\n\t\tbtnSave = guifactory.createButton( \"Save\", \"btnSave\", pnlEdit);\r\n\t\tbtnSave.setPosition( btnEdit.getPosition());\r\n\t\tbtnSave.addGestureListener( TapProcessor.class, new BtnSaveListener());\r\n\t}", "private void setComponents(String title,String category, String description, int image){\n // Settings values\n //txttitle.setText(title);\n txtdescription.setText(description);\n txtcategory.setText(category);\n //img.setImageResource(image);\n collapsingToolbarLayout.setBackgroundResource(image);\n collapsingToolbarLayout.setTitle(title);\n }", "public void setTitulo(String titulo){\n item_titulo.setText(titulo);\n }", "public void updateUI(MusicData data) {\n\n if (data != null) {\n if (data instanceof Album) {\n Album albumData = (Album) data;\n if (albumData.getCoverAlbumBitmap() != null) {\n imageView.setImageBitmap(albumData.getCoverAlbumBitmap());\n } else {\n String uri = albumData.getCoverAlbum();\n int resources = imageView.getResources().getIdentifier(uri, null, imageView.getContext().getPackageName());\n imageView.setImageResource(resources);\n }\n topText.setText(albumData.getName());\n bottomText.setText(albumData.getArtist().getName());\n } else if (data instanceof Song) {\n Song songData = (Song) data;\n if (songData.getAlbum().getCoverAlbumBitmap() != null) {\n imageView.setImageBitmap(songData.getAlbum().getCoverAlbumBitmap());\n } else {\n String uri = songData.getAlbum().getCoverAlbum();\n int resources = imageView.getResources().getIdentifier(uri, null, imageView.getContext().getPackageName());\n imageView.setImageResource(resources);\n }\n topText.setText(songData.getTitle());\n bottomText.setText(\"\");\n } else if (data instanceof Artist) {\n Artist artistData = (Artist) data;\n String uri = artistData.getPicture();\n int resources = imageView.getResources().getIdentifier(uri, null, imageView.getContext().getPackageName());\n imageView.setImageResource(resources);\n topText.setText(artistData.getName());\n bottomText.setText(\"\");\n } else if (data instanceof Genre) {\n Genre genreData = (Genre) data;\n// String uri = artistData.getPicture();\n// int resources = imageView.getResources().getIdentifier(uri, null, imageView.getContext().getPackageName());\n// imageView.setImageResource(resources);\n topText.setText(genreData.getName());\n bottomText.setText(\"\");\n }\n }\n }", "@Override\n\tprotected void runPlaylistUpdate() {\n\t\treturn;\n\t}", "public void setAlbumTitle(java.lang.String value) {\r\n\t\tBase.set(this.model, this.getResource(), ALBUMTITLE, value);\r\n\t}", "@Override\n\tpublic void initialize(URL arg0, ResourceBundle arg1) {\n\t\t\n\t\tcurrentAlbumTitle.setText(AccessibleUsersList.masterUserList.userLoggedIn + \"/ \" + AccessibleUsersList.masterUserList.userLoggedIn.selectedAlbum);\n\t\t\n\t\tdisplayedPhoto = FXCollections.observableArrayList();\n\t\t/*\n\t\tif(AccessibleUsersList.masterUserList.userLoggedIn.getUsername().equals(\"stock\")) {\n\t\t\tbackButton.setVisible(false);\n\t\t}\n\t\t*/\n\t\t\n\t\t/*\n\t\tFile file = new File(\"stockphotos/Bahamas.jpg\");\n Image image = new Image(file.toURI().toString());\n //DisplayedImage.setImage(image);\n ImageView pic = new ImageView();\n\t\tpic.setFitWidth(400);\n\t\tpic.setFitHeight(330);\n\t\tpic.setImage(image);\n\t\tdisplayedPhoto.add(pic);\n DisplayedImage.setItems(displayedPhoto);\n\t\t*/\n\t\t\n Album currAlbum = AccessibleUsersList.masterUserList.userLoggedIn.selectedAlbum;\n //System.out.println(\"Accessing Album: \" + currAlbum.getName());\n ArrayList<Photo> phots = currAlbum.getAlbum();\n //System.out.println(phots);\n //listOfPhotos = FXCollections.observableList(phots);\n //photoDisplay.setItems(listOfPhotos);\n printPhotos();\n \n //load the OTHER Albums\n ArrayList<Album> oAlbums = AccessibleUsersList.masterUserList.userLoggedIn.getOtherAlbums();\n otherAlbums = FXCollections.observableList(oAlbums);\n OtherAlbumsDisplay.setItems(otherAlbums);\n \n tagNameLabel.setVisible(false);\n \ttagValueLabel.setVisible(false);\n \tsubmitNewTagButton.setVisible(false);\n \tcancelNewTagButton.setVisible(false);\n \tnewTagName.setVisible(false);\n \tnewTagValue.setVisible(false);\n \tFriendsListButton.setDisable(false);\n \t\n \tif(AccessibleUsersList.masterUserList.userLoggedIn.getUsername().equals(\"stock\")) {\n \t\tFriendsListButton.setDisable(true);\n \t}\n \n\t\t//DisplayedImage.setImage(image1);\n\t\t\n\t}", "public void setImages() {\n\n imgBlock.removeAll();\n imgBlock.revalidate();\n imgBlock.repaint();\n labels = new JLabel[imgs.length];\n for (int i = 0; i < imgs.length; i++) {\n\n labels[i] = new JLabel(new ImageIcon(Toolkit.getDefaultToolkit().createImage(imgs[i].getSource())));\n imgBlock.add(labels[i]);\n\n }\n\n SwingUtilities.updateComponentTreeUI(jf); // refresh\n initialized = true;\n\n }", "private void createYourListsTitle() {\n\t\tjlYourLists = new JLabel(\"PLAYLISTS\");\t\t\n\t\tjlYourLists.setFont(new java.awt.Font(\"Century Gothic\",0, 17));\n\t\tjlYourLists.setForeground(new Color(250,250,250));\n\t}", "public void setImage(Image itemImg) \n {\n img = itemImg;\n }", "public void addRadioSong(String songTitle, String songArtist) {\n for (SharedSongPanel radioSong : radioSongs) {\n if (radioSong.getTitle().equals(songTitle))//if song exists.\n return;//exiting method\n }\n try {\n BufferedImage defaultImage = ImageIO.read(new File(\"RadioSongs/defaultImage.png\"));\n SharedSongPanel newRadioSong = new SharedSongPanel(defaultImage, songTitle, songArtist, radioSongs, null);\n radioSongs.add(newRadioSong);\n } catch (IOException e) {\n JOptionPane.showMessageDialog(null, \"Error reading radio default image\", \"An Error Occurred\", JOptionPane.ERROR_MESSAGE);\n }\n }", "public static void initOutlets(JPanel jPListContainer, JLabel jLInformationSong, JButton jBPlayButton, JToggleButton orderByAlbum, JToggleButton orderByArtist,\n JToggleButton orderByYear, JFileChooser jFileChooser1, MyOwnJFrame actualWindow, JFileChooser jfcOneFile, JToggleButton jtbRepeatSongs)\n {\n JSoundsMainWindowViewController.jPListContainer = jPListContainer;\n JSoundsMainWindowViewController.jLInformationSong = jLInformationSong;\n JSoundsMainWindowViewController.jBPlayButton = jBPlayButton;\n JSoundsMainWindowViewController.orderByAlbum = orderByAlbum;\n JSoundsMainWindowViewController.orderByArtist = orderByArtist;\n JSoundsMainWindowViewController.orderByYear = orderByYear;\n JSoundsMainWindowViewController.jFileChooser1 = jFileChooser1; \n JSoundsMainWindowViewController.jlActualListSongs = null;\n JSoundsMainWindowViewController.iAmPlaying = true;\n JSoundsMainWindowViewController.iAmPausing = false;\n JSoundsMainWindowViewController.iAmResuming = false; \n JSoundsMainWindowViewController.actualWindow = actualWindow;\n JSoundsMainWindowViewController.jtbRepeatSongs = jtbRepeatSongs;\n JSoundsMainWindowViewController.jtbRepeatSongs.setSelected(false); \n JSoundsMainWindowViewController.jfcOneFile = jfcOneFile; \n }", "public PlayList() {\n\t\tthis.name = \"Untitled\";\n\t\tsongList = new ArrayList<Song>();\n\t}", "public void setImage (Product product) {\n\t\t//TODO beh�ver hj�lp. hur s�tter jag mha referens till objektet bilden?\n\t\tpictureLbl.setText(\"\");\n\t\t//picLbl.setIcon(product.getImageName());\n\t\tpictureLbl.repaint();\n\t}", "private void processImages(List<String> images) {\n setTitle(\"Showing images\");\n mImages = images;\n setListAdapter(new ImagesAdapter());\n }", "private void setupImageViews(int currentPosition) {\n DataModel prevModel = musicList.get(currentPosition > 0 ? currentPosition - 1 : musicList.size() - 1);\n tv_previous_music.setText(prevModel.getTitle() + \"\\n\" + prevModel.getArtist_actors());\n String prevUrl = getString(R.string.imageUrl) + \"/img/\" + prevModel.getImage();\n Log.e(\"url\", prevUrl);\n Picasso.with(getApplicationContext()).load(prevUrl).fit()\n .error(R.drawable.image_placeholder)\n .placeholder(R.drawable.image_placeholder)\n .into(previous_pic_imv);\n\n\n DataModel nextModel = musicList.get(currentPosition < musicList.size() - 1 ? currentPosition + 1 : 0);\n tv_next_music.setText(nextModel.getTitle() + \"\\n\" + prevModel.getArtist_actors());\n String nextUrl = getString(R.string.imageUrl) + \"/img/\" + nextModel.getImage();\n Log.e(\"url\", nextUrl);\n Picasso.with(getApplicationContext()).load(nextUrl).fit()\n .error(R.drawable.image_placeholder)\n .placeholder(R.drawable.image_placeholder)\n .into(next_pic_imv);\n\n\n }", "@Override\n public void displayImage(String url, String mimeType, String title, String description,\n String iconSrc, final LaunchListener listener) {\n setMediaSource(new MediaInfo.Builder(url, mimeType)\n .setTitle(title)\n .setDescription(description)\n .setIcon(iconSrc)\n .build(), listener);\n }", "public void setPlaylists(ArrayList<Playlist> p)\n\t{\n\t\tplaylists = p;\n\t}", "public void showMediaList(){\r\n mediaView.showMediaList(getMediaList());\r\n }", "private void createYourMusicTitle() {\n\t\tjpYourMusic = new JPanel(new GridLayout(1,1));\n\t\tjpYourMusic.setOpaque(false);\n\t\tJLabel jlYourMusic = new JLabel(\"YOUR MUSIC\");\t\t\n\t\tjlYourMusic.setFont(new java.awt.Font(\"Century Gothic\",0, 17));\n\t\tjlYourMusic.setForeground(new Color(250,250,250));\n\t\tjpYourMusic.add(jlYourMusic);\n\t}", "void scrollSetUp() {\r\n\t\tJList<Image> imageFile = new JList<>();\r\n\t\tmodel = new DefaultListModel<>();\r\n\t\timageFile.setModel(model);\r\n\t\timageFile.addListSelectionListener(new ListSelectionListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void valueChanged(ListSelectionEvent e) {\r\n\t\t\t\tselectedImage = imageFile.getSelectedValue();\r\n\t\t\t\t/*\r\n\t\t\t\t * Generic image info for testing String name = \"File Name: \" +\r\n\t\t\t\t * selectedImage.name + \"\\n\"; String size = \"File Size: \" + selectedImage.size +\r\n\t\t\t\t * \"\\n\"; more/accurate info will go here later\r\n\t\t\t\t */\r\n\r\n\t\t\t\tString infstr = \"Path: \" + selectedImage.getPath();\r\n\t\t\t\tinfoText.setText(infstr);\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\tJScrollPane pane = new JScrollPane(imageFile, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,\r\n\t\t\t\tJScrollPane.HORIZONTAL_SCROLLBAR_NEVER);\r\n\t\tpane.getHorizontalScrollBar().setPreferredSize(new Dimension(0, 13));\r\n\t\tpane.getVerticalScrollBar().setPreferredSize(new Dimension(13, 0));\r\n\t\tmainFrame.add(pane);\r\n\t\talbumList = imageFile;\r\n\t}", "public void updateTrackDetails() {\n if (mTracks != null && !mTracks.isEmpty()) {\n Track track = mTracks.get(mPlayingIndex);\n if (track != null) {\n mArtistName.setText(track.getArtistName());\n mAlbumName.setText(track.getAlbumName());\n Picasso.with(getActivity()).load(track.getThumbnailImageUrl())\n .into(mAlbumArtWork);\n mTrackName.setText(track.getTrackName());\n mTrackDuration.setText(Utilities.getFormatedTime(30000));\n mNowPlaying = \"#NowPlaying \" + track.getTrackUrl();\n if (mShareActionProvider != null) {\n mShareActionProvider.setShareIntent(createShareNowPlayingIntent());\n }\n }\n }\n }", "void setImage(String image);", "public void configureGallery(T aView)\n {\n aView.setFont(Font.Arial10); aView.setBorder(new Border.BevelBorder(0));\n Label label0 = new Label(\"Split\"); label0.setPadding(10,20,10,20); label0.setTextFill(Color.GRAY);\n Label label1 = new Label(\"View\"); label1.setPadding(10,20,10,20); label1.setTextFill(Color.GRAY);\n aView.setItems(label0,label1);\n }", "public ItemPresentation(Article art, Vector thumbs)\n throws Exception\n {\n this.article = art;\n this.thumbnails = thumbs;\n\n setChannelId(article);\n }", "public void onLoadMenuMyPlaylistSelected();", "public howToPlayButton()\r\n {\r\n GreenfootImage howToGuide = new GreenfootImage(\"how to play.png\");\r\n setImage(howToGuide);\r\n }", "@Override\n protected void initView() {\n view.setVideoThumbnail(model.getThumbnail());\n\n if (isInFocus) {\n playOrPauseVideoIfMomentIsInFocus();\n }\n\n view.setMomentTitle(model.getTitle());\n view.setCounterTimeText(\"\" + Math.round((model.getEndTimeMs() - model.getStartTimeMs())/ TimeUtil.MS_IN_SECOND));\n\n view.setState(isInFocus);\n }", "public void showAlbumSongs(String albumTitle) {\n playlistIsRunning = false;\n showSongs(albumPanels.get(albumTitle).getSongPanels());\n }", "protected void SetTitle(String newTitle){ title = newTitle; }", "public GUIPROJECT3(){\n setLayout(new FlowLayout());\n image1=new ImageIcon(getClass().getResource(\"uche pics 009.JPG\"));\n \n Label1= new JLabel(image1);\n add(Label1);\n \n image2= new ImageIcon(getClass().getResource(\"uche pics 315.JPG\"));\n \n Label2= new JLabel(image2);\n add(Label2);\n}", "public void setDescription(String text)\n\t{\n\t\tthis.description = text;\n\t\tthis.repaint();\n\t}", "public void initSlideshow(Album a){\n\t\talbum=a;\n\t\tlistOfPhotos = album.getPhotos();\n\t\tPhoto photo = listOfPhotos.get(photoNumber);\n\t\tImage photoImage = new Image(photo.getLocation(),610,450,false,false);\n\t\tphotoImageView.setImage(photoImage);\n\t\tImage img = new Image(\"file:resources/info.png\",35,34,false,false);\n infoHoverButton.setGraphic(new ImageView(img));\n Tooltip tt = new Tooltip();\n tt.setText(photo.printAttributes());\n tt.setStyle(\"-fx-font: normal bold 20 Langdon; \"\n + \"-fx-base: #AE3522; \"\n + \"-fx-text-fill: orange;\");\n infoHoverButton.setTooltip(tt);\n\t}", "public void updateViews(String title, String artist, int albumCover, String album) {\n titleTextView.setText(title);\n artistTextView.setText(artist);\n albumCoverImg.setImageResource(albumCover);\n albumTextView.setText(album);\n }", "private void setViewsForCurrentSong() {\n int albumCoverResourceID = thisSong.getAlbumCover(this, \"full\");\n now_playing_album_cover.setImageResource(albumCoverResourceID);\n now_playing_song_title.setText(thisSong.getSongTitle());\n now_playing_artist_name.setText(thisSong.getArtistName());\n now_playing_album_title.setText(thisSong.getAlbumTitle());\n\n // Update the current time elapsed\n // It doesn't matter if this is called with bad data on Activity startup because it will be immediately fixed by timer_countUp\n // However we do need this for when the song is paused and then the screen is rotated\n if (!playing) {\n long milliseconds_elapsed = System.currentTimeMillis() - (timer_startTime + pauseTimer_pauseTime());\n int seconds_elapsed = (int) (milliseconds_elapsed / MILLISECONDS_IN_SECOND);\n int minutes_elapsed = seconds_elapsed / SECONDS_IN_MINUTE;\n\n now_playing_song_current_length.setText(String\n .format(Locale.getDefault(), TIME_FORMAT_STRING, minutes_elapsed % MINUTES_IN_HOUR, seconds_elapsed % SECONDS_IN_MINUTE));\n }\n\n // Update the total song length\n long thisSongDurationSeconds = thisSong.getLengthMilliseconds() / MILLISECONDS_IN_SECOND;\n long minutes = thisSongDurationSeconds / MINUTES_IN_HOUR;\n now_playing_song_total_length.setText(String\n .format(Locale.getDefault(), TIME_FORMAT_STRING, minutes % MINUTES_IN_HOUR, thisSongDurationSeconds % SECONDS_IN_MINUTE));\n }", "public void setDisplay(String title, String html, String url) {\n\t\t\n\t\tthis.title = title;\n\t\tthis.html = html;\n\t\tthis.url = url;\n\t\t\n\t}", "public static void playListSongs(boolean iSelectASong)\n {\n Album actualAlbum = AlbumXmlFile.getAlbumFromDataBase(JSoundsMainWindowViewController.jlActualListSongs.getAlbumName(), true);\n\n \n if ((selectedAlbum!=null) && (!actualAlbum.getName().equals(selectedAlbum.getName())))\n {\n JSoundsMainWindowViewController.listSongs=null;\n JSoundsMainWindowViewController.listSongs=new JMusicPlayerList();\n alreadyPlaying=false;\n if((!isPlaylist) && (!shutDown))\n dontInitPlayer=true;\n }\n \n if (JSoundsMainWindowViewController.iAmPlaying && JSoundsMainWindowViewController.jlActualListSongs != null)\n { \n if (alreadyPlaying==false)\n {\n ViewUtilFunctions.changeIconFromButton(JSoundsMainWindowViewController.jBPlayButton, \"src/view/images/IBPause.png\");\n JSoundsMainWindowViewController.iAmPlaying = false;\n JSoundsMainWindowViewController.iAmPausing = true;\n JSoundsMainWindowViewController.iAmResuming = false;\n \n selectedAlbum=actualAlbum;\n \n Song actualSong = null;\n int position;\n if (!isPlaylist) //Si no estoy tratando de reproducir una lista de reproduccion.\n { \n \n \n if (actualAlbum != null)\n {\n Iterator songsIterator = actualAlbum.getSongs().iterator();\n \n position = 0;\n \n while (songsIterator.hasNext())\n {\n actualSong = (Song) songsIterator.next();\n \n if (actualSong != null)\n {\n listSongs.addSongToPlayerList(new JMusicSong(position, UtilFunctions.removeStrangeCharacters(actualSong.getName()), UtilFunctions.removeStrangeCharacters(actualSong.getName()), actualSong.getName(), UtilFunctions.removeStrangeCharacters(actualSong.getArtist().getName()), actualSong.getArtist().getName(), UtilFunctions.removeStrangeCharacters(actualAlbum.getName()), actualAlbum.getName()));\n position++;\n }\n }\n }\n }\n else //Si es una lista de reproduccion\n {\n Album actualAlbumPlaylist = PlaylistXmlFile.getPlaylistAlbumFromDataBase(JSoundsMainWindowViewController.jlActualListSongs.getAlbumName(), true);\n \n \n if (actualAlbumPlaylist != null)\n {\n Iterator songsIterator = actualAlbumPlaylist.getSongs().iterator();\n \n position = 0;\n \n while (songsIterator.hasNext())\n {\n \n actualSong = (Song) songsIterator.next();\n \n if (actualSong != null)\n {\n listSongs.addSongToPlayerList(new JMusicSong(position, UtilFunctions.removeStrangeCharacters(actualSong.getName()), UtilFunctions.removeStrangeCharacters(actualSong.getName()), actualSong.getName(), UtilFunctions.removeStrangeCharacters(actualSong.getArtist().getName()), actualSong.getArtist().getName(), UtilFunctions.removeStrangeCharacters(actualAlbumPlaylist.getName()), actualAlbumPlaylist.getName()));\n position++;\n }\n }\n }\n } \n if (!dontInitPlayer) // Inicio el reproductor\n {\n MusicPlayerControl.initMusicPlayer(Util.JSOUNDS_LIBRARY_PATH, JSoundsMainWindowViewController.jlActualListSongs, JSoundsMainWindowViewController.jLInformationSong, JSoundsMainWindowViewController.jlActualListSongs.getjLLastPlayedSongList(), table, JSoundsMainWindowViewController.LIST_SONG_COLUMN, JSoundsMainWindowViewController.jlActualListSongs.getRowInJTable(), JSoundsMainWindowViewController.LAST_PLAYED_SONG_COLUMN);\n MusicPlayerControl.loadSongs(listSongs);\n shutDown=false;\n }\n else // El reproductor ya esta iniciado\n {\n MusicPlayerControl.loadSongs(listSongs);\n dontInitPlayer=false;\n }\n \n if (iSelectASong)\n {\n if (indexFromSearchedSong>(-1))\n {\n MusicPlayerControl.changeSongFromIndexSong(indexFromSearchedSong);\n iSelectASong=false;\n indexFromSearchedSong=-1;\n }\n else\n {\n MusicPlayerControl.changeSongFromIndexSong(JSoundsMainWindowViewController.jlActualListSongs.getSelectedIndex());\n iSelectASong = false;\n }\n \n }\n EditSongWindow.songName =listSongs.getSongAtIndex(JSoundsMainWindowViewController.jlActualListSongs.getSelectedIndex()).getSongName();\n EditSongWindow.index = JSoundsMainWindowViewController.jlActualListSongs.getSelectedIndex();\n EditSongWindow.list = listSongs;\n JSoundsMainWindowViewController.fillEditWindow(JSoundsMainWindowViewController.jlActualListSongs.getSelectedIndex());\n MusicPlayerControl.playSong();\n alreadyPlaying = true;\n }\n if ((alreadyPlaying==true) && (iSelectASong==true) && (fixedIndex== true))\n {\n ViewUtilFunctions.changeIconFromButton(JSoundsMainWindowViewController.jBPlayButton, \"src/view/images/IBPause.png\");\n JSoundsMainWindowViewController.iAmPlaying = false;\n JSoundsMainWindowViewController.iAmPausing = true;\n JSoundsMainWindowViewController.iAmResuming = false;\n MusicPlayerControl.changeSongFromIndexSong(JSoundsMainWindowViewController.jlActualListSongs.getSelectedIndex()-1);\n \n JSoundsMainWindowViewController.fillEditWindow(JSoundsMainWindowViewController.jlActualListSongs.getSelectedIndex()-1);\n \n MusicPlayerControl.playSong();\n }\n if ((alreadyPlaying==true) && (iSelectASong==true) && (iAmPausing==true) && (!fixedIndex))\n {\n MusicPlayerControl.changeSongFromIndexSong(JSoundsMainWindowViewController.jlActualListSongs.getSelectedIndex());\n \n JSoundsMainWindowViewController.fillEditWindow(JSoundsMainWindowViewController.jlActualListSongs.getSelectedIndex());\n \n MusicPlayerControl.playSong();\n }\n if ((alreadyPlaying==true) && (iSelectASong==true) && (iAmPlaying==true) && (!fixedIndex))\n {\n ViewUtilFunctions.changeIconFromButton(JSoundsMainWindowViewController.jBPlayButton, \"src/view/images/IBPause.png\");\n JSoundsMainWindowViewController.iAmPlaying = false;\n JSoundsMainWindowViewController.iAmPausing = true;\n JSoundsMainWindowViewController.iAmResuming = false;\n MusicPlayerControl.changeSongFromIndexSong(JSoundsMainWindowViewController.jlActualListSongs.getSelectedIndex());\n \n JSoundsMainWindowViewController.fillEditWindow(JSoundsMainWindowViewController.jlActualListSongs.getSelectedIndex());\n \n MusicPlayerControl.playSong();\n }\n \n }\n else\n {\n if (JSoundsMainWindowViewController.iAmPausing && JSoundsMainWindowViewController.jlActualListSongs != null)\n {\n ViewUtilFunctions.changeIconFromButton(JSoundsMainWindowViewController.jBPlayButton, \"src/view/images/IBPlay.png\");\n JSoundsMainWindowViewController.iAmPlaying = false;\n JSoundsMainWindowViewController.iAmPausing = false;\n JSoundsMainWindowViewController.iAmResuming = true;\n \n MusicPlayerControl.pauseSong();\n }\n else\n {\n if (JSoundsMainWindowViewController.iAmResuming && JSoundsMainWindowViewController.jlActualListSongs != null)\n {\n ViewUtilFunctions.changeIconFromButton(JSoundsMainWindowViewController.jBPlayButton, \"src/view/images/IBPause.png\");\n \n JSoundsMainWindowViewController.iAmPlaying = false;\n JSoundsMainWindowViewController.iAmPausing = true;\n JSoundsMainWindowViewController.iAmResuming = false;\n \n MusicPlayerControl.resumeSong();\n }\n \n }\n }\n }", "private void setupGui(NbImageIcon nbIcon) {\n if (ignoreSetValue || (nbIcon == null && ignoreNull)) {\n return;\n }\n\n selectedFile = null;\n selectedURL = null;\n ignoreCombo = true;\n if (cbFile.getItemCount() > 0) {\n cbFile.setSelectedIndex(0);\n }\n ignoreCombo = false;\n\n if (nbIcon == null) {\n rbProjectImages.setSelected(true);\n previewLabel.setIcon(null);\n return;\n }\n\n switch (nbIcon.getType()) {\n case IconEditor.TYPE_FILE:\n FileObject iconFile = rootFolder.getFileObject(nbIcon.getName());\n setSelectedFolder(iconFile.getParent());\n setSelectedFile(iconFile);\n rbProjectImages.setSelected(true);\n enableUrlChoose(false);\n break;\n case IconEditor.TYPE_URL:\n setSelectedUrl(nbIcon.getName());\n rbExternalImages.setSelected(true);\n enableFileChoose(false);\n break;\n }\n previewLabel.setIcon(nbIcon);\n }", "private ImageView getAlbumArt () {\n ImageView iv = new ImageView((Image) this.playlist.getCurrentMedia().getMetadata().get(\"image\"));\n // Future implementations:\n // * store in cache for faster loading\n // * be sure to give an option to empty cache\n return iv;\n }", "void setImageFromURL(String imageURL);", "public void initPlayerStateUI() {\n if (!playableMediaItem.getBitrate().isEmpty()) {\n tvTrackInfo.setText(playableMediaItem.getBitrate() + getString(R.string.kbps));\n } else {\n tvTrackInfo.setText(\"\");\n }\n\n if (universalPlayer.isPrepaired) {\n ((IToolbarHolder) getActivity()).getToolbar().setTitle(R.string.now_paying);\n if (btnPlay.isPlay() && universalPlayer.isPlaying()) {\n btnPlay.toggle();\n } else if (!btnPlay.isPlay() && !universalPlayer.isPlaying()) {\n btnPlay.toggle();\n }\n\n } else {\n ((IToolbarHolder) getActivity()).getToolbar().setTitle(R.string.buffering);\n if (!btnPlay.isPlay()) {\n btnPlay.toggle();\n }\n }\n }", "public ItemPresentation(Article art, Vector thumbs, Vector regs)\n throws Exception\n {\n this.article = art;\n this.thumbnails = thumbs;\n this.regulars = regs;\n\n setChannelId(this.article);\n }", "private void setData() {\n\n if (id == NO_VALUE) return;\n MarketplaceItem item = ControllerItems.getInstance().getModel().getItemById(id);\n if (item == null) return;\n\n ControllerAnalytics.getInstance().logItemView(id, item.getTitle());\n\n if (item.getPhotos() != null\n && item.getPhotos().size() > 0 &&\n !TextUtils.isEmpty(item.getPhotos().get(0).getSrc_big(this)))\n Picasso.with(this).load(item.getPhotos().get(0).getSrc_big(this)).into((ImageView) findViewById(R.id.ivItem));\n else if (!TextUtils.isEmpty(item.getThumb_photo()))\n Picasso.with(this).load(item.getThumb_photo()).into((ImageView) findViewById(R.id.ivItem));\n\n adapter.updateData(item, findViewById(R.id.rootView));\n }", "private void setupView() {\n view.setName(advertisement.getTitle());\n view.setPrice(advertisement.getPrice());\n view.setDescription(advertisement.getDescription());\n view.setDate(advertisement.getDatePublished());\n view.setTags(advertisement.getTags());\n setCondition();\n if (advertisement.getImageUrl() != null) { //the url here is null right after upload\n view.setImageUrl(advertisement.getImageUrl());\n }\n }", "public void setTitle(String title) {\r\n\t\tthis.pictureFrame.setTitle(title);\r\n\t}", "public ShowList(String title) {\n id = title;\n initComponents();\n updateListModel();\n }", "public PlaylistViewHolder(View itemView) {\n super(itemView);\n\n this.imageView1 = itemView.findViewById(R.id.imageView1);\n this.imageView2 = itemView.findViewById(R.id.imageView2);\n this.imageView3 = itemView.findViewById(R.id.imageView3);\n this.imageView4 = itemView.findViewById(R.id.imageView4);\n this.imageView5 = itemView.findViewById(R.id.imageView5);\n this.imageView6 = itemView.findViewById(R.id.imageView6);\n\n this.imageViews = new ImageView[] {imageView1, imageView2, imageView3, imageView4, imageView5, imageView6};\n\n this.playlistTitleTextView = itemView.findViewById(R.id.playlistTitleTextView);\n this.playlistDescriptionTextView = itemView.findViewById(R.id.playlistDescriptionTextView);\n }", "public MediaLibraryGUI() {\r\n initializeFields();\r\n\r\n makeMenu();\r\n\r\n makeCenter();\r\n\r\n makeSouth();\r\n\r\n startGUI();\r\n }", "private void populateUI(Event event){\n mTitle.setText(event.getTitle()); //sets title to event title\n mDescription.setText(event.getDescription());\n }", "public static void editSong (JMusicPlayerList list, int index, String name, String artistName, String albumName, String number)\n {\n list.getSongAtIndex(index).setSongNameForDisplay(name);\n list.getSongAtIndex(index).setArtistForDisplay(artistName);\n list.getSongAtIndex(index).setAlbumForDisplay(albumName);\n list.getSongAtIndex(index).setNumberSong(UtilFunctions.stringToInteger(number));\n }", "private void setUpList() {\n\n\n Contents s1 = new Contents(R.drawable.bishist,\"Bishisht Bhatta\",\"+977-9849849525\", Color.parseColor(\"#074e87\"));\n list.add(s1);\n Contents s2 = new Contents(R.drawable.sagar,\"Sagar Pant\",\"+977-9865616888\",Color.parseColor(\"#074e87\"));\n list.add(s2);\n Contents s3 = new Contents(R.drawable.rabins,\"Rabin Nath\",\"+977-9848781007\",Color.parseColor(\"#074e87\"));\n list.add(s3);\n\n\n }", "@WorkerThread @UiThread\n public void setPictures(Iterable<Picture> pictures) {\n List<String> titles = new ArrayList<>();\n List<String> urls = new ArrayList<>();\n List<String> urlsLowRes = new ArrayList<>();\n\n for (Picture picture: pictures) {\n titles.add(picture.title);\n urls.add(picture.url);\n // NEW!! Model stores low res urls\n urlsLowRes.add(picture.lowResUrl);\n }\n\n String[] titlesAsArray = titles.toArray(new String[titles.size()]);\n String[] urlsAsArray = urls.toArray(new String[urls.size()]);\n String[] urlsLowResAsArray = urlsLowRes.toArray(new String[urlsLowRes.size()]);\n\n // Synchronize for the shortest possible time\n synchronized (this) {\n this.titles = titlesAsArray;\n this.urls = urlsAsArray;\n this.urlsLowRes = urlsLowResAsArray;\n this.bitmaps.clear();\n this.bitmapsLowRes.clear();\n }\n\n // Tell all registered views that the list of pictures has changed\n notifyViews(Event.PICTURES_LIST_CHANGED);\n }", "private void initUIComponents() {\n Glide.with(this)\n .load(mNeighbour.getAvatarUrl()\n .replace(\"/150?\", \"/450?\"))\n .centerCrop()\n .into(mAvatarImg);\n mTitleTxt.setText(mNeighbour.getName());\n mNameTxt.setText(mNeighbour.getName());\n mAddressTxt.setText(mNeighbour.getAddress());\n mPhoneNumberTxt.setText(mNeighbour.getPhoneNumber());\n mFacebookTxt.setText(\"www.facebook.fr/\"+mNeighbour.getName());\n mAboutMeTextTxt.setText(mNeighbour.getAboutMe());\n }", "public void setSavedSongs(Playlist p)\n\t{\n\t\tsavedSongs = p;\n\t}", "private void initView() {\n\t\t//buttonPlayPause = (ImageButton)getView().findViewById(R.id.ButtonTestPlayPause);\n\t\t//buttonPlayPause.setOnClickListener(this);\n\t\t\n\t\t//seekBarProgress = (SeekBar)getView().findViewById(R.id.SeekBarTestPlay);\t\n\t\t//seekBarProgress.setMax(99); // It means 100% .0-99\n\t\t//seekBarProgress.setOnTouchListener(this);\n\t\t//editTextSongURL = (EditText)findViewById(R.id.EditTextSongURL);\n\t\t//editTextSongURL.setText(R.string.testsong_20_sec);\n\t\t\n\t\t//mediaPlayer = new MediaPlayer();\n\t\t//mediaPlayer.setOnBufferingUpdateListener(this);\n\t\t//mediaPlayer.setOnCompletionListener(this);\n\t}", "public void setMusic(Music music);", "private void setMovie() {\n Movie movie = getIntent().getExtras().getParcelable(MOVIE);\n Glide.with(mMoviePoster).setDefaultRequestOptions(new RequestOptions().diskCacheStrategy(DiskCacheStrategy.ALL)).load(BuildConfig.IMG_DIR + movie.getPosterPath())\n .into(mMoviePoster);\n setTitle(movie.getTitle());\n mMovieTitle.setText(movie.getTitle());\n mMovieRating.setText(String.valueOf(movie.getVoteAverage()));\n mMovieDate.setText(movie.getReleaseDate());\n mMovieGenre.setText(movie.isAdult() ? getString(R.string.genre_type_adults) : getString(R.string.genre_type_all));\n mMovieDesc.setText(movie.getOverview());\n }", "public void setup() {\n \n populating_variables();\n frameRate(120);\n background(white);\n load_songs();\n instructions();\n music_player_setup();\n scrollable_list();\n}", "public void setItemImageUrl(CharSequence value) {\n this.item_image_url = value;\n }", "private void setVisualState() {\n\n // STATE: station loading\n if (isAdded() && mThisStation != null && mPlaybackState == PLAYBACK_STATE_LOADING_STATION) {\n // change playback button image to stop\n mPlaybackButton.setImageResource(R.drawable.smbl_stop);\n // change playback indicator and metadata views\n mPlaybackIndicator.setBackgroundResource(R.drawable.ic_playback_indicator_loading_24dp);\n mStationMetadataView.setText(R.string.descr_station_stream_loading);\n mStationDataSheetMetadata.setText(R.string.descr_station_stream_loading);\n // show metadata views\n mStationMetadataView.setVisibility(View.VISIBLE);\n mStationMetadataView.setSelected(true);\n mStationDataSheetMetadataLayout.setVisibility(View.VISIBLE);\n displayExtendedMetaData(mThisStation);\n }\n // STATE: playback started\n else if (isAdded() && mThisStation != null && mPlaybackState == PLAYBACK_STATE_STARTED) {\n // change playback button image to stop\n mPlaybackButton.setImageResource(R.drawable.smbl_stop);\n // change playback indicator and metadata views\n mPlaybackIndicator.setBackgroundResource(R.drawable.ic_playback_indicator_started_24dp);\n mStationMetadataView.setText(mThisStation.getMetadata());\n mStationDataSheetMetadata.setText(mThisStation.getMetadata());\n // show metadata views\n mStationMetadataView.setVisibility(View.VISIBLE);\n mStationMetadataView.setSelected(true);\n mStationDataSheetMetadataLayout.setVisibility(View.VISIBLE);\n displayExtendedMetaData(mThisStation);\n }\n // STATE: playback stopped\n else if (isAdded()) {\n // change playback button image to play\n mPlaybackButton.setImageResource(R.drawable.smbl_play);\n // change playback indicator\n mPlaybackIndicator.setBackgroundResource(R.drawable.ic_playback_indicator_stopped_24dp);\n // hide metadata views\n mStationMetadataView.setVisibility(View.GONE);\n mStationDataSheetMetadataLayout.setVisibility(View.GONE);\n mStationDataSheetMimeTypeLayout.setVisibility(View.GONE);\n mStationDataSheetChannelCountLayout.setVisibility(View.GONE);\n mStationDataSheetSampleRateLayout.setVisibility(View.GONE);\n mStationDataSheetBitRateLayout.setVisibility(View.GONE);\n }\n }", "private void createYourMusicContent() {\n\t\t/**Creates all images we will use for the buttons*/\n\t\tImageIcon image1 = new ImageIcon(sURLFB1);\n\t\tImageIcon image2 = new ImageIcon(sURLFB2);\n\t\tImageIcon image3 = new ImageIcon(sURLFB3);\n\t\tImageIcon image4 = new ImageIcon(sURLFBS1);\n\t\tImageIcon image5 = new ImageIcon(sURLFBS2);\n\t\tImageIcon image6 = new ImageIcon(sURLFBS3);\n\t\tImageIcon image7 = new ImageIcon(sURLFBPL1);\n\t\tImageIcon image8 = new ImageIcon(sURLFBPL2);\n\t\tImageIcon image9 = new ImageIcon(sURLFBPL3);\n\t\n\t\t/**Creates the button of Favourites and configures it*/\n\t\tjbFavorites = new JButton(\"Favorites\");\n\t\tjbFavorites.setFont(new java.awt.Font(\"Century Gothic\",0, 15));\n\t\tjbFavorites.setForeground(new Color(150,100,100));\n\t\tjbFavorites.setIcon(image1);\n\t\tjbFavorites.setHorizontalTextPosition(SwingConstants.CENTER);\n\t\tjbFavorites.setVerticalTextPosition(SwingConstants.CENTER);\n\t\tjbFavorites.setRolloverIcon(image2);\n\t\tjbFavorites.setSelectedIcon(image3);\n\t\tjbFavorites.setContentAreaFilled(false);\n\t\tjbFavorites.setFocusable(false);\n\t\tjbFavorites.setBorderPainted(false);\n\t\t\n\t\t/**Creates the button of Songs and configures it*/\n\t\tjbSongs = new JButton(\"Songs\");\n\t\tjbSongs.setFont(new java.awt.Font(\"Century Gothic\",0, 15));\n\t\tjbSongs.setForeground(new Color(150,100,100));\n\t\tjbSongs.setIcon(image4);\n\t\tjbSongs.setHorizontalTextPosition(SwingConstants.CENTER);\n\t\tjbSongs.setVerticalTextPosition(SwingConstants.CENTER);\n\t\tjbSongs.setRolloverIcon(image5);\n\t\tjbSongs.setSelectedIcon(image6);\n\t\tjbSongs.setContentAreaFilled(false);\n\t\tjbSongs.setFocusable(false);\n\t\tjbSongs.setBorderPainted(false);\n\t\t\n\t\t/**Creates the button of PartyList and configures it*/\n\t\tjbPartyList = new JButton(\"PartyList\");\n\t\tjbPartyList.setFont(new java.awt.Font(\"Century Gothic\",0, 15));\n\t\tjbPartyList.setForeground(new Color(150,100,100));\n\t\tjbPartyList.setIcon(image7);\n\t\tjbPartyList.setHorizontalTextPosition(SwingConstants.CENTER);\n\t\tjbPartyList.setVerticalTextPosition(SwingConstants.CENTER);\n\t\tjbPartyList.setRolloverIcon(image8);\n\t\tjbPartyList.setSelectedIcon(image9);\t\n\t\tjbPartyList.setContentAreaFilled(false);\n\t\tjbPartyList.setFocusable(false);\n\t\tjbPartyList.setBorderPainted(false);\n\t\t\n\t\t/**Creates the panel where we will put all buttons*/\n\t\tjpPreLists = new JPanel(new BorderLayout());\n jpPreLists.setOpaque(false);\n\t\tjpPreLists.add(jbFavorites,BorderLayout.NORTH);\n\t\tjpPreLists.add(jbSongs,BorderLayout.CENTER);\n\t\tjpPreLists.add(jbPartyList,BorderLayout.SOUTH);\n\t}" ]
[ "0.6298616", "0.597243", "0.5856922", "0.5784531", "0.57770294", "0.5731825", "0.5643281", "0.56310976", "0.5610902", "0.5610399", "0.558033", "0.55740684", "0.55096114", "0.55011636", "0.54974395", "0.5475124", "0.54684126", "0.54676133", "0.54556495", "0.54405755", "0.5438298", "0.54318607", "0.54215825", "0.541902", "0.54109365", "0.54030037", "0.54015046", "0.53935224", "0.53635514", "0.53591007", "0.5354668", "0.53543323", "0.5353019", "0.5345236", "0.5329206", "0.53126264", "0.5309517", "0.53030115", "0.5296681", "0.5289581", "0.5275423", "0.5253303", "0.52500385", "0.5248963", "0.52478725", "0.5237848", "0.5235976", "0.5233925", "0.5231469", "0.5224745", "0.5220408", "0.52193624", "0.5214384", "0.52143", "0.5212035", "0.52113044", "0.52084416", "0.5208439", "0.52046627", "0.51997924", "0.51985955", "0.5192034", "0.5191683", "0.5188601", "0.5187727", "0.51856637", "0.5183464", "0.5176558", "0.51646847", "0.5163329", "0.5161486", "0.51566803", "0.51537275", "0.5152604", "0.5150137", "0.51468164", "0.5144504", "0.5138181", "0.51376617", "0.51360846", "0.5132355", "0.51284784", "0.51271313", "0.5124287", "0.51213235", "0.51188284", "0.5109992", "0.5108428", "0.5094951", "0.5092466", "0.50920534", "0.5090066", "0.50893", "0.50859755", "0.50811946", "0.5071276", "0.5070188", "0.50574213", "0.50556415", "0.50539374" ]
0.71609795
0
Constructor with parameters The constructor with parameters is used to create the object with filled attributes, it uses the setters methods to put the information in the attributes.
public Employee(String username,String password,String firstname,String lastname,Date DoB, String contactNamber,String email,float salary,String positionStatus,String name, String buildingName, String street, Integer buildingNo, String area, String city, String country, String postcode){ super(username, password,firstname, lastname,DoB, contactNamber, email, name, buildingName, street, buildingNo, area, city, country, postcode); setSalary(salary); setPositionStatus(positionStatus); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Constructor() {\r\n\t\t \r\n\t }", "public Parameters() {\n\t}", "public BaseParameters(){\r\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 Car () {\n\n Make = \"\";\n Model = \"\";\n Year = 2017;\n Price = 0.00;\n }", "public Person() {\n\t\tname \t= \"\";\n\t\taddress = \"\";\n\t\tcity \t= \"\";\n\t\tage \t= 0;\n\t}", "public Person()\n {\n this.name = \"John Doe\";\n this.address = \"1234 Somewhere Dr.\";\n this.phoneNumber = \"309-555-1234\";\n this.emailAddress = \"[email protected]\";\n }", "public Constructor(){\n\t\t\n\t}", "public Person(String name, String address, String postalCode, String city, String phone){\n // initialise instance variables\n this.name = name;\n this.address = address;\n this.postalCode = postalCode;\n this.city = city;\n this.phone = phone;\n }", "public ConstructorsDemo() \n\t {\n\t x = 5; // Set the initial value for the class attribute x\n\t }", "@Test\n public void billCustomConstructor_isCorrect() throws Exception {\n\n int billId = 100;\n String billName = \"test Bill\";\n int userId = 101;\n int accountId = 202;\n double billAmount = 300.25;\n String dueDate = \"02/02/2018\";\n int occurrenceRte = 1;\n\n //Create empty bill\n Bill bill = new Bill(billId,userId,accountId,billName,billAmount,dueDate,occurrenceRte);\n\n // Verify Values\n assertEquals(billId, bill.getBillId());\n assertEquals(billName, bill.getBillName());\n assertEquals(userId, bill.getUserId());\n assertEquals(accountId, bill.getAccountId());\n assertEquals(billAmount, bill.getBillAmount(), 0);\n assertEquals(dueDate, bill.getDueDate());\n assertEquals(occurrenceRte, bill.getOccurrenceRte());\n }", "public Car() {\r\n this(\"\", \"\", \"\", 0, Category.EMPTY, 0.00, \"\", 0, \"\", 0.00, \"\", DriveTrain.EMPTY,\r\n Aspiration.EMPTY, 0.00, 0.00, 0.00, 0.00, 0.0, 0.0, 0.0, 0.0, 0.0);\r\n }", "protected ParameterList(){\n //title = t;\n //cellWorld = cw;\n }", "public Book() {\n this.bookName = \"Five Point Someone\";\n this.bookAuthorName = \"Chetan Bhagat\";\n this.bookIsbnNumber = \"9788129104595\";\n\n }", "public Person()\n\t{\n\t\tthis.age = -1;\n\t\tthis.name = \"Unknown\";\n\t}", "public Attr() {\n\t\t\tsuper();\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 MLetter(Parameters parametersObj) {\r\n\t\tsuper(parametersObj);\r\n\t}", "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 Customer() {\n name = \"N.A.\";\n surname = \"N.A.\";\n address = \"N.A.\";\n email = \"N.A.\";\n }", "public Doctor(float weight, int age, double height, int years, String specialty){\r\n\t\t//This calls the human's constructor, so a human object for the doctor can be created.\r\n\t\tsuper(weight, age, height);\r\n\t\t//the field years is set\r\n\t\tthis.years = years;\r\n\t\t//The field specialty is set\r\n\t\tthis.specialty = specialty;\r\n\t}", "public Airplane() { \n\n\t\t//The Airplane constructor calls the Flyingobject constructor\n\t\tsuper();\n\n\t\t//Sets its attributes to default values\n\t\tthis.brand = \"\";\n\t\tthis.price = 0.0; \n\t\tthis.horsePower = 0; \n\t}", "public BookRecord(String NameOfTheBook, String NameofWriter, int isbnNumber, double booksCost) \r\n\r\n{ \r\n\r\nthis.NameOfTheBook = NameOfTheBook; \r\n\r\nthis.NameofWriter = NameofWriter; \r\n\r\nthis.isbnNumber = isbnNumber; \r\n\r\nthis.booksCost = booksCost; \r\n\r\n}", "public IRAttribute ( ) {\n\t\tsuper();\n\t}", "public Student() {\r\n\t\t\r\n\t\t//populating country options\r\n\t\t//can also be done using a properties file\r\n\t\t\r\n\t\t/*\r\n\t\t * countryOptions = new LinkedHashMap<String, String>();\r\n\t\t * \r\n\t\t * countryOptions.put(\"BR\", \"Brazil\"); countryOptions.put(\"IN\", \"India\");\r\n\t\t * countryOptions.put(\"US\", \"United States\"); countryOptions.put(\"CA\",\r\n\t\t * \"Canada\");\r\n\t\t */\r\n\t\t\r\n\t\t\r\n\t}", "public AttributeDescriptorDTO()\n\t{\n\t\tsuper();\n\t}", "PassengerPersonalInfo(String First_Name, String Last_Name, int Age, Date dob, \n String Address, String Nationality, long Number, String eID) { \n this.firstName = First_Name;\n this.lastName = Last_Name;\n this.age = Age;\n this.dateOfBirth = dob;\n this.address = Address;\n this.nationality = Nationality;\n this.contact = Number;\n this.email = eID;\n }", "public Person (String firstName, String lastName, String address) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.address = address;\n\n }", "public Car()\n {\n \tsuper();\n bodyType = null;\n noOfDoors = 0;\n noOfSeats = 0;\n }", "public Student(){\n firstName = \"\";\n lastName = \"\";\n bootcamp = \"\";\n id = 42;\n grade = 1.0;\n }", "public Student()\n {\n lname = \"Tantiviramanond\";\n fname = \"Anchalee\";\n grade = 12;\n studentNumber = 2185;\n }", "public User(String n, int a) { // constructor\r\n name = n;\r\n age = a;\r\n }", "public Account() {\n this(0, 0.0, \"Unknown name\"); // Invole the 2-param constructor\n }", "public Employee(String nama, int usia) {\r\n // Constructor digunakan untuk inisialisasi value, yang di inisiate saat melakukan instantiation\r\n this.nama = nama;\r\n this.usia = usia;\r\n }", "public Book () {\n\t\tsuper ();\n\t\t_title = \"\";\n\t\t_text = \"\";\n\t\t_publisher = null;\n\t\t_oid = 0;\n\t\t_author = null;\n\t\t_Isbn = \"\";\n\t}", "public Human() { // has to be name of class — COnstuctor\n\t\t\n\t\tname = \"\";\n\t\tage = 0;\n\t\tSystem.out.println(\"CONSTRUCTOR HERE\");\n\t\t\n\t}", "public Card() { this(12, 3); }", "public DepictionParameters() {\n this(200, 150, true, DEFAULT_BACKGROUND);\n }", "public Generador(Generic generic) {\r\n this.generic = generic;\r\n this.Num_Atributes = this.generic.getClass().getDeclaredFields().length;\r\n this.SuperDeclaredFields = this.generic.getClass().getSuperclass().getDeclaredFields();\r\n this.DeclaredFields = this.generic.getClass().getDeclaredFields();\r\n }", "public Person() {\r\n\t\tid = \"00000\";\r\n\t\tfName = \"unknown\";\r\n\t\tlName = \"unknown\";\r\n\t\tbirthday = LocalDate.now();\r\n\t\tphone = \"unknown\";\r\n\t\tstatus = \"unknown\";\r\n\t\tcontacts = new ArrayList<String>();\r\n\t}", "public Student() {\r\n\t\timePrezime = \"Petar Petrovic\";\r\n\t\tfakultet = \"Matematicki\";\r\n\t\tgodina = 1;\r\n\t}", "public Employee () {\r\n lName = \"NO LAST NAME\";\r\n fName = \"NO FIRST NAME\";\r\n empID = \"NO EMPLOYEE ID\";\r\n salary = -1;\r\n }", "public AttributeContainer() {\n super();\n }", "@Test\n public void billEmptyConstructorCustomSetters_isCorrect() throws Exception {\n\n int billId = 100;\n String billName = \"test Bill\";\n int userId = 101;\n int accountId = 202;\n double billAmount = 300.25;\n String dueDate = \"02/02/2018\";\n int occurrenceRte = 1;\n\n //Create empty bill\n Bill bill = new Bill();\n\n //Set the values\n bill.setBillId(billId);\n bill.setBillName(billName);\n bill.setUserId(userId);\n bill.setAccountId(accountId);\n bill.setBillAmount(billAmount);\n bill.setDueDate(dueDate);\n bill.setOccurrenceRte(occurrenceRte);\n\n // Verify Values\n assertEquals(billId, bill.getBillId());\n assertEquals(billName, bill.getBillName());\n assertEquals(userId, bill.getUserId());\n assertEquals(accountId, bill.getAccountId());\n assertEquals(billAmount, bill.getBillAmount(), 0);\n assertEquals(dueDate, bill.getDueDate());\n assertEquals(occurrenceRte, bill.getOccurrenceRte());\n }", "public PaymentDetails () {\n\t}", "public Customer()\n{\n this.firstName = \"noFName\";\n this.lastName = \"noLName\";\n this.address = \"noAddress\";\n this.phoneNumber = 0;\n this.emailAddress = \"noEmail\";\n \n}", "public Citizen(){\n fullName = \"\";\n email = \"\";\n address = \"\";\n age = 0;\n district = 0;\n resident = false;\n gender = 'M';\n }", "public Person(){\r\n\t\tsuper();\r\n\t}", "public Employee(){\r\n this(\"\", \"\", \"\", 0, \"\", 0.0);\r\n }", "public LoyaltyCard(String theTitle, String theFirstName, \r\n String theLastName, String street, \r\n String town, String postcode, \r\n String theCardNumber, int thePoints)\r\n {\r\n title = theTitle;\r\n firstName = theFirstName;\r\n lastName = theLastName;\r\n address = new LoyaltyCardAddress(street, town, postcode);\r\n cardNumber = theCardNumber;\r\n points = thePoints; \r\n }", "Data() {\n\t\t// dia = 01;\n\t\t// mes = 01;\n\t\t// ano = 1970;\n\t\tthis(1, 1, 1970); // usar um construtor dentro de outro\n\t}", "Employee(int id, String name, String birthDate, int eage, double esalary){\r\n ID=id; \r\n NAME=name; \r\n BIRTHDATE=birthDate; \r\n age=eage; \r\n salary=esalary; \r\n }", "public BankAccount() {\n this(12346, 5.00, \"Default Name\", \"Default Address\", \"default phone\");\n }", "public BaseballCard(){\r\n\r\n\t}", "public LoyaltyCard(String theTitle, String theFirstName, \r\n String theLastName, String street, \r\n String town, String postcode, \r\n String theCardNumber)\r\n {\r\n title = theTitle; \r\n firstName = theFirstName;\r\n lastName = theLastName;\r\n address = new LoyaltyCardAddress(street, town, postcode);\r\n cardNumber = theCardNumber;\r\n points = 0;\r\n }", "public Person() {\n\t\t\n\t}", "public Attendance()\t//constructor, it exists as method in Attendance class\r\n\t{\r\n\t\tthis.name = \"NULL\";\t//initiates name\r\n\t\tthis.year = 0;\t\t//initiates year\r\n\t\tthis.student_id = \"NULL\";\t//initiates student_id\r\n\t\tthis.missed = 0;\t//initiates missed\r\n\t}", "public UserImplPart1(int studentId, String yourName, int yourAge,int yourSchoolYear, String yourNationality){\n this.studentId = studentId;\n this.name= yourName;\n this.age = yourAge; \n this.schoolYear= yourSchoolYear;\n this.nationality= yourNationality;\n}", "public Human(String name,int age, int height){\n //set this object's name with the provided name\n this.name = name;\n //set this object's age with the provided age\n this.age = age;\n //set this object's height with the provided height\n this.height = height;\n\n System.out.println(\"Created a new Human instance.\\n\");\n }", "public EmployeeRecords(String n, int s){ // defined a parameterized constructor\r\n this.name = n; // assigning a local variable value to a global variable\r\n this.salary = s; // assigning a local variable value to a global variable\r\n }", "protected GeometricObject() \n\t{\n\t\tdateCreated = new java.util.Date();\n\t}", "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 AttributeMap()\r\n\t{\r\n\t\tsuper();\r\n\t}", "public Customer(){\n\t \n }", "public BookInfoDO() {\n super();\n }", "public Person() {\r\n setPersonID(null);\r\n setAssocUserName(null);\r\n setFirstName(null);\r\n setLastName(null);\r\n setGender(null);\r\n setFatherID(null);\r\n setMotherID(null);\r\n setSpouseID(null);\r\n }", "public Persona(){\n \n }", "public Persona(){\n \n }", "public ComponentDescriptor() {\r\n\t\t// initialize empty collections\r\n\t\tconstructorParametersTypes = new LinkedList<List<Class<?>>>();\r\n//\t\trequiredProperties = new HashMap<String, MetaProperty>();\r\n//\t\toptionalProperties = new HashMap<String, MetaProperty>();\r\n\t}", "public Car(String description)\r\n {\r\n this.description = description;\r\n customersName = \"\";\r\n }", "private Params()\n {\n }", "protected Product()\n\t{\n\t}", "public Student()\r\n {\r\n // initialise variables with defult values\r\n ID=-1;\r\n Name=null;\r\n University=null;\r\n Department=null;\r\n term=0;\r\n cgpa=0.0;\r\n Gpa=new double[10];\r\n Creditsandgrades=new double[10][10][10];\r\n }", "public Product() {\n\t}", "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 Persona() {\n \t\n }", "Student4(int i, String n, int t) {\n id = i;\n name = n;\n age = t;\n\n }", "public ModuleParams()\n\t{\n\t}", "public Book() {\n\t\t// Default constructor\n\t}", "public Attribute(String title) {\n \t\tthis.title = title;\n \t\tconflictMagnitude = 0;\n \t}", "public BacInfo() {\n }", "public Student() { //Default Constructor\n\t\tthis.roll_no=0;\n\t\tthis.full_name=\"\";\n\t\tthis.grade=\"\";\n\t}", "public Vehicle() {\r\n\t\tthis.numOfDoors = 4;\r\n\t\tthis.price = 1;\r\n\t\tthis.yearMake = 2019;\r\n\t\tthis.make = \"Toyota\";\r\n\t}", "public Construct() {\n\tprefixes = new StringBuilder();\n\tvariables = new StringBuilder();\n\twheres = new StringBuilder();\n }", "public Person( String emailAddress, String first, String last, \r\n String password, String currency, String creditCard )\r\n {\r\n setEmail( emailAddress );\r\n setFirstName( first );\r\n setLastName( last );\r\n setPassword( password );\r\n setCurrency( currency );\r\n setCreditCard( creditCard );\r\n }", "public Customer() // default constructor to initialize data\r\n\t{\r\n\t\tthis.address = null;\r\n\t\tthis.name = null;\r\n\t\tthis.phoneNumber = null;\r\n\t\t// intializes the data\r\n\t}", "protected abstract void createAttributes();", "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 Entity(int n, Type t, Priority p, O thing, WhoAmI imposedId, WhoAmI creatorId, String... a) throws ThingsException {\r\n\t\t\r\n\t\t// Set fields\r\n\t\tnumeric = n;\r\n\t\tmyThing = thing;\r\n\t\tmyPriority = p;\r\n\t\tmyType = t;\r\n\t\tmyId = imposedId;\r\n\t\tmyCreatorId = creatorId;\r\n\t\t\r\n\t\t// Fix ids?\r\n\t\tif (myId == null) myId = cachedNobody;\r\n\t\tif (myCreatorId == null) myCreatorId = cachedNobody;\t\r\n\t\t\r\n\t\t// Stamp the time.\r\n\t\tstamp = System.currentTimeMillis();\r\n\r\n\t\t// Attributes\r\n\t\tif (a==null) throw new ThingsException(\"Cannot set attribute object as null.\", ThingsException.DATA_ATTRIBUTE_OBJECT_NULL);\r\n\t\tReadWriteableAttributes tempAttributes = new ReadWriteableAttributes();\r\n\t\ttempAttributes.addMultiAttributes(a);\r\n\t\tattributes = tempAttributes;\r\n\t}", "public Persona() {\n\t}", "public LearnConstructor(int age,String name,String address){\n this.age=age;\n this.address=address;\n this.name=name;\n System.out.println(this.name+\" \"+this.address+\" \"+this.age);\n }", "@Test\n public void purchaseCustomConstructor_isCorrect() throws Exception {\n\n int purchaseId = 41;\n int userId = 99;\n int accountId = 6541;\n double price = 99.99;\n String date = \"02/19/2019\";\n String time = \"12:12\";\n String category = \"test category\";\n String location = \"test location\";\n String comment = \"test comment\";\n\n //Create empty purchase\n Purchase purchase = new Purchase(purchaseId, userId, accountId, price, date, time, category, location, comment);\n\n // Verify Values\n assertEquals(purchaseId, purchase.getPurchaseId());\n assertEquals(userId, purchase.getUserId());\n assertEquals(accountId, purchase.getAccountId());\n assertEquals(price, purchase.getPrice(), 0);\n assertEquals(date, purchase.getDate());\n assertEquals(time, purchase.getTime());\n assertEquals(category, purchase.getCategory());\n assertEquals(location, purchase.getLocation());\n assertEquals(comment, purchase.getComment());\n }", "public CreateUser(int age, String name){ // constructor\n userAge = age;\n userName = name;\n }", "public Student() \r\n {\r\n studentId = 0;\r\n studentName = \"\";\r\n studentMajor = \"\";\r\n }", "public User() {\r\n\t\temployee=new HashMap<Integer, Employee>();\r\n\t\tperformance=new HashMap<Employee,String>();\r\n\t}", "public AttributeForm() \n {\n initComponents();\n mJerseyNumberUpDown.setModel(new SpinnerNumberModel(0,0,99,1));\n \n m_Parser = new InputParser();\n m_Attributes = new JComboBox[8];\n m_Attributes[0] = m_RSBox;\n m_Attributes[1] = m_RPBox;\n m_Attributes[2] = m_MSBox;\n m_Attributes[3] = m_HPBox;\n m_Attributes[4] = m_PS_BC_PI_KABox;\n m_Attributes[5] = m_PC_REC_QU_KABox;\n m_Attributes[6] = m_ACCBox;\n m_Attributes[7] = m_APBBox;\n\n m_SimAttrs = new JSpinner[4];\n m_SimAttrs[0] = m_Sim1UpDown;\n m_SimAttrs[1] = m_Sim2UpDown;\n m_SimAttrs[2] = m_Sim3UpDown;\n m_SimAttrs[3] = m_Sim4UpDown;\n \n m_DoneInit = true;\n setCurrentState(StateEnum.QB);\n \n }", "public Monster(Object[] parameters) {\n setName((String) parameters[0]);\n setLevel((int) parameters[1]);\n setAttribute(Attributes.valueOf(((String) parameters[2]).toUpperCase()));\n setMonsterType(MonsterTypes.valueOf(((String) parameters[3]).toUpperCase()));\n setCardType(CardType.valueOf(((String) parameters[4]).toUpperCase()));\n if (cardType.getName().equals(\"Effect\")) this.setHasEffect(true);\n setAtk((int) parameters[5]);\n setAtkHolder((int) parameters[5]);\n setDef((int) parameters[6]);\n setDefHolder((int) parameters[6]);\n setDescription((String) parameters[7]);\n setPrice((int) parameters[8]);\n Set<String> keys = this.getEffectsMap().keySet();\n for (String key : keys) {\n this.getEffectsMap().get(key).accept(new Effect(0, 0));\n }\n DataController.monsterEffectParser((String) parameters[9], this);\n DataController.cardPairsParser((String) parameters[10], this);\n setHasAttackedOnceInTurn(false);\n }", "@Test\n public void goalCustomConstructor_isCorrect() throws Exception {\n\n int goalId = 11;\n int userId = 1152;\n String name = \"Test Name\";\n int timePeriod = 1;\n int unit = 2;\n double amount = 1000.52;\n\n\n //Create goal\n Goal goal = new Goal(goalId, userId, name, timePeriod, unit, amount);\n\n // Verify Values\n assertEquals(goalId, goal.getGoalId());\n assertEquals(userId, goal.getUserId());\n assertEquals(name, goal.getGoalName());\n assertEquals(timePeriod, goal.getTimePeriod());\n assertEquals(unit, goal.getUnit());\n assertEquals(amount, goal.getAmount(),0);\n }", "public CampoModelo(String valor, String etiqueta, Integer longitud)\n/* 10: */ {\n/* 11:17 */ this.valor = valor;\n/* 12:18 */ this.etiqueta = etiqueta;\n/* 13:19 */ this.longitud = longitud;\n/* 14: */ }", "public TradeData() {\r\n\r\n\t}", "protected Book() {\n this.title = \"Init\";\n this.author = \"Init\";\n this.bookCategories = new HashSet<>(10);\n }" ]
[ "0.64635783", "0.6419635", "0.63706964", "0.6369119", "0.63618964", "0.6345918", "0.63170856", "0.6301077", "0.629714", "0.6224238", "0.622092", "0.6202806", "0.61675954", "0.6112038", "0.6111659", "0.6109753", "0.6108225", "0.6085344", "0.6063957", "0.60608417", "0.6042511", "0.6040493", "0.60193163", "0.6004857", "0.60000855", "0.59915465", "0.5989723", "0.59896666", "0.5965353", "0.59586495", "0.5957705", "0.59569865", "0.59520334", "0.59513193", "0.59445757", "0.5944572", "0.5940234", "0.5938136", "0.5926936", "0.59237576", "0.5913745", "0.59073526", "0.5899265", "0.58903337", "0.5886941", "0.58788294", "0.5872266", "0.58668804", "0.58653224", "0.586384", "0.5859717", "0.58546567", "0.5854341", "0.58424634", "0.5842346", "0.5837721", "0.5835216", "0.5834745", "0.5833988", "0.5831316", "0.5829148", "0.5823039", "0.5820385", "0.5814083", "0.5812828", "0.5810362", "0.58036536", "0.58036536", "0.5802129", "0.57944834", "0.5786187", "0.578564", "0.57807916", "0.57807606", "0.57787865", "0.57783747", "0.57775533", "0.5776322", "0.57743764", "0.5773941", "0.5768554", "0.5764187", "0.576333", "0.57609195", "0.57599586", "0.5755977", "0.57559395", "0.5752443", "0.5747062", "0.5746865", "0.57442755", "0.5744045", "0.57436097", "0.5741067", "0.5738329", "0.57380706", "0.57365066", "0.57339", "0.57298356", "0.57286215", "0.572764" ]
0.0
-1
Setter methods The following methods set the attributes of the class Employee. The key word 'final' does not allow to subclasses (if they are exist) to override the setter methods because there is a rule: a constructor should not call methods that can be overridden. Set salary
public final void setSalary(float salary){ if(salary>=0){ this.salary=salary; } else{ JOptionPane.showMessageDialog(null,"Incorrect amount of salary "); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setSalary(double salary){\r\n this.salary = salary;\r\n }", "public void setSalary(double salary) {\r\n this.salary = salary;\r\n }", "public void setSalary(double sal) { //salary variable to assign a value\n\t\tsalary = sal;\n\t}", "public void setSalary(double salary) {\n this.salary = salary;\n }", "public void setSalary(double salary) {\n this.salary = salary;\n }", "@Override\n\tpublic void updateEmployee(int empid, int empNewSalary) {\n\t\t\n\t}", "public void setSalary(int salary) {\n this.salary = salary; // assigning a local variable value to a global variable\r\n }", "public void setEmployee(String employee)\r\n/* 43: */ {\r\n/* 44:47 */ this.employee = employee;\r\n/* 45: */ }", "public void setSalary(double salary) {\r\n\t\tthis.salary = salary;\r\n\t}", "public Employee(String firstName, String lastName, int age, double salary) {\r\n //envoke the super class's constructor\r\n super(firstName, lastName, age);\r\n \r\n //set the instance variables specific to this class. \r\n this.salary = salary;\r\n employeeNumber = nextEmployeeNumber;\r\n nextEmployeeNumber++;\r\n }", "public void setSalary (int newSalary) {\n if (joined == false) {\n this.salary = newSalary;\n }else{\n System.out.println(\"It is not possible to change the salary.\");\n }\n }", "public Employee(String name, int salary)\n\n\t{\n\t\tthis.name = name;\n\t\tthis.salary = salary;\n\t}", "Employee setLastname(String lastname);", "public Employee(String name, double salary){\r\n\t\tthis.employeeName = name;\r\n\t\tthis.salary = salary;\r\n\t}", "public void setSalary(double fromage)\r\n {\r\n mySalary = fromage;\r\n }", "public Employee(String fName, String lName, String gender, double salary) {\n this.fName = fName;\n this.lName = lName;\n this.gender = gender;\n this.salary = salary; \n }", "Employee setFirstname(String firstname);", "@Override\n\tpublic void computeSalary(int empid) {\n\t\t\n\t}", "Employee(String employeeName, double employeeSalary, int employeeAge) {\n\t\tthis.employeeName = employeeName;\n\t\tthis.employeeSalary = employeeSalary;\n\t\tthis.employeeAge = employeeAge;\n\t}", "public Employee(String firstName, String lastName, int salary, int bonus) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.salary = salary;\n this.bonus = bonus;\n this.taxableSalary=this.salary+this.bonus-this.taxAllowance;\n }", "public Employee(String n, double s)\n {\n name = n;\n salary = s;\n }", "public void setSalary(int salary) {\n salaryField.setText(\"\" + salary);\n }", "public void setEmpleado(Empleado empleado)\r\n/* 188: */ {\r\n/* 189:347 */ this.empleado = empleado;\r\n/* 190: */ }", "Employee(int id, String name, String birthDate, int eage, double esalary){\r\n ID=id; \r\n NAME=name; \r\n BIRTHDATE=birthDate; \r\n age=eage; \r\n salary=esalary; \r\n }", "public Employee(String name, int id, String position, double salary) { \n super(name, id);\n this.position = position;\n this.salary = salary;\n }", "@Override\n\tpublic void ModifyEmployee() {\n\t\t\n\t}", "public Employee(String name){\r\n\t\tthis.employeeName = name;\r\n\t\tthis.salary = 0;\r\n\t}", "public Employee () {\r\n lName = \"NO LAST NAME\";\r\n fName = \"NO FIRST NAME\";\r\n empID = \"NO EMPLOYEE ID\";\r\n salary = -1;\r\n }", "@Override\r\n\tpublic void updateEmployee(Employee t) {\n\t\t\r\n\t}", "public void setEmployeeID(int employeeID) { this.employeeID = employeeID; }", "public Employee(String firstName, String lastName, double monthlySalary) {\n\t\tthis.firstName = firstName;\n\t\tthis.lastName = lastName;\n\t\tif(monthlySalary > 0) {\n\t\t\tthis.monthlySalary = monthlySalary;\n\t\t} else {\n\t\t\tthis.monthlySalary = 0.0;\n\t\t}\n\t}", "public void updateEmployee(Employe employee) {\n\t\t\n\t}", "public Employee(String name, int id) {\n super(name, id);\n position = \"None\";\n salary = 0.0;\n }", "@Override\n\tpublic void updateEmployee() {\n\n\t}", "public void setSalaryDay(String salaryDay) {\n this.salaryDay = salaryDay;\n }", "public void setEmployee (jkt.hms.masters.business.MasEmployee employee) {\n\t\tthis.employee = employee;\n\t}", "public void setEmployees(int _employees){\n employees = _employees;\n }", "@Override\n\tpublic void setSal(BigDecimal sal) {\n\t\tsuper.setSal(sal);\n\t}", "@Override\n public void setDepartmentEmployee(Employee employee, int departmentId) {\n\n }", "public Employee(String inName, double inSalary)\n\t{\n\t\tname = inName;\n\t\tsalary = inSalary;\n\t}", "public void setEmployeeId(long employeeId);", "protected void setEmployeeSalaryService(EmployeeSalaryService service) {\n this.employeeSalaryService = service;\n }", "@Override\n\tpublic void updateEmployee(Employee e) {\n\t\t\n\t}", "public void setEmployee(Employee employee) {\r\n this.employee = employee;\r\n\r\n idLabel.setText(Integer.toString(employee.getId()));\r\n firstNameField.setText(employee.getFirstName());\r\n lastNameField.setText(employee.getLastName());\r\n industryField.setText(employee.getIndustry());\r\n workTypeField.setText(employee.getWorkType());\r\n addressField.setText(employee.getAddress());\r\n }", "@Override\r\n\tpublic void calculateSalary() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t salary = hoursWorked * hourlyWages;\r\n\t\t this.setSalary(salary);\r\n\t}", "@Override\n public void setEmployees() throws EmployeeCreationException {\n\n }", "public void updateSalaryForEmployee(Integer EmployeeID, int salary) {\n\t\tSession session = factory.openSession();\n\t\tTransaction transaction = null;\n\t\ttry {\n\t\t\ttransaction = session.beginTransaction();\n\t\t\tEmployee employee = (Employee) session.get(Employee.class, EmployeeID);\n\t\t\temployee.setSalary(salary);\n\t\t\tsession.update(employee);\n\t\t\ttransaction.commit();\n\t\t} catch (HibernateException e) {\n\t\t\tif (transaction != null)\n\t\t\t\ttransaction.rollback();\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tsession.close();\n\t\t}\n\t}", "public void setvalues(int tsal,int twh)\n {\n salary = tsal;\n wh = twh;\n }", "public void calculateSalary() ;", "public void salary(int sal)\n {\n System.out.println(\"Base Salary: \"+ sal);\n }", "@Test\n public void setHourlySalaryTest() {\n e1.setHourlySalary(5.0);\n double expected = 5.0;\n\n assertEquals(\"The expected new hourly salary does not match the actual: \"\n , expected, e1.getHourlySalary(), 0.001);\n }", "@Override\r\n public double getSalary() {\r\n return salary;\r\n }", "@JsonSetter(\"salary\")\n public void setSalary (int value) { \n this.salary = value;\n notifyObservers(this.salary);\n }", "public static void main(String[] args) {\n\t\t\n\t\tEmployee theEmployee = new Employee();\n\t\t\n//\t\twhat does it mean below setter? by this section we assign value to variables.\n\t\ttheEmployee.setId(1000);\n\t\ttheEmployee.setName(\"Ramesh\");\n\t\ttheEmployee.setPosition(\"Mangaer\");\n\t\ttheEmployee.setSalary(10000.88);\n//\t\tby thes getters we print the data.\n\t\tSystem.out.println(theEmployee.getId());\n\t\tSystem.out.println(theEmployee.getName());\n\t\tSystem.out.println(theEmployee.getPosition());\n\t\tSystem.out.println(theEmployee.getSalary());\n\t\tSystem.out.println(theEmployee.getClass());\n\t\n\t\tSystem.out.println(\"====================================\");\n\t\t\n\t\tEmployee theEmployee1 = new Employee();\n\t\t\n\t\ttheEmployee1.setId(2);\n\t\ttheEmployee1.setName(\"Rahim\");\n\t\ttheEmployee1.setPosition(\"Team leader\");\n\t\ttheEmployee1.setSalary(22.88);\n\t\t\n\t\tSystem.out.println(theEmployee1.getId());\n\t\tSystem.out.println(theEmployee1.getName());\n\t\tSystem.out.println(theEmployee1.getPosition());\n\t\tSystem.out.println(theEmployee1.getSalary());\n\t\tSystem.out.println(theEmployee1.getClass());\n\t\t\n\t\t\n\tSystem.out.println(\"============================\");\n\t\n\tEmployee theEmployee2 = new Employee();\n\t\n\ttheEmployee2.setId(9);\n\ttheEmployee2.setName(\"Ramin\");\n\ttheEmployee2.setPosition(\"Superwiser\");\n\ttheEmployee2.setSalary(15000.00);\n\t\n\tSystem.out.println(theEmployee2.getId());\n\tSystem.out.println(theEmployee2.getName());\n\tSystem.out.println(theEmployee2.getPosition());\n\tSystem.out.println(theEmployee2.getSalary());\n\tSystem.out.println(theEmployee2.getClass());\n\t\n\t\t\n\t}", "Employee setBirthdate(Date birthdate);", "public Employee(int id, String name, double salary, Date dateOfBirth,\n String emailId, String mobileNumber) {\n this.id = id;\n this.name = name;\n this.salary = salary;\n this.dateOfBirth = dateOfBirth;\n this.emailId = emailId;\n this.mobileNumber = mobileNumber;\n }", "private Employee(String name, String city, String id,int salary) {\n\t\tthis.name = name;\n\t\tthis.city = city;\n\t\tthis.id = id;\n\t\tthis.salary = salary;\n\t}", "public Employee(String name,String pos,int sal, int Vbal, int AnBon){\n Random rnd = new Random();\n this.idnum = 100000 + rnd.nextInt(900000);\n this.name = name;\n this.position = pos;\n this.salary = sal;\n this.vacationBal = Vbal;\n this.annualBonus = AnBon;\n this.password = \"AJDLIAFYI\";\n salaryHist[0] = salary;\n }", "public Employee(String employeeName, PositionTitle position, boolean salary, double payRate, int employeeShift,\n String startDate, double hrsIn) {\n // ////////////// construct Employees\n this.employeeName = employeeName;\n this.position = position;\n this.salary = salary;\n this.payRate = payRate;\n this.employeeShift = employeeShift;\n this.startDate = startDate;\n this.hrsIn = hrsIn;\n\n }", "public abstract void raiseSalary();", "public Employee(int id, String firstName, String lastName, int age, double salary, String address) {\n\t\tsuper();\n\t\tthis.id = id;\n\t\tthis.firstName = firstName;\n\t\tthis.lastName = lastName;\n\t\tthis.age = age;\n\t\tthis.salary = salary;\n\t\tthis.address = address;\n\t}", "public void setSalary(String salary) {\n this.salary = salary == null ? null : salary.trim();\n }", "public void setSalary(String salary) {\n this.salary = salary == null ? null : salary.trim();\n }", "@Override\r\n\tpublic void updateEmployee(long employeeId, Employee updateEmployee) {\n\t\t\r\n\t}", "public abstract double salary();", "@Override\r\n\tpublic int updateEmployee(Connection con, Employee employee) {\n\t\treturn 0;\r\n\t}", "@Override\n\tpublic void update(Employee employee) {\n\t}", "public Employee(String employeeFirstName, String employeeLastName, \r\n String employeeEmail, long employeePhoneNumber, \r\n String employeeStatus, double employeeSalary) {\r\n this.employeeFirstName = employeeFirstName;\r\n this.employeeLastName = employeeLastName;\r\n this.employeeEmail = employeeEmail;\r\n this.employeePhoneNumber = employeePhoneNumber;\r\n this.employeeStatus = employeeStatus;\r\n this.dateHired = new Date();\r\n this.employeeAddress = new Address();\r\n this.employeeSalary = employeeSalary;\r\n }", "@Override\n public void setEmployeeDepartment(int employeeId, int departmentId) {\n\n }", "public void salary(int sal)\n {\n IT it = new IT();\n it.salary(sal);\n System.out.println(\"ECE Faculty: \"+(sal+4500));\n }", "public void setEmployees(ArrayList<Employee> employees) { \r\n this.employees = employees;\r\n }", "public Employee(String username,String password,String firstname,String lastname,Date DoB,\n String contactNamber,String email,float salary,String positionStatus,String name,\n String buildingName, String street, Integer buildingNo, String area,\n String city, String country, String postcode){\n\n super(username, password,firstname, lastname,DoB, contactNamber, email,\n name, buildingName, street, buildingNo, area, city, country, postcode);\n setSalary(salary);\n setPositionStatus(positionStatus);\n }", "public void salary(int sal)\n {\n CSE cse = new CSE();\n cse.salary(sal);\n System.out.println(\"IT Faculty: \"+(sal+5000));\n }", "@Override\n\tpublic float CalculateSalary() {\n\t\treturn salary;\n\t}", "public void calculateSalary() {\n if (hours < 0 || hourlyRate < 0) {\r\n salary = -1;\r\n }\r\n else if (hours > 40) {\r\n salary = 40 * hourlyRate;\r\n }\r\n else {\r\n salary = hours * hourlyRate;\r\n }\r\n }", "public void setEmployeeID(int employeeID)\n {\n if(employeeID<=9999&&employeeID>=1000)\n {\n this.employeeID = employeeID;\n }else\n {\n System.out.println(\"The Employee ID should be of 4 digits only.\");\n \n }\n }", "Employee(String id, Kitchen kitchen) {\r\n this.id = id;\r\n this.kitchen = kitchen;\r\n this.attendance = \"Present\";\r\n this.password = \"password\";\r\n }", "public void salary(int sal)\n {\n Faculty fac = new Faculty();\n fac.salary(sal);\n System.out.println(\"CSE Faculty: \"+(sal+3000));\n }", "public void setSalaryRange(String salaryRange) {\r\n this.salaryRange = salaryRange;\r\n }", "public abstract void updateEmployee(int id, Employee emp) throws DatabaseExeption;", "public Executive(int salary, String name, String department, int yearlyBonus){\n super(salary,name,department); \n this.yearlyBonus = yearlyBonus;\n }", "public double getSalary(){\r\n return salary;\r\n }", "public void setEmployees(Employee[] employees) {\n\t\tthis.employees = employees;\n\t}", "public Employee(int id, String firstName, String lastName, String company) {\n this(firstName, lastName, company);\n\n this.id = id;\n }", "public SalesEmployee(String firstName, String lastName, String number, double salary, double commission){\r\n this.firstname = firstName;\r\n this.lastname = lastName;\r\n this.number = number;\r\n this.salary = salary;\r\n this.commission = commission;\r\n }", "Salesman(String name, int salary, int annualSales, int year) {\n super(name, salary, year);\n super.setType(EMPLOYEE_TYPE);\n this.setAnnualSales(annualSales);\n }", "@Override\n public double calculateSalary(){\n return this.horas_trabajadas*EmployeeByHours.VALOR_HORA;\n }", "Employee(String firstName, String lastName, String role) {\n\n\t\tthis.firstName = firstName;\n\t\tthis.lastName = lastName;\n\t\tthis.role = role;\n\t}", "public Employee(String proffesion) {\n\n this.name = rnd.randomCharName(8);\n this.surname = rnd.randomCharName(7);\n this.hourSalary = rnd.randomNumber(75,100);\n this.profession = proffesion;\n this.workingHour = WORKING_HOURS;\n this.moneyEarned = 0;\n this.moneyEarned = 0;\n this.isAbleTowork = true; \n }", "public void update(Employee e) {\n\t\t\r\n\t}", "public CommissionEmployee(String name, double monthlySales)\n {\n super(name);\n setMonthlySales(monthlySales);\n }", "public double getSalary() {\r\n return salary;\r\n }", "public Employee(){\r\n this(\"\", \"\", \"\", 0, \"\", 0.0);\r\n }", "@Override\n\tpublic void updateEmployee(List<Employee> employees) {\n\t\t\n\t}", "public Employee(int empID, String firstName, String lastName, int ssNum,\n Date hireDate, double salary) {\n if (Employee.setOfIDs.contains(empID) || !Employee.isPositive(empID)) {\n this.empID = Employee.generateID();\n } else {\n this.empID = empID;\n }\n Employee.sortType = SortType.SORT_BY_ID;\n Employee.setOfIDs.add(this.empID);\n this.firstName = firstName;\n this.lastName = lastName;\n this.ssNum = ssNum;\n this.hireDate = hireDate;\n this.salary = salary;\n }", "Employee(String name, String password) {\n if (checkName()) {\n setUsername(name);\n setEmail(name);\n } else {\n this.username = \"default\";\n this.email = \"[email protected]\";\n }\n\n if (isValidPassword()) {\n this.password = password;\n } else {\n this.password = \"pw\";\n }\n\n }", "@Override\n\tpublic void setEmpId(long empId) {\n\t\t_employee.setEmpId(empId);\n\t}", "public Employee(){\n this.employeeName = new String();\n this.employeeSalary = null;\n this.employeeProjectList = new ArrayList<String>();\n this.employeeDepartmentLead = new String();\n }", "public Fulltime(String employeeName, String deptCode, Date hireDate,\n\t\t\tdouble salary) {\n\t\tsuper(employeeName, deptCode, hireDate);\n\t\tthis.annualSalary = salary;\n\t}", "public void setAge(int age) { this.age = age; }" ]
[ "0.73213404", "0.7134039", "0.7113219", "0.7098836", "0.7098836", "0.68691456", "0.686526", "0.6809788", "0.68066376", "0.66174775", "0.6554571", "0.6523052", "0.6510273", "0.6488553", "0.64524287", "0.63939416", "0.63722193", "0.6306971", "0.628718", "0.6275631", "0.62441206", "0.6201606", "0.6181595", "0.6167394", "0.61481863", "0.61038214", "0.60608876", "0.6060323", "0.6047091", "0.6034666", "0.60202533", "0.6001554", "0.6001151", "0.60004026", "0.5988864", "0.59841645", "0.59521353", "0.59519243", "0.5950134", "0.5931785", "0.59249276", "0.5908225", "0.58921427", "0.5877178", "0.58672607", "0.5854265", "0.5853307", "0.5833279", "0.5827284", "0.5819753", "0.5808971", "0.5778397", "0.57614934", "0.57602125", "0.5757923", "0.57562053", "0.57499176", "0.57261723", "0.57203037", "0.56865007", "0.5684902", "0.56741107", "0.56741107", "0.5660377", "0.56367826", "0.56245273", "0.56230795", "0.55999494", "0.55989975", "0.5589848", "0.5583623", "0.5577436", "0.55652684", "0.55639774", "0.55627453", "0.5558674", "0.5551368", "0.55468285", "0.5542344", "0.5530645", "0.5513468", "0.5511746", "0.5507346", "0.55060077", "0.5489021", "0.5486866", "0.54866105", "0.54860336", "0.54852545", "0.5476466", "0.5461716", "0.5456414", "0.54556704", "0.545171", "0.54498345", "0.5449769", "0.54490054", "0.5424378", "0.54071563", "0.54046947" ]
0.6603711
10
Other Methods Save Employee in file Saves the user's information to the destination file.
@Override public void save(String fileName){ FileWriter addEmployeeDetails = null; try{ addEmployeeDetails = new FileWriter(fileName,true); addEmployeeDetails.append(getUsername()); addEmployeeDetails.append(System.getProperty("line.separator")); addEmployeeDetails.append(getPassword()); addEmployeeDetails.append(System.getProperty("line.separator")); addEmployeeDetails.append(getFirstname()); addEmployeeDetails.append(System.getProperty("line.separator")); addEmployeeDetails.append(getLastname()); addEmployeeDetails.append(System.getProperty("line.separator")); addEmployeeDetails.append(DMY.format(getDoB()));//format,convert,save addEmployeeDetails.append(System.getProperty("line.separator")); addEmployeeDetails.append(getContactNumber()); addEmployeeDetails.append(System.getProperty("line.separator")); addEmployeeDetails.append(getEmail()); addEmployeeDetails.append(System.getProperty("line.separator")); addEmployeeDetails.append(String.valueOf(getSalary())); addEmployeeDetails.append(System.getProperty("line.separator")); addEmployeeDetails.append(getPositionStatus()); addEmployeeDetails.append(System.getProperty("line.separator")); //************Saves the address in the file.**************** homeAddress.save(addEmployeeDetails); //********************************************************** addEmployeeDetails.append("$$$"); addEmployeeDetails.append(System.getProperty("line.separator")); addEmployeeDetails.close(); addEmployeeDetails = null; }//end try catch (IOException ioe){}//end catch }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static void WriteEmployeeObjectIntoFile(Employee emp,String filename)\n\t{\n\t\t\n\t try\n\t {\n\t FileOutputStream fileOut =\n\t new FileOutputStream(filename);\n\t ObjectOutputStream out = new ObjectOutputStream(fileOut);\n\t //Main write method\n\t out.writeObject(emp);\n\t out.close();\n\t fileOut.close();\n\t System.out.printf(\"Serialized data is saved in \" + filename);\n\t }catch(IOException i)\n\t {\n\t i.printStackTrace();\n\t }\n\t}", "private void saveEmployee(Employee employee) {\n ContentValues contentValues = new ContentValues();\n contentValues.put(ReportContract.EmployeeEntry.COLUMN_KEY, employee.getKey());\n contentValues.put(ReportContract.EmployeeEntry.COLUMN_VALUE, employee.getValue());\n\n getContext().getContentResolver().insert(\n ReportContract.EmployeeEntry.CONTENT_URI,\n contentValues\n );\n\n }", "@Override\r\n\tpublic void saveEmployee(Employee employee) {\n\t\t\r\n\t}", "private void saveEmployee()\n {\n Employee tempEmployee = new Employee();\n String line = \"\";\n try\n {\n PrintWriter out = new PrintWriter(fileName);\n for(int i = 0; i < employees.size(); i++)\n {\n tempEmployee = (Employee) employees.get(i);\n line = tempEmployee.getName() + \",\" + tempEmployee.getHours() + \",\" +\n tempEmployee.getRate();\n out.println(line);\n }\n out.close(); \n }\n catch(IOException ex)\n {\n ex.printStackTrace();\n }\n }", "@Override\n\tpublic void save(Employee theEmployee) {\n\t\t\n\t}", "public void saveAccount() {\r\n\t\t\r\n\t\tString[] emailParts = GID.split(\"@\");\r\n\t\t//Recover the file name\r\n\t\tString fileName = name + \"_\" + emailParts[0] + \"_\" + emailParts[1];\r\n\t\t\r\n\t try {\r\n\t //use buffering\r\n\t OutputStream file = new FileOutputStream( fileName );\r\n\t OutputStream buffer = new BufferedOutputStream( file );\r\n\t ObjectOutput output = new ObjectOutputStream( buffer );\r\n\t \r\n\t try {\r\n\t \toutput.writeObject(this);\r\n\t }\r\n\t finally {\r\n\t \toutput.close();\r\n\t }\r\n\t }\r\n\t \r\n\t catch(IOException ex){\r\n\t \t System.out.println(\"Cannot perform output.\");\r\n\t }\r\n\t}", "public void saveEmployee(Employe employee) {\n\t\t\n\t}", "public void writeStaffEntry(String firstName, String lastName, String userName)\r\n\t{\r\n\t\ttry \r\n\t\t{\r\n\t\t\tPrintWriter out = new PrintWriter(new FileWriter(\"StaffEntryRecords.txt\", true));\r\n\t\t\tout.println(\"First Name: \" +firstName);\r\n\t\t\tout.println(\"Last Name: \" +lastName);\r\n\t\t\tout.println(\"Username: \" +userName);\r\n\t\t\tout.println(\" \");\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.out.println(\"Error: Cannot open file for writing\");\r\n\t\t}\r\n\t\tcatch(IOException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Error: Cannot write to file\");\r\n\t\t}\r\n\t}", "public void saveUserName(String userName) throws Exception {\r\n\t\tSystem.out.println(\"writing name in file \"+userName);\r\n\t\tsetuName(userName);\r\n\t\tFileWriter fw = new FileWriter(filePath, true);\r\n\t BufferedWriter bw = new BufferedWriter(fw);\r\n\t PrintWriter out = new PrintWriter(bw);\r\n\t out.println(userName);\r\n\t out.close();\r\n\t\t\t\r\n\t}", "void save(Employee employee);", "public void saveEmployee(Employee emp){\n System.out.println(\"saved\" + emp);\n\n }", "@FXML\r\n\tpublic void saveNewAccount( ) {\r\n\t\t// Save user input\r\n\t\tString name = userName.getText( );\r\n\t\tString mail = email.getText( );\r\n\r\n\t\t// Call the to file method to write to data.txt\r\n\t\tUserToFile.toFile(name, pin, mail);\r\n\t\t\r\n\t\t// View the test after the info is saved\r\n\t\tviewTest( );\r\n\t}", "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 }", "private static void writeToFileEmployees() throws IOException {\n FileWriter write = new FileWriter(path2, append);\n PrintWriter print_line = new PrintWriter(write);\n for (int i = 0; i < RegisteredEmployees.listOfEmployees.size(); i++) {\n ArrayList<Integer> list = RegisteredEmployees.getEmployeeList();\n Integer ID = list.get(i);\n textLine = String.valueOf(ID);\n print_line.printf(\"%s\" + \"%n\", textLine);\n }\n print_line.close();\n }", "public void writeToEmployeeListFile()\r\n {\r\n\ttry(ObjectOutputStream toEmployeeListFile = \r\n new ObjectOutputStream(new FileOutputStream(\"listfiles/employeelist.dta\")))\r\n\t{\r\n toEmployeeListFile.writeObject(employeeList);\r\n employeeList.saveStaticEmpRunNr(toEmployeeListFile);\r\n\t}\r\n\tcatch(NotSerializableException nse)\r\n\t{\r\n JOptionPane.showMessageDialog(null, \"Ansatt objektene er ikke \"\r\n + \"serialiserbare.\\nIngen registrering på fil!\"\r\n + nse.getMessage(), \"Feilmelding\", \r\n JOptionPane.ERROR_MESSAGE);\r\n\t}\r\n\tcatch(IOException ioe)\r\n\t{\r\n JOptionPane.showMessageDialog(null, \"Det oppsto en feil ved skriving \"\r\n + \"til fil.\\n\" + ioe.getMessage());\r\n\t}\r\n }", "@Override\n\tpublic int saveEmployee() {\n\t\tEmployeeDao dao= new EmployeeDao();\n\t\tint result=dao.saveEmployee(new Employee(101349, \"Deevanshu\", 50000));\n\t\treturn result;\n\t}", "public void exportFile() {\n\t\ttry {\n\t\t\tFileWriter file_write = new FileWriter(\"accounts/CarerAccounts.txt\", false);\n\t\t\tString s = System.getProperty(\"line.separator\");\n\t\t\tfor (int i=0; i < CarerAccounts.size();i++) {\n\t\t\t\tString Users = new String();\n\t\t\t\tfor (int user: CarerAccounts.get(i).getUsers()) {\n\t\t\t\t\tUsers += Integer.toString(user) + \"-\";\n\t\t\t\t}\n\t\t\t\tString individual_user = CarerAccounts.get(i).getID() + \",\" + CarerAccounts.get(i).getUsername() + \",\" + CarerAccounts.get(i).getPassword() + \",\" + CarerAccounts.get(i).getFirstName() + \",\" + CarerAccounts.get(i).getLastName() + \",\" + CarerAccounts.get(i).getEmailAddress() + \",\" + Users;\n\t\t\t\tfile_write.write(individual_user + s);\n\t\t\t}\n\t\t\tfile_write.close();\n\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Unable to export file.\");\n\t\t}\n\t}", "public static void save() throws IOException {\n String output = Main.currentUser.toString();\n output += DatabaseTranslator.getUserLocations(currentUser.getName());\n DatabaseTranslator.storeUserData(currentUser.getName(), output);\n }", "public void saveFile(String theFileLocation){\r\n try {\r\n File fileArchive = new File(theFileLocation);\r\n if (!fileArchive.exists()){ //if there is no file then it creates a new file\r\n fileArchive.createNewFile();\r\n }\r\n FileWriter fW = new FileWriter(theFileLocation);\r\n BufferedWriter bW = new BufferedWriter(fW);\r\n \r\n for (int p = 0; p < buckets.length; p++){\r\n for (int i = 0; i < buckets[p].size(); i++){\r\n EmployeeInfo theEmployee = buckets[p].get(i);\r\n \r\n if (theEmployee instanceof FTE){\r\n bW.write(\"FTE\");\r\n bW.write(\"*\");\r\n } else {\r\n if (theEmployee instanceof PTE){\r\n bW.write(\"PTE\");\r\n bW.write(\"*\");\r\n } \r\n }\r\n // general for both\r\n bW.write(Integer.toString(theEmployee.getEmpNum()));;\r\n bW.write(\"*\");\r\n bW.write(theEmployee.getFirstName());\r\n bW.write(\"*\");\r\n bW.write(theEmployee.getLastName());\r\n bW.write(\"*\");\r\n bW.write(Integer.toString(theEmployee.getGender()));\r\n bW.write(\"*\");\r\n bW.write(Integer.toString(theEmployee.getWorkLoc()));\r\n bW.write(\"*\");\r\n bW.write(Integer.toString(theEmployee.getEmpRole()));\r\n bW.write(\"*\");\r\n bW.write(Double.toString(theEmployee.getDeductRate()));\r\n bW.write(\"*\");\r\n \r\n if (theEmployee instanceof FTE){\r\n FTE theFTE = (FTE) theEmployee;\r\n bW.write(Double.toString(theFTE.yearlySalary));\r\n\r\n } else {\r\n if (theEmployee instanceof PTE){\r\n PTE thePTE = (PTE) theEmployee;\r\n bW.write(Double.toString(thePTE.hourlyWage));\r\n bW.write(\"*\");\r\n bW.write(Double.toString(thePTE.hoursPerWeek));\r\n bW.write(\"*\");\r\n bW.write(Double.toString(thePTE.weeksPerYear));\r\n } \r\n }\r\n \r\n bW.newLine(); \r\n \r\n }\r\n \r\n }\r\n bW.write(\"$$$$$$$\");\r\n bW.close();\r\n }\r\n \r\n catch (IOException IOE){\r\n IOE.printStackTrace();\r\n }\r\n }", "@Override\n public void edit(){\n Integer Pointer=0;\n FileWriter editDetails = null;\n ArrayList<String> lineKeeper = saveText();\n\n /* Search into the list to find the Username, if it founds it, changes the\n * old information with the new information.\n * Search*/\n if(lineKeeper.contains(getUsername())){\n Pointer=lineKeeper.indexOf(getUsername());\n\n //Write the new information\n lineKeeper.set(Pointer+1, getPassword());\n lineKeeper.set(Pointer+2, getFirstname());\n lineKeeper.set(Pointer+3, getLastname());\n lineKeeper.set(Pointer+4, DMY.format(getDoB()));\n lineKeeper.set(Pointer+5, getContactNumber());\n lineKeeper.set(Pointer+6, getEmail());\n lineKeeper.set(Pointer+7, String.valueOf(getSalary()));\n lineKeeper.set(Pointer+8, getPositionStatus());\n Pointer=Pointer+9;\n homeAddress.edit(lineKeeper,Pointer);\n }//end if\n\n try{\n editDetails= new FileWriter(\"employees.txt\",false);\n for( int i=0;i<lineKeeper.size();i++){\n editDetails.append(lineKeeper.get(i));\n editDetails.append(System.getProperty(\"line.separator\"));\n }//end for\n editDetails.close();\n editDetails = null;\n }//end try\n catch (IOException ioe) {}//end catch\n }", "public static void save(Context context,User user){\n try\n {\n\n FileOutputStream fileOutputStream = context.openFileOutput(\"UserData.dat\", Context.MODE_PRIVATE);\n ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);\n objectOutputStream.writeObject(user);\n objectOutputStream.close();\n fileOutputStream.close();\n\n }\n\n catch(IOException ex) {\n System.out.println(\"IOException is caught\");\n }\n }", "public static void createUsername(Login newEmp) throws FileNotFoundException, IOException {\n\t\tString employeeUsername = \"\";\n\t\tdo {\n\t\t\temployeeUsername = JOptionPane.showInputDialog(\"Please enter a username.\");\n\t\t\tif (!newEmp.setUsername(employeeUsername)) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Wrong employee name, please try again\");\n\t\t\t}\n\t\t} while (!newEmp.setUsername(employeeUsername));\n\t\t/*\n\t\t Text file is stored in a source folder.\n\t\t */\n\t\tFileOutputStream fstream = new FileOutputStream(\"./src/Phase5/username.txt\", true);\n\t\tDataOutputStream outputFile = new DataOutputStream(fstream);\n\t\toutputFile.writeUTF(employeeUsername + \", \");\n\t\toutputFile.close();\n\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tJFileChooser chooser = new JFileChooser();\r\n\t\t\t\tint opt = chooser.showSaveDialog(null);\r\n\t\t\t\tif (opt == JFileChooser.APPROVE_OPTION) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tFile file = chooser.getSelectedFile();\r\n\t\t\t\t\tif (FilenameUtils.getExtension(file.getName()).equalsIgnoreCase(user)) {\r\n\t\t\t\t\t\t// filename is OK as-is\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfile = new File(file.toString() + \".\"+user);\r\n\t\t\t\t\t\tfile = new File(file.getParentFile(), FilenameUtils.getBaseName(file.getName()) + \".\"+user);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tFileOutputStream fo = new FileOutputStream(file);\r\n\t\t\t\t\t\tObjectOutputStream oos = new ObjectOutputStream(fo);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\toos.writeUTF(user);\r\n\t\t\t\t\t\toos.writeObject(StudentArray);\r\n\t\t\t\t\t\toos.writeObject(tab);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\toos.close();\r\n\t\t\t\t\t\tfo.close();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} catch (IOException e1) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}", "public void saveData() {\n try {\n JsonWriter jw = new JsonWriter(openFileOutput(DATA_FILE, Context.MODE_PRIVATE));\n jw.write(user);\n jw.close();\n } catch(Exception e) {\n Log.i(\"Exception :\", e.toString());\n }\n }", "public void saveUser(User user) {\n\t\tFile d = new File(\"users\");\n\t\t\n\t\tif (!d.exists() || !d.isDirectory()) {\n\t\t\td.mkdir();\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n\t\t\tDocumentBuilder builder = factory.newDocumentBuilder();\n\t\t\t//Document document = builder.parse(f);\n\t\t\t\n\t\t\tDocument document = builder.newDocument();\n\t\t\t\n\t\t\tElement root = document.createElement(\"User\");\n\t\t\tdocument.appendChild(root);\n\t\t\t\n\t\t\troot.setAttribute(\"username\", user.name);\n\t\t\troot.setAttribute(\"password\", user.password);\n\t\t\t\n\t\t\t//System.out.println(\"Save: \" + user.password);\n\t\t\t\n\t\t\tIterator i = user.record.entrySet().iterator();\n\t\t\t\n\t\t\twhile (i.hasNext()) {\n\t\t\t\tMap.Entry u = (Map.Entry)i.next();\n\t\t\t\tString name = (String)u.getKey();\n\t\t\t\tString record = (String)u.getValue();\n\n\t\t\t\tElement precord = document.createElement(\"Record\");\n\t\t\t\t\n\t\t\t\tprecord.setAttribute(\"username\", name);\n\t\t\t\tprecord.setTextContent(record);\n\t\t\t\troot.appendChild(precord);\n\t\t\t}\n\t\t\t\n\t\t\tTransformerFactory tfactory = TransformerFactory.newInstance();\n\t\t\tTransformer transformer = tfactory.newTransformer();\n\t\t\tDOMSource source = new DOMSource(document);\n\t\t\tStreamResult result = new StreamResult(new File(\"users/\" + user.name + \".xml\"));\n\t\t\ttransformer.transform(source, result);\n\t\t} catch (ParserConfigurationException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (TransformerConfigurationException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (TransformerException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void saveAs() {\n writeFile.Export();\n }", "@Override\n\tpublic void save(Employee employee) {\n\t\temployeeDao.save(employee);\n\t\t\n\t}", "private void saveFile() {\n\t\ttry {\n\t\t\tFile file = jfc.getSelectedFile();\n\t\t\tint c = -1;\n\t\t\tif(file==null)\n\t\t\t{\n\t\t\t\tc = jfc.showSaveDialog(this);\n\t\t\t}\n\t\t\t\n\n\t\t\tif(file!= null || c ==0)\n\t\t\t{\t\n\t\t\t\tFileWriter fw = new FileWriter(jfc.getSelectedFile());\n\t\t\t\tfw.write(jta.getText());\n\t\t\t\tfw.close();\n\t\t\t\tSystem.out.println(\"파일을 저장하였습니다\");\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t\t\n\t\t} catch (Exception e2) {\n\t\t\t// TODO: handle exception\n\t\t\tSystem.out.println(e2.getMessage());\n\t\t}\n\t}", "private void save() {\n File personFile = mainApp.getFilmFilePath();\n if (personFile != null) {\n mainApp.saveFilmDataToFile(personFile);\n } else {\n saveAs();\n }\n }", "public void save() throws FileNotFoundException, IOException, ClassNotFoundException ;", "public static void save() {\n\t\t// Save each user \n\t\t// and list of directories \n\t\t// and files in each directory\n\t\tArrayList<String> usernames = getRegisteredUserNames();\n\t\tUtils.FileUtils.write(\n\t\t\t\tusernames, \n\t\t\t\tGlobal.Constants.LIST_OF_USERS\n\t\t\t\t);\t\n\t\tfor (User user:Global.Variables.registeredUsers) {\n\t\t\tUtils.FileUtils.write(\n\t\t\t\tuser.getDirectoryNames(), \n\t\t\t\tGlobal.Constants.DIRECTORY_LOCATION + user.getName()\n\t\t\t\t);\n\t\t\tsave(user);\n\t\t}\n\t}", "private void saveDataToFile() {\n boolean isLoggedInNew = na.isLoggedIn();\n boolean isLoggedIn = uL.isLoggedIn();\n // path for new accounts after sucsessful new account creation\n if (isLoggedInNew) {\n String username = na.getUsername();\n String fileExt = \"_data.txt\";\n String workingDirectory = System.getProperty(\"user.dir\");\n String filePath = workingDirectory + \"\\\\\" + username + fileExt;\n File file = new File(filePath);\n try {\n try (FileWriter fw = new FileWriter(file);\n BufferedWriter bw = new BufferedWriter(fw)) {\n for (int i = 0; i < remindersTable.getRowCount(); i++) { // rows\n for (int j = 0; j < remindersTable.getColumnCount(); j++) { // cols\n bw.write(remindersTable.getValueAt(i, j).toString() + \"\\t\");\n }\n bw.newLine();\n }\n }\n } catch (IOException ex) {\n Logger.getLogger(MoneyMinderDesktopMainGui.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n // path for existing accounts after sucsessful login\n if (isLoggedIn) {\n String username = uL.getUsername();\n String fileExt = \"_data.txt\";\n String workingDirectory = System.getProperty(\"user.dir\");\n String filePath = workingDirectory + \"\\\\\" + username + fileExt;\n File file = new File(filePath);\n try {\n try (FileWriter fw = new FileWriter(file);\n BufferedWriter bw = new BufferedWriter(fw)) {\n for (int i = 0; i < remindersTable.getRowCount(); i++) { // rows\n for (int j = 0; j < remindersTable.getColumnCount(); j++) { // cols\n bw.write(remindersTable.getValueAt(i, j).toString() + \"\\t\");\n }\n bw.newLine();\n }\n }\n } catch (IOException ex) {\n Logger.getLogger(MoneyMinderDesktopMainGui.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }", "@FXML\r\n\tprivate void saveEmployee(ActionEvent event) {\r\n\t\tif (validateFields()) {\r\n\t\t\tEmployee e;\r\n\t\t\tif (newEmployee) {\r\n\t\t\t\te = new Employee();\r\n\t\t\t\tlistaStaff.getItems().add(e);\r\n\t\t\t} else {\r\n\t\t\t\te = listaStaff.getSelectionModel().getSelectedItem();\r\n\t\t\t}\r\n\t\t\te.setUsername(txUsuario.getText());\r\n\t\t\te.setPassword(txPassword.getText());\r\n\t\t\tif (checkAdmin.isSelected())\r\n\t\t\t\te.setIsAdmin(1);\r\n\t\t\telse\r\n\t\t\t\te.setIsAdmin(0);\r\n\t\t\tif (checkTPV.isSelected())\r\n\t\t\t\te.setTpvPrivilege(1);\r\n\t\t\telse\r\n\t\t\t\te.setTpvPrivilege(0);\r\n\t\t\tif (newEmployee) {\r\n\t\t\t\tservice.saveEmployee(e);\r\n\t\t\t\tnewEmployee = false;\r\n\t\t\t} else\r\n\t\t\t\tservice.updateEmployee(e);\r\n\t\t\tbtGuardar.setDisable(true);\r\n\t\t\tbtEditar.setDisable(false);\r\n\t\t\tconmuteFields();\r\n\t\t\tupdateList();\r\n\t\t}\r\n\t}", "@Override\n\tpublic Employee saveEmployee(Employee emp) {\n\t\tlog.debug(\"EmplyeeService.saveEmployee(Employee emp) save Employee object\");\n\t\treturn repositary.save(emp);\n\t}", "public void saveUsers() {\n\t\ttry {\n\t\t\t\n\t\t\tFile xmlFile = new File(\"Users.xml\");\n\t\t\tDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n\t\t\tDocumentBuilder builder = factory.newDocumentBuilder();\n\t\t\tDocument document = builder.parse(xmlFile);\n\t\t\tElement users = document.getDocumentElement();\n\t\t\t\n\t\t\tArrayList<Student> u = ManageUsers.getActiveList();\n\t\t\tfor (int i = 0; i < u.size(); i++) {\n\t\t\t\t// Grab the info for a specific student\n\t\t\t\tStudent s = u.get(i);\n\t\t\t\tString fName = s.getFirstName();\n\t\t\t\tString lName = s.getLastName();\n\t\t\t\tint ucid = s.getUcid();\n\t\t\t\tint currentBorrowing = s.getCurrentBorrowing();\n\t\t\t\tboolean isActive = true;\n\t\t\t String username = s.getUsername();\n\t\t\t String password = s.getPassword();\n\t\t\t boolean isLibrarian = s.getIsLibrarian();\n\t\t\t \n\t\t\t Element student = document.createElement(\"student\");\n\t\t\t \n\t\t\t // Make a new element <student>\n\t\t\t // Add the element to the xml as a child of <Users>\n\t\t\t // Add the above fields (fName, etc.) as child nodes to the new student node\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Something went wrong with writing to the xml\");\n\t\t\tSystem.out.println(e);\n\t\t}\n\t}", "public void addToFile(User newUser){\r\n //If the user name is not already in the file then we do not want to re-add the user.\r\n if (f.searchForUsername(newUser.getUsername()) == -1) {\r\n newUser.setPassword(encrypt(newUser.getPassword()));\r\n f.write(newUser);\r\n } else {\r\n System.err.println(\"User already exists\");\r\n }\r\n }", "public String toFile(){\n\t\tString personInfo = this.firstName + \" ; \" + this.lastName + \" ; \";\n\t\t\n\t\treturn personInfo;\n\t}", "public static void writeUser(String file, User user) {\r\n try (ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(file + \".ser\"))) {\r\n out.writeObject(user);\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "private void saveEmployee() {\n // Read from input fields\n // Use trim to eliminate leading or trailing white space\n String nameString = mNameEditText.getText().toString().trim();\n String addressString = mAddressEditText.getText().toString().trim();\n String numberString = mNumberEditText.getText().toString().trim();\n String birthDateString = mBirthTextView.getText().toString().trim();\n\n // Check if this is supposed to be a new pet\n // and check if all the fields in the editor are blank\n if (mCurrentPetUri == null &&\n TextUtils.isEmpty(nameString) &&\n mImagePath.isEmpty()) {\n // Since no fields were modified, we can return early without creating a new pet.\n // No need to create ContentValues and no need to do any ContentProvider operations.\n return;\n }\n\n // Create a ContentValues object where column names are the keys,\n // and employee attributes from the editor are the values.\n ContentValues values = new ContentValues();\n values.put(EmployeeEntry.COLUMN_EMPLOYEE_NAME, nameString);\n values.put(EmployeeEntry.COLUMN_EMPLOYEE_ADDRESS, addressString);\n values.put(EmployeeEntry.COLUMN_EMPLOYEE_BIRTH_DAY, birthDateString);\n\n values.put(EmployeeEntry.COLUMN_EMPLOYEE_PHOTOS, mImagePath);\n\n // If the number is not provided by the user, don't try to parse the string into an\n // integer value. Use 0 by default.\n int number = 0;\n if (!TextUtils.isEmpty(numberString)) {\n number = Integer.parseInt(numberString);\n }\n values.put(EmployeeEntry.COLUMN_EMPLOYEE_NUMBER, number);\n\n // Determine if this is a new or existing pet by checking if mCurrentPetUri is null or not\n if (mCurrentPetUri == null) {\n // This is a NEW employee, so insert a new employee into the provider,\n // returning the content URI for the new pet.\n Uri newUri = getContentResolver().insert(EmployeeEntry.CONTENT_URI, values);\n\n // Show a toast message depending on whether or not the insertion was successful.\n if (newUri == null) {\n // If the new content URI is null, then there was an error with insertion.\n Toast.makeText(this, getString(R.string.editor_insert_employee_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the insertion was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_insert_employee_successful),\n Toast.LENGTH_SHORT).show();\n }\n } else {\n // Otherwise this is an EXISTING pet, so update the pet with content URI: mCurrentPetUri\n // and pass in the new ContentValues. Pass in null for the selection and selection args\n // because mCurrentPetUri will already identify the correct row in the database that\n // we want to modify.\n int rowsAffected = getContentResolver().update(mCurrentPetUri, values, null, null);\n\n // Show a toast message depending on whether or not the update was successful.\n if (rowsAffected == 0) {\n // If no rows were affected, then there was an error with the update.\n Toast.makeText(this, getString(R.string.editor_update_employee_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the update was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_update_employee_successful),\n Toast.LENGTH_SHORT).show();\n }\n }\n }", "public static void SaveUser(StandardUserModel user, Context context) {\n\t\tfilename = userprofile;\n\t\tString modelJson = gson.toJson(user);\n\t\t\n\t\twriteuser(modelJson, context);\n\t}", "private static void saveFile(Sheet sheet) throws IOException {\r\n File newFile = new File(\"evidence.ods\");\r\n sheet.getSpreadSheet().saveAs(newFile);\r\n }", "public void saveNewRollManager()\n\t{\n\t JFileChooser chooser = new JFileChooser(); //allows the user to choose a file\n\t chooser.setCurrentDirectory(new File(\"/home/me/Documents\"));\t//sets the directory of where to find the file\n\t int retrival = chooser.showSaveDialog(null);\n\t if (retrival == JFileChooser.APPROVE_OPTION) {\n\t try \n\t {\n\t FileWriter fw = new FileWriter(chooser.getSelectedFile()+\".txt\");\n\t fw.write (getCourseToFileString ( ));\n\t for(Student b : getStudents ( ))\t \t\n\t \tfw.write(b.toFileString ( ));\n\t \tfw.close ( );\n\t \t;\n\t } \n\t catch (Exception ex) \n\t {\n\t ex.printStackTrace();\n\t }\n\t\t\tthis.saveNeed = false;\n\n\t }\n\t \n\t}", "public void guardar(Empleado e){\r\n \r\n //Para serializar el primer paso es generar el archivo fisico donde\r\n //estara nuestro objto de tipo usuario\r\n\r\n File file=new File(\"Empleados.yo\");\r\n \r\n //Despues lo abrimos para escribir sobre el \r\n if(file.exists()){\r\n empleado=buscarTodos();\r\n }\r\n try{\r\n FileOutputStream fos=new FileOutputStream(file);\r\n \r\n //Luego serializamos\r\n ObjectOutputStream oos=new ObjectOutputStream(fos);\r\n \r\n //Guardamos nuestro usuario\r\n empleado.add(e);\r\n oos.writeObject(empleado);\r\n \r\n //Ponemos un mensaje\r\n System.out.println(\"Objeto guardado con exito\");\r\n \r\n }catch (Exception e){\r\n System.out.println(e.getMessage());\r\n }\r\n }", "public void saveUsers() {\n FileWriter fileWriter = null;\n PrintWriter printWriter = null;\n try {\n fileWriter = new FileWriter(pathData);\n printWriter = new PrintWriter(fileWriter);\n if (users != null) {\n \n for (Map.Entry m : users.entrySet()) {\n printWriter.println(m.getKey() + spChar + m.getValue() + \"\\n\");\n }\n }\n printWriter.close();\n } catch (IOException e) {\n }\n }", "public void saveToFile()\n\t{\t\n\t\tsetCourseToFileString(courseToFileString);\n\t\t\ttry \n\t {\n\t FileWriter fw = new FileWriter(fileName);\n\t fw.write (this.getCourseToFileString ( ));\n\t for(Student b : this.getStudents ( ))\t \t\n\t \tfw.write(b.toFileString ( ));\n\t \tfw.close ( );\n\t } \n\t catch (Exception ex) \n\t {\n\t ex.printStackTrace();\n\t }\n\t\t\tthis.saveNeed = false;\n\n\t}", "public void save(String fileName) throws IOException;", "public void saveFile(boolean answer) {\n if (answer) {\n userController.saveUserToFile();\n }\n }", "private void saveFile(final FileMessage fm) {\n FileChooser fileChooser = new FileChooser();\n fileChooser.setInitialFileName(fm.getFilename());\n FileChooser.ExtensionFilter extFilter;\n extFilter = new FileChooser.ExtensionFilter(\"Any files (*.*)\", \"*.*\");\n fileChooser.getExtensionFilters().add(extFilter);\n File dest = fileChooser.showSaveDialog(this);\n if (dest != null) {\n try {\n Files.write(\n Paths.get(\n String.valueOf(dest)),\n fm.getData(),\n StandardOpenOption.CREATE);\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }\n }", "public abstract void saveToFile(PrintWriter out);", "public void saveOrUpdateProfile(){\n try {\n \n if(PersonalDataController.getInstance().existRegistry(username)){\n PersonalDataController.getInstance().update(username, staff_name, staff_surname, \n Integer.parseInt(id_type), \n id_number, imagePic, phone_number, mobile_number, email, birthdate, \n Integer.parseInt(gender), birthdate);\n }else{\n PersonalDataController.getInstance().create(username, staff_name, staff_surname, \n Integer.parseInt(id_type), \n id_number, imagePic, phone_number, mobile_number, email, birthdate, \n Integer.parseInt(gender));\n }\n } catch (GB_Exception ex) {\n LOG.error(ex);\n GBMessage.putMessage(GBEnvironment.getInstance().getError(32), null);\n }\n GBMessage.putMessage(GBEnvironment.getInstance().getError(33), null);\n }", "public void saveFile(){\n returnValue = this.showSaveDialog(null);\n if (returnValue == JFileChooser.APPROVE_OPTION) {\n new CustomerFileWriter(new File(this.getSelectedFile().getAbsolutePath())).saveCustomer(Bank.customer);\n }\n }", "public void writeFile() {\n try {\n FileWriter writer = new FileWriter(writeFile, true);\n writer.write(user + \" \" + password);\n writer.write(\"\\r\\n\"); // write new line\n writer.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n \n }", "private void saveEntity(E entity){\n try (BufferedWriter bw = new BufferedWriter(new FileWriter(this.fileName, true))) {\n bw.write(entity.toFile());\n bw.newLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void saveUserDetails()\r\n\t{\r\n\t\t/*\r\n\t\t * Retrieve content from form\r\n\t\t */\r\n\t\tContentValues reg = new ContentValues();\r\n\r\n\t\treg.put(UserdataDBAdapter.C_NAME, txtName.getText().toString());\r\n\r\n\t\treg.put(UserdataDBAdapter.C_USER_EMAIL, txtUserEmail.getText()\r\n\t\t\t\t.toString());\r\n\r\n\t\treg.put(UserdataDBAdapter.C_RECIPIENT_EMAIL, lblAddressee.getText()\r\n\t\t\t\t.toString());\r\n\r\n\t\tif (rdbKilo.isChecked())\r\n\t\t{\r\n\t\t\treg.put(UserdataDBAdapter.C_USES_METRIC, 1);\t// , true\r\n\t\t}\r\n\t\telse\r\n\t\t\tif (rdbPound.isChecked())\r\n\t\t\t{\r\n\t\t\t\treg.put(UserdataDBAdapter.C_USES_METRIC, 0);\t// , false\r\n\t\t\t}\r\n\r\n\t\t/*\r\n\t\t * Save content into database source:\r\n\t\t * http://stackoverflow.com/questions/\r\n\t\t * 9212574/calling-activity-methods-from-fragment\r\n\t\t */\r\n\t\ttry\r\n\t\t{\r\n\t\t\tActivity parent = getActivity();\r\n\r\n\t\t\tif (parent instanceof LauncherActivity)\r\n\t\t\t{\r\n\t\t\t\tif (arguments == null)\r\n\t\t\t\t{\r\n\t\t\t\t\t((LauncherActivity) parent).getUserdataDBAdapter().insert(\r\n\t\t\t\t\t\t\treg);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\treg.put(UserdataDBAdapter.C_ID, arguments.getInt(\"userId\"));\r\n\r\n\t\t\t\t\t((LauncherActivity) parent).getUserdataDBAdapter().update(\r\n\t\t\t\t\t\t\treg);\r\n\r\n\t\t\t\t\t((LauncherActivity) parent).queryForUserDetails();\r\n\t\t\t\t}\r\n\t\t\t\tToast.makeText(parent, \"User details successfully stored\",\r\n\t\t\t\t\t\tToast.LENGTH_LONG).show();\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (SQLException e)\r\n\t\t{\r\n\t\t\tLog.i(this.getClass().toString(), e.getMessage());\r\n\t\t}\r\n\t}", "public void save(){\n\t\t\n\t\ttry {\n\t\t\t\t \n\t\t\t// Open Streams\n\t\t\tFileOutputStream outFile = new FileOutputStream(\"user.ser\");\n\t\t\tObjectOutputStream outObj = new ObjectOutputStream(outFile);\n\t\t\t\t \n\t\t\t// Serializing the head will save the whole list\n\t\t\toutObj.writeObject(this.head);\n\t\t\t\t \n\t\t\t// Close Streams \n\t\t\toutObj.close();\n\t\t\toutFile.close();\n\t\t}\n\n\t\tcatch(Exception e) {\n\t\t\tSystem.out.println(\"Error saving\");\n\t\t}\n\t\t\t\n\t}", "public void saveOnClick(View view) {\n final EditText nameET = (EditText) findViewById(R.id.name_et);\n final EditText titleET = (EditText) findViewById(R.id.title_et);\n final EditText emailET = (EditText) findViewById(R.id.email_et);\n final EditText addressET = (EditText) findViewById(R.id.address_et);\n user.setName(nameET.getText().toString());\n user.setTitle(titleET.getText().toString());\n user.setEmailAddress(emailET.getText().toString());\n user.setHomeAddress(addressET.getText().toString());\n\n RegistrationData.editUserData(db, user);\n finish();\n }", "void save(String fileName);", "@FXML\n\tpublic void saveFile() {\n\t\tif (file == null) {\n\t\t\tFileChooser saveFileChooser = new FileChooser();\n\t\t\tsaveFileChooser.setInitialDirectory(userWorkspace);\n\t\t\tsaveFileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter(\"Text doc(*.txt)\", \"*.txt\"));\n\t\t\tfile = saveFileChooser.showSaveDialog(ap.getScene().getWindow());\n\t\t}\n\n\t\tif (file.getName().endsWith(\".txt\")) {\n\t\t\ttry {\n\t\t\t\tfilePath = file.getAbsolutePath();\n\t\t\t\tStage primStage = (Stage) ap.getScene().getWindow();\n\t\t\t\tprimStage.setTitle(filePath);\n\t\t\t\tTab tab = tabPane.getSelectionModel().getSelectedItem();\n\t\t\t\ttab.setId(filePath);\n\t\t\t\ttab.setText(file.getName());\n\n\t\t\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(file));\n\t\t\t\tPrintWriter output = new PrintWriter(writer);\n\t\t\t\toutput.write(userText.getText());\n\t\t\t\toutput.flush();\n\t\t\t\toutput.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(file.getName() + \" has no valid file-extenstion.\");\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t}", "public static void writeUserFile(String fileToWriteTo, String info) throws IOException\n\t{\n\t\tFileWriter write = new FileWriter(fileToWriteTo, true);\n\t\twrite.write(info);\n\t\twrite.close();\n\t}", "@Override\r\n\tpublic String AddEmployeeDetails(EmployeeEntity employee) throws CustomException {\n\t\tString strMessage=\"\";\r\n\t\trepository.save(employee);\r\n\t\tstrMessage=\"Employee data has been saved\";\r\n\t\treturn strMessage;\r\n\t}", "public void SaveFile(String filePath) throws IOException {\r\n\t\tif (students == null) {\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Please load a roster before saving a file\", \"Error\", 2);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tString fileContents = \"ID,First Name,Last Name,Program,Level,ASURITE\";\r\n\t\tfor (int i=0; i<dates.size(); i++) {\r\n\t\t\tfileContents += \",\" + dates.get(i);\r\n\t\t}\r\n\t\tfileContents += \"\\n\";\r\n\t\t\r\n\t\tfor (int i=0; i<students.size(); i++) {\r\n\t\t\tfileContents+=students.get(i).toString();\r\n\t\t\tfor (int j=0; j<dates.size(); j++) {\r\n\t\t\t\tfileContents+=\",\" + students.get(i).getAttendance().get(j);\r\n\t\t\t}\r\n\t\t\tfileContents+=\"\\n\";\r\n\t\t}\r\n\t\t\r\n\t\tfilePath+=\".csv\";\r\n\t\tFileWriter myFile = new FileWriter(filePath); \r\n\t\tmyFile.write(fileContents);\r\n\t\tmyFile.close();\r\n\t\tJOptionPane.showMessageDialog(null, \"File written successfully!\", \"Success\", 1);\r\n\t}", "public void writeData(UserInfo info)\n\t{\n\t\tSystem.out.println(\"file has been written!\");\n\t\tuserinfos.add(info);\n\t}", "void saveUserData(User user);", "EmployeeDetail save(EmployeeDetail detail) throws DBException;", "private static void newEmployee(UserType employeeType) {\n\n\t\tString username = null, password;\n\n\t\tboolean valid = false;\n\n\t\t// make sure that the username is not already taken\n\t\twhile (!valid) {\n\t\t\tSystem.out.print(\"What username would you like for your account? \");\n\t\t\tusername = input.nextLine();\n\t\t\tif (nameIsTaken(username, customerList)) {\n\t\t\t\tSystem.out.println(\"Sorry but that username has already been taken.\");\n\t\t\t} else\n\t\t\t\tvalid = true;\n\t\t}\n\t\t// set valid to false after each entry\n\t\tvalid = false;\n\n\t\tSystem.out.print(\"What password would you like for your account? \");\n\t\tpassword = input.nextLine();\n\n\t\tEmployee e = new Employee(username, password);\n\n\t\te.setType(employeeType);\n\t\temployeeList.add(e);\n\t\tcurrentUser = e;\n\t\twriteObject(employeeFile, employeeList);\n\t\temployeeDao.create(e);\n\t}", "private static void saveChanges() throws IOException{\n\t\twriteToStudentsFile(); //copy all the StudentDetails objects in ALL_STUDENTS and write them to the students.txt file\n\t\twriteToBooksFile(); //copy all the BookDetails objects in ALL_BOOKS and write them to the books.txt file\n\t\tSystem.out.println(\"All Changes Successfully Saved!\");\n\t\tSystem.out.println(\"Thanks for using the Library Management System\");\n\t}", "@Override\n\tpublic void save(Employee employee) {\n\t\tSession currentSession = entityManager.unwrap(Session.class);\n\t\t\n\t\t// Save an Employee\n\t\tcurrentSession.saveOrUpdate(employee);\n\t\t\n\t}", "public void save() {\n\t\tWriteFile data = new WriteFile( this.name + \".txt\" );\n\t\ttry {\n\t\t\t data.writeToFile(this.toString());\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tSystem.out.println(\"Couldn't print to file\");\n\t\t}\n\t}", "public void saveAs() {\n editorManager.currentFileManager().saveAs();\n mimaUI.fileChanged();\n }", "private void saveFile() {\n if (fileExisted == false) {\n JFileChooser fChoice = new JFileChooser();\n int choice = fChoice.showSaveDialog(this);\n if (choice == JFileChooser.APPROVE_OPTION) {\n File f = fChoice.getSelectedFile();\n //\n if(!f.getName().contains(\".txt\")){\n File fN=new File(f.getParent(), f.getName()+\".txt\");\n FileDAO.writeFile(fN, txtContent);\n fMain = fN;\n fileExisted = true;\n lastSave=true;\n this.setTitle(fN.getName());\n }\n else{\n \n FileDAO.writeFile(f, txtContent);\n fMain = f;\n fileExisted = true;\n lastSave=true;\n this.setTitle(f.getName());\n } \n \n }\n } else if (fileExisted == true) {\n FileDAO.writeFile(fMain, txtContent);\n lastSave=true;\n }\n\n }", "void addNewAccountToFile(Account newAccount);", "public void save(Employee employee) {\n String objectStr = MyUtils.serializeIntoAString(employee);\n Connection connection = null;\n Statement stmt = null;\n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n connection = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/MyDB\", \"root\", \"password\");\n stmt = connection.createStatement();\n stmt.execute(\"INSERT INTO EMPLOYEE VALUES(\" + objectStr + \")\");\n } catch (SQLException | ClassNotFoundException throwables) {\n throwables.printStackTrace();\n }\n }", "public void save(File file) {\n //new FileSystem().saveFile(addressBook, file);\n }", "@Override\n\tpublic void save() {\n\t\t\n\t\tFile savingDirectory = new File(savingFolder());\n\t\t\n\t\tif( !savingDirectory.isDirectory() ) {\n\t\t\tsavingDirectory.mkdirs();\n\t\t}\n\t\t\n\t\t\n\t\t//Create the file if it's necessary. The file is based on the name of the item. two items in the same directory shouldn't have the same name.\n\t\t\n\t\tFile savingFile = new File(savingDirectory, getIdentifier());\n\t\t\n\t\tif( !savingFile.exists() ) {\n\t\t\t\n\t\t\ttry {\n\t\t\t\tsavingFile.createNewFile();\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"the following item couldn't be saved: \" + getIdentifier());\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\n\t\t}\n\n\t\t\n\t\t//generate the savingTextLine and print it in the savingFile. the previous content is erased when the PrintWriter is created.\n\t\t\n\t\tString text = generateSavingTextLine();\n\n\t\ttry {\n\t\t\tPrintWriter printer = new PrintWriter(savingFile);\n\t\t\tprinter.write(text);\t\t\t\n\t\t\tprinter.close();\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t\tsave();\n\t\t} \n\t}", "private void writeToFile(E entity){\n try (BufferedWriter bw = new BufferedWriter(new FileWriter(this.fileName,true))) {\n bw.write(entity.toFile());\n bw.newLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static void storeDataIntoFile() {\n\r\n try {\r\n FileWriter writer = new FileWriter(\"DetailsOfVaccination.txt.txt\");\r\n writer.write(\"Vaccination booth info - First names-\" + Arrays.toString(firstName)); //Write the patients first name\r\n writer.write(\"\\n Patient's surnames - \" + Arrays.toString(surname)); //Write the patients surname\r\n writer.write(\"\\n Number of remaining vaccines = \" + vaccines); //Write the remaining of vaccines in stock\r\n writer.close();\r\n System.out.println(\"Successfully stored data into the file.\");\r\n }\r\n catch (IOException e) { //Runs if there was an error in file\r\n System.out.println(\"An error occurred while storing data into the file. Please try again.\");\r\n e.printStackTrace(); //Tool used to handle exceptions and errors (gives the line number and class name where exception happened)\r\n }\r\n }", "@Override\n\tpublic void addEmployee(Employee employee) {\n\t\tem.getTransaction().begin();\n\t\tem.persist(employee);\n\t\tem.getTransaction().commit();\n\t\tSystem.out.println(\"Data Added successfully\");\n\t\tlogger.log(Level.INFO, \"Data Added successfully\");\n\n\t}", "public void save(String dataname, String username) throws IOException {\n List<String> outlines = newpairs.stream().map(p -> p.getFirst() + \"\\t\" + p.getSecond()).collect(toList());\n LineIO.write(getUserDictPath(dataname, username), outlines);\n }", "@Override\n public void delete(){\n Integer Pointer=0;\n FileWriter editDetails = null;\n ArrayList<String> lineKeeper = saveText();\n\n if(lineKeeper.contains(getUsername())){\n Pointer=lineKeeper.indexOf(getUsername());\n Pointer=Pointer-1;\n for(int i=1;i<=8;i++){\n lineKeeper.remove(Pointer+1);\n }//end for\n homeAddress.delete(lineKeeper);\n }\n try{\n editDetails= new FileWriter(\"employees.txt\",false);\n for( int i=0;i<lineKeeper.size();i++){\n editDetails.append(lineKeeper.get(i));\n editDetails.append(System.getProperty(\"line.separator\"));\n }//end for\n editDetails.close();\n editDetails = null;\n }//end try\n catch (IOException ioe) {}//end catch\n }", "public void saveUserDirectory(String fileName) {\n\t\ttry {\n\t\t\tUserRecordIO.writeUserRecords(fileName, users);\n\t\t} catch (IOException e) {\n\t\t\tthrow new IllegalArgumentException(\"Unable to write to file \" + fileName);\n\t\t}\n\t}", "@Override\n public void saveFile(Object o, File file, String ext)\n throws IOException {\n dest = file;\n }", "public void\tsaveAccounts() throws IOException;", "@Transactional\n\t\tpublic void saveEmployee(EmployeeEntity employeeEntity) {\n\t\t\temployeedao.saveEmployee(employeeEntity);\n\t\t}", "public void actionPerformed(ActionEvent arg0) { // method called when the button is clicked\n\n FileWriter fw; // create variable for the FileWriter which writes to the file\n //catch for empty unfilled textfields\n if (!txtLogin.getText().isEmpty() || !passwordField.getText().isEmpty() || !confirmPasswordField.getText().isEmpty() || !txtEmail.getText().isEmpty()) {\n if (passwordField.getText().equals(confirmPasswordField.getText())) {\n Pattern p = Pattern.compile(\"^[_A-Za-z0-9-\\\\+]+(\\\\.[_A-Za-z0-9-]+)*@\"\n + \"[A-Za-z0-9-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\"); // Rejex which checks for a valid email address\n Matcher m = p.matcher(txtEmail.getText()); //Tries to match the input email to check whether it is a valid email coapturing all required aspects\n\n if (m.find()) { // when mathcer finds the email valid proceed below\n try {\n fw = new FileWriter(\"src//SandwichShop//users.txt\", true); // Assign the FileWriter fw to a file\n fw.write(txtLogin.getText() + \" \" + passwordField.getText() + \" \" + txtEmail.getText() + \" \\r\\n\"); // Write user details to the file\n fw.close(); //close the FileWriter\n } catch (IOException e1) {\n e1.printStackTrace();\n }\n JOptionPane.showMessageDialog(null, \"Registration completed successfully!\");\n } else {\n JOptionPane.showMessageDialog(null, \"Enter correct E-mail, please.\");\n }\n } else {\n JOptionPane.showMessageDialog(null, \"\\\"Password\\\" field and \\\"Confirm Password\\\" field not match\");\n }\n } else {\n JOptionPane.showMessageDialog(null, \"One or more fields are empty!\");\n }\n }", "@Override\n\tpublic void save(Account userForm) {\n\t\taccount.save(userForm);\n\n\t}", "@Override\n\tpublic void save(Object o, String file) {\n\t\t\n\t}", "void saveAdditionalInformation(UserDTO userDTO);", "private void saveUserInformation() {\n name.setText(nameInput.getText().toString());\n\n if (name.getText().toString().isEmpty()) {\n name.setError(\"Name required\");\n name.requestFocus();\n return;\n }\n\n FirebaseUser user = mAuth.getCurrentUser();\n if (user != null) {\n if (isBname()) {\n updateName(user);\n }\n if (isBtitle()) {\n updateTitle(user);\n }\n }\n }", "@Override\n\tpublic void doSaveAs() {\n\n\t}", "public void persist() throws PersistenceException, ValidationException {\r\n\t\tPortalExtraInfo pei = PortalUtil.loadPortalExtraInfo(null, null, \"photoroster\");\r\n\t\tExtraInfo ei = pei.getExtraInfo();\r\n\t\tei.setValue(\"remoteLocal\", getRemoteLocal());\r\n\t\tei.setValue(\"enableInstructorUpload\", getEnableInstructorUpload());\r\n\r\n\t\tei.setValue(\"filePath\", getFilePath());\r\n\t\tei.setValue(\"fileDirectory\", getFileDirectory());\r\n\t\tei.setValue(\"remoteURLRoot\", getRemoteURLRoot());\r\n\t\tei.setValue(\"localURLRoot\", getLocalURLRoot());\r\n\t\tei.setValue(\"filenameID\", getFilenameID());\r\n\t\tei.setValue(\"scalePhotos\", getScalePhotos());\r\n\t\tei.setValue(\"scaledPhotoExtents\", getScaledPhotoExtents());\r\n\t\tei.setValue(\"photoCheck\", getPhotoCheck());\r\n\t\tei.setValue(\"allowableCourseRoles\", getAllowableCourseRoles());\r\n\t\tei.setValue(\"doneOnce\", \"y\");\r\n\r\n\t\tPortalUtil.savePortalExtraInfo(pei);\r\n\t}", "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 }", "@Override\r\n\tpublic void save(User user) {\n\t\t\r\n\t}", "public void saveStaffList(String fileName) {\n try {\n BufferedWriter out = new BufferedWriter(new FileWriter(fileName));\n out.write(maxStaff+\"\\r\\n\");\n \n out.write(numStaff+\"\\r\\n\");\n \n \n for (int i = 0; i < numStaff; i++) {\n if (staffList[i] instanceof Labourer) {\n out.write(staffList[i].toFile());\n } else if (staffList[i] instanceof Manager) {\n out.write(staffList[i].toFile());\n }\n }\n out.close();\n } catch (IOException iox) {\n System.out.println(\"Error saving to \" + fileName);\n }\n }", "static public void addEmployeesToFile(Set<Employee> company){\n\t\tfor(Employee employee : company) {\n\t\t\ttry{\n\t\t\t\tFileWriter writer = new FileWriter(employee.getDepartment() + \".txt\", true); // second argument for appending\n\t\t\t\tBufferedWriter bw = new BufferedWriter(writer);\n\t\t\t\tPrintWriter out = new PrintWriter(bw);\n\t\t\t\tout.println(employee.toFileString());\n\t\t\t\tout.close();\n\t\t\t\tbw.close();\n\t\t\t\twriter.close();\n\t\t\t}\n\t\t\tcatch (IOException ex){\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void save(OutputStream outputStream) throws Exception {\n //implement this method - реализуйте этот метод\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(outputStream));\n if (users.size() > 0) {\n\n bw.write(\"yes\");\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy/MM/dd/HH/mm/ss/SSS\");\n\n for(User u : users) {\n bw.newLine();\n bw.write(u.getFirstName());\n\n bw.newLine();\n bw.write(u.getLastName());\n\n bw.newLine();\n Date d = u.getBirthDate();\n String string = sdf.format(d);\n /*int year = d.getYear();\n int month = d.getMonth();\n int day = d.getDay();\n int hour = d.getHours();\n int minuta = d.getMinutes();\n int second = d.getSeconds();\n int milisecond = d.;\n bw.write(\"\" + year + \" \" + month + \" \" + day);*/\n bw.write(sdf.format(d));\n\n bw.newLine();\n bw.write(u.isMale() ? \"true\" : \"false\");\n\n bw.newLine();\n bw.write(\"\" + u.getCountry().getDisplayName());\n }\n\n } else bw.write(\"no\");\n bw.flush();\n\n }", "public void createFile() throws IOException {\n String newName = input.getText();\n File user = new File(\"SaveData\\\\UserData\\\\\" + newName + \".txt\");\n\n if (user.exists() && !user.isDirectory()) {\n input.setStyle(\"-fx-border-color: red\");\n }\n if (user.exists() && !user.isDirectory() || newName.isEmpty()) {\n input.setStyle(\"-fx-border-color: red\");\n ERROR_AUDIO.play(Double.parseDouble(getInitData().get(\"SFXVol\")));\n\n }\n else {\n input.setStyle(\"-fx-border-color: default\");\n playerList.getItems().addAll(newName);\n PrintWriter newUser = new PrintWriter(new FileWriter(\"SaveData\\\\UserData\\\\\" + newName + \".txt\"));\n newUser.write(\"0 0 0 0 icon0 car\");\n newUser.close();\n MAIN_MENU_AUDIO.play(Double.parseDouble(getInitData().get(\"SFXVol\")));\n }\n }", "void save(String fileName) throws IOException, TransformerConfigurationException, ParserConfigurationException;", "private void putPersonalInformation() throws SQLException, FileNotFoundException, IOException {\n AdUserPersonalData personal;\n try {\n personal = PersonalDataController.getInstance().getPersonalData(username);\n staff_name = personal.getGbStaffName();\n staff_surname = personal.getGbStaffSurname();\n id_type = \"\"+personal.getGbIdType();\n id_number = personal.getGbIdNumber();\n putProfPic(personal.getGbPhoto());\n phone_number = personal.getGbPhoneNumber();\n mobile_number = personal.getGbMobileNumber();\n email = personal.getGbEmail();\n birthdate = personal.getGbBirthdate();\n gender = \"\"+personal.getGbGender();\n } catch (GB_Exception ex) {\n LOG.error(ex);\n GBMessage.putException(ex);\n }\n }", "@Override\n\tpublic void save(User u) {\n\t\tSystem.out.println(\"a user saved\");\n\t}", "public void save() {\n\t\tFileOutputStream fos;\n\t\ttry {\n\t\t\tfos = new FileOutputStream(\"studentData.dat\");\n\n\t\t\tObjectOutputStream oos;\n\t\t\ttry {\n\t\t\t\toos = new ObjectOutputStream(fos);\n\n\t\t\t\toos.writeObject(studentList);\n\t\t\t\toos.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(\"File is finished writing to the hard drive\");\n\t}" ]
[ "0.69330937", "0.6628618", "0.66085064", "0.65785426", "0.65588355", "0.65063864", "0.6483218", "0.6406097", "0.6238583", "0.61776245", "0.6147336", "0.61239475", "0.6105383", "0.60550225", "0.60464346", "0.59974766", "0.5975819", "0.5972444", "0.59158045", "0.5889257", "0.5854186", "0.5853373", "0.5845832", "0.584297", "0.58332723", "0.58306235", "0.5827402", "0.5823916", "0.5796401", "0.5792739", "0.57844675", "0.577972", "0.57542163", "0.5732533", "0.5718534", "0.57182604", "0.57152647", "0.5694383", "0.5690796", "0.5688301", "0.56822413", "0.5682168", "0.5681551", "0.567942", "0.5675882", "0.567105", "0.566411", "0.5634498", "0.56292003", "0.5628822", "0.5620057", "0.5618465", "0.56056225", "0.5601124", "0.5588375", "0.55699986", "0.5558661", "0.5548785", "0.5543276", "0.5539189", "0.55351925", "0.5530217", "0.5518296", "0.55159974", "0.5510721", "0.5509504", "0.5508026", "0.5504538", "0.5499549", "0.5494755", "0.5492636", "0.549236", "0.54920036", "0.5491292", "0.5490921", "0.5490022", "0.5477193", "0.5476873", "0.54749894", "0.54708654", "0.54696405", "0.54695404", "0.54603624", "0.54451084", "0.544304", "0.54406905", "0.5440462", "0.54390067", "0.5433152", "0.5425708", "0.54234093", "0.5422174", "0.541889", "0.54042196", "0.54030144", "0.53835624", "0.5378928", "0.5378422", "0.5372946", "0.53675914" ]
0.75535333
0
Load details Loads employee details from the text file
@Override public void load(String keyWord, String fileName){ FileReader loadDetails; String record; try{ loadDetails=new FileReader(fileName); BufferedReader bin=new BufferedReader(loadDetails); while (((record=bin.readLine()) != null)){ if ((record).contentEquals(keyWord)){ setUsername(record); setPassword(bin.readLine()); setFirstname(bin.readLine()); setLastname(bin.readLine()); setDoB((Date)DMY.parse(bin.readLine())); setContactNumber(bin.readLine()); setEmail(bin.readLine()); setSalary(Float.valueOf(bin.readLine())); setPositionStatus(bin.readLine()); homeAddress.load(bin); }//end if }//end while bin.close(); }//end try catch (IOException ioe){}//end catch catch (ParseException ex) { Logger.getLogger(Product.class.getName()).log(Level.SEVERE, null, ex); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void loadEmployees(String fileName)\r\n\t{\r\n\t\t//try block to attempt to open the file\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//declare local variables for the file name and data fields within the employeelist text file\r\n\t\t\t//these will all be Strings when pulled from the file, and then converted to the proper data type when they are assigned to the Employee objects\r\n\t\t\tString empID = \"\";\r\n\t\t\tString empLastName = \"\";\r\n\t\t\tString empFirstName = \"\";\r\n\t\t\tString empType = \"\";\t\r\n\t\t\tString empSalary = \"\"; //will convert to double\r\n\t\t\t\r\n\t\t\t//scan for file\r\n\t\t\tScanner infile = new Scanner(new FileInputStream(fileName));\r\n\t\t\t\r\n\t\t\t//while loop searching file records\r\n\t\t\twhile(infile.hasNext())\r\n\t\t\t{\r\n\t\t\t\t//split the field into segments with the comma (,) being the delimiter (employee ID, Last Name, First Name, employee type, and employee salary)\r\n\t\t\t\tString line = infile.nextLine();\r\n\t\t\t\tString[] fields = line.split(\",\");\r\n\t\t\t\tempID = fields[0];\r\n\t\t\t\tempLastName = fields[1];\r\n\t\t\t\tempFirstName = fields[2];\r\n\t\t\t\tempType = fields[3];\r\n\t\t\t\tempSalary = fields[4];\r\n\t\t\t\t\r\n\t\t\t\t//create a selection structure that creates the type of employee based on the empType\r\n\t\t\t\tif(empType.equalsIgnoreCase(\"H\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t//create an HourlyEmployee and convert empSalary to a double\r\n\t\t\t\t\tHourlyEmployee hourlyEmp = new HourlyEmployee(empID, empLastName, empFirstName, Double.parseDouble(empSalary));\r\n\t\t\t\t\t\r\n\t\t\t\t\t//add hourlyEmp to the Employee ArrayList empList\r\n\t\t\t\t\tempList.add(hourlyEmp);\r\n\t\t\t\t}//end create hourly employee\r\n\t\t\t\t\r\n\t\t\t\t//else if create an exempt employee for E\r\n\t\t\t\telse if(empType.equalsIgnoreCase(\"E\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t//create an exempt employee (salary) and convert the empSalary to a double\r\n\t\t\t\t\tExemptEmployee salaryEmp = new ExemptEmployee(empID, empLastName, empFirstName, Double.parseDouble(empSalary));\r\n\t\t\t\t\t\r\n\t\t\t\t\t//add salaryEmp to the Employee ArrayList empList\r\n\t\t\t\t\tempList.add(salaryEmp);\r\n\t\t\t\t}//end create exempt (salary) employee\r\n\t\t\t\t\r\n\t\t\t\t//else if create a contractor \r\n\t\t\t\telse if(empType.equalsIgnoreCase(\"C\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t//create a contract employee and convert the empSalary to a double\r\n\t\t\t\t\tContractEmployee contractEmp = new ContractEmployee(empID, empLastName, empFirstName, Double.parseDouble(empSalary));\r\n\t\t\t\t\t\r\n\t\t\t\t\t//add contractEmp to the Employee ArrayList empList\r\n\t\t\t\t\tempList.add(contractEmp);\r\n\t\t\t\t}//end create contractor employee\r\n\t\t\t\t\r\n\t\t\t\t//else if create a day laborer\r\n\t\t\t\telse if(empType.equalsIgnoreCase(\"d\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t//create a day laborer and convert the empSalary to a double\r\n\t\t\t\t\tDayLaborer laborer = new DayLaborer(empID, empLastName, empFirstName, Double.parseDouble(empSalary));\r\n\t\t\t\t\t\r\n\t\t\t\t\t//add laborer to the Employee ArrayList empList\r\n\t\t\t\t\tempList.add(laborer);\r\n\t\t\t\t}//end create day laborer employee\r\n\t\t\t\t\r\n\t\t\t\t//else ignore the employee (looking at you Greyworm!)\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t//save the employee type and id to return as an error\r\n\t\t\t\t\tempTypeError = empType;\r\n\t\t\t\t\tempIDError = empID;\r\n\t\t\t\t\t\r\n\t\t\t\t\t//ignore the employee \r\n\t\t\t\t\tempType = null;\r\n\t\t\t\t}//end ignore X employee\r\n\t\t\t}//end while loop cycling the records in the employeelist\r\n\t\t\t\r\n\t\t\t//close infile when done\r\n\t\t\tinfile.close();\r\n\t\t}//end of try block opening employeelist.txt file\r\n\t\t\r\n\t\t//catch block if file not found\r\n\t\tcatch(IOException ex)\r\n\t\t{\r\n\t\t\t//call ex object and display message\r\n\t\t\tex.printStackTrace();\r\n\t\t}//end of catch for file not found\r\n\t}", "public void read(String fileName)\n\t{\n\t\tString line = \"\";\n\t\tint headCount = 0;\n\t\tEmployee helperEmployee;\n\t\t\n\t\ttry\n\t\t{\n\t\t\t//FileReader is in charge of reading text files\n\t\t\tFileReader fileReader = new FileReader(fileName);\n\t\t\t\n\t\t\t//Wrapping FileReader in BufferedReader\n\t\t\tBufferedReader bufferedReader = new BufferedReader(fileReader);\n\t\t\t\n\t\t\t//Continue reading until we reach end of file\n\t\t\twhile( (line = bufferedReader.readLine()) != null)\n\t\t\t{\n\t\t\t\tString[] lineString = line.split(\",\");\n\t\t\t\t//Get the header information and arrange it just once, then read the rest of the information\n\t\t\t\tif(headCount == 0)\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\thelperEmployee = new Employee();\n\t\t\t\t\thelperEmployee.setEmployeeName(lineString[0] + \"\" + lineString[1]); \n\t\t\t\t\thelperEmployee.setEmployeeNumber(Integer.parseInt(lineString[2]));\n\t\t\t\t\thelperEmployee.setEmployeeState(lineString[3]);\n\t\t\t\t\thelperEmployee.setEmployeeZipCode(Integer.parseInt(lineString[4]));\n\t\t\t\t\thelperEmployee.setEmployeeAge(Integer.parseInt(lineString[6]));\n\t\t\t\t\tadd(helperEmployee);\n\t\t\t\t}\n\t\n\t\t\t\t//Keep track of number of employees\n\t\t\t\theadCount++;\n\t\t\t}\n\t\t\t\n\t\t\t//Close file as good practice\n\t\t\tbufferedReader.close();\n\t\t}\n\t\tcatch(FileNotFoundException ex)\n\t\t{\n\t\t\tSystem.out.println(\"Unable to open the file named '\" + fileName + \"'\");\n\t\t}\n\t\tcatch(IOException ex)\n\t\t{\n\t\t\tSystem.out.println(\"Error when reading the file \" + fileName + \"'\");\n\t\t}\n\t}", "void readFromFile(String file)\n {\n try\n {\n employees.clear();\n FileReader inputFile = new FileReader(fileName);\n BufferedReader input = new BufferedReader(inputFile);\n String line = input.readLine();\n \n while(line != null)\n {\n Employee worker = new Employee();\n StringTokenizer stringParser = new StringTokenizer(line, \",\");\n while(stringParser.hasMoreElements())\n {\n worker.setName(stringParser.nextElement().toString());\n worker.setHours(Integer.parseInt(stringParser.nextElement().toString()));\n worker.setRate(Float.parseFloat(stringParser.nextElement().toString()));\n }\n employees.add(worker);\n line = input.readLine();\n }\n inputFile.close();\n }\n catch(FileNotFoundException e)\n {\n e.getStackTrace();\n }\n catch(IOException e)\n {\n e.getStackTrace();\n }\n }", "public void loadHours(String fileName)\r\n\t{\r\n\t\t//try block to try and open the file\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//declare local variables that will be assigned to the employee. These will be converted after split. \r\n\t\t\tString empID = \"\";\r\n\t\t\tString dailyHours = \"\";\r\n\t\t\tString day = \"\";\r\n\t\t\t//scan for the file \r\n\t\t\tScanner infile = new Scanner(new FileInputStream(fileName));\r\n\t\t\t\r\n\t\t\t//while loop if there is a next line\r\n\t\t\twhile(infile.hasNext())\r\n\t\t\t{\r\n\t\t\t\t//declare the line that was pulled as a single string \r\n\t\t\t\tString line = infile.nextLine();\r\n\t\t\t\t\r\n\t\t\t\t//break the line up by the delimiter (,)\r\n\t\t\t\tString fields[] = line.split(\",\");\r\n\t\t\t\t\r\n\t\t\t\t//assign the first field to day, 2nd to employeeID, and 3rd to dailyHours\r\n\t\t\t\tday = fields[0];\r\n\t\t\t\tempID = fields[1];\r\n\t\t\t\tdailyHours = fields[2];\r\n\t\t\t\t\r\n\t\t\t\t//cycle the Employee arrayList and see which employee ID matches the added ID\r\n\t\t\t\tfor (Employee employee : empList)\r\n\t\t\t\t{\r\n\t\t\t\t\t//selection structure checking if the empID matches the Employee list ID\r\n\t\t\t\t\tif(employee.getEmpoyeeId().equalsIgnoreCase(empID))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t//add the hours to the employee object (convert dailyHours to a Double)\r\n\t\t\t\t\t\temployee.addHours(Double.parseDouble(dailyHours));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//now that the hours have been added to that individual employee, the hours need to be added to the date in the \r\n\t\t\t\t\t\t//DailyHours class by calling findEntryByDate\r\n\t\t\t\t\t\taddToDailyReport(day, Double.parseDouble(dailyHours), employee.getSalary());\r\n\t\t\t\t\t}//end employee ID found\r\n\t\t\t\t\t\r\n\t\t\t\t\t//else not found so set to null\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\temployee = null;\r\n\t\t\t\t\t}//end not found \r\n\t\t\t\t}//end for loop cycling the empList\t\r\n\t\t\t}//end the file has no more lines\r\n\t\t}//end try block\r\n\t\t\r\n\t\t//catch block incase try fails for OPENING THE FILE\r\n\t\tcatch(IOException ex)\r\n\t\t{\r\n\t\t\t//call ex object and display message\r\n\t\t\tex.printStackTrace();\r\n\t\t}//end of catch block\t\r\n\t}", "@Override\n public void readDataFromTxtFile()\n throws NumberFormatException, DepartmentCreationException, EmployeeCreationException {\n\n }", "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 }", "public void readFromEmployeeListFile()\r\n {\r\n try(ObjectInputStream fromEmployeeListFile = \r\n new ObjectInputStream(new FileInputStream(\"listfiles/employeelist.dta\")))\r\n {\r\n employeeList = (EmployeeList) fromEmployeeListFile.readObject();\r\n employeeList.setSavedStaticEmpRunNR(fromEmployeeListFile);\r\n }\r\n catch(ClassNotFoundException cnfe)\r\n {\r\n employeeList = new EmployeeList();\r\n JOptionPane.showMessageDialog(null, \"Fant ikke definisjon av ansatt \"\r\n + \"objektene.\\nOppretter tomt ansattregister.\\n\"\r\n + cnfe.getMessage(), \"Feilmelding\", \r\n JOptionPane.ERROR_MESSAGE);\r\n }\r\n catch(FileNotFoundException fnfe)\r\n {\r\n employeeList = new EmployeeList();\r\n JOptionPane.showMessageDialog(null, \"Finner ikke angitt fil.\\n\"\r\n + \"Oppretter tomt ansattregister.\\n\" \r\n + fnfe.getMessage(), \"Feilmelding\", \r\n JOptionPane.ERROR_MESSAGE);\r\n }\r\n catch(IOException ioe)\r\n\t{\r\n employeeList = new EmployeeList();\r\n JOptionPane.showMessageDialog(null, \"Fikk ikke lest fra filen.\\n\"\r\n + \"Oppretter tomt ansattregister.\\n\"\r\n + ioe.getMessage(), \"Feilmelding\", \r\n JOptionPane.ERROR_MESSAGE);\r\n\t}\r\n }", "private void loadData(){\n try (BufferedReader br = new BufferedReader(new FileReader(this.fileName))) {\n String line;\n while((line=br.readLine())!=null){\n E e = createEntity(line);\n super.save(e);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private static Employee [] readFile(String fileName) {\n Employee[] employees = new Employee[0];\n try{\n File file = new File(fileName);\n try (Scanner scanner = new Scanner(file)) {\n while(scanner.hasNextLine())\n {\n StringTokenizer st = new StringTokenizer(scanner.nextLine());\n Employee employee = new Employee();\n employee.employee = st.nextToken();\n if(st.hasMoreTokens()) {\n String manager = st.nextToken();\n \n // Check if manager is not empty, if empty then last employee\n if(!\"\".equals(manager))\n employee.manager = manager;\n }\n \n employees = addEmployee(employees, employee);\n } }\n } catch (FileNotFoundException e)\n {\n }\n \n return employees;\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 }", "public void readStaffEntry()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tScanner reader = new Scanner(new FileReader(\"StaffEntryRecords.txt\"));\r\n\t\t\twhile (reader.hasNext())\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(reader.nextLine());\r\n\t\t\t}\r\n\t\t\treader.close();\r\n\t\t}\r\n\t\tcatch(FileNotFoundException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"FileNotFoundException\");\r\n\t\t}\r\n\t}", "public void load_from_file() {\r\n // prompting file name from user\r\n System.out.print(\"Enter in FileName:\\n>\");\r\n\r\n // taking user input of file name\r\n String filename = Menu.sc.next();\r\n Scanner input;\r\n\r\n // try to open file, if fails throws exception and returns to main menu\r\n try {\r\n input = new Scanner(new FileReader(filename));\r\n } catch (FileNotFoundException e) {\r\n System.out.println(\"Unable to open file!!\");\r\n System.out.println();\r\n return;\r\n }\r\n\r\n int count = 0; // variable to count number of address entry read\r\n\r\n /* reading data until end of file */\r\n while (input.hasNextLine()) {\r\n String firstName = \"\", lastName = \"\", street = \"\", city = \"\", state = \"\", email = \"\", phone = \"\";\r\n int zip = 0;\r\n if (input.hasNextLine())\r\n firstName = input.nextLine();\r\n if (input.hasNextLine())\r\n lastName = input.nextLine();\r\n if (input.hasNextLine())\r\n street = input.nextLine();\r\n if (input.hasNextLine())\r\n city = input.nextLine();\r\n if (input.hasNextLine())\r\n state = input.nextLine();\r\n if (input.hasNextLine())\r\n zip = Integer.parseInt(input.nextLine());\r\n if (input.hasNextLine())\r\n phone = input.nextLine();\r\n if (input.hasNext())\r\n email = input.nextLine();\r\n if (input.hasNext())\r\n input.nextLine();\r\n addressEntryList.add(new AdressEntry(firstName, lastName, street, city, state, zip, phone, email));\r\n count++;\r\n }\r\n\r\n /*\r\n printing number of address entry variables\r\n and printing total number of AddressEntry in the list\r\n */\r\n System.out.println(\"Read in \" + count + \" new Addresses, successfully loaded, currently \"\r\n + addressEntryList.size() + \" Addresses\");\r\n input.close();\r\n System.out.println();\r\n }", "public static void loadProgramData() {\n\r\n try {\r\n File f = new File(\"DetailsOfVaccination.txt.txt\"); //Accessing the file\r\n Scanner read = new Scanner(f);\r\n while (read.hasNextLine()) { //Print data in the file line by line\r\n String data = read.nextLine();\r\n System.out.println(data);\r\n }\r\n read.close();\r\n }\r\n catch (FileNotFoundException e) { //Runs if there was an error\r\n System.out.println(\"An error occurred while reading data from the file.\");\r\n e.printStackTrace();\r\n }\r\n }", "public static void main (String args[] ){\n\t\tScanner scanner = new Scanner( System.in );\r\n\t\tSystem.out.print ( \" 1. Load Employee (From File) \\n 2. Exit Program \\n Enter Your Selection: \" );\r\n\t\tint input = scanner.nextInt();\r\n\t\t\r\n\t\t//if user inputs 1 read the text file and print employees loaded from the file\r\n\t\tif (input == 1 ){\r\n\t\t\tString[] Data;\r\n\t\t\t/**\r\n\t\t\t**create four arrays each of type StaffPharmacist, PharmacyManager, StaffTechnician, Senior technician\r\n\t\t\t**in order to store the employee objects. create arrays of length 1\r\n\t\t\t**/\r\n\t\t\tStaffPharmacist [] Pharmacist = new StaffPharmacist[1];\t\t\r\n\t\t\tPharmacyManager [] Manager = new PharmacyManager[1];\t\t\t\r\n\t\t\tStaffTechnician [] staffTech = new StaffTechnician[1];\t\t\t\r\n\t\t\tSeniorTechnician [] seniorTech = new SeniorTechnician[1];\r\n\t\t\ttry{\r\n\t\t\t\t//read the text file using scanner\r\n\t\t\t\tFile file = new File(\"employees.txt\");\r\n\t\t\t\t\t\t\r\n\t\t\t\tScanner sc = new Scanner(file);\r\n\t\t\t\t\t\r\n\t\t\t\t//while text file has next line split the text to store all elements in to an array\r\n\t\t\t\twhile (sc.hasNextLine()){\r\n\t\t\t\t\t\r\n\t\t\t\t\t//read the text file and store it in an array called data. split the text file at , and read until we have next line\r\n\t\t\t\t\tData = sc.nextLine().split(\",\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t//create 4 employee objects of each employee type \r\n\t\t\t\t\tPharmacyManager pharmacyManager = new PharmacyManager(Data);\r\n\t\t\t\t\tStaffPharmacist staffPharmacist = new StaffPharmacist(Data);\r\n\t\t\t\t\tStaffTechnician staffTechnician = new StaffTechnician(Data);\r\n\t\t\t\t\tSeniorTechnician seniorTechnician = new SeniorTechnician(Data);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tint i;\r\n\t\t\t\t\t/** parse through the text files to check the job id number.\r\n\t\t\t\t\tif the job id is one than the employee is pharmacy manager and there fore store it in an array of type pharmacy manager, else if job id == 2 than it is a staff pharmacist there fore store the staff pharmacist employee in the respective array. else if job id == 3 the employee is a staff technician therefore store the employee object staff technician in array of type staff technician and if the id == 4 than the employee is senior technician so store the employee senior technician in an array of type senior technician\r\n\t\t\t\t\t**/\r\n\t\t\t\t\tfor( i = 0; i < Data.length; i = i + 4){\r\n\t\t\t\t\t\tif( Integer.parseInt(Data[i]) == 1 ){\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tManager[0] = pharmacyManager;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}else if( Integer.parseInt(Data[i]) == 2 ){\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tPharmacist[0] = staffPharmacist;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}else if( Integer.parseInt(Data[i]) == 3 ){\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tstaffTech[0] = staffTechnician;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}else if( Integer.parseInt(Data[i]) == 4 ){\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tseniorTech[0] = seniorTechnician;\r\n\t\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\t\t\r\n\t\t\t\t//close the file \r\n\t\t\t\tsc.close();\r\n\t\t\t\t\t\r\n\t\t\t\t//print that the file loaded success fully\r\n\t\t\t\tSystem.out.println ( \" \\n File Successfully Loaded! \" );\r\n\t\t\t\t\t\r\n\t\t\t\t//set a boolean variable named keepgoing equal to true.\r\n\t\t\t\tboolean keepGoing = true;\r\n\t\t\t\t//as long as keep going remains true, do the following steps\r\n\t\t\t\twhile(keepGoing){\r\n\t\t\t\t\t\r\n\t\t\t\t\t//ask the user what they would like to do next\r\n\t\t\t\t\tSystem.out.print ( \" \\n 1. Print Employee Information \\n 2. Enter Hours Worked \\n 3. Calculate Paychecks \\n 4. Exit Program \\n Enter Your Selection: \" );\r\n\t\t\t\t\tinput = scanner.nextInt();\r\n\t\t\t\t\tdo{\r\n\t\t\t\t\t\t//if user inputs 3 that is tries to print checks prior to entering hours worked than throw an error\r\n\t\t\t\t\t\tif(input == 3){\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tSystem.out.println( \" Please enter the hours worked (Option #2) before trying to calculate the paycheck amounts! \" );\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//again ask the user after throwing the exception about what they would like to do\r\n\t\t\t\t\t\t\tSystem.out.print ( \" \\n 1. Print Employee Information \\n 2. Enter Hours Worked \\n 3. Calculate Paychecks \\n 4. Exit Program \\n Enter Your Selection: \" );\r\n\t\t\t\t\t\t\tinput = scanner.nextInt();\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\r\n\t\t\t\t\t\t//do this steps as long as user inputs 1 or 2\r\n\t\t\t\t\t\tdo{\r\n\t\t\t\t\t\t\t//if the user inputs 1 print the employee information described in respective classes of employees\r\n\t\t\t\t\t\t\tif(input == 1){\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tManager[0].printPharmacyManager();\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tPharmacist[0].printStaffPharmacist();\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tseniorTech[0].printSeniorTechnician();\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tstaffTech[0].printStaffTechnician();\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//if the user inputs 2 prompt the user asking the number of hours worked by employees\r\n\t\t\t\t\t\t\telse if(input == 2){\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tSystem.out.print( \" \\n Please enter the hours worked: \" );\r\n\t\t\t\t\t\t\t\tint workingHours = scanner.nextInt();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//than again ask user what they would like to do\r\n\t\t\t\t\t\t\t\tSystem.out.print ( \" \\n 1. Print Employee Information \\n 2. Enter Hours Worked \\n 3. Calculate Paychecks \\n 4. Exit Program \\n Enter Your Selection: \" );\r\n\t\t\t\t\t\t\t\tinput = scanner.nextInt();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t/**if user inputs 3 after they entered number of hours employees worked than calculate the employee pay checks\r\n\t\t\t\t\t\t\t\tusing the calculate pay method defined in employee class\r\n\t\t\t\t\t\t\t\tget the employees pay rate by using getHourlyRate method defined in employee class\r\n\t\t\t\t\t\t\t\t**/\r\n\t\t\t\t\t\t\t\tif(input == 3){\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tManager[0].calculatePay(workingHours, Manager[0].getHourlyRate() );\r\n\t\t\t\t\t\t\t\t\tPharmacist[0].calculatePay(workingHours, Pharmacist[0].getHourlyRate() );\r\n\t\t\t\t\t\t\t\t\tstaffTech[0].calculatePay(workingHours, seniorTech[0].getHourlyRate() );\r\n\t\t\t\t\t\t\t\t\tseniorTech[0].calculatePay(workingHours, staffTech[0].getHourlyRate() );\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t//again show the menu to the user asking them what they would like to do\r\n\t\t\t\t\t\t\t//if user enters one or two or three repeat the above steps else exit the loop\r\n\t\t\t\t\t\t\tSystem.out.print ( \" \\n 1. Print Employee Information \\n 2. Enter Hours Worked \\n 3. Calculate Paychecks \\n 4. Exit Program \\n Enter Your Selection: \" );\r\n\t\t\t\t\t\t\tinput = scanner.nextInt();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}while(input == 1 || input == 2 );\r\n\t\t\t\t\t}while(input == 3);\r\n\t\t\t\t\t//if user enters 4 set keepGoing = false print good bye and exit the loop.\r\n\t\t\t\t\tif(input == 4){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tkeepGoing = false;\r\n\t\t\t\t\t\tSystem.out.println( \" Goodbye! \" );\r\n\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\t}\r\n\t\t\t\t\r\n\t\t\t//if the file is not found in the system throw an IO exception printing file not found\t\t\t\t\t\t\t\r\n\t\t\t}catch(FileNotFoundException fnfe){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t//catch the exception if the file is not found\r\n\t\t\t\tSystem.out.println(\" File Load Failed! \\n java.io.FileNotFoundException: employees.txt ( The system cannot find the file specified) \\n Program Exiting..... \");\r\n\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\t\r\n\t\t//if the user inputs 2 in the main menu bar exit the loop and say goodBye!\r\n\t\tif(input == 2){\r\n\t\t\t\t\r\n\t\t\tSystem.out.println ( \"\\n Good Bye! \\n\" );\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\t\r\n\t}", "public List<String> loadFromFile(String fileName) {\n String line;\n List<String> listValuesFieldsEmployees = new ArrayList<>();\n\n try (FileReader fileReader = new FileReader(fileName);\n BufferedReader reader = new BufferedReader(fileReader)) {\n while ((line = reader.readLine()) != null) {\n listValuesFieldsEmployees.add(line);\n }\n } catch (IOException exc) {\n exc.printStackTrace();\n }\n return listValuesFieldsEmployees;\n }", "static void loadUser() {\n\t\tScanner inputStream = null; // create object variable\n\n\t\ttry { // create Scanner object & assign to variable\n\t\t\tinputStream = new Scanner(new File(\"user.txt\"));\n\t\t\tinputStream.useDelimiter(\",\");\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"No User Infomation was Loaded\");\n\t\t\t// System.exit(0);\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\twhile (inputStream.hasNext()) {\n\n\t\t\t\tString instanceOf = inputStream.next();\n\n\t\t\t\tString readUserName = inputStream.next();\n\t\t\t\tString readPassword = inputStream.next();\n\t\t\t\tString readEmployeeNumber = inputStream.next();\n\t\t\t\tString readName = inputStream.next();\n\t\t\t\tString readPhone = inputStream.next();\n\t\t\t\tString readEmail = inputStream.next();\n\t\t\t\tif (instanceOf.contains(\"*AD*\")) {\n\t\t\t\t\tAdmin a1 = new Admin(readUserName, readPassword, readEmployeeNumber, readName, readPhone,\n\t\t\t\t\t\t\treadEmail);\n\t\t\t\t\tuserInfoArray.add(a1);\n\t\t\t\t\t//System.out.println(\"Read an Admin User: \" + ((User) a1).getUserName() + \" \" + a1.getPassword() + \" \"+ a1.getEmployeeNum());\n\t\t\t\t} else if (instanceOf.contains(\"*CC*\")) {\n\t\t\t\t\tCourseCoordinator a1 = new CourseCoordinator(readUserName, readPassword, readEmployeeNumber,\n\t\t\t\t\t\t\treadName, readPhone, readEmail);\n\t\t\t\t\tuserInfoArray.add(a1);\n\t\t\t\t\t//System.out.println(\"Read an CC User: \" + ((User) a1).getUserName() + \" \" + a1.getPassword() + \" \"+ a1.getEmployeeNum());\n\t\t\t\t} else if (instanceOf.contains(\"*AP*\")) {\n\t\t\t\t\tApproval a1 = new Approval(readUserName, readPassword, readEmployeeNumber, readName, readPhone,\n\t\t\t\t\t\t\treadEmail);\n\t\t\t\t\tuserInfoArray.add(a1);\n\t\t\t\t\t//System.out.println(\"Read an Approval User: \" + ((User) a1).getUserName() + \" \" + a1.getPassword()+ \" \" + a1.getEmployeeNum());\n\t\t\t\t} else if (instanceOf.contains(\"*CA*\")) {\n\t\t\t\t\tCasual a1 = new Casual(readUserName, readPassword, readEmployeeNumber, readName, readPhone,\n\t\t\t\t\t\t\treadEmail);\n\t\t\t\t\ta1.setHrly_rate(inputStream.nextInt());\n\t\t\t\t\tuserInfoArray.add(a1);\n\t\t\t\t\t//System.out.println(\"Read an Casual User: \" + ((User) a1).getUserName() + \" \" + a1.getPassword()+ \" \" + a1.getEmployeeNum());\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IllegalStateException e) {\n\t\t\tSystem.err.println(\"Could not read from the file\");\n\t\t} catch (InputMismatchException e) {\n\t\t\tSystem.err.println(\"Something wrong happened while reading the file\");\n\t\t}\n\t\tinputStream.close();\n\t}", "private static void loadEmployeeDetails(final List<Employee> employeeDetails) {\r\n\t\tfinal SalariedEmployee salariedEmployee1 = new SalariedEmployee(\"James\", \"Hogan\", \"Salaried\", 13200.00, true);\r\n\t\tfinal SalariedEmployee salariedEmployee2 = new SalariedEmployee(\"Joan\", \"Han\", \"Salaried\", 10400.00, false);\r\n\r\n\t\tfinal HourlyEmployee hourlyEmployee1 = new HourlyEmployee(\"Jennifer\", \"Waltz\", \"Hourly\", 45, 10.95, false);\r\n\t\tfinal HourlyEmployee hourlyEmployee2 = new HourlyEmployee(\"Moly\", \"Smith\", \"Hourly\", 32, 15, false);\r\n\r\n\t\tfinal CommissionedEmployee commissionedEmployee = new CommissionedEmployee(\"Marry\", \"Butler\", \"Commissioned\", 10000, false);\r\n\r\n\t\temployeeDetails.add(salariedEmployee1);\r\n\t\temployeeDetails.add(salariedEmployee2);\r\n\t\temployeeDetails.add(hourlyEmployee1);\r\n\t\temployeeDetails.add(hourlyEmployee2);\r\n\t\temployeeDetails.add(commissionedEmployee);\r\n\t}", "public static void read(String fname){\r\n\t\t\t\r\n\t\t\tString line = \"\";\r\n\t\t\ttry {\r\n\t // FileReader reads text files in the default encoding.\r\n\t FileReader fileReader = new FileReader(fname);\r\n\t \r\n\t // Always wrap FileReader in BufferedReader.\r\n\t BufferedReader bufferedReader = new BufferedReader(fileReader);\r\n\t header=bufferedReader.readLine();\r\n\t \r\n\t data = new ArrayList<alldata>();\r\n\r\n\t while((line = bufferedReader.readLine()) != null) {\r\n\t \t\r\n\t //parse line and divide data by comma\r\n\t \r\n\t \t\r\n\t \tString[] lineStr = line.split(\",\");\r\n\t \t\r\n\t //create object row into which data from each line is stored and then added to array list\t\r\n\t \t\r\n\t if(lineStr.length >0) {\r\n\t \talldata row = new alldata();\r\n\t \trow.Name = lineStr[0]+ \",\" + lineStr[1];\r\n\t \trow.Num = lineStr[2];\r\n\t \trow.State = lineStr[3];\r\n\t \trow.Zip = lineStr[4];\r\n\t \trow.Age = Integer.parseInt(lineStr[6]);\r\n\t \trow.Sex = lineStr[7];\r\n\t \t\r\n\t \tdata.add(row);\r\n\t }\r\n\t \r\n\t \r\n\t } \r\n\t bufferedReader.close(); // Always close files. \r\n\t }catch(FileNotFoundException ex) {\r\n\t System.out.println(\"Unable to open file '\" + fname + \"'\"); \r\n\t }catch(IOException ex) {\r\n\t System.out.println(\"Error reading file '\" + fname + \"'\"); \r\n\t }\r\n\t\t\tSystem.out.println(\"Finish reading data from file \"+ fname);\r\n\t\t}", "public void loadData() {\n\t\tempsList.add(\"Pankaj\");\r\n\t\tempsList.add(\"Raj\");\r\n\t\tempsList.add(\"David\");\r\n\t\tempsList.add(\"Lisa\");\r\n\t}", "private void readFile(File fp)throws IOException{\n Scanner in=new Scanner(fp);\n String line,s[];\n while(in.hasNext()){\n line=in.nextLine();\n s=line.split(\"[ ]+\");\n if(s.length<3){\n payroll.addLast(new ObjectListNode(new Employee(s[1],s[0])));\n }\n else{\n payroll.addLast(new ObjectListNode(new Employee(s[1],s[0],s[2].charAt(0),s[4].charAt(0),\n Integer.parseInt(s[3]),Double.parseDouble(s[5]))));\n }\n }\n }", "private void readFileToUser(String fileName){\r\n\t\tString line = null;\r\n\t\ttry {\r\n\t\t\t// FileReader reads text files in the default encoding.\r\n\t\t\tFileReader fileReader = \r\n\t\t\t\t\tnew FileReader(fileName);\r\n\r\n\t\t\t// Always wrap FileReader in BufferedReader.\r\n\t\t\tBufferedReader bufferedReader = \r\n\t\t\t\t\tnew BufferedReader(fileReader);\r\n\r\n\t\t\twhile((line = bufferedReader.readLine()) != null) {\r\n\t\t\t\tString[] split = line.split(\",\", 3);\r\n\t\t\t\tString username = split[0];\r\n\t\t\t\tString password = split[1];\r\n\t\t\t\tString user = split[2];\r\n\t\t\t\tusers.add(new User(username,password,user));\r\n\r\n\t\t\t} \r\n\t\t\tbufferedReader.close(); \r\n\t\t}\r\n\t\tcatch(FileNotFoundException ex) {\r\n\t\t\tSystem.out.println(\"Unable to open file '\" + fileName + \"'\"); \r\n\t\t}\r\n\t\tcatch(IOException ex) {\r\n\t\t\tSystem.out.println(\"Error reading file '\" + fileName + \"'\"); \r\n\t\t}\r\n\t}", "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 }", "String loadFromFile () throws Exception {\n\n Reader reader = new Reader(new FileReader(file));\n String line;\n\n// reads all lines of the file\n while ((line = reader.readLine()) != null) {\n\n// depending on the object tag [element], it reads relevant parameters and creates the Element\n if (line.contains(\"[timeline]\"))\n timelines.add(new Timeline(reader.getStringArgument()));\n\n else if (line.contains(\"[event]\")) {\n String timelineName = reader.getStringArgument();\n for (Timeline timeline : timelines) {\n if (timelineName.equals(timeline.name)) {\n timeline.addEvent(\n reader.getStringArgument(),\n reader.getDateArgument(),\n reader.getDateArgument(),\n reader.getIntArgument() != 0,\n reader.getNotesArgument());\n break;\n }\n }\n }\n }\n reader.close();\n return (\"Data loaded successfully\");\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}", "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 }", "static void loadCourse() {\n\t\tScanner inputStreamC = null; // create object variable for Course\n\n\t\ttry { // create Scanner object & assign to variable\n\t\t\tinputStreamC = new Scanner(new File(\"course.txt\"));\n\t\t\tinputStreamC.useDelimiter(\",\");\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"No Course Infomation was Loaded\");\n\t\t\t// System.exit(0);\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\twhile (inputStreamC.hasNext()) {\n\n\t\t\t\tString readCourseID = inputStreamC.next();\n\t\t\t\tString readCourseName = inputStreamC.next();\n\t\t\t\tString readCourseUserName = inputStreamC.next();\n\t\t\t\t\n\t\t\t\tCourse c1 = new Course(readCourseID, readCourseName, readCourseUserName);\n\t\t\t\tcourseInfoArray.add(c1);\n\t\t\t\t//System.out.println(\"Read a Course \" + c1.getCourseID() + \" \" + c1.getCourseName() + \" \"\t+ c1.getCoordinatorUserID());\n\t\t\t\t\n\t\t\t} //eo while\n\t\t} catch (IllegalStateException e) {\n\t\t\tSystem.err.println(\"Could not read from the file\");\n\t\t} catch (InputMismatchException e) {\n\t\t\tSystem.err.println(\"Something wrong happened while reading the file\");\n\t\t}\n\t\tinputStreamC.close();\n\t}", "private void readFileAndStoreData_(String fileName) {\n In in = new In(fileName);\n int numberOfTeams = in.readInt();\n int teamNumber = 0;\n while (!in.isEmpty()) {\n assignTeam_(in, teamNumber);\n assignTeamInfo_(in, numberOfTeams, teamNumber);\n teamNumber++;\n }\n }", "@Override\n public void loadDataFromFile(File file) {\n Gson gson = new Gson();\n try {\n Scanner scanner = new Scanner(file);\n while (scanner.hasNextLine()){\n IndividualCustomer customer =\n gson.fromJson(scanner.nextLine(),IndividualCustomer.class);\n customerList.add(customer);\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n\n }", "public static void main(String[] args) {\n File data = new File(\"C:\" + File.separatorChar + \"temp\" + File.separatorChar \r\n + \"labFile.txt\");\r\n \r\n BufferedReader in = null;\r\n int count = 0;\r\n int recordCount = 0;\r\n try {\r\n //FileReader is being decorated by BufferedReader to make it read faster\r\n //buffered allows us to talk to file\r\n //open the stream\r\n in = new BufferedReader(new FileReader(data));\r\n //read the first line\r\n String line = in.readLine();\r\n //so long as line we just read is not null then continue reading file\r\n //if line is null it's end of file\r\n while (line != null) {\r\n \r\n \r\n if (count == 0) {\r\n String[] myStringArray = line.split(\" \");\r\n \r\n System.out.println(\"First Name: \" + myStringArray[0]);\r\n System.out.println(\"Last Name: \" + myStringArray[1]); \r\n } else if (count == 1) {\r\n \r\n System.out.println(\"Street Address: \" + line); \r\n } else if (count == 2) {\r\n \r\n String[] myStringArray = line.split(\" \");\r\n System.out.println(\"City: \" + myStringArray[0].replace(\",\", \" \"));\r\n System.out.println(\"State: \" + myStringArray[1]);\r\n System.out.println(\"Zip: \" + myStringArray[2]);\r\n \r\n count = -1;\r\n recordCount++;\r\n System.out.println(\"\");\r\n System.out.println(\"Number of records read: \" + recordCount);\r\n System.out.println(\"\");\r\n } \r\n count++;\r\n \r\n //reads next line\r\n line = in.readLine(); // strips out any carriage return chars\r\n \r\n }\r\n\r\n } catch (IOException ioe) {\r\n System.out.println(\"Houston, we have a problem! reading this file\");\r\n //want to close regardless if there is an error or not\r\n } finally {\r\n try {\r\n //close the stream\r\n //closing the file throws a checked exception that has to be surrounded by try catch\r\n in.close();\r\n } catch (Exception e) {\r\n\r\n }\r\n }\r\n }", "private ArrayList<String> saveText(){\n FileReader loadDetails = null;\n String record;\n record = null;\n\n //Create an ArrayList to store the lines from text file\n ArrayList<String> lineKeeper = new ArrayList<String>();\n\n try{\n loadDetails=new FileReader(\"employees.txt\");\n BufferedReader bin=new BufferedReader (loadDetails);\n record=new String();\n while (((record=bin.readLine()) != null)){//Read the file and store it into the ArrayList line by line*\n lineKeeper.add(record);\n }//end while\n bin.close();\n bin=null;\n }//end try\n catch (IOException ioe) {}//end catc\n\n return lineKeeper;\n\n }", "public void loadPeriodInfo() throws IOException{\r\n try { \r\n String line;\r\n FileReader in = new FileReader (\"Period List.txt\");\r\n BufferedReader input = new BufferedReader(in); \r\n String line1;\r\n teacherListModel.removeAllElements();\r\n periodModel.removeAllElements();\r\n removeTeachersListModel.removeAllElements();\r\n editTeachersListModel.removeAllElements();\r\n teachers.clear();\r\n //Running through each line of code\r\n while ((line1 = input.readLine()) != null) {\r\n String tempLine = line1; \r\n String[] teacherData = new String [2];\r\n for (int i = 0; i < 2; i++) {\r\n teacherData [i] = tempLine.substring (0, tempLine.indexOf(\",\")); \r\n tempLine = tempLine.substring(tempLine.indexOf(\",\") + 1, tempLine.length()); \r\n } \r\n //Adding the teachers and their data\r\n Teacher tempTeacher = new Teacher (teacherData[0]);//name\r\n teacherListModel.addElement(teacherData[0]); \r\n periodModel.addElement(teacherData[0]); \r\n removeTeachersListModel.addElement(teacherData[0]); \r\n editTeachersListModel.addElement (teacherData[0]);\r\n teachers.add (tempTeacher);\r\n for (int j = 0; j < teacherData[1].length(); j++) {\r\n tempTeacher.addPeriod (Integer.parseInt(teacherData[1].substring (j, j + 1))); //period\r\n }\r\n }\r\n }catch (IOException E) {\r\n System.out.println (\"ERROR READING 'Period List.txt\"); \r\n }\r\n }", "public void fillFromFile()\n\t{\n\t\tJFileChooser fc = new JFileChooser();\t//creates a new fileChooser object\n\t\tint status = fc.showOpenDialog(null);\t//creates a var to catch the dialog output\n\t\tif(status == JFileChooser.APPROVE_OPTION)\t\n\t\t{\n\t\t\tFile selectedFile = fc.getSelectedFile ( );\n\t\t\tthis.fileName = selectedFile;\n\t\t\tScanner file = null; //scans the file looking for information to load\n\n\t\t\tif(selectedFile.exists())\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tfile = new Scanner(fileName); //scans the input file\n\t\t\t\t}\n\t\t\t\tcatch(Exception IOException)\n\t\t\t\t{\n\t\t\t\t\tJOptionPane.showConfirmDialog (null, \"Unable to import data from the list\");\n\t\t\t\t\tSystem.exit (-1);\n\t\t\t\t}//if there was an error it will pop up this message\n\t\t\t\t\n\t\t\t\tString str = file.nextLine ( ); //names the line\n\t\t\t\tString [] header = str.split (\"\\\\|\"); //splits the line at the |\n\t\t\t\tsetCourseNumber(header[1]);\n\t\t\t\tsetCourseName(header[0]);\n\t\t\t\tsetInstructor(header[2]);\n\t\t\t\t\n\t\t\t\twhile(file.hasNextLine ( ))\n\t\t\t\t{\n\t\t\t\t\tstr = file.nextLine ( ); //names the line\n\t\t\t\t\tString [] tokens = str.split (\"\\\\|\"); //splits the line at the |\n\t\t\t\t\tStudent p = new Student();\n\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tp.setStrNameLast (String.valueOf (tokens[0]));\n\t\t\t\t\t\tp.setStrNameFirst (String.valueOf (tokens[1]));\n\t\t\t\t\t\tp.setStrMajor (String.valueOf (tokens[2]));\n\t\t\t\t\t\tp.setClassification (tokens[3]);\n\t\t\t\t\t\tp.setiHoursCompleted (new Integer (tokens[4]).intValue ( ));\n\t\t\t\t\t\tp.setfGPA (new Float (tokens[5]).floatValue ( ));\n\t\t\t\t\t\tp.setStrStudentPhoto (String.valueOf (tokens[6]));\n\t\t\t\t\t//creates a person object and then populates it with an array of scanned input values\n\t\t\t\t\t\tclassRoll.add (p);\n\t\t\t\t\t\t}//creates a person object and then populates it with an array of scanned input values\n\t\t\t\t\t\tcatch(Exception IOException)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tIOException.printStackTrace ( );\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog (null, \"Bad input record: '\" + str + \"'\" + IOException.getMessage());\n\t\t\t\t\t\t}//pops up a message if there were any errors reading from the file\n\t\t\t\t}//continues through the file until there are no more lines to scan\n\t\t\tfile.close ( ); //closes the file\n\n\t\t\t\tif(selectedFile.exists ( )==false)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Exception();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception IOException)\n\t\t\t\t\t{\n\t\t\t\t\t\tJOptionPane.showMessageDialog (null, \"Bad input record: '\" + selectedFile + \"' \" + IOException.getMessage());\n\t\t\t\t\t}\n\t\t\t\t}//if the user picks a file that does not exist this error message will be caught.\n\t\t\t}\n\t\t}//if the input is good it will load the information from the selected file to and Array List\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.exit (0);\n\t\t\t}\n\t\tthis.saveNeed = true;\n\n\t\t}", "public void readTable() {\r\n\r\n try ( BufferedReader b = new BufferedReader(new FileReader(\"Hashdata.txt\"))) {\r\n\r\n String line;\r\n ArrayList<String> arr = new ArrayList<>();\r\n while ((line = b.readLine()) != null) {\r\n\r\n arr.add(line);\r\n }\r\n\r\n for (String str : arr) {\r\n this.load(str);\r\n }\r\n this.print();\r\n\r\n } catch (IOException e) {\r\n System.out.println(\"Unable to read file\");\r\n }\r\n\r\n this.userInterface();\r\n\r\n }", "private void loadInformation(){\n\t\ttry{\n\t\t\tFileReader fr = new FileReader(\"SpaceProgramGaussDistribution.txt\");\n\t\t\tBufferedReader br = new BufferedReader(fr);\n\t\t\tScanner sc = new Scanner(br);\n\t\t\t\n\t\t\tString info = \"\";\n\t\t\t\n\t\t\twhile(sc.hasNextLine()){\n\t\t\t\tinfo += sc.nextLine();\n\t\t\t}\n\t\t\t\n\t\t\tString split[] = info.split(\"#\");\n\t\t\t\n\t\t\tfor(int i = 0; i < split.length; i++){\n\t\t\t\tpopulationInfo += split[i]+\"\\n\";\n\t\t\t}\n\t\t\tsc.close();\n\t\t\tbr.close();\n\t\t\tfr.close();\n\t\t\t\n\t\t}catch(Exception e){\n\t\t\tSystem.out.println(\"File not found: SpaceProgramGaussDistribution.txt\");\n\t\t}\n\t}", "public void loadStaffList(String fileName) {\n try {\n BufferedReader in = new BufferedReader(new FileReader(fileName));\n maxStaff = Integer.parseInt(in.readLine());\n staffList = new Staff[maxStaff];\n int numStaffInFile = Integer.parseInt(in.readLine());\n \n for (int i = 0; i < numStaffInFile; i++){\n \n String staffType = in.readLine();\n if (staffType.equals(\"Labourer\")) {\n staffList[i] = new Labourer(in.readLine(), Integer.parseInt(in.readLine()), in.readLine(), Double.parseDouble(in.readLine()), Integer.parseInt(in.readLine()));\n numStaff++;\n } else if (staffType.equals(\"Manager\")) /*;*/\n {\n staffList[i] = new Manager(in.readLine(), Integer.parseInt(in.readLine()), in.readLine(), Double.parseDouble(in.readLine()));\n numStaff++;\n }\n }\n \n } catch (IOException iox) {\n System.out.println(\"Error reading \" + fileName);\n \n } catch (NumberFormatException ex) {\n System.out.println(\"Problem with file formatting. Please check the file and try again.\");\n }\n }", "static Employee GetEmployeeObjectFromFile(String filename)\n\t{\n\t\tEmployee e = null;\n\t try\n\t {\n\t FileInputStream fileIn = new FileInputStream(filename);\n\t ObjectInputStream in = new ObjectInputStream(fileIn);\n\t //Main read method\n\t e = (Employee) in.readObject();\n\t in.close();\n\t fileIn.close();\n\t }catch(IOException i)\n\t {\n\t i.printStackTrace();\n\t }catch(ClassNotFoundException c)\n\t {\n\t System.out.println(\"Employee class not found\");\n\t c.printStackTrace();\n\t }\n\t\treturn e;\n\t}", "public static void Load() {\n System.out.println(\"LOADED DATA:\");\n try {\n File object = new File(\"Output.txt\");\n Scanner reader = new Scanner(object);\n while (reader.hasNextLine()) {\n String info = reader.nextLine();\n System.out.println(info);\n }\n reader.close();\n } catch (FileNotFoundException e) {\n System.out.println(\"An error occurred\");\n e.printStackTrace();\n }\n System.out.println(\"|--------------------------------------------------------------| \");\n\n }", "public static List readFromACsv(String addressbookname){\n final String COMMA_DELIMITER = \",\";\n String PATH=\"C:/Users/Sukrutha Manjunath/IdeaProjects/Parctice+\" + addressbookname;\n List<Person> personList=new ArrayList<Person>();\n BufferedReader br =null;\n try{\n br=new BufferedReader(new FileReader(PATH));\n String line = \"\";\n br.readLine();\n while ((line = br.readLine()) != null)\n {\n String[] personDetails = line.split(COMMA_DELIMITER);\n\n if(personDetails.length > 0 )\n {\n //Save the employee details in Employee object\n Person person = new Person(personDetails[0],personDetails[1],personDetails[2],\n personDetails[3],personDetails[4], personDetails[5],personDetails[6]);\n personList.add(person);\n }\n }\n\n }catch (Exception ex){\n ex.printStackTrace();\n }\n finally {\n try{\n br.close();\n }\n catch (IOException e){\n e.printStackTrace();\n }\n }\n return personList;\n }", "public static void loadArrayList() throws IOException\n\t{\n\t\tString usersXPFile = \"UsersXP.txt\";\n\t\t\n\t\tFile file = new File(usersXPFile);\n\t\t\n\t\tScanner fileReader;\n\t\t\n\t\tif(file.exists())\n\t\t{\n\t\t\tfileReader = new Scanner(file);\n\t\t\twhile(fileReader.hasNext())\n\t\t\t\tuserDetail1.add(userData.addNewuser(fileReader.nextLine().trim()));\n\t\t\tfileReader.close();\n\t\t}\n\t\telse overwriteFile(usersXPFile, \"\");\n\t\t\n\t\t\n\t}", "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 void loadVehicles() throws IOException {\n File veFile = new File(VE_FILE);\n\n //Checks is file created\n if (!veFile.exists()) {\n veFile.createNewFile(); //If not, creates new file\n System.out.print(\"The data file vehicles.txt is not exits. \" +\n \"Creating new data file vehicles.txt... \" +\n \"Done!\");\n this.numberOfVehicle = 0; //New data file with the number of Vehicle is 0\n } else {\n //If file is existed, so loading this data file\n System.out.print(\"The data file vehicles.txt is found. \" +\n \"Data of vehicles is loading...\");\n\n //Loads text file into buffer\n try (BufferedReader br = new BufferedReader(new FileReader(VE_FILE))) {\n String line, contractId, type, licensePlate, chassisId, enginesId;\n\n //Reads number of vehicles\n line = br.readLine();\n if (line == null) return;\n this.numberOfVehicle = Integer.parseInt(line);\n\n for (int i = 0; i < this.numberOfVehicle; i++) {\n //Reads Vehicle's information\n contractId = br.readLine();\n type = br.readLine();\n licensePlate = br.readLine();\n chassisId = br.readLine();\n enginesId = br.readLine();\n\n\n //Create new instance of Vehicle and adds to Vehicle bank\n this.vehicles.add(new Vehicle(Integer.parseInt(contractId), type, licensePlate, chassisId, enginesId));\n }\n }\n System.out.print(\"Done!\");\n }\n }", "public void readDataFromFile() {\n System.out.println(\"Enter address book name: \");\n String addressBookFile = sc.nextLine();\n Path filePath = Paths.get(\"C:\\\\Users\\\\Muthyala Aishwarya\\\\git\" + addressBookFile + \".txt\");\n try {\n Files.lines(filePath).map(line -> line.trim()).forEach(line -> System.out.println(line));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private static void readFaculties(){\r\n try(BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(FACULTIES_CONFIG), \"Cp1252\"))){\r\n String line;\r\n while((line = br.readLine()) != null){\r\n String[] parts = line.split(\"\\t\");\r\n if(parts.length == 2){\r\n faculties.put(parts[1], parts[0]);\r\n facultyChoice.add(parts[1]);\r\n }\r\n else{\r\n Logger.getLogger(\"Helper\").log(Level.CONFIG, \"faculties.txt contains invalid data.\");\r\n }\r\n }\r\n } catch (IOException ex) {\r\n Logger.getLogger(\"Helper\").log(Level.SEVERE, null, ex);\r\n }\r\n }", "@Override\n\t// read registration records from dataFile\n\tpublic synchronized Info readInfoFromFile(){\n\t\tInfo new_StudInfo = null;\n\t\ttry{\n\t\t\t\tString newLine = br.readLine();\t// read a line from file\n\t\t\t\tif(newLine!=null){\n\t\t\t\t\t// split a record into 3 strings and an integer\n\t\t\t\t\tregInfoLine = newLine.split(\" \");\t\n\t\t\t\t\tnew_StudInfo = new StudentInfo(\n\t\t\t\t\t\t\t\t\t\tregInfoLine[0],\n\t\t\t\t\t\t\t\t\t\tregInfoLine[1],\n\t\t\t\t\t\t\t\t\t\tregInfoLine[2],\n\t\t\t\t\t\t\t\t\t\t(Integer.parseInt(regInfoLine[3])));\n\t\t\t\t}\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\tSystem.out.println(e);\n\t\t\tSystem.exit(1);\n\t\t}\n\t\treturn new_StudInfo;\n\t}", "public void loadData () {\n // create an ObjectInputStream for the file we created before\n ObjectInputStream ois;\n try {\n ois = new ObjectInputStream(new FileInputStream(\"DB/Guest.ser\"));\n\n int noOfOrdRecords = ois.readInt();\n Guest.setMaxID(ois.readInt());\n System.out.println(\"GuestController: \" + noOfOrdRecords + \" Entries Loaded\");\n for (int i = 0; i < noOfOrdRecords; i++) {\n guestList.add((Guest) ois.readObject());\n //orderList.get(i).getTable().setAvailable(false);\n }\n } catch (IOException | ClassNotFoundException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n }", "public void readFromFile(String path) {\n try {\n ArrayList<String> list = new ArrayList<>(Files.readAllLines(Paths.get(path)));\n\n for (String info: list) {\n AddressEntry entry = new AddressEntry();\n ArrayList<String> entryList = new ArrayList<>(Arrays.asList(info.split(\",\")));\n entry.setFirstName(entryList.get(0).trim());\n entry.setLastName(entryList.get(1).trim());\n entry.setStreet(entryList.get(2).trim());\n entry.setCity(entryList.get(3).trim());\n entry.setState(entryList.get(4).trim());\n entry.setZip(Integer.parseInt(entryList.get(5).trim()));\n entry.setPhone(entryList.get(6).trim());\n entry.setEmail(entryList.get(7).trim());\n add(entry);\n }\n\n System.out.println(\"Read in \" + list.size() + \" new Addresses. Successfully loaded\");\n System.out.println(\"There are currently \" + addressEntryList.size() + \" Addresses in the Address Book.\");\n }\n catch (IOException e) {\n System.out.println(e);\n }\n }", "private Employee[] readEmployees() {\n Employee[] employees = null;\n \n try (DataInputStream inputStream = new DataInputStream(new FileInputStream(\"employeeBinary.dat\"))) {\n int numEmployees = inputStream.readInt();\n employees = new Employee[numEmployees];\n \n int length;\n String name;\n String dateString;\n LocalDate date;\n Double salary;\n \n for (int n = 0; n < numEmployees; ++n) {\n length = inputStream.readInt();\n name = readFixedString(length, inputStream);\n length = inputStream.readInt();\n dateString = readFixedString(length, inputStream);\n date = LocalDate.parse(dateString);\n salary = inputStream.readDouble();\n Employee temp = new Employee(name, salary, date);\n employees[n] = temp;\n }\n \n } catch (IOException e) {\n e.printStackTrace();\n }\n return employees;\n }", "public void readDataFromFile(){\n try {\n weatherNow.clear();\n // Open File\n Scanner scan = new Scanner(context.openFileInput(fileSaveLoc));\n\n // Find all To Do items\n while (scan.hasNextLine()) {\n String line = scan.nextLine();\n\n // if line is not empty it is data, add item.\n if (!line.isEmpty()) {\n // first is the item name and then the item status.\n String[] readList = line.split(\",\");\n String city = readList[0];\n String countryCode = readList[1];\n double temp = Double.parseDouble(readList[2]);\n String id = readList[3];\n String description = readList[4];\n\n weatherNow.add(new WeatherNow(city,countryCode, temp, id, description));\n }\n }\n\n // done\n scan.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void readFromFile() {\n\n\t}", "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 void loadDataFromFile(String name) throws FileNotFoundException {\n\t\tFileReader reader = new FileReader(name);\n\t\tScanner in = new Scanner(reader);\n\t\twhile(in.hasNextLine()) {\n\t\t\tString readName = \"\";\n\t\t\tString readScore = \"\";\n\t\t\tint intScore = 0;\n\t\t\treadName = in.nextLine();\n\t\t\treadScore = in.nextLine();\n\t\t\ttry {\n\t\t\tintScore = Integer.parseInt(readScore);\n\t\t\t}\n\t\t\tcatch(NumberFormatException e){\n\t\t\t\tSystem.out.println(\"Incorrect format for \" + readName + \" not a valid score: \" + readScore);\n\t\t\t\tSystem.out.println();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tstudents.add(new Student(readName,intScore));\n\t\t}\n\t}", "public void adminLoad() {\n try {\n File file = new File(adminPath);\n Scanner scanner = new Scanner(file);\n while (scanner.hasNextLine()){\n String data = scanner.nextLine();\n String[]userData = data.split(separator);\n AdminAccounts adminAccounts = new AdminAccounts();\n adminAccounts.setUsername(userData[0]);\n adminAccounts.setPassword(userData[1]);\n users.add(adminAccounts);\n }\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }", "public void readAndPrint(String fileName)\n\t{\n\t\tString[] names = null;\n\t\tFile file = new File(fileName);\n\t\tScanner sc;\n\t\ttry {\n\t\t\tsc = new Scanner(file);\n\t\t\twhile (sc.hasNextLine()) {\n\t\t\t\tString line = sc.nextLine();\n\t\t\t\tString[] tokens = line.split(\" \");\n\t\t\t\tSystem.out.println(\"Person: \" + tokens[0] + \", \" + \n\t\t\t\t\"Age: \" + tokens[1] + \" \");\n\t\t\t\tSystem.out.print(tokens[0] + \",\");\n\t\t\t}\n\t\t} \n\t\tcatch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\n\t\t\t//process the information\n\t\t}\n\n\t\t//System.out.println(\"readAndPrint NOT IMPLEMENTED\");\n\t}", "public void load(String inFN) throws FileNotFoundException\n {\n String check = \" \";\n \tfile = new Scanner(new FileReader(inFN));\n \n \t// Rip apart the string and find the number of cities\n \t// Save it to a misc string named fileInfo\n \twhile (!check.equals(\"NODE_COORD_SECTION\"))\n {\n \tcheck = file.next();\n \t// Get the number of cities from the file\n \tif (check.equals(\"DIMENSION\"))\n \t{\n \t\t// Removes the character ':'\n \t\tcheck = file.next();\n \t\tfileInfo = fileInfo + check + \" \";\n \t\t\n \t\t// Extracts the number of cities\n \t\tcityNumber = file.nextInt();\n \t\tfileInfo = fileInfo + cityNumber + \" \";\n \t}\n \t\n \t// Dumps the fileinfo into one string\n \tfileInfo = fileInfo + check + \" \";\n }\n\n \t// Now that we have the number of cities, use it to\n \t// initialize an array\n \tcity = new City[cityNumber];\n \t\n \t// Loads the city data from the file into the city array\n \tfor (int i = 0; i < cityNumber; i++)\n {\n \t\tfile.nextInt();\n \tcity[i] = new City(i, file.nextDouble(), file.nextDouble());\n \t}\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 }", "public void loadFile(String fileName) {//Retrieves name of file\r\n\t\tString line = null;\r\n\t\ttry{\r\n\t\t\tFileReader open = new FileReader(fileName);\r\n\t\t\tBufferedReader read = new BufferedReader(open);\r\n\t\t\twhile((line = read.readLine()) != null) {\r\n String[] parts = line.split(\" \");\r\n String part1 = parts[0];\r\n String part2 = parts[1];\r\n System.out.println(part1 + part2);\r\n \r\n\t\t\t\r\n\t\t\t}read.close();}\r\n\t\tcatch(FileNotFoundException ex) {\r\n System.out.println(\r\n \"Unable to open file '\" + \r\n fileName + \"'\"); } \r\n\t\tcatch(IOException ex) {\r\n System.out.println(\r\n \"Error reading file '\" \r\n + fileName + \"'\"); }\r\n\t}", "public void printData(String path , boolean isEmployee) {\n try {\n\n FileReader fileReader = new FileReader(path);\n BufferedReader buffReader = new BufferedReader(fileReader);\n String line ;\n boolean firstLine = true;\n\n // reading csv file and setting to person proto\n while((line = buffReader.readLine()) != null)\n {\n if ( firstLine) {\n firstLine = false;\n continue;\n }\n String [] data = line.split(\",\");\n\n if (isEmployee)\n readEmployeeData(data);\n else\n readBuildingData(data);\n }\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void load(Path fileName) throws IOException {\n try(BufferedReader reader = Files.newBufferedReader(fileName)) {\n String line = \"\";\n\n // Matches lines with the format:\n // key=value\n // where the key is any sequence of lowercase letters. (a to z)\n // where value may be any letters from a to z (case insensitive) 0 to 9 or the letters '-' and '.'.\n Pattern validLine = Pattern.compile(\"^(?<key>[a-z]+)=(?<value>[a-zA-Z0-9-.]+)$\");\n\n // Read the file line by line\n while((line = reader.readLine()) != null) {\n if(line.startsWith(\";\")) { // Ignore lines that start with ;\n continue;\n }\n\n // Remove any whitespace\n line = line.trim();\n\n // Continue if our line is empty\n if(\"\".equals(line)) {\n continue;\n }\n\n Matcher matcher = validLine.matcher(line);\n\n if(!matcher.matches() || matcher.groupCount() != 2) {\n System.err.println(\"Unable to parse line: \" + line);\n continue;\n }\n\n String key = matcher.group(\"key\");\n String value = matcher.group(\"value\");\n\n map.put(key, value);\n }\n }\n }", "private void loadUsers() throws IOException {\n File accounts = new File(\"accounts.txt\");\n if (!accounts.exists()) {\n accounts.createNewFile();\n }\n\n FileInputStream fileInputStream = new FileInputStream(accounts);\n BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(fileInputStream));\n\n for (String line = bufferedReader.readLine(); line != null; line = bufferedReader.readLine()) {\n String[] pair = line.split(\":\");\n userAccounts.put(pair[0], pair[1]);\n }\n }", "static public Employee getEmployeeFromString(String lineRead){\n\t\tString[] newEmployee = lineRead.split(\",\");\n\t\tString name = newEmployee[0];\n\t\tFloat number = Float.parseFloat(newEmployee[1]);\n\t\tDepartment department = Department.valueOf(newEmployee[2]);\n\t\tEmployee finalEmployee = new Employee(name, number, department);\n\t\treturn finalEmployee;\n\t}", "void fileReader(String filename) \r\n\t\t{\r\n\r\n\t\ttry (Scanner s = new Scanner(new FileReader(filename))) { \r\n\t\t while (s.hasNext()) { \r\n\t\t \tString name = s.nextLine(); // read name untill space\r\n\t\t \tString str[] = name.split(\",\");\r\n\t\t \tString nam = str[0]; \r\n\t\t \tint number = Integer.parseInt(str[1]); // read number untill space\r\n\t\t this.addContact(nam, number);\r\n\t\t\r\n\t\t }\t\t \r\n\t\t \r\n\t\t} \r\n\t\tcatch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t}", "public void readCustomerDetails()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tScanner reader = new Scanner(new FileReader(\"customersWhoPurchased.txt\"));\r\n\t\t\twhile (reader.hasNext())\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(reader.nextLine());\r\n\t\t\t}\r\n\t\t\treader.close();\r\n\t\t}\r\n\t\tcatch(FileNotFoundException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"FileNotFoundException\");\r\n\t\t}\r\n\t}", "public void loadMembers(String filename) {\n try {\r\n Scanner input = new Scanner(new File(filename));\r\n // keep going until the end \r\n while (input.hasNext()) {\r\n String name = input.nextLine();\r\n String address = input.nextLine();\r\n String onLoan = input.nextLine();\r\n // add the member \r\n addMember(name, address);\r\n \r\n if (!onLoan.equals(\"NONE\")) {\r\n \r\n }\r\n }\r\n } catch (FileNotFoundException e) {\r\n // print an error message \r\n System.err.println(\"File not found\");\r\n }\r\n }", "public void loadData(){\n try {\n entities.clear();\n\n DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();\n Document document = documentBuilder.parse(fileName);\n\n Node root = document.getDocumentElement();\n NodeList nodeList = root.getChildNodes();\n for (int i = 0; i < nodeList.getLength(); i++){\n Node node = nodeList.item(i);\n if (node.getNodeType() == Node.ELEMENT_NODE){\n Element element = (Element) node;\n Department department = createDepartmentFromElement(element);\n try{\n super.save(department);\n } catch (RepositoryException | ValidatorException e) {\n e.printStackTrace();\n }\n }\n }\n } catch (SAXException | ParserConfigurationException | IOException e) {\n e.printStackTrace();\n }\n }", "private void loadDataFromFile() {\n boolean isLoggedInNew = na.isLoggedIn();\n boolean isLoggedIn = uL.isLoggedIn();\n // load data for new users after sucsessful new account creation\n if (isLoggedInNew) {\n String username = na.getUsername();\n String fileExt = \"_data.txt\";\n String workingDirectory = System.getProperty(\"user.dir\");\n String filePath = workingDirectory + \"\\\\\" + username + fileExt;\n File file = new File(filePath);\n try {\n FileReader fr = new FileReader(file);\n BufferedReader br = new BufferedReader(fr);\n DefaultTableModel model = (DefaultTableModel) remindersTable.getModel();\n Object[] lines = br.lines().toArray();\n for (int i = 0; i < lines.length; i++) {\n String[] row = lines[i].toString().split(\"\\t\");\n model.addRow(row);\n }\n } catch (FileNotFoundException ex) {\n Logger.getLogger(MoneyMinderDesktopMainGui.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n // load data for existing users after sucsessful login\n if (isLoggedIn) {\n String username = uL.getUsername();\n String fileExt = \"_data.txt\";\n String workingDirectory = System.getProperty(\"user.dir\");\n String filePath = workingDirectory + \"\\\\\" + username + fileExt;\n File file = new File(filePath);\n try {\n FileReader fr = new FileReader(file);\n BufferedReader br = new BufferedReader(fr);\n DefaultTableModel model = (DefaultTableModel) remindersTable.getModel();\n Object[] lines = br.lines().toArray();\n for (int i = 0; i < lines.length; i++) {\n String[] row = lines[i].toString().split(\"\\t\");\n model.addRow(row);\n }\n } catch (FileNotFoundException ex) {\n Logger.getLogger(MoneyMinderDesktopMainGui.class.getName()).log(Level.SEVERE, null, ex);\n }\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 void loadData() throws Exception {\n List<Student> listOfStudents = new ArrayList<>();\n DocumentBuilderFactory documentBuilderFactory =\n DocumentBuilderFactory.newInstance();\n\n DocumentBuilder documentBuilder =\n documentBuilderFactory.newDocumentBuilder();\n Document document = documentBuilder.parse(XMLfile);\n Element root = document.getDocumentElement();\n\n NodeList nodes = root.getChildNodes();\n int len = nodes.getLength();\n for (int i = 0; i < len; i++) {\n Node studentNode = nodes.item(i);\n if (studentNode instanceof Element) {\n Student b = createStudent((Element) studentNode);\n listOfStudents.add(b);\n }\n }\n Map<Long, Student> map= new HashMap<>();\n for (Student s : listOfStudents){\n map.putIfAbsent(s.getId(),s);\n }\n this.setEntities(map);\n }", "private void readFile() {\r\n\t\tcsvEntrys = new ArrayList<>();\r\n\t\tString line = \"\";\r\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(new File(filepath)))) {\r\n\t\t\twhile ((line = br.readLine()) != null) {\r\n\t\t\t\tif (!line.contains(\"id\")) {\r\n\t\t\t\t\tcsvEntrys.add(line);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public static void main(String[] args) throws Exception {\n\t\tFileInputStream fis=new FileInputStream(\"emp.txt\");\n\t\t//Object o=ois.readObject();\n\t\tObjectInputStream ois=new ObjectInputStream(fis);\t\t\t\t\t//typecast (deserilisation)\n\t\tEmployee o=(Employee)ois.readObject();\n\t\t///Employee e=(Employee)o;\t\t\t\t\t\t\t\t\t\t\t//another way to typecast the obj\n\t\tSystem.out.println(o.getEmpid());\n\t\tSystem.out.println(o.getEmpName());\n\t\t\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 }", "@Override\n public void load() {\n File file = new File(path + \"/\" + \"rooms.txt\"); //Hold file of the riddles. riddles.txt should be placed in the root folder.\n Scanner scanner = null; //if the scanner can't load the file.\n\n try {\n scanner = new Scanner(file); // scanner for the file\n } catch (FileNotFoundException ex) {\n try {\n //if not such file exists create it.\n file.createNewFile();\n } catch (IOException ex1) {\n Logger.getLogger(LoadRooms.class.getName()).log(Level.SEVERE, null, ex1);\n return;\n }\n }\n while (scanner.hasNextLine()) { //if scanner har fundt next line of text in the file\n switch (scanner.nextLine()) {\n case \"[Room]:\": //if scanner fundt \"[Room]:\" case, get rooms attributes\n state = LOAD_ATTRIBUTES;\n break;\n case \"[Connections]:\"://if scanner fundt \"[Connections]:\" case, get connections from file\n state = LOAD_CONNECTIONS;\n break;\n\n default:\n break;\n }\n switch (state) {\n case LOAD_ATTRIBUTES: //case, that get rooms attributes and add them to room_list\n String name = scanner.nextLine();\n int timeToTravel = Integer.parseInt(scanner.nextLine());\n boolean isLocked = Boolean.parseBoolean(scanner.nextLine());\n boolean isTransportRoom = Boolean.parseBoolean(scanner.nextLine());\n Room newRoom = new Room(name, timeToTravel, isLocked, isTransportRoom);\n if (newRoom.isTransportRoom()) {\n newRoom.setExit(\"exit\", newRoom);\n newRoom.setExitDir(\"west\", newRoom);\n }\n rooms_list.add(newRoom);\n break;\n case LOAD_CONNECTIONS: //case that get connections betweem rooms in game\n while (scanner.hasNextLine()) {\n String[] string = scanner.nextLine().split(\",\");\n Room room = this.getRoomByName(string[0]);\n room.setExit(string[1], this.getRoomByName(string[1]));\n if (!this.getRoomByName(string[1]).isTransportRoom() && !room.isTransportRoom()) {\n room.setExitDir(string[2], getRoomByName(string[1]));\n }\n }\n break;\n default:\n break;\n }\n }\n }", "public static void readRecords() {\n\t\t\n\t\tSystem.out.printf(\"%-10s%-12s%-12s%10s%n\", \"Account\", \"First Name\", \"Last Name\", \"Balance\");\n\t\t\n\t\ttry {\n\t\t\twhile (input.hasNext()) {\n\t\t\t\tSystem.out.printf(\"%-10s%-12s%-12s%10.2f%n\", input.nextInt(), input.next(), input.next(), input.nextDouble());\n\t\t\t\n\t\t\t}\n\t\t}\n\t\tcatch (NoSuchElementException elementException) {\n\t\t\tSystem.out.println(elementException);\n\t\t\tSystem.err.println(\"File improperly formed. Terminating.\");\n\t\t}\n\t\tcatch (IllegalStateException stateException)\n\t\t{\n\t\t\tSystem.err.println(\"Error reading from file. Terminating.\");\n\t\t}\n\t\t\t\n\t\t}", "public void readFromFile(String fileName)\r\n\t{\r\n\r\n\t\tScanner fileScanner = null;\r\n\t\ttry\r\n\t\t{\r\n\t\t\tfileScanner = new Scanner(new File(fileName));\r\n\t\t}\r\n\t\tcatch(FileNotFoundException e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\twhile(fileScanner.hasNext())\r\n\t\t{\r\n\t\t\tString fileLine = fileScanner.nextLine();\r\n\t\t\tString[] splitLines = fileLine.split(\" \",2);\r\n\t\t\t//checks each word and makes sure it is ok\r\n\t\t\tif(splitLines[0].equalsIgnoreCase(\"Name\"))\r\n\t\t\t{\r\n\t\t\t\tname = splitLines[1];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(splitLines[0].equalsIgnoreCase(\"Speed\"))\r\n\t\t\t{\r\n\t\t\t\tspeed = Double.parseDouble(splitLines[1]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(splitLines[0].equalsIgnoreCase(\"Strength\"))\r\n\t\t\t{\r\n\t\t\t\tstrength = Integer.parseInt(splitLines[1]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(splitLines[0].equalsIgnoreCase(\"HP\"))\r\n\t\t\t{\r\n\t\t\t\thp = Integer.parseInt(splitLines[1]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(splitLines[0].equalsIgnoreCase(\"Weapon\"))\r\n\t\t\t{\r\n\t\t\t\t\tweapon = splitLines[1];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tfileScanner.close();\r\n\t\r\n\t}", "public Account load() throws IOException {\n Account account = new Account();\n try {\n FileReader fileReader = new FileReader(fileName);\n BufferedReader bufferedReader = new BufferedReader(fileReader);\n String line;\n while ((line = bufferedReader.readLine()) != null) {\n //if (line.contains(\"#\")) { continue; }\n String[] info = line.split(\" @ \");\n\n switch (info[0]) {\n case \"INIT\":\n account.setToInitialize(Boolean.parseBoolean(info[1]));\n break;\n case \"BS\":\n account.setBaseSavings(Float.parseFloat((info[1])));\n break;\n case \"INC\":\n parseIncome(info, account);\n break;\n case \"EXP\":\n parseExpenditure(info, account);\n break;\n case \"G\":\n parseGoal(info, account);\n break;\n case \"INS\":\n parseInstalment(info, account);\n break;\n case \"LOA\":\n parseLoan(info, account);\n break;\n case \"BAN\":\n parseBankAccount(info, account);\n break;\n default:\n throw new DukeException(\"OOPS!! Your file has been corrupted/ input file is invalid!\");\n }\n }\n bufferedReader.close();\n } catch (FileNotFoundException err) {\n final File parentDir = new File(\"dataFG\");\n parentDir.mkdir();\n final String hash = \"moneyAccount\";\n final String fileName = hash + \".txt\";\n final File file = new File(parentDir, fileName);\n file.createNewFile();\n } catch (IOException | DateTimeParseException | DukeException e) {\n e.printStackTrace();\n }\n return account;\n }", "private void loadFromFile(String fileName) {\n try {\n InputStream inputStream = this.openFileInput(fileName);\n if (inputStream != null) {\n ObjectInputStream input = new ObjectInputStream(inputStream);\n boardManager = (BoardManager) input.readObject();\n inputStream.close();\n }\n } catch (FileNotFoundException e) {\n Log.e(\"login activity\", \"File not found: \" + e.toString());\n } catch (IOException e) {\n Log.e(\"login activity\", \"Can not read file: \" + e.toString());\n } catch (ClassNotFoundException e) {\n Log.e(\"login activity\", \"File contained unexpected data type: \" + e.toString());\n }\n }", "@Test\n public void testTaxpayerInfoFromTxt() throws FileNotFoundException {\n\n Database.processTaxpayersDataFromFilesIntoDatabase(databaseInstance.getTaxpayersInfoFilesPath(), txtTestFilenameList);\n\n // Get the taxpayer from the Database\n Taxpayer actualTaxpayerInfoTxt = databaseInstance.getTaxpayerFromArrayList(0);\n\n // Test user info from txt file\n Taxpayer expectedTaxpayerInfoTxt = new Taxpayer(\"Apostolos Zarras\", \"130456093\",\n ApplicationConstants.MARRIED_FILING_JOINTLY, \"22570\");\n\n Receipt expectedTaxpayerReceiptFromTxt =\n new Receipt(ApplicationConstants.BASIC_RECEIPT, \"1\", \"25/2/2014\", \"2000\",\n \"Hand Made Clothes\", \"Greece\", \"Ioannina\", \"Kaloudi\", \"10\");\n\n expectedTaxpayerInfoTxt.setReceipts(new ArrayList<>( Collections.singletonList(expectedTaxpayerReceiptFromTxt)));\n expectedTaxpayerInfoTxt.calculateTaxpayerTaxIncreaseOrDecreaseBasedOnReceipts();\n\n assertEquals(expectedTaxpayerReceiptFromTxt.toString(), actualTaxpayerInfoTxt.getReceipts().get(0).toString());\n assertEquals(expectedTaxpayerInfoTxt.toString(), actualTaxpayerInfoTxt.toString());\n\n }", "public void readUserFile (){\n try {\n FileReader reader = new FileReader(fileName);\n BufferedReader bufferedReader = new BufferedReader(reader);\n String line;\n while ((line = bufferedReader.readLine()) != null) {\n Scanner s = new Scanner(line); //use of a scanner to parse the line and assign its tokens to different variables\n//each line corresponds to the values of a User object\n while(s.hasNext()){\n String usrname = s.next();\n String pass = s.next();\n User u = new User(usrname,pass);\n userlist.add(u);//added to the list\n }\n \n }\n reader.close();\n \n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void readPatient() {\n\t\tBufferedReader br;\n\t\tString s;\n\t\ttry {\n\t\t\tbr = new BufferedReader(new FileReader(\"patients.txt\"));\n\n\t\t\twhile ((s = br.readLine()) != null) {\n\t\t\t\tString[] fields = s.split(\", \");\n\n\t\t\t\tString ssn = fields[0];\n\t\t\t\tString name = fields[1];\n\t\t\t\tString address = fields[2];\n\t\t\t\tString phoneNum = fields[3];\n\t\t\t\tString insurance = fields[4];\n\t\t\t\tString currentMeds = fields[5];\n\t\t\t\tPatient patient = new Patient(ssn, name, address, phoneNum, insurance, currentMeds);\n\t\t\t\tpat.add(patient);\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\n\t}", "private void loadApplication() throws Exception{\n\t\t\n\t\tBufferedReader br = new BufferedReader(new FileReader(this.appfile));\n\t\tString line;\n\t\t\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tif (line.equals(\"Date\")){\n\t\t\t\tline = br.readLine();\n\t\t\t\tsetDate(line);\n\t\t\t}\n\t\t\telse if (line.equals(\"GPA\")){\n\t\t\t\tline = br.readLine();\n\t\t\t\tdouble newGPA = Double.parseDouble(line);\n\t\t\t\tsetGPA(newGPA);\n\t\t\t}\n\t\t\telse if (line.equals(\"Education Level\")){\n\t\t\t\tline = br.readLine();\n\t\t\t\tsetEducationLevel(line);\n\t\t\t}\n\t\t\telse if (line.equals(\"Status\")){\n\t\t\t\tline = br.readLine();\n\t\t\t\tsetStatus(line);\n\t\t\t}\n\t\t\telse if (line.equals(\"Priority\")){\n\t\t\t\tline = br.readLine();\n\t\t\t\tint newPriority = Integer.parseInt(line);\n\t\t\t\tsetPriority(newPriority);\n\t\t\t}\n\t\t}\n\t\tbr.close();\t\n\t}", "public String detailsLoad() throws Exception {\n\t\treturn null;\n\t}", "public void readData() throws FileNotFoundException {\n this.plane = readPlaneDimensions();\n this.groupBookingsList = readBookingsList();\n }", "@Test\n\tpublic void testReadFacultyRecords() throws FileNotFoundException {\n\t\t// testing valid Faculty records\n\t\ttry {\n\t\t\tLinkedList<Faculty> facultys = FacultyRecordIO.readFacultyRecords(\"test-files/faculty_records.txt\");\n\t\t\tassertEquals(8, facultys.size());\n\n\t\t\tfor (int i = 0; i < facultys.size(); i++) {\n\t\t\t\tassertEquals(validFacultys[i], facultys.get(i).toString());\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\tfail(\"Unexpected error reading \" + \"faculty_records.txt\");\n\t\t}\n\t\t// testing file that does not exist\n\t\tLinkedList<Faculty> facultys = null;\n\t\ttry {\n\t\t\tfacultys = FacultyRecordIO.readFacultyRecords(\"test-files/fake_file.txt\");\n\t\t\tassertEquals(0, facultys.size());\n\t\t} catch (FileNotFoundException e) {\n\t\t\tassertEquals(facultys, null);\n\t\t}\n\t\t// testing file that is empty\n\t\ttry {\n\t\t\tfacultys = FacultyRecordIO.readFacultyRecords(\"test-files/Empty_File.txt\");\n\t\t\tassertEquals(0, facultys.size());\n\t\t} catch (FileNotFoundException e) {\n\t\t\tassertEquals(facultys, null);\n\t\t}\n\t\t// testing invalid Faculty records\n\t\ttry {\n\t\t\tfacultys = FacultyRecordIO.readFacultyRecords(\"test-files/invalid_faculty_records.txt\");\n\t\t\tassertEquals(0, facultys.size());\n\t\t} catch (IllegalArgumentException e) {\n\t\t\tassertEquals(0, facultys.size());\n\t\t}\n\n\t}", "public void importStudents(String fileName) throws FileNotFoundException\n {\n Scanner inf = new Scanner(new File(fileName));\n while(inf.hasNextLine())\n {\n String first = inf.nextLine();\n String last = inf.nextLine();\n String password = inf.nextLine();\n String p1 = inf.nextLine();\n String p2 = inf.nextLine();\n String p3 = inf.nextLine();\n String p4 = inf.nextLine();\n String p5 = inf.nextLine();\n String p6 = inf.nextLine();\n String p7 = inf.nextLine();\n String p8 = inf.nextLine();\n \n students.add(new Student(first, last, password, p1, p2, p3, p4, p5, p6, p7, p8, this));\n }\n }", "private void loadFromFile() {\n\t\ttry {\n\t\t\tFileInputStream fis = openFileInput(FILENAME);\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(fis));\n\t\t\tString line = in.readLine();\n\t\t\tGson gson = new Gson();\n\t\t\twhile (line != null) {\n\t\t\t\tCounterModel counter = gson.fromJson(line, CounterModel.class);\n\t\t\t\tif (counterModel.getCounterName().equals(counter.getCounterName())) {\n\t\t\t\t\tcounterListModel.addCounterToList(counterModel);\n\t\t\t\t\tcurrentCountTextView.setText(Integer.toString(counterModel.getCount()));\n\t\t\t\t} else {\n\t\t\t\t\tcounterListModel.addCounterToList(counter);\n\t\t\t\t}\n\t\t\t\tline = in.readLine();\n\t\t\t} \n\t\t\tfis.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void loadFacultyFromFile(String filename) {\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tfacultyDirectory = FacultyRecordIO.readFacultyRecords(filename);\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tthrow new IllegalArgumentException(\"Unable to read file \" + filename);\r\n\t\t}\r\n\t}", "public void importUsers(String filename) throws Exception {\r\n\t\tFileReader fr = new FileReader(filename);\r\n\t\tBufferedReader br = new BufferedReader(fr);\r\n\t\t\r\n\t\twhile(true) {\r\n\t\t\tString line = br.readLine();\r\n\t\t\tif (line == null)\r\n\t\t\t\tbreak;\r\n\t\t\tString[] tokens = line.split(\",\");\r\n\t\t\tString userLastName = tokens[0].trim();\r\n\t\t\tString userFirstName = tokens[1].trim();\r\n\t\t\tString userMiddleName = tokens[2].trim();\t\t\t\r\n\t\t\tString email = tokens[3].trim();\r\n\t\t\tString userName = tokens[4].trim();\r\n\t\t\tString password = tokens[5].trim();\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Line:\"+line);\r\n\t\t\tSystem.out.println(\"LastName:\"+userLastName);\r\n\t\t\tSystem.out.println(\"FirstName:\"+userFirstName);\r\n\t\t\tSystem.out.println(\"MiddleName:\"+userMiddleName);\r\n\t\t\tSystem.out.println(\"Email:\"+email);\r\n\t\t\tSystem.out.println(\"UserName:\"+userName);\r\n\t\t\tSystem.out.println(\"Password:\"+password);\r\n\t\t\t\r\n\t\t\tUser user = new User();\r\n\t\t\tuser.setLastName(userLastName);\r\n\t\t\tuser.setFirstName(userFirstName);\r\n\t\t\tuser.setMiddleName(userMiddleName);\r\n\t\t\tuser.setEmailAddress(email);\r\n\t\t\tuser.setUserName(userName);\r\n\t\t\tuser.setPassword(password);\t\t\t\r\n\t\t\tuser.setStatus(UserStatus.ACTIVE);\r\n\t\t\t\r\n\t\t\tem.persist(user);\r\n\t\t}\r\n\t\t\r\n\t\tbr.close();\r\n\t\tfr.close();\r\n\t}", "public void readFromFile() {\n FileInputStream fis = null;\n try {\n //reaad object\n fis = new FileInputStream(file);\n ObjectInputStream ois = new ObjectInputStream(fis);\n TravelAgent travelAgent = (TravelAgent)ois.readObject();\n travelGUI.setTravelAgent(travelAgent);\n ois.close();\n }\n catch (Exception e) {\n System.out.println(e.getMessage());\n if (fis != null) {\n try {\n fis.close();\n }\n catch (IOException e2) {\n System.out.println(e2.getMessage());\n }\n }\n return;\n }\n finally {\n if (fis != null) {\n try {\n fis.close();\n }\n catch (IOException e2) {\n System.out.println(e2.getMessage());\n }\n }\n }\n if (fis != null) {\n try {\n fis.close();\n }\n catch (IOException e2) {\n System.out.println(e2.getMessage());\n }\n }\n }", "public void load(String fileName) throws Exception {\n\t\tTolvenLogger.info(\"Uploading Lab Orders list from: \" + fileName, LoadLabOrder.class);\n BufferedReader reader;\n reader = new BufferedReader(new InputStreamReader(new FileInputStream( new File(fileName)),\"ISO-8859-1\"));\n String record;\n String fields[];\n int rowCount = 0;\n while (reader.ready()) {\n rowCount++;\n record = reader.readLine();\n // Might break out early if requested\n if (rowCount > getIterationLimit()) {\n \t\tTolvenLogger.info( \"Upload stopped early due to \" + UPLOAD_LIMIT + \" property being set\", LoadLabOrder.class);\n \tbreak;\n }\n // Skip the heading line\n if (rowCount==1) continue;\n fields = record.split(\"\\\\t\",13);\n\t\t \tStringWriter bos = new StringWriter();\n\t\t\tXMLOutputFactory factory = XMLOutputFactory.newInstance();\n\t\t\tXMLStreamWriter writer = factory.createXMLStreamWriter(bos);\n\t\t\twriter.writeStartDocument(\"ISO-8859-1\", \"1.0\" );\n\t\t\tgenerateTrim( fields, writer );\n\t\t\twriter.writeEndDocument();\n//\t\t\twriter.flush();\n\t\t\twriter.close();\n\t\t\tbos.close();\n\t\t\t/*String trimName = */generateName(fields);\n\t\t\t//TolvenLogger.info(\"Lab Order Trim: \" + bos.toString(), LoadLabOrder.class);\n\t\t\tcreateTrimHeader(bos.toString());\n\t\t\t/*\n\t\t\ttrims.add(bos.toString());\n\t\t\tif (trims.size() >= BATCH_SIZE ) {\n\t\t\t\tTolvenLogger.info( \"Load batch\", LoadLabOrder.class );\n\t\t\t\tgetTrimBean().createTrimHeaders(trims.toArray(new String[0]), null, \"LoadLabOrders\", true);\n\t\t\t\ttrims.clear();\n\t\t\t}\n\t\t\t*/\t\t\t\n }\n /*\n // Send unfinished batch, if any.\n\t\tif (trims.size() > 0 ) {\n\t\t\tgetTrimBean().createTrimHeaders(trims.toArray(new String[0]), null, \"LoadLabOrders\", true);\n\t\t}\n\t\t*/\n\t\tTolvenLogger.info( \"Count of Lab Orders uploaded: \" + (rowCount-1), LoadLabOrder.class);\n\t\tTolvenLogger.info( \"Activating headers... \", LoadLabOrder.class);\n\t\t// getTrimBean().queueActivateNewTrimHeaders();\n\t\tactivate(); \n\t}", "private void loadData() {\n FileInputStream fis;\n\n try {\n fis = openFileInput(DATA_FILE);\n user = (User) new JsonReader(fis).readObject();\n fis.close();\n } catch(Exception e) {\n Log.i(\"Exception :\", e.toString());\n }\n }", "private void loadCheckingAccounts(String checkingAccountFileName)\n {\n try\n {\n /* Open the file to read */\n File inputFile = new File(checkingAccountFileName);\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 //parse 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 int overdraftSavingsAccountId = Integer.parseInt(splitLine[5]);\n boolean isGoldDiamond = Boolean.parseBoolean(splitLine[6]);\n\n Checking checkingAccount = new Checking(accountId,\n balance,\n ssn,\n interestRate,\n dateOpened,\n overdraftSavingsAccountId,\n isGoldDiamond);\n\n ArrayList<Transaction> accountTransactions = transactionHashMap.get(accountId);\n checkingAccount.setTransactions(accountTransactions);\n\n //add checking account...\n accounts.add(checkingAccount);\n }\n\n input.close();\n\n } catch (Exception e)\n {\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}", "private HashMap<String, SubsetElement> LoadFile(String fileName) {\n final HashMap<String, SubsetElement> tempMap = new HashMap<String, SubsetElement>();\r\n try {\r\n final Scanner input = new Scanner(new File(fileName));\r\n String line = input.nextLine();\r\n final String[] headers = line.split(\"\\t\");\r\n\r\n Integer i = 1;\r\n while (input.hasNext()) {\r\n line = input.nextLine();\r\n final String[] values = line.split(\"\\t\");\r\n // if(values.length!=headers.length){\r\n // System.out.println(\"Missing values in data row \"+ i);\r\n // break;\r\n // }\r\n\r\n final SubsetElement element = new SubsetElement(headers,\r\n values, this.subsetIdName, this.conceptIdName);\r\n tempMap.put(element.getHash(), element);\r\n i++;\r\n }\r\n input.close();\r\n\r\n } catch (final FileNotFoundException e) {\r\n System.err.println(\"Unable to open and parse file \" + fileName);\r\n e.printStackTrace();\r\n }\r\n\r\n return tempMap;\r\n }", "public void readPatientListFromFile()\r\n\t{\n\t\tnextPatientLocation = 0;\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//Makes file reader objects and passes filename\r\n\t\t\tFileReader fr = new FileReader(patientMasterfile);\r\n\t\t\tBufferedReader br = new BufferedReader(fr);\r\n\r\n\t\t\t//reads first line and makes a blank patient \r\n\t\t\tString aReadLine = br.readLine();\r\n\t\t\tPatient tempRead = new Patient();\r\n\t\t\t//loops through all lines in the file\r\n\t\t\twhile(aReadLine != null)\r\n\t\t\t{\r\n\t\t\t\t//resets patient to null\r\n\t\t\t\ttempRead = new Patient();\r\n\t\t\t\t//Splits the read in data and assigns that data to the appropriate attribute \r\n\t\t\t\tString[] splitPatientData = aReadLine.split(\"~~\");\r\n\r\n\t\t\t\ttempRead.patientID = splitPatientData[0];\r\n\t\t\t\ttempRead.forename = splitPatientData[1];\r\n\t\t\t\ttempRead.surname = splitPatientData[2];\r\n\t\t\t\ttempRead.username = splitPatientData[3];\r\n\t\t\t\ttempRead.password = splitPatientData[4];\r\n\t\t\t\ttempRead.houseNumber = splitPatientData[5];\r\n\t\t\t\ttempRead.postcode = splitPatientData[6];\r\n\t\t\t\ttempRead.telephoneNumber = splitPatientData[7];\r\n\t\t\t\ttempRead.dob = splitPatientData[8];\r\n\t\t\t\ttempRead.mode = splitPatientData[9];\r\n\t\t\t\t//adds patient to list and gets the next line\r\n\t\t\t\taddPatientToList(tempRead);\r\n\t\t\t\taReadLine = br.readLine();\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t//catches any exceptions trown by reading \r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Error reading file, \");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void getOldFile() throws FileNotFoundException, IOException, ClassNotFoundException{\r\n\t\tObjectInputStream ois = new ObjectInputStream(new FileInputStream(\"agenda.txt\"));\r\n\t\tArrayList<Artist> inputArtists = (ArrayList<Artist>) ois.readObject();\r\n\t\tArrayList<Stage> inputStages = (ArrayList<Stage>) ois.readObject();\r\n\t\tArrayList<Performance> inputPerformances = (ArrayList<Performance>) ois.readObject();\r\n\t\tartists.addAll(inputArtists);\r\n\t\tstages.addAll(inputStages);\r\n\t\tperformances.addAll(inputPerformances);\r\n\t}", "public static void main(String[] args) throws IOException {\n\t\tScanner s=new Scanner(System.in);\r\n\t\tSystem.out.println(\"Main Menu\");\r\n\t\tSystem.out.println(\"1. Add an Employee\");\r\n\t\tSystem.out.println(\"2. Display All\");\r\n\t\tSystem.out.println(\"3. Exit\");\r\n\t\tFile f= new File(\"EmployeeDetails.txt\");\r\n\t\tint choice=0;\r\n\t\tdo\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Enter your choice: \");\r\n\t\t\tchoice=s.nextInt();\r\n\t\t\tswitch(choice)\r\n\t\t\t{\r\n\t\t\tcase 1:\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Enter Employee ID: \");\r\n\t\t\t\tint emp_id=s.nextInt();\r\n\t\t\t\tSystem.out.println(\"Enter Employee Name: \");\r\n\t\t\t\tString emp_name=s.next();\r\n\t\t\t\tSystem.out.println(\"Enter Employee age: \");\r\n\t\t\t\tint emp_age=s.nextInt();\r\n\t\t\t\tSystem.out.println(\"Enter Employee Salary:\");\r\n\t\t\t\tdouble emp_salary=s.nextDouble();\r\n\t\t\t\tString str=emp_id+\" \"+emp_name+\" \"+emp_age+\" \"+emp_salary;\r\n\t\t\t\tFileWriter fwrite=new FileWriter(f.getAbsoluteFile(),true);\r\n\t\t\t\tfor(int i=0;i<str.length();i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfwrite.write(str.charAt(i));\r\n\t\t\t\t}\r\n\t\t\t\tfwrite.close();\r\n\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tScanner fread= new Scanner(f);\r\n\t\t\t\tSystem.out.println(\"-----Report-----\");\r\n\t\t\t\twhile(fread.hasNext())\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(fread.nextLine());\r\n\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println(\"-----End of Report-----\");\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\tSystem.out.println(\"Exiting the system\");\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tSystem.out.println(\"Invalid input\");\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}while(choice<=3);\r\n\t\t\r\n\r\n\t}", "@PostConstruct\n public void loaddata() throws IOException {\n File file = ResourceUtils.getFile(configProvider.getFilePath());\n Reader in = new FileReader(file.getPath());\n Iterable<CSVRecord> records = CSVFormat.RFC4180.withHeader(\n \"locationid\", \"Applicant\", \"FacilityType\", \"cnn\", \"LocationDescription\", \"Address\", \"blocklot\", \"block\", \"lot\",\n \"permit\", \"Status\", \"FoodItems\", \"X\", \"Y\", \"Latitude\", \"Longitude\", \"Schedule\",\n \"dayshours\", \"NOISent\", \"Approved\", \"Received\", \"PriorPermit\", \"ExpirationDate\",\n \"Location\", \"Fire Prevention Districts\", \"Police Districts\",\n \"Supervisor Districts\", \"Zip Codes\", \"Neighborhoods (old)\"\n ).parse(in);\n\n Iterator<CSVRecord> iterator = records.iterator();\n iterator.next();\n // use our own ids because of how atomic integers work, we can't have a 0 for an id, so can't rely on outside sources.\n int i = 0;\n while (iterator.hasNext()) {\n CSVRecord record = iterator.next();\n FoodTruck truck = new FoodTruck(Float.parseFloat(record.get(\"Latitude\")), Float.parseFloat(record.get(\"Longitude\")),\n record.get(\"Address\"), record.get(\"FoodItems\"), ++i);\n //add food truck to datastore\n truckDataStore.addTruck(truck.getId(), truck);\n\n final Rectangle rect = new Rectangle(truck.getLat(), truck.getLon(),\n truck.getLat(), truck.getLon());\n //add food truck location + id to location data store.\n locationDataStore.getSpatialIndex().add(rect, truck.getId());\n }\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic static void readUserFile() {\n\t\ttry {\n\t\t\tObjectInputStream readFile = new ObjectInputStream(new FileInputStream(userFile));\n\t\t\tVerify.userList = (ArrayList<User>) readFile.readObject();\n\t\t\treadFile.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t//add contents of file to separate lists\n\t\tfor (int i=0; i<Verify.userList.size(); i++) {\n\t\t\tVerify.userIds.add(Verify.userList.get(i).getUserId());\n\t\t\tVerify.usernames.add(Verify.userList.get(i).getUsername());\n\t\t\tif (Verify.userList.get(i).getAccounts() != null) {\n\t\t\t\tVerify.accountList.addAll(Verify.userList.get(i).getAccounts());\n\t\t\t}\n\t\t\tif (Verify.userList.get(i).getRequests() != null) {\n\t\t\t\tVerify.requestList.addAll(Verify.userList.get(i).getRequests());\t\n\t\t\t}\n\t\t}\n\t\tfor (Account account: Verify.accountList) {\n\t\t\tVerify.accountIds.add(account.getAccountId());\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 Map<String, List<String>> processIncidenceFile(String fileName) throws AggregateFileInitializationException {\n \t\t\tFile file = new File(fileName);\n \t\t\tHashMap<String, List<String>> data = new HashMap<String,List<String>>();\n \t\t\t\n \t\t\ttry {\n \t\t String record; \n \t\t String header;\n \t\t int recCount = 0;\n \t\t List<String> headerElements = new ArrayList<String>();\n \t\t FileInputStream fis = new FileInputStream(file); \n \t\t BufferedReader d = new BufferedReader(new InputStreamReader(fis));\n \t\t \n \t\t //\n \t\t // Read the file header\n \t\t //\n \t\t if ( (header=d.readLine()) != null ) { \n \t\t \t\n \t\t\t StringTokenizer st = new StringTokenizer(header );\n \t\t\t \n \t\t\t while (st.hasMoreTokens()) {\n \t\t\t \t String val = st.nextToken(\",\");\n \t\t\t \t headerElements.add(val.trim());\n \t\t\t }\n \t\t } // read the header\n \t\t /////////////////////\n \t\t \n \t\t // set up the empty lists\n \t\t int numColumns = headerElements.size();\n \t\t for (int i = 0; i < numColumns; i ++) {\n \t\t \tString key = headerElements.get(i);\n \t\t \tdata.put(key, new ArrayList<String>());\n \t\t }\n \t\t \n \t\t // Here we check the type of the data file\n \t\t // by checking the header elements\n \t\t \n \t\t \n \t\t \n \t\t \n \t //////////////////////\n \t // Read the data\n \t //\n \t while ( (record=d.readLine()) != null ) { \n \t recCount++; \n \t \n \t StringTokenizer st = new StringTokenizer(record );\n \t int tcount = 0;\n \t\t\t\t\twhile (st.hasMoreTokens()) {\n \t\t\t\t\t\tString val = st.nextToken(\",\");\n \t\t\t\t\t\tString key = headerElements.get(tcount);\n \t\t\t\t\t\t(data.get(key)).add(val.trim());\n \t\t\t\t\t\ttcount ++;\n \t\t\t\t\t}\n \t\t\t\t} // while file has data\n \t } catch (IOException e) { \n \t // catch io errors from FileInputStream or readLine()\n \t \t Activator.logError(\" IOException error!\", e);\n \t \t throw new AggregateFileInitializationException(e);\n \t }\n \t return data;\n \t\t }", "@Logging\n\tprivate List<Employee> getEmployee(List<String> aFileList) {\n\t\t\n\t\tList<Employee> aEmployeList = aFileList.stream()\n\t\t\t\t.skip(1) // skip the header line\n\t\t\t\t.map(line -> line.split(\",\")) // transform each line to an array\n\t\t\t\t.map(employeeData -> new Employee(Long.parseLong(employeeData[0]), employeeData[1], employeeData[2],\n\t\t\t\t\t\temployeeData[3], employeeData[4])) // transform each array to an entity\n\t\t\t\t.collect(Collectors.toList());\n\t\t\n\t\treturn aEmployeList;\n\t\t\n\t}" ]
[ "0.7502014", "0.72978175", "0.6976945", "0.6965155", "0.69643885", "0.66967434", "0.6682795", "0.65027225", "0.6461597", "0.64477324", "0.6395349", "0.63598776", "0.6359591", "0.6298586", "0.627457", "0.62259996", "0.61993545", "0.61389214", "0.6124515", "0.60817176", "0.606494", "0.603868", "0.60176724", "0.6001285", "0.599613", "0.597704", "0.596499", "0.59645957", "0.5959342", "0.5936306", "0.5917694", "0.59065443", "0.59046984", "0.5877816", "0.5872849", "0.58700895", "0.5853503", "0.5840707", "0.5828904", "0.58261305", "0.5820044", "0.58162755", "0.58141893", "0.5813307", "0.58075345", "0.57932115", "0.5792146", "0.57797796", "0.57736164", "0.5767998", "0.5763751", "0.57539624", "0.57452214", "0.5727108", "0.5700057", "0.56982726", "0.5689327", "0.56813645", "0.5681162", "0.56740665", "0.56703246", "0.56612533", "0.5657983", "0.56295896", "0.5618059", "0.5611833", "0.56105834", "0.56091106", "0.5606887", "0.5595707", "0.55932665", "0.5589544", "0.5587884", "0.558213", "0.5582129", "0.5577472", "0.55774593", "0.5574922", "0.5574615", "0.5569168", "0.55563366", "0.55517167", "0.55417794", "0.5518128", "0.55112755", "0.55091673", "0.55007434", "0.54987735", "0.5490893", "0.54878217", "0.54864377", "0.5481929", "0.5479451", "0.54753006", "0.54718405", "0.54662263", "0.5465926", "0.5461978", "0.54525524", "0.54509205" ]
0.68321025
5
Display Employee Displays Employee's information at JtextFileds.
@Override public void display(JPasswordField passFirstnameTextField, JTextField userFirstnameTextField, JTextField userLastnameTextField, JTextField DoBTextField, JTextField contactNumberTextField, JTextField emailTextField, JTextField salaryTextField, JTextField positionStatusTextField, JTextField nameTextField, JTextField buildingNameTextField, JTextField streetTextField, JTextField buildingNoTextField, JTextField areaTextField, JTextField cityTextField, JTextField countryTextField, JTextField postcodeTextField){ passFirstnameTextField.setText(getPassword()); userFirstnameTextField.setText(getFirstname()); userLastnameTextField.setText(getLastname()); DoBTextField.setText(DMY.format(getDoB())); contactNumberTextField.setText(getContactNumber()); emailTextField.setText(getEmail()); salaryTextField.setText(String.valueOf(getSalary())); positionStatusTextField.setText(getPositionStatus()); homeAddress.display(nameTextField,buildingNameTextField,streetTextField, buildingNoTextField,areaTextField,cityTextField, countryTextField,postcodeTextField); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void displayEmployees(){\n System.out.println(\"NAME --- SALARY --- AGE \");\n for (Employee employee : employees) {\n System.out.println(employee.getName() + \" \" + employee.getSalary() + \" \" + employee.getAge());\n }\n }", "public static void showEmployee(RequestHandler handler, Employee e) {\n\t\tStringBuilder sb;\n\t\tsb = new StringBuilder();\n\t\tsb.append(\"\\n*****************************************\");\n\t\tsb.append(\"\\nEmployee ID: \" + e.getId());\n\t\tsb.append(\"\\n Name: \" + e.getName());\n\t\tsb.append(\"\\n Email: \" + e.getEmail());\n\t\tsb.append(\"\\n Department: \" + e.getDepartment());\n\t\tsb.append(\"\\n*****************************************\");\n\t\thandler.sendMessage(sb.toString());\n\t}", "private void addEmployeeInfo(Section catPart) throws SQLException, IOException{\r\n PdfPTable employee = new PdfPTable(1);\r\n \r\n Paragraph empId = new Paragraph(\"Medarbejdernummer: \"+model.getTimeSheet(0).getEmployeeId());\r\n PdfPCell empIdCell = new PdfPCell(empId);\r\n empIdCell.setBorderColor(BaseColor.WHITE);\r\n String name = fal.getFiremanById(model.getTimeSheet(0).getEmployeeId()).getFirstName() +\" \"+ fal.getFiremanById(model.getTimeSheet(0).getEmployeeId()).getLastName();\r\n Paragraph empName = new Paragraph(\"Navn: \" + name);\r\n PdfPCell empNameCell = new PdfPCell(empName);\r\n empNameCell.setBorderColor(BaseColor.WHITE);\r\n \r\n employee.setHeaderRows(0);\r\n employee.addCell(empIdCell);\r\n employee.addCell(empNameCell);\r\n employee.setWidthPercentage(80.0f);\r\n \r\n catPart.add(employee);\r\n }", "public void show() {\r\n\t\tSystem.out.println(\"Id \\t Name \\t Address\");\r\n\t\t\r\n\t\tfor (int index = 0; index < emp.size(); index++) {\r\n\t\t\tSystem.out.println(emp.get(index).empId + \"\\t\" + emp.get(index).name +\"\\t\" + emp.get(index).adress);\r\n\t\t}\r\n\t}", "void printEmployeeDetail(){\n\t\tSystem.out.println(\"First name: \" + firstName);\n\t\tSystem.out.println(\"Last name: \" + lastName);\n\t\tSystem.out.println(\"Age: \" + age);\n\t\tSystem.out.println(\"Salary: \" + salary);\n\t\tSystem.out.println(firstName + \" has \" + car.color + \" \" + car.model + \" it's VIN is \" + car.VIN + \" and it is make year is \" + car.year );\n\t\t\n\t}", "public static void showEmployees(RequestHandler handler) {\n\t\tStringBuilder sb;\n\t\tsb = new StringBuilder();\n\t\tsb.append(\"\\nDisplaying all employees:\");\n\t\thandler.sendMessage(sb.toString());\n\t\tfor (Employee e : EmployeeData.getEmployees()) {\n\t\t\tshowEmployee(handler, e);\n\t\t}\n\t\thandler.sendMessage(new StringBuilder(\"Finished Displaying Employees\"));\n\t}", "public void listEmployees()\n\t{\n\t\tString str = \"Name\\tSurname\\tMail\\tPassword\\tBranchId\\tId\\n\";\n\t\t\n\t\tList<Employee> employees = this.company.getEmployees();\n\n\t\tfor(int i=0; i<employees.length(); i++)\n\t\t{\n\t\t\tstr += employees.get(i).getName() + \"\\t\" + employees.get(i).getSurname() + \"\\t\" + employees.get(i).getMail() + \"\\t\" + employees.get(i).getPassword() + \"\\t\\t\" + employees.get(i).getBranchId() + \"\\t\\t\" + employees.get(i).getId() + \"\\n\";\n\t\t}\n\n\t\tSystem.out.println(str);\n\n\t}", "public addEmployee() {\n initComponents();\n \n conn = db.java_db();\n Toolkit toolkit = getToolkit();\n Dimension size = toolkit.getScreenSize();\n setLocation(size.width / 2 - getWidth() / 2, size.height / 2 - getHeight() / 2);\n }", "public static void getEmployeeInformation(Employee [] employee) {\n\t\tif (Employee.getEmployeeQuantity() == 0) {\n\t\t\tJOptionPane.showMessageDialog(null, \"There is no employee!\");\n\t\t} else {\n\t\t\tfor (int i = 0; i < Employee.getEmployeeQuantity(); i++) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"-------List of Employees-------\\n\"\n\t\t\t\t\t\t+ (i+1) + \": \"+ employee[i+1].getName() + \"\\n\");\n\t\t\t}\t\t\t\n\t\t}\n\t}", "public void DisplayAllEmployees(){\r\n String format = \"%-20s %-20s %-9s\";\r\n System.out.println(\"\\n\");\r\n System.out.printf(format, \"|\"+\" Name \", \"|\"+\" Department \", \"|\"+\" phone number|\"+\"\\n\");\r\n System.out.println(\"----------------------------------------------------------\");\r\n for(Employee employee: listOfEmployees){\r\n System.out.format(format,\"|\"+employee.name,\"|\"+employee.departmentName,\"|\"+employee.contactNumber+\" |\"+ \"\\n\");\r\n }\r\n }", "public void setEmployee(Employee employee) {\r\n this.employee = employee;\r\n\r\n idLabel.setText(Integer.toString(employee.getId()));\r\n firstNameField.setText(employee.getFirstName());\r\n lastNameField.setText(employee.getLastName());\r\n industryField.setText(employee.getIndustry());\r\n workTypeField.setText(employee.getWorkType());\r\n addressField.setText(employee.getAddress());\r\n }", "public void actionPerformed(ActionEvent e){\n\t\t\t\tempJTextArea.setText(null);\n\t\t\t\t\tif(employees.size() >= 1){\n\t\t\t\t\t\tfor(Employee employee: employees){\n\t\t\t\t\t\t\tempJTextArea.append(\"\\n Employee ID: \"+employee.getEmployeeId()\n\t\t\t\t\t\t\t+\"\\n Name: \" +employee.getEmployeeName() \n\t\t\t\t\t\t\t+\"\\n Access Level: \" +employee.getAccess()\n\t\t\t\t\t\t\t+\"\\n Password: \" +employee.getPassword()\n\t\t\t\t\t\t\t+\"\\n Salary: \" +employee.getSalary()+\"\\n\");\n\t\t\t\t\t\t\tempJTextArea.setCaretPosition(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"No Employees Found\");\n\t\t\t\t\t}\n\t\t\t}", "public static void printEmployees() {\n List<Employee> employees = null;\n try {\n employees = employeeRepository.getAll(dataSource);\n } catch (SQLException e) {\n LOGGER.error(e.getMessage());\n }\n if (employees.isEmpty()) {\n System.out.println(\"\\n\" + resourceBundle.getString(\"empty.list\") + \"\\n\");\n LOGGER.warn(\"The list of employees is empty\");\n return;\n }\n System.out.println();\n employees.forEach(System.out::println);\n }", "private void showStaff() {\n\t\tCommonADO ado=CommonADO.getCommonADO();\r\n\t\tString sql=\"select * from Staff\";\r\n\t\tResultSet rs=ado.executeSelect(sql);\r\n\t\tString str=\"\";\r\n\t\tstr+=\"员工编号:\"+\" 职位:\"+\" 姓名:\"+\" 性别: \"+\" 电话号码:\"+\"\\n\";\r\n\t\ttry {\r\n\t\t\twhile(rs.next()){\r\n\t\t\t\tString no=rs.getString(\"StaffNo\");\r\n\t\t\t\tString jobname=rs.getString(\"JobName\");\r\n\t\t\t\tString name=rs.getString(\"Name\");\r\n\t\t\t\tString sex=rs.getString(\"Sex\");\r\n\t\t\t\tString phone=rs.getString(\"Phone\");\r\n\t\t\t\tif(no.length()<8){\r\n\t\t\t\t\tfor(int i=no.length();i<=12;i++)\r\n\t\t\t\t\t\tno+=\" \";\r\n\t\t\t\t}\r\n\t\t\t\tif(jobname.length()<8){\r\n\t\t\t\t\tfor(int i=jobname.length();i<=8;i++)\r\n\t\t\t\t\t\tjobname+=\" \";\r\n\t\t\t\t}\r\n\t\t\t\tif(name.length()<8){\r\n\t\t\t\t\tfor(int i=name.length();i<=8;i++)\r\n\t\t\t\t\t\tname+=\" \";\r\n\t\t\t\t}\r\n\t\t\t\tif(sex.length()<8){\r\n\t\t\t\t\tfor(int i=sex.length();i<=8;i++)\r\n\t\t\t\t\t\tsex+=\" \";\r\n\t\t\t\t}\r\n\t\t\t\tif(phone.length()<12){\r\n\t\t\t\t\tfor(int i=phone.length();i<=12;i++)\r\n\t\t\t\t\t\tphone+=\" \";\r\n\t\t\t\t}\r\n\t\t\t\tstr+=no+jobname+name+sex+phone+\"\\n\";\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\ttextAreaStaff.setText(str);\r\n\t}", "private void doViewAllEmployees() {\n Scanner sc = new Scanner(System.in);\n\n System.out.println(\"***Hors Management System:: System Administration:: View All Staffs\");\n\n List<Employee> employees = employeeControllerRemote.retrieveAllEmployees();\n\n employees.forEach((employee) -> {\n System.out.println(\"Employee ID: \" + employee.getEmployeeId() + \"First Name: \" + employee.getFirstName() + \"Last Name: \" + employee.getLastName() + \"Job Role: \" + employee.getJobRole().toString() + \"Username: \" + employee.getUserName() + \"Password: \" + employee.getPassword());\n });\n\n System.out.println(\"Press any key to continue...>\");\n sc.nextLine();\n }", "public void empdetails() {\r\n\t\tSystem.out.println(\"name : \"+ name);\r\n\t}", "public static void EmployeeJob() {\r\n\t\t\r\n\t\tJLabel e4 = new JLabel(\"Employee's Job:\");\r\n\t\te4.setFont(f);\r\n\t\tGUI1Panel.add(e4);\r\n\t\tGUI1Panel.add(employeeJobType);\r\n\t\te4.setHorizontalAlignment(JLabel.LEFT);\r\n\t\tGUI1Panel.add(Box.createHorizontalStrut(5));\r\n\t}", "public static void display(List<Employee> empList) {\r\n\t\t\r\n\t\tfor(Employee e : empList) {\r\n\t\t\t\r\n\t\t\tSystem.out.println(e.getEmployeeId()+\"\\t\"+e.getEmployeeName()+\"\\t\"+e.getEmployeeAddress());\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\r\n System.out.println(\"* * * * * Welcome to the employee inform * * * * * \");\r\n\r\n Employee_Company Jane = new Employee_Company();\r\n Employee_Company Lucas = new Employee_Company();\r\n Employee_Company Intern_Sophia = new Employee_Company();\r\n Employee_Company Intern_Ava = new Employee_Company();\r\n Employee_Company Intern_James = new Employee_Company();\r\n Employee_Company Intern_Nicholas = new Employee_Company();\r\n\r\n\r\n Lucas.Set_name_employee(\"Lucas Smith\");\r\n Lucas.Set_Email_employee(\"[email protected]\");\r\n Lucas.Set_role_employee(\"Software Engineer\");\r\n Lucas.setSalary_employee(103438);\r\n\r\n\r\n Jane.Set_name_employee(\"Jane charlotte\");\r\n Jane.Set_Email_employee(\"[email protected]\");\r\n Jane.setSalary_employee(623100);\r\n Jane.Set_role_employee(\"CEO Tech Company\");\r\n\r\n\r\n Intern_Sophia.Set_name_employee(\"Sophia Wood\");\r\n Intern_Sophia.Set_Intern_application('A');\r\n Intern_Sophia.Set_role_employee(\"Intern Artificial Intelligence \");\r\n\r\n\r\n Intern_Ava.Set_name_employee(\"Ava Richardson\");\r\n Intern_Ava.Set_Intern_application('B');\r\n Intern_Ava.Set_role_employee(\"Intern Computer Science\");\r\n\r\n\r\n Intern_James.Set_name_employee(\"James Benjamin\");\r\n Intern_James.Set_Intern_application('B');\r\n Intern_James.Set_role_employee(\"Intern Business Analyst\");\r\n\r\n\r\n Intern_Nicholas.Set_name_employee(\"Nicholas Miller\");\r\n Intern_Nicholas.Set_Intern_application('C');\r\n Intern_Nicholas.Set_role_employee(\"Intern Systems Integration Engineering\");\r\n\r\n\r\n\r\n System.out.println(\"\\n\\t*** Tech Company employee information ***\");\r\n System.out.println(\"1. View Salary\");\r\n System.out.println(\"2. View Name of the Employee\");\r\n System.out.println(\"3. View Email Address\");\r\n System.out.println(\"4. View Employee Role\");\r\n System.out.println(\"5. View Intern Application grade\");\r\n\r\n\r\n\r\n Scanner input = new Scanner(System.in);\r\n System.out.println(\"Direction: Input the number is addressed in Tech Company employee information\");\r\n int input_user = input.nextInt();\r\n\r\n switch (input_user){\r\n case 1 -> {\r\n System.out.println(\"Here is the salary of the employee of Tech Company\");\r\n System.out.println(\"Salary of Software engineering: \"+Lucas.getSalary_employee());\r\n System.out.println(\"Salary of CEO: \"+Jane.getSalary_employee());\r\n }\r\n case 2 ->{\r\n System.out.println(\"Here is the name of the employee of Tech Company\");\r\n System.out.println(\"The software engineering of Tech Company name of the employee is: \"+Jane.Get_name_employee());\r\n System.out.println(\"The CEO Tech Company name of the employee is: \"+Lucas.Get_name_employee());\r\n }\r\n case 3 ->{\r\n System.out.println(\"Here is the Email Address of employee of Tech Company\");\r\n System.out.println(\"Jane Charlotte is CEO of Tech company Email Address its : \"+Jane.Get_Email_employee());\r\n System.out.println(\"Lucas Smith is Software Engineering of Tech Company Email Address its: \"+Lucas.Get_Email_employee());\r\n }\r\n case 4 ->{\r\n System.out.println(\"Here is the Employee Role of Tech Company\");\r\n System.out.println(Jane.Get_role_employee());\r\n System.out.println(Lucas.Get_role_employee());\r\n }\r\n case 5 ->{\r\n System.out.println(\"Here is all the Intern get accepted to Tech Company \");\r\n System.out.println(\"1.\"+Intern_Ava.Get_name_employee()+\" GPA college: \"+Intern_Ava.Get_Intern_application()+\"- \"+\" Application: Accepted \"+Intern_Ava.Get_role_employee());\r\n System.out.println(\"2.\"+Intern_Sophia.Get_name_employee()+\" GPA college: \"+Intern_Sophia.Get_Intern_application()+\"+ \"+\" Application: Accepted \"+Intern_Sophia.Get_role_employee());\r\n System.out.println(\"3.\"+Intern_James.Get_name_employee()+\" GPA college: \"+Intern_James.Get_Intern_application()+\"+ \"+\" Application: Accepted \"+Intern_James.Get_role_employee());\r\n System.out.println(\"4.\"+Intern_Nicholas.Get_name_employee()+\"GPA college: \"+Intern_Nicholas.Get_Intern_application()+\"+ \"+\" Application: Accepted \"+Intern_Nicholas.Get_role_employee());\r\n }\r\n }\r\n\r\n\r\n\r\n }", "public void outputInfo(){\n outputHeader();\n ObjectListNode p=payroll.getFirstNode();\n while(p!=null){\n ((Employee)p.getInfo()).displayInfo(pw);\n p=p.getNext();\n }\n System.out.print(\"\\nNumber of Employees: \"+payroll.size()+\"\\n\");\n pw.print(\"\\nNumber of Employees: \"+payroll.size()+\"\\n\");\n }", "public static void EmployeeName() {\r\n\t\t\r\n\t\tJLabel e1 = new JLabel(\"Employee's Name:\");\r\n\t\te1.setFont(f);\r\n\t\tGUI1Panel.add(e1);\r\n\t\tGUI1Panel.add(employeeName);\r\n\t\te1.setHorizontalAlignment(JLabel.LEFT);\r\n\t\tGUI1Panel.add(Box.createHorizontalStrut(5));\r\n\t\t\r\n\t}", "@RequestMapping(path = \"/employee\", method = RequestMethod.GET)\r\n\t@ResponseBody\r\n\tpublic List<Employee> displayEmployee() {\r\n\t\treturn er.findAll();\r\n\t}", "public EmployeePage() {\n initComponents();\n try {\n //Connects to database with an absolute path\n Path con = Paths.get(\"ScrumProject.FDB\").toRealPath(LinkOption.NOFOLLOW_LINKS);\n idb = new InfDB(con.toString());\n } catch (InfException | IOException e) {\n JOptionPane.showMessageDialog(null, e);\n }\n Validation val = new Validation();\n txtNameE.setText(val.getUserName(Validation.getIdInlogged()));\n txtPhoneE.setText(val.getUserTelefon(Validation.getIdInlogged()));\n txtEmailE.setText(val.getUserEmail(Validation.getIdInlogged()));\n }", "public abstract String printEmployeeInformation();", "public void listEmployees() {\n\t\tSession session = factory.openSession();\n\t\tTransaction transaction = null;\n\t\ttry {\n\t\t\ttransaction = session.beginTransaction();\n\t\t\t@SuppressWarnings(\"rawtypes\")\n\t\t\tList employees = session.createQuery(\"FROM Employee\").list();\n\t\t\tfor (@SuppressWarnings(\"rawtypes\")\n\t\t\tIterator iterator = employees.iterator(); iterator.hasNext();) {\n\t\t\t\tEmployee employee = (Employee) iterator.next();\n\t\t\t\tSystem.out.print(\"First Name: \" + employee.getFirstName());\n\t\t\t\tSystem.out.print(\" Last Name: \" + employee.getLastName());\n\t\t\t\tSystem.out.println(\" Salary: \" + employee.getSalary());\n\t\t\t}\n\t\t\ttransaction.commit();\n\t\t} catch (HibernateException e) {\n\t\t\tif (transaction != null)\n\t\t\t\ttransaction.rollback();\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tsession.close();\n\t\t}\n\t}", "public String f9employee() throws Exception {\r\n\t\tString query = \"SELECT HRMS_EMP_OFFC.EMP_TOKEN, \"\r\n\t\t\t\t+ \"\tHRMS_EMP_OFFC.EMP_FNAME||' '||HRMS_EMP_OFFC.EMP_MNAME||' '||HRMS_EMP_OFFC.EMP_LNAME ,HRMS_EMP_OFFC.EMP_ID,\"\r\n\t\t\t\t+ \"\tHRMS_EMP_OFFC.EMP_DIV,NVL(DIV_NAME,' ') FROM HRMS_EMP_OFFC \"\r\n\t\t\t\t+ \"\tINNER JOIN HRMS_CENTER ON HRMS_CENTER.CENTER_ID = HRMS_EMP_OFFC.EMP_CENTER\"\r\n\t\t\t\t+ \"\tINNER JOIN HRMS_DIVISION ON (HRMS_DIVISION.DIV_ID = HRMS_EMP_OFFC.EMP_DIV)\";\r\n\t\t\t\tquery += getprofileQuery(bulkForm16);\r\n\t\t\t\tquery += \"\tORDER BY HRMS_EMP_OFFC.EMP_ID\";\r\n\r\n\t\tString[] headers = { getMessage(\"employee.id\"), getMessage(\"employee\") };\r\n\r\n\t\tString[] headerWidth = { \"30\", \"70\" };\r\n\r\n\t\tString[] fieldNames = { \"empToken\", \"empName\", \"empId\",\r\n\t\t\t\t\"divisionId\", \"divisionName\" };\r\n\r\n\t\tint[] columnIndex = { 0, 1, 2, 3, 4 };\r\n\r\n\t\tString submitFlag = \"false\";\r\n\r\n\t\tString submitToMethod = \"\";\r\n\t\tsetF9Window(query, headers, headerWidth, fieldNames, columnIndex,\r\n\t\t\t\tsubmitFlag, submitToMethod);\r\n\r\n\t\treturn \"f9page\";\r\n\t}", "public void Display()\r\n \t{\r\n\t SimpleDateFormat sdf=new SimpleDateFormat(\"dd/MM/yyyy\");\r\n\r\n\t try{\r\n\t\t txtID.setText(rsTution.getString(1));\r\n\t\t txtName.setText(rsTution.getString(2));\r\n\t\t txtYear.setText(rsTution.getString(3));\r\n\t\t txtMonth.setText(rsTution.getString(4));\r\n\t\t txtPDate.setText(sdf.format(rsTution.getDate(5)));\r\n\t\t txtFees.setText(rsTution.getString(6));\r\n\r\n\t }catch(SQLException sqle)\r\n\t {System.out.println(\"Display Error:\"+sqle);\r\n\t }\r\n \t}", "private static void writeToFileEmployees() throws IOException {\n FileWriter write = new FileWriter(path2, append);\n PrintWriter print_line = new PrintWriter(write);\n for (int i = 0; i < RegisteredEmployees.listOfEmployees.size(); i++) {\n ArrayList<Integer> list = RegisteredEmployees.getEmployeeList();\n Integer ID = list.get(i);\n textLine = String.valueOf(ID);\n print_line.printf(\"%s\" + \"%n\", textLine);\n }\n print_line.close();\n }", "public ViewObjectImpl getEmployees() {\n return (ViewObjectImpl)findViewObject(\"Employees\");\n }", "public String toString() {\r\n\t\treturn \"Name : \"+name+\"\\nEmp# : \"+employeeNum;\r\n\t}", "public String getEmployeeInfo() throws SQLException {\n String SQL = String.format(\"SELECT * FROM %s\", DbSchema.table_employees.name);\n Statement statement = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);\n ResultSet results = statement.executeQuery(SQL);\n\n //Prepare format stuff\n String tableHeader = String.format(\"%s %s %s %s %s\\n\", table_employees.cols.id, table_employees.cols.first_name, table_employees.cols.last_name, table_employees.cols.age, table_employees.cols.salary);\n StringBuilder output = new StringBuilder(tableHeader);\n DecimalFormat format = new DecimalFormat(\"#,###.00\");\n\n while (results.next()) {\n //Iterate through each row (employee) and add each bit of info to table\n String row = String.format(\"%s %s %s %s %s\\n\",\n results.getInt(table_employees.cols.id),\n results.getString(table_employees.cols.first_name),\n results.getString(table_employees.cols.last_name),\n results.getInt(table_employees.cols.age),\n format.format(results.getDouble(table_employees.cols.salary)));\n output.append(row);\n }\n return output.toString();\n }", "public String editEmploye(Employee emp){\n System.out.println(\"******* Edit employe ************\");\n System.out.println(emp.toString());\n employeeService.editEmployee(emp);\n sessionController.logInEmp();\n\n return \"/pages/childCareCenterDashboard.xhtml?faces-redirect=true\";\n }", "public void empDetails() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t\r\n\t}", "@Override\r\n\tpublic String toString() {\r\n\t\treturn \"Employee [id=\" + id + \", name=\" + name + \", salary=\" + salary + \", designation=\" + designation\r\n\t\t\t\t+ \", department=\" + department + \", address=\" + address + \"]\";\r\n\t}", "public EmployeeList() {\r\n initComponents();\r\n\r\n empName = getEmployeeName();\r\n empPosition = getEmployeePosition();\r\n System.out.println(empName + \"----- \" + empPosition);\r\n details = (ArrayList<String>) setEmployeeDetails(empName, empPosition);\r\n initializeComponents(details);\r\n\r\n }", "public Employee viewInformation(int id) {\n\t\tEmployee employee = new Employee(); \n\t\ttry{ \n\n\t\t\tString sql = \"select * from employees where id = \"+id; \n\t\t\tConnection connection = DBConnectionUtil.getConnection();\n\t\t\tStatement statement = connection.createStatement();\n\t\t\tResultSet resultSet = statement.executeQuery(sql);\n\n\t\t\tresultSet.next();\n\t\t\temployee.setId(resultSet.getInt(\"employee_id\"));\n\t\t\temployee.setUsername(resultSet.getString(\"username\"));\n\t\t\temployee.setPassword(resultSet.getString(\"password\"));\n\t\t\temployee.setFirstName(resultSet.getString(\"first_name\"));\n\t\t\temployee.setLastName(resultSet.getString(\"last_name\"));\n\t\t\temployee.setEmail(resultSet.getString(\"email\"));\n\t\t\t\n\t\t\treturn employee;\n\t\t\t \n\t\t}catch(Exception e){System.out.println(e);} \n\t\treturn null; \t\t\n\t}", "public void editEmployeeInformationName(String text) {\n\t\tthis.name=text;\n\t\tResourceCatalogue resCat = new ResourceCatalogue();\t\t\n\t\tresCat.getResource(rid).editResource(name, this.sectionId);\n\t\tHashMap<String, String> setVars = new HashMap<String, String>();\n\t\tsetVars.put(\"empname\", \"\\'\"+name+\"\\'\");\n\t\tsubmitToDB(setVars);\n\n\t}", "public void parseAndPrintRecords() {\n ArrayList<Employee> employees;\n\n employees = parseData(data);\n\n System.out.printf(\"%10s%10s%10s\\n\", \"Last\", \"First\", \"Salary\");\n for(Employee employee : employees) {\n System.out.printf(\"%10s%10s%10d\\n\", employee.lName, employee.fName, employee.salary);\n }\n\n }", "@RequestMapping(\"/edit/{id}\")\n\tpublic String showEditEmployeePage(@PathVariable(name = \"id\") int id, Model model) {\n\t\tEmployees Employees = service.get(id);\n\t\tmodel.addAttribute(\"Employees\", Employees);\n\t\tList<Employees> Employeeslist = service.listAll();\n\t\tmodel.addAttribute(\"Employeeslist\", Employeeslist);\n\t\treturn \"Edit_Employees\";\n\t}", "public EmployeeInfo() {\n initComponents();\n }", "public String toString() {\n return \"Employee Id:\" + id + \" Employee Name: \" + name+ \"Employee Address:\" + address + \"Employee Salary:\" + salary;\n }", "public void displayAllContacts() {\n\n for (int i = 0; i < contacts.size(); i ++) {\n\n Contact contact = contacts.get(i);\n\n System.out.println(\" Name: \" + contact.getName());\n System.out.println(\" Title: \" + contact.getTitle());\n System.out.println(\" ID #: \" + contact.getID());\n System.out.println(\" Hoursrate: \" + contact.getHoursrate());\n System.out.println(\" Workhours \" + contact.getWorkhours());\n System.out.println(\"-------------\");\n\n\n\n Employee one = new Employee(\"A\", \"A\", \"A\", \"A\"); // I give it some contact information first.\n Employee two = new Employee(\"Bob\", \"Bob\", \"A\", \"A\");\n\n\n\n\n\n\n}\n\n\n//***************************************************************", "@RequestMapping(path = \"/employee/{id}\", method = RequestMethod.GET)\r\n\t@ResponseBody\r\n\tpublic Optional<Employee> displayEmployeeById() {\r\n\t\treturn er.findById(1);\r\n\t}", "public EmployeeView(Employees employees,int status, /*EmployeWork setEmpl,*/ JFrame frame)\n {\n super(frame, \"EmployeeView\", true);\n this.setResizable(false);\n this.setSize(300, 200);\n //this.status = status;\n //this.setEmpl = setEmpl;\n setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n this.employeesModel = employees;\n textFieldfirstname.setText(employeesModel.getFirstName());\n textsecondtname.setText(employeesModel.getSecondName());\n textFieldfphone.setText(employeesModel.getPhoneNumber());\n String salary = \"\";\n salary += employeesModel.getSalary();\n textsalary.setText(salary);\n JPanel panel = new JPanel();\n this.add(panel);\n panel.setLayout(new BorderLayout());\n JPanel panelname = new JPanel();\n panelname.add(labalfirstname);\n panelname.add(textFieldfirstname);\n panel.add(panelname, BorderLayout.NORTH);\n JPanel panelsname = new JPanel();\n JPanel panelcenter = new JPanel();\n JPanel panelphone = new JPanel();\n panelcenter.setLayout(new BorderLayout());\n panelsname.add(labalsecondtname);\n panelsname.add(textsecondtname);\n panelcenter.add(panelsname, BorderLayout.NORTH);\n panelphone.add(labelphone);\n panelphone.add(textFieldfphone);\n panelcenter.add(panelphone, BorderLayout.CENTER);\n JPanel panelsalary = new JPanel();\n panelsalary.add(labelsalary);\n panelsalary.add(textsalary);\n panelcenter.add(panelsalary, BorderLayout.SOUTH);\n panel.add(panelcenter, BorderLayout.CENTER);\n JPanel panelbut = new JPanel();\n JPanel panelchec= new JPanel();\n panelbut.add(buttonset);\n panelbut.add(buttonOk);\n panel.add(panelbut, BorderLayout.SOUTH);\n buttonOk.addActionListener(new ActionListener()\n {\n @Override\n public void actionPerformed(ActionEvent e)\n {\n try\n {\n if (flagcreate == GOOD_CREATE)\n {\n setVisible(false);\n dispose();\n }\n else throw new Exception();\n }\n catch (Exception e1)\n {\n JOptionPane.showMessageDialog(EmployeeView.this, \"Ошибка\", \"Вы вы вели плохие параметры\", JOptionPane.WARNING_MESSAGE);\n }\n }\n });\n buttonset.addActionListener(new ActionListener()\n {\n @Override\n public void actionPerformed(ActionEvent e)\n {\n try\n {\n if (textFieldfirstname.getText().equals(\"\") || textsecondtname.getText().equals(\"\")\n || textFieldfphone.getText().equals(\"\"))\n {\n throw new Exception();\n }\n employeesModel.setFirstName(textFieldfirstname.getText());\n employeesModel.setSecondName(textsecondtname.getText());\n employeesModel.setPhoneNumber(textFieldfphone.getText());\n employeesModel.setSalary(Integer.parseInt(textsalary.getText()));\n flagcreate = GOOD_CREATE;\n }\n catch (Exception e1)\n {\n flagcreate = BAD_CREATE;\n JOptionPane.showMessageDialog(EmployeeView.this, \"Ошибка\", \"Вы вы вели плохие параметры\", JOptionPane.WARNING_MESSAGE);\n }\n }\n\n });\n }", "private void displayEmployee()\n {\n employeeJComboBox.removeAllItems();\n int location = employeeJComboBox.getSelectedIndex();\n String[] namesArray = new String[employees.size()];\n for(int i = 0; i < employees.size(); i++)\n {\n namesArray[i] = employees.get(i).getName();\n employeeJComboBox.addItem(namesArray[i]);\n }\n if(location < 0)\n {\n employeeJComboBox.setSelectedIndex(0);\n }\n else\n {\n employeeJComboBox.setSelectedIndex(location);\n }\n }", "@Override\n\tpublic List<Employee> viewAllEmployees() {\n\t\t CriteriaBuilder cb = em.getCriteriaBuilder();\n\t\t CriteriaQuery<Employee> cq = cb.createQuery(Employee.class);\n\t\t Root<Employee> rootEntry = cq.from(Employee.class);\n\t\t CriteriaQuery<Employee> all = cq.select(rootEntry);\n\t \n\t\t TypedQuery<Employee> allQuery = em.createQuery(all);\n\t\t return allQuery.getResultList();\n\t}", "private void displayUserInfo(String name) {\n\t\tString username = null;\n\t\tPattern p = Pattern.compile(\"\\\\[(.*?)\\\\]\");\n\t\tMatcher m = p.matcher(name);\n\t\tif (m.find())\n\t\t{\n\t\t username = m.group(1);\n\t\t lastClickedUser = username;\n\t\t}\n\t\tUser u = jdbc.get_user(username);\n\t\ttextFirstName.setText(u.get_firstname());\n\t\ttextLastName.setText(u.get_lastname());\n\t\ttextUsername.setText(u.get_username());\n\t\tif (u.get_usertype() == 1) {\n\t\t\trdbtnAdminDetails.setSelected(true);\n\t\t} else if (u.get_usertype() == 2) {\n\t\t\trdbtnManagerDetails.setSelected(true);\n\t\t} else {\n\t\t\trdbtnWorkerDetails.setSelected(true);\n\t\t}\n\t\tif (u.get_email() != null) {textEmail.setText(u.get_email());} else {textEmail.setText(\"No Email Address in Database.\");}\n\t\tif (u.get_phone() != null) {textPhone.setText(u.get_phone());} else {textPhone.setText(\"No Phone Number in Database.\");}\t\t\t\t\n\t\tcreateQualLists(u.get_userID());\n\t}", "public String f9employee() throws Exception {\r\n\t\t/**\r\n\t\t * BUILD COMPLETE QUERY (ALONG WITH PARAMETERS) WHICH GIVES THE DESIRED\r\n\t\t * OUTPUT ALONG WITH PROFILES\r\n\t\t */\r\n\t\tString query = \"SELECT EMP_TOKEN, EMP_FNAME || ' ' || EMP_MNAME || ' ' || EMP_LNAME,\"\r\n\t\t\t\t+ \" EMP_ID,CENTER_NAME,RANK_NAME\"\r\n\t\t\t\t+ \" FROM HRMS_EMP_OFFC\"\r\n\t\t\t\t+ \" LEFT JOIN HRMS_CENTER ON(HRMS_CENTER.CENTER_ID=HRMS_EMP_OFFC.EMP_CENTER)\"\r\n\t\t\t\t+ \" LEFT JOIN HRMS_RANK ON(HRMS_RANK.RANK_ID=HRMS_EMP_OFFC.EMP_RANK) \";\r\n\r\n\t\tquery += \"\tORDER BY EMP_ID ASC \";\r\n\r\n\t\t/**\r\n\t\t * SET THE HEADER NAMES OF TABLE WHICH IS DISPLAYED IN POP-UP WINDOW. *\r\n\t\t */\r\n\r\n\t\tString[] headers = { getMessage(\"employee.id\"), getMessage(\"employee\") };\r\n\r\n\t\t/**\r\n\t\t * DEFINE THE PERCENT WIDTH OF EACH COLUMN\r\n\t\t */\r\n\t\tString[] headerWidth = { \"15\", \"35\" };\r\n\r\n\t\t/**\r\n\t\t * -SET THE FIELDNAMES INTO WHICH THE VALUES ARE BEING POPULATED AFTER A\r\n\t\t * ROW IS SELECTED. -USEFULL IN CASES WHERE SUBMIT FLAG IS 'false'\r\n\t\t * -PARENT FORM WILL SHOW THE VALUES IN THE FILDS CORRSPONDING TO COLUMN\r\n\t\t * INDEX. NOTE: LENGHT OF COLUMN INDEX MUST BE SAME AS THE LENGTH OF\r\n\t\t * FIELDNAMES\r\n\t\t */\r\n\r\n\t\tString[] fieldNames = { \"searchemptoken\", \"searchempName\",\r\n\t\t\t\t\"searchempId\" };\r\n\r\n\t\t/**\r\n\t\t * SET THE COLUMN INDEX E.G. SUPPOSE THE POP-UP SHOWS 4 COLUMNS, BUT ON\r\n\t\t * CLICKING A ROW ONLY SECOND AND FORTH COLUMN VALUES NEED TO BE SHOWN\r\n\t\t * IN THE PARENT WINDOW FIELDS THEN THE COLUMN INDEX CAN BE {1,3}\r\n\t\t * \r\n\t\t * NOTE: COLUMN NUMBERS STARTS WITH 0\r\n\t\t * \r\n\t\t */\r\n\t\tint[] columnIndex = { 0, 1, 2 };\r\n\r\n\t\t/**\r\n\t\t * WHEN SET TO 'true' WILL SUBMIT THE FORM\r\n\t\t * \r\n\t\t */\r\n\t\tString submitFlag = \"false\";\r\n\r\n\t\t/**\r\n\t\t * IF THE 'submitFlag' IS 'true' , THE FORM WILL SUBMIT AND CALL\r\n\t\t * FOLLOWING METHOD IN THE ACTION * NAMING CONVENSTION: <NAME OF\r\n\t\t * ACTION>_<METHOD TO CALL>.action\r\n\t\t */\r\n\t\tString submitToMethod = \"\";\r\n\r\n\t\t/**\r\n\t\t * CALL THIS METHOD AFTER ALL PARAMETERS ARE DEFINED *\r\n\t\t */\r\n\r\n\t\tsetF9Window(query, headers, headerWidth, fieldNames, columnIndex,\r\n\t\t\t\tsubmitFlag, submitToMethod);\r\n\r\n\t\treturn \"f9page\";\r\n\t}", "public void lectureDetails() {\n\n try {\n String sql = \"SELECT eid as 'Employee ID', lectur_name as 'Lecturer Name', faculty as 'Faculty', department as 'Department', center as 'Center', building as 'Building', lec_level as 'Level', lec_rank as 'Rank' FROM lecturer\";\n pst = con.prepareStatement(sql);\n res = pst.executeQuery();\n\n lectDetails.setModel(DbUtils.resultSetToTableModel(res));\n\n } catch (SQLException ex) {\n Logger.getLogger(lecturers_mgmt.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public String EmployeeSummary(){\r\n\t\treturn String.format(\"%d\\t%d\\t\\tJunior\\t\\t$%,.2f\\t\\t$%,.2f\\r\\n\", getID(), getYearHired(), getBaseSalary(), CalculateTotalCompensation());\r\n\t}", "public String getEmployeeName() {\n return employeeName;\n }", "public String[][] displayEmployee() {\r\n\t\t\t\t\r\n\t\t// Print the employee numbers for the employees stored in each bucket's ArrayList,\r\n\t\t// starting with bucket 0, then bucket 1, and so on.\r\n \r\n if (numInHashTable > 0){\r\n dataTable = new String[numInHashTable][5];\r\n int q = 0;\r\n \r\n for (ArrayList<EmployeeInfo> bucket : buckets){\r\n for (int i = 0; i < bucket.size(); i++){\r\n EmployeeInfo theEmployee = bucket.get(i);\r\n \r\n //display specfically for a PTE (All the general attributes plus the specifc ones)\r\n if (theEmployee instanceof PTE) {\r\n PTE thePTE = (PTE) theEmployee;\r\n dataTable[q][0] = Integer.toString(theEmployee.getEmpNum());\r\n dataTable[q][1] = \"PTE\";\r\n dataTable[q][2] = theEmployee.getFirstName();\r\n dataTable[q][3] = theEmployee.getLastName();\r\n dataTable[q][4] = Double.toString(thePTE.calcNetAnnualIncome()); \r\n q++;\r\n }\r\n \r\n //display specfically for a FTE (All the general attributes plus the specifc ones)\r\n if (theEmployee instanceof FTE){\r\n FTE theFTE = (FTE) theEmployee;\r\n dataTable[q][0] = Integer.toString(theEmployee.getEmpNum());\r\n dataTable[q][1] = \"FTE\";\r\n dataTable[q][2] = theEmployee.getFirstName();\r\n dataTable[q][3] = theEmployee.getLastName();\r\n dataTable[q][4] = Double.toString(theFTE.calcNetAnnualIncome());\r\n q++;\r\n } \r\n }\r\n }\r\n }\r\n return dataTable;\r\n }", "public void actionPerformed(ActionEvent e){\n\t\t\t\tif(employees.size() >= 1){\n\t\t\t\t\tif(empNameCombo.getSelectedIndex() != 0){\n\t\t\t\t\t\tfor(Employee employee: employees){\n\t\t\t\t\t\t\tif(employee.getEmployeeName().equalsIgnoreCase(empNameCombo.getSelectedItem().toString())){\n\t\t\t\t\t\t\t\tempJTextArea.setText(\"Employee ID: \"+employee.getEmployeeId()\n\t\t\t\t\t\t\t+\"\\n Name: \" +employee.getEmployeeName() \n\t\t\t\t\t\t\t+\"\\n Access Level: \" +employee.getAccess()\n\t\t\t\t\t\t\t+\"\\n Password: \" +employee.getPassword()\n\t\t\t\t\t\t\t+\"\\n Salary: \" +employee.getSalary());\n\t\t\t\t\t\t\tempNameCombo.setSelectedIndex(0);\n\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}else{\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Please Select a Valid Employee.\");\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"No Employees Found\");\n\t\t\t\t}\n\t\t\t}", "void display()\n\t {\n\t\t System.out.println(\"Student ID: \"+id);\n\t\t System.out.println(\"Student Name: \"+name);\n\t\t System.out.println();\n\t }", "@Override\n\tpublic void getAllEmployee() {\n\t\t\n\t}", "public void outputNames(){\n System.out.printf(\"\\n%9s%11s\\n\",\"Last Name\",\"First Name\");\n pw.printf(\"\\n%9s%11s\",\"Last Name\",\"First Name\");\n ObjectListNode p=payroll.getFirstNode();\n while(p!=null){\n ((Employee)p.getInfo()).displayName(pw);\n p=p.getNext();\n }\n System.out.print(\"\\nNumber of Employees: \"+payroll.size()+\"\\n\");\n pw.print(\"\\nNumber of Employees: \"+payroll.size()+\"\\n\");\n }", "public EmployeeGUI() \n {\n initComponents(); //build the GUI\n this.setLocationRelativeTo(null); //center form\n //Set form's icon \n this.setIconImage(Toolkit.getDefaultToolkit()\n .getImage(\"src/EmployeeStats/fish.jpg\"));\n //set rollButton as default\n this.getRootPane().setDefaultButton(displayJButton);\n printJMenuItem.setEnabled(false);\n //Read Employees from external file and store in the ArrayList\n readFromFile(fileName);\n displayEmployee();\n }", "public static void printEmployees(ArrayList<Employee> newEmployee){\n for(int i = 0; i < newEmployee.size(); i++){\n System.out.print(newEmployee.get(i).toString());\n }\n }", "@Override\n\tpublic String toString() {\n\t\treturn super.toString() + \"\\nEmployees: \" + getEmployees();\n\t}", "public void display () {\n super.display ();\n if (joined == true) {\n System.out.println(\"Staff name: \"+staffName+\n \"\\nSalary: \"+salary+\n \"\\nWorking hour: \"+workingHour+\n \"\\nJoining date: \"+joiningDate+\n \"\\nQualification: \"+qualification+\n \"\\nAppointed by: \"+appointedBy);\n }\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tnew EmployeeView().init();\r\n\t\t\t}", "public Viewemployeeexpenditure() {\n initComponents();\n view1();\n \n }", "@Override \n public String toString() \n { \n return \"user\" + \n \"\\n\\t RecordNo: \" + this.recordNo + \n \"\\n\\t EmployeeName: \" + this.name + \n \"\\n\\t Age: \" + this.age + \n \"\\n\\t Sex: \" + this.sex + \n \"\\n\\t Date of Birth: \" + this.dob + \n \"\\n\\t Remark: \" + this.remark; \n }", "public static void main(String[] args) {\n\r\n\r\n Employee e1=new Employee();\r\n\r\n e1.name=\"avinash\";\r\n e1.city=\"ongole\";\r\n e1.age=58;\r\n\r\n e1.display();\r\n }", "private static void printEmployeeDetails(final List<Employee> employeeDetails) {\r\n\t\tString headerFormat = \"%-25s%-20s%-20s%-20s%-20s%-20s\\n\";\r\n\t\tString rowFormat = \"%-25s%-20s%-20s%-20s%-20s%-20s\\n\";\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Employee details:\");\r\n\t\tSystem.out.println(\"=============================================================================================================================\");\r\n\t\tSystem.out.format(headerFormat, \"Name\", \"Class\", \"Hours\", \"Sales\", \"Rate\", \"Weekly Pay Amount\");\r\n\t\tSystem.out.println(\"=============================================================================================================================\");\r\n\t\tfinal NumberFormat formatter = NumberFormat.getCurrencyInstance();\r\n\t\tfor (Employee employee : employeeDetails) {\r\n\t\t\tfinal StringBuilder employeeName = new StringBuilder();\r\n\t\t\temployeeName.append(employee.getFirstName()).append(\" \").append(employee.getLastName());\r\n\r\n\t\t\tif (employee.getClassType().equalsIgnoreCase(\"Salaried\")) {\r\n\r\n\t\t\t\tdouble monthlySalary = ((SalariedEmployee) employee).getMonthlySalary();\r\n\t\t\t\tboolean isRewarded = employee.isRewarded();\r\n\t\t\t\tif (isRewarded) {\r\n\t\t\t\t\tmonthlySalary += monthlySalary * 0.1;\r\n\t\t\t\t}\r\n\t\t\t\tStringBuilder sb = new StringBuilder();\r\n\t\t\t\tsb.append(formatter.format(monthlySalary / 4));\r\n\t\t\t\tsb.append(isRewarded ? \"*\" : \"\");\r\n\t\t\t\tSystem.out.format(rowFormat, employeeName.toString(), employee.getClassType(), \"\", \"\", \"\", sb.toString());\r\n\r\n\t\t\t} else if (employee.getClassType().equalsIgnoreCase(\"Hourly\")) {\r\n\r\n\t\t\t\tdouble weeklyWorkedHours = ((HourlyEmployee) employee).getWeeklyWorkedHours();\r\n\t\t\t\tdouble hourlyRate = ((HourlyEmployee) employee).getHourlyRate();\r\n\t\t\t\tdouble weeklyPayAmount = 40 * ((HourlyEmployee) employee).getHourlyRate();\r\n\r\n\t\t\t\t// Rate will be doubled if it’s beyond 40 hours/week.\r\n\t\t\t\tif (((HourlyEmployee) employee).getWeeklyWorkedHours() > 40) {\r\n\t\t\t\t\tdouble overtime = ((HourlyEmployee) employee).getWeeklyWorkedHours() - 40;\r\n\t\t\t\t\tdouble overtimePay = overtime * (((HourlyEmployee) employee).getHourlyRate() * 2);\r\n\t\t\t\t\tweeklyPayAmount += overtimePay;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tSystem.out.format(rowFormat, employeeName.toString(), employee.getClassType(), weeklyWorkedHours, \"\", formatter.format(hourlyRate), formatter.format(weeklyPayAmount));\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\tdouble weeklySales = ((CommissionedEmployee) employee).getWeeklySales();\r\n\t\t\t\tdouble commissionRate = ((CommissionedEmployee) employee).getCommissionRate();\r\n\t\t\t\tSystem.out.format(rowFormat, employeeName.toString(), employee.getClassType(), \"\", formatter.format(weeklySales), \"\", formatter.format(weeklySales * commissionRate));\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"\\nNote: * A 10% bonus is awarded\\n\");\r\n\r\n\t}", "public static void main(String[] args) throws NullPointerException {\n\n\t\t// default constructor\n\t\tEmployeeInfo employeeInfo = new EmployeeInfo();\n\t\tEmployeeInfo employeeInfo1 = new EmployeeInfo(\" FORTUNE COMPANY \");\n\n\t\tEmployeeInfo emp1 = new EmployeeInfo(1, \"Abrah Lincoln\", \"Accounts\", \"Manager\", \"Hodgenville, KY\");\n\t\tEmployeeInfo emp2 = new EmployeeInfo(2, \"John F Kenedey\", \"Marketing\", \"Executive\", \"Brookline, MA\");\n\t\tEmployeeInfo emp3 = new EmployeeInfo(3, \"Franklin D Rossevelt\", \"Customer Realation\", \"Assistnt Manager\",\n\t\t\t\t\"Hyde Park, NY\");\n\n\n\t\t// Printing Employee information in this pattern\n\t\t// \"ID Name Number Department Position Years Worked Pension Bonus Total salary \"\n\n\t\tSystem.out.println(emp1.employeeId() + \"\\t\" + emp1.employeeName() + \"\\t\\t\" + emp1.getDepartment() + \"\\t\\t\"\n\t\t\t\t+ emp1.getJobTitle() + \"\\t\\t\\t\" + emp1.getYearsWorked() + \"\\t\\t\" + emp1.calculateEmployeePension()\n\t\t\t\t+ \"\\t\" + emp1.calculateEmployeeBonus() + \"\\t\\t\" + emp1.calculateSalary());\n\n\t\tSystem.out.println(emp2.employeeId() + \"\\t\" + emp2.employeeName() + \"\\t\\t\" + emp2.getDepartment() + \"\\t\\t\"\n\t\t\t\t+ emp2.getJobTitle() + \"\\t\\t\" + emp2.getYearsWorked() + \"\\t\\t\" + emp2.calculateEmployeePension() + \"\\t \"\n\t\t\t\t+ emp2.calculateEmployeeBonus() + \"\\t\\t\" + emp2.calculateSalary());\n\n\t\tSystem.out.println(emp3.employeeId() + \"\\t\" + emp3.employeeName() + \"\\t\" + emp3.getDepartment() + \"\\t\"\n\t\t\t\t+ emp3.getJobTitle() + \"\\t\" + emp3.getYearsWorked() + \"\\t\\t \" + emp3.calculateEmployeePension() + \"\\t\"\n\t\t\t\t+ emp3.calculateEmployeeBonus() + \" \\t\\t\" + emp3.calculateSalary());\n\n\n\n\t}", "public String getEmployeeName() {\r\n\t\r\n\t\treturn employeeName;\r\n\t}", "@FXML\n void displayPD() {\n generalTextArea.clear();\n clearEverything();\n String employeeListPD = company.printByDepartment();\n generalTextArea.appendText(employeeListPD);\n }", "@Override\n\tpublic Employee getModel() {\n\t\treturn employee;\n\t}", "public static void getSalesInformation(Employee [] employee) {\n\t\tdouble total = 0;\n\t\tString report = \"-------List of employees with sales information-------\\n\";\n\t\tif (Employee.getEmployeeQuantity() == 0) {\n\t\t\tJOptionPane.showMessageDialog(null, \"There is no Employee!\");\n\t\t} else {\n\t\t\tfor (int i = 0; i < Employee.getEmployeeQuantity(); i++) {\n\t\t\t\ttotal += employee[i+1].getSales().getEachSales();\n\t\t\t\treport += ((i+1) + \" \" + employee[i+1].getName() + \" Sales: \" + employee[i+1].getSales().getEachSales() + \"\\n\"\n\t\t\t\t\t\t);\n\t\t\t}\n\t\t\treport += \"\\nTotal: \" + total;\n\t\t\tJOptionPane.showMessageDialog(null, report);\n\t\t}\n\t}", "public String toString(){\r\n return getNumber() + \":\" + getLastName() + \",\" + getFirstName() + \",\" + \"Sales Employee\";\r\n }", "public String getEmployeeName() {\r\n\t\treturn employeeName;\r\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n jButton1 = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Name\", \"Employee Code\", \"Post \", \"Phone No\", \"Gender\"\n }\n ));\n jScrollPane1.setViewportView(jTable1);\n\n getContentPane().add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 60, 560, 360));\n\n jButton1.setText(\"Show Employee Information\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n getContentPane().add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 440, -1, -1));\n\n jButton2.setText(\"Back\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n getContentPane().add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 440, -1, -1));\n\n jLabel1.setFont(new java.awt.Font(\"Copperplate Gothic Light\", 0, 18)); // NOI18N\n jLabel1.setText(\"Update Employee\");\n getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 20, -1, -1));\n\n pack();\n }", "public String getEmployees(){\n return employees;\n }", "public List<TRForm> viewFormforEmployee(int eid);", "public String toString()\n\t//return employee values\n\t{\n\t\treturn \"Id \" + id + \" Start date \" + start + \" Salary \" + salary + super.toString() + \" Job Title \" + jobTitle;\n\t}", "public List<Employee> getAllEmployeeDetail() {\n\t\treturn dao.getAllEmployeeDetail();\n\t}", "@RequestMapping(method=RequestMethod.POST ,value=\"/searchemployee\")\n\tpublic ModelAndView getEmployee(@RequestParam int employee_id )\n\t{\n\t\tSystem.out.println(\"INSIDE search by eid\");\n\t\t\n\t\tEmployeeRegmodel erobj= ergserv.getEmployeeRecordFromDB(employee_id);\n\t\t\n\t\tModelAndView mv= new ModelAndView();\n\t\t\t\tif(erobj.getEmployee_fullname()!= null)\n\t\t\t\t{\n\t\t\t\t\tmv.addObject(\"stinfo\", erobj);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tmv.addObject(\"msg\", \"INVALID Employee ID\");\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tmv.setViewName(\"ShowEmployeeDetails.jsp\");\n\t\t\t\t\n\t\t\t\t\n\t\t\t\treturn mv;\n\t}", "public void showemplist() throws Exception {\n\t\t Log.info(\"*******started execution of showemplist() in TC_hrms_102***********\");\n\t\tActions action = new Actions(g.driver);\n\t\taction.moveToElement(g.driver.findElement(By.linkText(\"PIM\"))).perform();\n\t\tThread.sleep(3000);\n\t\t\n\t\t//clicking on addemployee submenu link\n\t\tg.driver.findElement(By.id(\"menu_pim_viewEmployeeList\")).click();\n\t\tThread.sleep(3000);\n\t\tSystem.out.println(\"Clicked on Employee List submenu\");\n\t\t Log.info(\"*******end of execution of showemplist() in TC_hrms_102***********\");\n\t}", "private void btnPrintEmployeeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrintEmployeeActionPerformed\n if(searched == false){\n JOptionPane.showMessageDialog(rootPane, \"Please Perform a search on database first.\");\n return;\n }\n try {\n String report = \"IReports\\\\Employee.jrxml\";\n JasperReport jReport = JasperCompileManager.compileReport(report);\n JasperPrint jPrint = JasperFillManager.fillReport(jReport, null, newHandler.getConnector());\n JasperViewer.viewReport(jPrint, false);\n } catch (JRException ex) {\n JOptionPane.showMessageDialog(rootPane, ex.getMessage());\n }\n }", "public void DisplayEntry()\r\n {\r\n System.out.println(\"Username: \" + this.myUserName);\r\n System.out.println(\"Entry: \\n\" +\r\n this.myEntry);\r\n System.out.println(\"Date: \" + this.myDate);\r\n }", "@Override\n\tString toString(Employee obj) {\n\t\treturn null;\n\t}", "public com.example.nettyserver.protobuf.Employee.EmployeeInfo getEmployeelist() {\n return employeelist_ == null ? com.example.nettyserver.protobuf.Employee.EmployeeInfo.getDefaultInstance() : employeelist_;\n }", "@Override\n public void display(){\n System.out.println(\"Student id: \"+getStudentId()+\"\\nName is: \"+getName()+\"\\nAge :\"+getAge()+\"\\nAcademic year: \"+getSchoolYear()\n +\"\\nNationality :\"+getNationality());\n }", "private void saveEmployee()\n {\n Employee tempEmployee = new Employee();\n String line = \"\";\n try\n {\n PrintWriter out = new PrintWriter(fileName);\n for(int i = 0; i < employees.size(); i++)\n {\n tempEmployee = (Employee) employees.get(i);\n line = tempEmployee.getName() + \",\" + tempEmployee.getHours() + \",\" +\n tempEmployee.getRate();\n out.println(line);\n }\n out.close(); \n }\n catch(IOException ex)\n {\n ex.printStackTrace();\n }\n }", "@GetMapping(\"/showNewEmpForm\")\n\tpublic String showNewEmpForm(Model model) {\n\t\tEmployees employee = new Employees();\n\t\tmodel.addAttribute(\"employee\", employee);\n\t\treturn \"new_employee\";\n\t}", "java.lang.String getEmployeeName();", "@Override\r\n public String toString() {\r\n return \"Employee{\" + super.toString() + \", \" + \"employeeNumber=\" + employeeNumber + \", salary=\" + salary + '}';\r\n }", "public AddEmployeeGUI() {\r\n\t\tsetBackground(Color.RED);\r\n\t\tsetTitle(\"Add Employee\");\r\n\t\tsetDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\r\n\t\tsetBounds(100, 100, 450, 500);\r\n\t\tcontentPane = new JPanel();\r\n\t\tcontentPane.setBorder(new EmptyBorder(5, 5, 5, 5));\r\n\t\tsetContentPane(contentPane);\r\n\t\tcontentPane.setLayout(null);\r\n\r\n\t\tJLabel lblSelectEmployeeType = new JLabel(\"Select Employee Type\");\r\n\t\tlblSelectEmployeeType.setBounds(5, 0, 207, 25);\r\n\t\tcontentPane.add(lblSelectEmployeeType);\r\n\r\n\t\tlabel = new JLabel(\"\");\r\n\t\tlabel.setBounds(180, 36, 212, 24);\r\n\t\tcontentPane.add(label);\r\n\r\n\t\tJLabel lblFirstName = new JLabel(\"First Name\");\r\n\t\tlblFirstName.setBounds(5, 55, 207, 45);\r\n\t\tcontentPane.add(lblFirstName);\r\n\r\n\t\ttxtFirstName = new JTextField();\r\n\t\ttxtFirstName.setBounds(180, 71, 212, 24);\r\n\t\tcontentPane.add(txtFirstName);\r\n\t\ttxtFirstName.setColumns(10);\r\n\r\n\t\tJLabel lblLastName = new JLabel(\"Last Name\");\r\n\t\tlblLastName.setBounds(5, 105, 207, 45);\r\n\t\tcontentPane.add(lblLastName);\r\n\r\n\t\ttxtLastName = new JTextField();\r\n\t\ttxtLastName.setBounds(180, 119, 212, 24);\r\n\t\tcontentPane.add(txtLastName);\r\n\t\ttxtLastName.setColumns(10);\r\n\r\n\t\tJLabel lblDateOfBirth = new JLabel(\"Date of Birth (yyyy-mm-dd)\");\r\n\t\tlblDateOfBirth.setBounds(5, 155, 207, 45);\r\n\t\tcontentPane.add(lblDateOfBirth);\r\n\r\n\t\ttxtDOB = new JTextField();\r\n\t\ttxtDOB.setBounds(180, 167, 212, 24);\r\n\t\tcontentPane.add(txtDOB);\r\n\t\ttxtDOB.setColumns(10);\r\n\r\n\t\tJLabel lblTelephoneNo = new JLabel(\"Telephone no.\");\r\n\t\tlblTelephoneNo.setBounds(5, 205, 207, 45);\r\n\t\tcontentPane.add(lblTelephoneNo);\r\n\r\n\t\ttxtTel = new JTextField();\r\n\t\ttxtTel.setBounds(180, 215, 212, 24);\r\n\t\tcontentPane.add(txtTel);\r\n\t\ttxtTel.setColumns(10);\r\n\r\n\t\tJLabel lblEmail = new JLabel(\"Email\");\r\n\t\tlblEmail.setBounds(5, 255, 207, 45);\r\n\t\tcontentPane.add(lblEmail);\r\n\r\n\t\ttxtEmail = new JTextField();\r\n\t\ttxtEmail.setBounds(180, 263, 212, 24);\r\n\t\tcontentPane.add(txtEmail);\r\n\t\ttxtEmail.setColumns(10);\r\n\r\n\t\tJLabel lblGener = new JLabel(\"Gender\");\r\n\t\tlblGener.setBounds(5, 305, 207, 45);\r\n\t\tcontentPane.add(lblGener);\r\n\r\n\t\ttxtGender = new JTextField();\r\n\t\ttxtGender.setBounds(180, 311, 212, 24);\r\n\t\tcontentPane.add(txtGender);\r\n\t\ttxtGender.setColumns(10);\r\n\r\n\t\tJLabel lblStartDate = new JLabel(\"Start Date (yyyy-mm-dd)\");\r\n\t\tlblStartDate.setBounds(5, 355, 207, 45);\r\n\t\tcontentPane.add(lblStartDate);\r\n\r\n\t\ttxtStartDate = new JTextField();\r\n\t\ttxtStartDate.setBounds(180, 359, 212, 24);\r\n\t\tcontentPane.add(txtStartDate);\r\n\t\ttxtStartDate.setColumns(10);\r\n\r\n\t\tlabel_1 = new JLabel(\" \");\r\n\t\tlabel_1.setBounds(5, 405, 207, 50);\r\n\t\tcontentPane.add(label_1);\r\n\r\n\t\tbtnAdd = new JButton(\"Add\");\r\n\t\tbtnAdd.setBounds(325, 405, 67, 24);\r\n\t\tcontentPane.add(btnAdd);\r\n\t}", "private void editJMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editJMenuItemActionPerformed\n // TODO add your handling code here:\n //Clear and set JTextFields visible--not a good a good implementation\n int index = employeeJComboBox.getSelectedIndex();\n try\n {\n String employeeName = employeeJComboBox.getSelectedItem().toString();\n\n //Create a temp city to populate fields of form\n Employee employeeToEdit = new Employee(findEmployee(employeeName));\n \n //pass city info to EdiCity constructor and view Edit form\n EditEmployee editedEmployee = new EditEmployee(this, true, employeeToEdit);\n editedEmployee.setVisible(true);\n if(editedEmployee.getEmployee() != null)\n {\n employees.remove(index);\n employees.add(index, editedEmployee.getEmployee());\n saveEmployee();\n displayEmployee();\n }\n }\n catch(NullPointerException nullex)\n {\n JOptionPane.showMessageDialog(null, \"Employee not edited\", \"Input error\",\n JOptionPane.WARNING_MESSAGE);\n //clearAll();\n employeeJList.setVisible(true);\n employeeJList.setSelectedIndex(0);\n }\n\n }", "public void displayLable() {\n\t\tSystem.out.println(\"Name of Company :\"+name+ \" Address :\"+address);\r\n\t}", "@Override\r\n\tpublic String AddEmployeeDetails(EmployeeEntity employee) throws CustomException {\n\t\tString strMessage=\"\";\r\n\t\trepository.save(employee);\r\n\t\tstrMessage=\"Employee data has been saved\";\r\n\t\treturn strMessage;\r\n\t}", "public String getEmployeeName();", "public void display() {\n\tSystem.out.println(\"student id is \"+studentid+\"\\t\"+\"student name is \"+studentName+\"\\t\"+\"marks is \"+marks);\r\n}", "private void btnGetEmployeeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGetEmployeeActionPerformed\n String stringID = textEmployeeID.getText();\n if(textEmployeeID.getText().isEmpty()){\n JOptionPane.showMessageDialog(rootPane, \"Please Enter a valid ID\");\n return;\n }\n int ID = Integer.parseInt(stringID);\n newHandler.getEmployee(ID);\n \n if(newHandler.getErrorMsg() != null){\n JOptionPane.showMessageDialog(rootPane, newHandler.getErrorMsg());\n }\n textEmployeeID.setText(Integer.toString(newHandler.getEmployeeID()));\n textFirstName.setText(newHandler.getEmployeeFirstName());\n textLastName.setText(newHandler.getEmployeeLastName());\n textJobTitle.setText(newHandler.getJobTitle());\n textSalary.setText(Double.toString(newHandler.getSalary()));\n textOtherDetails.setText(newHandler.getOtherDetails());\n searched = true;\n }", "@Override\n\tpublic void updateEmployee() {\n\n\t}", "public void actionPerformed(ActionEvent e){\n\t\t\tif(employees.size() >= 1){\n\t\t\t\t\ttry{\n\t\t\t\t\t\tfor(Employee employee: employees){\n\t\t\t\t\t\t\tif(employee.getEmployeeId()== Integer.parseInt(empIdCombo.getSelectedItem().toString())){\n\t\t\t\t\t\t\t\tempJTextArea.setText(\"Employee ID: \"+employee.getEmployeeId()\n\t\t\t\t\t\t\t\t\t\t+\"\\n Name: \" +employee.getEmployeeName() \n\t\t\t\t\t\t\t\t\t\t+\"\\n Access Level: \" +employee.getAccess()\n\t\t\t\t\t\t\t\t\t\t+\"\\n Password: \" +employee.getPassword()\n\t\t\t\t\t\t\t\t\t\t+\"\\n Salary: \" +employee.getSalary());\n\t\t\t\t\t\t\t\tempIdCombo.setSelectedIndex(0);\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}catch(NumberFormatException nfe){\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Employee Id should be a number.\");\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"No Employees Found\");\n\t\t\t\t}\n\t\t\t}", "public com.example.nettyserver.protobuf.Employee.EmployeeInfo getEmployeelist() {\n if (employeelistBuilder_ == null) {\n return employeelist_ == null ? com.example.nettyserver.protobuf.Employee.EmployeeInfo.getDefaultInstance() : employeelist_;\n } else {\n return employeelistBuilder_.getMessage();\n }\n }", "public Employeedetails getEmployeeDetailByName(String employeeId);", "@Override\n public String toString ()\n {\n String format = \"Employee %s: %s , %s\\n Commission Rate: $%.1f\\n Sales: $%.2f\\n\";\n\n return String.format(format, this.getId(), this.getLastName(), this.getFirstName(), this.getRate(), this.getSales());\n }", "public void xxx() {\n System.out.println(\"Salary: \" + salary);\n printInfo();\n\n Employee e = new Employee(\"Andy\", \"123\", 26);\n// System.out.println(\"Name: \" + e.name + \"; Age: \" + e.age + \";ID: \" + e.id);\n\n Manager m = new Manager(\"Andylee\", \"124\", 27);\n// System.out.println(\"Name: \" + m.name + \"; Age: \" + m.age + \";ID: \" + m.id);\n\n }" ]
[ "0.71017784", "0.7076639", "0.6917487", "0.6792148", "0.6775536", "0.6658171", "0.65851015", "0.65503305", "0.6458684", "0.6449608", "0.63708043", "0.629784", "0.62786233", "0.62635064", "0.62602913", "0.6251515", "0.623602", "0.62216944", "0.6216088", "0.6214841", "0.6210499", "0.6197975", "0.6158077", "0.60317117", "0.60004765", "0.5996955", "0.59705013", "0.59616816", "0.595991", "0.595765", "0.59424573", "0.59305763", "0.5930141", "0.5929989", "0.592579", "0.5907448", "0.58912164", "0.58781075", "0.58439577", "0.58092695", "0.5803158", "0.58004", "0.5798535", "0.57828146", "0.5770867", "0.57695824", "0.5768706", "0.57682997", "0.5758209", "0.5755128", "0.5754777", "0.5747411", "0.5738057", "0.5711318", "0.57035065", "0.5701259", "0.5692746", "0.56913126", "0.56881243", "0.5668514", "0.56603444", "0.5655176", "0.56544745", "0.5654153", "0.56201977", "0.5615834", "0.5611592", "0.5610802", "0.56091195", "0.5608308", "0.5601699", "0.5594709", "0.55923975", "0.5582726", "0.5582361", "0.55812526", "0.55774015", "0.5569353", "0.5567433", "0.5565505", "0.55645883", "0.5563392", "0.5559662", "0.5547543", "0.5547433", "0.55451226", "0.55438274", "0.55435807", "0.55384237", "0.55295974", "0.552806", "0.55280286", "0.551958", "0.5517875", "0.5514071", "0.5511548", "0.55061597", "0.550044", "0.5500177", "0.5492549", "0.54818356" ]
0.0
-1
Edit method Allow to user to change the information of employee's profile. This method put each line of a text fil into an ArrayList of stings
private ArrayList<String> saveText(){ FileReader loadDetails = null; String record; record = null; //Create an ArrayList to store the lines from text file ArrayList<String> lineKeeper = new ArrayList<String>(); try{ loadDetails=new FileReader("employees.txt"); BufferedReader bin=new BufferedReader (loadDetails); record=new String(); while (((record=bin.readLine()) != null)){//Read the file and store it into the ArrayList line by line* lineKeeper.add(record); }//end while bin.close(); bin=null; }//end try catch (IOException ioe) {}//end catc return lineKeeper; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void edit(){\n Integer Pointer=0;\n FileWriter editDetails = null;\n ArrayList<String> lineKeeper = saveText();\n\n /* Search into the list to find the Username, if it founds it, changes the\n * old information with the new information.\n * Search*/\n if(lineKeeper.contains(getUsername())){\n Pointer=lineKeeper.indexOf(getUsername());\n\n //Write the new information\n lineKeeper.set(Pointer+1, getPassword());\n lineKeeper.set(Pointer+2, getFirstname());\n lineKeeper.set(Pointer+3, getLastname());\n lineKeeper.set(Pointer+4, DMY.format(getDoB()));\n lineKeeper.set(Pointer+5, getContactNumber());\n lineKeeper.set(Pointer+6, getEmail());\n lineKeeper.set(Pointer+7, String.valueOf(getSalary()));\n lineKeeper.set(Pointer+8, getPositionStatus());\n Pointer=Pointer+9;\n homeAddress.edit(lineKeeper,Pointer);\n }//end if\n\n try{\n editDetails= new FileWriter(\"employees.txt\",false);\n for( int i=0;i<lineKeeper.size();i++){\n editDetails.append(lineKeeper.get(i));\n editDetails.append(System.getProperty(\"line.separator\"));\n }//end for\n editDetails.close();\n editDetails = null;\n }//end try\n catch (IOException ioe) {}//end catch\n }", "private void updateListaInformacaoSalva(){\n try(Stream<String> lines = Files.lines(Paths.get(this.path))){\n this.listaInformacaoSalva = lines\n .map(SalvaCsv::pelaLinha)\n .collect(Collectors.toList());\n\n }catch (IOException e){\n e.printStackTrace();\n }\n }", "public List <Person> editUser(List <Person> listOfPerson)\n\t{\n\t System.out.println(\"Enter the First Name you want to make changes in: \");\n\t String fname = Utility.inputString();\n\t for(int i = 0; i < listOfPerson.size(); i++)\n\t {\n\t \tif(listOfPerson.get(i).getFname().equals(fname))\n\t \t{\n\t \t\tPerson temp = listOfPerson.get(i);\n\t do {\n\t\t System.out.println(\"Enter the detail you want to edit: \");\n\t\t System.out.println(\"Enter 1 to edit Last Name: \");\n\t\t System.out.println(\"Enter 2 to edit Address: \");\n\t\t System.out.println(\"Enter 3 to edit City: \");\n\t\t System.out.println(\"Enter 4 to edit State: \");\n\t\t System.out.println(\"Enter 5 to edit Zip code: \");\n\t\t System.out.println(\"Enter 6 to edit Phone Number: \");\n\t\t int choice = Utility.inputInteger();\n\t\t switch(choice)\n\t\t {\n\t\t case 1:\n\t\t\t System.out.println(\"Enter the new Last Name\");\n\t\t\t temp.setLname(Utility.inputString()); \n\t\t\t System.out.println(\"Details saved successfully\");\n\t\t\t break;\n\t\t\t \n\t\t case 2:\n\t\t \t System.out.println(\"Enter the New Address\");\n\t\t \t temp.setAddress(Utility.inputString());\n\t\t \t System.out.println(\"Details saved successfully\");\n\t\t \t break;\n\t\t \t \n\t\t case 3:\n\t\t \t System.out.println(\"Enter the New City\");\n\t\t \t temp.setCity(Utility.inputString());\n\t\t \t System.out.println(\"Details saved successfully\");\n\t\t \t break;\n\t\t \t \n\t\t case 4:\n\t\t \t System.out.println(\"Enter the New State\");\n\t\t \t temp.setState(Utility.inputString());\n\t\t \t System.out.println(\"Details saved successfully\");\n\t\t \t break;\n\t\t \t \n\t\t case 5:\n\t\t \t System.out.println(\"Enter the new Zip code\");\n\t\t \t temp.setZip(Utility.inputInteger());\n\t\t \t System.out.println(\"Details saved successfully\");\n\t\t \t break;\n\t\t \t \n\t\t case 6:\n\t\t \t System.out.println(\"Enter the New Phone Number\");\n\t\t \t temp.setPhn(Utility.inputLong());\n\t\t \t System.out.println(\"Details saved successfully\");\n\t\t \t break;\n\t\t \t \n\t\t \t default:\n\t\t \t\t System.out.println(\"Invaild choice\");\n\t\t \t\t break;\n\t\t } \n\t\t listOfPerson.add(temp);\n\t\t return listOfPerson;\n\t }while(Utility.inputBoolean());\n\t }\n\t }\n\t return listOfPerson;\n\t}", "@Override\r\n public void update() {\n ArrayList<String>Lines=new ArrayList<>();\r\n File file =new File(\"/home/yara/Documents/4year/OODP/Task.txt\");\r\n BufferedReader br = null;\r\n try {\r\n br = new BufferedReader(new FileReader(\"/home/yara/Documents/4year/OODP/Task.txt\"));\r\n } catch (FileNotFoundException ex) {\r\n Logger.getLogger(Task.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n String str;\r\n String UID=id.getText();\r\n try {\r\n while((str=br.readLine()) !=null)\r\n {\r\n \r\n Lines.add(str);\r\n }\r\n String UpadetString = id.getText() +\" , \"+ name.getText()+\" , \"+ date_start.getText()+\" , \"+ date_finish.getText()+\" , \"+status.getText();\r\n for (int i=0 ;i<Lines.size();i++)\r\n {\r\n String line=Lines.get(i).trim();\r\n String[] datarow =line.split(\" , \");\r\n if(datarow[0].equals(UID))\r\n {\r\n Lines.set(i,UpadetString );\r\n } \r\n }\r\n PrintWriter Pwriter = new PrintWriter(file);\r\n Pwriter.print(\"\");\r\n Pwriter.close();\r\n \r\n File f=new File(\"/home/yara/Documents/4year/OODP/Task.txt\");\r\n FileWriter writer = new FileWriter(f.getAbsoluteFile(), true);\r\n BufferedWriter bw=new BufferedWriter(writer);\r\n for(String x:Lines)\r\n {\r\n bw.write(x);\r\n bw.newLine();\r\n }\r\n bw.close();\r\n \r\n } catch (IOException ex) {\r\n Logger.getLogger(Task.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n \r\n }", "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 static void updateApplication() throws FileNotFoundException {\n\t\tFile file = new File(\"C:\\\\Users\\\\singh\\\\eclipse-workspace\\\\Loan\\\\application.txt\");\n\t\tScanner scan = new Scanner(file);\n\t\tScanner scanInput = new Scanner(System.in);\n\t\tSystem.out.println(\"Type the name of the person you want to update:\");\n\t\tString personName = scanInput.nextLine();\n\t\tString person = \"\\\"\"+personName+\"\\\"\";\n\t\t\n\t\t\n\n\t\twhile (scan.hasNextLine()) {\n\n\t\t\tString line = scan.nextLine();\n\t\t\tString[] userInfo = line.split(\"\\t\");\n\t\t\tString userInfoString= userInfo[0].toLowerCase();\n\t\t\tint education = Integer.parseInt(userInfo[2]);\n\t\t\tint experience = Integer.parseInt(userInfo[3]);\n\t\t\tint sum = education + experience;\n\t\t\t\n\t\t\tint loan = Integer.parseInt(userInfo[1]);\n\t\t\tint score = 0;\n\t\t\tint[] estimatedProfit = new int[userInfo.length - 4];\n\t\t\tApplicant applicant = new Applicant(userInfo[0], education, experience, estimatedProfit, score, loan);\n\t\t\t\tif(userInfoString.equals(person.toLowerCase())) {\n\t\t\t\t\tApplicant tempApplicant = activeList.find(applicant);\n\t\t\t\t\tint updatedEducation;\n\t\t\t\t\tint updatedExperience;\n\t\t\t\t\tString updatedName;\n\t\t\t\t\tint updatedScore = 0;\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"Enter the updated Name:\");\n\t\t\t\t\tupdatedName = scanInput.nextLine();\n\t\t\t\t\tSystem.out.println(\"Enter the updated experience:\");\n\t\t\t\t\tupdatedExperience = scanInput.nextInt();\n\t\t\t\t\tSystem.out.println(\"Enter the updated education:\");\n\t\t\t\t\tupdatedEducation=scanInput.nextInt();\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"How many enteries do you have for estimated profit?\");\n\t\t\t\t\tint temp =scanInput.nextInt();\n\t\t\t\t\tint[] updatedEstPro = new int[temp];\n\t\t\t\t\tfor(int i=0;i<temp;i++) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.println(\"Enter the \"+(i+1)+\" entry of estimated profit\");\n\t\t\t\t\t\tint entry = scanInput.nextInt();\n\t\t\t\t\t\tupdatedEstPro[i]=entry;\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 (sum < 10) {\n\t\t\t\t\t\tapplicant = new Applicant(updatedName, updatedEducation, updatedExperience, estimatedProfit, score, loan);\n\t\t\t\t\t\trejectedList.add(applicant);\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Calculate score\n\t\t\t\t\t\t */\n\t\t\t\t\t\tint tmp = 0;\n\t\t\t\t\t\tfor (int j = 0; j < estimatedProfit.length; j++) {\n\t\t\t\t\t\t\ttmp = estimatedProfit[j] / (j + 1);\n\t\t\t\t\t\t\tupdatedScore = updatedScore + tmp;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\tApplicant updatedApplicant = new Applicant(updatedName, updatedEducation,updatedExperience,updatedEstPro,updatedScore,loan);\n\t\t\t\t\tactiveList.updateKey(updatedApplicant );\n\t\t\t\t \n\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t\n\t\t\n\n\t} }", "public void editContact() {\n int match = -1;\n Scanner sc = new Scanner(System.in);\n System.out.println(\"enter first name of person whose contact details you wants to edit\");\n String name = sc.nextLine();\n Contact contactToBeEdited = contactList.get(0);\n System.out.println(contactList.get(0));\n\n for (int j = 0; j < contactList.size(); j++) {\n Contact conMatch = contactList.get(j);\n System.out.println(conMatch.getFirstName());\n if (name.equals(conMatch.getFirstName())) {\n match = j;\n contactToBeEdited = contactList.get(match);\n\n } else {\n System.out.println(\"no contact with this first name \");\n }\n\n }\n\n if (match != -1) {\n\n System.out.print(\" what you want to edit : \"\n + \"\\n1. Zip Code\" + \"\\n2. First Name\" + \"\\n3 Last Name\" + \"\\n4. Address\"+ \"\\n5. City\" + \"\\n6. State\"\n\n + \"\\n7. Phone Number\" + \"\\n8. Email\");\n\n int option = sc.nextInt();\n sc.nextLine(); // catches the new line character\n\n switch (option) {\n case 1:\n System.out.println(\"enter new zip code\");\n String newZipCode = sc.nextLine();\n contactToBeEdited.setZip(newZipCode);\n break;\n\n case 2:\n System.out.println(\"enter new first name\");\n String newFirstName = sc.nextLine();\n contactToBeEdited.setFirstName(newFirstName);\n break;\n\n case 3:\n System.out.println(\"enter new last name\");\n String newLastName = sc.nextLine();\n contactToBeEdited.setFirstName(newLastName);\n break;\n\n case 4 :\n System.out.println(\"enter new street address\");\n String address = sc.nextLine();\n contactToBeEdited.setAddress(address);\n break;\n\n\n\n case 5:\n System.out.println(\"enter new city name\");\n String newcityName = sc.nextLine();\n contactToBeEdited.setCity(newcityName);\n break;\n\n case 6:\n System.out.println(\"enter new state name\");\n String newStateName = sc.nextLine();\n contactToBeEdited.setState(newStateName);\n break;\n\n\n case 7:\n System.out.println(\"enter new phone number\");\n String newPhoneNumber = sc.nextLine();\n contactToBeEdited.setPhone(newPhoneNumber);\n break;\n\n case 8:\n System.out.println(\"enter new email address\");\n String newEmailAddress = sc.nextLine();\n contactToBeEdited.setEmail(newEmailAddress);\n break;\n\n default:\n System.out.println(\"choice does not exist\");\n\n }\n\n\n }\n\n }", "public void readUserFile (){\n try {\n FileReader reader = new FileReader(fileName);\n BufferedReader bufferedReader = new BufferedReader(reader);\n String line;\n while ((line = bufferedReader.readLine()) != null) {\n Scanner s = new Scanner(line); //use of a scanner to parse the line and assign its tokens to different variables\n//each line corresponds to the values of a User object\n while(s.hasNext()){\n String usrname = s.next();\n String pass = s.next();\n User u = new User(usrname,pass);\n userlist.add(u);//added to the list\n }\n \n }\n reader.close();\n \n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void delete(){\n Integer Pointer=0;\n FileWriter editDetails = null;\n ArrayList<String> lineKeeper = saveText();\n\n if(lineKeeper.contains(getUsername())){\n Pointer=lineKeeper.indexOf(getUsername());\n Pointer=Pointer-1;\n for(int i=1;i<=8;i++){\n lineKeeper.remove(Pointer+1);\n }//end for\n homeAddress.delete(lineKeeper);\n }\n try{\n editDetails= new FileWriter(\"employees.txt\",false);\n for( int i=0;i<lineKeeper.size();i++){\n editDetails.append(lineKeeper.get(i));\n editDetails.append(System.getProperty(\"line.separator\"));\n }//end for\n editDetails.close();\n editDetails = null;\n }//end try\n catch (IOException ioe) {}//end catch\n }", "void addInputData(List<Profile> profiles) {\n\t\tfinal String METHOD_NAME = \"addInputData\";\n\t\tLOGGER.entering(CLASS_NAME, METHOD_NAME);\n\t\tfinal String inputFilePath = \"input.txt\";\n\t\tFile file = new File(inputFilePath);\n\t\ttry {\n\t\t\tBufferedReader bufferedReader = new BufferedReader(new FileReader(file));\n\t\t\tString currentLine;\n\t\t\twhile((currentLine = bufferedReader.readLine()) != null) {\n\t\t\t\tString[] inputs = currentLine.split(\" \");\n\t\t\t\tProfile tempProfile = new Profile();\n\t\t\t\ttempProfile.setFirstName(inputs[0]);\n\t\t\t\tif(inputs.length > 1) {\n\t\t\t\t\ttempProfile.setLastName(inputs[1]);\n\t\t\t\t}\n\t\t\t\tif(inputs.length > 2) {\n\t\t\t\t\tStringBuilder location = new StringBuilder();\n\t\t\t\t\tfor(int i = 2; i < inputs.length; i++) {\n\t\t\t\t\t\tlocation.append(inputs[i] + \" \");\n\t\t\t\t\t}\n\t\t\t\t\ttempProfile.setLocation(location.toString().trim());\n\t\t\t\t}\n\t\t\t\tprofiles.add(tempProfile);\n\t\t\t}\n\t\t\tbufferedReader.close();\n\t\t} catch (IOException ex) {\n\t\t\tLOGGER.logp(Level.SEVERE, CLASS_NAME, METHOD_NAME, \"Error reading data from input file\" + inputFilePath);\n\t\t}\n\t\tLOGGER.exiting(CLASS_NAME, METHOD_NAME);\n\t}", "static void editDetails(int index, List<String> data){\n people.get(index).setFirstName(data.get(0));\n people.get(index).setLastName(data.get(1));\n people.get(index).setHeight(Short.parseShort(data.get(2)));\n people.get(index).setWeight(Double.parseDouble(data.get(3)));\n people.get(index).setBirthDate(LocalDate.of(\n Integer.parseInt(data.get(4)),\n Integer.parseInt(data.get(5)),\n Integer.parseInt(data.get(6))));\n people.get(index).setSex(checkSex(data.get(7)));\n people.get(index).setPosition(data.get(8));\n people.get(index).setHireDate(LocalDate.of(\n Integer.parseInt(data.get(9)),\n Integer.parseInt(data.get(10)),\n Integer.parseInt(data.get(11))));\n ;\n }", "public void readStaffEntry()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tScanner reader = new Scanner(new FileReader(\"StaffEntryRecords.txt\"));\r\n\t\t\twhile (reader.hasNext())\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(reader.nextLine());\r\n\t\t\t}\r\n\t\t\treader.close();\r\n\t\t}\r\n\t\tcatch(FileNotFoundException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"FileNotFoundException\");\r\n\t\t}\r\n\t}", "public void editStudentList(String lastName){\n for(int i = 0; i<studList.size();i++){\n \n if(lastName.equals(studList.get(i).getLastName())){\n \n System.out.println(\"Student Name: \" + studList.get(i).getFullName() + \", Student Number: \" + studList.get(i).getStuNumber() + \", Student GPA: \" + studList.get(i).getGPA());\n\n Scanner input = new Scanner(System.in);\n String newName = \"\";\n double newGPA;\n\n System.out.print(\"Student name: \");\n newName = input.nextLine();\n\n System.out.print(\"Student GPA: \");\n newGPA = input.nextDouble();\n\n Student temp = new Student(newName, studList.get(i).getStuNumber(), newGPA);\n studList.set(i, temp);\n }\n }\n }", "public static void editInfo(String user, boolean Registration){\n\t\ttry{\n\t\t\tFile Information = new File(\"information.txt\");\n\t\t\tArrayList<String> info = new ArrayList<String>();\n\t\t\tScanner inputFromInformation = new Scanner(Information);\n\t\t\tif (Registration){\n\t\t\t\twhile (inputFromInformation.hasNextLine()){\n\t\t\t\t\tinfo.add(inputFromInformation.nextLine());\n\t\t\t\t}\n\n\t\t\t\tinfo.add(Editor(user));\n\t\t\t\tPrintWriter output = new PrintWriter(Information);\n\t\t\t\tfor (int i=0; i<info.size(); i++){\n\t\t\t\t\toutput.println(info.get(i));\n\t\t\t\t}\n\t\t\t\toutput.close();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"If you would like to change any information, \"\n\t\t\t\t\t\t+ \"\\nYou will need to change all the information, for security reasons\");\n\t\t\t\twhile (inputFromInformation.hasNextLine()){\n\t\t\t\t\tinfo.add(inputFromInformation.nextLine());\n\t\t\t\t}\n\t\t\t\tString uname=\" \";\n\t\t\t\tint index=0;\n\t\t\t\tfor(int i=0; i<info.size();i++){\n\t\t\t\t\tuname=\"\";\n\t\t\t\t\tString name=info.get(i);\n\t\t\t\t\tfor (int j=0; j<name.length(); j++){\n\t\t\t\t\t\tString temp = name.charAt(j)+\"\";\n\t\t\t\t\t\tif (!temp.equals(\" \"))\n\t\t\t\t\t\t\tuname+=name.charAt(j);\n\t\t\t\t\t}\n\t\t\t\t\tif(user.equals(uname)){\n\t\t\t\t\t\tindex=i;\n\t\t\t\t\t}\t\t\n\t\t\t\t}\n\n\t\t\t\tinfo.set(index,Editor(user));\n\t\t\t\tPrintWriter output = new PrintWriter(Information);\n\t\t\t\tfor (int i=0; i<info.size(); i++){\n\t\t\t\t\toutput.println(info.get(i));\n\t\t\t\t}\n\t\t\t\toutput.close();\n\t\t\t\tScanner input = new Scanner(System.in);\n\t\t\t\tSystem.out.println(\"Enter (1) to logout\");\n\t\t\t\tint command = input.nextInt();\n\t\t\t\tif (command==1)starter();\n\t\t\t}\n\t\t}\n\n\t\tcatch (java.io.IOException ex){\n\t\t\tSystem.out.println(\"I/O Errors: File is not found\");\n\t\t}\t\n\t}", "private void viewAllInfo(){\r\n try{\r\n Scanner scanner = new Scanner(file);\r\n String info;\r\n\r\n while (scanner.hasNext()){\r\n String line = scanner.nextLine();\r\n String[] components = line.split(separator);\r\n info = \" Name: \" + components[0] + \"\\n\";\r\n info += \" Phone No.: \"+components[1]+\"\\n\";\r\n info += \" Email: \"+components[2]+\"\\n\";\r\n info += \" Address: \"+components[3]+\"\\n\";\r\n textAreaFromAllInfo.append(info+\"\\n\");\r\n }\r\n\r\n }catch (IOException e){\r\n fileError();\r\n }\r\n }", "private static void editStudent () {\n System.out.println(\"Here is a list of Students..\");\n showStudentDB();\n System.out.println(\"Enter Id of student you want to edit: \");\n int studentId = input.nextInt();\n input.nextLine();\n Student student = null;\n\n for(Student s: studentDB) {\n if(s.getID() == studentId) {\n student = s;\n }\n }\n\n if(student != null) {\n System.out.println(\"Enter New Name\");\n String str = input.nextLine();\n student.setName(str);\n System.out.println(\"Name is changed!\");\n System.out.println(\"Id: \" + student.getID() + \"\\n\" + \"Name: \" + student.getName() );\n } else {\n System.out.println(\"Invalid Person!\");\n }\n }", "public static void loadArrayList() throws IOException\n\t{\n\t\tString usersXPFile = \"UsersXP.txt\";\n\t\t\n\t\tFile file = new File(usersXPFile);\n\t\t\n\t\tScanner fileReader;\n\t\t\n\t\tif(file.exists())\n\t\t{\n\t\t\tfileReader = new Scanner(file);\n\t\t\twhile(fileReader.hasNext())\n\t\t\t\tuserDetail1.add(userData.addNewuser(fileReader.nextLine().trim()));\n\t\t\tfileReader.close();\n\t\t}\n\t\telse overwriteFile(usersXPFile, \"\");\n\t\t\n\t\t\n\t}", "public void setClientList(String filePath) throws FileNotFoundException {\n Scanner scan = new Scanner(new File(filePath));\n while (scan.hasNextLine()) { // while there's another line in the file\n String line = scan.nextLine();\n if (line == \"\") { // if the next line is empty, stop the loop\n break;\n }\n int i = 0; // to keep track of the iterator placement in the line\n int n = 0; // to keep track of information in store\n String email = new String();\n String[] newInformation = new String[5];\n while (i < line.length()) { // checks every character in the line\n String store = \"\";\n while (i < line.length() && line.charAt(i) != ',') {\n store += line.charAt(i);\n i++;\n }\n i++;\n n++;\n switch (n) { // stores area into appropriate place for user\n case 1:\n newInformation[0] = store;\n break;\n case 2:\n newInformation[1] = store;\n break;\n case 3:\n email = store;\n break;\n case 4:\n newInformation[2] = store;\n break;\n case 5:\n newInformation[3] = store;\n break;\n case 6:\n newInformation[4] = store;\n break;\n }\n }\n boolean b = false;\n for (Client c: this.clientList) {\n if (c.getEmail().equals(email)) {\n b = true;\n c.setLastName(newInformation[0]);\n c.setFirstNames(newInformation[1]);\n c.setAddress(newInformation[2]);\n c.setCreditCardNumber(newInformation[3]);\n c.setExpiryDate(newInformation[4]);\n }\n }\n if (!b) {\n this.clientList.add(new Client(email, newInformation[0], newInformation[1], newInformation[2], newInformation[3], newInformation[4]));\n }\n }\n scan.close();\n flightSystem.setClientList(this.clientList); // updates FlightSystem\n setChanged();\n notifyObservers(clientList);\n }", "public void editAss() throws IOException {\r\n\t\tif (listview.getSelectionModel().getSelectedItem() != null) {\r\n\t\t\tassToChoose = listview.getSelectionModel().getSelectedItem();\r\n\t\t\tfor (int i = 0; i < b.size(); i++) {\r\n\t\t\t\tif (b.get(i).getAssname().equals(assToChoose)) {\r\n\t\t\t\t\tassId = b.get(i).getAssId();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tconnectionmain.showTeacherEditAssGUI();\r\n\t\t}\r\n\t}", "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 void edit() {\n\n\t}", "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 }", "public static void main(String[] args) throws Exception {\n\t\t Scanner sc=new Scanner(System.in);\n//\t\t List<String> list=new ArrayList<>();\n//\t\t BufferedReader br=new BufferedReader(new FileReader(\"f:\\\\picture\\\\user.txt\"));\n//\t\t String line=null;\t\n//\t\t System.out.println(\"学生信息:\");\n//\t\t System.out.println(\"姓名,密码 ,画像 ,年龄,性别\");\n//\t\t System.out.println(\"姓名\");\n//\t\t String s=sc.next();\n//\t\t System.out.println(\"替换后\");\n//\t\t String s1=sc.next();\n//\t\t while ((line=br.readLine())!=null) {\t\t\t\n//\t\t\t String[] arr=line.split(\",\");\t\t\t\t\n//\t\t\t if(arr[0].equals(s)) {\n//\t\t\t\tSystem.out.print(arr[0]+\",\");\t\t\n//\t\t\t\tString s2=line.replace(s,s1);\n//\t\t\t\tSystem.out.println(s2);\n//\t\t\t }\n//\t\t\t}\n\t\t System.out.println(\"删除 姓名\");\n\t\t String s=sc.next();\n\t\n\t\tStringBuffer sb=new StringBuffer();\n\t\tBufferedReader br=new BufferedReader(new FileReader(\"f:\\\\picture\\\\user.txt\"));\n\t\tString line=null;\n\t\twhile ((line=br.readLine())!=null) {\t\t\t\n\t\t\t String[] arr=line.split(\",\");\t\t\t\t\n\t\t\t if(arr[0].equals(s)) {\n\t\t\t\tSystem.out.print(arr[0]+\",\");\t\t\n\t\t\t\t//String s2=line.replace(s,s1);\n\t\t\t\t//System.out.println(s2);\n\t\t\t }else {\n\t\t\t \tsb.append(line).append(\"\\r\\n\");\n\t\t\t }\n\t\t\t }\n\t\tBufferedWriter bw=new BufferedWriter(new FileWriter(\"f:\\\\picture\\\\user.txt\")); \t \n\t System.out.println(sb.toString());\n\t\tbw.write(sb.toString());\n\t\tbw.close();\n\t}", "private void readFile(File fp)throws IOException{\n Scanner in=new Scanner(fp);\n String line,s[];\n while(in.hasNext()){\n line=in.nextLine();\n s=line.split(\"[ ]+\");\n if(s.length<3){\n payroll.addLast(new ObjectListNode(new Employee(s[1],s[0])));\n }\n else{\n payroll.addLast(new ObjectListNode(new Employee(s[1],s[0],s[2].charAt(0),s[4].charAt(0),\n Integer.parseInt(s[3]),Double.parseDouble(s[5]))));\n }\n }\n }", "public void getOldFile() throws FileNotFoundException, IOException, ClassNotFoundException{\r\n\t\tObjectInputStream ois = new ObjectInputStream(new FileInputStream(\"agenda.txt\"));\r\n\t\tArrayList<Artist> inputArtists = (ArrayList<Artist>) ois.readObject();\r\n\t\tArrayList<Stage> inputStages = (ArrayList<Stage>) ois.readObject();\r\n\t\tArrayList<Performance> inputPerformances = (ArrayList<Performance>) ois.readObject();\r\n\t\tartists.addAll(inputArtists);\r\n\t\tstages.addAll(inputStages);\r\n\t\tperformances.addAll(inputPerformances);\r\n\t}", "public void editTheirProfile() {\n\t\t\n\t}", "public void readFromEmployeeListFile()\r\n {\r\n try(ObjectInputStream fromEmployeeListFile = \r\n new ObjectInputStream(new FileInputStream(\"listfiles/employeelist.dta\")))\r\n {\r\n employeeList = (EmployeeList) fromEmployeeListFile.readObject();\r\n employeeList.setSavedStaticEmpRunNR(fromEmployeeListFile);\r\n }\r\n catch(ClassNotFoundException cnfe)\r\n {\r\n employeeList = new EmployeeList();\r\n JOptionPane.showMessageDialog(null, \"Fant ikke definisjon av ansatt \"\r\n + \"objektene.\\nOppretter tomt ansattregister.\\n\"\r\n + cnfe.getMessage(), \"Feilmelding\", \r\n JOptionPane.ERROR_MESSAGE);\r\n }\r\n catch(FileNotFoundException fnfe)\r\n {\r\n employeeList = new EmployeeList();\r\n JOptionPane.showMessageDialog(null, \"Finner ikke angitt fil.\\n\"\r\n + \"Oppretter tomt ansattregister.\\n\" \r\n + fnfe.getMessage(), \"Feilmelding\", \r\n JOptionPane.ERROR_MESSAGE);\r\n }\r\n catch(IOException ioe)\r\n\t{\r\n employeeList = new EmployeeList();\r\n JOptionPane.showMessageDialog(null, \"Fikk ikke lest fra filen.\\n\"\r\n + \"Oppretter tomt ansattregister.\\n\"\r\n + ioe.getMessage(), \"Feilmelding\", \r\n JOptionPane.ERROR_MESSAGE);\r\n\t}\r\n }", "public static void editContact() {\n System.out.println(\"Enter first name: \");\n String firstName = sc.nextLine();\n for (int i = 0; i < list.size(); i++) {\n if (list.get(i).getFirstName().equalsIgnoreCase(firstName)) {\n list.remove(i);\n addContact();\n } else {\n System.out.println(\"No data found in Address Book\");\n }\n }\n }", "public static ArrayList<Student> loadListOfStudents(String fileName) {\n ArrayList<Student> students = new ArrayList<>();\r\n String str = TextReader.StringFromFile(fileName);//Uses the method that returns a complete string with newlines for each studentline.\r\n if (validateInput(str)) {//Uses the validation method to check that the input is valid.\r\n String[] lines = str.split(\"\\n\");\r\n String[] lineParameters;\r\n int countFor = 0;\r\n for (String line : lines) {\r\n if(countFor > 1){\r\n lineParameters = line.split(\",\");\r\n Vote vote = new Vote(new Subject(lineParameters[1]), new Subject(lineParameters[2]), new Subject(lineParameters[3]), new Subject(lineParameters[4]));\r\n Student newStudent = new Student(lineParameters[0], vote);\r\n students.add(newStudent);\r\n }\r\n countFor++;\r\n }\r\n }\r\n\r\n return students;\r\n }", "private void readFile() {\r\n\t\tScanner sc = null; \r\n\t\ttry {\r\n\t\t\tsc = new Scanner(inputFile);\t\r\n\t\t\twhile(sc.hasNextLine()){\r\n\t\t\t\tgrade.add(sc.nextLine());\r\n\t } \r\n\t\t}\r\n\t\tcatch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tsc.close();\r\n\t\t}\t\t\r\n\t}", "private List<User> readFromFile() {\n\n List<String> lines = new ArrayList<>();\n List<User> contactList = new ArrayList<>();\n Map<String, PhoneNumber> phoneNumbersNewUser = new HashMap<>();\n\n try (BufferedReader in = new BufferedReader(new FileReader(contactsFile))) {\n String line;\n while ((line = in.readLine()) != null) {\n lines.add(line);\n }\n\n } catch (IOException ex) {\n System.out.println(\"File not found \\n\" + ex);\n ;\n }\n\n for (String line : lines) {\n String[] userProperties = line.split(\"\\\\|\");\n\n int id = Integer.parseInt(userProperties[0]);\n String fName = userProperties[1];\n String lName = userProperties[2];\n String email = userProperties[3];\n int age = Integer.parseInt(userProperties[4]);\n String[] phones = userProperties[5].split(\"\\\\,\");\n String[] homePhone = phones[0].split(\"\\\\_\");\n String[] mobilePhone = phones[1].split(\"\\\\_\");\n String[] workPhone = phones[2].split(\"\\\\_\");\n phoneNumbersNewUser.put(homePhone[0], new PhoneNumber(homePhone[1], homePhone[2]));\n phoneNumbersNewUser.put(mobilePhone[0], new PhoneNumber(mobilePhone[1], mobilePhone[2]));\n phoneNumbersNewUser.put(workPhone[0], new PhoneNumber(workPhone[1], workPhone[2]));\n String[] homeAdress = userProperties[6].split(\"\\\\,\");\n Address homeAdressNewUser = new Address(homeAdress[0], Integer.parseInt(homeAdress[1]), Integer.parseInt(homeAdress[2]),\n homeAdress[3], homeAdress[4], homeAdress[5], homeAdress[6]);\n String title = userProperties[7];\n String[] companyProperties = userProperties[8].split(\"\\\\_\");\n String[] companyAddress = companyProperties[1].split(\"\\\\,\");\n Address companyAddressNewUser = new Address(companyAddress[0], Integer.parseInt(companyAddress[1]),\n Integer.parseInt(companyAddress[2]), companyAddress[3], companyAddress[4], companyAddress[5],\n companyAddress[6]);\n String companyName = companyProperties[0];\n Company companyNewUser = new Company(companyName, companyAddressNewUser);\n boolean isFav = Boolean.parseBoolean(userProperties[9]);\n User user = new User(id, fName, lName, email, age, phoneNumbersNewUser, homeAdressNewUser, title, companyNewUser, isFav);\n contactList.add(user);\n }\n\n\n return contactList;\n }", "public void loadPeriodInfo() throws IOException{\r\n try { \r\n String line;\r\n FileReader in = new FileReader (\"Period List.txt\");\r\n BufferedReader input = new BufferedReader(in); \r\n String line1;\r\n teacherListModel.removeAllElements();\r\n periodModel.removeAllElements();\r\n removeTeachersListModel.removeAllElements();\r\n editTeachersListModel.removeAllElements();\r\n teachers.clear();\r\n //Running through each line of code\r\n while ((line1 = input.readLine()) != null) {\r\n String tempLine = line1; \r\n String[] teacherData = new String [2];\r\n for (int i = 0; i < 2; i++) {\r\n teacherData [i] = tempLine.substring (0, tempLine.indexOf(\",\")); \r\n tempLine = tempLine.substring(tempLine.indexOf(\",\") + 1, tempLine.length()); \r\n } \r\n //Adding the teachers and their data\r\n Teacher tempTeacher = new Teacher (teacherData[0]);//name\r\n teacherListModel.addElement(teacherData[0]); \r\n periodModel.addElement(teacherData[0]); \r\n removeTeachersListModel.addElement(teacherData[0]); \r\n editTeachersListModel.addElement (teacherData[0]);\r\n teachers.add (tempTeacher);\r\n for (int j = 0; j < teacherData[1].length(); j++) {\r\n tempTeacher.addPeriod (Integer.parseInt(teacherData[1].substring (j, j + 1))); //period\r\n }\r\n }\r\n }catch (IOException E) {\r\n System.out.println (\"ERROR READING 'Period List.txt\"); \r\n }\r\n }", "public void fillFromFile()\n\t{\n\t\tJFileChooser fc = new JFileChooser();\t//creates a new fileChooser object\n\t\tint status = fc.showOpenDialog(null);\t//creates a var to catch the dialog output\n\t\tif(status == JFileChooser.APPROVE_OPTION)\t\n\t\t{\n\t\t\tFile selectedFile = fc.getSelectedFile ( );\n\t\t\tthis.fileName = selectedFile;\n\t\t\tScanner file = null; //scans the file looking for information to load\n\n\t\t\tif(selectedFile.exists())\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tfile = new Scanner(fileName); //scans the input file\n\t\t\t\t}\n\t\t\t\tcatch(Exception IOException)\n\t\t\t\t{\n\t\t\t\t\tJOptionPane.showConfirmDialog (null, \"Unable to import data from the list\");\n\t\t\t\t\tSystem.exit (-1);\n\t\t\t\t}//if there was an error it will pop up this message\n\t\t\t\t\n\t\t\t\tString str = file.nextLine ( ); //names the line\n\t\t\t\tString [] header = str.split (\"\\\\|\"); //splits the line at the |\n\t\t\t\tsetCourseNumber(header[1]);\n\t\t\t\tsetCourseName(header[0]);\n\t\t\t\tsetInstructor(header[2]);\n\t\t\t\t\n\t\t\t\twhile(file.hasNextLine ( ))\n\t\t\t\t{\n\t\t\t\t\tstr = file.nextLine ( ); //names the line\n\t\t\t\t\tString [] tokens = str.split (\"\\\\|\"); //splits the line at the |\n\t\t\t\t\tStudent p = new Student();\n\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tp.setStrNameLast (String.valueOf (tokens[0]));\n\t\t\t\t\t\tp.setStrNameFirst (String.valueOf (tokens[1]));\n\t\t\t\t\t\tp.setStrMajor (String.valueOf (tokens[2]));\n\t\t\t\t\t\tp.setClassification (tokens[3]);\n\t\t\t\t\t\tp.setiHoursCompleted (new Integer (tokens[4]).intValue ( ));\n\t\t\t\t\t\tp.setfGPA (new Float (tokens[5]).floatValue ( ));\n\t\t\t\t\t\tp.setStrStudentPhoto (String.valueOf (tokens[6]));\n\t\t\t\t\t//creates a person object and then populates it with an array of scanned input values\n\t\t\t\t\t\tclassRoll.add (p);\n\t\t\t\t\t\t}//creates a person object and then populates it with an array of scanned input values\n\t\t\t\t\t\tcatch(Exception IOException)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tIOException.printStackTrace ( );\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog (null, \"Bad input record: '\" + str + \"'\" + IOException.getMessage());\n\t\t\t\t\t\t}//pops up a message if there were any errors reading from the file\n\t\t\t\t}//continues through the file until there are no more lines to scan\n\t\t\tfile.close ( ); //closes the file\n\n\t\t\t\tif(selectedFile.exists ( )==false)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Exception();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception IOException)\n\t\t\t\t\t{\n\t\t\t\t\t\tJOptionPane.showMessageDialog (null, \"Bad input record: '\" + selectedFile + \"' \" + IOException.getMessage());\n\t\t\t\t\t}\n\t\t\t\t}//if the user picks a file that does not exist this error message will be caught.\n\t\t\t}\n\t\t}//if the input is good it will load the information from the selected file to and Array List\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.exit (0);\n\t\t\t}\n\t\tthis.saveNeed = true;\n\n\t\t}", "public void readFromFile(String path) {\n try {\n ArrayList<String> list = new ArrayList<>(Files.readAllLines(Paths.get(path)));\n\n for (String info: list) {\n AddressEntry entry = new AddressEntry();\n ArrayList<String> entryList = new ArrayList<>(Arrays.asList(info.split(\",\")));\n entry.setFirstName(entryList.get(0).trim());\n entry.setLastName(entryList.get(1).trim());\n entry.setStreet(entryList.get(2).trim());\n entry.setCity(entryList.get(3).trim());\n entry.setState(entryList.get(4).trim());\n entry.setZip(Integer.parseInt(entryList.get(5).trim()));\n entry.setPhone(entryList.get(6).trim());\n entry.setEmail(entryList.get(7).trim());\n add(entry);\n }\n\n System.out.println(\"Read in \" + list.size() + \" new Addresses. Successfully loaded\");\n System.out.println(\"There are currently \" + addressEntryList.size() + \" Addresses in the Address Book.\");\n }\n catch (IOException e) {\n System.out.println(e);\n }\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 }", "public void load_from_file() {\r\n // prompting file name from user\r\n System.out.print(\"Enter in FileName:\\n>\");\r\n\r\n // taking user input of file name\r\n String filename = Menu.sc.next();\r\n Scanner input;\r\n\r\n // try to open file, if fails throws exception and returns to main menu\r\n try {\r\n input = new Scanner(new FileReader(filename));\r\n } catch (FileNotFoundException e) {\r\n System.out.println(\"Unable to open file!!\");\r\n System.out.println();\r\n return;\r\n }\r\n\r\n int count = 0; // variable to count number of address entry read\r\n\r\n /* reading data until end of file */\r\n while (input.hasNextLine()) {\r\n String firstName = \"\", lastName = \"\", street = \"\", city = \"\", state = \"\", email = \"\", phone = \"\";\r\n int zip = 0;\r\n if (input.hasNextLine())\r\n firstName = input.nextLine();\r\n if (input.hasNextLine())\r\n lastName = input.nextLine();\r\n if (input.hasNextLine())\r\n street = input.nextLine();\r\n if (input.hasNextLine())\r\n city = input.nextLine();\r\n if (input.hasNextLine())\r\n state = input.nextLine();\r\n if (input.hasNextLine())\r\n zip = Integer.parseInt(input.nextLine());\r\n if (input.hasNextLine())\r\n phone = input.nextLine();\r\n if (input.hasNext())\r\n email = input.nextLine();\r\n if (input.hasNext())\r\n input.nextLine();\r\n addressEntryList.add(new AdressEntry(firstName, lastName, street, city, state, zip, phone, email));\r\n count++;\r\n }\r\n\r\n /*\r\n printing number of address entry variables\r\n and printing total number of AddressEntry in the list\r\n */\r\n System.out.println(\"Read in \" + count + \" new Addresses, successfully loaded, currently \"\r\n + addressEntryList.size() + \" Addresses\");\r\n input.close();\r\n System.out.println();\r\n }", "public static void readFromFile(ArrayList<String> sArrayList, Context context){\n\n int i=0;\n try{\n InputStream inputStream = context.openFileInput(TxtName);\n\n if(inputStream!=null) {\n InputStreamReader inputStreamReader = new InputStreamReader(inputStream);\n BufferedReader bufferedReader = new BufferedReader(inputStreamReader);\n String receivedString = \"\";\n\n while((receivedString = bufferedReader.readLine())!=null){\n sArrayList.set(i,receivedString);\n Log.d(\"fileContent\", \"readFromFile: \"+sArrayList.get(i)+\"\\n\");\n i++;\n }\n inputStream.close();\n }\n\n } catch (FileNotFoundException e) {\n Log.e(\"login activity\", \"File not found: \" + e.toString());\n } catch (IOException e) {\n Log.e(\"login activity\", \"Can not read file: \" + e.toString());\n }\n\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}", "private void seePerso() {\n\t\tfor (int i = 0; i < persoList.size(); i++) {\n\t\t\tPersonnage perso = persoList.get(i);\n\t\t\tSystem.out.println(\"id : \" + i);\n\t\t\tSystem.out.println(perso);\n\t\t}\n\n\t\tSystem.out.println(\"souhaitez vous modifier un personnage ? o/n\");\n\t\tif (sc.nextLine().toLowerCase().contentEquals(\"o\")) {\n\t\t\tSystem.out.println(\"Lequel ? id\");\n\t\t\tint id = sc.nextInt();\n\t\t\tsc.nextLine();\n\t\t\tchangePerso(id);\n\t\t}\n\t}", "public void editMenuItem() {\n\t\tviewMenu();\n\n\t\t// Clean arraylist so that you can neatly add data from saved file\n\t\tmm.clear();\n\t\t\n\t\tString menuEdit;\n\t\tint editC;\n\n\t\tSystem.out.println(\"Which one do you want to edit?\");\n\n\t\tString toChange;\n\t\tDouble changePrice;\n\t\tScanner menuE = new Scanner(System.in);\n\t\tmenuEdit = menuE.next();\n\n\t\ttry \n\t\t{\n\t\t\t// Get data contents from saved file\n\t\t\tFileInputStream fis = new FileInputStream(\"menuData\");\n ObjectInputStream ois = new ObjectInputStream(fis);\n \n mm = (ArrayList<AlacarteMenu>) ois.readObject();\n \n ois.close();\n fis.close();\n \n try {\n \tfor (int i = 0; i < mm.size(); i++) {\n \t\t\tif (mm.get(i).getMenuName().equals(menuEdit.toUpperCase())) {\n \t\t\t\tSystem.out.println(\n \t\t\t\t\t\t\"Edit Option \\n 1 : Menu Description \\n 2 : Menu Price \\n 3 : Menu Type \");\n \t\t\t\teditC = menuE.nextInt();\n\n \t\t\t\tif (editC == 1) {\n \t\t\t\t\tmenuE.nextLine();\n \t\t\t\t\tSystem.out.println(\"Change in Menu Description : \");\n \t\t\t\t\ttoChange = menuE.nextLine();\n \t\t\t\t\tmm.get(i).setMenuDesc(toChange);\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t\telse if (editC == 2) {\n \t\t\t\t\tSystem.out.println(\"Change in Menu Price : \");\n \t\t\t\t\tchangePrice = menuE.nextDouble();\n \t\t\t\t\tmm.get(i).setMenuPrice(changePrice);\n \t\t\t\t\tbreak;\n \t\t\t\t} \n \t\t\t\telse if (editC == 3) {\n \t\t\t\t\tSystem.out.println(\"Change in Menu Type : \\n1 : Appetizers \\n2 : Main \\n3 : Sides \\n4 : Drinks\");\n \t\t\t\t\tchangePrice = menuE.nextDouble();\n \t\t\t\t\tif (changePrice == 1) {\n \t\t\t\t\t\tmm.get(i).setMenuType(\"Appetizers\");\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t\telse if (changePrice == 2) {\n \t\t\t\t\t\tmm.get(i).setMenuType(\"Main\");\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t\telse if (changePrice == 3) {\n \t\t\t\t\t\tmm.get(i).setMenuType(\"Sides\");\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t} \n \t\t\t\t\telse if (changePrice == 4) {\n \t\t\t\t\t\tmm.get(i).setMenuType(\"Drinks\");\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\n \tFileOutputStream fos = new FileOutputStream(\"menuData\");\n\t\t\t\tObjectOutputStream oos = new ObjectOutputStream(fos);\n\t\t\t\toos.writeObject(mm);\n\t\t\t\toos.close();\n\t\t\t\tfos.close();\n }\n catch (IOException e) {\n \t\t\tSystem.out.println(\"Error editing menu item!\");\n \t\t\treturn;\n \t\t}\n ois.close();\n fis.close();\n\t\t} \n\t\tcatch (IOException e) {\n\t\t\t//System.out.println(\"No menu items found!\");\n\t\t\tSystem.out.format(\"+------------+---------------------------------------+-------+--------------+%n\");\n\t\t\tSystem.out.format(\"| Menu ID | Description | Price | Type |%n\");\n\t\t\tSystem.out.format(\"+------------+---------------------------------------+-------+--------------+%n\");\n\t\t\treturn;\n\t\t}\n\t\tcatch (ClassNotFoundException c) {\n\t\t\tc.printStackTrace();\n\t\t\treturn;\n\t\t}\n\t}", "public String read(String user, String action) throws FileNotFoundException, IOException {\r\n\t\tString filename = user + \".txt\";\r\n \tString absoluteFilePath = \"\";\r\n\t\tString workingDirectory = System.getProperty(\"user.dir\");\r\n\t\tArrayList<String> create = new ArrayList<String>();\r\n\t\tArrayList<String> logged = new ArrayList<String>();\r\n\t\tArrayList<String> updated = new ArrayList<String>();\r\n\t\tArrayList<String> removed = new ArrayList<String>();\r\n\t\t\r\n\t\t\r\n\t\t//absoluteFilePath = workingDirectory + System.getProperty(\"file.separator\") + filename;\r\n\t\tabsoluteFilePath = workingDirectory + File.separator + filename;\r\n\t\ttry(BufferedReader br = new BufferedReader(new FileReader(absoluteFilePath))) {\r\n\t\t StringBuilder sb = new StringBuilder();\r\n\t\t String line = br.readLine();\r\n\t\t \r\n\t\t while (line != null) {\r\n\t\t \t\r\n\t\t \t\r\n\t\t \tString arr[] = line.split(\" \");\r\n\t\t \tString firstWord = arr[0];\r\n\t\t \tif(firstWord.equals(\"'Created\"))\r\n\t\t {\r\n\t\t \t\r\n\t\t \tcreate.add(line);\r\n\t\t \t\r\n\t\t }\r\n\t\t \t\r\n\t\t \telse if(firstWord.equals(\"'Logged\"))\r\n\t\t {\r\n\t\t \t\r\n\t\t \tlogged.add(line);\r\n\t\t \t\r\n\t\t }\r\n\t\t \t\r\n\t\t \telse if(firstWord.equals(\"'Updated\"))\r\n\t\t {\r\n\t\t \t\r\n\t\t \tupdated.add(line);\r\n\t\t \t\r\n\t\t }\r\n\t\t \t\r\n\t\t \telse if(firstWord.equals(\"'Removed\"))\r\n\t\t {\r\n\t\t \t\r\n\t\t \tremoved.add(line);\r\n\t\t \t\r\n\t\t }\r\n\t\t \t\r\n\t\t \r\n\t\t line = br.readLine();\r\n \r\n\t\t }\r\n\t\t \r\n\t\t \r\n\t\t if(action==\"logged\")\r\n\t\t {\r\n\t\t for(String d : logged)\r\n\t\t {\r\n\t\t \tsb.append(\"<p style='font-size: 80%'>\");\r\n\t\t\t sb.append(d);\r\n\t\t\t sb.append(\"</p>\");\r\n\t\t }\r\n\t\t }\r\n\t\t \r\n\t\t \r\n\t\t else if(action==\"create\")\r\n\t {\r\n\t\t for(String d : create)\r\n\t\t {\r\n\t\t \tsb.append(\"<p style='font-size: 80%'>\");\r\n\t\t\t sb.append(d);\r\n\t\t\t sb.append(\"</p>\");\r\n\t\t \t\r\n\t\t }\r\n\t } \r\n\t\t \r\n\t\r\n\t\t else if(action==\"update\")\r\n\t {\r\n\t\t for(String d : updated)\r\n\t\t {\r\n\t\t \tsb.append(\"<p style='font-size: 80%'>\");\r\n\t\t\t sb.append(d);\r\n\t\t\t sb.append(\"</p>\");\r\n\t\r\n\t\t }\r\n\t }\r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t else if(action==\"remove\") \r\n\t\t {\r\n\t\t for(String d : removed)\r\n\t\t {\r\n\t\t \tsb.append(\"<p style='font-size: 80%'>\");\r\n\t\t\t sb.append(d);\r\n\t\t\t sb.append(\"</p>\");\r\n\t\r\n\t\t }\r\n\t\t }\r\n\t\t \r\n\t\t \r\n\t\t String everything = sb.toString();\r\n\t\t return everything;\r\n\t\t} \r\n\t}", "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}", "@Override\r\n\tpublic void update(List<Student> list, Scanner sc) {\n\t\tSystem.out.println(\"请输入需要修改学生的名字,进行其年龄的修改\");\r\n\t\tString name=sc.next();\r\n\t\tSystem.out.println(\"请输入需要改定的年龄:\");\r\n\t\tint age=sc.nextInt();\r\n\t\tfor(Student i:list){\r\n\t\t\tif(name.equals(i.getName())){\r\n\t\t\t\ti.setAge(age);\r\n\t\t\t\tSystem.out.println(\"修改完成!\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public void edit_contact_list(String old_contact, String new_contact)\n {\n String[] current_data = read();\n try\n {\n dir = new File(contextRef.getFilesDir(), filename);\n PrintWriter writer = new PrintWriter(dir);\n\n for (int i = 0; i < current_data.length; i++)\n {\n String line = current_data[i];\n if (line != null && !line.contains(old_contact))\n {\n writer.println(line);\n }\n }\n writer.println(new_contact);\n writer.close();\n }catch (Exception ex)\n {\n //debug2(\"write_contact_list failure\");\n }\n }", "public void editStudentList(int stuNumber){\n for(int i = 0; i<studList.size();i++){\n if(stuNumber == studList.get(i).getStuNumber()){\n \n System.out.println(\"Student Name: \" + studList.get(i).getFullName() + \", Student Number: \" + \n studList.get(i).getStuNumber() + \", Student GPA: \" + studList.get(i).getGPA());\n\n Scanner input = new Scanner(System.in);\n String newName = \"\";\n double newGPA;\n\n System.out.print(\"Student name: \");\n newName = input.nextLine();\n\n System.out.print(\"Student GPA: \");\n newGPA = input.nextDouble();\n\n Student temp = new Student(newName, studList.get(i).getStuNumber(), newGPA);\n studList.set(i, temp);\n }\n }\n }", "private ArrayList<Person> parsePersons(int i) {\n\t\trestart();\n\t\tString nxtLine;\n\t\tint nbrOfP; \n\t\tArrayList<Person> persons = new ArrayList<Person>();\n\t\twhile(s.hasNextLine()) {\n\t\t\tnxtLine = s.nextLine();\n\t\t\tif(nxtLine.contains(\"=\")){\n//\t\t\t\tSystem.out.println(\"found it\");\n\t\t\t\tnbrOfP = Integer.parseInt(nxtLine.substring(2));\n//\t\t\t\tSystem.out.println(\"\"+nbrOfP);\n\t\t\t\tif(i==0)\n\t\t\t\t\tpersons = createMenList(nbrOfP);\n\t\t\t\telse\n\t\t\t\t\tpersons = createWomenList(nbrOfP);\n\t\t\t}\n\t\t}\n\t\treturn persons;\n\t}", "public void editarHospede() {\n int i;\n if (hospedesCadastrados.isEmpty()) {\n System.err.println(\"Nao existe hospedes cadastrados\\n\");\n } else {\n listarHospedes();\n int cpf = verifica();\n for (i = 0; i < hospedesCadastrados.size(); i++) {\n if (hospedesCadastrados.get(i).getCpf() == cpf) {//hospede\n System.err.println(\"O que deseja editar:\\n Nome(1)\\n\"\n + \"Cpf(2)\\nE-MAIL(3)\");\n int a = verifica();\n switch (a) {\n case 1:\n System.err.println(\"Digite o novo nome do hospede:\\n\");\n String nome = ler.next();\n hospedesCadastrados.get(i).setNome(nome);\n System.err.println(\"Atualzacao concluida!\\n\");\n break;\n case 2:\n System.err.println(\"Digite o novo CPF do hospede:\\n\");\n int cpf1 = verifica();\n hospedesCadastrados.get(i).setCpf(cpf1);\n System.err.println(\"Atualzacao concluida!\\n\");\n break;\n case 3:\n System.err.println(\"Digite o novo E-MAIL do hospede:\\n\");\n String email = ler.next();\n hospedesCadastrados.get(i).setEmail(email);\n System.err.println(\"Atualzacao concluida!\\n\");\n break;\n }\n\n } else if (hospedesCadastrados.size() == i) {\n System.err.println(\"Nao existem hospedes com esse cpf cadastrados!\\n\");\n }\n }\n }\n }", "public void editProfile() {\n\n\t\tAccount account = getInputOfUsersAccount();\n\t\tSystem.out.println(account.getUser().toString());\n\n\t\taccount = userBo.handleProfileOption(account);\n\n\t\tif (userDAO.editProfile(account))\n\t\t\tSystem.out.println(\"User edited!\");\n\n\t\telse\n\t\t\tSystem.out.println(\"Something went wrong!\");\n\n\t\tAdminMenu.getAdminMenu();\n\t}", "public static void finaliseEdit() throws IOException {\r\n //Creating scanner object and reading the file\r\n Scanner s = new Scanner(new File(\"output.txt\"));\r\n Scanner sc2 = new Scanner(System.in);\r\n //Empty string to append the lines of the file to\r\n String lines = \"\";\r\n //While loop to append lines of file to empty string\r\n while (s.hasNext()) {\r\n lines += s.nextLine();\r\n }\r\n //Creating array by splitting the string by \"#\" which will be written in when a project is added\r\n String[] lineArr = lines.split(\"#\");\r\n //Creating arraylist and appending lines from array with while loop\r\n List<String> inLines = Arrays.asList(lineArr);\r\n while (s.hasNextLine()) {\r\n inLines.add(s.nextLine());\r\n }\r\n s.close();\r\n //For loop to split array by \", \"\r\n for (int i = 0; i < lineArr.length; i++) {\r\n String[] projectInfo = lineArr[i].split(\", \");\r\n //Prompting the user to enter a number to select a project to finalise\r\n System.out.println(\"Enter index number of task to finalise: \\ne - Exit\");\r\n int proSelect = sc2.nextInt();\r\n //Opening the file and creating a bufferedwriter object\r\n FileWriter writer = new FileWriter(\"output.txt\",false);\r\n BufferedWriter buffer = new BufferedWriter(writer);\r\n //The project gets selected by the user entering a number to select. That number will be subtracted by 1 to get the correct index of the selected project\r\n String selectedProj = inLines.get(proSelect - 1);\r\n //Creating array by splitting the string\r\n String[] selectedProjarr = selectedProj.split(\", \");\r\n //Changing the value of the index\r\n selectedProjarr[21] = \"finalised\";\r\n //Creating a string from the edited array\r\n String projLinestr = Arrays.toString(selectedProjarr);\r\n //Replacing the selected project in the arraylist with the string of the edited project\r\n inLines.set(proSelect - 1 , projLinestr);\r\n //For loop to write the arraylist to file. I got this method from https://stackoverflow.com/questions/6548157/how-to-write-an-arraylist-of-strings-into-a-text-file/6548204\r\n for(String str:inLines) {\r\n buffer.write((str + \"#\\n\"));\r\n }\r\n buffer.close();\r\n //Reading integers from file to calculate amount to be paid\r\n String feeStr = selectedProjarr[5];\r\n int feeINT = Integer.valueOf(feeStr);\r\n String ptdStr = selectedProjarr[6];\r\n int ptdInt = Integer.valueOf(ptdStr);\r\n int tobePaid = feeINT - ptdInt;\r\n //If there still is money to be payed when a project gets finalised, an invoice will be created, if all fees are paid, no invoive will be made\r\n if (tobePaid != 0) {\r\n //Opening the file and creating buffered writer to write to the file\r\n FileWriter writer2 = new FileWriter(\"invoice.txt\");\r\n BufferedWriter buffer2 = new BufferedWriter(writer2);\r\n //Writing to the file\r\n buffer2.write(\"Customer name: \" + selectedProjarr[12] + \" \" + selectedProjarr[13] + \"\\n\");\r\n buffer2.write(\"Customer tel number: \" + selectedProjarr[14] + \"\\n\");\r\n buffer2.write(\"Customer email: \" + selectedProjarr[15] + \"\\n\");\r\n buffer2.write(\"Customer address: \" + selectedProjarr[16] + \"\\n\");\r\n buffer2.write(\"Amount to be paid: \" + \"R\" + tobePaid);\r\n buffer2.close();\r\n System.out.println(\"Project has been finalised and invoice was created.\");\r\n }\r\n else\r\n {\r\n System.out.println(\"Total amount has been paid, invoice was not created.\\nProject was finalised.\");\r\n }\r\n //Opening file and creating buffered writer object to write to the completed projects file\r\n FileWriter writer3 = new FileWriter(\"completedProject.txt\");\r\n BufferedWriter buffer3 = new BufferedWriter(writer3);\r\n //Writing the project info to the file\r\n buffer3.write(\"Project name: \" + selectedProjarr[0] + \"\\n\");\r\n buffer3.write(\"Project number: \" + selectedProjarr[1] + \"\\n\");\r\n buffer3.write(\"Building type: \" + selectedProjarr[2] + \"\\n\");\r\n buffer3.write(\"Address: \" + selectedProjarr[3] + \"\\n\");\r\n buffer3.write(\"ERF Number: \" + selectedProjarr[4] + \"\\n\");\r\n buffer3.write(\"Fee: \" + \"R\" + selectedProjarr[5] + \"\\n\");\r\n buffer3.write(\"Amount paid to date: \" + \"R\" + selectedProjarr[6] + \"\\n\");\r\n buffer3.write(\"Due date: \" + selectedProjarr[7] + \"\\n\");\r\n //Creating date format to get the current date\r\n DateTimeFormatter dtf = DateTimeFormatter.ofPattern(\"dd/MM/yyyy\");\r\n LocalDateTime now = LocalDateTime.now();\r\n buffer3.write(\"Date completed: \" + dtf.format(now) + \"\\n\");\r\n //Writing Contractor information\r\n buffer3.write(\"Contractor name: \" + selectedProjarr[8] + \"\\n\");\r\n buffer3.write(\"Contractor tel number: \" + selectedProjarr[9] + \"\\n\");\r\n buffer3.write(\"Contractor email: \" + selectedProjarr[10] + \"\\n\");\r\n buffer3.write(\"Contractor address: \" + selectedProjarr[11] + \"\\n\");\r\n //Writing Customer information\r\n buffer3.write(\"Customer name: \" + selectedProjarr[12] + \" \" + selectedProjarr[13] + \"\\n\");\r\n buffer3.write(\"Customer tel number: \" + selectedProjarr[14] + \"\\n\");\r\n buffer3.write(\"Customer email: \" + selectedProjarr[15] + \"\\n\");\r\n buffer3.write(\"Customer address: \" + selectedProjarr[16] + \"\\n\");\r\n //Writing Architect information\r\n buffer3.write(\"Architect name: \" + selectedProjarr[17] + \"\\n\");\r\n buffer3.write(\"Architect tel numbert: \" + selectedProjarr[18] + \"\\n\");\r\n buffer3.write(\"Architect email: \" + selectedProjarr[19] + \"\\n\");\r\n buffer3.write(\"Architect address: \" + selectedProjarr[20] + \"\\n\");\r\n buffer3.close();\r\n break;\r\n }\r\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 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 readListFromFile() {\n // clear existing list\n if (listArr == null || listArr.size() > 0) {\n listArr = new ArrayList<>();\n }\n\n try {\n Scanner scan = new Scanner(openFileInput(LIST_FILENAME));\n\n while (scan.hasNextLine()) {\n String line = scan.nextLine();\n listArr.add(line);\n }\n\n if (listAdapter != null) {\n listAdapter.notifyDataSetChanged();\n }\n\n } catch (IOException ioe) {\n Log.e(\"ReadListFromFile\", ioe.toString());\n }\n\n }", "private ArrayList<Person> getScores() {\n ArrayList<Person> persons = new ArrayList<>(); \n\n try {\n \t//The file is selected and then a reader is created to read the file\n File myObj = new File(\"highscores.txt\");\n Scanner myReader = new Scanner(myObj);\n\n //This constraint checks for a next available line and adds the variable data to this line. Data contains the name and score of the person. \n //The splitter is used to separate the name and score of the person, which is then added to the person Array. Then the reader is closed.\n while (myReader.hasNextLine()) {\n String data = myReader.nextLine();\n int splitterIndex = data.indexOf(\"-\");\n persons.add(new Person(data.substring(0, splitterIndex), parseInt((data.substring(splitterIndex + 1)))));\n }\n myReader.close();\n } catch (FileNotFoundException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n return persons;\n }", "public void loadEmployees(String fileName)\r\n\t{\r\n\t\t//try block to attempt to open the file\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//declare local variables for the file name and data fields within the employeelist text file\r\n\t\t\t//these will all be Strings when pulled from the file, and then converted to the proper data type when they are assigned to the Employee objects\r\n\t\t\tString empID = \"\";\r\n\t\t\tString empLastName = \"\";\r\n\t\t\tString empFirstName = \"\";\r\n\t\t\tString empType = \"\";\t\r\n\t\t\tString empSalary = \"\"; //will convert to double\r\n\t\t\t\r\n\t\t\t//scan for file\r\n\t\t\tScanner infile = new Scanner(new FileInputStream(fileName));\r\n\t\t\t\r\n\t\t\t//while loop searching file records\r\n\t\t\twhile(infile.hasNext())\r\n\t\t\t{\r\n\t\t\t\t//split the field into segments with the comma (,) being the delimiter (employee ID, Last Name, First Name, employee type, and employee salary)\r\n\t\t\t\tString line = infile.nextLine();\r\n\t\t\t\tString[] fields = line.split(\",\");\r\n\t\t\t\tempID = fields[0];\r\n\t\t\t\tempLastName = fields[1];\r\n\t\t\t\tempFirstName = fields[2];\r\n\t\t\t\tempType = fields[3];\r\n\t\t\t\tempSalary = fields[4];\r\n\t\t\t\t\r\n\t\t\t\t//create a selection structure that creates the type of employee based on the empType\r\n\t\t\t\tif(empType.equalsIgnoreCase(\"H\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t//create an HourlyEmployee and convert empSalary to a double\r\n\t\t\t\t\tHourlyEmployee hourlyEmp = new HourlyEmployee(empID, empLastName, empFirstName, Double.parseDouble(empSalary));\r\n\t\t\t\t\t\r\n\t\t\t\t\t//add hourlyEmp to the Employee ArrayList empList\r\n\t\t\t\t\tempList.add(hourlyEmp);\r\n\t\t\t\t}//end create hourly employee\r\n\t\t\t\t\r\n\t\t\t\t//else if create an exempt employee for E\r\n\t\t\t\telse if(empType.equalsIgnoreCase(\"E\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t//create an exempt employee (salary) and convert the empSalary to a double\r\n\t\t\t\t\tExemptEmployee salaryEmp = new ExemptEmployee(empID, empLastName, empFirstName, Double.parseDouble(empSalary));\r\n\t\t\t\t\t\r\n\t\t\t\t\t//add salaryEmp to the Employee ArrayList empList\r\n\t\t\t\t\tempList.add(salaryEmp);\r\n\t\t\t\t}//end create exempt (salary) employee\r\n\t\t\t\t\r\n\t\t\t\t//else if create a contractor \r\n\t\t\t\telse if(empType.equalsIgnoreCase(\"C\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t//create a contract employee and convert the empSalary to a double\r\n\t\t\t\t\tContractEmployee contractEmp = new ContractEmployee(empID, empLastName, empFirstName, Double.parseDouble(empSalary));\r\n\t\t\t\t\t\r\n\t\t\t\t\t//add contractEmp to the Employee ArrayList empList\r\n\t\t\t\t\tempList.add(contractEmp);\r\n\t\t\t\t}//end create contractor employee\r\n\t\t\t\t\r\n\t\t\t\t//else if create a day laborer\r\n\t\t\t\telse if(empType.equalsIgnoreCase(\"d\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t//create a day laborer and convert the empSalary to a double\r\n\t\t\t\t\tDayLaborer laborer = new DayLaborer(empID, empLastName, empFirstName, Double.parseDouble(empSalary));\r\n\t\t\t\t\t\r\n\t\t\t\t\t//add laborer to the Employee ArrayList empList\r\n\t\t\t\t\tempList.add(laborer);\r\n\t\t\t\t}//end create day laborer employee\r\n\t\t\t\t\r\n\t\t\t\t//else ignore the employee (looking at you Greyworm!)\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t//save the employee type and id to return as an error\r\n\t\t\t\t\tempTypeError = empType;\r\n\t\t\t\t\tempIDError = empID;\r\n\t\t\t\t\t\r\n\t\t\t\t\t//ignore the employee \r\n\t\t\t\t\tempType = null;\r\n\t\t\t\t}//end ignore X employee\r\n\t\t\t}//end while loop cycling the records in the employeelist\r\n\t\t\t\r\n\t\t\t//close infile when done\r\n\t\t\tinfile.close();\r\n\t\t}//end of try block opening employeelist.txt file\r\n\t\t\r\n\t\t//catch block if file not found\r\n\t\tcatch(IOException ex)\r\n\t\t{\r\n\t\t\t//call ex object and display message\r\n\t\t\tex.printStackTrace();\r\n\t\t}//end of catch for file not found\r\n\t}", "private void setUserAccount() throws FileNotFoundException\r\n\t{\r\n\t\tint index = 0;\r\n\t\tFile inputFile = new File(\"UserAccount.txt\");\r\n\t\tScanner input = new Scanner(inputFile);\r\n\t\tif (!inputFile.exists())\r\n\t\t{\r\n\t\t\tSystem.out.println(\"The text file \\\"UserAccount.txt\\\" is missing\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t\twhile(input.hasNextLine())\r\n\t\t{\r\n\t\t\tuserAccounts[0][index] = input.nextLine();\t\t\t//stores the username\r\n\t\t\tuserAccounts[1][index] = input.nextLine();\t\t\t//stores the password\r\n\t\t\tnumOfUsers++;\r\n\t\t\tindex++;\r\n\t\t}\r\n\t}", "@Override\r\n public void add() {\n String ID =id.getText();\r\n String Name =name.getText();\r\n String form_date =date_start.getText();\r\n String to_date =date_finish.getText();\r\n String Status =status.getText();\r\n String MemberID = MemberId.getText();\r\n ArrayList<String> arr = new ArrayList<String>();\r\n arr.add(ID);\r\n arr.add(Name);\r\n arr.add(form_date);\r\n arr.add(to_date);\r\n arr.add(Status);\r\n arr.add(MemberID);\r\n String PathFile = \"/home/yara/Documents/4year/OODP/Task.txt\";\r\n FileFacade facade = new FileFacade();\r\n facade.Add(PathFile, arr);\r\n }", "public void editUser()\r\n\t{\r\n\t\tsc.nextLine();\r\n\t\tint index=loginattempt();\r\n\t\tif(index==-1)\r\n\t\t{\r\n\t\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tString password=\"\",repassword=\"\";\r\n\t\t\tboolean flag=false;\r\n\t\t\twhile(!flag)\r\n\t\t\t{\r\n\t\t\t\tboolean validpassword=false;\r\n\t\t\t\twhile(!validpassword)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.print(\"Please enter your new password: \");\r\n\t\t\t\t\tpassword=sc.nextLine();\r\n\t\t\t\t\tvalidpassword=a.validitycheck(password);\r\n\t\t\t\t\tif(!validpassword)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"Your password has to fulfil: at least 1 small letter, 1 capital letter, 1 digit!\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.print(\"Please re-enter your new password: \");\r\n\t\t\t\trepassword=sc.nextLine();\r\n\t\t\t\tflag=a.matchingpasswords(password,repassword);\r\n\t\t\t\tif(!flag)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.print(\"Password not match! \");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tString hash_password=hashfunction(password); \r\n\t\t\tSystem.out.print(\"Please enter your new full name: \");\r\n\t\t\tString fullname=sc.nextLine();\r\n\t\t\tSystem.out.print(\"Please enter your new email address: \");\r\n\t\t\tString email=sc.nextLine();\r\n\t\t\t((User)user_records.get(index)).set_hash_password(hash_password);\r\n\t\t\t((User)user_records.get(index)).set_fullname(fullname);\r\n\t\t\t((User)user_records.get(index)).set_email(email);\r\n\t\t\tSystem.out.println(\"Record update successfully!\");\r\n\t\t}\r\n\t}", "private void jButtonCreateInsexActionPerformed(java.awt.event.ActionEvent evt) {\n try {\n lstPerson = new ArrayList();\n Properties prop = new Properties();//почти тоже самое что ini файлы\n content = Files.readAllLines(Paths.get(PATH_FILE_SOURCE), Charset.forName(\"cp1251\"));\n String s = content.get(0);\n for (int i = 0, j = 1; i < s.length(); i += 128, j++) {\n Person p = new Person(\n s.substring(i, i + 30).trim(),\n s.substring(i + 30, i + 50).trim(),\n s.substring(i + 50, i + 70).trim(),\n s.substring(i + 70, i + 78).trim(),\n s.substring(i + 78).trim(), j);\n lstPerson.add(p);\n }\n\n for (Person person : lstPerson) {\n prop.put(person.getSurname().toUpperCase(), Integer.toString(person.getID()));\n }\n prop.storeToXML(new FileOutputStream(FILE_PATH_INDEX_SURNAME), \"LIB\");//можно и без xml\n jLabelStatusBar.setForeground(Color.magenta);\n jLabelStatusBar.setText(\"Индексный файл создан!\");\n jLabelStatusBar.setForeground(Color.BLACK);\n\n } catch (IOException ex) {\n jLabelStatusBar.setForeground(Color.red);\n jLabelStatusBar.setText(\"Индексный файл не создан!\");\n Logger.getLogger(NewJFrame1.class.getName()).log(Level.SEVERE, null, ex);\n }\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}", "@Override\r\n\tpublic void edit() {\n\t\t\r\n\t}", "public void saveProfileEditData() {\r\n\r\n }", "private void saveEmployee()\n {\n Employee tempEmployee = new Employee();\n String line = \"\";\n try\n {\n PrintWriter out = new PrintWriter(fileName);\n for(int i = 0; i < employees.size(); i++)\n {\n tempEmployee = (Employee) employees.get(i);\n line = tempEmployee.getName() + \",\" + tempEmployee.getHours() + \",\" +\n tempEmployee.getRate();\n out.println(line);\n }\n out.close(); \n }\n catch(IOException ex)\n {\n ex.printStackTrace();\n }\n }", "public static void ReplacesEntry(int index){\n int cont = 0;\n String[] thingstowrite = ManageCommissionerList.ReturnsCommissionerListInString(index);\n try{\n Path path = Paths.get(\"logscommission.txt\");\n List<String> lines = Files.readAllLines(path, StandardCharsets.UTF_8);\n for(int i = index*19;i<(index*19)+19;i++){\n lines.set(i, thingstowrite[cont]);\n cont++;\n }\n Files.write(path, lines, StandardCharsets.UTF_8);\n }catch(Exception e){\n e.printStackTrace();\n System.out.printf(\"Not possible to replace entry!\\n\");\n }\n }", "void readFromFile(String file)\n {\n try\n {\n employees.clear();\n FileReader inputFile = new FileReader(fileName);\n BufferedReader input = new BufferedReader(inputFile);\n String line = input.readLine();\n \n while(line != null)\n {\n Employee worker = new Employee();\n StringTokenizer stringParser = new StringTokenizer(line, \",\");\n while(stringParser.hasMoreElements())\n {\n worker.setName(stringParser.nextElement().toString());\n worker.setHours(Integer.parseInt(stringParser.nextElement().toString()));\n worker.setRate(Float.parseFloat(stringParser.nextElement().toString()));\n }\n employees.add(worker);\n line = input.readLine();\n }\n inputFile.close();\n }\n catch(FileNotFoundException e)\n {\n e.getStackTrace();\n }\n catch(IOException e)\n {\n e.getStackTrace();\n }\n }", "void changeFile()\n {\n App app = new App();\n // Loop through the read File\n for (String s : readFile) {\n if (app.containsUtilize(s)) {\n // Changes the first use of utilize with use\n String newTemp = s.replaceFirst(\"utilize\", \"use\");\n // Writes to file\n this.writeFile.add(newTemp);\n } else {\n // not utilize\n this.writeFile.add(s);\n }\n }\n }", "void appendUserInformation(String line);", "private void processLine(String line1) {\n StringTokenizer tVal = new StringTokenizer(line1);\n int yearOf = Integer.parseInt((tVal.nextToken()));\n List chosenYear = yearOf == 2014 ? employeeSalary_2014:\n employeeSalary_2015;\n String employeeTypeE = tVal.nextToken();\n String employeeName = tVal.nextToken();\n Integer employeeMonthlySalary =\n Integer.parseInt(tVal.nextToken());\n Employee newEmployee = null;\n if (employeeTypeE.equals(\"Salesman\")) {\n Integer salesmanCommission=\n Integer.parseInt(tVal.nextToken());\n\n newEmployee = new Salesman(employeeName, employeeMonthlySalary, salesmanCommission);\n\n }\n else if (employeeTypeE.equals(\"Executive\")) {\n Integer stockPrice= Integer.parseInt(tVal.nextToken());\n newEmployee = new Executive(employeeName, employeeMonthlySalary, stockPrice);\n }\n else {\n newEmployee = new Employee(employeeName, employeeMonthlySalary);\n }\n chosenYear.add(newEmployee);\n }", "public void data() {\n\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(\"/Users/macbook_user/Desktop/OOP Project/List.txt\"));\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n return;\n }\n\n String[] columnName\n = {\"Id\", \"Name\", \"Amount\", \"Shelf#\", \"Position\"};\n int i, index;\n String line;\n try {\n br.readLine();\n while ((line = br.readLine()) != null) {\n index = 0;\n String[] se = line.split(\" \");\n Map<String, Object> item = new HashMap<>();\n for (i = 0; i < se.length; i++) {\n if (\"\".equals(se[i])) {\n continue;\n }\n if (index >= columnName.length) {\n continue;\n }\n item.put(columnName[index], se[i]);\n index++;\n }\n\n //get the amount of the item from the list\n int amount = Integer.parseInt((String) item\n .get(columnName[2]));\n\n // if amount greater than 0, Existence is Y, else N\n if (amount > 0) {\n item.put(\"Existence\", \"Y\");\n } else {\n item.put(\"Existence\", \"N\");\n }\n\n inventory.add(item);// add item to ArrayList\n }\n br.close();\n\n outPutFile();\n } catch (IOException e) {\n }\n\n }", "public void readFile(File inputFile) throws FileNotFoundException, IOException, ClassNotFoundException {\n\n ArrayList<Student> studentList = null;\n int noOfStudents = 1; int noOfProjects = 0;\n int count = 1;\n String title; String school; String supervisor; Project project = null; \n ArrayList<Project> projectList = new ArrayList<>();\n\n Scanner scan = new Scanner(new FileReader(inputFile));\n String line = null;\n\n while (scan.hasNextLine()) {\n studentList = new ArrayList<>();\n \n if (count == 1) {\n line = scan.nextLine();\n noOfProjects = Integer.parseInt(line);\n System.out.println(line);\n }\n\n line = scan.nextLine();\n String[] projectInfo = line.split(\",\", 5);\n noOfStudents = Integer.parseInt(projectInfo[3]);\n String[] studentInfo = projectInfo[4].split(\",\");\n\n Student student = null;\n \n for (int k = 0; k < studentInfo.length; k+=4) {\n //new Student(AdminNo, Name, Course, Gender)\n student = new Student(studentInfo[k], studentInfo[k+1], studentInfo[k+2], studentInfo[k+3]);\n studentList.add(student); //Add new Student to List\n }\n\n title = projectInfo[0];\n school = projectInfo[1];\n supervisor = projectInfo[2];\n project = new Project(title, school, supervisor, noOfStudents, studentList);\n \n System.out.println(line);\n count++;\n \n projectList.add(project);\n }\n\n for (Student stud: studentList) {\n System.out.println(stud.getAdminNo() + stud.getCourse() + stud.getGender() + stud.getName());\n }\n \n writeToFile(project);\n \n scan.close();\n }", "public static List readFromACsv(String addressbookname){\n final String COMMA_DELIMITER = \",\";\n String PATH=\"C:/Users/Sukrutha Manjunath/IdeaProjects/Parctice+\" + addressbookname;\n List<Person> personList=new ArrayList<Person>();\n BufferedReader br =null;\n try{\n br=new BufferedReader(new FileReader(PATH));\n String line = \"\";\n br.readLine();\n while ((line = br.readLine()) != null)\n {\n String[] personDetails = line.split(COMMA_DELIMITER);\n\n if(personDetails.length > 0 )\n {\n //Save the employee details in Employee object\n Person person = new Person(personDetails[0],personDetails[1],personDetails[2],\n personDetails[3],personDetails[4], personDetails[5],personDetails[6]);\n personList.add(person);\n }\n }\n\n }catch (Exception ex){\n ex.printStackTrace();\n }\n finally {\n try{\n br.close();\n }\n catch (IOException e){\n e.printStackTrace();\n }\n }\n return personList;\n }", "public void editarArtista() {\n\t\tArrayList<String> listString = new ArrayList<>();\r\n\t\tArrayList<ArtistaMdl> listArtista = new ArrayList<>();\r\n\t\tString[] possibilities = pAController.getArtista();\r\n\t\tfor (String s : possibilities) {\r\n\t\t\tString text = s.replaceAll(\".*:\", \"\");\r\n\t\t\tlistString.add(text);\r\n\t\t\tif (s.contains(\"---\")) {\r\n\t\t\t\tArtistaMdl artista = new ArtistaMdl();\r\n\t\t\t\tartista.setNome(listString.get(1));\r\n\t\t\t\tlistArtista.add(artista);\r\n\t\t\t\tlistString.clear();\r\n\t\t\t}\r\n\t\t}\r\n\t\tString[] possibilities2 = new String[listArtista.size()];\r\n\t\tfor (int i = 0; i < listArtista.size(); i++) {\r\n\t\t\tpossibilities2[i] = listArtista.get(i).getNome();\r\n\t\t}\r\n\t}", "private void enterStudentPersonalities() throws IOException {\n boolean foundStudent = false, validPersonality = false;\n String studID;\n char studPersonality = 0;\n\n do {\n System.out.println(\"\\nEnter assigned student ID:\");\n studID = Global.scan.nextLine();\n\n for (Student stud: Student.allStudents) {\n if (stud.getId().compareTo(studID) == 0) {\n foundStudent = true;\n System.out.println(\"\\nPlease enter personality of \" + studID + \" :\");\n studPersonality = Global.scan.nextLine().toUpperCase().charAt(0);\n char[] validPersonalities = {'A', 'B', 'C', 'D', 'E', 'F'};\n for (int i = 0; i < 6; i++) {\n if (studPersonality == validPersonalities[i]) {\n validPersonality = true;\n stud.setStudentPersonality(studPersonality);\n System.out.println(stud.getStudentPersonality());\n }\n }\n if (!validPersonality) {\n System.out.println(\"Invalid personality type!\");\n }\n }\n }\n if (!foundStudent) {\n System.out.println(\"Student not found!\");\n }\n } while (foundStudent == false || studID.isEmpty() || studPersonality == '0');\n FileReadWrite.saveStudentDetails(Main.studentsFileName, Student.allStudents);\n }", "public List<Event> fillArrayList()\r\n {\r\n List<Event> list1=new ArrayList<>();\r\n FileReader fr=null;\r\n \r\n try{\r\n \r\n fr=new FileReader(\"./event.txt\");\r\n BufferedReader bf=new BufferedReader(fr);\r\n String s;\r\n \r\n while((s=bf.readLine())!=null)\r\n {\r\n Event event=new Event();\r\n String s1[]=new String[7];\r\n for(int i=0;i<s1.length;i++)\r\n {\r\n s1=s.split(\",\");\r\n \r\n event.setId(Integer.parseInt(s1[0]));\r\n \r\n event.setName(s1[1]);\r\n \r\n event.setOrganizer(s1[2]);\r\n \r\n Date date=Date.valueOf(s1[3]);\r\n \r\n event.setDate(date);\r\n \r\n event.setFees(Double.parseDouble(s1[4]));\r\n \r\n } \r\n list1.add(event);\r\n }\r\n \r\n bf.close();\r\n \r\n }catch(Exception e){e.printStackTrace();}\r\n return list1;\r\n\r\n }", "private void update(){\n\t\tIterator it = lList.iterator();\r\n\t\tString out=\"\"; // it used for collecting all members\r\n\t\tint count = 0;\r\n\t\twhile (it.hasNext()){\r\n\t\t\tObject element = it.next();\r\n\t\t\tout += \"\\nPERSON \" + count + \"\\n\";\r\n\t\t\tout += \"=============\\n\";\r\n\t\t\tout += element.toString();\r\n\t\t\t++count;\r\n\t\t}\t\t\r\n\t\toutputArea.setText(out); \r\n\t}", "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 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 static void RT() {//metodo para leer la informacion del txt , presente en todas las clases que se guardan en un txt\n\t\treadTxt(\"usuarios.txt\", usersList);\n\t}", "public void readDataFromFile() {\n System.out.println(\"Enter address book name: \");\n String addressBookFile = sc.nextLine();\n Path filePath = Paths.get(\"C:\\\\Users\\\\Muthyala Aishwarya\\\\git\" + addressBookFile + \".txt\");\n try {\n Files.lines(filePath).map(line -> line.trim()).forEach(line -> System.out.println(line));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void updatePerson() {\n\t\tSystem.out.println(\"****Update Record****\");\n\t\tSystem.out.println(\"Enter contact no.\");\n\t\tlong contactSearch = sc.nextLong();\n\t\tfor (int i = 0; i < details.length; i++) {\n\t\t\tif (details[i] != null && details[i].getPhoneNo() == contactSearch) {\n\t\t\t\tSystem.out.println(details[i].getFirstName());\n\t\t\t\tSystem.out.println(\"Please select field you need to edit\");\n\t\t\t\tSystem.out.println(\"1. Address\");\n\t\t\t\tSystem.out.println(\"2. City\");\n\t\t\t\tSystem.out.println(\"3. State\");\n\t\t\t\tSystem.out.println(\"4. Zipcode\");\n\t\t\t\tSystem.out.println(\"5. Phone Number\");\n\t\t\t\tint choiceUpdate = sc.nextInt();\n\t\t\t\tswitch (choiceUpdate) {\n\t\t\t\tcase 1:\n\t\t\t\t\tSystem.out.println(\"Enter your Address\");\n\t\t\t\t\tString addressUpdate = sc.next();\n\t\t\t\t\tdetails[i].setAddress(addressUpdate);\n\t\t\t\t\tSystem.out.println(\"Address Updated\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tSystem.out.println(\"Enter your City \");\n\t\t\t\t\tString cityUpdate = sc.next();\n\t\t\t\t\tdetails[i].setCity(cityUpdate);\n\t\t\t\t\tSystem.out.println(\"City Updated\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tSystem.out.println(\"Enter your State\");\n\t\t\t\t\tString stateUpdate = sc.next();\n\t\t\t\t\tdetails[i].setState(stateUpdate);\n\t\t\t\t\tSystem.out.println(\"State Updated\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tSystem.out.println(\"Enter Your Zipcode\");\n\t\t\t\t\tint zipcodeUpdate = sc.nextInt();\n\t\t\t\t\tdetails[i].setZip(zipcodeUpdate);\n\t\t\t\t\tSystem.out.println(\"Zipcode Updated\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tSystem.out.println(\"Enter Phone Number\");\n\t\t\t\t\tlong phoneUpdate = sc.nextLong();\n\t\t\t\t\tdetails[i].setPhoneNo(phoneUpdate);\n\t\t\t\t\tSystem.out.println(\"Phone Number Updated\");\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tSystem.out.println(\"Update Invalid choive! Enter again..\\n\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void createAccount()\r\n\t {\r\n\t\t String name;\r\n\t\t String username;\r\n\t\t String password;\r\n\t\t ArrayList<Book> booksLent = null;\r\n\t\t System.out.println(\"Enter your name\");\r\n\t\t Scanner src = new Scanner(System.in);\r\n\t\t name = src.next();\r\n\t\t System.out.println(\"Enter your username\");\r\n\t\t src = new Scanner(System.in);\r\n\t\t username = src.next();\r\n\t\t System.out.println(\"Enter your password\");\r\n\t\t src = new Scanner(System.in);\r\n\t\t password = src.next();\r\n\t\t \r\n\t\t Student stu = new Student(name, username, password, booksLent, 0);\r\n\t\t studentAccount = stu;\r\n\t\t FileReader.getStudents().add(stu);\r\n\t\t FileReader.update();\r\n\t\t Display.studentDisplay(studentAccount);\r\n\t }", "@Override\n public void search(String firstName,String lastName,String fileName){\n int Pointer;\n ArrayList<String> lineKeeper = saveText();\n /* Search into the list to find the firstname, if it founds\n * old information and then rewrite new inforamtion\n * Search and remove*/\n if(lineKeeper.contains(firstName)){\n Pointer=lineKeeper.indexOf(firstName);\n if(lineKeeper.get(Pointer+1).equals(lastName)){\n this.load(lineKeeper.get(Pointer-3),fileName);\n }\n }\n }", "public List<Student> importStudent(String filename) throws FileNotFoundException {\n List<Student> students = new ArrayList<>();\n FileReader fileReader = new FileReader(DATA_PATH + filename);\n Scanner scanner = new Scanner(fileReader);\n //skip first line\n String firstLine = scanner.nextLine();\n Log.i(\"first line: \" + firstLine);\n\n while (scanner.hasNextLine()) {\n String[] s = scanner.nextLine().split(\",\");\n String fullName = s[0];\n int yearLevel = Integer.parseInt(s[1]);\n Student student = new Student(fullName, yearLevel);\n students.add(student);\n }\n\n scanner.close();\n return students;\n }", "public int edit_type_profile(ArrayList<String> list,Connection con,int user_id)\t//parameters also require list of values\n\t{\n\t\t Iterator<String> iter = list.iterator();\n\n\t\t \n\t\t String emptyrow=\"delete e_id , executive_producer , line_producer , supervising_producer , co_producer , co_ordinating_producer , primary_associate_or_assistant_producer , secondary_associate_or_assistant_producer , other_associate_or_assistant_producer , segment_producer , event_producer , music_producer , film_director , primary_associate_film_director , secondary_associate_film_director , other_associate_film_director , casting_director , primary_associate_casting_director ,secondary_associate_casting_director ,other_associate_casting_director , music_director ,primary_associate_music_director ,secondary_associate_music_director , other_associate_music_director , dop , primary_camera_operator , secondary_camera_operator , other_camera_operator , gafer , best_boy , lighting_technician_or_grip , film_video_editor , sound_designer , dialouge_editor , foley_artist , language_translator , language_tutor , fashion_stylist , hair_makeup_stylist , illustrator , graphic_artist , production_designer , art_director , set_designer , set_dressor , set_constructor , script_writter , script_supervisor ,\\r\\n\" + \n\t\t \t\t\"\t\t finance_manager , location_manager , scout , primary_assistant_location_manager , secondary_assistant_location_manager , other_assistant_location_manager , primary_production_manager , secondary_production_manager , other_production_manager , unit_publicist , legal_counsel , system_adminstrator , event_manager , of_any_other_entity , actor , model , dancer , singer , insrumentalist , composer , music_engineer , radio_or_voice_over , dj , band , stand_up_comedian , other_type from type_of_profile where e_id=\"+user_id; \n\t\t\tPreparedStatement pst;\n\t\t\t\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tpst=con.prepareStatement(emptyrow);\n\t\t\t\t\tpst.executeUpdate();\n\t\t\t\t}\n\t\t\t\n\t\t\tcatch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace(); \n\t\t\t\t\n\t\t\t} \n\t\t String createUser =\n\t\t\t \"INSERT INTO type_of_profile (\";\n\t\t\t \n\t\t try {\n\t\t\n\t\twhile (iter.hasNext()) { \n\t\t\tcreateUser+=iter.next();\n\t\t\tif(iter.hasNext())\n\t\t\t{\n\t\t\t\tcreateUser+=\",\";\n\t\t\t}\n }\n\t\t\n\t\t\n\t\tcreateUser+=\") values (\";\n\t\t\n\t\tfor(int k=0;k<list.size();k++)\n\t\t{\n\t\t\tcreateUser+=\"?\";\n\t\t\tif(k<list.size()-1)\n\t\t\t{\n\t\t\t\tcreateUser+=\",\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tcreateUser+=\")\";\n\t\t\n\t\tPreparedStatement p = con.prepareStatement(createUser);\n\t\tint i=2;\n\t\t\n\t\tp.setInt(1,1);\n\t\tfor(int k=1;k<list.size();k++)\n\t\t{\n\t\t\tp.setString(k+1,\"YES\");\n\t\t}\n\t\t\n\t\tp.executeUpdate();\n\t\tcon.close();\n\t\t\n\t\t } catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\n\t\treturn 0;\n\t}", "public static void updateStudentList(String content) {\n String timestamp = String.format(\"List last updated %s\", new Date()); \n try {\n BufferedWriter writer = new BufferedWriter(new FileWriter(Constants.STUDENT_LIST)); \n writer.write(content);\n writer.newLine();\n writer.append(timestamp); \n writer.close();\n } catch (IOException exception) {\n System.out.println(exception);\n } \n }", "public void editPlayer(Nimsys nimSys,ArrayList<Player> list,Scanner keyboard) {\r\n\t\tboolean flag=false;\r\n\t\tIterator<Player> aa = list.iterator();\r\n\t\twhile (aa.hasNext()) {\r\n\t\t\tPlayer in = aa.next();\r\n\t\t\tif(in.getUserName().equals(nimSys.commands[0])){\r\n\t\t\t\tin.setSurName(nimSys.commands[1]);\r\n\t\t\t\tin.setGivenName(nimSys.commands[2]);\r\n\t\t\t\tflag = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(flag == false)\r\n\t\t\tSystem.out.println(\"The player does not exist.\");\r\n\t\t\r\n\t}", "public void importStudents(String fileName) throws FileNotFoundException\n {\n Scanner inf = new Scanner(new File(fileName));\n while(inf.hasNextLine())\n {\n String first = inf.nextLine();\n String last = inf.nextLine();\n String password = inf.nextLine();\n String p1 = inf.nextLine();\n String p2 = inf.nextLine();\n String p3 = inf.nextLine();\n String p4 = inf.nextLine();\n String p5 = inf.nextLine();\n String p6 = inf.nextLine();\n String p7 = inf.nextLine();\n String p8 = inf.nextLine();\n \n students.add(new Student(first, last, password, p1, p2, p3, p4, p5, p6, p7, p8, this));\n }\n }", "public void editEmployeeInformationName(String text) {\n\t\tthis.name=text;\n\t\tResourceCatalogue resCat = new ResourceCatalogue();\t\t\n\t\tresCat.getResource(rid).editResource(name, this.sectionId);\n\t\tHashMap<String, String> setVars = new HashMap<String, String>();\n\t\tsetVars.put(\"empname\", \"\\'\"+name+\"\\'\");\n\t\tsubmitToDB(setVars);\n\n\t}", "public void getList() {\n\n\t\tFile opFile = new File(\"/home/bridgeit/Desktop/newfile.txt\");\n\t\ttry {\n\t\t\topFile.createNewFile();\n\t\t\tFileWriter fwriter = new FileWriter(opFile);\n\n\t\t\tfor (int i = 0; i < slist.size(); i++) {\n\n\t\t\t\tfwriter.append(slist.returnItem(i) + \" \");\n\n\t\t\t}\n\t\t\tfwriter.close();\n\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void read() {\n String line = \"\";\n int counter = 0;\n try {\n input = new BufferedReader(new FileReader(file));\n while (line != null) {\n if (!(line.equals(\"arglebargle\"))) {//not a default\n names.add(line);\n }\n }\n input.close();\n }\n catch (IOException e) {\n }\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 }", "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 void saveFile(String fileName)\n {\n try\n {\n Formatter file = new Formatter(fileName);\n for (Item item: myList)\n {\n file.format(item.getFirstName() +\"\\n\" + item.getLastName() +\"\\n\"+ item.getPhoneNumber()+\"\\n\"+ item.getEmail()+\"\\n\");\n }\n file.close();\n }\n\n catch (Exception ex)\n {\n System.out.println(\"Error saving...\");\n }\n\n System.out.println(\"\");\n }", "private void handleImportLines(String inputLineString ){\n String [] splitInputLine = inputLineString.split(\",\");\n String command = splitInputLine[0];\n String name = \"\";\n String date = \"\";\n String department = \"\";\n\n double pay = 0;\n int role = 0;\n\n if(splitInputLine.length == ADDPARTFULLCOMMANDS){\n name = splitInputLine[1];\n department = splitInputLine[2];\n date = splitInputLine[3];\n pay = Double.parseDouble(splitInputLine[4]);\n\n }else if(splitInputLine.length == ADDMANAGECOMMANDS){\n name = splitInputLine[1];\n department = splitInputLine[2];\n date = splitInputLine[3];\n pay = Double.parseDouble(splitInputLine[4]);\n role = Integer.parseInt(splitInputLine[5]);\n }else if(splitInputLine.length == OTHEREXPECTEDCOMMANDS){\n name = splitInputLine[1];\n department = splitInputLine[2];\n date = splitInputLine[3];\n }\n\n if(command.equals(\"P\")){\n Profile newEmployeeProfile = profileData(name, department, date);\n Employee newEmployee = new Parttime(newEmployeeProfile, pay);\n company.add(newEmployee);\n }else if(command.equals(\"F\")){\n Profile newEmployeeProfile = profileData(name, department, date);\n Employee newEmployee = new Fulltime(newEmployeeProfile, pay);\n company.add(newEmployee);\n }else if(command.equals(\"M\")){\n Profile newEmployeeProfile = profileData(name, department, date);\n Employee newEmployee = new Management(newEmployeeProfile, pay, role);\n company.add(newEmployee);\n }\n }", "public static void addRecords() {\n\t\t\n\t\ttry {\n\t\t\twhile(fileInput.hasNextLine()) {\n\t\t\t\t// get user input to add contact to list. \n\t\t\t\tSystem.out.print(\"\\n\\nEnter contact first name: \");\t\n\t\t\t\tString firstName = input.next();\n\t\t\t\tSystem.out.print(\"\\nEnter contact last name: \");\n\t\t\t\tString lastName = input.next();\n\t\t\t\tSystem.out.print(\"\\nEnter contact phone number: \"); \n\t\t\t\tString phoneNumber = input.next();\n\t\t\t\tSystem.out.print(\"\\nEnter contact email address: \");\n\t\t\t\tString email = input.next();\n\t\t\t\t\n\t\t\t\tString[] contactInfo = { firstName, lastName, phoneNumber, email };\n\t\t\t\t\n\t\t\t\tList<String> newInput = Arrays.asList(contactInfo);\n\t\t\t\tSystem.out.printf(\"Unsorted array elements: %s%n\", list);\n\t\t\t\t\n\t\t\t\tCollections.sort(list); // sort ArrayList\n\t\t\t\tSystem.out.printf(\"Sorted array elements: %s%n\", list);\n\t\t\t\t\n\t\t\t\t// output new record to file.\n\n\t\t}\n\t\tcatch (FormatterClosedException f) {\n\t\t\tSystem.err.println(\"Error writing to file. Terminating.\"); break;\n\t\t}\n\t\tcatch (NoSuchElementException e) {\n\t\t\tSystem.err.println(\"Invalid input. Please try again.\");\n\t\t\tinput.nextLine(); // discard input so user can try again. \n\t\t}\n\t\t\t\n\t\tSystem.out.println(\"Enter another contact? 0 for no, 1 for yes: \");\n\t\tswitch(input.nextInt()) {\n\t\t\tcase 0: moreInput = false; break;\n\t\t\tcase 1: moreInput = true; break;\n\t\t}\n\t\t\t\n\t\t\t\n\t\t} // end while. \n\n\t\tSystem.out.println();\n\t}", "@Override\r\n public void remove() {\n ArrayList<String>Lines=new ArrayList<>();\r\n String Path = \"/home/yara/Documents/4year/OODP/Task.txt\";\r\n \r\n String RID=id.getText();\r\n String Taskname = name.getText();\r\n String startDate = date_start.getText();\r\n String EndDate = date_finish.getText();\r\n String LocalStatus = status.getText();\r\n String MemberID = MemberId.getText();\r\n \r\n Lines.add(RID);\r\n Lines.add(Taskname);\r\n Lines.add(startDate);\r\n Lines.add(EndDate);\r\n Lines.add(LocalStatus);\r\n Lines.add(MemberID);\r\n \r\n FileFacade facade = new FileFacade();\r\n facade.remove(Path, Lines);\r\n \r\n }", "public static void editStudentInfo(){\n System.out.println(\"Enter the students ID\");\r\n System.out.println(\"=============================\");\r\n Scanner studentNameSearch = new Scanner(System.in);\r\n String idToSearch = studentNameSearch.nextLine();\r\n for (Student searchStudent : studentList){ //basic loop to search through the list of student by the ID\r\n if (searchStudent.getStudentID().equals(idToSearch)){\r\n searchStudent.printStudentInfo();\r\n System.out.println(\"What would you like to do?\");\r\n System.out.println(\"===========================\");\r\n System.out.println(\"1: Change a students name\");\r\n System.out.println(\"2: Add a course\");\r\n System.out.println(\"3: Remove a course\");\r\n System.out.println(\"4: Set course as completed\");\r\n System.out.println(\" \");\r\n Scanner editChoice = new Scanner(System.in);\r\n\r\n switch (editChoice.nextInt()){\r\n case 1 -> {\r\n //Edit first and last name\r\n Scanner newNameInput = new Scanner(System.in);\r\n System.out.println(\"Enter the students Last name\");\r\n String newName = newNameInput.nextLine();\r\n searchStudent.setLastName(newName);\r\n System.out.println(\"Enter the students First name\");\r\n String newName1 = newNameInput.nextLine();\r\n searchStudent.setFirstName(newName1);\r\n searchStudent.getFullName();\r\n mainMenu();\r\n }\r\n case 2 -> {\r\n //search for a course and add a course to the students schedule\r\n System.out.println(\"Enter the course ID\");\r\n Scanner courseToAdd = new Scanner(System.in);\r\n String courseIdToSearch = courseToAdd.nextLine();\r\n for (Course searchCourse : courseList){\r\n if (searchCourse.getCourseID().equals(courseIdToSearch)){\r\n searchStudent.addClasstoSchedule(searchCourse);\r\n }\r\n }\r\n mainMenu();\r\n }\r\n case 3 -> {\r\n //remove a course from the students schedule\r\n System.out.println(\"Enter the course ID\");\r\n Scanner courseToAdd = new Scanner(System.in);\r\n String courseIdToSearch = courseToAdd.nextLine();\r\n for (Course searchCourse : courseList){\r\n if (searchCourse.getCourseID().equals(courseIdToSearch)){\r\n searchStudent.removeClassFromSchedule(searchCourse);\r\n }\r\n }\r\n mainMenu();\r\n }\r\n case 4 ->{\r\n //Set a course as completed\r\n System.out.println(\"Enter the course ID\");\r\n Scanner courseToAdd = new Scanner(System.in);\r\n String courseIdToSearch = courseToAdd.nextLine();\r\n for (Course searchCourse : courseList){\r\n if (searchCourse.getCourseID().equals(courseIdToSearch)){\r\n searchStudent.setCourseComplete(courseIdToSearch);\r\n }\r\n }\r\n mainMenu();\r\n }\r\n default -> {\r\n //does nothing\r\n }\r\n\r\n }\r\n\r\n }\r\n else{\r\n System.err.println(\"Could not find student based on that ID\");\r\n mainMenu();\r\n }\r\n }\r\n }", "public void modify(AddressBookDict addressBook) {\n\t\tlog.info(\"Enter the address book name whose contact you want to edit\");\n\t\tString addressBookName = obj.next();\n\t\tlog.info(\"Enter the name whose contact you want to edit\");\n\t\tString name = obj.next();\n\t\tPersonInfo p = addressBook.getContactByName(addressBookName, name);\n\t\tif (p == null) {\n\t\t\tlog.info(\"No such contact exists\");\n\t\t} else {\n\t\t\twhile (true) {\n\t\t\t\tlog.info(\n\t\t\t\t\t\t\"1. First name\\n 2.Last name\\n 3.Address\\n 4. City\\n 5. State\\n 6. Zip\\n 7. Phone number\\n 8.Email\\n 0. Exit\");\n\t\t\t\tlog.info(\"Enter the info to be modified\");\n\t\t\t\tint info_name = obj.nextInt();\n\t\t\t\tswitch (info_name) {\n\t\t\t\tcase 1:\n\t\t\t\t\tlog.info(\"Enter new First Name\");\n\t\t\t\t\tp.setFirst_name(obj.next());\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tlog.info(\"Enter new Last Name\");\n\t\t\t\t\tp.setLast_name(obj.next());\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tlog.info(\"Enter new Address\");\n\t\t\t\t\tp.setAddress(obj.next());\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tlog.info(\"Enter new City\");\n\t\t\t\t\tp.setCity(obj.next());\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tlog.info(\"Enter new State\");\n\t\t\t\t\tp.setState(obj.next());\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\tlog.info(\"Enter new Zip Code\");\n\t\t\t\t\tp.setZip(obj.next());\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7:\n\t\t\t\t\tlog.info(\"Enter new Phone Number\");\n\t\t\t\t\tp.setPhno(obj.next());\n\t\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t\tlog.info(\"Enter new Email\");\n\t\t\t\t\tp.setEmail(obj.next());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (info_name == 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void readAdmin(String fileName)\n {\n try\n {\n FileReader inputFile = new FileReader(fileName);\n Scanner parser = new Scanner(inputFile);\n String[] array = parser.nextLine().split(\";\");\n for(int index = 0; index < array.length; index++)\n {\n String[] elements = array[index].split(\",\");\n String account = elements[0];\n String password = elements[1];\n setAdmin(index, account, password);\n }\n }\n catch(FileNotFoundException exception)\n {\n System.out.println(fileName + \" not found\");\n }\n catch(IOException exception)\n {\n System.out.println(\"Unexpected I/O error occured\");\n }\n\n }", "public static void main(String[] args) {\n ArrayList<arrayset> list = new ArrayList<>();\n String [] newarray= new String[97];\n File data = new File(\"records.txt\");\n try {\n Scanner input = new Scanner(data);\n while (input.hasNextLine()) {\n String line = input.nextLine();\n firstName = line.split(\",\")[0];\n\n lastName = line.split(\",\")[1];\n\n gender = line.split(\",\")[2];\n\n age = Integer.parseInt(line.split(\",\")[3]);\n\n phoneNo = line.split(\",\")[4];\n\n email = line.split(\",\")[5];\n\n firstName = Character.toUpperCase(firstName.charAt(0)) + firstName.substring(1, firstName.length());\n lastName = Character.toUpperCase(lastName.charAt(0)) + lastName.substring(1, lastName.length());\n\n if (gender.toLowerCase() == \"male\" || gender.toLowerCase() == \"female\") {\n gender = gender.toLowerCase();\n }\n if (age > 1 || age < 129) {\n age = age;\n }\n else if(age <1 || age > 129) {\n System.out.println(\"Error person not valid\");\n }\n if (phoneNo.length() == 13) {\n phoneNo = phoneNo;\n }\n else if(phoneNo.length()<13) {\n System.out.println(\"Error person not valid\");\n }\n if (email.matches(\"[A-Z][0-9].@\")) {\n email = email;\n }\n else if(email.matches(\"[A-Z][0-9].@\")) {\n System.out.println(\"Error person not valid\");\n }\n list.add(new arrayset(firstName, lastName, gender, age, phoneNo, email));\n }\n input.close();\n }\n catch (FileNotFoundException e) {\n System.out.println(\"Error Wrong File!\");\n }\n System.out.println(\"Error: Person 4 is not valid, since age = -89\\n\" +\n \"Error: Person 12 is not valid, since last name = Lara22\\n\" +\n \"Error: Person 21 is not valid, since age = 179\\n\" +\n \"Error: Person 32 is not valid, since last name = Mccullough\\n\" +\n \"Error: Person 52 is not valid, since email = MMaddenMadden.net\\n\" +\n \"Error: Person 96 is not valid, since age = 0\");\n System.out.format(\"%-20s%-15s%-15s%-10s%-20s%7s \", \"First Name\", \"Last Name\", \"Gender\", \"Age\", \"Number\", \"Email\");\n\n int i = 0;\n while (i < list.size()) {\n String printarray= String.format(\"%-20s%-15s%-15s%-10s%-20s%7s \", list.get(i).getFirstName(), list.get(i).getLastName(),\n list.get(i).getGender(), list.get(i).getAge(), list.get(i).getPhoneNo(), list.get(i).getEmail());\n newarray[i]=printarray;\n i++;\n\n }\n for(int j=0; j<newarray.length; j++) {\n System.out.println(newarray[j]);\n\n }\n}", "public static void main(String[] args) throws IOException {\n\t\tScanner s=new Scanner(System.in);\r\n\t\tSystem.out.println(\"Main Menu\");\r\n\t\tSystem.out.println(\"1. Add an Employee\");\r\n\t\tSystem.out.println(\"2. Display All\");\r\n\t\tSystem.out.println(\"3. Exit\");\r\n\t\tFile f= new File(\"EmployeeDetails.txt\");\r\n\t\tint choice=0;\r\n\t\tdo\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Enter your choice: \");\r\n\t\t\tchoice=s.nextInt();\r\n\t\t\tswitch(choice)\r\n\t\t\t{\r\n\t\t\tcase 1:\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Enter Employee ID: \");\r\n\t\t\t\tint emp_id=s.nextInt();\r\n\t\t\t\tSystem.out.println(\"Enter Employee Name: \");\r\n\t\t\t\tString emp_name=s.next();\r\n\t\t\t\tSystem.out.println(\"Enter Employee age: \");\r\n\t\t\t\tint emp_age=s.nextInt();\r\n\t\t\t\tSystem.out.println(\"Enter Employee Salary:\");\r\n\t\t\t\tdouble emp_salary=s.nextDouble();\r\n\t\t\t\tString str=emp_id+\" \"+emp_name+\" \"+emp_age+\" \"+emp_salary;\r\n\t\t\t\tFileWriter fwrite=new FileWriter(f.getAbsoluteFile(),true);\r\n\t\t\t\tfor(int i=0;i<str.length();i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfwrite.write(str.charAt(i));\r\n\t\t\t\t}\r\n\t\t\t\tfwrite.close();\r\n\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tScanner fread= new Scanner(f);\r\n\t\t\t\tSystem.out.println(\"-----Report-----\");\r\n\t\t\t\twhile(fread.hasNext())\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(fread.nextLine());\r\n\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println(\"-----End of Report-----\");\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\tSystem.out.println(\"Exiting the system\");\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tSystem.out.println(\"Invalid input\");\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}while(choice<=3);\r\n\t\t\r\n\r\n\t}" ]
[ "0.76074827", "0.61558557", "0.6031909", "0.60163176", "0.5930704", "0.5764944", "0.5733894", "0.5648746", "0.5634261", "0.5622021", "0.56189346", "0.5596486", "0.55896664", "0.5574204", "0.55674446", "0.55594546", "0.5557735", "0.5527598", "0.5524064", "0.5517859", "0.5476736", "0.54579264", "0.5445795", "0.54356164", "0.5417244", "0.5407106", "0.5376884", "0.5366132", "0.53580153", "0.5340364", "0.53331274", "0.5331233", "0.5331137", "0.5325566", "0.53236634", "0.530548", "0.52911174", "0.5283432", "0.52596885", "0.5258829", "0.5248974", "0.5237112", "0.52294207", "0.5222409", "0.52176577", "0.52124774", "0.5212105", "0.52116966", "0.5199348", "0.5191722", "0.518932", "0.518665", "0.5185509", "0.5180963", "0.5154245", "0.5149228", "0.5148593", "0.51484007", "0.51289666", "0.5114908", "0.51132655", "0.5109508", "0.51013803", "0.5091691", "0.50893044", "0.5087119", "0.50630957", "0.5053321", "0.50514346", "0.5046068", "0.5045824", "0.5035472", "0.5034884", "0.5030006", "0.5028789", "0.5027245", "0.500927", "0.50059754", "0.5003203", "0.500108", "0.49996924", "0.49991894", "0.49975887", "0.4989079", "0.49866885", "0.49734995", "0.49727693", "0.497225", "0.4971016", "0.49667913", "0.4965703", "0.49656463", "0.49589005", "0.49564883", "0.49557453", "0.49505055", "0.49435425", "0.49397218", "0.49387193", "0.4937889" ]
0.61604667
1
The following method take the ArrayList from the method above and finish the editing.
@Override public void edit(){ Integer Pointer=0; FileWriter editDetails = null; ArrayList<String> lineKeeper = saveText(); /* Search into the list to find the Username, if it founds it, changes the * old information with the new information. * Search*/ if(lineKeeper.contains(getUsername())){ Pointer=lineKeeper.indexOf(getUsername()); //Write the new information lineKeeper.set(Pointer+1, getPassword()); lineKeeper.set(Pointer+2, getFirstname()); lineKeeper.set(Pointer+3, getLastname()); lineKeeper.set(Pointer+4, DMY.format(getDoB())); lineKeeper.set(Pointer+5, getContactNumber()); lineKeeper.set(Pointer+6, getEmail()); lineKeeper.set(Pointer+7, String.valueOf(getSalary())); lineKeeper.set(Pointer+8, getPositionStatus()); Pointer=Pointer+9; homeAddress.edit(lineKeeper,Pointer); }//end if try{ editDetails= new FileWriter("employees.txt",false); for( int i=0;i<lineKeeper.size();i++){ editDetails.append(lineKeeper.get(i)); editDetails.append(System.getProperty("line.separator")); }//end for editDetails.close(); editDetails = null; }//end try catch (IOException ioe) {}//end catch }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void slide127() {\n ArrayList<String> obj = new ArrayList<String>();\n\n //This is how we add elements to an ArrayList\n obj.add(\"Alex\");\n obj.add(\"Con\");\n obj.add(\"Paul\");\n obj.add(\"Estel\");\n obj.add(\"Peter\");\n\n // Displaying elements\n System.out.println(\"Original ArrayList:\");\n for(String str:obj)\n System.out.println(str);\n\n // Add element at the specific index\n\n obj.add(0, \"Mary\");\n obj.add(1, \"Justin\");\n\n // Displaying elements\n System.out.println(\"ArrayList after add operation:\");\n for(String str:obj)\n System.out.println(str);\n\n //Remove elements from ArrayList like this\n obj.remove(\"Peter\");\n obj.remove(\"Paul\");\n\n // Displaying elements\n System.out.println(\"ArrayList after remove operation:\");\n for(String str:obj)\n System.out.println(str);\n\n // Edit element from ArrayList\n obj.set(2, \"Tom\");\n\n // Displaying elements\n System.out.println(\"ArrayList after edit operation:\");\n for(String str:obj)\n System.out.println(str);\n\n\n //Remove element from the specified index\n obj.remove(1); //Removes Second element from the List\n\n // Displaying elements\n System.out.println(\"Final ArrayList:\");\n for(String str:obj)\n System.out.println(str);\n }", "@Test\n public void TestEditOne(){\n ArrayList<Task> listToEdit = new ArrayList<Task>();\n ArrayList<Integer> indexList = new ArrayList<Integer>();\n String message;\n \n indexList.add(3);\n listToEdit.add(new Task(\"New item 99\"));\n message = logicObject.editItem(listToEdit, indexList, true, true);\n assertEquals(\"Error: There is no item at this index.\", message);\n assertEquals(\"Item 1\", logicObject.listOfTasks.get(0).getName());\n assertEquals(\"Item 2\", logicObject.listOfTasks.get(1).getName());\n assertEquals(\"Item 3\", logicObject.listOfTasks.get(2).getName());\n \n indexList.clear();\n indexList.add(2);\n message = logicObject.editItem(listToEdit, indexList, true, true);\n assertEquals(\"Item(s) successfully edited.\", message);\n assertEquals(\"Item 1\", logicObject.listOfTasks.get(0).getName());\n assertEquals(\"Item 2\", logicObject.listOfTasks.get(1).getName());\n assertEquals(\"New item 99\", logicObject.listOfTasks.get(2).getName());\n \n indexList.clear();\n indexList.add(-1);\n message = logicObject.editItem(listToEdit, indexList, true, true);\n assertEquals(\"Error: There is no item at this index.\", message);\n assertEquals(\"Item 1\", logicObject.listOfTasks.get(0).getName());\n assertEquals(\"Item 2\", logicObject.listOfTasks.get(1).getName());\n assertEquals(\"New item 99\", logicObject.listOfTasks.get(2).getName());\n \n indexList.clear();\n indexList.add(-2);\n message = logicObject.editItem(listToEdit, indexList, true, true);\n assertEquals(\"Error: There is no item at this index.\", message);\n assertEquals(\"Item 1\", logicObject.listOfTasks.get(0).getName());\n assertEquals(\"Item 2\", logicObject.listOfTasks.get(1).getName());\n assertEquals(\"New item 99\", logicObject.listOfTasks.get(2).getName());\n }", "@Test\n public void TestEditTwo(){\n ArrayList<Task> listToEdit = new ArrayList<Task>();\n ArrayList<Integer> indexList = new ArrayList<Integer>();\n String message;\n \n indexList.add(0);\n listToEdit.add(new Task(\"New item 1\"));\n message = logicObject.editItem(listToEdit, indexList, true, true);\n assertEquals(\"Item(s) successfully edited.\", message);\n assertEquals(\"New item 1\", logicObject.listOfTasks.get(0).getName());\n assertEquals(\"Item 2\", logicObject.listOfTasks.get(1).getName());\n assertEquals(\"Item 3\", logicObject.listOfTasks.get(2).getName());\n \n indexList.clear();\n listToEdit.clear();\n indexList.add(1);\n listToEdit.add(new Task(\"New item 2\"));\n message = logicObject.editItem(listToEdit, indexList, true, true);\n assertEquals(\"Item(s) successfully edited.\", message);\n assertEquals(\"New item 1\", logicObject.listOfTasks.get(0).getName());\n assertEquals(\"New item 2\", logicObject.listOfTasks.get(1).getName());\n assertEquals(\"Item 3\", logicObject.listOfTasks.get(2).getName());\n \n indexList.clear();\n listToEdit.clear();\n indexList.add(2);\n listToEdit.add(new Task(\"New item 3\"));\n message = logicObject.editItem(listToEdit, indexList, true, true);\n assertEquals(\"Item(s) successfully edited.\", message);\n assertEquals(\"New item 1\", logicObject.listOfTasks.get(0).getName());\n assertEquals(\"New item 2\", logicObject.listOfTasks.get(1).getName());\n assertEquals(\"New item 3\", logicObject.listOfTasks.get(2).getName());\n \n indexList.clear();\n logicObject.showUpdatedItems();\n listToEdit.clear();\n indexList.add(1);\n listToEdit.add(new Task(\"item 2 changed again!\"));\n message = logicObject.editItem(listToEdit, indexList, true, true);\n assertEquals(\"Item(s) successfully edited.\", message);\n assertEquals(\"New item 1\", logicObject.listOfTasks.get(0).getName());\n assertEquals(\"item 2 changed again!\", logicObject.listOfTasks.get(1).getName());\n assertEquals(\"New item 3\", logicObject.listOfTasks.get(2).getName());\n }", "public void updateList() \n { \n model.clear();\n for(int i = ScholarshipTask.repository.data.size() - 1; i >= 0; i--) \n {\n model.addElement(ScholarshipTask.repository.data.get(i));\n }\n }", "private void modify(List listString){\n\t}", "protected void doListEdit() {\r\n String nameInput = mEditTextForList.getText().toString();\r\n\r\n /**\r\n * Set input text to be the current list item name if it is not empty and is not the\r\n * previous name.\r\n */\r\n if (!nameInput.equals(\"\") && !nameInput.equals(mItemName)) {\r\n Firebase firebaseRef = new Firebase(Constants.FIREBASE_URL);\r\n\r\n /* Make a map for the item you are editing the name of */\r\n HashMap<String, Object> updatedItemToAddMap = new HashMap<String, Object>();\r\n\r\n /* Add the new name to the update map*/\r\n updatedItemToAddMap.put(\"/\" + Constants.FIREBASE_LOCATION_SHOPPING_LIST_ITEMS + \"/\"\r\n + mListId + \"/\" + mItemId + \"/\" + Constants.FIREBASE_PROPERTY_ITEM_NAME,\r\n nameInput);\r\n\r\n /* Make the timestamp for last changed */\r\n HashMap<String, Object> changedTimestampMap = new HashMap<>();\r\n changedTimestampMap.put(Constants.FIREBASE_PROPERTY_TIMESTAMP, ServerValue.TIMESTAMP);\r\n\r\n /* Add the updated timestamp */\r\n updatedItemToAddMap.put(\"/\" + Constants.FIREBASE_LOCATION_ACTIVE_LISTS +\r\n \"/\" + mListId + \"/\" + Constants.FIREBASE_PROPERTY_TIMESTAMP_LAST_CHANGED, changedTimestampMap);\r\n\r\n /* Do the update */\r\n firebaseRef.updateChildren(updatedItemToAddMap);\r\n\r\n }\r\n }", "@Override\n public void refreshList(ArrayList<String> newList){\n }", "private void startEditExistingTextActivity(int whichListPosition){\n ArrayList<String> listToExpand = new ArrayList<String>();\n listToExpand = myList.get(whichListPosition);\n Intent intent = new Intent(this, EditExistingText.class);\n Bundle bundle = new Bundle();\n bundle.putStringArrayList(\"theList\", listToExpand);\n bundle.putInt(\"theListPosition\", whichListPosition);\n bundle.putInt(\"theItemPosition\", 0);\n intent.putExtras(bundle);\n startActivityForResult(intent, EDITTEXTRC);\n }", "private void listExample()\n\t{\n\n\t\tArrayList <String> alist = new ArrayList<String>();//doesn't have to be string- can be Duck, or Mouse, or Apostrophe\n\t\talist.add(\"banana\"); //adds \"banana\" to the end of the list\n\t\talist.add(\"strawberry\");\n\t\talist.add(\"blueberry\");\n\t\talist.add(\"blackberry\");\n\t\t\n\t\tJOptionPane.showMessageDialog(null,alist);\n\t\t\n\t\talist.add(2, \"apple\"); //adds it in spot 2 (3rd position)\n\t\t\n\t\tJOptionPane.showMessageDialog(null,alist);\n\t\t\n\t\t\n\t\talist.remove(\"blueberry\"); \n\t\t/**\n\t\t * .remove returns what was in the spot that was just taken out--and shrinks down by one\n\t\t * .set also returns this value but it replaces the value with something else\n\t\t */\n\t\talist.remove(0); //removes 1st element\n\t\tJOptionPane.showMessageDialog(null,alist);\n\t\t\n\t\tfor (String str:alist)\n\t\t\tJOptionPane.showMessageDialog(null, str); //shows each individually\n\t\t\n\t\talist.set(1, \"coconut\"); //alist.set(index, element) --replaces\n\t\t\n\t\tint numberOfItems = alist.size();\n\t\talist.clear();\n\n\t\n\t}", "public List <Person> editUser(List <Person> listOfPerson)\n\t{\n\t System.out.println(\"Enter the First Name you want to make changes in: \");\n\t String fname = Utility.inputString();\n\t for(int i = 0; i < listOfPerson.size(); i++)\n\t {\n\t \tif(listOfPerson.get(i).getFname().equals(fname))\n\t \t{\n\t \t\tPerson temp = listOfPerson.get(i);\n\t do {\n\t\t System.out.println(\"Enter the detail you want to edit: \");\n\t\t System.out.println(\"Enter 1 to edit Last Name: \");\n\t\t System.out.println(\"Enter 2 to edit Address: \");\n\t\t System.out.println(\"Enter 3 to edit City: \");\n\t\t System.out.println(\"Enter 4 to edit State: \");\n\t\t System.out.println(\"Enter 5 to edit Zip code: \");\n\t\t System.out.println(\"Enter 6 to edit Phone Number: \");\n\t\t int choice = Utility.inputInteger();\n\t\t switch(choice)\n\t\t {\n\t\t case 1:\n\t\t\t System.out.println(\"Enter the new Last Name\");\n\t\t\t temp.setLname(Utility.inputString()); \n\t\t\t System.out.println(\"Details saved successfully\");\n\t\t\t break;\n\t\t\t \n\t\t case 2:\n\t\t \t System.out.println(\"Enter the New Address\");\n\t\t \t temp.setAddress(Utility.inputString());\n\t\t \t System.out.println(\"Details saved successfully\");\n\t\t \t break;\n\t\t \t \n\t\t case 3:\n\t\t \t System.out.println(\"Enter the New City\");\n\t\t \t temp.setCity(Utility.inputString());\n\t\t \t System.out.println(\"Details saved successfully\");\n\t\t \t break;\n\t\t \t \n\t\t case 4:\n\t\t \t System.out.println(\"Enter the New State\");\n\t\t \t temp.setState(Utility.inputString());\n\t\t \t System.out.println(\"Details saved successfully\");\n\t\t \t break;\n\t\t \t \n\t\t case 5:\n\t\t \t System.out.println(\"Enter the new Zip code\");\n\t\t \t temp.setZip(Utility.inputInteger());\n\t\t \t System.out.println(\"Details saved successfully\");\n\t\t \t break;\n\t\t \t \n\t\t case 6:\n\t\t \t System.out.println(\"Enter the New Phone Number\");\n\t\t \t temp.setPhn(Utility.inputLong());\n\t\t \t System.out.println(\"Details saved successfully\");\n\t\t \t break;\n\t\t \t \n\t\t \t default:\n\t\t \t\t System.out.println(\"Invaild choice\");\n\t\t \t\t break;\n\t\t } \n\t\t listOfPerson.add(temp);\n\t\t return listOfPerson;\n\t }while(Utility.inputBoolean());\n\t }\n\t }\n\t return listOfPerson;\n\t}", "private <T> void populateArrayFromList(T[] arr, ArrayList<T> arrayList) {\n\t\tSystem.out.println(\"Array size \" + arr.length);\n\t\tSystem.out.println(\"ArrayList size \" + arrayList.size());\n\t\tfor (int i = 0; i < arrayList.size(); i++) {\n\t\t\tsavedListModel.addElement(arrayList.get(i).toString());\n\t\t\tarr[i] = arrayList.get(i);\n\t\t}\n\t}", "private ArrayList<String> simpleFormList(ArrayList<String> list){\n\t\tArrayList<String> simpleFormList = new ArrayList<String>();\n\t\tfor(String s : list){\n\t\t\tString pos = posMap.get(s);\n\t\t\tsimpleFormList.add(simpleForm(s,pos));\n\t\t}\n\t\treturn simpleFormList;\n\t}", "private void editList(){\n String name =this.stringPopUp(\"New name:\");\n Color newDefaultPriority = ColorPicker.colorPopUp(ColorPicker.getColor(currentList.getColor()));\n if(name != null && !name.isEmpty()) {\n String oldName = getPanelForList().getName();\n JPanel panel = getPanelForList();\n currentList.setName(name);\n currentList.setColor(ColorPicker.getColorName(newDefaultPriority));\n agenda.getConnector().editItem(currentList);\n setup.remove(oldName);\n window.remove(panel);\n setup.put(name,true);\n panel.setName(name);\n comboBox.addItem(name);\n comboBox.setSelectedItem(name);\n window.add(name,panel);\n comboBox.removeItem(oldName);\n this.updateComponent(panel);\n this.showPanel(name);\n this.updateComponent(header);\n }\n }", "public void guardarCambios(View v){\n\n ArrayList<ENListaCompra> miL = DespenBD.getListasVisibles();\n ENListaCompra lCompra = miL.get(miL.size()-posicion-1);\n\n System.out.println(\"Posician: \"+posicion);\n System.out.println(\"Nombre: \"+lCompra.getNombre());\n\n DespenBD.editarLista(lCompra.getNombre(),lCompra.getFecha(),etNombre.getText().toString(), etFecha.getText().toString());\n //lCompra.setNombre();\n\n /* for (ENListaCompra lc: miL) {\n //misListas.add(0, new MisListas(\"\"+lc.getNombre(),\"\"+lc.getFecha()));\n System.out.println(\"imprime: \" + lc.getNombre());\n }*/\n\n Intent i = new Intent(this, ListasCompra.class );\n //i.putExtra(\"nombre\", \"\" + etNombre.getText());\n //i.putExtra(\"accion\", \"editar\");\n startActivity(i);\n\n finish();\n\n }", "public static void main(String[] args){\n \t\t\r\n \r\n \t\tArrayList<Phonebook> list = new ArrayList<Phonebook>();\r\n \t\t\r\n \t\tSystem.out.println(\"Original List\");\r\n \t\tlist.add(new Phonebook(1234567, \"[email protected]\", 1987654, \"123 qwerty lane\"));\r\n \t\tlist.add(new Phonebook(1987654, \"[email protected]\", 1994560, \"098 qwerty lane\"));\r\n \t\t\r\n \t\tfor (int i = 0; i < list.size(); i++) {\r\n\t\t\tSystem.out.println(list.get(i).getNumber() + \", \" + list.get(i).getEmail() + \", \" + list.get(i).getCell() + \", \" + list.get(i).getAddress());\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"\\nNew List\");\r\n\t\tlist.add(new Phonebook(2341234, \"[email protected]\", 3241563, \"122 qwerty lane\"));\r\n\t\tfor (int i = 0; i < list.size(); i++) {\r\n\t\t\tSystem.out.println(list.get(i).getNumber() + \", \" + list.get(i).getEmail() + \", \" + list.get(i).getCell() + \", \" + list.get(i).getAddress());\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"\\nNewer List \");\r\n\t\tlist.remove(1);\r\n\t\tfor (int i = 0; i < list.size(); i++) {\r\n\t\t\tSystem.out.println(list.get(i).getNumber() + \", \" + list.get(i).getEmail() + \", \" + list.get(i).getCell() + \", \" + list.get(i).getAddress());\r\n\t\t}\r\n\t\t\r\n\t\t\r\n \t}", "public void edit(ArrayList<Movie> movies)\n {\n String deleteMovie = \"\";\n String newact1 = \"\";\n String newact2 = \"\";\n String newact3 = \"\";\n int newrating = 0; \n String title = \"\";\n int movieIndex = 0; \n ArrayList<Movie> result = new ArrayList<Movie>();\n \n title = insertTitle();\n result = checkExistence(movies, title);\n boolean value = displayExistanceResult(result, title);\n \n if (value == false)\n return;\n \n int options = insertNumberOption(result, \"modify\");\n \n options = options - 1;\n String head = result.get(options).getTitle();\n String director = result.get(options).getDirector();\n String actor1 = result.get(options).getActor1();\n String actor2 = result.get(options).getActor2(); \n String actor3 = result.get(options).getActor3();\n int rating = result.get(options).getRating();\n \n newact1 = actor1;\n newact2 = actor2;\n newact3 = actor3;\n newrating = rating; \n \n int ans = insertEditMenuAnswer();\n \n if (ans == 1)\n {\n newact1 = insertActor(1);\n newact2 = insertActor(2);\n \n if (newact2.length() != 0)\n {\n newact3 = insertActor(3);\n \n if (newact3.length() == 0)\n newact3 = actor3;\n }\n else \n if (newact2.length() == 0)\n newact2 = actor2;\n }\n else \n if (ans == 2)\n newrating = insertRating();\n else\n if (ans == 3)\n {\n newact1 = insertActor(1);\n newact2 = insertActor(2);\n \n if (newact2.length() != 0)\n {\n newact3 = insertActor(3);\n \n if (newact3.length() == 0)\n newact3 = actor3;\n }\n else \n if (newact2.length() == 0)\n newact2 = actor2; \n newrating = insertRating();\n }\n else\n if (ans == 4)\n return;\n \n actor1 = newact1;\n actor2 = newact2;\n actor3 = newact3;\n rating = newrating;\n \n for (Movie film : movies)\n {\n String titles = film.getTitle();\n \n if (head.equalsIgnoreCase(titles))\n break;\n \n movieIndex = movieIndex + 1;\n }\n \n Movie film = new Movie(head,director,actor1,actor2,actor3,rating);\n movies.set(movieIndex, film);\n \n System.out.println(\"\\n\\t\\t >>>>> As you want, \" + head.toUpperCase() + \" has been UPDATED! <<<<<\");\n displayOneFilm(film);\n }", "public static void main(String[] args) {\n\n\t\tArrayList arr = new ArrayList();\n\n\t\tarr.add(2);\n\t\tarr.add(10);\n\t\tarr.add(\"Hello\");\n\t\tarr.add(\"Java Developer\");\n\t\tarr.add('J');\n\t\tarr.add(2.5);\n\t\tarr.add(2);\n\t\tarr.add(2);\n\n\t\tSystem.out.println(arr);\n\t\tSystem.out.println(\"Size of ArrayList :\" + arr.size());\n\t\t\n\t\tListIterator itr = arr.listIterator();\n\t\twhile(itr.hasNext()){\n\t\t\t\n\t\t\tObject obj = itr.next();\n\t\t\titr.set(obj +\"Tops\");\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.println(\"After the modification\");\n\t\t\n\t\titr = arr.listIterator();\n\t\t\n\t\twhile(itr.hasNext()){\n\t\t\t\n\t\t\tObject obj = itr.next();\n\t\t\tSystem.out.println(\"Ele :\"+obj);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Reverse Order\");\n\t\twhile(itr.hasPrevious()){\n\t\t\t\n\t\t\tObject obj = itr.previous();\n\t\t\tSystem.out.println(\"Ele :\" +obj);\n\t\t}\n\n\t}", "public void edit(List<InsertObject> inserts);", "public ModifyCitedPublicationList( ArrayList <CitedPublication> StartedList ){\n \n modifiedList = new ArrayList<Integer>(); \n IndexDeletedItem = new ArrayList<Integer>();\n deletedItem = new ArrayList <CitedPublication>();\n \n KeepItem = StartedList;\n \n }", "public void revolver() {\n this.lista = Lista.escojerAleatorio(this, this.size()).lista;\n }", "private void edit() {\n\n\t}", "public void setEditList(List<StepModel> stepList){\n //Guardamos el tamaña de la lista a modificar\n int prevSize = this.stepModelList.size();\n //Limpiamos la lista\n this.stepModelList.clear();\n //Si la lista que me pasan por parámtro es nula, la inicializo a vacia\n if(stepList == null) stepList = new ArrayList<>();\n //Añado la lista que me pasan por parámetro a la lista vaciada\n this.stepModelList.addAll(stepList);\n //Notifico al adaptador que el rango de item se ha eliminado\n notifyItemRangeRemoved(0, prevSize);\n //Notifico que se ha insertado un nuevo rango de items\n notifyItemRangeInserted(0, stepList.size());\n }", "private void actualizarLista(ArrayList<Producto> p2) {\n\t\tString[] str = new String[p2.size()];\n\t\tfor (int i = 0; i < p2.size(); i++) {\n\t\t\tstr[i] = p2.get(i).get_nombre();\n\t\t}\n\t\tstr.clone();\n\t\tlistaProductos.setModel(new javax.swing.AbstractListModel<String>() {\n\t\t\tString[] strings = str.clone();\n\n\t\t\tpublic int getSize() {\n\t\t\t\treturn strings.length;\n\t\t\t}\n\n\t\t\tpublic String getElementAt(int i) {\n\t\t\t\treturn strings[i];\n\t\t\t}\n\t\t});\n\t\t/*informacion.setText(\"Precio:\\t\" + p2.get(0).get_nombre() + \"\\n\"\n\t\t\t\t+ \"Plataforma:\\t\" + p2.get(0).get_genero() + \"\\nPrecio:\\t\"\n\t\t\t\t+ Double.toString(p2.get(0).get_precio()));*/\n\t\tlistaProductos.addListSelectionListener(new ListSelectionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void valueChanged(ListSelectionEvent e) {\n\t\t\t\tif (!e.getValueIsAdjusting()) {\n\t\t\t\t\tinformacion.setText(obtenerInfo(listaProductos.getSelectedValue().toString()));\n\t\t\t\t\ttextoValoraciones.setText(obtenerValoraciones(listaProductos.getSelectedValue().toString()));\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t}\n\t\t});\n\t}", "private void update(){\n\t\tIterator it = lList.iterator();\r\n\t\tString out=\"\"; // it used for collecting all members\r\n\t\tint count = 0;\r\n\t\twhile (it.hasNext()){\r\n\t\t\tObject element = it.next();\r\n\t\t\tout += \"\\nPERSON \" + count + \"\\n\";\r\n\t\t\tout += \"=============\\n\";\r\n\t\t\tout += element.toString();\r\n\t\t\t++count;\r\n\t\t}\t\t\r\n\t\toutputArea.setText(out); \r\n\t}", "private void cargarLista(ArrayList<CarritoDTO> arrayList)\n {\n DefaultListModel modelo = new DefaultListModel();\n //Recorrer el contenido del ArrayList\n for(int i=0; i<arrayList.size(); i++) \n {\n CarritoDTO item =(CarritoDTO) arrayList.get(i);\n //Añadir cada elemento del ArrayList en el modelo de la lista\n modelo.add(i, item.toString());\n }\n //Asociar el modelo de lista al JList\n jList1.setModel(modelo);\n }", "public void setCurrentListToBeDoneList();", "public boolean onOptionsItemSelected(MenuItem item) {\n String input = note_input.getText().toString();\n\n switch (item.getItemId()) {\n case R.id.add:\n try {\n Log.i(tag, \"ADD: \" + input);\n\n //Adds item to adapter\n adapter.add(adapter.getCount() + 1 + \". \" + input);\n adapter.notifyDataSetChanged();\n\n //Every time after first adding new items. It appends the ArrayList too\n if (adapter.getCount() != listItem.size()) {\n Log.i(tag, \"Added by list...\");\n listItem.add(listItem.size() + 1 + \". \" + input);\n }\n\n //Resets the EditText box\n note_input.setText(\"\");\n\n for (int i = 0; i < listItem.size(); i++) {\n Log.i(tag, i + \": \" + listItem.get(i));\n }\n\n current_pos = -1; //Resets position\n return true;\n } catch (Exception e) {\n Toast.makeText(getApplicationContext(), \"Error, nothing selected\", Toast.LENGTH_SHORT).show();\n return true;\n }\n case R.id.delete:\n try {\n Log.i(tag, \"Delete: \" + input);\n Log.i(tag, \"Current pos: \" + current_pos);\n\n\n listItem.remove(current_pos); //Removes item from list\n listItem = remake_array(listItem); //Remakes list so that number labels are in order\n\n Log.i(tag, \"After Remake\");\n\n for (int i = 0; i < listItem.size(); i++) {\n Log.i(tag, i + \": \" + listItem.get(i));\n }\n\n //Following three lines are to update the adapter\n adapter.clear();\n adapter.addAll(listItem);\n adapter.notifyDataSetChanged();\n\n //Resets the edit text box and current position\n note_input.setText(\"\");\n current_pos = -1;\n return true;\n } catch (Exception e) {\n Toast.makeText(getApplicationContext(), \"Nothing selected to delete\", Toast.LENGTH_SHORT).show();\n return true;\n }\n case R.id.update:\n try {\n\n Log.i(tag, \"Update: \" + input);\n Log.i(tag, \"Current pos: \" + current_pos);\n\n //Updates the adapter\n adapter.remove(listItem.get(current_pos));\n adapter.insert(current_pos+1 + \". \" + input,current_pos);\n\n //Updates the ArrayList\n listItem.remove(current_pos); //Removes item from list\n listItem.add(current_pos, current_pos+1 + \". \" + input);\n listItem = remake_array(listItem); //Remakes list so that number labels are in order\n\n adapter.notifyDataSetChanged();\n\n Log.i(tag, \"After Update\");\n\n for (int i = 0; i < listItem.size(); i++) {\n Log.i(tag, i + \": \" + listItem.get(i));\n }\n\n\n\n note_input.setText(\"\");\n current_pos = -1;\n return true;\n } catch (Exception e) {\n Toast.makeText(getApplicationContext(), \"Nothing selected to update\", Toast.LENGTH_SHORT).show();\n return true;\n }\n //If the user presses the close or save button it closes the app\n case R.id.close:\n finish();\n return true;\n\n case R.id.save:\n finish();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\r\n\tpublic void redo() {\n\t\tfor(IShape shape : tempList)\r\n\t\t\tshapeList.add(shape);\r\n\t}", "public static void main(String[] args) {\n\t\tArrayList al = new ArrayList(); // support heterogeneous data main any type of value\r\n\t\t// add new element\r\n\t\tal.add(15);\r\n\t\tal.add(\"welocome\");\r\n\t\tal.add(2020);\r\n\t\tal.add(15.5);\r\n\t\tal.add(\"A\");\r\n\r\n\t\tSystem.out.println(al);\r\n\t\t// size of Arrylist\r\n\t\tSystem.out.println(\"no of index \" + al.size());\r\n\t\t\r\n\t\t// remove method\r\n\t\tal.remove(2);\r\n \tSystem.out.println(al);\r\n\r\n\t\t// Inert a data\r\n\t\tal.add(2, 2021);\r\n\t\tSystem.out.println(\"add the data in array list\" + al);\r\n\t\t// Retried the specific element\r\n\t\r\n \tSystem.out.println(al.get(2));\r\n\t\t// change and replace the element\r\n\t\tal.set(2, 2022);\r\n\t\tSystem.out.println(al);\r\n\t\t\r\n\t\t// search // contains\r\n\t\tSystem.out.println(al.contains(\"welocome\")); \r\n\t\t\r\n\t\t// is empty\r\n\t\tSystem.out.println(al.isEmpty());\r\n\r\n\t\tIterator it = al.iterator();\r\n\t\t\r\n\t\twhile (it.hasNext()) {\r\n\t\tSystem.out.println(it.next());\r\n\t\t}\r\n\r\n\t}", "public void updateAnimalList(){\r\n // if (animals != null && animals.size() > 0)\r\n // {\r\n // \r\n // }\r\n // else\r\n // {\r\n animals.clear();\r\n \r\n for (fit5042.assign.repository.entity.Animal animal : animalManagedBean.getAllAnimals())//for each animal entry in the Entity Class Animal, get all animals\r\n {\r\n animals.add(animal); //add Animal data to the ArrayList<Animal> animals\r\n }\r\n \r\n setAnimal(animals); //set the global ArrayList attribute with the local ArrayList attribute\r\n // }\r\n }", "private void updateArrayListCoordinates() {\n this.coordinates = makeCoordinatesFromCenterCoordinate(centerPointCoordinate);\n }", "public void saveChanges() {\n if(finalListModel.isEmpty() || finalListModel.size() < initialListModel.size() ) {\n JOptionPane.showMessageDialog(null, \"Sorry, number of buttons should be \" +\n \"equal to the number of files in final list\");\n }\n// else if((finalListModel.toString()).equals(initialListModel.toString())) {\n// JOptionPane.showMessageDialog(null, \"Sorry, make different selections as \" +\n// \"both final and initial list are same\");\n// }\n else {\n save();\n initialListModel.removeAllElements();\n for (int i = 0; i < order.getItemCount(); i++) {\n initialListModel.addElement(finalListModel.getElementAt(i));\n }\n }\n }", "public void EditandSavelist(String Editlistname){\r\n\t\tString editlist = getValue(Editlistname);\r\n\r\n\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Link should be edited and saved\");\r\n\t\ttry{\r\n\r\n\t\t\twaitForElement(locator_split(\"lnkeditlist\"));\r\n\t\t\tclick(locator_split(\"lnkeditlist\")); \r\n\r\n\t\t\tsleep(1000);\r\n\t\t\twaitForElement(locator_split(\"txtlistname\"));\r\n\t\t\tsendKeys(locator_split(\"txtlistname\"), editlist);\r\n\r\n\r\n\t\t\twaitForElement(locator_split(\"clksavelist\"));\r\n\t\t\tclick(locator_split(\"clksavelist\")); \r\n\r\n\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Link is edited and saved\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Favorities is not clicked \"+elementProperties.getProperty(\"lnkFavorities\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"lnkFavorities\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\t\r\n\r\n\r\n\t}", "public ArrayList<String> a(ArrayList<View> arrayList) {\n ArrayList<String> arrayList2 = new ArrayList<>();\n int size = arrayList.size();\n for (int i = 0; i < size; i++) {\n View view = arrayList.get(i);\n arrayList2.add(p.e(view));\n p.a(view, (String) null);\n }\n return arrayList2;\n }", "public void perform() {\n if (valid) {\n if (isUndo) {\n ObjArrayUtil.addItems(itemSlots, this.items, true);\n Editor.setClipboard(savedClipboard);\n } else {\n // undo operation constructs modified items for us\n getUndo();\n Editor.setClipboard(oppOper.items);\n ObjArrayUtil.deleteItems(itemSlots);\n }\n }\n }", "@Override\n\tpublic void redo() {\n\t\tfor (IShape shape : temp) {\n\t\t\tlist.delete(shape);\n\t\t}\n\t}", "private void butEditCategories_Click(Object sender, EventArgs e) throws Exception {\n ArrayList selected = new ArrayList();\n for (int i = 0;i < listCategories.SelectedIndices.Count;i++)\n {\n selected.Add(CatList[listCategories.SelectedIndices[i]].DefNum);\n }\n FormDefinitions FormD = new FormDefinitions(DefCat.ProcCodeCats);\n FormD.ShowDialog();\n DataValid.setInvalid(InvalidType.Defs);\n changed = true;\n fillCats();\n for (int i = 0;i < CatList.Length;i++)\n {\n if (selected.Contains(CatList[i].DefNum))\n {\n listCategories.SetSelected(i, true);\n }\n \n }\n //we need to move security log to within the definition window for more complete tracking\n SecurityLogs.MakeLogEntry(Permissions.Setup, 0, \"Definitions\");\n fillGrid();\n }", "public void updateTempList() {\n if (disableListUpdate == 0) {\n tempAdParts.clear();\n LatLngBounds bounds = mapboxMap.getProjection().getVisibleRegion().latLngBounds;\n iterator = AdParts.listIterator();\n while (iterator.hasNext()) {\n current = iterator.next();\n if (bounds.contains(current.getLatLng())) {\n tempAdParts.add(current);\n }\n }\n AdAdapter adapter = new AdAdapter(MainActivity.this, tempAdParts);\n listView.setAdapter(adapter);\n }\n }", "@Override\n\tpublic void undo() {\n\t\tfor (IShape shape : temp) {\n\t\t\tlist.add(shape);\n\t\t}\n\t}", "@Override\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n if(resultCode == Activity.RESULT_OK && requestCode == REQUEST_CODE_ADD){\n if (data!=null){\n// data = getIntent();\n String returnedBookString = data.getStringExtra(\"returnedBook\");\n Book book = new Book(returnedBookString);\n bookArrayList.add(book);\n\n }\n for(Book books:bookArrayList){\n listLayout.removeAllViews();\n buildItemView(books); }\n }\n\n\n }", "private void update_auxlist(ArrayList<Line> auxlist, Line workingSet) {\n\t\tLine new_working_set = new Line(workingSet);\n\n\t\t// Add the working set copy to the set of maximal lines\n\t\tauxlist.add(new_working_set);\n\t}", "@Override\r\n\tpublic void edit() {\n\t\t\r\n\t}", "public static void main(String args[]) {\n ArrayList al = new ArrayList();\n // add elements to the array list\n al.add(\"C\");\n al.add(\"A\");\n al.add(\"E\");\n al.add(\"B\");\n al.add(\"D\");\n al.add(\"F\");\n\n // Use iterator to display contents of al\n System.out.print(\"Original contents of al: \");\n Iterator itr = al.iterator();\n\n while (itr.hasNext()) {\n Object element = itr.next();\n System.out.print(element + \" \");\n }\n System.out.println();\n\n // Modify objects being iterated\n ListIterator litr = al.listIterator();\n while (litr.hasNext()) {\n Object element = litr.next();\n litr.set(element + \"+\");\n }\n System.out.print(\"Modified contents of al: \");\n itr = al.iterator();\n while (itr.hasNext()) {\n Object element = itr.next();\n System.out.print(element + \" \");\n }\n System.out.println();\n // Now, display the list backwards\n System.out.print(\"Modified list backwards: \");\n\n while (litr.hasPrevious()) {\n Object element = litr.previous();\n System.out.print(element + \" \");\n }\n System.out.println();\n }", "public void updateInterpList(){\n System.out.println(\"updating list\");\n tableVals = FXCollections.observableArrayList();\n for(InterpreterStaff interp: getInterpreterStaff()){\n tableVals.add(new InterpreterTableAdapter(interp));\n }\n InterpInfoTable.setItems(tableVals);\n }", "public void addToList() {\n addToCurrentListButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n //getting the variables from the user input\n String address = enterAddress.getText();\n String issue = enterAddress.getText();\n String model = enterModel.getText();\n //date method\n Date date = new Date();\n //creating a quick CentralAC list\n CentralAC acEntry = new CentralAC(address, issue, date, model);\n //adding items to the Arraylist\n HVACGUI.newCentralAC.add(acEntry);\n //adding items to the default list model\n HVACGUI.openService.addElement(acEntry);\n //disposing the form\n CentralAC_GUI.this.dispose();\n\n\n }\n });\n }", "private void updateUI() {\n /* Making an array of strings to store tasks entered by the user. */\n ArrayList<String> taskList = new ArrayList<>();\n SQLiteDatabase db = OpenDB.getReadableDatabase();\n Cursor cursor = db.query(AccessData.ToDoEntry.table,\n new String[]{AccessData.ToDoEntry._ID, AccessData.ToDoEntry.todo_title},\n null, null, null, null, null);\n while (cursor.moveToNext()) {\n int idx = cursor.getColumnIndex(AccessData.ToDoEntry.todo_title);\n taskList.add(cursor.getString(idx));\n }\n\n /* Check if array adapter is created. */\n if (listAdapter == null) {\n /* If adapter is not created i.e. NULL, create a new adapter */\n listAdapter = new ArrayAdapter<>(this,\n R.layout.todo_item,\n R.id.task_title,\n taskList);\n /* Set the above created adapter as the todoListView adapter */\n todoListView.setAdapter(listAdapter);\n } else {\n /* If created: it is assigned to the todoListView */\n listAdapter.clear(); // clear it\n listAdapter.addAll(taskList); // re-populate it\n listAdapter.notifyDataSetChanged(); // notify view to refresh with new data values\n }\n\n cursor.close();\n db.close();\n }", "public static void main(String args[]){\r\n Object objArray;\r\n \r\n \t Scanner input = new Scanner(System.in);\r\n \t // display on console enter file name\r\n \t System.out.println(\"Enter array list data separated by a comma - for example 1, 2, 3, 4 : \");\r\n\r\n \t input = new Scanner(System.in);\r\n Object arrayListInput = input.nextLine();\r\n \r\n // create instance of class ArrayList.java\r\n \t Arraylist arrayList = new Arraylist();\r\n\r\n \t // load input data into array list object\r\n \t arrayList.loadArrayList(arrayListInput);\r\n\r\n \t // determine if array list object is empty \t \r\n \t boolean arrayListEmpty = arrayList.isEmpty();\r\n \t \r\n \t System.out.println(\"Is the array list empty \" + arrayListEmpty);\r\n \r\n arrayList.add(\"10\"); \r\n \t System.out.println(\"Add object to array list\");\r\n \t \r\n objArray = arrayList.get(5);\r\n \t System.out.println(\"Get object from array list \");\r\n \r\n }", "public static void processArrayList(){\n ArrayList<String> newArray = new ArrayList<String>();\n newArray.addAll(groceryList.getGroceryList()); //Method 1: adds all items from the groceryList into the newArray\n\n ArrayList<String> newArray2 = new ArrayList<String>(groceryList.getGroceryList()); //Method 2: same as method 1 but the copying happens at the time of initialising the newArray2\n\n //if for some reason you want to save all the contents of an arrayList into an array\n String[] myArray = new String[groceryList.getGroceryList().size()]; //create the array to be equal to the size of the arraylist\n myArray = groceryList.getGroceryList().toArray(myArray); //convert an arraylist of strings (the outcome of getGroceryList()), and save it into our array\n }", "private void fillSelectionListFromArrayList(JList aListComponent,ArrayList<String> theList) {\n int[] toBeSelectedIndices = new int[theList.size()];\n int aValueIndex = 0;\n if(theList.size()>0){\n for(String aValue : theList){\n for(int in = 0; in < aListComponent.getModel().getSize();in++){\n String aCorrType = (String)aListComponent.getModel().getElementAt(in);\n if(aValue.equals(aCorrType)){\n toBeSelectedIndices[aValueIndex] = in;\n }\n }\n aValueIndex++;\n }\n aListComponent.setSelectedIndices(toBeSelectedIndices);\n \n }else{\n aListComponent.clearSelection();\n }\n \n }", "private void updateUserList() {\n\t\tUser u = jdbc.get_user(lastClickedUser);\n\t\tString s = String.format(\"%s, %s [%s]\", u.get_lastname(), u.get_firstname(), u.get_username());\n\t\tuserList.setElementAt(s, lastClickedIndex);\n\t}", "private void editTimetable(ArrayList<Subject> timetable, Intent result) {\n\t\tSubject.sortTimetable(timetable, getIntent().getStringExtra(\"semester\"));\n\t\tArrayList<String> ch = new ArrayList<>();\n\t\tch.add(\"\");\n\t\tfor (Subject s : timetable) s.setItems(ch);\n\t\tArrayList<Subject> subjects;\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tsubjects = new ArrayList<>();\n\t\t\tfor (Subject s : timetable) {\n\t\t\t\tif (s.getDay() == i) {\n\t\t\t\t\tsubjects.add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult.putExtra(\"subjects\" + i, subjects);\n\t\t}\n\t}", "public void getOrderedList() {\n\n\t\tFile opFile = new File(\"/home/bridgeit/Desktop/newfile.txt\");\n\t\ttry {\n\t\t\topFile.createNewFile();\n\t\t\tFileWriter fwriter = new FileWriter(opFile);\n\n\t\t\tfor (int i = 0; i < olist.size(); i++) {\n\n\t\t\t\tfwriter.append(olist.returnItem(i) + \" \");\n\n\t\t\t}\n\t\t\tfwriter.close();\n\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "@Override\n public void refreshList() {\n }", "@Override\n\tpublic void acheter(List<Object> la) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tString[] zeug = {\"fußball\",\"Stift\",\"tennisball\",\"lineal\",\"wacken\", \"nille\"};\n\t\tList<String> liste1 = new ArrayList<String>();\n\t\n\t\t//add Array items to list\n\t\t//String Array in Array List reinschreiben\n\t\tfor (String x: zeug) \n\t\tliste1.add(x);\n\t\n\t\t// nochmal String Array und Array List erstellen\n\t\tString[] mehrZeug = {\"Kugelschreiber\", \"geodreieck\",\"fußball\",\"Stift\",\"Keks\",\"tennisball\",\"nille\"};\n\t\tList<String> liste2 = new ArrayList<String>();\n\t\n\t\t// nochmal String Array in Array List reinschreiben\n\t\tfor (String y: mehrZeug)\n\t\tliste2.add(y);\n\t\n\t\t// ausgeben\n\t\t// Liste1 ausgeben. Die Array List\n\t\tSystem.out.println(\"Liste1 vor dem Bearbeiten:\");\n\t\t\n\t\tfor (int i=0; i<liste1.size(); i++) { \n\t\tSystem.out.printf(\"%s \", liste1.get(i));\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println(\"Liste2 zum Vergleich:\");\n\t\tfor (int i=0; i<liste2.size(); i++) { \n\t\t\tSystem.out.printf(\"%s \", liste2.get(i));\n\t\t}\n\t\t\n\t\t\n\t\t// methode listebearbeiten angewendet und liste1 und liste2 als parameter übergeben\n\t\tlistebearbeiten(liste1,liste2);\n\t\tSystem.out.println();\n\t\tSystem.out.println();\n\t\t// liste1 wird nach dem bearbeiten durch die Methode erneut ausgegeben\n\t\tSystem.out.println(\"Liste 1 nach dem bearbeiten:\");\n\t\tfor (int i=0; i<liste1.size(); i++) { \n\t\t\tSystem.out.printf(\"%s \", liste1.get(i));\n\t\t}\n\t\n\t\n\t\n\t}", "private void removeList()\r\n {\n if (tableCheckBinding != null)\r\n {\r\n tableCheckBinding.dispose();\r\n tableCheckBinding = null;\r\n }\r\n\r\n // m_TableViewer.setInput(null);\r\n WritableList newList = new WritableList(SWTObservables.getRealm(Display.getDefault()));\r\n for (int i = 0; i < 10; ++i)\r\n {\r\n newList.add(this.generateNewDataModelItem());\r\n }\r\n m_TableViewer.setInput(newList);\r\n }", "private void setToDoLists(){\n\n ArrayList<String> groceries = new ArrayList<String>();\n groceries.add(\"groceries\");\n groceries.add(\"apples\");\n groceries.add(\"gogurts\");\n groceries.add(\"cereal\");\n groceries.add(\"fruit roll ups\");\n groceries.add(\"lunch meat\");\n groceries.add(\"milk\");\n groceries.add(\"something for dessert\");\n groceries.add(\"steak\");\n groceries.add(\"milksteak\");\n groceries.add(\"cookies\");\n groceries.add(\"brewzongs\");\n\n ArrayList<String> bills = new ArrayList<String>();\n bills.add(\"bills\");\n bills.add(\"car loan\");\n bills.add(\"cable\");\n bills.add(\"rent\");\n\n ArrayList<String> emails = new ArrayList<String>();\n emails.add(\"emails\");\n\n ArrayList<ArrayList<String>> tmpMyList;\n tmpMyList = new ArrayList<ArrayList<String>>();\n\n tmpMyList.add(groceries);\n tmpMyList.add(bills);\n tmpMyList.add(emails);\n\n myList = tmpMyList;\n\n }", "private static void testAdd(ArrayList list, int[] content) {\n System.out.print(\"Adding to the list: \");\n for (int index = 0; index < content[index]; index++) {\n list.addToEnd(content);\n } // end for\n System.out.println();\n displayList(list);\n }", "private void resize() {\n int listSize = numItemInList();\n //debug\n //System.out.println(\"resize: \" + nextindex + \"/\" + list.length + \" items:\" + listSize);\n if (listSize <= list.length / 2) {\n for (int i = 0; i < listSize; i++) {\n list[i] = list[startIndex + i];\n }\n } else {\n Object[] newList = new Object[this.list.length * 2];\n\n// System.arraycopy(this.list, startIndex, newList, 0, this.list.length-startIndex);\n for (int i = 0; i < listSize; i++) {\n newList[i] = list[i + startIndex];\n }\n this.list = newList;\n //debug\n //System.out.println(\"After resize:\" + nextindex + \" / \" + list.length + \" items:\" + numItemInList());\n }\n nextindex = nextindex - startIndex;\n startIndex = 0;\n }", "public final int a(ArrayList<com.tencent.mm.plugin.wenote.model.a.c> arrayList, int i, int i2, int i3, int i4) {\n AppMethodBeat.i(26743);\n if (arrayList == null || arrayList.size() <= 0 || this.iPr == null || i2 < 0 || i3 < 0 || i4 < 0 || i4 < i3) {\n ab.e(\"MicroMsg.Note.NoteDataManager\", \"pasteItemList,error,return\");\n AppMethodBeat.o(26743);\n return -1;\n } else if (com.tencent.mm.plugin.wenote.model.c.ddG().uMN == null) {\n ab.e(\"MicroMsg.Note.NoteDataManager\", \"pasteItemList, but get wnnote base is null, return\");\n AppMethodBeat.o(26743);\n return -1;\n } else {\n com.tencent.mm.plugin.wenote.model.a.c cVar = (com.tencent.mm.plugin.wenote.model.a.c) arrayList.get(arrayList.size() - 1);\n if (cVar == null) {\n ab.e(\"MicroMsg.Note.NoteDataManager\", \"pasteItemList, lastInsertItem is null\");\n AppMethodBeat.o(26743);\n return -1;\n }\n cVar.uNV = -1;\n cVar.uNT = true;\n cVar.uNZ = false;\n com.tencent.mm.plugin.wenote.model.a.c Ke = Ke(i2);\n if (Ke == null) {\n ab.e(\"MicroMsg.Note.NoteDataManager\", \"pasteItemList, item is null\");\n AppMethodBeat.o(26743);\n return -1;\n }\n synchronized (this) {\n try {\n deq();\n boolean z;\n int i5;\n int i6;\n int i7;\n if (i == 0 && Ke.getType() == 1) {\n Spanned ahb = com.tencent.mm.plugin.wenote.model.nativenote.a.a.ahb(((i) Ke).content);\n if (ahb == null || i3 > ahb.length() || i4 > ahb.length()) {\n String str = \"MicroMsg.Note.NoteDataManager\";\n String str2 = \"pasteItemList error, oriText:%d startOff:%d endOff:%d\";\n Object[] objArr = new Object[3];\n objArr[0] = Integer.valueOf(ahb == null ? -1 : ahb.length());\n objArr[1] = Integer.valueOf(i3);\n objArr[2] = Integer.valueOf(i4);\n ab.e(str, str2, objArr);\n } else {\n CharSequence subSequence = ahb.subSequence(0, i3);\n CharSequence subSequence2 = ahb.subSequence(i4, ahb.length());\n String a = com.tencent.mm.plugin.wenote.model.nativenote.a.b.a((Spanned) subSequence);\n String a2 = com.tencent.mm.plugin.wenote.model.nativenote.a.b.a((Spanned) subSequence2);\n i iVar = (i) Ke;\n if (!bo.isNullOrNil(a)) {\n iVar.content = a.endsWith(\"<br/>\") ? a.substring(0, a.length() - 5) : a;\n i2++;\n if (!bo.isNullOrNil(a2)) {\n Ke = new i();\n Ke.type = 1;\n if (a2.startsWith(\"<br/>\")) {\n a2 = a2.substring(5, a2.length());\n }\n Ke.content = a2;\n Ke.uNV = 0;\n Ke.uNT = false;\n Ke.uNZ = false;\n b(i2, Ke);\n z = true;\n i5 = i2;\n i6 = i2;\n }\n z = false;\n i5 = i2;\n i6 = i2;\n } else if (bo.isNullOrNil(a2)) {\n Kf(i2);\n if (this.uPa != null) {\n this.uPa.JZ(i2);\n }\n z = false;\n i5 = i2;\n i6 = i2;\n } else {\n if (a2.startsWith(\"<br/>\")) {\n a2 = a2.substring(5, a2.length());\n }\n iVar.content = a2;\n z = false;\n i5 = i2;\n i6 = i2;\n }\n Iterator it = arrayList.iterator();\n while (it.hasNext()) {\n cVar = (com.tencent.mm.plugin.wenote.model.a.c) it.next();\n b(cVar);\n if (b(i6, cVar)) {\n i7 = i6 + 1;\n } else {\n i7 = i6;\n }\n i6 = i7;\n }\n }\n } else {\n if (i != 1) {\n i5 = i2 + 1;\n } else {\n i5 = i2;\n }\n Iterator it2 = arrayList.iterator();\n i6 = i5;\n while (it2.hasNext()) {\n cVar = (com.tencent.mm.plugin.wenote.model.a.c) it2.next();\n b(cVar);\n if (b(i6, cVar)) {\n i7 = i6 + 1;\n } else {\n i7 = i6;\n }\n i6 = i7;\n }\n z = false;\n }\n } finally {\n while (true) {\n }\n AppMethodBeat.o(26743);\n }\n }\n }\n return -1;\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (resultCode == RESULT_OK && requestCode == REQUEST_CODE) {\n\n int position = data.getExtras().getInt(\"editPos\");\n\n Task task = items.get(position);\n task.taskName = data.getExtras().getString(\"updatedText\");\n\n if (DEBUG) {\n Toast.makeText(this, task.taskName, Toast.LENGTH_SHORT).show();\n }\n\n db.updateTask(task);\n\n items.remove(position);\n items.add(position, task);\n\n taskAdapter.notifyDataSetChanged();\n }\n }", "public void refresh(ArrayList pNewList) {\n listLivingBeings.setListData(pNewList.toArray());\n if (!pNewList.isEmpty()) {\n listLivingBeings.setSelectedIndex(0);\n }\n }", "private void rewriteLocationList(List<Location> newLocationList) {\n Log.d(\"debugMode\", \"writing new contents\");\n for (Location location : newLocationList) {\n String line = \"\\n\" + location.returnFull();\n byte[] bytes = line.getBytes();\n\n FileOutputStream out;\n try {\n Log.d(\"debugMode\", location.returnFull());\n out = openFileOutput(\"Locations.txt\", MODE_APPEND);\n out.write(bytes);\n out.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }", "public void getList() {\n\n\t\tFile opFile = new File(\"/home/bridgeit/Desktop/newfile.txt\");\n\t\ttry {\n\t\t\topFile.createNewFile();\n\t\t\tFileWriter fwriter = new FileWriter(opFile);\n\n\t\t\tfor (int i = 0; i < slist.size(); i++) {\n\n\t\t\t\tfwriter.append(slist.returnItem(i) + \" \");\n\n\t\t\t}\n\t\t\tfwriter.close();\n\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "@Override\n\tpublic void redo() {\n\t\tthis.list.add(shape);\n\n\t}", "protected abstract void editItem();", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tArrayList <String> cars = new ArrayList <String>();\n\t\t cars.add(\"Nissan\");\n\t\t cars.add(\"Mustang\");\n\t\t cars.add(\"BMW\");\n\t\t cars.add(\"Merc.Benz\");\n\t\t cars.add(\"Honda\");\n\t\t cars.add(\"Toyota\");\n\t\t\n\t\t System.out.println(cars);\n\t\t \n\t//\t System.out.println(cars.size());//here I use size method to get ArrayList size\n\t//\t System.out.println(cars.remove(1));\n\t\t cars.set(0, \"Jaguar\");\n\t\t System.out.println(cars.set(0, \"Jaguar\"));\n\t\t// System.out.println(cars);\n\t\t \n\t\t\n\t\t\n\t//\t System.out.println(cars.get(2));// here I use get method to get that index element\n\t\t\n\t\t \n\t\t/* cars.remove(3);//here I use remove method to remove an item from ArrayList\n\t\t System.out.println(cars);\n\t\t\n\t\tcars.add(\"Lexus\");*/\n\t\t \n\t\t //first to last element print\n\t/*\t for (int j=0;j<cars.size();j++)\n\t\t\t{\n\t\t\t\t\tSystem.out.println(cars.get(j));\n\t\t\t}\n\t\t System.out.println(cars.size());\n\t\t\n\t\t \n\t\t cars.set(0,\"Jaguar\");\n\t\t System.out.println(cars);\n\t\t \n\t\t\n\t\t\n\t\t \n\t\t//last to first element print\n\t\t for (int k=cars.size()-1;k>=0;k--)\n\t\t\t{\n\t\t\t\t\tSystem.out.println(cars.get(k));\n\t\t\t}\n\t\t\t\n\t\t \n\t\t \n\t/*\t \n\t\t\tArrayList <Integer> even = new ArrayList <Integer>();\n\t\t\n\t\teven.add(2);\n\t\teven.add(4);\n\t\teven.add(6);\n\t\teven.add(8);\n\t\teven.add(10);\n\t\tSystem.out.println(even.get(4));\n\t\t\n\t\t\n\t\tSystem.out.println(even);\n\t\t//access an item\n\t\t\n\t\tSystem.out.println(even.get(1));\n\t\t\t\n\t\t */\n\t\t \n\t\t \n\t\t\n\t\t \n\n\t}", "public void run(){\n\t\t\t\tupdateList();\r\n\t\t\t}", "public void editOperation() {\n\t\t\r\n\t}", "private void updateUI() {\n ArrayList<String> taskList = new ArrayList<>();\n SQLiteDatabase db = mHelper.getReadableDatabase();\n Cursor cursor = db.query(Task.TaskEntry.TABLE,new String[] {Task.TaskEntry.COL_TASK_TITLE},null,null,null,null,null);\n listItems.clear();\n\n while (cursor.moveToNext()){\n int index = cursor.getColumnIndex(Task.TaskEntry.COL_TASK_TITLE);\n taskList.add(cursor.getString(index));\n ListItems item = new ListItems(cursor.getString(index));\n listItems.add(item);\n }\n\n\n R_adapter = new RecyclerAdapterGoals(this.getContext(), listItems);\n mTaskListView.setAdapter(R_adapter);\n cursor.close();\n db.close();\n }", "static void editDetails(int index, List<String> data){\n people.get(index).setFirstName(data.get(0));\n people.get(index).setLastName(data.get(1));\n people.get(index).setHeight(Short.parseShort(data.get(2)));\n people.get(index).setWeight(Double.parseDouble(data.get(3)));\n people.get(index).setBirthDate(LocalDate.of(\n Integer.parseInt(data.get(4)),\n Integer.parseInt(data.get(5)),\n Integer.parseInt(data.get(6))));\n people.get(index).setSex(checkSex(data.get(7)));\n people.get(index).setPosition(data.get(8));\n people.get(index).setHireDate(LocalDate.of(\n Integer.parseInt(data.get(9)),\n Integer.parseInt(data.get(10)),\n Integer.parseInt(data.get(11))));\n ;\n }", "public void buildList(ArrayList<String> arrayList) {\n\t\t// write your code for buildList using the specification above\n\t\tfor(int counter=arrayList.size()-1; counter >= 0 ; counter--){\n\t\t\tString temp = arrayList.get(counter);\n\t\t\tadd(temp);\n\t\t}\n\t}", "@Override\n public void update(ArrayList<League> leagues) {\n\n }", "void updateList() throws Exception {\n\t\tlist.getItems().clear();\n\t\tfor(Plant p : plantsInBasket) {\n\t\t\tAnchorPane ap = new AnchorPane();\n\t\t\tLabel sname = new Label(p.getScientificName() + \" |\");\n\t\t\tLabel cname = new Label(p.getCommonName());\n\t\t\tsname.setFont(Font.loadFont(getClass().getResourceAsStream(\"/fonts/Roboto-Italic.ttf\"), 21));\n\t\t\tcname.setFont(Font.loadFont(getClass().getResourceAsStream(\"/fonts/Roboto-Italic.ttf\"), 21));\n HBox hBox = new HBox();\n hBox.setAlignment(Pos.CENTER_LEFT);\n \n \t\tImageView iv = new ImageView();\n \t\tiv.setImage(p.getPlantPic());\n \t\tiv.setPreserveRatio(true);\n \t iv.setFitHeight(PLANT_WD_HT);\n \t iv.setFitWidth(PLANT_WD_HT);\n \n \t Tooltip tooltip = new Tooltip(\"Common Name: \" + p.getCommonName() + System.lineSeparator()\n \t\t+ \"Spread: \" + p.getSpread() + \" ft.\" + System.lineSeparator() + \n \t\t\"Soil type: \" + p.getSoilType() + System.lineSeparator() +\n \t\t\"Sun level: \" + p.getSun() + System.lineSeparator() + \n \t\t\"Moisture: \" + p.getMoisture() + System.lineSeparator() +\"Lep Species Supported: \" + p.getLep().getNumLeps() + System.lineSeparator() +\n \t\t\"Most common lep: \" + p.getLep().getSpecies());\n \t ImageView ivLep = new ImageView(p.getLepPic());\n \t ivLep.setFitHeight(LEP_WD_HT);\n \t ivLep.setFitWidth(LEP_WD_HT);\n \t tooltip.setGraphic(ivLep);\n \t tooltip.setPrefWidth(TOOLTIP_SIZE);\n \n \t tooltip.setWrapText(true);\n \t Tooltip.install(iv, tooltip);\n // Add the values from our piece to the HBox\n hBox.getChildren().addAll(iv, sname, cname);\n \n \tImageView compost = new ImageView(new Image(getClass().getResourceAsStream(\"/img/compost.png\")));\n \tcompost.setFitHeight(COMPOST_SIZE);\n compost.setFitWidth(COMPOST_SIZE);\n \n Button b = new Button();\n b.setGraphic(compost);\n b.setStyle(\"-fx-background-color: #99B898;\");\n \n ap.getChildren().addAll(hBox, b);\n AnchorPane.setLeftAnchor(hBox, root.getWidth() / 3);\n AnchorPane.setRightAnchor(b, COMPOST_RIGHT);\n AnchorPane.setTopAnchor(b, COMPOST_TOP);\n \n b.setOnAction(e -> {\n \ttry {\n\t\t\t\t\tView.getGarden().removeFromBasket(p);\n\t\t\t\t\tupdateList();\n\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n \t\n \t\n });\n list.getItems().add(ap);\n\t\t}\n\t}", "public void display(boolean editing, ArrayList<ArrayList<Object>> grupos, String idAsignatura) {\n currentAsignatura = idAsignatura;\n if (editing) {\n currentGrupos = grupos;\n System.out.println(grupos);\n\n listview.getItems().clear();\n Integer i = 1;\n for (ArrayList<Object> g: grupos) {\n String idG = (String)g.get(0);\n ArrayList<ArrayList<Object>> subgr = (ArrayList<ArrayList<Object>>)g.get(1);\n for (ArrayList<Object> sg : subgr) {\n listview.getItems().add(idG + sg.get(0) + \" \" + sg.get(2));\n }\n }\n listview.getSelectionModel().selectedItemProperty().removeListener(grSelected);\n listview.getSelectionModel().selectedItemProperty().addListener(grSelected);\n } else {\n currentGrupos = new ArrayList<>();\n }\n idGadd.getItems().clear();\n idGadd.setItems(FXCollections.observableArrayList(\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"));\n idSadd.getItems().clear();\n idSadd.setItems(FXCollections.observableArrayList(\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"));\n\n rbTadd.setOnAction( e -> setRadioButtons(\"Tadd\"));\n rbPadd.setOnAction( e -> setRadioButtons(\"Padd\"));\n rbLadd.setOnAction( e -> setRadioButtons(\"Ladd\"));\n rbTedit.setOnAction( e -> setRadioButtons(\"Tedit\"));\n rbPedit.setOnAction( e -> setRadioButtons(\"Pedit\"));\n rbLedit.setOnAction( e -> setRadioButtons(\"Ledit\"));\n }", "public void updateList(List<?> listOfObjects){\n this.radioObjects = listOfObjects;\n }", "public static void finaliseEdit() throws IOException {\r\n //Creating scanner object and reading the file\r\n Scanner s = new Scanner(new File(\"output.txt\"));\r\n Scanner sc2 = new Scanner(System.in);\r\n //Empty string to append the lines of the file to\r\n String lines = \"\";\r\n //While loop to append lines of file to empty string\r\n while (s.hasNext()) {\r\n lines += s.nextLine();\r\n }\r\n //Creating array by splitting the string by \"#\" which will be written in when a project is added\r\n String[] lineArr = lines.split(\"#\");\r\n //Creating arraylist and appending lines from array with while loop\r\n List<String> inLines = Arrays.asList(lineArr);\r\n while (s.hasNextLine()) {\r\n inLines.add(s.nextLine());\r\n }\r\n s.close();\r\n //For loop to split array by \", \"\r\n for (int i = 0; i < lineArr.length; i++) {\r\n String[] projectInfo = lineArr[i].split(\", \");\r\n //Prompting the user to enter a number to select a project to finalise\r\n System.out.println(\"Enter index number of task to finalise: \\ne - Exit\");\r\n int proSelect = sc2.nextInt();\r\n //Opening the file and creating a bufferedwriter object\r\n FileWriter writer = new FileWriter(\"output.txt\",false);\r\n BufferedWriter buffer = new BufferedWriter(writer);\r\n //The project gets selected by the user entering a number to select. That number will be subtracted by 1 to get the correct index of the selected project\r\n String selectedProj = inLines.get(proSelect - 1);\r\n //Creating array by splitting the string\r\n String[] selectedProjarr = selectedProj.split(\", \");\r\n //Changing the value of the index\r\n selectedProjarr[21] = \"finalised\";\r\n //Creating a string from the edited array\r\n String projLinestr = Arrays.toString(selectedProjarr);\r\n //Replacing the selected project in the arraylist with the string of the edited project\r\n inLines.set(proSelect - 1 , projLinestr);\r\n //For loop to write the arraylist to file. I got this method from https://stackoverflow.com/questions/6548157/how-to-write-an-arraylist-of-strings-into-a-text-file/6548204\r\n for(String str:inLines) {\r\n buffer.write((str + \"#\\n\"));\r\n }\r\n buffer.close();\r\n //Reading integers from file to calculate amount to be paid\r\n String feeStr = selectedProjarr[5];\r\n int feeINT = Integer.valueOf(feeStr);\r\n String ptdStr = selectedProjarr[6];\r\n int ptdInt = Integer.valueOf(ptdStr);\r\n int tobePaid = feeINT - ptdInt;\r\n //If there still is money to be payed when a project gets finalised, an invoice will be created, if all fees are paid, no invoive will be made\r\n if (tobePaid != 0) {\r\n //Opening the file and creating buffered writer to write to the file\r\n FileWriter writer2 = new FileWriter(\"invoice.txt\");\r\n BufferedWriter buffer2 = new BufferedWriter(writer2);\r\n //Writing to the file\r\n buffer2.write(\"Customer name: \" + selectedProjarr[12] + \" \" + selectedProjarr[13] + \"\\n\");\r\n buffer2.write(\"Customer tel number: \" + selectedProjarr[14] + \"\\n\");\r\n buffer2.write(\"Customer email: \" + selectedProjarr[15] + \"\\n\");\r\n buffer2.write(\"Customer address: \" + selectedProjarr[16] + \"\\n\");\r\n buffer2.write(\"Amount to be paid: \" + \"R\" + tobePaid);\r\n buffer2.close();\r\n System.out.println(\"Project has been finalised and invoice was created.\");\r\n }\r\n else\r\n {\r\n System.out.println(\"Total amount has been paid, invoice was not created.\\nProject was finalised.\");\r\n }\r\n //Opening file and creating buffered writer object to write to the completed projects file\r\n FileWriter writer3 = new FileWriter(\"completedProject.txt\");\r\n BufferedWriter buffer3 = new BufferedWriter(writer3);\r\n //Writing the project info to the file\r\n buffer3.write(\"Project name: \" + selectedProjarr[0] + \"\\n\");\r\n buffer3.write(\"Project number: \" + selectedProjarr[1] + \"\\n\");\r\n buffer3.write(\"Building type: \" + selectedProjarr[2] + \"\\n\");\r\n buffer3.write(\"Address: \" + selectedProjarr[3] + \"\\n\");\r\n buffer3.write(\"ERF Number: \" + selectedProjarr[4] + \"\\n\");\r\n buffer3.write(\"Fee: \" + \"R\" + selectedProjarr[5] + \"\\n\");\r\n buffer3.write(\"Amount paid to date: \" + \"R\" + selectedProjarr[6] + \"\\n\");\r\n buffer3.write(\"Due date: \" + selectedProjarr[7] + \"\\n\");\r\n //Creating date format to get the current date\r\n DateTimeFormatter dtf = DateTimeFormatter.ofPattern(\"dd/MM/yyyy\");\r\n LocalDateTime now = LocalDateTime.now();\r\n buffer3.write(\"Date completed: \" + dtf.format(now) + \"\\n\");\r\n //Writing Contractor information\r\n buffer3.write(\"Contractor name: \" + selectedProjarr[8] + \"\\n\");\r\n buffer3.write(\"Contractor tel number: \" + selectedProjarr[9] + \"\\n\");\r\n buffer3.write(\"Contractor email: \" + selectedProjarr[10] + \"\\n\");\r\n buffer3.write(\"Contractor address: \" + selectedProjarr[11] + \"\\n\");\r\n //Writing Customer information\r\n buffer3.write(\"Customer name: \" + selectedProjarr[12] + \" \" + selectedProjarr[13] + \"\\n\");\r\n buffer3.write(\"Customer tel number: \" + selectedProjarr[14] + \"\\n\");\r\n buffer3.write(\"Customer email: \" + selectedProjarr[15] + \"\\n\");\r\n buffer3.write(\"Customer address: \" + selectedProjarr[16] + \"\\n\");\r\n //Writing Architect information\r\n buffer3.write(\"Architect name: \" + selectedProjarr[17] + \"\\n\");\r\n buffer3.write(\"Architect tel numbert: \" + selectedProjarr[18] + \"\\n\");\r\n buffer3.write(\"Architect email: \" + selectedProjarr[19] + \"\\n\");\r\n buffer3.write(\"Architect address: \" + selectedProjarr[20] + \"\\n\");\r\n buffer3.close();\r\n break;\r\n }\r\n }", "private void UpdateTagsList()\r\n\t{ \r\n\t\t // for every element in our checkboxes from the view array\r\n\t\t for (CheckBox checkBox : this.CBlist) \r\n\t\t {\r\n\t\t\t // if it is checked\r\n\t\t\t if(checkBox.isChecked())\r\n\t\t\t {\r\n\t\t\t\t // Update the values on the local indication array\r\n\t\t\t\t hmTags.put(checkBox.getText().toString(), true);\r\n\t\t\t }\r\n\t\t }\t\t\t\r\n\t}", "public void editContact() {\n int match = -1;\n Scanner sc = new Scanner(System.in);\n System.out.println(\"enter first name of person whose contact details you wants to edit\");\n String name = sc.nextLine();\n Contact contactToBeEdited = contactList.get(0);\n System.out.println(contactList.get(0));\n\n for (int j = 0; j < contactList.size(); j++) {\n Contact conMatch = contactList.get(j);\n System.out.println(conMatch.getFirstName());\n if (name.equals(conMatch.getFirstName())) {\n match = j;\n contactToBeEdited = contactList.get(match);\n\n } else {\n System.out.println(\"no contact with this first name \");\n }\n\n }\n\n if (match != -1) {\n\n System.out.print(\" what you want to edit : \"\n + \"\\n1. Zip Code\" + \"\\n2. First Name\" + \"\\n3 Last Name\" + \"\\n4. Address\"+ \"\\n5. City\" + \"\\n6. State\"\n\n + \"\\n7. Phone Number\" + \"\\n8. Email\");\n\n int option = sc.nextInt();\n sc.nextLine(); // catches the new line character\n\n switch (option) {\n case 1:\n System.out.println(\"enter new zip code\");\n String newZipCode = sc.nextLine();\n contactToBeEdited.setZip(newZipCode);\n break;\n\n case 2:\n System.out.println(\"enter new first name\");\n String newFirstName = sc.nextLine();\n contactToBeEdited.setFirstName(newFirstName);\n break;\n\n case 3:\n System.out.println(\"enter new last name\");\n String newLastName = sc.nextLine();\n contactToBeEdited.setFirstName(newLastName);\n break;\n\n case 4 :\n System.out.println(\"enter new street address\");\n String address = sc.nextLine();\n contactToBeEdited.setAddress(address);\n break;\n\n\n\n case 5:\n System.out.println(\"enter new city name\");\n String newcityName = sc.nextLine();\n contactToBeEdited.setCity(newcityName);\n break;\n\n case 6:\n System.out.println(\"enter new state name\");\n String newStateName = sc.nextLine();\n contactToBeEdited.setState(newStateName);\n break;\n\n\n case 7:\n System.out.println(\"enter new phone number\");\n String newPhoneNumber = sc.nextLine();\n contactToBeEdited.setPhone(newPhoneNumber);\n break;\n\n case 8:\n System.out.println(\"enter new email address\");\n String newEmailAddress = sc.nextLine();\n contactToBeEdited.setEmail(newEmailAddress);\n break;\n\n default:\n System.out.println(\"choice does not exist\");\n\n }\n\n\n }\n\n }", "public ModificationList(ArrayList aFModStringArrayList, ArrayList aVModStringArrayList, String aFixedModifications_ParameterSection) {\n generateVModVector(aVModStringArrayList);\n if (aFixedModifications_ParameterSection != null) {\n generateFModVector(aFixedModifications_ParameterSection);\n }\n }", "public void updateJList() {\n list.setModel(toListModel(auctionItemList));\n }", "public static void main(String[] args) {\n\t\tArrayList<String> al=new ArrayList<String>();\n\n\t\tal.add(\"suraj\");\n\t\tal.add(\"rohit\");\n\t\tal.add(\"virat\");\n\t\tal.add(\"suhas\");\n\t\tSystem.out.println(al);\n\t\tal.add(1, \"adi\");\n\t\tSystem.out.println(al);\n\t\tSystem.out.println(al.get(3));\n\t\t//sets new data into list\n al.set(1,\"prakash\");\n \t\tSystem.out.println(al);\n \t\t//check given content in list\n System.out.println(al.contains(\"adi\"));\n\t\t\n\t\tArrayList<String> al1=new ArrayList<String>();\n\t\tal1.add(\"atul\");\n\t\tSystem.out.println(al1);\n\t\tal1.addAll(al);\n\t\tSystem.out.println(al1);\n\n\t\t/*System.out.println(\"------------Iterator------------\");\n\t\tIterator<String> it=al1.iterator();\n\t\twhile(it.hasNext()){\n\t\t\tSystem.out.println(it.next()+\"\\t\");\n\t\t}*/\n\t\t\n\t\t\n\t\tfor(String s:al1){\n\t\t\tSystem.out.println(s+\"\\t\");\n\t\t}\n\t\t\n\t\t\n\n\t\t\n\t\t\n \n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public void setCurrentListToBeUndoneList();", "void addLaptop(ArrayList list){\n System.out.println(\"Enter ID\");\r\n int id = sc.nextInt();\r\n System.out.println(\"Enter ram size\");\r\n int ram = sc.nextInt();\r\n System.out.println(\"Enter HDD size\");\r\n int hdd = sc.nextInt();\r\n sc.nextLine();\r\n System.out.println(\"Enter brand name\");\r\n String brand = sc.nextLine();\r\n \r\n \r\n int idVal = 1;\r\n for (Object obj : list) {\r\n //Checking for valid id\r\n if(((Laptop)obj).getId() == id){\r\n idVal = 0;\r\n break;\r\n }\r\n }\r\n if (idVal == 1) {\r\n //adding a new element/row in the existing list\r\n list.add(new Laptop(id, ram, hdd, brand));\r\n System.out.println(\"Element added successfully!\");\r\n } else {\r\n System.out.println(\"Entered id already exist!\");\r\n }\r\n\r\n }", "public void actionPerformed(ActionEvent e) {\n\t\tString allTags = this.textArea.getText().trim();\n\t\t\n\t\tif (allTags.equals(\"\")) {\n\t\t\tToolkit.getDefaultToolkit().beep();\n\t\t\tJOptionPane.showMessageDialog(null, \"Please enter a non-empty tag.\");\n\t\t\ttextArea.requestFocusInWindow();\n\t\t\ttextArea.selectAll();\n\t\t\treturn;\n\t\t} else if (allTags.indexOf(\"@\") != -1) {\n\t\t\tToolkit.getDefaultToolkit().beep();\n\t\t\tJOptionPane.showMessageDialog(null, \"Tag should not contain '@' character, please re-enter.\");\n\t\t\ttextArea.requestFocusInWindow();\n\t\t\ttextArea.selectAll();\n\t\t\ttextArea.setText(\"\");\n\t\t\treturn;\n\t\t} \n\t\t\n\t\t// The user provided a valid tag(s). Adds the tag(s) to this photo.\n\t\telse {\n\t\t\tList<String> tagsList = Arrays.asList(allTags.split(\",\"));\n\t\t\tfor (String tagEntered: tagsList) {\n\t\t\t\tif (!tagEntered.trim().equals(\"\") && !thisListModel.contains(tagEntered.trim())) {\n\t\t\t\t\tTag newTag = TagManager.findTag(tagEntered.trim());\n\t\t\t\t\tif (newTag == null) {\n\t\t\t\t\t\tnewTag = new Tag(tagEntered.trim());\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tString tagName = tagEntered.trim();\n\t\t\t\t\t\tthis.photo.addTag(newTag);\n\t\t\t\t\t\tthisListModel.addElement(tagName);\n\t\t\t\t\t\tif (!allListModel.contains(tagName)) {\n\t\t\t\t\t\t\tallListModel.addElement(tagName);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (IOException a) {\n\t\t\t\t\t\ta.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tJOptionPane.showMessageDialog(null, \"Done adding tags to \" + photo.getName());\n\t\t\tJOptionPane.showMessageDialog(null, this.photo.printTags());\n\t\t}\n\t\t\n\t\t// Resets the text field.\n\t\tint index = thisList.getSelectedIndex();\n textArea.requestFocusInWindow();\n\t\ttextArea.setText(\"\");\n \n\t\t// Updates the revert options only if this tag is new.\n String date = this.photo.getLastModifiedDate();\n System.out.println(this.photo.getName());\n boolean alreadyAdded = false;\n for (int i=0; i<revertOptions.getItemCount(); i++) {\n String menuText = date + \"--> (Added Tag) \" + this.photo.getRenamingHistory().get(this.photo.getLastModifiedDate()).getName();\n \tif (revertOptions.getItem(i).getText().equals(menuText)) {\n \t\tlogger.log(Level.FINE, \"menuItem: \" + revertOptions.getItem(i).getName());\n \t\talreadyAdded = true;\n \t}\n }\n if (!alreadyAdded) {\n \tJMenuItem newMenuItem = new JMenuItem(date + \"--> (Added Tag) \" + this.photo.getRenamingHistory().get(date).getName());\n \t\trevertOptions.add(newMenuItem);\n \t\tActionListener revertBackToDate = new RevertListener(photo, date, revertOptions, thisListModel,\n \t\t\t\tallListModel, thisList, allList, photoFrame, imageNameIndicator);\n \t\tnewMenuItem.addActionListener(revertBackToDate);\n \t\t\n \t\t// Updates JFrame to add the new revert options.\n photoFrame.getContentPane().validate();\n \t\tphotoFrame.getContentPane().repaint();\n }\n //updates the photo's name on Photo Editing window.\n imageNameIndicator.setText(TEXT_SEPARATOR + this.photo.getName() + TEXT_SEPARATOR);\n\t}", "public void updateItemList(SegmentType formType, SegmentType elementType, int elementIdList) {\n switch (formType) {\n case Change:\n switch (elementType) {\n case Artifact:\n for (Change segment : dataModel.getChanges()) {\n editChangeArtifact(segment, elementIdList);\n\n }\n }\n break;\n case Configuration:\n switch (elementType) {\n case Committed_Configuration:\n for (Configuration segment : dataModel.getConfigurations()) {\n editConfigurationCommittedConfiguration(segment, elementIdList);\n }\n }\n case Phase:\n switch (elementType) {\n case Configuration:\n for (Phase segment : dataModel.getPhases()) {\n editPhaseConfiguration(segment, elementIdList);\n }\n break;\n }\n break;\n case Iteration:\n switch (elementType) {\n case Configuration:\n for (Iteration segment : dataModel.getIterations()) {\n editIterationConfiguration(segment, elementIdList);\n }\n break;\n }\n break;\n default:\n }\n\n }", "private void fillList(JList aListComponent,ArrayList<String> theList) {\n DefaultListModel itsModel = new DefaultListModel();\n aListComponent.setModel(itsModel);\n for(String anItem : theList){\n itsModel.addElement(anItem);\n }\n aListComponent.setModel(itsModel);\n }", "@Override\n public void onDone(boolean state, ArrayList<Ingredient> list) {\n Log.i(\"AddDinnerActivity\", \"Got list from fragment: \" + list.toString());\n if (state) {\n ingredientList = new ArrayList<>();\n ingredientList = list;\n Log.d(TAG, \"Updated ingredientList from fragment \" + ingredientList);\n updateAdapter();\n }\n }", "private void updateList(int colNum) {\n TableColumn column = this.dataTable.getColumnModel().getColumn(colNum);\n String header = column.getHeaderValue().toString();\n ArrayList<String> currentList = null;\n \n //More ugliness... should be one entry here for every private list member above\n if(header.equals(\"employee_first_name\")) currentList = employee_first_name;\n else if(header.equals(\"employee_last_name\")) currentList = employee_last_name;\n else if(header.equals(\"employee_middle_initial\")) currentList = employee_middle_initial;\n else if(header.equals(\"employee_ssn\")) currentList = employee_ssn;\n else if(header.equals(\"employee_address\")) currentList = employee_address;\n else if(header.equals(\"employee_address2\")) currentList = employee_address2;\n else if(header.equals(\"employee_city\")) currentList = employee_city;\n else if(header.equals(\"employee_state\")) currentList = employee_state;\n else if(header.equals(\"employee_zip\")) currentList = employee_zip;\n else if(header.equals(\"employee_phone\")) currentList = employee_phone;\n else if(header.equals(\"employee_phone2\")) currentList = employee_phone2;\n else if(header.equals(\"employee_pager\")) currentList = employee_pager;\n else if(header.equals(\"employee_cell\")) currentList = employee_cell;\n else if(header.equals(\"employee_email\")) currentList = employee_email;\n else if(header.equals(\"employee_birthdate\")) currentList = employee_birthdate;\n else if(header.equals(\"employee_hire_date\")) currentList = employee_hire_date;\n \n if(currentList == null)\n return;\n \n for(int i = 0; i < this.dataTable.getRowCount(); i++) {\n currentList.add(this.dataTable.getModel().getValueAt(i, colNum).toString());\n }\n }", "public ModificationList(ArrayList aFModStringArrayList, ArrayList aVModStringArrayList) {\n generateVModVector(aVModStringArrayList);\n generateFModVector(aFModStringArrayList);\n }", "public void put_The_Details_Of_Store_Two_On_GUI()\n\t{\n\t\t/* The Expected ArrayList<Object> --->\n\t\t * Index 0 = Second Store ID \n\t\t * Index 1 = Quarter Report - Second Store \n\t\t * Index 2 = Quantity Of Order - Second Store\n\t\t * Index 3 = Type Of Product In Order - Second Store\n\t\t * Index 4 = Quantity Of Each Product Type In Order - Second Store\n\t\t * Index 5 = The Revenue Of Store - Second Store\n\t\t * Index 6 = The Number Of Complaint - Second Store\n\t\t * Index 7 = Number Of Client That Fill Survey - Second Store\n\t\t * Index 8 = Total Average Of Survey Answer - Second Store \n\t\t * */\n\t\tthis.txtStoreID_2.setText(String.valueOf(CompanyManagerUI.Object_From_Comparing_For_Store_2.get(0)));\n\t\tthis.txtNumOfQuarter_2.setText(String.valueOf(CompanyManagerUI.Object_From_Comparing_For_Store_2.get(1)));\n\t\tthis.txtQuantityOfOrder_2.setText(String.valueOf(CompanyManagerUI.Object_From_Comparing_For_Store_2.get(2)));\n\t\tset_List_Of_Product_Type_Of_Store_Two();\n\t\tthis.txtRevenuOfStore_2.setText(String.valueOf(CompanyManagerUI.Object_From_Comparing_For_Store_2.get(5)));\n\t\tthis.txtNumberOfComplaint_2.setText(String.valueOf(CompanyManagerUI.Object_From_Comparing_For_Store_2.get(6)));\n\t\tthis.txtNumberOfClientInSurvey_2.setText(String.valueOf(CompanyManagerUI.Object_From_Comparing_For_Store_2.get(7)));\n\t\t\n\t\tdouble Total_Average = Double.parseDouble(new DecimalFormat(\"##.###\").format(CompanyManagerUI.Object_From_Comparing_For_Store_2.get(8)));\n\t\tthis.txtTotalAverageInSurvey_2.setText(String.valueOf(Total_Average));\n\t}", "void commitShadowList() {\n int shadowNextIdx = 0;\n for(int i = 0, j = 0; i < nextIdx && j < shadowList.size(); i++){\n if(actualList.get(i).equals(shadowList.get(j))){\n // replace the shadow list's element with actual list's element to persist execution state\n shadowList.set(j, actualList.get(i));\n j++;\n shadowNextIdx++;\n } else if(j != 0){\n break;\n }\n }\n List<Action> tmpList = shadowList;\n shadowList = actualList;\n actualList = tmpList;\n nextIdx = shadowNextIdx;\n shadowList.clear();\n }", "@Override\n public void onClick(View v) {\n SplNewList.clear();\n\n splNewListId.clear();\n for (int i = 0; i < specializationSelectedList.size(); i++)\n\n if (specializationSelectedList.get(i).getStatus()) {\n // jobLocation.setText(metrocitySelectedList.toString().replace(\"[\",\"\").replace(\"]\",\"\"));\n SplNewList.add(specializationSelectedList.get(i).getSpecialization_name());\n splNewListId.add(specializationSelectedList.get(i).getSpecialization_id());\n Log.d(\"modelArrayList\", specializationList.get(i).getSpecialization_name() + \"<><<\" + specializationList.get(i).getStatus());\n }\n\n Log.d(\"ISZEOFTITLESELLIS\", SplNewList.size() + \"\");\n medicalSplId = splNewListId.toString().replace(\"[\", \"\").replace(\"]\", \"\");\n\n Log.d(\"MEDICALmedicalSplId\", medicalSplId);\n\n spl_auto.setText(SplNewList.toString().replace(\"[\", \"\").replace(\"]\", \"\"));\n if (SplNewList.size() > 3) {\n Toast toast = Toast.makeText(Sell_Buy_Practice_Activity.this, \"Only 3 Specializations can be selected!\", Toast.LENGTH_LONG);\n\n toast.show();\n dialog.show();\n } else {\n dialog.dismiss();\n }\n\n }", "public static void main(String[] args) {\n ArrayList<String> cars = new ArrayList<>();\n cars.add(\"Volvo\");\n cars.add(\"BMW\");\n cars.add(\"Ford\");\n cars.add(\"Mazda\");\n cars.add(\"Chevrolet\");\n cars.add(\"Kia\");\n\n ArrayList<String> cars2 = new ArrayList<>();\n cars2.add(\"Lamborghini\");\n cars2.add(\"Bugatti\");\n\n //1. Adding methods to the list\n //1.1 Add specified element to the end of the list\n cars.add(\"Nissan\");\n //1.2 Add specified element at the specified position\n //could be any position should be inside the length of the list, avoid out of bounds positions\n cars.add(1,\"Smart\");\n //1.3 Add all the elements a list to the another list\n cars.addAll(cars2);\n\n //2. Getting the size of the list\n int size = cars.size();\n System.out.println(\"Size of the list: \" + size);\n\n //3. Removing elements from the list\n //3.1 Remove the specified object from the list, by object or index\n cars.remove(\"Chevrolet\");\n cars.remove(7);\n //3.2 Remove all the elements from the list\n ArrayList<String> cars3 = new ArrayList<String>(cars);\n cars3.clear();\n //3.3 Remove elements from an specific range\n ArrayList<String> cars4 = new ArrayList<String>(cars);\n cars4.subList(4,6).clear();\n\n //4. Searching elements in the List\n //4.1 Search the specified element, return false if the specified element is not found\n cars.contains(\"Fiat\");\n //4.2 Returns the index of the first occurrence of the specified element\n cars.indexOf(\"BMW\");\n\n //5. Replaces the element at the specified position with the new element\n cars.set(3,\"Nissan\");\n }", "public void testingArrayList() {\r\n\t\tSystem.err\r\n\t\t\t\t.println(\"Class NewFeatures, method testingArrayList called!\");\r\n\t\t// we don't need to write data type two times\r\n\t\t// ArrayList<String> list = new ArrayList<String>();\r\n\t\tArrayList<String> list = new ArrayList<>();\r\n\t\tlist.add(\"hey\");\r\n\t\tlist.add(\"kello\");\r\n\t\tlist.add(\"labas\");\r\n\t\tSystem.out.println(\"\\nValue in list:\" + list.get(0));\r\n\t\tSystem.out.println(\"Printing out the ArrayList: \" + list);\r\n\t\tSystem.out.println(\"Class NewFeatures, method testingArrayList done!\");\r\n\t}", "@Override\n public void onPlayListEdited(PlayList playList) {\n }", "private void updateDocumentList(Response response) {\n\t\t\tfor (String doc : response.getEditorList()) {\n\t\t\t\tif (!RevisionList.this.listmodel.contains(doc))\n\t\t\t\t\tRevisionList.this.listmodel.addElement(doc);\n\t\t\t}\n\t\t}", "private void addElementsToPanelList(JList<String> jlist, JButton clickUpdate, JButton clickDelete,\r\n JButton clickComplete, JButton clickIncomplete,\r\n JButton clickCreate, JButton showComplete,\r\n JButton clickSave) {\r\n panelList.add(jlist);\r\n panelList.add(clickUpdate);\r\n panelList.add(clickDelete);\r\n panelList.add(clickComplete);\r\n panelList.add(clickIncomplete);\r\n panelList.add(clickCreate);\r\n panelList.add(showComplete);\r\n panelList.add(clickSave);\r\n }", "public void insertPhone(ArrayList<DetailModel> detailModelArrayList){\n\n\n\n\n }", "public static void main(String[] args) {\n ArrayList<Long> lst = new ArrayList<>();\n\n// C.R.U.D\n// Create, Read, Update, Delete\n\n // add item, insert an item, read item, update the item, remove the item, check the location ...\n\n lst.add( 12L ); // 12L is automatically converted to new Long(12L) ; because ArrayList only store object\n lst.add( 100L );\n lst.add( 150L );\n lst.add( 200L );\n // practically you will not add null, but it possible\n // lst.add(null);\n\n System.out.println(\"lst = \" + lst);\n // I want to insert 125 between 100L and 150L, basically 2nd and 3rd item\n lst.add(2,125L);\n System.out.println(\"lst = \" + lst);\n System.out.println(\"lst item count = \" + lst.size());\n\n System.out.println(\"lst.get(3) = \" + lst.get(3));\n\n // updating value at certain index : set method\n lst.set(3,195L);\n System.out.println(\"NEW VALUE FOR lst.get(3) = \" + lst.get(3));\n System.out.println(\"lst = \" + lst);\n\n // removing item by its value\n // lst.remove(100L);\n // System.out.println(\"lst after removing 100 = \" + lst);\n // removing item by its index\n // lst.remove(2);\n // System.out.println(\"lst after removing by index = \" + lst);\n\n // looking for location of certain item\n\n System.out.println(\"\\nLocation of 100L is using lst.indexOf(100L) \" + lst.indexOf(100L));\n\n System.out.println(\"\\nLocation of 23L is using lst.indexOf(23L) \" + lst.indexOf(23L));\n\n // Check whether a list is empty or not\n System.out.println(\"\\nlst.size() > 0 = \" + (lst.size() > 0));\n\n System.out.println(\"\\nlst.isEmpty() = \" + lst.isEmpty());\n\n // how do I delete everything inside my ArrayList\n // lst.clear();\n // System.out.println(\"\\nlst.isEmpty() = \" + lst.isEmpty());\n // System.out.println(\"lst = \" + lst);\n\n // check whether we have certain item or not\n\n System.out.println(\"\\nlst.contains(100L) = \" + lst.contains(100L));\n System.out.println(\"lst.contains(10L) = \" + lst.contains(10L));\n\n // how do I check whether a list contains an item without using contains\n // use indexOf method, if it return -1, it means we don't have it\n System.out.println(\"DO I HAVE 10L = \" + (lst.indexOf(10L) != -1));\n\n ArrayList<Integer> lst2 = new ArrayList<>();\n lst2.add(5);\n lst2.add(3);\n lst2.add(4);\n lst2.add(2);\n\n lst2.indexOf(3);\n System.out.println(\"\\nlst2 = \" + lst2);\n\n\n }" ]
[ "0.67358166", "0.64996487", "0.6486077", "0.62991166", "0.6244", "0.6199656", "0.61648613", "0.60781205", "0.6051611", "0.6050893", "0.6046054", "0.60227424", "0.59966487", "0.5993247", "0.59814864", "0.5882548", "0.5880574", "0.5859202", "0.5846131", "0.58452994", "0.58448696", "0.5830026", "0.58293813", "0.58286613", "0.58249724", "0.58159", "0.58137494", "0.5758653", "0.5743141", "0.5740046", "0.5726438", "0.57248354", "0.5651878", "0.5645657", "0.5639348", "0.5638251", "0.56218505", "0.56207097", "0.5613839", "0.56120986", "0.5608891", "0.55994767", "0.5596051", "0.55846024", "0.55768794", "0.55685395", "0.556414", "0.5557812", "0.5547111", "0.55444914", "0.5526704", "0.5517584", "0.5514116", "0.55139655", "0.5512155", "0.5508012", "0.55079585", "0.5502558", "0.5501885", "0.5496555", "0.5492209", "0.5488808", "0.5487508", "0.5484315", "0.5481172", "0.547791", "0.547444", "0.54731834", "0.5450548", "0.54487175", "0.54471666", "0.54410475", "0.5433234", "0.5430062", "0.5423945", "0.5422059", "0.5419544", "0.5417626", "0.5413628", "0.54104936", "0.5407899", "0.5407251", "0.5406972", "0.5404107", "0.5398321", "0.5392961", "0.5391002", "0.5388089", "0.53874403", "0.53797644", "0.53792995", "0.5378867", "0.5378822", "0.5378435", "0.53761345", "0.5374641", "0.53739524", "0.53648466", "0.5361476", "0.5359395" ]
0.55993015
42
Delete method Delete an existing employee
@Override public void delete(){ Integer Pointer=0; FileWriter editDetails = null; ArrayList<String> lineKeeper = saveText(); if(lineKeeper.contains(getUsername())){ Pointer=lineKeeper.indexOf(getUsername()); Pointer=Pointer-1; for(int i=1;i<=8;i++){ lineKeeper.remove(Pointer+1); }//end for homeAddress.delete(lineKeeper); } try{ editDetails= new FileWriter("employees.txt",false); for( int i=0;i<lineKeeper.size();i++){ editDetails.append(lineKeeper.get(i)); editDetails.append(System.getProperty("line.separator")); }//end for editDetails.close(); editDetails = null; }//end try catch (IOException ioe) {}//end catch }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String deleteEmployee(EmployeeDetails employeeDetails);", "@Override\n\tpublic void deleteEmployee() {\n\n\t}", "@Override\n\tpublic void deleteEmployee(Employee employee) {\n\t\t\n\t}", "public void delete(Employee employee){\n employeeRepository.delete(employee);\n }", "@Override\n\tpublic void deleteEmployee(Employee e) {\n\t\t\n\t}", "@Override\n public void deleteEmployee(int employeeId) {\n\n }", "@Override\r\n\tpublic void deleteEmployee(Employee t) {\n\t\t\r\n\t}", "@Override\n\tpublic void deleteEmployeeById(int empId) {\n\t\t\n\t}", "@Override\n\tpublic void deleteEmployeeById(int id) {\n\t\t\n\t}", "public void deleteEmployee(Long employeeId) throws ApiDemoBusinessException;", "@Override\n\tpublic void delete(Employee employee) {\n\t\temployeeDao.delete(employee);\n\t}", "@Override\n\tpublic void deleteEmployee(Employee employee) {\n\t\tEmployee deleteEmployee = em.find(Employee.class, employee.getId());\n\t\ttry {\n\t\t\tem.getTransaction().begin();\n\t\t\tem.remove(deleteEmployee);\n\t\t\tem.getTransaction().commit();\n\t\t\tSystem.out.println(\"Employee Data Removed successfully\");\n\t\t\tlogger.log(Level.INFO, \"Employee Data Removed successfully\");\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Not found\");\n\t\t}\n\n\t}", "@Override\r\n\tpublic void delete(Employee arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void deleteEmployeeByEmployeeId(long emplloyeeId) {\n\t\t\r\n\t}", "@Override\r\n\tpublic int deleteEmployee(Connection con, Employee employee) {\n\t\treturn 0;\r\n\t}", "private void deleteEmployee() {\n // Only perform the delete if this is an existing pet.\n if (mCurrentPetUri != null) {\n // Call the ContentResolver to delete the pet at the given content URI.\n // Pass in null for the selection and selection args because the mCurrentPetUri\n // content URI already identifies the pet that we want.\n int rowsDeleted = getContentResolver().delete(mCurrentPetUri, null, null);\n\n // Show a toast message depending on whether or not the delete was successful.\n if (rowsDeleted == 0) {\n // If no rows were deleted, then there was an error with the delete.\n Toast.makeText(this, getString(R.string.editor_delete_pet_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the delete was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_delete_pet_successful),\n Toast.LENGTH_SHORT).show();\n }\n }\n\n // Close the activity\n finish();\n }", "public void delete(EmployeeEntity entity){\n EmployeeDB.getInstance().delete(entity);\n }", "public static void deleteEmployee(Employee employee) {\n try {\n if (employeeRepository.delete(dataSource, employee) == 0) {\n LOGGER.info(\"The employee \" + employee.getFirstName() + \" \" + employee.getLastName() +\n \" \" + employee.getBirthday() + \" was successfully deleted from the list of employees\");\n System.out.println(\"\\n\" + resourceBundle.getString(\"emp\") + \" \" + employee.getFirstName() + \" \" + employee.getLastName() +\n \" \" + employee.getBirthday() + \" \" + resourceBundle.getString(\"success.delete\") + \"\\n\");\n } else {\n LOGGER.warn(\"The employee \" + employee.getFirstName() + \" \" + employee.getLastName() + \" \" + employee.getBirthday() + \" was not found in the list of employees\");\n System.out.println(\"\\n\" + resourceBundle.getString(\"emp\") + \" \" + employee.getFirstName() + \" \" + employee.getLastName() + \" \" + employee.getBirthday() + \" \" + resourceBundle.getString(\"not.in.list\") + \"\\n\");\n }\n } catch (SQLException e) {\n LOGGER.error(e.getMessage());\n }\n }", "@Override\n\tpublic void deleteEmployee(Employee emp) {\n\t\tlog.debug(\"EmplyeeService.deleteEmployee(Employee emp) delete Employee object whos id is\" + emp.getId());\n\n\t\trepositary.delete(emp);\n\n\t}", "public void deleteEmployee(Long id) {\n employeeRepository.deleteById(id);\n }", "@DeleteMapping(\"/deleteEmployee/{id}\")\n\tpublic void deleteEmployee(@PathVariable Long id){\n repo.deleteById(id);\n\t}", "public void deleteEmp(int empno) {\n\t\t\n\t}", "@DeleteMapping(\"/DeleteEmployee/{empId}\")\r\n public String deleteEmployee(@PathVariable String empId) {\r\n return admin.deleteEmployeeService(empId);\r\n }", "@Override\n\tpublic Employee delete(Employee emp) {\n\t\treturn null;\n\t}", "@DeleteMapping(\"/employees/{employeeId}\")\n\tpublic String deleteEmployee (@PathVariable int employeeId) {\n\t\tEmployee theEmployee = employeeService.fndById(employeeId);\n\t\t\n\t\t// if employee null\n\t\tif (theEmployee == null) {\n\t\t\tthrow new RuntimeException(\"Employee xx his idEmpl not found \"+ employeeId);\n\t\t\t \n\t\t}\n\t\temployeeService.deleteById(employeeId);\n\t\treturn \"the employe was deleted \"+ employeeId;\n\t\t\n\t}", "private void deleteEmployee(HttpServletRequest request, HttpServletResponse response)\r\n\t\tthrows Exception {\n\t\tString theEmployeeId = request.getParameter(\"employeeId\");\r\n\t\t\r\n\t\t// delete employee from database\r\n\temployeeDAO.deleteEmployee(theEmployeeId);\r\n\t\t\r\n\t\t// send them back to \"list employees\" page\r\n\t\tlistEmployees(request, response);\r\n\t}", "@DeleteMapping(\"/employee/{id}\")\r\n\tpublic void delete(@PathVariable Integer id) {\r\n\t\tempService.delete(id);\r\n\t}", "public abstract Employee deleteEmployee(int id) throws DatabaseExeption;", "public ResponseEntity<Void> deleteEmp(@ApiParam(value = \"employee id to delete\",required=true) @PathVariable(\"empId\") Long empId) {\n \tEmployee newEmp= empService.getEmployeeById(empId);\n\t\t\n\t\tif(newEmp==null) {\n\t\t\tthrow new ResourceNotFoundException(\"Skill with id \"+empId+\" is not found\");\n\t\t}\n\t\t\n\t\telse {\n\t\t\t\n//\t\t\tLOGGER.trace(\" Trying to trace skills to delete details\");\n\t\t\tempService.deleteEmp(empId);\n\t\t\treturn new ResponseEntity<>(HttpStatus.ACCEPTED);\n\t\t}\n }", "@Override\n\tpublic String deleteEmployee(int id) {\n\t\treturn employeeDao.deleteEmployee(id);\n\t}", "@DeleteMapping(\"/{ecode}\")\n\tpublic ResponseEntity<Employee> deleteEmployee( @PathVariable (value =\"ecode\") long id) {\n\t\tEmployee existingEmployee = this.employeeRepository.findById(id)\n\t\t\t\t.orElseThrow(() -> new ResourceNotFoundException(\"Employee not found with id: \"+ id));\n\t\t\n\t\tthis.employeeRepository.delete(existingEmployee);\n\t\treturn ResponseEntity.ok().build();\n\t}", "@Override\r\n\tpublic void deleteEmployee(int id) {\n\t\ttry {\r\n\t DirectlyDatabase.update(PropertyManager.getProperty(\"db_employee_delete\"), id +\"\"); \r\n\t\t} catch (SQLException ex) {\r\n System.out.println(ex.toString());\r\n }\t\r\n\t}", "public ResponseEntity<Void> deleteEmployeeDetails(@ApiParam(value = \"employee id to delete\",required=true) @PathVariable(\"empId\") Long empId) {\n \tEmployee newEmp= empService.getEmployeeById(empId);\n\t\t\n\t\tif(newEmp==null) {\n\t\t\tthrow new ResourceNotFoundException(\"Skill with id \"+empId+\" is not found\");\n\t\t}\n\t\t\n\t\telse {\n\t\t\t\n//\t\t\tLOGGER.trace(\" Trying to trace skills to delete details\");\n\t\t\tempService.deleteEmployeeDetails(empId);\n\t\t\treturn new ResponseEntity<>(HttpStatus.ACCEPTED);\n\t\t}\n }", "public void delete(Employee employee) {\r\n\r\n String sql = \"delete from db.emp where id= ?\";\r\n try {\r\n Connection connection = ConnectDB();\r\n PreparedStatement preparedStatement = connection.prepareStatement(sql);\r\n preparedStatement.setInt(1,employee.getId());\r\n\r\n int rows=preparedStatement.executeUpdate();\r\n String message=rows==1 ? \"A fost sters cu succes\": \"Nu este nimic de sters\";\r\n\r\n System.out.println(message);\r\n\r\n } catch (SQLException Ex) {\r\n System.out.println(Ex.getMessage());\r\n System.out.println(\"Eroare la stergere\"+ Ex.getMessage());\r\n\r\n }\r\n }", "public void deleteEmployee(int id) {\r\n\t\temployee1.remove(id);\r\n\t}", "public void deleteEmp(Integer id) {\n\t\temployeeMapper.deleteByPrimaryKey(id);\n\t}", "@Override\r\n\tpublic int deleteEmployee(int empId) {\n\t\tint added = 0;\r\n\t\tString insertData = \"delete from employee where empId=?\";\r\n\r\n\t\ttry {\r\n\t\t\tPreparedStatement ps = dataSource.getConnection().prepareStatement(insertData);\r\n\t\t\tps.setInt(1, empId);\r\n\t\t\tadded = ps.executeUpdate();\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn added;\r\n\r\n\t}", "@RequestMapping(value = \"/{id}\", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE)\n public final void deleteEmployee(@PathVariable(\"id\") long id) {\n try {\n LOGGER.info(\"deleting Employee with id=\" + id);\n employeeFacade.removeEmployee(id);\n } catch (NonExistingEntityException | IllegalArgumentException e) {\n throw new RequestedResourceNotFound(\"Employee with id=\" + id + \" does not exist in system.\", e);\n }\n }", "@DeleteMapping(\"/{id}\")\n public ResponseEntity deleteEmployee(@PathVariable(\"id\") Long id){\n Employee employee = employeeService.deleteEmployee(id);\n String responseMessage = String.format(\"Employee: %s ID: %s has been deleted from records.\", employee.getName(), employee.getEmployeeId());\n return new ResponseEntity<>(responseMessage, HttpStatus.OK);\n }", "@DeleteMapping(\"employee/{employeeId}\")\n\tpublic void deleteEmployeeById(@PathVariable(\"employeeId\") int employeeId, Principal principal)\n\t{\n\t\temployeeService.deleteEmployeeById(employeeId,principal);\n\t}", "@Override\n\tpublic boolean deleteEmployeeById(int employeeId) {\n\t\tint isDeleted = template.update(\"delete from employee where empid = ?\", employeeId);\n\t\tif (isDeleted > 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "@Override\n\tpublic void delete(Integer employeeId) {\n\t\tEmployee e = employeeDao.getById(employeeId);\n\t\temployeeDao.delete(e);\n\t}", "@Override\n\tpublic ResponseEntity<Employee> deleteById(Long id) {\n\t\treturn null;\n\t}", "@RequestMapping(path = \"/employee/{id}\", method = RequestMethod.DELETE)\r\n\t@ResponseBody\r\n\tpublic String deleteEmployeeById(@PathVariable int id) {\r\n\t\ter.deleteById(id);\r\n\t\treturn \"Employee deleted with id: \" + id;\r\n\t}", "public void deleteById(Integer employeeid) {\n\t\temployeerepository.deleteById(employeeid);\n\t}", "@GetMapping(\"/deleteEmployee/{emp_no}\")\n\tpublic String deleteEmployee(@PathVariable(value = \"emp_no\") Integer emp_no) {\n\t\tthis.service.deleteEmployeeById(emp_no);\n\t\treturn \"redirect:/employees\";\n\t}", "@DeleteMapping(value=\"/employes/{Id}\")\n\tpublic void deleteEmployeeDetailsByEmployeeId(@PathVariable Long Id) {\n\t\t\n\t\temployeeService.deleteEmployeeDetails(Id);\t\n\t}", "public void deleteEmployee(int employeeID) {\n try {\r\n Class.forName(\"com.mysql.cj.jdbc.Driver\");\r\n\r\n Connection con = DriverManager.getConnection(DatabaseManager.CONNECTION_TO_DATABASE, DatabaseManager.USER_NAME, DatabaseManager.PASSWORD);\r\n\r\n String query = \"DELETE FROM employees WHERE id = '\"+employeeID+\"'\";\r\n\r\n PreparedStatement preparedStatement = con.prepareStatement(query);\r\n preparedStatement.execute();\r\n \r\n if(getEmployeeCount() == 0) \r\n {\r\n DatabaseManager.locations.deleteAllLocations();\r\n }\r\n\r\n con.close();\r\n\r\n } catch (ClassNotFoundException e) {\r\n System.out.println(e.getMessage());\r\n\r\n JOptionPane.showMessageDialog(null, e.getMessage());\r\n } catch (SQLException e2) {\r\n System.out.println(e2.getMessage());\r\n\r\n JOptionPane.showMessageDialog(null, e2.getMessage());\r\n }\r\n\r\n }", "public void delete(Employeee em) {\n\t\temployeerepo.delete(em);\n\t}", "@Override\n\tpublic Employees delete(Employees entity) throws OperationNotSupportedException {\n\t\treturn null;\n\t}", "@Override\n\tpublic void deleteEPAData(int empId) {\n\t}", "@Override\r\n\tpublic Map deleteEmployee(long employeeId) {\n\t\treturn null;\r\n\t}", "@DeleteMapping(\"/employee/{id}\")\n\tpublic ResponseEntity<Map<String, Boolean>> deleteEmployee(@PathVariable Long id){\n\t\tEmployee employee = emprepo.findById(id).orElseThrow(()-> new ResourceNotFoundException(\"Employee not exist with id: \"+id ));\n\t\t\n\t\temprepo.delete(employee);\n\t\tMap<String, Boolean> response = new HashMap<>();\n\t\t\tresponse.put(\"deleted\", Boolean.TRUE);\n\t\t\treturn ResponseEntity.ok(response);\n\t\t\t\n\n\t}", "@Override\n\tpublic void deleteEmpByID(int employeeID) {\n\t\temployeeRepository.deleteById(employeeID);\n\t}", "@Override\n\tpublic void deleteByEmployeeId(Long id) {\n\t\temployeeRepository.deleteById(id);\n\t}", "@Override\n\t@Transactional\n\tpublic boolean delete(int id) {\n\t\treturn employeeDao.delete(id);\n\t}", "private void deleteEmployeeBooking() {\n BookingModel bookingModel1 = new BookingModel();\n try {\n bookingModel1.deleteBooking(employeeID);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n }", "@DELETE\n @Transactional\n @Path(\"/{id}\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response delete(\n @PathParam(\"id\") @NotNull(message = ValidationMessages.EMPLOYEE_ID_MUST_NOT_BE_NULL)\n UUID employeeId) {\n\n deleteEmployeeById.handle(employeeId);\n return Response.ok().build();\n }", "@Override\n\tpublic EmployeeBean deleteEmployeeDetails(Integer id) throws Exception {\n\t\treturn employeeDao.deleteEmployeeDetails(id);\n\t}", "public int deleteRecord(Employee employee) {\n\t\ttry {\n\t\t\tString query = \"delete from employeedbaddress where eNo=?\";\n\t\t\tPreparedStatement ps = connection.prepareStatement(query);\n\t\t\tps.setInt(1, employee.getEno());\n\t\t\tresult = ps.executeUpdate();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn result;\n\t}", "public void delete(Long id) {\n log.debug(\"Request to delete Employee : {}\", id);\n employeeRepository.deleteById(id);\n }", "public static void deleteRecord(Integer employeeId) {\n\t\ttry {\n\t\t\t// Getting Session Object From SessionFactory\n\t\t\tsessionObj = buildSessionFactory().openSession();\n\t\t\t// Getting Transaction Object From Session Object\n\t\t\tsessionObj.beginTransaction();\n\n\t\t\tFuncionario employeeObj = findRecordById(employeeId);\n\t\t\tsessionObj.delete(employeeObj);\n\n\t\t\t// Committing The Transactions To The Database\n\t\t\tsessionObj.getTransaction().commit();\n\t\t} catch (Exception sqlException) {\n\t\t\tif (null != sessionObj.getTransaction()) {\n\t\t\t\tsessionObj.getTransaction().rollback();\n\t\t\t}\n\t\t\tsqlException.printStackTrace();\n\t\t} finally {\n\t\t\tif (sessionObj != null) {\n\t\t\t\tsessionObj.close();\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic String deleteEmp(int eid) {\n\t\treturn eb.deleteEmp(eid);\n\t}", "public void deleteEmployee(ActionRequest request, ActionResponse response) throws SystemException, PortalException {\n\t\tString stringKey = request.getParameter(\"deleteKey\");\n\t\tlong employeeId = Long.valueOf(stringKey);\n\t\tEmployee employee = EmployeeLocalServiceUtil.getEmployee(employeeId);\n\t\tServiceContext serviceContext = ServiceContextFactory.getInstance(DLFolder.class.getName(), request);\n\t\tEmployeeLocalServiceUtil.deleteEmployee(employeeId);\n\t\tResourceLocalServiceUtil.deleteResource(serviceContext.getCompanyId(), Employee.class.getName(),\n\t\t\t\tResourceConstants.SCOPE_INDIVIDUAL, employee.getEmployeeId());\n\t\tif (employee.getFileEntryId() > 0) {\n\t\t\tDLFileEntryLocalServiceUtil.deleteDLFileEntry(employee.getFileEntryId());\n\t\t}\n\t\tresponse.setRenderParameter(\"mvcPath\", \"/html/employee/view.jsp\");\n\t}", "@Override\n public void deleteById(long id) {\n\n Query theQuery = entityManager.createQuery(\"DELETE FROM Employee WHERE id=:employeeId\");\n \n theQuery.setParameter(\"employeeId\", id);\n \n theQuery.executeUpdate();\n }", "@Override\n\tpublic int deleteEmployeeByID(int empid) throws RemoteException {\n\t\treturn DAManager.deleteEmployeeByID(empid);\n\t}", "@Override\n\tpublic void deleteEmp(int id) {\n\t\tConnection con=null;\n\t\tPreparedStatement stmt=null;\n\t\t\n\t\t\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t\n\t\tcon=DriverManager.getConnection(\"jdbc:mysql://localhost:3306/ems?user=root&password=root\");\n\t\tString query=\"delete from employee where id=?\";\n\t\tstmt=con.prepareStatement(query);\n\t\tstmt.setInt(1, id);\n\t\tstmt.execute();\n\t\t\n\t\t\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "@RequestMapping(value = \"/employee/{empId}\", method = RequestMethod.DELETE)\r\n\tpublic void deleteCustomerDetails(@PathVariable int empId) throws EmployeeMaintainceException {\r\n\t\ttry {\r\n\t\t\teService.deleteEmployeeDetails(empId);\r\n\t\t} catch (Exception e) {\r\n\t\t\tthrow new EmployeeMaintainceException(204, e.getMessage());\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void deleteEmployee(int id) {\n\t\temployees.removeIf(emp -> emp.getEmpId()==(id));\r\n\t}", "@DeleteMapping(\"/remove/{id}\")\n\tpublic ResponseEntity<String> deleteEmployee(@PathVariable Integer id) {\n\t\tResponseEntity<String> response = null;\n\t\ttry {\n\t\t\tservice.deleteEmployee(id);\n\t\t\tString message = \"Employee '\" + id + \"' Deleted!\";\n\t\t\tresponse = new ResponseEntity<String>(message, HttpStatus.OK);\n\t\t} catch (EmployeeNotFoundException e) {\n\t\t\tthrow e;\n\t\t}\n\t\treturn response;\n\t}", "public void deleteEmployee(Employee formerEmployee) {\n\t\tthis.employee.remove(formerEmployee);\n\t}", "@Override\n\tpublic Integer deleteEmloyee(EmployeeBean employeeBean, DepartmentBean departmentBean) {\n\t\tLOGGER.info(\"starts deleteEmployee method\");\n\t\tLOGGER.info(\"Ends deleteEmployee method\");\n\t\treturn adminEmployeeDao.deleteEmloyee(employeeBean);\n\t}", "@Override\n public Mechanic deleteEmployee(Long id) {\n LOGGER.info(\"Delete Mechanic with id {}\", id);\n Mechanic mechanic = getEmployee(id);\n mechanicRepository.delete(mechanic);\n return mechanic;\n }", "@RequestMapping(value = BASE_URL_API + DELETE_EMPLOYEE_BY_ID, method=RequestMethod.DELETE)\r\n public HttpEntity<?> deleteEmployee(@PathVariable(\"id\") String id) {\r\n\r\n checkLogin();\r\n\r\n employeeService.deleteEmployeeById(id);\r\n\r\n return new ResponseEntity<>(HttpStatus.OK);\r\n }", "public String deleteEmployee(String employeeID) {\n\t\t\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t\tConnection con = DriverManager.getConnection(\"jdbc:mysql://mysql3.cs.stonybrook.edu:3306/mwcoulter?useSSL=false\",\"mwcoulter\",\"111030721\");\n\t\t\tStatement st = con.createStatement();\n\t\t\tst.executeUpdate(\n\t\t\t\t\t\"DELETE Employee, Login FROM mwcoulter.Employee INNER JOIN mwcoulter.Login WHERE \"\n\t\t\t\t\t+ \"Email = Username AND ID = \" + Integer.valueOf(employeeID));\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t\treturn \"failure\";\n\t\t}\n\t\treturn \"success\";\n\n\t}", "@Test\n public void removeEmployee() {\n userDAO.createUser(new User(\"dummy\", \"dummy\", 1));\n\n //Create dummy employee to delete\n employeeDAO.createEmployee(new Employee(\"dummy\", \"dummy\", \"dummy\", \"dummy\", \"dummy\", 3));\n\n //removing dummy data to avoid clutter in database\n assertTrue(employeeResource.removeEmployee(\"dummy\"));\n userDAO.removeUser(\"dummy\");\n\n //test clean up\n assertNull(userResource.getUser(\"dummy\"));\n }", "@Override\n public void deleteById(int theId) {\n Query theQuery = entityManager.createQuery(\n \"delete from Employee where id=:employeeId\");\n theQuery.setParameter(\"employeeId\", theId);\n theQuery.executeUpdate();\n }", "public boolean deleteEmployee(int employeeID){\n try {\n DatabaseSupport.deleteEmployee(employeeID);\n } catch (SQLException throwables) {\n throwables.printStackTrace();\n return false;\n }\n return true;\n }", "@Override\r\n\tpublic ResponseEntity<String> deleteEmployee(int employeeId,String authToken) throws ManualException{\r\n\t\tfinal\tSession session=sessionFactory.openSession();\r\n\t\t\r\n\t\tResponseEntity<String> responseEntity=new ResponseEntity<String>(HttpStatus.BAD_REQUEST);\r\n\t\t\r\n\t\t/* check for authToken of admin */\r\n\t\tsession.beginTransaction();\r\n\t\ttry{\r\n\t\t\tAuthTable authtable=session.get(AuthTable.class, authToken);\r\n\t\t\tUser userAdmin=session.get(User.class, authtable.getUser().getEmpId());\r\n\t\t\tif(userAdmin.getUsertype().equals(\"Admin\")){\r\n\t\t\t\tUser user = session.get(User.class, employeeId);\r\n\t\t\t\tif(user!=null){\r\n\t\t\t\t\t\r\n\t\t\t\t\t/* delete from user_skill */\r\n\t\t\t\t\tString sql = \"delete FROM user_skill WHERE user_employeeId = :employee_id\";\r\n\t\t\t\t\tSQLQuery query = session.createSQLQuery(sql);\r\n\t\t\t\t\tquery.setParameter(\"employee_id\", user.getEmpId() );\r\n\t\t\t\t\tquery.executeUpdate();\r\n\t\t\t\t\t\r\n\t\t\t\t\t/* delete from authtable */\r\n\t\t\t\t\tString hql = \"delete FROM authtable where employeeId= :empId\" ;\r\n\t\t\t\t\tQuery query2 = session.createQuery(hql);\r\n\t\t\t\t\tquery2.setInteger(\"empId\", user.getEmpId());\r\n\t\t\t\t\tquery2.executeUpdate();\r\n\t\t\t\t\t\r\n\t\t\t\t\t/* delete from operations table */\r\n\t\t\t\t\thql = \"delete FROM operations where employeeId= :empId\" ;\r\n\t\t\t\t\tquery2 = session.createQuery(hql);\r\n\t\t\t\t\tquery2.setInteger(\"empId\", user.getEmpId());\r\n\t\t\t\t\tquery2.executeUpdate();\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t/* delete from user */\r\n\t\t\t\t\tsession.delete(user);\r\n\t\t\t\t\t\r\n\t\t\t\t\t/* delete from usercredential */\r\n\t\t\t\t\tsession.delete(user.getUserCredential());\r\n\t\t\t\t\t\r\n\t\t\t\t\t/* entry in operation table */\r\n\t\t\t\t\tOperationImpl operationImpl= new OperationImpl();\r\n\t\t\t\t\toperationImpl.addOperation(session, userAdmin, \"Deleted Employee \"+user.getName());\r\n\t\t\t\t\t\r\n\t\t\t\t\tresponseEntity=new ResponseEntity<String>(HttpStatus.OK);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\tresponseEntity=new ResponseEntity<String>(HttpStatus.NOT_FOUND);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tresponseEntity=new ResponseEntity<String>(HttpStatus.UNAUTHORIZED);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tresponseEntity=null;\r\n\t\t}\r\n\t\tfinally{\r\n\t\t\tsession.getTransaction().commit();\r\n\t\t\tsession.close();\r\n\t\t\treturn responseEntity;\r\n\t\t}\r\n\t}", "public void DeleteEmployee(int idEmployee)\n\t{\n\t\tfor(int i = 0; i < departments.size() ; i++)\n\t\t\tfor(Employee emp : departments.get(i).getEmployeeList())\n\t\t\t{\n\t\t\t\tif(emp.getIdEmployee()==idEmployee) \n\t\t\t\t{\n\t\t\t\t\tdepartments.get(i).delEmployee(emp);break;\n\t\t\t\t}\n\t\t\t}\n\t}", "@Override\r\n\tpublic void delete(Integer id) {\n\t\tempdao.deleteById(id);\r\n\t}", "@POST(\"/DeleteEmpire\")\n\tCollection<Empire> deleteEmpire(@Body Empire empire,@Body int id) throws GameNotFoundException;", "public void deleteEmployee(Integer employeeID) {\n\t\tSession session = factory.openSession();\n\t\tTransaction transaction = null;\n\t\ttry {\n\t\t\ttransaction = session.beginTransaction();\n\t\t\tEmployee employee = (Employee) session.get(Employee.class, employeeID);\n\t\t\tsession.delete(employee);\n\t\t\ttransaction.commit();\n\t\t} catch (HibernateException e) {\n\t\t\tif (transaction != null)\n\t\t\t\ttransaction.rollback();\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tsession.close();\n\t\t}\n\t}", "public void delEmployee(String person){\n System.out.println(\"Attempt to delete \" + person);\n try {\n String delete =\"DELETE FROM JEREMY.EMPLOYEE WHERE NAME='\" + person+\"'\"; \n stmt.executeUpdate(delete);\n \n \n } catch (Exception e) {\n System.out.println(person +\" may not exist\" + e);\n }\n \n }", "@FXML\r\n\tprivate void deleteEmployee(ActionEvent event) {\r\n\t\teraseFieldsContent();\r\n\t\tEmployee e = listaStaff.getSelectionModel().getSelectedItem();\r\n\t\tservice.deleteEmployee(e);\r\n\t\tlistaStaff.getItems().remove(e);\r\n\t\tbtDelete.setDisable(true);\r\n\t\tbtEditar.setDisable(true);\r\n\t\tupdateList();\r\n\t}", "@DELETE\n\t@Path(\"{empID}\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response remove(@PathParam(\"empID\") int id) {\n\t\tEmployeeFacade employeeFacade = new EmployeeFacade();\n\t\tboolean result = employeeFacade.removeById(id);\n\t\tif (result) {\n\t\t\treturn Response.status(200).build();\n\t\t}\n\t\treturn Response.status(409).build();\n\t}", "public static void deleteEmployee(int employeeID) {\n\t\ttry {\n\n\t\t\t// request holds the complete URL to be passed sent to the API\n\t\t\tURL request = new URL(endpoint + \"/\" + employeeID);\n\n\t\t\t// opens connection with API, sends data via URL request\n\t\t\tHttpURLConnection connection = (HttpURLConnection) request.openConnection();\n\t\t\tconnection.setRequestMethod(\"DELETE\");\n\n\t\t\t// if anything other than a successful connection occurs, stop\n\t\t\t// program and display the error code\n\t\t\tif (connection.getResponseCode() != 200) {\n\t\t\t\tthrow new RuntimeException(\"Failed : HTTP error code : \" + connection.getResponseCode());\n\t\t\t}\n\n\t\t\t// print out confirmation to the console if successful\n\t\t\tSystem.out.println(\"Employee Deleted.\\n\");\n\n\t\t} /* try */ catch (MalformedURLException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Transactional\n public void delete(Long id) {\n logger.debug(\"delete employee by id : {}\", id);\n employeeDao.delete(id);\n }", "@Override\r\n\tpublic int deleteByExample(EmpExample example) {\n\t\treturn 0;\r\n\t}", "public int deleteEmployeeById(int id) throws SQLException {\n\t\t\treturn employeeDAO.deleteEmployeeById(id);\n\t\t}", "@GetMapping(\"/deleteEmployee/{id}\")\n public String deleteEmployee(@PathVariable(value =\"id\") long id){\n employeeService.deleteEmployeeById(id);\n return \"redirect:/\";\n }", "@Override\n\tpublic void deleteById(int theId) {\n\t\tSession currentSession = entityManager.unwrap(Session.class);\n\t\t\n\t\tQuery<Employee> theQuery = currentSession.createQuery(\"delete from Employee where id=:employeeId\");\n\t\ttheQuery.setParameter(\"employeeId\", theId);\n\t\ttheQuery.executeUpdate();\n\t\t\n\t}", "@RequestMapping(value = \"/delete/{bookId}\", method = RequestMethod.GET)\n\tpublic @ResponseBody()\n\tStatus deleteEmployee(@PathVariable(\"bookId\") long bookId) {\n\t\ttry {\n\t\t\tbookService.deleteBook(bookId);;\n\t\t\treturn new Status(1, \"book deleted Successfully !\");\n\t\t} catch (Exception e) {\n\t\t\treturn new Status(0, e.toString());\n\t\t}\n\t}", "@Override\n public String deleteByPrimaryKey(Integer empId) {\n int result = mapper.deleteByPrimaryKey(empId);\n StringBuffer sb = new StringBuffer(\"\");\n if(result<=0) {\n sb.append(\"删除失败\");\n }else {\n sb.append(\"删除成功\");\n }\n return sb.toString();\n }", "public EmployeeEntity deleteEmployeeData(int employeeId, StorageContext context) throws PragmaticBookSelfException {\n\t\tEmployeeEntity result = null;\n\t\tSession hibernateSession = context.getHibernateSession();\n\t\tresult = (EmployeeEntity) hibernateSession.get(EmployeeEntity.class, employeeId);\n\t\treturn result;\n\n\t}", "@DeleteMapping(\"/deleteByID/{id}\")\n\t\tpublic ResponseEntity deleteByID(@PathVariable Integer id) {\n\t\t\tOptional<EmployeeMon> empId = repository.findById(id);\n\t\t\tif(empId.isPresent()) {\n\t\t\t\trepository.deleteById(id);\n\t\t\t\treturn new ResponseEntity<>(HttpStatus.OK);\n\t\t\t} else {\n\t\t\t\treturn new ResponseEntity<>(HttpStatus.NOT_FOUND);\n\t\t\t}\n\t\t}", "public boolean removeEmployee(int empID){\n log.debug(\"Inside removeEmployee Method.\");\n String deleteSQL;\n\n log.debug(\"User entered only employeeID, removing employee by ID\");\n deleteSQL = \"DELETE FROM employeeDetails where empID = \" + empID;\n\n if(database.updateDatabase(deleteSQL)){\n removeEmployeeAvailability(empID);\n log.debug(\"Successfully removed employee, returning to controller.\");\n return true;\n }\n log.debug(\"Failed to removed employee, returning to controller.\");\n return false;\n }", "@DeleteMapping(\"{id}\")\n\t@Secured(Roles.ADMIN)\n\tpublic ResponseEntity<?> delete(@PathVariable long id) {\n\t\tLogStepIn();\n\n\t\tEmployee employee = employeeRepository.findById(id);\n\t\tif (employee == null) {\n\t\t\treturn LogStepOut(ResponseEntity.notFound().build());\n\t\t}\n\t\telse {\n\t\t\tuserRepository.deleteById(employee.getUser().getId());\n\t\t\temployeeRepository.deleteById(id);\n\t\t\treturn LogStepOut(ResponseEntity.noContent().build());\n\t\t}\n\t}", "@GET\n\t@Path(\"delete\")\n\t@Produces(MediaType.TEXT_PLAIN)\n\tpublic String deleteEmployee(@QueryParam(\"id\") String id) throws ParseException {\n\t\t\n\t\tJSONObject employeesJsonObject = (JSONObject) parser.parse(getFileContent());\n\t\tJSONArray employeesArray = (JSONArray) employeesJsonObject.get(\"employee\");\n\t\tJSONObject employee;\n\t\t\n\t\t/*checking each employee*/\n\t\tfor ( int i = 0 ; i < employeesArray.size() ; i++ ){\n\t\t\temployee = ((JSONObject) employeesArray.get(i));\n\t\t\t\n\t\t\tif(employee.get(\"id\").toString().equalsIgnoreCase(id)){\n\t\t\t\temployeesArray.remove(employee);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tinsertIntoFile(employeesJsonObject.toString());\n\t\treturn \"success\";\n\t}", "public boolean deleteEmployee(int id) {\n\t\tboolean flag = false;\n\t\tMapSqlParameterSource myMap = new MapSqlParameterSource();\n\t\tmyMap.addValue(\"id\", id);\n\t\t\n\t\tint effected = jdbcTemplate.update(\"delete from employee where empId=:id\", myMap);\n\t\tif(effected !=0) {\n\t\t\tflag=true;\n\t\t\tSystem.out.println(\"Employee with id \"+id+\" deleted successfully\");\n\t\t}else {\n\t\t\tSystem.out.println(\"Some proble while deleting data from Employee table\");\n\t\t}\n\t\treturn flag;\n\t}", "@RequestMapping( method = RequestMethod.DELETE)\r\n\tpublic void deleteEmp(@RequestParam(\"employeeBankId\") String employeeBankId, HttpServletRequest req) {\r\n\t\tlogger.info(\"deleteEmp is calling :\" + \"employeeBankId\" + employeeBankId);\r\n\t\tLong empBankId = Long.parseLong(employeeBankId);\r\n\t\tbankDetailsService.delete(empBankId);\r\n\t}" ]
[ "0.85345966", "0.8423302", "0.8362232", "0.8352293", "0.83260995", "0.826066", "0.82531565", "0.8220535", "0.8188256", "0.81316674", "0.8105619", "0.8089938", "0.8068804", "0.7976881", "0.7900794", "0.7888894", "0.78854", "0.7871655", "0.7868204", "0.7849611", "0.7836619", "0.77870303", "0.7772612", "0.77723086", "0.7769465", "0.7767604", "0.77283514", "0.77230966", "0.7714614", "0.76608074", "0.764991", "0.76483977", "0.76409954", "0.76302403", "0.76023847", "0.75924546", "0.7538944", "0.7529093", "0.7520483", "0.7507921", "0.75052106", "0.7502244", "0.7490369", "0.7480754", "0.7459823", "0.74487895", "0.7435939", "0.7428984", "0.74274856", "0.74003834", "0.7389488", "0.73480767", "0.7343146", "0.73090357", "0.7299958", "0.7270862", "0.7230179", "0.72208995", "0.72204936", "0.7216887", "0.72058874", "0.72052383", "0.71937215", "0.7191148", "0.715878", "0.7140563", "0.7128334", "0.712502", "0.71177095", "0.7117249", "0.7111486", "0.71000457", "0.70893186", "0.70810974", "0.70588094", "0.703053", "0.7029873", "0.7028226", "0.7017861", "0.70122224", "0.70024914", "0.69817775", "0.69703746", "0.6968465", "0.6964102", "0.69315165", "0.6927878", "0.69031847", "0.6876047", "0.68445975", "0.68381447", "0.68279886", "0.68244725", "0.680724", "0.67946833", "0.6764445", "0.67289597", "0.6727873", "0.6704025", "0.67027664", "0.6700005" ]
0.0
-1
Search method This method search employees by first name and last name
@Override public void search(String firstName,String lastName,String fileName){ int Pointer; ArrayList<String> lineKeeper = saveText(); /* Search into the list to find the firstname, if it founds * old information and then rewrite new inforamtion * Search and remove*/ if(lineKeeper.contains(firstName)){ Pointer=lineKeeper.indexOf(firstName); if(lineKeeper.get(Pointer+1).equals(lastName)){ this.load(lineKeeper.get(Pointer-3),fileName); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@GetMapping(value = \"/search\")\n\tpublic String searchName(@RequestParam(name = \"fname\") String fname, Model model) {\n\t\tmodel.addAttribute(\"employees\", employeerepository.findByFnameIgnoreCaseContaining(fname));\n\t\treturn \"employeelist\";\n\t}", "private Employee searchEmployee(String empName)\n {\n empName = empName.toLowerCase();\n Employee found = null;\n // Find the employee in the array list\n Iterator<Employee> emp = employees.iterator();\n while(emp.hasNext() && found == null)\n {\n myEmployee = emp.next(); //get employee from array list\n String fullName = myEmployee.getName().toLowerCase();\n String[] FirstLast = fullName.split(\" \");\n \n if (\n matchString(fullName,empName) ||\n matchString(FirstLast[0],empName) ||\n matchString(FirstLast[1],empName)\n )\n found = myEmployee;\n } \n return found;\n }", "List<User> findByfnameContaining(String search);", "List<Employee> findByNameAndLocation(String name, String location);", "@GetMapping(value=\"/searchEmpData/{fname}\")\n\tpublic List<Employee> getEmployeeByName(@PathVariable (value = \"fname\") String fname)\n\t{\n\t\treturn integrationClient.getEmployees(fname);\n\t}", "@Override\r\n\t@Transactional\r\n\tpublic List<EmployeeMaster> searchbyeyEmployeeforSA(String search_key) {\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\r\n\t\tList<EmployeeMaster> listemp = (List<EmployeeMaster>) sessionFactory.getCurrentSession()\r\n\t\t.createQuery(\"from EmployeeMaster WHERE obsolete ='N' and emp_name LIKE '%\" + search_key + \"%'\"\r\n\t\t\t\t+ \" OR empcategory LIKE '%\" + search_key + \"%' OR emp_code LIKE '%\" + search_key + \"%'\"\r\n\t\t\t\t+ \" OR branchModel.branch_name LIKE '%\" + search_key + \"%' OR emp_address1 LIKE '%\" + search_key + \"%'\"\r\n\t\t\t\t+ \" OR emp_address2 LIKE '%\" + search_key + \"%' OR location.location_name LIKE '%\" + search_key + \"%'\"\r\n\t\t\t\t+ \" OR location.address.city LIKE '%\" + search_key + \"%' OR location.address.district LIKE '%\" + search_key + \"%'\"\r\n\t\t\t\t+ \" OR location.address.state LIKE '%\" + search_key + \"%' OR emp_phoneno LIKE '%\" + search_key + \"%' OR emp_email LIKE '%\" + search_key + \"%' OR dob LIKE '%\"+ search_key + \"%'\"\r\n\t\t\t\t+ \" OR doj LIKE '%\" + search_key + \"%'\").list();\r\n\t\treturn listemp;\r\n\t\t\r\n\t}", "public static void search() {\n int userSelected = selectFromList(crudParamOptions);\n switch (userSelected){\n case 1:\n searchFirstName();\n break;\n case 2:\n searchLastName();\n break;\n case 3:\n searchPhone();\n break;\n case 4:\n searchEmail();\n break;\n default:\n break;\n }\n }", "@Override\n\tString searchEmployee(String snum) {\n\t\treturn null;\n\t}", "@JsonView(JSONView.ParentObject.class)\n\t@RequestMapping(value = \"/users\", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)\n\tpublic List<MMDHUser> findAll(@RequestParam(value = \"searchByOperator\", required = false) String searchByOperator,\n\t\t\t@RequestParam(value = \"firstName\", required = false) String firstName,\n\t\t\t@RequestParam(value = \"lastName\", required = false) String lastName) {\n\n\t\tif (StringUtils.hasLength(searchByOperator) && StringUtils.hasLength(firstName)\n\t\t\t\t&& StringUtils.hasLength(lastName)) {\n\t\t\tif (searchByOperator.equals(\"AND\"))\n\t\t\t\treturn userRepo.findByFirstNameAndLastName(firstName, lastName);\n\t\t\telse if (searchByOperator.equals(\"OR\"))\n\t\t\t\treturn userRepo.findByFirstNameOrLastName(firstName, lastName);\n\t\t} else if (StringUtils.hasLength(firstName) && !StringUtils.hasLength(lastName)) {\n\t\t\tif (StringUtils.hasLength(searchByOperator) && searchByOperator.equals(\"LIKE\"))\n\t\t\t\treturn userRepo.findByFirstNameLike(firstName + \"%\");\n\t\t\treturn userRepo.findByFirstName(firstName);\n\t\t} else if (!StringUtils.hasLength(firstName) && StringUtils.hasLength(lastName)) {\n\t\t\tif (StringUtils.hasLength(searchByOperator) && searchByOperator.equals(\"LIKE\"))\n\t\t\t\treturn userRepo.findByLastNameLike(lastName + \"%\");\n\t\t\treturn userRepo.findByLastName(lastName);\n\t\t}\n\t\treturn userRepo.findAll();\n\t}", "List<Employee> findByNameContaining(String keyword, Sort sort);", "public void getByPropertyemployee(String textToFind){\n\t\t// ejemplo buscar por propiedad direccion\n\t\tEmployeeResult employeeResult = getJerseyClient().resource(getBaseUrl() + \"/employee/search/\"+textToFind).get(EmployeeResult.class);\n\t\tfor (EmployeeDTO c : employeeResult.getEmployees()) {\n\t\t\tSystem.out.println(\"Nombre: \"+c.getName());\n\t\t\tSystem.out.println(\"Apellido: \"+c.getSurname());\n\t\t\tSystem.out.println(\"Direccion: \"+c.getAddress());\n\t\t\tSystem.out.println(\"RUC: \"+c.getRUC());\n\t\t\tSystem.out.println(\"Telefono: \"+c.getCellphone());\n\t\t}\n\t\t\n\t}", "@Override\r\n\t@Transactional\r\n\tpublic List<EmployeeMaster> searchbyEmployee(String search_key) {\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\r\n\t\tList<EmployeeMaster> listcust = (List<EmployeeMaster>) sessionFactory.getCurrentSession()\r\n\t\t.createQuery(\"from EmployeeMaster WHERE obsolete ='N' \"\r\n\t\t\t\t+ \" AND user.role.role_Name <>'\" + constantVal.ROLE_SADMIN + \"' \"\r\n\t\t\t\t+ \" and emp_name LIKE '%\" + search_key + \"%'\").list();\r\n\t\treturn listcust;\r\n\t\t\r\n\t}", "public void search(String LastName)\n {\n //delare variables to hold file types\n BufferedReader fIn = null;\n \n //try to open the file for reading\n try\n {\n fIn = new BufferedReader(new FileReader(filename)); \n \n }\n catch(IOException ioe)\n {\n System.out.println(\"search: Exception opening the file\");\n }\n \n //try to read each record\n //if the value of the Last_name field equals the value\n /*\n create a counter to count the number of\n matching records\n */\n int counter = 0;\n \n try\n {\n //read the first record\n String line = fIn.readLine();\n \n //while the record is not null\n //split the record into fields\n //test if the field equals the LastName parameter\n //display the record and increment the counter\n //read the next record\n while(line != null)\n {\n String[] info = line.split(\",\");\n String last = info[0];\n if(last.equals(LastName))\n {\n System.out.print(line);\n counter += 1;\n }\n else\n {\n line = fIn.readLine();\n System.out.print(line);\n counter += 1;\n }\n line = fIn.readLine();\n }\n System.out.println(\"\\nTotal matching records found: \" + counter + \"\\n\");\n \n \n }\n catch(IOException ioe)\n {\n System.out.println(\"search: Exception reading the file\");\n }\n\n // try to close the file\n try\n {\n fIn.close(); \n \n }\n catch(IOException ioe)\n {\n System.out.println(\"search: Exception closing the file\");\n }\n \n //dislay a count of the records found\n \n \n }", "public List<User> findUsersByFirstNameContainsOrLastNameContains(String firstName, String lastName);", "public void searchByName() {\n System.out.println(\"enter a name to search\");\n Scanner sc = new Scanner(System.in);\n String fName = sc.nextLine();\n Iterator itr = list.iterator();\n while (itr.hasNext()) {\n Contact person = (Contact) itr.next();\n if (fName.equals(person.getFirstName())) {\n List streamlist = list.stream().\n filter(n -> n.getFirstName().\n contains(fName)).\n collect(Collectors.toList());\n System.out.println(streamlist);\n }\n }\n }", "public List<User> findEmployees(String companyShortName, int start, int rows, String sortBy, String sortHow);", "@Override\r\n\t@Transactional\r\n\tpublic List<EmployeeMaster> searchbyeyEmployee(String search_key, int branch_id) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\r\n\t\tList<EmployeeMaster> listemp = (List<EmployeeMaster>) sessionFactory.getCurrentSession()\r\n\t\t.createQuery(\"from EmployeeMaster WHERE\"\r\n\t\t\t\t+\" branchModel.branch_id = \"+ branch_id\r\n\t\t\t\t+\" and obsolete ='N'\"\r\n\t\t\t\t+\" and emp_name LIKE '%\" + search_key + \"%'\"\r\n\t\t\t\t+\" OR empcategory LIKE '%\" + search_key + \"%'\"\r\n\t\t\t\t+\" OR emp_address1 LIKE '%\" + search_key + \"%'\"\r\n\t\t\t\t+\" OR location.location_name LIKE '%\" + search_key + \"%'\"\r\n\t\t\t\t+\" OR location.address.city LIKE '%\" + search_key + \"%'\"\r\n\t\t\t\t+\" OR location.address.district LIKE '%\" + search_key + \"%'\"\r\n\t\t\t\t+\" OR location.address.state LIKE '%\" + search_key + \"%'\"\r\n\t\t\t\t+\" OR emp_phoneno LIKE '%\" + search_key + \"%'\"\r\n\t\t\t\t/*+\" OR emp_email LIKE '%\" + search_key + \"%'\"\r\n\t\t\t\t+\" OR dob LIKE '%\"+ search_key + \"%'\"\r\n\t\t\t\t+\" OR doj LIKE '%\" + search_key + \"%' AND user.role.role_Name <> '\"+ constantVal.ROLE_SADMIN +\"'\"*/).list();\r\n\t\treturn listemp;\r\n\t\t\r\n\t}", "public Address SearchContact(String firstName,String lastName) {\r\n int i = 0;\r\n while (!contact.get(i).getFirstName().equals(firstName) && !contact.get(i).getLastName().equals(lastName)){\r\n i++;\r\n }\r\n return contact.get(i);\r\n }", "public List<Employee> findAllByOrderByFirstName();", "public void searchPerson() {\r\n\r\n\t/*get values from text filed*/\r\n\tname = tfName.getText();\r\n\r\n\t/*clear contents of arraylist if there are any from previous search*/\r\n\tpersonsList.clear();\r\n\r\n // intialize recordNumber to zero\r\n\trecordNumber = 0;\r\n\r\n\tif(name.equals(\"\"))\r\n\t{\r\n\t\tJOptionPane.showMessageDialog(null,\"Please enter person name to search.\");\r\n\t}\r\n\telse\r\n\t{\r\n\t\t/*get an array list of searched persons using PersonDAO*/\r\n\t\tpersonsList = pDAO.searchPerson(name);\r\n\r\n\t\tif(personsList.size() == 0)\r\n\t\t{\r\n\t\t\tJOptionPane.showMessageDialog(null, \"No record found.\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t/*downcast the object from array list to PersonInfo*/\r\n\t\t\tPersonInfo person = (PersonInfo) personsList.get(recordNumber);\r\n\r\n // displaying search record in text fields \r\n\t\t\ttfName.setText(person.getName());\r\n\t\t\ttfAddress.setText(person.getAddress());\r\n\t\t\ttfPhone.setText(\"\"+person.getPhone());\r\n\t\t\ttfEmail.setText(person.getEmail());\r\n\t\t}\r\n\t}\r\n\r\n }", "List<Employee> findByName(String name);", "public void searchPerson() {\n\t\tSystem.out.println(\"*****Search a person*****\");\n\t\tSystem.out.println(\"Enter Phone Number to search: \");\n\t\tlong PhoneSearch = sc.nextLong();\n\t\tfor (int i = 0; i < details.length; i++) {\n\t\t\tif (details[i] != null && details[i].getPhoneNo() == PhoneSearch) {\n\t\t\t\tSystem.out.print(\"Firstname \\tLastname \\tAddress \\t\\tCity \\t\\tState \\t\\t\\tZIP \\t\\tPhone \\n\");\n\t\t\t\tSystem.out.println(details[i]);\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic List<Person> searchPerson(PersonSearchRequestModel personSearchRequestModel) {\n\t\t\n\t\tCriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();\n\t\tCriteriaQuery<Person> criteriaQuery = criteriaBuilder.createQuery(Person.class);\n\t\tRoot<Person> root = criteriaQuery.from(Person.class);\n\t\t\n\t\tString firstName = personSearchRequestModel.getFirstName();\n\t\tString lastName = personSearchRequestModel.getLastName();\n\t\tLocalDate startRangeDateOfBirth = personSearchRequestModel.getStartRangeBirthDate();\n\t\tLocalDate endRangeDateOfBirth = personSearchRequestModel.getEndRangeBirthDate();\n\t\tLong mobile = personSearchRequestModel.getMobile();\n\t\t\n\t\t/*\n\t\t * Adding search criteria's for query using CriteriaBuilder\n\t\t */\n\t\tList<Predicate> searchCriterias = new ArrayList<>();\n\t\t\n\t\tif( (firstName != \"\") && (firstName != null) ) {\n\t\t\tsearchCriterias.add( criteriaBuilder.like( root.get(\"firstName\"), \"%\"+firstName+\"%\") );\n\t\t}\n\t\tif( (lastName != \"\") && (lastName != null) ) {\n\t\t\tsearchCriterias.add( criteriaBuilder.like( root.get(\"lastName\"), \"%\"+lastName+\"%\") );\n\t\t}\n\t\tif( startRangeDateOfBirth!=null && endRangeDateOfBirth!=null && startRangeDateOfBirth.isAfter(endRangeDateOfBirth) ) {\n\t\t\tsearchCriterias.add( criteriaBuilder.between( root.get(\"birthDate\"), startRangeDateOfBirth, endRangeDateOfBirth) );\n\t\t}\n\t\tif( mobile!=null && mobile!=0 ) {\n\t\t\tsearchCriterias.add( criteriaBuilder.equal( root.get(\"mobile\"), mobile) );\n\t\t}\n\t\tcriteriaQuery.select( root ).where( criteriaBuilder.and( searchCriterias.toArray(new Predicate[searchCriterias.size()]) ));\n\t\treturn entityManager.createQuery(criteriaQuery).getResultList();\n\t}", "public List<Employe> findByEnameStartingWithAndEaddStartingWith(String name,String addrs);", "public void searchEmployee(TaxChallan taxChallan, HttpServletRequest request) {\r\n\t\tObject data[][] = null;\r\n\t\ttry {\r\n\t\t\tString challanQuery = \"SELECT HRMS_TAX_CHALLAN_DTL.CHALLAN_CODE,HRMS_TAX_CHALLAN_DTL.EMP_ID,EMP_TOKEN,EMP_FNAME||' '||EMP_MNAME||' '||EMP_LNAME,HRMS_TAX_CHALLAN_DTL.CHALLAN_TDS,\"\r\n\t\t\t\t\t+ \" TO_CHAR(NVL(HRMS_TAX_CHALLAN_DTL.CHALLAN_SURCHARGE,0), 9999999990.99),TO_CHAR(NVL(HRMS_TAX_CHALLAN_DTL.CHALLAN_EDU_CESS,0), 9999999990.99),TO_CHAR(NVL(HRMS_TAX_CHALLAN_DTL.CHALLAN_TOTAL_TAX,0), 9999999990.99) \" \r\n\t\t\t\t\t+ \" FROM HRMS_TAX_CHALLAN_DTL \"\r\n\t\t\t\t\t+ \" INNER JOIN HRMS_TAX_CHALLAN ON(HRMS_TAX_CHALLAN_DTL.CHALLAN_CODE=HRMS_TAX_CHALLAN.CHALLAN_CODE)\"\r\n\t\t\t\t\t+ \" INNER JOIN HRMS_EMP_OFFC ON(HRMS_TAX_CHALLAN_DTL.EMP_ID=HRMS_EMP_OFFC.EMP_ID)\"\r\n\t\t\t\t\t+ \" WHERE HRMS_TAX_CHALLAN_DTL.CHALLAN_CODE=\"\r\n\t\t\t\t\t+ taxChallan.getChallanID()\r\n\t\t\t\t\t+ \" ORDER BY EMP_FNAME||' '||EMP_MNAME||' '||EMP_LNAME\";\r\n\t\t\tdata = getSqlModel().getSingleResult(challanQuery);\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"exception in challanQuery in getChallanRecords method\",e);\r\n\t\t} //end of catch\r\n\t\t\r\n\t\tif(data.length> 0 && data!=null){\r\n\t\t\tint rownum = 0;\r\n\t\t\tfor (int i = 0; i < data.length; i++) {\r\n\t\t\t\tif(String.valueOf(data[i][1]).equals(taxChallan.getSearchForEmpId())){\r\n\t\t\t\t\trownum = i;\r\n\t\t\t\t} //end of if\r\n\t\t\t} //end of loop\r\n\t\t\tlogger.info(\"rownum======\"+rownum);\r\n\t\t\tint recPerPage = 20;\r\n\t\t\tString[] pageIndex = Utility.doPaging(taxChallan.getMyPage(), data.length, recPerPage);\r\n\t\t\tif (pageIndex == null) {\r\n\t\t\t\tpageIndex[0] = \"0\";\r\n\t\t\t\tpageIndex[1] = \"20\";\r\n\t\t\t\tpageIndex[2] = \"1\";\r\n\t\t\t\tpageIndex[3] = \"1\";\r\n\t\t\t\tpageIndex[4] = \"\";\r\n\t\t\t} //end of if\r\n\t\t\trequest.setAttribute(\"totalPage\", Integer.parseInt(String\r\n\t\t\t\t\t.valueOf(pageIndex[2])));\r\n\t\t\t\r\n\r\n\t\t\tif (pageIndex[4].equals(\"1\"))\r\n\t\t\t\ttaxChallan.setMyPage(\"1\");\r\n\t\t\t\r\n\t\t\ttaxChallan.setListFlag(\"true\");\r\n\t\t\tArrayList<Object> chList = new ArrayList<Object>();\r\n\t\t\t\r\n\t\t\tint startRecNo = 0;\r\n\t\t\tint endRecNo = 0;\r\n\t\t\t\r\n\t\t\tint pageDiv = rownum/recPerPage;\r\n\t\t\t\r\n\t\t\tstartRecNo = pageDiv * recPerPage;\r\n\t\t\tendRecNo = startRecNo + recPerPage - 1;\r\n\t\t\t\r\n\t\t\tif(data.length <= endRecNo){\r\n\t\t\t\tendRecNo = data.length-1;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlogger.info(\"startRecNo======\"+startRecNo);\r\n\t\t\tlogger.info(\"endRecNo======\"+endRecNo);\r\n\t\t\tint pageRemainder = (rownum+1)%recPerPage;\r\n\t\t\tlogger.info(\"pageRemainder======\"+pageRemainder);\r\n\t\t\t\r\n\t\t\tint highlightRec = 0;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(pageRemainder > 0){\r\n\t\t\t\tpageDiv = pageDiv+1;\r\n\t\t\t\thighlightRec = pageRemainder - 1;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tpageDiv = pageDiv+1;\r\n\t\t\t\thighlightRec = recPerPage - 1;\r\n\t\t\t}\r\n\t\t\trequest.setAttribute(\"highlightRec\", highlightRec);\r\n\t\t\tlogger.info(\"highlightRec======\"+highlightRec);\r\n\t\t\trequest.setAttribute(\"pageNo\", pageDiv);\r\n\t\t\ttaxChallan.setMyPage(String.valueOf(pageDiv));\r\n\t\t\t\r\n\t\t\ttry{\r\n\t\t\t\tfor (int i = startRecNo; i <= endRecNo; i++) {\r\n\t\t\t\t\tTaxChallan bean=new TaxChallan(); \r\n\t\t\t\t\tbean.setChallanCode(String.valueOf(data[i][0]));//Challan Code\r\n\t\t\t\t\tbean.setEmpId(String.valueOf(data[i][1]));//Employee Id\r\n\t\t\t\t\tbean.setEmpToken(String.valueOf(data[i][2]));//Token No.\r\n\t\t\t\t\tbean.setEmpName(String.valueOf(data[i][3]));//Emp Name\r\n\t\t\t\t\tbean.setChallanTax(Utility.twoDecimals(String.valueOf(data[i][4])));//Tds\r\n\t\t\t\t\tbean.setChallanSurcharge(Utility.twoDecimals(String.valueOf(data[i][5])));//Surcharge\r\n\t\t\t\t\tbean.setChallanEduCess(Utility.twoDecimals(String.valueOf(data[i][6])));//Education cess\r\n\t\t\t\t\tbean.setChallanTotTax(Utility.twoDecimals(String.valueOf(data[i][7])));\t//Total Tax\r\n\t\t\t\t\r\n\t\t\t\t\tchList.add(bean);\r\n\t\t\t\t} //end of loop\r\n\t\t\t}catch (Exception e) {\r\n\t\t\t\tlogger.error(\"exception in data loop\",e);\r\n\t\t\t} //end of catch\r\n\t\t\t taxChallan.setChallanList(chList);\r\n\t\t} //end of if\r\n\t\t\r\n\t\tint fromYear=0;\r\n\t\tint toYear=0;\r\n\t\tif(Integer.parseInt(taxChallan.getMonth())>=4 && Integer.parseInt(taxChallan.getMonth())<=12) {\r\n\t\t\tfromYear =Integer.parseInt(taxChallan.getYear());\r\n\t\t\ttoYear=fromYear+1;\r\n\t\t } //end of if\r\n\t\telse if(Integer.parseInt(taxChallan.getMonth())>=1 && Integer.parseInt(taxChallan.getMonth())<=3) {\r\n\t\t fromYear =Integer.parseInt(taxChallan.getYear())-1;\r\n\t\t toYear=Integer.parseInt(taxChallan.getYear());\r\n\t\t} //end of else if\t\r\n\t\t\r\n\t\tString empIncomeQuery = \"SELECT TO_CHAR(NVL(TDS_TAXABLE_INCOME,0), 9999999990.99),TDS_EMP_ID FROM HRMS_TDS \" \r\n\t\t\t+\" LEFT JOIN HRMS_EMP_OFFC ON (HRMS_EMP_OFFC.EMP_ID = HRMS_TDS.TDS_EMP_ID) \"\r\n\t\t\t+\" WHERE TDS_FROM_YEAR=\"+fromYear+\" AND TDS_TO_YEAR=\"+toYear+\" AND EMP_DIV = 22 \"\r\n\t\t\t+\" ORDER BY TDS_EMP_ID\";\r\n\t\t\tObject empTaxIncome[][] = getSqlModel().getSingleResult(empIncomeQuery);\r\n\t\t\t try {\r\n\t\t\t\t\tif(empTaxIncome != null && empTaxIncome.length != 0){\r\n\t\t\t\t\t\t ArrayList<Object> valuesList = new ArrayList<Object>();\r\n\t\t\t\t\t\t for (int i = 0; i < empTaxIncome.length; i++) {\r\n\t\t\t\t\t\t\t\t TaxChallan bean = new TaxChallan();\r\n\t\t\t\t\t\t\t\t bean.setHidListEmpId(String.valueOf(empTaxIncome[i][1]));\r\n\t\t\t\t\t\t\t\t bean.setHidListTdsIncome(String.valueOf(empTaxIncome[i][0]));\r\n\t\t\t\t\t\t\t\t valuesList.add(bean);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ttaxChallan.setValuesList(valuesList);\r\n\t\t\t\t\t }\r\n\t\t\t\t} catch (RuntimeException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\ttaxChallan.setEnterTotalTax(\"0\");\r\n\t\t\ttaxChallan.setAddedTds(\"0\");\r\n\t\t\ttaxChallan.setAddedSurcharge(\"0\");\r\n\t\t\ttaxChallan.setAddedEduCess(\"0\");\r\n\t\t\ttaxChallan.setAddEmpId(\"\");\r\n\t\t\ttaxChallan.setAddEmpToken(\"\");\r\n\t\t\ttaxChallan.setAddEmpName(\"\");\r\n\t\t\ttaxChallan.setF9AddEmpFlag(\"false\");\r\n\t\t\r\n\t}", "List<Student> findAllByLastNameLike(String lastName);", "@RequestMapping(\"/search\")\n public Collection<Employee> findByName(@RequestParam(\"name\") String name){\n return employeeService.findByName(name);\n }", "public List<Employee> findAllByOrderByLastNameAsc();", "public List<Employee> findAllByOrderByLastNameAsc();", "public List<Employee> findAllByOrderByLastNameAsc();", "public List<Employee> findAllByOrderByLastNameAsc();", "public List<Employee> findAllByOrderByLastNameAsc();", "public List<User> searchUser(String searchValue);", "private List<User> simulateSearchResult(String firstName)\n\t{\n\n\t\tArrayList<User> user=(ArrayList<User>) userService.getAllUsers();\n\t\tArrayList<User> result = new ArrayList<User>();\n\t\tfor (User u : user) {\n\t\t\tif (u.getFirstName().contains(firstName)) {\n\t\t\t\tresult.add(u);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}", "@Override\n\tpublic void searchByName() {\n\t\tcount = 0;\n\t\tif (UtilityClinic.patFile == null) {\n\t\t\ttry {\n\t\t\t\tutil.accessExistingPatJson();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"File not found\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tutil.readFromPatJson(UtilityClinic.patFile);\n\t\tSystem.out.println(\"Enter search.....\");\n\t\tString search = UtilityClinic.readString();\n\t\tSystem.out.println(\"Showing search result(s).......\");\n\t\tfor (int i = 0; i < UtilityClinic.patJson.size(); i++) {\n\t\t\tJSONObject jsnobj = (JSONObject) UtilityClinic.patJson.get(i);\n\t\t\tif (jsnobj.get(\"Patient's name\").toString().equals(search))\n\t\t\t\tSystem.out.print(\n\t\t\t\t\t\t++count + \" Name:\" + jsnobj.get(\"Patient's name\") + \" ID:\" + jsnobj.get(\"Patient's ID\")\n\t\t\t\t\t\t\t\t+ \" Mobile:\" + jsnobj.get(\"Mobile\") + \" Age:\" + jsnobj.get(\"Age\"));\n\t\t}\n\t\tif (count == 0) {\n\t\t\tSystem.out.println(\"No results found.....\");\n\t\t}\n\t}", "public List<User> getAllEmployees(String companyShortName);", "abstract public void search();", "@Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRED)\r\n\t@Override\r\n\tpublic List<Employee> getAllEmployee(Long id, String firstname, String lastname, String email) {\n\t\tCriterion firstnameCriterion = null;\r\n\t\tCriterion lastCriterion = null;\r\n\t\tCriterion emailCriterion = null;\r\n\t\tCriterion idCriterion = null;\r\n\r\n\t\tCriteria criteria = sessionFactory.getCurrentSession().createCriteria(Employee.class);\r\n\r\n\t\tif (!StringUtils.isEmpty(firstname)) {\r\n\t\t\tfirstnameCriterion = Restrictions.ilike(\"firstname\", firstname, MatchMode.ANYWHERE);\r\n\t\t}\r\n\r\n\t\tif (!StringUtils.isEmpty(lastname)) {\r\n\t\t\tlastCriterion = Restrictions.ilike(\"lastname\", firstname, MatchMode.ANYWHERE);\r\n\t\t}\r\n\r\n\t\tif (!StringUtils.isEmpty(email)) {\r\n\t\t\temailCriterion = Restrictions.ilike(\"email\", email, MatchMode.ANYWHERE);\r\n\t\t}\r\n\r\n\t\tif (!StringUtils.isEmpty(id)) {\r\n\t\t\tidCriterion = Restrictions.eq(\"id\", id);\r\n\t\t}\r\n\r\n\t\tif (!StringUtils.isEmpty(idCriterion)) {\r\n\t\t\tcriteria.add(idCriterion);\r\n\t\t}\r\n\t\tDisjunction disjunctions = Restrictions.disjunction();\r\n\r\n\t\tif (null != firstnameCriterion) {\r\n\t\t\tdisjunctions.add(firstnameCriterion);\r\n\t\t}\r\n\r\n\t\tif (null != lastCriterion) {\r\n\t\t\tdisjunctions.add(lastCriterion);\r\n\t\t}\r\n\r\n\t\tif (null != emailCriterion) {\r\n\t\t\tdisjunctions.add(emailCriterion);\r\n\t\t}\r\n\r\n\t\tcriteria.add(disjunctions);\r\n\r\n\t\treturn criteria.list();\r\n\t}", "@CrossOrigin(origins = \"http://localhost:3000\")\n @RequestMapping(value = \"/getByName\", method = RequestMethod.GET, produces = \"application/json\")\n public Page<Student> getStudentsByFirstLastName(@RequestParam(value = \"fName\", required = false) String firstName,\n @RequestParam(value = \"lName\", required = false) String lastName,\n @RequestParam(\"page\") int page,\n @RequestParam(\"size\") int size\n ){\n page = page <0 ? PAGINATION_DEFAULT_PAGE : page;\n size = (size <0) ? PAGINATION_DEFAULT_SIZE: size;\n return studentService.findStudentByNamePagingCriteria(firstName, lastName, PageRequest.of(page, size));\n }", "Customer search(String login);", "@Query(\"MATCH (p:Person) \" + \"WHERE LOWER(p.firstName) CONTAINS LOWER({0}) \"\n + \"AND LOWER(p.lastName) CONTAINS LOWER({1}) \" + \"RETURN p\")\n Iterable<Person> locateByFirstLast(String firstName, String lastName);", "public static Employee queryStuff(String firstName){\n\t\tDatastoreService datastore = DatastoreServiceFactory.getDatastoreService();\n\t\tQuery q = buildAQuery(firstName);\n\t\t// Use PreparedQuery interface to retrieve results\n\t\tPreparedQuery pq = datastore.prepare(q);\n\t\t//Loops through all results. In our case, we are going to just use the first one\n\t\tfor (Entity result : pq.asIterable()) {\n\t\t\t\n\t\t\t//Get results via the properties\n\t\t\tString actualFirstName = (String) result.getProperty(\"firstName\");\n\t\t\tString actualLastName = (String) result.getProperty(\"lastName\");\n\t\t\tboolean attendedHrTraining = (boolean) result.getProperty(\"attendedHrTraining\");\n\t\t\tDate hireDate = (Date) result.getProperty(\"hireDate\");\n\t\t\tLong id = (Long) result.getKey().getId();\n\t\t\t\n\t\t\t//Build an employee\n\t\t\tEmployee emp = new Employee();\n\t\t \temp.setFirstName(actualFirstName);\n\t\t \temp.setLastName(actualLastName);\n\t\t \temp.setAttendedHrTraining(attendedHrTraining);\n\t\t \temp.setHireDate(hireDate);\n\t\t \temp.setId(id);\n\t\t \t\n\t\t \treturn emp;\n\t\t}\n\t\treturn null;\n\t}", "@GetMapping(value=\"/searchEmpData\")\n\tpublic List<Employee> getAllEmployees()\n\t{\n\t\treturn this.integrationClient.getAllEmployees();\n\t}", "@Override\r\n\t@Transactional\r\n\tpublic List<EmployeeMaster> searchbyEmployee4SA(String search_key) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\r\n\t\tList<EmployeeMaster> listcust = (List<EmployeeMaster>) sessionFactory.getCurrentSession()\r\n\t\t.createQuery(\"from EmployeeMaster WHERE obsolete ='N' and emp_name LIKE '%\" + search_key + \"%'\").list();\r\n\t\treturn listcust;\r\n\t\t\r\n\t}", "private static void searchStaffByName(){\n\t\tshowMessage(\"type the name you are looking for: \\n\");\n\t\tString name = getUserTextTyped();\n\t\tToScreen.listEmployee(EmployeeSearch.employee(employee.getAllEmployee(),name), true);\n\t\t\n\t\t//condition to do another search by name or go back to the main menu\n //if the user decide for doing another search the method is called again, otherwise it will go back to the main menu\n\t\tint tryAgain = askForGoMainMenu(\"Would you like to search for another name or go back to main menu?\\n Type 1 to search someone else \\n Type 0 to go to menu. \\n Choice: \");\n\t\tif(tryAgain == 1){\n\t\t\tsearchStaffByName();\n\t\t} else {\n\t\t\tmain();\n\t\t}\n\t}", "List<User> findByFirstname(String firstName);", "@Override\n\tpublic List<User> searchByUser(String userName) {\n\t\tlog.info(\"Search by username!\");\n\t\treturn userRepository.findByFirstNameRegex(userName+\".*\");\n\t}", "@RestResource(path = \"search\", rel = \"search\")\n List<MonographEditors> findByFirstNameContainingAndLastNameContainingAndMiddleNameContainingAndEmailContainingAndAffiliationsContainingAllIgnoreCase(\n @Param(\"firstName\") String firstName,\n @Param(\"lastName\") String lastName,\n @Param(\"middleName\") String middleName,\n @Param(\"email\") String email,\n @Param(\"affiliations\") String affiliations);", "List<Person> findByLastName(String lastName);", "public void search() {\n listTbagendamentos\n = agendamentoLogic.findAllTbagendamentoByDataAndPacienteAndFuncionario(dataSearch, tbcliente, tbfuncionario);\n }", "public void research() throws Exception\r\n\t{\r\n\t\tresult = ((CLibraryManager)AUser.getInstance()).searchUser(jTextField_UserName.getText(),jTextField_UserID.getText(),jTextField_FirstName.getText(),jTextField_LastName.getText());\r\n\t}", "List<Customer> findByFirstNameAndLastName(String firstName, String lastName);", "public void search() {\r\n \t\r\n }", "Iterable<Customer> findByLastName(String lastName);", "List<Employee> findAllByName(String name);", "@Repository(\"userRepository\")\npublic interface UserRepository extends JpaRepository<User, UUID> {\n\n User findByEmail(String email);\n\n List<User> findByFirstNameIgnoreCaseContaining(String firstName);\n\n List<User> findByLastNameIgnoreCaseContaining(String lastName);\n\n List<User> findByEmailIgnoreCaseContaining(String email);\n\n @Query(\"SELECT t FROM User t WHERE \" +\n \"LOWER(t.lastName) LIKE LOWER(CONCAT('%',:searchTerm, '%')) OR \" +\n \"LOWER(t.firstName) LIKE LOWER(CONCAT('%',:searchTerm, '%'))\")\n Page<User> searchByTerm(@Param(\"searchTerm\") String searchTerm, Pageable pageable);\n}", "public void search() {\n String q = this.query.getText();\n String cat = this.category.getValue();\n if(cat.equals(\"Book\")) {\n searchBook(q);\n } else {\n searchCharacter(q);\n }\n }", "public static List<StudentInfo> searchStudentInfo(String firtname, String lastname) {\r\n \r\n List<StudentInfo> students = new ArrayList<>();\r\n \r\n // declare resultSet\r\n ResultSet rs = null;\r\n \r\n // declare prepared statement\r\n PreparedStatement preparedStatement = null;\r\n \r\n // declare connection\r\n Connection conn = null;\r\n try {\r\n // get connection\r\n conn = DBUtils.getConnection();\r\n\r\n // set prepared statement\r\n preparedStatement = conn\r\n .prepareStatement(\"SELECT instructor.FName, instructor.LName,\" +\r\n \" IF(EXISTS ( SELECT * FROM gra WHERE gra.StudentId = phdstudent.StudentId) , 'GRA', \" +\r\n \" IF(EXISTS ( SELECT * FROM gta WHERE gta.StudentId = phdstudent.StudentId) , 'GTA', \" +\r\n \" IF(EXISTS ( SELECT * FROM scholarshipsupport WHERE scholarshipsupport.StudentId = phdstudent.StudentId) , 'scholarship', \" +\r\n \" IF(EXISTS ( SELECT * FROM selfsupport WHERE selfsupport.StudentId = phdstudent.StudentId) , 'self', ''))\" +\r\n \" )) AS StudentType, \" +\r\n \" milestone.MName, milestonespassed.PassDate\" +\r\n \" FROM phdstudent left join instructor on instructor.InstructorId = phdstudent.Supervisor\"\r\n + \" left join milestonespassed on phdstudent.StudentId = milestonespassed.StudentId\"\r\n + \" left join milestone on milestonespassed.MID = milestone.MID\" +\r\n \" WHERE phdstudent.FName = ? AND phdstudent.LName = ?\");\r\n \r\n // execute query\r\n preparedStatement.setString(1, firtname);\r\n preparedStatement.setString(2, lastname); \r\n\r\n rs = preparedStatement.executeQuery();\r\n \r\n //iterate and create the StudentInfo objects\r\n while (rs.next()) {\r\n \r\n students.add(new StudentInfo(rs.getString(1)+ \" \" + rs.getString(2), rs.getString(3), rs.getString(4), \r\n utils.Utils.toDate(rs.getDate(5))));\r\n\r\n }\r\n }catch(Exception ex){\r\n ex.printStackTrace();\r\n }\r\n finally {\r\n DBUtils.closeResource(conn);\r\n DBUtils.closeResource(preparedStatement);\r\n DBUtils.closeResource(rs);\r\n } \r\n \r\n return students; \r\n }", "List<Customer> findByLastName(String lastName);", "public List<User> listSearch(String search);", "List<AddressbookEntry> findByLastNameLike(String pattern);", "@In String search();", "public List<Employee> findEmployee(String name) {\n\t\tCriteriaQuery<Employee> createQuery = emp.getCriteriaBuilder().createQuery(Employee.class);\n\t\tRoot<Employee> root = createQuery.from(Employee.class);\n\t\tcreateQuery.where(root.get(\"name\").in(name));\n\t\treturn emp.createQuery(createQuery).getResultList();\n\t}", "List<ResultDTO> searchUser(String query);", "@GetMapping(\"/search/results\")\n public String showClientsByNameAndLastName(Model model, @ModelAttribute(CUSTOMER) CustomerDTO customerDTO) {\n Customer customer = mapDTOCustomerToPersistent(customerDTO);\n model.addAttribute(CUSTOMERS, customerService.findByNameAndLastName(customer.getFirstName(), customer.getLastName()));\n return CUSTOMERS_INDEX;\n }", "void search();", "void search();", "public void searchFunction() {\n textField_Search.textProperty().addListener(new ChangeListener<String>() {\n @Override\n public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {\n tableView.setPredicate(new Predicate<TreeItem<EntryProperty>>() {\n @Override\n public boolean test(TreeItem<EntryProperty> entryTreeItem) {\n Boolean flag = entryTreeItem.getValue().titleProperty().getValue().toLowerCase().contains(newValue.toLowerCase()) ||\n entryTreeItem.getValue().usernameProperty().getValue().toLowerCase().contains(newValue.toLowerCase());\n return flag;\n }\n });\n }\n });\n }", "List<SearchResult> search(SearchQuery searchQuery);", "@SuppressWarnings(\"unused\")\n\t@Override\n\tpublic ArrayList<Object> searchUserByName(String search) {\n\t\t\n\t\tSystem.out.println(\"i am in service search looking for users\" + search.length());\n\t\t\n\t\tif(search == null){\n\t\t\t\n\t\t\tSystem.out.println(\"nothing can be find\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"its not 0000000000\");\n\t\t\n\t\tArrayList<Object> list = userRepository.findUserByName(search);\n\t\t\n\t\t//System.out.println(Arrays.toString(list));\n\t\treturn list;\n\t}", "@GetMapping(\"/search\")\n public String findClientByNameAndLastName(Model model) {\n Customer customer = new Customer();\n model.addAttribute(CUSTOMER, customer);\n return CUSTOMERS_SEARCH;\n }", "public List<Employe> findByEnameInOrEaddIn(List<String> names,List<String> addresses);", "List<DataTerm> search(String searchTerm);", "public Student findStudent(String firstName, String lastName)\n\t{\n\t\tStudent foundStudent = null;\t\n\t\tfor(Student b : classRoll)\n\t\t{\n\t\t\t\n\t\t\tif (b.getStrNameFirst ( ) != null && b.getStrNameFirst().contains(firstName))\n\t\t\t{\n\t\t\t\tif(b.getStrNameLast ( ) != null && b.getStrNameLast().contains(lastName))\n\t\t\t\t{\n\t\t\t\t\tfoundStudent = b;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn foundStudent;\n\t}", "public static void findEmployeeByLastName(String lastName) {\n List<Employee> employees = null;\n try {\n employees = EmployeeRepository.findByLastName(dataSource, lastName);\n } catch (SQLException e) {\n LOGGER.error(e.getMessage());\n }\n if (employees.isEmpty()) {\n LOGGER.warn(\"The employee with the last name of \" + lastName + \" was not found in the list\");\n System.out.println(resourceBundle.getString(\"emp\") + \" \" + resourceBundle.getString(\"not.found\") + \" \" + lastName + \" \"\n + resourceBundle.getString(\"not.in.list\"));\n return;\n }\n employees.forEach(System.out::println);\n }", "public User search_userinfo(String user_name);", "List<EmployeeDTO> findByName(String name);", "public static List<Employee> getAllEmployees(){\n\t\t// Get the Datastore Service\n\t\tlog.severe(\"datastoremanager-\" + 366);\n\t\tDatastoreService datastore = DatastoreServiceFactory.getDatastoreService();\n\t\tlog.severe(\"datastoremanager-\" + 368);\n\t\tQuery q = buildAQuery(null);\n\t\tlog.severe(\"datastoremanager-\" + 370);\n\t\t// Use PreparedQuery interface to retrieve results\n\t\tPreparedQuery pq = datastore.prepare(q);\n\t\tlog.severe(\"datastoremanager-\" + 373);\n\t\t//List for returning\n\t\tList<Employee> returnedList = new ArrayList<>();\n\t\tlog.severe(\"datastoremanager-\" + 376);\n\t\t//Loops through all results and add them to the returning list \n\t\tfor (Entity result : pq.asIterable()) {\n\t\t\tlog.severe(\"datastoremanager-\" + 379);\n\t\t\t//Vars to use\n\t\t\tString actualFirstName = null;\n\t\t\tString actualLastName = null;\n\t\t\tBoolean attendedHrTraining = null;\n\t\t\tDate hireDate = null;\n\t\t\tBlob blob = null;\n\t\t\tbyte[] photo = null;\n\t\t\t\n\t\t\t//Get results via the properties\n\t\t\ttry {\n\t\t\t\tactualFirstName = (String) result.getProperty(\"firstName\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\tactualLastName = (String) result.getProperty(\"lastName\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\tattendedHrTraining = (Boolean) result.getProperty(\"attendedHrTraining\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\thireDate = (Date) result.getProperty(\"hireDate\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\tblob = (Blob) result.getProperty(\"picture\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\tphoto = blob.getBytes();\n\t\t\t} catch (Exception e){}\n\t\t\tlog.severe(\"datastoremanager-\" + 387);\n\t\t\t\n\t\t\t//Build an employee (If conditionals for nulls)\n\t\t\tEmployee emp = new Employee();\n\t\t \temp.setFirstName((actualFirstName != null) ? actualFirstName : null);\n\t\t \temp.setLastName((actualLastName != null) ? actualLastName : null);\n\t\t \temp.setAttendedHrTraining((attendedHrTraining != null) ? attendedHrTraining : null);\n\t\t \temp.setHireDate((hireDate != null) ? hireDate : null);\n\t\t \temp.setPicture((photo != null) ? photo : null);\n\t\t \tlog.severe(\"datastoremanager-\" + 395);\n\t\t \treturnedList.add(emp);\n\t\t}\n\t\tlog.severe(\"datastoremanager-\" + 398);\n\t\treturn returnedList;\n\t}", "public List<Partner> searchPartners(String searchText) throws SQLException {\n QueryBuilder<Partner, String> qb = partnerDao.queryBuilder();\n Where<Partner, String> where = qb.where();\n\n where.like(\"FirstName\", '%'+searchText+'%')\n .or()\n .like(\"LastName\", '%'+searchText+'%')\n .or()\n .like(\"Phone\", '%'+searchText+'%')\n .or()\n .like(\"CompanyName\", '%'+searchText+'%');\n\n PreparedQuery<Partner> preparedQuery = qb.prepare();\n\n return partnerDao.query(preparedQuery);\n }", "@PreAuthorize(\"hasAnyAuthority(T(rs.acs.uns.sw.sct.util.AuthorityRoles).ADMIN, T(rs.acs.uns.sw.sct.util.AuthorityRoles).ADVERTISER, T(rs.acs.uns.sw.sct.util.AuthorityRoles).VERIFIER)\")\n @GetMapping(\"/users/search\")\n public ResponseEntity<List<UserDTO>> search(@RequestParam(value = \"username\", required = false) String username,\n @RequestParam(value = \"email\", required = false) String email,\n @RequestParam(value = \"firstName\", required = false) String firstName,\n @RequestParam(value = \"lastName\", required = false) String lastName,\n @RequestParam(value = \"phoneNumber\", required = false) String phoneNumber,\n @RequestParam(value = \"companyName\", required = false) String companyName,\n Pageable pageable) {\n\n List<UserDTO> list = userService.findBySearchTerm(username, email, firstName, lastName, phoneNumber, companyName, pageable)\n .stream().map(user -> user.convertToDTO()).collect(Collectors.toList());\n\n return new ResponseEntity<>(list, HttpStatus.OK);\n }", "private Collection<Record> getResults(SimpleSurnameAndPostcodeQuery query) {\n\t\treturn search(query);\n\t}", "@RequestMapping(value = \"/getAllNamesStartWith\", method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE })\r\n\tpublic List<Employee> getNamesStartWith(@RequestParam String name){\r\n\t\treturn repository.getAllEmpoyees().stream().filter(emp -> emp.getEmpName().startsWith(name)).collect(Collectors.toList());\r\n\t}", "public ArrayList<Customer> findCustomer(String searchText) {\r\n\t\tsearchText = searchText.toLowerCase();\r\n\t\tArrayList<Customer> customers = new ArrayList<Customer>();\r\n\t\ttry (ResultSet result = manager.performSql(\"SELECT id FROM Customer WHERE LOWER(first_name || ' ' || last_name) LIKE '%\" + searchText + \"%'\")) {\r\n\t\t\twhile (result.next()) {\r\n\t\t\t\tcustomers.add(manager.getCustomer(result.getInt(1)));\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn customers;\r\n\t}", "public AddressBook search(String query)\n {\n Integer count = 0;\n Integer size = addressEntryList.size();\n AddressBook ab = new AddressBook();\n int indexes[] = new int[size];\n //For loop, iterating through our entire list of Address Entries\n for (int i = 0; i < addressEntryList.size(); i++)\n {\n //If the lastname is the search query\n if(addressEntryList.get(i).getLastName().contains(query))\n {\n indexes[count] = i;\n count++;\n }\n }\n //If we found anything\n if (count > 0)\n {\n //Add entries found\n for (int i = 0; i < count; i++)\n {\n ab.addressEntryList.add(addressEntryList.get(indexes[i]));\n }\n }\n //No entries were found\n else {\n System.out.println(\"No entries were found.\");\n }\n\n return ab;\n\n }", "Search getSearch();", "public List<EmployeeEntity> getEmployeeDataByName(String name, StorageContext context)\n\t\t\tthrows PragmaticBookSelfException {\n\t\tList<EmployeeEntity> result = null;\n\t\ttry {\n\t\t\tSession hibernateSeesion = context.getHibernateSession();\n\t\t\tString retrieveEmployeebyNameQuery = \"FROM EmployeeEntity e WHERE e.fname LIKE :fname or e.lname LIKE :lname\";\n\t\t\tQuery query = hibernateSeesion.createQuery(retrieveEmployeebyNameQuery);\n\t\t\tquery.setParameter(\"fname\", name);\n\t\t\tquery.setParameter(\"lname\", name);\n\t\t\tresult = (List<EmployeeEntity>) query.list();\n\t\t} catch (HibernateException he) {\n\t\t\tthrow new PragmaticBookSelfException(he);\n\t\t}\n\t\treturn result;\n\t}", "public Employee SearchEmployee(int idEmployee)\n\t{\n\t\tfor(int i = 0; i < departments.size() ; i++)\n\t\t{\n\t\t\tfor(Employee emp : departments.get(i).getEmployeeList())\n\t\t\t{\n\t\t\t\tif(emp.getIdEmployee()==idEmployee) return emp;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private void searchPerson(String searchName){\r\n\r\n textAreaFromSearch.setText(\"\");\r\n try{\r\n Scanner scanner = new Scanner(file);\r\n String info;\r\n\r\n while (scanner.hasNext()){\r\n String line = scanner.nextLine();\r\n String[] components = line.split(separator);\r\n if (searchName.length() == 0){\r\n return;\r\n }\r\n if (components[0].contains(searchName)){\r\n info = \" Name: \" + components[0] + \"\\n\";\r\n info += \" Phone No.: \"+components[1]+\"\\n\";\r\n info += \" Email: \"+components[2]+\"\\n\";\r\n info += \" Address: \"+components[3]+\"\\n\";\r\n textAreaFromSearch.append(info+\"\\n\");\r\n }\r\n }\r\n }catch (IOException e){\r\n fileError();\r\n }\r\n }", "private void searchFunction() {\n\t\t\r\n\t}", "@Test\n public void testSearchUsersByName() {\n token.setGroupId(findMemberGroup(token).getGroupId());\n\n // Setting a partial name to search for. The search will look at both\n // first and last names which contain this as part of their name. In\n // this case, we're searching for \"man\", which will yield the following:\n // - Germany\n // - Oman\n // - Romania\n final SearchUserRequest request = new SearchUserRequest();\n request.setName(\"man\");\n\n // Now, invoke the search for users with a partial name given\n final SearchUserResponse response = administration.searchUsers(token, request);\n\n // And verify the result\n assertThat(response.isOk(), is(true));\n assertThat(response.getUsers().size(), is(3));\n }", "@Override\n\tpublic List<Customer> searchCustomers(String theSearchName) {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\t\t\n\t\tQuery theQuery = null;\n\t\t\n\t\t// only search by name if theSearchName is not empty\n\t\tif(theSearchName != null && theSearchName.trim().length() > 0) {\n\t\t\ttheQuery = currentSession.createQuery(\"from Customer where \"\n\t\t\t\t\t+ \"lower(firstName) like :theName or lower(lastName) \"\n\t\t\t\t\t+ \"like :theName\", Customer.class);\n\t\t\t\n\t\t\ttheQuery.setParameter(\"theName\", \"%\" + theSearchName.toLowerCase() + \"%\");\n\t\t}\n\t\telse {\n\t\t\t// theSearchName is empty, so get all the customers\n\t\t\ttheQuery=currentSession.createQuery(\"from Customer\", Customer.class);\n\t\t}\n\t\t\n\t\t// execute query and get result list\n\t\tList<Customer> customers = theQuery.getResultList();\n\t\t\n\t\treturn customers;\n\t}", "@GET\n\t@Path(\"/search/{empName}\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response getByName(@PathParam(\"empName\") String name) {\n\t\tEmployeeFacade employeeFacade = new EmployeeFacade();\n\t\tGenericEntity<List<EmployeeVO>> generic = new GenericEntity<List<EmployeeVO>>(employeeFacade.findByName(name)) {};\n\t\treturn Response.status(200).header(\"Access-Control-Allow-Origin\", CorsFilter.DEFAULT_ALLOWED_ORIGINS).entity(generic).build();\n\t}", "public void searchLeadForm(String firstName, String lastName) {\n\t\tactionbot.type(By.id(\"search_name_basic\"), firstName + \" \" + lastName);\n\t\tactionbot.click(By.id(\"search_form_submit\"));\n\t}", "@Override\r\n\t@Transactional\r\n\tpublic List<EmployeeMaster> searchDriver(String search_key) {\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\r\n\t\tList<EmployeeMaster> listemp = (List<EmployeeMaster>) sessionFactory.getCurrentSession()\r\n\t\t.createQuery(\"from EmployeeMaster WHERE obsolete ='N'\"\r\n\t\t\t\t+ \" AND empcategory LIKE '%Driver%'\"\t\r\n\t\t\t\t+ \"and emp_name LIKE '%\"+search_key+\"%'\").list();\r\n\t\treturn listemp;\r\n\t\t\r\n\t}", "public List<Product> search(String searchString);", "@RestResource(path = \"search1\", rel = \"search1\")\n List<MonographEditors> findByNumOrderAndFirstNameContainingAndLastNameContainingAndMiddleNameContainingAndEmailContainingAndAffiliationsContainingAndPersonIdAllIgnoreCase(\n @Param(\"numOrder\") Integer numOrder,\n @Param(\"firstName\") String firstName,\n @Param(\"lastName\") String lastName,\n @Param(\"middleName\") String middleName,\n @Param(\"email\") String email,\n @Param(\"affiliations\") String affiliations,\n @Param(\"personId\") Long personId);", "static int searchFirstname(String firstName) {\n for (Person p : people) {\n if (p.getFirstName().contains(firstName))\n return people.indexOf(p);//returns the index of people in the list.\n\n }\n return -1;\n }", "public static void SearchAction() {\r\n\t\r\n \r\n ActionListener actionListener = new ActionListener() {\r\n public void actionPerformed(ActionEvent event) {\r\n \t try {\r\n\t\t\tConnection con=DriverManager.getConnection( \r\n\t\t\t \t\t\"jdbc:mysql://localhost:3306/Test\",\"root\",\"Tdd&08047728\");\r\n\t\t\tString c = SearchField.getText();\r\n\t\t\tStatement stmt = con.createStatement();\r\n\t\t String query[] = {\r\n\t\t \"SELECT * FROM capstonedatabase5.employees\", \r\n\t\t \"select EmployeeName from capstonedatabase5.employees where EmployeeName like'\" + c +\"_'\" \r\n\t\t \r\n\t\t };\r\n\t\t \r\n\t\t for(String q : query) {\r\n\t\t ResultSet r = stmt.executeQuery(q);\r\n\t\t System.out.println(\"Names for query \"+q+\" are\");\r\n\t\t \r\n\t\t while (r.next()) {\r\n\t\t String name = r.getString(\"EmployeeName\");\r\n\t\t System.out.print(name+\" \");\r\n\t\t }\r\n\t\t System.out.println();\r\n\t\t }\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} \r\n \r\n }\r\n };\r\n\r\n SearchButton2.addActionListener(actionListener);\r\n }", "@RestResource(path = \"search4\", rel = \"search\")\n List<MonographEditors> findByFirstNameContainingAndLastNameContainingAndMiddleNameContainingAndEmailContainingAndAffiliationsContainingAndMonographOfPapersIdAllIgnoreCase(\n @Param(\"firstName\") String firstName,\n @Param(\"lastName\") String lastName,\n @Param(\"middleName\") String middleName,\n @Param(\"email\") String email,\n @Param(\"affiliations\") String affiliations,\n @Param(\"monographOfPapersId\") Long monographOfPapersId);", "List<User> searchUsersByUsername(String username);" ]
[ "0.7314662", "0.72372746", "0.6775847", "0.669932", "0.6698817", "0.65063196", "0.6460672", "0.64548737", "0.6454842", "0.64523405", "0.6441554", "0.6434485", "0.64312494", "0.6392926", "0.63548595", "0.6344629", "0.6323708", "0.63040376", "0.62938064", "0.62811923", "0.62708247", "0.6270226", "0.62518966", "0.624741", "0.6233996", "0.6230699", "0.6177232", "0.61681396", "0.61681396", "0.61681396", "0.61681396", "0.61681396", "0.61661494", "0.6155134", "0.6140862", "0.61397773", "0.61384207", "0.6129472", "0.6122449", "0.61147773", "0.6110877", "0.6108256", "0.6080757", "0.60792226", "0.60658616", "0.60561633", "0.60545474", "0.6032228", "0.60286254", "0.6018454", "0.60172427", "0.6001256", "0.5996558", "0.5996309", "0.59941983", "0.59892243", "0.5948964", "0.5947183", "0.59140205", "0.59026384", "0.5896044", "0.58848923", "0.58788776", "0.5876339", "0.58752555", "0.58743066", "0.58743066", "0.5857478", "0.58435863", "0.5843286", "0.5841362", "0.5832712", "0.582353", "0.58156675", "0.5810853", "0.58103484", "0.5809623", "0.58078593", "0.5807348", "0.5807088", "0.5801147", "0.5793797", "0.5793321", "0.57896113", "0.5789573", "0.57794785", "0.5772758", "0.5770308", "0.5765764", "0.5764644", "0.57633656", "0.57587206", "0.5756007", "0.575004", "0.5743367", "0.57405454", "0.57404065", "0.57395613", "0.57329905", "0.57297075" ]
0.6425071
13
Clone method This method gets as parameter an Employee object and clone all the attribute to the object that calls the methods
public void clone(Employee theEmployee) { this.setUsername(theEmployee.getUsername()); this.setPassword(theEmployee.getPassword()); this.setFirstname(theEmployee.getFirstname()); this.setLastname(theEmployee.getLastname()); this.setDoB(theEmployee.getDoB()); this.setContactNumber(theEmployee.getContactNumber()); this.setEmail(theEmployee.getEmail()); this.setSalary(theEmployee.getSalary()); this.setPositionStatus(theEmployee.getPositionStatus()); this.homeAddress.clone(theEmployee.getHomeAddress()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\tEmployee e = (Employee)super.clone();\r\n\t\te.add = this.add.clone(); //Clone method of Address class\r\n\t\treturn e;\r\n\t}", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\tEmployee eClone = (Employee) super.clone();\r\n\t\teClone.setDeparment((Deparment) eClone.getDeparment().clone());\r\n\t\treturn eClone;\r\n\t}", "public static void main(String[] args) throws CloneNotSupportedException\n {\n ArrayList<String> companies = new ArrayList<String>();\n companies.add(\"Baidu\");\n companies.add(\"Tencent\");\n companies.add(\"Ali\");\n WorkExprience workExprience = new WorkExprience(companies);\n String nameString = new String(\"Tom\");\n String genderString = new String(\"male\");\n Resume resume = new Resume(nameString, 23, genderString, workExprience);\n System.out.println(\"Source Resume\");\n resume.printResum();\n \n ArrayList<String> companies1 = new ArrayList<String>();\n companies1.add(\"Google\");\n companies1.add(\"Microsoft\");\n companies1.add(\"Oracle\");\n Resume copyResume = (Resume)resume.clone();\n String nameString1 = new String(\"Jerry\");\n String genderString1 = new String(\"Fmale\");\n copyResume.setName(nameString1);\n copyResume.setAge(20);\n copyResume.setGender(genderString1);\n copyResume.getWorkExprience().setCompanyArrayList(companies1);\n System.out.println();\n System.out.println(\"Source Resume\");\n resume.printResum();\n System.out.println();\n System.out.println(\"Copy Resume\");\n copyResume.printResum();\n }", "public static void main(String[] args)\n\t\t\tthrows CloneNotSupportedException\n\t{\n\t\t\n\t\tEmployee e1 = new Employee(210,\"Raj\");\n\t\tDepartment dep = new Department(\"Administration\",\"A298\");\n\t\te1.show();\n\t\tEmployee e2 = (Employee)e1.clone();\n\t\te2.show();\n\t\tdep.show();\n\t\tDepartment dep1 = (Department)dep.clone();\n\t\tdep1.show();\n\t\t\n\t\n\t\t\n\t}", "public EmployeeSet(Object obj)\n\t{\n\t\tif((obj != null) && (obj instanceof EmployeeSet))\n\t\t{\n\t\t\t//proceed to create a new instance of EmployeeSet\n\t\t\tEmployeeSet copiedEmployeeSet = (EmployeeSet) obj;\n\t\t\tthis.employeeData = copiedEmployeeSet.employeeData;\n\t\t\tthis.numOfEmployees = copiedEmployeeSet.numOfEmployees;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//throw new IllegalArgumentException(\"Unable to activate copy constructor. Object to be copied from is either a null object or is not an EmployeeSet object\");\n\t\t\tSystem.out.println(\"ERROR: Unable to activate copy constructor. Object to be copied from is either a null object or is not an EmployeeSet object\");\n\t\t}\n\t}", "public static EmployeeDTO valueOf(Employee employee){\n EmployeeDTO employeeDTO = new EmployeeDTO();\n BeanUtils.copyProperties(employee, employeeDTO);\n// employeeDto.setId( employee.getId() );\n// employeeDto.setFirstName( employee.getFirstName() );\n\n return employeeDTO;\n\n }", "@Override\n\tpublic void ModifyEmployee() {\n\t\t\n\t}", "public Employee(EmployeeDto e) {\n\t\tthis.id = e.getId();\n\t\tthis.firstName = e.getFirstName();\n this.lastName = e.getLastName();\n\t\tthis.dateOfBirth = e.getDateOfBirth();\n\t\tthis.gender = e.getGender();\n\t\tthis.startDate = e.getStartDate();\n\t\tthis.endDate = e.getEndDate();\n\t\tthis.position = e.getPosition();\n this.monthlySalary = e.getMonthlySalary();\n this.hourSalary = e.getHourSalary();\n this.area = e.getArea();\n this.createdAt = e.getCreatedAt();\n this.modifiedAt = e.getModifiedAt();\n\t}", "public Function clone();", "public abstract Pessoa clone();", "Object clone();", "Object clone();", "public DessertVO clone() {\r\n return (DessertVO) super.clone();\r\n }", "@Override\n public Object clone ( ) throws CloneNotSupportedException {\n CTEUser clonedUser = (CTEUser) _user.clone();\n MoveCursorToHome clone = new MoveCursorToHome(clonedUser);\n return clone;\n }", "public abstract Object clone() ;", "public static void main(String[] args) {\n\t\tDept dept= new Dept(1212, \"IT\", \"Bangalore\");\n\t\tEmp emp = new Emp(1234, \"Tarun\", 9999999999L, dept);\n\t\tSystem.out.println(emp);\n\t\tEmp e1=null;\n\t\ttry {\n\t\t\te1 = (Emp) emp.clone();\n\t\t\t\n\t\t} catch (CloneNotSupportedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tdept.setLocation(\"Chennai\");\n\t\tSystem.out.println(e1);\n\t\t\n\t}", "public abstract Object clone();", "@SuppressWarnings(\"unchecked\")\n \tprivate <T extends Entity<T>> T _clone(Entity<T> obj) throws RaplaException {\n \t\tEntity<T> deepClone = ((Mementable<T>) obj).deepClone();\n \t\tT clone = deepClone.cast();\n \n \t\tRaplaType raplaType = clone.getRaplaType();\n \t\tif (raplaType == Appointment.TYPE) {\n \t\t\t// Hack for 1.6 compiler compatibility\n \t\t\tObject temp = clone;\n \t\t\t((AppointmentImpl) temp).removeParent();\n \t\t}\n \t\tif (raplaType == Category.TYPE) {\n \t\t\t// Hack for 1.6 compiler compatibility\n \t\t\tObject temp = clone;\n \t\t\t((CategoryImpl) temp).removeParent();\n \t\t}\n \n \t\tsetNew((RefEntity<T>) clone, this.workingUser);\n \t\treturn clone;\n \t}", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException { // semi-copy\r\n\t\tthrow new CloneNotSupportedException();\r\n\t}", "public Object clone();", "public Object clone();", "public Object clone();", "public Object clone();", "public Object clone() {\n // No problems cloning here since private variables are immutable\n return super.clone();\n }", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\tthrow new CloneNotSupportedException();\r\n\t}", "public Employee convert() {\n\n Application app = Application.getInstance();\n Employee employee = new Employee();\n employee.setLWantCom(null);\n employee.setResume(getRes());\n employee.setNotifiStack(getNotifiStack());\n\n /*\n I update his friends because if i don't\n they will have the old user as a friend\n whilst i need them to befriend the new employee\n */\n for (int i = 0; i < getFriends().size();) {\n employee.add(getFriends().get(i));\n getFriends().get(i).remove(this);\n }\n app.remove(this);\n\n return employee;\n\n }", "public Object clone() throws CloneNotSupportedException {\n throw new CloneNotSupportedException(\"clone() is not supported in \"+this.getClass().getName());\n }", "private void modifyEntityFromModifyEmployeeDto(ModifyEmployeeDto modifyEmployeeDto, Employee originalEmployee){\n\t\toriginalEmployee.setId(modifyEmployeeDto.id);\n\n\t\tif(modifyEmployeeDto.children != null)\n\t\t\toriginalEmployee.setChildren(modifyEmployeeDto.children);\n\n\t\tif(modifyEmployeeDto.isJustMarried != null)\n\t\t\toriginalEmployee.setJustMarried(modifyEmployeeDto.isJustMarried);\n\n\t\tif(modifyEmployeeDto.isSingleParent != null)\n\t\t\toriginalEmployee.setSingleParent(modifyEmployeeDto.isSingleParent);\n\t}", "@Override\n public Object clone() {\n return super.clone();\n }", "@Override\n public Object clone() throws CloneNotSupportedException{\n return super.clone();\n }", "public Object clone()\n {\n Object o = null;\n try\n {\n o = super.clone();\n }\n catch (CloneNotSupportedException e)\n {\n e.printStackTrace();\n }\n return o;\n}", "@Override\n public Object clone() throws CloneNotSupportedException {\n throw new CloneNotSupportedException();\n }", "public Object clone() throws CloneNotSupportedException {\n\t\t//Super.clone () return object thats why we need a cast\n\t\tFaculty bb = (Faculty) super.clone();\n\t\tedu = (Education) edu.clone();\n\t\tbb.setEducation(edu);\n\t\treturn bb;\n\t}", "public MemberAddress clone() {\r\n try {\r\n return (MemberAddress)super.clone();\r\n } catch (CloneNotSupportedException e) {\r\n throw new IllegalStateException(\"Failed to clone the entity: \" + toString(), e);\r\n }\r\n }", "public Object clone(){\n \t\n \treturn this;\n \t\n }", "public EmployeeTransition(Employee employee) {\n this.id = employee.getId();\n this.f_name = employee.getFname();\n this.l_name = employee.getLname();\n this.employeeid = employee.getEmployeeid();\n this.active = employee.getActive();\n this.role = employee.getRole();\n this.manager = employee.getManager();\n this.password = employee.getPassword();\n this.createdOn = employee.getCreatedOn();\n }", "@Override\r\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\t\r\n\t\treturn super.clone();\r\n\t}", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}", "public Object clone() throws CloneNotSupportedException { return super.clone(); }", "public Object clone() throws CloneNotSupportedException{\n\t\tthrow (new CloneNotSupportedException());\n\t}", "@Override\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\tthrow new CloneNotSupportedException();\n\t}", "@Override\r\n\tpublic Student clone() \r\n\t{\n\t\ttry {\r\n\t\t\treturn (Student)super.clone();\r\n\t\t}\r\n\t\tcatch (CloneNotSupportedException e) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "@Override\n\tpublic YoungO clone() throws CloneNotSupportedException {\n\t\tYoungO toReturn = (YoungO) super.clone();\n\t\treturn toReturn;\n\t}", "public Object clone() throws CloneNotSupportedException {\r\n\t\tthrow new CloneNotSupportedException();\r\n\t}", "@Override\n public Product clone() throws CloneNotSupportedException {\n\n Product newObject = (Product)super.clone();\n if(this.category != null) {\n try {\n newObject.category = ((Category) this.category.clone());\n } catch (CloneNotSupportedException exc) {\n exc.printStackTrace();\n }\n }\n if(this.price != null) {\n try {\n newObject.price = (this.price.clone());\n } catch (CloneNotSupportedException exc) {\n exc.printStackTrace();\n }\n }\n return newObject;\n }", "@Override\n protected Object clone() throws CloneNotSupportedException {\n\n return super.clone();\n }", "@Override\r\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}", "private EmployeeDto toDto(Employee employee){\n\t\tEmployeeDto employeeDto = new EmployeeDto();\n\t\temployeeDto.id = employee.getId();\n\n\t\temployeeDto.name = employee.getName();\n\t\temployeeDto.email = employee.getEmail();\n\n\t\temployeeDto.jobTypeId = employee.getJobtype().getId();\n\n\t\temployeeDto.bossId = employee.getBossId();\n\n\t\temployeeDto.netPayment = employee.getNetPayment();\n\t\temployeeDto.grossPayment = employee.getGrossPayment();\n\t\temployeeDto.employerTotalCost = employee.getEmployerTotalCost();\n\t\temployeeDto.workHours = employee.getWorkHours();\n\n\t\temployeeDto.children = employee.getChildren();\n\n\t\temployeeDto.workStatus = employee.getWorkStatus().getStringValue();\n\n\t\temployeeDto.isEntrant = employee.isEntrant();\n\t\temployeeDto.isJustMarried = employee.isJustMarried();\n\t\temployeeDto.isSingleParent = employee.isSingleParent();\n\n\t\treturn employeeDto;\n\t}", "public Object clone()\n {\n Object o = null;\n try \n { o = super.clone(); } \n catch(CloneNotSupportedException e) \n { System.err.println(\"Erreur dans le clonage de la cellule...\"); }\n return o;\n }", "@Override\n public Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError(e);\n }\n }", "@Override\n\tAlgebraicExpression clone();", "@Override\n public Employee addNewEmployee(Employee employee) {\n return null;\n }", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "public Object clone(){ \r\n\t\tBaseballCard cloned = new BaseballCard();\r\n\t\tcloned.name = this.getName();\r\n\t\tcloned.manufacturer=this.getManufacturer();\r\n\t\tcloned.year = this.getYear();\r\n\t\tcloned.price = this.getPrice();\r\n\t\tcloned.size[0]= this.getSizeX();\r\n\t\tcloned.size[1]= this.getSizeY();\r\n\t\treturn cloned;\r\n\t}", "public static void main(String[] args) {\n Employee employee = new GovernmentEmployee();\n\n GovernmentEmployee employee2 = (GovernmentEmployee) employee;\n employee.commonMethod();\n \n GovernmentEmployee governmentEmployee = new GovernmentEmployee();\n Employee governmentEmployee1 = governmentEmployee;\n\n\n }", "@Override\n\tpublic void createEmployee(Employee e) {\n\t\t\n\t}", "@Override\r\n\tprotected A clone() throws CloneNotSupportedException {\r\n\t\tA clone = (A)super.clone();\r\n//\t\tclone.b = new B();\r\n\t\treturn clone;\r\n\t}", "public Object clone() {\r\n\t\tUser cloned = new User();\r\n\t\tif (this.password != null)\r\n\t\t\tcloned.setPassword(new String(this.password));\r\n\t\tif (this.name != null)\r\n\t\t\tcloned.setName(new String(this.name));\r\n\t\tif (this.roles.get(0) != null)\r\n\t\t\tcloned.roles.add(new Role(this.roles.get(0).getRole()));\r\n\t\treturn cloned;\r\n\t}", "public Object clone() {\n \ttry {\n \tMyClass1 result = (MyClass1) super.clone();\n \tresult.Some2Ob = (Some2)Some2Ob.clone(); ///IMPORTANT: Some2 clone method called for deep copy without calling this Some2.x will be = 12\n \t\n \treturn result;\n \t} catch (CloneNotSupportedException e) {\n \treturn null; \n \t}\n\t}", "@Override \n public Score clone()\n {\n try\n { \n return (Score)super.clone();\n }\n catch(CloneNotSupportedException e)\n {\n throw new InternalError();\n }\n }", "public Object clone() throws CloneNotSupportedException\n\t{\n\t\tthrow new CloneNotSupportedException();\n\t}", "public Object clone() {\n \n\tQuerynotyfyaddressbol obj = new Querynotyfyaddressbol(getObjectsDatastore());\n\n\tobj.iNotifyaddress = iNotifyaddress; \n\n\treturn obj;\n }", "@Override\n protected Alpha clone() {\n try {\n Alpha alpha = (Alpha) super.clone();\n alpha.mListeners = new ArrayList<Listener>();\n return alpha;\n } catch (CloneNotSupportedException e) {\n throw new RuntimeException(e);\n }\n }", "public IVenda clone ();", "public Entity clone() {\n try {\n return (Entity) super.clone();\n } catch (CloneNotSupportedException e) {\n e.printStackTrace();\n return null;\n }\n }", "@Override\n public User clone(){\n return new User(this);\n }", "@Override\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "public Employee(String id) {\n super(id);\n }", "public void copyEmployeeSalarySheetFrom(EmployeeSalarySheet employeeSalarySheet) {\n\t\t\n EmployeeSalarySheet employeeSalarySheetInList = findTheEmployeeSalarySheet(employeeSalarySheet);\n EmployeeSalarySheet newEmployeeSalarySheet = new EmployeeSalarySheet();\n employeeSalarySheetInList.copyTo(newEmployeeSalarySheet);\n newEmployeeSalarySheet.setVersion(0);//will trigger copy\n getEmployeeSalarySheetList().add(newEmployeeSalarySheet);\n\t}", "public Employee() {\n this.isActivated = false;\n this.salt = CryptographicHelper.getInstance().generateRandomString(32);\n\n this.address = new Address();\n this.reports = new ArrayList<>();\n }", "public static void main(String[] args) throws CloneNotSupportedException {\n\t\tStudent s=new Student();\r\n\t\t//Cloneable标记接口\r\n\t\ts.setName(\"张三\");\r\n\t\tObject obj=s.clone();\r\n\t\tStudent s2=(Student)obj;\r\n\t\tSystem.out.println(s.getName()+\"-----\"+s2.getName());\r\n\t}", "public FirmReference clone() {\r\n try {\r\n\t\t\treturn (FirmReference) super.clone();\r\n\t\t} catch (CloneNotSupportedException e) {\r\n\t\t\t\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n \r\n\t}", "public final Object clone() throws CloneNotSupportedException {\n throw new CloneNotSupportedException();\n }", "@Override\n\tpublic Object clone() throws CloneNotSupportedException {\n\treturn super.clone();\n\t}", "public Object clone ()\n\t{\n\t\ttry \n\t\t{\n\t\t\treturn super.clone();\n\t\t}\n\t\tcatch (CloneNotSupportedException e) \n\t\t{\n throw new InternalError(e.toString());\n\t\t}\n\t}", "@Override\n\tpublic Object clone() throws CloneNotSupportedException{\n\t\tShape cloned = this;\n\t\tcloned.setPosition(this.getPosition());\n\t\tcloned.setProperties(this.getProperties());\n\t\tcloned.setColor(this.getColor());\n\t\tcloned.setFillColor(this.getFillColor());\n\t\treturn cloned;\n\t}", "@Override\n public MovePath clone() {\n final MovePath copy = new MovePath(getGame(), getEntity());\n copy.steps = new Vector<MoveStep>(steps);\n copy.careful = careful;\n return copy;\n }", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\tPrototype prototype=null;\n\t\t\n\t\tprototype=(Prototype)super.clone();\n//\t\tprototype.lists=(ArrayList<String>) this.lists.clone();\n\t\n\t\t\n\t\treturn prototype;\n\t}", "@Override\r\n\tpublic Address clone() throws CloneNotSupportedException {\n\t\treturn (Address)super.clone();\r\n\t}", "@Override\n public Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError(e);\n }\n }", "public List<E> clone();", "public Employee(){\n\t\t\n\t}", "public Employee(){\n\t\t\n\t}", "public Employee(String employeeId, String name) {\n this.employeeId = employeeId;\n this.name = name; // TODO fill in code here\n }", "@Override\r\n\tprotected B clone() throws CloneNotSupportedException {\r\n\t\tB clone = (B)super.clone();\r\n//\t\tclone.a = new A();\r\n\t\treturn clone;\r\n\t}", "public Object clone()\n/* */ {\n/* 835 */ return super.clone();\n/* */ }", "public Cliente clone(){\r\n return new Cliente(this.nome, this.email, this.endereco, this.id);\r\n }", "public Object clone() throws CloneNotSupportedException {\r\n\t\t// Shallow clone\r\n\t\tExpression v = (Expression) super.clone();\r\n\t\tv.eval_stack = null;\r\n\t\t// v.text = new StringBuffer(new String(text));\r\n\t\tint size = elements.size();\r\n\t\tArrayList cloned_elements = new ArrayList(size);\r\n\t\tv.elements = cloned_elements;\r\n\r\n\t\treturn v;\r\n\t}" ]
[ "0.8063044", "0.805637", "0.6461267", "0.6440511", "0.63104284", "0.62555784", "0.6237014", "0.6160677", "0.61425847", "0.6142088", "0.61365366", "0.61365366", "0.61348695", "0.6112877", "0.60988575", "0.6089758", "0.6083402", "0.6074358", "0.6029218", "0.5996953", "0.5996953", "0.5996953", "0.5996953", "0.5990786", "0.5964201", "0.5953996", "0.59499955", "0.5946688", "0.59335786", "0.5923229", "0.5905051", "0.5891902", "0.589116", "0.5891026", "0.5884885", "0.58522236", "0.58488214", "0.58428574", "0.58428574", "0.58428574", "0.584121", "0.58340096", "0.58293056", "0.5827429", "0.5826246", "0.5821362", "0.57870054", "0.57869697", "0.57695764", "0.5762605", "0.5762084", "0.57565016", "0.574741", "0.57433444", "0.5733938", "0.5733938", "0.5733938", "0.5733938", "0.5733938", "0.5733938", "0.5733938", "0.5733938", "0.5733938", "0.5733153", "0.5732109", "0.5719153", "0.5699812", "0.56997013", "0.5699286", "0.5696082", "0.5694734", "0.56923115", "0.56905097", "0.56827074", "0.56791914", "0.56773293", "0.567376", "0.567376", "0.567376", "0.56724036", "0.5670878", "0.56686157", "0.5668364", "0.56674236", "0.5666352", "0.5662205", "0.5661095", "0.56597996", "0.5645913", "0.5637171", "0.56311893", "0.5628085", "0.5615473", "0.5614723", "0.5614723", "0.561204", "0.56114286", "0.56062305", "0.55963373", "0.55923396" ]
0.7753064
2
isEqual method The following method checks of two objects of class Employee have identical elements (Username, password etc).
public boolean isEqual(Employee theEmployee) { boolean equal; if (this.username.equals(theEmployee.username) && this.password.equals(theEmployee.password) && this.firstname.equals(theEmployee.firstname) && this.lastname.equals(theEmployee.lastname) && this.DoB.equals(theEmployee.DoB) && this.contactNumber.equals(theEmployee.contactNumber) && this.email.equals(theEmployee.email) && (this.salary==theEmployee.salary) && this.positionStatus.equals(theEmployee.positionStatus) && this.homeAddress.equals(theEmployee.homeAddress)){ equal = true; } else { equal = false; } return equal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Employee)) {\n return false;\n }\n Employee other = (Employee) object;\n if ((this.username == null && other.username != null) || (this.username != null && !this.username.equals(other.username))) {\n return false;\n }\n return true;\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Employee)) {\r\n return false;\r\n }\r\n Employee other = (Employee) object;\r\n if ((this.name == null && other.name != null) || (this.name != null && !this.name.equals(other.name))) {\r\n return false;\r\n }\r\n return true;\r\n }", "public boolean equals(Object o){\r\n if (o instanceof SalesEmployee){\r\n // d stores the parameter object if it is an instance of SalesEmployee \r\n SalesEmployee d = (SalesEmployee) o; \r\n if (this.getNumber() == d.getNumber() && this.getFirstName().equals(d.getFirstName()) && this.getLastName().equals(d.getLastName())){\r\n return true;\r\n }\r\n else \r\n return false;\r\n }\r\n else\r\n return false;\r\n }", "public boolean equals(Employee anotherEmp) {\r\n\t\tif(anotherEmp==null)return false;\r\n\t\tif(name.equals(anotherEmp.name)&&employeeNum==anotherEmp.employeeNum)return true;\r\n\t\treturn false;\r\n\t}", "@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Employee sum = null;\n assertFalse(emp.equals(sum));\n sum = new Employee(1, \"Anu\", \"Sha\", 12345678, new Date(), 600000);\n assertFalse(emp.equals(sum));\n sum = new Employee(1, \"Auk\", \"Sau\", 12345678, new Date(), 600000);\n assertEquals(emp, sum);\n \n }", "@Override\n public boolean equals(Object o) {\n if (this == o) {\n return true;\n }\n Employee employee = (Employee) o;\n return employeeID == employee.employeeID;\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Empleado)) {\n return false;\n }\n Empleado other = (Empleado) object;\n if ((this.empid == null && other.empid != null) || (this.empid != null && !this.empid.equals(other.empid))) {\n return false;\n }\n return true;\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Employee)) {\r\n return false;\r\n }\r\n Employee other = (Employee) object;\r\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Test\n void testEquals() {\n final boolean expected_boolean = true;\n\n // Properties for the objects\n final String username = \"username\";\n final String name = \"their_name\";\n final String password = \"password\";\n\n // Create two LoginAccount objects\n LoginAccount first_account = new LoginAccount(username, name, password);\n LoginAccount second_account = new LoginAccount(username, name, password);\n\n // Variable to check\n boolean objects_are_equal = first_account.equals(second_account);\n\n // Assert that the two boolean values are the same\n assertEquals(expected_boolean, objects_are_equal);\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Employee)) {\n return false;\n }\n Employee other = (Employee) object;\n if ((this.employeeId == null && other.employeeId != null) || (this.employeeId != null && !this.employeeId.equals(other.employeeId))) {\n return false;\n }\n return true;\n }", "private boolean equalKeys(Object other) {\n if (this==other) {\n return true;\n }\n if (!(other instanceof User)) {\n return false;\n }\n User that = (User) other;\n if (this.getIduser() != that.getIduser()) {\n return false;\n }\n return true;\n }", "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif(!(obj instanceof UserData))\n\t\t\treturn false;\n\t\telse {\n\t\t\tUserData that = (UserData) obj;\n\t\t\treturn password.equals(that.getPassword());\n\t\t}\n\t}", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof User)) {\r\n return false;\r\n }\r\n User other = (User) object;\r\n if ((this.login == null && other.login != null) || (this.login != null && !this.login.equals(other.login))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\r\n\tpublic boolean equals(Object anObject) {\r\n\t\tboolean result = false;\r\n\t\ttry {\r\n\t\t\tUserDTO anUserDTO = (UserDTO) anObject;\r\n\t\t\tresult = anUserDTO.getUsername().equals(this.getUsername());\r\n\t\t} catch (Exception e) {\r\n\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}", "@Override\n public boolean equals(Object obj) {\n if (obj == null) {\n return false;\n }\n if (getClass() != obj.getClass()) {\n return false;\n }\n final Employee other = (Employee) obj;\n return other.ssNum == this.ssNum;\n }", "@Override\n public boolean equals(Object obj) {\n if (this == obj) {\n return true;\n }\n if (obj == null) {\n return false;\n }\n if (getClass() != obj.getClass()) {\n return false;\n }\n final User other = (User) obj;\n if (this.userId != other.userId) {\n return false;\n }\n if (!Objects.equals(this.userName, other.userName)) {\n return false;\n }\n if (!Objects.equals(this.password, other.password)) {\n return false;\n }\n if (!Objects.equals(this.email, other.email)) {\n return false;\n }\n return true;\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Employee)) {\n return false;\n }\n Employee other = (Employee) object;\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\n return false;\n }\n return true;\n }", "@Override\n\tpublic boolean equals(Object obj) {\n\t\treturn this.getName().equals(((Employee) obj).getName());\n\t}", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Users)) {\r\n return false;\r\n }\r\n Users other = (Users) object;\r\n if ((this.username == null && other.username != null) || (this.username != null && !this.username.equals(other.username))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n\tpublic boolean equals(Object obj) {\n\n\t\t\n\n\t\tEmployee employee = (Employee) obj;\n\n\t\treturn (this.city.equalsIgnoreCase(employee.city) && this.name.equalsIgnoreCase(employee.name));\n\t\t\n\t}", "public boolean equals(Employee E) {\n return FName.equals(E.FName) && LName.equals(E.LName) && ID == E.ID;\n }", "@Override\n public boolean equals(Object obj) {\n if (!(obj instanceof User)) {\n return false;\n }\n\n User other = (User) obj;\n return username.equals(other.username);\n }", "@Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (o == null || getClass() != o.getClass()) return false;\n\n Employee employee = (Employee) o;\n\n if (birthDate != null ? !birthDate.equals(employee.birthDate) : employee.birthDate != null) return false;\n if (endDate != null ? !endDate.equals(employee.endDate) : employee.endDate != null) return false;\n if (firstname != null ? !firstname.equals(employee.firstname) : employee.firstname != null) return false;\n if (!id.equals(employee.id)) return false;\n if (jobRole != employee.jobRole) return false;\n if (lastname != null ? !lastname.equals(employee.lastname) : employee.lastname != null) return false;\n if (salary != null ? !salary.equals(employee.salary) : employee.salary != null) return false;\n if (startDate != null ? !startDate.equals(employee.startDate) : employee.startDate != null) return false;\n if (turnover != null ? !turnover.equals(employee.turnover) : employee.turnover != null) return false;\n\n return true;\n }", "@Override\n public boolean equals(Object obj){\n boolean isEqual = false;\n if(obj instanceof Employee){\n Employee person = (Employee)obj;\n if(this.profile.equals(person.profile)){\n isEqual = true;\n }\n }\n return isEqual;\n }", "public boolean equals(Object obj) {\r\n if (obj == null) {\r\n return false;\r\n }\r\n if (this == obj) {\r\n return true;\r\n }\r\n if (getClass() != obj.getClass()) {\r\n return false;\r\n }\r\n Soggetti other = (Soggetti) obj;\r\n if (username == null) {\r\n if (other.getUsername() != null) {\r\n return false;\r\n }\r\n } else if (!username.equals(other.getUsername())) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof UserAccount)) {\n return false;\n }\n UserAccount other = (UserAccount) object;\n if ((this.userLogin == null && other.userLogin != null) || (this.userLogin != null && !this.userLogin.equals(other.userLogin))) {\n return false;\n }\n return true;\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof User)) {\r\n return false;\r\n }\r\n User other = (User) object;\r\n if ((this.username == null && other.username != null) || (this.username != null && !this.username.equals(other.username))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof User)) {\r\n return false;\r\n }\r\n User other = (User) object;\r\n if ((this.username == null && other.username != null) || (this.username != null && !this.username.equals(other.username))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Account)) {\n return false;\n }\n Account other = (Account) object;\n if ((this.username == null && other.username != null) || (this.username != null && !this.username.equals(other.username))) {\n return false;\n }\n return true;\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Users)) {\r\n return false;\r\n }\r\n Users other = (Users) object;\r\n if ((this.usersname == null && other.usersname != null) || (this.usersname != null && !this.usersname.equals(other.usersname))) {\r\n return false;\r\n }\r\n return true;\r\n }", "public boolean equals(User other) {\n return (username.equals(other.username));\n }", "@Override\r\n\tpublic boolean equals(Object obj) {\n\t\tif (((EmployeeVo) obj).empID == this.empID)\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}", "@Test\n public void testEquals_sameParameters() {\n CellIdentityNr cellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI,\n ALPHAL, ALPHAS, Collections.emptyList());\n CellIdentityNr anotherCellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI,\n ALPHAL, ALPHAS, Collections.emptyList());\n\n // THEN this two objects are equivalent\n assertThat(cellIdentityNr).isEqualTo(anotherCellIdentityNr);\n }", "@Override\n public boolean equals(Object o){\n if(this == o){\n return true;\n }\n if(o == null || this.getClass() != o.getClass()){\n return false;\n }\n\n User test = (User) o;\n\n /*return test.name.equals(this.name) && test.email.equals(this.email) && test.password.equals(this.password)\n && test.projects.equals(projects);*/\n return this.email.equals(((User) o).getEmail());\n }", "@Test\r\n\tpublic void testEquality(){\n\t\t assertEquals(object1, object2);\r\n\t}", "@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Object obj = null;\n Usuario instance = null;\n boolean expResult = false;\n boolean result = instance.equals(obj);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "@Override\n public boolean equals(Object obj) {\n if (this == obj) {\n return true;\n }\n if (obj == null) {\n return false;\n }\n if (getClass() != obj.getClass()) {\n return false;\n }\n final User other = (User) obj;\n if (this.id != other.id) {\n return false;\n }\n if (!Objects.equals(this.name, other.name)) {\n return false;\n }\n /*\n if (!Objects.equals(this.cash, other.cash)) {\n return false;\n }\n if (!Objects.equals(this.skills, other.skills)) {\n return false;\n }\n if (!Objects.equals(this.potions, other.potions)) {\n return false;\n }*/\n \n if(!this.cash.getValue().equals(other.cash.getValue())){\n return false;\n }\n \n for (int i = 0; i < this.skills.size(); i++) {\n if(!this.skills.get(i).getValue().equals(other.skills.get(i).getValue())){\n return false;\n }\n\t}\n \n for (int i = 0; i < this.potions.size(); i++) {\n if(!this.potions.get(i).getValue().equals(other.potions.get(i).getValue())){\n return false;\n }\n\t}\n \n return true;\n }", "@Override\r\n public boolean equals(Object that) {\r\n if (this == that) {\r\n return true;\r\n }\r\n if (that == null) {\r\n return false;\r\n }\r\n if (getClass() != that.getClass()) {\r\n return false;\r\n }\r\n User other = (User) that;\r\n return (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))\r\n && (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName()))\r\n && (this.getUserPassword() == null ? other.getUserPassword() == null : this.getUserPassword().equals(other.getUserPassword()))\r\n && (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone()))\r\n && (this.getUserEmail() == null ? other.getUserEmail() == null : this.getUserEmail().equals(other.getUserEmail()))\r\n && (this.getUserCreateTime() == null ? other.getUserCreateTime() == null : this.getUserCreateTime().equals(other.getUserCreateTime()))\r\n && (this.getUserUpdateTime() == null ? other.getUserUpdateTime() == null : this.getUserUpdateTime().equals(other.getUserUpdateTime()))\r\n && (this.getUserState() == null ? other.getUserState() == null : this.getUserState().equals(other.getUserState()))\r\n && (this.getUserGroupId() == null ? other.getUserGroupId() == null : this.getUserGroupId().equals(other.getUserGroupId()))\r\n && (this.getUserRealName() == null ? other.getUserRealName() == null : this.getUserRealName().equals(other.getUserRealName()))\r\n && (this.getUserSex() == null ? other.getUserSex() == null : this.getUserSex().equals(other.getUserSex()))\r\n && (this.getUserAge() == null ? other.getUserAge() == null : this.getUserAge().equals(other.getUserAge()))\r\n && (this.getUserGroupTopId() == null ? other.getUserGroupTopId() == null : this.getUserGroupTopId().equals(other.getUserGroupTopId()))\r\n && (this.getUserRole() == null ? other.getUserRole() == null : this.getUserRole().equals(other.getUserRole()))\r\n && (this.getUserImg() == null ? other.getUserImg() == null : this.getUserImg().equals(other.getUserImg()));\r\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Empleado)) {\n return false;\n }\n Empleado other = (Empleado) object;\n if ((this.idEmpleado == null && other.idEmpleado != null) || (this.idEmpleado != null && !this.idEmpleado.equals(other.idEmpleado))) {\n return false;\n }\n return true;\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof LoginEntity)) {\n return false;\n }\n LoginEntity other = (LoginEntity) object;\n if ((this.loginId == null && other.loginId != null) || (this.loginId != null && !this.loginId.equals(other.loginId))) {\n return false;\n }\n return true;\n }", "@Override\n\tpublic boolean equals(Object o) {\n\t\tif (this == o) return true;\n\t\tif (o == null || getClass() != o.getClass()) return false;\n\n\t\tUser user = (User) o;\n\t\tif (ID == user.ID) return true;\n\t\tif (firstName != null ? !firstName.equals(user.firstName) : user.firstName != null) return false;\n\t\treturn lastName != null ? lastName.equals(user.lastName) : user.lastName == null;\n\t}", "@Override\n public boolean equals(Object other) {\n if (other == this) {\n return true;\n }\n\n if (!(other instanceof Person)) {\n return false;\n }\n\n Person otherPerson = (Person) other;\n return otherPerson.getName().equals(getName())\n && otherPerson.getPhone().equals(getPhone())\n && otherPerson.getEmail().equals(getEmail())\n && otherPerson.getAddress().equals(getAddress())\n && otherPerson.getSalary().equals(getSalary())\n && otherPerson.getProjects().equals(getProjects())\n && otherPerson.getProfilePic().equals(getProfilePic())\n && otherPerson.getUsername().equals(getUsername())\n && otherPerson.getPassword().isSamePassword(getPassword())\n && otherPerson.getLeaveApplications().equals(getLeaveApplications());\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof RwEmployment)) {\r\n return false;\r\n }\r\n RwEmployment other = (RwEmployment) object;\r\n if ((this.empId == null && other.empId != null) || (this.empId != null && !this.empId.equals(other.empId))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Employe)) {\r\n return false;\r\n }\r\n Employe other = (Employe) object;\r\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n\tpublic boolean equals(Object u)\n\t{\n\t\tif(this.getPassword() == null || ((User) u).getPassword() == null)\n\t\t{\n\t\t\t// a user does not have a password so just compare the usernames\n\t\t\treturn this.getUsername().equals(((User) u).getUsername());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// both users have passwords so compare by username and password\n\t\t\treturn this.getUsername().equals(((User) u).getUsername()) && this.getPassword().equals(((User) u).getPassword());\n\t\t}\n\t}", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Member1)) {\r\n return false;\r\n }\r\n Member1 other = (Member1) object;\r\n if ((this.username == null && other.username != null) || (this.username != null && !this.username.equals(other.username))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Test\n void equals1() {\n Student s1=new Student(\"emina\",\"milanovic\",18231);\n Student s2=new Student(\"emina\",\"milanovic\",18231);\n assertEquals(true,s1.equals(s2));\n }", "@Override\n public boolean equals(Object other) {\n return this == other || (other instanceof UserDetails && hashCode() == other.hashCode());\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Emploi)) {\r\n return false;\r\n }\r\n Emploi other = (Emploi) object;\r\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Login)) {\n return false;\n }\n Login other = (Login) object;\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\n return false;\n }\n return true;\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Usuario)) {\r\n return false;\r\n }\r\n Usuario other = (Usuario) object;\r\n if ((this.usu_codigo == null && other.usu_codigo != null) || (this.usu_codigo != null && !this.usu_codigo.equals(other.usu_codigo))) {\r\n return false;\r\n }\r\n return true;\r\n }", "public boolean isEqual(Object objectname1, Object objectname2, Class<?> voClass) {\n\t\treturn false;\n\t}", "@Test\n\tpublic void testEquals() {\n\t\tPMUser user = new PMUser(\"Smith\", \"John\", \"[email protected]\");\n\t\tPark a = new Park(\"name\", \"address\", user);\n\t\tPark b = new Park(\"name\", \"address\", user);\n\t\tPark c = new Park(\"name\", \"different address\", user);\n\t\tassertEquals(a, a);\n\t\tassertEquals(a, b);\n\t\tassertEquals(b, a);\n\t\tassertFalse(a.equals(c));\n\t}", "@Test\r\n public void testReflexiveForEqual() throws Exception {\n\r\n EmployeeImpl emp1 = new EmployeeImpl(\"7993389\", \"[email protected]\");\r\n EmployeeImpl emp2 = new EmployeeImpl(\"7993389\", \"[email protected]\");\r\n\r\n Assert.assertTrue(\"Comparable implementation is incorrect\", emp1.compareTo(emp2) == 0);\r\n Assert.assertTrue(\"Comparable implementation is incorrect\", emp1.compareTo(emp2) == emp2.compareTo(emp1));\r\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Identity)) {\r\n return false;\r\n }\r\n Identity other = (Identity) object;\r\n if ((this.userid == null && other.userid != null) || (this.userid != null && !this.userid.equals(other.userid))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Test\n void testEqualsSameObject() {\n assertEquals(loginRequest1, loginRequest1);\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Empleado)) {\n return false;\n }\n Empleado other = (Empleado) object;\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\n return false;\n }\n return true;\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Empleado)) {\r\n return false;\r\n }\r\n Empleado other = (Empleado) object;\r\n if ((this.codigo == null && other.codigo != null) || (this.codigo != null && !this.codigo.equals(other.codigo))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof EUser)) {\n return false;\n }\n EUser other = (EUser) object;\n if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.getId().equals(other.getId()))) {\n return false;\n }\n return true;\n }", "@Override\n public boolean equals(Object o) {\n if (this == o) {\n return true;\n }\n if (o == null || getClass() != o.getClass()) {\n return false;\n }\n User user = (User) o;\n return getId() == user.getId()\n && isType() == user.isType()\n && Objects.equals(getUsername(), user.getUsername())\n && Objects.equals(getPassword(), user.getPassword())\n && Objects.equals(getEmail(), user.getEmail());\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Tblusuarios)) {\n return false;\n }\n Tblusuarios other = (Tblusuarios) object;\n if ((this.credito == null && other.credito != null) || (this.credito != null && !this.credito.equals(other.credito))) {\n return false;\n }\n return true;\n }", "@Override\n public boolean equals(Object o) {\n if (this == o) {\n return true;\n }\n if (o == null || getClass() != o.getClass()) {\n return false;\n }\n Employee employee = (Employee) o;\n if (employee.getId() == null || getId() == null) {\n return false;\n }\n return Objects.equals(getId(), employee.getId());\n }", "@Override\n public boolean equals(Object other) {\n if (!(other instanceof User)) return false;\n return this.equalKeys(other) && ((User)other).equalKeys(this);\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof EmpresaPK)) {\r\n return false;\r\n }\r\n EmpresaPK other = (EmpresaPK) object;\r\n if (this.id != other.id) {\r\n return false;\r\n }\r\n if (this.contactoEmpresaid != other.contactoEmpresaid) {\r\n return false;\r\n }\r\n if (this.direccionEmpresaid != other.direccionEmpresaid) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n public boolean equals(Object o) {\n if (this == o) {\n return true;\n }\n if (!(o instanceof Employee)) {\n return false;\n }\n return id != null && id.equals(((Employee) o).id);\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof UsuarioEntidade)) {\n return false;\n }\n UsuarioEntidade other = (UsuarioEntidade) object;\n if ((this.idUsuario == null && other.idUsuario != null) || (this.idUsuario != null && !this.idUsuario.equals(other.idUsuario))) {\n return false;\n }\n return true;\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Usuario)) {\r\n return false;\r\n }\r\n Usuario other = (Usuario) object;\r\n if ((this.idusuario == null && other.idusuario != null) || (this.idusuario != null && !this.idusuario.equals(other.idusuario))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Usuario)) {\r\n return false;\r\n }\r\n Usuario other = (Usuario) object;\r\n if ((this.idusuario == null && other.idusuario != null) || (this.idusuario != null && !this.idusuario.equals(other.idusuario))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Cliente2)) {\n return false;\n }\n Cliente2 other = (Cliente2) object;\n if ((this.nickname == null && other.nickname != null) || (this.nickname != null && !this.nickname.equals(other.nickname))) {\n return false;\n }\n return true;\n }", "@Override\n public boolean equals(Object other) \n {\n Student s = (Student)other; \n return this.name.equals(s.getName()) && this.id.equals(s.getId()); \n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Usuario)) {\r\n return false;\r\n }\r\n Usuario other = (Usuario) object;\r\n if ((this.usrId == null && other.usrId != null) || (this.usrId != null && !this.usrId.equals(other.usrId))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Empresas)) {\r\n return false;\r\n }\r\n Empresas other = (Empresas) object;\r\n if ((this.idempresa == null && other.idempresa != null) || (this.idempresa != null && !this.idempresa.equals(other.idempresa))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (o == null || getClass() != o.getClass()) return false;\n Employee employee = (Employee) o;\n return ssNum == employee.ssNum;\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Memberpass)) {\n return false;\n }\n Memberpass other = (Memberpass) object;\n if ((this.username == null && other.username != null) || (this.username != null && !this.username.equals(other.username))) {\n return false;\n }\n return true;\n }", "@Test\n public void testEquals_differentParameters() {\n CellIdentityNr cellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI,\n ALPHAL, ALPHAS, Collections.emptyList());\n CellIdentityNr anotherCellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI + 1,\n ALPHAL, ALPHAS, Collections.emptyList());\n\n // THEN this two objects are different\n assertThat(cellIdentityNr).isNotEqualTo(anotherCellIdentityNr);\n }", "@Override\n public boolean equals(Object other) {\n if (other == this) {\n return true;\n }\n\n if (!(other instanceof LoggedInAccount)) {\n return false;\n }\n\n LoggedInAccount otherAccount = (LoggedInAccount) other;\n return (otherAccount.getUsername().fullUsername.toLowerCase()).equals(getUsername().fullUsername.toLowerCase());\n }", "@Override\r\n\tpublic boolean equals(Object obj) {\n\t\tif(!(obj instanceof User)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tUser obj2 = (User)obj;\r\n\t\tif(this.id>0){\r\n\t\t\treturn this.id==obj2.getId();\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Usuario)) {\r\n return false;\r\n }\r\n Usuario other = (Usuario) object;\r\n if ((this.idUsuario == null && other.idUsuario != null) || (this.idUsuario != null && !this.idUsuario.equals(other.idUsuario))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Usuario)) {\r\n return false;\r\n }\r\n Usuario other = (Usuario) object;\r\n if ((this.idUsuario == null && other.idUsuario != null) || (this.idUsuario != null && !this.idUsuario.equals(other.idUsuario))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Usuario)) {\r\n return false;\r\n }\r\n Usuario other = (Usuario) object;\r\n if ((this.idUsuario == null && other.idUsuario != null) || (this.idUsuario != null && !this.idUsuario.equals(other.idUsuario))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Usuario)) {\n return false;\n }\n Usuario other = (Usuario) object;\n if ((this.usuario == null && other.usuario != null) || (this.usuario != null && !this.usuario.equals(other.usuario))) {\n return false;\n }\n return true;\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Usuario)) {\n return false;\n }\n Usuario other = (Usuario) object;\n if ((this.idusuario == null && other.idusuario != null) || (this.idusuario != null && !this.idusuario.equals(other.idusuario))) {\n return false;\n }\n return true;\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Usuario)) {\n return false;\n }\n Usuario other = (Usuario) object;\n if ((this.idusuario == null && other.idusuario != null) || (this.idusuario != null && !this.idusuario.equals(other.idusuario))) {\n return false;\n }\n return true;\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Usuario)) {\r\n return false;\r\n }\r\n Usuario other = (Usuario) object;\r\n if ((this.identificacion == null && other.identificacion != null) || (this.identificacion != null && !this.identificacion.equals(other.identificacion))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof UsuarioTelefone)) {\n return false;\n }\n UsuarioTelefone other = (UsuarioTelefone) object;\n if ((this.idusuarioTelefone == null && other.idusuarioTelefone != null) || (this.idusuarioTelefone != null && !this.idusuarioTelefone.equals(other.idusuarioTelefone))) {\n return false;\n }\n return true;\n }", "public boolean equals(Object obj) {\n\t\tif (obj == null)\n\t\t\treturn false;\n\t\tif (obj == this)\n\t\t\treturn true;\n\n\t\tif (this.eid == ((Employee) obj).eid\n\t\t\t\t&& this.ename == ((Employee) obj).ename)\n\t\t\treturn false;\n\t\treturn false;\n\t}", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof TUsers)) {\r\n return false;\r\n }\r\n TUsers other = (TUsers) object;\r\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Test\n public void equalsTest() {\n prepareEntitiesForEqualityTest();\n\n assertEquals(entity0, entity1);\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof OldInvitedUsers)) {\n return false;\n }\n OldInvitedUsers other = (OldInvitedUsers) object;\n if ((this.oldInvitedUserID == null && other.oldInvitedUserID != null) || (this.oldInvitedUserID != null && !this.oldInvitedUserID.equals(other.oldInvitedUserID))) {\n return false;\n }\n return true;\n }", "@Override\n public boolean equals(Object o) {\n if (o != null && o.getClass() == this.getClass()) {\n Usuario user = (Usuario) o;\n if (this.getUserId() == user.getUserId()) {\n return true;\n }\n }\n\n return false;\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof TUser)) {\n return false;\n }\n TUser other = (TUser) object;\n if ((this.idUser == null && other.idUser != null) || (this.idUser != null && !this.idUser.equals(other.idUser))) {\n return false;\n }\n return true;\n }", "public boolean equals(final Object obj) {\n\t\tif (obj instanceof User) {\n\t\t\tUser user = (User) obj;\n\t\t\tif (this.username.equals(user.username) && (this.password == null)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (this.username.equals(user.username) && this.password.equals(user.password)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Empleado)) {\r\n return false;\r\n }\r\n Empleado other = (Empleado) object;\r\n if ((this.ci == null && other.ci != null) || (this.ci != null && !this.ci.equals(other.ci))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof TblEmpleado)) {\r\n return false;\r\n }\r\n TblEmpleado other = (TblEmpleado) object;\r\n if ((this.idempleado == null && other.idempleado != null) || (this.idempleado != null && !this.idempleado.equals(other.idempleado))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Test\n\tpublic void testEqualsPersonalData() {\n\t\tSystem.out.println(\"starting testEqualsPersonalData()\");\n\t\tPersonalData personalData1 = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tPersonalData personalData2 = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"personalData1 equals personalData2\", personalData1.equals(personalData2));\n\t System.out.println(\"testEqualsPersonalData PASSED\");\t\t\n\t}", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof User)) {\r\n return false;\r\n }\r\n User other = (User) object;\r\n if ((this.idUser == null && other.idUser != null) || (this.idUser != null && !this.idUser.equals(other.idUser))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\r\n\tpublic boolean equals(Object obj) {\r\n\t\tif (this == obj)\r\n\t\t\treturn true;\r\n\t\tif (obj == null)\r\n\t\t\treturn false;\r\n\t\tif (getClass() != obj.getClass())\r\n\t\t\treturn false;\r\n\t\tEmprestimo other = (Emprestimo) obj;\r\n\t\tif (dataDeDevolucao == null) {\r\n\t\t\tif (other.dataDeDevolucao != null)\r\n\t\t\t\treturn false;\r\n\t\t} else if (!dataDeDevolucao.equals(other.dataDeDevolucao))\r\n\t\t\treturn false;\r\n\t\tif (dataInicialEmprestimo == null) {\r\n\t\t\tif (other.dataInicialEmprestimo != null)\r\n\t\t\t\treturn false;\r\n\t\t} else if (!dataInicialEmprestimo.equals(other.dataInicialEmprestimo))\r\n\t\t\treturn false;\r\n\t\tif (emprestimoid == null) {\r\n\t\t\tif (other.emprestimoid != null)\r\n\t\t\t\treturn false;\r\n\t\t} else if (!emprestimoid.equals(other.emprestimoid))\r\n\t\t\treturn false;\r\n\t\tif (numeroDiasParaEmprestimo != other.numeroDiasParaEmprestimo)\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Users)) {\n return false;\n }\n Users other = (Users) object;\n if ((this.idUser == null && other.idUser != null) || (this.idUser != null && !this.idUser.equals(other.idUser))) {\n return false;\n }\n return true;\n }", "@Override\n\tpublic boolean equals(Object obj) {\n\t\treturn this.a==((User)obj).a;\n\t}", "@Override\n public boolean equals(Object other) {\n return this == other;\n }" ]
[ "0.7537861", "0.69602555", "0.68304354", "0.67996556", "0.6745006", "0.67366135", "0.6704204", "0.6696917", "0.66953576", "0.6684644", "0.66699636", "0.66344726", "0.66178393", "0.6615723", "0.6599851", "0.65942174", "0.65807176", "0.6565561", "0.65434194", "0.6541667", "0.65324897", "0.65169996", "0.6512721", "0.6488874", "0.6483045", "0.64819145", "0.64817464", "0.64817464", "0.64780825", "0.64696157", "0.6466286", "0.6455637", "0.64485353", "0.644577", "0.64137685", "0.64001", "0.63994145", "0.63817906", "0.63785964", "0.6375738", "0.63749605", "0.63737285", "0.6370969", "0.63673806", "0.6366258", "0.63576144", "0.63319755", "0.6322402", "0.63091844", "0.63089234", "0.63029844", "0.62897503", "0.6284582", "0.62736654", "0.627243", "0.6261721", "0.62610304", "0.6259255", "0.6257437", "0.62552065", "0.62544245", "0.6244391", "0.6236465", "0.6234775", "0.6231336", "0.6229312", "0.62149113", "0.62149113", "0.62100786", "0.6204393", "0.6197978", "0.6197797", "0.6195147", "0.6193375", "0.61838007", "0.61773866", "0.61714", "0.61669594", "0.61669594", "0.61669594", "0.61574835", "0.61543435", "0.61543435", "0.61530054", "0.6151268", "0.6146021", "0.61454445", "0.6142308", "0.6140464", "0.6140378", "0.6139776", "0.6133638", "0.61324024", "0.61280906", "0.61220163", "0.6120742", "0.6117015", "0.6107919", "0.61039704", "0.6103227" ]
0.76804847
0
Creates new handler for client with given sockets for communication.
public ClientHandler(Socket cmdSocket, Socket fileSocket, FileTransferServer server) { // Set up a simple configuration that logs on the console. BasicConfigurator.configure(); log = Logger.getLogger(ClientHandler.class.getName()); this.cmdSocket = cmdSocket; this.fileSocket = fileSocket; this.server = server; prepareStreams(); // Initialize handlers for each command handlers = new HashMap<>(); handlers.put("DIR", new DirRequestHandler(server)); handlers.put("GET", new GetRequestHandler(server, fileOutStream)); handlers.put("PUT", new PutRequestHandler(server, fileInStream)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public TelnetServerHandler createHandler(TelnetSocket s);", "ClientHandler(Socket socket) {\n this.client = socket;\n }", "private void initSocketWithHandlers() {\n\t\tfor(String key: eventHandlerMap.keySet()) {\n\t\t\tmSocket.on(key, eventHandlerMap.get(key));\n\t\t}\n\t}", "public ClientHandler(Socket s){\r\n mySocket = s;\r\n }", "public SocketHandler createSocketHandler (String host, int port) {\r\n\t\t\t\t\t\t\t\r\n\t\tSocketHandler socketHandler = null;\r\n\r\n\t\ttry {\r\n\t\t\t\t\t\t \t\r\n\t\t\tsocketHandler = new SocketHandler(host, port);\r\n\t\t\t\t\t\t\t\t\r\n\t\t} catch (SecurityException | IOException e) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\t\t\t\t \r\n\t\treturn socketHandler;\r\n\t}", "ClientHandler(GameServer server, Socket clientSocket, String[] communication) {\n this.server = server;\n this.clientSocket = clientSocket;\n this.communicationWhenStarting = communication;\n connected = true;\n this.contr = server.getController();\n }", "public ClientHandle(Socket cs) {\r\n \t\r\n this.threadSocket = cs;\r\n\r\n }", "synchronized SocketIoSocket add(SocketIoClient client, Object data) {\n final SocketIoSocket socket = new SocketIoSocket(this, client, data);\n if (client.getConnection().getReadyState() == ReadyState.OPEN) {\n mSockets.put(socket.getId(), socket);\n socket.onConnect();\n\n emit(\"connect\", socket);\n emit(\"connection\", socket);\n }\n\n return socket;\n }", "SockHandle(Socket client,String my_ip,String my_port,int my_c_id,HashMap<Integer, SockHandle> c_list,HashMap<Integer, SockHandle> s_list, boolean rx_hdl,boolean svr_hdl,ClientNode cnode) \n {\n \tthis.client = client;\n \tthis.my_ip = my_ip;\n \tthis.my_port = my_port;\n this.my_c_id = my_c_id;\n this.remote_c_id = remote_c_id;\n this.c_list = c_list;\n this.s_list = s_list;\n this.rx_hdl = rx_hdl;\n this.svr_hdl = svr_hdl;\n this.cnode = cnode;\n // get input and output streams from socket\n \ttry \n \t{\n \t in = new BufferedReader(new InputStreamReader(client.getInputStream()));\n \t out = new PrintWriter(client.getOutputStream(), true);\n \t} \n \tcatch (IOException e) \n \t{\n \t System.out.println(\"in or out failed\");\n \t System.exit(-1);\n \t}\n try\n {\n // only when this is started from a listening node\n // send a initial_setup message to the initiator node (like an acknowledgement message)\n // and get some information from the remote initiator node\n if(rx_hdl == true)\n {\n \t System.out.println(\"send cmd 1: setup sockets to other clients\");\n out.println(\"initial_setup\");\n ip = in.readLine();\n \t System.out.println(\"ip:\"+ip);\n port=in.readLine();\n \t System.out.println(\"port:\"+port);\n remote_c_id=Integer.valueOf(in.readLine());\n \t out.println(my_ip);\n \t out.println(my_port);\n \t out.println(my_c_id);\n \t System.out.println(\"neighbor connection, PID:\"+ Integer.toString(remote_c_id)+ \" ip:\" + ip + \" port = \" + port);\n // when this handshake is done\n // add this object to the socket handle list as part of the main Client object\n synchronized (c_list)\n {\n c_list.put(remote_c_id,this);\n }\n }\n }\n \tcatch (IOException e)\n \t{\n \t System.out.println(\"Read failed\");\n \t System.exit(1);\n \t}\n \t// handle unexpected connection loss during a session\n \tcatch (NullPointerException e)\n \t{\n \t System.out.println(\"peer connection lost\");\n \t System.exit(1);\n \t}\n // thread that continuously runs and waits for incoming messages\n // to process it and perform actions accordingly\n \tThread read = new Thread()\n {\n \t public void run()\n {\n \t while(rx_cmd(in,out) != 0) { }\n }\n \t};\n \tread.setDaemon(true); \t// terminate when main ends\n read.setName(\"rx_cmd_\"+my_c_id+\"_SockHandle_to_Server\"+svr_hdl);\n read.start();\t\t// start the thread\t\n }", "public ClientConnectionHandler(Socket socket, int number) {\r\n clientSocket = socket;\r\n clientNumber = number;\r\n isOpen = true;\r\n\r\n try {\r\n in = new DataInputStream(socket.getInputStream());\r\n out = new DataOutputStream(socket.getOutputStream());\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "public HandleAClient(Socket socket) {\n this.socket = socket;\n }", "private Socket createClient()\n\t{\n\t\tSocket client = null;\n\t\ttry {\n\t\t\tclient = this.server.accept();\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\tinsertLogEntry(e.getMessage(), e.getStackTrace().toString());\n\t\t}\n\t\t\n\t\treturn client;\n\t}", "public abstract void handle(Socket socket);", "public static SocketHandler getInstance(Socket socket) {\n\t\treturn new SocketHandler(socket);\n\t}", "public HandleAClient(Socket s) {\n\t\t\tmySocket = s;\n\t\t}", "protected ClientHandler createClientHandler(final Socket finalAccept,\n\t\t\tfinal InputStream inputStream) {\n\t\treturn new ClientHandler(inputStream, finalAccept);\n\t}", "void initAndListen() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSocket clientSocket = serverSocket.accept();\n\t\t\t\t// Startuje nowy watek z odbieraniem wiadomosci.\n\t\t\t\tnew ClientHandler(clientSocket, this);\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"Accept failed.\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void onConnectionRequest(Socket socket) {\n ConnectionHandler connectionHandler = makeConnection(socket);\n if(connectionHandler != null){\n readOnlyConnections.add(connectionHandler);\n onConnectionEstablished(connectionHandler);\n }\n }", "public Handler(Socket socket) {\n this.socket = socket;\n }", "public Handler(Socket socket) {\n this.socket = socket;\n }", "public ConnectionHandler(Socket clientSocket) {\n\t\tthis.clientSocket = clientSocket;\n\t\t//Set up a service object to get the current date and time\n\t\ttheDateService = new DateTimeService();\n\t}", "public void newClientConnection (ServerSocket client) {\n this.connectedClients.add(client);\n }", "public void creatSocket() {\n\n try {\n\n server = new ServerSocket(PORT);\n\n mExecutorService = Executors.newCachedThreadPool();\n\n while (true) {\n\n Socket client = server.accept();\n\n mExecutorService.execute(new SockectService(client));\n\n Log.d(TAG, \"Creating Socket\" );\n\n }\n\n } catch (Exception e) {\n\n e.printStackTrace();\n\n }\n\n }", "public EchoClientHandler() {\n firstMessage = Unpooled.buffer(EchoClient.SIZE);\n for (int i = 0; i < firstMessage.capacity(); i ++) {\n firstMessage.writeByte((byte) i);\n }\n }", "public JavaClientHandler(Socket newsoc, List<Question> newquiz) {\n\t\tincoming = newsoc;\n\t\tquiz = newquiz;\n\t}", "@Nonnull\n static SocketHandler from(@Nonnull String name, @Nonnull BiConsumer<WebSocket, String> rawHandler) {\n return new SocketHandlerImpl(name, rawHandler);\n }", "public static void main(String[] args) throws IOException {\n ServerSocket ss = new ServerSocket(3000);\n\n // infinite loop is running for getting client request\n while (true) {\n Socket serverSocket = null;\n\n try {\n // server socket object receive incoming client requests\n serverSocket = ss.accept();\n count++;\n\n System.out.println(\"A new client\" + clientNum++ + \" is connected : \" + serverSocket);\n\n // getting input and out streams\n DataInputStream dataInputStream = new DataInputStream(serverSocket.getInputStream());\n DataOutputStream dataOutputStream = new DataOutputStream(serverSocket.getOutputStream());\n\n System.out.println(\"Allocating new thread for this client\" + clientNum);\n\n // create a new thread object\n Thread newThread = new ClientHandler(serverSocket, dataInputStream, dataOutputStream, count);\n\n // Invoking the start() method\n newThread.start();\n\n } catch (Exception e) {\n serverSocket.close();\n e.printStackTrace();\n }\n }\n }", "public ShellClientHandler(final RemoteShellService aOwner,\n final Socket aClient) {\n\n pShellService = aOwner;\n pClient = aClient;\n }", "public ClientThread(Server server, Socket socket,\n RegistrationLoginHandler registrationLoginHandler,\n BootHandler bootHandler, ContactHandler contactHandler) {\n this.server = server;\n this.socket = socket;\n\n //handlers\n this.registrationLoginHandler = registrationLoginHandler;\n this.bootHandler = bootHandler;\n this.contactHandler = contactHandler;\n\n id = UUID.randomUUID().toString();\n\n System.out.println(\"Client connected with id: \" + id);\n\n try {\n output = new ObjectOutputStream(socket.getOutputStream());\n input = new ObjectInputStream(socket.getInputStream());\n } catch (IOException ex) {\n server.displayError(\"Exception creating new Input/output Streams: \" + ex.getMessage());\n ex.printStackTrace();\n }\n }", "void connect( String name,\n ServerSocket socket,\n ConnectionHandlerFactory handlerFactory )\n throws Exception;", "public ThreadedConnectionHandler(Socket clientSocket) {\r\n this.clientSocket = clientSocket;\r\n //Set up a service object to get the current date and time\r\n this.theDateService = new DateTimeService();\r\n //this.lngNumberOfReadings = 0;\r\n this.theTemperatureService = new TemperatureService();\r\n }", "public ClientHandler(Socket _incoming, DatagramSocket _incomingUDP) {\n\t\t\tthis.incoming = _incoming;\n\t\t\tthis.incomingUDP = _incomingUDP;\n\n\t\t}", "protected abstract ConnectionBase createNewConnection(Socket socket);", "public abstract void handleClient(Client conn);", "public ConnectionHandler(Socket controlSocket, Socket dataSocket) {\n\t\tnetwork = new NetworkHandler(controlSocket, dataSocket);\n\t}", "public void setup_servers()\n {\n // get ServerInfo\n ServerInfo t = new ServerInfo();\n // all 3 servers\n for(int i=0;i<3;i++)\n {\n // get the server IP and port info\n String t_ip = t.hmap.get(i).ip;\n int t_port = Integer.valueOf(t.hmap.get(i).port);\n Thread x = new Thread()\n {\n public void run()\n {\n try\n {\n Socket s = new Socket(t_ip,t_port);\n // SockHandle instance with svr_hdl true and rx_hdl false as this is the socket initiator\n SockHandle t = new SockHandle(s,my_ip,my_port,my_c_id,c_list,s_list,false,true,cnode);\n }\n catch (UnknownHostException e) \n {\n \tSystem.out.println(\"Unknown host\");\n \tSystem.exit(1);\n } \n catch (IOException e) \n {\n \tSystem.out.println(\"No I/O\");\n e.printStackTrace(); \n \tSystem.exit(1);\n }\n }\n };\n \n x.setDaemon(true); \t// terminate when main ends\n x.setName(\"Client_\"+my_c_id+\"_SockHandle_to_Server\"+i);\n x.start(); \t\t\t// start the thread\n }\n }", "public int createSocket()\n\t{\n\t\t\n\t}", "void handleClient(Server srv, Socket s) {\n\n InputStream is = null;\n PrintStream ps = null;\n\n try {\n\n logger.debug(\"Setting request timeout to: \" + srv.getTimeout() + \"ms\");\n s.setSoTimeout(srv.getTimeout());\n s.setTcpNoDelay(true);\n \n // Get reader/writer on stream\n logger.debug(\"Creating IO streams\");\n is = s.getInputStream();\n ps = new PrintStream(s.getOutputStream());\n\n HTTPRequest req = new HTTPRequest(srv.getApplicationName(), is, logger);\n HTTPResponse resp;\n\t if ( req.isGet() ){\n\t\t logger.debug( \"Response is GET\" );\n\t\t resp = new HTTPResponse(srv.getApplicationName(), ps, logger);\n\t } else {\n\t\t logger.debug( \"Response is HEAD\" );\n\t\t resp = new HTTPHeadResponse(srv.getApplicationName(), ps, logger);\n\t }\n new HTTPHandler(srv, req, resp, logger);\n\n } catch (Exception e) {\n // I would say throw a 500 here, but that's not really\n // possible since if we got here, something is wrong\n // with the socket/streams\n logger.error(e);\n \n } finally {\n logger.debug(\"Closing socket and streams.\");\n try {\n is.close();\n } catch (Exception e) {}\n try {\n ps.close();\n } catch (Exception e) {}\n try {\n s.close();\n } catch (Exception e) {}\n is = null;\n ps = null;\n }\n }", "ServerThread(Server srv, Socket s, IProtocolHandler h) throws IOException {\n server = srv;\n fromClient = new BufferedReader(new InputStreamReader(s.getInputStream()));\n toClient = new PrintWriter(s.getOutputStream(), true);\n client = s;\n handler = h;\n id = UUID.randomUUID().toString();\n }", "public ClientHandler(GameHandler serverArg, Socket sockArg) throws IOException {\n this.game = serverArg;\n this.sock = sockArg;\n this.in = new BufferedReader(new InputStreamReader(this.sock.getInputStream()));\n this.out = new BufferedWriter(new OutputStreamWriter(this.sock.getOutputStream()));\n \n }", "@Override\n\tpublic void run(){\n\t\tInetAddress IPAddress = serverTcpSocket.getInetAddress();\n\t\tfor (ClientObj c: clients)\n\t\t\tif (c.getId() == client.getId()){\n\t\t\t\tSystem.out.print(IPAddress + \" Client already connected!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\ttry{\n\t\t\t// Check handshake received for correctness\n\t\t\t//(connect c->s) [herader | \"JUSTIN\\0\" | connection port] (udp)\n\t\t\t//(connect response s->c) [header | client id | port] (udp)\n\t \n\t // open the connection\n\t\t clientSocket = null;\n\t\t Socket clientListener = null;\n\t\t // wait for client connection on tcp port\n\t\t //serverTcpSocket.setSoTimeout(5000);\n\t \tSystem.out.println (\" Waiting for tcp connection.....\");\n\t \tclientSocket = serverTcpSocket.accept();\n\t \tclientListener = serverTcpSocket.accept();\n\t \tclient.setListenerSocket(clientListener);\n\t\t\tIPAddress = clientSocket.getInetAddress();\n\t\t\tint recv_port = clientSocket.getPort();\n\t\t\tSystem.out.println(IPAddress + \": Client connected @ port \" + recv_port);\n\n\t\t // handle tcp connection\n\t\t\tclientSocket.setSoTimeout(Constants.ACK_TIMEOUT);\n\t\t out = new BufferedOutputStream(clientSocket.getOutputStream());\n\t\t\tin = new BufferedInputStream(clientSocket.getInputStream());\n\t\t\tclient.setAddress(clientSocket.getInetAddress());\n\t\t\tclient.setPort(clientSocket.getPort());\n\t\t clients.add(client);\n\t\t\t\n\t\t // handle requests\n\t\t\twhile (!shutdown_normally) {\n\t\t\t\t// read just the header, then handle the req based on the info in the header\n\t\t\t\tif ((buf = Utility.readIn(in, Constants.HEADER_LEN)) == null)\n\t\t\t\t\tbreak;\n\t\t\t\tint flag = buf.getInt(0);\n\t\t\t\tint len2 = buf.getInt(4);\n\t\t\t\tint id = buf.getInt(8);\n\t\t\t\t\n\t\t\t\t// check for correctness of header\n\t\t\t\t\n\t\t\t\tif (flag < Constants.OPEN_CONNECTION || \n\t\t\t\t\t\tflag > Constants.NUM_FLAGS || \n\t\t\t\t\t\tid != client.getId() || \n\t\t\t\t\t\tlen2 < 0){\n\t\t\t\t\tout.close(); \n\t\t\t\t\tin.close(); \n\t\t\t\t\tclientSocket.close(); \n\t\t\t\t\tserverTcpSocket.close();\n\t\t\t\t\tclients.remove(client);\n\t\t\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\t\t\"Connection - FAILURE! (malformed header)\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// read payload\n\t\t\t\tif ((buf = Utility.readIn(in, Utility.getPaddedLength(len2))) == null)\n\t\t\t\t\tthrow new IOException(\"read failed.\");\n\t\t\t\t// update address (necessary?)\n\t\t\t\tclients.get(clients.indexOf(client)).setAddress(clientSocket.getInetAddress());\n\t\t\t\tclient.setAddress(clientSocket.getInetAddress());\n\t\t\t\tswitch (flag){\n\t\t\t\t\tcase Constants.ACK:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.VIEW_REQ:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing view request...\");\n\t\t\t\t\t\tViewFiles(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.DOWNLOAD_REQ:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing download request...\");\n\t\t\t\t\t\tDownload(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.UPLOAD_REQ:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing upload request...\");\n\t\t\t\t\t\tUpload(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.DOWNLOAD_ACK:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing download acknowledgment...\");\n\t\t\t\t\t\tDownloadCompleted(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.CLOSE_CONNECTION:\n\t\t\t\t\t\tshutdown_normally = true;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// close all open sockets\n\t\t out.close(); \n\t\t in.close(); \n\t\t clientSocket.close(); \n\t\t serverTcpSocket.close();\n\t\t} catch (SocketTimeoutException e) {\n\t\t\tSystem.err.println(IPAddress + \": Timeout waiting for response.\");\n\t\t} catch (UnknownHostException e) {\n\t\t\t// IPAdress unknown\n\t\t\tSystem.err.println(\"Don't know about host \" + IPAddress);\n\t\t} catch (IOException e) {\n\t\t\t// Error in communication\n\t\t\tSystem.err.println(\"Couldn't get I/O for the connection to \" +\n\t\t\t\t\tIPAddress);\n\t\t} catch (RuntimeException e){\n\t\t\t// Malformed Header or payload most likely\n\t\t\tSystem.err.println(IPAddress + \": Connection - FAILURE! (\" + e.getMessage() + \")\");\n\t\t} finally {\n\t\t\t// remove this client from active lists, close all (possibly) open sockets\n\t\t\tSystem.out.println(IPAddress + \": Connection - Closing!\");\n\t\t\tclients.remove(client);\n\t\t\ttry {\n\t\t\t\tSocket clientConnection = client.getListenerSocket();\n\t\t\t\tOutputStream out_c = new BufferedOutputStream(clientConnection.getOutputStream());\n\t\t\t\tbuf = Utility.addHeader(Constants.CLOSE_CONNECTION, 0, client.getId());\n\t\t\t\tout_c.write(buf.array());\n\t\t\t\tout_c.flush();\n\t\t\t\tout_c.close();\n\t\t\t\tclientConnection.close();\n\n\t\t\t\tif (out != null)\n\t\t\t\t\tout.close();\n\t\t\t\tif (in != null)\n\t\t\t\t\tin.close();\n\t\t\t\tif (!clientSocket.isClosed())\n\t\t\t\t\tclientSocket.close();\n\t\t\t\tif (!serverTcpSocket.isClosed())\n\t\t\t\t\tserverTcpSocket.close();\n\t\t\t} catch (IOException e){\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n }", "public HandlerInvokeListener(DefaultClient client, Map<String, BaseHandler> topicTagHandlers) {\r\n\t\tsuper(topicTagHandlers, client);\r\n\t}", "AuthServerConnectionHandler(Socket socket){\n\t\tthis.socket=socket;\n\n\t}", "public abstract void createConnection(Socket socket, String userName);", "public HttpGetSocket(SocketHandler h)\r\n {\r\n super(h);\r\n }", "public String registerClient(String clientSocket) throws RemoteException;", "public ConnectionHandler(Socket sSocket, String id, int thID)\n {\n try\n {\n incoming = sSocket;\n out = new PrintWriter(incoming.getOutputStream(), true);\n in = new BufferedReader(new InputStreamReader(incoming.getInputStream()));\n IDENT = id;\n threadID = thID;\n \n dhe = new DiffieHellmanExchange(\"DHKey\");\n }\n catch (Exception e)\n {\n System.out.println(\"ConnectionHandler [ConnectionHandler]: Error in Server: \" + e);\n }\n }", "public void run() {\n ServerSocket serverSocket = null;\n try {\n serverSocket = new ServerSocket(8823);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n // running infinite loop for getting\n // client request\n while (true)\n {\n Socket socket = null;\n\n try\n {\n // socket object to receive incoming client requests\n socket = serverSocket.accept();\n\n //System.out.println(\"A new client is connected : \" + socket);\n\n // obtaining input and out streams\n InputStream inputStream = new DataInputStream(socket.getInputStream());\n OutputStream outputStream = new DataOutputStream(socket.getOutputStream());\n\n //System.out.println(\"Assigning new thread for this client\");\n\n // create a new thread object\n Thread t = new ClientHandler(socket, inputStream, outputStream);\n\n // Invoking the start() method\n t.start();\n\n }\n catch (Exception e){\n try {\n socket.close();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n e.printStackTrace();\n }\n }\n }", "public static final SocketHandler getStart(Socket socket) {\n\t\tSocketHandler requestHandler = new SocketHandler(socket);\n\t\trequestHandler.start();\n\t\treturn requestHandler;\n\t}", "SocketReader newSocketReader(SocketConnection connection);", "public void run() {\n\n // Start threadPool\n for (int i = 0; i < nbThreads; i++) {\n ThreadClient threadClient = new ThreadClient(listSocketDevice, String.valueOf(i), handler);\n arrayThreadClients.add(threadClient);\n threadClient.start();\n }\n\n while (true) {\n try {\n if (v) Log.d(TAG, \"Server is waiting on accept...\");\n ISocket isocket = acceptISocket();\n\n if (v) Log.d(TAG, isocket.getRemoteSocketAddress() + \" accepted\");\n listSocketDevice.addSocketClient(isocket);\n\n // Notify handler\n handler.obtainMessage(Service.CONNECTION_PERFORMED,\n isocket.getRemoteSocketAddress()).sendToTarget();\n\n } catch (SocketException e) {\n handler.obtainMessage(Service.LOG_EXCEPTION, e).sendToTarget();\n break;\n } catch (IOException e) {\n handler.obtainMessage(Service.LOG_EXCEPTION, e).sendToTarget();\n break;\n }\n }\n }", "public void handleNewConnections() throws IOException {\n\t\tfinal Socket newConnection = serverSocket.accept();\n\t\tnew Thread() {\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n \t\t\t\tclientOutputs.add(new PrintWriter(newConnection.getOutputStream(), true));\n \t\t\t\thandleCurrentConnection(newConnection);\n\t\t\t\t} catch(Exception e) {\n\t\t\t\t e.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}.start();\n\t}", "@Override\n protected void initChannel (SocketChannel ch) throws Exception {\n // can utilize channel to push message to different client since one channel correspond to one client\n System.out.println(\"client socket channel hashcode = \" + ch.hashCode());\n ch.pipeline().addLast(new NettyServerHandler());\n }", "public Handler_ClientChat(Socket clientSocket, PrintWriter user) \r\n\t\t{\r\n\t\t\tPrintWriter_client = user;\r\n\t\t\ttry \r\n\t\t\t{\r\n\t\t\t\tsocket_1 = clientSocket;\r\n\t\t\t\t\r\n\t\t\t\tInputStreamReader isReader = new InputStreamReader(socket_1.getInputStream());\r\n\t\t\t\tbuff_reader = new BufferedReader(isReader);\r\n\t\t\t}\r\n\t\t\tcatch (Exception ex) \r\n\t\t\t{\r\n\t\t\t\tChat.append(\"Unlooked-for Error... \\n\");\r\n\t\t\t}\r\n\t\t}", "public void handleClient(InputStream inFromClient, OutputStream outToClient);", "ClientProcess(Socket socket)\r\n {\r\n\r\n id = IDCounter++;\r\n this.socket = socket;\r\n\r\n System.out.println(\"Thread trying to create Object Input/Output Streams\");\r\n try\r\n {\r\n //set up i/o\r\n out = new ObjectOutputStream(socket.getOutputStream());\r\n in = new ObjectInputStream(socket.getInputStream());\r\n\r\n username = (String) in.readObject();\r\n displayMessage(\"***username + \" + \"JUST CONNECTED***\");\r\n userNames.add(username);\r\n }\r\n catch (IOException e) {\r\n displayMessage(\"Exception creating new Input/output Streams: \" + e);\r\n return;\r\n }\r\n\r\n\r\n catch (ClassNotFoundException e) {\r\n }\r\n\r\n System.out.println(\"complete\");\r\n }", "public Registration() {\r\n initComponents();\r\n handler = new ClientSocketHandler();\r\n }", "private void\n\thandle(\n\t\tSocket\tclientSocket)\n\t\tthrows\tIOException\n\t{\n\t\t// got client connection, get reader & writer\n\n\t\tBufferedReader\tin = getReader(clientSocket);\n\t\tOutputStream\tout = clientSocket.getOutputStream();\n\n\t\t// process request\n\n\t\tprocess(in, out);\n\n\t\t// clean up\n\n\t\tin.close();\n\t\tout.close();\n\t}", "Client createNewClient(Client client);", "private void ClientSocketConnection(ServerSocket serverSocket){\n while(true){\n try{\n Socket socket = serverSocket.accept();\n ClientThread client = new ClientThread(this, socket);\n Thread thread = new Thread(client);\n thread.start();\n clients.add(client);\n } \n catch (IOException e){\n e.printStackTrace();\n }\n }\n }", "public void run() {\r\n while (!serverSocket.isClosed()) {\r\n try {\r\n Socket socket = serverSocket.accept();\r\n if (socket.isConnected()) {\r\n clientConnections.add(new ConnectionHandler(socket));\r\n }\r\n } catch (SocketException e) {\r\n System.out.println(\"Socket ist nicht verfügbar\");\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n }", "public void setUpNetworking() throws Exception {\n this.serverSock = new ServerSocket(4242);\n\n groupChats = new HashMap<String, ArrayList<String>>();\n groupMessages = new HashMap<String, ArrayList<String>>();\n groupMessages.put(\"Global\", new ArrayList<String>());\n\n int socketOn = 0;\n\n while (true) {\n\n Socket clientSocket = serverSock.accept();\n System.out.println(\"Received connection \" + clientSocket);\n\n ClientObserver writer = new ClientObserver(clientSocket.getOutputStream());\n\n Thread t = new Thread(new ClientHandler(clientSocket, writer));\n t.start();\n System.out.println(\"Connection Established\");\n socketOn = 1;\n }\n }", "public ClientHandler(Socket s, PrintWriter out, String workingDirectory) {\r\n\t /**\r\n * assign to Socket\r\n */\r\n\t this.s = s;\r\n /**\r\n * assigning out to class PrintWriter object\r\n */\r\n this.out = out;\r\n /**\r\n * assign working directory argument to the workingDirectory variable\r\n */\r\n this.workingDirectory = workingDirectory;\r\n }", "public interface ClientHandler {\r\n\r\n\t/**\r\n\t * Handle client.\r\n\t *\r\n\t * @param inFromClient the in from client\r\n\t * @param outToServer the out to server\r\n\t */\r\n\tpublic void handleClient(InputStream inFromClient, OutputStream outToServer);\r\n}", "@Override\r\n \tpublic void clientConnectedCallback(RoMClient newClient) {\r\n \t\t// Add new client and start listening to this one\r\n \t\tthis.clients.addClient(newClient);\r\n \r\n \t\t// Create the ReceiveClientCommandThread for this client\r\n \t\tReceiveClientCommandThread receiveCommandThread = new ReceiveClientCommandThread(newClient, this, this);\r\n \t\treceiveCommandThread.start();\r\n \r\n \t\t// Create the CommandQueue Thread for this client\r\n \t\tClientCommandQueueThread commandQueueThread = new ClientCommandQueueThread(newClient);\r\n \t\tcommandQueueThread.start();\r\n \t}", "public void setup_clients()\n {\n ClientInfo t = new ClientInfo();\n for(int i=0;i<5;i++)\n {\n // for mesh connection between clients\n // initiate connection to clients having ID > current node's ID\n if(i > my_c_id)\n {\n // get client info\n String t_ip = t.hmap.get(i).ip;\n int t_port = Integer.valueOf(t.hmap.get(i).port);\n Thread x = new Thread()\n {\n \tpublic void run()\n {\n try\n {\n Socket s = new Socket(t_ip,t_port);\n // SockHandle instance with svr_hdl false and rx_hdl false as this is the socket initiator\n // and is a connection to another client node\n SockHandle t = new SockHandle(s,my_ip,my_port,my_c_id,c_list,s_list,false,false,cnode);\n }\n catch (UnknownHostException e) \n {\n \tSystem.out.println(\"Unknown host\");\n \tSystem.exit(1);\n } \n catch (IOException e) \n {\n \tSystem.out.println(\"No I/O\");\n e.printStackTrace(); \n \tSystem.exit(1);\n }\n \t}\n };\n \n x.setDaemon(true); \t// terminate when main ends\n x.setName(\"Client_\"+my_c_id+\"_SockHandle_to_Client\"+i);\n x.start(); \t\t\t// start the thread\n }\n }\n\n // another thread to check until all connections are established ( ie. socket list size =4 )\n // then send a message to my_id+1 client to initiate its connection setup phase\n Thread y = new Thread()\n {\n public void run()\n {\n int size = 0;\n // wait till client connections are setup\n while (size != 4)\n {\n synchronized(c_list)\n {\n size = c_list.size();\n }\n }\n // if this is not the last client node (ID =4)\n // send chain init message to trigger connection setup\n // phase on the next client\n if(my_c_id != 4)\n {\n c_list.get(my_c_id+1).send_setup();\n System.out.println(\"chain setup init\");\n }\n // send the setup finish, from Client 4\n // indicating connection setup phase is complete\n else\n {\n c_list.get(0).send_setup_finish();\n }\n }\n };\n \n y.setDaemon(true); \t// terminate when main ends\n y.start(); \t\t\t// start the thread\n }", "@Override\r\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tRecieveSocketOfClient(SocketForClient);\r\n\t\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}", "public interface ServerSocketFactory {\n\n\t\tpublic ServerSocket create() throws IOException;\n\n\t}", "public void addServer(AbstractServer server) {\n // Iterate through all types of CorfuMsgType, registering the handler\n server.getHandler().getHandledTypes()\n .forEach(x -> {\n handlerMap.put(x, server);\n log.trace(\"Registered {} to handle messages of type {}\", server, x);\n });\n }", "public void handleClientRequest() {\n System.out.println(\"... new ConnectionHandler constructed ...\");\n try {\n while (true) {\n // Get input data from client over socket\n String line = br.readLine();\n String[] lineArray = line.split(\" \");\n String requestType = lineArray[0];\n String resourceName = lineArray[1];\n // Log this request\n log.append(\"\\nRequest at \").append(fldt).append(\":\\n\").append(line);\n log.newLine();\n File f = new File(path + resourceName);\n String contentLength = String.valueOf(f.length());\n\n // Interpret request and respond accordingly\n if (!f.isFile()) {\n byte[] response = getHeader(404, contentLength, resourceName);\n\n os.write(response);\n // Log this response\n log.append(\"Response code:\\n404 Not Found\");\n log.newLine();\n break;\n } else if (requestType.contains(\"GET\")) {\n byte[] header = getHeader(200, contentLength, resourceName);\n byte[] content = getContent(f);\n byte[] response = new byte[header.length + content.length];\n System.arraycopy(header, 0, response, 0, header.length);\n System.arraycopy(content, 0, response, header.length, content.length);\n\n os.write(response);\n // Log this response\n log.append(\"Response code:\\n200 OK\");\n log.newLine();\n break;\n } else if (requestType.equals(\"HEAD\")) {\n byte[] response = getHeader(200, contentLength, resourceName);\n\n os.write(response);\n // Log this response\n log.append(\"Response code:\\n200 OK\");\n log.newLine();\n break;\n } else if (requestType.equals(\"DELETE\")) {\n f.delete();\n break;\n } else {\n byte[] response = getHeader(501, contentLength, resourceName);\n\n os.write(response);\n // Log this response\n log.append(\"Response code:\\n501 Not Implemented\");\n log.newLine();\n break;\n }\n }\n cleanUp();\n } catch (IOException | IndexOutOfBoundsException e) {\n System.err.println(\"ConnectionHandler:handleClientRequest (error): \" + e.getMessage());\n cleanUp();\n }\n }", "public static Runnable getServiceHandler(TcpPacket request, Socket socket, IndexFile index) {\n MessageType requestType = request.getMessageType();\n Request toProcess = null;\n if (requestType != MessageType.LIST){\n toProcess = NetworkUtils.getPacketContents(request);\n }\n switch (requestType) {\n case DOWNLOAD:\n return new DownloadServiceHandler(socket, toProcess, index);\n case UPLOAD:\n return new UploadServiceHandler(socket, toProcess, index);\n case DELETE:\n return new DeleteServiceHandler(socket, toProcess, index);\n case LIST:\n return new FileListServiceHandler(socket, index);\n default:\n //\n // throw new Exception(\"Wrong request type\");\n return null;\n }\n\n }", "public Socket createSocket()\n/* */ {\n/* 82 */ return new Socket();\n/* */ }", "public ParticipantHandler(Socket socket, ExecuteController executeController) throws IOException {\n this.id = UUID.randomUUID().toString();\n this.socket = socket;\n this.readerConnection = new InputStreamReader(this.socket.getInputStream());\n this.reader = new BufferedReader(readerConnection);\n this.writer = new PrintWriter(this.socket.getOutputStream(), true);\n this.executeController = executeController;\n }", "void connect( String name,\n ServerSocket socket,\n ConnectionHandlerFactory handlerFactory,\n ThreadPool threadPool )\n throws Exception;", "public void createNewConnection(Socket socket) throws IOException{\n\t\tThread connection = null;\n\t\t\n\t\tswitch (type){\n\t\n\t\t\tcase RULE_CONNECTION:\n\t\t\t\tconnection = new Thread(new RemoteRuleHandler(socket));\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tconnections.add(connection);\n\t\tconnection.start();\n\t}", "private void handleNewClientProxyEvent(NewClientProxyEvent event) throws AppiaEventException {\n \t\tevent.loadMessage();\n \t\tSystem.out.println(\"Received a new client from a server\");\n \n \t\t//Get the parameters\n \t\tString groupId = event.getClient().getGroup().id;\n \n \t\t//Add the client as a future client\n \t\tVsClientManagement.addAsFutureClient(groupId, event.getClient());\n \n \t\t//I ask if I have some client in that group\n \t\tif( VsClientManagement.hasSomeClientConnectedToServer(groupId, listenAddress)){\n \t\t\tSystem.out.println(\"I have clients to ask to shut up\");\n \n \t\t\t//I need to ask my attached clients for them to Block\t\n \t\t\tVsGroup group = VsClientManagement.getVsGroup(groupId);\n \t\t\tShutUpStubEvent shutUpEvent = new ShutUpStubEvent(groupId);\n \t\t\tsendStubEvent(shutUpEvent, group);\n \t\t}\n \n \t\t//If I don't have no clients in that group\n \t\telse{\n \t\t\tSystem.out.println(\"I have no clients for group: \" + groupId + \" so I can send the blockOk\");\n \n \t\t\t//Get my version for this group\n \t\t\tint viewVersion = VsClientManagement.getVsGroup(groupId).getCurrentVersion();\n \n \t\t\t//I may send directly the BlockOkProxy event to me and the other server\n \t\t\tBlockOkProxyEvent blockedOkProxy = new BlockOkProxyEvent(groupId, myEndpt, viewVersion);\n \t\t\tsendToOtherServers(blockedOkProxy);\n \t\t\tsendToMyself(blockedOkProxy);\n \t\t}\n \t}", "@Override\n\tpublic void createClient() {\n\t\t\n\t}", "public static void main(String[] args) throws Throwable {\n ServerSocket server = new ServerSocket();\n server.bind(new InetSocketAddress(3000));\n System.out.println(\"Blocking Socket : listening for new Request\");\n while (true) { // <1>\n Socket socket = server.accept();\n //each incomming request(socket request) allocate in a separate thread\n new Thread(clientHandler(socket)).start();\n }\n }", "public KVCommunicationModule createCommunicationModule(Socket socket){\n KVCommunicationModule module = new KVCommunicationModule(socket,\"server\");\n module.setLogLevel(kv_out.getOutputLevel(),kv_out.getLogLevel());\n return module;\n }", "private void initBinding() throws IOException {\n serverSocketChannel.bind(new InetSocketAddress(0));\n serverSocketChannel.configureBlocking(false);\n serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT);\n\n sc.configureBlocking(false);\n var key = sc.register(selector, SelectionKey.OP_CONNECT);\n uniqueContext = new ClientContext(key, this);\n key.attach(uniqueContext);\n sc.connect(serverAddress);\n }", "private void addThread(SSLSocket socket)\n {\n if(pop < clist.length)\n {\n for(ServerThread srv : clist)\n {\n if(srv == null)\n {\n //make a new thread to run data through to new client\n srv = new ServerThread(this, socket);\n \n try\n {\n //start up the thread\n srv.open();\n start();\n \n //set everything up here (increment pop count, keep track of thread)\n clist[pop] = srv;\n pop++;\n break;\n }\n catch(IOException e)\n {\n System.out.println(\"Cannot open new thread\");\n }\n \n \n }\n \n }\n System.out.println(\"New Connection: \" + socket);\n\n }\n else\n {\n System.out.println(\"Sorry, server full at \" + pop);\n }\n }", "public clientThread(Socket clientSocket, clientThread[] threads) {\n\t this.clientSocket = clientSocket;\n\t this.threads = threads;\n\t maxClients = threads.length;\n\t }", "public ServiceHandler createServiceHandler(\n Reactor reactor,\n SelectableChannel handle) {\n try {\n return new TestAcceptHandler(reactor, handle, this._pool);\n } catch (IOException ex) {\n MDMS.ERROR(ex.getMessage());\n return null;\n }\n }", "public void handleMessage(Message message, Socket socket) throws IOException, HandlingException;", "protected abstract void createLogin(Socket socket);", "public ClientTSap(SocketFactory socketFactory) {\n this.socketFactory = socketFactory;\n }", "public ServerProcessConnection(ServerSocket socket, \n\t\t\tList<ClientObj> clients, ClientObj client) {\n\t\tthis.client = client;\n\t\tthis.clients = clients;\n\t serverTcpSocket = socket;\n\t peer_threads = new ArrayList<ServerFwding>();\n\t}", "@Override\n\tpublic void handlerAdded(ChannelHandlerContext ctx) throws Exception {\n\t\tLog.i(\"MySocketHandler\", \"handlerAdded\");\n\t\tsuper.handlerAdded(ctx);\n\t}", "public void run() {\n while(!serverSocket.isClosed()) {\n try {\n Socket newClient = serverSocket.accept();\n PrintWriter pw = new PrintWriter(newClient.getOutputStream());\n if(connections.size() < MAX_CONNECTIONS) {\n synchronized(this) {\n connections.addElement(newClient);\n writers.addElement(pw);\n pw.print(\"TelnetAppender v1.0 (\" + connections.size()\n\t\t + \" active connections)\" + EOL + EOL);\n pw.flush();\n }\n } else {\n pw.print(\"Too many connections.\" + EOL);\n pw.flush();\n newClient.close();\n }\n } catch(Exception e) {\n if (e instanceof InterruptedIOException || e instanceof InterruptedException) {\n Thread.currentThread().interrupt();\n }\n if (!serverSocket.isClosed()) {\n LogLog.error(\"Encountered error while in SocketHandler loop.\", e);\n }\n break;\n }\n }\n\n try {\n serverSocket.close();\n } catch(InterruptedIOException ex) {\n Thread.currentThread().interrupt();\n } catch(IOException ex) {\n }\n }", "protected void handleConnection(Socket socket) {\n try {\n PrintWriter out = new PrintWriter(socket.getOutputStream(), true);\n BufferedReader in = new BufferedReader(\n new InputStreamReader(socket.getInputStream()\n ));\n \n new Thread(new RequestHandler(in, out)).start();\n }\n catch (IOException e) {\n\n }\n\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\twhile (true) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tSocket socket = serverSocket.accept();\n\t\t\t\t\t\tclients.add(new Client(socket));\n\t\t\t\t\t\tSystem.out.println(\"[클라이언트 접속] \" + socket.getRemoteSocketAddress() + \": \"\n\t\t\t\t\t\t\t\t+ Thread.currentThread().getName());\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t// TODO: handle exception\n\t\t\t\t\t\tif (!serverSocket.isClosed()) {\n\t\t\t\t\t\t\tstopServer();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public static void main(String[] args) throws IOException\n {\n Scanner sc=new Scanner(System.in);\n System.out.print(\"Enter Port No:\");\n int port=sc.nextInt();\n ServerSocket server_sokt=new ServerSocket(port); //Server Created \n System.out.println(\"Server Hosted at Port \"+port);\n\n while(true)\n {\n Socket socket_object=null; // Initialize Listening Socket\n try \n {\n socket_object=server_sokt.accept(); //Accept Connection Request from Client\n cnt+=1; \n DataInputStream inpt=new DataInputStream(socket_object.getInputStream());\n // String name=\"Client\"+cnt; // I can also put names like client1,client2 ......\n String name=inpt.readUTF(); // Read Name of Client \n System.out.println(\"Client \"+name+\" Connected\"); \n Thread new_client_thread=new ClientHandle(socket_object,inpt,name); // Creating a thread for a client\n new_client_thread.start(); //starting thread\n } \n catch (Exception e)\n {\n socket_object.close();\n e.printStackTrace();\n break;\n }\n }\n server_sokt.close();\n sc.close();\n }", "private static void handleServer(){\n // Main program. It should handle all connections.\n try{\n while(true){\n Socket clientSocket= serverSocket.accept();\n ServerThread thread = new ServerThread(clientSocket, connectedUsers, groups);\n thread.start();\n }\n }catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void initiateServerInstance(Socket newSocket){\n KVCommunicationModule com = createCommunicationModule(newSocket);\n KVServerInstance instance = createServerInstance(com, master);\n aliveInstances.add(instance);\n Thread aliveinstancethread = new Thread(instance);\n aliveinstancethread.start();\n aliveinstancethreads.add(aliveinstancethread);\n }", "public interface ClientHandler extends Remote {\n\n public void handleMessage(Message msg) throws RemoteException;\n\n}", "public CallAppAbilityConnnectionHandler createHandler() {\n EventRunner create = EventRunner.create();\n if (create != null) {\n return new CallAppAbilityConnnectionHandler(create);\n }\n HiLog.error(LOG_LABEL, \"createHandler: no runner.\", new Object[0]);\n return null;\n }", "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 }", "@Test\n public void testServerHandler() throws IOException {\n ServerHandler handler = new ServerHandler();\n\n // Add user\n String username = handler.generateUsername();\n User user = new User.UserBuilder()\n .hasUsername(username)\n .build();\n Socket socket = new Socket();\n ClientInfo clientInfo = new ClientInfo(user, socket, handler);\n handler.addUser(clientInfo);\n\n // Add another user\n String username2 = handler.generateUsername();\n User user2 = new User.UserBuilder()\n .hasUsername(username2)\n .build();\n Socket socket2 = new Socket();\n ClientInfo clientInfo2 = new ClientInfo(user2, socket2, handler);\n handler.addUser(clientInfo2);\n\n // Remove second user\n handler.removeUser(handler.getUserClientInfo(username2));\n\n // Get users\n Vector<ClientInfo> users = handler.getUsers();\n\n // Find user\n User foundUser = handler.findByUsername(username);\n\n // User existence\n boolean userExists = handler.usernameExists(foundUser.getUsername());\n\n assertEquals(10, foundUser.getUsername().length());\n assertEquals(true, userExists);\n assertEquals(1, users.size());\n }", "public abstract void onClientConnect(ClientWrapper client);", "@Override\n protected void initChannel(NioSocketChannel nioSocketChannel) throws Exception {\n nioSocketChannel.pipeline().addLast(new FirstClientHandler());\n }" ]
[ "0.64748335", "0.6365735", "0.62987614", "0.62264377", "0.5858654", "0.5819042", "0.57744706", "0.5685101", "0.5637421", "0.5635924", "0.56052285", "0.5598046", "0.5566442", "0.55618465", "0.5522567", "0.5514853", "0.5512556", "0.5494091", "0.5490908", "0.5490908", "0.54393697", "0.54390675", "0.5395473", "0.53420544", "0.531728", "0.5310636", "0.52840626", "0.52812684", "0.52695215", "0.5196827", "0.5190357", "0.5166538", "0.51645184", "0.5159035", "0.51306266", "0.51298434", "0.5124421", "0.5080519", "0.5042907", "0.5024035", "0.5019038", "0.5010132", "0.50047237", "0.49870583", "0.49763063", "0.49722627", "0.49708128", "0.49689764", "0.495925", "0.49485457", "0.49473727", "0.49369913", "0.4928798", "0.49284562", "0.49273857", "0.4925261", "0.49231893", "0.49195278", "0.49129006", "0.49114773", "0.4910302", "0.4902768", "0.48832023", "0.48742083", "0.48635694", "0.48537102", "0.4831913", "0.48286045", "0.48070133", "0.48025003", "0.47938478", "0.47906467", "0.47861072", "0.47778457", "0.4776649", "0.47733858", "0.47691733", "0.47641388", "0.47640392", "0.47611997", "0.47594345", "0.47591165", "0.47575188", "0.47523814", "0.4752116", "0.47464538", "0.4740689", "0.4738868", "0.47368124", "0.4735215", "0.47321495", "0.4728564", "0.4722632", "0.4719214", "0.4707664", "0.4705511", "0.47013766", "0.46983135", "0.46861896", "0.46829823" ]
0.5345019
23
Starts client handler. Handler begins to listen for commands from client and responds to it.
@Override public void run() { try { Request command = (Request) cmdInStream.readObject(); while (!"EXIT".equalsIgnoreCase(command.getContent())) { log.info(String.format("Received command: %s", command.getContent())); // Searching for appropriate handler for received request RequestHandler request = handlers.get(command.getContent()); if (request != null) { // Processing request and writing response Response response = request.handle(command); cmdOutStream.writeObject(response); } else { cmdOutStream.writeObject(new Response("Incorrect request. Please try again.")); } // Read next command command = (Request) cmdInStream.readObject(); } cmdInStream.close(); cmdOutStream.close(); fileInStream.close(); fileOutStream.close(); cmdSocket.close(); fileSocket.close(); } catch (ClassNotFoundException ex) { log.error("Class can't be found! " + ex.getMessage()); } catch (IOException ex) { log.error(ex.getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void serveClient() {\r\n\t\tif (lineIn == null || lineOut == null) {\r\n\t\t\tSystem.err.printf(\"I/O has not been set up.%n\");\r\n\t\t} else {\r\n\t\t\ttry {\r\n\t\t\t\tString clientRequest;\r\n\t\t\t\tStringTokenizer args;\r\n\r\n\t\t\t\t// control loop, receiving client requests\r\n\t\t\t\twhile (!exitRecieved) {\r\n\t\t\t\t\t// PRESENT PROMPT\r\n\t\t\t\t\tsendMessage(PROMPT);\r\n\r\n\t\t\t\t\t// ACCEPT & PROCESS INPUT\r\n\t\t\t\t\tclientRequest = receiveMessage();\r\n\t\t\t\t\targs = new StringTokenizer(clientRequest);\r\n\t\t\t\t\tprocessCommand(args);\r\n\t\t\t\t}\r\n\r\n\t\t\t} catch (IOException ioe) {\r\n\t\t\t\tSystem.err.printf(\"IO Error receiving client input: %s%n\", ioe);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void run() {\n try {\n // accepts the connection request.\n SelectableChannel peerHandle = this._handle.accept();\n if (peerHandle != null) {\n // now, create a service handler object to serve the\n // the client.\n ServiceHandler handler =\n this._factory.createServiceHandler(\n this._reactor,\n peerHandle);\n if (handler != null)\n // give the service handler object a chance to initialize itself.\n handler.open();\n }\n } catch (IOException ex) {\n MDMS.ERROR(ex.getMessage());\n }\n }", "public void run() {\n clientLogger.info(\"Client \" + name + \" started working\");\n EventLoopGroup group = new NioEventLoopGroup();\n try {\n Bootstrap bootstrap = new Bootstrap()\n .group(group)\n .channel(NioSocketChannel.class)\n .handler(new ClientInitializer());\n Channel channel = bootstrap.connect(host, port).sync().channel();\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\n while (true) {\n channel.write(in.readLine() + \"\\r\\n\");\n }\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n group.shutdownGracefully();\n }\n clientLogger.info(\"Client \" + name + \" finished working\");\n }", "public static void startServer() {\n clientListener.startListener();\n }", "void initAndListen() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSocket clientSocket = serverSocket.accept();\n\t\t\t\t// Startuje nowy watek z odbieraniem wiadomosci.\n\t\t\t\tnew ClientHandler(clientSocket, this);\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"Accept failed.\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}\n\t}", "public Client() {\n initComponents();\n \n Server server = new Server();\n server.start();\n \n }", "public void clientStart()\n\t{\n\t\tint cnt = 0;\n\t\tfor(ConnectionThread i : connectionPool)\n\t\t{\n\t\t\ti.sendMessage(\"Rock and Roll\");\n\t\t\taddText(\"send start signal to Player\" + cnt++);\n\t\t}\n\t\tchangePicture();\n\t}", "public void processStart(){\n initWorkerQueue();\n DataBean serverArgs = new DataBean();\n serverArgs.setValue(\"mode\",\"server\");\n serverArgs.setValue(\"messagekey\",\"72999\");\n serverArgs.setValue(\"user\",\"auth\");\n serverArgs.setValue(\"messagechannel\",\"/esb/system\");\n messageClient = new MessageClient(this,serverArgs);\n Helper.writeLog(1,\"starting message server\");\n messageClient.addHandler(this);\n \n }", "@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tthis.sendMessage(Response.WELCOME_MESSAGE);\n\t\t\t// Get new command from client\n\t\t\twhile (true) {\n\t\t\t\tthis.executeCommand();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// If a exception is catch we just close the client connection\n\t\t\ttry {\n\t\t\t\tthis.close();\n\t\t\t} catch (IOException e1) {\n\t\t\t\t/// just throw the exception of the close\n\t\t\t\tthrow new RuntimeException(e1);\n\t\t\t}\n\t\t}\n\t}", "public void run() {\r\n String request = \"\";\r\n\r\n try {\r\n /**\r\n * The ClientConnectionHandler constantly waits for requests from the client. Requests are the initial message\r\n * that the client sends. This initial message determines how the server receives the messages that come after\r\n * it (if there are any).\r\n */\r\n while (isOpen) {\r\n request = readMessage();\r\n processRequest(request);\r\n }\r\n clientSocket.close();\r\n System.out.println(\"Client #\" + clientNumber + \" has closed\");\r\n } catch (Exception e) {}\r\n }", "private void startHandler() {\n mHandler = new MessageHandler();\n }", "public void start() {\n system = ActorSystem.create(\"http-server\", config);\n\n Settings settings = SettingsExtension.SettingsExtensionProvider.get(system);\n\n vHostHandlers = settings.vHostConfigs()\n .stream()\n .map(vc -> new AkkaTcpHandler(system, vc))\n .collect(Collectors.toList());\n\n vHostHandlers.forEach(VHostHandler::start);\n\n Runtime.getRuntime().addShutdownHook(new Thread(this::terminate));\n }", "@Override\r\n\tprotected void onStart() {\n\t\tsuper.onStart();\r\n\t\tUiUpdater.registerClient(handler);\r\n\t\tupdateUI();\r\n\t}", "@Override\n\tpublic void run() {\n\n\t\tServerSocket sSocket;\n\t\ttry {\n\t\t\tsSocket = new ServerSocket(15001);\n\t\t\tSystem.out.println(\"server listening at \" + sSocket.getLocalPort());\n\t\t\twhile (true) {\n\t\t\t\t// this is an unique socket for each client\n\t\t\t\tSocket socket = sSocket.accept();\n\t\t\t\tSystem.out.println(\"Client with port number: \" + socket.getPort() + \" is connected\");\n\t\t\t\t// start a new thread for handling requests from the client\n\t\t\t\tClientRequestHandler requestHandler = new ClientRequestHandler(sketcher, socket, scene, playerMap);\n\t\t\t\tnew Thread(requestHandler).start();\n\t\t\t\t// start a new thread for handling responses for the client\n\t\t\t\tClientResponseHandler responseHandler = new ClientResponseHandler(socket, scene, playerMap);\n\t\t\t\tnew Thread(responseHandler).start();\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t}\n\t}", "public synchronized void listen() {\n// synchronized (this) {\n try {\n String input;\n if ((input = in.readLine()) != null) {\n parseCommand(input);\n }\n } catch (IOException ex) {\n Logger.getLogger(ClientIO.class.getName()).log(Level.SEVERE, null, ex);\n }\n// }\n }", "public void startClientServer() {\n try {\n this.server_socket = new ServerSocket( port );\n this.start();\n } catch (IOException e ) {\n System.err.println( \"Failure: Socket couldn't OPEN! -> \" + e );\n } finally {\n System.out.println( \"Success: Server socket is now Listening on port \" + port + \"...\" );\n }\n }", "public void start() {\n System.err.println(\"Server will listen on \" + server.getAddress());\n server.start();\n }", "@Override\r\n\tpublic void run() {\n\t\trunClient();\r\n\t}", "public void run() {\n running = true;\n System.out.println(\"Server started on port: \" + port);\n manageClients();\n receive();\n startConsole();\n }", "public EchoClientHandler() {\n firstMessage = Unpooled.buffer(EchoClient.SIZE);\n for (int i = 0; i < firstMessage.capacity(); i ++) {\n firstMessage.writeByte((byte) i);\n }\n }", "public void startServer()\n\t{\n\t\twhile(true)\n\t\t{\n\t\t\tSystem.out.println(\"Listen\");\n\t\t\tif(listenInitialValuesRequest)\n\t\t\t{\n\t\t\t\tlistenInitialValuesRequest();\n\t\t\t}\n\t\t}\n\t}", "public void start() {\n System.out.println(\"server started\");\n mTerminalNetwork.listen(mTerminalConfig.port);\n }", "public void start() {\n\t\tconnection.start((sender, message) -> message.accept(new Visitor(sender)));\n\t\tloadData();\n\t}", "private void runServer()\n {\n int port = Integer.parseInt(properties.getProperty(\"port\"));\n String ip = properties.getProperty(\"serverIp\");\n \n Logger.getLogger(ChatServer.class.getName()).log(Level.INFO, \"Server started. Listening on: {0}, bound to: {1}\", new Object[]{port, ip});\n try\n {\n serverSocket = new ServerSocket();\n serverSocket.bind(new InetSocketAddress(ip, port));\n do\n {\n Socket socket = serverSocket.accept(); //Important Blocking call\n Logger.getLogger(ChatServer.class.getName()).log(Level.INFO, \"Connected to a client. Waiting for username...\");\n ClientHandler ch = new ClientHandler(socket, this);\n clientList.add(ch);\n ch.start();\n } while (keepRunning);\n } catch (IOException ex)\n {\n Logger.getLogger(ChatServer.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void start()\n {\n isRunning = true;\n try\n {\n //metoden opretter en ny socket for serveren på den valgte port\n ServerSocket serverSocket = new ServerSocket(port);\n //mens serveren kører venter den på en client\n while (isRunning)\n {\n serverDisplay(\"Serveren venter på clienter på port: \" + port);\n //accepterer clienten på socketen\n Socket socket = serverSocket.accept();\n\n if (!isRunning)\n {\n break;\n }\n // laver en ny thread til clienten med socketen der er blevet accepteret\n HandleClientThread handleClientThread = new HandleClientThread(socket);\n\n // her blever tråden tilføjet til arryet af clienter\n clientThreadArrayList.add(handleClientThread);\n // Starer handleclient tråden som håndtere clienter\n handleClientThread.start();\n }\n try\n {\n //Her lukker serveren socketen\n serverSocket.close();\n for (int i = 0; i < clientThreadArrayList.size() ; i++)\n {\n HandleClientThread hct = clientThreadArrayList.get(i);\n try\n {\n hct.inputStream.close();\n hct.outputStream.close();\n hct.socket.close();\n }\n catch (IOException e)\n {\n System.out.println(\"Uknowen command \" + e);\n }\n }\n }\n catch (Exception e)\n {\n serverDisplay(\"Kunne ikke lukke serveren og clienterne pga. \" + e);\n }\n }\n catch (IOException e)\n {\n String message = dateFormat.format(new Date()) + \"Fejl på ny server socket\" + e + \"\\n\";\n serverDisplay(message);\n }\n }", "public void run() {\n ServerSocket serverSocket = null;\n try {\n serverSocket = new ServerSocket(8823);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n // running infinite loop for getting\n // client request\n while (true)\n {\n Socket socket = null;\n\n try\n {\n // socket object to receive incoming client requests\n socket = serverSocket.accept();\n\n //System.out.println(\"A new client is connected : \" + socket);\n\n // obtaining input and out streams\n InputStream inputStream = new DataInputStream(socket.getInputStream());\n OutputStream outputStream = new DataOutputStream(socket.getOutputStream());\n\n //System.out.println(\"Assigning new thread for this client\");\n\n // create a new thread object\n Thread t = new ClientHandler(socket, inputStream, outputStream);\n\n // Invoking the start() method\n t.start();\n\n }\n catch (Exception e){\n try {\n socket.close();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n e.printStackTrace();\n }\n }\n }", "@Override\n public void registerClientCommands(CommandHandler handler) {\n new InGameCommands(handler);\n }", "public ClientHandler(Socket cmdSocket, Socket fileSocket, FileTransferServer server) {\n // Set up a simple configuration that logs on the console.\n BasicConfigurator.configure();\n\n log = Logger.getLogger(ClientHandler.class.getName());\n\n this.cmdSocket = cmdSocket;\n this.fileSocket = fileSocket;\n this.server = server;\n\n prepareStreams();\n\n // Initialize handlers for each command\n handlers = new HashMap<>();\n handlers.put(\"DIR\", new DirRequestHandler(server));\n handlers.put(\"GET\", new GetRequestHandler(server, fileOutStream));\n handlers.put(\"PUT\", new PutRequestHandler(server, fileInStream));\n }", "public void onStart() {\n\t\tnew Thread() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tinitConnection();\n\t\t\t\treceive();\n\t\t\t}\n\t\t}.start();\n\t}", "public void run() {\n // Initial connect request comes in\n Request request = getRequest();\n\n if (request == null) {\n closeConnection();\n return;\n }\n\n if (request.getConnectRequest() == null) {\n closeConnection();\n System.err.println(\"Received invalid initial request from Remote Client.\");\n return;\n }\n\n ObjectFactory objectFactory = new ObjectFactory();\n Response responseWrapper = objectFactory.createResponse();\n responseWrapper.setId(request.getId());\n responseWrapper.setSuccess(true);\n responseWrapper.setConnectResponse(objectFactory.createConnectResponse());\n responseWrapper.getConnectResponse().setId(id);\n\n // Return connect response with our (statistically) unique ID.\n if (!sendMessage(responseWrapper)) {\n closeConnection();\n System.err.println(\"Unable to respond to connect Request from remote Client.\");\n return;\n }\n\n // register our thread with the server\n Server.register(id, this);\n\n // have handler manage the protocol until it decides it is done.\n while ((request = getRequest()) != null) {\n\n Response response = handler.process(this, request);\n\n if (response == null) {\n continue;\n }\n\n if (!sendMessage(response)) {\n break;\n }\n }\n\n // client is done so thread can be de-registered\n if (handler instanceof IShutdownHandler) {\n ((IShutdownHandler) handler).logout(Server.getState(id));\n }\n Server.unregister(id);\n\n // close communication to client.\n closeConnection();\n }", "@Override\r\n \tpublic void clientConnectedCallback(RoMClient newClient) {\r\n \t\t// Add new client and start listening to this one\r\n \t\tthis.clients.addClient(newClient);\r\n \r\n \t\t// Create the ReceiveClientCommandThread for this client\r\n \t\tReceiveClientCommandThread receiveCommandThread = new ReceiveClientCommandThread(newClient, this, this);\r\n \t\treceiveCommandThread.start();\r\n \r\n \t\t// Create the CommandQueue Thread for this client\r\n \t\tClientCommandQueueThread commandQueueThread = new ClientCommandQueueThread(newClient);\r\n \t\tcommandQueueThread.start();\r\n \t}", "@SubscribeEvent\n public void onClientStarting(final FMLClientSetupEvent event) {\n LOGGER.info(\"client setting up\");\n }", "private void start() {\n windowForCommunication.append(\"Awaiting client connection...\" + \"\\n\");\n\n //check if client is connected, if yes, add the following text to the chat window, then enable communication\n if (clientSocket.isConnected()) {\n windowForCommunication.append(\"Connection is established. Type 'stopconnection' to stop connection\" + \"\\n\");\n textField.setEditable(true);\n }\n\n //Begin communication, end if \"stopconnection\" is typed by Server/Client. If it is, call closeStreams method.\n try {\n String userInput;\n\n while((userInput = input.readLine()) != null) {\n if(userInput.contains(\"stopconnection\")){\n closeStreams();\n break;\n }\n\n displayMessage(userInput + \"\\n\");\n\n }\n }\n catch(IOException e) {\n e.printStackTrace();\n }\n }", "void clientReady();", "public void run() {\n\t\tMisc.log(\"Server waiting for client...\");\r\n\r\n\t\ttry {\r\n\t\t\tserver = socket.accept();\r\n\t\t\tMisc.log(server.getRemoteSocketAddress() + \" has connected.\");\r\n\t\t\t\r\n\t\t\t//get the input and output streams which are used to send and receive messages from the client\r\n\t\t\tin = new DataInputStream(server.getInputStream());\r\n\t\t\tout = new DataOutputStream(server.getOutputStream());\r\n\t\t\t\r\n\t\t\t//send host's username to the connected client by creating a hello packet with the username\r\n\t\t\tsendData(new HelloPacket(serverHost.getUsername()).getData());\r\n\t\t\t\r\n\t\t} catch(IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t//server is listening until the serverRunning flag is set to false\r\n\t\twhile(serverRunning) {\t\t\t\r\n\t\t\t//construct packet object to save received data into\r\n\t\t\tbyte[] data = new byte[1024];\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\t//wait to receive a packet\r\n\t\t\t\tin.read(data);\r\n\t\t\t\t//handle packet\r\n\t\t\t\tpacketHandler.handlePacket(data);\r\n\t\t\t} catch(Exception e) {\r\n\t\t\t\tMisc.log(\"Exception in server.\");\r\n\t\t\t\tserverRunning = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//we are done and it has been requested that the server turns off\r\n\t\tcloseServer();\r\n\t\t\r\n\t\t//end of thread\r\n\t}", "void startClient(String name, Config.ClientConfig config);", "public void startServer() {\n server.start();\n }", "public void run() {\n\t\twhile (true) {\n\t\t\tSocket clientSocket = null;\n\t\t\ttry {\n\t\t\t\tclientSocket = server.accept();\n\t\t\t\tview.writeLog(\"New client connected\");\n\t\t\t\tClientThread client = new ClientThread(clientSocket, this);\n\t\t\t\t(new Thread(client)).start();\n\t\t\t} catch (IOException e) {e.printStackTrace();}\n\t\t}\n\t}", "public void initializeClient(WebSocketAdapter client) {\n\t\tServer.log.debug(\"Send initial node info to \" + client);\r\n\r\n\t\tfor (IController controller : this.controllers.values()) {\r\n\t\t\tif (controller != null && controller.isEnabled() && controller.isInitialized()) {\r\n\t\t\t\tCollection<JSONMessage> messages = controller.initClient();\r\n\t\t\t\tif (messages != null) {\r\n\t\t\t\t\tfor (JSONMessage message : messages) {\r\n\t\t\t\t\t\tclient.getRemote().sendStringByFuture(message.serialize().toString());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void onCreate() {\n Log.i(TAG, \"MinaClient create\");\r\n\r\n Thread thread = new Thread(this);\r\n thread.start();\r\n\r\n CommandHandle.getInstance().setContext(getApplicationContext());\r\n }", "private void runServer() {\n while(true) {\n // This is a blocking call and waits until a new client is connected.\n Socket clientSocket = waitForClientConnection();\n handleClientInNewThread(clientSocket);\n } \n }", "public void startClient() throws RemoteException {\n\t\t\n\t\t// object to be passed to server\n\t\tString[] details = { name, dob, country, clientServiceName, hostName };\n\n\t\t// creating server stub \n\t\ttry {\n\t\t\tNaming.rebind(\"rmi://\" + hostName + \"/\" + clientServiceName, this);\n\t\t\tIServer = (IChatServer) Naming.lookup(\"rmi://\" + hostName + \"/\" + serviceName);\n\t\t} catch (ConnectException e) {\n\t\t\tJOptionPane.showMessageDialog(chatGUI.frame, \"The server seems to be unavailable\\nPlease try later\",\n\t\t\t\t\t\"Connection problem\", JOptionPane.ERROR_MESSAGE);\n\t\t\tconnectionProblem = true;\n\t\t\te.printStackTrace();\n\t\t} catch (NotBoundException | MalformedURLException me) {\n\t\t\tconnectionProblem = true;\n\t\t\tme.printStackTrace();\n\t\t}\n\t\t// if no problem sends details object to the server to be processed\n\t\tif (!connectionProblem) {\n\t\t\tIServer.initiateRegister(details);\n\n\t\t}\n\t\t// print this if it was able to reach this point\n\t\tSystem.out.println(\"Client Listen RMI Server is running...\\n\");\n\t}", "public void start() throws IOException {\n ThreadExecutor.registerClient(this.getClass().getName());\n tcpServer.startServer();\n }", "public static void start() {\n enableIncomingMessages(true);\n }", "public void start() {\n \t\tinit();\n\t\tif(!checkBackend()){\n\t\t\tvertx.createHttpServer().requestHandler(new Handler<HttpServerRequest>() {\n\t\t\t\tpublic void handle(HttpServerRequest req) {\n\t\t\t\t String query_type = req.path();\t\t\n\t\t\t\t req.response().headers().set(\"Content-Type\", \"text/plain\");\n\t\t\t\t\n\t\t\t\t if(query_type.equals(\"/target\")){\n\t\t\t\t\t String key = req.params().get(\"targetID\");\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tprocessRequest(key,req);\n\t\t\t\t\t\t} catch (Exception e) {\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 else {\n\t\t\t\t\t String key = \"1\";\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tprocessRequestRange(key,req);\n\t\t\t\t\t\t} catch (Exception e) {\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 } \n\t\t\t}).listen(80);\n\t\t} else {\n\t\t\tSystem.out.println(\"Please make sure that both your DCI are up and running\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "protected void serverStarted()\n {\n System.out.println(\"Server listening for connections on port \" + getPort());\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\twhile (true) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tSocket socket = serverSocket.accept();\n\t\t\t\t\t\tclients.add(new Client(socket));\n\t\t\t\t\t\tSystem.out.println(\"[클라이언트 접속] \" + socket.getRemoteSocketAddress() + \": \"\n\t\t\t\t\t\t\t\t+ Thread.currentThread().getName());\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t// TODO: handle exception\n\t\t\t\t\t\tif (!serverSocket.isClosed()) {\n\t\t\t\t\t\t\tstopServer();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public void listen() {\n\t\tthread(\"NetworkClientInput\", () -> {\n\t\t\twhile (true) {\n\t\t\t\ttry {\n\t\t\t\t\tString str = in.readLine();\n\t\t\t\t\t\n\t\t\t\t\tif (str == null)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"[CLIENT] Received: \" + str);\n\t\t\t\t\ttry {\n\t\t\t\t\t\thandle(str);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tSystem.err.println(\"[Client] Error handling input\");\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tSystem.out.println(\"[Client] Disconnected.\");\n\t\t\t\t\tconnected = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tconnected = false;\n\t\t\texecutor.shutdown();\n\t\t\tsocket.close();\n\t\t});\n\t}", "public void run() {\n try {\n handler.process( client, map );\n }\n catch ( java.io.IOException ioe ) {\n System.err.println( ioe );\n }\n }", "@Override\n\tpublic void onStart() {\n\n\t\tsuper.onStart();\n\n\t\t/*\n\t\t * Connect the client. Don't re-start any requests here;\n\t\t * instead, wait for onResume()\n\t\t */\n\t\tmLocationClient.connect();\n\t}", "public void run() {\n ServerSocketChannelFactory acceptorFactory = new OioServerSocketChannelFactory();\n ServerBootstrap server = new ServerBootstrap(acceptorFactory);\n\n // The pipelines string together handlers, we set a factory to create\n // pipelines( handlers ) to handle events.\n // For Netty is using the reactor pattern to react to data coming in\n // from the open connections.\n server.setPipelineFactory(new EchoServerPipelineFactory());\n\n server.bind(new InetSocketAddress(port));\n }", "public void startServer()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tserverSocket = new ServerSocket(port);\r\n\t\t}\r\n\t\tcatch (IOException e1)\r\n\t\t{\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"Waiting for client connection.\");\r\n\r\n\t\ttry\r\n\t\t{\r\n\t\t\tSocket socket = serverSocket.accept();\r\n\t\t\tSystem.out.println(\"Client connects.\");\r\n\r\n\t\t\tObjectInputStream ois = null;\r\n\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tois = new ObjectInputStream(new BufferedInputStream(socket.getInputStream()));\r\n\t\t\t\tObject o = ois.readObject();\r\n\t\t\t\tif (!(o instanceof Message))\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new Exception(\"Received information is not message. Skip.\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tmessage = (Message) o;\r\n\t\t\t\tSystem.out.println(\"Message received: \" + message);\r\n\t\t\t}\r\n\t\t\tcatch (IOException e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tcatch (ClassNotFoundException e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\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}\r\n\t\t\tfinally\r\n\t\t\t{\r\n\t\t\t\tCloseUtil.closeAll(ois, socket, serverSocket);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (IOException e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void start() {\n\n // server 환경설정\n EventLoopGroup bossGroup = new NioEventLoopGroup(bossCount);\n EventLoopGroup workerGroup = new NioEventLoopGroup();\n\n try {\n\n ServerBootstrap b = new ServerBootstrap();\n b.group(bossGroup, workerGroup)\n .channel(NioServerSocketChannel.class)\n .childHandler(new ChannelInitializer<SocketChannel>() {\n @Override\n public void initChannel(SocketChannel ch) throws Exception {\n ChannelPipeline pipeline = ch.pipeline();\n pipeline.addLast(new StringDecoder(CharsetUtil.UTF_8));\n pipeline.addLast(new StringEncoder(CharsetUtil.UTF_8));\n pipeline.addLast(new LoggingHandler(LogLevel.INFO));\n pipeline.addLast(SERVICE_HANDLER);\n }\n })\n .option(ChannelOption.SO_BACKLOG, backLog)\n .childOption(ChannelOption.SO_KEEPALIVE, true);\n\n ChannelFuture channelFuture = b.bind(tcpPort).sync();\n channelFuture.channel().closeFuture().sync();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n bossGroup.shutdownGracefully();\n workerGroup.shutdownGracefully();\n }\n\n }", "private void startServer() throws IOException {\n while (true) {\n System.out.println(\"[1] Waiting for connection...\");\n\n client = server.accept();\n System.out.println(\"[2] Connection accepted from: \" + client.getInetAddress());\n\n in = new BufferedReader(new InputStreamReader(client.getInputStream()));\n out = new PrintStream(client.getOutputStream(), true);\n\n while (!in.ready()) ;\n\n String line = in.readLine();\n ManageConnections connection = new ManageConnectionsFactory().getConnection(line);\n\n connection.goConnect(client, in, out);\n }\n }", "protected void serverStarted()\r\n {\r\n System.out.println\r\n (\"Server listening for connections on port \" + getPort());\r\n }", "protected void serverStarted()\n {\n // System.out.println\n // (\"Server listening for connections on port \" + getPort());\n }", "public void run() {\n\t\ttry {\n\t\t\tout = new PrintWriter(client.getOutputStream(), true);\n\t\t\tin = new BufferedReader(new InputStreamReader(client.getInputStream()));\n\t\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\t\ts.getMessage(this, inputLine);\n\t\t\t\tSystem.out.println(inputLine);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Couldn't get I/O for the connection to host\");\n\t\t\tSystem.exit(-1);\n\t\t}\n\t}", "@Override\n public void start(ClientStreamListener listener) {\n listener.onReady();\n }", "@Override\n\tpublic void run() {\n\n\t\treceiveClients();\n\n\t\tbeginLogging();\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 }", "@Override\n\tpublic void run() {\n\t\trespond();\n\t\tlisten();\n\t}", "public static void main(String[] args) {\n\n try (ServerSocket ss = new ServerSocket(PORT)) {\n System.out.println(\"chat.Server is started...\");\n System.out.println(\"Server address: \" + getCurrentIP() + \":\" + PORT);\n\n while (true) {\n Socket socket = ss.accept();\n new Handler(socket).start();\n }\n\n } catch (IOException e) {\n System.out.println(\"chat.Server error.\");\n }\n }", "public void startListening() {\r\n\t\tlisten.startListening();\r\n\t}", "public static void initClient() {\n BundleEvents.register();\n }", "public void handleStart()\n {\n }", "private void runProgram() {\n\n try {\n ServerSocket ss = new ServerSocket(8088);\n Dispatcher dispatcher = new Dispatcher(allmsg,allNamedPrintwriters,clientsToBeRemoved);\n Cleanup cleanup = new Cleanup(clientsToBeRemoved,allClients);\n cleanup.start();\n dispatcher.start();\n logger.initializeLogger();\n\n while (true) {\n Socket client = ss.accept();\n InputStreamReader ir = new InputStreamReader(client.getInputStream());\n PrintWriter printWriter = new PrintWriter(client.getOutputStream(),true);\n BufferedReader br = new BufferedReader(new InputStreamReader(client.getInputStream()));\n String input = br.readLine();\n System.out.println(input);\n String name = input.substring(8);\n logger.logEventInfo(name + \" has connected to the chatserver!\");\n allClients.put(name,client);\n allNamedPrintwriters.put(name,printWriter);\n ClientHandler cl = new ClientHandler(name,br, printWriter, allmsg);\n Thread t = new Thread(cl);\n t.start();\n allmsg.add(\"ONLINE#\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void onStart() {\n\t new Thread() {\n\t @Override public void run() {\n\t receive();\n\t }\n\t }.start();\n\t }", "public void start() throws IOException{\n\t\tSystem.out.println(\"starting new chatclient with socket ID ...\"); //socketID is currently determined in chatserverthread so inaccessible\n\t\tstrOut = new DataOutputStream(new BufferedOutputStream (socket.getOutputStream()) );\n\t\tconsole = new BufferedReader(new InputStreamReader(System.in)); //sets up environment for client msgs\n\t\n\t\t//Note: Later, Rather than reading in the console, data must be retrieved consistently from the GUI\n\t\t//Try again\n\t\t\n\t\tif(thread == null){\n\t\t\tclient = new ChatClientThread(this, socket);\n\t\t\tthread = new Thread(this);\n\t\t\tthread.start();\n\t\t\t//Where should this go?\n\t\t\t//Is there another way to start a gui for each new client?\n\t\t\t//Does the run method in here interfere with the run method below?\n\t\t}\n\t\t\n\t}", "public void clientRunning() {\n\t\twhile (this.running) {\n\t\t\tString userInputString = textUI.getString(\"Please input (or type 'help'):\");\n\t\t\tthis.processUserInput(userInputString);\n\t\t}\n\t}", "public void run() {\n try {\n\n // Decorate the streams so we can send characters\n // and not just bytes.  Ensure output is flushed\n // after every newline.\n BufferedReader in = new BufferedReader(\n new InputStreamReader(socket.getInputStream()));\n PrintWriter out = new PrintWriter(socket.getOutputStream(), true);\n\n // Send a welcome message to the client.\n out.println(\"Hello, you are client #\" + clientNumber + \".\");\n out.println(\"Enter a line with only a period to quit\\n\");\n\n // Get messages from the client, line by line; return them\n // capitalized\n while (true) {\n String input = in.readLine();\n if (input == null || input.equals(\".\")) {\n break;\n }\n out.println(input.toUpperCase());\n }\n } catch (IOException e) {\n log(\"Error handling client# \" + clientNumber + \": \" + e);\n } finally {\n try {\n socket.close();\n } catch (IOException e) {\n log(\"Couldn't close a socket, what's going on?\");\n }\n log(\"Connection with client# \" + clientNumber + \" closed\");\n }\n }", "public void start() throws IOException {\n\t\tserverSocket = new ServerSocket(port);\n\t\tserverCallbacks.forEach(c -> c.onServerStarted(this, port));\n\t}", "public void run() {\n sendMessageToClient(\"Connexion au serveur réussie\");\n\n while (isActive) {\n try {\n String input = retrieveCommandFromClient();\n handleCommand(input);\n } catch (ServerException e) {\n System.out.println(e.getMessage());\n sendMessageToClient(e.getMessage());\n } catch (ClientOfflineException e) {\n System.out.println(\"Client # \" + clientId + \" deconnecte de facon innattendue\");\n deactivate();\n }\n }\n\n close();\n }", "GameHandler(ClientHandler theLeader) {\n leader = theLeader;\n leader.setHandler(this);\n leader.start();\n }", "@Override\n public void run() {\n try {\n boolean autoFlush = true;\n fromClient = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));\n toClient = new PrintWriter(clientSocket.getOutputStream(), autoFlush);\n } catch (IOException ioe) {\n throw new UncheckedIOException(ioe);\n }\n for (String entry : communicationWhenStarting) {\n sendMsg(entry);\n }\n while (connected) {\n try {\n Message msg = new Message(fromClient.readLine());\n updateClientAction(msg);\n } catch (IOException ioe) {\n disconnectClient();\n throw new MessageException(ioe);\n }\n }\n }", "@Override\n public void onInitializeClient() {\n KeyBinding keyBinding = new KeyBinding(\n \"config.advancedchat.key.openlog\",\n InputUtil.Type.KEYSYM,\n GLFW.GLFW_KEY_Y,\n \"category.advancedchat.keys\"\n );\n KeyBindingHelper.registerKeyBinding(keyBinding);\n ClientTickEvents.START_CLIENT_TICK.register(s -> {\n if (keyBinding.wasPressed()) {\n // s.openScreen(new ExampleScreen());\n open();\n }\n });\n }", "private void startServerService() {\n Intent intent = new Intent(this, MainServiceForServer.class);\n // Call bindService(..) method to bind service with UI.\n this.bindService(intent, serverServiceConnection, Context.BIND_AUTO_CREATE);\n Utils.log(\"Server Service Starting...\");\n\n //Disable Start Server Button And Enable Stop and Message Button\n messageButton.setEnabled(true);\n stopServerButton.setEnabled(true);\n startServerButton.setEnabled(false);\n\n\n }", "public synchronized void start(CertificateClient client)\n throws IOException {\n Preconditions.checkState(!isRunning());\n setCertClient(client);\n updateCurrentKey(new KeyPair(certClient.getPublicKey(),\n certClient.getPrivateKey()), certClient.getCertificate());\n client.registerNotificationReceiver(this);\n setIsRunning(true);\n }", "public void startNetworkHandler() throws ClientNetworkException {\n\t\tif (networkHandler != null) {\n\t\t\tnew Thread(networkHandler,\"NetworkHandler\").start();\n\t\t} else {\n\t\t\tthrow new ClientNetworkException(\"Error starting Networkhandler\");\n\t\t}\n\t}", "private void startServer(){\n clients = new ArrayList<ClientThread>();\n ServerSocket ClientSocket = null;\n try {\n ClientSocket = new ServerSocket(ClientPort);\n ClientSocketConnection(ClientSocket);\n } catch (IOException e){\n e.printStackTrace();\n System.exit(1);\n }\n }", "private void start(String[] args){\n\t\tServerSocket listenSocket;\n\n\t\ttry {\n\t\t\tlistenSocket = new ServerSocket(Integer.parseInt(args[0])); //port\n\t\t\tSystem.out.println(\"Server ready...\");\n\t\t\twhile (true) {\n\t\t\t\tSocket clientSocket = listenSocket.accept();\n\t\t\t\tSystem.out.println(\"Connexion from:\" + clientSocket.getInetAddress());\n\t\t\t\tClientThread ct = new ClientThread(this,clientSocket);\n\t\t\t\tct.start();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"Error in EchoServer:\" + e);\n\t\t}\n\t}", "@ReactMethod\n public void start() {\n ChirpError error = chirpConnect.start();\n if (error.getCode() > 0) {\n onError(context, error.getMessage());\n } else {\n isStarted = true;\n }\n }", "public void handleClientRequest() {\n System.out.println(\"... new ConnectionHandler constructed ...\");\n try {\n while (true) {\n // Get input data from client over socket\n String line = br.readLine();\n String[] lineArray = line.split(\" \");\n String requestType = lineArray[0];\n String resourceName = lineArray[1];\n // Log this request\n log.append(\"\\nRequest at \").append(fldt).append(\":\\n\").append(line);\n log.newLine();\n File f = new File(path + resourceName);\n String contentLength = String.valueOf(f.length());\n\n // Interpret request and respond accordingly\n if (!f.isFile()) {\n byte[] response = getHeader(404, contentLength, resourceName);\n\n os.write(response);\n // Log this response\n log.append(\"Response code:\\n404 Not Found\");\n log.newLine();\n break;\n } else if (requestType.contains(\"GET\")) {\n byte[] header = getHeader(200, contentLength, resourceName);\n byte[] content = getContent(f);\n byte[] response = new byte[header.length + content.length];\n System.arraycopy(header, 0, response, 0, header.length);\n System.arraycopy(content, 0, response, header.length, content.length);\n\n os.write(response);\n // Log this response\n log.append(\"Response code:\\n200 OK\");\n log.newLine();\n break;\n } else if (requestType.equals(\"HEAD\")) {\n byte[] response = getHeader(200, contentLength, resourceName);\n\n os.write(response);\n // Log this response\n log.append(\"Response code:\\n200 OK\");\n log.newLine();\n break;\n } else if (requestType.equals(\"DELETE\")) {\n f.delete();\n break;\n } else {\n byte[] response = getHeader(501, contentLength, resourceName);\n\n os.write(response);\n // Log this response\n log.append(\"Response code:\\n501 Not Implemented\");\n log.newLine();\n break;\n }\n }\n cleanUp();\n } catch (IOException | IndexOutOfBoundsException e) {\n System.err.println(\"ConnectionHandler:handleClientRequest (error): \" + e.getMessage());\n cleanUp();\n }\n }", "private void startClientConnection() {\r\n\t\t\t\r\n\t//\tStringBuilder sbreq = new StringBuilder();\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\t/*making connection request*/\r\n\t\t\tclientsoc = new Socket(ip,port);\r\n\t\t\t\r\n\t\t\t/*Input and output streams for data sending and receiving through client and server sockets.*/\r\n\t\t\tdis = new DataInputStream(clientsoc.getInputStream());\t\r\n\t\t\tdos = new DataOutputStream(clientsoc.getOutputStream());\r\n\t\t\t\r\n\t\t\tStringBuilder sbconnreq = new StringBuilder();\r\n\r\n\t\t\t/*Building the Http Connection Request and passing Client name as body. Thus the Http Header\r\n\t\t\tare encoded around the client name data.*/\r\n\t\t\tsbconnreq.append(\"POST /\").append(\"{\"+clientname+\"}\").append(\"/ HTTP/1.1\\r\\n\").append(host).append(\"\\r\\n\").\r\n\t\t\tappend(userAgent).append(\"\\r\\n\").append(contentType).append(\"\\r\\n\").append(contentlength).append(clientname.length()).append(\"\\r\\n\").\r\n\t\t\tappend(date).append(new Date()).append(\"\\r\\n\");\r\n\t\t\t\r\n\t\t\tdos.writeUTF(sbconnreq.toString());\r\n\r\n\t\t\totherusers = new ArrayList<>(10);\r\n\t\t\tusertimestamp = new HashMap<>(10);\r\n\t\t\tJOptionPane.showMessageDialog(null, \"You have logged in. You can start Chatting: \" + clientname);\r\n\t\t\tconnected = true;\r\n\t\t\t\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t}", "public void run() {\n\t\tString choice = null;\n\t\tBufferedReader inFromClient = null;\n\t\tDataOutputStream outToClient = null;\n\t\t\n\t\ttry {\n\t\t\tinFromClient = new BufferedReader(new InputStreamReader(client.getInputStream()));\n\t\t\toutToClient = new DataOutputStream(client.getOutputStream());\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\t// Loops until the client's connection is lost\n\t\t\twhile (true) {\t\n\t\t\t\t// Request that was sent from the client\n\t\t\t\tchoice = inFromClient.readLine();\n\t\t\t\tif(choice != null) {\n\t\t\t\t\tSystem.out.println(choice);\n\t\t\t\t\tswitch (choice) {\n\t\t\t\t\t\t// Calculates the next even fib by creating a new\n\t\t\t\t\t\t// thread to handle that calculation\n\t\t\t\t\t\tcase \"NEXTEVENFIB\":\n\t\t\t\t\t\t\tnew EvenFib(client).run();\n\t\t\t\t\t\t\t// Increments the fib index tracker so no duplicates\n\t\t\t\t\t\t\t// are sent\n\t\t\t\t\t\t\tServer.fib++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t// Calculates the next even nextLargerRan by creating a new\n\t\t\t\t\t\t// thread to handle that calculation\n\t\t\t\t\t\tcase \"NEXTLARGERRAND\":\n\t\t\t\t\t\t\tnew NextLargeRan(client).run();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t// Calculates the next prime by creating a new\n\t\t\t\t\t\t// thread to handle that calculation\n\t\t\t\t\t\tcase \"NEXTPRIME\":\n\t\t\t\t\t\t\tnew NextPrime(client).run();\n\t\t\t\t\t\t\t// Increments the prime index tracker so no duplicates\n\t\t\t\t\t\t\t// are sent\n\t\t\t\t\t\t\tServer.prime++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// Displays that the client it was connected to\n\t\t\t// has disconnected\n\t\t\tSystem.out.println(\"Client Disconnected\");\n\t\t}\n\n\t}", "@Override\n public void start(Future<Void> startFuture) {\n vertx.createHttpServer()\n .requestHandler(getRequestHandler()).listen(8080, http -> {\n if (http.succeeded()) {\n startFuture.complete();\n LOGGER.info(\"HTTP server started on http://localhost:8080\");\n } else {\n startFuture.fail(http.cause());\n }\n });\n }", "ClientHandler(Socket socket) {\n this.client = socket;\n }", "public void start(){\n runServerGUI();\n // new server thread object created\n ServerThread m_Server = new ServerThread(this);\n m_Server.start();\n }", "public void startListening() {\n\twhile (true) {\n\t try {\n\t\tSocket s = socket.accept();\n\n\t\tnew TCPSessionClient(s, this.clients);\n\t } // end of try\n\n\t catch (IOException e) {\n\t\te.printStackTrace();\n\t } // end of catch\n\t} // end of while\n }", "public synchronized void start() {\n\t\tif(isStarted) {\n\t\t\treturn;\n\t\t}\n\t\tif(isStopped) {\n\t\t\tthrow new IllegalStateException(\"Cannot restart a TorClient instance. Create a new instance instead.\");\n\t\t}\n\t\tlogger.info(\"Starting Orchid (version: \"+ Tor.getFullVersion() +\")\");\n\t\tverifyUnlimitedStrengthPolicyInstalled();\n\t\tdirectoryDownloader.start(directory);\n\t\tcircuitManager.startBuildingCircuits();\n\t\tif(dashboard.isEnabledByProperty()) {\n\t\t\tdashboard.startListening();\n\t\t}\n\t\tisStarted = true;\n\t}", "public void run() {\n\t\texecuteCommand( client, false );\n\t}", "@Override\n public void run() {\n eventLoopGroup = EPOLL ? new EpollEventLoopGroup() : new NioEventLoopGroup();\n try {\n System.out.println(startServerMsg);\n LOGGER.info(startServerMsg);\n new ServerBootstrap()\n .group(eventLoopGroup)\n .channel(EPOLL ? EpollServerSocketChannel.class : NioServerSocketChannel.class)\n .childOption(ChannelOption.TCP_NODELAY, true)\n .childOption(ChannelOption.SO_KEEPALIVE,true)\n .childOption(ChannelOption.RCVBUF_ALLOCATOR,new AdaptiveRecvByteBufAllocator(1024,16*1024,1024*1024))\n .childHandler(new ChannelInitializer() {\n @Override\n protected void initChannel(Channel ch) {\n ChannelPipeline pipeline = ch.pipeline();\n pipeline.addLast(\"decoder\", new Decoder());\n pipeline.addLast(\"handler\",new TcpServerHandler(viewModel));\n }\n })\n .bind(port).sync().channel().closeFuture().syncUninterruptibly();\n } catch (InterruptedException e) {\n LOGGER.error(\"Failed to start server : \",e);\n e.printStackTrace();\n } finally {\n System.out.println(ANSI_RED+\"Server shutting down.\"+ANSI_RESET);\n LOGGER.info(\"Server shutting down.\");\n eventLoopGroup.shutdownGracefully();\n\n }\n }", "public void initiate(TelnetClient client) {\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}", "public void run() {\n try {\n this.listener = new ServerSocket(port);\n } catch (IOException e) {\n e.printStackTrace();\n }\n \n // On new connections, start a new thread to handle communications.\n try {\n while(true) {\n new Handler(this.listener.accept()).start();\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n this.listener.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "public void startListening();", "@Override\r\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tRecieveSocketOfClient(SocketForClient);\r\n\t\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}", "@Override\n public void run() {\n handleClientRequest();\n }", "public void start() {\n this.messenger.start();\n }", "public void readFromClient() throws IOException {\n\t\tserverBuffer.writeFrom(clientChannel);\n\t\tif (serverBuffer.isReadyToRead()) {\n\t\t\tregister();\n\t\t}\n\t}", "public void start() {\n // set player number\n playerNumber = clientTUI.getInt(\"set player number (2-4):\");\n while (true) {\n try {\n game = new Game();\n game.setPlayerNumber(playerNumber - 1);\n host = this.clientTUI.getString(\"server IP address:\");\n port = this.clientTUI.getInt(\"server port number:\");\n clientName = this.clientTUI.getString(\"your name:\");\n player = clientTUI.getBoolean(\"are you human (or AI): (true/false)\") ?\n new HumanPlayer(clientName) : new ComputerPlayer(clientName);\n game.join(player);\n // initialize the game\n game.init();\n while (clientName.indexOf(' ') >= 0) {\n clientName = this.clientTUI.getString(\"re-input your name without space:\");\n }\n this.createConnection();\n this.sendJoin(clientName);\n this.handleJoin();\n if (handshake) {\n run();\n } else {\n if (!this.clientTUI.getBoolean(\"Do you want to open a new connection?\")) {\n shutdown();\n break;\n }\n }\n } catch (ServerUnavailableException e) {\n clientTUI.showMessage(\"A ServerUnavailableException error occurred: \" + e.getMessage());\n if (!clientTUI.getBoolean(\"Do you want to open a new connection?\")) {\n shutdown();\n break;\n }\n }\n }\n clientTUI.showMessage(\"Exiting...\");\n }", "public void start()\r\n\t\t{\r\n\t\tDebug.assert(serverSocket != null, \"(Server/123)\");\r\n\r\n \t// flag the server as running\r\n \tstate = RUNNING;\r\n\r\n // Loop while still listening, accepting new connections from the server socket\r\n while (state == RUNNING)\r\n \t{\r\n // Get a connection from the server socket\r\n\t\t\tSocket socket = null;\r\n\t\t\ttry {\r\n socket = serverSocket.accept();\r\n \tif (state == RUNNING) \r\n \t createLogin(socket);\r\n }\r\n \r\n // The socket timeout allows us to check if the server has been shut down.\r\n // In this case the state will not be RUNNING and the loop will end.\r\n\t\t catch ( InterruptedIOException e )\r\n\t\t \t{\r\n\t\t \t// timeout happened\r\n\t\t \t}\r\n\t\t \r\n\t\t // This shouldn't happen...\r\n \t catch ( IOException e )\r\n \t \t{\r\n log(\"Server: Error creating Socket\");\r\n \t \tDebug.printStackTrace(e);\r\n \t }\r\n\t }\r\n\t \r\n\t // We've finished, clean up\r\n disconnect();\r\n\t\t}" ]
[ "0.68783355", "0.6649693", "0.6610888", "0.6470383", "0.64076084", "0.63433594", "0.612469", "0.6119706", "0.61094415", "0.6104393", "0.6092675", "0.6089585", "0.6062007", "0.60605484", "0.6035304", "0.6026001", "0.6025731", "0.60169643", "0.59299445", "0.59121203", "0.59044826", "0.5884054", "0.5866043", "0.5854998", "0.58308786", "0.58276635", "0.5821311", "0.5803779", "0.57831013", "0.57597923", "0.5726375", "0.57258075", "0.57106155", "0.5701244", "0.56947523", "0.5694636", "0.5688526", "0.56876785", "0.56687343", "0.56665766", "0.56564736", "0.5654815", "0.5618752", "0.56162393", "0.56142575", "0.56072116", "0.56043094", "0.5591079", "0.5590964", "0.5588307", "0.558454", "0.5583263", "0.55818725", "0.5581587", "0.5558011", "0.5554874", "0.5553976", "0.55483305", "0.55298907", "0.550393", "0.5500337", "0.54912436", "0.5474096", "0.5463333", "0.5449287", "0.5447028", "0.5444302", "0.54428613", "0.5439452", "0.5433387", "0.54309905", "0.54264605", "0.54249734", "0.54161423", "0.5415566", "0.54139006", "0.5411233", "0.5405378", "0.5403379", "0.5402507", "0.5400855", "0.5391913", "0.53866416", "0.53783727", "0.53673536", "0.53607357", "0.53579724", "0.53498054", "0.5347465", "0.5347301", "0.5340467", "0.5340034", "0.5331486", "0.5328616", "0.5323941", "0.5323819", "0.53187037", "0.53088075", "0.53075767", "0.53008324", "0.52987826" ]
0.0
-1
saveAndReturnId(); updateBudgetByName(); fetchAll(); fetchProducerNameByMovieName(); fetchCount1();
public static void main(String[] args) { fetchMaxBudget(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Repository\npublic interface LoanCorporateForeignInvestment_DAO{\n @Insert(\"insert into LoanCorporateForeignInvestment(custCode,CreditCardNumber,InvesteeCompanyName,InvestmentAmount,InvestmentCurrency,OrganizationCode) \" +\n \"values (\" +\n \"#{custCode,jdbcType=VARCHAR},\" +\n \"#{CreditCardNumber,jdbcType=VARCHAR},\" +\n \"#{InvesteeCompanyName,jdbcType=VARCHAR},\" +\n \"#{InvestmentAmount,jdbcType=VARCHAR},\" +\n \"#{InvestmentCurrency,jdbcType=VARCHAR},\" +\n \"#{OrganizationCode,jdbcType=VARCHAR}\" +\n \")\")\n @ResultType(Boolean.class)\n public boolean save(LoanCorporateForeignInvestment_Entity entity);\n\n @Select(\"SELECT COUNT(*) FROM LoanCorporateForeignInvestment Where CustCode=\"+\"#{custCode,jdbcType=VARCHAR}\")\n @ResultType(Integer.class)\n Integer countAll(String custCode);\n\n @Select(\"SELECT * FROM LoanCorporateForeignInvestment Where CustCode=\"+\"#{custCode,jdbcType=VARCHAR}\"+\" Order By Id Asc\")\n @ResultType(LoanCorporateForeignInvestment_Entity.class)\n List<LoanCorporateForeignInvestment_Entity> findAll(String custCode);\n\n @Update(\"Update LoanCorporateForeignInvestment \" +\n \"SET \" +\n \"custCode=\" + \"#{custCode,jdbcType=VARCHAR},\"+\n \"CreditCardNumber=\" + \"#{CreditCardNumber,jdbcType=VARCHAR},\" +\n \"InvesteeCompanyName=\" + \"#{InvesteeCompanyName,jdbcType=VARCHAR},\" +\n \"InvestmentAmount=\" + \"#{InvestmentAmount,jdbcType=VARCHAR},\" +\n \"InvestmentCurrency= \" + \"#{InvestmentCurrency,jdbcType=VARCHAR},\" +\n \"OrganizationCode= \" + \"#{OrganizationCode,jdbcType=VARCHAR}\" +\n \"Where Id=\" + \"#{Id,jdbcType=VARCHAR}\"\n )\n @ResultType(Boolean.class)\n boolean update(LoanCorporateForeignInvestment_Entity entity);\n\n @Delete(\"DELETE FROM LoanCorporateForeignInvestment Where Id=\"+\"#{Id,jdbcType=VARCHAR}\")\n boolean delete(String Id);\n}", "FetchFirst createFetchFirst();", "@Dao\npublic interface ExpenseDao {\n\n @Query(\"SELECT * FROM expenses\")\n List<Expense> getExpenses();\n\n @Query(\"SELECT * FROM expenses WHERE id = :expenseId\")\n Expense getExpense(long expenseId);\n\n\n @Insert()\n long addExpense(Expense expense);\n\n @Update()\n void updateExpense(Expense expense);\n\n @Delete()\n void deleteExpense(Expense expense);\n\n @Insert()\n void addTwoExpenses(List<Expense> expenses);\n\n\n}", "int updateGoodsByGoodsId(Goods goods);", "public Beneficios fetchBeneficiosById(FetchByIdRequest request);", "@Repository\npublic interface FoodClassifyDao {\n\n void insert(FoodClassify foodClassify);\n\n int delete(FoodClassify foodClassify);\n\n List<FoodClassify> queryAll(String openid);\n\n int queryExistName(FoodClassify foodClassify);\n\n int queryExistId(FoodClassify foodClassify);\n\n int updatePosition(FoodClassify foodClassify);\n\n int queryMaxSort(String openid);\n\n int updateName(FoodClassify foodClassify);\n}", "Person fetchPersonById(Person person);", "public synchronized String fetchAll(String admin_segment, String economic_segment, String budget_year_id) {\n List mtssCostingsList = null;\n String jsonList = \"\";\n\n final Session session = HibernateUtil.getSessionFactory().getCurrentSession();\n Transaction tx = null;\n try {\n //final Session session = HibernateUtil.getSessionFactory().getCurrentSession();\n //session.beginTransaction();\n tx = session.beginTransaction();\n if(budget_year_id.equals(\"\")){\n budget_year_id = \"0\";\n }\n int year = Integer.parseInt(budget_year_id) - 1;\n String sql = \" SELECT a.id, (select code from Economic_Segment where code=a.economic_segment) as code, (select name from Economic_Segment where code=a.economic_segment) as name, \" +\n \" (select ISNULL(sum(budget_amount),0) from MTSS_Costing where a.admin_segment=admin_segment and a.economic_segment=economic_segment and a.programme_segment=programme_segment \" +\n \" and a.functional_segment=functional_segment and a.fund_segment=fund_segment and a.geo_segment=geo_segment and budget_year_id=2015) as amount0, \" +\n \" (select ISNULL(sum(budget_amount),0) from MTSS_Costing where a.admin_segment=admin_segment and a.economic_segment=economic_segment and a.programme_segment=programme_segment \" +\n \" and a.functional_segment=functional_segment and a.fund_segment=fund_segment and a.geo_segment=geo_segment and budget_year_id=2016) as amount1, \" +\n \" (select ISNULL(sum(budget_amount),0) from MTSS_Costing where a.admin_segment=admin_segment and a.economic_segment=economic_segment and a.programme_segment=programme_segment \" +\n \" and a.functional_segment=functional_segment and a.fund_segment=fund_segment and a.geo_segment=geo_segment and budget_year_id=2017) as amount2, \" +\n \" (select ISNULL(sum(budget_amount),0) from MTSS_Costing where a.admin_segment=admin_segment and a.economic_segment=economic_segment and a.programme_segment=programme_segment \" +\n \" and a.functional_segment=functional_segment and a.fund_segment=fund_segment and a.geo_segment=geo_segment and budget_year_id=2018) as amount3, \" +\n \" (select ISNULL(sum(budget_amount),0) from MTSS_Costing where a.admin_segment=admin_segment and a.economic_segment=economic_segment and a.programme_segment=programme_segment \" +\n \" and a.functional_segment=functional_segment and a.fund_segment=fund_segment and a.geo_segment=geo_segment and budget_year_id=2019) as amount4, \" +\n \" (select ISNULL(sum(budget_amount),0) from MTSS_Costing where a.admin_segment=admin_segment and a.economic_segment=economic_segment and a.programme_segment=programme_segment \" +\n \" and a.functional_segment=functional_segment and a.fund_segment=fund_segment and a.geo_segment=geo_segment and budget_year_id=2020) as amount5, \" +\n \" (select ISNULL(sum(budget_amount),0) from MTSS_Costing where a.admin_segment=admin_segment and a.economic_segment=economic_segment and a.programme_segment=programme_segment \" +\n \" and a.functional_segment=functional_segment and a.fund_segment=fund_segment and a.geo_segment=geo_segment and budget_year_id=2021) as amount6 \" +\n \" FROM MTSS_Costing a where a.admin_segment='\"+admin_segment+\"' and a.economic_segment like '\"+economic_segment+\"%' and a.budget_year_id=\"+(year + 1);\n\n if(economic_segment.contains(\",\")){\n sql = \" SELECT a.id, (select code from Economic_Segment where code=a.economic_segment) as code, (select name from Economic_Segment where code=a.economic_segment) as name, \" +\n \" (select ISNULL(sum(budget_amount),0) from MTSS_Costing where a.admin_segment=admin_segment and a.economic_segment=economic_segment and a.programme_segment=programme_segment \" +\n \" and a.functional_segment=functional_segment and a.fund_segment=fund_segment and a.geo_segment=geo_segment and budget_year_id=2015) as amount0, \" +\n \" (select ISNULL(sum(budget_amount),0) from MTSS_Costing where a.admin_segment=admin_segment and a.economic_segment=economic_segment and a.programme_segment=programme_segment \" +\n \" and a.functional_segment=functional_segment and a.fund_segment=fund_segment and a.geo_segment=geo_segment and budget_year_id=2016) as amount1, \" +\n \" (select ISNULL(sum(budget_amount),0) from MTSS_Costing where a.admin_segment=admin_segment and a.economic_segment=economic_segment and a.programme_segment=programme_segment \" +\n \" and a.functional_segment=functional_segment and a.fund_segment=fund_segment and a.geo_segment=geo_segment and budget_year_id=2017) as amount2, \" +\n \" (select ISNULL(sum(budget_amount),0) from MTSS_Costing where a.admin_segment=admin_segment and a.economic_segment=economic_segment and a.programme_segment=programme_segment \" +\n \" and a.functional_segment=functional_segment and a.fund_segment=fund_segment and a.geo_segment=geo_segment and budget_year_id=2018) as amount3, \" +\n \" (select ISNULL(sum(budget_amount),0) from MTSS_Costing where a.admin_segment=admin_segment and a.economic_segment=economic_segment and a.programme_segment=programme_segment \" +\n \" and a.functional_segment=functional_segment and a.fund_segment=fund_segment and a.geo_segment=geo_segment and budget_year_id=2019) as amount4, \" +\n \" (select ISNULL(sum(budget_amount),0) from MTSS_Costing where a.admin_segment=admin_segment and a.economic_segment=economic_segment and a.programme_segment=programme_segment \" +\n \" and a.functional_segment=functional_segment and a.fund_segment=fund_segment and a.geo_segment=geo_segment and budget_year_id=2020) as amount5, \" +\n \" (select ISNULL(sum(budget_amount),0) from MTSS_Costing where a.admin_segment=admin_segment and a.economic_segment=economic_segment and a.programme_segment=programme_segment \" +\n \" and a.functional_segment=functional_segment and a.fund_segment=fund_segment and a.geo_segment=geo_segment and budget_year_id=2021) as amount6 \" +\n \" FROM MTSS_Costing a where a.admin_segment='\"+admin_segment+\"' and a.economic_segment in (\"+economic_segment+\") and a.budget_year_id=\"+(year + 1);\n \n }\n \n //System.out.println(\"fetchAll sql: \"+sql);\n SQLQuery q = session.createSQLQuery(sql);\n mtssCostingsList = q.list();\n// Query q = session.createQuery(\"from MtssCosting as a where a.name<>'' order by a.name\");\n// mtssCostingsList = q.list();\n //session.getTransaction().commit();\n Gson gson = new Gson();\n jsonList = gson.toJson(mtssCostingsList);\n tx.commit();\n } catch (HibernateException e) {\n if (tx != null) {\n tx.rollback();\n }\n e.printStackTrace();\n } finally {\n //session.close();\n }\n return jsonList;\n }", "List<Customer> findAllWithFetch();", "public void crudOperationStudent(){\n //Retrieve Student\n Student student=entityManager.find(Student.class,2L);\n // persistence Context have Student\n //Retrieve Passport\n Passport passport=student.getPassport();\n // persistence Context have Student,passport\n //Update passport number for student\n passport.setPassportNo(\"ZX132322\");\n // persistence Context have Student, updated-passport\n //update Student details\n student.setAge(25);\n // persistence Context have updated-Student, updated-passport\n entityManager.persist(student);\n\n }", "public interface LeadersDao {\r\n\r\n @Select(\"select * from leaders where dept_id=#{deptId}\")\r\n List<Leaders> selectLeadersByDept(@Param(\"deptId\") Integer dept_id);\r\n \r\n @Select(\"select * from leaders where lid=#{lid}\")\r\n Leaders selectLeadersByid(@Param(\"lid\") Integer lid);\r\n\r\n @Insert(\"INSERT INTO leaders (lid,dept_id) \" +\r\n \" VALUES (#{lid},#{deptId})\")\r\n int insertLeader(@Param(\"lid\")Integer lid, @Param(\"deptId\")Integer dept_id);\r\n\r\n @Delete(\"delete from leaders where lid = #{lid}\")\r\n int deleteLeader(Integer lid);\r\n}", "@Component\npublic interface BidDao {\n\n /**\n * 通过标id查找该标的信息\n * @return\n */\n @Select(value = \"select id,userId,bidAmount,bidCurrentAmount,bidRepaymentMethod,bidRate,bidDeadline,substr(to_char(bidIssueDate,'yyyy-mm-dd hh24:mi:ss'),0,19) bidIssueDate,bidDeadDay,bidDeadDate,bidApplyDate,bidDesc,bidType from bid_info where id=#{id}\")\n Map getBidInfoById(int id);\n\n /**\n * 根据用户id查找该用户的信息\n * @param userId\n * @return\n */\n @Select(value = \"select realname,sex,address,idnumber,academic,housed,marriage,income from realname_certification where userId=#{userId}\")\n Map getBaseInfoByUserId(int userId);\n\n /**\n * 将投标信息放入到bid_submit投资记录表中\n * @param map\n * @return\n */\n @Insert(value = \"insert into bid_submit values(seq_bidinfo_id.nextval,#{bidid},#{userId},#{bidNum},#{bidRate},sysdate)\")\n int investBid(Map map);\n\n /**\n * 根据标的id来查投该标的总钱数\n * @param map\n * @return\n */\n @Select(value = \"select nvl(sum(bidAmount),0) bidAmount,nvl(sum(bidRate),0) bidRate from bid_submit where bidInfoID=#{bidid}\")\n Map findInvestMoney(Map map);\n\n /**\n * 通过当前用户查找该用户的登录信息\n * @param userId\n * @return\n */\n @Select(value = \"select username,password,telephone from user_login_info where id=#{userId}\")\n Map findUserName(int userId);\n\n /**\n * 根据标id查找该标的投资状况\n * @param id\n * @return\n */\n @Select(value = \"select b.id,b.BIDINFOID,b.BIDAMOUNT,b.BIDRATE,substr(to_char(b.BIDDATE,'yyyy-mm-dd hh24:mi:ss'),0,19) BIDDATE,u.id,u.USERNAME,u.PASSWORD,u.TELEPHONE from bid_submit b left join USER_LOGIN_INFO u on u.ID=b.USERID where b.BIDINFOID=#{id}\")\n List<Map> findInvestInfo(int id);\n\n /**\n * 通过标id找到招标人id\n * @param id\n * @return\n */\n @Select(value = \"select userId from bid_info where id=#{id}\")\n Map findBidUserId(int id);\n\n /**\n * 根据招标人的id查找该人的还款信息\n * @param bidUserId\n * @return\n */\n /*@Select(value = \"select id,bidID,bidRepayAmount,bidRepayDate,bidRepayDeadDate,bidNextRepayDate,bidNextReapyAmount,bidRepayState,bidRepayNumber,bidRepayTotPmts,bidRepayMethod,(select max(bidrepaydeaddate) from bid_repay_info where bidRepayUserID=#{bidUserId}) lastDate from bid_repay_info where bidRepayUserID=#{bidUserId}\")*/\n @Select(value = \"select id,bidID,bidRepayAmount,bidRepayDate,bidRepayDeadDate,substr(to_char(bidNextRepayDate,'yyyy-mm-dd hh24:mi:ss'),0,19) bidNextRepayDate,bidNextReapyAmount,bidRepayState,bidRepayNumber,bidRepayTotPmts,bidRepayMethod,(select substr(to_char(max(bidrepaydeaddate),'yyyy-mm-dd hh24:mi:ss'),0,19) from bid_repay_info where bidRepayUserID=#{bidUserId}) lastDate from bid_repay_info where bidRepayUserID=#{bidUserId}\")\n List<Map> findRepayByBidUserId(int bidUserId);\n\n /**\n * 根据登录人id查找用户的支付密码\n * @param userId\n * @return\n */\n @Select(value = \"select paypwd from user_info where userId=#{userId}\")\n Map getPayPwd(int userId);\n\n /**\n * 根据登录人的id查找该用户的总的待收利息,总的待收本金\n * @param userId\n * @return\n */\n @Select(value = \"select sum(bidrate) bidrate,sum(bidAmount) bidAmount from bid_submit where userId = #{userId}\")\n Map findTotalRateAndMoney(int userId);\n\n /**\n * 根据用户id查找该用户的账户信息表\n * @param userId\n * @return\n */\n @Select(value = \"select id,USERID,AVAILABLEBALANCE,RECEIVEINTEREST,RECEIVEPRINCIPAL,RETURNAMOUNT,FREEZINGAMOUNT,CREDITLINE,SURPLUSCREDITLINE,TRANSACTIONPASSWORD from user_account where userId=#{userId}\")\n Map findUserAccount(int userId);\n\n /**\n * 根据用户的投标相应的更新用户账户表\n * @param userAccountMap\n * @return\n */\n @Update(value = \"update user_account set availableBalance=#{availableBalance},receiveInterest=#{receiveInterest},receivePrincipal=#{receivePrincipal},freezingAmount=#{freezingAmount} where userId = #{userID}\")\n int updateUserAccount(Map userAccountMap);\n\n /**\n * 用户投标之后将该条信息插入到用户账户流水表中去\n * @param map\n * @return\n */\n @Insert(value = \"insert into user_account_flow values(seq_user_account_flow_id.nextval,#{userId},#{accountId},#{amount},#{availableBalance},sysdate,8)\")\n int insertUserAccountFolw(Map map);\n}", "LuckyBag selectByPrimaryKey(Integer id);", "@Writer\n int updateByPrimaryKeySelective(LuckyBag record);", "public void fetch(){ \n for(int i = 0; i < this.queries.size(); i++){\n fetch(i);\n }\n }", "public int save(SaveQuery saveQuery, EntityDetails entityDetails, ObjectWrapper<Object> idGenerated);", "@Test\r\n\tpublic void retrieveAll() {\r\n\t\tList<Opinion> opinions = IntStream.range(0, BATCH_SIZE).mapToObj(i -> {\r\n\t\t\tOpinion currentOpinion = new Opinion(\"Student B\", \"B is for batch\");\r\n\t\t\tservice.save(currentOpinion);\r\n\t\t\treturn currentOpinion;\r\n\t\t}).collect(Collectors.toList());\r\n\r\n\t\tassertEquals(service.count(), BATCH_SIZE);\r\n\r\n\t\topinions.forEach(op -> service.delete(op));\r\n\t}", "public interface SeckillDao {\n int reduceNumber(long seckillId,Date killTime);\n\n Seckill queryByID(long seckillId);\n\n List<Seckill> queryAll(int offset, int limit);\n}", "public interface ExpenseItemDAO extends GenericDAO {\r\n ExpenseItem find(long id) throws DAOException;\r\n\r\n List findByExpense(Expense expense, PageInfo pageInfo) throws DAOException;\r\n\r\n List findByCategory(ExpenseItemCategory expItemCat, PageInfo pageInfo) throws DAOException;\r\n\r\n List findByExpenseAndCategory(Expense expense, ExpenseItemCategory expItemCat,\r\n PageInfo pageInfo) throws DAOException;\r\n\r\n ExpenseItem store(ExpenseItem expItem) throws DAOException;\r\n\r\n void delete(long id) throws DAOException;\r\n\r\n}", "int updateByPrimaryKey(Dormitory record);", "public interface BannerDao {\n public int insert(Banner banner) throws Exception;\n public int modifyBanner(Banner banner) throws Exception;\n public Integer selectTotalCnt(Banner banner) throws Exception;\n public List<Banner> selectBannerList(Banner banner, PagingParam pagingParam);\n public Banner selectBanner(Banner banner);\n public Banner select(Banner banner) throws Exception;\n List<Banner> selectAllList();\n\n}", "int update(Purchase purchase) throws SQLException, DAOException;", "public void postDoRetrieve(ID id)\n {\n }", "T buidEntity(ResultSet rs) throws SQLException;", "@Dao\npublic interface MedicalCategoryDAO {\n\n\n\n @Query(\"SELECT * FROM medicalcategory\")\n List<MedicalCategory> getAll();\n\n @Query(\"SELECT COUNT(*) from medicalcategory\")\n int countcategories();\n\n\n @Insert(onConflict = OnConflictStrategy.REPLACE)\n void insertAll(MedicalCategory... medicalCategories);\n\n\n @Insert(onConflict = OnConflictStrategy.IGNORE)\n void insertsingle(MedicalCategory medicalCategory);\n\n\n}", "O obtener(PK id) throws DAOException;", "public BankThing retrieve(String id);", "void fetchForSaleHousesData();", "int updateByPrimaryKey(ResPartnerBankEntity record);", "int add(Bill bill) throws SQLException;", "int getExperiencePoints(int id) throws SQLException, DBException;", "public static List<Book> getBookDetails_2() throws HibernateException{\r\n \r\n session = sessionFactory.openSession();\r\n session.beginTransaction();\r\n \r\n Query query=session.getNamedQuery(\"INVENTORY_getAllBookList_2\");\r\n List<Book> bookList=query.list();\r\n \r\n session.getTransaction().commit();\r\n session.close();\r\n \r\n return bookList;\r\n}", "int updateByPrimaryKeySelective(DashboardGoods record);", "List<StockList> fetchAll();", "public void Deposit(double ammount){\n abal = ammount + abal;\n UpdateDB();\n }", "@Writer\n int updateByPrimaryKey(LuckyBag record);", "public interface PromulgatorService {\n\n //修改发布者信息\n int updateByPrimaryKeySelective(Promulgator record);\n\n //得到用户总点赞数\n List<Map<String,Object>> guidLikecount(String saleGuid);\n\n //根据proId查找数据\n Promulgator selectByPrimaryKey(String proId);\n\n //修改用户总点赞数\n int upLikecount(Integer likeCount,String proId);\n\n\n int insertSelective(Promulgator record);\n\n Integer selectPlikeCount(String saleGuid);\n}", "public interface RecruitmentDao {\n List<Recruitment> selects(PageRequest pageRequest);\n\n Integer selectCount(PageRequest pageRequest);\n\n Recruitment select(Long id);\n\n void delete(Long id);\n\n void insert(Recruitment recruitment);\n\n void update(Recruitment recruitment);\n}", "int updateByPrimaryKey(Dress record);", "int updateByPrimaryKey(DashboardGoods record);", "int updateByPrimaryKey(Dish record);", "int updateByPrimaryKey(Factory record);", "int updateByPrimaryKeySelective(GoodsPo record);", "public interface PreparedDishHistoryDAO {\n int addPreparedDish(PreparedDish dish);\n List<PreparedDish> getAll();\n}", "BusinessRepayment selectByPrimaryKey(String id);", "@PostConstruct\n\t@Transactional\n\tpublic void fillData() {\n\t\n\t\tBookCategory progromming1 = new BookCategory(1,\"Programming\",new ArrayList<Book>());\n\t\tBookCategory programming2 = new BookCategory(2,\"Programming\",new ArrayList<Book>());\n\t\tBookCategory programming3 = new BookCategory(3,\"Programming\",new ArrayList<Book>());\n\t\tBookCategory programming4 = new BookCategory(4,\"Programming\",new ArrayList<Book>());\n\t\tBookCategory programming5 = new BookCategory(5,\"Programming\",new ArrayList<Book>());\n\t\tBookCategory programming6 = new BookCategory(6,\"Programming\",new ArrayList<Book>());\n\t\tBookCategory programming7 = new BookCategory(7,\"Programming\",new ArrayList<Book>());\n\t\tBookCategory programming8 = new BookCategory(8,\"Programming\",new ArrayList<Book>());\n\t\tBookCategory programming9 = new BookCategory(9,\"Programming\",new ArrayList<Book>());\n\t\tBookCategory programming10 = new BookCategory(10,\"Programming\",new ArrayList<Book>());\n\t\t\n\n\t\t\n\t\tbookCategoryRepository.save(progromming1);\n\t\tbookCategoryRepository.save(programming2);\n\t\tbookCategoryRepository.save(programming3);\n\t\tbookCategoryRepository.save(programming4);\n\t\tbookCategoryRepository.save(programming5);\n\t\tbookCategoryRepository.save(programming6);\n\t\tbookCategoryRepository.save(programming7);\n\t\tbookCategoryRepository.save(programming8);\n\t\tbookCategoryRepository.save(programming9);\n\t\tbookCategoryRepository.save(programming10);\n\t\t\n\t\tBook java = new Book(\n\t\t\t\t(long) 1,\"text-100\",\"Java Programming Language\",\n\t\t\t\t \"Master Core Java basics\",\n\t\t\t\t 754,\n\t\t\t\t \"assets/images/books/text-106.jpg\",\n\t\t\t\t true, 300,LocalDateTime.now(), null,\tprogromming1\n\t\t);\n\t\tBook kotlin = new Book(\n\t\t\t\t(long) 2,\"text-101\",\"Kotlin Programming Language\",\n\t\t\t\t \"Learn Kotlin Programming Language\",\n\t\t\t\t 829,\n\t\t\t\t \"assets/images/books/text-102.jpg\",\n\t\t\t\t true, 300,LocalDateTime.now(), null,\tprogramming2\n\t\t);\n\t\tBook python = new Book(\n\t\t\t\t(long) 3,\"text-102\",\"Python 9\",\n\t\t\t\t \"Learn Python Language\",\n\t\t\t\t 240,\n\t\t\t\t \"assets/images/books/text-103.jpg\",\n\t\t\t\t true, 300,LocalDateTime.now(), null,\tprogramming3\n\t\t);\n\t\tBook cShap = new Book(\n\t\t\t\t(long) 4,\"text-103\",\"C#\",\n\t\t\t\t \"Learn C# Programming Language\",\n\t\t\t\t 490,\n\t\t\t\t \"assets/images/books/text-101.jpg\",\n\t\t\t\t true, 300,LocalDateTime.now(), null,\tprogramming4\n\t\t);\n\t\tBook cpp = new Book(\n\t\t\t\t(long) 5,\"text-104\",\"C++\",\n\t\t\t\t \"Learn C++ Language\",\n\t\t\t\t 830,\n\t\t\t\t \"assets/images/books/text-110.jpg\",\n\t\t\t\t true, 300,LocalDateTime.now(), null,\tprogramming5\n\t\t);\n\t\tBook dataStru = new Book(\n\t\t\t\t(long) 6,\"text-105\",\"Data Structure 3\",\n\t\t\t\t \"Learn Data Structures\",\n\t\t\t\t 560,\n\t\t\t\t \"assets/images/books/text-106.jpg\",\n\t\t\t\t true, 300,LocalDateTime.now(), null,\tprogramming6\n\t\t);\n\t\tBook cprog = new Book(\n\t\t\t\t(long) 7,\"text-106\",\"C Programming\",\n\t\t\t\t \"Learn C Language\",\n\t\t\t\t 695,\n\t\t\t\t \"assets/images/books/text-100.jpg\",\n\t\t\t\t true, 300,LocalDateTime.now(), null,\tprogramming7\n\t\t);\n\t\tBook crushInterview = new Book(\n\t\t\t\t(long) 3,\"text-102\",\"Coding Interview\",\n\t\t\t\t \"Crushing the Coding interview\",\n\t\t\t\t 600,\n\t\t\t\t \"assets/images/books/text-103.jpg\",\n\t\t\t\t true, 300,LocalDateTime.now(), null,\tprogramming8\n\t\t);\n\t\tBook desing = new Book(\n\t\t\t\t(long) 859,\"text-102\",\"Design Parttens\",\n\t\t\t\t \"Learn Python Language\",\n\t\t\t\t 690,\n\t\t\t\t \"assets/images/books/text-105.jpg\",\n\t\t\t\t true, 300,LocalDateTime.now(), null,\tprogramming9\n\t\t);\n\t\tBook machineLearn = new Book(\n\t\t\t\t(long) 9,\"text-102\",\"Python 3\",\n\t\t\t\t \"Learn Python Machine Learning with Python\",\n\t\t\t\t 416,\n\t\t\t\t \"assets/images/books/text-107.jpg\",\n\t\t\t\t true, 300,LocalDateTime.now(), null,\tprogramming10\n\t\t);\n\t\tBook apiJava = new Book(\n\t\t\t\t(long) 10,\"text-102\",\"Practical API Design\",\n\t\t\t\t \"Java Framework Architect\",\n\t\t\t\t 540,\n\t\t\t\t \"assets/images/books/text-108.jpg\",\n\t\t\t\t true, 300,LocalDateTime.now(), null,\tprogramming8\n\t\t);\n\tbookRepository.save(java);\n\tbookRepository.save(kotlin);\n\tbookRepository.save(python);\n\tbookRepository.save(cpp);\n\tbookRepository.save(cprog);\n\tbookRepository.save(crushInterview);\n\tbookRepository.save(cShap);\n\tbookRepository.save(dataStru);\n\tbookRepository.save(desing);\n\tbookRepository.save(machineLearn);\n\tbookRepository.save(apiJava);\n\n\t}", "int updateByPrimaryKeySelective(Goods record);", "int updateByPrimaryKeySelective(Goods record);", "int updateByPrimaryKey(Goods record);", "int updateByPrimaryKey(Goods record);", "int insertSelective(DashboardGoods record);", "public interface ResourceDAO {\n //通过资源信息获取id\n @Select(\" SELECT r.resourceId \" +\n \" FROM btl_resource r \" +\n \" WHERE r.resourceURL = #{resourceURL} \" +\n \" AND r.resourceMethodType = #{resourceMethodType} \" +\n \" AND r.systemId = #{systemId} \")\n public List<Long> findIdByResourceInfo(@Param(\"resourceURL\") String resourceURL,\n @Param(\"resourceMethodType\") int resourceMethodType,\n @Param(\"systemId\") int systemId) ;\n\n //通过资源信息和可用性获取可用id\n @Select(\" SELECT r.resourceId \" +\n \" FROM btl_resource r \" +\n \" WHERE r.resourceURL = #{resourceURL} \" +\n \" AND r.resourceMethodType = #{resourceMethodType} \" +\n \" AND r.systemId = #{systemId} \" +\n \" AND r.state = #{state} \")\n public List<Long> findIdByResourceInfoAndState(@Param(\"resourceURL\") String resourceURL,\n @Param(\"resourceMethodType\") int resourceMethodType,\n @Param(\"systemId\") int systemId,\n @Param(\"state\") int state) ;\n\n //通过ids获取资源记录\n @Select({\"<script>\" ,\n \" SELECT * \",\n \" FROM btl_resource r \",\n \" WHERE r.resourceId IN \",\n \"<foreach item='id' index='index' collection='ids' open='(' separator=',' close=')'>\",\n \"#{id}\",\n \"</foreach>\",\n \"</script>\"})\n public List<ResourceRecord> findByIds(@Param(\"ids\") List<Long> ids) ;\n\n //通过ids获取可用的资源记录\n @Select({\"<script>\" ,\n \" SELECT * \",\n \" FROM btl_resource r \",\n \" WHERE r.state = #{state} \",\n \" AND r.resourceId IN \",\n \"<foreach item='id' index='index' collection='ids' open='(' separator=',' close=')'>\",\n \"#{id}\",\n \"</foreach>\",\n \"</script>\"})\n public List<ResourceRecord> findByIdsAndState(@Param(\"ids\") List<Long> ids , @Param(\"state\") int state) ;\n\n //通过ids获取资源信息\n @Select({\"<script>\" ,\n \" SELECT r.resourceId , r.resourceURL , r.resourceMethodType , r.systemId \",\n \" FROM btl_resource r \",\n \" WHERE r.resourceId IN \",\n \"<foreach item='id' index='index' collection='ids' open='(' separator=',' close=')'>\",\n \"#{id}\",\n \"</foreach>\",\n \"</script>\"})\n public List<ResourceRecord> findIdsWithResourceInfosByIds(@Param(\"ids\") List<Long> ids) ;\n\n //通过ids获取资源名称\n @Select({\"<script>\" ,\n \" SELECT r.resourceId , r.resourceName \",\n \" FROM btl_resource r \",\n \" WHERE r.resourceId IN \",\n \"<foreach item='id' index='index' collection='ids' open='(' separator=',' close=')'>\",\n \"#{id}\",\n \"</foreach>\",\n \"</script>\"})\n public List<ResourceRecord> findIdsWithResourceNameByIds(@Param(\"ids\") List<Long> ids) ;\n\n //通过ids获取资源可用信息\n @Select({\"<script>\" ,\n \" SELECT r.resourceId , r.state \",\n \" FROM btl_resource r \",\n \" WHERE r.resourceId IN \",\n \"<foreach item='id' index='index' collection='ids' open='(' separator=',' close=')'>\",\n \"#{id}\",\n \"</foreach>\",\n \"</script>\"})\n public List<ResourceRecord> findIdsWithStateByIds(@Param(\"ids\") List<Long> ids) ;\n\n\n //获取所有处于某种状态下的资源信息\n @Select(\" SELECT r.resourceId , r.resourceURL , r.resourceMethodType , r.systemId \" +\n \" FROM btl_resource r \" +\n \" WHERE r.state = #{state} \")\n public List<ResourceRecord> findIdsWithResourceInfoByState(@Param(\"state\") int state) ;\n\n //通过名字获取资源记录(分页)\n @Select(\" SELECT * \" +\n \" FROM btl_resource r \" +\n \" WHERE r.resourceName LIKE CONCAT('%' , #{name} , '%') \" +\n \" LIMIT ${skip},${size} \")\n public List<ResourceRecord> findByNameInPage(@Param(\"name\") String name,\n @Param(\"skip\") int skip,\n @Param(\"size\") int size);\n //通过名字获取资源数\n @Select(\" SELECT count(1) \" +\n \" FROM btl_resource r \" +\n \" WHERE r.resourceName LIKE CONCAT('%' , #{name} , '%') \")\n long getCountByName(@Param(\"name\") String name);\n\n\n //获取资源树信息\n @Select(\"SELECT r.resourceId , r.resourceName , r.parentId , r.state FROM btl_resource r\")\n public List<ResourceRecord> findAllRoleIdsWithRoleNameAndParentIdAndState() ;\n\n //添加资源\n @Insert(\" INSERT IGNORE INTO btl_resource(createTime , resourceCode , resourceName , resourceURL , resourceMethodType , systemId , state , parentId , resourceMemo) \" +\n \" VALUES(now() , #{re.resourceCode} , #{re.resourceName} , #{re.resourceURL} , #{re.resourceMethodType} , #{re.systemId} , #{re.state} , #{re.parentId} , #{re.resourceMemo}) \")\n public int insertResource(@Param(\"re\") ResourceRecord re);\n\n //删除资源\n @Delete(\"DELETE FROM btl_resource WHERE resourceId=#{resourceId}\")\n public int deleteById(@Param(\"resourceId\") long resourceId);\n\n //更新资源\n @Update(\"UPDATE btl_resource SET \" +\n \" resourceCode = #{re.resourceCode} , \" +\n \" resourceName = #{re.resourceName} , \" +\n \" resourceURL = #{re.resourceURL} , \" +\n \" resourceMethodType = #{re.resourceMethodType} , \" +\n \" systemId = #{re.systemId} , \" +\n \" state = #{re.state} , \" +\n \" parentId = #{re.parentId} , \" +\n \" resourceMemo = #{re.resourceMemo} \" +\n \" WHERE resourceId = #{re.resourceId}\")\n public int updateResource(@Param(\"re\") ResourceRecord re);\n\n}", "public interface SuccessKilledDao {\n //插入购买明细,可以过滤重复 return为插入的行数\n int insertSuccessKilled(@Param(\"secKillId\") long secKillId,@Param(\"userPhone\") long userPhone);\n //根据id查询SucceessKilled并携带秒杀产品对象实体\n SuccessKilled queryByIdWithSeckill(@Param(\"seckillId\") long seckillId, @Param(\"userPhone\") long userPhone);\n}", "public Student findById(int theStudent_id);", "List<InvoiceDTO> fetchAll();", "@Dao\npublic interface BillDOA {\n @Query(\"SELECT * FROM BillsPaybale\")\n Maybe<List<BillsPaybale>> getAll();\n\n @Query(\"SELECT * FROM BillsPaybale WHERE BILLREF IN (:userIds)\")\n Flowable<List<BillsPaybale>> loadAllByIds(int[] userIds);\n\n\n @Query(\"SELECT * FROM BillsPaybale where BILLREF = :id\")\n Maybe<BillsPaybale> findById(int id);\n\n\n @Insert\n void insertAll(BillsPaybale... users);\n\n @Delete\n void delete(BillsPaybale user);\n\n @Update\n public void updateUsers(BillsPaybale... users);\n}", "@Repository\npublic interface MainItemOrderedRepository extends CrudRepository<MainItemOrdered, Long> {\n\n /**\n * Run query like Select * from...\n *\n * @return List of ordered main item\n */\n public List<MainItemOrdered> findAll();\n\n /**\n * Run query like insert into ...\n *\n * @param mainItemOrdered Main item ordered\n * @return Ordered main item saved\n */\n public MainItemOrdered save(MainItemOrdered mainItemOrdered);\n\n /**\n * Run query like Delete from ...\n *\n * @param mainItemOrdered Oredered main item to delete\n */\n public void delete(MainItemOrdered mainItemOrdered);\n}", "int updateByPrimaryKey(Collect record);", "public interface IDbProvider {\n DaoSession getSession();\n\n List<Category> getCategoryList();\n\n List<Spending> getSpendingsList(Category category);\n\n void addCategory(Category category) throws CategoryNameExistsException;\n\n void addSpending(Spending spending);\n\n void editSpending(Spending item, float value, String title, Date dateGiven);\n\n void deleteSpending(Spending spending);\n\n float getSum(Date dateFrom, Date dateThrough);\n}", "@DBRepository\npublic interface ArticleDao {\n\n void save(Article article);\n\n void update(Article article);\n\n void incrReadTime(@Param(\"id\") int id);\n\n Article findById(@Param(\"id\") int id);\n\n List<Article> getPage(PageQuery page);\n\n int count();\n}", "Promo selectByPrimaryKey(Integer id);", "@Dao\npublic interface BookDao {\n @Insert(onConflict = OnConflictStrategy.REPLACE)\n void insertData(BookModel bookmodel);\n\n @Query(\"select * from booktable\")\n BookModel[] selectAllData();\n\n //fungsi update book\n @Update\n int updateBook(BookModel bookModel);\n\n //fungsi delete\n @Delete\n int deleteBook(BookModel bookModel);\n\n //fungsi get detailbyID\n @Query(\"select * from booktable WHERE bookId = :id Limit 1\")\n BookModel detailbyId(int id);\n}", "int updateByPrimaryKey(GoodsPo record);", "public abstract void fetch();", "@Repository(\"LostmessDAO\")\npublic interface LostmessDAO {\n public Lostmess selectLostmessFromId(int id);\n\n public int selectLostmessCount(Lostmess lostmess);\n\n public List<Lostmess> selectLostmess(Lostmess lostmess, int start, int size);\n\n public int insertLostmess(Lostmess lostmess);\n\n public int deleteLostmess(int id);\n\n public int updateLostmess(Lostmess lostmess);\n\n}", "@Repository\npublic interface AutoIncrementMapper {\n int insertData(AutoIncrementEntity autoIncrementEntity) throws Exception;\n AutoIncrementEntity selectData(Long id) throws Exception;\n int deleteData(Long id) throws Exception;\n int updateData(AutoIncrementEntity autoIncrementEntity) throws Exception;\n}", "public void saveBorrowings() {\n\t}", "int updateByPrimaryKey(BusinessRepayment record);", "int updateByPrimaryKey(SupplyNeed record);", "int updateByPrimaryKeySelective(Dish record);", "int updateByPrimaryKey(FinancialManagement record);", "public void addtorepository() {\n ClientModel widget = new ClientModel();\n widget.setAddress(\"123 Fake Street\");\n widget.setCurrentInvoice(10000);\n widget.setName(\"Widget Inc\");\n clientrepository.save(widget);\n //next client\n ClientModel foo = new ClientModel();\n foo.setAddress(\"456 Attorney Drive\");\n foo.setCurrentInvoice(20000);\n foo.setName(\"Foo LLP\");\n clientrepository.save(foo);\n //next client\n ClientModel bar = new ClientModel();\n bar.setAddress(\"111 Bar Street\");\n bar.setCurrentInvoice(30000);\n bar.setName(\"Bar and Food\");\n clientrepository.save(bar);\n //next client\n ClientModel dog = new ClientModel();\n dog.setAddress(\"222 Dog Drive\");\n dog.setCurrentInvoice(40000);\n dog.setName(\"Dog Food and Accessories\");\n clientrepository.save(dog);\n //next client\n ClientModel cat = new ClientModel();\n cat.setAddress(\"333 Cat Court\");\n cat.setCurrentInvoice(50000);\n cat.setName(\"Cat Food\");\n clientrepository.save(cat);\n //next client\n ClientModel hat = new ClientModel();\n hat.setAddress(\"444 Hat Drive\");\n hat.setCurrentInvoice(60000);\n hat.setName(\"The Hat Shop\");\n clientrepository.save(hat);\n //next client\n ClientModel hatB = new ClientModel();\n hatB.setAddress(\"445 Hat Drive\");\n hatB.setCurrentInvoice(60000);\n hatB.setName(\"The Hat Shop B\");\n clientrepository.save(hatB);\n //next client\n ClientModel hatC = new ClientModel();\n hatC.setAddress(\"446 Hat Drive\");\n hatC.setCurrentInvoice(60000);\n hatC.setName(\"The Hat Shop C\");\n clientrepository.save(hatC);\n //next client\n ClientModel hatD = new ClientModel();\n hatD.setAddress(\"446 Hat Drive\");\n hatD.setCurrentInvoice(60000);\n hatD.setName(\"The Hat Shop D\");\n clientrepository.save(hatD);\n //next client\n ClientModel hatE = new ClientModel();\n hatE.setAddress(\"447 Hat Drive\");\n hatE.setCurrentInvoice(60000);\n hatE.setName(\"The Hat Shop E\");\n clientrepository.save(hatE);\n //next client\n ClientModel hatF = new ClientModel();\n hatF.setAddress(\"448 Hat Drive\");\n hatF.setCurrentInvoice(60000);\n hatF.setName(\"The Hat Shop F\");\n clientrepository.save(hatF);\n }", "public interface FundRepository extends JpaRepository<Fund,String> ,JpaSpecificationExecutor<Fund> {\n Fund findByCustomerId(Integer customerId);\n \n @Modifying\n @Query(\"update t_fund set BALANCE = :balance where CUSTOMER_ID = :customerId\")\n\tvoid updateFund(@Param(\"balance\")BigDecimal balance,@Param(\"customerId\")Integer customerId);\n\n @Modifying\n @Query(\"update t_fund set BALANCE = :balance,COMMISSION = :commission where CUSTOMER_ID = :customerId\")\n\tvoid updateCommission(@Param(\"balance\")BigDecimal balance,@Param(\"commission\")BigDecimal commission,@Param(\"customerId\")Integer customerId);\n}", "Dormitory selectByPrimaryKey(Integer id);", "int updateByPrimaryKeySelective(Dress record);", "public CustomerModel findById(int id) throws Exception {\n String sql = \"SELECT * FROM customer WHERE ID = ?\";\n CustomerModel customer = null;\n \n try {\n \n log.info(\"Loading MySql driver\");\n Class.forName(\"com.mysql.jdbc.Driver\");\n\n log.info(\"Setting up connection with db\");\n connect= DriverManager.getConnection(\"jdbc:mysql://localhost:3306/apidft\",\"root\",\"cisco\");\n\n PreparedStatement stmt = connect.prepareStatement(sql);\n stmt.setInt(1, id);\n ResultSet rs = stmt.executeQuery();\n if (rs.next()) {\n customer = processRow(rs);\n }\n \n } catch (Exception e) {\n e.printStackTrace();\n throw new RuntimeException(e);\n} finally {\nconnect.close();\n}\n return customer;\n }", "FinancialManagement selectByPrimaryKey(Integer fId);", "public void getSavedRecord(MealVoucherConfiguration mealVoucher) {\n\r\n\t\tString query = \" SELECT MEAL_CONFIG_CASH, MEAL_CONFIG_FREQUENCY, MEAL_CONFIG_COUPEN, MEAL_CONFIG_DEBIT \"\r\n\t\t\t\t+ \" ,CASH.CREDIT_NAME,COUPEN.CREDIT_NAME,DEBIT_NAME , \" +\r\n\t\t\t\t\" MEAL_CONFIG_FROM, MEAL_CONFIG_TO, MEAL_CONFIG_AMT_LIMIT, MEAL_CONFIG_AMT_DECLARE, MEAL_FROM_PERIOD, MEAL_TO_PERIOD \"\r\n\t\t\t\t+ \" FROM HRMS_MEAL_VOUCHER_CONFIG \"\r\n\t\t\t\t+ \" INNER JOIN HRMS_CREDIT_HEAD CASH ON(CASH.CREDIT_CODE=HRMS_MEAL_VOUCHER_CONFIG.MEAL_CONFIG_CASH) \"\r\n\t\t\t\t+ \" INNER JOIN HRMS_CREDIT_HEAD COUPEN ON(COUPEN.CREDIT_CODE=HRMS_MEAL_VOUCHER_CONFIG.MEAL_CONFIG_COUPEN) \"\r\n\t\t\t\t+ \" INNER JOIN HRMS_DEBIT_HEAD ON(HRMS_DEBIT_HEAD.DEBIT_CODE=HRMS_MEAL_VOUCHER_CONFIG.MEAL_CONFIG_DEBIT) \";\r\n\r\n\t\tObject dataObj[][] = getSqlModel().getSingleResult(query);\r\n\r\n\t\tif (dataObj != null && dataObj.length > 0) {\r\n\t\t\t\r\n\t\t\tmealVoucher.setCreditCode(String.valueOf(dataObj[0][0]));\r\n\t\t\tmealVoucher.setFreqencyOfChange(String.valueOf(dataObj[0][1]));\r\n\t\t\tmealVoucher.setCoupenCode(String.valueOf(dataObj[0][2]));\r\n\t\t\tmealVoucher.setDebitCode(String.valueOf(dataObj[0][3]));\r\n\t\t\tmealVoucher.setCreditHead(String.valueOf(dataObj[0][4]));\r\n\t\t\tmealVoucher.setCoupenHead(String.valueOf(dataObj[0][5]));\r\n\t\t\tmealVoucher.setDebitHead(String.valueOf(dataObj[0][6]));\r\n\t\t\t\r\n\t\t\tmealVoucher.setFromYear(String.valueOf(dataObj[0][7]));\r\n\t\t\tmealVoucher.setToYear(String.valueOf(dataObj[0][8]));\r\n\t\t\tmealVoucher.setMealVoucherAmtLimit(String.valueOf(dataObj[0][9]));\r\n\t\t\tmealVoucher.setMealVoucherAmtDeclare(String.valueOf(dataObj[0][10]));\r\n\t\t\tmealVoucher.setFromPeriod(checkNull(String.valueOf(dataObj[0][11])));\r\n\t\t\tmealVoucher.setToPeriod(checkNull(String.valueOf(dataObj[0][12])));\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\r\n\t}", "public synchronized String fetchAllProgrammes(String admin_segment, String economic_segment, String budget_year_id) {\n List mtssCostingsList = null;\n String jsonList = \"\";\n\n final Session session = HibernateUtil.getSessionFactory().getCurrentSession();\n Transaction tx = null;\n try {\n //final Session session = HibernateUtil.getSessionFactory().getCurrentSession();\n //session.beginTransaction();\n tx = session.beginTransaction();\n if(budget_year_id.equals(\"\")){\n budget_year_id = \"0\";\n }\n int year = Integer.parseInt(budget_year_id) - 1;\n String sql = \" SELECT max(id), concat(policy,programme,code,objective) as code, name, 0 as amt0, 0 as amt1, 0 as amt2, 0 as amt3, 0 as amt4, 0 as amt5, 0 as amt6, (select d.year from budget_years d where d.id=year_id) as year_id, rank FROM Project_Detail \" +\n \" where project_status=1 and mda in (select id from mdas where administrative_Segment='\"+admin_segment+\"') group by policy,programme,code,objective, name, year_id, rank\" + \n \" UNION SELECT (select b.id from MTSS_Costing b where b.admin_segment='\"+admin_segment+\"' and b.programme_segment=a.programme_segment and b.economic_segment like '\"+economic_segment+\"%' and b.budget_year_id=\"+(year + 1)+\") as id, \" +\n \" a.programme_segment as code, (select name from Project_Detail where project_code=substring(a.programme_segment,1,12)) as name, \" +\n \" (select ISNULL(sum(b.budget_amount),0) from MTSS_Costing b where b.admin_segment='\"+admin_segment+\"' and b.programme_segment=a.programme_segment and b.economic_segment like '\"+economic_segment+\"%' and b.budget_year_id=\"+(year - 3)+\") as amount0, \" +\n \" (select ISNULL(sum(b.budget_amount),0) from MTSS_Costing b where b.admin_segment='\"+admin_segment+\"' and b.programme_segment=a.programme_segment and b.economic_segment like '\"+economic_segment+\"%' and b.budget_year_id=\"+(year - 2)+\") as amount1, \" +\n \" (select ISNULL(sum(b.budget_amount),0) from MTSS_Costing b where b.admin_segment='\"+admin_segment+\"' and b.programme_segment=a.programme_segment and b.economic_segment like '\"+economic_segment+\"%' and b.budget_year_id=\"+(year - 1)+\") as amount2, \" +\n \" (select ISNULL(sum(b.budget_amount),0) from MTSS_Costing b where b.admin_segment='\"+admin_segment+\"' and b.programme_segment=a.programme_segment and b.economic_segment like '\"+economic_segment+\"%' and b.budget_year_id=\"+(year)+\") as amount3, \" +\n \" (select ISNULL(sum(b.budget_amount),0) from MTSS_Costing b where b.admin_segment='\"+admin_segment+\"' and b.programme_segment=a.programme_segment and b.economic_segment like '\"+economic_segment+\"%' and b.budget_year_id=\"+(year + 1)+\") as amount4, \" +\n \" (select ISNULL(sum(b.budget_amount),0) from MTSS_Costing b where b.admin_segment='\"+admin_segment+\"' and b.programme_segment=a.programme_segment and b.economic_segment like '\"+economic_segment+\"%' and b.budget_year_id=\"+(year + 2)+\") as amount5, \" +\n \" (select ISNULL(sum(b.budget_amount),0) from MTSS_Costing b where b.admin_segment='\"+admin_segment+\"' and b.programme_segment=a.programme_segment and b.economic_segment like '\"+economic_segment+\"%' and b.budget_year_id=\"+(year + 3)+\") as amount6, \" +\n \" (select year from budget_years where id=(select year_id from Project_Detail where project_code=substring(a.programme_segment,1,12))) as year_id, 100 as rank \" +\n \" FROM MTSS_Costing a where a.admin_segment='\"+admin_segment+\"' and a.economic_segment like '\"+economic_segment+\"%' \" +\n \" group by a.admin_segment,a.programme_segment,a.economic_segment order by year_id, code, rank \";\n//System.out.println(\"fetchAllProgrammes sql: \"+sql);\n SQLQuery q = session.createSQLQuery(sql);\n mtssCostingsList = q.list();\n// Query q = session.createQuery(\"from MtssCosting as a where a.name<>'' order by a.name\");\n// mtssCostingsList = q.list();\n //session.getTransaction().commit();\n Gson gson = new Gson();\n jsonList = gson.toJson(mtssCostingsList);\n tx.commit();\n } catch (HibernateException e) {\n if (tx != null) {\n tx.rollback();\n }\n e.printStackTrace();\n } finally {\n //session.close();\n }\n return jsonList;\n }", "InvoiceDTO fetchByID(int id);", "public static void main( String[] args )\n {\n \tSessionFactory sf = HibernateSessionFactoryUtil.getSessionFactory(); \n \tSession session1 = sf.openSession();\n \t\n \t// insertTestData(session1);\n \t\n \tsession1.beginTransaction();\n \t\n \t\n \tSystem.out.println(\"List of objects\\n\");\n \tQuery query1 = session1.createQuery(\"from Student s where s.rollno>45\");\n \tList<Student> students= query1.list();\n \t\n \tfor(Student s: students) {\n \t\tSystem.out.println(s);\n \t}\n \t\n \tSystem.out.println(\"\\n*****************\\n\");\n \t\n \tint rollno = 7;\n \t\n \tSystem.out.println(\"Single object via explicit parameter\\n\");\n \tQuery query2 = session1.createQuery(\"from Student where rollno=:param\");\n \tquery2.setParameter(\"param\", rollno);\n \tStudent student1 = (Student) query2.uniqueResult();\n \tSystem.out.println(student1);\n \t\n \tSystem.out.println(\"\\n*****************\\n\");\n \t\n \tSystem.out.println(\"Single object with certain columns\\\\n\");\n \t\n \tQuery query3 = session1.createQuery(\"Select rollno, name from Student where rollno=7\");\n \tObject[] student2 = (Object[]) query3.uniqueResult();\n \tSystem.out.println(student2[0] + \" - \" + student2[1]);\n \t\n \tSystem.out.println(\"\\n*****************\\n\");\n \t\n \tSystem.out.println(\"Returns results of adding data (summation)\\n\");\n \t\n \tQuery query4 = session1.createQuery(\"Select sum(marks) from Student\");\n \tLong sumOfMarks = (Long) query4.uniqueResult();\n \tSystem.out.println(\"sumOfMarks: \" + sumOfMarks);\n \t\n \tSystem.out.println(\"\\n*****************\\n\");\n \t\n \t\n \tSystem.out.println(\"Returns results by using original SQL\\n\");\n \t\n \tSQLQuery query5 = session1.createSQLQuery(\"SELECT * FROM student WHERE marks>60\");\n \tquery5.addEntity(Student.class);\n \tList<Student> students2 = query5.getResultList();\n \t\n \tfor(Student s1: students2) {\n \t\tSystem.out.println(s1);\n \t}\n \t\n \tSystem.out.println(\"\\n*****************\\n\");\n \t\n \tSystem.out.println(\"Return results by using original SQL/Native Query\\n\");\n \t\n \tNativeQuery query6 = session1.createSQLQuery(\"SELECT rollno, name FROM student WHERE marks>60\");\n \tquery6.setResultTransformer(Criteria.ALIAS_TO_ENTITY_MAP);\n \tList<?> students3 = query6.list();\n \t\n \tfor(Object s1: students3) {\n \t\tMap<?, ?> m1 = (Map) s1;\n \t\tSystem.out.println(m1.get(\"name\") + \" : \" + m1.get(\"rollno\"));\n \t}\n \t\n \tSystem.out.println(\"\\n*****************\\n\");\n \t\n \tsession1.getTransaction().commit();\n }", "public void okButtonAction(ActionEvent actionEvent){\n\n\n System.out.println(\"okkkkkk\");\n querySpecial=null;\n\n PersistenceUtil pu= PersistenceUtil.getInstance();\n EntityManagerFactory emf =pu.getEmf();\n EntityManager em = emf.createEntityManager();\n\n ArtistRepository ar= ArtistRepository.getInstance();\n\n\n if(textField1.getText()!=null)\n {\n System.out.println(textField1.getText());\n resultArtist=ar.findById(Integer.parseInt(textField1.getText()));\n System.out.println(resultArtist.get().getName());\n writeTable();\n }\n\n\n }", "private static final String FIND_BY_PK(boolean fetchDewars) {\r\n\t\treturn \"from Shipping3VO vo \" + (fetchDewars ? \"left join fetch vo.dewarVOs \" : \"\")\r\n\t\t\t\t+ \"where vo.shippingId = :pk\";\r\n\r\n\t}", "int updateByPrimaryKeySelective(PracticeClass record);", "public interface RewardDAO {\n\n List<Reward> listReward(Page page);\n void addReward(Reward reward);\n void updateReward(Reward reward);\n void deleteReward(@Param(\"id\") long id);\n\n}", "int updateByPrimaryKey(PracticeClass record);", "T queryForId(ID id) throws SQLException, DaoException;", "@Override\n public void save()\n {\n// dao1.save();\n// dao2.save();\n }", "@Transactional\npublic interface ReportEntryDAO {\n public List<ReportEntry> findItems(final Integer sem_id, final Integer dept_id, final Integer teacher_id);\n public void create(ReportEntry reportEntry);\n\n void update(ReportEntry reportEntry);\n ReportEntry find(final Integer id);\n\n public void delete(final int id);\n\n}", "@Repository\npublic interface ArticleMapper {\n\n @Select(\"select count(*) from article\")\n int countArticle();\n\n List<Article> getList(Pageable<Article> pageable);\n\n @Select(\"select count(*) from article a where a.userId = #{userId}\")\n int countSelfArticle(Article article);\n\n List<Article> getSelfList(Pageable<Article> pageable);\n\n @Delete(\"delete a from article a where a.id = #{id}\")\n int delete(Article article);\n\n @Select(\"select * from article a where a.id = #{id}\")\n Article findById(Article article);\n\n @Insert(\"insert into article values (#{id}, #{title}, #{publishTime}, #{userId}, #{content}, #{status}, #{cover}, #{updateTime}, #{shareDescribe} ) \")\n int add(Article article);\n\n @Update(\"update article set title = #{title}, content = #{content}, cover = #{cover}, updateTime = #{updateTime}, userId = #{userId}, shareDescribe = #{shareDescribe} where id = #{id}\")\n int update(Article article);\n\n @Update(\"update article set status = #{status} where id = #{id}\")\n int setStatus(Article article);\n\n @Select(\"select a.title, a.id from article a\")\n List<Article> getAllList();\n\n @Select(\"select a.title, a.id, a.cover from article a where a.status = 1\")\n List<Article> getCoverList();\n\n Article getDetail(String id);\n}", "int insert(DashboardGoods record);", "@Dao\npublic interface MovieDao {\n\n\n @Insert\n void insert(Movie... movies);\n\n @Query(\"SELECT * FROM Movie WHERE id = :Id\")\n Maybe<Movie> ISFavorit(int Id);\n\n\n @Query(\"SELECT * FROM Movie\")\n Flowable<List<Movie>> getAll();\n\n @Delete\n void delete(Movie movie);\n}", "int updateByPrimaryKey(AccessModelEntity record);", "Purchase retrieve(Long id) throws SQLException, DAOException;", "int updateByPrimaryKey(Promo record);", "public interface ImprimeRepository extends JpaRepository<Imprime,Long> {\n\n Imprime findById(Long id);\n\n}", "public interface BookRepository extends JpaRepository<Book, Long> {\n\n List<String> giveMeAllBooksTitlesByAuthor(String author);\n\n List<Book> giveMeAllBooksByAuthorWithPrizeGraterThan(@Param(\"author\") String author,\n @Param(\"prize\") BigDecimal prize);\n\n BigDecimal giveMeAveragePrizeOfBooks();\n\n List<Book> giveMeAllBooksByAuthorOrderedByPagesDesc(@Param(\"author\") String author, Pageable pageable);\n\n List<Employee> giveMeAllEmployeesWhoSoldBooksOfThisAuthor(@Param(\"author\") String author);\n\n void increasePrizesByTenPercent(@Param(\"id\") Long id);\n}", "@Dao\npublic interface GardensDao {\n @Query(\"SELECT * FROM gardens\")\n List<Garden> getAll();\n\n @Query(\"UPDATE gardens SET status = 'saved' WHERE propid = :id\")\n void saveGarden(String id);\n\n @Insert(onConflict = REPLACE)\n void insertGarden(Garden garden);\n\n @Insert(onConflict = REPLACE)\n void insertAllGardens(List<Garden> garden);\n\n @Query(\"SELECT * FROM gardens where propid LIKE :id\")\n Garden findGardenByID(String id);\n\n @Query(\"SELECT * FROM gardens where status LIKE 'saved'\")\n List<Garden> getSaved();\n\n @Delete\n void deleteGarden(Garden garden);\n\n @Delete\n void deleteGardenList(List<Garden> gardenList);\n\n @Query(\"SELECT COUNT(*) from gardens\")\n int countGardens();\n}", "public CustomerPurchase getById(Integer id) throws SQLException;", "@Test(expected = NoResultException.class)\r\n public void updatePosts(){\r\n\r\n Post post = entityManager.createNamedQuery(\"Post.fetchAllRecordsByUserId\", Post.class)\r\n .setParameter(\"value1\", 3000l)\r\n .getSingleResult();\r\n \r\n post.setDescription(\"TRASHED ELECTRONICS ARE PILING UP ACROSS ASIA\");\r\n post.setLikes(500);\r\n \r\n \r\n entityTransaction.begin();\r\n entityManager.createNamedQuery(\"Post.updateDescriptionAndLikesByPostId\", Post.class)\r\n .setParameter(\"value1\", post.getDescription())\r\n .setParameter(\"value2\", post.getLikes())\r\n .setParameter(\"value3\", post.getPostId())\r\n .executeUpdate();\r\n entityManager.refresh(post);\r\n entityTransaction.commit();\r\n\r\n post = entityManager.createNamedQuery(\"Post.fetchAllRecordsByUserId\", Post.class)\r\n .setParameter(\"value1\", 300l)\r\n .getSingleResult(); \r\n assertNotNull(post); \r\n }", "public BankAccount findAccountById(int currentBankID) throws SQLException;" ]
[ "0.58847225", "0.58114856", "0.55385244", "0.5537376", "0.54796773", "0.54748285", "0.54648507", "0.5444338", "0.5398169", "0.5393515", "0.53784823", "0.53555334", "0.53280246", "0.5327271", "0.5322535", "0.53181773", "0.53170043", "0.5313435", "0.53023934", "0.5291084", "0.5290658", "0.5290037", "0.5274699", "0.5266149", "0.5265404", "0.52532196", "0.523894", "0.52345574", "0.52338135", "0.52327913", "0.5229882", "0.52232116", "0.5215579", "0.5203403", "0.5201051", "0.51775116", "0.5177059", "0.51687336", "0.51582897", "0.51415956", "0.5140291", "0.5139579", "0.5135106", "0.51319766", "0.51220053", "0.51212823", "0.51212144", "0.51212144", "0.5117435", "0.5117435", "0.51169926", "0.5115047", "0.5113234", "0.51084787", "0.5104533", "0.5103085", "0.50939685", "0.509377", "0.5091828", "0.50891894", "0.50832444", "0.50811833", "0.508038", "0.5080332", "0.5077968", "0.50774664", "0.5076959", "0.5076352", "0.50758785", "0.5074234", "0.5073667", "0.5073141", "0.50731385", "0.5068634", "0.50668085", "0.5062257", "0.5061514", "0.5060156", "0.5056347", "0.50548947", "0.5054712", "0.5054519", "0.50543606", "0.50505716", "0.50474", "0.5044337", "0.5043886", "0.50387555", "0.5032175", "0.50158757", "0.5004427", "0.5004054", "0.5001172", "0.49984586", "0.49966416", "0.49926755", "0.499123", "0.49900988", "0.49892315", "0.49878457", "0.49855602" ]
0.0
-1
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_tutor_list, container, false); rv = (RecyclerView) rootView.findViewById(R.id.rvTutors); // rv.setHasFixedSize(true); rv.setLayoutManager(new LinearLayoutManager(getActivity())); swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipeRefreshLayout); id = this.getArguments().getString("session"); //Toast.makeText(getContext(),"Session id "+id,Toast.LENGTH_SHORT); connect2server = new getTutors(this.getActivity(), id, list); connect2server.delegate = this; connect2server.execute(); swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright, android.R.color.holo_green_light, android.R.color.holo_orange_light, android.R.color.holo_red_light); swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { // Refresh items refreshItems(); } }); return rootView; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.wallpager_layout, null);\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_invit_friends, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_zhuye, container, false);\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_posts, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n return inflater.inflate(R.layout.ilustration_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_sow_drug_cost_per_week, container, false);\n\n db = new DataBaseAdapter(getActivity());\n hc = new HelperClass();\n pop = new FeedSowsFragment();\n\n infltr = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n parent = (LinearLayout) v.findViewById(R.id.layout_for_add);\n tvTotalCost = (TextView) v.findViewById(R.id.totalCost);\n\n getData();\n setData();\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_stream_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_event, container, false);\n\n\n\n\n\n\n\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_feed, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.screen_select_list_student, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_overall, container, false);\n mNamesLayout = (LinearLayout) rootView.findViewById(R.id.fragment_overall_names_layout);\n mOverallView = (OverallView) rootView.findViewById(R.id.fragment_overall_view);\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState)\n {\n\n\n view = inflater.inflate(R.layout.fragment_earning_fragmant, container, false);\n ini(view);\n return view;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n super.onCreateView(inflater, container, savedInstanceState);\n final View rootview = inflater.inflate(R.layout.activity_email_frag, container, false);\n ConfigInnerElements(rootview);\n return rootview;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\trootView = inflater.inflate(R.layout.fragment_attack_armor, container, false);\r\n\r\n\t\tfindInterfaceElements();\r\n\t\taddRangeSelector();\r\n\t\tupdateHeadings();\r\n\t\tsetListeners();\r\n\r\n\t\tsetFromData();\r\n\r\n\t\treturn rootView;\r\n\t}", "@SuppressLint(\"InflateParams\")\r\n\t@Override\r\n\tpublic View initLayout(LayoutInflater inflater) {\n\t\tView view = inflater.inflate(R.layout.frag_customer_all, null);\r\n\t\treturn view;\r\n\t}", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_fore_cast, container, false);\r\n initView();\r\n mainLayout.setVisibility(View.GONE);\r\n apiInterface = RestClinet.getClient().create(ApiInterface.class);\r\n loadData();\r\n return view;\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_friend, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_detail, container, false);\n image = rootView.findViewById(R.id.fr_image);\n name = rootView.findViewById(R.id.fr_name);\n phoneNumber = rootView.findViewById(R.id.fr_phone_number);\n email = rootView.findViewById(R.id.fr_email);\n street = rootView.findViewById(R.id.fr_street);\n city = rootView.findViewById(R.id.fr_city);\n state = rootView.findViewById(R.id.fr_state);\n zipcode = rootView.findViewById(R.id.fr_zipcode);\n dBrith = rootView.findViewById(R.id.date_brith);\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_pm25, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_kkbox_playlist, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_feed_pager, container, false);\n\n// loadData();\n\n findViews(rootView);\n\n setViews();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n layout = (FrameLayout) inflater.inflate(R.layout.fragment_actualites, container, false);\n\n relLayout = (RelativeLayout) layout.findViewById(R.id.relLayoutActus);\n\n initListView();\n getXMLData();\n\n return layout;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.frag_post_prayer_video, container, false);\n setCustomDesign();\n setCustomClickListeners();\n return rootView;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.lf_em4305_fragment, container, false);\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_recordings, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view=inflater.inflate(R.layout.fragment_category, container, false);\n initView(view);\n bindRefreshListener();\n loadParams();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_cm_box_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_layout12, container, false);\n\n iniv();\n\n init();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_details, container, false);\n //return inflater.inflate(R.layout.fragment_details, container, false);\n getIntentValues();\n initViews();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_mem_body_blood, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_qiugouxiaoxi, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_coll_blank, container, false);\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_attendance_divide, container, false);\n\n initView(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.show_program_fragment, parent, false);\n }", "@Override\n public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,\n @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.visualization_fragment, container, false);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_category_details_page, container, false);\n initializeAll();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n final View v = inflater.inflate(R.layout.fragemnt_reserve, container, false);\n\n\n\n\n return v;\n }", "protected int getLayoutResId() {\n return R.layout.activity_fragment;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_quizs, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n role = getArguments().getInt(\"role\");\n rootview = inflater.inflate(R.layout.fragment_application, container, false);\n layout = rootview.findViewById(R.id.patentDetails);\n progressBar = rootview.findViewById(R.id.progressBar);\n try {\n run();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return rootview;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\tview = inflater.inflate(R.layout.fragment_zhu, null);\n\t\tinitView();\n\t\tinitData();\n\t\treturn view;\n\t}", "@Override\n\t\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)\n\t\t{\n\t\t\tView rootView = inflater.inflate(R.layout.maimfragment, container, false);\n\t\t\treturn rootView;\n\t\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n // Inflate the layout for this fragment\n return inflater.inflate(R.layout.fragment__record__week, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_porishongkhan, container, false);\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_dashboard, container, false);\n resultsRv = view.findViewById(R.id.db_results_rv);\n resultText = view.findViewById(R.id.db_search_empty);\n progressBar = view.findViewById(R.id.db_progressbar);\n lastVisitText = view.findViewById(R.id.db_last_visit);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(getLayoutId(), container, false);\n init(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_feedback, container, false);\n self = getActivity();\n initUI(view);\n initControlUI();\n initData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_service_summery, container, false);\n tvVoiceMS = v.findViewById(R.id.tvVoiceValue);\n tvDataMS = v.findViewById(R.id.tvdataValue);\n tvSMSMS = v.findViewById(R.id.tvSMSValue);\n tvVoiceFL = v.findViewById(R.id.tvVoiceFLValue);\n tvDataBS = v.findViewById(R.id.tvDataBRValue);\n tvTotal = v.findViewById(R.id.tvTotalAccountvalue);\n return v;\n }", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_clan_rank_details, container, false);\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_star_wars_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_lei, container, false);\n\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_quotation, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_wode_ragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n\n\n\n\n\n return inflater.inflate(R.layout.fragment_appoint_list, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n if (rootView == null) {\n rootView = inflater.inflate(R.layout.fragment_ip_info, container, false);\n initView();\n }\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_offer, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_rooms, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\n View view = inflater.inflate(R.layout.fragment_img_eva, container, false);\n\n getSendData();\n\n initView(view);\n\n initData();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_project_collection, container, false);\n ButterKnife.bind(this, view);\n fragment = this;\n initView();\n getCollectionType();\n // getCategoryList();\n initBroadcastReceiver();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_yzm, container, false);\n initView(view);\n return view;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\t\tmainLayout = inflater.inflate(R.layout.fragment_play, container, false);\r\n\t\treturn mainLayout;\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_invite_request, container, false);\n initialiseVariables();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n getLocationPermission();\n return inflater.inflate(R.layout.centrum_fragment, container, false);\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_habit_type_details, container, false);\n\n habitTitle = rootView.findViewById(R.id.textViewTitle);\n habitReason = rootView.findViewById(R.id.textViewReason);\n habitStartDate = rootView.findViewById(R.id.textViewStartDate);\n habitWeeklyPlan = rootView.findViewById(R.id.textViewWeeklyPlan);\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_information_friends4, container, false);\n\n if (getArguments() != null) {\n FriendsID = getArguments().getString(\"keyFriends\");\n }\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_post_details, container, false);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hotel, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_bus_inquiry, container, false);\n initView();\n initData();\n initDialog();\n getDataFromNet();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_weather, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_srgl, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_ground_detail_frgment, container, false);\n init();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_book_appointment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_wheretogo, container, false);\n ids();\n setup();\n click();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n binding = DataBindingUtil\n .inflate(inflater, R.layout.fragment_learning_leaders, container, false);\n init();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_end_game_tab, container, false);\n\n setupWidgets();\n setupTextFields(view);\n setupSpinners(view);\n\n // Inflate the layout for this fragment\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.memoir_fragment, container, false);\n\n getUserIdFromSharedPref();\n configureUI(view);\n configureSortSpinner();\n configureFilterSpinner();\n\n networkConnection = new NetworkConnection();\n new GetAllMemoirTask().execute();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_jadwal, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_delivery_detail, container, false);\n initialise();\n\n\n\n return view;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_4, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_product, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_group_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment06_7, container, false);\n initView(view);\n setLegend();\n setXAxis();\n setYAxis();\n setData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_downloadables, container, false);\n }", "@Override\n public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.movie_list_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_like, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hall, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_unit_main, container, false);\n TextView mTxvBusinessAassistant = (TextView) view.findViewById(R.id.txv_business_assistant);\n TextView mTxvCardINformation = (TextView) view.findViewById(R.id.txv_card_information);\n RelativeLayout mRelOfficialWebsite = (RelativeLayout) view.findViewById(R.id.rel_official_website);\n RelativeLayout mRelPictureAblum = (RelativeLayout) view.findViewById(R.id.rel_picture_album);\n TextView mTxvQrCodeCard = (TextView) view.findViewById(R.id.txv_qr_code_card);\n TextView mTxvShareCard = (TextView) view.findViewById(R.id.txv_share_card);\n mTxvBusinessAassistant.setOnClickListener(this.mOnClickListener);\n mTxvCardINformation.setOnClickListener(this.mOnClickListener);\n mRelOfficialWebsite.setOnClickListener(this.mOnClickListener);\n mRelPictureAblum.setOnClickListener(this.mOnClickListener);\n mTxvQrCodeCard.setOnClickListener(this.mOnClickListener);\n mTxvShareCard.setOnClickListener(this.mOnClickListener);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_moviespage, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_s, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_overview, container, false);\n\n initOverviewComponents(view);\n registerListeners();\n initTagListener();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_bahan_ajar, container, false);\n initView(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n root = (ViewGroup) inflater.inflate(R.layout.money_main, container, false);\n context = getActivity();\n initHeaderView(root);\n initView(root);\n\n getDate();\n initEvetn();\n return root;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_historical_event, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_event_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_video, container, false);\n unbinder = ButterKnife.bind(this, view);\n initView();\n initData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n v= inflater.inflate(R.layout.fragment_post_contacts, container, false);\n this.mapping(v);\n return v;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_measures, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_feed, container, false);\n findViews(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_surah_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_data_binded, container, false);\n }" ]
[ "0.6739604", "0.67235583", "0.6721706", "0.6698254", "0.6691869", "0.6687986", "0.66869223", "0.6684548", "0.66766286", "0.6674615", "0.66654444", "0.66654384", "0.6664403", "0.66596216", "0.6653321", "0.6647136", "0.66423255", "0.66388357", "0.6637491", "0.6634193", "0.6625158", "0.66195583", "0.66164845", "0.6608733", "0.6596594", "0.65928894", "0.6585293", "0.65842897", "0.65730995", "0.6571248", "0.6569152", "0.65689117", "0.656853", "0.6566686", "0.65652984", "0.6553419", "0.65525705", "0.65432084", "0.6542382", "0.65411425", "0.6538022", "0.65366334", "0.65355957", "0.6535043", "0.65329415", "0.65311074", "0.65310687", "0.6528645", "0.65277404", "0.6525902", "0.6524516", "0.6524048", "0.65232015", "0.65224624", "0.65185034", "0.65130377", "0.6512968", "0.65122765", "0.65116245", "0.65106046", "0.65103024", "0.6509013", "0.65088093", "0.6508651", "0.6508225", "0.6504662", "0.650149", "0.65011525", "0.6500686", "0.64974767", "0.64935696", "0.6492234", "0.6490034", "0.6487609", "0.6487216", "0.64872116", "0.6486594", "0.64861935", "0.6486018", "0.6484269", "0.648366", "0.6481476", "0.6481086", "0.6480985", "0.6480396", "0.64797544", "0.647696", "0.64758915", "0.6475649", "0.6474114", "0.6474004", "0.6470706", "0.6470275", "0.64702207", "0.6470039", "0.6467449", "0.646602", "0.6462256", "0.64617974", "0.6461681", "0.6461214" ]
0.0
-1
Publish a bean to generate swagger2 endpoints
@Bean public Docket usersApi() { return new Docket(DocumentationType.SWAGGER_2) .apiInfo(usersApiInfo()) .select() .paths(userPaths()) .apis(RequestHandlerSelectors.any()) .build() .useDefaultResponseMessages(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Bean\n public Docket api(){\n //Enables following endpoints once configured\n //http://localhost:8080/swagger-ui.html\n //http://localhost:8080/v2/api-docs\n return new Docket(DocumentationType.SWAGGER_2)\n //.apiInfo(ApiInfo.DEFAULT)\n .apiInfo(DEFAULT_API_INFO)\n .produces(DEFAULT_PRODUCES_AND_CONSUMES)\n .consumes(DEFAULT_PRODUCES_AND_CONSUMES);\n }", "public abstract Endpoint createAndPublishEndpoint(String address, Object implementor);", "@Bean\r\n public Docket api() {\n\r\n return new Docket(DocumentationType.SWAGGER_2)\r\n .select()\r\n .apis(RequestHandlerSelectors.basePackage(\"com.varun.swaggerapp\"))\r\n .paths(PathSelectors.any())\r\n .build()\r\n .apiInfo(getMyAppInfo());\r\n }", "@Bean\n\tpublic Docket postApi() {\n\t\treturn new Docket(DocumentationType.SWAGGER_2)\n\t\t\t\t.apiInfo(metadata()).select().paths(regex(\"/api.*\")).build();\n\t}", "public interface ApiEndpointDefinition extends Serializable {\n\n\t/**\n\t * Get the endpoint class.\n\t * @return the endpoint class\n\t */\n\tClass<?> getEndpointClass();\n\n\t/**\n\t * Get the endpoint type.\n\t * @return the endpoint type\n\t */\n\tApiEndpointType getType();\n\n\t/**\n\t * Get the scanner type.\n\t * @return the scanner type\n\t */\n\tJaxrsScannerType getScannerType();\n\n\t/**\n\t * Get the endpoint path.\n\t * @return the endpoint path\n\t */\n\tString getPath();\n\n\t/**\n\t * Get the API context id to which the endpoint is bound.\n\t * @return the API context id to which the endpoint is bound\n\t */\n\tString getContextId();\n\n\t/**\n\t * Init the endpoint context.\n\t * @return <code>true</code> if initialized, <code>false</code> if already initialized\n\t */\n\tboolean init();\n\n\t/**\n\t * Create a new {@link ApiEndpointDefinition}.\n\t * @param endpointClass The endpoint class (not null)\n\t * @param type The endpoint type\n\t * @param scannerType The scanner type\n\t * @param path The endpoint path\n\t * @param contextId the API context id to which the endpoint is bound\n\t * @param initializer Initializer (not null)\n\t * @return A new {@link ApiEndpointDefinition} instance\n\t */\n\tstatic ApiEndpointDefinition create(Class<?> endpointClass, ApiEndpointType type, JaxrsScannerType scannerType,\n\t\t\tString path, String contextId, Callable<Void> initializer) {\n\t\treturn new DefaultApiEndpointDefinition(endpointClass, type, scannerType, path, contextId, initializer);\n\t}\n\n}", "@Bean\n public Docket swaggerApi() {\n\n return new Docket(DocumentationType.SWAGGER_2).apiInfo(swaggerInfo()).select()\n .apis(RequestHandlerSelectors.basePackage(\"rooftophero.io.toyp2p.api\"))\n .paths(PathSelectors.any())\n// .paths(PathSelectors.ant(\"/api/*\"))\n .build()\n .useDefaultResponseMessages(false); // 기본으로 세팅되는 200,401,403,404 메시지를 표시 하지 않음\n }", "@Bean\n public Docket productApi() {\n return new Docket(DocumentationType.SWAGGER_2) \t\t\t\t \n\t\t .select()\n\t\t \t//.apis(RequestHandlerSelectors.any())\n\t\t \t.apis(RequestHandlerSelectors.basePackage(\"com.thingtrack.training.vertica.services.controller\"))\n\t\t \t.paths(PathSelectors.any())\t\t \t\t \n\t\t \t.build()\n\t\t .securitySchemes(Lists.newArrayList(apiKey()))\n\t\t .securityContexts(Lists.newArrayList(securityContext()))\t\t \t\n\t\t .apiInfo(metaData());\n }", "@Service(name = \"CustomerService\")\n@OpenlegacyDesigntime(editor = \"WebServiceEditor\")\npublic interface CustomerServiceService {\n\n public CustomerServiceOut getCustomerService(CustomerServiceIn customerServiceIn) throws Exception;\n\n @Getter\n @Setter\n public static class CustomerServiceIn {\n \n Integer id3;\n }\n \n @ApiModel(value=\"CustomerServiceOut\", description=\"\")\n @Getter\n @Setter\n public static class CustomerServiceOut {\n \n @ApiModelProperty(value=\"Getuserdetails\")\n Getuserdetails getuserdetails;\n }\n}", "@Bean\n\tpublic Docket api() { \n\n\t\tDocket docket= new Docket(DocumentationType.SWAGGER_2) \n\t\t\t\t.select() \n\t\t\t\t.apis(RequestHandlerSelectors.basePackage(\"com.authorizationservice.authorization\")) \n\t\t\t\t.paths(PathSelectors.any()) \n\t\t\t\t.build().apiInfo(apiDetails()); \n\t\tlog.debug(\"Docket{}:\", docket);\n\t\treturn docket;\n\t}", "@Bean\n public Docket productApi() {\n return new Docket(DocumentationType.SWAGGER_2)\n .select()\n .paths(PathSelectors.regex(\"/api/.*\"))\n .apis(RequestHandlerSelectors.basePackage(\"com.stackroute.muzix\"))\n .build()\n .apiInfo(apiDetails());\n }", "@Bean\n public Docket api() {\n return new Docket(DocumentationType.SWAGGER_2)\n .groupName(groupName)\n .select()\n .apis(RequestHandlerSelectors.basePackage(basePackage))\n .paths(PathSelectors.any())\n .build()\n .enable(enable)\n .apiInfo(apiInfo());\n }", "public interface AppFooEndpoint {\n}", "interface WithPublishRunbook {\n /**\n * Specifies the publishRunbook property: The auto publish of the source control. Default is true..\n *\n * @param publishRunbook The auto publish of the source control. Default is true.\n * @return the next definition stage.\n */\n WithCreate withPublishRunbook(Boolean publishRunbook);\n }", "@Bean\n\tpublic Docket createRestApi() {\n\t\treturn new Docket(DocumentationType.SWAGGER_2)\n\t\t\t\t.apiInfo(apiInfo())\n\t\t\t\t.groupName(\"rest\")\n\t\t\t\t.select()\n\t\t\t\t.apis(RequestHandlerSelectors.basePackage(\"com.ly.edu.controller\"))\n\t\t\t\t.paths(PathSelectors.any())\n\t\t\t\t.build();\n\t}", "@Bean\n\tpublic Docket api() {\n\t\treturn new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.any())\n\t\t\t\t.paths(PathSelectors.any()).build();\n\t}", "@Bean\n public SwaggerSpringMvcPlugin swaggerSpringMvcPlugin() {\n return new SwaggerSpringMvcPlugin(springSwaggerConfig)\n .includePatterns(\n \"/business.*\",\n \"/api-docs.*\"\n\n )\n .pathProvider(new CustomRelativeSwaggerPathProvider() )\n .apiInfo(apiInfo())\n .build();\n }", "@Path(JaxRsActivator.OVERVIEW_ENDPOINT_PATH)\npublic interface ApiOverviewRestEndpoint {\n /**\n * A {@code String} constant representing json v1 \"{@value #MEDIA_TYPE_JSON_V1}\" media type .\n */\n String MEDIA_TYPE_JSON_V1 = \"application/vnd.overview-v1+json\";\n /**\n * A {@link MediaType} constant representing json v1 \"{@value #MEDIA_TYPE_JSON_V1}\" media type.\n */\n MediaType MEDIA_TYPE_JSON_V1_TYPE = new MediaType(\"application\", \"vnd.overview-v1+json\");\n\n /**\n * <pre>\n * http://127.0.0.1:8180/auth-microservice/auth-api/overview/endpoints\n * curl -v -H \"Accept: application/vnd.overview-v1+json\" -H \"Content-Type: application/vnd.overview-v1+json\" -H \"X-BOMC-REQUEST-ID: SET-BY-CURL-123\" -H \"X-BOMC-AUTHORIZATION: BOMC_USER\" -X GET \"127.0.0.1:8180/auth-microservice/auth-api/overview/endpoints\"\n * </pre>\n * @return JSON response for all available endpoints.\n * @description List all available endpoints. responseType javax.json.JsonObject\n * @responseMessage 200 A Response object that wraps the javax.json.JsonObject.\n * @responseMessage 400 Invalid Request.\n * @responseMessage 401 Unauthorized. API key does not need access privileges.\n * @responseMessage 404 Endpoint not found.\n */\n @GET\n @Path(\"/endpoints\")\n @Produces(ApiOverviewRestEndpoint.MEDIA_TYPE_JSON_V1)\n @Cache\n Response getAvailableEndpoints(@Context final Dispatcher dispatcher);\n}", "@PostConstruct\n\tpublic void config() {\n\t\tthis.configureSwaggerV1();\n\t}", "private void createEndpointElement(JsonObject swaggerObject, String swaggerVersion) throws RegistryException {\n\t\t/*\n\t\tExtracting endpoint url from the swagger document.\n\t\t */\n\t\tif (SwaggerConstants.SWAGGER_VERSION_12.equals(swaggerVersion)) {\n\t\t\tJsonElement endpointUrlElement = swaggerObject.get(SwaggerConstants.BASE_PATH);\n\t\t\tif (endpointUrlElement == null) {\n\t\t\t\tlog.warn(\"Endpoint url is not specified in the swagger document. Endpoint creation might fail. \");\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tendpointUrl = endpointUrlElement.getAsString();\n\t\t\t}\n\t\t} else if (SwaggerConstants.SWAGGER_VERSION_2.equals(swaggerVersion)) {\n\t\t\tJsonElement transportsElement = swaggerObject.get(SwaggerConstants.SCHEMES);\n\t\t\tJsonArray transports = (transportsElement != null) ? transportsElement.getAsJsonArray() : null;\n\t\t\tString transport = (transports != null) ? transports.get(0).getAsString() + \"://\" : DEFAULT_TRANSPORT;\n\t\t\tJsonElement hostElement = swaggerObject.get(SwaggerConstants.HOST);\n\t\t\tString host = (hostElement != null) ? hostElement.getAsString() : null;\n if (host == null) {\n log.warn(\"Endpoint(host) url is not specified in the swagger document. \"\n + \"The host serving the documentation is to be used(including the port) as endpoint host\");\n\n if(requestContext.getSourceURL() != null) {\n URL sourceURL = null;\n try {\n sourceURL = new URL(requestContext.getSourceURL());\n } catch (MalformedURLException e) {\n throw new RegistryException(\"Error in parsing the source URL. \", e);\n }\n host = sourceURL.getAuthority();\n }\n }\n\n if (host == null) {\n log.warn(\"Can't derive the endpoint(host) url when uploading swagger from file. \"\n + \"Endpoint creation might fail. \");\n return;\n }\n\n\t\t\tJsonElement basePathElement = swaggerObject.get(SwaggerConstants.BASE_PATH);\n\t\t\tString basePath = (basePathElement != null) ? basePathElement.getAsString() : DEFAULT_BASE_PATH;\n\n\t\t\tendpointUrl = transport + host + basePath;\n\t\t}\n\t\t/*\n\t\tCreating endpoint artifact\n\t\t */\n\t\tOMFactory factory = OMAbstractFactory.getOMFactory();\n\t\tendpointLocation = EndpointUtils.deriveEndpointFromUrl(endpointUrl);\n\t\tString endpointName = EndpointUtils.deriveEndpointNameWithNamespaceFromUrl(endpointUrl);\n\t\tString endpointContent = EndpointUtils\n\t\t\t\t.getEndpointContentWithOverview(endpointUrl, endpointLocation, endpointName, documentVersion);\n\t\ttry {\n\t\t\tendpointElement = AXIOMUtil.stringToOM(factory, endpointContent);\n\t\t} catch (XMLStreamException e) {\n\t\t\tthrow new RegistryException(\"Error in creating the endpoint element. \", e);\n\t\t}\n\n\t}", "interface WithPublishRunbook {\n /**\n * Specifies the publishRunbook property: The auto publish of the source control. Default is true..\n *\n * @param publishRunbook The auto publish of the source control. Default is true.\n * @return the next definition stage.\n */\n Update withPublishRunbook(Boolean publishRunbook);\n }", "@Api(description = \"supermarket client api\")\npublic interface SupermarketClientApi extends ProductApi {\n}", "@PostConstruct\n public void init() {\n configureSwagger();\n }", "@Bean\n\tpublic SwaggerSpringMvcPlugin customImplementation() {\n\t\tboolean enable = ResourceUtils.getBundleValue4Boolean(\"swagger.enable\");\n\t\treturn new SwaggerSpringMvcPlugin(this.springSwaggerConfig).apiInfo(apiInfo()).enable(enable)\n\t\t\t\t.includePatterns(\".*?\");\n\t}", "@Bean\n\tpublic Docket api() {\n\t// @formatter:off\n return new Docket(DocumentationType.SWAGGER_2)\n // 為了顯示 CompletableFuture 內的 DTO 描述\n .genericModelSubstitutes(ResponseEntity.class, CompletableFuture.class)\n .apiInfo(this.apiInfo())\n .select()\n .apis(RequestHandlerSelectors.any())\n // 濾掉預設的與監控路徑\n .paths(\n path -> {\n return !(path.matches(\"/error\")\n || path.matches(\"/actuator+(.*)\")\n || path.matches(\"/profile\"));\n })\n .build();\n // @formatter:on\n\t}", "@Bean\n public Docket userApi() {\n return new Docket(DocumentationType.SWAGGER_2)\n .apiInfo(metaData())\n .select()\n .apis(RequestHandlerSelectors.basePackage(API_BASE_PACKAGE))\n .apis(RequestHandlerSelectors.any())\n .paths(PathSelectors.any())\n .build();\n }", "@SwaggerDefinition(\n info = @Info(\n version = \"1.0.0\",\n title = \"\",\n extensions = {\n @Extension(properties = {\n @ExtensionProperty(name = \"name\", value = \"picavi\"),\n @ExtensionProperty(name = \"context\", value = \"/picavi\"),\n })\n }\n ),\n tags = {\n @Tag(name = \"picavi\", description = \"\")\n }\n)\n@Scopes(\n scopes = {\n @Scope(\n name = \"Enroll device\",\n description = \"\",\n key = \"perm:picavi:enroll\",\n permissions = {\"/device-mgt/devices/enroll/picavi\"}\n )\n }\n)\n@SuppressWarnings(\"NonJaxWsWebServices\")\npublic interface DeviceTypeService {\n /**\n * End point to send message to Picavi device.\n */\n @POST\n @Path(\"device/{deviceId}/message\")\n @ApiOperation(\n httpMethod = \"POST\",\n value = \"Send message to Picavi device\",\n notes = \"\",\n response = Response.class,\n tags = \"picavi\",\n extensions = {\n @Extension(properties = {\n @ExtensionProperty(name = PicaviConstants.SCOPE, value = \"perm:picavi:enroll\")\n })\n }\n )\n @ApiResponses(value = {\n @ApiResponse(\n code = 200,\n message = \"OK.\",\n response = Response.class,\n responseHeaders = {\n @ResponseHeader(\n name = \"Content-Type\",\n description = \"The content type of the body\"),\n @ResponseHeader(\n name = \"Last-Modified\",\n description = \"Date and time the resource was last modified.\\n\" +\n \"Used by caches, or in conditional requests.\"),\n }),\n @ApiResponse(\n code = 400,\n message = \"Bad Request. \\n Invalid Device Identifiers found.\",\n response = Response.class),\n @ApiResponse(\n code = 401,\n message = \"Unauthorized. \\n Unauthorized request.\"),\n @ApiResponse(\n code = 500,\n message = \"Internal Server Error. \\n Error occurred while executing command operation to\"\n + \" send threashold\",\n response = Response.class)\n })\n Response sendMessage(\n @ApiParam(\n name = \"deviceId\",\n value = \"The registered device Id.\",\n required = true)\n @PathParam(\"deviceId\") String deviceId,\n @ApiParam(\n name = \"message\",\n value = \"The message to be displayed.\",\n required = true)\n @QueryParam(\"message\") String message);\n\n /**\n * Enroll devices.\n */\n @POST\n @Path(\"device/{device_id}/register\")\n @ApiOperation(\n httpMethod = \"POST\",\n value = \"Enroll device\",\n notes = \"\",\n response = Response.class,\n tags = \"picavi\",\n extensions = {\n @Extension(properties = {\n @ExtensionProperty(name = PicaviConstants.SCOPE, value = \"perm:picavi:enroll\")\n })\n }\n )\n @ApiResponses(value = {\n @ApiResponse(\n code = 202,\n message = \"Accepted.\",\n response = Response.class),\n @ApiResponse(\n code = 406,\n message = \"Not Acceptable\"),\n @ApiResponse(\n code = 500,\n message = \"Internal Server Error. \\n Error on retrieving stats\",\n response = Response.class)\n })\n Response register(\n @ApiParam(\n name = \"deviceId\",\n value = \"Device identifier id of the device to be added\",\n required = true)\n @PathParam(\"device_id\") String deviceId,\n @ApiParam(\n name = \"deviceName\",\n value = \"Device name of the device to be added\",\n required = true)\n @QueryParam(\"deviceName\") String deviceName);\n\n /**\n * Retrieve Sensor data for the device type\n */\n @Path(\"device/stats/{deviceId}\")\n @GET\n @ApiOperation(\n consumes = MediaType.APPLICATION_JSON,\n httpMethod = \"GET\",\n value = \"Retrieve Sensor data for the device type\",\n notes = \"\",\n response = Response.class,\n tags = \"picavi\",\n extensions = {\n @Extension(properties = {\n @ExtensionProperty(name = PicaviConstants.SCOPE, value = \"perm:picavi:enroll\")\n })\n }\n )\n @Consumes(\"application/json\")\n @Produces(\"application/json\")\n Response getPicaviDeviceStats(@PathParam(\"deviceId\") String deviceId, @QueryParam(\"from\") long from,\n @QueryParam(\"to\") long to, @QueryParam(\"sensorType\") String sensorType);\n\n\n}", "@Path(\"policyDefs\")\npublic interface IPolicyDefinitionResource {\n\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n public List<PolicyDefinitionSummaryBean> list() throws NotAuthorizedException;\n\n @POST\n @Consumes(MediaType.APPLICATION_JSON)\n @Produces(MediaType.APPLICATION_JSON)\n public PolicyDefinitionBean create(PolicyDefinitionBean bean) throws PolicyDefinitionAlreadyExistsException, NotAuthorizedException;\n \n @GET\n @Path(\"{policyDefinitionId}\")\n @Produces(MediaType.APPLICATION_JSON)\n public PolicyDefinitionBean get(@PathParam(\"policyDefinitionId\") String policyDefinitionId) throws PolicyDefinitionNotFoundException, NotAuthorizedException;\n\n @PUT\n @Path(\"{policyDefinitionId}\")\n public void update(@PathParam(\"policyDefinitionId\") String policyDefinitionId, PolicyDefinitionBean bean)\n throws PolicyDefinitionNotFoundException, NotAuthorizedException;\n\n @DELETE\n @Path(\"{policyDefinitionId}\")\n public void delete(@PathParam(\"policyDefinitionId\") String policyDefinitionId)\n throws PolicyDefinitionNotFoundException, NotAuthorizedException;\n\n}", "@Bean\n public Docket swaggerYogurtApi() {\n return new Docket(DocumentationType.SWAGGER_2)\n .groupName(\"Yogurt\")\n .select()\n .apis(RequestHandlerSelectors.basePackage(\"com.yogurt.controller.v1.api\"))\n .paths(PathSelectors.any())\n .build()\n .apiInfo(apiInfo())\n .securitySchemes(Arrays.asList(apiKey()));\n }", "public interface SwaggerDescriptions {\n\n String VIN = \"Identifies a vehicle. This is a required parameter unless year, make, and model are provided as input values.\";\n String COUNTRY = \"Identifies a country. This country could be different than the country in which the vehicle was manufactured.\";\n String USED = \"Identifies whether the vehicle is used. If set to true, you can specify install options for the vehicle using other input values.\";\n String VEHICLE_YEAR = \"Identifies the year in which the vehicle was manufactured. This is an optional parameter unless VIN is not specified.\";\n String VEHICLE_MAKE = \"Identifies the vehicle make. This is an optional parameter unless VIN is not specified.\";\n String VEHICLE_MODEL = \"Identifies the vehicle model. This is an optional parameter unless VIN is not specified.\";\n String VEHICLE_TRIM = \"Identifies the vehicle trim. If you submit a VIN that returns multiple style ids, you can specify a trim to focus the response on one style id.\";\n String VEHICLE_BODY_STYLE = \"Identifies the vehicle body style to install on the vehicle.\";\n String VEHICLE_ENGINE = \"Identifies the vehicle engine code to install on the vehicle.\";\n String VEHICLE_TRANS = \"Identifies the vehicle transmission to install on the vehicle.\";\n String VEHICLE_EXT_COLOR = \"Identifies the vehicle's exterior color to install on the vehicle.\";\n String VEHICLE_INT_COLOR = \"Identifies the vehicle's interior color to install on the vehicle.\";\n String LIST_OPTIONS = \"Identifies a list of vehicle options to install on the vehicle.\";\n String LIST_UNSTRUCTURED = \"Identifies unstructured text that is mapped to the vehicle features you want installed on the vehicle.\";\n\n String INCLUDE_DEBUG_INFO = \"Include debug information in the response object\";\n String INCLUDE_SUPPORT_INFO = \"Include support information in the response object\";\n\n String LANGUAGE = \"Language\";\n\n String GET_WS_VERSION = \"Get the version of the web service\";\n String GET_WS_HEALTH = \"Check the health of the services\";\n String GET_WS_CONNECTION = \"Get the status of micro service connections\";\n\n String WS_RESPONSE_ID = \"Displays a unique identifier of the web service response.\";\n String WS_DATE_TIME = \"Displays the date and time on the server when the request was made.\";\n\n String WS_MESSAGE = \"Displays messages from the server.\";\n String WS_ERROR = \"Identifies whether an error occurred with the request.\";\n String EXECUTION_TIME = \"Displays the execution time of the request in milliseconds.\";\n String WS_DEBUG_INFO = \"Displays debug information.\";\n String WS_SUPPORT_INFO = \"Displays support information.\";\n String WS_RESULT = \"Displays the web service results.\";\n String WS_EXECUTION_DETAILS = \"Displays Akana related billing informations.\";\n String WS_COPYRIGHT = \"Displays the copywrite message.\";\n\n}", "Map<String, Object> swagger();", "@SwaggerDefinition(info = @Info(description = \"Ampula API \", version = \"1.0.0\", title = \"Ampula API\"),\n produces = MediaType.APPLICATION_JSON_UTF8_VALUE,\n schemes = SwaggerDefinition.Scheme.HTTPS\n)\n@Api(tags = \"Doctor Service\", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, protocols = \"https\")\n@RequestMapping(value = \"api/doctor/\")\npublic interface DoctorEndpoint {\n\n @ApiOperation(value = \"Add new doctor\")\n @ApiResponses({\n @ApiResponse(code = 200, message = \"OK\")\n })\n @RequestMapping(value = \"/add\", method = RequestMethod.POST)\n GeneralResponse<Long> addNewDoctor(GeneralRequest<Void, CreateDoctorRequest> request);\n\n\n @ApiOperation(value = \"Fire a doctor\")\n @ApiResponses({\n @ApiResponse(code = 200, message = \"OK\"),\n @ApiResponse(code = 500, message = \"Server error\", response = GeneralErrorResponse.class)\n })\n @RequestMapping(value = \"/delete\", method = RequestMethod.DELETE)\n GeneralResponse<Void> deleteDoctor(Long doctor_id);\n\n\n @ApiOperation(value = \"Update doctor data\")\n @ApiResponses({\n @ApiResponse(code = 200, message = \"OK\"),\n @ApiResponse(code = 500, message = \"Server error\", response = GeneralErrorResponse.class)\n })\n @RequestMapping(value = \"/update\", method = RequestMethod.POST)\n GeneralResponse<Void> updateDoctorData(GeneralRequest<Long, UpdateDoctorRequest> request);\n\n\n @ApiOperation(value = \"Get doctor data by ID\")\n @ApiResponses({\n @ApiResponse(code = 200, message = \"OK\"),\n @ApiResponse(code = 500, message = \"Server error\", response = GeneralErrorResponse.class)\n })\n @RequestMapping(value = \"/get\", method = RequestMethod.GET)\n GeneralResponse<DoctorDTO> getDoctor(Long doctor_id);\n\n\n @ApiOperation(value = \"Get all doctor's patients\")\n @ApiResponses({\n @ApiResponse(code = 200, message = \"OK\"),\n @ApiResponse(code = 500, message = \"Server error\", response = GeneralErrorResponse.class)\n })\n @RequestMapping(value = \"/get/all/patients\", method = RequestMethod.GET)\n GeneralResponse<List<CardDTO>> getAllPatients(Long doctor_id);\n\n\n @ApiOperation(value = \"Get all doctors\")\n @ApiResponses({\n @ApiResponse(code = 200, message = \"OK\")\n })\n @RequestMapping(value = \"/get/all\", method = RequestMethod.GET)\n GeneralResponse<List<DoctorDTO>> getAll();\n\n\n}", "@Path(\"property\")\n@Tag(name = \"Property\", description = \"This endpoint is used for sharing properties between different data\")\npublic interface PropertyControllerDefinition extends IPropertyControllerJaxRS {\n\n @Override\n @Operation(summary = \"Get JSON\", description = \"GET a JSON document.\")\n String getJsonConfiguration(String name) throws RemoteException;\n\n @Override\n @Operation(summary = \"Save JSON\", description = \"Saves a JSON document.\")\n void setJsonConfiguration(String name, String json) throws RemoteException;\n\n @Override\n @Operation(summary = \"Get Property\", description = \"Gets property's value\")\n String getProperty(String name) throws RemoteException;\n\n @Override\n @Operation(summary = \"Set Property\", description = \"Updates the property's value\")\n void setProperty(String name, String value) throws RemoteException;\n\n @Override\n @Operation(summary = \"Get Properties\", description = \"Gets all properties as key / value pairs.\")\n Map<String, String> getProperties() throws RemoteException;\n\n @Override\n @Operation(summary = \"Get Properties\", description = \"Gets properties as key / value pairs of specified properties.\")\n Map<String, String> getProperties(String[] names) throws RemoteException;\n\n @Override\n @Operation(summary = \"Set Properties\", description = \"Updates the values of multiple properties.\")\n void setProperties(Map<String, String> values) throws RemoteException;\n\n @Override\n @Operation(summary = \"Get Principal\", description = \"Returns user's principal used by front-ends for queries or to determine what to display.\")\n ICoalescePrincipal whoami();\n}", "@Bean\n public OpenAPI openApi() {\n return new OpenAPI()\n .info(new Info()\n .title(\"EU Digital COVID Certificate Business Rule Service\")\n .description(\"The API defines how to exchange business rule information for \"\n + \"the EU digital COVID certificates.\")\n .version(buildProperties.getVersion())\n .license(new License()\n .name(\"Apache 2.0\")\n .url(\"https://www.apache.org/licenses/LICENSE-2.0\")));\n }", "public Docket api( ) {\r\n\t\t return new Docket(DocumentationType.SWAGGER_2)\r\n\t .select()\r\n\t .apis(RequestHandlerSelectors.any())\r\n\t .paths(regex(\"/.*\"))\r\n\t .build().apiInfo(apiInfo());\r\n\t}", "@Bean\n public Docket swaggerUserApi() {\n return new Docket(DocumentationType.SWAGGER_2)\n .groupName(\"yogurt v1\")\n .select()\n .apis(RequestHandlerSelectors.basePackage(\"com.yogurt.controller.v1.ap1\"))\n .paths(PathSelectors.any())\n .build()\n .apiInfo(apiInfo())\n .securitySchemes(Arrays.asList(apiKey()));\n }", "@Path(\"/providers/Microsoft.Compute/locations/{location}\")\n@RequestFilters({ OAuthFilter.class, ApiVersionFilter.class })\n@Consumes(APPLICATION_JSON)\npublic interface OSImageApi {\n\n /**\n * List Publishers in location\n */\n @Named(\"publisher:list\")\n @GET\n @Path(\"/publishers\")\n @Fallback(EmptyListOnNotFoundOr404.class)\n List<Publisher> listPublishers();\n\n /**\n * List Offers in publisher\n */\n @Named(\"offer:list\")\n @GET\n @Path(\"/publishers/{publisher}/artifacttypes/vmimage/offers\")\n @Fallback(EmptyListOnNotFoundOr404.class)\n List<Offer> listOffers(@PathParam(\"publisher\") String publisher);\n\n /**\n * List SKUs in offer\n */\n @Named(\"sku:list\")\n @GET\n @Path(\"/publishers/{publisher}/artifacttypes/vmimage/offers/{offer}/skus\")\n @Fallback(EmptyListOnNotFoundOr404.class)\n List<SKU> listSKUs(@PathParam(\"publisher\") String publisher, @PathParam(\"offer\") String offer);\n\n /**\n * List Versions in SKU\n */\n @Named(\"version:list\")\n @GET\n @Path(\"/publishers/{publisher}/artifacttypes/vmimage/offers/{offer}/skus/{sku}/versions\")\n @Fallback(EmptyListOnNotFoundOr404.class)\n List<Version> listVersions(@PathParam(\"publisher\") String publisher, @PathParam(\"offer\") String offer,\n @PathParam(\"sku\") String sku);\n \n /**\n * Get the details of a Version\n */\n @Named(\"version:get\")\n @GET\n @Path(\"/publishers/{publisher}/artifacttypes/vmimage/offers/{offer}/skus/{sku}/versions/{version}\")\n @Fallback(EmptyListOnNotFoundOr404.class)\n Version getVersion(@PathParam(\"publisher\") String publisher, @PathParam(\"offer\") String offer,\n @PathParam(\"sku\") String sku, @PathParam(\"version\") String version);\n\n}", "@Bean\n public Docket api() {\n AuthorizationScope[] authScopes = new AuthorizationScope[1];\n authScopes[0] = new AuthorizationScopeBuilder().scope(\"require_auth\")\n .description(\"Scope that requires authorized access\").build();\n SecurityReference securityReference =\n SecurityReference.builder().reference(\"default\").scopes(authScopes).build();\n List<SecurityContext> securityContexts = Arrays.asList(\n (SecurityContext.builder().securityReferences(Arrays.asList((securityReference))).build()));\n\n // Docket\n return new Docket(DocumentationType.SWAGGER_2)\n .directModelSubstitute(LocalDate.class, java.sql.Date.class)\n .directModelSubstitute(OffsetDateTime.class, java.util.Date.class)\n .consumes(\n Sets.newHashSet(MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE))\n .produces(\n Sets.newHashSet(MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE))\n .securitySchemes(Arrays.asList((new BasicAuth(securityReference.getReference()))))\n .securityContexts(securityContexts).select().apis(RequestHandlerSelectors.any())\n .paths(PathSelectors.any()).build();\n }", "public interface IApplicationWs {\n\n\tString INSTANCE_PATH_PREFIX = \"/instance/\";\n\tString OPTIONAL_INSTANCE_PATH = \"{instancePath:(\" + INSTANCE_PATH_PREFIX + \"[^/]+?)?}\";\n\tString PATH = \"/\" + UrlConstants.APP + \"/{name}\";\n\n\n\t/**\n\t * Performs an action on an instance of an application.\n\t * @param applicationName the application name\n\t * @param action see {@link ApplicationAction}\n\t * @param instancePath the instance path (optional, null to consider the application as the root)\n\t * @param applyToAllChildren only makes sense when instancePath is not null\n\t * <p>\n\t * True to apply this action to all the children too, false to apply it only to this instance.\n\t * </p>\n\t *\n\t * @return a response\n\t */\n\t@POST\n\t@Path( \"/{action}\" + OPTIONAL_INSTANCE_PATH )\n\t@Produces( MediaType.APPLICATION_JSON )\n\tResponse perform( @PathParam(\"name\") String applicationName, @PathParam(\"action\") String action, @PathParam(\"instancePath\") String instancePath, boolean applyToAllChildren );\n\n\n\t/**\n\t * Adds a new instance.\n\t * @param applicationName the application name\n\t * @param parentInstancePath the path of the parent instance (optional, null to consider the application as the root)\n\t * @param instance the new instance\n\t * @return a response\n\t */\n\t@POST\n\t@Path( \"/add\" + OPTIONAL_INSTANCE_PATH )\n\t@Produces( MediaType.APPLICATION_JSON )\n\tResponse addInstance( @PathParam(\"name\") String applicationName, @PathParam(\"instancePath\") String parentInstancePath, Instance instance );\n\n\n\t/**\n\t * Lists the paths of the children of an instance.\n\t * @param applicationName the application name\n\t * @param instancePath the instance path (optional, null to consider the application as the root)\n\t * @return a non-null list\n\t */\n\t@GET\n\t@Path( \"/children\" + OPTIONAL_INSTANCE_PATH )\n\t@Produces( MediaType.APPLICATION_JSON )\n\tList<Instance> listChildrenInstances( @PathParam(\"name\") String applicationName, @PathParam(\"instancePath\") String instancePath );\n\n\n\t/**\n\t * Lists the paths of the children of an instance.\n\t * @param applicationName the application name\n\t * @param instancePath the instance path (optional, null to consider the application as the root)\n\t * @return a non-null list\n\t */\n\t@GET\n\t@Path( \"/all-children\" + OPTIONAL_INSTANCE_PATH )\n\t@Produces( MediaType.APPLICATION_JSON )\n\tList<Instance> listAllChildrenInstances( @PathParam(\"name\") String applicationName, @PathParam(\"instancePath\") String instancePath );\n\n\n\t/**\n\t * Finds possible components under a given instance.\n\t * <p>\n\t * This method answers the question: what can we deploy on this instance?\n\t * </p>\n\t *\n\t * @param applicationName the application name\n\t * @param instancePath the instance path (optional, null to consider the application as the root)\n\t * @return a non-null list of components names\n\t */\n\t@GET\n\t@Path( \"/possibilities\" + OPTIONAL_INSTANCE_PATH )\n\t@Produces( MediaType.APPLICATION_JSON )\n\tList<Component> findPossibleComponentChildren( @PathParam(\"name\") String applicationName, @PathParam(\"instancePath\") String instancePath );\n\n\n\t/**\n\t * Lists the available components in this application.\n\t * @param applicationName the application name\n\t * @return a non-null list of components\n\t */\n\t@GET\n\t@Path( \"/components\" )\n\t@Produces( MediaType.APPLICATION_JSON )\n\tList<Component> listComponents( @PathParam(\"name\") String applicationName );\n\n\n\t/**\n\t * Finds possible parent instances for a given component.\n\t * <p>\n\t * This method answers the question: where could I deploy such a component?\n\t * </p>\n\t *\n\t *\n\t * @param applicationName the application name\n\t * @return a non-null list of instances paths\n\t */\n\t@GET\n\t@Path(\"/component/{componentName}\")\n\t@Produces( MediaType.APPLICATION_JSON )\n\tList<String> findPossibleParentInstances( @PathParam(\"name\") String applicationName, @PathParam(\"componentName\") String componentName );\n\n\n\t/**\n\t * Creates an instance from a component name.\n\t * @param applicationName the application name\n\t * @return a response\n\t */\n\t@GET\n\t@Path(\"/component/{componentName}/new\")\n\t@Produces( MediaType.APPLICATION_JSON )\n\tInstance createInstanceFromComponent( @PathParam(\"name\") String applicationName, @PathParam(\"componentName\") String componentName );\n}", "@WebService(name = \"publish_portype\", targetNamespace = \"http://middleware.intra.bc/api/services/pubsub/push\")\n@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)\n@XmlSeeAlso({\n bc.intra.middleware.api.schema.fault.ObjectFactory.class,\n bc.intra.middleware.api.schema.pubsub.ObjectFactory.class,\n bc.intra.middleware.api.services.pubsub.push.ObjectFactory.class\n})\npublic interface PublishPortype {\n\n\n /**\n * \n * @param parameters\n * @return\n * returns bc.intra.middleware.api.services.pubsub.push.PublishResponseType\n * @throws PublishFaultMessage\n */\n @WebMethod(operationName = \"Publish\", action = \"http://www.proximus.com/middleware/services/pubsub/Publish\")\n @WebResult(name = \"PublishResponse\", targetNamespace = \"http://middleware.intra.bc/api/services/pubsub/push\", partName = \"parameters\")\n public PublishResponseType publish(\n @WebParam(name = \"PublishRequest\", targetNamespace = \"http://middleware.intra.bc/api/services/pubsub/push\", partName = \"parameters\")\n PublishRequestType parameters)\n throws PublishFaultMessage\n ;\n\n}", "SourceBuilder createRestController();", "void configureEndpoint(Endpoint endpoint);", "interface WithPrivateEndpoint {\n /**\n * Specifies privateEndpoint.\n * @param privateEndpoint The resource of private end point\n * @return the next update stage\n */\n Update withPrivateEndpoint(PrivateEndpointInner privateEndpoint);\n }", "public interface IControllerDocBuilder {\n\n /**\n * build api docs and return as string\n *\n * @param controllerNode\n * @return\n */\n String buildDoc(ControllerNode controllerNode) throws IOException;\n\n}", "void publishMe();", "public interface ConfigurationServiceV1 {\n \n \n /**\n * Auto generated method signature\n * Documentation goes here.\n * @param getBSConfigRequest\n */\n\n \n public nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetBSConfigResponse getBSConfig\n (\n nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetBSConfigRequest getBSConfigRequest\n )\n ;\n \n \n /**\n * Auto generated method signature\n * Documentation goes here.\n * @param setServiceLocationRequest\n */\n\n \n public nl.tudelft.ewi.st.atlantis.tudelft.v1.services.SetServiceLocationResponse setServiceLocation\n (\n nl.tudelft.ewi.st.atlantis.tudelft.v1.services.SetServiceLocationRequest setServiceLocationRequest\n )\n ;\n \n \n /**\n * Auto generated method signature\n * Documentation goes here.\n * @param getOPSConfigRequest\n */\n\n \n public nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetOPSConfigResponse getOPSConfig\n (\n nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetOPSConfigRequest getOPSConfigRequest\n )\n ;\n \n \n /**\n * Auto generated method signature\n * Documentation goes here.\n * @param getClientConfigRequest\n */\n\n \n public nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetClientConfigResponse getClientConfig\n (\n nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetClientConfigRequest getClientConfigRequest\n )\n ;\n \n \n /**\n * Auto generated method signature\n * \n * @param getQSLocationsRequest\n */\n\n \n public nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetQSLocationsResponse getQSLocations\n (\n nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetQSLocationsRequest getQSLocationsRequest\n )\n ;\n \n \n /**\n * Auto generated method signature\n * Documentation goes here.\n * @param setClientToBSRequest\n */\n\n \n public nl.tudelft.ewi.st.atlantis.tudelft.v1.services.SetClientToBSResponse setClientToBS\n (\n nl.tudelft.ewi.st.atlantis.tudelft.v1.services.SetClientToBSRequest setClientToBSRequest\n )\n ;\n \n \n /**\n * Auto generated method signature\n * \n * @param getESLocationsRequest\n */\n\n \n public nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetESLocationsResponse getESLocations\n (\n nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetESLocationRequest getESLocationsRequest\n )\n ;\n \n \n /**\n * Auto generated method signature\n * Documentation goes here.\n * @param setBSToOPSRequest\n */\n\n \n public nl.tudelft.ewi.st.atlantis.tudelft.v1.services.SetBSToOPSResponse setBSToOPS\n (\n nl.tudelft.ewi.st.atlantis.tudelft.v1.services.SetBSToOPSRequest setBSToOPSRequest\n )\n ;\n \n \n /**\n * Auto generated method signature\n * Documentation goes here.\n * @param getBSLocationsRequest\n */\n\n \n public nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetBSLocationsResponse getBSLocations\n (\n nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetBSLocationsRequest getBSLocationsRequest\n )\n ;\n \n \n /**\n * Auto generated method signature\n * \n * @param getOPSLocationsRequest\n */\n\n \n public nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetOPSLocationsResponse getOPSLocations\n (\n nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetOPSLocationsRequest getOPSLocationsRequest\n )\n ;\n \n }", "public File transform(final Swagger swagger) throws Exception {\n\t\tapplication.getDoc().add(addDoc(swagger.getInfo().getTitle(), swagger.getInfo().getDescription()));\n\t\tResources resources = objectFactory.createResources();\n\t\tapplication.getResources().add(resources);\n\n\t\t/**\n\t\t * look for end point URL This is required for AI\n\t\t */\n\t\tString protocol = \"\";\n\n\t\tString baseURI = null;\n\t\tif (swagger.getHost() != null) {\n\t\t\tbaseURI = swagger.getHost();\n\t\t}\n\t\tif (null != baseURI && (!baseURI.contains(ParserConstants.http.toString()) || !baseURI.contains(ParserConstants.https.toString()))) {\n\t\t\tif (null != swagger.getSchemes() && swagger.getSchemes().size() > 0) {\n\t\t\t\tprotocol = swagger.getSchemes().get(0).toString() + \"://\";\n\t\t\t\tprotocol = protocol.toLowerCase();\n\t\t\t} else {\n\t\t\t\tprotocol = ParserConstants.http.value();\n\t\t\t}\n\t\t}\n\t\tString basePath = \"\";\n\t\tif (null != swagger.getBasePath() && !swagger.getBasePath().isEmpty()) {\n\t\t\tbasePath = swagger.getBasePath();\n\t\t}\n\n\t\tif (null != baseURI) {\n\t\t\tresources.setBase(protocol + baseURI + basePath);\n\t\t}\n\t\t\n\t\tif(null!=resources.getBase()){\n\t\t\tlogger.info(\"end point : \" + resources.getBase());\n\t\t}else{\n\t\t\tthrow new Exception(\"End point URL not present\");\n\t\t}\n\t\t/**\n\t\t * enumerates different parameters type such as headers,query\n\t\t */\n\t\tfor (Map.Entry<String, Path> path : swagger.getPaths().entrySet()) {\n\t\t\tResource resource = objectFactory.createResource();\n\t\t\tresource.setId(path.getKey().replace('/', '_').replace('{', '_').replace('}', '_'));\n\t\t\tresource.setPath(path.getKey());\n\n\t\t\tif (path.getValue().getParameters() != null) {\n\t\t\t\tfor (Parameter param : path.getValue().getParameters()) {\n\t\t\t\t\tParam params = objectFactory.createParam();\n\t\t\t\t\tparams.setName(param.getName());\n\t\t\t\t\tparams.getDoc().add(addDoc(param.getName(), param.getDescription()));\n\t\t\t\t\tparams.setStyle(ParamStyle.fromValue(param.getIn()));\n\t\t\t\t\tparams.setRequired(param.getRequired());\n\t\t\t\t\tparams.setType(new QName(\"\"));\n\t\t\t\t\tresource.getParam().add(params);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * check for operation name, resource base etc.\n\t\t\t */\n\t\t\tfor (Entry<HttpMethod, Operation> op : path.getValue().getOperationMap().entrySet()) {\n\t\t\t\tMethod method = objectFactory.createMethod();\n\t\t\t\tmethod.getDoc().add(addDoc(op.getValue().getOperationId(), op.getValue().getSummary()));\n\t\t\t\tmethod.setId(op.getValue().getOperationId());\n\t\t\t\tmethod.setName(op.getKey().name().toUpperCase());\n\n\t\t\t\tRequest req = objectFactory.createRequest();\n\t\t\t\t/**\n\t\t\t\t * check tyoe of request, namespace etc.\n\t\t\t\t */\n\t\t\t\tif (op.getValue().getConsumes() != null) {\n\t\t\t\t\tfor (String mime : op.getValue().getConsumes()) {\n\t\t\t\t\t\tRepresentation representation = objectFactory.createRepresentation();\n\t\t\t\t\t\trepresentation.setElement(new QName(ParserConstants.tns_prefix.value() + path.getKey()));\n\t\t\t\t\t\trepresentation.setMediaType(mime);\n\t\t\t\t\t\treq.getRepresentation().add(representation);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (op.getValue().getParameters() != null) {\n\t\t\t\t\tfor (Parameter param : op.getValue().getParameters()) {\n\t\t\t\t\t\tParam parameter = null;\n\t\t\t\t\t\tparameter = objectFactory.createParam();\n\t\t\t\t\t\tparameter.setName(param.getName());\n\t\t\t\t\t\tparameter.getDoc().add(addDoc(param.getName(), param.getDescription()));\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * check input parameter type like header, query etc.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (null != param.getIn() && (param.getIn().equalsIgnoreCase(ParserConstants.query.toString())\n\t\t\t\t\t\t\t\t|| param.getIn().equalsIgnoreCase(ParserConstants.header.toString())\n\t\t\t\t\t\t\t\t|| param.getIn().equalsIgnoreCase(ParserConstants.template.toString())\n\t\t\t\t\t\t\t\t|| param.getIn().equalsIgnoreCase(ParserConstants.matrix.toString())\n\t\t\t\t\t\t\t\t|| param.getIn().equalsIgnoreCase(ParserConstants.plain.toString()))) {\n\t\t\t\t\t\t\tparameter.setStyle(ParamStyle.fromValue(param.getIn()));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tparameter.setRequired(param.getRequired());\n\t\t\t\t\t\tparameter.setType(new QName(\"\"));\n\t\t\t\t\t\treq.getParam().add(parameter);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//set the request\n\t\t\t\tmethod.setRequest(req);\n\n\t\t\t\t//set the response\n\t\t\t\tResponse res = objectFactory.createResponse();\n\t\t\t\tfor (String mime : op.getValue().getProduces()) {\n\t\t\t\t\tRepresentation representation = objectFactory.createRepresentation();\n\t\t\t\t\trepresentation.setElement(new QName(ParserConstants.tns_prefix.value() + path.getKey()));\n\t\t\t\t\trepresentation.setMediaType(mime);\n\t\t\t\t\tres.getRepresentation().add(representation);\n\t\t\t\t}\n\t\t\t\tfor (Entry<String, io.swagger.models.Response> response : op.getValue().getResponses().entrySet()) {\n\t\t\t\t\tres.getDoc().add(addDoc(response.getKey(), response.getValue().getDescription()));\n\t\t\t\t}\n\t\t\t\tmethod.getResponse().add(res);\n\t\t\t\tresource.getMethodOrResource().add(method);\n\t\t\t}\n\t\t\tresources.getResource().add(resource);\n\t\t}\n\n\t\tfor (Entry<String, Model> def : swagger.getDefinitions().entrySet()) {\n\t\t\tif (null != def.getValue().getProperties())\n\t\t\t\tschema.appendChild(js2wadl(def.getKey(), def.getValue().getProperties()));\n\t\t}\n\n\t\t/**\n\t\t * by default store the converted swagger into file\n\t\t */\n\t\tJAXBContext jaxbContext = JAXBContext.newInstance(ParserConstants.jaxb_tns.value());\n\t\tMarshaller marshaller = jaxbContext.createMarshaller();\n\t\tmarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, new Boolean(true));\n\t\tFile file = new File(ParserConstants.File_Name.value());\n\t\tmarshaller.marshal(application, file);\n\t\treturn file;\n\t}", "UMOImmutableEndpoint createResponseEndpoint(UMOEndpointBuilder builder, UMOManagementContext managementContext) throws UMOException;", "public abstract Endpoint createEndpoint(String bindingId, Object implementor);", "UMOImmutableEndpoint createOutboundEndpoint(UMOEndpointBuilder builder, UMOManagementContext managementContext) throws UMOException;", "@WebMethod\n URI exposeEndpoint(Endpoint endpoint);", "public interface IEndpoint\n{\n @GET(Contract.PATH_POPULAR_MOVIE)\n Call<MovieResponse> getPopularMovies(@Query(\"api_key\") String apiKey);\n\n @GET(Contract.PATH_TOP_RATED_MOVIE)\n Call<MovieResponse> getTopRatedMovies(@Query(\"api_key\") String apiKey);\n\n @GET(\"movie/{id}/videos\")\n Call<MovieTrailer> getMovieTrailer(@Path(\"id\") int id,\n @Query(\"api_key\") String apiKey);\n\n @GET(\"movie/{id}/reviews\")\n Call<MovieReview> getMovieReview(@Path(\"id\") int id,\n @Query(\"api_key\") String apiKey);\n\n @GET(Contract.SIZE_MOBILE + \"{posterImagePath}\")\n Call<ResponseBody> getPosterImage(\n @Path(value = \"posterImagePath\", encoded = true)\n String posterImagePath);\n\n @GET(\"w780{backdropImagePath}\")\n Call<ResponseBody> getBackdropImage(\n @Path(value = \"backdropImagePath\", encoded = true)\n String backdropImagePath);\n}", "GeneratedInterface generate(Class interfaze, String targetNamespace, String wsdlLocation, String serviceName, String portName) throws Fabric3Exception;", "@Bean\n\tpublic Docket customDocket() {\n\n\t\t//Docket aDocket = new Docket(DocumentationType.SWAGGER_2).host(\"120.79.76.25\");\n\t\tDocket aDocket = new Docket(DocumentationType.SWAGGER_2);\n\n\t\tContact authorContact = new Contact(\"WindRanger\", \"\", \"[email protected]\");\n\t\tApiInfo apiInfo = new ApiInfo(\"Sz91online WindRanger API Document\",\n\t\t\t\t\"本文档描述前台与后台的交互方式、接口和数据。 <br/>后台目前只提供JSON方式数据,http返回请求中的content为json内容,内容只包含业务数据,不包含类似result_code之类的非业务数据。\"\n\t\t\t\t\t\t+ \"非业务数据通过http header返回,如果header中未包含return_code,表示http请求处理正常,否则取return_code作相应的提示。提示的内容取return_msg,return_msg是URLEncode后的中文字符串,使用前需还原。<br/>\"\n\t\t\t\t\t\t+ \"通用错误代码列表:<br/>\" + EBusinessException.MIS_PARAMETER_ERROR + \":缺少必要参数<br/>\" + \"\",\n\t\t\t\t\"V1.0\", \"\", authorContact, \"\", \"\");\n\t\taDocket.apiInfo(apiInfo);\n\n\t\treturn aDocket;\n\t}", "@Bean\n public Jaxb2Marshaller jaxb2Marshaller(){\n Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller();\n jaxb2Marshaller.setContextPath(\"hellios.wsdl\");\n return jaxb2Marshaller;\n }", "public interface ProductService extends Service {\n\n\t/**\n\t * Example: curl http://localhost:9000/api/product/Alice\n\t */\n\tServiceCall<NotUsed, String> product(String id);\n\n\t/**\n\t * Example: curl -H \"Content-Type: application/json\" -X POST -d '{\"message\":\n\t * \"Hi\"}' http://localhost:9000/api/product/Alice\n\t */\n\tServiceCall<Product, NotUsed> create();\n\n\t@Override\n\tdefault Descriptor descriptor() {\n\t\t// @formatter:off\n\t\treturn named(\"product\")\n\t\t\t\t.withCalls(pathCall(\"/api/product/:id\", this::product), pathCall(\"/api/product\", this::create))\n\t\t\t\t.withAutoAcl(true);\n\t\t// @formatter:on\n\t}\n}", "@Bean\n public Jaxb2Marshaller marshaller() {\n Jaxb2Marshaller marshaller = new Jaxb2Marshaller();\n // this package must match the package in the <generatePackage>\n // specified in pom.xml\n marshaller.setContextPath(CONTEXT_PATH);\n return marshaller;\n }", "void publish();", "@PayEntryGenerator(\n packageName = \"example.loo.com.fastec\",\n payEntryTemplate = WXPayEntryTemplate.class\n)\npublic interface WeChatPayEntry {\n}", "springfox.documentation.schema.Model create(ModelContext context);", "public interface ShortUrlApi {\n\n @POST(\"shorturl\")\n @Converter(ShortUrlConverter.class)\n Call<String> shortUrl(@Body String longUrl,@Query(\"access_token\")String accessToken);\n\n class ShortUrlConverter extends JacksonConverter<String,String> {\n @Override\n public byte[] request(ObjectMapper mapper, Type type, String longUrl) throws IOException {\n return String.format(\"{\\\"action\\\":\\\"long2short\\\",\\\"long_url”:”%s”}\",longUrl).getBytes(CHARSET_UTF8);\n }\n\n @Override\n public String response(ObjectMapper mapper, Type type, byte[] response) throws IOException {\n JsonNode jsonNode = mapper.readTree(response);\n return jsonNode.path(\"short_url\").asText();\n }\n }\n}", "@FeignClient(name=\"service-ribbon\")\npublic interface ConsumerController {\n\n\t@PostMapping(value = \"/registerTeacher\")\n\tString hello(@RequestParam(value = \"name\") String name);\n}", "@Path(\"/api/khy\")\n@Produces(\"application/json\")\npublic interface LegaliteDysRESTApis {\n\n @POST\n @Consumes(\"application/json\")\n @Produces(\"application/json\")\n @Path(\"/belge-durum-guncelle\")\n SimpleResponse belgeDurumGuncelle(BelgeDurumuModel belgeDurum);\n\n @POST\n @Consumes(\"application/json\")\n @Produces(\"application/json\")\n @Path(\"/belge-al\")\n SimpleResponse belgeGonder(BelgeAlRestModel request);\n}", "interface PrivateEndpointConnectionsService {\n @Headers({ \"Content-Type: application/json; charset=utf-8\", \"x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_04_01_preview.PrivateEndpointConnections get\" })\n @GET(\"subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}\")\n Observable<Response<ResponseBody>> get(@Path(\"subscriptionId\") String subscriptionId, @Path(\"resourceGroupName\") String resourceGroupName, @Path(\"parentType\") String parentType, @Path(\"parentName\") String parentName, @Path(\"privateEndpointConnectionName\") String privateEndpointConnectionName, @Query(\"api-version\") String apiVersion, @Header(\"accept-language\") String acceptLanguage, @Header(\"User-Agent\") String userAgent);\n\n @Headers({ \"Content-Type: application/json; charset=utf-8\", \"x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_04_01_preview.PrivateEndpointConnections update\" })\n @PUT(\"subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}\")\n Observable<Response<ResponseBody>> update(@Path(\"subscriptionId\") String subscriptionId, @Path(\"resourceGroupName\") String resourceGroupName, @Path(\"parentType\") String parentType, @Path(\"parentName\") String parentName, @Path(\"privateEndpointConnectionName\") String privateEndpointConnectionName, @Body PrivateEndpointConnectionInner privateEndpointConnection, @Query(\"api-version\") String apiVersion, @Header(\"accept-language\") String acceptLanguage, @Header(\"User-Agent\") String userAgent);\n\n @Headers({ \"Content-Type: application/json; charset=utf-8\", \"x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_04_01_preview.PrivateEndpointConnections beginUpdate\" })\n @PUT(\"subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}\")\n Observable<Response<ResponseBody>> beginUpdate(@Path(\"subscriptionId\") String subscriptionId, @Path(\"resourceGroupName\") String resourceGroupName, @Path(\"parentType\") String parentType, @Path(\"parentName\") String parentName, @Path(\"privateEndpointConnectionName\") String privateEndpointConnectionName, @Body PrivateEndpointConnectionInner privateEndpointConnection, @Query(\"api-version\") String apiVersion, @Header(\"accept-language\") String acceptLanguage, @Header(\"User-Agent\") String userAgent);\n\n @Headers({ \"Content-Type: application/json; charset=utf-8\", \"x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_04_01_preview.PrivateEndpointConnections delete\" })\n @HTTP(path = \"subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}\", method = \"DELETE\", hasBody = true)\n Observable<Response<ResponseBody>> delete(@Path(\"subscriptionId\") String subscriptionId, @Path(\"resourceGroupName\") String resourceGroupName, @Path(\"parentType\") String parentType, @Path(\"parentName\") String parentName, @Path(\"privateEndpointConnectionName\") String privateEndpointConnectionName, @Query(\"api-version\") String apiVersion, @Header(\"accept-language\") String acceptLanguage, @Header(\"User-Agent\") String userAgent);\n\n @Headers({ \"Content-Type: application/json; charset=utf-8\", \"x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_04_01_preview.PrivateEndpointConnections beginDelete\" })\n @HTTP(path = \"subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}\", method = \"DELETE\", hasBody = true)\n Observable<Response<ResponseBody>> beginDelete(@Path(\"subscriptionId\") String subscriptionId, @Path(\"resourceGroupName\") String resourceGroupName, @Path(\"parentType\") String parentType, @Path(\"parentName\") String parentName, @Path(\"privateEndpointConnectionName\") String privateEndpointConnectionName, @Query(\"api-version\") String apiVersion, @Header(\"accept-language\") String acceptLanguage, @Header(\"User-Agent\") String userAgent);\n\n @Headers({ \"Content-Type: application/json; charset=utf-8\", \"x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_04_01_preview.PrivateEndpointConnections listByResource\" })\n @GET(\"subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections\")\n Observable<Response<ResponseBody>> listByResource(@Path(\"subscriptionId\") String subscriptionId, @Path(\"resourceGroupName\") String resourceGroupName, @Path(\"parentType\") String parentType, @Path(\"parentName\") String parentName, @Query(\"api-version\") String apiVersion, @Query(\"$filter\") String filter, @Query(\"$top\") Integer top, @Header(\"accept-language\") String acceptLanguage, @Header(\"User-Agent\") String userAgent);\n\n @Headers({ \"Content-Type: application/json; charset=utf-8\", \"x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2020_04_01_preview.PrivateEndpointConnections listByResourceNext\" })\n @GET\n Observable<Response<ResponseBody>> listByResourceNext(@Url String nextUrl, @Header(\"accept-language\") String acceptLanguage, @Header(\"User-Agent\") String userAgent);\n\n }", "interface SensorOutputAPI {\n /**\n * Get the outputs of the device\n *\n * @param device the device\n *\n * @return the outputs\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getDeviceSensorOutputs/{device}\")\n List<JsonSensorOutput> byDevice(@PathParam(\"device\") int device);\n }", "ServiceEndpointPolicy.DefinitionStages.Blank define(String name);", "OAuth2AuthorizationEndpointConfigurer(ObjectPostProcessor<Object> objectPostProcessor) {\n\t\tsuper(objectPostProcessor);\n\t}", "public interface EmployeeResource {\n\n /**\n * Retrieves the {@link Employee} resource by id.\n *\n * @param id employee id.\n * @return {@link Employee} resource.\n */\n @GetMapping(value = \"/v1/bfs/employees/{id}\", produces = MediaType.APPLICATION_JSON_VALUE)\n ResponseEntity<Employee> employeeGetById(@PathVariable(\"id\") String id) throws EmployeeNotFoundException;\n\n // ----------------------------------------------------------\n // TODO - add a new operation for creating employee resource.\n // ----------------------------------------------------------\n \n\t/**\n * Inserts employee record.\n * \n * @Valid annotation helps to validate \n * the javax validations on the employee POJO\n *\n * @param uuid the uuid\n * @param employee the employee\n * @return the response entity\n * @throws BadRequestException the bad request exception\n */\n @PostMapping(value = \"/v1/bfs/employees\", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)\n ResponseEntity<Employee> insertEmployee(\n \t\t@RequestHeader String uuid,\n \t\t@Valid @RequestBody Employee employee) throws BadRequestException;\n}", "public Endpoint createAndPublishEndpoint(String address, Object implementor,\n WebServiceFeature... features) {\n throw new UnsupportedOperationException(\n \"JAX-WS 2.2 implementation must override this default behaviour.\");\n }", "public interface SensorAPI {\n\n /**\n * Get the sensor output API.\n *\n * @return the API\n */\n @Path(\"sensorOutputs\")\n SensorOutputAPI sensorOutputs();\n\n /**\n * Get the device API.\n *\n * @return the API\n */\n @Path(\"device\")\n DeviceAPI devices();\n\n /**\n * Get the platform API.\n *\n * @return the API\n */\n @Path(\"platforms\")\n PlatformAPI platforms();\n\n /**\n * JAX-RS interface for the sensor output resource.\n */\n interface SensorOutputAPI {\n /**\n * Get the outputs of the device\n *\n * @param device the device\n *\n * @return the outputs\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getDeviceSensorOutputs/{device}\")\n List<JsonSensorOutput> byDevice(@PathParam(\"device\") int device);\n }\n\n /**\n * JAX-RS interface for the device resource.\n */\n interface DeviceAPI {\n /**\n * Get the children of the device.\n *\n * @param device the device\n *\n * @return the children\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getChildrenOfDevice/{device}\")\n List<JsonDevice> childrenOf(@PathParam(\"device\") int device);\n\n /**\n * Get the SensorML description of the device.\n *\n * @param id the id\n *\n * @return the SensorML description\n */\n @GET\n @Produces(MediaType.APPLICATION_XML)\n @Path(\"getDeviceAsSensorML/{device}\")\n String getSensorML(@PathParam(\"device\") int id);\n\n /**\n * Get the list of all devices.\n *\n * @return the devices\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getAllActiveDevicesFast\")\n List<JsonDevice> all();\n\n /**\n * Get the device.\n *\n * @param device the id\n *\n * @return the device\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getDevice/{device}\")\n JsonDevice byId(@PathParam(\"device\") int device);\n\n /**\n * Get all device categories.\n *\n * @return the device categories\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getAllDeviceCategories\")\n List<JsonType> types();\n\n /**\n * Get the device.\n *\n * @param urn the URN\n *\n * @return the device\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getDeviceByUrn/{urn}\")\n JsonDevice byURN(@PathParam(\"urn\") String urn);\n }\n\n /**\n * JAX-RS interface for the platform resource.\n */\n interface PlatformAPI {\n /**\n * Get all platforms.\n *\n * @return the platforms\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getAllRootItems\")\n List<JsonDevice> all();\n\n /**\n * Get all platform types.\n *\n * @return the platform types\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getAllPlatformTypes\")\n List<JsonType> types();\n }\n\n}", "public static void main( String[] args )\n {\n Endpoint.publish(\"http://localhost:9999/ws/saldo\", new SaldoServiceImpl());\n Endpoint.publish(\"http://localhost:9999/ws/chocolate\", new ChocolateServiceImpl());\n Endpoint.publish(\"http://localhost:9999/ws/request\", new RequestServiceImpl());\n Endpoint.publish(\"http://localhost:9999/ws/ingredients\", new IngredientsServiceImpl());\n }", "API createAPI();", "@Bean\n public GroupedOpenApi pushApiGroup() {\n String[] packages = {\"io.getlime.push.controller.rest\"};\n\n return GroupedOpenApi.builder()\n .group(\"push\")\n .packagesToScan(packages)\n .build();\n }", "@GetMapping(value=\"/person/produces\", produces=\"application/vnd.company.app-v1+json\")\n public PersonV1 producesV1() {\n return new PersonV1(\"Bob Charlie\");\n }", "@MessagingGateway(defaultRequestChannel = \"eventOutput\")\ninterface EventWriter {\n\n @Gateway(requestChannel = \"eventOutput\")\n void writeEvent(Event event);\n}", "interface ExportConfigurationsService {\n @Headers({ \"Content-Type: application/json; charset=utf-8\", \"x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.ExportConfigurations list\" })\n @GET(\"subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration\")\n Observable<Response<ResponseBody>> list(@Path(\"resourceGroupName\") String resourceGroupName, @Path(\"subscriptionId\") String subscriptionId, @Path(\"resourceName\") String resourceName, @Query(\"api-version\") String apiVersion, @Header(\"accept-language\") String acceptLanguage, @Header(\"User-Agent\") String userAgent);\n\n @Headers({ \"Content-Type: application/json; charset=utf-8\", \"x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.ExportConfigurations create\" })\n @POST(\"subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration\")\n Observable<Response<ResponseBody>> create(@Path(\"resourceGroupName\") String resourceGroupName, @Path(\"subscriptionId\") String subscriptionId, @Path(\"resourceName\") String resourceName, @Query(\"api-version\") String apiVersion, @Body ApplicationInsightsComponentExportRequest exportProperties, @Header(\"accept-language\") String acceptLanguage, @Header(\"User-Agent\") String userAgent);\n\n @Headers({ \"Content-Type: application/json; charset=utf-8\", \"x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.ExportConfigurations delete\" })\n @HTTP(path = \"subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}\", method = \"DELETE\", hasBody = true)\n Observable<Response<ResponseBody>> delete(@Path(\"resourceGroupName\") String resourceGroupName, @Path(\"subscriptionId\") String subscriptionId, @Path(\"resourceName\") String resourceName, @Path(\"exportId\") String exportId, @Query(\"api-version\") String apiVersion, @Header(\"accept-language\") String acceptLanguage, @Header(\"User-Agent\") String userAgent);\n\n @Headers({ \"Content-Type: application/json; charset=utf-8\", \"x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.ExportConfigurations get\" })\n @GET(\"subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}\")\n Observable<Response<ResponseBody>> get(@Path(\"resourceGroupName\") String resourceGroupName, @Path(\"subscriptionId\") String subscriptionId, @Path(\"resourceName\") String resourceName, @Path(\"exportId\") String exportId, @Query(\"api-version\") String apiVersion, @Header(\"accept-language\") String acceptLanguage, @Header(\"User-Agent\") String userAgent);\n\n @Headers({ \"Content-Type: application/json; charset=utf-8\", \"x-ms-logging-context: com.microsoft.azure.management.applicationinsights.v2015_05_01.ExportConfigurations update\" })\n @PUT(\"subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}\")\n Observable<Response<ResponseBody>> update(@Path(\"resourceGroupName\") String resourceGroupName, @Path(\"subscriptionId\") String subscriptionId, @Path(\"resourceName\") String resourceName, @Path(\"exportId\") String exportId, @Query(\"api-version\") String apiVersion, @Body ApplicationInsightsComponentExportRequest exportProperties, @Header(\"accept-language\") String acceptLanguage, @Header(\"User-Agent\") String userAgent);\n\n }", "@Bean\n public GroupedOpenApi api() {\n return GroupedOpenApi.builder()\n .group(\"Product API\")\n .pathsToMatch(\"/Produits/**\", \"/AdminProduits/**\", \"/TriProduits/**\")\n .build();\n }", "public void generarDoc(){\n generarDocP();\n }", "@ApiScope\n@Component(modules={NetModule.class}, dependencies = {ApplicationComponent.class})\npublic interface ApiComponent {\n ProductService productService();\n String apiKey();\n Retrofit retrofit();\n}", "@Bean\n\t\tpublic OpenAPI openApi() {\n\t\t\treturn new OpenAPI()\n\t\t\t\t\t.components(new Components()\n\n\t\t\t\t\t\t\t//HTTP Basic, see: https://swagger.io/docs/specification/authentication/basic-authentication/\n\t\t\t\t\t\t\t.addSecuritySchemes(\"basicScheme\", new SecurityScheme()\n\t\t\t\t\t\t\t\t\t.type(SecurityScheme.Type.HTTP)\n\t\t\t\t\t\t\t\t\t.scheme(\"basic\")\n\t\t\t\t\t\t\t)\n\n\t\t\t\t\t\t\t//API Key, see: https://swagger.io/docs/specification/authentication/api-keys/\n\t\t\t\t\t\t\t.addSecuritySchemes(\"apiKeyScheme\", new SecurityScheme()\n\t\t\t\t\t\t\t\t\t.type(SecurityScheme.Type.APIKEY)\n\t\t\t\t\t\t\t\t\t.in(SecurityScheme.In.HEADER)\n\t\t\t\t\t\t\t\t\t.name(\"X-API-KEY\")\n\t\t\t\t\t\t\t)\n\n\t\t\t\t\t\t\t//OAuth 2.0, see: https://swagger.io/docs/specification/authentication/oauth2/\n\t\t\t\t\t\t\t.addSecuritySchemes(\"oAuthScheme\", new SecurityScheme()\n\t\t\t\t\t\t\t\t\t.type(SecurityScheme.Type.OAUTH2)\n\t\t\t\t\t\t\t\t\t.description(\"This API uses OAuth 2 with the implicit grant flow. [More info](https://api.example.com/docs/auth)\")\n\t\t\t\t\t\t\t\t\t.flows(new OAuthFlows()\n\t\t\t\t\t\t\t\t\t\t\t.implicit(new OAuthFlow()\n\t\t\t\t\t\t\t\t\t\t\t\t\t.authorizationUrl(\"https://api.example.com/oauth2/authorize\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.scopes(new Scopes()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addString(\"read_pets\", \"read your pets\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addString(\"write_pets\", \"modify pets in your account\")\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)\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t\t.addSecurityItem(new SecurityRequirement()\n\t\t\t\t\t\t\t.addList(\"basicScheme\")\n\t\t\t\t\t)\n\t\t\t\t\t.addSecurityItem(new SecurityRequirement()\n\t\t\t\t\t\t\t.addList(\"apiKeyScheme\")\n\t\t\t\t\t)\n\t\t\t\t\t.addSecurityItem(new SecurityRequirement()\n\t\t\t\t\t\t\t.addList(\"oAuthScheme\")\n\t\t\t\t\t)\n\t\t\t\t\t;\n\t\t}", "@Path(\"version\")\n@Consumes({ VersionRESTResource.MEDIA_TYPE_JSON_V })\n@Produces({ VersionRESTResource.MEDIA_TYPE_JSON_V })\n@Api(value = \"/version\", produces = \"application/vnd.health-v1+json\", consumes = \"application/vnd.health-v1+json\")\n@SwaggerDefinition(\n\t\tinfo = @Info(\n\t\t description = \"Provides the current version of this api.\",\n\t\t version = \"1.00.00-SNAPSHOT\",\n\t\t title = \"The Version API\",\n\t\t termsOfService = \"http://localhost:8180/bomc-swagger\",\n\t\t contact = @Contact(\n\t\t\t\tname = \"bomc\", \n\t\t\t\temail = \"[email protected]\", \n\t\t\t\turl = \"http://bomc.org\"\n\t\t ),\n\t\t license = @License(\n\t\t\t\tname = \"Apache 2.0\", \n\t\t\t\turl = \"http://www.apache.org/licenses/LICENSE-2.0\"\n\t\t )\n\t\t),\n\t\tconsumes = {\"application/vnd.version-v1+json\"},\n\t\tproduces = {\"application/vnd.version-v1+json\"},\n\t\tschemes = {SwaggerDefinition.Scheme.HTTP},\n\t\ttags = {\n\t\t\t\t@Tag(name = \"current-version\", description = \"Return the current version in json format.\")\n\t\t}, \n\t\texternalDocs = @ExternalDocs(value = \"Documentation\", url = \"http://confluence.org/bomc-swagger.html\")\n\t)\npublic interface VersionRESTResource {\n\n\tString MEDIA_TYPE_JSON_V = \"application/vnd.version-v1+json\";\n\n\t/**\n\t * <pre>\n\t * http://localhost:8080/bomc-swagger/rest/version/current-version\n\t * </pre>\n\t * \n\t * @return available heap as JsonObject.\n\t */\n\t@GET\n\t@Path(\"/current-version\")\n\t@ApiOperation(notes = \"Return the current version in json format.\", value = \"getVersion\", httpMethod = \"GET\", nickname = \"getVersion\", position = 1)\n\t@ApiResponses(value = {\n\t\t\t@ApiResponse(code = 200, message = \"Successful retrieval of current version.\", response = String.class),\n\t\t\t@ApiResponse(code = 500, message = \"Request failed\", response = String.class) })\n\tResponse getVersion();\n}", "@Beta\npublic interface PluginEndpoint {\n /**\n * get the type of method parameter\n *\n * @return Type of method's first parameter\n * @throws IllegalArgumentException if argument list is empty\n */\n Type getMethodParameterType() throws IllegalArgumentException;\n\n /**\n * get the return type of plugin method\n *\n * @return return type of method\n */\n Type getResultType();\n\n /**\n * invoke method with the request object as parameter.\n *\n * @param reqest request object\n * @return result from invoking the object\n * @throws IOException when instantiating plugin before invoking method on it\n * @throws ClassNotFoundException when instantiating plugin before invoking method on it\n * @throws InvocationTargetException method invoke can throw\n * @throws IllegalAccessException method invoke can throw\n * @throws IllegalArgumentException method invoke can throw\n */\n Object invoke(Object reqest) throws IOException, ClassNotFoundException,\n InvocationTargetException, IllegalAccessException, IllegalArgumentException;\n}", "public interface APIEndpoints {\n\n @GET(\"user/{id}\")\n Call<User> getUser(@Path(\"id\") String userId);\n\n @GET(\"user\")\n Call<List<User>> getUsers();\n\n @POST(\"user\")\n Call<User> createUser(@Body User user);\n\n @PATCH(\"user/{id}\")\n Call<User> updateUser(@Body User user, @Path(\"id\") String userId);\n\n @DELETE\n Call<User> deleteUser(@Path(\"id\") String userID);\n\n @GET(\"challenge\")\n Call<List<Challenge>> getChallenges();\n\n @GET(\"challenge/{id}\")\n Call<Challenge> getChallenge(@Path(\"id\") String challengeID);\n\n @POST(\"challenge\")\n Call<User> createChallenge(@Body Challenge challenge);\n\n @PATCH(\"challenge/{id}\")\n Call<Challenge> updateChallenge(@Body Challenge challenge, @Path(\"id\") String challengeID);\n\n @DELETE\n Call<User> deleteChallenge(@Path(\"id\") String challengeID);\n\n @GET(\"issue\")\n Call<List<Issue>> getIssues();\n\n @GET(\"issue/{id}\")\n Call<Issue> getIssue(@Path(\"id\") String issueId);\n\n @POST(\"issue\")\n Call<Issue> createIssue(@Body Issue issue);\n\n @PUT(\"issue/{id}\")\n Call<Issue> updateIssue(@Body Issue issue, @Path(\"id\") String issueId);\n\n @DELETE(\"issue/{id}\")\n Call<Issue> deleteIssue(@Path(\"id\") String issueId);\n\n}", "void registerBeans(@Observes AfterBeanDiscovery event, BeanManager manager) {\n {\n AnnotatedType<Office> oat = manager.createAnnotatedType(Office.class);\n BeanAttributes<Office> oa = manager.createBeanAttributes(oat);\n InjectionTargetFactory<Office> factory = manager.getInjectionTargetFactory(oat);\n Bean<?> bean = manager.createBean(oa, Office.class, factory);\n event.addBean(bean);\n }\n // create a serializable synthetic class bean\n {\n AnnotatedType<SerializableOffice> oat = manager.createAnnotatedType(SerializableOffice.class);\n BeanAttributes<SerializableOffice> oa = manager.createBeanAttributes(oat);\n InjectionTargetFactory<SerializableOffice> factory = manager.getInjectionTargetFactory(oat);\n Bean<?> bean = manager.createBean(oa, SerializableOffice.class, factory);\n event.addBean(bean);\n }\n // create a synthetic decorator\n {\n AnnotatedType<VehicleDecorator> oat = manager.createAnnotatedType(VehicleDecorator.class);\n BeanAttributes<VehicleDecorator> oa = addDecoratorStereotype(manager.createBeanAttributes(oat));\n InjectionTargetFactory<VehicleDecorator> factory = manager.getInjectionTargetFactory(oat);\n Bean<?> bean = manager.createBean(oa, VehicleDecorator.class, factory);\n assertTrue(bean instanceof Decorator<?>);\n event.addBean(bean);\n }\n\n assertNotNull(zooBean);\n\n // create synthetic producer field\n {\n AnnotatedType<Zoo> zoo = manager.createAnnotatedType(Zoo.class);\n assertEquals(1, zoo.getFields().size());\n AnnotatedField<? super Zoo> field = zoo.getFields().iterator().next();\n BeanAttributes<Lion> attributes = Reflections.cast(starveOut(manager.createBeanAttributes(field)));\n ProducerFactory<Zoo> factory = getManagerImpl(manager).getProducerFactory(field, zooBean);\n event.addBean(manager.createBean(attributes, Zoo.class, factory));\n }\n // create synthetic producer method\n {\n AnnotatedType<Zoo> zoo = manager.createAnnotatedType(Zoo.class);\n AnnotatedMethod<? super Zoo> method = null;\n for (AnnotatedMethod<? super Zoo> _method : zoo.getMethods()) {\n if (_method.getBaseType().equals(Tiger.class)) {\n method = _method;\n }\n }\n assertNotNull(method);\n BeanAttributes<Tiger> attributes = Reflections.cast(starveOut(manager.createBeanAttributes(method)));\n ProducerFactory<Zoo> factory = getManagerImpl(manager).getProducerFactory(method, zooBean);\n event.addBean(manager.createBean(attributes, Zoo.class, factory));\n }\n }", "public interface ApiAction {}", "@RemotingBean\npublic interface Projectable {\n}", "void setEndpointParameter(Endpoint endpoint, String name, Object value) throws RuntimeCamelException;", "@Api(value = \"课程分类管理\",description = \"课程分类管理\",tags = {\"课程分类管理\"})\npublic interface CategoryControllerApi {\n @ApiOperation(\"查询分类\")\n public CategoryNode findList(String id);\n}", "public String generateImplementationBean(String wsName, FileObject pkg, Project project, String delegateData)throws java.io.IOException;", "ResourceAPI createResourceAPI();", "public interface APIService {\n\n\t@POST(Configs.ApiConfig.VIDEO_LINK)\n\tObservable<BaseResponse> getAllVedioBy(@Body boolean once_no);\n}", "interface WithProperties {\n /**\n * Specifies properties.\n * @param properties Properties of the secret\n * @return the next definition stage\n */\n WithCreate withProperties(SecretProperties properties);\n }", "public void initPublicEndpoint() {\n \t//TODO: Register the new Public End Point with in the Content Repository Node\n \tString uniqueId = UUID.randomUUID().toString();\n \t\n \tpublicEndPoint = new JMSEndpoint();\n \tpublicEndPoint.setAddress(uniqueId + \"/public\");\n \t\n \tpublicEndPoint.setProperties(configuration.getBrokerPool().getBroker().getConnections(\"topic\").getParameters());\n \n // save the public endpoint from the registry\n registry.createPublicEndpoint();\n \n publicSender = initPublicSender(new JMSSenderFactory().create(publicEndPoint));\n \t\n \tisPublicEndPointInit = true;\n }", "@ApiMethod(name = \"sayHi\")\n public MyBean sayHi(@Named(\"name\") String name) {\n MyBean response = new MyBean();\n response.setData(\"Hi, \" + name);\n\n return response;\n }", "void register(String name, Object bean);", "@FeignClient(name = \"product-server\",path = \"/product\")\n@Component\npublic interface ProductService {\n @RequestMapping(value = \"getProduct\")\n String getProduct();\n}", "@Override\n\tpublic void init(EndpointConfig arg0) {\n\t\t\n\t}", "@Override\n\tpublic void init(EndpointConfig arg0) {\n\t\t\n\t}", "public interface AboutUnivStarService {\n\n @POST(\"/v1/m/user/setting/about\")\n Observable<AboutUnivStarBean> loadAboutUnivStarMessage();\n}", "public interface RestApi {\n}", "BeanConfiguration deploy(Supplier<? extends Assembly> supplier, Wirelet... wirelets);" ]
[ "0.63285476", "0.6305854", "0.62405604", "0.61480194", "0.60214", "0.5914546", "0.5863444", "0.5845168", "0.5815267", "0.58124864", "0.5809024", "0.5794706", "0.5781983", "0.57485783", "0.573589", "0.5642202", "0.5617435", "0.56127715", "0.5588965", "0.5581967", "0.5488899", "0.5433954", "0.5422674", "0.53949845", "0.53833383", "0.5377723", "0.53427154", "0.532301", "0.531418", "0.53060883", "0.5299348", "0.52860874", "0.5281793", "0.52817667", "0.5258838", "0.525662", "0.5255171", "0.52318895", "0.5209593", "0.5175865", "0.5170417", "0.5166067", "0.5162524", "0.51614434", "0.5131136", "0.50949764", "0.50895303", "0.5068201", "0.5062284", "0.50605214", "0.5028093", "0.5026465", "0.5017529", "0.49993715", "0.4989327", "0.49875963", "0.49708012", "0.49651986", "0.4954821", "0.49326852", "0.49313408", "0.49282137", "0.49242306", "0.49213222", "0.49105558", "0.4907776", "0.49044022", "0.49000734", "0.48952216", "0.4890029", "0.48883617", "0.48863202", "0.4885521", "0.48789677", "0.48695308", "0.48641056", "0.4855476", "0.4854725", "0.48535824", "0.48534563", "0.48509172", "0.48504248", "0.48503578", "0.4847988", "0.4830897", "0.48288712", "0.48268598", "0.4823196", "0.48179615", "0.48173305", "0.48170045", "0.4815898", "0.48120743", "0.48091915", "0.47963172", "0.47884753", "0.47884753", "0.47822797", "0.47793475", "0.47792816" ]
0.4852469
80
Method responsible for show the view telling there is no matches in that day
private void showNoView(boolean isShown){ if(isShown){ mNoMatchesImageView.setVisibility(View.VISIBLE); mNoMatchesTextView.setVisibility(View.VISIBLE); }else{ mNoMatchesImageView.setVisibility(View.GONE); mNoMatchesTextView.setVisibility(View.GONE); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void showMatchFailedView() {\n mMatchStatus = MATCH_STATUS_MATCH_FAILED;\n postInvalidate();\n }", "public static void displayNoResults()\n {\n tableData.add(new Company(null, \"No results found\"));\n tableView.setItems(tableData); \n }", "public static void handleNoMatchException() {\n System.out.println(\"\\tThere no task in the list that matches your search, sir.\");\n Duke.jarvis.printDivider();\n }", "private void updateEmptyView()\n\t{\n\t\tif (_forecastAdapter.getItemCount() == 0)\n\t\t{\n\t\t\tTextView textView = (TextView) getView().findViewById(R.id.recyclerview_forecast_empty);\n\n\t\t\t//if cursor is empty\n\t\t\tif (textView != null)\n\t\t\t{\n\t\t\t\tint message = R.string.empty_forecast_list;\n\n\t\t\t\[email protected] int locationStatus = Util\n\t\t\t\t\t\t.getLocationStatus(getContext());\n\n\t\t\t\tswitch (locationStatus)\n\t\t\t\t{\n\t\t\t\t\tcase SunshineSyncAdapter.LOCATION_STATUS_SERVER_DOWN:\n\t\t\t\t\t{\n\t\t\t\t\t\tmessage = R.string.empty_forecast_list_server_down;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SunshineSyncAdapter.LOCATION_STATUS_SERVER_INVALID:\n\t\t\t\t\t{\n\t\t\t\t\t\tmessage = R.string.empty_forecast_list_server_error;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SunshineSyncAdapter.LOCATION_STATUS_INVALID:\n\t\t\t\t\t{\n\t\t\t\t\t\tmessage = R.string.empty_forecast_list_invalid_location;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif (!Util.isNetworkAvailable(getContext()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmessage = R.string.empty_forecast_list_no_network;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttextView.setText(message);\n\t\t\t}\n\t\t}\n\t}", "public void displayEmptyView() {\n if (peers_.size() == 0) {\n list_view_.getEmptyView().setVisibility(View.VISIBLE);\n } else {\n list_view_.getEmptyView().setVisibility(View.INVISIBLE);\n }\n }", "void noDataFoundTextView();", "private void showEmptyListView() {\n\t\tempty_icon.setBackgroundResource(R.drawable.ic_search_large);\n\t\tempty_label.setText(R.string.setting_friend_have_no_friend);\n\t\tempty_layout.setVisibility(View.VISIBLE);\n\t\tlst_friend.setVisibility(View.GONE);\n\t}", "public void showAppointments()\n {\n System.out.println(\"=== Day \" + dayNumber + \" ===\");\n int time = START_OF_DAY;\n for(Appointment appointment : appointments) {\n System.out.print(time + \": \");\n if(appointment != null) {\n System.out.println(appointment.getDescription());\n }\n else {\n System.out.println();\n }\n time++;\n }\n }", "private String notFound() {\n\t\tquestionBot.put(owner.id(), \"Desculpe, não entendi sua resposta\");\n\t\treturn buildMessage(questionBot.get(owner.id()));\n\t}", "public void showAvailTable() {\n if (availDay.getDate() != null) {\n availTable.setVisible(true);\n } \n else {\n showNoDateMess();\n };\n }", "@Override\n public void infoUsersNotHaveData() {\n mSearchChildView.showEmptyArtistsLayout();\n }", "public void displayNoRoute() {\n\t\tmetaInfo.showInfoWhenNoRouteIsSelected();\n\t\tutilities.removeAllPins();\n\t\tupdateLinesAndGrid();\n\t}", "private void onDataEmpty() {\n mArticlesView.showNoArticles();\n }", "private void defaultLessonTimetableShouldNotBeFound(String filter) throws Exception {\n restLessonTimetableMockMvc\n .perform(get(ENTITY_API_URL + \"?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n\n // Check, that the count call also returns 0\n restLessonTimetableMockMvc\n .perform(get(ENTITY_API_URL + \"/count?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(content().string(\"0\"));\n }", "boolean getMissingResults();", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_matches, container, false);\n\n\n if (getArguments() != null) {\n teamInfo = getArguments().getParcelable(StaticConfig.TEAM_INFO);\n player_id = getArguments().getString(StaticConfig.PARAM_PLAYER_ID);\n }\n\n initialiseViews(view);\n\n\n matches_adapter = new Adapter(getActivity(), list);\n\n\n matches_recycler.setAdapter(matches_adapter);\n\n\n matches_recycler.setLayoutManager(new LinearLayoutManager(getActivity()));\n\n\n calendar = Calendar.getInstance();\n\n datePickerDialog = new DatePickerDialog(\n getActivity(), this, calendar.get(Calendar.YEAR),\n calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH));\n\n\n if (teamInfo != null && teamInfo.getRecentMatches() != null) {\n LL_date_layout.setVisibility(GONE);\n\n matches.addAll(teamInfo.getRecentMatches());\n\n Collections.sort(matches, (o, t1) -> {\n Match match = o;\n Match match1 = t1;\n\n long millis1 = Utils.getMillisFromMatchDate(match.getFullDatetimeSpaces());\n long millis2 = Utils.getMillisFromMatchDate(match1.getFullDatetimeSpaces());\n\n if (millis1 > millis2)\n return 1;\n else if (millis1 < millis2)\n return -1;\n else\n return 0;\n });\n list.addAll(matches);\n\n if (matches.size() == 0)\n AppSingleton.getInstance(getActivity()).loadNativeAds(mNativeAds, matches_recycler,\n matches_adapter, matches, list, NUMBER_OF_NATIVE_ADS_MATCHES);\n else\n AppSingleton.getInstance(getActivity()).loadNativeAds(mNativeAds, matches_recycler,\n matches_adapter, matches, list, NUMBER_OF_NATIVE_ADS_MATCHES);\n\n matches_adapter.notifyDataSetChanged();\n shimmerFrameLayout.hideShimmer();\n shimmerFrameLayout.setVisibility(GONE);\n } else if (player_id != null) {\n LL_date_layout.setVisibility(GONE);\n\n getPlayerMatches();\n\n } else {\n\n handler = new Handler();\n runnable = this::getMatches;\n getMatches();\n displayDate();\n\n }\n\n getLatestNews();\n\n\n return view;\n }", "private void showDateDialog() {\n\t\tDateDetailInfo[] dateInfo = DateDetailInfo.getDateDetailInfo();\n\t\tboolean noDate = (dateInfo == null);\n\t\tboolean allPermanent = (null != dateInfo)\n\t\t\t\t&& (dateInfo.length == 1)\n\t\t\t\t&& (dateInfo[0] != null)\n\t\t\t\t&& (dateInfo[0].deadText != null)\n\t\t\t\t&& (dateInfo[0].deadText.equals(this.getResources().getString(\n\t\t\t\t\t\tR.string.package_detail_forever)));\n\t\tif (DateDetailInfo.dayOffMax > 0 && (!(noDate || allPermanent))) {\n\t\t\tinitDateDialog();\n\t\t\tDateDialog dialog = new DateDialog(this);\n\t\t\tdialog.getWindow().setBackgroundDrawable(new ColorDrawable(0));\n\t\t\tdialog.requestWindowFeature(Window.FEATURE_NO_TITLE);\n\t\t\tdialog.setListener(new DialogInterface.OnClickListener() {\n\t\t\t\t@Override\n\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\tstartGetTicketActivity();\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (null != DateDialog.mListStr && DateDialog.mListStr.length > 1) {\n\t\t\t\tdialog.show();\n\t\t\t}\n\t\t}\n\t}", "private void showDisconnectedView() {\n\t\tempty_icon.setBackgroundResource(R.drawable.ic_disconnected);\n\t\tempty_label.setText(R.string.search_disconnected_msg);\n\t\tempty_layout.setVisibility(View.VISIBLE);\n\t\tlst_friend.setAdapter(null);\n\t}", "public void showEmptyView() {\n mStateView.showViewEmpty();\n }", "private void showEmptyView() {\n mEmptyView.setVisibility(View.VISIBLE);\n mDashboardList.setVisibility(View.INVISIBLE);\n }", "@Test\n public void TestNextAppNoUpcoming () {\n onView(withId(R.id.noUpcoming)).check(matches(withText(containsString(\"No Upcoming Appointments\"))));\n }", "private void setViewToNoMoreResults (String messageToDisplay) {\n\t\ttextViewRestaurantName.setVisibility(View.INVISIBLE);\n\t\ttextViewRestaurantDistance.setVisibility(View.INVISIBLE);\n\t\timageButtonRestaurantImage.setVisibility(View.INVISIBLE);\n\t\tbuttonAcceptRestaurant.setVisibility(View.INVISIBLE);\n\t\tbuttonRejectRestaurant.setVisibility(View.INVISIBLE);\n\n\t\ttextViewNoMoreResults.setText(messageToDisplay);\n\t\ttextViewNoMoreResults.setVisibility(View.VISIBLE);\n\t}", "private void emptyViewForFilter(){\n if(adapter.getItemCount() <= 0){\n v.setVisibility(View.GONE);\n filempty.setVisibility(View.VISIBLE);\n } else {\n v.setVisibility(View.VISIBLE);\n filempty.setVisibility(View.GONE);\n }\n }", "public void showResponse(final Response<EventInfoFetch> response) {\n\n if (response.body().getEventList().isEmpty()) {\n setContentView(R.layout.activity_empty_view);\n ImageView imageView = findViewById(R.id.back);\n TextView text_empty = findViewById(R.id.text_empty);\n final ImageView headerlogoIv1 = findViewById(R.id.headerlogoIv);\n Util.logomethod(this, headerlogoIv1);\n text_empty.setText(\"No Data Found\");\n imageView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n finish();\n }\n });\n } else {\n if (response.body().getStatus().equalsIgnoreCase(\"success\")) {\n String startTime = \"\", endTime = \"\";\n SimpleDateFormat sdf = new SimpleDateFormat(ApiConstant.dateformat + \" HH:mm\");\n String currentDateandTime = sdf.format(new Date());\n try {\n if (response.body().getEventList().get(0).getEventStart().equals(\"null\") && response.body().getEventList().get(0).getEventStart() != null && !response.body().getEventList().get(0).getEventStart().isEmpty()) {\n startTime = currentDateandTime;\n } else {\n startTime = response.body().getEventList().get(0).getEventStart();\n }\n\n if (response.body().getEventList().get(0).getEventEnd().equals(\"null\") && response.body().getEventList().get(0).getEventEnd() != null && response.body().getEventList().get(0).getEventEnd().isEmpty()) {\n endTime = currentDateandTime;\n } else {\n endTime = response.body().getEventList().get(0).getEventEnd();\n }\n } catch (Exception e) {\n startTime = currentDateandTime;\n endTime = currentDateandTime;\n }\n\n\n // SimpleDateFormat df = new SimpleDateFormat(\"hh:mm a\");\n\n SimpleDateFormat formatter = null;\n\n String formate1 = ApiConstant.dateformat;\n String formate2 = ApiConstant.dateformat1;\n\n if (Utility.isValidFormat(formate1, startTime, Locale.UK)) {\n formatter = new SimpleDateFormat(ApiConstant.dateformat);\n } else if (Utility.isValidFormat(formate2, startTime, Locale.UK)) {\n formatter = new SimpleDateFormat(ApiConstant.dateformat1);\n }\n try {\n d1 = formatter.parse(startTime);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n long millisecondsStart = d1.getTime();\n\n try {\n d2 = formatter.parse(endTime);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n long millisecondsEnd = d2.getTime();\n\n SimpleDateFormat formatter1 = new SimpleDateFormat(\"dd MMM yyyy\");\n\n String finalStartTime = formatter1.format(new Date(millisecondsStart));\n String finalEndTime = formatter1.format(new Date(millisecondsEnd));\n\n try {\n nameTv.setText(response.body().getEventList().get(0).getEventName());\n if (finalStartTime.equalsIgnoreCase(finalEndTime)) {\n dateTv.setText(finalStartTime);\n\n } else {\n dateTv.setText(finalStartTime + \" - \" + finalEndTime);\n }\n cityTv.setText(response.body().getEventList().get(0).getEventCity());\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n\n try {\n if (event_info_description.equalsIgnoreCase(\"1\") && response.body().getEventList().get(0).getEventDescription() != null) {\n\n event_desc.setVisibility(View.VISIBLE);\n// eventvenu.setVisibility(View.VISIBLE);\n view.setVisibility(View.VISIBLE);\n\n } else {\n event_desc.setVisibility(View.GONE);\n// eventvenu.setVisibility(View.GONE);\n view.setVisibility(View.GONE);\n }\n\n event_desc.setText(response.body().getEventList().get(0).getEventLocation() + \"\\n\\n\" + response.body().getEventList().get(0).getEventDescription());\n String image_final_url = ApiConstant.imgURL + \"uploads/app_logo/\" + response.body().getEventList().get(0).getLogo();\n\n// Glide.with(getApplicationContext()).load(image_final_url).into(logoIv).onLoadStarted(getDrawable(R.drawable.logo));\n Glide.with(getApplicationContext()).load(image_final_url)\n .apply(RequestOptions.skipMemoryCacheOf(true))\n .apply(RequestOptions.diskCacheStrategyOf(DiskCacheStrategy.NONE)).listener(new RequestListener<Drawable>() {\n @Override\n public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {\n\n logoIv.setImageResource(R.drawable.profilepic_placeholder);\n return true;\n }\n\n @Override\n public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {\n\n return false;\n }\n }).into(logoIv).onLoadStarted(this.getDrawable(R.drawable.profilepic_placeholder));\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n linMap.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n /* String label = \"ABC Label\";\n String uriBegin = \"geo:\" + response.body().getEventList().get(0).getEventLatitude() + \",\" + response.body().getEventList().get(0).getEventLongitude();\n String query = response.body().getEventList().get(0).getEventLatitude() + \",\" + response.body().getEventList().get(0).getEventLatitude() + \"(\" + label + \")\";\n String encodedQuery = Uri.encode(query);\n String uriString = uriBegin + \"?q=\" + encodedQuery + \"&z=16\";\n Uri uri = Uri.parse(uriString);\n Intent intent = new Intent(android.content.Intent.ACTION_VIEW, uri);\n startActivity(intent);*/\n String label = response.body().getEventList().get(0).getEventName();\n String strUri = \"http://maps.google.com/maps?q=loc:\" + response.body().getEventList().get(0).getEventLatitude() + \",\" + response.body().getEventList().get(0).getEventLongitude() + \" (\" + label + \")\";\n Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(strUri));\n\n intent.setClassName(\"com.google.android.apps.maps\", \"com.google.android.maps.MapsActivity\");\n\n startActivity(intent);\n\n\n }\n });\n\n\n try {\n if (map != null && event_info_display_map.equalsIgnoreCase(\"1\")) {\n\n fm.getView().setVisibility(View.VISIBLE);\n position = new LatLng(Double.parseDouble(response.body().getEventList().get(0).getEventLatitude()), Double.parseDouble(response.body().getEventList().get(0).getEventLongitude()));\n\n CameraUpdate updatePosition1 = CameraUpdateFactory.newLatLng(position);\n\n map.moveCamera(updatePosition1);\n\n // Instantiating MarkerOptions class\n options = new MarkerOptions();\n\n // Setting position for the MarkerOptions\n options.position(position);\n\n // Setting title for the MarkerOptions\n\n\n // Setting snippet for the MarkerOptions\n options.snippet(response.body().getEventList().get(0).getEventLocation());\n\n\n // Adding Marker on the Google Map\n map.addMarker(options);\n\n\n moveToCurrentLocation(position);\n } else {\n fm.getView().setVisibility(View.GONE);\n }\n } catch (Exception e) {\n }\n }\n\n }\n }", "public void showEmptySeats(){\n System.out.println(\"The following seats are empty: \");\n for (PlaneSeat seat:seat){\n if (! seat.isOccupied()){\n System.out.println(\"SeatID \" + seat.getSeatID());\n }\n }\n }", "private void defaultMGachaRenditionShouldNotBeFound(String filter) throws Exception {\n restMGachaRenditionMockMvc.perform(get(\"/api/m-gacha-renditions?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n\n // Check, that the count call also returns 0\n restMGachaRenditionMockMvc.perform(get(\"/api/m-gacha-renditions/count?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(content().string(\"0\"));\n }", "public boolean noDaySelected() {\n return selectedDays.size() == 0;\n }", "public boolean noDaySelected() {\n return selectedDays.size() == 0;\n }", "@Then(\"no results appear in the search list\")\n public void no_results_appear_in_the_search_list() {\n assert true;\n }", "public String viewByDate(LocalDate date) {\n\t\tArrayList<Event> list = new ArrayList<Event>();\n\t\tDateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"E, MMM dd YYYY\");\n\n\t\tString str = formatter.format(date);\n\n\t\tif(map.containsKey(date)) {\n\t\t\tlist = map.get(date);\n\t\t\tformatter = DateTimeFormatter.ofPattern(\"E, MMM dd YYYY\");\n\t\t\tstr = formatter.format(date);\n\t\t\tfor(int i = 0; i<list.size(); i++) {\n\t\t\t\tEvent e = list.get(i);\n\t\t\t\tstr = str + \"\\n\\n\" + \"\\t\" + e.sTime + \" - \" + e.eTime + \": \" + e.name;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tstr = str + \"\\n\\n\"+\":: No Event Scheduled Yet ::\";\n\t\t}\n\n\t\treturn str;\n\n\t}", "private void showContentNotFoundLayoutIfNeeded() {\n if (newsListToShow.size() > 0) {\n contentNotFoundLayout.setVisibility(View.GONE);\n } else {\n warningImage.setImageResource(R.mipmap.ic_warning_white_48dp);\n contentNotFoundLayout.setVisibility(View.VISIBLE);\n contentNotFoundTextView.setText(BaseThemeActivity.EMPTY_SAVED_NEWS);\n }\n\n }", "private void showMatchView() {\n mMatchShadowView.animate().alpha(1);\n\n // Only show if it is not already visible\n if (mMatchView.getVisibility() != View.VISIBLE) {\n mMatchView.setVisibility(View.INVISIBLE);\n mMatchView.setTranslationY(-mMatchView.getHeight());\n mMatchView.setVisibility(View.VISIBLE);\n // Clear the listener from the hiding animation\n mMatchView.animate().translationY(0).setListener(null);\n }\n }", "@Test()\n public void testGetExpensesByTypeAndDayNull() {\n\tString type = \"DAILY\";\n\tLocalDate date = LocalDate.of(2015, 3, 25);\n\tList<Expense> expensesForDisplay = expenseManager.getExpensesByTypeAndDay(type, date);\n\tassertEquals(0, expensesForDisplay.size(), 0);\n }", "private void hideMatchView() {\n mMatchShadowView.animate().alpha(0);\n\n mMatchView.animate()\n .translationY(-mMatchView.getHeight())\n .setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n super.onAnimationEnd(animation);\n mMatchView.setVisibility(View.INVISIBLE);\n }\n });\n }", "private void checkSearchViewExists() {\n onView(withId(R.id.searchView)).check(matches(isDisplayed()));\n }", "@Test\n\tpublic void testListReservationsOfUserNoMatch() {\n\t\t// create a reservation of another user\n\t\tdataHelper.createPersistedReservation(\"someID\", new ArrayList<String>(), validStartDate, validEndDate);\n\n\t\t// should not find above reservation\n\t\tCollection<Reservation> reservationsOfUser;\n\t\treservationsOfUser = bookingManagement.listReservationsOfUser(USER_ID, validStartDate, validEndDate);\n\t\tassertNotNull(reservationsOfUser);\n\t\tassertTrue(reservationsOfUser.isEmpty());\n\t}", "public void showNoDateMess() {\n JOptionPane.showMessageDialog(this, \"No date has been choosen. Choose date before clicking button.\", \"Date Not Selected\", WARNING_MESSAGE);\n }", "public void setPLPRecyclerNoResultView()\n {\n recyclerView.setVisibility(View.GONE);\n recyclerViewNoResult.setVisibility(View.VISIBLE);\n }", "public boolean getViewMissing() {\n return view == null;\n }", "public void showNoNotifications(){\n noNotificationsTitle.setVisibility(View.VISIBLE);\n noNotificationsText.setVisibility(View.VISIBLE);\n noNotificationsImage.setVisibility(View.VISIBLE);\n }", "@Override\n public void onFailedSearch() {\n infoUsersNotHaveData();\n }", "private static Result renderHome(Skier loggedInSkier){\n int openMeetings=0;\n int doneMeetings=0;\n for(Meeting m : Meeting.getBySkier(loggedInSkier)){\n if(m.getDate().before(new Date())){\n doneMeetings++;\n } else openMeetings++;\n }\n List<Meeting> usermeetings =Meeting.getBySkier(loggedInSkier);\n Collections.sort(usermeetings);\n return ok(home.render(loggedInSkier,Interests.getAll(),Skiarena.getAll(),Integer.valueOf(openMeetings), Integer.valueOf(doneMeetings),usermeetings));\n }", "protected void doCheckView() {\n // check the remotes first\n if (getAnnouncementRegistry() == null) {\n logger.info(\"announcementRegistry is null (will check view again later)\");\n return;\n }\n getAnnouncementRegistry().checkExpiredAnnouncements();\n }", "private void viewSavedSchedules() {\n if (yesNoQuestion(\"Would you like to filter through the saved schedules?\")) {\n showAllSchedulesFiltered(scheduleList.getScheduleList());\n } else {\n showAllSchedules(scheduleList.getScheduleList());\n }\n }", "private void findMatches() {\n this.user.getMatches().clear();\n final String HOST_MATCH = HOST_URL + \"/match/\" + user.getId() + \"/?page=0\" + HomeView.MATCH_LIMIT;\n RequestQueue que = Volley.newRequestQueue(this);\n JsonObjectRequest req = new JsonObjectRequest(Request.Method.GET, HOST_MATCH, null,\n new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject response) {\n try { //String id, String firstName, String lastName, String email) {\n MatchView.parseEdges(response.getJSONArray(\"matches\"), toBeMatched);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n Log.d(\"HomeView\", \"Could not find matches\");\n }\n });\n que.add(req);\n }", "private void defaultReservationShouldNotBeFound(String filter) throws Exception {\n restReservationMockMvc.perform(get(ReservationController.BASE_URL + \"?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(jsonPath(\"$.data.content\").isArray())\n .andExpect(jsonPath(\"$.data.content\").isEmpty());\n\n }", "private void defaultMMarathonLoopRewardGroupShouldNotBeFound(String filter) throws Exception {\n restMMarathonLoopRewardGroupMockMvc.perform(get(\"/api/m-marathon-loop-reward-groups?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n\n // Check, that the count call also returns 0\n restMMarathonLoopRewardGroupMockMvc.perform(get(\"/api/m-marathon-loop-reward-groups/count?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(content().string(\"0\"));\n }", "public void displayCalendar() throws IllegalArgumentException {\r\n\t\tif (getCurrentEntity() == null) {\r\n\t\t\tthrow new IllegalArgumentException(\"No doctor is displayed\");\r\n\t\t}\r\n\t\ttracer(this).debug(\"Displaying calendar of doctor: \" + getCurrentEntity().getId());\r\n\t\tgetEventBus().fireEvent(DoctorCalendarPage.createPageEvent(this, getCurrentEntity().getId()));\r\n\t\tview.setViewVisible(false);\r\n\t}", "public void extractFifteenDays(View view) {\n showExtractOnListView();\n }", "@Override\n public void run() {\n if (filteredList.size() == 0) {\n //Utils.toast(\"No data found\");\n }\n notifyDataSetChanged();\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n HashMap<String, String> report = getItem(position);\n // Check if an existing view is being reused, otherwise inflate the view\n if (convertView == null) {\n convertView = LayoutInflater.from(getContext()).inflate(R.layout.fillup_line, parent, false);\n }\n // Lookup view for data population\n TextView vId = (TextView) convertView.findViewById(R.id.idFld);\n TextView rDate = (TextView) convertView.findViewById(R.id.dateFld);\n TextView vName = (TextView) convertView.findViewById(R.id.vehicleFld);\n TextView rMiles = (TextView) convertView.findViewById(R.id.milesFld);\n TextView rGallons = (TextView) convertView.findViewById(R.id.gallonsFld);\n TextView rCost = (TextView) convertView.findViewById(R.id.costFld);\n TextView rMileage = (TextView) convertView.findViewById(R.id.mileageFld);\n // Populate the data into the template view using the data object\n vId.setText(report.get(Fillup.KEY_ID));\n rDate.setText(report.get(Fillup.KEY_DATE));\n vName.setText(report.get(Fillup.KEY_VEHICLE_NAME));\n rMiles.setText(report.get(Fillup.KEY_MILES));\n rGallons.setText(report.get(Fillup.KEY_GALLONS));\n rCost.setText(report.get(Fillup.KEY_COST));\n rMileage.setText(report.get(Fillup.KEY_MILEAGE));\n\n // If the at Position >=1 and previous field date is same hide date\n if(position >= 1){\n HashMap<String, String> prevreport = getItem(position - 1);\n String current = report.get(Fillup.KEY_DATE);\n String prev = prevreport.get(Fillup.KEY_DATE);\n if(current.equals(prev)){\n rDate.setVisibility(View.GONE);\n }\n }\n\n // Return the completed view to render on screen\n return convertView;\n }", "public void extractSevenDays(View view) {\n showExtractOnListView();\n }", "private void checkIfEmpty() {\n\n if (emptyView != null && recyclerView.getAdapter() != null) {\n\n boolean emptyViewVisible = recyclerView.getAdapter().getItemCount() == 0;\n Log.d(Utility.LOG_TAG, \" Enabling empty view for list : No data found \" );\n emptyView.setVisibility(emptyViewVisible ? View.VISIBLE : View.GONE);\n recyclerView.setVisibility(emptyViewVisible ? View.GONE : View.VISIBLE);\n }\n }", "public String getMessage() {\n return \"Sorry, there isn't any event in the list on the given date.\";\n }", "public String showFind() {\n String findMessage = \"Ain't no problem! I have found the matchin' tasks in your list:\";\n return findMessage;\n }", "public void clearWeeklyView(){\n\t\tthis.weeklyView=false;\n\t\tnotifyDataSetChanged();\n\t\tnotifyDataSetInvalidated();\n\t}", "@Test(expected=IllegalArgumentException.class)\r\n\tpublic void emptyFlightSearch() {\r\n\t\tList<FlightAbstract> flightResults = SearchEngine.flightSearch(newFlightSearch);\r\n\t}", "@Override\n\tpublic int getCount() {\n\t\treturn date.size();\n\t}", "private void assertStreamItemViewHasNoTag() {\n Object tag = mView.getTag();\n assertNull(\"should not have a tag\", tag);\n }", "private void showLoadedResults() {\n recyclerView.setVisibility(View.VISIBLE);\n errorMessageDisplayView.setVisibility(View.INVISIBLE);\n }", "public static boolean testDaoLireRapportVisite() throws DaoException, Exception {\n boolean ok = true;\n ArrayList<RapportVisite> lesRapportsVisites = new ArrayList<RapportVisite>();\n lesRapportsVisites = daoRapportVisite.getAll();\n System.out.println(\"liste des rapports\");\n for (RapportVisite unRapportVisite: lesRapportsVisites){\n unRapportVisite.DateToString();\n System.out.println(unRapportVisite);\n \n }\n return ok;\n }", "@Then(\"no search results are displayed\")\n\t\tpublic void no_search_results_are_displayed() throws Exception {\n\t\t\t//Waits for the result page to load\n\t\t\tdriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n\n\t\t\t//Saves all results that match our book ID\n\t\t\tList<WebElement> results = driver.findElements(By.xpath(resultsPage));\n\n\t\t\tif(results.size() > 1) {\n\n\t\t\t\t//Verifies that my book id is really among the results\n\t\t\t\tfor(int i = 0; i < results.size(); ++i) {\n\t\t\t\t\tproduto = results.get(i).getAttribute(\"data-product\");\n\t\t\t\t\tif (produto.contains(id)) {\n\t\t\t\t\t\tSystem.out.println(\"\\nA busca encontrou o meu livro!\");\n\t\t\t\t\t\tSystem.out.println(id);\n\t\t\t\t\t\tSystem.out.println(\"------------------------------------------------\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tSystem.out.println(\"Livro não encontrado!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\tSystem.out.println(\"\\nNenhum resultado encontrado!\\n\");\n\t\t\t}\n\n\t\t\t// Take snapshot as evidence\n\t\t\tFunctions.takeSnapShot(driver, null);\n\n\t\t}", "public boolean displayMessage()\n {\n boolean show = false;\n Calendar cal2 = null;\n Calendar cal = null;\n\n int h = this.getIntHora();\n cal = Calendar.getInstance();\n cal.setTime(cfg.getCoreCfg().getIesClient().getDatesCollection().getHoresClase()[h-1]);\n cal.set(Calendar.YEAR, m_cal.get(Calendar.YEAR));\n cal.set(Calendar.MONTH, m_cal.get(Calendar.MONTH));\n cal.set(Calendar.DAY_OF_MONTH, m_cal.get(Calendar.DAY_OF_MONTH));\n cal.add(Calendar.MINUTE, cfg.activaMissatges);\n\n cal2 = (Calendar) cal.clone();\n cal2.add(Calendar.SECOND, 4); //show during 4 sec\n\n //System.out.println(\"ara es hora\" + h);\n //System.out.println(\"comparing dates \" + cal.getTime() + \"; \" + cal2.getTime() + \"; \" + m_cal.getTime());\n\n if(cal.compareTo(m_cal)<=0 && m_cal.compareTo(cal2)<=0 )\n {\n show = true;\n }\n\n return show;\n }", "@FXML\n public void todaySelected() {\n ArrayList<Interview> todayInterviews = new ArrayList<>();\n for (Interview it : this.interviewer.getPendingInterviews()) {\n Date itDate = it.getDate();\n if (itDate.getYear() == new Date().getYear() &&\n itDate.getMonth() == new Date().getMonth() &&\n itDate.getDay() == new Date().getDay()) {\n todayInterviews.add(it);\n }\n }\n this.populateListInterview(todayInterviews);\n }", "public void displayEvents() {\n List<EventModel> day1List=new ArrayList<>();\n List<EventModel> day2List=new ArrayList<>();\n List<EventModel> day3List=new ArrayList<>();\n List<EventModel> day4List=new ArrayList<>();\n\n// noEventsPreRevels = findViewById(R.id.cat_pre_revels_no_events);\n noEventsDay1 = findViewById(R.id.cat_day_1_no_events);\n noEventsDay2 = findViewById(R.id.cat_day_2_no_events);\n noEventsDay3 = findViewById(R.id.cat_day_3_no_events);\n noEventsDay4 = findViewById(R.id.cat_day_4_no_events);\n\n if (mDatabase == null)\n return;\n\n RealmResults<ScheduleModel> scheduleResultsRealm = mDatabase.where(ScheduleModel.class).equalTo(\"catId\", cat_id).findAll().sort(\"startTime\");\n scheduleResults = mDatabase.copyFromRealm(scheduleResultsRealm);\n for (ScheduleModel schedule : scheduleResults) {\n// if (schedule.getIsRevels().contains(\"0\")) {\n// Log.d(TAG, \"displayEvents: PreRevels\");\n// EventDetailsModel eventDetails = mDatabase.where(EventDetailsModel.class).equalTo(\"eventID\", schedule.getEventID()).findFirst();\n// EventModel event = new EventModel(eventDetails, schedule);\n// preRevelsList.add(event);\n// } else {\n\n Log.d(TAG, schedule.toString());\n EventDetailsModel eventDetails = mDatabase.where(EventDetailsModel.class).equalTo(\"eventId\", schedule.getEventId()).findFirst();\n EventModel event = new EventModel(eventDetails, schedule);\n switch (event.getDay()) {\n case \"1\":\n day1List.add(event);\n break;\n case \"2\":\n day2List.add(event);\n break;\n case \"3\":\n day3List.add(event);\n break;\n case \"4\":\n day4List.add(event);\n break;\n }\n// }\n }\n// preRevelsEventSort(preRevelsList);\n eventSort(day1List);\n eventSort(day2List);\n eventSort(day3List);\n eventSort(day4List);\n\n// RecyclerView recyclerViewDayPreRevels = findViewById(R.id.category_pre_revels_recycler_view);\n// if (preRevelsList.isEmpty()) {\n// noEventsPreRevels.setVisibility(View.VISIBLE);\n// recyclerViewDayPreRevels.setVisibility(View.GONE);\n// } else {\n// recyclerViewDayPreRevels.setAdapter(new CategoryEventsAdapter(preRevelsList, this, getBaseContext(), false));\n// recyclerViewDayPreRevels.setNestedScrollingEnabled(false);\n// recyclerViewDayPreRevels.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));\n// }\n\n RecyclerView recyclerViewDay1 = findViewById(R.id.category_day_1_recycler_view);\n if(day1List.isEmpty()){\n noEventsDay1.setVisibility(View.VISIBLE);\n recyclerViewDay1.setVisibility(View.GONE);\n }\n else{\n recyclerViewDay1.setAdapter(new CategoryEventsAdapter(day1List, this, getBaseContext(), true, this));\n recyclerViewDay1.setNestedScrollingEnabled(false);\n recyclerViewDay1.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));\n }\n\n RecyclerView recyclerViewDay2 = findViewById(R.id.category_day_2_recycler_view);\n if(day2List.isEmpty()){\n noEventsDay2.setVisibility(View.VISIBLE);\n recyclerViewDay2.setVisibility(View.GONE);\n }\n else{\n recyclerViewDay2.setAdapter(new CategoryEventsAdapter(day2List, this, getBaseContext(), true, this));\n recyclerViewDay2.setNestedScrollingEnabled(false);\n recyclerViewDay2.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));\n }\n\n RecyclerView recyclerViewDay3 = findViewById(R.id.category_day_3_recycler_view);\n if(day3List.isEmpty()){\n noEventsDay3.setVisibility(View.VISIBLE);\n recyclerViewDay3.setVisibility(View.GONE);\n }\n else {\n recyclerViewDay3.setAdapter(new CategoryEventsAdapter(day3List, this, getBaseContext(), true, this));\n recyclerViewDay3.setNestedScrollingEnabled(false);\n recyclerViewDay3.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));\n }\n\n RecyclerView recyclerViewDay4 = findViewById(R.id.category_day_4_recycler_view);\n if(day4List.isEmpty()){\n noEventsDay4.setVisibility(View.VISIBLE);\n recyclerViewDay4.setVisibility(View.GONE);\n }\n else {\n recyclerViewDay4.setAdapter(new CategoryEventsAdapter(day4List, this, getBaseContext(), true, this));\n recyclerViewDay4.setNestedScrollingEnabled(false);\n recyclerViewDay4.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));\n }\n }", "public void clearMatches() {\n JPanel spaceholder = new JPanel();\n spaceholder.setBackground(Color.white);\n scroller.setViewportView(spaceholder);\n scroller.validate();\n scroller.repaint();\n }", "@Override\r\n\tprotected void onActivityResult(int arg0, int arg1, Intent arg2) {\n\t\tsuper.onActivityResult(arg0, arg1, arg2);\r\n\t\tString squery = \"SELECT * FROM \" + \"'\" + year + \".\" + month\r\n\t\t\t\t+ \"' WHERE day = \" + day + \";\";\r\n\t\tCursor c = database.rawQuery(squery, null);\r\n\r\n\t\tc.moveToFirst();\r\n\r\n\t\tdayCell.clear();\r\n\t\tdo {\r\n\t\t\tif (c.getString(4) != null) {\r\n\t\t\tdayCell.add(new DailyCell(String.valueOf(c.getInt(0)), String\r\n\t\t\t\t\t.valueOf(c.getInt(1)), String.valueOf(c.getDouble(2)),\r\n\t\t\t\t\tString.valueOf(c.getDouble(3)), c.getString(4), c.getString(5)));\r\n\t\t\t}\r\n\t\t} while (c.moveToNext());\r\n\t\tmDailyAdapter.notifyDataSetChanged();\r\n\t}", "public boolean getMissingResults() {\n return missingResults_;\n }", "boolean hasAdScheduleView();", "private void drawNoResultsMessage()\n\t{\n\t\tFont font = new Font(\"Invalid\", Font.BOLD, 30);\t\t\n\t\ttitle.setBounds((super.getWidth()/2) - 380, (super.getHeight()/2) - 70, 800, 50);\n\t\ttitle.setFont(font);\n\t\tthis.add(title);\n\t}", "public boolean isDisplayed() {\n return isValid() && (getLastSeen() > System.currentTimeMillis() - DAYS_30);\n }", "@Override\n public View getItem(int index, View cachedView, ViewGroup parent) {\n\t\t\tint day = index;\n\t\t\t\n\t\t\tLog.e(TAG, \"index = \" + index + \" ,day = \" + day);\n\t\t\t\n Calendar newCalendar = (Calendar) calendar.clone();\n newCalendar.add(Calendar.DAY_OF_YEAR, day);\n \n View view = super.getItem(index, cachedView, parent);\n\n TextView weekday = (TextView) view.findViewById(R.id.time2_weekday);\n TextView monthday = (TextView) view.findViewById(R.id.time2_monthday);\n \n\n if (day == 0) {\n \tif( Utils.utc2DateTime(\"yyyy-MM-dd\", newCalendar.getTime()).equals(Utils.utc2DateTime(\"yyyy-MM-dd\", Calendar.getInstance().getTime()))) {\n\t monthday.setText(\"Today\");\n\t monthday.setTextColor(0xFF0000F0);\n\t weekday.setText(\"\");\n \t}\n \telse {\n \tmonthday.setText(Utils.utc2DateTime(\"yyyy-MM-dd\", newCalendar.getTime()));\n monthday.setTextColor(0xFF111111);\n weekday.setText(Utils.utc2DateTime(\"E\", newCalendar.getTime()));\n \t}\n \n } else {\n //DateFormat format = new SimpleDateFormat(\"yyyy-MM-dd\");\n //monthday.setText(format.format(newCalendar.getTime()));\n \tmonthday.setText(Utils.utc2DateTime(\"yyyy-MM-dd\", newCalendar.getTime()));\n monthday.setTextColor(0xFF111111);\n weekday.setText(Utils.utc2DateTime(\"E\", newCalendar.getTime()));\n }\n \n //DateFormat dFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n //view.setTag(dFormat.format(newCalendar.getTime()));\n view.setTag(Utils.utc2DateTime(\"yyyy-MM-dd\", newCalendar.getTime()));\n return view;\n }", "private void emptyView(){\n if(adapter.getItemCount() <= 0){\n v.setVisibility(View.GONE);\n empty.setVisibility(View.VISIBLE);\n } else {\n v.setVisibility(View.VISIBLE);\n empty.setVisibility(View.GONE);\n }\n }", "@Test\n\tpublic void testListReservationsOfFacilityNoMatch() {\n\t\t// create a reservation of another user\n\t\tdataHelper.createPersistedReservation(USER_ID, Arrays.asList(room1.getId()), validStartDate, validEndDate);\n\n\t\t// should not find above reservation\n\t\tCollection<Reservation> reservationsOfFacility;\n\t\treservationsOfFacility = bookingManagement.listReservationsOfFacility(infoBuilding.getId(),\n\t\t\t\tvalidStartDate, validEndDate);\n\t\tassertNotNull(reservationsOfFacility);\n\t\tassertTrue(reservationsOfFacility.isEmpty());\n\t}", "@Override\n public String displayUponMatchingResult() {\n\n if (brand == null || brand.equals(\"N/A\")) {\n return String.format(\"%s (%s)\", foodLabel, category);\n } else {\n return String.format(\"%s (%s by %s)\", foodLabel, category, brand);\n }\n\n }", "public static void viewBy() {\n\t\tMONTHS[] arrayOfMonths = MONTHS.values();\n\t\tLONGDAYS[] arrayOfLongDays = LONGDAYS.values();\n\t\tSystem.out.println(\"[D]ay view or [M]onth view ? \");\n\t\tScanner sc = new Scanner(System.in);\n\t\tString input;\n\t\tif (sc.hasNextLine()) {\n\t\t\tinput = sc.nextLine().toLowerCase();\n\n\t\t\tif (input.equals(\"d\")) { //day view\t\t\t\t\n\t\t\t\tGregorianCalendar cal1 = new GregorianCalendar();\n\t\t\t\tGregorianCalendar cal = new GregorianCalendar(cal1.get(Calendar.YEAR), cal1.get(Calendar.MONTH)+1, cal1.get(Calendar.DAY_OF_MONTH));\n\t\t\t\tSystem.out.print(arrayOfLongDays[cal1.get(Calendar.DAY_OF_WEEK) - 1]);\n\t\t\t\tSystem.out.print(\", \");\n\t\t\t\tSystem.out.print(arrayOfMonths[cal.get(Calendar.MONTH)-1]);\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t\tSystem.out.print(cal.get(Calendar.DAY_OF_MONTH));\n\t\t\t\tSystem.out.print(\", \");\n\t\t\t\tSystem.out.print(cal.get(Calendar.YEAR));\n\t\t\t\tString values = getValues(cal);\n\t\t\t\tif (values != \"\") {\n\t\t\t\t\tSystem.out.println(\"\\n\" + values);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"\\nThere are no events scheduled for this day\");\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"\\n[P]revious or [N]ext or [M]ain menu ? \");\n\t\t\t\tinput = sc.nextLine().toLowerCase();\n\t\t\t\twhile (input.equals(\"n\") || input.equals(\"p\")) {\n\t\t\t\t\tif (input.equals(\"p\")) { // previous\n\t\t\t\t\t\tcal.add(Calendar.DAY_OF_MONTH, -1);\n\t\t\t\t\t\tcal1.add(Calendar.DAY_OF_MONTH, -1);\n\t\t\t\t\t\tSystem.out.print(arrayOfLongDays[cal1.get(Calendar.DAY_OF_WEEK) - 1]);\n\t\t\t\t\t\tSystem.out.print(\", \");\n\t\t\t\t\t\tSystem.out.print(arrayOfMonths[cal.get(Calendar.MONTH)-1]);\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t\tSystem.out.print(cal.get(Calendar.DAY_OF_MONTH));\n\t\t\t\t\t\tSystem.out.print(\", \");\n\t\t\t\t\t\tSystem.out.print(cal.get(Calendar.YEAR) + \"\\n\");\n\t\t\t\t\t\tString value = getValues(cal);\n\t\t\t\t\t\tif (value != \"\") {\n\t\t\t\t\t\t\tSystem.out.println(value);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.println(\"\\nThere are no events scheduled for this day\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tSystem.out.println(\"\\n[P]revious or [N]ext or [M]ain menu ? \");\n\t\t\t\t\t\tinput = sc.nextLine().toLowerCase();\n\t\t\t\t\t} else if (input.equals(\"n\")) { // next\n\t\t\t\t\t\tcal.add(Calendar.DAY_OF_MONTH, 1);\n\t\t\t\t\t\tcal1.add(Calendar.DAY_OF_MONTH, 1);\n\t\t\t\t\t\tSystem.out.print(arrayOfLongDays[cal1.get(Calendar.DAY_OF_WEEK) - 1]);\n\t\t\t\t\t\tSystem.out.print(\", \");\n\t\t\t\t\t\tSystem.out.print(arrayOfMonths[cal.get(Calendar.MONTH)-1]);\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t\tSystem.out.print(cal.get(Calendar.DAY_OF_MONTH));\n\t\t\t\t\t\tSystem.out.print(\", \");\n\t\t\t\t\t\tSystem.out.print(cal.get(Calendar.YEAR) + \"\\n\");\n\t\t\t\t\t\tString values1 = getValues(cal);\n\t\t\t\t\t\tif (values1 != \"\") {\n\t\t\t\t\t\t\tSystem.out.println(values1);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.println(\"\\nThere are no events scheduled for this day\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tSystem.out.println(\"\\n[P]revious or [N]ext or [M]ain menu ? \");\n\t\t\t\t\t\tinput = sc.nextLine().toLowerCase();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (input.equals(\"m\")) { // main menu\n\t\t\t\t\tSystem.out.println(\"main menu\");\n\t\t\t\t} else { // user didn't input a valid option\n\t\t\t\t\tSystem.out.println(\"\\n[P]revious or [N]ext or [M]ain menu ? \");\n\t\t\t\t}\n\n\t\t\t} else if (input.equals(\"m\")) { // month view\n\t\t\t\tGregorianCalendar cal = new GregorianCalendar();\n\t\t\t\tdisplayMainMenuWithEvents(cal);\n\t\t\t\tSystem.out.println(\"[P]revious or [N]ext or [M]ain menu ? \");\n\t\t\t\tinput = sc.nextLine().toLowerCase();\n\t\t\t\twhile (input.equals(\"p\") || input.equals(\"n\")) {\n\t\t\t\t\tif (input.equals(\"p\")) { // previous\n\t\t\t\t\t\tcal.add(Calendar.MONTH, -1);\n\t\t\t\t\t\tdisplayMainMenuWithEvents(cal);\n\t\t\t\t\t\tSystem.out.println(\"\\n[P]revious or [N]ext or [M]ain menu ? \");\n\t\t\t\t\t\tinput = sc.nextLine().toLowerCase();\n\t\t\t\t\t} else if (input.equals(\"n\")) { // next\n\t\t\t\t\t\tcal.add(Calendar.MONTH, 1);\n\t\t\t\t\t\tdisplayMainMenuWithEvents(cal);\n\t\t\t\t\t\tSystem.out.println(\"\\n[P]revious or [N]ext or [M]ain menu ? \");\n\t\t\t\t\t\tinput = sc.nextLine().toLowerCase();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (input.equals(\"m\")) { // main menu\n\t\t\t\t\tSystem.out.println(\"main menu\");\n\t\t\t\t} else { // user didn't input a valid option\n\t\t\t\t\tSystem.out.println(\"\\n[P]revious or [N]ext or [M]ain menu ? \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void showDetails(View view){\n View parent=(View)view.getParent();\n taskname=(TextView)parent.findViewById(R.id.tname);\n String ts=String.valueOf(taskname.getText());\n ArrayList<String>a = help.getAllTaskDtae( ts);\n if(a.isEmpty() ) {\n // show message\n showMessage(\"Error\",\"Nothing found\");\n return;\n }\n StringBuffer buffer = new StringBuffer();\n if(a.contains(ts)) {\n buffer.append(\"Task Name :- \"+ a.get(0)+\"\\n\");\n buffer.append(\"Task Date :- \"+ a.get(1)+\"\\n\");\n buffer.append(\"Remainder Date :\"+ a.get(2)+\"\\n\\n\");\n }\n\n //Show all data\n showMessage(\"Data\",buffer.toString());\n }", "@Test\n public void myMeetingList_ShouldNotBeEmpty() {\n onView(withId(R.id.recyclerview)).check(matches(hasMinimumChildCount(1)));\n }", "public boolean getMissingResults() {\n return missingResults_;\n }", "public void displayValidityReport() {\r\n\t\tif (this.tuple == null)\r\n\t\t\treturn;\r\n\t\tsetMessage(\"\");\r\n\t\tint row = this.tableView.getSelectedRow();\r\n\t\tif (row < this.tuple.getNumberOfEntries() && row >= 0)\r\n\t\t\tdisplayValidityReport(row);\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_daily, container, false);\n\n TextView titleTextView = (TextView) v.findViewById(R.id.textTitle);\n TextView descriptionTextView = (TextView) v.findViewById(R.id.textDesc);\n TextView dateTextView = (TextView) v.findViewById(R.id.dateTextView);\n TextView businessTextView = (TextView) v.findViewById(R.id.businessTextView);\n TextView loveTextView = (TextView) v.findViewById(R.id.loveTextView);\n TextView healthTextView = (TextView) v.findViewById(R.id.healthTextView);\n LinearLayout imageContentLayout = (LinearLayout) v.findViewById(R.id.imageContentLayout);\n\n imageContentLayout.setVisibility(View.VISIBLE);\n\n Log.d(\"my_log_daily_ocview\",\"zodiak name is \"+zname);\n\n Calendar c = Calendar.getInstance();\n System.out.println(\"Current date => \"+c.get(c.DATE));\n System.out.println(\"zname length => \"+zname.toCharArray().length);\n switch (zname) {\n case \"Тоқты\": chooseith(c,zname);\n break;\n case \"Торпақ\": chooseith(c,zname);\n break;\n case \"Егіздер\": chooseith(c,zname);\n break;\n case \"Шаян\": chooseith(c,zname);\n break;\n case \"Арыстан\": chooseith(c,zname);\n break;\n case \"Бикеш\": chooseith(c,zname);\n break;\n case \"Таразы\": chooseith(c,zname);\n break;\n case \"Сарышаян\": chooseith(c,zname);\n break;\n case \"Мерген\": chooseith(c,zname);\n break;\n case \"Тауешкі\": chooseith(c,zname);\n break;\n case \"Балықтар\": chooseith(c,zname);\n break;\n case \"Суқұйғыш\": chooseith(c,zname);\n break;\n }\n\n\n businessTextView.setText(\"Бизнес: \"+i1);\n loveTextView.setText(\"Махаббат: \"+i2);\n healthTextView.setText(\"Денсаулық: \"+i3);\n\n\n SimpleDateFormat df = new SimpleDateFormat(\"dd.MM.yyyy\");\n String formattedDate = df.format(c.getTime());\n\n// titleTextView.setText(zname);\n descriptionTextView.setText(zodiakDescriptionToday);\n dateTextView.setText(formattedDate);\n\n return v;\n }", "EmptyDay(StoreData viewData, final JFrame parent, int numOfEvents){\n\t\tlayout = new GridBagLayout();\n\t\tGridBagConstraints con = new GridBagConstraints();\n\t\tscroll = new JScrollPane(masterPane);\n\t\tmasterPane.setLayout(layout);\n\t\tthis.add(scroll, BorderLayout.CENTER);\n\n\t\t// Listener for button that sends user back to weekly/monthly view\n\t\tclose.addActionListener(new ActionListener(){\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e){\n\t\t\t\tthisThing.dispose();\n\t\t\t}\n\t\t});\n\t\t// Populates window with text\n\t\tJLabel combine;\n\t\tcombine = new JLabel(\"There are\" );\n\t\tnameL = combine;\n\t\tduration = new JLabel(\"no events on\");\n\t\tdescripL = new JLabel(\"the day you have selected.\");\n\t\tlocationL = new JLabel(\"Please select a day with events.\");\n\t\t// Sets font for text.\n\t\tcombine.setFont(new Font(\"Serif\", Font.PLAIN, 52));\n\t\tnameL.setFont(new Font(\"Serif\", Font.PLAIN, 46));\n\t\tduration.setFont(new Font(\"Serif\", Font.PLAIN, 46));\n\t\tdescripL.setFont(new Font(\"Serif\", Font.PLAIN, 46));\n\t\tlocationL.setFont(new Font(\"Serif\", Font.PLAIN, 46));\n\t\tspace.setFont(new Font(\"Serif\", Font.PLAIN, 46));\n\t\t// Creates separator that will never exist\n\t\tJSeparator sep = new JSeparator(JSeparator.HORIZONTAL);\n\t\tsep.setPreferredSize(new Dimension(300,10));\n\t\t// Panel that holds the text alerting the user that no events exist on selected day\n\t\tJPanel eventPanel = new JPanel();\n\t\teventPanel.setLayout(new GridBagLayout());\n\t\tGridBagConstraints s = new GridBagConstraints();\n\t\ts.anchor = GridBagConstraints.NORTH;\n\t\ts.insets = new Insets(0,0,5,0);\n\t\ts.gridx = 0;\n\t\ts.gridy = 0;\n\t\teventPanel.add(nameL, s);\n\t\ts.gridx = 0;\n\t\ts.gridy = 1;\n\t\teventPanel.add(duration, s);\n\t\ts.gridx = 0;\n\t\ts.gridy = 2;\n\t\teventPanel.add(descripL, s);\n\t\ts.gridx = 0;\n\t\ts.gridy = 3;\n\t\teventPanel.add(locationL, s);\n\t\ts.gridx = 0;\n\t\ts.gridy = 4;\n\t\teventPanel.add(close, s);\n\t\ts.gridx = 0;\n\t\ts.gridy = 5;\n\t\teventPanel.add(space, s);\n\t\t//s.fill = GridBagConstraints.VERTICAL;\n\t\ts.weightx = 1;\n\t\tmasterPane.add(eventPanel, con);\n\t\tmasterPane.revalidate();\n\t\tmasterPane.repaint();\n\n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tthis.setSize(600,550);\n\t\tthis.setVisible(true);\n\t\tthis.setResizable(false);\n\t}", "public void show_message_no_data() {\n\t\tAlertDialog.Builder dialog=new AlertDialog.Builder(this);\n\t\t\n dialog.setTitle(\"Notice\");\n dialog.setMessage(\"No data for TI list\");\n \n dialog.setPositiveButton(\"OK\",new DialogListener(this, dialog, 0));\n \n dialog.create();\n dialog.show();\n\t\t\n\t}", "public void my_timesheet_report()\n {\n\t boolean timesheetreppresent =mytimesheetrep.size()>0;\n\t if(timesheetreppresent)\n\t {\n\t\t // System.out.println(\" My Timesheet report is PRESENT\");\n\t }\n\t else\n\t {\n\t\t System.out.println(\"Timesheet report is not present\");\n\t }\n }", "public Builder clearMissingResults() {\n \n missingResults_ = false;\n onChanged();\n return this;\n }", "private void visitToSearch() {\n if (search_Attendance==null) {\n search_Attendance=new Search_Attendance();\n search_Attendance.setVisible(true);\n } else {\n search_Attendance.setVisible(true);\n }\n }", "public static void printEmptyEventDateError() {\n botSpeak(Message.EMPTY_EVENT_DATE_ERROR);\n }", "public boolean isMissingData() {\n return myModel.getRealtimeTimestamp() == 0;\n }", "protected void showReservations() {\n storageDao.findAllRented()\n .forEach(System.out::println);\n }", "public void addData() {\n if (daySchedule == null) {\n return;\n }\n int numTimes = daySchedule.size();\n TableLayout tl = findViewById(R.id.table);\n int chosenTime = MainActivity.hour * 60 + MainActivity.minute;\n if(chosenTime == 0)\n {\n Calendar now = Calendar.getInstance();\n chosenTime = now.get(Calendar.HOUR_OF_DAY) * 60 + now.get(Calendar.MINUTE);;\n }\n for (int i = 0; i < numTimes; i++) {\n TableRow tr = new TableRow(this);\n tr.setLayoutParams(getLayoutParams());\n Time t = daySchedule.get(i);\n if (!haverford) {\n if (Time.toMinutes(t.leaveBrynMawr()) > chosenTime) {\n Log.d(\"brynmawrtime\", String.valueOf(Time.toMinutes(t.leaveBrynMawr())));\n tr.addView(getTextView(i + 1, t.leaveBrynMawr(), Color.WHITE, Typeface.NORMAL, ContextCompat.getColor(this, R.color.colorAccent)));\n tr.addView(getTextView(i + numTimes, t.arriveHaverford(), Color.WHITE, Typeface.NORMAL, ContextCompat.getColor(this, R.color.colorAccent)));\n }\n } else {\n if (Time.toMinutes(t.leaveHaverford()) > chosenTime) {\n tr.addView(getTextView(i + 1, t.leaveHaverford(), Color.WHITE, Typeface.NORMAL, ContextCompat.getColor(this, R.color.colorAccent)));\n tr.addView(getTextView(i + numTimes, t.arriveBrynMawr(), Color.WHITE, Typeface.NORMAL, ContextCompat.getColor(this, R.color.colorAccent)));\n }\n }\n tl.addView(tr, getTblLayoutParams());\n }\n }", "@Override\r\n\tprotected boolean isValidView(final ResultSet resultSet) throws SQLException {\r\n\t\treturn !resultSet.getString(3).contains(\"BIN$\");\r\n\t}", "@Override\n\tpublic int getCount() {\n\t\treturn appointments_model.size();\n\t}", "public static boolean testDaoLireUnRapportVisite() {\n boolean ok = true;\n RapportVisite unRapportVisite = null;\n try {\n unRapportVisite = daoRapportVisite.getOne(3);\n unRapportVisite.DateToString();\n } catch (Exception ex) {\n ok = false;\n }\n \n System.out.println(\"le rapport de visite:\");\n System.out.println(unRapportVisite);\n \n return ok;\n }", "public void timesheet_report()\n {\n\t boolean timesheetreppresent =timesheetrep.size()>0;\n\t if(timesheetreppresent)\n\t {\n\t\t // System.out.println(\"Timesheet report is PRESENT\");\n\t }\n\t else\n\t {\n\t\t System.out.println(\"Timesheet report is not present\");\n\t }\n }", "private void displayDatePickerAndUpdateUi(View view) {\n Calendar calendar = Calendar.getInstance();\n int year = calendar.get(Calendar.YEAR);\n int month = calendar.get(Calendar.MONTH);\n int day = calendar.get(Calendar.DAY_OF_MONTH);\n DatePickerDialog datePickerDialog = new DatePickerDialog(mActivity, (datePicker, year1, month1, day1) -> {\n int id = view.getId();\n if (id == R.id.fragment_search_for_sale_txt) {\n mBinding.fragmentSearchForSaleTxt.setText(getString(R.string.hour_format, day1, month1 + 1, year1));\n } else if (id == R.id.fragment_search_sold_txt) {\n mBinding.fragmentSearchSoldTxt.setText(getString(R.string.hour_format, day1, month1 + 1, year1));\n }\n }, year, month, day);\n datePickerDialog.setButton(DialogInterface.BUTTON_NEUTRAL, \"Delete Date\", (dialogInterface, i) -> {\n int id = view.getId();\n if (id == R.id.fragment_search_for_sale_txt) {\n mBinding.fragmentSearchForSaleTxt.setText(null);\n } else if (id == R.id.fragment_search_sold_txt) {\n mBinding.fragmentSearchSoldTxt.setText(null);\n }\n });\n datePickerDialog.show();\n }", "void displayAppointment(){\n\r\n if(accountType.equalsIgnoreCase(\"Patient\")){\r\n try{\r\n int i = user.getAppointments().size();\r\n Appointment appointment = user.getAppointments().get(i - 1);\r\n appointmentTime.setText(appointment.getDate().toString());\r\n appointmentNewsFeed.setText(\"Dr.\" + appointment.getSpecialist().getFirstname() + \" \" + appointment.getSpecialist().getLastname());\r\n appointmentStatus.setText(appointment.getStatus());\r\n\r\n if(appointment.getStatus().equalsIgnoreCase(\"CANCEL\")){\r\n appointmentStatus.setForeground(Color.RED);\r\n }\r\n else if(appointment.getStatus().equalsIgnoreCase(\"WAITING\")){\r\n appointmentStatus.setForeground(Color.YELLOW);\r\n }\r\n else if(appointment.getStatus().equalsIgnoreCase(\"IN-PROGRESS\")){\r\n appointmentStatus.setForeground(Color.GREEN);\r\n }\r\n else if(appointment.getStatus().equalsIgnoreCase(\"FINISHED\")){\r\n appointmentStatus.setForeground(Color.BLUE);\r\n }\r\n else if(appointment.getStatus().equalsIgnoreCase(\"NEW APPOINTMENT\")){\r\n appointmentStatus.setForeground(Color.cyan);\r\n }\r\n\r\n }catch(Exception e){\r\n appointmentNewsFeed.setText(\"No Upcoming Appointments\");\r\n }\r\n }else if(accountType.equalsIgnoreCase(\"Specialist\")){\r\n try{\r\n int i = user.getAppointments().size();\r\n Appointment appointment = user.getAppointments().get(i - 1);\r\n appointmentTime.setText(appointment.getDate().toString());\r\n appointmentNewsFeed.setText(appointment.getPatient().getFirstname() + \" \" + appointment.getPatient().getLastname());\r\n appointmentStatus.setText(appointment.getStatus());\r\n\r\n if(appointment.getStatus().equalsIgnoreCase(\"CANCEL\")){\r\n appointmentStatus.setForeground(Color.RED);\r\n }\r\n else if(appointment.getStatus().equalsIgnoreCase(\"WAITING\")){\r\n appointmentStatus.setForeground(Color.YELLOW);\r\n }\r\n else if(appointment.getStatus().equalsIgnoreCase(\"IN-PROGRESS\")){\r\n appointmentStatus.setForeground(Color.GREEN);\r\n }\r\n else if(appointment.getStatus().equalsIgnoreCase(\"FINISHED\")){\r\n appointmentStatus.setForeground(Color.BLUE);\r\n }\r\n else if(appointment.getStatus().equalsIgnoreCase(\"NEW APPOINTMENT\")){\r\n appointmentStatus.setForeground(Color.cyan);\r\n }\r\n\r\n\r\n }catch(Exception e){\r\n appointmentNewsFeed.setText(\"No Upcoming Appointments\");\r\n }\r\n\r\n }else if(accountType.equalsIgnoreCase(\"Administrator\")){\r\n try{\r\n int i = user.getAppointments().size();\r\n Appointment appointment = user.getAppointments().get(i - 1);\r\n appointmentTime.setText(appointment.getDate().toString());\r\n appointmentNewsFeed.setText(\"Dr.\" + appointment.getSpecialist().getFirstname() + \" \" + appointment.getSpecialist().getLastname() + \" and \" + appointment.getPatient().getFirstname() + \" \" + appointment.getPatient().getLastname());\r\n appointmentStatus.setText(appointment.getStatus());\r\n\r\n if(appointment.getStatus().equalsIgnoreCase(\"CANCEL\")){\r\n appointmentStatus.setForeground(Color.RED);\r\n }\r\n else if(appointment.getStatus().equalsIgnoreCase(\"WAITING\")){\r\n appointmentStatus.setForeground(Color.YELLOW);\r\n }\r\n else if(appointment.getStatus().equalsIgnoreCase(\"IN-PROGRESS\")){\r\n appointmentStatus.setForeground(Color.GREEN);\r\n }\r\n else if(appointment.getStatus().equalsIgnoreCase(\"FINISHED\")){\r\n appointmentStatus.setForeground(Color.BLUE);\r\n }\r\n else if(appointment.getStatus().equalsIgnoreCase(\"NEW APPOINTMENT\")){\r\n appointmentStatus.setForeground(Color.cyan);\r\n }\r\n\r\n }catch(Exception e){\r\n appointmentNewsFeed.setText(\"No Upcoming Appointments\");\r\n }\r\n }\r\n }", "@Override public void searchStopped() {\n progressBar.setVisibility(View.GONE);\n if(userAdapter.getItemCount() == 0){\n Snackbar.make(recyclerView, R.string.string_no_any_user, Snackbar.LENGTH_SHORT).show();\n }\n}", "void showNoneParametersView();", "@Override\n public void onShowRefresh(boolean notUsed) {\n // nothing required for this assignment.\n }", "public void noSearch() {\n\t\tprintMsg(\"검색결과없음\");\n\t\t//굳이 필요는 없지만 편의성\n\t\t//System.out.println(\"검색결과없음\");\n\t}" ]
[ "0.61531097", "0.61132485", "0.57636786", "0.5732152", "0.5520446", "0.54781103", "0.5471621", "0.54240745", "0.54192245", "0.5414938", "0.54024994", "0.53260523", "0.53015447", "0.5295616", "0.5278784", "0.5271252", "0.52643424", "0.52378", "0.5163518", "0.5139335", "0.51242757", "0.5115026", "0.50981027", "0.5075873", "0.5075704", "0.5064661", "0.5062819", "0.5062819", "0.5062414", "0.5053201", "0.5050934", "0.50330764", "0.5018699", "0.5016247", "0.5012495", "0.49956378", "0.49907017", "0.4984046", "0.49840158", "0.496122", "0.4947123", "0.49415487", "0.4939605", "0.49354753", "0.49205214", "0.4918887", "0.48977605", "0.48850718", "0.48832527", "0.48787457", "0.48780385", "0.4861286", "0.4849652", "0.48379084", "0.483745", "0.4827293", "0.48260796", "0.48231146", "0.48149323", "0.48143193", "0.48123312", "0.48116675", "0.48075077", "0.47967768", "0.47924215", "0.47904643", "0.47865987", "0.47811916", "0.47743544", "0.47681636", "0.47668037", "0.47609445", "0.4753206", "0.4752686", "0.4750378", "0.47478786", "0.47429505", "0.47425747", "0.4740361", "0.47359538", "0.47354126", "0.47287026", "0.47219488", "0.4718014", "0.47154453", "0.4713485", "0.4712597", "0.47071892", "0.47056818", "0.4704218", "0.4703981", "0.47026736", "0.47015548", "0.46914285", "0.469073", "0.46881565", "0.46844864", "0.4683832", "0.46833608", "0.46818143" ]
0.52022314
18
Method responsible for control the refresh icon
private void postRefreshing(final boolean refreshing) { // Check if layout is not null and then add or remove the refresh icon according to the parameter if (mSwipeRefreshLayout != null) mSwipeRefreshLayout.post(new Runnable() { @Override public void run() { if (mSwipeRefreshLayout != null) mSwipeRefreshLayout.setRefreshing(refreshing); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\tpublic void onRefreshClick() {\n\t\t\t\thttpRefreshMethod();\n\t\t\t}", "public void Refresh_button() {\n\t\tthis.defaultSetup();\n\t}", "public void refresh() {\n \t\n /* Attach a rotating ImageView to the refresh item as an ActionView */\n LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n ImageView iv = (ImageView) inflater.inflate(R.layout.refresh_action_view, null);\n\n Animation rotation = AnimationUtils.loadAnimation(mContext, R.anim.clockwise_refresh);\n rotation.setRepeatCount(Animation.INFINITE);\n iv.startAnimation(rotation);\n\n mSGV.setVisibility(View.INVISIBLE);\n mProgress.setVisibility(View.VISIBLE);\n \n mRefreshItem.setActionView(iv);\n refreshGoodsItems();\n \n }", "private void updateBusyIcon() {\n this.jLabelIcon.setIcon( getSelectedBusyICon() );\n }", "private void setModifiedAndUpdateIcon() {\n document.setModified(true);\n updateTabIcon(document);\n }", "private void toggleRefresh() {\n if (mProgressBar.getVisibility() == View.INVISIBLE) {\n mProgressBar.setVisibility(View.VISIBLE);\n mRefreshImageView.setVisibility(View.INVISIBLE);\n } else {\n mProgressBar.setVisibility(View.INVISIBLE);\n mRefreshImageView.setVisibility(View.VISIBLE);\n }\n }", "public void setRefreshMenu() {\n }", "@Override\r\n\tprotected ActionListener refreshBtnAction() {\n\t\treturn null;\r\n\t}", "public void refreshFavoriteBtn() {\r\n if (recipe.isFavorite(context)) {\r\n favoriteBtn.setIcon(\"faw_star\");\r\n } else {\r\n favoriteBtn.setIcon(\"faw_star_o\");\r\n }\r\n }", "@Override\n public void onRefresh() {\n }", "@Override\n\tpublic void onRefresh() {\n\n\t}", "public void onReloadClicked() {\n\n }", "@Override\r\n\tpublic void onRefresh() {\n\r\n\t}", "void onRefresh() {\n\t}", "private VehicleMessageRefreshButton getRefresh() {\r\n\t\tif (refresh == null) {\r\n\t\t\trefresh = new VehicleMessageRefreshButton();\r\n\t\t\trefresh.setToolTipText(\"Refresh data\");\r\n\t\t\trefresh.setMargin(ViewHelper.getMinimalButtonMargin());\r\n\t\t\trefresh.setIcon(new ImageIcon(getClass().getResource(\"/br/skylight/cucs/images/refresh.gif\")));\r\n\t\t\trefresh.setup(subscriberService, messagingService, MessageType.M100);\r\n\t\t}\r\n\t\treturn refresh;\r\n\t}", "@Override\n public void onRefresh() {\n }", "private void updateBaseIcon() {\n this.squareIcon.setDecoratedIcon( getSelectedBaseIcon() );\n this.radialIcon.setDecoratedIcon( getSelectedBaseIcon() );\n }", "private VehicleMessageRefreshButton getRefresh() {\r\n\t\tif (refresh == null) {\r\n\t\t\trefresh = new VehicleMessageRefreshButton();\r\n\t\t\trefresh.setToolTipText(\"Refresh data\");\r\n\t\t\trefresh.setMargin(ViewHelper.getMinimalButtonMargin());\r\n\t\t\trefresh.setIcon(new ImageIcon(getClass().getResource(\"/br/skylight/cucs/images/refresh.gif\")));\r\n\t\t\trefresh.setup(subscriberService, messagingService, MessageType.M1100);\r\n\t\t}\r\n\t\treturn refresh;\r\n\t}", "@Override\r\n\t\t\tpublic void onRefresh() {\n\r\n\t\t\t}", "@Override\r\n\t\tpublic void requestIcon(String arg0) {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void onMyRefresh() {\n\t\t\n\t}", "@Override\n\tpublic void onMyRefresh() {\n\t\t\n\t}", "public void onRefresh() {\n }", "protected JButton createRefreshButton() {\n JButton butRefresh = new JButton();\n butRefresh.setIcon(new ImageIcon(getClass().getClassLoader().getResource(\"image/refresh3.png\")));\n butRefresh.setToolTipText(\"Refresh All\");\n butRefresh.addActionListener(new refreshListener());\n return butRefresh;\n }", "@Source(\"update.gif\")\n\tpublic DataResource updateIconDisabledResource();", "public void resetShellIcon() {\r\n\t\tGDE.display.asyncExec(new Runnable() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\tGDE.shell.setImage(SWTResourceManager.getImage(GDE.IS_MAC ? \"gde/resource/DataExplorer_MAC.png\" : \"gde/resource/DataExplorer.png\")); //$NON-NLS-1$ //$NON-NLS-2$\r\n\t\t\t}\r\n\t\t});\r\n\t}", "protected void refresh() {\n\t}", "@Override\n\tpublic void changeToReleaseRefresh() {\n\n\t}", "private void updateRefreshTime(){\n\t\t\trefreshLabel.setText(\"Last Updated: \" + (new Date()).toString());\n\t\t}", "@Override\r\n\tpublic void refreshUI(int id, MSG msg) {\n\r\n\t}", "@Override\n public void refresh() {\n }", "private void updateDisplayModeIcon() {\n FontAwesome icon = FontAwesome.CALENDAR;\n if (getDisplayMode().equals(DisplayMode.GRID)) {\n icon = FontAwesome.TABLE;\n }\n\n final FontIcon graphic = new FontIcon(icon);\n graphic.getStyleClass().addAll(\"button-icon\", \"display-mode-icon\");\n displayModeButton.setGraphic(graphic);\n }", "@Override\n\tpublic void refresh() {\n\t\t\n\t}", "@Override\n\tpublic void refresh() {\n\t\t\n\t}", "public void refresh() {\n }", "public void UI_Refresh ()\r\n\t{\r\n\t\tUI_RefreshSensorData ();\r\n\t\tUI_RefreshConnStatus ();\r\n\t}", "public void Refresh()\n\t{\n\t}", "@Override\n\tpublic void refresh() {\n\n\t}", "@Override\n public void refresh() {\n refresher.enqueueRefresh();\n }", "@Override\n public String getStatusIcon() {\n if (isDone) {\n return \"[X]\";\n } else {\n return \"[ ]\";\n }\n }", "@Override\n public void onRefresh() {\n synchronizeContent();\n }", "@Override\n\tpublic long updateDisplay() {\n\t\treturn AppStatus.NO_REFRESH;\n\t}", "protected String getStatusIcon() {\n return isDone ? \"x\" : \" \";\n }", "public void mo19868k() {\n ImageView imageView = (ImageView) mo19852a(R.id.iv_refresh);\n C8271i.m35382a((Object) imageView, \"iv_refresh\");\n ezy.p642a.View.m34750a(imageView, 0, new C3585b(this), 1, null);\n ((CenteredTitleBar) mo19852a(R.id.toolbar)).setNavigationOnClickListener(new C3586c(this));\n TextView textView = (TextView) mo19852a(R.id.tv_close);\n C8271i.m35382a((Object) textView, \"tv_close\");\n ezy.p642a.View.m34750a(textView, 0, new C3587d(this), 1, null);\n }", "public abstract void refreshing();", "@Override\n\t\tpublic void onRefresh() {\n\t\t\thttpRefreshMethod();\n\t\t}", "@Override\r\n\t\t\tpublic void onRefresh() {\n\t\t\t\tgetLichHoc();\r\n\t\t\t}", "@Override\n\t\tpublic void onRefresh() {\n\t\t\tloadInfo(1, 0);\n\t\t}", "private String getStatusIcon() {\n return this.isDone ? \"X\" : \"\";\n }", "public void changeIcon() {\n\t\t\tint choice = rand.nextInt(list.length);\n\t\t\tString iconName = list[choice].getName();\n\t\t\ticon = new ImageIcon(helpIconBase + File.separator + iconName);\n\t\t\tDimension dim = new Dimension(icon.getIconWidth() * 2, HEIGHT);\n\t\t\tsetPreferredSize(dim);\n\t\t\tsetMinimumSize(dim);\n\t\t}", "protected void refresh()\n {\n refresh(System.currentTimeMillis());\n }", "private String getStatusIcon() {\n return (isDone ? \"+\" : \"-\");\n }", "public void onRefreshClicked(){\n\t\tmGui.showToastRefresh(mData.getActivity());\r\n\t\t\r\n\t\t//update User Information in Data\r\n\t\tmData.setUser(mDataInterface.getUser(mData.getUser().getName()));\r\n\t\t\r\n\t\t//update Statistics in data\r\n\t\tmData.loadStatistics();\r\n\t\t\r\n\t\t//apply data (updated statistics) to Gui\r\n\t\tapplyDataToGui();\t\r\n\t}", "private void updateAlertIcon() {\n if (0 < alertCount && alertCount < 10) {\n countTextView.setText(String.valueOf(alertCount));\n } else {\n countTextView.setText(\"\");\n }\n\n redCircle.setVisibility((alertCount > 0) ? VISIBLE : GONE);\n\n }", "void backgroundRefresh();", "private void displayVisitIcon() {\n if (!mStrComingFrom.equalsIgnoreCase(Constants.RouteList)) {\n Constants.Route_Plan_Key = \"\";\n }\n if (mStrComingFrom.equalsIgnoreCase(Constants.AdhocList)\n || mStrComingFrom.equalsIgnoreCase(Constants.CustomerList)\n || mStrComingFrom.equalsIgnoreCase(Constants.RouteList)\n || mStrComingFrom.equalsIgnoreCase(Constants.OtherRouteList)) {\n iv_visit_status.setVisibility(View.VISIBLE);\n } else {\n iv_visit_status.setVisibility(View.GONE);\n }\n mBooleanVisitStartDialog = false;\n mBooleanVisitEndDialog = false;\n String mStrVisitStartEndQry = Constants.Visits + \"?$filter=StartDate eq datetime'\" + UtilConstants.getNewDate() + \"' and EndDate eq datetime'\" + UtilConstants.getNewDate() + \"'\" +\n \"and CPGUID eq '\" + mCpGuid.guidAsString32().toUpperCase() + \"' and \" + Constants.StatusID + \" eq '01'\";\n\n\n String mStrVisitStartedQry = Constants.Visits + \"?$filter=StartDate eq datetime'\" + UtilConstants.getNewDate() + \"' and EndDate eq null \" +\n \"and CPGUID eq '\" + mCpGuid.guidAsString32().toUpperCase() + \"'and \" + Constants.StatusID + \" eq '01'\";\n try {\n if (OfflineManager.getVisitStatusForCustomer(mStrVisitStartedQry)) {\n iv_visit_status.setImageResource(R.drawable.stop);\n mBooleanVisitStarted = true;\n } else if (OfflineManager.getVisitStatusForCustomer(mStrVisitStartEndQry)) {\n iv_visit_status.setImageResource(R.drawable.ic_done);\n mBooleanVisitStarted = false;\n } else {\n Constants.MapEntityVal.clear();\n\n String qry = Constants.Visits + \"?$filter=EndDate eq null and CPGUID eq '\" + mCpGuid.guidAsString32().toUpperCase() + \"' \" +\n \"and StartDate eq datetime'\" + UtilConstants.getNewDate() + \"' and \" + Constants.StatusID + \" eq '01'\";\n\n try {\n mStrVisitId = OfflineManager.getVisitDetails(qry);\n } catch (OfflineODataStoreException e) {\n// e.printStackTrace();\n LogManager.writeLogError(Constants.error_txt + e.getMessage());\n }\n\n if (!Constants.MapEntityVal.isEmpty()) {\n iv_visit_status.setImageResource(R.drawable.stop);\n mBooleanVisitStarted = true;\n } else {\n iv_visit_status.setImageResource(R.drawable.start);\n mBooleanVisitStarted = false;\n }\n }\n } catch (OfflineODataStoreException e) {\n e.printStackTrace();\n }\n\n }", "protected void onReloadImage() {\n String url = DataProvider.SCREEN + DataProvider.SCREEN_INDEX + mScreenId + \"&time=\" + System.currentTimeMillis();\n image.setUrl(url); //just to avoid caching\n loadTree();\n }", "public void pushStatusIcon(IconReference ref);", "@Override\r\n public void onRefresh() {\n\r\n refreshContent();\r\n\r\n }", "private void SetIcon() {\n \n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"appIcon.png\")));\n }", "@Override\n\tpublic void setIcon(int resId) {\n\t\t\n\t}", "public void refresh() {\n\t\tthis.repaint();\n\t}", "@Override\n public void setIconURI(String arg0)\n {\n \n }", "@Override\r\n public void updateUI() {\r\n }", "@Override\r\n\t\t\t\t\tpublic boolean isRefreshNeeded() {\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic boolean isRefreshNeeded() {\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}", "public void clickIconViewButton() {\n\t\tfilePicker.stickyButton(locIconBtn);\n\t}", "public void clearStatusIcons();", "@Override\n public void refresh() {\n throw new UnsupportedOperationException(\"operation not supported\");\n }", "@Override\n\tpublic void refreshUI(Object pushMsg) {\n\t\t\n\t}", "@Override\n\tprotected void UpdateUI() {\n\t\t\n\t}", "@Override\n\tprotected void UpdateUI() {\n\t\t\n\t}", "public void startUpdatingAnimation() {\n if (menu != null) {\n MenuItem menuItem = menu.findItem(R.id.action_refresh);\n if (menuItem != null && menuItem.getActionView() == null) {\n LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n RelativeLayout iv = (RelativeLayout) inflater.inflate(R.layout.ic_refresh, null);\n Animation rotation = AnimationUtils.loadAnimation(this, R.anim.rotate_refresh);\n rotation.setRepeatCount(Animation.INFINITE);\n iv.startAnimation(rotation);\n menuItem.setActionView(iv);\n }\n }\n }", "@Override\n public void refreshResources() {\n\n }", "public void refresh();", "public void refresh();", "public void refresh();", "public void refresh();", "public void refresh();", "public void refresh();", "public void refresh();", "@Override\n\tprotected void RefreshView() {\n\t\t\n\t}", "@Override\n\tprotected void refreshView() {\n\t\t\n\t}", "public abstract void refresh();", "public abstract void refresh();", "public abstract void refresh();", "public FRMUpdateRepair() {\n initComponents();\n this.setLocationRelativeTo(null);\n setIconImage(new ImageIcon(getClass().getResource(\"icono.png\")).getImage());\n }", "private void InitSwipeRefreshUI()\n {\n //Set on refresh functionality\n swipeRefreshLayout = getView().findViewById(R.id.swipeRefresh);\n swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { //This sets what function is called when we swipe down to refresh\n @Override\n public void onRefresh() {\n OnSwipeRefreshed();\n\n try {\n Field f = swipeRefreshLayout.getClass().getDeclaredField(\"mCircleView\");\n f.setAccessible(true);\n ImageView img = (ImageView)f.get(swipeRefreshLayout);\n\n RotateAnimation rotate = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);\n rotate.setRepeatMode(Animation.INFINITE);\n rotate.setDuration(1000);\n rotate.setRepeatCount(5);\n rotate.setInterpolator(new LinearInterpolator());\n img.startAnimation(rotate);\n } catch (NoSuchFieldException e) {\n e.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n }\n }\n });\n\n //Set Image of swipe refresh\n try {\n Field f = swipeRefreshLayout.getClass().getDeclaredField(\"mCircleView\");\n f.setAccessible(true);\n ImageView img = (ImageView)f.get(swipeRefreshLayout);\n img.setImageDrawable(ResourcesCompat.getDrawable(getResources(), R.drawable.ic_amiv_logo_icon_bordered, null));\n } catch (NoSuchFieldException e) {\n e.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n }\n }", "abstract void refresh();", "public LiveBtn() {\n\t\tsuper(\"L\");\n\t\tURL iconUrlLive = getClass().getResource(\"/res/icons/record.png\");\n\t\tif (iconUrlLive != null) {\n\t\t\tImageIcon icon = new ImageIcon(iconUrlLive);\n\t\t\tImage img = icon.getImage();\n\t\t\tImage newimg = img.getScaledInstance(20, 20, java.awt.Image.SCALE_SMOOTH);\n\t\t\tImageIcon newIcon = new ImageIcon(newimg);\n\t\t\tthis.setIcon(newIcon);\n\t\t\tthis.setText(\"\");\n\t\t\tthis.setBorderPainted(false);\n\t\t}\n\t}", "@Override\r\n\t\t\tpublic void invoke() {\n\t\t\t\trefresh();\r\n\t\t\t}", "@Override\n\tpublic void refreshView() {\n\n\t}", "private void setRefreshing() {\n mSwipe.setProgressViewOffset(false, 0, (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 24, getResources().getDisplayMetrics()));\n mSwipe.setRefreshing(true);\n }", "private void setIcon() {\n \n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"iconabc.png\")));\n }", "public abstract void pullToRefresh();", "void refresh();", "void refresh();", "void refresh();", "void refresh();", "void refresh();", "long lastAutomaticRefresh();" ]
[ "0.6880749", "0.68570286", "0.6724968", "0.6595266", "0.65327996", "0.64938194", "0.64893806", "0.64438564", "0.64340967", "0.6426319", "0.64186025", "0.63998646", "0.6391513", "0.63851684", "0.6378502", "0.63735044", "0.6368505", "0.6365905", "0.6362482", "0.63554364", "0.63478374", "0.63478374", "0.6308152", "0.62976754", "0.62878263", "0.6273033", "0.6268079", "0.62596834", "0.62408197", "0.623905", "0.62291574", "0.622737", "0.6206498", "0.6206498", "0.6199158", "0.61903954", "0.6166546", "0.6162082", "0.61412185", "0.61387056", "0.6134118", "0.6132123", "0.6130409", "0.6119119", "0.6102155", "0.60816246", "0.6061041", "0.6060999", "0.60489357", "0.60441947", "0.60352325", "0.60325485", "0.6006762", "0.599264", "0.5984855", "0.5981616", "0.5980859", "0.59792536", "0.5972896", "0.59699523", "0.5963742", "0.5954073", "0.59256166", "0.5923519", "0.5918139", "0.5918139", "0.5914322", "0.5911851", "0.58899975", "0.587978", "0.58788306", "0.58788306", "0.58654505", "0.58513725", "0.58492416", "0.58492416", "0.58492416", "0.58492416", "0.58492416", "0.58492416", "0.58492416", "0.5847719", "0.58426195", "0.5839314", "0.5839314", "0.5839314", "0.58390933", "0.5824657", "0.5822217", "0.5818388", "0.58130884", "0.5808307", "0.58057183", "0.58036315", "0.580159", "0.57911736", "0.57911736", "0.57911736", "0.57911736", "0.57911736", "0.5785848" ]
0.0
-1
Check if it was find matches in that day and make the TextView gone
@Override public void onLoadFinished(Loader<Cursor> cursorLoader, Cursor cursor) { if(cursor.getCount() > 0) showNoView(false); // Swap the cursor and cancel the refresh icon mMatchesAdapter.swapCursor(cursor); postRefreshing(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onFocusChange(View v, boolean hasFocus) {\n if (et_night.isFocused()) {\n et_night.setText(null);\n et_night.requestFocus();\n\n }\n\n }", "private void findHide() {\n \tif (this.pagesView != null) this.pagesView.setFindMode(false);\n \tthis.currentFindResultNumber = null;\n \tthis.currentFindResultPage = null;\n \tthis.findButtonsLayout.setVisibility(View.GONE);\n }", "void unsetFoundingDate();", "@Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n\n\n if (count == 0) {\n //sentText.setBackgroundColor(getResources().getColor(android.R.color.transparent));\n // sentText.setText(getString(R.string.otpSentString));\n //subtext.setText(getString(R.string.otpSentSubString));\n // ortextV.setVisibility(View.INVISIBLE);\n\n }\n }", "void noDataFoundTextView();", "public void MonitorTextView()\n {\n TextView textview = (TextView) findViewById(R.id.textViewDelayLength);\n textview.setOnClickListener(new View.OnClickListener()\n {\n @Override\n public void onClick(View v) {\n EditText editText = (EditText) findViewById(R.id.editTextMessageDelay);\n SeekBar seek = (SeekBar) findViewById(R.id.seekBarMessageDelay);\n if (editText.getVisibility() == View.GONE)\n {\n editText.setVisibility(View.VISIBLE);\n seek.setVisibility(View.GONE);\n }\n else if (editText.getVisibility() == View.VISIBLE)\n {\n editText.setVisibility(View.GONE);\n seek.setVisibility(View.VISIBLE);\n }\n }\n });\n }", "private void checkLastVisitLabelAndText(String date, String time) {\n // scroll to last visit label\n onView(withId(R.id.tv_label_last_visit)).perform(scrollTo());\n // check that the last visit label and date are still visible\n onView(withId(R.id.tv_label_last_visit)).check(\n matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)));\n onView(withId(R.id.tv_last_visit)).check(\n matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)));\n\n // check last visit has updated date and time\n onView(withId(R.id.tv_last_visit)).check(\n matches(withText(date + AT + time)));\n }", "private void hideMatchView() {\n mMatchShadowView.animate().alpha(0);\n\n mMatchView.animate()\n .translationY(-mMatchView.getHeight())\n .setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n super.onAnimationEnd(animation);\n mMatchView.setVisibility(View.INVISIBLE);\n }\n });\n }", "@Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n if (s.length() > 0 || !s.equals(\"\")) {\n searchBottom.setVisibility(View.GONE);\n }\n if (s.length() <= 0) {\n searchBottom.setVisibility(View.VISIBLE);\n updateHistory();\n }\n }", "private void refreshDBDangerZone(){\n FirebaseDatabase.getInstance().getReference().child(\"Danger Zone Markers\")\n .addListenerForSingleValueEvent(new ValueEventListener() {\n Date currentDate = new Date();\n String currentDateString = currentDate.toString();\n String getCurrentDateSubString = currentDateString.substring(0,10);\n\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n int numberOfMarkers = 0;\n for (DataSnapshot snapshot : dataSnapshot.getChildren()) {\n numberOfMarkers++;\n String markerDate = snapshot.child(\"time\").getValue().toString();\n System.out.println(\"MARKER DATE: \" + markerDate);\n System.out.println(\"CURRENT DATE: \" + getCurrentDateSubString);\n if(numberOfMarkers>1){\n if(!(markerDate.contains(getCurrentDateSubString))) {\n snapshot.getRef().removeValue();\n }\n }\n\n\n }\n\n }\n @Override\n public void onCancelled(DatabaseError databaseError) {\n }\n });\n }", "private void eraseDateLabel()\n\t{\n\t\tdayDateLabel.setText(\"\");\n\t}", "public void showMatchFailedView() {\n mMatchStatus = MATCH_STATUS_MATCH_FAILED;\n postInvalidate();\n }", "@Override\n public void onClick(View view) {\n mVibrator.vibrate(100);\n reset(\"\");\n show_dni.setText(\"\");\n find_people.setText(\"\");\n }", "private void updateEmptyView()\n\t{\n\t\tif (_forecastAdapter.getItemCount() == 0)\n\t\t{\n\t\t\tTextView textView = (TextView) getView().findViewById(R.id.recyclerview_forecast_empty);\n\n\t\t\t//if cursor is empty\n\t\t\tif (textView != null)\n\t\t\t{\n\t\t\t\tint message = R.string.empty_forecast_list;\n\n\t\t\t\[email protected] int locationStatus = Util\n\t\t\t\t\t\t.getLocationStatus(getContext());\n\n\t\t\t\tswitch (locationStatus)\n\t\t\t\t{\n\t\t\t\t\tcase SunshineSyncAdapter.LOCATION_STATUS_SERVER_DOWN:\n\t\t\t\t\t{\n\t\t\t\t\t\tmessage = R.string.empty_forecast_list_server_down;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SunshineSyncAdapter.LOCATION_STATUS_SERVER_INVALID:\n\t\t\t\t\t{\n\t\t\t\t\t\tmessage = R.string.empty_forecast_list_server_error;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SunshineSyncAdapter.LOCATION_STATUS_INVALID:\n\t\t\t\t\t{\n\t\t\t\t\t\tmessage = R.string.empty_forecast_list_invalid_location;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif (!Util.isNetworkAvailable(getContext()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmessage = R.string.empty_forecast_list_no_network;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttextView.setText(message);\n\t\t\t}\n\t\t}\n\t}", "private void onTextChanged(CharSequence newText) {\n if (!TextUtils.isEmpty(searchEditText.getText())) {\n displayClearButton(true);\n } else {\n displayClearButton(false);\n }\n }", "@Override\n\t public void onAnimationEnd(Animation animation) {\n\t\t findViewById(R.id.textView8).setVisibility(View.GONE);\n\t\t findViewById(R.id.textView81).setVisibility(View.GONE);\n\t \tfindViewById(R.id.textView9).setVisibility(View.GONE);\n\t \tfindViewById(R.id.textView10).setVisibility(View.GONE);\t \t\n\t \tfindViewById(R.id.textView11).startAnimation(animb);\n\t }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.search_seance);\n\t\t\n\t\tdate = (EditText)findViewById(R.id.editText11);\n\t\tdate.setHint(\"Wyszukaj po dacie seansu\");\n\t\tgodzina = (EditText)findViewById(R.id.editText21);\n\t\tgodzina.setHint(\"Wyszukaj po godzinie seansu\");\n\t\tcena = (EditText)findViewById(R.id.editText31);\n\t\tcena.setHint(\"Wyszukaj po cenie bieltu\");\n\t\tdate.addTextChangedListener(new TextWatcher() {\n\t\t\t private String current = \"\";\n\t\t\t private String ddmmyyyy = \"DDMMYYYY\";\n\t\t\t@Override\n\t\t\tpublic void onTextChanged(CharSequence s, int start, int before, int count) {\n\t\t\t\tif (!s.toString().equals(current)) {\n\t\t String clean = s.toString().replaceAll(\"[^\\\\d.]\", \"\");\n\t\t String cleanC = current.replaceAll(\"[^\\\\d.]\", \"\");\n\t\t Calendar cal = Calendar.getInstance(TimeZone.getDefault());\n\t\t int cl = clean.length();\n\t\t int sel = cl;\n\t\t for (int i = 2; i <= cl && i < 6; i += 2) {\n\t\t sel++;\n\t\t }\n\t\t //Fix for pressing delete next to a forward slash\n\t\t if (clean.equals(cleanC)) sel--;\n\n\t\t if (clean.length() < 8){\n\t\t clean = clean + ddmmyyyy.substring(clean.length());\n\t\t }else{\n\t\t //This part makes sure that when we finish entering numbers\n\t\t //the date is correct, fixing it otherways\n\t\t int day = Integer.parseInt(clean.substring(0,2));\n\t\t int mon = Integer.parseInt(clean.substring(2,4));\n\t\t int year = Integer.parseInt(clean.substring(4,8));\n\n\t\t if(mon > 12) mon = 12;\n\t\t cal.set(Calendar.MONTH, mon-1);\n\t\t day = (day > cal.getActualMaximum(Calendar.DATE))? cal.getActualMaximum(Calendar.DATE):day;\n\t\t year = (year<1900)?1900:(year>2100)?2100:year;\n\t\t clean = String.format(\"%02d%02d%02d\",day, mon, year);\n\t\t }\n\n\t\t clean = String.format(\"%s/%s/%s\", clean.substring(0, 2),\n\t\t clean.substring(2, 4),\n\t\t clean.substring(4, 8));\n\t\t current = clean;\n\t\t date.setText(current);\n\t\t date.setSelection(sel < current.length() ? sel : current.length());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void beforeTextChanged(CharSequence s, int start, int count,\tint after) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t}", "private void checkStopped() {\n playPauseButton.check(matches(isCompletelyDisplayed()));\n resetButton.check(matches(isCompletelyDisplayed()));\n stopButton.check(matches(not(isDisplayed())));\n timeView.check(matches(withText(TIME_ZERO)));\n\n playPauseButton.check(matches(withCompoundDrawable(R.drawable.ic_play)));\n resetButton.check(matches(withCompoundDrawable(R.drawable.ic_pause)));\n\n checkReminder(true);\n\n // TODO: Check timeView's color state.\n }", "private void clearAllViews() {\n\t\tTextView usage=(TextView)view.findViewById(R.id.word_usage);\n\t\tusage.setVisibility(View.GONE);\n\n\t}", "@Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n if (inputTitle.getText().toString().length() > 0 &&\n inputDate.getText().toString() != \"Press to choose date\" &&\n inputDescription.getText().toString().length() > 0) {\n addReminder.setEnabled(true);\n addReminder.setBackgroundColor(Color.CYAN);\n }\n if(inputDescription.getText().toString().length() > TEXT_LENGTH_LIMIT ||\n inputTitle.getText().toString().length() > (TEXT_LENGTH_LIMIT/4)){\n addReminder.setEnabled(false);\n addReminder.setBackgroundColor(Color.LTGRAY);\n inputDescription.clearFocus();\n inputTitle.clearFocus(); //clearing desc focus moves to next focusable\n\n Toast.makeText(getApplicationContext(), \"Description limit reached\", Toast.LENGTH_SHORT);\n\n }\n }", "private void onInvalidateQible(String message) {\n // TextView textView = (TextView)\n // findViewById(R.id.location_text_line1);\n TextView textView = (TextView) findViewById(R.id.location_text_line2);\n // TextView textView3 = (TextView)\n // findViewById(R.id.location_text_line3);\n\n textView.setText(\"\");\n textView.setVisibility(View.INVISIBLE);\n findViewById(R.id.arrowImage)\n .setVisibility(View.INVISIBLE);\n findViewById(R.id.compassImage)\n .setVisibility(View.INVISIBLE);\n findViewById(R.id.frameImage)\n .setVisibility(View.INVISIBLE);\n findViewById(R.id.qiblaLayout)\n .setVisibility(View.INVISIBLE);\n TextView textView3 = (TextView) findViewById(R.id.noLocationText);\n textView3.setText(message);\n findViewById(R.id.noLocationLayout)\n .setVisibility(View.VISIBLE);\n findViewById(R.id.textLayout)\n .setVisibility(View.INVISIBLE);\n\n }", "@Override\n public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { todo:\n // let tmp = after set stop time\n // if tmp time < start time, do nothing.\n //\n Calendar tmp = Calendar.getInstance();\n tmp.set(year, monthOfYear, dayOfMonth, EventListFragment.this.mStopSearchCalendar.get(Calendar.HOUR_OF_DAY), EventListFragment.this\n .mStopSearchCalendar.get(Calendar.MINUTE), 0);\n\n if (tmp.after(EventListFragment.this.mStartSearchCalendar) || tmp.equals(EventListFragment.this.mStartSearchCalendar)) {\n\n EventListFragment.this.mStopSearchCalendar.set(year, monthOfYear, dayOfMonth, EventListFragment.this.mStopSearchCalendar.get\n (Calendar.HOUR_OF_DAY), EventListFragment.this.mStopSearchCalendar.get(Calendar.MINUTE), 0);\n\n btnStopDate.setText(dateFormat.format(EventListFragment.this.mStopSearchCalendar.getTime()));\n\n }\n }", "@Override\n public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {\n Calendar newDate = Calendar.getInstance();\n newDate.set(year, monthOfYear, dayOfMonth);\n\n\n if(!newDate.before(newCalendar)){\n /**\n * Update TextView with choosen date\n */\n newDate.set(Calendar.HOUR_OF_DAY, 0);\n newDate.set(Calendar.MINUTE, 0);\n newDate.set(Calendar.SECOND, 0);\n newDate.set(Calendar.MILLISECOND,0);\n mDateTextView.setTextColor(Color.BLACK);\n String day = mDateFormatter.getDayName(newDate.getTime());\n String date = mDateFormatter.getOnlyDate(newDate.getTime());\n String month = mDateFormatter.getMonth(newDate.getTime());\n mDateTextView.setText(day + \" \" + date + \",\" + month);\n mChoosenSaveDate = newDate;\n }else{\n mDateTextView.setText(\"Deadline has to be at leats same as current date\");\n mDateTextView.setTextColor(Color.RED);\n Toast.makeText(view.getContext(),\"invalid choosen date\",\n Toast.LENGTH_LONG).show();\n }\n\n\n }", "@Override\r\n\t public void onTextChanged( CharSequence arg0, int arg1, int arg2, int arg3){\n\t \tlist.setVisibility(View.VISIBLE);\r\n\t \tif(arg3 == 0){\r\n\t \t\tlist.setVisibility(View.GONE);\r\n\t \t}\r\n\t \t\t\r\n\t }", "@Override\n public boolean onQueryTextChange(String s) {\n\n FetchSearchData(s);\n //return false;\n if (data_list.size() == 0) {\n tv_nofound.setVisibility(View.VISIBLE);\n recyclerView.getRecycledViewPool().clear();\n } else {\n tv_nofound.setVisibility(View.GONE);\n }\n\n return true;\n }", "public void clearWeeklyView(){\n\t\tthis.weeklyView=false;\n\t\tnotifyDataSetChanged();\n\t\tnotifyDataSetInvalidated();\n\t}", "public void delhiFalse(View view) {\n delhi = false;\n }", "@Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n //no-op\n }", "@Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n if (s != null && start == 0 && before == 0 && count > 1) {\n performSearch();\n }\n }", "@Override\r\n\t\t\tpublic void afterTextChanged(Editable arg0) {\n\t\t\t\tString edit = keyword.getText().toString();\r\n\t\t\t\tLog.i(\"cheshi\", \"德玛edit:\" + edit);\r\n\t\t\t\tif (edit.length() == 0) {\r\n\t\t\t\t\tdelete.setVisibility(delete.GONE);\r\n\t\t\t\t\tLog.i(\"cheshi\", \"德玛\");\r\n\t\t\t\t}\r\n\t\t\t}", "public void resetText(View view) {\n display();\n }", "public void removeAnswers(){\n for(int i=0;i<gridView.getChildCount();i++){\n final View child = gridView.getChildAt(i);\n if(Build.VERSION.SDK_INT>15){\n child.animate().alpha(0).setDuration(300).withEndAction(new Runnable() {\n @Override\n public void run() {\n child.setVisibility(View.GONE);\n }\n });}else{ child.setAlpha(0);\n child.setVisibility(View.GONE);}\n }\n\n }", "public void extractFifteenDays(View view) {\n showExtractOnListView();\n }", "@Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n afterTextChanged(null);\n }", "public void fillText(View view){\n if(running==true){\n\n\n latestOp=false;\n for(int i = 0; i<9; i++)\n if(i==win&&idOfViews[i]==view.getId()) {\n score++;\n sec=sec+3;\n latestOp=true;\n }\n\n //Defining the score\n total++;\n scoret.setText(\" \"+score+\" /\"+total);\n\n //Setting the message about the latest one.\n resultT.setText(\"Missed\");\n if(latestOp==true)\n resultT.setText(\"Correct!\");\n\n\n //Calling a new screen\n newScreen();\n }\n\n\n }", "@Override\r\n public void onAnimationEnd(Animator animation) {\n mSearchView.setVisibility(View.INVISIBLE);\r\n }", "@Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n if(timer != null) {\n timer.cancel();\n }\n if((s.length() < 3) && (count == 0)) {\n resetAll();\n }\n }", "@Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n if (editText.getTag() == null) {\n hasBeenSetManually = true;\n }\n }", "@Override\n public void run() {\n\t\t\t\t\ttable.getDisplay().timerExec(100, new Runnable() {\n\t\t\t\t\t\t@Override\n public void run() {\n//\t\t\t\t\t\t\tfindText.setBackground(PropertyChangeListener.getColor(found == null && matchCount == 0 ? new RGB(255, 0, 0) : new RGB(255, 255, 255)));\n\t\t\t\t\t\t\tif (!wrapped)\n\t\t\t\t\t\t\t\thexEditor.getEditorSite().getActionBars().getStatusLineManager().setMessage(found == null && matchCount == 0 ? Messages.HexEditorControl_7 : matchCount > 0 ? Messages.HexEditorControl_8 + matchCount + Messages.HexEditorControl_9 : null);\n\t\t\t\t\t\t\tupdateStatusPanel();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}", "@Override\n\t\tpublic void onDisconnect(Myo myo, long timestamp) {\n\t\t\t// Set the text color of the text view to red when a Myo\n\t\t\t// disconnects.\n\t\t\t// mTextView.setTextColor(Color.RED);\n\t\t\tmyos.remove(myo);\n\t\t\tconnectedMyo = null;\n\t\t}", "@Så(\"^forekommer ingen endringer hvis nye oppdateringer ikke er tilgjengelig$\")\n public void forekommer_ingen_endringer_hvis_nye_oppdateringer_ikke_er_tilgjengelig(int pos){\n RVMatcher rvmatcher = new RVMatcher(R.id.recycler_view);\n onView(rvmatcher\n .atPositionInView(pos, R.id.weather_photo))\n .check(matches(not(isSelected())));\n }", "@Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n if (mEmailAddress.length() > 0) {\n mAutoFill.setVisibility(View.INVISIBLE);\n } else {\n //Visible again when text is deleted\n mAutoFill.setVisibility(View.VISIBLE);\n }\n }", "@Override\r\n\t\t\t\t\t\tpublic void afterTextChanged(Editable arg0) {\n\t\t\t\t\t\t\tString keyWords = etDialogSearch.getText()\r\n\t\t\t\t\t\t\t\t\t.toString();\r\n\t\t\t\t\t\t\tif (!keyWords.equals(\"\")) {\r\n\t\t\t\t\t\t\t\tList<Note> notes = databaseHelper\r\n\t\t\t\t\t\t\t\t\t\t.searchNotes(keyWords);\r\n\t\t\t\t\t\t\t\tfor (int i = 0; i < notes.size(); i++) {\r\n\t\t\t\t\t\t\t\t\tSystem.out.println(notes.get(i).toString());\r\n\t\t\t\t\t\t\t\t\tdialogAdapter = new NoteAdapter(\r\n\t\t\t\t\t\t\t\t\t\t\tNoteListActivity.this, notes, false);\r\n\t\t\t\t\t\t\t\t\tlvDialog.setAdapter(dialogAdapter);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t\t}", "@Override\r\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\tPropertyRepairActivity.this.runOnUiThread(new Runnable() {\r\n\t\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\t\tnonemsgtext.setVisibility(View.GONE);\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}", "@Override\n public void onCancel(DialogInterface dialog) {\n textDate.setTextColor(getColor(R.color.colorBlack));\n }", "public void updateTextViews() {\n // Set the inputs according to the initial input from the entry.\n //TextView dateTextView = (TextView) findViewById(R.id.date_textview);\n //dateTextView.setText(DateUtils.formatDateTime(getApplicationContext(), mEntry.getStart(), DateUtils.FORMAT_SHOW_DATE));\n\n EditText dateEdit = (EditText) findViewById(R.id.date_text_edit);\n dateEdit.setText(DateUtils.formatDateTime(this, mEntry.getStart(), DateUtils.FORMAT_NUMERIC_DATE | DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_YEAR | DateUtils.FORMAT_ABBREV_ALL));\n\n EditText startTimeEdit = (EditText) findViewById(R.id.start_time_text_edit);\n startTimeEdit.setText(DateUtils.formatDateTime(this, mEntry.getStart(), DateUtils.FORMAT_SHOW_TIME));\n\n EditText endTimeEdit = (EditText) findViewById(R.id.end_time_text_edit);\n endTimeEdit.setText(DateUtils.formatDateTime(this, mEntry.getEnd(), DateUtils.FORMAT_SHOW_TIME));\n\n\n TextView descriptionView = (TextView) findViewById(R.id.description);\n descriptionView.setText(mEntry.getDescription());\n\n\n enableSendButtonIfPossible();\n }", "public void afterTextChanged(final Editable s){\n\t\t\t\t//adapterArticoliLs.getFilter().filter(s.toString());\n\t\t\t\t//keyboardHide(myFilter);\n\t\t\t\t//sringaDaCercare = s.toString();\n\t\t\t\t//if(sringaDaCercare.length() > 2){\n\t\t\t\t/*\ttimer.cancel();\n\t\t\t\t\ttimer = new Timer();\n\t\t\t\t\ttimer.schedule(new TimerTask(){\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void run(){\n\t\t\t\t\t\t\tsringaDaCercare = s.toString();\n\t\t\t\t\t\t\tLog.i(\"Filtro\", \"run: \" + sringaDaCercare);\n\t\t\t\t\t\t\t//adapterArticoliLs.getFilter().filter(sletto);\n\t\t\t\t\t\t\t//Toast.makeText(getApplicationContext(), \"cerco: \" + sletto, Toast.LENGTH_LONG);\n\t\t\t\t\t\t\tadapterArticoliLs.getFilter().filter(sringaDaCercare);\n\t\t\t\t\t\t\tdaCercare = true;\n\t\t\t\t\t\t\tLog.i(\"Filtro\", \"daCercare 1: \" + daCercare);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 500);*/\n\t\t\t\t//}\n\n\t\t\t\t/*synchronized(daCercare){\n\t\t\t\tLog.i(\"Filtro\", \"daCercare 2: \" + daCercare);\n\t\t\t\tif(daCercare){\n\t\t\t\t\tdaCercare = false;\n\t\t\t\t\tadapterArticoliLs.getFilter().filter(sringaDaCercare);\n\t\t\t\t\tsringaDaCercare = null;\n\t\t\t\t\tadapterArticoliLs.notifyDataSetChanged();\n\t\t\t\t}}*/\n\t\t\t\t//Log.i(\"Filtro\", \"daCercare 3: \" + daCercare);\n\n\n\n\t\t\t\t/*if(StringUtils.length(stringaDaCercare) < 4){\n\t\t\t\t\treturn;\n\t\t\t\t}*/\n\t\t\t\t//handler.removeMessages(TRIGGER_SEARCH);\n\t\t\t\t//handler.sendEmptyMessageDelayed(TRIGGER_SEARCH, 1000);\n\t\t\t\t//Log.i(\"Filtro\", \"afterTextChanged\");\n\n\t\t\t\tsetStringaDaCercare(s.toString());\n\t\t\t}", "private void m116772S() {\n if (isViewValid() && this.f94525K != null && this.f94531Q != null) {\n if (!this.f94531Q.isSecret() && this.f94531Q.nicknameUpdateReminder()) {\n String str = \" T\";\n SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder();\n spannableStringBuilder.append(this.f94525K.getText());\n spannableStringBuilder.append(str);\n spannableStringBuilder.setSpan(new C36728am(getContext(), R.drawable.a6w, 1), (spannableStringBuilder.length() - str.length()) + 1, spannableStringBuilder.length(), 17);\n this.f94525K.setText(spannableStringBuilder);\n if (ProfileNewStyleExperiment.INSTANCE.getUSE_T_NEW()) {\n this.f94525K.setTextColor(getResources().getColor(R.color.ab0));\n } else {\n this.f94525K.setTextColor(getResources().getColor(R.color.ac9));\n }\n } else if (ProfileNewStyleExperiment.INSTANCE.getUSE_T_NEW()) {\n this.f94525K.setTextColor(getResources().getColor(R.color.ab0));\n } else {\n this.f94525K.setTextColor(getResources().getColor(R.color.ac8));\n }\n }\n }", "public void onClick(DialogInterface dialog, int idx) {\n \t \t String today = Utilities.TodayIs();\n\n// \t \t\t tag_to_remove = fetchSingleField(String.format(\"SELECT id_infoid FROM id_info_table where id_infoid = %s;\", selectedItem),\"user_task_name\");\n // \t \t Log.i(\"removefarmtag\", today);\n \t \t Log.i(\"removefarmtag\", \" farm tag record is \" + String.valueOf(tag_to_remove) );\n \t \t \n \t \t\t String cmd = String.format( \"update id_info_table SET tag_date_off = '\" + today + \"' where id_infoid=%d\", tag_to_remove );\n \t \t\t Log.i(\"removefarmtag\", \" command is \" + cmd);\n \t \t\t dbh.exec( cmd );\n \t \t\t findTagsShowAlert (v, thissheep_id); \n// \t \t\t \tClear the display of the tags\n// \t \t\t \tTextView TV = (TextView) findViewById(R.id.farmText)\t;\n// \t \t TV.setText(null);\n// \t \t\tTV = (TextView) findViewById(R.id.farm_colorText);\n// \t \t\tTV.setText(\"\");\n// \t \t\tTV = (TextView) findViewById(R.id.farm_locationText);\n// \t \t\tTV.setText(\"\"); \n// \t \t\tfarmtagid = 0;\n \t \t\t}", "public void onReject (View view) {\n\n\t\t// Grab the list of items from the latest search (list starts with business currently displayed).\n\t\tList<Business> currentSearchList = ApplicationData.getInstance().getListCurrentSearch();\n\n\t\t// Add the current business to the history.\n\t\tApplicationData.getInstance().addBusinessToHistory(\n\t\t\t\tcurrentSearchList.get(0),\n\t\t\t\tfalse\t\t\t\t\t\t\t\t// false since rejected\n\t\t);\n\n\t\t// Now remove the index 0 item from the current search list and set the new top item to currently viewable\n\t\t// restaurant in restaurant selection\n\t\tcurrentSearchList.remove(0);\n\t\tif (currentSearchList.size() == 0) {\n\t\t\tsetViewToNoMoreResults(\"No more search results.\");\n\t\t\treturn;\n\t\t}\n\t\tBusiness newTop = currentSearchList.get(0);\n\t\ttextViewRestaurantName.setText(newTop.name());\n\t\ttextViewRestaurantDistance.setText(\"\" + (Math.round(newTop.distance())));\n\t\t(new taskLoadImage(\n\t\t\t\timageButtonRestaurantImage,\n\t\t\t\tnewTop.imageUrl()\n\t\t)).execute();\n\n\t}", "private void clearFind() {\n\t\tthis.currentFindResultPage = null;\n\t\tthis.currentFindResultNumber = null;\n \tthis.pagesView.setFindMode(false);\n\t\tthis.findButtonsLayout.setVisibility(View.GONE);\n }", "public void updateBtnClearSearchView() {\n this.mBtnClearSearchView.setVisibility(this.mEdtSearch.getText().length() > 0 ? 0 : 8);\n }", "private void showDisconnectedView() {\n\t\tempty_icon.setBackgroundResource(R.drawable.ic_disconnected);\n\t\tempty_label.setText(R.string.search_disconnected_msg);\n\t\tempty_layout.setVisibility(View.VISIBLE);\n\t\tlst_friend.setAdapter(null);\n\t}", "public void setUpTextWatcher(EditText searchFriendText) {\n searchFriendText.addTextChangedListener(new TextWatcher() {\n @Override\n public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {\n Log.i(TAG,\"beforeTextChanged\");\n }\n\n @Override\n public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {\n Log.i(TAG,\"onTextCHanged\");\n Log.i(TAG,charSequence.toString());\n if (charSequence.length() == 0) {\n searchRecyclerview.setVisibility(View.INVISIBLE);\n } else {\n searchRecyclerview.setVisibility(View.VISIBLE);\n }\n Query query = databaseReference.orderByChild(\"UserData/displayname\")\n .startAt(charSequence.toString())\n .endAt(charSequence.toString() + \"\\uf8ff\");\n query.addValueEventListener(valueEventListener);\n }\n\n @Override\n public void afterTextChanged(Editable editable) {\n Log.i(TAG,\"afterTextChanged\");\n }\n });\n }", "@Override\n public void onStop() {\n super.onStop();\n mListener.onMatchMadeDialogSeen();\n }", "@Override\n public void onDisconnect(Myo myo, long timestamp) {\n // Set the text color of the text view to red when a Myo disconnects.\n }", "@Override\n public void afterTextChanged(Editable s) {\n filter(s.toString());\n //you can use runnable postDelayed like 500 ms to delay search text\n }", "@Override\n public void onFocusChange(View v, boolean hasFocus) {\n if (et_eve.isFocused()) {\n et_eve.setText(null);\n et_eve.requestFocus();\n\n }\n\n }", "@Override\n public void beforeTextChanged(CharSequence s, int start, int count,\n int after) {\n afterTextChanged(null);\n }", "@Override\n public void focusGained(FocusEvent arg0) {\n if(jtxt_joinDate.getText().contains(\"xxx\")){\n jtxt_joinDate.setText(\"\");\n }\n }", "private void updateDisplay() \n\t{\n\t\t// updates the date in the TextView\n if(bir.hasFocus())\n {\n\t\tbir.setText(\n\t\t\t\tnew StringBuilder()\n\t\t\t\t// Month is 0 based so add 1\n\t\t\t\t\n\t\t\t\t.append(mDay).append(\"-\")\n\t\t\t\t.append(mMonth + 1).append(\"-\")\n\t\t\t\t.append(mYear).append(\" \"));\n }else\n {\n\t\taniv.setText(\n\t\t\t\tnew StringBuilder()\n\t\t\t\t// Month is 0 based so add 1\n\t\t\t\t\n\t\t\t\t.append(mDay).append(\"-\")\n\t\t\t\t.append(mMonth + 1).append(\"-\")\n\t\t\t\t.append(mYear).append(\" \"));\n }\n\n\n\t}", "private void showNoView(boolean isShown){\n if(isShown){\n mNoMatchesImageView.setVisibility(View.VISIBLE);\n mNoMatchesTextView.setVisibility(View.VISIBLE);\n }else{\n mNoMatchesImageView.setVisibility(View.GONE);\n mNoMatchesTextView.setVisibility(View.GONE);\n }\n }", "@Override\n public void onClick(View view) {\n String weekd = dateFormat3.format(calendar.getTime());\n\n String day = intentDate.substring(6, 8);\n datetext.setText(day+\"일 \"+weekd+\"요일\");\n Log.d(\"VIVIEIW\", view.toString());\n if(intentDate.equals(colorList.get(0).get(0))){\n Log.d(\"date\", intentDate);\n }else{\n Log.d(\"trnas\", colorList.get(0).get(0)+\" \"+intentDate);\n }\n// isRecyclerViewVisible = !isRecyclerViewVisible;\n// if(isRecyclerViewVisible) {\n// recyclerView2.setVisibility(View.VISIBLE);\n// } else {\n// recyclerView2.setVisibility(View.INVISIBLE);\n// }\n\n\n\n ArrayList<ArrayList<String>> lists = new ArrayList<>();\n int temp = 0;\n for (ArrayList<String> list : colorList) {\n ArrayList<String> tdata = new ArrayList<>();\n if (intentDate.equals(list.get(0))) {\n tdata.add(list.get(0));\n String time = list.get(1);\n String timef = time.substring(0, 2) + \":\" + time.substring(2, 4);\n tdata.add(timef);\n tdata.add(list.get(2));\n tdata.add(list.get(3));\n tdata.add(list.get(4));\n tdata.add(list.get(5));\n tdata.add(list.get(6));\n tdata.add(list.get(7));\n lists.add(tdata);\n\n int rcvmoney = Integer.parseInt(list.get(2));\n int paymoney = Integer.parseInt(list.get(3));\n if(rcvmoney > paymoney){\n temp += rcvmoney;\n } else {\n temp -=paymoney;\n }\n\n }\n }\n//\n\n\n CalendarRecylerAdapter adapter = new CalendarRecylerAdapter(lists, popupAsk) ;\n recyclerView2.setAdapter(adapter);\n\n\n datecount.setText(\"총 \"+toString().valueOf(lists.size())+\"건\");\n DecimalFormat myFormatter = new DecimalFormat(\"###,###\");\n String formattedStringPrice = myFormatter.format(temp) + \"원\";\n datesum.setText(formattedStringPrice);\n\n CalendarAdapter.setRecyler(recyclerView2);\n\n\n if (imgColor.getColorFilter() == null) {\n// Intent intent = new Intent(parent.getContext(), addDiary.class);\n// intent.putExtra(\"datekey\", intentDate);\n// parent.getContext().startActivity(intent);\n } else {\n// Intent intent = new Intent(parent.getContext(), ActivityD.class);\n// intent.putExtra(\"sendDate\", intentDate);\n// parent.getContext().startActivity(intent);\n }\n }", "@Override\n public void onCancel(DialogInterface dialog) {\n textTime.setTextColor(getColor(R.color.colorBlack));\n\n }", "@Override\n public void afterTextChanged(Editable s) {\n\n try {\n LocalTime parsedTime = LocalTime.parse(s.toString(), DateTimeFormat.forPattern(\"HH:mm\"));\n // Need to check if it already is that value to prevent an infinite loop.\n String endTimeText = DateUtils.formatDateTime(TimeTableEntryCreationActivity.this, mEntry.getStart().plus(Duration.millis(parsedTime.getMillisOfDay())), DateUtils.FORMAT_SHOW_TIME);\n if (endDurationFlag && !endTimeEdit.getText().toString().equals(endTimeText)) {\n endDurationFlag = false;\n endTimeEdit.setText(endTimeText);\n }\n durationEdit.setError(null);\n } catch (IllegalArgumentException e) {\n durationEdit.setError(\"Bitte eine Dauer im Format Stunden:Minuten eingeben\");\n }\n }", "private void setViewToNoMoreResults (String messageToDisplay) {\n\t\ttextViewRestaurantName.setVisibility(View.INVISIBLE);\n\t\ttextViewRestaurantDistance.setVisibility(View.INVISIBLE);\n\t\timageButtonRestaurantImage.setVisibility(View.INVISIBLE);\n\t\tbuttonAcceptRestaurant.setVisibility(View.INVISIBLE);\n\t\tbuttonRejectRestaurant.setVisibility(View.INVISIBLE);\n\n\t\ttextViewNoMoreResults.setText(messageToDisplay);\n\t\ttextViewNoMoreResults.setVisibility(View.VISIBLE);\n\t}", "public void onClick(View arg0) {\n scanCurrentDay();\n }", "@Override\r\n\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\t\tPropertyRepairActivity.this.runOnUiThread(new Runnable() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnonemsgtext.setVisibility(View.GONE);\r\n\t\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\t});\r\n\t\t\t\t\t\t\t\t\t\t\t}", "@Override\r\n\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\t\tPropertyRepairActivity.this.runOnUiThread(new Runnable() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnonemsgtext.setVisibility(View.GONE);\r\n\t\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\t});\r\n\t\t\t\t\t\t\t\t\t\t\t}", "void textChanged() {\n\t\ttextAreaChanged = true;\n\t\tfinder.clear();\n\t\tfindIndex = 0;\n\t\ttextEditor.getHighlighter().removeAllHighlights();\n\t\terrorTextArea.setText(\"\");\n\t}", "private void notifyAfterTextChanged() {\n removeMessages(ON_TEXT_CHANGED);\n sendEmptyMessageDelayed(ON_TEXT_CHANGED, DELAY_IN_MILLISECOND);\n }", "public void removeTextView(View view) {\r\n /*LinearLayout linearLayout = (LinearLayout) findViewById(R.id.parentLinear);\r\n if (TextViewCount != 0) {\r\n LinearLayout toRemove = (LinearLayout) findViewById(TextViewCount - 1);\r\n linearLayout.removeView(toRemove);\r\n characterNames.remove(TextViewCount - 1);\r\n characters.remove(TextViewCount -1);\r\n saveCharacters(this);\r\n TextViewCount--;\r\n }\r\n */}", "void hideSearch() {\r\n AccelerateDecelerateInterpolator interpolator = new AccelerateDecelerateInterpolator();\r\n\r\n // Setup the animation for mSearchView\r\n mSearchView.setPivotY(mSearchView.getHeight());\r\n ObjectAnimator searchAnim = ObjectAnimator.ofFloat(mSearchView, \"scaleY\", 1.0f, 0.0f);\r\n searchAnim.setDuration(100);\r\n searchAnim.addListener(new AnimatorListenerAdapter() {\r\n @Override\r\n public void onAnimationEnd(Animator animation) {\r\n // Set the visibility of the SearchView\r\n mSearchView.setVisibility(View.INVISIBLE);\r\n }\r\n });\r\n\r\n // Setup the animation for mTitle\r\n mTitle.setPivotY(mTitle.getHeight());\r\n ObjectAnimator titleAnim = ObjectAnimator.ofFloat(mTitle, \"scaleY\", 0.1f, 1.0f);\r\n searchAnim.setDuration(100);\r\n\r\n AnimatorSet animSet = new AnimatorSet();\r\n animSet.playSequentially(searchAnim, titleAnim);\r\n animSet.setInterpolator(interpolator);\r\n animSet.addListener(new AnimatorListenerAdapter() {\r\n @Override\r\n public void onAnimationStart(Animator animation) {\r\n // Hide the app title\r\n mTitle.setVisibility(View.VISIBLE);\r\n }\r\n });\r\n animSet.start();\r\n\r\n // Hide the SearchView and show the search icon\r\n mSearchIcon.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_menu_search));\r\n\r\n // Hide the Card allowing the user to search additional recipes online\r\n mSearchMore.setVisibility(View.GONE);\r\n\r\n if (mSearchListener != null) {\r\n // Reset the search filter\r\n mSearchView.setText(\"\");\r\n mSearchListener.onSearch(\"\");\r\n }\r\n\r\n // Hide the soft keyboard\r\n InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);\r\n imm.hideSoftInputFromWindow(this.getCurrentFocus().getWindowToken(), 0);\r\n }", "private void clickOk(){\n bnOk.setOnClickListener(new View.OnClickListener(){\n @Override\n public void onClick(View v){\n if(nameTask.getText().toString().matches(\"\")){\n Toast.makeText(activity.getApplicationContext(), activity.getResources().getString(R.string.noNameEntered), Toast.LENGTH_SHORT ).show();\n return;\n }\n\n schedulerDB.updateData(id, nameTask.getText().toString(), day);\n dismiss();\n\n }\n });\n }", "private void nastavViews() {\n tv_steps = (TextView) findViewById(R.id.textview1);\n den = (TextView) findViewById(R.id.time1);\n kcalTv = (TextView) findViewById(R.id.kCalTv);\n df = new SimpleDateFormat(\"EEE, d. MMM\");\n df2 = new SimpleDateFormat(\"dd-MMM-yyyy\");\n c = Calendar.getInstance().getTime();\n aktualnyDatum = df.format(c);\n aktualnyDatum2 = df2.format(c);\n }", "@Override\n\tprotected void onPause() {\n\t\tsuper.onPause();\n\t\tday();\n\t}", "@Override\n public View getItem(int index, View cachedView, ViewGroup parent) {\n\t\t\tint day = index;\n\t\t\t\n\t\t\tLog.e(TAG, \"index = \" + index + \" ,day = \" + day);\n\t\t\t\n Calendar newCalendar = (Calendar) calendar.clone();\n newCalendar.add(Calendar.DAY_OF_YEAR, day);\n \n View view = super.getItem(index, cachedView, parent);\n\n TextView weekday = (TextView) view.findViewById(R.id.time2_weekday);\n TextView monthday = (TextView) view.findViewById(R.id.time2_monthday);\n \n\n if (day == 0) {\n \tif( Utils.utc2DateTime(\"yyyy-MM-dd\", newCalendar.getTime()).equals(Utils.utc2DateTime(\"yyyy-MM-dd\", Calendar.getInstance().getTime()))) {\n\t monthday.setText(\"Today\");\n\t monthday.setTextColor(0xFF0000F0);\n\t weekday.setText(\"\");\n \t}\n \telse {\n \tmonthday.setText(Utils.utc2DateTime(\"yyyy-MM-dd\", newCalendar.getTime()));\n monthday.setTextColor(0xFF111111);\n weekday.setText(Utils.utc2DateTime(\"E\", newCalendar.getTime()));\n \t}\n \n } else {\n //DateFormat format = new SimpleDateFormat(\"yyyy-MM-dd\");\n //monthday.setText(format.format(newCalendar.getTime()));\n \tmonthday.setText(Utils.utc2DateTime(\"yyyy-MM-dd\", newCalendar.getTime()));\n monthday.setTextColor(0xFF111111);\n weekday.setText(Utils.utc2DateTime(\"E\", newCalendar.getTime()));\n }\n \n //DateFormat dFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n //view.setTag(dFormat.format(newCalendar.getTime()));\n view.setTag(Utils.utc2DateTime(\"yyyy-MM-dd\", newCalendar.getTime()));\n return view;\n }", "private void takeABreak(){\n mIsBreak = false;\n mLytBreakLayout.setVisibility(View.VISIBLE);\n startTimer(_str_break);\n }", "private void clearOpponentPosition() {\n\t\tfor (TextView txtView : this.computerPlayerTxtViews) {\n\t\t\ttxtView.setText(\"\");\n\t\t}\n\t}", "@Test\n public void testMessageTimeNotNull(){\n ViewInteraction appCompatEditTextView = onView(withId(R.id.input));\n appCompatEditTextView.perform(replaceText(\"testMessageTime\"), closeSoftKeyboard());\n onView(withId(R.id.fab)).perform(click());\n TextView messageTime= messagesActivity.messageTime;\n assertNotNull(messageTime);\n }", "public void delhiTrue(View view) { //Sets delhi to be true\n delhi = true;\n }", "@Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n\n if (userReason != null) {\n if (s.length() > 1 && s.charAt(s.length() - 1) == '\\n') {\n userReason.setText(s.subSequence(0, s.length() - 1));\n InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(userReason.getWindowToken(), 0);\n } else if (s.length() > 0 && s.charAt(0) == '\\n') {\n userReason.setText(\"\");\n InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(userReason.getWindowToken(), 0);\n } else\n ; // normal behavior\n }\n }", "private void updateViews() {\n String twtText = tweetInput.getText().toString();\n int elapsedLength = MAX_CHAR_COUNT - twtText.length();\n if (elapsedLength >= 0 && elapsedLength < MAX_CHAR_COUNT) {\n btnTweet.setEnabled(true);\n charCounter.setTextColor(getResources().getColor(COLOR_GRAY));\n } else {\n btnTweet.setEnabled(false);\n charCounter.setTextColor(getResources().getColor(COLOR_RED));\n }\n\n charCounter.setText(\"\" + elapsedLength);\n }", "public void onTextChanged(CharSequence s, int start, int before, int count) {\n if (et_One.getText().length() == 1) {\r\n }\r\n }", "private void xuLyThanhToanDVReload() {\n txtThanhToanDVGiaDV.setText(\"\");\n txtThanhToanDVSoLuong.setText(\"\");\n txtThanhToanDVSoLuongMoi.setText(\"\");\n txtThanhToanDVSoLuongCu.setText(\"\");\n txtThanhToanTongCong.setText(\"0\");\n tongCong=0;\n cbbThanhToanMaKH.removeAllItems();\n hienThiMaKHSuDungDV();\n }", "@Override\n\t\t\tpublic void afterTextChanged(Editable s) {\n\n\t\t\t\tLog.e(\"dajiayilian\", \"watcher\" + s.toString());\n\t\t\t\tif (TextUtils.isEmpty(s)) {\n\n\t\t\t\t} else {\n\n\t\t\t\t}\n\t\t\t}", "@Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n if (!TextUtils.isEmpty(typecode.getSelectId())) {\n String code = typecode.getSelectId();\n Cursor c = getActivity().getContentResolver().query(Drug.CONTENT_URI,\n new String[]{Drug.CODE, Drug.SELL, Drug.COST, Drug.TOOTHTYPE}, \"drugcode = ?\", new String[]{code}, Drug.DEFAULT_SORTING);\n if (c.moveToFirst()) {\n cost = c.getString(1);\n real = c.getString(2);\n toothType = c.getString(3);\n\n if (!TextUtils.isEmpty(real)) {\n money.setText(real);\n\n }\n\n setAsRemoveButton(mClose);\n\n }\n\n\n }\n\n\n }", "@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)\n @Override\n public void onFinish() {\n textViewInput.setVisibility(View.INVISIBLE);\n buttonStartTime.setVisibility(View.VISIBLE);\n mProgressBar.setVisibility(View.VISIBLE);\n mProgressBar1.setVisibility(View.GONE);\n textViewInput.setText(\"\");\n textViewShuffle.setText(givenWord);\n buttonBuyTime.setVisibility(View.INVISIBLE);\n\n //put the new score into highScore list (if suitable)\n\n SharedPreferences preferences = getSharedPreferences(\"TIME_PREFS\", 0);\n SharedPreferences.Editor editor = preferences.edit();\n editor.putInt(\"latestscore\", score);\n editor.apply();\n\n //Hide the soft keyboard when timer finishes\n// textViewInput.onEditorAction(EditorInfo.IME_ACTION_DONE);\n\n closeKeyboard();\n\n }", "public void reset() {\n\t\tTextView SetQuestionText = (TextView) findViewById(R.id.textView5);\n\t\tSetQuestionText.setText(\"\" + Question);\n\t\tEditText editText22 = (EditText) findViewById(R.id.editText1);\n\t\teditText22.setText(\" ?\");\n\t\tExpresstion_generator_based_on_difficulty();\n\t\tEndTimer();\n\t\tStartTimer();\n\t}", "@Override\r\n public void afterTextChanged(Editable arg0) {\n if (mVehicleCode.equals(\"苏\") && arg0.length() > 0\r\n && arg0.toString().substring(0, 1).equals(\"E\")) {\r\n mVehicleFrameNumLL.setVisibility(View.VISIBLE);\r\n mVehicleEngineNumLL.setVisibility(View.GONE);\r\n mVehicleFrameNumET.setHint(\"请输入车架号后7位\");\r\n mVehicleFrameNumET\r\n .setFilters(new InputFilter[]{new InputFilter.LengthFilter(\r\n 7)});\r\n } else if (mVehicleCode.equals(\"苏\") && arg0.length() > 0\r\n && !arg0.toString().substring(0, 1).equals(\"E\")) {\r\n mVehicleEngineNumLL.setVisibility(View.VISIBLE);\r\n mVehicleFrameNumLL.setVisibility(View.GONE);\r\n mVehicleEngineNumET.setHint(\"请输入发动机号后6位\");\r\n mVehicleEngineNumET\r\n .setFilters(new InputFilter[]{new InputFilter.LengthFilter(\r\n 6)});\r\n }\r\n }", "private void searchQuery() {\n edit_search.addTextChangedListener(new TextWatcher() {\n @Override\n public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n if (paletteComposition.getVisibility() == View.VISIBLE){\n paletteComposition.setVisibility(View.GONE);\n setComposer.setVisibility(View.VISIBLE);\n }\n }\n\n @Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n setContactThatNameContains(s.toString().trim());\n }\n\n @Override\n public void afterTextChanged(Editable s) {\n\n }\n });\n }", "public void infoProgressOff (){\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (tabTourInfoBinding.tourInfoProgress.getVisibility() != View.GONE) {\n tabTourInfoBinding.tourInfoProgress.setVisibility(View.GONE);\n }\n if (tabTourInfoBinding.tourInfoLayout.getVisibility() != View.VISIBLE) {\n tabTourInfoBinding.tourInfoLayout.setVisibility(View.VISIBLE);\n }\n }\n });\n }", "private void onSearchLoadTimeout() {\n ViewGroup root = (ViewGroup) getView();\n Activity host = getActivity();\n if (root != null && host != null) {\n mListPanel.setVisibility(View.GONE);\n mWarningContainer = (ViewGroup) LayoutInflater.from(host).inflate(\n R.layout.message_list_warning, root, false);\n TextView title = UiUtilities.getView(mWarningContainer, R.id.message_title);\n TextView message = UiUtilities.getView(mWarningContainer, R.id.message_warning);\n title.setText(R.string.search_slow_warning_title);\n message.setText(R.string.search_slow_warning_message);\n root.addView(mWarningContainer);\n }\n }", "public void extractSevenDays(View view) {\n showExtractOnListView();\n }", "@Override\n public void onTimeSet(TimePicker view, int hourOfDay, int minute) { todo:\n // let tmp = after set stop time\n // if tmp time < start time, do nothing.\n //\n Calendar tmp = Calendar.getInstance();\n tmp.set(EventListFragment.this.mStopSearchCalendar.get(Calendar.YEAR), EventListFragment.this.mStopSearchCalendar.get(Calendar\n .MONTH), EventListFragment.this.mStopSearchCalendar.get(Calendar.DAY_OF_MONTH), hourOfDay, minute, 0);\n\n if (tmp.after(EventListFragment.this.mStartSearchCalendar) || tmp.equals(EventListFragment.this.mStartSearchCalendar)) {\n\n EventListFragment.this.mStopSearchCalendar.set(EventListFragment.this.mStopSearchCalendar.get(Calendar.YEAR), EventListFragment\n .this.mStopSearchCalendar.get(Calendar.MONTH), EventListFragment.this.mStopSearchCalendar.get(Calendar.DAY_OF_MONTH),\n hourOfDay, minute);\n\n btnStopTime.setText(timeFormat.format(EventListFragment.this.mStopSearchCalendar.getTime()));\n }\n }", "public void refreshDateDescription(int position){\n String date= reminderItems.get(position).getReminderDescriptionDate();\n if (date.equals(\"Today\")||date.equals(\"Tomorrow\")) {\n // Retrieve all reminder item information.\n Calendar alarmCalendar = Calendar.getInstance();\n String title = reminderItems.get(position).getReminderTitle();\n String time = reminderItems.get(position).getReminderDescriptionTime();\n String repeat = reminderItems.get(position).getReminderDescriptionRepeat();\n int reminderCode = reminderItems.get(position).getReminderCode();\n int repeatCode = reminderItems.get(position).getReminderRepeatCode();\n int year = reminderItems.get(position).getReminderYear();\n int month = reminderItems.get(position).getReminderMonth();\n int day = reminderItems.get(position).getReminderDay();\n int hour = reminderItems.get(position).getReminderHour();\n int minute = reminderItems.get(position).getReminderMinute();\n int second = 0;\n alarmCalendar.set(year, month, day, hour, minute, second);\n\n // Setting the new date.\n date = day + \"/\" + (month + 1) + \"/\" + year;\n if (isToday(alarmCalendar)) {\n date = \"Today\";\n } else if (isTomorrow(alarmCalendar)) {\n date = \"Tomorrow\";\n }\n\n // Resetting the reminder item.\n reminderItems.set(position, new ReminderItem(\n title,\n year,\n month,\n day,\n hour,\n minute,\n reminderCode,\n repeatCode,\n date,\n time,\n repeat));\n\n // Refreshing recycler.\n recyclerAdapter.notifyDataSetChanged();\n }\n }", "@Override\n public void timerExpired() {\n //Inform the player they have failed\n if (isEnglish) {\n Toast.makeText(this, LOSS, Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(this, LOSS_CHINESE, Toast.LENGTH_SHORT).show();\n }\n\n //Set visibility for replay button to visible\n replayButton.setVisibility(View.VISIBLE);\n retryButton.setVisibility(View.VISIBLE);\n scoreboardButton.setVisibility(View.VISIBLE);\n }", "org.apache.xmlbeans.XmlDateTime xgetSearchWindowEnd();", "@Override\r\n\t\t\tpublic void onTextChanged(CharSequence arg0, int arg1, int arg2,\r\n\t\t\t\t\tint arg3) {\n\t\t\t\tString edit = keyword.getText().toString();\r\n\t\t\t\tLog.i(\"cheshi\", \"赵信edit:\" + edit);\r\n\t\t\t\tif (edit.length() != 0 && !edit.equals(\"null\")) {\r\n\t\t\t\t\tLog.i(\"cheshi\", \"赵信\");\r\n\t\t\t\t\tdelete.setVisibility(delete.VISIBLE);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}", "@Override\n public void onClick(View v) {\n TextView tries_tv;\n tries_tv = findViewById(R.id.notries_Textview);\n // set this back to 1\n tries_tv.setText(R.string.default_tries);\n // set the RelativeLayout invisible again\n tries.setVisibility(View.GONE);\n // reset the \"Press to top out text\"\n completeBoulder.setText(getResources().getString(R.string.topout));\n }", "public void stopMatch() {\n GovernThread game = GovernThread.getInstance();\n if (game != null) {\n game.emergencyStopMatch();\n }\n beginMatchButton.setEnabled(false);\n resetButton.setEnabled(true);\n switcherButton.setEnabled(true);\n stopMatchButton.setEnabled(false);\n }" ]
[ "0.5853671", "0.5626717", "0.55216724", "0.54961234", "0.54695445", "0.54526985", "0.5413859", "0.5354564", "0.53266823", "0.53165543", "0.52972937", "0.5289693", "0.5283377", "0.52696323", "0.5259633", "0.5251006", "0.5235503", "0.5224779", "0.5217134", "0.5203451", "0.51993215", "0.5171652", "0.51701206", "0.51426035", "0.51419556", "0.51296747", "0.51267606", "0.50944436", "0.50939286", "0.50831544", "0.50621074", "0.5055404", "0.5053174", "0.50439346", "0.5043464", "0.50424075", "0.50406986", "0.50242937", "0.50219506", "0.5021926", "0.50208277", "0.5015952", "0.500467", "0.49971142", "0.4986539", "0.49828318", "0.49784097", "0.49712667", "0.4970984", "0.49708477", "0.4949048", "0.49450514", "0.49383137", "0.49324355", "0.49270853", "0.49174502", "0.4915887", "0.4911265", "0.49050254", "0.4899343", "0.48963365", "0.48935843", "0.48860583", "0.48852083", "0.4884618", "0.48831174", "0.4880452", "0.4872297", "0.4872297", "0.48662597", "0.48660746", "0.48604345", "0.48526633", "0.4850663", "0.4847935", "0.48469186", "0.48411164", "0.48314232", "0.48299545", "0.48230785", "0.48211795", "0.48180073", "0.48170748", "0.48149055", "0.48131776", "0.4812405", "0.48064607", "0.47974777", "0.4785381", "0.47849882", "0.47815025", "0.47799283", "0.4777867", "0.47760224", "0.47752637", "0.47740954", "0.47735375", "0.47717896", "0.47681212", "0.47664693", "0.47657865" ]
0.0
-1
First delete old values from DB
private void updateMatches(){ getContext().getContentResolver().delete(MatchesContract.BASE_CONTENT_URI, null, null); // Fetch new data new FetchScoreTask(getContext()).execute(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void clearData() {\n em.createQuery(\"delete from ViajeroEntity\").executeUpdate();\n }", "private void deleteOldData() {\n Date today = SunshineDateUtils.getNormalizedUtcDateForToday();\n weatherDao.deleteOldWeather(today);\n }", "public void removeOldRecords();", "private void clearData() {\r\n em.createQuery(\"delete from MonitoriaEntity\").executeUpdate();\r\n }", "protected void removeOldData() {\n if (!storage.isEmpty()) {\n long timeLowerbound = storage.lastKey() - maxStorageTime;\n while (!storage.isEmpty() && storage.firstKey() < timeLowerbound) {\n storage.pollFirstEntry();\n } \n }\n }", "private void clearData() throws SQLException {\n//Lay chi so dong cuoi cung\n int n = tableModel.getRowCount() - 1;\n for (int i = n; i >= 0; i--) {\n tableModel.removeRow(i);//Remove tung dong\n }\n }", "@Override\n public void removeFromDb() {\n }", "@Override\n\tpublic void clearDBRisposte() {\n\t\tDB db = getDB();\n\t\tMap<Long, Risposta> risposte = db.getTreeMap(\"risposte\");\n\t\trisposte.clear();\n\t\tdb.commit();\n\t}", "private void cleanDB() {\n // the database will contain a maximum of MAX_DB_SIZE wallpapers (default N=50)\n // when the db gets bigger then N, the oldest wallpapers are deleted from the database\n // the user will set if he wants to delete also the wallpaper or the database entry only\n if (maxDbSize != -1 && getOldWallpapersID().size() > maxDbSize) {\n try (ResultSet rs = db.executeQuery(\"SELECT wp FROM WALLPAPERS ORDER BY date FETCH FIRST 20 PERCENT ROWS ONLY\")) {\n while (!keepWallpapers && rs.next()) {\n Wallpaper wp = (Wallpaper) rs.getObject(\"wp\");\n log.log(Level.FINEST, wp::toString);\n log.log(Level.FINE, () -> \"Cleaning of DB, removing \" + wp.getID());\n\n new File(wp.getPath()).delete();\n }\n db.executeUpdate(\"DELETE FROM WALLPAPERS WHERE id IN (SELECT id FROM WALLPAPERS ORDER BY date fetch FIRST 20 PERCENT rows only)\");\n\n } catch (SQLException throwables) {\n log.log(Level.WARNING, \"Query Error in cleanDB()\");\n log.log(Level.FINEST, throwables.getMessage());\n }\n }\n }", "public void removeAllData() {\n dbHelper.removeAllData(db);\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 deletes() {\n \tDBPeer.fetchTableRows();\n DBPeer.fetchTableIndexes();\n \n for (Delete delete: deletes) {\n \tdelete.init();\n }\n \n //DBPeer.updateTableIndexes(); //Set min max of indexes not implemented yet\n }", "@Override\n\tpublic void clearDBDomande() {\n\t\tDB db = getDB();\n\t\tMap<Long, Domanda> domande = db.getTreeMap(\"domande\");\n\t\tdomande.clear();\n\t\tdb.commit();\n\t}", "@Synchronized\r\n public void cleanTransferModelRecordsPeriodically() {\r\n try {\r\n ArrayList<Long> arrayList = getTransferModelsListIds();\r\n ArrayList<String> arrayListToDelete = new ArrayList<>();\r\n if (!arrayList.isEmpty() && arrayList.size() > 20) {\r\n for (int i = 19; i < arrayList.size(); i++) {\r\n arrayListToDelete.add(arrayList.get(i) + \"\");\r\n }\r\n String[] itemIds = arrayListToDelete.toArray(new String[arrayListToDelete.size()]);\r\n if (itemIds != null && itemIds.length > 0) {\r\n databaseHandler.getWritableDatabase();\r\n databaseHandler.deleteData(TableTransferModel.TABLE_NAME, TableTransferModel.id + \"=?\", itemIds);\r\n }\r\n }\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n FirebaseCrashlytics.getInstance().recordException(e);\r\n }\r\n }", "@Override\r\n\tpublic void clearDatabase() {\n\t\t\r\n\t}", "public void deleteAllData() {\n SQLiteDatabase db = getWritableDatabase();\n db.beginTransaction();\n try {\n db.delete(TABLE_HISTORY, null, null);\n db.delete(TABLE_LASTSCAN, null, null);\n db.delete(TABLE_SENSOR, null, null);\n db.delete(TABLE_SCANS, null, null);\n\n db.setTransactionSuccessful();\n } catch (Exception e) {\n\n } finally {\n db.endTransaction();\n }\n }", "@Override\r\n public void removeAll() {\r\n EntityManager em = PersistenceUtil.getEntityManager();\r\n em.getTransaction().begin();\r\n Query query = em.createQuery(\"DELETE FROM Assunto \");\r\n query.executeUpdate();\r\n em.getTransaction().commit();\r\n }", "public void clearDatabase();", "private void deletePreviousContent()\n {\n SQLiteDatabase db = this.getWritableDatabase();\n db.delete(DATABASE_TABLE_SINGLE_PAGE, null, null);\n db.close();\n }", "public void clearDatabase() {\n\n\t\tObjectSet<Article> articles = db.query(Article.class);\n\t\tarticles.stream()\n\t\t\t.forEach(db::delete);\n\n\t\tObjectSet<CreditCard> creditCards = db.query(CreditCard.class);\n\t\tcreditCards.stream()\n\t\t\t.forEach(db::delete);\n\n\t\tObjectSet<Customer> customers = db.query(Customer.class);\n\t\tcustomers.stream()\n\t\t\t.forEach(db::delete);\n\n\t\tObjectSet<Order> orders = db.query(Order.class);\n\t\torders.stream()\n\t\t\t.forEach(db::delete);\n\n\t\tObjectSet<OrderDetail> orderDetails = db.query(OrderDetail.class);\n\t\torderDetails.stream()\n\t\t\t.forEach(db::delete);\n\t\t\n\t\tSystem.out.println(\"\\nBase de dades esborrada per complet\");\n\t}", "@Override\n public void clearRowsWithChanges() {\n }", "public void deleteHistory() {\n weatherRepo.deleteAll();\n }", "public void clean() {\r\n\t\t\r\n\t\tlogger.trace(\"Enter clean\");\r\n\t\t\r\n\t\tdata.clear();\r\n\t\tfireTableDataChanged();\r\n\t\t\r\n\t\tlogger.trace(\"Exit clean\");\r\n\t}", "public void clearDatabase() {\n new ExecutionEngine(this.database).execute(\"MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r, n\");\n }", "void removeAllData() throws DatabaseNotAccessibleException;", "@Override\n\t\tprotected void _delete() {\n\t\t\toldValue = 0;\n\t\t\tnewValue = 0;\n\t\t}", "public void deleteAllFromDB() {\r\n for (int i = 0; i < uploads.size(); i++) {\r\n FileUtil.deleteFile(uploads.get(i).getFilepath());\r\n }\r\n super.getBasebo().remove(uploads);\r\n }", "public void wipeDateFromRealm() {\n nearByPlacesDAO.deleteFromDB();\n }", "private void repopulateTableForDelete()\n {\n clearTable();\n populateTable(null);\n }", "public void clearDatabase() {\n\t\tstudentRepository.deleteAll();\n\t}", "private <T extends IEntity> void clearRetrieveValues(T entity) {\n Key pk = entity.getPrimaryKey();\n entity.clear();\n entity.setPrimaryKey(pk);\n }", "public void deleteTableRecords()\n {\n coronaRepository.deleteAll();\n }", "void clearDeletedItemsTable();", "public void removeAll()\r\n {\n db = this.getWritableDatabase(); // helper is object extends SQLiteOpenHelper\r\n db.execSQL(\"drop table \"+\"campaing\");\r\n db.execSQL(\"drop table \"+\"cafe\");\r\n db.execSQL(\"drop table \"+\"points\");\r\n\r\n db.close ();\r\n }", "public void clearBatch() throws SQLException {\n\r\n }", "private void delete() {\n\t\tConfiguration conf = new Configuration();\n\t\tconf.configure(\"hibernate.cfg.xml\");\n\t\tSessionFactory sf = conf.buildSessionFactory();\n\t\tSession s = sf.openSession();\n\t\ts.beginTransaction();\n\n\t\tQuery query = s.createQuery(\"delete from OldStudent where name='Michael'\");\n\t\tint count = query.executeUpdate();\n\t\tSystem.out.println(\"Number of Rows Deleted in the oldstudent table=\" + count);\n\n\t\ts.getTransaction().commit();\n\t\ts.clear();// s.evict() on all student objects in session\n\t\tsf.close();\n\n\t}", "public void removeAll(){\n SQLiteDatabase db = this.getWritableDatabase();\n db.delete(TABLE_GAS_SENSOR, null, null);\n // db.delete(DatabaseHelper.TAB_USERS_GROUP, null, null);\n }", "@RequestMapping(\"reset\")\n\tpublic @ResponseBody\n\tString resetDB() {\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tList<SwapItem> items = dao.findAll();\n\t\tfor (SwapItem item : items) {\n\t\t\tint result = dao.delete(item);\n\t\t\tbuffer.append(result).append(\" / \");\n\t\t}\n\t\treturn buffer.toString();\n\t}", "public void clearProteges(){\n ActiveAndroid.execSQL(\"delete from proteges\");\n }", "@After\n public void cleanDatabase() {\n\n databaseInstance.setTaxpayersArrayList(new ArrayList<Taxpayer>());\n }", "void deleteMin() {\n delete(keys[0]);\n }", "private void clearRecords() {\n SQLiteDatabase db = mDbHelper.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(HabitEntry.COLUMN_SUNDAY, 0);\n values.put(HabitEntry.COLUMN_MONDAY, 0);\n values.put(HabitEntry.COLUMN_TUESDAY, 0);\n values.put(HabitEntry.COLUMN_WEDNESDAY, 0);\n values.put(HabitEntry.COLUMN_THURSDAY, 0);\n values.put(HabitEntry.COLUMN_FRIDAY, 0);\n values.put(HabitEntry.COLUMN_SATURDAY, 0);\n\n db.update(HabitEntry.TABLE_NAME, values, null, null);\n\n loaderManager.restartLoader(HABITS_LOADER_ID, null, this);\n }", "private static void clearDB()\n {\n if(getStatus().equals(\"no database\"))\n return;\n\n clearTable(\"myRooms\");\n clearTable(\"myReservations\");\n }", "public void wipeDB() {\n\t\tSQLiteDatabase db = nodeData.getReadableDatabase();\n\t\tdb.delete(EventDataSQLHelper.TABLE, null, null);\n\t\tdb.close();\n }", "@Override\n public void clearBatch() throws SQLException {\n throw new SQLException(\"tinySQL does not support clearBatch.\");\n }", "public void clearTable(){\n\t\tloaderImage.loadingStart();\n\t\tfullBackup.clear();\n\t\tlist.clear();\n\t\toracle.clear();\n\t\tselectionModel.clear();\n\t\tdataProvider.flush();\n\t\tdataProvider.refresh();\n\t}", "private void deleteMathGamesPreviousContent()\n {\n SQLiteDatabase db = this.getWritableDatabase();\n db.delete(DATABASE_TABLE_MATH_GAMES, null, null);\n db.close();\n }", "public void deleteAllState() {\n\r\n SQLiteDatabase db2 = this.getWritableDatabase();\r\n db2.delete(TABLE_SOS2, null, null);\r\n /*\r\n Cursor cursor = db.rawQuery(selectQuery, null);\r\n\r\n // looping through all rows and adding to list\r\n if (cursor.moveToFirst()) {\r\n do {\r\n String id = cursor.getString(0);\r\n String name = cursor.getString(1);\r\n String phone = cursor.getString(2);\r\n //Log.e(\"DEBUG\", \"ID= \" + id+\" NAME= \"+name+\" PHONE= \"+phone);\r\n if (id == null || name == null || phone == null){\r\n return;\r\n }\r\n deleteData(Integer.parseInt(id));\r\n\r\n } while (cursor.moveToNext());\r\n }*/\r\n }", "private void BorrarBBDD() {\n\t\tSQLiteHelper usdbh = new SQLiteHelper(this, \"baseDeDatos\", null, 1);\n\n\t\tSQLiteDatabase db = usdbh.getReadableDatabase();\n\n\t\t// Si hemos abierto correctamente la base de datos\n\t\tif (db != null) {\n\t\t\t// Consultamos el valor esLaPrimeraVez\n\t\t\tdb.execSQL(\"DELETE from Tarjetas;\");\n\n\t\t\tdb.close();\n\t\t}\n\t}", "@Override\n\tpublic void delete() {\n\t\tSystem.out.println(\"Mysql DB 서버에 접속해서 삭제를 하다.\");\n\t}", "public synchronized void dropChanges() {\n\t\tmPendingDeleteCount = 0;\n\t}", "public void clearDatabase(){\n\t\tem.createNativeQuery(\"DELETE FROM CAMINHO\").executeUpdate();\r\n\t\tem.createNativeQuery(\"DELETE FROM MAPA\").executeUpdate();\r\n\t\t\r\n\t\tlog.info(\"Limpou a base de dados\");\r\n\t\r\n\t}", "void delData();", "public void delete() {\n \t\t try(Connection con = DB.sql2o.open()) {\n \t\t\t String sql = \"DELETE FROM sightings where id=:id\";\n\t\t\t con.createQuery(sql)\n\t\t\t.addParameter(\"id\", this.id)\n\t\t\t.executeUpdate();\n\n \t\t }\n \t }", "public void prepareDeleteAll() {\n setCallFromStatement();\n // The statement is no longer require so can be released.\n clearStatement();\n\n super.prepareDeleteAll();\n }", "List<MongoDBEntry<K, V>> removeExpiredData(byte[] lastKey);", "public void invalidateData() {\n Log.d(TAG, \"mama MessagesListRepository invalidateData \");\n //messagesRepository.setInitialKey(null);\n messagesRepository.invalidateData();\n }", "@AfterEach\n\tvoid clearDatabase() {\n\t\t//Clear the table\n\t\taccountRepository.deleteAll();\n\t}", "@Override\r\n public void supprimerFilm(Film f) {\n int idEvent= RetourIdEvent(f);\r\n try {\r\n String sql = \"DELETE FROM `film` where (idEvent ='\"+idEvent+\"');\";\r\n\r\n Statement stl = conn.createStatement();\r\n int rs =stl.executeUpdate(sql);\r\n \r\n String sql2 = \"DELETE FROM `evenement` where (idEvent ='\"+idEvent+\"');\";\r\n\r\n Statement stl2 = conn.createStatement();\r\n int rs1 =stl2.executeUpdate(sql2);\r\n \r\n } catch (SQLException ex) {\r\n System.err.println(\"SQLException: \" + ex.getMessage());\r\n \r\n } }", "@Override\n public void clearTable() {\n final var query = \"TRUNCATE TABLE piano_project.pianos\";\n try(final var statement = connection.createStatement()) {\n statement.executeUpdate(query);\n } catch (SQLException throwables) {\n throwables.printStackTrace();\n }\n }", "public void undoChanges() {\r\n if (getPageDataStoresStatus() == DataStoreBuffer.STATUS_NOT_MODIFIED)\r\n return;\r\n else\r\n _ds.undoChanges(_ds.getRow());\r\n }", "io.dstore.values.IntegerValue getForceDelete();", "public void deleteExpiredAbsences() throws SQLException {\n java.sql.Date sqlExpiryDate = java.sql.Date.valueOf(LocalDate.now());\n String SQLStmt = \"DELETE FROM ABSENCE WHERE DATE < '\" + sqlExpiryDate + \"';\";\n try (Connection con = dbc.getConnection()) {\n Statement statement = con.createStatement();\n statement.executeUpdate(SQLStmt); \n }\n }", "@Override\n public void deleteAll() {\n String deleteAllQuery = \"DELETE FROM \" + getTableName();\n getJdbcTemplate().execute(deleteAllQuery);\n }", "@Override\n\t\t\t\tpublic void rowsDeleted(int firstRow, int endRow) {\n\n\t\t\t\t}", "private void deletedAllNewsFromDatabase() {\n new DeleteNewsAsyncTask(newsDao).execute();\n }", "@Override\r\n\tpublic void delete(TQssql sql) {\n\r\n\t}", "public void clear()\n\t{\n\t\tfor(DBColumn col : _RowData.values())\n\t\t\tcol.clear();\n\t\t\t\n\t\t_MetaData = null;\n\t\t_Parent = null;\n\t\t_Status = DBRowStatus.Unchanged;\n\t}", "private void deleteItem()\n {\n Category categoryToDelete = dataCategories.get(dataCategories.size()-1);\n AppDatabase db = Room.databaseBuilder(getApplicationContext(),\n AppDatabase.class, \"database-name\").allowMainThreadQueries().build();\n db.categoryDao().delete(categoryToDelete);\n testDatabase();\n }", "@Override\n\tpublic boolean preDelete() {\n\t\teliminarCuentasHijas(instance);\n\t\treturn true;\n\t}", "private void clearInsertingValues() {\n mapFieldsIntegers.clear();\n mapFieldsStrings.clear();\n }", "@Override\n\tpublic void deleteOne(String id) {\n\t\tsqlSession.delete(\"product.deleteOne\", id);//상품 삭제\n\t\tsqlSession.delete(\"product.deleteAll\", id);//상품 시작일 모두 삭제\n\t}", "public void deleteDevices(){\n SQLiteDatabase db = getWritableDatabase();\n db.execSQL(\"delete from \"+devicesContract.deviceEntry.tableName);\n db.close();\n }", "public void clearData(){\r\n data.clear();\r\n this.fireTableDataChanged();\r\n }", "public void deleteMin();", "public void deleteAll();", "void eliminar(PK id);", "void execute() {\n deleteNextEntry();\n }", "@Override\n public void run() {\n\n String filename = \"PurgeTable\";\n\n PreparedStatement stmt1 = null;\n try {\n stmt1 = conn.prepareStatement(\"delete from \" + filename);\n stmt1.executeUpdate();\n System.out.println(\"Deletion successful\");\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n }", "@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}", "public void deleteDB() {\n \n sql = \"Delete from Order where OrderID = \" + getOrderID();\n db.deleteDB(sql);\n \n }", "public void wipeTable() {\n SqlStorage.wipeTable(db, TABLE_NAME);\n }", "protected boolean afterDelete() throws DBSIOException{return true;}", "@Override\r\n\tpublic int deleteOne(int idx) throws SQLException {\n\t\treturn 0;\r\n\t}", "@Scheduled(fixedDelay = 60000)\n @Transactional\n public void run() {\n try {\n List<ClientLoanDetails> oldDetails = clientLoanDetailsDao.findOldEntity();\n oldDetails.forEach(clientLoanDetailsDao::delete);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "@Test\r\n\tpublic void testDeleteAll() throws Exception {\n\t\tArrayList<Calificacion> calificaciones = modelo.getAll();\r\n\t\tfor (Calificacion calificacion : calificaciones) {\r\n\t\t\tassertTrue(modelo.delete(calificacion.getId()));\r\n\t\t}\r\n\t\tassertNull(modelo.getAll());\r\n\t}", "public void wipeDatabaseData() {\n\t\tdbHelper.onUpgrade(database, 0, 1);\n\t}", "@Modifying\n @Transactional\n @Query(\"DELETE FROM \" + dbName)\n void deleteAllFromTable();", "public static void deleteAll() throws RocksDBException {\n RocksIterator iter = db.newIterator();\n\n for (iter.seekToFirst(); iter.isValid(); iter.next()) {\n db.delete(iter.key());\n }\n\n iter.close();\n }", "@Override\n\tpublic void deleteAll() {\n\t\tdao.deleteAll();\n\n\t}", "@Override\n public void cleanUsersTable() {\n\n Session session = sessionFactory.openSession();\n Transaction tx = session.beginTransaction();\n session.createQuery(\"delete from User\").executeUpdate();\n tx.commit();\n System.out.println(\"HibCleaning users table\");\n session.close();\n\n }", "public void deleteAllRealTestCode() {\n\n\t myDataBase.delete(\"tbl_TestCode\", \"TestCode\" + \" != ?\",\n\t new String[] { \"1\" });\n\t }", "private DeleteByValue() {}", "private DeleteByValue() {}", "public void deleteAll(){\r\n\t\thead = null;\r\n\t}", "@Query(\"delete from Asignatura \")\n void borrarAsignaturas();", "public boolean deleteLatestEntry() {\n // count entries\n String select = \"SELECT * FROM \"+MyDBContract.FirstTable.TABLE_NAME+\";\";\n Cursor cursor = getReadableDatabase().rawQuery(select, null);\n int count = cursor.getCount();\n cursor.close();\n if(0<count) {\n // Delete a row\n final String SQL_DELETE_ROW =\n \"DELETE FROM \"+MyDBContract.FirstTable.TABLE_NAME +\n \" WHERE \"+MyDBContract.FirstTable.COLUMN_NAME_ID+\" = \"+String.valueOf(count);\n getWritableDatabase().execSQL(SQL_DELETE_ROW);\n return true;\n } else {\n return false;\n }\n }", "private void deleteOldTables(){\n jdbcTemplate.execute(\"DROP TABLE OLDcompetence\");\n jdbcTemplate.execute(\"DROP TABLE OLDrole\");\n jdbcTemplate.execute(\"DROP TABLE OLDperson\");\n jdbcTemplate.execute(\"DROP TABLE OLDavailability\");\n jdbcTemplate.execute(\"DROP TABLE OLDcompetence_profile\");\n }" ]
[ "0.6860494", "0.6842252", "0.68077254", "0.6785814", "0.6547479", "0.648695", "0.6481635", "0.6464174", "0.6437724", "0.64349186", "0.64340883", "0.6373924", "0.63381094", "0.63276494", "0.62369037", "0.61938095", "0.6191044", "0.6186723", "0.6181258", "0.61528075", "0.613883", "0.60709107", "0.6060077", "0.6055143", "0.6051146", "0.6044316", "0.60378516", "0.60306525", "0.60084325", "0.6001539", "0.6001033", "0.59871644", "0.59809804", "0.5976525", "0.5952711", "0.59411806", "0.59307986", "0.5928579", "0.5925731", "0.59085107", "0.5901463", "0.58906347", "0.5886921", "0.58840567", "0.5881095", "0.5878307", "0.58717906", "0.5866255", "0.5864896", "0.58368844", "0.58337027", "0.5830436", "0.58288336", "0.5825618", "0.5808054", "0.57988596", "0.5791239", "0.5790871", "0.57796645", "0.57742894", "0.5772665", "0.57667965", "0.5756427", "0.57461435", "0.5740979", "0.57399756", "0.5736977", "0.573551", "0.573093", "0.57285947", "0.5718323", "0.5716582", "0.57105243", "0.5706989", "0.570572", "0.57025146", "0.570201", "0.568696", "0.5683558", "0.5681666", "0.5681666", "0.5681666", "0.5681666", "0.5680404", "0.5676259", "0.56723595", "0.56695575", "0.56677896", "0.56670797", "0.56617653", "0.5656186", "0.56557167", "0.56543344", "0.5648519", "0.5646927", "0.5646713", "0.5646713", "0.5642362", "0.5641494", "0.5638794", "0.56336" ]
0.0
-1
Convierte el String en un byte
private void send (String messageToSend) throws IOException { byte[] ba = messageToSend.getBytes(); packetToSend = new DatagramPacket (ba, ba.length, serverIPAddress, PORT); //Envia el paquete por el socket. clientSocket.send(packetToSend); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\tpublic byte[] convert(String s) {\n\t\t\treturn s.getBytes();\n\t\t}", "@NonNull\n public static byte[] StringToByte(String string) throws UnsupportedEncodingException\n {\n return string.getBytes(\"UTF-8\");\n }", "static ByteString toBytes(String str) {\n return ByteString.copyFrom(str.getBytes(Internal.UTF_8));\n }", "private static byte[] string2Bytes(final String string) {\n if (string == null) return null;\n return string.getBytes();\n }", "private int convertstringtobyte(String string) {\n return Integer.parseInt(string, 16);\n }", "ByteArray(String s) {\n\tdata = StringConverter.hexToByte(s);\n }", "private byte[] stringToBytes(String bytesInStringForm) {\n byte[] bytes = new byte[16];\n String[] byteValues = bytesInStringForm.split(\",\");\n for (int byteIndex = 0; byteIndex < 16; byteIndex++) {\n bytes[byteIndex] = (byte) Integer.parseInt(byteValues[byteIndex]);\n }\n return bytes;\n\n }", "public static byte str2byte(String s) {\r\n byte b = (byte) 0;\r\n int i;\r\n if (s.length() == 8 && s.matches(regex)) {\r\n i = Integer.parseInt(s, 2);\r\n if (i >= 0 && i <= 255) {\r\n b = (byte) i;\r\n } else {\r\n System.out.println(\"string out of range\");\r\n }\r\n }\r\n return b;\r\n }", "protected static byte[] toByteArray(String str) {\n byte[] bytes = new byte[str.length()];\n for (int i = 0; i < bytes.length; i++) {\n bytes[i] = (byte) str.charAt(i);\n }\n return bytes;\n }", "private byte[] getUTF8Bytes(String input) {\n\t\treturn input.getBytes(StandardCharsets.UTF_8);\n\t}", "public static byte[] toBytes(String s) {\n return s.getBytes(UTF8_CHARSET);\n }", "public byte[] charToByte(String text, String encoding);", "public static byte[] stringToBytes(String string) {\n return string.getBytes(ENCODING);\n }", "public static byte[] stringToBytes(String input) {\n return Base64.decodeBase64(input);\n }", "public byte[] charToByte(char char1, String encoding);", "private static Buffer toBytes(String str) {\n try {\n return new Buffer(str.getBytes(\"UTF-8\"));\n } catch(java.io.UnsupportedEncodingException e) {\n throw new RuntimeException(\"UTF-8 not supported.\", e);\n }\n }", "public static byte[] hexString2bytes(String s)\r\n\t{\r\n\t\tif (null == s)\r\n\t\t\treturn null;\r\n\t\ts = trimSpace(s);\r\n\t\treturn hex2byte(s, 0, s.length() >> 1);\r\n\t}", "private byte[] toByteArray(String s)\r\n\t\t{\n\t\t\tlong l = 0;\r\n\t\t\tif (s.startsWith(\"0x\") || s.startsWith(\"0X\")) {\r\n\t\t\t\tfinal byte[] d = new byte[(s.length() - 1) / 2];\r\n\t\t\t\tint k = (s.length() & 0x01) != 0 ? 3 : 4;\r\n\t\t\t\tfor (int i = 2; i < s.length(); i = k, k += 2)\r\n\t\t\t\t\td[(i - 1) / 2] = (byte) Short.parseShort(s.substring(i, k), 16);\r\n\t\t\t\treturn d;\r\n\t\t\t}\r\n\t\t\telse if (s.length() > 1 && s.startsWith(\"0\"))\r\n\t\t\t\tl = Long.parseLong(s, 8);\r\n\t\t\telse if (s.startsWith(\"b\"))\r\n\t\t\t\tl = Long.parseLong(s.substring(1), 2);\r\n\t\t\telse\r\n\t\t\t\tl = Long.parseLong(s);\r\n\t\t\tint i = 0;\r\n\t\t\tfor (long test = l; test != 0; test /= 0x100)\r\n\t\t\t\t++i;\r\n\t\t\tfinal byte[] d = new byte[i == 0 ? 1 : i];\r\n\t\t\tfor (; i-- > 0; l /= 0x100)\r\n\t\t\t\td[i] = (byte) (l & 0xff);\r\n\t\t\treturn d;\r\n\t\t}", "void writeBytes(String s) throws IOException;", "public static final byte[] asUTF8(final String s) {\n return s.getBytes(StandardCharsets.UTF_8);\n }", "private byte[] stringToArrayOfByte(String string)\n\t\t\tthrows NumberFormatException {\n\n\t\tbyte[] bytes = new byte[string.length() + 1];\n\n\t\tfor (int i = 0; i < string.length(); i++) {\n\t\t\tbytes[i] = charToByte(string.charAt(i));\n\t\t}\n\n\t\tbytes[string.length()] = nullByte;\n\n\t\treturn bytes;\n\n\t}", "public static byte[] stringToBytes(String str) {\n\t\tif (str==null)\n\t\t\treturn null;\n\t\tif (str.charAt(str.length()-1)!='\\0') str+='\\0';\n\t\treturn str.getBytes();\n\t}", "@NotNull\n public static byte[] convertHexToBytes(@NotNull String s) {\n checkNotNull(s);\n int len = s.length();\n checkArgument(len % 2 == 0);\n\n len /= 2;\n byte[] buff = new byte[len];\n for (int i = 0; i < len; i++) {\n buff[i] = (byte) ((getHexDigit(s, i + i) << 4) | getHexDigit(s, i + i + 1));\n }\n return buff;\n }", "public byte[] getUTF8Bytes(String str) {\n\t try { return str.getBytes(\"UTF-8\"); } catch (Exception ex) { return null; }\n\t }", "private static byte[] getBytes(String string) {\n log.log(Level.FINEST, String.format(\"%d %s\", string.length(), string));\n return string.getBytes();\n }", "public abstract byte[] mo32305a(String str);", "int retrieveString(byte s[]);", "byte decodeByte();", "private byte[] toBytes(String obj){\n return Base64.getDecoder().decode(obj);\n }", "public static String toByteString(byte value) {\n String str = String.format(\"%x\", value);\n if (str.length() == 1)\n str = \"0\" + str;\n return str;\n }", "private static byte[] HexStringToByteArray(String input){\n\n\t\tint len = input.length();\n\n\t\tbyte[] inputByte = new byte[len/2];\n\n\t\tfor(int i=0; i< len; i+=2){\n\t\t\tinputByte[i/2] = (byte) ((Character.digit(input.charAt(i), 16) << 4)\n\t\t\t\t\t+(Character.digit(input.charAt(i+1), 16)));\n\t\t}\n\n\t\treturn inputByte;\n\t}", "public static byte[] toBytes(String s)\n\t{\n\t\ttry\n\t\t{\n\t\t\t// int l = 4 - (s.length()%4);\n\t\t\t// for(int i=0;i<l;++i)\n\t\t\t// \ts+=\" \";\n\n\t\t\t// return Base64.getDecoder().decode(s);\n\t\t\treturn s.getBytes(ISO_8859_1);\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "public static byte[] stringToByteArray(String str) {\r\n return str.getBytes();\r\n }", "public static byte[] toByteArray(String s) {\n return DatatypeConverter.parseHexBinary(s.toUpperCase());\n }", "public static byte[] getUTF8Bytes(String str) {\r\n try { return str.getBytes(\"UTF-8\"); } catch (Exception ex) { return null; }\r\n }", "public static byte[] convertirString(String archivo) {\n\t\ttry {\n\t\t\treturn archivo.getBytes(\"UTF-8\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "static Value<Byte> parseByte(String value) {\n try {\n if (value == null || value.isEmpty()) return empty();\n return of(Byte.parseByte(value));\n } catch (NumberFormatException error) {\n return empty();\n }\n }", "public static byte[] hexStringToBytes(String hexString) {\n if (hexString == null || hexString.equals(\"\")) {\n return null;\n }\n //2A51704910EA2922\n hexString = hexString.toUpperCase();\n //8\n int length = hexString.length() / 2;\n //\n char[] hexChars = hexString.toCharArray();\n LogUtils.e(\"ANKUR\", \"hexChars : \" + hexChars);\n byte[] d = new byte[length];\n for (int i = 0; i < length; i++) {\n int pos = i * 2;\n d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1]));\n }\n LogUtils.e(\"ANKUR\", \"byteArray d : \" + d);\n return d;\n }", "public String byteToChar(byte b[], String encoding);", "public static byte[] dataStringToByteArray(String inDataString) throws JCavernInternalError\n\t{\n\t\tStringTokenizer aTokenizer = new StringTokenizer(inDataString);\n\t\tint\t\t\t\tindex = 0;\n\t\tbyte[]\t\t\ttheBytes = new byte[aTokenizer.countTokens()];\n\n\t\twhile (aTokenizer.hasMoreTokens())\n\t\t{\n\t\t\tString\taToken = aTokenizer.nextToken();\n\t\t\ttheBytes[index] = (byte) Integer.parseInt(aToken, 16);\n\t\t\tindex++;\n\t\t}\n\t\t\n\t\treturn theBytes;\n\t}", "static StringBuilder convert_to_binary(String msg) {\n byte[] bytes = msg.getBytes();\r\n StringBuilder binary = new StringBuilder();\r\n for (byte b : bytes) {\r\n int val = b;\r\n for (int i = 0; i < 8; i++) {\r\n binary.append((val & 128) == 0 ? 0 : 1);\r\n val <<= 1;\r\n }\r\n binary.append(\"\");\r\n }\r\n return binary;\r\n }", "protected byte[] stringToByte_8859_1(String str) throws SaslException {\n char[] buffer = str.toCharArray();\n try {\n if (useUTF8) {\n for (int i = 0; i < buffer.length; i++) {\n if (buffer[i] > 'ÿ') {\n return str.getBytes(\"UTF8\");\n }\n }\n }\n return str.getBytes(\"8859_1\");\n } catch (UnsupportedEncodingException e) {\n throw new SaslException(\"cannot encode string in UTF8 or 8859-1 (Latin-1)\", e);\n }\n }", "byte toStringValue() {\n return (byte) String.valueOf(value).charAt(0);\n }", "public static byte[]\n hexStringToBytes(String s) {\n byte[] ret;\n\n if (s == null) return null;\n\n int sz = s.length();\n\n ret = new byte[sz/2];\n\n for (int i=0 ; i <sz ; i+=2) {\n ret[i/2] = (byte) ((hexCharToInt(s.charAt(i)) << 4)\n | hexCharToInt(s.charAt(i+1)));\n }\n\n return ret;\n }", "public static byte [] toBytesBinary(String in) {\n byte [] b = new byte[in.length()];\n int size = 0;\n for (int i = 0; i < in.length(); ++i) {\n char ch = in.charAt(i);\n if (ch == '\\\\' && in.length() > i+1 && in.charAt(i+1) == 'x') {\n // ok, take next 2 hex digits.\n char hd1 = in.charAt(i+2);\n char hd2 = in.charAt(i+3);\n\n // they need to be A-F0-9:\n if (!isHexDigit(hd1) ||\n !isHexDigit(hd2)) {\n // bogus escape code, ignore:\n continue;\n }\n // turn hex ASCII digit -> number\n byte d = (byte) ((toBinaryFromHex((byte)hd1) << 4) + toBinaryFromHex((byte)hd2));\n\n b[size++] = d;\n i += 3; // skip 3\n } else {\n b[size++] = (byte) ch;\n }\n }\n // resize:\n byte [] b2 = new byte[size];\n System.arraycopy(b, 0, b2, 0, size);\n return b2;\n }", "public static byte[] toByteArray(String string) {\n byte[]\tbytes = new byte[string.length()];\n char[] chars = string.toCharArray();\n\n for (int i = 0; i != chars.length; i++) {\n bytes[i] = (byte)chars[i];\n }\n\n return bytes;\n }", "public static byte[] hexStringToBytes(String hexString) {\n if (hexString == null || hexString.equals(\"\")) {\n return null;\n }\n hexString = hexString.toUpperCase();\n int length = hexString.length() / 2;\n char[] hexChars = hexString.toCharArray();\n byte[] d = new byte[length];\n for (int i = 0; i < length; i++) {\n int pos = i * 2;\n d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1]));\n }\n return d;\n }", "public static byte[] hexStringToBytes(String hexString) {\n if (hexString == null || hexString.equals(\"\")) {\n return null;\n }\n hexString = hexString.toUpperCase();\n int length = hexString.length() / 2;\n char[] hexChars = hexString.toCharArray();\n byte[] d = new byte[length];\n for (int i = 0; i < length; i++) {\n int pos = i * 2;\n d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1]));\n }\n return d;\n }", "public static String bytesToString(byte[] txtInByte){\n \treturn hexToString(bytesToHex(txtInByte));\n }", "private String toBinary(byte caracter){\n byte byteDeCaracter = (byte)caracter;\n String binario=\"\";\n for( int i = 7; i>=0; i--){\n binario += ( ( ( byteDeCaracter & ( 1<<i ) ) > 0 ) ? \"1\" : \"0\" ) ;\n }\n return binario;\n }", "private static byte[] convertToBytes(final String macNumber) {\n byte[] bytes = new byte[6];\n String[] hex = macNumber.split(\"(\\\\:|\\\\-)\");\n if (hex.length != 6) {\n return new byte[0];\n }\n try {\n for (int i = 0; i < 6; i++) {\n bytes[i] = (byte) Integer.parseInt(hex[i], 16);\n }\n } catch (NumberFormatException e) {\n LOG.error(e);\n return new byte[0];\n }\n return bytes;\n }", "public static byte[] convert(String hex) {\n/* 51 */ ByteArrayOutputStream baos = new ByteArrayOutputStream();\n/* 52 */ for (int i = 0; i < hex.length(); i += 2) {\n/* 53 */ char c1 = hex.charAt(i);\n/* 54 */ if (i + 1 >= hex.length())\n/* 55 */ throw new IllegalArgumentException(); \n/* 56 */ char c2 = hex.charAt(i + 1);\n/* 57 */ byte b = 0;\n/* 58 */ if (c1 >= '0' && c1 <= '9') {\n/* 59 */ b = (byte)(b + (c1 - 48) * 16);\n/* 60 */ } else if (c1 >= 'a' && c1 <= 'f') {\n/* 61 */ b = (byte)(b + (c1 - 97 + 10) * 16);\n/* 62 */ } else if (c1 >= 'A' && c1 <= 'F') {\n/* 63 */ b = (byte)(b + (c1 - 65 + 10) * 16);\n/* */ } else {\n/* 65 */ throw new IllegalArgumentException();\n/* 66 */ } if (c2 >= '0' && c2 <= '9') {\n/* 67 */ b = (byte)(b + c2 - 48);\n/* 68 */ } else if (c2 >= 'a' && c2 <= 'f') {\n/* 69 */ b = (byte)(b + c2 - 97 + 10);\n/* 70 */ } else if (c2 >= 'A' && c2 <= 'F') {\n/* 71 */ b = (byte)(b + c2 - 65 + 10);\n/* */ } else {\n/* 73 */ throw new IllegalArgumentException();\n/* 74 */ } baos.write(b);\n/* */ } \n/* 76 */ return baos.toByteArray();\n/* */ }", "@Test\n public void testGetBytes() {\n LOGGER.info(\"testGetBytes\");\n final String s = \"Hello\";\n final byte[] expected = s.getBytes(US_ASCII);\n final AtomString atomString1 = new AtomString(s);\n final byte[] actual = atomString1.getBytes();\n assertArrayEquals(expected, actual);\n }", "protected byte[] encodeString(String in) {\n\t\tbyte[] rv = null;\n\t\ttry {\n\t\t\trv = in.getBytes(charset);\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t\treturn rv;\n\t}", "public static byte[] hexStringToBytes(String hexString) {\r\n\t\tif (hexString == null || hexString.equals(\"\")) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\thexString = hexString.toUpperCase();\r\n\t\tint length = hexString.length() / 2;\r\n\t\tchar[] hexChars = hexString.toCharArray();\r\n\t\tbyte[] d = new byte[length];\r\n\t\tfor (int i = 0; i < length; i++) {\r\n\t\t\tint pos = i * 2;\r\n\t\t\td[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1]));\r\n\t\t}\r\n\t\treturn d;\r\n\t}", "@Test\n public void testEncodeAsBytes() {\n LOGGER.info(\"encodeAsBytes\");\n final AtomString atomString = new AtomString();\n final byte[] actual = atomString.encodeAsBytes();\n final byte[] expected = {0x30, 0x3a};\n assertArrayEquals(expected, actual);\n }", "public static byte[] base64ToByte(String data) throws IOException {\n BASE64Decoder decoder = new BASE64Decoder();\n return decoder.decodeBuffer(data);\n }", "public static byte[] toBytes(String strhex ){\r\n\t\t \r\n\t\t String hexString = strhex.trim();\t\t \r\n\t int length = hexString.length();\r\n\t if ( length % 2 != 0 ) {\r\n\t \thexString = \"0\" ;\r\n\t \thexString += strhex.trim();\r\n\t }\r\n\t length = hexString.length();\r\n\t byte[] data = new byte[ length / 2 ];\r\n\t char highChar, lowChar;\r\n\t byte highNibble, lowNibble;\r\n\t for (int i = 0, offset = 0; i < length; i += 2, offset ++ )\r\n\t {\r\n\t highChar = hexString.charAt( i );\r\n\t if ( highChar >= '0' && highChar <= '9')\r\n\t {\r\n\t highNibble = (byte)(highChar - '0');\r\n\t }\r\n\t else if (highChar >= 'A' && highChar <= 'F')\r\n\t {\r\n\t highNibble = (byte)(10 + highChar - 'A');\r\n\t }\r\n\t else if (highChar >= 'a' && highChar <= 'f')\r\n\t {\r\n\t highNibble = (byte)(10 + highChar - 'a');\r\n\t }\r\n\t else\r\n\t {\r\n\t throw new NumberFormatException( \"Invalid hex char: \" + highChar );\r\n\t }\r\n\r\n\t lowChar = hexString.charAt( i + 1 );\r\n\t if ( lowChar >= '0' && lowChar <= '9')\r\n\t {\r\n\t lowNibble = (byte)(lowChar - '0');\r\n\t }\r\n\t else if (lowChar >= 'A' && lowChar <= 'F')\r\n\t {\r\n\t lowNibble = (byte)(10 + lowChar - 'A');\r\n\t }\r\n\t else if (lowChar >= 'a' && lowChar <= 'f')\r\n\t {\r\n\t lowNibble = (byte)(10 + lowChar - 'a');\r\n\t }\r\n\t else\r\n\t {\r\n\t throw new NumberFormatException( \"Invalid hex char: \" + lowChar );\r\n\t }\r\n //System.out.println(\"len = \" + length +\", offset = \" + offset);\r\n\t data[ offset ] = (byte)(highNibble << 4 | lowNibble);\r\n\t }\r\n\t return data;\r\n\t}", "private static byte[] hexStringToByteArray(String s) {\n\t\tint len = s.length();\n\t\tbyte[] data = new byte[len / 2];\n\t\tfor (int i = 0; i < len; i += 2) {\n\t\t\tdata[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)\n\t\t\t\t\t+ Character.digit(s.charAt(i+1), 16));\n\t\t}\n\t\treturn data;\n\t}", "public static byte[] GetBytesFromOctetString(String p) throws IOException {\n Charset encoding = StandardCharsets.UTF_8;\n return StringUtility.GetBytesFromOctetString(p, encoding);\n }", "private static byte[] hexStringToByteArray(String s) {\n final int len = s.length();\n final byte[] data = new byte[len / 2];\n \n for (int i = 0; i < len; i += 2) {\n data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)\n + Character.digit(s.charAt(i + 1), 16));\n }\n \n return data;\n }", "public static byte[] hexStringToBytes(String str) {\n\t\treturn hexStringToBytes(str,str.length()/2); \n\t}", "public static byte[] decodeToBytes(String string){\n\t\treturn decode(string.getBytes());\n\t}", "public static byte[] hexStringToBytes(String hexString) {\n\t\tif (hexString == null || hexString.equals(\"\")) {\n\t\t\treturn null;\n\t\t}\n\t\thexString = hexString.toUpperCase();\n\t\tint length = hexString.length() / 2;\n\t\tchar[] hexChars = hexString.toCharArray();\n\t\tbyte[] d = new byte[length];\n\t\tfor (int i = 0; i < length; i++) {\n\t\t\tint pos = i * 2;\n\t\t\td[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1]));\n\t\t}\n\t\treturn d;\n\t}", "public static byte[] hexStringToByte(String command) {\n\t\tString[] s = command.split(\" \");\r\n\t\tbyte []bs=new byte[s.length];\r\n\t\tfor(int i=0;i<s.length;i++) {\r\n\t\t\tint temp=hexTool(s[i]);\r\n\t\t\tbyte bt=(byte) (temp&0xff);\r\n//\t\t\tSystem.out.print(bt);\r\n\t\t\tbs[i]=bt;\r\n\t\t}\r\n\t\treturn bs;\r\n//\t\tSystem.out.println(bs);\r\n\t}", "public abstract byte[] toBytes() throws Exception;", "public static byte[] hextobyte(String keyText) {\n\t\tif (keyText.length() % 2 == 1) {\n\t\t\tthrow new IllegalArgumentException(\"Invalid string format --> invalid size\");\n\t\t}\n\n\t\tbyte[] byteArray = new byte[keyText.length() / 2];\n\t\tchar[] charArray = keyText.toCharArray();\n\n\t\tfor (int i = 0; i < charArray.length;) {\n\t\t\tchar c1 = charArray[i++];\n\t\t\tchar c2 = charArray[i];\n\n\t\t\tif (checkChar(c1) && checkChar(c2)) {\n\t\t\t\tint value = Integer.parseInt(new StringBuilder().append(c1).append(c2).toString(), 16);\n\t\t\t\tbyteArray[i / 2] = (byte) value;\n\t\t\t} else {\n\t\t\t\tthrow new IllegalArgumentException(\"Invalid string format --> invalid character\");\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\n\t\treturn byteArray;\n\t}", "public static byte[] HexStringToBytes(String s) {\n\n int size = s.length();\n byte[] b = new byte[size / 2];\n\n for (int i = 0; i < size; i += 2) {\n b[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)\n + Character.digit(s.charAt(i + 1), 16));\n }\n return b;\n }", "public static byte[] hexToBytes(String s) {\n int len = s.length();\n byte[] data = new byte[len / 2];\n for (int i = 0; i < len; i += 2) {\n data[i / 2] =\n (byte) ((Character.digit(s.charAt(i), 16) << 4) + Character.digit(s.charAt(i + 1), 16));\n }\n return data;\n }", "private String toBinary( byte[] bytes )\n\t{\n \t\tStringBuilder sb = new StringBuilder(bytes.length * Byte.SIZE);\n\t\tfor( int i = 0; i < Byte.SIZE * bytes.length; i++ )\n\t\t\tsb.append((bytes[i / Byte.SIZE] << i % Byte.SIZE & 0x80) == 0 ? '0' : '1');\n\t\treturn sb.toString();\n\t}", "public static byte[] hextobyte(String keyText) {\n\t\tif (keyText.length() % 2 != 0) throw new IllegalArgumentException(\"Length must be even.\");\n\t\tchar[] hexInput = keyText.toCharArray();\n\t\tbyte[] byteOutput = new byte[keyText.length() / 2];\n\t\tfor (int i = 0; i < hexInput.length; i += 2) {\n\t\t\tbyteOutput[i / 2] = (byte) ((Character.digit(hexInput[i], HEX_BASE) * HEX_BASE)\n\t\t\t\t\t+ Character.digit(hexInput[i + 1], HEX_BASE));\n\t\t}\n\t\treturn byteOutput;\n\t}", "private static byte[] String2Bytes(String str, int digit) {\n\t\tbyte[] bArray = new BigInteger(\"10\" + str, digit).toByteArray();\r\n\r\n\t\t// Copy all the REAL bytes, not the \"first\"\r\n\t\tbyte[] ret = new byte[bArray.length - 1];\r\n\t\tfor (int i = 0; i < ret.length; i++) {\r\n\t\t\tret[i] = bArray[i + 1];\r\n\t\t}\r\n\r\n\t\treturn ret;\r\n\t}", "public static byte[] hexToBytes(String txtInHex) {\n byte[] txtInBytes = new byte[txtInHex.length() / 2];\n for (int i = 0; i < txtInBytes.length; i++) {\n int index = i * 2;\n int v = Integer.parseInt(txtInHex.substring(index, index + 2), 16);\n txtInBytes[i] = (byte) v;\n }\n return txtInBytes;\n }", "java.lang.String getEncoded();", "public static byte[] hexStringToByteArray(String hex) \r\n{\r\n\tif((hex.length()%2)==1) // Falls die Länge des Strings ungerade ist, wird eine 1 angehängt\r\n\t{\r\n\t\tchar c = '1';\r\n\t\thex += c;\r\n\t\tSystem.out.println(\"Fehler in Convert.hexStringToByteArray: Ungerade String-Zeichenfolge!\");\r\n\t}\r\n\tint l = hex.length();\r\n\tbyte[] data = new byte[l/2];\r\n\tfor (int i = 0; i < l; i += 2) \r\n\t{\r\n\t\tdata[i/2] = (byte) ((Character.digit(hex.charAt(i), 16) << 4) + Character.digit(hex.charAt(i+1), 16));\r\n\t}\r\n\treturn data;\r\n}", "private byte[] macStringToByteArray(String dstMac) {\n byte[] dstMAC = new byte[6];\n if (dstMac != null) {\n for (int i = 0; i < 6; i++) {\n dstMAC[i] = (byte) Integer.parseInt(dstMac.substring(i * 3, (i * 3) + 2), 16);\n }\n }\n return dstMAC;\n }", "static String hexToBin(String s) {\n\t\treturn new BigInteger(s, 16).toString(2);\n\t}", "private static String bytes2String(byte[] bytes) {\n StringBuffer stringBuffer = new StringBuffer();\n for (int i = 0; i < bytes.length; i++) {\n stringBuffer.append((char) bytes[i]);\n }\n return stringBuffer.toString();\n }", "public static byte[] charToByte(TextInputEditText editText)\n {\n int length = editText.length();\n char[] charArray = new char[length];\n editText.getText().getChars(0, length, charArray, 0);\n\n ByteBuffer buffer = StandardCharsets.UTF_8.encode(CharBuffer.wrap(charArray));\n byte[] byteArray = new byte[buffer.limit()];\n buffer.get(byteArray);\n\n return byteArray;\n }", "public static final byte[] hexStrToBytes(String s) {\n\t\tbyte[] bytes;\n\n\t\tbytes = new byte[s.length() / 2];\n\n\t\tfor (int i = 0; i < bytes.length; i++) {\n\t\t\tbytes[i] = (byte) Integer.parseInt(s.substring(2 * i, (2 * i) + 2), 16);\n\t\t}\n\n\t\treturn bytes;\n\t}", "@Test\n public void testToByte() {\n System.out.println(\"toByte\");\n String hexString = \"\";\n byte[] expResult = null;\n byte[] result = Crypto.toByte(hexString);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public static byte[] convertToByteArray(String key)\n\t{\n\t byte[] b = new byte[key.length()/2];\n\t\n\t for(int i=0, bStepper=0; i<key.length()+2; i+=2)\n\t if(i !=0)\n\t b[bStepper++]=((byte) Integer.parseInt((key.charAt(i-2)+\"\"+key.charAt(i-1)), 16));\n\t\n\t return b;\n\t}", "public static byte[] hex2byte(String s, int offset, int len)\r\n\t{\r\n\t\tbyte[] d = new byte[len];\r\n\t\tint byteLen = len * 2;\r\n\t\tfor (int i = 0; i < byteLen; i++)\r\n\t\t{\r\n\t\t\tint shift = (i % 2 == 1) ? 0 : 4;\r\n\t\t\td[i >> 1] |= Character.digit(s.charAt(offset + i), 16) << shift;\r\n\t\t}\r\n\t\treturn d;\r\n\t}", "public static byte[] toBytes(final String hexadecimal) {\n\t\treturn toBytes(hexadecimal.toCharArray());\n\t}", "private static byte[] hexStr2Bytes(String hex) {\n // Adding one byte to get the right conversion\n // values starting with \"0\" can be converted\n byte[] bArray = new BigInteger(\"10\" + hex, 16).toByteArray();\n\n // Copy all the REAL bytes, not the \"first\"\n byte[] ret = new byte[bArray.length - 1];\n for (int i = 0; i < ret.length; i++)\n ret[i] = bArray[i + 1];\n return ret;\n }", "public static byte[] stringToHash (String hash)\n {\n if (hash == null || hash.length() % 2 != 0) {\n return null;\n }\n\n hash = hash.toLowerCase();\n byte[] data = new byte[hash.length() / 2];\n for (int ii = 0; ii < hash.length(); ii += 2) {\n int value = (byte) (HEX.indexOf(hash.charAt(ii)) << 4);\n value += HEX.indexOf(hash.charAt(ii + 1));\n\n // values over 127 are wrapped around, restoring negative bytes\n data[ii / 2] = (byte) value;\n }\n\n return data;\n }", "public abstract byte[] parse(String input);", "static String createString(byte b[]) {\n\treturn StringConverter.byteToHex(b);\n }", "public static String convertToUTF8(String s) {\n String converted = null;\n\n if (s != null) {\n byte[] bytes = new byte[s.length()];\n\n for (int i = 0; i < s.length(); i++) {\n bytes[i] = (byte) s.charAt(i);\n }\n\n try {\n converted = new String(bytes, \"UTF-8\");\n if (log.isDebugEnabled()) {\n log.debug(\"Converted '\" + s + \"' to UTF-8 '\" + converted + \"'.\");\n }\n } catch (UnsupportedEncodingException ue) {\n log.error(\"Unable to set UTF-8 character encoding for string '\" + s + \"'!\", ue);\n }\n }\n\n return converted;\n }", "protected void setByteValue(String name, byte[] value) throws CharConversionException, UnsupportedEncodingException {\r\n\r\n APICharFieldDescription field = getCharFieldDescription(name);\r\n int offset = getAbsoluteFieldOffset(field);\r\n int length = field.getLength();\r\n\r\n if (value.length > length) {\r\n throw new IllegalArgumentException(\"Invalid length of byte array parameter 'value'\");\r\n }\r\n\r\n for (byte b : value) {\r\n bytes[offset] = b;\r\n offset++;\r\n length--;\r\n }\r\n\r\n while (length > 0) {\r\n bytes[offset] = 0x00;\r\n offset++;\r\n length--;\r\n }\r\n }", "private byte[] convertingTobyteArray(String result) {\n String[] splited = result.split(\"\\\\s+\");\n byte[] valueByte = new byte[splited.length];\n for (int i = 0; i < splited.length; i++) {\n if (splited[i].length() > 2) {\n String trimmedByte = splited[i].split(\"x\")[1];\n valueByte[i] = (byte) convertstringtobyte(trimmedByte);\n }\n\n }\n return valueByte;\n\n }", "public static String TextToBinary(String input){\n\t\tString output = \"\";\n\t\tfor(int i = 0; i < input.length(); i++){\n\t\t\toutput += Integer.toBinaryString(0x100 | input.charAt(i)).substring(1);\n\t\t}\n\t\treturn output;\n\t}", "private ByteBuffer encode(String str) {\n ByteBuffer bb = null;\n CharsetEncoder isoencoder = UTF8.newEncoder();\n try {\n bb = isoencoder.encode(CharBuffer.wrap(str));\n } catch (CharacterCodingException e) {\n log.error(e);\n }\n return bb;\n }", "public static Bytes valueOf(final String string) throws StringValueConversionException\n\t{\n\t\treturn valueOf(string, Locale.getDefault(Locale.Category.FORMAT));\n\t}", "public static byte[] hextobyte(String keyText) {\n\t\tif (Objects.requireNonNull(keyText).length() == 0) {\n\t\t\treturn new byte[0];\n\t\t}\n\t\tif (keyText.length() % 2 == 1) {\n\t\t\tthrow new IllegalArgumentException(\"keyText is odd-sized.\");\n\t\t}\n\t\tbyte[] bytearray = new byte[keyText.length() / 2];\n\t\tfor (int index = 0, length = keyText.length(); index < length; index += 2) {\n\t\t\tbytearray[index / 2] = (byte) (toNibble(keyText.charAt(index)) << 4 | toNibble(keyText.charAt(index+1)));\n\t\t}\n\t\treturn bytearray;\n\t}", "public static byte[] hexStringToByteArray(String s) {\n int len = s.length();\n byte[] data = new byte[len / 2];\n for (int i = 0; i < len; i += 2) {\n data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)\n + Character.digit(s.charAt(i+1), 16));\n }\n return data;\n }", "public static byte[] decode(String s) {\r\n \t\treturn decode(s.toCharArray());\r\n \t}", "void mo30633b(int i, String str, byte[] bArr);", "public static byte[] hexStringToByteArray(String s) {\n if (s == null)\n return null;\n\n byte[] b = new byte[s.length() / 2];\n for (int i = 0; i < b.length; i++) {\n int index = i * 2;\n int v = Integer.parseInt(s.substring(index, index + 2), 16);\n b[i] = (byte) v;\n }\n return b;\n }", "protected String decodeByte(String given) {\n if (given == null || given.length() % 8 != 0 || given.isEmpty()) {\n return \"\";\n }\n StringBuilder source = new StringBuilder(given);\n StringBuilder target = new StringBuilder();\n while (source.length() > 0) {\n String pair = source.substring(0, 2);\n source.delete(0, 2);\n if (pair.charAt(0) == pair.charAt(1)) {\n target.append(pair.charAt(0));\n } else {\n target.append(\"?\");\n }\n }\n if (target.substring(0,4).contains(\"?\")) {\n target = new StringBuilder(decodeByteWithParity(target.toString()));\n }\n while (target.length() > 3) {\n target.deleteCharAt(target.length() - 1);\n }\n\n return target.toString();\n }", "public static byte[] hexStringToByteArray(String s) {\n\t\tint len = s.length();\n\t\tbyte[] data = new byte[len / 2];\n\t\tfor (int i = 0; i < len; i += 2) {\n\t\t\tdata[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) + Character.digit(s.charAt(i + 1), 16));\n\t\t}\n\t\treturn data;\n\t}" ]
[ "0.73673373", "0.7218121", "0.71082187", "0.68615234", "0.681577", "0.6802713", "0.67840767", "0.6780783", "0.6699114", "0.66851175", "0.6641117", "0.66123533", "0.6609432", "0.6522016", "0.6513473", "0.64906174", "0.6462239", "0.6442034", "0.6432216", "0.6431193", "0.64197826", "0.64079374", "0.6402806", "0.63778496", "0.634017", "0.6337721", "0.6333949", "0.63293314", "0.63288355", "0.6288976", "0.62778467", "0.62667525", "0.62665784", "0.62594455", "0.6250485", "0.61971474", "0.61950845", "0.6177679", "0.617714", "0.61756563", "0.6175572", "0.61413395", "0.6135232", "0.61279094", "0.61135656", "0.60984296", "0.60832906", "0.60832906", "0.6071019", "0.60435635", "0.6031545", "0.60312486", "0.6019659", "0.60193366", "0.6017821", "0.601463", "0.6013299", "0.6007124", "0.59906745", "0.5987377", "0.59803", "0.59657735", "0.5962559", "0.596246", "0.5956767", "0.5949652", "0.5945593", "0.5935109", "0.592852", "0.5925617", "0.59169227", "0.59022385", "0.59022295", "0.5897654", "0.5875157", "0.5874144", "0.5868833", "0.5868034", "0.58633506", "0.58565474", "0.58547944", "0.583538", "0.5834475", "0.5832507", "0.58323634", "0.581982", "0.5810942", "0.5796081", "0.5794617", "0.5793281", "0.5785824", "0.5784919", "0.5781206", "0.5773349", "0.5769285", "0.57636166", "0.5761441", "0.57448244", "0.5729389", "0.5723865", "0.57157123" ]
0.0
-1
/ Set the Nimbus look and feel / If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. For details see
public static void main(String args[]) { try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Multihilo_Chat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Multihilo_Chat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Multihilo_Chat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Multihilo_Chat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { try { new Multihilo_Chat().setVisible(true); } catch (UnknownHostException ex) { Logger.getLogger(Multihilo_Chat.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(Multihilo_Chat.class.getName()).log(Level.SEVERE, null, ex); } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void setLookAndFeel() {\n try {\n for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n\n // TODO: Configure theming colors. UIManager.put(property, new Color(...));\n // {@see http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/_nimbusDefaults.html}\n\n\t\t\tfinal NimbusLookAndFeel laf = new NimbusLookAndFeel();\n UIManager.setLookAndFeel(laf);\n UIDefaults defaults = laf.getDefaults();\n defaults.put(\"List[Selected].textForeground\",\n laf.getDerivedColor(\"nimbusLightBackground\", 0.0f, 0.0f, 0.0f, 0, false));\n defaults.put(\"List[Selected].textBackground\",\n laf.getDerivedColor(\"nimbusSelectionBackground\", 0.0f, 0.0f, 0.0f, 0, false));\n defaults.put(\"List[Disabled+Selected].textBackground\",\n laf.getDerivedColor(\"nimbusSelectionBackground\", 0.0f, 0.0f, 0.0f, 0, false));\n defaults.put(\"List[Disabled].textForeground\",\n laf.getDerivedColor(\"nimbusDisabledText\", 0.0f, 0.0f, 0.0f, 0, false));\n defaults.put(\"List:\\\"List.cellRenderer\\\"[Disabled].background\",\n laf.getDerivedColor(\"nimbusSelectionBackground\", 0.0f, 0.0f, 0.0f, 0, false));\n\n } catch (Exception e) {}\n }", "@SuppressWarnings(\"unused\")\n private static void activateNimbus() //just for testing reasons\n {\n try {\n for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (Exception e) {\n log.warn(\"error in nimbus activation?\", e);\n }\n }", "static void customizeNimbus()\r\n\t\tthrows Exception\r\n\t{\n\t\tUIManager.put(\"control\", BACKGROUND);\r\n\r\n\t\t// TODO: imilne 04/SEP/2009 - No longer working since JRE 1.6.0_u13\r\n\t\tif (SystemUtils.isWindows())\r\n\t\t{\r\n\t\t\tUIManager.put(\"defaultFont\", FONT);\r\n\t\t\tUIManager.put(\"Label[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"Table[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"TableHeader[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"TabbedPane[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"ComboBox[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"Button[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"ToggleButton[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"TextField[Enabled].font\", FONT);\r\n\t\t\tUIManager.put(\"CheckBox[Enabled].font\", FONT);\r\n\t\t}\r\n\r\n\t\tfor (UIManager.LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels())\r\n\t\t\tif (laf.getName().equals(\"Nimbus\"))\r\n\t\t\t\tUIManager.setLookAndFeel(laf.getClassName());\r\n\r\n\r\n\t\tUIManager.put(\"SplitPane[Enabled].size\", 8);\r\n\r\n\t\tUIManager.put(\"nimbusOrange\", new Color(51, 98, 140));\r\n//\t\tUIManager.put(\"nimbusOrange\", new Color(57, 105, 138));\r\n//\t\tUIManager.put(\"nimbusOrange\", new Color(115, 164, 209));\r\n\r\n\r\n\t\t// Reset non-Aqua look and feels to use CMD+C/X/V rather than CTRL for copy/paste stuff\r\n\t\tif (SystemUtils.isMacOS())\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Setting OS X keyboard shortcuts\");\r\n\r\n\t\t\tInputMap textField = (InputMap) UIManager.get(\"TextField.focusInputMap\");\r\n\t\t\ttextField.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.META_DOWN_MASK), DefaultEditorKit.copyAction);\r\n\t\t\ttextField.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.META_DOWN_MASK), DefaultEditorKit.pasteAction);\r\n\t\t\ttextField.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.META_DOWN_MASK), DefaultEditorKit.cutAction);\r\n\t\t\ttextField.put(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.META_DOWN_MASK), DefaultEditorKit.selectAllAction);\r\n\r\n\t\t\tInputMap textArea = (InputMap) UIManager.get(\"TextArea.focusInputMap\");\r\n\t\t\ttextArea.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.META_DOWN_MASK), DefaultEditorKit.copyAction);\r\n\t\t\ttextArea.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.META_DOWN_MASK), DefaultEditorKit.pasteAction);\r\n\t\t\ttextArea.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.META_DOWN_MASK), DefaultEditorKit.cutAction);\r\n\t\t\ttextArea.put(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.META_DOWN_MASK), DefaultEditorKit.selectAllAction);\r\n\t\t}\r\n\t}", "public final static void setDesign() {\n\t\t\ttry{\n\t\t\t\tUIManager.setLookAndFeel(\"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel\");\n\t\t\t}catch(Exception e){\n\t\t\t\tSystem.out.println(\"Prob with setDesign()\");\n\t\t\t}\n\t\t\t\n\t\t}", "public static void LookAndFeel() {\n\t\ttry {\n\t\t\tUIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); // uniformed\n\t\t} catch (Exception exc) {\n\t\t}\n\t}", "public examreports() {\n dblogincred();\n initComponents();\n try {\n for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n} catch (Exception e) {\n // If Nimbus is not available, you can set the GUI to another look and feel.\n}\n }", "private static void setLook() {\r\n try {\r\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n } catch (IllegalAccessException ex) {\r\n ex.printStackTrace();\r\n } catch (UnsupportedLookAndFeelException ex) {\r\n ex.printStackTrace();\r\n } catch (ClassNotFoundException ex) {\r\n ex.printStackTrace();\r\n } catch (InstantiationException ex) {\r\n ex.printStackTrace();\r\n }\r\n }", "private boolean isNimbus()\n/* */ {\n/* 152 */ return UIManager.getLookAndFeel().getName().contains(\"Nimbus\");\n/* */ }", "private void LookAndFeel() {\n try {\n // Set System L&F\n BasicLookAndFeel darcula = new DarculaLaf();\n UIManager.setLookAndFeel(darcula);\n } catch (UnsupportedLookAndFeelException e) {\n // handle exception\n }\n }", "private String getLookAndFeelClassName(String nimbus) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "protected static void initLnF() {\r\n try {\r\n if (!\"com.sun.java.swing.plaf.motif.MotifLookAndFeel\".equals(UIManager.getSystemLookAndFeelClassName())\r\n && !\"com.sun.java.swing.plaf.gtk.GTKLookAndFeel\".equals(UIManager.getSystemLookAndFeelClassName())\r\n && !UIManager.getSystemLookAndFeelClassName().equals(UIManager.getLookAndFeel().getClass().getName())) {\r\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n }\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "private static void setLookAndFeel() { \r\n try {\r\n UIManager.setLookAndFeel(\"javax.swing.plaf.metal.MetalLookAndFeel\"); \r\n } catch (final UnsupportedLookAndFeelException e) {\r\n System.out.println(\"UnsupportedLookAndFeelException\");\r\n } catch (final ClassNotFoundException e) {\r\n System.out.println(\"ClassNotFoundException\");\r\n } catch (final InstantiationException e) {\r\n System.out.println(\"InstantiationException\");\r\n } catch (final IllegalAccessException e) {\r\n System.out.println(\"IllegalAccessException\");\r\n } \r\n }", "private void configuraInterface() {\n\t\tJFrame.setDefaultLookAndFeelDecorated(true);\n\t\ttry\t{\n\t\t\tUIManager.setLookAndFeel(\"com.sun.java.swing.plaf.windows.WindowsLookAndFeel\");\n\t\t}\n\t\tcatch (Exception ex) {\n\t\t\tSystem.out.println(\"Falhou o carregamento do L&F: \");\n\t\t\tSystem.out.println(ex);\n\t\t}\n\t}", "public static void windowLookAndFeel(){\r\n\t try{\r\n\t UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n\t }catch (Exception e) {\r\n\t System.out.println(\"Look and Feel error: \" + e);\r\n\t }\r\n\t}", "private static void setLookAndFeel() {\n\tSystem.setProperty(\"apple.laf.useScreenMenuBar\", \"true\");\n\n\ttry {\n\t UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n\n\t //copy progress bar of System LAF\n\t HashMap<Object, Object> progressDefaults = new HashMap<Object, Object>();\n\t for (Map.Entry<Object, Object> entry : UIManager.getDefaults()\n\t\t .entrySet()) {\n\t\tif (entry.getKey().getClass() == String.class\n\t\t\t&& ((String) entry.getKey()).startsWith(\"ProgressBar\")) {\n\t\t progressDefaults.put(entry.getKey(), entry.getValue());\n\t\t}\n\t }\n\n\t prepareLayout();\n\n\t UIManager\n\t\t .setLookAndFeel(\"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel\");\n\n\t // copy back progress bar of metal Look and Feel\n\t for (Map.Entry<Object, Object> entry : progressDefaults.entrySet()) {\n\t\tUIManager.getDefaults().put(entry.getKey(), entry.getValue());\n\t }\n\t} catch (ClassNotFoundException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t} catch (InstantiationException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t} catch (IllegalAccessException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t} catch (UnsupportedLookAndFeelException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t}\n\n }", "private void nativeLookAndFeel() {\n\n try {\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n } catch (UnsupportedLookAndFeelException | ClassNotFoundException | InstantiationException | IllegalAccessException e) {\n e.printStackTrace();\n }\n }", "private void setNativeLAndF() {\r\n\t\ttry {\r\n\t\t\tUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n\t\t} catch (Exception e) {\r\n\t\t\t//do nothing. It will default to normal\r\n\t\t}\r\n\t}", "public void applyLookAndFeel() {\n\r\n\t\tLookAndFeelInfo[] infos = UIManager.getInstalledLookAndFeels();\r\n\r\n\t\tif (look < 0) {\r\n\t\t\tfor (int i = 0; i < infos.length; i++) {\r\n\t\t\t\tif (infos[i].getName().toUpperCase().contains(\"NIMBUS\")) {\r\n\t\t\t\t\tlook = i;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (look < 0) {\r\n\t\t\tfor (int i = 0; i < infos.length; i++) {\r\n\t\t\t\tif (infos[i].getName().toUpperCase().contains(\"WINDOW\")) {\r\n\t\t\t\t\tlook = i;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlook = (Math.abs(look) % infos.length);\r\n\r\n\t\tString lookName = infos[look].getName();\r\n\r\n\t\ttry {\r\n \t\tUIManager.setLookAndFeel(infos[look].getClassName());\r\n \t\tsetTitle(JMTKResizer.ABOUT + \" - \" + lookName);\r\n \tSwingUtilities.updateComponentTreeUI(this);\r\n \t\t//pack();\r\n\r\n \t} catch (Exception e) {\r\n \t\te.printStackTrace();\r\n \t}\r\n\t}", "private void menuNimbusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuNimbusActionPerformed\n try {\n UIManager.setLookAndFeel(\"com.sun.java.swing.plaf.motif.MotifLookAndFeel\");\n SwingUtilities.updateComponentTreeUI(this);\n } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {\n Logger.getLogger(MoneyMinderDesktopMainGui.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private static void initLookAndFeel()\n {\n try \n {\n UIManager.setLookAndFeel(\"de.javasoft.plaf.synthetica.SyntheticaAluOxideLookAndFeel\");\n }\n \n catch(ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e)\n {\n JOptionPane.showMessageDialog(null, \"Failed to load resource package\");\n }\n }", "private void setupLookAndFeel() {\n SwingUtilities.invokeLater(() -> {\n model.getUserPreferences().getThemeSubject().subscribe((skin) -> {\n try {\n UIManager.setLookAndFeel(new SubstanceLookAndFeel(\n (SubstanceSkin) skin.getTheme().newInstance()\n ) {\n });\n if (frame != null) {\n frame.repaint();\n }\n } catch (UnsupportedLookAndFeelException | InstantiationException | IllegalAccessException e) {\n ExceptionHandler.get().handle(e);\n }\n });\n });\n }", "public static void setLookAndFeel(){\n\t\t\n\t\tUIManager.put(\"nimbusBase\", new Color(0,68,102));\n\t\tUIManager.put(\"nimbusBlueGrey\", new Color(60,145,144));\n\t\tUIManager.put(\"control\", new Color(43,82,102));\n\t\tUIManager.put(\"text\", new Color(255,255,255));\n\t\tUIManager.put(\"Table.alternateRowColor\", new Color(0,68,102));\n\t\tUIManager.put(\"TextField.font\", new Font(\"Font\", Font.BOLD, 12));\n\t\tUIManager.put(\"TextField.textForeground\", new Color(0,0,0));\n\t\tUIManager.put(\"PasswordField.foreground\", new Color(0,0,0));\n\t\tUIManager.put(\"TextArea.foreground\", new Color(0,0,0));\n\t\tUIManager.put(\"FormattedTextField.foreground\", new Color(0,0,0));\n\t\t\n\t\tUIManager.put(\"ComboBox:\\\"ComboBox.listRenderer\\\".background\", new Color(0,68,102));\n\t\tUIManager.put(\"ComboBox:\\\"ComboBox.listRenderer\\\"[Selected].background\", new Color(0,0,0));\n\t\t\n\t\t//TODO nie chca dzialac tooltipy na mapie\n\t\tBorder border = BorderFactory.createLineBorder(new Color(0,0,0)); //#4c4f53\n\t\tUIManager.put(\"ToolTip.border\", border);\n\n\t\t//UIManager.put(\"ToolTip.foregroundInactive\", new Color(0,0,0));\n\t\t//UIManager.put(\"ToolTip.backgroundInactive\", new Color(0,0,0));\n\t\t//UIManager.put(\"ToolTip.background\", new Color(0,0,0)); //#fff7c8\n\t\t//UIManager.put(\"ToolTip.foreground\", new Color(0,0,0));\n\t\t Painter<Component> p = new Painter<Component>() {\n\t\t public void paint(Graphics2D g, Component c, int width, int height) {\n\t\t g.setColor(new Color(20,36,122));\n\t\t //and so forth\n\t\t }\n\t\t };\n\t\t \n\t\tUIManager.put(\"ToolTip[Enabled].backgroundPainter\", p);\n\n//\t\tUIManager.getLookAndFeelDefaults().put(\"ToolTip.foregroundInactive\", new Color(255, 255, 255));\n//\t\tUIManager.getLookAndFeelDefaults().put(\"backgroundInactive\", new Color(255, 255, 255));\n//\t\tUIManager.getLookAndFeelDefaults().put(\"ToolTip.background\", new Color(255, 255, 255)); //#fff7c8\n//\t\tUIManager.getLookAndFeelDefaults().put(\"ToolTip.foreground\", new Color(255, 255, 255));\n//\t\t\n//\t\tUIManager.getLookAndFeelDefaults().put(\"ToolTip.foregroundInactive\",new ColorUIResource(new Color(255, 255, 255)));\n//\t\tUIManager.getLookAndFeelDefaults().put(\"backgroundInactive\", new ColorUIResource((new Color(255, 255, 255))));\n//\t\tUIManager.getLookAndFeelDefaults().put(\"ToolTip.background\", new ColorUIResource(new Color(255, 255, 255))); //#fff7c8\n//\t\tUIManager.getLookAndFeelDefaults().put(\"ToolTip.foreground\", new ColorUIResource(new Color(255, 255, 255)));\n\t\t\n\t \n\t\ttry {\n\t\t for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {\n\t\t if (\"Nimbus\".equals(info.getName())) {\n\t\t UIManager.setLookAndFeel(info.getClassName());\n\t\t break;\n\t\t }\n\t\t }\n\t\t} catch (Exception e) {\n\t\t // If Nimbus is not available, you can set the GUI to another look and feel.\n\t\t}\n\n\t\tUIManager.getLookAndFeelDefaults().put(\"Table:\\\"Table.cellRenderer\\\".background\", new ColorUIResource(new Color(74,144,178)));\n\t\tUIManager.getLookAndFeelDefaults().put(\"Table.background\", new ColorUIResource(new Color(74,144,178)));\n\t\t\n\n\t}", "public static String setLookAndFeel(String look) {\n UIManager.put(\"swing.boldMetal\", Boolean.FALSE); //$NON-NLS-1$\n // Display slider value is set to false (already in all LAF by the panel title), used by GTK LAF\n UIManager.put(\"Slider.paintValue\", Boolean.FALSE); //$NON-NLS-1$\n\n String laf = getAvailableLookAndFeel(look);\n try {\n UIManager.setLookAndFeel(laf);\n } catch (Exception e) {\n laf = UIManager.getSystemLookAndFeelClassName();\n LOGGER.error(\"Unable to set the Look&Feel\", e); //$NON-NLS-1$\n }\n // Fix font issue for displaying some Asiatic characters. Some L&F have special fonts.\n setUIFont(new javax.swing.plaf.FontUIResource(\"SansSerif\", Font.PLAIN, 12)); //$NON-NLS-1$\n return laf;\n }", "public JFind2() {\n try {\n String metal = \"javax.swing.plaf.metal.MetalLookAndFeel\";\n String synth = \"javax.swing.plaf.synth.SynthLookAndFeel\"; // --> since JDK-1.5\n\n String gtk = \"com.sun.java.swing.plaf.gtk.GTKLookAndFeel\"; // -> since JDK-1.4\n\n String motif = \"com.sun.java.swing.plaf.motif.MotifLookAndFeel\";\n String windows = \"com.sun.java.swing.plaf.windows.WindowsLookAndFeel\";\n\n String os = System.getProperty(\"os.name\");\n if (os.startsWith(\"Linux\")) {\n try // Install client system look and feel.\n {\n UIManager.setLookAndFeel(metal);\n } catch (Exception e) {\n }\n } else {\n try // Install client system look and feel.\n {\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n } catch (Exception e) {\n }\n }\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n\n preInit();\n initComponents();\n postInit();\n\n }", "public void lookandfeel(){\n \n try{\n UIManager.setLookAndFeel(seta_look);\n SwingUtilities.updateComponentTreeUI(this);\n }\n catch(Exception erro){\n JOptionPane.showMessageDialog(null, erro);\n \n }\n}", "public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException,\n\t\t\tUnsupportedLookAndFeelException {\n\t\tdetermineOS();\n\t\tif (currentOs == MAC_OS) {\n\t\t\tSystem.setProperty(\"com.apple.mrj.application.apple.menu.about.name\", \"UP-Admin\");\n\t\t\tSystem.setProperty(\"apple.laf.useScreenMenuBar\", \"true\");\n\t\t\tSystem.setProperty(\"com.apple.mrj.application.live-resize\", \"true\");\n\n\t\t\ttry {\n\t\t\t\tUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (InstantiationException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IllegalAccessException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (UnsupportedLookAndFeelException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} else if ((currentOs == WIN_OS) || (currentOs == null)) {\n\n\t\t\tUIManager.put(\"nimbusBase\", new Color(0x525252));\n\t\t\tUIManager.put(\"control\", new Color(0x949494));\n\t\t\tUIManager.put(\"nimbusSelectionBackground\", new Color(0x171717));\n\t\t\tUIManager.put(\"Menu.background\", new Color(0x2B2B2B));\n\t\t\tUIManager.put(\"background\", new Color(0x171717));\n\t\t\tUIManager.put(\"DesktopIcon.background\", new Color(0x171717));\n\t\t\tUIManager.put(\"nimbusLightBackground\", new Color(0xE3E3E3));\n\t\t\tUIManager.setLookAndFeel(\"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel\");\n\t\t\t\n\t\t}\n\n\t\tEventQueue.invokeLater(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tFrame frame = new Frame();\n\t\t\t\t\tframe.setVisible(true);\n\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "private void setupSwing() {\r\n SwingUtilities.invokeLater(new Runnable() {\r\n @Override\r\n public void run() {\r\n \r\n try {\r\n for (LookAndFeelInfo info: UIManager.getInstalledLookAndFeels()) {\r\n if (info.getName().equals(\"Windows\")) {\r\n UIManager.setLookAndFeel(info.getClassName());\r\n }\r\n }\r\n } catch (ClassNotFoundException \r\n | InstantiationException\r\n | IllegalAccessException \r\n | UnsupportedLookAndFeelException e) {\r\n e.printStackTrace(System.err);\r\n }\r\n \r\n window = new ManagerWindow(MetagridManager.this);\r\n window.pack();\r\n window.setVisible(true);\r\n }\r\n });\r\n }", "public static void main(String[] args) {\r\n SageLife sagelife = new SageLife();\r\n\r\n try {\r\n for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {\r\n if (\"Nimbus\".equals(info.getName())) {\r\n UIManager.setLookAndFeel(info.getClassName());\r\n break;\r\n }\r\n }\r\n } catch (Exception e) {\r\n // If Nimbus is not available, you can set the GUI to another look and feel.\r\n }\r\n\r\n sagelife.createLayout();\r\n }", "private LookAndFeelManager() {}", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n \n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n \n \n /* Create and display the form */ \n \n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new home().setVisible(true);\n }\n });\n }", "public Q4() {\n initComponents();\n looks=UIManager.getInstalledLookAndFeels();\n }", "public static void main(String args[]) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n UI tesis = new UI();\n tesis.setVisible(true);\n try {\n tesis.inicializar(); \n } catch (NullPointerException e) {\n System.out.println(\"Ejecución terminada forzosamente\");\n System.exit(1);\n }\n }\n });\n }", "@Override\n public void init() {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(TugasB.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(TugasB.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(TugasB.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(TugasB.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the applet */\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 }", "@Override\r\n public void init() {\r\n /* Set the Nimbus look and feel */\r\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\r\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\r\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \r\n */\r\n try {\r\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\r\n if (\"Nimbus\".equals(info.getName())) {\r\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\r\n break;\r\n }\r\n }\r\n } catch (ClassNotFoundException ex) {\r\n java.util.logging.Logger.getLogger(IMC.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n } catch (InstantiationException ex) {\r\n java.util.logging.Logger.getLogger(IMC.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n } catch (IllegalAccessException ex) {\r\n java.util.logging.Logger.getLogger(IMC.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\r\n java.util.logging.Logger.getLogger(IMC.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n }\r\n //</editor-fold>\r\n\r\n /* Create and display the applet */\r\n try {\r\n java.awt.EventQueue.invokeAndWait(new Runnable() {\r\n public void run() {\r\n initComponents();\r\n }\r\n });\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }", "private void configureUI() {\r\n // UIManager.put(\"ToolTip.hideAccelerator\", Boolean.FALSE);\r\n\r\n Options.setDefaultIconSize(new Dimension(18, 18));\r\n\r\n Options.setUseNarrowButtons(settings.isUseNarrowButtons());\r\n\r\n // Global options\r\n Options.setTabIconsEnabled(settings.isTabIconsEnabled());\r\n UIManager.put(Options.POPUP_DROP_SHADOW_ENABLED_KEY,\r\n settings.isPopupDropShadowEnabled());\r\n\r\n // Swing Settings\r\n LookAndFeel selectedLaf = settings.getSelectedLookAndFeel();\r\n if (selectedLaf instanceof PlasticLookAndFeel) {\r\n PlasticLookAndFeel.setPlasticTheme(settings.getSelectedTheme());\r\n PlasticLookAndFeel.setTabStyle(settings.getPlasticTabStyle());\r\n PlasticLookAndFeel.setHighContrastFocusColorsEnabled(\r\n settings.isPlasticHighContrastFocusEnabled());\r\n } else if (selectedLaf.getClass() == MetalLookAndFeel.class) {\r\n MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());\r\n }\r\n\r\n // Work around caching in MetalRadioButtonUI\r\n JRadioButton radio = new JRadioButton();\r\n radio.getUI().uninstallUI(radio);\r\n JCheckBox checkBox = new JCheckBox();\r\n checkBox.getUI().uninstallUI(checkBox);\r\n\r\n try {\r\n UIManager.setLookAndFeel(selectedLaf);\r\n } catch (Exception e) {\r\n System.out.println(\"Can't change L&F: \" + e);\r\n }\r\n\r\n }", "public static void main(String[] args) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(siniestro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(siniestro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(siniestro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(siniestro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n EventQueue.invokeLater(new Runnable() {\n public void run() {\n JFrame frame = new JFrame();\n frame.setContentPane(new siniestro());\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.pack();\n frame.setVisible(true);\n }\n });\n }", "@Override\n public void init() {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n getContentPane().setBackground(Color.BLUE);\n this.setSize(450, 350);\n\n /* Create and display the applet */\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 */\n run();\n }", "public static void start() {\n\t\ttry {\n\t\t\tfor (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n\t\t\t\tif (\"Nimbus\".equals(info.getName())) {\n\t\t\t\t\tjavax.swing.UIManager.setLookAndFeel(info.getClassName());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (ClassNotFoundException ex) {\n\t\t\tjava.util.logging.Logger.getLogger(GUInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n\t\t} catch (InstantiationException ex) {\n\t\t\tjava.util.logging.Logger.getLogger(GUInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n\t\t} catch (IllegalAccessException ex) {\n\t\t\tjava.util.logging.Logger.getLogger(GUInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n\t\t} catch (javax.swing.UnsupportedLookAndFeelException ex) {\n\t\t\tjava.util.logging.Logger.getLogger(GUInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n\t\t}\n //</editor-fold>\n\n\t\t/* Create and display the form */\n\t\tjava.awt.EventQueue.invokeLater(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tnew GUInterface().setVisible(true);\n\t\t\t}\n\t\t});\n\t}", "public static void main(String args[]) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(HFGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(HFGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(HFGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(HFGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new HFGUI().setVisible(true);\n }\n });\n }", "public void setTheme(String name) {\n\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (name.equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(UserInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(UserInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(UserInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(UserInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n }", "public static void main(String args[]) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(InicioSesion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(InicioSesion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(InicioSesion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(InicioSesion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new InicioSesion().setVisible(true);\n }\n });\n }", "public static void main(String[] args) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(JFrame_Accueil.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(JFrame_Accueil.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(JFrame_Accueil.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(JFrame_Accueil.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n \n /* Create and display the form */\n java.awt.EventQueue.invokeLater(() -> {\n try {\n new JFrame_Accueil(0).setVisible(true);\n } catch (Exception ex) {\n Logger.getLogger(JFrame_Accueil.class.getName()).log(Level.SEVERE, null, ex);\n }\n });\n }", "public static void main(String[] args) {\r\n /* Set the Nimbus look and feel */\r\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\r\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\r\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html\r\n */\r\n try {\r\n javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());\r\n } catch (ClassNotFoundException ex) {\r\n java.util.logging.Logger.getLogger(FrameCuentasContablesAdmin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n } catch (InstantiationException ex) {\r\n java.util.logging.Logger.getLogger(FrameCuentasContablesAdmin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n } catch (IllegalAccessException ex) {\r\n java.util.logging.Logger.getLogger(FrameCuentasContablesAdmin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\r\n java.util.logging.Logger.getLogger(FrameCuentasContablesAdmin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n }\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n //</editor-fold>\r\n\r\n /* Create and display the form */\r\n EventQueue.invokeLater(new Runnable() {\r\n public void run() {\r\n JFrame frame = new JFrame();\r\n frame.setContentPane(new FrameCuentasContablesAdmin());\r\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n frame.pack();\r\n frame.setVisible(true);\r\n }\r\n });\r\n }", "private void changeUIdefaults() {\n\t\tUIManager.put(\"TaskPaneContainer.useGradient\", Boolean.FALSE);\n\t\tUIManager.put(\"TaskPaneContainer.background\",\n\t\t\t\tColors.LightGray.color(0.5f));\n\n\t\t// setting taskpane defaults\n\t\tUIManager.put(\"TaskPane.font\", new FontUIResource(new Font(\"Verdana\",\n\t\t\t\tFont.BOLD, 16)));\n\t\tUIManager.put(\"TaskPane.titleBackgroundGradientStart\",\n\t\t\t\tColors.White.color());\n\t\tUIManager.put(\"TaskPane.titleBackgroundGradientEnd\",\n\t\t\t\tColors.LightBlue.color());\n\t}", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n \n\n}\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(NewJFrame1.class\n.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n \n\n} catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(NewJFrame1.class\n.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n \n\n} catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(NewJFrame1.class\n.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n \n\n} catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(NewJFrame1.class\n.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new NewJFrame1().setVisible(true);\n }\n });\n }", "@Override\r\n\tpublic void run() {\n\t\ttry {\r\n\t\t\tLookAndFeelInfo look[] = UIManager.getInstalledLookAndFeels();\r\n\t\t\tfor (LookAndFeelInfo lookAndFeelInfo : look) {\r\n\r\n\t\t\t\tSystem.out.println(lookAndFeelInfo.getClassName());\r\n\t\t\t}\r\n\t\t\tUIManager.setLookAndFeel(this.config.getLookAndFeel());\r\n\t\t} catch (ClassNotFoundException | InstantiationException\r\n\t\t\t\t| IllegalAccessException | UnsupportedLookAndFeelException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tsetVisible(true);\r\n\t}", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {\n Logger.getLogger(InterpreterGui.class.getName()).log(Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(() -> {\n new InterpreterGui().setVisible(true);\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Calculator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Calculator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Calculator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Calculator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new Calculator().setVisible(true);\n }\n } \n );\n}", "public void setLAF(String lookAndFeelStr) {\n String exceptionNotice = \"\";\n try {\n // Set the font for Metal LAF to non-bold, in case Metal is used\n UIManager.put(\"swing.boldMetal\", Boolean.FALSE);\n if (lookAndFeelStr == null || lookAndFeelStr.equalsIgnoreCase(\"Metal\")) {\n UIManager.setLookAndFeel(new MetalLookAndFeel());\n } else\n if (lookAndFeelStr.equalsIgnoreCase(\"Nimbus\")) {\n for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {\n if (info.getName().equals(\"Nimbus\")) {\n UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } else {\n UIManager.setLookAndFeel(lookAndFeelStr);\n }\n } catch (UnsupportedLookAndFeelException e) {\n exceptionNotice = \"UnsupportedLookAndFeelException\";\n } catch (ClassNotFoundException e) {\n exceptionNotice = \"ClassNotFoundException\";\n } catch (InstantiationException e) {\n exceptionNotice = \"InstantiationException\";\n } catch (IllegalAccessException e) {\n exceptionNotice = \"IllegalAccessException\";\n } finally {\n if (! exceptionNotice.isEmpty()) {\n try {\n // The desired LAF was not created, so try to use the Metal LAF as a default.\n UIManager.setLookAndFeel(new MetalLookAndFeel());\n } catch (UnsupportedLookAndFeelException e) {\n logger.error(\"Could not initialize the Swing Look and Feel settings, MCT is closing.\");\n System.exit(1);\n }\n }\n }\n // Look and Feel has been successfully created, now set colors\n initializeColors(UIManager.getLookAndFeel());\n Properties props = new Properties();\n String filename = System.getProperty(viewColor,\"resources/properties/viewColor.properties\");\n FileReader reader = null;\n try {\n \treader = new FileReader(filename);\n \tprops.load(reader);\n BASE_PROPERTIES = new ColorScheme(props);\n BASE_PROPERTIES.applyColorScheme(); // Apply top-level color bindings\n } catch (Exception e) {\n logger.warn(\"Using default color and font properties because could not open viewColor properties file :\"+filename);\n BASE_PROPERTIES = new ColorScheme();\n } finally {\n \ttry {\n if (reader != null) reader.close();\n } catch(IOException ioe1){ }\n }\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Form.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Form.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Form.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Form.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new Form().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(LibroDiario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(LibroDiario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(LibroDiario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(LibroDiario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new LibroDiario().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(KamarFrom.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(KamarFrom.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(KamarFrom.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(KamarFrom.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new KamarFrom().setVisible(true);\n }\n });\n }", "protected void installDefaults() {\n this.controlPanel.setBackground(null);\n\n Font font = this.controlPanel.getFont();\n if (font == null || font instanceof UIResource) {\n Font toSet = RadianceThemingCortex.GlobalScope.getFontPolicy().getFontSet().\n getControlFont();\n this.controlPanel.setFont(toSet);\n }\n }", "static public LookAndFeelManager createDefaultLookAndFeelManager()\n {\n LookAndFeelManager manager = new LookAndFeelManager();\n\n /* =-=AEW DO NOT register the external look-and-feels; these\n class names are UIX 2.2 look-and-feels, which won't (and can't)\n work in UIX 3, given the different class names. Only uncomment\n if and when such classes are ported to UIX 3.\n // support requests from iasWireless if laf can be found\n _registerExternalLookAndFeel(manager, iaswLaf, _IASW_SCORER);\n\n // register OA's Text LAF if laf can be found\n _registerExternalLookAndFeel(manager, _OA_TEXT_LAF, _OA_TEXT_SCORER);\n */\n\n // Base lafs\n BaseDesktopUtils.registerLookAndFeel(manager);\n\n SimpleDesktopUtils.registerLookAndFeel(manager);\n SimplePdaUtils.registerLookAndFeel(manager);\n\n return manager;\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Puntos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Puntos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Puntos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Puntos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new Puntos().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(HW3.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(HW3.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(HW3.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(HW3.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new HW3().setVisible(true);\n }\n });\n }", "public Vista_Login() {\n \t\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Vista_Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Vista_Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Vista_Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Vista_Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(FrmLoguin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(FrmLoguin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(FrmLoguin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(FrmLoguin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new FrmLoguin().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Musica.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Musica.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Musica.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Musica.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new Musica().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new Register().setVisible(true);\n }\n });\n }", "public static void main(String[] args) throws Exception{\n\t\tUIManager.setLookAndFeel(new NimbusLookAndFeel());\n\t\t\n\t\t\n\t\tMyWindow myWindow = new MyWindow();\n\t\tmyWindow.setVisible(true);\n\n\t}", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Setup.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Setup.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Setup.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Setup.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new Setup().setVisible(true);\n }\n });\n }", "public static void main(String[] args) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(CadContasReceitasDespesasView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(CadContasReceitasDespesasView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(CadContasReceitasDespesasView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(CadContasReceitasDespesasView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n EventQueue.invokeLater(new Runnable() {\n public void run() {\n JFrame frame = new JFrame();\n frame.setContentPane(new CadContasReceitasDespesasView());\n //frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.pack();\n frame.setVisible(true);\n frame.setTitle(args[0]);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(sinavlar2.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(sinavlar2.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(sinavlar2.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(sinavlar2.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /*\n * Create and display the form\n */\n java.awt.EventQueue.invokeLater(new Runnable() {\n\n @Override\n public void run() {\n new sinavlar2().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Registracija.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Registracija.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Registracija.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Registracija.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new Registracija().setVisible(true);\n }\n });\n }", "private void applyInitialLook() {\r\n\t\tthis.control.setFont(this.initialFont);\r\n\t\tthis.control.setBackground(this.initialBackgroundColor);\r\n\t\tthis.control.setForeground(this.initialForegroundColor);\r\n\t}", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new main().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(UsuarioView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(UsuarioView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(UsuarioView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(UsuarioView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n @Override\n public void run() {\n JFrame frame = new JFrame(\"Inscrição\");\n frame.add(new InscricaoView());\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.setResizable(false);\n frame.pack();\n frame.setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(cusRegister.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(cusRegister.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(cusRegister.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(cusRegister.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n try {\n new cusRegister().setVisible(true);\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(cusRegister.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(RamkaGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(RamkaGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(RamkaGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(RamkaGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new RamkaGui().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(adminhome.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(adminhome.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(adminhome.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(adminhome.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new adminhome().setVisible(true);\n }\n });\n }", "public static void main(String[] args) \n\t{\n\t\tCommonMethods.openConnection();\n\t\ttry {\n \t for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {\n \t if (\"Nimbus\".equals(info.getName())) {\n \t UIManager.setLookAndFeel(info.getClassName());\n \t break;\n \t }\n \t }\n \t} catch (Exception e) {\n \t // If Nimbus is not available, you can set the GUI to another look and feel.\n \t}\n\t\t\n\t\tnew AddNewCustomer();\n\n\t}", "public static void main(String args[]) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Stock_Management.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Stock_Management.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Stock_Management.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Stock_Management.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new Stock_Management().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(kullaniciEkrani.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(kullaniciEkrani.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(kullaniciEkrani.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(kullaniciEkrani.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new kullaniciEkrani().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(UIHorariosLista.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(UIHorariosLista.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(UIHorariosLista.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(UIHorariosLista.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new UIHorariosLista().setVisible(true);\n }\n });\n }", "public static void startTrayIcon() {\r\n try {\r\n \tUIManager.setLookAndFeel(\"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel\");\r\n } catch (Exception ex) {\r\n \tJOptionPane.showMessageDialog(null, \"Error setting Look & Feel \"+ex, \"Error setting Look & Feel\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n /* Turn off metal's use of bold fonts */\r\n UIManager.put(\"swing.boldMetal\", Boolean.FALSE);\r\n //Schedule a job for the event-dispatching thread:\r\n //adding TrayIcon.\r\n SwingUtilities.invokeLater(new Runnable() {\r\n public void run() {\r\n createAndShowGUI();\r\n }\r\n });\r\n }", "protected void installDefaults() {\n spinner.setLayout(createLayout());\n LookAndFeel.installBorder(spinner, \"Spinner.border\");\n LookAndFeel.installColorsAndFont(spinner, \"Spinner.background\", \"Spinner.foreground\", \"Spinner.font\"); }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(UrunListele.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(UrunListele.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(UrunListele.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(UrunListele.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new UrunListele().setVisible(true);\n }\n });\n }", "public static void main(final String[] args) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(ClienteView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(ClienteView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(ClienteView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(ClienteView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n EventQueue.invokeLater(new Runnable() {\n public void run() {\n JFrame frame = new JFrame();\n frame.setContentPane(new ClienteView());\n frame.pack();\n frame.setVisible(true);\n frame.setTitle(args[0]);\n \n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Register.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n try {\n new Register().setVisible(true);\n } catch (SQLException ex) {\n Logger.getLogger(Register.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n });\n }", "public static void main(String[] args) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n// * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n// */\n// try {\n// for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n// if (\"Nimbus\".equals(info.getName())) {\n// javax.swing.UIManager.setLookAndFeel(info.getClassName());\n// break;\n// }\n// }\n// } catch (ClassNotFoundException ex) {\n// java.util.logging.Logger.getLogger(CatcTitles.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n// } catch (InstantiationException ex) {\n// java.util.logging.Logger.getLogger(CatcTitles.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n// } catch (IllegalAccessException ex) {\n// java.util.logging.Logger.getLogger(CatcTitles.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n// } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n// java.util.logging.Logger.getLogger(CatcTitles.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n// }\n //</editor-fold>\n\n /* Create and display the form */\n EventQueue.invokeLater(new Runnable() {\n public void run() {\n JFrame frame = new JFrame();\n frame.setContentPane(new CatcTitles());\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.pack();\n frame.setVisible(true);\n }\n });\n }", "public CalculatorGUI() {\n initComponents();\n setTitle(\"Calculator\");\n //setLookAndFeel(\"Windows\");\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Kayıt_Sil.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Kayıt_Sil.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Kayıt_Sil.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Kayıt_Sil.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold> \n\n /* Create and display the form */\n \n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new Kayıt_Sil().setVisible(true);\n }\n });\n }", "private void menuMotifActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuMotifActionPerformed\n try {\n UIManager.setLookAndFeel(\"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel\");\n SwingUtilities.updateComponentTreeUI(this);\n } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {\n Logger.getLogger(MoneyMinderDesktopMainGui.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(TelaDelProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(TelaDelProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(TelaDelProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(TelaDelProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n }", "private void setAppearance(String className) {\n DweezilUIManager.setLookAndFeel(className, new Component[]{MainFrame.getInstance(), StatusWindow.getInstance(),\n PrefsSettingsPanel.this.getParent().getParent()});\n\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(SpaceSim.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n @Override\n public void run() {\n new SpaceSim().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(segundapartepestaña5.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(segundapartepestaña5.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(segundapartepestaña5.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(segundapartepestaña5.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new segundapartepestaña5().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(frmBuscarRemitentes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(frmBuscarRemitentes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(frmBuscarRemitentes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(frmBuscarRemitentes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n frmBuscarRemitentes dialog = new frmBuscarRemitentes(new javax.swing.JFrame(), true);\n dialog.addWindowListener(new java.awt.event.WindowAdapter() {\n public void windowClosing(java.awt.event.WindowEvent e) {\n System.exit(0);\n }\n });\n dialog.setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(FRM_Venta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(FRM_Venta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(FRM_Venta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(FRM_Venta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new FRM_Venta().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(JFMenu_principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(JFMenu_principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(JFMenu_principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(JFMenu_principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new TelaCliente().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(ImagenesProducto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(ImagenesProducto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(ImagenesProducto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(ImagenesProducto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new ImagenesProducto().setVisible(true);\n }\n });\n }", "protected void installDefaults() {\n\t\tColor bg = this.controlPanel.getBackground();\n\t\tif (bg == null || bg instanceof UIResource) {\n\t\t\tthis.controlPanel.setBackground(FlamingoUtilities.getColor(\n\t\t\t\t\tColor.lightGray, \"ControlPanel.background\",\n\t\t\t\t\t\"Panel.background\"));\n\t\t}\n\n\t\tBorder b = this.controlPanel.getBorder();\n\t\tif (b == null || b instanceof UIResource) {\n\t\t\tBorder toSet = UIManager.getBorder(\"ControlPanel.border\");\n\t\t\tif (toSet == null)\n\t\t\t\tnew BorderUIResource.EmptyBorderUIResource(1, 2, 1, 2);\n\t\t\tthis.controlPanel.setBorder(toSet);\n\t\t}\n\t\t\n\t\tFont font = this.controlPanel.getFont();\n if (font == null || font instanceof UIResource) {\n Font toSet = UIManager.getFont(\"Panel.font\");\n this.controlPanel.setFont(toSet);\n }\n\t}", "public MainFrame() throws Exception {\r\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n //SynthLookAndFeel laf = new SynthLookAndFeel();\r\n //UIManager.setLookAndFeel(laf);\r\n initComponents();\r\n }", "public static void main(String args[]) {\r\n try {\r\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\r\n if (\"Nimbus\".equals(info.getName())) {\r\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\r\n break;\r\n }\r\n }\r\n } catch (ClassNotFoundException ex) {\r\n java.util.logging.Logger.getLogger(Roysched.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n } catch (InstantiationException ex) {\r\n java.util.logging.Logger.getLogger(Roysched.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n } catch (IllegalAccessException ex) {\r\n java.util.logging.Logger.getLogger(Roysched.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\r\n java.util.logging.Logger.getLogger(Roysched.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\r\n }\r\n //</editor-fold>\r\n\r\n /* Create and display the form */\r\n java.awt.EventQueue.invokeLater(new Runnable() {\r\n public void run() {\r\n new Roysched().setVisible(true);\r\n }\r\n });\r\n }", "protected void uninstallDefaults() {\n\t\tLookAndFeel.uninstallBorder(this.controlPanel);\n\t}", "public static void main(String[] args) {\n\t\ttry {\r\n\t\t\tUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n\t\t} catch (Exception ex) {\r\n\t\t}\r\n\t}", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(jfmActividades.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(() -> {\n new jfmActividades().setVisible(true);\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(ThermalInfo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(ThermalInfo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(ThermalInfo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(ThermalInfo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new ThermalInfo().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(HomePage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(HomePage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(HomePage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(HomePage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new HomePage().setVisible(true);\n }\n });\n }", "public static void main(String args[]) {\n /* Set the Nimbus look and feel */\n //<editor-fold defaultstate=\"collapsed\" desc=\" Look and feel setting code (optional) \">\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(VentaForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(VentaForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(VentaForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(VentaForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new VentaForm().setVisible(true);\n }\n });\n }" ]
[ "0.7949177", "0.7767432", "0.7700453", "0.7505285", "0.72892106", "0.7228083", "0.72242665", "0.7219334", "0.71824956", "0.71557355", "0.7120814", "0.71131855", "0.71004164", "0.70623386", "0.70506656", "0.6914896", "0.681819", "0.67058736", "0.66945297", "0.6586071", "0.657471", "0.6529725", "0.6527057", "0.6505809", "0.64167625", "0.6404806", "0.62610257", "0.6260199", "0.62218", "0.61894715", "0.61695814", "0.6137937", "0.61346996", "0.6077677", "0.6061483", "0.6055815", "0.603076", "0.6027144", "0.5995923", "0.5948873", "0.5899828", "0.58841854", "0.5861428", "0.5856423", "0.5806266", "0.57933265", "0.5785838", "0.57706314", "0.5745527", "0.57393897", "0.57260334", "0.5659065", "0.56562257", "0.5654377", "0.5650165", "0.56219906", "0.5606097", "0.56003606", "0.5585026", "0.55735874", "0.55711806", "0.5567775", "0.55676097", "0.55622214", "0.554676", "0.55465007", "0.5517036", "0.551466", "0.55122614", "0.549769", "0.5490632", "0.5489558", "0.54728675", "0.5471712", "0.54548645", "0.5453761", "0.5453085", "0.544681", "0.54430735", "0.5437859", "0.54316306", "0.5430247", "0.5425269", "0.5419398", "0.5415798", "0.54030114", "0.5401843", "0.53857636", "0.5376464", "0.5364001", "0.5362827", "0.5353076", "0.535274", "0.5334693", "0.5329685", "0.5323622", "0.53223747", "0.5321501", "0.5320476", "0.5320379", "0.5313285" ]
0.0
-1
As an air traffic controller So I can get passengers to a destination I want to instruct a plane to land at an airport
@Test public void planeCanLand() { try { heathrow.landing(tap); } catch (Exception exception) { } expectedPlanes.add(tap); assertEquals(expectedPlanes, heathrow.hangar); assertSame(tap, heathrow.hangar.get(0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public IAirport getDestination();", "LaneController getStraightLaneController();", "@Override\n\tprotected void land(){\n\t\tgvh.log.i(TAG, \"Drone landing\");\n\t\t//setControlInput(my_model.yaw, 0, 0, 5);\n\t}", "public Airplane (){\n \n }", "public static void main(String[] args) {\n\t\tint grid[][] = new int[][]\n\t\t\t { \n\t\t\t { 1, 1, 0, 0, 0, 0, 1, 0, 0, 0 }, \n\t\t\t { 0, 1, 0, 1, 0, 0, 0, 1, 0, 0 }, \n\t\t\t { 0, 0, 0, 1, 0, 0, 1, 0, 1, 0 }, \n\t\t\t { 1, 1, 1, 1, 0, 1, 1, 1, 1, 0 }, \n\t\t\t { 0, 0, 0, 1, 0, 0, 0, 1, 0, 1 }, \n\t\t\t { 0, 1, 0, 0, 0, 0, 1, 0, 1, 1 }, \n\t\t\t { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, \n\t\t\t { 0, 1, 0, 0, 0, 0, 1, 0, 0, 0 }, \n\t\t\t { 0, 0, 1, 1, 1, 1, 0, 1, 1, 0 } \n\t\t\t };\n\t\t\n // Step 1: Obtain an instance of GridBasedTrafficControl.\n Configurator cfg = new DefaultConfigurator();\n GridBasedTrafficControl gbtc = cfg.getGridBasedTrafficControl(grid);\n\t\t\n\t // Step 2: Obtain path for Journey-1.\n\t Point source1 = new Point(0, 0);\n\t Point dest1 = new Point(3,4);\t \n\t String vehicleId1 = formVehicleId(source1);\n\t List<Point> path1 = gbtc.allocateRoute(vehicleId1, source1, dest1);\n\t System.out.println(\"Route for Journey-1:\" + path1);\n\t \n\t // Step 3: Obtain path for Journey-2.\n\t // This call will not return a route as the available route conflicts with the route\n\t // allocated for Journey-1.\n\t Point source2 = new Point(3, 0);\n\t Point dest2 = new Point(2,4);\n\t String vehicleId2 = formVehicleId(source2);\n\t List<Point> path2 = gbtc.allocateRoute(vehicleId2, source2, dest2);\n\t System.out.println(\"Route for Journey-2:\" + path2);\n\t \n\t // Step 4: Start Journey-1 and mark Journey-1 as complete.\n\t GridConnectedVehicle vehicle1 = new GridConnectedVehicle(vehicleId1, gbtc);\n\t vehicle1.selfDrive(path1);\n\t gbtc.markJourneyComplete(vehicleId1, source1, dest1);\n\t \n\t // Step 5: Retry call to obtain path for Journey-2.\n\t // This call should return a valid path as Journey-1 was marked as complete.\n\t path2 = gbtc.allocateRoute(formVehicleId(source2), source2, dest2);\n\t System.out.println(\"Route for Journey-2:\" + path2);\n\t \n\t // Step 6: Start Journey-2 and mark Journey-2 as complete.\n\t GridConnectedVehicle vehicle2 = new GridConnectedVehicle(vehicleId2, gbtc);\n\t vehicle2.selfDrive(path2);\n\t gbtc.markJourneyComplete(vehicleId2, source2, dest2);\n\t}", "public IAirport getOrigin();", "public interface TravelStrategy {\r\n\t/**\r\n\t * Returns the floor number of the passenger's current destination, so that other strategies can base their\r\n\t * decisions on where the passenger is trying to get to.\r\n\t */\r\n\tint getDestination();\r\n\t\r\n\t/**\r\n\t * Called when it is time to schedule a PassengerNextDestinationEvent according to the rules of this travel strategy.\r\n\t * Typically this occurs when the passenger departs the elevator on the correct floor, but that is not guaranteed.\r\n\t * @param currentFloor the floor that the passenger got off.\r\n\t */\r\n\tvoid scheduleNextDestination(Passenger passenger, Floor currentFloor);\r\n}", "@Override\n\tprotected void landAction(){\n\t\tdestIndex++;\n\t\tif(destIndex>=track.size())\n\t\t\tdestIndex=0;\n\t\tdestination=track.get(destIndex);\n\t\t\n\t}", "public static void main(String[] args) throws CantAdd, CoronaWarn {\n\t\tTravelAgency TravelAgency = new TravelAgency();\r\n\r\n\t\tPlane p=new Plane(200,2,\"first plane max travelers\");\r\n\t\tPlane p1=new Plane(100,1,\"second plan min traelers\");\r\n\r\n\t\tTrip i=new Trip(p,Country.Australia,Country.Canada);\r\n\t\tTrip io=new Trip(p1,Country.Australia,Country.Canada);\r\n\t\t \r\n\t\tDate date=new Date(1,2,5);\r\n\t\tPassport passprt1=new Passport(\"anton\",44,date);\r\n\t\tPassport passprt2=new Passport(\"abdo\",44,date);\r\n\t\tPassport passprt3=new Passport(\"julie\",44,date);\r\n\t\tPassport passprt4=new Passport(\"juliana\",44,date);\r\n\t\tPassport passprt5=new Passport(\"bella\",44,date);\r\n\t\tPassport passprt6=new Passport(\"geris\",44,date);\r\n\t\tTraveler t1=new Traveler(passprt1,true,true);\r\n\t\tTraveler t2=new Traveler(passprt2,true,true);\r\n\t\tTraveler t3=new Traveler(passprt3,true,true);\r\n\t\tTraveler t4=new Traveler(passprt4,true,true);\r\n\t\tTraveler t5=new Traveler(passprt5,true,true);\r\n\t\tTraveler t6=new Traveler(passprt6,true,true);\r\n\t\t\r\n\t\t\r\n\t\tio.addTraveler(t1);\r\n\t\tio.addTraveler(t2);\r\n\t\tio.addTraveler(t3);\r\n\t\tio.addTraveler(t6);\r\n\t\tio.addTraveler(t5);\r\n\t\tio.addTraveler(t4);\r\n\t\tio.addTraveler(t6);\r\n \r\n\t\ti.addTraveler(t1);\r\n\t\ti.addTraveler(t2);\r\n\t\ti.addTraveler(t3);\r\n\t\ti.addTraveler(t4);\r\n\t\r\n\t\ti.addTraveler(t6);\r\n\t\t\r\n\t\tTravelAgency.addTrip(i);\t\r\n\t\tTravelAgency.addTrip(io);\r\n\t\tSystem.out.print(TravelAgency.findUnsafeTrips());\r\n\r\n\t\t\r\n\t\tTravelAgency.AddTraveler(t1);\r\n\t\tTravelAgency.AddTraveler(t2);\r\n\t\tTravelAgency.AddTraveler(t3);\r\n\t\tTravelAgency.AddTraveler(t4);\r\n\t\tTravelAgency.AddTraveler(t5);\r\n\t\tTravelAgency.AddTraveler(t6);\r\n\t\t\r\n\t}", "public boolean enterAirPlane(Plane<?> newPlane) {\r\n\r\n //it's boolean because im to lazy to add trycatch blocks\r\n //create a new excpetion; plus this provideds a easy way to exit the method;\r\n\r\n Runway temp = findRunway(newPlane.getRunway());\r\n\r\n if(temp != null) {\r\n temp.enqueueToRunway(newPlane);\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }", "private void travelTo(Location destination) \n\t{\n\t\tSystem.out.println(destination.name());\n\t\tif (destination == Location.Home) {\n\t\t\t\n\t\t\tif (role == Role.Attacker) {\n\t\t\t\t\n\t\t\t\tswitch(startingCorner) { \n\t\t\t\t\t/*case 1: travelTo(Location.X4); travelTo(Location.AttackBase); break;\n\t\t\t\t\tcase 2: travelTo(Location.X3); travelTo(Location.AttackBase); break;\n\t\t\t\t\tcase 3: case 4: travelTo(Location.AttackBase);*/\n\t\t\t\tcase 1: travelTo(Location.AttackBase); break;\n\t\t\t\tcase 2: travelTo(Location.AttackBase); break;\n\t\t\t\tcase 3: //travelTo(Location.X2);\n\t\t\t\t\t\ttravelTo(Location.AttackBase); break;\n\t\t\t\tcase 4: //travelTo(Location.X1);\n\t\t\t\t\t\ttravelTo(Location.AttackBase); break;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else if (role == Role.Defender) {\n\t\t\t\t\n\t\t\t\tswitch(startingCorner) {\n\t\t\t\t\tcase 1: //travelTo(Location.X4);\n\t\t\t\t\t\t\ttravelTo(Location.DefenseBase); break;\n\t\t\t\t\tcase 2: //travelTo(Location.X3);\n\t\t\t\t\t\t\ttravelTo(Location.DefenseBase); break;\n\t\t\t\t\tcase 3: travelTo(Location.DefWay3);\n\t\t\t\t\t\t\ttravelTo(Location.DefenseBase); break;\n\t\t\t\t\tcase 4: travelTo(Location.DefWay4);\n\t\t\t\t\t\t\ttravelTo(Location.DefenseBase); break;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t\n\t\telse if (destination == Location.BallPlatform)\n\t\t\tnavigator.travelTo(ballPlatform[0], ballPlatform[1]);\n\t\t\t\n\t\telse if (destination == Location.ShootingRegion)\n\t\t\tnavigator.travelTo(CENTER, 7 * 30.0); // we have to account for the case when there is an obstacle in the destination\n\t\t\t// also need to find a way of determining the y coordinate\n\n\t\telse if (destination == Location.AttackBase)\n\t\t\tnavigator.travelTo(ATTACK_BASE[0], ATTACK_BASE[1]); \n\t\t\n\t\telse if (destination == Location.DefenseBase)\n\t\t\tnavigator.travelTo(DEFENSE_BASE[0], DEFENSE_BASE[1]);\n\t\t\n\t\telse if (destination == Location.X1) \n\t\t\tnavigator.travelTo(X[0][0] * 30.0, X[0][1] * 30.0);\n\n\t\telse if (destination == Location.X2)\n\t\t\tnavigator.travelTo(X[1][0] * 30.0, X[1][1] * 30.0);\n\t\t\n\t\telse if (destination == Location.X3) \n\t\t\tnavigator.travelTo(X[2][0] * 30.0, X[2][1] * 30.0);\n\n\t\telse if (destination == Location.X4)\n\t\t\tnavigator.travelTo(X[3][0] * 30.0, X[3][1] * 30.0);\n\t\t\n\t\telse if (destination == Location.DefWay3)\n\t\t\tnavigator.travelTo(240, 240);\n\t\t\n\t\telse if (destination == Location.DefWay4)\n\t\t\tnavigator.travelTo(60, 240);\n\n\t\t\n\t\t// return from method only after navigation is complete\n\t\twhile (navigator.isNavigating())\n\t\t{\n\t\t\tSystem.out.println(\"destX: \" + navigator.destDistance[0] + \"destY: \" + navigator.destDistance[1]);\n\t\t\ttry {\n\t\t\t\tThread.sleep(100);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public abstract int drive(int journeyDistance);", "private void startMapCreater() {\n\t\tNavigator navi = new Navigator(pilot);\n\t\tnavi.addWaypoint(0,0);\n\t\tnavi.addWaypoint(0,5000);\n\t\tBehavior forward = new Forward(navi);\n\t\tBehavior ultrasonic = new UltrasonicSensor(ultrasonicSensorAdaptor,pilot, sonicWheel,dis,dos,navi);\n\t\tBehavior stopEverything = new StopRobot(Button.ESCAPE);\n\t\tBehavior[] behaiverArray = {forward, ultrasonic, stopEverything};\n\t\tarb = new Arbitrator(behaiverArray);\n\t\t\n\t arb.go();\n\t\t\n\t}", "public String getArrivalAirport();", "public void boardPassenger(int floor){\n _passengersOnboard +=1;\n switch(floor){\n case 1: Floor.FIRST.makeDestinationRequest();\n Floor.FIRST.addQueuedPassenger();\n break;\n case 2: Floor.SECOND.makeDestinationRequest();\n Floor.SECOND.addQueuedPassenger();\n break;\n case 3: Floor.THIRD.makeDestinationRequest();\n Floor.THIRD.addQueuedPassenger();\n break;\n case 4: Floor.FOURTH.makeDestinationRequest();\n Floor.FOURTH.addQueuedPassenger();\n break;\n case 5: Floor.FIFTH.makeDestinationRequest();\n Floor.FIFTH.addQueuedPassenger();\n break;\n case 6: Floor.SIXTH.makeDestinationRequest();\n Floor.SIXTH.addQueuedPassenger();\n break;\n case 7: Floor.SEVENTH.makeDestinationRequest();\n Floor.SEVENTH.addQueuedPassenger();\n break;\n }\n }", "public Airplane(){\n\t\tsuper(106, 111);\n\t\tspeed = Math.random() + 2.0;\n\t}", "Plane getPlane();", "public Flight(String flightNumber, String airline, int passengerCapacity, String destination){\n this.flightNumber = flightNumber;\n this.airline = airline;\n this.passengerCapacity = passengerCapacity;\n this.destination = destination;\n passengerManifest = new ArrayList<Passenger>();\n\n }", "public static void setAirplaneMode(boolean isAirplaneMode) {\n Settings.System.putInt(Robolectric.application.getContentResolver(), Settings.System.AIRPLANE_MODE_ON, isAirplaneMode ? 1 : 0);\n }", "public void setDestinationAirport(java.lang.String destinationAirport) {\r\n this.destinationAirport = destinationAirport;\r\n }", "public interface AircraftColleague {\n public void startLanding();\n public void finishLanding();\n}", "public abstract void onLand(Player player);", "public Flight(Plane plane, String flightNo, String airlineName) {\n this.airlineName = airlineName;\n this.flightNo = flightNo;\n this.plane = plane;\n }", "@Override\r\n\tpublic void cruise() {\n\t\tSystem.out.println(\"In SeaPlane::cruise\");\r\n\t\tif (altitude < 10) \r\n\t\t\tSail.super.cruise();\r\n\t\telse\r\n\t\t\tFastFly.super.cruise();\r\n\t}", "@Override\n public void onLongPress(MotionEvent event) { Place a new Route Point\n //\n switch (event.getActionMasked())\n {\n case MotionEvent.ACTION_DOWN:\n {\n //Log.i(\"onLongPress\", \"This is a onLongPress (ACTION_DOWN) event...\");\n if (routeVisuals.selectedWaypoint != null) {\n movingRoutePoint = true;\n placingRoutePoint = false;\n }\n else {\n placingRoutePoint = true;\n movingRoutePoint = false;\n }\n\n super.getLocationForPoint(new PointF(event.getX(), event.getY()), new LocationReceiver() {\n @Override\n public void receiveLocation(Location location) {\n if (!movingRoutePoint) {\n Log.w(\"onLongPress\", \"lon:\" + location.longitude + \" lat:\" + location.latitude);\n Coordinate c = new Coordinate(location.longitude, location.latitude);\n WithinAirspaceCheck check = new WithinAirspaceCheck(MyMapView.this.context, c);\n check.SetOnFoundAirspace(new WithinAirspaceCheck.OnFoundAirspace() {\n @Override\n public void OnFoundAirspace(Airspace airspace) {\n Log.i(TAG, \"Found: \" + airspace.Name);\n if (onFoundAirspace != null)\n onFoundAirspace.OnFoundAirspace(airspace);\n }\n\n @Override\n public void OnFoundAllAirspaces(Airspaces airspaces) {\n Log.i(TAG, \"Total airspaces : \" + airspaces.size());\n if (onFoundAirspace != null)\n onFoundAirspace.OnFoundAllAirspaces(airspaces);\n }\n });\n\n\n check.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n }\n\n }\n });\n\n break;\n }\n }\n\n// super.getLocationForPoint(new PointF(event.getX(), event.getY()), new ConvertPointCallback(){\n// @Override\n// public void convertComplete(Location loc) {\n// //Log.w(\"onLongPress\", \"lon:\" + loc.longitude + \" lat:\" + loc.latitude);\n//\n// if (placingRoutePoint) {\n// String name = loc.longitude + \",\" + loc.latitude;\n// routeVisuals.AddWaypoint(name, loc);\n//\n// //placingRoutePoint = false;\n// movingRoutePoint = true;\n// // insert the new point\n//\n// }\n//\n//\n// }});\n\n super.onLongPress(event);\n }", "public void travel();", "java.lang.String getTransitAirport();", "private void landOrTakeoff(String land_or_takeoff) {\n\t\ttry {\n\t\tthis.baggage = Integer.valueOf(land_or_takeoff);\n\t\tthis.isLanding = true;\n\t\t}catch(NumberFormatException e) {\n\t\t\tthis.isLanding = false;\n\t\t\tthis.destination = land_or_takeoff;\n\t\t}//catch\n\t}", "public OBGPControlPlane(Config aConfig, SimulationAccounting aAccounting) {\r\n\t\t\r\n\t\r\n\r\n\t\tsuper(aConfig);\r\n\t\t// System.out.println(\"Carregando plano de controle\");\r\n\t\tthis.accounting = (Accounting) aAccounting;\r\n\t\t// Get the links of this network\r\n\t\tlinks = config.getLinks();\r\n\t\t// System.out.println(links.toString());\r\n\t\t// Create the nodes of this network\r\n\t\tnodes = new LinkedHashMap<String, OBGPLabelSwitchRouter>();\r\n\t\t// Create the storage of disrupted connections by failure\r\n\t\tdisruptedLSP = new Hashtable<String, LightpathRequest>();\r\n\t\trestoredLSP = new Hashtable<String, Connection>();\r\n\t\t// Get the simulation parameters\r\n\t\tHashtable<String, Vector<String>> parameters = config\r\n\t\t\t\t.getSimulationParameters();\r\n\t\t// see all the parameters\r\n\t\tif (verbose)\r\n\t\t\tSystem.out.println(parameters.toString());\r\n\r\n\t\t// get all the asbrs. It will be important to identify the node\r\n\t\tasbrs = parameters.get(\"/Domains/ASBR\");\r\n\r\n\t\t// policyFrom = parameters.get(\"/Domains/POLICY/@from\");\r\n\t\tsetPolicy = new LinkedHashMap<String, Vector<String>>();\r\n\r\n\t\thopLimit = Integer.parseInt(parameters.get(\"/OPS/Hop/@limit\")\r\n\t\t\t\t.firstElement());\r\n\t\t// Get details about the RWA algorithm used\r\n\t\trerouting = ReRouting.valueOf(parameters.get(\"/RWA/Routing/@rerouting\")\r\n\t\t\t\t.firstElement());\r\n\r\n\t\t// Get the number of rerounting attempts\r\n\t\treroutingAttempts = Integer.parseInt(parameters.get(\r\n\t\t\t\t\"/RWA/Routing/@attempts\").firstElement());\r\n\t\t// Get the number of interomdina rerouting attempts\r\n\t\tmaxInterReroutingAttempts = Integer.parseInt(parameters.get(\r\n\t\t\t\t\"/RWA/Routing/@interAttempts\").firstElement());\r\n\t\t// The max number of rerouting attempts\r\n\t\tmaxReroutingAttempts = Integer.parseInt(parameters.get(\r\n\t\t\t\t\"/RWA/Routing/@maxAttempts\").firstElement());\r\n\t\tthis.alternative = reroutingAttempts + 1; // Number of k-shortest paths\r\n\t\twa = WavelengthAssignment.valueOf(parameters.get(\"/RWA/WA/@type\")\r\n\t\t\t\t.firstElement());\r\n\r\n\t\tmaxInterRoutes = Integer.parseInt(parameters.get(\r\n\t\t\t\t\"/RWA/Routing/@interRoutes\").firstElement());\r\n\r\n\t\tboolean serRT = Boolean.parseBoolean(parameters.get(\r\n\t\t\t\t\"/RWA/Serialize/@rt\").firstElement());\r\n\r\n\t\t// Gets the size of the time slice\r\n\t\ttimeSlice = Double.parseDouble(parameters.get(\r\n\t\t\t\t\"/Outputs/Transient/@timeSlice\").firstElement());\r\n\t\tactualTimeSlice = timeSlice;\r\n\t\t// Gets the time necessary for fault localization.\r\n\t\tfaultLocalizationTime = Double.parseDouble(parameters.get(\r\n\t\t\t\t\"/Failure/Timing/@localization\").firstElement());\r\n\t\tidentificationLength = Integer.parseInt(parameters.get(\r\n\t\t\t\t\"/OPS/Hop/@bytes\").firstElement());\r\n\r\n\t\tLinkedHashMap<String, ExplicitRoutingTable> rTables = null;\r\n\r\n\t\t// create the collection of graphs\r\n\t\tdomainGraphs = new LinkedHashMap<String, Graph>();\r\n\t\treroutedLSP = new LinkedHashMap<String, Connection>();\r\n\r\n\t\t/** GENERATION OF PER DOMAIN GRAPH */\r\n\r\n\t\tsetPerDomainPaths(graph, domainGraphs);\r\n\r\n\t\tif (serRT) {\r\n\t\t\tString fileRT = parameters.get(\"/RWA/Serialize/@file\")\r\n\t\t\t\t\t.firstElement();\r\n\r\n\t\t\trTables = this.read(fileRT);\r\n\t\t} else {\r\n\r\n\t\t\t/** COMMAND BLOCK: GENERATION OF PER-DOMAIN ROUTES */\r\n\r\n\t\t\tdomainSetPaths = new LinkedHashMap<String, LinkedHashMap<String, Vector<Path>>>();\r\n\t\t\t// Populates the hash table domainSetPaths with path inside each\r\n\t\t\t// domain\r\n\t\t\tfor (String domain : domainGraphs.keySet()) {\r\n\t\t\t\tdomainSetPaths.put(domain,\r\n\t\t\t\t\t\tthis.getPaths(domainGraphs.get(domain), alternative));\r\n\t\t\t}\r\n\t\t\t// Now, each domain has all the best paths from one node to another\r\n\t\t\t// (inside the same domain)\r\n\t\t}\r\n\r\n\t\t// We need to create a routing table of the node inside its own domain.\r\n\t\tfor (String domain : domainGraphs.keySet()) {\r\n\t\t\t// the Graph representing the domain\r\n\t\t\tGraph gDomain = domainGraphs.get(domain);\r\n\t\t\t// for each node inside the domain\r\n\t\t\tfor (String node : gDomain.nodes()) {\r\n\t\t\t\t// creates the routing table of this node\r\n\t\t\t\tExplicitRoutingTable rtable;\r\n\r\n\t\t\t\t// if this table comes from a file, so we need to load it\r\n\t\t\t\tif (rTables != null) {\r\n\t\t\t\t\trtable = rTables.get(node);\r\n\r\n\t\t\t\t} else { // otherwise, we need to create a new one\r\n\t\t\t\t\trtable = new ExplicitRoutingTable(node, alternative);\r\n\r\n\t\t\t\t\t// and the new routing table will be updated from the\r\n\t\t\t\t\t// topology\r\n\t\t\t\t\trtable.updateFromTopology(gDomain,\r\n\t\t\t\t\t\t\tdomainSetPaths.get(domain));\r\n\r\n\t\t\t\t\tRoutingTableEntry[][] teste = rtable.getRoutingTable();\r\n\r\n\t\t\t\t}\r\n\t\t\t\t// the adjacents nodes from this node\r\n\t\t\t\tVector<String> adjacent = gDomain.adjacentNodes(node);\r\n\t\t\t\t// the linkstate hashmap\r\n\t\t\t\tLinkedHashMap<String, LinkState> linkStateSet = new LinkedHashMap<String, LinkState>();\r\n\r\n\t\t\t\tfor (String adjId : adjacent) {\r\n\t\t\t\t\t// get the link between node and adjacent\r\n\t\t\t\t\tLink link = links.get(node + \"-\" + adjId);\r\n\t\t\t\t\t// create a linkState\r\n\t\t\t\t\tLinkState linkState = new LinkState(link);\r\n\t\t\t\t\t// put this on a link state\r\n\t\t\t\t\tlinkStateSet.put(adjId.toString(), linkState);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// if the current node is an ASBR, so, we need to\r\n\t\t\t\t// generate all links to its neighbors\r\n\t\t\t\tif (asbrs.contains(node)) {\r\n\t\t\t\t\tif (verbose)\r\n\t\t\t\t\t\tSystem.out.println(\"OBGP Info: Este no eh um ASBR\");\r\n\r\n\t\t\t\t\tVector<String> adjancent = graph.adjacentNodes(node);\r\n\r\n\t\t\t\t\tfor (int i = 0; i < adjancent.size(); i++) {\r\n\t\t\t\t\t\tif (!getDomain(adjancent.get(i))\r\n\t\t\t\t\t\t\t\t.equals(getDomain(node))) {\r\n\t\t\t\t\t\t\tLink link = links\r\n\t\t\t\t\t\t\t\t\t.get(node + \"-\" + adjancent.get(i));\r\n\t\t\t\t\t\t\tLinkState lstate = new LinkState(link);\r\n\t\t\t\t\t\t\tlinkStateSet.put(adjancent.get(i).toString(),\r\n\t\t\t\t\t\t\t\t\tlstate);\r\n\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// Create the node and put it into the table.\r\n\t\t\t\tOBGPLabelSwitchRouter obgpLSR = new OBGPLabelSwitchRouter(node,\r\n\t\t\t\t\t\trtable, linkStateSet, gDomain, wa, rerouting,\r\n\t\t\t\t\t\tmaxReroutingAttempts, reroutingAttempts,\r\n\t\t\t\t\t\tasbrs.contains(node), getDomain(node),\r\n\t\t\t\t\t\tmaxInterReroutingAttempts);\r\n\r\n\t\t\t\tnodes.put(node, obgpLSR);\r\n\r\n\t\t\t\t// System.out.println(\"=== Routing Table ===\\n\"\r\n\t\t\t\t// + obgpLSR.getRoutingTable().toString());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/*\r\n\t\t * GUSTAVO [old] // Initialize the state of each node for (String id :\r\n\t\t * graph.nodes()) { // System.out.println(\"...: \"+id); // Create the\r\n\t\t * routing table for this node ExplicitRoutingTable ert; if (rTables !=\r\n\t\t * null) { ert = rTables.get(id); } else { ert = new\r\n\t\t * ExplicitRoutingTable(id, alternative); ert.updateFromTopology(graph,\r\n\t\t * setPaths); // System.out.println(ert.toString()); } // Create the\r\n\t\t * links adjacent to this node. Vector<String> adjacent =\r\n\t\t * graph.adjacentNodes(id); // System.out.println(adjacent.toString());\r\n\t\t * LinkedHashMap<String, LinkState> linkStateSet = new\r\n\t\t * LinkedHashMap<String, LinkState>(); // for each adjacent node do for\r\n\t\t * (String adjId : adjacent) { Link link = links.get(id + \"-\" + adjId);\r\n\t\t * LinkState linkState = new LinkState(link);\r\n\t\t * linkStateSet.put(adjId.toString(), linkState); } // Create the node\r\n\t\t * and put it into the table. // AQUI EU CRIO OS NODES\r\n\t\t * OBGPLabelSwitchRouter node = new OBGPLabelSwitchRouter(id, ert,\r\n\t\t * linkStateSet, graph, wa, rerouting, maxReroutingAttempts,\r\n\t\t * reroutingAttempts); nodes.put(id, node); }\r\n\t\t */\r\n\r\n\t\t/** INTER-DOMAIN ROUTING POLICY */\r\n\r\n\t\t// generates the inter-domain routing\r\n\t\t// required by the next steps\r\n\t\t// read policy from XML and generates the policy rules\r\n\t\tsetPolicy(setPolicy);\r\n\t\t// generateASPathv2(setPolicy);\r\n\t\t// simulates Path dissemation from BGP generating AS-PATH\r\n\t\tLinkedHashMap<String, ArrayList<Vector<String>>> ASPath = generateASPath(setPolicy);\r\n\t\tOBGPRoutingTable interdomainRoutes = new OBGPRoutingTable(ASPath);\r\n\t\t// System.out.println(domainGraphs.toString());\r\n\t\t// Fill the Interdomain Routing Table\r\n\t\t// All interdomain routes does not contain :\r\n\t\t// Example: 1:a-1:g is an intra-domain route\r\n\t\t// and 1-2 is an interdomain route\r\n\t\t// for (String key : setPolicy.keySet()) {\r\n\t\t// if (!key.contains(\":\")) {\r\n\t\t// interdomainRoutes.putEntry(key, ASPath.get(key));\r\n\t\t// interdomainRoutes.putEntry(key, setPolicy.get(key));\r\n\t\t// }\r\n\r\n\t\t// }\r\n\r\n\t\tSystem.out.println(\"Tabela de Rotas - Interdominio\");\r\n\t\tSystem.out.println(interdomainRoutes.toString());\r\n\t\t// System.out.println(\"Os links:\");\r\n\t\t// System.out.println(config.getLinks().toString());\r\n\r\n\t\tSystem.out.println(\"JA PASSEI PELO CONSTRUTOR\");\r\n\t}", "@Override\n public void calcRoute(final GeoPoint origin, final GeoPoint destination, double bearing, CallbackOnlineRouteReceiver callback){\n final String origLatLong = origin.getLatitude() + \",\" + origin.getLongitude();\n String destLatLong = destination.getLatitude() + \",\" + destination.getLongitude();\n\n // converting the heading to a string\n String heading = String.valueOf(bearing).split(\"\\\\.\")[0];\n\n // then we make the request to Bing API\n BingRequests mapsService = RoutingAPIs.getInstance().connectToBingMaps();\n Call<BingRespGetRoute> responseGetRoute =\n mapsService.requestDirections(\n origLatLong,\n destLatLong,\n heading,\n NavConfig.getLanguageTag(),\n NavConfig.API_KEY);\n\n // enqueuing the response\n responseGetRoute.enqueue(new Callback<BingRespGetRoute>() {\n @Override\n public void onResponse(@NonNull Call<BingRespGetRoute> call, @NonNull Response<BingRespGetRoute> response) {\n\n if (response.isSuccessful() && response.body() != null) {\n // once we get a successful response...\n List<RoutePoint> routePoints = new ArrayList<>(); // we start a new list of RoutePoints, that will be returned\n\n try {\n // we get a list of all the route points\n List<GeoPoint> routeGeoPoints = response.body()\n .getBingRouteResourceSets()[0]\n .getResources()[0]\n .getRoutePath()\n .getLine()\n .getLinePoints();\n\n // then we get a list of all pertinent data from the Bing API\n BingRouteLeg[] bingRouteLegs = response.body()\n .getBingRouteResourceSets()[0]\n .getResources()[0]\n .getRouteLegs();\n\n List<BingItineraryItem> allItems = new ArrayList<>();\n for (BingRouteLeg currentLeg : bingRouteLegs) {\n // adding all itinerary items on the same list (itinerary items encapsulate traffic info, instructions, ...)\n allItems.addAll(Arrays.asList(currentLeg.getItineraryItems()));\n }\n\n // we create a final version of our items list\n final List<BingItineraryItem> allInstructions = new ArrayList<>(allItems);\n\n // finally, we create a string with all route point coordinates to feed the snap to roads request\n String pointsString = \"\";\n for (GeoPoint point : routeGeoPoints) {\n pointsString = pointsString.concat(String.valueOf(point.getLatitude()))\n .concat(\",\")\n .concat(String.valueOf(point.getLongitude()))\n .concat(\";\");\n }\n // for the last point, we simply remove the final \";\"\n pointsString = pointsString.substring(0, pointsString.length() - 1);\n\n Log.d(TAG, \"Bing request Get Route was successful. Requesting snap to roads.\");\n // once we get a successful response, we make a new snap to roads request\n Call<BingRespSnapToRoad> responseSnapToRoad =\n mapsService.requestSnapToRoad(\n pointsString,\n NavConfig.API_KEY);\n\n // enqueuing the snap to roads response\n responseSnapToRoad.enqueue(new Callback<BingRespSnapToRoad>() {\n\n @Override\n public void onResponse(Call<BingRespSnapToRoad> call, Response<BingRespSnapToRoad> response) {\n\n try {\n\n BingSnappedPoint[] snappedPoints\n = response.body()\n .getBingSnapResourceSets()[0]\n .getResources()[0]\n .getSnappedPoints();\n\n List<RoutePoint> allRoutePoints = new ArrayList<>();\n\n // now we build each RoutePoint\n for (BingSnappedPoint point : snappedPoints) {\n\n double latitude = point.getCoordinates().getLatitude();\n double longitude = point.getCoordinates().getLongitude();\n\n GeoPoint gp = new GeoPoint(latitude, longitude);\n RoutePoint newRP = new RoutePoint(gp);\n\n newRP.setStreetName(point.getStreetName());\n newRP.setRecommendedSpeed(String.valueOf(point.getSpeedLimit()));\n\n allRoutePoints.add(newRP);\n }\n\n /* we end up with two parallel lists. One with all the points (allRoutePoints) and another\n with all the instruction data (allInstructions). We have to join them together. We'll cycle\n through all instructions and, for each one, we'll find the closest RoutePoint. Once we do,\n we simply assign all the instructions to that point */\n\n for (BingItineraryItem currentItem : allInstructions) {\n\n // for each item, we find its closest RoutePoint\n RoutePoint closestPoint = findClosestRoutePoint(currentItem, allRoutePoints);\n\n // and complement it\n if (closestPoint != null)\n complementRoutePointFromItem(closestPoint, currentItem);\n\n }\n callback.returnSuccess(allRoutePoints);\n\n } catch (Exception e) {\n Log.e(TAG, \"Exception while retrieving snap to roads: \" + response.message());\n Log.e(TAG, \"Processing original request\");\n e.printStackTrace();\n\n // On failure, we process our original response, without the snapped points\n List<RoutePoint> originalResponseRPs = processOriginalResponse(routeGeoPoints, allInstructions);\n callback.returnSuccess(originalResponseRPs);\n }\n }\n\n @Override\n public void onFailure(Call<BingRespSnapToRoad> call, Throwable throwable) {\n Log.e(TAG, \"ERROR while retrieving Bing snap to roads request. Processing original request\");\n // On failure, we process our original response, without the snapped points\n List<RoutePoint> originalResponseRPs = processOriginalResponse(routeGeoPoints, allInstructions);\n callback.returnSuccess(originalResponseRPs);\n }\n });\n\n } catch (Exception e) {\n Log.e(TAG, \"Exception while retrieving route: \" + response.message());\n e.printStackTrace();\n callback.returnFailure(origin, destination); // calculate an offline route on failure\n }\n } else {\n Log.e(TAG, \"Route request not accepted: \" + response.message());\n callback.returnFailure(origin, destination); // calculate an offline route on failure\n }\n }\n @Override\n public void onFailure(@NonNull Call<BingRespGetRoute> call, @NonNull Throwable t) {\n Log.w(TAG, \"No connection.\");\n callback.returnFailure(origin, destination); // calculate an offline route on failure\n }\n });\n }", "java.lang.String getArrivalAirport();", "boolean land();", "void scheduleNextDestination(Passenger passenger, Floor currentFloor);", "public void outputToDashboard() {\n\n double theta = Math.toRadians(getAngleToTarget()); // we rename these for sake of sanity with the math\n double phi = Math.toRadians(getHeightAngleToTarget());\n double depthToTarget = getDistanceToTarget() * Math.cos(phi) * Math.cos(theta);\n double lengthToTarget = getDistanceToTarget() * Math.cos(phi) * Math.sin(theta);\n double heightToTarget = getDistanceToTarget() * Math.sin(phi);\n\n //from here we can add value to depth height and length easily because we are relative to the back hole in its basis.\n double depthToThreePointGoal = depthToTarget + Config.fieldVisionDepthOfThreePointHoleFromVisionTarget;\n double lengthToThreePointGoal = lengthToTarget;\n double heightToThreePointGoal = heightToTarget + Config.fieldVisionHeightOfThreePointHoleFromVisionTarget;\n\n double threePointHoleDistance = Math.sqrt(depthToThreePointGoal * depthToThreePointGoal + lengthToThreePointGoal * lengthToThreePointGoal + heightToThreePointGoal * heightToThreePointGoal);\n //WE'LL NEED THESE LATER HOLD ON TO THE FORMULAE FOR NOW\n double threePointHoleTx = Math.toDegrees(Math.asin(heightToThreePointGoal / threePointHoleDistance)); //aka adjusted phi, aka the angle we need to rotate by to be facing the 3 point goal\n double threePointHoleTy = Math.toDegrees(Math.atan2(lengthToThreePointGoal, depthToThreePointGoal)); //this and distance become the arm angle and power.\n\n SmartDashboard.putNumber(\"Three Point Hole Distance\", threePointHoleDistance);\n SmartDashboard.putNumber(\"Tx (Adjusted)\", threePointHoleTx);\n SmartDashboard.putNumber(\"Ty (Adjusted)\", threePointHoleTy);\n SmartDashboard.putNumber(\"Vision Distance\", getDistanceToTarget());\n SmartDashboard.putNumber(\"Distance to Alliance Wall (Depth)\", depthToTarget);\n }", "@Override\n\tpublic void move() {\n\t\tSystem.out.println(\"Driving a airplane!\");\n\t}", "public void startTransit() {\n\t\tthis.currentDriver.setStatus(Status.INTRANSIT);\n\t\tthis.currentDriver.setStatus(Status.FINISHED);\n\t\tthis.passenger.setLocation(currentRide.getDropOff());\n\t\tthis.currentDriver.setLocation(currentRide.getDropOff());\n\t\tthis.finishRide();\n\t}", "private void getRoute(Point origin, Point destination){\n NavigationRoute.builder(this)\n .profile(DirectionsCriteria.PROFILE_WALKING) //Change Here for car navigation\n .accessToken(Mapbox.getAccessToken())\n .origin(origin)\n .destination(destination)\n .build()\n .getRoute(new Callback<DirectionsResponse>() {\n @Override\n public void onResponse(Call<DirectionsResponse> call, Response<DirectionsResponse> response) {\n if(response.body() == null)\n {\n Log.e(TAG, \"No routes found, check right user and access token\");\n return;\n }else if (response.body().routes().size() == 0){\n Log.e(TAG,\"No routes found\");\n return;\n }\n\n currentRoute = response.body().routes().get(0);\n\n if(navigationMapRoute != null){\n navigationMapRoute.removeRoute();\n }\n else{\n navigationMapRoute = new NavigationMapRoute(null,mapView,map);\n }\n navigationMapRoute.addRoute(currentRoute);\n }\n\n @Override\n public void onFailure(Call<DirectionsResponse> call, Throwable t) {\n Log.e(TAG, \"Error:\" + t.getMessage());\n }\n });\n }", "@Override\n public void planTrip(String departingAddress, String departingZipCode,\n String arrivalZipCode, Date preferredArrivalTime) {\n FlightSchedule schedule = airlineAgency.bookTicket(departingZipCode, arrivalZipCode, preferredArrivalTime);\n //cab pickup scheduling activity\n cabAgency.requestCab(departingAddress, schedule.getFlightNumber());\n \n //Test output\n System.out.println(\"Test output: trip planned\");\n }", "public void land() {\n Game currentGame = this.getGame();\n this.setHasBeenVisited(true);\n currentGame.setMode( Game.Mode.GAME_WON);\n\n }", "Flight() {}", "public static void main(String[] args) throws InterruptedException {\n\t\tPlane plane = new Plane(10);\r\n\t\t//Adding names to the passengers list\r\n\t\tplane.onboard(\"Ali\");\r\n\t\tplane.onboard(\"Nitin\");\r\n\t\tplane.onboard(\"Neeraj\");\r\n\t\tplane.onboard(\"Kaushik\");\r\n\t\t//Print Take-off Time\r\n\t\tSystem.out.println(\"Plane take-off time: \"+plane.takeOff());\r\n\t\t\r\n\t\t//Print Passengers list\r\n\t\tSystem.out.println(\"People on the plane: \"+plane.getPassesngers());\r\n\t\t\r\n\t\t//Plane in flight..\r\n\t\tThread.sleep(5000);\r\n\t\t\r\n\t\t//Land the plane\r\n\t\tplane.land(new Date());\r\n\t\t\r\n\t\t//Print time of landing \r\n\t\tSystem.out.println(\"Plane landing time: \"+plane.getLastTimeLanded());\r\n\t\tSystem.out.println(\"People on the plane after landing: \"+plane.getPassesngers());\r\n\t}", "public Flight(String name, int number, String home, String away) \n {\n airlineName = name;\n flightNumber = number;\n origin = home;\n destination = away;\n \n }", "public void displaymap(AircraftData data);", "public void updateDestination(){\r\n\t\tdestination.update_pc_arrivalFlows(flows);\r\n\t}", "public static AirPlane askForAirPlane() {\n boolean exist = false;\n AirPlane airPlane = null;\n\n System.out.print(\"Enter the license plate of the airplane that you wish to manipulate:\");\n String airPlaneToManipulate = keyboard.next();\n while(exist == false) {\n\n exist = searchIfAirPlaneExsist(airPlaneToManipulate);// check if the user entrie is correct or if the airplane exsist\n if(exist) {\n airPlane = catchObjectAirPlane(airPlaneToManipulate);// search the airplane to controll\n }\n\n if(exist == false) {\n System.out.println(\"This Air Plane doesn't exsist, try it again:\");\n airPlaneToManipulate = keyboard.next();\n }\n }\n\n return airPlane; //return object/airplane that user wanna controll\n }", "public interface ElevatorControl {\n /**\n *Задать место назначения\n * @param destination этаж\n */\n void addNewDestination(Integer destination);\n}", "@Override\n\tpublic void seeRoute() {\n\t\tRoute route = game.getIncidentRoutes();\n\t\tSystem.out.println(route);\n\t\tSystem.out.println(\"Total sailing days required is \"+ game.calculateSailingDays(route)+\" days\");\n\t\tboolean state = false;\n\t\twhile (state == false) {\n\t\t\tSystem.out.println(\"Choose your actions: \");\n\t\t\tSystem.out.println(\"(1) Go back!\");\n\t\t\tSystem.out.println(\"(2) Set Sail\");\n\t\t\ttry { \n\t\t\t\tint selectedAction = scanner.nextInt();\n\t\t\t\tif (selectedAction <= 2 && selectedAction > 0) {\n\t\t\t\tstate = true;\n\t\t\t\tif (selectedAction == 1) {\n\t\t\t\t\tgame.backToMain();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (game.isIslandReachable(route)) {\n\t\t\t\t\t\tif (game.checkMyShipHealth()) {\n\t\t\t\t\t\t\tgame.payCrew(route);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tSystem.out.println(\"You should repair your ship first!\" + \"\\n\" + \"you will be redirected to store at your current Island\" + \"\\n\");\n\t\t\t\t\t\t\tgame.repairMyShip();\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\tSystem.out.println(\"This Island is not accessible because you don't have enough days left, you can choose other Island\");\n\t\t\t\t\t\tgame.backToMain();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"Please choose from actions above\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(INPUT_REQUIREMENTS);\n\t\t\t\tscanner.nextLine();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public void createEnterZoneRule(){\n// ECAAgent.getDefaultECAAgent().createRule(\"enterZoneRule_\"+name,enterZone,\"MAKEFITS.Track.C_enterTheZone\",\"MAKEFITS.Track.A_enterTheZone\",1,CouplingMode.IMMEDIATE ,Context.RECENT);\n ECAAgent.getDefaultECAAgent().createRule(\"enterZoneRule_\"+name,enterZone,\"MAKEFITS.Track.C_enterTheZone\",\"MAKEFITS.Track.A_enterTheZone\",1,CouplingMode.IMMEDIATE ,ParamContext.RECENT);\n // ECAAgent.getDefaultECAAgent().createRule(\"enterZoneRule_\"+name,enterZone,\"MAKEFITS.Track.C_enterTheZone\",\"MAKEFITS.Track.A_enterTheZone\",1,CouplingMode.IMMEDIATE ,ParamContext.CHRONICLE);\n }", "public CargoAirplane createRandomCargoAirplane() {\n\tthrow new RuntimeException(\"Cargo airplanes is not supported\");\n }", "public void performAirplaneModeChange(boolean z) {\n this.airplaneMode = z;\n }", "private void prepareInfo() {\n if (plane != null) {\n String planeType = plane.getType();\n ArrayList<String> airports = new ArrayList<>();\n\n if (planeType.equalsIgnoreCase(\"Passenger Plane\")) {\n World.getPublicAirports().forEach(publicAirport ->\n airports.add(publicAirport.getName())\n );\n } else if (planeType.equalsIgnoreCase(\"Military Plane\")) {\n World.getMilitaryAirports().forEach(militaryAirport ->\n airports.add(militaryAirport.getName())\n );\n }\n\n startAirport.setItems(FXCollections.observableArrayList(airports));\n endAirport.setItems(FXCollections.observableArrayList(airports));\n startAirport.getSelectionModel().select(plane.getStartBuilding().getName());\n endAirport.getSelectionModel().select(plane.getEndBuilding().getName());\n\n title.setText(\"PLANE INFO\");\n name.setText(plane.getName());\n speed.setText(String.valueOf(plane.getSpeed()));\n fuelLevel.setText(String.valueOf(plane.getFuelLevel()));\n type.setText(plane.getType());\n\n if (plane.isEmergencyLanding()) {\n landButton.setText(\"Take off\");\n } else {\n landButton.setText(\"Emergency land\");\n }\n\n if (plane.getType().equalsIgnoreCase(\"Military Plane\")) {\n MilitaryPlane plane = (MilitaryPlane) this.plane;\n weapon.setText(plane.getWeaponType().weaponType());\n passengers.setVisible(false);\n passengers.setMaxHeight(0);\n } else {\n PassengerPlane plane = (PassengerPlane) this.plane;\n passengers.setItems(FXCollections.observableArrayList(plane.getPassengerContainer().getPassengers()));\n }\n }\n }", "public interface PublicTransport {\n /**\n * Returns the target end station of the public transport vehicle.\n *\n * @return target station\n */\n String directsTo();\n\n /**\n * Inverts the direction of transport line (e.g.when the vehicle arrives\n * the end station).\n */\n void changeDirection();\n}", "godot.wire.Wire.Plane getPlaneValue();", "public void onFlight() {\r\n }", "@Override\n public void announceArrival() {\n this.lock.lock();\n try {\n // update pilot state\n this.repository.updatePilotState(PilotState.DEBOARDING);\n\n // call passengers\n this.endOfFlight = true;\n while (!this.passengers.isEmpty()) {\n // wake up passengers\n this.passengerLeavePlane = this.passengers.poll();\n this.passengersWaitForEndOfFlight.signal();\n this.passengersWaitForEndOfFlight.signalAll();\n\n // wait for all passengers\n this.pilotWaitForDeboarding.await();\n }\n this.endOfFlight = false;\n\n // update pilot state\n this.repository.updatePilotState(PilotState.FLYING_BACK);\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n this.lock.unlock();\n }\n }", "@Override\n public void run ()\n {\n travelToAirport();\t\t\t\t//Passenger takes some time to arrive to the departure airport\n da.waitInQueue();\t\t\t\t//Passenger enters the queue and then waits for is turn to be checked\n da.showDocuments();\t\t\t\t//Passenger starts preparing to show his documents to the hostess, waking her when this thread is ready\n da.boardThePlane();\t\t\t //Passenger goes to the plane after the end of the check stage\n pl.waitForEndOfFlight();\t\t//Passenger sleeps while the plane has not arrived the destination airport\n pl.leaveThePlane();\t\t\t\t//Passenger wakes up, and leaves the plane, arriving also to the destination airport\n }", "public void leerPlanesDietas();", "public static void main(String[] args) {\n\t\tAirplane a = new Airplane(\"\",1.12f,\"\",1,1,\"\",\"\");\r\n\t\t\r\n\t\t//no flexibility with our current design\r\n\t}", "public void doMission(Connection connection) {\n final Unit unit = getUnit();\n if (unit.getTile() == null) {\n logger.finest(\"AI pioneer waiting to go to\"\n + getTransportDestination() + \": \" + unit);\n return;\n }\n\n if (!hasTools()) { // Try to equip.\n if (colonyWithTools != null\n && !checkColonyForTools(getAIUnit(), colonyWithTools)) {\n colonyWithTools = null;\n }\n if (colonyWithTools == null) { // Find a new colony.\n colonyWithTools = findColonyWithTools(getAIUnit());\n }\n if (colonyWithTools == null) {\n abandonTileImprovementPlan();\n logger.finest(\"AI pioneer can not find equipment: \" + unit);\n return;\n }\n\n // Go there, equip unit.\n if (travelToTarget(\"AI pioneer\", colonyWithTools.getTile())\n != Unit.MoveType.MOVE) return;\n getAIUnit().equipForRole(Unit.Role.PIONEER, false);\n if (!hasTools()) {\n abandonTileImprovementPlan();\n logger.finest(\"AI pioneer reached \" + colonyWithTools.getName()\n + \" but could not equip: \" + unit);\n return;\n }\n logger.finest(\"AI pioneer reached \" + colonyWithTools.getName()\n + \" and equips: \" + unit);\n colonyWithTools = null;\n }\n\n // Check the plan still makes sense.\n final Player player = unit.getOwner();\n final EuropeanAIPlayer aiPlayer = getEuropeanAIPlayer();\n if (tileImprovementPlan != null\n && !validateTileImprovementPlan(tileImprovementPlan, aiPlayer)) {\n tileImprovementPlan = null;\n }\n if (tileImprovementPlan == null) { // Find a new plan.\n AIUnit aiu = getAIUnit();\n tileImprovementPlan = findTileImprovementPlan(aiu);\n if (tileImprovementPlan == null) {\n logger.finest(\"AI pioneer could not find an improvement: \"\n + unit);\n return;\n }\n tileImprovementPlan.setPioneer(aiu);\n }\n \n // Go to target and take control of the land before proceeding\n // to build.\n Tile target = tileImprovementPlan.getTarget();\n if (travelToTarget(\"AI pioneer\", target) != Unit.MoveType.MOVE) return;\n if (!player.owns(target)) {\n // TODO: Better choice whether to pay or steal.\n // Currently always pay if we can, steal if we can not.\n boolean fail = false;\n int price = player.getLandPrice(target);\n if (price < 0) {\n fail = true;\n } else {\n if (price > 0 && !player.checkGold(price)) {\n price = NetworkConstants.STEAL_LAND;\n }\n if (!AIMessage.askClaimLand(aiPlayer.getConnection(), target,\n null, price)\n || !player.owns(target)) { // Failed to take ownership\n fail = true;\n }\n }\n if (fail) {\n aiPlayer.removeTileImprovementPlan(tileImprovementPlan);\n tileImprovementPlan.dispose();\n tileImprovementPlan = null;\n logger.finest(\"AI pioneer can not claim land at \" + target\n + \": \" + unit);\n return;\n }\n }\n\n if (unit.getState() == UnitState.IMPROVING) {\n unit.setMovesLeft(0);\n logger.finest(\"AI pioneer improving \"\n + tileImprovementPlan.getType() + \": \" + unit);\n } else if (unit.checkSetState(UnitState.IMPROVING)) {\n // Ask to create the TileImprovement\n if (AIMessage.askChangeWorkImprovementType(getAIUnit(),\n tileImprovementPlan.getType())) {\n logger.finest(\"AI pioneer began improvement \"\n + tileImprovementPlan.getType()\n + \" at target \" + target\n + \": \" + unit);\n } else {\n aiPlayer.removeTileImprovementPlan(tileImprovementPlan);\n tileImprovementPlan.dispose();\n tileImprovementPlan = null;\n logger.finest(\"AI pioneer failed to improve \" + target\n + \": \" + unit);\n }\n } else { // Probably just out of moves.\n logger.finest(\"AI pioneer waiting to improve at \" + target.getId()\n + \": \" + unit);\n }\n }", "int getDestination();", "public String getDestinationAirportName() {\n return destination.getName();\n }", "public void addNewAirplane(){\r\n\t\tuiAirplaneModel.setNewAirplane(new ArrayList<UiAirplaneModel>());\r\n\t\tUiAirplaneModel plane=new UiAirplaneModel();\r\n\t\tplane.setAirplaneModel(\"\");\r\n\t\tplane.setGroupIDs(new ArrayList<String>());\r\n\t\tplane.setStatusCheck(false);\r\n\t\tplane.setApNamesList(new ArrayList<UiAirplaneModel>());\r\n\t\tplane.setAirplaneNames(\"\");\r\n\t\tplane.setStage(\"\");\r\n\t\tuiAirplaneModel.setSelectedGrp(\"\");\r\n\t\tuiAirplaneModel.getNewAirplane().add(plane);\r\n\t}", "public void setDestinationFloor(int destinationFloor){\n this.destinationFloor=destinationFloor;\n }", "public void findNewAStarPath(PedSimCity state) {\n\n\t\tRouteData route = new RouteData();\n\t\troute.origin = originNode.getID();\n\t\troute.destination = destinationNode.getID();\n\t\t//\t\toriginNode = PedSimCity.nodesMap.get(9406);\n\t\t//\t\tdestinationNode = PedSimCity.nodesMap.get(4456);\n\n\t\tif (UserParameters.empiricalABM) {\n\t\t\tSystem.out.println(\" Agent nr. \"+this.agentID + \" group \" + this.agp.groupName + \" OD \" + originNode.getID()+\" \" +destinationNode.getID());\n\t\t\tagp.defineRouteChoiceParameters();\n\t\t\tCombinedNavigation combinedNavigation = new CombinedNavigation();\n\t\t\tnewPath = combinedNavigation.path(originNode, destinationNode, agp);\n\t\t\troute.group = this.agp.groupID;\n\t\t\troute.localH = this.agp.localHeuristic;\n\t\t\troute.routeID = this.agentID.toString()+\"-\"+originNode.getID().toString()+\"-\"+destinationNode.getID().toString();\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(originNode.getID() + \" \"+ destinationNode.getID()+ \" \"+ap.routeChoice);\n\t\t\tselectRouteChoice();\n\t\t\troute.routeChoice = ap.routeChoice;\n\t\t\t//\t\t\troute.routeID = numTrips;\n\t\t}\n\n\t\tList<Integer> sequenceEdges = new ArrayList<Integer>();\n\n\t\tfor (GeomPlanarGraphDirectedEdge o : newPath) {\n\t\t\t// update edge data\n\t\t\tupdateEdgeData((EdgeGraph) o.getEdge());\n\t\t\tint edgeID = ((EdgeGraph) o.getEdge()).getID();\n\t\t\tsequenceEdges.add(edgeID);\n\t\t}\n\t\troute.sequenceEdges = sequenceEdges;\n\t\tPedSimCity.routesData.add(route);\n\t\tindexOnPath = 0;\n\t\tpath = newPath;\n\n\t\t// set up how to traverse this first link\n\t\tEdgeGraph firstEdge = (EdgeGraph) newPath.get(0).getEdge();\n\t\tsetupEdge(firstEdge); //Sets the Agent up to proceed along an Edge\n\n\t\t// update the current position for this link\n\t\tupdatePosition(segment.extractPoint(currentIndex));\n\t\tnumTrips += 1;\n\t}", "private void btnSelectPlaneActionPerformed(java.awt.event.ActionEvent evt) {\n this.airplaneSelected = true;\n SelectAirplaneScreen select = new SelectAirplaneScreen(this.rightPanel, this.agency, this.index, this.f);\n \n this.rightPanel.add(\"SelectAirplaneScreen\", select);\n CardLayout layout = (CardLayout) this.rightPanel.getLayout();\n layout.next(this.rightPanel);\n\n }", "FlowPanel(Terrain terrain,Water2 water) {\n\t\tflood = water;\n\t\tland=terrain;\n\t}", "public void chechPortaitAndLandSacpe() {\n if (CompatibilityUtility.isTablet(BecomeHostActivity.this)) {\n setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);\n } else {\n setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);\n }\n }", "void playRoadCard(EdgeLocation spot1, EdgeLocation spot2);", "TradeRoute(String aStartPoint, String anEndPoint, int anId){\n startPoint = aStartPoint;\n endPoint = anEndPoint;\n id = anId;\n }", "@Override\n\t\tpublic void onGetDrivingRouteResult(DrivingRouteResult drivingrouteresult) {\n\t\t\tnearby_baidumap.clear();// 清除图层覆盖物\n\t\t\tN_showdatainfotv.setText(\"\");\n\t\t\tSB.delete(0, SB.length());\n\t\t\tif (drivingrouteresult == null || drivingrouteresult.error != SearchResult.ERRORNO.NO_ERROR) {\n\t\t\t\tToastUtil.CreateToastShow(navigation, null, \"温馨提示\", \"没有找到合适的路线\");\n\t\t\t}\n\t\t\tif (drivingrouteresult.error == SearchResult.ERRORNO.AMBIGUOUS_ROURE_ADDR) {\n\t\t\t\t// 起终点或途经点地址有岐义,通过以下接口获取建议查询信息\n\t\t\t\t// result.getSuggestAddrInfo()\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (drivingrouteresult.error == SearchResult.ERRORNO.NO_ERROR) {\n\t\t\t\tN_routeline = drivingrouteresult.getRouteLines().get(0);// 第一方案\n\t\t\t\tSB.append(\"起点\\t\\t\" + N_currentaddress).append(\"\\t\\t\\t----\\t\\t\\t\").append(\"终点\\t\\t\" + N_targetaddress)\n\t\t\t\t\t\t.append(\"\\n\\n\");\n\t\t\t\tfor (int i = 0; i < N_routeline.getAllStep().size(); i++) {\n\n\t\t\t\t\tDrivingRouteLine.DrivingStep step = (DrivingStep) N_routeline.getAllStep().get(i);\n\n\t\t\t\t\tSB.append(i + \"\\t在\\t:\" + step.getEntranceInstructions() + \"\\t\\t\\t\")\n\t\t\t\t\t\t\t.append(i + \"\\t在\\t:\" + step.getExitInstructions() + \"\\t\\t\\t\");\n\t\t\t\t}\n\t\t\t\tN_showdatainfotv.setText(SB);\n\t\t\t\tDrivingOverlayUtil drivingoverlayutil = new DrivingOverlayUtil(nearby_baidumap, navigation);\n\t\t\t\tdrivingoverlayutil.setData(drivingrouteresult.getRouteLines().get(0));\n\t\t\t\tdrivingoverlayutil.addToMap();\n\t\t\t\tdrivingoverlayutil.zoomToSpan();\n\n\t\t\t}\n\n\t\t}", "public void setOriginAirport(java.lang.String originAirport) {\r\n this.originAirport = originAirport;\r\n }", "void onRunwayAssignment(final String flightId, final String destination, final String runway, final long flightsAhead)\n throws RemoteException;", "public Airport(String name, int x, int y)\n\t{\n\t\tthis.name = name;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tconnections = new TreeSet<>();\n\t}", "public void teleportToAstronaut() {\n\t\tAstronaut a;\n\t\tSpaceship sp;\n\t\tif(roamingAstronauts > 0) {\n\t\t\tsp = getTheSpaceship();\n\t\t\ta = getRandomAstronaut();\n\t\t\tsp.setLocation(a.getLocation());\n\t\t\tSystem.out.println(\"You've teleported to an astronaut. \\n Hope you didn't hit them.\");\n\t\t}\n\t\telse \n\t\t\tSystem.out.println(\"Error: Ther were no astronauts to jump to.\");\n\t}", "public void setup() {\n land = new Landscape(20,800,400);\n}", "public int getLane();", "private void travelToAirport()\n {\n try\n { sleep ((long) (1 + 30000 * Math.random ()));\n }\n catch (InterruptedException e) {}\n }", "public interface Aircraft {\n public String flyForwards();\n}", "public Airplane find(int id);", "public void teleport(boolean penalty) { \n\t\tPublisher teleport_h = new Publisher(\"/ariac_human/go_home\", \"std_msgs/Bool\", bridge);\n\t\tif(penalty)\t\n\t\t\tteleport_h.publish(new Bool(true));\t\n\t\telse\n\t\t\tteleport_h.publish(new Bool(false));\t\n\n\t\t// Reset \"smart\" orientation variables\n\t\tlastHumanState_MsgT = System.currentTimeMillis();\n\t\tlastUnsafeD_MsgT = System.currentTimeMillis();\n\t\tpreviousDistance = 50.0;\n\t\tisAproximating = false;\n\t}", "public Long getDestinationAirportId() {\n return destination.getId();\n }", "public static void launchPlane(ListArrayBasedGeneric<Runway> runwayList, AOSLArrayBased listOfPlanes) throws IOException // Option # 2\r\n\t{\r\n\t\tint sizeOfAirport = runwayList.size();\r\n\t\tint sizeOfRunway = 0;\r\n\t\tString flightNumber = \"\";\r\n\t\tString runwayName = \"\";\r\n\t\tchar userInput = '!';\r\n\t\tboolean readyToLaunch = false;\r\n\t\tint orderOfLaunch;\r\n\t\tint numberOfPlanes = 0;\r\n\t\t\r\n\t\t// Can't rely on the listOfPlanes' size because if planes are in purgatory, then they\r\n\t\t// are not taken out of the listOfPlanes' list and still CONTRIBUTE to the size even\r\n\t\t// though they are not on the runways to take off, so have to go through each runway \r\n\t\t// and count the size and total them up to get a accurate, updated count for the\r\n\t\t// number of planes\r\n\t\tfor(int i = 1; i < sizeOfAirport; i++)\r\n\t\t{\r\n\t\t\tnumberOfPlanes += runwayList.get(i).getListOfPlanes().size();\r\n\t\t}\r\n\t\t\r\n\t\tif(numberOfPlanes > 0) // Only launch, if there is a runway\r\n\t\t{\r\n\t\t\twhile(readyToLaunch == false)\r\n\t\t\t{\r\n\t\t\t\t// Get the launch order and size of the runway\r\n\t\t\t\torderOfLaunch = getLaunchOrder();\r\n\t\t\t\t\r\n\t\t\t\t// Get the size of the runway that is set to launch\r\n\t\t\t\tsizeOfRunway = runwayList.get(orderOfLaunch).getListOfPlanes().size();\r\n\t\t\t\t\r\n\t\t\t\tif(sizeOfRunway > 0) // Has atleast 1 plane in it\r\n\t\t\t\t{\r\n\t\t\t\t\t// Get the flight number from the runway\r\n\t\t\t\t\tflightNumber = runwayList.get(orderOfLaunch).getListOfPlanes().get(0).getFlightNumber();\r\n\t\t\t\t\t\r\n\t\t\t\t\tSystem.out.print(\"\\tFlight \" + flightNumber + \" cleared for takeoff(Y/N): \");\r\n\t\t\t\t\tuserInput = stdin.readLine().trim().charAt(0);\r\n\t\t\t\t\tSystem.out.println(userInput);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(userInput == 'Y' || userInput == 'y') // Yes --> Take off\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Get the runway name to display it\r\n\t\t\t\t\t\trunwayName = runwayList.get(orderOfLaunch).getListOfPlanes().get(0).getRunway();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Launch the plane\r\n\t\t\t\t\t\trunwayList.get(orderOfLaunch).takeOff();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tSystem.out.println(\"\\tFlight \" + flightNumber + \" has now taken off from runway \" + runwayName);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Remove it from the list of planes, so it can be added back in the future\r\n\t\t\t\t\t\tlistOfPlanes.remove(listOfPlanes.search(flightNumber));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Increment flight counter and launch order\r\n\t\t\t\t\t\t/**\r\n\t\t\t\t\t\t * sizeOfAirport - 1 because:\r\n\t\t\t\t\t\t * P A B C\r\n\t\t\t\t\t\t * 1 2 3\r\n\t\t\t\t\t\t * reset to 1 when launchOrder reaches 3 which is\r\n\t\t\t\t\t\t * size of the runway (4) - 1\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tif(launchOrder == sizeOfAirport - 1)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tsetLaunchOrder(1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tincrementLaunchOrder();\r\n\t\t\t\t\t\t} // END IF/ELSE\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Increment flight counter\r\n\t\t\t\t\t\tincrementFlightTakeOffCounter();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse // User didn't give clearance --> Add it to purgatory and increment launch order but not the flight counter\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"\\tFlight \" + flightNumber + \" is now waiting to be allowed to re-enter a runway\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trunwayList.get(0).addPlane(runwayList.get(orderOfLaunch).removeFromRunway(0));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Increment launch order\r\n\t\t\t\t\t\tif(launchOrder == sizeOfAirport - 1)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tsetLaunchOrder(1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tincrementLaunchOrder();\r\n\t\t\t\t\t\t} // END IF/ELSE\r\n\t\t\t\t\t} // END IF/ELSE\r\n\t\t\t\t\t\r\n\t\t\t\t\treadyToLaunch = true; // Quit after 1 iteration, whether the plane is launched or not\r\n\t\t\t\t}\r\n\t\t\t\telse // Get it to a launch order where it will have a plane\r\n\t\t\t\t{\r\n\t\t\t\t\tif(launchOrder == sizeOfAirport - 1) // It has reached the end of the runway count, so reset it to start at 1 (AFTER purgatory)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tsetLaunchOrder(1); // Set it back to 1 so it can start again\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse // Launch order hasn't reached the end, increment it by 1\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tincrementLaunchOrder();\r\n\t\t\t\t\t} // END IF/ELSE\r\n\t\t\t\t} // END IF/ELSE\r\n\t\t\t} // END WHILE\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"\\tNo planes on any runway!\");\r\n\t\t} // END IF/ELSE\r\n\t\t\r\n\t\tSystem.out.println();\r\n\t}", "public Polyline createHelicopterRoute(Double originLat, Double originLong,\n Double destinationLat, Double destinationLong) {\n\n LatLong originLatLong = new LatLong(originLat, originLong);\n LatLong destinationLatLong = new LatLong(destinationLat, destinationLong);\n LatLong[] coordinatesList = new LatLong[]{originLatLong, destinationLatLong};\n\n MVCArray pointsOnMap = new MVCArray(coordinatesList);\n PolylineOptions polyOpts = new PolylineOptions().path(pointsOnMap)\n .strokeColor(\"blue\").strokeWeight(2);\n\n return new Polyline(polyOpts);\n }", "public interface IFlightEndPoints {\n \n Integer getFlightEndPointId();\n void setFlightEndPointId(Integer flightEndPointId);\n \n String getOriginAirportShortName();\n void setOriginAirportShortName(String shortName);\n \n double getDepartureDelay();\n void setDepartureDelay(double departureDelay);\n Date getDepartureTime();\n void setDepartureTime(Date date);\n \n String getDestAirportShortName();\n void setDestAirportShortName(String shortName);\n \n double getArrivalDelay();\n void setArrivalDelay(double arrivalDelay);\n Date getArrivalTime();\n void setArrivalTime(Date date); \n}", "public Builder setTransitAirport(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n transitAirport_ = value;\n onChanged();\n return this;\n }", "public void dispatchAirplaneModeChange(boolean z) {\n this.handler.sendMessage(this.handler.obtainMessage(10, z ? 1 : 0, 0));\n }", "private Destination createDestination(String originCode, TopRoute route) {\n\t\tString countryCode = cityService.getCountry(originCode);\n\t\tFlight flight = flightService.cheapestFlightReader(countryCode, route.getFrom(), route.getTo());\n\t\tDestination destination = new Destination(route.getTo(), flight);\n\t\treturn destination;\n\t}", "Flight updateFlight(Flight flight);", "@Override\n void setJourney(String line, TransitCard transitCard) {\n SubwayLine subwayLine = SubwaySystem.getSubwayLineByName(line);\n int startIndex = subwayLine.getStationList().indexOf(this.startLocation);\n int endIndex = subwayLine.getStationList().indexOf(this.endLocation);\n if (startIndex < endIndex) {\n while (!subwayLine\n .getStationList()\n .get(startIndex)\n .getNodeName()\n .equals(this.endLocation.getNodeName())) {\n this.addTransitNode(subwayLine.getStationList().get(startIndex));\n transitCard.increaseStationReached();\n startIndex++;\n }\n this.addTransitNode(subwayLine.getStationList().get(startIndex));\n } else {\n while (!subwayLine\n .getStationList()\n .get(startIndex)\n .getNodeName()\n .equals(this.endLocation.getNodeName())) {\n this.addTransitNode(subwayLine.getStationList().get(startIndex));\n transitCard.increaseStationReached();\n startIndex--;\n }\n this.addTransitNode(subwayLine.getStationList().get(startIndex));\n }\n double d =\n Distance.getDistance(\n startLocation.getNodeLocation().get(0),\n startLocation.getNodeLocation().get(1),\n endLocation.getNodeLocation().get(0),\n endLocation.getNodeLocation().get(1));\n Administrator.getListOfDays()\n .get(Administrator.getListOfDays().size() - 1)\n .incrementDistance(d);\n Administrator.getListOfDays()\n .get(Administrator.getListOfDays().size() - 1)\n .incrementPassengers();\n }", "public Passenger(String name, int passengerId, DepartureAirportStub da, PlaneStub pl)\n {\n super (name);\n this.passengerId = passengerId;\n passengerState = PassengerStates.GOING_TO_AIRPORT;\n this.da = da;\n this.pl = pl;\n }", "@Override\n\tpublic void canLand() {\n\t\tSystem.out.println(\"IF IM IN THE SKY, I CANT LAND. BY THE OMNISSIAH\");\n\t}", "@Test(groups = {\"SMOKE\"})\r\n public void airlinesTest() {\r\n new ChooseFlightPage(driver, url)\r\n .run(new PickFlightScenario(\"Paris\", \"Bunos Aires\"))\r\n .check(new FlightOptionsAssertion())\r\n .verifyFlightNumberOrder(flightNumbersOrderVA)\r\n .verifyFlightNumbersUnordered(flightNumbersUnordered);\r\n }", "void transit();", "public String getDepartureAirport();", "public Airport(int X, int Y, int Fees) {\r\n\t\tthis.X=X;\r\n\t\tthis.Y=Y;\r\n\t\tthis.AirportFees=Fees;\r\n\t}", "@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 }", "void placeTower();", "public interface Traveller {\n\n /**\n * Adds the given town to the town network map, connected to the given towns\n * @param town the town to add to the network\n * @param connectedTowns the towns that the new town is connected to\n */\n void add_to_network(Town town, List<Town> connectedTowns);\n\n /**\n * Places the given Character in a Town by changing a Town's occupancy state\n * @param character\n * @param town\n * @throws IllegalStateException\n */\n void place_character(Character character, Town town) throws IllegalStateException;\n\n /**\n * Determines whether a Character can travel to the given town without passing through\n * any other towns with Characters in them\n * @param character the Character attempting to travel\n * @param town the town that the Character is going to attempt to travel to\n * @return true if the character can travel to the town, false otherwise\n */\n Boolean can_travel_to(Character character, Town town);\n}", "List<Route> getDirectRoutes(String departure, String arrival);", "public java.lang.String getDestinationAirport() {\r\n return destinationAirport;\r\n }" ]
[ "0.65607595", "0.6371535", "0.62493384", "0.6186578", "0.59600914", "0.59287894", "0.58959", "0.5894845", "0.57951534", "0.5772711", "0.5755709", "0.5753759", "0.56876713", "0.56792957", "0.56674147", "0.5652183", "0.5651145", "0.5631379", "0.56253046", "0.5620392", "0.56094795", "0.5582917", "0.5582672", "0.5560022", "0.55550694", "0.554956", "0.55305094", "0.5527171", "0.5520216", "0.5505358", "0.55019903", "0.5499692", "0.5496532", "0.5436753", "0.5425554", "0.54233336", "0.5398232", "0.53914475", "0.53828126", "0.5366297", "0.5366132", "0.5366038", "0.5355021", "0.53545964", "0.53519577", "0.53459954", "0.5345464", "0.5338892", "0.53324836", "0.53292197", "0.5323285", "0.531836", "0.53110176", "0.5310507", "0.5290382", "0.5279113", "0.5276505", "0.5274772", "0.52665174", "0.52482796", "0.5236026", "0.5231155", "0.522661", "0.52212924", "0.5218454", "0.52177286", "0.5214476", "0.52143496", "0.5208821", "0.52076834", "0.52065784", "0.51869404", "0.51802075", "0.51764053", "0.5166416", "0.5160989", "0.5159022", "0.5150139", "0.5147753", "0.5146524", "0.51381904", "0.5136304", "0.51351905", "0.5131664", "0.51238793", "0.5123346", "0.5119943", "0.51165485", "0.51054317", "0.5102835", "0.5102605", "0.50921345", "0.5092114", "0.5084944", "0.5084708", "0.5077638", "0.50767106", "0.5075647", "0.5075429", "0.5065705" ]
0.6150996
4
As an air traffic controller So I can get passengers on the way to their destination I want to instruct a plane to take off from an airport and confirm that it is no longer in the airport
@Test public void planeCanTakeOff() { try { heathrow.landing(tap); } catch (Exception exception) { } try { heathrow.takeoff(tap); } catch (Exception exception) { } assertEquals(expectedPlanes, heathrow.hangar); assertTrue(heathrow.hangar.isEmpty()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void confirmFlight();", "public void flightDisappear();", "public void noFlights();", "@Override\n public void informPlaneReadyToTakeOff(int passengerId) {\n this.lock.lock();\n try {\n // wait for last passenger\n while (this.lastPassengerToBoard != passengerId) {\n this.hostessWaitForLastPassengerBoard.await();\n }\n\n // update hostess state\n this.repository.updateHostessState(HostessState.READY_TO_FLY);\n\n // wake up pilot\n this.planeReadyToTakeOff = true;\n this.pilotWaitForAllInBoard.signal();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n this.lock.unlock();\n }\n }", "void toggleInAir() {\n inAir = !inAir;\n }", "void advanceInCampaign(CampaignFleetAPI fleet);", "public void changeOutofService(Room room);", "private void releaseAirfield() {\n\t\tlandedAirfield.setOccupied(false);\n\t}", "private void turnOffAirCond(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_turnOffAirCond\n\n this.selectedTrain.setAC(0);\n this.operatingLogbook.add(\"Turned off AC.\");\n this.printOperatingLogs();\n }", "public boolean enterAirPlane(Plane<?> newPlane) {\r\n\r\n //it's boolean because im to lazy to add trycatch blocks\r\n //create a new excpetion; plus this provideds a easy way to exit the method;\r\n\r\n Runway temp = findRunway(newPlane.getRunway());\r\n\r\n if(temp != null) {\r\n temp.enqueueToRunway(newPlane);\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }", "public void sendToOutpatients(){\r\n\t\t//here is some code that we do not have access to\r\n\t}", "public boolean reEnterRunway(Plane<?> flight)\r\n {\r\n int tempIndex = clearance.search(flight);\r\n\r\n if(tempIndex < 0)\r\n {\r\n System.out.println(\"Flight \" + flight.getFlightNumber() + \" is not waiting for clearance.\");\r\n return false;\r\n\r\n }\r\n else\r\n {\r\n Plane<?> tempPlane = clearance.get(tempIndex);\r\n clearance.remove(tempIndex);\r\n\r\n findRunway(tempPlane.getRunway()).enqueueToRunway(tempPlane);\r\n System.out.println(\"Flight \" + tempPlane.getFlightNumber() + \" is now waiting for takeoff on runway \" + tempPlane.getRunway());\r\n return true;\r\n }\r\n\r\n }", "@Audit(transName=\"editPlaneConfirmation\", transType=\"editPlane\", beforeLog=TRUE, afterLog=TRUE)\r\n\tpublic void editPlaneConfirmation(){\r\n\t\twsrdModel.setErrorMsg(\"\");\r\n\t\twsrdModel.setDuplicateErrorMsg(\"\");\r\n\t\tif(checkMultiplePlaneEdit()){\r\n\t\t\twsrdModel.setErrorMsg(WsrdConstants.UNSAVED);\r\n\t\t}\r\n\t\telse{\r\n\r\n\t\t\tif(checkPlaneUnavaialble()){\r\n\t\t\t\twsrdModel.setErrorMsg(WsrdConstants.UNAVAILABLE);\r\n\t\t\t}\r\n\t\t\telse{\r\n\r\n\t\t\t\tString str=checkPlaneAssociation();\r\n\t\t\t\tif(str.trim().equalsIgnoreCase(WsrdConstants.SELECTMSG)){\r\n\t\t\t\t\tfor(UiAirplaneModel plane:uiAirplaneModel.getAirplaneList()){\r\n\t\t\t\t\t\tif(plane.isSelected()){\r\n\t\t\t\t\t\t\tuiAirplaneModel.setValidTPI(false);\r\n\t\t\t\t\t\t\tList<String> airplaneModels = wsrdAdminService.fetchTPIAirplanes(wsrdUtilController.getUserPrivileges().getBemsID());\r\n\t\t\t\t\t\t\tif (airplaneModels.contains(plane.getAirplaneModel())) {\r\n\t\t\t\t\t\t\t\tuiAirplaneModel.setValidTPI(true);\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\tif(uiAirplaneModel.getValidTPI() || wsrdUtilController.getUserPrivileges().isSuperAdmin()){\r\n\t\t\t\t\t\t\t\teditAirplane();\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\taddErrorMessage(WsrdConstants.APMESSAGE, WsrdConstants.NOT_AUTHORIZED);\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 }else{\r\n\t\t\t\t\twsrdModel.setDuplicateErrorMsg(str);\r\n\t\t\t\t\twsrdModel.setErrorMsg(WsrdConstants.AP_CONFLICT);\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t\t\r\n\t\t}\r\n\t}", "public void cancelFlight(){\n \n Flight flightObject = FlightRepository.getFlight(this.number);\n if (flightObject == null){\n System.out.println(\"Please select a valid flight number\");\n }\n flightObject.removePassengerSeat(this.PassengerID);\n }", "public void performAirplaneModeChange(boolean z) {\n this.airplaneMode = z;\n }", "void passivate();", "public static AirPlane askForAirPlane() {\n boolean exist = false;\n AirPlane airPlane = null;\n\n System.out.print(\"Enter the license plate of the airplane that you wish to manipulate:\");\n String airPlaneToManipulate = keyboard.next();\n while(exist == false) {\n\n exist = searchIfAirPlaneExsist(airPlaneToManipulate);// check if the user entrie is correct or if the airplane exsist\n if(exist) {\n airPlane = catchObjectAirPlane(airPlaneToManipulate);// search the airplane to controll\n }\n\n if(exist == false) {\n System.out.println(\"This Air Plane doesn't exsist, try it again:\");\n airPlaneToManipulate = keyboard.next();\n }\n }\n\n return airPlane; //return object/airplane that user wanna controll\n }", "void issueBoardingPass();", "public Airplane (){\n \n }", "@Override\n\tpublic void move() {\n\t\tSystem.out.println(\"Driving a airplane!\");\n\t}", "public void dispatchAirplaneModeChange(boolean z) {\n this.handler.sendMessage(this.handler.obtainMessage(10, z ? 1 : 0, 0));\n }", "@Override\n public void announceArrival() {\n this.lock.lock();\n try {\n // update pilot state\n this.repository.updatePilotState(PilotState.DEBOARDING);\n\n // call passengers\n this.endOfFlight = true;\n while (!this.passengers.isEmpty()) {\n // wake up passengers\n this.passengerLeavePlane = this.passengers.poll();\n this.passengersWaitForEndOfFlight.signal();\n this.passengersWaitForEndOfFlight.signalAll();\n\n // wait for all passengers\n this.pilotWaitForDeboarding.await();\n }\n this.endOfFlight = false;\n\n // update pilot state\n this.repository.updatePilotState(PilotState.FLYING_BACK);\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n this.lock.unlock();\n }\n }", "LaneController getStraightLaneController();", "@Override\n\tpublic void action() \n\t{\n\t\tif(this.user.arrivedToFinalStation())\n\t\t{\n\t\t\tthis.user.stablishDesiredVehicle();\n\t\t\tthis.user.stablishDesiredStation();\n\t\t}\n\t\t\n\t\t//printing info\n\t\tSystem.out.println(\"\\nI'm \" + this.user.getLocalName() + \": I'm on \" + this.user.getCurrentStation() + \" and I want to go to \" + this.user.desiredStation + \" by \" + this.user.desiredVehicle +\".\\n\");\n\t\t//this.mensaje=scanner.nextLine(); //debug\n\t\t\n\t\t//PetitionRequest\n\t\tSystem.out.println(\"I make a vehicle request to \" + this.user.getCurrentStation() + \": I'm on \" + this.user.getCurrentStation() + \" and I want to go to \" + this.user.desiredStation + \" by \" + this.user.desiredVehicle + \".\");\n\t\tthis.msgObject = new Capsule(null,this.user.getDesiredVehicle(),this.user.getDesiredStation(),null);\n\t\tUtils.enviarMensaje(myAgent, this.user.getCurrentStation(), this.msgObject, \"VEHICLE_REQUEST\");\n\t\t\n\t\t//Waiting for answer\n\t\tACLMessage msg=this.myAgent.blockingReceive(\n\t\t\t\tMessageTemplate.and(\n\t\t\t\t\t\tMessageTemplate.MatchPerformative(ACLMessage.REQUEST), \n\t\t\t\t\t\tMessageTemplate.MatchOntology(\"ontologia\"))\n\t\t\t\t);\n\t\t\n\t\ttry\n\t\t{\n\t\t\tthis.comment = msg.getEnvelope().getComments();\n\t\t\tthis.msgObject = (Capsule) msg.getContentObject();\n\t\t\tSystem.out.println(\"\\t\" + this.user.getCurrentStation() + \" told me \" + this.comment + \". \");\n\t\t\t\n\t\t\tswitch(this.comment)\n\t\t\t{\n\t\t\tcase \"VEHICLE_DELIVERY\":\n\t\t\t\t//1. The station give to the user the vehicle normaly\n\t\t\t\tif(msgObject.getVehicle() != null) {\n\t\t\t\t\tthis.user.takeVehicle(msgObject.getVehicle());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//2. The user goes to the final station\n\t\t\t\tthis.notifyMonitor(\"moving\");\n\t\t\t\tthis.user.goToStation();\n\t\t\t\tthis.notifyMonitor(\"waiting\");\n\n\t\t\t\t//3. Leaves the vehicle on the final station\n\t\t\t\tif(this.user.hasVehicle())\n\t\t\t\t{\n\t\t\t\t\tthis.vehicleTemp = this.user.leaveVehicle();\n\t\t\t\t\tmsgObject = new Capsule(this.vehicleTemp,null, null, null);\n\t\t\t\t\tUtils.enviarMensaje(myAgent, this.user.getCurrentStation(), this.msgObject, \"VEHICLE_RETURN\");\n\t\t\t\t}\n\n\t\t\t\t//4. The user waits a bit\n\t\t\t\tthis.user.waitSomeTime(8000);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"UNSATISFACTORY_REQUEST\":\n\t\t\t\t// The station reports that the request couldn't be completed properly\n\t\t\t\t//1. The capsule can cointain: alternativeStation and alternativeVehicle\n\t\t\t\tif(msgObject.getStation() != null) {\t//checks if there's an alternative reserved station\n\t\t\t\t\tSystem.out.println(\"\\t\"+this.user.getCurrentStation() + \" told me that there's an alternative route -> \" + msgObject.getStation() + \". \");\n\t\t\t\t\tthis.user.stablishDestinationStation(msgObject.getStation());\n\t\t\t\t}\n\t\t\t\tif(msgObject.getVehicle() != null) { //checks if the station gave an alternative vehicle\n\t\t\t\t\tSystem.out.println(\"\\t\"+this.user.getCurrentStation() + \" gived to me an alternative vehicle -> \" + msgObject.getVehicle().getType() + \". \");\n\t\t\t\t\tthis.user.takeVehicle(msgObject.getVehicle());\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"\\tI have to go walking. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//2. Moving to the destination station\n\t\t\t\tthis.notifyMonitor(\"moving\");\n\t\t\t\tthis.user.goToStation();\n\t\t\t\tthis.notifyMonitor(\"waiting\");\n\n\t\t\t\t//3. If has a vehicle, the user leaves it\n\t\t\t\tif(this.user.hasVehicle()) \n\t\t\t\t{\n\t\t\t\t\t//send the vehicle to the station\n\t\t\t\t\tthis.vehicleTemp = this.user.leaveVehicle();\n\t\t\t\t\tmsgObject = new Capsule(this.vehicleTemp,null, null, null);\n\t\t\t\t\tUtils.enviarMensaje(myAgent, this.user.getCurrentStation(), this.msgObject, \"VEHICLE_RETURN\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//4. the user waits before restarting the behavior\n\t\t\t\tthis.user.waitSomeTime(4000);\n\t\t\t}\n\t\t}\n\t\tcatch (UnreadableException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void doMission(Connection connection) {\n final Unit unit = getUnit();\n if (unit.getTile() == null) {\n logger.finest(\"AI pioneer waiting to go to\"\n + getTransportDestination() + \": \" + unit);\n return;\n }\n\n if (!hasTools()) { // Try to equip.\n if (colonyWithTools != null\n && !checkColonyForTools(getAIUnit(), colonyWithTools)) {\n colonyWithTools = null;\n }\n if (colonyWithTools == null) { // Find a new colony.\n colonyWithTools = findColonyWithTools(getAIUnit());\n }\n if (colonyWithTools == null) {\n abandonTileImprovementPlan();\n logger.finest(\"AI pioneer can not find equipment: \" + unit);\n return;\n }\n\n // Go there, equip unit.\n if (travelToTarget(\"AI pioneer\", colonyWithTools.getTile())\n != Unit.MoveType.MOVE) return;\n getAIUnit().equipForRole(Unit.Role.PIONEER, false);\n if (!hasTools()) {\n abandonTileImprovementPlan();\n logger.finest(\"AI pioneer reached \" + colonyWithTools.getName()\n + \" but could not equip: \" + unit);\n return;\n }\n logger.finest(\"AI pioneer reached \" + colonyWithTools.getName()\n + \" and equips: \" + unit);\n colonyWithTools = null;\n }\n\n // Check the plan still makes sense.\n final Player player = unit.getOwner();\n final EuropeanAIPlayer aiPlayer = getEuropeanAIPlayer();\n if (tileImprovementPlan != null\n && !validateTileImprovementPlan(tileImprovementPlan, aiPlayer)) {\n tileImprovementPlan = null;\n }\n if (tileImprovementPlan == null) { // Find a new plan.\n AIUnit aiu = getAIUnit();\n tileImprovementPlan = findTileImprovementPlan(aiu);\n if (tileImprovementPlan == null) {\n logger.finest(\"AI pioneer could not find an improvement: \"\n + unit);\n return;\n }\n tileImprovementPlan.setPioneer(aiu);\n }\n \n // Go to target and take control of the land before proceeding\n // to build.\n Tile target = tileImprovementPlan.getTarget();\n if (travelToTarget(\"AI pioneer\", target) != Unit.MoveType.MOVE) return;\n if (!player.owns(target)) {\n // TODO: Better choice whether to pay or steal.\n // Currently always pay if we can, steal if we can not.\n boolean fail = false;\n int price = player.getLandPrice(target);\n if (price < 0) {\n fail = true;\n } else {\n if (price > 0 && !player.checkGold(price)) {\n price = NetworkConstants.STEAL_LAND;\n }\n if (!AIMessage.askClaimLand(aiPlayer.getConnection(), target,\n null, price)\n || !player.owns(target)) { // Failed to take ownership\n fail = true;\n }\n }\n if (fail) {\n aiPlayer.removeTileImprovementPlan(tileImprovementPlan);\n tileImprovementPlan.dispose();\n tileImprovementPlan = null;\n logger.finest(\"AI pioneer can not claim land at \" + target\n + \": \" + unit);\n return;\n }\n }\n\n if (unit.getState() == UnitState.IMPROVING) {\n unit.setMovesLeft(0);\n logger.finest(\"AI pioneer improving \"\n + tileImprovementPlan.getType() + \": \" + unit);\n } else if (unit.checkSetState(UnitState.IMPROVING)) {\n // Ask to create the TileImprovement\n if (AIMessage.askChangeWorkImprovementType(getAIUnit(),\n tileImprovementPlan.getType())) {\n logger.finest(\"AI pioneer began improvement \"\n + tileImprovementPlan.getType()\n + \" at target \" + target\n + \": \" + unit);\n } else {\n aiPlayer.removeTileImprovementPlan(tileImprovementPlan);\n tileImprovementPlan.dispose();\n tileImprovementPlan = null;\n logger.finest(\"AI pioneer failed to improve \" + target\n + \": \" + unit);\n }\n } else { // Probably just out of moves.\n logger.finest(\"AI pioneer waiting to improve at \" + target.getId()\n + \": \" + unit);\n }\n }", "public void passivate()\n {\n }", "public void takeOff(boolean clearnce) {\r\n\r\n if(clearnce) {\r\n Plane tempPlane = runways.get(position).peekRunway();\r\n runways.get(position).dequeueFromRunway();\r\n System.out.println(\"Flight \" + tempPlane.getFlightNumber() + \" has now taken off from runway \" + tempPlane.getRunway());\r\n position = (position + 1) % (runways.size());\r\n count++;\r\n } else {\r\n Plane tempPlane = runways.get(position).peekRunway();\r\n clearance.add(runways.get(position).dequeueFromRunway());\r\n System.out.println(\"Flight \" + tempPlane.getFlightNumber() + \" is now waiting to be allowed to re-enter a runway.\");\r\n position = (position + 1) % (runways.size());\r\n\r\n }\r\n }", "public void updateDeviceAir(){\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.add(Calendar.DATE, -1);\n\t\tDate date = calendar.getTime();\n\t\tDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\tString time = df.format(date);\n\t\t\n\t\tHashMap<String, Integer> insideMap = deviceStatusDao.getAverageInside(time + \"%\");\n\t\tHashMap<String, Integer> outsideMap = deviceStatusDao.getAverageOutside(time + \"%\");\n\t\t//pair device air & city air\n\t\tfor(String device_id : insideMap.keySet()){\n\t\t\tDeviceAir deviceAir = new DeviceAir();\n\t\t\tdeviceAir.setDeviceID(device_id);\n\t\t\tdeviceAir.setInsideAir(insideMap.get(device_id));\n\t\t\tif(!outsideMap.containsKey(device_id)){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdeviceAir.setOutsideAir(outsideMap.get(device_id));\n\t\t\tdeviceAir.setDate(time);\n\t\t\tdeviceStatusDao.insertDeviceAir(deviceAir);\n\t\t}\n\t}", "private void travelToAirport()\n {\n try\n { sleep ((long) (1 + 30000 * Math.random ()));\n }\n catch (InterruptedException e) {}\n }", "public LWTRTPdu disConnectAcpt() throws IncorrectTransitionException;", "private void dealWithDeadEnd(MyAIController controller) {\n\t\tWorldSpatial.Direction orientation = controller.getOrientation();\n\t\tCoordinate pos = new Coordinate(controller.getPosition());\n\n\t\t// Check the space on left and right of the car\n\t\tint spaceOnRight = map.spaceInDirection(pos, orientation,\n\t\t\t\tWorldSpatial.RelativeDirection.RIGHT);\n\t\tint spaceOnLeft = map.spaceInDirection(pos, orientation,\n\t\t\t\tWorldSpatial.RelativeDirection.LEFT);\n\n\t\t// Perform turning actions based on space available\n\t\tif (spaceOnRight > 1) {\n\t\t\tcontroller.performUTurn(WorldSpatial.RelativeDirection.RIGHT);\n\t\t\tstate = ExplorerState.JUST_TURNED_LEFT;\n\t\t} else if (spaceOnRight >= 0 && spaceOnLeft >= 1) {\n\t\t\tcontroller.performThreePointTurn(WorldSpatial.RelativeDirection.RIGHT);\n\t\t\tstate = ExplorerState.JUST_TURNED_LEFT;\n\t\t} else {\n\t\t\tjustReversed = true;\n\t\t\tcontroller.toggleReverseMode();\n\t\t}\n\t}", "public static void main(String[] args) throws CantAdd, CoronaWarn {\n\t\tTravelAgency TravelAgency = new TravelAgency();\r\n\r\n\t\tPlane p=new Plane(200,2,\"first plane max travelers\");\r\n\t\tPlane p1=new Plane(100,1,\"second plan min traelers\");\r\n\r\n\t\tTrip i=new Trip(p,Country.Australia,Country.Canada);\r\n\t\tTrip io=new Trip(p1,Country.Australia,Country.Canada);\r\n\t\t \r\n\t\tDate date=new Date(1,2,5);\r\n\t\tPassport passprt1=new Passport(\"anton\",44,date);\r\n\t\tPassport passprt2=new Passport(\"abdo\",44,date);\r\n\t\tPassport passprt3=new Passport(\"julie\",44,date);\r\n\t\tPassport passprt4=new Passport(\"juliana\",44,date);\r\n\t\tPassport passprt5=new Passport(\"bella\",44,date);\r\n\t\tPassport passprt6=new Passport(\"geris\",44,date);\r\n\t\tTraveler t1=new Traveler(passprt1,true,true);\r\n\t\tTraveler t2=new Traveler(passprt2,true,true);\r\n\t\tTraveler t3=new Traveler(passprt3,true,true);\r\n\t\tTraveler t4=new Traveler(passprt4,true,true);\r\n\t\tTraveler t5=new Traveler(passprt5,true,true);\r\n\t\tTraveler t6=new Traveler(passprt6,true,true);\r\n\t\t\r\n\t\t\r\n\t\tio.addTraveler(t1);\r\n\t\tio.addTraveler(t2);\r\n\t\tio.addTraveler(t3);\r\n\t\tio.addTraveler(t6);\r\n\t\tio.addTraveler(t5);\r\n\t\tio.addTraveler(t4);\r\n\t\tio.addTraveler(t6);\r\n \r\n\t\ti.addTraveler(t1);\r\n\t\ti.addTraveler(t2);\r\n\t\ti.addTraveler(t3);\r\n\t\ti.addTraveler(t4);\r\n\t\r\n\t\ti.addTraveler(t6);\r\n\t\t\r\n\t\tTravelAgency.addTrip(i);\t\r\n\t\tTravelAgency.addTrip(io);\r\n\t\tSystem.out.print(TravelAgency.findUnsafeTrips());\r\n\r\n\t\t\r\n\t\tTravelAgency.AddTraveler(t1);\r\n\t\tTravelAgency.AddTraveler(t2);\r\n\t\tTravelAgency.AddTraveler(t3);\r\n\t\tTravelAgency.AddTraveler(t4);\r\n\t\tTravelAgency.AddTraveler(t5);\r\n\t\tTravelAgency.AddTraveler(t6);\r\n\t\t\r\n\t}", "public void action() {\r\n\t\tLCD.drawString(\"Avoid Behavior!\", 0, 7);\r\n\r\n\t\tMapUpdate.updateWithoutObject(0);\r\n\t\tMapUpdate.updateWithObject(StandardRobot.us.getRange());\r\n\r\n\t\tif (StandardRobot.ts.isPressed()) {\r\n\t\t\tStandardRobot.pilot.setTravelSpeed(7);\r\n\t\t\tStandardRobot.pilot.travel(-5);\r\n\t\t\tcounter.countTravel();\r\n\r\n\t\t\tif (store.getFlag() == 0) {\r\n\t\t\t\tStandardRobot.pilot.rotate(-90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t} else {\r\n\t\t\t\tStandardRobot.pilot.rotate(90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\tif (store.getFlag() == 0) {\r\n\t\t\t\tStandardRobot.pilot.rotate(-90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t} else {\r\n\t\t\t\tStandardRobot.pilot.rotate(90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void landOrTakeoff(String land_or_takeoff) {\n\t\ttry {\n\t\tthis.baggage = Integer.valueOf(land_or_takeoff);\n\t\tthis.isLanding = true;\n\t\t}catch(NumberFormatException e) {\n\t\t\tthis.isLanding = false;\n\t\t\tthis.destination = land_or_takeoff;\n\t\t}//catch\n\t}", "public static void teleportAway(ClientContext ctx) {\n Item sceptre = ctx.inventory.select().id(Items.SKULL_SCEPTRE_I_21276).poll();\n\n if (sceptre.valid()) {\n sceptre.interact(\"Invoke\", sceptre.name());\n sleep(3000);\n } else {\n // Teletab\n Item tab = ctx.inventory.select().select(new Filter<Item>() {\n @Override\n public boolean accept(Item item) {\n return item.name().toLowerCase().contains(\"teleport\");\n }\n }).poll();\n\n if (tab.valid()) {\n tab.click();\n } else {\n // Glory Teleport\n ctx.game.tab(Game.Tab.EQUIPMENT);\n Item ammy = ctx.equipment.itemAt(Equipment.Slot.NECK);\n if (ammy.name().toLowerCase().contains(\"glory\")) {\n ammy.interact(\"Edgeville\");\n sleep(4000);\n }\n }\n }\n }", "public void startTransit() {\n\t\tthis.currentDriver.setStatus(Status.INTRANSIT);\n\t\tthis.currentDriver.setStatus(Status.FINISHED);\n\t\tthis.passenger.setLocation(currentRide.getDropOff());\n\t\tthis.currentDriver.setLocation(currentRide.getDropOff());\n\t\tthis.finishRide();\n\t}", "public void showAway();", "@Override\n public void planTrip(String departingAddress, String departingZipCode,\n String arrivalZipCode, Date preferredArrivalTime) {\n FlightSchedule schedule = airlineAgency.bookTicket(departingZipCode, arrivalZipCode, preferredArrivalTime);\n //cab pickup scheduling activity\n cabAgency.requestCab(departingAddress, schedule.getFlightNumber());\n \n //Test output\n System.out.println(\"Test output: trip planned\");\n }", "@Override\n\tpublic void canTakeOff() {\n\t\tSystem.out.println(\"I CANNOT TAKE OFF UNLESS YA JUMP ME OVER SOMMAT\");\n\t}", "private static void turnAwayFromWall() {\n while (true) {\n if (readUsDistance() > OPEN_SPACE) {\n leftMotor.stop();\n rightMotor.stop();\n // re-calibrate theta, offset will be added to this angle\n odometer.setTheta(0);\n System.out.println(\"starting localization...\");\n prevDist = 255;\n dist = prevDist;\n break;\n }\n }\n }", "void removeAirport(Long id);", "@Override\n public void action() {\n DFAgentDescription appointmentAgentDescription = dfSubscription.getAgentDescription();\n List<AllocationState> preferredAllocations = patientAgent.getAllocationStates();\n\n if (patientAgent.getCurrentAllocation() == GlobalAgentConstants.APPOINTMENT_UNINITIALIZED) {\n /* Patient agent has not got any appointment from the hospital agent yet */\n return;\n\n } else if (preferredAllocations.isEmpty()) {\n /* Patient Agent has its most preferred appointment */\n isHappyWithAppointment = true;\n\n } else if (appointmentAgentDescription != null) {\n\n /* Loop executed when action is executed for the first time */\n if (preferredAllocationsIterator == null) {\n /* Querying patient preferences */\n preferredAllocationsIterator = patientAgent.getAllocationStates().iterator();\n currentSize = patientAgent.getAllocationStates().size();\n }\n\n\n if (!preferredAllocationsIterator.hasNext()) {\n /* Condition executed when no more swaps available */\n updatePreferences();\n\n } else if (expectedMessageTemplate == null) {\n\n /* We are not expecting any response, we can make another swap proposal */\n proposeSwap(preferredAllocationsIterator.next(), appointmentAgentDescription);\n\n } else {\n /* Some message has been sent, awaiting a response */\n ACLMessage expectedMessage = patientAgent.receive(expectedMessageTemplate);\n if (expectedMessage != null) {\n boolean wasSwapSuccessful = receiveResponse(expectedMessage, appointmentAgentDescription);\n expectedMessageTemplate = null;\n currentlyProposedAllocationSwap = null;\n\n /* If swap has been successful, we need to update our preference list\n as the patient agent has got new appointment */\n if (wasSwapSuccessful) {\n updatePreferences();\n }\n }\n }\n }\n }", "Flight updateFlight(Flight flight);", "public void endTrip()\r\n {\r\n if (detourTrip == null)\r\n {\r\n // we are in a normal trip\r\n trip = null;\r\n }\r\n else\r\n {\r\n // we are in a detour trip\r\n detourTrip = null;\r\n }\r\n }", "@Override\n\tpublic void seeRoute() {\n\t\tRoute route = game.getIncidentRoutes();\n\t\tSystem.out.println(route);\n\t\tSystem.out.println(\"Total sailing days required is \"+ game.calculateSailingDays(route)+\" days\");\n\t\tboolean state = false;\n\t\twhile (state == false) {\n\t\t\tSystem.out.println(\"Choose your actions: \");\n\t\t\tSystem.out.println(\"(1) Go back!\");\n\t\t\tSystem.out.println(\"(2) Set Sail\");\n\t\t\ttry { \n\t\t\t\tint selectedAction = scanner.nextInt();\n\t\t\t\tif (selectedAction <= 2 && selectedAction > 0) {\n\t\t\t\tstate = true;\n\t\t\t\tif (selectedAction == 1) {\n\t\t\t\t\tgame.backToMain();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (game.isIslandReachable(route)) {\n\t\t\t\t\t\tif (game.checkMyShipHealth()) {\n\t\t\t\t\t\t\tgame.payCrew(route);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tSystem.out.println(\"You should repair your ship first!\" + \"\\n\" + \"you will be redirected to store at your current Island\" + \"\\n\");\n\t\t\t\t\t\t\tgame.repairMyShip();\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\tSystem.out.println(\"This Island is not accessible because you don't have enough days left, you can choose other Island\");\n\t\t\t\t\t\tgame.backToMain();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"Please choose from actions above\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(INPUT_REQUIREMENTS);\n\t\t\t\tscanner.nextLine();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "@Override\n\tpublic void teleopPeriodic() {\n\t\t\n\t\t\n\t\t\n//\t\tSmartDashboard.putBoolean(\"Alliance_R\", alliance_R_SwitchState);\n//\t\tSmartDashboard.putBoolean(\"Alliance_L\", alliance_L_SwitchState);\n//\t\tSmartDashboard.putBoolean(\"Scale_R\", R_scaleState);\n//\t\tSmartDashboard.putBoolean(\"Scale_L\", L_scaleState);\n//\t\tSmartDashboard.putBoolean(\"oppisite_R\", opposite_R_SwitchState);\n//\t\tSmartDashboard.putBoolean(\"opposite_L\", opposite_L_SwitchState);\n//\t\t\n//\t\tSmartDashboard.putNumber(\"right Vel\", chassis.rightMagVelocity());\n//\t\tSmartDashboard.putNumber(\"left Vel\", chassis.leftMagVelocity());\n//\t\tSmartDashboard.putNumber(\"right Pos\", chassis.rightMagPosition());\n//\t\tSmartDashboard.putNumber(\"left Pos\", chassis.leftMagPosition());\n\t\tSmartDashboard.putData(\"gyro\", chassis.navx);\n\t\tSmartDashboard.putData(\"Chassis\",chassis);\n\t\tSmartDashboard.putBoolean(\"shift is high\", chassis.shiftIsHigh);\n\t\tSmartDashboard.putNumber(\"Arm Pot Value\", Robot.arm.getArmPot());\n\t\tSmartDashboard.putNumber(\"Elevator Encoder\", elevator.getElevatorMagPosition());\n\t\t\n//\t\tSmartDashboard.putNumber(\"TurnPID\", chassis.turnSpeed.getSpeed());\n//\t\tSmartDashboard.putData(\"TurnController\", chassis.turnController);\n//\t\tSmartDashboard.putData(\"Turn\",new Turn());\t\t\n//\t\tSmartDashboard.putNumber(\"leftDistPID\", chassis.leftDistanceSpeed.getSpeed());\n//\t\tSmartDashboard.putNumber(\"rightDistPID\", chassis.rightDistanceSpeed.getSpeed());\n//\t\tSmartDashboard.putData(\"right drive controller\", chassis.rightDistanceController);\n//\t\tSmartDashboard.putData(\"left drive controller\", chassis.leftDistanceController);\t\t\t\n//\t\tSmartDashboard.putData(\"test\",new drivefrompoint());\n\t\tSmartDashboard.putData(\"Arm PID\", arm.armPID);\n\t\tSmartDashboard.putData(\"Elevator PID\", elevator.elePID);\n\t\tSmartDashboard.putData(\"Elevator Subsystem\", elevator);\n\t\tSmartDashboard.putData(\"Hold Climb Command\", new LowerElevatorManual(0.1));\n\t\t\n\t\tSmartDashboard.putNumber(\"intake lead current\", Robot.intake.intakeLeader.getOutputCurrent());\n\t\tSmartDashboard.putNumber(\"intake follow current\", Robot.intake.intakeFollower.getOutputCurrent());\n\t\t\n\t\tSmartDashboard.putNumber(\"arm current\", arm.arm.getOutputCurrent());\n\t\t//SmartDashboard.putBoolean(\"Upper Elevator Limit Switch\", elevato);\n\t\t\n\t\tScheduler.getInstance().run();\n\t\t\n\t\t\n\t\tif(!elevator.getBottomElevatorLimit()) {\n\t\t\televator.resetElevatorMag();\n\t\t}\n\t\t\n\t}", "private void stop() {\n System.out.println(\"Stopping on \"+ _currentFloor.floorName() +\" floor \" );\n _currentFloor.clearDestinationRequest();\n _passengersOnboard = _passengersOnboard - _currentFloor.queuedPassengers();\n _currentFloor.clearQueuedPassengers();\n System.out.println(this);\n\n }", "public abstract int drive(int journeyDistance);", "public interface AircraftColleague {\n public void startLanding();\n public void finishLanding();\n}", "private static void incrementFlightTakeOffCounter()\r\n\t{\r\n\t\tflightTakeOffCounter++;\r\n\t}", "@Test\n\tpublic void testDepartedGoodScenario() {\n\t\tgateInfoDatabase.allocate(0, 112);\n\t\tgateInfoDatabase.allocate(1, 332);\n\t\t\t\t\n\t\t/* Test if the allocations were successful. The returned status code should be 1 (RESERVED)\n\t\tfor both gates. */\n\t\tassertEquals(1, gateInfoDatabase.getStatus(0));\n\t\tassertEquals(1, gateInfoDatabase.getStatus(1));\n\t\t\n\t\t// Test if the getStatuses method returns an array storing the correct status codes (1 - RESERVED).\t\t\t\t\n\t\tassertEquals(1, gateInfoDatabase.getStatuses()[0]);\n\t\tassertEquals(1, gateInfoDatabase.getStatuses()[1]);\n\t\t\n\t\t// Then, the planes are docked.\n\t\tgateInfoDatabase.docked(0);\n\t\tgateInfoDatabase.docked(1);\n\t\t\n\t\t/* Test if the aircrafts have successfully docked. \n\t\tThe returned status codes should be 2 (OCCUPIED) for both gates. */\n\t\tassertEquals(2, gateInfoDatabase.getStatus(0));\n\t\tassertEquals(2, gateInfoDatabase.getStatus(1));\n\t\t\n\t\t// Test if the getStatuses method returns an array storing the correct status codes (2 - OCCUPIED).\t\t\n\t\tassertEquals(2, gateInfoDatabase.getStatuses()[0]);\n\t\tassertEquals(2, gateInfoDatabase.getStatuses()[1]);\n\t\t\n\t\t// Finally, the planes depart. \t\t\n\t\tgateInfoDatabase.departed(0);\n\t\tgateInfoDatabase.departed(1);\n\t\t\n\t\t/* Test that the aircrafts have successfully departed.\n\t\tThe returned status codes should be 0 (FREE) for both gates, since the planes have \n\t\talready departed and the gates have been freed. */\n\t\tassertEquals(0, gateInfoDatabase.getStatus(0));\n\t\tassertEquals(0, gateInfoDatabase.getStatus(1));\n\t\t\n\t\t// Test if the getStatuses method returns an array storing the correct status codes (0 - FREE).\t\t\n\t\tassertEquals(0, gateInfoDatabase.getStatuses()[0]);\n\t\tassertEquals(0, gateInfoDatabase.getStatuses()[1]);\n\t}", "boolean validateFlight(Flight flight);", "@Test\n public void test_UnsuccessfulTravel() {\n \n setup(1, 1);\n \n SolarSystems.ADI.changeLocation(SolarSystems.SHALKA);\n \n // Tests the player's current fuel.\n assertEquals(1, player.getFuel());\n \n // Tests the player's current location.\n assertEquals(SolarSystems.ADI, player.getSolarSystems());\n \n }", "public interface TravelStrategy {\r\n\t/**\r\n\t * Returns the floor number of the passenger's current destination, so that other strategies can base their\r\n\t * decisions on where the passenger is trying to get to.\r\n\t */\r\n\tint getDestination();\r\n\t\r\n\t/**\r\n\t * Called when it is time to schedule a PassengerNextDestinationEvent according to the rules of this travel strategy.\r\n\t * Typically this occurs when the passenger departs the elevator on the correct floor, but that is not guaranteed.\r\n\t * @param currentFloor the floor that the passenger got off.\r\n\t */\r\n\tvoid scheduleNextDestination(Passenger passenger, Floor currentFloor);\r\n}", "boolean CanBuyRoad();", "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}", "@Override\n public void leaveThePlane(int passengerId) {\n this.lock.lock();\n try {\n // wake up pilot\n this.pilotWaitForDeboarding.signal();\n } finally {\n this.lock.unlock();\n }\n }", "public static void launchPlane(ListArrayBasedGeneric<Runway> runwayList, AOSLArrayBased listOfPlanes) throws IOException // Option # 2\r\n\t{\r\n\t\tint sizeOfAirport = runwayList.size();\r\n\t\tint sizeOfRunway = 0;\r\n\t\tString flightNumber = \"\";\r\n\t\tString runwayName = \"\";\r\n\t\tchar userInput = '!';\r\n\t\tboolean readyToLaunch = false;\r\n\t\tint orderOfLaunch;\r\n\t\tint numberOfPlanes = 0;\r\n\t\t\r\n\t\t// Can't rely on the listOfPlanes' size because if planes are in purgatory, then they\r\n\t\t// are not taken out of the listOfPlanes' list and still CONTRIBUTE to the size even\r\n\t\t// though they are not on the runways to take off, so have to go through each runway \r\n\t\t// and count the size and total them up to get a accurate, updated count for the\r\n\t\t// number of planes\r\n\t\tfor(int i = 1; i < sizeOfAirport; i++)\r\n\t\t{\r\n\t\t\tnumberOfPlanes += runwayList.get(i).getListOfPlanes().size();\r\n\t\t}\r\n\t\t\r\n\t\tif(numberOfPlanes > 0) // Only launch, if there is a runway\r\n\t\t{\r\n\t\t\twhile(readyToLaunch == false)\r\n\t\t\t{\r\n\t\t\t\t// Get the launch order and size of the runway\r\n\t\t\t\torderOfLaunch = getLaunchOrder();\r\n\t\t\t\t\r\n\t\t\t\t// Get the size of the runway that is set to launch\r\n\t\t\t\tsizeOfRunway = runwayList.get(orderOfLaunch).getListOfPlanes().size();\r\n\t\t\t\t\r\n\t\t\t\tif(sizeOfRunway > 0) // Has atleast 1 plane in it\r\n\t\t\t\t{\r\n\t\t\t\t\t// Get the flight number from the runway\r\n\t\t\t\t\tflightNumber = runwayList.get(orderOfLaunch).getListOfPlanes().get(0).getFlightNumber();\r\n\t\t\t\t\t\r\n\t\t\t\t\tSystem.out.print(\"\\tFlight \" + flightNumber + \" cleared for takeoff(Y/N): \");\r\n\t\t\t\t\tuserInput = stdin.readLine().trim().charAt(0);\r\n\t\t\t\t\tSystem.out.println(userInput);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(userInput == 'Y' || userInput == 'y') // Yes --> Take off\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Get the runway name to display it\r\n\t\t\t\t\t\trunwayName = runwayList.get(orderOfLaunch).getListOfPlanes().get(0).getRunway();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Launch the plane\r\n\t\t\t\t\t\trunwayList.get(orderOfLaunch).takeOff();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tSystem.out.println(\"\\tFlight \" + flightNumber + \" has now taken off from runway \" + runwayName);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Remove it from the list of planes, so it can be added back in the future\r\n\t\t\t\t\t\tlistOfPlanes.remove(listOfPlanes.search(flightNumber));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Increment flight counter and launch order\r\n\t\t\t\t\t\t/**\r\n\t\t\t\t\t\t * sizeOfAirport - 1 because:\r\n\t\t\t\t\t\t * P A B C\r\n\t\t\t\t\t\t * 1 2 3\r\n\t\t\t\t\t\t * reset to 1 when launchOrder reaches 3 which is\r\n\t\t\t\t\t\t * size of the runway (4) - 1\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tif(launchOrder == sizeOfAirport - 1)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tsetLaunchOrder(1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tincrementLaunchOrder();\r\n\t\t\t\t\t\t} // END IF/ELSE\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Increment flight counter\r\n\t\t\t\t\t\tincrementFlightTakeOffCounter();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse // User didn't give clearance --> Add it to purgatory and increment launch order but not the flight counter\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"\\tFlight \" + flightNumber + \" is now waiting to be allowed to re-enter a runway\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trunwayList.get(0).addPlane(runwayList.get(orderOfLaunch).removeFromRunway(0));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Increment launch order\r\n\t\t\t\t\t\tif(launchOrder == sizeOfAirport - 1)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tsetLaunchOrder(1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tincrementLaunchOrder();\r\n\t\t\t\t\t\t} // END IF/ELSE\r\n\t\t\t\t\t} // END IF/ELSE\r\n\t\t\t\t\t\r\n\t\t\t\t\treadyToLaunch = true; // Quit after 1 iteration, whether the plane is launched or not\r\n\t\t\t\t}\r\n\t\t\t\telse // Get it to a launch order where it will have a plane\r\n\t\t\t\t{\r\n\t\t\t\t\tif(launchOrder == sizeOfAirport - 1) // It has reached the end of the runway count, so reset it to start at 1 (AFTER purgatory)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tsetLaunchOrder(1); // Set it back to 1 so it can start again\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse // Launch order hasn't reached the end, increment it by 1\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tincrementLaunchOrder();\r\n\t\t\t\t\t} // END IF/ELSE\r\n\t\t\t\t} // END IF/ELSE\r\n\t\t\t} // END WHILE\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"\\tNo planes on any runway!\");\r\n\t\t} // END IF/ELSE\r\n\t\t\r\n\t\tSystem.out.println();\r\n\t}", "public static void setAirplaneMode(boolean isAirplaneMode) {\n Settings.System.putInt(Robolectric.application.getContentResolver(), Settings.System.AIRPLANE_MODE_ON, isAirplaneMode ? 1 : 0);\n }", "public interface AutoPilot {\n /**\n * This is called on each update cycle. The AutoPilot looks at the environment\n * (via the Car object), and then make a decision about what car controls to use\n * at that cycle.\n * that encapsulates the information needed for decision-making.\n *\n * @see ActuatorAction\n * @param delta Seconds passed since last update\n * @param carStatus\n * @return\n */\n ActuatorAction handle(float delta, SensorInfo carStatus);\n\n /**\n * Lets the caller know whether this AutoPilot can take over the control. Some\n * types of AutoPilot (such as TurningAutoPilot) only takes over control at\n * certain tiles.\n *\n * @return true if it is ready to take over control.\n */\n public boolean canTakeCharge();\n\n /**\n * Lets the caller know whether this AutoPilot can be swapped out.\n * \n * Sometimes, AutoPilots are in certain crtical states (like in the process of making a turn),\n * and should not be interrupted. Otherwise, the car will end up in an unrecoverable state (like\n * halfway in the turning trajectory).\n * \n * @return true if it can be swapped out.\n */\n public boolean canBeSwappedOut();\n\n}", "@Override\n\t\t\t\tpublic void action() {\n\t\t\t\t\t\tRandom r = new Random();\n\t\t\t\t\t\tint Low = 1;\n\t\t\t\t\t\tint High = 999;\n\t\t\t\t\t\tint Result = r.nextInt(High-Low) + Low;\n\t\t\t\t\t\tACLMessage msg = new ACLMessage(ACLMessage.REQUEST);\n\t\t\t\t\t\tmsg.setOntology(\"AirConditioner\");\n\t\t\t\t\t\tmsg.addReceiver(new AID(\"da\", AID.ISLOCALNAME));\n//\t\t\t\t\t\tif (Result % 2 == 0){\n//\t\t\t\t\t\t\t//humid mode\n//\t\t\t\t\t\t\tmsg.setContent(\"humid\");\n//\t\t\t\t\t\t\tSystem.out.println(\"Agent \"+ myAgent.getLocalName() + \": operating mode: humid\" );\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\telse if((Result % 3 == 0)) {\n//\t\t\t\t\t\t\t//mid\n//\t\t\t\t\t\t\tmsg.setContent(\"mid\");\n//\t\t\t\t\t\t\tSystem.out.println(\"Agent \"+ myAgent.getLocalName() + \": operating mode: mid\" );\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\telse if((Result % 5 == 0)) {\n//\t\t\t\t\t\t\t//high\n//\t\t\t\t\t\t\tmsg.setContent(\"mid\");\n//\t\t\t\t\t\t\tSystem.out.println(\"Agent \"+ myAgent.getLocalName() + \": operating mode: high\" );\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\telse {\n//\t\t\t\t\t\t\t//low\n//\t\t\t\t\t\t\tmsg.setContent(\"mid\");\n//\t\t\t\t\t\t\tSystem.out.println(\"Agent \"+ myAgent.getLocalName() + \": operating mode: low\" );\n//\t\t\t\t\t\t}\n\t\t\t\t\t\tmsg.setContent(Airconditioner_Agent.mode);\n\t\t\t\t\t\tSystem.out.println(\"Agent \"+ myAgent.getLocalName() + \": operating mode: \"+Airconditioner_Agent.mode );\n\t\t\t\t\t\tmyAgent.send(msg);\n\t\t\t\t\t}", "public void boardPassenger(int floor){\n _passengersOnboard +=1;\n switch(floor){\n case 1: Floor.FIRST.makeDestinationRequest();\n Floor.FIRST.addQueuedPassenger();\n break;\n case 2: Floor.SECOND.makeDestinationRequest();\n Floor.SECOND.addQueuedPassenger();\n break;\n case 3: Floor.THIRD.makeDestinationRequest();\n Floor.THIRD.addQueuedPassenger();\n break;\n case 4: Floor.FOURTH.makeDestinationRequest();\n Floor.FOURTH.addQueuedPassenger();\n break;\n case 5: Floor.FIFTH.makeDestinationRequest();\n Floor.FIFTH.addQueuedPassenger();\n break;\n case 6: Floor.SIXTH.makeDestinationRequest();\n Floor.SIXTH.addQueuedPassenger();\n break;\n case 7: Floor.SEVENTH.makeDestinationRequest();\n Floor.SEVENTH.addQueuedPassenger();\n break;\n }\n }", "public void travaille();", "public void notifySwitchAway() { }", "boolean hasMission();", "boolean isInAir() {\n return inAir;\n }", "public IAirport getDestination();", "void unsetStation();", "void nearingTheWallBefore(){\n robot.absgyroRotation(0, \"absolute\");\n\n //alligning with the wall before going for the toy\n while(robot.leftDistanceSensor.getDistance(DistanceUnit.CM) > 15 && !isStopRequested()){\n if(robot.leftDistanceSensor.getDistance(DistanceUnit.CM) < 30)\n robot.mecanumMovement(0, .3, 0);\n else\n robot.mecanumMovement(0, .7, 0);\n\n telemetry.addLine(\"Distance from sensor: \" + robot.leftDistanceSensor.getDistance(DistanceUnit.CM));\n telemetry.update();\n }\n robot.mecanumMovement(0, 0, 0);\n\n robot.absgyroRotation(45, \"absolute\");\n }", "boolean hasOriginFlightLeg();", "public void teleopPeriodic() {\n\n \t//NetworkCommAssembly.updateValues();\n \t\n\t\t// both buttons pressed simultaneously, time to cal to ground\n\t\tif (gamepad.getRawButton(FRONT_ARM_GROUND_CAL_BUTTON1) && gamepad.getRawButton(FRONT_ARM_GROUND_CAL_BUTTON2)) {\n\t\t\tprocessGroundCal();\n\t\t}\n\n\t\t// PID CONTROL ONLY\n\t\tdouble armDeltaPos = gamepad.getRawAxis(1);\n\t\tif (Math.abs(armDeltaPos) < ARM_DEADZONE) {\n\t\t\tarmDeltaPos = 0.0f;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tarmDeltaPos *= ARM_POS_MULTIPLIER;\n\t\t\tdouble currPos = testMotor.getPosition();\n\t\t\t\n\t\t\tif (((currPos > SOFT_ENCODER_LIMIT_MAX) && armDeltaPos > 0.0) || ((currPos < SOFT_ENCODER_LIMIT_FLOOR) && armDeltaPos < 0.0)) {\n\t\t\t\tSystem.out.println(\"SOFT ARM LIMIT HIT! Setting armDeltaPos to zero\");\n\t\t\t\tarmDeltaPos = 0.0;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tdouble newPos = currPos + armDeltaPos;\n\t\t\ttestMotor.set(newPos);\n\t\t\tSystem.out.println(\"Setting new front arm pos = \" + newPos);\t\n\t\t}\t\t\n\n \t/*\n\t\tdouble newArmPos = gamepad.getRawAxis(1);\n\t\tif(Math.abs(newArmPos) <= ARM_DEADZONE) {\n\t\t\tnewArmPos = 0.0;\n\t\t}\n\t\tdouble newMotorPos = (newArmPos * ARM_SPEED_MULTIPLIER) + testMotor.getPosition();\n\t\tpositionMoveByCount(newMotorPos);\n\t\tSystem.out.println(\"input = \" + newArmPos + \" target pos = \" + newMotorPos + \" enc pos = \" + testMotor.getPosition());\n \t*/\n \t\n\t\t// PercentVbus test ONLY!!\n \t/*\n\t\tdouble armSpeed = gamepad.getRawAxis(1);\n\t\tif (Math.abs(armSpeed) < ARM_DEADZONE) {\n\t\t\tarmSpeed = 0.0f;\n\t\t}\t\n\t\tarmSpeed *= ARM_MULTIPLIER;\n\t\t\n\t\tdouble pos= testMotor.getPosition();\n\t\tif (((pos > SOFT_ENCODER_LIMIT_1) && armSpeed < 0.0) || ((pos < SOFT_ENCODER_LIMIT_2) && armSpeed > 0.0))\n\t\t\tarmSpeed = 0.0;\n\t\ttestMotor.set(armSpeed);\n\t\t\n\t\tSystem.out.println(\"armSpeed = \" + armSpeed + \" enc pos = \" + testMotor.getPosition());\n\t\t */ \n }", "public void createEnterZoneRule(){\n// ECAAgent.getDefaultECAAgent().createRule(\"enterZoneRule_\"+name,enterZone,\"MAKEFITS.Track.C_enterTheZone\",\"MAKEFITS.Track.A_enterTheZone\",1,CouplingMode.IMMEDIATE ,Context.RECENT);\n ECAAgent.getDefaultECAAgent().createRule(\"enterZoneRule_\"+name,enterZone,\"MAKEFITS.Track.C_enterTheZone\",\"MAKEFITS.Track.A_enterTheZone\",1,CouplingMode.IMMEDIATE ,ParamContext.RECENT);\n // ECAAgent.getDefaultECAAgent().createRule(\"enterZoneRule_\"+name,enterZone,\"MAKEFITS.Track.C_enterTheZone\",\"MAKEFITS.Track.A_enterTheZone\",1,CouplingMode.IMMEDIATE ,ParamContext.CHRONICLE);\n }", "@Override\n\tpublic void teleopPeriodic() {\n\t\tif (state.equals(\"teleop\")) {\n\t\t\tlastState = \"teleop\";\n\t\t}\n\t\tstate = \"teleop\";\n\n\t\tif (lastState.equals(\"auton\")) {\n\t\t\tNetworkTables.getControlsTable().putBoolean(\"auton\", false);\n\t\t\t\n\t\t\t//Changes the control Mode back to PercentVbus\n\t\t\t//Should only run once - first interation of teleop\n\t\t\t//And ends auton if running\n\t\t\tif(autonomousCommand != null){\n\t\t\t\tautonomousCommand.cancel();\n\t\t\t}\n\t\t\tActuators.getLeftDriveMotor().changeControlMode(TalonControlMode.PercentVbus);\n\t\t\tActuators.getLeftDriveMotor().set(Constants.MOTOR_STOP);\n\t\t\tActuators.getRightDriveMotor().changeControlMode(TalonControlMode.PercentVbus);\n\t\t\tActuators.getRightDriveMotor().set(Constants.MOTOR_STOP);\n\t\t}\n\n//\t\tNetworkTables.putStream(Gamepad.primary.getX() || Gamepad.secondary.getX());\n\t\t/*\n\t\t * Primary Controllers Controls\n\t\t */\n\t\t// TODO: confirm right trigger forward, left trigger reverse\n\t\t// Drive controls\n\t\tDrive.drive(-Gamepad.primary.getLeftX(), Gamepad.primary.getTriggers()); \n\t\tDrive.shift(Gamepad.primary.getA(), Gamepad.primary.getY()); // shifting with A low gear and Y high gear\n\t\tDrive.shiftToggle(Gamepad.primary.getLB());\n\t\tDrive.crab(Gamepad.primary.getDPadLeft(), Gamepad.primary.getDPadRight());\n\t\t\n//\t\tif (Gamepad.primary.getDPadLeft()){\n//\t\t\tDrive.goingLeft = true;\n//\t\t\tDrive.crab();\t\t\n//\t\t}else if( Gamepad.primary.getDPadRight()){\n//\t\t\tDrive.goingLeft = false;\n//\t\t\tDrive.crab();\t\t\t\n//\t\t}else if (Drive.crabState > 0){\n//\t\t\tDrive.crab();\n//\t\t}\n\n\t\t\n\t\t// Climb controls\n\t\tClimb.climbStopPrimary(Gamepad.primary.getDPadUp()); // runs climbStop using left on the DPad - Primary\n\t\t// Climb.climbSafetyTogglePrimary(Gamepad.primary.getBack()); //toggles safety if pressed 3 times\n\n\t\t// Gear controls\n\t\tScore.dispenseGear(Gamepad.primary.getB() || Gamepad.secondary.getDPadUp());\n\n\t\t/*\n\t\t * Secondary Controllers Controls\n\t\t */\n\t\t// Intake controls\n\t\tIntake.intake(Gamepad.secondary.getRightButton()); // runs intake with clicking in the Right Joystick on second controller\n\t\tIntake.intakeSpeed(Gamepad.secondary.getRightY()); // Override Y Button\n\t\tIntake.intakeDirection(Gamepad.secondary.getRightX()); // Override Y Button\n\t\tIntake.intakeJam(Gamepad.secondary.getLB()); // Runs the unjamming procedure for a max of 3 seconds per press\n\t\t// Intake.intakeSafety(Gamepad.secondary.getStart()); //Have to press 3 times to toggle the safety\n\t\tIntake.intakeIn(Gamepad.secondary.getA(), Gamepad.secondary.getB(), Gamepad.secondary.getX()); // Toggles Intake running into the robot at full speed\n\t\tIntake.intakeRun(Gamepad.secondary.getRB()); // Runs all stuff for intake in(conveyor and intake motor)\n//\t\tIntake.intakeOut(Gamepad.secondary.getB());\n\t\t// Climb controls\n\t\tClimb.climbStopSecondary(Gamepad.secondary.getDPadRight()); // runs climbStop using left on the DPad - Secondary\n\t\tClimb.climbStartSecondary(Gamepad.secondary.getDPadLeft()); // runs climbStart using right on the DPad Secondary\n\t\tClimb.climbSafetyToggleSecondary(Gamepad.secondary.getBack()); // Have to press 3 times to toggle the safety\n\n\t\t// Gear controls\n\t\t// Score.gearLock(Gamepad.secondary.getStart(),\n\t\t// Gamepad.secondary.getBack());\n\n\t\t// Outtake Controls\n\t\t// Score.outtakeToggle(Gamepad.secondary.getLB());\n\n\t\t// Conveyor Controls\n\n\t\tScore.conveyor(Gamepad.secondary.getLeftButton()); // runs conveyor with clicking in the Left Joystick on second controller\n\t\tScore.conveyorSpeed(Gamepad.secondary.getLeftY());\n\t\tScore.conveyorDirection(Gamepad.secondary.getLeftX());\n\t\tScore.conveyorIn(Gamepad.secondary.getY());\n\n\t\t// Sweeper\n\t\t// Sweeper.sweeperMotion(Gamepad.secondary.getTriggers());\n\n\t\tDash.driveMode();\n\n\t\tSmartDashboard.putString(\"Controls Table\", NetworkTables.getControlsTable().getKeys().toString());\n\t\tSmartDashboard.putString(\"Stream\", NetworkTables.getControlsTable().getString(\"stream\", \"nothing\"));\n\n\t}", "void cancelProduction();", "@Test\n\tpublic void planeCanLand() {\n\t\ttry {\n\t\t\theathrow.landing(tap);\n\t\t} catch (Exception exception) {\n\n\t\t}\n\t\texpectedPlanes.add(tap);\n\n\t\tassertEquals(expectedPlanes, heathrow.hangar);\n\t\tassertSame(tap, heathrow.hangar.get(0));\n\t}", "@Override\n\tpublic void action() {\n\t\tsuppressed = false;\n\t\tSettings.readState = true;\n\t\tSettings.atStartOfMaze = false;\n\t\tpilot.travel(-5);\n\t\tpilot.rotate(100);\n\t\twhile( pilot.isMoving() && !suppressed );\n\t\tpilot.stop();\n\t}", "private void reconsiderStop(NodeReference position, NodeReference station, IVehicleContext context) {\n NodeReference prev = context.getChargingStop();\n float ar = context.getEV().getActionRadius() / 1000; //convert m to km.\n //float distanceBef = (float) context.calculateRouteReference(position).resolveDistance(context.getGraphReference());\n context.scheduleChargingStop(station);\n float distanceAft = (float) context.calculateRouteReference(position).resolveDistance(context.getGraphReference());\n if (distanceAft > ar) {\n context.scheduleChargingStop(prev);\n }else{\n eventcontroller.publishEvent(\"agent:dmas:reconsider\", \"vehicle\",context.getEV().getVehicleEntity().getVehicleReference().getId());\n }\n }", "public void youWinByAbandonment() {\n try {\n if (getClientInterface() != null)\n getClientInterface().gameEndedByAbandonment(\"YOU WON BECAUSE YOUR OPPONENTS HAVE ABANDONED!!\");\n }\n catch (RemoteException e) {\n System.out.println(\"remote sending ended by abandonment error\");\n }\n }", "public void onFlight() {\r\n }", "@Override\n\tprotected void takeOff(){\n\t\tgvh.log.i(TAG, \"Drone taking off\");\n\t\tsetControlInput(0, 0, 0, 1);\n\t}", "public void radarLostContact() {\n if (status == 1 || status == 18) {\n status = 0;\n flightCode = \"\";\n passengerList = null;\n faultDescription = \"\";\n itinerary = null;\n gateNumber = -1;\n }//END IF\n }", "@Override\n public void stop() {\n\n leftDrive.setPower(0);\n rightDrive.setPower(0);\n armMotor.setPower(0);\n // extendingArm.setPower(0);\n\n telemetry.addData(\"Status\", \"Terminated Interative TeleOp Mode\");\n telemetry.update();\n\n\n }", "public void placePowerStation() {\n this.powerStation = true;\n\n }", "@Override\n public void informPlaneReadyForBoarding() {\n this.lock.lock();\n try {\n // update pilot state\n this.repository.updatePilotState(PilotState.READY_FOR_BOARDING);\n\n // wake up hostess\n this.planeReadyForBoarding = true;\n this.hostessWaitPlaneReadyToTakeOff.signal();\n } finally {\n this.lock.unlock();\n }\n }", "private boolean poleSwitchEngaged(){\n return true; //poleSwitch.get();\n }", "void exitCurrentStationCard();", "public AirCondition(){}", "public void onMissionEnd() {\n\n }", "public void drive(double power_cap, double target_distance, double target_acceleration,\n double target_velocity) {\n TL.resetMotor();\n TR.resetMotor();\n BL.resetMotor();\n BR.resetMotor();\n\n // Required Stop Condition\n int success_count = TL.getSuccess_count();\n\n // \"PID\" Loop\n while((opModeIsActive() && !isStopRequested()) && (success_count < 90)){\n success_count = TL.getSuccess_count();\n // IMU PID STUFF\n imu.imu_iter(0.00000001);\n double imu_correction = imu.getCorrection();\n telemetry.addData(\"IMU Correction -> \", imu_correction);\n telemetry.addData(\"Global Angle ->\", imu.getGlobalAngle());\n if (!MotorPlus.isWithin(0.0195, imu_correction, 0.0)){\n // If correction is needed, we correct the angle\n TL.addExternalResponse(-imu_correction);\n TR.addExternalResponse(imu_correction);\n BL.addExternalResponse(-imu_correction);\n BR.addExternalResponse(imu_correction);\n } else {\n TL.addExternalResponse(0.0);\n TR.addExternalResponse(0.0);\n BL.addExternalResponse(0.0);\n BR.addExternalResponse(0.0);\n }\n\n // Supplying the \"targets\" to the Motors\n TL.actuate(power_cap, target_distance, target_acceleration, target_velocity);\n TR.actuate(power_cap, target_distance, target_acceleration, target_velocity);\n BL.actuate(power_cap, target_distance, target_acceleration, target_velocity);\n BR.actuate(power_cap, target_distance, target_acceleration, target_velocity);\n\n // Telemetry Stuff\n telemetry.addData(\"TL, TR, BL, and BR Vels -> \", TL.getCurrent_velocity());\n telemetry.addData(\"Success Count TL -> \", TL.getSuccess_count());\n telemetry.update();\n }\n }", "public void teleport(boolean penalty) { \n\t\tPublisher teleport_h = new Publisher(\"/ariac_human/go_home\", \"std_msgs/Bool\", bridge);\n\t\tif(penalty)\t\n\t\t\tteleport_h.publish(new Bool(true));\t\n\t\telse\n\t\t\tteleport_h.publish(new Bool(false));\t\n\n\t\t// Reset \"smart\" orientation variables\n\t\tlastHumanState_MsgT = System.currentTimeMillis();\n\t\tlastUnsafeD_MsgT = System.currentTimeMillis();\n\t\tpreviousDistance = 50.0;\n\t\tisAproximating = false;\n\t}", "boolean hasValidIAta(AirportDTO airportDTO);", "public interface PublicTransport {\n /**\n * Returns the target end station of the public transport vehicle.\n *\n * @return target station\n */\n String directsTo();\n\n /**\n * Inverts the direction of transport line (e.g.when the vehicle arrives\n * the end station).\n */\n void changeDirection();\n}", "@Test\n public void alienAttacksNoone() throws FileNotFoundException,\n URISyntaxException, DisconnectedException {\n MatchController matchController = new MatchController() {\n @Override\n public void initMatch(PartyController partyController)\n throws FileNotFoundException, URISyntaxException {\n this.partyController = partyController;\n this.match = new Match();\n this.turnController = new TurnController(this);\n ZoneFactory zf = new TemplateZoneFactory(\n EftaiosGame.DEFAULT_MAP);\n this.zoneController = new ZoneController(zf);\n }\n\n @Override\n public void checkEndGame() {\n }\n\n @Override\n protected void sendTurnViewModel() {\n }\n\n };\n\n PlayerCard alien = new PlayerCard(PlayerRace.ALIEN, null);\n Party party = new Party(\"test\", new EftaiosGame(), false);\n PartyController partyController = PartyController.createNewParty(party);\n party.addToParty(UUID.randomUUID(), \"player1\");\n List<Player> players = new ArrayList<Player>(party.getMembers()\n .keySet());\n Player player1 = players.get(0);\n player1.setIdentity(alien);\n\n matchController.initMatch(partyController);\n Turn turn = new Turn(player1, matchController.getMatch().getTurnCount());\n matchController.getTurnController().setTurn(turn);\n matchController.getTurnController().getTurn().setMustMove(false);\n HexPoint point = HexPoint.fromOffset(1, 1);\n Sector sec = new Sector(null, point);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player1, sec);\n matchController.getTurnController().getTurn().setCanAttack(true);\n ActionRequest action = new ActionRequest(ActionType.ATTACK, null, null);\n // eseguo l'azione\n Attack atk = new Attack() {\n @Override\n protected void notifyInChatByCurrentPlayer(String what) {\n }\n\n @Override\n protected void notifyCurrentPlayerByServer(String what) {\n }\n };\n atk.initAction(matchController, action);\n if (atk.isValid())\n atk.processAction();\n // verifico gli esiti\n assertTrue(player1.getKillsCount() == 0);\n assertTrue(matchController.getZoneController().getCurrentZone()\n .getCell(player1).equals(sec));\n assertTrue(matchController.getMatch().getDeadPlayer().size() == 0);\n }", "public synchronized void prepareNextLeg(int flight, int id) throws SharedException {\n try {\n if (flight + 1 > SimulatorParam.NUM_FLIGHTS) /* check for proper parameter range */\n throw new SharedException(\"Flight cannot exceed the defined parameter for number of flights: \" + flight + \".\");\n } catch (SharedException e) {\n System.out.println(\"Thread \" + ((Thread) Thread.currentThread()).getName() + \"terminated.\");\n System.out.println(\"Error on prepareNextLeg()\" + e.getMessage());\n System.exit(1);\n }\n repo.setPassengerState(id, PassengerState.ENTERING_THE_DEPARTURE_TERMINAL);\n ate.incCntPassengersEnd();\n if (ate.getCntPassengersEnd() == SimulatorParam.NUM_PASSANGERS) {\n ate.wakeUpAll();\n this.wakeUpAll();\n }\n while (!this.timeToWakeUp) {\n try {\n wait();\n } catch (InterruptedException e) {\n\n }\n }\n ate.decCntPassengersEnd();\n if (ate.getCntPassengersEnd() == 0) {\n \t//Waiting for porter and bus driver to fall asleep before changing the passenger state to NO_STATE\n \twhile(ArrivalLounge.b)\n \ttry {\n wait(20);\n } catch (InterruptedException e) {\n System.out.println(e);\n }\n this.timeToWakeUp = false;\n ate.setTimeToWakeUpToFalse();\n if (flight + 1 == SimulatorParam.NUM_FLIGHTS) {\n al.setEndOfWork();\n attq.setEndOfWork();\n }\n }\n repo.setPassengerState(id, PassengerState.NO_STATE);\n }", "public void transport(int startFloor, int endFloor, boolean up){\r\n\t\t\r\n\t\tisIntransit = true;\r\n\t\tdirectionUp = up;\r\n\t\topenDoor(startFloor);\r\n\t\tcloseDoor(startFloor);\r\n\t\t\r\n\t\t//Traverse floor and report.\r\n\t\tint trip = endFloor-startFloor; \r\n\t\tint finalCount = trip*1000;\r\n\t\tint j = 0 ;\r\n\t\televatorAt = startFloor ;\r\n\t\tfor(int i=0; i<finalCount; i++){\t\t\t\r\n\t\t\tj++;\r\n\t\t\tif(j==1000){\r\n\t\t\t\tif(up){\r\n\t\t\t\t\televatorAt++;\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\televatorAt--;\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println(\"Elevator no. \" + id + \" at \"+ elevatorAt);\r\n\t\t\t\tj=0;\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t\r\n\t\tfloorsTraversed += endFloor - startFloor; \r\n\t\ttrips++;\r\n\t\tif(trips==100){\r\n\t\t\tserviccerequired = true; \r\n\t\t}\r\n\t\t\r\n\t\topenDoor(endFloor);\r\n\t\tcloseDoor(endFloor);\r\n\t\t\r\n\t\tisIntransit = false;\r\n\t}", "@Override\r\n\tpublic void teleopPeriodic() {\n\t\t\r\n\t\tmDrive.arcadeDrive(mOI.getY(), mOI.getTwist());\r\n\t}", "public static void main(String[] args) {\n\t\tint grid[][] = new int[][]\n\t\t\t { \n\t\t\t { 1, 1, 0, 0, 0, 0, 1, 0, 0, 0 }, \n\t\t\t { 0, 1, 0, 1, 0, 0, 0, 1, 0, 0 }, \n\t\t\t { 0, 0, 0, 1, 0, 0, 1, 0, 1, 0 }, \n\t\t\t { 1, 1, 1, 1, 0, 1, 1, 1, 1, 0 }, \n\t\t\t { 0, 0, 0, 1, 0, 0, 0, 1, 0, 1 }, \n\t\t\t { 0, 1, 0, 0, 0, 0, 1, 0, 1, 1 }, \n\t\t\t { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, \n\t\t\t { 0, 1, 0, 0, 0, 0, 1, 0, 0, 0 }, \n\t\t\t { 0, 0, 1, 1, 1, 1, 0, 1, 1, 0 } \n\t\t\t };\n\t\t\n // Step 1: Obtain an instance of GridBasedTrafficControl.\n Configurator cfg = new DefaultConfigurator();\n GridBasedTrafficControl gbtc = cfg.getGridBasedTrafficControl(grid);\n\t\t\n\t // Step 2: Obtain path for Journey-1.\n\t Point source1 = new Point(0, 0);\n\t Point dest1 = new Point(3,4);\t \n\t String vehicleId1 = formVehicleId(source1);\n\t List<Point> path1 = gbtc.allocateRoute(vehicleId1, source1, dest1);\n\t System.out.println(\"Route for Journey-1:\" + path1);\n\t \n\t // Step 3: Obtain path for Journey-2.\n\t // This call will not return a route as the available route conflicts with the route\n\t // allocated for Journey-1.\n\t Point source2 = new Point(3, 0);\n\t Point dest2 = new Point(2,4);\n\t String vehicleId2 = formVehicleId(source2);\n\t List<Point> path2 = gbtc.allocateRoute(vehicleId2, source2, dest2);\n\t System.out.println(\"Route for Journey-2:\" + path2);\n\t \n\t // Step 4: Start Journey-1 and mark Journey-1 as complete.\n\t GridConnectedVehicle vehicle1 = new GridConnectedVehicle(vehicleId1, gbtc);\n\t vehicle1.selfDrive(path1);\n\t gbtc.markJourneyComplete(vehicleId1, source1, dest1);\n\t \n\t // Step 5: Retry call to obtain path for Journey-2.\n\t // This call should return a valid path as Journey-1 was marked as complete.\n\t path2 = gbtc.allocateRoute(formVehicleId(source2), source2, dest2);\n\t System.out.println(\"Route for Journey-2:\" + path2);\n\t \n\t // Step 6: Start Journey-2 and mark Journey-2 as complete.\n\t GridConnectedVehicle vehicle2 = new GridConnectedVehicle(vehicleId2, gbtc);\n\t vehicle2.selfDrive(path2);\n\t gbtc.markJourneyComplete(vehicleId2, source2, dest2);\n\t}", "public void setAsDown () \n\t{ \n\t\tn.setFailureState(false);\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}", "public\tvoid stop()\n\t{\t\t\t\t\t\t\t\t\t\n\t\tSystem.out.println(\"Stopping at floor: \"+currentFloor);\n\t\ttotalPassengers = totalPassengers - getTotalPassDestFloor()[currentFloor] ;\n\t\tSystem.out.println(\"Total passengers before boarding passengers waiting on the floor: \" + totalPassengers);\t\t\n\t\tF[currentFloor].unloadPassengers(this);\t\t\t\t\t\t\t\t\t\t\t\t//Calls unloadPassenges method to handle the passengers \n\t\tthis.registerRequest();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//registers request for the appropriate flooors\n\t\tSystem.out.println(this);\n\t//\tSystem.out.println();\n\t\tSystem.out.println(this.F[currentFloor]);\n\t\tSystem.out.println();\n\t}", "public void powerOff() { //power_off\n String json = new Gson().toJson(new TelevisionModel(TelevisionModel.Action.OFF));\n String a = sendMessage(json);\n TelevisionModel teleM = new Gson().fromJson(a, TelevisionModel.class);\n System.out.println(\"Client Received \" + json);\n\n if (teleM.getAction() == TelevisionModel.Action.OFF) {\n isTurningOff = teleM.getValue();\n ui.updateArea(teleM.getMessage());\n }\n }" ]
[ "0.63177854", "0.60385925", "0.59353954", "0.5795577", "0.57936597", "0.56520575", "0.564721", "0.5641962", "0.5628323", "0.5622062", "0.56176335", "0.5602935", "0.54999375", "0.54988736", "0.5493202", "0.54853326", "0.5483619", "0.5475948", "0.54755783", "0.547491", "0.54704237", "0.54512763", "0.5440218", "0.5419974", "0.5415857", "0.53841066", "0.53735024", "0.53602093", "0.5346463", "0.5336005", "0.53357553", "0.53225", "0.5321019", "0.5298935", "0.5288148", "0.526895", "0.525916", "0.52579486", "0.52578413", "0.5253203", "0.5240835", "0.52333266", "0.523158", "0.52297664", "0.52286136", "0.52267104", "0.5221023", "0.52208936", "0.52206117", "0.52184796", "0.5210342", "0.5197633", "0.519745", "0.5197243", "0.5196098", "0.519313", "0.5191185", "0.5189421", "0.5182064", "0.5179828", "0.51748806", "0.51625836", "0.51619595", "0.5161941", "0.515792", "0.51425165", "0.5141419", "0.51324993", "0.5122072", "0.51172197", "0.51155436", "0.511427", "0.5113859", "0.5104349", "0.5099979", "0.5099274", "0.5097364", "0.50886464", "0.5083741", "0.50757915", "0.5071882", "0.50684196", "0.50623184", "0.50603217", "0.50586987", "0.50534064", "0.50523645", "0.50498104", "0.5048191", "0.50443286", "0.5043204", "0.5040524", "0.50402987", "0.5026122", "0.50259966", "0.5020725", "0.50192827", "0.50175375", "0.50150114", "0.5009544" ]
0.5947738
2
As an air traffic controller To ensure safety I want to prevent landing when the airport is full
@Test public void landingPreventedWhenFull() throws Exception { Exception e = new Exception(); try { heathrow.landing(tap); heathrow.landing(ba); } catch (Exception exception) { e = exception; } assertEquals("Airport is full", e.getMessage()); assertEquals(heathrow.capacity, heathrow.hangar.size()); assertEquals(1, heathrow.hangar.size()); assertEquals(-1, heathrow.hangar.indexOf(ba)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isSeatAllReserved() {\n return airplane.isFull();\n }", "public void noFlights();", "private void travelToAirport()\n {\n try\n { sleep ((long) (1 + 30000 * Math.random ()));\n }\n catch (InterruptedException e) {}\n }", "public boolean takeControl() {\n\t\tif (Squirrel.us.getDistance() <= 30 && Squirrel.notDetected)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public void restrictAcceleration() {\n\t\tif (acceleration.x > MAX_ACCELERATION.x)\r\n\t\t\tacceleration.x = MAX_ACCELERATION.x;\r\n\t\tif (acceleration.y > MAX_ACCELERATION.y)\r\n\t\t\tacceleration.y = MAX_ACCELERATION.y;\r\n\t\t\r\n\t\t// Caps Deceleration at Max Deceleration.\r\n\t\tif (acceleration.x < MAX_DECELERATION.x)\r\n\t\t\tacceleration.x = MAX_DECELERATION.x;\r\n\t\tif (acceleration.y < MAX_DECELERATION.y)\r\n\t\t\tacceleration.y = MAX_DECELERATION.y;\r\n\t}", "void nearingTheWallBefore(){\n robot.absgyroRotation(0, \"absolute\");\n\n //alligning with the wall before going for the toy\n while(robot.leftDistanceSensor.getDistance(DistanceUnit.CM) > 15 && !isStopRequested()){\n if(robot.leftDistanceSensor.getDistance(DistanceUnit.CM) < 30)\n robot.mecanumMovement(0, .3, 0);\n else\n robot.mecanumMovement(0, .7, 0);\n\n telemetry.addLine(\"Distance from sensor: \" + robot.leftDistanceSensor.getDistance(DistanceUnit.CM));\n telemetry.update();\n }\n robot.mecanumMovement(0, 0, 0);\n\n robot.absgyroRotation(45, \"absolute\");\n }", "@Override\n\tprotected void land(){\n\t\tgvh.log.i(TAG, \"Drone landing\");\n\t\t//setControlInput(my_model.yaw, 0, 0, 5);\n\t}", "@NotNull\n boolean isTrustedWholeLand();", "boolean CanBuyRoad();", "@Override\n\tpublic void canLand() {\n\t\tSystem.out.println(\"IF IM IN THE SKY, I CANT LAND. BY THE OMNISSIAH\");\n\t}", "private void releaseAirfield() {\n\t\tlandedAirfield.setOccupied(false);\n\t}", "@Override\n public void onRequestNotFilled(AdColonyZone zone) {\n notifyFailed(\"no_fill\");\n }", "@Override\r\n\tpublic void cruise() {\n\t\tSystem.out.println(\"In SeaPlane::cruise\");\r\n\t\tif (altitude < 10) \r\n\t\t\tSail.super.cruise();\r\n\t\telse\r\n\t\t\tFastFly.super.cruise();\r\n\t}", "@Test\n\tpublic void preventLandingWhenStormyWeather() {\n\t\tException exception = new Exception();\n\n\t\ttry {\n\t\t\twhen(weatherMock.getWeather()).thenReturn(\"stormy\");\n\t\t\theathrow.landing(tap);\n\t\t} catch (Exception e) {\n\t\t\texception = e;\n\t\t}\n\n\t\tassertEquals(\"Not allowed to land in stormy weather\", exception.getMessage());\n\t\tassertEquals(0, heathrow.hangar.size());\n\n\t}", "public boolean isOverSpeed(){ return vehicleAvarageSpeed > roadMaxSpeed; }", "boolean isInAir() {\n return inAir;\n }", "@Override\n\tpublic boolean isDanger() {\n\t\tSharedPreferences prefs = NotificationStack.context.getSharedPreferences(\"com.app.virtualguardian\", Context.MODE_PRIVATE); \n\t\tint distancia=pingGps(Latitud,Longitud);\n\t\tint distanciaAuto=pingCar();\n\t\tint maxPer = Integer.parseInt(prefs.getString(\"distanciaPersonal\",\"3000\")); \n\t\tint maxCar = Integer.parseInt(prefs.getString(\"distanciaAuto\",\"3000\"));\n\t\tif(distancia<=maxPer){\n\t\t\t//avisaamigos\n\t\t\tavisaAmigos(distancia);\n\t\t}\n\t\tif(distanciaAuto<=maxCar){\n\t\t\t//avisaauto\n\t\t\tavisaAuto(distanciaAuto);\n\t\t}\n\t\tif(distancia<=maxPer || distanciaAuto<=maxCar)return true;\n\t\treturn false;\n\t}", "void toggleInAir() {\n inAir = !inAir;\n }", "@Override\n\t\t\t\tpublic void action() {\n\t\t\t\t\t\tRandom r = new Random();\n\t\t\t\t\t\tint Low = 1;\n\t\t\t\t\t\tint High = 999;\n\t\t\t\t\t\tint Result = r.nextInt(High-Low) + Low;\n\t\t\t\t\t\tACLMessage msg = new ACLMessage(ACLMessage.REQUEST);\n\t\t\t\t\t\tmsg.setOntology(\"AirConditioner\");\n\t\t\t\t\t\tmsg.addReceiver(new AID(\"da\", AID.ISLOCALNAME));\n//\t\t\t\t\t\tif (Result % 2 == 0){\n//\t\t\t\t\t\t\t//humid mode\n//\t\t\t\t\t\t\tmsg.setContent(\"humid\");\n//\t\t\t\t\t\t\tSystem.out.println(\"Agent \"+ myAgent.getLocalName() + \": operating mode: humid\" );\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\telse if((Result % 3 == 0)) {\n//\t\t\t\t\t\t\t//mid\n//\t\t\t\t\t\t\tmsg.setContent(\"mid\");\n//\t\t\t\t\t\t\tSystem.out.println(\"Agent \"+ myAgent.getLocalName() + \": operating mode: mid\" );\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\telse if((Result % 5 == 0)) {\n//\t\t\t\t\t\t\t//high\n//\t\t\t\t\t\t\tmsg.setContent(\"mid\");\n//\t\t\t\t\t\t\tSystem.out.println(\"Agent \"+ myAgent.getLocalName() + \": operating mode: high\" );\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\telse {\n//\t\t\t\t\t\t\t//low\n//\t\t\t\t\t\t\tmsg.setContent(\"mid\");\n//\t\t\t\t\t\t\tSystem.out.println(\"Agent \"+ myAgent.getLocalName() + \": operating mode: low\" );\n//\t\t\t\t\t\t}\n\t\t\t\t\t\tmsg.setContent(Airconditioner_Agent.mode);\n\t\t\t\t\t\tSystem.out.println(\"Agent \"+ myAgent.getLocalName() + \": operating mode: \"+Airconditioner_Agent.mode );\n\t\t\t\t\t\tmyAgent.send(msg);\n\t\t\t\t\t}", "@Test\n\tpublic void preventTakeOffWhenStormyWeather() {\n\t\tException exception = new Exception();\n\n\t\ttry {\n\t\t\theathrow.landing(tap);\n\t\t\t// airport instance return stormy weather\n\t\t\twhen(weatherMock.getWeather()).thenReturn(\"stormy\");\n\t\t\theathrow.takeoff(tap);\n\t\t} catch (Exception e) {\n\t\t\texception = e;\n\t\t}\n\n\t\tassertEquals(\"Not allowed to takeoff in stormy weather\", exception.getMessage());\n\t\tassertEquals(1, heathrow.hangar.size());\n\t}", "public void setAllowFlight ( boolean flight ) {\n\t\texecute ( handle -> handle.setAllowFlight ( flight ) );\n\t}", "boolean canFall();", "@Override\n protected boolean shouldRouteByProfileAccount() {\n return getBlanketTravel() || !getTripType().isGenerateEncumbrance() || hasOnlyPrepaidExpenses();\n }", "public void chechPortaitAndLandSacpe() {\n if (CompatibilityUtility.isTablet(BecomeHostActivity.this)) {\n setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);\n } else {\n setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);\n }\n }", "public void action() {\r\n\t\tLCD.drawString(\"Avoid Behavior!\", 0, 7);\r\n\r\n\t\tMapUpdate.updateWithoutObject(0);\r\n\t\tMapUpdate.updateWithObject(StandardRobot.us.getRange());\r\n\r\n\t\tif (StandardRobot.ts.isPressed()) {\r\n\t\t\tStandardRobot.pilot.setTravelSpeed(7);\r\n\t\t\tStandardRobot.pilot.travel(-5);\r\n\t\t\tcounter.countTravel();\r\n\r\n\t\t\tif (store.getFlag() == 0) {\r\n\t\t\t\tStandardRobot.pilot.rotate(-90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t} else {\r\n\t\t\t\tStandardRobot.pilot.rotate(90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\tif (store.getFlag() == 0) {\r\n\t\t\t\tStandardRobot.pilot.rotate(-90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t} else {\r\n\t\t\t\tStandardRobot.pilot.rotate(90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void landOrTakeoff(String land_or_takeoff) {\n\t\ttry {\n\t\tthis.baggage = Integer.valueOf(land_or_takeoff);\n\t\tthis.isLanding = true;\n\t\t}catch(NumberFormatException e) {\n\t\t\tthis.isLanding = false;\n\t\t\tthis.destination = land_or_takeoff;\n\t\t}//catch\n\t}", "@Override\n public void robotPeriodic() {\n\n boolean c = mGPM.haveCargo();\n \n // Need signal due to distance for assurance that cargo is obtained/\n if (c) {\n CargoLight.set(Value.kOn);\n } else{\n CargoLight.set(Value.kOff);\n }\n }", "private boolean validAdd(Flight flight) {\n double stopOverTime = getStopOverTime(flight);\n return (destination.equals(flight.getOrigin()) \n && stopOverTime <= 6 && stopOverTime >= 0 /*= 0 creates error*/\n && !(places.contains(flight.getDestination())));\n }", "@Override\n\tpublic boolean takeControl() {\n\t\treturn (Math.abs(Motor.A.getTachoCount() - Settings.motorAAngle) > 5 || (Motor.A.getTachoCount() == 0 && Settings.motorAAngle == -90));\n\t}", "private synchronized void canAccessStreet() {\n checkRequiredSemaphores();\n for (Semaphore semaphore : requiredSemaphores) {\n try {\n semaphore.acquire();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n System.out.println(\"Car with [\" + car.start + \" to \" + car.end + \"] wanna pass the intersection.\");\n// try {\n// Thread.sleep(1000*requiredSemaphores.size());\n// } catch (InterruptedException e) {\n// e.printStackTrace();\n// }\n System.out.println(\"Car with [\" + car.start + \" to \" + car.end + \"] passes safely\");\n for (Semaphore semaphore : requiredSemaphores) {\n semaphore.release();\n }\n }", "public abstract void onLand(Player player);", "private void changeDirectionIfReachedPacingAreaMax()\n {\n int totalDistance = Math.abs(xTotalDistance);\n\n if (totalDistance > this.currentDistance)\n {\n this.nextDirection();\n //this.isFollowLimitedByTerrain = false;\n }\n }", "private void doWiperAvailabiltiyCheck()\n {\n // Hardcode for now to make sure WPS is not triggered\n bWiperAvailable = true;\n\n mWifi = (WifiManager)getSystemService(mContext.WIFI_SERVICE);\n\n if ((mWifi == null) || ( (locationManager == null)|| ((locationProvider = locationManager.getProvider(LocationManager.NETWORK_PROVIDER )) == null)))\n {\n Log.e(TAG,\" Disable wiper : No object for WPS / Wifi Scans \");\n bWiperAvailable = false;\n }\n\n\n // call native function to trigger RPC from A11-> A9\n // informing about WPS capability\n //\n native_notify_wiper_available(bWiperAvailable);\n\n if (Config.LOGV)\n {\n Log.v(TAG, \"Wiper: Availability Check \"+ bWiperAvailable);\n }\n }", "public abstract boolean isRestricted();", "public AirCondition(){}", "private void cs8() {\n\t\t\t\n\t\n\t\t\tif(new Tile(3088,3092,0).matrix(ctx).reachable()){\n\t\t\t\t\n\t\t\t\tif(new Tile(3079,3084,0).distanceTo(ctx.players.local().tile())<7){\n\t\t\t\t\tMethod.interactO(9709, \"Open\", \"Door\");\n\t\t\t\t}else ctx.movement.step(new Tile(3079,3084,0));\n\t\t\t\t\n\t\t\t}else if(new Tile(3090,3092,0).distanceTo(ctx.players.local().tile())<7){\n\t\t\t\tfinal int[] bounds = {140, 108, -84, 144, -64, 136};\n\t\t\t\tGameObject gate = ctx.objects.select().id(GATEBYFISH).each(Interactive.doSetBounds(bounds)).select(Interactive.areInViewport()).nearest().poll();\n\t\t\t\tgate.interact(\"Open\",\"\");\n\t\t\t}else ctx.movement.step(new Tile(3090,3092,0));\n\t\t\t\n\t\t\t\n\t\t}", "public void updateDeviceAir(){\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.add(Calendar.DATE, -1);\n\t\tDate date = calendar.getTime();\n\t\tDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\tString time = df.format(date);\n\t\t\n\t\tHashMap<String, Integer> insideMap = deviceStatusDao.getAverageInside(time + \"%\");\n\t\tHashMap<String, Integer> outsideMap = deviceStatusDao.getAverageOutside(time + \"%\");\n\t\t//pair device air & city air\n\t\tfor(String device_id : insideMap.keySet()){\n\t\t\tDeviceAir deviceAir = new DeviceAir();\n\t\t\tdeviceAir.setDeviceID(device_id);\n\t\t\tdeviceAir.setInsideAir(insideMap.get(device_id));\n\t\t\tif(!outsideMap.containsKey(device_id)){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdeviceAir.setOutsideAir(outsideMap.get(device_id));\n\t\t\tdeviceAir.setDate(time);\n\t\t\tdeviceStatusDao.insertDeviceAir(deviceAir);\n\t\t}\n\t}", "boolean UnlockedEscapeTheIsland() {\n if (allMissions.missionStatus.get(\"Escape the island\") == true) {\n return false;\n }\n return true;\n }", "public void liftArm(){armLifty.set(-drivePad.getThrottle());}", "private void dealWithDeadEnd(MyAIController controller) {\n\t\tWorldSpatial.Direction orientation = controller.getOrientation();\n\t\tCoordinate pos = new Coordinate(controller.getPosition());\n\n\t\t// Check the space on left and right of the car\n\t\tint spaceOnRight = map.spaceInDirection(pos, orientation,\n\t\t\t\tWorldSpatial.RelativeDirection.RIGHT);\n\t\tint spaceOnLeft = map.spaceInDirection(pos, orientation,\n\t\t\t\tWorldSpatial.RelativeDirection.LEFT);\n\n\t\t// Perform turning actions based on space available\n\t\tif (spaceOnRight > 1) {\n\t\t\tcontroller.performUTurn(WorldSpatial.RelativeDirection.RIGHT);\n\t\t\tstate = ExplorerState.JUST_TURNED_LEFT;\n\t\t} else if (spaceOnRight >= 0 && spaceOnLeft >= 1) {\n\t\t\tcontroller.performThreePointTurn(WorldSpatial.RelativeDirection.RIGHT);\n\t\t\tstate = ExplorerState.JUST_TURNED_LEFT;\n\t\t} else {\n\t\t\tjustReversed = true;\n\t\t\tcontroller.toggleReverseMode();\n\t\t}\n\t}", "public Airplane (){\n \n }", "private boolean capacityController(Arrival newArrival) {\n int[] duration = calculateDuration(newArrival);\n for (int i = duration[0]; i <= duration[1]; i++) {\n if (this.parentTrainStation.getMaxCapacity() <= capacityArray[i]) {\n return false;\n }\n }\n for (int i = duration[0]; i <= duration[1]; i++) {\n capacityArray[i]++;\n }\n return true;\n }", "@Test\n\tpublic void planeCanTakeOff() {\n\t\ttry {\n\t\t\theathrow.landing(tap);\n\t\t} catch (Exception exception) {\n\n\t\t}\n\n\t\ttry {\n\t\t\theathrow.takeoff(tap);\n\t\t} catch (Exception exception) {\n\n\t\t}\n\n\t\tassertEquals(expectedPlanes, heathrow.hangar);\n\t\tassertTrue(heathrow.hangar.isEmpty());\n\t}", "public void chechPortaitAndLandSacpe() {\n if (CompatibilityUtility.isTablet(BecomeHostLoginActivity.this)) {\n\n setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);\n } else {\n\n setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);\n }\n }", "private final void maintain(){\n\t\tif(host.getStrength()>MAINTENANCE_COST){\n\t\t\thost.expend(MAINTENANCE_COST);\n\t\t}\n\t\telse{\n\t\t\tkill();\n\t\t}\n\t}", "@Override\n protected void execute() {\n if(!Robot.SCISSOR.getFloorSensor() && speed < 0) {\n Robot.SCISSOR.liftRobotPnumatic(false);\n }\n }", "private void visionDrive(double throttle) {\n if(limelight.isValidTarget()) {\n// DriverStation.reportWarning(\"\"+SmartDashboard.getNumber(\"Vision P\", Constants.visionDriveP),false);\n// visionDrive.setP(SmartDashboard.getNumber(\"Vision P\", Constants.visionDriveP));\n// visionDrive.setI(SmartDashboard.getNumber(\"Vision I\", Constants.visionDriveI));\n// visionDrive.setD(SmartDashboard.getNumber(\"Vision D\", Constants.visionDriveD));\n// visionDrive.setMaxIOutput(.225);\n double error = limelight.getCenter().x;\n double output = Constants.outsideP * -error;\n if(Math.abs(error) < 4) {\n// SmartDashboard.putString(\"In PID?\", \"PID\");\n output = visionDrive.getOutput(error);\n left.set(ControlMode.PercentOutput, throttle - output);\n right.set(ControlMode.PercentOutput, throttle + output);\n// SmartDashboard.putNumber(\"PID Output\", output);\n }\n else if(Math.abs(error) < 7 && Math.abs(error) > 2){\n double val = .2;\n if (error < 0){\n// SmartDashboard.putString(\"In PID?\", \"1\");\n left.set(ControlMode.PercentOutput, -val);\n right.set(ControlMode.PercentOutput, val);\n }\n else if (error > 0){\n// SmartDashboard.putString(\"In PID?\", \"2\");\n left.set(ControlMode.PercentOutput, val);\n right.set(ControlMode.PercentOutput, -val);\n }\n }\n else if (error < 0){\n// SmartDashboard.putString(\"In PID?\", \"3\");\n left.set(ControlMode.PercentOutput, -.25);\n right.set(ControlMode.PercentOutput, .25);\n }\n else if (error > 0){\n// SmartDashboard.putString(\"In PID?\", \"4\");\n left.set(ControlMode.PercentOutput, .25);\n right.set(ControlMode.PercentOutput, -.25);\n }\n\n SmartDashboard.putNumber(\"Error\", error);\n } else {\n visionDrive.reset();\n setOutput(0, 0);\n }\n }", "public void flightDisappear();", "public void confirmFlight();", "@Override\n public boolean activate() {\n //When will this activate?\n return Areas.FALADOR.contains(ctx.players.local().tile())\n && ctx.widgets.component(1371,0).visible()\n && !ctx.objects.select().name(\"Waterpump\").within(6.0).isEmpty();\n }", "@Test\r\n\tpublic void testDeliveryChuteFull() {\r\n\t\tdcListen.chuteFull(vend.getDeliveryChute());\r\n\t\tassertTrue(vend.getDeliveryChute().isDisabled());\r\n\t}", "public synchronized boolean canWatch() {\n\t\t//boolean to keep track of theater vacancy \n\t\tboolean enterStatus;\n\t\t//when the movie is in session or the theater is full we can't enter\n\t\tif(Clock.isInSession ||Driver.currentVisitors == 8) { \n\t\t\tenterStatus = false;\n\t\t}else {\n\t\t\tenterStatus = true;\n\t\t}\n\t\treturn enterStatus;\n\t}", "@Override\n\tpublic void canTakeOff() {\n\t\tSystem.out.println(\"I CANNOT TAKE OFF UNLESS YA JUMP ME OVER SOMMAT\");\n\t}", "@Override\n public void handleEvent(VehicleEntersTrafficEvent event) {\n if (!event.getNetworkMode().equals(\"car\")) {\n if( nonCarWarn <=1) {\n logger.warn(\"non-car modes are supported, however, not properly tested yet.\");\n logger.warn(Gbl.ONLYONCE);\n nonCarWarn++;\n }\n }\n Id<Link> linkId = event.getLinkId();\n Id<Vehicle> vehicleId = event.getVehicleId();\n double startEngineTime = event.getTime();\n this.vehicleId2coldEmissionEventLinkId.put(vehicleId, linkId);\n\n double parkingDuration;\n if (this.vehicleId2stopEngineTime.containsKey(vehicleId)) {\n double stopEngineTime = this.vehicleId2stopEngineTime.get(vehicleId);\n parkingDuration = startEngineTime - stopEngineTime;\n\n } else { //parking duration is assumed to be at least 12 hours when parking overnight\n parkingDuration = 43200.0;\n }\n this.vehicleId2parkingDuration.put(vehicleId, parkingDuration);\n this.vehicleId2accumulatedDistance.put(vehicleId, 0.0);\n\n Vehicle vehicle = vehicles.getVehicles().get(vehicleId);\n\n this.coldEmissionAnalysisModule.calculateColdEmissionsAndThrowEvent(\n linkId,\n vehicle,\n startEngineTime,\n parkingDuration,\n 1\n );\n }", "@Override\n\tpublic boolean canPassengerSteer() {\n\t\treturn false;\n\t}", "protected boolean isMovementNoisy() {\n/* 1861 */ return (!this.abilities.flying && (!this.onGround || !isDiscrete()));\n/* */ }", "@Test(expected=RuntimeException.class)\n\tpublic void testWarm_DetailedThenTechnologyAverageElseAbort_ShouldAbort() {\n\t\tEmissionModule emissionModule = setUpScenario(EmissionsConfigGroup.DetailedVsAverageLookupBehavior.onlyTryDetailedElseAbort);\n\n\t\tdouble travelTimeOnLink = 21; //sec. approx freeSpeed of link12 is : (200 m) / (9.72.. m/s) approx 20.57 s\n\t\temissionModule.getWarmEmissionAnalysisModule().checkVehicleInfoAndCalculateWarmEmissions(vehicleFallbackToAverageTable, link, travelTimeOnLink);\n\t}", "public void placePowerStation() {\n this.powerStation = true;\n\n }", "private static boolean runAway(Critter foo){\n\t\tif(foo.moved) {\n\t\t\tfoo.energy = foo.getEnergy() - Params.walk_energy_cost;\n\t\t\tif (foo.getEnergy() <= 0) {\n\t\t\t\tfoo.isAlive=false;\n\t\t\t}\n\t\t\treturn false;\n\t\t} else {\n\t\t\tint dir = getRandomInt(8);\n\t\t\tif(canMove(foo, dir)) {\n\t\t\t\tfoo.walk(dir);\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\tfoo.energy = foo.getEnergy() - Params.walk_energy_cost;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public void autonomous() {\n robot.drive(0.5); //Drives in a square\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n }", "void steady_flight_at_given_speed (double step, double start_pitch) {\n // preamble: make sure inputs are in\n //computeFlowAndRegenPlotAndAdjust();\n\n //strut.aoa = 0.5; // ad hoc\n\n recomp_all_parts();\n\n double load = FoilBoard.this.load;\n\n // now moved into load box and bar \n //rider.weight = load - BOARD_WEIGHT - RIG_WEIGHT - FOIL_WEIGHT;\n\n steady_flight_at_given_speed___ok = false; // so far util done\n\n craft_pitch = start_pitch;\n // double prev_pitch = -20; // we nned it only because pitch value gets rounded somewhere in recomp_all_parts...\n while (craft_pitch < aoa_max && craft_pitch > aoa_min) {\n //computeFlowAndRegenPlotAndAdjust();\n recomp_all_parts();\n double lift = foil_lift();\n if (lift == load // exact hit, done !(almost never happens, though)\n // happens due to rounding\n // || prev_pitch == craft_pitch\n ) \n break;\n if (step > 0 && lift > load) { // done or pivot\n if (step < 0.0025) { \n // done! flight is OK\n steady_flight_at_given_speed___ok = true;\n break;\n }\n step = -step/2; // shrink step & pivot\n } else if (step < 0 && lift < load) { \n step = -step/2; // shrink step & pivot\n } // else keep going with current stepa\n // prev_pitch = craft_pitch;\n craft_pitch += step;\n }\n\n // expect small increse in drag as the result\n vpp.set_mast_aoa_for_given_drag(total_drag()); // (wing.drag+stab.drag);\n recomp_all_parts();\n\n // old linearly increasing logic \n //find_aoa_of_min_drag();\n //if (foil_lift() > load_numeric) {\n // // need to reduce AoA\n // while (craft_pitch > aoa_min) {\n // craft_pitch -= 0.1;\n // System.out.println(\"-- reducing... craft_pitch: \" + craft_pitch);\n // computeFlowAndRegenPlotAndAdjust();\n // recomp_all_parts();\n // if (foil_lift() <= load_numeric) \n // break; // done\n // } \n //}\n //else if (foil_lift() < load_numeric) {\n // // need to increase AoA\n // while (craft_pitch < aoa_max) {\n // craft_pitch += 0.1;\n // System.out.println(\"-- increasing... craft_pitch: \" + craft_pitch);\n // computeFlowAndRegenPlotAndAdjust();\n // recomp_all_parts();\n // if (foil_lift() >= load_numeric) \n // break; // done\n // } \n //}\n\n }", "private static void turnAwayFromWall() {\n while (true) {\n if (readUsDistance() > OPEN_SPACE) {\n leftMotor.stop();\n rightMotor.stop();\n // re-calibrate theta, offset will be added to this angle\n odometer.setTheta(0);\n System.out.println(\"starting localization...\");\n prevDist = 255;\n dist = prevDist;\n break;\n }\n }\n }", "public void sendToOutpatients(){\r\n\t\t//here is some code that we do not have access to\r\n\t}", "public boolean affordRoad() {\n \t\treturn (FREE_BUILD || roads.size() < MAX_ROADS\n \t\t\t\t&& getResources(Type.BRICK) >= 1\n \t\t\t\t&& getResources(Type.LUMBER) >= 1);\n \t}", "@Override\n public boolean activate() {\n // We only want to go to the bank if our inventory is full and we aren't already there.\n return Mining.isInvFull() && !Constants.BANK_AREA.contains(Players.getLocal());\n }", "public void doLimitBreach(Gamepad gamepad) {\n\t\tenablePID(false);\n\t\n\t\tif (gamepad.getTrigger(Constants.BUTTON_LT)) {\n\t\t\tif (stringPot.get() < Constants.BreachArm.STRINGPOT_MIN) {\n\t\t\t\tcanBreach.set(-breachSpeed);\n\t\t\t\tisBreaching = true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcanBreach.set(0);\n\t\t\t\tisBreaching = false;\n\t\t\t}\n\t\t\t\n\t\t} else if (gamepad.getTrigger(Constants.BUTTON_RT)) {\n\t\t\tif (stringPot.get() > Constants.BreachArm.STRINGPOT_MAX) {\n\t\t\t\tcanBreach.set(breachSpeed);\n\t\t\t\tisBreaching = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcanBreach.set(0);\n\t\t\t\tisBreaching = false;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tcanBreach.set(0);\n\t\t\tisBreaching = false;\n\t\t}\n\n\t\tSmartDashboard.putNumber(\"Breach-breachSpeed\", breachSpeed);\n\t\tSmartDashboard.putBoolean(\"Breach-isBreaching?\", isBreaching);\n\t\tSmartDashboard.putNumber(\"String Pot\", stringPot.get());\n\t}", "void setMaxActiveAltitude(double maxActiveAltitude);", "public boolean canSurf()\n\t{\n\t\treturn getTrainingLevel() >= 25;\n\t}", "private boolean check_vicinity(FishTankItem TankItem) {\r\n if (getDirection()) {\r\n return 0 <= (TankItem.firstCoordinate - this.firstCoordinate)\r\n && (TankItem.firstCoordinate - this.firstCoordinate) <= 7;\r\n } else {\r\n return 0 <= (this.firstCoordinate - TankItem.firstCoordinate)\r\n && (this.firstCoordinate - TankItem.firstCoordinate) <= 5;\r\n }\r\n }", "public void land() {\n Game currentGame = this.getGame();\n this.setHasBeenVisited(true);\n currentGame.setMode( Game.Mode.GAME_WON);\n\n }", "public boolean isOnLand() {\r\n\t\treturn isOnLand;\r\n\t}", "@Override\n public void teleopPeriodic() {\n Scheduler.getInstance().run();\n SmartDashboard.putNumber(\"right encoder\", drive.getRightEncoder());\n SmartDashboard.putNumber(\"left encoder\", drive.getLeftEncoder());\n \n PixyCamBlock centerBlock = PixyCam2.GetCentermostBlock();\n boolean targetInRange = false ;\n \n if(centerBlock == null)\n {\n targetInRange = false;\n SmartDashboard.putString(\"center block data \", \"null\"); \n }\n else if(centerBlock.yCenter < 200)\n {\n targetInRange = true;\n String out = \"Center Block, X: \"+centerBlock.xCenter + \" Y: \"+centerBlock.yCenter;\n SmartDashboard.putString(\"center block data \", out); \n }\n\n String targetValue = Boolean.toString(targetInRange);\n SmartDashboard.putString(\"target good?\", targetValue);\n \n \n SmartDashboard.putBoolean(\"isFlipped\", flipped);\n }", "public boolean C_enterTheZone(ListOfParameterLists parameterLists){\n //if(isEnter == true){\n if(debug)\n System.out.println(\"Condition from Rule7 :: is true\");\n\n\n return true;\n\n // }\n // else\n //return false;\n\n // Future work\n // Put the condition code here, eg. if the track is friendly, we\n // don't need to alert the analyst.\n\n }", "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 cancelRoadLength() {\n \t\troadLength = 0;\n \t}", "public Boolean IsIOtrminate() {\n Random r = new Random();\n int k = r.nextInt(100);\n //20%\n if (k <= 20) {\n return true;\n }\n return false;\n }", "@Test\n\tpublic void planeCanLand() {\n\t\ttry {\n\t\t\theathrow.landing(tap);\n\t\t} catch (Exception exception) {\n\n\t\t}\n\t\texpectedPlanes.add(tap);\n\n\t\tassertEquals(expectedPlanes, heathrow.hangar);\n\t\tassertSame(tap, heathrow.hangar.get(0));\n\t}", "public boolean isGateFull(){return GateFull;}", "boolean canSnowFallOn();", "@Override\n public void verifyAirInformationPage() {\n String currentURL = getWebdriverInstance().getCurrentUrl();\n if (!currentURL.contains(\"flight-information\")) {\n throw new org.openqa.selenium.NotFoundException(\"Was expecting to be on SEO flight information page\" +\n \" but was on\" + currentURL);\n }\n }", "public Airplane(){\n\t\tsuper(106, 111);\n\t\tspeed = Math.random() + 2.0;\n\t}", "@Override\n public void robotPeriodic() {\n double high = m_filter.calculate(m_photoHigh.getValue());// * kValueToInches;\n double low = m_filter.calculate(m_photoLow.getValue()); //* kValueToInches;\n if (low<=6){\n BallPresent = true;\n //stop motor if ultrasonic sensor median falls below 6 inches indicating a ball is blocking the sensor\n m_RightMotor.set(ControlMode.PercentOutput, 0);\n } else {\n BallPresent = false;\n //stop motor if ultrasonic sensor median falls below 6 inches indicating a ball is blocking the sensor\n m_RightMotor.set(ControlMode.PercentOutput, 0.5);\n }\n /*Shuffleboard.getTab(\"Shooter\").add(\"Ball Present\", BallPresent)\n .withWidget(BuiltInWidgets.kBooleanBox)\n .withPosition(0, 0)\n .withSize(1, 1)\n .withProperties(Map.of(\"colorWhenTrue\",\"green\",\"colorWhenFalse\",\"black\"));*/\n SmartDashboard.putNumber(\"High\", high);\n SmartDashboard.putNumber(\"Low\", low); \n /*Shuffleboard.getTab(\"Shooter\").add(\"Ultrasonic 1\", currentDistance)\n .withWidget(BuiltInWidgets.kGraph)\n .withPosition(0, 2)\n .withSize(4, 4);*/\n // convert distance error to a motor speed\n //double currentSpeed = (kHoldDistance - currentDistance) * kP;\n\n // drive robot\n //m_robotDrive.arcadeDrive(currentSpeed, 0);\n }", "public void action() {\r\n\t\tsuppressed = false;\r\n\t\tMotor.B.stop();\r\n\t\tMotor.C.stop();\r\n\t\tDelay.msDelay(1000);\r\n\t\tMotor.B.setSpeed(180);\r\n\t\tMotor.C.setSpeed(180);\r\n\t\tMotor.B.forward();\r\n\t\tMotor.C.forward();\r\n\t\tif((light.getLightValue()>46 && light.getLightValue()<49) || (light.getLightValue()>27 && light.getLightValue()<31)){\r\n\t\t\tMotor.B.stop();\r\n\t\t\tMotor.C.stop();\r\n\t\t\tDelay.msDelay(500);\r\n\t\t\tMotor.B.forward();\r\n\t\t\tMotor.C.forward();\r\n\t\t\tif(light.getLightValue()>44 && light.getLightValue()<45){//home base\r\n\t\t\t\tMotor.B.stop();\r\n\t\t\t\tMotor.C.stop();\r\n\t\t\t}\r\n\t\t}\r\n\t\twhile(!suppressed){\r\n\t\t\tThread.yield();\r\n\t\t}\r\n\t}", "private void fallDetection(double acceleration){\n \n switch (state){\n case INIT_STATE:\n // Acceleration considered as free fall if it has value lower than 0.42G ~ 0.63G\n if (acceleration < 0.63){\n freeFallTime = Instant.now().toEpochMilli();\n Log.println(Log.DEBUG, TAG, \"FREE_FALL_DETECTED: \" +freeFallTime);\n sendBroadcast(new Intent().setAction(FALLING_STATE));\n state = FallingState.FREE_FALL_DETECTION_STATE;\n }\n break;\n\n case FREE_FALL_DETECTION_STATE:\n // Detect ground impact: > 2.02g ~ 3.10g\n if (acceleration > 2.02){\n long impactTime = Instant.now().toEpochMilli();\n long duration = impactTime - freeFallTime;\n // Measure duration between free fall incident and impact\n if (duration > 250 && duration < 800){\n Log.println(Log.DEBUG, TAG, \"IMPACT_DETECTED - Falling Duration: \"\n +duration +\" ms\");\n sendBroadcast(new Intent().setAction(LAYING_STATE));\n state = FallingState.IMPACT_DETECTION_STATE;\n }\n else{\n Log.println(Log.DEBUG, TAG, \"Resetting...\");\n sendBroadcast(new Intent().setAction(STANDING_STATE));\n state = FallingState.INIT_STATE;\n }\n }\n else if (Instant.now().isAfter(Instant.ofEpochMilli(freeFallTime).plusMillis(800))){\n Log.println(Log.DEBUG, TAG, \"Resetting...\");\n sendBroadcast(new Intent().setAction(STANDING_STATE));\n state = FallingState.INIT_STATE;\n }\n break;\n\n case IMPACT_DETECTION_STATE:\n // Detect Immobility (about 1G): If stand still for over 2.5 seconds\n if (Instant.now().isAfter(Instant.ofEpochMilli(freeFallTime).plusMillis(1800)) &&\n acceleration >= 0.90 && acceleration <= 1.10){\n // Detection of motion interrupts the count\n long duration = Instant.now().toEpochMilli() - freeFallTime;\n sendBroadcast(new Intent().setAction(LAYING_STATE));\n // 1800ms since free fall detection and 2200ms standing still\n if (duration > 4000){\n Log.println(Log.DEBUG, TAG, \"IMMOBILITY_DETECTED\");\n state = FallingState.IMMOBILITY_DETECTION_STATE;\n }\n }\n // If motion is detected go to Initial State\n else if(Instant.now().isAfter(Instant.ofEpochMilli(freeFallTime).plusMillis(1800))){\n Log.println(Log.DEBUG, TAG, \"Resetting...\");\n sendBroadcast(new Intent().setAction(STANDING_STATE));\n state = FallingState.INIT_STATE;\n }\n break;\n\n case IMMOBILITY_DETECTION_STATE:\n // Trigger Countdown Alarm\n sendBroadcast(new Intent().setAction(FALL_RECEIVER));\n Log.println(Log.DEBUG, TAG, \"Alarm Triggered!!!\");\n state = FallingState.INIT_STATE;\n break;\n }\n }", "public boolean isLanding() {\n\t\treturn isLanding;\n\t}", "AttackResult smartAttack();", "public boolean isLandAnimal() {\n return false;\n }", "public void breakWall() {\r\n\tbustedWall = true;\r\n}", "private boolean buildStreetIsAllowed(Road road) {\r\n\t\tif (!client.isBeginning()\r\n\t\t\t\t&& road.isBuildable(island, client.getSettler().getID())\r\n\t\t\t\t&& road.getOwner() == Constants.NOBODY) {\r\n\t\t\treturn true;\r\n\t\t} else if (((client.isBeginning() && road.getEnd() == getLastSettlementNode()) || (client\r\n\t\t\t\t.isBeginning() && road.getStart() == getLastSettlementNode()))\r\n\t\t\t\t&& road.getOwner() == Constants.NOBODY) {\r\n\t\t\treturn true;\r\n\t\t} else\r\n\t\t\treturn false;\r\n\t}", "@Override\n public boolean waitForNextFlight() {\n this.lock.lock();\n try {\n boolean wait = this.passengersStillMissing != 0;\n\n // update hostess state\n this.repository.updateHostessState(HostessState.WAIT_FOR_NEXT_FLIGHT);\n\n if (wait) {\n // wait for pilot\n while (!this.planeReadyForBoarding) {\n this.hostessWaitPlaneReadyToTakeOff.await();\n }\n this.planeReadyForBoarding = false;\n }\n\n return wait;\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n this.lock.unlock();\n }\n return false;\n }", "public void tensionRangeCheck(){\n if(motor.get() < 0){\n if(Bottom_Limit_Switch.get() | tenPot.pidGet()> tenPotMAX ){\n motor.set(0.0);\n }\n }else if(motor.get() > 0){\n if(Top_Limit_Switch.get() | tenPot.pidGet()< tenPotMIN){\n motor.set(0.0);\n }\n }\n }", "public boolean isExempt();", "public void enableBuyEntrance(){\r\n\t\tbuyEntrance = true;\r\n\t\tbuildHotel = true;\r\n\t}", "@Override\n\tpublic void disabledInit() {\n\t\tRobot.driveSubsystem.setCoastMode();\n\t}", "void bypass();", "public static void setAirplaneMode(boolean isAirplaneMode) {\n Settings.System.putInt(Robolectric.application.getContentResolver(), Settings.System.AIRPLANE_MODE_ON, isAirplaneMode ? 1 : 0);\n }", "public void invalidRoute() \n {\n validRoute = false;\n }", "@Test\r\n\tpublic void testFillChargingNonlinear_EmptyCar_ExhaustiveDesiredCapacity() {\n\t\tSimulation.verbosity = 0;\r\n\t\tint startTimeSeconds = 0;\r\n\t\t\r\n\t\tdouble desiredCapacityInterval = 1; \r\n\t\t\r\n\t\tdouble desiredCapacity = desiredCapacityInterval;\r\n\t\twhile (desiredCapacity <= car.getMaxCapacity()) {\r\n\t\t\t\r\n\t\t\t//System.out.println(\"desiredCapacity=\" + desiredCapacity);\r\n\t\t\tcar.setCurrentPlan(new double[96]);\r\n\t\t\tschedulerNonlinear.fillChargingPlan(car, chargingStation, desiredCapacity, \r\n\t\t\t\t\tTimeslotSorter.getSortedTimeslots(null, 0, 96, TimeslotSortingCriteria.INDEX), \r\n\t\t\t\t\tstartTimeSeconds);\r\n\t\t\t\r\n\t\t\tassertEquals(desiredCapacity, schedulerNonlinear.getPlannedCapacity(chargingStation, car, startTimeSeconds), 1e-2);\r\n\t\t\tdesiredCapacity += desiredCapacityInterval;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public void onSensorUnreliable ()\r\n\t{\r\n\t\tif ((System.currentTimeMillis())>5000)\r\n\t\t{\r\n\t\t\tLog.d(TAG,\"You need to calibrate your sensors.\");\r\n\t\t}\r\n\t}", "@Override\n\tpublic void teleopPeriodic() {\n\t\tRobot.intakeSubsystem._getSpeed();\n\n\t\tRobot.driveSubsystem.operatorOverride();\n\t\tScheduler.getInstance().run();\n\n\t\tTargetRegion boilerTarget = Robot.navigator.getBoilerTarget();\n\t\tif (boilerTarget != null) {\n\t\t\tSmartDashboard.putNumber(\"Target Center X\", boilerTarget.m_centerTop);\n\t\t\tSmartDashboard.putNumber(\"Target Center Y\", boilerTarget.m_bounds.m_top);\n\t\t} else {\n\t\t\tSmartDashboard.putNumber(\"Target Center X\", -1);\n\t\t\tSmartDashboard.putNumber(\"Target Center Y\", -1);\n\t\t}\n\t}" ]
[ "0.5938257", "0.58932275", "0.5782056", "0.5777831", "0.57614774", "0.5616863", "0.5556931", "0.55047315", "0.55043095", "0.54763526", "0.5471112", "0.5407462", "0.5404355", "0.5402837", "0.5386619", "0.53686523", "0.5359436", "0.53390974", "0.53353775", "0.5331541", "0.5327669", "0.53039384", "0.52934223", "0.52930534", "0.52780104", "0.52742016", "0.52711374", "0.5268", "0.5258678", "0.5251892", "0.52381825", "0.5214815", "0.5210685", "0.52064645", "0.5184567", "0.51843107", "0.5182732", "0.5170933", "0.5168837", "0.5167351", "0.514297", "0.5139818", "0.5131084", "0.51275516", "0.51198095", "0.5114622", "0.5113915", "0.5096226", "0.50960886", "0.5094978", "0.50947696", "0.5090607", "0.50884825", "0.50814396", "0.50805974", "0.5072149", "0.5069353", "0.5065107", "0.5059892", "0.50573426", "0.5056366", "0.5052803", "0.5051683", "0.5051232", "0.50491637", "0.50472444", "0.5046505", "0.5044366", "0.50442284", "0.5036312", "0.50290734", "0.5023858", "0.5022931", "0.5022825", "0.5021547", "0.5015435", "0.5010558", "0.5008649", "0.49987096", "0.49895555", "0.4987006", "0.4984892", "0.49821234", "0.4979908", "0.49782208", "0.49692547", "0.4968886", "0.49669588", "0.49669293", "0.49570218", "0.49552205", "0.49489146", "0.49475375", "0.49459055", "0.49442416", "0.49420783", "0.4939321", "0.49245316", "0.49215916", "0.4919509" ]
0.63602346
0
As the system designer So that the software can be used for many different airports I would like a default airport capacity that can be overridden as appropriate
@Test public void overrideDefaultCapacity() { cst = new Airport(2, weatherMock); assertEquals(2, cst.capacity); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.cantor.drop.aggregator.model.CFTrade.Capacity getCapacity();", "public Airplane(int aircraftType, int flightNumber, int maximumCapacity,\n\t\t\tint maximumWeight) {\n\t\tthis.aircraftType = aircraftType; // all of these are of the airplane\n\t\tthis.flightNumber = flightNumber;\n\t\tthis.maximumCapacity = maximumCapacity;\n\t\tthis.maximumWeight = maximumWeight;\n\t}", "public Airplane() { \n\n\t\t//The Airplane constructor calls the Flyingobject constructor\n\t\tsuper();\n\n\t\t//Sets its attributes to default values\n\t\tthis.brand = \"\";\n\t\tthis.price = 0.0; \n\t\tthis.horsePower = 0; \n\t}", "public int getCapacity() {\n\t\treturn mCapcity;\n\t}", "java.lang.String getTransitAirport();", "public String getArrivalAirport();", "public Builder setAvailableCapacity(int value) {\n \n availableCapacity_ = value;\n onChanged();\n return this;\n }", "@Override\n public int requestAvailableCapacity() {\n int total = facility.getCapacity();\n for (Facility facility : facilities) {\n total += facility.getCapacity();\n }\n return total;\n }", "public interface FlotationCapacity {\n public String flotation();\n}", "public Bedroom(int number, int capacity , TypesOfBedrooms type, int nightlyrate) {\n super(capacity);\n this.number = number;\n this.type = type;\n this.nightlyrate = nightlyrate;\n this.guests = new ArrayList<Guest>();\n }", "public ProductionPower(){\n this(0, new NumberOfResources(), new NumberOfResources(), 0, 0);\n }", "public void setCapacity(int value) {\n this.capacity = value;\n }", "private void setCompanyDemand() {\n\n\t\tfloat shopping = Float.parseFloat(label_2.getText().toString());\n\t\tfloat giveing = Float.parseFloat(label_5.getText().toString());\n\n\t\tfloat companyDemand = shopping - giveing;\n\n\t\tlabel_7.setText(companyDemand + \"\");\n\n\t}", "protected abstract double getDefaultCost();", "public String getDepartureAirport();", "public Builder setOverallPartiesCap(int value) {\n \n overallPartiesCap_ = value;\n onChanged();\n return this;\n }", "void askDefaultProduction();", "public Airplane(){\n\t\tsuper(106, 111);\n\t\tspeed = Math.random() + 2.0;\n\t}", "@java.lang.Override\n public int getOverallPartiesCap() {\n return overallPartiesCap_;\n }", "@Override\n\tpublic void setRam() {\n\t\tcom.setRam(\"16g\");\n\t}", "public void precio4e(){\n precioHabitaciones = precioHabitaciones + (cantidadHabitaciones * numeroCamas);\n\n //Restaurante\n if(capacidadRestaurant < 30){\n precioHabitaciones = precioHabitaciones + 10;\n } else if (capacidadRestaurant > 29 && capacidadRestaurant < 51){\n precioHabitaciones = precioHabitaciones + 30;\n } else if (capacidadRestaurant > 50){\n precioHabitaciones = precioHabitaciones + 50;\n }\n\n //Gimnasio\n switch (gimnasio){\n case \"A\":\n precioHabitaciones = precioHabitaciones + 50;\n break;\n case \"B\":\n precioHabitaciones = precioHabitaciones + 30;\n break;\n }\n\n }", "public String getAirportCode(){\n\t\treturn this.airportCode;\n\t}", "private void createDefaultGalaxy(){\n milkyWay.setGalaxyColonies(37579321);\n milkyWay.setGalaxyPopulation(1967387132);\n milkyWay.setGalaxyFleets(237);\n milkyWay.setGalaxyStarships(34769);\n }", "public void setCapacity( Resource.Type type, int capacity );", "public void setCargoCapacity(int cargoCapacity) { // set the cargo capacity\n\t\tthis.cargoCapacity = cargoCapacity;\n\t}", "public CargoAirplane createRandomCargoAirplane() {\n\tthrow new RuntimeException(\"Cargo airplanes is not supported\");\n }", "public SystematicAcension_by_LiftingTechnology() {\n\n\t}", "public Airplane (){\n \n }", "@java.lang.Override\n public int getOverallPartiesCap() {\n return overallPartiesCap_;\n }", "public double getCost() {\n\t\tif (this.accommodationType.equals(TYPEsingle)) {\n\t\t\tif (this.getRoomView().equals(\"street view\")) {\n\t\t\t\treturn 50.0;\n\t\t\t} else if (this.getRoomView().equals(\"garden view\")) {\n\t\t\t\treturn 70.0;\n\t\t\t} else {\n\t\t\t\treturn 110.0;\n\t\t\t}\n\t\t} else if (this.accommodationType.equals(TYPEdouble)) {\n\t\t\tif (this.getRoomView().equals(\"street view\")) {\n\t\t\t\treturn 70.0;\n\t\t\t} else if (this.getRoomView().equals(\"garden view\")) {\n\t\t\t\treturn 98.0;\n\t\t\t} else {\n\t\t\t\treturn 154.0;\n\t\t\t}\n\t\t} else if (this.accommodationType.equals(TYPEfamily)) {\n\t\t\tif (this.getRoomView().equals(\"street view\")) {\n\t\t\t\treturn 86.0;\n\t\t\t} else if (this.getRoomView().equals(\"garden view\")) {\n\t\t\t\tif (getInfoJacuzzi() == true) {\n\t\t\t\t\treturn 180.6;\n\t\t\t\t} else {\n\t\t\t\t\treturn 120.4;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (getInfoJacuzzi() == true) {\n\t\t\t\t\treturn 283.8;\n\t\t\t\t} else {\n\t\t\t\t\treturn 189.2;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (this.accommodationType.equals(TYPEpresidential)) {\n\t\t\tif (this.getRoomView().equals(\"street view\")) {\n\t\t\t\treturn 200.0;\n\t\t\t} else if (this.getRoomView().equals(\"garden view\")) {\n\t\t\t\tif (getInfoJacuzzi() == true) {\n\t\t\t\t\treturn 420.0;\n\t\t\t\t} else {\n\t\t\t\t\treturn 280.0;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (getInfoJacuzzi() == true) {\n\t\t\t\t\treturn 660.0;\n\t\t\t\t} else {\n\t\t\t\t\treturn 440.0;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\treturn 0.0;\n\t\t}\n\t}", "public void setCapacity(final int theCapacity) {\n\t\tif (theCapacity < 1) {\n\t\t\tthrow new IllegalArgumentException(\"Please supply a valid capacity.\");\n\t\t}\n\t\tthis.mCapcity = theCapacity;\n\t}", "public void testApp() {\n\t\tCapacityItem capacityItem1 = new CapacityItem(\"KAABA00011GN\",\n\t\t\t\t\"2012-12-01\", \"2012-12-31\", \"M10\", 100000, 5000);\n\n\t\t// 12.83 * 0.2 * 0.5 * 100000= 128300.0\n\t\tCapacityItem capacityItem2 = new CapacityItem(\"KEALGYO03ONN\",\n\t\t\t\t\"2012-05-01\", \"2012-05-31\", \"M10\", 100000, 5000);\n\n\t\t// 21.38 * 0.2 * 1.0 * 100000 = 427600.0\n\t\tCapacityItem capacityItem3 = new CapacityItem(\"GEDRAVAS1IIN\",\n\t\t\t\t\"2012-05-01\", \"2012-05-31\", \"M0\", 100000, 5000);\n\t\t// 19.24 * 0.2 * 1.0 * 100000 = 384800.0\n\t\tCapacityItem capacityItem4 = new CapacityItem(\"KETELJCS57EN\",\n\t\t\t\t\"2012-05-01\", \"2012-05-31\", \"M0\", 100000, 5000);\t\t\t\n\n\t\tassertEquals(\"Winter test\", capacityItem1.getSeasonalPrecent(), 0.9);\n\t\tassertEquals(\"Other season test\", capacityItem2.getSeasonalPrecent(),\n\t\t\t\t0.2);\n\n\t\tassertEquals(\"M10 test\", capacityItem1.getTypePrecent(), 0.5);\n\t\tassertEquals(\"M0 test\", capacityItem3.getTypePrecent(), 1.0);\n\n\t\tassertEquals(\"Location type test1\", capacityItem1.getLocationType(),\n\t\t\t\t\"Hazai kilépési\");\n\t\tassertEquals(\"Location type test2\", capacityItem2.getLocationType(),\n\t\t\t\t\"Hazai tárolói belépési\");\n\t\tassertEquals(\"Location type test3\", capacityItem3.getLocationType(),\n\t\t\t\t\"Külföldi belépési\");\n\t\tassertEquals(\"Location type test4\", capacityItem4.getLocationType(),\n\t\t\t\t\"Hazai termelői belépési\");\n\n\t\tassertEquals(\"Fee test1\", capacityItem1.getItemFee(), 159727.5);\n\t\tassertEquals(\"Fee test2\", capacityItem2.getItemFee(), 128300.0);\n\t\tassertEquals(\"Fee test3\", capacityItem3.getItemFee(), 427600.0);\n\t\tassertEquals(\"Fee test4\", capacityItem4.getItemFee(), 384800.0);\n\n\t}", "@Override\n\tpublic void setVehicleCost(double van, double railway, double airplane) {\n\t\tconstantPO.setVanCost(van);\n\t\tconstantPO.setRailwayCost(railway);\n\t\tconstantPO.setAirplaneCost(airplane);\n\t}", "private int currentCapacity(){\n int total = 0;\n \n for(int i = Elevator.MIN_FLOOR; i <= Elevator.MAX_FLOOR; i++){\n total += destinedPassengers[i];\n }\n \n return total;\n }", "private void determinePlanet(DrawButtonInterface db, boolean airResistanceHitBox)\n\t{\n\t\t// Reset boolean\n\t\tnoAtmosphere = false;\n\n\t\t// Strings of the planets are located in DrawButtonInterface under addPlanets()\n\t\tif(db.getPlanetButton().getString() == \"Earth\")\n\t\t{\n\t\t // Set gravity\n\t\t\tgravity = 9.80665;\n\n\t\t\t// Set density\n\t\t\tdensityOfAir = 1.23;\n\n\t\t\t// Set planet name\n\t\t\tplanet = \"Earth\";\n\t\t\tSystem.out.println(\"Earth: Gravity = \" + gravity);\n\t\t}\n\t\telse if(db.getPlanetButton().getString() == \"Moon\")\n\t\t{\n\t\t // Set gravity\n\t\t\tgravity = 1.622;\n\n\t\t\t// Set density\n\t\t\tdensityOfAir = 0;\n\n\t\t\t// Set planet name\n\t\t\tplanet = \"Moon\";\n\n\t\t\t// Super Thin Atmosphere\n\t\t\tnoAtmosphere = true;\n\t\t\tSystem.out.println(\"Moon: Gravity = \" + gravity);\n\t\t}\n\t\telse if(db.getPlanetButton().getString() == \"Mercury\")\n\t\t{\n\t\t // Set gravity\n\t\t\tgravity = 3.7;\n\n\t\t\t// Set density\n\t\t\tdensityOfAir = 0;\n\n\t\t\t// Set planet name\n\t\t\tplanet = \"Mercury\";\n\n\t\t\t// Super Thin Atmosphere\n\t\t\tnoAtmosphere = true;\n\t\t\tSystem.out.println(\"Mercury: Gravity = \" + gravity);\n\t\t}\n\t\telse if(db.getPlanetButton().getString() == \"Venus\")\n\t\t{\n\t\t // Set gravity\n\t\t\tgravity = 8.87;\n\n\t\t\t// Set density(yes that high)\n\t\t\tdensityOfAir = 67;\n\n\t\t\t// Set planet name\n\t\t\tplanet = \"Venus\";\n\t\t\tSystem.out.println(\"Venus: Gravity = \" + gravity);\n\t\t}\n\t\telse if(db.getPlanetButton().getString() == \"Mars\")\n\t\t{\n\t\t // Set gravity\n\t\t\tgravity = 3.711;\n\n\t\t\t// Set density\n\t\t\tdensityOfAir = 0.020;\n\n\t\t\t// Set planet name\n\t\t\tplanet = \"Mars\";\n\t\t\tSystem.out.println(\"Mars: Gravity = \" + gravity);\n\t\t}\n\t\telse if(db.getPlanetButton().getString() == \"Jupiter\")\n\t\t{\n\t\t // Set gravity\n\t\t\tgravity = 24.79;\n\n\t\t\t// Set density\n\t\t\tdensityOfAir = 0.16;\n\n\t\t\t// Set planet name\n\t\t\tplanet = \"Jupiter\";\n\t\t\tSystem.out.println(\"Jupiter: Gravity = \" + gravity);\n\t\t}\n\t\telse if(db.getPlanetButton().getString() == \"Saturn\")\n\t\t{\n\t\t // Set gravity\n\t\t\tgravity = 10.44;\n\n\t\t\t// Set density\n\t\t\tdensityOfAir = 0.19;\n\n\t\t\t// Set planet name\n\t\t\tplanet = \"Saturn\";\n\t\t\tSystem.out.println(\"Saturn: Gravity = \" + gravity);\n\t\t}\n\t\telse if(db.getPlanetButton().getString() == \"Uranus\")\n\t\t{\n\t\t // Set gravity\n\t\t\tgravity = 8.69;\n\n\t\t\t// Set density name\n\t\t\tdensityOfAir = 0.42;\n\n\t\t\t// Set planet name\n\t\t\tplanet = \"Uranus\";\n\t\t\tSystem.out.println(\"Uranus: Gravity = \" + gravity);\n\t\t}\n\t\telse if(db.getPlanetButton().getString() == \"Neptune\")\n\t\t{\n\t\t // Set gravity\n\t\t\tgravity = 11.15;\n\n\t\t\t// Set density\n\t\t\tdensityOfAir = 0.45;\n\n\t\t\t// Set planet name\n\t\t\tplanet = \"Neptune\";\n\t\t\tSystem.out.println(\"Neptune: Gravity = \" + gravity);\n\t\t}\n\t\telse if(db.getPlanetButton().getString() == \"Pluto\")\n\t\t{\n\t\t // Set gravity\n\t\t\tgravity = 0.658;\n\n\t\t\t// Set density\n\t\t\tdensityOfAir = 0;\n\n\t\t\t// Set planet name\n\t\t\tplanet = \"Pluto\";\n\n\t\t\t// Super Thin Atmosphere\n\t\t\tnoAtmosphere = true;\n\t\t\tSystem.out.println(\"Pluto: Gravity = \" + gravity);\n\t\t}\n\t\telse if(db.getPlanetButton().getString() == \"Io\")\n\t\t{\n\t\t // Set gravity\n\t\t\tgravity = 1.796;\n\n\t\t\t// Set density\n\t\t\tdensityOfAir = 0;\n\n\t\t\t// Set planet name\n\t\t\tplanet = \"Io\";\n\n\t\t\t// Super Thin Atmosphere\n\t\t\tnoAtmosphere = true;\n\t\t\tSystem.out.println(\"Io: Gravity = \" + gravity);\n\t\t}\n\t\telse if(db.getPlanetButton().getString() == \"Europa\")\n\t\t{\n\t\t // Set gravity\n\t\t\tgravity = 1.314;\n\n\t\t\t// Set density\n\t\t\tdensityOfAir = 0;\n\n\t\t\t// Set planet name\n\t\t\tplanet = \"Europa\";\n\n\t\t\t// Super Thin Atmosphere\n\t\t\tnoAtmosphere = true;\n\t\t\tSystem.out.println(\"Europa: Gravity = \" + gravity);\n\t\t}\n\t\telse if(db.getPlanetButton().getString() == \"Titan\")\n\t\t{\n\t\t // Set gravity\n\t\t\tgravity = 1.352;\n\n\t\t\t// Set density\n\t\t\tdensityOfAir = 0;\n\n\t\t\t// Set planet name\n\t\t\tplanet = \"Titan\";\n\n\t\t\t// Super Thin Atmosphere\n\t\t\tnoAtmosphere = true;\n\t\t\tSystem.out.println(\"Titan: Gravity = \" + gravity);\n\t\t}\n\t\telse if(db.getPlanetButton().getString() == \"Sun\")\n\t\t{\n\t\t // Set gravity\n\t\t\tgravity = 274;\n\n\t\t\t// Set density\n\t\t\tdensityOfAir = 0;\n\n\t\t\t// Set planet name\n\t\t\tplanet = \"Sun\";\n\n\t\t\t// Super Thin Atmosphere\n\t\t\tnoAtmosphere = true;\n\t\t\tSystem.out.println(\"Sun: Gravity = \" + gravity);\n\t\t}\n\t\telse if(db.getPlanetButton().getString() == \"Neutron Star\")\n\t\t{\n\t\t // Set gravity\n\t\t\tgravity = 25800 * 100000000;\n\n\t\t\t// Set density\n\t\t\tdensityOfAir = 1.23; // Doesn't matter because gravity so great\n\n\t\t\t// Set planet name\n\t\t\tplanet = \"Neutron Star\";\n\t\t\tSystem.out.println(\"Neutron Star: Gravity = \" + gravity);\n\t\t}\n\n\t\t// Final calculation for b and terminal velocity\n\t\tb = .5 * dragCoef * densityOfAir * crossSectionArea;\n\t\tterminalVelocity = Math.sqrt(((mass * gravity) / b));\n\t\tSystem.out.println(\"b: \" + b + \"TV: \" + terminalVelocity);\n\t}", "@Test\r\n\tpublic void testFillChargingNonlinear_EmptyCar_ExhaustiveDesiredCapacity() {\n\t\tSimulation.verbosity = 0;\r\n\t\tint startTimeSeconds = 0;\r\n\t\t\r\n\t\tdouble desiredCapacityInterval = 1; \r\n\t\t\r\n\t\tdouble desiredCapacity = desiredCapacityInterval;\r\n\t\twhile (desiredCapacity <= car.getMaxCapacity()) {\r\n\t\t\t\r\n\t\t\t//System.out.println(\"desiredCapacity=\" + desiredCapacity);\r\n\t\t\tcar.setCurrentPlan(new double[96]);\r\n\t\t\tschedulerNonlinear.fillChargingPlan(car, chargingStation, desiredCapacity, \r\n\t\t\t\t\tTimeslotSorter.getSortedTimeslots(null, 0, 96, TimeslotSortingCriteria.INDEX), \r\n\t\t\t\t\tstartTimeSeconds);\r\n\t\t\t\r\n\t\t\tassertEquals(desiredCapacity, schedulerNonlinear.getPlannedCapacity(chargingStation, car, startTimeSeconds), 1e-2);\r\n\t\t\tdesiredCapacity += desiredCapacityInterval;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "private void setDefaults() {\n\t\tequipActions = new String[] { \"Remove\", null, \"Operate\", null, null };\n\t\tmodelId = 0;\n\t\tname = null;\n\t\tdescription = null;\n\t\tmodifiedModelColors = null;\n\t\toriginalModelColors = null;\n\t\tmodifiedTextureColors = null;\n\t\toriginalTextureColors = null;\n\t\tmodelZoom = 2000;\n\t\tmodelRotation1 = 0;\n\t\tmodelRotation2 = 0;\n\t\tmodelRotationY = 0;\n\t\tmodelOffset1 = 0;\n\t\tmodelOffset2 = 0;\n\t\tstackable = false;\n\t\tvalue = 1;\n\t\tmembersObject = false;\n\t\tgroundOptions = new String[5];\n\t\tinventoryOptions = new String[5];\n\t\tmaleModel = -1;\n\t\tanInt188 = -1;\n\t\tmaleOffset = 0;\n\t\tfemaleModel = -1;\n\t\tanInt164 = -1;\n\t\tfemaleOffset = 0;\n\t\tanInt185 = -1;\n\t\tanInt162 = -1;\n\t\tanInt175 = -1;\n\t\tanInt166 = -1;\n\t\tanInt197 = -1;\n\t\tanInt173 = -1;\n\t\tstackIDs = null;\n\t\tstackAmounts = null;\n\t\tcertID = -1;\n\t\tcertTemplateID = -1;\n\t\tanInt167 = 128;\n\t\tanInt192 = 128;\n\t\tanInt191 = 128;\n\t\tanInt196 = 0;\n\t\tanInt184 = 0;\n\t\tteam = 0;\n\n\t\topcode140 = -1;\n\t\topcode139 = -1;\n\t\topcode148 = -1;\n\t\topcode149 = -1;\n\n\t\tsearchableItem = false;\n\t}", "@Test\r\n\tpublic void testFillChargingPlan_Nonlinear_HighInitialSoC() {\n\t\tdouble initialSoC = 0.99;\r\n\t\tint startTimeSeconds = 0;\r\n\t\twhile (car.carBattery.getSoC() < initialSoC) {\r\n\t\t\tcar.addChargedCapacity(1, 32);\r\n\t\t}\r\n\t\tdouble desiredCapacity = car.getMissingCapacity();\r\n\t\t\r\n\t\t\r\n\t\t// Nonlinear\r\n\t\tcar.setCurrentPlan(new double[96]);\r\n\t\tschedulerNonlinear.fillChargingPlan(car, chargingStation, desiredCapacity, \r\n\t\t\t\tTimeslotSorter.getSortedTimeslots(null, 0, 95, TimeslotSortingCriteria.INDEX), \r\n\t\t\t\tstartTimeSeconds);\r\n\t\t\r\n\t\t//System.out.println(Arrays.toString(car.getCurrentPlan()));\r\n\t\t//System.out.println(schedulerNonlinear.getPlannedCapacity(chargingStation, car, startTimeSeconds));\r\n\t\t\r\n\t\tassertEquals(car.getMissingCapacity(), schedulerNonlinear.getPlannedCapacity(chargingStation, car, startTimeSeconds), 1e-8);\r\n\t\t\r\n\t}", "public Arena() \r\n {\r\n setVenueName(\"\");\r\n setCity(\"\");\r\n setState(\"\");\r\n setMaxCapacity(0);\r\n setYearOpened(0);\r\n team = new Tenant();\r\n }", "public void setCapacity(int capacity) \n {\n this.capacity = capacity;\n }", "public void setFuelCapacity(int newCapacity) {\r\n this.fuelCapacity = newCapacity;\r\n }", "private void setupSettlementCost(){\n\t\tsettlementCost.put(ResourceKind.WOOL, 1);\n\t\tsettlementCost.put(ResourceKind.WOOD, 1);\n\t\tsettlementCost.put(ResourceKind.BRICK, 1);\n\t\tsettlementCost.put(ResourceKind.GRAIN, 1);\n\t}", "public void setOccupancy(int value) {\n this.occupancy = value;\n }", "java.lang.String getArrivalAirport();", "void setMaxActiveAltitude(double maxActiveAltitude);", "java.lang.String getDepartureAirport();", "private Map<Integer, WorldAirport> getAirportMap(){\n\t\treturn this.airports;\n\t}", "public void setDemand(Map<ClockType, Integer> demandPerType);", "public void setInfrastructureCost(int infrastructureCost) {\r\n this.infrastructureCost = infrastructureCost;\r\n }", "public int getInfrastructureCost() {\r\n return infrastructureCost;\r\n }", "@Override\n\tpublic int seatCapacity() {\n\t\treturn 4;\n\t}", "public Crate(int cap){\r\n capacity = cap;\r\n }", "@Test\r\n\tpublic void testGetPlannedCapacity_Nonlinear() {\n\t\tassertEquals(car.sumUsedPhases*900.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 0, 900), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 300, 300, 900), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 0, 600), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*300.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 300, 300, 600), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*1200.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 300, 300, 1500), 1e-8);\r\n\t\t\r\n\t}", "public com.cantor.drop.aggregator.model.CFTrade.Capacity getCapacity() {\n com.cantor.drop.aggregator.model.CFTrade.Capacity result = com.cantor.drop.aggregator.model.CFTrade.Capacity.valueOf(capacity_);\n return result == null ? com.cantor.drop.aggregator.model.CFTrade.Capacity.AGENT : result;\n }", "public void setCapacity(int capacity) {\r\n this.capacity = capacity;\r\n }", "public int getFuelCapacity() {\r\n return fuelCapacity;\r\n }", "public int getCapacity() {\n switch (getID()) {\n case 5509:\n return 3;\n case 5510:\n case 5511:\n return 6;\n case 5512:\n case 5513:\n return 9;\n case 5514:\n case 5515:\n default:\n return 12;\n }\n }", "@Test\r\n\tpublic void testFillChargingPlan_Linear_HighInitialSoC() {\n\t\tdouble initialSoC = 0.9;\r\n\t\tint startTimeSeconds = 0;\r\n\t\t\r\n\t\twhile (car.carBattery.getSoC() < initialSoC) {\r\n\t\t\tcar.addChargedCapacity(1, 32);\r\n\t\t}\r\n\t\tdouble desiredCapacity = car.getMissingCapacity();\r\n\t\t\r\n\t\t// Linear\r\n\t\tcar.setCurrentPlan(new double[96]);\r\n\t\tschedulerLinear.fillChargingPlan(car, chargingStation, desiredCapacity, \r\n\t\t\t\tTimeslotSorter.getSortedTimeslots(null, 0, 95, TimeslotSortingCriteria.INDEX), \r\n\t\t\t\tstartTimeSeconds);\r\n\t\t\r\n\t\t\r\n\t\t//System.out.println(\"DesiredCapactiy: \" + desiredCapacity);\r\n\t\t//System.out.println(\"Planned capacity: \" + schedulerLinear.getPlannedCapacity(chargingStation, car, startTimeSeconds));\r\n\t\t//System.out.println(Arrays.toString(car.getCurrentPlan()));\r\n\t\t\r\n\r\n\t\tassertTrue(car.getCurrentPlan()[0] > 0);\r\n\t\tassertEquals(car.getMissingCapacity(), schedulerLinear.getPlannedCapacity(chargingStation, car, startTimeSeconds), 1e-6);\r\n\t}", "public abstract int getCostToUpgrade();", "public void setCapacity(int capacity) {\r\n\r\n this.capacity = capacity;\r\n }", "public void setName() {\r\n\t\tapplianceName = \"ElectricShower\";\r\n\t}", "U2(){\r\n setCurrentWeight(0);\r\n setMaxWeight(29*1000);\r\n setCost(120*1000000);\r\n }", "java.lang.String getTransitAirportCity();", "public com.cantor.drop.aggregator.model.CFTrade.Capacity getCapacity() {\n com.cantor.drop.aggregator.model.CFTrade.Capacity result = com.cantor.drop.aggregator.model.CFTrade.Capacity.valueOf(capacity_);\n return result == null ? com.cantor.drop.aggregator.model.CFTrade.Capacity.AGENT : result;\n }", "public ScGridColumn<AcUspsInternationalSkeletonRouteOffer> newCapacityColumn()\n {\n return newCapacityColumn(\"Capacity\");\n }", "public void setCapacity(int capacity) {\n this.capacity = capacity;\n }", "public void setAirportCode(String airportCode){\n\t\tthis.airportCode = \"\";\n\t\tthis.airportCode += airportCode;\n\t}", "@Test\r\n\tpublic void testFillChargingNonlinear_HighInitialSoC_ExhaustiveDesiredCapacity() {\n\t\tSimulation.verbosity = 0;\r\n\t\tint startTimeSeconds = 0;\r\n\t\t\r\n\t\t// Charge until soc=0.9\r\n\t\tdouble initialSoC = 0.9;\r\n\t\twhile (car.carBattery.getSoC() < initialSoC) {\r\n\t\t\tcar.addChargedCapacity(1, 32);\r\n\t\t}\r\n\t\t\r\n\t\tdouble desiredCapacity = 0.1;\r\n\t\twhile (desiredCapacity <= car.getMissingCapacity()) {\r\n\t\t\t\r\n\t\t\tcar.setCurrentPlan(new double[96]);\r\n\t\t\tschedulerNonlinear.fillChargingPlan(car, chargingStation, desiredCapacity, \r\n\t\t\t\t\tTimeslotSorter.getSortedTimeslots(null, 0, 96, TimeslotSortingCriteria.INDEX), \r\n\t\t\t\t\tstartTimeSeconds);\r\n\t\t\t\r\n\r\n\t\t\tdouble plannedCapacity = schedulerNonlinear.getPlannedCapacity(chargingStation, car, startTimeSeconds);\r\n\t\t\t//System.out.println(\"desiredCapacity=\" + desiredCapacity + \"Ah, plannedCapacity=\" + plannedCapacity);\r\n\t\t\t\r\n\t\t\tassertEquals(desiredCapacity, plannedCapacity, 1e-2);\r\n\t\t\tdesiredCapacity+=0.1;\r\n\t\t}\r\n\t\t\r\n\t}", "public OutdoorActivities(String nameActivity, int capacity, int equipmentCost) {\r\n\t\t\tsuper(nameActivity, capacity);\r\n\t\t\tsetEquipmentCost(equipmentCost);\r\n\t\t\t\r\n\t\t}", "public Fortress(int waterCapacityInitial, Vector2 position) {\r\n\t\tthis.position =position;\r\n\t\tthis.waterCapacity = waterCapacityInitial; \r\n\t\tthis.waterLevel = 0;\r\n\t\tthis.level = 1;\r\n\t\tthis.pumpSpeed = 1; \r\n\t\t//this.weapon = new Weapon();\r\n\t}", "public Battery(double initialCapacity) {\r\n capacity = initialCapacity;\r\n originalCapacity = initialCapacity;\r\n }", "java.lang.String getDepartureAirportCode();", "public int getCapacity( )\n {\n // Implemented by student.\n }", "public void setSupplyMovementRate(int value) {\n this.supplyMovementRate = value;\n }", "public PowerPlant(AircraftEnum aircraftName, String name, String description, \n\t\t\tdouble x, double y,double z,\n\t\t\tAircraft aircraft) {\n\n\t\tthis(name, description, x, y, z);\n\t\t_theAircraft = aircraft;\n\t\tinitializeEngines(aircraftName);\n\t}", "int range() {\n\t\treturn mpg * fuelcap;\n\t}", "String getAvailability_zone();", "void setMinActiveAltitude(double minActiveAltitude);", "public void setCapacity(int capacity)\n {\n Validate.isTrue(capacity > 0, \"Capacity must be > 0\");\n capacity_ = capacity; \n }", "public interface AircraftType {\r\n String getAircraftType();\r\n}", "public static int getCapacity () {\n\t\tcapacity = nbrOfHouses*Barn.getCapacity();\n\t\treturn capacity;\n\t}", "private String getSlot() {\n\t\tint slotPick = rgen.nextInt(1, 7);\n\t\t\tswitch (slotPick) {\n\t\t\tcase 1: return CHERRY;\n\t\t\tcase 2: return LEMON;\n\t\t\tcase 3: return ORANGE;\n\t\t\tcase 4: return PLUM;\n\t\t\tcase 5: return BELL;\n\t\t\tcase 6: return BAR;\n\t\t\tcase 7: return EMPTY_SLOT;\n\t\t\tdefault: return null;\n\t\t}\n\t}", "void setOrderCapacity(OrderCapacity inOrderCapacity);", "public void setCapacity(int capacity) {\n\n\t\tthis.capacity = capacity;\n\t}", "public Airport(int X, int Y, int Fees) {\r\n\t\tthis.X=X;\r\n\t\tthis.Y=Y;\r\n\t\tthis.AirportFees=Fees;\r\n\t}", "private static void showToUserConsoleTotalAircraftsCarryingCapacity(AirlineManageSystem airlineCompanyManager)\n throws AirlineEmptyParkException, NoAirlineCompanyException {\n System.out.println(\"A total cargo carrying capacity of all aircrafts at the park is \"\n + airlineCompanyManager.getTotalWeigthCapacity());\n }", "public void setTime() {\r\n\t\tArrayList<String> slots = new ArrayList<String>();\r\n\t\tString inSched = getWorkHours();\r\n\t\tswitch(inSched) {\r\n\t\tcase \"6AM-3PM\":\r\n\t\t\tArrayList<String> sched1 = new ArrayList<String>(Arrays.asList(\"06AM\",\"07AM\",\"08AM\",\"09AM\",\"10AM\",\"12PM\",\"1PM\",\"2PM\"));\r\n\t\t\tslots = sched1;\r\n\t\t\tbreak;\r\n\t\tcase \"7AM-4PM\":\r\n\t\t\tArrayList<String> sched2 = new ArrayList<String>(Arrays.asList(\"07AM\",\"08AM\",\"09AM\",\"10AM\",\"11AM\",\"1PM\",\"2PM\",\"3PM\"));\r\n\t\t\tslots = sched2;\r\n\t\t\tbreak;\r\n\t\tcase \"8AM-5PM\":\r\n\t\t\tArrayList<String> sched3 = new ArrayList<String>(Arrays.asList(\"08AM\",\"09AM\",\"10AM\",\"11AM\",\"12PM\",\"2PM\",\"3PM\",\"4PM\"));\r\n\t\t\tslots = sched3;\r\n\t\t\tbreak;\r\n\t\tcase \"9AM-6PM\":\r\n\t\t\tArrayList<String> sched4 = new ArrayList<String>(Arrays.asList(\"09AM\",\"10AM\",\"11AM\",\"12PM\",\"1PM\",\"3PM\",\"4PM\",\"5PM\"));\r\n\t\t\tslots = sched4;\r\n\t\t\tbreak;\r\n\t\tcase \"10AM-7PM\":\r\n\t\t\tArrayList<String> sched5 = new ArrayList<String>(Arrays.asList(\"10AM\",\"11AM\",\"12PM\",\"1PM\",\"2PM\",\"4PM\",\"5PM\",\"6PM\"));\r\n\t\t\tslots = sched5;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tslots.add(\"No appointments available for this date.\");\r\n\t\t}\r\n\t\tthis.timeAvailable = slots;\r\n\t}", "private static void showToUserConsoleTotalAircraftsPassengerCapacity(AirlineManageSystem airlineCompanyManager)\n throws AirlineEmptyParkException, NoAirlineCompanyException {\n System.out.println(\"A total passengers capacity of all aircrafts at the park is \"\n + airlineCompanyManager.getTotalAircraftsCapacity());\n }", "public void setCapacity(double capacity) {\n\t\tthis.capacity = capacity;\n\t}", "private static void setOptimumHumidity(String room) {\r\n switch (room) {\r\n case \"a\": // living room\r\n case \"b\": // office\r\n case \"c\": // bedroom\r\n optimumRHLL = 40.00f;\r\n optimumRHUL = 60.00f;\r\n break;\r\n case \"d\": // bathroom\r\n optimumRHLL = 50.00f;\r\n optimumRHUL = 70.00f;\r\n break;\r\n case \"e\": // kitchen\r\n optimumRHLL = 50.00f;\r\n optimumRHUL = 60.00f;\r\n break;\r\n case \"f\": // basement\r\n optimumRHLL = 50.00f;\r\n optimumRHUL = 65.00f;\r\n break;\r\n }\r\n }", "public int getFuelCapacity() {\n return this.type.fuelCapacity;\n }", "public void alg_REQAlg(){\r\nswitch (productIndex.value){\r\ncase 0:\r\r\n\tprice.value=10;\r\r\ncase 1:\t\r\r\n\tprice.value=20;\r\r\ncase 2:\r\r\n\tprice.value=30;\r\r\ndefault:\r\n\tprice.value=1;\r\r\n}\r\n}", "public Object setInitialHoldings()\r\n/* */ {\r\n\t\t\t\tlogger.info (count++ + \" About to setInitialHoldings : \" + \"Agent\");\r\n/* 98 */ \tthis.profit = 0.0D;\r\n/* 99 */ \tthis.wealth = 0.0D;\r\n/* 100 */ \tthis.cash = this.initialcash;\r\n/* 101 */ \tthis.position = 0.0D;\r\n/* */ \r\n/* 103 */ return this;\r\n/* */ }", "public String toString() {\n\t\treturn \"This Airplane is manufactured by \" + this.brand +\". It costs \" + this.price + \"$ and its horse power is \" + this.horsePower + \".\";\n\t}", "private Map<Good, Integer> initiateMarketplace() {\n Random noise = new Random();\n Map<Good, Integer> map = Collections.synchronizedMap(\n new EnumMap<Good, Integer>(Good.class));\n for (Good item : Good.values()) {\n if (item.getMinTech() <= techLevel) {\n Integer price = Math.max(item.getBasePrice()\n - (techLevel - item.getMinTech()) + alignment.getPriceChange()\n + noise.nextInt(5),\n 5);\n map.put(item, price);\n }\n }\n return map;\n }", "java.lang.String getTransitAirportCode();", "public Flight(String flightNumber, String airline, int passengerCapacity, String destination){\n this.flightNumber = flightNumber;\n this.airline = airline;\n this.passengerCapacity = passengerCapacity;\n this.destination = destination;\n passengerManifest = new ArrayList<Passenger>();\n\n }", "public static void generateDefaults() {\n Building temp = BuildingList.getBuilding(0);\n SubAreas temp2 = temp.getSubArea(1);\n temp2.createFireSensor();\n temp2.createMotionSensor();\n temp2 = temp.getSubArea(2);\n temp2.createMotionSensor();\n temp2 = temp.getSubArea(3);\n temp2.createMotionSensor();\n temp2.createFireSensor();\n temp2 = temp.getSubArea(5);\n temp2.createFireSensor();\n temp2 = temp.getSubArea(6);\n temp2.createFireSensor();\n temp2.createMotionSensor();\n }", "private Integer getSeatingCapacity() {\n WebElement seatingCapacity = amenities.findElement(By.className(\"seleniumSeatingCapacity\"));\n return Integer.parseInt(seatingCapacity.getText().replaceAll(\"[^0-9]\", \"\"));\n }", "private static void createRooms() {\n// Room airport, beach, jungle, mountain, cave, camp, raft, seaBottom;\n\n airport = new Room(\"airport\");\n beach = new Room(\"beach\");\n jungle = new Room(\"jungle\");\n mountain = new Room(\"mountain\");\n cave = new Room(\"cave\");\n camp = new Room(\"camp\");\n seaBottom = new Room(\"seabottom\");\n\n //Setting the the exits in different rooms\n beach.setExit(\"north\", jungle);\n beach.setExit(\"south\", seaBottom);\n beach.setExit(\"west\", camp);\n\n jungle.setExit(\"north\", mountain);\n jungle.setExit(\"east\", cave);\n jungle.setExit(\"south\", beach);\n\n mountain.setExit(\"south\", jungle);\n\n cave.setExit(\"west\", jungle);\n\n camp.setExit(\"east\", beach);\n\n seaBottom.setExit(\"north\", beach);\n\n // Starting room\n currentRoom = airport;\n }" ]
[ "0.5682482", "0.5671575", "0.5651661", "0.5545372", "0.5541049", "0.5484843", "0.5482297", "0.54453015", "0.5441184", "0.5440678", "0.54275626", "0.540607", "0.53968143", "0.53772986", "0.5337528", "0.5327218", "0.53271073", "0.53239346", "0.5318727", "0.5289899", "0.5289411", "0.5286834", "0.5274636", "0.5270096", "0.52615935", "0.52592576", "0.5240994", "0.52394587", "0.523411", "0.52311826", "0.522775", "0.5221912", "0.52214235", "0.52188635", "0.5214207", "0.5213069", "0.52110463", "0.5203683", "0.51984894", "0.51950717", "0.5193662", "0.51926136", "0.5187404", "0.5182031", "0.5178271", "0.51632947", "0.5159413", "0.514339", "0.5134016", "0.5131718", "0.51287085", "0.5127865", "0.51199174", "0.51054233", "0.51037556", "0.51032025", "0.5100215", "0.5098938", "0.50983334", "0.5091152", "0.5085478", "0.50816464", "0.5076408", "0.50738436", "0.5072075", "0.50716215", "0.50698733", "0.506905", "0.50598747", "0.5053183", "0.5052879", "0.5051291", "0.50461817", "0.50396395", "0.50388646", "0.50379634", "0.50365007", "0.50334203", "0.5033313", "0.5031735", "0.5029906", "0.50290424", "0.50281566", "0.50279933", "0.50275207", "0.50253904", "0.50229216", "0.50177276", "0.5009441", "0.5008629", "0.5003473", "0.5002815", "0.5002277", "0.49928528", "0.49870682", "0.49870405", "0.49861538", "0.49821717", "0.49770916", "0.4973794" ]
0.6980199
0
As an air traffic controller To ensure safety I want to prevent takeoff when weather is stormy
@Test public void preventTakeOffWhenStormyWeather() { Exception exception = new Exception(); try { heathrow.landing(tap); // airport instance return stormy weather when(weatherMock.getWeather()).thenReturn("stormy"); heathrow.takeoff(tap); } catch (Exception e) { exception = e; } assertEquals("Not allowed to takeoff in stormy weather", exception.getMessage()); assertEquals(1, heathrow.hangar.size()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void penguinStormReaction(){\n if(obstacle.getUserData().getAssetId().equals(OBSTACLE_CLOUD_ASSETS_ID)){\n if(penguin.isFrightStopped()){\n obstacle.setStormRaining(false);\n }else{\n obstacle.setStormRaining(true);\n }\n }\n }", "boolean canSnowFallOn();", "protected boolean isMovementNoisy() {\n/* 1861 */ return (!this.abilities.flying && (!this.onGround || !isDiscrete()));\n/* */ }", "public void action() {\r\n\t\tLCD.drawString(\"Avoid Behavior!\", 0, 7);\r\n\r\n\t\tMapUpdate.updateWithoutObject(0);\r\n\t\tMapUpdate.updateWithObject(StandardRobot.us.getRange());\r\n\r\n\t\tif (StandardRobot.ts.isPressed()) {\r\n\t\t\tStandardRobot.pilot.setTravelSpeed(7);\r\n\t\t\tStandardRobot.pilot.travel(-5);\r\n\t\t\tcounter.countTravel();\r\n\r\n\t\t\tif (store.getFlag() == 0) {\r\n\t\t\t\tStandardRobot.pilot.rotate(-90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t} else {\r\n\t\t\t\tStandardRobot.pilot.rotate(90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\tif (store.getFlag() == 0) {\r\n\t\t\t\tStandardRobot.pilot.rotate(-90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t} else {\r\n\t\t\t\tStandardRobot.pilot.rotate(90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void updateConditions() {\n\n weatherTower = new WeatherTower();\n String newWeather = weatherTower.getWeather(coordinates); // this is the currentWeather algorythm\n\n switch (newWeather) {\n\n case WeatherType.SUN:\n coordinates.setLongitude(coordinates.getLongitude() + 2);\n coordinates.setHeight(coordinates.getHeight() + 4);\n message = \"Baloon# \" + this.getName() + \"(\" + this.getId() + \"): \" + \"It is so sunny and hot.\";\n System.out.println(\"message\");\n try(PrintWriter pw = new PrintWriter(new FileOutputStream(new File(\"outputFile.txt\"), true))){\n pw.println(message);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n break;\n\n case WeatherType.RAIN:\n coordinates.setLatitude(coordinates.getLatitude() - 5);\n message = \"Baloon#\" + this.getName() + \"(\" + this.getId() + \"): \" + \"Damn you rain! You messed up my baloon.\";\n System.out.println(\"message\");\n try(PrintWriter pw = new PrintWriter(new FileOutputStream(new File(\"outputFile.txt\"), true))){\n pw.println(message);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n break;\n\n case WeatherType.FOG:\n coordinates.setLatitude(coordinates.getLatitude() - 3);\n message = \"Baloon#\" + this.getName() + \"(\" + this.getId() + \"): \" + \"Even though it's fog, let's take some pics!\";\n System.out.println(\"message\");\n try(PrintWriter pw = new PrintWriter(new FileOutputStream(new File(\"outputFile.txt\"), true))){\n pw.println(message);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n break;\n\n case WeatherType.SNOW:\n coordinates.setHeight(coordinates.getHeight() - 15);\n message = \"Baloon#\" + this.getName() + \"(\" + this.getId() + \"): \" + \" It's snowing. We're gonna crash.\\n\";\n System.out.println(\"message\");\n try(PrintWriter pw = new PrintWriter(new FileOutputStream(new File(\"outputFile.txt\"), true))){\n pw.println(message);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n break;\n }\n }", "@Override\n public void robotPeriodic() {\n\n boolean c = mGPM.haveCargo();\n \n // Need signal due to distance for assurance that cargo is obtained/\n if (c) {\n CargoLight.set(Value.kOn);\n } else{\n CargoLight.set(Value.kOff);\n }\n }", "private void pump_water() {\n\t\t\r\n\t}", "void find_steady_conditions () {\n // System.out.println(\"-- find_steady_conditions: \" + can_do_gui_updates);\n // double min_lift = parse_force_constraint(tf_tkoff_min_lift);\n double max_drag = parse_force_constraint(tf_tkoff_max_drag);\n boolean saved_flag = can_do_gui_updates;\n can_do_gui_updates = false;\n vpp.steady_flight_at_given_speed(5, 0);\n can_do_gui_updates = saved_flag;\n recomp_all_parts();\n\n\n // this animation idea alas does not work now... \n // //add a bit of animation in case the rider crosses the takeoff speed.\n // if (alt_val == 0 && foil_lift() >= load) { // need to raise up\n // while (alt_val < 70 && foil_lift() >= load) {\n // alt_val += 0.1;\n // loadPanel();\n // viewer.repaint();\n // // try { Thread.sleep(100); } catch (InterruptedException e) {}\n // saved_flag = can_do_gui_updates;\n // can_do_gui_updates = false;\n // vpp.steady_flight_at_given_speed(5, 0);\n // can_do_gui_updates = saved_flag;\n // }\n // }\n\n if (alt_val == 0 && foil_lift() >= load) { // need to raise up\n // viewer.start_raise = true; // this is experimentsl, has quirks....\n alt_val = 70;\n } else if (alt_val > 0 && foil_lift() < load) { // must splash\n // viewer.start_descend = true; // this is experimentsl, has quirks....\n alt_val = 0;\n }\n\n \n loadPanel();\n if (total_drag() > max_drag) \n dash.outTotalDrag.setForeground(Color.red);\n if (foil_lift() < load) \n dash.outTotalLift.setForeground(Color.red);\n }", "void toggleInAir() {\n inAir = !inAir;\n }", "@Override\n\tpublic void teleopPeriodic() {\n\t\tScheduler.getInstance().run();\n\t\tSmartDashboard.putBoolean(\"Max Intake Extension: \", RobotMap.intakeLifted.get());\n\t\tSmartDashboard.putBoolean(\"Max Lift Extension:\", RobotMap.isAtTop.get());\n\t\tSmartDashboard.putBoolean(\"Min Lift Extension:\", RobotMap.isAtBottom.get());\n\t\tDriveTrain.driveWithJoystick(RobotMap.stick, RobotMap.rd); // Drive\n\t\tTeleOp.RaiseLift(RobotMap.liftTalon, RobotMap.controller); // Raise lift\n\t\tif(RobotMap.controller.getRawAxis(RobotMap.lowerLiftAxis) >= 0.2) {\n\t\tTeleOp.LowerLift(RobotMap.liftTalon, RobotMap.controller);\n\t\t}\n\t\tTeleOp.DropIntake(RobotMap.controller, RobotMap.intakeLifter);\n\t\tTeleOp.spinOut(RobotMap.intakeVictorLeft, RobotMap.controller);\n\t\t//TeleOp.spinnySpinny(RobotMap.intakeVictorLeft, RobotMap.stick);\n\t}", "@Override\n public void teleopPeriodic() {\n double y = -xbox.getRawAxis(0) * 0.7D * (1.0D + Math.max(0, xbox.getRawAxis(4)) * 1.4285714D);\n double rawSpeed = xbox.getRawAxis(2) - xbox.getRawAxis(3);\n\n if (SAFETY_MODE) {\n y *= 0.75D;\n\n if (xbox.getBumper(Hand.kLeft) && joystick.getRawButton(7)) {\n if (safetyCount > 0) {\n safetyCount--;\n SmartDashboard.putNumber(\"Safety Count\", safetyCount);\n\n if (safetyCount == 0) {\n safetyTripped = false;\n clearAllButtonStates();\n SmartDashboard.putBoolean(\"Safety Tripped\", safetyTripped);\n }\n } else {\n safetyTripped = false;\n }\n } else {\n safetyTripped = true;\n safetyCount = MAX_SAFETY_COUNT;\n SmartDashboard.putNumber(\"Safety Count\", safetyCount);\n SmartDashboard.putBoolean(\"Safety Tripped\", safetyTripped);\n }\n } else {\n safetyTripped = false;\n }\n\n // Climb Speed\n if (xbox.getRawButton(6)) {\n rawSpeed = -0.3D;\n }\n\n // Super slow mode\n if (xbox.getAButton() || SAFETY_MODE) {\n SpeedRamp.Setpoint = rawSpeed * 0.45D;\n } else {\n SpeedRamp.Setpoint = rawSpeed * 0.8D * (1.0D + Math.max(0, xbox.getRawAxis(4)) * 0.25);\n }\n\n SpeedRamp.update();\n\n boolean seesTape = TapeDetectedEntry.getBoolean(false);\n \n if (seesTape && !safetyTripped) {\n final double ADJUST_CONST = 0.13281734;\n //double tapePitch = TapePitchEntry.getNumber(0).doubleValue();\n double tapeYaw = TapeYawEntry.getNumber(0).doubleValue();\n final double TARGET_YAW = 0;//PitchYawAdjuster.GetYawFromPitch(tapePitch);\n\n //SmartDashboard.putNumber(\"tapePitch\", tapePitch);\n //SmartDashboard.putNumber(\"tapeYaw\", tapeYaw);\n \n double diff = tapeYaw - ADJUST_CONST;\n \n String s = \"\";\n\n if (diff > 0) {\n s = \"<-- (\" + diff + \")\";\n } else if (diff < 0) {\n s = \"--> (\" + diff + \")\";\n }\n\n if (/*xbox.getRawButton(5) This is now taken for the safety button*/false) {\n final double MAX_AFFECT = 0.4;\n if (diff > MAX_AFFECT) {\n diff = MAX_AFFECT;\n } else if (diff < -MAX_AFFECT) {\n diff = -MAX_AFFECT;\n }\n\n y -= diff;\n }\n\n SmartDashboard.putString(\"TapeDir\", s);\n } else {\n SmartDashboard.putString(\"TapeDir\", \"X\");\n }\n\n if (xbox.getRawButtonPressed(7)) {\n Lifter.setSelectedSensorPosition(0);\n LiftSetpoint = 0;\n LiftRamp.Setpoint = 0;\n LiftRamp.setOutput(0);\n }\n\n //Scheduler.getInstance().run();\n // Cargo ship is(n't anymore) -13120\n\n // The fine adjustment has nothing to do with hammers.\n // Don't try to use a hammer on the roboRIO. Ever.\n final int FINE_ADJUSTMENT_AMOUNT = -500;\n\n if (!safetyTripped) {\n if (joystick.getPOV() == 0) {\n if (!joyPOV0PressedLast) {\n joyPOV0PressedLast = true;\n if (LiftSetpoint - FINE_ADJUSTMENT_AMOUNT <= 0)\n LiftSetpoint -= FINE_ADJUSTMENT_AMOUNT;\n }\n } else {\n joyPOV0PressedLast = false;\n\n if (joystick.getPOV() == 180) {\n if (!joyPOV180PressedLast) {\n joyPOV180PressedLast = true;\n LiftSetpoint += FINE_ADJUSTMENT_AMOUNT;\n }\n } else {\n joyPOV180PressedLast = false;\n }\n }\n\n Drive.arcadeDrive(SpeedRamp.getOutput(), y);\n\n if (joystick.getRawButtonPressed(11)) {\n LiftSetpoint = HATCH_BOTTOM;\n } else if (joystick.getRawButtonPressed(9)) {\n LiftSetpoint = HATCH_MIDDLE;\n //} else if (joystick.getRawButtonPressed(7)) {\n // This button is now used for safety mode LiftSetpoint = HATCH_TOP;\n // and also for grab-hatch-on-impact mode\n } else if (joystick.getRawButtonPressed(12)) {\n LiftSetpoint = CARGO_BOTTOM;\n } else if (joystick.getRawButtonPressed(10)) {\n LiftSetpoint = CARGO_MIDDLE;\n //} else if (joystick.getRawButtonPressed(8)) {\n //LiftSetpoint = CARGO_TOP;\n } else if (joystick.getRawButtonPressed(1)) {\n LiftSetpoint = CARGO_FLOOR;\n }\n\n double liftY = -joystick.getRawAxis(1);\n final double deadband = 0.15;\n\n if (Math.abs(liftY) > deadband) {\n double change = (liftY < 0 ? liftY + 0.15 : liftY - 0.15) * 200;//(int)liftEntry.getDouble(0);//\n \n if (change > 100) {\n change = 100;\n } else if (change < -100) {\n change = -100;\n }\n\n LiftRamp.setOutput(LiftRamp.getOutput() + change);\n LiftRamp.Setpoint += change;\n LiftSetpoint = (int)LiftRamp.Setpoint;\n }\n\n if (LiftSetpoint < LIMIT_UP) {\n LiftSetpoint = LIMIT_UP;\n }\n } else {\n Drive.arcadeDrive(0, 0);\n }\n \n LiftRamp.Setpoint = LiftSetpoint;\n SmartDashboard.putNumber(\"LiftSetpoint\", LiftRamp.Setpoint);\n //SmartDashboard.putNumber(\"LiftEncoderPos\", Lifter.getSelectedSensorPosition());\n SmartDashboard.putNumber(\"LiftOutput\", LiftRamp.getOutput());\n LiftRamp.update();\n\n Lifter.set(ControlMode.Position, LiftRamp.getOutput());\n //Lifter.set(ControlMode.PercentOutput, -joystick.getRawAxis(1));\n\n if (!safetyTripped) {\n if (joystick.getRawButtonPressed(4)) {\n ArmsClosed = !ArmsClosed;\n } else if (!SAFETY_MODE) {\n // This is the same as the joystick safety button, so it only works outside\n // safety mode, and why would it be needed in safety mode anyway?\n // It should be disabled in safety mode anyway to make sure we don't\n // accidently attack someone's fingers at a Demo.\n\n // Holding joystick button 7 makes the limit switches on the hatch mechanism\n // active, so when the hatch contacts the switches, the mechanism automatically\n // grabs the hatch.\n // HatchSwitch0 does not have to be inverted. It's complicated.\n if (joystick.getRawButton(7) && (HatchSwitch0.get() || !HatchSwitch1.get())) {\n ArmsClosed = false;\n }\n }\n\n if (joystick.getRawButtonPressed(3)) {\n ArmsExtended = !ArmsExtended;\n }\n }\n\n ArmExtender.set(ArmsExtended);\n ArmOpener.set(ArmsClosed);\n\n //Diagnostics.writeDouble(\"DriveX\", x);\n //Diagnostics.writeDouble(\"DriveY\", y);\n\n // X = out, Y = in\n\n final double GRAB_SPEED;\n\n if (SAFETY_MODE) {\n GRAB_SPEED = 0.8D;\n } else {\n GRAB_SPEED = 1D; // TODO at one point we had this 0.8, is that what it's supposed to be?\n }\n \n if (!safetyTripped) {\n ArmGrippers.set(/*xbox.getXButton() || */joystick.getRawButton(6) ? -GRAB_SPEED : /*xbox.getYButton() ||*/ joystick.getRawButton(5) ? GRAB_SPEED : 0);\n } else {\n ArmGrippers.set(0);\n }\n\n\n // === Climbing stuff ===\n\n boolean climbSafety = /*joystick.getRawButton(2) &&*/ !safetyTripped;\n \n // Have to check all of these every update to make sure it was pressed\n // between now and the last update\n boolean retractFront = xbox.getYButton/*Pressed*/();\n boolean retractBack = xbox.getXButton/*Pressed*/();\n boolean climbBoth = xbox.getRawButton/*Pressed*/(8);\n\n final double CLIMB_SPEED = 1;\n final double RETRACT_SPEED = 0.75;\n final double HOLD_SPEED = 0.3;\n // If you multiply the hold by this, you get the climb value.\n // Avoids having to thing + or minus so many times.\n final double HOLD_CLIMB_MULTIPLIER = CLIMB_SPEED / HOLD_SPEED;\n\n // Left is negative, right is positive\n double xOff = Math.round((Accel.getX() - ZeroX) * 10) / 10D;\n // Forward is negative, backwards is positive\n double zOff = Math.round((Accel.getZ() - ZeroZ) * 10) / 10D;\n\n\n SmartDashboard.putNumber(\"X\", xOff);\n SmartDashboard.putNumber(\"Z\", zOff);\n\n\n if (climbSafety || IsHoldingBack || IsHoldingFront) {\n if (climbBoth) {\n IsHoldingBack = true;\n IsHoldingFront = true;\n\n \n double SpeedFR = CLIMB_SPEED;\n double SpeedFL = -CLIMB_SPEED;\n double SpeedBR = -CLIMB_SPEED;\n double SpeedBL = CLIMB_SPEED;\n\n final double SLOW_MULT = 0.3;\n\n if (xOff < 0 || zOff < 0) {\n SpeedBR *= SLOW_MULT;\n }\n\n if (xOff < 0 || zOff > 0) {\n SpeedFR *= SLOW_MULT;\n }\n\n if (xOff > 0 || zOff < 0) {\n SpeedBL *= SLOW_MULT;\n }\n\n if (xOff > 0 || zOff > 0) {\n SpeedFL *= SLOW_MULT;\n }\n \n LegFrontR.set(SpeedFR);\n LegFrontL.set(ControlMode.PercentOutput, SpeedFL);\n LegBackR.set(ControlMode.PercentOutput, SpeedBR);\n LegBackL.set(ControlMode.PercentOutput, SpeedBL);\n\n } else {\n if (retractBack) {\n IsHoldingBack = false;\n LegBackR.set(ControlMode.PercentOutput, RETRACT_SPEED);\n LegBackL.set(ControlMode.PercentOutput, -RETRACT_SPEED);\n } else if (IsHoldingBack) {\n double rightSpeed = -HOLD_SPEED;\n double leftSpeed = HOLD_SPEED;\n int pov = xbox.getPOV();\n\n // Front right leg\n if (pov >= 0 && pov <= 90) {\n\n }\n\n LegBackR.set(ControlMode.PercentOutput, -HOLD_SPEED);\n LegBackL.set(ControlMode.PercentOutput, HOLD_SPEED);\n } else {\n LegBackR.set(ControlMode.PercentOutput, 0);\n LegBackL.set(ControlMode.PercentOutput, 0);\n }\n\n if (retractFront) {\n IsHoldingFront = false;\n LegFrontR.set(-RETRACT_SPEED);\n LegFrontL.set(ControlMode.PercentOutput, RETRACT_SPEED);\n } else if (IsHoldingFront) {\n double rightSpeed = HOLD_SPEED;\n double leftSpeed = -HOLD_SPEED;\n int pov = xbox.getPOV();\n\n // Front right leg\n if (pov >= 0 && pov <= 90) {\n rightSpeed *= HOLD_CLIMB_MULTIPLIER;\n }\n\n LegFrontR.set(rightSpeed);\n LegFrontL.set(ControlMode.PercentOutput, leftSpeed);\n } else {\n LegFrontR.set(0);\n LegFrontL.set(ControlMode.PercentOutput, 0);\n }\n }\n } else {\n LegBackR.set(ControlMode.PercentOutput, 0);\n LegBackL.set(ControlMode.PercentOutput, 0);\n LegFrontR.set(0);\n LegFrontL.set(ControlMode.PercentOutput, 0);\n }\n \n double footSpeed = Math.max(-1.0, Math.min(rawSpeed * 3, 1.0F));\n\n if (IsHoldingBack) {\n // Drive back feet\n BackFootMover.set(footSpeed);\n } else {\n BackFootMover.set(0);\n }\n\n if (IsHoldingFront) {\n // Drive front feet\n FrontFootMover.set(footSpeed);\n } else {\n FrontFootMover.set(0);\n }\n\n // Publish values to dashboard for LEDs\n LedArmsClosed.setBoolean(ArmsClosed);\n }", "@Override\r\n\tpublic void cruise() {\n\t\tSystem.out.println(\"In SeaPlane::cruise\");\r\n\t\tif (altitude < 10) \r\n\t\t\tSail.super.cruise();\r\n\t\telse\r\n\t\t\tFastFly.super.cruise();\r\n\t}", "public void onSensorUnreliable ()\r\n\t{\r\n\t\tif ((System.currentTimeMillis())>5000)\r\n\t\t{\r\n\t\t\tLog.d(TAG,\"You need to calibrate your sensors.\");\r\n\t\t}\r\n\t}", "@Override\n protected void execute() {\n if(!Robot.SCISSOR.getFloorSensor() && speed < 0) {\n Robot.SCISSOR.liftRobotPnumatic(false);\n }\n }", "private void aimlessScout() {\n\t\ttargetFlower = null;\n\t\t// if bee is sufficiently far from flower, look for other flowers\n\t\tif((clock.time - tempTime) > 0.15) {\n\t\t\tstate = \"SCOUTING\";\n\t\t}\n\t\t// otherwise keep flying\n\t\telse{\n\t\t\tcurrentAngle += RandomHelper.nextDoubleFromTo(-Math.PI/8, Math.PI/8);\n\t\t\tspace.moveByVector(this, 4, currentAngle,0);\n\t\t\tNdPoint myPoint = space.getLocation(this);\n\t\t\tgrid.moveTo(this, (int) myPoint.getX(), (int) myPoint.getY());\n\t\t\t//energy -= exhaustionRate;\n\t\t\tfood -= highMetabolicRate;\n\t\t}\n\t}", "public boolean takeControl() {\n\t\tif (Squirrel.us.getDistance() <= 30 && Squirrel.notDetected)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public abstract boolean attack(TemporaryCharm i);", "private boolean canRunTowerImmediateEffects(Player player, int floor){\n List<DevelopmentCard> developmentCards = player.getPersonalBoard().getCards(DevelopmentCardColor.BLUE);\n for(DevelopmentCard developmentCard : developmentCards)\n if (developmentCard.getPermanentEffect() instanceof EffectNoBonus){\n EffectNoBonus effectNoBonus = (EffectNoBonus) developmentCard.getPermanentEffect();\n for (Integer towerFloor : effectNoBonus.getFloors())\n if (towerFloor == floor)\n return true;\n\n }\n return false;\n }", "private static boolean runAway(Critter foo){\n\t\tif(foo.moved) {\n\t\t\tfoo.energy = foo.getEnergy() - Params.walk_energy_cost;\n\t\t\tif (foo.getEnergy() <= 0) {\n\t\t\t\tfoo.isAlive=false;\n\t\t\t}\n\t\t\treturn false;\n\t\t} else {\n\t\t\tint dir = getRandomInt(8);\n\t\t\tif(canMove(foo, dir)) {\n\t\t\t\tfoo.walk(dir);\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\tfoo.energy = foo.getEnergy() - Params.walk_energy_cost;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public void setSensorOff() {\n\n }", "private static void turnAwayFromWall() {\n while (true) {\n if (readUsDistance() > OPEN_SPACE) {\n leftMotor.stop();\n rightMotor.stop();\n // re-calibrate theta, offset will be added to this angle\n odometer.setTheta(0);\n System.out.println(\"starting localization...\");\n prevDist = 255;\n dist = prevDist;\n break;\n }\n }\n }", "@Override\n public void robotPeriodic() {\n double high = m_filter.calculate(m_photoHigh.getValue());// * kValueToInches;\n double low = m_filter.calculate(m_photoLow.getValue()); //* kValueToInches;\n if (low<=6){\n BallPresent = true;\n //stop motor if ultrasonic sensor median falls below 6 inches indicating a ball is blocking the sensor\n m_RightMotor.set(ControlMode.PercentOutput, 0);\n } else {\n BallPresent = false;\n //stop motor if ultrasonic sensor median falls below 6 inches indicating a ball is blocking the sensor\n m_RightMotor.set(ControlMode.PercentOutput, 0.5);\n }\n /*Shuffleboard.getTab(\"Shooter\").add(\"Ball Present\", BallPresent)\n .withWidget(BuiltInWidgets.kBooleanBox)\n .withPosition(0, 0)\n .withSize(1, 1)\n .withProperties(Map.of(\"colorWhenTrue\",\"green\",\"colorWhenFalse\",\"black\"));*/\n SmartDashboard.putNumber(\"High\", high);\n SmartDashboard.putNumber(\"Low\", low); \n /*Shuffleboard.getTab(\"Shooter\").add(\"Ultrasonic 1\", currentDistance)\n .withWidget(BuiltInWidgets.kGraph)\n .withPosition(0, 2)\n .withSize(4, 4);*/\n // convert distance error to a motor speed\n //double currentSpeed = (kHoldDistance - currentDistance) * kP;\n\n // drive robot\n //m_robotDrive.arcadeDrive(currentSpeed, 0);\n }", "public abstract boolean attack(PermanentCharm i);", "@Override\n public void teleopPeriodic() {\n Scheduler.getInstance().run();\n SmartDashboard.putNumber(\"right encoder\", drive.getRightEncoder());\n SmartDashboard.putNumber(\"left encoder\", drive.getLeftEncoder());\n \n PixyCamBlock centerBlock = PixyCam2.GetCentermostBlock();\n boolean targetInRange = false ;\n \n if(centerBlock == null)\n {\n targetInRange = false;\n SmartDashboard.putString(\"center block data \", \"null\"); \n }\n else if(centerBlock.yCenter < 200)\n {\n targetInRange = true;\n String out = \"Center Block, X: \"+centerBlock.xCenter + \" Y: \"+centerBlock.yCenter;\n SmartDashboard.putString(\"center block data \", out); \n }\n\n String targetValue = Boolean.toString(targetInRange);\n SmartDashboard.putString(\"target good?\", targetValue);\n \n \n SmartDashboard.putBoolean(\"isFlipped\", flipped);\n }", "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}", "private void weather() {\n\t\t// System.out.println(\"Sending weather information via Twitter.\");\n\t\t// TwitterComm.sendDirectMessage(Constants.AUTH_USER,\n\t\t// Alfred.getYrParser()\n\t\t// .getWeatherReport().twitterForecastToString());\n\t}", "private void automaticModeChecks(){\n // turn on lights if underground\n if (this.isUnderground()){ this.selectedTrain.setLights(1);}\n // set heat\n if (this.selectedTrain.getTemp() <= 40.0){this.selectedTrain.setThermostat(60.0);}\n else if (this.selectedTrain.getTemp() >= 80){ this.selectedTrain.setThermostat(50.0);}\n }", "@Test\n\tpublic void preventLandingWhenStormyWeather() {\n\t\tException exception = new Exception();\n\n\t\ttry {\n\t\t\twhen(weatherMock.getWeather()).thenReturn(\"stormy\");\n\t\t\theathrow.landing(tap);\n\t\t} catch (Exception e) {\n\t\t\texception = e;\n\t\t}\n\n\t\tassertEquals(\"Not allowed to land in stormy weather\", exception.getMessage());\n\t\tassertEquals(0, heathrow.hangar.size());\n\n\t}", "public void placePowerStation() {\n this.powerStation = true;\n\n }", "private void sharplyChange(){\r\n\t\t\tgovernmentLegitimacy -= 0.3;\r\n\t\t}", "public void teleopContinuous() {\n //feed the watchdog\n myDog.feed();\n\n //check safestop button\n /*safestop commented out\n if (joysticks.getRightButton(10))//Buttons on top of right stick stops robot\n {\n safeStop();\n //delay to allow driver to release button\n Timer.delay(.1);\n myDog.feed();\n //at this point driver should have released the butto\n while (!joysticks.getRightTop()) {\n myDog.feed();\n }\n //now the button is pressed again, indicating a restart- the program can continue\n\n //slight delay to allow driver to release the button before the next loop\n Timer.delay(.1);\n }\n */\n\n //if arm is in teleop mode, handles input accordingly\n if (armState == TELEOP) {\n handleArmInput();\n }\n\n //if arm is in auto mode, checks whether user is pressing button 1 to regain\n //control and stops the auto task if so\n\n /*\n arm never goes to auto mode, so this is commented out\n\n (armState == AUTO) {\n //if the driver is attempting to cancel the task OR the task is done, return control\n //to the driver\n if (armJoystick.getRawButton(7) || !armTask.isRunning()) {\n armTask.interrupt();\n armTask.stop();\n armState = TELEOP;\n }\n }\n */\n\n //if drive is in teleop mode, handles input accordingly\n if (driveState == TELEOP) {\n try {\n handleDriveInput();\n } catch (EnhancedIOException e) {\n }\n\n }\n\n //if drive is in auto mode, checks whether user is trying to regain control\n /*not used\n if (driveState == AUTO) {\n //if the driver is attempting to cancel the task OR the task is done, return control\n //to the driver\n if (joysticks.getLeftButton(1) || !driveTask.isRunning()) {\n driveTask.interrupt();\n driveTask.stop();\n driveState = TELEOP;\n }\n }\n */\n\n\n printToScreen(\"Gyro Angle: \" + arm.gyro.getAngle());\n printToScreen(\"Arm Angle: \" + arm.getArmAngle());\n }", "public void duelmode(ScannedRobotEvent e) {\r\n //run predictive_shooter()\r\n if(e.getEnergy() <= 20) {\r\n //shoot things\r\n engage(e);\r\n } runaway(e);\r\n }", "public void noFlights();", "void nearingTheWallBefore(){\n robot.absgyroRotation(0, \"absolute\");\n\n //alligning with the wall before going for the toy\n while(robot.leftDistanceSensor.getDistance(DistanceUnit.CM) > 15 && !isStopRequested()){\n if(robot.leftDistanceSensor.getDistance(DistanceUnit.CM) < 30)\n robot.mecanumMovement(0, .3, 0);\n else\n robot.mecanumMovement(0, .7, 0);\n\n telemetry.addLine(\"Distance from sensor: \" + robot.leftDistanceSensor.getDistance(DistanceUnit.CM));\n telemetry.update();\n }\n robot.mecanumMovement(0, 0, 0);\n\n robot.absgyroRotation(45, \"absolute\");\n }", "public AirCondition(){}", "public void teleopPeriodic() {\n\t\t// resetAndDisable();\n\t\tupdateDashboard();\n\t\tLogitechJoystick.controllers();\n\t\tDrivetrain.arcadeDrive();\n\t\tShooterAngleMotor.angleShooter();\n\t\tBallShooter.shootBalls();\n\t\tSonicSensor.updateSensors();\n\t\t\n\t\t//if(LogitechJoystick.rightBumper2)\n\t\t\t//{\n\t\t\t\t//LowBar.makeArmStable();\n\t\t\t//}\n\n\t}", "@EventHandler\n public void weatherChange(WeatherChangeEvent event) {\n if (event.isCancelled()) {\n return;\n }\n MultiverseWorld world = this.plugin.getMVWorldManager().getMVWorld(event.getWorld().getName());\n if (world != null) {\n // If it's going to start raining and we have weather disabled\n event.setCancelled((event.toWeatherState() && !world.isWeatherEnabled()));\n }\n }", "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 }", "@Override\n\tpublic void canTakeOff() {\n\t\tSystem.out.println(\"I CANNOT TAKE OFF UNLESS YA JUMP ME OVER SOMMAT\");\n\t}", "public void teleopPeriodic() {\n Scheduler.getInstance().run();\n// if (oi.driveStick.getRawButton(4)) {\n// System.out.println(\"Left Encoder Distance: \" + RobotMap.leftDriveEncoder.getDistance());\n// System.out.println(\"RightEncoder Distance: \" + RobotMap.rightDriveEncoder.getDistance());\n// }\n\n }", "boolean canFall();", "@Override\n\tpublic boolean isDanger() {\n\t\tSharedPreferences prefs = NotificationStack.context.getSharedPreferences(\"com.app.virtualguardian\", Context.MODE_PRIVATE); \n\t\tint distancia=pingGps(Latitud,Longitud);\n\t\tint distanciaAuto=pingCar();\n\t\tint maxPer = Integer.parseInt(prefs.getString(\"distanciaPersonal\",\"3000\")); \n\t\tint maxCar = Integer.parseInt(prefs.getString(\"distanciaAuto\",\"3000\"));\n\t\tif(distancia<=maxPer){\n\t\t\t//avisaamigos\n\t\t\tavisaAmigos(distancia);\n\t\t}\n\t\tif(distanciaAuto<=maxCar){\n\t\t\t//avisaauto\n\t\t\tavisaAuto(distanciaAuto);\n\t\t}\n\t\tif(distancia<=maxPer || distanciaAuto<=maxCar)return true;\n\t\treturn false;\n\t}", "public int water(){\n //TODO\n }", "@Override\n @SuppressWarnings(\"empty-statement\")\n public void attack(){\n\n if (myTerritory.getAlpha() <= 0.5){\n myTerritory.produceSoldiers(myTerritory.getNatRes(), myTerritory.getPeasants());\n attackingSoldiers = myTerritory.getSoldiers()/4;\n defendingSoldiers = myTerritory.getSoldiers()*3/4;\n attackedTerritoryID = (new Random()).nextInt(myTerritory.getNeighbors().numObjs) + 1;\n }\n else\n myTerritory.produceSoldiers(myTerritory.getNatRes(), myTerritory.getPeasants());\n attackingSoldiers = myTerritory.getFoodGrowth()/4;\n defendingSoldiers = myTerritory.getFoodGrowth()*3/4;\n attackedTerritoryID = (new Random()).nextInt(myTerritory.getNeighbors().numObjs) + 1;\n }", "private void findWindSpeeds(ForecastIO FIO, WeatherlyDayForecast day){\n FIOHourly hourlyForecast = new FIOHourly(FIO);\n\n //Determine the number of hours left in the day\n Calendar rightNow = Calendar.getInstance();\n int dayHoursLeft = 24 - rightNow.get(Calendar.HOUR_OF_DAY);\n\n //Find the lowest and highest chances for precipitation for the rest of the day\n double minSpeed = hourlyForecast.getHour(0).windSpeed();\n double maxSpeed = minSpeed;\n int maxHour = rightNow.get(Calendar.HOUR_OF_DAY);\n for (int i = 1; i < dayHoursLeft; i++){\n double speed = hourlyForecast.getHour(i).windSpeed();\n if (minSpeed > speed)\n minSpeed = speed;\n if (maxSpeed < speed) {\n maxSpeed = speed;\n maxHour = i + rightNow.get(Calendar.HOUR_OF_DAY);\n }\n\n }\n\n day.setWindMin((int) (minSpeed + 0.5));\n day.setWindMax((int) (maxSpeed + 0.5));\n day.setWindMaxTime(maxHour);\n }", "public void updateDeviceAir(){\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.add(Calendar.DATE, -1);\n\t\tDate date = calendar.getTime();\n\t\tDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\tString time = df.format(date);\n\t\t\n\t\tHashMap<String, Integer> insideMap = deviceStatusDao.getAverageInside(time + \"%\");\n\t\tHashMap<String, Integer> outsideMap = deviceStatusDao.getAverageOutside(time + \"%\");\n\t\t//pair device air & city air\n\t\tfor(String device_id : insideMap.keySet()){\n\t\t\tDeviceAir deviceAir = new DeviceAir();\n\t\t\tdeviceAir.setDeviceID(device_id);\n\t\t\tdeviceAir.setInsideAir(insideMap.get(device_id));\n\t\t\tif(!outsideMap.containsKey(device_id)){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdeviceAir.setOutsideAir(outsideMap.get(device_id));\n\t\t\tdeviceAir.setDate(time);\n\t\t\tdeviceStatusDao.insertDeviceAir(deviceAir);\n\t\t}\n\t}", "private void setAirCondTemp(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_setAirCondTemp\n\n String tempStr = this.acTempTextField.getText();\n System.out.println(tempStr);\n // make sure the user doesnt set an unreasonable temp\n if (Double.parseDouble(tempStr) < 40.0 || Double.parseDouble(tempStr) > 60.0 ){\n System.out.println(\"Error. Please set a temperature between 40.0 - 60.0\");\n\n }else{\n this.setTemp = Double.parseDouble(tempStr);\n this.turnOnAC(Double.parseDouble(tempStr));\n }\n }", "@Override\n public void teleopPeriodic() {\n // drive.DrivePeriodic();\n controllerMap.controllerMapPeriodic();\n // intake.IntakePeriodic();\n // climb.ClimbPeriodic();\n\n }", "@Override\n\tpublic void teleopPeriodic() {\n\t\tRobot.intakeSubsystem._getSpeed();\n\n\t\tRobot.driveSubsystem.operatorOverride();\n\t\tScheduler.getInstance().run();\n\n\t\tTargetRegion boilerTarget = Robot.navigator.getBoilerTarget();\n\t\tif (boilerTarget != null) {\n\t\t\tSmartDashboard.putNumber(\"Target Center X\", boilerTarget.m_centerTop);\n\t\t\tSmartDashboard.putNumber(\"Target Center Y\", boilerTarget.m_bounds.m_top);\n\t\t} else {\n\t\t\tSmartDashboard.putNumber(\"Target Center X\", -1);\n\t\t\tSmartDashboard.putNumber(\"Target Center Y\", -1);\n\t\t}\n\t}", "AttackResult smartAttack();", "@NonNull boolean waterlogged();", "private void turnOffAirCond(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_turnOffAirCond\n\n this.selectedTrain.setAC(0);\n this.operatingLogbook.add(\"Turned off AC.\");\n this.printOperatingLogs();\n }", "@Override\n public void periodic() {\n SmartDashboard.putBoolean(\"Climber Safety Mode: \", Robot.m_oi.getSafety());\n\n if (Robot.m_oi.getSafety()) {\n \t\tif (Robot.m_oi.getClimbUp()) {\n // if (printDebug) {\n // System.out.println(\"Climb: up speed = \" + speed);\n // }\n // talonMotor.setInverted(false); // do not reverse motor\n talonMotor.set(-speed); // activate motor\n\n \t\t} else if (Robot.m_oi.getClimbDown()) {\n // if (printDebug) {\n // System.out.println(\"IntakeArm: retract speed = \" + speed);\n // }\n // talonMotor.setInverted(true); // reverse motor\n talonMotor.set(speed);\n \n \t\t} else { // else no hand button pressed, so stop motor\n talonMotor.set(0);\n }\n\n if (climbState == 0 && Robot.m_oi.getClimbUp()) {\n climbState = 1;\n }\n\n if (climbState == 1 && Robot.m_oi.getClimbDown()) {\n climbState = 2;\n }\n\n if (climbState == 2 && talonMotor.getSensorCollection().isFwdLimitSwitchClosed()) {\n // Activiate the solenoid\n RobotMap.solenoid.extendSolenoid(true);\n }\n }\n }", "@Override\n\tprotected void takeOff(){\n\t\tgvh.log.i(TAG, \"Drone taking off\");\n\t\tsetControlInput(0, 0, 0, 1);\n\t}", "@Override\n\tpublic void teleopPeriodic() {\n\t\t\n\t\t\n\t\t\n//\t\tSmartDashboard.putBoolean(\"Alliance_R\", alliance_R_SwitchState);\n//\t\tSmartDashboard.putBoolean(\"Alliance_L\", alliance_L_SwitchState);\n//\t\tSmartDashboard.putBoolean(\"Scale_R\", R_scaleState);\n//\t\tSmartDashboard.putBoolean(\"Scale_L\", L_scaleState);\n//\t\tSmartDashboard.putBoolean(\"oppisite_R\", opposite_R_SwitchState);\n//\t\tSmartDashboard.putBoolean(\"opposite_L\", opposite_L_SwitchState);\n//\t\t\n//\t\tSmartDashboard.putNumber(\"right Vel\", chassis.rightMagVelocity());\n//\t\tSmartDashboard.putNumber(\"left Vel\", chassis.leftMagVelocity());\n//\t\tSmartDashboard.putNumber(\"right Pos\", chassis.rightMagPosition());\n//\t\tSmartDashboard.putNumber(\"left Pos\", chassis.leftMagPosition());\n\t\tSmartDashboard.putData(\"gyro\", chassis.navx);\n\t\tSmartDashboard.putData(\"Chassis\",chassis);\n\t\tSmartDashboard.putBoolean(\"shift is high\", chassis.shiftIsHigh);\n\t\tSmartDashboard.putNumber(\"Arm Pot Value\", Robot.arm.getArmPot());\n\t\tSmartDashboard.putNumber(\"Elevator Encoder\", elevator.getElevatorMagPosition());\n\t\t\n//\t\tSmartDashboard.putNumber(\"TurnPID\", chassis.turnSpeed.getSpeed());\n//\t\tSmartDashboard.putData(\"TurnController\", chassis.turnController);\n//\t\tSmartDashboard.putData(\"Turn\",new Turn());\t\t\n//\t\tSmartDashboard.putNumber(\"leftDistPID\", chassis.leftDistanceSpeed.getSpeed());\n//\t\tSmartDashboard.putNumber(\"rightDistPID\", chassis.rightDistanceSpeed.getSpeed());\n//\t\tSmartDashboard.putData(\"right drive controller\", chassis.rightDistanceController);\n//\t\tSmartDashboard.putData(\"left drive controller\", chassis.leftDistanceController);\t\t\t\n//\t\tSmartDashboard.putData(\"test\",new drivefrompoint());\n\t\tSmartDashboard.putData(\"Arm PID\", arm.armPID);\n\t\tSmartDashboard.putData(\"Elevator PID\", elevator.elePID);\n\t\tSmartDashboard.putData(\"Elevator Subsystem\", elevator);\n\t\tSmartDashboard.putData(\"Hold Climb Command\", new LowerElevatorManual(0.1));\n\t\t\n\t\tSmartDashboard.putNumber(\"intake lead current\", Robot.intake.intakeLeader.getOutputCurrent());\n\t\tSmartDashboard.putNumber(\"intake follow current\", Robot.intake.intakeFollower.getOutputCurrent());\n\t\t\n\t\tSmartDashboard.putNumber(\"arm current\", arm.arm.getOutputCurrent());\n\t\t//SmartDashboard.putBoolean(\"Upper Elevator Limit Switch\", elevato);\n\t\t\n\t\tScheduler.getInstance().run();\n\t\t\n\t\t\n\t\tif(!elevator.getBottomElevatorLimit()) {\n\t\t\televator.resetElevatorMag();\n\t\t}\n\t\t\n\t}", "private final void maintain(){\n\t\tif(host.getStrength()>MAINTENANCE_COST){\n\t\t\thost.expend(MAINTENANCE_COST);\n\t\t}\n\t\telse{\n\t\t\tkill();\n\t\t}\n\t}", "public void action() {\r\n\t\tsuppressed = false;\r\n\t\tMotor.B.stop();\r\n\t\tMotor.C.stop();\r\n\t\tDelay.msDelay(1000);\r\n\t\tMotor.B.setSpeed(180);\r\n\t\tMotor.C.setSpeed(180);\r\n\t\tMotor.B.forward();\r\n\t\tMotor.C.forward();\r\n\t\tif((light.getLightValue()>46 && light.getLightValue()<49) || (light.getLightValue()>27 && light.getLightValue()<31)){\r\n\t\t\tMotor.B.stop();\r\n\t\t\tMotor.C.stop();\r\n\t\t\tDelay.msDelay(500);\r\n\t\t\tMotor.B.forward();\r\n\t\t\tMotor.C.forward();\r\n\t\t\tif(light.getLightValue()>44 && light.getLightValue()<45){//home base\r\n\t\t\t\tMotor.B.stop();\r\n\t\t\t\tMotor.C.stop();\r\n\t\t\t}\r\n\t\t}\r\n\t\twhile(!suppressed){\r\n\t\t\tThread.yield();\r\n\t\t}\r\n\t}", "@Override\n public void onStationary() {\n showToast(\"设备停止移动\");\n LogUtil.e(\"stop_move\");\n }", "public void pleaseStop()\n {\n\t this.doorgaan_thread = false;\n\t this.doorgaan_wheel = true;\n draad = null; // waarom? \n }", "@Override\n\tpublic void action() {\n\t\tsuppressed = false;\n\t\tSettings.readState = true;\n\t\tSettings.atStartOfMaze = false;\n\t\tpilot.travel(-5);\n\t\tpilot.rotate(100);\n\t\twhile( pilot.isMoving() && !suppressed );\n\t\tpilot.stop();\n\t}", "protected boolean canSustainPlant(IBlockState state){\n return state.getBlock() == getSoilBlock();\n }", "@Override\n public void teleopPeriodic() {\n double triggerVal = \n (m_driverController.getTriggerAxis(Hand.kRight)\n - m_driverController.getTriggerAxis(Hand.kLeft))\n * RobotMap.DRIVING_SPEED;\n\n double stick = \n (m_driverController.getX(Hand.kLeft))\n * RobotMap.TURNING_RATE;\n \n m_driveTrain.tankDrive(triggerVal + stick, triggerVal - stick);\n\n if(m_driverController.getAButton()){\n m_shooter.arcadeDrive(RobotMap.SHOOTER_SPEED, 0.0);\n }\n \n else{\n m_shooter.arcadeDrive(0.0, 0.0);\n }\n \n }", "boolean stop()\n {\n boolean success = true; // Tells whether attempt to stop lift is successful or not\n\n try\n {\n _motor.setPower(0);\n }\n catch(Exception e)\n {\n Log.e(\"Error\" , \"Cannot stop lift, check your mapping\");\n success = false;\n }\n\n return success;\n }", "public void liftArm(){armLifty.set(-drivePad.getThrottle());}", "public void windChillIndex()\n {\n\n System.out.print( \"Enter the damn wind speed: \" );\n double v = scan.nextDouble();\n System.out.print( \"Enter the darn temperature: \" );\n double t = scan.nextDouble();\n double wci;\n if ( 0 <= v && v <= 4 )\n {\n wci = t;\n System.out.println( \"The wind chill index is: \" + wci );\n }\n if ( v >= 45 )\n {\n wci = 1.6 * t - 55;\n System.out.println( \"The wind chill index is: \" + wci );\n }\n wci = 91.4 + ( 91.4 - t )\n * ( 0.0203 * v - 0.304 * Math.sqrt( (double)v ) - 0.474 );\n System.out.println( \"The wind chill index is: \" + wci );\n\n }", "void steady_flight_at_given_speed (double step, double start_pitch) {\n // preamble: make sure inputs are in\n //computeFlowAndRegenPlotAndAdjust();\n\n //strut.aoa = 0.5; // ad hoc\n\n recomp_all_parts();\n\n double load = FoilBoard.this.load;\n\n // now moved into load box and bar \n //rider.weight = load - BOARD_WEIGHT - RIG_WEIGHT - FOIL_WEIGHT;\n\n steady_flight_at_given_speed___ok = false; // so far util done\n\n craft_pitch = start_pitch;\n // double prev_pitch = -20; // we nned it only because pitch value gets rounded somewhere in recomp_all_parts...\n while (craft_pitch < aoa_max && craft_pitch > aoa_min) {\n //computeFlowAndRegenPlotAndAdjust();\n recomp_all_parts();\n double lift = foil_lift();\n if (lift == load // exact hit, done !(almost never happens, though)\n // happens due to rounding\n // || prev_pitch == craft_pitch\n ) \n break;\n if (step > 0 && lift > load) { // done or pivot\n if (step < 0.0025) { \n // done! flight is OK\n steady_flight_at_given_speed___ok = true;\n break;\n }\n step = -step/2; // shrink step & pivot\n } else if (step < 0 && lift < load) { \n step = -step/2; // shrink step & pivot\n } // else keep going with current stepa\n // prev_pitch = craft_pitch;\n craft_pitch += step;\n }\n\n // expect small increse in drag as the result\n vpp.set_mast_aoa_for_given_drag(total_drag()); // (wing.drag+stab.drag);\n recomp_all_parts();\n\n // old linearly increasing logic \n //find_aoa_of_min_drag();\n //if (foil_lift() > load_numeric) {\n // // need to reduce AoA\n // while (craft_pitch > aoa_min) {\n // craft_pitch -= 0.1;\n // System.out.println(\"-- reducing... craft_pitch: \" + craft_pitch);\n // computeFlowAndRegenPlotAndAdjust();\n // recomp_all_parts();\n // if (foil_lift() <= load_numeric) \n // break; // done\n // } \n //}\n //else if (foil_lift() < load_numeric) {\n // // need to increase AoA\n // while (craft_pitch < aoa_max) {\n // craft_pitch += 0.1;\n // System.out.println(\"-- increasing... craft_pitch: \" + craft_pitch);\n // computeFlowAndRegenPlotAndAdjust();\n // recomp_all_parts();\n // if (foil_lift() >= load_numeric) \n // break; // done\n // } \n //}\n\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n if (timerFlag) {\n sendInfo(\"heart\", (sim_flag ? bpm/sim_scale : bpm));\n timerFlag = false;\n\n HR_i++;\n if(HR_i>9) {\n HR_i = 0;\n over = true;\n }\n\n if (over)\n {\n HeartRateAvg = 0;\n for (int i=0;i<10;i++)\n {\n HeartRateAvg = HeartRateAvg + HeartRate[i];\n }\n HeartRateAvg = HeartRateAvg/10;\n if ((bpm>HeartRateAvg*1.3 || bpm<HeartRateAvg*0.7) && !sendAttackFlag && sendAttackFlagCnt>15)\n {\n sendInfo(\"attack\",0);\n sendAttackFlag = true;\n Toast.makeText(getApplicationContext(), \"HeartAttack\", Toast.LENGTH_SHORT).show();\n }\n sendAttackFlagCnt++;\n if (sendAttackFlag) {\n sendAttackFlagCnt++;\n if (sendAttackFlagCnt>10)\n {\n sendAttackFlagCnt=0;\n sendAttackFlag = false;\n }\n }\n }\n HeartRate[HR_i] = bpm;\n sendInfo (\"avg\", HeartRateAvg);\n }\n\n // Update the accelerometer\n if (flag) {\n if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {\n final float alpha = (float) 0.8;\n // Isolate the force of gravity with the low-pass filter.\n gravity[0] = alpha * gravity[0] + (1 - alpha) * event.values[0];\n gravity[1] = alpha * gravity[1] + (1 - alpha) * event.values[1];\n gravity[2] = alpha * gravity[2] + (1 - alpha) * event.values[2];\n\n // Remove the gravity contribution with the high-pass filter.\n linear_acceleration[0] = event.values[0] - gravity[0];\n linear_acceleration[1] = event.values[1] - gravity[1];\n linear_acceleration[2] = event.values[2] - gravity[2];\n\n totAcc = Math.sqrt(linear_acceleration[0] * linear_acceleration[0] +\n linear_acceleration[1] * linear_acceleration[1] +\n linear_acceleration[2] * linear_acceleration[2]);\n\n fallAcc = linear_acceleration[2];\n }\n\n // Update the heart rate\n if (event.sensor.getType() == Sensor.TYPE_HEART_RATE) {\n bpm = event.values[0];\n if (sim_flag)\n bpm = bpm/sim_scale;\n\n String message = String.valueOf ((int) bpm) + \" bpm\";\n heart.setText(message);\n }\n\n flag = false;\n\n FallCounter = ((totAcc > threshold) ? FallCounter + 1 : 0);\n\n if (FallCounter == 5 && !detected) {\n fallDetectionAction();\n }\n }\n }", "public void teleopPeriodic() {\n\n \t//NetworkCommAssembly.updateValues();\n \t\n\t\t// both buttons pressed simultaneously, time to cal to ground\n\t\tif (gamepad.getRawButton(FRONT_ARM_GROUND_CAL_BUTTON1) && gamepad.getRawButton(FRONT_ARM_GROUND_CAL_BUTTON2)) {\n\t\t\tprocessGroundCal();\n\t\t}\n\n\t\t// PID CONTROL ONLY\n\t\tdouble armDeltaPos = gamepad.getRawAxis(1);\n\t\tif (Math.abs(armDeltaPos) < ARM_DEADZONE) {\n\t\t\tarmDeltaPos = 0.0f;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tarmDeltaPos *= ARM_POS_MULTIPLIER;\n\t\t\tdouble currPos = testMotor.getPosition();\n\t\t\t\n\t\t\tif (((currPos > SOFT_ENCODER_LIMIT_MAX) && armDeltaPos > 0.0) || ((currPos < SOFT_ENCODER_LIMIT_FLOOR) && armDeltaPos < 0.0)) {\n\t\t\t\tSystem.out.println(\"SOFT ARM LIMIT HIT! Setting armDeltaPos to zero\");\n\t\t\t\tarmDeltaPos = 0.0;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tdouble newPos = currPos + armDeltaPos;\n\t\t\ttestMotor.set(newPos);\n\t\t\tSystem.out.println(\"Setting new front arm pos = \" + newPos);\t\n\t\t}\t\t\n\n \t/*\n\t\tdouble newArmPos = gamepad.getRawAxis(1);\n\t\tif(Math.abs(newArmPos) <= ARM_DEADZONE) {\n\t\t\tnewArmPos = 0.0;\n\t\t}\n\t\tdouble newMotorPos = (newArmPos * ARM_SPEED_MULTIPLIER) + testMotor.getPosition();\n\t\tpositionMoveByCount(newMotorPos);\n\t\tSystem.out.println(\"input = \" + newArmPos + \" target pos = \" + newMotorPos + \" enc pos = \" + testMotor.getPosition());\n \t*/\n \t\n\t\t// PercentVbus test ONLY!!\n \t/*\n\t\tdouble armSpeed = gamepad.getRawAxis(1);\n\t\tif (Math.abs(armSpeed) < ARM_DEADZONE) {\n\t\t\tarmSpeed = 0.0f;\n\t\t}\t\n\t\tarmSpeed *= ARM_MULTIPLIER;\n\t\t\n\t\tdouble pos= testMotor.getPosition();\n\t\tif (((pos > SOFT_ENCODER_LIMIT_1) && armSpeed < 0.0) || ((pos < SOFT_ENCODER_LIMIT_2) && armSpeed > 0.0))\n\t\t\tarmSpeed = 0.0;\n\t\ttestMotor.set(armSpeed);\n\t\t\n\t\tSystem.out.println(\"armSpeed = \" + armSpeed + \" enc pos = \" + testMotor.getPosition());\n\t\t */ \n }", "@Override\n public void run() {\n for(int i=0;i<TheWeatherMan.WEATHER_CHECKS; i++) {\n\n // Have some delay\n try {\n Thread.sleep(1000* startTime);\n } catch (InterruptedException e) {\n System.out.println(\"『 Weather Report 』 Pacific has gone berserk and cant sleep.\\n\" +\n \"Terminating Program...\");\n System.exit(1);\n }\n\n /**\n * Handling Different City Temperatures -------------------------------------------\n */\n\n\n // Handling Singapore Temperatures\n if(cityName == \"Singapore\") {\n\n // Generates a random number between -.3 and .3\n double randNum = (Math.random() * (.6)) - .3;\n // Formats decimals to 2 places\n DecimalFormat df = new DecimalFormat(\"#.##\");\n\n cityTemperature = Double.valueOf(df.format((cityTemperature + randNum)));\n // Set Temp\n ((Satellite) satellite).setWeather1(cityTemperature);\n }\n\n // Handling Melbourne Temperatures\n if(cityName == \"Melbourne\") {\n Random random = new Random();\n double temp = (double) random.nextInt(45) + random.nextDouble();\n\n cityTemperature = temp;\n // Set Temp\n ((Satellite) satellite).setWeather2(cityTemperature);\n }\n\n // Handling Shanghai Temperatures\n if(cityName == \"Shanghai\") {\n\n // Fluctuate +-5\n Random random = new Random();\n double temp = ((double) random.nextInt(5) +\n random.nextDouble()) * (random.nextBoolean() ? 1 : -1);\n\n\n cityTemperature = cityTemperature + temp;\n // Set Temp\n ((Satellite) satellite).setWeather3(cityTemperature);\n }\n\n }\n }", "public void teleopPeriodic() \n {\n // NIVision.Rect rect = new NIVision.Rect(10, 10, 100, 100);\n /*\n NIVision.IMAQdxGrab(session, frame, 1);\n //NIVision.imaqDrawShapeOnImage(frame, frame, rect,\n // DrawMode.DRAW_VALUE, ShapeMode.SHAPE_OVAL, 0.0f);\n */\n \n //cam.getImage(frame);\n //camServer.setImage(frame);\n \n //CameraServer.getInstance().setImage(frame);\n \n if(verticalLift.limitSwitchHit())\n verticalLift.resetEnc();\n \n Scheduler.getInstance().run();\n }", "public boolean isOverSpeed(){ return vehicleAvarageSpeed > roadMaxSpeed; }", "@Override\n public void onPourWaterRaised() {\n if (theFSM.getCupPlaced()) {\n pouringState = true;\n }\n }", "private void condenseSteam() {\n if (getPressure()> Constants.ATMOSPHERIC_PRESSURE) {\n double boilingPoint = Water.getBoilingTemperature(getPressure());\n if (boilingPoint > steam.getTemperature()) { // remove steam such that it equalizes to the boiling point\n double newSteamPressure = Math.max(Water.getBoilingPressure(steam.getTemperature()), Constants.ATMOSPHERIC_PRESSURE);\n \n\n int newQuantity = steam.getParticlesAtState(newSteamPressure, getCompressibleVolume());\n int deltaQuantity = steam.getParticleNr() - newQuantity;\n if (deltaQuantity < 0) {\n System.out.println(\"BAD\");\n }\n steam.remove(deltaQuantity);\n getWater().add(new Water(steam.getTemperature(), deltaQuantity));\n }\n } \n }", "private void travelToAirport()\n {\n try\n { sleep ((long) (1 + 30000 * Math.random ()));\n }\n catch (InterruptedException e) {}\n }", "@Override\n\tpublic void teleopPeriodic() {\n\t\tupdate();\n\t\t\n\t\t//dashboard outputs\n\t\tdashboardOutput();\n\t\t\n\t\t\n\t\t\n\t\tif (tankDriveBool) {\n\t\t\ttankDrive();\n\t\t} \n\t\telse {\n\t\t\ttankDrive();\n\t\t}\n\t\tif (buttonA) {\n\t\t\ttest = true;\n\t\t\twhile (test) {\n\t\t\t\tcalibrate(10);\n\t\t\t\ttest = false;\n\t\t\t}\n\t\t}\n\t\tif (buttonY) {\n\t\t\tclimbMode = !climbMode;\n\t\t\tcontroller.setRumble(Joystick.RumbleType.kRightRumble, 0.5);\n\t\t\tcontroller.setRumble(Joystick.RumbleType.kLeftRumble, 0.5);\n\t\t\tTimer.delay(0.5);\n\t\t\tcontroller.setRumble(Joystick.RumbleType.kRightRumble, 0);\n\t\t\tcontroller.setRumble(Joystick.RumbleType.kLeftRumble, 0);\n\t\t}\n\t\tverticalMovement();\n\t\tgrab();\n\t}", "TrafficTreatment treatment();", "public void teleopPeriodic() {\r\n //Driving\r\n if (driveChooser.getSelected().equals(\"tank\")){\r\n if (joystickChooser.getSelected().equals(\"two\")){\r\n drive.tankDrive(leftJoystick.getY(), rightJoystick.getY());\r\n } \r\n else {\r\n drive.tankDrive(manipulator.getY(), manipulator.getThrottle());\r\n }\r\n }\r\n if (driveChooser.getSelected().equals(\"arcade1\")){\r\n if (joystickChooser.getSelected().equals(\"two\")){\r\n drive.arcadeDrive(leftJoystick.getY(), leftJoystick.getX());\r\n } \r\n else {\r\n drive.arcadeDrive(manipulator.getY(), manipulator.getX());\r\n }\r\n }\r\n if (driveChooser.getSelected().equals(\"arcade2\")){\r\n if (joystickChooser.getSelected().equals(\"two\")){\r\n drive.arcadeDrive(leftJoystick.getY(), rightJoystick.getX());\r\n }\r\n else{\r\n drive.arcadeDrive(manipulator.getY(), manipulator.getTwist());\r\n }\r\n }\r\n \r\n //Shooting\r\n if (shootButton1.get()||shootButton2.get()){\r\n frontShooter.set(-1);\r\n backShooter.set(1);\r\n }\r\n else{\r\n frontShooter.set(0);\r\n backShooter.set(0); \r\n }\r\n if (transportButton1.get()||transportButton2.get()){\r\n transport.set(-1);\r\n }\r\n else{\r\n transport.set(0); \r\n }\r\n \r\n //Intake\r\n if (intakeButton1.get()||intakeButton2.get()){\r\n //intakeA.set(-1);BROKEN\r\n intakeB.set(-1);\r\n }\r\n else{\r\n intakeA.set(0);\r\n intakeB.set(0); \r\n }\r\n \r\n //Turret\r\n if (toggleTurretButton.get()){\r\n turret.set(leftJoystick.getX());\r\n }\r\n else{\r\n turret.set(manipulator.getX());\r\n }\r\n }", "public boolean shouldDieAtEndOfTurnBecauseOfWater() {\n return shouldDieAtEndOfTurnBecauseOfWater;\n }", "@Override\n public void robotPeriodic() {\n\n enabledCompr = pressBoy.enabled();\n //pressureSwitch = pressBoy.getPressureSwitchValue();\n currentCompr = pressBoy.getCompressorCurrent();\n //SmartDashboard.putBoolean(\"Pneumatics Loop Enable\", closedLoopCont);\n SmartDashboard.putBoolean(\"Compressor Status\", enabledCompr);\n //SmartDashboard.putBoolean(\"Pressure Switch\", pressureSwitch);\n SmartDashboard.putNumber(\"Compressor Current\", currentCompr);\n }", "public void getDanger(){\r\n\t\r\n\tif(isnow>0){ //is it snow?\r\n\t\t// There is snow, we set all spread indexes to 0\r\n\t\tset_AllSpreadIndexToZero();\r\n\t\t\r\n\t\tadjust_BUI();\r\n\t}else {\r\n\t\t\t//There is no snow on the ground we will compute the spread indexes and fire load\r\n\r\n\t\t\t//Calculate Fine fuel moisture\r\n\t\t\tcal_FineFuelMoisture();\r\n\t\t\t\r\n\t\t\t//calculate the drying factor for the day\r\n\t\t\tcal_DryFactor();\r\n\t\t\t\r\n\t\t\t// adjust fine fuel moist\t\t\r\n\t\t\tadjust_FineFuelMoisture();\r\n\t\t}\r\n\t\r\n\tif (precip>0.1){ // is it rain?\r\n\t\t//There is rain (precipitation >0.1 inch), we must reduce the build up index (BUO) by \r\n\t\t//an amount equal to rain fall\r\n\t\tadjust_BUI();\r\n\t}else{\r\n\t\t//After correct for rain, if any, we are ready to add today's dring factor to obtain the \r\n\t\t//current build up index\r\n\t\tincrease_BUIBYDryingFactor();\r\n\t\t\r\n\t\t//we will adjust the grass index for heavy fuel lags. The result will be the timber spread index\r\n\t\t//The adjusted fuel moisture, ADFM, Adjusted for heavy fuels, will now be computed.\r\n\t\tcal_AdjustedFuelMoist();\r\n\t\t\r\n\t\tif (ADFM>33){\r\n\t\t\tset_AllSpreadIndexToOne();\r\n\r\n\t\t\t}else{\r\n\t\t\t\t//whether wind>14? and calculate grass and timber spread index\r\n\t\t\t\tcal_GrassAndTimber();\r\n\t\t\t\t//Both BUI and Timber spread index are not 0?\r\n\t\t\t\tif (!((TIMBER==0)&(BUO==0))){\r\n\t\t\t\t\tcal_FireLoadRating();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n}", "public void towerIndexing()\n {\n m_towerMotor.set(ControlMode.PercentOutput, 0.5);\n m_intakeHopperMotor.set(ControlMode.PercentOutput, HopperConstants.HOPPER_MOTOR_POWER);\n }", "@Override\n public void runOpMode() {\n motorFL = hardwareMap.get(DcMotor.class, \"motorFL\");\n motorBL = hardwareMap.get(DcMotor.class, \"motorBL\");\n motorFR = hardwareMap.get(DcMotor.class, \"motorFR\");\n motorBR = hardwareMap.get(DcMotor.class, \"motorBR\");\n landerRiser = hardwareMap.get(DcMotor.class, \"lander riser\");\n landerRiser = hardwareMap.get(DcMotor.class, \"lander riser\");\n landerRiser.setDirection(DcMotor.Direction.FORWARD);\n landerRiser.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n markerDrop = hardwareMap.get(Servo.class, \"marker\");\n markerDrop.setDirection(Servo.Direction.FORWARD);\n telemetry.addData(\"Status\", \"Initialized\");\n telemetry.update();\n\n // Wait for the game to start (driver presses PLAY)\n waitForStart();\n runtime.reset();\n\n //Landing & unlatching\n landerRiser.setPower(-1);\n telemetry.addData(\"Status\", \"Descending\");\n telemetry.update();\n sleep(5550);\n landerRiser.setPower(0);\n telemetry.addData(\"Status\",\"Unhooking\");\n telemetry.update();\n move(-0.5, 600, true);\n strafe(-0.4,0.6, 3600, true);\n move(0.5,600,true);\n markerDrop.setPosition(0);\n sleep(1000);\n markerDrop.setPosition(0.5);\n sleep(700);\n markerDrop.setPosition(0);\n strafe(0, -0.5,500,true);\n strafe(0.5, -0.25, 8500, true);\n\n }", "public void action() {\n\t\tsuppressed = false;\r\n\t\tpilot.setLinearSpeed(8);\r\n\t\tpilot.setLinearAcceleration(4);\r\n\t\tColorThread.updatePos = false;\r\n\t\tColorThread.updateCritical = false;\r\n\t\t//create a array to save the map information\r\n\t\tfor (int a = 0; a < 8; a++) {\r\n\t\t\tfor (int b = 0; b < 8; b++) {\r\n\t\t\t\trobot.probability[a][b] = -1;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (int a = 0; a < 8; a++) {\r\n\t\t\tfor (int b = 0; b < 8; b++) {\r\n\t\t\t\tif (a == 0 || a == 7 || b == 0 || b == 7) {\r\n\t\t\t\t\trobot.probability[a][b] = 100;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (int a = 0; a < 6; a++) {\r\n\t\t\tfor (int b = 0; b < 6; b++) {\r\n\t\t\t\tif (robot.map[a][b].getOccupied() == 1) {\r\n\t\t\t\t\trobot.probability[a + 1][b + 1] = 100;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Step1: use ArrayList to save all of the probability situation.\r\n\t\tfloat front, left, right, back;\r\n\t\tfront = USThread.disSample[0];\r\n\t\trobot.setmotorM(90);\r\n\t\tDelay.msDelay(1000);\r\n\t\tleft = USThread.disSample[0];\r\n\t\trobot.setmotorM(-180);\r\n\t\tDelay.msDelay(1000);\r\n\t\tright = USThread.disSample[0];\r\n\t\trobot.setmotorM(90);\r\n\t\tDelay.msDelay(1000);\r\n\t\trobot.correctHeading(180);\r\n\t\tDelay.msDelay(1000);\r\n\t\tback = USThread.disSample[0];\r\n\t\trobot.correctHeading(180);\r\n\t\tfor (int a = 1; a < 7; a++) {\r\n\t\t\tfor (int b = 1; b < 7; b++) {\r\n\t\t\t\tif (robot.probability[a][b] == -1) {\r\n\t\t\t\t\tif (((robot.probability[a][b + 1] == 100 && front < 0.25)\r\n\t\t\t\t\t\t\t|| (robot.probability[a][b + 1] == -1 && front > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a + 1][b] == 100 && right < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a + 1][b] == -1 && right > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b - 1] == 100 && back < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b - 1] == -1 && back > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a - 1][b] == 100 && left < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a - 1][b] == -1 && left > 0.25))) {\r\n\t\t\t\t\t\t//direction is north\r\n\t\t\t\t\t\trobot.listOfPro.add(new ProPoint(0, 0, a, b));\r\n\t\t\t\t\t\t//System.out.println(\"0 \"+a+\" \"+b);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (((robot.probability[a + 1][b] == 100 && front < 0.25)\r\n\t\t\t\t\t\t\t|| (robot.probability[a + 1][b] == -1 && front > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b - 1] == 100 && right < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b - 1] == -1 && right > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a - 1][b] == 100 && back < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a - 1][b] == -1 && back > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b + 1] == 100 && left < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b + 1] == -1 && left > 0.25))) {\r\n\t\t\t\t\t\t// direction is east\r\n\t\t\t\t\t\trobot.listOfPro.add(new ProPoint(1, 0, a, b));\r\n\t\t\t\t\t\t//System.out.println(\"1 \"+a+\" \"+b);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (((robot.probability[a][b - 1] == 100 && front < 0.25)\r\n\t\t\t\t\t\t\t|| (robot.probability[a][b - 1] == -1 && front > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a - 1][b] == 100 && right < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a - 1][b] == -1 && right > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b + 1] == 100 && back < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b + 1] == -1 && back > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a + 1][b] == 100 && left < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a + 1][b] == -1 && left > 0.25))) {\r\n\t\t\t\t\t\t// direction is sourth\r\n\t\t\t\t\t\trobot.listOfPro.add(new ProPoint(2, 0, a, b));\r\n\t\t\t\t\t\t//System.out.println(\"2 \"+a+\" \"+b);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (((robot.probability[a - 1][b] == 100 && front < 0.25)\r\n\t\t\t\t\t\t\t|| (robot.probability[a - 1][b] == -1 && front > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b + 1] == 100 && right < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b + 1] == -1 && right > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a + 1][b] == 100 && back < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a + 1][b] == -1 && back > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b - 1] == 100 && left < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b - 1] == -1 && left > 0.25))) {\r\n\t\t\t\t\t\t// direction is west\r\n\t\t\t\t\t\trobot.listOfPro.add(new ProPoint(3, 0, a, b));\r\n\t\t\t\t\t\t//System.out.println(\"3 \"+a+\" \"+b);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Step 2: use loop to take control of robot walk and check the location correction\r\n\t\tboolean needLoop = true;\r\n\t\tint loopRound = 0;\r\n\t\twhile (needLoop) {\r\n\t\t\t// One of way to leave the loop is at the hospital\r\n\t\t\tif ((ColorThread.leftColSample[0] >= 0.2 && ColorThread.leftColSample[1] < 0.2\r\n\t\t\t\t\t&& ColorThread.leftColSample[1] >= 0.14 && ColorThread.leftColSample[2] <= 0.8)\r\n\t\t\t\t\t&& (ColorThread.rightColSample[0] >= 0.2 && ColorThread.rightColSample[1] < 0.2\r\n\t\t\t\t\t\t\t&& ColorThread.rightColSample[1] >= 0.11 && ColorThread.rightColSample[2] <= 0.08)) {\r\n\t\t\t\trobot.updatePosition(0, 0);\r\n\t\t\t\tint numOfAtYellow = 0;\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getNowX() == 1 && robot.listOfPro.get(i).getNowY() == 1) {\r\n\t\t\t\t\t\tnumOfAtYellow++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(numOfAtYellow == 1) {\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getNowX() == 1 && robot.listOfPro.get(i).getNowY() == 1) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 3) {\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// do not to set the heading, because the default value is 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\t}else {\r\n\t\t\t\t\t//have two way to go to the yellow part\r\n\t\t\t\t\tfront = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(90);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tleft = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(-180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tright = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(90);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tback = USThread.disSample[0];\r\n\t\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tif(front<0.25 && right<0.25 && left>0.25 && back>0.25) {\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t}else if(front<0.25 && right>0.25 && back>0.25 && left<0.25) {\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t}else if(front>0.25 && right>0.25 && back<0.25 && left<0.25) {\r\n\t\t\t\t\t\t// do not to set the heading, because the default value is 0.\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tneedLoop = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t//Another way to leave the loop is the robot arrive the green cell.\r\n\t\t\tif ((ColorThread.leftColSample[0] <= 0.09 && ColorThread.leftColSample[1] >= 0.17\r\n\t\t\t\t\t&& ColorThread.leftColSample[2] <= 0.09)\r\n\t\t\t\t\t&& (ColorThread.rightColSample[0] <= 0.09 && ColorThread.rightColSample[1] >= 0.014\r\n\t\t\t\t\t\t\t&& ColorThread.rightColSample[2] <= 0.11)) {\r\n\t\t\t\trobot.updatePosition(5, 0);\r\n\t\t\t\tint numOfAtGreen = 0;\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getNowX() == 6 && robot.listOfPro.get(i).getNowY() == 1) {\r\n\t\t\t\t\t\tnumOfAtGreen++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(numOfAtGreen==1) {\r\n\t\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowX() == 6 && robot.listOfPro.get(i).getNowY() == 1) {\r\n\t\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 3) {\r\n\t\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// do not to set the heading, because the default value is 0.\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else {\r\n\t\t\t\t\tfront = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(90);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tleft = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(-180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tright = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(90);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tback = USThread.disSample[0];\r\n\t\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tif(front<0.25 && right<0.25 && left>0.25 && back>0.25) {\r\n\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t}else if(front<0.25 && right>0.25 && back>0.25 && left<0.25) {\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t}else if(front>0.25 && right>0.25 && back<0.25 && left<0.25) {\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t// do not to set the heading, because the default value is 0.\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tneedLoop = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t//The third way of leave the loop is the robot have already know his position and direction.\r\n\t\t\tint maxStepNumber = 0;\r\n\t\t\tint numberOfMaxSteps = 0;\r\n\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\tif (robot.listOfPro.get(i).getSteps() > maxStepNumber) {\r\n\t\t\t\t\tmaxStepNumber = robot.listOfPro.get(i).getSteps();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\tif (robot.listOfPro.get(i).getSteps() == maxStepNumber) {\r\n\t\t\t\t\tnumberOfMaxSteps++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (numberOfMaxSteps == 1) {\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getSteps() == maxStepNumber) {\r\n\t\t\t\t\t\trobot.updatePosition(robot.listOfPro.get(i).getNowX() - 1,\r\n\t\t\t\t\t\t\t\trobot.listOfPro.get(i).getNowY() - 1);\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 3) {\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// do not to set the heading, because the default value is 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\tneedLoop = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t//The below part are the loops.\r\n\t\t\tfront = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(90);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tleft = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(-180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tright = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(90);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\trobot.correctHeading(180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tback = USThread.disSample[0];\r\n\t\t\trobot.correctHeading(180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\t// move\r\n\t\t\t\r\n\t\t\tif (front > 0.25) {\r\n\t\t\t\trobot.getPilot().travel(25);\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif(robot.listOfPro.get(i).getSteps()==loopRound) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() + 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() + 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() - 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() - 1);\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} else if (left > 0.25) {\r\n\t\t\t\trobot.correctHeading(-90);\r\n\t\t\t\trobot.getPilot().travel(25);\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif(robot.listOfPro.get(i).getSteps()==loopRound) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(3);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() - 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(0);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() + 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(1);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() + 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(2);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() - 1);\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} else if (right > 0.25) {\r\n\t\t\t\trobot.correctHeading(90);\r\n\t\t\t\trobot.getPilot().travel(25);\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif(robot.listOfPro.get(i).getSteps()==loopRound) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(1);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() + 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(2);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() - 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(3);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() - 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(0);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() + 1);\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} else {\r\n\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\trobot.getPilot().travel(25);\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif(robot.listOfPro.get(i).getSteps()==loopRound) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(2);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() - 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(3);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() - 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(0);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() + 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(1);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() + 1);\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\t// It time to check the around situation\r\n\t\t\tfront = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(90);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tleft = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(-180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tright = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(90);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\trobot.correctHeading(180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tback = USThread.disSample[0];\r\n\t\t\trobot.correctHeading(180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t//System.out.println(robot.listOfPro.get(i).getSteps());\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\tif (((front < 0.25\r\n\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro.get(i).getNowY()\r\n\t\t\t\t\t\t\t\t\t\t+ 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (front > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() + 1] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((left < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t- 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (left > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() - 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((right < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (right > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() + 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((back < 0.25 && robot.probability[robot.listOfPro.get(i)\r\n\t\t\t\t\t\t\t\t\t\t\t\t.getNowX()][robot.listOfPro.get(i).getNowY() - 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (back > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() - 1] == -1))) {\r\n\t\t\t\t\t\t\t//It is correct when the robot have the same data information with estimate information\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setSteps(robot.listOfPro.get(i).getSteps() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\tif (((left < 0.25\r\n\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro.get(i).getNowY()\r\n\t\t\t\t\t\t\t\t\t\t+ 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (left > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() + 1] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((back < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t- 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (back > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() - 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((front < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (front > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() + 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((right < 0.25 && robot.probability[robot.listOfPro.get(i)\r\n\t\t\t\t\t\t\t\t\t\t\t\t.getNowX()][robot.listOfPro.get(i).getNowY() - 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (right > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() - 1] == -1))) {\r\n\t\t\t\t\t\t\t//It is correct when the robot have the same data information with estimate information\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setSteps(robot.listOfPro.get(i).getSteps() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\tif (((back < 0.25\r\n\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro.get(i).getNowY()\r\n\t\t\t\t\t\t\t\t\t\t+ 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (back > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() + 1] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((right < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t- 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (right > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() - 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((left < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (left > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() + 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((front < 0.25 && robot.probability[robot.listOfPro.get(i)\r\n\t\t\t\t\t\t\t\t\t\t\t\t.getNowX()][robot.listOfPro.get(i).getNowY() - 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (front > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() - 1] == -1))) {\r\n\t\t\t\t\t\t\t//It is correct when the robot have the same data information with estimate information\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setSteps(robot.listOfPro.get(i).getSteps() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (((right < 0.25\r\n\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro.get(i).getNowY()\r\n\t\t\t\t\t\t\t\t\t\t+ 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (right > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() + 1] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((front < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t- 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (front > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() - 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((back < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (back > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() + 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((left < 0.25 && robot.probability[robot.listOfPro.get(i)\r\n\t\t\t\t\t\t\t\t\t\t\t\t.getNowX()][robot.listOfPro.get(i).getNowY() - 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (left > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() - 1] == -1))) {\r\n\t\t\t\t\t\t\t//It is correct when the robot have the same data information with estimate information\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setSteps(robot.listOfPro.get(i).getSteps() + 1);\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\tloopRound++;\r\n\t\t}\r\n\t\t// if is out the while loop, it will find the heading and the position of robot right now.\r\n\t\t//Step 3: It is time to use wavefront to come back to the hospital\r\n\t\trobot.restoreDefault();\r\n\t\trobot.RunMode = 1;\r\n\t\tColorThread.updatePos = true;\r\n\t\tColorThread.updateCritical = true;\r\n\t}", "public void autonomous() {\n robot.drive(0.5); //Drives in a square\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n }", "void think() {\n //get the output of the neural network\n decision = brain.output(vision);\n\n if (decision[0] > 0.8) {//output 0 is boosting\n boosting = true;\n } else {\n boosting = false;\n }\n if (decision[1] > 0.8) {//output 1 is turn left\n spin = -0.08f;\n } else {//cant turn right and left at the same time\n if (decision[2] > 0.8) {//output 2 is turn right\n spin = 0.08f;\n } else {//if neither then dont turn\n spin = 0;\n }\n }\n //shooting\n if (decision[3] > 0.8) {//output 3 is shooting\n shoot();\n }\n }", "private void wentOffWall() {\n //random location\n b.numX = r.nextInt(2400) + 100;\n b.numY = r.nextInt(1400) + 100;\n //random speed\n b.xSpeed = this.newSpeed();\n b.ySpeed = this.newSpeed();\n }", "public void setWatering(int value) {\n\t\tthis.watering = value;\n\t}", "@Override\n public void teleopPeriodic() {\n double x = xcontroller2.getX(Hand.kLeft);\n //double y = xcontroller1.getTriggerAxis(Hand.kRight) - xcontroller1.getTriggerAxis(Hand.kLeft);\n // For testing just use left joystick. Use trigger axis code for GTA Drive/\n double y = -xcontroller2.getY(Hand.kLeft);\n double z = xcontroller2.getX(Hand.kRight);\n double yaw = imu.getAngleZ();\n RobotDT.driveCartesian(x, y, 0, 0);\n \n\n // After you spin joystick R3 press A button to reset gyro angle\n if (xcontroller1.getAButtonPressed()) {\n imu.reset();\n }\n \n if (xcontroller2.getBButtonPressed()){\n mGPM.goSpongeHatch();\n }\n\n if (xcontroller2.getXButtonPressed()){\n mGPM.goPineHome();\n \n }\n\n\n /** \n * If Bumpers are pressed then Cargo Intake Motor = -1 for Intake \n *if Triggers are pressed set value to 1 for Outtake\n *If triggers are released set value to 0*/\n if(xcontroller2.getBumperPressed(Hand.kLeft) && xcontroller2.getBumperPressed(Hand.kRight)) {\n mGPM.setCargoMotor(-1);\n } else if((xcontroller2.getTriggerAxis(Hand.kLeft) >0.75) && (xcontroller2.getTriggerAxis(Hand.kRight) >0.75)) {\n mGPM.setCargoMotor(1);\n } else{\n mGPM.setCargoMotor(0);\n }\n }", "@Override\n public void teleopPeriodic() {\n try {\n mDriveController.update();\n mOperatorController.update();\n driverControl();\n \n } catch (Throwable t) {\n CrashTracker.logThrowableCrash(t);\n throw t;\n }\n \n }", "@Override\n\tpublic void teleopPeriodic() {\n\t\tScheduler.getInstance().run();\n\t\tisAutonomous = false;\n\t\tisTeleoperated = true;\n\t\tisEnabled = true;\n\t\tupdateLedState();\n\t\t//SmartDashboard.putNumber(\"Gyro\", Robot.drivebase.driveGyro.getAngle());\n\t\tSmartDashboard.putNumber(\"Climber Current Motor 1\", Robot.climber.climberTalon.getOutputCurrent());\n\t\tSmartDashboard.putNumber(\"Climber Current motor 2\", Robot.climber.climberTalon2.getOutputCurrent());\n\t\t//visionNetworkTable.getGearData();\n\t//\tvisionNetworkTable.showGearData();\n\t\tSmartDashboard.putNumber(\"GM ACTUAL POSITION\", Robot.gearManipulator.gearManipulatorPivot.getPosition());\n\n\t\tif(Robot.debugging){\t\t\t\n\t\t\tSmartDashboard.putNumber(\"Shooter1RPM Setpoint\", shooter.shooter1.getSetpoint());\n\t \tSmartDashboard.putNumber(\"Intake Pivot Encoder Position\", Robot.gearManipulator.gearManipulatorPivot.getPosition());\n\t\n\t\t\tSmartDashboard.putNumber(\"Gear Manipulator Setpoint\", gearManipulator.gearManipulatorPivot.getSetpoint());\n\t\t}\n\t\t//\tvisionNetworkTable.getGearData();\n\t\t//visionNetworkTable.getHighData();\n\t}", "private void reconsiderStop(NodeReference position, NodeReference station, IVehicleContext context) {\n NodeReference prev = context.getChargingStop();\n float ar = context.getEV().getActionRadius() / 1000; //convert m to km.\n //float distanceBef = (float) context.calculateRouteReference(position).resolveDistance(context.getGraphReference());\n context.scheduleChargingStop(station);\n float distanceAft = (float) context.calculateRouteReference(position).resolveDistance(context.getGraphReference());\n if (distanceAft > ar) {\n context.scheduleChargingStop(prev);\n }else{\n eventcontroller.publishEvent(\"agent:dmas:reconsider\", \"vehicle\",context.getEV().getVehicleEntity().getVehicleReference().getId());\n }\n }", "public void teleopPeriodic() {\n \t\n \twhile (isOperatorControl() && isEnabled()) {\n \t\tdebug();\n \t\tsmartDashboardVariables();\n \t\t//driver control functions\n \t\tdriverControl();\n \t//state machine\n \tterrainStates();\n \t//this function always comes last\n \t//armSlack();\n Timer.delay(0.005);\t\t// wait for a motor update time\n }\n \tTimer.delay(0.005);\n }", "public void consumeWater(boolean waterOnly) {\n//\t\tlogger.info(person + \"::consumeWater()\");\n\t\tthirst = condition.getThirst();\n//\t\tboolean notThirsty = !condition.isThirsty();\n\t\t\n\t\tif (thirst > PhysicalCondition.THIRST_THRESHOLD / 2.0) {\n\t\t\tdouble currentThirst = Math.min(thirst, THIRST_CEILING);\n\t\t\tUnit containerUnit = person.getContainerUnit();\n\t\t\tInventory inv = null;\n\t\t\t\n\t\t\tif (containerUnit != null) {\t\t\t\n\t\t\t\tif (containerUnit instanceof MarsSurface) {\n\t\t\t\t\t// Doing EVA outside. Get water from one's EVA suit\n\t\t\t\t\tinv = person.getSuit().getInventory();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// In a vehicle or settlement\n\t\t\t\t\tinv = containerUnit.getInventory();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tdouble waterFinal = Math.min(waterEachServing, currentThirst);\n\n\t\t\tif (inv != null && waterFinal > 0) {\n\t\t\t\tint level = person.getAssociatedSettlement().getWaterRation();\n\t\t\t\tdouble new_thirst = (currentThirst - waterFinal) / 10;\n\t\t\t\t// Test to see if there's enough water\n\t\t\t\tboolean haswater = false;\n\t\t\t\tdouble amount = waterFinal / 1000D / level;\n\n\t\t\t\tif (amount > MIN) {\n\t\t\t\t\tdouble available = inv.getAmountResourceStored(ResourceUtil.waterID, false);//Storage.retrieveAnResource(amount, ResourceUtil.waterID, inv, false);\n\t\t\t\t\tif (available >= amount)\n\t\t\t\t\t\thaswater = true;\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tif (haswater) {\n\t\t\t\t\tnew_thirst = new_thirst - amount * 5_000;\n\t\t\t\t\tif (new_thirst < 0)\n\t\t\t\t\t\tnew_thirst = 0;\n\t\t\t\t\telse if (new_thirst > THIRST_CEILING)\n\t\t\t\t\t\tnew_thirst = THIRST_CEILING;\n\t\t\t\t\tcondition.setThirst(new_thirst);\n\n\t\t\t\t\tif (amount > MIN) {\n\t\t\t\t\t\tStorage.retrieveAnResource(amount, ResourceUtil.waterID, inv, true);\n\t\t\t\t\t\t// Track the water consumption\n\t\t\t\t\t\tperson.addConsumptionTime(1, amount);\n\t\t\t\t\t\tif (waterOnly)\n\t\t\t\t\t\t\tsetDescription(Msg.getString(\"Task.description.eatDrink.water\")); //$NON-NLS-1$\n\t\t\t\t\t\tLogConsolidated.log(Level.FINE, 1000, sourceName,\n\t\t\t\t\t\t\t\t\"[\" + person.getLocationTag().getLocale() + \"] \" + person\n\t\t\t\t\t\t\t\t\t\t+ \" drank \" + Math.round(amount * 1000.0) / 1.0\n\t\t\t\t\t\t\t\t\t\t+ \" mL of water.\");\n\t\t\t\t\t}\n//\t\t\t\t\tLogConsolidated.log(Level.INFO, 1000, sourceName,\n//\t\t\t\t\t\t person + \" is drinking \" + Math.round(amount * 1000.0)/1000.0 + \"kg of water\"\n//\t\t\t\t\t\t + \" thirst : \" + Math.round(currentThirst* 100.0)/100.0\n//\t\t\t\t\t\t + \" waterEachServing : \" + Math.round(waterEachServing* 100.0)/100.0\n//\t\t\t\t\t\t + \" waterFinal : \" + Math.round(waterFinal* 100.0)/100.0\n//\t\t\t\t\t\t + \" new_thirst : \" + Math.round(new_thirst* 100.0)/100.0, null);\n\t\t\t\t}\n\n\t\t\t\telse if (!haswater) {\n\t\t\t\t\t// Test to see if there's just half of the amount of water\n\t\t\t\t\tamount = waterFinal / 1000D / level / 1.5;\n\t\t\t\t\tif (amount > MIN) {\n\t\t\t\t\t\tdouble available = inv.getAmountResourceStored(ResourceUtil.waterID, false);//Storage.retrieveAnResource(amount, ResourceUtil.waterID, inv, false);\n\t\t\t\t\t\tif (available >= amount)\n\t\t\t\t\t\t\thaswater = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (haswater) {\n\t\t\t\t\t\tnew_thirst = new_thirst - amount * 5_000;\n\t\t\t\t\t\tif (new_thirst < 0)\n\t\t\t\t\t\t\tnew_thirst = 0;\n\t\t\t\t\t\telse if (new_thirst > THIRST_CEILING)\n\t\t\t\t\t\t\tnew_thirst = THIRST_CEILING;\n\t\t\t\t\t\tcondition.setThirst(new_thirst);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (amount > MIN) {\n\t\t\t\t\t\t\tStorage.retrieveAnResource(amount, ResourceUtil.waterID, inv, true);\n\t\t\t\t\t\t\t// Track the water consumption\n\t\t\t\t\t\t\tperson.addConsumptionTime(1, amount);\n\t\t\t\t\t\t\tif (waterOnly)\n\t\t\t\t\t\t\t\tsetDescription(Msg.getString(\"Task.description.eatDrink.water\")); //$NON-NLS-1$\n\t\t\t\t\t\t\tLogConsolidated.log(Level.WARNING, 1000, sourceName,\n\t\t\t\t\t\t\t\t\t\"[\" + person.getLocationTag().getLocale() + \"] \" + person\n\t\t\t\t\t\t\t\t\t\t\t+ \" was put on water ration and allocated to drink no more than \" \n\t\t\t\t\t\t\t\t\t\t\t+ Math.round(amount * 1000.0) / 1.0\n\t\t\t\t\t\t\t\t\t\t\t+ \" mL of water.\");\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\tamount = waterFinal / 1000D / level / 3.0;\n\n\t\t\t\t\t\tif (amount > MIN) {\n\t\t\t\t\t\t\tdouble available = inv.getAmountResourceStored(ResourceUtil.waterID, false);//Storage.retrieveAnResource(amount, ResourceUtil.waterID, inv, false);\n\t\t\t\t\t\t\tif (available >= amount)\n\t\t\t\t\t\t\t\thaswater = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (haswater) {\n\t\t\t\t\t\t\tnew_thirst = new_thirst - amount * 5_000;\n\t\t\t\t\t\t\tif (new_thirst < 0)\n\t\t\t\t\t\t\t\tnew_thirst = 0;\n\t\t\t\t\t\t\telse if (new_thirst > THIRST_CEILING)\n\t\t\t\t\t\t\t\tnew_thirst = THIRST_CEILING;\n\t\t\t\t\t\t\tcondition.setThirst(new_thirst);\n\n\t\t\t\t\t\t\tif (amount > MIN) {\n\t\t\t\t\t\t\t\tStorage.retrieveAnResource(amount, ResourceUtil.waterID, inv, true);\n\t\t\t\t\t\t\t\t// Track the water consumption\n\t\t\t\t\t\t\t\tperson.addConsumptionTime(1, amount);\n\t\t\t\t\t\t\t\tif (waterOnly)\n\t\t\t\t\t\t\t\t\tsetDescription(Msg.getString(\"Task.description.eatDrink.water\")); //$NON-NLS-1$\n\t\t\t\t\t\t\t\tLogConsolidated.log(Level.WARNING, 1000, sourceName,\n\t\t\t\t\t\t\t\t\t\t\"[\" + person.getLocationTag().getLocale() + \"] \" + person\n\t\t\t\t\t\t\t\t\t\t\t\t+ \" was put on water ration and allocated to drink no more than \" \n\t\t\t\t\t\t\t\t\t\t\t\t+ Math.round(amount * 1000.0) / 1.0\n\t\t\t\t\t\t\t\t\t\t\t\t+ \" mL of water.\");\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\telse {\n\t\t\t\t\t\t\tamount = waterFinal / 1000D / level / 4.5;\n\t\t\t\t\t\t\tif (amount > MIN) {\n\t\t\t\t\t\t\t\tdouble available = inv.getAmountResourceStored(ResourceUtil.waterID, false);//Storage.retrieveAnResource(amount, ResourceUtil.waterID, inv, false);\n\t\t\t\t\t\t\t\tif (available >= amount)\n\t\t\t\t\t\t\t\t\thaswater = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (haswater) {\n\t\t\t\t\t\t\t\tnew_thirst = new_thirst - amount * 5_000;\n\t\t\t\t\t\t\t\tif (new_thirst < 0)\n\t\t\t\t\t\t\t\t\tnew_thirst = 0;\n\t\t\t\t\t\t\t\telse if (new_thirst > THIRST_CEILING)\n\t\t\t\t\t\t\t\t\tnew_thirst = THIRST_CEILING;\n\t\t\t\t\t\t\t\tcondition.setThirst(new_thirst);\n\n\t\t\t\t\t\t\t\tif (amount > MIN) {\n\t\t\t\t\t\t\t\t\tStorage.retrieveAnResource(amount, ResourceUtil.waterID, inv, true);\n\t\t\t\t\t\t\t\t\t// Track the water consumption\n\t\t\t\t\t\t\t\t\tperson.addConsumptionTime(1, amount);\n\t\t\t\t\t\t\t\t\tif (waterOnly)\n\t\t\t\t\t\t\t\t\t\tsetDescription(Msg.getString(\"Task.description.eatDrink.water\")); //$NON-NLS-1$\n\t\t\t\t\t\t\t\t\tLogConsolidated.log(Level.WARNING, 1000, sourceName,\n\t\t\t\t\t\t\t\t\t\t\t\"[\" + person.getLocationTag().getLocale() + \"] \" + person\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \" was put on water ration and allocated to drink no more than \" \n\t\t\t\t\t\t\t\t\t\t\t\t\t+ Math.round(amount * 1000.0) / 1.0\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \" mL of water.\");\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}", "@Override\n\tpublic void action() {\n\t\tsuppressed = false;\n\t\t//if (Settings.motorAAngle == -90) Settings.motorAAngle = -95;\n\n\t\tMotor.A.rotateTo(Settings.motorAAngle, true);\n\n\t\twhile (Motor.A.isMoving() && !Motor.A.isStalled() && !suppressed);\t\t\t\n\t\t\n\t\tMotor.A.stop();\n\t}", "protected byte[] getWaterHeaterStatus() {return null;}", "@Override\n\tpublic void teleopPeriodic() {\n\t\tif (state.equals(\"teleop\")) {\n\t\t\tlastState = \"teleop\";\n\t\t}\n\t\tstate = \"teleop\";\n\n\t\tif (lastState.equals(\"auton\")) {\n\t\t\tNetworkTables.getControlsTable().putBoolean(\"auton\", false);\n\t\t\t\n\t\t\t//Changes the control Mode back to PercentVbus\n\t\t\t//Should only run once - first interation of teleop\n\t\t\t//And ends auton if running\n\t\t\tif(autonomousCommand != null){\n\t\t\t\tautonomousCommand.cancel();\n\t\t\t}\n\t\t\tActuators.getLeftDriveMotor().changeControlMode(TalonControlMode.PercentVbus);\n\t\t\tActuators.getLeftDriveMotor().set(Constants.MOTOR_STOP);\n\t\t\tActuators.getRightDriveMotor().changeControlMode(TalonControlMode.PercentVbus);\n\t\t\tActuators.getRightDriveMotor().set(Constants.MOTOR_STOP);\n\t\t}\n\n//\t\tNetworkTables.putStream(Gamepad.primary.getX() || Gamepad.secondary.getX());\n\t\t/*\n\t\t * Primary Controllers Controls\n\t\t */\n\t\t// TODO: confirm right trigger forward, left trigger reverse\n\t\t// Drive controls\n\t\tDrive.drive(-Gamepad.primary.getLeftX(), Gamepad.primary.getTriggers()); \n\t\tDrive.shift(Gamepad.primary.getA(), Gamepad.primary.getY()); // shifting with A low gear and Y high gear\n\t\tDrive.shiftToggle(Gamepad.primary.getLB());\n\t\tDrive.crab(Gamepad.primary.getDPadLeft(), Gamepad.primary.getDPadRight());\n\t\t\n//\t\tif (Gamepad.primary.getDPadLeft()){\n//\t\t\tDrive.goingLeft = true;\n//\t\t\tDrive.crab();\t\t\n//\t\t}else if( Gamepad.primary.getDPadRight()){\n//\t\t\tDrive.goingLeft = false;\n//\t\t\tDrive.crab();\t\t\t\n//\t\t}else if (Drive.crabState > 0){\n//\t\t\tDrive.crab();\n//\t\t}\n\n\t\t\n\t\t// Climb controls\n\t\tClimb.climbStopPrimary(Gamepad.primary.getDPadUp()); // runs climbStop using left on the DPad - Primary\n\t\t// Climb.climbSafetyTogglePrimary(Gamepad.primary.getBack()); //toggles safety if pressed 3 times\n\n\t\t// Gear controls\n\t\tScore.dispenseGear(Gamepad.primary.getB() || Gamepad.secondary.getDPadUp());\n\n\t\t/*\n\t\t * Secondary Controllers Controls\n\t\t */\n\t\t// Intake controls\n\t\tIntake.intake(Gamepad.secondary.getRightButton()); // runs intake with clicking in the Right Joystick on second controller\n\t\tIntake.intakeSpeed(Gamepad.secondary.getRightY()); // Override Y Button\n\t\tIntake.intakeDirection(Gamepad.secondary.getRightX()); // Override Y Button\n\t\tIntake.intakeJam(Gamepad.secondary.getLB()); // Runs the unjamming procedure for a max of 3 seconds per press\n\t\t// Intake.intakeSafety(Gamepad.secondary.getStart()); //Have to press 3 times to toggle the safety\n\t\tIntake.intakeIn(Gamepad.secondary.getA(), Gamepad.secondary.getB(), Gamepad.secondary.getX()); // Toggles Intake running into the robot at full speed\n\t\tIntake.intakeRun(Gamepad.secondary.getRB()); // Runs all stuff for intake in(conveyor and intake motor)\n//\t\tIntake.intakeOut(Gamepad.secondary.getB());\n\t\t// Climb controls\n\t\tClimb.climbStopSecondary(Gamepad.secondary.getDPadRight()); // runs climbStop using left on the DPad - Secondary\n\t\tClimb.climbStartSecondary(Gamepad.secondary.getDPadLeft()); // runs climbStart using right on the DPad Secondary\n\t\tClimb.climbSafetyToggleSecondary(Gamepad.secondary.getBack()); // Have to press 3 times to toggle the safety\n\n\t\t// Gear controls\n\t\t// Score.gearLock(Gamepad.secondary.getStart(),\n\t\t// Gamepad.secondary.getBack());\n\n\t\t// Outtake Controls\n\t\t// Score.outtakeToggle(Gamepad.secondary.getLB());\n\n\t\t// Conveyor Controls\n\n\t\tScore.conveyor(Gamepad.secondary.getLeftButton()); // runs conveyor with clicking in the Left Joystick on second controller\n\t\tScore.conveyorSpeed(Gamepad.secondary.getLeftY());\n\t\tScore.conveyorDirection(Gamepad.secondary.getLeftX());\n\t\tScore.conveyorIn(Gamepad.secondary.getY());\n\n\t\t// Sweeper\n\t\t// Sweeper.sweeperMotion(Gamepad.secondary.getTriggers());\n\n\t\tDash.driveMode();\n\n\t\tSmartDashboard.putString(\"Controls Table\", NetworkTables.getControlsTable().getKeys().toString());\n\t\tSmartDashboard.putString(\"Stream\", NetworkTables.getControlsTable().getString(\"stream\", \"nothing\"));\n\n\t}", "@Override\r\n public void teleopPeriodic() {\n if (m_stick.getRawButton(12)){\r\n TestCompressor.setClosedLoopControl(true);\r\n System.out.println(\"??\");\r\n } \r\n if (m_stick.getRawButton(11)) {\r\n TestCompressor.setClosedLoopControl(false);\r\n }\r\n //// fireCannon(Solenoid_1, m_stick, 8);\r\n //// fireCannon(Solenoid_2, m_stick, 10);\r\n //// fireCannon(Solenoid_3, m_stick, 12);\r\n //// fireCannon(Solenoid_4, m_stick, 7);\r\n //// fireCannon(Solenoid_5, m_stick, 9);\r\n //// fireCannon(Solenoid_6, m_stick, 11);\r\n\r\n // Logic to control trigering is inside\r\n // DO: Move the logic out here, makes more sense. \r\n fireTrio(topSolonoids, m_stick, 5);\r\n fireTrio(bottomSolonoids, m_stick, 6);\r\n\r\n // Make robit go\r\n double[] movementList = adjustJoystickInput(-m_stick.getY(), m_stick.getX(), m_stick.getThrottle());\r\n m_myRobot.arcadeDrive(movementList[0], movementList[1]);\r\n //System.out.println(m_gyro.getAngle());\r\n }", "void deployRobot(){\n\n //Robot going down\n //Can be omitted if for test purposes\n if(!autonomonTesting) {\n while (robot.mechLiftLeft.getCurrentPosition() < robot.MAX_LIFT_POSITION &&\n robot.mechLiftRight.getCurrentPosition() < robot.MAX_LIFT_POSITION && !isStopRequested()) {\n robot.liftMovement(robot.LIFT_SPEED, false);\n }\n telemetry.addData(\"Lift Position\", robot.mechLiftLeft.getCurrentPosition());\n }\n else{\n telemetry.addLine(\"Tesint mode, without lift\");\n }\n robot.liftMovement(0, false);\n telemetry.update();\n\n\n //tensor activation\n if (tfod != null) {\n tfod.activate();\n }\n\n //moving to get in position for TensorFlow scan\n\n //out of the hook\n robot.setDrivetrainPosition(-300, \"translation\", .6);\n\n //away from the lander\n robot.setDrivetrainPosition(800, \"strafing\", .3);\n\n //back to initial\n robot.setDrivetrainPosition(300, \"translation\", .6);\n\n }", "@Override\n\tpublic void teleopPeriodic() {\n\n\t\tif (Joy.getRawButtonPressed(1)) {\n\t\t\ttriggerValue = !triggerValue;\n\n\t\t\tif (triggerValue) {\n\t\t\t\tairCompressor.start();\n\t\t\t\tSystem.out.println(\"Compressor ON\");\n\n\t\t\t} else if (!triggerValue) {\n\t\t\t\tairCompressor.stop();\n\t\t\t\tSystem.out.println(\"Compressor OFF\");\n\t\t\t}\n\t\t}\n\n\t\tif (Joy.getRawButtonPressed(2)) {\n\t\t\ttriggerValue = !triggerValue;\n\n\t\t\tif (triggerValue) {\n\t\t\t\ts1.set(DoubleSolenoid.Value.kForward);\n\t\t\t\tTimer.delay(1);\n\t\t\t\ts2.set(DoubleSolenoid.Value.kForward);\n\t\t\t\tSystem.out.println(\"Solenoid Forward\");\n\n\t\t\t} else if (!triggerValue) {\n\t\t\t\ts1.set(DoubleSolenoid.Value.kReverse);\n\t\t\t\tTimer.delay(1);\n\t\t\t\ts2.set(DoubleSolenoid.Value.kReverse);\n\t\t\t\tSystem.out.println(\"Solenoid Reversed\");\n\n\t\t\t}\n\t\t}\n\t}", "@EventHandler\n public void thunderChange(ThunderChangeEvent event) {\n if (event.isCancelled()) {\n return;\n }\n MultiverseWorld world = this.plugin.getMVWorldManager().getMVWorld(event.getWorld().getName());\n if (world != null) {\n // If it's going to start raining and we have weather disabled\n event.setCancelled((event.toThunderState() && !world.isWeatherEnabled()));\n }\n }" ]
[ "0.64644265", "0.6375125", "0.63289803", "0.60844713", "0.5903213", "0.5902263", "0.5895337", "0.5859328", "0.58032256", "0.57682693", "0.5709414", "0.56970406", "0.56715125", "0.56629133", "0.5648251", "0.56481564", "0.562932", "0.5624229", "0.5617046", "0.56161016", "0.5610339", "0.5604244", "0.5582074", "0.55807793", "0.55789644", "0.55741936", "0.5573387", "0.55683583", "0.5564167", "0.5555111", "0.55540586", "0.5546019", "0.55436695", "0.55417174", "0.55413854", "0.55362815", "0.55360806", "0.55331784", "0.55218816", "0.54920083", "0.54917234", "0.5487952", "0.5469258", "0.5466786", "0.54612863", "0.5460006", "0.5457644", "0.54558176", "0.545242", "0.5446625", "0.5445108", "0.54406035", "0.5438894", "0.5436323", "0.54358494", "0.54354846", "0.542792", "0.5419233", "0.54176784", "0.54171693", "0.5412221", "0.5412", "0.541052", "0.5409149", "0.5406797", "0.53948945", "0.53757983", "0.5359868", "0.53512394", "0.5335138", "0.53322154", "0.5331151", "0.5320944", "0.53151053", "0.53146726", "0.5307039", "0.5297614", "0.52927256", "0.5284363", "0.5280057", "0.52800393", "0.5277796", "0.52709556", "0.52705276", "0.52665097", "0.52642447", "0.52640945", "0.52640885", "0.5261498", "0.52594244", "0.5259296", "0.52591723", "0.52589273", "0.5254744", "0.52536654", "0.5251951", "0.52479774", "0.5241851", "0.5239246", "0.5228888" ]
0.62778974
3
As an air traffic controller To ensure safety I want to prevent landing when weather is stormy
@Test public void preventLandingWhenStormyWeather() { Exception exception = new Exception(); try { when(weatherMock.getWeather()).thenReturn("stormy"); heathrow.landing(tap); } catch (Exception e) { exception = e; } assertEquals("Not allowed to land in stormy weather", exception.getMessage()); assertEquals(0, heathrow.hangar.size()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean canSnowFallOn();", "@Test\n\tpublic void preventTakeOffWhenStormyWeather() {\n\t\tException exception = new Exception();\n\n\t\ttry {\n\t\t\theathrow.landing(tap);\n\t\t\t// airport instance return stormy weather\n\t\t\twhen(weatherMock.getWeather()).thenReturn(\"stormy\");\n\t\t\theathrow.takeoff(tap);\n\t\t} catch (Exception e) {\n\t\t\texception = e;\n\t\t}\n\n\t\tassertEquals(\"Not allowed to takeoff in stormy weather\", exception.getMessage());\n\t\tassertEquals(1, heathrow.hangar.size());\n\t}", "protected boolean isMovementNoisy() {\n/* 1861 */ return (!this.abilities.flying && (!this.onGround || !isDiscrete()));\n/* */ }", "void nearingTheWallBefore(){\n robot.absgyroRotation(0, \"absolute\");\n\n //alligning with the wall before going for the toy\n while(robot.leftDistanceSensor.getDistance(DistanceUnit.CM) > 15 && !isStopRequested()){\n if(robot.leftDistanceSensor.getDistance(DistanceUnit.CM) < 30)\n robot.mecanumMovement(0, .3, 0);\n else\n robot.mecanumMovement(0, .7, 0);\n\n telemetry.addLine(\"Distance from sensor: \" + robot.leftDistanceSensor.getDistance(DistanceUnit.CM));\n telemetry.update();\n }\n robot.mecanumMovement(0, 0, 0);\n\n robot.absgyroRotation(45, \"absolute\");\n }", "private void penguinStormReaction(){\n if(obstacle.getUserData().getAssetId().equals(OBSTACLE_CLOUD_ASSETS_ID)){\n if(penguin.isFrightStopped()){\n obstacle.setStormRaining(false);\n }else{\n obstacle.setStormRaining(true);\n }\n }\n }", "@Override\n\tprotected void land(){\n\t\tgvh.log.i(TAG, \"Drone landing\");\n\t\t//setControlInput(my_model.yaw, 0, 0, 5);\n\t}", "@Override\n public void robotPeriodic() {\n\n boolean c = mGPM.haveCargo();\n \n // Need signal due to distance for assurance that cargo is obtained/\n if (c) {\n CargoLight.set(Value.kOn);\n } else{\n CargoLight.set(Value.kOff);\n }\n }", "public void action() {\r\n\t\tLCD.drawString(\"Avoid Behavior!\", 0, 7);\r\n\r\n\t\tMapUpdate.updateWithoutObject(0);\r\n\t\tMapUpdate.updateWithObject(StandardRobot.us.getRange());\r\n\r\n\t\tif (StandardRobot.ts.isPressed()) {\r\n\t\t\tStandardRobot.pilot.setTravelSpeed(7);\r\n\t\t\tStandardRobot.pilot.travel(-5);\r\n\t\t\tcounter.countTravel();\r\n\r\n\t\t\tif (store.getFlag() == 0) {\r\n\t\t\t\tStandardRobot.pilot.rotate(-90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t} else {\r\n\t\t\t\tStandardRobot.pilot.rotate(90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\tif (store.getFlag() == 0) {\r\n\t\t\t\tStandardRobot.pilot.rotate(-90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t} else {\r\n\t\t\t\tStandardRobot.pilot.rotate(90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public boolean takeControl() {\n\t\tif (Squirrel.us.getDistance() <= 30 && Squirrel.notDetected)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "@Override\r\n\tpublic void cruise() {\n\t\tSystem.out.println(\"In SeaPlane::cruise\");\r\n\t\tif (altitude < 10) \r\n\t\t\tSail.super.cruise();\r\n\t\telse\r\n\t\t\tFastFly.super.cruise();\r\n\t}", "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}", "void toggleInAir() {\n inAir = !inAir;\n }", "@NonNull boolean waterlogged();", "public void placePowerStation() {\n this.powerStation = true;\n\n }", "private void travelToAirport()\n {\n try\n { sleep ((long) (1 + 30000 * Math.random ()));\n }\n catch (InterruptedException e) {}\n }", "void deployRobot(){\n\n //Robot going down\n //Can be omitted if for test purposes\n if(!autonomonTesting) {\n while (robot.mechLiftLeft.getCurrentPosition() < robot.MAX_LIFT_POSITION &&\n robot.mechLiftRight.getCurrentPosition() < robot.MAX_LIFT_POSITION && !isStopRequested()) {\n robot.liftMovement(robot.LIFT_SPEED, false);\n }\n telemetry.addData(\"Lift Position\", robot.mechLiftLeft.getCurrentPosition());\n }\n else{\n telemetry.addLine(\"Tesint mode, without lift\");\n }\n robot.liftMovement(0, false);\n telemetry.update();\n\n\n //tensor activation\n if (tfod != null) {\n tfod.activate();\n }\n\n //moving to get in position for TensorFlow scan\n\n //out of the hook\n robot.setDrivetrainPosition(-300, \"translation\", .6);\n\n //away from the lander\n robot.setDrivetrainPosition(800, \"strafing\", .3);\n\n //back to initial\n robot.setDrivetrainPosition(300, \"translation\", .6);\n\n }", "@Override\n protected void execute() {\n if(!Robot.SCISSOR.getFloorSensor() && speed < 0) {\n Robot.SCISSOR.liftRobotPnumatic(false);\n }\n }", "void find_steady_conditions () {\n // System.out.println(\"-- find_steady_conditions: \" + can_do_gui_updates);\n // double min_lift = parse_force_constraint(tf_tkoff_min_lift);\n double max_drag = parse_force_constraint(tf_tkoff_max_drag);\n boolean saved_flag = can_do_gui_updates;\n can_do_gui_updates = false;\n vpp.steady_flight_at_given_speed(5, 0);\n can_do_gui_updates = saved_flag;\n recomp_all_parts();\n\n\n // this animation idea alas does not work now... \n // //add a bit of animation in case the rider crosses the takeoff speed.\n // if (alt_val == 0 && foil_lift() >= load) { // need to raise up\n // while (alt_val < 70 && foil_lift() >= load) {\n // alt_val += 0.1;\n // loadPanel();\n // viewer.repaint();\n // // try { Thread.sleep(100); } catch (InterruptedException e) {}\n // saved_flag = can_do_gui_updates;\n // can_do_gui_updates = false;\n // vpp.steady_flight_at_given_speed(5, 0);\n // can_do_gui_updates = saved_flag;\n // }\n // }\n\n if (alt_val == 0 && foil_lift() >= load) { // need to raise up\n // viewer.start_raise = true; // this is experimentsl, has quirks....\n alt_val = 70;\n } else if (alt_val > 0 && foil_lift() < load) { // must splash\n // viewer.start_descend = true; // this is experimentsl, has quirks....\n alt_val = 0;\n }\n\n \n loadPanel();\n if (total_drag() > max_drag) \n dash.outTotalDrag.setForeground(Color.red);\n if (foil_lift() < load) \n dash.outTotalLift.setForeground(Color.red);\n }", "public void noFlights();", "@Override\n\tpublic void canLand() {\n\t\tSystem.out.println(\"IF IM IN THE SKY, I CANT LAND. BY THE OMNISSIAH\");\n\t}", "private static void turnAwayFromWall() {\n while (true) {\n if (readUsDistance() > OPEN_SPACE) {\n leftMotor.stop();\n rightMotor.stop();\n // re-calibrate theta, offset will be added to this angle\n odometer.setTheta(0);\n System.out.println(\"starting localization...\");\n prevDist = 255;\n dist = prevDist;\n break;\n }\n }\n }", "private void aimlessScout() {\n\t\ttargetFlower = null;\n\t\t// if bee is sufficiently far from flower, look for other flowers\n\t\tif((clock.time - tempTime) > 0.15) {\n\t\t\tstate = \"SCOUTING\";\n\t\t}\n\t\t// otherwise keep flying\n\t\telse{\n\t\t\tcurrentAngle += RandomHelper.nextDoubleFromTo(-Math.PI/8, Math.PI/8);\n\t\t\tspace.moveByVector(this, 4, currentAngle,0);\n\t\t\tNdPoint myPoint = space.getLocation(this);\n\t\t\tgrid.moveTo(this, (int) myPoint.getX(), (int) myPoint.getY());\n\t\t\t//energy -= exhaustionRate;\n\t\t\tfood -= highMetabolicRate;\n\t\t}\n\t}", "AttackResult smartAttack();", "boolean canFall();", "@NotNull\n boolean isTrustedWholeLand();", "public abstract boolean attack(TemporaryCharm i);", "@Override\n public void robotPeriodic() {\n double high = m_filter.calculate(m_photoHigh.getValue());// * kValueToInches;\n double low = m_filter.calculate(m_photoLow.getValue()); //* kValueToInches;\n if (low<=6){\n BallPresent = true;\n //stop motor if ultrasonic sensor median falls below 6 inches indicating a ball is blocking the sensor\n m_RightMotor.set(ControlMode.PercentOutput, 0);\n } else {\n BallPresent = false;\n //stop motor if ultrasonic sensor median falls below 6 inches indicating a ball is blocking the sensor\n m_RightMotor.set(ControlMode.PercentOutput, 0.5);\n }\n /*Shuffleboard.getTab(\"Shooter\").add(\"Ball Present\", BallPresent)\n .withWidget(BuiltInWidgets.kBooleanBox)\n .withPosition(0, 0)\n .withSize(1, 1)\n .withProperties(Map.of(\"colorWhenTrue\",\"green\",\"colorWhenFalse\",\"black\"));*/\n SmartDashboard.putNumber(\"High\", high);\n SmartDashboard.putNumber(\"Low\", low); \n /*Shuffleboard.getTab(\"Shooter\").add(\"Ultrasonic 1\", currentDistance)\n .withWidget(BuiltInWidgets.kGraph)\n .withPosition(0, 2)\n .withSize(4, 4);*/\n // convert distance error to a motor speed\n //double currentSpeed = (kHoldDistance - currentDistance) * kP;\n\n // drive robot\n //m_robotDrive.arcadeDrive(currentSpeed, 0);\n }", "private void weather() {\n\t\t// System.out.println(\"Sending weather information via Twitter.\");\n\t\t// TwitterComm.sendDirectMessage(Constants.AUTH_USER,\n\t\t// Alfred.getYrParser()\n\t\t// .getWeatherReport().twitterForecastToString());\n\t}", "@EventHandler\n public void weatherChange(WeatherChangeEvent event) {\n if (event.isCancelled()) {\n return;\n }\n MultiverseWorld world = this.plugin.getMVWorldManager().getMVWorld(event.getWorld().getName());\n if (world != null) {\n // If it's going to start raining and we have weather disabled\n event.setCancelled((event.toWeatherState() && !world.isWeatherEnabled()));\n }\n }", "void bypass();", "@Override\n\tpublic boolean isDanger() {\n\t\tSharedPreferences prefs = NotificationStack.context.getSharedPreferences(\"com.app.virtualguardian\", Context.MODE_PRIVATE); \n\t\tint distancia=pingGps(Latitud,Longitud);\n\t\tint distanciaAuto=pingCar();\n\t\tint maxPer = Integer.parseInt(prefs.getString(\"distanciaPersonal\",\"3000\")); \n\t\tint maxCar = Integer.parseInt(prefs.getString(\"distanciaAuto\",\"3000\"));\n\t\tif(distancia<=maxPer){\n\t\t\t//avisaamigos\n\t\t\tavisaAmigos(distancia);\n\t\t}\n\t\tif(distanciaAuto<=maxCar){\n\t\t\t//avisaauto\n\t\t\tavisaAuto(distanciaAuto);\n\t\t}\n\t\tif(distancia<=maxPer || distanciaAuto<=maxCar)return true;\n\t\treturn false;\n\t}", "@Override\n public void teleopPeriodic() {\n Scheduler.getInstance().run();\n SmartDashboard.putNumber(\"right encoder\", drive.getRightEncoder());\n SmartDashboard.putNumber(\"left encoder\", drive.getLeftEncoder());\n \n PixyCamBlock centerBlock = PixyCam2.GetCentermostBlock();\n boolean targetInRange = false ;\n \n if(centerBlock == null)\n {\n targetInRange = false;\n SmartDashboard.putString(\"center block data \", \"null\"); \n }\n else if(centerBlock.yCenter < 200)\n {\n targetInRange = true;\n String out = \"Center Block, X: \"+centerBlock.xCenter + \" Y: \"+centerBlock.yCenter;\n SmartDashboard.putString(\"center block data \", out); \n }\n\n String targetValue = Boolean.toString(targetInRange);\n SmartDashboard.putString(\"target good?\", targetValue);\n \n \n SmartDashboard.putBoolean(\"isFlipped\", flipped);\n }", "private void cs8() {\n\t\t\t\n\t\n\t\t\tif(new Tile(3088,3092,0).matrix(ctx).reachable()){\n\t\t\t\t\n\t\t\t\tif(new Tile(3079,3084,0).distanceTo(ctx.players.local().tile())<7){\n\t\t\t\t\tMethod.interactO(9709, \"Open\", \"Door\");\n\t\t\t\t}else ctx.movement.step(new Tile(3079,3084,0));\n\t\t\t\t\n\t\t\t}else if(new Tile(3090,3092,0).distanceTo(ctx.players.local().tile())<7){\n\t\t\t\tfinal int[] bounds = {140, 108, -84, 144, -64, 136};\n\t\t\t\tGameObject gate = ctx.objects.select().id(GATEBYFISH).each(Interactive.doSetBounds(bounds)).select(Interactive.areInViewport()).nearest().poll();\n\t\t\t\tgate.interact(\"Open\",\"\");\n\t\t\t}else ctx.movement.step(new Tile(3090,3092,0));\n\t\t\t\n\t\t\t\n\t\t}", "public AirCondition(){}", "public void action() {\r\n\t\tsuppressed = false;\r\n\t\tMotor.B.stop();\r\n\t\tMotor.C.stop();\r\n\t\tDelay.msDelay(1000);\r\n\t\tMotor.B.setSpeed(180);\r\n\t\tMotor.C.setSpeed(180);\r\n\t\tMotor.B.forward();\r\n\t\tMotor.C.forward();\r\n\t\tif((light.getLightValue()>46 && light.getLightValue()<49) || (light.getLightValue()>27 && light.getLightValue()<31)){\r\n\t\t\tMotor.B.stop();\r\n\t\t\tMotor.C.stop();\r\n\t\t\tDelay.msDelay(500);\r\n\t\t\tMotor.B.forward();\r\n\t\t\tMotor.C.forward();\r\n\t\t\tif(light.getLightValue()>44 && light.getLightValue()<45){//home base\r\n\t\t\t\tMotor.B.stop();\r\n\t\t\t\tMotor.C.stop();\r\n\t\t\t}\r\n\t\t}\r\n\t\twhile(!suppressed){\r\n\t\t\tThread.yield();\r\n\t\t}\r\n\t}", "public abstract boolean attack(PermanentCharm i);", "private void automaticModeChecks(){\n // turn on lights if underground\n if (this.isUnderground()){ this.selectedTrain.setLights(1);}\n // set heat\n if (this.selectedTrain.getTemp() <= 40.0){this.selectedTrain.setThermostat(60.0);}\n else if (this.selectedTrain.getTemp() >= 80){ this.selectedTrain.setThermostat(50.0);}\n }", "private void pump_water() {\n\t\t\r\n\t}", "@Override\n\tpublic void action() {\n\t\tsuppressed = false;\n\t\tSettings.readState = true;\n\t\tSettings.atStartOfMaze = false;\n\t\tpilot.travel(-5);\n\t\tpilot.rotate(100);\n\t\twhile( pilot.isMoving() && !suppressed );\n\t\tpilot.stop();\n\t}", "private static boolean runAway(Critter foo){\n\t\tif(foo.moved) {\n\t\t\tfoo.energy = foo.getEnergy() - Params.walk_energy_cost;\n\t\t\tif (foo.getEnergy() <= 0) {\n\t\t\t\tfoo.isAlive=false;\n\t\t\t}\n\t\t\treturn false;\n\t\t} else {\n\t\t\tint dir = getRandomInt(8);\n\t\t\tif(canMove(foo, dir)) {\n\t\t\t\tfoo.walk(dir);\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\tfoo.energy = foo.getEnergy() - Params.walk_energy_cost;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void physicAttack() {\n\t\tSystem.out.println(\"进行物理攻击!\");\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 onSensorUnreliable ()\r\n\t{\r\n\t\tif ((System.currentTimeMillis())>5000)\r\n\t\t{\r\n\t\t\tLog.d(TAG,\"You need to calibrate your sensors.\");\r\n\t\t}\r\n\t}", "public abstract void onLand(Player player);", "@Override\n @SuppressWarnings(\"empty-statement\")\n public void attack(){\n\n if (myTerritory.getAlpha() <= 0.5){\n myTerritory.produceSoldiers(myTerritory.getNatRes(), myTerritory.getPeasants());\n attackingSoldiers = myTerritory.getSoldiers()/4;\n defendingSoldiers = myTerritory.getSoldiers()*3/4;\n attackedTerritoryID = (new Random()).nextInt(myTerritory.getNeighbors().numObjs) + 1;\n }\n else\n myTerritory.produceSoldiers(myTerritory.getNatRes(), myTerritory.getPeasants());\n attackingSoldiers = myTerritory.getFoodGrowth()/4;\n defendingSoldiers = myTerritory.getFoodGrowth()*3/4;\n attackedTerritoryID = (new Random()).nextInt(myTerritory.getNeighbors().numObjs) + 1;\n }", "public void attack() {\n this.attacked = true;\n }", "protected boolean canSustainPlant(IBlockState state){\n return state.getBlock() == getSoilBlock();\n }", "public void updateConditions() {\n\n weatherTower = new WeatherTower();\n String newWeather = weatherTower.getWeather(coordinates); // this is the currentWeather algorythm\n\n switch (newWeather) {\n\n case WeatherType.SUN:\n coordinates.setLongitude(coordinates.getLongitude() + 2);\n coordinates.setHeight(coordinates.getHeight() + 4);\n message = \"Baloon# \" + this.getName() + \"(\" + this.getId() + \"): \" + \"It is so sunny and hot.\";\n System.out.println(\"message\");\n try(PrintWriter pw = new PrintWriter(new FileOutputStream(new File(\"outputFile.txt\"), true))){\n pw.println(message);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n break;\n\n case WeatherType.RAIN:\n coordinates.setLatitude(coordinates.getLatitude() - 5);\n message = \"Baloon#\" + this.getName() + \"(\" + this.getId() + \"): \" + \"Damn you rain! You messed up my baloon.\";\n System.out.println(\"message\");\n try(PrintWriter pw = new PrintWriter(new FileOutputStream(new File(\"outputFile.txt\"), true))){\n pw.println(message);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n break;\n\n case WeatherType.FOG:\n coordinates.setLatitude(coordinates.getLatitude() - 3);\n message = \"Baloon#\" + this.getName() + \"(\" + this.getId() + \"): \" + \"Even though it's fog, let's take some pics!\";\n System.out.println(\"message\");\n try(PrintWriter pw = new PrintWriter(new FileOutputStream(new File(\"outputFile.txt\"), true))){\n pw.println(message);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n break;\n\n case WeatherType.SNOW:\n coordinates.setHeight(coordinates.getHeight() - 15);\n message = \"Baloon#\" + this.getName() + \"(\" + this.getId() + \"): \" + \" It's snowing. We're gonna crash.\\n\";\n System.out.println(\"message\");\n try(PrintWriter pw = new PrintWriter(new FileOutputStream(new File(\"outputFile.txt\"), true))){\n pw.println(message);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n break;\n }\n }", "public boolean isLandAnimal() {\n return false;\n }", "void think() {\n //get the output of the neural network\n decision = brain.output(vision);\n\n if (decision[0] > 0.8) {//output 0 is boosting\n boosting = true;\n } else {\n boosting = false;\n }\n if (decision[1] > 0.8) {//output 1 is turn left\n spin = -0.08f;\n } else {//cant turn right and left at the same time\n if (decision[2] > 0.8) {//output 2 is turn right\n spin = 0.08f;\n } else {//if neither then dont turn\n spin = 0;\n }\n }\n //shooting\n if (decision[3] > 0.8) {//output 3 is shooting\n shoot();\n }\n }", "public void flashlightSwitch()\n {\n usingFlashlight = !usingFlashlight;\n }", "@Override\n public void teleopPeriodic() {\n double y = -xbox.getRawAxis(0) * 0.7D * (1.0D + Math.max(0, xbox.getRawAxis(4)) * 1.4285714D);\n double rawSpeed = xbox.getRawAxis(2) - xbox.getRawAxis(3);\n\n if (SAFETY_MODE) {\n y *= 0.75D;\n\n if (xbox.getBumper(Hand.kLeft) && joystick.getRawButton(7)) {\n if (safetyCount > 0) {\n safetyCount--;\n SmartDashboard.putNumber(\"Safety Count\", safetyCount);\n\n if (safetyCount == 0) {\n safetyTripped = false;\n clearAllButtonStates();\n SmartDashboard.putBoolean(\"Safety Tripped\", safetyTripped);\n }\n } else {\n safetyTripped = false;\n }\n } else {\n safetyTripped = true;\n safetyCount = MAX_SAFETY_COUNT;\n SmartDashboard.putNumber(\"Safety Count\", safetyCount);\n SmartDashboard.putBoolean(\"Safety Tripped\", safetyTripped);\n }\n } else {\n safetyTripped = false;\n }\n\n // Climb Speed\n if (xbox.getRawButton(6)) {\n rawSpeed = -0.3D;\n }\n\n // Super slow mode\n if (xbox.getAButton() || SAFETY_MODE) {\n SpeedRamp.Setpoint = rawSpeed * 0.45D;\n } else {\n SpeedRamp.Setpoint = rawSpeed * 0.8D * (1.0D + Math.max(0, xbox.getRawAxis(4)) * 0.25);\n }\n\n SpeedRamp.update();\n\n boolean seesTape = TapeDetectedEntry.getBoolean(false);\n \n if (seesTape && !safetyTripped) {\n final double ADJUST_CONST = 0.13281734;\n //double tapePitch = TapePitchEntry.getNumber(0).doubleValue();\n double tapeYaw = TapeYawEntry.getNumber(0).doubleValue();\n final double TARGET_YAW = 0;//PitchYawAdjuster.GetYawFromPitch(tapePitch);\n\n //SmartDashboard.putNumber(\"tapePitch\", tapePitch);\n //SmartDashboard.putNumber(\"tapeYaw\", tapeYaw);\n \n double diff = tapeYaw - ADJUST_CONST;\n \n String s = \"\";\n\n if (diff > 0) {\n s = \"<-- (\" + diff + \")\";\n } else if (diff < 0) {\n s = \"--> (\" + diff + \")\";\n }\n\n if (/*xbox.getRawButton(5) This is now taken for the safety button*/false) {\n final double MAX_AFFECT = 0.4;\n if (diff > MAX_AFFECT) {\n diff = MAX_AFFECT;\n } else if (diff < -MAX_AFFECT) {\n diff = -MAX_AFFECT;\n }\n\n y -= diff;\n }\n\n SmartDashboard.putString(\"TapeDir\", s);\n } else {\n SmartDashboard.putString(\"TapeDir\", \"X\");\n }\n\n if (xbox.getRawButtonPressed(7)) {\n Lifter.setSelectedSensorPosition(0);\n LiftSetpoint = 0;\n LiftRamp.Setpoint = 0;\n LiftRamp.setOutput(0);\n }\n\n //Scheduler.getInstance().run();\n // Cargo ship is(n't anymore) -13120\n\n // The fine adjustment has nothing to do with hammers.\n // Don't try to use a hammer on the roboRIO. Ever.\n final int FINE_ADJUSTMENT_AMOUNT = -500;\n\n if (!safetyTripped) {\n if (joystick.getPOV() == 0) {\n if (!joyPOV0PressedLast) {\n joyPOV0PressedLast = true;\n if (LiftSetpoint - FINE_ADJUSTMENT_AMOUNT <= 0)\n LiftSetpoint -= FINE_ADJUSTMENT_AMOUNT;\n }\n } else {\n joyPOV0PressedLast = false;\n\n if (joystick.getPOV() == 180) {\n if (!joyPOV180PressedLast) {\n joyPOV180PressedLast = true;\n LiftSetpoint += FINE_ADJUSTMENT_AMOUNT;\n }\n } else {\n joyPOV180PressedLast = false;\n }\n }\n\n Drive.arcadeDrive(SpeedRamp.getOutput(), y);\n\n if (joystick.getRawButtonPressed(11)) {\n LiftSetpoint = HATCH_BOTTOM;\n } else if (joystick.getRawButtonPressed(9)) {\n LiftSetpoint = HATCH_MIDDLE;\n //} else if (joystick.getRawButtonPressed(7)) {\n // This button is now used for safety mode LiftSetpoint = HATCH_TOP;\n // and also for grab-hatch-on-impact mode\n } else if (joystick.getRawButtonPressed(12)) {\n LiftSetpoint = CARGO_BOTTOM;\n } else if (joystick.getRawButtonPressed(10)) {\n LiftSetpoint = CARGO_MIDDLE;\n //} else if (joystick.getRawButtonPressed(8)) {\n //LiftSetpoint = CARGO_TOP;\n } else if (joystick.getRawButtonPressed(1)) {\n LiftSetpoint = CARGO_FLOOR;\n }\n\n double liftY = -joystick.getRawAxis(1);\n final double deadband = 0.15;\n\n if (Math.abs(liftY) > deadband) {\n double change = (liftY < 0 ? liftY + 0.15 : liftY - 0.15) * 200;//(int)liftEntry.getDouble(0);//\n \n if (change > 100) {\n change = 100;\n } else if (change < -100) {\n change = -100;\n }\n\n LiftRamp.setOutput(LiftRamp.getOutput() + change);\n LiftRamp.Setpoint += change;\n LiftSetpoint = (int)LiftRamp.Setpoint;\n }\n\n if (LiftSetpoint < LIMIT_UP) {\n LiftSetpoint = LIMIT_UP;\n }\n } else {\n Drive.arcadeDrive(0, 0);\n }\n \n LiftRamp.Setpoint = LiftSetpoint;\n SmartDashboard.putNumber(\"LiftSetpoint\", LiftRamp.Setpoint);\n //SmartDashboard.putNumber(\"LiftEncoderPos\", Lifter.getSelectedSensorPosition());\n SmartDashboard.putNumber(\"LiftOutput\", LiftRamp.getOutput());\n LiftRamp.update();\n\n Lifter.set(ControlMode.Position, LiftRamp.getOutput());\n //Lifter.set(ControlMode.PercentOutput, -joystick.getRawAxis(1));\n\n if (!safetyTripped) {\n if (joystick.getRawButtonPressed(4)) {\n ArmsClosed = !ArmsClosed;\n } else if (!SAFETY_MODE) {\n // This is the same as the joystick safety button, so it only works outside\n // safety mode, and why would it be needed in safety mode anyway?\n // It should be disabled in safety mode anyway to make sure we don't\n // accidently attack someone's fingers at a Demo.\n\n // Holding joystick button 7 makes the limit switches on the hatch mechanism\n // active, so when the hatch contacts the switches, the mechanism automatically\n // grabs the hatch.\n // HatchSwitch0 does not have to be inverted. It's complicated.\n if (joystick.getRawButton(7) && (HatchSwitch0.get() || !HatchSwitch1.get())) {\n ArmsClosed = false;\n }\n }\n\n if (joystick.getRawButtonPressed(3)) {\n ArmsExtended = !ArmsExtended;\n }\n }\n\n ArmExtender.set(ArmsExtended);\n ArmOpener.set(ArmsClosed);\n\n //Diagnostics.writeDouble(\"DriveX\", x);\n //Diagnostics.writeDouble(\"DriveY\", y);\n\n // X = out, Y = in\n\n final double GRAB_SPEED;\n\n if (SAFETY_MODE) {\n GRAB_SPEED = 0.8D;\n } else {\n GRAB_SPEED = 1D; // TODO at one point we had this 0.8, is that what it's supposed to be?\n }\n \n if (!safetyTripped) {\n ArmGrippers.set(/*xbox.getXButton() || */joystick.getRawButton(6) ? -GRAB_SPEED : /*xbox.getYButton() ||*/ joystick.getRawButton(5) ? GRAB_SPEED : 0);\n } else {\n ArmGrippers.set(0);\n }\n\n\n // === Climbing stuff ===\n\n boolean climbSafety = /*joystick.getRawButton(2) &&*/ !safetyTripped;\n \n // Have to check all of these every update to make sure it was pressed\n // between now and the last update\n boolean retractFront = xbox.getYButton/*Pressed*/();\n boolean retractBack = xbox.getXButton/*Pressed*/();\n boolean climbBoth = xbox.getRawButton/*Pressed*/(8);\n\n final double CLIMB_SPEED = 1;\n final double RETRACT_SPEED = 0.75;\n final double HOLD_SPEED = 0.3;\n // If you multiply the hold by this, you get the climb value.\n // Avoids having to thing + or minus so many times.\n final double HOLD_CLIMB_MULTIPLIER = CLIMB_SPEED / HOLD_SPEED;\n\n // Left is negative, right is positive\n double xOff = Math.round((Accel.getX() - ZeroX) * 10) / 10D;\n // Forward is negative, backwards is positive\n double zOff = Math.round((Accel.getZ() - ZeroZ) * 10) / 10D;\n\n\n SmartDashboard.putNumber(\"X\", xOff);\n SmartDashboard.putNumber(\"Z\", zOff);\n\n\n if (climbSafety || IsHoldingBack || IsHoldingFront) {\n if (climbBoth) {\n IsHoldingBack = true;\n IsHoldingFront = true;\n\n \n double SpeedFR = CLIMB_SPEED;\n double SpeedFL = -CLIMB_SPEED;\n double SpeedBR = -CLIMB_SPEED;\n double SpeedBL = CLIMB_SPEED;\n\n final double SLOW_MULT = 0.3;\n\n if (xOff < 0 || zOff < 0) {\n SpeedBR *= SLOW_MULT;\n }\n\n if (xOff < 0 || zOff > 0) {\n SpeedFR *= SLOW_MULT;\n }\n\n if (xOff > 0 || zOff < 0) {\n SpeedBL *= SLOW_MULT;\n }\n\n if (xOff > 0 || zOff > 0) {\n SpeedFL *= SLOW_MULT;\n }\n \n LegFrontR.set(SpeedFR);\n LegFrontL.set(ControlMode.PercentOutput, SpeedFL);\n LegBackR.set(ControlMode.PercentOutput, SpeedBR);\n LegBackL.set(ControlMode.PercentOutput, SpeedBL);\n\n } else {\n if (retractBack) {\n IsHoldingBack = false;\n LegBackR.set(ControlMode.PercentOutput, RETRACT_SPEED);\n LegBackL.set(ControlMode.PercentOutput, -RETRACT_SPEED);\n } else if (IsHoldingBack) {\n double rightSpeed = -HOLD_SPEED;\n double leftSpeed = HOLD_SPEED;\n int pov = xbox.getPOV();\n\n // Front right leg\n if (pov >= 0 && pov <= 90) {\n\n }\n\n LegBackR.set(ControlMode.PercentOutput, -HOLD_SPEED);\n LegBackL.set(ControlMode.PercentOutput, HOLD_SPEED);\n } else {\n LegBackR.set(ControlMode.PercentOutput, 0);\n LegBackL.set(ControlMode.PercentOutput, 0);\n }\n\n if (retractFront) {\n IsHoldingFront = false;\n LegFrontR.set(-RETRACT_SPEED);\n LegFrontL.set(ControlMode.PercentOutput, RETRACT_SPEED);\n } else if (IsHoldingFront) {\n double rightSpeed = HOLD_SPEED;\n double leftSpeed = -HOLD_SPEED;\n int pov = xbox.getPOV();\n\n // Front right leg\n if (pov >= 0 && pov <= 90) {\n rightSpeed *= HOLD_CLIMB_MULTIPLIER;\n }\n\n LegFrontR.set(rightSpeed);\n LegFrontL.set(ControlMode.PercentOutput, leftSpeed);\n } else {\n LegFrontR.set(0);\n LegFrontL.set(ControlMode.PercentOutput, 0);\n }\n }\n } else {\n LegBackR.set(ControlMode.PercentOutput, 0);\n LegBackL.set(ControlMode.PercentOutput, 0);\n LegFrontR.set(0);\n LegFrontL.set(ControlMode.PercentOutput, 0);\n }\n \n double footSpeed = Math.max(-1.0, Math.min(rawSpeed * 3, 1.0F));\n\n if (IsHoldingBack) {\n // Drive back feet\n BackFootMover.set(footSpeed);\n } else {\n BackFootMover.set(0);\n }\n\n if (IsHoldingFront) {\n // Drive front feet\n FrontFootMover.set(footSpeed);\n } else {\n FrontFootMover.set(0);\n }\n\n // Publish values to dashboard for LEDs\n LedArmsClosed.setBoolean(ArmsClosed);\n }", "boolean isInAir() {\n return inAir;\n }", "private boolean canRunTowerImmediateEffects(Player player, int floor){\n List<DevelopmentCard> developmentCards = player.getPersonalBoard().getCards(DevelopmentCardColor.BLUE);\n for(DevelopmentCard developmentCard : developmentCards)\n if (developmentCard.getPermanentEffect() instanceof EffectNoBonus){\n EffectNoBonus effectNoBonus = (EffectNoBonus) developmentCard.getPermanentEffect();\n for (Integer towerFloor : effectNoBonus.getFloors())\n if (towerFloor == floor)\n return true;\n\n }\n return false;\n }", "public void checkWindCollision() {\n\n if (Intersector.overlaps(player.boundingCircle, wind1.boundingRectangle)) {\n if (!wind1.angry) {\n //Blow Right\n if (wind1.left && (player.x + AssetHandler.WIND_STRENGTH + player.circleRad < AssetHandler.SCREEN_WIDTH)) {\n player.x += AssetHandler.WIND_STRENGTH;\n } else if (!wind1.left && player.x - AssetHandler.WIND_STRENGTH - player.circleRad > 0) {\n player.x -= AssetHandler.WIND_STRENGTH;\n }\n } else {\n wind1.boundingRectangle.x = -wind1.boundingRectangle.width;\n player.paralyzed = true;\n player.paralyzedStart = TimeUtils.nanoTime();\n shake = true;\n }\n\n }\n\n\n //Check 2nd wind\n\n if (Intersector.overlaps(player.boundingCircle, wind2.boundingRectangle)) {\n if (!wind2.angry) {\n if (wind2.left && (player.x + AssetHandler.WIND_STRENGTH + player.circleRad < AssetHandler.SCREEN_WIDTH)) {\n player.x += AssetHandler.WIND_STRENGTH;\n } else if (!wind2.left && player.x - AssetHandler.WIND_STRENGTH - player.circleRad > 0) {\n player.x -= AssetHandler.WIND_STRENGTH;\n }\n } else {\n wind2.boundingRectangle.x = -wind2.boundingRectangle.width;\n player.paralyzed = true;\n player.paralyzedStart = TimeUtils.nanoTime();\n shake = true;\n }\n }\n\n\n //Check 3rd wind\n\n if (Intersector.overlaps(player.boundingCircle, wind3.boundingRectangle)) {\n if (!wind3.angry) {\n if (wind3.left && (player.x + AssetHandler.WIND_STRENGTH + player.circleRad < AssetHandler.SCREEN_WIDTH)) {\n player.x += AssetHandler.WIND_STRENGTH;\n } else if (!wind3.left && player.x - AssetHandler.WIND_STRENGTH - player.circleRad > 0) {\n player.x -= AssetHandler.WIND_STRENGTH;\n }\n } else {\n wind3.boundingRectangle.x = -wind3.boundingRectangle.width;\n player.paralyzed = true;\n player.paralyzedStart = TimeUtils.nanoTime();\n shake = true;\n }\n }\n\n\n /*\n * Check Wind Collision For Particle Effect Generation\n */\n\n\n //Check 1st Wind\n\n if(Intersector.overlaps(player.boundingCircle, wind1.spriteRectangle)) {\n if(!particle) {\n cloudParticle.setPosition(player.x, wind1.y + wind1.height/2);\n if(cloudParticle.isComplete())\n cloudParticle.reset();\n particle = true;\n } else {\n cloudParticle.setPosition(cloudParticle.getEmitters().first().getX(), wind1.y + wind1.height/2);\n }\n if(wind1.angry) {\n cloudParticle.setFlip(false, true);\n } else {\n cloudParticle.setFlip(false, false);\n }\n }\n\n\n //Check 2nd Wind\n\n if(Intersector.overlaps(player.boundingCircle, wind2.spriteRectangle)) {\n if(!particle) {\n cloudParticle.setPosition(player.x, wind2.y + wind2.height/2);\n if(cloudParticle.isComplete())\n cloudParticle.reset();\n particle = true;\n } else {\n cloudParticle.setPosition(cloudParticle.getEmitters().first().getX(), wind2.y + wind2.height/2);\n }\n if(wind2.angry) {\n cloudParticle.setFlip(false, true);\n } else {\n cloudParticle.setFlip(false, false);\n }\n }\n\n\n //Check 3rd Wind\n\n if(Intersector.overlaps(player.boundingCircle, wind3.spriteRectangle)) {\n if(!particle) {\n cloudParticle.setPosition(player.x, wind3.y + wind3.height/2);\n if(cloudParticle.isComplete())\n cloudParticle.reset();\n particle = true;\n } else {\n cloudParticle.setPosition(cloudParticle.getEmitters().first().getX(), wind3.y + wind3.height/2);\n }\n if(wind3.angry) {\n cloudParticle.setFlip(false, true);\n } else {\n cloudParticle.setFlip(false, false);\n }\n }\n\n }", "public void pleaseStop()\n {\n\t this.doorgaan_thread = false;\n\t this.doorgaan_wheel = true;\n draad = null; // waarom? \n }", "private void fallDetection(double acceleration){\n \n switch (state){\n case INIT_STATE:\n // Acceleration considered as free fall if it has value lower than 0.42G ~ 0.63G\n if (acceleration < 0.63){\n freeFallTime = Instant.now().toEpochMilli();\n Log.println(Log.DEBUG, TAG, \"FREE_FALL_DETECTED: \" +freeFallTime);\n sendBroadcast(new Intent().setAction(FALLING_STATE));\n state = FallingState.FREE_FALL_DETECTION_STATE;\n }\n break;\n\n case FREE_FALL_DETECTION_STATE:\n // Detect ground impact: > 2.02g ~ 3.10g\n if (acceleration > 2.02){\n long impactTime = Instant.now().toEpochMilli();\n long duration = impactTime - freeFallTime;\n // Measure duration between free fall incident and impact\n if (duration > 250 && duration < 800){\n Log.println(Log.DEBUG, TAG, \"IMPACT_DETECTED - Falling Duration: \"\n +duration +\" ms\");\n sendBroadcast(new Intent().setAction(LAYING_STATE));\n state = FallingState.IMPACT_DETECTION_STATE;\n }\n else{\n Log.println(Log.DEBUG, TAG, \"Resetting...\");\n sendBroadcast(new Intent().setAction(STANDING_STATE));\n state = FallingState.INIT_STATE;\n }\n }\n else if (Instant.now().isAfter(Instant.ofEpochMilli(freeFallTime).plusMillis(800))){\n Log.println(Log.DEBUG, TAG, \"Resetting...\");\n sendBroadcast(new Intent().setAction(STANDING_STATE));\n state = FallingState.INIT_STATE;\n }\n break;\n\n case IMPACT_DETECTION_STATE:\n // Detect Immobility (about 1G): If stand still for over 2.5 seconds\n if (Instant.now().isAfter(Instant.ofEpochMilli(freeFallTime).plusMillis(1800)) &&\n acceleration >= 0.90 && acceleration <= 1.10){\n // Detection of motion interrupts the count\n long duration = Instant.now().toEpochMilli() - freeFallTime;\n sendBroadcast(new Intent().setAction(LAYING_STATE));\n // 1800ms since free fall detection and 2200ms standing still\n if (duration > 4000){\n Log.println(Log.DEBUG, TAG, \"IMMOBILITY_DETECTED\");\n state = FallingState.IMMOBILITY_DETECTION_STATE;\n }\n }\n // If motion is detected go to Initial State\n else if(Instant.now().isAfter(Instant.ofEpochMilli(freeFallTime).plusMillis(1800))){\n Log.println(Log.DEBUG, TAG, \"Resetting...\");\n sendBroadcast(new Intent().setAction(STANDING_STATE));\n state = FallingState.INIT_STATE;\n }\n break;\n\n case IMMOBILITY_DETECTION_STATE:\n // Trigger Countdown Alarm\n sendBroadcast(new Intent().setAction(FALL_RECEIVER));\n Log.println(Log.DEBUG, TAG, \"Alarm Triggered!!!\");\n state = FallingState.INIT_STATE;\n break;\n }\n }", "public void autonomous() {\n robot.drive(0.5); //Drives in a square\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n }", "@Override\n\tpublic void teleopPeriodic() {\n\t\tScheduler.getInstance().run();\n\t\tSmartDashboard.putBoolean(\"Max Intake Extension: \", RobotMap.intakeLifted.get());\n\t\tSmartDashboard.putBoolean(\"Max Lift Extension:\", RobotMap.isAtTop.get());\n\t\tSmartDashboard.putBoolean(\"Min Lift Extension:\", RobotMap.isAtBottom.get());\n\t\tDriveTrain.driveWithJoystick(RobotMap.stick, RobotMap.rd); // Drive\n\t\tTeleOp.RaiseLift(RobotMap.liftTalon, RobotMap.controller); // Raise lift\n\t\tif(RobotMap.controller.getRawAxis(RobotMap.lowerLiftAxis) >= 0.2) {\n\t\tTeleOp.LowerLift(RobotMap.liftTalon, RobotMap.controller);\n\t\t}\n\t\tTeleOp.DropIntake(RobotMap.controller, RobotMap.intakeLifter);\n\t\tTeleOp.spinOut(RobotMap.intakeVictorLeft, RobotMap.controller);\n\t\t//TeleOp.spinnySpinny(RobotMap.intakeVictorLeft, RobotMap.stick);\n\t}", "@Override\n public void runOpMode() {\n motorFL = hardwareMap.get(DcMotor.class, \"motorFL\");\n motorBL = hardwareMap.get(DcMotor.class, \"motorBL\");\n motorFR = hardwareMap.get(DcMotor.class, \"motorFR\");\n motorBR = hardwareMap.get(DcMotor.class, \"motorBR\");\n landerRiser = hardwareMap.get(DcMotor.class, \"lander riser\");\n landerRiser = hardwareMap.get(DcMotor.class, \"lander riser\");\n landerRiser.setDirection(DcMotor.Direction.FORWARD);\n landerRiser.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n markerDrop = hardwareMap.get(Servo.class, \"marker\");\n markerDrop.setDirection(Servo.Direction.FORWARD);\n telemetry.addData(\"Status\", \"Initialized\");\n telemetry.update();\n\n // Wait for the game to start (driver presses PLAY)\n waitForStart();\n runtime.reset();\n\n //Landing & unlatching\n landerRiser.setPower(-1);\n telemetry.addData(\"Status\", \"Descending\");\n telemetry.update();\n sleep(5550);\n landerRiser.setPower(0);\n telemetry.addData(\"Status\",\"Unhooking\");\n telemetry.update();\n move(-0.5, 600, true);\n strafe(-0.4,0.6, 3600, true);\n move(0.5,600,true);\n markerDrop.setPosition(0);\n sleep(1000);\n markerDrop.setPosition(0.5);\n sleep(700);\n markerDrop.setPosition(0);\n strafe(0, -0.5,500,true);\n strafe(0.5, -0.25, 8500, true);\n\n }", "public void teleopPeriodic() \n {\n // NIVision.Rect rect = new NIVision.Rect(10, 10, 100, 100);\n /*\n NIVision.IMAQdxGrab(session, frame, 1);\n //NIVision.imaqDrawShapeOnImage(frame, frame, rect,\n // DrawMode.DRAW_VALUE, ShapeMode.SHAPE_OVAL, 0.0f);\n */\n \n //cam.getImage(frame);\n //camServer.setImage(frame);\n \n //CameraServer.getInstance().setImage(frame);\n \n if(verticalLift.limitSwitchHit())\n verticalLift.resetEnc();\n \n Scheduler.getInstance().run();\n }", "public void action() {\n\t\tsuppressed = false;\r\n\t\tpilot.setLinearSpeed(8);\r\n\t\tpilot.setLinearAcceleration(4);\r\n\t\tColorThread.updatePos = false;\r\n\t\tColorThread.updateCritical = false;\r\n\t\t//create a array to save the map information\r\n\t\tfor (int a = 0; a < 8; a++) {\r\n\t\t\tfor (int b = 0; b < 8; b++) {\r\n\t\t\t\trobot.probability[a][b] = -1;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (int a = 0; a < 8; a++) {\r\n\t\t\tfor (int b = 0; b < 8; b++) {\r\n\t\t\t\tif (a == 0 || a == 7 || b == 0 || b == 7) {\r\n\t\t\t\t\trobot.probability[a][b] = 100;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (int a = 0; a < 6; a++) {\r\n\t\t\tfor (int b = 0; b < 6; b++) {\r\n\t\t\t\tif (robot.map[a][b].getOccupied() == 1) {\r\n\t\t\t\t\trobot.probability[a + 1][b + 1] = 100;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Step1: use ArrayList to save all of the probability situation.\r\n\t\tfloat front, left, right, back;\r\n\t\tfront = USThread.disSample[0];\r\n\t\trobot.setmotorM(90);\r\n\t\tDelay.msDelay(1000);\r\n\t\tleft = USThread.disSample[0];\r\n\t\trobot.setmotorM(-180);\r\n\t\tDelay.msDelay(1000);\r\n\t\tright = USThread.disSample[0];\r\n\t\trobot.setmotorM(90);\r\n\t\tDelay.msDelay(1000);\r\n\t\trobot.correctHeading(180);\r\n\t\tDelay.msDelay(1000);\r\n\t\tback = USThread.disSample[0];\r\n\t\trobot.correctHeading(180);\r\n\t\tfor (int a = 1; a < 7; a++) {\r\n\t\t\tfor (int b = 1; b < 7; b++) {\r\n\t\t\t\tif (robot.probability[a][b] == -1) {\r\n\t\t\t\t\tif (((robot.probability[a][b + 1] == 100 && front < 0.25)\r\n\t\t\t\t\t\t\t|| (robot.probability[a][b + 1] == -1 && front > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a + 1][b] == 100 && right < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a + 1][b] == -1 && right > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b - 1] == 100 && back < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b - 1] == -1 && back > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a - 1][b] == 100 && left < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a - 1][b] == -1 && left > 0.25))) {\r\n\t\t\t\t\t\t//direction is north\r\n\t\t\t\t\t\trobot.listOfPro.add(new ProPoint(0, 0, a, b));\r\n\t\t\t\t\t\t//System.out.println(\"0 \"+a+\" \"+b);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (((robot.probability[a + 1][b] == 100 && front < 0.25)\r\n\t\t\t\t\t\t\t|| (robot.probability[a + 1][b] == -1 && front > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b - 1] == 100 && right < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b - 1] == -1 && right > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a - 1][b] == 100 && back < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a - 1][b] == -1 && back > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b + 1] == 100 && left < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b + 1] == -1 && left > 0.25))) {\r\n\t\t\t\t\t\t// direction is east\r\n\t\t\t\t\t\trobot.listOfPro.add(new ProPoint(1, 0, a, b));\r\n\t\t\t\t\t\t//System.out.println(\"1 \"+a+\" \"+b);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (((robot.probability[a][b - 1] == 100 && front < 0.25)\r\n\t\t\t\t\t\t\t|| (robot.probability[a][b - 1] == -1 && front > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a - 1][b] == 100 && right < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a - 1][b] == -1 && right > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b + 1] == 100 && back < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b + 1] == -1 && back > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a + 1][b] == 100 && left < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a + 1][b] == -1 && left > 0.25))) {\r\n\t\t\t\t\t\t// direction is sourth\r\n\t\t\t\t\t\trobot.listOfPro.add(new ProPoint(2, 0, a, b));\r\n\t\t\t\t\t\t//System.out.println(\"2 \"+a+\" \"+b);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (((robot.probability[a - 1][b] == 100 && front < 0.25)\r\n\t\t\t\t\t\t\t|| (robot.probability[a - 1][b] == -1 && front > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b + 1] == 100 && right < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b + 1] == -1 && right > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a + 1][b] == 100 && back < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a + 1][b] == -1 && back > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b - 1] == 100 && left < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b - 1] == -1 && left > 0.25))) {\r\n\t\t\t\t\t\t// direction is west\r\n\t\t\t\t\t\trobot.listOfPro.add(new ProPoint(3, 0, a, b));\r\n\t\t\t\t\t\t//System.out.println(\"3 \"+a+\" \"+b);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Step 2: use loop to take control of robot walk and check the location correction\r\n\t\tboolean needLoop = true;\r\n\t\tint loopRound = 0;\r\n\t\twhile (needLoop) {\r\n\t\t\t// One of way to leave the loop is at the hospital\r\n\t\t\tif ((ColorThread.leftColSample[0] >= 0.2 && ColorThread.leftColSample[1] < 0.2\r\n\t\t\t\t\t&& ColorThread.leftColSample[1] >= 0.14 && ColorThread.leftColSample[2] <= 0.8)\r\n\t\t\t\t\t&& (ColorThread.rightColSample[0] >= 0.2 && ColorThread.rightColSample[1] < 0.2\r\n\t\t\t\t\t\t\t&& ColorThread.rightColSample[1] >= 0.11 && ColorThread.rightColSample[2] <= 0.08)) {\r\n\t\t\t\trobot.updatePosition(0, 0);\r\n\t\t\t\tint numOfAtYellow = 0;\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getNowX() == 1 && robot.listOfPro.get(i).getNowY() == 1) {\r\n\t\t\t\t\t\tnumOfAtYellow++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(numOfAtYellow == 1) {\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getNowX() == 1 && robot.listOfPro.get(i).getNowY() == 1) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 3) {\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// do not to set the heading, because the default value is 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\t}else {\r\n\t\t\t\t\t//have two way to go to the yellow part\r\n\t\t\t\t\tfront = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(90);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tleft = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(-180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tright = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(90);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tback = USThread.disSample[0];\r\n\t\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tif(front<0.25 && right<0.25 && left>0.25 && back>0.25) {\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t}else if(front<0.25 && right>0.25 && back>0.25 && left<0.25) {\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t}else if(front>0.25 && right>0.25 && back<0.25 && left<0.25) {\r\n\t\t\t\t\t\t// do not to set the heading, because the default value is 0.\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tneedLoop = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t//Another way to leave the loop is the robot arrive the green cell.\r\n\t\t\tif ((ColorThread.leftColSample[0] <= 0.09 && ColorThread.leftColSample[1] >= 0.17\r\n\t\t\t\t\t&& ColorThread.leftColSample[2] <= 0.09)\r\n\t\t\t\t\t&& (ColorThread.rightColSample[0] <= 0.09 && ColorThread.rightColSample[1] >= 0.014\r\n\t\t\t\t\t\t\t&& ColorThread.rightColSample[2] <= 0.11)) {\r\n\t\t\t\trobot.updatePosition(5, 0);\r\n\t\t\t\tint numOfAtGreen = 0;\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getNowX() == 6 && robot.listOfPro.get(i).getNowY() == 1) {\r\n\t\t\t\t\t\tnumOfAtGreen++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(numOfAtGreen==1) {\r\n\t\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowX() == 6 && robot.listOfPro.get(i).getNowY() == 1) {\r\n\t\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 3) {\r\n\t\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// do not to set the heading, because the default value is 0.\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else {\r\n\t\t\t\t\tfront = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(90);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tleft = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(-180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tright = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(90);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tback = USThread.disSample[0];\r\n\t\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tif(front<0.25 && right<0.25 && left>0.25 && back>0.25) {\r\n\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t}else if(front<0.25 && right>0.25 && back>0.25 && left<0.25) {\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t}else if(front>0.25 && right>0.25 && back<0.25 && left<0.25) {\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t// do not to set the heading, because the default value is 0.\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tneedLoop = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t//The third way of leave the loop is the robot have already know his position and direction.\r\n\t\t\tint maxStepNumber = 0;\r\n\t\t\tint numberOfMaxSteps = 0;\r\n\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\tif (robot.listOfPro.get(i).getSteps() > maxStepNumber) {\r\n\t\t\t\t\tmaxStepNumber = robot.listOfPro.get(i).getSteps();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\tif (robot.listOfPro.get(i).getSteps() == maxStepNumber) {\r\n\t\t\t\t\tnumberOfMaxSteps++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (numberOfMaxSteps == 1) {\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getSteps() == maxStepNumber) {\r\n\t\t\t\t\t\trobot.updatePosition(robot.listOfPro.get(i).getNowX() - 1,\r\n\t\t\t\t\t\t\t\trobot.listOfPro.get(i).getNowY() - 1);\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 3) {\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// do not to set the heading, because the default value is 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\tneedLoop = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t//The below part are the loops.\r\n\t\t\tfront = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(90);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tleft = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(-180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tright = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(90);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\trobot.correctHeading(180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tback = USThread.disSample[0];\r\n\t\t\trobot.correctHeading(180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\t// move\r\n\t\t\t\r\n\t\t\tif (front > 0.25) {\r\n\t\t\t\trobot.getPilot().travel(25);\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif(robot.listOfPro.get(i).getSteps()==loopRound) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() + 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() + 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() - 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() - 1);\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} else if (left > 0.25) {\r\n\t\t\t\trobot.correctHeading(-90);\r\n\t\t\t\trobot.getPilot().travel(25);\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif(robot.listOfPro.get(i).getSteps()==loopRound) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(3);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() - 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(0);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() + 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(1);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() + 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(2);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() - 1);\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} else if (right > 0.25) {\r\n\t\t\t\trobot.correctHeading(90);\r\n\t\t\t\trobot.getPilot().travel(25);\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif(robot.listOfPro.get(i).getSteps()==loopRound) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(1);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() + 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(2);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() - 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(3);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() - 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(0);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() + 1);\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} else {\r\n\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\trobot.getPilot().travel(25);\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif(robot.listOfPro.get(i).getSteps()==loopRound) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(2);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() - 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(3);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() - 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(0);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() + 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(1);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() + 1);\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\t// It time to check the around situation\r\n\t\t\tfront = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(90);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tleft = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(-180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tright = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(90);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\trobot.correctHeading(180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tback = USThread.disSample[0];\r\n\t\t\trobot.correctHeading(180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t//System.out.println(robot.listOfPro.get(i).getSteps());\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\tif (((front < 0.25\r\n\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro.get(i).getNowY()\r\n\t\t\t\t\t\t\t\t\t\t+ 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (front > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() + 1] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((left < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t- 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (left > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() - 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((right < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (right > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() + 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((back < 0.25 && robot.probability[robot.listOfPro.get(i)\r\n\t\t\t\t\t\t\t\t\t\t\t\t.getNowX()][robot.listOfPro.get(i).getNowY() - 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (back > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() - 1] == -1))) {\r\n\t\t\t\t\t\t\t//It is correct when the robot have the same data information with estimate information\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setSteps(robot.listOfPro.get(i).getSteps() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\tif (((left < 0.25\r\n\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro.get(i).getNowY()\r\n\t\t\t\t\t\t\t\t\t\t+ 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (left > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() + 1] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((back < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t- 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (back > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() - 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((front < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (front > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() + 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((right < 0.25 && robot.probability[robot.listOfPro.get(i)\r\n\t\t\t\t\t\t\t\t\t\t\t\t.getNowX()][robot.listOfPro.get(i).getNowY() - 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (right > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() - 1] == -1))) {\r\n\t\t\t\t\t\t\t//It is correct when the robot have the same data information with estimate information\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setSteps(robot.listOfPro.get(i).getSteps() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\tif (((back < 0.25\r\n\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro.get(i).getNowY()\r\n\t\t\t\t\t\t\t\t\t\t+ 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (back > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() + 1] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((right < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t- 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (right > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() - 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((left < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (left > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() + 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((front < 0.25 && robot.probability[robot.listOfPro.get(i)\r\n\t\t\t\t\t\t\t\t\t\t\t\t.getNowX()][robot.listOfPro.get(i).getNowY() - 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (front > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() - 1] == -1))) {\r\n\t\t\t\t\t\t\t//It is correct when the robot have the same data information with estimate information\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setSteps(robot.listOfPro.get(i).getSteps() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (((right < 0.25\r\n\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro.get(i).getNowY()\r\n\t\t\t\t\t\t\t\t\t\t+ 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (right > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() + 1] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((front < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t- 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (front > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() - 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((back < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (back > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() + 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((left < 0.25 && robot.probability[robot.listOfPro.get(i)\r\n\t\t\t\t\t\t\t\t\t\t\t\t.getNowX()][robot.listOfPro.get(i).getNowY() - 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (left > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() - 1] == -1))) {\r\n\t\t\t\t\t\t\t//It is correct when the robot have the same data information with estimate information\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setSteps(robot.listOfPro.get(i).getSteps() + 1);\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\tloopRound++;\r\n\t\t}\r\n\t\t// if is out the while loop, it will find the heading and the position of robot right now.\r\n\t\t//Step 3: It is time to use wavefront to come back to the hospital\r\n\t\trobot.restoreDefault();\r\n\t\trobot.RunMode = 1;\r\n\t\tColorThread.updatePos = true;\r\n\t\tColorThread.updateCritical = true;\r\n\t}", "@Override\n public void onSensorChanged(SensorEvent event) {\n float distance = event.values[0];\n Log.e(\"xuawang\", \"d: \"+distance);\n if(distance > 5) {\n //far\n if(mIsDarkMode){\n darkScreen(false, getWindow());\n am.setMode(AudioManager.MODE_NORMAL);\n am.setSpeakerphoneOn(true);\n am.setBluetoothScoOn(false);\n }\n mIsDarkMode = false;\n } else {\n //close enough\n if(!mIsDarkMode){\n darkScreen(true, getWindow());\n am.setMode(AudioManager.MODE_IN_CALL);\n am.setSpeakerphoneOn(false);\n am.setBluetoothScoOn(true);\n }\n mIsDarkMode = true;\n }\n }", "private void check() {\n ShedSolar.instance.haps.post( Events.WEATHER_REPORT_MISSED );\n LOGGER.info( \"Failed to receive weather report\" );\n\n // check again...\n startChecker();\n }", "boolean UnlockedEscapeTheIsland() {\n if (allMissions.missionStatus.get(\"Escape the island\") == true) {\n return false;\n }\n return true;\n }", "boolean CanBuyRoad();", "public void attack() {\n //Grab an attacker.\n Territory attacker = potentialAttackers.remove(0);\n \n //Find the weakest adjacent territory\n int victimStrength = Integer.MAX_VALUE;\n Territory victim = null;\n List<Territory> adjs = gameController.getBoard().getAdjacentTerritories(attacker);\n for(Territory adj : adjs){\n \n //Verify that our odds are good enough for this attack to consider it.\n int aTroops = attacker.getNumTroops() - 1;\n int dTroops = adj.getNumTroops();\n double odds = MarkovLookupTable.getOddsOfSuccessfulAttack(aTroops, dTroops);\n boolean yes = Double.compare(odds, ACCEPTABLE_RISK) >= 0;\n \n //If we have a chance of winning this fight and its the weakest opponent.\n if(yes && adj.getNumTroops() < victimStrength && !adj.getOwner().equals(this)){\n victim = adj;\n victimStrength = adj.getNumTroops();\n }\n }\n \n //Resolve the Attack by building forces and settle the winner in Victim's land\n Force atkForce = attacker.buildForce(attacker.getNumTroops() - 1);\n Force defForce = victim.buildForce(victimStrength); //Guaranteed not null\n Force winner = atkForce.attack(defForce);\n victim.settleForce(winner);\n }", "public void towerIndexing()\n {\n m_towerMotor.set(ControlMode.PercentOutput, 0.5);\n m_intakeHopperMotor.set(ControlMode.PercentOutput, HopperConstants.HOPPER_MOTOR_POWER);\n }", "private void turnToNoWall(Navigation.Turn direction) {\r\n\t\tnavigation.rotate(direction);\r\n\t\tdoneTurning=false;\r\n\t\t\r\n\t\twhile(!doneTurning) {\r\n\t\t\tif(usSensor.rawDistance()>WALL_THRESHOLD) {\r\n\t\t\t filterControl++;\r\n\t\t\t\tif(filterControl>=NO_WALL_FILTER) {\r\n\t\t\t\t\tfilterControl=0;\r\n\t\t\t\t\tdoneTurning=true;\r\n\t\t\t\t\tnavigation.stopMotors();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tfilterControl=0;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic void teleopPeriodic() {\n\t\tRobot.intakeSubsystem._getSpeed();\n\n\t\tRobot.driveSubsystem.operatorOverride();\n\t\tScheduler.getInstance().run();\n\n\t\tTargetRegion boilerTarget = Robot.navigator.getBoilerTarget();\n\t\tif (boilerTarget != null) {\n\t\t\tSmartDashboard.putNumber(\"Target Center X\", boilerTarget.m_centerTop);\n\t\t\tSmartDashboard.putNumber(\"Target Center Y\", boilerTarget.m_bounds.m_top);\n\t\t} else {\n\t\t\tSmartDashboard.putNumber(\"Target Center X\", -1);\n\t\t\tSmartDashboard.putNumber(\"Target Center Y\", -1);\n\t\t}\n\t}", "public void teleopPeriodic() {\n\t\t// resetAndDisable();\n\t\tupdateDashboard();\n\t\tLogitechJoystick.controllers();\n\t\tDrivetrain.arcadeDrive();\n\t\tShooterAngleMotor.angleShooter();\n\t\tBallShooter.shootBalls();\n\t\tSonicSensor.updateSensors();\n\t\t\n\t\t//if(LogitechJoystick.rightBumper2)\n\t\t\t//{\n\t\t\t\t//LowBar.makeArmStable();\n\t\t\t//}\n\n\t}", "@Override\n public void teleopPeriodic() {\n double triggerVal = \n (m_driverController.getTriggerAxis(Hand.kRight)\n - m_driverController.getTriggerAxis(Hand.kLeft))\n * RobotMap.DRIVING_SPEED;\n\n double stick = \n (m_driverController.getX(Hand.kLeft))\n * RobotMap.TURNING_RATE;\n \n m_driveTrain.tankDrive(triggerVal + stick, triggerVal - stick);\n\n if(m_driverController.getAButton()){\n m_shooter.arcadeDrive(RobotMap.SHOOTER_SPEED, 0.0);\n }\n \n else{\n m_shooter.arcadeDrive(0.0, 0.0);\n }\n \n }", "public void duelmode(ScannedRobotEvent e) {\r\n //run predictive_shooter()\r\n if(e.getEnergy() <= 20) {\r\n //shoot things\r\n engage(e);\r\n } runaway(e);\r\n }", "private void checkFall(){\n if(onGround()){\n vSpeed = 0;\n }\n else{\n if(getGlobalY() > 590)\n {\n death();\n changeCanMove(false);\n }\n else{\n fall();\n }\n }\n }", "@Override\n public void onPourWaterRaised() {\n if (theFSM.getCupPlaced()) {\n pouringState = true;\n }\n }", "protected boolean canTriggerWalking() {\n/* 140 */ return false;\n/* */ }", "public void autonomousPeriodic() {\n\t\tScheduler.getInstance().run();\n\t\t\n shooterArm.updateSmartDashboard();\n\t\tdriveTrain.getDegrees();\n\n\t\tvision.findGoal();\n\t\tvision.getGoalXAngleError();\n\t\tvision.getGoalArmAngle();\n\n\t\t// Stop auto mode if the robot is tilted too much\n\t\tif (Math.abs(driveTrain.getRobotPitch())<=60 && Math.abs(driveTrain.getRobotRoll())<=60)\n\t\t\ttimerTilt.reset();\n\t\t\n\t\t// For some reason, robot did not move in last match in auto, so this code is suspect\n\t\t// Do the Pitch/Roll values need to be zeroed?\n//\t\tif ( autonomousCommand != null && timerTilt.get()>0.5)\n//\t\t\tautonomousCommand.cancel();\n\n\t}", "@Test\n public void shouldThrowExceptionAmbientAirTemperatureBelowLowerBound() {\n\n Integer testInput = -1;\n \n AmbientAirTemperature testAmbientAirTemperature = new AmbientAirTemperature(testInput);\n AmbientAirPressure testAmbientAirPressure = new AmbientAirPressure(0);\n \n WeatherProbe testWeatherProbe = new WeatherProbe(\n testAmbientAirTemperature,\n testAmbientAirPressure,\n mockWiperSet);\n \n try {\n OssWeatherProbe.genericWeatherProbe(testWeatherProbe).getAirTemp();\n fail(\"Expected IllegalArgumentException\");\n } catch (RuntimeException e) {\n assertEquals(IllegalArgumentException.class, e.getClass());\n }\n \n }", "@Override\n public boolean activate() {\n //When will this activate?\n return Areas.FALADOR.contains(ctx.players.local().tile())\n && ctx.widgets.component(1371,0).visible()\n && !ctx.objects.select().name(\"Waterpump\").within(6.0).isEmpty();\n }", "void sitOn();", "public Boolean IsIOtrminate() {\n Random r = new Random();\n int k = r.nextInt(100);\n //20%\n if (k <= 20) {\n return true;\n }\n return false;\n }", "void initSafeties(){\n gyroSafety();\n tensorFlowSafety();\n\n telemetry.addLine(\"Init finalized successfully\");\n telemetry.update();\n }", "public HitWall() {\n\t\ttouch_r = Settings.TOUCH_R;\n\t\ttouch_l = Settings.TOUCH_L;\n\t\tpilot = Settings.PILOT;\n\t}", "private void notWorthy(final Player player) {\n\t\tplayer.getInterfaceManager().closeChatBoxInterface();\n\t\tplayer.lock(15);\n\t\tplayer.setNextFaceWorldTile(new WorldTile(3084, 3483, 0));\n\t\tWorldTasksManager.schedule(new WorldTask() {\n\t\t\tint phase = 0;\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tfinal int[] randomNPC = { 6935, 3283, 4344, 6966 };\n\t\t\t\tswitch (phase) {\n\t\t\t\tcase 0:\n\t\t\t\t\tplayer.setNextAnimation(new Animation(857));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tplayer.setNextAnimation(new Animation(915));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tplayer.setNextAnimation(new Animation(857));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tplayer.setNextGraphics(new Graphics(86));\n\t\t\t\t\tplayer.getGlobalPlayerUpdater().transformIntoNPC(randomNPC[Utils.random(randomNPC.length - 1)]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tplayer.setNextForceTalk(new ForceTalk(\".... what in Helwyr is going on..!?\"));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tplayer.setNextGraphics(new Graphics(86));\n\t\t\t\t\tplayer.getGlobalPlayerUpdater().transformIntoNPC(-1);\n\t\t\t\t\tplayer.setNextAnimation(new Animation(10070));\n\t\t\t\t\t//player.setNextForceMovement(new ForceMovement(new WorldTile(3084, 3485, 0), 0, 2));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\t//player.setNextWorldTile(new WorldTile(3084, 3485, 0)); TODO find out why force movement doesn't work <.>\n\t\t\t\t\tNPC guard = World.findNPC(5941);\n\t\t\t\t\tsendNPCDialogue(4405, GOOFY_LAUGH, \"Looks like Dahmaroc had a sense of humour!\");\n\t\t \t // player.faceEntity(guard);\n\t\t \t // guard.faceEntity(player);\n\t\t\t\t\tplayer.unlock();\n\t\t\t\t\tstage = 99;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tphase++;\n\t\t\t}\n\t\t}, 0, 2);\n\t}", "public void setAttacking (Fighter f1 , Platform plat, boolean[] inputs)\r\n {\r\n //if pressing attack button and isn't blocking and can attack\r\n if (inputs[4] == true && f1.getBlocking() != 1 && f1.getAttacking() == 0) \r\n {\r\n Fighter.Attack b; //the fighter's new attack\r\n\r\n if(f1.getPos()[1] + f1.getSize() < plat.getY()) //if in the air\r\n {\r\n if(inputs[2] == true) //if holding down\r\n {\r\n b = f1.new AirDown(); //the new attack is air down\r\n }else if(inputs[1] == true || inputs[3] == true) //if holding a directional button\r\n {\r\n b = f1.new AirDirection(); //the new attack is air direction\r\n }else\r\n {\r\n b = f1.new AirNeutral(); //the new attack is air neutral\r\n }\r\n }else\r\n { \r\n if(inputs[2] == true) //if down is held\r\n {\r\n b = f1.new BasicUp(); //the new attack is basic up\r\n }else if(inputs[1] == true || inputs[3] == true) //if holding a directional button\r\n {\r\n b = f1.new BasicDirection(); //the new attack is basic direction\r\n }else\r\n {\r\n b = f1.new BasicNeutral(); //the new attack is basic neutral\r\n }\r\n }\r\n f1.setAttack(b); //sets this fighter's attack to b\r\n f1.setAttacking(1); //sets this fighter to \"is attacking\"\r\n }\r\n }", "private void startWork() {\n String destSensor = destination.get(\"sensorUri\");\n if (destSensor.contains(\"temp\")) {\n System.out.println(\"Turn on Heater\");\n workType.set(\"TEMP\");\n } else if (destSensor.contains(\"soil\")) {\n System.out.println(\"Watering\");\n workType.set(\"WATER\");\n } else if (destSensor.contains(\"light\")) {\n System.out.println(\"Turn on Shield\");\n workType.set(\"LIGHT\");\n }\n }", "public AirConditioner()\n\t{\n\t\tinit();\n\t}", "@Override\n public void onStationary() {\n showToast(\"设备停止移动\");\n LogUtil.e(\"stop_move\");\n }", "private void setAirCondTemp(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_setAirCondTemp\n\n String tempStr = this.acTempTextField.getText();\n System.out.println(tempStr);\n // make sure the user doesnt set an unreasonable temp\n if (Double.parseDouble(tempStr) < 40.0 || Double.parseDouble(tempStr) > 60.0 ){\n System.out.println(\"Error. Please set a temperature between 40.0 - 60.0\");\n\n }else{\n this.setTemp = Double.parseDouble(tempStr);\n this.turnOnAC(Double.parseDouble(tempStr));\n }\n }", "void steady_flight_at_given_speed (double step, double start_pitch) {\n // preamble: make sure inputs are in\n //computeFlowAndRegenPlotAndAdjust();\n\n //strut.aoa = 0.5; // ad hoc\n\n recomp_all_parts();\n\n double load = FoilBoard.this.load;\n\n // now moved into load box and bar \n //rider.weight = load - BOARD_WEIGHT - RIG_WEIGHT - FOIL_WEIGHT;\n\n steady_flight_at_given_speed___ok = false; // so far util done\n\n craft_pitch = start_pitch;\n // double prev_pitch = -20; // we nned it only because pitch value gets rounded somewhere in recomp_all_parts...\n while (craft_pitch < aoa_max && craft_pitch > aoa_min) {\n //computeFlowAndRegenPlotAndAdjust();\n recomp_all_parts();\n double lift = foil_lift();\n if (lift == load // exact hit, done !(almost never happens, though)\n // happens due to rounding\n // || prev_pitch == craft_pitch\n ) \n break;\n if (step > 0 && lift > load) { // done or pivot\n if (step < 0.0025) { \n // done! flight is OK\n steady_flight_at_given_speed___ok = true;\n break;\n }\n step = -step/2; // shrink step & pivot\n } else if (step < 0 && lift < load) { \n step = -step/2; // shrink step & pivot\n } // else keep going with current stepa\n // prev_pitch = craft_pitch;\n craft_pitch += step;\n }\n\n // expect small increse in drag as the result\n vpp.set_mast_aoa_for_given_drag(total_drag()); // (wing.drag+stab.drag);\n recomp_all_parts();\n\n // old linearly increasing logic \n //find_aoa_of_min_drag();\n //if (foil_lift() > load_numeric) {\n // // need to reduce AoA\n // while (craft_pitch > aoa_min) {\n // craft_pitch -= 0.1;\n // System.out.println(\"-- reducing... craft_pitch: \" + craft_pitch);\n // computeFlowAndRegenPlotAndAdjust();\n // recomp_all_parts();\n // if (foil_lift() <= load_numeric) \n // break; // done\n // } \n //}\n //else if (foil_lift() < load_numeric) {\n // // need to increase AoA\n // while (craft_pitch < aoa_max) {\n // craft_pitch += 0.1;\n // System.out.println(\"-- increasing... craft_pitch: \" + craft_pitch);\n // computeFlowAndRegenPlotAndAdjust();\n // recomp_all_parts();\n // if (foil_lift() >= load_numeric) \n // break; // done\n // } \n //}\n\n }", "public void updateDeviceAir(){\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.add(Calendar.DATE, -1);\n\t\tDate date = calendar.getTime();\n\t\tDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\tString time = df.format(date);\n\t\t\n\t\tHashMap<String, Integer> insideMap = deviceStatusDao.getAverageInside(time + \"%\");\n\t\tHashMap<String, Integer> outsideMap = deviceStatusDao.getAverageOutside(time + \"%\");\n\t\t//pair device air & city air\n\t\tfor(String device_id : insideMap.keySet()){\n\t\t\tDeviceAir deviceAir = new DeviceAir();\n\t\t\tdeviceAir.setDeviceID(device_id);\n\t\t\tdeviceAir.setInsideAir(insideMap.get(device_id));\n\t\t\tif(!outsideMap.containsKey(device_id)){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdeviceAir.setOutsideAir(outsideMap.get(device_id));\n\t\t\tdeviceAir.setDate(time);\n\t\t\tdeviceStatusDao.insertDeviceAir(deviceAir);\n\t\t}\n\t}", "public boolean isLegOut()\n{\n if (jumpState == 1)\n return true;\n return false;\n}", "@Override\n public void run() {\n for(int i=0;i<TheWeatherMan.WEATHER_CHECKS; i++) {\n\n // Have some delay\n try {\n Thread.sleep(1000* startTime);\n } catch (InterruptedException e) {\n System.out.println(\"『 Weather Report 』 Pacific has gone berserk and cant sleep.\\n\" +\n \"Terminating Program...\");\n System.exit(1);\n }\n\n /**\n * Handling Different City Temperatures -------------------------------------------\n */\n\n\n // Handling Singapore Temperatures\n if(cityName == \"Singapore\") {\n\n // Generates a random number between -.3 and .3\n double randNum = (Math.random() * (.6)) - .3;\n // Formats decimals to 2 places\n DecimalFormat df = new DecimalFormat(\"#.##\");\n\n cityTemperature = Double.valueOf(df.format((cityTemperature + randNum)));\n // Set Temp\n ((Satellite) satellite).setWeather1(cityTemperature);\n }\n\n // Handling Melbourne Temperatures\n if(cityName == \"Melbourne\") {\n Random random = new Random();\n double temp = (double) random.nextInt(45) + random.nextDouble();\n\n cityTemperature = temp;\n // Set Temp\n ((Satellite) satellite).setWeather2(cityTemperature);\n }\n\n // Handling Shanghai Temperatures\n if(cityName == \"Shanghai\") {\n\n // Fluctuate +-5\n Random random = new Random();\n double temp = ((double) random.nextInt(5) +\n random.nextDouble()) * (random.nextBoolean() ? 1 : -1);\n\n\n cityTemperature = cityTemperature + temp;\n // Set Temp\n ((Satellite) satellite).setWeather3(cityTemperature);\n }\n\n }\n }", "@Override\n public void periodic() {\n SmartDashboard.putBoolean(\"Climber Safety Mode: \", Robot.m_oi.getSafety());\n\n if (Robot.m_oi.getSafety()) {\n \t\tif (Robot.m_oi.getClimbUp()) {\n // if (printDebug) {\n // System.out.println(\"Climb: up speed = \" + speed);\n // }\n // talonMotor.setInverted(false); // do not reverse motor\n talonMotor.set(-speed); // activate motor\n\n \t\t} else if (Robot.m_oi.getClimbDown()) {\n // if (printDebug) {\n // System.out.println(\"IntakeArm: retract speed = \" + speed);\n // }\n // talonMotor.setInverted(true); // reverse motor\n talonMotor.set(speed);\n \n \t\t} else { // else no hand button pressed, so stop motor\n talonMotor.set(0);\n }\n\n if (climbState == 0 && Robot.m_oi.getClimbUp()) {\n climbState = 1;\n }\n\n if (climbState == 1 && Robot.m_oi.getClimbDown()) {\n climbState = 2;\n }\n\n if (climbState == 2 && talonMotor.getSensorCollection().isFwdLimitSwitchClosed()) {\n // Activiate the solenoid\n RobotMap.solenoid.extendSolenoid(true);\n }\n }\n }", "public void breakWall() {\r\n\tbustedWall = true;\r\n}", "public boolean isSoft();", "public void commonPeriodic()\n {\n double d1LeftJoystick = driver1.getAxis(driver1.LAxisUD);\n double d1RightJoystick = driver1.getAxis(driver1.RAxisUD);\n\n double d2LeftJoystick = driver2.getAxis(driver2.LAxisUD);\n double d2RightJoystick = driver2.getAxis(driver2.RAxisUD);\n\n // -------------------- DRIVER 1\n\n driveTrain.drive(d1LeftJoystick * speedModifier, d1RightJoystick * speedModifier);\n\n // driver1 controls ramp\n // press start and select together to deploy\n if(driver1.down(driver1.Start) && driver1.down(driver1.Select))\n {\n ramp.deploy();\n hatchArm.fingerGrab();\n }\n else\n {\n ramp.undeploy();\n }\n\n // driver 1 can double speed by holding L2\n //driveTrain.fastSpeed = driver1.down(driver1.L2);\n if(driver1.pressed(driver1.A))\n {\n driveTrain.slowSpeed = !driveTrain.slowSpeed;\n System.out.println(\"Fast speed toggled to: \" + driveTrain.slowSpeed);\n }\n\n //drive straight\n if(driver1.down(driver1.L1))\n {\n driveTrain.set_right_motors(speedModifier);\n }\n if(driver1.down(driver1.R1))\n {\n driveTrain.set_left_motors(speedModifier);\n }\n\n // flip drive orientation\n if(driver1.pressed(driver1.Select))\n {\n driveTrain.flip_orientation();\n \n if(driveTrain.isFacingForward())\n {\n camServForward.setSource(camFront);\n //camServReverse.setSource(camBack);\n // camBack.free();\n // camFront.close();\n // camFront = CameraServer.getInstance().startAutomaticCapture(0);\n // camBack = CameraServer.getInstance().startAutomaticCapture(1);\n }\n else\n {\n camServForward.setSource(camBack);\n //camServReverse.setSource(camFront);\n // camBack.close();\n // camFront.close();\n // camFront = CameraServer.getInstance().startAutomaticCapture(1);\n // camBack = CameraServer.getInstance().startAutomaticCapture(0);\n }\n }\n\n\n // -------------------- DRIVER 2\n\n\n // up is out\n // down is in\n // (when it's negated)\n cargoArm.spinBallMotor(-1 * d2LeftJoystick * 0.9);\n\n // control hatch placement pistons\n if(driver2.pressed(driver2.A))\n {\n hatchArm.pushPistons();\n }\n else if (driver2.released(driver2.A))\n {\n hatchArm.retractPistons();\n }\n\n // open/close hatch grabber arms\n if(driver2.pressed(driver2.B))\n {\n hatchArm.toggleGrabber();\n }\n\n if(driver2.pressed(driver2.Select))\n {\n //cargoArm.toggleArmLock();\n hatchArm.toggleFinger();\n }\n\n // extend/de-extend cargo hand\n if(driver2.pressed(driver2.Start))\n {\n cargoArm.toggleHand();\n }\n\n // button 7: L2\n // button 8: R2\n // L2 will reverse the finger\n // R2 will rotate it forward\n if(driver2.down(driver2.L1))\n {\n hatchArm.rotateFinger(1);\n }\n else\n {\n if(driver2.down(driver2.L2))\n {\n hatchArm.rotateFinger(-1);\n }\n else\n {\n hatchArm.rotateFinger(0);\n }\n }\n\n \n // button 5: L1\n // button 6: R1\n // L1 will move the hatch arm one way\n // R1 will move it the other way\n if(driver2.down(driver2.R1))\n {\n hatchArm.rotateArm(-1 * speedModifier);// * 0.75);\n }\n else\n {\n if(driver2.down(driver2.R2))\n {\n hatchArm.rotateArm(1 * speedModifier);// * 0.75);\n }\n else\n {\n hatchArm.rotateArm(0);\n }\n }\n\n \n // button 1: x\n // button 4: y\n // button 1 will move the ball arm one way\n // button 4 will move it the other way\n if(driver2.down(driver2.X))\n {\n //cargoArm.requestMove(-1 * speedModifier);\n cargoArm.rotateArm(-1);\n //cargoArm.solArmBrake.set(false);\n }\n else\n {\n if(driver2.down(driver2.Y))\n {\n //cargoArm.requestMove(2 * speedModifier);\n cargoArm.rotateArm(1);\n //cargoArm.solArmBrake.set(false);\n }\n else\n {\n //cargoArm.rotateArm(cargoArm.getArmCalculation());\n //cargoArm.solArmBrake.set(true);\n cargoArm.rotateArm(0);\n }\n }\n if(driver2.released(driver2.X) || driver2.released(driver2.Y))\n {\n //cargoArm.setArmTarget(cargoArm.currentPosition());\n //cargoArm.solArmBrake.set(true);\n cargoArm.rotateArm(0);\n }\n\n if(driver2.dpad(driver2.Up))\n {\n cargoArm.setArmUp();\n }\n if(driver2.dpad(driver2.Down))\n {\n cargoArm.setArmDown();\n }\n if(driver2.dpad(driver2.Left))\n {\n cargoArm.setArmMid();\n }\n if(driver2.dpad(driver2.Right))\n {\n cargoArm.setArmLow();\n }\n\n if(driver2.pressed(driver2.LThumb))\n {\n cargoArm.armLockEnabled = !cargoArm.armLockEnabled;\n \n }\n if(driver2.pressed(driver2.RThumb))\n {\n cargoArm.toggleBrake();\n }\n\n\n // allow move-to calculations to occur\n hatchArm.periodic();\n cargoArm.periodic();\n }", "public void teleportToAstronaut() {\n\t\tAstronaut a;\n\t\tSpaceship sp;\n\t\tif(roamingAstronauts > 0) {\n\t\t\tsp = getTheSpaceship();\n\t\t\ta = getRandomAstronaut();\n\t\t\tsp.setLocation(a.getLocation());\n\t\t\tSystem.out.println(\"You've teleported to an astronaut. \\n Hope you didn't hit them.\");\n\t\t}\n\t\telse \n\t\t\tSystem.out.println(\"Error: Ther were no astronauts to jump to.\");\n\t}", "public void chechPortaitAndLandSacpe() {\n if (CompatibilityUtility.isTablet(BecomeHostActivity.this)) {\n setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);\n } else {\n setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);\n }\n }", "public void WingAttack(Pokemon opponent, boolean isComputer)\r\n {\r\n window.addToTextBox(\"Scyther used Wing Attack!\");\r\n damage = 60;\r\n accuracy = 100;\r\n abilityType = \"Flying\";\r\n useAbility(opponent, damage, accuracy, abilityType, isComputer);\r\n }" ]
[ "0.60934746", "0.60600114", "0.6020324", "0.6005918", "0.5954852", "0.59411675", "0.59072024", "0.5754633", "0.5711718", "0.5625349", "0.56245804", "0.5588555", "0.5585657", "0.5576646", "0.5540423", "0.5522859", "0.55133754", "0.5505964", "0.55021465", "0.5496287", "0.5486911", "0.54836273", "0.54687625", "0.5464254", "0.54611325", "0.54506814", "0.5444107", "0.5439453", "0.54297155", "0.54247105", "0.5406906", "0.5396503", "0.53876495", "0.5387635", "0.538471", "0.5374571", "0.5357199", "0.53523093", "0.5350575", "0.5343565", "0.533206", "0.5301747", "0.5297747", "0.5292887", "0.52859354", "0.5268444", "0.52602965", "0.52587014", "0.52508205", "0.52314156", "0.5230223", "0.5201447", "0.51998216", "0.51957864", "0.5193163", "0.5191225", "0.5186626", "0.51834404", "0.51792485", "0.51545805", "0.51462305", "0.51444846", "0.51406986", "0.5139657", "0.51315564", "0.5122754", "0.5097813", "0.50970405", "0.5095252", "0.5091868", "0.50909144", "0.5089526", "0.5085947", "0.50845075", "0.50794864", "0.5065949", "0.5065504", "0.5065489", "0.5065303", "0.50649893", "0.5063963", "0.5062238", "0.50618005", "0.50609773", "0.5057452", "0.50572103", "0.5054956", "0.5049527", "0.5049516", "0.5048668", "0.5047103", "0.5040335", "0.5039966", "0.5035705", "0.50337", "0.5032947", "0.5032875", "0.5026977", "0.5024239", "0.5023168" ]
0.62945664
0
unlike interfaces, abstract classes have concrete and at least one abstract methods
public void engine() { System.out.println("Follow engine guidelines"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tvoid methodAbstractAndSubclassIsAbstract() {\n\t\t\n\t}", "public boolean isAbstract()\n/* */ {\n/* 146 */ return false;\n/* */ }", "public boolean isAbstract();", "public abstract void abstractMethodToImplement();", "public interface AbstractC2883ha {\n boolean a();\n}", "abstract void method();", "public interface AbstractC14990nD {\n void ACi(View view);\n\n void ACk(View view);\n\n void ACo(View view);\n}", "public interface AbstractC1953c50 {\n}", "public void noabstractone() {\n\t\tSystem.out.println(\"No Abstract\");\n\t}", "public interface AbstractC0273Ek {\n void e();\n}", "public interface AbstractC7729o0ooOoo {\n void OooO00o();\n}", "@Override\n public boolean getAllowAbstractClasses()\n {\n \treturn allowAbstractClasses;\n }", "public interface AbstractC0211Dj0 {\n void a(int i);\n}", "public interface Citizen {\n public abstract void sayHello();\n}", "public interface AbstractC03680oI {\n}", "public abstract void abstractone();", "public interface AbstractC00591m {\n void A9X(C0495Jm jm);\n\n void AAI(List<RG> list);\n}", "public interface AbstractC01264e {\n void ABn(AnonymousClass4X v, @Nullable AnonymousClass4A v2, AnonymousClass4A v3);\n\n void ABp(AnonymousClass4X v, @NonNull AnonymousClass4A v2, @Nullable AnonymousClass4A v3);\n\n void ABr(AnonymousClass4X v, @NonNull AnonymousClass4A v2, @NonNull AnonymousClass4A v3);\n\n void ADd(AnonymousClass4X v);\n}", "abstract interface I1 {\n public abstract void m1();\n}", "@CheckReturnValue\n Boolean isAbstract();", "public boolean isConcrete()\n/* */ {\n/* 154 */ return true;\n/* */ }", "public interface AbstractC7617o0oOO {\n void OooO00o(View view);\n\n void OooO0O0(View view);\n\n void OooO0OO(View view);\n}", "public interface Behaviour {\n/**abstract method of the Behaviour interface*/\n\tvoid sad();\n}", "public void setAbstract() {\r\n\t\tthis.isAbstract = true;\r\n\t}", "@Override\n\tvoid methodabstract() {\n\t\t\n\t}", "@Override\n public void matiz() {\n System.out.println(\"New not Abstract method\");\n }", "public interface AbstractC3386kV0 {\n boolean b();\n\n void d();\n\n void dismiss();\n\n ListView f();\n}", "@Override\r\n\tpublic boolean isAbstract() throws NotesApiException {\n\t\treturn false;\r\n\t}", "public void setupAbstract() {\n \r\n }", "public interface FlyBehavior {\n public abstract void fly();\n// public abstract void\n}", "public interface Animal {\n\n public void eat();\n public void travel();\n}", "boolean test(AbstractAnimals a);", "Type.Remote<SomeRemoteType, SomeRemoteThing> isAbstract(Boolean isAbstract);", "private void testAbstraction() {\n Shape triangle = new Triangle();\n\n Shape circle = new Circle();\n\n //Since square implements IShape but not Shape, so we cannot create instance of Shape using Square\n Square square = new Square();\n\n //The end user only calls getNoOfSides(). But does not see implementation in Shape class.\n //Here it picks implementation from Triangle class, so it will return a 3.\n System.out.println(\"No of sides in a triangle: \" + triangle.getNoOfSides());\n System.out.println(\"No of sides in a circle: \" + circle.getNoOfSides());\n System.out.println(\"No of sides in a square: \" + square.getNoOfSides());\n }", "public interface AbstractC0386gl {\n}", "private abstract void privateabstract();", "public interface AbstractC2502fH1 extends IInterface {\n}", "abstract void m1();", "@Override\n\tpublic void method2() {\n\t\tSystem.out.println(\"AbstractClass 추상메쏘드 method2()를 재정의(implement)\");\n\t}", "@Override\r\n\tprotected void abstractMethod() {\n\t\tSystem.out.println(\"I'm from the abstract method\");\r\n\t}", "public interface AbstractC0647Pn {\n void A9C(AbstractC0645Pl pl);\n\n void A9Y(Exception exc);\n}", "interface PureAbstract {\n void method1();\n long method2(long a, long b);\n}", "public boolean isAbstract()\n {\n ensureLoaded();\n return m_flags.isAbstract();\n }", "public interface AbstractC1509Ys0 extends Q31 {\n Object g(Callback callback);\n}", "public void testCreateMethodWithAbstractModifier() {\n IDOMMethod method = this.domFactory.createMethod();\n method.setName(\"foo\");\n method.setFlags(ClassFileConstants.AccPublic | ClassFileConstants.AccAbstract);\n assertSourceEquals(\"source code incorrect\", \"public abstract void foo() {\\n\" + \"}\\n\", method.getContents());\n }", "public interface MyAbstractElement extends EObject {\n}", "public abstract boolean a();", "public interface AbstractC61422t9 {\n void AJZ(C61072sS v);\n}", "public abstract void method1();", "public interface AbstractC1008ba extends JQ {\n void AA9();\n}", "public abstract void mo102899a();", "public interface ad\n{\n\n public abstract void a(cs cs);\n\n public abstract void a(ds ds);\n}", "public abstract T a();", "public interface Pet {// interface is the blueprint for other class\r\n\r\n\tpublic String food();// method food abstract method no action \r\n\r\n\r\n}", "public interface ITeslaProduct extends IProduct {\n //@Override\n public abstract void makeProduct();\n}", "public boolean isAbstract() {\n return (getAccessFlags() & Constants.ACCESS_ABSTRACT) > 0;\n }", "public interface AbstractC1815a {\n void onFail();\n\n void onSuccess();\n }", "public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public interface AbstractC2930hp1 {\n void a(String str, boolean z);\n\n void b(String str, long j);\n\n void c(String str, int i, int i2, int i3, int i4);\n\n void d(String str, int i);\n\n void e(String str, int i, int i2, int i3, int i4);\n}", "public abstract String a();", "public interface zzo\n extends IInterface\n{\n\n public abstract void zze(AdRequestParcel adrequestparcel);\n}", "abstract void sayHello();", "public boolean isAbstractOrInterface() {\n\t\treturn ((access & Opcodes.ACC_ABSTRACT) | (access & Opcodes.ACC_INTERFACE)) != 0;\n\t}", "abstract int pregnancy();", "@Override\n public boolean isInterface() { return false; }", "public abstract void mo30696a();", "public boolean isAbstract() {\n return abstractMethod;\n }", "public abstract boolean foo();", "public abstract int a();", "public interface TellStory {\n public abstract void tellStory();\n}", "public abstract void test();", "public abstract void test();", "interface Workshop{\n\tabstract public void work();\n}", "public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }", "public abstract void mo70713b();", "public static interface _cls9\n{\n\n public abstract void onEbayError(List list);\n\n public abstract void onRemindersError();\n\n public abstract void updateMsgRemindersCounts(UserActivitySummary useractivitysummary);\n}", "public abstract void mh();", "public interface l\n{\n\n public abstract String a();\n\n public abstract String b();\n\n public abstract String c();\n\n public abstract String d();\n\n public abstract int e();\n\n public abstract String f();\n\n public abstract int g();\n\n public abstract int h();\n\n public abstract String i();\n\n public abstract String j();\n\n public abstract String k();\n\n public abstract et l();\n\n public abstract eq m();\n}", "public abstract void afvuren();", "@FunctionalInterface\r\ninterface SingleMethod { // functional interface cant have more than one abstract method\r\n\tvoid method();\r\n\t\r\n}", "public void setIsAbstract(boolean b);", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface Structure {\n\n // Interface: \n // Methods are \"public abstract\"\n // Variables are \"public static final\"\n // e.e, public static final int x = 123;\n\n public abstract double totalWeight();\n boolean isBalanced();\n\n}", "public abstract void mo4359a();", "abstract void classRooms();", "public abstract void comes();", "abstract public T doSomething();", "public interface AbstractC10485b {\n /* renamed from: a */\n void mo64153a(boolean z);\n }", "@Override\n\tpublic void doStuff() {\n\t\tSystem.out.println(\"Do stuff in Abstract Car\");\n\t}", "public interface Animal {\n\n void print();\n}", "public boolean isInterface();", "public interface Implementor {\n // 实现抽象部分需要的某些具体功能\n void operationImpl();\n}", "interface InterfaceDemo {\n int age =0; //接口中变量都是公开静态常量\n String name =null;\n abstract void aa();\n\n public abstract void display(); //接口中方法都是抽象的\n}", "public Abstraction abstractToPattern(Set<Integer> pattern)\n\t{\n\t\tassert (initialState != null);\n\n\t\t// Abstract goal condition.\n\t\tCondition abstractGoal = explicitGoal.abstractToPattern(pattern);\n\n\t\t// Abstract operators.\n\t\tSet<Operator> abstractedOperators = new LinkedHashSet<Operator>(\n\t\t\t\tgetOperators().size());\n\t\tfor (Operator op : getOperators())\n\t\t{\n\t\t\tOperator absOp = op.abstractToPattern(pattern);\n\t\t\tif (absOp != null)\n\t\t\t{\n\t\t\t\tassert absOp.isAbstracted;\n\t\t\t\tabstractedOperators.add(absOp);\n\t\t\t}\n\t\t}\n\t\tassert Operator.assertNoDuplicateInNames(abstractedOperators);\n\t\tif (DEBUG)\n\t\t{\n\t\t\tSystem.out.println(\"Abstracted ops:\");\n\t\t\tfor (Operator op : abstractedOperators)\n\t\t\t{\n\t\t\t\t((ExplicitOperator) op).dump();\n\t\t\t}\n\t\t}\n\n\t\t// An axiom is either completely conserved or completely removed in an\n\t\t// abstraction.\n\t\tSet<OperatorRule> abstractedAxioms = new LinkedHashSet<ExplicitOperator.OperatorRule>(\n\t\t\t\taxioms.size());\n\t\tfor (OperatorRule axiom : axioms)\n\t\t{\n\t\t\tif (pattern.contains(axiom.head.first))\n\t\t\t{\n\t\t\t\tfor (Pair<Integer, Integer> fact : axiom.body)\n\t\t\t\t{\n\t\t\t\t\tassert pattern.contains(fact.first);\n\t\t\t\t}\n\t\t\t\tabstractedAxioms.add(axiom);\n\t\t\t}\n\t\t}\n\n\t\t// Abstract and set initial state.\n\t\tSortedSet<Integer> sortedPattern = new TreeSet<Integer>(pattern);\n\t\tAbstraction abstraction = new Abstraction(sortedPattern, abstractGoal,\n\t\t\t\tabstractedOperators, abstractedAxioms);\n\t\tabstraction.setInitialState(Arrays.asList(initialState\n\t\t\t\t.abstractToPattern(abstraction)));\n\t\treturn abstraction;\n\t}", "public abstract void mo957b();", "public abstract void mo27464a();", "public interface AbstractC2726a {\n /* renamed from: a */\n void mo36480a(int i, int i2, ImageView imageView, Uri uri);\n\n /* renamed from: a */\n void mo36481a(int i, ImageView imageView, Uri uri);\n\n /* renamed from: a */\n void mo36482a(ImageView imageView, Uri uri);\n\n /* renamed from: b */\n void mo36483b(int i, ImageView imageView, Uri uri);\n}", "public abstract Object mo1771a();", "public void calling(){ // when the abstract method is implemented in other class 'public' keyword is used..\r\n System.out.println(\"I am calling...\");\r\n }", "interface cm\n{\n\n public abstract void f(com.google.android.gms.internal.d.a a);\n\n public abstract cj lS();\n\n public abstract cj lT();\n\n public abstract ck lU();\n\n public abstract ck lV();\n\n public abstract ck lW();\n\n public abstract ck lX();\n}" ]
[ "0.75825924", "0.749714", "0.74469423", "0.7307807", "0.719057", "0.70996076", "0.6987594", "0.6972758", "0.6967071", "0.6950546", "0.6943486", "0.6863291", "0.685282", "0.6848893", "0.68410933", "0.6824801", "0.6770064", "0.6746766", "0.6739988", "0.67218447", "0.6709935", "0.66814274", "0.6642645", "0.66375905", "0.6603909", "0.65967", "0.6586421", "0.6567538", "0.6557569", "0.6529547", "0.6467837", "0.64334285", "0.6431124", "0.6407298", "0.64060116", "0.63890046", "0.6383863", "0.6377707", "0.63725674", "0.63616216", "0.6346536", "0.6338077", "0.63313484", "0.6327564", "0.63256484", "0.63210106", "0.6315622", "0.63153374", "0.6288061", "0.62737525", "0.62722236", "0.6271073", "0.6270792", "0.62580055", "0.6257065", "0.6253213", "0.6251877", "0.62481", "0.62318146", "0.6228723", "0.62251633", "0.62217927", "0.6220484", "0.6218946", "0.62128234", "0.6210598", "0.6197852", "0.618901", "0.61782503", "0.61705303", "0.61693907", "0.61619824", "0.61619824", "0.61595744", "0.6158697", "0.61569893", "0.61565584", "0.61472785", "0.61469996", "0.6134062", "0.6120719", "0.61186975", "0.6103411", "0.6101229", "0.6099856", "0.60945", "0.60847414", "0.60795265", "0.60689664", "0.6067834", "0.6060863", "0.60489416", "0.60303724", "0.60283786", "0.6024677", "0.6014234", "0.60025203", "0.6001768", "0.59963155", "0.5994446", "0.5993624" ]
0.0
-1
api para consulta de estados pelo ibge
@RequestLine("GET /api/v1/localidades/estados") List<EstadoJson> get();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<DietaBalanceada> consultar_dietaBalanceada();", "List<InsureUnitTrend> queryInsureDate();", "private void querys() {\n\t try {\r\n\t\tBoxYieldRptFactory.getRemoteInstance().SteDate();\r\n\t } catch (EASBizException e) {\r\n\t\t// TODO Auto-generated catch block\r\n\t\te.printStackTrace();\r\n\t } catch (BOSException e) {\r\n\t\t// TODO Auto-generated catch block\r\n\t\te.printStackTrace();\r\n\t }\r\n\t}", "public List<TblRetur>getAllDataRetur();", "String getDataStatus();", "public static List getStatusList() \n {\n session=SessionFact.getSessionFact().openSession();\n List li=session.createQuery(\"select status from Alumni_data group by status\").list();\n session.close();\n return li;\n }", "public ReturnData queryEncounterForinfo(){\n ReturnData returnData = new ReturnData();\n String [] jsids = {\"03034a63-e8d6-49a4-8e71-58a544b8fca3\",\n \"1ae3709f-d8c2-4db8-9f38-1a60fb0d2e61\",\n \"7340479a-28fc-44b6-bf18-374f037d5f03\",\n \"e1e5f378-b16f-441e-b673-0f0d2544d108\"};\n try {\n returnData.setData(jueseMapper.selectByPrimaryKey(jsids[MyUuid.getRandomInt(jsids.length)-1]));\n }catch (Exception e){\n returnData.setCode(-1);\n returnData.setData(e.getMessage());\n }finally {\n return returnData;\n }\n }", "@Override\r\n\tpublic List<EstadoDTO> listaEstados() throws Exception {\n\t\treturn objDAO.listaEstados();\r\n\t}", "@Override\n\tpublic void statCalculator() throws StateNotValid, DateNotValid, RangeNotValid, GenreNotValid, KeywordNotValid {\n\t\tJSONArray database = new JSONArray();\n\t\tdatabase = Database.getDatabaseFromFile();\n\t\tJSONObject state=(JSONObject) filter.get(\"state\");\n\t\t\n\t\tVector<String> in=(Vector<String>) state.get(\"in\");\n\t\tif(in.equals(null))\n\t\t\tthrow new StateNotValid();\n\t\telse {\n\t\t\tfor(String s:in) {\n\t\t\t\tJSONObject tempFilter1 = new JSONObject();\n\t\t\t\tJSONObject body1 = new JSONObject();\n\t\t\t\tbody1.put(\"$in\", s);\n\t\t\t\ttempFilter1.put(\"state\", body1);\n\t\t\t\tJSONArray temp = new JSONArray();\n\t\t\t\tfor(int i=0; i<12; i++) {\n\t\t\t\t\tJSONObject tempFilter = new JSONObject();\n\t\t\t\t\tJSONObject body = new JSONObject();\n\t\t\t\t\tString mese = new String();\n\t\t\t\t\tString dataini = new String();\n\t\t\t\t\tString datafin = new String();\n\t\t\t\t\tswitch(i) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\tmese = \"Gennaio\";\n\t\t\t\t\t\tdataini = \"2021:01:01\";\n\t\t\t\t\t\tdatafin = \"2021:01:31\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tmese = \"Febbraio\";\n\t\t\t\t\t\tdataini = \"2021:02:01\";\n\t\t\t\t\t\tdatafin = \"2021:02:28\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tmese = \"Marzo\";\n\t\t\t\t\t\tdataini = \"2021:03:01\";\n\t\t\t\t\t\tdatafin = \"2021:03:31\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tmese = \"Aprile\";\n\t\t\t\t\t\tdataini = \"2021:04:01\";\n\t\t\t\t\t\tdatafin = \"2021:04:30\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\tmese = \"Maggio\";\n\t\t\t\t\t\tdataini = \"2021:05:01\";\n\t\t\t\t\t\tdatafin = \"2021:05:31\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 5:\n\t\t\t\t\t\tmese = \"Giugno\";\n\t\t\t\t\t\tdataini = \"2021:06:01\";\n\t\t\t\t\t\tdatafin = \"2021:06:30\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 6:\n\t\t\t\t\t\tmese = \"Luglio\";\n\t\t\t\t\t\tdataini = \"2021:07:01\";\n\t\t\t\t\t\tdatafin = \"2021:07:31\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 7:\n\t\t\t\t\t\tmese = \"Agosto\";\n\t\t\t\t\t\tdataini = \"2021:08:01\";\n\t\t\t\t\t\tdatafin = \"2021:08:31\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 8:\n\t\t\t\t\t\tmese = \"Settembre\";\n\t\t\t\t\t\tdataini = \"2021:09:01\";\n\t\t\t\t\t\tdatafin = \"2021:09:30\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 9:\n\t\t\t\t\t\tmese = \"Ottobre\";\n\t\t\t\t\t\tdataini = \"2021:10:01\";\n\t\t\t\t\t\tdatafin = \"2021:10:31\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 10:\n\t\t\t\t\t\tmese = \"Novembre\";\n\t\t\t\t\t\tdataini = \"2021:11:01\";\n\t\t\t\t\t\tdatafin = \"2021:11:30\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 11:\n\t\t\t\t\t\tmese = \"Dicembre\";\n\t\t\t\t\t\tdataini = \"2021:12:01\";\n\t\t\t\t\t\tdatafin = \"2021:12:31\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tVector<String> dates = new Vector<String>();\n\t\t\t\t\tdates.add(dataini);\n\t\t\t\t\tdates.add(datafin);\n\t\t\t\t\tbody.put(\"$bt\", dates);\n\t\t\t\t\ttempFilter.put(\"date\", body);\n\t\t\t\t\t\n\t\t\t\t\tStateFilter filter1 = new StateFilter();\n\t\t\t\t\tdatabase = filter1.filter(database, tempFilter1);\n\t\t\t\t\tGenreFilter filter2 = new GenreFilter();\n\t\t\t\t\tdatabase = filter2.filter(database, filter);\n\t\t\t\t\tDateFilter filter3 = new DateFilter();\n\t\t\t\t\tdatabase = filter3.filter(database, tempFilter);\n\t\t\t\t\tKeywordFilter filter4 = new KeywordFilter();\n\t\t\t\t\tdatabase = filter4.filter(database, filter);\n\t\t\t\t\t\n\t\t\t\t\tJSONObject month = new JSONObject();\n\t\t\t\t\tmonth.put(\"name\", mese);\n\t\t\t\t\tmonth.put(\"value\", database.size());\n\t\t\t\t\ttemp.add(month);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tJSONObject render = new JSONObject();\n\t\t\t\trender.put(\"name\", s);\n\t\t\t\trender.put(\"min\", this.getMin(temp));\n\t\t\t\trender.put(\"max\", this.getMax(temp));\n\t\t\t\trender.put(\"avg\", this.getMedia(temp));\n\t\t\t\toutput.add(render);\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public List<HrCStatitem> findAll();", "private void getVisitas(){\n mVisitasTerreno = estudioAdapter.getListaVisitaTerrenosSinEnviar();\n //ca.close();\n }", "Jugador consultarGanador();", "@GetMapping(\"/stagiaires\")\n @Timed\n public List<StagiaireDTO> getAllStagiaires() {\n log.debug(\"REST request to get all Stagiaires\");\n return stagiaireService.findAll();\n }", "private void getDataSalaf(){\n UserAPIService api = Config.getRetrofit().create(UserAPIService.class);\n Call<Value> call = api.lihat_jenis(\"Salaf\");\n call.enqueue(new Callback<Value>() {\n @Override\n public void onResponse(Call<Value> call, Response<Value> response) {\n// pDialog.dismiss();\n String value1 = response.body().getStatus();\n if (value1.equals(\"1\")){\n Value value = response.body();\n resultAlls = new ArrayList<>(Arrays.asList(value.getResult()));\n adapter = new RecyclerAdapterListAll(resultAlls,getApplicationContext());\n recyclerView.setAdapter(adapter);\n }else {\n Toast.makeText(ListPonpesActivity.this,\"Maaf Data Tidak Ada\",Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onFailure(Call<Value> call, Throwable t) {\n // pDialog.dismiss();\n Toast.makeText(ListPonpesActivity.this,\"Respon gagal\",Toast.LENGTH_SHORT).show();\n Log.d(\"Hasil internet\",t.toString());\n }\n });\n }", "public List<ContentInterventoBOBean> execGetAll() {\n System.out.println(\"InterventoLogics - execGetAll\");\n InterventoClient client = new InterventoClient(new ContentInterventoRequestBean());\n try {\n client.getAll();\n return BOFactory.convertWorkableToBOInterventi(client.getResList());\n }catch(Exception e){\n e.printStackTrace();\n }\n return null;\n }", "public interface InsureUnitTrendService {\n\n /**\n * Query insure date list.\n *\n * @return the list\n */\n List<InsureUnitTrend> queryInsureDate();\n\n /**\n * Query unit list.\n *\n * @return the list\n */\n List<InsureUnitTrend> queryUnit();\n\n /**\n * Query cancel list.\n *\n * @return the list\n */\n List<InsureUnitTrend> queryCancel();\n\n\n}", "String getEstado();", "public List<StatusDemande> getStatusDemandes(){\n return statusDemandeRepository.findAll();\n }", "@Test\n public void testTransplantListEndpointQueryAge() {\n String lowerBound = \"1970-01-01\";\n String upperBound = \"2018-09-27\";\n ResponseEntity response = dataController.getTransplantWaitingListRange(null,null,\"12\",null,upperBound, lowerBound);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }", "public IStatus getResult();", "@GET\n\t@Produces({ MediaType.APPLICATION_JSON })\n\tpublic Response getOperadores() {\n\t\t\n\t\ttry {\n\t\t\tAlohAndesTransactionManager tm = new AlohAndesTransactionManager(getPath());\n\t\t\t\n\t\t\tList<Operador> operadores;\n\t\t\t//Por simplicidad, solamente se obtienen los primeros 50 resultados de la consulta\n\t\t\toperadores = tm.getAllOperadores();\n\t\t\treturn Response.status(200).entity(operadores).build();\n\t\t} \n\t\tcatch (Exception e) {\n\t\t\treturn Response.status(500).entity(doErrorMessage(e)).build();\n\t\t}\n\t}", "Reserva Obtener();", "public int getDossierStatus();", "List<Venta1> consultarVentaPorFecha(Date desde, Date hasta, Persona cliente) throws Exception;", "public List<Madeira> buscaCidadesEstado(String estado);", "public static Estudiante buscarEstudiante(String Nro_de_ID) {\r\n //meter este método a la base de datos\r\n Estudiante est = new Estudiante();\r\n try {\r\n Class.forName(\"com.mysql.jdbc.Driver\");\r\n Connection conexion = DriverManager.getConnection(\"jdbc:mysql://localhost/registrolaboratorios\", \"root\", \"admin\");\r\n System.out.print(\"Conexion establecida!\");\r\n Statement sentencia = conexion.createStatement();\r\n ResultSet necesario = sentencia.executeQuery(\"select * from estudiante where Nro_de_ID ='\" + Nro_de_ID + \"'\");\r\n\r\n while (necesario.next()) {\r\n\r\n String ced = necesario.getString(\"Nro_de_ID\");\r\n String nomb = necesario.getString(\"Nombres\");\r\n String ape = necesario.getString(\"Apellidos\");\r\n String lab = necesario.getString(\"Laboratorio\");\r\n String carr = necesario.getString(\"Carrera\");\r\n String mod = necesario.getString(\"Modulo\");\r\n String mta = necesario.getString(\"Materia\");\r\n String fecha = necesario.getString(\"Fecha\");\r\n String HI = necesario.getString(\"Hora_Ingreso\");\r\n String HS = necesario.getString(\"Hora_Salida\");\r\n\r\n est.setNro_de_ID(ced);\r\n est.setNombres(nomb);\r\n est.setApellidos(ape);\r\n est.setLaboratorio(lab);\r\n est.setCarrera(carr);\r\n est.setModulo(mod);\r\n est.setMateria(mta);\r\n est.setFecha(fecha);\r\n est.setHora_Ingreso(HI);\r\n est.setHora_Salida(HS);\r\n\r\n }\r\n sentencia.close();\r\n conexion.close();\r\n\r\n } catch (Exception ex) {\r\n System.out.print(\"Error en la conexion\" + ex);\r\n }\r\n return est;\r\n }", "@TaDaMethod(variablesToTrack = {\"name\", \"race\", \"ssn2\", \"ssn3\",\n\t\t\t\"investmentIncome\", \"investmentIncome\", \"investmentIncome\",\n\t\t\t\"education\", \"ssn4\", \"occupationCode\",\n\t\t\t\"industryCode\", \"weeklyWage\", \"workWeeks\"}, \n\t\t\tcorrespondingDatabaseAttribute = {\"userrecord.name\", \"userrecord.race\", \"education.ssn\", \"investment.ssn\",\n\t\t\t\"investment.CAPITALGAINS\", \"investment.CAPITALLOSSES\", \"investment.STOCKDIVIDENDS\",\n\t\t\t\"education.education\", \"job.ssn\", \"job.INDUSTRYCODE\", \n\t\t\t\"job.OCCUPATIONCODE\", \"job.WEEKWAGE\", \"job.workweeks\"})\n\tpublic EstimateIncomeDTOInterface getValues(int ssn){\n\t\t\n\t\tResultSet results;\n\t\tStatement statement;\n\t\t\n\t\tString ssnString = Integer.toString(ssn);\n\t\t\n\t\tString name = null;\n\t\tString race = null;\n\t\tString education = null;\n\t\tint occupationCode = 0;\n\t\tint industryCode = 0;\n\t\tint weeklyWage = 0;\n\t\tint workWeeks = 0;\n\t\tint investmentIncome = 0;\n\t\t\n\t\ttry{\n\t\t\tstatement = Factory.getConnection().createStatement();\n\t \tresults = statement.executeQuery(\"SELECT SSN, NAME, RACE from userrecord WHERE SSN = \" + ssnString +\"\");\n\t \twhile(results.next()){\n\t \t\tif(results.getInt(\"SSN\") == 0){\n\t \t\t\tcontinue;\n\t \t\t} else {\n\t \t\t\tname = results.getString(\"NAME\");\n\t \t\t\trace = results.getString(\"RACE\");\n\t \t\t}\n\t \t}\n\t \t\n\t \tresults = statement.executeQuery(\"SELECT SSN, EDUCATION from education WHERE SSN = \" + ssnString +\"\");\n\t \twhile(results.next()){\n\t \t\tint ssn2 = results.getInt(\"SSN\");\n\t \t\tif(ssn2 == 0){\n\t \t\t\tcontinue;\n\t \t\t} else {\n\t \t\t\teducation = results.getString(\"EDUCATION\");\n\t \t\t}\n\t \t}\n\t \t\n\t \tresults = statement.executeQuery(\"SELECT SSN, CAPITALGAINS, CAPITALLOSSES, STOCKDIVIDENDS from investment WHERE SSN = \" + ssnString +\"\");\n\t \twhile(results.next()){\n\t \t\tint ssn3 = results.getInt(\"SSN\");\n\t \t\tif(ssn3 == 0){\n\t \t\t\tcontinue;\n\t \t\t} else {\n\t \t\t\tinvestmentIncome = results.getInt(\"CAPITALGAINS\") - results.getInt(\"CAPITALLOSSES\") + results.getInt(\"STOCKDIVIDENDS\");\n\t \t\t}\n\t \t}\n\t \t\n\t \tresults = statement.executeQuery(\"SELECT SSN, INDUSTRYCODE, OCCUPATIONCODE, WEEKWAGE, WORKWEEKS from job WHERE SSN = \" + ssnString +\"\");\n\t \twhile(results.next()){\n\t \t\tint ssn4 = results.getInt(\"SSN\");\n\t \t\tif(ssn4 == 0){\n\t \t\t\tcontinue;\n\t \t\t} else {\n\t \t\toccupationCode = results.getInt(\"INDUSTRYCODE\");\n\t \t\tindustryCode = results.getInt(\"OCCUPATIONCODE\");\n\t \t\tweeklyWage = results.getInt(\"WEEKWAGE\");\n\t \t\tworkWeeks = results.getInt(\"WORKWEEKS\");\n\t \t\t}\n\t \t}\n\n\t\t} catch(SQLException e) {\n\t\t\twhile (e != null) {\n\t\t\t\tSystem.err.println(\"\\n----- SQLException -----\");\n\t\t\t\tSystem.err.println(\" SQL State: \" + e.getSQLState());\n\t\t\t\tSystem.err.println(\" Error Code: \" + e.getErrorCode());\n\t\t\t\tSystem.err.println(\" Message: \" + e.getMessage());\n\t\t\t\t// for stack traces, refer to derby.log or uncomment this:\n\t\t\t\t// e.printStackTrace(System.err);\n\t\t\t\te = e.getNextException();\n\t\t\t}\n\t\t}\n\t\t\t\n \treturn Factory.getEstimateIncomeDTO(name, ssn, race, education,\n \t\t\toccupationCode, industryCode, weeklyWage, workWeeks, investmentIncome);\n \t\n\t}", "@Test\n public void testTransplantListEndpointQueryRegion() {\n String lowerBound = \"1970-01-01\";\n String upperBound = \"2018-09-27\";\n ResponseEntity response = dataController.getTransplantWaitingListRange(null,null,null,\"Auckland\",upperBound, lowerBound);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }", "private void getObsequios(){\n mObsequios = estudioAdapter.getListaObsequiosSinEnviar();\n //ca.close();\n }", "public void obtenerHistoricoEstatusCliente(Cliente cliente)\n throws MareException {\n UtilidadesLog.info(\" DAOSolicitudes.obtenerHistoricoEstatusCliente(\"\n +\"Cliente cliente):Entrada\");\n BelcorpService bs;\n RecordSet respuesta;\n String codigoError;\n StringBuffer query = new StringBuffer();\n\n try {\n bs = BelcorpService.getInstance();\n } catch (MareMiiServiceNotFoundException e) {\n UtilidadesLog.error(\"ERROR \", e);\n codigoError = CodigosError.ERROR_AL_PEDIR_UN_SERVICIO_MARE;\n throw new MareException(e, UtilidadesError.armarCodigoError(\n codigoError));\n }\n\n try {\n query.append(\" SELECT ESTA_OID_ESTA_CLIE, OID_HIST_ESTA, \");\n query.append(\" PERD_OID_PERI, \");\n query.append(\" PERD_OID_PERI_PERI_FIN, \");\n query.append(\" PED.FEC_INIC as PED_FEC_INIC, \");\n query.append(\" PED.FEC_FINA as PED_FEC_FINA, \");\n query.append(\" PED.MARC_OID_MARC as PED_MARC_OID_MARC, \");\n query.append(\" PED.CANA_OID_CANA as PED_CANA_OID_CANA, \");\n query.append(\" PED.PAIS_OID_PAIS as PED_PAIS_OID_PAIS, \");\n query.append(\" PCD.COD_PERI as PCD_COD_PERI, \");\n query.append(\" PEH.FEC_INIC as PEH_FEC_INIC, \");\n query.append(\" PEH.FEC_FINA as PEH_FEC_FINA, \");\n query.append(\" PEH.MARC_OID_MARC as PEH_MARC_OID_MARC, \");\n query.append(\" PEH.CANA_OID_CANA as PEH_CANA_OID_CANA, \");\n query.append(\" PEH.PAIS_OID_PAIS as PEH_PAIS_OID_PAIS, \");\n query.append(\" PCH.COD_PERI as PCH_COD_PERI \");\n query.append(\" FROM MAE_CLIEN_HISTO_ESTAT, \");\n query.append(\" CRA_PERIO PED, \");\n query.append(\" SEG_PERIO_CORPO PCD, \");\n query.append(\" CRA_PERIO PEH, \");\n query.append(\" SEG_PERIO_CORPO PCH \");\n query.append(\" WHERE PERD_OID_PERI = PED.OID_PERI \");\n query.append(\" AND PED.PERI_OID_PERI = PCD.OID_PERI \");\n query.append(\" AND PERD_OID_PERI_PERI_FIN = PEH.OID_PERI(+) \");\n query.append(\" AND PEH.PERI_OID_PERI = PCH.OID_PERI(+) \");\n query.append(\" AND CLIE_OID_CLIE = \").append(cliente\n .getOidCliente());\n respuesta = bs.dbService.executeStaticQuery(query.toString());\n \n if(log.isDebugEnabled()) //sapaza -- cambio Optimizacion Logs -- 23/03/2010 \n UtilidadesLog.debug(\" obtenerHistoricoEstatusCliente respuesta \" + respuesta); \n } catch (Exception e) {\n UtilidadesLog.error(\"ERROR \", e);\n codigoError = CodigosError.ERROR_DE_LECTURA_EN_BASE_DE_DATOS;\n throw new MareException(e, UtilidadesError.armarCodigoError(\n codigoError));\n }\n\n if (respuesta.esVacio()) {\n cliente.setHistoricoEstatusCliente(new HistoricoEstatusCliente[0]);\n } else {\n HistoricoEstatusCliente[] historico = new HistoricoEstatusCliente[\n respuesta.getRowCount()];\n\n for (int i = 0; i < respuesta.getRowCount(); i++) {\n if(log.isDebugEnabled()) //sapaza -- cambio Optimizacion Logs -- 23/03/2010 \n UtilidadesLog.debug(\"Pongo un historico\");\n\n Periodo periodoDesde = new Periodo();\n periodoDesde.setOidPeriodo(new Long(((BigDecimal) respuesta\n .getValueAt(i, \"PERD_OID_PERI\")).longValue()));\n periodoDesde.setFechaDesde((Date) respuesta\n .getValueAt(i, \"PED_FEC_INIC\"));\n periodoDesde.setFechaHasta((Date) respuesta\n .getValueAt(i, \"PED_FEC_FINA\"));\n periodoDesde.setOidMarca(new Long(((BigDecimal) respuesta\n .getValueAt(i, \"PED_MARC_OID_MARC\")).longValue()));\n periodoDesde.setOidCanal(new Long(((BigDecimal) respuesta\n .getValueAt(i, \"PED_CANA_OID_CANA\")).longValue()));\n periodoDesde.setOidPais(new Long(((BigDecimal) respuesta\n .getValueAt(i, \"PED_PAIS_OID_PAIS\")).longValue()));\n periodoDesde.setCodperiodo((String) respuesta\n .getValueAt(i, \"PCD_COD_PERI\"));\n\n Periodo periodoHasta;\n BigDecimal periodoFin = (BigDecimal) respuesta\n .getValueAt(i, \"PERD_OID_PERI_PERI_FIN\");\n\n if (periodoFin == null) {\n periodoHasta = null;\n } else {\n periodoHasta = new Periodo();\n periodoHasta.setOidPeriodo(new Long(periodoFin\n .longValue()));\n periodoHasta.setFechaDesde((Date) respuesta\n .getValueAt(i, \"PEH_FEC_INIC\"));\n periodoHasta.setFechaHasta((Date) respuesta\n .getValueAt(i, \"PEH_FEC_FINA\"));\n periodoHasta.setOidMarca((respuesta\n .getValueAt(i, \"PEH_MARC_OID_MARC\") != null)\n ? new Long(((BigDecimal) respuesta\n .getValueAt(i, \"PEH_MARC_OID_MARC\")).longValue()) \n : null);\n periodoHasta.setOidCanal((respuesta\n .getValueAt(i, \"PEH_CANA_OID_CANA\") != null) \n ? new Long(((BigDecimal) respuesta\n .getValueAt(i, \"PEH_CANA_OID_CANA\")).longValue()) \n : null);\n periodoHasta.setOidPais((respuesta\n .getValueAt(i, \"PEH_PAIS_OID_PAIS\") != null)\n ? new Long(((BigDecimal) respuesta\n .getValueAt(i, \"PEH_PAIS_OID_PAIS\")).longValue()) \n : null);\n periodoHasta.setCodperiodo((String) respuesta\n .getValueAt(i, \"PCH_COD_PERI\"));\n }\n\n historico[i] = new HistoricoEstatusCliente();\n historico[i].setOidEstatus(respuesta.getValueAt(i, \"ESTA_OID_ESTA_CLIE\")==null?null:\n new Long(((BigDecimal) respuesta.getValueAt(i, \"ESTA_OID_ESTA_CLIE\")).longValue()));\n historico[i].setPeriodoInicio(periodoDesde);\n historico[i].setPeriodoFin(periodoHasta);\n \n if(log.isDebugEnabled()) {//sapaza -- cambio Optimizacion Logs -- 23/03/2010 \n UtilidadesLog.debug(\"Pongo un historico historico[i].setOidEs\"\n +\"tatus \" + historico[i].getOidEstatus());\n UtilidadesLog.debug(\"Pongo un historico historico[i].setPerio\"\n +\"doInicio \" + historico[i].getPeriodoInicio());\n UtilidadesLog.debug(\"Pongo un historico historico[i].setPerio\"\n +\"doFin \" + historico[i].getPeriodoFin());\n } \n }\n\n cliente.setHistoricoEstatusCliente(historico);\n }\n UtilidadesLog.info(\" DAOSolicitudes.obtenerHistoricoEstatusCliente(\"\n +\"Cliente cliente):Salida\");\n }", "@RequestMapping(value = \"/estados\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public List<Estado> getAll() {\n log.debug(\"REST request to get all Estados\");\n return estadoRepository.findAll();\n }", "public static void query() {\n\n GPS = \"24.9684297,121.1959266\";\n\n SimpleDateFormat sdFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date nowDate = new Date();\n\n String startDayStr = \"2017-01-09\";\n Calendar cal = Calendar.getInstance();\n cal.setTime(nowDate);\n // cal.add(Calendar.MONTH, 3);\n cal.add(Calendar.MONTH, 1);\n String endDayStr = sdFormat.format(cal.getTime());\n\n String query = String.format(\"▽活動搜尋▼▽start_day▼%s▽end_day▼%s\", startDayStr, endDayStr);\n\n System.out.println(\"伺服器狀態測試查詢... \" + query + \" \" + GPS + \" \" + radius);\n Socket client = new Socket();\n InetSocketAddress isa = new InetSocketAddress(address, port);\n try {\n client.connect(isa, 10000);\n\n DataOutputStream out = new DataOutputStream(client.getOutputStream());\n out.writeUTF(query + \" \" + GPS + \" \" + radius + \" \" + whichFucntion + \" \" + \"test \" + quantity);\n client.shutdownOutput();\n ObjectInputStream in = new ObjectInputStream(client.getInputStream());\n Object obj = in.readObject();\n\n//\t\t\tSystem.out.println(obj.toString());\n SearchResultShopData searchResultShopData = (SearchResultShopData) obj;\n ArrayList<ShopData> a = (ArrayList<ShopData>) searchResultShopData.getShopDataList();\n//\t\t\tSystem.out.println(\"searchResultShopData.getStaut() : \" + searchResultShopData.getStaut());\n if (searchResultShopData.getStaut() == 1) {\n for (int i = 0; i < a.size(); i++) {\n if (a.get(i).getSearchEngine().equals(ShopData.SEARCH_ENGINE_ATTRIBUTE_FB_ACTIVITY_SOLR)) {\n FBShopActivityDescription fbShopActivityDescription = (FBShopActivityDescription) a.get(i);\n System.out.println(\"/////////////////////////start////////////////////////\");\n System.out.println(\"活動名稱:\" + fbShopActivityDescription.getTitle());\n System.out.println(\"活動發文連結:\" + fbShopActivityDescription.getHttp());\n System.out.println(\"GPS:\" + fbShopActivityDescription.getLatitude() + \",\" + fbShopActivityDescription.getLongitude());\n System.out.println();\n System.out.println(\"*******************活動摘要資訊********************\");\n System.out.println(\"活動開始時間:\" + fbShopActivityDescription.getStartDate());\n System.out.println(\"活動結束時間:\" + fbShopActivityDescription.getEndDate());\n System.out.println(\"活動地點:\" + fbShopActivityDescription.getAddress());\n System.out.println(\"~~~~~~~~~~~~~~~~~~HighlightFBPost~~~~~~~~~~~~~~~~~~~~\");\n System.out.println(fbShopActivityDescription.getDescription());\n System.out.println(\"////////////////////////end/////////////////////////\");\n System.out.println();\n }\n }\n }\n out.flush();\n out.close();\n out = null;\n in.close();\n in = null;\n client.close();\n client = null;\n } catch (java.io.IOException e) {\n System.err.println(\"SocketClient 連線有問題 !\");\n System.err.println(\"IOException :\" + e.toString());\n } catch (ClassNotFoundException e) {\n System.err.println(\"ClassNotFoundException :\" + e.toString());\n } catch (Exception e) {\n System.err.println(\"Exception :\" + e.toString());\n }\n\n }", "int getDatenvolumen();", "private void getDataBahasa(){\n\n UserAPIService api = Config.getRetrofit().create(UserAPIService.class);\n Call<Value> call = api.lihat_program_like(\"Bahasa\");\n call.enqueue(new Callback<Value>() {\n @Override\n public void onResponse(Call<Value> call, Response<Value> response) {\n// pDialog.dismiss();\n String value1= response.body().getStatus();\n if (value1.equals(\"1\")){\n Value value = response.body();\n resultAlls = new ArrayList<>(Arrays.asList(value.getResult()));\n adapter = new RecyclerAdapterListAll(resultAlls,getApplicationContext());\n recyclerView.setAdapter(adapter);\n }else {\n Toast.makeText(ListPonpesActivity.this,\"Maaf Data Tidak Ada\",Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onFailure(Call<Value> call, Throwable t) {\n // pDialog.dismiss();\n Toast.makeText(ListPonpesActivity.this,\"Respon gagal\",Toast.LENGTH_SHORT).show();\n Log.d(\"Hasil internet\",t.toString());\n }\n });\n }", "public SearchResponse getStatus();", "@GET(\"iss-now.json/\")\n Call<ISStatus> GetLocation();", "public Estado ReadEstado(int estadoID){\r\n SQLiteDatabase sqLiteDatabase = conn.getReadableDatabase();\r\n String query = \"select * from estados WHERE estadoID=?\";\r\n Cursor c= sqLiteDatabase.rawQuery(query, new String[]{String.valueOf(estadoID)});\r\n if (c.moveToFirst()) return new Estado(estadoID,c.getString(c.getColumnIndex(\"descripcion\")));\r\n return null;\r\n\r\n\r\n }", "@Test\n public void testTransplantListEndpointQueryGender() {\n String lowerBound = \"1970-01-01\";\n String upperBound = \"2018-09-27\";\n ResponseEntity response = dataController.getTransplantWaitingListRange(null,\"M\",null,null,upperBound, lowerBound);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public String consultarSolicitudes()\n {\n Object objeto = sdao.consultaGeneral();\n return gson.toJson(objeto);\n }", "void fetchHolidayRentalHousesData();", "@Override\r\n\tpublic List<Object> consultarVehiculos() {\r\n\t\t\r\n\t\tFormat formato = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\t\r\n\t\treturn AdminEstacionamientoImpl.getParqueadero().stream().map(\r\n\t\t\t\t temp -> {HashMap<String, String> lista = new HashMap<String, String>(); \r\n\t\t\t\t lista.put( \"placa\", temp.getVehiculo().getPlaca() );\r\n\t\t\t\t lista.put( \"tipo\", temp.getVehiculo().getTipo() );\r\n\t\t\t\t lista.put( \"fechaInicio\", formato.format( temp.getFechaInicio() ) );\r\n\r\n\t\t\t\t return lista;\r\n\t\t\t\t }\r\n\t\t\t\t).collect(Collectors.toList());\r\n\t}", "public List getAllStu();", "private void getDataModern(){\n UserAPIService api = Config.getRetrofit().create(UserAPIService.class);\n Call<Value> call = api.lihat_jenis(\"Modern\");\n call.enqueue(new Callback<Value>() {\n @Override\n public void onResponse(Call<Value> call, Response<Value> response) {\n// pDialog.dismiss();\n String value1 = response.body().getStatus();\n if (value1.equals(\"1\")){\n Value value = response.body();\n resultAlls = new ArrayList<>(Arrays.asList(value.getResult()));\n adapter = new RecyclerAdapterListAll(resultAlls,getApplicationContext());\n recyclerView.setAdapter(adapter);\n }else {\n Toast.makeText(ListPonpesActivity.this,\"Maaf Data Tidak Ada\",Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onFailure(Call<Value> call, Throwable t) {\n // pDialog.dismiss();\n Toast.makeText(ListPonpesActivity.this,\"Respon gagal\",Toast.LENGTH_SHORT).show();\n Log.d(\"Hasil internet\",t.toString());\n }\n });\n }", "private static void checkStatus() {\n\r\n\t\tDate date = new Date();\r\n\t\tSystem.out.println(\"Checking at :\"+date.toString());\r\n\t\tString response = \"\";\r\n\t\ttry {\r\n\t\t\tresponse = sendGET(GET_URL_COVAXIN);\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\t//System.out.println(response.toString());\r\n\t\tArrayList<Map> res = formatResponse(response);\r\n\r\n\t\tres = checkAvailability(res);\r\n\t\tif(res.size()>0)\r\n\t\t\tnotifyUser(res);\r\n\t\t//System.out.println(emp.toString());\r\n\t}", "java.util.List<online_info>\n getInfoList();", "public static List<CentroDeCusto> readAllAtivos() {\n Query query = HibernateUtil.getSession().createQuery(\"FROM CentroDeCusto WHERE status = 'A'\");\n return query.list();\n }", "public int getEntitystatus();", "public void consultasSeguimiento() {\r\n try {\r\n switch (opcionMostrarAnalistaSeguim) {\r\n case \"Cita\":\r\n ListSeguimientoRadicacionesConCita = Rad.ConsultasRadicacionYSeguimiento(2, mBsesion.codigoMiSesion());\r\n break;\r\n case \"Entrega\":\r\n ListSeguimientoRadicacionesConCita = Rad.ConsultasRadicacionYSeguimiento(3, mBsesion.codigoMiSesion());\r\n break;\r\n }\r\n } catch (Exception e) {\r\n mbTodero.setMens(\"Error en el metodo '\" + this.getClass() + \".consultasSeguimiento()' causado por: \" + e.getMessage());\r\n mbTodero.error();\r\n }\r\n\r\n }", "List<Averia> listarAverias() throws BusinessException;", "public List viewTotalInscritosBD();", "public void status() {\n System.out.println(\"Nome: \" + this.getNome());\n System.out.println(\"Data de Nascimento: \" + this.getDataNasc());\n System.out.println(\"Peso: \" + this.getPeso());\n System.out.println(\"Altura: \" + this.getAltura());\n }", "public abstract List<GnNotaria> getAllGnNotaria() throws Exception;", "public Vector listaAsignaturas(String nombre_titulacion)\n {\n try\n {\n Date fechaActual = new Date();\n SimpleDateFormat formato = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\n\n //Se obtiene una conexion\n Connection conexion = this.bbdd.getConexion();\n\n //Se prepara la query\n String query = \"SELECT * FROM asignaturatotal \";\n query += \"WHERE fechainicio <='\" + formato.format(fechaActual) +\"' \";\n query += \"AND fechafin >= '\"+formato.format(fechaActual)+\"' AND tit_nombre='\"+nombre_titulacion+\"' AND activa = 's'\";\n\n //Se crea un vector de asignaturas\n Vector vectorAsignaturas = new Vector();\n\n //Se ejecuta la query \n Statement st = conexion.createStatement();\n ResultSet resultado = st.executeQuery(query);\n \n //Para cada fila se creará un objeto y se rellenará\n //con los valores de las columnas.\n while(resultado.next())\n {\n asignatura asignatura = new asignatura();\n \n asignatura.setCodigo(resultado.getString(\"codigo\"));\n asignatura.setTitulo(resultado.getString(\"titulo\"));\n asignatura.setFechaInicio(resultado.getDate(\"fechainicio\"));\n asignatura.setFechaFin(resultado.getDate(\"fechafin\"));\n asignatura.setResponsable(resultado.getString(\"responsable\"));\n asignatura.setEmail(resultado.getString(\"email\"));\n asignatura.setTelefono(resultado.getString(\"telefono\"));\n \n //Se añade la asignatura al vector de asignaturas\n vectorAsignaturas.add(asignatura);\n }\n\n //Se cierra la conexión\n this.bbdd.cerrarConexion(conexion);\n\n return vectorAsignaturas;\n }\n catch(SQLException e)\n {\n System.out.println(\"Error al acceder a las asignaturas de la Base de Datos: \"+e.getMessage());\n return null;\n }\n }", "public ListaResponse<G> listar();", "public void consultaTest() throws Exception{\n\t\t\n\t ResultSet rs = statement.executeQuery(\"select * from statistics\");\n\t \n\t \n\t while(rs.next())\n\t {\n\t\t \n\t\t DateFormat df = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss.SSS\");\n\t\t Date date = df.parse(rs.getString(\"timeActual\"));\n\t\t Calendar cal = Calendar.getInstance();\n\t\t cal.setTime(date);\n\t\t \n\t\t String completoDay = cal.get(Calendar.YEAR)+\"-\"+(cal.get(Calendar.MONTH) + 1)+\"-\"+ cal.get(Calendar.DAY_OF_MONTH);\n\t\t \n\t System.out.println(\"id= \" + rs.getInt(\"id\") + \" memory= \" + rs.getInt(\"memory\") + \" cpu= \" \n\t \t+ rs.getInt(\"cpu\") + \" timeActual= \" + completoDay);\n\t }\n\t \n\t if(rs != null)\n\t\t rs.close();\n\t \n\t if(connection != null)\n\t connection.close();\n\t \n\t}", "private boolean getEstadoProceso(int indiceProceso ,int CodEmp, int CodLoc, int CodCot){\n boolean blnRes=false;\n java.sql.Connection conLoc;\n java.sql.ResultSet rstLoc;\n java.sql.Statement stmLoc;\n try{ //null=No tiene;P=Pendiente;C=Completa\n conLoc=DriverManager.getConnection(objParSis.getStringConexion(),objParSis.getUsuarioBaseDatos(),objParSis.getClaveBaseDatos());\n if(conLoc!=null){\n stmLoc = conLoc.createStatement();\n strSql=\"\";\n strSql+=\" SELECT a1.co_emp,a1.co_loc,a1.co_cot, \\n\";\n strSql+=\" CASE WHEN a1.st_solResInv IS NULL THEN 'N' ELSE a1.st_solResInv END as st_solResInv \\n\";\n strSql+=\" FROM tbm_cabCotVen as a1 \\n\";\n strSql+=\" WHERE a1.co_emp=\"+CodEmp+\" AND a1.co_loc=\"+CodLoc+\" AND a1.co_cot=\"+CodCot+\" \\n\";\n rstLoc = stmLoc.executeQuery(strSql);\n if(rstLoc.next()){\n switch(indiceProceso){\n case 1: \n if(rstLoc.getString(\"st_solResInv\").equals(\"N\")) \n blnRes=true; \n break;\n case 2: \n if(rstLoc.getString(\"st_solResInv\").equals(\"P\"))\n blnRes=true;\n break;\n case 3: \n if(rstLoc.getString(\"st_solResInv\").equals(\"C\"))\n blnRes=true;\n break;\n } \n }\n rstLoc.close();\n rstLoc=null;\n stmLoc.close();\n stmLoc=null;\n conLoc.close();\n conLoc=null;\n }\n \n }\n catch (java.sql.SQLException e){\n blnRes=false;\n objUti.mostrarMsgErr_F1(this, e);\n }\n catch (Exception e){\n blnRes=false;\n objUti.mostrarMsgErr_F1(this, e);\n }\n return blnRes;\n }", "private void listadoEstados() {\r\n sessionProyecto.getEstados().clear();\r\n sessionProyecto.setEstados(itemService.buscarPorCatalogo(CatalogoEnum.ESTADOPROYECTO.getTipo()));\r\n }", "private void getCariSemua(){\n UserAPIService api = Config.getRetrofit().create(UserAPIService.class);\n Call<Value> call = api.cari_semua_like(txt_kodeMK.getSelectedItem().toString(),txt_kelas.getSelectedItem().toString());\n call.enqueue(new Callback<Value>() {\n @Override\n public void onResponse(Call<Value> call, Response<Value> response) {\n// pDialog.dismiss();\n String value1 = response.body().getStatus();\n if (value1.equals(\"1\")) {\n Value value = response.body();\n resultAlls = new ArrayList<>(Arrays.asList(value.getResult()));\n adapter = new RecyclerAdapterListAll(resultAlls, getApplicationContext());\n recyclerView.setAdapter(adapter);\n }else{\n Toast.makeText(ListPonpesActivity.this,\"Maaf Data Tidak Ada\",Toast.LENGTH_SHORT).show();\n\n }\n }\n\n @Override\n public void onFailure(Call<Value> call, Throwable t) {\n // pDialog.dismiss();\n Toast.makeText(ListPonpesActivity.this,\"Respon gagal\",Toast.LENGTH_SHORT).show();\n Log.d(\"Hasil internet\",t.toString());\n }\n });\n }", "private void getDatosVisitasTerreno(){\n mDatosVisitasTerreno = estudioAdapter.getListaDatosVisitaTerrenosSinEnviar();\n //ca.close();\n }", "public void getAngajati() {\n\t\tList<Angajat> angajatiWithSalary = angajatOperations.getAngajatiBySalaryCondition();\n\t\tangajatOperations.printListOfAngajati(angajatiWithSalary);\n\t}", "@GET \n @Produces(\"text/plain\")\n public String getIt() {\n \tGraphDAO dao = GraphDAO.getInstance();\n \tdao.init(\"graphdbs/ComboBreaker\");\n \tString retVal = dao.outputGraphNodes();\n \treturn retVal;\n }", "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 void getPaySuccessData() {\n\n RetrofitNetNew.build(SCommonApi.class, getIdentifier()).get_my_paysuccess(BanbenUtils.getInstance().getVersion(), BanbenUtils.getInstance().getImei(), BanbenUtils.getInstance().getToken()).enqueue(new Callback<ResponseSlbBean<SPaySuccessBean>>() {\n @Override\n public void onResponse(Call<ResponseSlbBean<SPaySuccessBean>> call, Response<ResponseSlbBean<SPaySuccessBean>> response) {\n if (!hasView()) {\n return;\n }\n if (response.body() == null) {\n return;\n }\n if (response.body().getCode() != 0) {\n getView().OnPaySuccessNodata(response.body().getMsg());\n return;\n }\n getView().OnPaySuccessSuccess(response.body().getData());\n call.cancel();\n }\n\n @Override\n public void onFailure(Call<ResponseSlbBean<SPaySuccessBean>> call, Throwable t) {\n if (!hasView()) {\n return;\n }\n// String string = t.toString();\n String string = BanbenUtils.getInstance().net_tips;\n getView().OnPaySuccessFail(string);\n call.cancel();\n }\n });\n\n }", "public ArrayList<Info_laboral> findAll(){\n ConexionBD con = new ConexionBD();\n Connection c = con.conOracle();\n\n ArrayList<Info_laboral> eeg = new ArrayList();\n\n try{\n ResultSet gs = con.ejecutaCon(\" Select * from Info_laboral\"); \n while(gs.next()){\n \n Estudios_Egresado ee=new Estudios_Egresado();\n Info_laboral i =new Info_laboral();\n Egresado eg = new Egresado();\n Estudios es = new Estudios();\n \n i.setId(gs.getInt(1));\n i.setJefe(gs.getString(2));\n i.setCargo(gs.getString(3));\n i.setFuncion(gs.getString(4));\n i.setFecha_ini(gs.getDate(5));\n i.setFecha_fin(gs.getDate(6));\n i.setMotivo_retiro(gs.getString(7));\n eg.setId(gs.getLong(8));\n i.setId_egresado(eg);\n i.setPerfil(gs.getString(9));\n \n eeg.add(i);\n }\n }catch(SQLException e){\n System.out.println(\"error \"+e);\n return null;\n }\n return eeg;\n }", "List<BInformation> findAll();", "@Override\npublic JsonArray queryStatistics(String date, Employee em) throws Exception {\n\tint [] montharr= {31,28,31,30,31,30,31,31,30,31,30,31};\n\tSystem.out.println(date);\n\tint year;\n\tint month;\n\tif(date.length()==0){\n\t\tmonth = new Date().getMonth()+1;\n\t\tyear= new Date().getYear()+1900;\n\t}else{\n\t\tString[] s=date.split(\"-\");\n\t\tyear=Integer.parseInt(s[0]);\n\t\tmonth=Integer.parseInt(s[1]);\n\t}\n\t\n\t\n\tList<Map<String,Object>> lstMap = new LinkedList<Map<String,Object>>();\n\tfor (int i = 1; i <=montharr[month-1] ; i++) {\n\t\tStringBuffer buffer =new StringBuffer(\"select SUM(c.golds) from consumption c,machineinfo m where c.fmachineid=m.id and m.state!=-1 and c.type=-1 and m.empid=\")\n\t\t\t\t.append(em.getId()).append(\" and year(c.createtime) =\").append(year)\n\t\t\t\t.append(\" and month(c.createtime) =\").append(month).append(\" and day(c.createtime) =\").append(i);;\n\t\t\t\tSystem.out.println(buffer);\n\t\t\t\tMap<String,Object> map = new HashMap<String,Object>();\n\t\t\t\tList<Object> lst = databaseHelper.getResultListBySql(buffer.toString());\n\t\t\t\t\n\t\t\t\tmap.put(\"nums\", lst==null?\"0\":lst.size()==0?\"0\":lst.get(0)==null?\"0\":lst.get(0).toString());\n\t\t\t\tmap.put(\"time\", i+\"日\");\n\t\t\t\tmap.put(\"month\", month);\n\t\t\t\tlstMap.add(map);\n\t}\n\tString result = new Gson().toJson(lstMap);\n\tJsonArray jarr = (JsonArray) new JsonParser().parse(result);\n\treturn jarr;\n}", "@GetMapping(\"/table/checkAvailabilityList\")\n\tpublic List<TableRestaurant> getAvailabilityList()\n\t{\n\t\tList<TableRestaurant> availableTime = tableRepo.checkTableAvailabilityList();\n\t\tif(availableTime.equals(null))\n\t\t{\n\t\t\tthrow new UniquoNotFoundException(\"The waiting time cannot be calculated\");\n\t\t}\n\t\treturn availableTime;\n\t}", "@GET\n @Path(\"/{nqaId}\")\n @Consumes(MediaType.APPLICATION_JSON)\n @Produces(MediaType.APPLICATION_JSON)\n public NbiNqa query(@Context HttpServletRequest req, @Context HttpServletResponse resp,\n @PathParam(\"nqaId\") String nqaId) throws ServiceException {\n\n long infterEnterTime = System.currentTimeMillis();\n\n LOGGER.info(\"Query begin, nqaId is :\" + nqaId);\n\n UuidUtils.checkUuid(nqaId);\n\n ResultRsp<NbiNqa> resultRsp = nqaSvc.query(req, resp, nqaId);\n\n LOGGER.info(\"Exit query NQA method. cost time(ms): \" + (System.currentTimeMillis() - infterEnterTime));\n\n return resultRsp.getData();\n }", "@Test\n public void testTransplantListEndpointQueryBloodtype() {\n String lowerBound = \"1970-01-01\";\n String upperBound = \"2018-09-27\";\n ResponseEntity response = dataController.getTransplantWaitingListRange(\"AB+\",null,null,null,upperBound, lowerBound);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }", "List<Oficios> buscarActivas();", "private void getDataLainya(){\n\n UserAPIService api = Config.getRetrofit().create(UserAPIService.class);\n Call<Value> call = api.lihat_jenis(\"Komprehensif\");\n call.enqueue(new Callback<Value>() {\n @Override\n public void onResponse(Call<Value> call, Response<Value> response) {\n// pDialog.dismiss();\n String value1= response.body().getStatus();\n if (value1.equals(\"1\")){\n Value value = response.body();\n resultAlls = new ArrayList<>(Arrays.asList(value.getResult()));\n adapter = new RecyclerAdapterListAll(resultAlls,getApplicationContext());\n recyclerView.setAdapter(adapter);\n }else {\n Toast.makeText(ListPonpesActivity.this,\"Maaf Data Tidak Ada\",Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onFailure(Call<Value> call, Throwable t) {\n // pDialog.dismiss();\n Toast.makeText(ListPonpesActivity.this,\"Respon gagal\",Toast.LENGTH_SHORT).show();\n Log.d(\"Hasil internet\",t.toString());\n }\n });\n }", "public interface GrafanaService {\n @GET(\"/render\")\n Call<List<ParsedStatElement>> getData(@Query(\"from\") String from, @Query(\"until\") String until, @Query(\"target\") String target, @Query(\"format\") String format);\n}", "private void getDataDai(){\n\n UserAPIService api = Config.getRetrofit().create(UserAPIService.class);\n Call<Value> call = api.lihat_program_like(\"Dai\");\n call.enqueue(new Callback<Value>() {\n @Override\n public void onResponse(Call<Value> call, Response<Value> response) {\n// pDialog.dismiss();\n String value1= response.body().getStatus();\n if (value1.equals(\"1\")){\n Value value = response.body();\n resultAlls = new ArrayList<>(Arrays.asList(value.getResult()));\n adapter = new RecyclerAdapterListAll(resultAlls,getApplicationContext());\n recyclerView.setAdapter(adapter);\n }else {\n Toast.makeText(ListPonpesActivity.this,\"Maaf Data Tidak Ada\",Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onFailure(Call<Value> call, Throwable t) {\n // pDialog.dismiss();\n Toast.makeText(ListPonpesActivity.this,\"Respon gagal\",Toast.LENGTH_SHORT).show();\n Log.d(\"Hasil internet\",t.toString());\n }\n });\n }", "@GetMapping(\"/statuts\")\n public List<Status> selectAllStatuts(){\n \treturn serviceStatut.selectAllStatuts();\n }", "public List<Consulta> getAll() throws BusinessException;", "private void calcularOtrosIngresos(Ingreso ingreso)throws Exception{\n\t\tfor(IngresoDetalle ingresoDetalle : ingreso.getListaIngresoDetalle()){\r\n\t\t\tif(ingresoDetalle.getIntPersPersonaGirado().equals(ingreso.getBancoFondo().getIntPersonabancoPk())\r\n\t\t\t&& ingresoDetalle.getBdAjusteDeposito()==null){\r\n\t\t\t\tbdOtrosIngresos = ingresoDetalle.getBdMontoAbono();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public Vector listaAsignaturasTotal(String nombre_titulacion)\n {\n try\n { \n //Se obtiene una conexion\n Connection conexion = this.bbdd.getConexion();\n\n //Se prepara la query\n String query = \"SELECT * FROM asignaturatotal \";\n query += \"WHERE tit_nombre='\"+nombre_titulacion+\"' AND activa = 's'\";\n\n //Se crea un vector de asignaturas\n Vector vectorAsignaturas = new Vector();\n\n //Se ejecuta la query\n Statement st = conexion.createStatement();\n ResultSet resultado = st.executeQuery(query);\n\n //Para cada fila se creará un objeto y se rellenará\n //con los valores de las columnas.\n while(resultado.next())\n {\n asignatura asignatura = new asignatura();\n\n asignatura.setCodigo(resultado.getString(\"codigo\"));\n asignatura.setTitulo(resultado.getString(\"titulo\"));\n asignatura.setFechaInicio(resultado.getDate(\"fechainicio\"));\n asignatura.setFechaFin(resultado.getDate(\"fechafin\"));\n asignatura.setResponsable(resultado.getString(\"responsable\"));\n asignatura.setEmail(resultado.getString(\"email\"));\n asignatura.setTelefono(resultado.getString(\"telefono\"));\n\n //Se añade la asignatura al vector de asignaturas\n vectorAsignaturas.add(asignatura);\n }\n\n //Se cierra la conexión\n this.bbdd.cerrarConexion(conexion);\n\n return vectorAsignaturas;\n }\n catch(SQLException e)\n {\n System.out.println(\"Error al acceder a las asignaturas de la Base de Datos: \"+e.getMessage());\n return null;\n }\n }", "private void getDataTakfidul(){\n UserAPIService api = Config.getRetrofit().create(UserAPIService.class);\n Call<Value> call = api.lihat_program_like(\"Takhfidul Qur'an\");\n call.enqueue(new Callback<Value>() {\n @Override\n public void onResponse(Call<Value> call, Response<Value> response) {\n// pDialog.dismiss();\n String value1 = response.body().getStatus();\n if (value1.equals(\"1\")){\n Value value = response.body();\n resultAlls = new ArrayList<>(Arrays.asList(value.getResult()));\n adapter = new RecyclerAdapterListAll(resultAlls,getApplicationContext());\n recyclerView.setAdapter(adapter);\n }else {\n Toast.makeText(ListPonpesActivity.this,\"Maaf Data Tidak Ada\",Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onFailure(Call<Value> call, Throwable t) {\n // pDialog.dismiss();\n Toast.makeText(ListPonpesActivity.this,\"Respon gagal\",Toast.LENGTH_SHORT).show();\n Log.d(\"Hasil internet\",t.toString());\n }\n });\n }", "private void getReport() {\n\t\tdialog = ProgressDialog.show(this, \"\", \" Please wait...\", true);\n dialog.setCancelable(true);\n\t\tSharedPreferences pref = this.getSharedPreferences(\"User\", Activity.MODE_PRIVATE);\n\t\tString accessToken = pref.getString(\"access_token\", null);\n\t\tNetworkEngine.getInstance().getSeatReport(accessToken, bus_id, agent_id, new Callback<List<SeatReport>>() {\n\t\t\t\n\t\t\tpublic void success(List<SeatReport> arg0, Response arg1) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tseatReports = new ArrayList<SeatReport>();\n\t\t\t\tseatReports = arg0;\n\t\t\t\tlvSeatDetails.setAdapter(new SeatDetailsbyAgentAdapter(SeatDetailsbyAgentActivity.this, seatReports));\n\t\t\t\tdialog.cancel();\n\t\t\t}\n\t\t\t\n\t\t\tpublic void failure(RetrofitError arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tdialog.cancel();\n\t\t\t\tLog.i(\"\",\"Hello Error Response Code: \"+arg0.getResponse().getStatus());\n\t\t\t}\n\t\t});\n\t}", "@SuppressWarnings(\"unchecked\")\n public void consultarCoactivosXLS() throws CirculemosNegocioException {\n\n // consulta la tabla temporal de los 6000 coactivos\n StringBuilder sql = new StringBuilder();\n\n sql.append(\"select [TIPO DOC], [NUMERO DE IDENTIFICACIÓN], [valor multas], [titulo valor], proceso \");\n sql.append(\"from coactivos_xls \");\n sql.append(\"where id_tramite is null and numero_axis is null AND archivo is not null \");\n sql.append(\"AND [titulo valor] IN ('2186721','2187250','2187580','2186845')\");\n\n Query query = em.createNativeQuery(sql.toString());\n\n List<Object[]> listaResultados = Utilidades.safeList(query.getResultList());\n\n Date fechaCoactivo = UtilFecha.buildCalendar().getTime();\n CoactivoDTO coactivoDTOs;\n TipoIdentificacionPersonaDTO tipoIdentificacion;\n List<ObligacionCoactivoDTO> obligacionesCoactivoDTO;\n PersonaDTO personaDTO;\n ProcesoDTO proceso;\n // persiste los resultados en coactivoDTO\n for (Object[] coactivo : listaResultados) {\n coactivoDTOs = new CoactivoDTO();\n // persiste el tipo de indetificacion en TipoIdentificacionPersonaDTO\n personaDTO = new PersonaDTO();\n proceso = new ProcesoDTO();\n tipoIdentificacion = new TipoIdentificacionPersonaDTO();\n obligacionesCoactivoDTO = new ArrayList<>();\n\n tipoIdentificacion.setCodigo((String) coactivo[0]);\n personaDTO.setTipoIdentificacion(tipoIdentificacion);\n coactivoDTOs.setPersona(personaDTO);\n coactivoDTOs.getPersona().setNumeroIdentificacion((String) coactivo[1]);\n\n proceso.setFechaInicio(fechaCoactivo);\n coactivoDTOs.setProceso(proceso);\n coactivoDTOs.setValorTotalObligaciones(BigDecimal\n .valueOf(Double.valueOf(coactivo[2].toString().replaceAll(\"\\\\.\", \"\").replaceAll(\",\", \".\"))));\n coactivoDTOs.setValorTotalCostasProcesales(\n coactivoDTOs.getValorTotalObligaciones().multiply(BigDecimal.valueOf(0.05)));\n coactivoDTOs.getProceso().setObservacion(\"COACTIVO\");\n String[] numeroFactura = coactivo[3].toString().split(\",\");\n // separa los numeros de factura cuando viene mas de uno.\n for (String nFactura : numeroFactura) {\n // consulta por numero de factura el el saldo a capital por cada factura\n sql = new StringBuilder();\n sql.append(\"select nombre, saldo_capital, saldo_interes \");\n sql.append(\"from cartera_coactivos_xls \");\n sql.append(\"where nombre = :nFactura\");\n\n Query quer = em.createNativeQuery(sql.toString());\n\n quer.setParameter(\"nFactura\", nFactura);\n\n List<Object[]> result = Utilidades.safeList(quer.getResultList());\n // persiste las obligaciones consultadas y las inserta en ObligacionCoactivoDTO\n ObligacionCoactivoDTO obligaciones;\n for (Object[] obligacion : result) {\n obligaciones = new ObligacionCoactivoDTO();\n obligaciones.setNumeroObligacion((String) obligacion[0]);\n obligaciones.setValorObligacion(BigDecimal.valueOf(\n Double.valueOf(obligacion[1].toString().replaceAll(\"\\\\.\", \"\").replaceAll(\",\", \".\"))));\n obligaciones.setValorInteresMoratorios(BigDecimal.valueOf(\n Double.valueOf(obligacion[2].toString().replaceAll(\"\\\\.\", \"\").replaceAll(\",\", \".\"))));\n // Adiciona las obligaciones a una lista\n obligacionesCoactivoDTO.add(obligaciones);\n }\n\n }\n coactivoDTOs.setObligacionCoactivos(obligacionesCoactivoDTO);\n try {\n iLCoactivo.registrarCoactivoAxis(coactivoDTOs, coactivo[4].toString());\n } catch (Exception e) {\n logger.error(\"Error al registrar coactivo 6000 :\", e);\n }\n }\n }", "@Override\n public List<FecetProrrogaOrden> findWhereIdEstatusIdOrdenEquals(final BigDecimal estado, BigDecimal idOrden) {\n StringBuilder query = new StringBuilder();\n query.append(SQL_SELECT).append(SQL_ALL_COLUMNS).append(SQL_FROM).append(getTableName());\n query.append(\" WHERE ID_ORDEN = ? AND ID_ESTATUS = ? \");\n return getJdbcTemplateBase().query(query.toString(), new FecetProrrogaOrdenMapper(), idOrden, estado);\n }", "@GET(\"system/status\")\n Call<InlineResponse200> getStatus();", "private void onGetAllRettighet(Event<FintResource> responseEvent) {\n Identifikator batcaveId = new Identifikator();\n batcaveId.setIdentifikatorverdi(\"BATCAVE\");\n Rettighet batcave = new Rettighet();\n batcave.setSystemId(batcaveId);\n batcave.setNavn(\"Batcave\");\n batcave.setKode(\"BAT-002\");\n batcave.setBeskrivelse(\"Grants access to the secret cave\");\n responseEvent.addData(FintResource\n .with(batcave)\n .addRelations(new Relation.Builder().with(Rettighet.Relasjonsnavn.IDENTITET).forType(Identitet.class).field(\"systemid\").value(\"BATMAN\").build())\n .addRelations(new Relation.Builder().with(Rettighet.Relasjonsnavn.IDENTITET).forType(Identitet.class).field(\"systemid\").value(\"ROBIN\").build())\n );\n\n Identifikator batmobileId = new Identifikator();\n batmobileId.setIdentifikatorverdi(\"BATMOBILE\");\n Rettighet batmobile = new Rettighet();\n batmobile.setSystemId(batmobileId);\n batmobile.setKode(\"BAT-001\");\n batmobile.setNavn(\"Batmobile\");\n batmobile.setBeskrivelse(\"Grants access to driving the ultimate vehicle\");\n responseEvent.addData(FintResource.with(batmobile)\n .addRelations(new Relation.Builder().with(Rettighet.Relasjonsnavn.IDENTITET).forType(Identitet.class).field(\"systemid\").value(\"BATMAN\").build())\n );\n }", "public List<HrJBorrowcontract> findAll();", "@Override\n\t/*Método para usarse en el momento de ver las reservas de un determinado usuaario en el panel del mismo*/\n\tpublic String verReservas(String nombreusuario) {\n\t\tGson json= new Gson(); \n\t\tDBConnection con = new DBConnection();\n\t\tString sql =\"Select * from alquileres alq, peliculas p where alq.pelicula=p.id and alq.usuario LIKE '\"+nombreusuario+\"' order by p.titulo\"; //Seleccion de los alquileres relacionados con el usuario \n\t\ttry {\n\t\t\t\n\t\t\tArrayList<Alquiler> datos= new ArrayList<Alquiler>(); //ArrayList que va a almacenar los alquileres del usuario\n\t\t\t\n\t\t\tStatement st = con.getConnection().createStatement();\n\t\t\tResultSet rs = st.executeQuery(sql);\n\t\t\t\n\t\t\t//Se cogen los datos necesarios \n\t\t\twhile(rs.next()) {\n\t\t\t\tString idpelicula=rs.getString(\"id\");\n\t\t\t\tint numero_alquiler=rs.getInt(\"numero_alquiler\");\n\t\t\t\tString fecha=rs.getString(\"fecha_alquiler\");\n\t\t\t\tString titulo= rs.getString(\"titulo\"); \n\t\t\t\tString genero= rs.getString(\"genero\"); \n\t\t\t\tString cadenaestreno=rs.getString(\"estreno\");\n\t\t\t\tString estreno=\"\"; \n\t\t\t\t\n\t\t\t\t//comprobación y asignación del atributo estreno:\n\t\t\t\t/*Como en la base de datos se guarda como una cadena de texto, cuando se devuelve\n\t\t\t\t * hay que comprobar su valor y dependiendo del que sea pasarlo a una cadena para pasarla a la clase \n\t\t\t\t * Alquiler*/\n\t\t\t\t\n\t\t\t\tif(cadenaestreno.equals(\"true\")) {\n\t\t\t\t\testreno=\"Si\";\n\t\t\t\t}else if(cadenaestreno.equals(\"false\")) {\n\t\t\t\t\testreno=\"No\";\n\t\t\t\t}\n\t\t\t\tAlquiler alquiler=new Alquiler(numero_alquiler,idpelicula,fecha,titulo,genero,estreno); //uso esta clase para poder enviar los datos\n\t\t\t\tdatos.add(alquiler); //añado el alquiler a los datos que se van a devolver\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\tst.close();\n\t\treturn json.toJson(datos); //devuelvo la lista de los datos en JSON \n\t\t}catch(Exception e){\n\t\t\tSystem.out.println(e.getMessage());\n\t\t\treturn e.getMessage();\n\t\t}finally {\n\t\t\tcon.desconectar();\n\t\t}\n\t}", "public Cliente[] findWhereEstadoEquals(String estado) throws ClienteDaoException;", "public interface BirthdayService {\n\n List<Birthday> getAllBirthdayInfo();\n\n List<Birthday> queryBirthdayInfoByPage(int nowPage, int pageSize);\n\n int queryCount();\n\n}", "@Override\r\n\t@Transactional\r\n\tpublic FmtEstado list(Long id){\r\n\t\ttry{\r\n\t\t\tString sql = \"select \"+FmtEstado.getColumnNames()\r\n\t\t\t\t\t + \"from FMT_ESTADO \"\r\n\t\t\t\t\t + \"where estacons = :id \";\r\n\t\t\t\t\t\t\r\n\t\t\tQuery query = getSession().createSQLQuery(sql)\r\n\t\t\t\t\t\t .addEntity(FmtEstado.class)\t\t\t\t\t\r\n\t\t\t\t\t .setParameter(\"id\", id);\r\n\t\t\treturn (FmtEstado)query.uniqueResult();\r\n\t\t}catch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public int getAyudantes(){\n return ayudantes; \n }", "@PostMapping(\"/fetch\")\n\tpublic ResponseEntity<?> getAgeAndPrenom(@Valid @RequestBody GeneriqueSpecificationRequest search){\n\t\tEtudiantSpecificationsBuilder<Etudiant> builder = new EtudiantSpecificationsBuilder();\n\t\tObject tmp=null;\n\t\tfor(SearchCriteria sc:search.getItems()){\n\t\t\tif(sc.getKey().equals(\"type\")){\n\t\t\t\tif (sc.getValue().equals(\"ACTIF\")) {\n\t\t\t\t\ttmp = Type.ACTIF;\n\t\t\t\t} else if (sc.getValue().equals(\"DISABLE\")) {\n\t\t\t\t\ttmp = Type.DISABLE;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\ttmp=sc.getValue();\n\t\t\t}\n\t\t\tbuilder.with(sc.getKey(),sc.getOperation(),tmp);\n\t\t}\n\t\tSpecification<Etudiant> spec = builder.build();\n\t\tPageable paging = PageRequest.of(search.getPageable().getPage(),search.getPageable().getSize());\n\t\tPage<Etudiant> pageTuts = etudiantRepository.findAll(spec,paging);\n\t\tList<Etudiant> etu;\n\t\tetu = pageTuts.getContent();\n\t\tMap<String, Object> response = new HashMap<>();\n\t\tresponse.put(\"tutorials\", etu);\n\t\tresponse.put(\"currentPage\", pageTuts.getNumber());\n\t\tresponse.put(\"totalItems\", pageTuts.getTotalElements());\n\t\tresponse.put(\"totalPages\", pageTuts.getTotalPages());\n\n\t\treturn new ResponseEntity<>(response, HttpStatus.OK);\n\t}", "public Status getStatus();", "private void consultPluviometer() {\r\n\t\tResourceBundle bundle = ControladorContexto.getBundle(\"mensaje\");\r\n\t\tResourceBundle bundleLifeCycle = ControladorContexto\r\n\t\t\t\t.getBundle(\"messageLifeCycle\");\r\n\t\tValidacionesAction validate = ControladorContexto\r\n\t\t\t\t.getContextBean(ValidacionesAction.class);\r\n\t\tpluviometerPojoSubList = new ArrayList<PluviometerPojo>();\r\n\t\tList<SelectItem> parameters = new ArrayList<SelectItem>();\r\n\t\tStringBuilder consult = new StringBuilder();\r\n\t\tStringBuilder unionSearchMessages = new StringBuilder();\r\n\t\tString searchMessages = \"\";\r\n\t\ttry {\r\n\t\t\tadvancedSearch(consult, parameters, bundle, unionSearchMessages);\r\n\t\t\tList<Pluviometer> pluviometerList = pluviometerDao\r\n\t\t\t\t\t.consultPluviometer(consult, parameters);\r\n\t\t\tpluviometerPojoList = new ArrayList<PluviometerPojo>();\r\n\t\t\tif (pluviometerList != null) {\r\n\t\t\t\tfor (Pluviometer pluviometer : pluviometerList) {\r\n\t\t\t\t\tDate date = pluviometer.getDateRecord();\r\n\t\t\t\t\tif (pluviometerPojo == null\r\n\t\t\t\t\t\t\t|| !((date.after(pluviometerPojo.getStartWeek()) && date\r\n\t\t\t\t\t\t\t\t\t.before(pluviometerPojo.getEndWeek())))) {\r\n\t\t\t\t\t\tpluviometerPojo = new PluviometerPojo();\r\n\t\t\t\t\t\tpluviometerPojo.setWeek(ControladorFechas\r\n\t\t\t\t\t\t\t\t.getNumberWeek(pluviometer.getDateRecord()));\r\n\t\t\t\t\t\tpluviometerPojo.setStartWeek(ControladorFechas\r\n\t\t\t\t\t\t\t\t.diaInicialSemana(pluviometer.getDateRecord()));\r\n\t\t\t\t\t\tpluviometerPojo.setEndWeek(ControladorFechas\r\n\t\t\t\t\t\t\t\t.diaFinalSemana(pluviometer.getDateRecord()));\r\n\t\t\t\t\t\tpluviometerPojo.setTotal(0);\r\n\t\t\t\t\t\tpluviometerPojo.setVector(new int[7]);\r\n\t\t\t\t\t\tpluviometerPojoList.add(pluviometerPojo);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tint numberDay = ControladorFechas.getNumberDay(date);\r\n\t\t\t\t\tif (numberDay != 1) {\r\n\t\t\t\t\t\tnumberDay = numberDay - 1;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tnumberDay = 7;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpluviometerPojo.setVectorPos(numberDay - 1,\r\n\t\t\t\t\t\t\tpluviometer.getReading());\r\n\t\t\t\t\tpluviometerPojo.setTotal(pluviometerPojo.getTotal()\r\n\t\t\t\t\t\t\t+ pluviometer.getReading());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tlong amount = (long) pluviometerPojoList.size();\r\n\t\t\tpagination.paginar(amount);\r\n\t\t\tint totalReg = pagination.getRango();\r\n\t\t\tint start = pagination.getInicio();\r\n\t\t\tint rank = start + totalReg;\r\n\t\t\tif (pluviometerPojoList.size() < rank) {\r\n\t\t\t\trank = pluviometerPojoList.size();\r\n\t\t\t}\r\n\t\t\tthis.pluviometerPojoSubList = pluviometerPojoList.subList(start,\r\n\t\t\t\t\trank);\r\n\t\t\tif ((pluviometerPojoList == null || pluviometerPojoList.size() <= 0)\r\n\t\t\t\t\t&& !\"\".equals(unionSearchMessages.toString())) {\r\n\t\t\t\tsearchMessages = MessageFormat\r\n\t\t\t\t\t\t.format(bundle\r\n\t\t\t\t\t\t\t\t.getString(\"message_no_existen_registros_criterio_busqueda\"),\r\n\t\t\t\t\t\t\t\tunionSearchMessages);\r\n\t\t\t} else if (pluviometerPojoList == null\r\n\t\t\t\t\t|| pluviometerPojoList.size() <= 0) {\r\n\t\t\t\tControladorContexto.mensajeInformacion(null,\r\n\t\t\t\t\t\tbundle.getString(\"message_no_existen_registros\"));\r\n\t\t\t} else if (!\"\".equals(unionSearchMessages.toString())) {\r\n\t\t\t\tsearchMessages = MessageFormat\r\n\t\t\t\t\t\t.format(bundle\r\n\t\t\t\t\t\t\t\t.getString(\"message_existen_registros_criterio_busqueda\"),\r\n\t\t\t\t\t\t\t\tbundleLifeCycle.getString(\"rain_gauge_label_s\"),\r\n\t\t\t\t\t\t\t\tunionSearchMessages);\r\n\t\t\t}\r\n\t\t\tvalidate.setMensajeBusqueda(searchMessages);\r\n\t\t} catch (Exception e) {\r\n\t\t\tControladorContexto.mensajeError(e);\r\n\t\t}\r\n\t}", "public interface DataKPU {\n @GET(\"open/v1/api.php?cmd=wilayah_browse&\")\n Call<RWilayah> wilayah_browse(@Query(\"wilayah_id\") String idWil);\n}", "public List getFiAvailableInvoices(FiAvailableInvoice fiAvailableInvoice);", "public interface RestApi {\n\n @GET(\"/ride.asp\")\n Call<List<Model>> getData (@Query(\"userid\") int userId,\n @Query(\"from_name\") String fromName,\n @Query(\"from_lat\") double lat,\n @Query(\"from_lng\") double lng,\n @Query(\"to_name\") String toName,\n @Query(\"to_lat\") double toLat,\n @Query(\"to_lng\") double toLng,\n @Query(\"time\") long time);\n}", "public List<DashboardIndicatorComparasionModel> getIusDataForCpisHome(Integer selectedLang);", "@Override\n public List<Transaksi> getAll() {\n List<Transaksi> listTransaksi = new ArrayList<>();\n\n try {\n String query = \"SELECT id, date_format(tgl_transaksi, '%d-%m-%Y') AS tgl_transaksi FROM transaksi\";\n\n PreparedStatement ps = Koneksi().prepareStatement(query);\n ResultSet rs = ps.executeQuery();\n\n while (rs.next()) {\n Transaksi transaksi = new Transaksi();\n\n transaksi.setId(rs.getString(\"id\"));\n transaksi.setTglTransaksi(rs.getString(\"tgl_transaksi\"));\n\n listTransaksi.add(transaksi);\n }\n } catch (SQLException se) {\n se.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return listTransaksi;\n }", "public void Get() { ob = ti.Get(currentrowi, \"persoana\"); ID = ti.ID; CNP = ob[0]; Nume = ob[1]; Prenume = ob[2]; }", "private void getDataKitabKuning(){\n UserAPIService api = Config.getRetrofit().create(UserAPIService.class);\n Call<Value> call = api.lihat_program_like(\"Kitab Kuning\");\n call.enqueue(new Callback<Value>() {\n @Override\n public void onResponse(Call<Value> call, Response<Value> response) {\n// pDialog.dismiss();\n String value1 = response.body().getStatus();\n if (value1.equals(\"1\")){\n Value value = response.body();\n resultAlls = new ArrayList<>(Arrays.asList(value.getResult()));\n adapter = new RecyclerAdapterListAll(resultAlls,getApplicationContext());\n recyclerView.setAdapter(adapter);\n }else {\n Toast.makeText(ListPonpesActivity.this,\"Maaf Data Tidak Ada\",Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onFailure(Call<Value> call, Throwable t) {\n // pDialog.dismiss();\n Toast.makeText(ListPonpesActivity.this,\"Respon gagal\",Toast.LENGTH_SHORT).show();\n Log.d(\"Hasil internet\",t.toString());\n }\n });\n }", "private void getData(){\n UserAPIService api = Config.getRetrofit().create(UserAPIService.class);\n Call<Value> call = api.getJSON();\n call.enqueue(new Callback<Value>() {\n @Override\n public void onResponse(Call<Value> call, Response<Value> response) {\n// pDialog.dismiss();\n String value1 = response.body().getStatus();\n if (value1.equals(\"1\")) {\n Value value = response.body();\n resultAlls = new ArrayList<>(Arrays.asList(value.getResult()));\n adapter = new RecyclerAdapterListAll(resultAlls, getApplicationContext());\n recyclerView.setAdapter(adapter);\n }else{\n Toast.makeText(ListPonpesActivity.this,\"Maaf Data Tidak Ada\",Toast.LENGTH_SHORT).show();\n\n }\n }\n\n @Override\n public void onFailure(Call<Value> call, Throwable t) {\n // pDialog.dismiss();\n Toast.makeText(ListPonpesActivity.this,\"Respon gagal\",Toast.LENGTH_SHORT).show();\n Log.d(\"Hasil internet\",t.toString());\n }\n });\n }" ]
[ "0.57930875", "0.57756174", "0.57678396", "0.5706893", "0.56750846", "0.56646216", "0.5663888", "0.56603354", "0.56313264", "0.5605635", "0.55964375", "0.55869246", "0.5585885", "0.55769235", "0.55761105", "0.5564627", "0.5537621", "0.5535061", "0.5517393", "0.55024445", "0.5498387", "0.547685", "0.5472398", "0.54701865", "0.546598", "0.5463736", "0.54569864", "0.5453764", "0.5453258", "0.5444619", "0.5442892", "0.5430048", "0.5418712", "0.5409814", "0.5398518", "0.5392346", "0.5383673", "0.53814465", "0.53796655", "0.53728306", "0.53702205", "0.53698736", "0.535687", "0.53550965", "0.5352902", "0.535131", "0.53508496", "0.53475827", "0.53458625", "0.534385", "0.5343494", "0.5343017", "0.5340744", "0.5340722", "0.5336341", "0.53321093", "0.5331453", "0.53313434", "0.532241", "0.53202707", "0.5318478", "0.5317062", "0.5313389", "0.531019", "0.53046924", "0.53043276", "0.5298906", "0.52907884", "0.5290208", "0.5289097", "0.52885115", "0.52787364", "0.52745616", "0.5273542", "0.52712435", "0.5265109", "0.5262428", "0.5262311", "0.52614915", "0.52607775", "0.5256671", "0.52536047", "0.5246406", "0.5237594", "0.52361435", "0.5235735", "0.5227464", "0.5224182", "0.5220874", "0.52173376", "0.5213187", "0.52129716", "0.52117074", "0.5208545", "0.52031344", "0.5199058", "0.51974356", "0.5196671", "0.5196204", "0.519619" ]
0.54497033
29
add to local list
@Override public void run() { chatAdapter.notifyDataSetChanged(); chatListView.postInvalidate(); chatListView.smoothScrollToPosition(chatAdapter.getCount()); // input.setText(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void addList() {\n\t}", "public TempList<T> add(T elem) {\n chk();\n list.add(elem);\n return this;\n }", "private void add() {\n\n\t}", "private void addToList (IGameState state, MoveEvaluation m) {\n\t\tlist.append(new Pair(state.copy(), m));\n\t}", "public void add(Object o){\n list.add(o);\n }", "public void addList(String name){\n }", "public void add(List<?> list) {\n list.clear();\n pool.offer(list);\n }", "public void addLocalVariable(LocalVariable localVariable) {\n\t\tlocalVariables.add(localVariable);\n\t}", "public void addPart(ArrayList<Part> pList) {\n\t\tpartsCollected.addAll(pList);\n\t}", "public void addFriendList(FriendList list);", "public void add(){\n list.add(smart);\n list.add(mega);\n list.add(smartMini);\n list.add(absolute);\n\n clientsList.add(client1);\n clientsList.add(client2);\n clientsList.add(client3);\n clientsList.add(client4);\n clientsList.add(client5);\n }", "public void addEntryToList(String entry){\n\t\tlogList.add(entry);\n\t}", "public void add() {\n\t\t\n\t}", "public void addToList(Song song, boolean a) {\n\t\tthis.getCurrentList(a).heapInsert(song);\n\t\tsong.setIndex(a, this.getCurrentList(a).getHeapSize());\n\t}", "private ArrayList<Node<T>> addAll(Node<T> current, ArrayList<Node<T>> list) {\n\t\tlist.add(current);\n\t\tif (current.getLeft() != null) {\n\t\t\tlist = addAll(current.getLeft(), list);\n\t\t}\n\t\t\n\t\tif (current.getRight() != null) {\n\t\t\tlist = addAll(current.getRight(), list);\n\t\t}\n\t\t\n\t\treturn list;\n\t}", "IList<T> add(T t);", "public void add(String text) {\n list.add(text);\n }", "public void addPatientToList(Patient tempPatient)\r\n\t{\r\n\t\tarrayPatients[nextPatientLocation] = tempPatient;\r\n\t\tnextPatientLocation++;\r\n\t}", "public void appendInPlace (List l) {\n\t\tif (this.isEmpty()) {\n\t\t\tmyHead = l.myHead;\n\t\t\tmySize = l.mySize;\n\t\t\tmyTail = l.myTail;\n\t\t}\n\t\telse if (l.isEmpty()) {\n\t\t\treturn;\n\t\t}\n\t\telse {\n\t\t\tmyTail.myNext = l.myHead;\n\t\t\tmyTail = l.myTail;\n\t\t\tmySize += l.mySize;\n\t\t}\n\t}", "public void addItem(Item param) {\r\n if (localItem == null) {\r\n localItem = new Item[] { };\r\n }\r\n\r\n //update the setting tracker\r\n localItemTracker = true;\r\n\r\n java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localItem);\r\n list.add(param);\r\n this.localItem = (Item[]) list.toArray(new Item[list.size()]);\r\n }", "private synchronized void addResultToMultiList() {\n\t addObjectToMultiList(resultArrayList);\r\n\t }", "private void addMove(ArrayList<Move> l, Move m) {\n if (m.valid() && isLegal(m)) {\n l.add(m);\n }\n }", "void addAll(intList list) throws IllegalAccessException;", "public gov.nih.nlm.ncbi.www.SeqIdDocument.SeqId.Local addNewLocal()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n gov.nih.nlm.ncbi.www.SeqIdDocument.SeqId.Local target = null;\r\n target = (gov.nih.nlm.ncbi.www.SeqIdDocument.SeqId.Local)get_store().add_element_user(LOCAL$0);\r\n return target;\r\n }\r\n }", "public void AddList( TColStd_HSequenceOfTransient list) {\n OCCwrapJavaJNI.Interface_EntityIterator_AddList(swigCPtr, this, TColStd_HSequenceOfTransient.getCPtr(list) , list);\n }", "public static void addLocalItems(Player player, Set<Integer> itemIds) {\n\t\tLocationManager.getLocalPlayers(player.getFloor(), player.getTileId(), 15)\n\t\t\t.forEach(localPlayer -> addItems(localPlayer, itemIds));\n//\t\tfor (Player localPlayer : localPlayers)\n//\t\t\taddItems(localPlayer, itemIds);\n\t}", "public void addALl(List<T> list){\n for(int i = 0; i < list.size(); i++){\n add(list.get(i));\n }\n }", "protected <T> ArrayList<T> addToList(ArrayList<T> l, T value)\n {\n if (l == null) {\n l = new ArrayList<T>();\n }\n l.add(value);\n return l;\n }", "private void addRewardToList(double[] playVector, double reward) \n\t{\n\t\t\n\t\tint index = deepContainsArray(valueArrayList,playVector);\n\t\tif (index != -1)\t\t\t\t\t\t//if it's already been added before, append the reward\n\t\t{\t\n\t\t\tdouble[] rewards = rewardList.get(index);\n\t\t\trewards = Arrays.copyOf(rewards,rewards.length+1);\n\t\t\trewards[rewards.length-1] = reward;\n\t\t\trewardList.set(index, rewards);\n\t\t}\n\t\telse\t\t\t\t\t\t\t\t//if it isn't, add both the vector and the reward\n\t\t{\n\t\t\tvalueArrayList.add(playVector); //add to ArrayList too!\n\t\t\tdouble [] rewardArray = {reward};\n\t\t\trewardList.add(rewardArray);\n\t\t}\n\t\t\n\t}", "public void add(String str) {\r\n list.add(str);\r\n }", "public void addNewScope(){\n List<String> varScope = new ArrayList<>();\n newVarInCurrentScope.add(varScope);\n\n List<String> objScope = new ArrayList<>();\n newObjInCurrentScope.add(objScope);\n }", "public void addList()\n\t{\n\t\tdlm_patch.clear();\n\t\tif (pf.getAllPatch_DB() != null)\n\t\t{\n\t\t\tfor ( Patch p : pf.getAllPatch_DB() )\n\t\t\t\tdlm_patch.addElement(p);\n\t\t}\n\t}", "@Override\n public void addToOpenList(AState state) throws Exception {\n if (state == null)\n throw new IllegalArgumentException(\"State cannot be null\");\n openList.add(state);\n }", "public void addNewFiles(java.lang.String param){\r\n if (localNewFiles == null){\r\n localNewFiles = new java.lang.String[]{};\r\n }\r\n\r\n \r\n //update the setting tracker\r\n localNewFilesTracker = true;\r\n \r\n\r\n java.util.List list =\r\n org.apache.axis2.databinding.utils.ConverterUtil.toList(localNewFiles);\r\n list.add(param);\r\n this.localNewFiles =\r\n (java.lang.String[])list.toArray(\r\n new java.lang.String[list.size()]);\r\n\r\n }", "public void addElement(Integer e){\n list.add(e);\n }", "public void addToStopList(Stop s){ this.stopList.add(s); }", "void addList(ShoppingList _ShoppingList);", "public RTWLocation append(Object... list);", "void addAll(intList list, int index) throws IllegalAccessException;", "private static final <T> List<T> append(List<T> list, T newElement) {\n List<T> newList = Lists.newArrayListWithCapacity(list.size() + 1);\n newList.addAll(list);\n newList.add(newElement);\n return newList;\n }", "void addScope() {\n\t\tlist.addFirst(new HashMap<String, Sym>());\n\t}", "public void add();", "public void add() {\n }", "public void addProductToList(Product aProduct){\n listOfProduct.add(aProduct);\n }", "public void setList(DOCKSList param) {\r\n localListTracker = param != null;\r\n\r\n this.localList = param;\r\n }", "@Override\n\tpublic void add(T t) {\n\t\tc.add(t);\n\t}", "IList<T> append(IList<T> l);", "public void addFact(Fact param) {\r\n if (localFact == null) {\r\n localFact = new Fact[]{};\r\n }\r\n\r\n\r\n //update the setting tracker\r\n localFactTracker = true;\r\n\r\n\r\n java.util.List list =\r\n org.apache.axis2.databinding.utils.ConverterUtil.toList(localFact);\r\n list.add(param);\r\n this.localFact =\r\n (Fact[]) list.toArray(\r\n new Fact[list.size()]);\r\n\r\n }", "private void addFriendList(People value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureFriendListIsMutable();\n friendList_.add(value);\n }", "@Override\n\tpublic void add() {\n\t\t\n\t}", "private void addActiveCourseListToCourseList() {\n courseList.addCoursesToList(activeCourseList);\n activeCourseList = new ArrayList<>();\n System.out.println(\"Added and Cleared!\");\n }", "public void addLocations(List<Location> listOfLocation)\n {\n this.locationLst.addAll(listOfLocation);\n }", "public IList<T> append(IList<T> l) {\n return l;\n }", "@Override\n public void addCacheList(ArrayList<String> cacheList) {\n scanList = cacheList;\n }", "@Override\n public void add(LocalDateTime date, List<Gadget> list) {\n orders.put(date, list);\n }", "public void givePlaceInList() {\r\n\t\tmyPlaceInList = allyTracker.getPlaceInList();\r\n\t}", "public org.openxmlformats.schemas.presentationml.x2006.main.CTExtensionList addNewExtLst()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.openxmlformats.schemas.presentationml.x2006.main.CTExtensionList target = null;\n target = (org.openxmlformats.schemas.presentationml.x2006.main.CTExtensionList)get_store().add_element_user(EXTLST$14);\n return target;\n }\n }", "public final void addToInitList() {\n\t\tEngine.getSingleton().addToInitList(this);\n\t}", "public void addToFreeList(V value) {\n this.mFreeList.add(value);\n }", "public void addToList() {\n addToCurrentListButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n //getting the variables from the user input\n String address = enterAddress.getText();\n String issue = enterAddress.getText();\n String model = enterModel.getText();\n //date method\n Date date = new Date();\n //creating a quick CentralAC list\n CentralAC acEntry = new CentralAC(address, issue, date, model);\n //adding items to the Arraylist\n HVACGUI.newCentralAC.add(acEntry);\n //adding items to the default list model\n HVACGUI.openService.addElement(acEntry);\n //disposing the form\n CentralAC_GUI.this.dispose();\n\n\n }\n });\n }", "public PlayList[] addPlayList(String namePlayList){\n boolean space2 = false;\n for(int i = 0; i<MAX_PLAYLIST && !space2; i++){\n if(thePlayLists[i] == null){\n PlayList publicPlayList = new PublicP(namePlayList);\n thePlayLists[i] = publicPlayList;\n numPlayList++;\n space2 = true;\n }\n }\n return thePlayLists;\n }", "public void updateList() {\n\t\tthis.myList.clear();\n\t\tIterator<String> item = this.myHashMap.keySet().iterator();\n\n\t\twhile (item.hasNext())\n\t\t{\n\t\t\tString name = (String)item.next();\n\t\t\tthis.myList.add(name);\n\t\t}\n\t\tthis.nameId = -1;\n\t\t\n\t}", "private void add() {\n\t\tlist = new ArrayList<Fragment>();\n\t\tlist.add(new HomeFragment());\n\t\tlist.add(new MenuFragment());\n\t\tlist.add(new FriendsFragment());\n\t\tlist.add(new MineFragment());\n\t}", "@SuppressWarnings (\"unchecked\") public void addAll(ItemList list){\n items.addAll(list.items);\n }", "private void inorderHelper(ArrayList<T> list, BSTNode<T> current) {\n if (current.getLeft() != null) {\n inorderHelper(list, current.getLeft());\n }\n list.add(current.getData());\n if (current.getRight() != null) {\n inorderHelper(list, current.getRight());\n }\n }", "@Override\n\tpublic void push(Object x) {\n\t\tlist.addFirst(x);\n\t}", "public void cbListAddElement() {\n cbWorker.clear();\n cbWorker.add(cbJ);\n cbWorker.add(cbK);\n cbWorker.add(cbM);\n cbWorker.add(cbP);\n cbWorker.add(cbA);\n cbWorker.add(cbS);\n }", "public void add(int v) {\n if (empty) {\n x = v;\n empty = false;\n }\n else {\n if (next == null) {\n next = new Lista(v);\n }\n else {\n Lista iter = new Lista(this);\n while (iter.next != null) {\n iter = iter.next;\n }\n iter.next = new Lista(v);\n } \n }\n }", "public void addFilters(cwterm.service.rigctl.xsd.Filter param) {\n if (localFilters == null) {\n localFilters = new cwterm.service.rigctl.xsd.Filter[] {};\n }\n localFiltersTracker = true;\n java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localFilters);\n list.add(param);\n this.localFilters = (cwterm.service.rigctl.xsd.Filter[]) list.toArray(new cwterm.service.rigctl.xsd.Filter[list.size()]);\n }", "public void addToCache () {\n ArrayList <Location> gridCache = getGridCache();\n for (Location l : imageLocs) {\n gridCache.add (l);\n }\n }", "public void add(List<SermCit> citList){\n //Add one by one\n for (SermCit x : citList){\n add(x);\n }\n }", "public void addResultList(String path) {\n synchronized (this.paths) {\n this.paths.add(path);\n }\n }", "@Override\n public void add(Object item)\n {\n if (size == list.length)\n {\n Object [] itemInListCurrently = deepCopy();\n list = new Object[size * 2];\n\n System.arraycopy(itemInListCurrently, 0, list, 0, size);\n }\n\n list[size++] = item;\n }", "private Node<E> add(Node<E> localRoot, E item) {\n if (localRoot == null) {\n addReturn = true;\n return new Node<E>(item);\n } else if (item.compareTo(localRoot.data) == 0) {\n addReturn = false;\n return localRoot;\n } else if (item.compareTo(localRoot.data) < 0) {\n localRoot.left = add(localRoot.left, item);\n return localRoot;\n } else {\n localRoot.right = add(localRoot.right, item);\n return localRoot;\n }\n }", "public void addTaskListRecNum(int recnum) { taskListRecNums.add(recnum); }", "public void add(String name)\n/* 15: */ {\n/* 16:14 */ this.members.add(name);\n/* 17: */ }", "public void addElement(Integer elem){\n\t\tlist.add(elem);\n\t}", "@Override\n\tpublic void add(L value) {\n\t\tif(value==null) throw new NullPointerException();\n\t\tListNode<L> newNode=new ListNode<>(value);\n newNode.storage=value;\n newNode.next=null;\n newNode.previous=last;\n if(last==null){\n first=newNode;\n }else {\n last.next=newNode;\n }\n last=newNode;\n\t\tthis.size++;\n\t\tthis.modificationCount++;\n\t}", "@Override\r\n\tpublic void add(T element) {\n\t\tthis._list.add(element);\r\n\t}", "synchronized void crawledList_add(HashSet _crawledList, String url)\n {\n _crawledList.add(url);\n System.out.println(\"Added\"+\"\\t\"+url);\n }", "public void add() {\n\n }", "public void addVertex (){\t\t \n\t\tthis.graph.insert( new MyList<Integer>() );\n\t}", "public boolean add(List<T> e) {\n\t\treturn lists.add(e);\n\t}", "public void addLVA(LV l) {\r\n ZugewieseneLV.add(l);\r\n }", "public void add(E elem) {\n if (!list.contains(elem))\n list.insertLast(elem);\n }", "public void add() {\n\t\tcart.add(item.createCopy());\n\t}", "public static void push(Object data) {\n list.add(data);\n }", "public void addToList(int cap) {\n\t\t\tRoomList.addToList(cap);\r\n\t\t}", "public void m65918a(List<SearchTrack> list) {\n SpotifyTrackSearchTarget spotifyTrackSearchTarget = (SpotifyTrackSearchTarget) this.f56358a.H();\n if (spotifyTrackSearchTarget != null) {\n this.f56358a.f56363e = true;\n spotifyTrackSearchTarget.addTracks(list);\n this.f56358a.f56361c = this.f56358a.f56361c + 1;\n }\n }", "static List<StateRef> append(List<StateRef> l1, List<StateRef> l2) {\n l1.addAll(l2);\n return l1;\n }", "public void addItemtoInventoryList(String item) {\r\n InventoryList.add(item);\r\n }", "public boolean addList(ArrayList<Npcinfo> NpcinfoList);", "private List<LocalAlbum> convertToLocalAlbumsList(List<Album> albumList){\n List<LocalAlbum> list = new ArrayList<>();\n for (Album album : albumList) {\n LocalAlbum localAlbum = new LocalAlbum(album.getAlbumId(),album.getId(),album.getTitle(),album.getUrl(),album.getThumbnailUrl());\n list.add(localAlbum);\n localAlbum.save();\n }\n return list;\n }", "void addListing(Listing<P, C> listing) {\n this.collectionOfCurrentListings.add(listing);\n }", "public synchronized void addList(int[] list) {\r\n listsOfSorted.offer(list);\r\n }", "public void addInventoryList(ArrayList<? extends Item> toAddList){\n\t\tinventoryList.addAll(toAddList);\n\t}", "public void add_return(User param){\r\n if (local_return == null){\r\n local_return = new User[]{};\r\n }\r\n\r\n \r\n //update the setting tracker\r\n local_returnTracker = true;\r\n \r\n\r\n java.util.List list =\r\n org.apache.axis2.databinding.utils.ConverterUtil.toList(local_return);\r\n list.add(param);\r\n this.local_return =\r\n (User[])list.toArray(\r\n new User[list.size()]);\r\n\r\n }", "public void addToList(Vertex newVertex)\n\t{\n\t\tadjacencyList.add(newVertex);\n\t\tupdateIndegree();\n\t}", "void addItem (Item toAdd){\n\t\t\tthis.items.add(toAdd);}", "public Vector2f addLocal (Vector2f other)\n {\n return add(other, this);\n }", "public void addElement(Replicated obj)\r\n\t{\n\t\tinsert(obj, seq.size());\r\n\t}" ]
[ "0.6899728", "0.6379032", "0.63095164", "0.6304549", "0.6206425", "0.61161435", "0.60938996", "0.60761184", "0.60517275", "0.603062", "0.60178185", "0.6010226", "0.59783924", "0.5972209", "0.59315705", "0.59313333", "0.5910321", "0.5896465", "0.58797455", "0.586597", "0.5844927", "0.58369356", "0.5832794", "0.58275265", "0.5800365", "0.5797036", "0.57913846", "0.5785643", "0.5784966", "0.5776653", "0.576975", "0.57567275", "0.57558304", "0.5738962", "0.57340884", "0.57329166", "0.5731907", "0.5727281", "0.5726255", "0.57233244", "0.5722965", "0.5706362", "0.5701415", "0.5695841", "0.5686625", "0.5676488", "0.56740344", "0.56677437", "0.5666337", "0.5662039", "0.5653514", "0.5642295", "0.5639982", "0.5636014", "0.5621214", "0.5614735", "0.5608366", "0.5599441", "0.55985904", "0.55968297", "0.5586209", "0.5583652", "0.55701566", "0.55626076", "0.555509", "0.5546943", "0.5546338", "0.55415064", "0.5538929", "0.5535412", "0.553434", "0.5533021", "0.5531091", "0.55280364", "0.55264044", "0.55232203", "0.551561", "0.5511694", "0.5507061", "0.5503712", "0.5498008", "0.5490031", "0.5486961", "0.5484194", "0.54836935", "0.54834163", "0.5483071", "0.5479602", "0.5479532", "0.5465784", "0.5465501", "0.54624116", "0.5460706", "0.54579306", "0.5455845", "0.5455515", "0.5452769", "0.5448579", "0.54446703", "0.54441893", "0.5441143" ]
0.0
-1
add to local list
@Override public void run() { chatAdapter.notifyDataSetChanged(); chatListView.postInvalidate(); input.setText(""); chatListView.smoothScrollToPosition(chatAdapter.getCount()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void addList() {\n\t}", "public TempList<T> add(T elem) {\n chk();\n list.add(elem);\n return this;\n }", "private void add() {\n\n\t}", "private void addToList (IGameState state, MoveEvaluation m) {\n\t\tlist.append(new Pair(state.copy(), m));\n\t}", "public void add(Object o){\n list.add(o);\n }", "public void addList(String name){\n }", "public void add(List<?> list) {\n list.clear();\n pool.offer(list);\n }", "public void addLocalVariable(LocalVariable localVariable) {\n\t\tlocalVariables.add(localVariable);\n\t}", "public void addPart(ArrayList<Part> pList) {\n\t\tpartsCollected.addAll(pList);\n\t}", "public void addFriendList(FriendList list);", "public void add(){\n list.add(smart);\n list.add(mega);\n list.add(smartMini);\n list.add(absolute);\n\n clientsList.add(client1);\n clientsList.add(client2);\n clientsList.add(client3);\n clientsList.add(client4);\n clientsList.add(client5);\n }", "public void addEntryToList(String entry){\n\t\tlogList.add(entry);\n\t}", "public void add() {\n\t\t\n\t}", "public void addToList(Song song, boolean a) {\n\t\tthis.getCurrentList(a).heapInsert(song);\n\t\tsong.setIndex(a, this.getCurrentList(a).getHeapSize());\n\t}", "private ArrayList<Node<T>> addAll(Node<T> current, ArrayList<Node<T>> list) {\n\t\tlist.add(current);\n\t\tif (current.getLeft() != null) {\n\t\t\tlist = addAll(current.getLeft(), list);\n\t\t}\n\t\t\n\t\tif (current.getRight() != null) {\n\t\t\tlist = addAll(current.getRight(), list);\n\t\t}\n\t\t\n\t\treturn list;\n\t}", "IList<T> add(T t);", "public void add(String text) {\n list.add(text);\n }", "public void addPatientToList(Patient tempPatient)\r\n\t{\r\n\t\tarrayPatients[nextPatientLocation] = tempPatient;\r\n\t\tnextPatientLocation++;\r\n\t}", "public void appendInPlace (List l) {\n\t\tif (this.isEmpty()) {\n\t\t\tmyHead = l.myHead;\n\t\t\tmySize = l.mySize;\n\t\t\tmyTail = l.myTail;\n\t\t}\n\t\telse if (l.isEmpty()) {\n\t\t\treturn;\n\t\t}\n\t\telse {\n\t\t\tmyTail.myNext = l.myHead;\n\t\t\tmyTail = l.myTail;\n\t\t\tmySize += l.mySize;\n\t\t}\n\t}", "public void addItem(Item param) {\r\n if (localItem == null) {\r\n localItem = new Item[] { };\r\n }\r\n\r\n //update the setting tracker\r\n localItemTracker = true;\r\n\r\n java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localItem);\r\n list.add(param);\r\n this.localItem = (Item[]) list.toArray(new Item[list.size()]);\r\n }", "private synchronized void addResultToMultiList() {\n\t addObjectToMultiList(resultArrayList);\r\n\t }", "private void addMove(ArrayList<Move> l, Move m) {\n if (m.valid() && isLegal(m)) {\n l.add(m);\n }\n }", "void addAll(intList list) throws IllegalAccessException;", "public gov.nih.nlm.ncbi.www.SeqIdDocument.SeqId.Local addNewLocal()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n gov.nih.nlm.ncbi.www.SeqIdDocument.SeqId.Local target = null;\r\n target = (gov.nih.nlm.ncbi.www.SeqIdDocument.SeqId.Local)get_store().add_element_user(LOCAL$0);\r\n return target;\r\n }\r\n }", "public void AddList( TColStd_HSequenceOfTransient list) {\n OCCwrapJavaJNI.Interface_EntityIterator_AddList(swigCPtr, this, TColStd_HSequenceOfTransient.getCPtr(list) , list);\n }", "public static void addLocalItems(Player player, Set<Integer> itemIds) {\n\t\tLocationManager.getLocalPlayers(player.getFloor(), player.getTileId(), 15)\n\t\t\t.forEach(localPlayer -> addItems(localPlayer, itemIds));\n//\t\tfor (Player localPlayer : localPlayers)\n//\t\t\taddItems(localPlayer, itemIds);\n\t}", "public void addALl(List<T> list){\n for(int i = 0; i < list.size(); i++){\n add(list.get(i));\n }\n }", "protected <T> ArrayList<T> addToList(ArrayList<T> l, T value)\n {\n if (l == null) {\n l = new ArrayList<T>();\n }\n l.add(value);\n return l;\n }", "private void addRewardToList(double[] playVector, double reward) \n\t{\n\t\t\n\t\tint index = deepContainsArray(valueArrayList,playVector);\n\t\tif (index != -1)\t\t\t\t\t\t//if it's already been added before, append the reward\n\t\t{\t\n\t\t\tdouble[] rewards = rewardList.get(index);\n\t\t\trewards = Arrays.copyOf(rewards,rewards.length+1);\n\t\t\trewards[rewards.length-1] = reward;\n\t\t\trewardList.set(index, rewards);\n\t\t}\n\t\telse\t\t\t\t\t\t\t\t//if it isn't, add both the vector and the reward\n\t\t{\n\t\t\tvalueArrayList.add(playVector); //add to ArrayList too!\n\t\t\tdouble [] rewardArray = {reward};\n\t\t\trewardList.add(rewardArray);\n\t\t}\n\t\t\n\t}", "public void add(String str) {\r\n list.add(str);\r\n }", "public void addNewScope(){\n List<String> varScope = new ArrayList<>();\n newVarInCurrentScope.add(varScope);\n\n List<String> objScope = new ArrayList<>();\n newObjInCurrentScope.add(objScope);\n }", "public void addList()\n\t{\n\t\tdlm_patch.clear();\n\t\tif (pf.getAllPatch_DB() != null)\n\t\t{\n\t\t\tfor ( Patch p : pf.getAllPatch_DB() )\n\t\t\t\tdlm_patch.addElement(p);\n\t\t}\n\t}", "@Override\n public void addToOpenList(AState state) throws Exception {\n if (state == null)\n throw new IllegalArgumentException(\"State cannot be null\");\n openList.add(state);\n }", "public void addNewFiles(java.lang.String param){\r\n if (localNewFiles == null){\r\n localNewFiles = new java.lang.String[]{};\r\n }\r\n\r\n \r\n //update the setting tracker\r\n localNewFilesTracker = true;\r\n \r\n\r\n java.util.List list =\r\n org.apache.axis2.databinding.utils.ConverterUtil.toList(localNewFiles);\r\n list.add(param);\r\n this.localNewFiles =\r\n (java.lang.String[])list.toArray(\r\n new java.lang.String[list.size()]);\r\n\r\n }", "public void addElement(Integer e){\n list.add(e);\n }", "void addList(ShoppingList _ShoppingList);", "public void addToStopList(Stop s){ this.stopList.add(s); }", "public RTWLocation append(Object... list);", "void addAll(intList list, int index) throws IllegalAccessException;", "private static final <T> List<T> append(List<T> list, T newElement) {\n List<T> newList = Lists.newArrayListWithCapacity(list.size() + 1);\n newList.addAll(list);\n newList.add(newElement);\n return newList;\n }", "void addScope() {\n\t\tlist.addFirst(new HashMap<String, Sym>());\n\t}", "public void add();", "public void add() {\n }", "public void addProductToList(Product aProduct){\n listOfProduct.add(aProduct);\n }", "public void setList(DOCKSList param) {\r\n localListTracker = param != null;\r\n\r\n this.localList = param;\r\n }", "@Override\n\tpublic void add(T t) {\n\t\tc.add(t);\n\t}", "IList<T> append(IList<T> l);", "private void addFriendList(People value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureFriendListIsMutable();\n friendList_.add(value);\n }", "public void addFact(Fact param) {\r\n if (localFact == null) {\r\n localFact = new Fact[]{};\r\n }\r\n\r\n\r\n //update the setting tracker\r\n localFactTracker = true;\r\n\r\n\r\n java.util.List list =\r\n org.apache.axis2.databinding.utils.ConverterUtil.toList(localFact);\r\n list.add(param);\r\n this.localFact =\r\n (Fact[]) list.toArray(\r\n new Fact[list.size()]);\r\n\r\n }", "@Override\n\tpublic void add() {\n\t\t\n\t}", "private void addActiveCourseListToCourseList() {\n courseList.addCoursesToList(activeCourseList);\n activeCourseList = new ArrayList<>();\n System.out.println(\"Added and Cleared!\");\n }", "public void addLocations(List<Location> listOfLocation)\n {\n this.locationLst.addAll(listOfLocation);\n }", "public IList<T> append(IList<T> l) {\n return l;\n }", "@Override\n public void addCacheList(ArrayList<String> cacheList) {\n scanList = cacheList;\n }", "@Override\n public void add(LocalDateTime date, List<Gadget> list) {\n orders.put(date, list);\n }", "public void givePlaceInList() {\r\n\t\tmyPlaceInList = allyTracker.getPlaceInList();\r\n\t}", "public org.openxmlformats.schemas.presentationml.x2006.main.CTExtensionList addNewExtLst()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.openxmlformats.schemas.presentationml.x2006.main.CTExtensionList target = null;\n target = (org.openxmlformats.schemas.presentationml.x2006.main.CTExtensionList)get_store().add_element_user(EXTLST$14);\n return target;\n }\n }", "public final void addToInitList() {\n\t\tEngine.getSingleton().addToInitList(this);\n\t}", "public void addToList() {\n addToCurrentListButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n //getting the variables from the user input\n String address = enterAddress.getText();\n String issue = enterAddress.getText();\n String model = enterModel.getText();\n //date method\n Date date = new Date();\n //creating a quick CentralAC list\n CentralAC acEntry = new CentralAC(address, issue, date, model);\n //adding items to the Arraylist\n HVACGUI.newCentralAC.add(acEntry);\n //adding items to the default list model\n HVACGUI.openService.addElement(acEntry);\n //disposing the form\n CentralAC_GUI.this.dispose();\n\n\n }\n });\n }", "public void addToFreeList(V value) {\n this.mFreeList.add(value);\n }", "public PlayList[] addPlayList(String namePlayList){\n boolean space2 = false;\n for(int i = 0; i<MAX_PLAYLIST && !space2; i++){\n if(thePlayLists[i] == null){\n PlayList publicPlayList = new PublicP(namePlayList);\n thePlayLists[i] = publicPlayList;\n numPlayList++;\n space2 = true;\n }\n }\n return thePlayLists;\n }", "public void updateList() {\n\t\tthis.myList.clear();\n\t\tIterator<String> item = this.myHashMap.keySet().iterator();\n\n\t\twhile (item.hasNext())\n\t\t{\n\t\t\tString name = (String)item.next();\n\t\t\tthis.myList.add(name);\n\t\t}\n\t\tthis.nameId = -1;\n\t\t\n\t}", "private void add() {\n\t\tlist = new ArrayList<Fragment>();\n\t\tlist.add(new HomeFragment());\n\t\tlist.add(new MenuFragment());\n\t\tlist.add(new FriendsFragment());\n\t\tlist.add(new MineFragment());\n\t}", "@SuppressWarnings (\"unchecked\") public void addAll(ItemList list){\n items.addAll(list.items);\n }", "private void inorderHelper(ArrayList<T> list, BSTNode<T> current) {\n if (current.getLeft() != null) {\n inorderHelper(list, current.getLeft());\n }\n list.add(current.getData());\n if (current.getRight() != null) {\n inorderHelper(list, current.getRight());\n }\n }", "public void cbListAddElement() {\n cbWorker.clear();\n cbWorker.add(cbJ);\n cbWorker.add(cbK);\n cbWorker.add(cbM);\n cbWorker.add(cbP);\n cbWorker.add(cbA);\n cbWorker.add(cbS);\n }", "@Override\n\tpublic void push(Object x) {\n\t\tlist.addFirst(x);\n\t}", "public void add(int v) {\n if (empty) {\n x = v;\n empty = false;\n }\n else {\n if (next == null) {\n next = new Lista(v);\n }\n else {\n Lista iter = new Lista(this);\n while (iter.next != null) {\n iter = iter.next;\n }\n iter.next = new Lista(v);\n } \n }\n }", "public void addFilters(cwterm.service.rigctl.xsd.Filter param) {\n if (localFilters == null) {\n localFilters = new cwterm.service.rigctl.xsd.Filter[] {};\n }\n localFiltersTracker = true;\n java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localFilters);\n list.add(param);\n this.localFilters = (cwterm.service.rigctl.xsd.Filter[]) list.toArray(new cwterm.service.rigctl.xsd.Filter[list.size()]);\n }", "public void add(List<SermCit> citList){\n //Add one by one\n for (SermCit x : citList){\n add(x);\n }\n }", "public void addToCache () {\n ArrayList <Location> gridCache = getGridCache();\n for (Location l : imageLocs) {\n gridCache.add (l);\n }\n }", "public void addResultList(String path) {\n synchronized (this.paths) {\n this.paths.add(path);\n }\n }", "@Override\n public void add(Object item)\n {\n if (size == list.length)\n {\n Object [] itemInListCurrently = deepCopy();\n list = new Object[size * 2];\n\n System.arraycopy(itemInListCurrently, 0, list, 0, size);\n }\n\n list[size++] = item;\n }", "private Node<E> add(Node<E> localRoot, E item) {\n if (localRoot == null) {\n addReturn = true;\n return new Node<E>(item);\n } else if (item.compareTo(localRoot.data) == 0) {\n addReturn = false;\n return localRoot;\n } else if (item.compareTo(localRoot.data) < 0) {\n localRoot.left = add(localRoot.left, item);\n return localRoot;\n } else {\n localRoot.right = add(localRoot.right, item);\n return localRoot;\n }\n }", "public void addTaskListRecNum(int recnum) { taskListRecNums.add(recnum); }", "public void add(String name)\n/* 15: */ {\n/* 16:14 */ this.members.add(name);\n/* 17: */ }", "public void addElement(Integer elem){\n\t\tlist.add(elem);\n\t}", "@Override\n\tpublic void add(L value) {\n\t\tif(value==null) throw new NullPointerException();\n\t\tListNode<L> newNode=new ListNode<>(value);\n newNode.storage=value;\n newNode.next=null;\n newNode.previous=last;\n if(last==null){\n first=newNode;\n }else {\n last.next=newNode;\n }\n last=newNode;\n\t\tthis.size++;\n\t\tthis.modificationCount++;\n\t}", "@Override\r\n\tpublic void add(T element) {\n\t\tthis._list.add(element);\r\n\t}", "synchronized void crawledList_add(HashSet _crawledList, String url)\n {\n _crawledList.add(url);\n System.out.println(\"Added\"+\"\\t\"+url);\n }", "public void add() {\n\n }", "public void addVertex (){\t\t \n\t\tthis.graph.insert( new MyList<Integer>() );\n\t}", "public boolean add(List<T> e) {\n\t\treturn lists.add(e);\n\t}", "public void addLVA(LV l) {\r\n ZugewieseneLV.add(l);\r\n }", "public void add() {\n\t\tcart.add(item.createCopy());\n\t}", "public static void push(Object data) {\n list.add(data);\n }", "public void add(E elem) {\n if (!list.contains(elem))\n list.insertLast(elem);\n }", "public void m65918a(List<SearchTrack> list) {\n SpotifyTrackSearchTarget spotifyTrackSearchTarget = (SpotifyTrackSearchTarget) this.f56358a.H();\n if (spotifyTrackSearchTarget != null) {\n this.f56358a.f56363e = true;\n spotifyTrackSearchTarget.addTracks(list);\n this.f56358a.f56361c = this.f56358a.f56361c + 1;\n }\n }", "public void addToList(int cap) {\n\t\t\tRoomList.addToList(cap);\r\n\t\t}", "static List<StateRef> append(List<StateRef> l1, List<StateRef> l2) {\n l1.addAll(l2);\n return l1;\n }", "public void addItemtoInventoryList(String item) {\r\n InventoryList.add(item);\r\n }", "public boolean addList(ArrayList<Npcinfo> NpcinfoList);", "private List<LocalAlbum> convertToLocalAlbumsList(List<Album> albumList){\n List<LocalAlbum> list = new ArrayList<>();\n for (Album album : albumList) {\n LocalAlbum localAlbum = new LocalAlbum(album.getAlbumId(),album.getId(),album.getTitle(),album.getUrl(),album.getThumbnailUrl());\n list.add(localAlbum);\n localAlbum.save();\n }\n return list;\n }", "void addListing(Listing<P, C> listing) {\n this.collectionOfCurrentListings.add(listing);\n }", "public void addInventoryList(ArrayList<? extends Item> toAddList){\n\t\tinventoryList.addAll(toAddList);\n\t}", "public synchronized void addList(int[] list) {\r\n listsOfSorted.offer(list);\r\n }", "public void add_return(User param){\r\n if (local_return == null){\r\n local_return = new User[]{};\r\n }\r\n\r\n \r\n //update the setting tracker\r\n local_returnTracker = true;\r\n \r\n\r\n java.util.List list =\r\n org.apache.axis2.databinding.utils.ConverterUtil.toList(local_return);\r\n list.add(param);\r\n this.local_return =\r\n (User[])list.toArray(\r\n new User[list.size()]);\r\n\r\n }", "public void addToList(Vertex newVertex)\n\t{\n\t\tadjacencyList.add(newVertex);\n\t\tupdateIndegree();\n\t}", "void addItem (Item toAdd){\n\t\t\tthis.items.add(toAdd);}", "public Vector2f addLocal (Vector2f other)\n {\n return add(other, this);\n }", "public void addElement(Replicated obj)\r\n\t{\n\t\tinsert(obj, seq.size());\r\n\t}" ]
[ "0.690285", "0.6379813", "0.6313125", "0.6308416", "0.6207322", "0.6118244", "0.6094481", "0.60752255", "0.6053751", "0.6033701", "0.6020748", "0.6012052", "0.5981748", "0.5973048", "0.59339225", "0.5933156", "0.59119636", "0.5897413", "0.58798623", "0.5866773", "0.58486366", "0.58395284", "0.58359164", "0.58276033", "0.5804134", "0.57958955", "0.5793559", "0.57879966", "0.5786533", "0.5777829", "0.5768791", "0.5759017", "0.5758111", "0.57391554", "0.57355845", "0.5734264", "0.57339144", "0.57294416", "0.572904", "0.5724588", "0.57230794", "0.5709401", "0.57046115", "0.5698278", "0.5687157", "0.5677859", "0.567567", "0.5669389", "0.56689256", "0.56659305", "0.5655737", "0.56434375", "0.56415427", "0.56381094", "0.56233436", "0.5615337", "0.56104815", "0.5602405", "0.5599338", "0.55989355", "0.55877376", "0.55836564", "0.5573033", "0.556556", "0.55554307", "0.55486083", "0.5547113", "0.55423826", "0.55388975", "0.55369806", "0.5536316", "0.55356795", "0.5532207", "0.5528236", "0.55269027", "0.5525833", "0.55166376", "0.55121905", "0.5508416", "0.5506396", "0.55011684", "0.5491999", "0.5488232", "0.54861593", "0.54858905", "0.54839927", "0.5483014", "0.54823756", "0.54809535", "0.5467675", "0.5466823", "0.5465812", "0.5461364", "0.5458539", "0.5457463", "0.545738", "0.5453969", "0.54498905", "0.5446864", "0.5443908", "0.54420155" ]
0.0
-1
This Method is used to take the folder path and select the workflow
public void operation() { try { if (path==null) { scanner = new Scanner(System.in); System.out.println("Enter The Directory (path):"); path= scanner.next(); } workFlow(); } catch(Exception e){ e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void openWorkflow() {\n Workflow workflow = null;\n int returnVal = this.graphFileChooser.showOpenDialog(this.engine.getGUI().getFrame());\n\n if (returnVal == JFileChooser.APPROVE_OPTION) {\n File file = this.graphFileChooser.getSelectedFile();\n logger.debug(file.getPath());\n\n try {\n String path = file.getPath();\n\n if (path.endsWith(XBayaConstants.GRAPH_FILE_SUFFIX)) {\n WSGraph graph = WSGraphFactory.createGraph(file);\n workflow = Workflow.graphToWorkflow(graph);\n } else {\n JsonObject workflowObject = JSONUtil.loadJSON(file);\n// XmlElement workflowElement = XMLUtil.loadXML(file);\n// workflow = new Workflow(workflowElement);\n workflow = new Workflow(workflowObject);\n }\n GraphCanvas newGraphCanvas = engine.getGUI().newGraphCanvas(true);\n newGraphCanvas.setWorkflow(workflow);\n //this.engine.setWorkflow(workflow);\n engine.getGUI().getGraphCanvas().setWorkflowFile(file);\n } catch (IOException e) {\n this.engine.getGUI().getErrorWindow().error(ErrorMessages.OPEN_FILE_ERROR, e);\n } catch (GraphException e) {\n this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);\n } catch (ComponentException e) {\n this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);\n } catch (RuntimeException e) {\n this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);\n } catch (Error e) {\n this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);\n }\n }\n \n }", "@FXML\n public void openFolder()\n {\n try\n {\n Desktop.getDesktop().open(nng.getStorePopulation().getParentFile());\n }\n catch (IOException e)\n {\n }\n }", "@Override\n\tpublic void init(IWorkbench workbench, IStructuredSelection selection) {\n\t\tif(selection.getFirstElement() instanceof IFolder \n\t\t && ((IFolder)selection.getFirstElement()).getName().equals(\"states\"))\n\t\t{\n\t\t\tthis.targetFolder = (IFolder)selection.getFirstElement();\n\t\t} else {\n\t\t\tthis.performCancel();\n\t\t\tMessageDialog.\n\t\t\t\topenError(getShell(), \n\t\t\t\t\t\t \"Wrong Selection\", \"State machines can only be created in a package named 'states'\");\n\t\t}\n\t}", "private void actionTimelapseImport ()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\r\n\t\t\tJFileChooser folderChooser = new JFileChooser();\r\n\t\t\tfolderChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\r\n\r\n\t\t\tint isFolderSelected = folderChooser.showOpenDialog(folderChooser);\r\n\r\n\t\t\tif (isFolderSelected == JFileChooser.APPROVE_OPTION)\r\n\t\t\t{\r\n\t\t\t\tString folderPath = folderChooser.getSelectedFile().getPath();\r\n\r\n\t\t\t\tDataController.scenarioTimelapseImport(folderPath);\r\n\r\n\t\t\t\thelperDisplayProjectFiles();\r\n\t\t\t\thelperDisplayInputImage();\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (ExceptionMessage e)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(e);\r\n\t\t}\r\n\t}", "public void loadWorkflow(String filename);", "private void actionAddFolder ()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\r\n\t\t\tJFileChooser folderChooser = new JFileChooser();\r\n\t\t\tfolderChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\r\n\r\n\t\t\tint isFolderSelected = folderChooser.showOpenDialog(folderChooser);\r\n\r\n\t\t\tif (isFolderSelected == JFileChooser.APPROVE_OPTION)\r\n\t\t\t{\r\n\t\t\t\tString folderPath = folderChooser.getSelectedFile().getPath();\r\n\r\n\t\t\t\tFile folderFileDescriptor = new File(folderPath);\r\n\t\t\t\tFile[] listFolderFiles = folderFileDescriptor.listFiles();\r\n\r\n\t\t\t\tString[] fileList = new String[listFolderFiles.length];\r\n\r\n\t\t\t\tfor (int i = 0; i < listFolderFiles.length; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfileList[i] = listFolderFiles[i].getPath();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tDataController.scenarioOpenFolder(fileList);\r\n\r\n\t\t\t\thelperDisplayProjectFiles();\r\n\t\t\t\thelperDisplayInputImage();\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (ExceptionMessage e)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(e);\r\n\t\t}\r\n\t}", "private void selectFolderBtnMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_selectFolderBtnMouseClicked\n if (workingDirectory == null)\n {\n workingDirectory = new File(\".\");\n }\n JFileChooser selectFolderUI = new JFileChooser();\n selectFolderUI.setCurrentDirectory(workingDirectory);\n selectFolderUI.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n int response = selectFolderUI.showOpenDialog(mainUI.this);\n if (response == JFileChooser.APPROVE_OPTION)\n {\n ArrayList<FileItem> fileList = new ArrayList<>();\n workingDirectory = selectFolderUI.getSelectedFile();\n ArrayList<File> files = \n new ArrayList<>(Arrays.asList(workingDirectory.listFiles()));\n \n for (File f : files)\n {\n if (!f.isDirectory())\n {\n FileItem fi = null;\n try {\n fi = new FileItem(f);\n } catch (IOException ex) {\n Logger.getLogger(mainUI.class.getName()).log(Level.SEVERE, null, ex);\n }\n fileList.add(fi);\n }\n }\n \n CSPB.testFiles = fileList;\n mainUI.this.refresh();\n } \n }", "public void selectSourcePackageFolder(String item) {\n cboSourcePackageFolder().selectItem(item);\n }", "public void importWorkflow() {\n int returnVal = this.graphFileChooser.showOpenDialog(this.engine.getGUI().getFrame());\n if (returnVal == JFileChooser.APPROVE_OPTION) {\n File file = this.graphFileChooser.getSelectedFile();\n try {\n\n String path = file.getPath();\n Workflow importedWorkflow;\n if (path.endsWith(XBayaConstants.GRAPH_FILE_SUFFIX)) {\n WSGraph importedGraph = WSGraphFactory.createGraph(file);\n importedWorkflow = Workflow.graphToWorkflow(importedGraph);\n } else {\n XmlElement importedWorkflowElement = XMLUtil.loadXML(file);\n importedWorkflow = new Workflow(importedWorkflowElement);\n }\n GraphCanvas newGraphCanvas = engine.getGUI().newGraphCanvas(true);\n newGraphCanvas.setWorkflow(importedWorkflow);\n this.engine.getGUI().setWorkflow(importedWorkflow);\n engine.getGUI().getGraphCanvas().setWorkflowFile(file);\n\n } catch (IOException e) {\n this.engine.getGUI().getErrorWindow().error(ErrorMessages.OPEN_FILE_ERROR, e);\n } catch (GraphException e) {\n this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);\n } catch (ComponentException e) {\n this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);\n } catch (RuntimeException e) {\n this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);\n } catch (Error e) {\n this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);\n }\n }\n }", "public void workFlow()\n {\n System.out.println(\"Enter the Option:\");\n options();\n int option = scanner.nextInt();\n switch (option) {\n case 1:\n file = new File(path);\n if(file.isDirectory()) {\n ascendingOrder(file);\n\n } else {\n System.out.println(\"Invalid path please select new context to continue\");\n }\n System.out.println(\"\\n\");\n operation();\n break;\n case 2:\n file = new File(path);\n if(file.isDirectory()) {\n createFile(path);\n System.out.println(\"[If you want to view the file added in the folder ,select option 1,else please continue]\");\n }else {\n System.out.println(\"Invalid path please select new context to continue\");\n }\n System.out.println(\"\\n\");\n operation();\n break;\n case 3:\n file = new File(path);\n if(file.isDirectory()) {\n deleteFile(path);\n System.out.println(\"\\n\");\n }else {\n System.out.println(\"Invalid path please select new context to continue\");\n }\n operation();\n break;\n case 4:\n file = new File(path);\n if(file.isDirectory()) {\n searchFile(path);\n System.out.println(\"\\n\");\n }else {\n System.out.println(\"Invalid path please select new context to continue\");\n }\n operation();\n break;\n case 5:\n file = new File(path);\n if(file.isDirectory()) {\n System.out.println(\"The current execution context is closed--------/\");\n System.out.println(\"\\n\");\n }else {\n System.out.println(\"-----------Invalid Input-----------\");\n }\n path=null;\n operation();\n break;\n case 6:\n System.out.println(\"--------------Thank You For Using File System------------\");\n break;\n default:\n System.out.println(\"The Option You Have Entered Does not exist ,Please enter the valid option:\");\n workFlow();\n }\n }", "private void gotoPath() {\n\t\tfinal String hdfs = getFullPath(txtRootPath.getText().trim());\n\t\tif (StringUtils.isEmpty(hdfs)) {\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tFileStatus fs = getFileStatusWithProgress(hdfs);\n\t\t\tgotoPath(fs);\n\t\t} catch (Exception e) {\n\t\t\tMessageDialog.openError(getShell(), Messages.msgError, e.getMessage());\n\t\t}\n\t}", "void selectDirectory(){\n fc.setCurrentDirectory(new java.io.File( \"saved\" + File.separator));\n fc.setDialogTitle(\"FILE CHOOSER!\");\n FileNameExtensionFilter xmlfilter = new FileNameExtensionFilter(\n \"json files (*.json)\", \"json\");\n fc.setFileFilter(xmlfilter);\n int response = fc.showSaveDialog(this);\n if (response == JFileChooser.APPROVE_OPTION) {\n File selectedFile = fc.getSelectedFile();\n System.out.println(\"Save as file: \" + selectedFile.getAbsolutePath());\n } else if (response == JFileChooser.CANCEL_OPTION) {\n System.out.println(\"Cancel was selected\");\n }\n System.out.println(fc.getSelectedFile().getAbsolutePath());\n }", "WithCreate withFolderPath(String folderPath);", "@SuppressWarnings(\"unused\")\n\tprivate void openFolder() {\n\t\tDesktop desktop = null;\n\t\tif (Desktop.isDesktopSupported()) {\n\t\t\tdesktop = Desktop.getDesktop();\n\t\t}\n\t\ttry {\n\t\t\tdesktop.open(new File(savePath));\n\t\t} catch (IOException e) {\n\t\t}\n\t}", "public HomePageActController openContextMenuOverFolder(String folder) {\n WebElement parentFolder = driver.findElement(By.xpath(\"//*[@id='foldersTree']//*[@id='node1sub']/li/p[text()='\"+folder+\"']\"));\n\n // If there is no such folder - test fails\n if (parentFolder == null) { Assert.fail(\"There is no folder named: \" + folder); }\n\n // Context click on desired folder\n Actions actions = new Actions(driver);\n actions.moveToElement(parentFolder).contextClick(parentFolder).perform();\n\n // waiting for all context menu elements to be opened\n wait.until(ExpectedConditions.visibilityOfNestedElementsLocatedBy(menu, By.xpath(\"li/p\")));\n return this;\n }", "public void run(){\n\t\tc = Controller.getApp();\n\t\t//sets the selected folder so we know how much the view needs to refresh\n\t\ttry{\n\t\t\ttarget = c.getActiveView().getSelectedFolder();\n\t\t}catch(NoItemSelectedException e){\n\t\t\t//if they haven't selected a folder, let them know so they aren't confused why it isn't doing anything\n\t\t\tMessageDialog.openWarning(Display.getCurrent().getActiveShell(), \"Warning\", \"Please select a folder to import feeds into\");\n\t\t\treturn;\n\t\t}\n\t\t//gets the url\n\t\tInputDialog dlg = new InputDialog(Display.getCurrent().getActiveShell(),\"Import from OPML\",\"Enter OPML file URL and Click 'OK'\",\"\", null);\n\t\tint rc = dlg.open();\n\t\tif (rc == Window.OK){\n\t\t\topmlurl = dlg.getValue();\n\t\t\ttry{\n\t\t\t\t//prepares the statusline to use as the progress monitor\n\t\t\t\tStatusLineManager s = c.getStatusLine();\n\t\t\t\ts.setCancelEnabled(true);\n\t\t\t\t//performs action in progress dialog since it takes awhile\n\t\t\t\tModalContext.run(this,true,s.getProgressMonitor(),Display.getCurrent());\n\t\t\t\t//updates the folder contents\n\t\t\t\tc.getActiveView().updateFolderContents(target);\n\t\t\t\tc.setStatus(\"done\");\n\t\t\t}catch(InterruptedException e){\n\t\t\t\tc.setStatus(\"Problem opening file: \"+e.getMessage());\n\t\t\t\tc.getActiveView().updateFolderContents(target);\n\t\t\t}catch(InvocationTargetException e){\n\t\t\t\tc.setStatus(\"Done\");\n\t\t\t\tc.getActiveView().updateFolderContents(target);\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\t//if the tread throws some big time exception just exit gracefully\n\t\t\t\tc.setStatus(\"Error importing feeds: \"+e);\n\t\t\t\tc.getActiveView().updateFolderContents(target);\n\t\t\t}\n\t\t}\n\t}", "String folderPath();", "public static void processDirectorySelecction()\n {\n int answer = JSoundsMainWindowViewController.jFileChooser1.showOpenDialog(JSoundsMainWindowViewController.jSoundsMainWindow);\n \n if (answer == JFileChooser.APPROVE_OPTION)\n {\n File actualDirectory = JSoundsMainWindowViewController.jFileChooser1.getCurrentDirectory();\n String directory = actualDirectory.getAbsolutePath() + \"/\" + JSoundsMainWindowViewController.jFileChooser1.getSelectedFile().getName();\n UtilFunctions.listFilesAndFilesSubDirectories(directory);\n JSoundsMainWindowViewController.orderBy(true, false, false);\n \n \n }\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tCheckBoxTreeNode node=(CheckBoxTreeNode) path.getLastPathComponent();\n\t\t\t\tString nodeName=(String) node.getUserObject();\n\t\t\t\ttry {\n\t\t\t\t\tRuntime.getRuntime().exec(\"explorer.exe \"+nodeName);\n\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t}", "public @Override void actionPerformed(ActionEvent e) {\n RP.post(new Runnable() {\n public @Override void run() {\n Set<Project> projects = new HashSet<Project>();\n // Collect projects corresponding to selected folders.\n for (DataFolder d : context.lookupAll(DataFolder.class)) {\n try {\n Project p = ProjectManager.getDefault().findProject(d.getPrimaryFile());\n if (p != null) {\n projects.add(p);\n }\n // Ignore folders not corresponding to projects (will not disable action if some correspond to projects).\n // Similarly, do not worry about projects which are already open - no harm done.\n } catch (IOException x) {\n Logger.getLogger(OpenProjectFolderAction.class.getName()).log(Level.INFO, null, x);\n }\n }\n OpenProjectList.getDefault().open(projects.toArray(new Project[projects.size()]), false, true);\n }\n });\n }", "public void actionPerformed(ActionEvent e) {\r\n\r\n if (e.getActionCommand() == \"BATCH_SOURCE_FOLDER\") { \r\n \t JFileChooser fc = new JFileChooser();\r\n\r\n\t\t fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\r\n\t\t int returnVal = fc.showDialog(RSMLGUI.this, \"Choose\");\r\n\t\t \r\n if (returnVal == JFileChooser.APPROVE_OPTION){ \r\n \t String fName = fc.getSelectedFile().toString();\r\n \t batchSourceFolder.setText(fName);\r\n }\r\n else SR.write(\"Choose folder cancelled.\"); \r\n }\r\n \r\n else if(e.getActionCommand() == \"BATCH_EXPORT\"){\r\n \t batchExport();\r\n }\r\n \r\n }", "public void newFolderButtonClicked() {\n TreePath[] paths = _fileSystemTree.getSelectionPaths();\r\n List selection = getSelectedFolders(paths);\r\n if (selection.size() > 1 || selection.size() == 0)\r\n return; // should never happen\r\n \r\n File parent = (File) selection.get(0);\r\n \r\n final ResourceBundle resourceBundle = FolderChooserResource.getResourceBundle(Locale.getDefault());\r\n String folderName = JOptionPane.showInputDialog(_folderChooser, resourceBundle.getString(\"FolderChooser.new.folderName\"),\r\n resourceBundle.getString(\"FolderChooser.new.title\"), JOptionPane.OK_CANCEL_OPTION | JOptionPane.QUESTION_MESSAGE);\r\n \r\n if (folderName != null) {\r\n File newFolder = new File(parent, folderName);\r\n boolean success = newFolder.mkdir();\r\n \r\n TreePath parentPath = paths[0];\r\n boolean isExpanded = _fileSystemTree.isExpanded(parentPath);\r\n if (!isExpanded) { // expand it first\r\n _fileSystemTree.expandPath(parentPath);\r\n }\r\n \r\n LazyMutableTreeNode parentTreeNode = (LazyMutableTreeNode) parentPath.getLastPathComponent();\r\n BasicFileSystemTreeNode child = BasicFileSystemTreeNode.createFileSystemTreeNode(newFolder, _folderChooser);\r\n // child.setParent(parentTreeNode);\r\n if (success) {\r\n parentTreeNode.clear();\r\n int insertIndex = _fileSystemTree.getModel().getIndexOfChild(parentTreeNode, child);\r\n if (insertIndex != -1) {\r\n // ((BasicFileSystemTreeModel) _fileSystemTree.getModel()).insertNodeInto(child, parentTreeNode, insertIndex);\r\n ((BasicFileSystemTreeModel) _fileSystemTree.getModel()).nodeStructureChanged(parentTreeNode);\r\n // ((BasicFileSystemTreeModel) _fileSystemTree.getModel()).addPath(parentPath, insertIndex, child);\r\n }\r\n }\r\n TreePath newPath = parentPath.pathByAddingChild(child);\r\n _fileSystemTree.setSelectionPath(newPath);\r\n _fileSystemTree.scrollPathToVisible(newPath);\r\n }\r\n }", "@FXML\n private void selectPath(MouseEvent mouseEvent) {\n\n DirectoryChooser directoryChooser = new DirectoryChooser();\n File selectedDirectory = directoryChooser.showDialog(getStage(mouseEvent));\n if (selectedDirectory != null){\n pathTextField.setText(selectedDirectory.getPath());\n }\n\n }", "void selectFile(){\n JLabel lblFileName = new JLabel();\n fc.setCurrentDirectory(new java.io.File(\"saved\" + File.separator));\n fc.setDialogTitle(\"FILE CHOOSER\");\n FileNameExtensionFilter xmlfilter = new FileNameExtensionFilter(\n \"json files (*.json)\", \"json\");\n fc.setFileFilter(xmlfilter);\n int response = fc.showOpenDialog(this);\n if (response == JFileChooser.APPROVE_OPTION) {\n lblFileName.setText(fc.getSelectedFile().toString());\n }else {\n lblFileName.setText(\"the file operation was cancelled\");\n }\n System.out.println(fc.getSelectedFile().getAbsolutePath());\n }", "public static void openFolder(File outputFolder) {\n\t\tProjectExplorerManager projExpMan = new ProjectExplorerManager();\n\t\t\n\t\tprojExpMan.refreshFolder(projExpMan.getTreeNodeModelbyFilePath(outputFolder.getAbsolutePath()));\n\t\tProjectExplorerTreeNodeModel newFileModel = projExpMan.getTreeNodeModelbyFilePath(outputFolder.getAbsolutePath());\n\t\tif(newFileModel.getElementInStack() == null){\n\t\t\tPartStackHandler.execute(newFileModel);\n\t\t}\n\t\telse{\n\t\t\tPartStackHandler.reOpenPart(newFileModel);\n\t\t}\n\t\t\n\t}", "private void startFileSelection() {\n final Intent chooseFile = new Intent(Intent.ACTION_GET_CONTENT);\n chooseFile.setType(getString(R.string.file_type));\n startActivityForResult(chooseFile, PICK_FILE_RESULT_CODE);\n }", "public void clickCreateFolderButton() {\n\t\tfilePicker.fileManButton(locCreateFolderButton);\n\t}", "public void setPath(File path) {\n this.path = path;\n \n // Flush any previously existing path data\n this.analysisPanels.clear();\n this.selectedClusteringMarkers = null;\n \n // Determine analysis kind\n gmlFiles = path.listFiles(new FilenameFilter() {\n public boolean accept(File f, String name) {\n return (name.endsWith(\".medians.gml\"));\n }\n });\n \n if (gmlFiles.length > 0) { // We are probably doing analysis\n fcsFiles = path.listFiles(new FilenameFilter() {\n public boolean accept(File f, String name) {\n return (name.endsWith(\".cluster.fcs\"));\n }\n });\n \n // Validate that we have matching GML and FCS files\n if (gmlFiles.length != fcsFiles.length)\n throw new IllegalArgumentException(\"Missing fcs or gml files\");\n \n Arrays.sort(fcsFiles);\n Arrays.sort(gmlFiles);\n \n for (int i=0; i<gmlFiles.length; i++) {\n if (!gmlFiles[i].getName().contains(fcsFiles[i].getName())) {\n throw new IllegalArgumentException(\"Missing counterpart for \"+gmlFiles[i]);\n }\n }\n \n // Set workflow\n workflowKind = WorkflowKind.ANALYSIS;\n } else {\n fcsFiles = path.listFiles(new FilenameFilter() {\n public boolean accept(File f, String name) {\n return (name.endsWith(\".fcs\"));\n }\n });\n if (fcsFiles.length == 0)\n throw new IllegalArgumentException(\"No FCS files found in directory\");\n Arrays.sort(fcsFiles);\n workflowKind = WorkflowKind.PROCESSING;\n }\n }", "public static void processOneFileSelecction()\n {\n int answer = JSoundsMainWindowViewController.jfcOneFile.showOpenDialog(JSoundsMainWindowViewController.jSoundsMainWindow);\n \n if (answer == JFileChooser.APPROVE_OPTION)\n {\n File actualDirectory = JSoundsMainWindowViewController.jfcOneFile.getCurrentDirectory();\n String directory = actualDirectory.getAbsolutePath() + \"/\" + JSoundsMainWindowViewController.jfcOneFile.getSelectedFile().getName();\n UtilFunctions.listOneFile(JSoundsMainWindowViewController.jfcOneFile.getSelectedFile());\n JSoundsMainWindowViewController.orderBy(true, false, false); \n }\n }", "@Override\n public void onFolderSelected(String absolutePath) {\n PdfViewCtrlSettingsManager.updateLocalFolderPath(this, absolutePath);\n // Update last-used local folder tree to the same path\n PdfViewCtrlSettingsManager.updateLocalFolderTree(this, absolutePath);\n\n if (mNavigationDrawerView != null && mNavigationDrawerView.getMenu() != null) {\n MenuItem menuItem = mNavigationDrawerView.getMenu().findItem(R.id.item_folder_list);\n selectNavigationItem(menuItem);\n }\n }", "interface WithFolderPath {\n /**\n * Specifies the folderPath property: The folder path of the source control. Path must be relative..\n *\n * @param folderPath The folder path of the source control. Path must be relative.\n * @return the next definition stage.\n */\n WithCreate withFolderPath(String folderPath);\n }", "@Test(groups={\"Enterprise-only\",\"Enterprise4.2Bug\"})\n public void folderSearchTest() throws Exception\n {\n \tAdvanceSearchContentPage contentSearchPage = dashBoard.getNav().selectAdvanceSearch().render();\n \tfolderSearchPage = contentSearchPage.searchLink(\"Folders\").render(); \t\n contentSearchPage.inputName(\"Contracts\");\n contentSearchPage.inputDescription(\"This folder holds the agency contracts\"); \n FacetedSearchPage searchResults = contentSearchPage.clickSearch().render();\n Assert.assertTrue(searchResults.hasResults()); \n }", "private void chooseFilesDirectory() {\n JFileChooser setWD = new JFileChooser(System.getProperty(\"user.home\"));\n setWD.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n setWD.setDialogType(JFileChooser.OPEN_DIALOG);\n setWD.showDialog(this, \"Выбрать папку\");\n workingDirectory = setWD.getSelectedFile();\n putLog(\"Директория с файлами: \" + workingDirectory.getPath());\n jbParse.setEnabled(workingDirectory != null && remainderFile != null);\n }", "private NodeRef getCaseFolder(){\n LOG.debug(\"### Executing \"+ Thread.currentThread().getStackTrace()[1].getMethodName() +\" ####\");\n List<String> pathElements = new ArrayList<String>();\n pathElements.add(TradeMarkModel.CABINET_FOLDER_NAME);\n pathElements.add(TradeMarkModel.CASE_FOLDER_NAME);\n NodeRef nr = null;\n try {\n nr = fileFolderService.resolveNamePath(repositoryHelper.getCompanyHome(), pathElements).getNodeRef();\n } catch (FileNotFoundException e) {\n if(LOG.isInfoEnabled()){\n LOG.info(e.getMessage(), e);\n } \n LOG.error(e.getMessage(), e);\n }\n return nr;\n }", "public void clickBreadcrumb(String folderName) {\n\t\tfilePicker.clickBreadcrumb(folderName);\n\t}", "public void setDir() throws FileNotFoundException, IOException{\r\n final JFileChooser jfc = new JFileChooser();\r\n jfc.setDialogTitle(\"Choose Workplace Dirtory\");\r\n FileSystemView fsv = FileSystemView.getFileSystemView();\r\n //wppath stores workplace location\r\n wppath = fsv.getDefaultDirectory();\r\n File rd = new File(wppath.getAbsolutePath() + \"/USQ_Reporter.txt\");\r\n int ext = 0;\r\n if(rd.exists())ext=1;\r\n if(!rd.exists())ext=2;\r\n FileReader fr; \r\n if(rd.exists()){\r\n fr= new FileReader(rd);\r\n if(fr.read()==-1)\r\n ext=2;\r\n }\r\n //System.out.println(ext);\r\n //workplace path\r\n if(ext==1) {\r\n BufferedReader br = new BufferedReader(new FileReader(rd));\r\n workplace = br.readLine();\r\n }else if (ext==2) {\r\n jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\r\n int returnVal = jfc.showOpenDialog(this);\r\n \r\n if(returnVal == JFileChooser.APPROVE_OPTION) {\r\n File file = jfc.getSelectedFile();\r\n if(!file.exists()) {\r\n JOptionPane.showMessageDialog(null, \"file doesn't exist.\", \"System Message\", JOptionPane.ERROR_MESSAGE);\r\n } else if(file.isDirectory()) {\r\n workplace = file.getAbsolutePath();\r\n }\r\n }\r\n BufferedWriter bw = new BufferedWriter(new FileWriter(rd));\r\n bw.write(workplace);\r\n bw.flush();\r\n bw.close();\r\n }\r\n }", "private void selectCurrent() {\n final File currentSelection = callback.getCurrentSelection();\n final List<DirectoryListItem> items = gridView.getItems();\n IntStream.range(0, items.size())\n .filter(i -> compareFilePaths(items.get(i).getFile(), currentSelection))\n .findFirst()\n .ifPresent(selectedCellIndex::setValue);\n }", "@Override\r\n\tprotected void directorySelectionChangedDirectly() {\n\r\n\t}", "@Override\r\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tJFileChooser fc = new JFileChooser();\r\n\t\t\t\t\tfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\r\n\t\t\t\t\tint result = fc.showOpenDialog(new JFrame());\r\n\t\t\t\t\tif(result == JFileChooser.APPROVE_OPTION){\r\n\t\t\t\t\t\tString path = fc.getSelectedFile().getAbsolutePath();\r\n\t\t\t\t\t\ttfPath.setText(path);\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "private void browseProject()\n {\n List<FileFilter> filters = new ArrayList<>();\n filters.add(new FileNameExtensionFilter(\"Bombyx3D project file\", \"yml\"));\n\n File directory = new File(projectPathEdit.getText());\n File selectedFile = FileDialog.chooseOpenFile(this, BROWSE_DIALOG_TITLE, directory, filters);\n if (selectedFile != null) {\n projectDirectory = selectedFile.getParentFile();\n projectPathEdit.setText(projectDirectory.getPath());\n projectPathEdit.selectAll();\n }\n }", "public void saveWorkflow(String filename);", "public folderize() {\n }", "private void openPathButtonActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_openPathButtonActionPerformed\n\tFile savePath = PlatypusGUI.getInstance().getLastSavePath();\n\tif (savePath.isDirectory()) {\n\t try {\n\t\tDesktop.getDesktop().open(savePath);\n\t } catch (IOException ex) {\n\t\tex.printStackTrace();\n\t }\n\t}\n }", "public void updateLabtainersPath(){\n labsPath = new File(labtainerPath + File.separator + \"labs\");\n labChooser.setCurrentDirectory(labsPath); \n }", "public Workflow getWorkflow(String identifier) throws PortalException;", "public void readResult() {\n File dirXml = new File(System.getProperty(\"user.dir\") + \"/target/classes/\");\n /// Get Parent Directory\n String parentDirectory = dirXml.getParent();\n File folder = new File(parentDirectory + \"/jbehave\");\n File[] listOfFiles = folder.listFiles();\n\n if (listOfFiles != null) {\n for (File listOfFile : listOfFiles) {\n if (listOfFile.isFile()) {\n String filePath = folder.getPath() + \"/\" + listOfFile.getName();\n System.out.println(\"File \" + filePath);\n if (filePath.contains(\".xml\") && !filePath.contains(\"AfterStories\") && !filePath.contains(\n \"BeforeStories\")) {\n readXML(filePath);\n }\n }\n }\n }\n }", "NodeRef getCurrentFolderNodeRef(NodeRef parent, String folderName);", "private void clickNewStateMachine(ARCEditor arcEditor, VMFile file) {\n ClickHandler clickHandler = new ClickHandler() {\n @Override\n public void onClick(MenuItemClickEvent event) {\n editResourceService.getDirId(file.getId(), new AsyncCallback<Long>() {\n\n @Override\n public void onFailure(Throwable caught) {\n SC.warn(caught.getMessage());\n }\n\n @Override\n public void onSuccess(Long dirID) {\n VMFile newFile = new VMFile();\n newFile.setExtension(Extension.FSM);\n String fileName = \"StateMachine\";\n\n editResourceService.getResources(dirID, new AsyncCallback<List<VMResource>>() {\n\n @Override\n public void onFailure(Throwable caught) {\n SC.warn(caught.getMessage());\n }\n\n @Override\n public void onSuccess(List<VMResource> result) {\n // check duplicate file name under same directory and set file name\n newFile.setName(checkDuplicateName(result, fileName, newFile.getExtension(), 0));\n ZGCreateFileCommand createFileCommand = new ZGCreateFileCommand(editResourceService, viewHandler, dirID, newFile, null);\n createFileCommand.addCommandListener(new CommandListener() {\n\n @Override\n public void undoEvent() {\n treeGrid.deselectAllRecords();\n fileTreeNodeFactory.removeVMResource(createFileCommand.getFileId());\n fileTreeNodeFactory.refresh(editorTabSet, tree, tabRegs);\n treeGrid.sort();\n treeGrid.redraw();\n }\n\n @Override\n public void redoEvent() {\n createCallbackFile(fileTreeNodeFactory.findTreeNode(tree, createFileCommand.getParentId()), createFileCommand.getFile(),\n createFileCommand.getFileId(), true);\n }\n\n @Override\n public void executeEvent() {\n createCallbackFile(fileTreeNodeFactory.findTreeNode(tree, createFileCommand.getParentId()), createFileCommand.getFile(),\n createFileCommand.getFileId(), true);\n editResourceService.getFileContent(createFileCommand.getFileId(), new AsyncCallback<byte[]>() {\n\n @Override\n public void onFailure(Throwable caught) {\n SC.warn(caught.getMessage());\n }\n\n @Override\n public void onSuccess(byte[] result) {\n BinaryResourceImpl r = new BinaryResourceImpl();\n ByteArrayInputStream bi = new ByteArrayInputStream(result);\n EPackage.Registry.INSTANCE.put(FSMPackage.eNS_URI, FSMPackage.eINSTANCE);\n\n FSMDStateMachine machine = null;\n try {\n r.load(bi, EditOptions.getDefaultLoadOptions());\n machine = (FSMDStateMachine) r.getContents().get(0);\n } catch (IOException e) {\n SC.warn(e.getMessage());\n }\n ARCState newState = ARCFactory.eINSTANCE.createARCState();\n newState.setFileId(machine.getId());\n newState.setTop(arcEditor.getStateTop());\n newState.setLeft(arcEditor.getStateLeft());\n newState.setHeight(40);\n newState.setWidth(80);\n newState.setEvalPriority(arcEditor.getMaxEvalPriority());\n\n CompoundCommand cmd = ARCEditorCommandProvider.getInstance().addState(arcEditor.getARCRoot(), newState,\n arcEditor.getARCRoot().getStates().size());\n arcEditor.getEditManager().execute(cmd.unwrap());\n arcEditor.refresh();\n }\n });\n }\n\n @Override\n public void bindEvent() {\n viewHandler.clear();\n registerRightClickEvent();\n }\n });\n CompoundCommand c = new CompoundCommand();\n c.append(createFileCommand);\n manager.execute(c.unwrap());\n }\n });\n }\n });\n }\n };\n arcEditor.addNewStateMachineHandler(clickHandler);\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif(path.getAbsolutePath().startsWith(Constants.getAppDirectory())) {\n\t\t\t\t\tshowToast(\"Not implemented for Home dir yet\");\n\t\t\t\t\t//open file browser\n\t\t\t\t}\n\t\t\t\telse {\n//\t\t\t\t\tCopyTask copyTask = new CopyTask();\n//\t\t\t\t\tcopyTask.destination = Constants.getAppDirectory();\n//\t\t\t\t\tcopyTask.execute(selList);\n\t\t\t\t\t// Just copy the files to home directory\n\t\t\t\t\tfor(File sel:selList) {\n\t\t\t\t\t\tUtils.copy(sel, Constants.getAppDirectory());\n\t\t\t\t\t}\n\t\t\t\t\tshowToast(\"Import complete\");\n\t\t\t\t}\n\t\t\t\t// Clean up\n\t\t\t\tcancelAction();\n\t\t\t}", "public File start(){\n\t\t\n\t\tJFileChooser fileChooser = new JFileChooser();\n\t\tfileChooser.setCurrentDirectory(new File(System.getProperty(\"user.home\")));\n\t\tint result = fileChooser.showOpenDialog(null);\n\t\tFile selectedFile = null;\n\t\tif (result == JFileChooser.APPROVE_OPTION) {\n\t\t\tselectedFile = fileChooser.getSelectedFile();\n\t\t}\n\t\treturn selectedFile;\n\t\t\n\t}", "@Override\n public void onChosenDir(String chosenDir) {\n ((EditTextPreference)preference).setText(chosenDir);\n try {\n SettingsActivity.createWorkingDir(getActivity(), new File(chosenDir));\n } catch (Exception ex) {\n Toast.makeText(getActivity(), ex.getMessage(), Toast.LENGTH_SHORT).show();\n }\n AvnLog.i(Constants.LOGPRFX, \"select work directory \" + chosenDir);\n }", "private void outputFolderButtonActionPerformed(java.awt.event.ActionEvent evt) {\n JFileChooser chooser = new JFileChooser();\n chooser.setDialogTitle(\"Select Output Folder\");\n chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n File workingDirectory = new File(System.getProperty(\"user.dir\"));\n chooser.setCurrentDirectory(workingDirectory);\n if (chooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {\n outputFile = chooser.getSelectedFile();\n outputFolderLabel.setText(getFileName(chooser.getSelectedFile()));\n }\n }", "@Override\n\tpublic void setParrentFolder(String parrentFolder) {\n\t\t\n\t}", "public String getFolder() {\r\n return folder;\r\n }", "private void loadFolderPressed() {\n\n\t\t// open a jfile chooser and then go through the directory chosen\n\t\t// then load all the video and audio files in that directory\n\n\t\tFile chosenDirectory =null;\n\n\t\t// choose a directory only\n\t\tJFileChooser chooser = new JFileChooser();\n\t\tchooser.setCurrentDirectory(new java.io.File(\".\"));\n\t\tchooser.setDialogTitle(\"Choose Directory\");\n\t\tchooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n\t\tint response = chooser.showOpenDialog(Library.this);\n\t\tif (response == JFileChooser.APPROVE_OPTION) {\n\t\t\t// Chose the directory to save to\n\t\t\tchosenDirectory = chooser.getSelectedFile().getAbsoluteFile();\n\t\t}\n\t\tif(chosenDirectory != null){\n\t\t\t// go through the chosen directory and get all the files\n\t\t\tl.clear();\n\t\t\tFile[] directoryListing = chosenDirectory.listFiles();\n\t\t\tif (directoryListing != null) {\n\n\t\t\t\t// check if that file chosen currently is a media file. If it is then\n\t\t\t\t// add it to the list\n\t\t\t\tInvalidCheck ic = new InvalidCheck();\n\n\t\t\t\tfor(File f : directoryListing){\n\t\t\t\t\tboolean isValid = ic.invalidCheck(f.getAbsolutePath());\n\n\t\t\t\t\tif(isValid){\n\t\t\t\t\t\tlistFolder.add(f);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor(File f2 : listFolder){\n\t\t\t\t\tSystem.out.println(f2.getName());\n\t\t\t\t}\n\n\t\t\t\t// get the paths and sizes of the media files.\n\t\t\t\tfor(File f : listFolder){\n\t\t\t\t\t// only put the file in if it is not size 0 so that any bad files are avoided.\n\t\t\t\t\tif(f.length() != 0){\n\t\t\t\t\t\tl.addElement(f.getName());\n\t\t\t\t\t\tpaths.put(f.getName(),f.getAbsoluteFile());\n\t\t\t\t\t\tsizes.put(f.getName(), f.length());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Test(dependsOnMethods=\"folderSearchTest\")\n public void testIsFolder() throws Exception\n {\n AdvanceSearchContentPage contentSearchPage = dashBoard.getNav().selectAdvanceSearch().render();\n folderSearchPage = contentSearchPage.searchLink(\"Folders\").render();\n folderSearchPage.inputName(\"Contracts\");\n FacetedSearchPage searchResults = contentSearchPage.clickSearch().render();\n Assert.assertTrue(searchResults.hasResults());\n Assert.assertTrue(searchResults.getResults().get(0).isFolder());\n }", "@Test\n void searchListButtonClicked() {\n //if file chooser function finds GroceryList.txt\n\n }", "public String promptForFolder( Component parent )\n\t{\n\t JFileChooser fc = new JFileChooser();\n\t fc.setFileSelectionMode( JFileChooser.FILES_AND_DIRECTORIES);\n\n\t if( fc.showOpenDialog( parent ) == JFileChooser.APPROVE_OPTION )\n\t {\n\t return fc.getSelectedFile().getAbsolutePath();\n\t }\n\n\t return null;\n\t}", "public String getWorkflowName(){return workflowName;}", "public String getWorkflowName(){return workflowName;}", "public void startGameFlow(String path) throws IOException {\n\n List<LevelInformation> levelList = new ArrayList<>();\n\n LevelSetReader levelSetReader = new LevelSetReader(Paths.get(path));\n levelSetReader.fromReader(new FileReader(path));\n\n SubMenuAnimation<Task<Void>> subMenu =\n new SubMenuAnimation<Task<Void>>(\"Arkanoid\", keyboardSensor, animationRunner);\n levelList = getLevelListToRun(path, subMenu);\n\n\n this.startMenu(levelList, subMenu);\n }", "public void gotoParentDir() {\n boolean z;\n if (!isRootDir() && this.mCurrentDir != null && this.mBox.hasAuthenticated()) {\n String sb = new StringBuilder(getCurrentDirPath()).toString();\n if (sb.endsWith(File.separator)) {\n sb = sb.substring(0, sb.lastIndexOf(File.separator));\n }\n String substring = sb.substring(0, sb.lastIndexOf(File.separator) + 1);\n if (!substring.equals(getCurrentDirName())) {\n if (!substring.equals(File.separator) && substring.endsWith(File.separator)) {\n substring = substring.substring(0, substring.length() - 1);\n }\n BoxFileObject boxFileObject = null;\n if (this.mDirCached.containsKey(substring)) {\n boxFileObject = (BoxFileObject) this.mDirCached.get(substring);\n }\n if (boxFileObject == null) {\n z = this.mBox.asyncLoadDir(substring, this.mLoadFolderListener);\n } else {\n z = this.mBox.asyncLoadDir(boxFileObject, this.mLoadFolderListener);\n }\n if (z) {\n showWaitingDialog(this.mActivity.getString(C4538R.string.zm_msg_loading), this.mWaitingDialogCancelListener);\n }\n }\n }\n }", "private void addFolder(){\n }", "public String getSelectedSourcePackageFolder() {\n return cboSourcePackageFolder().getSelectedItem().toString();\n }", "public void enter(String path);", "protected ResourceReference getFolderOpen()\n\t{\n\t\treturn FOLDER_OPEN;\n\t}", "public void openProject(File pfile, FileOpenSelector files) { }", "public void treeSelection() {\n\t\tFlowTreeNode ftn = (FlowTreeNode) tree.getLastSelectedPathComponent();\n\n\t\tif (ftn == null)\n\t\t\treturn;\n\t\telse\n\n\t\t{\n\n\t\t\tftn.execute();\n\t\t\tthis.revalidate();\n\t\t\t// buildTreeView();\n\n\t\t}\n\t}", "public Path getPath() {\r\n return getTargetPath().resolve(folder);\r\n }", "public abstract void selectInTree(@NotNull Project project, @NotNull SNode node, boolean focus);", "private void openFolder(String dest) {\n\t\tDesktop desktop = Desktop.getDesktop();\n\t\tFile dirToOpen = null;\n\t\ttry {\n\t\t\tdirToOpen = new File(dest);\n\t\t\tdesktop.open(dirToOpen);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void openFolderButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openFolderButtonActionPerformed\n String path = FileIO.getPathOfExecutable() + \"reports\";\n File reportsDirectory = new File(path);\n if (!reportsDirectory.exists() || !reportsDirectory.isDirectory()) return;\n\n try {\n java.awt.Desktop.getDesktop().open(reportsDirectory);\n } catch (IOException ex) {\n Logger.getLogger(SimulationView.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void selectActionToStartTraining(String trainingName)\n {\n\t\t WebElement optionToBeSelected= driver.findElement(ByLocator(\"//strong[contains(text(),'\"+trainingName+\"')]/..//button\"));\n\t\t clickOn(optionToBeSelected);\n\t\t reportInfo();\n }", "private void setClubEventFolder (File file) {\n if (file == null) {\n eventsFile = null;\n // currentFileSpec = null;\n statusBar.setFileName(\" \", \" \");\n } else {\n fileSpec = recentFiles.addRecentFile (file);\n if (clubEventList != null) {\n clubEventList.setSource (fileSpec);\n } else {\n // System.out.println(\"ClubPlanner.setClubEventFolder clubEventList is null\");\n }\n eventsFile = file;\n currentDirectory = file.getParentFile();\n FileName fileName = new FileName (file);\n statusBar.setFileName(fileName);\n // textMergeWindow.openSource(currentDirectory);\n }\n }", "@FXML\n private void handleChooseDirectory(){\n\n //Use directoryChooser for let user select the directory he wants\n //to be monitored\n DirectoryChooser directoryChooser = new DirectoryChooser();\n directoryChooser.setTitle(\"Select a directory to be monitored...\");\n directoryChooser.setInitialDirectory(new File(\"C:\\\\\"));\n File chosenDirectory = directoryChooser.showDialog(mainApp.getPrimaryStage());\n\n\n //Check that the path is valid and if it exists\n if(chosenDirectory.isDirectory() && chosenDirectory.exists()){\n //Put the full path in the textField\n directoryPathField.setText(chosenDirectory.getAbsolutePath());\n }\n\n //Enable buttons after directory has been chosen\n startWatcherButton.setDisable(false);\n stopWatcherButton.setDisable(true);\n\n //Getting the path\n monitoredPath = Paths.get(chosenDirectory.getAbsolutePath());\n }", "@SuppressWarnings(\"unused\") // Used by incremental task action.\n @InputDirectory\n public File getInputFolder() {\n return inputFolder;\n }", "private Module selectModuleFromPath(String path) {\n\n\t\tModule module = modules.get(path);\n\t\tif (module != null)\n\t\t\treturn module;\n\t\telse\n\t\t\treturn new DiscardingModule();\n\t}", "@Override\r\n public void widgetSelected(final SelectionEvent event) {\r\n System.out.println(\"TN5250JPart: Tab folder selected: \" + tn5250jPart.getClass().getSimpleName());\r\n setFocus();\r\n }", "private IFolder getSortedFolder() {\n \t\tString sortedFolder = (String) arguments.get(SORTED_FOLDER);\n \t\tif (sortedFolder == null)\n \t\t\tsortedFolder = DEFAULT_SORTED_FOLDER;\n \t\treturn getProject().getFolder(sortedFolder);\n \t}", "void openChooser(Property<String> pathProperty);", "private void chooseDirectoryAction(){\n\t\t \tJFileChooser chooser = new JFileChooser(); \n\t\t chooser.setCurrentDirectory(lastChoosedDirectory == null ? new java.io.File(\".\") : lastChoosedDirectory);\n\t\t chooser.setDialogTitle(translations.getChooseDirectory());\n\t\t chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n\t\t //\n\t\t // disable the \"All files\" option.\n\t\t //\n\t\t chooser.setAcceptAllFileFilterUsed(false);\n\t\t // \n\t\t if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) { \n\t\t \tFile file = chooser.getSelectedFile();\n\t\t \tsetDirectoryInfoLabel(file.getAbsolutePath());\n\t\t\t\tsetMessage( translations.getDirChosen().replace(\"#replace\", file.getAbsolutePath() ) );\n\t\t\t\tlastChoosedDirectory = file;\n\t\t }\n\t\t else {\n\t\t \tsetDirectoryInfoLabel(translations.getDirHasNotBeenChosen());\n\t\t \tshowWarningMessage( translations.getDirHasNotBeenChosen() );\n\t\t \tlastChoosedDirectory = null;\n\t\t }\n\t}", "@FXML private void handleExaminar() {\r\n \tDirectoryChooser dc = new DirectoryChooser();\r\n \tdc.setTitle(\"Examinar archivos\");\r\n \t\r\n \t\r\n \tFile dir = dc.showDialog(null); \r\n \t\r\n \tif(dir != null) {\r\n \t\tpath = dir.getAbsolutePath().replace('\\\\', '/');\r\n \t\ttext_examinar.setText(path);\r\n \t}\r\n \t\r\n \tlista_usuarios.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);\r\n \tlista_usuarios.setMouseTransparent( false );\r\n \tlista_usuarios.setFocusTraversable( true );\r\n }", "private void setPathToRootOfPostVersionLists() {\n if (postBlockTypeToInvestigate == PostBlockTypeToInvestigate.Text) {\n pathToSelectedRootOfPostVersionLists = Paths.get(\"testdata\", \"files to investigate\", \"text\");\n } else if (postBlockTypeToInvestigate == PostBlockTypeToInvestigate.Code) {\n pathToSelectedRootOfPostVersionLists = Paths.get(\"testdata\", \"files to investigate\", \"code\");\n }\n }", "@Override\n public void onClick(View v) \n {\n DirectoryChooserDialog directoryChooserDialog = \n new DirectoryChooserDialog(getActivity(), \n new DirectoryChooserDialog.ChosenDirectoryListener() \n {\n @Override\n public void onChosenDir(String chosenDir) \n {\n m_chosenDir = chosenDir;\n Utils.getModel(CurrentPlaylistFragment.this).saveTracksFromDir(chosenDir);\n ((MainActivity) getActivity()).goToCurrentPlaylist();\n }\n }); \n // Toggle new folder button enabling\n directoryChooserDialog.setNewFolderEnabled(m_newFolderEnabled);\n // Load directory chooser dialog for initial 'm_chosenDir' directory.\n // The registered callback will be called upon final directory selection.\n directoryChooserDialog.chooseDirectory(m_chosenDir);\n m_newFolderEnabled = ! m_newFolderEnabled;\n }", "@Test\n public void testFinder() throws WorkflowException {\n ProtocolFactory.createProtocolDocument(PROTOCOL_NUMBER, 1);\n ProtocolDocument protocolDocument1 = ProtocolFactory.createProtocolDocument(PROTOCOL_NUMBER, 2);\n\n ProtocolDocument protocolDocument2 = ProtocolFactory.createProtocolDocument(PROTOCOL_NUMBER2, 1);\n\n Protocol protocol = protocolFinder.findCurrentProtocolByNumber(PROTOCOL_NUMBER2);\n assertNotNull(protocol);\n assertEquals(protocolDocument2.getProtocol().getProtocolId(), protocol.getProtocolId());\n\n protocol = protocolFinder.findCurrentProtocolByNumber(PROTOCOL_NUMBER);\n assertNotNull(protocol);\n assertEquals(protocolDocument1.getProtocol().getProtocolId(), protocol.getProtocolId());\n }", "@Listen(\"onClick = #selectModel\")\n\tpublic void selectModel(){\n\t\ttreeModel.setOpenObjects(List.of(treeModel.getRoot().getChildren().get(path[0])));\n\t\ttreeModel.addToSelection(treeModel.getChild(path));\n\t}", "@Override\n public void onFileUploaded(FolderNode folderNode, FileNode fileNode) {\n choices.selectValue(fileNode.getName());\n closeAdditionalChoiceDialog(true);\n }", "public abstract void selectInTree(@NotNull Project project, @NotNull SModel model, boolean focus);", "private String setFolderPath(int selection) {\n\t\tString directory = \"\";\n\t\tswitch (selection) {\n\t\tcase 1:\n\t\t\tdirectory = \"\\\\art\";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tdirectory = \"\\\\mikons_1\";\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tdirectory = \"\\\\mikons_2\";\n\t\t\tbreak;\n\t\t}\n\t\treturn directory;\n\t}", "public void actionPerformed(ActionEvent e) {\n\t \tJFileChooser fileChooser = new JFileChooser(lastChoosenDir);\n\t int returnValue = fileChooser.showOpenDialog(null);\n\t if (returnValue == JFileChooser.APPROVE_OPTION) {\n\t selectedFile = fileChooser.getSelectedFile();\n\t lastChoosenDir = selectedFile.getParentFile();\n\t System.out.println(selectedFile.getName());\n\t // lblSlika=new JLabel(\"aa\");\n\t displayChosen();\n\t \n\t // content.add(lblSlika);\n\t \n\t }\n\t }", "@Override\r\n\t protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\t if (resultCode == RESULT_OK) {\r\n\t\t\t if (data != null) {\r\n\t\t\t\t // Get the URI of the selected file\r\n\t\t\t\t uri = data.getData();\r\n\t\t\t\t Log.i(TAG, \"Uri = \" + uri.toString());\r\n\t\t\t\t try {\r\n\t\t\t\t\t // Get the file path from the URI\r\n\t\t\t\t\t final String path = FileUtils.getPath(this, uri);\r\n\t\t\t\t\t Intent intent = new Intent(MainActivity.this, ShowFileActiviy.class);\r\n\t\t\t\t\t intent.putExtra(\"file_path\", path);\r\n\t\t\t\t\t startActivity(intent);\r\n\t\t\t\t } catch (Exception e) {\r\n\t\t\t\t\t Log.e(\"FileSelectorTestActivity\", \"File select error\", e);\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t }\r\n\t }", "public String getWorkflowRoot() {\n return workflowRoot;\n }", "private NodeRef getCabinetFolder(){\n LOG.debug(\"### Executing \"+ Thread.currentThread().getStackTrace()[1].getMethodName() +\" ####\");\n List<String> pathElements = new ArrayList<String>();\n pathElements.add(TradeMarkModel.CABINET_FOLDER_NAME);\n NodeRef nr = null;\n try {\n nr = fileFolderService.resolveNamePath(repositoryHelper.getCompanyHome(), pathElements).getNodeRef();\n } catch (FileNotFoundException e) {\n if(LOG.isInfoEnabled()){\n LOG.info(e.getMessage(), e);\n } \n LOG.error(e.getMessage(), e);\n }\n return nr;\n }", "public String choosePath(int chooserType) {\n JFileChooser jfc=new JFileChooser();\n jfc.setFileSelectionMode(chooserType );\n jfc.showDialog(new JLabel(), \"选择\");\n File file=jfc.getSelectedFile();\n if(file.isDirectory()){\n return file.getAbsolutePath()+\"\\\\\";\n }\n System.out.println(jfc.getSelectedFile().getName());\n return file.getAbsolutePath();\n }", "private JSONObject importFlowJSON (Path pathToFolder) {\n // Create a JSONParser to parse the content of the file\n JSONParser parser = new JSONParser();\n\n // The JSONObject instance that will be returned\n JSONObject flow;\n\n try{\n // Read and parse the json file\n flow = (JSONObject) parser.parse(new FileReader(pathToFolder.toString() + \"/\" + FLOW_FILE_NAME));\n // If the file has been found and parsed we return it as a JSONObject\n return flow;\n } catch (ParseException | IOException e) {\n // If the file hasn't been found we return null\n e.printStackTrace();\n return null;\n }\n }", "@Test(groups={\"Enterprise-only\",\"Enterprise4.2Bug\"})\n public void folderKeywordSearchTest() throws Exception\n {\n AdvanceSearchContentPage contentSearchPage = dashBoard.getNav().selectAdvanceSearch().render();\n folderSearchPage = contentSearchPage.searchLink(\"Folders\").render();\n folderSearchPage.inputKeyword(\"Contracts\");\n FacetedSearchPage searchResults = contentSearchPage.clickSearch().render();\n Assert.assertTrue(searchResults.hasResults());\n //folderSearchPage = searchResults.goBackToAdvanceSearch().render();\n //Assert.assertEquals(\"Contracts\", contentSearchPage.getKeyword());\n }", "public File getFolder() {\n return folder;\n }", "interface WithFolderPath {\n /**\n * Specifies the folderPath property: The folder path of the source control. Path must be relative..\n *\n * @param folderPath The folder path of the source control. Path must be relative.\n * @return the next definition stage.\n */\n Update withFolderPath(String folderPath);\n }", "@Override\n public void run() {\n String whichFiles = \"'\" + languageFolder.getId() + \"' in parents and \" + NOT_TRASHED + \" and \" + FOLDER + \" and \" + NOT_SPREADSHEET;\n List<File> files = getContents(whichFiles);\n \n prune(localLanguageFolder, files);\n processFolders(files, localLanguageFolder);\n }", "private void openFile() {\n \n // Initialize local variables\n File clubRecordsFolder = null;\n File opYearFolder = null;\n File eventsFolder = null;\n ClubEventCalc newClubEventCalc = new ClubEventCalc();\n StringDate strDate = newClubEventCalc.getStringDate();\n File result = null;\n String resultName = \"\";\n XFileChooser chooser = new XFileChooser ();\n chooser.setFileSelectionMode(XFileChooser.DIRECTORIES_ONLY);\n boolean ok = true;\n int progress = 0;\n String desiredFolder = \"\";\n while (ok && progress < 3) {\n switch (progress) {\n case 0: \n desiredFolder = \"Folder Containing Club Records\";\n break;\n case 1:\n chooser.setCurrentDirectory(clubRecordsFolder);\n desiredFolder = \"Folder for Desired Operating Year\";\n break;\n case 2:\n chooser.setCurrentDirectory(opYearFolder);\n desiredFolder = \"Events Folder\";\n break;\n }\n chooser.setDialogTitle (\"Specify \" + desiredFolder);\n result = chooser.showOpenDialog (this);\n if (result != null\n && result.exists()\n && result.canRead()\n && result.isDirectory()) {\n resultName = result.getName();\n boolean folderContainsOpYear = strDate.parseOpYear(resultName);\n boolean pathContainsOpYear = newClubEventCalc.setFileName(result);\n if (folderContainsOpYear) {\n opYearFolder = result;\n progress = 2;\n }\n else\n if (pathContainsOpYear) {\n eventsFolder = result;\n progress = 3;\n }\n else\n if (progress < 1) {\n clubRecordsFolder = result;\n progress = 1;\n } else {\n ok = false;\n JOptionPane.showMessageDialog(this,\n \"A Valid Operating Year Folder was not specified\",\n \"Operating Year Folder Missing\",\n JOptionPane.WARNING_MESSAGE,\n Home.getShared().getIcon());\n }\n } else {\n ok = false;\n JOptionPane.showMessageDialog(this,\n \"A Valid \" + desiredFolder + \" was not specified\",\n \"Invalid Folder Specification\",\n JOptionPane.WARNING_MESSAGE,\n Home.getShared().getIcon());\n }\n }\n \n if (ok) {\n closeFile();\n fileSpec = recentFiles.addRecentFile (result);\n handleOpenFile(fileSpec);\n }\n currentFileModified = false;\n }" ]
[ "0.5929118", "0.560747", "0.56024116", "0.55863804", "0.5586077", "0.55642444", "0.54346347", "0.541485", "0.53642166", "0.5313975", "0.52878314", "0.52510226", "0.5247363", "0.5217956", "0.51996064", "0.5190395", "0.5178008", "0.5174907", "0.51661956", "0.51649654", "0.51615655", "0.5161069", "0.5157133", "0.5150375", "0.51463604", "0.5116871", "0.5106735", "0.50828844", "0.5068085", "0.50622624", "0.5054815", "0.50536025", "0.504242", "0.5041245", "0.5031086", "0.50238657", "0.5018306", "0.5005826", "0.5001055", "0.4990553", "0.4985845", "0.4979533", "0.49740878", "0.49715877", "0.49698123", "0.4964809", "0.49412614", "0.4938261", "0.49325204", "0.49323508", "0.49297115", "0.49082655", "0.49007338", "0.48987496", "0.48858765", "0.48839957", "0.48832557", "0.4875159", "0.48645973", "0.48645973", "0.48642457", "0.4856636", "0.4856217", "0.4839565", "0.48388833", "0.48368084", "0.48235315", "0.48218232", "0.48192322", "0.48119456", "0.48081833", "0.48031163", "0.48014244", "0.4780415", "0.47801653", "0.4779494", "0.47737843", "0.47723395", "0.4771796", "0.47680637", "0.47643572", "0.47583675", "0.47517738", "0.4747224", "0.474412", "0.47430494", "0.4737903", "0.47348538", "0.47242633", "0.47223172", "0.47131297", "0.47128472", "0.47118172", "0.47081548", "0.47078928", "0.47060657", "0.47030976", "0.46932173", "0.46890092", "0.46845457" ]
0.59374315
0
Sort the files in Ascending order
public static void ascendingOrder(File folder) { try { folder.exists(); File[] listOfFiles = folder.listFiles(); Arrays.sort(listOfFiles); if (listOfFiles.length > 0) { for(int i = 0; i < listOfFiles.length; i++) { System.out.println("File :" + listOfFiles[i].getName()); } } else { System.out.println("No Files in the folder"); } } catch (Exception e) { System.out.println(e.getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void sort() {\n setFiles(getFileStreamFromView());\n }", "public static void sortFiles(List<File> files)\r\n\t{\r\n\t\t/*\r\n\t\t * bubblesort algorithm\r\n\t\t */\r\n\t\tboolean changesMade = true;\r\n\t\t\r\n\t\twhile (changesMade)\r\n\t\t{\r\n\t\t\tchangesMade = false;\r\n\t\t\t\r\n\t\t\tfor(int x=1; x<files.size(); x++)\r\n\t\t\t{\r\n\t\t\t\t/*\r\n\t\t\t\t * if file at index x has a lower number than the file\r\n\t\t\t\t * at index x-1\r\n\t\t\t\t */\r\n\t\t\t\tif(getFileNum(files.get(x)) < getFileNum(files.get(x-1)))\r\n\t\t\t\t{\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * put this file in the previous index\r\n\t\t\t\t\t */\r\n\t\t\t\t\tFile tempFile = files.get(x);\r\n\t\t\t\t\tfiles.remove(x);\r\n\t\t\t\t\tfiles.add(x-1, tempFile);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//indicate changes were made\r\n\t\t\t\t\tchangesMade = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "public static File[] getSortedFiles(File[] files){\n Arrays.sort(files, new Comparator<File>() {\t\n \tpublic int compare(File o1, File o2){\n \t\tint n1 = getPageSequenceNumber(o1.getName());\n \t\tint n2 = getPageSequenceNumber(o2.getName());\n \t\treturn n1 - n2;\n \t}\n });\n \n return files;\n\t}", "@Override\n public int compare(File o1, File o2) {\n if (desc) {\n return -o1.getFileName().compareTo(o2.getFileName());\n }\n return o1.getFileName().compareTo(o2.getFileName());\n }", "private void sortFileToScreen() throws FileNotFoundException {\n Scanner file = new Scanner(new File(FILE_NAME));\n while (file.hasNext()) {\n addToOrderedList(file.nextInt());\n }\n file.close();\n printList();\n }", "@Override\n\tpublic int compare(File f1, File f2) {\n\t\treturn f1.compareTo(f2);\n\t}", "static void mergeSortedFiles() throws IOException {\n\n\t\tBufferedReader[] bufReaderArray = new BufferedReader[noOfFiles];\n\t\tList<String> intermediateList = new ArrayList<String>();\n\t\tList<String> lineDataList = new ArrayList<String>();\n\n\t\tfor (int file = 0; file < noOfFiles; file++) {\n\t\t\tbufReaderArray[file] = new BufferedReader(new FileReader(DividedfileList.get(file)));\n\n\t\t\tString fileLine = bufReaderArray[file].readLine();\n\n\t\t\tif (fileLine != null) {\n\t\t\t\tintermediateList.add(fileLine.substring(0, 10));\n\t\t\t\tlineDataList.add(fileLine);\n\t\t\t}\n\t\t}\n\n\t\tBufferedWriter bufw = new BufferedWriter(new FileWriter(Outputfilepath));\n\n\t\t// Merge files into one file\n\n\t\tfor (long lineNumber = 0; lineNumber < totalLinesInMainFile; lineNumber++) {\n\t\t\tString sortString = intermediateList.get(0);\n\t\t\tint sortFile = 0;\n\n\t\t\tfor (int iter = 0; iter < noOfFiles; iter++) {\n\t\t\t\tif (sortString.compareTo(intermediateList.get(iter)) > 0) {\n\t\t\t\t\tsortString = intermediateList.get(iter);\n\t\t\t\t\tsortFile = iter;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbufw.write(lineDataList.get(sortFile) + \"\\r\\n\");\n\t\t\tintermediateList.set(sortFile, \"-1\");\n\t\t\tlineDataList.set(sortFile, \"-1\");\n\n\t\t\tString nextString = bufReaderArray[sortFile].readLine();\n\n\t\t\tif (nextString != null) {\n\t\t\t\tintermediateList.set(sortFile, nextString.substring(0, 10));\n\t\t\t\tlineDataList.set(sortFile, nextString);\n\t\t\t} else {\n\t\t\t\tlineNumber = totalLinesInMainFile;\n\n\t\t\t\tList<String> ListToWrite = new ArrayList<String>();\n\n\t\t\t\tfor (int file = 0; file < intermediateList.size(); file++) {\n\t\t\t\t\tif (lineDataList.get(file) != \"-1\")\n\t\t\t\t\t\tListToWrite.add(lineDataList.get(file));\n\n\t\t\t\t\twhile ((sortString = bufReaderArray[file].readLine()) != null) {\n\t\t\t\t\t\tListToWrite.add(sortString);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tCollections.sort(ListToWrite);\n\t\t\t\tint index = 0;\n\t\t\t\twhile (index < ListToWrite.size()) {\n\t\t\t\t\tbufw.write(ListToWrite.get(index) + \"\\r\\n\");\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\tbufw.close();\n\t\tfor (int file = 0; file < noOfFiles; file++)\n\t\t\tbufReaderArray[file].close();\n\t}", "@Override\n public void sortCurrentList(FileSortHelper sort) {\n }", "protected void sortCode() {\n for (int i = 1; i < codeCount; i++) {\n int who = i;\n for (int j = i + 1; j < codeCount; j++) {\n if (code[j].getFileName().compareTo(code[who].getFileName()) < 0) {\n who = j; // this guy is earlier in the alphabet\n }\n }\n if (who != i) { // swap with someone if changes made\n SketchCode temp = code[who];\n code[who] = code[i];\n code[i] = temp;\n }\n }\n }", "ArrayList<String> sortFiles(String[] allFiles){\n\n ArrayList<String> tempArrayList = new ArrayList<String>();\n ArrayList<String> returnArrayList = new ArrayList<String>();\n String[] tempArray = allFiles;\n String[] returnArray;\n\n int numOfFiles = tempArray.length;\n\n //delete nonneeded files\n for(int k = 0; k < numOfFiles; k++){\n if (tempArray[k].startsWith(\"G-\") || tempArray[k].startsWith(\"M-\") || tempArray[k].startsWith(\"I-\")){\n tempArrayList.add(tempArray[k]);\n }\n }\n\n returnArray = new String[tempArrayList.size()];\n for(int i = 0; i < tempArrayList.size(); i++){\n returnArray[i] = tempArrayList.get(i);\n }\n\n //if 0 return empty array\n if (returnArray.length < 2){\n return returnArrayList;\n }\n\n //bubble sort\n for (int i = 0; i < returnArray.length-1; i++){\n for (int j = 0; j < returnArray.length-i-1; j++){\n //get string of full number from file\n String tempFirst = returnArray[j].split(\"_\")[2] + returnArray[j].split(\"_\")[3];\n String tempSecond = returnArray[j+1].split(\"_\")[2] + returnArray[j+1].split(\"_\")[3];\n //take out csv if it is not a subgraph\n if (!tempFirst.contains(\"_subgraph_\")){\n tempFirst = tempFirst.substring(0,14);\n }\n if (!tempSecond.contains(\"_subgraph_\")){\n tempSecond = tempSecond.substring(0,14);\n }\n //get int of string\n long tempFirstNum = Long.parseLong(tempFirst);\n long tempSecondNum = Long.parseLong(tempSecond);\n //compare and swap if bigger\n if (tempFirstNum >= tempSecondNum)\n {\n String temp = returnArray[j];\n returnArray[j] = returnArray[j+1];\n returnArray[j+1] = temp;\n }\n }\n }\n\n //add elements to arraylist with newest date being first\n for(int k = returnArray.length-1; k >= 0; k--){\n returnArrayList.add(returnArray[k]);\n System.out.println(allFiles[k]);\n }\n\n return returnArrayList;\n }", "public void sort() {\n documents.sort();\n }", "public void sortAscending()\r\n\t{\r\n\t\tList<Book> oldItems = items;\r\n\t\titems = new ArrayList<Book>(items);\r\n\t\tCollections.sort(items);\r\n\t\tfirePropertyChange(\"books\", oldItems, items);\r\n\t}", "public String doSort();", "public static void sort(File input, File output) throws IOException {\n ExternalSort.mergeSortedFiles(ExternalSort.sortInBatch(input), output);\n }", "private static File[] sortFileList(File[] list, String sort_method) {\n // sort the file list based on sort_method\n // if sort based on name\n if (sort_method.equalsIgnoreCase(\"name\")) {\n Arrays.sort(list, new Comparator<File>() {\n public int compare(File f1, File f2) {\n return (f1.getName()).compareTo(f2.getName());\n }\n });\n } else if (sort_method.equalsIgnoreCase(\"size\")) {\n Arrays.sort(list, new Comparator<File>() {\n public int compare(File f1, File f2) {\n return Long.valueOf(f1.length()).compareTo(f2.length());\n }\n });\n } else if (sort_method.equalsIgnoreCase(\"time\")) {\n Arrays.sort(list, new Comparator<File>() {\n public int compare(File f1, File f2) {\n return Long.valueOf(f1.lastModified()).compareTo(f2.lastModified());\n }\n });\n }\n return list;\n }", "private static File[] sortFileList(File[] list, String sort_method) {\n // sort the file list based on sort_method\n // if sort based on name\n if (sort_method.equalsIgnoreCase(\"name\")) {\n Arrays.sort(list, new Comparator<File>() {\n public int compare(File f1, File f2) {\n return (f1.getName()).compareTo(f2.getName());\n }\n });\n }\n else if (sort_method.equalsIgnoreCase(\"size\")) {\n Arrays.sort(list, new Comparator<File>() {\n public int compare(File f1, File f2) {\n return Long.valueOf(f1.length()).compareTo(f2.length());\n }\n });\n }\n else if (sort_method.equalsIgnoreCase(\"time\")) {\n Arrays.sort(list, new Comparator<File>() {\n public int compare(File f1, File f2) {\n return Long.valueOf(f1.lastModified()).compareTo(f2.lastModified());\n }\n });\n }\n return list;\n }", "public void sort() throws IOException {\n for(int i = 0; i < 32; i++)\n {\n if(i%2 == 0){\n filePointer = file;\n onePointer = one;\n }else{\n filePointer = one;\n onePointer = file;\n }\n filePointer.seek(0);\n onePointer.seek(0);\n zero.seek(0);\n zeroCount = oneCount = 0;\n for(int j = 0; j < totalNumbers; j++){\n int n = filePointer.readInt();\n sortN(n,i);\n }\n //Merging\n onePointer.seek(oneCount*4);\n zero.seek(0L);\n for(int j = 0; j < zeroCount; j++){\n int x = zero.readInt();\n onePointer.writeInt(x);\n }\n //One is merged\n }\n }", "protected void sortResources()\n {\n PriorityComparator priorityComparator = new PriorityComparator();\n List<Resource> resources = getResources();\n Collections.sort(resources, priorityComparator);\n }", "private void sortAlphabet()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\n }", "public static <T extends FileData> void sortFileDataByOrder(List<T> fileDataToSort) {\n Collections.sort(fileDataToSort, new Comparator<T>() {\n public int compare(T o1, T o2) {\n int ret = Integer.valueOf(o1.getOrder()).compareTo(o2.getOrder());\n if (ret != 0) {\n return ret;\n }\n return OID.compareOids(o1.getUniqueOid(), o2.getUniqueOid());\n }\n });\n }", "public static List<File> sortByName(List<File> files) {\n\t\tComparator<File> comp = new Comparator<File>() {\n\t\t\t@Override\n\t\t\tpublic int compare(File file1, File file2) {\n\t\t\t\treturn file1.getName().compareTo(file2.getName());\n\t\t\t}\n\t\t};\n\t\tCollections.sort(files, comp);\n\t\treturn files;\n\t}", "public void sortPaths(List<String> paths){\n //System.out.println(\"Received LIST: \"+Arrays.toString(paths.toArray()));\n Collections.sort(paths, new Comparator<String>() {\n\n @Override\n public int compare(String o1, String o2) {\n int s1 = Integer.valueOf(o1.substring(1));\n int s2 = Integer.valueOf(o2.substring(1));\n return s2-s1;\n }\n\n });\n //System.out.println(\"AFTER SORTING LIST: \"+Arrays.toString(paths.toArray()));\n }", "public int compareFiles(File file1, File file2)\n\t\t\tthrows FileNotFoundException {\n\t\treturn _order.compareFiles(file1, file2) * (_reverse ? -1 : 1);\n\t}", "public String sortBy();", "public int compareTo (Object o) {\n return getFileName ().compareTo (((Page)o).getFileName());\n }", "public File sort(String path){\n try {\r\n File file = new File(path);\r\n BufferedReader readStream = new BufferedReader(new FileReader(file));\r\n String currentLine;\r\n int index = 0;\r\n int fileNumber = 1;\r\n while((currentLine = readStream.readLine()) != null){\r\n tempArray[index++] = currentLine;//read next line into the temporary array\r\n if(index >= limit){//check whether the number of lines stored in the temp has reached the maximum allowed\r\n Arrays.sort(tempArray);//sort tempArray\r\n Writer writeStream = null;//create a writer\r\n String currentFileName = \"temp\" + fileNumber + \".txt\";//this name is passed to the buffered writer\r\n writeStream = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(currentFileName)));//create a new temporary file to be written to\r\n fileArrayList.add(new File(currentFileName));//add file to list\r\n for(String line : tempArray){// write the lines currently stored in the array into the newly created file\r\n writeStream.write(line);\r\n writeStream.write(\"\\n\");\r\n }\r\n writeStream.close();//close the output stream\r\n index = 0;//reset\r\n ++fileNumber;//increment the file number so that the next block of lines is written to a different file name\r\n }\r\n\r\n\r\n }\r\n readStream.close();\r\n }catch(Exception e){\r\n System.out.println(e.getMessage() + \" occurred during split\");\r\n }\r\n\r\n //merge temporary files and write to output file\r\n try {\r\n System.out.println(Arrays.toString(fileArrayList.toArray()));\r\n fileArrayList.trimToSize();\r\n int sortedFileID = 0;//used to differentiate between temporary files while merging\r\n int head = 0;//used to access file names stored in array list from the start\r\n int tail = fileArrayList.size() - 1;//used to access file names stored in array list from the end\r\n while(fileArrayList.size() > 1) {\r\n sortedFileID++;//increment to create a unique file name\r\n String mergedFileName = \"sorted\"+sortedFileID+\".txt\";\r\n File firstFile = fileArrayList.get(head);\r\n File secondFile = fileArrayList.get(tail);\r\n System.out.println(head + \" + \" + tail);\r\n //merge first and second\r\n File combinedFile = mergeFiles(firstFile, secondFile, mergedFileName);\r\n //delete both temporary files once they are merged\r\n\r\n if(!secondFile.delete()){\r\n System.out.println(\"warning file could not be deleted\");\r\n }\r\n if(!firstFile.delete()){\r\n System.out.println(\"warning file could not be deleted\");\r\n }\r\n fileArrayList.set(head, combinedFile);//replace the first of the two merged files with the new combined file\r\n fileArrayList.remove(tail);//remove the second of the two merged files\r\n head++;//increment both indexes one position closer towards the center of the array list\r\n tail--;\r\n if(head >= tail){//check if there are no remaining files between the head and the tail\r\n head = 0;//reset to the beginning of the array list\r\n fileArrayList.trimToSize();\r\n tail = fileArrayList.size() - 1;//reset to the end of the array list\r\n }\r\n }\r\n }catch(Exception e){\r\n System.out.println(e.getMessage() + \" occurred during merge\");\r\n }\r\n //after iteratively merging head and tail, and storing the result at the head index\r\n //the final resulting file that combines all temporary files will be stored at index (0)\r\n return fileArrayList.get(0);//return the final combined file\r\n }", "public File[] SortFilesByName(final File[] Files, final boolean bCaseSensitive, final boolean bSortDesecnding) {\n\n File[] faFiles = null;\n Comparator<File> comparator = null;\n\n try {\n faFiles = Files.clone();\n if (faFiles == null) {\n throw new Exception(\"Null File Array Object\");\n }\n\n //check if array consists of more than 1 file\n if (faFiles.length > 1) {\n\n //creating Comparator\n comparator = new Comparator<File>() {\n\n @Override\n protected Object clone() throws CloneNotSupportedException {\n return super.clone(); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public int compare(File objFile1, File objFile2) {\n String Str1 = objFile1.getName();\n String Str2 = objFile2.getName();\n\n if (bCaseSensitive) {\n int iRetVal = objFile1.getName().compareTo(objFile2.getName());\n return iRetVal;\n } else {\n int iRetVal = objFile1.getName().compareToIgnoreCase(objFile2.getName());\n return iRetVal;\n }\n }\n };\n\n //Sorting Array\n if (bSortDesecnding) {//Descending\n\n } else {//Ascending\n Arrays.sort(faFiles, comparator);\n }\n }\n\n } catch (Exception e) {\n faFiles = null;\n } finally {\n return faFiles;\n }\n\n }", "@Override\n public void sort() throws IOException {\n long i = 0;\n // j represents the turn of writing the numbers either to g1 or g2 (or viceversa)\n long j = 0;\n long runSize = (long) Math.pow(2, i);\n long size;\n\n long startTime = System.currentTimeMillis();\n\n System.out.println(\"Strart sorting \"+ this.inputFileName);\n\n while(i <= Math.ceil(Math.log(this.n) / Math.log(2))){\n j = 0;\n do{\n size = merge(runSize, destinationFiles[(int)j % 2]);\n j += 1;\n }while (size/2 == runSize);\n\n System.out.println(\"iteration: \" + i + \", Run Size:\" + runSize + \", Total time elapsed: \" + (System.currentTimeMillis() - startTime));\n i += 1;\n runSize = (long) Math.pow(2, i);\n swipe();\n }\n System.out.println(\"The file has been sorted! Total time elapsed: \"+(System.currentTimeMillis() - startTime));\n\n destinationFiles[0].close();\n destinationFiles[1].close();\n originFiles[0].close();\n originFiles[1].close();\n\n createFile(OUT_PATH +inputFileName);\n copyFile(new File(originFileNames[0]), new File(\"out/TwoWayMergesort/OUT_\"+inputFileName));\n\n }", "public static ArrayList<File> sortOsmFiles(Set<File> files) {\n File[] sortingArray = files.toArray(new File[0]);\n Arrays.sort(sortingArray, LastModifiedFileComparator.LASTMODIFIED_COMPARATOR);\n ArrayList<File> sortedList = new ArrayList<>();\n for(int i = 0; i < sortingArray.length; i++) {\n sortedList.add(sortingArray[i]);\n }\n\n return sortedList;\n }", "public void sort() {\n }", "public static void userSort(ArrayList<FileData> fromFile, int primary_sort, int secondary_sort, int primary_order, int secondary_order)\n {\n \n // user wants to sort by primary = state code and secondary = county code\n if(primary_sort == 1 && secondary_sort == 2) \n {\n if(primary_order == 1 && secondary_order == 1){// user wants both primary and secondary in ascending order\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order == 2 && secondary_order == 2){ // user wants both primary and secondary in decending order\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){// primary is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){//primary is descending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n // user wants to sort by primary = county code and secondary = state code\n if(primary_sort == 2 && secondary_sort == 1){\n if(primary_order == 1 && secondary_order == 1){\n //primary and seconary is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order == 2 && secondary_order == 2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){//primary is ascending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code()); // primary sort\n \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){//primary is descending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code().reversed()); // primary sort\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==1&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Name()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new Sort_State_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new Sort_County_Name()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new Sort_County_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==1&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount());\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information \n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information \n } \n } \n }\n \n \n if(primary_sort==1&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); \n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); \n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n \n if(primary_sort==8&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new Sort_State_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new Sort_County_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new Sort_County_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==2&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==6&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==2&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==7&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==8&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==3&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==4&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==5&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==8&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==8&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order == 2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n }", "public void listSort() {\n\t\tCollections.sort(cd);\n\t}", "private void sort() {\n Collections.sort(mEntries, new Comparator<BarEntry>() {\n @Override\n public int compare(BarEntry o1, BarEntry o2) {\n return o1.getX() > o2.getX() ? 1 : o1.getX() < o2.getX() ? -1 : 0;\n }\n });\n }", "private void sort()\n {\n pd = new ProgressDialog(this);\n pd.setMessage(\"Sorting movies...\");\n pd.setCancelable(false);\n pd.show();\n\n movieList.clear();\n if(show.equals(\"notWatched\"))\n watched(false);\n else if(show.equals(\"watched\"))\n watched(true);\n else movieList.addAll(baseMovieList);\n\n if(orderBy.equals(\"alphabet\"))\n sortAlphabet();\n else if(orderBy.equals(\"date\"))\n sortDate();\n else sortRating();\n\n if(orderType)\n Collections.reverse(movieList);\n\n recyclerView.setAdapter(movieAdapter);\n pd.dismiss();\n }", "public static void main(String[] args) {\n\n File folder = new File(\"D:\\\\UNSORTED TBW\\\\\");\n File[] listOfFiles = folder.listFiles();\n String defaultPath = \"D:\\\\UNSORTED TBW\\\\\";\n\n\n //for loop for each file in the list\n for (int i = 0; i < listOfFiles.length; i++) {\n if (listOfFiles[i].isFile()) {\n\n //splits file name with - Only want the name before - so we call for 0.\n //This is the deafult way of show my shows are sorted.\n // also adds a - in the string in case there is no - in file\n String fileName = listOfFiles[i].getName() + \"-\";\n String[] names = fileName.split(\"-\");\n //System.out.print(names[0]+\"\\n\");\n Path folderPath = Paths.get(defaultPath + names[0].trim() + \"\\\\\");\n System.out.print(folderPath + \"\\n\");\n File directory = new File(String.valueOf(folderPath));\n\n //checks if directory exists. if does not exist, make new directory.\n if (!directory.exists()) {\n //makes a directory if not exists\n directory.mkdir();\n }\n //sets initial file directory\n File dirA = listOfFiles[i];\n //renames the file path of the file i nthe if loop\n //returns a user response if successful or not\n if (dirA.renameTo(new File(String.valueOf(folderPath) + \"\\\\\" + dirA.getName()))) {\n System.out.print(\"Move success\");\n } else {\n System.out.print(\"Failed\");\n }\n }\n }\n }", "public void sort() {\r\n\t\tCollections.sort(parts);\r\n\t}", "protected void sort() {\n\n\t\tCollections.sort(this.myRRList);\n\t}", "public void sortByName(String file) throws FileNotFoundException, IOException, ParseException {\n\t\tarrayList = pareseFile(file);\n\t\tFile file1 = new File(file);\n\t\t/*\n\t\t * for (int i = 0; i < arrayList.size(); i++) { JSONObject\n\t\t * person1=(JSONObject)arrayList.get(i); //person1.get(\"lastName\");\n\t\t * arrayList.sort((Person.CompareByName)person1); }\n\t\t */\n\t\t// mapper.writeValue(file1, arrayList);\n\t\tfor (int i = 0; i < arrayList.size() - 1; i++) {\n\t\t\tfor (int j = 0; j < arrayList.size() - i - 1; j++) {\n\n\t\t\t\tJSONObject person1 = (JSONObject) arrayList.get(j);\n\t\t\t\tJSONObject person2 = (JSONObject) arrayList.get(j + 1);\n\t\t\t\tif ((person1.get(\"lastName\").toString()).compareToIgnoreCase(person2.get(\"lastName\").toString()) > 0) {\n\t\t\t\t\tJSONObject temp = person1;\n\t\t\t\t\tarrayList.set(j, person2);\n\t\t\t\t\tarrayList.set(j + 1, temp);\n\t\t\t\t}\n\t\t\t}\n\t\t\tmapper.writeValue(file1, arrayList);\n\n\t\t}\n\t}", "static void doSort(int location) throws Exception {\n\n\t\tList<String> sortedList = null;\n\n\t\tsortedList = readDataFile(DividedfileList.get(location));\n\t\tCollections.sort(sortedList);\n\t\twriteFile(sortedList, location);\n\t\tsortedList.clear();\n\n\t}", "@Override\n public int compare(FileNameExtensionFilter ext1, FileNameExtensionFilter ext2)\n {\n return ext1.getDescription().toLowerCase().compareTo(ext2.getDescription().toLowerCase());\n }", "public int compare(File file, File file2) {\n if (file.lastModified() > file2.lastModified()) {\n return 1;\n }\n if (file.lastModified() == file2.lastModified()) {\n return 0;\n }\n return -1;\n }", "public int compare(File file, File file2) {\n if (file == null || file2 == null || file.lastModified() >= file2.lastModified()) {\n return (file == null || file2 == null || file.lastModified() != file2.lastModified()) ? 1 : 0;\n }\n return -1;\n }", "public List<String> sortFilesByExtensions(String[] listOfFileNames) throws DirectoryException{\r\n\t\tList<String> orginalList = new CopyOnWriteArrayList<>(Arrays.asList(listOfFileNames));\r\n\t\tSet<String> setOfuniqueExtension = new TreeSet<>();\r\n\r\n\t\tfor (String item : listOfFileNames) {\r\n\t\t\tif (item.contains(\".\")) {\r\n\t\t\t\tString[] split = item.split(HelperContstants.DELIMETER);\r\n\t\t\t\tString temp = \".\" + split[split.length - 1];\r\n\t\t\t\tsetOfuniqueExtension.add(temp);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tList<String> finalListOfAllFiles = new LinkedList<>();\r\n\t\tsetOfuniqueExtension.stream().forEach((s1) -> {\r\n\t\t\tfor (int i = 0; i < orginalList.size(); i++) {\r\n\t\t\t\tif (orginalList.get(i).contains(s1)) {\r\n\t\t\t\t\tfinalListOfAllFiles.add(orginalList.get(i));\r\n\t\t\t\t\torginalList.remove(orginalList.get(i));\r\n\t\t\t\t\ti--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\torginalList.stream().filter((s1) -> (!finalListOfAllFiles.contains(s1))).forEach((s1) -> {\r\n\t\t\tfinalListOfAllFiles.add(s1);\r\n\t\t});\r\n\r\n\t\treturn finalListOfAllFiles;\r\n\t}", "void sort();", "void sort();", "@Override\n\tpublic int compareTo(File pathname) {\n\t\treturn this.index - new IndexedFile(pathname.getAbsolutePath()).index;\n\t}", "public void sort() {\n Collections.sort(tasks);\n }", "public int compareTo(AppFile aAF)\n{\n if(_priority!=aAF._priority) return _priority>aAF._priority? -1 : 1;\n return _file.compareTo(aAF._file);\n}", "@Override\r\n\tpublic void sortASC(int[] array) {\n\t\t\r\n\t\tfor (int i = 0; i < array.length; i++) {\r\n\t\t\tfor (int j = i + 1; j < array.length; j++) {\r\n\t\t\t\t\r\n\t\t\t\tif (array[i] > array[j]) {\r\n\t\t\t\t\tint temp = array[i];\r\n\t\t\t\t\tarray[i] = array[j];\r\n\t\t\t\t\tarray[j] = temp;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "private Stream<File> sort(final Stream<File> fileStream) {\n return fileStream.sorted(new FileMetaDataComparator(callback.orderByProperty().get(),\n callback.orderDirectionProperty().get()));\n }", "public void sort () {\n\t\t\n\t\t// Clear iterator\n\t\titer = null;\n\t\t\n\t\tCollections.sort(this.pathObjects, new Comparator<PathObject>() {\n\t\t @Override\n\t\t public int compare(PathObject lhs, PathObject rhs) {\n\t\t // -1 - less than, 1 - greater than, 0 - equal, all inversed for descending\n\t\t return Double.compare(lhs.getClassProbability(), rhs.getClassProbability()); // Use double compare to safely handle NaN and Infinity\n\t\t }\n\t\t});\n\t\t\n\t\titer = this.pathObjects.iterator();\n\t}", "public int compare(File file, File file2) {\n int i = ((file.lastModified() - file2.lastModified()) > 0 ? 1 : ((file.lastModified() - file2.lastModified()) == 0 ? 0 : -1));\n if (i > 0) {\n return 1;\n }\n return i == 0 ? 0 : -1;\n }", "public int compare(File file, File file2) {\n if (file == null || file2 == null || file.lastModified() >= file2.lastModified()) {\n return (file == null || file2 == null || file.lastModified() != file2.lastModified()) ? 1 : 0;\n }\n return -1;\n }", "public File[] SortFilesByDate(final File[] Files, final boolean bSortDesecnding) {\n\n File[] faFiles = null;\n Comparator<File> comparator = null;\n\n try {\n faFiles = Files.clone();\n if (faFiles == null) {\n throw new Exception(\"Null File Array Object\");\n }\n\n //check if array consists of more than 1 file\n if (faFiles.length > 1) {\n\n //creating Comparator\n comparator = new Comparator<File>() {\n\n @Override\n protected Object clone() throws CloneNotSupportedException {\n return super.clone(); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public int compare(File objFile1, File objFile2) {\n String Str1 = objFile1.getName();\n String Str2 = objFile2.getName();\n if (bSortDesecnding) {\n int iRetVal = objFile1.getName().compareTo(objFile2.getName());\n return iRetVal;\n } else {\n int iRetVal = objFile1.getName().compareToIgnoreCase(objFile2.getName());\n return iRetVal;\n }\n }\n };\n\n //Sorting Array\n Arrays.sort(faFiles, comparator);\n }\n\n } catch (Exception e) {\n faFiles = null;\n } finally {\n return faFiles;\n }\n\n }", "public int compare(File file, File file2) {\n int i = ((file.lastModified() - file2.lastModified()) > 0 ? 1 : ((file.lastModified() - file2.lastModified()) == 0 ? 0 : -1));\n if (i > 0) {\n return 1;\n }\n return i == 0 ? 0 : -1;\n }", "public int compare(File file, File file2) {\n int i = ((file.lastModified() - file2.lastModified()) > 0 ? 1 : ((file.lastModified() - file2.lastModified()) == 0 ? 0 : -1));\n if (i > 0) {\n return 1;\n }\n return i == 0 ? 0 : -1;\n }", "private void refreshList() {\n setTitle(this.path.get(this.path.size() - 1));\n\n // Read all files sorted into the values-array\n values.clear();\n File dir = new File(this.path.get(this.path.size() - 1));\n if (!dir.canRead()) {\n setTitle(getTitle() + \" (inaccessible)\");\n }\n String[] list = dir.list();\n if (list != null) {\n for (String file : list) {\n if (!file.startsWith(\".\")) {\n values.add(file);\n }\n }\n }\n Collections.sort(values);\n }", "private String doSortOrder(SlingHttpServletRequest request) {\n RequestParameter sortOnParam = request.getRequestParameter(\"sortOn\");\n RequestParameter sortOrderParam = request.getRequestParameter(\"sortOrder\");\n String sortOn = \"sakai:filename\";\n String sortOrder = \"ascending\";\n if (sortOrderParam != null\n && (sortOrderParam.getString().equals(\"ascending\") || sortOrderParam.getString()\n .equals(\"descending\"))) {\n sortOrder = sortOrderParam.getString();\n }\n if (sortOnParam != null) {\n sortOn = sortOnParam.getString();\n }\n return \" order by @\" + sortOn + \" \" + sortOrder;\n }", "private void orderer(double[] sizes, File[] files) {\r\n for (int i = 0; i < sizes.length - 1; i++) {\r\n boolean flag = true;\r\n if(i < sizes.length -1) {\r\n if (sizes[i] > sizes[i + 1]) { // this file size is bigger than the next\r\n\r\n double tempInt = sizes[i]; // switch between them\r\n sizes[i] = sizes[i + 1];\r\n sizes[i + 1] = tempInt;\r\n\r\n File tempFile = files[i];\r\n files[i] = files[i + 1];\r\n files[i + 1] = tempFile;\r\n\r\n flag = false; // there was a switch made, make sure we go over it all again\r\n }\r\n }\r\n else {\r\n if (!flag){ // we're not done ordering, restart\r\n i = -1;\r\n }\r\n }\r\n }\r\n }", "public void sort()\n {\n RecordComparator comp = new RecordComparator(Context.getCurrent().getApplicationLocale());\n if (comp.hasSort)\n sort(comp);\n }", "private void sortDate()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getReleaseDate().compareTo(b.getReleaseDate());\n if( result < 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n else if(result == 0)\n {\n result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\n }\n }", "public void sortAlphabetically()\r\n {\r\n PrintWriter output;\r\n int i, x, t1;\r\n String t0;\r\n \r\n //insertion sort\r\n for (x = 1; x < countries.length; x++) //iterates through\r\n {\r\n t0 = countries[x]; //stores the temps\r\n t1 = population[x];\r\n i = x - 1; //sets i to the previous element\r\n while (i >= 0) {\r\n if (t0.compareTo(countries[i]) > 0) //if previous is already sorted(greater means it is higher on the alphabet(e.g. t0 could be 'c', countries[i] 'e'))\r\n break;\r\n countries[i + 1] = countries[i]; //if not, swap the positions\r\n population[i + 1] = population[i];\r\n i--;\r\n }\r\n countries[i + 1] = t0; //sets it back to temp\r\n population[i + 1] = t1;\r\n }\r\n try\r\n {\r\n output = new PrintWriter (new FileWriter (\"sortedByCountry.txt\")); //saves\r\n \r\n //prints to the file\r\n for (int a = 0 ; a < countries.length ; a++)\r\n output.printf(\"%-1s \\t\\t\\t\\t %,d %n\", countries[a], population[a]);\r\n output.close (); //closes stream\r\n }\r\n catch (IOException e)\r\n {\r\n JOptionPane.showMessageDialog (null, \"Something went wrong with the input or output operations!\"); //error message\r\n }\r\n }", "public static void sortInputExternalMerge() {\r\n\t\tExternalMultiwayMerge merge = new ExternalMultiwayMerge();\r\n\t\tmerge.sort(inputFile, M, d);\r\n\t}", "public static void mergesort (File A) throws IOException {\r\n\t\tFile copy = File.createTempFile(\"Mergesort\", \".bin\");\r\n\t\tcopyFile (A, copy);\r\n\r\n\t\tRandomAccessFile src = new RandomAccessFile(A, \"rw\");\r\n\t\tRandomAccessFile dest = new RandomAccessFile(copy, \"rw\");\r\n\t\tFileChannel srcC = src.getChannel();\r\n\t\tFileChannel destC = dest.getChannel();\r\n\t\tMappedByteBuffer srcMap = srcC.map (FileChannel.MapMode.READ_WRITE, 0, src.length());\r\n\t\tMappedByteBuffer destMap = destC.map (FileChannel.MapMode.READ_WRITE, 0, dest.length());\r\n\r\n\t\tmergesort (destMap, srcMap, 0, (int) A.length());\r\n\t\t\r\n\t\tsrc.close();\r\n\t\tdest.close();\r\n\t\tcopy.deleteOnExit();\r\n\t}", "@Override\r\n\t\t\tpublic int compare(File o1, File o2) {\n\t\t\t\treturn Long.compare(o1.lastModified(), o2.lastModified());\r\n\t\t\t}", "@Override\r\n\t\t\tpublic int compare(File o1, File o2) {\n\t\t\t\treturn Long.compare(o2.lastModified(), o1.lastModified());\r\n\t\t\t}", "boolean isSortAscending();", "public static int mergeSortedFiles(List<File> files, File outputfile,\n final Comparator<String> cmp) throws IOException {\n return mergeSortedFiles(files, outputfile, cmp,\n Charset.defaultCharset());\n }", "public static List<File> sortInBatch(File file)\n throws IOException {\n return sortInBatch(file, defaultcomparator, DEFAULTMAXTEMPFILES, DEFAULT_MAX_MEM_BYTES,\n Charset.defaultCharset(), null, false);\n }", "private void sort() {\n\t\tCollections.sort(this.entities, comparator);\n\t}", "private void mapSortedFiles(String file1, String file2) {\n\t\tString file1Copy = tempPath + tempFileName.getTempFileName(sourcePath1, \"Mapper\");\r\n\t\tString file2Copy = tempPath + tempFileName.getTempFileName(sourcePath2, \"Mapper\");\r\n\r\n\t\tcreateFileCopy(new File(file1).toPath(), file1Copy);\r\n\t\tcreateFileCopy(new File(file2).toPath(), file2Copy);\r\n\r\n\t\ttry {\r\n\t\t\tLineIterator file1Iterator = FileUtils.lineIterator(new File(file1));\r\n\r\n\t\t\tLineIterator file2Iterator = FileUtils.lineIterator(new File(file2));\r\n\r\n\t\t\tint leftIndex = 0;\r\n\t\t\tint rightIndex = 0;\r\n\r\n\t\t\twhile (file1Iterator.hasNext()) {\r\n\r\n\t\t\t\tString left = file1Iterator.nextLine();\r\n\t\t\t\tString right = file2Iterator.nextLine();\r\n\r\n\t\t\t\tString leftSortKey = getSortKey(left);\r\n\t\t\t\tString rightSortKey = getSortKey(right);\r\n\t\t\t\t\r\n\t\t\t\tleftIndex++;\r\n\t\t\t\trightIndex++;\r\n\t\t\t\t\r\n\r\n\t\t\t\twhile (leftSortKey.compareTo(rightSortKey) > 0) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//System.out.println(leftSortKey +\", \" + rightSortKey);\r\n\r\n\t\t\t\t\tList<String> lines = Files.readAllLines(Paths.get(file1Copy));\r\n\t\t\t\t\tlines.add(leftIndex-1, getEmptyLine());\r\n\t\t\t\t\tFiles.write(Paths.get(file1Copy), lines);\r\n\r\n\t\t\t\t\trightIndex++;\r\n\t\t\t\t\tright = file2Iterator.nextLine();\r\n\t\t\t\t\trightSortKey = getSortKey(right);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\twhile (leftSortKey.compareTo(rightSortKey) < 0) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//System.out.println(leftSortKey +\", \" + rightSortKey);\r\n\r\n\t\t\t\t\tList<String> lines = Files.readAllLines(Paths.get(file2Copy));\r\n\t\t\t\t\tlines.add(rightIndex-1, getEmptyLine());\r\n\t\t\t\t\tFiles.write(Paths.get(file2Copy), lines);\r\n\r\n\t\t\t\t\tleftIndex++;\r\n\t\t\t\t\tleft = file1Iterator.nextLine();\r\n\t\t\t\t\tleftSortKey = getSortKey(left);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(\"Temp file was not found: \" + e.getMessage());\r\n\t\t}\r\n\r\n\t}", "public int compare(File file, File file2) {\n return Long.valueOf(file.lastModified()).compareTo(Long.valueOf(file2.lastModified()));\n }", "@Override\n public int compare(File arg0, File arg1) {\n long diff = arg0.lastModified() - arg1.lastModified();\n if (diff > 0)\n return -1;\n else if (diff == 0)\n return 0;\n else\n return 1;\n }", "public void sortToDo(){\n\t\tCollections.sort(allToDoLists);\n\t}", "public void sort() {\n Card.arraySort(this.cards, this.topCard);\n }", "private static void alphabetize() {\r\n Collections.sort(kwicIndex, String.CASE_INSENSITIVE_ORDER);\r\n }", "public void sort(Comparator<? super AudioFile> comparator) {\n Collections.sort(mObjects, comparator);\n if (mNotifyOnChange) notifyDataSetChanged();\n }", "protected Sort getSortASC() {\n Sort.Order order = new Sort.Order(Sort.Direction.ASC, \"id\");\n return Sort.by(order);\n }", "public static void Java_ls(File dir, String display_method, String sort_method) {\n // TODO: list files\n File[] fileList = dir.listFiles();\n if (display_method == null) {\n for (File file : fileList) {\n System.out.println(file.getName());\n }\n } else if (sort_method == null) {\n for (File file : fileList) {\n System.out.format(\"%-15s Size: %-10s Last Modified: %-40s\", file.getName(), file.length(), new Date(file.lastModified()));\n System.out.println();\n }\n } else {\n File[] sorted = sortFileList(fileList, sort_method);\n for (File file : sorted) {\n System.out.format(\"%-15s Size: %-10s Last Modified: %-40s\", file.getName(), file.length(), new Date(file.lastModified()));\n System.out.println();\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}", "public void step1(){\n\n Collections.sort(names, new Comparator<String>() {\n @Override\n public int compare(String a, String b) {\n return b.compareTo(a);\n }\n });\n }", "public ArrayList<String> getSortedNames() throws Exception {\n FileReader fileReader = new FileReader();\n // Tell FileReader the file path\n fileReader.setFilePath(\"src/main/java/ex41/base/exercise41_input.txt\");\n // use FileReader to get an Arraylist and store it\n ArrayList<String> names = fileReader.getStrings();\n // call sort method to sort arraylist and return that\n return sort(names);\n }", "public void sort() {\r\n for (int i = 0; i < namesOfApp.length && i < runTimeOfApp.length; i++) {\r\n for (int j = 0; j < i; j++) {\r\n if (runTimeOfApp[j] < runTimeOfApp[i]) {\r\n String tempName = namesOfApp[i];\r\n long tempRunTime = runTimeOfApp[i];\r\n namesOfApp[i] = namesOfApp[j];\r\n runTimeOfApp[i] = runTimeOfApp[j];\r\n namesOfApp[j] = tempName;\r\n runTimeOfApp[j] = tempRunTime;\r\n }\r\n }\r\n }\r\n\r\n }", "private void testZipfileOrder(Path out) throws IOException {\n ZipFile outZip = new ZipFile(out.toFile());\n Enumeration<? extends ZipEntry> entries = outZip.entries();\n int index = 0;\n LinkedList<String> entryNames = new LinkedList<>();\n // We expect classes*.dex files first, in order, then the rest of the files, in order.\n while(entries.hasMoreElements()) {\n ZipEntry entry = entries.nextElement();\n if (!entry.getName().startsWith(\"classes\") || !entry.getName().endsWith(\".dex\")) {\n entryNames.add(entry.getName());\n continue;\n }\n if (index == 0) {\n Assert.assertEquals(\"classes.dex\", entry.getName());\n } else {\n Assert.assertEquals(\"classes\" + (index + 1) + \".dex\", entry.getName());\n }\n index++;\n }\n // Everything else should be sorted according to name.\n String[] entriesUnsorted = entryNames.toArray(StringUtils.EMPTY_ARRAY);\n String[] entriesSorted = entryNames.toArray(StringUtils.EMPTY_ARRAY);\n Arrays.sort(entriesSorted);\n Assert.assertArrayEquals(entriesUnsorted, entriesSorted);\n }", "public void testCompareViaSort() throws Exception {\n\n String correctlySortedNames[] = {\n \"0000_aaa\",\n \"0000_bbb\",\n \"1111DC_U_022107_L99_Sum.lsm\",\n \"6325DC_U_022107_L0_Sum.lsm\",\n \"6325DC_U_022107_L1_Sum.lsm\",\n \"6325DC_U_022107_L2_Sum.lsm\",\n \"6325DC_U_022107_L8_Sum.lsm\",\n \"6325DC_U_022107_L9_Sum.lsm\",\n \"6325DC_U_022107_L10_Sum.lsm\",\n \"6325DC_U_022107_L11_Sum.lsm\",\n \"6325DC_U_022107_L20_Sul.lsm\",\n \"6325DC_U_022107_L20_Sum.lsm\",\n \"6325DC_U_022107_L20_Sun.lsm\",\n \"6325DC_U_022107_L21_Sum.lsm\",\n \"6325DC_U_022107_L22_Sum.lsm\",\n \"6325DC_U_022107_L99_Sum.lsm\",\n \"6325DC_U_022107_L111_Sum.lsm\",\n \"6325DC_U_022107_L222_Sum.lsm\",\n \"7777DC_U_022107_L22_Sum.lsm\",\n \"9999_aaa\",\n \"9999_bbb\" \n };\n\n FileTarget[] targets = new FileTarget[correctlySortedNames.length];\n\n int index = 0;\n for (String name : correctlySortedNames) {\n int reverseOrder = targets.length - 1 - index;\n File file = new File(name);\n targets[reverseOrder] = new FileTarget(file);\n index++;\n }\n\n Arrays.sort(targets, new LNumberComparator());\n\n index = 0;\n for (FileTarget target : targets) {\n assertEquals(\"name \" + index + \" of \" + targets.length +\n \" was not sorted correctly\",\n correctlySortedNames[index], target.getName());\n index++;\n }\n }", "public void sort() {\n\tqsort(a,0,a.length-1);\n }", "static List sort(String[] file){\n\t\tList main = new List();\n\t\t// appends the first item to the new list\n\t\tif(file.length > 0){\n\t\t\tmain.append(0);\t\n\t\t}\n\t\t// loops through input array\n\t\tfor(int i = 1; i<file.length; i++){\n\t\t\tString word = file[i];\n\t\t\tint cursor = i-1;\n\t\t\tmain.moveTo(cursor);\n\t\t\t// loops through each list and checks to see if the value is similar\n\t\t\twhile(cursor>-1 && word.compareTo(file[main.getElement()])<1){\n\t\t\t\tcursor--;\n\t\t\t\tmain.movePrev();\n\t\t\t}\n\t\t\t// if it makes it to the end of the list prepend it to the list, \n\t\t\t// but if it isn't insert it after the current element\n\t\t\tif(main.getIndex() == -1){\n\t\t\t\tmain.prepend(i);\n\t\t\t}else {\n\t\t\t\tmain.insertAfter(i);\n\t\t\t}\n\t\t}\n\t\t// returns the finished list\n\t\treturn main;\n\t}", "public static int mergeSortedFiles(List<File> files, File outputfile,\n final Comparator<String> cmp, Charset cs) throws IOException {\n return mergeSortedFiles(files, outputfile, cmp, cs, false);\n }", "JDKSort() {\n }", "public static void userSort(ArrayList<String>list) throws FileNotFoundException{\r\n\t\tCollections.sort(list, new Comparator<String>(){\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(String o1, String o2) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t//Take the first string, split according to \";\", and store in an arraylist\r\n\t\t\t\tString[] values = o1.split(\";\");\r\n\t\t\t\t//Take the second string and do the same thing\r\n\t\t\t\tString[] values2 = o2.split(\";\");\r\n\t\t\t\t//Compare strings according to their integer values\r\n\t\t\t\treturn Integer.valueOf(values[0].replace(\"\\\"\", \"\")).compareTo(Integer.valueOf(values2[0].replace(\"\\\"\", \"\")));\r\n\t\t\t}\r\n\t\t});\r\n\t\t//Output sorted ArrayList to a text file\r\n\t\t@SuppressWarnings(\"resource\")\r\n\t\tPrintStream out = new PrintStream(new FileOutputStream(\"SortedUsers.txt\"));\r\n\t\t\tfor(int i = 0; i < list.size(); i++){\r\n\t\t\t\tout.println(list.get(i));\r\n\t\t\t}\r\n\t}", "public void sortEvents() {\n\t\tCollections.sort(events);\n\t}", "private void externalSort() throws IOException{\n\t\t/*\n\t\t * Pass 0: internal sort\n\t\t */\n\t\t// Read in from child;Write out runs of B pages;\n\t\t\n\t\tint numPerRun = B * 4096 / (schema.size() * 4); // # of tuples per run given in Pass0\n\t\tboolean buildMore;\n\t\tint numRuns = 0;\n\t\tif(sortAttrsIndex == null) {\n\t\t\tthis.buildAttrsIndex();\n\t\t}\n\t\texComparator myComp = new exComparator();\n\t\tinternal = new PriorityQueue<Tuple>(myComp);\n\t\tdo {\n\t\t\tbuildMore = this.buildHeap(numPerRun);\n\t\t\tnumRuns++;\n\t\t\t\n\t\t\t// write out the (numRuns)th run\n\t\t\tTupleWriter TW;\n\t\t\tif(!buildMore && numRuns == 1) {\n\t\t\t\tTW = new TupleWriter(new FileOutputStream(tempsubdir + \"sortResult\"));\n\t\t\t} else {\n\t\t\t\tTW = new TupleWriter(new FileOutputStream(tempsubdir + \"0_\" + numRuns));\n\t\t\t}\n\t\t\twhile(!internal.isEmpty()) {\n//\t\t\t\tSystem.out.println(internal.peek().data);\n\t\t\t\tTW.setNextTuple(internal.poll()); \n\t\t\t}\n\t\t\t// leftover, fill with zero and write out\n\t\t\tif(!TW.bufferEmpty()) { // TW would never know the end of writing\n\t\t\t\tTW.fillFlush(); \n\t\t\t}\n\t\t\tTW.close();\n\t\t\t// internal must be empty until this point\n\t\t}while (buildMore);\n\t\t\n\t\t/*\n\t\t * Pass 1 and any following\n\t\t */\n\t\tif(numRuns > 1) { // if numRuns generated in Pass 0 is 1 already, file sorted already, no need to merge\n\t\t\tthis.merge(numRuns, myComp);\n\t\t}\n\t\t\n\t}", "@Override\n \tpublic void sort() {\n \t\tArrays.sort(data);\n \t}", "public static void sortAsc(int[] theArray) {\n Arrays.sort(theArray);\n }", "private void sort(int[] fields) {\n\t\tsort(fields, (currentSort.length == 1 && currentSort[0] == fields[0]) ? !reverseSort : false);\r\n\t}", "protected void createFileList()\n {\n // get a sorted array of files\n File f = new File(appManagementDir);\n String[] files = f.list(new FileFilter(AppSettings.getFilter()));\n \n // get the adapter for this file list\n ArrayAdapter<String> a = (ArrayAdapter<String>)fileList.getAdapter();\n a.clear();\n \n // clear the check boxes\n fileList.clearChoices();\n \n if (files != null && files.length > 0)\n {\n Arrays.sort(files, 0, files.length, new Comparator<Object>() {\n \n @Override\n public int compare(Object object1, Object object2)\n {\n int comp = 0;\n if (object1 instanceof String \n && object2 instanceof String)\n {\n String str1 = (String)object1;\n String str2 = (String)object2;\n \n comp = str1.compareToIgnoreCase(str2);\n }\n \n return comp;\n }});\n \n \n // add all the files\n for (String fileName : files)\n {\n a.add(fileName);\n }\n \n fileList.invalidate();\n }\n }", "public void sort(){\n\t\tCollections.sort(_ligacoes, (new Comparator<Ligacao>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Ligacao l1, Ligacao l2){\n\t\t\t\tint resultado = Integer.compare(l1.getCusto(), l2.getCusto());\n\t\t\t\tif (resultado == 0)\n\t\t\t\t\tresultado = Boolean.compare(l1.isAerea(), l2.isAerea());\n\t\t\t\treturn resultado;\n\t\t\t}\n\t\t}));\n\t}", "private void mergeSort(int amtFiles, String outputFile) throws IOException {\n // Base case\n if (amtFiles > 1) {\n for (int i = 1; i <= amtFiles; i += 2) {\n\n if (i <= amtFiles - 1) {\n try (Scanner file1 = new Scanner(Paths.get(outputFile + i + \".txt\"));\n Scanner file2 = new Scanner(Paths.get(outputFile + (i + 1) + \".txt\"));\n BufferedWriter writer = Files.newBufferedWriter(Paths.get(outputFile + \".txt\"),\n StandardCharsets.UTF_8);) {\n merge(file1, file2, writer);\n\n } // close the Scanner and BufferedWriter\n // Replace a file\n Files.move(Paths.get(outputFile + \".txt\"), Paths.get(outputFile + ((i + 1) / 2) + \".txt\"),\n StandardCopyOption.REPLACE_EXISTING);\n } else {\n Files.move(Paths.get(outputFile + i + \".txt\"), Paths.get(outputFile + ((i + 1) / 2) + \".txt\"),\n StandardCopyOption.REPLACE_EXISTING);\n } // end of if\n } // end of for\n\n amtFiles = (amtFiles / 2) + (amtFiles % 2);\n mergeSort(amtFiles, outputFile);\n } // end of if\n }", "public void sortTasks() {\n tasks.sort(null);\n }", "public static void sort(String f1, String f2) throws FileNotFoundException, IOException {\n\t\tDataInputStream input = new DataInputStream(new BufferedInputStream(new FileInputStream(new File(f1))));\n\t\tfileSize = (int) input.available()/4;\n\t\tif (fileSize == 0){ input.close(); return;} //file is empty\t\n\t\t\n\t\tRandomAccessFile f1a = new RandomAccessFile(f1,\"rw\");\n\t\tRandomAccessFile f2a = new RandomAccessFile(f2,\"rw\");\n\t\tDataOutputStream f1d = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(f1a.getFD())));\n\t\tDataOutputStream f2d = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(f2a.getFD())));\n\t\t\n\t\t//perform quicksort on partitions of quickSortSize\n\t\tquickSortSize = (int) (Math.min(quickSortSize, fileSize)); \n\t\tint numDivisions = (int) (Math.floor(fileSize/quickSortSize));\n\t\tint excess = (int) (fileSize%(numDivisions*quickSortSize));\n\t\tint[] tmp = new int[quickSortSize];\n\t\tfor (int j = 0; j < numDivisions; j++){\n\t\t\tfor (int i = 0; i< quickSortSize; i++){\n\t\t\t\ttmp[i] = input.readInt();\n\t\t\t}\n\t\t\tquickSort(tmp);\n\t\t\tfor (int i: tmp){\n\t\t\t\tf2d.writeInt(i);\n\t\t\t}\n\t\t}\n\t\ttmp = new int[excess];\n\t\tfor (int i = 0; i< excess; i++){\n\t\t\ttmp[i] = input.readInt();\n\t\t}\n\t\tquickSort(tmp);\n\t\tfor (int i: tmp){\n\t\t\tf2d.writeInt(i);\n\t\t}\n\t\tf2d.flush();\n\t\tinput.close();\n\t\t\n\t\t//Perform Merge sort on the larger partitions\n\t\tint iteration = (int) Math.ceil(Math.log(fileSize/(quickSortSize))/Math.log(2));\n\t\tfor (int i = 0; i < iteration; i++){\n\t\t\tint size = (int) Math.pow(2, i)*quickSortSize;\n\t\t\tif (i%2 == 0){ \n\t\t\t\tf1a.seek(0);\n\t\t\t\tstepSorter(f2, f1d, size);\n\t\t\t} else {\n\t\t\t\tf2a.seek(0);\n\t\t\t\tstepSorter(f1, f2d, size);\n\t\t\t}\n\t\t}\n\n\t\t//Copies f2 to f1 if the iteration ends with f2\n\t\tif (iteration%2==0){\n\t\t\tFileChannel source = null;\n\t\t\tFileChannel destination = null;\n\t\t\ttry {\n\t\t\t\tsource = new FileInputStream(f2).getChannel();\n\t\t\t\tdestination = new FileOutputStream(f1).getChannel();\n\t\t destination.transferFrom(source, 0, source.size());\n\t\t }\n\t\t finally {\n\t\t if(source != null) {\n\t\t source.close();\n\t\t }\n\t\t if(destination != null) {\n\t\t destination.close();\n\t\t }\n\t\t }\n\t\t}\n\t\tf1a.close();\n\t\tf2a.close();\n\t\tf1d.close();\n\t\tf2d.close();\n\t}" ]
[ "0.74731696", "0.7111747", "0.710987", "0.699678", "0.6826459", "0.6815126", "0.66033703", "0.6538002", "0.65178365", "0.6492611", "0.6469363", "0.6386946", "0.63803494", "0.63559103", "0.6309815", "0.63016057", "0.62505394", "0.6249481", "0.6248682", "0.6230955", "0.62021345", "0.61976135", "0.61434245", "0.61314124", "0.61066484", "0.6091381", "0.6062104", "0.60577065", "0.6040155", "0.6017171", "0.5994161", "0.59893346", "0.597915", "0.5971354", "0.59563667", "0.5952924", "0.5938195", "0.59235126", "0.59187174", "0.59170717", "0.5899512", "0.5878967", "0.5877942", "0.5868354", "0.5868354", "0.58666605", "0.5854496", "0.58464605", "0.5842887", "0.5835081", "0.5832545", "0.5815881", "0.58130604", "0.5812709", "0.57880545", "0.57880545", "0.57784164", "0.5776516", "0.5773636", "0.576726", "0.57607764", "0.57540727", "0.57467514", "0.5738037", "0.5737864", "0.5734788", "0.5733776", "0.5719415", "0.57127297", "0.5712328", "0.5709885", "0.5704439", "0.5697084", "0.5687938", "0.5673839", "0.56723416", "0.56693417", "0.56591076", "0.5657864", "0.5650302", "0.5648628", "0.56441927", "0.5643244", "0.5626714", "0.5624622", "0.56078166", "0.5602796", "0.55895084", "0.557962", "0.55695426", "0.5569091", "0.55685586", "0.556678", "0.55644494", "0.556246", "0.55606383", "0.55560803", "0.5554442", "0.5552563", "0.55512476" ]
0.7349515
1
Create the New file
public static void createFile(String path) { try { Scanner scanner = new Scanner(System.in); System.out.println("Enter the file name :"); String filepath = path+"/"+scanner.next(); File newFile = new File(filepath); newFile.createNewFile(); System.out.println("File is Created Successfully"); } catch (Exception ex) { System.out.println(ex.getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void createFile()\n {\n //Check if file already exists\n try {\n File myObj = new File(\"src/main/java/ex45/exercise45_output.txt\");\n if (myObj.createNewFile()) {\n System.out.println(\"File created: \" + myObj.getName());// created\n } else {\n System.out.println(\"File already exists.\"); //exists\n }\n //Error check\n } catch (IOException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n }", "public void createFiles() {\r\n try {\r\n FileWriter file = new FileWriter(registerNumber + \".txt\");\r\n file.write(\"Name : \" + name + \"\\n\");\r\n file.write(\"Surname : \" + surname + \"\\n\");\r\n file.write(\"Registration Number : \" + registerNumber + \"\\n\");\r\n file.write(\"Position : \" + position + \"\\n\");\r\n file.write(\"Year of Start : \" + yearOfStart + \"\\n\");\r\n file.write(\"Total Salary : \" + Math.round(totalSalary) + \".00 TL\" +\"\\n\");\r\n file.close();\r\n }\r\n catch(IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "private void createFile(PonsFileFactory ponsFileFactory, Profile profile){\n moveX(profile);\n ponsFileFactory.setProfile(profile);\n String text = ponsFileFactory.createPonsFile();\n String profileName = profile.getName();\n WriteFile.write(text,pathTextField.getText() + \"/\" + profileName.substring(0,profileName.indexOf(\".\")));\n }", "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 }", "private FSDataOutputStream createNewFile() throws Exception {\n\t\tlogger.traceEntry();\n\t\tPath newFile = new Path(rootDirectory, \"dim_\" + System.currentTimeMillis() + \".json\");\n\t\tlogger.debug(\"Creating file \" + newFile.getName());\n\t\tFSDataOutputStream dataOutputStream = null;\n\n\t\tif (!hadoopFileSystem.exists(newFile)) {\n\t\t\tdataOutputStream = hadoopFileSystem.create(newFile);\n\t\t} else {\n\t\t\tdataOutputStream = hadoopFileSystem.append(newFile);\n\t\t}\n\n\t\tdataOutputStreams.clear();\n\t\tdataOutputStreams.add(dataOutputStream);\n\t\tlogger.traceExit();\n\t\treturn dataOutputStream;\n\t}", "@Override\n public File createFile(String path) throws IOException {\n String pathStr=path+fileSeparator+\"Mail.json\";\n File file = new File(pathStr);\n file.createNewFile();\n return file;\n }", "private void CreateNewFile() {\n\tcheckState();\n\t\n\tif (CanR=CanW=true)\n\t{\n\t\t\n\t\ttry {\n\t\t root = Environment.getExternalStorageDirectory();\n\t\t \n\t\t if (root.canWrite()){\n\t\t gpxfile = new File(root, \"Speed_SD.csv\");\n\t\t gpxwriter = new FileWriter(gpxfile,true);\n\t\t out = new BufferedWriter(gpxwriter);\nout.append(\"\"+\",\"+\"\"+\",\"+\"\");\n\t\t out.newLine();\n\t\t }\n\t\t} catch (IOException e) {\n\t\t //Log.e(, \"Could not write file \" + e.getMessage());\ne.printStackTrace();\n\t\t\n\t}\n\t\t\n}\n\t\t}", "public static void printCreateNewFile() {\n System.out.println(Message.CREATE_NEW_FILE);\n }", "public static void CreateFile (String filename) {\r\n\t\t try {\r\n\t\t File myObj = new File(filename + \".txt\");\r\n\t\t if (myObj.createNewFile()) {\r\n\t\t System.out.println(\"File created: \" + myObj.getName());\r\n\t\t } else {\r\n\t\t System.out.println(\"File already exists.\");\r\n\t\t }\r\n\t\t } catch (IOException e) {\r\n\t\t System.out.println(\"An error occurred.\");\r\n\t\t e.printStackTrace();\r\n\t\t }\r\n\t\t }", "public static void CreateFile(){\n try{\n new File(\"wipimages\").mkdir();\n logscommissions.createNewFile();\n }catch(Exception e){\n e.printStackTrace();\n System.out.println(\"CreateFile Failed\\n\");\n }\n }", "public void createNewImageFile(){\n fillNewImage();\n\n try {\n ImageIO.write(newImage, imageFileType, new File(k + \"_Colored_\" + fileName.substring(0,fileName.length() - 4) + \".\" + imageFileType));\n } catch (IOException e){\n e.printStackTrace();\n }\n \n }", "int createFile(String pFileNamePath, String pContent, String pPath, String pRoot, boolean pOverride) throws RemoteException;", "public void filecreate(String Response_details) throws IOException\n\t{\n\t\tFileWriter myWriter = new FileWriter(\"D://Loadtime.txt\",true);\n\t\tmyWriter.write(Response_details+System.lineSeparator());\n\t\tmyWriter.close();\n\t\tSystem.out.println(\"Successfully wrote to the file.\");\n\t\t\n\t\t\n\t}", "public static void createFile(String name)\n {\n file = new File(name);\n try\n {\n if(file.exists())\n {\n file.delete();\n file.createNewFile();\n }else file.createNewFile();\n \n fileWriter = new FileWriter(file);\n fileWriter.append(\"Generation, \");\n fileWriter.append(\"Fitness, \");\n fileWriter.append(\"Average\\n\");\n \n }catch (IOException e) \n {\n System.out.println(e);\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 }", "FileContent createFileContent();", "static void createNewFile(String path) \n\t\t{\n\t\tLinkedList<String> defaultData = new LinkedList<String>();\n\t\tdefaultData.add(\"1,Frank,West,98,95,87,78,77,80\");\n\t\tdefaultData.add(\"2,Dianne,Greene,78,94,88,87,95,92\");\n\t\tdefaultData.add(\"3,Doug,Lei,78,94,88,87,95,92\");\n\t\tdefaultData.add(\"4,James,Hewlett,69,92,74,77,89,91\");\n\t\tdefaultData.add(\"5,Aroha,Wright,97,92,87,83,82,92\");\n\t\t\n\t\ttry \n\t\t{\n\t\t\tPrintWriter newFile = new PrintWriter(path, \"UTF-8\"); // Create .txt file in given path\n\t\t\t\n\t\t\tfor (String s : defaultData) \n\t\t\t{\n\t\t\t\tnewFile.println(s); // Write To file\n\t\t\t}\n\t\t\t\n\t\t\tnewFile.close(); // Close File\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tSystem.out.println(\"studentData.txt Created Successfully!\");\n\t\t\n\t}", "@Override\r\n\tpublic void createFile(FacebookClient fbClient, ITable table,\r\n\t\t\tString outputFile) {\n\t}", "@Test\n public void CreateFile() throws Exception {\n createFile(\"src\\\\TestSuite\\\\SampleFiles\\\\supervisor.xlsx\",\n readTemplateXLSX(\"src\\\\TestSuite\\\\SampleFiles\\\\template_supervisor.xlsx\"));\n File file = new File(\"src\\\\TestSuite\\\\SampleFiles\\\\supervisor.xlsx\");\n Assert.assertTrue(file.exists());\n }", "private void createScheduleFile() {\n try {\n File scheduleFile = new File(filePath, \"schedule.txt\");\n// FileWriter fw = new FileWriter(scheduleFile);\n\n OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream(scheduleFile), StandardCharsets.UTF_8);\n osw.write(\"SCHEDULE:\\n\" + schedule);\n osw.close();\n\n System.out.println(\"schedule.txt successfully created.\");\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void createFile(String outputData, File file) {\n try {\n FileWriter writer = new FileWriter(file);\n writer.write(outputData);\n writer.close();\n } catch (IOException e) {\n e.getSuppressed();\n }\n }", "public static boolean createFile() throws IOException {\n String bytes = \"\";\n byte[] write = bytes.getBytes(); //Salva i bytes della stringa nel byte array\n if(!fileName.exists()){\n Path filePath = Paths.get(fileName.toString()); //Converte il percorso in stringa\n Files.write(filePath, write); // Creare il File\n Main.log(\"File \\\"parametri\\\" creato con successo in \" + fileName.toString());\n return true;\n }\n return false;\n }", "public boolean createFile() {\n String filename = name + \".ics\";\n String directory = \"Calendar-Files\";\n String userHome = System.getProperty(\"user.home\") + \"/Desktop/\";\n System.out.println(\"Generating Event File...\");\n \n try {\n File folder = new File(userHome, directory);\n\n // if no folder exists, create it\n if (!folder.exists()) {\n folder.mkdir();\n }\n\n // change file location\n File file = new File(userHome + \"/\" + directory, filename);\n\n // if no file exists, create it\n if (!file.exists()) {\n file.createNewFile();\n }\n\n // write the content string to the event file\n FileWriter fw = new FileWriter(file.getAbsoluteFile());\n BufferedWriter bw = new BufferedWriter(fw);\n bw.write(createContent());\n bw.close();\n }\n catch (IOException e) {\n return false;\n }\n return true;\n }", "public ActionScriptBuilder createFile(String filecontents,String filepath,boolean overwrite,String delimeter){\n\t\tline(\"createfile until \"+delimeter);\n\t\tlines(Arrays.asList(filecontents.split(\"\\n\")));\n\t\tline(delimeter);\n\t\tmove(\"__createfile\",filepath,overwrite);\n\t\treturn this;\n\t}", "public void createFile() throws IOException {\n String newName = input.getText();\n File user = new File(\"SaveData\\\\UserData\\\\\" + newName + \".txt\");\n\n if (user.exists() && !user.isDirectory()) {\n input.setStyle(\"-fx-border-color: red\");\n }\n if (user.exists() && !user.isDirectory() || newName.isEmpty()) {\n input.setStyle(\"-fx-border-color: red\");\n ERROR_AUDIO.play(Double.parseDouble(getInitData().get(\"SFXVol\")));\n\n }\n else {\n input.setStyle(\"-fx-border-color: default\");\n playerList.getItems().addAll(newName);\n PrintWriter newUser = new PrintWriter(new FileWriter(\"SaveData\\\\UserData\\\\\" + newName + \".txt\"));\n newUser.write(\"0 0 0 0 icon0 car\");\n newUser.close();\n MAIN_MENU_AUDIO.play(Double.parseDouble(getInitData().get(\"SFXVol\")));\n }\n }", "@Override\n protected void createFile(String directoryName, String fileNamePrefix) {\n }", "private void createFile(String fileName, String content) throws IOException {\n File file = new File(fileName);\n if (!file.exists()) {\n file.createNewFile();\n }\n FileWriter fileWriter = new FileWriter(fileName, false);\n fileWriter.append(content);\n fileWriter.close();\n }", "public void createFile (String filePath){\n try{\n File newFile = new File(filePath);\n if(newFile.createNewFile()){\n System.out.println(\"File created: \"+newFile.getName());\n } else {\n System.out.println(\"File already exists.\");\n }\n } catch (IOException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n }", "@Test\n public void createFile(){\n try\n {\n URI uri = new URI(\"http://www.yu.edu/documents/doc390\");//given the complete uri\n String path = uri.getAuthority() + this.disectURI(uri);//get the Path which is www.yu.edu\\documents\n File file = new File(baseDir.getAbsolutePath() + File.separator + path);//make a File with the full class path and with the \"URI Path\"\n Files.createDirectories(file.toPath());//create the directories we didn't have before, ie not apart of the baseDir\n\n File theFile = new File(file.getAbsolutePath() + File.separator + \"doc390.txt\");//create a new File with the document as the last piece\n //wrap in a try because if the file is already there than we don't need to create a file\n if(!theFile.exists())Files.createFile(theFile.toPath());//create this file in the computer\n\n //write to the file -- in the real application this is the writing of the json\n FileWriter fileWriter = new FileWriter(theFile);\n fileWriter.write(\"HaYom sishi BShabbos\");\n fileWriter.flush();\n fileWriter.close();\n\n }\n catch(Exception e){\n e.printStackTrace();\n }\n }", "public boolean create()\n\t{\n\t\ttry\n\t\t{\n\t\t\treturn file.createNewFile() ;\n\t\t}\n\t\tcatch( IOException ex )\n\t\t{\n\t\t\tex.printStackTrace() ;\n\t\t\treturn false ;\n\t\t}\n\t}", "public void CreateTestResultFile()\n\t{ \n\t\tDate dNow = new Date( );\n\t\tSimpleDateFormat ft =new SimpleDateFormat (\"MMddYYYY\");\n\t\t\n\t\ttry \n\t\t{\n\t\t\tFileOutputStream fos = new FileOutputStream(System.getProperty(\"user.dir\")+\"//PG HealthCheck List_\"+ft.format(dNow)+\".xls\");\n\t HSSFWorkbook workbook = new HSSFWorkbook();\n\t HSSFSheet worksheet = workbook.createSheet(\"PG Functionality - Country\");\n\t HSSFRow row1 = worksheet.createRow(0);\n\t row1.createCell(0).setCellValue(\"Availability of Data\");\n\t HSSFRow row = worksheet.createRow(1);\n\t row.createCell(0).setCellValue(\"Testcase\");\n\t row.createCell(1).setCellValue(\"TestRunStatus\");\n\t row.createCell(2).setCellValue(\"Remarks\");\n\t workbook.write(fos);\n\t fos.close();\n\t \t \n\t } \n\t\tcatch (Exception e)\n\t {\n\t \te.printStackTrace();\n\t }\n\t\t\t\n\t\t\n\t}", "static void createNew() \r\n\t {\n boolean flag = false;\r\n Scanner file = new Scanner(System.in);\r\n System.out.println(\"Enter a new file name\");\r\n String newfilename = file.next();\r\n File createfile = new File(\"D:\\\\java_project\\\\\"+newfilename+\".txt\");\r\n try\r\n\t\t {\r\n\t\t flag = createfile.createNewFile();\r\n\t\t System.out.println(\"flag value\" + flag);\r\n\t\t if(!flag)\r\n\t\t {\r\n\t\t \t System.out.println(\"Same file name already exisy\" + createfile.getPath());\r\n\t\t } \r\n\t\t else \r\n\t\t {\r\n\t\t \t System.out.println(\"file is created sucessfully\" + createfile.getPath() + \" created \");\r\n\t\t }\r\n\t\t } \r\n\t\t catch (IOException ioe) \r\n\t\t {\r\n\t\t System.out.println(\"Error while Creating File in Java\" + ioe);\r\n\t\t }\r\n\t\t \r\n\t\t \t }", "private static void createFile() throws Exception {\n\t\t // retrieve an instance of H4File\n\t\t FileFormat fileFormat = FileFormat.getFileFormat(FileFormat.FILE_TYPE_HDF4);\n\n\t\t if (fileFormat == null) {\n\t\t System.err.println(\"Cannot find HDF4 FileFormat.\");\n\t\t return;\n\t\t }\n\n\t\t // create a new file with a given file name.\n\t\t @SuppressWarnings(\"deprecation\")\n\t\t\t\tH4File testFile = (H4File) fileFormat.create(fname);\n\n\t\t if (testFile == null) {\n\t\t System.err.println(\"Failed to create file:\" + fname);\n\t\t return;\n\t\t }\n\n\t\t // open the file and retrieve the root group\n\t\t testFile.open();\n\t\t Group root = (Group) ((javax.swing.tree.DefaultMutableTreeNode) testFile.getRootNode()).getUserObject();\n\n\t\t // set the data values\n\t\t int[] dataIn = new int[20 * 10];\n\t\t for (int i = 0; i < 20; i++) {\n\t\t for (int j = 0; j < 10; j++) {\n\t\t dataIn[i * 10 + j] = 1000 + i * 100 + j;\n\t\t }\n\t\t }\n\n\t\t // create 2D 32-bit (4 bytes) integer dataset of 20 by 10\n\t\t Datatype dtype = testFile.createDatatype(Datatype.CLASS_INTEGER, 4, Datatype.NATIVE, Datatype.NATIVE);\n\t\t @SuppressWarnings(\"unused\")\n\t\t\t\tDataset dataset = testFile\n\t\t .createScalarDS(\"2D 32-bit integer 20x10\", root, dtype, dims2D, null, null, 0, dataIn);\n\n\t\t // close file resource\n\t\t //testFile.close();\n\t\t }", "public void createFile(File file) throws IOException {\n if (!file.exists()) {\n file.createNewFile();\n }\n }", "public void newDemo() {\r\n \t\t\r\n \t\tString date = new SimpleDateFormat(\"yyyy-MM-dd_HH-mm-ss\").format(new Date());\r\n \t\tthis.fileName = this.demoFolder + this.map.replace(\".xml\", \"\") + \"_\" + date + \".r2d\";\r\n \t\ttry {\r\n \t\t\tthis.fos = (FileOutputStream)this.fileIO.writeFile(this.fileName);\r\n \t\t} catch (IOException e) {\r\n \t\t}\r\n \t\t\r\n \t\ttry {\r\n \t\t\tthis.demoParts.put(this.map + \"/\");\r\n \t\t} catch (InterruptedException e) {\r\n \t\t}\r\n \t}", "public void createFile(File file) {\n\t\tif (file.exists())\n\t\t\treturn;\n\t\ttry {\n\t\t\tfile.createNewFile();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void createNewScriptFile(String scriptContent) {\n String fileName = prop.getProperty(\"FileName\");\n try {\n // Assume default encoding.\n FileWriter fileWriter = new FileWriter(fileName);\n // Always wrap FileWriter in BufferedWriter.\n BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);\n // Note that write() does not automatically append a newline character.\n bufferedWriter.write(scriptContent);\n // Always close files.\n bufferedWriter.close();\n } catch (IOException ex) {\n System.out.println(\"Error writing to file '\" + fileName + \"'\");\n }\n }", "private void createFile() {\n if (mDriveServiceHelper != null) {\n Log.d(\"error\", \"Creating a file.\");\n\n mDriveServiceHelper.createFile()\n .addOnSuccessListener(fileId -> readFile(fileId))\n .addOnFailureListener(exception ->\n Log.e(\"error\", \"Couldn't create file.\", exception));\n }\n }", "public CreateInputFiles()\n\t{\n\t\ttry\n\t\t{\n\t\t\tEXCEL_FILE = new FileInputStream(new File(INPUT_FILE_NAME));\n\t\t\t/* Log File */\n\t\t\tLOG_WRITER = writerCreator(LOG_FILE, BLANK);\n\t\t\tLOG_WRITER.write(START_TIME + new java.util.Date() + LINE_SEPERATOR);\n\t\t\tSystem.out.println(NEW_LINE + START_TIME + new java.util.Date() + LINE_SEPERATOR);\n\n\t\t\t/* Service Part Creation */\n\t\t\tSERVICE_PART_WRITER = writerCreator(SERVICE_PARTS_CREATION_INPUT_FILE,\n\t\t\t\t\tSERVICE_PART_CREATION_CONFIG);\n\n\t\t\t/* Service Form Update */\n\t\t\tSERVICE_FORM_WRITER = writerCreator(SERVICE_FORM_PROPERTIES_INPUT_FILE,\n\t\t\t\t\tSERVICE_FORM_UPDATE_CONFIG);\n\n\t\t\t/* PS_UPLOAD - Service Structures Creation \n\t\t\tPS_STRUCTURE_WRITER = writerCreator(PS_STRUCTURE_CREATION_INPUT_FILE,\n\t\t\t\t\tPS_STRUCTURE_CREATION_CONFIG); */\n\n\t\t\t/* Service Structures Creation */\n\t\t\tSTRUCTURE_WRITER = writerCreator(STRUCTURE_CREATION_INPUT_FILE,\n\t\t\t\t\tSTRUCTURE_CREATION_CONFIG);\n\n\t\t\t/* EngParts' Service Form Creation and Attachment*/\n\t\t\tEP_SERVICE_FORM_WRITER = writerCreator(EP_SERVICE_FORM_CREATION_INPUT_FILE,\n\t\t\t\t\tEP_SERVICE_FORM_CREATION_CONFIG);\n\n\t\t\t/* Service Parts' Global Alternate */\n\t\t\tSP_GLOBAL_ALT_WRITER = writerCreator(SP_GLOBAL_ALT_INPUT_FILE, BLANK);\n\n\t\t\t/* Service Parts' Group ID update */\n\t\t\tSP_GROUP_ID_WRITER = writerCreator(SP_GROUP_ID_INPUT_FILE, SP_GROUP_ID_UPDATE_CONFIG);\n\n\t\t\t/* Relate Service Parts to three types of attachments*/\n\t\t\tSP_ATTACHMENT_WRITER = writerCreator(SP_ATTACHMENT_INPUT_FILE, SP_ATTACHMENT_CONFIG);\n\n\t\t\t/* Made From Relation Creation */\n\t\t\tMADE_FROM_RELATION_WRITER = writerCreator(MADE_FROM_REL_INPUT_FILE,\n\t\t\t\t\tMADE_FROM_REL_CONFIG);\n\n\t\t} catch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(EXCEPTION + e.getMessage());\n\t\t\tSystem.exit(1);\n\t\t}\n\t}", "public void createFile(View view) {\n // start the background file creation task\n CreateFileTask task = new CreateFileTask();\n task.execute();\n }", "public void createFile(String fname) {\n\t\tprintMsg(\"running createFiles() in \\\"\" + this.getClass().getName() + \"\\\" class.\");\n\t\t\n\t\t// Check if the scratch directory exists, create it if it doesn't\n\t\tPath rootpath = Paths.get(theRootPath);\n\t\tcreateScratchDirectory(rootpath);\n\n\t\t// Check if the file name is null or empty, if it is, use default name\n\t\tPath filepath = null;\n\t\tif(fname == null || fname.isEmpty()) {\n\t\t\tfilepath = Paths.get(rootpath + System.getProperty(\"file.separator\") + theFilename);\n\t\t} else {\n\t\t\tfilepath = Paths.get(rootpath + System.getProperty(\"file.separator\") + fname);\n\t\t}\n\t\t\n\t\t// Create file\n\t\ttry {\n\t\t\t// If file exists already, don't override it.\n\t\t\tif(!Files.exists(filepath)) {\n\t\t\t\tFiles.createFile(filepath);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private File createNewRotationFile(String clearName, String extension, Path parent){\n\n Path newPath = getPathRotationFile(clearName, lastCountRotation+1, extension, parent);\n try{\n File ret = Files.createFile(newPath).toFile();\n return ret;\n } catch (IOException ex){\n System.out.println(\"Ошибка в создании файла: \"+ex.getMessage());\n }\n System.out.println(\"Ошибка в создании файла: \"+newPath);\n return file;\n }", "public static void createSaveFile( )\n {\n try\n {\n new File( \"data\" ).mkdirs( );\n PrintWriter writer = new PrintWriter( \"data/\" + Game.instance.getCurrentSaveFile( ).SAVEFILENAME + \".txt\", \"UTF-8\" );\n writer.println( \"dkeys: \" + Game.START_DIAMOND_KEY_COUNT );\n writer.close( );\n }\n catch ( IOException e )\n {\n e.printStackTrace( );\n System.exit( 1 );\n }\n }", "public void createNoteBookFile(NoteBook myNoteBook) throws DaoException {\n\t\tFile notebookFile = new File(FILE_NAME);\n\t\tif (notebookFile.exists()) {\n\t\t\tnotebookFile.delete();\n\t\t}\n\t\ttry {\n\t\t\tnotebookFile.createNewFile();\n\t\t} catch (IOException e) {\n\t\t\tthrow new DaoException(\"Create NoteBook file error\", e);\n\t\t}\n\t}", "void create() {\n\t\ttry {\n\t\t\tFile file = new File(\"Student.txt\");\n\t\t\t//File named Student.txt is created\n\t\t\tboolean x = file.createNewFile();\n\t\t\tif (x) {\n\t\t\t\tSystem.out.println(\"File has been created successfully! \");\n\t\t\t//Message of successful creation after new file is created\n\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"File already present\");\n\t\t\t\t//message if file already exists\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Exception Occurred:\");\n\n\t\t}\t\t\t\t\n\t\t\n\t\t\t\t\n\t\ttry {\n\t\tPrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(\"Student.txt\", true)));\n\t\tint x = 1;\n\t\t\n\t\tdo {\n\t\t\tScanner sc = new Scanner(System.in);\n\t\t\tint y;\n\t\t\t//take input from user for name,roll no and mobile no.\n\t\t\t\n\t\t\tSystem.out.print(\"\\nEnter Student Name: \");\n\t\t\tstudentname = br.readLine();\n\t\t\t\n\t\t\tSystem.out.print(\"Student Roll no: \");\n\t\t\trollno = Integer.parseInt(br.readLine());\t\t\n\t\t\t\n\t\t\tSystem.out.print(\"Mobile Number: \");\n\t\t\tmob_no = Integer.parseInt(br.readLine());\n\t\t\t\n\t\t\tSystem.out.print(\"Marks : \");\n\t\t\tmarks = Float.parseFloat(br.readLine());\n\t\t\t\n\t\t\t//display student data\n\n\t\t\tpw.println(studentname + \"\\t\" + rollno + \"\\t\" + marks + \"\\t\" + mob_no);\n\t\t\t\n\t\t\tSystem.out.println(\"Do you want to enter more records? \\n1) Yes\\n2) No\");\n\t\t\t\n\t\t\ty = sc.nextInt();\n\t\t\t\n\t\t\tif(y == 2) {\n\t\t\t\tx = 0;\n\t\t\t}\n\t\t}while(x==1); //loop to add more records\n\t\tpw.close();\n\t\t}catch(IOException e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\t\n\t}", "public static void main(String[] args) {\n\n\t\tFile fi = new File(\"C:/test_io\");\n\t\tif(fi.exists()) {\n\t\t\t\n\t\t\tSystem.out.println(\"exists!\");\n\t\t}else {\n\t\t\tSystem.out.println(\"new\");\n\t\t\tfi.mkdir();\n\t\t}\n\t\t\n\t\tFile fic1 = new File(fi, \"AA\");\n\t\tfic1.mkdir();\n\t\t\n\t\tFile fic2 = new File(\"C:/test_io\", \"BB\");\n\t\tfic2.mkdir();\n\t\t\n\t\tFile fitxt = new File(fic1,\"a.txt\");\n\t\t\n\t\ttry {//checked exception\n\t\t\tfitxt.createNewFile();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private File createDestinationFile() {\n\t\tSystem.out.print(\"Please enter the name of the output file that will be created to hold the modified/correct inventory: \");\n\t\tString fileName = sc.nextLine();\n\t\tFile file = new File(fileName);\n\t\twhile (file.exists()) {\n\t\t\tSystem.out.println(\"----->A file with the name of \\\"\" + fileName + \"\\\" [size = \" + file.length() + \" bytes; path = \" + file.getAbsolutePath() + \"] already exists.<-----\");\n\t\t\tSystem.out.print(\"Please input a new file name: \");\n\t\t\tfileName = sc.nextLine();\n\t\t\tfile = new File(fileName);\n\t\t}\n\t\treturn file;\n\t}", "public static void main(String[] args) {\n\t\tFile file = new File(\"test/a.txt\");\r\n\t\tFileUtil.createFile(file);\r\n\t\t/*if(! file.exists()){\r\n\t\t\ttry {\r\n\t\t\t\tSystem.out.println(file.getAbsolutePath());\r\n\t\t\t\tfile.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\t*/\r\n\t}", "public void makeProgressFile() {\n progressData = new File(wnwData, \"progress.dat\");\n try {\n progressData.createNewFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n progressData.setWritable(true);\n }", "private void createStudentNotaFile(Nota n, String feedback) throws IOException {\n String numeStud = \"src/main/java/DataAll/DateStudenti/\"+ n.getStudent().getNumele()+\".txt\";\n File file = new File(numeStud);\n if(!file.exists()) {\n file.createNewFile();\n }\n BufferedWriter br = new BufferedWriter(new FileWriter(file,true));\n br.write(\"Tema: \" + n.getTema().getID().toString());\n br.newLine();\n br.write(\"Nota: \"+ n.getNota().toString());\n br.newLine();\n br.write(\"Predata_in_saptamana: \"+ n.getDataPredareTema().toString());\n br.newLine();\n br.write(\"Deadline: \" + n.getTema().getDeadline().toString());\n br.newLine();\n br.write(\"Feedback: \"+ feedback);\n br.newLine();\n br.newLine();\n try{\n br.close();\n }catch(Exception ex){\n throw new ValidationException(\"Error in closing the BufferedWriter\"+ex);\n }\n\n }", "private static void createTestFile(String path) throws IOException {\n\t\tFile file = new File(path);\n\t\tFileWriter writer = new FileWriter(file);\n\t\twriter.write(\"Jenkins Test : \"+new Date() + \" ==> Writing : \" + Math.random());\n\t\twriter.flush();\n\t\twriter.close();\n\t}", "public void createPatient() throws IOException\n {\n addPatientToList();\n \n //creates the patient's empty folders and files\n File userFolder = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB); \n File patientEvaluation = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm\");\n File patientProgressReports = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/ProgressNotes\"); \n \n try\n \t{\n \tuserFolder.mkdir();\n patientEvaluation.mkdir();\n patientProgressReports.mkdir();\n \t//result = true;\n \t} \n \tcatch(SecurityException se)\n \t{\n \t//handle it\n \t} \n \t\n File listOfProgressReports = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/ProgressReports.txt\");\n FileWriter writer = new FileWriter(listOfProgressReports, true);\t \n BufferedWriter bufferedreader = new BufferedWriter(writer);\n writer.append(\"\");\n bufferedreader.close();\n writer.close();\n \n \n /*if(result) \n \t{ \n \t\tSystem.out.println(\"DIR created\"); \n \t}*/\n \n //creates the patient's empty evaluation form files\n File signedStatus = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/signed.txt\");\n FileWriter w = new FileWriter(signedStatus, true);\t \n BufferedWriter b = new BufferedWriter(w);\n w.append(\"false\");\n b.close();\n w.close();\n \n File firstName = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/first.txt\");\n FileWriter writ = new FileWriter(firstName, true);\t \n BufferedWriter bw = new BufferedWriter(writ);\n writ.append(currentPatientFirstName);\n bw.close();\n writ.close();\n \n File lastName = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/last.txt\");\n FileWriter writ1 = new FileWriter(lastName, true);\t \n BufferedWriter bw1 = new BufferedWriter(writ1);\n writ1.append(currentPatientLastName);\n bw1.close();\n writ1.close();\n \n File age = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/age.txt\");\n FileWriter writ2 = new FileWriter(age, true);\t \n BufferedWriter bw2 = new BufferedWriter(writ2);\n writ2.append(\"\");\n bw2.close();\n writ2.close();\n \n File dob = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/dateofbirth.txt\");\n FileWriter writ3 = new FileWriter(dob, true);\t \n BufferedWriter bw3 = new BufferedWriter(writ3);\n writ3.append(\"\");\n bw3.close();\n writ3.close();\n \n File maritalstatus = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/maritalstatus.txt\");\n FileWriter writ4 = new FileWriter(maritalstatus, true);\t \n BufferedWriter bw4 = new BufferedWriter(writ4);\n writ4.append(\"\");\n bw4.close();\n writ4.close();\n \n File ethnicity = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/ethnicity.txt\");\n FileWriter writ5 = new FileWriter(ethnicity, true);\t \n BufferedWriter bw5 = new BufferedWriter(writ5);\n writ5.append(\"\");\n bw5.close();\n writ5.close();\n\n File ethnicityother = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/ethnicity-other.txt\");\n FileWriter writt = new FileWriter(ethnicityother, true);\t \n BufferedWriter bww = new BufferedWriter(writt);\n writt.append(\"\");\n bww.close();\n writt.close();\n \n File sex = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/sex.txt\");\n FileWriter writ6 = new FileWriter(sex, true);\t \n BufferedWriter bw6 = new BufferedWriter(writ6);\n writ6.append(\"\");\n bw6.close();\n writ6.close();\n \n File referredBy = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/referredby.txt\");\n FileWriter writ7 = new FileWriter(referredBy, true);\t \n BufferedWriter bw7 = new BufferedWriter(writ7);\n writ7.append(\"\");\n bw7.close();\n writ7.close();\n \n File referredByTherapist = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/referredby-therapist.txt\");\n FileWriter writ8 = new FileWriter(referredByTherapist, true);\t \n BufferedWriter bw8 = new BufferedWriter(writ8);\n writ8.append(\"\");\n bw8.close();\n writ8.close();\n \n File referredByOther = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/referredby-other.txt\");\n FileWriter writ9 = new FileWriter(referredByOther, true);\t \n BufferedWriter bw9 = new BufferedWriter(writ9);\n writ9.append(\"\");\n bw9.close();\n writ9.close();\n \n //dr. prince\n File reasonForReferral = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/reasonforreferral.txt\");\n FileWriter writ10 = new FileWriter(reasonForReferral, true);\t \n BufferedWriter bw10 = new BufferedWriter(writ10);\n writ10.append(\"\");\n bw10.close();\n writ10.close();\n \n File sourceOfInformation = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/sourceofinformation.txt\");\n FileWriter writ11 = new FileWriter(sourceOfInformation, true);\t \n BufferedWriter bw11 = new BufferedWriter(writ11);\n writ11.append(\"\");\n bw11.close();\n writ11.close();\n \n File sourceOfInformationOther = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/sourceofinformation-other.txt\");\n FileWriter writ12 = new FileWriter(sourceOfInformationOther, true);\t \n BufferedWriter bw12 = new BufferedWriter(writ12);\n writ12.append(\"\");\n bw12.close();\n writ12.close();\n \n File reliabilityOfInformation = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/reliabilityofinformation.txt\");\n FileWriter writ13 = new FileWriter(reliabilityOfInformation, true);\t \n BufferedWriter bw13 = new BufferedWriter(writ13);\n writ13.append(\"\");\n bw13.close();\n writ13.close();\n \n File reliabilityOfInformationOther = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/reliabilityofinformation-other.txt\");\n FileWriter writ14 = new FileWriter(reliabilityOfInformationOther, true);\t \n BufferedWriter bw14 = new BufferedWriter(writ14);\n writ14.append(\"\");\n bw14.close();\n writ14.close();\n \n File historyOfPresentIllness = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/historyofpresentillness.txt\");\n FileWriter writ15 = new FileWriter(historyOfPresentIllness, true);\t \n BufferedWriter bw15 = new BufferedWriter(writ15);\n writ15.append(\"\");\n bw15.close();\n writ15.close();\n \n File signsSymptoms = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/signsandsymptoms.txt\");\n FileWriter writ16 = new FileWriter(signsSymptoms, true);\t \n BufferedWriter bw16 = new BufferedWriter(writ16);\n writ16.append(\"\");\n bw16.close();\n writ16.close();\n \n File currentMedications = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/currentmedications.txt\");\n FileWriter writ17 = new FileWriter(currentMedications, true);\t \n BufferedWriter bw17 = new BufferedWriter(writ17);\n writ17.append(\"\");\n bw17.close();\n writ17.close();\n \n File pastHistoryOf = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/pasthistoryof.txt\");\n FileWriter writ18 = new FileWriter(pastHistoryOf, true);\t \n BufferedWriter bw18 = new BufferedWriter(writ18);\n writ18.append(\"\");\n bw18.close();\n writ18.close();\n \n File pastHistoryOfText = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/pasthistoryoftext.txt\");\n FileWriter writ19 = new FileWriter(pastHistoryOfText, true);\t \n BufferedWriter bw19 = new BufferedWriter(writ19);\n writ19.append(\"\");\n bw19.close();\n writ19.close();\n \n File medicationTrialsTable = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/medicationtrialstable.txt\");\n FileWriter writ20 = new FileWriter(medicationTrialsTable, true);\t \n BufferedWriter bw20 = new BufferedWriter(writ20);\n writ20.append(\"\");\n bw20.close();\n writ20.close();\n \n File medicationTrialsComments = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/medicationtrialscomments.txt\");\n FileWriter writ21 = new FileWriter(medicationTrialsComments, true);\t \n BufferedWriter bw21 = new BufferedWriter(writ21);\n writ21.append(\"\");\n bw21.close();\n writ21.close();\n \n File substanceUseHistory = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/substanceusehistory.txt\");\n FileWriter writ22 = new FileWriter(substanceUseHistory, true);\t \n BufferedWriter bw22 = new BufferedWriter(writ22);\n writ22.append(\"\");\n bw22.close();\n writ22.close();\n \n File deniesHistoryOf = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/denieshistoryof.txt\");\n FileWriter writ23 = new FileWriter(deniesHistoryOf, true);\t \n BufferedWriter bw23 = new BufferedWriter(writ23);\n writ23.append(\"\");\n bw23.close();\n writ23.close();\n \n File deniesHistoryOfText = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/denieshistoryoftext.txt\");\n FileWriter writ24 = new FileWriter(deniesHistoryOfText, true);\t \n BufferedWriter bw24 = new BufferedWriter(writ24);\n writ24.append(\"\");\n bw24.close();\n writ24.close();\n \n File socialHistoryText = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/socialhistorytext.txt\");\n FileWriter writ25 = new FileWriter(socialHistoryText, true);\t \n BufferedWriter bw25 = new BufferedWriter(writ25);\n writ25.append(\"\");\n bw25.close();\n writ25.close();\n \n File socialHistoryParents = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/socialhistoryparents.txt\");\n FileWriter writ26 = new FileWriter(socialHistoryParents, true);\t \n BufferedWriter bw26 = new BufferedWriter(writ26);\n writ26.append(\"\");\n bw26.close();\n writ26.close();\n \n File socialHistorySiblings = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/socialhistorysiblings.txt\");\n FileWriter writ27 = new FileWriter(socialHistorySiblings, true);\t \n BufferedWriter bw27 = new BufferedWriter(writ27);\n writ27.append(\"\");\n bw27.close();\n writ27.close();\n \n File socialHistoryChildren = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/socialhistorychildren.txt\");\n FileWriter writ28 = new FileWriter(socialHistoryChildren, true);\t \n BufferedWriter bw28 = new BufferedWriter(writ28);\n writ28.append(\"\");\n bw28.close();\n writ28.close();\n \n File familyHistoryOfMentalIllness = new File(installationPath + \"/userdata/\" + currentPatientFirstName + currentPatientLastName + currentPatientDOB + \"/EvaluationForm/familyhistoryofmentalillness.txt\");\n FileWriter writ29 = new FileWriter(familyHistoryOfMentalIllness, true);\t \n BufferedWriter bw29 = new BufferedWriter(writ29);\n writ29.append(\"\");\n bw29.close();\n writ29.close();\n \n }", "public ActionScriptBuilder createFile(String filecontents, String filepath,boolean overwrite){\n\t\treturn createFile(filecontents,filepath,true,\"[EOF]\");\n\t}", "public static File createNewFile(String filename){\n try {\n File outputFile = new File(filename + \".csv\");\n\n //Creates File\n outputFile.createNewFile();\n\n return outputFile;\n\n } catch (IOException ex) {\n Logger.getLogger(CSVWriter.class.getName()).log(Level.SEVERE, null, ex);\n return null;\n }\n }", "public void crearPrimerFichero(){\n File f=new File(getApplicationContext().getFilesDir(),\"datos.json\");\n // si no existe lo creo\n if(!f.exists()) {\n String filename = \"datos.json\";\n String fileContents = \"[]\";\n FileOutputStream outputStream;\n\n try {\n outputStream = openFileOutput(filename, Context.MODE_PRIVATE);\n outputStream.write(fileContents.getBytes());\n outputStream.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n }", "String prepareFile();", "public abstract T create(T file, boolean doPersist) throws IOException;", "private void createExecutableFile() throws IOException {\r\n //if (report.getErrorList() == null)\r\n //{\r\n System.out.println(\"Currently generating the executable file.....\");\r\n executableFile = new File(sourceName + \".lst\");\r\n // if creating the lst file is successful, then you can start to write in the lst file\r\n executableFile.delete();\r\n if (executableFile.createNewFile()) {\r\n writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(sourceName + \".asm\"), \"utf-8\")); //create an object to write into the lst file\r\n\r\n String [] hex = generate.split(\" \");\r\n\r\n for (int index = 0; index < hex.length; index++) {\r\n String hex1 = hex[index].trim();\r\n System.out.println(hex1);\r\n\r\n int i = Integer.parseInt(hex1, 16);\r\n String bin = Integer.toBinaryString(i);\r\n System.out.println(bin);\r\n\r\n writer.write(bin); // once the instruction is converted to binary it is written into the exe file\r\n }\r\n\r\n writer.close();\r\n\r\n }\r\n }", "public boolean create() {\n boolean operation = false;\n try {\n File file = new File( fileName );\n file.createNewFile();\n\n if ( this.open() == false ) {\n throw new Exception(\"File created but still has issues opening the file\");\n } else {\n writeFirstLine(\"\");\n }\n\n operation = true;\n } catch( Exception error ) {\n System.out.println(error.toString());\n operation = false;\n }\n\n return operation;\n }", "private void saveResourceFile()\r\n\t{\t\r\n\t\tFile file = null;\r\n\t\tFileWriter fw = null;\r\n\t\t//File complete = null;//New file for the completed list\r\n\t\t//FileWriter fw2 = null;//Can't use the same filewriter to do both the end task and the complted products.\r\n\t\ttry{\r\n\t\t\tfile = new File(outFileName);\r\n\t\t\tfile.createNewFile();\r\n\t\t\tfw = new FileWriter(outFileName,true);\r\n\t\t\tfor(FactoryObject object : mFObjects)\r\n\t\t\t{\r\n\t\t\t\tif(object instanceof FactoryReporter) {\r\n\t\t\t\t\t((FactoryReporter)object).report(fw);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (IOException ioe) {\r\n\t\t\tSystem.out.println(ioe.getMessage());\r\n\t\t\tif(file != null) {\r\n\t\t\t\tfile.delete();\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tif(fw != null) {\r\n\t\t\t\ttry{\r\n\t\t\t\t\tfw.close();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\tSystem.out.println(\"Failed to close the filewriter!\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void newFile() {\n\t\tString filename = \"untitled\";\n\t\tfilename = JOptionPane.showInputDialog(null,\n\t\t\t\t\"Enter the new file name\");\n\t\taddTab(filename+\".minl\");\n\t}", "public void generate(File file) throws IOException;", "public EnigmaFile() throws Exception\n {\n\n String path = Main.class.getClassLoader().getResource(\"filein.txt\").getPath();\n File currentDirectory=new File(path);\n finstream = new FileInputStream(currentDirectory);\n\n\n String pathToWrite = path.replaceFirst(\"filein.txt\",\"fileout.txt\");\n File outputFile = new File(pathToWrite);\n br = new BufferedReader(new InputStreamReader(finstream));\n outputFile.createNewFile();\n FileWriter fileWrite = new FileWriter(outputFile.getAbsoluteFile());\n writer = new BufferedWriter(fileWrite);\n\n\n }", "FileReference createFile(String fileName, String toolId);", "@Override\n public String createFile(String date, String todaysDate) throws FlooringMasteryPersistenceException{\n \n return \"You are in Training mode, cannot create file\";\n }", "public String createFile(String name) {\t\t\n\t\tString filename = this.path + name;\n\t\tFile file = new File(filename);\n\t\t\n\t\ttry {\n\t\t\tif (file.createNewFile()) {\n\t\t System.out.println(\"Created file '\" + filename + \"'.\");\n\t\t \n\t\t // Add file to files list\n\t\t\t\tthis.files.add(name);\t\n\t\t\t\t\n\t\t } else {\n\t\t \t// Null filename to report it was NOT created\n\t\t\t\tfilename = null;\n\t\t System.out.println(\"ERROR - File name already exists!\");\n\t\t }\n\t\t} catch(IOException e) {\n\t\t\t// Null filename to report it was NOT created\n\t\t\tfilename = null;\n\t\t e.printStackTrace();\n\t\t}\t\t\n\t\t\n\t\treturn filename;\n\t}", "public static File MakeNewFile(String hint) throws IOException {\n File file = new File(hint);\n String name = GetFileNameWithoutExt(hint);\n String ext = GetFileExtension(hint);\n int i = 0;\n while (file.exists()) {\n file = new File(name + i + \".\" + ext);\n ++i;\n }\n\n file.createNewFile();\n\n return file;\n }", "public ActionScriptBuilder createFile(String filecontents, String filepath){\n\t\treturn createFile(filecontents,filepath,true);\n\t}", "@TaskAction\n public void create() {\n dir.mkdirs();\n getChmod().chmod(dir, dirMode);\n }", "private static void createFileUmidade() throws IOException {\r\n\t\tInteger defaultUmidade = 30;\r\n\t\tarqUmidade = new File(pathUmidade);\r\n\t\tif(!arqUmidade.exists()) {\r\n\t\t\tarqUmidade.createNewFile();\r\n\t\t\tFileWriter fw = new FileWriter(getArqUmidade());\r\n\t\t\tBufferedWriter buffWrite = new BufferedWriter(fw);\r\n\t\t\tbuffWrite.append(defaultUmidade.toString() + String.valueOf('\\n'));/*Inicializa o arquivo com uma umidade Inicial*/\r\n\t\t\tbuffWrite.close();\r\n\t\t}else {\r\n\t\t\tFileReader fr = new FileReader(getArqUmidade());\r\n\t\t\tBufferedReader buffRead = new BufferedReader(fr);\r\n\t\t\tif(!buffRead.ready()) {/*Se o arquivo se encontar criado mas estiver vazio*/\r\n\t\t\t\tFileWriter fw = new FileWriter(arqUmidade);\r\n\t\t\t\tBufferedWriter buffWrite = new BufferedWriter(fw);\r\n\t\t\t\tbuffWrite.append(defaultUmidade.toString() + String.valueOf('\\n'));/*Inicializa o arquivo com uma umidade Inicial*/\r\n\t\t\t\tbuffWrite.close();\r\n\t\t\t}\r\n\t\t\tbuffRead.close();\r\n\t\t}\r\n\t}", "public void newFile() {\r\n \t\tcurFile = null;\r\n \t}", "protected abstract void writeFile();", "public void createXMLFile(String INPUT_XML_SYMBOL) throws IOException {\n\n\t\t// creates isoxxxx-xxx_temp.xml\n\t\tOUTPUT_FILE_TEMP = INPUT_XML_SYMBOL.replace(\".xml\", \"_temp.xml\");\n\n\t\t// get Symbol\n\t\tString xmlSymbol = readFile(INPUT_XML_SYMBOL);\n\n\t\t// get ComponentName\n\t\tint i = xmlSymbol.indexOf(\"ComponentName=\") + 15;\n\t\tint j = xmlSymbol.indexOf(\"\\\"\", i);\n\t\tString componentName = xmlSymbol.substring(i, j);\n\n\t\t// get basic file stuff\n\t\tString xmlHeader = readFile(this.INPUT_XML_HEADER);\n\t\tString xmlBottom = readFile(this.INPUT_XML_FOOTER).replace(\"abc\", componentName);\n\n\t\t// create the new file\n\t\twriteStringToFile(\n\t\t\t\txmlHeader + \"\\n\" + xmlSymbol + \"\\n\" + \"</ShapeCatalogue>\" + \"\\n\" + xmlBottom + \"\\n\" + \"</PlantModel>\");\n\t}", "void setNewFile(File file);", "public void newFileCreated(OpenDefinitionsDocument doc) { }", "public void newFileCreated(OpenDefinitionsDocument doc) { }", "public void newFile(int temp) {\n if(!doesExist(temp)){\n System.out.println(\"The Directory does not exist \");\n return;\n }\n\n directory nodeptr = root;\n for(int count = 0; count < temp; count++) {\n nodeptr = nodeptr.forward;\n }\n int space = nodeptr.f.createFile(nodeptr.count);\n nodeptr.count++;\n nodeptr.availableSpace = 512 - space;\n\n }", "private void createFile(String packageName, String enclosingName, String methodName, String returnType) {\n try {\n JavaFileObject jfo = mFiler.createSourceFile(enclosingName, new Element[]{});\n Writer writer = jfo.openWriter();\n writer.write(brewCode(packageName, enclosingName, methodName, returnType));\n writer.flush();\n writer.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public static void enterNewTXTFile(String input, String id, String newName, String newHandle, String newTime, String newTweet)\n {\n try {\n String str = Integer.parseInt(id)+ \" \" +newName+ \" \" +newHandle+ \" \" +newTime+ \" \" +newTweet+ \" \";\n writer = new BufferedWriter(new FileWriter(input, true)); // continue to write to existing output file\n writer.write(str);\n writer.newLine();\n writer.close();\n \n } catch (Exception e) { System.out.println(e); }\n }", "public static File createFile(String filename){\n try {\n File outputFile = new File(filename + \".csv\");\n\n //Prevent File Overwrite\n int tmp = 1;\n while (outputFile.exists()){\n outputFile = new File(filename + \".csv\" + \".\" + tmp);\n tmp++;\n }\n\n //Creates File\n outputFile.createNewFile();\n\n return outputFile;\n\n } catch (IOException ex) {\n Logger.getLogger(CSVWriter.class.getName()).log(Level.SEVERE, null, ex);\n return null;\n }\n }", "protected void createHMetisOutFilePath() {\n\t\tString file = \"\";\n\t\tfile += \"TEMP_GRAPH_FILE.hgr.part.\";\n\t\tfile += this.getPartitioner().getPartition().getNumBlock();\n\t\tthis.setHMetisOutFile(file);\t\n\t}", "Object create(File file) throws IOException, SAXException, ParserConfigurationException;", "private void createWinnerScheduleFile() {\n try {\n File scheduleFile = new File(filePath, \"winners.txt\");\n\n OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream(scheduleFile), StandardCharsets.UTF_8);\n osw.write(\"WINNERS:\\n\" + winnerSchedule);\n osw.close();\n\n System.out.println(\"winners.txt successfully created.\");\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) {\n\t\tFile myFile = new File(\"newfile.txt\");\n\t\t/*try {\n\t\t\tboolean isCreated = myFile.createNewFile();\n\t\t\tif(isCreated) {\n\t\t\t\tSystem.out.println(\"Your file is created\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"File wasn't created, or it's already there\");\n\t\t\t}\n\t\t} catch (FileNotFoundException fnf){\n\t\t\tfnf.printStackTrace();\n\t\t} catch (IOException ioe) {\n\t\t\tioe.printStackTrace();\n\t\t} */\n\t\t\n\t\t////////////////////// WRITE TO A FILE //////////////////////////////\n\t\t/*\n\t\t * \n\t\t */\n\t\ttry{\n\t\t byte[] writeArr = {1,2,3,4,5};\n\t\t FileWriter os = new FileWriter(\"newfile.txt\");\n\t\t for(int i = 0; i < writeArr.length ; i++){\n\t\t os.write( writeArr[i] ); \n\t\t }\n\t\t os.close();\n\t\t \n\t\t \n\t\t FileReader is = new FileReader(\"newfile.txt\");\n\t\t BufferedReader bfr = new BufferedReader((is));\n\t\t bfr.readLine()\n\t\t int size = is.available();\n\t\t \n\t\t for(int i=0; i< size; i++){\n\t\t System.out.print(is.read() + \" \");\n\t\t }\n\t\t is.close();\n\t\t }catch(IOException e){\n\t\t System.out.print(\"Exception\");\n\t\t }\t\n\t\t\n\t\t\n\n\t}", "public void dataFileCreate() {\r\n\t\tString COMMA_DELIMITER = \",\";\r\n\t\tString NEW_LINE_SEPERATOR = \"\\n\";\r\n\t\tString FILE_HEADER = \"Title,First Name,Last Name,Email,Phone Number\";\r\n\t\ttry {\r\n\t\t\tList<Customer> dataList = new ArrayList<Customer>();\r\n\t\t\tdataList.add(\r\n\t\t\t\t\tnew Customer(title, customerFirstName, customerLastName, custromerEmailId, customerPhoneNumber));\r\n\r\n\t\t\tFileWriter fileWriter = new FileWriter(\"CustomerDetails.csv\");\r\n\t\t\tBufferedWriter bufferWriter = new BufferedWriter(fileWriter);\r\n\t\t\tbufferWriter.append(FILE_HEADER);\r\n\r\n\t\t\tfor (Customer c : dataList) {\r\n\t\t\t\tbufferWriter.write(NEW_LINE_SEPERATOR);\r\n\t\t\t\tbufferWriter.write(c.getTitle());\r\n\t\t\t\tbufferWriter.write(COMMA_DELIMITER);\r\n\t\t\t\tbufferWriter.write(c.getFirstName());\r\n\t\t\t\tbufferWriter.write(COMMA_DELIMITER);\r\n\t\t\t\tbufferWriter.write(c.getLastName());\r\n\t\t\t\tbufferWriter.write(COMMA_DELIMITER);\r\n\t\t\t\tbufferWriter.write(c.getEmailAddress());\r\n\t\t\t\tbufferWriter.write(COMMA_DELIMITER);\r\n\t\t\t\tbufferWriter.write(String.valueOf(c.getPhone()));\r\n\t\t\t\tbufferWriter.write(COMMA_DELIMITER);\r\n\t\t\t}\r\n\r\n\t\t\tbufferWriter.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}", "@SuppressWarnings(\"unused\")\r\n\tprivate static File createFile(String path) {\r\n\t\t\r\n\t\t// open the file\r\n\t\tFile currentFile = new File(path);\r\n\t\t\r\n\t\t\r\n\t\t// check if it is a valid file\r\n\t\tif (currentFile == null) {\r\n\t\t\tSystem.out.println(\"Could not create the file\");\r\n\t\t\tthrow new NullPointerException();\r\n\t\t}\r\n\r\n\t\t// hopefully things went perfect\r\n\t\treturn currentFile;\r\n\r\n\t}", "public static void createFile(File source) {\n try {\n if (!source.createNewFile()) {\n throw new IOException();\n }\n } catch (IOException e) {\n throw new RuntimeException(\"Failed to create file: \" + source.getAbsolutePath(), e);\n }\n }", "public File generateFile()\r\n {\r\n return generateFile(null);\r\n }", "public File newLogFile() {\n File flog = null;\n try {\n this.logFileName = getTimestamp() + \".xml\";\n this.pathToLogFile = logFileFolder + logFileName;\n URL logURL = new URL(this.pathToLogFile);\n flog = new File(logURL.toURI());\n if (!flog.exists()) {\n flog.createNewFile();\n }\n } catch (Exception ex) {\n log.error(\"newLogFile :\"+ ex.getMessage());\n } finally{\n this.fLogFile = flog;\n return flog;\n }\n }", "public abstract void writeToFile( );", "public static void main(String[] args) throws IOException {\n\t\t\n\t\tFile file = new File(\"F:/Chandu/Test/Test1/Test2/Test3/Test4\");\n\t\t\n\t\t//create a directory\n\t\t\n\t\tboolean isFolderCreated =file.mkdirs();\n\t\t\n\t\tSystem.out.println(isFolderCreated);\n\t\t\n\t\t//get AbsolutePath\n\t\t\n\t\tString absolutePath =file.getAbsolutePath();\n\t\tSystem.out.println(absolutePath);\n\t\t\n\t\tString canonicalPath =file.getCanonicalPath();\n\t\tSystem.out.println(canonicalPath);\n\t\t\n\t\tboolean isDirectory =file.isDirectory();\n\t\t\n\t\tSystem.out.println(isDirectory);\n\t\t\n\t\t//how to create file\n\t\t\n\t\tFile file1 = new File(\"F:/Chandu/Test/abc.java\") ;\n\t\t\n\t\t//write data into file\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t}", "private void createFile() {\n if (mDriveServiceHelper != null) {\n Log.d(TAG, \"Creating a file.\");\n\n mDriveServiceHelper.createFile()\n .addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n //progressDialog.setProgress(100);\n progressDialog.dismiss();\n Toast.makeText(MainActivity.this, \"Download Successful\", Toast.LENGTH_SHORT).show();\n }\n })\n .addOnFailureListener(exception ->\n Log.e(TAG, \"Couldn't Create file.\", exception));}\n }", "public GridFSInputFile createFile(File f) throws IOException {\n\treturn createFile(new FileInputStream(f), f.getName(), true);\n }", "public static void createFiles()\n\t{\n\t\t//Variable Declaration\n\t\tScanner obj = new Scanner (System.in);\n\t\tString fileName; \n\t\tint linesCount;\n\t\tList<String> content = new ArrayList<String>();\n\t\t\n\t\t//Read file name from user\n\t\tSystem.out.println(\"Enter the FIle Name:\");\n\t\tfileName= obj.nextLine();\n\t\t\n\t\t//Read number of lines from user\n\t\tSystem.out.println(\"Enter how many line in the file:\");\n\t\tlinesCount= Integer.parseInt(obj.nextLine());\n\t\t\n\t\t//Read Lines from user\n\t\tfor(int i=1; i<=linesCount;i++)\n\t\t{\n\t\t\tSystem.out.println(\"Enter line \"+i+\":\");\n\t\t\tcontent.add(obj.nextLine());\n\t\t}\n\t\t\n\t\t//Save the content into the file\n\t\tboolean isSaved = FileManager.createFiles(folderpath, fileName, content);\n\t\t\n\t\tif(isSaved)\n\t\t\tSystem.out.println(\"File and data is saved sucessfully\");\n\t\telse\n\t\t\tSystem.out.println(\"Some error occured. Please contact [email protected]\");\n\t}", "@Override\r\n\tpublic void createBoardWithFile(Board board) {\n\t\t\r\n\t}", "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 }", "public void createFile(String ext) throws IOException {\n\t\tString name = JOptionPane\n\t\t\t\t.showInputDialog(\"Please Enter a new file name:\");\n\t\tif (name == null)\n\t\t\treturn;\n\n\t\t// get the current selected node and the file attached to it\n\t\tDefaultMutableTreeNode node = (DefaultMutableTreeNode) getLastSelectedPathComponent();\n\t\tEllowFile pfile = (EllowFile) node.getUserObject();\n\t\tEllowFile file;\n\n\t\tif (pfile.isDirectory()) {\n\t\t\tfile = new EllowFile(pfile.getAbsolutePath() + \"\\\\\\\\\" + name + \".\"\n\t\t\t\t\t+ ext);\n\t\t\tfile.createNewFile();\n\t\t\tfile.parentProject = pfile.parentProject;\n\t\t\t// use insert node instead of add to update the tree without\n\t\t\t// reloading it, which cause the tree to be reset\n\t\t\tmodel.insertNodeInto(new DefaultMutableTreeNode(file), node,\n\t\t\t\t\tnode.getChildCount());\n\t\t} else {\n\t\t\tfile = new EllowFile(pfile.getParent() + \"\\\\\\\\\" + name + \".\" + ext);\n\t\t\tfile.createNewFile();\n\t\t\tfile.parentProject = pfile.parentProject;\n\t\t\tnode = ((DefaultMutableTreeNode) node.getParent());\n\t\t\tmodel.insertNodeInto(new DefaultMutableTreeNode(file), node,\n\t\t\t\t\tnode.getChildCount());\n\t\t}\n\t\t// save the project to the file, and the file to the project, for later\n\t\t// reference\n\t\tpfile.parentProject.rebuild();\n\t\tmodel.nodeChanged(root);\n\n\t\t/*\n\t\t * if (ext.equals(ProjectDefault.EXT_NOTE))\n\t\t * desktopPane.createFrameNote(file);\n\t\t */\n\t\tdesktopPane.openFile(file);\n\t}", "public static void createNewFile(File file) {\n\t\ttry {\n\t\t\tfile.createNewFile();\n\t\t} catch (Exception exp) {\n\t\t\tthrow new RuntimeException(exp);\n\t\t}\n\t}", "public void create() {\n\t\t\n\t}", "private void tryToCreateNew() {\n if (current != null) {\n if (!this.tryToClose()) return;\n }\n\n //enter a name for this scenario\n String name = (String) JOptionPane.showInputDialog(\n this,\n \"Name of the scenario\",\n \"Next\",\n JOptionPane.PLAIN_MESSAGE,\n null,\n null,\n null);\n\n if (name == null) return;\n\n\n //select a directory name\n JFileChooser chooser = new JFileChooser(new File(\".\"));\n chooser.setDialogTitle(\"Select scenario file destination\");\n chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n\n int result = chooser.showDialog(this, \"Select\");\n if (result == JFileChooser.APPROVE_OPTION) {\n try {\n File dir = chooser.getSelectedFile();\n\n String path = dir.getAbsolutePath();\n String filename = path + File.separator + (name.replaceAll(\" \", \"_\")) + \".xml\";\n\n current = new Document(filename, name, path, Database.getInstance().getNumberOfFloors());\n current.save();\n\n this.update();\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, \"ERROR: the document could not be saved!\", \"An Error Occured\", JOptionPane.ERROR_MESSAGE);\n e.printStackTrace();\n }\n }\n }" ]
[ "0.7188921", "0.71493185", "0.70549244", "0.7046145", "0.703206", "0.6910916", "0.6853993", "0.68468094", "0.6830529", "0.68165386", "0.67405283", "0.6719523", "0.66984177", "0.6673988", "0.66271836", "0.6620416", "0.6601299", "0.65801793", "0.65754175", "0.6571958", "0.65545064", "0.6545358", "0.649564", "0.6491003", "0.64742357", "0.6466207", "0.64316624", "0.64215", "0.6421324", "0.64191014", "0.6408355", "0.6401028", "0.63426155", "0.63409966", "0.6326608", "0.63244057", "0.6324319", "0.6291966", "0.62738264", "0.6262393", "0.62515837", "0.6238203", "0.62377685", "0.6232613", "0.6194092", "0.6193717", "0.619178", "0.61777836", "0.6159647", "0.6159375", "0.615721", "0.61381", "0.61354023", "0.61335737", "0.6133201", "0.6132463", "0.6129259", "0.61180687", "0.61124974", "0.60835284", "0.60785025", "0.6064686", "0.60561156", "0.6052817", "0.6049027", "0.6044138", "0.60329884", "0.60215026", "0.6017949", "0.60138804", "0.6008793", "0.6006657", "0.5997802", "0.59946185", "0.5989824", "0.5989824", "0.5986132", "0.59850967", "0.5966609", "0.5965886", "0.59585303", "0.5950774", "0.5950204", "0.5946004", "0.5945417", "0.5940668", "0.5935112", "0.5934193", "0.59268117", "0.5921784", "0.5915159", "0.5913975", "0.59038824", "0.5899739", "0.58949745", "0.58903354", "0.5870321", "0.5868157", "0.5860273", "0.5856342" ]
0.6245035
41
Find file in folder
public static void searchFile(String path){ try { Scanner scanner = new Scanner(System.in); System.out.println("Enter the File Name You need to Find:"); String name = scanner.next(); File file = new File(path + "/" + name); if (file.isFile()) { file.getName(); System.out.println("File Exists"); } else{ System.out.println("File Not Found"); } } catch (Exception e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void searchFile() \n\t{\n\t\t//Variable Declaration\n\t\tString fileName;\n\t\tScanner obj = new Scanner(System.in);\n\n\t\t//Read file name from user\n\t\tSystem.out.println(\"Enter file name to searched:\");\n\t\tfileName= obj.nextLine();\n\t\t\n\t\t//Searching the file\n\t\tboolean isFound = FileManager.searchFile(folderpath, fileName);\n\t\t\n\t\tif(isFound)\n\t\t\tSystem.out.println(\"File is present\");\n\t\telse\n\t\t\tSystem.out.println(\"File not present.\");\n\n\t}", "private static void searchFile(File fileDir) throws Exception {\n String fileName = getFileNameInput();\n File targetFile = new File(fileDir.toString() + \"\\\\\" + fileName);\n boolean fileExists = targetFile.exists();\n if (fileExists) {\n System.out.println(\"File is found on current directory.\");\n } else {\n throw new FileNotFoundException(\"No such file on current directory.\");\n }\n }", "public File searchForFile(String searchFilename) {\r\n File[] files = new File(APP_INSTANCE.getAppDirectory()).listFiles((dir1, examineName) -> examineName.equals(searchFilename));\r\n return Arrays.stream(files).findFirst().orElse(null);\r\n }", "@Override\n public FileInfo findFile(String pkgPath) {\n if (fileLookup == null) {\n buildFileLookupMap();\n }\n return fileLookup.get(pkgPath);\n }", "public void testFindFilesForLocation() {\n \t\t//should not find the workspace root\n \t\tIWorkspaceRoot root = getWorkspace().getRoot();\n \t\tIFile[] result = root.findFilesForLocation(root.getLocation());\n \t\tassertEquals(\"1.0\", 0, result.length);\n\t\t\n\t\tIProject project = root.getProject(\"p1\");\n\t\tIFile existing = project.getFile(\"file1\");\n\t\tensureExistsInWorkspace(existing, true);\n\t\t\n\t\t//existing file\n\t\tresult = root.findFilesForLocation(existing.getLocation());\n\t\tassertResources(\"2.0\", existing, result);\n\t\t\n\t\t//non-existing file\n\t\tIFile nonExisting = project.getFile(\"nonExisting\");\n\t\tresult = root.findFilesForLocation(nonExisting.getLocation());\n\t\tassertResources(\"2.1\", nonExisting, result);\n \n \t\t// TODO add more tests\n \t}", "public FileLocation findFile(int k) {\n RemoteMapper rm = findMapper(k);\n FileLocation fl = null;\n try {\n return rm.lookup(k);\n } catch (RemoteException ex) {\n System.err.println(\"Mapper.findFile remote Exception\");\n }\n\n return fl;\n }", "public static boolean Java_find(File dir, String name) {\n boolean flag = false;\n // TODO: find files\n File[] fileList = dir.listFiles();\n\n for (File file : fileList) {\n if (file.getName().endsWith(name)) {\n System.out.println(file.getAbsolutePath());\n flag = true;\n } else if (file.isDirectory()) {\n boolean tempFlag = Java_find(file, name);\n if (!flag) {\n flag = tempFlag;\n }\n }\n }\n\n return flag;\n }", "protected ArrayList<Path> find(Path file) {\n\t\tPath name = file.getFileName();\n\t\tif (name != null && matcher.matches(name)) {\n\t\t\tresults.add(file);\n\t\t}\n\t\treturn null;\n\t}", "public static void findFile() throws IOException {\n File newFile = new File(\"test.txt\");\n FileInputStream stream = new FileInputStream(newFile);\n }", "String findPhastConsFile(String dirName, String regex) {\n\t\ttry {\n\t\t\tFile dir = new File(dirName);\n\t\t\tfor (File f : dir.listFiles()) {\n\t\t\t\tString fname = f.getCanonicalPath();\n\t\t\t\tif (fname.matches(regex)) return fname;\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\t// Do nothing\n\t\t}\n\n\t\tLog.info(\"Cannot find any file in directory '\" + dirName + \"' matching regular expression '\" + regex + \"'\");\n\t\treturn null;\n\t}", "@objid (\"116a5759-3df1-4c8b-bd9e-e521507f07e6\")\r\n public String searchFile() {\r\n String nomFichier = this.dialog.open();\r\n if ((nomFichier != null) && (nomFichier.length() != 0)) {\r\n this.currentFile = new File(nomFichier);\r\n this.text.setText(nomFichier);\r\n }\r\n return this.text.getText();\r\n }", "List<File> list(String directory) throws FindException;", "public static boolean Java_find(File dir, String name) {\n boolean flag = false;\n // TODO: find files\n File[] list = dir.listFiles();\n FileOperation.listOfFiles = new ArrayList<String>();\n FileOperation.listOfMatching = new ArrayList<String>();\n listOfAllFiles(dir);\n for(String filename:FileOperation.listOfFiles){\n if(filename.contains(name)){\n flag=true;\n listOfMatching.add(filename);\n }\n }\n return flag;\n }", "public String find()\n\t{\n\t\tFile f = new File(ampath);\n\t\tString fdir = f.getParent();\n\t\tFile fs = new File (fdir);\n\t\tString cplpath = null;\n\t\tboolean found = false;\n\t\t\n\t\tFile [] files = fs.listFiles();\n\t\t\n\t\tfor (int i=0; i<files.length; i++) {\n\t\t\tif(files[i].getName().equalsIgnoreCase(cplfilename)){\n\t\t\t\tfound = true;\n\t\t\t\tcplpath = files[i].getPath();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t//Searching in Subfolder for CPL-File\n\t\t\tif (files[i].isDirectory()) {\n\t\t\t\tFile f2 = new File(files[i].getPath());\n\t\t\t\tFile [] files2 = f2.listFiles();\n\t\t\t\tfor(int j=0; j<files2.length; j++) {\n\t\t\t\t\tif(files2[j].getName().equalsIgnoreCase(cplfilename)){\n\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\tcplpath = files2[i].getPath();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Returns CPL-File as String\n\t\tif (found == false) {\n\t\t\tSystem.out.println(\"CPL-File not found\");\n\t\t\treturn \"CPL-File not found\";\n\t\t}\n\t\telse {\n\t\t\treturn cplpath;\n\t\t}\n\t\t\n\t}", "private void seekBy() {\n Queue<File> queue = new LinkedList<>();\n queue.offer(new File(root));\n while (!queue.isEmpty()) {\n File file = queue.poll();\n File[] list = file.listFiles();\n if (file.isDirectory() && list != null) {\n for (File tempFile : list) {\n queue.offer(tempFile);\n }\n } else {\n if (args.isFullMatch() && searchingFile.equalsIgnoreCase(file.getName())) {\n result.add(file);\n }\n if (args.isMask() && searchingFile.replaceAll(\"\\\\*\", \".*\").equalsIgnoreCase(file.getName())) {\n result.add(file);\n }\n if (args.isRegex() && file.getName().matches(args.getName())) {\n result.add(file);\n }\n }\n }\n this.writeLog(output, result);\n }", "java.lang.String getFileLoc();", "public static FileInfo findFileInFolderInfo(Path file, FolderInfo folderInfo) {\n\t\tfor (FileInfo fileInfo : folderInfo.getFileInfoList()) {\n\t\t\tif (file.toString().equals(fileInfo.getOrgPath())) {\n\t\t\t\tif (file.toFile().length() == fileInfo.getSize()) {\n\t\t\t\t\treturn fileInfo;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "static void searchFile( ) \r\n\t {\n\t\t\r\n\t\t File directoryPath = new File(\"D:\\\\java_project\");\r\n\t File filesList[] = directoryPath.listFiles();\r\n\t\t Scanner file = new Scanner(System.in);\r\n System.out.println(\"Enter a file name\");\r\n String newfilename = file.next();\r\n\t\t File f = new File( \"D:\\\\java_project\\\\\"+file+\".txt\");\r\n\t boolean fileound=false;\r\n\t\t for(File file1:filesList)\r\n\t\t {\r\n\t\t \t File tempFile = new File(\"D:\\\\java_project\\\\\"+newfilename+\".txt\");\r\n\t\t\t boolean exists = tempFile.exists();\r\n\t\t\t\r\n\t\t \t if(exists)\r\n\t\t \t{\r\n\t\t\t\t fileound = true;\r\n\t\t\t\t\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t }\r\n\t\t }\r\n\t\t if(fileound)\r\n\t\t {\r\n\t\t\t System.out.println(\"File found\");\t\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\t System.out.println(\"File not found\");\r\n\t\t }\r\n\t\t\r\n\t }", "public static File getMatchingFile(String keyword) {\n\t\tFile directory = new File(Constant.pathToRoot + Constant.clientDataPath);\n\t\tif (directory != null) {// To check if there are files in this directory\n\t File[] listOfFiles = directory.listFiles();\n\t String currentFile;\n\t for (int i = 0; i < listOfFiles.length; i++) {\n\t if (listOfFiles[i].isFile()) {\n\t \tcurrentFile = listOfFiles[i].getName();\n\t if (currentFile.endsWith(keyword) || currentFile.startsWith(keyword)) {\n\t return listOfFiles[i];// User name already exist\n\t }\n\t }\n\t }\n\t\t}\n // User name does not exist\n \treturn null;\n\t}", "private File scanForScript(final File scriptPath, final RequestMethod verb) {\n File folder = scriptPath;\n File scriptFile = null;\n while(!folder.equals(scriptRoot)) {\n if(folder.exists() && folder.isDirectory()) {\n LOGGER.info(\"Scanning {} for script with verb {}\", scriptPath, verb);\n IOFileFilter fileFileFilter = FileFilterUtils.fileFileFilter();\n IOFileFilter prefixFileFilter = FileFilterUtils.prefixFileFilter(verb.name());\n File[] matchingFiles = folder.listFiles((FilenameFilter) FileFilterUtils.and(fileFileFilter, prefixFileFilter));\n if(matchingFiles != null && matchingFiles.length >= 1) {\n scriptFile = matchingFiles[0];\n break;\n }\n }\n folder = folder.getParentFile();\n }\n if(scriptFile == null) {\n LOGGER.error(\"Could not find script for verb {} on path {}\", verb.name(), scriptPath.getAbsolutePath());\n }\n return scriptFile;\n }", "CharStream findFile(String name) throws IOException,\n IncludeFileNotFound {\n // Look in the directory containing the source file ...\n String dir = \".\"; // default value used e.g. when reading from stdin\n File src = getSource();\n if (src != null && src.getParent() != null) {\n dir = src.getParent();\n }\n String full = dir + \"/\" + name;\n File f = new File(full);\n if (f.exists()) {\n LOG.debug(\"Using local file \" + full);\n return CharStreams.fromFileName(full);\n }\n\n // ... and fall back to the standard library path if not found.\n final URL url = ClassLoader.getSystemResource(\"include/\" + name);\n if (url != null) {\n LOG.debug(\"Using library \" + url);\n // Use fromReader(Reader, String) to catch the file name --- fromStream(InputStream) does not.\n return CharStreams.fromReader(new InputStreamReader(url.openStream()), url.getFile());\n }\n\n throw new IncludeFileNotFound(name, this, getInputStream()); // TODO: check this\n }", "@CheckForNull\n FileObject find(@NonNull String filename);", "public static File loadFileContainingString(String filename, File directory) {\n File[] files = directory.listFiles();\n if (files == null){\n return null;\n }\n for (File f : files) {\n if (f.getName().contains(filename)) {\n return f;\n } else if (f.isDirectory()) {\n File file = loadFileContainingString(filename, f);\n if (file != null) {\n return file;\n }\n }\n }\n return null;\n }", "public void performFileSearch() {\n\n // ACTION_OPEN_DOCUMENT is the intent to choose a file via the system's file browser.\n Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);\n\n // Filter to only show results that can be \"opened\", such as a\n // file (as opposed to a list of contacts or timezones)\n intent.addCategory(Intent.CATEGORY_OPENABLE);\n\n // Filter to show only images, using the image MIME data type.\n // If one wanted to search for ogg vorbis files, the type would be \"audio/ogg\".\n // To search for all documents available via installed storage providers, it would be \"*/*\".\n intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);\n intent.setType(\"image/*\");\n\n startActivityForResult(intent, READ_REQUEST_CODE);\n }", "private void searchNextFolder() {\n File nextFolder = foldersToSearch.get(0);\n File[] files = nextFolder.listFiles();\n for (int i = 0; i < files.length; i++) {\n if (this.isCancelled()) { break; }\n File nextFile = files[i];\n String nextLower = nextFile.getName().toLowerCase();\n if (nextFile.isHidden()) {\n // Skip hidden files and folders\n } else if (nextFile.isDirectory()) {\n if (nextLower.contains(\"archive\")\n || nextLower.contains(\"backup\")\n || nextLower.equals(\"deploy\")\n || nextLower.equals(\"dist\")\n || nextLower.equals(\"icons\")\n || nextLower.equals(\"jars\")\n || nextFile.getName().equalsIgnoreCase(\"Library\")\n || nextFile.getName().equalsIgnoreCase(\"Music\")\n || nextFile.getName().equalsIgnoreCase(\"Pictures\")\n || nextFile.getName().equalsIgnoreCase(\"PSPub Omni Pack\")\n || nextFile.getName().endsWith(\".app\")) {\n // Let's not search certain folders\n } else {\n foldersToSearch.add(nextFile);\n }\n } else if (nextFile.getName().equals(NoteIO.README_FILE_NAME)) {\n String line = \"\";\n boolean notenikLineFound = false;\n try {\n FileReader fileReader = new FileReader(nextFile);\n BufferedReader reader = new BufferedReader(fileReader);\n line = reader.readLine();\n while (line != null && (! notenikLineFound)) {\n int j = line.indexOf(NoteIO.README_LINE_1);\n notenikLineFound = (j >= 0);\n line = reader.readLine();\n }\n } catch(IOException e) {\n // Ignore\n }\n if (notenikLineFound) {\n FileSpec collectionSpec = master.getFileSpec(nextFolder);\n if (collectionSpec == null) {\n collectionsToAdd.add(nextFolder);\n }\n } // end if notenik line found within README file\n } // end if we found a README file\n } // end for each file in directory\n foldersToSearch.remove(0);\n }", "@NotNull\n protected VirtualFile searchForVirtualFileInProject(String filename) {\n Collection<VirtualFile> files = FilenameIndex.getVirtualFilesByName(myProject, filename, GlobalSearchScope.allScope(myProject));\n assertEquals(String.format(\"%s not found.\", filename), 1, files.size());\n return files.iterator().next();\n }", "private static File openFile(String file) {\r\n \tFile currFile;\r\n\r\n \tfor (String directory : dir) {\r\n \t\tcurrFile = new File(directory.concat(file));\r\n \t\tif (currFile.exists() && !currFile.isDirectory()) {\r\n \t\t\treturn currFile;\r\n \t\t}\r\n \t}\r\n \treturn null;\r\n }", "private File callNext() {\r\n \r\n while(fileIterator.hasNext()) {\r\n File temp = ((File) fileIterator.next());\r\n if(temp.getName().contains(searchPattern)) {\r\n \r\n return temp;\r\n }\r\n }\r\n return null;\r\n \r\n }", "List<String> getFiles(String path, String searchPattern) throws IOException;", "public void performSearch() throws IOException {\n configuration();\n\n File fileDir = new File(queryFilePath);\n if (fileDir.isDirectory()) {\n File[] files = fileDir.listFiles();\n Arrays.stream(files).forEach(file -> performSearchUsingFileContents(file));\n }\n }", "private void performFileSearch() {\n Intent intent = new Intent();\n intent.setType(\"*/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"), PICK_IMAGE_REQUEST);\n\n }", "public FileObject findResource(String name) {\n Enumeration en = getFileSystems ();\n while (en.hasMoreElements ()) {\n FileSystem fs = (FileSystem)en.nextElement ();\n FileObject fo = fs.findResource(name);\n if (fo != null) {\n // object found\n return fo;\n }\n }\n return null;\n }", "public void performFileSearch() {\n Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);\n\n // Filter to only show results that can be \"opened\", such as a file (as opposed to a list\n // of contacts or timezones)\n intent.addCategory(Intent.CATEGORY_OPENABLE);\n\n // Filter to show only images, using the image MIME data type.\n // If one wanted to search for ogg vorbis files, the type would be \"audio/ogg\".\n // To search for all documents available via installed storage providers, it would be\n // \"*/*\".\n intent.setType(\"image/*\");\n\n startActivityForResult(intent, READ_REQUEST_CODE);\n // END_INCLUDE (use_open_document_intent)\n }", "public static String findBillFile() throws IOException{\n\t\tString billFile = null;\n\t\tFile directory = new File(System.getProperty(\"user.dir\"));\n\t\tFile[] allFilesInDir = directory.listFiles();\n\t\tint count = 0;\n\t\tfor(File file:allFilesInDir) {\n\t\t\tif (file.toString().endsWith(\".csv\")) {\n\t\t\t\tcount++;\n\t\t\t\tif (count == 2) {\n\t\t\t\t\tbillFile = file.toString();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn billFile;\n\t}", "List<String> getFiles(String path, String searchPattern, String searchOption) throws IOException;", "public void searchFile(String fname) {\n File file = new File(fname);\n try {\n BufferedReader br = new BufferedReader(new FileReader(file));\n String s;\n while ((s = br.readLine()) != null) { \n //Search each line for at least 1 match ogf the regex\n searchLine(s);\n }\n } catch (FileNotFoundException e) { \n System.out.println(\"File \" + fname + \" not found\");\n } catch (IOException e) { \n e.printStackTrace();\n }\n }", "@Override\n public void run() {\n \t\n \t\t\n \t\tSearchFile.findFile(f1);\n }", "public int getFileFromID(int id) {\n for(int i = 0 ; i < files.size(); i++) {\n if(files.get(i).getFileID() == id)\n return i;\n }\n return -1;\n }", "private File getMatchingFile(String fileName){\n debug(\"matching file: \"+fileName);\n StringBuffer filePath = new StringBuffer();\n filePath.append(rootDir.getAbsolutePath());\n filePath.append(File.separator);\n String compPath = fileName.replace('\\\\', '/'); \n Iterator it = files.iterator(); \n while(it.hasNext()){\n String rawPath = (String)it.next();\n String path = rawPath.replace('\\\\', '/');\n debug(\"path:\"+path); \n if(getFile(rawPath).isDirectory()){\n //check if path ends with the same name as fileName starts\n int rawIndex = path.lastIndexOf('/');\n String rawEnd = path.substring(rawIndex+1);\n debug(\"rawend:\"+rawEnd);\n int compIndex = compPath.indexOf('/');\n String compStart;\n if (compIndex < 0) {\n compStart = \".\";\n } else {\n compStart = compPath.substring(0,compIndex);\n }\n if(rawEnd.equals(compStart)){\n debug(\"equals\");\n filePath.append(path);\n if (compIndex >= 0) filePath.append(compPath.substring(compIndex));\n break;\n }\n }else{\n if(path.endsWith(compPath)){\n filePath.append(path);\n break;\n }\n }\n }\n debug(\"matching file result:\"+filePath.toString());\n return new File(filePath.toString());\n }", "private String locateFile(String fileName) {\n\t\tString file = null;\n\t\tURL fileURL = ClassLoader.getSystemResource(fileName);\n\t\tif (fileURL != null) {\n\t\t\tfile = fileURL.getFile();\n\t\t} else\n\t\t\tSystem.err.println(\"Unable to locate file \" + fileName);\n\t\treturn file;\n\t}", "private static RubyFile findRubyScript(RubyProject rubyProject, String rubyScriptName) {\r\n \t\tfor (RubyProjectElement rubyElement : rubyProject.getRubyElementsInternal()) {\r\n \t\t\tif (rubyElement.getFileExtension().equals(\"urf\")) {\r\n \t\t\t\tif (rubyElement.getName().equals(rubyScriptName)) {\r\n \t\t\t\t\treturn (RubyFile)rubyElement;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn null;\r\n \t}", "@Override\n public final boolean accept(File dir, String name) {\n return pattern.matcher(name).find();\n }", "@NotNull\n protected VirtualFile firstMatchingVirtualFileInProject(String filename) {\n Collection<VirtualFile> files = FilenameIndex.getVirtualFilesByName(myProject, filename, GlobalSearchScope.allScope(myProject));\n assertTrue(String.format(\"Filename %s not found in project\", filename), files.size() > 0);\n return files.iterator().next();\n }", "public boolean searchFile(FileObject file)\n throws IllegalArgumentException;", "public String searchFromGridFile(File file) {\n String result = \"\";\n\n // TODO: read file and generate path using AStar algorithm\n\n return result;\n }", "void getFilesInfoInFolder(String pathToFolder) {\n File[] listOfFiles = getFilesInFolder(pathToFolder);\n for (int i = 0; i < listOfFiles.length; i++) {\n if (listOfFiles[i].isFile()) {\n System.out.println(\"File \" + listOfFiles[i].getName());\n continue;\n }\n\n if (listOfFiles[i].isDirectory()) {\n System.out.println(\"Directory \" + listOfFiles[i].getName());\n }\n }\n }", "public static File[] findFiles(String fileName) {\n List<File> fileList_ = new ArrayList<File>();\n if(fileRepoPath_ != null)\n listFiles(new File(fileRepoPath_),fileName, fileList_);\n if(fileList_.size()==0) {\n try {\n \t Enumeration<URL> en_ = FileFinder.class.getClassLoader().getResources(fileName);\n \t while(en_.hasMoreElements()) {\n \t fileList_.add(new File(en_.nextElement().getFile().replaceAll(\"%20\",\" \")));\n \t }\n \t } \n \t catch(IOException e) { }\n }\n \treturn (File[])fileList_.toArray(new File[fileList_.size()]);\n }", "public File getSingleFileFromDirectory(int index) {\n ClassLoader classLoader = getClass().getClassLoader();\n File directoryFile = new File(classLoader.getResource(directoryString).getFile());\n\n\n File[] files = directoryFile.listFiles();\n\n return files[index];\n }", "private String get_FilePath(String put, int ind) {\n\n File file = new File(put);\n File[] files = file.listFiles();\n\n try {\n if (files[ind].isFile()) {\n return files[ind].getAbsolutePath();\n }\n } catch (Exception e) {\n Log.d(TAG, \"Exception error : \" + e.getMessage());\n }\n return null;\n }", "public static File searchForFile(String fileName, List<String> possibleLocations) throws FileNotFoundException {\n for (String possibleLocation : possibleLocations) {\n Path path = Paths.get(possibleLocation, fileName);\n File file = new File(path.toUri());\n if (file.exists()) {\n return file;\n }\n }\n\n // File not found, throw exception\n StringBuilder sb = new StringBuilder(\"Unable to find file \")\n .append(fileName)\n .append(\" in any of the following locations:\\n\");\n for (String possibleLocation : possibleLocations) {\n Path path = Paths.get(possibleLocation, fileName);\n File file = new File(path.toUri());\n sb.append(file).append(\"\\n\");\n }\n\n throw new FileNotFoundException(sb.toString());\n }", "static void searchForFile() {\n\t\ttry {\n\t\t\t// Get the path for the user's current shared and not-shared directories\n\t\t\tFile sharedPath = new File(\"users/\" + username + \"/shared\");\n\t\t\tFile notSharedPath = new File(\"users/\" + username + \"/not-shared\");\n\n\t\t\t// Allow the user to enter the name of the file they want to search for\n\t\t\tSystem.out.println(\"Enter the name of the file you wish to search for followed by Enter\");\n\t\t\tSystem.out.print(\"Your Entry: \");\n\n\t\t\tString fileToSearchFor = input.readLine();\n\n\t\t\t// Create an array of filenames for the shared and not-shared files\n\t\t\tFile[] sharedFiles = sharedPath.listFiles();\n\t\t\tFile[] notSharedFiles = notSharedPath.listFiles();\n\n\t\t\t// Check through the shared files array to see if the user already owns the file and is sharing it\n\t\t\tfor (File file : sharedFiles) {\n\t\t\t\tif (fileToSearchFor.equals(file.getName())) {\n\t\t\t\t\t// If it exists, tell the user and prompt to exit\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\tSystem.out.println(\"You already own the file: \" + fileToSearchFor);\n\t\t\t\t\tSystem.out.println(\"It is in your shared files.\");\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t// This has been added in order to allow the user to review the results before going back to the main menu\n\t\t\t\t\t// Upon pressing Enter, the main menu will come back up again and ready for a new menu option to be selected\n\t\t\t\t\ttry {\n\t\t\t\t\t\tSystem.out.println(\"Press any key to return\");\n\t\t\t\t\t\tinput.readLine();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tSystem.out.println(\"Error! \" + e.getMessage());\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check through the not-shared files array to see if the user already owns the file and is not sharing it\n\t\t\tfor (File file : notSharedFiles) {\n\t\t\t\tif (fileToSearchFor.equals(file.getName())) {\n\t\t\t\t\t// If it exists, tell the user and prompt to exit\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\tSystem.out.println(\"You already own the file: \" + fileToSearchFor);\n\t\t\t\t\tSystem.out.println(\"It is in your non-shared files.\");\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t// This has been added in order to allow the user to review the results before going back to the main menu\n\t\t\t\t\t// Upon pressing Enter, the main menu will come back up again and ready for a new menu option to be selected\n\t\t\t\t\ttry {\n\t\t\t\t\t\tSystem.out.println(\"Press any key to return\");\n\t\t\t\t\t\tinput.readLine();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tSystem.out.println(\"Error! \" + e.getMessage());\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Otherwise, this means the user does not have the file\n\t\t\t// In this case, send a request to the server via CORBA to see who owns the file\n\t\t\tString[] usersWithFile = server.findFile(fileToSearchFor);\n\t\t\t// If no one owns a file by this name that is available for sharing, let the user know\n\t\t\tif(usersWithFile.length == 0){\n\t\t\t\tSystem.out.println(\"No match was found for: '\"+ fileToSearchFor + \"'\");\n\t\t\t\tSystem.out.println(\"It does not exist, or is not currently being shared.\");\n\t\t\t}\n\t\t\t// Otherwise a match was found\n\t\t\t// Give the user an option to download the file and share it, download the file and keep it in their not-shared directory, or return to the main menu\n\t\t\t// Keep the owner of the file's information hidden from the user\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"A match for : \"+ fileToSearchFor + \" was found.\");\n\t\t\t\tSystem.out.println(\"Would you like to download the file?\");\n\t\t\t\tSystem.out.println(\"\\t[1] | Download And Share The File\");\n\t\t\t\tSystem.out.println(\"\\t[2] | Download And Do Not Share The File\");\n\t\t\t\tSystem.out.println(\"\\t[3] | Return To The Main Menu\");\n\t\t\t\tSystem.out.println(\"--------------------------------------------------------------------\");\n\t\t\t\tSystem.out.print(\"Your Entry: \");\n\t\t\t\tString userEntry = input.readLine();\n\n\t\t\t\t// If the user enters 1, start the download file method with the flag of 1\n\t\t\t\tif(userEntry.equals(\"1\")){\n\t\t\t\t\tdownloadFile(usersWithFile, fileToSearchFor, 1);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// If the user enters 2, start the download file method with the flag of 2\n\t\t\t\telse if (userEntry.equals(\"2\")) {\n\t\t\t\t\tdownloadFile(usersWithFile, fileToSearchFor, 2);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// If the user enters 3, bring them back to the main menu\n\t\t\t\telse if (userEntry.equals(\"3\")){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// Otherwise, they entered something invalid, return to the main menu\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"Invalid entry! Returning to the main menu.\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error! : \" + e.getMessage());\n\t\t\treturn;\n\t\t}\n System.out.println();\n\t\t// This has been added in order to allow the user to review the results before going back to the main menu\n\t\t// Upon pressing Enter, the main menu will come back up again and ready for a new menu option to be selected\n try {\n System.out.println(\"Press any key to return\");\n input.readLine();\n } catch (Exception e) {\n System.out.println(\"Error! \" + e.getMessage());\n }\n\t}", "private File getFile(String path, String name)\r\n {\r\n File file = null;\r\n boolean found = false;\r\n String ext = \"\";\r\n\r\n for (int i = 0; i < name.length(); i++)\r\n ext += \"\" + ( (name.charAt(i) == '.') ? '\\\\' : name.charAt(i));\r\n\r\n while(ext.length() > 0 && !found)\r\n {\r\n file = new File(path + \"\\\\\" + ext + \".java\");\r\n found = file != null && file.exists() && file.isFile();\r\n ext = ext.substring(0, Math.max(0, ext.lastIndexOf('\\\\')));\r\n }\r\n\r\n return (found)?file:null;\r\n }", "public static void main(String[] args) throws IOException {\n\n\n findFile();\n return;\n }", "public static File searchPaths(Iterable<? extends File> paths, String relFile) {\n for (File path : paths) {\n File f = new File(path, relFile);\n if (f.exists()) {\n return path;\n }\n }\n return null;\n }", "public interface FileLocator {\n\n /**\n * Returns the file corresponding to the filename (or path) or\n * <code>null</code> if locator can't find the file.\n *\n * @param filename name of the file\n * @return the file corresponding to the filename (or path) or\n * <code>null</code> if locator can't find the file\n */\n @CheckForNull\n FileObject find(@NonNull String filename);\n\n }", "public void testFindFile() throws TimeoutException, ExecutionException {\r\n AnActionEvent e = createAnActionEvent(\"file2.java\");\r\n Project project = e.getProject();\r\n String expected = \"[PsiJavaFile:file2.java]\";\r\n assertEquals(TraverseProjectPsi.findFile(project).size(), 1);\r\n assertEquals(TraverseProjectPsi.findFile(project).toString(), expected);\r\n }", "public String resolvePath();", "public List<String> search(File file, String name) {\n\t\t\n\t\tif (file.isDirectory()) {\n\t\t\tlog.debug(\"Searching directory:[{}]\", file.getAbsoluteFile());\n\n\t\t\t// do you have permission to read this directory?\n\t\t\tif (file.canRead()) {\n\t\t\t\tfor (File temp : file.listFiles()) {\n\t\t\t\t\tif (temp.isDirectory()) {\n\t\t\t\t\t\tsearch(temp, name);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (name.equals(temp.getName())) {\n\t\t\t\t\t\t\tresult.add(temp.getAbsoluteFile().toString());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tlog.info(\"Permission Denied: [{}]\", file.getAbsoluteFile());\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}", "private void FindFiles(Path findPath)\n {\n\n try (DirectoryStream<Path> stream = Files.newDirectoryStream(findPath))\n {\n\n for (Path thisPath : stream)\n {\n File file = new File(thisPath.toString());\n\n if (file.isDirectory())\n {\n dirCount++;\n\n if (HasMatch(thisPath.toString(), lineIncludePattern, lineExcludePattern))\n {\n dirLineMatchCount++;\n\n System.out.println(thisPath.toAbsolutePath().toString() + \",directory,none\");\n }\n\n if (HasMatch(thisPath.toString(), dirIncludePattern, dirExcludePattern))\n {\n dirMatchCount++;\n folderLevel++;\n //indentBuffer = String.join(\"\", Collections.nCopies(folderLevel * 3, \" \"));\n indentBuffer = \"\";\n\n //System.out.println(indentBuffer + thisPath.toString() + \" ...\");\n FindFiles(thisPath.toAbsolutePath());\n\n folderLevel--;\n //indentBuffer = String.join(\"\", Collections.nCopies(folderLevel * 3, \" \"));\n }\n }\n else\n {\n fileCount++;\n\n if (HasMatch(thisPath.getParent().toString(), lineIncludePattern, lineExcludePattern))\n {\n fileLineMatchCount++;\n\n System.out.println(thisPath.getParent().toString() + \",\" + thisPath.getFileName() + \",none\");\n }\n\n if (HasMatch(thisPath.toString(), fileIncludePattern, fileExcludePattern))\n {\n fileMatchCount++;\n\n File refFile;\n if (doReplace)\n {\n refFile = new File(thisPath.toString() + \"_bak\");\n file.renameTo(refFile);\n\n //System.out.println(indentBuffer + thisPath.toString());\n Scan(refFile.toPath().toAbsolutePath().toString(),thisPath.toAbsolutePath().toString());\n }\n else\n {\n //System.out.println(indentBuffer + thisPath.toString());\n Scan(file.toPath().toAbsolutePath().toString(),thisPath.toAbsolutePath().toString());\n }\n\n }\n }\n }\n }\n catch (Exception e)\n {\n System.err.format(\"Exception occurred trying to read '%s'.\", findPath);\n e.printStackTrace();\n }\n\n }", "public Map<String, Object> fileFinder(String file_id) {\n\t\tMap<String, Object> tempMap = new HashMap<String,Object>();\n\t\tMap<String, Object> findMap = new HashMap<String,Object>();\n\t\tArrayList<File> rootList= new ArrayList<File>(Arrays.asList(rootFile.listFiles()));\n\t\tString curName;\n\t\tfor(File file:rootList) {\n\t\t\tcurName = file.getName();\n\t\t\tString reg1 = \"(^[FP]_\"+file_id+\"_TB.xml$)\";\n\t\t\tPattern p = Pattern.compile(reg1);\n\t\t\tMatcher m = p.matcher(curName);\n\t\t\tif(m.find()) {\n\t\t\t\tif((file.getName()).charAt(0)=='F')\n\t\t\t\t\ttempMap.put(\"F\", new File(file.getPath()));\n\t\t\t\telse\n\t\t\t\t\ttempMap.put(\"P\", new File(file.getPath()));\n\t\t\t}\n\t\t\ttempMap.put(curName, tempMap);\n\t\t}\n\t\treturn tempMap;\n\t}", "public static boolean containsFile(File dir) {\n try {\n final boolean[] found = new boolean[1];\n found[0] = false;\n Files.walkFileTree(dir.toPath(), new SimpleFileVisitor<Path>(){\n @Override\n public FileVisitResult visitFile(Path path, BasicFileAttributes attributes) throws IOException {\n if(Files.isRegularFile(path)){\n found[0] = true;\n return FileVisitResult.TERMINATE;\n }\n return FileVisitResult.CONTINUE;\n }\n });\n return found[0];\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "private void findFiles(Path file) throws InterruptedException {\n Path name = file.getFileName();\n if (name != null && matcher.matches(name)) {\n System.out.println(String.format(\"Put file [%s] to files queue\", file));\n files.put(file.toString());\n }\n }", "public static Path findItemInCache( final String name, final Configuration conf) throws IOException {\r\n\t\tif (name==null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tPath result = null;\r\n\t\tresult = findClassPathFile(name,conf);\r\n\t\tif (result!=null) {\r\n\t\t\treturn result;\r\n\t\t}\r\n\t\tresult = findNonClassPathFile(name,conf);\r\n\t\tif (result!=null) {\r\n\t\t\treturn result;\r\n\t\t}\r\n\t\tresult = findClassPathArchive(name,conf);\r\n\t\tif (result!=null) {\r\n\t\t\treturn result;\r\n\t\t}\r\n\t\tresult = findNonClassPathArchive(name,conf);\r\n\t\tif (result!=null) {\r\n\t\t\treturn result;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public File findOne(String id) {\n\t\treturn fileDAO.selectOneById(id);\n\t}", "@Override\n\tpublic List<FileConfig> findFile(String fileName) {\n\t\treturn this.fileConfigDao.findFile(fileName);\n\t}", "@Override \n\t\tprotected String findEclipseOnPlatform(File dir) {\n\t\t\tFile possible = new File(dir, getWindowsExecutableName());\n\t\t\treturn (possible.isFile()) ? dir.getAbsolutePath() : null;\n\t\t}", "private String handleFindFileRequest(String request) {\r\n\t\tString[] commandFragments = Utils.splitCommandIntoFragments(request);\r\n\t\t// TODO validation here\r\n\t\tString[] filesFromCommandFrag = Utils.getKeyAndValuefromFragment(commandFragments[0]);\r\n\t\tString[] failedPeerList = Utils.getKeyAndValuefromFragment(commandFragments[1], SharedConstants.NO_LIMIT_SPLIT);\r\n\r\n\t\tString peers = findPeersForFile(filesFromCommandFrag[1], failedPeerList[1]);\r\n\t\treturn peers;\r\n\t}", "@Nullable\n public ObjectId findFile(String fileName) throws IOException {\n if (revision == null) {\n return null;\n }\n\n try (TreeWalk tw = TreeWalk.forPath(reader, fileName, revision.getTree())) {\n if (tw != null) {\n return tw.getObjectId(0);\n }\n }\n return null;\n }", "static void walkTheDir(){ \n\t try (Stream<Path> paths = Files.walk(Paths.get(\"/ownfiles/tullverketCert/source\"))) {\n\t \t paths\n\t \t .filter(Files::isRegularFile)\n\t \t //.forEach(System.out::println);\n\t \t .forEach( e ->{\n\t \t \t\tSystem.out.println(e);\n\t \t \t\tSystem.out.println(e.getParent());\n\t \t \t\t\n\t \t \t});\n\t \t \n \t}catch (Exception e) { \n\t System.out.println(\"Exception: \" + e); \n\t } \n\t }", "@Override\n public common.FileLocation lookup(int key) throws RemoteException {\n common.FileLocation fl = map.get(key);\n if (fl == null) {\n printAct(\">requested of key: \" + key + \", returned null\");\n } else {\n printAct(\">requested of key: \" + key + \", returned: \" + fl);\n }\n return fl;\n }", "public ArrayList<File> findRelevantFiles (int reimburseID);", "public abstract String getFileLocation();", "private DomainFile findProgramByName(String programText, DomainFolder folder) {\n\t\tDomainFile[] files = folder.getFiles();\n\t\tfor (DomainFile file : files) {\n\t\t\tif (file.getName().equals(programText)) {\n\t\t\t\treturn file;\n\t\t\t}\n\t\t}\n\n\t\t// not at the current level, then check sub-folders\n\t\tDomainFolder[] folders = folder.getFolders();\n\t\tfor (DomainFolder subFolder : folders) {\n\t\t\tDomainFile domainFile = findProgramByName(programText, subFolder);\n\t\t\tif (domainFile != null) {\n\t\t\t\treturn domainFile;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public IAstRlsSourceFile findRlsFile(int langCode);", "private static void getFile(String path){\n File file = new File(path); \r\n // get the folder list \r\n File[] array = file.listFiles();\r\n // flag = array.length;\r\n \r\n for(int i=0;i<array.length;i++){ \r\n if(array[i].isFile()){ \r\n // only take file name \r\n //System.out.println(\"^^^^^\" + array[i].getName()); \r\n // take file path and name \r\n //System.out.println(\"#####\" + array[i]); \r\n // take file path and name \r\n System.out.println(\"*****\" + array[i].getPath()); \r\n\t\t\tcalculate_Ave(array[i].getPath());\r\n } \r\n }\r\n}", "@Override\n public void run() {\n DriveId parentId = getFolderID(file, googleAPI);\n\n // This returns the id of the file itself. We don't found to do that.\n// if (parentId != null)\n// parentId = getID(parentId, fileName, fileType, googleAPI);\n\n // Let the Callback handle a 'not found' file.\n// if (parentId == null) {\n// return;\n// }\n\n Filter filter = Filters.and(\n Filters.in(SearchableField.PARENTS, parentId)\n , Filters.eq(SearchableField.TRASHED, false)\n , Filters.eq(SearchableField.TITLE, fileName));\n\n // Create a query for a specific filename in Drive.\n final Query query = new Query.Builder()\n .addFilter(filter)\n .build();\n\n Drive.DriveApi.query(googleAPI, query)\n .setResultCallback(resultOfQuery);\n }", "private File getDocumentFile(String filename) {\n LOGGER.debug(\"In getDownloadFile Params: filename[{}]\", filename);\n // get absolute path of the application\n String root = fileUploadDirectory; //context.getRealPath(\"/\");\n File folder = new File(root + File.separator + \"uploads\");\n if (folder.exists()) {\n File[] listFiles = folder.listFiles();\n for (File listFile : listFiles) {\n if (listFile.getName().equals(filename)) {\n LOGGER.debug(\"File found: [{}]\", listFile.getName());\n return listFile;\n }\n }\n } else {\n LOGGER.error(\"File upload folder path not found [{}]\", folder.getName());\n }\n LOGGER.error(\"Download File not found: [{}]\", filename);\n return null;\n }", "@RequestMapping(value = \"/search-in-doc/{id}\", \n\t\t\t\t\tmethod = RequestMethod.GET)\n\tpublic ResponseEntity<?> searchInDoc(@PathVariable(\"id\") String id, \n\t\t\t\t\t\t\t\t\t\t\t @RequestParam(value = \"word\", required = true) String word) throws IOException {\n\n\t\tboolean foundFile = false; // denota si el archivo fue encontrado\n\t\t\n\t\tString pageToken = null;\n\t\tdo { // proceso de busqueda\n\t\t\tFileList result = DriveConnection.driveService.files().list() \n\t\t\t\t .setSpaces(\"drive\")\n\t\t\t .setFields(\"nextPageToken, files(id)\") \n\t\t\t .setPageToken(pageToken)\n\t\t\t .execute();\n\t\t\n\t\t\t\t for (File file : result.getFiles()) { \n\t\t\t\t\t if (file.getId().equals(id)) {\n\t\t\t\t\t\t\tfoundFile = true;\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t \n\t\t\t pageToken = result.getNextPageToken();\n\t\t} while (pageToken != null);\n\t\t\n\t\tif (foundFile) {\n\t\t\t\n\t\t\tFile content = DriveConnection.driveService.files().get(id).execute();\t\n\t\t\tcontent.toString().contains(word);\t\n\t\t\treturn new ResponseEntity<>(\"Found\", HttpStatus.OK); // mostramos rpta en consola\n\t\t\t\t\n\t\t} else {\t\n\t\t\t\n\t\t\treturn new ResponseEntity<>(\"Not found\", HttpStatus.NOT_FOUND); // mostramos rpta en consola\n\t\t\t\n\t\t}\n\t\n\t}", "private List<String> scoutForFiles(FileType fileType, Path path) {\n\t\tfinal List<String> filesFound = new ArrayList<>();\n\n\t\t// Create a stream of Paths for the contents of the directory\n\t\ttry (Stream<Path> walk = Files.walk(path)) {\n\n\t\t\t// Filter the stream to find only Paths that match the filetype we are looking\n\t\t\tfilesFound.addAll(walk.map(x -> x.toString())\n\t\t\t\t.filter(f -> f.endsWith(fileType.suffix)).collect(Collectors.toList()));\n\t\t} catch (IOException e) {\n\t\t\tthrow new MessagePassableException(EventKey.ERROR_EXTERNAL_DIR_NOT_READABLE, e, path.toString());\n\t\t}\n\n\t\treturn filesFound;\n\t}", "public List<File> search(String token, String name) {\n Drive service;\n List<File> files = new ArrayList<>();\n try {\n service = getDriveService(token);\n files = service.files().list().setQ(\"name = '\" + name + \"'\").setFields(\"files(id, name, mimeType, owners, ownedByMe, trashed)\").execute().getFiles();\n\n } catch (IOException | GeneralSecurityException e) {\n log.debug(\"Error while searching the file, {}\", e.getMessage());\n //e.printStackTrace();\n }\n\n return files;\n }", "static List<PsiFile> findViewFiles(String relativePath, Project project) {\n PsiManager psiManager = PsiManager.getInstance(project);\n\n // If no extension is specified, it's a PHP file\n relativePath = PhpExtensionUtil.addIfMissing(relativePath);\n\n List<PsiFile> viewFiles = new ArrayList<>();\n for (PsiFileSystemItem fileSystemItem : getViewDirectories(project)) {\n VirtualFile viewDirectory = fileSystemItem.getVirtualFile();\n VirtualFile viewFile = viewDirectory.findFileByRelativePath(relativePath);\n if (viewFile != null && !viewFile.isDirectory()) {\n PsiFile psiFile = psiManager.findFile(viewFile);\n if (psiFile != null) {\n viewFiles.add(psiFile);\n }\n }\n }\n return viewFiles;\n }", "static void find(final File current,\n final Histogram class_use,\n final Histogram method_use) {\n if (current.isDirectory()) {\n for (File child:current.listFiles()){\n find(child, class_use, method_use);\n }\n } else if (current.isFile()) {\n String name = current.toString();\n if ( name.endsWith(\".zip\")\n || name.endsWith(\".jar\")\n || name.endsWith(\".rar\") // weird use of rar for zip, but ... used in case study.\n || name.endsWith(\".war\")\n ) {\n processZip(current, class_use, method_use);\n } else if (name.endsWith(\".class\")) {\n processClass(current, class_use, method_use);\n }\n } else {\n TextIo.error(\"While processing file `\" + current + \"` an error occurred.\");\n }\n }", "public FileManagerFile getFile(int id) throws Exception {\n\n if (files == null) { // defer loading files list until requested.\n cacheFoldersFiles();\n }\n for (FileManagerFile file : files) {\n if (file.getId() == id) {\n return file;\n }\n }\n return null;\n }", "private String retrieveWorkSpaceFileLoc(String fileName) {\n ArrayList<String> regResourceProjects = loadRegistryResourceProjects();\n boolean fileExists = false;\n IWorkspace workspace = ResourcesPlugin.getWorkspace();\n String folder = workspace.getRoot().getLocation().toFile().getPath().toString();\n String resourceFilePath = null;\n for (String regResourceProject : regResourceProjects) {\n resourceFilePath = folder + File.separator + regResourceProject + File.separator +\n fileName;\n File resourceFile = new File(resourceFilePath);\n if (resourceFile.exists()) {\n fileExists = true;\n break;\n }\n }\n if (!fileExists) {\n displayUserError(RESGISTRY_RESOURCE_RETRIVING_ERROR, NO_SUCH_RESOURCE_EXISTS);\n }\n return resourceFilePath;\n }", "public void isfolder(File findfile){\n\t\tif(findfile.isDirectory()){\n\t\t\tSystem.out.println(findfile + \"is a directory\");\n\t\t\tString[] directoryContents = findfile.list();\n\t\t\tfor(int i = 0; i < directoryContents.length; i++){\n\t\t\t\tFile newpath = new File(findfile + \"/\" + directoryContents[i]);\n\t\t\t\tisfolder(newpath);\n\t\t\t\t\t\t\n\t\t\t}\n\t\t}else{\n\t\t\tHashmappDemo.addtoHashMap(findfile);\n\t\t}\n\t\t\n\t}", "private Map<String, ModuleReference> scanDirectory(Path dir)\n throws IOException\n {\n // The map of name -> mref of modules found in this directory.\n Map<String, ModuleReference> nameToReference = new HashMap<>();\n\n try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir)) {\n for (Path entry : stream) {\n BasicFileAttributes attrs;\n try {\n attrs = Files.readAttributes(entry, BasicFileAttributes.class);\n } catch (NoSuchFileException ignore) {\n // file has been removed or moved, ignore for now\n continue;\n }\n\n ModuleReference mref = readModule(entry, attrs);\n\n // module found\n if (mref != null) {\n // can have at most one version of a module in the directory\n String name = mref.descriptor().name();\n ModuleReference previous = nameToReference.put(name, mref);\n if (previous != null) {\n String fn1 = fileName(mref);\n String fn2 = fileName(previous);\n throw new FindException(\"Two versions of module \"\n + name + \" found in \" + dir\n + \" (\" + fn1 + \" and \" + fn2 + \")\");\n }\n }\n }\n }\n\n return nameToReference;\n }", "public static void main(String[] args) throws IOException {\n\n Path path = Paths.get(\"11\");\n Files.walkFileTree(path, new FileVisitor<Path>() {\n @Override\n public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {\n return FileVisitResult.CONTINUE;\n }\n\n @Override\n public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n System.out.println(file.getFileName().toString());\n if (file.getFileName().toString().equals(\"5.txt\")) {\n System.out.println(\"Requested file is found\");\n return FileVisitResult.TERMINATE;\n }\n return FileVisitResult.CONTINUE;\n }\n\n @Override\n public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {\n return FileVisitResult.CONTINUE;\n }\n\n @Override\n public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {\n return FileVisitResult.CONTINUE;\n }\n });\n }", "@Nullable\n public DocumentFile findFile(@NonNull Context context, @NonNull DocumentFile parent, @NonNull String fileName) {\n List<DocumentFile> result = listDocumentFiles(context, parent, createNameFilterEquals(fileName), false, true, true);\n if (!result.isEmpty()) return result.get(0);\n else return null;\n }", "ArrayList<File> findSong(File file) {\n ArrayList<File> arrayList = new ArrayList<>();\n\n File[] files = file.listFiles();\n for (File singleFile : files) {\n if (singleFile.isDirectory() && !singleFile.isHidden()) {\n arrayList.addAll(findSong(singleFile));\n } else {\n if (singleFile.getName().endsWith(\".mp3\") || singleFile.getName().endsWith(\".wva\")) {\n arrayList.add(singleFile);\n }\n }\n }\n return arrayList;\n }", "private File findIndex(File fastaFile) {\n\t\tString presumedPath = fastaFile.getAbsolutePath() + \".fai\";\n\t\tFile index = new File(presumedPath);\n\t\treturn index;\n\t}", "public interface IReadDirectory {\n\n /**\n * List all files existing in the given directory.\n * \n * @param directory\n * @return file list\n * @throws FindException\n */\n List<File> list(String directory) throws FindException;\n\n}", "public static void goThroughFilesForFolder(final File folder) throws Exception {\r\n\r\n\t\t/*\r\n\t\t * char[] filePath;\r\n\t\t// *Files.walk(Paths.get(\"E:/Studying/eclipse/workspace/Thesis/PMIDs\")).\r\n\t\t * Files.walk(Paths.get(\"E:/Studying/Box Sync/workspace/Thesis/PMIDs\")).\r\n\t\t * forEach(filePath -> { if (Files.isRegularFile(filePath)) {\r\n\t\t * System.out.println(filePath); } }\r\n\t\t */\r\n\t\t// /*\r\n\t\tfor (final File fileEntry : folder.listFiles()) {\r\n\t\t\tif (fileEntry.isDirectory()) {\r\n\t\t\t\tgoThroughFilesForFolder(fileEntry);\r\n\t\t\t} else {\r\n\t\t\t\tprocessFile(fileEntry);\r\n\t\t\t\t// System.out.println(fileEntry.getName());\r\n\t\t\t}\r\n\t\t}\r\n\t\t// */\r\n\t}", "public static Path findNonClassPathFile( final String name, final Configuration conf) throws IOException {\r\n\t\tif (name==null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tPath []files = DistributedCache.getLocalCacheFiles(conf);\r\n\t\tif (files==null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tString altName = makeRelativeName(name, conf);\r\n\t\tfor( Path file : files) {\r\n\t\t\tif (name.equals(file.getName())) {\r\n\t\t\t\treturn file;\r\n\t\t\t}\r\n\t\t\tif (altName!=null&&altName.equals(file.getName())) {\r\n\t\t\t\treturn file;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public int searchFileContent(String path, String searchString, boolean ignoreCase, boolean skipSubDirectories) {\n\t\tsuccesses.clear();\n\t\tfailures.clear();\n\t\tfinal Path sourcePath = Paths.get(path);\n\t\ttry {\n\t\t\tFiles.walkFileTree(sourcePath, EnumSet.of(FileVisitOption.FOLLOW_LINKS), Integer.MAX_VALUE, new SimpleFileVisitor<Path>() {\n\t\t\t\t\n\t\t\t\t/* (non-Javadoc)\n\t\t\t\t * @see java.nio.file.SimpleFileVisitor#visitFile(java.lang.Object, java.nio.file.attribute.BasicFileAttributes)\n\t\t\t\t */\n\t\t\t\t@Override\n\t\t\t\tpublic FileVisitResult visitFile(Path file,\n\t\t\t\t\t\tBasicFileAttributes attrs) {\n\t\t\t\t\tFileContent fileContent = new FileContent();\n\t\t\t\t\tif(!file.toFile().isDirectory() && !filter.applies(file)) {\n\t\t\t\t\t\tif(fileContent.search(file, searchString, ignoreCase)) {\n\t\t\t\t\t\t\tsuccesses.add(file);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(!skipSubDirectories)\n\t\t\t\t\t\treturn FileVisitResult.CONTINUE;\n\t\t\t\t\telse \n\t\t\t\t\t\treturn FileVisitResult.SKIP_SUBTREE;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* (non-Javadoc)\n\t\t\t\t * @see java.nio.file.SimpleFileVisitor#visitFileFailed(java.lang.Object, java.io.IOException)\n\t\t\t\t */\n\t\t\t\t@Override\n\t\t\t\tpublic FileVisitResult visitFileFailed(Path file,\n\t\t\t\t\t\tIOException exc) {\n\t\t\t\t\tfailures.add(file);\n\t\t\t\t\t// return super.visitFileFailed(file, exc);\n\t\t\t\t\tif(!skipSubDirectories)\n\t\t\t\t\t\treturn FileVisitResult.CONTINUE;\n\t\t\t\t\telse \n\t\t\t\t\t\treturn FileVisitResult.SKIP_SUBTREE;\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\tif(!successes.isEmpty()) {\n\t\t\t\tSystem.out.println(\"Succeeded to search in the following paths:\");\n\t\t\t\tfor(Path p : successes)\n\t\t\t\t\tSystem.out.println(p.toString());\n\t\t\t\tSystem.out.println(\"Matches in total: \" + successes.size());\n\t\t\t} \n\t\t\tif(!failures.isEmpty()) {\n\t\t\t\tSystem.out.println(\"Failed to search in the following paths:\");\n\t\t\t\tfor(Path p : failures)\n\t\t\t\t\tSystem.out.println(p.toString());\n\t\t\t} \n\t\t}\n\t\treturn successes.size();\n\t}", "String getFilepath();", "public IFile getChildFile(String name) {\n // Loops through the children files of the current directory\n for (IFile element : this.childFiles) {\n // If the name equals to the name of the file you're searching for,\n // return it\n if (element.getName().equals(name)) {\n return element;\n }\n }\n // Return null otherwise\n return null;\n }", "@Override\n public InputStream findResource(String filename)\n {\n InputStream resource = null;\n try\n {\n Path scriptRootPath = Files.createDirectories(getScriptRootPath(side));\n Path scriptPath = scriptRootPath.resolve(filename).toAbsolutePath();\n resource = Files.newInputStream(scriptPath, StandardOpenOption.READ);\n } catch (IOException e)\n {\n resource = super.findResource(filename);\n }\n return resource;\n }", "@Nullable\n public DocumentFile findFolder(@NonNull Context context, @NonNull DocumentFile parent, @NonNull String subfolderName) {\n List<DocumentFile> result = listDocumentFiles(context, parent, createNameFilterEquals(subfolderName), true, false, true);\n if (!result.isEmpty()) return result.get(0);\n else return null;\n }", "@Test\n public void testGetFile() {\n System.out.println(\"getFile with valid path of existing folder with 2 subfiles\");\n String path = System.getProperty(\"user.dir\")+fSeparator+\"MyDiaryBook\"+fSeparator+\"Users\"+fSeparator+\n \"Panagiwtis Georgiadis\"+fSeparator+\"Entries\"+fSeparator+\"Texnologia2\"+fSeparator+\"Images\";\n FilesDao instance = new FilesDao();\n File expResult = new File(path+fSeparator+\"testImg.jpg\");\n File result;\n try{\n result = instance.getFile(path);\n }catch(EntryException ex){\n result = null;\n }\n assertEquals(\"Some message\",expResult, result);\n }", "public abstract VFolder locatePackage(final String pkg_name);" ]
[ "0.6908228", "0.6710762", "0.6532409", "0.6369467", "0.63034195", "0.62441343", "0.6228954", "0.6189753", "0.61800736", "0.6163421", "0.61620486", "0.6120826", "0.606627", "0.60177976", "0.60116124", "0.6007929", "0.5926833", "0.59147894", "0.5901405", "0.58858657", "0.58126855", "0.5806162", "0.58047324", "0.5803312", "0.5753709", "0.5704676", "0.5687544", "0.5685688", "0.5683043", "0.5681158", "0.5666552", "0.5651535", "0.5645356", "0.56291187", "0.5594044", "0.55502266", "0.5515356", "0.551076", "0.55078113", "0.54919213", "0.54818726", "0.5451218", "0.5449576", "0.54490227", "0.5447551", "0.5447332", "0.5426221", "0.5422833", "0.53946716", "0.53901184", "0.5379432", "0.53713197", "0.5365341", "0.5360252", "0.5345265", "0.5345121", "0.53374416", "0.5336563", "0.5323535", "0.531592", "0.53115803", "0.53021425", "0.5274192", "0.5272568", "0.52614135", "0.525853", "0.52370095", "0.52353317", "0.5227682", "0.52157044", "0.52114195", "0.5206484", "0.52064216", "0.5202163", "0.5198471", "0.51975715", "0.51859254", "0.5178633", "0.5175985", "0.5167882", "0.5159265", "0.5158902", "0.5144713", "0.51254493", "0.5115836", "0.51135826", "0.51129186", "0.51109505", "0.5110326", "0.5104157", "0.510319", "0.5099528", "0.5096139", "0.5092695", "0.50913984", "0.50814086", "0.5074734", "0.5074663", "0.50556386", "0.5041364" ]
0.6573692
2
Select the workflow for the selected Option
public void workFlow() { System.out.println("Enter the Option:"); options(); int option = scanner.nextInt(); switch (option) { case 1: file = new File(path); if(file.isDirectory()) { ascendingOrder(file); } else { System.out.println("Invalid path please select new context to continue"); } System.out.println("\n"); operation(); break; case 2: file = new File(path); if(file.isDirectory()) { createFile(path); System.out.println("[If you want to view the file added in the folder ,select option 1,else please continue]"); }else { System.out.println("Invalid path please select new context to continue"); } System.out.println("\n"); operation(); break; case 3: file = new File(path); if(file.isDirectory()) { deleteFile(path); System.out.println("\n"); }else { System.out.println("Invalid path please select new context to continue"); } operation(); break; case 4: file = new File(path); if(file.isDirectory()) { searchFile(path); System.out.println("\n"); }else { System.out.println("Invalid path please select new context to continue"); } operation(); break; case 5: file = new File(path); if(file.isDirectory()) { System.out.println("The current execution context is closed--------/"); System.out.println("\n"); }else { System.out.println("-----------Invalid Input-----------"); } path=null; operation(); break; case 6: System.out.println("--------------Thank You For Using File System------------"); break; default: System.out.println("The Option You Have Entered Does not exist ,Please enter the valid option:"); workFlow(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent actionevent) {\n\t\t\t\tif (select.isSelected()) {\r\n\t\t\t\t\tservice.selectTask(row);\r\n\t\t\t\t\t// service.getTask(row).setSelected(true);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tservice.cancleTask(row);\r\n\t\t\t\t\t// service.getTask(row).setSelected(false);\r\n\t\t\t\t}\r\n\t\t\t\t// System.out.println(\"after: \" + service.getSelectedSet());\r\n\r\n\t\t\t}", "void selectActivityOptions(int activity_number, Model model);", "public void selectChangeSecurityQuestionsOption() {\n\t\ttry {\n\t\t\n\t\t\t//Utility.wait(changeSecurityQuestions);\n\t\t\tchangeSecurityQuestions.click();\n\t\t\tUtility.simpleWait(6000);\n\t\t\tLog.addMessage(\"Change Security Questions option selected\");\n\t\t}catch(Exception e) {\n\t\t\tLog.addMessage(\"Failed to select Change Security Questions option\");\n\t\t\tSystem.out.println(e.getMessage().toString());\n\t\t\tAssert.assertTrue(false, \"Failed to slect Change Security Questions option\");\n\t\t}\n\t}", "private void selectPhenotype(String option) {\r\n if (option.equals(\"null\") || option.equals(currentPhenotype)){\r\n return;\r\n } \r\n \r\n setDatasets((VerifiedSNP) getController().getActiveSNP(), option);\r\n currentPhenotype = option; \r\n }", "public void selected(String action);", "public void chooseOptionAssignToOnBulkActionsDropDown() {\n getLogger().info(\"Choose option: Assign to.\");\n clickElement(optionAssignTo, \"Assign To Option\");\n }", "public void selectAgent(int selected) {\n this.selected = selected;\n }", "public void selectActionToStartTraining(String trainingName)\n {\n\t\t WebElement optionToBeSelected= driver.findElement(ByLocator(\"//strong[contains(text(),'\"+trainingName+\"')]/..//button\"));\n\t\t clickOn(optionToBeSelected);\n\t\t reportInfo();\n }", "public void chooseCurentInstructuon(Event event) {\n InstructionsModel selectProject = lvInstructions.getSelectionModel().getSelectedItem();\n labelInstructions.setText(selectProject.getContent());\n }", "@Listen(\"onClick = #selectModel\")\n\tpublic void selectModel(){\n\t\ttreeModel.setOpenObjects(List.of(treeModel.getRoot().getChildren().get(path[0])));\n\t\ttreeModel.addToSelection(treeModel.getChild(path));\n\t}", "public void select() {\n checkboxElement.click();\n }", "private void actionSwitchSelect()\r\n\t{\r\n\t\tif (FormMainMouse.isSampleSelectOn)\r\n\t\t{\r\n\t\t\thelperSwitchSelectOff();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\thelperSwitchSelectOn();\r\n\r\n\t\t\t//---- If we can select sample, we can not move it\r\n\t\t\thelperSwitchMoveOff();\r\n\t\t}\r\n\t}", "private void optionSelected(MenuActionDataItem action){\n \t\tString systemAction = action.getSystemAction();\n \t\tif(!systemAction.equals(\"\")){\n \t\t\t\n \t\t\tif(systemAction.equals(\"back\")){\n \t\t\t\tonBackPressed();\n \t\t\t}else if(systemAction.equals(\"home\")){\n \t\t\t\tIntent launchHome = new Intent(this, CoverActivity.class);\t\n \t\t\t\tstartActivity(launchHome);\n \t\t\t}else if(systemAction.equals(\"tts\")){\n \t\t\t\ttextToSearch();\n \t\t\t}else if(systemAction.equals(\"search\")){\n \t\t\t\tshowSearch();\n \t\t\t}else if(systemAction.equals(\"share\")){\n \t\t\t\tshowShare();\n \t\t\t}else if(systemAction.equals(\"map\")){\n \t\t\t\tshowMap();\n \t\t\t}else\n \t\t\t\tLog.e(\"CreateMenus\", \"No se encuentra el el tipo de menu: \" + systemAction);\n \t\t\t\n \t\t}else{\n \t\t\tNextLevel nextLevel = action.getNextLevel();\n \t\t\tshowNextLevel(this, nextLevel);\n \t\t\t\n \t\t}\n \t\t\n \t}", "@Override\n\tpublic TurnAction selectAction() {\n\t\tJSONObject message = new JSONObject();\n\t\tmessage.put(\"function\", \"select\");\n\t\tmessage.put(\"type\", \"action\");\n\n\t\tthis.sendInstruction(message);\n\t\tString selected = this.getResponse();\n\t\treturn TurnAction.valueOf(selected);\n\t}", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n if (parent.getItemAtPosition(position).equals(\"Choose Your Workout\")) {\n // do nothing\n }\n else {\n //get the workout chosen by the user\n chosenWorkout = parent.getItemAtPosition(position).toString();\n Intent intent = new Intent(WorkoutActivity.this, DropDownActivity.class);\n startActivity(intent);\n }\n\n }", "public void onClick(View v) {\n showSchedule(v);\n league_selected = leagues_sp.getSelectedItemPosition();\n Log.d(\"MainActivity\", \"Selected league is \" +league_selected);\n team_selected = teams_sp.getSelectedItem().toString();\n Log.d(\"MainActivity\", \"Selected team is \" +team_selected);\n }", "@Listen(\"onClick = #selectTree\")\n\tpublic void select(){\n\t\ttreeModel.setOpenObjects(treeModel.getRoot().getChildren());\n\t\tTreeitem[] items = tree.getItems().toArray(new Treeitem[0]);\n\t\ttree.setSelectedItem(items[items.length - 1]);\n\t}", "@OnClick(R.id.converter_organization_cv)\n public void chooseOrganization() {\n mDialog = new DialogList(mContext,\n mOrganizationDialogTitle, null, mListForOrganizationsDialog,\n new RecyclerViewAdapterDialogList.OnItemClickListener() {\n @Override\n public void onClick(int position) {\n mOrganizationId = mListForOrganizationsDialog.get(position).getOrganization().getId();\n mPreferenceManager.setConverterOrganizationId(mOrganizationId);\n mDialog.getDialog().dismiss();\n checkDefaultData();\n setLang();\n }\n });\n ((ImageView) mDialog.getDialog().getWindow().findViewById(R.id.dialog_list_done))\n .setImageResource(R.drawable.ic_tr);\n mDialog.getDialog().getWindow().findViewById(R.id.dialog_list_done)\n .setBackground(getResources().getDrawable(R.drawable.ic_tr));\n }", "public Axiom getSelected() {\r\n\treturn view.getSelected();\r\n }", "@Override\n public void select(Menu context) {\n updateControllable(context);\n currentStructure.assignWorkersToPowerHarvest(context.getFocus(), PopUpMenuWindow.WorkerMenu());\n }", "public void setSelected(boolean selected);", "default public void clickSelect() {\n\t\tremoteControlAction(RemoteControlKeyword.SELECT);\n\t}", "public void setSelected(boolean selected) \n {\n this.selected = selected;\n }", "@Override\n\tpublic void setSelected(boolean selected) {\n\t\t\n\t}", "public void setSelected(boolean s)\n {\n selected = s; \n }", "public void select() {\n \t\t\tString sinput = \"\";\r\n \t\t\tOption selected = null;\r\n \t\t\tErrorLog.debug(name + \" selected.\");\r\n \t\t\t\r\n \t\t\twhile (true) {\r\n \t\t\t\tSystem.out.println(toString()); //Print menu.\r\n \t\t\t\tsinput = read(); //Get user selection.\r\n \t\t\t\tif (!sinput.equalsIgnoreCase(\"exit\")) {\r\n \t\t\t\t\tselected = options.get(sinput); //Find corresponding option.\r\n \r\n \t\t\t\t\tif (selected != null) //Sinput corresponds to an extant option.\r\n \t\t\t\t\t\tselected.select(); //Select the selected.\r\n \t\t\t\t\telse\r\n \t\t\t\t\t\tprint(sinput + \" is not a valid option\");\r\n \t\t\t\t} else\r\n \t\t\t\t\t{print(\"Returning to previous menu.\"); break;}\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tErrorLog.debug (\"Quitting \" + name + \". Sinput:\"+sinput);\r\n \t\t\t\r\n \t\t\treturn;\r\n \t\t}", "public void openWorkflow() {\n Workflow workflow = null;\n int returnVal = this.graphFileChooser.showOpenDialog(this.engine.getGUI().getFrame());\n\n if (returnVal == JFileChooser.APPROVE_OPTION) {\n File file = this.graphFileChooser.getSelectedFile();\n logger.debug(file.getPath());\n\n try {\n String path = file.getPath();\n\n if (path.endsWith(XBayaConstants.GRAPH_FILE_SUFFIX)) {\n WSGraph graph = WSGraphFactory.createGraph(file);\n workflow = Workflow.graphToWorkflow(graph);\n } else {\n JsonObject workflowObject = JSONUtil.loadJSON(file);\n// XmlElement workflowElement = XMLUtil.loadXML(file);\n// workflow = new Workflow(workflowElement);\n workflow = new Workflow(workflowObject);\n }\n GraphCanvas newGraphCanvas = engine.getGUI().newGraphCanvas(true);\n newGraphCanvas.setWorkflow(workflow);\n //this.engine.setWorkflow(workflow);\n engine.getGUI().getGraphCanvas().setWorkflowFile(file);\n } catch (IOException e) {\n this.engine.getGUI().getErrorWindow().error(ErrorMessages.OPEN_FILE_ERROR, e);\n } catch (GraphException e) {\n this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);\n } catch (ComponentException e) {\n this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);\n } catch (RuntimeException e) {\n this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);\n } catch (Error e) {\n this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);\n }\n }\n \n }", "public void setSelected(boolean select) {\r\n isSelected = select;\r\n }", "public void buildSelectedAction() {\n\t\tfinal List<Project> selectedItems = selectionList.getSelectionModel().getSelectedItems();\n\t\tif (!selectedItems.isEmpty()) {\n\t\t\tnavigationController.clickProgress();\n\t\t\tprojectService.build(selectedItems, false);\n\t\t}\n\t}", "@Override\n public void onClick(View view)\n {\n if(selectedStructure != null) //checks if object is selected and if prev object is same object\n {\n //if object is the same, then deselect the structure\n if (selectedStructure.equals(structureList.get(getAdapterPosition())))\n selected = false;\n else\n selected = true;\n }\n\n // if selected, get object otherwise let no object is selected\n if (selected)\n {\n selectedStructure = structureList.get(getAdapterPosition());\n }\n else\n {\n selectedStructure = null;\n }\n }", "public void select(int action) {\n\t\tselected = true;\n\t\tthis.action = action;\n\t}", "public void invSelected()\n {\n\t\t//informaPreUpdate();\n \tisSelected = !isSelected;\n\t\t//informaPostUpdate();\n }", "public void setSelectedOption(int selectedOption) {\n this.selectedOption = selectedOption;\n }", "public void option() {\n ReusableActionsPageObjects.clickOnElement(driver, options, logger, \"user options.\");\n }", "abstract public void cabMultiselectPrimaryAction();", "public void selectAProduct() {\n specificProduct.click();\n }", "public void setSelection (boolean selected) {\r\n\tcheckWidget();\r\n\tif ((style & (SWT.CHECK | SWT.RADIO | SWT.TOGGLE)) == 0) return;\r\n\tOS.PtSetResource (handle, OS.Pt_ARG_FLAGS, selected ? OS.Pt_SET : 0, OS.Pt_SET);\r\n}", "public String getOptionSelection(){\r\n\t\treturn optionSelection;\r\n\t}", "public void selectEditProfileOption() {\n\t\ttry {\n\t\t\t//Utility.wait(editProfile);\n\t\t\teditProfile.click();\n\t\t\tLog.addMessage(\"Edit Profile option selected\");\n\t\t}catch(Exception e) {\n\t\t\tLog.addMessage(\"Failed to select EditProfile option\");\n\t\t\tSystem.out.println(e.getMessage().toString());\n\t\t\tAssert.assertTrue(false, \"Failed to select EditProfile option\");\n\t\t}\n\t}", "public void openSaveSelection() {\n\t\ttry {\n\t\t\tFXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(\"/SaveSelectionView.fxml\"));\n\t\t\tfxmlLoader.setResources(bundle);\n\t\t\tParent root1 = (Parent) fxmlLoader.load();\n\t\t\tStage stage = new Stage();\n\t\t\tSaveSelectionController ssc = fxmlLoader.getController();\n\t\t\tssc.setMainController(this);\n\t\t\tstage.initModality(Modality.APPLICATION_MODAL);\n\t\t\t// stage.initStyle(StageStyle.UNDECORATED);\n\t\t\tstage.setTitle(bundle.getString(\"sSHeaderLabel\"));\n\t\t\tstage.setScene(new Scene(root1));\n\t\t\tstage.show();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void selectSurvey(int index) {\n selectedSurvey = activeTargetedSurveys.get(index);\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tgsv.startSelectState();\n\t\t\t}", "public String button1_action() {\n getSessionBean1().setSelected_algos(listbox1.getValueAsStringArray(this.getContext()));\n getSessionBean1().setSelected_tiers(listbox2.getValueAsStringArray(this.getContext()));\n getSessionBean1().setSelected_runs(listbox3.getValueAsStringArray(this.getContext()));\n getSessionBean1().setSelected_storageelems(listbox4.getValueAsStringArray(this.getContext()));\n //getSessionBean1().setSelected_branches(listbox5.getValueAsStringArray(this.getContext()));\n \n //String selected_primary = (String)dropDown1.getSelected().toString();\n //log(\"Selected Primary is\"+selected_primary);\n \n if ( dropDown1.getSelected() != null ||\n getSessionBean1().getSelected_algos().length !=0 || \n getSessionBean1().getSelected_tiers().length !=0 ||\n getSessionBean1().getSelected_runs().length != 0 ||\n getSessionBean1().getSelected_storageelems().length !=0 \n //getSessionBean1().getSelected_branches().length !=0\n ) {\n getSessionBean1().setItems_selected(\"1\");\n }\n return null;\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tjtp.setSelectedIndex(1);\r\n\t\t\t}", "public AUndertaking getSelectedTask()\n {\n String errorMsg;\n Iterator<AUndertaking> taskIt = getSelectedTaskIterator();\n\n if (taskIt.hasNext()) {\n AUndertaking selectedTask = taskIt.next();\n\n if (! taskIt.hasNext()) {\n return selectedTask;\n }\n\n errorMsg = \"Selection is multiple\";\n }\n else {\n errorMsg = \"Nothing is selected\";\n }\n\n throw new IllegalStateException(errorMsg);\n }", "public void selectModelItem(final String type, final String name){\n\t\tactivate();\n\t\tDisplay.syncExec(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n DefaultCTabItem tabItem = new DefaultCTabItem(1);\n\t\t\t\ttabItem.activate();\n\t\t\t\tGraphicalViewer viewer = ((IEditorPart) tabItem.getSWTWidget().getData()).getAdapter(GraphicalViewer.class);\n\t\t\t\tviewer.select(ViewerHandler.getInstance().getEditParts(viewer, new ModelEditorItemMatcher(type, name)).get(0));\n\t\t\t}\n\t\t});\n\t}", "@Override\n\t\tpublic void setSelected(int p_178011_1_, int p_178011_2_, int p_178011_3_) {\n\n\t\t}", "@Override\n\t\tpublic void setSelected(int p_178011_1_, int p_178011_2_, int p_178011_3_) {\n\n\t\t}", "public void select(boolean a)\n {\n selected = a;\n }", "public void setSelected(boolean selected) {\n\t\tiAmSelected = selected;\n\t}", "public void setSelection(Pair selection);", "@Override\n public void selectItem(String selection) {\n vendingMachine.setSelectedItem(selection);\n vendingMachine.changeToHasSelectionState();\n }", "public boolean getSelected()\n {\n return selected; \n }", "static void selectFirstOption(){\r\n\r\n WebDriverWait wait= new WebDriverWait(BrowserInitiation.driver, 5000);\r\n wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector(brandFromListCssSelector)));\r\n\r\n List<WebElement> brandOptionsList= BrowserInitiation.driver.findElements(By.cssSelector(brandFromListCssSelector));\r\n brandOptionsList.get(0).click();\r\n\r\n }", "@Then(\"^Select value from dropdown, select check box & radio button$\")\n\t public void J() throws InterruptedException {\n\t\t Select s= new Select(driver.findElement(By.xpath(\"//*[@id=\\\"input_3\\\"]\")));\n\t\t s.selectByIndex(5);\n\t\t\n\t\t// Select check box\n\t\tWebElement Checkbox = driver.findElement(By.xpath(\"//*[@id=\\\"input_8_0\\\"]\"));\n\t\tJavascriptExecutor executor = (JavascriptExecutor)driver;\n\t\texecutor.executeScript(\"arguments[0].click();\", Checkbox);\n\t\t\n\t\t//Select radio button\n\t\t\n\t\tWebElement RadioButton = driver.findElement(By.xpath(\"//*[@id=\\\"input_13_1\\\"]\"));\n\t\t\n\t\texecutor.executeScript(\"arguments[0].click();\", RadioButton);\n\t\t\n\t\tif(RadioButton.isSelected()) {\n\t\t\tSystem.out.println(\"Radio button is selected\");\n\t\t}\n\t\tThread.sleep(2000);\n\t\t\n\t\t }", "public boolean isSelected() { return selected; }", "private void doSelect() {\n this.setVisible(false);\n }", "@Override\n public void perform() {\n pickList.advanced().getSourceList().getItem(ChoicePickerHelper.byIndex().last()).select();\n pickList.advanced().getAddButtonElement().click();\n pickList.advanced().getRemoveButtonElement().click();\n }", "public void setSelected(boolean selected) {\n this.selected = selected;\n }", "public OptionEntry getSelectedOption() {\n for (Iterator it=getEntries().iterator();it.hasNext();) {\n OptionEntry o=(OptionEntry)it.next();\n if (o.getValue().getBoolean()==true) {\n return o;\n }\n }\n return null;\n\n }", "public abstract void selectInTree(@NotNull Project project, @NotNull SModel model, boolean focus);", "@Override\n\t\tpublic void launch(Map<GherkinEditorDocument, IStructuredSelection> selection, Mode mode,\n\t\t\t\tboolean temporary, IProgressMonitor monitor) {\n\t\t}", "public void chooseYourMode(){\r\n ActionHandlers.ChooseModeHandler chooseModeHandler = (s) -> {\r\n try {\r\n choice.put(s);\r\n } catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n };\r\n runLater(() -> main.run(chooseModeHandler));\r\n }", "@FXML\n void selectSavings(ActionEvent event) {\n \tdirectDep.setSelected(false);\n \tisLoyal.setSelected(false);\n \tdirectDep.setDisable(true);\n \tisLoyal.setDisable(false);\n }", "private static void selectOption() {\n\t\tSystem.out.println(\n\t\t\t\t\"\\r\\nSelect an Option:\\r\\n\" + \n\t\t\t\t\"1. Factorial\\r\\n\" + \n\t\t\t\t\"2. Fibonacci\\r\\n\" + \n\t\t\t\t\"3. Greatest Common Denominator\\r\\n\" + \n\t\t\t\t\"4. Combinatorial\\r\\n\" + \n\t\t\t\t\"5. Josephus\\r\\n\" + \n\t\t\t\t\"6. Quit\\r\\n\" + \n\t\t\t\t\"\");\n\t}", "@Then(\"^I choose the park on combobox$\")\n public void i_choose_the_park_on_combobox() {\n onViewWithId(R.id.spinnerParks).click();\n onViewWithText(\"Parque D\").isDisplayed();\n onViewWithText(\"Parque D\").click();\n }", "public void setButtonSelection(String action);", "public int getSelected() {\n \t\treturn selected;\n \t}", "public void setSelection(int molIndex) {}", "@Override\n public void onClick(View v) {\n\n holder.routineCompletedButton.setSelected(!holder.routineCompletedButton.isSelected());\n\n }", "public abstract void select(boolean select);", "public void setSelectPresentation(java.lang.String[] selectPresentation);", "public void CameToSelectActivity (View view) {\n Intent CameToSelectIntent = new Intent(getApplicationContext(), SelectActivity.class);\n startActivity(CameToSelectIntent);\n }", "public S getSelected()\n\t\t{\n\t\t\treturn newValue;\n\t\t}", "public static void setToggleActionSelected(ToggleDockingActionIf toggleAction,\n\t\t\tActionContext context, boolean selected, boolean wait) {\n\n\t\tboolean shouldPerformAction = runSwing(() -> {\n\t\t\treturn toggleAction.isSelected() != selected;\n\t\t});\n\n\t\tif (shouldPerformAction) {\n\t\t\tperformAction(toggleAction, context, wait);\n\t\t}\n\t}", "public boolean isSelected(){\r\n return selected;\r\n }", "public void toSelectingAction() {\n }", "@Override\r\n protected TreeItem getSelectedItem() {\r\n return getSelectionModel().getSelectedItem();\r\n }", "public String getSyndicatedLoanArrangementSelectedOption() {\n return syndicatedLoanArrangementSelectedOption;\n }", "public String getFinancialMarketAnalysisSelectedOption() {\n return financialMarketAnalysisSelectedOption;\n }", "private void helperSwitchSelectOn()\r\n\t{\r\n\t\tImageIcon iconButton = FormUtils.getIconResource(FormStyle.RESOURCE_PATH_ICO_SELECT_PRESSED);\r\n\r\n\t\tmainFormLink.getComponentToolbar().getComponentButtonSelect().setIcon(iconButton);\r\n\r\n\t\tFormMainMouse.isSampleSelectOn = true;\r\n\t}", "public void setSelected(int index){\n\t\toptGroup.setSelected(index);\n\t\tsetText(optGroup.selectedText());\n\t}", "private void selectPriority(String priority) {\n delegationDefaultCreationScreen.priorityField.click();\n delegationDefaultCreationScreen.picker.sendKeys(priority);\n delegationDefaultCreationScreen.doneButton.click();\n }", "public Team selectTeam() {\r\n \r\n String[] list = new String[controller.getTeams().size()];\r\n for (int i = 0; i < controller.getTeams().size(); i++) {\r\n list[i] = controller.getTeams().get(i).getName();\r\n }\r\n\r\n JComboBox cmbOption = new JComboBox(list);\r\n int input = JOptionPane.showOptionDialog(null, cmbOption, \"Select Team that your like Delete\",JOptionPane.DEFAULT_OPTION,JOptionPane.QUESTION_MESSAGE, null, null, null);\r\n if(input==-1){\r\n return null;\r\n }\r\n Team teamAux = controller.searchTeam((String) cmbOption.getSelectedItem());\r\n return teamAux;\r\n }", "public void ClickOption(WebElement e) {\n\t\te.click();\n\n\t}", "private void selectProposal(int index) {\n\t\tAssert.isTrue(index >= 0, \"Proposal index should never be negative\"); //$NON-NLS-1$\n\t\tif (!isValid() || proposalList == null || index >= getTableLength()) {\n\t\t\treturn;\n\t\t}\n\t\tproposalTable.setSelection(index);\n\t\tproposalTable.showSelection();\n\n\t\tshowProposalDescription();\n\t}", "@Override\n public void select(TaskView selectedCard) {\n if(selectedTask != null) {\n selectedTask.deselectCard();\n }\n selectedTask = selectedCard;\n selectedTask.selectCard();\n }", "private void handleSearchButtonSelected() {\n\t\tShell shell = getShell();\n\t\tIProject project = getProject(editorLocal.getProjectName());\n\t\tIJavaProject javaProject = JavaCore.create(project);\n\t\tIType[] types = new IType[0];\n\t\tboolean[] radioSetting = new boolean[2];\n\t\ttry {\n\t\t\t// fix for Eclipse bug 66922 Wrong radio behaviour when switching\n\t\t\t// remember the selected radio button\n\t\t\tradioSetting[0] = mTestRadioButton.getSelection();\n\t\t\tradioSetting[1] = mTestContainerRadioButton.getSelection();\n\t\t\ttypes = TestSearchEngine.findTests(getLaunchConfigurationDialog(), javaProject, getTestKind());\n\t\t} catch (InterruptedException e) {\n\t\t\tsetErrorMessage(e.getMessage());\n\t\t\treturn;\n\t\t} catch (InvocationTargetException e) {\n\t\t\tLOG.error(\"Error finding test types\", e);\n\t\t\treturn;\n\t\t} finally {\n\t\t\tmTestRadioButton.setSelection(radioSetting[0]);\n\t\t\tmTestContainerRadioButton.setSelection(radioSetting[1]);\n\t\t}\n\t\tSelectionDialog dialog = new TestSelectionDialog(shell, types);\n\t\tdialog.setTitle(JUnitMessages.JUnitLaunchConfigurationTab_testdialog_title);\n\t\tdialog.setMessage(JUnitMessages.JUnitLaunchConfigurationTab_testdialog_message);\n\t\tif (dialog.open() == Window.CANCEL) {\n\t\t\treturn;\n\t\t}\n\t\tObject[] results = dialog.getResult();\n\t\tif ((results == null) || (results.length < 1)) {\n\t\t\treturn;\n\t\t}\n\t\tIType type = (IType) results[0];\n\t\tif (type != null) {\n\t\t\tmTestText.setText(type.getFullyQualifiedName('.'));\n\t\t}\n\t}", "public boolean isSelected() \n {\n return selected;\n }", "@Override\n public void companySelectedAsWorkspace(int position) {\n selectedWorkspace = companies.get(position);\n }", "private void select() {\n\t\tif (selected.equals(mealSelect) && !eating) {\n\t\t\tmakeMeal();\n\t\t} else if (selected.equals(snackSelect) && !eating) {\n\t\t\tmakeSnack();\n\t\t} else if (selected.equals(medicineSelect) && !eating){\n\t\t\tmakeMedicine();\n\t\t} else if (selected.equals(playSelect) && !eating){\n\t\t\tmakePlay();\n\t\t}\n\t\t\n\t}", "public void setAD_Workflow_ID (int AD_Workflow_ID);", "public void selectSlot() {\n\t\t\r\n\t}", "public void setSelectedImpact(Operation selectedImpact) {\r\n\t\t_selectedImpact = selectedImpact;\r\n\r\n\t\trefreshImpactSelectDependentFields();\r\n\t}", "public void setSelected(String optText){\n\t\toptGroup.setSelected(optText);\n\t\tsetText(optGroup.selectedText());\n\t}", "@Step(\"Select {language} language from the list\")\n public void selectLanguage(String language) {\n Select select = new Select(languageSelect);\n select.selectByVisibleText(language);\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tClickOption();\n\t\t\t\t\n\t\t\t}", "public void selectAction(){\r\n\t\t\r\n\t\t//Switch on the action to be taken i.e referral made by health care professional\r\n\t\tswitch(this.referredTo){\r\n\t\tcase DECEASED:\r\n\t\t\tisDeceased();\r\n\t\t\tbreak;\r\n\t\tcase GP:\r\n\t\t\treferToGP();\r\n\t\t\tbreak;\r\n\t\tcase OUTPATIENT:\r\n\t\t\tsendToOutpatients();\r\n\t\t\tbreak;\r\n\t\tcase SOCIALSERVICES:\r\n\t\t\treferToSocialServices();\r\n\t\t\tbreak;\r\n\t\tcase SPECIALIST:\r\n\t\t\treferToSpecialist();\r\n\t\t\tbreak;\r\n\t\tcase WARD:\r\n\t\t\tsendToWard();\r\n\t\t\tbreak;\r\n\t\tcase DISCHARGED:\r\n\t\t\tdischarge();\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t\r\n\t\t}//end switch\r\n\t}", "public void setSelected(boolean selected) {\r\n\t\tthis.selected = selected;\r\n\t}", "@Override\r\n public void handle(ActionEvent event) {\n InnerPaneCreator.getChildTabPanes()[2].getSelectionModel().select(1);\r\n }", "public void setSelected(boolean selected)\n\t{\n\t\tthis.selected = selected;\n\t}" ]
[ "0.58419675", "0.5828239", "0.5735003", "0.57248336", "0.5722333", "0.56942517", "0.56331456", "0.56213397", "0.5602491", "0.5523965", "0.54948694", "0.5468157", "0.54679555", "0.5458593", "0.5456465", "0.54538465", "0.5411228", "0.54063976", "0.5401926", "0.5384144", "0.53594244", "0.5352763", "0.53505474", "0.5335726", "0.53188485", "0.53047067", "0.5286179", "0.5281827", "0.52814424", "0.52766526", "0.5275478", "0.52745736", "0.52681214", "0.52536374", "0.5249615", "0.5241895", "0.52376294", "0.5237263", "0.52250355", "0.52195877", "0.52099895", "0.52011997", "0.5199019", "0.51966643", "0.5194987", "0.5183792", "0.5183058", "0.5183058", "0.5181886", "0.51653314", "0.5159167", "0.51582074", "0.5153841", "0.514688", "0.5141725", "0.51356643", "0.51314354", "0.5130064", "0.51290685", "0.51275635", "0.51254815", "0.5106684", "0.5104582", "0.51028055", "0.50838023", "0.5080747", "0.5080566", "0.5068987", "0.50684667", "0.50633866", "0.50615245", "0.5060672", "0.5052329", "0.504504", "0.5043155", "0.50398105", "0.5037175", "0.503662", "0.5029025", "0.50285006", "0.50261146", "0.5025181", "0.5021248", "0.5017906", "0.501002", "0.5001375", "0.49988785", "0.4995947", "0.49953923", "0.49943474", "0.49930042", "0.49918717", "0.49820957", "0.49815702", "0.4980732", "0.49803165", "0.49762684", "0.49755505", "0.4974517", "0.49741662", "0.49617162" ]
0.0
-1
Spy framework's main frame.
@Override public void build(final Component root, final Component currentComponent) { frame = new JFrame(ctx.getString(TITLE.getStr())); frame.getContentPane().setBackground(Color.decode(ctx.getString(BG_COLOR.getStr()))); frame.setPreferredSize(new Dimension(ctx.getInt(WIDTH.getStr()), ctx.getInt(HEIGHT.getStr()))); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // Spy framework's status bar. statusBar = new SpyStatusBar(ctx); frame.getContentPane().add(statusBar.getStatusBarPanel(), BorderLayout.SOUTH); // Spy framework's menu. SpyMenu spyMenu = new SpyMenu(statusBar); frame.setJMenuBar(spyMenu.getMenuBar()); // Spy framework's toolbar. SpyToolBar toolBar = new SpyToolBar(statusBar); frame.getContentPane().add(toolBar.getToolBar(), BorderLayout.NORTH); // Spy framework's tree panel. SpyTreePanel treePanel = new SpyTreePanel(); frame.getContentPane().add(treePanel.getTreePanel(), BorderLayout.WEST); // Spy framework's properties panel. SpyPropertiesPanel propertiesPanel = new SpyPropertiesPanel(); frame.getContentPane().add(propertiesPanel.getPropertiesPanel(), BorderLayout.CENTER); JPanel fut = new JPanel(); fut.setBackground(Color.decode("#CCE0FF")); frame.getContentPane().add(fut, BorderLayout.EAST); // Spy framework's settings for display. frame.setExtendedState(java.awt.Frame.MAXIMIZED_BOTH); frame.pack(); frame.setVisible(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public launchFrame() {\n \n initComponents();\n \n }", "@Test\n\n\tpublic void testCallMain() {\n\n\t\tDABPanel.main(new String[0]);\n\n\t\tSwingUtilities.invokeLater(() -> {\n\n\t\t\tfor (Frame frame : Frame.getFrames()) {\n\n\t\t\t\tframe.dispose();\n\n\t\t\t}\n\n\t\t});\n\n\t}", "public FrameManageTests() {\n initComponents();\n }", "public RunFrame(MainFrame mainFrame) {\n\tthis.mainFrame = mainFrame;\n\tmainFrame.addScriptEventListener(scrEvtLis);\n\tsetAlwaysOnTop(true);\n setFocusable(false);\n setLocationByPlatform(true);\n\tsetLayout(new GridBagLayout());\n\tsetUndecorated(true);\n\tsetTitle(\"JUltima Toolbar\");\n\n\taddMouseListener(this);\n\taddMouseMotionListener(this);\n }", "public void setApplicationFrame(ApplicationFrame mainFrame) { }", "@Test\n public void testSubFrames() {\n openSubFrames();\n }", "@Before\n\tpublic void setUp() {\n\t\tgui = GuiActionRunner.execute(new GuiQuery<MainWindow>() {\n\t\t\t@Override\n\t\t\tprotected MainWindow executeInEDT() throws Throwable {\n\t\t\t\treturn new MainWindow(GUI_WIDTH, GUI_HEIGHT, false);\n\t\t\t}\n\t\t});\n\t\twindow = new FrameFixture(gui);\n\t\twindow.show();\n\t}", "void frameSetUp() {\r\n\t\tJFrame testFrame = new JFrame();\r\n\t\ttestFrame.setSize(700, 400);\r\n\t\ttestFrame.setResizable(false);\r\n\t\ttestFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\ttestFrame.setLayout(new GridLayout(0, 2));\r\n\t\tmainFrame = testFrame;\r\n\t}", "private void switchToFrame() {\n\t\tdriver.switchTo().frame(\"mainpanel\");\n\t}", "public MainFrame() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "public static void changeFrame() {\r\n\t\t\r\n\t}", "public OSPFrame getMainFrame();", "public MainFrame5(){\r\n inint();\r\n }", "@Test\n\tpublic void testGetFrame() {\n\t}", "public static void main(String[] args) {\n \n MyFrame myFrame = new MyFrame();\n \n }", "public static void main( String args[] )\n\t{\n\t\tmainFrame = getInstance();\n\t\tmainFrame.setVisible( true );\n\t\t\n\t}", "public void factoryMainScreen()\n\t{\n\t\t\n\t}", "@Test\n\tpublic void setFrameTest() throws Exception {\n\t\tif (Configuration.shufflerepeat &&\n\t\tConfiguration.featureamp&&\n\t\tConfiguration.playengine&&\n\t\tConfiguration.choosefile&&\n\t\tConfiguration.gui&&\n\t\tConfiguration.skins&&\n\t\tConfiguration.light&&\n\t\tConfiguration.filesupport&&\n\t\tConfiguration.showtime&&\n\t\tConfiguration.volumecontrol&&\n\t\tConfiguration.mp3 &&\n\t\tConfiguration.queuetrack) {\n\t\t\tstart();\n\t\t\tgui.setFrame();\n\t\t\tJFrame g = (JFrame) MemberModifier.field(Application.class, \"frmAsd\").get(gui);\n\t\t\tassertTrue(g.getBounds().getX() == 100);\n\t\t\tassertTrue(g.getBounds().getY() == 100);\n\t\t\tassertTrue(g.getBounds().getWidth() == 1207);\n\t\t\tassertTrue(g.getBounds().getHeight() == 511);\n\t\t\tassertTrue(g.getDefaultCloseOperation() == JFrame.EXIT_ON_CLOSE);\n\t\t\tassertTrue(g.getContentPane().getLayout() == null);\n\t\t\tassertTrue(g.getContentPane() != null);\n\t\t}\n\n\t}", "public void main(String[] args) {\n // TODO code application logic here\n MF= new MainFrame();\n }", "public static void setMainFrame(final Frame frame) {\n\n m_MainFrame = frame;\n\n }", "public static void main(String[] args) {\n new MainFrameClass();\n\n }", "public mainframe() {\n initComponents();\n }", "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 FirstNewFrame() {\n\t\tjbInit();\n\t}", "void setupFrame()\n {\n int wd = shopFrame.getWidth();\n sellItemF(wd);\n\n requestItemF(wd);\n setAllVisFalse();\n }", "private void setFrame() {\r\n this.getContentPane().setLayout(null);\r\n this.addWindowListener(new WindowAdapter() {\r\n public void windowClosing(WindowEvent evt) {\r\n close();\r\n }\r\n });\r\n MainClass.frameTool.startup(this, FORM_TITLE, FORM_WIDTH, FORM_HEIGHT, \r\n false, true, false, false, FORM_BACKGROUND_COLOR,\r\n SNAKE_ICON);\r\n }", "public MainFrame() {\n initComponents();\n \n }", "@Test\n\tpublic void setFrame_PTest() throws Exception {\n\t\t\n\t\tif (Configuration.featureamp &&\n\t\t\t\tConfiguration.playengine &&\n\t\t\t\tConfiguration.choosefile &&\n\t\t\t\tConfiguration.gui &&\n\t\t\t\tConfiguration.skins &&\n\t\t\t\t!Configuration.queuetrack ) {\n\t\t\t\n\t\t\t\n\t\t\tstart();\n\t\t\tgui.setFrame();\n\t\t\n\t\t\tJFrame g = (JFrame) MemberModifier.field(Application.class, \"frmAsd\").get(gui);\n\t\t\t\n\t\t\tassertTrue(g.getBounds().getX() == 100);\n\t\t\tassertTrue(g.getBounds().getY() == 100);\n\t\t\tassertTrue(g.getBounds().getWidth() == 807);\n\t\t\tassertTrue(g.getBounds().getHeight() == 511);\n\t\t\tassertTrue(g.getDefaultCloseOperation() == JFrame.EXIT_ON_CLOSE);\n\t\t\tassertTrue(g.getContentPane().getLayout() == null);\n\t\t\tassertTrue(g.getContentPane() != null);\n\t\t}\n\t}", "public JFrameMain() {\n initComponents();\n \n }", "public MainFrame() {\n initComponents();\n\n mAlmondUI.addWindowWatcher(this);\n mAlmondUI.initoptions();\n\n initActions();\n init();\n\n if (IS_MAC) {\n initMac();\n }\n\n initMenus();\n mActionManager.setEnabledDocumentActions(false);\n }", "public static void main(String[] args){\r\n Panel panel = new Panel();\r\n Frame frame = new Frame();\r\n frame.setFrame(panel, \"Practica LDH\");\r\n }", "public static void main(String[] bb)\n\t{\n\t\tnew Frame1().setVisible(true);\n\t}", "public void switchToMainFrame(WebDriver driver) {\r\n\t\tdriver.switchTo().defaultContent();\r\n\t\tdriver.switchTo().frame(\"gsft_main\"); // edge_center\r\n\r\n\t}", "private FrameUIController(){\r\n\t\t\r\n\t}", "public void launch() {\n m_frame.pack();\n m_frame.setVisible(true);\n }", "public void run()\r\n\t{\r\n\t\tthis.mainFrame.setVisible(true);\r\n\t}", "public MainFrame() {\n initComponents();\n setLocationRelativeTo(null);\n }", "void setMainFrame(NewMainFrame mainFrame) {\n this.mainFrame = mainFrame;\n }", "public static void main(String[] args) {\n\t MainFrame app=new MainFrame();\n\t\t\n\t\t//autoClose();\n\t}", "public MainFrameController() {\n }", "public void refreshFrame() {\n switchWindow();\n this.switchToFrame(\"botFr\");\n }", "public Mainframe() {\n initComponents();\n }", "public JFrameMain() {\n initComponents();\n }", "public testDatabaseFrame getAppFrame()\n\t{\n\t\treturn appFrame;\n\t}", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n }", "public JFrame sprout()\n {\n return super.sprout();\n }", "public static void main(String[] args) {\n\t\t\tMyFrame f = new MyFrame();\n\t}", "public static void main(String[] args) {\n Frame testFrame = new MyGUIProgram();\n testFrame.setVisible(true);\n \n }", "private void initVars() {\r\n\t\tapplicationFrame = new JFrame(BPCC_Util.getApplicationTitle());\r\n\t\tBPCC_Util.setHubFrame(applicationFrame);\r\n\t}", "private void setupFrame()\n\t\t{\n\t\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\tthis.setResizable(false);\n\t\t\tthis.setSize(800, 600);\n\t\t\tthis.setTitle(\"SEKA Client\");\n\t\t\tthis.setContentPane(panel);\n\t\t\tthis.setVisible(true);\n\t\t}", "public static void main(String[] args) {\n\t\tAppFrame mf = new AppFrame();\n\t}", "public JFrameApp() {\n initComponents();\n }", "public static void main(String[] args) {\n\t\tFrame window= new Frame(); \n\t}", "@Override protected void startup() {\n BlaiseGraphicsTestFrameView view = new BlaiseGraphicsTestFrameView(this);\n canvas1 = view.canvas1;\n root1 = view.canvas1.getGraphicRoot();\n canvas1.setSelectionEnabled(true);\n show(view);\n }", "public SearchFrame(){//The main search frame which calls other methods\n\t\t/*Calling the methods intitialiseGUI and buildGUI*/\n\t\tintitialiseGUI();\n\t\tbuildGUI();\n\t}", "void open(VirtualFrame frame);", "@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n RefSystemGUI.main(args);\n }", "public static JinFrame getMainFrame(){\r\n return mainFrame;\r\n }", "public static void main(String[] args) {\n\t\tMyFrame myframe=new MyFrame();\n\t}", "private void show() {\n mainFrame.setVisible(true);\r\n\t}", "public static void main(String[] args) {\n \n Frame2 frame=new Frame2();\n \n \n }", "public void createAndShowGUI(JFrame frame) {\n providerSideBar(frame.getContentPane(), pat);\n topBarPatientInformation(frame.getContentPane(), pat);\n patientReferralPanel(frame.getContentPane());\n\n }", "@Test\n public void testFramesOpen() {\n SmallFrameSet set = openSubFrames();\n\n DriverRequest driverRequest = sendCommand(\"selectFrame\", \"subFrame1\", \"\");\n set.topFrame.expectCommand(\"getWhetherThisFrameMatchFrameExpression\", \"top\", \"subFrame1\");\n set.topFrame.sendResult(\"OK,false\");\n set.subFrame0.expectCommand(\"getWhetherThisFrameMatchFrameExpression\", \"top\", \"subFrame1\");\n set.subFrame0.sendResult(\"OK,false\");\n set.subFrame1.expectCommand(\"getWhetherThisFrameMatchFrameExpression\", \"top\", \"subFrame1\");\n set.subFrame1.sendResult(\"OK,true\");\n driverRequest.expectResult(\"OK\");\n\n driverRequest = sendCommand(\"open\", \"blah.html\", \"\");\n set.subFrame1.expectCommand(\"open\", \"blah.html\", \"\");\n set.subFrame1.sendResult(\"OK\");\n set.subFrame1.sendClose();\n\n MockPIFrame newSubFrame1 =\n new MockPIFrame(DRIVER_URL, sessionId, \"newSubFrame1\", \"top.frames[1]\", \"\");\n newSubFrame1.seleniumStart();\n\n newSubFrame1.expectCommand(\"getTitle\", \"\", \"\");\n newSubFrame1.sendResult(\"OK,blah.html\");\n driverRequest.expectResult(\"OK\");\n }", "public static void main (String args[]){\r\n\t\tCalculator s = new Calculator();\r\n\t\ts.launchFrame();\r\n\t}", "private void closeFrame()\n\t{\n\t\tSystem.exit(0);\n\t}", "public void buildFrame();", "@Before\n\tpublic void setUpTestFrames() {\n\t\ttestXOffset = 0;\n\t\tinitializeRemoteBrowser( System.getProperty(\"browserType\"), System.getProperty(\"hubUrl\") ,\n Integer.parseInt( System.getProperty(\"hubPort\") ) );\n\t\tSystem.out.println(\"TestFrames thread id = \" + Thread.currentThread().getId());\n\t\tclasslogger.info(\"Finished setUpTestFrames\");\n\t}", "public static void run(){\n EventQueue.invokeLater(new Runnable() {\n public void run() {\n try {\n PlanHomeCoach frame = new PlanHomeCoach();\n frame.init();\n Dimension screenSize =Toolkit.getDefaultToolkit().getScreenSize();\n frame.setLocation(screenSize.width/2-400/2,screenSize.height/2-700/2);\n frame.setResizable(false);\n frame.setVisible(true);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n });\n }", "public void onFrame(Controller controller) {\n\r\n\t}", "public static void main(String[] args){\n\t\t@SuppressWarnings(\"unused\")\r\n\t\tMainFrame mainFrame = new MainFrame();\r\n\t}", "@Test\n\tpublic void test1_addFrames() throws GeneralLeanFtException{\n\t\ttry\n\t\t{\t\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Test 1 - Check Add Frames Started\");\n\t\t\t\n\t\t\t//App should exist \n\t\t\tassertTrue(mySet.appExistsorNot());\t\t\n\t\t\tWindow mainWindow = Desktop.describe(Window.class, new WindowDescription.Builder()\n\t\t\t.title(\"SwingSet2\").index(0).build());\n\n\t\t\t//Find all Internal Frames having native class as JInternalFrame \n\t\t\tInternalFrame[] children = mainWindow.findChildren(InternalFrame.class, new InternalFrameDescription.Builder()\n\t\t\t.nativeClass(\"javax.swing.JInternalFrame\").build());\n\t\t\t\n\t\t\tint originalLength = children.length;\n\t\t\t\n\t\t\t//Assert that array should have some values\n\t\t\tassertTrue(\"No. of Frames Found = \" + originalLength,originalLength>0);\n\t\t\t\n\t\t\t//Highlight each Frame\n\t\t\tfor(InternalFrame child : children)\n\t\t\t{\n\t\t\t\tchild.highlight();\n\t\t\t}\n\t\t\t\n\t\t\t//Add a new Frame with Frame Generator\n\t\t\tmainWindow.describe(InternalFrame.class, new InternalFrameDescription.Builder()\n\t\t\t.title(\"Internal Frame Generator\").nativeClass(\"javax.swing.JInternalFrame\").index(0).build())\n\t\t\t.describe(Button.class, new ButtonDescription.Builder()\n\t\t\t.label(\"moon_small\").build()).click();\n\t\t\t\n\t\t\t//Get Child count again\n\t\t\tchildren = mainWindow.findChildren(InternalFrame.class, new InternalFrameDescription.Builder()\n\t\t\t.nativeClass(\"javax.swing.JInternalFrame\").build());\n\t\t\t\n\t\t\tint newLength = children.length;\n\t\t\t\n\t\t\t//Verify that count increased by 1\n\t\t\tassertEquals(newLength,originalLength+1);\n\t\t\t\n\t\t\tInternalFrame newFrame = mainWindow.describe(InternalFrame.class, new InternalFrameDescription.Builder()\n\t\t\t.nativeClass(\"javax.swing.JInternalFrame\").title(\"Frame \" + (newLength-2) + \" \").build());\n\t\t\t\n\t\t\t//Verify that new Frame is Maximizable\n\t\t\tassertTrue(newFrame.isMaximizable());\n\t\t\t\n\t\t\t//Verify that new Frame is Resizable\n\t\t\tassertTrue(newFrame.isResizable());\n\t\t\t\n\t\t\t//Uncheck the Maximizable checkbox\n\t\t\tmainWindow.describe(InternalFrame.class, new InternalFrameDescription.Builder()\n\t\t\t.title(\"Internal Frame Generator\").index(0).build()).describe(CheckBox.class, new CheckBoxDescription.Builder()\n\t\t\t.attachedText(\"Maximizable\").build()).click();\n\t\t\t\n\n\t\t\t//Uncheck the Resizable checkbox\n\t\t\tmainWindow.describe(InternalFrame.class, new InternalFrameDescription.Builder()\n\t\t\t.title(\"Internal Frame Generator\").index(0).build()).describe(CheckBox.class, new CheckBoxDescription.Builder()\n\t\t\t.attachedText(\"Resizable\").build()).click();\n\t\t\t\n\t\t\t//Add a new Frame with Frame Generator\n\t\t\tmainWindow.describe(InternalFrame.class, new InternalFrameDescription.Builder()\n\t\t\t.title(\"Internal Frame Generator\").nativeClass(\"javax.swing.JInternalFrame\").index(0).build())\n\t\t\t.describe(Button.class, new ButtonDescription.Builder()\n\t\t\t.label(\"moon_small\").build()).click();\n\t\t\t\n\t\t\t//Get Child count again\n\t\t\tchildren = mainWindow.findChildren(InternalFrame.class, new InternalFrameDescription.Builder()\n\t\t\t.nativeClass(\"javax.swing.JInternalFrame\").build());\n\t\t\t\n\t\t\tint newerLength = children.length;\n\t\t\t\t\t\t\n\t\t\t//Verify that count increased by 1\n\t\t\tassertEquals(newerLength,newLength+1);\n\t\t\t\n\t\t\tInternalFrame newerFrame = mainWindow.describe(InternalFrame.class, new InternalFrameDescription.Builder()\n\t\t\t.nativeClass(\"javax.swing.JInternalFrame\").title(\"Frame \" + (newerLength-2) + \" \").build());\n\t\t\t\n\t\t\t\n\t\t\t//Verify that new Frame is not Maximizable\n\t\t\tassertFalse(newerFrame.isMaximizable());\n\t\t\t\n\t\t\t//Verify that new Frame is not Resizable\n\t\t\tassertFalse(newerFrame.isResizable());\n\t\t\t\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Unexpected Error Occurred. Message = \" + e.getMessage());\n\t\t\tassertTrue(false);\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tSystem.out.println(\"Test 1 - Check Add Frames Finished\");\n\t\t}\n\t\t\n\t}", "private void prepareFrame() {\n logger.debug(\"prepareFrame : enter\");\n\n // initialize the actions :\n registerActions();\n final Container container;\n\n if (Bootstrapper.isHeadless()) {\n container = null;\n } else {\n final JFrame frame = new JFrame(ApplicationDescription.getInstance().getProgramName());\n\n // handle frame icon\n final Image jmmcFavImage = ResourceImage.JMMC_FAVICON.icon().getImage();\n frame.setIconImage(jmmcFavImage);\n\n // get screen size to adjust minimum window size :\n final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n logger.info(\"screen size = {} x {}\", screenSize.getWidth(), screenSize.getHeight());\n // hack for screens smaller than 1024x768 screens:\n final int appWidth = 950;\n final int appHeightMin = (screenSize.getHeight() >= 850) ? 800 : 700;\n\n final Dimension dim = new Dimension(appWidth, appHeightMin);\n frame.setMinimumSize(dim);\n frame.addComponentListener(new ComponentResizeAdapter(dim));\n frame.setPreferredSize(INITIAL_DIMENSION);\n\n App.setFrame(frame);\n\n container = frame.getContentPane();\n }\n // init the main panel:\n createContent(container);\n\n StatusBar.show(\"application started.\");\n\n logger.debug(\"prepareFrame : exit\");\n }", "public void launchFrame() {\n\t\tf.getContentPane().add(sbrText);\n\t\tf.getContentPane().add(btnQuit);\n\n\t\t// Close when the close button is clicked\n\t\tf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\t// Display Frame\n\t\tf.pack(); // Adjusts frame to size of components\n\t\tf.setVisible(true);\n\t}", "public interface MainFrame {\r\n\r\n /**\r\n * Gets the main OSPFrame. The main frame will usually exit program when it is closed.\r\n * @return OSPFrame\r\n */\r\n public OSPFrame getMainFrame();\r\n \r\n /**\r\n * Gets the OSP Application that is controlled by this frame.\r\n * @return\r\n */\r\n public OSPApplication getOSPApp();\r\n\r\n /**\r\n * Adds a child frame that depends on the main frame.\r\n * Child frames are closed when this frame is closed.\r\n *\r\n * @param frame JFrame\r\n */\r\n public void addChildFrame(JFrame frame);\r\n\r\n /**\r\n * Clears the child frames from the main frame.\r\n */\r\n public void clearChildFrames();\r\n\r\n /**\r\n * Gets a copy of the ChildFrames collection.\r\n * @return Collection\r\n */\r\n public Collection getChildFrames();\r\n\r\n\r\n}", "private void setupFrame()\n\t{\n\t\tthis.setContentPane(botPanel);\n\t\tthis.setSize(800,700);\n\t\tthis.setTitle(\"- Chatbot v.2.1 -\");\n\t\tthis.setResizable(true);\n\t\tthis.setVisible(true);\n\t}", "public StartProgramFrame() {\n initComponents();\n }", "public static void main(String[] args) {\n\r\n\t\t\r\n\tWebDriver driver=launchBrowser(\"http://www.seleniumframework.com/Practiceform/\");\r\n\tdriver.findElement(By.id(\"alert\")).click();\r\n\t\r\n\tAlert alert=driver.switchTo().alert();\r\n\tString alertText=alert.getText();\r\n\tSystem.out.println(alertText);\r\n\talert.accept();\r\n\t\r\n\tdriver.findElement(By.name(\"name\")).sendKeys(\"Selenium\");\r\n\t\r\n\tdriver.switchTo().frame(0);\r\n\t//adfasdfasdf\r\n\tdriver.switchTo().defaultContent();\r\n\t\r\n\t\r\n\t\r\n\t}", "protected HFrame(){\n\t\tinit();\n\t}", "private static void createAndShowGUI()\r\n {\r\n JFrame frame = new JFrame(\"ChangingTitleFrame Application\");\r\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n frame.getContentPane().add(new FramePanel(frame).getPanel());\r\n frame.pack();\r\n frame.setLocationRelativeTo(null);\r\n frame.setVisible(true);\r\n }", "public TestFrames() {\n\t\tclasslogger.info(\"Called constructor for TestFrames...\");\n\t}", "void gotoMain();", "public WhereIsAppCreator(JFrame frame) {\n this.frame = frame;\n initComponents();\n }", "public static Frame getMainFrame() {\n\n return m_MainFrame;\n\n }", "public void run()\n {\n m_frame = new DrawingFrame();\n \n m_frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);\n m_frame.addWindowListener(new WindowAdapter() {\n public void windowClosing(WindowEvent evt)\n {\n try\n {\n m_context.getBundle(0).stop();\n }\n catch (BundleException ex)\n {\n ex.printStackTrace();\n }\n }\n });\n \n m_frame.setVisible(true);\n \n m_shapetracker = new ShapeTracker(m_context, m_frame);\n m_shapetracker.open();\n }", "public MainFrame() {\n initComponents();\n\n\n }", "public MainFrame() {\n\t\tsuper(\"Contry Detail\");\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tsetPreferredSize(new Dimension(450, 300));\n\t\tsetResizable(false);\n\t\t\n\t\tinitComponents();\n\t\t\n\t\tcontroller = new Service(this);\n\t}", "@Override\n public void run() {\n Frame parentFrame = getParentFrame(IFrameSource.FULL_CONTEXT);\n if (parentFrame != null) {\n getFrameList().gotoFrame(parentFrame);\n }\n }", "public static void main(String[] args) {\n new GameJFrame();\n // new DigitalWatch();\n }", "public static void main(String[] args) {\n\t\tSwingUtilities.invokeLater(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tFrame app = new Frame(\"Santa on Christmas Eve\"); \n\t\t\t}\n\t\t}\n\t\t);\n\t}" ]
[ "0.6664409", "0.6571429", "0.65374845", "0.6493795", "0.648736", "0.64291024", "0.64279526", "0.6378004", "0.6376791", "0.635743", "0.63502234", "0.63449544", "0.6337825", "0.6335407", "0.6270044", "0.6267727", "0.62099534", "0.6178901", "0.61410606", "0.6139058", "0.61011857", "0.60702246", "0.6066646", "0.60582125", "0.6054163", "0.6052175", "0.6050408", "0.60359615", "0.60257196", "0.6013831", "0.6012114", "0.6011239", "0.6004051", "0.5999975", "0.59982485", "0.5987094", "0.59863937", "0.59855825", "0.5973058", "0.595791", "0.5955892", "0.5944266", "0.5941847", "0.59378654", "0.5934291", "0.5934291", "0.5934291", "0.5934291", "0.5934291", "0.5934291", "0.5934291", "0.5934291", "0.5934291", "0.5934291", "0.5934291", "0.5934291", "0.59340346", "0.5931486", "0.5922972", "0.5909192", "0.58888996", "0.58887047", "0.58850074", "0.5875629", "0.5875367", "0.5859543", "0.585951", "0.5857064", "0.5848795", "0.5844253", "0.5839545", "0.5832761", "0.58327544", "0.58270055", "0.58253485", "0.58228004", "0.58182204", "0.5812309", "0.58015305", "0.5789816", "0.5777729", "0.577323", "0.57727367", "0.5764588", "0.57629985", "0.57585216", "0.5752455", "0.5750521", "0.5747304", "0.5746081", "0.5743267", "0.5741683", "0.57356876", "0.5727545", "0.57274276", "0.57186055", "0.57118446", "0.5710693", "0.56970036", "0.5695234" ]
0.5993371
35
TODO Autogenerated method stub
public static void main(String[] args) throws IOException { FileManager csv=new FileManager(); csv.readListOfFiles(); csv.readFile(); //csv.tk.displayTokens(); //csv.it.displayHashMap(); csv.writeTokensToFile(csv.tk.tokensMap); csv.matcher.longestSequence(csv.it); //csv.it.intTokenList was supposed to be passed but since I need csv.it object in caller so im passing it csv.matcher.displaySubsequences(csv.it); csv.writeMatchesToFile(csv.matcher.resultMap,csv.it); System.out.println("\nProgram Ends "); }
{ "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
For all ajax call in meter replacement screen
public String ajaxMethod() { AppLog.begin(); try { Map<String, Object> session = ActionContext.getContext() .getSession(); String userId = (String) session.get("userId"); if (null == userId || "".equals(userId)) { addActionError(getText("error.login.expired")); inputStream = new StringBufferInputStream("ERROR:" + getText("error.login.expired") + ", Please re login and try Again!"); AppLog.end(); return "login"; } if ("populateMRNo".equalsIgnoreCase(hidAction)) { Map<String, String> returnMap = (HashMap<String, String>) GetterDAO .getMRNoListMap(selectedZone); StringBuffer dropDownSB = new StringBuffer(512); dropDownSB .append("<select name=\"selectedMRNo\" id=\"selectedMRNo\" class=\"selectbox\" onfocus=\"fnCheckZone();\" onchange=\"fnGetArea();\">"); dropDownSB.append("<option value=''>Please Select</option>"); if (null != returnMap && !returnMap.isEmpty()) { for (Entry<String, String> entry : returnMap.entrySet()) { dropDownSB.append(optionTagBeginPart1); dropDownSB.append(entry.getKey()); dropDownSB.append(optionTagBeginPart2); dropDownSB.append(entry.getValue()); dropDownSB.append(optionTagEnd); } } dropDownSB.append(selectTagEnd); session.put("MRNoListMap", returnMap); inputStream = new StringBufferInputStream(dropDownSB.toString()); } if ("populateArea".equalsIgnoreCase(hidAction)) { Map<String, String> returnMap = (HashMap<String, String>) GetterDAO .getAreaListMap(selectedZone, selectedMRNo); StringBuffer dropDownSB = new StringBuffer(512); dropDownSB .append("<select name=\"selectedArea\" id=\"selectedArea\" class=\"selectbox-long\" onfocus=\"fnCheckZoneMRNo();\" >"); dropDownSB.append("<option value=''>Please Select</option>"); if (null != returnMap && !returnMap.isEmpty()) { for (Entry<String, String> entry : returnMap.entrySet()) { dropDownSB.append(optionTagBeginPart1); dropDownSB.append(entry.getKey()); dropDownSB.append(optionTagBeginPart2); dropDownSB.append(entry.getValue()); dropDownSB.append(optionTagEnd); } } dropDownSB.append(selectTagEnd); session.put("AreaListMap", returnMap); inputStream = new StringBufferInputStream(dropDownSB.toString()); } /** * @Added by Madhuri as per Jtrac -Djb:- 4464 & Open Project id 1203 to match mrkey tagged with AMR user & The mrkey selected by User for new job submit * @return * @author 735689 * @since 03-06-2016 */ if ("validateMrkey".equalsIgnoreCase(hidAction)) { Map<String, String> mrkyFromSession = (Map<String, String>) session.get("taggedMrkey"); String validMrkey = MRDScheduleDownloadDAO.getMrdCode( selectedZone, selectedMRNo, selectedArea); AppLog.info("Mrkeys Tagged to Logged In users is/Are" +mrkyFromSession.size()); try { if(null != validMrkey && null != mrkyFromSession && mrkyFromSession.containsValue(validMrkey)){ inputStream = new StringBufferInputStream("validMrkey"); } else{ inputStream = new StringBufferInputStream("ERROR:You do not have security rights for this action. Please select the input fields correctly."); } } catch(Exception e){ inputStream = new StringBufferInputStream("ERROR:"); AppLog.error(e); } /*@Ended by Madhuri as per Jtrac -Djb:- 4464 & Open Project id 1203 to match mrkey tagged with AMR user & The mrkey selected by User for new job submit */ } response.setHeader("Expires", "0"); response.setHeader("Pragma", "cache"); response.setHeader("Cache-Control", "private"); } catch (Exception e) { inputStream = new StringBufferInputStream( "ERROR:There was an error at Server end."); // response.setHeader("Expires", "0"); // response.setHeader("Pragma", "cache"); // response.setHeader("Cache-Control", "private"); AppLog.error(e); } AppLog.end(); return SUCCESS; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void ajaxListener() {\n System.out.println(\"!ttttt \" );\n }", "@Override\n public void onWebBridgeResult(String url, JSONObject json, AjaxStatus ajaxStatus) {\n\n // TODO Auto-generated method stub\n int status = 0;\n String msg = \"\";\n\n try {\n status = json.getInt(\"status\");\n msg\t = json.getString(\"message\");\n } catch (Exception e) {}\n\n if (status == 0) {\n new AlertDialog.Builder(this).setTitle(R.string.txt_error).setMessage(msg).setNeutralButton(R.string.bt_close, null).show();\n } else {\n if (url.contains(\"getStatusMap\")) {\n\n int level = 0, pre = 0, feedback = 0, post = 0, checklist = 0, operation = 0;\n //checklist = 0,\n\n try {\n level = json.getInt(\"map_level_access\");\n pre = json.getInt(\"pre\");\n checklist = json.getInt(\"checklist\");\n feedback = json.getInt(\"feedback\");\n post = json.getInt(\"post\");\n operation = json.getInt(\"operativa\");\n } catch (Exception e) {}\n\n if (pre == 0) {\n Intent intent = new Intent(MapActivity.this, ProfileActivity.class);\n intent.putExtra(\"evaluation\", true);\n startActivityForResult(intent, 1);\n return;\n }\n\n hide();\n\n ImageView path = (ImageView)findViewById(R.id.img_map_path);\n ImageView dflt = (ImageView)findViewById(R.id.img_map_path_default);\n\n int r = getResources().getIdentifier(\"image_map_status_\" + level, \"drawable\", getPackageName());\n path.setImageResource(r);\n\n AlphaAnimation a = new AlphaAnimation(1.0f, 0.0f);\n a.setDuration(300);\n a.setFillAfter(true);\n dflt.startAnimation(a);\n\n fade(rlMap);\n fade(path);\n fade(llMenu);\n\n if (level >= 3) {\n btInfo.setVisibility(View.VISIBLE);\n btLogbook.setVisibility(View.VISIBLE);\n }\n\n if (level >= 5) {\n btEvaluation.setVisibility(View.VISIBLE);\n btFeedback.setVisibility(View.VISIBLE);\n btFemsa.setVisibility(View.VISIBLE);\n btYammer.setVisibility(View.VISIBLE);\n }\n\n if (feedback == 1) {\n btFeedback.setVisibility(View.GONE);\n }\n\n if (post == 1) {\n btEvaluation.setVisibility(View.GONE);\n }\n\n User.set(\"checklist\", checklist == 1 ? \"true\" : \"false\", this);\n User.set(\"operation\", operation == 1 ? \"true\" : \"false\", this);\n\n /*\n if (level > 1 || true) fade(btGame);\n //if (level == 4 || true && checklist == 0) btChecklist.setVisibility(View.VISIBLE);\n if (level == 5 || true) {\n if (feedback == 0) btFeedback.setVisibility(View.VISIBLE);\n else if (post == 0) btEvaluation.setVisibility(View.VISIBLE);\n }\n if (level == 7 || true) btFemsa.setVisibility(View.VISIBLE);\n */\n\n }\n }\n }", "@Override\n public void onServerResponse(Object json) {\n runOnUiThread(() -> {\n loadRaters();\n ((TextView) findViewById(R.id.labelmenos1)).setText(\"Seleccione un evaluador de la lista a continuación\");\n });\n scrollDown();\n }", "@Override\r\n\t\t\tpublic void onRequest() {\n\t\t\t\t\r\n\t\t\t}", "public FunctionRequestAjax() {\r\n\t\tsuper();\r\n\t}", "protected void onBeginRequest()\n\t{\n\t}", "@Override\n protected void onUpdate(AjaxRequestTarget target) {\n }", "@Override\n public void processFinish(int response_code, String response_message, JSONObject output) {\n loading--;\n if (loading == 0) {\n loadingbar.setVisibility(View.GONE);\n } else System.out.println(\"INFO: Open web calls \" + loading);\n\n //Server Response\n response.append(response_code + \" \" + response_message + \"\\r\\n\");\n\n if (response_code == 200 && output != null) {\n trigger = TriggerDetails.fromJson(output);\n\n TextView value_id = getView().findViewById(R.id.value_id);\n value_id.setText(trigger.getId());\n\n TextView value_title = getView().findViewById(R.id.value_title);\n value_title.setText(trigger.getTitle());\n\n Switch active = getView().findViewById(R.id.value_active);\n active.setChecked(trigger.getActive());\n\n Switch current = getView().findViewById(R.id.value_state);\n current.setChecked(trigger.getState());\n\n if (trigger.getType() == 0) {\n\n updateStartDate();\n updateStartTime();\n\n updateEndDate();\n updateEndTime();\n\n Spinner interval = getView().findViewById(R.id.value_interval);\n interval.setSelection(trigger.getInterval());\n } else if (trigger.getType() == 1) {\n Button source = getView().findViewById(R.id.value_rule);\n source.setText(trigger.getSource());\n\n Spinner relop = getView().findViewById(R.id.value_relop);\n relop.setSelection(trigger.getRelop());\n\n TextView threshold = getView().findViewById(R.id.value_threshold);\n threshold.setText(Integer.toString(trigger.getThreshold()));\n\n NegativeProgressSeekerBar tolerance = getView().findViewById(R.id.value_tolerance);\n tolerance.setProgress(25 + trigger.getTolerance());\n\n Spinner interval = getView().findViewById(R.id.value_interval);\n interval.setSelection(trigger.getInterval());\n } else if (trigger.getType() == 2) {\n Spinner relop = getView().findViewById(R.id.value_relop);\n relop.setSelection(trigger.getRelop());\n\n TextView threshold = getView().findViewById(R.id.value_threshold);\n threshold.setText(Integer.toString(trigger.getThreshold()));\n\n TextView counter = getView().findViewById(R.id.value_counter);\n counter.setText(trigger.getCount().toString());\n } else if (trigger.getType() == 3) {\n\n }\n }\n }", "@Override\n public void onPostLook(JSONObject response) {\n stopProgressBar();\n }", "private void loadNotiCount2(){\n\n String url = \"http://\"+ConfigIP.IP+\"/dogcat/get_noti_count.php?pet_id=\" + getPet_id;\n Log.d(\"url\",url);\n\n StringRequest stringRequest = new StringRequest(url, new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n// progressDialog.dismiss();\n showNotiCount2(response);\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n Toast.makeText(getActivity().getApplicationContext(), \"ไม่สามารถดึงข้อมูลได้ โปรดตรวจสอบการเชื่อมต่อ\", Toast.LENGTH_SHORT).show();\n }\n }\n );\n RequestQueue requestQueue = Volley.newRequestQueue(this.getContext().getApplicationContext());\n requestQueue.add(stringRequest);\n }", "@Override\n\tpublic void OnRequest() {\n\t\t\n\t}", "public void findDataFromServer() {\n try {\n JSONObject jsonObjectGetPostParameterEachScreen = null;\n PassParameterbean passParameterbean = null;\n if (pageTokenAvailable) {\n searchbean_post_data.setPageToken(pageToken);\n }\n\n if (TextUtils.isEmpty(baseTextview_searched_item.getText().toString())) {\n\n } else {\n String name = URLEncoder.encode(baseTextview_searched_item.getText().toString(), \"utf-8\");\n searchbean_post_data.setSearchText(name);\n }\n\n\n searchbean_post_data.setIsCommuntiySearchByName(\"1\");\n searchbean_post_data.setUser_id(commonSession.getLoggedUserID());\n requestParametersbean.setSearchbeanPassPostData(searchbean_post_data);\n\n jsonObjectGetPostParameterEachScreen = GetPostParameterEachScreen.getPostParametersAccordingIndex(ScreensEnums.SEARCH_BY_COMMUNITYNAME.getScrenIndex(), requestParametersbean);\n passParameterbean = new PassParameterbean(this, CommunitySearchByNameActivity.this, getApplicationContext(), URLs.SEARCH_BY_COMMUNITYNAME, jsonObjectGetPostParameterEachScreen, ScreensEnums.SEARCH_BY_COMMUNITYNAME.getScrenIndex(), CommunitySearchByNameActivity.class.getClass());\n\n\n /* requestParametersbean.setUserId(commonSession.getLoggedUserID());\n requestParametersbean.setStart_limit(current_start);\n\n jsonObjectGetPostParameterEachScreen = GetPostParameterEachScreen.getPostParametersAccordingIndex(ScreensEnums.FILTER_COMMUNITY.getScrenIndex(), requestParametersbean);\n passParameterbean = new PassParameterbean(this, CommunitySearchByNameActivity.this, getApplicationContext(), URLs.FILTERCOMMUNITY, jsonObjectGetPostParameterEachScreen, ScreensEnums.FILTER_COMMUNITY.getScrenIndex(), CommunitySearchByNameActivity.class.getClass());\n*/\n\n\n passParameterbean.setNoNeedToDisplayLoadingDialog(true);\n new RequestToServer(passParameterbean, retryParameterbean).execute();\n\n\n } catch (Exception e) {\n e.printStackTrace();\n new BaseException(e, false, retryParameterbean);\n }\n }", "private void urlMethods(String URL, final String intUrls) {\n Utils.get(URL, null, new JsonHttpResponseHandler() {\n @Override\n public void onStart() {\n progressDialog.show();\n progressDialog.setMessage(\"Connecting to Server ...\");\n\n }\n\n\n @Override\n public void onSuccess(int statusCode, Header[] headers, JSONArray timeline) {\n // Pull out the first event on the public timeline\n try {\n\n if (timeline == null && timeline.length() <= 0) {\n filMthd();\n return;\n\n } else if (intUrls.equalsIgnoreCase(Utils.URL_POSCLIENT)) {\n whID = timeline.getJSONObject(0).getString(\"wh_id\");\n groupCode = timeline.getJSONObject(0).getString(\"group_code\");\n Utils.saveString(BackgrodBaseActivity.this, timeline.getJSONObject(0).getString(\"wh_id\").toString(), \"wh_id\");\n\n // String[] xyz = {\"company_name\", \"wh_name\", \"wh_id\", \"group_code\", \"tax_type\",\"tax_per\", \"curr_code\", \"pymt_code\", \"header_info\", \"footer_info\", \"absorb_tax\"};\n Utils.saveJSONArray(BackgrodBaseActivity.this, \"server\", \"key\", timeline);\n\n Utils.saveMap(getApplicationContext(), Utils.jsonToMap(timeline.getJSONObject(0)), \"getPOSClient\");\n Log.d(\"saved\", \"\" + whID);\n\n } else if (intUrls.equalsIgnoreCase(\"woImg\")) {\n jsBtnWoimg = new JSONArray();\n jsBtnWoimg = timeline;\n\n //Utils.saveJSONArray(getApplicationContext(), \"pages\", \"1\", timeline);\n\n }\n\n\n } catch (Exception exception) {\n Log.d(\"this error\", \"\" + exception);\n\n }\n\n }\n\n @Override\n public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) {\n // Utils.alertDialogShow(getApplicationContext(), \"Error\", \" Connection refused\", 0);\n }\n\n\n @Override\n public void onFinish() {\n progressDialog.dismiss();\n if (intUrls.equalsIgnoreCase(Utils.URL_POSCLIENT)) {\n\n String urlMtds = Utils.INTIALSTRI + Utils._MEALGROUP + Utils.COMPCODE + \"&whid=\" + Utils.getString(BackgrodBaseActivity.this, \"wh_id\") + \"&mealid=\" + MealID + \"&regcode=\" + tsdArr.get(4) + \"&date=\" + Utils.currenDate();\n Log.d(\"urrrl2\", urlMtds);\n frstUrl(urlMtds, \"Meal GROUP\");\n } else if (intUrls.equalsIgnoreCase(\"woImg\")) {\n String urlMtds = Utils.INTIALSTRI + Utils._FULLDETAILS + Utils.COMPCODE + \"&paramgroup_code=\" + MealGroup;\n frstUrl(urlMtds, \"FULL DETAILS\");\n Log.d(\"urrrl3\", urlMtds);\n }\n\n\n }\n });\n\n\n }", "public String ajaxMethod() {\n\t\tAppLog.begin();\n\t\ttry {\n\t\t\tMap<String, Object> session = ActionContext.getContext()\n\t\t\t\t\t.getSession();\n\t\t\tString userId = (String) session.get(\"userId\");\n\t\t\tif (null == userId || \"\".equals(userId)) {\n\t\t\t\tinputStream = ScreenAccessValidator\n\t\t\t\t\t\t.ajaxResponse(getText(\"error.login.expired\"));\n\t\t\t\tAppLog.end();\n\t\t\t\treturn \"success\";\n\t\t\t}\n\t\t\tif (!ScreenAccessValidator.validate(session, SCREEN_ID)) {\n\t\t\t\taddActionError(getText(\"error.access.denied\"));\n\t\t\t\tinputStream = ScreenAccessValidator\n\t\t\t\t\t\t.ajaxResponse(getText(\"error.access.denied\"));\n\t\t\t\tAppLog.end();\n\t\t\t\treturn \"success\";\n\t\t\t}\n\t\t\t\n\t\t\t/* Start: Added by Matiur Rahman on 30-09-2015 */\n\t\t\tif (null != selectedMRKeys && selectedMRKeys.contains(\",\")) {\n\t\t\t\tString[] selectedMRKeysArr = selectedMRKeys.split(\",\");\n\t\t\t\tselectedMRKeys = \"\";\n\t\t\t\tfor (int i = 0; i < selectedMRKeysArr.length; i++) {\n\t\t\t\t\tif (null != selectedMRKeysArr[i]\n\t\t\t\t\t\t\t&& !\"\".equals(selectedMRKeysArr[i])) {\n\t\t\t\t\t\tselectedMRKeys += \",\" + selectedMRKeysArr[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (selectedMRKeys.indexOf(\",\") == 0) {\n\t\t\t\t\tselectedMRKeys = selectedMRKeys.substring(1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t/* End: Added by Matiur Rahman on 30-09-2015 */\n\t\t\tif (\"tagMRD\".equalsIgnoreCase(hidAction)) {\n\t\t\t\tAppLog.end();\n\t\t\t\treturn tagMRD();\n\t\t\t}\n\t\t\tif (\"unTagMRD\".equalsIgnoreCase(hidAction)) {\n\t\t\t\tAppLog.end();\n\t\t\t\treturn unTagMRD();\n\t\t\t}\n\t\t\tif (\"search\".equalsIgnoreCase(hidAction)) {\n\t\t\t\tAppLog.end();\n\t\t\t\tsearchMeterReaderMRDMapping();\n\t\t\t}\n\t\t\tif (\"searchHistory\".equalsIgnoreCase(hidAction)) {\n\t\t\t\tAppLog.end();\n\t\t\t\tsearchMeterReaderMRDMappingHistory();\n\t\t\t}\n\t\t\tif (\"populateMtrRdr\".equalsIgnoreCase(hidAction)) {\n\t\t\t\tAppLog.end();\n\t\t\t\treturn populateMtrRdr();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tinputStream = new StringBufferInputStream(\n\t\t\t\t\t\"<font color='red' size='2'><li><span><b>ERROR:Sorry, There was problem while Processing Last Operation.</b></font>\");\n\t\t\tAppLog.error(e);\n\n\t\t}\n\t\tAppLog.end();\n\t\treturn SUCCESS;\n\t}", "public void fetchResults() {\n String requestUrl = \"http://192.168.1.40:8090/trending\";\n StringRequest request = new StringRequest(\n Request.Method.POST,\n requestUrl,\n trendingGetData,\n errorListener){\n\n protected Map<String, String> getParams() throws com.android.volley.AuthFailureError {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"memberID\", \"MMM111\");\n return params;\n };\n };\n RequestQueue queue = Volley.newRequestQueue(this);\n queue1 = Volley.newRequestQueue(this);\n queue2 = Volley.newRequestQueue(this);\n queue.add(request);\n }", "@Override\n public void onRefresh() {\n load_remote_data();\n }", "public static void requestRenderFromNUI() {\r\n\t\tif (m_Handler != null) {\t\t\t\r\n\t\t\ts_lRequestTicks = System.currentTimeMillis();\r\n\t\t\tm_SkiaView.postInvalidate();\r\n\t\t}\r\n\t}", "@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 }", "private void authentication() {\n if(getSmartApplication().readSharedPreferences().getString(SP_LAST_REQUEST_TIME,\"\").length()<=0){\n lnrSync.setVisibility(View.VISIBLE);\n txtSync.setText(getString(R.string.sync_with_server));\n globalConfiguration.loadGlobalConfiguration(new WebCallListener() {\n\n @Override\n public void onProgressUpdate(int progressCount) {\n }\n\n @Override\n public void onCallComplete(int responseCode, String errorMessage,\n ArrayList<HashMap<String, String>> data1, Object data2) {\n if (responseCode == 200) {\n globalConfiguration.loadAllData(true,\"1\",getLastRequestTime(),new WebCallListener() {\n @Override\n public void onCallComplete(final int responseCode, String errorMessage, ArrayList<HashMap<String, String>> data1, Object data2) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (responseCode == 200) {\n setLastRequestTime();\n getSmartApplication().writeSharedPreferences(SP_LAST_REQUEST_TIME,getLastRequestTime());\n lnrSync.setVisibility(View.GONE);\n lnrMain.setVisibility(View.VISIBLE);\n txtLoadingMsg.setText(getString(R.string.alert_loading_media));\n skProgress.setProgress(0);\n txtProgress.setText(\"0/0\");\n getSmartApplication().writeSharedPreferences(SP_ALLIMAGEDOWNLOADED,\"false\");\n new SobiproCategoriesDataProvider(IjoomerSplashActivity.this).startDownloadEntryImages(new ImageDownloadListener(){\n @Override\n public void onImgeDownload(int total, int countProgress) {\n if (countProgress < 0) {\n IjoomerUtilities.getCustomOkDialog(getString(R.string.splash),\n getString(getResources().getIdentifier(\"code\" + (599), \"string\", getPackageName())),\n getString(R.string.ok), R.layout.ijoomer_ok_dialog, new CustomAlertNeutral() {\n\n @Override\n public void NeutralMethod() {\n finish();\n }\n });\n } else {\n skProgress.setMax(total);\n skProgress.setProgress(countProgress);\n txtProgress.setText((countProgress) + \"/\" + (total));\n }\n }\n\n @Override\n public void onTaskComplete() {\n lnrMain.setVisibility(View.GONE);\n getSmartApplication().writeSharedPreferences(SP_ALLIMAGEDOWNLOADED,\"true\");\n try {\n loadNew(IjoomerHomeActivity.class,\n IjoomerSplashActivity.this, true,\n \"IN_USERID\", \"0\", \"IN_PRIVIOUS_ACTIVITY\",IN_PRIVIOUS_ACTIVITY);\n } catch (Throwable e1) {\n e1.printStackTrace();\n }\n }\n });\n\n }else{\n responseMessageHandler(responseCode, true);\n }\n }\n });\n\n }\n\n @Override\n public void onProgressUpdate(final int progressCount) {\n\n }\n });\n }else{\n responseMessageHandler(responseCode, true);\n }\n }\n });\n }else{\n lnrSync.setVisibility(View.VISIBLE);\n txtSync.setText(getString(R.string.sync_with_server));\n if(SmartApplication.REF_SMART_APPLICATION.readSharedPreferences().getString(SP_LNAGUAGE,\"\").equals(\"es\")){\n globalConfiguration.loadConfigurationForSpanish(new WebCallListener() {\n\n @Override\n public void onProgressUpdate(int progressCount) {\n }\n\n @Override\n public void onCallComplete(int responseCode, String errorMessage,ArrayList<HashMap<String, String>> data1, Object data2) {\n if(responseCode==599){\n lnrSync.setVisibility(View.GONE);\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n try {\n loadNew(IjoomerHomeActivity.class,IjoomerSplashActivity.this, true,\"IN_USERID\", \"0\",\"IN_PRIVIOUS_ACTIVITY\",IN_PRIVIOUS_ACTIVITY);\n } catch (Throwable e1) {\n e1.printStackTrace();\n }\n }\n },1000);\n\n }else{\n globalConfiguration.loadAllData(false, \"0\", getLastRequestTime(), new WebCallListener() {\n @Override\n public void onCallComplete(int responseCode, String errorMessage, ArrayList<HashMap<String, String>> data1, Object data2) {\n getSmartApplication().writeSharedPreferences(SP_LAST_REQUEST_TIME, getLastRequestTime());\n if (responseCode == 200) {\n setLastRequestTime();\n if(getSmartApplication().readSharedPreferences().getString(SP_ALLIMAGEDOWNLOADED,\"false\").equals(\"false\")){\n lnrMain.setVisibility(View.VISIBLE);\n txtLoadingMsg.setText(getString(R.string.alert_loading_media));\n skProgress.setProgress(0);\n txtProgress.setText(\"0/0\");\n getSmartApplication().writeSharedPreferences(SP_ALLIMAGEDOWNLOADED,\"false\");\n new SobiproCategoriesDataProvider(IjoomerSplashActivity.this).startDownloadEntryImages(new ImageDownloadListener(){\n @Override\n public void onImgeDownload(int total, int countProgress) {\n if (countProgress < 0) {\n IjoomerUtilities.getCustomOkDialog(getString(R.string.splash),\n getString(getResources().getIdentifier(\"code\" + (599), \"string\", getPackageName())),\n getString(R.string.ok), R.layout.ijoomer_ok_dialog, new CustomAlertNeutral() {\n\n @Override\n public void NeutralMethod() {\n finish();\n }\n });\n } else {\n skProgress.setMax(total);\n skProgress.setProgress(countProgress);\n txtProgress.setText((countProgress) + \"/\" + (total));\n }\n }\n\n @Override\n public void onTaskComplete() {\n lnrMain.setVisibility(View.GONE);\n getSmartApplication().writeSharedPreferences(SP_ALLIMAGEDOWNLOADED,\"true\");\n try {\n loadNew(IjoomerHomeActivity.class,\n IjoomerSplashActivity.this, true,\n \"IN_USERID\", \"0\",\"IN_PRIVIOUS_ACTIVITY\",IN_PRIVIOUS_ACTIVITY);\n } catch (Throwable e1) {\n e1.printStackTrace();\n }\n }\n });\n }else {\n new SobiproCategoriesDataProvider(IjoomerSplashActivity.this).startDownloadEntryImages(new ImageDownloadListener() {\n @Override\n public void onImgeDownload(int total, int countProgress) {\n\n }\n\n @Override\n public void onTaskComplete() {\n lnrSync.setVisibility(View.GONE);\n try {\n loadNew(IjoomerHomeActivity.class, IjoomerSplashActivity.this, true, \"IN_USERID\", \"0\", \"IN_PRIVIOUS_ACTIVITY\", IN_PRIVIOUS_ACTIVITY);\n } catch (Throwable e1) {\n e1.printStackTrace();\n }\n }\n });\n\n }\n } else {\n lnrSync.setVisibility(View.GONE);\n try {\n loadNew(IjoomerHomeActivity.class, IjoomerSplashActivity.this, true, \"IN_USERID\", \"0\", \"IN_PRIVIOUS_ACTIVITY\", IN_PRIVIOUS_ACTIVITY);\n } catch (Throwable e1) {\n e1.printStackTrace();\n }\n }\n }\n\n @Override\n public void onProgressUpdate(int progressCount) {\n\n }\n });\n\n\n\n }\n\n }\n });\n }else{\n globalConfiguration.loadConfigurationForEnglish(new WebCallListener() {\n\n @Override\n public void onProgressUpdate(int progressCount) {\n }\n\n @Override\n public void onCallComplete(int responseCode, String errorMessage,ArrayList<HashMap<String, String>> data1, Object data2) {\n if(responseCode==599){\n lnrSync.setVisibility(View.GONE);\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n try {\n loadNew(IjoomerHomeActivity.class,IjoomerSplashActivity.this, true,\"IN_USERID\", \"0\",\"IN_PRIVIOUS_ACTIVITY\",IN_PRIVIOUS_ACTIVITY);\n } catch (Throwable e1) {\n e1.printStackTrace();\n }\n }\n },1000);\n\n }else{\n globalConfiguration.loadAllData(false, \"0\", getLastRequestTime(), new WebCallListener() {\n @Override\n public void onCallComplete(int responseCode, String errorMessage, ArrayList<HashMap<String, String>> data1, Object data2) {\n getSmartApplication().writeSharedPreferences(SP_LAST_REQUEST_TIME, getLastRequestTime());\n if (responseCode == 200) {\n setLastRequestTime();\n if(getSmartApplication().readSharedPreferences().getString(SP_ALLIMAGEDOWNLOADED,\"false\").equals(\"false\")){\n lnrMain.setVisibility(View.VISIBLE);\n txtLoadingMsg.setText(getString(R.string.alert_loading_media));\n skProgress.setProgress(0);\n txtProgress.setText(\"0/0\");\n getSmartApplication().writeSharedPreferences(SP_ALLIMAGEDOWNLOADED,\"false\");\n new SobiproCategoriesDataProvider(IjoomerSplashActivity.this).startDownloadEntryImages(new ImageDownloadListener(){\n @Override\n public void onImgeDownload(int total, int countProgress) {\n if (countProgress < 0) {\n IjoomerUtilities.getCustomOkDialog(getString(R.string.splash),\n getString(getResources().getIdentifier(\"code\" + (599), \"string\", getPackageName())),\n getString(R.string.ok), R.layout.ijoomer_ok_dialog, new CustomAlertNeutral() {\n\n @Override\n public void NeutralMethod() {\n finish();\n }\n });\n } else {\n skProgress.setMax(total);\n skProgress.setProgress(countProgress);\n txtProgress.setText((countProgress) + \"/\" + (total));\n }\n }\n\n @Override\n public void onTaskComplete() {\n lnrMain.setVisibility(View.GONE);\n getSmartApplication().writeSharedPreferences(SP_ALLIMAGEDOWNLOADED,\"true\");\n try {\n loadNew(IjoomerHomeActivity.class,\n IjoomerSplashActivity.this, true,\n \"IN_USERID\", \"0\",\"IN_PRIVIOUS_ACTIVITY\",IN_PRIVIOUS_ACTIVITY);\n } catch (Throwable e1) {\n e1.printStackTrace();\n }\n }\n });\n }else {\n new SobiproCategoriesDataProvider(IjoomerSplashActivity.this).startDownloadEntryImages(new ImageDownloadListener() {\n @Override\n public void onImgeDownload(int total, int countProgress) {\n\n }\n\n @Override\n public void onTaskComplete() {\n lnrSync.setVisibility(View.GONE);\n try {\n loadNew(IjoomerHomeActivity.class, IjoomerSplashActivity.this, true, \"IN_USERID\", \"0\", \"IN_PRIVIOUS_ACTIVITY\", IN_PRIVIOUS_ACTIVITY);\n } catch (Throwable e1) {\n e1.printStackTrace();\n }\n }\n });\n\n }\n } else {\n lnrSync.setVisibility(View.GONE);\n try {\n loadNew(IjoomerHomeActivity.class, IjoomerSplashActivity.this, true, \"IN_USERID\", \"0\", \"IN_PRIVIOUS_ACTIVITY\", IN_PRIVIOUS_ACTIVITY);\n } catch (Throwable e1) {\n e1.printStackTrace();\n }\n }\n }\n\n @Override\n public void onProgressUpdate(int progressCount) {\n\n }\n });\n\n\n\n }\n\n }\n });\n }\n }\n\n\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n addsms();\n //This code is executed if there is an error.\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n new Handler().postDelayed(new Runnable() {\n public void run() {\n Consulta();\n }\n }, 800);\n }", "@Override\n public void onSuccess(JSONObject object,String method){\n super.onSuccess(object, method);\n hideLoading();\n Gson gs = new Gson();\n int teamId;\n JSONObject returnInfo;\n if (method.equals(HttpConstant.MATCH_ITEM)) {\n JSONArray obj = null;\n try {\n obj = object.getJSONArray(\"object\");\n } catch (JSONException e) {\n e.printStackTrace();\n }\n games = new Gson().fromJson(obj.toString(), new TypeToken<List<WarGame>>() {\n }.getType());\n for (WarGame wargam : games) {\n if (wargam.getItem_id() == item_id && wargam.getServer_required() == 1) {\n server_rl.setVisibility(View.VISIBLE);\n }\n }\n }\n try {\n if (method.equals(HttpConstant.CORPS_ACTIVITY_DETAIL)) {\n returnInfo = object.getJSONObject(\"object\");\n if (returnInfo.has(\"teamId\")) {\n BroadcastController.sendUserChangeBroadcase(context);\n teamId = returnInfo.getInt(\"teamId\");\n intent = new Intent(context, CorpsDetailsV2Activity.class);\n intent.putExtra(\"teamId\", teamId);\n intent.putExtra(\"matchId\", matchId);\n context.startActivity(intent);\n //MainActivity.requestMsgCount();\n finish();\n }\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }", "private void addDataForListView() {\n \t\n \tif(loadable)\n \t{\t\n \tloadable = false;\n \tdirection = BACKWARD;\n \tstrUrl = Url.composeHotPageUrl(type_id, class_id, last_id);\n \trequestData();\n \t}\n\t}", "@Override\n\tpublic void onRefresh() {\n\t\tSimpleDateFormat sdf=new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\", Locale.getDefault());\t\t\n\t\tmAdapterView.setRefreshTime(sdf.format(new Date()));\n\t\tmAdapterView.stopRefresh();\n\t\tFindHttpPost();\n\t\tpage = 1;\n\t\t\n\t\tif(mLocationClient.isStarted()){\n\t\t\tmLocationClient.stop();\n\t\t}else{\n\t\t\tmLocationClient.start();\n\t\t\tmLocationClient.requestLocation();\n\t\t}\n\t}", "private void loadaspirasirt(){\n String m_idwarga = getSp().getString(\"id_warga\",null);\n Call<ResponModel>viewmypost = getApi().rtaspirasi();\n viewmypost.enqueue(new Callback<ResponModel>() {\n @Override\n public void onResponse(Call<ResponModel> call, Response<ResponModel> response) {\n refresh.setRefreshing(false);\n Log.d(\"RESPON\",\"Hasil\"+response.body());\n mItem= response.body().getResult();\n mAdapter = new AdapterRT(mItem,AspirasiRTActivity.this);\n mylistpost.setAdapter(mAdapter);\n mAdapter.notifyDataSetChanged();\n\n }\n\n @Override\n public void onFailure(Call<ResponModel> call, Throwable t) {\n refresh.setRefreshing(false);\n Log.d(\"RESPON\",\"GAGAL\");\n }\n });\n }", "private String gatewayRequest(String url) {\n final ProgressDialog pDialog = new ProgressDialog(mCtx);\n pDialog.setMessage(\"Loading...\");\n pDialog.show();\n\n JsonObjectRequest jsonObjReq = new JsonObjectRequest(Request.Method.GET,\n url, null,\n new Response.Listener<JSONObject>() {\n\n @Override\n public void onResponse(JSONObject response) {\n manageResponse(response);\n //manageResponse(getDevicesMoke());\n\n pDialog.hide();\n }\n }, new Response.ErrorListener() {\n\n @Override\n public void onErrorResponse(VolleyError error) {\n Log.d(TAG, \"Error: \" + error.getMessage());\n // hide the progress dialog\n pDialog.hide();\n }\n });\n HttpHandler.getInstance(mCtx).addToRequestQueue(jsonObjReq);\n return \"\";\n\n }", "private void getMall(HttpServletRequest request, HttpServletResponse response) {\n\t\t\n\t}", "@Override\n\t\t\tpublic void onResponseReceived(Request request, Response response) {\n\t\t\t\t\n\t\t\t}", "private void hitSpinnerSeries(final String brand) {\n\n views.showProgress(ShopActivity.this);\n series_list_dataSeries.clear();\n series_list.clear();\n\n RequestQueue requestQueueMobile = Volley.newRequestQueue(ShopActivity.this);\n StringRequest request = new StringRequest(Request.Method.POST, Url.getseries, new com.android.volley.Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n Log.d(\"Logdfgonse\", response);\n views.hideProgress();\n try {\n JSONObject jsonObject = new JSONObject(response);\n\n if (jsonObject.getString(\"code\").equals(\"200\")) {\n JSONArray jsonArray = jsonObject.getJSONArray(\"data\");\n\n for (int i = 0; i < jsonArray.length(); i++) {\n JSONObject jsonObject1 = jsonArray.getJSONObject(i);\n SeriesModel seriesModel = new SeriesModel();\n seriesModel.setSeries_id(jsonObject1.getString(\"id\"));\n seriesModel.setSeries_name(jsonObject1.getString(\"series_name\"));\n series_list.add(seriesModel);\n series_list_dataSeries.add(series_list.get(i).getSeries_name());\n }\n\n Log.d(\"jhkljasdk\", series_list_dataSeries.toString());\n\n ArrayAdapter brandAdapter = new ArrayAdapter(ShopActivity.this, android.R.layout.simple_spinner_dropdown_item, series_list_dataSeries);\n spinnerSeries.setAdapter(brandAdapter);\n }\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }, new com.android.volley.Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n views.hideProgress();\n Toast.makeText(ShopActivity.this, \"Something Wrong\", Toast.LENGTH_SHORT).show();\n Log.d(\"errodfr\", error.getMessage() + \"errorr\");\n\n }\n }) {\n protected Map<String, String> getParams() {\n HashMap<String, String> hashMap = new HashMap<>();\n hashMap.put(\"key\", Url.key);\n hashMap.put(\"brand_id\", brand);\n Log.d(\"brandidd\", brand_id);\n\n return hashMap;\n\n }\n\n };\n requestQueueMobile.getCache().clear();\n requestQueueMobile.add(request);\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t\tURL url;\n\t\t\t\ttry{\n\n\t\t\t\t strUrl = Url.composeCoopResourceListUrl(location, res_type, keyword, page);\n\t\t\t\t\tLog.i(\"coop_resource_url\", strUrl);\n\t\t\t\t url = new URL(strUrl);\n\t\t\t\t\tURLConnection con = url.openConnection();\n\t\t\t\t\tcon.connect();\n\t\t\t\t\tInputStream input = con.getInputStream();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif(\"人力\".equals(cooper_type))\n\t\t\t\t\t{ List<Cooper> temp = null;\n\t\t\t\t\t\tjson = new JsonCoopResearchListHandler(activity,\"labor\");\n\t\t\t\t\t\ttemp = (List<Cooper>) json.getListItems(input);\n\t\t\t\t\t\tif(temp != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcoop_list = temp;\n\t\t\t\t\t\t\thandler.sendEmptyMessage(UPDATE_COOP_LIST);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tLog.i(\"temp?==0\",\"temp==0\");\n\t\t\t\t\t\t\thandler.sendEmptyMessage(3);\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(\"设备\".equals(cooper_type))\n\t\t\t\t\t{\n\t\t\t\t\t json = json = new JsonCoopResearchListHandler(activity,\"facility\"); \n\t\t\t\t\t List<Facility> temp = null;\n\t\t\t\t\t temp = (List<Facility>) json.getListItems(input);\n\t\t\t\t\t if(temp != null)\n\t\t\t\t\t {\n\t\t\t\t\t\t faci_list = temp;\n\t\t\t\t\t\t handler.sendEmptyMessage(UPDATE_COOP_LIST);\n\t\t\t\t\t\t\n\t\t\t\t\t }else\n\t\t\t\t\t{\n\t\t\t\t\t\tLog.i(\"temp?==0\",\"temp==0\");\n\t\t\t\t\t\thandler.sendEmptyMessage(3);\n\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}catch(MalformedURLException e)\n\t\t\t\t{\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}", "@Override\n\t\t\t\t\tpublic void onLoadLiveTV(String result) {\n\t\t\t\t\t\tLog.i(\"LiveTV\", result);\n\t\t\t\t\t\tGlobal.listTV = Global.tvapisender.listLiveShow(result);\n\t\t\t\t\t\t// if(Global.listTV!=null){\n\t\t\t\t\t\tGlobal.lich.add(new LichChieu(\"Live Tivi\",\n\t\t\t\t\t\t\t\tGlobal.listTV));\n\t\t\t\t\t\t// }\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tgetShedule(new VolleyCallback() {\n\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\tpublic void onSuccess(String result) {\n\t\t\t\t\t\t\t\t\tGlobal.chanelList = Global.tvapisender\n\t\t\t\t\t\t\t\t\t\t\t.getShedule(result);\n\t\t\t\t\t\t\t\t\tif (Global.chanelList != null) {\n\t\t\t\t\t\t\t\t\t\tGlobal.lich\n\t\t\t\t\t\t\t\t\t\t\t\t.add(new LichChieu(\"LichChieu\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGlobal.chanelList));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tHandler handler = new Handler();\n\t\t\t\t\t\t\t\t\thandler.postDelayed(new Runnable() {\n\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\tstartApp();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}, 2000);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\tpublic void onLoadMenuShow(String result) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\tpublic void onLoadVideo(String result) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\tpublic void onLoadLiveTV(String result) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\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} catch (JSONException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}", "private void executeReportRequest(String user_id, String search_date, final String searchedUser){\n new ServerApiRequests(this,\n\n new ServerApiRequests.AsyncStart(){\n\n @Override\n public void onProcessStart(){\n loadReport.setVisibility(View.VISIBLE);\n }\n },\n\n new ServerApiRequests.AsyncResponse() {\n\n @Override\n public void onProcessFinish(String output) {\n Log.e(\"response\", output);\n\n try {\n JSONObject result = new JSONObject(output);\n\n PersonalToastDesign tst = new PersonalToastDesign(getApplicationContext());\n String state = result.getString(\"success\");\n if(state.equals(\"true\")) {\n// tst.showToast(\"User unfriended.\");\n\n mMap.clear();\n ArrayList<Marker> markersList = new ArrayList<Marker>();\n double distance = 0;\n double prev_x = 0;\n double prev_y = 0;\n\n PolylineOptions rectOptions = new PolylineOptions();\n JSONArray jsonUsers = result.getJSONArray(\"user\");\n\n\n for (int i = 0; i < jsonUsers.length(); i++) {\n\n\n PointCoordinates tempPoint = new PointCoordinates(\n jsonUsers.getJSONObject(i).getDouble(\"COOR_X\")\n , jsonUsers.getJSONObject(i).getDouble(\"COOR_Y\")\n ,jsonUsers.getJSONObject(i).getString(\"REC_DATE\"));\n\n Marker marker = mMap.addMarker(new MarkerOptions()\n .position(new LatLng(tempPoint.getCoord_x(), tempPoint.getCoord_y()))\n .title(tempPoint.getRec_date())\n// .icon(BitmapDescriptorFactory.fromResource(R.drawable.red_house))\n );\n// marker.showInfoWindow();\n markersList.add(marker);\n\n rectOptions.add(new LatLng(tempPoint.getCoord_x(), tempPoint.getCoord_y()));\n\n // accumulate distance\n\n if (i > 0){\n distance += tempPoint.distanceToMe(prev_x,prev_y);\n } else {\n prev_x = tempPoint.getCoord_x();\n prev_y = tempPoint.getCoord_y();\n }\n }\n\n showDistance.setVisibility(View.VISIBLE);\n double finalValue = Math.round( distance * 1000.0 ) / 1000.0;\n showDistance.setText(\"Изминатo разстояние от \"+ searchedUser + \" ~ \" + String.valueOf(finalValue)+ \" км.\");\n\n\n mMap.addPolyline(rectOptions).setColor(Color.GREEN);;\n\n // zooming\n final int padding = 30;//initialize the padding for map boundary\n /**create the bounds from latlngBuilder to set into map camera*/\n LatLngBounds.Builder builder = new LatLngBounds.Builder();\n for (Marker m : markersList) {\n builder.include(m.getPosition());\n }\n\n final LatLngBounds bounds = builder.build();\n mMap.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, padding));\n\n } else {\n //tst.showToast(result.getString(\"error\"));\n String r = result.getString(\"error\");\n if(r.equals(\"Day or user not found\")) {\n tst.showToast(\"Денят, или потребителят не са намерени\");\n }\n if(r.equals(\"Please provide user name and search date\")) {\n tst.showToast(\"Моля въведете име и търсена дата\");\n }\n\n mMap.clear();\n showDistance.setVisibility(View.GONE);\n mMap.animateCamera(CameraUpdateFactory.zoomTo(1));\n }\n\n } catch (JSONException e) {\n e.printStackTrace();\n PersonalToastDesign tst = new PersonalToastDesign(getApplicationContext());\n tst.showToast(\"Възникна проблем със сървъра\");\n mMap.clear();\n executeReport.setEnabled(true);\n showDistance.setVisibility(View.GONE);\n loadReport.setVisibility(View.GONE);\n mMap.animateCamera(CameraUpdateFactory.zoomTo(1));\n }\n\n loadReport.setVisibility(View.GONE);\n executeReport.setEnabled(true);\n }\n }\n\n ).execute(\"get_report_coords_url\", user_id, search_date);\n }", "@Override \n public void run() {\n\t\tString path = Urls.URL_32;\n\t\t\n\t\tMap<String, String> map = new HashMap<String, String>();\n\t\tmap.put(\"login-name-or-mobile\", username);\n\t\tmap.put(\"pwd\", password);\n\t \tList<BasicNameValuePair> params = HttpUtils.setParams(map);\n\t \t\n\t\tMap<String, String> map2 = new HashMap<String, String>();\n\t \tmap2.put(\"Accept-Encoding\", \"gzip, deflate\");\n\t \tmap2.put(\"Accept\", \"application/json\");\n\n\t \tMap<String,String> info = new HashMap<String,String>();\n\t\tString jsonStr = \"\";\n\t\ttry {\n\t\t\tjsonStr = RequestService.getInstance().getRequest(params, path, map2);\n\t\t\t\n\t\t\tif(jsonStr==null || \"null\".equals(jsonStr) || \"\".equals(jsonStr)){\n\t\t\t\tinfo.put(\"available\", \"0\");\n\t\t\t}else{\n\t\t\t\tHttpUtils.parseJson(jsonStr, info, null);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tMessage msg = new Message(); \n\t msg.what = Constants.NETWORK_ERROR;\n\t handler.sendMessage(msg); \n\t return;\n\t\t}\n\t\t\n Message msg = new Message(); \n msg.obj = info;\n msg.what = Constants.GET_BALANCE_SUCCESS;\n handler.sendMessage(msg); \n }", "private void getData1() {\n loading1 = new ProgressDialog(ScoreActivity.this);\n loading1.setIcon(R.drawable.wait_icon);\n loading1.setTitle(\"Loading\");\n loading1.setMessage(\"Please wait....\");\n loading1.show();\n\n String URL = Key.MCQ_MARK+mid;\n\n StringRequest stringRequest = new StringRequest(URL, new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n loading1.dismiss();\n showJSON1(response);\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n\n Intent intent = new Intent(ScoreActivity.this,ExaminationActivity.class);\n startActivity(intent);\n loading1.dismiss();\n Toast.makeText(ScoreActivity.this, \"Network Error!\", Toast.LENGTH_SHORT).show();\n }\n });\n\n RequestQueue requestQueue = Volley.newRequestQueue(ScoreActivity.this);\n requestQueue.add(stringRequest);\n }", "@Override\n public void onClick(View v) {\n new AsyncCheckInternet(Activity_Lesson_Unit_Point_Display_FlashCardActivity.this,new INetStatus(){\n @Override\n public void inetSatus(Boolean netStatus) {\n if(netStatus){\n HashMap<String,String> hmap=new HashMap<>();\n hmap.put(\"QUASTION_ID\",cur_questionNo);\n hmap.put(\"COURSE_ID\",courseid);\n hmap.put(\"SUBJECT_ID\",subjectid);\n hmap.put(\"PAPER_ID\",paperid);\n hmap.put(\"CHAPTER_ID\",paperid);\n hmap.put(\"ACTIVITY_TYPE\",\"FLASH_CARD\");\n hmap.put(\"ISSUE_TYPE\",sp_report.getSelectedItem().toString());\n report_message=txt_reportMessage.getText().toString();\n hmap.put(\"ISSUE_MESSAGE\",report_message);\n hmap.put(\"REPORTED_BY\",studentid);\n\n new BagroundTask(URLClass.hosturl +\"insert_report.php\",hmap, Activity_Lesson_Unit_Point_Display_FlashCardActivity.this, new IBagroundListener() {\n\n @Override\n public void bagroundData(String json) {\n if(json.equalsIgnoreCase(\"Report_NOT_Inserted\")){\n Toast.makeText(getApplicationContext(),\"Report not submitted,please try again..\",Toast.LENGTH_SHORT).show();\n }else {\n alertDialog.cancel();\n Toast.makeText(getApplicationContext(),\"Report submitted,Thank you for your feedback..\",Toast.LENGTH_SHORT).show();\n }\n }\n }).execute();\n }else {\n Toast.makeText(getApplicationContext(),\"No internet,Please Check Your Connection\",Toast.LENGTH_SHORT).show();\n }\n }\n }).execute();\n }", "public void waitingChargeApiCall(final JSONObject js) {\n RequestQueue queue = Volley.newRequestQueue(context);\n JsonObjectRequestWithHeader jsonObjReq = new JsonObjectRequestWithHeader(Request.Method.POST,\n Constants.URL_WAITING_CHARGE, js,\n new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject response) {\n Log.v(\"Response\", response.toString());\n try {\n if (response.getBoolean(\"result\")) {\n Toast.makeText(context, response.getString(\"response\"), Toast.LENGTH_SHORT).show();\n showRateDialog();\n\n } else {\n Toast.makeText(context, response.getString(\"response\"), Toast.LENGTH_SHORT).show();\n showRateDialog();\n }\n progressDialog.dismiss();\n\n\n } catch (JSONException e) {\n progressDialog.dismiss();\n }\n }\n }, new Response.ErrorListener() {\n\n @Override\n public void onErrorResponse(VolleyError error) {\n VolleyLog.d(\"Response\", \"Error: \" + error.getMessage());\n progressDialog.dismiss();\n }\n });\n\n int socketTimeout = 30000;//30 seconds - change to what you want\n RetryPolicy policy = new DefaultRetryPolicy(socketTimeout, DefaultRetryPolicy.DEFAULT_MAX_RETRIES,\n DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);\n jsonObjReq.setRetryPolicy(policy);\n queue.add(jsonObjReq);\n }", "private void getData() {\n showDialog();\n Call<InfoMcWkMoldRes> call = apiInterface.getCompositeMaster(idActual);\n call.enqueue(new Callback<InfoMcWkMoldRes>() {\n @Override\n public void onResponse(Call<InfoMcWkMoldRes> call, Response<InfoMcWkMoldRes> response) {\n if(response.isSuccessful()){\n compositeMasterArrayList = new ArrayList<>();\n InfoMcWkMoldRes res = response.body();\n if (res!=null){\n compositeMasterArrayList = res.getCompositeMasterList();\n if (compositeMasterArrayList.isEmpty()) {\n dialog.dismiss();\n nodata.setVisibility(View.VISIBLE);\n mapping.setVisibility(View.GONE);\n return;\n }\n dialog.dismiss();\n buildRecycleView();\n }\n\n }else {\n nodata.setVisibility(View.VISIBLE);\n mapping.setVisibility(View.GONE);\n AlertError.alertError(\"The server response error\", CompositeActivity.this);\n dialog.dismiss();\n }\n }\n\n @Override\n public void onFailure(Call<InfoMcWkMoldRes> call, Throwable t) {\n call.cancel();\n nodata.setVisibility(View.VISIBLE);\n mapping.setVisibility(View.GONE);\n AlertError.alertError(t.getMessage(), CompositeActivity.this);\n dialog.dismiss();\n\n }\n });\n\n Log.e(\"getData\", webUrl + \"ActualWO/Getinfo_mc_wk_mold?id_actual=\" + idActual);\n }", "protected void onClientInfo(AjaxRequestTarget target, WebClientInfo clientInfo)\n\t{\n\t}", "@Override\r\n public void onResponse(JSONObject response) {\n Log.d(TAG, response.toString());\r\n try {\r\n\r\n evalResponse(response);\r\n } catch (JSONException e) {\r\n\r\n e.printStackTrace();\r\n }\r\n pdLoading.dismiss();\r\n }", "@Override\n public void onRefresh() {\n category = searchSpinner.getSelectedItem().toString();\n if(connection.isOnline(MainActivity.this)){\n swipeContainer.setVisibility(View.GONE);\n progressBar.setVisibility(View.VISIBLE);\n new LoadMeetsAsync().execute();\n }\n else {\n swipeContainer.setRefreshing(false);\n }\n }", "@Override\n public void onResponse(String response, int id) {\n processData(response);\n\n OkHttpUtils.get().url(Constants.BANNER_URL).build().execute(new StringCallback() {\n @Override\n public void onError(Call call, Exception e, int id) {\n Log.e(\"TAG\", \"\" + e.getMessage());\n }\n\n @Override\n public void onResponse(final String response, int id) {\n //Log.e(\"TAG\", \"\" + response);\n /*MainActivity activity = (MainActivity) mContext;\n activity.runOnUiThread(new Runnable() {\n @Override\n public void run() {*/\n processData1(response);\n adapter = new ThemAdapter(mContext, resultBean, result);\n rvThem.setAdapter(adapter);\n GridLayoutManager manager = new GridLayoutManager(mContext, 1);\n rvThem.setLayoutManager(manager);\n swipeRefreshLayout.setRefreshing(false);\n /* }\n });*/\n\n }\n });\n }", "private void callWebServiceData() {\r\n\r\n\t\tif(Utility.FragmentContactDataFetchedOnce){\r\n\t\t\tgetDataFromSharedPrefernce();\r\n\t\t} else {\r\n\t\t\t//Utility.startDialog(activity);\r\n\t\t\tnew GetDataAsynRegistration().execute();\r\n\t\t}\r\n\t}", "private void sendSupportRequest()\n {\n if (HelperHttp.isNetworkAvailable(getActivity()))\n {\n //Add parameters to request in arraylist\n ArrayList<Parameter> parameterList = new ArrayList<Parameter>();\n parameterList.add(new Parameter(\"userHash\", DataManager.getInstance().user.getUserHash(), String.class));\n parameterList.add(new Parameter(\"ticketType\", selectedRequestId, Integer.class));\n parameterList.add(new Parameter(\"ticketTitle\", edTitle.getText().toString(), String.class));\n parameterList.add(new Parameter(\"ticketDetails\", edDescription.getText().toString(), String.class));\n\n //create web service inputs\n DataInObject inObj = new DataInObject();\n inObj.setMethodname(\"LogNewSupportRequest\");\n inObj.setNamespace(Constants.TEMP_URI_NAMESPACE);\n inObj.setSoapAction(Constants.TEMP_URI_NAMESPACE + \"IPlannerService/LogNewSupportRequest\");\n inObj.setUrl(Constants.PLANNER_WEBSERVICE_URL);\n inObj.setParameterList(parameterList);\n\n //Network call\n showProgressDialog();\n new WebServiceTask(getActivity(), inObj, true, new TaskListener()\n {\n @Override\n public void onTaskComplete(Object response)\n {\n //Added by Asmita on 24th Jan 2017 as client asked to temporary hide the functionality due to server side error\n try\n {\n SoapObject outer = (SoapObject) response;\n SoapObject inner = (SoapObject) outer.getPropertySafely(\"Success\");\n successMessage = inner.getPropertySafelyAsString(\"Message\", \"0\");\n planTaskId = Integer.parseInt(inner.getPropertySafelyAsString(\"PlanTaskID\", \"0\"));\n\n if (imageDragableGridView.getUpdatedImageListWithoutPlus().size() >= 1)\n {\n for (int i = 0; i < imageDragableGridView.getUpdatedImageListWithoutPlus().size(); i++)\n {\n uploadDocFiles();\n }\n\n } else\n {\n hideProgressDialog();\n CustomDialogManager.showOkDialog(getActivity(), successMessage, new DialogListener()\n {\n @Override\n public void onButtonClicked(int type)\n {\n hideProgressDialog();\n if (getFragmentManager().getBackStackEntryCount() != 0)\n {\n getFragmentManager().popBackStack();\n } else\n {\n getActivity().finish();\n }\n }\n });\n }\n\n } catch (Exception e)\n {\n hideProgressDialog();\n e.printStackTrace();\n }\n\n }\n }).execute();\n } else\n {\n CustomDialogManager.showOkDialog(getActivity(), getString(R.string.no_internet_connection));\n }\n }", "@Override\n\tpublic void onStartRequest(HttpRequest request,int requestId) {\n\t\tprogressDialog.show();\n\t}", "@Override\n public void onLoadMore() {\n MyApplacation.getmHandler().postDelayed(new Runnable() {\n @Override\n public void run() {\n pageNo++;\n getDataForService();\n }\n }, 1000);\n\n }", "private void initdata() {\n\t\tProgressDialogUtil.showProgressDlg(this, \"加载数据\");\n\t\tProdDetailRequest req = new ProdDetailRequest();\n\t\treq.id = prodInfo.id+\"\";\n\t\tRequestParams params = new RequestParams();\n\t\ttry {\n\t\t\tparams.setBodyEntity(new StringEntity(req.toJson()));\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tnew HttpUtils().send(HttpMethod.POST, Api.GETGOODSDETAIL, params, new RequestCallBack<String>() {\n\t\t\t@Override\n\t\t\tpublic void onFailure(HttpException arg0, String arg1) {\n\t\t\t\tProgressDialogUtil.dismissProgressDlg();\n\t\t\t\tT.showNetworkError(CommodityInfosActivity.this);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onSuccess(ResponseInfo<String> resp) {\n\t\t\t\tProgressDialogUtil.dismissProgressDlg();\n\t\t\t\tProdDetailResponse bean = new Gson().fromJson(resp.result, ProdDetailResponse.class);\n\t\t\t\tLog.e(\"\", \"\"+resp.result);\n\t\t\t\tif(Api.SUCCEED == bean.result_code && bean.data != null) {\n\t\t\t\t\tupview(bean.data);\n\t\t\t\t\tdatas = bean.data;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public void init() {\n FacesContext context = FacesContext.getCurrentInstance();\n Map<String, String> paramMap = context.getExternalContext().getRequestParameterMap();//gets the info from the URL\n this.setFormId(paramMap.get(\"id\"));//gets the form ID from the URL and sets it to the variable\n\n\n this.startDateQuestionSet();//executes the method\n this.startMultQuestionSet();//executes the method\n this.startSingleQuestionSet();//executes the method\n this.startTextQuestionSet();//executes the method\n }", "@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\thandlHttpRequest(url, trackerinfo.get_info_hash(), Settings.PEER_DEFAULT_ID);\n\t\t\t\t\t}", "@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}", "private void getData() {\n loading = new ProgressDialog(ScoreActivity.this);\n loading.setIcon(R.drawable.wait_icon);\n loading.setTitle(\"Loading\");\n loading.setMessage(\"Please wait....\");\n loading.show();\n\n String URL = Key.WRITTEN_MARK+mid;\n\n StringRequest stringRequest = new StringRequest(URL, new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n loading.dismiss();\n showJSON(response);\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n\n Intent intent = new Intent(ScoreActivity.this,ExaminationActivity.class);\n startActivity(intent);\n loading.dismiss();\n Toast.makeText(ScoreActivity.this, \"Network Error!\", Toast.LENGTH_SHORT).show();\n }\n });\n\n RequestQueue requestQueue = Volley.newRequestQueue(ScoreActivity.this);\n requestQueue.add(stringRequest);\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 public void onResponse(JSONObject response) {\n hideCustomLoadingView();\n try {\n String status = response.getString(\"status\");\n if (status.equals(\"1\")) {\n showToast(\"Started\");\n setCustomers();\n } else if (status.equals(\"false\")) {\n showToast(\"Fail\");\n } else {\n showToast(\"Network Error!\");\n }\n } catch (Exception e) {\n e.printStackTrace();\n showToast(\"Network Error!\");\n }\n }", "private void doApiCall() {\n\n if (currentPage != PAGE_START) adapter.removeLoading();\n\n // check weather is last page or not\n if (totalPage != 0) {\n adapter.addLoading();\n apiCall(currentPage);\n } else {\n isLastPage = true;\n }\n isLoading = false;\n }", "void successUiUpdater();", "public void loadData(){\n JsonArrayRequest request = new JsonArrayRequest(\"http://www.efstratiou.info/projects/newsfeed/getList.php\", netListener, errorListener);\n\n //submit request\n ArticlesApp.getInstance().getRequestQueue().add(request);\n\n }", "public void onSuccessFetching(String method, Object data) {\n\t\t\t\t\n\t\t\t}", "public void onSuccessFetching(String method, Object data) {\n\t\t\t\t\n\t\t\t}", "@RequestMapping(value = \"/plugins/{type}/table/ajax\", method = RequestMethod.GET)\n\tpublic void getStorageAjax(@PathVariable(\"type\") String type, HttpServletResponse response, HttpServletRequest request) {\n\t\tString aoData = request.getParameter(\"aoData\");\n\t\tJSONArray params = JSON.parseArray(aoData);\n\t\tint sEcho = 0, iDisplayStart = 0, iDisplayLength = 0;\n\t\tString search = \"\";\n\t\tfor (Object object : params) {\n\t\t\tJSONObject param = (JSONObject) object;\n\t\t\tif (\"sEcho\".equals(param.getString(\"name\"))) {\n\t\t\t\tsEcho = param.getIntValue(\"value\");\n\t\t\t} else if (\"iDisplayStart\".equals(param.getString(\"name\"))) {\n\t\t\t\tiDisplayStart = param.getIntValue(\"value\");\n\t\t\t} else if (\"iDisplayLength\".equals(param.getString(\"name\"))) {\n\t\t\t\tiDisplayLength = param.getIntValue(\"value\");\n\t\t\t} else if (\"sSearch\".equals(param.getString(\"name\"))) {\n\t\t\t\tsearch = param.getString(\"value\");\n\t\t\t}\n\t\t}\n\n\t\tMap<String, Object> map = new HashMap<>();\n\t\tmap.put(\"search\", search);\n\t\tmap.put(\"type\", type);\n\t\tmap.put(\"start\", iDisplayStart);\n\t\tmap.put(\"size\", iDisplayLength);\n\n\t\tJSONArray storages = JSON.parseArray(storageService.get(map).toString());\n\t\tJSONArray aaDatas = new JSONArray();\n\t\tfor (Object object : storages) {\n\t\t\tJSONObject storage = (JSONObject) object;\n\t\t\tJSONObject aaData = new JSONObject();\n\t\t\tint id = storage.getInteger(\"id\");\n\t\t\taaData.put(\"host\", \"<a href='/hc/storage/\" + storage.getString(\"type\") + \"/\" + id + \"/console'>\" + storage.getString(\"host\") + \"</a>\");\n\t\t\taaData.put(\"port\", storage.getInteger(\"port\"));\n\t\t\taaData.put(\"modify\", storage.getString(\"modify\"));\n\t\t\taaData.put(\"operate\",\n\t\t\t\t\t\"<div class='btn-group'><button class='btn btn-primary btn-xs dropdown-toggle' type='button' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>Action <span class='caret'></span></button><ul class='dropdown-menu dropdown-menu-right'><li><a id='operater_modal' name='operater_modal' href='#\"\n\t\t\t\t\t\t\t+ id + \"/'>Modify</a></li><li><a href='/hc/storage/\" + storage.getString(\"type\") + \"/\" + id + \"/delete/'>Delete</a></li></ul></div>\");\n\t\t\taaDatas.add(aaData);\n\t\t}\n\n\t\tint count = storageService.count(map);\n\t\tJSONObject target = new JSONObject();\n\t\ttarget.put(\"sEcho\", sEcho);\n\t\ttarget.put(\"iTotalRecords\", count);\n\t\ttarget.put(\"iTotalDisplayRecords\", count);\n\t\ttarget.put(\"aaData\", aaDatas);\n\t\ttry {\n\t\t\tbyte[] output = target.toJSONString().getBytes();\n\t\t\tBaseController.response(output, response);\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "protected void loadData() {\n refreshview.setRefreshing(true);\n //小区ID\\t帐号\\t消息类型ID\\t开始时间\\t结束时间\n // ZganLoginService.toGetServerData(26, 0, 2, String.format(\"%s\\t%s\\t%s\\t%s\\t%d\", PreferenceUtil.getUserName(), msgtype, \"2015-01-01\", nowdate, pageindex), handler);\n //ZganCommunityService.toGetServerData(26, 0, 2, String.format(\"%s\\t%s\\t%s\\t%s\\t%d\", PreferenceUtil.getUserName(), msgtype, \"2015-01-01\", nowdate, pageindex), handler);\n ZganCommunityService.toGetServerData(40, String.format(\"%s\\t%s\\t%s\\t%s\", PreferenceUtil.getUserName(), funcPage.gettype_id(), String.format(\"@id=22,@page_id=%s,@page=%s\",funcPage.getpage_id(),pageindex), \"22\"), handler);\n }", "@Override\n public void onResponse(String response) {\n mTimerPage.cancel();\n swipContainer.setRefreshing(false);\n DaerahWrapper wrapper = null;\n Debug.i(\"Response \" + response);\n try {\n VolleyParsing parsing = new VolleyParsing();\n wrapper = parsing.daerahParsing(response);\n\n if (wrapper != null) {\n if (wrapper.list.size() == 0) {\n showEmpty(getString(R.string.text_no_data));\n } else {\n if (mIsRefresh) {\n mDaerahList = new ArrayList<Daerah>();\n }\n updateView(wrapper);\n cacheDb.updateDaerahList(wrapper.list,\"kabupaten\");\n }\n } else {\n showEmpty(getString(R.string.text_download_failed));\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private void getData(final int num){\n final ProgressDialog loading = ProgressDialog.show(this, \"Please wait...\",\"Loading...\",false,false);\n loading.setCancelable(true);\n\n Thread thread = new Thread(new Runnable() {\n @Override\n public void run() {\n\n //Creating a json array request to get the json from our api\n JsonArrayRequest jsonArrayRequest = new JsonArrayRequest(DATA_URL,\n new Response.Listener<JSONArray>() {\n @Override\n public void onResponse(JSONArray response) {\n //Dismissing the progressdialog on response\n loading.dismiss();\n\n json_array = response;\n\n handler.post(new Runnable() {\n @Override\n public void run() {\n\n\n //Displaying our grid\n showGrid(json_array,num);\n }\n });\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n mPullRefreshGridView.onRefreshComplete();\n Toast.makeText(getApplicationContext(),\"Connection Error!\",Toast.LENGTH_LONG).show();\n }\n }\n );\n\n //Creating a request queue\n RequestQueue requestQueue = Volley.newRequestQueue(BanglaTopSongGridActivity.this);\n //Adding our request to the queue\n requestQueue.add(jsonArrayRequest);\n }\n });\n thread.start();\n }", "private void sendInfoPlugins(HttpServletRequest request, String action) {\n\t\t\n\t\tEmployee user = getUser(request);\n\t\t\n\t\tif (user != null && !isAjaxCall(request)) {\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\t// Info for load plugins\n\t\t\t\tList<PluginLoad> pluginsLoad = new ArrayList<PluginLoad>();\n\t\t\t\t\n\t\t\t\tString servletName = this.getClass().getSimpleName();\n\t\t\t\t\n\t\t\t\tPluginLogic logic = new PluginLogic();\n\t\t\t\t\n\t\t\t\t// Find plugins for logged user\n\t\t\t\tHashMap<String, Boolean> plugins = logic.getPlugins(getUser(request).getContact());\n\t\t\t\n\t\t\t\tfor (String plugin : plugins.keySet()) {\n\t\t\t\t\t\n\t\t\t\t\t// Plugin enabled\n\t\t\t\t\tif (plugins.get(plugin)) {\n\n\t\t\t\t\t\tOperationPlugin operationPlugin = null;\n\t\t\t\t \t\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Instantiate the operation\n\t\t\t\t\t\t\toperationPlugin = (OperationPlugin) Class.forName(OperationPlugin.pluginClass(plugin)).newInstance();\n setInformationPlugin(request, operationPlugin);\n\n\t\t\t\t\t\t} catch (Exception e) {\n//\t\t\t\t\t\t\tLOGGER.warn(e);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Plugin has configuration\n\t\t\t\t\t\tif (operationPlugin != null) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Add configuration of plugin\n\t\t\t\t\t\t\tpluginsLoad.addAll(operationPlugin.pluginLoad(servletName, action));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n // Find in package annotation\n Set<Class<?>> configuredClasses = CacheStatic.getPluginLoads();\n\n if (ValidateUtil.isNotNull(configuredClasses)) {\n\n // Proccess anotations\n for (Class<?> configuredClass : configuredClasses) {\n\n\n // Get annotation configuration\n es.sm2.openppm.core.plugin.annotations.PluginLoad load = configuredClass.getAnnotation(es.sm2.openppm.core.plugin.annotations.PluginLoad.class);\n\n if (Arrays.asList(load.servlet()).contains(servletName)) {\n\n PluginAction annotation = CacheStatic.getPluginAction(configuredClass);\n\n PluginLoad pluginLoad = new PluginLoad();\n pluginLoad.setPluginName(annotation.plugin());\n pluginLoad.setSelector(load.selector());\n pluginLoad.setTypeModification(load.loadType().name());\n pluginLoad.setTemplate(annotation.action());\n pluginLoad.setForms(load.forms());\n\n pluginsLoad.add(pluginLoad);\n }\n }\n }\n\n\n\t\t\t\t// Add configuration for load plugins\n\t\t\t\tif (ValidateUtil.isNotNull(pluginsLoad)) {\n\t\t\t\t\t\n\t\t\t\t\tfor (PluginLoad load : pluginsLoad) {\n\t\t\t\t\t\tLOGGER.debug(\"Plugin for load: \"+load.getPluginName()+\" [\"+load.getSelector()+\"||\"+load.getTemplate()+\"]\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\trequest.setAttribute(\"pluginsLoad\", pluginsLoad);\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tLOGGER.warn(\"Error in plugin\", e);\n\t\t\t}\n\t\t}\n\t}", "public void UpdateAllControl(){\n try {\n AsyncHttpClient cliente = new AsyncHttpClient();\n cliente.setMaxRetriesAndTimeout(0, 10000);\n\n RequestParams parametros = new RequestParams();\n parametros.put(\"account\", UserName);\n parametros.put(\"apikey\", Apikey);\n parametros.put(\"date\", Date);\n parametros.put(\"hour\", Hour);\n parametros.put(\"minute\", Minute);\n\n cliente.put(this, GenConf.UpdateControlsURL, parametros, new JsonHttpResponseHandler() {\n @Override\n public void onStart() {\n mdialog.show();\n super.onStart();\n }\n\n @Override\n public void onFinish() {\n mdialog.cancel();\n super.onFinish();\n closed = true;\n CloseActivity();\n }\n });\n }\n catch (Exception e){\n\n }\n }", "public static void m5843o() {\n if (f4669a != null) {\n f4669a.m12578a(\"Web_view_result_scrape_success\", null);\n }\n Answers.getInstance().logCustom(new CustomEvent(\"Web view result scrape success\"));\n }", "@Override\n\t\t\t\t\tpublic void onReqStart() {\n\t\t\t\t\t}", "@Override\n public void onResponse(JSONArray response) {\n loading.dismiss();\n\n json_array = response;\n\n handler.post(new Runnable() {\n @Override\n public void run() {\n\n\n //Displaying our grid\n showGrid(json_array,num);\n }\n });\n }", "@Override\n public void run() {\n JsonArrayRequest jsonArrayRequest = new JsonArrayRequest(DATA_URL,\n new Response.Listener<JSONArray>() {\n @Override\n public void onResponse(JSONArray response) {\n //Dismissing the progressdialog on response\n loading.dismiss();\n\n json_array = response;\n\n handler.post(new Runnable() {\n @Override\n public void run() {\n\n\n //Displaying our grid\n showGrid(json_array,num);\n }\n });\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n mPullRefreshGridView.onRefreshComplete();\n Toast.makeText(getApplicationContext(),\"Connection Error!\",Toast.LENGTH_LONG).show();\n }\n }\n );\n\n //Creating a request queue\n RequestQueue requestQueue = Volley.newRequestQueue(BanglaTopSongGridActivity.this);\n //Adding our request to the queue\n requestQueue.add(jsonArrayRequest);\n }", "private void requestData() {\n Jc11x5Factory.getInstance().getJobPriceList(mHandler);\n }", "private void viewPendingRequests() {\n\n\t}", "protected abstract void onEvent(final AjaxRequestTarget target);", "private void dataSubmission() {\n getPreferences(); // reload all the data\n\n String jsonObjectString = createJsonObject();\n StringBuilder url = new StringBuilder();\n url.append(serverUrl);\n\n if (vslaName == null || numberOfCycles == null || representativeName == null || representativePost == null\n || repPhoneNumber == null || grpBankAccount == null || physAddress == null\n || grpPhoneNumber == null || grpSupportType == null) {\n flashMessage(\"Please Fill all Fields\");\n\n } else if (IsEditing.equalsIgnoreCase(\"1\")) {\n url.append(\"editVsla\");\n new HttpAsyncTaskClass().execute(url.toString(), jsonObjectString);\n saveVslaInformation();\n\n } else { // Creating a new VSLA\n url.append(\"addNewVsla\");\n new HttpAsyncTaskClass().execute(url.toString(), jsonObjectString);\n saveVslaInformation();\n }\n }", "@MainThread\n @Override\n protected void onForceLoad() {\n super.onForceLoad();\n cancelLoadHelper();\n\n makeRequest();\n }", "@Override\n protected void callBackForServerSuccess(HemaNetTask netTask,\n HemaBaseResult baseResult) {\n JhHttpInformation information = (JhHttpInformation) netTask\n .getHttpInformation();\n switch (information) {\n case NOTICE_LIST:\n HemaPageArrayResult<Notice> iResult = (HemaPageArrayResult<Notice>) baseResult;\n ArrayList<Notice> notices1 = iResult.getObjects();\n notices.addAll(iResult.getObjects());\n if (\"0\".equals(currentPage.toString())) {\n layout.refreshSuccess();\n notices.clear();\n notices.addAll(iResult.getObjects());\n if (notices.size() == 0) {\n alert.setVisibility(View.VISIBLE);\n\n } else {\n alert.setVisibility(View.GONE);\n }\n int sysPagesize = getApplicationContext().getSysInitInfo()\n .getSys_pagesize();\n if (notices1.size() < sysPagesize)\n layout.setLoadmoreable(false);\n else\n layout.setLoadmoreable(true);\n //}\n } else {// 更多\n layout.loadmoreSuccess();\n if (notices1.size() > 0)\n this.notices.addAll(iResult.getObjects());\n else {\n layout.setLoadmoreable(false);\n XtomToastUtil.showShortToast(mContext, \"已经到最后啦\");\n }\n }\n freshData();\n break;\n case NOTICE_SAVEOPERATE:\n String keytype = netTask.getParams().get(\"operatetype\");\n String id = netTask.getParams().get(\"keyid\");\n if (\"3\".equals(keytype)) {\n showTextDialog(\"删除成功\");\n }\n currentPage = 0;\n getList(currentPage.toString(), tag);\n break;\n// case task_recieve:\n// getNetWorker().noticeSaveoperate(user.getToken(),\n// currentId,\"2\");\n// break;\n }\n }", "@Override\n public void onResponse(JSONArray response) {\n listExams.clear();\n parseData(response);\n //Hiding the progressbar\n\n }", "void hitModelApi(final String series) {\n views.showProgress(ShopActivity.this);\n\n RequestQueue requestQueue = Volley.newRequestQueue(ShopActivity.this);\n StringRequest request = new StringRequest(Request.Method.POST, Url.getModel, new com.android.volley.Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n Log.d(\"response_model\", response);\n views.hideProgress();\n\n try {\n JSONObject jsonObject = new JSONObject(response);\n\n if (jsonObject.getString(\"code\").equals(\"200\")) {\n JSONArray jsonArray = jsonObject.getJSONArray(\"data\");\n // model_list_dataModel.clear();\n model_list.clear();\n for (int i = 0; i < jsonArray.length(); i++) {\n\n JSONObject jsonObject1 = jsonArray.getJSONObject(i);\n Model_Model model = new Model_Model();\n model.setModel_id(jsonObject1.getString(\"id\"));\n model.setModelName(jsonObject1.getString(\"model_name\"));\n model_list.add(model);\n\n\n }\n\n modelAdapter = new ModelAdapter(getApplicationContext(), R.layout.activity_shop,\n R.id.lbl_name, model_list);\n model_autocompleteTv.setAdapter(modelAdapter);\n }\n\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n }\n }, new com.android.volley.Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n views.hideProgress();\n }\n }) {\n @Override\n protected Map<String, String> getParams() throws AuthFailureError {\n HashMap<String, String> hashMap = new HashMap<>();\n hashMap.put(\"key\", Url.key);\n hashMap.put(\"series_id\", series);\n return hashMap;\n }\n };\n requestQueue.getCache().clear();\n requestQueue.add(request);\n\n\n }", "@Override\n\t\t\tpublic void onLoading(String url, long totalSize, long currentSize, long speed)\n\t\t\t{\n\t\t\t\tsuper.onLoading(url, totalSize, currentSize, speed);\n\t\t\t\tint progress = (int) ((currentSize * 100) / (totalSize));\n\t\t\t\tmNotification.contentView.setProgressBar(R.id.upgradeService_pb, 100, progress, false);\n\t\t\t\tmNotification.contentView.setTextViewText(R.id.upgradeService_tv, progress + \"%\");\n\t\t\t\tmNotificationManager.notify(mNotificationId, mNotification);\n\t\t\t}", "@Override\n\tpublic void onLoadMore() {\n\t\tSimpleDateFormat sdf=new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\", Locale.getDefault());\t\t\n\t\tmAdapterView.setLoadTime(sdf.format(new Date()));\n\t\tmAdapterView.stopLoadMore();\n\t\tFindHttpPost();\n\t}", "private void initControls() {\n Log.e(\"sha1\",sHA1(this));\n\n// back.setOnClickListener(this);\n load_view.setOnRetryListener(new LoadingView.OnRetryListener() {\n @Override\n public void OnRetry() {\n requestCarBrandData();\n }\n });\n }", "@Override\n protected void callBeforeDataBack(HemaNetTask netTask) {\n showProgressDialog(\"加载中\");\n }", "private void doGetSobotInfo() {\n showProgress(\"\");\n RetrofitApiFactory.createApi(MineApi.class)\n .doGetSobotInfo(0, null, null)\n .compose(RxSchedulers.compose())\n .compose((this).bindUntilEvent(ActivityEvent.DESTROY))\n .subscribe(new FastObserver<BaseData<SobotSystemEntity>>(this) {\n\n @Override\n public void onSuccess(BaseData<SobotSystemEntity> data) {\n SobotApiUtils.getInstance().toCustomServicePage(getContext(), UserInfoCache.get(), null, data.getData());\n }\n });\n }", "private void getSqlDetails() {\n\n String url= String.format(\"http://192.168.2.22/hm/api/urunArar.php?searchQuery=\"+urunAydi);\n pd.show();\n StringRequest stringRequest = new StringRequest(Request.Method.GET,\n url,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n\n pd.hide();\n\n\n try {\n\n JSONArray jsonarray = new JSONArray(response);\n\n for(int i=0; i < jsonarray.length(); i++) {\n\n JSONObject jsonobject = jsonarray.getJSONObject(i);\n\n\n String id = jsonobject.getString(\"id\");\n String brand = jsonobject.getString(\"marka\");\n String isim = jsonobject.getString(\"model\");\n String kucukResim = jsonobject.getString(\"kucuk_resim\");\n String imgURL =\"http://192.168.2.22/hm/\"+kucukResim;\n urunAdi.setText(isim);\n urunID.setText(id);\n urunMarka.setText(brand);\n Picasso.get().load(\"http://192.168.2.22/hm/\"+kucukResim).into(urunResmi);\n\n //new DownLoadImageTask(urunResmi).execute(imgURL);\n\n if(urunAdi.toString()!=\"\") {\n\n adetLbl.setVisibility(View.VISIBLE);\n btnCapturePicture.setVisibility(View.VISIBLE);\n urunResmi.setVisibility(View.VISIBLE);\n }\n\n }\n } catch (JSONException e) {\n e.printStackTrace();\n\n\n }\n\n\n\n\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n if(error != null){\n\n Toast.makeText(getApplicationContext(), \"Veri tabanına bağlanılamadı\", Toast.LENGTH_LONG).show();\n }\n }\n }\n\n );\n\n MySingleton.getInstance(getApplicationContext()).addToRequestQueue(stringRequest);\n }", "public static void m5829g() {\n if (f4669a != null) {\n f4669a.m12578a(\"webview_multiple_records_found\", null);\n }\n Answers.getInstance().logCustom(new CustomEvent(\"webview_multiple_records_found\"));\n }", "public void run() {\n\t\t\t\t\t\tint success;\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t// Building Parameters\r\n\t\t\t\t\t\t\tList<NameValuePair> params = new ArrayList<NameValuePair>();\r\n\t\t\t\t\t\t\tparams.add(new BasicNameValuePair(TAG_NAME, \"TempSensor\"));\r\n\t\t\t\t\t\t\t// getting product details by making HTTP request\r\n\t\t\t\t\t\t\t// Note that product details url will use GET request\r\n\t\t\t\t\t\t\tJSONObject json = jsonParser.makeHttpRequest(\r\n\t\t\t\t\t\t\t\t\turl_read_sensor, \"GET\", params);\r\n\t\t\t\t\t\t// check your log for json response\r\n\t\t\t\t\t\t\tLog.d(\"Smart Home\",\"===========sensor value=================\");\r\n\t\t\t\t\t\t\tLog.d(\"Smart Home\",json.toString());\r\n\t\t\t\t\t\t\tString result = \"CurrentValue \" + json.getString(TAG_SENSOR) + \"\\n\";\r\n\t\t\t\t\t\t\twelcome.append(myUI.getStyle(result, 12, 15, \"GREEN\") );\t\t\t\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t\tcatch (Exception e) {\r\n\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}", "@Override\n public void refreshData() {\n\n if (InternetConnection.checkConnection(context)) {\n ApiService apiService = RetroClient.getApiService();\n Call<String> call = apiService.getFactdata();\n Log.e(TAG, \"request ongetData url :\" + call.request().url());\n call.enqueue(new Callback<String>() {\n @Override\n public void onResponse(Call<String> call, Response<String> response) {\n Log.e(TAG, \"response : ongetData :\" + response.body());\n parseResponse(response.body());\n }\n\n @Override\n public void onFailure(Call<String> call, Throwable t) {\n Log.e(TAG, \"onFailure ongetData : \" + t.getMessage());\n }\n });\n } else {\n factDataView.displayMessage(context.getString(R.string.nonetwork), false);\n }\n }", "@Override\n public void onResponse(String response) {\n opprettListe(response);\n }", "@Override\n public void run() {\n String locString =\"javascript:updateUserLocation(\"+ String.valueOf(userLocation.getLatitude()) + \",\" +String.valueOf(userLocation.getLongitude())+ \")\";\n mWebView.loadUrl(locString);\n locString =\"javascript:updateUserAccuracy(\"+ String.valueOf(userLocation.getAccuracy())+ \")\";\n mWebView.loadUrl(locString);\n }", "@Override\n\t\t\tpublic void onRefresh() {\n\t\t\t\tcurPage = 1;\n\t\t\t\tmList.clear();\n\t\t\t\tJiaoYiJiLuExec.getInstance().getTiXianJiLuList(mHandler,\n\t\t\t\t\t\tManagerUtils.getInstance().yjtc.getId(), curPage,\n\t\t\t\t\t\tpageSize, NetworkAsyncCommonDefines.GET_TXJL_LIST_S,\n\t\t\t\t\t\tNetworkAsyncCommonDefines.GET_TXJL_LIST_F);\n\t\t\t}", "@Override\n protected void onProgressUpdate(ResponseInfo... responseInfo) {\n \tif (responseInfo[0].responseCode == 200 | responseInfo[0].responseCode == 201) {\n \t\t//Update the event display - first check for any new devices added\n \tMeshDisplayControllerApplictaion appObject = (MeshDisplayControllerApplictaion)LiveMeshEventControllerActivity.this.getApplicationContext();\n \tMeshDisplayControllerEngine meshDisplayEngine = appObject.getAppMeshDisplayControllerEngine();\n \t\n \t\ttry {\n \t\t\t//First read the JSON response into a new HashMap\n \t\t\t//For large displays this is not particularly efficient and the server should respond with \n \t\t\t//added and deleted clients only, with a full refresh only done periodically. For this proof \n \t\t\t//of concept this is fine.\n \t\t\tJSONArray clientList = responseInfo[0].clientList;\n \t\t\tHashMap<String, MeshDisplayClient> receivedClientsMap = new HashMap<String, MeshDisplayClient>();\n \t\t\tfor (int i = 0; i< clientList.length(); i++) {\n \t\t\t\tMeshDisplayClient receivedClient = new MeshDisplayClient();\n \t\t\t\treceivedClient.id = clientList.getJSONObject(i).getString(\"client_id\").toString();\n \t\t\t\treceivedClient.textToDisplay = clientList.getJSONObject(i).getString(\"client_text\").toString();\n \t\t\t\treceivedClientsMap.put(receivedClient.id, receivedClient);\n \t\t\t}\n \t\t\t\n \t\t\t//Check for anything that is in the Map from the server but not in the engine Map here - this is a \n \t\t\t//new client added\n \t\t\tSet <String> addedClients = new HashSet<String>(receivedClientsMap.keySet());\n \t\t\taddedClients.removeAll(meshDisplayEngine.clientsMap.keySet());\n \t\t\t\n \t\t\tfor (String clientIDToAdd : addedClients) {\n \t\t\t\t//Add this client from the current engine client Map\n \t\t\t\tMeshDisplayClient newClient = receivedClientsMap.get(clientIDToAdd);\n \t\t\t\tmeshDisplayEngine.clientsMap.put(clientIDToAdd, receivedClientsMap.get(clientIDToAdd));\n \t\t\t\t\n \t\t\t\t//Add this client to the display\n \t\t\t\tdisplayNewClient(newClient);\n \t\t\t}\n \t\t\t\n \t\t\t//Now check for anything that is in the current engine clientMap but not the received clientMap\n \t\t\tSet <String> deletedClients = new HashSet<String>(meshDisplayEngine.clientsMap.keySet());\n \t\t\tdeletedClients.removeAll(receivedClientsMap.keySet());\n \t\t\t\n \t\t\tfor (String clientIDToRemove : deletedClients) {\n \t\t\t\t//Remove this client from the current engine client Map\n \t\t\t\tmeshDisplayEngine.clientsMap.remove(clientIDToRemove);\n \t\t\t\t\n \t\t\t\t//Remove this client from the display\n \t\t\t\tremoveClientFromDisplay(clientIDToRemove);\n \t\t\t}\n\t \t\t\n \t\t} catch (JSONException e) {\n\t\t\t\t\t//An Error occurred decoding the JSON\n\t\t\t\t\tLog.d(\"LiveMeshEventControllerActivity PollServerForClients\", \"exception parsing JSON response\");\n\t\t\t\t\te.printStackTrace();\n \t\t}\n\n \t} else {\n \t\t//Log an issue\n \t\tLog.d(\"LiveMeshEventControllerActivity PollServerForClients\",\"-> onProgressUpdate: unexpecetd resposne code: \" + responseInfo[0].responseCode);\n \t}\n }", "@Override\n public void onResponse(String json) {\n parseRefreshResponse(json);\n }", "private void loadData() {\n\n if (mIsLoading) {\n return;\n }\n\n String url = mSiteData.getUrl();\n\n if (!mIsRefreshMode) {\n //if (mMaxPage > 0 && mCurrentPage > mMaxPage) {\n // return;\n //}\n //Log.e(mTag, \"mMaxPage: \" + mMaxPage);\n\n if (mCurrentPage > 1) {\n switch (mSiteData.getId()) {\n case Config.BLOG_ID_AKB48_TEAM8:\n url = url + \"?p=\" + mCurrentPage;\n break;\n case Config.BLOG_ID_NGT48_MANAGER:\n url = url + \"lite/?p=\" + mCurrentPage;\n break;\n case Config.BLOG_ID_SKE48_SELECTED:\n case Config.BLOG_ID_NMB48_OFFICIAL:\n url = url + \"page-\" + mCurrentPage + \".html\";\n break;\n }\n //showToolbarProgressBar();\n }\n }\n\n String userAgent = Config.USER_AGENT_WEB;\n switch (mSiteData.getId()) {\n case Config.BLOG_ID_SKE48_SELECTED:\n case Config.BLOG_ID_NMB48_OFFICIAL:\n case Config.BLOG_ID_NGT48_MANAGER:\n case Config.BLOG_ID_NGT48_PHOTOLOG:\n userAgent = Config.USER_AGENT_MOBILE;\n break;\n }\n\n mIsLoading = true;\n\n if (!mIsFirst && !mIsRefreshMode) {\n mLoLoadingMore.setVisibility(View.VISIBLE);\n }\n\n //Log.e(mTag, url);\n requestData(url, userAgent);\n }", "private void checkMandatory(final String slid) {\n\n\n StringRequest stringRequest = new StringRequest(Request.Method.POST, ApiUrl.CHECK_MANDATORY_URL, new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n\n Log.e(\"mandatory\", response);\n try {\n\n JSONArray jsonArray = new JSONArray(response);\n\n if (jsonArray.length() == 0) {\n\n tvNoMetaFound.setVisibility(View.VISIBLE);\n\n } else {\n\n tvNoMetaFound.setVisibility(View.GONE);\n for (int i = 0; i < jsonArray.length(); i++) {\n\n String fieldname = jsonArray.getJSONObject(i).getString(\"field_name\");\n String size = jsonArray.getJSONObject(i).getString(\"length_data\");\n String mandatorystatus = jsonArray.getJSONObject(i).getString(\"mandatory\");\n String datatype = jsonArray.getJSONObject(i).getString(\"data_type\");\n\n //5 times\n createDynamicView(fieldname, size, mandatorystatus, datatype);\n\n\n }\n\n\n }\n\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n\n }\n }) {\n\n @Override\n protected Map<String, String> getParams() {\n\n Map<String, String> params = new HashMap<String, String>();\n\n params.put(\"slid\", slid);\n\n\n return params;\n }\n };\n\n VolleySingelton.getInstance(getActivity()).addToRequestQueue(stringRequest);\n }", "protected void onEndRequest()\n\t{\n\t}", "@Override\r\n\t\tpublic void run() {\n\t\t\tString httpresponse = new String();\r\n\t\t\t// for (int i = 0; i < 10; i++) {\r\n\t\t\thttpresponse = HTTPGetInfo();\r\n\t\t\ttry {\r\n\t\t\t\tJSONparser(httpresponse);\r\n\t\t\t} catch (JSONException e) {\r\n\t\t\t\t// TODO 自动生成的 catch 块\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}", "private void OTP_Matchapi() {\n\n final ProgressDialog progressDialog = new ProgressDialog(Vendor_Booking_ConfirmDetails.this);\n progressDialog.setTitle(\"Loading..\");\n progressDialog.show();\n String url = BaseUrl + OTP_MATCH_by_vendor_usergiven;\n AndroidNetworking.post(url)\n .addBodyParameter(\"otp\", otp)\n .addBodyParameter(\"bookingId\", id)\n .addBodyParameter(\"vendor_id\", vid)\n .setPriority(Priority.MEDIUM)\n .build()\n .getAsJSONObject(new JSONObjectRequestListener() {\n @Override\n public void onResponse(JSONObject jsonObject) {\n\n System.out.println(\"booking_match_otp --- \" + \"otp \" + otp + \" bookid \" + id + \" vendor_id \" + vid);\n progressDialog.dismiss();\n try {\n\n String result = jsonObject.getString(\"job_status\");\n String msg = jsonObject.getString(\"start_time\");\n\n if (result.equalsIgnoreCase(\"Inprogress\")) {\n Log.e(\"otpmatchapiresponce- \", jsonObject.toString());\n progressDialog.dismiss();\n Startbooking();\n alertDialog.dismiss();\n } else {\n progressDialog.dismiss();\n alertDialog.dismiss();\n\n\n }\n\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n }\n\n @Override\n public void onError(ANError anError) {\n Log.e(\"error_my_join\", anError.toString());\n\n\n }\n });\n\n\n }", "private void districtApiCall() {\n\n waitingDialog = new SpotsDialog(Shared_AssessmentSearch.this);\n waitingDialog.show();\n waitingDialog.setCancelable(false);\n String REQUEST_TAG = \"apiDistrictDetails_Request\";\n\n JsonArrayRequest apiDistrictDetails_Request = new JsonArrayRequest(Request.Method.GET, API_DISTRICT_DETAILS, null, new Response.Listener<JSONArray>() {\n @Override\n public void onResponse(final JSONArray response) {\n\n new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n Log.e(TAG, response.toString());\n\n if (!response.isNull(0)) {\n for (int i = 0; i < response.length(); i++) {\n\n JSONObject district_jsonObject = response.getJSONObject(i);\n\n mDistrictId = district_jsonObject.getString(\"DistrictId\");\n mDistrictName = district_jsonObject.getString(\"DistrictName\");\n\n mDistrictHashmapitems.put(Integer.parseInt(mDistrictId), mDistrictName);\n\n mDistrictList.add(mDistrictName);\n }\n\n } else Snackbar.make(rootlayout, \"Error\", Snackbar.LENGTH_SHORT).show();\n\n waitingDialog.dismiss();\n\n } catch (JSONException e) {\n e.printStackTrace();\n\n Snackbar.make(rootlayout, e.getMessage(), Snackbar.LENGTH_SHORT).show();\n\n waitingDialog.dismiss();\n }\n }\n }).start();\n\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n VolleyLog.e(TAG, \"Error: \" + error.getMessage());\n Log.e(TAG, error.toString());\n\n waitingDialog.dismiss();\n if (error instanceof TimeoutError || error instanceof NoConnectionError) {\n\n SnackShowTop(\"Time out\", rootlayout);\n\n } else if (error instanceof AuthFailureError) {\n\n SnackShowTop(\"Connection Time out\", rootlayout);\n\n } else if (error instanceof ServerError) {\n\n SnackShowTop(\"Could not connect server\", rootlayout);\n\n } else if (error instanceof NetworkError) {\n\n SnackShowTop(\"Please check the internet connection\", rootlayout);\n\n } else if (error instanceof ParseError) {\n\n SnackShowTop(\"Parse Error\", rootlayout);\n\n } else {\n\n SnackShowTop(error.getMessage(), rootlayout);\n\n }\n }\n }) {\n @Override\n public Map<String, String> getHeaders() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"accesstoken\", ACCESS_TOKEN);\n\n return params;\n }\n };\n AppSingleton.getInstance(getApplicationContext()).addToRequestQueue(apiDistrictDetails_Request, REQUEST_TAG);\n\n }", "@Override\n\t\tpublic void onRefresh() {\n\t\t\thttpRefreshMethod();\n\t\t}", "@Override\n public void success(Object object, String msg) {\n if (object != null && object instanceof GetAdList) {\n GetAdList list = (GetAdList) object;\n Log.e(\"lbb\", \"---------3-------0-2-\");\n if (list != null && list.data != null && list.data.size() >= 0) {\n BaseApplication.mInstance.imageIdList3 = list.data;\n adLists = list.data;\n try {\n setTV();\n BaseApplication.mInstance.context.sendBroadcast(new Intent(ACTION_GetAdList3));\n } catch (Exception e) {\n e.printStackTrace();\n }\n //getActivity().sendBroadcast(new Intent(ACTION_GetAdList3));\n SharedPreUtil.putStringValue(getActivity(), ACTION_GetAdList3, new JsonBuild().setModel(object).getJson1());\n Log.e(\"lbb\", \"---------3-----1-2---\");\n }\n }\n }", "@Override\n public void initData() {\n super.initData();\n\n RetrofitService.getInstance()\n .getApiCacheRetryService()\n .getDetail(appContext.getWenDang(Const.Detail, wendangid))\n .enqueue(new SimpleCallBack<WenDangMode>() {\n @Override\n public void onSuccess(Call<WenDangMode> call, Response<WenDangMode> response) {\n if (response.body() == null) return;\n WenDangMode data = response.body();\n title_text.setText(data.getPost().getPost_title());\n String s = data.getPost().getPost_excerpt();\n excerpt_text.setText(s.replaceAll(\"[&hellip;]\", \"\"));\n wendang_text.setText(stripHtml(data.getPost().getPost_content()));\n url = data.getPost().getDownload_page();\n list.clear();\n\n list = quChu(getImgStr(data.getPost().getPost_content()));\n\n adapter.bindData(true, list);\n//\t\t\t\t\t\trecyclerView.notifyMoreFinish(true);\n rootAdapter.notifyDataSetChanged();\n beautifulRefreshLayout.finishRefreshing();\n }\n });\n }", "@Override\n public void onSuccess(int statusCode, Header[] headers, JSONObject data) {\n pd.hide();\n try {\n JSONArray arrayBrands = data.getJSONArray(\"data\");\n\n\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n pd.hide();\n Toast.makeText(RatingActivity.this, \"Terimakasih telah menggunakan layanan kami\",\n Toast.LENGTH_LONG).show();\n Intent intent = new Intent(RatingActivity.this, MainActivity.class);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(intent);\n\n finish();\n }", "public void onRefresh() {\n\t\t\t\tnew AsyncTask<Void, Void, Void>() {\r\n\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tprotected Void doInBackground(Void... params) {\r\n\t\t\t\t\t\tlist.clear();\r\n\t\t\t\t\t\tnew Getliuyan().start();\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tprotected void onPostExecute(Void result) {\r\n\t\t\t\t\t\thandler.sendEmptyMessage(2);\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t}.execute();\r\n\t\t\t}", "@Override\n protected void onStartLoading() {\n if (idlingResource != null) {\n idlingResource.setIdleState(false);\n }\n\n if (recepts != null) {\n deliverResult(recepts);\n } else {\n mLoadingIndicator.setVisibility(View.VISIBLE);\n forceLoad();\n }\n }" ]
[ "0.6168905", "0.60722804", "0.59428793", "0.57372093", "0.57323694", "0.57114106", "0.563447", "0.56002396", "0.5596802", "0.55905086", "0.5579135", "0.55782986", "0.5573137", "0.55724967", "0.5543111", "0.55405354", "0.5496946", "0.54862523", "0.5474093", "0.54698735", "0.5452215", "0.5424199", "0.542131", "0.5418755", "0.5416777", "0.54165125", "0.53991514", "0.53856975", "0.5372696", "0.5369027", "0.535719", "0.5348177", "0.53470546", "0.53408235", "0.5339244", "0.53302634", "0.5327023", "0.5322352", "0.5321196", "0.5321136", "0.5318947", "0.53105867", "0.5310379", "0.53090954", "0.53076863", "0.5297518", "0.5296705", "0.5290321", "0.5284338", "0.5283124", "0.5281151", "0.52802217", "0.5277533", "0.52498823", "0.5248503", "0.5243613", "0.5243613", "0.52417976", "0.5240993", "0.52236295", "0.522255", "0.5212421", "0.5199511", "0.5197108", "0.5195979", "0.51863307", "0.5180679", "0.51802623", "0.5179762", "0.517411", "0.51699996", "0.5169198", "0.51686734", "0.5168312", "0.5165205", "0.5164033", "0.5163481", "0.5161679", "0.5160326", "0.5159108", "0.51580805", "0.5157359", "0.51557785", "0.5153455", "0.5143398", "0.5143185", "0.51419055", "0.51409394", "0.51405156", "0.5139105", "0.51376754", "0.5132297", "0.5129289", "0.5129159", "0.51278365", "0.5121051", "0.5120932", "0.5119675", "0.5119258", "0.5114303", "0.5109631" ]
0.0
-1
Created by yangxiong on 2018/4/22/022.
public interface ILoginView { void showProgress(); void hideProgress(); void setUsernameError(); void setPasswordError(); void navigateToHome(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\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 comer() {\n\t\t\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "public final void mo51373a() {\n }", "@Override\n\tprotected void getExras() {\n\n\t}", "private void poetries() {\n\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n void init() {\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tprotected void interr() {\n\t}", "private void strin() {\n\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public void mo38117a() {\n }", "@Override\n public void init() {\n }", "private void init() {\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 memoria() {\n \n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n protected void getExras() {\n }", "public void mo4359a() {\n }", "@Override\n protected void initialize() \n {\n \n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\n public void init() {}", "private void kk12() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tpublic void sacrifier() {\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 public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\r\n\tpublic void init() {}", "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 protected void init() {\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "public void mo6081a() {\n }", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "private void init() {\n\n\n\n }", "private Rekenhulp()\n\t{\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\n\tpublic void init() {\n\t}", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "private void m50366E() {\n }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n\tprotected void initdata() {\n\n\t}", "public void mo55254a() {\n }", "@Override\n\tpublic void one() {\n\t\t\n\t}", "Petunia() {\r\n\t\t}", "@Override\n public void initialize() {\n \n }", "protected boolean func_70814_o() { return true; }", "@Override\n\tpublic void emprestimo() {\n\n\t}", "private zza.zza()\n\t\t{\n\t\t}", "@Override\n\t\tpublic void init() {\n\t\t}", "@Override\n public void initialize() { \n }" ]
[ "0.5949967", "0.5892733", "0.57048285", "0.57048285", "0.5677127", "0.565009", "0.56455433", "0.5641377", "0.5609627", "0.55813515", "0.5514394", "0.551135", "0.5493289", "0.54800606", "0.54792297", "0.5460331", "0.544987", "0.54459745", "0.5439848", "0.54396296", "0.54354715", "0.5423766", "0.5419712", "0.54190415", "0.5417672", "0.5416458", "0.5412241", "0.54086804", "0.540816", "0.5393997", "0.5393997", "0.5393997", "0.5393997", "0.5393997", "0.53871286", "0.53868055", "0.5360895", "0.53568995", "0.53430176", "0.5339932", "0.5339932", "0.5339932", "0.5339932", "0.5339932", "0.5339932", "0.5333951", "0.5325666", "0.5325666", "0.5325007", "0.5325007", "0.5325007", "0.53219503", "0.53059727", "0.5304924", "0.5304257", "0.5298385", "0.52983147", "0.52983147", "0.52983147", "0.5296959", "0.5296959", "0.5296658", "0.52943605", "0.52943605", "0.52943605", "0.52943605", "0.52943605", "0.52943605", "0.52943605", "0.52840805", "0.52514845", "0.52514845", "0.52477956", "0.524482", "0.524482", "0.524482", "0.52409035", "0.5240594", "0.52142197", "0.52140003", "0.52094793", "0.52078605", "0.52071726", "0.52034396", "0.51974165", "0.519712", "0.51940376", "0.5185355", "0.518382", "0.51814175", "0.5177341", "0.51748186", "0.517098", "0.5157765", "0.5149046", "0.5147774", "0.5146916", "0.5142147", "0.5141586", "0.5140794", "0.5138145" ]
0.0
-1
Returns the next element in the iteration without advancing the iterator.
public Integer peek() { if (list == null || list.size() == 0) { return -1; } return list.peek(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Integer next() {\n if (!isPeeked && hasNext())\n return iterator.next();\n int toReturn = peekedElement;\n peekedElement = -1;\n isPeeked = false;\n return toReturn;\n }", "Object getNextElement() throws NoSuchElementException;", "@Override\n public Integer next() {\n if (next != null) {\n Integer next = this.next;\n this.next = null;\n return next;\n\n }\n\n return iterator.next();\n }", "public T next() {\n\t\t\tif (hasNext()) {\n\t\t\t\tT nextItem = elements[index];\n\t\t\t\tindex++;\n\t\t\t\t\n\t\t\t\treturn nextItem;\n\t\t\t}\n\t\t\telse\n\t\t\t\tthrow new java.util.NoSuchElementException(\"No items remaining in the iteration.\");\n\t\t\t\n\t\t}", "private E next() {\n\t\tif (hasNext()) {\n\t\t\tE temp = iterator.data;\n\t\t\titerator = iterator.next;\n\t\t\treturn temp;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public Object nextElement() {\n/* 75 */ return this.iterator.next();\n/* */ }", "@Override\n public Integer next() {\n if (next == null) {\n throw new NoSuchElementException();\n }\n Integer toReturn = next;\n next = null;\n if (peekingIterator.hasNext()) {\n next = peekingIterator.next();\n }\n return toReturn;\n }", "@Override\n public Integer next() {\n Integer result = null;\n if (checkCurrentIterator(this.currentIterator) && this.currentIterator.hasNext()) {\n while (this.currentIterator.hasNext()) {\n return this.currentIterator.next();\n }\n } else if (it.hasNext()) {\n this.currentIterator = getIterator(it);\n return this.next();\n }\n return result;\n }", "public Object next()\n/* */ {\n/* 93 */ if (this.m_offset < this.m_array.length) {\n/* 94 */ Object localObject = this.m_array[this.m_offset];\n/* 95 */ advance();\n/* 96 */ return localObject;\n/* */ }\n/* 98 */ throw new NoSuchElementException();\n/* */ }", "public T getNextElement();", "@Override\n\tpublic Item next() {\n\t\tindex = findNextElement();\n\n\t\tif (index == -1)\n\t\t\treturn null;\n\t\treturn items.get(index);\n\t}", "public E next()\n\t{\n\t\treturn (vector.get(curr++));\n\t}", "public T next() {\r\n if\t(!hasNext()) {\r\n throw new NoSuchElementException();\r\n }\r\n return items[now++];\r\n }", "public T nextElement() {\r\n\t\treturn items[currentObject++];\r\n \t}", "public Object next()\n/* */ {\n/* 84 */ if (this.m_offset < this.m_limit) {\n/* 85 */ return this.m_array[(this.m_offset++)];\n/* */ }\n/* 87 */ throw new NoSuchElementException();\n/* */ }", "@Override\n public Integer next() {\n if (cur != null) {\n int temp = cur.intValue();\n cur = null;\n return temp;\n }\n\n if (iter.hasNext()) {\n return iter.next();\n }\n\n return null;\n }", "@Override\n public T next() {\n T n = null;\n if (hasNext()) {\n // Give it to them.\n n = next;\n next = null;\n // Step forward.\n it = it.next;\n stop -= 1;\n } else {\n // Not there!!\n throw new NoSuchElementException();\n }\n return n;\n }", "public Object next()throws NullPointerException\r\n {\r\n if(hasNext())\r\n return e.get(index+1);\r\n else\r\n throw new NullPointerException();\r\n }", "public T getNext(T element);", "public Object next()\n {\n return _iterator.next();\n }", "@Override\n public Integer next() {\n Integer res = next;\n advanceIter();\n return res;\n }", "public E getNext() {\n\t\tif (!super.isEmpty()) {\n\t\t\tif (index >= this.size() - 1)\n\t\t\t\tindex = -1;\n\t\t\treturn this.get(++index);\n\t\t}\n\t\treturn null;\n\t}", "public K next()\n {\n\tif (hasNext()) {\n\t K element = current.data();\n\t current = current.next(0);\n\t return element; \n\t} else {\n\t return null; \n\t}\n }", "@Override\n\tpublic Integer next() {\n\t return iterator.next();\n\t}", "public T next() {\n\t\t\tif(hasNext()) {\n\t\t\t\tT temp = vector.elementAt(nextPosition);\n\t\t\t\tnextPosition--;\n\t\t\t\tpreviousPosition--;\n\t\t\t\treturn temp;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new NoSuchElementException(\"The iterator has already reached the end\");\n\t\t\t}\n\t\t\t\n\t\t}", "public final T next()\n {\n return skip(1);\n }", "@Override\n public Integer next() {\n if(peekedVal != null ){\n Integer next = peekedVal;\n peekedVal = null;\n return next;\n }\n if(!iter.hasNext()){\n throw new NoSuchElementException();\n }\n return iter.next();\n\n }", "public Object next()\n {\n if(!hasNext())\n {\n throw new NoSuchElementException();\n //return null;\n }\n previous= position; //Remember for remove;\n isAfterNext = true; \n if(position == null) \n {\n position = first;// true == I have not called next \n }\n else\n {\n position = position.next;\n }\n return position.data;\n }", "public E next() {\n int index = 0;\n\n // iterating over collections\n for (Collection<E> coll : collectionList) {\n // checking if current collection contains the desired element (i.e. itrCounter falls in coll)\n if (coll.size() <= itrCounter - index)\n // desired index doesn't lie in current collection -> skipping all elements\n index += coll.size();\n // current collection contains desired element\n else {\n // finding desired element; iterating over coll\n for (E element : coll){\n // desired index found -> increment itrCounter and return element\n if (index == itrCounter) {\n itrCounter++;\n return element;\n }\n // desired index not reached yet -> increment index\n else index++;\n }\n }\n }\n // could not find next element\n throw new NoSuchElementException();\n }", "public T next(){\r\n return itrArr[position++];\r\n }", "@Override\n public Item next() {\n if(!hasNext()) throw new NoSuchElementException(\"Failed to perform next because hasNext returned false!\");\n Item item = current.data;\n current = current.next;\n return item;\n }", "public AIter next() {\n int p;\n return (p = start + 1) < size ? new Iter(p) : null;\n }", "public E next() {\r\n current++;\r\n return elem[current];\r\n }", "@Override\n public E next() {\n this.modificationCheck();\n E result;\n if (this.position != SimpleArrayList.this.index) {\n result = (E) values[position++];\n } else {\n throw new NoSuchElementException(\"No more suitable elements!\");\n }\n return result;\n }", "public Item next(){\n if(current==null) {\n throw new NoSuchElementException();\n }\n\n Item item = (Item) current.item;\n current=current.next;\n return item;\n }", "public E next() \n throws NoSuchElementException {\n if (entries != null && \n size > 0 &&\n position > 0 &&\n position < size) {\n E element = entries[position];\n position++;\n return element;\n } else {\n throw new NoSuchElementException(); \n } \n \n }", "public Object getNext() { \t\n\t\t\tcurrIndex++;\t \n\t\t\treturn collection.elementAt(currIndex);\n\t\t}", "public E next()\n {\n if (hasNext())\n {\n E item = currentNode.data();\n currentNode = currentNode.next();\n count--;\n return item;\n }\n else\n {\n throw new NoSuchElementException(\"There isnt another element\");\n\n }\n }", "public Item next() {\n\t\t\tif (!hasNext())\n\t\t\t\treturn null;\n lastAccessed = current;\n Item item = current.item;\n current = current.next; \n index++;\n return item;\n\t\t}", "public T getNext() {\n\n // Create a new item to return\n T nextElement = getInstance();\n\n // Check if there are any more items from the list\n if (cursor <= arrayLimit) {\n nextElement = collection.get(cursor);\n cursor++;\n } else {\n // There are no more items - set to null\n nextElement = null;\n }\n\n // Return the derived item (will be null if not found)\n return nextElement;\n }", "@Override\n public E next() {\n if (hasNext() == false) {\n throw new NoSuchElementException();\n }\n return this.array[this.index++];\n }", "public E next() throws NoSuchElementException\n {\n E retElement = null;\n if(hasNext() == true)\n {\n retElement = arrayList.get(index);\n index++;\n }\n else\n { throw new NoSuchElementException(); }\n return retElement;\n }", "private Object getNextElement()\n {\n return __m_NextElement;\n }", "public E next() {\r\n\r\n\t\tE result = null;\r\n\t\tif (hasNext()) {\r\n\t\t\tresult = links.get(counter);\r\n\t\t\tcounter++;\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public Item next() {\r\n if (!hasNext()) throw new NoSuchElementException();\r\n lastAccessed = current;\r\n Item item = current.item;\r\n current = current.next;\r\n index++;\r\n return item;\r\n }", "public T next()\r\n { \r\n if (next == null)\r\n throw new NoSuchElementException(\"Attempt to\" +\r\n \" call next when there's no next element.\");\r\n\r\n prev = next;\r\n next = next.next;\r\n return prev.data;\r\n }", "@Override\n public Resource next() {\n if (wrapped == null || !wrapped.hasNext()) {\n throw new NoSuchElementException();\n }\n failFast(this);\n try {\n return wrapped.next();\n } finally {\n if (!wrapped.hasNext()) {\n wrapped = null;\n remove(this);\n }\n }\n }", "public E next() {\n if (nextIndex >= set.count)\n throw new NoSuchElementException();\n\n canRemove = true;\n\n return set.data[nextIndex++];\n }", "@Override\n public T next() {\n if (nextItem == null)\n throw new NoSuchElementException();\n T item = nextItem;\n lastItem = nextItem;\n remainingItemCount.decrement();\n if (remainingItemCount.isZero())\n getNextReady();\n return item;\n }", "public T next(){\n if (hasNext())\n return (T)VectorGeneric.this.vec[index++];\n throw new NoSuchElementException(\"Index out of bounds!\");\n \n }", "@Override\r\n public T next() {\r\n if (hasNext()) {\r\n node = node.next();\r\n nextCalled = true;\r\n return node.getData();\r\n }\r\n else {\r\n throw new NoSuchElementException(\"Illegal call to next(); \"\r\n + \"iterator is after end of list.\");\r\n }\r\n }", "public E next() throws NoSuchElementException{\n\t\tPosition<E> aux=actual;\n\t\tif (aux == null) \n\t\t\tthrow new NoSuchElementException();\t\t\n\t\tthis.avanzar();\n\t\treturn aux.element();\n\t}", "@Nonnull\n public Optional<ENTITY> next()\n {\n currentItem = Optional.of(items.get(++index));\n update();\n return currentItem;\n }", "public T next(){\r\n\t\t\tif (expectedModCount != modCount){\r\n\t\t\t\tthrow new ConcurrentModificationException();\r\n\t\t\t}\r\n\t\t\tT passed = current;\r\n\t\t\tif ((currentNode.next==endMarker)&&(currentNode.getLast()==current)){\r\n\t\t\t\tcurrentNode = endMarker;\r\n\t\t\t\tcurrent = null;\r\n\t\t\t\treturn passed;\r\n\t\t\t}\r\n\t\t\tif (currentNode.indexOf(current)==currentNode.getArraySize()-1){\r\n\t\t\t\tcurrentNode = currentNode.next;\r\n\t\t\t\tcurrent = currentNode.getFirst();\r\n\t\t\t\tidx = 0;\r\n\t\t\t\treturn passed;\r\n\t\t\t}\t\r\n\t\t\tidx++;\r\n\t\t\tcurrent = currentNode.get(idx);\r\n\t\t\treturn passed;\r\n\t\t}", "@Override\n public Integer next() {\n if (!hasNext()) {\n throw new NoSuchElementException(\"The iteration has no more elements.\");\n }\n currentPrime = getNextPrime(currentPrime);\n counter++;\n return currentPrime;\n }", "@Override\n public T next() {\n setCurrent();\n T returnValue = current;\n current = null;\n elementToRemove = returnValue;\n return returnValue;\n }", "@Override\r\n\tpublic T next() throws NoSuchElementException{\n\t\tif (hasNext()) {\r\n\t\t\tT curr = next.getData();\r\n\t\t\tnext = next.getNext();\r\n\t\t\treturn curr;\r\n\t\t}\r\n\t\telse throw new NoSuchElementException();\r\n\t\t\r\n\t}", "public Item next() throws NoSuchElementException {\n if (isEmpty()) {\n throw new NoSuchElementException(\"Cannot retrieve item from empty deque\");\n }\n Item item = current.getItem(); //item = current item to be returned\n current = current.getNext();\n return item;\n }", "@SuppressWarnings(\"unchecked cast\")\n @Override\n public T next() {\n if (!hasNext()) {\n throw new NoSuchElementException();\n }\n lastNext = heap[cursor++];\n return (T) lastNext;\n }", "@Override\n public E next() {\n if(!hasWork()) {\n throw new NoSuchElementException();\n }\n E tmp = array[front];\n array[front] = null;\n size--;\n front = (front + 1) % capacity();\n return tmp;\n }", "public V next()\n {\n if (hasNext())\n {\n V currentEntry = arrayDictionary.dictionary[cursor].getValue();\n cursor++;\n nextEntry = currentEntry;\n return currentEntry;\n } \n else\n throw new NoSuchElementException();\n // end if\n }", "public void nextHard() {\n\t\titerator.next();\n\t}", "Element nextElement () {\n\t\treturn stream.next();\n\t}", "public E next() {\n\t\t\tif (mIterModCount != modCount) {\n\t\t\t\tSystem.out.println( mIterModCount + \" : \" + modCount);\n\t\t\t\tthrow new ConcurrentModificationException();\n\t\t\t}\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new java.util.NoSuchElementException();\n\t\t\tmLastNodeReturned = mCurrentNode;\n\t\t\tmCurrentNode = mCurrentNode.next;\n\t\t\tmCurrentIndex++;\n\t\t\tmLastIteration = NEXT;\n\t\t\treturn mLastNodeReturned.data;\n\t\t}", "@Override\r\n\t\tpublic Item next() {\r\n\t\t\tif (!hasNext()) {\r\n\t\t\t\tthrow new NoSuchElementException();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn queue[index[i++]];\r\n\t\t\t}\r\n\t\t}", "public T next() {\n return cur.next();\n }", "public ListElement<T> getNext()\n\t{\n\t\treturn next;\n\t}", "public T next()\n {\n T data = current.item;\n current = current.next;\n return data;\n }", "@SuppressWarnings(\"unchecked\")\n\t\tpublic T next() throws NoSuchElementException {\n\t\t\ttry {\n\t\t\t\tT object = (T)data[pinnedRow * numCols + cursor];\n\t\t\t\tlastRet = cursor++;\n\t\t\t\treturn object;\n\t\t\t} catch ( IndexOutOfBoundsException e ) {\n\t\t\t\tthrow new NoSuchElementException( \"You have iterated past the last element.\" + e.toString() );\n\t\t\t}\n\t\t}", "public Integer next() {\n if (list.isEmpty()){\n return iterator.next();\n }else {\n Integer integer = list.get(list.size() - 1);\n list.remove(list.size()-1);\n return integer;\n }\n\n }", "public Item next() throws XPathException {\n while (true) {\n NodeInfo next = (NodeInfo)iterator.next();\n if (next == null) {\n current = null;\n position = -1;\n return null;\n }\n if (current != null && next.isSameNodeInfo(current)) {\n continue;\n } else {\n position++;\n current = next;\n return current;\n }\n }\n }", "@SuppressWarnings(\"unchecked\")\n\t\tpublic T next() throws NoSuchElementException {\n\t\t\ttry {\n//\t\t\t\tT object = (T)data[cursor * numCols + pinnedColumn];\n\t\t\t\tT object = get(cursor, pinnedColumn);\n\t\t\t\tlastRet = cursor++;\n\t\t\t\treturn object;\n\t\t\t} catch ( IndexOutOfBoundsException e ) {\n\t\t\t\tthrow new NoSuchElementException( \"You have iterated past the last element.\" + e.toString() );\n\t\t\t}\n\t\t}", "public T next() {\n return array[current++];\n }", "@Override\n public Map.Entry<K, V> next() {\n if (iter.hasNext()) {\n \n lastItemReturned = iter.next();\n return lastItemReturned;\n } else {\n throw new NoSuchElementException();\n }\n }", "public abstract T next() throws NoSuchElementException;", "public BSCObject next()\n {\n if (ready_for_fetch)\n {\n // the next sibling is waiting to be returned, so just return it\n ready_for_fetch = false;\n return sibling;\n }\n else if (hasNext())\n {\n // make sure there is a next sibling; if so, return it\n ready_for_fetch = false;\n return sibling;\n }\n else\n throw new NoSuchElementException();\n }", "public T next()\n\t\t{\n\t\t\tif(hasNext())\n\t\t\t{\n\t\t\t\tT currentData = current.getData(); //the data that will be returned\n\t\t\t\t\n\t\t\t\t// must continue to keep track of the Node that is in front of\n\t\t\t\t// the current Node whose data is must being returned , in case\n\t\t\t\t// its nextNode must be reset to skip the Node whose data is\n\t\t\t\t// just being returned\n\t\t\t\tbeforePrevious = previous;\n\t\t\t\t\n\t\t\t\t// must continue keep track of the Node that is referencing the\n\t\t\t\t// data that was just returned in case the user wishes to remove()\n\t\t\t\t// the data that was just returned\n\t\t\t\t\n\t\t\t\tprevious = current; // get ready to point to the Node with the next data value\n\t\t\t\t\n\t\t\t\tcurrent = current.getNext(); // move to next Node in the chain, get ready to point to the next data item in the list\n\t\t\t\t\n\t\t\t\tthis.removeCalled = false;\n\t\t\t\t// it's now pointing to next value in the list which is not the one that may have been removed\n\t\t\t\t\n\t\t\t\treturn currentData;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\t}\n\t\t}", "public T next() {\n T temp = this.curr.getData();\n this.curr = this.curr.getNext();\n return temp;\n }", "@SuppressWarnings(\"unchecked\")\n\t\tpublic T next() throws NoSuchElementException {\n\n\t\t\ttry {\n\n//\t\t\t\tT object = (T)data[currentRow * numCols + currentColumn];\n\t\t\t\tT object = get(currentRow, currentColumn);\n\n\t\t\t\tcurrentRow++;\n\t\t\t\tif ( currentRow == numRows ) {\n\t\t\t\t\tcurrentRow = 0;\n\t\t\t\t\tcurrentColumn++;\n\t\t\t\t}\n\n\t\t\t\tlastRet = cursor++;\n\t\t\t\treturn object;\n\t\t\t} catch ( IndexOutOfBoundsException e ) {\n\t\t\t\tthrow new NoSuchElementException( \"You have iterated past the last element. \" + e.toString() );\n\t\t\t}\n\n\t\t}", "public T next() {\n T temp = this.curr.next.getData();\n this.curr = this.curr.next;\n return temp;\n }", "public Integer peek() {\n if (next != null) {\n return next;\n }\n\n if (iterator.hasNext()) {\n next = iterator.next();\n return next;\n }\n\n return null;\n }", "@Override\n\t\tpublic Item next() {\n\t\t\tItem item=current.item;\n\t\t\tcurrent=current.next;\n\t\t\treturn item;\n\t\t}", "public IndexRecord getIteratorNext() {\n iter = (iter == next - 1 ? -1: iter + 1);\n return (iter == -1 ? null : data[iter]);\n }", "public Pixel next() {\n\t\treturn (isEmpty()) ? null : iterator().next();\n\t}", "public void next() {\n\t\titerator.next();\n\t}", "@Override\n public E next() throws NoSuchElementException {\n if (j == size) throw new NoSuchElementException(\"No next element\");\n removable = true; // this element can subsequently be removed\n return data[j++]; // post-increment j, so it is ready for future call to next\n }", "public Element<T> getNextElement() \n\t{\n\t\treturn nextElement;\n\t}", "private int findNextElement() {\n\t\tif (hasNext()) {\n\t\t\tint value = this.index + 1;\n\t\t\treturn value;\n\n\t\t}\n\t\treturn -1;\n\t}", "public T next(){\n return (T)data[ci++];\n }", "@Override\r\n\t\tpublic Item next() {\r\n\t\t\treturn arr[index++];\r\n\t\t}", "public I next(){\n return (I) listI.get(index++);\n }", "@Override\n\t\tpublic T next() {\n\t\t\tmoveToNextIndex();\n\t\t\treturn objectAtIndex(_indicesByInsertOrder[_index]);\n\t\t}", "public Record next() {\n if (hasNext()) {\n if (nextRecord != null) {\n Record out = nextRecord;\n nextRecord = null;\n return out;\n }\n }\n throw new NoSuchElementException();\n //throw new UnsupportedOperationException(\"hw3: TODO\");\n }", "@Override\r\n\t\tpublic E next() {\n\t\t\tcaret = caret.next();\r\n\t\t\tif (caret == null)\r\n\t\t\t\tthrow new NoSuchElementException();\r\n\t\t\tnextIndex++;\r\n\t\t\treturn caret.n.data[caret.idx];\r\n\t\t}", "@Override\n public E next() {\n if(!hasWork()) {\n throw new NoSuchElementException(\"The worklist is empty\");\n }\n E work = array[front];\n if(front + 1 == array.length) {\n front = 0;\n } else {\n front++;\n }\n size--;\n return work;\n }", "@Override\n public E next() throws NoSuchElementException{\n lastItem = it.next();\n nextCount++;\n return(lastItem);\n }", "@Override\n public E next() {\n if (this.hasNext()) {\n curr = curr.nextNode;\n return curr.getData();\n }\n else {\n throw new NoSuchElementException();\n }\n }", "public T next() {\r\n if (!hasNext()) {\r\n throw new NoSuchElementException();\r\n }\r\n \r\n Random r = new Random();\r\n int rValue = r.nextInt(length);\r\n T next = items[rValue];\r\n // Switch rValue with last item if it is not last item\r\n if (rValue != (length - 1)) {\r\n items[rValue] = items[length - 1];\r\n items[length - 1] = next;\r\n }\r\n length--;\r\n return next;\r\n }", "@Override\n public IntVec3 next() {\n if(this.hasNext()){\n this.current = this.current.clone();\n } else throw new NoSuchElementException();\n if(this.current.x != this.end.x){\n this.current=this.current.incrX(this.xDir);\n } else if(this.current.y != this.end.y){\n this.current=IntVec3.get(0, this.current.y + this.yDir, this.current.z);\n } else if(this.current.z != this.end.z){\n this.current=IntVec3.get(0, 0, this.current.z + this.zDir);\n } else throw new NoSuchElementException();\n return this.current;\n }", "@Override\r\n public Integer next() {\r\n // Time complexity: O(1), where the problem size N \r\n // represents the size of the sequence to generate.\r\n if (!hasNext()) // check if the current element has a next element in this sequence\r\n return null; \r\n int current = next; // set the current element to next\r\n generatedCount++; // increment the number of generated elements so far\r\n next *= RATIO; // set the next element (adds the common ratio to the current number)\r\n return current; // return the current number as the generated one\r\n }", "@SuppressWarnings(\"unchecked\")\r\n\t\tpublic T next( )\r\n\t\t{\r\n\t\t\tif (!hasNext())\r\n\t\t\t\tthrow new NoSuchElementException();\r\n\t\t\t\r\n\t\t\tT result = currentArrayItr.next();\r\n\t\t\t//System.out.println(\"in next iterator LinkedArray \" + result);\r\n\t\t\treturn result;\r\n\r\n\t\t}" ]
[ "0.7958216", "0.794867", "0.78590846", "0.78295815", "0.77967113", "0.77268815", "0.77264446", "0.7711753", "0.7703207", "0.7672829", "0.7652239", "0.76162845", "0.7611684", "0.7596586", "0.75893503", "0.7583718", "0.7583034", "0.75609744", "0.7560039", "0.75470746", "0.75417084", "0.75317425", "0.7525519", "0.7507965", "0.75015384", "0.7474831", "0.7473127", "0.7470621", "0.7464267", "0.7451816", "0.74193573", "0.740191", "0.73937535", "0.73911005", "0.73891366", "0.7369641", "0.736546", "0.73478633", "0.7336533", "0.7329488", "0.73226124", "0.73171824", "0.7314145", "0.73133", "0.73108417", "0.72862375", "0.7282447", "0.7270398", "0.72675085", "0.7259203", "0.7235879", "0.7230957", "0.7207412", "0.72047246", "0.7190932", "0.7187478", "0.7186525", "0.7183315", "0.71450067", "0.7137202", "0.7131228", "0.7123078", "0.71196634", "0.7114473", "0.7112568", "0.71116954", "0.71042275", "0.71036744", "0.7098913", "0.7084748", "0.70781213", "0.707238", "0.7071002", "0.7049133", "0.70243144", "0.70187736", "0.70157516", "0.7011927", "0.7009714", "0.6996409", "0.6995662", "0.6993806", "0.6982281", "0.69811434", "0.6980461", "0.6978243", "0.69699347", "0.6960688", "0.6954488", "0.69525725", "0.6950562", "0.6934673", "0.69205993", "0.69193196", "0.6918221", "0.6914543", "0.6912108", "0.69102275", "0.69065666", "0.69041824", "0.6897495" ]
0.0
-1
Intent: Provide the user with the option to run various evaluation and grading tasks. Once the user selects a task, the task is run and the result of the task is displayed to the console. Postcondition1 (Task and secret prompt): The user is prompted to select a task and is then prompted to enter a secret. Postcondition2 (Task execution): The task the user selected has been executed.
public static void main(String[] args) { // Set up Scanner object Scanner keyboard = new Scanner(System.in); // Print welcome message System.out.println("Welcome to JGRAM."); // Loop until the user indicates they wish to exit boolean keepGoing = true; while (keepGoing) { // Post1 Task and secret prompt System.out.println("\n---------------------------------[ INPUT ]--" + "-----------------------------------\n"); String task = prompt(TASK_SELECTION, keyboard); // Post3 Task execution switch (task) { // New Document case "1": Task newDocTask = new NewDocumentTask(keyboard); newDocTask.performTask(); break; // Evaluation case "2": String evalSecret = prompt(GET_SECRET, keyboard); System.out.println(SECRET_REMINDER); Task evalTask = new EvaluationTask(evalSecret, keyboard); evalTask.performTask(); break; // Tamper case "3": String tamperSecret = prompt(GET_SECRET, keyboard); System.out.println(SECRET_REMINDER); Task tamperTask = new TamperTask(tamperSecret, keyboard); tamperTask.performTask(); break; // Report case "4": Task assignmentReportTask = new AssignmentReportTask(keyboard); assignmentReportTask.performTask(); break; // Help case "5": help(); break; // Exit case "6": keepGoing = false; break; // Invalid selection default: System.out.println("Invalid selection. Please try again."); break; } // End switch } // End while keyboard.close(); System.out.println("Goodbye..."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void mainCommands() {\n\t\tint inputId = taskController.getInt(\"Please input the number of your option: \", \"You must input an integer!\");\n\t\tswitch (inputId) {\n\t\tcase 1:\n\t\t\tthis.taskController.showTaskByTime();\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tthis.taskController.filterAProject();\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tthis.taskController.addTask();\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tthis.taskController.EditTask();\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tthis.taskController.removeTask();\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\tthis.taskController.saveTaskList();\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\tSystem.out.println(\"Thank you for coming, Bye!\");\n\t\t\tthis.exit = true;\n\t\t\t// save the task list before exit all the time.\n\t\t\tthis.taskController.saveTaskList();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"This is not a valid option, please input 1 ~ 7.\");\n\t\t\tbreak;\n\t\t}\n\n\t}", "public void actions() {\n\t\t\tProvider p = array_provider[theTask.int_list_providers_that_tried_task.get(0)];\n\t\t\t\n\t\t\t//there is a percentage of probability that the user will fail to complete the task\n\t\t\tif(random.draw((double)PERCENTAGE_TASK_FAILURE/100)){ // SUCCESS\n\n\t\t\t\ttot_success_tasks++;\n\t \tthrough_time += time() - theTask.entryTime;\n\t\t\t\ttheTask.out();\n\t\t\t\t\n\t\t\t\tif(FIXED_EARNING_FOR_TASK) earning_McSense = earning_McSense + FIXED_EARNING_VALUE;\n\t\t\t\telse {\n\n\t\t\t\t\t//Provider p = (Provider) theTask.providers_that_tried_task.first();\n\t\t\t\t\tearning_McSense = earning_McSense + (p.min_price*PERCENTAGE_EARNING)/100;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\telse { // FAILURE\n\t\t\t\t//we should check again and if the check fails insert the task in rescheduled_waiting\n\t\t\t\ttheTask.into(taskrescheduled);\n\t\t\t\ttot_failed_tasks++;\n\t\t\t\t//new StartTaskExecution(theTask).schedule(time());\n\n\t\t\t}\n\t\t\t// the provider frees one slot\n\t\t\tp.number_of_task_executing--;\n\t\t\ttot_scheduled_completed_in_good_or_bad_tasks++;\n\n \t}", "public void execute() {\n\n try {\n checkTask();\n Ui.printLines();\n Ui.printMatchingTasks();\n int index = 1;\n\n for (Task task : TaskList.taskArrayList) {\n String task_description = task.toString();\n\n if (task_description.contains(command)) {\n System.out.println(index + \". \" + task);\n index++;\n }\n\n }\n Ui.printLines();\n } catch (InvalidTask invalidTask) {\n Ui.printLines();\n Ui.printInvalidTask();\n Ui.printLines();\n }\n }", "public void executeTask(Version theTask) {\n\n\tif (_stoppedTasks.contains(theTask)) {\n\t // todo: what to do here???\n\t // this task obviously didn't perform well .. \n\t // and now, there's another request to run it!\n\t if (true) {\n\t\t// either try the task again ... \n\t\t_stoppedTasks.remove(theTask);\n\t } else {\n\t\t// or, refuse to run it at all \n\t\treturn;\n\t }\n\t}\n\t\n\t// System.out.println(\" - - - - - - - - - - - PSL! entered executeTask, parameter version> \" + theTask);\n\t// if (_versionCache.contains(theTask)) return;\n\n\n\t// add the pre-execution task to our knowledge base\n\t// replicate it so that in case of a crash we may recover\n\t_versionCache.addVersion(theTask);\n\treplicate(theTask);\n\n\t// tell replicators that we are about to start executing\n\talertReplicatorsExecutingTask(theTask);\n\n\tString taskName = ((TaskDefinition)theTask.data()).getName();\n\n\t// execute the task and get the next task\n\tVersion nextTask = executeTaskLocal(theTask);\n\t_log.completedTaskLocal(theTask);\n\n\tif (_stoppedTasks.contains(theTask)) {\n\t // this task was supposed to be stopped .. can ignore result\n\t _stoppedTasks.remove(theTask);\n\t _log.ignoreResultsOfStoppedTask(theTask);\n\t} else if (nextTask == null) { \n\t // this only happens if we have reached\n\t // the end of the workflow execution \n\t // tell replicators that everything is done.\n\t System.out.println(\"WORKFLOW IS DONE\");\n\t alertReplicatorsDoneExecutingTask(theTask);\n\t} else {\n\t nextTask.append(taskName);\n\t // todo: we need to find a way to replicate the \n\t // post-execution task in a clean way. The here-under\n\t // commented code does not work as it creates a version clash.\n\t // todo: 16-Feb maybe uncomment this??\n\t // _versionCache.addVersion(nextTask);\n\n\t // set the next task for execution\n\t queueTask(nextTask);\n\t // tell the replicators we are done executing the task, they\n\t // don't have to worry about things anymore.\n\t alertReplicatorsDoneExecutingTask(theTask);\n\t}\n }", "private void launchTask() {\n switch (buttonPressed) {\n case 1: // Launch task 1\n Intent i = new Intent(this, TaskActivity1.class);\n startActivity(i);\n break;\n case 2: // Launch task 2\n Intent j = new Intent(this, TaskActivity2.class);\n startActivity(j);\n }\n }", "public static void main(String[] args) {\n System.out.println(\"This is Tasker, the place where you can handle all your tasks. With this, maintaining good health and well-being has never been easier!\\n\"); // introduces/presents the app\n ArrayList<Task> taskList; // declaring the ArrayList of tasks\n taskList = deser(); // deserializes any existing .ser file for ArrayList Object\n do { // runs the main program loop\n System.out.println(\"In Tasker, you can choose from...\\na. Check task list\\nb. Add a task\\nc. Remove a task\\nd. Mark a task as complete\\ne. Change a task's date\\nf. Save & Exit Tasker\"); // options menu \n System.out.print(\"Please select an option: \"); // prompting the user\n response = input.nextLine(); // receiving the user's input\n System.out.print(\"\\n\"); // printing a newline for formatting\n if (response.equalsIgnoreCase(\"a\")) { // if the user choes to look at task list\n printTaskList(taskList); // printing the task list to the user\n } else if (response.equalsIgnoreCase(\"b\")) { // if the user wants to add a task\n addTask(taskList); // allows the user to add a task\n } else if (response.equalsIgnoreCase(\"c\")) { // if the user wants to remove a task\n delTask(taskList); // allows the user to remove a task\n } else if (response.equalsIgnoreCase(\"d\")) { // if the user wants to mark a task as complete\n markComplete(taskList); // allows the user to mark a task as complete\n } else if (response.equalsIgnoreCase(\"e\")) { // if the user wants to change a task's date\n promptDate(taskList); // allows the user to change the date of a task\n } else if (!response.equalsIgnoreCase(\"f\")){\n System.out.println(\"Invalid input.\"); // telling the user they entered an invalid input\n }\n } while (!response.equalsIgnoreCase(\"f\")); // while the user does not want to exit \n ser(taskList); // serializes the ArrayList of the task objects the user created\n }", "public static void main(String[] args) {\n String[] TaskList = new String[50]; // list of tasks\n int numTasks = -1;\n int userChoice; // user input from menu\n userChoice = getUserOption();\n while (userChoice != 0){\n switch (userChoice) {\n case 1: // Add a Task\n numTasks++;\n addTask(TaskList, numTasks);\n break;\n case 2: // Remove a Task\n if ( numTasks < 0 )\n System.out.println( \"There are no tasks on the list to remove.\");\n else\n numTasks = removeTask(TaskList, numTasks);\n break;\n case 3: // Update a Task\n if ( numTasks < 0 )\n System.out.println( \"There are no tasks on the list to update.\");\n else\n updateTask(TaskList, numTasks);\n break;\n case 4: // List Tasks\n listTasks(TaskList, numTasks);\n break;\n }\n userChoice = getUserOption();\n }\n }", "@Test\n\tpublic void Cases_23275_execute() throws Exception {\n\t\tVoodooUtils.voodoo.log.info(\"Running \" + testName + \"...\");\n\n\t\t// Go to Active tasks dashlet\n\t\t// TODO: VOOD-960 - Dashlet selection \n\t\tnew VoodooControl(\"span\", \"css\", \".row-fluid > li div span a span\").click();\n\t\tnew VoodooControl(\"a\", \"css\", \"[data-dashletaction='createRecord']\").click();\n\t\tsugar().tasks.createDrawer.getEditField(\"subject\").set(testName);\n\t\tsugar().tasks.createDrawer.save();\n\t\tif(sugar().alerts.getSuccess().queryVisible()) {\n\t\t\tsugar().alerts.getSuccess().closeAlert();\n\t\t}\n\n\t\t// refresh the Dashlet\n\t\tnew VoodooControl(\"a\", \"css\", \".dashboard-pane ul > li > ul > li .btn-group [title='Configure']\").click();\n\t\tnew VoodooControl(\"a\", \"css\", \"li > div li div [data-dashletaction='refreshClicked']\").click();\n\t\tVoodooUtils.waitForReady();\n\n\t\t// Verify task is in Active-Task Dashlet (i.e in TODO tab, if we have no related date for that record)\n\t\tnew VoodooControl(\"div\", \"css\", \"div[data-voodoo-name='active-tasks'] .dashlet-unordered-list .dashlet-tabs-row div.dashlet-tab:nth-of-type(3)\").click();\n\t\tnew VoodooControl(\"div\", \"css\", \"div.tab-pane.active p a:nth-of-type(2)\").assertEquals(testName, true);\n\n\t\tVoodooUtils.voodoo.log.info(testName + \" complete.\");\n\t}", "public void executeTask10 () {\n double a = UserInput.input(\"Input a:\");\n double b = UserInput.input(\"Input b:\");\n\n //Methods which take TWO parameters - sides of rectangle and returns perimeter and area:\n double s = RectangleCalculator.calculateArea(a, b);\n double p = RectangleCalculator.calculatePerimeter(a, b);\n\n //Print to the console finaly results:\n Printer.print(\"Square with a = \" + a + \" and b = \" + b + \": \");\n Printer.print(\"S = \" + s);\n Printer.print(\"P = \" + p);\n }", "public void executedTask(Task task) { // called by the inference rules\r\n float budget = task.getBudget().singleValue();\r\n float minSilent = parameters.SILENT_LEVEL / 100.0f;\r\n if (budget > minSilent)\r\n report(task.getSentence(), false);\r\n }", "private static void executeTask02() {\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}", "@Override\n public void execute(TaskList taskList, Ui ui, Storage storage) throws DukeException {\n if (userInputCommand.trim().equals(COMMAND_TODO)) {\n throw new DukeException(ERROR_MESSAGE_GENERAL + MESSAGE_FOLLOWUP_NUll);\n } else if (userInputCommand.trim().charAt(4) == ' ') {\n String description = userInputCommand.split(\"\\\\s\",2)[1].trim();\n if (description.contains(\"/after\")) {\n String details = description.split(\"/after\", 2)[0].trim();\n String doaftertask = description.split(\"/after\", 2)[1].trim();\n if (details.isEmpty() || doaftertask.isEmpty()) {\n throw new DukeException(ERROR_MESSAGE_DO_AFTER);\n } else {\n taskList.addDoAfterTask(details, doaftertask);\n storage.saveFile(taskList);\n }\n } else {\n taskList.addTodoTask(description);\n storage.saveFile(taskList);\n }\n } else {\n throw new DukeException(ERROR_MESSAGE_RANDOM);\n }\n }", "public static void main(String[]args) {\n\t\n\t \n\tArgsHandler handler = new ArgsHandler(args);\n if (!handler.empty()) {\n handler.execute();\n }\n \n final int exit = 0;\n final int setValues = 1;\n final int getValues = 2;\n final int execute2 = 3;\n final int printResult = 4;\n String word = null;\n \n /**\n * Our dialog menu with checking of input argumet's of program \n */\n do {\n UI.mainMenu();\n UI.enterChoice();\n switch (UI.getChoice()) {\n case exit:\n if (ArgsHandler.isDebug()) {\n System.out.println(\"\\nYou chosen 0. Exiting...\");\n System.out.format(\"%n############################################################### DEBUG #############################################################\");\n }\n break;\n case setValues:\n if (ArgsHandler.isDebug()) {\n \tSystem.out.format(\"%n############################################################### DEBUG #############################################################\");\n System.out.println(\"\\nYou chosen 1. Setting values...\");\n }\n word = UI.enterValues();\n break;\n case getValues:\n if (ArgsHandler.isDebug()) {\n \tSystem.out.format(\"%n############################################################### DEBUG #############################################################\");\n System.out.println(\"\\nYou chosen 2. Getting values...\");\n }\n if (word != null ) {\n UI.printText(word);\n } else {\n System.out.format(\"%nFirst you need to add values.\");\n }\n break; \n case execute2:\n if (ArgsHandler.isDebug()) {\n \tSystem.out.format(\"%n############################################################### DEBUG #############################################################\");\n System.out.println(\"\\nYou chosen 3. Executing task...\");\n }\n if (word != null) {\n \t final String []lines = NewHelper.DivString(word);\n \t System.out.println(\"\\nTask done...\");\n \t if (ArgsHandler.isDebug()) {\n \t System.out.format(\"%n############################################################### DEBUG #############################################################\");\n \t }\n } else {\n System.out.format(\"%nFirst you need to add values.\");\n }\n break;\n case printResult:\n if (ArgsHandler.isDebug()) {\n \tSystem.out.format(\"%n############################################################### DEBUG #############################################################\");\n System.out.format(\"%nYou chosen 4. \"\n + \"Printing out result...%n\");\n }\n if (word != null) {\n \tfinal String[] lines2 = NewHelper.DivString(word);\n \tfor (final String line2 : lines2) {\n NewHelper.printSymbols(line2);\n NewHelper.printSymbolNumbers(line2);\n \t}\n \tif(ArgsHandler.isDebug()) {\n \tSystem.out.format(\"%n############################################################### DEBUG #############################################################\");\n } \n \telse {\n System.out.format(\"%nFirst you need to add values.\"); \n }\n break;\n }\n default:\n System.out.println(\"\\nEnter correct number.\");\n }\n } while (UI.getChoice() != 0);\n}", "public void run()\n {\n String option = \"\";\n System.out.println(\"To Do List - Please enter an option\");\n System.out.println(\" add priority description (add a new task)\");\n System.out.println(\" next (remove and print most urgent task)\");\n System.out.println(\" quit (exit this program)\");\n System.out.println();\n \n Scanner in = new Scanner(System.in);\n \n do\n {\n System.out.print(\"> \");\n option = in.nextLine();\n if (option.startsWith(\"add\"))\n {\n addTask(option);\n }\n else if (option.equals(\"next\"))\n {\n nextTask();\n }\n } \n while (! option.equals(\"quit\"));\n }", "protected void execute() {\n \tTmSsAutonomous.getInstance().showAlgInfo();\n \tshowPreferenceSettings(); //P.println(\"[Preferences info TBD]\");\n }", "public static void main(String[] args)\r\n\t{\r\n\t\tSystem.out.print(\"Choose task todo: [G]et all task, [C]reate new task, [S]tart task, [E]nd task :\");\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tString input = sc.next();\r\n\r\n\t\ttaskProcess(input);\r\n\t}", "public static void main(String[] args) throws ParseException {\n ProcessEngine processEngine = initProcessEngine();\n ProcessDefinition processDefinition = initRepositoryService(processEngine);\n\n RuntimeService runtimeService = processEngine.getRuntimeService();\n ProcessInstance processInstance = initProcessInstance(runtimeService, \"onboarding\");\n\n TaskService taskService = processEngine.getTaskService();\n FormService formService = processEngine.getFormService();\n HistoryService historyService = processEngine.getHistoryService();\n\n Scanner scanner = new Scanner(System.in);\n\n while (processInstance != null && !processInstance.isEnded()) {\n List<Task> tasks = taskService.createTaskQuery().taskCandidateGroup(\"managers\").list();\n System.out.println(String.format(\"Active outstanding task:[%s]\", tasks.size()));\n for (Task task : tasks) {\n System.out.println(String.format(\"Processing Task [%s]\", task.getName()));\n Map<String, Object> variables = new HashMap<String, Object>();\n FormData formData = formService.getTaskFormData(task.getId());\n for (FormProperty formProperty : formData.getFormProperties()) {\n if (StringFormType.class.isInstance(formProperty.getType())) {\n System.out.println(formProperty.getName() + \"?\");\n String value = scanner.nextLine();\n variables.put(formProperty.getId(), value);\n } else if (LongFormType.class.isInstance(formProperty.getType())) {\n System.out.println(String.format(\"%s Must be a whole number\", formProperty.getName()));\n Long value = Long.valueOf(scanner.nextLine());\n variables.put(formProperty.getId(), value);\n } else if (DateFormType.class.isInstance(formProperty.getType())) {\n System.out.println(String.format(\"%s Must be a data m/d/yy\", formProperty.getName()));\n DateFormat dateFormat = new SimpleDateFormat(\"m/d/yy\");\n Date value = dateFormat.parse(scanner.nextLine());\n variables.put(formProperty.getId(), value);\n } else {\n System.out.println(String.format(\"<form type:%s not supported>\", formProperty.getType()));\n }\n }\n taskService.complete(task.getId(), variables);\n\n HistoricActivityInstance endActivity = null;\n List<HistoricActivityInstance> activityInstances =\n historyService.createHistoricActivityInstanceQuery()\n .processInstanceId(processInstance.getId()).finished()\n .orderByHistoricActivityInstanceEndTime().asc().list();\n for (HistoricActivityInstance activityInstance : activityInstances) {\n if (activityInstance.getActivityType().equals(\"startEvent \")) {\n System.out.println(String.format(\"BEGIN [%s] %s ms\", processDefinition.getName(), activityInstance.getDurationInMillis()));\n }\n if (activityInstance.getActivityType().equals(\"endEvent\")) {\n endActivity = activityInstance;\n } else {\n System.out.println(String.format(\"-- %s [%s] %s ms\", activityInstance.getActivityName(), activityInstance.getActivityId(), activityInstance.getDurationInMillis()));\n }\n }\n if (endActivity != null) {\n System.out.println(String.format(\"-- %s [%s] %s ms\", endActivity.getActivityName(), endActivity.getActivityId(), endActivity.getDurationInMillis()));\n System.out.println(String.format(\"COMPLETE %s [%s] %s\", processDefinition.getName(), processInstance.getProcessDefinitionKey(), endActivity.getEndTime()));\n }\n processInstance = runtimeService.createProcessInstanceQuery()\n .processInstanceId(processInstance.getId()).singleResult();\n }\n }\n scanner.close();\n }", "public void execute(Ui ui, TaskList tasklist){\r\n tasklist.addTask(task);\r\n ui.printMessage(\"Got it. I've added this task: \");\r\n ui.printMessage(task.getTaskDetails());\r\n }", "public void singlePremiseTask(TruthValue truth, BudgetValue budget) {\r\n Term content = this.currentTask.getContent();\r\n Base base = this.currentBelief.getBase();\r\n Sentence newJudgment = Sentence.make(content, Symbols.JUDGMENT_MARK, truth, base, this);\r\n Task newTask = new Task(newJudgment, budget, this);\r\n newTask.setStructual();\r\n derivedTask(newTask);\r\n }", "@Override\n\tpublic void execute(DelegateExecution execution) throws Exception {\n\t\tLOG.info(\"\\n\\n\\n Start cewate task \"+\"\\n\\n\\n\");\n\n\t\t// IdentityService identityService = Context.getProcessEngineConfiguration().getIdentityService();\n\t // User user = identityService.createUserQuery().userId(assignee).singleResult();\n\t \n\t // check if the first task listener was executed\n\t List<String> assigneeList = new ArrayList<>();//InformAssigneeTaskListener.assigneeList;\n\t assigneeList.add(\"demo\");\n\t assigneeList.add(\"test\");\n\t execution.setVariable(\"assigns\", assigneeList);\n\t LOG.info(\"\\n\\n\\n Start cewate task \"+assigneeList.toString() +\"\\n\\n\\n\");\n\t //assertThat(assigneeList.size(), is(1));\n\t //assertThat(assigneeList.get(0), is(\"Kermit\"));\n\n\t execution.setVariable(\"thisOk_new\", \"123456\");\n\t // complete first user task\n\t //Task task = taskService.createTaskQuery().singleResult();\n\t //taskService.complete(task.getId());\n\n\t}", "@Override\n public String execute(TaskList taskList, Storage storage) {\n assert super.getAction() == Action.BYE : \"Exit command action type error\";\n storage.writeToTaskTxt(taskList.getTasks());\n return \"Bye. Hope to see you again soon!\\n\";\n }", "public void testGame1EmulateIncorrectAnswers() {\n int[] indicators;\n MainPage mainPage = getMainPage();\n GameObjectImpl game1 = mainPage.gameOpen(1);\n game1.waitIndicatorsLoad();\n indicators = game1.getIndicators();\n int qtyTasksBeforeCycle = indicators[3];\n int tasksFailedBeforeCycle = indicators[1];\n for(int iter = 0; iter < qtyTasksBeforeCycle - 1; iter++) {\n game1.waitTaskBegin();\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n indicators = game1.getIndicators();\n int varTasksPassedBegin = indicators[0];\n int varTasksFailedBegin = indicators[1];\n int varTasksRemainBegin = indicators[2];\n int qtyTasksInLoopBegin = indicators[3];\n\n String[] partsOfTask = game1.getPartsOfTask();\n String firstNumberVar = partsOfTask[0];\n String secondNumberVar = partsOfTask[1];\n String operationVar = partsOfTask[2];\n int actualResult = game1.getResultWithKeys(firstNumberVar, secondNumberVar, operationVar);\n // press wrong button\n String strActualResult = Integer.toString(actualResult + 1);\n for (int i = 0; i < strActualResult.length(); i++) {\n String subStr = strActualResult.substring(i, i + 1);\n game1.pressButton((subStr));\n }\n //press correct button\n strActualResult = Integer.toString(actualResult);\n for (int i = 0; i < strActualResult.length(); i++) {\n String subStr = strActualResult.substring(i, i + 1);\n game1.pressButton((subStr));\n }\n indicators = game1.getIndicators();\n int varTasksPassedEnd = indicators[0];\n int varTasksFailedEnd = indicators[1];\n int varTasksRemainEnd = indicators[2];\n int qtyTasksInLoopEnd = indicators[3];\n\n assert varTasksRemainEnd == varTasksRemainBegin : \"positiveTestCorrectAnswers: tasks remain\";//\n assert varTasksFailedEnd == (varTasksFailedBegin + 1) : \"positiveTestCorrectAnswers: tasks failed\";\n assert varTasksPassedEnd == varTasksPassedBegin : \"positiveTestCorrectAnswers: tasks passed\";\n assert qtyTasksInLoopEnd == qtyTasksInLoopBegin + 1 : \"negativeTestWrongAnswers: tasks all\";\n }\n indicators = game1.getIndicators();\n int varTasksFailedAfterCycle = indicators[1];\n int qtyTasksAfterCycle = indicators[3];\n assert varTasksFailedAfterCycle - tasksFailedBeforeCycle == qtyTasksAfterCycle - qtyTasksBeforeCycle\n : \"positiveTestCorrectAnswers: tasks summ\" ;//\n game1.clickCloseGame();\n\n }", "@Override\n\tpublic Document executeTask(YFSEnvironment env, Document inXML) throws Exception {\n\t\tYFCDocument\tdocTaskQueue = YFCDocument.getDocumentFor (inXML);\n\t\tYFCElement\teleTaskQueue = docTaskQueue.getDocumentElement();\n\t\tYIFApi\tapi = YIFClientFactory.getInstance().getLocalApi ();\n\n\t\tif (YFSUtil.getDebug ())\n\t\t{\n\t\t\tSystem.out.println (\"In Agent \" + eleTaskQueue.getAttribute(\"TransactionId\") + \" (SEWarrantyActivationAgentImpl.java)\");\n\t\t\tSystem.out.println (\"Task Input:\");\n\t\t\tSystem.out.println (docTaskQueue.getString());\n\t\t}\n\t\t\t\t\n\t\tchangeOrderLineStatus (env, eleTaskQueue);\n\t\t\n\t\tregisterTaskComplete (env, eleTaskQueue);\n\t\treturn null;\n\t}", "public static Task PromptForTask(BufferedReader stdin, PrintStream stdout)\n\t\t\tthrows IOException {\n\t\t Task task = new Task();\n\t\n\ttask.setTask(numTask);\n\t//numTask++;\n\t\n\tstdout.print(\"Enter context: \");\n\ttask.setContext(stdin.readLine());\n\t\n\tstdout.print(\"Enter project: \");\n\ttask.setProject(stdin.readLine());\n\n\tstdout.print(\"Enter priority(HIGH,MID,LOW): \");\n\tString priority = stdin.readLine();//Por defecto la prioridad es LOW\n\tif (priority.equals(\"HIGH\")){\n\t\ttask.setPriority(HIGH);\n\t}\n\telse if (priority.equals(MID)){\n\t\ttask.setPriority(MID);\n\t}\n\telse{\n\t\ttask.setPriority(LOW);\n\t}\n\t\treturn task;\n\t}", "public void executeTask11 () {\n double r = UserInput.input(\"Input rsdius:\");\n\n //Methods which take one parameter - radius of circle and returns perimeter and lenth:\n double l = CircleCalculator.calculateLength(r);\n double s = CircleCalculator.calculateArea(r);\n\n //Print to the console finaly results:\n Printer.print(\"Circle with r = \" + r + \": \");\n Printer.print(\"L = \" + l);\n Printer.print(\"S = \" + s);\n }", "@Override\n public String execute(TaskList tasks, Ui ui, Storage storage) \n throws UnableToSaveException, NoSuchTaskException, NotNumberException {\n int taskNo;\n try {\n taskNo = Integer.parseInt(inputArr[1]) - 1;\n } catch (NumberFormatException e) {\n throw new NotNumberException();\n }\n if (taskNo > tasks.size()) {\n throw new NoSuchTaskException();\n }\n tasks.setDone(taskNo);\n storage.saveToSave(tasks);\n return ui.reply(\"Okcan, I mark this task as done:\\n \" + Constant.SPACE + tasks.getTask(taskNo));\n }", "void executeStraight(Runnable task);", "public void activatedTask(BudgetValue budget, Sentence sentence, boolean isInput) {\r\n Task task = new Task(sentence, budget, this);\r\n newTasks.add(task);\r\n }", "public static void main(String[] args) {\n String line;\n Scanner Input = new Scanner(System.in);\n ui.showIntroMessage();\n try {\n loadFile();\n } catch (FileNotFoundException e) {\n ui.showToUser(\"File Not Found\", \"Creating new file...\");\n }\n line = Input.nextLine();\n boolean inSystem = !line.equals(\"bye\");\n while (inSystem) {\n String[] words = line.split(\" \");\n boolean isList = words[0].equals(\"list\");\n boolean isDone = words[0].equals(\"done\");\n boolean isTodo = words[0].equals(\"todo\");\n boolean isDeadline = words[0].equals(\"deadline\");\n boolean isEvent = words[0].equals(\"event\");\n boolean isDelete = words[0].equals(\"delete\");\n boolean isFind = words[0].equals(\"find\");\n try {\n validateInput(words);\n } catch (Exception e) {\n ui.showToUser(e.getMessage());\n line = Input.nextLine();\n inSystem = !line.equals(\"bye\");\n continue;\n }\n if (isList) {\n try {\n validateListInput(words);\n } catch (Exception e) {\n ui.showToUser(e.getMessage());\n line = Input.nextLine();\n inSystem = !line.equals(\"bye\");\n continue;\n }\n printList();\n } else if (isDone) {\n int taskNumber = Integer.parseInt(words[1]) - 1;\n Tasks.get(taskNumber).taskComplete();\n ui.showToUser(ui.DIVIDER, \"Nice! I've marked this task as done:\\n\" + \" \" + Tasks.get(taskNumber).toString(), ui.DIVIDER);\n } else if (isDelete) {\n int taskNumber = Integer.parseInt(words[1]) - 1;\n ui.showToUser(ui.DIVIDER, \"Noted. I've removed this task:\\n\" + Tasks.get(taskNumber).toString());\n Tasks.remove(taskNumber);\n ui.showToUser(\"Now you have \" + Tasks.size() + \" tasks in the list.\", ui.DIVIDER);\n } else if (isTodo) {\n try {\n validateToDoInput(words);\n } catch (Exception e) {\n ui.showToUser(e.getMessage());\n line = Input.nextLine();\n inSystem = !line.equals(\"bye\");\n continue;\n }\n line = line.replace(\"todo \", \"\");\n ToDo toDo = new ToDo(line);\n Tasks.add(toDo);\n printTaskAdded();\n } else if (isDeadline) {\n line = line.replace(\"deadline \", \"\");\n words = line.split(\"/by \");\n Deadline deadline = new Deadline(words[0], words[1]);\n Tasks.add(deadline);\n printTaskAdded();\n } else if (isEvent) {\n line = line.replace(\"event \", \"\");\n words = line.split(\"/at \");\n Event event = new Event(words[0], words[1]);\n Tasks.add(event);\n printTaskAdded();\n } else if (isFind) {\n line = line.replace(\"find \", \"\");\n findTask(line);\n }\n line = Input.nextLine();\n inSystem = !line.equals(\"bye\");\n }\n String file = \"tasks.txt\";\n try {\n saveFile(file);\n } catch (IOException e) {\n ui.showToUser(\"Something went wrong: \" + e.getMessage());\n }\n ui.showExitMessage();\n }", "public static void main(String[] args) {\n\n\t SalesforceDesignTest solution = new SalesforceDesignTest();\n\t try(Scanner sc = new Scanner(System.in))\n\t {\n\t int n = sc.nextInt();\n\t for(int t = 0; t < n; t++) {\n\t String command = sc.nextLine();\n\t while (command.trim().isEmpty())\n\t {\n\t \tcommand = sc.nextLine();\n\t }\n\t \n\t solution.executeTask(command); \n\t }\t\n\t }\n}", "@Test\n\t@Deployment(resources=\"process.bpmn\")\n\tpublic void testCompletionOftask() {\n\t\tProcessInstanceWithVariables processInstance = (ProcessInstanceWithVariables) processEngine().getRuntimeService().startProcessInstanceByKey(PROCESS_DEFINITION_KEY);\n\t\t\n\t\t//Obtain a reference to the current task\n\t\tTaskAssert taskAssert = assertThat(processInstance).task();\n\t\tTaskEntity task = (TaskEntity) taskAssert.getActual();\n\t\ttask.delegate(\"user\");\n\t\ttask.resolve();\n\t\n\t\t\n\t}", "public WSActionResult execute(WSContext wsContext, WSAssetTask task) {\n WSHumanTaskStep hts = ReassignStep.getNextHumanTaskStep(task);\n if(null == hts) {\n log.error(\"Can not locate the very next human step to step \" + task.getCurrentTaskStep().getWorkflowStep().getName());\n return new WSActionResult(WSActionResult.ERROR, \"Can not locate the very next human step\");\n }\n WSUser executor = ReassignStep.getPrevousTaskStepExecutor(task);\n if(null == executor) {\n return new WSActionResult(WSActionResult.ERROR, \"Can not locate the user who completed the last human step in a workflow\");\n }\n ReassignStep.reassign(hts, new WSUser[] {executor});\n return new WSActionResult(getReturns()[0], \"Reassigned step \" +\n hts.getWorkflowStep().getName() +\n \" to \" + executor.getFullName()\n + \" (\" + executor.getUserName() + \")\");\n }", "public static void main(String[] args) {\n try {\n if (args.length < 1) {\n System.err.println();\n System.err.println(Globals.getWorkbenchInfoString());\n System.err.println();\n System.err.println(\"No task specified.\");\n } else {\n if (isJavaVersionOK() == false || WekaUtils.isWekaVersionOK() == false) {\n return;\n }\n // create standard options\n FlagOption suppressStatusOutputOption = new FlagOption(\n \"suppressStatusOutput\", 'S',\n \"Suppress the task status output that is normally send to stderr.\");\n FlagOption suppressResultOutputOption = new FlagOption(\n \"suppressResultOutput\", 'R',\n \"Suppress the task result output that is normally send to stdout.\");\n IntOption statusUpdateFrequencyOption = new IntOption(\n \"statusUpdateFrequency\",\n 'F',\n \"How many milliseconds to wait between status updates.\",\n 1000, 0, Integer.MAX_VALUE);\n Option[] extraOptions = new Option[]{\n suppressStatusOutputOption, suppressResultOutputOption,\n statusUpdateFrequencyOption};\n // build a single string by concatenating cli options\n StringBuilder cliString = new StringBuilder();\n for (int i = 0; i < args.length; i++) {\n cliString.append(\" \").append(args[i]);\n }\n // parse options\n Task task = (Task) ClassOption.cliStringToObject(cliString.toString(), Task.class, extraOptions);\n Object result = null;\n if (suppressStatusOutputOption.isSet()) {\n result = task.doTask();\n } else {\n System.err.println();\n System.err.println(Globals.getWorkbenchInfoString());\n System.err.println();\n boolean preciseTiming = TimingUtils.enablePreciseTiming();\n // start the task thread\n TaskThread taskThread = new TaskThread(task);\n taskThread.start();\n int progressAnimIndex = 0;\n // inform user of progress\n while (!taskThread.isComplete()) {\n StringBuilder progressLine = new StringBuilder();\n progressLine.append(progressAnimSequence[progressAnimIndex]);\n progressLine.append(' ');\n progressLine.append(StringUtils.secondsToDHMSString(taskThread.getCPUSecondsElapsed()));\n progressLine.append(\" [\");\n progressLine.append(taskThread.getCurrentStatusString());\n progressLine.append(\"] \");\n double fracComplete = taskThread.getCurrentActivityFracComplete();\n if (fracComplete >= 0.0) {\n progressLine.append(StringUtils.doubleToString(\n fracComplete * 100.0, 2, 2));\n progressLine.append(\"% \");\n }\n progressLine.append(taskThread.getCurrentActivityString());\n while (progressLine.length() < MAX_STATUS_STRING_LENGTH) {\n progressLine.append(\" \");\n }\n if (progressLine.length() > MAX_STATUS_STRING_LENGTH) {\n progressLine.setLength(MAX_STATUS_STRING_LENGTH);\n progressLine.setCharAt(\n MAX_STATUS_STRING_LENGTH - 1, '~');\n }\n System.err.print(progressLine.toString());\n System.err.print('\\r');\n if (++progressAnimIndex >= progressAnimSequence.length) {\n progressAnimIndex = 0;\n }\n try {\n Thread.sleep(statusUpdateFrequencyOption.getValue());\n } catch (InterruptedException ignored) {\n // wake up\n }\n }\n StringBuilder cleanupString = new StringBuilder();\n for (int i = 0; i < MAX_STATUS_STRING_LENGTH; i++) {\n cleanupString.append(' ');\n }\n System.err.println(cleanupString);\n result = taskThread.getFinalResult();\n if (!(result instanceof FailedTaskReport)) {\n System.err.print(\"Task completed in \"\n + StringUtils.secondsToDHMSString(taskThread.getCPUSecondsElapsed()));\n if (preciseTiming) {\n System.err.print(\" (CPU time)\");\n }\n System.err.println();\n System.err.println();\n }\n }\n if (result instanceof FailedTaskReport) {\n System.err.println(\"Task failed. Reason: \");\n ((FailedTaskReport) result).getFailureReason().printStackTrace();\n } else {\n if (!suppressResultOutputOption.isSet()) {\n if (result instanceof Measurement[]) {\n StringBuilder sb = new StringBuilder();\n Measurement.getMeasurementsDescription(\n (Measurement[]) result, sb, 0);\n System.out.println(sb.toString());\n } else {\n System.out.println(result);\n }\n System.out.flush();\n }\n }\n }\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "public void execute(TaskList tasks, Ui ui , Storage storage, Parser parser){\n ui.showBye();\n }", "private void showTask(String title, String message, int icon, Context context) {\n\n int alertTheme = R.style.LightCustom;\n if (currentTheme == 2) {\n alertTheme = R.style.DarkCustom;\n }\n\n AlertDialog alertDialog = new AlertDialog.Builder(context, alertTheme).create();\n\n alertDialog.setTitle(title);\n alertDialog.setMessage(message);\n alertDialog.setIcon(icon);\n\n int positive = AlertDialog.BUTTON_POSITIVE;\n int negative = AlertDialog.BUTTON_NEGATIVE;\n\n alertDialog.setButton(positive, \"Select this Task\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n launchTask();\n }\n });\n\n alertDialog.setButton(negative, \"Cancel\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n // Can execute code here if desired.\n }\n });\n\n alertDialog.show();\n }", "@Override\n\tpublic void executeAdapter() {\n\t\tthis.jobRowId = this.task.getTaskID();\n\t\tif (this.site != null){\n\t\t this.jobLocationId = this.site.getCustomerSurveySiteRowID();\n\t\t}\n\t\tthis.jobNo = this.task.getTaskCode();\n\t\t\n\t\tif (this.inspectDataSaved != null){\n\t\t\tthis.productId = this.inspectDataSaved.getProductID();\t\t\t\n\t\t\t\n\t\t\tthis.productQty = this.inspectDataSaved.getQty();\n\t\t\tthis.productUnit = this.inspectDataSaved.getProductAmountUnitText();\n\t\t\t\n\t\t\tthis.productPrice = this.inspectDataSaved.getMarketPrice();\n\t\t\tthis.productValue = this.inspectDataSaved.getValue();\n\t\t\t\n\t\t\tthis.inspectDataObjectID = this.inspectDataSaved.getInspectDataObjectID();\n\t\t\t\n\t\t\t/*\n\t\t\tif (this.getcOrder() == 3){\n\t\t\t this.inspectDataObjectID = this.inspectDataSaved.getInspectDataObjectID();\n\t\t\t}*/\n\t\t\t\n\t\t\tthis.productInfo = this.inspectDataSaved.getOpinionValue();\n\n\t\t\tthis.marketPriceID = this.inspectDataSaved.getMarketPriceID();\n\t\t\tthis.marketPrice = this.inspectDataSaved.getMarketPrice();\n\t\t\t\n\t\t\tthis.clusterControlFlag = (this.inspectDataSaved.isProductControlled())?\"Y\":\"N\";\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "public static void main(String [] args) {\n Task specialTask = new MessageTask(args[0],args[1],args[2],args[3],args[4],args[5]);\n specialTask.execute();\n\n System.out.println(\"Hello to your first Java program!\");\n\n Task[] tasks = new Task[5];\n tasks[0] = new MessageTask(\"1\",\"Seminar\",\"Hello world\",\"Computer\",\"Students\",\"2018-10-02 13:00\");\n tasks[1] = new MessageTask(\"2\",\"Laborator\",\"Beautiful world\",\"Love\",\"Ex's\",\"2012-05-02 15:00\");\n tasks[2] = new MessageTask(\"3\",\"Curs\",\"Cruel world\",\"Teacher\",\"Parents\",\"2058-08-02 13:35\");\n tasks[3] = new MessageTask(\"4\",\"Examen\",\"Great world\",\"Colleague\",\"Teachers\",\"1018-03-02 20:00\");\n tasks[4] = new MessageTask(\"5\",\"Colocviu\",\"Bye world\",\"Deputy\",\"Mayor\",\"2618-10-02 13:00\");\n\n// for(Task i: tasks)\n// i.execute();\n\n }", "public void execute(TaskManager taskManager, Storage storage, Ui ui) {\n ui.showText(HELP);\n }", "void executeTask(org.apache.ant.common.antlib.Task task) throws org.apache.ant.common.util.ExecutionException;", "private void takeInUserInput(){\n\t\t// only take in input when it is in the ANSWERING phase\n\t\tif(spellList.status == QuizState.Answering){\n\t\t\tspellList.setAnswer(getAndClrInput());\n\t\t\tspellList.status = QuizState.Answered;\n\t\t\tansChecker=spellList.getAnswerChecker();\n\t\t\tansChecker.execute();\n\t\t}\t\n\n\t}", "public String execute(TaskList tasks, Ui ui, Storage storage) {\n return Ui.showBye();\n }", "@Override\n public void executeAction(String command) {\n String[] parts = command.split(\",\");\n Task task = Task.buildTask(parts[0], parts[1], DateSorting.parseDate(\"dd-MM-yyyy\", parts[2]),\n parts[3], parts[4]);\n\n TodoList.tasks.put(task.getId(), task);\n System.out.println(\"IP.TodoListApplication.App.Task successfully added!\");\n\n }", "public void intialRun() {\n }", "public String execute() {\n String result;\n try {\n ToDo todo = new ToDo(task, false);\n result = UI.toDoCalled(taskList, todo);\n } catch (Exception e) {\n result = UI.printError(\" \\u2639 OOPS!!! The description of a todo cannot be empty.\");\n }\n return result;\n }", "public abstract void execute(TaskList taskList, Ui ui, Storage storage) throws DukeException;", "public void run() \n\t\t{\n\t\t\tboolean exitMenu = false;\n\t\t\tdo \n\t\t\t{\t\t\t\t\t\n\t\t\t\tmenu.display();\n\t\t\t\tint choice = menu.getUserSelection();\n\t\t\t\t// the above method call will return 0 if the user did not\n\t\t\t\t// entered a valid selection in the opportunities given...\n\t\t\t\t// Otherwise, it is valid...\n\t\t\t\tif (choice == 0)\n\t\t\t\t{\n\t\t\t\t\t// here the user can be informed that fail to enter a\n\t\t\t\t\t// valid input after all the opportunities given....\n\t\t\t\t\t// for the moment, just exit....\n\t\t\t\t\texitMenu = true;\n\t\t\t\t}\n\t\t\t\telse if (choice == 1) \n\t\t\t\t{\n\t\t\t\t\t// here goes your code to initiate action associated to\n\t\t\t\t\t// menu option 1....\n\t\t\t\t\tProjectUtils.operationsOnNumbers();\n\t\t\t\t}\n\t\t\t\telse if (choice == 2)\n\t\t\t\t{\n\t\t\t\t\tProjectUtils.operationsOnStrings();\n\t\t\t\t}\n\t\t\t\telse if (choice == 3) \n\t\t\t\t{\n\t\t\t\t\tProjectUtils.showStatistics();\n\t\t\t\t}\n\t\t\t\telse if (choice == 4)\n\t\t\t\t{\n\t\t\t\t\texitMenu = true; \n\t\t\t\t\tProjectUtils.println(\"Exiting now... \\nGoodbye!\");\n\t\t\t\t}\n\t\t\t} while (!exitMenu);\n\t\t}", "@Override\n public IntentDTO run(String... args) {\n this.setup(args);\n\n if (foundStudent != null) {\n ProgressDAO progressDAO = new ProgressDAO();\n Progress progress = progressDAO.findProgress(foundStudent);\n\n if (progress != null) {\n if (progress.name.equals(Progress.reset)) {\n /**\n * The student reseted it's account, reply accordingly\n */\n return (new RegistrationResetIntention()).run(args);\n } else if (progress.name.equals(Progress.initialRegistration)) {\n /**\n * After the student replied to the \"can you help me?\"\n * question, check if they are willing to continue\n */\n return (new InititalRegistrationIntent()).run(args);\n } else if (progress.name.equals(Progress.registrationCanceled)) {\n /**\n * The student replied negatively to the \"can you help me?\"\n * question\n */\n return (new RegistrationCanceledIntent()).run(args);\n } else if (shouldRegisterUniversity(progress)) {\n /**\n * The user replied positively to the \"can you help me?\"\n * question, or we did not find their university or they\n * said we didn't find their university\n */\n return (new RegisterUniversityIntent()).run(args);\n } else if (progress.name.equals(Progress.universityRegistrationResponse)) {\n /**\n * The user replied to the \"what is your university?\"\n * question\n */\n return (new UniversityRegistrationResponseIntent()).run(args);\n } else if (shouldRegisterCourse(progress)) {\n /**\n * The user replied positively to the \"is this your\n * university?\" question, or we did not find their course or\n * they said we didn't find their course\n */\n return (new RegisterCourseIntent()).run(args);\n } else if (progress.name.equals(Progress.courseRegistrationResponse)) {\n /**\n * The user replied to the \"what is your course?\" question\n */\n return (new CourseRegistrationResponseIntent()).run(args);\n } else if (shouldForwardToTermsAcceptanceIntent(progress)) {\n /**\n * The user replied positively to the \"Is this your course?\"\n * question\n */\n return (new TermsAcceptanceIntent()).run(args);\n }\n }\n }\n\n /**\n * The user is not in any valid progress, therefore, we assume it's\n * their first access\n */\n return firstAccess();\n }", "public void executeChoice(int choice) {\n\t\tSystem.out.println();\n\t\tswitch (choice) {\n\t\t\tcase View.NO_CHOICE:{\n\t\t\t\tbreak;}\n\n\t\t\tcase View.ADDCUS:{\n\t\t\t\tLong cusId = view.readIDWithPrompt(\"Enter Customer ID: \");\n\t\t\t\tString name = view.readLineWithPrompt(\"Enter Name: \");\n\t\t\t\tString address = view.readLineWithPrompt(\"Enter Address: \");\n\t\t\t\t\n\t\t\t\tatMyService.addCustomer(cusId, name, address);\n\t\t\t\tbreak;}\n\t\t\tcase View.ADDITEM:{\n\t\t\t\tLong itemId = view.readIDWithPrompt(\"Enter Item ID: \");\n\t\t\t\tString description = view.readLineWithPrompt(\"Enter Description: \");\n\t\t\t\tatMyService.addItem(itemId, description);\n\t\t\t\tbreak;}\n\t\t\tcase View.ADDSTOCK:{\n\t\t\t\tLong id = view.readIDWithPrompt(\"Enter Target Item ID: \");\n\t\t\t\tif (id == null) {\n\t\t\t\t\tSystem.out.println(\"Item Not Found.\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tint amt = view.readIntWithPrompt(\"Enter Amount(negative to subtract): \");\n\t\t\t\tatMyService.addStock(id, amt);\n\t\t\t\tbreak;}\n\t\t\tcase View.PLACEORD:{\n\t\t\t\tprovideOrderAccess();\n\t\t\t\tbreak;}\n\t\t\tcase View.DISPLAYORD:{\n\t\t\t\tLong cusId = view.readIDWithPrompt(\"Enter Customer ID: \");\n\t\t\t\tDate begin = view.readDateWithPrompt(\"Enter Begin Date(yyyy-MM-dd) for range: \");\n\t\t\t\tDate end = view.readDateWithPrompt(\"Enter End Date(yyyy-MM-dd) for range: \");\t\t\t\n\n\t\t\t\tArrayList<Order> orders = atMyService.displayOrders(cusId, begin, end);\n\t\t\t\t// check to see if orders is valid\n\t\t\t\tif (!(orders.isEmpty())) {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\tSystem.out.println(\"Customer Name: \" + atMyService.findCustomer(cusId).getName());\n\t\t\t\t\tSystem.out.println(\"Orders:\");\n\t\t\t\t\tfor(Order ord : orders) {\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tSystem.out.println(\"Order ID: \" + ord.getID());\n\t\t\t\t\t\tSystem.out.println(\" Date Placed: \" + ord.getDate());\n\t\t\t\t\t\tSystem.out.printf(\" Items Ordered(amt): \");\n\t\t\t\t\t\tLong[][] items = ord.getItems();\n\t\t\t\t\t\tfor (int i = 0; i < items.length; i++) {\n\t\t\t\t\t\t\t// print item, amount ordered, and commas if necessary\n\t\t\t\t\t\t\tif (!(i == items.length - 1)) {\n\t\t\t\t\t\t\t\tSystem.out.printf(items[i][0] + \"(\" + items[i][1] + \")\" + \", \");\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tSystem.out.printf(items[i][0] + \"(\" + items[i][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\tSystem.out.println();\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"There are no orders for this customer.\");\n\t\t\t\t}\n\t\t\t\tbreak;}\n\t\t\tcase View.DISPLAYINV:{\n\t\t\t\tList<Item> items = atMyService.displayInventory();\n\t\t\t\tSystem.out.println(\"Current Inventory:\");\n\n\t\t\t\t//iterate through and display\n\t\t\t\tfor (Item item : items) {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\tSystem.out.println(\"Item ID: \" + item.getID());\n\t\t\t\t\tSystem.out.println(\" Description: \" + item.getDescription());\n\t\t\t\t\tSystem.out.println(\" Stock: \" + item.getStock());\n\t\t\t\t}\n\t\t\t\tbreak;}\n\t\t\tcase View.DISPLAYCUS:{\n\t\t\t\tList<Customer> customers = atMyService.displayCustomers();\n\t\t\t\tSystem.out.println(\"Customers:\");\n\n\t\t\t\t//iterate through and display\n\t\t\t\tfor (Customer customer : customers) {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\tSystem.out.println(\"Customer ID: \" + customer.getID());\n\t\t\t\t\tSystem.out.println(\" Name: \" + customer.getName());\n\t\t\t\t\tSystem.out.println(\" Address: \" + customer.getAddress());\n\t\t\t\t\tSystem.out.printf(\" Orders: \");\n\t\t\t\t\tLong[] orders = customer.getOrders();\n\t\t\t\t\tfor (int i = 0; i < orders.length; i++) {\n\t\t\t\t\t\tif (!(i == orders.length -1)) {\n\t\t\t\t\t\t\tSystem.out.printf(orders[i] + \", \");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.printf(\"%d\", orders[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;}\n\t\t\tcase View.EXIT:{\n\t\t\t\tSystem.out.println(\"Goodbye\");\n\t\t\t\tbreak;}\n\t\t}\n\t}", "public String execute(TaskList taskList, Ui ui, Storage storage) {\n return ui.showGoodbye();\n }", "@Override\n public void afterExecute(Task task, TaskState taskState) {\n String taskImpl = task.getClass().getSimpleName();\n if (taskImpl.endsWith(\"_Decorated\")) {\n taskImpl = taskImpl.substring(0, taskImpl.length() - \"_Decorated\".length());\n }\n String potentialExecutionTypeName = \"TASK_\" +\n CaseFormat.LOWER_CAMEL.converterTo(CaseFormat.UPPER_UNDERSCORE).\n convert(taskImpl);\n ExecutionType executionType;\n try {\n executionType = ExecutionType.valueOf(potentialExecutionTypeName);\n } catch (IllegalArgumentException ignored) {\n executionType = ExecutionType.GENERIC_TASK_EXECUTION;\n }\n\n List<Recorder.Property> properties = new ArrayList<Recorder.Property>();\n properties.add(new Recorder.Property(\"project\", task.getProject().getName()));\n properties.add(new Recorder.Property(\"task\", task.getName()));\n\n if (task instanceof DefaultAndroidTask) {\n String variantName = ((DefaultAndroidTask) task).getVariantName();\n if (variantName == null) {\n throw new IllegalStateException(\"Task with type \" + task.getClass().getName() +\n \" does not include a variantName\");\n }\n if (!variantName.isEmpty()) {\n properties.add(new Recorder.Property(\"variant\", variantName));\n }\n }\n\n TaskRecord taskRecord = taskRecords.get(task.getName());\n mRecorder.closeRecord(new ExecutionRecord(\n taskRecord.recordId,\n 0 /* parentId */,\n taskRecord.startTime,\n System.currentTimeMillis() - taskRecord.startTime,\n executionType,\n properties));\n }", "abstract void execute(TaskList tasks, Ui ui, Storage storage) throws IOException;", "public String execute(TaskList task, Ui ui, Storage storage) throws DukeException {\n String[] arrOfText = description.split(\" \", 2);\n if (arrOfText.length < 2) {\n throw new InvalidDescriptionException(\"Wrong description\");\n }\n\n int sizeOfList = task.getNumOfTasks();\n if (arrOfText[1].matches(\"^\\\\d+\")) {\n int taskNum = Integer.parseInt(arrOfText[1]);\n if (taskNum > sizeOfList || taskNum < 1) {\n throw new InvalidDescriptionException(\"Wrong description\");\n } else {\n String response = ui.showText(task.removeTask(taskNum));\n storage.writeToFile(task);\n return response;\n }\n } else {\n throw new InvalidDescriptionException(\"Wrong description\");\n }\n }", "abstract void run(TaskList tasks, MainWindow ui, Storage storage);", "public void singlePremiseTask(BudgetValue budget, Term content, TruthValue truth) {\r\n Sentence sentence = currentTask.getSentence();\r\n Sentence newSentence = Sentence.make(sentence, content, truth, sentence.getBase(), this);\r\n Task newTask = new Task(newSentence, budget, this);\r\n newTask.setStructual();\r\n derivedTask(newTask);\r\n }", "@Override\n public void execute(TaskList taskList, Ui ui, Storage storage) throws DukeException, ParseException {\n if (userInputCommand.trim().equals(COMMAND_SNOOZE)) {\n throw new DukeException(ERROR_MESSAGE_EMPTY_INDEX + MESSAGE_FOLLOWUP_EMPTY_INDEX);\n } else if (userInputCommand.trim().charAt(6) == ' ') {\n String description = userInputCommand.trim().split(\"\\\\s\", 2)[1];\n if (isParsable(description)) {\n //converting string to integer\n int index = Integer.parseInt(description);\n if (index > taskList.getSize() || index <= 0) {\n if (taskList.getSize() == 0) {\n throw new DukeException(ERROR_MESSAGE_EMPTY_LIST);\n } else {\n throw new DukeException(ERROR_MESSAGE_INVALID_INDEX + taskList.getSize() + \".\");\n }\n } else {\n taskList.snoozeTask(index);\n if (description.contains(\" /by \")) {\n String details = taskList.getTask(index - 1).getDescription();\n String date = description.trim().split(\" /by \", 2)[1];\n if (details == null || date == null) {\n throw new DukeException(ERROR_MESSAGE_DEADLINE);\n } else {\n if (isParseDate(date)) {\n taskList.addDeadlineTask(details, date);\n storage.saveFile(taskList);\n } else {\n throw new DukeException(ERROR_MESSAGE_INVALID_DATE);\n }\n }\n } else if (description.contains(\" /at \")) {\n String details = description.trim().split(\" /at \", 2)[0];\n String date = description.trim().split(\" /at \", 2)[1];\n if (details == null || date == null) {\n throw new DukeException(ERROR_MESSAGE_EVENT);\n } else {\n taskList.addEventTask(details, date);\n storage.saveFile(taskList);\n }\n } else {\n description = userInputCommand.trim().split(\"\\\\s\", 2)[1];\n taskList.addTodoTask(description);\n storage.saveFile(taskList);\n }\n }\n } else {\n throw new DukeException(ERROR_MESSAGE_UNKNOWN_INDEX);\n }\n } else {\n throw new DukeException(ERROR_MESSAGE_RANDOM);\n }\n }", "public void execute(TaskList tasks, Ui ui, Storage storage) {\n if (tasks.getSize() == 0)\n {\n Ui.printOutput(\"You have currently no tasks in your list.\");\n }\n else\n {\n Ui.printDash();\n Ui.printMessage(\"Here are the task(s) in your list:\");\n int i = 1;\n for (Task task : tasks.getTasks()) {\n Ui.printMessage(i++ + \".\" + task.toString());\n }\n Ui.printDash();\n }\n }", "@Override\n\tpublic final void execute (Map<Key, Object> context) {\n\t\tboolean outcome = makeDecision (context);\n\n\t\tif (outcome) {\n\t\t\tpositiveOutcomeStep.execute (context);\n\t\t} else {\n\t\t\tnegativeOutcomeStep.execute (context);\n\t\t}\n\t}", "public void doAction(\r\n\t\t\tAction_To_Choose action,\r\n\t\t\tGuideline_Action_Choices currentDecision,\r\n\t\t\tGuidelineInterpreter interpreter ){\r\n\n\t\tif (getrule_in_conditionValue() != null) {\n\t\t\tCriteria_Evaluation evaluation = HelperFunctions.dummyCriteriaEvaluation();\n\t\t\ttry {\n\t\t\t\tevaluation = (Criteria_Evaluation) ((Criterion)getrule_in_conditionValue()).evaluate(interpreter, false);\n\t\t\t\tif (!(PCAInterfaceUtil.mapTruthValue(evaluation.truth_value))) { // rule-in condition does not hold\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t} catch (PCA_Session_Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\treturn ;\n\t\t\t}\n\t\t}\n\r\n\t\t// each item in alternatives is a Drug Usage.\r\n\t\t// each item in addEvaluation is an Add_Evaluation structure\n\t\tCollection<Slot> recommendationBais = getrecommendation_basisValue();\r\n\t\tCollection alternatives = getalternativesValue();\r\n\t\tList addEvaluations = new ArrayList();\r\n\t\t// addEvaluations is a collection of Choice_Evaluation instances\r\n\t\tfor (Iterator i = alternatives.iterator();i.hasNext();) {\r\n\t\t\tDrug_Usage activity = (Drug_Usage) i.next();\r\n\t\t\tChoice_Evaluation choiceEvaluation = new Choice_Evaluation();\r\n\t\t\ttry {\r\n\t\t\t\tAdd_Evaluation addEval = activity.evaluateAdd(interpreter, \n\t\t\t\t\t\tthis.getfine_grain_priorityValue(), null, recommendationBais);\r\n\t\t\t\tif (addEval != null) {\r\n\t\t\t\t\tchoiceEvaluation.add_eval(addEval);\r\n\t\t\t\t\taddEvaluations.add(choiceEvaluation);\r\n\t\t\t\t}\r\n\t\t\t\tlogger.debug(activity.getlabelValue()+\" got evaluated\");\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tlogger.error(activity.getlabelValue()+\" cannot be evaluated; \"+e.getClass());\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tCollections.sort(addEvaluations, new CompareEvals());\r\n\r\n\t\tinterpreter.addEvaluatedChoice(\r\n\t\t\t\tnew Guideline_Activity_Evaluations(\r\n\t\t\t\t\t\tthis.makeGuideline_Entity(interpreter.getCurrentGuidelineID()),\r\n\t\t\t\t\t\tEvaluation_Type.add,\r\n\t\t\t\t\t\t(Choice_Evaluation[])addEvaluations.toArray(new Choice_Evaluation[0]),\r\n\t\t\t\t\t\tinterpreter.getCurrentGuidelineID())\r\n\t\t\t\t);\r\n\r\n\t}", "@Override\n public void execute(TaskList tasks, Ui ui, Storage storage){\n isExit = true;\n }", "public void doublePremiseTask(BudgetValue budget, Term content, TruthValue truth) {\r\n Sentence newSentence = Sentence.make(currentTask.getSentence(), content, truth, this.currentBase, this);\r\n Task newTask = new Task(newSentence, budget, this);\r\n derivedTask(newTask);\r\n }", "public static void launchTask(Task tsk)\n {\n getInstance().doExecute(tsk);\n }", "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) throws IOException {\n\n // For String input from the GUI.\n String input;\n\n // For User choice.\n int choice;\n\n // For keeping the count of the Total added Tasks.\n int totalTasks = 0;\n\n // Created MenuText Object for creating the Menu Text.\n MenuText menuText = new MenuText();\n\n // Created Task Object for creating all the Tasks.\n Task task = new Task();\n\n // Created Project Object for creating the Project and detail regarding the Project.\n Project project = new Project();\n\n // Created ArrayList Object for saving all the Task Objects.\n ArrayList<Task> tasksList = new ArrayList<>();\n\n // Created Menu Object for manipulating Tasks and showing Menu.\n Menu menu = new Menu();\n\n // For User Choice to see the Main menu again.\n do {\n\n // For setting the main menu display text with list of options and input from user.\n menuText.setSelectOption1(\"(1) Show all the tasks\");\n menuText.setSelectOption2(\"(2) Add new task\");\n menuText.setSelectOption3(\"(3) Edit task\");\n menuText.setSelectOption4(\"(4) Save and quit\");\n\n input = JOptionPane.showInputDialog(null, menuText.getWelcomeText() +\n \"\\n\\n\" + \"You have total \" + totalTasks + \" tasks in your todo List\" +\n \"\\n\" + menuText.getMenuOptionsText() +\n\n \"\\n\\n\" + menuText.getSelectOption1() +\n \"\\n\" + menuText.getSelectOption2() +\n \"\\n\" + menuText.getSelectOption3() +\n \"\\n\" + menuText.getSelectOption4() + \"\\n\", \"Main Menu\", JOptionPane.INFORMATION_MESSAGE);\n\n choice = Integer.parseInt(input);\n\n // For Error Message window in case of invalid Choice from user.\n while (choice < 1 || choice > 4) {\n input = JOptionPane.showInputDialog(null,\n \"\\n\" + menuText.getMenuOptionsText() +\n\n \"\\n\\n\" + menuText.getSelectOption1() +\n \"\\n\" + menuText.getSelectOption2() +\n \"\\n\" + menuText.getSelectOption3() +\n \"\\n\" + menuText.getSelectOption4() + \"\\n\", \"Invalid Choice \", JOptionPane.ERROR_MESSAGE);\n\n //For User choice input.\n choice = Integer.parseInt(input);\n }\n\n // To Do List action method after user Choose some option from the list.\n switch (choice) {\n case 1:\n\n // In case user Want to Show th Task List.\n menu.showTasks(tasksList, menuText);\n break;\n\n case 2:\n do {\n\n // In case user Want to Add th Task List.\n menu.addTaskData(task, project, menuText, tasksList);\n\n //For keeping count of the total number of Tasks.\n totalTasks++;\n\n // In case user want to another Task after finishing the previous.\n menuText.setSelectOption5(\"IF you want to add more tasks enter yes otherwise enter any other text:\");\n input = JOptionPane.showInputDialog(menuText.getSelectOption5());\n\n } while (input.equals(\"yes\"));\n\n // Call to display method so user can see the tasks which he added.\n menu.showTasks(tasksList, menuText);\n break;\n\n case 3:\n\n // In case the User is going to Edit the Tasks before adding any Tasks.\n if (tasksList.isEmpty()) {\n JOptionPane.showMessageDialog(null, \"There is not current task to edit so please add some tasks first\");\n } else {\n do {\n\n // Edit Method Call if the user want to Edit Task detail.\n menu.editTasks(task, project, menuText, tasksList);\n\n menuText.setSelectOption6(\"If you want to edit more tasks please enter yes otherwise press enter any other text: \");\n input = JOptionPane.showInputDialog(menuText.getSelectOption6());\n\n } while (input.equals(\"yes\"));\n menu.showTasks(tasksList, menuText);\n }\n break;\n\n case 4:\n\n // To show user confirmation in case he just want to save the written data to file and quit.\n JOptionPane.showMessageDialog(null, \"All the tasks are saved and Application will Quit\", \"GoodBye\", JOptionPane.INFORMATION_MESSAGE);\n break;\n\n }\n menuText.setSelectOption7(\"Want to use to main menu again enter yes otherwise press enter any other text: \");\n input = JOptionPane.showInputDialog(menuText.getSelectOption7());\n } while (input.equals(\"yes\"));\n\n System.exit(0);\n\n }", "public void submitContextAndTaskString(final String evaluatorConfigurationString,\n final String contextConfigurationString,\n final String taskConfigurationString) {\n\n final DateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\n LOG.log(Level.FINE, \"AllocatedEvaluatorBridge:submitContextAndTaskString for evaluator id: {0}, time: {1}.\",\n new Object[] {evaluatorId, dateFormat.format(new Date())});\n\n if (evaluatorConfigurationString.isEmpty()) {\n throw new RuntimeException(\"empty evaluatorConfigurationString provided.\");\n }\n if (contextConfigurationString.isEmpty()) {\n throw new RuntimeException(\"empty contextConfigurationString provided.\");\n }\n if (taskConfigurationString.isEmpty()) {\n throw new RuntimeException(\"empty taskConfigurationString provided.\");\n }\n //When submit over the bridge, we would keep the task configurations as a serialized strings.\n //submitContextAndTask(final String contextConfiguration,\n //final String taskConfiguration) is not exposed in the interface. Therefore cast is necessary.\n ((AllocatedEvaluatorImpl)jallocatedEvaluator)\n .submitContextAndTask(evaluatorConfigurationString, contextConfigurationString, taskConfigurationString);\n }", "public void onClick(DialogInterface dialog, int which) {\n SharedPreferences.Editor editor = mainClassCall.edit();\n editor.putString(\"mainClassCall\", \"True\"); // Storing string\n editor.commit();\n TaskViewModel taskViewModel = Shared.SelectedTask;\n\n taskViewModel.IsDone = true;\n\n dbHelper.saveTask(taskViewModel, true);\n Toast.makeText(getActivity(), \" Move to Done list\", Toast.LENGTH_LONG).show();\n Intent myIntent = new Intent(getActivity(), MainActivity.class);\n getActivity().startActivity(myIntent);\n }", "public void doTask(Entity e) {\r\n\t\tif (getTask().equals(\"heal\")) {\r\n\t\t\tRandom rand = new Random();\r\n\t\t\tint healing = rand.nextInt(50) + 1;\r\n\t\t\tif (getNumTasks() > 0) {\r\n\t\t\t\tuseTask();\r\n\t\t\t\tif (Jedi.class.isInstance(e)) {\r\n\t\t\t\t\tJedi healMe = (Jedi) e;\r\n\t\t\t\t\thealMe.heal(healing);\r\n\t\t\t\t} else if (Rebel.class.isInstance(e)) {\r\n\t\t\t\t\tRebel healMe = (Rebel) e;\r\n\t\t\t\t\thealMe.heal(healing);\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println(\"Medical droid heals \" + e.getName()\r\n\t\t\t\t\t\t+ \" with \" + healing + \" hp.\");\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out\r\n\t\t\t\t\t\t.println(\"Medical Droid \"\r\n\t\t\t\t\t\t\t\t+ getName()\r\n\t\t\t\t\t\t\t\t+ \" has run out of number of tasks available to perform.\");\r\n\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"Medical Droid \" + getName()\r\n\t\t\t\t\t+ \" has no tasks upon which to perform.\");\r\n\t\t}\r\n\t}", "@Override\n public void execute(TaskList taskList, UI ui, Storage storage) throws DukeException {\n\n super.execute(taskList, ui, storage);\n checkValidity();\n\n Task doneTask = taskList.getTaskByIndex(Integer.parseInt(this.descriptionOfTask.trim()) - 1);\n doneTask.markAsDone();\n ui.displayDone(doneTask);\n storage.saveToDataFile(taskList);\n\n }", "public void completeTask()\n throws NumberFormatException, NullPointerException, IndexOutOfBoundsException {\n System.out.println(LINEBAR);\n try {\n int taskNumber = Integer.parseInt(userIn.split(\" \")[TASK_NUMBER]);\n\n int taskIndex = taskNumber - 1;\n\n tasks.get(taskIndex).markAsDone();\n storage.updateFile(tasks.TaskList);\n System.out.println(\"Bueno! The following task is marked as done: \\n\" + tasks.get(taskIndex));\n } catch (NumberFormatException e) {\n ui.printNumberFormatException();\n } catch (NullPointerException e) {\n ui.printNullPtrException();\n } catch (IndexOutOfBoundsException e) {\n ui.printIndexOOBException();\n }\n System.out.println(LINEBAR);\n }", "public void run() throws IOException {\n String EXIT_COMMAND = \"7\";\n ui.printIntro();\n ui.printExeType();\n String exeCommand = ui.getStringInput();\n while (!exeCommand.equals(EXIT_COMMAND)) {\n Parser parser = new Parser(ui, tasks);\n parser.parseCommand(exeCommand); //to select the exeType and execute it\n ui.printExeType(); //user guide after execution of command\n exeCommand = ui.getStringInput(); //get the next command\n }\n ui.printExit();\n }", "public void showNext(View v){\n\n //create our database for the tasks\n TasksDBHelper tasksDBHelper = new TasksDBHelper(getApplicationContext());\n //Set DB repository in write mode\n SQLiteDatabase db = tasksDBHelper.getWritableDatabase();\n\n\n\n //capture the text that is entered for tasks 1 to 3.\n EditText task1 = (EditText)findViewById(R.id.task1);\n EditText task2 = (EditText)findViewById(R.id.task2);\n EditText task3 = (EditText)findViewById(R.id.task3);\n\n //Convert the tasks to a string to write to the DB\n //need to convert editText to a string\n String myTask1 = task1.getText().toString();\n String myTask2 = task2.getText().toString();\n String myTask3 = task3.getText().toString();\n\n\n\n\n\n //Adding the tasks to the DB to be set and read later\n ContentValues tasks = new ContentValues();\n tasks.put(TasksDBHelper.FIELD_REWARD, myTask1);\n tasks.put(TasksDBHelper.FIELD_REWARD_1, myTask2);\n tasks.put(TasksDBHelper.FIELD_REWARD_2, myTask3);\n db.insert(TasksDBHelper.TABLE_NAME, null, tasks);\n\n //use intent to move us to next screen\n // Take us to enter the time\n Intent mainIntent = new Intent(this, MainActivity.class);\n startActivity(mainIntent);\n\n }", "public void run() {\n TasksCounter tc = new TasksCounter(tasks);\n new Window(tc);\n Ui.welcome();\n boolean isExit = false;\n Scanner in = new Scanner(System.in);\n while (!isExit) {\n try {\n String fullCommand = Ui.readLine(in);\n Command c = Parser.commandLine(fullCommand);\n c.execute(tasks, members, storage);\n isExit = c.isExit();\n } catch (DukeException e) {\n Ui.print(e.getMessage());\n }\n }\n }", "private void run() \n{\n String answer;\t//console answer\n \tboolean error;\t//answer error flag\n \terror = false;\n \tdo {\t\t\t\t\t\t\t//get the right answer\n \t \t//Take user input\n \t \t//System.out.println(\"\\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\\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\");\n \t\t\tSystem.out.println(\"Would you like to enter GUI or TIO?\");\n \t\t\tanswer = console.nextLine();\n \t \tif(answer.equals(\"GUI\"))\n \t\t\t{\n \t\t\t\terror = false;\n \t\t\t\tlaunchGUI();\n \t\t\t}else if(answer.equals(\"TIO\"))\n \t\t\t{\n \t\t\t\terror = false;\n \t\t\t\tlaunchTIO();\n \t\t\t}else\n \t\t\t{\n \t\t\t\t//Error: Not correct format\n \t\t\t\terror = true;\n \t\t\t\tSystem.out.println(\"I couldn't understand your answer. Please enter again \\n\");\n \t\t\t}\n \t\t}while (error == true);\n\n}", "private void doAddTask() {\n System.out.println(\n \"Kindly enter the time, description and date of the task you would like to add on separate lines.\");\n String time = input.nextLine();\n String description = input.nextLine();\n String date = input.nextLine();\n todoList.addTask(new Task(time,description,date));\n System.out.println(time + \" \" + description + \" \" + date + \" \" + \"has been added.\");\n }", "private void executeChoice (int choice) {\n System.out.println();\n if (choice == PLAY_GAME) {\n displayPlayerMenu();\n player1 = selectPlayer(1);\n player2 = selectPlayer(2);\n System.out.println();\n int numberOfSticks = readNumberOfSticks();\n String whoPlaysFirst = readWhoPlaysFirst();\n playGame(numberOfSticks,whoPlaysFirst);\n } else if (choice == EXIT)\n System.out.println(\"Good-bye.\");\n else\n System.out.println(choice + \" is not valid.\");\n }", "private void processCommand(String command) {\n if (command.equals(\"a\")) {\n doAddTask();\n } else if (command.equals(\"r\")) {\n doRemoveTask();\n } else if (command.equals(\"c\")) {\n doMarkTaskAsCompleted();\n } else if (command.equals(\"m\")) {\n doModifyTask();\n } else if (command.equals(\"v\")) {\n doViewAllTasks();\n } else if (command.equals(\"ct\")) {\n doViewAllCompletedTasks();\n } else if (command.equals(\"s\")) {\n saveTasks();\n } else {\n System.out.println(\"Invalid selection, kindly select from the options available.\");\n }\n }", "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 }", "@Override\n public Response runCommand(TaskList arrayOfTasks, Ui ui, Storage storage) {\n assert arrayOfTasks != null || ui != null || storage != null\n : \"arrayOfTasks, Ui and Storage objects cannot be null\";\n Response responseObject = ui.helpText();\n return responseObject;\n }", "public void confirmSelection() {\n\t\t//create and display an AlertDialog requesting a filename for the new capture\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(context);\n\t\tbuilder.setTitle(\"What did you hear?\");\n\t\tfinal EditText inputText = new EditText(context);\n\t\tinputText.setInputType(InputType.TYPE_CLASS_TEXT|InputType.TYPE_TEXT_FLAG_CAP_SENTENCES|InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);\n\t\tbuilder.setView(inputText);\n\n\t\tbuilder.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() { \n\t\t\t@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t// execute the capture operations:\n\t\t\t\tfilename = inputText.getText().toString().trim();\n\t\t\t\tnew CaptureTask(context).execute();\n\t\t\t}\n\t\t});\n\t\tbuilder.setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\tdialog.cancel();\n\t\t\t}\n\t\t});\n\t\tbuilder.show();\n\t}", "public static void main(String[] args) throws InterruptedException {\n\t\tSystem.out.println(\"Danton: Captain sir, I am to show you the ropes of this operation.\");\r\n\t\tThread.sleep(1000);\r\n\t\tSystem.out.println(\"Danton: Our target today is in an old resource depot near Tharsis highway.\");\r\n\t\tThread.sleep(1000);\r\n\t\tSystem.out.println(\"Danton: Do you have any questions about an operation, sir?\");\r\n\t\t\r\n\t\tString opAnswers[] = {\"What is an operation?\", \"What are the results of an operation?\", \"Nothing.\"};\r\n\t\t\r\n\t\tboolean answers = false;\r\n\t\t\r\n\t\tdo{\r\n\t\tString opResponses = (String) JOptionPane.showInputDialog(null, \"Questions?\", null, JOptionPane.QUESTION_MESSAGE,null, opAnswers, opAnswers[0]);\r\n\t\t\r\n\t\tif (opResponses == \"What is an operation?\"){\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Danton: An operation is a mission where you head down to the surface of the planet with a specific purpose in mind.\");\r\n\t\t\tanswers = false;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tif (opResponses == \"What are the results of an operation?\") {\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Danton: If you successfully complete the mission, the ship may get water, food, or raw materials. Cool items may also be found planetside\");\r\n\t\t\tSystem.out.println(\"Whether you fail or pass an operation, however, your ship's food, water, and fuel supply diminish.\");\r\n\t\t\tanswers = false;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tif (opResponses == \"Nothing.\")\r\n\t\t\r\n\t\t\tanswers = true;\r\n\t\t\r\n\t\t}while (answers == false);\r\n\t\t\r\n\t\t\r\n\t\tSystem.out.println(\"Danton: Very well sir.\");\r\n\t\tSystem.out.println(\"Danton: Scanners indicate a hostile presence in the area. \");\r\n\t\tSystem.out.println(\"Danton: Don't worry about getting shot too much, our med bay should patch you up so long as you aren't dead.\");\r\n\t\tSystem.out.println(\"I'll head around, you hold guard.\");\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"The ensuing, somber silence is shaken by a sniper shot\");\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Raider: Let's see what you're made of!\");\r\n\t\t\r\n\t\tint enemyhealth = 30;\r\n\t\tint health = 100;\r\n\t\tboolean cantFlee = false;\r\n\t\t\r\n\t\tcombat.battle(health, enemyhealth,cantFlee);\r\n\t}", "@Override\n protected void execute() {\n switch (Intake.intakeState) {\n case 2:\n Robot.intake.setCargoIntakeOutput(RobotMap.CARGO_INTAKE_SPEED);\n break;\n case 1:\n Robot.intake.setHatchGroundIntakeOutput(RobotMap.HATCH_GROUND_INTAKE_SPEED);\n break;\n case 0:\n default:\n //Robot.intake.setHarpoonExtend(true);\n Robot.intake.setHatchIntakeOutput(RobotMap.HATCH_INTAKE_SPEED);\n //Robot.intake.setHarpoonSecure(false);\n //Timer.delay(0.2);\n //Robot.intake.setHarpoonSecure(true);\n break;\n }\n }", "public void run() {\n LocalDateTime now = LocalDateTime.now();\n int month = now.getMonthValue();\n int day = now.getDayOfMonth();\n int year = now.getYear();\n String workingDate = \"\" + month + day + year;\n cio.print(\"\\nThe current date is \" + month + \"/\" + day + \"/\" + year);\n\n myOrder.load(workingDate);\n myProduct.load();\n myTax.load();\n\n int command = 0;\n\n while (command != 7) {\n command = ui.promptMenuChoice();\n switch (command) {\n case 1:\n boolean wantToSave = ui.promptToSave();\n if (wantToSave) {\n myOrder.save(workingDate);\n cio.print(\"Your work has been saved.\\n\");\n }\n //set date\n workingDate = ui.promptForDate();\n myOrder.load(workingDate);\n break;\n case 2:\n //add order\n addOrder(workingDate);\n break;\n case 3:\n //display all orders\n displayAllOrders(workingDate);\n break;\n case 4:\n //edit an order\n editOrder();\n break;\n case 5:\n //cancel an order\n cancelOrder();\n break;\n case 6:\n myOrder.save(workingDate);\n cio.print(\"Your work has been saved.\\n\");\n break;\n case 7:\n //prompt to save\n wantToSave = ui.promptToSave();\n if (wantToSave) {\n myOrder.save(workingDate);\n cio.print(\"Your work has been saved.\\n\");\n }\n //quit program\n default:\n break;\n }\n }\n myProduct.save();\n myTax.save();\n }", "@Override\n public void run(String... args) throws Exception {\n\n TaskTemplate finalProjectDemo = new TaskTemplate(\"Final Project Demo\", \"Finishing the Demo\", 300, \"Tuesday\");\n taskTemplateStorage.save(finalProjectDemo);\n\n User mom = new User(\"Mom\", 300, \"rose\", \"/front-end/images/mom.png\");\n User dad = new User(\"Dad\", 600, \"apple\", \"/front-end/images/Dad.png\");\n User bro = new User(\"Bro\", 200, \"light-blue\", \"/front-end/images/Bro.png\");\n User sis = new User(\"Sis\", 200, \"magenta\", \"/front-end/images/sis.png\");\n\n\n// userStorage.save(testUser);\n userStorage.save(mom);\n userStorage.save(dad);\n userStorage.save(bro);\n userStorage.save(sis);\n\n\n\n TaskTemplate cleanCommonArea = new TaskTemplate(\"Clean Common Area\", \"Clean all common areas\", 30, 30, \"Monday\");\n TaskTemplate cleanGarage = new TaskTemplate(\"Clean Garage\", \"Sweep and organize the Garage\", 45, 45, \"Tuesday\");\n TaskTemplate cleanBathrooms = new TaskTemplate(\"Clean Bathrooms\", \"Wipe down sinks, scrub toilets, sweep and mop floors, and empty bathroom trash\", 30, 30, \"Wednesday\");\n TaskTemplate takeOutTrash = new TaskTemplate(\"Take Out Trash\", \"Take all trash to rolling bin outside and take the rolling bin to the road if today is a trash day\", 15,\"Wednesday\" );\n TaskTemplate washDishes = new TaskTemplate(\"Wash Dishes\", \"Wash and dry all dishes in the sink and empty/load the dishwasher\", 30, \"Wednesday\");\n TaskTemplate washAndDryLaundry = new TaskTemplate(\"Wash and Dry Laundry\", \"\", 30, 200, \"Monday\");\n TaskTemplate foldAndPutAwayLaundry = new TaskTemplate(\"Fold and Put Away Laundry\", \"\", 30, \"Monday\");\n TaskTemplate rakeLeaves = new TaskTemplate(\"Rake Leaves\", \"Rake and bag the leaves from the front, back, and sides of the house\", 45, \"Monday\");\n TaskTemplate mowLawn = new TaskTemplate(\"Mow Lawn\", \"Pick up rocks and sticks in the yards and mow the front and back lawn\", 45, \"Monday\");\n TaskTemplate cleanBedroom = new TaskTemplate(\"Clean Bedroom\", \"Clean your room\", 30, \"Tuesday\");\n TaskTemplate deepCleanKitchen = new TaskTemplate(\"Deep Clean Kitchen\", \"Clear off and wipe down all counter tops, wipe cabinet fronts, wipe behind sink, wipe trim boards under cabinets, sweep, and mop kitchen\", 90, \"Tuesday\");\n TaskTemplate tidyKitchen = new TaskTemplate(\"Tidy Kitchen\", \"Move dishes to sink, wipe down counter tops and table, and sweep floors\", 30, \"Tuesday\");\n TaskTemplate vacuumLivingRoom = new TaskTemplate(\"Vacuum Living Room\", \"Vacuum floors, crevases, and under furniture, and remove couch cushions to vacuum under cushions\", 30, \"Tuesday\");\n TaskTemplate mopAndSweepKitchen = new TaskTemplate(\"Mop and Sweep Kitchen\", \"Sweep and hot mop the kitchen floors\", 30, \"Thursday\");\n TaskTemplate changeLitterBox = new TaskTemplate(\"Change Litter Box\", \"Scoop the litter box and replace the litter if today is Friday\", 15, \"Thursday\");\n TaskTemplate walkDog = new TaskTemplate(\"Walk Dog\", \"Take the dogs for a walk around the block\", 20, \"Daily\");\n TaskTemplate cleanUpYard = new TaskTemplate(\"Clean Up Yard\", \"Pick up sticks and rocks in the front and back yard and pick up any trash that has blown in\", 20, \"Thursday\");\n TaskTemplate getMail = new TaskTemplate(\"Get Mail\", \"Get the mail from the mailbox\", 5, \"Daily\");\n TaskTemplate dustLivingRoom = new TaskTemplate(\"Dust Living Room\", \"Dust picture frames, end tables, coffee table, and door sills in the living room\", 20, \"Friday\");\n TaskTemplate dustFamilyRoom = new TaskTemplate(\"Dust Family Room\", \"Dust bookshelves, mantel over fireplace, stereo, and door sills in family room\", 20, \"Friday\");\n TaskTemplate vacuumFamilyRoom = new TaskTemplate(\"Vacuum Family Room\", \"Vacuum floors, crevases, and under furniture in the family room\", 20, \"Friday\");\n TaskTemplate dustCeilingFans = new TaskTemplate(\"Dust Ceiling Fans\", \"Wipe blades of ceiling fans down and ensure dust is blown out of fan motor housing\", 30, \"Friday\", bro, sis);\n\n taskTemplateStorage.save(cleanCommonArea);\n taskTemplateStorage.save(cleanGarage);\n taskTemplateStorage.save(cleanBathrooms);\n taskTemplateStorage.save(takeOutTrash);\n taskTemplateStorage.save(washDishes);\n taskTemplateStorage.save(washAndDryLaundry);\n taskTemplateStorage.save(foldAndPutAwayLaundry);\n taskTemplateStorage.save(rakeLeaves);\n taskTemplateStorage.save(mowLawn);\n taskTemplateStorage.save(cleanBedroom);\n taskTemplateStorage.save(deepCleanKitchen);\n taskTemplateStorage.save(tidyKitchen);\n taskTemplateStorage.save(vacuumLivingRoom);\n taskTemplateStorage.save(mopAndSweepKitchen);\n taskTemplateStorage.save(changeLitterBox);\n taskTemplateStorage.save(walkDog);\n taskTemplateStorage.save(cleanUpYard);\n taskTemplateStorage.save(getMail);\n taskTemplateStorage.save(dustLivingRoom);\n taskTemplateStorage.save(dustFamilyRoom);\n taskTemplateStorage.save(vacuumFamilyRoom);\n taskTemplateStorage.save(dustCeilingFans);\n\n resourceManager.allocateAllTasks();\n\n }", "@Test\n\tpublic void Quotes_28078_execute() throws Exception {\n\t\tVoodooUtils.voodoo.log.info(\"Running \" + testName + \"...\");\n\n\t\tsugar().quotes.navToListView();\n\t\tsugar().quotes.listView.clickRecord(1);\n\n\t\tFieldSet tasksFS = new FieldSet();\n\t\ttasksFS.put(\"subject\", sugar().tasks.getDefaultData().get(\"subject\"));\n\n\t\tBWCSubpanel activitySubpanel = sugar().quotes.detailView.subpanels.get(sugar().tasks.moduleNamePlural);\n\t\tactivitySubpanel.subpanelAction(\"#formActivities\");\n\t\tsugar().tasks.createDrawer.getEditField(\"subject\").set(tasksFS.get(\"subject\"));\n\t\tsugar().tasks.createDrawer.save();\n\n\t\t// Verify created Task should be shown in the Activities subpanel.\n\t\tactivitySubpanel.verify(1, tasksFS, true);\n\n\t\tVoodooUtils.voodoo.log.info(testName + \" complete.\");\n\t}", "public void execute(TaskList taskList, Ui ui, Storage storage) throws DukeException {\n\n }", "public void createTask() {\n \tSystem.out.println(\"Inside createTask()\");\n \tTask task = Helper.inputTask(\"Please enter task details\");\n \t\n \ttoDoList.add(task);\n \tSystem.out.println(toDoList);\n }", "public void toolAccepted()\n {\n printOut(cliToolsManager.simpleQuestionsMaker(\"Strumento accettato\", 40, true));\n }", "public void createTask(View view){\n\n String title = ((EditText) findViewById(R.id.title)).getText().toString();\n String description = ((EditText) findViewById(R.id.description)).getText().toString();\n\n if(TextUtils.isEmpty(title) || TextUtils.isEmpty(description)) {\n if (TextUtils.isEmpty(title))\n Toast.makeText(this, \"Title cannot be empty\", Toast.LENGTH_SHORT).show();\n\n if (TextUtils.isEmpty(description))\n Toast.makeText(this, \"Description cannot be empty\", Toast.LENGTH_SHORT).show();\n } else {\n\n Intent intent = new Intent();\n intent.putExtra(TITLE, title);\n intent.putExtra(DESCRIPT, description);\n\n setResult(RESULT_OK, intent);\n this.finish();\n }\n }", "private static void taskProcess(String input)\r\n\t{\r\n\t\tswitch (input.toUpperCase())\r\n\t\t{\r\n\t\t\tcase CREATE:\r\n\t\t\t{\r\n\t\t\t\tPostTaskService postTask = new PostTaskService();\r\n\t\t\t\tpostTask.createTask();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tcase GET:\r\n\t\t\t{\r\n\t\t\t\tGetTaskService getTask = new GetTaskService();\r\n\t\t\t\tList<Task> taskList = getTask.getAllTasks();\r\n\t\t\t\tTaskSchedulerUtil.getInstance().printTasks(taskList);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tcase START:\r\n\t\t\t{\r\n\t\t\t\tStartTaskService startTask = new StartTaskService();\r\n\t\t\t\tstartTask.startTask();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tcase END:\r\n\t\t\t{\r\n\t\t\t\tEndTaskService endTask = new EndTaskService();\r\n\t\t\t\tendTask.endTask();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void q1Submit(View view) {\n\n EditText editText = (EditText) findViewById(R.id.q1enterEditText);\n String q1answer = editText.getText().toString().trim();\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if ((q1answer.toLowerCase().equals(getString(R.string.q1AnswerCheck1))) || (q1answer.toLowerCase().equals(getString(R.string.q1AnswerCheck2)))) {\n if (isNotAnsweredQ1) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct1), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ1 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }", "public void runSequential() {\n int exitVal = -101;\n try {\n exitVal = tsk.executeTask(ss == null ? null : ss.getHiveHistory());\n } catch (Throwable t) {\n if (tsk.getException() == null) {\n tsk.setException(t);\n }\n LOG.error(\"Error in executeTask\", t);\n }\n if (tsk.getException() != null) {\n result.setTaskError(tsk.getException());\n }\n result.setExitVal(exitVal);\n taskQueue.releaseRunnable();\n }", "private void runToDoList() {\n boolean keepGoing = true;\n String command = null;\n input = new Scanner(System.in);\n\n loadTasks();\n\n while (keepGoing) {\n presentMenu();\n command = input.nextLine();\n command = command.toLowerCase();\n\n if (command.equals(\"e\")) {\n keepGoing = false;\n } else {\n processCommand(command);\n }\n }\n System.out.println(\"\\nHave a nice day!\");\n }", "@Override\r\n\tpublic void execute(SailPointContext context, TaskSchedule arg1, TaskResult arg2, Attributes<String, Object> arg3)\r\n\t\t\tthrows Exception {\n\t\tString role = \"\";\r\n\t\tif(arg3.get(\"role\") != null){\r\n\t\t\trole = (String)arg3.get(\"role\");\r\n\t\t\tlogger.debug(CLASS_NAME + \" role that will be processed \" + role);\r\n\t\t}else{\r\n\t\t\tlogger.debug(CLASS_NAME + \" role argument's not found\");\r\n\t\t}\r\n\t\t\r\n\t\tif(arg3.get(\"branchCode\") != null){\r\n\t\t\tString input = (String)arg3.get(\"branchCode\");\r\n\t\t\tlogger.debug(CLASS_NAME + \" branchcode that will be processed \" + input);\r\n\t\t\t\r\n\t\t\tString branchCode = \"\";\r\n\t\t\tif(\"all\".equalsIgnoreCase(input)){\r\n\t\t\t\t\r\n\t\t\t\tlogger.debug(CLASS_NAME + \" will process all branch\");\r\n\t\t\t\t\r\n\t\t\t\t\tList branches = BranchUtil.getAllBranchCode(context);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(branches != null && branches.size() > 0){\r\n\t\t\t\t\t\tlogger.debug(\"branch tidak kosong\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tint listLength = branches.size();\r\n\t\t\t\t\t\tfor(int bob=0; bob<listLength; bob++){\r\n\t\t\t\t\t\t\tbranchCode = (String)branches.get(bob);\r\n\t\t\t\t\t\t\tlogger.debug(CLASS_NAME + \" process branch\" + branchCode);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tdeleteroleAssignments(context, branchCode, role);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tString[] arrBranchCode = input.split(\",\");\r\n\t\t\t\tint len = arrBranchCode.length;\r\n\t\t\t\tfor(int i=0; i<len; i++){\r\n\t\t\t\t\tbranchCode = arrBranchCode[i].trim();\r\n\t\t\t\t\tlogger.debug(CLASS_NAME + \" Branch Code : \" + branchCode);\r\n\t\t\t\t\t\r\n\t\t\t\t\tdeleteroleAssignments(context, branchCode, role);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tlogger.debug(CLASS_NAME + \" branchCode argument's not found\");\r\n\t\t}\r\n\t}", "public String execute(TaskList tasks, Storage storage) {\n return \"Bye boss! Hope to see you again soon! ^.^\";\n }", "@Override\r\n public void run() {\n if (preferences.getBoolean(\"isMain\",false))\r\n {\r\n startActivity(new Intent(SplashScreen.this,MainActivity.class));\r\n finish();\r\n }else {\r\n editor.putBoolean(\"isMain\",true);\r\n editor.apply();\r\n\r\n TaskStackBuilder.create(SplashScreen.this)\r\n .addNextIntentWithParentStack(new Intent(SplashScreen.this,MainActivity.class))\r\n .addNextIntent(new Intent(SplashScreen.this,IntroActivity.class))\r\n .startActivities();\r\n }\r\n }", "@Override\r\n public void run() {\r\n InputReader reader = new InputReader();\r\n String choice;\r\n do{\r\n System.out.println(\"Please stand still when probe is in you temple.\");\r\n choice = reader.getText(\"Start? Y for yes / N for no\");\r\n } while (!choice.equalsIgnoreCase(\"y\") && !choice.equalsIgnoreCase(\"n\"));\r\n TimeAux.systemSleep(5);\r\n if(choice.equalsIgnoreCase(\"y\")){\r\n runTests();\r\n System.out.println(getInfo());\r\n }\r\n }", "@Override\n\tpublic void execute() {\n\t\tboolean cashDispensed=false;\n\t\tdouble availableBalance;\n\t\tBankDatabase bankDatabase=getBankDatabase();\n\t\tScreen screen=getScreen();\n\t\tdo{\n\t\t\tamount=displayMenuOfAmounts();\n\t\t\tif(amount!=CANCELED){\n\t\t\t\tavailableBalance=bankDatabase.getAvailableBalance(getAccountNumber());\n\t\t\t\tif(amount<=availableBalance){\n\t\t\t\t\tif(cashDispenser.issufficientCashAvailable(amount)){\n\t\t\t\t\t\tbankDatabase.debit(getAccountNumber(), amount);\n\t\t\t\t\t\tcashDispenser.dispenseCash(amount);\n\t\t\t\t\t\tcashDispensed=true;\n\t\t\t\t\t\tscreen.displayMessageLine(\"\\nYour cash has been\" + \" dispensed. Please take your cash now.\");\n\t\t\t\t\t}\n\t\t\t\t\telse{//cash dispenser does not have enough cash\n\t\t\t\t\t\tscreen.displayMessageLine(\"\\nInsuffcient cash available in the ATM.\" + \"\\n\\nPlease choose a smaller amount.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{//not enough money available in user's account\n\t\t\t\t\tscreen.displayMessageLine(\"\\n insufficient funds in your account.\" + \"]n\\nPlease choose a smaller amount.\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tscreen.displayMessageLine(\"\\nCancelling transaction...\");\n\t\t\t\treturn;//return to main menu, because user cancelled\n\t\t\t}\n\t\t} while(!cashDispensed);\n\t}", "@Override\n\tpublic void answer(Task t) {\n\t\t// TODO Auto-generated method stub\n\t\ttry {\n\t\t\tanswers.put(t);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n public void onClick(View v) {\n String url = csp_server+\"/\"+userId+\"/answer/\"+questionId;\n AnswerQuestion ansq = new AnswerQuestion();\n String finalAns = \"No\";\n if(answer)\n finalAns = \"Yes\";\n ansq.execute(url, finalAns);\n Log.d(\"Notification-debug\", \"Submit button\");\n finish();\n\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n postTaskState(\"\", 13 + \"\");\n }" ]
[ "0.5996974", "0.57933354", "0.5737513", "0.56227565", "0.5587669", "0.5580666", "0.5552843", "0.5469504", "0.5460453", "0.5459535", "0.54464215", "0.54089487", "0.5364835", "0.535935", "0.5334309", "0.5299293", "0.5282253", "0.5255164", "0.5252614", "0.52399844", "0.52343595", "0.52316296", "0.5231179", "0.52244127", "0.5221822", "0.5218306", "0.5218188", "0.52167726", "0.5210378", "0.5178185", "0.51733685", "0.5165687", "0.51434475", "0.51328534", "0.51214534", "0.5121445", "0.5096915", "0.50925714", "0.5083495", "0.5081582", "0.50797135", "0.5077604", "0.50679076", "0.5065422", "0.5059984", "0.5058942", "0.50557965", "0.5055159", "0.50496", "0.50153106", "0.5004991", "0.49970385", "0.49876705", "0.49811372", "0.49797204", "0.4974078", "0.4971774", "0.49687558", "0.49673265", "0.49531785", "0.49530023", "0.49508512", "0.49472988", "0.4945118", "0.49394023", "0.49393868", "0.4925084", "0.4924757", "0.49169374", "0.49141714", "0.49117988", "0.49110442", "0.48972553", "0.48970824", "0.48901245", "0.488996", "0.48833635", "0.4878128", "0.48760086", "0.4872831", "0.48726842", "0.4871877", "0.4868183", "0.48638976", "0.48579413", "0.48565063", "0.48555055", "0.48520032", "0.4851299", "0.48500127", "0.48489258", "0.48417816", "0.48324698", "0.4829533", "0.48281324", "0.48272848", "0.4820558", "0.48189837", "0.48177615", "0.4816592" ]
0.6074495
0