This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MultipleThreads{ | |
public static void main(String[] args) { | |
MyThread m = new MyThread(); | |
m.setName("m"); | |
m.run(); | |
m.start(); | |
MyThread m2 = new MyThread(); | |
m2.setName("m2"); | |
m2.run(); | |
m2.start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SPECIES: | |
chebi: | |
for ~ http://identifiers.org/chebi/CHEBI:15905 | |
<annotation> | |
<rdf:RDF> | |
<rdf:Description rdf:about="#meta_s_0017"> | |
<bqbiol:is> | |
<rdf:Bag> | |
<rdf:li rdf:resource="http://identifiers.org/chebi/CHEBI:15905"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String getBiggIdFromSynonym(String data_source_biggId, String synonym, String type){ | |
String biggId = new String(); | |
String query; | |
switch (type){ | |
case TYPE_SPECIES: | |
query = SELECT + "c." + COLUMN_BIGG_ID + FROM + COMPONENT + " c, " + DATA_SOURCE + " d, " + SYNONYM + " s" | |
+ WHERE + "d." + COLUMN_BIGG_ID + " = '%s' AND d." + COLUMN_ID + " = s." + | |
COLUMN_DATA_SOURCE_ID + " AND s." + COLUMN_SYNONYM + " = '%s' AND s." + COLUMN_OME_ID + " = c." | |
+ COLUMN_ID; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean isGenePresentInBigg(GeneProduct geneProduct){ | |
String id = geneProduct.getId(); | |
if(id.startsWith("G_")){ | |
id=id.substring(2); | |
} | |
String query = SELECT + COLUMN_LOCUS_TAG + FROM + GENE + WHERE + COLUMN_LOCUS_TAG + " = '%s'"; | |
try { | |
ResultSet rst = connector.query(query,id); | |
return rst.next(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private String getGeneProductBiGGIdFromUriList(List<String> list_Uri) { | |
String biggId = null; | |
for(String uri : list_Uri){ | |
String dataSource, synonym_id, currentBiGGId; //currentBiGGId is id calculated in current iteration | |
synonym_id = uri.substring(uri.lastIndexOf('/')+1); | |
uri = uri.substring(0,uri.lastIndexOf('/')); | |
dataSource = uri.substring(uri.lastIndexOf('/')+1); | |
//updating the dataSource and synonym_id to match bigg database | |
switch (dataSource){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private String getSpeciesBiGGIdFromUriList(List<String> list_Uri){ | |
String biggId = null; | |
for(String uri : list_Uri){ | |
String dataSource, synonym_id, currentBiGGId; //currentBiGGId is id calculated in current iteration | |
synonym_id = uri.substring(uri.lastIndexOf('/')+1); | |
//crop uri to remove synonym identifier from end | |
uri = uri.substring(0,uri.lastIndexOf('/')); | |
dataSource = uri.substring(uri.lastIndexOf('/')+1); | |
//updating the dataSource and synonym_id to match bigg database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private String getReactionBiGGIdFromUriList(List<String> list_Uri){ | |
String biggId = null; | |
for(String uri : list_Uri){ | |
String dataSource, synonym_id, currentBiGGId; //currentBiGGId is id calculated in current iteration | |
synonym_id = uri.substring(uri.lastIndexOf('/')+1); | |
uri = uri.substring(0,uri.lastIndexOf('/')); | |
dataSource = uri.substring(uri.lastIndexOf('/')+1); | |
//updating the dataSource and synonym_id to match bigg database | |
switch (dataSource){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ThreadUsingThreadClass{ | |
public static void main(String[] args) { | |
System.out.println("Main thread name: "+ Thread.currentThread().getName()); | |
Thread t = new Thread(/*Thread name*/"Thread 1"); | |
t.start(); | |
// "Thread" constructor with thread_name parameter not "MyThread" | |
// MyThread mt = new MyThread("Example_Thread"); | |
// mt.start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ThreadUsingRunnableInterface{ | |
public static void main(String[] args) { | |
//without name | |
Thread t1 = new Thread(new MyRunnable()); | |
t1.start(); | |
//with name | |
Thread t2 = new Thread(new MyRunnable(), "Example_thread"); | |
t2.start(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ThreadUsingRunnableInterface{ | |
public static void main(String[] args) { | |
Thread t2 = new Thread( | |
()-> { | |
System.out.println("Thread name: "+ Thread.currentThread().getName()); | |
System.out.println("Thread id: "+ Thread.currentThread().getId()); | |
}, "Example_thread"); | |
t2.start(); | |
} | |
} |
OlderNewer