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
TODO Autogenerated method stub
public Remote getPort(Class arg0) throws ServiceException { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
public Remote getPort(QName arg0, Class arg1) throws ServiceException { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
public Iterator getPorts() throws ServiceException { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
public QName getServiceName() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
public TypeMappingRegistry getTypeMappingRegistry() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
public URL getWSDLDocumentLocation() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
============= Receiver code that receives data over a socket ==============
public TerminalScanReceiver() { super(StorageLevel.MEMORY_ONLY()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void receiveData() throws IOException;", "public abstract void RecvData(int sock, String Data) throws LowLinkException, TransportLayerException;", "public void packetReceiver(Socket socket);", "@Override\r\n\t\t\tpublic void run() {\n\r\n\t\t\t\twhile (!socket.isClosed()) {\r\n\r\n\t\t\t\t\tString line;\r\n\r\n\t\t\t\t\ttry {\r\n\r\n\t\t\t\t\t\tsocket.receive(recPacket);\r\n\r\n\t\t\t\t\t\tline = new String(recPacket.getData(), 0 , recPacket.getLength());\r\n\r\n\t\t\t\t\t\tbyte id = Byte.parseByte(line.substring(0, line.indexOf(\" \")));\r\n\r\n\t\t\t\t\t\tString payload = line.substring(line.indexOf(\" \") + 1, line.length());\r\n\r\n\t\t\t\t\t\tpacketMan.getPacketById(id).onRecieve(id, payload);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//System.out.println(payload);\r\n\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te.printStackTrace();\r\n\r\n\t\t\t\t\t\tdisconnect();\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}", "protected void receive() {\n // System.out.println(\"in MessageSocketUDP::Receive\");\n try {\n DatagramPacket p = new DatagramPacket(receiveBuffer.buffer, receiveBuffer.offset(), receiveBuffer.available());\n datagramSocket.receive(p);\n int nbRead = p.getLength();\n if (nbRead == 0) {\n System.out.println(\"MessageSocketUDP::receive (read=0)\");\n connected = false;\n } else {\n receiveBuffer.received(nbRead);\n receiveBuffer.process();\n }\n } catch (IOException e) {\n System.out.println(\"MessageSocketUDP::receive Error\");\n e.printStackTrace();\n connected = false;\n }\n }", "private void receive() {\r\n\t\ttry {\r\n\t\t\trcvpkt = filter.read();\t\t\t\t\t\t\t// Simulates Transfer-Failures and Errors in the received data\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private void receive() {\n receive = new Thread(\"Receive\") {\n public void run() {\n while (running) {\n byte[] data = new byte[1024];\n DatagramPacket packet = new DatagramPacket(data, data.length);\n try {\n socket.receive(packet);\n } catch (IOException e) {\n e.printStackTrace();\n }\n processPacket(packet);\n }\n }\n };\n receive.start();\n }", "public void receive() {\n try {\n ServerSocket s0 = new ServerSocket(PORT);\n s = s0.accept();\n rm.closeProgram();\n r = new BufferedReader(new InputStreamReader(s.getInputStream(), StandardCharsets.US_ASCII));\n w = new BufferedWriter(new OutputStreamWriter(s.getOutputStream(), StandardCharsets.US_ASCII));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "void onDataReceived(int source, byte[] data);", "String processDataFromSocket(String data, long fromId);", "public abstract void run(Data data, Socket socket);", "public int receive_data(String filename) {\r\n\tif (_socket == null) {\r\n\t\tSystem.out.println(\"no socket\");\r\n\t\treturn 2;\r\n\t}\r\n\t\r\n\tDataInputStream inputStream = null;\r\n\t\r\n\ttry {\r\n\t\t// retreve the stream\r\n\t\tinputStream = _socket.getInputStream();\r\n\t\t\r\n\t} catch (Exception e) {\r\n\t\tSystem.out.println(\"getInputStream() failed\");\r\n\t\treturn 2;\r\n\t}\r\n\t\r\n\ttry {\r\n\t\tString msg_received;\r\n\t\t// send verification information\r\n\t\t_socket.send_msg(\"i love ex machina\");\r\n\t\t\r\n\t\t// get hands shaked\r\n\t\tmsg_received = _socket.receive_msg();\r\n\t\tif (msg_received.equals(\"machina\")) {\r\n\t\t\tSystem.out.println(\"get machina. cool!\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"hand shake failed.\");\r\n\t\t\t_socket.disconnect();\r\n\t\t\treturn 2;\r\n\t\t}\r\n\t\t\r\n\t\t// send ur real need\r\n\t\t_socket.send_msg(\"need a file\");\r\n//\t\t_socket.send_msg(\"list all files\");\r\n\t\tmsg_received = _socket.receive_msg();\r\n\t\t\r\n\t\t// send required filename\r\n\t\t_socket.send_msg(filename);\r\n\t\t\r\n\t // 接收part1, which is filename\r\n\t String fullname = _socket.receive_msg();\r\n _socket.send_msg(\"ok\");\r\n\t if (!fullname.equals(filename))\r\n\t {\r\n\t\t System.out.println(fullname);\r\n\t\t System.out.println(\"file does not exist in the server.\\n\");\r\n\t\t\t _socket.disconnect();\r\n\t\t\t return 3;\r\n\t }\r\n\t \r\n\t System.out.println(fullname + \" is good.\");\r\n\t fullname = _savedir + fullname; \r\n\r\n\t // receive part2, which is file size. \r\n\t long filesize = Integer.parseInt(_socket.receive_msg());\r\n\t _socket.send_msg(\"ok\");\r\n\t System.out.println(\"file length: \" + filesize + \"\\n\");\r\n\r\n\t // 用于接收二进制文件流的stream, get ready for receiving the third part, which is the binary content\r\n\t DataOutputStream fileStream = null;\r\n\t try {\r\n\t\t FileOutputStream fileoutputStream = new FileOutputStream(fullname);\r\n\t\t BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(fileoutputStream);\r\n\t\t fileStream = new DataOutputStream(bufferedOutputStream);\r\n \t } catch (Exception e1) {\r\n\t\t\ttry {\r\n\t\t\t\tinputStream.close();\r\n\t\t\t} catch (IOException e2) {\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"file IO errer: \" + fullname);\r\n\t\t\treturn 1;\r\n \t }\r\n\t \r\n\t System.out.println(\"receiving file...\");\r\n\t \r\n\t // make some room for showing the progress percentage\r\n\t System.out.print(\"transfering: \");\r\n\t _lastpercentage_len = 0;\r\n\t String percent_show = \"what?\";\r\n\t \r\n\t int receive_total = 0;\r\n\t int bufferSize = 16384;\r\n\t byte[] receive_buff = new byte[bufferSize];\r\n\t // start to receive\r\n\t while (true) {\r\n\t \t int receive_current = 0;\r\n\t \t if (inputStream != null) {\r\n\t \t\t // beware that buffsize. only receive that amount of data each time\r\n\t \t\t receive_current = inputStream.read(receive_buff);\r\n\t \t }\r\n\t \t \r\n\t \t if (receive_current != -1){\r\n\t \t\t receive_total += receive_current;\r\n\t \t } else {\r\n\t \t\t break;\r\n\t \t }\r\n\r\n\t \t // just save those binary to file\r\n\t \t try {\r\n\t \t\t fileStream.write(receive_buff, 0, receive_current);\r\n\t \t } catch (Exception e1) {\r\n \t\t\ttry {\r\n \t\t\t\tinputStream.close();\r\n \t\t\t} catch (IOException e2) {\r\n \t\t\t\te1.printStackTrace();\r\n \t\t\t}\r\n \t\t\tSystem.out.println(\"file IO errer: \" + fullname);\r\n \t\t\treturn 1;\r\n\t \t }\r\n\t \t \r\n\t \t percent_show = 100.0 * receive_total / filesize + \"%\";\r\n\t \t for (int i=0; i<_lastpercentage_len; i++) {\r\n\t \t\t System.out.print('\\b');\r\n\t \t }\r\n\t \t System.out.print(percent_show);\r\n\t \t for (int i=percent_show.length(); i<_lastpercentage_len; i++) {\r\n\t \t\t System.out.print(' ');\r\n\t \t }\r\n\t \t for (int i=percent_show.length(); i<_lastpercentage_len; i++) {\r\n\t \t\t System.out.print('\\b');\r\n\t \t }\r\n\t \t _lastpercentage_len = percent_show.length();\r\n\t }\r\n\t \r\n\t fileStream.close();\r\n \t for (int i=0; i<_lastpercentage_len; i++) {\r\n \t\t System.out.print('\\b');\r\n \t }\r\n\t \r\n\t if (receive_total == filesize) {\r\n\t \t System.out.print(\"100%\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\\n\");\r\n\t \t System.out.println(\"\\nfile received: \" + fullname + \"\\n\");\r\n\t } else {\r\n\t \t System.out.println(\"\\nonly partial file was received!!! \" + \"file saved to \" + fullname + \"\\n\");\r\n\t }\r\n\t} catch (Exception e) {\r\n\t\ttry {\r\n\t\t\tinputStream.close();\r\n\t\t} catch (IOException e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\t\tSystem.out.println(\"oh boy, don't know where to start it.\" + \"\\n\");\r\n\t\treturn 2;\r\n\t}\r\n\r\n\ttry {\r\n\t\tinputStream.close();\r\n\t} catch (IOException e1) {\r\n\t\te1.printStackTrace();\r\n\t}\r\n\r\n\treturn 0;\r\n}", "@Override\n public synchronized byte[] receive(int length) throws SocketException {\n byte[] data = new byte[length];\n \n try {\n connectionSocket = serverSocket.accept();\n connectionSocket.getInputStream().read(data, 0, length);\n } catch (IOException ex) {\n Logger.getLogger(TCPServer.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n return data;\n }", "private void receivePacket() throws IOException {\n\t\tDatagramPacket packet = new DatagramPacket(new byte[SERVER_PACKET_MAX_SIZE], SERVER_PACKET_MAX_SIZE);\n\t\tsocket.receive(packet);\n\t\t\n\t\tbyte[] data = packet.getData();\n\t\tbyte[] body = Arrays.copyOfRange(data, PACKET_HEADER_SIZE, data.length);\n\t\t\n\t\tHeaderData header = readHeader(Arrays.copyOf(data, PACKET_HEADER_SIZE));\n\t\t\n\t\ttry {\n\t\t\thandler.get(header.label).handle(header, body);\n\t\t}catch (NullPointerException e) {\n\t\t\tSystem.out.println(\"CLIENT: Received unknown packet type: \" + header.label);\n\t\t}\n\t}", "@Override\r\n\t\tpublic void run() {\n\t\t\twhile (socket != null && !socket.isClosed()) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tbInputStream.read(rbyte);\r\n\t\t\t\t\t\tMessage msg = new Message();\r\n\t\t\t\t\t\tmsg.what = 1;\r\n\t\t\t\t\t\tmsg.obj = rbyte;\r\n\t\t\t\t\t\treHandler.sendMessage(msg);\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t}", "public void receiveData(){\n try {\n // setting up input stream and output stream for the data being sent\n fromClient = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n fileCount++;\n outputFile = new FileOutputStream(\"java_20/server/receivedFiles/receivedFile\"+fileCount+\".txt\");\n char[] receivedData = new char[2048];\n String section = null;\n\n //read first chuck of data and start timer\n int dataRead = fromClient.read(receivedData,0,2048);\n startTimer();\n\n //Read the rest of the files worth of data\n while ( dataRead != -1){\n section = new String(receivedData, 0, dataRead);\n outputFile.write(section.getBytes());\n\n dataRead = fromClient.read(receivedData, 0, 2048);\n }\n\n //stop timers\n endTimer();\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public int receivePacket(){\r\n\t\ttry{\t\t\r\n\t\t\tpacket = new DatagramPacket(buffer, bufLen);\r\n\t\t\tsock.setSoTimeout(0);//timeout infinito\r\n\t\t\tsock.receive(packet);\r\n\t\t}\r\n\t\tcatch(Exception ex){\r\n\t\t\tLogger.write(\"Errore ricezione pacchetto: \"+ex.getMessage());\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn 0;\r\n\t}", "@Override\n\tpublic void run()\n\t{\n\t\t try\n\t\t {\n\t\t\t DataInputStream stream = new DataInputStream(socket.getInputStream());\n\t\t\t byte[] data = new byte[3];\n\t\t\t data[0] = stream.readByte();\n\t\t\t data[1] = stream.readByte();\n\t\t\t data[2] = stream.readByte();\n\t\t\t short counter = stream.readShort();\n\n\t\t\t int checksum = data[0]+data[1]+counter;\n\n\t\t\t if(checksum+data[2] != 255)\n\t\t\t {\n\t\t\t\t System.out.println(\"Error: Message Checksum Failed\");\n\t\t\t\t return;\n\t\t\t }\n\n\t\t\t System.out.println(\"------Client-------\");\n\t\t\t System.out.println(\"Source:\"+(char)data[0]);\n\t\t\t System.out.println(\"Destination:\"+(char)data[1]);\n\t\t\t System.out.println(\"Data:\"+counter);\n\n }\n\t\t catch (IOException e)\n\t\t {\n\t\t\te.printStackTrace();\n\t\t }\n\t}", "public String receive() {\n\t\tbyte[] data = new byte[1024];\n\t\tDatagramPacket packet = new DatagramPacket(data, data.length);\n\t\t\n\t\t//put data into packet\n\t\ttry {\n\t\t\t// receive data that is send to socket, which knows the port\n\t\t\t//socket will sit until it receives sth --> will freeze application\n\t\t\t// need for threads\n\t\t\tsocket.receive(packet);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tString message = new String(packet.getData());\n\t\treturn message;\n\t}", "private void receive() throws IOException {\n byte[] lengthBuffer = new byte[4];\n dataInput.readFully(lengthBuffer);\n int length = Utilities.getIntFromByte(lengthBuffer, 0);\n pipedOutputStream.write(Utilities.getBytes(length));\n\n //now read the data indicated by length and write it to buffer\n byte[] buffer = new byte[length];\n dataInput.readFully(buffer);\n pipedOutputStream.write(buffer);\n pipedOutputStream.flush();\n clientBlocker();\n }", "public void readFromSocket(long socketId) {}", "public void readFromSocket() throws IOException, JSONException {\n int bytesAvailable = bluetoothSocket.getInputStream().available();\n if (bytesAvailable > 0) {\n byte[] msg = new byte[bytesAvailable];\n bluetoothSocket.getInputStream().read(msg);\n String receivedMessage = new String(msg);\n mListener.onMessageReceived(receivedMessage); //fire the message to the service\n Log.i(TAG, \"receivedMessage: \" + receivedMessage);\n }\n }", "@Override\n public void run() {\n P.print(\"Receive thread starts up.\");\n try {\n ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());\n while (P.choke_thread_running) { //read input forever.\n try{\n Object o = ois.readObject(); //blocking.\n if (o instanceof Handshake) { // this is a Handshake.\n Handshake hs = (Handshake)o;\n P.print(\"Received handshake from \"+hs.pid);\n }\n else if(o instanceof Message){ //this is a Message.\n Message M = (Message) o;\n if(M.type==0){\n P.print(\"Received choke from \"+t.getName());\n }\n else if(M.type==1){\n P.print(\"Received unchoke from \"+t.getName());\n }\n else if(M.type==2){\n P.print(\"Received interested from \"+t.getName());\n }\n else if(M.type ==3){\n P.print(\"Received not_interested from \"+t.getName()); \n }\n else if(M.type==4){\n P.print(\"Received have from \"+t.getName());\n }\n else if(M.type==5){\n P.print(\"Received bitfield from \"+t.getName());\n }\n else if(M.type==6){\n P.print(\"Received request from \"+t.getName());\n }\n else if(M.type==7){\n P.print(\"Received piece from \"+t.getName());\n }\n else{\n P.print(\"Error: undefined message type: \"+M.type);\n }\n }\n else {\n System.out.println(\"Class not found.\");\n }\n }\n catch(ClassNotFoundException ex){\n ex.printStackTrace();\n }\n }\n ois.close();\n socket.close();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "protected abstract void receive() throws IOException;", "public void receive(byte[] data, Connection from){\r\n System.out.println(\"Received message: \"+ new String(data));\r\n }", "public byte[] receive(int length) throws SocketException {\n byte[] data = new byte[length];\n DatagramPacket receivePacket = new DatagramPacket(data, data.length);\n \n try {\n serverSocket.receive(receivePacket);\n data = receivePacket.getData();\n this.lastClientIPAddress = receivePacket.getAddress();\n this.lastClientPort = receivePacket.getPort();\n } catch (Exception e) {\n Log.err(\"received malformed request of length n from \" + \n receivePacket.getAddress() + \" : \" + port);\n }\n \n return data;\n }", "@Override\n\tpublic void run() {\n\t\n\t\tboolean finMsg = false;\n\n \n \n\t\ttry {\n\t\t\t\n\t\t DataInputStream is = new DataInputStream(socket.getInputStream());\n DataOutputStream os = new DataOutputStream(socket.getOutputStream()); \n\t\t\t\n\t\t\twhile (!finMsg) {\n\t\t\t\t\n\t\t\tString[] client_Msg = is.readUTF().split(\" \");\n\t\t\t\t\n\t\t\tswitch (client_Msg[1]) {\n\t\t\t\n\t\t\t\tcase \"REG\":\n\t\t\t\t\thandleRegister(client_Msg, os);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"RDY\":\n\t\t\t\t\thandleReady(client_Msg, os);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"MOV\":\n\t\t\t\t\thandleMove(client_Msg, os);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\tcase \"FIN\":\n\t\t\t\t\tsocket.close();\n\t\t\t\t\tfinMsg=true;\n\t\t\t\t\tbreak;\n\t\t\t \n\t\t\t\n\t\t\t\t}\n\t\t\n\t\t \n\t\t\t}\n\t\t\t\t\n\t\t}catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "private void sendAndReceiveData(Socket socket) {\n try {\n long start = System.currentTimeMillis();\n\n // get the socket output stream\n OutputStream out = socket.getOutputStream();\n // get the socket input stream\n InputStream in = socket.getInputStream();\n DataInput dis = new DataInputStream(in);\n\n long iterations = dis.readLong();\n int size = dis.readInt();\n long total = iterations * size * 2L;\n long current = 0;\n\n System.out.println(MessageFormat.format(\"Sending/Receiving {0} bytes.\", total));\n while (current < iterations) {\n byte[] buf = new byte[size];\n dis.readFully(buf);\n out.write(buf);\n out.flush();\n current++;\n }\n\n out.close();\n in.close();\n\n long finish = System.currentTimeMillis();\n long elapsed = finish - start;\n System.out.println(MessageFormat.format(\"EOT. Received {0} bytes in {1} ms. Throughput = {2} KB/sec.\", total, elapsed,\n (total / elapsed) * 1000 / 1024));\n socket.close();\n System.out.println(\"Connection closed\");\n } catch (Exception ie) {\n ie.printStackTrace();\n }\n }", "@Override\r\n public void run() {\r\n byte[] buffer = new byte[1024];\r\n int bytes;\r\n int times = 0;\r\n\r\n while (!mStopped) {\r\n try {\r\n if (times == 0) {\r\n try {\r\n \t// Sometimes lag occurs. Therefore, from time to time\r\n \t// we just ignore a large chunk of data from input stream\r\n \t// in order to synchronize the communication.\r\n mInputStream.skip(1024000);\r\n } catch (Exception e) {}\r\n times = LAG_CUT_TIMEOUT;\r\n }\r\n times--;\r\n\r\n // Read from socket and send to the handler\r\n bytes = mInputStream.read(buffer);\r\n mReceiveHandler.receiveData(buffer, bytes);\r\n\r\n } catch (IOException ioe) {\r\n Log.e(Common.TAG, \"Error receiving from the socket: \" + ioe.getMessage());\r\n mPeer.communicationErrorOccured();\r\n break;\r\n }\r\n }\r\n }", "public interface SocketEventListener {\n\npublic void socketReceive( String s );\n}", "public void beginListenForData() {\n stopWorker = false;\n readBufferPosition = 0;\n try {\n inStream = btSocket.getInputStream();\n } catch (IOException e) {\n Log.d(TAG, \"Bug while reading inStream\", e);\n }\n Thread workerThread = new Thread(new Runnable() {\n public void run() {\n while (!Thread.currentThread().isInterrupted() && !stopWorker) {\n try {\n int bytesAvailable = inStream.available();\n if (bytesAvailable > 0) {\n byte[] packetBytes = new byte[bytesAvailable];\n inStream.read(packetBytes);\n for (int i = 0; i < bytesAvailable; i++) {\n // Log.d(TAG, \" 345 i= \" + i);\n byte b = packetBytes[i];\n if (b == delimiter) {\n byte[] encodedBytes = new byte[readBufferPosition];\n System.arraycopy(readBuffer, 0,\n encodedBytes, 0,\n encodedBytes.length);\n final String data = new String(\n encodedBytes, \"US-ASCII\");\n readBufferPosition = 0;\n handler.post(new Runnable() {\n public void run() {\n Log.d(TAG, \" M250 ingelezen data= \" + data);\n ProcesInput(data); // verwerk de input\n }\n });\n } else {\n readBuffer[readBufferPosition++] = b;\n }\n }\n } // einde bytesavalable > 0\n } catch (IOException ex) {\n stopWorker = true;\n }\n }\n }\n });\n workerThread.start();\n }", "public void run() {\n\t\tbyte[] out;\n\t\tshort[] in = new short[0];\n\t\tint read;\n\t\tint consumed;\n\t\t\n\t\ttry {\n\t\t\tconnect();\n\t\t\tin = new short[sock.getReceiveBufferSize()];\n\t\t} catch (Exception ex) {\n\t\t\t// TODO: Fire event to the model, so we can display something that lets the user know what happened.\n\t\t\tex.printStackTrace();\n\t\t\tdisconnect();\n\t\t}\n\t\t\n \t\twhile (sock != null && !sock.isClosed()) {\n\t\t\ttry {\n\t\t\t\tconsumed = 0;\n\t\t\t\t\n\t\t\t\t// Read up to in.length before we're invalid...\n\t\t\t\tinStream.mark(in.length);\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tread = inStream.read(in);\n\t\t\t\t} catch (IOException ioe) {\n\t\t\t\t\tread = 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Truncate the read buffer, and process it.\n\t\t\t\tif (read > 0) {\n\t\t\t\t\tshort[] truncIn = new short[read];\n\t\t\t\t\tSystem.arraycopy(in, 0, truncIn, 0, read);\n\t\t\t\t\t\n\t\t\t\t\tconsumed = consumeIncoming(truncIn);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// reset the mark, and then consume the bytes we've \n\t\t\t\t// processed.\n\t\t\t\tinStream.reset();\n\t\t\t\tif (consumed > 0) {\n\t\t\t\t\tinStream.skip(consumed);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// Do I have data to write?\n\t\t\t\tout = outgoingBytes();\n\t\t\t\tif (out.length > 0) {\n\t\t\t\t\tsock.getOutputStream().write(out);\n\t\t\t\t\tsock.getOutputStream().flush();\n\t\t\t\t}\n\t\t\t} catch (Exception ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t\tSystem.err.println(ex.toString());\n\t\t\t}\n\t\t\t// Play nice with thread schedulers.\n\t\t\tThread.yield();\n\t\t}\n\t}", "public interface SocketReadProcessor {\n\t\n\t/**\n\t * Process the data and return a response.\n\t * \n\t * <p> This method is called by a socket handler when data is read from it's\n\t * socket. Since the handler read the data the handler is using one of\n\t * MODE_READ, MODE_READ_WRITE or MODE_WRITE_READ. If the handler is using\n\t * MODE_READ_WRITE then the handler will write this method's return value\n\t * back to the socket.\n\t * \n\t * <p> The data will not be null.\n\t * \n\t * <p> The implementation of this method may need to be synchronized if\n\t * multiple socket handler threads will be calling it.\n\t * \n\t * @param data - The data that was read from the socket.\n\t * @param fromId - The unique id of the socket handler thread.\n\t * \n\t * @return A response which will be written back to the socket if the socket\n\t * handler is using MODE_READ_WRITE, otherwise ignored.\n\t */\n\tString processDataFromSocket(String data, long fromId);\n\t\n}", "int ReceivePacket();", "private void sendReceiveRes(){\n\t}", "public NetData recieve() throws Exception\n {\n NetData nd;\n\n\n try {\n if(reader.ready())\n {\n nd = new NetData(reader.readLine());\n }\n else\n {\n return null;\n }\n }\n catch (IOException ex)\n {\n xError.Report(xError.READ_FROM_SOCKET);\n throw new Exception();\n }\n xMessenger.miniMessege(\"<<<\"+ nd.toString());\n return nd;\n }", "@Override\n public void run() {\n //System.out.println(\"TCPReceiver is running\");\n logger.debug(\"TCPReceiver is running\");\n //receivePackage(DataHandler.inQueue);\n while (true){\n try {\n socket = serverSocket.accept();\n multiReceivePackage(this.inQueue);\n } catch (Exception e) {\n //System.out.println(\"[\" + Thread.currentThread().getName() + \"] Receiver 线程内出错。\");\n logger.error(\"[\" + Thread.currentThread().getName() + \"] Receiver 线程内出错。\");\n e.printStackTrace();\n }\n }\n\n\n }", "void Receive (int boardID, short addr, ByteBuffer buffer, long cnt, int Termination);", "void onMessageRead(byte[] data);", "public void getAndBuildData() throws Exception {\n byte[] byteBuffer = new byte[32];\n int recvMsgSize;\n\n while(true) {\n try {\n System.out.println(\"begin loop \" + serverSocket.isClosed());\n String received=\"\";\n Socket receiveSock=serverSocket.accept();\n //serverSocket.receive( receivePacket );\n System.out.println(\"Handling client at \" +\n receiveSock.getInetAddress().getHostAddress() + \" on port \" +\n receiveSock.getPort());\n InputStream in = receiveSock.getInputStream();\n \n // System.out.println(\"asjaejfjeaif\");\n if ((recvMsgSize = in.read(byteBuffer)) != -1){\n received= new String(byteBuffer);\n //byteBuffer=received.getBytes();\n //out.write(byteBuffer, 0, recvMsgSize);\n //in.read(byteBuffer);\n\n System.out.println(received);\n\n }\n System.out.println(\"client finished send\");\n //String sentence = new String(receivePacket.getData());\n int f=0;\n int m=0;\n //sendData = received.getBytes();\n // Disassemble the received packet into: the payload-data - packed, the IP - made InetAddress type //\n for(int j = 0; j < received.length(); j++){\n if(received.charAt(j) == '%'){\n ipAddress = InetAddress.getByName(received.substring(1,j));\n f = j;\n break;\n }\n }\n for(int k =f+1; k < received.length(); k++){\n if(received.charAt(k) == '%'){\n port = (received.substring(f+1, k));\n m=k;\n break;\n }\n }\n for(int l =m+1; l < received.length(); l++){\n if(received.charAt(l) == '%'){\n localPort = (received.substring(m+1, l));\n received = receiveSock.getInetAddress().getHostAddress() + \"%\" + port + \"%\" + serverSocket.getLocalPort() + \"%\" + received.substring(l+1, received.length());\n break;\n }\n }\n System.out.println(\"Send to \" + ipAddress + \" on \"+ port);\n System.out.println(\"Data: \"+received);\n sendData = received.getBytes();\n // ipAddress = receivePacket.getAddress();\n // Loop through the Routing Table to find an IP match\n\n for( int i = 0 ; i < 28; i++ ) {\n System.out.println(\"begin loop2, check \" + ipArray[1][i]+\" versus \" + port);\n if( ipArray[1][i].equals(port) ) {\n try {\n if(profile==1){\n if(localPort.equals(5556)==false){\n outgoingServerSocket= new Socket(\"127.0.0.1\",5556);}\n else {outgoingServerSocket=new Socket(\"127.0.0.1\",6001);}\n }\n else {\n if(localPort.equals(5555)==false){\n outgoingServerSocket= new Socket(\"127.0.0.1\",5555);}\n else {outgoingServerSocket=new Socket(\"127.0.0.1\",7001);}\n\n }\n }catch( IOException e ) {\n System.out.println( e.getMessage() );}\n System.out.println(\"found \"+port + \", sending message\");\n\t\t\t\t\t\t\t\t\t OutputStream out = outgoingServerSocket.getOutputStream();\n out.write(sendData, 0, recvMsgSize);\n break; }\n }\n\n }catch ( IOException e ) {\n System.out.println(\"Server error\" + e.getMessage());\n\n //this.Router( 0, sendData, ipAddress, port );\n }\n\n try { Thread.sleep(1500); } catch (Exception e) {}\n }\n }", "public void startRcvThread() {\n byte[] inRawData = new byte[UDPTransportLayer.PACKET_SIZE];\n DatagramPacket nextPacket = new DatagramPacket(inRawData, UDPTransportLayer.PACKET_SIZE);\n int packetSeq = 0;\n int packetType = 0;\n byte[] packetIn = null;\n int curStreamNum = 0;\n int streamLength = 0;\n int totBytes = 0;\n UDPDataPacket nextDataPack = null;\n byte[] nextRawData = null;\n UDPAddress senderAddr = null;\n Hashtable<Integer, DatagramPacket> heldMsgs = null;\n Integer gClast = null;\n\n try {\n while (true) {\n\t// Wait for a new packet\n\tsocket.receive(nextPacket);\n\t\n\t// Read the type of the new packet\n\tpacketIn = nextPacket.getData();\n// \tstreamIn.reset();\n// \tserialIn = new ObjectInputStream(streamIn);\n// \tpacketType = serialIn.readInt();\n\tpacketType = readByte(packetIn, 0);\n\n\t// Take appropriate action based on the type of packet\n\tswitch (packetType) {\n\tcase UDPTransportLayer.MESSAGE_TYPE_DATA:\n\t // PRAGMA [DEBUG] Debug.out.println(\"Received a DATA packet\");\n\t \n\t // Decypher the header of this packet, extract the data\n\t // portion, and build a UDPDataPacket structure\n\t senderAddr = new UDPAddress(nextPacket.getAddress(), nextPacket.getPort());\n\t packetSeq = readInt (packetIn, 1);\n\t curStreamNum = readShort(packetIn, 5);\n\t streamLength = readShort(packetIn, 7);\n\t totBytes = readShort(packetIn, 9);\n\t nextRawData = new byte[UDPTransportLayer.PACKET_SIZE - 11];\n\t System.arraycopy(packetIn, 11, nextRawData, 0, UDPTransportLayer.PACKET_SIZE - 11);\n\t nextDataPack = new UDPDataPacket(packetSeq, curStreamNum, streamLength, totBytes, nextRawData);\n\n\t // PRAGMA [SEND_RCV_DEBUG] Log.println(FoundryStart.sysLog, \"<UDPInstance.startRcvThread> Received data packet - sender: \" + senderAddr + \" seq_num: \" + packetSeq);\n\n\t // PRAGMA [DEBUG] Debug.out.println(\"*** UDPInstance ***: received data packet - sender: \" + senderAddr + \" seq_num: \" + packetSeq);\n\t // PRAGMA [DEBUG] Debug.out.println(\"Packet seq num : \" + packetSeq);\n\t // PRAGMA [DEBUG] Debug.out.println(\"Current stream num: \" + curStreamNum);\n\t // PRAGMA [DEBUG] Debug.out.println(\"Total stream len : \" + streamLength);\n\t // PRAGMA [DEBUG] Debug.out.println(\"Total num bytes : \" + totBytes);\n\t // PRAGMA [RAW_BYTE_DEBUG] {\n\t // PRAGMA [RAW_BYTE_DEBUG] byte[] rawD1 = nextRawData;\n\t // PRAGMA [RAW_BYTE_DEBUG] String rawD2 = \"\";\n\t // PRAGMA [RAW_BYTE_DEBUG] for(int q=0; q<rawD1.length; q++)\n\t // PRAGMA [RAW_BYTE_DEBUG] rawD2 = rawD2 + rawD1[q] + \" \";\n\t // PRAGMA [RAW_BYTE_DEBUG] Debug.out.println(\"Received raw bytes: \\n\" + rawD2);\n\t // PRAGMA [RAW_BYTE_DEBUG] }\n\n\n\t // Handle the new packet based on the address of the sender\n\t handleNewDataPacket(senderAddr, nextDataPack);\n\n\t break;\n\n\tcase UDPTransportLayer.MESSAGE_TYPE_GC:\n\t // PRAGMA [DEBUG] Debug.out.println(\"Received a GC packet\");\n\n\t // Figure out who we can GC messages for, also grab the last\n\t // message number we GCd for this receiver\n\t senderAddr = new UDPAddress(nextPacket.getAddress(), nextPacket.getPort());\n\t packetSeq = readInt(packetIn, 1);\n\n\t // Dump the packet parameters into the gcPackets queue which \n\t // should automatically wake up the GC thread.\n\t gcPackets.enqueue((new ParameterList(senderAddr, new Integer(packetSeq))).enumerate());\n\n\t break;\n\n\tcase UDPTransportLayer.MESSAGE_TYPE_ALIVE:\n\t // PRAGMA [DEBUG] Debug.out.println(\"Received an ALIVE packet\");\n\n\t // Figure out who is sending the message and the sequence\n\t // number of the last data packet they sent.\n\t senderAddr = new UDPAddress(nextPacket.getAddress(), nextPacket.getPort());\n\t packetSeq = readInt(packetIn, 1);\n\t gClast = (Integer) globalSeqNum.get(senderAddr);\n\t if (gClast == null) { \n\t gClast = new Integer(0);\n\t globalSeqNum.put(senderAddr, gClast);\n\t }\n\t \n\t if (packetSeq >= gClast.intValue()) \n\t // If packetSeq >= gClast then we missed a message so send a\n\t // NACK with value gClast.\n\t generateNACK(senderAddr, gClast.intValue());\n\t else \n\t // Otherwise, it may be that the sender missed our last GC\n\t // message so send another\n\t generateGC(senderAddr, gClast.intValue() - 1);\n\n\t break;\n\n\tcase UDPTransportLayer.MESSAGE_TYPE_NACK:\n\t // PRAGMA [DEBUG] Debug.out.println(\"Received a NACK packet\");\n\t \n\t // Figure out who is missing a packet and which one\n\t senderAddr = new UDPAddress(nextPacket.getAddress(), nextPacket.getPort());\n\t packetSeq = readInt(packetIn, 1);\n\n\t // Two cases: either the packet was missed and we still have\n\t // it, or this is a late NACK message and we've already GC'd\n\t // the packet.\n\t heldMsgs = (Hashtable<Integer, DatagramPacket>) notGCd.get(senderAddr);\n\t if (heldMsgs == null) {\n\t heldMsgs = new Hashtable<Integer, DatagramPacket>();\n\t notGCd.put(senderAddr, heldMsgs);\n\t }\n\t if (heldMsgs.containsKey(new Integer(packetSeq))) \n\t socket.send((DatagramPacket) heldMsgs.get(new Integer(packetSeq)));\n\t //\t toResend.enqueue(heldMsgs.get(new Integer(packetSeq)));\n\n\t // Need to wake up the sender thread if it isn't already\n\t // awake\n// \t synchronized (msgsToSend) {\n// \t msgsToSend.notifyAll();\n// \t }\n\t \n\t break;\n\n\tdefault:\n\t Debug.exit(\"ERROR: unknown packet type: \" + packetType);\n\t}\n }\n } catch(Exception e) {\n Debug.exit(e.toString());\n }\n\n }", "@Override\r\n\tpublic void run() {\n\t\tbyte[] buffer = new byte[YapttaConstants.Network.DEFAULT_PACKET_BUFFER_SIZE];\r\n\t\tDatagramPacket packet = new DatagramPacket(buffer, buffer.length);\r\n\t\t\r\n\t\t// Loop until we're disconnected/stopped/etc\r\n\t\twhile(!haltRequested && socket != null && socket.isBound() && !socket.isClosed())\r\n\t\t{\r\n\t\t\ttry {\r\n\t\t\t\t// Block the socket until data is received\r\n\t\t\t\tsocket.receive(packet);\r\n\t\t\t\t\r\n\t\t\t\t// Deserialize the data\r\n\t\t\t\tByteArrayInputStream bais = new ByteArrayInputStream(packet.getData(), 0, packet.getLength());\r\n\t\t\t\tObjectInputStream ois = new ObjectInputStream(bais);\r\n\t\t\t\tAbstractMessage am = (AbstractMessage) ois.readObject();\r\n\t\t\t\t\r\n\t\t\t\t// Save who the sender was\r\n\t\t\t\tam.setSender(packet.getAddress());\r\n\t\t\t\t\r\n\t\t\t\t// Call the data received handler as appropriate\r\n\t\t\t\tif(callback != null) callback.messageReceived(am);\r\n\t\t\t\t\r\n\t\t\t\t// Clean-up\r\n\t\t\t\tois.close();\r\n\t\t\t\tbais.close();\r\n\t\t\t\t\r\n\t\t\t\t// ... then do it again!\r\n\t\t\t\t\r\n\t\t\t} catch (SocketTimeoutException e) {\r\n\t\t\t\t// just try to roll with the error (but at least log it)... it's likely due to\r\n\t\t\t\t// disconnection and will end the thread when it checks the condition of the loop\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t// if something other than timeout occurred, give more info\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private TimerTask socketListener()\r\n\t{\r\n\t\tString theMessage;\r\n\t\tif (theSocket != null)\r\n\t\t{\r\n\t\t\tif (theSocket.isReady())\r\n\t\t\t{\r\n\t\t\t\t// blocks execution\r\n\t\t\t\t// get theMessage\r\n\t\t\t\ttheMessage = theSocket.getMessage();\r\n\t\t\t\tif (theMessage == null)\r\n\t\t\t\t{\r\n\t\t\t\t\twriteLine(\"Our connection has ended!\", 0);\r\n\t\t\t\t\trunning = false;\r\n\t\t\t\t\t// if the message = null\r\n\t\t\t\t\t// the we need to check the socket again\r\n\t\t\t\t\t// just in case\r\n\t\t\t\t\t// close it nicely if we can\r\n\t\t\t\t\tif (theSocket != null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttheSocket.close();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// otherwise just set it to null\r\n\t\t\t\t\t// set it to null regardless\r\n\t\t\t\t\ttheSocket = null;\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// if the socket is OK\r\n\t\t\t\t\t// and the socket isReady\r\n\t\t\t\t\t// then display the input\r\n\t\t\t\t\twriteLine(theMessage, 2);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} // end if theSocket !=null\r\n\t\treturn null;\r\n\t}", "@Override\n\tpublic void receive(String msg) {\n\t\t\n\t}", "private static DatagramPacket listenOnSocket(DatagramSocket socket) throws Exception { // TODO Handle exception\n\n // Create a generically big DatagramPacket\n byte[] receivedData = new byte[MAXIMUM_DATAGRAM_SIZE];\n DatagramPacket datagram = new DatagramPacket(receivedData, receivedData.length);\n\n // Listen to the socket\n socket.receive(datagram);\n\n // Trim the data array\n byte[] trimmedData = Arrays.copyOfRange(datagram.getData(), datagram.getOffset(), datagram.getLength());\n datagram.setData(trimmedData);\n\n return datagram;\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 void onDataReceived(byte[] data, String message) {\n }", "@Override\n public void onReceive(Object msg) throws Exception {\n }", "@Override\n\tpublic void run() {\n\t\tString remoteAddr = socket.getRemoteSocketAddress().toString();\n\t\treader = getReader(socket);\n\t\twriter = getWriter(socket);\n\t\tString msg = \"\";\n\t\ttry {\n\t\t\twhile((msg = reader.readLine()) != null){\n\t\t\t\tSystem.out.println(msg);\n\t\t\t\tif(\"bye\".equals(msg)){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\twriter.println(remoteAddr +\" [\" + msg + \"] got\");\n\t\t\t\twriter.flush();\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println();\n\t}", "private void handleRead(SelectionKey key) throws IOException {\n\t\t\tSSLSocketChannel ssl_socket_channel = ((SSLClientSession)key.attachment()).getSSLSocketChannel();\n\t\t\tByteBuffer request = ssl_socket_channel.getAppRecvBuffer();\n\t\t\tint count = ssl_socket_channel.read();\n\t\t\t\n\t\t\tif (count < 0) {\n\t\t\t\t\n\t\t\t\tremoveKeyAndSession(key);\n\t\t\t\t\n\t\t\t} else if (request.position() > 0) {\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tString message = new String(request.array(),0,request.position());\n\t\t\t\t\t\n//\t\t\t\t\tOutputHandler.println(\"Server: read \"+message);\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Parse the JSON message\n\t\t\t\t\tJSONObject json = (JSONObject) parser.parse(message);\n\t\t\t\t\t\n\t\t\t\t\t// Process the message\n\t\t\t\t\tprocessNetworkMessage(json, key);\n\t\t\t\t\t\n\t\t\t\t\trequest.clear();\n\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\tSystem.out.println(\"Invalid message format.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "@Override\n\tpublic void run() {\n\t\tSystem.out.println(\"Waiting for input\");\n\t\t// Handle reading data until we exit\n\t\tByteBuffer buf = ByteBuffer.allocate(2048);\n\t\twhile (!stopper && socketChannel.isOpen()) {\n\t\t\tSystem.out.println(\"Reading the socket\");\n\t\t\ttry {\n\t\t\t\t// No input from the user in 60 seconds results in kicking them\n\t\t\t\t// out\n\t\t\t\tint bytesRead = socketChannel.read(buf).get(60, TimeUnit.SECONDS);\n\t\t\t\t// ByteBuffer dst = ByteBuffer.allocate(bytesRead);\n\t\t\t\t// engine.unwrap(buf, dst);\n\t\t\t\tSystem.out.println(\"Got data of size: \" + bytesRead);\n\t\t\t\t// convert to proto\n\t\t\t\tcommonUIElements.MessageProtos.Message msg = commonUIElements.MessageProtos.Message\n\t\t\t\t\t\t.parseFrom(Arrays.copyOf(buf.array(), bytesRead));\n\t\t\t\tSystem.out.println(\"RXed: \" + msg.toString());\n\t\t\t\tif (!msg.getName().equals(name)) {\n\t\t\t\t\tname = msg.getName();\n\t\t\t\t}\n\t\t\t\t// add data to the message queue\n\t\t\t\tif (SignatureSystem.verifySignature(msg.getSignature(), msg.getMessage(), msg.getName(), trustStore)) {\n\t\t\t\t\tmessages.put(\n\t\t\t\t\t\t\tnew Message(msg.getSender(), msg.getMessage(), msg.getSignature(), msg.getClearance()));\n\t\t\t\t} else {\n\t\t\t\t\tMessage error = new Message(msg.getSender(), \"Error: signture is invalid\", msg.getSignature(),\n\t\t\t\t\t\t\tmsg.getClearance());\n\t\t\t\t\terror.error = true;\n\t\t\t\t\tmessages.put(error);\n\t\t\t\t}\n\t\t\t\t// clear the buffer for the next message\n\t\t\t\tbuf.clear();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tSystem.err.println(\"Failed to add message to the queue: \" + e.getMessage());\n\t\t\t\tMessage error = new Message(this.name, \"Disconnected\", \"\", 1);\n\t\t\t\terror.error = true;\n\t\t\t\ttry {\n\t\t\t\t\tmessages.put(error);\n\t\t\t\t} catch (InterruptedException e1) {\n\t\t\t\t\tSystem.err.println(\"Thread has an error, can't inform server of this transgression\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t} catch (TimeoutException e) {\n\t\t\t\tSystem.err.println(\"Timeout hit, waiting again\");\n\t\t\t\tMessage error = new Message(this.name, \"Client: \" + this.name + \" has timed out\", \"\", 1);\n\t\t\t\terror.kill = true;\n\t\t\t\ttry {\n\t\t\t\t\tmessages.put(error);\n\t\t\t\t} catch (InterruptedException e1) {\n\t\t\t\t\tSystem.err.println(\"Thread has an error, can't inform server of this transgression\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t} catch (ExecutionException e) {\n\t\t\t\tSystem.err.println(\"Execution error, breaking out of loop\");\n\t\t\t\tbreak;\n\t\t\t} catch (InvalidProtocolBufferException e) {\n\t\t\t\tSystem.err.println(\"Invalid protobuf received: \" + e.getMessage());\n\t\t\t\t// } catch(SSLException e) {\n\t\t\t\t// System.err.println(\"SSL Failed: \" + e.getMessage());\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\tsocketChannel.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Failed to close socket while exiting\");\n\t\t}\n\t\tSystem.out.println(\"Exiting thread...\");\n\t}", "public void run(){\r\n DataInputStream dis = null;\r\n try{\r\n dis = new DataInputStream(socket.getInputStream());\r\n while(true){\r\n String command = dis.readUTF();\r\n if(command.startsWith(\"/\")){\r\n if(command.length() > 1) listener.receivedCommand(this, command.substring(1));\r\n }\r\n else{\r\n int size = dis.readInt();\r\n if(size > limit){\r\n cleanup(false);\r\n break;\r\n }\r\n byte[] buffer = new byte[size];\r\n dis.readFully(buffer, 0, size);\r\n listener.receivedFile(this, command, buffer);\r\n }\r\n }\r\n }\r\n catch(SocketException e){ e.printStackTrace(); }\r\n catch(EOFException e){ e.printStackTrace(); }\r\n catch(IOException ioe){ ioe.printStackTrace(); }\r\n finally{ cleanup(); }\r\n \r\n if(dis != null){\r\n try{ dis.close(); } catch(IOException ioe){ ioe.printStackTrace(); }\r\n dis = null;\r\n }\r\n }", "@Override\n\tpublic void receive() {\n\t}", "public String receive()\n\t{\n \n\t\treceive = new Thread(\"receive_thread\")\n\t\t{\n \n\t\t\tpublic void run(){\n\t\t\t\twhile(running)\n\t\t\t\t{\n\t\t\t\t\tbyte[] buffer = new byte[1024];\n\t\t\t\t\tDatagramPacket dgpacket = new DatagramPacket(buffer, buffer.length);\n\n\t\t\t\t\ttry{\n\t\t\t\t\t\tsocket.receive(dgpacket);\n s= new String(dgpacket.getData());\n\t\t\t\t\t}\n\t\t\t\t\tcatch(IOException e)\n\t\t\t\t\t{\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\treceive.start();\n return s;\n\t}", "protected int receivePacket()\n\t\t\tthrows IOException, SocketTimeoutException\n\t{\n\t\t\n\t\tbyte buf[] = new byte[ILPacket.MAX_PACKET_SIZE];\n\t\tDatagramPacket packet = new DatagramPacket(buf, buf.length);\n\t\t\n\t\tthis.inSocket.receive(packet);\n\t\t\n\t\tthis.address = (InetSocketAddress) packet.getSocketAddress();\n\t\t\n\t\tthis.buffer = ByteBuffer.wrap(packet.getData());\n\t\t\t\t\n\t\treturn packet.getLength();\n\t}", "public void onEvent(TCPReceiverThread receiverThread, Event event) throws IOException;", "protected synchronized void receiveHighLevel() throws Exception{\n\t\treceivedMsg = conn.receiveALine( ); \n//\t\tprintln(\"received \" + receivedMsg);\n\t\twhile( receivedMsg == null ){ //this means that the connection works in raw mode\n\t\t\t//System.out.println(\"ConnInputReceiver waiting ... \" + conn );\n\t\t\tmemo();\n \t\t\twait();\n \t\t\t//System.out.println(\"ConnInputReceiver resuming ... \" + conn );\n\t\t\treceivedMsg = conn.receiveALine( ); \n\t\t}\t\n\t\tunmemo();\t\n\t}", "public int receive (byte []buffer, int offset, int length)\n throws IOException,IllegalArgumentException,IndexOutOfBoundsException\n {\n if (length == 0) {\n return 0;\n }\n if (offset < 0) {\n throw new java.lang.IndexOutOfBoundsException();\n }\n if (length < 0) {\n throw new java.lang.IndexOutOfBoundsException();\n }\n if ((offset + length) > buffer.length) {\n throw new java.lang.IndexOutOfBoundsException();\n }\n return receiveNative (buffer, offset, length, 0);\n }", "public interface MessageReceivedListener {\n\t\n\t/**\n\t * Called when new command/message received\n\t * @param msg Command/message as String\n\t */\n\tpublic void OnMessageReceived(String msg);\n\t\n\t/**\n\t * Called when new file is incoming.\n\t * @param length Total length of data expected to be received\n\t * @param downloaded Total length of data actually received so far\n\t */\n\tpublic void OnFileIncoming(int length);\n\t\n\t/**\n\t * Called when more data of a file has been transfered\n\t * @param data Byte array of data received\n\t * @param read The lenght of the data received as int\n\t * @param length Total length of data expected to be received\n\t * @param downloaded Total length of data actually received so far\n\t */\n\tpublic void OnFileDataReceived(byte[] data,int read, int length, int downloaded);\n\t\n\t/**\n\t * Called when file transfer is complete\n\t * @param got\n\t * @param expected\n\t */\n\tpublic void OnFileComplete();\n\t\n\t/**\n\t * Called when an error occur\n\t */\n\tpublic void OnConnectionError();\n\t\n\t/**\n\t * Called when socket has connected to the server\n\t */\n\tpublic void OnConnectSuccess();\n}", "public void listen() {\n\t\t\n\t\twhile(true) {\n\t\t\t\n\t\t\tDatagramPacket packet = new DatagramPacket(recieveData, MAX_SIZE);\n\t\t\tint available = 0;\n\t\t\t\n\t\t\ttry {\n\t\t\t\t//The 'receive(...)' method fills up the buffer of the packet we passed into it with the data received\n\t\t\t\tmainSocket.receive(packet);\n\t\t\t\t//available = packet.getLength();\n\t\t\t\tbyte[] data = packet.getData();\n\t\t\t\t\n\t\t\t\tif(data[0] == HEADER && data[1] == CONNECTION)\n\t\t\t\t\tif(askUser(packet, available))\n\t\t\t\t\t\tmakeClientThread();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t}\n\t\t\tcatch(PortUnreachableException ex) {\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"PortUnreachableException caught in server side.\\n Unable to recieve packet\\n\");\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t\tcatch (IOException ex) {\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"1. IOException Caught in server side.\\n Unable to vertify user\\n\");\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public abstract boolean receive(byte[] buffer, int size, int timeout) throws InterruptedIOException;", "public abstract void receive(CommNode source, Object packet, simulation.timebased.Simulator simulator);", "@Override\n\t\tpublic void run()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\twhile (keepListening)\n\t\t\t\t{\n\t\t\t\t\tString rcvStr = is.readLine();\n\t\t\t\t\t\n\t\t\t\t\t//We must make sure that this packet has been sent here correctly.\n\t\t\t\t\tif (rcvStr != null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//TO-DO parse message here and notify controller\n\t\t\t\t\t\t//just transmit it to controller.\n\t\t\t\t\t\tSystem.out.println(\"receive reply : \" + rcvStr);\n\t\t\t\t\t\tmyController.parseResponse(rcvStr);\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t//The receive String is null means that this connection is broken.\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"at ControlChannel listenRunnable : receive null response\");\n\t\t\t\t\t\tkeepListening = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "private void receive() {\n\t\t\ttry{\n\t\t\t\twhile(true){\n\t\t\t\t\tsuper.store(generateSimulateData());\n\t\t\t\t\tSystem.out.println(\"模拟接收数据\");\n\t\t\t\t\tThread.sleep(10000);\n\t\t\t\t}\n\t\t\t}catch(Exception ex){\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t }", "@Override\n\tprotected void processConnection() {\n\t\t\n\t\twhile(true) {\n\t\t\t\n\t\t\ttry {\n\t\t\t\tint receiverID = (Integer) input.readObject();\n\t\t\t\tString message = (String) input.readObject();\n\t\t\t\t\n\t\t\t\tClientHandler recieverHandler = Server.clientConnections.get(receiverID);\n\t\t\t\tif(recieverHandler == null) {\n\t\t\t\t\tsendData(ERROR_CODE);\n\t\t\t\t\tsendData(\"Not available\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\trecieverHandler.sendData(clientID);\n\t\t\t\t\trecieverHandler.sendData(message);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(ClassNotFoundException classNotFoundException) {\n\t\t\t\tserver.serverGUI.showMessage(\"Unknown object type recieved.\");\n\t\t\t}\n\t\t\tcatch(IOException ioException) {\n\t\t\t\tserver.serverGUI.showMessage(\"Client terminated connection.\\n\");\n\t\t\t\tcloseConnection();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "private void recieveData() throws IOException, InterruptedException {\n String senderIP= JOptionPane.showInputDialog(WED_ZERO.lang.getInstruct().get(1)[17]);\n if(senderIP==null) {\n ERROR.ERROR_359(Launch.frame);\n return;\n }\n JOptionPane.showMessageDialog(Launch.frame, WED_ZERO.lang.getInstruct().get(1)[18]);\n Networking net=new Networking(true);\n net.setIPAddress(senderIP);\n String to=net.initClient();\n int res = JOptionPane.showConfirmDialog(null, WED_ZERO.lang.getInstruct().get(1)[19]+\" \"\n +to+\".\", WED_ZERO.lang.getInstruct().get(1)[12],\n JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); \n if(res==JOptionPane.NO_OPTION||res==JOptionPane.CANCEL_OPTION) {\n return;\n }\n Map<Integer, ArrayList<String>> data=new HashMap<Integer, ArrayList<String>>();\n ArrayList<String> folderName=new ArrayList();\n net.transferData_RECIEVE(folderName, data);\n this.processNewData(data, folderName);\n \n }", "@Override\n\tpublic void run()\n\t{\n\t\tif(socket != null && !socket.isClosed() && socket.isConnected())\n\t\t{\n\t\t\tSendMessage(ApplicationManager.Instance().GetName(), MessageType.clientData);\n\t\t\tApplicationManager.textChat.writeGreen(\"Connected to \" + connectionInfo.ServerAdress);\n\t\t\t\n\t\t\ttry \n\t\t\t{\n\t\t\t\twhile (IsConnected) \n\t\t {\n\t\t Message message = (Message) in.readObject();\n\t\t\t\t\t\n\t\t if(!IsConnected)\n\t\t \tbreak;\n\t\t \t\n\t\t if(message == null)\n\t\t {\n\t\t \tIsConnected = false;\n\t\t \tbreak;\n\t\t }\n\t\t \n\t\t HandleMessage(message); \n\t\t }\n\t\t\t \n\t\t\t} \n\t\t\tcatch (SocketException | EOFException e) {\n\t\t\t\tif(IsConnected)\n\t\t\t\tApplicationManager.textChat.writeGreen(\"Server go down!\");\n\t\t\t}\n\t\t\tcatch (IOException | ClassNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tApplicationManager.Instance().Disconnect();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tApplicationManager.textChat.writeGreen(\"Cannot connect!\");\n\t\t\tApplicationManager.Instance().Disconnect();\n\n\t\t}\n\t}", "private void receiveServerMessage() throws IOException {\n mRemoteServerMessage = lengthValueRead(in, ServerMessage.class);\n if (mRemoteServerMessage == null) {\n setExchangeStatus(Status.ERROR);\n setErrorMessage(\"Remote server message was not received.\");\n throw new IOException(\"Remote server message was not received.\");\n }\n }", "public String recv() {\n\t\tDatagramPacket packet = new DatagramPacket(new byte[PACKET_SIZE], PACKET_SIZE);\n\n\t\ttry {\n\t\t\ts.receive(packet);\n\t\t} catch (IOException e) {\n\t\t}\n\n\t\tif(type==0) {\n\t\t\tthis.host = packet.getAddress();\n\t\t\tthis.port = packet.getPort();\n\t\t}\n\t\tString m = (new String(packet.getData())).trim();\n\t\treturn m;\n\t}", "@Override\n public void run() {\n console.append(\"Connected: \" + socket + \"\\n\");\n try {\n BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n\n String[] data = null;\n\n while (socket.isConnected()) {\n String incoming = in.readLine();\n console.append(incoming + \"\\n\");\n try {\n data = incoming.split(\",\");\n }catch(NullPointerException e){\n //eh\n }\n //recieve packets\n receivePackets(data);\n }\n } catch (Exception e) {\n console.append(\"Disconnected:\" + socket + \"\\n\");\n //e.printStackTrace();\n } finally {\n try { socket.close(); } catch (IOException e) {}\n console.append(\"Closed: \" + socket + \"\\n\");\n }\n }", "private Object receive() {\n\t\ttry {\n\t\t\t// verificamos si la conexion esta abierta\n\t\t\tif (!this.getConnection().isClosed())\n\t\t\t\t// retornamos los datos\n\t\t\t\treturn this.getInputStream().readObject();\n\t\t} catch (final IOException e) {\n\t\t\t// print the StackTrace\n\t\t\tthis.getLogger().error(e);\n\t\t} catch (final ClassNotFoundException e) {\n\t\t\t// print the StackTrace\n\t\t\tthis.getLogger().error(e);\n\t\t}\n\t\t// retornamos null\n\t\treturn null;\n\t}", "public static void SendAndReceive() throws IOException {\n\t\t\tbyte[]buffer = new byte[BUFFER_SIZE];\n\n\t\t\t/* Create remote endpoint */\n\t\t\tSocketAddress remoteBindPoint = new InetSocketAddress(IP, PORT);\n\n\t\t\t/* Create datagram packet for sending message */\n\t\t\tDatagramPacket sendPacket = new DatagramPacket(MSG.getBytes(), MSG.length(), remoteBindPoint);\n\n\t\t\t/* Create datagram packet for receiving echoed message */\n\t\t\tDatagramPacket receivePacket = new DatagramPacket(buffer, buffer.length);\n\n\t\t\t/* Send and receive message*/\n\t\t\tsocket.send(sendPacket);\n\t\t\t//System.out.println(\"SAR\");\n\t\t\tsocket.receive(receivePacket);\n\n\t\t\t/* Compare sent and received message */\n\t\t\tString receivedString = new String(receivePacket.getData(), receivePacket.getOffset(), receivePacket.getLength());\n\t\t\tif (receivedString.compareTo(MSG) == 0)\n\t\t\t\tSystem.out.printf(\"%d bytes sent and received\\n\", receivePacket.getLength());\n\t\t\telse\n\t\t\t\tSystem.out.printf(\"Sent and received msg not equal!\\n\");\n\n\n\t\t}", "public void onDataRecieved(byte data[]);", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tinput = new DataInputStream(socket.getInputStream());\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\n\t\t\t\t\t\t\twhile (input != null) {\n\t\t\t\t\t\t\t\tsynchronized (this) {\n\t\t\t\t\t\t\t\t\tdecode(input.readUTF());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\tSystem.exit(1);\n\t\t\t\t\t\t\te.printStackTrace();\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}", "protected void recvSensorPacket(Object data_)\n\t{\t\n\t\tif ( data_ instanceof SensorPacket )\n\t\t{\n\t\t\tSensorPacket spkt = (SensorPacket)data_ ;\n\t\t\tif(nodeState.equals(NodeState.SLEEPING) && spkt.pktType!=DRLDiffApp.INTEREST_PKT){\n\t\t\t\tlog(Level.FINE,\"Dropping packet as currenly asleep..\"+spkt.getBody());\n\t\t\t\tlog(Level.FINE,\"Current task:\"+microLearner.currentTask+\", current state:\"+microLearner.currentState\n\t\t\t\t\t\t+\" time:\"+microLearner.timesteps+\" lastDiff:\"+microLearner.lastDiffusionParticipation+\" lastS:\"+microLearner.lastSourceParticipation);\n\t\t\t\treturn;\n\t\t\t}else{\n\t\t\t\tlog(Level.FINE,\"Received sensor packet:\"+spkt.getBody());\n\t\t\t}\n\t\t\tboolean process;\n\t\t\tswitch ( spkt.pktType )\n\t\t\t{\n\t\t\t\tcase DRLDiffApp.INTEREST_PKT :\n\t\t\t\t\tnoOfInterests++;\n\t\t\t\t\tInterestPacket interestPkt = (InterestPacket)spkt.getBody() ;\n\t\t\t\t\tprocess=macroLearner.interestArriveAtDownPort(interestPkt);\n\t\t\t\t\tif(process)\n\t\t\t\t\t\tmicroLearner.handleInterestPkt(interestPkt);\n\t\t\t\t\tinterestCachePrint();\n\t\t\t\t\tbreak ;\n\t\t\t\tcase DRLDiffApp.DATA_PKT :\n\t\t\t\t\tDataPacket dataPkt = (DataPacket)spkt.getBody() ;\n\t\t\t\t\tif(dataPkt.isHeartBeat()){\n\t\t\t\t\t\tnoOfHeartBeats++;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tnoOfDataPkts++;\n\t\t\t\t\t}\n\t\t\t\t\tprocess=macroLearner.dataArriveAtDownPort(dataPkt);\n\t\t\t\t\tif(process){\n\t\t\t\t\t\tif(nid==sink_nid){\n\t\t\t\t\t\t\thandleSinkData(dataPkt);\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tmicroLearner.handleDataPkt(dataPkt);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DRLDiffApp.REINFORCEMENT_PKT :\n\t\t\t\t\tnoOfReinforcements++;\n\t\t\t\t\tReinforcementPacket reinforcementPkt = (ReinforcementPacket)spkt.getBody() ;\n\t\t\t\t\tlog(Level.FINE,\"Received REINFORCEMENT:\"+reinforcementPkt);\n\t\t\t\t\t//interestCachePrint();\n\t\t\t\t\tmacroLearner.handleReinforcement(reinforcementPkt);\n\t\t\t\t\tmicroLearner.handleReinforcement(reinforcementPkt);\n\t\t\t\t\tbreak ;\n\t\t\t\tdefault :\n\t\t\t\t\tsuper.recvSensorPacket(data_) ;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tsuper.recvSensorPacket(data_) ;\n \t}", "@Override\r\n\tpublic void run() {\n\t\tString msg;\r\n\t\ttry\r\n\t\t{\r\n\t\t\twhile(true)\r\n\t\t\t{\r\n\t\t\t\t\tBufferedReader inFromClient =\r\n\t\t\t\t new BufferedReader(new InputStreamReader(socket.getInputStream()));\r\n\t\t\t\t DataOutputStream outToClient = new DataOutputStream(socket.getOutputStream());\r\n\t\t\t\t \r\n\t\t\t\t String clientSentence;\r\n\t\t\t\t while((clientSentence = inFromClient.readLine())!=null)\r\n\t\t\t\t {\t\r\n\t\t\t\t\t System.out.println(\"Received: \" + clientSentence);\r\n\t\t\t\t\t System.out.println(\"port: \" + socket.getPort());\r\n\r\n\t\t\t\t\t String newsentence = clientSentence + '\\n';\r\n\t\t\t\t\t outToClient.writeBytes(\"Server: \"+newsentence);\r\n\t\t\t\t\t \r\n\t\t\t\r\n\t\t\t\t }\r\n//\t\t\t\t \r\n//\t\t\t\t\treader.close();\r\n//\t\t\t\t\tinFromClient.close();\r\n//\t\t\t\t\toutToClient.close();\r\n//\t\t\t\t\tsocket.close();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(SocketException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Client has Disconnected\");\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n public void run() {\n try {\n\n byte[] data = new byte[TcpClient.BUFFER_SIZE * 2];\n\n while(!Rebroadcaster.INSTANCE.isHalted()) {\n int len = is.read(data, 0, data.length);\n os.write(data, 0, len);\n os.flush();\n }\n } catch (IOException ex) {\n LOGGER.log(Level.SEVERE, null, ex);\n }\n }", "public synchronized Message receive() \r\n\tthrows IOException, SocketTimeoutException {\r\n\t\tbyte[] buffer = new byte[576];\r\n\t\tMessage msg = null;\r\n\t\twhile (msg == null) {\r\n\t\t\ttry {\r\n\t\t\t\tsocket.setSoTimeout(TIMEOUT);\r\n\t\t\t\tDatagramPacket response = new DatagramPacket(buffer,\r\n\t\t\t\t\t\tbuffer.length, this.socket.getInetAddress(),\r\n\t\t\t\t\t\tthis.socket.getLocalPort());\r\n\t\t\t\tsocket.receive(response);\r\n\t\t\t\tmsg = new Message(response.getData());\r\n\t\t\t\tmsg.setSender(response.getPort(), response.getAddress());\r\n\t\t\t} catch (MessageCorruptException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.sendConfirmation(msg.getSenderPort(), msg.getSenderHost());\r\n\r\n\t\tif (msg.getType().equals(\"%%start-fragments%%\"))\r\n\t\t\tmsg = receiveFragments();\r\n\r\n\t\treturn msg;\r\n\t}", "private void parsePacket() {\n\n // Request a new data buffer if no data is currently available.\n if (receiveBuffer == null) {\n socketHandle.read(DEFAULT_REQUEST_SIZE).addDeferrable(this, true);\n return;\n }\n\n // Attempt to parse the next packet. This can result in malformed message\n // exceptions which are passed back to the caller or buffer underflow exceptions\n // which result in a request for more data.\n final int startPosition = receiveBuffer.position();\n try {\n\n // Extract the main header byte and message length. If this fails the connection\n // is unrecoverable and must be closed.\n final int headerByte = 0xFF & receiveBuffer.get();\n final ControlPacketType controlPacketType = ControlPacketType.getControlPacketType(headerByte);\n if (controlPacketType == null) {\n throw new MalformedPacketException(\"Invalid control packet type\");\n }\n final int messageLength = VarLenQuantity.create(receiveBuffer).getValue();\n\n // Determine whether there is sufficient data in the buffer to parse the full\n // message. If not, request further data in an expanded buffer.\n if (messageLength > receiveBuffer.remaining()) {\n receiveBuffer.position(startPosition);\n fillReceiveBuffer(5 + messageLength);\n return;\n }\n\n // Parse the packet body, based on the known control packet type.\n ControlPacket parsedPacket;\n switch (controlPacketType) {\n case CONNECT:\n parsedPacket = ConnectPacket.parsePacket(messageLength, receiveBuffer);\n break;\n case CONNACK:\n parsedPacket = ConnackPacket.parsePacket(messageLength, receiveBuffer);\n break;\n case PUBLISH:\n parsedPacket = PublishPacket.parsePacket(headerByte, messageLength, receiveBuffer);\n break;\n case SUBSCRIBE:\n case UNSUBSCRIBE:\n parsedPacket = SubscribePacket.parsePacket(controlPacketType, messageLength, receiveBuffer);\n break;\n case SUBACK:\n parsedPacket = SubackPacket.parsePacket(messageLength, receiveBuffer);\n break;\n default:\n parsedPacket = ControlPacket.parsePacket(controlPacketType, messageLength, receiveBuffer);\n break;\n }\n\n // Include packet tracing if required.\n if (logger.getLogLevel() == Level.FINER) {\n logger.log(Level.FINER, \"RX \" + parsedPacket.tracePacket(false, false));\n } else if (logger.getLogLevel() == Level.FINEST) {\n logger.log(Level.FINEST, \"RX \" + parsedPacket.tracePacket(false, true));\n }\n\n // Hand off the received packet.\n deferredReceive.callback(parsedPacket);\n deferredReceive = null;\n\n // After parsing the packet, release any fully consumed buffers.\n if (!receiveBuffer.hasRemaining()) {\n socketService.releaseByteBuffer(receiveBuffer);\n receiveBuffer = null;\n }\n }\n\n // Request more data on a buffer underflow. This doubles the size of the request\n // buffer and then attempts to fill it.\n catch (final BufferUnderflowException error) {\n receiveBuffer.position(startPosition);\n fillReceiveBuffer(2 * receiveBuffer.remaining());\n }\n\n // Handle fatal errors.\n catch (final Exception error) {\n deferredReceive.errback(error);\n deferredReceive = null;\n }\n }", "public abstract void handle(Socket socket);", "@Override\r\n public void run() {\n int PORT = 55555;\r\n\r\n //Open a socket to receive from on port PORT\r\n try {\r\n switch (socketType) {\r\n case Type1:\r\n receiving_socket = new DatagramSocket(PORT);\r\n break;\r\n case Type2:\r\n receiving_socket = new DatagramSocket2(PORT);\r\n break;\r\n case Type3:\r\n receiving_socket = new DatagramSocket3(PORT);\r\n break;\r\n case Type4:\r\n receiving_socket = new DatagramSocket4(PORT);\r\n break;\r\n\r\n }\r\n\r\n } catch (SocketException e) {\r\n System.out.println(\"ERROR: TextReceiver: Could not open UDP socket to receive from.\");\r\n e.printStackTrace();\r\n System.exit(0);\r\n }\r\n\r\n boolean running = true;\r\n\r\n while (running) {\r\n\r\n try {\r\n //Receive a DatagramPacket (note that the string cant be more than 80 chars)\r\n byte[] buffer = new byte[80];\r\n DatagramPacket packet = new DatagramPacket(buffer, 0, 80);\r\n System.out.println(new String(packet.getData()));\r\n receiving_socket.receive(packet);\r\n\r\n //Get a string from the byte buffer\r\n String str = new String(buffer);\r\n //Display it\r\n if (!str.isEmpty()) {\r\n System.out.print(str.trim());\r\n }\r\n\r\n //The user can type EXIT to quit\r\n if (str.substring(0, 4).equalsIgnoreCase(\"EXIT\")) {\r\n running = false;\r\n }\r\n } catch (IOException e) {\r\n System.out.println(\"ERROR: TextReceiver: Some random IO error occured!\");\r\n e.printStackTrace();\r\n }\r\n }\r\n //Close the socket\r\n receiving_socket.close();\r\n\r\n }", "@Override\r\n\tpublic void onReceive(Object arg0) throws Exception {\n\t\t\r\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t\twhile(connected) {\n\t\t\tif(GameActivity.getInstance() == null)\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\ttry {\n\t\t\t\t// Read first 4 bytes (int, messageType) from stream\n\t\t\t\t//in.read(bytes, 0, 4);\n\t\t\t\tint messageType = in.readInt();\n\t\t\t\t//intByteBuffer.clear(); // Clear buffer so we can read from it again\n\t\t\t\t\n\t\t\t\t// Receive appropriate message based on received messageType\n\t\t\t if(messageType == Message.CHARACTERS.value()) {\n\t\t\t\t\treceiveCharacters();\n\t\t\t\t} else if(messageType == Message.ID.value()) {\n\t\t\t\t\treceiveId();\n\t\t\t\t} else {\n\t\t\t\t\tSystem.err.println(\"Received message with unknown id: \" + messageType);\n\t\t\t\t}\n\t\t\t \n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(\"Connection to server lost\");\n\t\t\t\te.printStackTrace();\n\t\t\t\tclose();\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "@Override\r\n\tpublic void newLineRecieved() {\n\t\tString response = grblPort.readNextLine();\r\n\t\tresponse.trim();\r\n\t\tSystem.out.println(\"Recieve: \" + response);\r\n\t\t//System.out.println(\"HAHAHAH\");\r\n\t\tif (response.contains(\"ok\") && grblPort.ok == false){\t\t\t\r\n\t\t\tgrblPort.ok = true;\t\t\r\n\t\t\tSystem.out.println(\"Got ACK\");\r\n\t\t\tif (!sendLines.isEmpty()){//If there is more stuff in the buffer, keep on sending it.\r\n\t\t\t\tsendLines.remove(0);\r\n\t\t\t\tgrblPort.sendDataLine(sendLines.get(0)); \t\t\r\n\t \t}\r\n\t\t}\r\n\t\tif (response.contains(\"error\")){\r\n\t\t\tSystem.out.println(\"ERROR...ERROR...ERROR...ERROR...ERROR...ERROR...ERROR...ERROR...ERROR\");\r\n\t\t\tgrblPort.sendDataLine(sendLines.get(0)); \r\n\t\t}\r\n\t\tif (response.contains(\"<\")&&response.contains(\">\")){\r\n\t\t\tif (!sendLines.isEmpty()){//If there is more stuff in the buffer, keep on sending it.\r\n\t\t\t//\tgrblPort.sendDataLine(sendLines.remove(0)); \t\t\r\n\t \t}\r\n\t\t\tresponse = response.replaceAll(\"<\", \"\");\r\n\t\t\tresponse = response.replaceAll(\">\", \"\");\r\n\t\t\tString data[] = response.split(\",\");\r\n\t\t\tfor (String string : data) {\r\n\t\t\t\tstring = string.toUpperCase();\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"************************************* \"+data[0]);\r\n\t\t\tswitch (data[0].toUpperCase()) {\r\n\t\t\tcase \"IDLE\":\r\n\t\t\t\tmachineState = MachineState.IDLE;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"RUN\":\r\n\t\t\t\tmachineState = MachineState.RUNNING;\r\n\t\t\t\treturn;\r\n\t\t\t\t//break;\r\n\t\t\tcase \"QUEUE\":\r\n\t\t\t\tmachineState = MachineState.QUEUE;\r\n\t\t\t\treturn;\r\n\t\t\tdefault:\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "private Object receive() {\n Object o = null;\n try {\n System.out.println(\"03. -- About to receive an object...\");\n o = is.readObject();\n System.out.println(\"04. <- Object received...\");\n } catch (Exception e) {\n System.out.println(\"XX. Exception Occurred on Receiving:\" + e.toString());\n }\n return o;\n }", "public void receiveMessage() throws IOException {\n String inputLine;\n while (true) {\n inputLine = inputStream.readLine();\n if (inputLine != null && !inputLine.equals(\"\")){\n if (!inputLine.equals(\"Host: closing\")) {\n network.appendMessage(inputLine);\n } else {\n network.appendMessage(\"Server has been closed! Restart the \"\n + \"server!\");\n waitForServer();\n }\n }\n }\n }", "private void recvSocket(String mServerMessage) {\n // if not started by Activity, prolong the pingStamp to keep running\n // until we have nothing else to do\n if (!serviceStartNormalMethod) {\n pingStamp = System.currentTimeMillis();\n }\n\n if (mServerMessage != null) {\n CtrlMessage msg = new CtrlMessage(mServerMessage);\n if (msg.getIsExtracted()) {\n if (ctrlAuthenticated) {\n if (msg.getIsAck()) {\n Log.i(TAG, \"Processing ACK to our TXsender: \" + msg.getTXsender());\n\n dataSource.ackTxClient2Server(msg.getTXsender());\n Log.i(TAG, \" ...acked in DB.\");\n\n if (msg.getIsOutOfSync()) {\n Log.i(TAG, \" ...ACKed but server told me OUT-OF-SYNC!\");\n if (outOfSyncCnt >= 5) {\n Log.i(TAG, \" ...will flush queue and re-connect the socket!\");\n\n stopQueuedItemsSender();\n\n dataSource.flushTxClient2Server();\n\n // close the socket, and ctrlConnMaintainer will\n // re-connect ASAP\n restartCtrlSocket();\n }\n else {\n outOfSyncCnt++;\n Log.i(TAG, \" ...will re-send unacknowledged queue items. Increased flush-counter to: \" + outOfSyncCnt + \"/\" + 5 + \"!\");\n\n stopQueuedItemsSender();\n\n Log.i(TAG, \" ...marking all unacknowledged items as unsent...\");\n dataSource.unsendAllUnackedTxClient2Server();\n\n Log.i(TAG, \" ...starting queued items sender of all unacknowledged items...\");\n startQueuedItemsSender();\n }\n }\n }\n else {\n Log.i(TAG, \"Processing Server's data...\");\n\n // acknowledge immediatelly (but only if\n // client is authorized and if this is not a\n // notification)\n CtrlMessage msgAck = new CtrlMessage();\n msgAck.setIsAck(true);\n msgAck.setTXsender(msg.getTXsender());\n\n if (!msg.getIsNotification()) {\n if (msg.getTXsender() <= TXserver) {\n msgAck.setIsProcessed(false);\n Log.w(TAG, \" ...Warning: re-transmitted command, not processed!\");\n }\n else if (msg.getTXsender() > (TXserver + 1)) {\n // SYNC PROBLEM! Server sent higher\n // than we expected! This means we\n // missed some previous Message!\n // This part should be handled on\n // Servers side.\n // Server should flush all data (NOT\n // A VERY SMART IDEA) and\n // re-connect. Re-sync should\n // naturally occur\n // then in auth procedure as there\n // would be nothing pending in queue\n // to send to Client.\n\n msgAck.setIsOutOfSync(true);\n msgAck.setIsProcessed(false);\n Log.e(TAG, \" ...Error: Client sent out-of-sync data! Expected: \" + (TXserver + 1) + \", but I got: \" + msg.getTXsender());\n }\n else {\n msgAck.setIsProcessed(true);\n // next package we will receive\n // should be +1 of current value, so\n // lets ++\n TXserver++;\n\n // instead of saving TXserver value to our local\n // DB, we can also save it to Server!\n /*\n dataSource.savePubVar(\"TXserver\", String.valueOf(TXserver));\n */\n JSONObject ooo = new JSONObject();\n try {\n ooo.put(\"TXserver\", TXserver);\n msgAck.setData(ooo);\n msgAck.setIsSaveTXserver(true);\n }\n catch (JSONException e) {\n e.printStackTrace();\n }\n }\n\n sendSocket(msgAck.buildMessage());\n Log.i(TAG, \" ...ACK sent back for TXsender: \" + msg.getTXsender());\n }\n else {\n // we need this for bellow code to\n // execute\n msgAck.setIsProcessed(true);\n Log.i(TAG, \" ...didn't ACK because this was a notification.\");\n }\n\n if (msgAck.getIsProcessed()) {\n if (msg.getIsSystemMessage()) {\n Log.i(TAG, \" ...system message received, parsing...\");\n\n // we must parse and extract stuff\n // from msg.data object\n JSONObject data = (JSONObject) msg.getData();\n\n try {\n if (data.has(\"type\") && data.getString(\"type\").equals(\"base_connection_status\") && data.has(\"connected\") && data.has(\"baseid\") && data.has(\"basename\")) {\n // this is a Base status\n // notification, we get this for\n // each Base associated to our\n // Client account\n\n Log.i(TAG, \" ...got Base Status Notification. BaseID=\" + data.getString(\"baseid\") + \", connected=\" + data.getBoolean(\"connected\"));\n\n // update base's last activity only if\n // the status has changed since last\n // update\n boolean lastConnectedState = dataSource.getBaseStatus(data.getString(\"baseid\"));\n if (lastConnectedState != data.getBoolean(\"connected\")) {\n dataSource.updateBaseLastActivity(data.getString(\"baseid\"));\n }\n\n dataSource.saveBaseConnectedStatus(context, data.getString(\"baseid\"), data.getBoolean(\"connected\"), data.getString(\"basename\"));\n broadcastNewBaseConnectionStatus(data.getString(\"baseid\"), data.getBoolean(\"connected\"));\n\n // Call appropriate BaseDataParser that\n // will possibly show notifications and\n // stuff if Activity for this BaseID is\n // in background\n callBaseDataParserWhenBackgrounded(data.getString(\"baseid\"), null, (lastConnectedState != data.getBoolean(\"connected\")), data.getBoolean(\"connected\"));\n }\n }\n catch (JSONException e) {\n e.printStackTrace();\n }\n }\n else {\n Log.i(TAG, \" ...fresh data from Base \" + msg.getBaseIds());\n Log.i(TAG, \" ...Data: \" + msg.getData());\n\n dataSource.saveBaseData(msg.getBaseIds().get(0), msg.getData().toString());\n dataSource.updateBaseLastActivity(msg.getBaseIds().get(0));\n broadcastNewBaseDataArrival(msg.getBaseIds().get(0), msg.getData().toString());\n\n // Call appropriate BaseDataParser that will\n // possibly show notifications and stuff if\n // Activity for this BaseID is in background\n callBaseDataParserWhenBackgrounded(msg.getBaseIds().get(0), msg.getData().toString(), false, false);\n }\n }\n }\n }\n else {\n // if not authenticated, whatever we receive\n // should be response to our auth request, so\n // lets parse it\n try {\n // we must parse and extract stuff from\n // msg.data object\n if (msg.getData() instanceof JSONObject) {\n JSONObject data = (JSONObject) msg.getData();\n\n if (data.has(\"type\") && data.get(\"type\") != null && data.getString(\"type\").equals(\"authentication_response\") && data.has(\"result\") && data.get(\"result\") != null && data.has(\"TXserver\")) {\n // authorized?\n if (data.getInt(\"result\") == 0) {\n ctrlAuthenticated = true;\n\n if (msg.getIsSync()) {\n TXserver = 0;\n }\n else {\n // instead reading TXserver from local\n // storage, we can now read the value\n // Server sends us, because we are\n // storing it on Server now:\n // (Server-Stored TXServer value)\n /*\n String sTXserver = dataSource.getPubVar(\"TXserver\");\n try {\n TXserver = Integer.parseInt(sTXserver);\n }\n catch (NumberFormatException e) {\n TXserver = 0;\n }\n */\n try {\n TXserver = data.getInt(\"TXserver\");\n }\n catch (JSONException jse) {\n TXserver = 0;\n }\n }\n\n // update our GCM regID to Server\n manageRegID(false);\n\n // we have pending items in DB to send to\n // Server?\n if (dataSource.countUnackedTxClient2Server() > 0) {\n Log.i(TAG, \"WE HAVE UNACKED ITEMS TO SEND NOW\");\n startQueuedItemsSender();\n }\n else {\n Log.i(TAG, \"NO UNACKED ITEMS TO SEND NOW\");\n }\n\n ctrlError = CtrlErrors.NONE;\n broadcastCtrlStatus();\n }\n else if (data.getInt(\"result\") == 1) {\n ctrlError = CtrlErrors.WRONG_AUTH_TOKEN;\n broadcastCtrlStatus();\n closeCtrlSocket();\n }\n else {\n ctrlError = CtrlErrors.TOO_MANY_AUTH_ATTEMPTS;\n broadcastCtrlStatus();\n closeCtrlSocket();\n }\n }\n }\n else {\n Log.e(TAG, \"Response to AUTH should have been JSON Object! Ignored.\");\n }\n }\n catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }\n }\n }", "public void recvSensorEvent(Object data_)\n\t{\n\t\tList<Tuple> event = ConstructSensingEvent((Message) data_) ;\n\t\tmicroLearner.handleSensorEvent(event);\t\t\n\t}", "void receive(String watcher) throws ProtocolExecutionException;", "public void receivedDataFromStation(int station, String data) {}", "@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tInputStream inputStream = mSocket.getInputStream();\n\t\t\tint leng;\n\t\t\tbyte[] buffer = new byte[1024];\n\t\t\tByteArrayBuffer[] data = {new ByteArrayBuffer(1024 * 32)};\n\t\t\twhile((leng = inputStream.read(buffer)) != -1 && mConected)\n\t\t\t{\n\t\t\t\tif(mConected)\n\t\t\t\t{\n\t\t\t\t\tdata[0].append(buffer, data[0].length(), leng);\n\t\t\t\t\tprocessMessage(data);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tLog.e(TAG, \"Cannot set InputStream\\nNetwork error\");\n\t\t\tevent.connectionLost();\n\t\t} catch (ProtocolException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tevent.connectionLost();\n\t\t}\n\t}", "public int receive (byte []buffer)\n throws IOException,IllegalArgumentException\n {\n return receiveNative (buffer, 0, buffer.length, 0);\n }", "public abstract void onBinaryReceived(byte[] data);", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2014-02-25 10:38:11.982 -0500\", hash_original_method = \"4C2C559A1F5EA512B39B33D53CB17E9D\", hash_generated_method = \"172F68C5AE823BE13435DB055190A3AF\")\n \npublic byte[] receive() throws IOException\n {\n int length;\n byte[] result;\n\n _socket_.receive(__receivePacket);\n\n result = new byte[length = __receivePacket.getLength()];\n System.arraycopy(__receiveData, 0, result, 0, length);\n\n return result;\n }", "LcapSocket getReceiveSocket() {\n return rcvSocket;\n }", "public void onReceive();", "public void run()\n\t{\n\t\ttry \n\t\t{\n\t\t\tis = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n\n\t\t\twhile ((serverInput = is.readLine())!= null)\n\t\t\t{\n\t\t\t\tif (Objects.equals(serverInput.substring(0, 3), \"210\"))\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(serverInput);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if (Objects.equals(serverInput.substring(0, 3), \"200\"))\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(serverInput.substring(0, 6));\n\n\t\t\t\t\tif (serverInput.length() > 22)\n\t\t\t\t\t{\n\t\t\t\t\t\tString [] list = serverInput.substring(6).split(\"@\");\n\t\t\t\t\t\tfor (int i = 0; i < list.length; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(list[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (Objects.equals(serverInput.substring(6), \"QUIT\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(serverInput.substring(6));\n\t\t\t\t\t\tbreak;\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//Do nothing\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(serverInput);\n\t\t\t\t}\n\t\t\t}\n\t\t\tis.close();\n\t\t\tsocket.close();\n\t\t\tSystem.exit(0);\n\t\t} \n\t\tcatch (IOException e) \n\t\t{\n\t\t\t//Error Handler\n\t\t}\n\t}", "@Override\n public void onReceive(Object message) throws Exception {\n }", "public void receive(final PacketHandler handler) {\n receive = new Thread(\"receive_thread\") {\n public void run() {\n while(running) {\n byte[] buffer = new byte[1024];\n DatagramPacket dgpacket = new DatagramPacket(buffer, buffer.length);\n\n try {\n socket.receive(dgpacket);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n handler.process(new Packet(dgpacket.getData(), dgpacket.getAddress(), dgpacket.getPort()));\n }\n }\n };\n\n receive.start();\n }", "public void run() {\n\t\ttry {\n\t\t\tObjectInputStream in = new ObjectInputStream(socket.getInputStream());\n\t\t\treceivedPacket = (Packet) in.readObject();\n this.handleReceivedPacket(receivedPacket);\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (ClassNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "void setReceiveSocket(LcapSocket socket) {\n rcvSocket = socket;\n }" ]
[ "0.75057566", "0.7505373", "0.7133966", "0.7032547", "0.6919413", "0.6867136", "0.6827808", "0.6818984", "0.67401785", "0.67195934", "0.6719219", "0.6706773", "0.66780573", "0.6672065", "0.6633285", "0.6584011", "0.6568354", "0.655838", "0.6544904", "0.6529201", "0.6526655", "0.65194285", "0.6513646", "0.64951766", "0.64821756", "0.64422005", "0.6438743", "0.6436629", "0.6434022", "0.6430842", "0.64092666", "0.63770264", "0.6374425", "0.63669425", "0.6351295", "0.63485694", "0.63280636", "0.6306106", "0.6302951", "0.63004535", "0.6298526", "0.62518764", "0.6238978", "0.62270826", "0.6224609", "0.62223244", "0.62119603", "0.6208793", "0.62052953", "0.6198607", "0.61609405", "0.61601883", "0.61600685", "0.61525244", "0.6152326", "0.6152036", "0.6148881", "0.61472654", "0.6142471", "0.6134852", "0.613469", "0.6129578", "0.6127552", "0.6122796", "0.6122653", "0.6110669", "0.61047363", "0.610356", "0.60989016", "0.6093635", "0.60896677", "0.6089205", "0.6085893", "0.6084456", "0.608164", "0.6078294", "0.6076853", "0.60754895", "0.60726243", "0.60682505", "0.6066247", "0.60625297", "0.6058903", "0.6052797", "0.6050279", "0.6046742", "0.60357875", "0.60247797", "0.601906", "0.6017409", "0.60005707", "0.5995472", "0.5991576", "0.59844536", "0.59782195", "0.5977533", "0.5975177", "0.59689426", "0.596291", "0.5951045", "0.5945268" ]
0.0
-1
Start the thread that receives data over a connection
public void onStart() { new Thread() { @Override public void run() { receive(); } }.start(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "@Override\r\n\tpublic void run() {\r\n\t\t\r\n\t\tLog.d(TAG, \"begin ConnectedThread job\");\r\n\t\t\r\n\t\t// Receive buffer\r\n\t\tbyte[] buffer = new byte[256];\r\n\t\t// Amount of bytes read from InputStream\r\n\t\tint length = 0;\r\n\t\t\r\n\t\twhile(running){\r\n\t\t\t\r\n\t\t\ttry{\r\n\t\t\t\t\r\n\t\t\t\t// Read available bytes from InputStream\r\n\t\t\t\tlength = oInStream.read(buffer);\r\n\t\t\t\t\t\t\r\n\t\t\t\t// Report the obtained bytes to the ConnectedListener\r\n\t\t\t\tif(oListener != null){\r\n\t\t\t\t\toListener.onReceive(buffer, length);\r\n\t\t\t\t}\r\n\t\t\t}catch(IOException e){\r\n\t\t\t\t\r\n\t\t\t\tLog.e(TAG, \"disconnected\", e);\r\n\t\t\t\t\r\n\t\t\t\t// Stop job\r\n\t\t\t\trunning = false;\r\n\t\t\t\t\r\n\t\t\t\t// Report this connection lose to the ConnectedListener \r\n\t\t\t\tif(oListener != null){\r\n\t\t\t\t\toListener.onDisconnect();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void run() {\n readFromClient();\n }", "private synchronized void openConnection() {\n\t\tsendData = new Thread(){\n\t\t\tpublic void run(){\n\t\t\t\tsynchronized(msgs){\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmsgs.wait(1000);\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\twhile(true){\n\t\t\t\t\tsynchronized(msgs){\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\tif(msgs.size() > 0){\n\t\t\t\t\t\t\t\tout = new PrintWriter(new PrintWriter(s.getOutputStream()));\n\t\t\t\t\t\t\t\tString temp = msgs.get(0);\n\t\t\t\t\t\t\t\tout.println(temp);\n\t\t\t\t\t\t\t\tout.flush();\n\t\t\t\t\t\t\t\tSystem.out.println(temp);\n\t\t\t\t\t\t\t\tmsgs.remove(0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}catch(IOException 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}\n\t\t\t}\n\t\t};\n\t\treceiveData = new Thread(){\n\t\t\tpublic void run(){\n\t\t\t\tString received;\n\t\t\t\tdo{\n\t\t\t\t\ttry {\n\t\t\t\t\t\tin = new BufferedReader(new InputStreamReader(s.getInputStream()));\n\t\t\t\t\t\treceived = in.readLine();\n\t\t\t\t\t\tparseMessageReceived(received);\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}while(true);\n\t\t\t}\n\t\t};\n\t\tsendData.setDaemon(true);\n\t\treceiveData.setDaemon(true);\n\t\tsendData.start();\n\t\treceiveData.start();\n\t\tnew Thread()\n\t\t{\n\t\t\tpublic void run(){\n\t\t\t\twhile(true){\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsendData.join();\n\t\t\t\t\t\treceiveData.join();\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}.start();\n\t}", "public void run() {\n\n // Attempt to connect and exit the thread if it failed\n try {\n connect();\n sendToReadHandler(\"CONNECTED\");\n } catch (Exception e) {\n Log.e(TAG, \"Failed to connect!\", e);\n sendToReadHandler(\"CONNECTION FAILED\");\n disconnect();\n return;\n }\n\n // Loop continuously, reading data, until thread.interrupt() is called\n while (!this.isInterrupted()) {\n\n // Make sure things haven't gone wrong\n if ((inStream == null) || (outStream == null)) {\n Log.e(TAG, \"Lost bluetooth connection!\");\n break;\n }\n\n // Read data and add it to the buffer\n String s = read();\n if (s.length() > 0)\n rx_buffer += s;\n\n // Look for complete messages\n parseMessages();\n }\n\n // If thread is interrupted, close connections\n disconnect();\n sendToReadHandler(\"DISCONNECTED\");\n }", "@Override\n public void run() {\n try {\n socket = new Socket(\"192.168.0.165\", 2000);\n out = new PrintWriter(socket.getOutputStream());\n in = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n ReadThread readThread = new ReadThread();\n readThread.start();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n boolean done = false;\n\n while (!done) {\n if (message != null) {\n try {\n out.print(message);\n out.flush();\n message = null;\n } catch (Exception e) {\n e.printStackTrace();\n try {\n socket.close();\n in.close();\n out.close();\n done = true;\n } catch (IOException d) {\n e.printStackTrace();\n }\n }\n }\n }\n disconnect();\n }", "public void run() {\n try {\n socketIn = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n socketOut = new ObjectOutputStream(socket.getOutputStream());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n readFromClient();\n pingToClient();\n }", "public void startThread(){\n String message = \"Connecting to RescueNet...Please Wait\";\n showProgressDialog(message);\n connectionThread = new ConnectionThread(mwifiAdmin, handlerMain);\n connectionThread.start();\n }", "private void receive() {\n receive = new Thread(\"Receive\") {\n public void run() {\n while (running) {\n byte[] data = new byte[1024];\n DatagramPacket packet = new DatagramPacket(data, data.length);\n try {\n socket.receive(packet);\n } catch (IOException e) {\n e.printStackTrace();\n }\n processPacket(packet);\n }\n }\n };\n receive.start();\n }", "private void Thread() {\n\n Thread thread = new Thread ( new Runnable() {\n \n @Override\n public void run() {\n \n String mensagem = \"\";\n\n try {\n \n InputStreamReader isr = new InputStreamReader(socket.getInputStream());\n BufferedReader br = new BufferedReader(isr);\n\n while ((mensagem = br.readLine()) != null) {\n\n enviarMensagem(mensagem);\n }\n } catch ( Exception e ) {\n e.printStackTrace();\n }\n }\n });\n //para iniciar a thread\n thread.start();\n }", "public void run() {\n\t\t\tbluetooth_adapter.cancelDiscovery();\r\n\t\t\tif(socket == null) return;\r\n\t\t\t\r\n\t\t\t// Connect the device through the socket. This will block\r\n\t\t\t// until it succeeds or throws an exception\r\n\t\t\ttry {\r\n\t\t\t\tsocket.connect();\r\n\t\t\t\tdata_thread = new Data_Thread(socket);\r\n\t\t\t\tdata_thread.start();\r\n\t\t\t\t//System.out.println(\"==============> Bluetooth Connected <===================\");\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsocket.close();\r\n\t\t\t\t} catch (IOException closeException) {\r\n\t\t\t\t\tcloseException.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tString message = \"Error: \" + e;\r\n\t\t\t\tif(device != null) {\r\n\t\t\t\t\tmessage += \" Device: \"+device.getName();\r\n\t\t\t\t}\r\n\t\t\t\tbluetooth_show_message(message);\r\n\t\t\t}\r\n\t\t\r\n\t\t\tclient_connect_thread = null;\r\n\t\t}", "public void start() {\n\t\t\n\t\ttry {\n\t\t\tmainSocket = new DatagramSocket(PORT_NUMBER);\n\t\t}\n\t\tcatch(SocketException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\t\n\t\t//Lambda expression to shorten the run method\n\t\tThread serverThread = new Thread( () -> {\n\t\t\tlisten();\n\t\t});\n\t\t\n\t\tserverThread.start();\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 run() {\n mBluetooth.cancelDiscovery();\n\n try {\n // Connect the device through the socket. This will block\n // until it succeeds or throws an exception\n mmSocket.connect();\n } catch (IOException connectException) {\n // Unable to connect; close the socket and get out\n try {\n mmSocket.close();\n } catch (IOException closeException) { }\n return;\n }\n\n // Do work to manage the connection (in a separate thread)\n connectedSocket(mmSocket);\n }", "public void run() {\n\t\t\twhile (running) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsocket = mmServerSocket.accept();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\tbluetooth_show_message(\"Bluetooth Error! Accepting a connection failed. Reason:\" + e);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// If a connection was accepted\r\n\t\t\t\t// Do work to manage the connection (in a separate thread)\r\n\t\t\t\tif (socket != null) {\r\n\t\t\t\t\t//System.out.println(\"=========> Bluetooth Connected as Server <===========\");\r\n\t\t\t\t\tdata_thread = new Data_Thread(socket);\r\n\t\t\t\t\tdata_thread.start();\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tmmServerSocket.close();\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tbluetooth.this.server_connect_thread = null;\r\n\t\t}", "@Override\n\t\tpublic void run() {\n\t\t\ttry {\n\t\t\t\tLog.v(TAG,\"connect to server...\");\n\t\t\t\tsocket=new Socket(\"140.116.246.200\",4000+id);\n\t\t\t\tout=socket.getOutputStream();\n\t\t\t\tin=socket.getInputStream();\n\t\t\t\tLog.v(TAG,\"connect!!\");\n\t\t\t\n\t\t\t\tsendData(\"ask#\");\n\t\t\t\tUIHr.post(refreshUI); \t\n\t\t\t\tresult=new Integer(readData());\n\t\t\t\tUIHr.post(refreshUI); \t\t\n\t\t\t\tsendData(\"over#\");\n\t\t\t\tsocket.close();\n\t\t\t} catch (UnknownHostException e) {e.printStackTrace();} \n\t\t\tcatch (IOException e) {e.printStackTrace();}\n\t\t}", "@Override\n public void run() {\n byte[] buffer = new byte[1024];\n int bytes;\n while (true) {\n try {\n\n bytes = inputStream.read(buffer);\n String data = new String(buffer, 0, bytes);\n handler.obtainMessage(MainActivityFreeEX.DATA_RECEIVED, data).sendToTarget();\n\n Log.i(this.toString(), \"en el run de Connection: \" + handler.obtainMessage(MainActivityFreeEX.DATA_RECEIVED, data).toString());\n\n\n } catch (IOException e) {\n break;\n }\n }\n }", "public void run() {\n\t\t\twhile (true) {// 保持连接直到异常发生或套接字返回\n\t\t\t\ttry {\n\t\t\t\t\tif (serverSocket != null) {\n\t\t\t\t\t\tmTempSocket = serverSocket.accept(); // 如果一个连接同意\n\t\t\t\t\t}\n\t\t\t\t\t// If a connection was accepted\n\t\t\t\t\tif (mTempSocket != null) {\n\t\t\t\t\t\t// Do work to manage the connection (in a separate\n\t\t\t\t\t\t// thread)\n\t\t\t\t\t\tmanageConnectedSocket(); // 管理一个已经连接的RFCOMM通道在单独的线程。\n\t\t\t\t\t\tserverSocket.close();\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private void startInThread() {\n final Client fthis = this;\n if (in != null && in.isAlive()) in.interrupt();\n in = new Thread(() -> {\n while (true) {\n if (client.isClosed()) break;\n try {\n InputStream inFromServer = client.getInputStream();\n if (inFromServer.available() > 0) {\n String l = (char) inFromServer.read() + \"\";\n while (!l.endsWith(\"\\r\")) {\n l += (char) inFromServer.read() + \"\";\n }\n l = l.replace(\"\\r\", \"\");\n runPacketEvent(new ClientPacketEvent(fthis, PacketType.CLIENT_RECEIVE, l));\n }\n } catch (Exception e) {\n e.printStackTrace();\n break;\n }\n }\n });\n in.start();\n }", "@Override\n public void run() {\n P.print(\"Listening on port \"+P.port+\", waiting for incomming connection...\");\n try {\n ServerSocket serverSocket = new ServerSocket(P.port);\n while (P.choke_thread_running) { //read input forever.\n Receive receive_thread = new Receive();\n Socket s = serverSocket.accept();\n String addr = s.getInetAddress().toString();\n int p = s.getPort();\n int i;\n for(i = 0;i<P.peer_ip.length;i++){\n if(addr.equals(P.peer_ip[i])){\n P.sockets[i] = s;\n P.tcp_out_stream[i] = new ObjectOutputStream(s.getOutputStream());\n break;\n }\n }\n receive_thread.start(P,s,P.peer_id[--i]);\n P.print(\"Accepted incomming connection: ip = \"+addr.substring(1)+\", port = \"+p);\n }\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\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}", "final public void run() {\n connectionEstablished();\n\n // The message from the server\n int msg;\n\n // Loop waiting for data\n\n try {\n // messageTimer.schedule(new TimerTask() {\n // @Override\n // public void run() {\n // try {\n // sendFromMessageQueue();\n // } catch (IOException e) {}\n // }\n // }, 0, 100);\n while (!readyToStop) {\n // Get data from Server and send it to the handler\n // The thread waits indefinitely at the following\n // statement until something is received from the server\n\n try { // added in version 2.31\n\n // String cur = input.readLine();\n // handleBig5String(cur + \"\\n\");\n readByte();\n\n } catch (RuntimeException ex) { // thrown by handleMessageFromServer\n\n connectionException(ex);\n }\n }\n } catch (Exception exception) {\n if (!readyToStop) {\n try {\n closeAll();\n } catch (Exception ex) {\n }\n\n clientReader = null;\n connectionException(exception);\n }\n } finally {\n\n clientReader = null;\n connectionClosed(); // moved here in version 2.31\n }\n }", "public void run() {\r\n try {\r\n while (true) {\r\n Socket serverClient = serverSocket.accept(); //server accept the contentServerId connection request\r\n ServerClientThread sct = new ServerClientThread(serverClient, lamportClock, feeds, timers); //send the request to a separate thread\r\n sct.start();\r\n }\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "public void run()\n\t{\n\t\tSystem.out.println(\"Connection established: \" + clientSocket);\n\t\tThread messageThread; // start a new Thread on TCPReceiver to receive messages through clientSocket.\n\t\ttry \n\t\t{\n\t\t\tmessageThread = new Thread(new TCPNodeReceiver(clientSocket, messagingNode), \"tcpReceiverThread\"); // pass a copy of the MessagingNode to TCPNodeReceiver.\n\t\t\tmessageThread.start(); // start receiving messages.\t\t\t\t\t\n\t\t} \n\t\tcatch (IOException e) {\n\t\t\tSystem.err.println(\"messagingNodeThread got error: \" + e.getMessage());\n\t\t} \n\t}", "@Override\r\n\tpublic void run() {\n\t boolean listen = true;\r\n\t while (listen) {\r\n\t\ttry {\r\n\t\t Socket socket = listeningSocket.accept();\r\n\t\t Thread ConnThread = new Thread (new Connection (socket, pid));\r\n\t\t ConnThread.start();\r\n\t\t connThreads.add(ConnThread);\r\n\t\t \r\n\t\t} catch (SocketException e) {\r\n\t\t // TODO Auto-generated catch block\r\n\t\t listen = false;\r\n\t\t} catch (Exception e) {\r\n\t\t System.err.println(\"Random exception\");\r\n\t\t}\r\n\t }\r\n\t}", "public void Connect() {\n run = new Thread(\"Connect\") {\n @Override\n public void run() {\n running = true;\n try {\n server = new ServerSocket(9080);\n waitingForConnection();\n } catch (IOException ex) {\n Logger.getLogger(Dashboard.class\n .getName()).log(Level.SEVERE, null, ex);\n }\n }\n };\n run.start();\n }", "@Override\r\n\tpublic void run() {\n\t\tsuper.run();\r\n\t\ttry {\r\n\r\n\t\t\tBufferedReader in = null;\r\n\t\t\tPrintWriter out = null;\r\n\t\t\tString result = \"\";\r\n\t\t\twhile (isStart) {\r\n\t\t\t\tsocket = new Socket();\r\n\t\t\t\tsocket.connect(\r\n\t\t\t\t\t\tnew InetSocketAddress(MyApplication.share.getIp(), PORT),\r\n\t\t\t\t\t\t5 * 1000);\r\n\t\t\t\twhile (!socket.isClosed()) {\r\n\t\t\t\t\tin = new BufferedReader(new InputStreamReader(\r\n\t\t\t\t\t\t\tsocket.getInputStream()));\r\n\t\t\t\t\tout = new PrintWriter(socket.getOutputStream());\r\n\r\n\t\t\t\t\tout.println(\"getNotification\");\r\n\t\t\t\t\tout.flush();\r\n\r\n\t\t\t\t\tresult = in.readLine();\r\n\t\t\t\t\tif (!TextUtils.isEmpty(result)) {\r\n\t\t\t\t\t\taccessResult(new String(Base64.decode(\r\n\t\t\t\t\t\t\t\tresult.getBytes(), Base64.DEFAULT)));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tLog.w(TAG, \"Socket ���ؽ��Ϊ null...\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tsleep(3 * 1000);\r\n\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tsocket.close();\r\n\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}", "public void run(){\n //wait for clients to connect to the server and start a new thread,\n //then continue waiting.\n while(true) {\n //create the packet to accept a message\n byte[] buf = new byte[bufSize];\n DatagramPacket packet = new DatagramPacket(buf, buf.length);\n try {\n //receive a message from the client\n datagramSocket.receive(packet);\n } catch (IOException e) {\n System.err.println(\"Error receiving datagram packet\");\n } catch (Exception e){\n serverGUI.displayText(\"Error: There is an issue with your connection. Please restart the program.\");\n }\n //Start a new thread for this client\n ServerThread servant = new ServerThread(mainServer, packet, serverGUI);\n servant.start();\n }\n }", "public void run(){\n\t\t\n\t\twhile(true){\n\t\t\ttry {\n\t\t\t\tSocket s = listener.accept();\n\t\t\t\tnew ServerConnection(chatServ, s).start();\n\t\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\t\n\t\t\t\te.printStackTrace();\n\t\t\t\treturn; // stop listening\n\t\t\t}\n\t\t}\n\t}", "public static void startChatServer() {\n\t\tbyte[] buffer = new byte[1024];\n\t\tStreamConnectionNotifier cn = null;\n\t\ttry {\n\t\t\tLocalDevice local = LocalDevice.getLocalDevice();\n\t\t\tlocal.setDiscoverable(DiscoveryAgent.GIAC);\n\t\t\tcn = (StreamConnectionNotifier) Connector.open(INSECURE_URL);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tOutputThread t = null;\n\t\t\tStreamConnection sock = null;\n\t\t\tInputStream is = null;\n\t\t\tOutputStream os = null;\n\t\t\ttry {\n\t\t\t\tSystem.out.println(\"accepting connection:\");\n\t\t\t\tsock = cn.acceptAndOpen();\n\t\t\t\tSystem.out.println(\"accept!: \" + Charset.defaultCharset());\n\t\t\t\tis = sock.openInputStream();\n\t\t\t\tos = sock.openOutputStream();\n\n\t\t\t\tt = new OutputThread(os);\n\t\t\t\tt.start();\n\n\t\t\t\twhile (t.isAlive()) {\n\t\t\t\t\t//TODO: use timeout read?\n\t\t\t\t\tint len = is.read(buffer);\n\t\t\t\t\t// printAsHex(buffer, len);\n\t\t\t\t\tif (len > 0) {\n\t\t\t\t\t\tSystem.out.println(\"received message(\" + len + \"): \" + new String(buffer, 0, len));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//TODO: check connection is live or not,\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} finally {\n\t\t\t\tt.interrupt();\n\t\t\t\tt = null;\n\t\t\t\ttry {\n\t\t\t\t\tsock.close();\n\t\t\t\t\tcn.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t//\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void run() {\n byte[] buffer = new byte[1024];\n int bytes;\n while (true) {\n try {\n bytes = mmInStream.read(buffer);\n if (bytes > 0) {\n Log.i(tag, \" ConnectedThread got value: \" + buffer[0]);\n Buffer.write(buffer[0]);\n }\n\n } catch (IOException e) {\n Log.e(tag, \"IOException in ConnectedThread\");\n break;\n }\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\tpublic void run() {\n\t\tsuper.run();\n\n\t\twhile (onWork) {\n\n\t\t\tswitch (state) {\n\t\t\tcase connect:\n\t\t\t\tconnect();\n\t\t\t\tbreak;\n\t\t\tcase running:\n\t\t\t\treceiveMsg();\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t}", "public void ListenThread() \n {\n Thread t = new Thread(new IncomingReader(writer, reader));\n t.start();\n \n }", "public void run() {\n try {\n BufferedReader serverInput = new BufferedReader(\n new InputStreamReader(connectionSock.getInputStream()));\n while (running) {\n // Get data sent from the server\n String serverText = serverInput.readLine();\n if (serverInput != null) {\n //System.out.println(\"CLIENT DEBUG: \" + serverText);\n parseResponse(serverText);\n }\n }\n } catch (Exception e) {\n System.out.println(\"Error: \" + e.toString());\n }\n }", "public void toThread() {\n\t\t// TODO Auto-generated method stub\n\t\tnew Thread(this).start();\n\t\tclient.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 }", "public synchronized void startConnection ()\r\n\t{\r\n \t\tsynchronized (this)\r\n \t\t{\r\n \t\t\tif (_roboCOM!=null) return;\r\n\t\t\t\r\n\t\t\tuitoken++;\r\n\t\t\t_roboCOM = new TCPClient (MsgQueue,cm,uitoken);\r\n\r\n\t\t\t// debug parameters\r\n\t\t\t_roboCOM.msgHello=\"Start Connection ACCE\";\r\n\t\t\t\t\t\t\t\r\n\t \t \tnew Thread (_roboCOM).start();\r\n \t\t}\r\n\t}", "public void start() {\n\t\tconnection.start((sender, message) -> message.accept(new Visitor(sender)));\n\t\tloadData();\n\t}", "@Override\r\n public void run() {\r\n byte[] buffer = new byte[1024];\r\n int bytes;\r\n int times = 0;\r\n\r\n while (!mStopped) {\r\n try {\r\n if (times == 0) {\r\n try {\r\n \t// Sometimes lag occurs. Therefore, from time to time\r\n \t// we just ignore a large chunk of data from input stream\r\n \t// in order to synchronize the communication.\r\n mInputStream.skip(1024000);\r\n } catch (Exception e) {}\r\n times = LAG_CUT_TIMEOUT;\r\n }\r\n times--;\r\n\r\n // Read from socket and send to the handler\r\n bytes = mInputStream.read(buffer);\r\n mReceiveHandler.receiveData(buffer, bytes);\r\n\r\n } catch (IOException ioe) {\r\n Log.e(Common.TAG, \"Error receiving from the socket: \" + ioe.getMessage());\r\n mPeer.communicationErrorOccured();\r\n break;\r\n }\r\n }\r\n }", "private void startThread() {\n\t\tif(receivethread != null && receivethread.isAlive())\n\t\t\treceivethread.interrupt();\n\n\t\t// Close datagram socket If still open\n\t\tif(udpsocket != null && udpsocket.isClosed() == false)\n\t\t\tudpsocket.close();\n\n\t\t// Open datagram socket\n\t\ttry {\n\t\t\tudpsocket = new DatagramSocket();\n\t\t\tudpsocket.setReceiveBufferSize(1024 * 1024);\n\t\t\tudpsocket.setSoTimeout(15000);\n\t\t} catch (SocketException e) {\n\t\t\tudpsocket.close();\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\t}\n\n\t\t// Start Receive Thread\n\t\treceivethread = new ReceiveThread(this.udpsocket, callback);\n\t\treceivethread.start();\n\t}", "@Override\n\tpublic void run() {\n\t\tSocket connect_port = null;\n\t\twhile (true) {\t\t\t\n\t\t\ttry {\n\t\t\t\tconnect_port = this.listen_port.accept();\n\t\t\t\tRequest req = new Request(connect_port);\n\t\t\t\tthis.pool.submit(req);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void run() {\n Log.d(\"bluetooth\", \"entrou na thread bluetoothconnect\");\n while (true) {\n try {if(mmServerSocket != null)\n socket = mmServerSocket.accept();\n\n\n } catch (IOException e) {\n break;\n }\n // If a connection was accepted\n if (socket != null) {\n // Do work to manage the connection (in a separate thread)\n //Server server = new Server(socket);\n Log.d(\"bluetooth\", \"socket não está mais null oba\");\n\n if(socket.isConnected()){\n tts.speak(\"Device connected\");\n\n }\n // Server server = new Server(socket);\n //server.initialize(handler);\n //mmServerSocket.close();\n\n\n break;\n }\n }\n }", "@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tTcpThreadList tcpThreadList = new TcpThreadList();\n\t\t\ttcpThreadList.start();\n\t\t\tserverSocket = new ServerSocket(tcp_port);\n\t\t\twhile(true) {\n\t\t\t\ttry {\n\t\t\t\t\tSocket recvSocket = serverSocket.accept();\n\t\t\t\t\tTcpThreadServer tcpThreadServer = new TcpThreadServer(recvSocket); \n\t\t\t\t\tlogger.debug(\"accept a tcp socket\");\n\t\t\t\t\ttcpThreadServer.start(); \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}\n\t\t} catch (IOException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t} finally {\n\t\t\tif(serverSocket!=null) { \n\t\t\t\ttry {\n\t\t\t\t\tserverSocket.close();\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} //socket关闭\n\t\t\t}\n\t\t\tflag = false; //标记Server结束\n\t\t}\n\t}", "public void run() {\r\n try {\r\n this.is = new ObjectInputStream(clientSocket.getInputStream());\r\n this.os = new ObjectOutputStream(clientSocket.getOutputStream());\r\n while (this.readCommand()) {}\r\n } \r\n catch (IOException e) \r\n {\r\n \tSystem.out.println(\"XX. There was a problem with the Input/Output Communication:\");\r\n e.printStackTrace();\r\n }\r\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 }", "public synchronized void start() {\n if (D) Log.d(TAG, \"start\");\n\n // Cancel any thread attempting to make a connection\n if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;}\n\n // Cancel any thread currently running a connection\n if (mConnectedThread != null) {mConnectedThread.cancel(); mConnectedThread = null;}\n\n setState(STATE_LISTEN);\n }", "@Override\r\n\tpublic void start() {\n\t\tscavenger.start();\r\n\t\tnew Thread() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\twhile (!serverSocket.isClosed()) {\r\n\t\t\t\t\tSocket socket = null;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tsocket = serverSocket.accept();\r\n\t\t\t\t\t\tscavenger.addSocket(socket);\r\n\t\t\t\t\t\tnew SynchronousSocketThread(socket).start();\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.start();\r\n\t}", "@Override\n\t\tpublic void run() {\n\t\t\tsuper.run();\n\t\t\tThread thisThread = currentThread();\n\t\t\ttry {\n\t\t\t\tLog.i(\"con\", \"worked3\");\n\t\t\t\tconnectToServer();\n\t\t\t\tif (connected) {\n\t\t\t\t\tsetUpStreams();\n\t\t\t\t\tsendProfile();\n\t\t\t\t\tLog.i(\"con\", \"worked8\");\n\t\t\t\t\twhile (blinker == thisThread) {\n\t\t\t\t\t\tstartListening();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\tLog.e(\"cl\", \"Found IO Exception!: \" + e);\n\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\tLog.e(\"cl\", \"Found class not found exception!: \" + e);\n\t\t\t}\n\n\t\t}", "@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tInputStream inputStream = mSocket.getInputStream();\n\t\t\tint leng;\n\t\t\tbyte[] buffer = new byte[1024];\n\t\t\tByteArrayBuffer[] data = {new ByteArrayBuffer(1024 * 32)};\n\t\t\twhile((leng = inputStream.read(buffer)) != -1 && mConected)\n\t\t\t{\n\t\t\t\tif(mConected)\n\t\t\t\t{\n\t\t\t\t\tdata[0].append(buffer, data[0].length(), leng);\n\t\t\t\t\tprocessMessage(data);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tLog.e(TAG, \"Cannot set InputStream\\nNetwork error\");\n\t\t\tevent.connectionLost();\n\t\t} catch (ProtocolException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tevent.connectionLost();\n\t\t}\n\t}", "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}", "@Override\n public void run() {\n //System.out.println(\"TCPReceiver is running\");\n logger.debug(\"TCPReceiver is running\");\n //receivePackage(DataHandler.inQueue);\n while (true){\n try {\n socket = serverSocket.accept();\n multiReceivePackage(this.inQueue);\n } catch (Exception e) {\n //System.out.println(\"[\" + Thread.currentThread().getName() + \"] Receiver 线程内出错。\");\n logger.error(\"[\" + Thread.currentThread().getName() + \"] Receiver 线程内出错。\");\n e.printStackTrace();\n }\n }\n\n\n }", "void startConnectionReader()\n {\n if (! synchronousMode)\n {\n connectionReader.start();\n }\n }", "@Override\n public void run() {\n console.append(\"Connected: \" + socket + \"\\n\");\n try {\n BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n\n String[] data = null;\n\n while (socket.isConnected()) {\n String incoming = in.readLine();\n console.append(incoming + \"\\n\");\n try {\n data = incoming.split(\",\");\n }catch(NullPointerException e){\n //eh\n }\n //recieve packets\n receivePackets(data);\n }\n } catch (Exception e) {\n console.append(\"Disconnected:\" + socket + \"\\n\");\n //e.printStackTrace();\n } finally {\n try { socket.close(); } catch (IOException e) {}\n console.append(\"Closed: \" + socket + \"\\n\");\n }\n }", "@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)\n public void run() {\n\n mBluetoothAdapter.cancelDiscovery();\n Log.i(\"Client\", \"trying to connect to server\");\n try {\n mSocket.connect();\n Log.i(\"Client\", \"connected\");\n\n isConnected = mSocket.isConnected();\n\n } catch (IOException connectException) {\n Log.i(\"Client\", \"fail io connect\");\n isConnected = false;\n\n try {\n mSocket.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return;\n }\n //manageConnectedSocket(mSocket);\n if (isConnected()) {\n mTransferThread = new TransferThread(mSocket);\n mTransferThread.start();\n }else{\n makeToast(\"Please try connecting again\",Toast.LENGTH_LONG);\n }\n }", "public void startRunning(){\r\n\t\ttry{\r\n\t\t\twhile( true ){\r\n\t\t\t\tserver = new ServerSocket(PORT);\r\n\t\t\t\ttry{\r\n\t\t\t\t\twaitForClient(1);\r\n\t\t\t\t\twaitForClient(2);\r\n\t\t\t\t\tnew ServerThread(connectionClient1, connectionClient2, this).start();\r\n\t\t\t\t}\r\n\t\t\t\tcatch( EOFException e ){\r\n\t\t\t\t\tshowMessage(\"\\nServer ended the connection\");\r\n\t\t\t\t}\r\n\t\t\t\tfinally {\r\n\t\t\t\t\tserver.close();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch( IOException e ){\r\n\t\t}\r\n\t}", "public void run(){\n\t\t\tObjectReader readerClient = new ObjectReader(in, clientInetAddress);\r\n\t\t\treaderClient.start();\r\n\t\t\t\r\n\t\t\t// Constantly checks msgToSend for messages and sends them\r\n\t\t\twhile(true){\r\n\t\t\t\ttry{\r\n\t\t\t\t\t// Send message\r\n\t\t\t\t\tif(msgToSend.length() != 0){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tout.writeObject(new DataObject(DataObject.STRING, msgToSend.toString()));\r\n\t\t\t\t\t\tout.flush();\r\n\t\t\t\t\t\tmsgToSend.setLength(0);\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\tcatch(IOException ioe){\r\n\t\t\t\t\tioe.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "@Override\n protected void startListener(){\n Socket socket = null;\n while (isRunning()){\n socket = acceptSocket();\n if (socket == null) {\n continue;\n }\n \n try {\n handleConnection(socket);\n } catch (Throwable ex) {\n getLogger().log(Level.FINE, \n \"selectorThread.handleConnectionException\",\n ex);\n try {\n socket.close(); \n } catch (IOException ioe){\n // Do nothing\n }\n continue;\n }\n } \n }", "@Override\n public void run() {\n try {\n //create a socket using sever name or IP and port\n socket = new Socket(serverName, serverPort);\n // set up stream\n start();\n //if everything is good, enable controls on GUI\n send.setEnabled(true); // setup buttons\n tf.setEnabled(true);\n connect.setEnabled(false);\n //catch execeptions if any\n } catch (UnknownHostException uhe) {\n display(\"Host unknown: \" + uhe.getMessage()); // Alert not the right host/ IP\n } catch (IOException ioe) {\n display(\"Unexpected exception: \" + ioe.getMessage());\n }\n //keep listening to incoming messages\n while (true) { // the infinite loop\n try {\n while (!bufferInput.ready()) { // when steam ready to read\n }\n String output = bufferInput.readLine(); // Received the data from socket\n while (output != null) \n {append(output + \"\\n\");\n output = bufferInput.readLine();} } \n catch (IOException ioe) {ioe.getMessage();}\t\n \t\t\t}\t\t }", "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 run() {\n mBluetoothAdapter.cancelDiscovery();\n \n try {\n // Connect the device through the socket. This will block\n // until it succeeds or throws an exception\n mmSocket.connect();\n while(!mmSocket.isConnected()){}\n Painter.paintSocketConnected = true;\n Log.d(tag, \"\" + mmSocket.isConnected());\n mOutputStream = mmSocket.getOutputStream(); \n mInputStream = mmSocket.getInputStream();\n\t\t\t\n } catch (IOException connectException) {\n try {\n\t\t\t\t\tmmSocket.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n return;\n }\n }", "@Override\n public void run() {\n String id = (identifier != \"\") ? identifier : socket.getInetAddress().toString();\n\n LOGGER.info(\"Got connection from \" + id + \".\");\n peerInput = new PeerInput(socket);\n peerInput.start();\n peerOutput = new PeerOutput(socket);\n initialized = true;\n LOGGER.info(\"Initialized connection \" + id);\n peerOutput.run();\n }", "@Override\n public void run() {\n\n startPingTimer();\n String read = \"\";\n\n try {\n while ((read = in.readLine()) != null){\n\n //System.out.println(\"[CLIENT] Received: \" + read);\n messageHandler(read);\n\n }\n closeConnection();\n\n }catch (IOException e){\n\n System.out.println(\"[CLIENT] \" + e.getMessage());\n System.out.println(\"[CLIENT] Connection closed.\");\n\n }\n\n }", "public void run() {\n\t\t\tbtAdapter.cancelDiscovery();\n\n\t\t\ttry {\n\t\t\t\t// Connect the device through the socket. This will block\n\t\t\t\t// until it succeeds or throws an exception\n\t\t\t\tmmSocket.connect();\n\t\t\t} catch (IOException connectException) {\n\t\t\t\t// Unable to connect; close the socket and get out\n\t\t\t\ttry {\n\t\t\t\t\tmmSocket.close();\n\t\t\t\t} catch (IOException closeException) { }\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Do work to manage the connection (in a separate thread)\n\t\t\tmHandler.obtainMessage(SUCCESS_CONNECT, mmSocket).sendToTarget();\n\t\t\tisConnected = true;\n\t\t\tConnectedThread connectedThread = new ConnectedThread((BluetoothSocket) mmSocket);\n\n\t\t}", "public void startListeningForConnection() {\n startInsecureListeningThread();\n }", "public void connect() {\n\n if (reader == null) {\n reader = new ReadFromGo(this);\n readerThread = new Thread(reader);\n readerThread.start();\n } else {\n System.out.println(\"stopGoProcess()\");\n if (readerThread != null) {\n reader.stop();\n readerThread.interrupt();\n reader = new ReadFromGo(this);\n readerThread = new Thread(reader);\n readerThread.start();\n System.out.println(\"Thread interrupted and started\");\n }\n }\n }", "private void createAndStartConnectionThread() {\n new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n boolean success = webSocketConnection.createAndConnectTCPSocket();\n if (success) {\n webSocketConnection.startConnection();\n }\n } catch (Exception e) {\n synchronized (globalLock) {\n if (isRunning) {\n webSocketConnection.closeInternal();\n\n onException(e);\n\n if (e instanceof IOException && automaticReconnection) {\n createAndStartReconnectionThread();\n }\n }\n }\n }\n }\n }).start();\n }", "@Override\n\t\tpublic void run() {\n\t\t\twhile (true) {\n\t\t\t\t\n\t\t\t\t// allocate buffer\n\t\t\t\tbyte[] buffer = new byte[RX_BUFFER_SIZE];\n\t\t\t\t\n\t\t\t\t// initialize new datagram\n\t\t\t\tDatagramPacket datagram = new DatagramPacket(buffer, buffer.length);\n\t\t\t\t\n\t\t\t\t// receive datagram\n\t\t\t\ttry {\n\t\t\t\t\tsocket.receive(datagram);\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\tcontinue;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tdatagramReceived(datagram);\n\t\t\t}\n\t\t}", "@SuppressWarnings(\"resource\")\r\n public void run() {\r\n try {\r\n ServerSocket server = new ServerSocket(ConfigurationFile.getClientPort()[clientNumber-1]);\r\n while(true) {\r\n Socket socket =server.accept();\r\n Thread thread = new Thread(new Connection(socket,hashtable));\r\n thread.start();\r\n }\r\n }\r\n catch(IOException e) {\r\n System.out.println(\"Server socket could not be created. Check configuration file.\");\r\n }\r\n }", "@Override\n\t\tpublic void run()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\twhile (keepListening)\n\t\t\t\t{\n\t\t\t\t\tString rcvStr = is.readLine();\n\t\t\t\t\t\n\t\t\t\t\t//We must make sure that this packet has been sent here correctly.\n\t\t\t\t\tif (rcvStr != null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//TO-DO parse message here and notify controller\n\t\t\t\t\t\t//just transmit it to controller.\n\t\t\t\t\t\tSystem.out.println(\"receive reply : \" + rcvStr);\n\t\t\t\t\t\tmyController.parseResponse(rcvStr);\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t//The receive String is null means that this connection is broken.\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"at ControlChannel listenRunnable : receive null response\");\n\t\t\t\t\t\tkeepListening = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "@Override\r\n\tpublic void run() {\r\n\t\t//Tries to initialise a connection\r\n\t\ttry {\r\n\t\t\t//Runs as long as the channel is open\r\n\t\t\twhile(channel.isOpen()) {\r\n\t\t\t\t//Creates a new byte buffer to create the input\r\n\t\t\t\tByteBuffer buffer = ByteBuffer.allocate(PACKET_SIZE);\r\n\t\t\t\t//Stores the result, -1 by default to assume that the channel couldn't be read\r\n\t\t\t\t//Checks which type of supported channel the channel is (DatagramChannel or SocketChannel - UDP vs TCP)\r\n\t\t\t\t//Uses this to determine where to read the result\r\n\t\t\t\t//Creates a string from the buffer and passes the string into the connector's function\r\n\t\t\t\t//Only passes the data if there's info to read (if the result isn't -1)\r\n\t\t\t\tif(channel.isOpen() && channel.read(buffer) != -1) {\r\n\t\t\t\t\t//Creates the packet from the received data and id\r\n\t\t\t\t\tString packet = new String(buffer.array()).trim();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//If the packet is a ping, returns a pong back\r\n\t\t\t\t\tif(packet.contains(\"!ping%EOP%\")) {\r\n\t\t\t\t\t\tsend(\"!pong\");\r\n\t\t\t\t\t} else if(packet.contains(\"!pong%EOP%\")) { //If the packet is a pong, calculates the ping\r\n\t\t\t\t\t\t//Calculates the ping from the current time and the time since the ping was sent\r\n\t\t\t\t\t\tping = System.currentTimeMillis() - timeSincePing;\r\n\t\t\t\t\t\t//System.out.println(\"Pong!\\nPING: \" + ping + \"ms\");\r\n\t\t\t\t\t} else if(!packet.trim().isEmpty()) { //Checks if the packet's data isn't just a blank string or whitespace\r\n\t\t\t\t\t\t//Sends the packet to the listener\r\n\t\t\t\t\t\t//Finds all the packets received by the listener by looping through as long as the packet contains an end-of-packet footer\r\n\t\t\t\t\t\twhile(packet.contains(\"%EOP%\")) {\r\n\t\t\t\t\t\t\t//Passes in the portion before the end-of-packet footer\r\n\t\t\t\t\t\t\tlistener.onReceive(new Packet(id, packet.substring(0, packet.indexOf(\"%EOP%\"))));\r\n\t\t\t\t\t\t\t//Removes that portion from the packet string\r\n\t\t\t\t\t\t\tpacket = packet.substring(packet.indexOf(\"%EOP%\") + \"%EOP%\".length());\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\r\n\t\t\t//Closes the connection\r\n\t\t\tclose();\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.err.println(\"Error receiving data over TCP!\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void run()\n\t{\n\t\tif(socket != null && !socket.isClosed() && socket.isConnected())\n\t\t{\n\t\t\tSendMessage(ApplicationManager.Instance().GetName(), MessageType.clientData);\n\t\t\tApplicationManager.textChat.writeGreen(\"Connected to \" + connectionInfo.ServerAdress);\n\t\t\t\n\t\t\ttry \n\t\t\t{\n\t\t\t\twhile (IsConnected) \n\t\t {\n\t\t Message message = (Message) in.readObject();\n\t\t\t\t\t\n\t\t if(!IsConnected)\n\t\t \tbreak;\n\t\t \t\n\t\t if(message == null)\n\t\t {\n\t\t \tIsConnected = false;\n\t\t \tbreak;\n\t\t }\n\t\t \n\t\t HandleMessage(message); \n\t\t }\n\t\t\t \n\t\t\t} \n\t\t\tcatch (SocketException | EOFException e) {\n\t\t\t\tif(IsConnected)\n\t\t\t\tApplicationManager.textChat.writeGreen(\"Server go down!\");\n\t\t\t}\n\t\t\tcatch (IOException | ClassNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tApplicationManager.Instance().Disconnect();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tApplicationManager.textChat.writeGreen(\"Cannot connect!\");\n\t\t\tApplicationManager.Instance().Disconnect();\n\n\t\t}\n\t}", "@Override\n public void run() {\n mBluetoothAdapter.cancelDiscovery();\n try {\n // Connect to the remote device through the socket. This call blocks\n // until it succeeds or throws an exception.\n mmSocket.connect();\n } catch (IOException connectException) {\n cancel();\n return;\n }\n\n onSocketObtained(mmSocket);\n }", "@Override\n\tpublic void run() {\n\t\tLog.i(\"here\",\"listener\");\n\t\twhile(true){\n\t\t\t\n\t\t\ttry {\n\t\t\t\tif((cs=s.accept())!=null)new Thread(new Worker(context,cs)).start();\n\t\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}\n }", "@Override\n\tpublic void run() {\n try {\n serverSocket = new ServerSocket(port);\n \n while (true) {\n System.out.println(\"[GenericServer.run] Waiting for connections on Port #\" + port);\n socket = serverSocket.accept();\n System.out.println(\"[GenericServer.run] A connection to a client is established!\");\n processConnection(socket);\n }\n\n } catch (IOException ioe) {\n System.err.println(\"IOException\" + ioe.getMessage());\n ioe.printStackTrace();\n }\n }", "private RRCPConnectionListener() {\n mainThread = new Thread(this);\n }", "@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 }", "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 while (true) { \n \t\ttry {\n \t\t\tString line=br.readLine();\n\t\t\t\t\t\t\th.obtainMessage(RECIEVE_MESSAGE, line).sendToTarget();\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n \n }\n }", "@Override\n\tpublic void run()\n\t{\n\t\tSocket clientSocket;\n\t\tMemoryIO serverIO;\n\t\t// Detect whether the listener is shutdown. If not, it must be running all the time to wait for potential connections from clients. 11/27/2014, Bing Li\n\t\twhile (!super.isShutdown())\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Wait and accept a connecting from a possible client residing on the coordinator. 11/27/2014, Bing Li\n\t\t\t\tclientSocket = super.accept();\n\t\t\t\t// Check whether the connected server IOs exceed the upper limit. 11/27/2014, Bing Li\n\t\t\t\tif (MemoryIORegistry.REGISTRY().getIOCount() >= ServerConfig.MAX_SERVER_IO_COUNT)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// If the upper limit is reached, the listener has to wait until an existing server IO is disposed. 11/27/2014, Bing Li\n\t\t\t\t\t\tsuper.holdOn();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (InterruptedException e)\n\t\t\t\t\t{\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If the upper limit of IOs is not reached, a server IO is initialized. A common Collaborator and the socket are the initial parameters. The shared common collaborator guarantees all of the server IOs from a certain client could notify with each other with the same lock. Then, the upper limit of server IOs is under the control. 11/27/2014, Bing Li\n//\t\t\t\tserverIO = new MemoryIO(clientSocket, super.getCollaborator(), ServerConfig.COORDINATOR_PORT_FOR_MEMORY);\n\t\t\t\tserverIO = new MemoryIO(clientSocket, super.getCollaborator());\n\t\t\t\t// Add the new created server IO into the registry for further management. 11/27/2014, Bing Li\n\t\t\t\tMemoryIORegistry.REGISTRY().addIO(serverIO);\n\t\t\t\t// Execute the new created server IO concurrently to respond the client requests in an asynchronous manner. 11/27/2014, Bing Li\n\t\t\t\tsuper.execute(serverIO);\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void run() {\n if (_running) {\n return;\n }\n _running = true;\n\n byte[] buf = new byte[8192];\n DatagramPacket dp = new DatagramPacket(buf, buf.length);\n\n //to enable stopping of receive\n try {\n _listenSocket.setSoTimeout(1000);\n } catch (SocketException ex) {\n ex.printStackTrace();\n// Logger.getLogger(NetworkNode.class.getName()).log(Level.SEVERE, \"Error in starting network node\", ex);\n }\n\n while (_running) {\n try {\n //System.out.println(_listenSocket.getLocalSocketAddress() + \"->\" + _listenSocket.getRemoteSocketAddress());\n _listenSocket.receive(dp);\n handlePacket(dp);\n } catch (SocketTimeoutException e) {\n // listen timeout. do nothing.\n } catch (Exception ex) {\n ex.printStackTrace();\n// Logger.getLogger(NetworkNode.class.getName()).log(Level.SEVERE, \"Error in receiving packet in network node\", ex);\n }\n }\n System.out.println(\"Listen thread finished!\");\n _runningThread = null;\n }", "void startListening()\n {\n if (outstanding_accept != null || open_connection != null) {\n return;\n }\n \n outstanding_accept = new AcceptThread(bt_adapter, handler);\n outstanding_accept.start();\n }", "@Override\n\tpublic void run() {\n\t\twhile (true) {\n\t\t\t//让改线程可以接受到客户端的信息;\n\t\t\ttry {\n//\t\t\t\tThread.sleep(2000);\n\t\t\tObjectInputStream ois=new ObjectInputStream(s.getInputStream());\n\t\t\tMessage message=(Message) ois.readObject();\n\t\t\tSystem.out.println(message.getSender()+\"给\"+message.getGetter()+\"说\"+message.getCon());\n\t\t\t//这里进行转发;\n\t\t\t/*\n\t\t\t * 转发时出现错误;???????????已解决;\n\t\t\t */\n\t\t\t//取得接收人的通讯线程;\n\t\t\tServerConnectClient scClient=ManageQQClientTh.getClientThread(message.getGetter());\n\t\t\tObjectOutputStream oos=new ObjectOutputStream(scClient.s.getOutputStream());\n\t\t\t\toos.writeObject(message);\n\t\t\n\t\t\t\t} catch (IOException | ClassNotFoundException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}", "@Override\n\tpublic void run() {\n\n\t\tURLConnection connection = null;\n\t\ttry {\n\t\t\tIterator<String> iterator = targetSensor.iterator();\n\t\t\tfor (int i = 0; i < targetSensor.size(); i++) {\n\t\t\t\tString sensorName = iterator.next();\n\n\t\t\t\tURL oracle = new URL(\"http://localhost:8081/fakeDataSource/sensors/\" + sensorName + \"/data\");\n\t\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(oracle.openStream()));\n\t\t\t\tString inputLine;\n\n\t\t\t\tString res = \"\";\n\n\t\t\t\twhile ((inputLine = in.readLine()) != null) {\n//System.out.println(\"Received\" + inputLine);\n\t\t\t\t\tres += inputLine;\n\t\t\t\t}\n\t\t\t\tSystem.out.printf(\"Thread [%s] - Tracking sensor %s and received %s\\n\", this.getName(), sensorName, res);\n\n\t\t\t\tin.close();\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void run() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSystem.out.println(\"accepting new connection\");\n\t\t\t\tSocket clientSocket = this.serverSocket.accept();\n\t\t\t\tSystem.out.println(\"this.base: \" + this.base.toString());\n\t\t\t\tConnection connection = new Connection(clientSocket,this.base, new HTTP());\n\t\t\t\tthis.fixedThreadPool.execute(connection);\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\tthis.serverSocket.close();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\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 }", "@Override\n public void run() {\n //Create server socket\n try (ServerSocket serverSocket = new ServerSocket(serverPort))\n {\n //In loop to continuously accept connections from client\n //main thread doing this\n while (true)\n {\n System.out.println(\"Waiting for client(s) to connect..\");\n //Socket represents connection to client\n Socket clientSocket = serverSocket.accept();\n System.out.println(\"Accepted connection from \" + clientSocket);\n //Message to write to client when connected via outputstream\n OutputStream outputStream = clientSocket.getOutputStream();\n outputStream.write((\"You have connected. Please write: login <username> to login!\\n\" + \"Write <help> for list of additional commands!\\n\").getBytes());\n //Server worker, handles communication with client socket\n ServerWorker worker = new ServerWorker(this, clientSocket);\n //Adding worker to workerlist\n workerList.add(worker);\n //Starting thread worker\n worker.start();\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "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 }", "@Override\n\tpublic void run() {\n\t\tif (FrameworkHandler.DEBUG_MODE){\n\t\t\tString strType = \"\";\n\t\t\tif (type == RULE_CONNECTION) strType = \"New RemoteRule Listener\";\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(strType + \" LISTENING on port: \" + listeningSocket.getLocalPort());\n\t\t}\n\t\ttry {\n\t\t\twhile (running) {\n\t\t\t\tSocket newSocket = listeningSocket.accept();\n\t\t\t\t\n\t\t\t\tif (FrameworkHandler.DEBUG_MODE)\n\t\t\t\t\tSystem.out.println(\"New request obtained on \" + newSocket.getPort() + \"|\" + newSocket.getLocalPort());\n\t\t\t\t\n\t\t\t\tcreateNewConnection(newSocket);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tFrameworkHandler.exceptionLog(FrameworkHandler.LOG_ERROR, this, e);\n\t\t}\n\t}", "public void run() {\n\t\tInputStream istream = null;\n\t\ttry {\n\t\t\tistream = (this.socket).getInputStream();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t DataInputStream dstream = new DataInputStream(istream);\n\t \n\t username = null;\n\t try {\n\t \tusername = dstream.readLine();\n\t \tSystem.out.println(username + \" on server side! (username)\");\n\t \tthis.masterServer.addUserName(username);\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 // pause thread to read in from client.\n\t\tString friendUsername = null;\n\t try {\n\t \tfriendUsername = dstream.readLine();\n\t \tSystem.out.println(friendUsername + \" on server side!!!!! (friendUsername)\");\n\t \tfindFriendsThread(friendUsername);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t try {\n\t\t\tdstream.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t try {\n\t\t\tistream.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t //this.masterServer.addUserName(username);\n\t \n\t}", "@Override\n public void run() {\n try {\n registerWithServer();\n initServerSock(mPort);\n listenForConnection();\n\t} catch (IOException e) {\n Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, e);\n setTextToDisplay(\"run(): \" + e.getMessage());\n setConnectedStatus(false);\n\t}\n }", "public void run() {\n\t\ttry {\n\t\t\tSystem.err.println(\"Lancement du serveur au port \" + this.listen_socket.getLocalPort());\n\t\t\twhile (true) {\n\t\t\t\tif (listen_socket.getLocalPort() == PORT_RESERVATION) {\n\t\t\t\t\tnew Thread(new ServiceReservation(listen_socket.accept())).start();\n\t\t\t\t} else if (listen_socket.getLocalPort() == PORT_EMPRUNT) {\n\t\t\t\t\tnew Thread(new ServiceEmprunt(listen_socket.accept())).start();\n\t\t\t\t} else if (listen_socket.getLocalPort() == PORT_RETOUR) {\n\t\t\t\t\tnew Thread(new ServiceRetour(listen_socket.accept())).start();\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\ttry {\n\t\t\t\tthis.listen_socket.close();\n\t\t\t} catch (IOException e1) {\n\t\t\t}\n\t\t\tSystem.err.println(\"Arręt du serveur au port \" + this.listen_socket.getLocalPort());\n\t\t}\n//\t\ttry {\n//\t\t\tthis.finalize();\n//\t\t} catch (Throwable e) {\n//\t\t\te.printStackTrace();\n//\t\t}\n\t}", "final public void openConnection() throws IOException {\n // Do not do anything if the connection is already open\n if (isConnected())\n return;\n\n // Create the sockets and the data streams\n try {\n clientSocket = new Socket(host, port);\n output = new DataOutputStream(clientSocket.getOutputStream());\n // input =\n // new BufferedReader(new InputStreamReader(clientSocket.getInputStream(), \"Big5_HKSCS\"));\n input = new DataInputStream(clientSocket.getInputStream());\n } catch (IOException ex)\n // All three of the above must be closed when there is a failure\n // to create any of them\n {\n try {\n closeAll();\n } catch (Exception exc) {\n }\n\n throw ex; // Rethrow the exception.\n }\n\n clientReader = new Thread(this); // Create the data reader thread\n readyToStop = false;\n clientReader.start(); // Start the thread\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tsuper.run();\n\t\t\t\ttry {\n\t\t\t\t\tinputStream = new DataInputStream(mSocket.getInputStream());// 2.23此处报空。崩\n\t\t\t\t\t// --使能常连接探测\n\t\t\t\t\tmSocket.setKeepAlive(true);\n\t\t\t\t\t// --设置心跳时间\n\t\t\t\t\tmSocket.setSoTimeout(1500);\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\twhile (!interrupted()) {\n\t\t\t\t\tint ret = 0;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tret = inputStream.read(recvBuf);\n\t\t\t\t\t\tif (ret > 0 && udpSocket != null) {\n\t\t\t\t\t\t\tDEBUG(\"recvlen:\" + ret);\n\n\t\t\t\t\t\t\t// --将接收到的TCP数据发送给UDP\n\n\t\t\t\t\t\t\tDatagramPacket packet = new DatagramPacket(recvBuf, 0, ret, address, iDstPort);\n\t\t\t\t\t\t\tudpSocket.send(packet);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (SocketTimeoutException e) {// 2.18甘\n\t\t\t\t\t\tDEBUG(\"read timeout!\");\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tDEBUG(\"=== IOException ===\");\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t// --断开链路\n\t\t\t\t\t\tstopTask();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "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\r\n\tpublic void run() {\n\t\ttry {\r\n\t\t\twhile (true) {\r\n\t\t\t\tString TransferLine = is.readUTF();\r\n\t\t\t\tSystem.out.println(\"Recv: \" + TransferLine);\r\n\t\t\t\tSimpleAttributeSet recv = new SimpleAttributeSet();\r\n\t\t\t\tStyleConstants.setForeground(recv, Color.RED);\r\n\t\t\t\tGUIObject.addText(\"Recv: \" + TransferLine, recv);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\r\n\t\t}\r\n\t}", "public void startListener() throws IOException {\n\t\tthis.listener = new ServerSocket(this.port);\n\n Runnable serverThread = new Runnable() {\n @Override\n public void run() {\n try {\n System.out.println(\"Waiting for clients to connect...\");\n\n while (true) {\n \t// Wait for connections\n Socket newSocket = listener.accept();\n\n // Init new peer and add it to our list\n PeerCommunicator newCommunication = new PeerCommunicator(id, \"\", newSocket);\n activePeers.add(newCommunication);\n\n // Span new thread\n Thread clientThread = new Thread(new ReceivedConnection(newCommunication, fm));\n clientThread.start();\n }\n } catch (Exception e) {\n System.err.println(\"Unable to process incoming client\");\n e.printStackTrace();\n }\n }\n };\n\n // Start it up\n (new Thread(serverThread)).start();\n\n // Once everything's good, mark server as running\n //this.status = Status.RUNNING;\n\t}", "@Override\r\n\tpublic void run() {\r\n\t\tPacket packet = new Packet();\r\n\t\t\r\n\t\twhile (runConnection) {\r\n\t\t\ttry {\r\n\t\t\t\tpacket = (Packet) inStream.readObject();\r\n\t\t\t\tprocessEvent(packet);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t//System.out.print(e);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\t\r\n\t}", "@Override\n\tpublic void run() {\n\t\tlog(\"Running on port \" + serverSocket.getLocalPort());\n\t\twhile(true) {\n\t\t\ttry {\n\t\t\t\t// accept incomming connections\n\t\t\t\tSocket clientSocket = serverSocket.accept();\n\t\t\t\t//log(\"New connection from \" + client_socket.getRemoteSocketAddress());\n\t\t\t\t// create a new connection handler and run in a separate thread\n\t\t\t\tTrackerRequestHandler handler = new TrackerRequestHandler(this, clientSocket);\n\t\t\t\texecutor.execute(handler);\n\t\t\t} catch (IOException e) {\n\t\t\t\tlog(\"Problem accepting a connection\");\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void run() {\n try {\n while(!this.socket.isClosed()) {\n System.out.println(\"Unicast Server Ok\");\n Socket distant = this.socket.accept();\n System.out.println(\"Connexion établie\");\n Discussion discussion =new Discussion(distant);\n discussion.addObserver(this);\n chatRooms.put(distant.getInetAddress(), discussion);\n new Thread(discussion).start();\n }\n } catch (IOException e) {\n System.out.println(\"Erreur socket unicast\");\n }\n }" ]
[ "0.7296005", "0.72307897", "0.71298987", "0.70653087", "0.695616", "0.69068813", "0.69004625", "0.68982774", "0.68918693", "0.6867195", "0.68508196", "0.6845326", "0.68371564", "0.6823336", "0.6806058", "0.68054354", "0.6802425", "0.6771163", "0.67671317", "0.6750269", "0.6741353", "0.6734364", "0.67228496", "0.67083013", "0.6701066", "0.6688278", "0.66816217", "0.666762", "0.666515", "0.666005", "0.66586196", "0.66546947", "0.665427", "0.66538846", "0.66517997", "0.66490364", "0.66482013", "0.66464597", "0.6643505", "0.6609196", "0.66075575", "0.6594137", "0.65933645", "0.65831554", "0.65822643", "0.65764856", "0.6574177", "0.65598893", "0.6558361", "0.6547324", "0.6544519", "0.6543501", "0.65376014", "0.6535775", "0.65324724", "0.65296257", "0.65177876", "0.6516061", "0.65140927", "0.6511618", "0.6508714", "0.65055823", "0.6503042", "0.6501797", "0.6500768", "0.64901376", "0.64900404", "0.6489803", "0.64796054", "0.6474535", "0.647261", "0.6454416", "0.6451515", "0.6432973", "0.64297175", "0.64127564", "0.64083445", "0.6407352", "0.63919884", "0.63899446", "0.6385547", "0.63841385", "0.6369899", "0.63685095", "0.63620067", "0.63569343", "0.6356138", "0.6353976", "0.63498235", "0.63464063", "0.6338488", "0.63349324", "0.63285303", "0.63267004", "0.632636", "0.6319447", "0.6306001", "0.6296511", "0.62932736", "0.6292834" ]
0.69813836
4
There is nothing much to do as the thread calling receive() is designed to stop by itself isStopped() returns false
public void onStop() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isStopped();", "private void receive() {\n receive = new Thread(\"Receive\") {\n public void run() {\n while (running) {\n byte[] data = new byte[1024];\n DatagramPacket packet = new DatagramPacket(data, data.length);\n try {\n socket.receive(packet);\n } catch (IOException e) {\n e.printStackTrace();\n }\n processPacket(packet);\n }\n }\n };\n receive.start();\n }", "boolean isStopped();", "private static synchronized void requestStop() {\n stopRequested = true;\n }", "@Override\r\n public void run() {\r\n byte[] buffer = new byte[1024];\r\n int bytes;\r\n int times = 0;\r\n\r\n while (!mStopped) {\r\n try {\r\n if (times == 0) {\r\n try {\r\n \t// Sometimes lag occurs. Therefore, from time to time\r\n \t// we just ignore a large chunk of data from input stream\r\n \t// in order to synchronize the communication.\r\n mInputStream.skip(1024000);\r\n } catch (Exception e) {}\r\n times = LAG_CUT_TIMEOUT;\r\n }\r\n times--;\r\n\r\n // Read from socket and send to the handler\r\n bytes = mInputStream.read(buffer);\r\n mReceiveHandler.receiveData(buffer, bytes);\r\n\r\n } catch (IOException ioe) {\r\n Log.e(Common.TAG, \"Error receiving from the socket: \" + ioe.getMessage());\r\n mPeer.communicationErrorOccured();\r\n break;\r\n }\r\n }\r\n }", "private synchronized boolean isStopped() {\n return this.isStopped;\n }", "public synchronized void requestStop() \n\t{\n\t\tstoprequested = true;\n\t}", "public boolean isThreadStopped() {\r\n return threadStopped;\r\n }", "@Override\n\tpublic boolean canReceive() {\n\t\treturn false;\n\t}", "@Override\n public void run() {\n if (_running) {\n return;\n }\n _running = true;\n\n byte[] buf = new byte[8192];\n DatagramPacket dp = new DatagramPacket(buf, buf.length);\n\n //to enable stopping of receive\n try {\n _listenSocket.setSoTimeout(1000);\n } catch (SocketException ex) {\n ex.printStackTrace();\n// Logger.getLogger(NetworkNode.class.getName()).log(Level.SEVERE, \"Error in starting network node\", ex);\n }\n\n while (_running) {\n try {\n //System.out.println(_listenSocket.getLocalSocketAddress() + \"->\" + _listenSocket.getRemoteSocketAddress());\n _listenSocket.receive(dp);\n handlePacket(dp);\n } catch (SocketTimeoutException e) {\n // listen timeout. do nothing.\n } catch (Exception ex) {\n ex.printStackTrace();\n// Logger.getLogger(NetworkNode.class.getName()).log(Level.SEVERE, \"Error in receiving packet in network node\", ex);\n }\n }\n System.out.println(\"Listen thread finished!\");\n _runningThread = null;\n }", "public boolean isStopped() {\n return m_runner == null;\n }", "@Override\n public void run()\n {\n while (true) {\n if (isReadyToStop && (buffer.poll() == null)) {\n System.out.println(\"Thread stop\");\n producerClient.close();\n return;\n }\n try {\n Message msg = buffer.poll(config.getBufferPollTimeout());\n if (msg == null) {\n // ignore it\n continue;\n }\n System.out.println(\"Sent out: [\" + msg + \"]\");\n if (msg.getTopic().isPresent()) {\n String topic = msg.getTopic().get();\n Optional<Function<String, Integer>> function = funcMapBuffer.get(topic);\n function.ifPresent(stringLongFunction -> {\n int fiberId = stringLongFunction.apply(msg.getKey());\n msg.setFiberId(fiberId);\n producerClient.send(topic, fiberId, msg);\n });\n // else ignore this message\n }\n // else ignore this message\n }\n catch (InterruptedException ignored) {\n // if poll nothing, enter next loop\n }\n }\n }", "public long getStopped() { return stopped; }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tbyte[] receive = new byte[1];\n\n\t\t\t\t\tDatagramSocket stopSocket = new DatagramSocket(35000);\n\t\t\t\t\tDatagramPacket stopPacket = new DatagramPacket(receive,\n\t\t\t\t\t\t\treceive.length);\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tstopSocket.receive(stopPacket);\n\t\t\t\t\t\ttalkingName.setText(\"\");\n\t\t\t\t\t\tif (iname != -1) {\n\t\t\t\t\t\t\tb[iname].setBackground(Color.BLUE);\n\t\t\t\t\t\t\tstatus = false;\n\t\t\t\t\t\t\tstatusPanel.repaint();\n\t\t\t\t\t\t\tre();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} catch (SocketException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\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}", "protected void receive() {\n // System.out.println(\"in MessageSocketUDP::Receive\");\n try {\n DatagramPacket p = new DatagramPacket(receiveBuffer.buffer, receiveBuffer.offset(), receiveBuffer.available());\n datagramSocket.receive(p);\n int nbRead = p.getLength();\n if (nbRead == 0) {\n System.out.println(\"MessageSocketUDP::receive (read=0)\");\n connected = false;\n } else {\n receiveBuffer.received(nbRead);\n receiveBuffer.process();\n }\n } catch (IOException e) {\n System.out.println(\"MessageSocketUDP::receive Error\");\n e.printStackTrace();\n connected = false;\n }\n }", "@Override\n public void run() {\n P.print(\"Receive thread starts up.\");\n try {\n ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());\n while (P.choke_thread_running) { //read input forever.\n try{\n Object o = ois.readObject(); //blocking.\n if (o instanceof Handshake) { // this is a Handshake.\n Handshake hs = (Handshake)o;\n P.print(\"Received handshake from \"+hs.pid);\n }\n else if(o instanceof Message){ //this is a Message.\n Message M = (Message) o;\n if(M.type==0){\n P.print(\"Received choke from \"+t.getName());\n }\n else if(M.type==1){\n P.print(\"Received unchoke from \"+t.getName());\n }\n else if(M.type==2){\n P.print(\"Received interested from \"+t.getName());\n }\n else if(M.type ==3){\n P.print(\"Received not_interested from \"+t.getName()); \n }\n else if(M.type==4){\n P.print(\"Received have from \"+t.getName());\n }\n else if(M.type==5){\n P.print(\"Received bitfield from \"+t.getName());\n }\n else if(M.type==6){\n P.print(\"Received request from \"+t.getName());\n }\n else if(M.type==7){\n P.print(\"Received piece from \"+t.getName());\n }\n else{\n P.print(\"Error: undefined message type: \"+M.type);\n }\n }\n else {\n System.out.println(\"Class not found.\");\n }\n }\n catch(ClassNotFoundException ex){\n ex.printStackTrace();\n }\n }\n ois.close();\n socket.close();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "private void receive() {\r\n\t\ttry {\r\n\t\t\trcvpkt = filter.read();\t\t\t\t\t\t\t// Simulates Transfer-Failures and Errors in the received data\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public synchronized void stop(){\n\t\tthis.running = false;\n\t\ttry {\n\t\t\tthis.thread.join();\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void stopReceiver() {\r\n\t\tif(receiver != null) {\r\n\t\t\treceiver.stop();\r\n\t\t\treceiver = null;\r\n\t\t}\r\n\t}", "public boolean isStopped() {\n return stopped;\n }", "public boolean isStopped() {\n return stopped;\n }", "public synchronized void waitForReceived() throws InterruptedException {\n\t\twhile (!_received) {\n\t\t\t// We allow the user to interrupt their own thread.\n\t\t\tthis.wait();\n\t\t}\n\t}", "public void run() {\n int eventseen = 0;\n int looptry = 0;\n int wait = 100;\n while(! isInterrupted()) {\n Iterable<byte[]> stream = new Iterable<byte[]>() {\n @Override\n public Iterator<byte[]> iterator() {\n Iterator<byte[]> i = Receiver.this.getIterator();\n if(i == null) {\n return new Iterator<byte[]>() {\n\n @Override\n public boolean hasNext() {\n return false;\n }\n\n @Override\n public byte[] next() {\n return null;\n }\n\n };\n } else {\n return i;\n }\n }\n };\n try {\n for(byte[] e: stream) {\n logger.trace(\"new message received: {}\", e);\n if(e != null) {\n eventseen++;\n //Wrap, but not a problem, just count as 1\n if(eventseen < 0) {\n eventseen = 1;\n }\n Event event = new Event();\n decode(event, e);\n send(event);\n }\n }\n } catch (Exception e) {\n eventseen = 0;\n logger.error(e.getMessage());\n logger.catching(e);\n }\n // The previous loop didn't catch anything\n // So try some recovery\n if(eventseen == 0) {\n looptry++;\n logger.debug(\"event seen = 0, try = {}\", looptry);\n // A little magic, give the CPU to other threads\n Thread.yield();\n if(looptry > 3) {\n try {\n Thread.sleep(wait);\n wait = wait * 2;\n looptry = 0;\n } catch (InterruptedException ex) {\n break;\n }\n }\n } else {\n looptry = 0;\n wait = 0;\n }\n }\n }", "@Override\n\tpublic void receive(boolean value) {\n\t\t\n\t}", "protected boolean processStoppedObserving(int gameNumber){return false;}", "@Override\n\tpublic void receive() {\n\t}", "private boolean isStopped() {\n\t\treturn (state == State.STOPPING || state == State.STOPPED || state == State.SUSPENDED);\n\t}", "public boolean shouldStop() {\n return !this.running;\n }", "public void onStart() {\n\t new Thread() {\n\t @Override public void run() {\n\t receive();\n\t }\n\t }.start();\n\t }", "@Override\n public boolean shouldStop() {\n return this.stop;\n }", "private void stop(){\n isRunning = false;\n try{\n thread.join();\n }\n catch(InterruptedException e){\n e.printStackTrace();\n }\n }", "@Override\n\t\tpublic void run() {\n\t\t\tbyte[] data = new byte[1024];\n\t\t\tByteBuffer buffer = ByteBuffer.allocate(2048);\n\n\t\t\ttry {\n\t\t\t\twhile(!isInterrupted()) {\n\t\t\t\t\tDatagramPacket packet = new DatagramPacket(data, data.length);\n\t\t\t\t\tUDPSocket.receive(packet);\n\n\t\t\t\t\tcheckPacket(buffer, data, packet.getLength());\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t\tif(!UDPSocket.isClosed()) {\n\t\t\t\t\tUDPSocket.close();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tLog.v(TAG, \"udp read Thread exit\");\n\t\t}", "public void stop() {\n this.stopRequested.set(true);\n synchronized(this) {\n notifyAll(); // Wakes run() if it is sleeping\n }\n }", "public void run() {\n\t\tThread t = Thread.currentThread();\n\t\twhile (!t.isInterrupted()) {\n\t\t\ttry {\n\t\t\t\t//boolean status = process();\n\t\t\t\tMessage message = receive();\n\t\t\t\tif (t.isInterrupted())\n\t\t\t\t\treturn;\n\t\t\t\t//if (!status)\n\t\t\t\t//\treturn;\n\t\t\t\tif (socket == null)\n\t\t\t\t\treturn;\n\t\t\t\tThread.yield();\n\t\t\t} catch (Exception e) {\n\t\t\t\t//_monitor.log(e);\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "void onStopped();", "protected synchronized boolean shouldStop() {\n\t\treturn shouldStop_;\n\t}", "@Override\n\tpublic void run() {\n\t\tSystem.out.println(\"Waiting for input\");\n\t\t// Handle reading data until we exit\n\t\tByteBuffer buf = ByteBuffer.allocate(2048);\n\t\twhile (!stopper && socketChannel.isOpen()) {\n\t\t\tSystem.out.println(\"Reading the socket\");\n\t\t\ttry {\n\t\t\t\t// No input from the user in 60 seconds results in kicking them\n\t\t\t\t// out\n\t\t\t\tint bytesRead = socketChannel.read(buf).get(60, TimeUnit.SECONDS);\n\t\t\t\t// ByteBuffer dst = ByteBuffer.allocate(bytesRead);\n\t\t\t\t// engine.unwrap(buf, dst);\n\t\t\t\tSystem.out.println(\"Got data of size: \" + bytesRead);\n\t\t\t\t// convert to proto\n\t\t\t\tcommonUIElements.MessageProtos.Message msg = commonUIElements.MessageProtos.Message\n\t\t\t\t\t\t.parseFrom(Arrays.copyOf(buf.array(), bytesRead));\n\t\t\t\tSystem.out.println(\"RXed: \" + msg.toString());\n\t\t\t\tif (!msg.getName().equals(name)) {\n\t\t\t\t\tname = msg.getName();\n\t\t\t\t}\n\t\t\t\t// add data to the message queue\n\t\t\t\tif (SignatureSystem.verifySignature(msg.getSignature(), msg.getMessage(), msg.getName(), trustStore)) {\n\t\t\t\t\tmessages.put(\n\t\t\t\t\t\t\tnew Message(msg.getSender(), msg.getMessage(), msg.getSignature(), msg.getClearance()));\n\t\t\t\t} else {\n\t\t\t\t\tMessage error = new Message(msg.getSender(), \"Error: signture is invalid\", msg.getSignature(),\n\t\t\t\t\t\t\tmsg.getClearance());\n\t\t\t\t\terror.error = true;\n\t\t\t\t\tmessages.put(error);\n\t\t\t\t}\n\t\t\t\t// clear the buffer for the next message\n\t\t\t\tbuf.clear();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tSystem.err.println(\"Failed to add message to the queue: \" + e.getMessage());\n\t\t\t\tMessage error = new Message(this.name, \"Disconnected\", \"\", 1);\n\t\t\t\terror.error = true;\n\t\t\t\ttry {\n\t\t\t\t\tmessages.put(error);\n\t\t\t\t} catch (InterruptedException e1) {\n\t\t\t\t\tSystem.err.println(\"Thread has an error, can't inform server of this transgression\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t} catch (TimeoutException e) {\n\t\t\t\tSystem.err.println(\"Timeout hit, waiting again\");\n\t\t\t\tMessage error = new Message(this.name, \"Client: \" + this.name + \" has timed out\", \"\", 1);\n\t\t\t\terror.kill = true;\n\t\t\t\ttry {\n\t\t\t\t\tmessages.put(error);\n\t\t\t\t} catch (InterruptedException e1) {\n\t\t\t\t\tSystem.err.println(\"Thread has an error, can't inform server of this transgression\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t} catch (ExecutionException e) {\n\t\t\t\tSystem.err.println(\"Execution error, breaking out of loop\");\n\t\t\t\tbreak;\n\t\t\t} catch (InvalidProtocolBufferException e) {\n\t\t\t\tSystem.err.println(\"Invalid protobuf received: \" + e.getMessage());\n\t\t\t\t// } catch(SSLException e) {\n\t\t\t\t// System.err.println(\"SSL Failed: \" + e.getMessage());\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\tsocketChannel.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Failed to close socket while exiting\");\n\t\t}\n\t\tSystem.out.println(\"Exiting thread...\");\n\t}", "public boolean isStopped()\r\n\t{\r\n\t\treturn currentstate == TIMER_STOP;\r\n\t}", "@Override\n public void run() {\n //System.out.println(\"TCPReceiver is running\");\n logger.debug(\"TCPReceiver is running\");\n //receivePackage(DataHandler.inQueue);\n while (true){\n try {\n socket = serverSocket.accept();\n multiReceivePackage(this.inQueue);\n } catch (Exception e) {\n //System.out.println(\"[\" + Thread.currentThread().getName() + \"] Receiver 线程内出错。\");\n logger.error(\"[\" + Thread.currentThread().getName() + \"] Receiver 线程内出错。\");\n e.printStackTrace();\n }\n }\n\n\n }", "boolean shouldStop();", "public boolean isStopped()\r\n\t{\r\n\t\treturn speed()==0;\r\n\t}", "private void waitOnReceive() throws IOException {\n while (inStream.available() == 0) {\n try {\n Thread.sleep(1);\n } catch (InterruptedException _) {\n }\n }\n }", "public void setThreadStopped(boolean flag) {\r\n threadStopped = flag;\r\n }", "protected void onStopped() {\n // Do nothing.\n }", "@Override public void run() {\n waitUntil(\"message\", new Condition() {\n @Override public boolean isMet() {\n return false;\n }\n }, 0);\n }", "public synchronized void stop() {\n isRunning = false;\n try {\n thread.join();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "public boolean isStopSupported();", "@Override\n public void run() {\n stop();\n }", "@EncoderThread\n protected abstract void onStop();", "@Override\n public void stop() {}", "boolean isReceiving();", "public int receiveTimeout(){\n return 0; //TODO codavaj!!\n }", "@Override\n public void onReceive(Object msg) throws Exception {\n }", "private void stopClient() {\n\n run = false;\n\n if (bufferOut != null) {\n bufferOut.flush();\n bufferOut.close();\n }\n\n messageListener = null;\n bufferIn = null;\n bufferOut = null;\n serverMessage = null;\n }", "private void stop() {\r\n\t\t\tstopped = true;\r\n\t\t}", "@Override\n public void run() {\n if (!this.m_running) {\n this.m_running = true;\n this.pollingLooper();\n }\n }", "@Override\n @SuppressWarnings(\"SuspiciousSystemArraycopy\")\n public void run() {\n //while (!isInterrupted()) {\n try {\n\n //String message=\"\";\n byte[] data = new byte[1024];\n int datalen = -1;\n messageStream = new byte[]{};\n while (isRunning) {\n if ((datalen = mIn.read(data)) != -1) {\n try {\n\n byte[] truedata = new byte[datalen];\n System.arraycopy(data, 0, truedata, 0, datalen);\n if ((datalen == 4) && new String(truedata).equals(\"0000\")) {\n CommonLib.PrintScreen(systemGlobal, \"SOCK - \" + identifyState + \" received IDLE: 0000\",showLogEnum.DETAILMODE);\n } else {\n messageStream = CommonLib.concatByteArray(messageStream, truedata);\n CommonLib.PrintScreen(systemGlobal, String.format(\"SOCKET.%s REV: %s \\n\\rBUFF 1(%d): %s\", identifyState, CommonLib.getHumanFormatFromByte(truedata), messageStream.length, CommonLib.getHumanFormatFromByte(messageStream)),showLogEnum.SIMPLEMODE);\n byte[] msg = new byte[]{};\n\n HeaderProcessing headerMsg = msgheaderInfo.clone();\n if (headerMsg.initHeaderFromBytes(messageStream)) {\n\n msg = headerMsg.getMessageFromBuffer(messageStream);\n while (msg.length > 0) {\n boolean needParsing = false;\n if (headerMsg.getHeaderPart(9) != null) {\n if (headerMsg.getHeaderPart(9).getValue().toString().equals(\"00000\")) {\n needParsing = true;\n }\n } else {\n needParsing = true;\n }\n if (needParsing) {\n IsoMessage isoMsg = new IsoMessage(msg, getInstituttionCode(), headerMsg, isoCfg, instData.getLineMode());\n if (isoMsg.isMessage()) {\n isoMsg.setSeqID(CommonLib.getNextSequence());\n isoMsg.setMsgType(CommonLib.getMsgType(isoMsg.getField(0)));\n incommingqueue.add(isoMsg);\n CommonLib.PrintScreen(systemGlobal, identifyState + \" parsed: \" + isoMsg.printedMessage(), showLogEnum.DEFAULT);\n\n //Added by DUNGBTK 08.11.2010\n messageStream = CommonLib.copyByteArrayFromArray(messageStream, msg.length, messageStream.length - msg.length);\n CommonLib.PrintScreen(systemGlobal, String.format(\"SOCKET.%s BUFF 2(%d): %s\", identifyState, messageStream.length, CommonLib.getHumanFormatFromByte(messageStream)), showLogEnum.SIMPLEMODE);\n //msg = CommonLib.getMsgFromBuffer(messageStream, msgheaderInfo);\n headerMsg = msgheaderInfo.clone();\n headerMsg.initHeaderFromBytes(messageStream);\n msg = headerMsg.getMessageFromBuffer(messageStream);\n } else {\n CommonLib.PrintScreen(systemGlobal, \"ERR SOCK - \" + identifyState + \" parsing (close connection): \" + CommonLib.asHex(msg), showLogEnum.SIMPLEMODE);\n isRunning = false;\n mServerDispatcher.deleteClient(mClientInfo);\n break;\n }\n } else {\n CommonLib.PrintScreen(systemGlobal, \"DROP BY HEADER - \" + identifyState + CommonLib.asHex(msg), showLogEnum.DETAILMODE);\n messageStream = CommonLib.copyByteArrayFromArray(messageStream, msg.length, messageStream.length - msg.length);\n CommonLib.PrintScreen(systemGlobal, String.format(\"SOCKET.%s BUFF 2(%d): %s\", identifyState, messageStream.length, CommonLib.getHumanFormatFromByte(messageStream)), showLogEnum.DETAILMODE);\n\n headerMsg = msgheaderInfo.clone();\n headerMsg.initHeaderFromBytes(messageStream);\n msg = headerMsg.getMessageFromBuffer(messageStream);\n }\n\n }\n if (messageStream.length > 0) {\n CommonLib.PrintScreen(systemGlobal, String.format(\"SOCKET.%s BUFF 3(%d): %s\", identifyState, messageStream.length, CommonLib.getHumanFormatFromByte(messageStream)),showLogEnum.DETAILMODE);\n }\n }\n }\n\n } catch (Exception e) {\n messageStream = new byte[]{};\n CommonLib.PrintScreen(systemGlobal, \"ERR SOCK \" + identifyState + \" data error (close connection): \" + e.getMessage(),showLogEnum.DETAILMODE);\n\n isRunning = false;\n mServerDispatcher.deleteClient(mClientInfo);\n break;\n }\n } else {\n CommonLib.PrintScreen(systemGlobal, \"ERR SOCK \" + identifyState + \" is interrupted..\",showLogEnum.DETAILMODE);\n isRunning = false;\n mServerDispatcher.deleteClient(mClientInfo);\n break;\n }\n }\n //--Thread.sleep(GlobalObject.SystemParas.getIntValue(\"VNBC_SOCK_RUNNING_INTEVAL\"));\n\n } catch (Exception ex) {\n isRunning = false;\n CommonLib.PrintScreen(systemGlobal, \"ERR SOCK \" + identifyState + \": Connection error\",showLogEnum.DETAILMODE);\n }\n //Communication is broken. Interrupt both listener and sender threads\n\n }", "public void run() {\n\t\t\t\tbyte[] sendStopMsg = new byte[1];\n\t\t\t\ttry {\n\t\t\t\t\tDatagramSocket serverStopSocket = new DatagramSocket();\n\t\t\t\t\tDatagramPacket serverStopPacket = new DatagramPacket(\n\t\t\t\t\t\t\tsendStopMsg, sendStopMsg.length, clientIP[iname],\n\t\t\t\t\t\t\t38000);\n\t\t\t\t\tserverStopSocket.send(serverStopPacket);\n\t\t\t\t} catch (SocketException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\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\n\t\t\t}", "private void receive() {\n\t\t\ttry{\n\t\t\t\twhile(true){\n\t\t\t\t\tsuper.store(generateSimulateData());\n\t\t\t\t\tSystem.out.println(\"模拟接收数据\");\n\t\t\t\t\tThread.sleep(10000);\n\t\t\t\t}\n\t\t\t}catch(Exception ex){\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t }", "@Override\r\n\t\tpublic void dmr_stop() throws RemoteException {\n\t\t\tUtils.printLog(TAG, \"dmr_stop\");\r\n\t\t\tisDMRstop = true;\r\n\t\t\tLog.d(TAG,\"now isDMR is \"+ isDMR);\r\n\t\t\tif(isDMR){ //add here 20161125 for dmr push first,message play next,then dmr stop,tv stop\r\n\t\t\t exitVideoPlay();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "public boolean isStopped() {\r\n\t\treturn this.stopped;\r\n\t}", "public synchronized void stop() {\n try {\n thread.join();\n running = false;\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "public void stop() {\n closed.set(true);\n consumer.wakeup();\n }", "@Override\n\t\t\t\tpublic void run() {\n\n\t\t\t\t\ttry{\n\t\t\t\t\t\tLog.d(\"Lavish\",\"Receive Thread running\");\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\trecSocket= new ServerSocket(5570);\n\t\t\t\t\t\t\n\t\t\t\t\twhile(runningFlag==1){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tclient_speak=recSocket.accept();\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t // connect to the server\n\t\t\t\t\t//final DataOutputStream rdos=new DataOutputStream(recSocket.getOutputStream());\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t rdis=new DataInputStream(client_speak.getInputStream());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tqueue=rdis.readUTF();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tLog.e(\"I Got\",\"Data:\"+queue);\n\t\t\t\t\t//Toast.makeText(gh.getApplicationContext(), \"Read kar liya\", Toast.LENGTH_LONG).show();\n\n\t\t\t\t\trunOnUiThread(new Runnable() {\n\t\t\t\t\t\t@SuppressWarnings(\"deprecation\")\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif((queue.equals(\"start_speaking\")))\n\t\t\t\t\t\t\t{\t\t\n\t\t\t\t\t\t\t\t\tispeak=1;\t\n\t\t\t\t\t\t\t\t\t\tLog.e(\"Inside got \",\"Data:\"+queue);\n\t\t\t\t\t\t\t\t\t\tqueuePos.setVisibility(View.GONE);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tstartsp.setVisibility(View.VISIBLE);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t/////// Notification starts//////////\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif(isbackground==1)//&&AudioMainActivity.mainback==0){\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tNotificationManager NM=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\tNotification notify=new Notification(R.drawable.mic_logo_small,\"Classroom Interaction\",System.currentTimeMillis());\n\t\t\t\t\t\t\t\t\t\t\tnotify.flags |= Notification.FLAG_AUTO_CANCEL;\n\t\t\t\t\t\t\t\t\t\t\tIntent nmintent=new Intent(getApplicationContext(),DummyActivity.class);\n\t\t\t\t\t\t\t\t\t\t\t//nmintent.setAction(Intent.ACTION_MAIN);\n\t\t\t\t\t\t\t\t\t\t\t//nmintent.addCategory(Intent.CATEGORY_LAUNCHER);\n\t\t\t\t\t\t\t\t\t\t\tnmintent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);\n\t\t\t\t\t\t\t\t\t\t PendingIntent pending=PendingIntent.getActivity(getApplicationContext(),0, nmintent,0);\n\t\t\t\t\t\t\t\t\t\t notify.setLatestEventInfo(getApplicationContext(),\"Permission Granted\",\"Click to start speaking...\",pending);\n\t\t\t\t\t\t\t\t\t\t NM.notify(0, notify);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t//////////Notification ends///////\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\telse if(queue.equals(\"kick_you\"))\n\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\tispeak=0;\n\t\t\t\t\t\t\t\tLog.e(\"inside if\", \"inside if block\");\n\t\t\t\t\t\t\t\trunningFlag=0;\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\trecSocket.close();\n\t\t\t\t\t\t\t\t\tLog.e(\"closing\", \"socket closed\");\n\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tLog.e(\"Inside got \",\"Data:\"+queue);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(as!=null)\n\t\t\t \t\t\t\t\t\t{as.onWithdrawPress();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tfinal Dialog dialog = new Dialog(context);\n\t\t\t\t\t\t\t\t\tdialog.setContentView(R.layout.kickdialog);\n\t\t\t\t\t\t\t\t\tdialog.setTitle(\"OOOPS...\");\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t// set the custom dialog components - text, image and button\n\t\t\t\t\t\t\t\t\tTextView text = (TextView) dialog.findViewById(R.id.kicktext);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tButton dialogButton = (Button) dialog.findViewById(R.id.kickok);\n\t\t\t\t\t\t\t\t\t// if button is clicked, close the custom dialog\n\t\t\t\t\t\t\t\t\tdialogButton.setOnClickListener(new OnClickListener() {\n\t\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t\t\t\t\t\t\tfinish();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\tdialog.show();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tLog.e(\"inside else\", \"inside else block\");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t\t\t\tLog.e(\"Inside got \",\"Data:\"+queue);\n\t\t\t\t\t\t\t\t\tqueuePos.setText(\"Your position is \"+queue);\n\t\t\t\t\t\t\t\t\tstartsp.setVisibility(View.GONE);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tcatch(Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(e.toString());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfinally\n\t\t\t\t\t{\n\t\t\t\t\t\tLog.e(\"INSIDE FINALLY\",\"HURRAYYYY\");\n\t\t\t\t\t\t//finish();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}", "public static void stop() {\n enableIncomingMessages(false);\n }", "public boolean hasStopped() {\n return hasStopped(10, 500, TimeUnit.MILLISECONDS);\n }", "public void run(){\n long startTime = System.nanoTime();\n long elapsedTime = System.nanoTime() - startTime;\n while(elapsedTime<500000000 && p.acknowledged == false){\n //echo(\"Waiting\");\n elapsedTime = System.nanoTime() - startTime;\n if(p.acknowledged == true){\n return;\n }\n }\n if(elapsedTime>= 500000000)\n {\n p.timed = true;\n //System.out.println(\"thread timed out at packet \"+ p.getSeq());\n for(int i=p.getSeq(); i<p.getSeq()+window; i++){\n if(i<packets.size()){\n packets.get(i).sent = false;\n }\n }\n //p.sent = false;\n }\n\n\n }", "public void run() {\n\t\t\twhile (running || !messages_to_send.isEmpty()) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsend();\r\n\t\t\t\t\tread();\r\n\t\t\t\t\tThread.sleep(100);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tbluetooth_show_message(\"Error! Sending or Reading failed. Reason: \" + e);\r\n\t\t\t\t\tcancel();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tsocket.close();\r\n\t\t\t} catch(IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}", "public JPlayerThread() {\n status = Status.stopped;\n }", "public void stop() {\n _running = false;\n }", "public void stopRequest()\r\n\t{\r\n\t\tnoStopRequested = false;\r\n\t\tinternalThread.interrupt();\r\n\t}", "boolean hasReceived();", "@Override\r\n\t\tpublic void run() {\n\t\t\ttry {\r\n\t\t\t\twhile (mClient.mSelector.select() > 0) {\r\n\t\t\t\t\tif (DEBUG) Log.e(TAG, \" In while 135\");\r\n\t\t\t\t\tfor (SelectionKey next : mClient.mSelector.selectedKeys()) {\r\n\t\t\t\t\t\tif (next.isReadable()) {\r\n\t\t\t\t\t\t\tSocketChannel socketChannel = (SocketChannel) next.channel();\r\n\t\t\t\t\t\t\tByteBuffer buffer = ByteBuffer.allocate(500);\r\n\t\t\t\t\t\t\tbuffer.clear();\r\n\t\t\t\t\t\t\tint length = socketChannel.read(buffer);\r\n//\t\t\t\t\t\t\tif (DEBUG) Log.e(TAG, Arrays.toString(buffer.array()));\r\n\t\t\t\t\t\t\tif (length == -1) continue;\r\n\t\t\t\t\t\t\tbuffer.flip();\r\n\t\t\t\t\t\t\tif (buffer.get(0) == MessageBean.MESSAGE_TYPE_TEXT) {\r\n\t\t\t\t\t\t\t\tMessageBean messageBean = MessageBean.createMessage(buffer.array());\r\n\t\t\t\t\t\t\t\t// send message to activity\r\n\t\t\t\t\t\t\t\tIntent intent = new Intent(ReceiveReceiver.ACTION);\r\n\t\t\t\t\t\t\t\tintent.putExtra(\"data\", messageBean.getByteArray());\r\n\t\t\t\t\t\t\t\tsendBroadcast(intent);\r\n\t\t\t\t\t\t\t\tnext.interestOps(SelectionKey.OP_READ);\r\n\t\t\t\t\t\t\t\tif (DEBUG) \r\n\t\t\t\t\t\t\t\t\tLog.e(TAG, \"message : \" + messageBean.getSendId() + \" \" + \r\n\t\t\t\t\t\t\t\t\t\t\tmessageBean.getReceiveId() + \" \" + messageBean.getSendMessageLength() + \" \" +\r\n\t\t\t\t\t\t\t\t\t\t\tmessageBean.getMessageText());\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tmClient.mSelector.selectedKeys().remove(next);\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} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}", "public synchronized void stop() {\n\t\tif (!isStart) {\n\t\t\tthrow new IllegalStateException();\n\t\t}\n\t\tfor (LoopThread l : thread) {\n\t\t\tl.finnish();\n\t\t}\n\t\tint activeCount;\n\t\tdo{\n\t\t\tactiveCount = 0;\n\t\t\tfor(LoopThread l : thread){\n\t\t\t\tif(l.isAlive()){\n\t\t\t\t\tactiveCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t} while (activeCount > 0);\n\t\t\n\t}", "@Override\r\n\tpublic void onReceive(Object arg0) throws Exception {\n\t\t\r\n\t}", "@Override\n\t\tpublic void run()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\twhile (keepListening)\n\t\t\t\t{\n\t\t\t\t\tString rcvStr = is.readLine();\n\t\t\t\t\t\n\t\t\t\t\t//We must make sure that this packet has been sent here correctly.\n\t\t\t\t\tif (rcvStr != null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//TO-DO parse message here and notify controller\n\t\t\t\t\t\t//just transmit it to controller.\n\t\t\t\t\t\tSystem.out.println(\"receive reply : \" + rcvStr);\n\t\t\t\t\t\tmyController.parseResponse(rcvStr);\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t//The receive String is null means that this connection is broken.\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"at ControlChannel listenRunnable : receive null response\");\n\t\t\t\t\t\tkeepListening = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "public void requestStop( ) {\n\t\tif (verbose) System.out.println(\"requestStop called, about to enter synchronized\");\n\t\tsynchronized (this) {\n\t\t\tif (verbose) System.out.println(\"... entered synchronized\");\n\t\t\tif( threadStatus == PAUSED ) {\n\t\t\t\tif (verbose) System.out.println(\"was paused so interrupting\");\n\t\t\t\tthis.interrupt();\n\t\t\t\tif (verbose) System.out.println(\"done interrupting\");\n\t\t\t}\n\t\t\tthreadStatus = STOPPING;\n\t\t\treportThreadStatus();\n\t\t\tif (verbose) System.out.println(\"... leaving synchronized\");\n\t\t}\n\t\tif (verbose) System.out.println(\"requestStop finished (threadStatus now \"+threadStatus+\")\");\n\t}", "boolean hasStopped()\n {\n if (running && ! isAlive())\n {\n nextStartTime = System.currentTimeMillis() + minDurationInMillis;\n running = false;\n return true;\n }\n return false;\n }", "public boolean isStop() {\n\t\treturn stop;\n\t}", "public void receiveTarget() {\n BufferedReader localReader = new BufferedReader(new InputStreamReader(System.in));\n String msg = null;\n try {\n while ((msg = localReader.readLine()) != null) {\n if (!msg.equals(\"bye\")){\n Target target=new Target(msg);\n addTarget(target);\n }else{\n shutdown=true;\n selector.wakeup(); // Let Connector thread return from the method select()\n break;\n }\n }\n } catch (IOException e) {\n e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n }\n }", "public void stop() {\n\t\t//If we have already stopped, or are not running, we don't have to do anything.\n\t\tif (thread == null || stop || done) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tthis.stop = true;\n\t\t\n\t\t//If we are RUNNING, we are now STOPPING\n\t\tif (isRunning()) {\n\t\t\tstateProperty.set(GameState.STOPPING);\n\t\t}\n\t}", "public abstract boolean receive(byte[] buffer, int size, int timeout) throws InterruptedIOException;", "public void stopSending ();", "public boolean shouldStop() {\r\n return this.stop;\r\n }", "public boolean shouldStop() {\r\n return this.stop;\r\n }", "@Override\n public void run() {\n try {\n boolean busy = true;\n while (busy) {\n AbstractBasicMessage msg = readMsg();\n if (msg != null) {\n busy = msg.operate(this.persistor, this.pushServer);\n }\n }\n } catch (IOException e) {\n // Treat an IOException as a termination of the message\n // exchange, and let this message-processing thread die.\n\n // CODE VON DOZENTEN...\n } catch (OperationNotSupportedException ex) {\n System.out.println(\"Error while reading incoming message\");\n ex.printStackTrace();\n }\n }", "boolean isStop();", "@Override\n public void stop() {\n }", "boolean stopThread();", "@Override\r\n\tpublic void receive() {\n\t\tcurrentState.receive();\r\n\t}", "public synchronized void stop()\r\n\t\t{\r\n\t\tstate = CLOSING_DOWN;\r\n\t\t}", "boolean isPendingToRead();", "public void beforeReceive() {\n\t}", "public void waitStop() throws InterruptedException {\n if (Thread.currentThread() == thread) {\n throw new RuntimeException(\n \"waitStop() may not be invoked from job queue (would lead to deadlock).\");\n }\n synchronized (this) {\n if (!started || stopped) {\n return;\n }\n stopped = true;\n }\n stop.await();\n }", "public boolean canReceiveMessages()\n {\n return true;\n }", "@Override\n public boolean isInterruptible() {\n return true;\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t while ( !bFinished ) {\n\t\t \tif(scan.hasNextLine()){\n\t\t\t String message = scan.nextLine();\n\t\t\t if ( message.equals( \"stop\" ) ) {\n\t\t\t \tscan.close();\n\t\t\t \tSystem.exit(0);\n\t\t\t break;\n\t\t\t }\n\t\t \t} \t\n\t\t }\n\t\t scan.close();\t\n\t\t\t}", "public Message<Object> receive() {\n\t\treturn null;\n\t}", "@Override\n\tpublic void run() {\n\t\twhile (!stopThread) {\n\t\t\ttry {\n\t\t\t\t//String outputMessage = mmInStream.available() + \" bytes available\";\n\t\t\t\t//Log.i(TAG, outputMessage);\n\t\t\t\t// Read from the InputStream\n\t\t\t\twhile (mmInStream.available() > 0) {\n\n\t\t\t\t\tsynchronized (buffer) {\n\t\t\t\t\t\tif (bufferLast == buffer.length) {\n\t\t\t\t\t\t\tbyte temp[] = new byte[bufferLast << 1];\n\t\t\t\t\t\t\tSystem.arraycopy(buffer, 0, temp, 0, bufferLast);\n\t\t\t\t\t\t\tbuffer = temp;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbuffer[bufferLast++] = (byte) mmInStream.read();\n\t\t\t\t\t}\n\t\t\t\t\tbtSerialEvent();\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\tLog.e(TAG, e.getMessage());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n public void stop() {\r\n }", "@Override\r\n public void stop() {\r\n }" ]
[ "0.6587857", "0.6514347", "0.64679724", "0.64283496", "0.63355595", "0.62870586", "0.6276333", "0.6276024", "0.6244422", "0.62226605", "0.62096304", "0.61659944", "0.6112653", "0.61062056", "0.6094674", "0.6093071", "0.60847783", "0.6083764", "0.60729593", "0.6059304", "0.6059304", "0.6040846", "0.6036904", "0.6018514", "0.6017442", "0.6011472", "0.6000322", "0.5991931", "0.5987076", "0.5981893", "0.5971593", "0.59607476", "0.5956135", "0.59546626", "0.59509647", "0.59353125", "0.5927534", "0.59210443", "0.59170526", "0.59079176", "0.59020007", "0.59009767", "0.58944714", "0.58944184", "0.58902204", "0.5871745", "0.58705443", "0.58690834", "0.58522993", "0.58481115", "0.58388287", "0.58378804", "0.58354425", "0.5832789", "0.58311695", "0.58234304", "0.5821046", "0.5818007", "0.5814443", "0.58057094", "0.5804313", "0.5790786", "0.5784299", "0.5776683", "0.57696337", "0.57674176", "0.5754248", "0.5753784", "0.5752251", "0.5748915", "0.57474476", "0.57450366", "0.5744696", "0.5741123", "0.57329863", "0.5730017", "0.57224363", "0.57198966", "0.57195795", "0.5717937", "0.57101274", "0.57055235", "0.5700889", "0.57003593", "0.57003593", "0.569899", "0.56967705", "0.56966984", "0.56951785", "0.5693734", "0.5688904", "0.568599", "0.56815845", "0.5680514", "0.56788677", "0.5671577", "0.5670855", "0.5668315", "0.56635857", "0.56597304", "0.56597304" ]
0.0
-1
Create a socket connection and receive data until receiver is stopped
private void receive() { try{ while(true){ super.store(generateSimulateData()); System.out.println("模拟接收数据"); Thread.sleep(10000); } }catch(Exception ex){ ex.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void receive() {\n receive = new Thread(\"Receive\") {\n public void run() {\n while (running) {\n byte[] data = new byte[1024];\n DatagramPacket packet = new DatagramPacket(data, data.length);\n try {\n socket.receive(packet);\n } catch (IOException e) {\n e.printStackTrace();\n }\n processPacket(packet);\n }\n }\n };\n receive.start();\n }", "private TimerTask socketListener()\r\n\t{\r\n\t\tString theMessage;\r\n\t\tif (theSocket != null)\r\n\t\t{\r\n\t\t\tif (theSocket.isReady())\r\n\t\t\t{\r\n\t\t\t\t// blocks execution\r\n\t\t\t\t// get theMessage\r\n\t\t\t\ttheMessage = theSocket.getMessage();\r\n\t\t\t\tif (theMessage == null)\r\n\t\t\t\t{\r\n\t\t\t\t\twriteLine(\"Our connection has ended!\", 0);\r\n\t\t\t\t\trunning = false;\r\n\t\t\t\t\t// if the message = null\r\n\t\t\t\t\t// the we need to check the socket again\r\n\t\t\t\t\t// just in case\r\n\t\t\t\t\t// close it nicely if we can\r\n\t\t\t\t\tif (theSocket != null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttheSocket.close();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// otherwise just set it to null\r\n\t\t\t\t\t// set it to null regardless\r\n\t\t\t\t\ttheSocket = null;\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// if the socket is OK\r\n\t\t\t\t\t// and the socket isReady\r\n\t\t\t\t\t// then display the input\r\n\t\t\t\t\twriteLine(theMessage, 2);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} // end if theSocket !=null\r\n\t\treturn null;\r\n\t}", "private synchronized void openConnection() {\n\t\tsendData = new Thread(){\n\t\t\tpublic void run(){\n\t\t\t\tsynchronized(msgs){\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmsgs.wait(1000);\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\twhile(true){\n\t\t\t\t\tsynchronized(msgs){\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\tif(msgs.size() > 0){\n\t\t\t\t\t\t\t\tout = new PrintWriter(new PrintWriter(s.getOutputStream()));\n\t\t\t\t\t\t\t\tString temp = msgs.get(0);\n\t\t\t\t\t\t\t\tout.println(temp);\n\t\t\t\t\t\t\t\tout.flush();\n\t\t\t\t\t\t\t\tSystem.out.println(temp);\n\t\t\t\t\t\t\t\tmsgs.remove(0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}catch(IOException 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}\n\t\t\t}\n\t\t};\n\t\treceiveData = new Thread(){\n\t\t\tpublic void run(){\n\t\t\t\tString received;\n\t\t\t\tdo{\n\t\t\t\t\ttry {\n\t\t\t\t\t\tin = new BufferedReader(new InputStreamReader(s.getInputStream()));\n\t\t\t\t\t\treceived = in.readLine();\n\t\t\t\t\t\tparseMessageReceived(received);\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}while(true);\n\t\t\t}\n\t\t};\n\t\tsendData.setDaemon(true);\n\t\treceiveData.setDaemon(true);\n\t\tsendData.start();\n\t\treceiveData.start();\n\t\tnew Thread()\n\t\t{\n\t\t\tpublic void run(){\n\t\t\t\twhile(true){\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsendData.join();\n\t\t\t\t\t\treceiveData.join();\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}.start();\n\t}", "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 }", "@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 static void startChatServer() {\n\t\tbyte[] buffer = new byte[1024];\n\t\tStreamConnectionNotifier cn = null;\n\t\ttry {\n\t\t\tLocalDevice local = LocalDevice.getLocalDevice();\n\t\t\tlocal.setDiscoverable(DiscoveryAgent.GIAC);\n\t\t\tcn = (StreamConnectionNotifier) Connector.open(INSECURE_URL);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tOutputThread t = null;\n\t\t\tStreamConnection sock = null;\n\t\t\tInputStream is = null;\n\t\t\tOutputStream os = null;\n\t\t\ttry {\n\t\t\t\tSystem.out.println(\"accepting connection:\");\n\t\t\t\tsock = cn.acceptAndOpen();\n\t\t\t\tSystem.out.println(\"accept!: \" + Charset.defaultCharset());\n\t\t\t\tis = sock.openInputStream();\n\t\t\t\tos = sock.openOutputStream();\n\n\t\t\t\tt = new OutputThread(os);\n\t\t\t\tt.start();\n\n\t\t\t\twhile (t.isAlive()) {\n\t\t\t\t\t//TODO: use timeout read?\n\t\t\t\t\tint len = is.read(buffer);\n\t\t\t\t\t// printAsHex(buffer, len);\n\t\t\t\t\tif (len > 0) {\n\t\t\t\t\t\tSystem.out.println(\"received message(\" + len + \"): \" + new String(buffer, 0, len));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//TODO: check connection is live or not,\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} finally {\n\t\t\t\tt.interrupt();\n\t\t\t\tt = null;\n\t\t\t\ttry {\n\t\t\t\t\tsock.close();\n\t\t\t\t\tcn.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t//\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void resumeListening() {\n Thread listener = new Thread() {\n @Override\n public void run() {\n try {\n mListenerSocket = new ServerSocket();\n mListenerSocket.setReuseAddress(true);\n mListenerSocket.bind(new InetSocketAddress(LOCAL_PORT));\n while (true) {\n Socket connSocket = mListenerSocket.accept();\n Scanner sc = new Scanner(connSocket.getInputStream());\n String encMsg = sc.nextLine();\n connSocket.close();\n sc.close();\n Message msg = mHandler.obtainMessage();\n msg.obj = encMsg;\n mHandler.sendMessage(msg);\n }\n } catch (IOException e) {\n Log.d(\"LANConnection\", \"Stopping listener thread due to error\", e);\n }\n }\n };\n listener.start();\n }", "@Override\n public void run() {\n mBluetoothAdapter.cancelDiscovery();\n try {\n // Connect to the remote device through the socket. This call blocks\n // until it succeeds or throws an exception.\n mmSocket.connect();\n } catch (IOException connectException) {\n cancel();\n return;\n }\n\n onSocketObtained(mmSocket);\n }", "@Override\r\n public void run() {\r\n byte[] buffer = new byte[1024];\r\n int bytes;\r\n int times = 0;\r\n\r\n while (!mStopped) {\r\n try {\r\n if (times == 0) {\r\n try {\r\n \t// Sometimes lag occurs. Therefore, from time to time\r\n \t// we just ignore a large chunk of data from input stream\r\n \t// in order to synchronize the communication.\r\n mInputStream.skip(1024000);\r\n } catch (Exception e) {}\r\n times = LAG_CUT_TIMEOUT;\r\n }\r\n times--;\r\n\r\n // Read from socket and send to the handler\r\n bytes = mInputStream.read(buffer);\r\n mReceiveHandler.receiveData(buffer, bytes);\r\n\r\n } catch (IOException ioe) {\r\n Log.e(Common.TAG, \"Error receiving from the socket: \" + ioe.getMessage());\r\n mPeer.communicationErrorOccured();\r\n break;\r\n }\r\n }\r\n }", "@Override\n\t\tpublic void run() {\n\t\t\twhile (true) {\n\t\t\t\t\n\t\t\t\t// allocate buffer\n\t\t\t\tbyte[] buffer = new byte[RX_BUFFER_SIZE];\n\t\t\t\t\n\t\t\t\t// initialize new datagram\n\t\t\t\tDatagramPacket datagram = new DatagramPacket(buffer, buffer.length);\n\t\t\t\t\n\t\t\t\t// receive datagram\n\t\t\t\ttry {\n\t\t\t\t\tsocket.receive(datagram);\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\tcontinue;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tdatagramReceived(datagram);\n\t\t\t}\n\t\t}", "@Override\n public void run() {\n //System.out.println(\"TCPReceiver is running\");\n logger.debug(\"TCPReceiver is running\");\n //receivePackage(DataHandler.inQueue);\n while (true){\n try {\n socket = serverSocket.accept();\n multiReceivePackage(this.inQueue);\n } catch (Exception e) {\n //System.out.println(\"[\" + Thread.currentThread().getName() + \"] Receiver 线程内出错。\");\n logger.error(\"[\" + Thread.currentThread().getName() + \"] Receiver 线程内出错。\");\n e.printStackTrace();\n }\n }\n\n\n }", "@Override\n protected void startListener(){\n Socket socket = null;\n while (isRunning()){\n socket = acceptSocket();\n if (socket == null) {\n continue;\n }\n \n try {\n handleConnection(socket);\n } catch (Throwable ex) {\n getLogger().log(Level.FINE, \n \"selectorThread.handleConnectionException\",\n ex);\n try {\n socket.close(); \n } catch (IOException ioe){\n // Do nothing\n }\n continue;\n }\n } \n }", "public Socket awaitMessages(){\n Socket s = null;\n try { \n s = serverSocket.accept();\n\t } catch (IOException e) {\n System.out.println(\"Could not listen on port \" + portNumber);\n }\n return s;\n }", "private void listen() {\n\t\ttry {\n\t\t\tServerSocket servSocket = new ServerSocket(PORT);\n\t\t\tSocket clientSocket;\n\t\t\twhile(true) {\n\t\t\t\tclientSocket = servSocket.accept();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"Error - Could not open connection\");\n\t\t}\n\t\t\n\t}", "public void run() {\n\t\t\twhile (true) {// 保持连接直到异常发生或套接字返回\n\t\t\t\ttry {\n\t\t\t\t\tif (serverSocket != null) {\n\t\t\t\t\t\tmTempSocket = serverSocket.accept(); // 如果一个连接同意\n\t\t\t\t\t}\n\t\t\t\t\t// If a connection was accepted\n\t\t\t\t\tif (mTempSocket != null) {\n\t\t\t\t\t\t// Do work to manage the connection (in a separate\n\t\t\t\t\t\t// thread)\n\t\t\t\t\t\tmanageConnectedSocket(); // 管理一个已经连接的RFCOMM通道在单独的线程。\n\t\t\t\t\t\tserverSocket.close();\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "@Override\n public void run() {\n try {\n socket = new Socket(\"192.168.0.165\", 2000);\n out = new PrintWriter(socket.getOutputStream());\n in = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n ReadThread readThread = new ReadThread();\n readThread.start();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n boolean done = false;\n\n while (!done) {\n if (message != null) {\n try {\n out.print(message);\n out.flush();\n message = null;\n } catch (Exception e) {\n e.printStackTrace();\n try {\n socket.close();\n in.close();\n out.close();\n done = true;\n } catch (IOException d) {\n e.printStackTrace();\n }\n }\n }\n }\n disconnect();\n }", "@Override\r\n\tpublic void run() {\n\t\tbyte[] buffer = new byte[YapttaConstants.Network.DEFAULT_PACKET_BUFFER_SIZE];\r\n\t\tDatagramPacket packet = new DatagramPacket(buffer, buffer.length);\r\n\t\t\r\n\t\t// Loop until we're disconnected/stopped/etc\r\n\t\twhile(!haltRequested && socket != null && socket.isBound() && !socket.isClosed())\r\n\t\t{\r\n\t\t\ttry {\r\n\t\t\t\t// Block the socket until data is received\r\n\t\t\t\tsocket.receive(packet);\r\n\t\t\t\t\r\n\t\t\t\t// Deserialize the data\r\n\t\t\t\tByteArrayInputStream bais = new ByteArrayInputStream(packet.getData(), 0, packet.getLength());\r\n\t\t\t\tObjectInputStream ois = new ObjectInputStream(bais);\r\n\t\t\t\tAbstractMessage am = (AbstractMessage) ois.readObject();\r\n\t\t\t\t\r\n\t\t\t\t// Save who the sender was\r\n\t\t\t\tam.setSender(packet.getAddress());\r\n\t\t\t\t\r\n\t\t\t\t// Call the data received handler as appropriate\r\n\t\t\t\tif(callback != null) callback.messageReceived(am);\r\n\t\t\t\t\r\n\t\t\t\t// Clean-up\r\n\t\t\t\tois.close();\r\n\t\t\t\tbais.close();\r\n\t\t\t\t\r\n\t\t\t\t// ... then do it again!\r\n\t\t\t\t\r\n\t\t\t} catch (SocketTimeoutException e) {\r\n\t\t\t\t// just try to roll with the error (but at least log it)... it's likely due to\r\n\t\t\t\t// disconnection and will end the thread when it checks the condition of the loop\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t// if something other than timeout occurred, give more info\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void run() {\n mBluetoothAdapter.cancelDiscovery();\n \n try {\n // Connect the device through the socket. This will block\n // until it succeeds or throws an exception\n mmSocket.connect();\n while(!mmSocket.isConnected()){}\n Painter.paintSocketConnected = true;\n Log.d(tag, \"\" + mmSocket.isConnected());\n mOutputStream = mmSocket.getOutputStream(); \n mInputStream = mmSocket.getInputStream();\n\t\t\t\n } catch (IOException connectException) {\n try {\n\t\t\t\t\tmmSocket.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n return;\n }\n }", "public void run() {\n try {\n while (!socket.isClosed()) {\n Message message = socket.receiveMessage();\n if (message != null) {\n logger.info(\"Received: \" + message);\n socket.sendMessage(message);\n logger.info(\"Sent: \" + message);\n } else {\n // Close socket if no messages were received.\n // NOTE: This is a simplifying assumption that no messages means the client has been shutdown\n // and the application lifecyle has come to an end. Otherwise a shutdown message should be\n // detected and handled accordingly.\n socket.close();\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n executorService.shutdown();\n }", "public void run() {\n Log.d(\"bluetooth\", \"entrou na thread bluetoothconnect\");\n while (true) {\n try {if(mmServerSocket != null)\n socket = mmServerSocket.accept();\n\n\n } catch (IOException e) {\n break;\n }\n // If a connection was accepted\n if (socket != null) {\n // Do work to manage the connection (in a separate thread)\n //Server server = new Server(socket);\n Log.d(\"bluetooth\", \"socket não está mais null oba\");\n\n if(socket.isConnected()){\n tts.speak(\"Device connected\");\n\n }\n // Server server = new Server(socket);\n //server.initialize(handler);\n //mmServerSocket.close();\n\n\n break;\n }\n }\n }", "public void run() {\n\t\t\tbluetooth_adapter.cancelDiscovery();\r\n\t\t\tif(socket == null) return;\r\n\t\t\t\r\n\t\t\t// Connect the device through the socket. This will block\r\n\t\t\t// until it succeeds or throws an exception\r\n\t\t\ttry {\r\n\t\t\t\tsocket.connect();\r\n\t\t\t\tdata_thread = new Data_Thread(socket);\r\n\t\t\t\tdata_thread.start();\r\n\t\t\t\t//System.out.println(\"==============> Bluetooth Connected <===================\");\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsocket.close();\r\n\t\t\t\t} catch (IOException closeException) {\r\n\t\t\t\t\tcloseException.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tString message = \"Error: \" + e;\r\n\t\t\t\tif(device != null) {\r\n\t\t\t\t\tmessage += \" Device: \"+device.getName();\r\n\t\t\t\t}\r\n\t\t\t\tbluetooth_show_message(message);\r\n\t\t\t}\r\n\t\t\r\n\t\t\tclient_connect_thread = null;\r\n\t\t}", "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 }", "@Override\n public void run()\n {\n while (true)\n {\n try\n {\n final Socket socket = m_ServerSocket.accept(); // NOFORTIFY: unreleased resource:\n //resources are managed by the remote channel lookup\n m_Logging.info(\"Connection made from %s for remote interface\", \n socket.getRemoteSocketAddress());\n \n m_RemoteChannelLookup.newServerSocketChannel(socket);\n }\n catch (final IOException e)\n {\n if (m_ServerSocket.isClosed())\n {\n m_Logging.info(\"Server socket has been closed, will stop accepting connections\");\n return;\n }\n }\n }\n }", "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}", "@Override\n public void run() {\n P.print(\"Listening on port \"+P.port+\", waiting for incomming connection...\");\n try {\n ServerSocket serverSocket = new ServerSocket(P.port);\n while (P.choke_thread_running) { //read input forever.\n Receive receive_thread = new Receive();\n Socket s = serverSocket.accept();\n String addr = s.getInetAddress().toString();\n int p = s.getPort();\n int i;\n for(i = 0;i<P.peer_ip.length;i++){\n if(addr.equals(P.peer_ip[i])){\n P.sockets[i] = s;\n P.tcp_out_stream[i] = new ObjectOutputStream(s.getOutputStream());\n break;\n }\n }\n receive_thread.start(P,s,P.peer_id[--i]);\n P.print(\"Accepted incomming connection: ip = \"+addr.substring(1)+\", port = \"+p);\n }\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void run()\n\t{\n\t\tif(socket != null && !socket.isClosed() && socket.isConnected())\n\t\t{\n\t\t\tSendMessage(ApplicationManager.Instance().GetName(), MessageType.clientData);\n\t\t\tApplicationManager.textChat.writeGreen(\"Connected to \" + connectionInfo.ServerAdress);\n\t\t\t\n\t\t\ttry \n\t\t\t{\n\t\t\t\twhile (IsConnected) \n\t\t {\n\t\t Message message = (Message) in.readObject();\n\t\t\t\t\t\n\t\t if(!IsConnected)\n\t\t \tbreak;\n\t\t \t\n\t\t if(message == null)\n\t\t {\n\t\t \tIsConnected = false;\n\t\t \tbreak;\n\t\t }\n\t\t \n\t\t HandleMessage(message); \n\t\t }\n\t\t\t \n\t\t\t} \n\t\t\tcatch (SocketException | EOFException e) {\n\t\t\t\tif(IsConnected)\n\t\t\t\tApplicationManager.textChat.writeGreen(\"Server go down!\");\n\t\t\t}\n\t\t\tcatch (IOException | ClassNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tApplicationManager.Instance().Disconnect();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tApplicationManager.textChat.writeGreen(\"Cannot connect!\");\n\t\t\tApplicationManager.Instance().Disconnect();\n\n\t\t}\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tsuper.run();\n\t\t\t\ttry {\n\t\t\t\t\tinputStream = new DataInputStream(mSocket.getInputStream());// 2.23此处报空。崩\n\t\t\t\t\t// --使能常连接探测\n\t\t\t\t\tmSocket.setKeepAlive(true);\n\t\t\t\t\t// --设置心跳时间\n\t\t\t\t\tmSocket.setSoTimeout(1500);\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\twhile (!interrupted()) {\n\t\t\t\t\tint ret = 0;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tret = inputStream.read(recvBuf);\n\t\t\t\t\t\tif (ret > 0 && udpSocket != null) {\n\t\t\t\t\t\t\tDEBUG(\"recvlen:\" + ret);\n\n\t\t\t\t\t\t\t// --将接收到的TCP数据发送给UDP\n\n\t\t\t\t\t\t\tDatagramPacket packet = new DatagramPacket(recvBuf, 0, ret, address, iDstPort);\n\t\t\t\t\t\t\tudpSocket.send(packet);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (SocketTimeoutException e) {// 2.18甘\n\t\t\t\t\t\tDEBUG(\"read timeout!\");\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tDEBUG(\"=== IOException ===\");\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t// --断开链路\n\t\t\t\t\t\tstopTask();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "private void listen() {\n\t\tString message;\n\t\twhile(true){\n\t\t\ttry {\n\t\t\t\tmessage = input.readLine();\n\t\t\t\tif (message == null) continue;\n\n\t\t\t\tif(message.equals(\"disconnect\")){\n\t\t\t\t\tThread t = new Thread(this::disconnect);\n\t\t\t\t\tt.start();\n\t\t\t\t\treturn;\n\t\t\t\t} else if(message.contains(\"PUSH\")) {\n\t\t\t\t\tparseMessage(message);\n\t\t\t\t} else if (message.equals(\"pong\")){\n\t\t\t\t\tponged = true;\n\t\t\t\t} else if(!validResponse) {\n\t\t\t\t\tsynchronized (this) {\n\t\t\t\t\t\tresponse = message;\n\t\t\t\t\t\tvalidResponse = true;\n\t\t\t\t\t\tnotifyAll();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} catch (IOException e) {\n\t\t\t\tThread t = new Thread(this::disconnect);\n\t\t\t\tt.start();\n\t\t\t\ttry {\n\t\t\t\t\tt.join();\n\t\t\t\t} catch (InterruptedException e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\tsynchronized (this) {\n\t\t\t\t\tresponse = null;\n\t\t\t\t\tvalidResponse = true;\n\t\t\t\t\tnotifyAll();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "public void start(){\r\n\t\tLog.out(\"Start Service...listening on \" + port, 5);\r\n\t\ttry{\r\n\t\t\t//set up\r\n\t\t\tssocket = new ServerSocket(port);\r\n\t\t}catch(Exception e){\r\n\t\t\tLog.out(\"Can't open the port\", 5);\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\ttry{\r\n\t\t\twhile(isRun){\r\n\t\t\t\t//accept socket request,but only one.\r\n\t\t\t\tSocket socket = ssocket.accept();\r\n\t\t\t\tLog.out(\"Got a socket from \"+socket.getLocalAddress(), 5);\r\n\t\t\t\t//if no client now\r\n\t\t\t\tif(clientSocket == null){\r\n\t\t\t\t\tLog.out(\"Handle as client.\", 4);\r\n\t\t\t\t\tclientSocket = socket;\r\n\t\t\t\t\tnew Thread(new ServiceReciever(this, socket)).start();\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tLog.out(\"The server is already in use,refuse the request.\",2);\r\n\t\t\t\t\tnew DataOutputStream(socket.getOutputStream()).writeInt(SOCKET_REFUSE);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}catch(Exception e){\r\n\t\t\tLog.out(\"There are something wrong when get the socket.\", 5);\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}", "@Override\r\n\t\t\tpublic void run() {\n\r\n\t\t\t\twhile (!socket.isClosed()) {\r\n\r\n\t\t\t\t\tString line;\r\n\r\n\t\t\t\t\ttry {\r\n\r\n\t\t\t\t\t\tsocket.receive(recPacket);\r\n\r\n\t\t\t\t\t\tline = new String(recPacket.getData(), 0 , recPacket.getLength());\r\n\r\n\t\t\t\t\t\tbyte id = Byte.parseByte(line.substring(0, line.indexOf(\" \")));\r\n\r\n\t\t\t\t\t\tString payload = line.substring(line.indexOf(\" \") + 1, line.length());\r\n\r\n\t\t\t\t\t\tpacketMan.getPacketById(id).onRecieve(id, payload);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//System.out.println(payload);\r\n\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te.printStackTrace();\r\n\r\n\t\t\t\t\t\tdisconnect();\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}", "final public void run() {\n connectionEstablished();\n\n // The message from the server\n int msg;\n\n // Loop waiting for data\n\n try {\n // messageTimer.schedule(new TimerTask() {\n // @Override\n // public void run() {\n // try {\n // sendFromMessageQueue();\n // } catch (IOException e) {}\n // }\n // }, 0, 100);\n while (!readyToStop) {\n // Get data from Server and send it to the handler\n // The thread waits indefinitely at the following\n // statement until something is received from the server\n\n try { // added in version 2.31\n\n // String cur = input.readLine();\n // handleBig5String(cur + \"\\n\");\n readByte();\n\n } catch (RuntimeException ex) { // thrown by handleMessageFromServer\n\n connectionException(ex);\n }\n }\n } catch (Exception exception) {\n if (!readyToStop) {\n try {\n closeAll();\n } catch (Exception ex) {\n }\n\n clientReader = null;\n connectionException(exception);\n }\n } finally {\n\n clientReader = null;\n connectionClosed(); // moved here in version 2.31\n }\n }", "public void run() {\n // open socket\n Socket s = null;\n int retries = 3;\n int retry_interval_ms = 100;\n for (int i = 0; i < retries; i++) {\n\n // create or find a socket server\n try {\n InetAddress localhost = InetAddress.getByName(null);\n if (id < otherId) {\n ServerSocket serverSocket = new ServerSocket(port, 0, localhost);\n s = serverSocket.accept();\n } else {\n s = new Socket(localhost, port);\n }\n System.out.println(logPrefix + \"socket connected\");\n break;\n\n // retry a few times if necessary\n } catch (IOException e) {\n System.out.println(logPrefix + \"Socket connection failure.\");\n System.out.println(logPrefix + e.getMessage());\n if (i < retries - 1) {\n System.out.println(logPrefix + \"Trying again...\");\n try {\n Thread.sleep(retry_interval_ms);\n } catch (InterruptedException e1) {\n }\n } else {\n System.out.println(logPrefix + \"Giving up.\");\n }\n }\n }\n\n // if socket exists, finish initialization then listen for messages\n if (s != null) {\n try (\n // get I/O streams\n PrintWriter xxx = outContainer[0] =\n new PrintWriter(s.getOutputStream(), true);\n BufferedReader in = new BufferedReader(new InputStreamReader(\n s.getInputStream()));\n ) {\n // enqueue received messages\n String inputLine;\n while ((inputLine = in.readLine()) != null) {\n messages.add(Integer.parseInt(inputLine));\n }\n } catch (IOException e) {\n System.out.println(logPrefix + \"Exception in socket thread.\");\n System.out.println(logPrefix + e.getMessage());\n }\n }\n }", "private void startConnection() throws IOException {\n bos = new BufferedOutputStream(socket.getOutputStream(), 65536);\n\n byte[] key = new byte[16];\n Random random = new Random();\n random.nextBytes(key);\n String base64Key = Base64.encodeBase64String(key);\n\n byte[] handshake = createHandshake(base64Key);\n bos.write(handshake);\n bos.flush();\n\n InputStream inputStream = socket.getInputStream();\n verifyServerHandshake(inputStream, base64Key);\n\n writerThread.start();\n\n notifyOnOpen();\n\n bis = new BufferedInputStream(socket.getInputStream(), 65536);\n read();\n }", "public void run() {\n mBluetooth.cancelDiscovery();\n\n try {\n // Connect the device through the socket. This will block\n // until it succeeds or throws an exception\n mmSocket.connect();\n } catch (IOException connectException) {\n // Unable to connect; close the socket and get out\n try {\n mmSocket.close();\n } catch (IOException closeException) { }\n return;\n }\n\n // Do work to manage the connection (in a separate thread)\n connectedSocket(mmSocket);\n }", "@Override\r\n\t\tpublic void run() {\n\t\t\twhile (socket != null && !socket.isClosed()) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tbInputStream.read(rbyte);\r\n\t\t\t\t\t\tMessage msg = new Message();\r\n\t\t\t\t\t\tmsg.what = 1;\r\n\t\t\t\t\t\tmsg.obj = rbyte;\r\n\t\t\t\t\t\treHandler.sendMessage(msg);\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t}", "@Override\n public void run() {\n String id = (identifier != \"\") ? identifier : socket.getInetAddress().toString();\n\n LOGGER.info(\"Got connection from \" + id + \".\");\n peerInput = new PeerInput(socket);\n peerInput.start();\n peerOutput = new PeerOutput(socket);\n initialized = true;\n LOGGER.info(\"Initialized connection \" + id);\n peerOutput.run();\n }", "public void run() {\r\n\r\n mRun = false;\r\n\r\n try {\r\n //here you must put your computer's IP address.\r\n InetAddress serverAddr = InetAddress.getByName(SERVER_IP);\r\n\r\n //create a socket to make the connection with the server\r\n socket = new Socket(serverAddr, SERVER_PORT);\r\n\r\n\r\n Log.i(TAG, \"run: connected\");\r\n\r\n mBufferOut = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())), true);\r\n\r\n //receives the message which the server sends back\r\n mBufferIn = new BufferedReader(new InputStreamReader(socket.getInputStream()));\r\n mRun = true; // socket attached so connected\r\n\r\n String line = mBufferIn.readLine();\r\n\r\n while (line != null) {\r\n mServerMessage = line;\r\n\r\n if (mMessageListener != null) {\r\n Log.i(TAG, \"server response: \" + mServerMessage);\r\n //call the method onResponseReceived from MyActivity class\r\n mMessageListener.onResponseReceived(mServerMessage);\r\n }\r\n\r\n line = mBufferIn.readLine();\r\n }\r\n\r\n } catch (ConnectException e) {\r\n Log.d(TAG, e.getMessage());\r\n\r\n Log.d(TAG, \"trying to reconnect\");\r\n if (retry < 10) {\r\n retry++;\r\n\r\n // try to reconnect after 3 seconds\r\n try {\r\n Thread.sleep(3000);\r\n } catch (InterruptedException ie) {\r\n Log.d(TAG, \"interruptedexception\");\r\n }\r\n\r\n run();\r\n } else {\r\n mRun = false;\r\n retry = 1;\r\n\r\n // reconnect after 30 seconds\r\n try {\r\n Log.d(TAG, \"sleep for 30\");\r\n Thread.sleep(30000);\r\n } catch (InterruptedException ie) {\r\n Log.d(TAG, \"interruptedexception\");\r\n }\r\n\r\n run();\r\n }\r\n\r\n\r\n\r\n }\r\n catch (SocketException e) {\r\n Log.e(TAG, \"socket ex: \" + e.getMessage());\r\n // we want to reconnect\r\n if (e.getMessage().contains(\"ECONNRESET\") || e.getMessage().contains(\"ETIMEDOUT\")) {\r\n run();\r\n }\r\n }\r\n catch (IOException e) {\r\n Log.e(TAG, \"S: Error\", e);\r\n }\r\n finally {\r\n //the socket must be closed. It is not possible to reconnect to this socket\r\n // after it is closed, which means a new socket instance has to be created.\r\n try {\r\n if (socket != null) {\r\n socket.close();\r\n retry = 1;\r\n }\r\n }\r\n catch (IOException e) {\r\n Log.e(TAG, \"error closing socket: \" + e.getMessage());\r\n }\r\n }\r\n\r\n mRun = true;\r\n }", "public void run() {\n\t\tbyte[] out;\n\t\tshort[] in = new short[0];\n\t\tint read;\n\t\tint consumed;\n\t\t\n\t\ttry {\n\t\t\tconnect();\n\t\t\tin = new short[sock.getReceiveBufferSize()];\n\t\t} catch (Exception ex) {\n\t\t\t// TODO: Fire event to the model, so we can display something that lets the user know what happened.\n\t\t\tex.printStackTrace();\n\t\t\tdisconnect();\n\t\t}\n\t\t\n \t\twhile (sock != null && !sock.isClosed()) {\n\t\t\ttry {\n\t\t\t\tconsumed = 0;\n\t\t\t\t\n\t\t\t\t// Read up to in.length before we're invalid...\n\t\t\t\tinStream.mark(in.length);\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tread = inStream.read(in);\n\t\t\t\t} catch (IOException ioe) {\n\t\t\t\t\tread = 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Truncate the read buffer, and process it.\n\t\t\t\tif (read > 0) {\n\t\t\t\t\tshort[] truncIn = new short[read];\n\t\t\t\t\tSystem.arraycopy(in, 0, truncIn, 0, read);\n\t\t\t\t\t\n\t\t\t\t\tconsumed = consumeIncoming(truncIn);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// reset the mark, and then consume the bytes we've \n\t\t\t\t// processed.\n\t\t\t\tinStream.reset();\n\t\t\t\tif (consumed > 0) {\n\t\t\t\t\tinStream.skip(consumed);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// Do I have data to write?\n\t\t\t\tout = outgoingBytes();\n\t\t\t\tif (out.length > 0) {\n\t\t\t\t\tsock.getOutputStream().write(out);\n\t\t\t\t\tsock.getOutputStream().flush();\n\t\t\t\t}\n\t\t\t} catch (Exception ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t\tSystem.err.println(ex.toString());\n\t\t\t}\n\t\t\t// Play nice with thread schedulers.\n\t\t\tThread.yield();\n\t\t}\n\t}", "public void run() {\n\t\t\twhile (running) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsocket = mmServerSocket.accept();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\tbluetooth_show_message(\"Bluetooth Error! Accepting a connection failed. Reason:\" + e);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// If a connection was accepted\r\n\t\t\t\t// Do work to manage the connection (in a separate thread)\r\n\t\t\t\tif (socket != null) {\r\n\t\t\t\t\t//System.out.println(\"=========> Bluetooth Connected as Server <===========\");\r\n\t\t\t\t\tdata_thread = new Data_Thread(socket);\r\n\t\t\t\t\tdata_thread.start();\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tmmServerSocket.close();\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tbluetooth.this.server_connect_thread = null;\r\n\t\t}", "public void run() {\n try { \n s = new ServerSocket(PORT); \n\t System.out.println(\"ready to accept connectinos\");\n }\n catch (IOException e)\n {\n System.out.println(\"Could not listen on port: \" + PORT);\n Shutdown = true;\n }\n try {\n Socket currentSocket;\n while (!Shutdown)\n { \n currentSocket = s.accept();\n System.out.println(\"Got new connection\");\n try\n {\n input = currentSocket.getInputStream();\n output = new DataOutputStream(currentSocket.getOutputStream());\n }\n catch ( Exception e )\n { \n e.printStackTrace();\n Shutdown = true;\n }\n WritePacket();\n }\n try { \n input.close();\n output.close();\n s.close(); \n } catch ( IOException e ) { e.printStackTrace(); }\n }\n catch ( IOException e) {\n System.out.println(\"Server Socket closed\");\n }\n }", "public void run() {\n try {\n socketIn = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n socketOut = new ObjectOutputStream(socket.getOutputStream());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n readFromClient();\n pingToClient();\n }", "public void listen() {\n\t\t\n\t\twhile(true) {\n\t\t\t\n\t\t\tDatagramPacket packet = new DatagramPacket(recieveData, MAX_SIZE);\n\t\t\tint available = 0;\n\t\t\t\n\t\t\ttry {\n\t\t\t\t//The 'receive(...)' method fills up the buffer of the packet we passed into it with the data received\n\t\t\t\tmainSocket.receive(packet);\n\t\t\t\t//available = packet.getLength();\n\t\t\t\tbyte[] data = packet.getData();\n\t\t\t\t\n\t\t\t\tif(data[0] == HEADER && data[1] == CONNECTION)\n\t\t\t\t\tif(askUser(packet, available))\n\t\t\t\t\t\tmakeClientThread();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t}\n\t\t\tcatch(PortUnreachableException ex) {\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"PortUnreachableException caught in server side.\\n Unable to recieve packet\\n\");\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t\tcatch (IOException ex) {\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"1. IOException Caught in server side.\\n Unable to vertify user\\n\");\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public void receive() {\n try {\n ServerSocket s0 = new ServerSocket(PORT);\n s = s0.accept();\n rm.closeProgram();\n r = new BufferedReader(new InputStreamReader(s.getInputStream(), StandardCharsets.US_ASCII));\n w = new BufferedWriter(new OutputStreamWriter(s.getOutputStream(), StandardCharsets.US_ASCII));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void receiveMessage() throws IOException {\n String inputLine;\n while (true) {\n inputLine = inputStream.readLine();\n if (inputLine != null && !inputLine.equals(\"\")){\n if (!inputLine.equals(\"Host: closing\")) {\n network.appendMessage(inputLine);\n } else {\n network.appendMessage(\"Server has been closed! Restart the \"\n + \"server!\");\n waitForServer();\n }\n }\n }\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 }", "@Override\n public void run() {\n if (_running) {\n return;\n }\n _running = true;\n\n byte[] buf = new byte[8192];\n DatagramPacket dp = new DatagramPacket(buf, buf.length);\n\n //to enable stopping of receive\n try {\n _listenSocket.setSoTimeout(1000);\n } catch (SocketException ex) {\n ex.printStackTrace();\n// Logger.getLogger(NetworkNode.class.getName()).log(Level.SEVERE, \"Error in starting network node\", ex);\n }\n\n while (_running) {\n try {\n //System.out.println(_listenSocket.getLocalSocketAddress() + \"->\" + _listenSocket.getRemoteSocketAddress());\n _listenSocket.receive(dp);\n handlePacket(dp);\n } catch (SocketTimeoutException e) {\n // listen timeout. do nothing.\n } catch (Exception ex) {\n ex.printStackTrace();\n// Logger.getLogger(NetworkNode.class.getName()).log(Level.SEVERE, \"Error in receiving packet in network node\", ex);\n }\n }\n System.out.println(\"Listen thread finished!\");\n _runningThread = null;\n }", "@Override\n\tpublic void run()\n\t{\n\t\tSocket clientSocket;\n\t\tMemoryIO serverIO;\n\t\t// Detect whether the listener is shutdown. If not, it must be running all the time to wait for potential connections from clients. 11/27/2014, Bing Li\n\t\twhile (!super.isShutdown())\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Wait and accept a connecting from a possible client residing on the coordinator. 11/27/2014, Bing Li\n\t\t\t\tclientSocket = super.accept();\n\t\t\t\t// Check whether the connected server IOs exceed the upper limit. 11/27/2014, Bing Li\n\t\t\t\tif (MemoryIORegistry.REGISTRY().getIOCount() >= ServerConfig.MAX_SERVER_IO_COUNT)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// If the upper limit is reached, the listener has to wait until an existing server IO is disposed. 11/27/2014, Bing Li\n\t\t\t\t\t\tsuper.holdOn();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (InterruptedException e)\n\t\t\t\t\t{\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If the upper limit of IOs is not reached, a server IO is initialized. A common Collaborator and the socket are the initial parameters. The shared common collaborator guarantees all of the server IOs from a certain client could notify with each other with the same lock. Then, the upper limit of server IOs is under the control. 11/27/2014, Bing Li\n//\t\t\t\tserverIO = new MemoryIO(clientSocket, super.getCollaborator(), ServerConfig.COORDINATOR_PORT_FOR_MEMORY);\n\t\t\t\tserverIO = new MemoryIO(clientSocket, super.getCollaborator());\n\t\t\t\t// Add the new created server IO into the registry for further management. 11/27/2014, Bing Li\n\t\t\t\tMemoryIORegistry.REGISTRY().addIO(serverIO);\n\t\t\t\t// Execute the new created server IO concurrently to respond the client requests in an asynchronous manner. 11/27/2014, Bing Li\n\t\t\t\tsuper.execute(serverIO);\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void start() {\n\t\t\n\t\ttry {\n\t\t\tmainSocket = new DatagramSocket(PORT_NUMBER);\n\t\t}\n\t\tcatch(SocketException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\t\n\t\t//Lambda expression to shorten the run method\n\t\tThread serverThread = new Thread( () -> {\n\t\t\tlisten();\n\t\t});\n\t\t\n\t\tserverThread.start();\n\t}", "public void startListener() throws IOException {\n\t\tthis.listener = new ServerSocket(this.port);\n\n Runnable serverThread = new Runnable() {\n @Override\n public void run() {\n try {\n System.out.println(\"Waiting for clients to connect...\");\n\n while (true) {\n \t// Wait for connections\n Socket newSocket = listener.accept();\n\n // Init new peer and add it to our list\n PeerCommunicator newCommunication = new PeerCommunicator(id, \"\", newSocket);\n activePeers.add(newCommunication);\n\n // Span new thread\n Thread clientThread = new Thread(new ReceivedConnection(newCommunication, fm));\n clientThread.start();\n }\n } catch (Exception e) {\n System.err.println(\"Unable to process incoming client\");\n e.printStackTrace();\n }\n }\n };\n\n // Start it up\n (new Thread(serverThread)).start();\n\n // Once everything's good, mark server as running\n //this.status = Status.RUNNING;\n\t}", "public void run() {\n\t\ttry {\n\t\t\tSystem.err.println(\"Lancement du serveur au port \" + this.listen_socket.getLocalPort());\n\t\t\twhile (true) {\n\t\t\t\tif (listen_socket.getLocalPort() == PORT_RESERVATION) {\n\t\t\t\t\tnew Thread(new ServiceReservation(listen_socket.accept())).start();\n\t\t\t\t} else if (listen_socket.getLocalPort() == PORT_EMPRUNT) {\n\t\t\t\t\tnew Thread(new ServiceEmprunt(listen_socket.accept())).start();\n\t\t\t\t} else if (listen_socket.getLocalPort() == PORT_RETOUR) {\n\t\t\t\t\tnew Thread(new ServiceRetour(listen_socket.accept())).start();\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\ttry {\n\t\t\t\tthis.listen_socket.close();\n\t\t\t} catch (IOException e1) {\n\t\t\t}\n\t\t\tSystem.err.println(\"Arręt du serveur au port \" + this.listen_socket.getLocalPort());\n\t\t}\n//\t\ttry {\n//\t\t\tthis.finalize();\n//\t\t} catch (Throwable e) {\n//\t\t\te.printStackTrace();\n//\t\t}\n\t}", "private void listenForConnection() throws IOException {\n\twhile(true) {\n System.out.println(\"Waiting for connection...\");\n // Wait for client to connect\n Socket cli = server.accept();\n if(connlist.size() < MAX_CONN) {\n\t\t// if numCli is less then 100\n initConnection(cli);\n }\n\t}\n }", "private void runServer() {\n while(true) {\n try {\n SSLSocket socket = (SSLSocket)listener.accept();\n\n this.establishClient(socket);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }", "private void listen() {\n System.out.println(\"launch listen task\");\n listenTask = new AsyncTask<Void, String, IOException>() {\n @Override\n protected IOException doInBackground(Void... params) {\n try (BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()))) {\n String line;\n while ((line = in.readLine()) != null) {\n System.out.println(\"receive \" + line);\n publishProgress(line);\n }\n } catch (SocketException e) {\n if (e.toString().equals(\"java.net.SocketException: Socket closed\")) {\n //that's what will happen when task.cancel() is called.\n System.out.println(\"listening is stopped as socket is closed\");\n return null;\n } else {\n e.printStackTrace();\n return e;\n }\n } catch (IOException e) {\n e.printStackTrace();\n return e;\n }\n return null;\n }\n\n @Override\n protected void onProgressUpdate(String... values) {\n handler.accept(new Message(MsgType.SERVER, values[0]));\n }\n\n @Override\n protected void onPostExecute(IOException e) {\n if (e == null) {\n handler.accept(new Message(MsgType.INFO, \"listening finished\"));\n } else {\n handler.accept(new Message(MsgType.ERROR,\n \"exception while listening\" + \"\\n\" + e.toString()));\n }\n }\n\n @Override\n protected void onCancelled() {\n super.onCancelled();\n }\n };\n //the listen task will last for a quite long time (blocking) and thus should run in a parallel pool.\n listenTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n }", "@Override\n\tpublic void run() {\n\t\tSystem.out.println(\"Waiting for input\");\n\t\t// Handle reading data until we exit\n\t\tByteBuffer buf = ByteBuffer.allocate(2048);\n\t\twhile (!stopper && socketChannel.isOpen()) {\n\t\t\tSystem.out.println(\"Reading the socket\");\n\t\t\ttry {\n\t\t\t\t// No input from the user in 60 seconds results in kicking them\n\t\t\t\t// out\n\t\t\t\tint bytesRead = socketChannel.read(buf).get(60, TimeUnit.SECONDS);\n\t\t\t\t// ByteBuffer dst = ByteBuffer.allocate(bytesRead);\n\t\t\t\t// engine.unwrap(buf, dst);\n\t\t\t\tSystem.out.println(\"Got data of size: \" + bytesRead);\n\t\t\t\t// convert to proto\n\t\t\t\tcommonUIElements.MessageProtos.Message msg = commonUIElements.MessageProtos.Message\n\t\t\t\t\t\t.parseFrom(Arrays.copyOf(buf.array(), bytesRead));\n\t\t\t\tSystem.out.println(\"RXed: \" + msg.toString());\n\t\t\t\tif (!msg.getName().equals(name)) {\n\t\t\t\t\tname = msg.getName();\n\t\t\t\t}\n\t\t\t\t// add data to the message queue\n\t\t\t\tif (SignatureSystem.verifySignature(msg.getSignature(), msg.getMessage(), msg.getName(), trustStore)) {\n\t\t\t\t\tmessages.put(\n\t\t\t\t\t\t\tnew Message(msg.getSender(), msg.getMessage(), msg.getSignature(), msg.getClearance()));\n\t\t\t\t} else {\n\t\t\t\t\tMessage error = new Message(msg.getSender(), \"Error: signture is invalid\", msg.getSignature(),\n\t\t\t\t\t\t\tmsg.getClearance());\n\t\t\t\t\terror.error = true;\n\t\t\t\t\tmessages.put(error);\n\t\t\t\t}\n\t\t\t\t// clear the buffer for the next message\n\t\t\t\tbuf.clear();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tSystem.err.println(\"Failed to add message to the queue: \" + e.getMessage());\n\t\t\t\tMessage error = new Message(this.name, \"Disconnected\", \"\", 1);\n\t\t\t\terror.error = true;\n\t\t\t\ttry {\n\t\t\t\t\tmessages.put(error);\n\t\t\t\t} catch (InterruptedException e1) {\n\t\t\t\t\tSystem.err.println(\"Thread has an error, can't inform server of this transgression\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t} catch (TimeoutException e) {\n\t\t\t\tSystem.err.println(\"Timeout hit, waiting again\");\n\t\t\t\tMessage error = new Message(this.name, \"Client: \" + this.name + \" has timed out\", \"\", 1);\n\t\t\t\terror.kill = true;\n\t\t\t\ttry {\n\t\t\t\t\tmessages.put(error);\n\t\t\t\t} catch (InterruptedException e1) {\n\t\t\t\t\tSystem.err.println(\"Thread has an error, can't inform server of this transgression\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t} catch (ExecutionException e) {\n\t\t\t\tSystem.err.println(\"Execution error, breaking out of loop\");\n\t\t\t\tbreak;\n\t\t\t} catch (InvalidProtocolBufferException e) {\n\t\t\t\tSystem.err.println(\"Invalid protobuf received: \" + e.getMessage());\n\t\t\t\t// } catch(SSLException e) {\n\t\t\t\t// System.err.println(\"SSL Failed: \" + e.getMessage());\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\tsocketChannel.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Failed to close socket while exiting\");\n\t\t}\n\t\tSystem.out.println(\"Exiting thread...\");\n\t}", "@Override\r\n\tpublic void run() {\r\n\t\t//Tries to initialise a connection\r\n\t\ttry {\r\n\t\t\t//Runs as long as the channel is open\r\n\t\t\twhile(channel.isOpen()) {\r\n\t\t\t\t//Creates a new byte buffer to create the input\r\n\t\t\t\tByteBuffer buffer = ByteBuffer.allocate(PACKET_SIZE);\r\n\t\t\t\t//Stores the result, -1 by default to assume that the channel couldn't be read\r\n\t\t\t\t//Checks which type of supported channel the channel is (DatagramChannel or SocketChannel - UDP vs TCP)\r\n\t\t\t\t//Uses this to determine where to read the result\r\n\t\t\t\t//Creates a string from the buffer and passes the string into the connector's function\r\n\t\t\t\t//Only passes the data if there's info to read (if the result isn't -1)\r\n\t\t\t\tif(channel.isOpen() && channel.read(buffer) != -1) {\r\n\t\t\t\t\t//Creates the packet from the received data and id\r\n\t\t\t\t\tString packet = new String(buffer.array()).trim();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//If the packet is a ping, returns a pong back\r\n\t\t\t\t\tif(packet.contains(\"!ping%EOP%\")) {\r\n\t\t\t\t\t\tsend(\"!pong\");\r\n\t\t\t\t\t} else if(packet.contains(\"!pong%EOP%\")) { //If the packet is a pong, calculates the ping\r\n\t\t\t\t\t\t//Calculates the ping from the current time and the time since the ping was sent\r\n\t\t\t\t\t\tping = System.currentTimeMillis() - timeSincePing;\r\n\t\t\t\t\t\t//System.out.println(\"Pong!\\nPING: \" + ping + \"ms\");\r\n\t\t\t\t\t} else if(!packet.trim().isEmpty()) { //Checks if the packet's data isn't just a blank string or whitespace\r\n\t\t\t\t\t\t//Sends the packet to the listener\r\n\t\t\t\t\t\t//Finds all the packets received by the listener by looping through as long as the packet contains an end-of-packet footer\r\n\t\t\t\t\t\twhile(packet.contains(\"%EOP%\")) {\r\n\t\t\t\t\t\t\t//Passes in the portion before the end-of-packet footer\r\n\t\t\t\t\t\t\tlistener.onReceive(new Packet(id, packet.substring(0, packet.indexOf(\"%EOP%\"))));\r\n\t\t\t\t\t\t\t//Removes that portion from the packet string\r\n\t\t\t\t\t\t\tpacket = packet.substring(packet.indexOf(\"%EOP%\") + \"%EOP%\".length());\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\r\n\t\t\t//Closes the connection\r\n\t\t\tclose();\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.err.println(\"Error receiving data over TCP!\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n public void run() {\n try {\n //create a socket using sever name or IP and port\n socket = new Socket(serverName, serverPort);\n // set up stream\n start();\n //if everything is good, enable controls on GUI\n send.setEnabled(true); // setup buttons\n tf.setEnabled(true);\n connect.setEnabled(false);\n //catch execeptions if any\n } catch (UnknownHostException uhe) {\n display(\"Host unknown: \" + uhe.getMessage()); // Alert not the right host/ IP\n } catch (IOException ioe) {\n display(\"Unexpected exception: \" + ioe.getMessage());\n }\n //keep listening to incoming messages\n while (true) { // the infinite loop\n try {\n while (!bufferInput.ready()) { // when steam ready to read\n }\n String output = bufferInput.readLine(); // Received the data from socket\n while (output != null) \n {append(output + \"\\n\");\n output = bufferInput.readLine();} } \n catch (IOException ioe) {ioe.getMessage();}\t\n \t\t\t}\t\t }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tsocket.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}", "public void run(){\n\t\t\n\t\twhile(true){\n\t\t\ttry {\n\t\t\t\tSocket s = listener.accept();\n\t\t\t\tnew ServerConnection(chatServ, s).start();\n\t\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\t\n\t\t\t\te.printStackTrace();\n\t\t\t\treturn; // stop listening\n\t\t\t}\n\t\t}\n\t}", "public int createSocket()\n\t{\n\t\t\n\t}", "public void InitSocket(String server, int port) throws IOException {\n socket = new Socket(server, port);\n outputStream = socket.getOutputStream();\n\n Thread receivingThread = new Thread() {\n @Override\n public void run() {\n try {\n \n BufferedReader reader = new BufferedReader(\n new InputStreamReader(socket.getInputStream()));\n String line;\n while ((line = reader.readLine()) != null)\n notifyObservers(line);\n } catch (IOException ex) {\n notifyObservers(ex);\n }\n }\n };\n receivingThread.start();\n }", "public void InitSocket(String server, int port) throws IOException {\r\n socket = new Socket(server, port);\r\n outputStream = socket.getOutputStream();\r\n\r\n Thread receivingThread = new Thread() {\r\n @Override\r\n public void run() {\r\n try {\r\n BufferedReader reader = new BufferedReader(\r\n new InputStreamReader(socket.getInputStream()));\r\n String line;\r\n while ((line = reader.readLine()) != null) {\r\n notifyObservers(line);\r\n }\r\n } catch (IOException ex) {\r\n notifyObservers(ex);\r\n }\r\n }\r\n };\r\n receivingThread.start();\r\n }", "public void run(){\n\t\t\t\tsynchronized (socket) {\n\t\t\t\t\tsocket.close();\n\t\t\t\t}\n\t\t\t}", "Socket call() throws InterruptedException;", "public void run() {\n\t\t\twhile (running || !messages_to_send.isEmpty()) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsend();\r\n\t\t\t\t\tread();\r\n\t\t\t\t\tThread.sleep(100);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tbluetooth_show_message(\"Error! Sending or Reading failed. Reason: \" + e);\r\n\t\t\t\t\tcancel();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tsocket.close();\r\n\t\t\t} catch(IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}", "@Override\n\tpublic void run() {\n try {\n while (true) {\n Socket socket = listener.accept();\n try {\n \t\n\t\t\t\t\tDataInputStream in = new DataInputStream(\n\t\t\t\t\t\t\tsocket.getInputStream());\n\t\t\t\t\tBufferedReader d = new BufferedReader(\n\t\t\t\t\t\t\tnew InputStreamReader(in));\n\n\t\t\t\t\tString msg = d.readLine();\n\t\t\t\t\t\n third.notifyAllClients(msg);\n \n d.close();\n in.close();\n } finally {\n socket.close();\n }\n }\n } catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n finally {\n try {\n\t\t\t\tlistener.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n }\n\t}", "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 }", "private void waitOnReceive() throws IOException {\n while (inStream.available() == 0) {\n try {\n Thread.sleep(1);\n } catch (InterruptedException _) {\n }\n }\n }", "@Override\n\t\tpublic void run() {\n\t\t\tsuper.run();\n\n\t\t\ttry {\n\t\t\t\tudpSocket = new DatagramSocket();\n\t\t\t} catch (SocketException e1) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\n\t\t\tif (udpSocket == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\ttcpSocket = new ServerSocket(iSrcPort);\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\tDEBUG(\"TcpToUdp tcpSocket:\" + tcpSocket);\n\t\t\tif (tcpSocket == null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\twhile (!interrupted()) {\n\t\t\t\tSocket socket = null;\n\t\t\t\ttry {\n\t\t\t\t\tsocket = tcpSocket.accept();\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\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (clientTask != null) {\n\t\t\t\t\tclientTask.stopTask();\n\t\t\t\t\tclientTask = null;\n\t\t\t\t}\n\t\t\t\tDEBUG(\"new remote accept!\");\n\t\t\t\t// DEBUG(\"remoteSocket:\"+remoteSocket.getInetAddress().getHostName());\n\t\t\t\tclientTask = new ClientTask(socket);\n\t\t\t\tclientTask.start();\n\n\t\t\t}\n\t\t}", "@Override\n public void run() {\n try {\n\n byte[] data = new byte[TcpClient.BUFFER_SIZE * 2];\n\n while(!Rebroadcaster.INSTANCE.isHalted()) {\n int len = is.read(data, 0, data.length);\n os.write(data, 0, len);\n os.flush();\n }\n } catch (IOException ex) {\n LOGGER.log(Level.SEVERE, null, ex);\n }\n }", "@Override\n public void run() {\n // Create a new socket on the address/port combination\n InetAddress iAddress;\n DatagramSocket socket;\n try {\n iAddress = InetAddress.getByName(address);\n socket = new DatagramSocket(port, iAddress);\n socket.setSoTimeout(SOCKET_TIMEOUT);\n \n System.out.println(\"ArtNet listening on \" + address + \":\" + port);\n } catch (IOException e) {\n System.out.println(e);\n return;\n } \n \n // Parse buffer\n byte[] buffer = new byte[BUFFER_SIZE];\n int timeout = 0;\n \n while (operating) {\n // Recieve next packet\n DatagramPacket packet = new DatagramPacket(buffer, buffer.length);\n try {\n socket.receive(packet);\n \n // Parse\n ArtNetPacket artnetPacket = Parser.parse(packet);\n if (artnetPacket != null) {\n // Notify listeners\n DMXPacket dmx = new DMXPacket(artnetPacket);\n for (ArtNetListener listener : listeners) {\n listener.receive_artnet(dmx);\n }\n\n // display response\n //System.out.println(\"Recieved Packet Opcode: \" + artnetPacket.getOpcode());\n //System.out.println(\"Data:\" + artnetPacket.getData());\n } else {\n //String recieved = new String(packet.getData(), 0, packet.getLength());\n //System.out.println(\"Packet parse failed: \" + packet);\n }\n } catch (SocketTimeoutException e) {\n // It's ok, just wait for the next packet\n timeout++;\n System.out.println(\"Timeout: \" + timeout);\n } catch (IOException e) {\n // Fail silently\n }\n }\n \n // Close the connection\n System.out.println(\"ArtNet closing\");\n socket.close();\n }", "public void run() {\n\t\ttry {\n\t\t\tinternalSocket = new Socket(\"localhost\", getPort());\n\t\t\tin = new ObjectInputStream(socket.getInputStream());\n\n\t\t\tinternalOut = new ObjectOutputStream(\n\t\t\t\t\tinternalSocket.getOutputStream());\n\t\t} catch (IOException e1) {\n\t\t\tconsoleOut(MESSAGE_ERROR_EXEC);\n\t\t\treturn;\n\t\t}\n\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tString message = in.readUTF();\n\n\t\t\t\t// take message and redirect this message to\n\t\t\t\t// second console\n\t\t\t\tsendMessage(message);\n\n\t\t\t\tif (message.equalsIgnoreCase(\"bye\")) {\n\t\t\t\t\tclose();\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} catch (Exception efEx) {\n\t\t\t\tconsoleOut(MESSAGE_ERROR_EXEC);\n\t\t\t\ttry {\n\t\t\t\t\tclose();\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tconsoleOut(MESSAGE_ERROR_EXEC);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "protected void stop() {\n keepGoing = false;\n try {\n new Socket(\"localhost\", port);\n }\n catch(Exception e) {\n e.printStackTrace();\n }\n }", "@Override\r\n public Object connect() {\n if(status()){\r\n //creates thread that checks messages in the network\r\n System.out.println(\"notifying network that connection is good\");\r\n notifyObservers(this);\r\n }\r\n return socket;\r\n }", "@Override\n\tpublic void run() {\n\t\tsuper.run();\n\n\t\twhile (onWork) {\n\n\t\t\tswitch (state) {\n\t\t\tcase connect:\n\t\t\t\tconnect();\n\t\t\t\tbreak;\n\t\t\tcase running:\n\t\t\t\treceiveMsg();\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t}", "private void gestionSocket(){\n Socket sock = null;\n try{\n sock = new Socket(adresse, 18000);\n }\n catch(IOException ioe){\n System.out.println(\"Erreur lors de la connexion : \" + ioe.getMessage());\n }\n \n envoieInt(sock, 3);\n }", "@Override\n public void run() {\n console.append(\"Connected: \" + socket + \"\\n\");\n try {\n BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n\n String[] data = null;\n\n while (socket.isConnected()) {\n String incoming = in.readLine();\n console.append(incoming + \"\\n\");\n try {\n data = incoming.split(\",\");\n }catch(NullPointerException e){\n //eh\n }\n //recieve packets\n receivePackets(data);\n }\n } catch (Exception e) {\n console.append(\"Disconnected:\" + socket + \"\\n\");\n //e.printStackTrace();\n } finally {\n try { socket.close(); } catch (IOException e) {}\n console.append(\"Closed: \" + socket + \"\\n\");\n }\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}", "private void startThread() {\n\t\tif(receivethread != null && receivethread.isAlive())\n\t\t\treceivethread.interrupt();\n\n\t\t// Close datagram socket If still open\n\t\tif(udpsocket != null && udpsocket.isClosed() == false)\n\t\t\tudpsocket.close();\n\n\t\t// Open datagram socket\n\t\ttry {\n\t\t\tudpsocket = new DatagramSocket();\n\t\t\tudpsocket.setReceiveBufferSize(1024 * 1024);\n\t\t\tudpsocket.setSoTimeout(15000);\n\t\t} catch (SocketException e) {\n\t\t\tudpsocket.close();\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\t}\n\n\t\t// Start Receive Thread\n\t\treceivethread = new ReceiveThread(this.udpsocket, callback);\n\t\treceivethread.start();\n\t}", "@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 }", "@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tInputStream inputStream = mSocket.getInputStream();\n\t\t\tint leng;\n\t\t\tbyte[] buffer = new byte[1024];\n\t\t\tByteArrayBuffer[] data = {new ByteArrayBuffer(1024 * 32)};\n\t\t\twhile((leng = inputStream.read(buffer)) != -1 && mConected)\n\t\t\t{\n\t\t\t\tif(mConected)\n\t\t\t\t{\n\t\t\t\t\tdata[0].append(buffer, data[0].length(), leng);\n\t\t\t\t\tprocessMessage(data);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tLog.e(TAG, \"Cannot set InputStream\\nNetwork error\");\n\t\t\tevent.connectionLost();\n\t\t} catch (ProtocolException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tevent.connectionLost();\n\t\t}\n\t}", "protected void mainTask() {\n\ttry {\n\t socket = serverSocket.accept();\t\n\t spawnConnectionThread(socket);\n\t} catch (IOException e) {\n\t return;\n\t}\n }", "@Override\r\n\tpublic void run() {\n\t\tsuper.run();\r\n\t\ttry {\r\n\r\n\t\t\tBufferedReader in = null;\r\n\t\t\tPrintWriter out = null;\r\n\t\t\tString result = \"\";\r\n\t\t\twhile (isStart) {\r\n\t\t\t\tsocket = new Socket();\r\n\t\t\t\tsocket.connect(\r\n\t\t\t\t\t\tnew InetSocketAddress(MyApplication.share.getIp(), PORT),\r\n\t\t\t\t\t\t5 * 1000);\r\n\t\t\t\twhile (!socket.isClosed()) {\r\n\t\t\t\t\tin = new BufferedReader(new InputStreamReader(\r\n\t\t\t\t\t\t\tsocket.getInputStream()));\r\n\t\t\t\t\tout = new PrintWriter(socket.getOutputStream());\r\n\r\n\t\t\t\t\tout.println(\"getNotification\");\r\n\t\t\t\t\tout.flush();\r\n\r\n\t\t\t\t\tresult = in.readLine();\r\n\t\t\t\t\tif (!TextUtils.isEmpty(result)) {\r\n\t\t\t\t\t\taccessResult(new String(Base64.decode(\r\n\t\t\t\t\t\t\t\tresult.getBytes(), Base64.DEFAULT)));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tLog.w(TAG, \"Socket ���ؽ��Ϊ null...\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tsleep(3 * 1000);\r\n\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tsocket.close();\r\n\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}", "public void run() {\r\n Thread.currentThread().setContextClassLoader(m_loader);\r\n try {\r\n m_socket.setTcpNoDelay(true);\r\n m_socket.setSoTimeout(m_timeout);\r\n m_in = new ObjectInputStream(m_socket.getInputStream());\r\n m_out = new ObjectOutputStream(m_socket.getOutputStream());\r\n } catch (IOException e) {\r\n throw new WrappedRuntimeException(e);\r\n }\r\n while (m_running) {\r\n try {\r\n switch (m_in.read()) {\r\n case Command.CREATE:\r\n handleCreateCommand();\r\n break;\r\n case Command.INVOKE:\r\n handleInvocationCommand();\r\n break;\r\n case Command.CLOSE:\r\n m_running = false;\r\n break;\r\n default:\r\n break;\r\n }\r\n } catch (Exception e) {\r\n close();\r\n throw new WrappedRuntimeException(e);\r\n }\r\n }\r\n close();\r\n }", "@Override\n public void run() {\n if (isV6())\n while (!interrupted()) {\n try {\n handleMessage(serverSocket.accept());\n } catch (SocketTimeoutException ignore) {\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n try {\n serverSocket.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private static void server() throws IOException {\n\t\tServerSocket serverSocket = new ServerSocket(10999);\n\t\t//listener, waiting connection\n\t\tSocket socket = serverSocket.accept();//block\n\t\t//input --> receive / output --> send\n\t\tInputStream inputStream = socket.getInputStream();\n\t\tOutputStream outputStream = socket.getOutputStream();\n\t\t//byte array (stream)\n\t\tbyte[] b = new byte[1024];\n\t\t//read/receive\n\t\tinputStream.read(b);\n\t\t//\n\t\tString resp = client(b);\n\t\t//\n\t\toutputStream.write(resp.getBytes());\n\t\t//closing\n\t\tsocket.close();\n\t\t//close server\n\t\tserverSocket.close();\n\t}", "@Override\n\t\tpublic void run() {\n\t\t\ttry {\n\t\t\t\tLog.v(TAG,\"connect to server...\");\n\t\t\t\tsocket=new Socket(\"140.116.246.200\",4000+id);\n\t\t\t\tout=socket.getOutputStream();\n\t\t\t\tin=socket.getInputStream();\n\t\t\t\tLog.v(TAG,\"connect!!\");\n\t\t\t\n\t\t\t\tsendData(\"ask#\");\n\t\t\t\tUIHr.post(refreshUI); \t\n\t\t\t\tresult=new Integer(readData());\n\t\t\t\tUIHr.post(refreshUI); \t\t\n\t\t\t\tsendData(\"over#\");\n\t\t\t\tsocket.close();\n\t\t\t} catch (UnknownHostException e) {e.printStackTrace();} \n\t\t\tcatch (IOException e) {e.printStackTrace();}\n\t\t}", "@Override\n public void run() {\n byte[] buffer = new byte[1024];\n int bytes;\n while (true) {\n try {\n\n bytes = inputStream.read(buffer);\n String data = new String(buffer, 0, bytes);\n handler.obtainMessage(MainActivityFreeEX.DATA_RECEIVED, data).sendToTarget();\n\n Log.i(this.toString(), \"en el run de Connection: \" + handler.obtainMessage(MainActivityFreeEX.DATA_RECEIVED, data).toString());\n\n\n } catch (IOException e) {\n break;\n }\n }\n }", "public void run() {\n\t\ttry {\n\t\t\tif(!sender && (ois == null)) {\n\t\t\t\tSystem.out.println(\"(NetAPI) Starting Input Stream\");\n\t\t\t\tois = new ObjectInputStream(new BufferedInputStream(socket.getInputStream()));\n\t\t\t} else if(sender && (oos == null)) {\n\t\t\t\tSystem.out.println(\"(NetAPI) Starting Output Stream\");\n\t\t\t\toos = new ObjectOutputStream(socket.getOutputStream());\n\t\t\t}\n\t\t\t\n\t\t\twhile(alive) {\n\t\t\t\tif(sender) {\n\t\t\t\t\tsendNewPackets();\n\t\t\t\t} else {\n\t\t\t\t\treceiveNewPackets();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(100);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// Ignore\n\t\t\t\t}\n\t\t\t}\t\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"(NetAPI) Connection failed to stream \" + e.getMessage());\n\t\t}\n\t\t\n\t\tSystem.out.println(\"(NetAPI) Closing packet thread\");\n\t}", "@Override\r\n\tpublic void run() {\n\t\tString msg;\r\n\t\ttry\r\n\t\t{\r\n\t\t\twhile(true)\r\n\t\t\t{\r\n\t\t\t\t\tBufferedReader inFromClient =\r\n\t\t\t\t new BufferedReader(new InputStreamReader(socket.getInputStream()));\r\n\t\t\t\t DataOutputStream outToClient = new DataOutputStream(socket.getOutputStream());\r\n\t\t\t\t \r\n\t\t\t\t String clientSentence;\r\n\t\t\t\t while((clientSentence = inFromClient.readLine())!=null)\r\n\t\t\t\t {\t\r\n\t\t\t\t\t System.out.println(\"Received: \" + clientSentence);\r\n\t\t\t\t\t System.out.println(\"port: \" + socket.getPort());\r\n\r\n\t\t\t\t\t String newsentence = clientSentence + '\\n';\r\n\t\t\t\t\t outToClient.writeBytes(\"Server: \"+newsentence);\r\n\t\t\t\t\t \r\n\t\t\t\r\n\t\t\t\t }\r\n//\t\t\t\t \r\n//\t\t\t\t\treader.close();\r\n//\t\t\t\t\tinFromClient.close();\r\n//\t\t\t\t\toutToClient.close();\r\n//\t\t\t\t\tsocket.close();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(SocketException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Client has Disconnected\");\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "protected void stop() {\n keepGoing = false;\n // connect to myself as Client to exit\n try {\n new Socket(\"localhost\", port);\n } catch(Exception e) {\n // exception handling\n }\n }", "@Override\n\tpublic void run() {\n\t\n\t\tboolean finMsg = false;\n\n \n \n\t\ttry {\n\t\t\t\n\t\t DataInputStream is = new DataInputStream(socket.getInputStream());\n DataOutputStream os = new DataOutputStream(socket.getOutputStream()); \n\t\t\t\n\t\t\twhile (!finMsg) {\n\t\t\t\t\n\t\t\tString[] client_Msg = is.readUTF().split(\" \");\n\t\t\t\t\n\t\t\tswitch (client_Msg[1]) {\n\t\t\t\n\t\t\t\tcase \"REG\":\n\t\t\t\t\thandleRegister(client_Msg, os);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"RDY\":\n\t\t\t\t\thandleReady(client_Msg, os);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"MOV\":\n\t\t\t\t\thandleMove(client_Msg, os);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\tcase \"FIN\":\n\t\t\t\t\tsocket.close();\n\t\t\t\t\tfinMsg=true;\n\t\t\t\t\tbreak;\n\t\t\t \n\t\t\t\n\t\t\t\t}\n\t\t\n\t\t \n\t\t\t}\n\t\t\t\t\n\t\t}catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\tif (FrameworkHandler.DEBUG_MODE){\n\t\t\tString strType = \"\";\n\t\t\tif (type == RULE_CONNECTION) strType = \"New RemoteRule Listener\";\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(strType + \" LISTENING on port: \" + listeningSocket.getLocalPort());\n\t\t}\n\t\ttry {\n\t\t\twhile (running) {\n\t\t\t\tSocket newSocket = listeningSocket.accept();\n\t\t\t\t\n\t\t\t\tif (FrameworkHandler.DEBUG_MODE)\n\t\t\t\t\tSystem.out.println(\"New request obtained on \" + newSocket.getPort() + \"|\" + newSocket.getLocalPort());\n\t\t\t\t\n\t\t\t\tcreateNewConnection(newSocket);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tFrameworkHandler.exceptionLog(FrameworkHandler.LOG_ERROR, this, e);\n\t\t}\n\t}", "@Override\n public void run() {\n P.print(\"Receive thread starts up.\");\n try {\n ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());\n while (P.choke_thread_running) { //read input forever.\n try{\n Object o = ois.readObject(); //blocking.\n if (o instanceof Handshake) { // this is a Handshake.\n Handshake hs = (Handshake)o;\n P.print(\"Received handshake from \"+hs.pid);\n }\n else if(o instanceof Message){ //this is a Message.\n Message M = (Message) o;\n if(M.type==0){\n P.print(\"Received choke from \"+t.getName());\n }\n else if(M.type==1){\n P.print(\"Received unchoke from \"+t.getName());\n }\n else if(M.type==2){\n P.print(\"Received interested from \"+t.getName());\n }\n else if(M.type ==3){\n P.print(\"Received not_interested from \"+t.getName()); \n }\n else if(M.type==4){\n P.print(\"Received have from \"+t.getName());\n }\n else if(M.type==5){\n P.print(\"Received bitfield from \"+t.getName());\n }\n else if(M.type==6){\n P.print(\"Received request from \"+t.getName());\n }\n else if(M.type==7){\n P.print(\"Received piece from \"+t.getName());\n }\n else{\n P.print(\"Error: undefined message type: \"+M.type);\n }\n }\n else {\n System.out.println(\"Class not found.\");\n }\n }\n catch(ClassNotFoundException ex){\n ex.printStackTrace();\n }\n }\n ois.close();\n socket.close();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "@Override\n public void run() {\n this.running.set(true);\n Socket socket = null;\n // if flag is set to listen, keep listening for client connection request and keep accepting connections\n while (this.running.get()) {\n try {\n if (connectionCount.get() < Constants.MAX_CLIENT_CONNECTIONS) {\n socket = serverSocket.accept();\n socket.setSoTimeout(30000); // timeout set to 30,000 ms\n socket.setKeepAlive(true);\n log.info(\"Connection Accepted: Local Add {} Remote Add {}\", socket.getLocalAddress(),\n socket.getRemoteSocketAddress());\n // add the connected socket to the list\n socketList.add(socket);\n // Pass the socket to the RequestHandler thread for processing\n IncomingMessageHandler messageHandler = new IncomingMessageHandler(socket, logWriter, fileWriterQueue,\n periodicReportingService, orderShutdown);\n messageHandler.start();\n connectionCount.getAndIncrement();// increment connection count\n log.debug(\"Current number of connections {}\", connectionCount.get());\n } else {\n if(maxConnWarnCount < 4) {\n log.warn(\"Reached maximum connection limit {}; Stopping to accept more client connections\"\n , connectionCount.get());\n maxConnWarnCount++;\n }\n }\n } catch (IOException e) {\n log.error(\"Error in accepting connections\", e);\n if (e instanceof SocketException) {\n log.error(\"SocketException for remote connection\");\n }\n }\n }\n }", "public void init() throws IOException {\r\n try {\r\n serverSocket = new ServerSocket(PORT);\r\n this.running = true;\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n }", "public void run() {\r\n BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();\r\n adapter.cancelDiscovery();\r\n try {\r\n btSocket.connect();\r\n Log.d(\"TAG\", \"Device connected\");\r\n isConnected = true;\r\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);\r\n SharedPreferences.Editor edit = preferences.edit();\r\n edit.putBoolean(\"Connection\", isConnected);\r\n edit.apply();\r\n handler.obtainMessage(CONNECTING_STATUS, 1, -1).sendToTarget();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n try {\r\n isConnected = false;\r\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);\r\n SharedPreferences.Editor edit = preferences.edit();\r\n edit.putBoolean(\"Connection\", isConnected);\r\n edit.apply();\r\n btSocket.close();\r\n handler.obtainMessage(CONNECTING_STATUS, -1,-1).sendToTarget();\r\n } catch (IOException f) {\r\n f.printStackTrace();\r\n }\r\n return;\r\n }\r\n //Perform work from connection in a separate thread\r\n connectedThread = new ConnectedThread(btSocket);\r\n connectedThread.run();\r\n }", "@Override\n\t\tpublic void run()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\twhile (keepListening)\n\t\t\t\t{\n\t\t\t\t\tString rcvStr = is.readLine();\n\t\t\t\t\t\n\t\t\t\t\t//We must make sure that this packet has been sent here correctly.\n\t\t\t\t\tif (rcvStr != null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//TO-DO parse message here and notify controller\n\t\t\t\t\t\t//just transmit it to controller.\n\t\t\t\t\t\tSystem.out.println(\"receive reply : \" + rcvStr);\n\t\t\t\t\t\tmyController.parseResponse(rcvStr);\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t//The receive String is null means that this connection is broken.\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"at ControlChannel listenRunnable : receive null response\");\n\t\t\t\t\t\tkeepListening = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "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 }", "@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}", "private WebSocketConnection() {\n this.pendingMessages = false;\n this.isClosed = false;\n this.outBuffer = new LinkedList<Payload>();\n this.internalLock = new Object();\n\n this.writerThread = new Thread(new Runnable() {\n @Override\n public void run() {\n synchronized (internalLock) {\n while (true) {\n if (!pendingMessages) {\n try {\n internalLock.wait();\n } catch (InterruptedException e) {\n // This should never happen\n }\n }\n\n pendingMessages = false;\n\n if (socket.isClosed()) {\n return;\n } else {\n while (outBuffer.size() > 0) {\n Payload payload = outBuffer.removeFirst();\n int opcode = payload.getOpcode();\n byte[] data = payload.getData();\n\n try {\n send(opcode, data);\n } catch (IOException e) {\n // Reader thread will notify this\n // exception\n // This thread just need to stop\n return;\n }\n }\n }\n }\n }\n }\n });\n }", "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 }" ]
[ "0.6765155", "0.67037886", "0.6659245", "0.6506788", "0.6489337", "0.64738077", "0.64663345", "0.6435698", "0.6424155", "0.63715667", "0.63713306", "0.63208234", "0.62999254", "0.6295777", "0.62770975", "0.62697583", "0.626149", "0.6253985", "0.62508345", "0.62452", "0.62108517", "0.6199771", "0.6165516", "0.61579984", "0.6155508", "0.6130174", "0.6118714", "0.611638", "0.61093754", "0.6086109", "0.6078504", "0.6078322", "0.60739547", "0.6073732", "0.60580707", "0.60522836", "0.60431504", "0.603297", "0.60259104", "0.6010792", "0.60093105", "0.6000706", "0.5987532", "0.59756345", "0.59749067", "0.5971216", "0.5967636", "0.5961655", "0.5948474", "0.59398746", "0.59398234", "0.5936317", "0.59312946", "0.59269047", "0.5919117", "0.5918972", "0.5918331", "0.5908502", "0.5901779", "0.58966684", "0.5882344", "0.58755344", "0.5871451", "0.5867958", "0.58630437", "0.5862917", "0.58527505", "0.58522975", "0.5850555", "0.58425653", "0.58412135", "0.5822414", "0.5819022", "0.58143485", "0.5810703", "0.5802696", "0.58007324", "0.5783095", "0.5772703", "0.5767687", "0.5766336", "0.5765631", "0.5764942", "0.5753671", "0.575078", "0.5730002", "0.5729929", "0.57262915", "0.572241", "0.57106256", "0.5705221", "0.56990564", "0.5696703", "0.5689379", "0.56867695", "0.56802595", "0.5678472", "0.5678082", "0.5676479", "0.56734", "0.5669924" ]
0.0
-1
Creates a new instance of MessageArgsTableModel
public MessageArgsTableModel() { int PRE_POPULATED_SIZE = 10; argList = new ArrayList<>(); for (int i = 0; i < PRE_POPULATED_SIZE; i++) { argList.add(""); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private ByaTableModel() {\n\t}", "public DebugTableModel() {\r\n }", "public JTable create() {\n\n Object[] colName = null;\n int columnsNumber = 0;\n\n columnsNumber = 2;\n colName = new Object[columnsNumber];\n\n colName[0] = MessagesManager.get(\"name\");\n colName[1] = MessagesManager.get(\"value\");\n\n Properties p = System.getProperties();\n\n Enumeration keys = p.keys();\n\n List<String> listKeys = new Vector<String>();\n\n while (keys.hasMoreElements()) {\n String key = (String) keys.nextElement();\n listKeys.add(key);\n }\n\n Collections.sort(listKeys);\n\n Object[][] data = new Object[listKeys.size()][columnsNumber];\n\n for (int i = 0; i < listKeys.size(); i++) {\n String key = listKeys.get(i);\n String value = p.getProperty(key);\n\n data[i][0] = key;\n data[i][1] = value;\n\n }\n\n // TableSorter is a tool class to sort columns by clicking on headers\n TableSorter sorter = new TableSorter(new TableModelNonEditable(data, colName));\n\n // We will create out own getCellRenderer() in the JTable, so that it can call\n // PgeepTableCellRenderer\n// JTable jTable1 = new JTable(sorter) \n// {\n// public TableCellRenderer getCellRenderer(int row, int column) \n// {\n// return new PgeepTableCellRenderer(owner);\n// } \n// };\n\n JTable jTable1 = new JTable(sorter);\n\n // Set the Table Header Display\n Font fontHeader = new Font(m_font.getName(), Font.PLAIN, m_font.getSize());\n JTableHeader jTableHeader = jTable1.getTableHeader();\n jTableHeader.setFont(fontHeader);\n sorter.setTableHeader(jTableHeader);\n\n jTable1.setFont(m_font);\n jTable1.setColumnSelectionAllowed(false);\n jTable1.setRowSelectionAllowed(true);\n jTable1.setAutoscrolls(true);\n\n //jTable1.setColumnModel(new MyTableColumnModel());\n //jTable1.setAutoCreateColumnsFromModel(true);\n\n jTable1.setShowHorizontalLines(false);\n jTable1.setShowVerticalLines(true);\n\n jTable1.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);\n\n // Resize last column (if necessary)\n jTable1.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);\n\n // use an Expansion factor of 1.3x for change between 12 and Arial,17 \n JTableUtil.calcColumnWidths(jTable1, 1.00);\n\n return jTable1;\n }", "private DefaultTableModel createModel() {\n List list = getDefaultInitialData();//obtenemos toda la lista a mostrar\n Vector data = new Vector();//vector tabla\n if (list != null) {\n for (Object o : list) {\n Vector columnas = new Vector();//columnas para llenar la tabla\n //lenar el vector columna\n Object object = null;\n for (Object x : title) {\n try {\n object = o.getClass().getMethod(\"get\" + convertir(x.toString()), new Class[]{}).invoke(o);\n columnas.add(object);\n } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {\n Logger.getLogger(JCAbstractXTable.class.getName()).log(Level.SEVERE, null, e);\n }\n }\n data.add(columnas);\n }\n }\n return new DefaultTableModel(data, nameColumn());\n }", "public ButtonAssignmentTableModel() { }", "private void createTableArea() {\n\t\tthis.tableModel = new MessagesTableModel();\n\t\tthis.conversation = new JTable(this.tableModel);\n\t\tthis.conversation.setRowSelectionAllowed(false);\n\t\tthis.conversation.getColumn(\"Pseudo\").setMaxWidth(150);\n\t\tthis.conversation.getColumn(\"Message\").setWidth(200);\n\t\tthis.conversation.getColumn(\"Heure\").setMaxWidth(50);\n\t\tthis.conversation.getColumn(\"Message\").setCellRenderer(new WrapTableCellRenderer());\n\t\tthis.conversation.getColumn(\"Pseudo\").setCellRenderer(new ColorTableCellRenderer());\n\t\tthis.scrollPane = new JScrollPane(conversation);\n\t}", "public FixedTableDialog(final Frame window,\r\n final FixedTableModel tableModel) {\r\n\r\n\r\n super(window, \"\", true);\r\n\r\n this.setResizable(false);\r\n\r\n m_TableModelOrg = tableModel;\r\n m_TableModel = FixedTableModel.newInstance(tableModel);\r\n\r\n initGUI();\r\n }", "public void inboxTable()\r\n\t{\r\n\t\tArrayList columnNames = new ArrayList();\r\n\t\tArrayList data = new ArrayList();\r\n\t\tDefaultTableModel model = new DefaultTableModel(new String[]{\"mailID\", \"From\", \"Subject\", \"Time Sent\"}, 0 );\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tString query = \"select mailID, sender, mailSubject, date_format(timeSent, \\\"%b %d %a %r\\\") as timeSent from mails where mailType = 's' and recipient = ? order by timeSent DESC\";\r\n\t\t\tpreparedStatement = connect.prepareStatement(query);\r\n\t\t\tpreparedStatement.setString(1, email_address);\r\n\t\t\tresultSet = preparedStatement.executeQuery();\r\n\t\t\t\r\n\t\t\t/*\r\n\t\t\t * while the resultSet has another row returned, the columns returned from the database are stored and assigned added to a row in the table model\r\n\t\t\t * the data from each column from the database can be stored by getting the value at the column name in the database\r\n\t\t\t * when added to the row it will be in order of how the table model column names are shown.\r\n\t\t\t */\r\n\t\t\twhile(resultSet.next())\r\n\t\t\t{\r\n\t\t\t\tString col1 = resultSet.getString(\"mailID\");\r\n\t\t\t\tString col2 = resultSet.getString(\"sender\");\r\n\t\t\t String col3 = resultSet.getString(\"mailSubject\");\r\n\t\t\t String col4 = resultSet.getString(\"timeSent\");\r\n\t\t\t\tmodel.addRow(new Object[] {col1, col2, col3, col4});\r\n\t\t\t}\r\n\r\n\t\t\t/*\r\n\t\t\t * after the table model has been populated it is then placed in the inbox table\r\n\t\t\t * once the inbox table is populated we collapse the mailID column so that the data is not displayed but still be used to obtain data from the database\r\n\t\t\t * \r\n\t\t\t */\r\n\t\t\ttableInbox.setModel(model);\r\n\t\t\ttableInbox.getColumnModel().getColumn(0).setMinWidth(0);\r\n\t\t\ttableInbox.getColumnModel().getColumn(0).setMaxWidth(0);\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public PromocionTableModel() {\n \n //Establecemos la sentencia SQL que vamos a ejecutar\n super(\"SELECT ID_PROMOCION , NOMBRE, DESCUENTO FROM PROMOCION\");\n \n }", "public AttlistTableModel () {\n super();\n }", "public void ListModelCreator(String NombreLista, String NombreTabla) {\r\n ArrayList<String> Atributos = new ArrayList();\r\n System.out.println(\"\");\r\n System.out.println(\"DefaultTableModel model = new DefaultTableModel();\");\r\n int NumVariables = this.Num_Atributes;\r\n String Lista = NombreLista;\r\n for (int i = 0; i < NumVariables; i++) {\r\n String Dato = this.DeclaredFields[i].getName();\r\n Atributos.add(Dato);\r\n System.out.println(\"model.addColumn(\\\"\"\r\n + Dato + \"\\\");\");\r\n }\r\n System.out.println(\"if (\" + Lista + \".size() >= 0) {\");\r\n System.out.println(\"Object[] o = new Object[model.getColumnCount()];\");\r\n System.out.println(\"for (int i = 0; i < \" + Lista + \".size(); i++) {\");\r\n for (int i = 0; i <= NumVariables; i++) {\r\n try {\r\n System.out.println(\"o[\" + i + \"] = \" + Lista + \".get(i).get\" + Atributos.get(i) + \"();\");\r\n } catch (Exception e) {\r\n }\r\n\r\n }\r\n System.out.println(\"model.addRow(o);\");\r\n System.out.println(\"}\");\r\n System.out.println(\"}\");\r\n String Tabla = NombreTabla;\r\n System.out.println(Tabla + \".setModel(model);\");\r\n }", "public TestFrame() {\n\n final String[] columnNames = {\"Nombre\",\n \"Apellido\",\n \"webeo\",\n \"Años de Practica\",\n \"Soltero(a)\"};\n final Object[][] data = {\n\n {\"Lhucas\", \"Huml\",\n \"Patinar\", new Integer(3), new Boolean(true)},\n {\"Kathya\", \"Walrath\",\n \"Escalar\", new Integer(2), new Boolean(false)},\n {\"Marcus\", \"Andrews\",\n \"Correr\", new Integer(7), new Boolean(true)},\n {\"Angela\", \"Lalth\",\n \"Nadar\", new Integer(4), new Boolean(false)}\n };\n\n Vector dataV1 = new Vector();\n dataV1.add(\"XXXX\");\n dataV1.add(\"YYYY\");\n dataV1.add(\"JJJJ\");\n\n Vector dataV2 = new Vector();\n dataV2.add(\"XX2XX\");\n dataV2.add(\"Y2YYY\");\n dataV2.add(\"J2JJJ\");\n\n List dataF = new ArrayList();\n dataF.add(dataV1);\n dataF.add(dataV2);\n\n /*Vector dataC = new Vector();\n dataC.add(\"1\");\n dataC.add(\"2\");\n dataC.add(\"J23JJJ\");\n\n //model = new ModeloDatosTabla(data, true);\n model = new TableModel_1_1(dataC, dataF);\n model2 = new TableModel(columnNames, data, false);\n*/\n\n\n\n initComponents();\n\n\n }", "@SuppressWarnings(\"unused\")\n public static ChatMsgFragment newInstance(int columnCount) {\n ChatMsgFragment fragment = new ChatMsgFragment();\n return fragment;\n }", "ReturnTable(TableModel dm) {\n super(dm);\n }", "@NotNull\n public static TableModel createLongTableModel ( final boolean editable )\n {\n return new SampleTableModel ( editable, 12 );\n }", "private void Table()\n{\n Object [] Kolom = {\"Nama\", \"No. Telp\", \"Kota Asal\"};\n Table = new DefaultTableModel(null, Kolom);\n Tabel.setModel(Table);\n}", "public JP1Table( TableModel model )\n {\n super( model );\n setSelectionMode( ListSelectionModel.SINGLE_SELECTION );\n // getSelectionModel().addListSelectionListener( this );\n setCellSelectionEnabled( true );\n setSurrendersFocusOnKeystroke( true );\n setAutoResizeMode( JTable.AUTO_RESIZE_LAST_COLUMN );\n tableHeader.setReorderingAllowed( false );\n DefaultCellEditor e = ( DefaultCellEditor )getDefaultEditor( String.class );\n new TextPopupMenu( ( JTextComponent )e.getComponent() );\n }", "public LayoutClassTable(TableModel tableModel, String[] columnNames)\n {\n super(tableModel);\n\n this.columnNames = columnNames;\n }", "public void draftsTable()\r\n\t{\r\n\t\tArrayList columnNames = new ArrayList();\r\n\t ArrayList data = new ArrayList();\r\n\t DefaultTableModel model = new DefaultTableModel(new String[]{\"mailID\", \"To\", \"Subject\", \"timeSent\"}, 0);\r\n\t \r\n\t\ttry\r\n\t\t{\r\n\t\t\tString query = \"select mailID, recipient, mailSubject, date_format(timeSent, \\\"%b %d %a %r\\\") as timeSent from mails where mailType = 'd' and sender = ? order by timeSent DESC\";\r\n\t\t\tpreparedStatement = connect.prepareStatement(query);\r\n\t\t\tpreparedStatement.setString(1, email_address);\r\n\t\t\tresultSet = preparedStatement.executeQuery();\r\n\t\t\t\r\n\t\t\t/*\r\n\t\t\t * while the resultSet has another row returned, the columns returned from the database are stored and assigned added to a row in the table model\r\n\t\t\t * the data from each column from the database can be stored by getting the value at the column name in the database\r\n\t\t\t * when added to the row it will be in order of how the table model column names are shown.\r\n\t\t\t */\r\n\t\t\twhile(resultSet.next())\r\n\t\t\t{\r\n\t\t\t\tString col1 = resultSet.getString(\"mailID\");\r\n\t\t\t\tString col2 = resultSet.getString(\"recipient\");\r\n\t\t\t String col3 = resultSet.getString(\"mailSubject\");\r\n\t\t\t String col4 = resultSet.getString(\"timeSent\");\r\n\t\t\t model.addRow(new Object[]{col1, col2, col3, col4});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/*\r\n\t\t\t * after the table model has been populated it is then placed in the draft table\r\n\t\t\t * once the draft table is populated we collapse the mailID column so that the data is not displayed but still be used to obtain data from the database\r\n\t\t\t * \r\n\t\t\t */\r\n\t\t\ttableDraft.setModel(model);\r\n\t\t\ttableDraft.getColumnModel().getColumn(0).setMinWidth(0);\r\n\t\t\ttableDraft.getColumnModel().getColumn(0).setMaxWidth(0);\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t}", "public DefaultTableColumnModelExt() {\r\n super();\r\n }", "public CustomJTable(final String[] columnnames, final int[] columnsizes, final Object[][] data) { \n super();\n dataModel = new AbstractTableModel() {\n // Met de volgende functies wordt het tablemodel gemaakt, niets wijzigen\n /**\n * Haalt het aantal kolommen op\n */\n @Override\n public int getColumnCount() { return columnnames.length; }\n /**\n * Haalt het aantal rijen op\n */\n @Override\n public int getRowCount() { return data.length; }\n /**\n * Haalt een bepaalde waarde op van een rij en een kolom (beide als intergers opgeven)\n * @param row Interger van de rij\n * @param column Interger van de kolom\n */\n @Override\n public Object getValueAt(int row, int column) { return data[row][column]; }\n /**\n * Haal de kolomnaam op\n * @param column Interger van de kolom\n */\n @Override\n public String getColumnName(int column) { return columnnames[column]; }\n /**\n * Zet een waarde op de plaats van een rij en een kolom (beide als intergers opgeven)\n * @param value Waarde die geplaatst moet worden\n * @param row Interger van de rij van de plaats\n * @param colum Interger van de kolom van de plaats\n */\n @Override\n public void setValueAt(Object value, int row, int column) { data[row][column] = value; }\n };\n this.setSize(800, 600);\n this.setModal(true);\n this.setLayout(new BorderLayout());\n \n // Vult de tabel aan\n jTable = new javax.swing.JTable(dataModel);\n jTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);\n // Implementeer de grote van de kolommen\n for (int i = 0; i <= (dataModel.getColumnCount() - 1); i++) {\n jTable.getColumnModel().getColumn(i).setPreferredWidth(columnsizes[i]);\n }\n \n // Voegt de tabel toe aan het panel in een scrollpane\n this.add(new JScrollPane(jTable));\n \n ListSelectionModel listMod;\n // Dit is de list selectioner, die kijkt of je iets selecteert\n listMod = jTable.getSelectionModel();\n // Hierdoor kan je maar 1 regel selecteren\n listMod.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n // Voegt de listener toe aan het frame\n listMod.addListSelectionListener(this);\n\n Center.add(new JScrollPane(jTable));\n South.add(selecteer);\n selecteer.addActionListener(this);\n \n this.add(North, BorderLayout.NORTH);\n this.add(Center, BorderLayout.CENTER);\n this.add(South, BorderLayout.SOUTH);\n this.setVisible(true);\n }", "public DataTableModel() {\n super();\n LanguageObservable.getInstance().attach(this);\n setLocalizedResourceBundle(\"ch.ethz.origo.jerpa.jerpalang.perspective.ededb.EDEDB\");\n initColumns();\n data = new LinkedList<DataRowModel>();\n }", "public ColumnStateTableColumnModel() {\n\t}", "private void criaJTable() {\n tabela = new JTable(modelo);\n modelo.addColumn(\"Codigo:\");\n modelo.addColumn(\"Data inicio:\");\n modelo.addColumn(\"Data Fim:\");\n modelo.addColumn(\"Valor produto:\");\n modelo.addColumn(\"Quantidade:\");\n\n preencherJTable();\n }", "public BasicTableModel() {\n\t\tcolNames = new ArrayList<String>();\n\t\tdata = new ArrayList<List>();\n\t}", "public GenericTableModel(String[] columns) {\r\n\t\tsuper();\r\n\t\t\r\n\t\tlogger.trace(\"Enter GenericTableModel\");\r\n\t\t\r\n\t\tthis.columns = columns;\r\n\t\t\r\n\t\tlogger.trace(\"Exit GenericTableModel\");\r\n\t}", "public void crearModelo() {\n modeloagr = new DefaultTableModel(null, columnasAgr) {\n public boolean isCellEditable(int fila, int columna) {\n return false;\n }\n };\n tbl.llenarTabla(AgendarA.tblAgricultor, modeloagr, columnasAgr.length, \"SELECT idPersonalExterno,cedula,CONCAT(nombres,' ',apellidos),municipios.nombre,telefono,telefono2,telefono3 FROM personalexterno,municipios WHERE tipo='agricultor' AND personalexterno.idMunicipio=municipios.idMunicipio\");\n tbl.alinearHeaderTable(AgendarA.tblAgricultor, headerColumnas);\n tbl.alinearCamposTable(AgendarA.tblAgricultor, camposColumnas);\n tbl.rowNumberTabel(AgendarA.tblAgricultor);\n }", "public ResultsTable() {\n// this.achievementsArr = new ArrayList <Achievement>();\n initComponents();\n resultsTable = (DefaultTableModel) rTable.getModel();\n }", "public UIBuilder getNewInstance(Map<String, Object> entries);", "@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 jTableMessages = new javax.swing.JTable();\n\n jTableMessages.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Recipient\", \"Snippet\", \"Time\", \"Message Id\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false, false, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n jTableMessages.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jTableMessagesMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(jTableMessages);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE)\n );\n }", "public TabellaModel() {\r\n lista = new Lista();\r\n elenco = new Vector<Persona>();\r\n elenco =lista.getElenco();\r\n values = new String[elenco.size()][3];\r\n Iterator<Persona> iterator = elenco.iterator();\r\n while (iterator.hasNext()) {\r\n\t\t\tfor (int i = 0; i < elenco.size(); i++) {\r\n\t\t\t\tpersona = new Persona();\r\n\t\t\t\tpersona = (Persona) iterator.next();\r\n\t\t\t\tvalues[i][0] = persona.getNome();\r\n\t\t\t\tvalues[i][1] = persona.getCognome();\r\n\t\t\t\tvalues[i][2] = persona.getTelefono();\t\r\n\t\t\t}\r\n\t\t}\r\n setDataVector(values, columnNames);\t\r\n }", "public ProjectTableModel(ArrayList<Project> prjs) {\n\t\t\tint rows = prjs.size();\n\t\t\t\n\t\t\tObject[][] data = null;\n\t\t\tString[] colNames = null;\n\t\t\tObject[] delOpt = new Object[rows];\n\t\t\t\n\t\t\tif(rows > 0) {\n\t\t\t\tif(prjs.get(0) instanceof OngoingProject) {\n\t\t\t\t\tdata = new Object[rows][ONGOING_COL_NAMES.length];\n\t\t\t\t\tcolNames = ONGOING_COL_NAMES;\n\t\t\t\t} else if(prjs.get(0) instanceof FinishedProject) {\n\t\t\t\t\tdata = new Object[rows][FINISHED_COL_NAMES.length];\n\t\t\t\t\tcolNames = FINISHED_COL_NAMES;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor(int i=0;i<rows;i++) {\n\t\t\t\tdata[i] = prjs.get(i).toTable();\n\t\t\t\tdelOpt[i] = new Boolean(true);\n\t\t\t}\n\t\t\t\n\t\t\tsuper.setDataVector(data, (Object[]) colNames);\n\t\t\tthis.addColumn(\"\", delOpt);\n\t\t\t\t\t\n\t\t}", "private void initTable(DefaultTableModel dmodel) {\n\t\tString[] COLUMN_NAMES = new String[] { \"#\", \"Date\", \"Product ID\", \"Name\", \"Quantity\", \"Total\" };\n\t\tfor (String string : COLUMN_NAMES)\n\t\t\tdmodel.addColumn(string);\n\t}", "private void carregarTabela() {\n try {\n\n Vector<String> cabecalho = new Vector();\n cabecalho.add(\"Id\");\n cabecalho.add(\"Nome\");\n cabecalho.add(\"Telefone\");\n cabecalho.add(\"Titular\");\n cabecalho.add(\"Data de Nascimento\");\n\n Vector detalhe = new Vector();\n\n for (Dependente dependente : new NDependente().listar()) {\n Vector<String> linha = new Vector();\n\n linha.add(dependente.getId() + \"\");\n linha.add(dependente.getNome());\n linha.add(dependente.getTelefone());\n linha.add(new NCliente().consultar(dependente.getCliente_id()).getNome());\n linha.add(dependente.getDataNascimento().toString());\n detalhe.add(linha);\n\n }\n\n tblDependentes.setModel(new DefaultTableModel(detalhe, cabecalho));\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, e.getMessage());\n }\n\n }", "private void createTable() {\n\t\t// Tao dataModel & table \n\t\tdataModel = new DefaultTableModel(headers, 0);\n\t\ttable.setModel(dataModel);\n\t\t\n\t\tnapDuLieuChoBang();\n\t}", "public Gui(Agent a ) {\n clientAgent=(ClientAgent)a;\n initComponents(); \n this.setVisible(true);\n String title[] = new String[]{\"Id\", \"Nom Produit\"};\n Object data[][] = new Object[][]{\n {\"1\", \"Carotte\"}, {\"2\", \"Poireau\"}, {\"4\", \"Brie\"}, {\"5\", \"Comté\"},\n {\"6\", \"Lait\"}, {\"7\", \"Bière\"}, {\"8\", \"Eau\"}, {\"9\", \"Coca\"}, {\"10\", \"Javel\"}\n };\n\n tableProduits.setModel(new DefaultTableModel(data, title));\n \n }", "@SuppressWarnings({\"deprecation\", \"rawtypes\", \"unchecked\"})\n public static <S, T> javafx.scene.control.cell.TextFieldTableCellBuilder<S, T, ?> create() {\n return new javafx.scene.control.cell.TextFieldTableCellBuilder();\n }", "public addConstructor() {\n\n\n \n initComponents();\n\n DefaultTableModel dt = (DefaultTableModel) tble.getModel();\n dt.setRowCount(0);\n\n try{\n Statement state = DB.getCon().createStatement();\n ResultSet rset = state.executeQuery(\"SELECT * FROM contractor \");\n\n while(rset.next()){\n Vector v = new Vector();\n v.add(rset.getString(\"ContractorID\"));\n v.add(rset.getString(\"CompanyName\"));\n v.add(rset.getString(\"CompanyAddress\"));\n\n dt.addRow(v);\n }\n } catch(Exception e) {\n System.out.println(e);\n }\n\n\n }", "public ABMTiposDesvios() {\n super(new TiposDesviosT());\n initComponents();\n btnBorrar.setEnabled(false);\n HashMap parametros = new HashMap();\n List<TiposDesviosT> nuevo = DesktopApp.getApplication().getTiposDesviosT(parametros);\n setListDto((ArrayList<TiposDesviosT>) nuevo);\n\n tableModel = new TiposDesviosTableModel(columnNames, this.getListDto());\n tableModel.addTableModelListener(new CustomTableModelListener());\n tiposDesviosTable.setModel(tableModel);\n\n sorter = new TableRowSorter<TableModel>(tableModel) {\n\n @Override\n public void toggleSortOrder(int column) {\n RowFilter<? super TableModel, ? super Integer> f = getRowFilter();\n setRowFilter(null);\n super.toggleSortOrder(column);\n setRowFilter(f);\n }\n };\n tiposDesviosTable.setRowSorter(sorter);\n\n setModificado(false);\n setNuevo(false);\n txtMotivo.setEnabled(false);\n\n if (getPadre() == null) {\n btnSeleccionar.setEnabled(false);\n }\n\n parametros = new HashMap();\n\n tiposDesviosTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n }", "private void buildTable() {\n\t\tObservableList<Record> data;\r\n\t\tdata = FXCollections.observableArrayList();\r\n\r\n\t\t// get records from the database\r\n\t\tArrayList<Record> list = new ArrayList<Record>();\r\n\t\tlist = getItemsToAdd();\r\n\r\n\t\t// add records to the table\r\n\t\tfor (Record i : list) {\r\n\t\t\tSystem.out.println(\"Add row: \" + i);\r\n\t\t\tdata.add(i);\r\n\t\t}\r\n\t\ttableView.setItems(data);\r\n\t}", "@Override\n\tpublic void createAddArgumentViewForFunctions(List<CQLFunctionArgument> argumentList) {\n\t\tcellTablePanel.clear();\n\t\tcellTablePanel.setStyleName(\"cellTablePanel\");\n\t\tisEditable = MatContext.get().getMeasureLockService().checkForEditPermission();\n\t\t\n\t\tif ((argumentList != null) && (argumentList.size() > 0)) {\n\t\t\tupdateFunctionArgumentNameMap(argumentList);\n\t\t\targumentListTable = new CellTable<CQLFunctionArgument>();\n\t\t\targumentListTable.setStriped(true);\n\t\t\targumentListTable.setCondensed(true);\n\t\t\targumentListTable.setBordered(true);\n\t\t\targumentListTable.setHover(true);\n\t\t\t\n\t\t\targumentListTable.setPageSize(TABLE_ROW_COUNT);\n\t\t\targumentListTable.redraw();\n\t\t\tlistDataProvider = new ListDataProvider<CQLFunctionArgument>();\n\t\t\tlistDataProvider.refresh();\n\t\t\tlistDataProvider.getList().addAll(argumentList);\n\t\t\tListHandler<CQLFunctionArgument> sortHandler = new ListHandler<CQLFunctionArgument>(\n\t\t\t\t\tlistDataProvider.getList());\n\t\t\targumentListTable.addColumnSortHandler(sortHandler);\n\t\t\targumentListTable = addColumnToTable(argumentListTable, sortHandler);\n\t\t\tlistDataProvider.addDataDisplay(argumentListTable);\n\t\t\tCustomPager.Resources pagerResources = GWT.create(CustomPager.Resources.class);\n\t\t\tspager = new MatSimplePager(CustomPager.TextLocation.CENTER, pagerResources, false, 0, true);\n\t\t\tspager.setDisplay(argumentListTable);\n\t\t\tspager.setPageStart(0);\n\t\t\tcellTablePanel.add(argumentListTable);\n\t\t\t// cellTablePanel.add(new SpacerWidget());\n\t\t\tcellTablePanel.add(spager);\n\t\t} else {\n\t\t\tcom.google.gwt.user.client.ui.Label tableHeader = new com.google.gwt.user.client.ui.Label(\n\t\t\t\t\t\"Added Arguments List\");\n\t\t\ttableHeader.getElement().setId(\"tableHeader_Label\");\n\t\t\ttableHeader.setStyleName(\"measureGroupingTableHeader\");\n\t\t\ttableHeader.getElement().setAttribute(\"tabIndex\", \"0\");\n\t\t\tHTML desc = new HTML(\"<p> No Arguments Added.</p>\");\n\t\t\tcellTablePanel.add(tableHeader);\n\t\t\tcellTablePanel.add(new SpacerWidget());\n\t\t\tcellTablePanel.add(desc);\n\t\t}\n\t\t/*\n\t\t * } else { com.google.gwt.user.client.ui.Label tableHeader = new\n\t\t * com.google.gwt.user.client.ui.Label(\"Added Arguments List\");\n\t\t * tableHeader.getElement().setId(\"tableHeader_Label\");\n\t\t * tableHeader.setStyleName(\"measureGroupingTableHeader\");\n\t\t * tableHeader.getElement().setAttribute(\"tabIndex\", \"0\"); HTML desc =\n\t\t * new HTML(\"<p> No Arguments Added.</p>\");\n\t\t * cellTablePanel.add(tableHeader); cellTablePanel.add(new\n\t\t * SpacerWidget()); cellTablePanel.add(desc); }\n\t\t */\n\t\t\n\t}", "private void carregarTabela() {\n try {\n\n Vector<String> cabecalho = new Vector();\n cabecalho.add(\"Id\");\n cabecalho.add(\"Nome\");\n cabecalho.add(\"CPF\");\n cabecalho.add(\"Telefone\");\n cabecalho.add(\"Endereço\");\n cabecalho.add(\"E-mail\");\n cabecalho.add(\"Data de Nascimento\");\n\n Vector detalhe = new Vector();\n\n for (Cliente cliente : new NCliente().listar()) {\n Vector<String> linha = new Vector();\n\n linha.add(cliente.getId() + \"\");\n linha.add(cliente.getNome());\n linha.add(cliente.getCpf());\n linha.add(cliente.getTelefone());\n linha.add(cliente.getEndereco());\n linha.add(cliente.getEmail());\n linha.add(cliente.getData_nascimento().toString());\n detalhe.add(linha);\n\n }\n\n tblClientes.setModel(new DefaultTableModel(detalhe, cabecalho));\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, e.getMessage());\n }\n\n }", "private void createTable(){\n Object[][] data = new Object[0][8];\n int i = 0;\n for (Grupo grupo : etapa.getGrupos()) {\n Object[][] dataAux = new Object[data.length+1][8];\n System.arraycopy(data, 0, dataAux, 0, data.length);\n dataAux[i++] = new Object[]{grupo.getNum(),grupo.getAtletas().size(),\"Registar Valores\",\"Selecionar Vencedores\", \"Selecionar Atletas\"};\n data = dataAux.clone();\n }\n\n //COLUMN HEADERS\n String columnHeaders[]={\"Numero do Grupo\",\"Número de Atletas\",\"\",\"\",\"\"};\n\n tableEventos.setModel(new DefaultTableModel(\n data,columnHeaders\n ));\n //SET CUSTOM RENDERER TO TEAMS COLUMN\n tableEventos.getColumnModel().getColumn(2).setCellRenderer(new ButtonRenderer());\n tableEventos.getColumnModel().getColumn(3).setCellRenderer(new ButtonRenderer());\n tableEventos.getColumnModel().getColumn(4).setCellRenderer(new ButtonRenderer());\n\n //SET CUSTOM EDITOR TO TEAMS COLUMN\n tableEventos.getColumnModel().getColumn(2).setCellEditor(new ButtonEditor(new JTextField(), this.etapa));\n tableEventos.getColumnModel().getColumn(3).setCellEditor(new ButtonEditor(new JTextField(), this.etapa));\n tableEventos.getColumnModel().getColumn(4).setCellEditor(new ButtonEditor(new JTextField(), this.etapa));\n\n }", "public static void buildTable() {\r\n\t\t//This method keeps the user from editing the table\r\n\t\ttableModel = new DefaultTableModel() {\r\n\t\t\tprivate static final long serialVersionUID = 1L;\r\n\t\t\t@Override\r\n\t\t\tpublic boolean isCellEditable(int row, int column) {\r\n\t\t\t\t//All cells false\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\ttableModel.setNumRows(dblogic.getSize());\r\n\t\ttableModel.setColumnCount(COL_COUNT);\r\n\t\ttableModel.setColumnIdentifiers(columnNames);\r\n\t\ttable.setRowSelectionAllowed(true);\r\n\t\ttable.setColumnSelectionAllowed(false);\r\n\t\ttable.setDragEnabled(false);\r\n\t\ttable.getTableHeader().setReorderingAllowed(false);\r\n\t\ttable.setModel(tableModel);\r\n\r\n\t\t//Build rows\r\n\t\tfor (int i = 0; i < dblogic.getSize(); i++) {\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getLastName(), i, COL_LAST);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getFirstName(), i, COL_FIRST);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getPatronEmail(), i, COL_EMAIL);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getDOB(), i, COL_BIRTH);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getPatronSinceString(), i, COL_ADDED);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getAnniv().toString(), i, COL_ANNIV);\r\n\t\t}\r\n\t}", "TABLE createTABLE();", "MultTable() //do not use the name of the constructor for the name of another method\n {}", "public TableModel getTableModel() {\n\t\tfinal int numEach = calcMags.length+1;\n\t\tfinal int rows = probs.rowKeySet().size()*numEach;\n\t\tfinal int cols = 4;\n\t\treturn new AbstractTableModel() {\n\n\t\t\t@Override\n\t\t\tpublic int getRowCount() {\n\t\t\t\treturn rows;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic int getColumnCount() {\n\t\t\t\treturn cols;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic Object getValueAt(int rowIndex, int columnIndex) {\n\t\t\t\tif (rowIndex == 0)\n\t\t\t\t\treturn headers[columnIndex];\n\t\t\t\trowIndex -= 1;\n\t\t\t\tint m = rowIndex % numEach;\n\t\t\t\tint d = rowIndex / numEach;\n\t\t\t\t\n\t\t\t\tif (columnIndex == 0) {\n\t\t\t\t\tif (m == 0)\n\t\t\t\t\t\treturn durations[d].label;\n\t\t\t\t\telse if (m == 1)\n\t\t\t\t\t\treturn df.format(Date.from(startDate));\n\t\t\t\t\telse if (m == 2)\n\t\t\t\t\t\treturn \"through\";\n\t\t\t\t\telse if (m == 3)\n\t\t\t\t\t\treturn df.format(Date.from(endDates[d]));\n\t\t\t\t\telse\n\t\t\t\t\t\treturn \"\";\n\t\t\t\t} else {\n\t\t\t\t\tif (m >= calcMags.length)\n\t\t\t\t\t\treturn \"\";\n\t\t\t\t\tdouble mag = calcMags[m];\n\t\t\t\t\tif (columnIndex == 1) {\n\t\t\t\t\t\tif (m == minMags.length) {\n\t\t\t\t\t\t\treturn \"M ≥ Main (\" + ((float)mag) + \")\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"M ≥ \"+(float)mag;\n\t\t\t\t\t} else if (columnIndex == 2) {\n\t\t\t\t\t\tint lower = (int)(numEventsLower.get(durations[d], mag)+0.5);\n\t\t\t\t\t\tint upper = (int)(numEventsUpper.get(durations[d], mag)+0.5);\n\t\t\t\t\t\tint median = (int)(numEventsMedian.get(durations[d], mag)+0.5);\n\t\t\t\t\t\tif (upper == 0)\n\t\t\t\t\t\t\treturn \"*\";\n\t\t\t\t\t\treturn lower + \" to \" + upper + \", median \" + median;\n\t\t\t\t\t} else if (columnIndex == 3) {\n\n\t\t\t\t\t\tdouble prob = 100.0 * probs.get(durations[d], mag);\n\t\t\t\t\t\tString probFormatted;\n\t\t\t\t\t\tif (prob < 1.0e-6 && prob > 0.0) {\n\t\t\t\t\t\t\tprobFormatted = SimpleUtils.double_to_string (\"%.2e\", prob);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdouble probRounded = SimpleUtils.round_double_via_string (\"%.2e\", prob);\n\t\t\t\t\t\t\tprobFormatted = SimpleUtils.double_to_string_trailz (\"%.8f\", SimpleUtils.TRAILZ_REMOVE, probRounded);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn probFormatted + \" %\";\n\n\t\t\t\t\t\t//int prob = (int)(100d*probs.get(durations[d], mag) + 0.5);\n\t\t\t\t\t\t//if (prob == 0)\n\t\t\t\t\t\t//\treturn \"*\";\n\t\t\t\t\t\t//else if (prob == 100)\n\t\t\t\t\t\t//\treturn \">99 %\";\n\t\t\t\t\t\t//return prob+\" %\";\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t\t\n\t\t};\n\t}", "public void actionPerformed(ActionEvent event){\n tableModel.addRow(blank);\r\n }", "Rows createRows();", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\tnew JTableTest();\n\t\t\n\t\t\n\t}", "private JComponent createInfoTable() {\r\n\t\tm_model = new JETATableModel();\r\n\r\n\t\tString[] names = new String[2];\r\n\t\tnames[0] = I18N.getLocalizedMessage(\"Property\");\r\n\t\tnames[1] = I18N.getLocalizedMessage(\"Value\");\r\n\t\tm_model.setColumnNames(names);\r\n\r\n\t\tClass[] coltypes = new Class[2];\r\n\t\tcoltypes[0] = String.class;\r\n\t\tcoltypes[1] = String.class;\r\n\t\tm_model.setColumnTypes(coltypes);\r\n\r\n\t\treturn new javax.swing.JScrollPane(TableUtils.createBasicTablePanel(m_model, true));\r\n\t}", "public static Matrix buildMatrixFromCommandLine (){\n\n int M = 0;\n int N = 0;\n double[][] data;\n\n M = new Double(getDoubleWithMessage(\"Enter rows number: \")).intValue();\n N = new Double(getDoubleWithMessage(\"Enter columns number: \")).intValue();\n System.out.println(\"You have matrix: \" + M + \"x\" + N);\n\n data = new double[M][N];\n\n for (int i = 0; i < M; i++){\n System.out.println(\"Row: \" + i);\n for (int j = 0; j < N; j++){\n data[i][j] = getDoubleWithMessage(\"Column: \" + j);\n }\n }\n return new Matrix(data);\n }", "public Modello() {\r\n super();\r\n initComponents();\r\n setModalita(APPEND_QUERY);\r\n setFrameTable(tabModello);\r\n setNomeTabella(\"vmodello\");\r\n tMarcaDescrizione.setEnabled(false);\r\n }", "@Override\r\n\tpublic void initialize(URL arg0, ResourceBundle arg1) {\n\t\tTableColumn workflowName = new TableColumn(\"Name\");\r\n\t\t\r\n\t\tworkflowName.setCellValueFactory(\r\n new PropertyValueFactory<WorkflowEntry, String>(\"name\"));\r\n\t\t\r\n\t\tTableColumn info = new TableColumn(\"Info\");\r\n\t\t\r\n\t info.setCellValueFactory(\r\n new PropertyValueFactory<WorkflowEntry, String>(\"info\"));\r\n\t \r\n\t // Adding a button to tableView\r\n\t \r\n\t TableColumn actionCol = new TableColumn( \"Action\" );\r\n actionCol.setCellValueFactory( new PropertyValueFactory<>( \"DUMMY\" ) );\r\n \r\n\t\ttableView.getColumns().addAll(workflowName,info,actionCol);\r\n\r\n\t}", "private DefaultTableModel createModel( JList<String> list) {\n\t\t\n\t\tSystem.out.println(\"PlaylistPanel -> SearchMenuPanel\");\n\t\tString[] transferSong = SearchMenuPanel.search(list.getSelectedValue().toString(), panel.aSocket, panel.serverPort); \n\t\tSystem.out.println(\"SearchMenuPanel -> PlaylistPanel\");\n\t\t\n\t\tDefaultTableModel model = new DefaultTableModel(null, new String[]{\"Song Title\", \"Artist\", \"Album\"});\t\t\n\t\tmodel.setRowCount(0);\n\t\tfor (int i = 0; i < transferSong.length; i++)\n\t\t\tmodel.addRow(transferSong[i].split(\"_\"));\n\t\t\n\t\treturn model;\n\t}", "FromTable createFromTable();", "public NoFiringTableModel(String[] headers,Object[][] tabledata) {\n\t\tcolNames = headers;\n\t\tdata = tabledata;\n\t}", "public abstract void fromProto(Message message, TARGET row);", "public static Model newOf(Model model) {\n\t\tModel newModel = Model.newOf();\n\t\tnewModel.setTitle(model.getTitle());\n\t\tnewModel.setTableCode(model.getTableCode());\n\t\tnewModel.setDescription(model.getDescription());\n\t\treturn newModel;\n\t}", "GridDataModel create(int parentRow, GridDataModel parentModel);", "public CampTableModel() {\n setColumnIdentifiers(new Object[] { Text.CAMP_ID.text(), Text.CAMP_LOCATION.text(), Text.CAMP_NAME.text() });\n }", "public ObserverInterface() {\n\n data = new Object[][]{};\n\n msgCount = 0;\n record = new JTable(new DefaultTableModel(data, columnNames));\n JScrollPane scrollPane = new JScrollPane(record);\n\n mainPanel = new JPanel(new GridLayout(1, 1));\n\n mainPanel.add(scrollPane);\n }", "public ChartTableModel(int rows) {\n this.data = new Object[rows][7];\n }", "public TimetableItemCellSizer(TableModel table_model){\n this.table_model = table_model;\n }", "public IDNameObjectSelectionTableModel(String... columnNames) {\r\n\t\tsuper(columnNames);\r\n\t}", "public TableViewFactory() {\n }", "public EditingTable() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "public CreateTable_args(CreateTable_args other) {\r\n if (other.isSetHost()) {\r\n this.host = other.host;\r\n }\r\n if (other.isSetDatabase()) {\r\n this.database = other.database;\r\n }\r\n if (other.isSetUserName()) {\r\n this.userName = other.userName;\r\n }\r\n if (other.isSetPassword()) {\r\n this.password = other.password;\r\n }\r\n if (other.isSetTableName()) {\r\n this.tableName = other.tableName;\r\n }\r\n if (other.isSetHiveTaleb()) {\r\n this.hiveTaleb = other.hiveTaleb;\r\n }\r\n }", "private void initDefaultTableModel() {\n defaultTableModel = new DefaultTableModel();\n defaultTableModel.addColumn(LocaleBundle.getResourceBundle().getString(\"name\"));\n defaultTableModel.addColumn(LocaleBundle.getResourceBundle().getString(\"sex\"));\n defaultTableModel.addColumn(LocaleBundle.getResourceBundle().getString(\"age\"));\n defaultTableModel.addColumn(LocaleBundle.getResourceBundle().getString(\"position\"));\n defaultTableModel.addColumn(LocaleBundle.getResourceBundle().getString(\"address\"));\n defaultTableModel.addColumn(LocaleBundle.getResourceBundle().getString(\"phone\"));\n defaultTableModel.addColumn(LocaleBundle.getResourceBundle().getString(\"email\"));\n defaultTableModel.addColumn(\"Tên tài khoản\");\n }", "public Complementos() {\n initComponents();\n String cabecera []={\"Producto\",\"Precio\"};\nString datos[][]={};\nboolean t=true;\nboolean f=false;\nmodelo = new Tablachida(datos,cabecera);\ntabla.setModel(modelo);\nTableColumnModel columnModel = tabla.getColumnModel();\ncolumnModel.getColumn(0).setPreferredWidth(250);\ntabla.setRowHeight(40);\n\n }", "@NotNull\n public static TableModel createShortTableModel ( final boolean editable )\n {\n return new SampleTableModel ( editable, 5 );\n }", "private TableModel getTabelaProduto() {\r\n\t\tString[] columnNames = { \"id_c\", \"nome\", \"telefone\", \"endereco\", \"cidade\", \"estado\", \"email\", \"genero\" };\r\n\r\n\t\tObject[][] dados = new Object[listacliente.size()][8];\r\n\t\tfor (int i = 0; i < listacliente.size(); i++) {\r\n\t\t\tint x = 0;\r\n\t\t\tdados[i][x++] = listacliente.get(i).getId();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getNome();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getTelefone();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getEndereco();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getCidade();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getEstado().getNome();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getEmail();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getGenero().getNome();\r\n\t\t}\r\n\r\n\t\treturn new DefaultTableModel(dados, columnNames);\r\n\r\n\t}", "public NuevoPrestamo() {\n initComponents();\n \n modeloHer = new DefaultTableModel();\n modeloPer = new DefaultTableModel();\n herramientasTable.setModel(modeloHer);\n personalTable.setModel(modeloPer);\n modeloHer.setColumnIdentifiers(titulosHer);\n modeloPer.setColumnIdentifiers(titulosPer);\n \n try {\n herramientas = herImp.lista_herramientas();\n for(Herramienta her : herramientas){\n Object[]o = new Object[4];\n o[0] = her.getCodigoProducto();\n o[1] = her.getNombre();\n o[2] = her.getDescripcion();\n o[3] = her.getCantidadDisponible();\n \n modeloHer.addRow(o);\n }\n } catch (Exception e) {\n System.out.println(\"Error al mostrar las herramientas en la tabla\");\n }\n \n try {\n listaPersonal = perImp.lista_personal();\n for(Personal per : listaPersonal){\n Object[]o = new Object[3];\n o[0] = per.getNombre();\n o[1] = per.getArea();\n o[2] = per.getPuesto();\n \n modeloPer.addRow(o);\n }\n } catch (Exception e) {\n System.out.println(\"Error al mostrar el personal en la tabla\");\n }\n \n }", "public TableForm() {\n initComponents();\n \n setMyTable();\n }", "private void addTable(Composite parent) {\n \n providers = new Table(parent, SWT.CHECK | SWT.BORDER\n | SWT.V_SCROLL | SWT.H_SCROLL);\n providers.setHeaderVisible(true);\n \n //Just for testing: Add some content to the table\n for (int i = 0; i < TITLES.length; i++) {\n TableColumn column = new TableColumn(providers, SWT.NULL);\n column.setText(TITLES[i]);\n }\n \n for (int i = 0; i < VilArgumentProvider.getProviderCount(); i++) {\n //Create new TableItem for each provider\n TableItem item = new TableItem(providers, SWT.NONE);\n\n VilArgumentProvider provider = VilArgumentProvider.getProvider(i);\n \n //Set Checkboxes\n if (VilArgumentProvider.getProvider(i).isActive()) {\n item.setChecked(true);\n } else {\n item.setChecked(false);\n }\n \n /*\n * Firstly we add the first 4 columns to the table-items because this is\n * essential for the decision whether a row is modifiable or not.\n * After that we add the free arguments to the items.\n * This is important because the method \"makeModifiable\" replaces certain cells in the table.\n */\n \n item.setText(0, String.valueOf(provider.getName()));\n item.setText(1, String.valueOf(provider.getParameterName()));\n item.setText(2, String.valueOf(provider.getParameterType()));\n item.setText(3, String.valueOf(provider.acceptsFreeArguments()));\n \n //make editor modifiable\n makeModifiable();\n \n try {\n item.setText(4, (provider.getFreeArguments().toString()));\n } catch (NullPointerException e) {\n item.setText(4, \"\");\n }\n \n }\n }", "public ScGridColumn<AcFossWebServiceMessage> newMessageColumn()\n {\n return newMessageColumn(\"Message\");\n }", "@SuppressWarnings(\"unchecked\")\n private void createTable(ArrayList<Object> objects){\n log.setText(\"\");\n if(!objects.isEmpty()) {\n ArrayList<String> list = new ArrayList<String>();\n int index = 0, row = 0, column = 0;\n for (Field field : objects.get(0).getClass().getDeclaredFields()) {\n list.add(field.getName());\n }\n String[] columnName = new String[list.size()];\n for(String s:list) {\n columnName[index] = s;\n index++;\n }\n Object data[][] = getData(objects, index);\n if(data.length != 0) {\n tableMode = new DefaultTableModel(data, columnName);\n }\n else {\n tableMode = null;\n }\n }\n else {\n tableMode = null;\n }\n }", "private void initTable(){\n TableCellEditor nonSelEditor = new TableCellEditor() {\n @Override\n public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {\n return null;\n }\n @Override\n public Object getCellEditorValue() {return null; }\n\n @Override\n public boolean isCellEditable(EventObject anEvent) {return false;}\n\n @Override\n public boolean shouldSelectCell(EventObject anEvent) {return false;}\n\n @Override\n public boolean stopCellEditing() {return false;}\n\n @Override\n public void cancelCellEditing() {/*NOP*/}\n\n @Override\n public void addCellEditorListener(CellEditorListener l) {/*NOP*/}\n\n @Override\n public void removeCellEditorListener(CellEditorListener l) {/*NOP*/}\n };\n\n tableModelArrays = new DefaultTableModel();\n\n String[] columns = {\"N\", \"Data type\", \"Length\", \"State\",\"Kit\"};\n for(String s : columns){\n tableModelArrays.addColumn(s);\n }\n\n /*\n * Add information about have generated structures to the table model\n */\n if(dataList != null){\n for(int i = 0; i<dataList.getLength(); i++){\n tableModelArrays.addRow(new String[]{\n Integer.toString(i + 1),\n dataList.getData(i).getType(),\n Integer.toString(dataList.getData(i).getLength(0)),\n dataList.getData(i).getState()\n });\n }\n }\n\n /*\n * Create table from table model\n */\n final JTable tableArrays = new JTable(tableModelArrays);\n\n /*\n * Runs popup menu for edition notices which contain in table.\n */\n tableArrays.addMouseListener(new PopupMenu(popupMenu){\n @Override\n public void maybeShowPopup(MouseEvent e) {\n if (e.isPopupTrigger()) {\n popupMenu.show(e.getComponent(),\n e.getX(), e.getY());\n if (e.getButton() == MouseEvent.BUTTON3) {\n Point point = e.getPoint();\n int column = tableArrays.columnAtPoint(point);\n int row = tableArrays.rowAtPoint(point);\n tableArrays.setColumnSelectionInterval(column, column);\n tableArrays.setRowSelectionInterval(row, row);\n selectedRow = tableArrays.getSelectedRow();\n }\n }\n }\n });\n\n tableArrays.setRowHeight(20);\n tableArrays.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n\n /*\n * Changes width all the columns in the table\n */\n tableArrays.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);\n tableArrays.getColumnModel().getColumn(0).setPreferredWidth(23);\n tableArrays.getColumnModel().getColumn(1).setPreferredWidth(67);\n tableArrays.getColumnModel().getColumn(2).setPreferredWidth(70);\n tableArrays.getColumnModel().getColumn(3).setPreferredWidth(65);\n tableArrays.getColumnModel().getColumn(4).setPreferredWidth(27);\n\n /*\n * Each notice sets as manually no editable\n */\n for (int i = 0; i<tableArrays.getColumnCount(); i++ ){\n tableArrays.getColumnModel().getColumn(i).setCellEditor(nonSelEditor);\n }\n\n /*\n * Add scroll controls to table\n */\n JScrollPane scrollTable = new JScrollPane(tableArrays);\n scrollTable.setSize(TABLE_WIDTH,getHeight()-FIELD_HEIGHT-150);\n scrollTable.setLocation(getWidth()-scrollTable.getWidth()-15, FIELD_HEIGHT+60);\n\n /*\n * Add table to frame\n */\n add(scrollTable);\n\n }", "private EditableTableModel(Object[][] rowData, String[] columnName) { // constructor\n\t super(rowData, columnName);\n\t this.editable_columns = new boolean[columnName.length];\n\t Arrays.fill(editable_columns, Boolean.FALSE);\n\t }", "@JsonCreator\n private DocumentTable(\n @JsonProperty(value = \"rowCount\", required = true) int rowCount,\n @JsonProperty(value = \"columnCount\", required = true) int columnCount,\n @JsonProperty(value = \"cells\", required = true) List<DocumentTableCell> cells,\n @JsonProperty(value = \"spans\", required = true) List<DocumentSpan> spans) {\n this.rowCount = rowCount;\n this.columnCount = columnCount;\n this.cells = cells;\n this.spans = spans;\n }", "private MyTable generateTable()\n\t{\n\t\t//this creates the column headers for the table\n\t\tString[] titles = new String[] {\"Name\"};\n\t\t//fields will store all of the entries in the database for the GUI\n\t\tArrayList<String[]> fields = new ArrayList<String[]>();\n\t\tfor (food foodStuff: items) //for each element in items do the following\n\t\t{\n\t\t\t//creates a single row of the table\n\t\t\tString[] currentRow = new String[1]; //creates an array for this row\n\t\t\tcurrentRow[1] = foodStuff.getName(); //sets this row's name\n\t\t\tfields.add(currentRow); //adds this row to the fields ArrayList\n\t\t}\n\t\t//builds a table with titles and a downgraded fields array\n\t\tMyTable builtTable = new MyTable(fields.toArray(new String[0][1]), titles);\n\t\treturn builtTable; // return\n\t}", "public VentanaInformacionHistoriaClinica() {\n \n menuOpciones = new JPopupMenu(\"Opciones\");\n \n menuOpciones.add(causas);\n menuOpciones.add(medicamentos);\n \n causas.addActionListener(this::causasRegistroHistoria);\n medicamentos.addActionListener(this::medicamentosRegistrosHistoria);\n \n modeloRegistro = new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Atendido por\", \"Fecha consulta\", \"Costo\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.String.class, java.lang.String.class, java.lang.Double.class\n };\n boolean[] canEdit = new boolean [] {\n false, false, false\n };\n\n @Override\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n @Override\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n };\n initComponents(); \n \n \n }", "public MyTableModel(SwingGui debugGui) {\n\t\tthis.debugGui = debugGui;\n\t\texpressions = Collections.synchronizedList(new ArrayList<String>());\n\t\tvalues = Collections.synchronizedList(new ArrayList<String>());\n\t\texpressions.add(\"\");\n\t\tvalues.add(\"\");\n\t}", "private void initilizeTable(DefaultTableModel model) throws SQLException {\r\n ArrayList<Products> allProducts;\r\n Connection c = null;\r\n PreparedStatement s = null;\r\n ResultSet rs;\r\n String query = \"SELECT * FROM products\";\r\n try {\r\n c = ConnectionFactory.getConnection();\r\n s = c.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);\r\n rs = s.executeQuery();\r\n allProducts = listForJTable(rs);\r\n rs.beforeFirst();\r\n model = getFieldsName(model, rs);\r\n for (Products p : allProducts)\r\n model.addRow(new String[]{String.valueOf(p.getIdproducts()), p.getProducts_name(), String.valueOf(p.getProducts_price()), String.valueOf(p.getProducts_inStock())});\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n } finally {\r\n ConnectionFactory.close(s);\r\n ConnectionFactory.close(c);\r\n }\r\n }", "Row createRow();", "public MyJTable createResultJTable(){\r\n\t\tmodel = new DefaultTableModel(getTableData(getRowNumber(), getTitle(), getAuthor(), getHyperLink(), getYear(), getAbstract(), getPublisher(), getMark(), getIsDuplicate(), getID()), getColumnName()) {\r\n\t\tprivate static final long serialVersionUID = 1L;\r\n\t\t\tClass<?>[] types = new Class<?>[] { Integer.class, String.class, String.class, URL.class, String.class, String.class, String.class, Boolean.class, Boolean.class, Integer.class};\r\n\r\n\t\t\tpublic Class<?> getColumnClass(int columnIndex) {\r\n\t\t\t\treturn types[columnIndex];\r\n\t\t\t}\r\n\t\t\r\n\t\t};\r\n\t\t\r\n\t\tMyJTable table = new MyJTable(model);\r\n\t\t//Sap xep noi dung cac dong trong table theo thu tu alpha B.\r\n\t\t//Cho phep sap xep theo tu cot rieng biet\r\n\t\tTableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>(table.getModel());\r\n\t\ttable.setRowSorter(sorter);\r\n\t\t\r\n\t\t/*\r\n\t\t * Set width of table column \r\n\t\t */\r\n\t\ttable.setShowGrid(true);\r\n\t\ttable.setShowVerticalLines(true);\r\n\t\ttable.setShowHorizontalLines(true);\r\n\t\ttable.setRowHeight(25);\r\n\t\t//table.getColumn(\"links\")//;\r\n\t\tDefaultTableCellRenderer dtcr = new DefaultTableCellRenderer(); \r\n\t\tdtcr.setHorizontalAlignment(SwingConstants.CENTER); \r\n\t\t\r\n\t\tTableCellRenderer tcr = table.getDefaultRenderer(Integer.class);\r\n\t\tDefaultTableCellRenderer renderer = (DefaultTableCellRenderer)tcr; \r\n\t\trenderer.setHorizontalAlignment(SwingConstants.CENTER); \r\n\t\t\r\n\t\ttable.getColumn((\"duplicate\")).setWidth(0);\r\n\t\ttable.getColumn((\"duplicate\")).setMinWidth(0);\r\n\t\ttable.getColumn((\"duplicate\")).setMaxWidth(0);\r\n\t\t\r\n\t\ttable.getColumn((\"id\")).setWidth(0);\r\n\t\ttable.getColumn((\"id\")).setMinWidth(0);\r\n\t\ttable.getColumn((\"id\")).setMaxWidth(0);\r\n\t\t\r\n\t\tfor(int i = 0; i < 8; i++){\r\n\t\t\tTableColumn col = table.getColumnModel().getColumn(i);\r\n\t\t\tif(i == 0){\r\n\t\t\t\tcol.setPreferredWidth(30);\r\n\t\t\t}else if(i == 1){\r\n\t\t\t\tcol.setPreferredWidth(300);\r\n\t\t\t}else if(i == 2){\r\n\t\t\t\tcol.setPreferredWidth(200);\r\n\t\t\t}else if(i == 3){\r\n\t\t\t\tcol.setPreferredWidth(150);\r\n\t\t\t}else if(i == 4){\r\n\t\t\t\tcol.setPreferredWidth(60);\r\n\t\t\t}else if (i == 5){\r\n\t\t\t\tcol.setPreferredWidth(150);\r\n\t\t\t}else if(i == 6){\r\n\t\t\t\tcol.setPreferredWidth(80);\r\n\t\t\t}else if(i == 7){\r\n\t\t\t\tcol.setPreferredWidth(30);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn table;\r\n\t}", "private void buildIngredientTable(){\n\n //IL=IM.getIngredientItemArrayList();\n\n\n\n ingredientTable = new JTable();\n ingredientTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);\n\n ingredientTable.getTableHeader().setReorderingAllowed(false);\n\n DTM = IM.getIngDTM();\n ingredientTable.setModel(DTM);\n\n ingredientTable.setRowSelectionAllowed(true);\n\n ingredientTable.setPreferredScrollableViewportSize(new Dimension(500, 50));\n ingredientTable.setDragEnabled(false);\n ingredientTable.setDefaultEditor(Object.class, null);\n //TODO\n\n TableColumnModel columnModel = ingredientTable.getColumnModel();\n columnModel.getColumn(1).setWidth(500);\n\n scrollPane = new JScrollPane(ingredientTable,ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);\n scrollPane.setPreferredSize(new Dimension(450, 450));\n\n }", "public Message(){\n this(\"Not Specified\",\"Not Specified\");\n }", "private void populateTreatementHistory() {\n DefaultTableModel model = (DefaultTableModel) historyTable.getModel();\n model.setRowCount(0);\n if (wr.getPatient().getPerson().getTreatmentHistory() != null) {\n for (WorkRequest r : wr.getPatient().getPerson().getTreatmentHistory()) {\n Object[] row = new Object[4];\n row[0] = r.getReceiver();\n row[1] = r.getResolveDate();\n row[2] = r.getMessage();\n row[3] = r.getStatus();\n\n model.addRow(row);\n }\n }\n\n }", "public ColumnBasedTableFilter(RowObjectTableModel<R> model) {\n\t\tthis.model = model;\n\t\tthis.name = null;\n\t}", "public void carga_bd_empleados(){\n try {\n Connection conectar = Conexion.conectar();\n PreparedStatement pst = conectar.prepareStatement(\n \"select nombre, edad, cargo, direccion, telefono from empleados\");\n\n ResultSet rs = pst.executeQuery();\n\n table = new JTable(model);\n jScrollPane1.setViewportView(table);\n table.setBackground(Color.yellow);\n\n model.addColumn(\"Nombre\");\n model.addColumn(\"Edad\");\n model.addColumn(\"Cargo\");\n model.addColumn(\"Direccion\");\n model.addColumn(\"Telefono\");\n\n while (rs.next()) {\n Object[] fila = new Object[8];\n //material mimaterial = new material();\n\n for (int i = 0; i < 5; i++) {\n fila[i] = rs.getObject(i + 1);\n }\n\n// model.addRow(fila);\n Empleado mimaterial = this.ChangetoEmpleado(fila);\n this.AddToArrayTableEmpleado(mimaterial);\n\n }\n\n conectar.close();\n \n } catch (SQLException e) {\n System.err.println(\"Error al llenar tabla\" + e);\n JOptionPane.showMessageDialog(null, \"Error al mostrar informacion\");\n\n }\n }", "public final InternalMessageModel newMessageModel() {\n return (InternalMessageModel) newProxy(InternalMessageModel.class,\n MessageModelImpl.class);\n }", "public Practice_JTable() {\n initComponents();\n }", "public void init2(){\n dateTextField.setText(String.valueOf(dateFormat.format(d)));\n Object [][] temp = new Object[realizarVenda.compra.size()][9];\n finalPurchaseTable.setModel(new javax.swing.table.DefaultTableModel(\n temp,\n new String [] {\n \"Pct#\", \"Nome\", \"Descrição\", \"Tamanho\", \"Valor\", \"Qntd\", \"Gênero\", \"Departamento\", \"Loja\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Object.class, java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.String.class\n };\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false, false, false, false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n finalPurchaseTable.setToolTipText(\"Pacote, Nome, Descrição, Tamanho, Valor, Quantidade, Gênero, Departamento, Loja\");\n finalPurchaseTable.getTableHeader().setReorderingAllowed(false);\n jScrollPane1.setViewportView(finalPurchaseTable);\n if (finalPurchaseTable.getColumnModel().getColumnCount() > 0) {\n finalPurchaseTable.getColumnModel().getColumn(0).setPreferredWidth(35);\n finalPurchaseTable.getColumnModel().getColumn(0).setMaxWidth(35);\n finalPurchaseTable.getColumnModel().getColumn(3).setPreferredWidth(45);\n finalPurchaseTable.getColumnModel().getColumn(3).setMaxWidth(45);\n finalPurchaseTable.getColumnModel().getColumn(4).setPreferredWidth(75);\n finalPurchaseTable.getColumnModel().getColumn(4).setMaxWidth(95);\n finalPurchaseTable.getColumnModel().getColumn(5).setPreferredWidth(45);\n finalPurchaseTable.getColumnModel().getColumn(5).setMaxWidth(45);\n finalPurchaseTable.getColumnModel().getColumn(6).setPreferredWidth(50);\n finalPurchaseTable.getColumnModel().getColumn(6).setMaxWidth(50);\n finalPurchaseTable.getColumnModel().getColumn(7).setPreferredWidth(70);\n finalPurchaseTable.getColumnModel().getColumn(7).setMaxWidth(70);\n finalPurchaseTable.getColumnModel().getColumn(8).setPreferredWidth(60);\n finalPurchaseTable.getColumnModel().getColumn(8).setMaxWidth(60);\n }\n for(int row = 0, col = 1;row<realizarVenda.compra.size();row++){\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).remessa, row, 0);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).nome, row, col);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).desc, row, col+1);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).tamanho, row, col+2);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).valor.valor_final, row, col+ 3);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).quantidade, row, col+4);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).sexo, row, col+5);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).dept, row, col+6);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).loja, row, col+7);\n }\n percentLabel.setText(String.valueOf(taxa)+\"%\");\n }", "public void populateTable()\n {\n DefaultTableModel model = (DefaultTableModel)workRequestJTable.getModel();\n \n model.setRowCount(0);\n for(WorkRequest request : weatherOrganisation.getWorkQueue().getWorkRequestList())\n {\n Object[] row = new Object[5];\n row[0] = request;\n \n row[1] = request.getStatus();\n row[2] = request.getRequestDate();\n row[3] = request.getResolveDate();\n row[4] = request.getDriverAcknowledgement();\n \n model.addRow(row);\n \n }\n \n }", "public void addTableGui() {\n\t\tDefaultTableModel mTableModel = new DefaultTableModel();\r\n\t\tmTable = new JTable(mTableModel);\r\n\r\n\t\tmTableModel.addColumn(\"MSSV\");\r\n\t\tmTableModel.addColumn(\"HoTen\");\r\n\t\tmTableModel.addColumn(\"GioiTinh\");\r\n\t\tmTableModel.addColumn(\"NTNS\");\r\n\t\tJScrollPane mJScrollPane = new JScrollPane(mTable);\r\n\t\tmJScrollPane.setPreferredSize(new Dimension(760, 310));\r\n\t\tc.fill = GridBagConstraints.HORIZONTAL;\r\n\t\tc.ipady = 40; //make this component tall\r\n\t\tc.weightx = 0.0;\r\n\t\tc.gridwidth = 3;\r\n\t\tc.gridx = 0;\r\n\t\tc.gridy = 1;\r\n\t\tpanel.add(mJScrollPane,c);\r\n\t}", "public void atualizarTabelaRespostas(){\n resposta = new Resposta(); \n\n try{\n if(txtIdPergunta.getText().isEmpty()){\n listaRespostas = respostaDao.ListaResposta(0);\n \n }else{\n listaRespostas = respostaDao.ListaResposta(Integer.parseInt(txtIdPergunta.getText()));\n \n }\n }catch (SQLException ex){\n Logger.getLogger(PerguntaView.class.getName()).log(Level.SEVERE, null, ex);\n } \nString dados [][] = new String[listaRespostas.size()][0];\nint i = 0;\nfor(Resposta resposta : listaRespostas){\n dados[i][0] = String.valueOf(resposta.getId());\n dados[i][1] = resposta.getDescricao();\n \n i++;\n}\nString tituloColuna[] ={\"ID Resposta\", \"Resposta\"};\nDefaultTableModel tabelaresposta = new DefaultTableModel();\ntabelaresposta.setDataVector(dados, tituloColuna);\n \n\n tabela_respostas.setModel(new DefaultTableModel(dados, tituloColuna){\n boolean[] canEdit = new boolean[]{\n false, false};\n \n public boolean isCellEditable(int rowIndex, int columnIndex){\n return canEdit[columnIndex];\n }\n \n\n });\ntabela_respostas.getColumnModel().getColumn(0).setPreferredWidth(100);\ntabela_respostas.getColumnModel().getColumn(1).setPreferredWidth(400);\n\nDefaultTableCellRenderer alinhamentoCentro = new DefaultTableCellRenderer();\nalinhamentoCentro.setHorizontalAlignment(SwingConstants.CENTER);\n\n\ntabela_respostas.getColumnModel().getColumn(0).setCellRenderer(alinhamentoCentro);\n\n\ntabela_respostas.setRowHeight(25);\ntabela_respostas.updateUI();\n }", "private EstabelecimentoTable() {\n\t\t\t}", "public Window_Table() {\n initComponents();\n \n \n \n }", "public SwitchColTable() {\r\r\r\r\n }" ]
[ "0.6077491", "0.5923667", "0.5874408", "0.5866467", "0.5781911", "0.5683022", "0.5661194", "0.5608904", "0.5574445", "0.5544361", "0.55077595", "0.55048937", "0.54693997", "0.5462226", "0.54445434", "0.54313123", "0.53963524", "0.5390453", "0.53780824", "0.5312975", "0.5277121", "0.52688247", "0.52430606", "0.52347344", "0.5233964", "0.52316946", "0.5226626", "0.521487", "0.5203312", "0.51885945", "0.51778835", "0.5153269", "0.5141057", "0.5133387", "0.5125259", "0.5125064", "0.5117271", "0.5112643", "0.511043", "0.5095716", "0.50906223", "0.5090131", "0.50889575", "0.50723726", "0.5070917", "0.5069654", "0.5060359", "0.5043873", "0.5036776", "0.5034613", "0.5033732", "0.5010188", "0.49890915", "0.49856395", "0.49827728", "0.49774516", "0.49735057", "0.49627957", "0.49531367", "0.49492353", "0.49447685", "0.49441534", "0.4933758", "0.4931744", "0.4926799", "0.49234253", "0.4921652", "0.49206677", "0.4915996", "0.4908848", "0.49058235", "0.48828956", "0.48822576", "0.48689997", "0.48678023", "0.48635608", "0.4852475", "0.48520613", "0.48511103", "0.4846069", "0.4842252", "0.48406336", "0.4840183", "0.48369685", "0.48290384", "0.48243576", "0.48208418", "0.48144686", "0.48081693", "0.48007354", "0.48006797", "0.4799395", "0.47989783", "0.47947496", "0.4789749", "0.47888747", "0.47873026", "0.47832185", "0.47817993", "0.47792703" ]
0.7811818
0
// TODO Autogenerated method stub //System.out.println("abinaya");
public static void main(String[] args) { prin(); Javabasics objjb = new Javabasics(); objjb.print(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void haha(){\n System.out.println(\"thavasi\");\n }", "private void sysout() {\nSystem.out.println(\"pandiya\");\n}", "@Override\n\tpublic void falar() {\n\t\tSystem.out.println(\"Kuack\");\n\t}", "void vorbereiten(){\n\t\tSystem.out.println(\"vorbereiten \");\n\t}", "private void syso() {\nSystem.out();\r\n}", "@Override\n public void comunicar() {\n System.out.println(\"miauuuu\");\n\n }", "public void Makan()\n\t{\n\tSystem.out.println(\"Harimau Makan Daging dan minum susu\");\n\tSystem.out.println();\n\t}", "void rajib () {\n\t\t \n\t\t System.out.println(\"Rajib is IT Eng\");\n\t }", "public void t(){\n System.out.println( \"Some text \"); \n }", "@Override\n\tpublic void habla() {\n\t\tSystem.out.println(\"Miau, Miau!!\");\n\t}", "@Override\n\tpublic void maasHesapla() {\n\t\tSystem.out.println(\"isciler icin maas 5000 tl \");\n \t\t\n\t}", "void miau() {\r\n\t\tSystem.out.println(\"Miauuuu!\");\r\n\t}", "@Override\r\n\tpublic void program() {\n\t\tSystem.out.println(\"我是一名Java工程师\");\r\n\t}", "static void print (){\n \t\tSystem.out.println();\r\n \t}", "@Override\n\tpublic void display() {\n\t\tSystem.out.println(\"Hyunjun\");\n\t}", "public void tampilKarakterA(){\r\n System.out.println(\"Saya mempunyai kaki empat \");\r\n }", "public void comer(){\r\n\t\tSystem.out.println(\"He comido\");\r\n\t}", "public static void test(){\n\t\tSystem.out.println(a);\n\t}", "public void breathe(){\n\n System.out.println(\"Through big nostrills\");\n }", "public void test() {\n\t\tSystem.out.println(\"test\");\n\t}", "public static void main(String[] args) {\nSystem.out.println(\"hello\");\r\nSystem.out.println(\"world\");\r\nSystem.out.println(\"haaai\");\r\nSystem.out.println(\"hell\");\r\n\t}", "public void printYourself(){\n\t}", "public void belajar(){\n\t\tSystem.out.println(\"Belajar java di \"+tempat+\" selama \"+jamBelajar+\" jam\");\n\t}", "@Override\r\n\tpublic void fly() {\n\t\tSystem.out.println(\"오리날다\");\r\n\t}", "public void test() {\n\t\tSystem.out.println(\"Test\");\r\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"iiAIDI\");\r\nSystem.out.println(\"jka\");\r\n\t}", "@Override\r\n\tpublic void alimentar() {\n\t\tSystem.out.print(\" como carne, yummy, yummy\");\r\n\t}", "public void tampilKarakterC(){\r\n System.out.println(\"Saya adalah binatang \");\r\n }", "private void mian()\r\n {\n System.out.println(\"Hello World222222221111\");\n System.out.println(\"12345\");\n }", "public void show() {\n\t\t System.out.println(\"这是A型产品\"); \r\n\t}", "public void display2(){\n System.out.println(\"codegym\");\n }", "@Override\r\n\tpublic void work() {\n\t\tSystem.out.println( aname + \"Berkerja\");\r\n\t}", "public void test(){//no input no output\n System.out.println(\"test method\");\n\n }", "@Override\n\tpublic void say() {\n\t\tSystem.out.println(\"产品A\");\n\t}", "public static void main(String[] args) {\nSystem.out.println(\"hi\");\r\nSystem.out.println(\"neelu\");\r\nSystem.out.println(\"change qu kiya\");\r\nSystem.out.println(\"neeraj...\");\r\nSystem.out.println(\"push\");\r\nSystem.out.println(\"push again\");\r\nSystem.out.println(\"changes done again\");\r\n\t}", "public void Jomijoma()\n {\n System.out.println(\"Ami dadar jomi joma paya geci\");\n }", "void crie(){\n\t\tSystem.out.println(\"miolement\");\n\t}", "void test()\n {\n System.out.println(\"ok\");\n }", "void comer() {\n\t\tSystem.out.println(\"comiendo\");\n\t}", "public void staffname() {\nSystem.out.println(\"staff name\");\n\t}", "@Override\n\tpublic void 숨쉰다() {\n\t\tSystem.out.println(\"허파로 숨을 쉰다.\");\n\t\t\n\t}", "@Override\n\tpublic void juxing() {\n\t\tSystem.out.println(\"***************\");\n\t\tSystem.out.println(\"***************\");\n\t\tSystem.out.println(\"***************\");\n\t\tSystem.out.println(\"***************\");\n\t\tSystem.out.println(\"***************\");\n\t}", "public static void main(String[] args) {\nint i = 1;\r\n\r\nSystem.out.println(\"안녕\");\r\n\t}", "public static void main(String[] args) {\n System.out.println(\"B\");\r\n }", "public void Practice1(){\n System.out.println(\"Hello\");\n }", "public void Display(){\n System.out.println(a);\n }", "public void ciudad(){\n System.out.println(\"ciudad londres\");\n }", "@Override\n\tvoid show() {\n\t\tSystem.out.println(\"Test\");\n\t}", "void emi(){\n\t\tSystem.out.println(\"This is HomeLoan EMi\");\n\t}", "void bark(){\r\n\t\tSystem.out.println(\"barking...\");\r\n\t}", "@Override\n public void tests() {\n System.out.println(\"222222222222222222\"); \n }", "void programming() {\n\t\tSystem.out.println(\"Programming is amazing\");\n\t}", "public static void main(String[] args) {\nSystem.out.println(b);\n\t}", "public void barking()\r\n {\r\n \tSystem.out.println (\"Woof Woof\");\r\n }", "public void test() {\n\t\tSystem.out.println(\"Still here, keep going dude.\");\n\t}", "public void sing() {\n\t\t System.out.println(lyric);\n\t}", "@Override\r\n\tpublic void 먹기() {\n\t\tSystem.out.println(\"다람쥐,도토리를 먹는다.\");\r\n\t}", "String print() {\n\t\treturn \"Hi\";\n\t}", "@Override\r\n\tpublic void 자기() {\n\t\tSystem.out.println(\"잠을 잔다\");\r\n\t}", "public void hello(){\n\t\t\r\n \t\r\n\t\t\r\n\t}", "public static void print() { //This is a Java method,Which will print \"Hello World\" on the cmd prompt.\n //Note : Keywords used : -\n //public : for the public access of method anywhere in this file or Another file.\n //static : It is used for a constant variable or a method that is same for every instance of a class.\n //void : returns nothing.\n System.out.println(\"Hello World\");\n }", "@Override\n\tpublic void jiao() {\n\t\tSystem.out.println(\"我睡觉打呼噜\");\n\t}", "@Override\n\tvoid name() {\n\t\tSystem.out.println(\"name is sai krishna\");\n\t}", "@Override\n\tvoid name() {\n\t\tSystem.out.println(\"name is anubhav\");\n\t\t\n\t}", "@Override\n\tpublic void HowtoEat() {\n\t\tSystem.out.println(\"Fırında Ye!!\");\n\t}", "void show() {\n System.out.print(\"show\");\n }", "@Override\n\tpublic void happyWithMan() {\n\t\tSystem.out.println(\"ÕýÄÇɶĨ¡£¡£¡£\");\n\t}", "@Override\r\n\tpublic void trunOn() {\n\t\tSystem.out.println(\"끄다\");\r\n\t}", "public void eat(){\n System.out.println(\"Bat Eatz\");\n }", "public static void main(String[] args) {\nSystem.out.println(\"xin chào linh\");\n\n\n}", "public void baocun() {\n\t\t\n\t}", "public void accountElection(){\n System.out.println(\"Elija una de las cuentas\");\n System.out.println(\"\");\n}", "public static void main(String[] args) {\n\t\tSystem.out.println(1);\r\n\t\tSystem.out.println(2);\r\n\t\tSystem.out.println(\"·ÖÖ§²âÊÔ\");\r\n System.out.println(\"zhufenzhi\");\r\n\t}", "public void geraeuschMachen() {\n System.out.println(\"BRUELL\");\n }", "@Override\r\n\tpublic void simpleOperation() {\n\t\tSystem.out.println(\"I'm building house\");\r\n\r\n\t}", "@Override\n\tpublic void bolumSoyle() {\n\t\tSystem.out.println(\"Benim Bölümüm Psi\");\n\t}", "public static void bark(){\n System.out.println(\"I am barking\");\n }", "@Override\n\tpublic void cry() {\n\t\tSystem.out.println(\"黄种人-哭\");\n\t}", "public void nace() {\n System.out.println(\"Ostia, acabo de nacer tío.\");\n }", "public static void hi() {\n System.out.println(\"Hi\");\n }", "public static void main(String[] args) { // main method\n System.out.println(\"hello World\") ; // print statement gives an output in Console\n\n\n }", "void print() {\n\t\n\t}", "@Override\n\tpublic void aaa() {\n\t\t\n\t}", "@Override\n\tpublic void nghienCuu() {\n\t\tSystem.out.println(\"Nghiên cứu\");\n\t}", "@Override\n\tpublic void b() {\n\t\tSystem.out.println(\"b method\");\n\t\t\n\t}", "@Override\n public void print() {\n System.out.println(\"Hello World Old Style!!\");\n }", "public void credit(){\n\n System.out.println(\"HSBC\");\n\n\n }", "public void print () {\n }", "public void show() {\n System.out.println(\"I am the best\");\n }", "public static void hehe(){\n \n }", "void bark(){\n\n System.out.println(\"=== baking !!! =====\");\n }", "public void test01() {\n\t\tSystem.out.println(\"I am in test01() method\");\n\t}", "private void printLine()\r\n\t{\r\n\t}", "public static void main(String[] args) {\n System.out.println(\"kkkjhhdjh\");\r\n System.out.println(\"pppppppppppppppp\");\r\n System.out.println(\"Overwriden\");\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tSystem.out.println(\"AA\");\n\t\t\n\n\t}", "public void test() {\n\t\tSystem.out.println(\"Bฑปต๗ำรมห\");\r\n\t}", "public static void main(String[] args){\n \n System.out.print(\"Print tanpa Enter\\n\"); //Output message tanpa Enter\n System.out.println(\"Print Pake Enter\"); //Output message dengan Enter di akhir pesan \n new Pengenalan(); //Pemanggilan constructor dari Class Pengenalan \n System.out.println(\"\\nBeberapa Statement C++ berfungsi di Java\");\n System.out.println(\"Contoh : If Else, Switch, For, While\");\n }", "public static void test() {\n System.out.println(\"This test works! \");\n }", "public void show() {\n\tSystem.out.println(\"show-method\");\t\n\t}", "public static void main(String[] args) {\nSystem.out.println(\"hello this is my first program\");\r\n\t}", "public static void RF2() {\r\n System.out.print(\"Gracias,Tenga un Buen Dia \");\r\n\tSystem.out.print(\"Adios :D\");\r\n }" ]
[ "0.81770056", "0.7723615", "0.75318056", "0.7342318", "0.7252836", "0.721343", "0.7213425", "0.7206224", "0.71989954", "0.7168648", "0.71494347", "0.7111762", "0.71026707", "0.70948964", "0.70564353", "0.7016302", "0.7001499", "0.6992975", "0.69430864", "0.6933612", "0.689581", "0.6891204", "0.6883304", "0.685069", "0.6848593", "0.68479085", "0.6845185", "0.6839275", "0.6817062", "0.6803131", "0.6789932", "0.6778408", "0.6766208", "0.67613673", "0.67405844", "0.6735787", "0.6729544", "0.67151225", "0.6713011", "0.6709313", "0.6706935", "0.670321", "0.6690888", "0.66779536", "0.66657305", "0.66652894", "0.6662687", "0.665607", "0.6645439", "0.66402006", "0.6633269", "0.66319335", "0.6625815", "0.66256875", "0.66108155", "0.66070336", "0.66054606", "0.6594304", "0.6594257", "0.65923494", "0.6590077", "0.65608454", "0.65564716", "0.65551454", "0.65423983", "0.653079", "0.65214366", "0.6512216", "0.6503985", "0.6503722", "0.64886355", "0.64756465", "0.6464139", "0.64636546", "0.64634734", "0.6461735", "0.64591354", "0.64526856", "0.6449456", "0.64478993", "0.6430272", "0.6428852", "0.64281094", "0.6422572", "0.641923", "0.6413818", "0.6412153", "0.64115626", "0.64111066", "0.6406637", "0.6404771", "0.64033616", "0.64009273", "0.6397893", "0.63940793", "0.6393125", "0.6381249", "0.6378554", "0.6376884", "0.63670844", "0.63645375" ]
0.0
-1
========================================================================= Takes wikitext and preprocesses the wikitext (without performing expansion). The following steps are performed: Validation Preprocessing (for inclusion/viewing) Entity substitution Optional: Expansion
public CompiledPage preprocess( PageId pageId, String wikitext, boolean forInclusion, ExpansionCallback callback) throws CompilerException { if (pageId == null) throw new NullPointerException(); PageTitle title = pageId.getTitle(); CompilerLog log = new CompilerLog(); log.setTitle(title.getFullTitle()); log.setRevision(pageId.getRevision()); LazyPreprocessedPage pprAst; try { EntityMap entityMap = new EntityMap(); String validatedWikitext = validate(title, wikitext, entityMap, log); LazyPreprocessedPage ppAst = preprocess(title, validatedWikitext, forInclusion, entityMap, log); pprAst = ppAst; if (callback != null) pprAst = expand(callback, title, ppAst, entityMap, null, false, log); } catch (CompilerException e) { e.attachLog(log); throw e; } catch (Throwable e) { throw new CompilerException("Compilation failed!", e, log); } return new CompiledPage( new Page(pprAst.getContent()), pprAst.getWarnings(), log); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void processContentEn() {\n if (this.content == null || this.content.equals(\"\")) {\r\n _logger.error(\"{} - The sentence is null or empty\", this.traceId);\r\n }\r\n\r\n // process input using ltp(Segmentation, POS, DP, SRL)\r\n this.nlp = new NLP(this.content, this.traceId, this.setting);\r\n }", "private void processContentCn() {\n if (this.content == null || this.content.equals(\"\")) {\r\n _logger.error(\"{} - The sentence is null or empty\", this.traceId);\r\n }\r\n\r\n // process input using ltp(Segmentation, POS, DP, SRL)\r\n this.ltp = new LTP(this.content, this.traceId, this.setting);\r\n }", "private static void processPart (WorkPart part) \n\t\tthrows Exception\n\t{\n\t\tTextWrapper textWrapper = part.getPrimaryText();\n\t\tif (textWrapper == null) return;\n\t\tText primary = textWrapper.getText();\n\t\tint n = primary.getNumLines();\n\t\tTextLine[] primaryLines = primary.getLines();\n\t\tTextLine[] translationLines = new TextLine[n];\n\t\tCollection lines = pm.getLinesInWorkPart(part);\n\t\tint numTranslatedLines = 0;\n\t\tfor (Iterator it = lines.iterator(); it.hasNext(); ) {\n\t\t\tLine line = (Line)it.next();\n\t\t\tTextRange location = line.getLocation();\n\t\t\tif (location == null) continue;\n\t\t\tTextLocation start = location.getStart();\n\t\t\tif (start == null) continue;\n\t\t\tTextLocation end = location.getEnd();\n\t\t\tif (end == null) continue;\n\t\t\tint endIndex = end.getIndex();\n\t\t\tString lineTag = line.getTag();\n\t\t\tif (lineTag == null) continue;\n\t\t\tElement el = (Element)lineTagToElMap.get(lineTag);\n\t\t\tif (el == null) continue;\n\t\t\tlineTagsFound.add(lineTag);\n\t\t\tTextLine translationLine = new BuildParagraph(el, \n\t\t\t\tTextParams.ROMAN,\n\t\t\t\tTextParams.TRANSLATED_LINE_FONT_SIZE);\n\t\t\tTextLine primaryLine = primaryLines[endIndex];\n\t\t\tint primaryIndentation = primaryLine.getIndentation();\n\t\t\ttranslationLine.setIndentation(primaryIndentation +\n\t\t\t\tTextParams.TRANSLATION_INDENTATION);\n\t\t\ttranslationLines[endIndex] = translationLine;\n\t\t\tnumTranslatedLines++;\n\t\t}\n\t\tif (numTranslatedLines == 0) return;\n\t\tText translation = new Text();\n\t\ttranslation.setCollapseBlankLines(false);\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tTextLine translationLine = translationLines[i];\n\t\t\tif (translationLine == null) {\n\t\t\t\ttranslation.appendBlankLine();\n\t\t\t} else {\n\t\t\t\ttranslation.appendLine(translationLine);\n\t\t\t}\n\t\t}\n\t\ttranslation.finalize();\n\t\tpm.begin();\n\t\tTextWrapper translationWrapper = new TextWrapper(translation);\n\t\tpm.save(translationWrapper);\n\t\tpart.addTranslation(translationTag, translationWrapper);\n\t\tpm.commit();\n\t}", "public static Patent transform(String patentxml) {\n\t\t patentxml = patentxml.trim();\n\t\t //patentxml = patentxml.replace(\"<!DOCTYPE math PUBLIC \\\"-//W3C//DTD MathML 3.0//EN\\\" \\\"http://www.w3.org/Math/DTD/mathml3/mathml3.dtd\\\">\", \"<!DOCTYPE PATDOC [<!ENTITY nbsp \\\"&#160;\\\" ><!ENTITY iexcl \\\"&#161;\\\" ><!ENTITY cent \\\"&#162;\\\" ><!ENTITY pound \\\"&#163;\\\" ><!ENTITY curren \\\"&#164;\\\" ><!ENTITY yen \\\"&#165;\\\" ><!ENTITY brvbar \\\"&#166;\\\" ><!ENTITY sect \\\"&#167;\\\" ><!ENTITY uml \\\"&#168;\\\" ><!ENTITY copy \\\"&#169;\\\" ><!ENTITY ordf \\\"&#170;\\\" ><!ENTITY laquo \\\"&#171;\\\" ><!ENTITY not \\\"&#172;\\\" ><!ENTITY shy \\\"&#173;\\\" ><!ENTITY reg \\\"&#174;\\\" ><!ENTITY macr \\\"&#175;\\\" ><!ENTITY deg \\\"&#176;\\\" ><!ENTITY plusmn \\\"&#177;\\\" ><!ENTITY sup2 \\\"&#178;\\\" ><!ENTITY sup3 \\\"&#179;\\\" ><!ENTITY acute \\\"&#180;\\\" ><!ENTITY micro \\\"&#181;\\\" ><!ENTITY para \\\"&#182;\\\" ><!ENTITY middot \\\"&#183;\\\" ><!ENTITY cedil \\\"&#184;\\\" ><!ENTITY sup1 \\\"&#185;\\\" ><!ENTITY ordm \\\"&#186;\\\" ><!ENTITY raquo \\\"&#187;\\\" ><!ENTITY frac14 \\\"&#188;\\\" ><!ENTITY frac12 \\\"&#189;\\\" ><!ENTITY frac34 \\\"&#190;\\\" ><!ENTITY iquest \\\"&#191;\\\" ><!ENTITY Agrave \\\"&#192;\\\" ><!ENTITY Aacute \\\"&#193;\\\" ><!ENTITY Acirc \\\"&#194;\\\" ><!ENTITY Atilde \\\"&#195;\\\" ><!ENTITY Auml \\\"&#196;\\\" ><!ENTITY Aring \\\"&#197;\\\" ><!ENTITY AElig \\\"&#198;\\\" ><!ENTITY Ccedil \\\"&#199;\\\" ><!ENTITY Egrave \\\"&#200;\\\" ><!ENTITY Eacute \\\"&#201;\\\" ><!ENTITY Ecirc \\\"&#202;\\\" ><!ENTITY Euml \\\"&#203;\\\" ><!ENTITY Igrave \\\"&#204;\\\" ><!ENTITY Iacute \\\"&#205;\\\" ><!ENTITY Icirc \\\"&#206;\\\" ><!ENTITY Iuml \\\"&#207;\\\" ><!ENTITY ETH \\\"&#208;\\\" ><!ENTITY Ntilde \\\"&#209;\\\" ><!ENTITY Ograve \\\"&#210;\\\" ><!ENTITY Oacute \\\"&#211;\\\" ><!ENTITY Ocirc \\\"&#212;\\\" ><!ENTITY Otilde \\\"&#213;\\\" ><!ENTITY Ouml \\\"&#214;\\\" ><!ENTITY times \\\"&#215;\\\" ><!ENTITY Oslash \\\"&#216;\\\" ><!ENTITY Ugrave \\\"&#217;\\\" ><!ENTITY Uacute \\\"&#218;\\\" ><!ENTITY Ucirc \\\"&#219;\\\" ><!ENTITY Uuml \\\"&#220;\\\" ><!ENTITY Yacute \\\"&#221;\\\" ><!ENTITY THORN \\\"&#222;\\\" ><!ENTITY szlig \\\"&#223;\\\" ><!ENTITY agrave \\\"&#224;\\\" ><!ENTITY aacute \\\"&#225;\\\" ><!ENTITY acirc \\\"&#226;\\\" ><!ENTITY atilde \\\"&#227;\\\" ><!ENTITY auml \\\"&#228;\\\" ><!ENTITY aring \\\"&#229;\\\" ><!ENTITY aelig \\\"&#230;\\\" ><!ENTITY ccedil \\\"&#231;\\\" ><!ENTITY egrave \\\"&#232;\\\" ><!ENTITY eacute \\\"&#233;\\\" ><!ENTITY ecirc \\\"&#234;\\\" ><!ENTITY euml \\\"&#235;\\\" ><!ENTITY igrave \\\"&#236;\\\" ><!ENTITY iacute \\\"&#237;\\\" ><!ENTITY icirc \\\"&#238;\\\" ><!ENTITY iuml \\\"&#239;\\\" ><!ENTITY eth \\\"&#240;\\\" ><!ENTITY ntilde \\\"&#241;\\\" ><!ENTITY ograve \\\"&#242;\\\" ><!ENTITY oacute \\\"&#243;\\\" ><!ENTITY ocirc \\\"&#244;\\\" ><!ENTITY otilde \\\"&#245;\\\" ><!ENTITY ouml \\\"&#246;\\\" ><!ENTITY divide \\\"&#247;\\\" ><!ENTITY oslash \\\"&#248;\\\" ><!ENTITY ugrave \\\"&#249;\\\" ><!ENTITY uacute \\\"&#250;\\\" ><!ENTITY ucirc \\\"&#251;\\\" ><!ENTITY uuml \\\"&#252;\\\" ><!ENTITY yacute \\\"&#253;\\\" ><!ENTITY thorn \\\"&#254;\\\" ><!ENTITY yuml \\\"&#255;\\\" > <!ENTITY lt \\\"&#38;#60;\\\" > <!ENTITY gt \\\"&#62;\\\" > <!ENTITY amp \\\"&#38;#38;\\\" > <!ENTITY apos \\\"&#39;\\\" > <!ENTITY quot \\\"&#34;\\\" > <!ENTITY OElig \\\"&#338;\\\" > <!ENTITY oelig \\\"&#339;\\\" > <!ENTITY Scaron \\\"&#352;\\\" > <!ENTITY scaron \\\"&#353;\\\" > <!ENTITY Yuml \\\"&#376;\\\" > <!ENTITY circ \\\"&#710;\\\" > <!ENTITY tilde \\\"&#732;\\\" > <!ENTITY ensp \\\"&#8194;\\\" > <!ENTITY emsp \\\"&#8195;\\\" > <!ENTITY thinsp \\\"&#8201;\\\" > <!ENTITY zwnj \\\"&#8204;\\\" > <!ENTITY zwj \\\"&#8205;\\\" > <!ENTITY lrm \\\"&#8206;\\\" > <!ENTITY rlm \\\"&#8207;\\\" > <!ENTITY ndash \\\"&#8211;\\\" > <!ENTITY mdash \\\"&#8212;\\\" > <!ENTITY lsquo \\\"&#8216;\\\" > <!ENTITY rsquo \\\"&#8217;\\\" > <!ENTITY sbquo \\\"&#8218;\\\" > <!ENTITY ldquo \\\"&#8220;\\\" > <!ENTITY rdquo \\\"&#8221;\\\" > <!ENTITY bdquo \\\"&#8222;\\\" > <!ENTITY dagger \\\"&#8224;\\\" > <!ENTITY Dagger \\\"&#8225;\\\" > <!ENTITY permil \\\"&#8240;\\\" > <!ENTITY lsaquo \\\"&#8249;\\\" > <!ENTITY rsaquo \\\"&#8250;\\\" > <!ENTITY euro \\\"&#8364;\\\" > <!ENTITY minus \\\"&#43;\\\" > <!ENTITY plus \\\"&#43;\\\" > <!ENTITY equals \\\"&#61;\\\" > <!ENTITY af \\\"\\\" > <!ENTITY it \\\"\\\" ><!ENTITY fnof \\\"&#402;\\\" > <!ENTITY Alpha \\\"&#913;\\\" > <!ENTITY Beta \\\"&#914;\\\" > <!ENTITY Gamma \\\"&#915;\\\" > <!ENTITY Delta \\\"&#916;\\\" > <!ENTITY Epsilon \\\"&#917;\\\" > <!ENTITY Zeta \\\"&#918;\\\" > <!ENTITY Eta \\\"&#919;\\\" > <!ENTITY Theta \\\"&#920;\\\" > <!ENTITY Iota \\\"&#921;\\\" > <!ENTITY Kappa \\\"&#922;\\\" > <!ENTITY Lambda \\\"&#923;\\\" > <!ENTITY Mu \\\"&#924;\\\" > <!ENTITY Nu \\\"&#925;\\\" > <!ENTITY Xi \\\"&#926;\\\" > <!ENTITY Omicron \\\"&#927;\\\" > <!ENTITY Pi \\\"&#928;\\\" > <!ENTITY Rho \\\"&#929;\\\" > <!ENTITY Sigma \\\"&#931;\\\" > <!ENTITY Tau \\\"&#932;\\\" > <!ENTITY Upsilon \\\"&#933;\\\" > <!ENTITY Phi \\\"&#934;\\\" > <!ENTITY Chi \\\"&#935;\\\" > <!ENTITY Psi \\\"&#936;\\\" > <!ENTITY Omega \\\"&#937;\\\" > <!ENTITY alpha \\\"&#945;\\\" > <!ENTITY beta \\\"&#946;\\\" > <!ENTITY gamma \\\"&#947;\\\" > <!ENTITY delta \\\"&#948;\\\" > <!ENTITY epsilon \\\"&#949;\\\" > <!ENTITY zeta \\\"&#950;\\\" > <!ENTITY eta \\\"&#951;\\\" > <!ENTITY theta \\\"&#952;\\\" > <!ENTITY iota \\\"&#953;\\\" > <!ENTITY kappa \\\"&#954;\\\" > <!ENTITY lambda \\\"&#955;\\\" > <!ENTITY mu \\\"&#956;\\\" > <!ENTITY nu \\\"&#957;\\\" > <!ENTITY xi \\\"&#958;\\\" > <!ENTITY omicron \\\"&#959;\\\" > <!ENTITY pi \\\"&#960;\\\" > <!ENTITY rho \\\"&#961;\\\" > <!ENTITY sigmaf \\\"&#962;\\\" > <!ENTITY sigma \\\"&#963;\\\" > <!ENTITY tau \\\"&#964;\\\" > <!ENTITY upsilon \\\"&#965;\\\" > <!ENTITY phi \\\"&#966;\\\" > <!ENTITY chi \\\"&#967;\\\" > <!ENTITY psi \\\"&#968;\\\" > <!ENTITY omega \\\"&#969;\\\" > <!ENTITY thetasym \\\"&#977;\\\" > <!ENTITY upsih \\\"&#978;\\\" > <!ENTITY piv \\\"&#982;\\\" > <!ENTITY bull \\\"&#8226;\\\" > <!ENTITY hellip \\\"&#8230;\\\" > <!ENTITY prime \\\"&#8242;\\\" > <!ENTITY Prime \\\"&#8243;\\\" > <!ENTITY oline \\\"&#8254;\\\" > <!ENTITY frasl \\\"&#8260;\\\" > <!ENTITY weierp \\\"&#8472;\\\" > <!ENTITY image \\\"&#8465;\\\" > <!ENTITY real \\\"&#8476;\\\" > <!ENTITY trade \\\"&#8482;\\\" > <!ENTITY alefsym \\\"&#8501;\\\" > <!ENTITY larr \\\"&#8592;\\\" > <!ENTITY uarr \\\"&#8593;\\\" > <!ENTITY rarr \\\"&#8594;\\\" > <!ENTITY darr \\\"&#8595;\\\" > <!ENTITY harr \\\"&#8596;\\\" > <!ENTITY crarr \\\"&#8629;\\\" > <!ENTITY lArr \\\"&#8656;\\\" > <!ENTITY uArr \\\"&#8657;\\\" > <!ENTITY rArr \\\"&#8658;\\\" > <!ENTITY dArr \\\"&#8659;\\\" > <!ENTITY hArr \\\"&#8660;\\\" > <!ENTITY forall \\\"&#8704;\\\" > <!ENTITY part \\\"&#8706;\\\" > <!ENTITY exist \\\"&#8707;\\\" > <!ENTITY empty \\\"&#8709;\\\" > <!ENTITY nabla \\\"&#8711;\\\" > <!ENTITY isin \\\"&#8712;\\\" > <!ENTITY notin \\\"&#8713;\\\" > <!ENTITY ni \\\"&#8715;\\\" > <!ENTITY prod \\\"&#8719;\\\" > <!ENTITY sum \\\"&#8721;\\\" > <!ENTITY minus \\\"&#8722;\\\" > <!ENTITY lowast \\\"&#8727;\\\" > <!ENTITY radic \\\"&#8730;\\\" > <!ENTITY prop \\\"&#8733;\\\" > <!ENTITY infin \\\"&#8734;\\\" > <!ENTITY ang \\\"&#8736;\\\" > <!ENTITY and \\\"&#8743;\\\" > <!ENTITY or \\\"&#8744;\\\" > <!ENTITY cap \\\"&#8745;\\\" > <!ENTITY cup \\\"&#8746;\\\" > <!ENTITY int \\\"&#8747;\\\" > <!ENTITY there4 \\\"&#8756;\\\" > <!ENTITY sim \\\"&#8764;\\\" > <!ENTITY cong \\\"&#8773;\\\" > <!ENTITY asymp \\\"&#8776;\\\" > <!ENTITY ne \\\"&#8800;\\\" > <!ENTITY equiv \\\"&#8801;\\\" > <!ENTITY le \\\"&#8804;\\\" > <!ENTITY ge \\\"&#8805;\\\" > <!ENTITY sub \\\"&#8834;\\\" > <!ENTITY sup \\\"&#8835;\\\" > <!ENTITY nsub \\\"&#8836;\\\" > <!ENTITY sube \\\"&#8838;\\\" > <!ENTITY supe \\\"&#8839;\\\" > <!ENTITY oplus \\\"&#8853;\\\" > <!ENTITY otimes \\\"&#8855;\\\" > <!ENTITY perp \\\"&#8869;\\\" > <!ENTITY sdot \\\"&#8901;\\\" > <!ENTITY lceil \\\"&#8968;\\\" > <!ENTITY rceil \\\"&#8969;\\\" > <!ENTITY lfloor \\\"&#8970;\\\" > <!ENTITY rfloor \\\"&#8971;\\\" > <!ENTITY lang \\\"&#9001;\\\" > <!ENTITY rang \\\"&#9002;\\\" > <!ENTITY loz \\\"&#9674;\\\" > <!ENTITY spades \\\"&#9824;\\\" > <!ENTITY clubs \\\"&#9827;\\\" > <!ENTITY hearts \\\"&#9829;\\\" > <!ENTITY diams \\\"&#9830;\\\" > <!ENTITY lcub \\\"\\\" > <!ENTITY rcub \\\"\\\" > <!ENTITY excl \\\"\\\" > <!ENTITY quest \\\"\\\" > <!ENTITY num \\\"\\\" >]>\");\n\t\t //patentxml = patentxml.replace(\"<!DOCTYPE math PUBLIC \\\"-//W3C//DTD MathML 3.0//EN\\\" \\\"http://www.w3.org/Math/DTD/mathml3/mathml3.dtd\\\">\", \"<!DOCTYPE math PUBLIC \\\"-//W3C//DTD MathML 2.0//EN\\\" \\\"dtds/mathml2.dtd\\\">\");\n\t\t patentxml = patentxml.replace(\"<!DOCTYPE math PUBLIC \\\"-//W3C//DTD MathML 3.0//EN\\\" \\\"http://www.w3.org/Math/DTD/mathml3/mathml3.dtd\\\">\", \"<!DOCTYPE math PUBLIC \\\"-//W3C//DTD MathML 2.0//EN\\\" \\\"http://10.18.203.79:7070/solr/dtds/mathml2.dtd\\\">\");\n\t\t Patent parsedPatent = null;\n\t if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v4.5 2014-04-03\\\"\")==true) { // patent xml is grant in DTD v4.5\n\t\t\t\tparsedPatent = parseGrantv45(patentxml);\t\t \n\t }\n\t else if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v4.4 2013-05-16\\\"\")==true) { // patent xml is grant in DTD v4.4\n\t \tparsedPatent = parseGrantv44(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v4.3 2012-12-04\\\"\")==true) { // patent xml is grant in DTD v4.3\n\t \tparsedPatent = parseGrantv43(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v4.2 2006-08-23\\\"\")==true) { // patent xml is grant in DTD v4.2\n\t \tparsedPatent = parseGrantv42(patentxml);\n\t }\t\n\t else if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v4.1 2005-08-25\\\"\")==true) { // patent xml is grant in DTD v4.5\n\t \tparsedPatent = parseGrantv41(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v40 2004-12-02\\\"\")==true) { // patent xml is grant in DTD v4.0\n\t \tparsedPatent = parseGrantv40_041202(patentxml);\n\t }\n\t else if(patentxml.contains(\"<PATDOC DTD=\\\"2.5\\\"\")==true) { // patent xml is grant in DTD v2.5\n\t \tparsedPatent = parseGrantv25(patentxml);\t\t \t\t\t\t \n\t }\n\t else if(patentxml.contains(\"<PATDOC DTD=\\\"2.4\\\"\")==true) { // patent xml is grant in DTD v2.5\n\t \tparsedPatent = parseGrantv24(patentxml);\t\t \t\t\t\t \n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.4 2014-04-03\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv44(patentxml);\t\t \n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.3 2012-12-04\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv43(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.2 2006-08-23\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv42(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.1 2005-08-25\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv41(patentxml);\n\t }\t \t \n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.0 2004-12-02\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv40_041202(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.0 2004-10-28\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv40_041028(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.0 2004-09-27\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv40_040927(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.0 2004-09-08\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv40_040908(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.0 2004-04-15\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv40_040415(patentxml);\n\t }\n\t else if(patentxml.indexOf(\"<!DOCTYPE patent-application-publication\")==0 && patentxml.contains(\"pap-v16-2002-01-01.dtd\")==true) { // patent xml is application in DTD v1.6\n\t \tparsedPatent = parseApplicationv16(patentxml);\n\t }\n\t\t return parsedPatent==null? new Patent():parsedPatent;\n\t }", "protected void importText(String text, Epml epml) {\n\t}", "String getTransformedText();", "protected void processXlateText(Hashtable attributes)\n throws SAXException\n {\n\tString key = (String) attributes.get(XMLTag.ID);\n\tif ((xlatedText == null) || (textTag == null))\n\t {\n\t throw new SAXException(\"Encountered xlateText element (id=\" +\n\t\t\t key + \") outside defining element.\");\n\t }\n\tXMLTag tag = (XMLTag) attributes.get(XMLTag.TAG);\n\tString dflt = (String) attributes.get(XMLTag.REMIND);\n\tString substitute = (String) attributes.get(XMLTag.SUBSTITUTE);\n\tString xlated = textSource.getI18NText(key,dflt);\n // ignore lines that are bare accent graves\n if (xlated.compareTo(\"`\") == 0)\n return;\n if (substitute != null)\n\t {\n\t int p1 = xlated.indexOf(\"%1\");\n\t if (p1 < 0)\n\t p1 = xlated.indexOf(\"%s\");\n\t if (p1 < 0)\n\t p1 = xlated.indexOf(\"%d\");\n\t if (p1 >= 0)\n\t {\n int p2 = xlated.indexOf(\" \",p1);\n\t\tif (p2 < 0)\n\t\t {\n xlated = xlated.substring(0,p1) + substitute;\n\t\t }\n\t\telse\n\t\t {\n xlated = xlated.substring(0,p1) + substitute +\n\t\t xlated.substring(p2);\n\t\t }\n\t\t}\n\t else // just append the substitute string.\n\t {\n p1 = xlated.lastIndexOf(\" \");\n\t\tif (p1 < (xlated.length() - 1))\n\t\t {\n\t\t xlated = xlated + \" \";\n\t\t }\n\t\txlated = xlated + substitute;\n\t\t}\n\t }\n\txlatedText.add(xlated);\n\ttextTag.add(tag);\n\ttextKey.add(key);\n\t}", "private void parseRawText() {\n\t\t//1-new lines\n\t\t//2-pageObjects\n\t\t//3-sections\n\t\t//Clear any residual data.\n\t\tlinePositions.clear();\n\t\tsections.clear();\n\t\tpageObjects.clear();\n\t\tcategories.clear();\n\t\tinterwikis.clear();\n\t\t\n\t\t//Generate data.\n\t\tparsePageForNewLines();\n\t\tparsePageForPageObjects();\n\t\tparsePageForSections();\n\t}", "public void preprocess() {\n }", "public void preprocess() {\n }", "public void preprocess() {\n }", "public void preprocess() {\n }", "@Override\n\tpublic void process(JCas aJCas) throws AnalysisEngineProcessException {\n\t\tString text = aJCas.getDocumentText();\n\n\t\t// create an empty Annotation just with the given text\n\t\tAnnotation document = new Annotation(text);\n//\t\tAnnotation document = new Annotation(\"Barack Obama was born in Hawaii. He is the president. Obama was elected in 2008.\");\n\n\t\t// run all Annotators on this text\n\t\tpipeline.annotate(document); \n\t\tList<CoreMap> sentences = document.get(SentencesAnnotation.class);\n\t\t HelperDataStructures hds = new HelperDataStructures();\n\n\t\t\n\t\t//SPnew language-specific settings:\n\t\t//SPnew subject tags of the parser\n\t\t HashSet<String> subjTag = new HashSet<String>(); \n\t\t HashSet<String> dirObjTag = new HashSet<String>(); \n\t\t //subordinate conjunction tags\n\t\t HashSet<String> compTag = new HashSet<String>(); \n\t\t //pronoun tags\n\t\t HashSet<String> pronTag = new HashSet<String>(); \n\t\t \n\t\t HashSet<String> passSubjTag = new HashSet<String>();\n\t\t HashSet<String> apposTag = new HashSet<String>(); \n\t\t HashSet<String> verbComplementTag = new HashSet<String>(); \n\t\t HashSet<String> infVerbTag = new HashSet<String>(); \n\t\t HashSet<String> relclauseTag = new HashSet<String>(); \n\t\t HashSet<String> aclauseTag = new HashSet<String>(); \n\t\t \n\t\t HashSet<String> compLemma = new HashSet<String>(); \n\t\t HashSet<String> coordLemma = new HashSet<String>(); \n\t\t HashSet<String> directQuoteIntro = new HashSet<String>(); \n\t\t HashSet<String> indirectQuoteIntroChunkValue = new HashSet<String>();\n\t\t \n//\t\t HashSet<String> finiteVerbTag = new HashSet<String>();\n\t\t \n\n\t\t //OPEN ISSUES PROBLEMS:\n\t\t //the subject - verb relation finding does not account for several specific cases: \n\t\t //opinion verbs with passive subjects as opinion holder are not accounted for,\n\t\t //what is needed is a marker in the lex files like PASSSUBJ\n\t\t //ex: Obama is worried/Merkel is concerned\n\t\t //Many of the poorer countries are concerned that the reduction in structural funds and farm subsidies may be detrimental in their attempts to fulfill the Copenhagen Criteria.\n\t\t //Some of the more well off EU states are also worried about the possible effects a sudden influx of cheap labor may have on their economies. Others are afraid that regional aid may be diverted away from those who currently benefit to the new, poorer countries that join in 2004 and beyond. \n\t\t// Does not account for infinitival constructions, here again a marker is needed to specify\n\t\t //subject versus object equi\n\t\t\t//Christian Noyer was reported to have said that it is ok.\n\t\t\t//Reuters has reported Christian Noyer to have said that it is ok.\n\t\t //Obama is likely to have said.. \n\t\t //Several opinion holder- opinion verb pairs in one sentence are not accounted for, right now the first pair is taken.\n\t\t //what is needed is to run through all dependencies. For inderect quotes the xcomp value of the embedded verb points to the \n\t\t //opinion verb. For direct quotes the offsets closest to thwe quote are relevant.\n\t\t //a specific treatment of inverted subjects is necessary then. Right now the\n\t\t //strategy relies on the fact that after the first subj/dirobj - verb pair the\n\t\t //search is interrupted. Thus, if the direct object precedes the subject, it is taken as subject.\n\t\t // this is the case in incorrectly analysed inverted subjeects as: said Zwickel on Monday\n\t\t //coordination of subject not accounted for:employers and many economists\n\t\t //several subject-opinion verbs:\n\t\t //Zwickel has called the hours discrepancy between east and west a \"fairness gap,\" but employers and many economists point out that many eastern operations have a much lower productivity than their western counterparts.\n\t\t if (language.equals(\"en\")){\n \t subjTag.add(\"nsubj\");\n \t subjTag.add(\"xsubj\");\n \t subjTag.add(\"nmod:agent\");\n \t \n \t dirObjTag.add(\"dobj\"); //for inverted subject: \" \" said IG metall boss Klaus Zwickel on Monday morning.\n \t \t\t\t\t\t\t//works only with break DEPENDENCYSEARCH, otherwise \"Monday\" is nsubj \n \t \t\t\t\t\t\t//for infinitival subject of object equi: Reuters reports Obama to have said\n \tpassSubjTag.add(\"nsubjpass\");\n \tapposTag.add(\"appos\");\n \trelclauseTag.add(\"acl:relcl\");\n \taclauseTag.add(\"acl\");\n \t compTag.add(\"mark\");\n \t pronTag.add(\"prp\");\n \thds.pronTag.add(\"prp\");\n \tcompLemma.add(\"that\");\n \tcoordLemma.add(\"and\");\n \tverbComplementTag.add(\"ccomp\");\n \tverbComplementTag.add(\"parataxis\");\n\n \tinfVerbTag.add(\"xcomp\"); //Reuters reported Merkel to have said\n \tinfVerbTag.add(\"advcl\");\n \tdirectQuoteIntro.add(\":\");\n \tindirectQuoteIntroChunkValue.add(\"SBAR\");\n \thds.objectEqui.add(\"report\");\n \thds.objectEqui.add(\"quote\");\n \thds.potentialIndirectQuoteTrigger.add(\"say\");\n// \thds.objectEqui.add(\"confirm\");\n// \thds.subjectEqui.add(\"promise\");\n// \thds.subjectEqui.add(\"quote\");\n// \thds.subjectEqui.add(\"confirm\");\n }\n\t\t \n\t\t boolean containsSubordinateConjunction = false;\n\t\t\n\t\t \n\t\tfor (CoreMap sentence : sentences) {\n//\t\t\tSystem.out.println(\"PREPROCESSING..\");\n\t\t\t\tSentenceAnnotation sentenceAnn = new SentenceAnnotation(aJCas);\n\t\t\t\t\n\t\t\t\tint beginSentence = sentence.get(TokensAnnotation.class).get(0)\n\t\t\t\t\t\t.beginPosition();\n\t\t\t\tint endSentence = sentence.get(TokensAnnotation.class)\n\t\t\t\t\t\t.get(sentence.get(TokensAnnotation.class).size() - 1)\n\t\t\t\t\t\t.endPosition();\n\t\t\t\tsentenceAnn.setBegin(beginSentence);\n\t\t\t\tsentenceAnn.setEnd(endSentence);\n\t\t\t\tsentenceAnn.addToIndexes();\n\t\t\t\t\n\t\t\t\t//SP Map offsets to NER\n\t\t\t\tList<NamedEntity> ners = JCasUtil.selectCovered(aJCas, //SPnew tut\n\t\t\t\t\t\tNamedEntity.class, sentenceAnn);\n\t\t\t\tfor (NamedEntity ne : ners){\n//\t\t\t\t\tSystem.out.println(\"NER TYPE: \" + ne.jcasType.toString());\n//\t\t\t\t\tSystem.out.println(\"NER TYPE: \" + ne.getCoveredText().toString());\n//\t\t\t\t\tSystem.out.println(\"NER TYPE: \" + ne.jcasType.casTypeCode);\n\t\t\t\t\t//Person is 71, Location is 213, Organization is 68 geht anders besser siehe unten\n\t\t\t\t\tint nerStart = ne\n\t\t\t\t\t\t\t.getBegin();\n\t\t\t\t\tint nerEnd = ne.getEnd();\n//\t\t\t\t\tSystem.out.println(\"NER: \" + ne.getCoveredText() + \" \" + nerStart + \"-\" + nerEnd ); \n\t\t\t\t\tString offsetNer = \"\" + nerStart + \"-\" + nerEnd;\n\t\t\t\t\thds.offsetToNer.put(offsetNer, ne.getCoveredText());\n//\t\t\t\t\tNer.add(offsetNer);\n\t\t\t\t\thds.Ner.add(offsetNer);\n//\t\t\t\t\tSystem.out.println(\"NER: TYPE \" +ne.getValue().toString());\n\t\t\t\t\tif (ne.getValue().equals(\"PERSON\")){\n\t\t\t\t\t\thds.NerPerson.add(offsetNer);\n\t\t\t\t\t}\n\t\t\t\t\telse if (ne.getValue().equals(\"ORGANIZATION\")){\n\t\t\t\t\t\thds.NerOrganization.add(offsetNer);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//DBpediaLink info: map offsets to links\n\t\t\t\tList<DBpediaResource> dbpeds = JCasUtil.selectCovered(aJCas, //SPnew tut\n\t\t\t\t\t\tDBpediaResource.class, sentenceAnn);\n\t\t\t\tfor (DBpediaResource dbped : dbpeds){\n//\t\t\t\t\t\n//\t\t\t\t\tint dbStart = dbped\n//\t\t\t\t\t\t\t.getBegin();\n//\t\t\t\t\tint dbEnd = dbped.getEnd();\n\t\t\t\t\t// not found if dbpedia offsets are wrongly outside than sentences\n//\t\t\t\t\tSystem.out.println(\"DBPED SENT: \" + sentenceAnn.getBegin()+ \"-\" + sentenceAnn.getEnd() ); \n//\t\t\t\t\tString offsetDB = \"\" + dbStart + \"-\" + dbEnd;\n//\t\t\t\t\thds.labelToDBpediaLink.put(dbped.getLabel(), dbped.getUri());\n//\t\t\t\t\tSystem.out.println(\"NOW DBPED: \" + dbped.getLabel() + \"URI: \" + dbped.getUri() ); \n\t\t\t\t\thds.dbpediaSurfaceFormToDBpediaLink.put(dbped.getCoveredText(), dbped.getUri());\n//\t\t\t\t\tSystem.out.println(\"NOW DBPED: \" + dbped.getCoveredText() + \"URI: \" + dbped.getUri() ); \n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//SP Map offsets to lemma of opinion verb/noun; parser does not provide lemma\n\t\t\t\t for (CoreLabel token: sentence.get(TokensAnnotation.class)) {\n//\t\t\t\t\t System.out.println(\"LEMMA \" + token.lemma().toString());\n\t\t\t\t\t int beginTok = token.beginPosition();\n\t\t\t\t\t int endTok = token.endPosition();\n\t\t\t\t\t String offsets = \"\" + beginTok + \"-\" + endTok;\n\t\t\t\t\t hds.offsetToLemma.put(offsets, token.lemma().toString());\n\t\t\t\t\t \n\t\t\t\t\t \t if (opinion_verbs.contains(token.lemma().toString())){\n\t\t\t\t\t\t\t hds.offsetToLemmaOfOpinionVerb.put(offsets, token.lemma().toString());\n\t\t\t\t\t\t\t hds.OpinionExpression.add(offsets);\n\t\t\t\t\t\t\t hds.offsetToLemmaOfOpinionExpression.put(offsets, token.lemma().toString());\n\t\t\t\t\t\t\t \n//\t\t\t \t System.out.println(\"offsetToLemmaOfOpinionVerb \" + token.lemma().toString());\n\t\t\t\t\t \t }\n\t\t\t\t\t \t if (passive_opinion_verbs.contains(token.lemma().toString())){\n\t\t\t\t\t\t\t hds.offsetToLemmaOfPassiveOpinionVerb.put(offsets, token.lemma().toString());\n\t\t\t\t\t\t\t hds.OpinionExpression.add(offsets);\n\t\t\t\t\t\t\t hds.offsetToLemmaOfOpinionExpression.put(offsets, token.lemma().toString());\n//\t\t\t \t System.out.println(\"offsetToLemmaOfPassiveOpinionVerb \" + token.lemma().toString());\n\t\t\t\t\t \t }\n\n\t\t\t\t } \n\n\t\t\t//SPnew parser\n\t\t\tTree tree = sentence.get(TreeAnnotation.class);\n\t\t\tTreebankLanguagePack tlp = new PennTreebankLanguagePack();\n\t\t\tGrammaticalStructureFactory gsf = tlp.grammaticalStructureFactory();\n\t\t\tGrammaticalStructure gs = gsf.newGrammaticalStructure(tree);\n\t\t\tCollection<TypedDependency> td = gs.typedDependenciesCollapsed();\n\n\t\t\t \n//\t\t\tSystem.out.println(\"TYPEDdep\" + td);\n\t\t\t\n\t\t\tObject[] list = td.toArray();\n//\t\t\tSystem.out.println(list.length);\n\t\t\tTypedDependency typedDependency;\nDEPENDENCYSEARCH: for (Object object : list) {\n\t\t\ttypedDependency = (TypedDependency) object;\n//\t\t\tSystem.out.println(\"DEP \" + typedDependency.dep().toString()+ \n//\t\t\t\t\t\" GOV \" + typedDependency.gov().toString()+ \n//\t\t\t\" :: \"+ \" RELN \"+typedDependency.reln().toString());\n\t\t\tString pos = null;\n String[] elements;\n String verbCand = null;\n int beginVerbCand = -5;\n\t\t\tint endVerbCand = -5;\n\t\t\tString offsetVerbCand = null;\n\n if (compTag.contains(typedDependency.reln().toString())) {\n \tcontainsSubordinateConjunction = true;\n// \tSystem.out.println(\"subordConj \" + typedDependency.dep().toString().toLowerCase());\n }\n \n else if (subjTag.contains(typedDependency.reln().toString())){\n \thds.predicateToSubjectChainHead.clear();\n \thds.subjectToPredicateChainHead.clear();\n \t\n \tverbCand = typedDependency.gov().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.gov().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.gov().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n//\t\t\t\tSystem.out.println(\"VERBCand \" + verbCand + offsetVerbCand);\n//\t\t\t\tfor (HashMap.Entry<String, String> entry : hds.offsetToLemma.entrySet()) {\n//\t\t\t\t String key = entry.getKey();\n//\t\t\t\t Object value = entry.getValue();\n//\t\t\t\t System.out.println(\"OFFSET \" + key + \" LEMMA \" + value);\n//\t\t\t\t // FOR LOOP\n//\t\t\t\t}\n//\t\t\t\tif (hds.offsetToLemma.containsKey(offsetVerbCand)){\n//\t\t\t\t\tString verbCandLemma = hds.offsetToLemma.get(offsetVerbCand);\n//\t\t\t\t\tif (hds.objectEqui.contains(verbCandLemma) || hds.subjectEqui.contains(verbCandLemma)){\n//\t\t\t\t\t\tSystem.out.println(\"SUBJCHAIN BEGIN verbCand \" + verbCand);\n//\t\t\t\t\t\tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t\tSystem.out.println(\"SUBJCHAINHEAD1\");\n\t\t\t\tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n//\t\t\t\tSystem.out.println(\"verbCand \" + verbCand);\n\t\t\t\t//hack for subj after obj said Zwickel (obj) on Monday morning (subj)\n\t\t\t\tif (language.equals(\"en\") \n\t\t\t\t\t\t&& hds.predicateToObject.containsKey(offsetVerbCand)\n\t\t\t\t\t\t){\n// \t\tSystem.out.println(\"CONTINUE DEP\");\n \t\tcontinue DEPENDENCYSEARCH;\n \t}\n\t\t\t\telse {\n\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n\t\t\t\t}\n }\n //Merkel is concerned\n else if (passSubjTag.contains(typedDependency.reln().toString())){\n \t//Merkel was reported\n \t//Merkel was concerned\n \t//Merkel was quoted\n \thds.predicateToSubjectChainHead.clear();\n \thds.subjectToPredicateChainHead.clear();\n \tverbCand = typedDependency.gov().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.gov().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.gov().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n//\t\t\t\tSystem.out.println(\"VERBCand \" + verbCand + offsetVerbCand);\n//\t\t\t\tif (hds.offsetToLemma.containsKey(offsetVerbCand)){\n//\t\t\t\t\tString verbCandLemma = hds.offsetToLemma.get(offsetVerbCand);\n////\t\t\t\t\tSystem.out.println(\"LEMMA verbCand \" + verbCandLemma);\n//\t\t\t\t\tif (hds.objectEqui.contains(verbCandLemma) || hds.subjectEqui.contains(verbCandLemma)){\n//\t\t\t\t\t\tSystem.out.println(\"SUBJCHAIN BEGIN verbCand \" + verbCand);\n//\t\t\t\t\t\tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n//\t\t\t\t\t}\n//\t\t\t\t}\n \t\n \tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n// \tSystem.out.println(\"SUBJCHAINHEAD2\");\n \t//Merkel is concerned\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfPassiveOpinionVerb,\n \t\t\thds);\n }\n //Meanwhile, the ECB's vice-president, Christian Noyer, was reported at the start of the week to have said that the bank's future interest-rate moves\n// would depend on the behavior of wage negotiators as well as the pace of the economic recovery.\n\n else if (apposTag.contains(typedDependency.reln().toString())){\n \t\n \tString subjCand = typedDependency.gov().toString().toLowerCase();\n \tint beginSubjCand = typedDependency.gov().beginPosition();\n \tint endSubjCand = typedDependency.gov().endPosition();\n \tString offsetSubjCand = \"\" + beginSubjCand + \"-\" + endSubjCand;\n \tString appo = typedDependency.dep().toString().toLowerCase();\n\t\t\t\tint beginAppo = typedDependency.dep().beginPosition();\n\t\t\t\tint endAppo = typedDependency.dep().endPosition();\n\t\t\t\tString offsetAppo = \"\" + beginAppo + \"-\" + endAppo;\n\t\t\t\t\n// \tSystem.out.println(\"APPOSITION1 \" + subjCand + \"::\"+ appo + \":\" + offsetSubjCand + \" \" + offsetAppo);\n \thds.subjectToApposition.put(offsetSubjCand, offsetAppo);\n }\n else if (relclauseTag.contains(typedDependency.reln().toString())){\n \tString subjCand = typedDependency.gov().toString().toLowerCase();\n \tint beginSubjCand = typedDependency.gov().beginPosition();\n \tint endSubjCand = typedDependency.gov().endPosition();\n \tString offsetSubjCand = \"\" + beginSubjCand + \"-\" + endSubjCand;\n \tverbCand = typedDependency.dep().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.dep().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.dep().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n\t\t\t\tString subjCandPos = null;\n\t\t\t\tif (hds.predicateToSubject.containsKey(offsetVerbCand)){\n\t\t\t\t\t\n\t\t\t\t\tif (subjCand.matches(\".+?/.+?\")) { \n\t\t\t\t\t\telements = subjCand.split(\"/\");\n\t\t\t\t\t\tsubjCand = elements[0];\n\t\t\t\t\t\tsubjCandPos = elements[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tString del = hds.predicateToSubject.get(offsetVerbCand);\n\t\t\t\t\thds.predicateToSubject.remove(offsetVerbCand);\n\t\t\t\t\thds.subjectToPredicate.remove(del);\n\t\t\t\t\thds.normalPredicateToSubject.remove(offsetVerbCand);\n\t\t\t\t\thds.subjectToNormalPredicate.remove(del);\n//\t\t\t\t\tSystem.out.println(\"REMOVE RELPRO \" + verbCand + \"/\" + hds.offsetToLemma.get(del));\n\t\t\t\t\thds.predicateToSubject.put(offsetVerbCand, offsetSubjCand);\n\t\t\t\t\thds.subjectToPredicate.put( offsetSubjCand, offsetVerbCand);\n\t\t\t\t\thds.normalPredicateToSubject.put(offsetVerbCand, offsetSubjCand);\n\t\t\t\t\thds.subjectToNormalPredicate.put( offsetSubjCand, offsetVerbCand);\n//\t\t\t\t\tSystem.out.println(\"RELCLAUSE \" + subjCand + \"::\" + \":\" + verbCand);\n\t\t\t\t\thds.offsetToSubjectHead.put(offsetSubjCand,subjCand);\n\t\t\t\t\thds.SubjectHead.add(offsetSubjCand);\n\t\t\t\t\t\n\t\t\t\t\tif (subjCandPos != null && hds.pronTag.contains(subjCandPos)){\n\t\t\t\t\t\thds.PronominalSubject.add(offsetSubjCand);\n\t\t\t\t\t}\n\t\t\t\t}\n \t\n \t\n }\n \n else if (dirObjTag.contains(typedDependency.reln().toString())\n \t\t){\n \tstoreRelations(typedDependency, hds.predicateToObject, hds.ObjectToPredicate, hds);\n \tverbCand = typedDependency.gov().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.gov().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.gov().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n\t\t\t\t\n\t\t\t\tString objCand = typedDependency.dep().toString().toLowerCase();\n \tint beginObjCand = typedDependency.dep().beginPosition();\n \tint endObjCand = typedDependency.dep().endPosition();\n \tString offsetObjCand = \"\" + beginObjCand + \"-\" + endObjCand;\n \tString objCandPos;\n \tif (objCand.matches(\".+?/.+?\")) { \n\t\t\t\t\telements = objCand.split(\"/\");\n\t\t\t\t\tobjCand = elements[0];\n\t\t\t\t\tobjCandPos = elements[1];\n//\t\t\t\t\tSystem.out.println(\"PRON OBJ \" + objCandPos);\n\t\t\t\t\tif (pronTag.contains(objCandPos)){\n\t\t\t\t\thds.PronominalSubject.add(offsetObjCand);\n\t\t\t\t\t}\n\t\t\t\t\t}\n// \tSystem.out.println(\"DIROBJ STORE ONLY\");\n \t//told Obama\n \t//said IG metall boss Klaus Zwickel\n \t// problem: pointing DO\n \t//explains David Gems, pointing out the genetically manipulated species.\n \t if (language.equals(\"en\") \n \t\t\t\t\t\t&& !hds.normalPredicateToSubject.containsKey(offsetVerbCand)\n \t\t\t\t\t\t){\n// \t\t System.out.println(\"INVERSE SUBJ HACK ENGLISH PREDTOOBJ\");\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n \t }\n }\n //was reported to have said\n else if (infVerbTag.contains(typedDependency.reln().toString())){\n \tstoreRelations(typedDependency, hds.mainToInfinitiveVerb, hds.infinitiveToMainVerb, hds);\n// \tSystem.out.println(\"MAIN-INF\");\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n \t\n }\n else if (aclauseTag.contains(typedDependency.reln().toString())){\n \tstoreRelations(typedDependency, hds.nounToInfinitiveVerb, hds.infinitiveVerbToNoun, hds);\n// \tSystem.out.println(\"NOUN-INF\");\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n \t\n }\n \n \n\n\t\t\t}\n\t\t\t\n//\t\t\tSemanticGraph dependencies = sentence.get(CollapsedCCProcessedDependenciesAnnotation.class);\n//\t\t\tSystem.out.println(\"SEM-DEP \" + dependencies);\t\n\t\t}\n\t\t\n\n\t\tMap<Integer, edu.stanford.nlp.dcoref.CorefChain> corefChains = document.get(CorefChainAnnotation.class);\n\t\t \n\t\t if (corefChains == null) { return; }\n\t\t //SPCOPY\n\t\t for (Entry<Integer, edu.stanford.nlp.dcoref.CorefChain> entry: corefChains.entrySet()) {\n//\t\t System.out.println(\"Chain \" + entry.getKey() + \" \");\n\t\t \tint chain = entry.getKey();\n\t\t String repMenNer = null;\n\t\t String repMen = null;\n\t\t String offsetRepMenNer = null;\n\n\t\t List<IaiCorefAnnotation> listCorefAnnotation = new ArrayList<IaiCorefAnnotation>();\n\t\t \n\t\t for (CorefMention m : entry.getValue().getMentionsInTextualOrder()) {\n\t\t \tboolean corefMentionContainsNer = false;\n\t\t \tboolean repMenContainsNer = false;\n\n//\t\t \n\n\t\t\t\t// We need to subtract one since the indices count from 1 but the Lists start from 0\n\t\t \tList<CoreLabel> tokens = sentences.get(m.sentNum - 1).get(TokensAnnotation.class);\n\t\t // We subtract two for end: one for 0-based indexing, and one because we want last token of mention not one following.\n//\t\t System.out.println(\" \" + m + \", i.e., 0-based character offsets [\" + tokens.get(m.startIndex - 1).beginPosition() +\n//\t\t \", \" + tokens.get(m.endIndex - 2).endPosition() + \")\");\n\t\t \n\t\t int beginCoref = tokens.get(m.startIndex - 1).beginPosition();\n\t\t\t\t int endCoref = tokens.get(m.endIndex - 2).endPosition();\n\t\t\t\t String offsetCorefMention = \"\" + beginCoref + \"-\" + endCoref;\n\t\t\t\t String corefMention = m.mentionSpan;\n\n\t\t\t\t CorefMention RepresentativeMention = entry.getValue().getRepresentativeMention();\n\t\t\t\t repMen = RepresentativeMention.mentionSpan;\n\t\t\t\t List<CoreLabel> repMenTokens = sentences.get(RepresentativeMention.sentNum - 1).get(TokensAnnotation.class);\n//\t\t\t\t System.out.println(\"REPMEN ANNO \" + \"\\\"\" + repMen + \"\\\"\" + \" is representative mention\" +\n// \", i.e., 0-based character offsets [\" + repMenTokens.get(RepresentativeMention.startIndex - 1).beginPosition() +\n//\t\t \", \" + repMenTokens.get(RepresentativeMention.endIndex - 2).endPosition() + \")\");\n\t\t\t\t int beginRepMen = repMenTokens.get(RepresentativeMention.startIndex - 1).beginPosition();\n\t\t\t\t int endRepMen = repMenTokens.get(RepresentativeMention.endIndex - 2).endPosition();\n\t\t\t\t String offsetRepMen = \"\" + beginRepMen + \"-\" + endRepMen;\n\t\t \t \n\t\t\t\t//Determine repMenNer that consists of largest NER (Merkel) to (Angela Merkel)\n\t\t\t\t //and \"Chancellor \"Angela Merkel\" to \"Angela Merkel\"\n\t\t \t //Further reduction to NER as in \"Chancellor Angela Merkel\" to \"Angela Merkel\" is\n\t\t\t\t //done in determineBestSubject. There, Chunk information and subjectHead info is available.\n\t\t\t\t //Chunk info and subjectHead info is used to distinguish \"Chancellor Angela Merkel\" to \"Angela Merkel\"\n\t\t\t\t //from \"The enemies of Angela Merkel\" which is not reduced to \"Angela Merkel\"\n\t\t\t\t //Problem solved: The corefMentions of a particular chain do not necessarily have the same RepMenNer (RepMen) \n\t\t\t\t // any more: Chancellor Angela Merkel repMenNer Chancellor Angela Merkel , then Angela Merkel has RepMenNer Angela Merkel\n\t\t\t\t if (offsetRepMenNer != null && hds.Ner.contains(offsetRepMenNer)){\n//\t\t\t\t\t System.out.println(\"NEWNer.contains(offsetRepMenNer)\");\n\t\t\t\t }\n\t\t\t\t else if (offsetRepMen != null && hds.Ner.contains(offsetRepMen)){\n\t\t\t\t\t repMenNer = repMen;\n\t\t\t\t\t\toffsetRepMenNer = offsetRepMen;\n//\t\t\t\t\t\tSystem.out.println(\"NEWNer.contains(offsetRepMen)\");\n\t\t\t\t }\n\t\t\t\t else if (offsetCorefMention != null && hds.Ner.contains(offsetCorefMention)){\n\t\t\t\t\t\trepMenNer = corefMention;\n\t\t\t\t\t\toffsetRepMenNer = offsetCorefMention;\n//\t\t\t\t\t\tSystem.out.println(\"Ner.contains(offsetCorefMention)\");\n\t\t\t\t\t}\n\t\t\t\t else {\n\t\t\t\t\t corefMentionContainsNer = offsetsContainAnnotation(offsetCorefMention,hds.Ner);\n\t\t\t\t\t repMenContainsNer = offsetsContainAnnotation(offsetRepMen,hds.Ner);\n//\t\t\t\t\t System.out.println(\"ELSE Ner.contains(offsetCorefMention)\");\n\t\t\t\t }\n\t\t\t\t //Determine repMenNer that contains NER\n\t\t\t\t\tif (repMenNer == null){\n\t\t\t\t\t\tif (corefMentionContainsNer){\n\t\t\t\t\t\t\trepMenNer = corefMention;\n\t\t\t\t\t\t\toffsetRepMenNer = offsetCorefMention;\n//\t\t\t\t\t\t\tSystem.out.println(\"DEFAULT1\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (repMenContainsNer){\n\t\t\t\t\t\t\trepMenNer = repMen;\n\t\t\t\t\t\t\toffsetRepMenNer = offsetRepMen;\n//\t\t\t\t\t\t\tSystem.out.println(\"DEFAULT2\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//no NER:\n\t\t\t\t\t\t//Pronoun -> repMen is repMenNer\n\t\t\t\t\t\telse if (hds.PronominalSubject.contains(offsetCorefMention) && repMen != null){\n\t\t\t\t\t\t\trepMenNer = repMen;\n\t\t\t\t\t\t\toffsetRepMenNer = offsetRepMen;\n//\t\t\t\t\t\t\tSystem.out.println(\"DEFAULT3\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t//other no NER: corefMention is repMenNer because it is closer to original\n\t\t\t\t\t\trepMenNer = corefMention;\n\t\t\t\t\t\toffsetRepMenNer = offsetCorefMention;\n//\t\t\t\t\t\tSystem.out.println(\"DEFAULT4\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t \n \t IaiCorefAnnotation corefAnnotation = new IaiCorefAnnotation(aJCas);\n\t\t\t\n\t\t\t\t\t\n\n\n\t\t\t\t\tcorefAnnotation.setBegin(beginCoref);\n\t\t\t\t\tcorefAnnotation.setEnd(endCoref);\n\t\t\t\t\tcorefAnnotation.setCorefMention(corefMention);\n\t\t\t\t\tcorefAnnotation.setCorefChain(chain);\n\t\t\t\t\t//done below\n//\t\t\t\t\tcorefAnnotation.setRepresentativeMention(repMenNer);\n//\t\t\t\t\tcorefAnnotation.addToIndexes(); \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tlistCorefAnnotation.add(corefAnnotation);\n\t\t\t\t\t\n//\t\t\t\t\tdone below:\n//\t\t\t\t\t offsetToRepMen.put(offsetCorefMention, repMenNer);\n//\t\t\t\t\t RepMen.add(offsetCorefMention);\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t }//end coref mention\n//\t\t System.out.println(\"END Chain \" + chain );\n//\t\t System.out.println(listCorefAnnotation.size());\n\t\t String offsetCorefMention = null;\n\t\t for (int i = 0; i < listCorefAnnotation.size(); i++) {\n\t\t \tIaiCorefAnnotation corefAnnotation = listCorefAnnotation.get(i);\n\t\t \tcorefAnnotation.setRepresentativeMention(repMenNer);\n\t\t \tcorefAnnotation.addToIndexes();\n\t\t \toffsetCorefMention = \"\" + corefAnnotation.getBegin() + \"-\" + corefAnnotation.getEnd();\n\t\t\t\t\thds.offsetToRepMen.put(offsetCorefMention, repMenNer);\n\t\t\t\t\thds.RepMen.add(offsetCorefMention);\n\t\t\t\t\t//COREF\n//\t\t\t\t\tSystem.out.println(\"Chain \" + corefAnnotation.getCorefChain());\n//\t\t\t\t\tSystem.out.println(\"corefMention \" + corefAnnotation.getCorefMention() + offsetCorefMention);\n//\t\t\t\t\tSystem.out.println(\"repMenNer \" + repMenNer);\n\t\t }\n\t\t } //end chains\n\n\n//\t\t System.out.println(\"NOW quote finder\");\n\n\n\t\t\n\t\t///* quote finder: begin find quote relation and quotee\n\t\t// direct quotes\n\t\t\n\t\t\n\t\tString quotee_left = null;\n\t\tString quotee_right = null; \n\t\t\n\t\tString representative_quotee_left = null;\n\t\tString representative_quotee_right = null; \n\t\t\n\t\tString quote_relation_left = null;\n\t\tString quote_relation_right = null;\n\t\t\n\t\tString quoteType = null;\n\t\tint quoteeReliability = 5;\n\t\tint quoteeReliability_left = 5;\n\t\tint quoteeReliability_right = 5;\n\t\tint quotee_end = -5;\n\t\tint quotee_begin = -5;\n\t\t\n\t\tboolean quoteeBeforeQuote = false;\n\n\n\t\n\t\t\n\t\t// these are all the quotes in this document\n\t\tList<CoreMap> quotes = document.get(QuotationsAnnotation.class);\n\t\tfor (CoreMap quote : quotes) {\n\t\t\tif (quote.get(TokensAnnotation.class).size() > 5) {\n\t\t\t\tQuoteAnnotation annotation = new QuoteAnnotation(aJCas);\n\n\t\t\t\tint beginQuote = quote.get(TokensAnnotation.class).get(0)\n\t\t\t\t\t\t.beginPosition();\n\t\t\t\tint endQuote = quote.get(TokensAnnotation.class)\n\t\t\t\t\t\t.get(quote.get(TokensAnnotation.class).size() - 1)\n\t\t\t\t\t\t.endPosition();\n\t\t\t\tannotation.setBegin(beginQuote);\n\t\t\t\tannotation.setEnd(endQuote);\n\t\t\t\tannotation.addToIndexes();\n//\t\t\t}\n//\t\t}\n//\t\t\n//\t\tList<Q> newQuotes = document.get(QuotationsAnnotation.class);\t\t\n//\t\tfor (CoreMap annotation : newQuotes) {\n//\t\t\t\tif (1==1){\n//\t\t\t\tRe-initialize markup variables since they are also used for indirect quotes\n\t\t\t\tquotee_left = null;\n\t\t\t\tquotee_right = null; \n\t\t\t\t\n\t\t\t\trepresentative_quotee_left = null;\n\t\t\t\trepresentative_quotee_right = null;\n\t\t\t\t\n\t\t\t\tquote_relation_left = null;\n\t\t\t\tquote_relation_right = null;\n\t\t\t\tquoteeReliability = 5;\n\t\t\t\tquoteeReliability_left = 5;\n\t\t\t\tquoteeReliability_right = 5;\n\t\t\t\tquotee_end = -5;\n\t\t\t\tquotee_begin = -5;\n\t\t\t\tquoteType = \"direct\";\n\t\t\t\tquoteeBeforeQuote = false;\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tList<Token> directQuoteTokens = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\tToken.class, annotation);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tList<Token> followTokens = JCasUtil.selectFollowing(aJCas,\n\t\t\t\t\t\tToken.class, annotation, 1);\n\t\t\t\t\n \n//\t\t\t\tfor (Token aFollowToken: followTokens){\n//\t\t\t\t\t List<Chunk> chunks = JCasUtil.selectCovering(aJCas,\n//\t\t\t\t\tChunk.class, aFollowToken);\n \n//direct quote quotee right:\n\t\t\t\t\n\t for (Token aFollow2Token: followTokens){\n\t\t\t\t\t List<SentenceAnnotation> sentencesFollowQuote = JCasUtil.selectCovering(aJCas,\n\t\t\t\t\t\t\t SentenceAnnotation.class, aFollow2Token);\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t for (SentenceAnnotation sentenceFollowsQuote: sentencesFollowQuote){\n\t\t\t\t\t\t List<Chunk> chunks = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\tChunk.class, sentenceFollowsQuote);\n//\t\t\tSystem.out.println(\"DIRECT QUOTE RIGHT\");\n\t\t\tString[] quote_annotation_result = determine_quotee_and_quote_relation(\"RIGHT\", \n\t\t\t\t\tchunks, hds, annotation);\n\t\t\tif (quote_annotation_result.length>=4){\n\t\t\t quotee_right = quote_annotation_result[0];\n\t\t\t representative_quotee_right = quote_annotation_result[1];\n\t\t\t quote_relation_right = quote_annotation_result[2];\n\t\t\t try {\n\t\t\t\t quoteeReliability = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t quoteeReliability_right = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t //Will Throw exception!\n\t\t\t //do something! anything to handle the exception.\n\t\t\t\tquoteeReliability = -5;\n\t\t\t\tquoteeReliability_right = -5;\n\t\t\t\t}\t\t\t\t\t \n\t\t\t }\n//\t\t\tSystem.out.println(\"DIRECT QUOTE RIGHT RESULT quotee \" + quotee_right + \" representative_quotee \" + representative_quotee_right\n//\t\t\t\t\t+ \" quote_relation \" + quote_relation_right);\n\t\t \n\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\t \n }\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tList<Token> precedingTokens = JCasUtil.selectPreceding(aJCas,\n\t\t\t\t\t\tToken.class, annotation, 1);\n for (Token aPrecedingToken: precedingTokens){ \n \t\n \tif (directQuoteIntro.contains(aPrecedingToken.getLemma().getValue().toString()) \n \t\t\t|| compLemma.contains(aPrecedingToken.getLemma().getValue().toString())) {\n// \t\tSystem.out.println(\"Hello, World lemma found\" + aPrecedingToken.getLemma().getValue());\n \t\tquoteeBeforeQuote = true;\n \t}\n \t\tList <NamedEntity> namedEntities = null;\n \t\tList <Token> tokens = null;\n \t\tList<Chunk> chunks = null;\n \t\t\n\t\t\t\t List<Sentence> precedingSentences = JCasUtil.selectPreceding(aJCas,\n\t\t\t\t \t\tSentence.class, aPrecedingToken, 1);\n\t\t\t\t \n\t\t\t\t\t\tif (precedingSentences.isEmpty()){\n\t\t\t\t\t\t\tList<Sentence> firstSentence;\n\t\t\t\t \tfirstSentence = JCasUtil.selectCovering(aJCas,\n\t\t\t\t \t\tSentence.class, aPrecedingToken);\n\n\t\t\t\t \tfor (Sentence aSentence: firstSentence){\n\t\t\t\t \t\t\n\n\t\t\t\t\t\t\t\tchunks = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\t\tChunk.class, aSentence.getBegin(), aPrecedingToken.getEnd());\n\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t \t\tnamedEntities = JCasUtil.selectCovered(aJCas,\n\t \t \t\tNamedEntity.class, aSentence.getBegin(), aPrecedingToken.getEnd());\n\t\t\t\t \t\ttokens = JCasUtil.selectCovered(aJCas,\n\t\t\t\t \t\t\t\tToken.class, aSentence.getBegin(), aPrecedingToken.getEnd());\n\t\t\t\t \t\n\t\t\t\t \t}\n\t\t\t\t\t\t}\n\t\t\t\t else {\t\n\t\t\t\t \tfor (Sentence aSentence: precedingSentences){\n//\t\t\t\t \t\tSystem.out.println(\"Hello, World sentence\" + aSentence);\n\t\t\t\t \t\tchunks = JCasUtil.selectBetween(aJCas,\n\t\t\t\t \t\t\t\tChunk.class, aSentence, aPrecedingToken);\n\t\t\t\t \t\tnamedEntities = JCasUtil.selectBetween(aJCas,\n\t\t\t\t \t\t\t\tNamedEntity.class, aSentence, aPrecedingToken);\n\t\t\t\t \t\ttokens = JCasUtil.selectBetween(aJCas,\n\t\t\t\t \t\t\t\tToken.class, aSentence, aPrecedingToken);\n\t\t\t\t \t}\n\t\t\t\t }\n \t\n//\t\t\t\t \n//\t\t\t\t\t\tSystem.out.println(\"DIRECT QUOTE LEFT\");\n\t\t\t\t\t\tString[] quote_annotation_direct_left = determine_quotee_and_quote_relation(\"LEFT\", chunks,\n\t\t\t\t\t\t\t\t hds, annotation\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t );\n//\t\t\t\t\t\tSystem.out.println(\"QUOTE ANNOTATION \" + quote_annotation_direct_left.length);\t\t\n\t\tif (quote_annotation_direct_left.length>=4){\n//\t\t\tSystem.out.println(\"QUOTE ANNOTATION UPDATE \" + quote_annotation_direct_left[0] +\n//\t\t\t\t\t\" \" + quote_annotation_direct_left[1] + \" \" +\n//\t\t\t\t\tquote_annotation_direct_left[2]);\n\t\t quotee_left = quote_annotation_direct_left[0];\n\t\t representative_quotee_left = quote_annotation_direct_left[1];\n\t\t quote_relation_left = quote_annotation_direct_left[2];\n\t\t try {\n\t\t\t quoteeReliability = Integer.parseInt(quote_annotation_direct_left[3]);\n\t\t\t quoteeReliability_left = Integer.parseInt(quote_annotation_direct_left[3]);\n\t\t\t} catch (NumberFormatException e) {\n\t\t //Will Throw exception!\n\t\t //do something! anything to handle the exception.\n\t\t\tquoteeReliability = -5;\n\t\t\tquoteeReliability_left = -5;\n\t\t\t}\t\t\t\t\t \n\t\t }\n//\t\tSystem.out.println(\"DIRECT QUOTE LEFT RESULT quotee \" + quotee_left + \" representative_quotee \" + representative_quotee_left\n//\t\t\t\t+ \" quote_relation \" + quote_relation_left);\n\t\t//no subject - predicate quotee quote_relation, quote introduced with colon: \n\t\tif (quotee_left == null && quote_relation_left == null && representative_quotee_left == null \n\t\t&& directQuoteIntro.contains(aPrecedingToken.getLemma().getValue().toString())){\n//\t\t\tSystem.out.println(\"NER DIRECT QUOTE LEFT COLON\");\n\t\t\tString quoteeCandOffset = null; \n\t\t\tString quoteeCandText = null;\n\t\t if (namedEntities.size() == 1){\n \t \tfor (NamedEntity ne : namedEntities){\n// \t \t\tSystem.out.println(\"ONE NER \" + ne.getCoveredText());\n \t \t\tquoteeCandText = ne.getCoveredText();\n\t\t\t\t\tquote_relation_left = aPrecedingToken.getLemma().getValue().toString();\n\t\t\t\t\tquotee_end = ne.getEnd();\n\t\t\t\t\tquotee_begin = ne.getBegin();\n\t\t\t\t\tquoteeCandOffset = \"\" + quotee_begin + \"-\" + quotee_end;\n\t\t\t\t\tquoteeReliability = 1;\n\t\t\t\t\tquoteeReliability_left = 1;\n \t }\n \t }\n \t else if (namedEntities.size() > 1) {\n \t \tint count = 0;\n \t \tString quotee_cand = null;\n// \t \tSystem.out.println(\"Hello, World ELSE SEVERAL NER\");\n \t \tfor (NamedEntity ner : namedEntities){\n// \t \t\tSystem.out.println(\"Hello, World NER TYPE\" + ner.getValue());\n \t \t\tif (ner.getValue().equals(\"PERSON\")){\n \t \t\t\tcount = count + 1;\n \t \t\t\tquotee_cand = ner.getCoveredText();\n \t \t\t\tquotee_end = ner.getEnd();\n \t \t\t\tquotee_begin = ner.getBegin();\n \t \t\t\tquoteeCandOffset = \"\" + quotee_begin + \"-\" + quotee_end;\n \t \t\t\t\n// \t \t\t\tSystem.out.println(\"Hello, World FOUND PERSON\" + quotee_cand);\n \t \t\t}\n \t \t}\n \t \tif (count == 1){ // there is exactly one NER.PERSON\n// \t \t\tSystem.out.println(\"ONE PERSON, SEVERAL NER \" + quotee_cand);\n \t \t\t\tquoteeCandText = quotee_cand;\n\t\t\t\t\t\tquote_relation_left = aPrecedingToken.getLemma().getValue().toString();\n\t\t\t\t\t\tquoteeReliability = 3;\n\t\t\t\t\t\tquoteeReliability_left = 3;\n \t \t}\n \t }\n\t\t if(quoteeCandOffset != null && quoteeCandText != null ){\n//\t\t \t quotee_left = quoteeCandText;\n\t\t \t String result [] = determineBestRepMenSubject(\n\t\t \t\t\t quoteeCandOffset,quoteeCandOffset, quoteeCandText, hds);\n\t\t \t if (result.length>=2){\n\t\t \t\t quotee_left = result [0];\n\t\t \t\t representative_quotee_left = result [1];\n//\t\t \t System.out.println(\"RESULT2 NER quotee \" + quotee_left + \" representative_quotee \" + representative_quotee_left);\n\t\t \t }\n\t\t }\n\t\t}\n }\n\t\t\n \n\n\t\t\t\t\n\t\t\t\tif (quotee_left != null && quotee_right != null){\n//\t\t\t\t\tSystem.out.println(\"TWO QUOTEES\");\n\t\t\t\t\t\n\t\t\t\t\tif (directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\".\") \n\t\t\t\t\t\t|| \tdirectQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"!\")\n\t\t\t\t\t\t|| directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"?\")\n\t\t\t\t\t\t\t){\n//\t\t\t\t\t\tSystem.out.println(\"PUNCT \" + quotee_left + quote_relation_left + quoteeReliability_left);\n\t\t\t\t\t\tannotation.setQuotee(quotee_left);\n\t\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_left);\n\n\t\t\t\t\t}\n\t\t\t\t\telse if (directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\",\")){\n//\t\t\t\t\t\tSystem.out.println(\"COMMA \" + quotee_right + \" \" + quote_relation_right + \" \" + quoteeReliability_right);\n\t\t\t\t\t\tannotation.setQuotee(quotee_right);\n\t\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_right);\n\t\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_right);\n\t\t\t\t\t}\n\t\t\t\t\telse if (!directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\".\")\n\t\t\t\t\t\t\t&& !directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"!\")\n\t\t\t\t\t\t\t&& !directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"?\")\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t){\n//\t\t\t\t\t\tSystem.out.println(\"NO PUNCT \" + quotee_right + \" \" + quote_relation_right + \" \" + quoteeReliability_right);\n\t\t\t\t\t\tannotation.setQuotee(quotee_right);\n\t\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_right);\n\t\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_right);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n//\t\t\t\t\t\tSystem.out.println(\"UNCLEAR LEFT RIGHT \" + quotee_left + quote_relation_left + quote + quotee_right + quote_relation_right);\n\t\t\t\t\tannotation.setQuotee(\"<unclear>\");\n\t\t\t\t\tannotation.setQuoteRelation(\"<unclear>\");\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (quoteeBeforeQuote == true){\n\t\t\t\t\tannotation.setQuotee(quotee_left);\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t}\n\t\t\t\telse if (quotee_left != null){\n//\t\t\t\t\tSystem.out.println(\"QUOTEE LEFT\" + quotee_left + quote_relation_left + quoteeReliability_left);\n\t\t\t\t\tannotation.setQuotee(quotee_left);\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t}\n\t\t\t\telse if (quotee_right != null){\n//\t\t\t\t\tSystem.out.println(\"QUOTEE RIGHT FOUND\" + quotee_right + \" QUOTE RELATION \" + quote_relation_right + \":\" + quoteeReliability_right);\n\t\t\t\t\tannotation.setQuotee(quotee_right);\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_right);\n\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_right);\n\t\t\t\t}\n\t\t\t\telse if (quote_relation_left != null ){\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n//\t\t\t\t\tSystem.out.println(\"NO QUOTEE FOUND\" + quote + quote_relation_left + quote_relation_right);\n\t\t\t\t}\n\t\t\t\telse if (quote_relation_right != null){\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t}\n\t\t\t\telse if (quoteType != null){\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n//\t\t\t\t\tSystem.out.println(\"Hello, World NO QUOTEE and NO QUOTE RELATION FOUND\" + quote);\n\t\t\t\t}\n\t\t\t\tif (annotation.getRepresentativeQuoteeMention() != null){\n//\t\t\t\t\tSystem.out.println(\"NOW!!\" + annotation.getRepresentativeQuoteeMention());\n\t\t\t\t\tif (hds.dbpediaSurfaceFormToDBpediaLink.containsKey(annotation.getRepresentativeQuoteeMention())){\n\t\t\t\t\t\tannotation.setQuoteeDBpediaUri(hds.dbpediaSurfaceFormToDBpediaLink.get(annotation.getRepresentativeQuoteeMention()));\n//\t\t\t\t\t\tSystem.out.println(\"DBPRED FOUND\" + annotation.getRepresentativeQuoteeMention() + \" URI: \" + annotation.getQuoteeDBpediaUri());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} //for direct quote\n\t\t\n\t\t// annotate indirect quotes: opinion verb + 'that' ... until end of sentence: said that ...\n\n//\t\tList<CoreMap> sentences = document.get(SentencesAnnotation.class); //already instantiated above\nINDIRECTQUOTE:\t\tfor (CoreMap sentence : sentences) {\n//\t\t\tif (sentence.get(TokensAnnotation.class).size() > 5) { \n\t\t\t\tSentenceAnnotation sentenceAnn = new SentenceAnnotation(aJCas);\n\t\t\t\t\n\t\t\t\tint beginSentence = sentence.get(TokensAnnotation.class).get(0)\n\t\t\t\t\t\t.beginPosition();\n\t\t\t\tint endSentence = sentence.get(TokensAnnotation.class)\n\t\t\t\t\t\t.get(sentence.get(TokensAnnotation.class).size() - 1)\n\t\t\t\t\t\t.endPosition();\n\t\t\t\tsentenceAnn.setBegin(beginSentence);\n\t\t\t\tsentenceAnn.setEnd(endSentence);\n//\t\t\t\tsentenceAnn.addToIndexes();\n\t\t\t\t\n\t\t\t\tQuoteAnnotation indirectQuote = new QuoteAnnotation(aJCas);\n\t \tint indirectQuoteBegin = -5;\n\t\t\t\tint indirectQuoteEnd = -5;\n\t\t\t\tboolean subsequentDirectQuoteInstance = false;\n\t\t\t\t\n\t\t\t\tList<Chunk> chunksIQ = JCasUtil.selectCovered(aJCas,\n\t\t\t\tChunk.class, sentenceAnn);\n\t\t\t\tList<Chunk> chunksBeforeIndirectQuote = null;\n\t\t\t\t\n\t\t\t\tint index = 0;\nINDIRECTCHUNK:\tfor (Chunk aChunk : chunksIQ) {\n\t\t\t\t\tindex++;\n\t\t\t\t\t\n//\t\t\t\t\tSystem.out.println(\"INDIRECT QUOTE CHUNK VALUE \" + aChunk.getChunkValue().toString());\n//\t\t\t\t\tif (aChunk.getChunkValue().equals(\"SBAR\")) {\n\t\t\t\t\tif(indirectQuoteIntroChunkValue.contains(aChunk.getChunkValue())){\n//\t\t\t\t\t\tSystem.out.println(\"INDIRECT QUOTE INDEX \" + \"\" + index);\n\t\t\t\t\t\t\n\t\t\t\t\t\tList<Token> tokensSbar = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\tToken.class, aChunk);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (Token aTokenSbar : tokensSbar){\n//\t\t\t\t\t\t\tString that = \"that\";\n\t\t\t\t\t\t\tif (compLemma.contains(aTokenSbar.getLemma().getCoveredText())){\n\t\t\t\t\t\t// VP test: does that clause contain VP?\n//\t\t\t\t\t\t\t\tSystem.out.println(\"TOK1\" + aTokenSbar.getLemma().getCoveredText());\n//\t\t\t \tQuoteAnnotation indirectQuote = new QuoteAnnotation(aJCas);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t indirectQuoteBegin = aChunk.getEnd() + 1;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t chunksBeforeIndirectQuote = chunksIQ.subList(0, index-1);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//NEW\n//\t\t\t\t\t\t\t\tif (LANGUAGE == \"en\")\n\t\t\t\t\t\t\t\tList<Token> precedingSbarTokens = JCasUtil.selectPreceding(aJCas,\n\t\t\t\t\t\t\t\t\t\tToken.class, aChunk, 1);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfor (Token aPrecedingSbarToken: precedingSbarTokens){ \n//\t\t\t\t\t\t\t\t\tSystem.out.println(\"TOK2\" + aPrecedingSbarToken.getLemma().getCoveredText());\n\t\t\t\t \tif (coordLemma.contains(aPrecedingSbarToken.getLemma().getValue().toString())){\n//\t\t\t\t \t\tSystem.out.println(\"TOKK\" + aPrecedingSbarToken.getLemma().getCoveredText());\n\t\t\t\t \t\tchunksBeforeIndirectQuote = chunksIQ.subList(0, index-1);\n\t\t\t\t \t\tint k = 0;\n\t\t\t\t \tSAY:\tfor (Chunk chunkBeforeAndThat : chunksBeforeIndirectQuote){\n//\t\t\t\t \t\t\txxxx\n\t\t\t\t \t\tk++;\n\t\t\t\t \t\t\tif (chunkBeforeAndThat.getChunkValue().equals(\"VP\")){\n\t\t\t\t \t\t\t\t\n\t\t\t\t \t\t\t\tList<Token> tokensInVp = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tToken.class, chunkBeforeAndThat);\n\t\t\t\t\t\t\t\t\t\t\t\tfor (Token aTokenInVp : tokensInVp){\n//\t\t\t\t\t\t\t\t\t\t\t\t\tString and;\n//\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"TOKK\" + aTokenInVp.getLemma().getCoveredText());\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (aTokenInVp.getLemma().getValue().equals(\"say\")){\n//\t\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"SAY OLD\" + indirectQuoteBegin + \":\" + sentenceAnn.getCoveredText());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tchunksBeforeIndirectQuote = chunksIQ.subList(0, k);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tindirectQuoteBegin = chunksBeforeIndirectQuote.get(chunksBeforeIndirectQuote.size()-1).getEnd()+1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"SAY NEW\" + indirectQuoteBegin + \":\" );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak SAY;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t \t\t\t\t\n\t\t\t\t \t\t\t\t\n\t\t\t\t \t\t\t}\n\t\t\t\t \t\t\t\n\t\t\t\t \t\t\t\n\t\t\t\t \t\t}\n\t\t\t\t \t\t\n\t\t\t\t \t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tList<QuoteAnnotation> coveringDirectQuoteChunk = JCasUtil.selectCovering(aJCas,\n\t\t\t\t\t\t\t\t\t\tQuoteAnnotation.class, aChunk);\n\t\t\t\t\t\t\t\tif (coveringDirectQuoteChunk.isEmpty()){\n//\t\t\t\t\t\t\t\t indirectQuoteBegin = aChunk.getEnd() + 1;\n\t\t\t\t\t\t\t\t indirectQuote.setBegin(indirectQuoteBegin);\n//\t\t\t\t\t\t\t\t chunksBeforeIndirectQuote = chunksIQ.subList(0, index-1);\n\t\t\t\t\t\t\t\t indirectQuoteEnd = sentenceAnn.getEnd();\n\t\t\t\t\t\t\t\t indirectQuote.setEnd(indirectQuoteEnd);\n\t\t\t\t\t\t\t\t indirectQuote.addToIndexes();\n\t\t\t\t\t\t\t\t subsequentDirectQuoteInstance = false;\n//\t\t\t\t\t\t\t\t System.out.println(\"SUBSEQUENT FALSE\");\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t List<Token> followTokens = JCasUtil.selectFollowing(aJCas,\n\t\t\t\t\t\t\t\t\t\t\tToken.class, indirectQuote, 1);\n\t\t\t\t\t\t\t\t for (Token aFollow3Token: followTokens){\n\t\t\t\t\t\t\t\t\t List<QuoteAnnotation> subsequentDirectQuotes = JCasUtil.selectCovering(aJCas,\n\t\t\t\t\t\t\t\t\t\t\tQuoteAnnotation.class,aFollow3Token);\n\t\t\t\t\t\t\t\t\t if (!subsequentDirectQuotes.isEmpty()){\n\t\t\t\t\t\t\t\t\t\t for (QuoteAnnotation subsequentDirectQuote: subsequentDirectQuotes){\n\t\t\t\t\t\t\t\t\t\t\t if (subsequentDirectQuote.getRepresentativeQuoteeMention() != null\n\t\t\t\t\t\t\t\t\t\t\t\t && subsequentDirectQuote.getRepresentativeQuoteeMention().equals(\"<unclear>\")){\n//\t\t\t\t\t\t\t\t\t\t\t System.out.println(\"SUBSEQUENT FOUND\"); \n\t\t\t\t\t\t\t\t\t\t\t hds.subsequentDirectQuote = subsequentDirectQuote;\n\t\t\t\t\t\t\t\t\t\t\t subsequentDirectQuoteInstance = true;\n\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t break INDIRECTCHUNK;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\n\t\t\t\t}\n\t\t\t\t\tif (indirectQuoteBegin >= 0 && indirectQuoteEnd >= 0){\n//\t\t\t\t\t\tList<QuoteAnnotation> coveringDirectQuote = JCasUtil.selectCovering(aJCas,\n//\t\t\t\t\t\t\t\tQuoteAnnotation.class, indirectQuote);\n//\t\t\t\t\t\tif (coveringDirectQuote.isEmpty()){\n////\t\t\t\t\t\t\t\n//\t\t\t\t\t\tindirectQuote.addToIndexes();\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\telse {\n//\t\t\t\t\t\t\t//indirect quote is covered by direct quote and therefore discarded\n//\t\t\t\t\t\t\tcontinue INDIRECTQUOTE;\n//\t\t\t\t\t\t}\n\t\t\t\t\tList<QuoteAnnotation> coveredDirectQuotes = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\tQuoteAnnotation.class, indirectQuote);\n\t\t\t\t\tfor (QuoteAnnotation coveredDirectQuote : coveredDirectQuotes){\n//\t\t\t\t\t\tSystem.out.println(\"Hello, World covered direct quote\" + coveredDirectQuote.getCoveredText());\n\t\t\t\t\t\t//delete coveredDirectQuoteIndex\n\t\t\t\t\t\tcoveredDirectQuote.removeFromIndexes();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t//no indirect quote in sentence\n\t\t\t\t\t\tcontinue INDIRECTQUOTE;\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n//\t\t\t\t\t\tRe-initialize markup variables since they are also used for direct quotes\n\t\t\t\t\t\tquotee_left = null;\n\t\t\t\t\t\tquotee_right = null; \n\t\t\t\t\t\t\n\t\t\t\t\t\trepresentative_quotee_left = null;\n\t\t\t\t\t\trepresentative_quotee_right = null;\n\t\t\t\t\t\t\n\t\t\t\t\t\tquote_relation_left = null;\n\t\t\t\t\t\tquote_relation_right = null;\n\t\t\t\t\t\t\n\t\t\t\t\t\tquoteType = \"indirect\";\n\t\t\t\t\t\tquoteeReliability = 5;\n\t\t\t\t\t\tquoteeReliability_left = 5;\n\t\t\t\t\t\tquoteeReliability_right = 5;\n\t\t\t\t\t\tquotee_end = -5;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\tif (chunksBeforeIndirectQuote != null){\n//\t\t\t\t\t\t\tSystem.out.println(\"chunksBeforeIndirectQuote FOUND!! \");\n\t\t\t\t\t\t\tString[] quote_annotation_result = determine_quotee_and_quote_relation(\"LEFT\", chunksBeforeIndirectQuote,\n\t\t\t\t\t\t\t\t\t hds, indirectQuote\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t );\n\t\t\tif (quote_annotation_result.length>=4){\n\t\t\t quotee_left = quote_annotation_result[0];\n\t\t\t representative_quotee_left = quote_annotation_result[1];\n\t\t\t quote_relation_left = quote_annotation_result[2];\n//\t\t\t System.out.println(\"INDIRECT QUOTE LEFT RESULT quotee \" + quotee_left + \" representative_quotee \" + representative_quotee_left\n//\t\t\t\t\t + \" QUOTE RELATION \" + quote_relation_left);\n\t\t\t try {\n\t\t\t\t quoteeReliability = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t quoteeReliability_left = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\tquoteeReliability = -5;\n\t\t\t\tquoteeReliability_left = -5;\n\t\t\t\t}\t\t\t\t\t \n\t\t\t }\n\t\t\t\n\t\t\t}\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (quotee_left != null){\n\t\t\t\t\t\t\tindirectQuote.setQuotee(quotee_left);\n\t\t\t\t\t\t\tindirectQuote.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\t\tindirectQuote.setQuoteType(quoteType);\n\t\t\t\t\t\t\tindirectQuote.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\t\t\tindirectQuote.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//indirect quote followed by direct quote:\n\t\t\t\t\t\t\t//the quotee and quote relation of the indirect quote are copied to the direct quote \n\t\t\t\t\t\t\t//Genetic researcher Otmar Wiestler hopes that the government's strict controls on genetic research \n\t\t\t\t\t\t\t//will be relaxed with the advent of the new ethics commission. \n\t\t\t\t\t\t\t//\"For one thing the government urgently needs advice, because of course it's such an extremely \n\t\t\t\t\t\t\t//complex field. And one of the reasons Chancellor Schröder formed this new commission was without \n\t\t\t\t\t\t\t//a doubt to create his own group of advisors.\"\n\n\t\t\t\t\t\t\tif (subsequentDirectQuoteInstance == true\n\t\t\t\t\t\t\t\t&&\thds.subsequentDirectQuote.getRepresentativeQuoteeMention().equals(\"<unclear>\")\n\t\t\t\t\t\t\t\t&& \thds.subsequentDirectQuote.getQuotee().equals(\"<unclear>\")\n\t\t\t\t\t\t\t\t&& \thds.subsequentDirectQuote.getQuoteRelation().equals(\"<unclear>\")\n\t\t\t\t\t\t\t\t\t){\n//\t\t\t\t\t\t\t\tSystem.out.println(\"SUBSEQUENT UNCLEAR DIR QUOTE FOUND!!\"); \n\t\t\t\t\t\t\t\tint begin = hds.subsequentDirectQuote.getBegin();\n\t\t\t\t\t\t\t\tint end = hds.subsequentDirectQuote.getEnd();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuotee(quotee_left);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuoteType(\"direct\");\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuoteeReliability(quoteeReliability_left + 2);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.addToIndexes();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\tSystem.out.println(\"Hello, World INDIRECT QUOTE \" + quotee_left + quote_relation_left + quoteeReliability);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (quote_relation_left != null){\n\t\t\t\t\t\t\tindirectQuote.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\t\tindirectQuote.setQuoteType(quoteType);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\telse if (quoteType != null){\n\t\t\t\t\t\t\tindirectQuote.setQuoteType(quoteType);\n//\t\t\t\t\t\t\tSystem.out.println(\"Hello, World INDIRECT QUOTE NOT FOUND\" + quote_relation_left);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (indirectQuote.getRepresentativeQuoteeMention() != null){\n//\t\t\t\t\t\t\tSystem.out.println(\"NOW!!\" + indirectQuote.getRepresentativeQuoteeMention());\n\t\t\t\t\t\t\tif (hds.dbpediaSurfaceFormToDBpediaLink.containsKey(indirectQuote.getRepresentativeQuoteeMention())){\n\t\t\t\t\t\t\t\tindirectQuote.setQuoteeDBpediaUri(hds.dbpediaSurfaceFormToDBpediaLink.get(indirectQuote.getRepresentativeQuoteeMention()));\n//\t\t\t\t\t\t\t\tSystem.out.println(\"DBPEDIA \" + indirectQuote.getRepresentativeQuoteeMention() + \" URI: \" + hds.dbpediaSurfaceFormToDBpediaLink.get(indirectQuote.getRepresentativeQuoteeMention()));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t }\n//\t\t\t} //for chunk\n//\t\t\t\tsay without that\n//\t\t\t}\t\t\n\t\t} //Core map sentences indirect quotes\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public void run() {\n try {\r\n TransformerFactory tFactory = TransformerFactory.newInstance();\r\n // Fortify Mod: prevent external entity injection\r\n tFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);\r\n Transformer transformer = tFactory.newTransformer();\r\n transformer.setOutputProperty(\"encoding\", \"UTF-8\");\r\n transformer.setOutputProperty(\"indent\", \"yes\");\r\n transformer.transform(new DOMSource(doc), new StreamResult(\r\n pos));\r\n } catch (Exception e) {\r\n throw new RuntimeException(\r\n \"Error converting Document to InputStream. \"\r\n + e.getMessage());\r\n } finally {\r\n try {\r\n pos.close();\r\n } catch (IOException e) {\r\n\r\n }\r\n }\r\n }", "private void textilizeNonBlankLine () {\n StringBuffer blockMod = new StringBuffer();\n int startPosition = 0;\n int textPosition = 0;\n leftParenPartOfURL = false;\n attributeType = 0;\n klass = new StringBuffer();\n id = new StringBuffer();\n style = new StringBuffer();\n language = new StringBuffer();\n String imageTitle = \"\";\n String imageURL = \"\";\n int endOfImageURL = -1;\n boolean doublePeriod = false;\n int periodPosition = line.indexOf (\".\");\n if (periodPosition >= 0) {\n textPosition = periodPosition + 1;\n if (textPosition < line.length()) {\n if (line.charAt (textPosition) == '.') {\n doublePeriod = true;\n textPosition++;\n }\n if (textPosition < line.length()\n && line.charAt (textPosition) == ' ') {\n textPosition++;\n textIndex = 0;\n while (textIndex < periodPosition\n && (Character.isLetterOrDigit (textChar()))) {\n blockMod.append (textChar());\n textIndex++;\n } // end while more letters and digits\n if (blockMod.toString().equals (\"p\")\n || blockMod.toString().equals (\"bq\")\n || blockMod.toString().equals (\"h1\")\n || blockMod.toString().equals (\"h2\")\n || blockMod.toString().equals (\"h3\")\n || blockMod.toString().equals (\"h4\")\n || blockMod.toString().equals (\"h5\")\n || blockMod.toString().equals (\"h6\")) {\n // look for attributes\n collectAttributes (periodPosition);\n } else {\n blockMod = new StringBuffer();\n textPosition = 0;\n }\n } // end if space follows period(s)\n } // end if not end of line following first period\n } // end if period found\n\n // Start processing at the beginning of the line\n textIndex = 0;\n\n // If we have a block modifier, then generate appropriate HTML\n if (blockMod.length() > 0) {\n lineDelete (textPosition);\n closeOpenBlockQuote();\n closeOpenBlock();\n doLists();\n if (blockMod.toString().equals (\"bq\")) {\n lineInsert (\"<blockquote><p\");\n context.blockQuoting = true;\n } else {\n lineInsert (\"<\" + blockMod.toString());\n }\n if (klass.length() > 0) {\n lineInsert (\" class=\\\"\" + klass.toString() + \"\\\"\");\n }\n lineInsert (\">\");\n if (doublePeriod) {\n context.nextBlock = blockMod.toString();\n } else {\n context.nextBlock = \"p\";\n }\n }\n\n // See if line starts with one or more list characters\n if (blockMod.length() <= 0) {\n while (textIndex < line.length()\n && (textChar() == '*'\n || textChar() == '#'\n || textChar() == ';')) {\n listChars.append (textChar());\n textIndex++;\n }\n if (listChars.length() > 0\n && (textIndex >= line.length()\n || ((! Character.isWhitespace (textChar()))\n && (textChar() != '(')))) {\n listChars = new StringBuffer();\n textIndex = 0;\n }\n int firstSpace = line.indexOf (\" \", textIndex);\n if (listChars.length() > 0) {\n collectAttributes (firstSpace);\n }\n }\n int endDelete = textIndex;\n if (endDelete < line.length()\n && Character.isWhitespace (line.charAt (endDelete))) {\n endDelete++;\n }\n\n if (listChars.length() > 0) {\n lineDelete (0, endDelete);\n }\n doLists();\n if (listChars.length() > 0\n && listChars.charAt(listChars.length() - 1) == ';') {\n lastDefChar = ';';\n } else {\n lastDefChar = ' ';\n }\n\n // See if this line contains a link alias\n if ((blockMod.length() <= 0)\n && ((line.length() - textIndex) >= 4)\n && (textChar() == '[')) {\n int rightBracketIndex = line.indexOf (\"]\", textIndex);\n if (rightBracketIndex > (textIndex + 1)) {\n linkAlias = true;\n String alias = line.substring (textIndex + 1, rightBracketIndex);\n String url = line.substring (rightBracketIndex + 1);\n lineDelete (line.length() - textIndex);\n lineInsert (\"<a alias=\\\"\" + alias + \"\\\" href=\\\"\" + url + \"\\\"> </a>\");\n }\n }\n\n // If no other instructions, use default start for a new line\n if (blockMod.length() <= 0 \n && listChars.length() <= 0\n & (! linkAlias)) {\n // This non-blank line does not start with a block modifier or a list char\n if (context.lastLineBlank) {\n if (context.nextBlock.equals (\"bq\")) {\n lineInsert (\"<p>\");\n } else {\n closeOpenBlockQuote();\n lineInsert (\"<\" + context.nextBlock + \">\");\n }\n } else {\n lineInsert (\"<br />\");\n }\n }\n\n // Now examine the rest of the line\n char last = ' ';\n char c = ' ';\n char next = ' ';\n leftParenPartOfURL = false;\n resetLineIndexArray();\n while (textIndex <= line.length()) {\n // Get current character, last character and next character\n last = c;\n if (textIndex < line.length()) {\n c = textChar();\n } else {\n c = ' ';\n }\n if ((textIndex + 1) < line.length()) {\n next = line.charAt (textIndex + 1);\n } else {\n next = ' ';\n }\n \n // ?? means a citation\n if (c == '?' && last == '?') {\n if (ix [CITATION] >= 0) {\n replaceWithHTML (CITATION, 2);\n } else {\n ix [CITATION] = textIndex - 1;\n textIndex++;\n }\n }\n else\n // __ means italics\n if (c == '_' && last == '_' && ix [QUOTE_COLON] < 0) {\n if (ix [ITALICS] >= 0) {\n replaceWithHTML (ITALICS, 2);\n } else {\n ix [ITALICS] = textIndex - 1;\n textIndex++;\n }\n }\n else\n // ** means bold\n if (c == '*' && last == '*') {\n if (ix [BOLD] >= 0) {\n replaceWithHTML (BOLD, 2);\n } else {\n ix [BOLD] = textIndex - 1;\n textIndex++;\n }\n }\n else\n // _ means emphasis\n if (c == '_' && next != '_' && ix [QUOTE_COLON] < 0) {\n if (ix [EMPHASIS] >= 0) {\n replaceWithHTML (EMPHASIS, 1);\n } else {\n ix [EMPHASIS] = textIndex;\n textIndex++;\n }\n }\n else\n // * means strong\n if (c == '*' && next != '*') {\n if (ix [STRONG] >= 0) {\n replaceWithHTML (STRONG, 1);\n } else {\n ix [STRONG] = textIndex;\n textIndex++;\n }\n }\n else\n // Exclamation points surround image urls\n if (c == '!' && Character.isLetter(next)\n && ix [QUOTE_COLON] < 0 && ix [EXCLAMATION] < 0) {\n // First exclamation point : store its location and move on\n ix [EXCLAMATION] = textIndex;\n textIndex++;\n }\n else\n // Second exclamation point\n if (c == '!'\n && ix [QUOTE_COLON] < 0 && ix [EXCLAMATION] >= 0) {\n // Second exclamation point\n imageTitle = \"\";\n endOfImageURL = textIndex;\n if (last == ')' && ix [EXCLAMATION_LEFT_PAREN] > 0) {\n ix [EXCLAMATION_RIGHT_PAREN] = textIndex - 1;\n endOfImageURL = ix [EXCLAMATION_LEFT_PAREN];\n imageTitle = line.substring\n (ix [EXCLAMATION_LEFT_PAREN] + 1, ix [EXCLAMATION_RIGHT_PAREN]);\n }\n imageURL = line.substring (ix [EXCLAMATION] + 1, endOfImageURL);\n // Delete the image url, title and parentheses,\n // but leave exclamation points for now.\n lineDelete (ix [EXCLAMATION] + 1, textIndex - ix [EXCLAMATION] - 1);\n String titleString = \"\";\n if (imageTitle.length() > 0) {\n titleString = \" title=\\\"\" + imageTitle + \"\\\" alt=\\\"\" + imageTitle + \"\\\"\";\n }\n lineInsert (ix [EXCLAMATION] + 1,\n \"<img src=\\\"\" + imageURL + \"\\\"\" + titleString + \" />\");\n if (next == ':') {\n // Second exclamation followed by a colon -- look for url for link\n ix [QUOTE_COLON] = textIndex;\n ix [LAST_QUOTE] = ix [EXCLAMATION];\n } else {\n lineDelete (ix [EXCLAMATION], 1);\n lineDelete (textIndex, 1);\n }\n ix [EXCLAMATION] = -1;\n ix [EXCLAMATION_LEFT_PAREN] = -1;\n ix [EXCLAMATION_RIGHT_PAREN] = -1;\n textIndex++;\n } // end if second exclamation point\n else\n // Parentheses within exclamation points enclose the image title\n if (c == '(' && ix [EXCLAMATION] > 0 ) {\n ix [EXCLAMATION_LEFT_PAREN] = textIndex;\n textIndex++;\n }\n else\n // Double quotation marks surround linked text\n if (c == '\"' && ix [QUOTE_COLON] < 0) {\n if (next == ':'\n && ix [LAST_QUOTE] >= 0\n && textIndex > (ix [LAST_QUOTE] + 1)) {\n ix [QUOTE_COLON] = textIndex;\n } else {\n ix [LAST_QUOTE] = textIndex;\n }\n textIndex++;\n }\n else\n // Flag a left paren inside of a url\n if (c == '(' && ix [QUOTE_COLON] > 0) {\n leftParenPartOfURL = true;\n textIndex++;\n }\n else\n // Space may indicate end of url\n if (Character.isWhitespace (c)\n && ix [QUOTE_COLON] > 0\n && ix [LAST_QUOTE] >= 0\n && textIndex > (ix [QUOTE_COLON] + 2)) {\n int endOfURL = textIndex - 1;\n // end of url is last character of url\n // do not include any trailing punctuation at end of url\n int backup = 0;\n while ((endOfURL > (ix [QUOTE_COLON] + 2))\n && (! Character.isLetterOrDigit (line.charAt(endOfURL)))\n && (! ((line.charAt(endOfURL) == ')') && (leftParenPartOfURL)))\n && (! (line.charAt(endOfURL) == '/'))) {\n endOfURL--;\n backup++;\n }\n String url = line.substring (ix [QUOTE_COLON] + 2, endOfURL + 1);\n // insert the closing anchor tag\n lineInsert (endOfURL + 1, \"</a>\");\n // Delete the quote, colon and url from the line\n lineDelete (ix [QUOTE_COLON], endOfURL + 1 - ix [QUOTE_COLON]);\n // insert the beginning of the anchor tag\n lineDelete (ix [LAST_QUOTE], 1);\n lineInsert (ix [LAST_QUOTE], \"<a href=\\\"\" + url + \"\\\">\");\n // Reset the pointers\n ix [QUOTE_COLON] = -1;\n ix [LAST_QUOTE] = -1;\n leftParenPartOfURL = false;\n // Increment the index to the next character\n if (backup > 0) {\n textIndex = textIndex - backup;\n } else {\n textIndex++;\n }\n }\n else\n // Look for start of definition\n if ((c == ':' || c == ';')\n && Character.isWhitespace(last)\n && Character.isWhitespace(next)\n && listChars.length() > 0\n && (lastDefChar == ';' || lastDefChar == ':')) {\n lineDelete (textIndex - 1, 3);\n lineInsert (closeDefinitionTag (lastDefChar)\n + openDefinitionTag (c));\n lastDefChar = c;\n }\n /* else\n // -- means an em dash\n if (c == '-' && last == '-') {\n textIndex--;\n lineDelete (2);\n lineInsert (\"&#8212;\");\n } */ else {\n textIndex++;\n }\n }// end while more characters to examine\n\n context.lastLineBlank = false;\n\n }", "public void testGetComplexText() throws Exception {\n \t\tXWPFWordExtractor extractor = \n \t\t\tnew XWPFWordExtractor(xmlB);\n \t\textractor.getText();\n \t\t\n \t\tString text = extractor.getText();\n \t\tassertTrue(text.length() > 0);\n \t\t\n \t\tchar euro = '\\u20ac';\n \t\tSystem.err.println(\"'\"+text.substring(text.length() - 20) + \"'\");\n \t\t\n \t\t// Check contents\n \t\tassertTrue(text.startsWith(\n \t\t\t\t\" \\n(V) ILLUSTRATIVE CASES\\n\\n\"\n \t\t));\n\t\tassertTrue(text.endsWith(\n \t\t\t\t\"As well as gaining \"+euro+\"90 from child benefit increases, he will also receive the early childhood supplement of \"+euro+\"250 per quarter for Vincent for the full four quarters of the year.\\n\\n\\n\\n \\n\\n\\n\"\n \t\t));\n \t\t\n \t\t// Check number of paragraphs\n \t\tint ps = 0;\n \t\tchar[] t = text.toCharArray();\n \t\tfor (int i = 0; i < t.length; i++) {\n \t\t\tif(t[i] == '\\n') { ps++; }\n \t\t}\n\t\tassertEquals(79, ps);\n \t}", "private void textilize () {\n\n textIndex = 0;\n int textEnd = line.length() - 1;\n listChars = new StringBuffer();\n linkAlias = false;\n while (textIndex < line.length()\n && (Character.isWhitespace(textChar()))) {\n textIndex++;\n }\n while (textEnd >= 0\n && textEnd >= textIndex\n && Character.isWhitespace (line.charAt (textEnd))) {\n textEnd--;\n }\n boolean blankLine = (textIndex >= line.length());\n if (blankLine) {\n textilizeBlankLine();\n }\n else\n if ((textIndex > 0)\n || ((line.length() > 0 )\n && (line.charAt(0) == '<'))) {\n // First character is white space of the beginning of an html tag:\n // Doesn't look like textile... process it without modification.\n }\n else\n if (((textEnd - textIndex) == 3)\n && line.substring(textIndex,textEnd + 1).equals (\"----\")) {\n // && (line.substring(textIndex, (textEnd + 1)).equals (\"----\")) {\n textilizeHorizontalRule(textIndex, textEnd);\n } else {\n textilizeNonBlankLine();\n };\n }", "private void parseEntities() {\n // See: https://github.com/twitter/twitter-text/tree/master/java\n entities.addExtractedEntities(TweetEntityAbstract.entitiesExtractor.extractCashtagsWithIndices(getText()));\n entities.addExtractedEntities(TweetEntityAbstract.entitiesExtractor.extractHashtagsWithIndices(getText()));\n entities.addExtractedEntities(TweetEntityAbstract.entitiesExtractor.extractMentionedScreennamesWithIndices(getText()));\n }", "public void process (String text) {\n\t\tProperties props = new Properties();\n\t\tprops.put(\"annotators\", \"tokenize, ssplit, pos, lemma, ner, parse, dcoref\");\n\t\tStanfordCoreNLP pipeline = new StanfordCoreNLP(props);\n\t\tAnnotation document = new Annotation(text);\n\t\tpipeline.annotate(document);\n\t\tList<CoreMap> sentences = document.get(SentencesAnnotation.class);\n\t\tfor(CoreMap sentence: sentences) {\n\t\t\tsgs.add(sentence.get(CollapsedCCProcessedDependenciesAnnotation.class));\n\t\t}\n\t\tccg = document.get(CorefChainAnnotation.class);\n\t}", "public String transform(String text){\n for(int i=0; i<transforms.length; i++)\n {\n if(transforms[i].contains(\"fromabbreviation\")){\n text = textTransformerAbbreviation.fromAbbreviation(text);\n }\n if(transforms[i].contains(\"toabbreviation\")){\n text = textTransformerAbbreviation.toAbbreviation(text);\n }\n if(transforms[i].contains(\"inverse\")){\n text = textTransformerInverse.inverse(text);\n }\n if(transforms[i].contains(\"upper\")){\n text = textTransformerLetterSize.upper(text);\n }\n if(transforms[i].contains(\"lower\")){\n text = textTransformerLetterSize.lower(text);\n }\n if(transforms[i].contains(\"capitalize\")) {\n text = textTransformerLetterSize.capitalize(text);\n }\n if(transforms[i].contains(\"latex\")){\n text = textTransformerLatex.toLatex(text);\n }\n if(transforms[i].contains(\"numbers\")){\n text = textTransformerNumbers.toText(text);\n }\n if(transforms[i].contains(\"repetitions\")){\n text = textTransformerRepetition.deleteRepetitions(text);\n }\n logger.debug(\"Text after \" + (i+1) + \" transform: \" + text);\n }\n\n logger.debug(\"Final form: \" + text);\n return text;\n }", "protected abstract String transform(final String xmlContent, final Map<String, Object> params) throws YFormProcessorException;", "private void makeReplacementText() throws IOException {\n valueBuf.clear();\n Token t = new Token();\n int start = currentTokenStart + 1;\n final int end = bufStart - 1;\n try {\n for (;;) {\n\tint tok;\n\tint nextStart;\n\ttry {\n\t tok = Tokenizer.tokenizeEntityValue(buf, start, end, t);\n\t nextStart = t.getTokenEnd();\n\t}\n\tcatch (ExtensibleTokenException e) {\n\t tok = e.getTokenType();\n\t nextStart = end;\n\t}\n\thandleEntityValueToken(valueBuf, tok, start, nextStart, t);\n\tstart = nextStart;\n }\n }\n catch (PartialTokenException e) {\n currentTokenStart = end;\n fatal(\"NOT_WELL_FORMED\");\n }\n catch (InvalidTokenException e) {\n currentTokenStart = e.getOffset();\n reportInvalidToken(e);\n }\n catch (EmptyTokenException e) { }\n }", "private void prepArticle(Element articleContent) {\n // we don't need to do this, we don't care\n cleanStyles(articleContent);\n // this replaces any break element or an nbsp with a plain break\n // element.\n // not needed. We will deal with breaks as we deal with breaks\n // killBreaks(articleContent);\n\n /* Clean out junk from the article content */\n cleanConditionally(articleContent, \"form\");\n clean(articleContent, \"object\");\n clean(articleContent, \"h1\");\n\n /**\n * If there is only one h2, they are probably using it as a header and not a subheader, so remove it\n * since we already have a header.\n ***/\n if (articleContent.getElementsByTag(\"h2\").size() == 1) {\n clean(articleContent, \"h2\");\n }\n clean(articleContent, \"iframe\");\n\n cleanHeaders(articleContent);\n\n /*\n * Do these last as the previous stuff may have removed junk that will affect these\n */\n cleanConditionally(articleContent, \"table\");\n cleanConditionally(articleContent, \"ul\");\n //could have no children, will crash then\n if (articleContent.children().size() != 0) {\n cleanConditionally(articleContent.child(0), \"div\");\n }\n\n /* Remove extra paragraphs */\n Elements articleParagraphs = articleContent.getElementsByTag(\"p\");\n for (Element para : articleParagraphs) {\n int imgCount = para.getElementsByTag(\"img\").size();\n int embedCount = para.getElementsByTag(\"embed\").size();\n int objectCount = para.getElementsByTag(\"object\").size();\n\n if (imgCount == 0 && embedCount == 0 && objectCount == 0 && para.text().matches(\"\\\\s*\")) {\n para.remove();\n }\n }\n\n Elements parasWithPreceedingBreaks = articleContent.getElementsByTag(\"br + p\");\n for (Element pe : parasWithPreceedingBreaks) {\n Element brElement = pe.previousElementSibling();\n brElement.remove();\n }\n }", "private void processText(){\n if(text == null || text.length() == 0){\n // When posting a tweet, Twitter returns the \"text\" JSON field even if it's not trimmed...\n text = trimmedText;\n }else{\n // Trim the original contents received from Twitter\n text = text.substring(0, text.offsetByCodePoints(0, displayTextRange[1]));\n }\n\n // Transform HTML characters (for some reason Twitter sends those)\n text = org.apache.commons.text.StringEscapeUtils.unescapeHtml4(text);\n }", "@Override\n public void preprocess() {\n }", "@Override\n\t\tprotected void process() throws Exception {\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing - Initializing Models...\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tGlobalVars.initialize();\n\n\t\t\t// Processing Step 1. - CoreNLP\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing CoreNLP.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tString processed_text = Filter\n\t\t\t\t\t.filterdata(GlobalVars.pipeline, text);\n\n\t\t\t// Processing Step 2. - Openie\"\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing Openie.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tStringBuilder openIEOutput = new StringBuilder();\n\t\t\tString temp = \"\";\n\t\t\tfor (String sentence : processed_text.split(\"\\\\. \")) {\n\n\t\t\t\tSeq<Instance> extractions = GlobalVars.openIE.extract(sentence);\n\n\t\t\t\tInstance[] arr = new Instance[extractions.length()];\n\t\t\t\textractions.copyToArray(arr);\n\n\t\t\t\tfor (Instance inst : arr) {\n\t\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\t\tsb.append(inst.sentence() + \"\\n\");\n\t\t\t\t\tDouble conf = inst.confidence();\n\t\t\t\t\tString stringConf = conf.toString().substring(0, 4);\n\t\t\t\t\tsb.append(stringConf).append(\" (\")\n\t\t\t\t\t\t\t.append(inst.extr().arg1().text()).append(\"; \")\n\t\t\t\t\t\t\t.append(inst.extr().rel().text()).append(\"; \");\n\n\t\t\t\t\ttemp += inst.extr().arg1().text() + \"\\n\"\n\t\t\t\t\t\t\t+ inst.extr().rel().text() + \"\\n\";\n\n\t\t\t\t\tPart[] arr2 = new Part[inst.extr().arg2s().length()];\n\t\t\t\t\tinst.extr().arg2s().copyToArray(arr2);\n\t\t\t\t\t/*\n\t\t\t\t\t * for (Part arg : arr2) { sb.append(arg.text()).append(\"\");\n\t\t\t\t\t * System.out.println(\"%\" + arg.text() + \"%\"); }\n\t\t\t\t\t */\n\t\t\t\t\tif (arr2.length != 0) {\n\t\t\t\t\t\tSystem.out.println(\"Hats: \" + arr2[0]);\n\t\t\t\t\t\ttemp += arr2[0] + \"\\n\";\n\t\t\t\t\t\tsb.append(arr2[0]);\n\t\t\t\t\t\tsb.append(\")\\n\\n\");\n\t\t\t\t\t\topenIEOutput.append(sb.toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Processing Step 3. - Rewrite\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing Rewrite.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\t// Load load = new Load();\n\t\t\t// result = load.Loadfilter(openIEOutput.toString());\n\t\t\tresult = temp;\n\t\t}", "protected void processTextElement(XMLTag elementTag)\n throws SAXException\n {\n\tif (elementTag == XMLTag.LABEL)\n\t {\n\t // one line, no formatting, applies to either\n\t // control or menu item.\n\t if (currentControl != null)\n\t {\n\t\tString label = (String) xlatedText.get(0);\n\t\tcurrentControl.setLabelText(label);\n\t\tString labelKey = (String) textKey.get(0);\n\t\tcurrentControl.setLabelKey(labelKey);\n\t\t}\n\t }\n\telse if (elementTag == XMLTag.TITLE)\n\t {\n\t if (currentPanel != null)\n\t {\n\t\tString title = (String) xlatedText.get(0);\n\t\tcurrentPanel.setTitle(title);\n\t\t} \n\t }\n\telse if (elementTag == XMLTag.HELP)\n\t {\n\t // Need to concatenate all strings and format\n\t // as HTML - will be embedded in another HTML\n\t // document, so we can leave off the <HTML> and <BODY>\n\t StringBuffer helpString = new StringBuffer();\n\t String[] keys = new String[textKey.size()];\n boolean bInList = false;\n\t for (int i = 0; i < xlatedText.size(); i++)\n\t {\n\t\tString temp = replaceAngleBrackets((String) xlatedText.get(i));\n\t\tXMLTag tTag = (XMLTag) textTag.get(i);\n\t\tif (tTag == XMLTag.PARAGRAPH)\n\t\t {\n if (bInList)\n\t\t {\n\t\t helpString.append(\"</dl>\\n\"); \n bInList = false;\n\t\t\t}\n\t\t if (i == 0)\n\t\t {\n\t\t\t //~~\t\thelpString.append(\"<P>\");\n\t\t\t}\n\t\t else\n\t\t {\n\t\t helpString.append(\"<p>\");\n\t\t\t}\n helpString.append(temp);\n\t\t }\n\t\telse if (tTag == XMLTag.LISTITEM)\n\t\t {\n if (!bInList)\n\t\t {\n\t\t helpString.append(\"<dl>\\n\");\n\t\t\tbInList = true;\n\t\t\t}\n\t\t if (i > 0)\n\t\t helpString.append(\"\\n\");\n\t\t helpString.append(\"<dd>\" + temp + \"</dd>\\n\");\n\t\t }\n\t\telse\n\t\t {\n\t\t helpString.append(temp);\n\t\t }\n\t\tkeys[i] = (String) textKey.get(i);\n\t\t}\n if (bInList)\n\t {\n helpString.append(\"</dl>\\n\");\n\t\t}\n\t helpString.append(\"</p></FONT>\\n\");\n\t // could apply to either a control or a menu item.\n\t if (currentControl != null)\n\t {\n\t\tcurrentControl.setHelpString(helpString.toString());\n\t\tcurrentControl.setHelpKeys(keys);\n\t\t}\n\t }\n\telse if (elementTag == XMLTag.CHOICES)\n\t {\n\t // only relevant if the current control is a combo, radio,\n\t // or checkbutton\n\t if (currentControl.isChoiceControl())\n\t {\n\t\tString[] keys = new String[textKey.size()];\n\t\tString[] choices = new String[xlatedText.size()];\n\t\tfor (int i = 0; i < xlatedText.size(); i++)\n\t\t {\n\t\t choices[i] = (String) xlatedText.get(i);\n\t\t keys[i] = (String) textKey.get(i);\n\t\t }\n\t\tcurrentControl.setChoiceStrings(choices);\n\t\tcurrentControl.setChoiceKeys(keys);\n\t\t}\n\t }\n\telse if (elementTag == XMLTag.TOOLTIP)\n\t {\n\t // just ignore \n\t // only relevant to menu items\n\n\t }\n\telse if (elementTag == XMLTag.DEFAULT)\n\t {\n if (currentControl != null)\n\t {\n\t\tString text = (String) xlatedText.get(0);\n\t\tcurrentControl.setDefaultValue(text);\n\t\tString key = (String)textKey.get(0);\n\t\tcurrentControl.setDefaultKey(key);\n\t }\n\t }\n\t// get rid of text and tags - we are done with them\n\txlatedText.clear();\n\txlatedText = null;\n\ttextTag.clear();\n\ttextTag = null;\n\t}", "@Override\n public SentenceBuilder call(SentenceBuilder builder, Map<String, Object> metadata) throws\n ProcessingException {\n\n /*find all substrings matching XML Escape Entities\n in the SentenceBuilder current String*/\n Matcher m = XMLCharacterEntity.EntityPattern.matcher(builder.toString());\n\n int stringIndex = 0;\n SentenceBuilder.Editor editor = builder.edit();\n\n /*for each entity found,\n * ask the editor to replace the entity text\n * with the character it stands for,\n * obtained by asking it to the XMLCharacterEntity*/\n while (m.find()) {\n int start = m.start();\n int end = m.end();\n\n if (stringIndex < start)\n stringIndex = end;\n\n String entity = m.group();\n String c = XMLCharacterEntity.unescape(entity);\n\n if (c != null)\n editor.replace(start, end - start, c);\n }\n editor.commit();\n return builder;\n }", "@Test//ExSkip\n public void fieldIncludeText() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n // Below are two ways to use INCLUDETEXT fields to display the contents of an XML file in the local file system.\n // 1 - Perform an XSL transformation on an XML document:\n FieldIncludeText fieldIncludeText = createFieldIncludeText(builder, getMyDir() + \"CD collection data.xml\", false, \"text/xml\", \"XML\", \"ISO-8859-1\");\n fieldIncludeText.setXslTransformation(getMyDir() + \"CD collection XSL transformation.xsl\");\n\n builder.writeln();\n\n // 2 - Use an XPath to take specific elements from an XML document:\n fieldIncludeText = createFieldIncludeText(builder, getMyDir() + \"CD collection data.xml\", false, \"text/xml\", \"XML\", \"ISO-8859-1\");\n fieldIncludeText.setNamespaceMappings(\"xmlns:n='myNamespace'\");\n fieldIncludeText.setXPath(\"/catalog/cd/title\");\n\n doc.save(getArtifactsDir() + \"Field.INCLUDETEXT.docx\");\n }", "@Before\n\tpublic void setUp() throws Exception {\n\t\tList<Paragraph> paragraphs = new ArrayList<Paragraph>();\n\t\tList<Paragraph> paragraphsWithNoSentences = new ArrayList<Paragraph>();\n\t\t\n\t\tScanner sc = null, sc1 = null;\n\t\ttry {\n\t\t\tsc = new Scanner(new File(\"testsearchtext.txt\"));\n\t\t\tsc1 = new Scanner(new File(\"testsearchentity.txt\"));\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tsc.useDelimiter(\"[.]\");\n\t\tsc1.useDelimiter(\"[|]\");\n\t\t\n\t\tList<Sentence> sentences = new ArrayList<Sentence>();\n\t\tint sCount = 0;\n\t\tint pCount = 0;\n\t\twhile(sc.hasNext()){\n\t\t\tString temp = sc.next().trim();\n\n\t\t\tif(sCount > 0 && (sCount%10 == 0 || !sc.hasNext())){\n\t\t\t\tParagraph p = new Paragraph(pCount);\n\t\t\t\tparagraphsWithNoSentences.add(p);\n\t\t\t\t\n\t\t\t\tp = new Paragraph(pCount);\n\t\t\t\tp.setSentences(sentences);\n\t\t\t\tparagraphs.add(p);\n\t\t\t\tpCount++;\n\t\t\t\t\n\t\t\t\tsentences = new ArrayList<Sentence>();\n\t\t\t}\n\t\t\t\n\t\t\tif(!temp.equals(\"\"))\n\t\t\t\tsentences.add(new Sentence((sCount%10), temp));\n\t\t\t\n\t\t\tsCount++;\n\t\t}\n\t\t\n\t\tList<Entity> entities = new ArrayList<Entity>();\n\t\tint currType = -1; \n\t\twhile(sc1.hasNext()){\n\t\t\tString temp = sc1.next().trim();\n\t\t\tif(temp.equals(\"place\")){currType = Entity.PLACE;} else\n\t\t\tif(temp.equals(\"url\")){currType = Entity.URL;} else\n\t\t\tif(temp.equals(\"email\")){currType = Entity.EMAIL;} else\n\t\t\tif(temp.equals(\"address\")){currType = Entity.ADDRESS;} \n\t\t\telse{\n\t\t\t\tentities.add(new Entity(currType, temp));\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tSource s = new Source(\"testsearchtext.txt\", \"testsearchtext.txt\");\n\t\tpt1 = new ProcessedText(s, paragraphs, null); \n\t\t\n\t\ts = new Source(\"testsearchtext1.txt\", \"testsearchtext1.txt\");\n\t\tpt2 = new ProcessedText(s, paragraphsWithNoSentences, null); \n\t\t\n\t\tpt3 = new ProcessedText();\n\t\tpt3.setParagraphs(paragraphs);\n\t\t\n\t\tpt4 = new ProcessedText();\n\t\ts = new Source(\"testsearchtext2.txt\", \"testsearchtext2.txt\");\n\t\tpt4.setMetadata(s);\n\t\t\n\t\ts = new Source(\"testsearchtext3.txt\", \"testsearchtext3.txt\");\n\t\tpt5 = new ProcessedText(s, paragraphs, entities); \n\t\t\n\t\ts = new Source(\"testsearchtext4.txt\", \"testsearchtext4.txt\");\n\t\tpt6 = new ProcessedText(s, null, entities); \n\t}", "private void buildRTF() {\n\t\n}", "public ArrayList<String> makeSentences(String text) {\n \t\t/*\n \t\t * Quick check so we're not trying to split up an empty\n \t\t * String. This only happens right before the user types\n \t\t * at the end of a document and we don't have anything to\n \t\t * split, so return.\n \t\t */\n \t\tif (text.equals(\"\")) {\n \t\t\tArrayList<String> sents = new ArrayList<String>();\n \t\t\tsents.add(\"\");\n \t\t\treturn sents;\n \t\t}\n \t\t\n \t\t/**\n \t\t * Because the eosTracker isn't initialized until the TaggedDocument is,\n \t\t * it won't be ready until near the end of DocumentProcessor, in which\n \t\t * case we want to set it to the correct\n \t\t */\n \t\tthis.eosTracker = main.editorDriver.taggedDoc.eosTracker;\n \t\tthis.editorDriver = main.editorDriver;\n \t\t\n \t\tArrayList<String> sents = new ArrayList<String>(ANONConstants.EXPECTED_NUM_OF_SENTENCES);\n \t\tArrayList<String> finalSents = new ArrayList<String>(ANONConstants.EXPECTED_NUM_OF_SENTENCES);\n \t\tboolean mergeNext = false;\n \t\tboolean mergeWithLast = false;\n \t\tboolean forceNoMerge = false;\n \t\tint currentStart = 1;\n \t\tint currentStop = 0;\n \t\tString temp;\n \n \t\t/**\n \t\t * replace unicode format characters that will ruin the regular\n \t\t * expressions (because non-printable characters in the document still\n \t\t * take up indices, but you won't know they're there untill you\n \t\t * \"arrow\" though the document and have to hit the same arrow twice to\n \t\t * move past a certain point. Note that we must use \"Cf\" rather than\n \t\t * \"C\". If we use \"C\" or \"Cc\" (which includes control characters), we\n \t\t * remove our newline characters and this screws up the document. \"Cf\"\n \t\t * is \"other, format\". \"Cc\" is \"other, control\". Using \"C\" will match\n \t\t * both of them.\n \t\t */\n \t\ttext = text.replaceAll(\"\\u201C\",\"\\\"\");\n \t\ttext = text.replaceAll(\"\\u201D\",\"\\\"\");\n \t\ttext = text.replaceAll(\"\\\\p{Cf}\",\"\");\n \n \t\tint lenText = text.length();\n \t\tint index = 0;\n \t\tint buffer = editorDriver.sentIndices[0];\n \t\tString safeString = \"\";\n \t\tMatcher abbreviationFinder = ABBREVIATIONS_PATTERN.matcher(text);\n \t\t\n \t\t//================ SEARCHING FOR ABBREVIATIONS ================\n \t\twhile (index < lenText-1 && abbreviationFinder.find(index)) {\n \t\t\tindex = abbreviationFinder.start();\n \t\t\t\n \t\t\ttry {\n \t\t\t\tint abbrevLength = index;\n \t\t\t\twhile (text.charAt(abbrevLength) != ' ') {\n \t\t\t\t\tabbrevLength--;\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif (ABBREVIATIONS.contains(text.substring(abbrevLength+1, index+1))) {\n \t\t\t\t\teosTracker.setIgnore(index+buffer, true);\n \t\t\t\t}\n \t\t\t} catch (Exception e) {}\n \t\t\t\n \t\t\tindex++;\n \t\t}\t\t\n \t\t\n \t\tMatcher sent = EOS_chars.matcher(text);\n \t\tboolean foundEOS = sent.find(currentStart); // xxx TODO xxx take this EOS character, and if not in quotes, swap it for a permanent replacement, and create and add an EOS to the calling TaggedDocument's eosTracker.\n \t\t\n \t\t/*\n \t\t * We want to check and make sure that the EOS character (if one was found) is not supposed to be ignored. If it is, we will act like we did not\n \t\t * find it. If there are multiple sentences with multiple EOS characters passed it will go through each to check, foundEOS will only be true if\n \t\t * an EOS exists in \"text\" that would normally be an EOS character and is not set to be ignored.\n \t\t */\n \t\t\n \t\tindex = 0;\n \t\tif (foundEOS) {\t\n \t\t\ttry {\n \t\t\t\twhile (index < lenText-1 && sent.find(index)) {\n \t\t\t\t\tindex = sent.start();\n \t\t\t\t\tif (!eosTracker.sentenceEndAtIndex(index+buffer)) {\n \t\t\t\t\t\tfoundEOS = false;\n \t\t\t\t\t} else {\n \t\t\t\t\t\tfoundEOS = true;\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t\tindex++;\n \t\t\t\t}\n \t\t\t} catch (IllegalStateException e) {}\n \t\t}\n \t\t//We need to reset the Matcher for the code below\n \t\tsent = EOS_chars.matcher(text);\n \t\tsent.find(currentStart);\n \t\t\n \t\tMatcher sentEnd;\n \t\tMatcher citationFinder;\n \t\tboolean hasCitation = false;\n \t\tint charNum = 0;\n \t\tint lenTemp = 0;\n \t\tint lastQuoteAt = 0;\n \t\tint lastParenAt = 0;\n \t\tboolean foundQuote = false;\n \t\tboolean foundParentheses = false;\n \t\tboolean isSentence;\n \t\tboolean foundAtLeastOneEOS = foundEOS;\n \t\t\n \t\t/**\n \t\t * Needed otherwise when the user has text like below:\n \t\t * \t\tThis is my sentence one. This is \"My sentence?\" two. This is the last sentence.\n \t\t * and they begin to delete the EOS character as such:\n \t\t * \t\tThis is my sentence one. This is \"My sentence?\" two This is the last sentence.\n \t\t * Everything gets screwed up. This is because the operations below operate as expected only when there actually is an EOS character\n \t\t * at the end of the text, it expects it there in order to function properly. Now usually if there is no EOS character at the end it wouldn't\n \t\t * matter since the while loop and !foundAtLeastOneEOS conditional are executed properly, BUT as you can see the quotes, or more notably the EOS character inside\n \t\t * the quotes, triggers this initial test and thus the operation breaks. This is here just to make sure that does not happen.\n \t\t */\n \t\tString trimmedText = text.trim();\n \t\tint trimmedTextLength = trimmedText.length();\n \n \t\t//We want to make sure that if there is an EOS character at the end that it is not supposed to be ignored\n \t\tboolean EOSAtSentenceEnd = true;\n \t\tif (trimmedTextLength != 0) {\n \t\t\tEOSAtSentenceEnd = EOS.contains(trimmedText.substring(trimmedTextLength-1, trimmedTextLength)) && eosTracker.sentenceEndAtIndex(editorDriver.sentIndices[1]-1);\n \t\t} else {\n \t\t\tEOSAtSentenceEnd = false;\n \t\t}\n \t\t\n \t\t//Needed so that if we are deleting abbreviations like \"Ph.D.\" this is not triggered.\n \t\tif (!EOSAtSentenceEnd && (editorDriver.taggedDoc.watchForEOS == -1))\n \t\t\tEOSAtSentenceEnd = true;\n \n \t\twhile (foundEOS == true) {\n \t\t\tcurrentStop = sent.end();\n \t\t\t\n \t\t\t//We want to make sure currentStop skips over ignored EOS characters and stops only when we hit a true EOS character\n \t\t\ttry {\n \t\t\t\twhile (!eosTracker.sentenceEndAtIndex(currentStop+buffer-1) && currentStop != lenText) {\n \t\t\t\t\tsent.find(currentStop+1);\n \t\t\t\t\tcurrentStop = sent.end();\n \t\t\t\t}\n \t\t\t} catch (Exception e) {}\n \n \t\t\ttemp = text.substring(currentStart-1,currentStop);\n \t\t\tlenTemp = temp.length();\n \t\t\tlastQuoteAt = 0;\n \t\t\tlastParenAt = 0;\n \t\t\tfoundQuote = false;\n \t\t\tfoundParentheses = false;\n \t\t\t\n \t\t\tfor(charNum = 0; charNum < lenTemp; charNum++){\n \t\t\t\tif (temp.charAt(charNum) == '\\\"') {\n \t\t\t\t\tlastQuoteAt = charNum;\n \t\t\t\t\t\n \t\t\t\t\tif (foundQuote == true)\n \t\t\t\t\t\tfoundQuote = false;\n \t\t\t\t\telse\n \t\t\t\t\t\tfoundQuote = true;\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif (temp.charAt(charNum) == '(') {\n \t\t\t\t\tlastParenAt = charNum;\n \t\t\t\t\t\n \t\t\t\t\tif (foundParentheses)\n \t\t\t\t\t\tfoundParentheses = false;\n \t\t\t\t\telse\n \t\t\t\t\t\tfoundParentheses = true;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tif (foundQuote == true && ((temp.indexOf(\"\\\"\",lastQuoteAt+1)) == -1)) { // then we found an EOS character that shouldn't split a sentence because it's within an open quote.\n \t\t\t\tif ((currentStop = text.indexOf(\"\\\"\",currentStart +lastQuoteAt+1)) == -1) {\n \t\t\t\t\tcurrentStop = text.length(); // if we can't find a closing quote in the rest of the input text, then we assume the author forgot to put a closing quote, and act like it's at the end of the input text.\n \t\t\t\t}\n \t\t\t\telse{\n \t\t\t\t\tcurrentStop +=1;\n \t\t\t\t\tmergeNext=true;// the EOS character we are looking for is not in this section of text (section being defined as a substring of 'text' between two EOS characters.)\n \t\t\t\t}\n \t\t\t}\n \t\t\tsafeString = text.substring(currentStart-1,currentStop);\n \t\t\t\n \t\t\tif (foundParentheses && ((temp.indexOf(\")\", lastParenAt+1)) == -1)) {\n \t\t\t\tif ((currentStop = text.indexOf(\")\", currentStart + lastParenAt + 1)) == -1)\n \t\t\t\t\tcurrentStop = text.length();\n \t\t\t\telse {\n \t\t\t\t\tcurrentStop += 1;\n \t\t\t\t\tmergeNext = true;\n \t\t\t\t}\n \t\t\t}\n \t\t\tsafeString = text.substring(currentStart-1,currentStop);\n \n \t\t\tif (foundQuote) {\n \t\t\t\tsentEnd = SENTENCE_QUOTE.matcher(text);\t\n \t\t\t\tisSentence = sentEnd.find(currentStop-2); // -2 so that we match the EOS character before the quotes (not -1 because currentStop is one greater than the last index of the string -- due to the way substring works, which is includes the first index, and excludes the end index: [start,end).)\n \n \t\t\t\tif (isSentence == true) { // If it seems that the text looks like this: He said, \"Hello.\" Then she said, \"Hi.\" \n \t\t\t\t\t// Then we want to split this up into two sentences (it's possible to have a sentence like this: He said, \"Hello.\")\n \t\t\t\t\tcurrentStop = text.indexOf(\"\\\"\",sentEnd.start())+1;\n \t\t\t\t\tsafeString = text.substring(currentStart-1,currentStop);\n \t\t\t\t\tforceNoMerge = true;\n \t\t\t\t\tmergeNext = false;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tif (foundParentheses) {\n \t\t\t\tsentEnd = SENTENCE_PARENTHESES.matcher(text);\n \t\t\t\tisSentence = sentEnd.find(currentStop-2);\n \t\t\t\t\n \t\t\t\tif (isSentence == true) {\n \t\t\t\t\tcurrentStop = text.indexOf(\")\", sentEnd.start()) + 1;\n \t\t\t\t\tsafeString = text.substring(currentStart-1, currentStop);\n \t\t\t\t\tforceNoMerge = true;\n \t\t\t\t\tmergeNext = false;\n \t\t\t\t}\n \t\t\t}\n \n \t\t\t// now check to see if there is a CITATION after the sentence (doesn't just apply to quotes due to paraphrasing)\n \t\t\t// The rule -- at least as of now -- is if after the EOS mark there is a set of parenthesis containing either one word (name) or a name and numbers (name 123) || (123 name) || (123-456 name) || (name 123-456) || etc..\n \t\t\tcitationFinder = CITATION.matcher(text.substring(currentStop));\t\n \t\t\thasCitation = citationFinder.find(); // -2 so that we match the EOS character before the quotes (not -1 because currentStop is one greater than the last index of the string -- due to the way substring works, which is includes the first index, and excludes the end index: [start,end).)\n \t\t\t\n \t\t\tif (hasCitation == true) { // If it seems that the text looks like this: He said, \"Hello.\" Then she said, \"Hi.\" \n \t\t\t\t// Then we want to split this up into two sentences (it's possible to have a sentence like this: He said, \"Hello.\")\n \t\t\t\tcurrentStop = text.indexOf(\")\",citationFinder.start()+currentStop)+1;\n \t\t\t\tsafeString = text.substring(currentStart-1,currentStop);\n \t\t\t\tmergeNext = false;\n \t\t\t}\t\n \t\t\t\n \t\t\tif (mergeWithLast) {\n \t\t\t\tmergeWithLast=false;\n \t\t\t\tString prev=sents.remove(sents.size()-1);\n \t\t\t\tsafeString=prev+safeString;\n \t\t\t}\n \t\t\t\n \t\t\tif (mergeNext && !forceNoMerge) {//makes the merge happen on the next pass through\n \t\t\t\tmergeNext=false;\n \t\t\t\tmergeWithLast=true;\n \t\t\t} else {\n \t\t\t\tforceNoMerge = false;\n \t\t\t\tfinalSents.add(safeString);\n \t\t\t}\n \t\t\n \t\t\tsents.add(safeString);\n \t\t\t\n \t\t\t//// xxx xxx xxx return the safeString_subbedEOS too!!!!\n \t\t\tif (currentStart < 0 || currentStop < 0) {\n \t\t\t\tLogger.logln(NAME+\"Something went really wrong making sentence tokens.\", LogOut.STDERR);\n \t\t\t\tErrorHandler.fatalProcessingError(null);\n \t\t\t}\n \n \t\t\tcurrentStart = currentStop+1;\n \t\t\tif (currentStart >= lenText) {\n \t\t\t\tfoundEOS = false;\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n \t\t\tfoundEOS = sent.find(currentStart);\n \t\t}\n \n \t\tif (!foundAtLeastOneEOS || !EOSAtSentenceEnd) {\n \t\t\tArrayList<String> wrapper = new ArrayList<String>(1);\n \t\t\twrapper.add(text);\n \t\t\treturn wrapper;\n \t\t}\n \t\t\n \t\treturn finalSents;\n \t}", "private static String pipelineMRC(String text, boolean debugMode, boolean onlyConceptTag) {\n\t\tif (debugMode) System.out.println(\"pipelineMRC_POS_NER function \");\n\t\ttext = text.replaceAll(\"&apos;\",\"\\'\");\n\t\tif (debugMode) System.out.println(\"MetaMap extracting concepts\");\n\t\t//String MetaMapText = MetaMapHandler.getAnnotatedXMLTags(text, debugMode);\n\t\tString LocalMetaMapText = LocalMetaMapHandler.getAnnotatedXMLTags(text);\n\n\t\t//Debugging\n\t\t//System.out.println(\"----------------------------------------------------\");\n\t\t//System.out.println(MetaMapText);\n\t\t//System.out.println(LocalMetaMapText);\n\t\t//System.out.println(\"----------------------------------------------------\");\n\t\t//End of Debugging\n\n\t\tif (debugMode) System.out.println(\"MetaMap concepts extracted\");\n\n\t\tif(!onlyConceptTag) {\n\t\t\tLocalMetaMapText = \"<content><text>\" + LocalMetaMapText;\n\t\t\tLocalMetaMapText = LocalMetaMapText.replaceAll(Pattern.quote(\"<concept\"), \"</text><concept\");\n\t\t\tLocalMetaMapText = LocalMetaMapText.replaceAll(Pattern.quote(\"</concept>\"), \"</concept><text>\");\n\t\t\tLocalMetaMapText = LocalMetaMapText + \"</text></content>\";\n\t\t}\n\n\t\treturn LocalMetaMapText;\n\t}", "@Override\n public void preprocess() {\n }", "private LazyPreprocessedPage preprocess(\n\t PageTitle title,\n\t String validatedWikitext,\n\t boolean forInclusion,\n\t EntityMap entityMap,\n\t ContentNode parentLog)\n\t throws CompilerException\n\t{\n\t\tPreprocessorLog log = new PreprocessorLog();\n\t\tparentLog.getContent().add(log);\n\t\t\n\t\tlog.setForInclusion(forInclusion);\n\t\t\n\t\tStopWatch stopWatch = new StopWatch();\n\t\tstopWatch.start();\n\t\t\n\t\ttry\n\t\t{\n\t\t\tLazyPreprocessor preprocessor = new LazyPreprocessor(wikiConfig);\n\t\t\t\n\t\t\tLazyPreprocessedPage preprocessedAst =\n\t\t\t (LazyPreprocessedPage) preprocessor.parseArticle(\n\t\t\t validatedWikitext,\n\t\t\t title.getFullTitle(),\n\t\t\t forInclusion);\n\t\t\t\n\t\t\treturn preprocessedAst;\n\t\t}\n\t\tcatch (xtc.parser.ParseException e)\n\t\t{\n\t\t\tlog.getContent().add(new ParseException(e.getMessage()));\n\t\t\t\n\t\t\tthrow new CompilerException(\"Preprocessing failed!\", e);\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tlogger.error(\"Preprocessing failed!\", e);\n\t\t\t\n\t\t\tStringWriter w = new StringWriter();\n\t\t\te.printStackTrace(new PrintWriter(w));\n\t\t\tlog.getContent().add(new UnhandledException(e, w.toString()));\n\t\t\t\n\t\t\tthrow new CompilerException(\"Preprocessing failed!\", e);\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tstopWatch.stop();\n\t\t\tlog.setTimeNeeded(stopWatch.getElapsedTime());\n\t\t}\n\t}", "@Override\n public void handleSpecialChar(\n com.globalsight.ling.docproc.extractor.html.HtmlObjects.Text t)\n {\n\n }", "public String preProcess( String data );", "private void processArticle(String rawArticleText, Article article, Context context) throws IOException, InterruptedException {\n if (!rawArticleText.trim().isEmpty()) {\n String[] splitSentences = rawArticleText.split(\"\\\\.\\\\s\");\n PriorityQueue<Sentence> sortedSentences = new PriorityQueue<>();\n\n for (int sentenceIndex = 0; sentenceIndex < splitSentences.length; sentenceIndex++) {\n String rawSentence = splitSentences[sentenceIndex];\n Double sentenceTfIdf = getSentenceTfIdf(rawSentence, article);\n sortedSentences.add(new Sentence(sentenceTfIdf, rawSentence, sentenceIndex));\n }\n\n String summary = topOrderedSentences(sortedSentences);\n context.write(new IntWritable(article.id), new Text(summary));\n }\n }", "private void filterFeatureswithtext() throws Exception {\n\t\ttry {\r\n\t\t\t//source = dataStore.getFeatureSource(typeName);\r\n\t\t\tString sql = text.getText();\r\n\t\t\tString filtertype = \"include\";\r\n\t\t\tString[] cql = sql.split(\":\");\r\n\t\t\tHints h = new Hints();\r\n \t\t\th.put(Hints.FILTER_FACTORY, ISOFilterFactoryImpl.class);\r\n \t\t\tFilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(h);\r\n \t\t\tWKTReader wktr = new WKTReader(DefaultGeographicCRS.WGS84_3D);\r\n \t\t\tFilter filter = CQL.toFilter(\"include\");\r\n \t\t\tlong start = System.currentTimeMillis();\r\n \t\t\tList<SimpleFeature> sfs = new ArrayList<SimpleFeature>();\r\n \t\t\tSimpleFeatureIterator iterator = currentfeatures.features();\r\n \t\t\t\r\n \t\t\tif(cql.length > 1 && cql[2].startsWith(\"BBOX3D\")) {\r\n \t\t\t cql[2] = cql[2].replaceAll(\"BBOX3D\", \"\");\r\n \t\t\t cql[2] = cql[2].replaceAll(\"\\\\(\", \"\");\r\n \t\t\t cql[2] = cql[2].replaceAll(\"\\\\)\", \"\");\r\n \t\t\t \r\n \t\t\t String[] coords = cql[2].split(\",\");\r\n \t\t\t \r\n \t\t\t String[] lowerStr = coords[0].trim().split(\" \");\r\n \t\t\t String[] upperStr = coords[1].trim().split(\" \");\r\n \t\t\t \r\n \t\t\t double[] lower = new double[3];\r\n \t\t\t double[] upper = new double[3];\r\n \t\t\t \r\n \t\t\t lower[0] = Double.parseDouble(lowerStr[0]);\r\n lower[1] = Double.parseDouble(lowerStr[1]);\r\n lower[2] = Double.parseDouble(lowerStr[2]);\r\n \r\n upper[0] = Double.parseDouble(upperStr[0]);\r\n upper[1] = Double.parseDouble(upperStr[1]);\r\n upper[2] = Double.parseDouble(upperStr[2]);\r\n \r\n DirectPosition lowerCorner = builder.createDirectPosition(lower);\r\n DirectPosition upperCorner = builder.createDirectPosition(upper);\r\n \r\n Solid s = makeFromEnvelope(builder, lowerCorner, upperCorner);\r\n cql[2] = s.toString();\r\n\r\n Document d = encode(s);\r\n //System.out.println(d);\r\n\r\n //System.out.println(cql[2]);\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif(cql[0].equalsIgnoreCase(\"contains\")) {\r\n \t\t\t\tfeatureid = \"\";\r\n \t\t\t\tfilter = ff.contains(cql[1], wktr.read(cql[2]));\r\n \t\t\t\tfiltertype = \"contains \";\r\n \t\t\t}\r\n \t\t\telse if(cql[0].equalsIgnoreCase(\"within\")) {\r\n \t\t\t\tfeatureid = \"\";\r\n \t\t\t\tfilter = ff.within(cql[1], wktr.read(cql[2]));\r\n \t\t\t\tfiltertype = \"within \";\r\n \t\t\t}\r\n \t\t\telse if(cql[0].equalsIgnoreCase(\"equals\")) {\r\n \t\t\t\tfilter = ff.equals(cql[1], wktr.read(cql[2]));\r\n \t\t\t\tfiltertype = \"equals \";\r\n \t\t\t}\r\n \t\t\telse if(cql[0].equalsIgnoreCase(\"intersects\")) {\r\n \t\t\t\tFilter getidfilter = ff.equals(cql[1], wktr.read(cql[2]));\r\n \t\t\t\t\r\n \t\t\t\twhile (iterator.hasNext()) {\r\n \t\t\t\t\tSimpleFeature feature = iterator.next();\r\n \t\t\t\t\t\r\n \t\t\t\t\tif(getidfilter.evaluate(feature)) {\r\n \t\t\t\t\t\tfeatureid = feature.getID();\r\n \t\t\t\t\t\tbreak;\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\tfilter = ff.intersects(cql[1], wktr.read(cql[2]));\r\n \t\t\t\tfiltertype = \"intersects \";\r\n \t\t\t}\r\n \t\t\t\r\n\t\t\t//SimpleFeatureCollection features = source.getFeatures(filter);\r\n \t\t\titerator = currentfeatures.features();\r\n\t\t\twhile (iterator.hasNext()) {\r\n\t\t\t\tSimpleFeature feature = iterator.next();\r\n\t\t\t\tSystem.out.print(featureid + \" : \" + feature.getID() + \" \");\r\n\t\t\t\tif(filter.evaluate(feature)) {\r\n\t\t\t\t\tsfs.add(feature);\r\n\t\t\t\t\tSystem.out.println(\"true\");\r\n\t\t\t\t}else {\r\n\t\t\t\t\tSystem.out.println(\"false\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(sfs.size() == 0) {\r\n\t\t\t\ttable.setModel(new DefaultTableModel(5, 5));\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tSimpleFeatureCollection result = ISODataUtilities.collection(sfs);\r\n \t\t\t\r\n\t\t\tlong end = System.currentTimeMillis();\r\n\t\t\t//System.out.println( \"실행 시간 : \" + ( end - start )/1000.0 );\r\n\t\t\tlabel.setText(filtertype + \"complete : \" + ( end - start )/1000.0 + \" sec\");\r\n\t\t\tFeatureCollectionTableModel model = new FeatureCollectionTableModel(result);\r\n\t\t\ttable.setModel(model);\r\n\t\t\t\r\n\t\t} catch (CQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ParseException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} \r\n\t}", "public abstract WordEntry manualTranslate(String text, String from, String to);", "@Override\n\tpublic Paragraph translateText(String freetext, boolean include) {\n\t\treturn null;\n\t}", "@Test\n public void fieldAutoText() throws Exception {\n Document doc = new Document();\n\n // Create a glossary document and add an AutoText building block to it.\n doc.setGlossaryDocument(new GlossaryDocument());\n BuildingBlock buildingBlock = new BuildingBlock(doc.getGlossaryDocument());\n buildingBlock.setName(\"MyBlock\");\n buildingBlock.setGallery(BuildingBlockGallery.AUTO_TEXT);\n buildingBlock.setCategory(\"General\");\n buildingBlock.setDescription(\"MyBlock description\");\n buildingBlock.setBehavior(BuildingBlockBehavior.PARAGRAPH);\n doc.getGlossaryDocument().appendChild(buildingBlock);\n\n // Create a source and add it as text to our building block.\n Document buildingBlockSource = new Document();\n DocumentBuilder buildingBlockSourceBuilder = new DocumentBuilder(buildingBlockSource);\n buildingBlockSourceBuilder.writeln(\"Hello World!\");\n\n Node buildingBlockContent = doc.getGlossaryDocument().importNode(buildingBlockSource.getFirstSection(), true);\n buildingBlock.appendChild(buildingBlockContent);\n\n // Set a file which contains parts that our document, or its attached template may not contain.\n doc.getFieldOptions().setBuiltInTemplatesPaths(new String[]{getMyDir() + \"Busniess brochure.dotx\"});\n\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n // Below are two ways to use fields to display the contents of our building block.\n // 1 - Using an AUTOTEXT field:\n FieldAutoText fieldAutoText = (FieldAutoText) builder.insertField(FieldType.FIELD_AUTO_TEXT, true);\n fieldAutoText.setEntryName(\"MyBlock\");\n\n Assert.assertEquals(\" AUTOTEXT MyBlock\", fieldAutoText.getFieldCode());\n\n // 2 - Using a GLOSSARY field:\n FieldGlossary fieldGlossary = (FieldGlossary) builder.insertField(FieldType.FIELD_GLOSSARY, true);\n fieldGlossary.setEntryName(\"MyBlock\");\n\n Assert.assertEquals(fieldGlossary.getFieldCode(), \" GLOSSARY MyBlock\");\n\n doc.updateFields();\n doc.save(getArtifactsDir() + \"Field.AUTOTEXT.GLOSSARY.dotx\");\n //ExEnd\n\n doc = new Document(getArtifactsDir() + \"Field.AUTOTEXT.GLOSSARY.dotx\");\n\n Assert.assertTrue(doc.getFieldOptions().getBuiltInTemplatesPaths().length == 0);\n\n fieldAutoText = (FieldAutoText) doc.getRange().getFields().get(0);\n\n TestUtil.verifyField(FieldType.FIELD_AUTO_TEXT, \" AUTOTEXT MyBlock\", \"Hello World!\\r\", fieldAutoText);\n Assert.assertEquals(\"MyBlock\", fieldAutoText.getEntryName());\n\n fieldGlossary = (FieldGlossary) doc.getRange().getFields().get(1);\n\n TestUtil.verifyField(FieldType.FIELD_GLOSSARY, \" GLOSSARY MyBlock\", \"Hello World!\\r\", fieldGlossary);\n Assert.assertEquals(\"MyBlock\", fieldGlossary.getEntryName());\n }", "public void prepareForFeaturesAndOrderCollection() throws Exception {\n\n LOG.info(\" - Preparing phrases...\");\n readPhrases(false);\n collectNumberProps(m_srcPhrs, m_trgPhrs, true, true); \n collectTypeProp(m_srcPhrs, m_trgPhrs); \n\n collectContextEqs();\n prepareSeedDictionary(m_contextSrcEqs, m_contextTrgEqs);\n prepareTranslitDictionary(m_contextSrcEqs);\n filterContextEqs();\n\n collectContextAndTimeProps(m_srcPhrs, m_trgPhrs);\n collectOrderProps(m_srcPhrs, m_trgPhrs);\n }", "void getNextWord () \n\t\t\tthrows IOException, FileNotFoundException {\n \n\t\tcontext.word.setLength(0);\n \n // Build the next entity\n while ((context.entityCharCount > 0)\n && (! atEnd)) {\n getNextCharacter();\n }\n \n // See if the word starts with white space\n boolean startingWhiteSpaceForWord\n = (htmlChar.whiteSpace \n && (context.fieldType == HTMLContext.TEXT)\n && (! context.preformatted));\n \n // Capture leading whitespace if appropriate\n if (htmlChar.whiteSpace\n && context.fieldType == HTMLContext.TEXT\n && (context.field.length() > 0\n || context.preformatted)) {\n context.word.append (htmlChar.character);\n }\n \n // If we're dealing with preformatted text, \n // then capture all leading white space\n if (context.preformatted && context.fieldType == HTMLContext.TEXT) {\n while (htmlChar.whiteSpace && (! atEnd)) {\n context.word.append (htmlChar.character);\n getNextCharacter();\n }\n }\n \n // Now skip any remaining white space\n while (((htmlChar.whiteSpace) \n || context.entityCharCount > 0)\n && (! atEnd)) {\n getNextCharacter();\n }\n \n // See if we've got got a quoted attribute value\n\t\tif (context.fieldType == HTMLContext.ATTRIBUTE_VALUE\n && (! htmlChar.translatedEntity)) {\n if (htmlChar.character == GlobalConstants.DOUBLE_QUOTE) {\n context.quoted = true;\n context.startQuoteChar = GlobalConstants.DOUBLE_QUOTE;\n }\n else\n if (htmlChar.character == GlobalConstants.SINGLE_QUOTE) {\n context.quoted = true;\n context.startQuoteChar = GlobalConstants.SINGLE_QUOTE;\n }\n\t\t}\n \n // Now capture the word's content\n\t\twhile (! htmlChar.endsWord) {\n\t\t\tcontext.word.append (htmlChar.character);\n\t\t\tdo {\n getNextCharacter();\n } while ((context.entityCharCount > 0) && (! atEnd));\n\t\t}\n \n\t\tif (context.quoted\n && (! htmlChar.translatedEntity)\n\t\t\t\t&& htmlChar.character == context.startQuoteChar) {\n\t\t\tcontext.word.append (htmlChar.character);\n context.quoted = false;\n\t\t\tdo {\n getNextCharacter();\n } while ((context.entityCharCount > 0) && (! atEnd));\n\t\t}\n if (startingWhiteSpaceForWord\n && context.fieldType == HTMLContext.TEXT\n && context.word.length() > 0\n && (! Character.isWhitespace (context.word.charAt (0)))) {\n context.word.insert (0, ' ');\n }\n\t}", "private static void processText(String line, BufferedWriter wrtr)\n\t\t\tthrows JSONException, IOException {\n\t\tJSONObject topicModel = TopicModelTemplateUtil\n\t\t\t\t.getJSONFromTemplate(line);\n\t\t// populate the WORD vector for the current topic model\n\t\tTopicModelTemplateUtil.geTopicModelFromTemplate(topicModel).forEach(\n\t\t\t\ttpm -> {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tLuceneNLPUtil.getRemovedStopAndStem(tpm.getWord(),\n\t\t\t\t\t\t\t\tLuceneNLPUtil.getDefaultEnglishStopWordList())\n\t\t\t\t\t\t\t\t.forEach(word -> {\n\t\t\t\t\t\t\t\t\tif (VOCABULARY_MAP.containsKey(word)) {\n\t\t\t\t\t\t\t\t\t\tVOCABULARY_MAP.replace(word, 1);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t// dump it to the file\n\t\tdumpTextLine(topicModel.getString(ConfigConstant.JSON_FIELD.BUSINESS_ID\n\t\t\t\t.getFieldName()), wrtr);\n\t}", "protected CompiledPage preprocessAndExpand(\n\t ExpansionCallback callback,\n\t PageId pageId,\n\t String wikitext,\n\t boolean forInclusion,\n\t EntityMap entityMap,\n\t Map<String, AstNode> arguments,\n\t ExpansionFrame rootFrame,\n\t ExpansionFrame parentFrame)\n\t throws CompilerException\n\t{\n\t\tif (pageId == null)\n\t\t\tthrow new NullPointerException();\n\t\t\n\t\tif (wikitext == null)\n\t\t\tthrow new NullPointerException();\n\t\t\n\t\tPageTitle title = pageId.getTitle();\n\t\t\n\t\tCompilerLog log = new CompilerLog();\n\t\tlog.setTitle(title.getFullTitle());\n\t\tlog.setRevision(pageId.getRevision());\n\t\t\n\t\tLazyPreprocessedPage pprAst;\n\t\ttry\n\t\t{\n\t\t\tString validatedWikitext =\n\t\t\t validate(title, wikitext, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage ppAst =\n\t\t\t preprocess(title, validatedWikitext, forInclusion, entityMap, log);\n\t\t\t\n\t\t\tpprAst = expand(\n\t\t\t callback,\n\t\t\t title,\n\t\t\t ppAst,\n\t\t\t entityMap,\n\t\t\t arguments,\n\t\t\t forInclusion,\n\t\t\t rootFrame,\n\t\t\t parentFrame,\n\t\t\t log);\n\t\t}\n\t\tcatch (CompilerException e)\n\t\t{\n\t\t\te.attachLog(log);\n\t\t\tthrow e;\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tthrow new CompilerException(\"Compilation failed!\", e, log);\n\t\t}\n\t\t\n\t\treturn new CompiledPage(\n\t\t new Page(pprAst.getContent()),\n\t\t pprAst.getWarnings(),\n\t\t log);\n\t}", "void commonConstruction () {\n\n if (inFile != null) {\n dataParent = inFile.getParent();\n }\n if (inURL != null) {\n dataParent = \"www\";\n }\n context = new HTMLContext();\n context.setFile(this);\n context.entityTranslation = false;\n\t\thtmlChar = new HTMLCharacter (context);\n }", "public static void convertTextParts(TextContainer tc) {\r\n \t\tfor (TextPart textPart : tc) {\r\n \t\t\tconvertTextPart(textPart);\r\n \t\t}\r\n \t}", "String processing();", "public CompiledPage postprocess(\n\t PageId pageId,\n\t String wikitext,\n\t ExpansionCallback callback)\n\t throws CompilerException\n\t{\n\t\tif (pageId == null)\n\t\t\tthrow new NullPointerException();\n\t\t\n\t\tPageTitle title = pageId.getTitle();\n\t\t\n\t\tCompilerLog log = new CompilerLog();\n\t\tlog.setTitle(title.getFullTitle());\n\t\tlog.setRevision(pageId.getRevision());\n\t\t\n\t\tLazyParsedPage pAst;\n\t\ttry\n\t\t{\n\t\t\tEntityMap entityMap = new EntityMap();\n\t\t\t\n\t\t\tString validatedWikitext =\n\t\t\t validate(title, wikitext, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage ppAst =\n\t\t\t preprocess(title, validatedWikitext, false, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage pprAst = ppAst;\n\t\t\tif (callback != null)\n\t\t\t\tpprAst = expand(callback, title, ppAst, entityMap, null, false, log);\n\t\t\t\n\t\t\tpAst = parse(title, pprAst, entityMap, log);\n\t\t\t\n\t\t\tpAst = postprocess(title, pAst, log);\n\t\t}\n\t\tcatch (CompilerException e)\n\t\t{\n\t\t\te.attachLog(log);\n\t\t\tthrow e;\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tthrow new CompilerException(\"Compilation failed!\", e, log);\n\t\t}\n\t\t\n\t\treturn new CompiledPage(\n\t\t new Page(pAst.getContent()),\n\t\t pAst.getWarnings(),\n\t\t log);\n\t}", "public static void convertTextPart(TextPart textPart) {\r\n \t\tif (!textPart.isSegment()) {\r\n \t\t\tTextFragment tf = textPart.getContent();\r\n \t\t\tif (tf.hasCode()) return;\r\n \t\t\t\r\n \t\t\t// Move the whole text of text part to a single code\r\n \t\t\ttf.changeToCode(0, tf.getCodedText().length(), \r\n \t\t\t\t\tTagType.PLACEHOLDER, null);\r\n \t\t}\r\n \t}", "public void run() {\n \n if (Parameter != null && Parameter instanceof ConvertTextUnitsParameter) {\n CastParameter = (ConvertTextUnitsParameter)Parameter;\n }\n else {\n CastParameter = null;\n }\n\n String shortErrorMessage = \"Error: Text Units Cannot be Converted!\";\n this.acceptTask(TaskProgress.INDETERMINATE, \"Initial Preparations\");\n this.validateParameter(Parameter, shortErrorMessage);\n this.openDiasdemCollection(CastParameter.getCollectionFileName());\n this.checkPrerequisitesAndSetDefaultTextUnitsLayer(shortErrorMessage);\n \n if (CastParameter.getConversionType() == ConvertTextUnitsParameter\n .APPLY_REGULAR_EXPRESSION_TO_TEXT_UNITS) {\n RegexPattern = Pattern.compile(CastParameter.getRegularExpression());\n }\n \n if (CastParameter.getConversionType() == ConvertTextUnitsParameter\n .IDENTIFY_SPECIFIED_MULTI_TOKEN_TERMS) {\n // read multi token word: each line contains one multi token word;\n // comment lines start with '#'\n TextFile multiTokenFile = new TextFile(\n new File(CastParameter.getMultiTokenFileName()));\n multiTokenFile.open();\n String line = multiTokenFile.getFirstLineButIgnoreCommentsAndEmptyLines();\n ArrayList list = new ArrayList();\n while (line != null) {\n list.add(line.trim());\n line = multiTokenFile.getNextLineButIgnoreCommentsAndEmptyLines();\n }\n // sort multi token terms by decreasing length\n Collections.sort(list, new SortStringsByDecreasingLength());\n // for (int i = 0; i < list.size(); i++) {\n // System.out.println((String)list.get(i));\n // }\n // System.out.println(list.size());\n String[] multiToken = new String[list.size()];\n for (int i = 0; i < list.size(); i++)\n multiToken[i] = (String)list.get(i);\n multiTokenFile.close();\n MyMultiTokenWordIdentifier = new HeuristicMultiTokenWordIdentifier(\n multiToken);\n }\n else {\n MyMultiTokenWordIdentifier = null;\n }\n \n if (CastParameter.getConversionType() == ConvertTextUnitsParameter\n .FIND_AND_REPLACE_SPECIFIED_TOKENS) {\n // read token replacement file: each line contains the tokens to search \n // for and the replacement tokens separated by a tab stop;\n // comment lines start with '#'\n TextFile tokenReplacementFile = new TextFile(\n new File(CastParameter.getTokenReplacementFileName()));\n tokenReplacementFile.open();\n String line = tokenReplacementFile.getFirstLineButIgnoreCommentsAndEmptyLines();\n HashMap tokensSearchList = new HashMap();\n String[] tokensContents = null;\n while (line != null) {\n tokensContents = line.split(\"\\t\");\n if (tokensContents.length == 2\n && tokensContents[1].trim().length() > 0) {\n try {\n tokensSearchList.put(tokensContents[0].trim(), \n tokensContents[1].trim());\n }\n catch (PatternSyntaxException e) {\n System.out.println(\"[TokenizeTextUnitsTask] Regex syntax error in \"\n + \" file \" + CastParameter.getTokenReplacementFileName() + \": \"\n + \" Line \\\"\" + line + \"\\\"; error message: \" + e.getMessage());\n }\n }\n else {\n System.out.println(\"[TokenizeTextUnitsTask] Error in file \"\n + CastParameter.getTokenReplacementFileName() + \": Line \\\"\"\n + line + \"\\\" does not conform to syntax!\");\n }\n line = tokenReplacementFile.getNextLineButIgnoreCommentsAndEmptyLines();\n }\n // sort multi token terms by decreasing length\n ArrayList list = new ArrayList(tokensSearchList.keySet());\n Collections.sort(list, new SortStringsByDecreasingLength());\n // create arrays for token replacement \n String[] tokensSearch = new String[list.size()];\n String[] tokensReplace = new String[list.size()];\n Iterator iterator = list.iterator();\n int i = 0;\n while (iterator.hasNext()) {\n TmpString = (String)iterator.next();\n tokensSearch[i] = TmpString;\n tokensReplace[i++] = (String)tokensSearchList.get(TmpString);\n }\n tokenReplacementFile.close();\n MyTokenReplacer = new HeuristicTokenReplacer(tokensSearch, tokensReplace);\n }\n else {\n MyTokenReplacer = null;\n }\n \n int counterProgress = 0;\n long maxProgress = DiasdemCollection.getNumberOfDocuments();\n \n DiasdemDocument = DiasdemCollection.getFirstDocument(); \n while (DiasdemDocument != null) {\n \n if (counterProgress == 1 || (counterProgress % 50) == 0) {\n Progress.update( (int)(counterProgress * 100 / maxProgress),\n \"Processing Document \" + counterProgress);\n DiasdemServer.setTaskProgress(Progress, TaskThread);\n }\n\n DiasdemDocument.setActiveTextUnitsLayer(DiasdemProject\n .getActiveTextUnitsLayerIndex());\n DiasdemDocument.backupProcessedTextUnits(DiasdemProject\n .getProcessedTextUnitsRollbackOption());\n \n for (int i = 0; i < DiasdemDocument.getNumberOfProcessedTextUnits(); \n i++) {\n DiasdemTextUnit = DiasdemDocument.getProcessedTextUnit(i);\n switch (CastParameter.getConversionType()) {\n case ConvertTextUnitsParameter.CONVERT_TEXT_UNITS_TO_LOWER_CASE: {\n TextUnitContentsAsString = DiasdemTextUnit.getContentsAsString()\n .toLowerCase();\n break;\n }\n case ConvertTextUnitsParameter.CONVERT_TEXT_UNITS_TO_UPPER_CASE: {\n TextUnitContentsAsString = DiasdemTextUnit.getContentsAsString()\n .toUpperCase();\n break;\n } \n case ConvertTextUnitsParameter.APPLY_REGULAR_EXPRESSION_TO_TEXT_UNITS: {\n RegexMatcher = RegexPattern.matcher(DiasdemTextUnit\n .getContentsAsString());\n TmpStringBuffer = new StringBuffer(DiasdemTextUnit\n .getContentsAsString().length() + 10000);\n while (RegexMatcher.find()) {\n RegexMatcher.appendReplacement(TmpStringBuffer,\n CastParameter.getReplacementString());\n }\n TextUnitContentsAsString = RegexMatcher.appendTail(TmpStringBuffer)\n .toString();\n break;\n }\n case ConvertTextUnitsParameter.IDENTIFY_SPECIFIED_MULTI_TOKEN_TERMS: {\n TextUnitContentsAsString = MyMultiTokenWordIdentifier\n .identifyMultiTokenWords(DiasdemTextUnit.getContentsAsString());\n break;\n } \n case ConvertTextUnitsParameter.FIND_AND_REPLACE_SPECIFIED_TOKENS: {\n TextUnitContentsAsString = MyTokenReplacer\n .replaceTokens(DiasdemTextUnit.getContentsAsString());\n break;\n } \n case ConvertTextUnitsParameter.REMOVE_PART_OF_SPEECH_TAGS_FROM_TOKENS: {\n TextUnitContentsAsString = this.removeTagsFromTokens(\n DiasdemTextUnit.getContentsAsString(), \"/p:\");\n break;\n } \n case ConvertTextUnitsParameter.REMOVE_WORD_SENSE_TAGS_FROM_TOKENS: {\n TextUnitContentsAsString = this.removeTagsFromTokens(\n DiasdemTextUnit.getContentsAsString(), \"/s:\");\n break;\n } \n default: {\n TextUnitContentsAsString = DiasdemTextUnit.getContentsAsString();\n }\n }\n DiasdemTextUnit.setContentsFromString(TextUnitContentsAsString);\n DiasdemDocument.replaceProcessedTextUnit(i, DiasdemTextUnit);\n }\n\n DiasdemCollection.replaceDocument(DiasdemDocument\n .getDiasdemDocumentID(), DiasdemDocument);\n \n DiasdemDocument = DiasdemCollection.getNextDocument();\n counterProgress++;\n \n } // read all documents\n \n super.closeDiasdemCollection();\n \n CastResult = new ConvertTextUnitsResult(TaskResult.FINAL_RESULT,\n \"All processed text units have been converted in the DIAsDEM document\\n\" +\n \" collection \" +\n Tools.shortenFileName(CastParameter.getCollectionFileName(), 55) + \"!\", \n \"Processed text units have been converted.\");\n this.setTaskResult(100, \"All Documents Processed ...\", CastResult,\n TaskResult.FINAL_RESULT, Task.TASK_FINISHED);\n \n }", "public void extractKnowledge()\n {\n }", "public void getParsed(String text) {\n\t\tAnnotation document = new Annotation(text);\n\n\t\t// run all Annotators on this text\n\t\tpipeline.annotate(document);\n\t\tsentences = document.get(SentencesAnnotation.class);\n\t\tsentIt = sentences.iterator();\n\t}", "private void translate(String input)\r\n/* 270: */ {\r\n/* 271:229 */ if (input.trim().isEmpty())\r\n/* 272: */ {\r\n/* 273:230 */ Mark.err(new Object[] {\"IMPACT produced nothing to translate\" });\r\n/* 274:231 */ return;\r\n/* 275: */ }\r\n/* 276:233 */ this.things.clear();\r\n/* 277:234 */ this.triples.clear();\r\n/* 278:235 */ this.previousTriple = null;\r\n/* 279:236 */ this.previousTriples.clear();\r\n/* 280: */ \r\n/* 281:238 */ String[] sentences = input.trim().split(\"\\\\)\\\\.\");\r\n/* 282:240 */ for (String s : sentences)\r\n/* 283: */ {\r\n/* 284:241 */ s = s.trim();\r\n/* 285:242 */ Mark.say(new Object[] {\"Sentence:\", s });\r\n/* 286: */ try\r\n/* 287: */ {\r\n/* 288:244 */ String[] parts = s.split(\"\\\\(\");\r\n/* 289:245 */ ThingTimeTriple triple = constructGenesisAction(parts[0].trim(), parts[1].trim());\r\n/* 290:246 */ this.triples.add(triple);\r\n/* 291:247 */ this.tripleList.clear();\r\n/* 292:248 */ this.tripleList.addAll(this.triples);\r\n/* 293: */ }\r\n/* 294: */ catch (Exception e)\r\n/* 295: */ {\r\n/* 296:252 */ Mark.say(new Object[] {\"Blew out trying to process IMPACT result,\", s });\r\n/* 297: */ \r\n/* 298:254 */ e.printStackTrace();\r\n/* 299: */ }\r\n/* 300: */ }\r\n/* 301: */ }", "@Override\n public void onSuccess(Text visionText) {\n\n Log.d(TAG, \"onSuccess: \");\n extractText(visionText);\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic void process(JCas cas) throws AnalysisEngineProcessException {\n\t\tint id = 0;\n\t\tlog.info(\"Starting enhancement\");\n\t\tObject o = getContext().getConfigParameterValue(\"Tags\");\n\t\tfinal String[] tags;\n\t\tlog.debug(\"Object is: \" + o.getClass().getName());\n\t\tif (o instanceof String) {\n\t\t\ttags = ((String) o).split(\"(\\\\s*,\\\\s*)+\");\n\t\t\tif (log.isDebugEnabled()) {\n\t\t\t\tfinal StringBuilder sb = new StringBuilder();\n\t\t\t\tfor (String s:tags) {\n\t\t\t\t\tsb.append(s + \" \");\n\t\t\t\t}\n\t\t\t\tlog.debug(\"Tags: \" + sb.toString());\n\t\t\t}\n\t\t} else {\n\t\t\tObject[] args = { o.toString(), \"Tags\" };\n\t\t\tthrow new AnalysisEngineProcessException\n\t\t\t\t(AnalysisEngineProcessException.RESOURCE_DATA_NOT_VALID, args);\n\t\t}\n\n\t\tfinal FSIndex textIndex = cas.getAnnotationIndex(Token.type);\n\t\tfinal Iterator<Token> tit = textIndex.iterator();\n\n\t\tlog.debug(\"Feature Structure index size: \" + textIndex.size());\n\n\t\tToken t; // token pointer\n\n\t\titeratetokens: while (tit.hasNext()) {\n\t\t\tt = tit.next();\n\t\t\tif (t.getTag() == null) {\n\t\t\t\tlog.debug(\"Encountered token with NULL tag\");\n\t\t\t\tcontinue iteratetokens;\n\t\t\t}\n\t\t\tif (EnhancerUtils.arrayContains(t.getTag(), tags)) {\n\t\t\t\tfinal Enhancement e = new Enhancement(cas);\n\t\t\t\te.setBegin(t.getBegin());\n\t\t\t\te.setEnd(t.getEnd());\n\n\t\t\t\tid++;\n\t\t\t\te.setEnhanceStart(\"<span id=\\\"\" + EnhancerUtils.get_id(\"WERTi-span\",id) + \"\\\">\");\n\t\t\t\te.setEnhanceEnd(\"</span>\");\n\n\t\t\t\tif (log.isTraceEnabled()) {\n\t\t\t\t\tlog.trace(\"Enhanced \" + t.getCoveredText()\n\t\t\t\t\t\t\t+ \" with tag \"\n\t\t\t\t\t\t\t+ t.getTag()\n\t\t\t\t\t\t\t+ \" with id \"\n\t\t\t\t\t\t\t+ id);\n\t\t\t\t}\n\t\t\t\te.addToIndexes();\n\t\t\t}\n\t\t}\n\t\tlog.info(\"Finished enhancement\");\n\t}", "@Override\n public void execute(TransformerImpl transformerImpl) throws TransformerException {\n if (transformerImpl.getStylesheet().isSecureProcessing()) {\n throw new TransformerException(XSLMessages.createMessage(\"ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING\", new Object[]{this.getRawName()}));\n }\n try {\n transformerImpl.getResultTreeHandler().flushPending();\n Object object = transformerImpl.getExtensionsTable().get(this.m_extns);\n if (object == null) {\n if (this.hasFallbackChildren()) {\n this.executeFallbacks(transformerImpl);\n return;\n }\n object = new TransformerException(XSLMessages.createMessage(\"ER_CALL_TO_EXT_FAILED\", new Object[]{this.getNodeName()}));\n transformerImpl.getErrorListener().fatalError((TransformerException)object);\n return;\n }\n try {\n ((ExtensionHandler)object).processElement(this.getLocalName(), this, transformerImpl, this.getStylesheet(), this);\n return;\n }\n catch (Exception exception) {\n if (this.hasFallbackChildren()) {\n this.executeFallbacks(transformerImpl);\n return;\n }\n if (exception instanceof TransformerException) {\n TransformerException transformerException = (TransformerException)exception;\n if (transformerException.getLocator() == null) {\n transformerException.setLocator(this);\n }\n transformerImpl.getErrorListener().fatalError(transformerException);\n return;\n }\n if (exception instanceof RuntimeException) {\n ErrorListener errorListener = transformerImpl.getErrorListener();\n TransformerException transformerException = new TransformerException(exception);\n errorListener.fatalError(transformerException);\n return;\n }\n ErrorListener errorListener = transformerImpl.getErrorListener();\n TransformerException transformerException = new TransformerException(exception);\n errorListener.warning(transformerException);\n return;\n }\n }\n catch (SAXException sAXException) {\n throw new TransformerException(sAXException);\n }\n catch (TransformerException transformerException) {\n transformerImpl.getErrorListener().fatalError(transformerException);\n }\n }", "private void trainText() throws Exception\n\t{\n\t\tdbiterator.setDataSource(DBInstanceIterator.DBSource.TEXT);\n\t\tSystem.out.println(\"Starting reading Text Trainingset ..\");\n\n\t\tPipe serialpipe = getTextPipe();\n\t\tInstanceList text_instances = new InstanceList(serialpipe);\n\n\t\tSystem.out.println(\"Preprocessing on Text Trainingset ..\");\n\t\ttext_instances.addThruPipe(dbiterator);\n\n\t\tSystem.out.println(\"Text Training set : \" + text_instances.size());\n\t\tSystem.out.println(\"Saving preprocessed data ..\");\n\t\tsaveinstances(text_instances, Train + \"T.bin\");\n\n\t\tSystem.out.println(\"Saving Features data ..\");\n\t\ttext_instances.getDataAlphabet().dump(new PrintWriter(new File(Attributes + \"text.dat\")));\n\n\t\tNaiveBayesTrainer trainer = new NaiveBayesTrainer();\n\n\t\tSystem.out.println(\"NaiveBayes Starts Training on Text training set ..\");\n\t\tNaiveBayes classifier = trainer.train(text_instances);\n\n\t\tSystem.out.println(\"Targets labels : \\t\"+classifier.getLabelAlphabet());\n\t\tSystem.out.println(\"Saving Naive Bayes Classifier ..\");\n\t\tsaveModel(classifier, Text_Train);\n\t\tSystem.out.println(\"Text classifier saved to : \" + Text_Train);\n\t}", "@Override\n public void process(JCas jCas) throws AnalysisEngineProcessException {\n JCas viewJCas = jCas;\n if (!view.equals(VIEW_SYSTEM)) {\n try {\n viewJCas = jCas.getView(view);\n } catch (CASException e) {// just rethrow\n throw new AnalysisEngineProcessException(e);\n }\n }\n\n Collection<de.julielab.jules.types.Sentence> sentences = select(\n viewJCas, de.julielab.jules.types.Sentence.class);\n\n for (de.julielab.jules.types.Sentence julesSentence : sentences) {\n int sentence_start = julesSentence.getBegin();\n\n if (julesSentence.getCoveredText().length() > 0) {\n\n try {\n Sentence sentence = new Sentence(\n julesSentence.getCoveredText());\n bannerTokenizer.tokenize(sentence);\n crfTagger.tag(sentence);// error\n if (postProcessor != null)\n postProcessor.postProcess(sentence);\n\n for (Mention mention : sentence.getMentions()) {\n\n int startChar = mention.getStartChar() + sentence_start;\n int endChar = mention.getEndChar() + sentence_start;\n // LOG.debug(\"found NE:\" + mention.getText() + \" \" +\n // startChar\n // + \":\" + endChar);\n Protein prot = new Protein(viewJCas, startChar, endChar);\n prot.setName(mention.getText());\n prot.setTextualRepresentation(\"⊂PROT⊃\");\n prot.addToIndexes();\n }\n\n } catch (Throwable t) {\n // not sure why, but this happens sometimes after some time\n int docId = getHeaderIntDocId(viewJCas);\n LOG.warn(\"Banner exception at docId {}, skipping. {}\",\n docId, StringUtils.print(t));\n try {\n GarbageCollectorAnnotator.runGC();\n loadTagger(); // reload\n } catch (Exception e) {\n throw new AnalysisEngineProcessException(e);\n }\n }\n }\n }\n }", "@Override\n public void unpackMarkup(Document doc, RepositioningInfo repInfo,\n RepositioningInfo ampCodingInfo) throws DocumentFormatException {\n if((doc == null)\n || (doc.getSourceUrl() == null && doc.getContent() == null)) {\n\n throw new DocumentFormatException(\n \"GATE document is null or no content found. Nothing to parse!\"); }// End\n // if\n\n // Create a status listener\n StatusListener statusListener = new StatusListener() {\n @Override\n public void statusChanged(String text) {\n // This is implemented in DocumentFormat.java and inherited here\n fireStatusChanged(text);\n }\n };\n\n // determine whether we have a GATE format document or not\n /*String content = doc.getContent().toString();\n if(content.length() > 2048) {\n content = content.substring(0, 2048);\n }*/\n boolean gateFormat = isGateFIFormat(doc);\n \n\n if(gateFormat) {\n unpackGateFormatMarkup(doc, statusListener);\n } else {\n unpackGeneralXmlMarkup(doc, repInfo, ampCodingInfo, statusListener);\n }\n }", "@Test\n\tpublic void testTextToXml()\n\t{\n\t\tDocument doc = XMLUtil.createEmpty();\n\t\tText text = new Text(\"Steve Unger Smells\");\n\t\tElement element = this.parser.toXML(doc, text);\n\t\tText text2 = this.parser.fromXML(element);\n\t\t\n\t\tassertEquals(\"Steve Unger Smells\", text2.getText());\t\t\n\t}", "public static void preprocessWikipediaInformation(LocationDataIO locationData) {\n\t\ttry {\n\t\t\tSAXParserFactory factory = SAXParserFactory.newInstance();\n\t\t\tfactory.setFeature(\"http://xml.org/sax/features/validation\", false);\n\t\t\tfactory.setFeature(\"http://apache.org/xml/features/continue-after-fatal-error\", true);\n\t\t\tfactory.setFeature(\"http://apache.org/xml/features/continue-after-fatal-error\", true);\n\t\t\tSAXParser parser = factory.newSAXParser();\n\n\t\t\tIterator<POI> iter = locationData.getPOIs().iterator();\n\t\t\twhile (iter.hasNext()) {\n\t\t\t\tPOI current = iter.next();\n\t\t\t\tif (current.getURL() != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tSystem.out.print(current.getName());\n\t\t\t\t\t\tURL url = current.getURL();\n\t\t\t\t\t\tURLConnection connection = url.openConnection();\n\t\t\t\t\t\tconnection.connect();\n\t\t\t\t\t\tInputSource input = new InputSource(connection.getInputStream());\n\t\t\t\t\t\tString lang = current.getURL().toExternalForm();\n\t\t\t\t\t\tif (lang.length() > 9 && lang.substring(7, 9).matches(\"[a-zA-Z]{2}\")) {\n\t\t\t\t\t\t\tlang = lang.substring(7, 9);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlang = \"de\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tWikipediaHandler handler = new WikipediaHandler(lang);\n\n\t\t\t\t\t\tparser.parse(input, handler);\n\t\t\t\t\t\tcurrent.setTextInfo(handler.getFirstParagraphs());\n\t\t\t\t\t\tcurrent.setURL(handler.getImageURL());\n\t\t\t\t\t\tSystem.out.print(\" ✓\\n\");\n\t\t\t\t\t} catch (SAXException e) {\n\t\t\t\t\t\tlogger.info(String.format(\"Schwerwiegender Syntaxfehler in %s! Wird ignoriert.\", current.getURL().toExternalForm()));\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tlogger.info(current.getURL().toExternalForm() + \" konnte nicht gelesen werden! Wird ignoriert.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (ParserConfigurationException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SAXNotRecognizedException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SAXNotSupportedException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SAXException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void convertObjectToXML() throws TransformerException{\r\n\t\tDocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();\r\n\t\ttry {\r\n\t\t\tDocumentBuilder docBuilder = docFactory.newDocumentBuilder();\r\n\r\n\t\t\t// root elements\r\n\t\t\tDocument doc = docBuilder.newDocument();\r\n\t\t\tElement fileElement = doc.createElement(\"TextFile\");\r\n\t\t\tdoc.appendChild(fileElement);\r\n\r\n\t\t\t// set attribute to file element\r\n\t\t\tAttr attr = doc.createAttribute(\"filename\");\r\n\t\t\tattr.setValue(this.fileName);\r\n\t\t\tfileElement.setAttributeNode(attr);\r\n\t\t\t\r\n\t\t\t//Tagged for paragraphs,sentence,word and punctuation\r\n\r\n\t\t\tfor (Paragraph paragraph : paragraphs) { // for each paragraph\r\n\r\n\t\t\t\tElement paragraphElement = doc.createElement(paragraph.getXMLTag());\r\n\t\t\t\tfileElement.appendChild(paragraphElement);\r\n\t\t\t\t//System.out.println(\"PARAGRAPH:\"+paragraph.getSentences().size());\r\n\t\t\t\tfor (Sentence sentence : paragraph.getSentences()) { // for each sentence\r\n\t\t\t\t\tElement sentenceElement = doc.createElement(sentence.getXMLTag());\r\n\t\t\t\t\tparagraphElement.appendChild(sentenceElement);\r\n\t\t\t\t\t//System.out.println(\"Sentence:\"+sentence.getSentencesItems().size());\r\n\t\t\t\t\tfor (Items sentenceItem : sentence.getSentencesItems()) { // for each sentence item\r\n\t\t\t\t\t\tif (sentenceItem instanceof Word) {\r\n\t\t\t\t\t\t\tWord word = (Word)sentenceItem;\r\n\t\t\t\t\t\t\tElement wordElement = doc.createElement(word.getXMLTag());\r\n\t\t\t\t\t\t\twordElement.appendChild(doc.createTextNode(word.getWord()));\r\n\t\t\t\t\t\t\tsentenceElement.appendChild(wordElement); //output text for each word\r\n\t\t\t\t\t\t\t//System.out.println(\"Word:\"+word.getWord());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (sentenceItem instanceof Punctuation) {\r\n\t\t\t\t\t\t\tPunctuation punctuation = (Punctuation)sentenceItem;\r\n\t\t\t\t\t\t\tElement punctuationElement = doc.createElement(punctuation.getXMLTag());\r\n\t\t\t\t\t\t\tpunctuationElement.appendChild(doc.createTextNode(punctuation.getPunctuation()));\r\n\t\t\t\t\t\t\tsentenceElement.appendChild(punctuationElement); //output text for each punctuation\r\n\t\t\t\t\t\t\t//System.out.println(\"Punctuation:\"+punctuation.getPunctuation());\r\n\t\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\t// write the content into xml file\r\n\t\t\tTransformerFactory transformerFactory = TransformerFactory.newInstance();\r\n\t\t\tTransformer transformer = transformerFactory.newTransformer();\r\n\t\t\tDOMSource source = new DOMSource(doc);\r\n\r\n\t\t\t//System.out.println(fileName.lastIndexOf(\"/\"));\r\n\t\t\tStreamResult result = new StreamResult(new File(\"output_\"+fileName.substring(fileName.lastIndexOf(\"/\")+1, fileName.length()-4)+\".xml\"));\r\n\t\t\ttransformer.transform(source, result);\r\n\r\n\t\t\tSystem.out.println(\"File: \"+\"output_\"+fileName.substring(fileName.lastIndexOf(\"/\")+1, fileName.length()-4)+\".xml\"+\" saved!\");\r\n\r\n\t\t}\r\n\t\tcatch (ParserConfigurationException 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\t}", "protected abstract MS_LineBuilder prepareContent(MS_LineBuilder lb);", "@Test\n public void InternalNLP_annotate_doesAnnotate() {\n ExtractedText extractedText = null;\n\n String fileUri = \"dummyUri\";\n String fileRef = \"src/test/res/Pasta.txt\";\n File file = new File(fileRef);\n try {\n InputStream inputStream = new FileInputStream(file);\n extractedText = mInternalTextProcessor.processFile(inputStream, fileUri, fileRef\n , \"txt\", false);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (FileTypeNotSupportedException e) {\n e.printStackTrace();\n } catch (DocumentNotSupportedException e) {\n e.printStackTrace();\n }\n\n // Annotate\n mInternalNLP.annotate(extractedText);\n\n if(!extractedText.getTitle().isEmpty()) {\n Assert.assertNotNull(extractedText.getTitleAnnotation());\n }\n\n for (Section section: extractedText.getSections()) {\n if(!section.getBody().isEmpty()) {\n Assert.assertNotNull(section.getBodyAnnotation());\n }\n if(!section.getTitle().isEmpty()) {\n Assert.assertNotNull(section.getTitleAnnotation());\n }\n }\n }", "public ParseTreeNode generateParseTree(ContextFreeGrammar cfg, Word w) {\n int n = w.length();\r\n int exactDervOfWord = (2*n) - 1;\r\n List<Rule> rules = new ArrayList<Rule>();\r\n rules = cfg.getRules();\r\n Variable startVariable = cfg.getStartVariable();\r\n int numDerivations = 0;\r\n List<List<Word>> generalList = new ArrayList<List<Word>>();\r\n List<List<Word>> varList = new ArrayList<List<Word>>();\r\n\r\n\r\n // 2. Lists for storing derivation\r\n // make exact number of list for words to be stored at each derivation \r\n makeLists(exactDervOfWord, generalList);\r\n\r\n // 3. Derivation from Start Variable\r\n for (Rule rule : rules) {\r\n if (rule.getVariable().equals(startVariable)) {\r\n generalList.get(numDerivations).add(rule.getExpansion());\r\n }\r\n }\r\n numDerivations += 1;\r\n\r\n // 4. \r\n while (numDerivations < exactDervOfWord-n) {\r\n if (numDerivations == 1){\r\n // Stores the var only from the start expansion into varList\r\n List<Word> listOfVars = new ArrayList<Word>();\r\n for (Word word : generalList.get(numDerivations-1)){\r\n boolean varOnly= true;\r\n for (int i =0; i < word.length(); i++){\r\n if(word.get(i).isTerminal()){\r\n varOnly = false;\r\n }\r\n }\r\n if (varOnly){\r\n listOfVars.add(word);\r\n }\r\n }\r\n varList.add(listOfVars);\r\n numDerivations += 1; \r\n }\r\n if (numDerivations > 1 && numDerivations - 1 < exactDervOfWord-n ) {\r\n List<List<List<Word>>> listOfExpPerDerviation = new ArrayList<List<List<Word>>>();\r\n for (Word word : varList.get(numDerivations-2)){\r\n List<List<Word>> listOfExPerWord = new ArrayList<List<Word>>();\r\n for(int i= 0; i <word.length(); i++){\r\n for(Rule rule :rules){\r\n List<Word> tempListofExpan = new ArrayList<Word>();\r\n if(rule.getVariable().equals(word.get(i))){\r\n if (!rule.getExpansion().isTerminal()){\r\n tempListofExpan.add(word);\r\n tempListofExpan.add(word.replace(i, rule.getExpansion()));\r\n listOfExPerWord.add(tempListofExpan);\r\n }\r\n }\r\n }\r\n }\r\n listOfExpPerDerviation.add(listOfExPerWord);\r\n }\r\n numDerivations += 1;\r\n }\r\n }\r\n\r\n return null;\r\n return null;\r\n }", "@Test\n\tpublic void testStoreProcessText3() {\n\t\tint sourceID = dm.storeProcessedText(pt6);\n\t\tassertTrue(sourceID > 0);\n\t\t\n\t\tds.startSession();\n\t\tSource source = ds.getSource(pt6.getMetadata().getUrl());\n\t\tassertTrue(pt6.getMetadata().getName().equals(source.getName()));\n\t\t\n\t\tList<Entity> entities = (List<Entity>) ds.getEntities(sourceID);\n\t\tassertTrue(pt6.getEntities().size() == entities.size());\n\t\t\n\t\tfor(int i = 0; i < pt6.getEntities().size(); i++){\n\t\t\tEntity originalEntity = pt6.getEntities().get(i);\n\t\t\tEntity retrievedEntity = entities.get(i);\n\t\t\tassertTrue(originalEntity.getContent().equals(retrievedEntity.getContent()));\n\t\t}\n\t\tds.closeSession();\n\t\t\n\t\t\n\t}", "private void checkTextAnnotation(MGraph g, UriRef textAnnotation, String content) {\n Iterator<Triple> selectedTextIterator = g.filter(textAnnotation,\n Properties.ENHANCER_SELECTED_TEXT, null);\n // check if the selected text is added\n assertTrue(selectedTextIterator.hasNext());\n // test if the selected text is part of the TEXT_TO_TEST\n Resource object = selectedTextIterator.next().getObject();\n assertTrue(object instanceof Literal);\n Literal selectedText = (Literal)object;\n object = null;\n assertTrue(content.indexOf(selectedText.getLexicalForm()) >= 0);\n // test if context is added\n //context not present for Zemanta\n// Iterator<Triple> selectionContextIterator = g.filter(textAnnotation,\n// Properties.ENHANCER_SELECTION_CONTEXT, null);\n// assertTrue(selectionContextIterator.hasNext());\n// // test if the selected text is part of the TEXT_TO_TEST\n// object = selectionContextIterator.next().getObject();\n// assertTrue(object instanceof Literal);\n// assertTrue(content.indexOf(((Literal)object).getLexicalForm()) >= 0);\n// object = null;\n //test start/end if present\n Iterator<Triple> startPosIterator = g.filter(textAnnotation,\n ENHANCER_START, null);\n Iterator<Triple> endPosIterator = g.filter(textAnnotation,\n ENHANCER_END, null);\n //start end is optional, but if start is present, that also end needs to be set\n if(startPosIterator.hasNext()){\n Resource resource = startPosIterator.next().getObject();\n //only a single start position is supported\n assertTrue(!startPosIterator.hasNext());\n assertTrue(resource instanceof TypedLiteral);\n TypedLiteral startPosLiteral = (TypedLiteral) resource;\n resource = null;\n int start = LiteralFactory.getInstance().createObject(Integer.class, startPosLiteral);\n startPosLiteral = null;\n //now get the end\n //end must be defined if start is present\n assertTrue(endPosIterator.hasNext());\n resource = endPosIterator.next().getObject();\n //only a single end position is supported\n assertTrue(!endPosIterator.hasNext());\n assertTrue(resource instanceof TypedLiteral);\n TypedLiteral endPosLiteral = (TypedLiteral) resource;\n resource = null;\n int end = LiteralFactory.getInstance().createObject(Integer.class, endPosLiteral);\n endPosLiteral = null;\n //check for equality of the selected text and the text on the selected position in the content\n //System.out.println(\"TA [\"+start+\"|\"+end+\"]\"+selectedText.getLexicalForm()+\"<->\"+content.substring(start,end));\n assertTrue(content.substring(start, end).equals(selectedText.getLexicalForm()));\n } else {\n //if no start position is present, there must also be no end position defined\n assertTrue(!endPosIterator.hasNext());\n }\n }", "private void initializeAnimalIText() {\r\n\t\tiText = lang.newText(new Offset(0, 178, rowText, AnimalScript.DIRECTION_SW), \"\", \"iText\", null);\r\n\t\tiText.hide();\r\n\t}", "public void processDocument() {\n\n\t\t// compact concepts\n\t\tprocessConcepts(concepts);\n\t}", "@Override\n\tprotected Map<Object, Object> rawTextParse(CharSequence text) {\n\n\t\tStanfordCoreNLP pipeline = null;\n\t\ttry {\n\t\t\tpipeline = pipelines.take();\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tAnnotation document = new Annotation(text.toString());\n\t\tpipeline.annotate(document);\n\t\tMap<Object, Object> sentencesMap = new LinkedHashMap<Object, Object>();//maintain sentence order\n\t\tint id = 0;\n\t\tList<CoreMap> sentences = document.get(CoreAnnotations.SentencesAnnotation.class);\n\n\t\tfor (CoreMap sentence : sentences) {\n\t\t\tStringBuilder processedText = new StringBuilder();\n\t\t\tfor (CoreLabel token : sentence.get(CoreAnnotations.TokensAnnotation.class)) {\n\t\t\t\tString word = token.get(CoreAnnotations.TextAnnotation.class);\n\t\t\t\tString lemma = token.get(CoreAnnotations.LemmaAnnotation.class);\n\t\t\t\tString pos = token.get(CoreAnnotations.PartOfSpeechAnnotation.class);\n\t\t\t\t//todo this should really happen after parsing is done, because using lemmas might confuse the parser\n\t\t\t\tif (config().isUseLowercaseEntries()) {\n\t\t\t\t\tword = word.toLowerCase();\n\t\t\t\t\tlemma = lemma.toLowerCase();\n\t\t\t\t}\n\t\t\t\tif (config().isUseLemma()) {\n\t\t\t\t\tword = lemma;\n\t\t\t\t}\n\t\t\t\tprocessedText.append(word).append(POS_DELIMITER).append(lemma).append(POS_DELIMITER).append(pos).append(TOKEN_DELIM);\n //inserts a TOKEN_DELIM at the end too\n\t\t\t}\n\t\t\tsentencesMap.put(id, processedText.toString().trim());//remove the single trailing space\n\t\t\tid++;\n\t\t}\n\t\ttry {\n\t\t\tpipelines.put(pipeline);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn sentencesMap;\n\t}", "public void processingInstruction(String target, String data)\n throws SAXException\n {\n if( XCHAIN_TRANSFORMER_FACTORY_TARGET.equals(target) && inProlog ) {\n if( templatesHandler != null ) {\n if( log.isWarnEnabled() ) {\n log.warn(\"More than one xchain-transformer-factory processing instructions were found in the prolog of '\"+systemId+\"'.\");\n }\n }\n else {\n loadTemplatesHandler(data);\n }\n }\n else if( inProlog ) {\n // cache the processing instruction.\n eventList.add(new ProcessingInstructionEvent(target, data));\n }\n else {\n super.processingInstruction(target, data);\n }\n }", "protected void extract() {\n\t\tfor (ITSState nodeState : doc.iterNodes()) {\n\t\t\tNode node = nodeState.node;\n\t\t\tRuleResolver resolver = resolvers.get(node.getNodeName()); \n\t\t\tif (resolver != null) {\n\t\t\t\tGlobalRule rule = resolver.extractRule(attrReader, parameters, nodeState.node);\n\t\t\t\tapplyRule(resolver, rule);\n\t\t\t}\n\t\t\t\n\t\t\tif (node.getNodeName().equals(\"its:param\")) {\n\t\t\t\tString name = node.getAttributes().getNamedItem(\"name\").getNodeValue();\n\t\t\t\tString value = node.getTextContent();\n\t\t\t\tparameters.add(name, value);\n\t\t\t} else if (attrReader.dialect.isRules(node)) { \n\t\t\t\t// we have external link (xlink:href or link href)\n\t\t\t\tString external = attrReader.dialect.getExternalRules(node);\n\t\t\t\tif (external != null) {\n\t\t\t\t\textractExternalRules(external);\n\t\t\t\t}\n\t\t\t} else if (node.getNodeName().equals(\"script\")) {\n\t\t\t\t// we have embedded\n\t\t\t\tif (node.hasAttributes()) {\n\t\t\t\t\tif (node.getAttributes().getNamedItem(\"type\").getNodeValue().equals(\"application/its+xml\")) {\n\t\t\t\t\t\textractEmbeddedRules(node.getTextContent());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!nodeState.nodePath.contains(\"its:rules\")) {\n\t\t\t\t// unless we're in rules, look at local annotations\n\t\t\t\t// LOCAL\n\t\t\t\textractLocal(nodeState);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// process inheritance\n\t\tfor (ITSState nodeState : doc.iterNodes()) {\n\t\t\t// Elements: handle inheritance \n\t\t\tITSData parentData = getParentState(nodeState);\n\t\t\tif (parentData != null) {\n\t\t\t\t// inherit from parent\n\t\t\t\tITSData thisData = nodeItsData.get(nodeState.nodePath);\n\t\t\t\tif (thisData == null) {\n\t\t\t\t\tthisData = new ITSData();\n\t\t\t\t\tapplyRuleToNode(nodeState.nodePath, thisData);\n\t\t\t\t} \n\t\t\t\tthisData.inherit(parentData);\t\t\t\t\n\t\t\t}\t\n\t\t\t\t\t\t\n\t\t} \n\t\t\n\t\t\n\t}", "private void convertTextBoxes(XWPFParagraph paragraph) {\n XmlCursor cursor = paragraph.getCTP().newCursor();\n cursor.selectPath(\"declare namespace w='http://schemas.openxmlformats.org/wordprocessingml/2006/main' .//*/w:txbxContent/w:p/w:r\");\n\n List<XmlObject> ctrsintxtbx = new ArrayList<>();\n\n while (cursor.hasNextSelection()) {\n cursor.toNextSelection();\n XmlObject obj = cursor.getObject();\n ctrsintxtbx.add(obj);\n }\n for (XmlObject xmlObject : ctrsintxtbx) {\n CTR ctr = null;\n try {\n ctr = CTR.Factory.parse(xmlObject.toString());\n XWPFRun textBoxRun = new XWPFRun(ctr, paragraph);\n// textBoxRun.getText(0);\n String fontFamily = getFontFamily(textBoxRun);\n String[] convertedText = engine.toUnicode(textBoxRun.getText(0), fontFamily);\n String sConvertedText = convertedText[0];\n textBoxRun.setText(sConvertedText, 0);\n// System.out.println(sConvertedText);\n logger.info(\"Text of textbox : \" + textBoxRun.getText(0));\n this.setFontFamily(textBoxRun, convertedText[1]);\n\n xmlObject.set(textBoxRun.getCTR());\n } catch (XmlException e) {\n e.printStackTrace();\n }\n\n }\n }", "public static String createValidContent(final String string) {\n\t\treturn Strings.replace(string, XML_ENTITY_CHARS, XML_ENTITY_REPLACMENTS); //do the replacements for the special XML symbols and return the results\n\t}", "public static void main(String[] args) throws ParseException {\n String text;\n\n File file;\n\n /* pdfStripper = null;\n pdDoc = null;\n cosDoc = null;\n */ String parsed = parseWithTika();\n file = new File(filePath);\n try {\n /* parser = new PDFParser(new FileInputStream(file)); // update for PDFBox V 2.0\n parser.parse();\n cosDoc = parser.getDocument();\n pdfStripper = new PDFTextStripper();\n pdDoc = new PDDocument(cosDoc);\n pdDoc.getNumberOfPages();\n */ //pdfStripper.setStartPage(1);\n //pdfStripper.setEndPage(10);\n /* text = pdfStripper.getText(pdDoc);\n String resultString = text.replaceAll(\"\\\\p{C}|\\\\p{Sm}|\\\\p{Sk}|\\\\p{So}\", \" \");\n */\n\n //testDictionary();\n testOpenNlp(parsed);\n testOpenNlp(\"anas al bassit\");\n testOpenNlp(\"Anas Al Bassit\");\n testOpenNlp(\"barack obama\");\n testOpenNlp(\"Barack Obama\");\n\n\n System.out.println();\n } catch (IOException e) {\n e.printStackTrace();\n }\n// catch (ParseException e) {\n// e.printStackTrace();\n// }\n }", "private static String pipelinePOS_NER(String text, boolean debugMode) {\n\t\tif (debugMode) System.out.println(\"Starting coreNLP analysis\");\n\n\t\t//POS & NER extraction, Stanford CoreNLP\n\t\tString NePosText = CoreNLPHandler.getXMLwithNERandPOS(text);\n\n\t\treturn NePosText;\n\t}", "public void transform() {\n String delimiter = \" \";\n\n System.out.println(\"Using pathname \" + this.inputPath_ + \"\\n\");\n\n //create string to hold the entire input file\n String input = \"\";\n try { //use a scanner to get the contents of the file into a string\n Scanner inputScanner = new Scanner(new File(this.inputPath_));\n //use a delimiter that only matches the end of the file; this will give us the whole file\n input = inputScanner.useDelimiter(\"\\\\Z\").next();\n inputScanner.close();\n } catch (Exception e) {\n System.err.println(\"Couldn't read \" + this.inputPath_);\n System.exit(-100);\n }\n //if we are here, then there wasn't an exception\n\n //make sure not empty file\n if(input.isEmpty()) {\n System.err.print(\"Error: Empty file.\");\n System.exit(-200);\n }\n\n //create an array for the line strings\n ArrayList<String> inputLines = new ArrayList<>();\n\n //next, separate the input string into multiple strings, one for each line\n //delimiter string regex - only match line terminators\n String lineDelim = \"(\\n|\\r|\\r\\n|\\u0085|\\u2028|\\u2029)\";\n StringTokenizer inputLineTokenizer = new StringTokenizer(input, lineDelim); //create a string tokenizer\n\n //count number of lines\n int numberOfLines = inputLineTokenizer.countTokens();\n\n //add the lines to the array\n for(int i = 0; i < numberOfLines; i++) inputLines.add(inputLineTokenizer.nextToken(lineDelim));\n\n\n //split line into words\n\n //create arraylist of strings\n ArrayList<ArrayList<String>> lines = new ArrayList<>();\n\n for(int i = 0; i < inputLines.size(); i++) {\n //printout(\"Read line: \" + inputLines.get(i) + \"\\n\");\n\n //create a tokenizer and count number of tokens\n StringTokenizer tokenizer = new StringTokenizer(inputLines.get(i), delimiter);\n int numWords = tokenizer.countTokens();\n\n //create array of strings\n ArrayList<String> currentLine = new ArrayList<>();\n\n for(int j = 0; j < numWords; j++) { //add a word if it is valid\n String currentWord = cleanUpText(tokenizer.nextToken(delimiter));\n if(!currentWord.isEmpty()) currentLine.add(currentWord);\n }\n\n //add the current line to the list of typed lines if it had any valid words\n if(currentLine.size() > 0) lines.add(currentLine);\n }\n\n if(lines.size() <= 0) {\n System.err.println(\"ERROR! File did not contain a line with any valid words. Please try again with a different inpput file.\");\n System.exit(-444);\n } else {\n //send lines from array to pipe\n for(int i = 0; i < lines.size(); i++) {\n this.output_.put(lines.get(i));\n }\n\n\n\n //send a null terminator?\n //this causes the other filter to give an exception\n //the exception is caught by the other filter, which breaks the loop it uses to get new lines\n this.output_.put(null);\n //printout(\"Done with file input.\\n\");\n //stop the filter\n this.stop();\n }\n\n\n }", "public void method1() {\n String s = \"\\uFE64\" + \"script\" + \"\\uFE65\";\n // Validate\n Pattern pattern = Pattern.compile(\"[<>]\"); // Check for angle brackets\n Matcher matcher = pattern.matcher(s);\n if (matcher.find()) {\n // Found black listed tag\n throw new IllegalStateException();\n } else {\n // ...\n }\n // Normalize\n s = Normalizer.normalize(s, Form.NFKC);\n }", "public abstract void interpret(EvaluationContext context);", "public synchronized void process() \n\t{\n\t\t// for each word in a line, tally-up its frequency.\n\t\t// do sentence-segmentation first.\n\t\tCopyOnWriteArrayList<String> result = textProcessor.sentenceSegmementation(content.get());\n\t\t\n\t\t// then do tokenize each word and count the terms.\n\t\ttextProcessor.tokenizeAndCount(result);\n\t}", "public void computeParagraph(){\r\n\r\n\t\tstrBuff = new StringBuffer();\r\n\r\n\t\t//For else for ER2 rule of inserting the first letter of my last name twice before each consonant\r\n\t\tfor(int i = 0; i < paragraph.length(); i++){\r\n\r\n\t\t\tif(paragraph.charAt(i) == 'a' || paragraph.charAt(i) == 'e' || paragraph.charAt(i) == 'i'\r\n\t\t\t\t|| paragraph.charAt(i) == 'o' || paragraph.charAt(i) == 'u' || paragraph.charAt(i) == 'A'\r\n\t\t\t\t|| paragraph.charAt(i) == 'E' || paragraph.charAt(i) == 'I' || paragraph.charAt(i) == 'O'\r\n\t\t\t\t|| paragraph.charAt(i) == 'U' || paragraph.charAt(i) == ' ' || paragraph.charAt(i) == '.'\r\n\t\t\t\t|| paragraph.charAt(i) == '!' || paragraph.charAt(i) == '?'){\r\n\t\t\t\tstrBuff.append(paragraph.charAt(i));\r\n\t\t\t}\r\n\r\n\t\t\telse{\r\n\t\t\t\tstrBuff.append(\"OO\");\r\n\t\t\t\tstrBuff.append(paragraph.charAt(i));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tnewParagraph = strBuff.toString();\r\n\r\n\t\tcount = 0;\r\n\r\n\t\t//For for ER2 rule of counting the number of characters in the initial text excluding the number of vowels\r\n\t\tfor(int i = 0; i < paragraph.length(); i++){\r\n\t\t\tif(paragraph.charAt(i) != 'a' && paragraph.charAt(i) != 'e' && paragraph.charAt(i) != 'i'\r\n\t\t\t\t&& paragraph.charAt(i) != 'o' && paragraph.charAt(i) != 'u' && paragraph.charAt(i) != 'A'\r\n\t\t\t\t&& paragraph.charAt(i) != 'E' && paragraph.charAt(i) != 'I' && paragraph.charAt(i) != 'O'\r\n\t\t\t\t&& paragraph.charAt(i) != 'U'){\r\n\t\t\t\t\tcount++;\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t}", "@Test\n public void main() throws IOException {\n currentArticle = null;\n\n for(String line: FileUtils.readLines(new File(\"D:\\\\projects\\\\вёрстка томов ИИ\\\\9 том\\\\термины.txt\"))) {\n\n Matcher matcher = compile(\"\\\\|([^\\\\|]+)\\\\|\\\\s[–\\\\-—]\\\\s(.+)\").matcher(line);\n if (matcher.find()) {\n if (currentArticle != null) {\n saveItem();\n currentArticle = null;\n }\n String term = matcher.group(1);\n String body = matcher.group(2);\n if(body.indexOf(\"см. \") != 0) {\n currentArticle = new Article(term, body);\n } /*else {\n String alias = body.replace(\"см. \", \"\").replace(\"«\", \"\").replace(\"»\", \"\").replace(\".\", \"\");\n saveAliases(alias, term);\n }*/\n } else if (currentArticle != null) {\n currentArticle.setContent(currentArticle.getContent() + \"<br/>\"+line);\n }\n }\n if (currentArticle != null) {\n saveItem();\n }\n }", "@SuppressWarnings(\"static-access\")\n\tpublic void detection(Request text) {\n\t\t//Fichiertxt fichier;\n\t\ttry {\t\t\t\t\t\n\t\t\t//enregistrement et affichage de la langue dans une variable lang\n\t\t\ttext.setLang(identifyLanguage(text.getCorpText()));\n\t\t\t//Ajoute le fichier traité dans la Base\n\t\t\tajouterTexte(text);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"fichier texte non trouvé\");\n\t e.printStackTrace();\n\t\t}\n\t}", "public interface OCR\r\n{\r\n /*\r\n * Method: extractKeywordsAbstract\r\n * Input: String of first PDF page text\r\n * Output: boolean\r\n * Algorithm: The method will take in this string, extract the keywords and abstract\r\n * if they exist, enter them in the DB, and return a boolean explaining if it worked\r\n */\r\n public boolean extractKeywordsAbstract (String firstPage, int paperID);\r\n}", "public void addText(IText text) {\n var name = \"Text\"; // TODO should texts have a name? E.g. the filename etc.?\n var textIndividual = ontologyConnector.addIndividualToClass(name, textClass);\n var uuid = ontologyConnector.getLocalName(textIndividual);\n ontologyConnector.addPropertyToIndividual(textIndividual, uuidProperty, uuid);\n\n ImmutableList<IWord> words = text.getWords();\n\n // first add all word individuals\n var wordIndividuals = new ArrayList<Individual>();\n var wordsToIndividuals = new HashMap<IWord, Individual>();\n for (var word : words) {\n var wordIndividual = addWord(word);\n wordIndividuals.add(wordIndividual);\n wordsToIndividuals.put(word, wordIndividual);\n }\n\n // add dependencies to words.\n // We only add outgoing dependencies as ingoing are the same (but viewed from another perspective)\n for (var word : words) {\n var wordIndividual = wordsToIndividuals.get(word);\n for (var dependencyType : DependencyTag.values()) {\n var outDependencies = word.getWordsThatAreDependencyOfThis(dependencyType);\n for (var outDep : outDependencies) {\n var outWordIndividual = wordsToIndividuals.get(outDep);\n addDependencyBetweenWords(wordIndividual, dependencyType, outWordIndividual);\n }\n }\n }\n\n // create the list that is used for the words property\n var olo = ontologyConnector.addList(\"WordsOf\" + name, wordIndividuals);\n var listIndividual = olo.getListIndividual();\n ontologyConnector.addPropertyToIndividual(textIndividual, wordsProperty, listIndividual);\n\n // add coref stuff\n var corefClusters = text.getCorefClusters();\n for (var corefCluster : corefClusters) {\n var representativeMention = corefCluster.getRepresentativeMention();\n var corefClusterIndividual = ontologyConnector.addIndividualToClass(representativeMention, corefClusterClass);\n ontologyConnector.addPropertyToIndividual(corefClusterIndividual, uuidProperty, \"\" + corefCluster.getId());\n ontologyConnector.addPropertyToIndividual(corefClusterIndividual, representativeMentionProperty, representativeMention);\n ontologyConnector.addPropertyToIndividual(textIndividual, hasCorefClusterProperty, corefClusterIndividual);\n\n var counter = 0;\n for (var mention : corefCluster.getMentions()) {\n var id = corefCluster.getId() + \"_\" + counter;\n counter += 1;\n var label = ICorefCluster.getTextForMention(mention);\n\n var mentionIndividual = ontologyConnector.addIndividualToClass(label, corefMentionClass);\n ontologyConnector.addPropertyToIndividual(mentionIndividual, uuidProperty, id);\n ontologyConnector.addPropertyToIndividual(corefClusterIndividual, mentionProperty, mentionIndividual);\n\n var mentionWordsIndividuals = getMentionWordIndividuals(mention, wordsToIndividuals);\n var mentionOlo = ontologyConnector.addList(\"WordsOf Mention \" + id, mentionWordsIndividuals);\n ontologyConnector.addPropertyToIndividual(mentionIndividual, wordsProperty, mentionOlo.getListIndividual());\n }\n }\n\n }", "public String[] prepareText(String text) {\n\n Properties props = new Properties();\n\n props.put(\"annotators\", \"tokenize, ssplit, pos, lemma, ner\");\n StanfordCoreNLP pipeline = new StanfordCoreNLP(props);\n\n //apply\n Annotation document = new Annotation(text);\n pipeline.annotate(document);\n\n List<CoreMap> sentences = document.get(CoreAnnotations.SentencesAnnotation.class);\n\n ArrayList<String> result = new ArrayList<>();\n\n for (CoreMap sentence : sentences) {\n\n for (CoreLabel token : sentence.get(CoreAnnotations.TokensAnnotation.class)) {\n // this is the text of the token\n String word = token.get(CoreAnnotations.LemmaAnnotation.class);\n // this is the POS tag of the token\n String pos = token.get(PartOfSpeechAnnotation.class);\n // this is the NER label of the token\n String ne = token.get(CoreAnnotations.NamedEntityTagAnnotation.class);\n\n if (!StringUtils.isStopWord(word)) {\n result.add(word);\n }\n\n }\n\n }\n String[] result_ar = new String[result.size()];\n\n return result.toArray(result_ar);\n }", "void computeHTMLFeatures() throws Exception{\n\t\tcountTagStatistics();\n\t\thtmlGlobalTagStatistics();\n\t\ttagInHeadStatistics();\n\t\thtmlStatisticsDiv();\n\t\thtmlStaticsticsParagraphs();\n\t\thtmlKeyWords();\n\t\tnormalizeData();\n\t}", "@Test\n\tpublic void testStoreProcessText4() {\n\t\tint sourceID = dm.storeProcessedText(pt2);\n\t\tassertTrue(sourceID > 0);\n\t\t\n\t\tds.startSession();\n\t\tSource source = ds.getSource(pt2.getMetadata().getUrl());\n\t\tList<Paragraph> paragraphs = (List<Paragraph>) ds.getParagraphs(source.getSourceID());\n\t\tassertTrue(pt2.getMetadata().getName().equals(source.getName()));\n\t\tassertTrue(pt2.getParagraphs().size() == paragraphs.size());\n\t\t\n\t\tfor(int i = 0; i < pt2.getParagraphs().size(); i++){\n\t\t\tParagraph p = paragraphs.get(i);\n\t\t\tParagraph originalP = pt2.getParagraphs().get(i);\n\t\t\tassertTrue(originalP.getParentOrder() == p.getParentOrder());\n\t\t\t\n\t\t\tList<Sentence> sentences = (List<Sentence>) ds.getSentences(p.getId());\n\t\t\tassertTrue(sentences.size() == 0);\n\t\t}\n\t\tds.closeSession();\t\t\n\t}", "public interface Text {\n\n String HELP = \"Sage 'Alexa, weiter', um die nächste Anweisung zu erhalten. \";\n String STOP = \"Lasst euch weiterhin feiern! \";\n String FALLBACK = \"Leider konnte der Herr dich nicht verstehen \";\n\n String PICOLO_START = \"Willkommen bei Picolo! Möchtest du ein neues Spiel starten? \";\n String[] ANZAHL_SPIELER = {\n \"Wie viele Spieler spielen mit?\",\n \"Nenne mir die Anzahl der teilnehmenden Spieler\",\n \"Wie viele Spieler gibt es heute?\"\n };\n String[] SPIELER_NAME_FRAGEN = {\n \"Nenne mir deinen Namen Spieler \",\n \"Bitte sage mir deinen Namen Spieler \",\n \"Sag mir bitte deinen Namen Spieler \"\n };\n String NAECHSTE_AUFGABE = \"Wollt ihr die nächste Aufgabe Wissen? \";\n String ERSTE_ANWEISUNG = \"Alles klar, Los geht´s! \";\n String WIEDERHOLEN_FEHLER = \"Das Spiel wurde noch nicht gestartet. Deswegen kann ich nichts wiederholen. Bitte starte vorher das Spiel. \";\n\n //SSML Aussprache\n\n /**TODO\n * SSML Text bearbeiten\n */\n String HELP_SSML = \"Sage 'Alexa, weiter', um die nächste Anweisung zu erhalten. \";\n String STOP_SSML = \"Lasst euch weiterhin feiern! \";\n String FALLBACK_SSML = \"Ich habe dich leider nicht verstanden. \";\n}", "public Map<String, Object> getIE(String text, FallBackListBased pd) {\n\t\ttext = text.replaceAll(\" � \", \", \");\n\t\ttext = text.replaceAll(\"'s \", \" \");\n\t\ttext = text.replaceAll(\"'s\", \"\");\n\t\ttext = text.replaceAll(\"�s \", \" \");\n\t\ttext = text.replaceAll(\"�s \", \" \");\n\t\ttext = text.replaceAll(\"\\\\?\", \"\");\n\t\ttext = text.replaceAll(\":\", \"\");\n\t\tMap<String, Object> entities_map = new TreeMap<String, Object>();\n\t\tMap<String, Object> extractedEntities = new TreeMap<String, Object>();\n\t\tList<TreeMap<String, String>> entities = new ArrayList<TreeMap<String, String>>();\n\t\tList<TreeMap<String, String>> intents= new ArrayList<TreeMap<String, String>>();\n\t\tSet<String> intentsList=new HashSet<String>();\n\t\tSet<String> entitiesList=new HashSet<String>();\n\t\t\n\t\tString input = text;\n\t\t// text=text.replaceAll(\" \", \" \");\n\t\tSpan spanSentences[] = pd.sentenceDetector.sentPosDetect(input);\n\t\tint sentenceId = 1;\n\t\tTreeMap<String, String> intents_map = new TreeMap<String, String>();\n\t\tDouble entites_highest_cofidence = 0.0;\n\t\tDouble intents_highest_cofidence = 0.0;\n\t\tfor (Span sentence : spanSentences) {\n\t\t\tArrayList<PhraseTemplate> phrases = pd.GetPhrases(sentence\n\t\t\t\t\t.getCoveredText(input).toString(), sentenceId++);\n\t\t\t\n\t\t\tfor (PhraseTemplate svo : phrases) {\n\t\t\t\tString key = svo.phrase;\n\t\t\t\tkey = key.replaceAll(\" is \", \"\");\n\t\t\t\tkey = key.replaceAll(\"What \", \"\");\n\t\t\t\tkey = key.replaceAll(\"what \", \"\");\n\t\t\t\tkey = key.replaceAll(\" the \", \"\");\n\n\t\t\t\tif (key.length() > 1) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tString resolvedEntity = lss.resolveEntity(key\n\t\t\t\t\t\t\t\t.toLowerCase().trim().toString(),\n\t\t\t\t\t\t\t\t\"entitesIndex\");\n\t\t\t\t\t\tString tokens[] = resolvedEntity.split(\"__\");\n//\t\t\t\t\t\tSystem.out.println(resolvedEntity+\" :: \"+key);\n\t\t\t\t\t\tif (tokens.length < 2)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tif (tokens[1].trim().startsWith(\"entity\")\n\t\t\t\t\t\t\t\t&& Double.parseDouble(tokens[5].trim())>0.9)\n\t\t\t\t\t\t\tentitiesList.add(tokens[5].trim());\n\t\t\t\t\t\tif (tokens[1].trim().startsWith(\"entity\")\n\t\t\t\t\t\t\t\t&& Double.parseDouble(tokens[5].trim()) > entites_highest_cofidence) {\n\t\t\t\t\t\t\tentities_map.clear();\n\t\t\t\t\t\t\tentities_map.put(\"Entity\", key.trim());\n\t\t\t\t\t\t\tentities_map.put(\"MappedEntity\", tokens[4].trim());\n\t\t\t\t\t\t\tentities_map.put(\"EntityConfidenceScore\", tokens[5].trim());\n\t\t\t\t\t\t\tentities_map.put(\"MappedEntityType\", tokens[2].trim());\n\t\t\t\t\t\t\tentites_highest_cofidence = Double\n\t\t\t\t\t\t\t\t\t.parseDouble(tokens[5].trim());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tokens[1].trim().startsWith(\"intent\")\n\t\t\t\t\t\t\t\t&& Double.parseDouble(tokens[5].trim())>0.9)\n\t\t\t\t\t\t\tintentsList.add(tokens[5].trim());\n\t\t\t\t\t\tif (tokens[1].trim().startsWith(\"intent\")\n\t\t\t\t\t\t\t\t&& Double.parseDouble(tokens[5].trim()) > intents_highest_cofidence) {\n\t\t\t\t\t\t\tintents_map.clear();\n\t\t\t\t\t\t\tintents_map.put(\"Id\", tokens[0].trim());\n\t\t\t\t\t\t\tintents_map.put(\"Extracted Entity\", key.trim());\n\t\t\t\t\t\t\tintents_map.put(\"Mapped Entity\", tokens[4].trim());\n\t\t\t\t\t\t\tintents_map.put(\"Confidence\", tokens[5].trim());\n\t\t\t\t\t\t\tintents_map.put(\"Class\", tokens[1].trim());\n\t\t\t\t\t\t\tintents_highest_cofidence = Double\n\t\t\t\t\t\t\t\t\t.parseDouble(tokens[5].trim());\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tentities_map.put(\"Intent\", intents_map.get(\"Extracted Entity\"));\n\t\tentities_map.put(\"MappedIntent\", intents_map.get(\"Mapped Entity\"));\n\t\tentities_map.put(\"IntentConfidenceScore\", intents_map.get(\"Confidence\"));\n\n\t\treturn entities_map;\n\t}", "public boolean setRawText(String text) {\n\t\ttry {\n\t\t\ttext = text.replace(\" \", \"\");\n\t\t\tString[] line = text.split(\"\\n\");\n\n\t\t\tif (line.length != 2) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tline[0] = replaceWithChars(line[0]);\n\t\t\tline[0] = line[0].substring(5);\n\n\t\t\tString[] names = line[0].split(\"<\");\n\n\t\t\tthis.nume = names[0];\n\n\t\t\tthis.prenume = \"\";\n\t\t\tfor (int i=1; i<names.length; i++) {\n\t\t\t\tif (names[i] != null && ! names[i].equals(\"\")) {\n\t\t\t\t\tthis.prenume += names[i] + \" \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t//\n\t\t\t// Start processing second line. \n\t\t\t//\n\t\t\tnames = line[1].split(\"<\");\n\n\t\t\tif (names.length != 2) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tthis.seria = \"\" + names[0].charAt(0); \n\t\t\tif (names[0].charAt(1) == '0') {\n\t\t\t\tthis.seria += \"D\";\n\t\t\t} else {\n\t\t\t\tthis.seria += names[0].charAt(1);\n\t\t\t}\n\n\t\t\tthis.numarul = replaceWithNumbers( names[0].substring(2) );\n\t\t\tthis.cetatenia = replaceWithNumbers( names[1].substring(0,4) ) ;\n\t\t\tthis.dataNasteri = replaceWithNumbers( names[1].substring(4,10) ) ;\n\t\t\tthis.sex = names[1].charAt(11);\n\t\t\tif (sex == 'H') {\n\t\t\t\tsex = 'M';\n\t\t\t}\n\t\t\t\n\t\t\tthis.valabilitate = replaceWithNumbers(names[1].substring(12,18));\n\n\t\t\tthis.CNP = sex == 'F'?\"2\" : \"1\";\n\t\t\tthis.CNP += this.dataNasteri + replaceWithNumbers( names[1].substring(20,26));\n\t\t\t\n\t\t\tthis.validate();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public Expression preEvaluate(ExpressionVisitor visitor) {\n return this;\n // in principle we could pre-evaluate any call of unparsed-text() with\n // constant arguments. But we don't, because the file contents might\n // change before the stylesheet executes.\n }", "public void sendQuestion() {\n/* 55 */ StringBuilder buf = new StringBuilder();\n/* 56 */ buf.append(getBmlHeader());\n/* */ \n/* 58 */ buf.append(\"label{text=\\\"\\\"}\");\n/* 59 */ buf.append(\"label{type=\\\"bold\\\";text=\\\"General\\\"}\");\n/* 60 */ buf.append(\"label{text=\\\" * I've keep some of the ways that HFC was used for skill increases. But no junk food, \\\"}\");\n/* 61 */ buf.append(\"label{text=\\\" e.g. nails are not used as an ingredient and if present in a container, they will stop the \\\"}\");\n/* 62 */ buf.append(\"label{text=\\\" food item being made.\\\"}\");\n/* 63 */ buf.append(\"label{text=\\\" * Meats now have a material, e.g. Meat, Dragon and Meat, Game\\\"}\");\n/* 64 */ buf.append(\"label{text=\\\" o As you can see it does not use the animal type, but a category as we have so \\\"}\");\n/* 65 */ buf.append(\"label{text=\\\" many animal types. Some of the categories are: (there are 16 total)\\\"}\");\n/* 66 */ buf.append(\"label{text=\\\" . Dragon\\\"}\");\n/* 67 */ buf.append(\"label{text=\\\" . Game\\\"}\");\n/* 68 */ buf.append(\"label{text=\\\" . Human\\\"}\");\n/* 69 */ buf.append(\"label{text=\\\" . Humanoid\\\"}\");\n/* 70 */ buf.append(\"label{text=\\\" . Snake\\\"}\");\n/* 71 */ buf.append(\"label{text=\\\" * Meat and fillets can now be put in FSB and Crates.\\\"}\");\n/* 72 */ buf.append(\"label{text=\\\" * Fish and fish fillets can now be put in FSB and Crates.\\\"}\");\n/* 73 */ buf.append(\"label{text=\\\" * Existing Zombified milk will lose its zombie status. New zombie milk should be fine.\\\"}\");\n/* 74 */ buf.append(\"label{text=\\\" * You will be able to seal some containers so long as they only have one liquid in them, \\\"}\");\n/* 75 */ buf.append(\"label{text=\\\" this will stop their decay.\\\"}\");\n/* 76 */ buf.append(\"label{text=\\\" o Small and Large Amphoria.\\\"}\");\n/* 77 */ buf.append(\"label{text=\\\" o Pottery Jar.\\\"}\");\n/* 78 */ buf.append(\"label{text=\\\" o Pottery Flask.\\\"}\");\n/* 79 */ buf.append(\"label{text=\\\" o Water Skin.\\\"}\");\n/* 80 */ buf.append(\"label{text=\\\" o Small Barrel.\\\"}\");\n/* 81 */ buf.append(\"harray{label{text=\\\" * \\\"};label{type=\\\"bold\\\";text=\\\"Bees\\\"};label{text=\\\" have been added.\\\"}}\");\n/* */ \n/* */ \n/* 84 */ buf.append(\"harray{label{text=\\\" * Cooking will now be from \\\"};label{type=\\\"bold\\\";text=\\\"recipes\\\"};label{text=\\\", this does not mean that you cannot continue \\\"}}\");\n/* */ \n/* */ \n/* 87 */ buf.append(\"label{text=\\\" cooking like you used to though, although some recipes will have changed.\\\"}\");\n/* 88 */ buf.append(\"harray{label{text=\\\" * A personal \\\"};label{type=\\\"bold\\\";text=\\\"cookbook\\\"};label{text=\\\" is now available which has the recipes that you know about in.\\\"}}\");\n/* */ \n/* */ \n/* 91 */ buf.append(\"label{text=\\\" * Hens eggs can now be found when foraging on grass tiles. And you will be able to put\\\"}\");\n/* 92 */ buf.append(\"label{text=\\\" in FSB, but that makes them infertile.\\\"}\");\n/* 93 */ buf.append(\"label{text=\\\" * Old containers and tools - now with more use.\\\"}\");\n/* 94 */ buf.append(\"label{text=\\\" o Sauce pan - had to change size of this, but that means some recipes need a \\\"}\");\n/* 95 */ buf.append(\"label{text=\\\" new one which is larger.\\\"}\");\n/* 96 */ buf.append(\"label{text=\\\" o Pottery bowl - can now be used to hold liquids as well, a lot of recipes use this.\\\"}\");\n/* 97 */ buf.append(\"label{text=\\\" o Hand - used to make some mixes, and other things. Note if a recipe says a \\\"}\");\n/* 98 */ buf.append(\"label{text=\\\" hand must be used, actually any active item will work.\\\"}\");\n/* 99 */ buf.append(\"label{text=\\\" o Fork - how else were you going to mix some stuff!\\\"}\");\n/* 100 */ buf.append(\"label{text=\\\" o Knife - used a lot in food preparation.\\\"}\");\n/* 101 */ buf.append(\"label{text=\\\" o Spoon - An alternative way to mix things (so same ingredients can be used in \\\"}\");\n/* 102 */ buf.append(\"label{text=\\\" multiple recipes. Also can be used to scoop.\\\"}\");\n/* 103 */ buf.append(\"label{text=\\\" o Press - can be used to squash something.\\\"}\");\n/* 104 */ buf.append(\"label{text=\\\" o Branch - branching out, could be used as a spit ...\\\"}\");\n/* 105 */ buf.append(\"label{text=\\\" * New containers and tools\\\"}\");\n/* 106 */ buf.append(\"label{text=\\\" o Stoneware. - used to make things like breads, biscuits etc\\\"}\");\n/* 107 */ buf.append(\"label{text=\\\" o Cake tin - used to make cakes\\\"}\");\n/* 108 */ buf.append(\"label{text=\\\" o Pie dish - used to make pies and tarts\\\"}\");\n/* 109 */ buf.append(\"label{text=\\\" o Roasting dish - used to roast food.\\\"}\");\n/* 110 */ buf.append(\"label{text=\\\" o Plate - used to make salads and sandwiches on.\\\"}\");\n/* 111 */ buf.append(\"label{text=\\\" o Mortar+Pestle - used to grind small things (e.g. spices)\\\"}\");\n/* 112 */ buf.append(\"label{text=\\\" o Measuring Jug - used to get a specific amount of liquid, its volume can be \\\"}\");\n/* 113 */ buf.append(\"label{text=\\\" adjusted (volume is same as weight for this).\\\"}\");\n/* 114 */ buf.append(\"label{text=\\\" o Still - used for distilling.\\\"}\");\n/* 115 */ buf.append(\"label{text=\\\" * New crops\\\"}\");\n/* 116 */ buf.append(\"label{text=\\\" o Carrots\\\"}\");\n/* 117 */ buf.append(\"label{text=\\\" o Cabbage\\\"}\");\n/* 118 */ buf.append(\"label{text=\\\" o Tomatos\\\"}\");\n/* 119 */ buf.append(\"label{text=\\\" o Sugar Beet\\\"}\");\n/* 120 */ buf.append(\"label{text=\\\" o Lettuce\\\"}\");\n/* 121 */ buf.append(\"label{text=\\\" o Peas\\\"}\");\n/* 122 */ buf.append(\"label{text=\\\" o Cucumbers\\\"}\");\n/* 123 */ buf.append(\"label{text=\\\" * New Bush\\\"}\");\n/* 124 */ buf.append(\"label{text=\\\" o Hazelnut bush - now you know where the hazelnuts come from.\\\"}\");\n/* 125 */ buf.append(\"label{text=\\\" * New Tree\\\"}\");\n/* 126 */ buf.append(\"label{text=\\\" o Orange tree - because it seemed like a good idea.\\\"}\");\n/* 127 */ buf.append(\"harray{label{text=\\\" * Spices - all can be planted in a \\\"};label{type=\\\"bold\\\";text=\\\"planter\\\"}label{text=\\\", except Nutmeg.\\\"}}\");\n/* */ \n/* */ \n/* 130 */ buf.append(\"label{text=\\\" o Cumin\\\"}\");\n/* 131 */ buf.append(\"label{text=\\\" o Ginger\\\"}\");\n/* 132 */ buf.append(\"label{text=\\\" o Paprika\\\"}\");\n/* 133 */ buf.append(\"label{text=\\\" o Turmeric\\\"}\");\n/* 134 */ buf.append(\"harray{label{text=\\\" * New Herbs - all Herbs can be planted in a \\\"};label{type=\\\"bold\\\";text=\\\"planter\\\"};}\");\n/* */ \n/* 136 */ buf.append(\"label{text=\\\" o Fennel\\\"}\");\n/* 137 */ buf.append(\"label{text=\\\" o Mint\\\"}\");\n/* 138 */ buf.append(\"label{text=\\\" * New items that are only found by forage / botanize. Note all above spices and herbs \\\"}\");\n/* 139 */ buf.append(\"label{text=\\\" and the new vegs can be found this way as well)\\\"}\");\n/* 140 */ buf.append(\"label{text=\\\" o Cocoa bean\\\"}\");\n/* 141 */ buf.append(\"label{text=\\\" o Nutmeg (note this is a spice but cannot be planted in a planter)\\\"}\");\n/* 142 */ buf.append(\"label{text=\\\" o Raspberries\\\"}\");\n/* 143 */ buf.append(\"label{text=\\\" o Hazelnut sprout.\\\"}\");\n/* 144 */ buf.append(\"label{text=\\\" o Orange sprout.\\\"}\");\n/* 145 */ buf.append(\"label{text=\\\" * Rocksalt\\\"}\");\n/* 146 */ buf.append(\"label{text=\\\" o Rock tiles that would of produced salt when mining will now be shown as \\\"}\");\n/* 147 */ buf.append(\"label{text=\\\" Rocksalt veins (this may take a day or two to show), but have a limited life (e.g. \\\"}\");\n/* 148 */ buf.append(\"label{text=\\\" you get 45-50 rocksalt from one).\\\"}\");\n/* 149 */ buf.append(\"label{text=\\\" o The Rocksalt can then be ground into salt using a grindstone. You can get\\\"}\");\n/* 150 */ buf.append(\"label{text=\\\" more than one salt from each Rocksalt bepending on your milling skill.\\\"}\");\n/* 151 */ buf.append(\"label{text=\\\" o Veins that had salt in, will be unaffected, e.g.you will still be able to get the \\\"}\");\n/* 152 */ buf.append(\"label{text=\\\" random salt when mining them.\\\"}\");\n/* 153 */ buf.append(\"label{text=\\\" * Trellis\\\"}\");\n/* 154 */ buf.append(\"label{text=\\\" o A new trellis has been added for hops.\\\"}\");\n/* 155 */ buf.append(\"label{text=\\\" o Trellis can now be harvested when their produce is in season (except ivy ones \\\"}\");\n/* 156 */ buf.append(\"label{text=\\\" don't have a season).\\\"}\");\n/* 157 */ buf.append(\"label{text=\\\" o To help plant your trellis in nice straight lines, you can plant them using a wall, \\\"}\");\n/* 158 */ buf.append(\"label{text=\\\" fence or tile border. And have three options, on left, center and on right.\\\"}\");\n/* 159 */ buf.append(\"label{text=\\\" o There is a limit of 4 planted trellis per tile. Any extras that are currently planted \\\"}\");\n/* 160 */ buf.append(\"label{text=\\\" on same tile will become unplanted.\\\"}\");\n/* 161 */ buf.append(\"label{text=\\\" * Flowers\\\"}\");\n/* 162 */ buf.append(\"label{text=\\\" o Flowers can now be used in some recipes, and therefore will now only go into \\\"}\");\n/* 163 */ buf.append(\"label{text=\\\" a food storage bin. This also applies to rose petals, oleander, lavender and \\\"}\");\n/* 164 */ buf.append(\"label{text=\\\" camellia.\\\"}\");\n/* 165 */ buf.append(\"label{text=\\\" o Any existing flowers in bulk storage bins are fine, you can still take them out,\\\"}\");\n/* 166 */ buf.append(\"label{text=\\\" but will not be able to put them back into the bulk storage bin, but they will go \\\"}\");\n/* 167 */ buf.append(\"label{text=\\\" into the food storage bin.\\\"}\");\n/* 168 */ buf.append(\"label{text=\\\" * The goodness of food\\\"}\");\n/* 169 */ buf.append(\"label{text=\\\" o Each meal made will have a bonus attached to it, so the same ingredients \\\"}\");\n/* 170 */ buf.append(\"label{text=\\\" making the same meal (in same cooker and same container) will end up with \\\"}\");\n/* 171 */ buf.append(\"label{text=\\\" this same bonus.\\\"}\");\n/* 172 */ buf.append(\"label{text=\\\" . This bonus will give a timed affinity to a skill, but can be different per \\\"}\");\n/* 173 */ buf.append(\"label{text=\\\" player, e.g. fish and chips may give a temp weaponsmithing affinity to \\\"}\");\n/* 174 */ buf.append(\"label{text=\\\" Joe, but to Tom it gives carpentry, (also may not give it to any skill).\\\"}\");\n/* 175 */ buf.append(\"label{text=\\\" o Nutrition has not been changed.\\\"}\");\n/* */ \n/* 177 */ buf.append(\"label{type=\\\"bold\\\";text=\\\"Bees\\\"}\");\n/* 178 */ buf.append(\"label{text=\\\" * Wild bee hives will appear in spring at random locations and they will vanish at the end \\\"}\");\n/* 179 */ buf.append(\"label{text=\\\" of the year (in winter). Note they will be in different locations each year.\\\"}\");\n/* 180 */ buf.append(\"label{text=\\\" * As time passes honey will be made in hives together with bees wax, the amount will\\\"}\");\n/* 181 */ buf.append(\"label{text=\\\" depend on nearby flowers, fields and trees.\\\"}\");\n/* 182 */ buf.append(\"label{text=\\\" * Each wild hive will start with one queen bee, this may increase by one every wurm \\\"}\");\n/* 183 */ buf.append(\"label{text=\\\" month, to a maximum of two, so long as the hive has over a certain amount of honey in \\\"}\");\n/* 184 */ buf.append(\"label{text=\\\" it. When there is two queen bees if there is a domestic hive nearby it may migrate to it.\\\"}\");\n/* 185 */ buf.append(\"label{text=\\\" * Domestic hives will be loadable. Even with a queen in it. So you can move it to \\\"}\");\n/* 186 */ buf.append(\"label{text=\\\" somewhere, e.g. your own deed. Watch out bees sting!\\\"}\");\n/* 187 */ buf.append(\"label{text=\\\" * Domestic hives that had a queen in it, will go dormant over the winter period and will \\\"}\");\n/* 188 */ buf.append(\"label{text=\\\" become active again in spring. But it is possible for the queen to die over winter if no \\\"}\");\n/* 189 */ buf.append(\"label{text=\\\" honey is left in the hive (Note can put sugar in hive to keep the queen alive.\\\"}\");\n/* 190 */ buf.append(\"label{text=\\\" * Honey ( and beeswax) will be collectable from hives.. But you may need a bee \\\"}\");\n/* 191 */ buf.append(\"label{text=\\\" smoker.. So bees do not sting you, note that this bee smoker is useful for other times, \\\"}\");\n/* 192 */ buf.append(\"label{text=\\\" like if you want to chop down a tree that has a hive, or load/unload a domestic hive \\\"}\");\n/* 193 */ buf.append(\"label{text=\\\" which has a queen in it.\\\"}\");\n/* */ \n/* 195 */ buf.append(\"label{type=\\\"bold\\\";text=\\\"Recipes\\\"}\");\n/* 196 */ buf.append(\"label{text=\\\" * As well as being able to examine a food container to see what it will make, you can \\\"}\");\n/* 197 */ buf.append(\"harray{label{text=\\\" also use \\\"};label{type=\\\"bold\\\";text=\\\"LORE\\\"};label{text=\\\", to get hints on what ingredient you could add into the container to be \\\"}}\");\n/* */ \n/* */ \n/* 200 */ buf.append(\"label{text=\\\" able to make something.\\\"}\");\n/* 201 */ buf.append(\"label{text=\\\" * Some more specialised recipes will call for a meat of a specific category, or a specific \\\"}\");\n/* 202 */ buf.append(\"label{text=\\\" fish, but most will use any meat or any fish or even any veg.\\\"}\");\n/* 203 */ buf.append(\"label{text=\\\" * Most new recipes only require one of each item, main exception is making sandwiches \\\"}\");\n/* 204 */ buf.append(\"label{text=\\\" which normally requires 2 slices of bread.\\\"}\");\n/* 205 */ buf.append(\"label{text=\\\" * Some recipes are an intermediate step, or some sauce which is used later e.g. there is \\\"}\");\n/* 206 */ buf.append(\"label{text=\\\" cake mix and white sauce.\\\"}\");\n/* 207 */ buf.append(\"label{text=\\\" * Lots of new food category types e.g.\\\"}\");\n/* 208 */ buf.append(\"label{text=\\\" o Curry\\\"}\");\n/* 209 */ buf.append(\"label{text=\\\" o Pizza\\\"}\");\n/* 210 */ buf.append(\"label{text=\\\" o Cookies\\\"}\");\n/* 211 */ buf.append(\"label{text=\\\" o Pie\\\"}\");\n/* 212 */ buf.append(\"label{text=\\\" o Tarts\\\"}\");\n/* 213 */ buf.append(\"label{text=\\\" o Biscuits\\\"}\");\n/* 214 */ buf.append(\"label{text=\\\" o Scones\\\"}\");\n/* 215 */ buf.append(\"label{text=\\\" o Salads\\\"}\");\n/* 216 */ buf.append(\"label{text=\\\" * And some of your old favorites like.\\\"}\");\n/* 217 */ buf.append(\"label{text=\\\" o Cakes\\\"}\");\n/* 218 */ buf.append(\"label{text=\\\" o Sandwiches\\\"}\");\n/* 219 */ buf.append(\"label{text=\\\" o Tea\\\"}\");\n/* 220 */ buf.append(\"label{text=\\\" o Wine\\\"}\");\n/* 221 */ buf.append(\"label{text=\\\" o Meal\\\"}\");\n/* 222 */ buf.append(\"label{text=\\\" * And there are some new drinks which will need distilling.\\\"}\");\n/* 223 */ buf.append(\"label{text=\\\" * Note you will need to experiment to find their recipes, but do note some items need a \\\"}\");\n/* 224 */ buf.append(\"label{text=\\\" mix before adding other items, e.g. you will now need a cake mix to make cakes.\\\"}\");\n/* 225 */ buf.append(\"label{text=\\\" * Some ingredients will only be found doing forage/botanize actions, whilst others, once \\\"}\");\n/* 226 */ buf.append(\"harray{label{text=\\\" found, they may be able to be planted as a \\\"};label{type=\\\"bold\\\";text=\\\"crop\\\"};label{text=\\\" or even in a \\\"};label{type=\\\"bold\\\";text=\\\"planter\\\"};label{text=\\\" (e.g. most spices \\\"}}\");\n/* */ \n/* */ \n/* */ \n/* */ \n/* 231 */ buf.append(\"label{text=\\\" and herbs can be planted in a planter).\\\"}\");\n/* 232 */ buf.append(\"label{text=\\\" o Fresh is an attribute of an item when just found from foraging or picking, if you \\\"}\");\n/* 233 */ buf.append(\"label{text=\\\" put it in a FSB it looses that attribute.\\\"}\");\n/* 234 */ buf.append(\"label{text=\\\" * Some recipes are nameable this means that whoever is the first to make the item for \\\"}\");\n/* 235 */ buf.append(\"label{text=\\\" that recipe, will have their name added to the front of that recipe name, e.g. if Pifa was \\\"}\");\n/* 236 */ buf.append(\"label{text=\\\" first to make a meat curry (assuming that was nameable) then it would show to \\\"}\");\n/* 237 */ buf.append(\"label{text=\\\" everyone, when they discover it, as ''Pifa's meat curry''.\\\"}\");\n/* 238 */ buf.append(\"label{text=\\\" * Note only one recipe can be named per person.\\\"}\");\n/* 239 */ buf.append(\"label{text=\\\" * Some recipes may only be makeable once you have that recipe in your cookbook,\\\"}\");\n/* 240 */ buf.append(\"label{text=\\\" these recipes are only available from killing certain creatures.\\\"}\");\n/* 241 */ buf.append(\"label{text=\\\" * Recipes can be inscribed onto papryus (or paper), to do this you need to be looking at\\\"}\");\n/* 242 */ buf.append(\"label{text=\\\" the recipe in your cookbook, and then use the reed pen on a blank papryus (or paper).\\\"}\");\n/* 243 */ buf.append(\"label{text=\\\" o You can then mail these or trade them to others, where they can add it to their\\\"}\");\n/* 244 */ buf.append(\"label{text=\\\" cookbook, if they don't know it, by either reading the recipe and selecting to add\\\"}\");\n/* 245 */ buf.append(\"label{text=\\\" to their cookbook or activate it and r-click on the cookbook menu option.\\\"}\");\n/* */ \n/* 247 */ buf.append(\"label{type=\\\"bold\\\";text=\\\"Planter\\\"}\");\n/* 248 */ buf.append(\"label{text=\\\" * Items can be planted in a planter, e.g. a herb or a spice (not all spices).\\\"}\");\n/* 249 */ buf.append(\"label{text=\\\" * The planted item will start growing.\\\"}\");\n/* 250 */ buf.append(\"label{text=\\\" * After a while it will be available to be harvested.\\\"}\");\n/* 251 */ buf.append(\"label{text=\\\" * Harvesting will be available daily,\\\"}\");\n/* 252 */ buf.append(\"label{text=\\\" * Each time you harvest it will prolong its life\\\"}\");\n/* 253 */ buf.append(\"label{text=\\\" * Eventually it will get too woody to be harvested, then it is time to start afresh.\\\"}\");\n/* */ \n/* 255 */ buf.append(\"label{type=\\\"bold\\\";text=\\\"LORE\\\"}\");\n/* 256 */ buf.append(\"label{text=\\\"Using LORE on a container, will let you know what could be made, e.g.\\\"}\");\n/* 257 */ buf.append(\"label{text=\\\" * If the contents match a known recipe (known by you that is). You would get a message \\\"}\");\n/* 258 */ buf.append(\"label{text=\\\" like:\\\"}\");\n/* 259 */ buf.append(\"label{text=\\\" o 'The ingredients in the frying pan would make an omlette when cooked'.\\\"}\");\n/* 260 */ buf.append(\"label{text=\\\" * If the contents match an unknown recipe. Message would be like: \\\"}\");\n/* 261 */ buf.append(\"label{text=\\\" o 'You think this may well work when cooked'.\\\"}\");\n/* 262 */ buf.append(\"label{text=\\\" * If the contents would make any recipe but has the incorrect amount of a liquid then \\\"}\");\n/* 263 */ buf.append(\"label{text=\\\" you would get something like:\\\"}\");\n/* 264 */ buf.append(\"label{text=\\\" o 'The ingredients in the saucepan would make tea when cooked, but...'\\\"}\");\n/* 265 */ buf.append(\"label{text=\\\" 'There is too much water, try between 300g and 400g.'\\\"}\");\n/* 266 */ buf.append(\"label{text=\\\" * Partial Matches\\\"}\");\n/* 267 */ buf.append(\"label{text=\\\" o It performs checks in this order \\\"}\");\n/* 268 */ buf.append(\"label{text=\\\" . Unknown recipe that is not nameable.\\\"}\");\n/* 269 */ buf.append(\"label{text=\\\" . Unknown recipe that is nameable.\\\"}\");\n/* 270 */ buf.append(\"label{text=\\\" . Known recipe that is not nameable.\\\"}\");\n/* 271 */ buf.append(\"label{text=\\\" . Known recipe that is nameable.\\\"}\");\n/* 272 */ buf.append(\"label{text=\\\" o If the contents form part of any recipe, it will give a hint as to what to add to \\\"}\");\n/* 273 */ buf.append(\"label{text=\\\" make that recipe. E.g. 'have you tried adding a chopped onion?'.\\\"}\");\n/* 274 */ buf.append(\"label{text=\\\" . Note the recipe is picked at random from a list of possible recipes and \\\"}\");\n/* 275 */ buf.append(\"label{text=\\\" so is the shown ingredient.\\\"}\");\n/* */ \n/* 277 */ buf.append(\"label{type=\\\"bold\\\";text=\\\"Cookbook\\\"}\");\n/* 278 */ buf.append(\"label{text=\\\" * Every person has a cookbook, where your known recipes are shown.\\\"}\");\n/* 279 */ buf.append(\"label{text=\\\" * Some recipes are known by everyone by default, you have to find the others and \\\"}\");\n/* 280 */ buf.append(\"label{text=\\\" make them for them to appear in your cookbook..\\\"}\");\n/* 281 */ buf.append(\"label{text=\\\" * The initial page of your cookbook allows you to select what recipes to view, i.e. \\\"}\");\n/* 282 */ buf.append(\"label{text=\\\" o Target action - these are the ones where you use one item on another, e.g. \\\"}\");\n/* 283 */ buf.append(\"label{text=\\\" grinding cereals to make flour.\\\"}\");\n/* 284 */ buf.append(\"label{text=\\\" o Container action - these ones are when you use a tool of some kind on a \\\"}\");\n/* 285 */ buf.append(\"label{text=\\\" container to change the contents of the container into a different item. E.g. \\\"}\");\n/* 286 */ buf.append(\"label{text=\\\" using your hand on a pottery bowl which containers flour, water, salt and butter \\\"}\");\n/* 287 */ buf.append(\"label{text=\\\" to make pastry.\\\"}\");\n/* 288 */ buf.append(\"label{text=\\\" o Heat - these ones are your basic cooking recipes, where you put ingredients \\\"}\");\n/* 289 */ buf.append(\"label{text=\\\" into a food container, and put in an cooker and after the ingredients get hot the \\\"}\");\n/* 290 */ buf.append(\"label{text=\\\" container items change to the result, e.g. putting maple sap into a saucepan in \\\"}\");\n/* 291 */ buf.append(\"label{text=\\\" a lit oven, will result in maple syrup after sometime. Not all recipes work in all \\\"}\");\n/* 292 */ buf.append(\"label{text=\\\" cookers.\\\"}\");\n/* 293 */ buf.append(\"label{text=\\\" o Time - these ones are used for brewing.\\\"}\");\n/* 294 */ buf.append(\"label{text=\\\" * Also on the initial page you also have links to view recipes (that you know) by\\\"}\");\n/* 295 */ buf.append(\"label{text=\\\" o Tool - this gives a list of the tools that you know are used for cooking, selecting \\\"}\");\n/* 296 */ buf.append(\"label{text=\\\" a tool from that list will give you the known recipes that can be made from it.\\\"}\");\n/* 297 */ buf.append(\"label{text=\\\" o Cooker - this will give a list of cookers, and selecting a cooker from that list will \\\"}\");\n/* 298 */ buf.append(\"label{text=\\\" lead you to a list of known recipes that can be made in it\\\"}\");\n/* 299 */ buf.append(\"label{text=\\\" o Container - this will give you a list of containers that can be used by known \\\"}\");\n/* 300 */ buf.append(\"label{text=\\\" recipes, selecting one will then give a list of the known recipes that use that \\\"}\");\n/* 301 */ buf.append(\"label{text=\\\" container.\\\"}\");\n/* 302 */ buf.append(\"label{text=\\\" o Ingredients - gives a list of all your known ingredients, and again selecting one \\\"}\");\n/* 303 */ buf.append(\"label{text=\\\" of them will then show a list of known recipes that use that ingredient.\\\"}\");\n/* 304 */ buf.append(\"label{text=\\\" * Also you can search your recipes.\\\"}\");\n/* 305 */ buf.append(\"label{text=\\\" * From any list of recipes, you can select one and view what you think is used to make \\\"}\");\n/* 306 */ buf.append(\"label{text=\\\" that item\\\"}\");\n/* 307 */ buf.append(\"label{text=\\\" o Note that there are optional ingredients, and unless you have used them for an \\\"}\");\n/* 308 */ buf.append(\"label{text=\\\" ingredient, then they will not show in your version.\\\"}\");\n/* 309 */ buf.append(\"label{text=\\\" o Note that some recipes may use any type of meat, or fish, or veg, or herb, or \\\"}\");\n/* 310 */ buf.append(\"label{text=\\\" spice, when you attempt the same recipe with a different type, your recipe will \\\"}\");\n/* 311 */ buf.append(\"label{text=\\\" be updated to show that information, e.g. if your recipe says that it uses beef \\\"}\");\n/* 312 */ buf.append(\"label{text=\\\" meat, and you try with canine meat, then if it works, the recipe will update \\\"}\");\n/* 313 */ buf.append(\"label{text=\\\" to show any meat. \\\"}\");\n/* 314 */ buf.append(\"label{text=\\\" o Note that not all recipes can use all types.\\\"}\");\n/* */ \n/* 316 */ buf.append(createAnswerButton2());\n/* 317 */ getResponder().getCommunicator().sendBml(480, 500, true, true, buf.toString(), 200, 200, 200, this.title);\n/* */ }", "public void testGetSimpleText() throws Exception {\n \t\tnew XWPFWordExtractor(xmlA);\n \t\tnew XWPFWordExtractor(POIXMLDocument.openPackage(fileA.toString()));\n \t\t\n \t\tXWPFWordExtractor extractor = \n \t\t\tnew XWPFWordExtractor(xmlA);\n \t\textractor.getText();\n \t\t\n \t\tString text = extractor.getText();\n \t\tassertTrue(text.length() > 0);\n \t\t\n \t\t// Check contents\n \t\tassertTrue(text.startsWith(\n \t\t\t\t\"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc at risus vel erat tempus posuere. Aenean non ante. Suspendisse vehicula dolor sit amet odio.\"\n \t\t));\n \t\tassertTrue(text.endsWith(\n \t\t\t\t\"Phasellus ultricies mi nec leo. Sed tempus. In sit amet lorem at velit faucibus vestibulum.\\n\"\n \t\t));\n \t\t\n \t\t// Check number of paragraphs\n \t\tint ps = 0;\n \t\tchar[] t = text.toCharArray();\n \t\tfor (int i = 0; i < t.length; i++) {\n \t\t\tif(t[i] == '\\n') { ps++; }\n \t\t}\n \t\tassertEquals(3, ps);\n \t}", "@Test\n\tpublic void testStoreProcessText2() {\n\t\tint sourceID = dm.storeProcessedText(pt1);\n\t\tassertTrue(sourceID > 0);\n\t\t\n\t\tds.startSession();\n\t\tSource source = ds.getSource(pt1.getMetadata().getUrl());\n\t\tList<Paragraph> paragraphs = (List<Paragraph>) ds.getParagraphs(source.getSourceID());\n\t\tassertTrue(pt1.getMetadata().getName().equals(source.getName()));\n\t\tassertTrue(pt1.getParagraphs().size() == paragraphs.size());\n\t\t\n\t\tfor(int i = 0; i < pt1.getParagraphs().size(); i++){\n\t\t\tParagraph p = paragraphs.get(i);\n\t\t\tParagraph originalP = pt1.getParagraphs().get(i);\n\t\t\tassertTrue(originalP.getParentOrder() == p.getParentOrder());\n\t\t\t\n\t\t\tList<Sentence> sentences = (List<Sentence>) ds.getSentences(p.getId());\n\t\t\tList<Sentence> originalSentences = (List<Sentence>) originalP.getSentences();\n\t\t\tfor(int j = 0; j < originalSentences.size(); j++){\n\t\t\t\tassertTrue(originalSentences.get(j).getContent().substring(DataStore.SENTENCE_PREFIX.length()).equals(sentences.get(j).getContent()));\n\t\t\t\tassertTrue(originalSentences.get(j).getParentOrder() == sentences.get(j).getParentOrder());\n\t\t\t}\n\t\t}\n\t\tds.closeSession();\n\t}", "@Test\n void nlpPipeline() {\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 assertFalse(sentences.isEmpty());\n }", "public void ach_doc_type_txt_test () {\n\t\t\n\t}", "public FreeMindWriter richPreText( String text ) {\n tagClose();\n out.print( \"<richcontent TYPE='NODE'><html>\\n <head>\\n\\n </head>\\n <body><pre>\" );\n out.writeEscapedXMLString( text, true );\n out.print( \"</pre></body>\\n</html>\\n</richcontent>\" );\n return this; \n }" ]
[ "0.6197842", "0.5737171", "0.55343705", "0.55089176", "0.5482881", "0.5455454", "0.54147065", "0.5405619", "0.5397318", "0.5397318", "0.5397318", "0.5397318", "0.53022665", "0.52693456", "0.52439266", "0.5222501", "0.5167544", "0.5163304", "0.5107296", "0.5072902", "0.5068012", "0.50652564", "0.5046175", "0.50345725", "0.5020127", "0.50067395", "0.5001191", "0.4983928", "0.4970825", "0.49557424", "0.49385592", "0.49353388", "0.4934772", "0.4912325", "0.48840886", "0.48735794", "0.48665923", "0.48636717", "0.48390803", "0.4824454", "0.48189852", "0.48167664", "0.48074996", "0.4797888", "0.4785757", "0.47841537", "0.47769773", "0.47724777", "0.4764826", "0.47623268", "0.4749209", "0.47372404", "0.47319737", "0.4720992", "0.4709344", "0.4703305", "0.4703063", "0.4694879", "0.46944967", "0.46931145", "0.46802515", "0.46712506", "0.46676856", "0.46661478", "0.46654406", "0.46566093", "0.4645282", "0.4642475", "0.46254456", "0.4607546", "0.45999515", "0.45994318", "0.45935094", "0.4586199", "0.45850897", "0.45835668", "0.45826542", "0.4579233", "0.4578083", "0.45766023", "0.45758888", "0.4575304", "0.4563822", "0.45632154", "0.45578173", "0.45566496", "0.455649", "0.45543516", "0.45534146", "0.45526904", "0.45444617", "0.45413607", "0.45221427", "0.45175996", "0.45171055", "0.45141372", "0.45130834", "0.45128244", "0.4510907", "0.45049322" ]
0.50269026
24
Takes wikitext and parses the wikitext for viewing. The following steps are performed: Validation Preprocessing (for viewing) Entity substitution Optional: Expansion Parsing Entity substitution
public CompiledPage parse( PageId pageId, String wikitext, ExpansionCallback callback) throws CompilerException { if (pageId == null) throw new NullPointerException(); PageTitle title = pageId.getTitle(); CompilerLog log = new CompilerLog(); log.setTitle(title.getFullTitle()); log.setRevision(pageId.getRevision()); LazyParsedPage pAst; try { EntityMap entityMap = new EntityMap(); String validatedWikitext = validate(title, wikitext, entityMap, log); LazyPreprocessedPage ppAst = preprocess(title, validatedWikitext, false, entityMap, log); LazyPreprocessedPage pprAst = ppAst; if (callback != null) pprAst = expand(callback, title, ppAst, entityMap, null, false, log); pAst = parse(title, pprAst, entityMap, log); } catch (CompilerException e) { e.attachLog(log); throw e; } catch (Throwable e) { throw new CompilerException("Compilation failed!", e, log); } return new CompiledPage( new Page(pAst.getContent()), pAst.getWarnings(), log); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void processContentEn() {\n if (this.content == null || this.content.equals(\"\")) {\r\n _logger.error(\"{} - The sentence is null or empty\", this.traceId);\r\n }\r\n\r\n // process input using ltp(Segmentation, POS, DP, SRL)\r\n this.nlp = new NLP(this.content, this.traceId, this.setting);\r\n }", "protected void importText(String text, Epml epml) {\n\t}", "private void parseEntities() {\n // See: https://github.com/twitter/twitter-text/tree/master/java\n entities.addExtractedEntities(TweetEntityAbstract.entitiesExtractor.extractCashtagsWithIndices(getText()));\n entities.addExtractedEntities(TweetEntityAbstract.entitiesExtractor.extractHashtagsWithIndices(getText()));\n entities.addExtractedEntities(TweetEntityAbstract.entitiesExtractor.extractMentionedScreennamesWithIndices(getText()));\n }", "private void parseRawText() {\n\t\t//1-new lines\n\t\t//2-pageObjects\n\t\t//3-sections\n\t\t//Clear any residual data.\n\t\tlinePositions.clear();\n\t\tsections.clear();\n\t\tpageObjects.clear();\n\t\tcategories.clear();\n\t\tinterwikis.clear();\n\t\t\n\t\t//Generate data.\n\t\tparsePageForNewLines();\n\t\tparsePageForPageObjects();\n\t\tparsePageForSections();\n\t}", "private void processContentCn() {\n if (this.content == null || this.content.equals(\"\")) {\r\n _logger.error(\"{} - The sentence is null or empty\", this.traceId);\r\n }\r\n\r\n // process input using ltp(Segmentation, POS, DP, SRL)\r\n this.ltp = new LTP(this.content, this.traceId, this.setting);\r\n }", "public static Patent transform(String patentxml) {\n\t\t patentxml = patentxml.trim();\n\t\t //patentxml = patentxml.replace(\"<!DOCTYPE math PUBLIC \\\"-//W3C//DTD MathML 3.0//EN\\\" \\\"http://www.w3.org/Math/DTD/mathml3/mathml3.dtd\\\">\", \"<!DOCTYPE PATDOC [<!ENTITY nbsp \\\"&#160;\\\" ><!ENTITY iexcl \\\"&#161;\\\" ><!ENTITY cent \\\"&#162;\\\" ><!ENTITY pound \\\"&#163;\\\" ><!ENTITY curren \\\"&#164;\\\" ><!ENTITY yen \\\"&#165;\\\" ><!ENTITY brvbar \\\"&#166;\\\" ><!ENTITY sect \\\"&#167;\\\" ><!ENTITY uml \\\"&#168;\\\" ><!ENTITY copy \\\"&#169;\\\" ><!ENTITY ordf \\\"&#170;\\\" ><!ENTITY laquo \\\"&#171;\\\" ><!ENTITY not \\\"&#172;\\\" ><!ENTITY shy \\\"&#173;\\\" ><!ENTITY reg \\\"&#174;\\\" ><!ENTITY macr \\\"&#175;\\\" ><!ENTITY deg \\\"&#176;\\\" ><!ENTITY plusmn \\\"&#177;\\\" ><!ENTITY sup2 \\\"&#178;\\\" ><!ENTITY sup3 \\\"&#179;\\\" ><!ENTITY acute \\\"&#180;\\\" ><!ENTITY micro \\\"&#181;\\\" ><!ENTITY para \\\"&#182;\\\" ><!ENTITY middot \\\"&#183;\\\" ><!ENTITY cedil \\\"&#184;\\\" ><!ENTITY sup1 \\\"&#185;\\\" ><!ENTITY ordm \\\"&#186;\\\" ><!ENTITY raquo \\\"&#187;\\\" ><!ENTITY frac14 \\\"&#188;\\\" ><!ENTITY frac12 \\\"&#189;\\\" ><!ENTITY frac34 \\\"&#190;\\\" ><!ENTITY iquest \\\"&#191;\\\" ><!ENTITY Agrave \\\"&#192;\\\" ><!ENTITY Aacute \\\"&#193;\\\" ><!ENTITY Acirc \\\"&#194;\\\" ><!ENTITY Atilde \\\"&#195;\\\" ><!ENTITY Auml \\\"&#196;\\\" ><!ENTITY Aring \\\"&#197;\\\" ><!ENTITY AElig \\\"&#198;\\\" ><!ENTITY Ccedil \\\"&#199;\\\" ><!ENTITY Egrave \\\"&#200;\\\" ><!ENTITY Eacute \\\"&#201;\\\" ><!ENTITY Ecirc \\\"&#202;\\\" ><!ENTITY Euml \\\"&#203;\\\" ><!ENTITY Igrave \\\"&#204;\\\" ><!ENTITY Iacute \\\"&#205;\\\" ><!ENTITY Icirc \\\"&#206;\\\" ><!ENTITY Iuml \\\"&#207;\\\" ><!ENTITY ETH \\\"&#208;\\\" ><!ENTITY Ntilde \\\"&#209;\\\" ><!ENTITY Ograve \\\"&#210;\\\" ><!ENTITY Oacute \\\"&#211;\\\" ><!ENTITY Ocirc \\\"&#212;\\\" ><!ENTITY Otilde \\\"&#213;\\\" ><!ENTITY Ouml \\\"&#214;\\\" ><!ENTITY times \\\"&#215;\\\" ><!ENTITY Oslash \\\"&#216;\\\" ><!ENTITY Ugrave \\\"&#217;\\\" ><!ENTITY Uacute \\\"&#218;\\\" ><!ENTITY Ucirc \\\"&#219;\\\" ><!ENTITY Uuml \\\"&#220;\\\" ><!ENTITY Yacute \\\"&#221;\\\" ><!ENTITY THORN \\\"&#222;\\\" ><!ENTITY szlig \\\"&#223;\\\" ><!ENTITY agrave \\\"&#224;\\\" ><!ENTITY aacute \\\"&#225;\\\" ><!ENTITY acirc \\\"&#226;\\\" ><!ENTITY atilde \\\"&#227;\\\" ><!ENTITY auml \\\"&#228;\\\" ><!ENTITY aring \\\"&#229;\\\" ><!ENTITY aelig \\\"&#230;\\\" ><!ENTITY ccedil \\\"&#231;\\\" ><!ENTITY egrave \\\"&#232;\\\" ><!ENTITY eacute \\\"&#233;\\\" ><!ENTITY ecirc \\\"&#234;\\\" ><!ENTITY euml \\\"&#235;\\\" ><!ENTITY igrave \\\"&#236;\\\" ><!ENTITY iacute \\\"&#237;\\\" ><!ENTITY icirc \\\"&#238;\\\" ><!ENTITY iuml \\\"&#239;\\\" ><!ENTITY eth \\\"&#240;\\\" ><!ENTITY ntilde \\\"&#241;\\\" ><!ENTITY ograve \\\"&#242;\\\" ><!ENTITY oacute \\\"&#243;\\\" ><!ENTITY ocirc \\\"&#244;\\\" ><!ENTITY otilde \\\"&#245;\\\" ><!ENTITY ouml \\\"&#246;\\\" ><!ENTITY divide \\\"&#247;\\\" ><!ENTITY oslash \\\"&#248;\\\" ><!ENTITY ugrave \\\"&#249;\\\" ><!ENTITY uacute \\\"&#250;\\\" ><!ENTITY ucirc \\\"&#251;\\\" ><!ENTITY uuml \\\"&#252;\\\" ><!ENTITY yacute \\\"&#253;\\\" ><!ENTITY thorn \\\"&#254;\\\" ><!ENTITY yuml \\\"&#255;\\\" > <!ENTITY lt \\\"&#38;#60;\\\" > <!ENTITY gt \\\"&#62;\\\" > <!ENTITY amp \\\"&#38;#38;\\\" > <!ENTITY apos \\\"&#39;\\\" > <!ENTITY quot \\\"&#34;\\\" > <!ENTITY OElig \\\"&#338;\\\" > <!ENTITY oelig \\\"&#339;\\\" > <!ENTITY Scaron \\\"&#352;\\\" > <!ENTITY scaron \\\"&#353;\\\" > <!ENTITY Yuml \\\"&#376;\\\" > <!ENTITY circ \\\"&#710;\\\" > <!ENTITY tilde \\\"&#732;\\\" > <!ENTITY ensp \\\"&#8194;\\\" > <!ENTITY emsp \\\"&#8195;\\\" > <!ENTITY thinsp \\\"&#8201;\\\" > <!ENTITY zwnj \\\"&#8204;\\\" > <!ENTITY zwj \\\"&#8205;\\\" > <!ENTITY lrm \\\"&#8206;\\\" > <!ENTITY rlm \\\"&#8207;\\\" > <!ENTITY ndash \\\"&#8211;\\\" > <!ENTITY mdash \\\"&#8212;\\\" > <!ENTITY lsquo \\\"&#8216;\\\" > <!ENTITY rsquo \\\"&#8217;\\\" > <!ENTITY sbquo \\\"&#8218;\\\" > <!ENTITY ldquo \\\"&#8220;\\\" > <!ENTITY rdquo \\\"&#8221;\\\" > <!ENTITY bdquo \\\"&#8222;\\\" > <!ENTITY dagger \\\"&#8224;\\\" > <!ENTITY Dagger \\\"&#8225;\\\" > <!ENTITY permil \\\"&#8240;\\\" > <!ENTITY lsaquo \\\"&#8249;\\\" > <!ENTITY rsaquo \\\"&#8250;\\\" > <!ENTITY euro \\\"&#8364;\\\" > <!ENTITY minus \\\"&#43;\\\" > <!ENTITY plus \\\"&#43;\\\" > <!ENTITY equals \\\"&#61;\\\" > <!ENTITY af \\\"\\\" > <!ENTITY it \\\"\\\" ><!ENTITY fnof \\\"&#402;\\\" > <!ENTITY Alpha \\\"&#913;\\\" > <!ENTITY Beta \\\"&#914;\\\" > <!ENTITY Gamma \\\"&#915;\\\" > <!ENTITY Delta \\\"&#916;\\\" > <!ENTITY Epsilon \\\"&#917;\\\" > <!ENTITY Zeta \\\"&#918;\\\" > <!ENTITY Eta \\\"&#919;\\\" > <!ENTITY Theta \\\"&#920;\\\" > <!ENTITY Iota \\\"&#921;\\\" > <!ENTITY Kappa \\\"&#922;\\\" > <!ENTITY Lambda \\\"&#923;\\\" > <!ENTITY Mu \\\"&#924;\\\" > <!ENTITY Nu \\\"&#925;\\\" > <!ENTITY Xi \\\"&#926;\\\" > <!ENTITY Omicron \\\"&#927;\\\" > <!ENTITY Pi \\\"&#928;\\\" > <!ENTITY Rho \\\"&#929;\\\" > <!ENTITY Sigma \\\"&#931;\\\" > <!ENTITY Tau \\\"&#932;\\\" > <!ENTITY Upsilon \\\"&#933;\\\" > <!ENTITY Phi \\\"&#934;\\\" > <!ENTITY Chi \\\"&#935;\\\" > <!ENTITY Psi \\\"&#936;\\\" > <!ENTITY Omega \\\"&#937;\\\" > <!ENTITY alpha \\\"&#945;\\\" > <!ENTITY beta \\\"&#946;\\\" > <!ENTITY gamma \\\"&#947;\\\" > <!ENTITY delta \\\"&#948;\\\" > <!ENTITY epsilon \\\"&#949;\\\" > <!ENTITY zeta \\\"&#950;\\\" > <!ENTITY eta \\\"&#951;\\\" > <!ENTITY theta \\\"&#952;\\\" > <!ENTITY iota \\\"&#953;\\\" > <!ENTITY kappa \\\"&#954;\\\" > <!ENTITY lambda \\\"&#955;\\\" > <!ENTITY mu \\\"&#956;\\\" > <!ENTITY nu \\\"&#957;\\\" > <!ENTITY xi \\\"&#958;\\\" > <!ENTITY omicron \\\"&#959;\\\" > <!ENTITY pi \\\"&#960;\\\" > <!ENTITY rho \\\"&#961;\\\" > <!ENTITY sigmaf \\\"&#962;\\\" > <!ENTITY sigma \\\"&#963;\\\" > <!ENTITY tau \\\"&#964;\\\" > <!ENTITY upsilon \\\"&#965;\\\" > <!ENTITY phi \\\"&#966;\\\" > <!ENTITY chi \\\"&#967;\\\" > <!ENTITY psi \\\"&#968;\\\" > <!ENTITY omega \\\"&#969;\\\" > <!ENTITY thetasym \\\"&#977;\\\" > <!ENTITY upsih \\\"&#978;\\\" > <!ENTITY piv \\\"&#982;\\\" > <!ENTITY bull \\\"&#8226;\\\" > <!ENTITY hellip \\\"&#8230;\\\" > <!ENTITY prime \\\"&#8242;\\\" > <!ENTITY Prime \\\"&#8243;\\\" > <!ENTITY oline \\\"&#8254;\\\" > <!ENTITY frasl \\\"&#8260;\\\" > <!ENTITY weierp \\\"&#8472;\\\" > <!ENTITY image \\\"&#8465;\\\" > <!ENTITY real \\\"&#8476;\\\" > <!ENTITY trade \\\"&#8482;\\\" > <!ENTITY alefsym \\\"&#8501;\\\" > <!ENTITY larr \\\"&#8592;\\\" > <!ENTITY uarr \\\"&#8593;\\\" > <!ENTITY rarr \\\"&#8594;\\\" > <!ENTITY darr \\\"&#8595;\\\" > <!ENTITY harr \\\"&#8596;\\\" > <!ENTITY crarr \\\"&#8629;\\\" > <!ENTITY lArr \\\"&#8656;\\\" > <!ENTITY uArr \\\"&#8657;\\\" > <!ENTITY rArr \\\"&#8658;\\\" > <!ENTITY dArr \\\"&#8659;\\\" > <!ENTITY hArr \\\"&#8660;\\\" > <!ENTITY forall \\\"&#8704;\\\" > <!ENTITY part \\\"&#8706;\\\" > <!ENTITY exist \\\"&#8707;\\\" > <!ENTITY empty \\\"&#8709;\\\" > <!ENTITY nabla \\\"&#8711;\\\" > <!ENTITY isin \\\"&#8712;\\\" > <!ENTITY notin \\\"&#8713;\\\" > <!ENTITY ni \\\"&#8715;\\\" > <!ENTITY prod \\\"&#8719;\\\" > <!ENTITY sum \\\"&#8721;\\\" > <!ENTITY minus \\\"&#8722;\\\" > <!ENTITY lowast \\\"&#8727;\\\" > <!ENTITY radic \\\"&#8730;\\\" > <!ENTITY prop \\\"&#8733;\\\" > <!ENTITY infin \\\"&#8734;\\\" > <!ENTITY ang \\\"&#8736;\\\" > <!ENTITY and \\\"&#8743;\\\" > <!ENTITY or \\\"&#8744;\\\" > <!ENTITY cap \\\"&#8745;\\\" > <!ENTITY cup \\\"&#8746;\\\" > <!ENTITY int \\\"&#8747;\\\" > <!ENTITY there4 \\\"&#8756;\\\" > <!ENTITY sim \\\"&#8764;\\\" > <!ENTITY cong \\\"&#8773;\\\" > <!ENTITY asymp \\\"&#8776;\\\" > <!ENTITY ne \\\"&#8800;\\\" > <!ENTITY equiv \\\"&#8801;\\\" > <!ENTITY le \\\"&#8804;\\\" > <!ENTITY ge \\\"&#8805;\\\" > <!ENTITY sub \\\"&#8834;\\\" > <!ENTITY sup \\\"&#8835;\\\" > <!ENTITY nsub \\\"&#8836;\\\" > <!ENTITY sube \\\"&#8838;\\\" > <!ENTITY supe \\\"&#8839;\\\" > <!ENTITY oplus \\\"&#8853;\\\" > <!ENTITY otimes \\\"&#8855;\\\" > <!ENTITY perp \\\"&#8869;\\\" > <!ENTITY sdot \\\"&#8901;\\\" > <!ENTITY lceil \\\"&#8968;\\\" > <!ENTITY rceil \\\"&#8969;\\\" > <!ENTITY lfloor \\\"&#8970;\\\" > <!ENTITY rfloor \\\"&#8971;\\\" > <!ENTITY lang \\\"&#9001;\\\" > <!ENTITY rang \\\"&#9002;\\\" > <!ENTITY loz \\\"&#9674;\\\" > <!ENTITY spades \\\"&#9824;\\\" > <!ENTITY clubs \\\"&#9827;\\\" > <!ENTITY hearts \\\"&#9829;\\\" > <!ENTITY diams \\\"&#9830;\\\" > <!ENTITY lcub \\\"\\\" > <!ENTITY rcub \\\"\\\" > <!ENTITY excl \\\"\\\" > <!ENTITY quest \\\"\\\" > <!ENTITY num \\\"\\\" >]>\");\n\t\t //patentxml = patentxml.replace(\"<!DOCTYPE math PUBLIC \\\"-//W3C//DTD MathML 3.0//EN\\\" \\\"http://www.w3.org/Math/DTD/mathml3/mathml3.dtd\\\">\", \"<!DOCTYPE math PUBLIC \\\"-//W3C//DTD MathML 2.0//EN\\\" \\\"dtds/mathml2.dtd\\\">\");\n\t\t patentxml = patentxml.replace(\"<!DOCTYPE math PUBLIC \\\"-//W3C//DTD MathML 3.0//EN\\\" \\\"http://www.w3.org/Math/DTD/mathml3/mathml3.dtd\\\">\", \"<!DOCTYPE math PUBLIC \\\"-//W3C//DTD MathML 2.0//EN\\\" \\\"http://10.18.203.79:7070/solr/dtds/mathml2.dtd\\\">\");\n\t\t Patent parsedPatent = null;\n\t if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v4.5 2014-04-03\\\"\")==true) { // patent xml is grant in DTD v4.5\n\t\t\t\tparsedPatent = parseGrantv45(patentxml);\t\t \n\t }\n\t else if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v4.4 2013-05-16\\\"\")==true) { // patent xml is grant in DTD v4.4\n\t \tparsedPatent = parseGrantv44(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v4.3 2012-12-04\\\"\")==true) { // patent xml is grant in DTD v4.3\n\t \tparsedPatent = parseGrantv43(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v4.2 2006-08-23\\\"\")==true) { // patent xml is grant in DTD v4.2\n\t \tparsedPatent = parseGrantv42(patentxml);\n\t }\t\n\t else if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v4.1 2005-08-25\\\"\")==true) { // patent xml is grant in DTD v4.5\n\t \tparsedPatent = parseGrantv41(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v40 2004-12-02\\\"\")==true) { // patent xml is grant in DTD v4.0\n\t \tparsedPatent = parseGrantv40_041202(patentxml);\n\t }\n\t else if(patentxml.contains(\"<PATDOC DTD=\\\"2.5\\\"\")==true) { // patent xml is grant in DTD v2.5\n\t \tparsedPatent = parseGrantv25(patentxml);\t\t \t\t\t\t \n\t }\n\t else if(patentxml.contains(\"<PATDOC DTD=\\\"2.4\\\"\")==true) { // patent xml is grant in DTD v2.5\n\t \tparsedPatent = parseGrantv24(patentxml);\t\t \t\t\t\t \n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.4 2014-04-03\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv44(patentxml);\t\t \n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.3 2012-12-04\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv43(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.2 2006-08-23\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv42(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.1 2005-08-25\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv41(patentxml);\n\t }\t \t \n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.0 2004-12-02\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv40_041202(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.0 2004-10-28\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv40_041028(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.0 2004-09-27\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv40_040927(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.0 2004-09-08\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv40_040908(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.0 2004-04-15\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv40_040415(patentxml);\n\t }\n\t else if(patentxml.indexOf(\"<!DOCTYPE patent-application-publication\")==0 && patentxml.contains(\"pap-v16-2002-01-01.dtd\")==true) { // patent xml is application in DTD v1.6\n\t \tparsedPatent = parseApplicationv16(patentxml);\n\t }\n\t\t return parsedPatent==null? new Patent():parsedPatent;\n\t }", "protected void processXlateText(Hashtable attributes)\n throws SAXException\n {\n\tString key = (String) attributes.get(XMLTag.ID);\n\tif ((xlatedText == null) || (textTag == null))\n\t {\n\t throw new SAXException(\"Encountered xlateText element (id=\" +\n\t\t\t key + \") outside defining element.\");\n\t }\n\tXMLTag tag = (XMLTag) attributes.get(XMLTag.TAG);\n\tString dflt = (String) attributes.get(XMLTag.REMIND);\n\tString substitute = (String) attributes.get(XMLTag.SUBSTITUTE);\n\tString xlated = textSource.getI18NText(key,dflt);\n // ignore lines that are bare accent graves\n if (xlated.compareTo(\"`\") == 0)\n return;\n if (substitute != null)\n\t {\n\t int p1 = xlated.indexOf(\"%1\");\n\t if (p1 < 0)\n\t p1 = xlated.indexOf(\"%s\");\n\t if (p1 < 0)\n\t p1 = xlated.indexOf(\"%d\");\n\t if (p1 >= 0)\n\t {\n int p2 = xlated.indexOf(\" \",p1);\n\t\tif (p2 < 0)\n\t\t {\n xlated = xlated.substring(0,p1) + substitute;\n\t\t }\n\t\telse\n\t\t {\n xlated = xlated.substring(0,p1) + substitute +\n\t\t xlated.substring(p2);\n\t\t }\n\t\t}\n\t else // just append the substitute string.\n\t {\n p1 = xlated.lastIndexOf(\" \");\n\t\tif (p1 < (xlated.length() - 1))\n\t\t {\n\t\t xlated = xlated + \" \";\n\t\t }\n\t\txlated = xlated + substitute;\n\t\t}\n\t }\n\txlatedText.add(xlated);\n\ttextTag.add(tag);\n\ttextKey.add(key);\n\t}", "String getTransformedText();", "protected void processTextElement(XMLTag elementTag)\n throws SAXException\n {\n\tif (elementTag == XMLTag.LABEL)\n\t {\n\t // one line, no formatting, applies to either\n\t // control or menu item.\n\t if (currentControl != null)\n\t {\n\t\tString label = (String) xlatedText.get(0);\n\t\tcurrentControl.setLabelText(label);\n\t\tString labelKey = (String) textKey.get(0);\n\t\tcurrentControl.setLabelKey(labelKey);\n\t\t}\n\t }\n\telse if (elementTag == XMLTag.TITLE)\n\t {\n\t if (currentPanel != null)\n\t {\n\t\tString title = (String) xlatedText.get(0);\n\t\tcurrentPanel.setTitle(title);\n\t\t} \n\t }\n\telse if (elementTag == XMLTag.HELP)\n\t {\n\t // Need to concatenate all strings and format\n\t // as HTML - will be embedded in another HTML\n\t // document, so we can leave off the <HTML> and <BODY>\n\t StringBuffer helpString = new StringBuffer();\n\t String[] keys = new String[textKey.size()];\n boolean bInList = false;\n\t for (int i = 0; i < xlatedText.size(); i++)\n\t {\n\t\tString temp = replaceAngleBrackets((String) xlatedText.get(i));\n\t\tXMLTag tTag = (XMLTag) textTag.get(i);\n\t\tif (tTag == XMLTag.PARAGRAPH)\n\t\t {\n if (bInList)\n\t\t {\n\t\t helpString.append(\"</dl>\\n\"); \n bInList = false;\n\t\t\t}\n\t\t if (i == 0)\n\t\t {\n\t\t\t //~~\t\thelpString.append(\"<P>\");\n\t\t\t}\n\t\t else\n\t\t {\n\t\t helpString.append(\"<p>\");\n\t\t\t}\n helpString.append(temp);\n\t\t }\n\t\telse if (tTag == XMLTag.LISTITEM)\n\t\t {\n if (!bInList)\n\t\t {\n\t\t helpString.append(\"<dl>\\n\");\n\t\t\tbInList = true;\n\t\t\t}\n\t\t if (i > 0)\n\t\t helpString.append(\"\\n\");\n\t\t helpString.append(\"<dd>\" + temp + \"</dd>\\n\");\n\t\t }\n\t\telse\n\t\t {\n\t\t helpString.append(temp);\n\t\t }\n\t\tkeys[i] = (String) textKey.get(i);\n\t\t}\n if (bInList)\n\t {\n helpString.append(\"</dl>\\n\");\n\t\t}\n\t helpString.append(\"</p></FONT>\\n\");\n\t // could apply to either a control or a menu item.\n\t if (currentControl != null)\n\t {\n\t\tcurrentControl.setHelpString(helpString.toString());\n\t\tcurrentControl.setHelpKeys(keys);\n\t\t}\n\t }\n\telse if (elementTag == XMLTag.CHOICES)\n\t {\n\t // only relevant if the current control is a combo, radio,\n\t // or checkbutton\n\t if (currentControl.isChoiceControl())\n\t {\n\t\tString[] keys = new String[textKey.size()];\n\t\tString[] choices = new String[xlatedText.size()];\n\t\tfor (int i = 0; i < xlatedText.size(); i++)\n\t\t {\n\t\t choices[i] = (String) xlatedText.get(i);\n\t\t keys[i] = (String) textKey.get(i);\n\t\t }\n\t\tcurrentControl.setChoiceStrings(choices);\n\t\tcurrentControl.setChoiceKeys(keys);\n\t\t}\n\t }\n\telse if (elementTag == XMLTag.TOOLTIP)\n\t {\n\t // just ignore \n\t // only relevant to menu items\n\n\t }\n\telse if (elementTag == XMLTag.DEFAULT)\n\t {\n if (currentControl != null)\n\t {\n\t\tString text = (String) xlatedText.get(0);\n\t\tcurrentControl.setDefaultValue(text);\n\t\tString key = (String)textKey.get(0);\n\t\tcurrentControl.setDefaultKey(key);\n\t }\n\t }\n\t// get rid of text and tags - we are done with them\n\txlatedText.clear();\n\txlatedText = null;\n\ttextTag.clear();\n\ttextTag = null;\n\t}", "@Override\n public void onSuccess(Text visionText) {\n\n Log.d(TAG, \"onSuccess: \");\n extractText(visionText);\n }", "public void testGetComplexText() throws Exception {\n \t\tXWPFWordExtractor extractor = \n \t\t\tnew XWPFWordExtractor(xmlB);\n \t\textractor.getText();\n \t\t\n \t\tString text = extractor.getText();\n \t\tassertTrue(text.length() > 0);\n \t\t\n \t\tchar euro = '\\u20ac';\n \t\tSystem.err.println(\"'\"+text.substring(text.length() - 20) + \"'\");\n \t\t\n \t\t// Check contents\n \t\tassertTrue(text.startsWith(\n \t\t\t\t\" \\n(V) ILLUSTRATIVE CASES\\n\\n\"\n \t\t));\n\t\tassertTrue(text.endsWith(\n \t\t\t\t\"As well as gaining \"+euro+\"90 from child benefit increases, he will also receive the early childhood supplement of \"+euro+\"250 per quarter for Vincent for the full four quarters of the year.\\n\\n\\n\\n \\n\\n\\n\"\n \t\t));\n \t\t\n \t\t// Check number of paragraphs\n \t\tint ps = 0;\n \t\tchar[] t = text.toCharArray();\n \t\tfor (int i = 0; i < t.length; i++) {\n \t\t\tif(t[i] == '\\n') { ps++; }\n \t\t}\n\t\tassertEquals(79, ps);\n \t}", "private void processText(){\n if(text == null || text.length() == 0){\n // When posting a tweet, Twitter returns the \"text\" JSON field even if it's not trimmed...\n text = trimmedText;\n }else{\n // Trim the original contents received from Twitter\n text = text.substring(0, text.offsetByCodePoints(0, displayTextRange[1]));\n }\n\n // Transform HTML characters (for some reason Twitter sends those)\n text = org.apache.commons.text.StringEscapeUtils.unescapeHtml4(text);\n }", "@Override\n public void unpackMarkup(Document doc, RepositioningInfo repInfo,\n RepositioningInfo ampCodingInfo) throws DocumentFormatException {\n if((doc == null)\n || (doc.getSourceUrl() == null && doc.getContent() == null)) {\n\n throw new DocumentFormatException(\n \"GATE document is null or no content found. Nothing to parse!\"); }// End\n // if\n\n // Create a status listener\n StatusListener statusListener = new StatusListener() {\n @Override\n public void statusChanged(String text) {\n // This is implemented in DocumentFormat.java and inherited here\n fireStatusChanged(text);\n }\n };\n\n // determine whether we have a GATE format document or not\n /*String content = doc.getContent().toString();\n if(content.length() > 2048) {\n content = content.substring(0, 2048);\n }*/\n boolean gateFormat = isGateFIFormat(doc);\n \n\n if(gateFormat) {\n unpackGateFormatMarkup(doc, statusListener);\n } else {\n unpackGeneralXmlMarkup(doc, repInfo, ampCodingInfo, statusListener);\n }\n }", "public void run() {\n try {\r\n TransformerFactory tFactory = TransformerFactory.newInstance();\r\n // Fortify Mod: prevent external entity injection\r\n tFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);\r\n Transformer transformer = tFactory.newTransformer();\r\n transformer.setOutputProperty(\"encoding\", \"UTF-8\");\r\n transformer.setOutputProperty(\"indent\", \"yes\");\r\n transformer.transform(new DOMSource(doc), new StreamResult(\r\n pos));\r\n } catch (Exception e) {\r\n throw new RuntimeException(\r\n \"Error converting Document to InputStream. \"\r\n + e.getMessage());\r\n } finally {\r\n try {\r\n pos.close();\r\n } catch (IOException e) {\r\n\r\n }\r\n }\r\n }", "@Override\n public SentenceBuilder call(SentenceBuilder builder, Map<String, Object> metadata) throws\n ProcessingException {\n\n /*find all substrings matching XML Escape Entities\n in the SentenceBuilder current String*/\n Matcher m = XMLCharacterEntity.EntityPattern.matcher(builder.toString());\n\n int stringIndex = 0;\n SentenceBuilder.Editor editor = builder.edit();\n\n /*for each entity found,\n * ask the editor to replace the entity text\n * with the character it stands for,\n * obtained by asking it to the XMLCharacterEntity*/\n while (m.find()) {\n int start = m.start();\n int end = m.end();\n\n if (stringIndex < start)\n stringIndex = end;\n\n String entity = m.group();\n String c = XMLCharacterEntity.unescape(entity);\n\n if (c != null)\n editor.replace(start, end - start, c);\n }\n editor.commit();\n return builder;\n }", "private void textilize () {\n\n textIndex = 0;\n int textEnd = line.length() - 1;\n listChars = new StringBuffer();\n linkAlias = false;\n while (textIndex < line.length()\n && (Character.isWhitespace(textChar()))) {\n textIndex++;\n }\n while (textEnd >= 0\n && textEnd >= textIndex\n && Character.isWhitespace (line.charAt (textEnd))) {\n textEnd--;\n }\n boolean blankLine = (textIndex >= line.length());\n if (blankLine) {\n textilizeBlankLine();\n }\n else\n if ((textIndex > 0)\n || ((line.length() > 0 )\n && (line.charAt(0) == '<'))) {\n // First character is white space of the beginning of an html tag:\n // Doesn't look like textile... process it without modification.\n }\n else\n if (((textEnd - textIndex) == 3)\n && line.substring(textIndex,textEnd + 1).equals (\"----\")) {\n // && (line.substring(textIndex, (textEnd + 1)).equals (\"----\")) {\n textilizeHorizontalRule(textIndex, textEnd);\n } else {\n textilizeNonBlankLine();\n };\n }", "@Override\n\tpublic void process(JCas aJCas) throws AnalysisEngineProcessException {\n\t\tString text = aJCas.getDocumentText();\n\n\t\t// create an empty Annotation just with the given text\n\t\tAnnotation document = new Annotation(text);\n//\t\tAnnotation document = new Annotation(\"Barack Obama was born in Hawaii. He is the president. Obama was elected in 2008.\");\n\n\t\t// run all Annotators on this text\n\t\tpipeline.annotate(document); \n\t\tList<CoreMap> sentences = document.get(SentencesAnnotation.class);\n\t\t HelperDataStructures hds = new HelperDataStructures();\n\n\t\t\n\t\t//SPnew language-specific settings:\n\t\t//SPnew subject tags of the parser\n\t\t HashSet<String> subjTag = new HashSet<String>(); \n\t\t HashSet<String> dirObjTag = new HashSet<String>(); \n\t\t //subordinate conjunction tags\n\t\t HashSet<String> compTag = new HashSet<String>(); \n\t\t //pronoun tags\n\t\t HashSet<String> pronTag = new HashSet<String>(); \n\t\t \n\t\t HashSet<String> passSubjTag = new HashSet<String>();\n\t\t HashSet<String> apposTag = new HashSet<String>(); \n\t\t HashSet<String> verbComplementTag = new HashSet<String>(); \n\t\t HashSet<String> infVerbTag = new HashSet<String>(); \n\t\t HashSet<String> relclauseTag = new HashSet<String>(); \n\t\t HashSet<String> aclauseTag = new HashSet<String>(); \n\t\t \n\t\t HashSet<String> compLemma = new HashSet<String>(); \n\t\t HashSet<String> coordLemma = new HashSet<String>(); \n\t\t HashSet<String> directQuoteIntro = new HashSet<String>(); \n\t\t HashSet<String> indirectQuoteIntroChunkValue = new HashSet<String>();\n\t\t \n//\t\t HashSet<String> finiteVerbTag = new HashSet<String>();\n\t\t \n\n\t\t //OPEN ISSUES PROBLEMS:\n\t\t //the subject - verb relation finding does not account for several specific cases: \n\t\t //opinion verbs with passive subjects as opinion holder are not accounted for,\n\t\t //what is needed is a marker in the lex files like PASSSUBJ\n\t\t //ex: Obama is worried/Merkel is concerned\n\t\t //Many of the poorer countries are concerned that the reduction in structural funds and farm subsidies may be detrimental in their attempts to fulfill the Copenhagen Criteria.\n\t\t //Some of the more well off EU states are also worried about the possible effects a sudden influx of cheap labor may have on their economies. Others are afraid that regional aid may be diverted away from those who currently benefit to the new, poorer countries that join in 2004 and beyond. \n\t\t// Does not account for infinitival constructions, here again a marker is needed to specify\n\t\t //subject versus object equi\n\t\t\t//Christian Noyer was reported to have said that it is ok.\n\t\t\t//Reuters has reported Christian Noyer to have said that it is ok.\n\t\t //Obama is likely to have said.. \n\t\t //Several opinion holder- opinion verb pairs in one sentence are not accounted for, right now the first pair is taken.\n\t\t //what is needed is to run through all dependencies. For inderect quotes the xcomp value of the embedded verb points to the \n\t\t //opinion verb. For direct quotes the offsets closest to thwe quote are relevant.\n\t\t //a specific treatment of inverted subjects is necessary then. Right now the\n\t\t //strategy relies on the fact that after the first subj/dirobj - verb pair the\n\t\t //search is interrupted. Thus, if the direct object precedes the subject, it is taken as subject.\n\t\t // this is the case in incorrectly analysed inverted subjeects as: said Zwickel on Monday\n\t\t //coordination of subject not accounted for:employers and many economists\n\t\t //several subject-opinion verbs:\n\t\t //Zwickel has called the hours discrepancy between east and west a \"fairness gap,\" but employers and many economists point out that many eastern operations have a much lower productivity than their western counterparts.\n\t\t if (language.equals(\"en\")){\n \t subjTag.add(\"nsubj\");\n \t subjTag.add(\"xsubj\");\n \t subjTag.add(\"nmod:agent\");\n \t \n \t dirObjTag.add(\"dobj\"); //for inverted subject: \" \" said IG metall boss Klaus Zwickel on Monday morning.\n \t \t\t\t\t\t\t//works only with break DEPENDENCYSEARCH, otherwise \"Monday\" is nsubj \n \t \t\t\t\t\t\t//for infinitival subject of object equi: Reuters reports Obama to have said\n \tpassSubjTag.add(\"nsubjpass\");\n \tapposTag.add(\"appos\");\n \trelclauseTag.add(\"acl:relcl\");\n \taclauseTag.add(\"acl\");\n \t compTag.add(\"mark\");\n \t pronTag.add(\"prp\");\n \thds.pronTag.add(\"prp\");\n \tcompLemma.add(\"that\");\n \tcoordLemma.add(\"and\");\n \tverbComplementTag.add(\"ccomp\");\n \tverbComplementTag.add(\"parataxis\");\n\n \tinfVerbTag.add(\"xcomp\"); //Reuters reported Merkel to have said\n \tinfVerbTag.add(\"advcl\");\n \tdirectQuoteIntro.add(\":\");\n \tindirectQuoteIntroChunkValue.add(\"SBAR\");\n \thds.objectEqui.add(\"report\");\n \thds.objectEqui.add(\"quote\");\n \thds.potentialIndirectQuoteTrigger.add(\"say\");\n// \thds.objectEqui.add(\"confirm\");\n// \thds.subjectEqui.add(\"promise\");\n// \thds.subjectEqui.add(\"quote\");\n// \thds.subjectEqui.add(\"confirm\");\n }\n\t\t \n\t\t boolean containsSubordinateConjunction = false;\n\t\t\n\t\t \n\t\tfor (CoreMap sentence : sentences) {\n//\t\t\tSystem.out.println(\"PREPROCESSING..\");\n\t\t\t\tSentenceAnnotation sentenceAnn = new SentenceAnnotation(aJCas);\n\t\t\t\t\n\t\t\t\tint beginSentence = sentence.get(TokensAnnotation.class).get(0)\n\t\t\t\t\t\t.beginPosition();\n\t\t\t\tint endSentence = sentence.get(TokensAnnotation.class)\n\t\t\t\t\t\t.get(sentence.get(TokensAnnotation.class).size() - 1)\n\t\t\t\t\t\t.endPosition();\n\t\t\t\tsentenceAnn.setBegin(beginSentence);\n\t\t\t\tsentenceAnn.setEnd(endSentence);\n\t\t\t\tsentenceAnn.addToIndexes();\n\t\t\t\t\n\t\t\t\t//SP Map offsets to NER\n\t\t\t\tList<NamedEntity> ners = JCasUtil.selectCovered(aJCas, //SPnew tut\n\t\t\t\t\t\tNamedEntity.class, sentenceAnn);\n\t\t\t\tfor (NamedEntity ne : ners){\n//\t\t\t\t\tSystem.out.println(\"NER TYPE: \" + ne.jcasType.toString());\n//\t\t\t\t\tSystem.out.println(\"NER TYPE: \" + ne.getCoveredText().toString());\n//\t\t\t\t\tSystem.out.println(\"NER TYPE: \" + ne.jcasType.casTypeCode);\n\t\t\t\t\t//Person is 71, Location is 213, Organization is 68 geht anders besser siehe unten\n\t\t\t\t\tint nerStart = ne\n\t\t\t\t\t\t\t.getBegin();\n\t\t\t\t\tint nerEnd = ne.getEnd();\n//\t\t\t\t\tSystem.out.println(\"NER: \" + ne.getCoveredText() + \" \" + nerStart + \"-\" + nerEnd ); \n\t\t\t\t\tString offsetNer = \"\" + nerStart + \"-\" + nerEnd;\n\t\t\t\t\thds.offsetToNer.put(offsetNer, ne.getCoveredText());\n//\t\t\t\t\tNer.add(offsetNer);\n\t\t\t\t\thds.Ner.add(offsetNer);\n//\t\t\t\t\tSystem.out.println(\"NER: TYPE \" +ne.getValue().toString());\n\t\t\t\t\tif (ne.getValue().equals(\"PERSON\")){\n\t\t\t\t\t\thds.NerPerson.add(offsetNer);\n\t\t\t\t\t}\n\t\t\t\t\telse if (ne.getValue().equals(\"ORGANIZATION\")){\n\t\t\t\t\t\thds.NerOrganization.add(offsetNer);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//DBpediaLink info: map offsets to links\n\t\t\t\tList<DBpediaResource> dbpeds = JCasUtil.selectCovered(aJCas, //SPnew tut\n\t\t\t\t\t\tDBpediaResource.class, sentenceAnn);\n\t\t\t\tfor (DBpediaResource dbped : dbpeds){\n//\t\t\t\t\t\n//\t\t\t\t\tint dbStart = dbped\n//\t\t\t\t\t\t\t.getBegin();\n//\t\t\t\t\tint dbEnd = dbped.getEnd();\n\t\t\t\t\t// not found if dbpedia offsets are wrongly outside than sentences\n//\t\t\t\t\tSystem.out.println(\"DBPED SENT: \" + sentenceAnn.getBegin()+ \"-\" + sentenceAnn.getEnd() ); \n//\t\t\t\t\tString offsetDB = \"\" + dbStart + \"-\" + dbEnd;\n//\t\t\t\t\thds.labelToDBpediaLink.put(dbped.getLabel(), dbped.getUri());\n//\t\t\t\t\tSystem.out.println(\"NOW DBPED: \" + dbped.getLabel() + \"URI: \" + dbped.getUri() ); \n\t\t\t\t\thds.dbpediaSurfaceFormToDBpediaLink.put(dbped.getCoveredText(), dbped.getUri());\n//\t\t\t\t\tSystem.out.println(\"NOW DBPED: \" + dbped.getCoveredText() + \"URI: \" + dbped.getUri() ); \n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//SP Map offsets to lemma of opinion verb/noun; parser does not provide lemma\n\t\t\t\t for (CoreLabel token: sentence.get(TokensAnnotation.class)) {\n//\t\t\t\t\t System.out.println(\"LEMMA \" + token.lemma().toString());\n\t\t\t\t\t int beginTok = token.beginPosition();\n\t\t\t\t\t int endTok = token.endPosition();\n\t\t\t\t\t String offsets = \"\" + beginTok + \"-\" + endTok;\n\t\t\t\t\t hds.offsetToLemma.put(offsets, token.lemma().toString());\n\t\t\t\t\t \n\t\t\t\t\t \t if (opinion_verbs.contains(token.lemma().toString())){\n\t\t\t\t\t\t\t hds.offsetToLemmaOfOpinionVerb.put(offsets, token.lemma().toString());\n\t\t\t\t\t\t\t hds.OpinionExpression.add(offsets);\n\t\t\t\t\t\t\t hds.offsetToLemmaOfOpinionExpression.put(offsets, token.lemma().toString());\n\t\t\t\t\t\t\t \n//\t\t\t \t System.out.println(\"offsetToLemmaOfOpinionVerb \" + token.lemma().toString());\n\t\t\t\t\t \t }\n\t\t\t\t\t \t if (passive_opinion_verbs.contains(token.lemma().toString())){\n\t\t\t\t\t\t\t hds.offsetToLemmaOfPassiveOpinionVerb.put(offsets, token.lemma().toString());\n\t\t\t\t\t\t\t hds.OpinionExpression.add(offsets);\n\t\t\t\t\t\t\t hds.offsetToLemmaOfOpinionExpression.put(offsets, token.lemma().toString());\n//\t\t\t \t System.out.println(\"offsetToLemmaOfPassiveOpinionVerb \" + token.lemma().toString());\n\t\t\t\t\t \t }\n\n\t\t\t\t } \n\n\t\t\t//SPnew parser\n\t\t\tTree tree = sentence.get(TreeAnnotation.class);\n\t\t\tTreebankLanguagePack tlp = new PennTreebankLanguagePack();\n\t\t\tGrammaticalStructureFactory gsf = tlp.grammaticalStructureFactory();\n\t\t\tGrammaticalStructure gs = gsf.newGrammaticalStructure(tree);\n\t\t\tCollection<TypedDependency> td = gs.typedDependenciesCollapsed();\n\n\t\t\t \n//\t\t\tSystem.out.println(\"TYPEDdep\" + td);\n\t\t\t\n\t\t\tObject[] list = td.toArray();\n//\t\t\tSystem.out.println(list.length);\n\t\t\tTypedDependency typedDependency;\nDEPENDENCYSEARCH: for (Object object : list) {\n\t\t\ttypedDependency = (TypedDependency) object;\n//\t\t\tSystem.out.println(\"DEP \" + typedDependency.dep().toString()+ \n//\t\t\t\t\t\" GOV \" + typedDependency.gov().toString()+ \n//\t\t\t\" :: \"+ \" RELN \"+typedDependency.reln().toString());\n\t\t\tString pos = null;\n String[] elements;\n String verbCand = null;\n int beginVerbCand = -5;\n\t\t\tint endVerbCand = -5;\n\t\t\tString offsetVerbCand = null;\n\n if (compTag.contains(typedDependency.reln().toString())) {\n \tcontainsSubordinateConjunction = true;\n// \tSystem.out.println(\"subordConj \" + typedDependency.dep().toString().toLowerCase());\n }\n \n else if (subjTag.contains(typedDependency.reln().toString())){\n \thds.predicateToSubjectChainHead.clear();\n \thds.subjectToPredicateChainHead.clear();\n \t\n \tverbCand = typedDependency.gov().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.gov().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.gov().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n//\t\t\t\tSystem.out.println(\"VERBCand \" + verbCand + offsetVerbCand);\n//\t\t\t\tfor (HashMap.Entry<String, String> entry : hds.offsetToLemma.entrySet()) {\n//\t\t\t\t String key = entry.getKey();\n//\t\t\t\t Object value = entry.getValue();\n//\t\t\t\t System.out.println(\"OFFSET \" + key + \" LEMMA \" + value);\n//\t\t\t\t // FOR LOOP\n//\t\t\t\t}\n//\t\t\t\tif (hds.offsetToLemma.containsKey(offsetVerbCand)){\n//\t\t\t\t\tString verbCandLemma = hds.offsetToLemma.get(offsetVerbCand);\n//\t\t\t\t\tif (hds.objectEqui.contains(verbCandLemma) || hds.subjectEqui.contains(verbCandLemma)){\n//\t\t\t\t\t\tSystem.out.println(\"SUBJCHAIN BEGIN verbCand \" + verbCand);\n//\t\t\t\t\t\tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t\tSystem.out.println(\"SUBJCHAINHEAD1\");\n\t\t\t\tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n//\t\t\t\tSystem.out.println(\"verbCand \" + verbCand);\n\t\t\t\t//hack for subj after obj said Zwickel (obj) on Monday morning (subj)\n\t\t\t\tif (language.equals(\"en\") \n\t\t\t\t\t\t&& hds.predicateToObject.containsKey(offsetVerbCand)\n\t\t\t\t\t\t){\n// \t\tSystem.out.println(\"CONTINUE DEP\");\n \t\tcontinue DEPENDENCYSEARCH;\n \t}\n\t\t\t\telse {\n\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n\t\t\t\t}\n }\n //Merkel is concerned\n else if (passSubjTag.contains(typedDependency.reln().toString())){\n \t//Merkel was reported\n \t//Merkel was concerned\n \t//Merkel was quoted\n \thds.predicateToSubjectChainHead.clear();\n \thds.subjectToPredicateChainHead.clear();\n \tverbCand = typedDependency.gov().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.gov().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.gov().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n//\t\t\t\tSystem.out.println(\"VERBCand \" + verbCand + offsetVerbCand);\n//\t\t\t\tif (hds.offsetToLemma.containsKey(offsetVerbCand)){\n//\t\t\t\t\tString verbCandLemma = hds.offsetToLemma.get(offsetVerbCand);\n////\t\t\t\t\tSystem.out.println(\"LEMMA verbCand \" + verbCandLemma);\n//\t\t\t\t\tif (hds.objectEqui.contains(verbCandLemma) || hds.subjectEqui.contains(verbCandLemma)){\n//\t\t\t\t\t\tSystem.out.println(\"SUBJCHAIN BEGIN verbCand \" + verbCand);\n//\t\t\t\t\t\tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n//\t\t\t\t\t}\n//\t\t\t\t}\n \t\n \tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n// \tSystem.out.println(\"SUBJCHAINHEAD2\");\n \t//Merkel is concerned\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfPassiveOpinionVerb,\n \t\t\thds);\n }\n //Meanwhile, the ECB's vice-president, Christian Noyer, was reported at the start of the week to have said that the bank's future interest-rate moves\n// would depend on the behavior of wage negotiators as well as the pace of the economic recovery.\n\n else if (apposTag.contains(typedDependency.reln().toString())){\n \t\n \tString subjCand = typedDependency.gov().toString().toLowerCase();\n \tint beginSubjCand = typedDependency.gov().beginPosition();\n \tint endSubjCand = typedDependency.gov().endPosition();\n \tString offsetSubjCand = \"\" + beginSubjCand + \"-\" + endSubjCand;\n \tString appo = typedDependency.dep().toString().toLowerCase();\n\t\t\t\tint beginAppo = typedDependency.dep().beginPosition();\n\t\t\t\tint endAppo = typedDependency.dep().endPosition();\n\t\t\t\tString offsetAppo = \"\" + beginAppo + \"-\" + endAppo;\n\t\t\t\t\n// \tSystem.out.println(\"APPOSITION1 \" + subjCand + \"::\"+ appo + \":\" + offsetSubjCand + \" \" + offsetAppo);\n \thds.subjectToApposition.put(offsetSubjCand, offsetAppo);\n }\n else if (relclauseTag.contains(typedDependency.reln().toString())){\n \tString subjCand = typedDependency.gov().toString().toLowerCase();\n \tint beginSubjCand = typedDependency.gov().beginPosition();\n \tint endSubjCand = typedDependency.gov().endPosition();\n \tString offsetSubjCand = \"\" + beginSubjCand + \"-\" + endSubjCand;\n \tverbCand = typedDependency.dep().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.dep().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.dep().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n\t\t\t\tString subjCandPos = null;\n\t\t\t\tif (hds.predicateToSubject.containsKey(offsetVerbCand)){\n\t\t\t\t\t\n\t\t\t\t\tif (subjCand.matches(\".+?/.+?\")) { \n\t\t\t\t\t\telements = subjCand.split(\"/\");\n\t\t\t\t\t\tsubjCand = elements[0];\n\t\t\t\t\t\tsubjCandPos = elements[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tString del = hds.predicateToSubject.get(offsetVerbCand);\n\t\t\t\t\thds.predicateToSubject.remove(offsetVerbCand);\n\t\t\t\t\thds.subjectToPredicate.remove(del);\n\t\t\t\t\thds.normalPredicateToSubject.remove(offsetVerbCand);\n\t\t\t\t\thds.subjectToNormalPredicate.remove(del);\n//\t\t\t\t\tSystem.out.println(\"REMOVE RELPRO \" + verbCand + \"/\" + hds.offsetToLemma.get(del));\n\t\t\t\t\thds.predicateToSubject.put(offsetVerbCand, offsetSubjCand);\n\t\t\t\t\thds.subjectToPredicate.put( offsetSubjCand, offsetVerbCand);\n\t\t\t\t\thds.normalPredicateToSubject.put(offsetVerbCand, offsetSubjCand);\n\t\t\t\t\thds.subjectToNormalPredicate.put( offsetSubjCand, offsetVerbCand);\n//\t\t\t\t\tSystem.out.println(\"RELCLAUSE \" + subjCand + \"::\" + \":\" + verbCand);\n\t\t\t\t\thds.offsetToSubjectHead.put(offsetSubjCand,subjCand);\n\t\t\t\t\thds.SubjectHead.add(offsetSubjCand);\n\t\t\t\t\t\n\t\t\t\t\tif (subjCandPos != null && hds.pronTag.contains(subjCandPos)){\n\t\t\t\t\t\thds.PronominalSubject.add(offsetSubjCand);\n\t\t\t\t\t}\n\t\t\t\t}\n \t\n \t\n }\n \n else if (dirObjTag.contains(typedDependency.reln().toString())\n \t\t){\n \tstoreRelations(typedDependency, hds.predicateToObject, hds.ObjectToPredicate, hds);\n \tverbCand = typedDependency.gov().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.gov().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.gov().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n\t\t\t\t\n\t\t\t\tString objCand = typedDependency.dep().toString().toLowerCase();\n \tint beginObjCand = typedDependency.dep().beginPosition();\n \tint endObjCand = typedDependency.dep().endPosition();\n \tString offsetObjCand = \"\" + beginObjCand + \"-\" + endObjCand;\n \tString objCandPos;\n \tif (objCand.matches(\".+?/.+?\")) { \n\t\t\t\t\telements = objCand.split(\"/\");\n\t\t\t\t\tobjCand = elements[0];\n\t\t\t\t\tobjCandPos = elements[1];\n//\t\t\t\t\tSystem.out.println(\"PRON OBJ \" + objCandPos);\n\t\t\t\t\tif (pronTag.contains(objCandPos)){\n\t\t\t\t\thds.PronominalSubject.add(offsetObjCand);\n\t\t\t\t\t}\n\t\t\t\t\t}\n// \tSystem.out.println(\"DIROBJ STORE ONLY\");\n \t//told Obama\n \t//said IG metall boss Klaus Zwickel\n \t// problem: pointing DO\n \t//explains David Gems, pointing out the genetically manipulated species.\n \t if (language.equals(\"en\") \n \t\t\t\t\t\t&& !hds.normalPredicateToSubject.containsKey(offsetVerbCand)\n \t\t\t\t\t\t){\n// \t\t System.out.println(\"INVERSE SUBJ HACK ENGLISH PREDTOOBJ\");\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n \t }\n }\n //was reported to have said\n else if (infVerbTag.contains(typedDependency.reln().toString())){\n \tstoreRelations(typedDependency, hds.mainToInfinitiveVerb, hds.infinitiveToMainVerb, hds);\n// \tSystem.out.println(\"MAIN-INF\");\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n \t\n }\n else if (aclauseTag.contains(typedDependency.reln().toString())){\n \tstoreRelations(typedDependency, hds.nounToInfinitiveVerb, hds.infinitiveVerbToNoun, hds);\n// \tSystem.out.println(\"NOUN-INF\");\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n \t\n }\n \n \n\n\t\t\t}\n\t\t\t\n//\t\t\tSemanticGraph dependencies = sentence.get(CollapsedCCProcessedDependenciesAnnotation.class);\n//\t\t\tSystem.out.println(\"SEM-DEP \" + dependencies);\t\n\t\t}\n\t\t\n\n\t\tMap<Integer, edu.stanford.nlp.dcoref.CorefChain> corefChains = document.get(CorefChainAnnotation.class);\n\t\t \n\t\t if (corefChains == null) { return; }\n\t\t //SPCOPY\n\t\t for (Entry<Integer, edu.stanford.nlp.dcoref.CorefChain> entry: corefChains.entrySet()) {\n//\t\t System.out.println(\"Chain \" + entry.getKey() + \" \");\n\t\t \tint chain = entry.getKey();\n\t\t String repMenNer = null;\n\t\t String repMen = null;\n\t\t String offsetRepMenNer = null;\n\n\t\t List<IaiCorefAnnotation> listCorefAnnotation = new ArrayList<IaiCorefAnnotation>();\n\t\t \n\t\t for (CorefMention m : entry.getValue().getMentionsInTextualOrder()) {\n\t\t \tboolean corefMentionContainsNer = false;\n\t\t \tboolean repMenContainsNer = false;\n\n//\t\t \n\n\t\t\t\t// We need to subtract one since the indices count from 1 but the Lists start from 0\n\t\t \tList<CoreLabel> tokens = sentences.get(m.sentNum - 1).get(TokensAnnotation.class);\n\t\t // We subtract two for end: one for 0-based indexing, and one because we want last token of mention not one following.\n//\t\t System.out.println(\" \" + m + \", i.e., 0-based character offsets [\" + tokens.get(m.startIndex - 1).beginPosition() +\n//\t\t \", \" + tokens.get(m.endIndex - 2).endPosition() + \")\");\n\t\t \n\t\t int beginCoref = tokens.get(m.startIndex - 1).beginPosition();\n\t\t\t\t int endCoref = tokens.get(m.endIndex - 2).endPosition();\n\t\t\t\t String offsetCorefMention = \"\" + beginCoref + \"-\" + endCoref;\n\t\t\t\t String corefMention = m.mentionSpan;\n\n\t\t\t\t CorefMention RepresentativeMention = entry.getValue().getRepresentativeMention();\n\t\t\t\t repMen = RepresentativeMention.mentionSpan;\n\t\t\t\t List<CoreLabel> repMenTokens = sentences.get(RepresentativeMention.sentNum - 1).get(TokensAnnotation.class);\n//\t\t\t\t System.out.println(\"REPMEN ANNO \" + \"\\\"\" + repMen + \"\\\"\" + \" is representative mention\" +\n// \", i.e., 0-based character offsets [\" + repMenTokens.get(RepresentativeMention.startIndex - 1).beginPosition() +\n//\t\t \", \" + repMenTokens.get(RepresentativeMention.endIndex - 2).endPosition() + \")\");\n\t\t\t\t int beginRepMen = repMenTokens.get(RepresentativeMention.startIndex - 1).beginPosition();\n\t\t\t\t int endRepMen = repMenTokens.get(RepresentativeMention.endIndex - 2).endPosition();\n\t\t\t\t String offsetRepMen = \"\" + beginRepMen + \"-\" + endRepMen;\n\t\t \t \n\t\t\t\t//Determine repMenNer that consists of largest NER (Merkel) to (Angela Merkel)\n\t\t\t\t //and \"Chancellor \"Angela Merkel\" to \"Angela Merkel\"\n\t\t \t //Further reduction to NER as in \"Chancellor Angela Merkel\" to \"Angela Merkel\" is\n\t\t\t\t //done in determineBestSubject. There, Chunk information and subjectHead info is available.\n\t\t\t\t //Chunk info and subjectHead info is used to distinguish \"Chancellor Angela Merkel\" to \"Angela Merkel\"\n\t\t\t\t //from \"The enemies of Angela Merkel\" which is not reduced to \"Angela Merkel\"\n\t\t\t\t //Problem solved: The corefMentions of a particular chain do not necessarily have the same RepMenNer (RepMen) \n\t\t\t\t // any more: Chancellor Angela Merkel repMenNer Chancellor Angela Merkel , then Angela Merkel has RepMenNer Angela Merkel\n\t\t\t\t if (offsetRepMenNer != null && hds.Ner.contains(offsetRepMenNer)){\n//\t\t\t\t\t System.out.println(\"NEWNer.contains(offsetRepMenNer)\");\n\t\t\t\t }\n\t\t\t\t else if (offsetRepMen != null && hds.Ner.contains(offsetRepMen)){\n\t\t\t\t\t repMenNer = repMen;\n\t\t\t\t\t\toffsetRepMenNer = offsetRepMen;\n//\t\t\t\t\t\tSystem.out.println(\"NEWNer.contains(offsetRepMen)\");\n\t\t\t\t }\n\t\t\t\t else if (offsetCorefMention != null && hds.Ner.contains(offsetCorefMention)){\n\t\t\t\t\t\trepMenNer = corefMention;\n\t\t\t\t\t\toffsetRepMenNer = offsetCorefMention;\n//\t\t\t\t\t\tSystem.out.println(\"Ner.contains(offsetCorefMention)\");\n\t\t\t\t\t}\n\t\t\t\t else {\n\t\t\t\t\t corefMentionContainsNer = offsetsContainAnnotation(offsetCorefMention,hds.Ner);\n\t\t\t\t\t repMenContainsNer = offsetsContainAnnotation(offsetRepMen,hds.Ner);\n//\t\t\t\t\t System.out.println(\"ELSE Ner.contains(offsetCorefMention)\");\n\t\t\t\t }\n\t\t\t\t //Determine repMenNer that contains NER\n\t\t\t\t\tif (repMenNer == null){\n\t\t\t\t\t\tif (corefMentionContainsNer){\n\t\t\t\t\t\t\trepMenNer = corefMention;\n\t\t\t\t\t\t\toffsetRepMenNer = offsetCorefMention;\n//\t\t\t\t\t\t\tSystem.out.println(\"DEFAULT1\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (repMenContainsNer){\n\t\t\t\t\t\t\trepMenNer = repMen;\n\t\t\t\t\t\t\toffsetRepMenNer = offsetRepMen;\n//\t\t\t\t\t\t\tSystem.out.println(\"DEFAULT2\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//no NER:\n\t\t\t\t\t\t//Pronoun -> repMen is repMenNer\n\t\t\t\t\t\telse if (hds.PronominalSubject.contains(offsetCorefMention) && repMen != null){\n\t\t\t\t\t\t\trepMenNer = repMen;\n\t\t\t\t\t\t\toffsetRepMenNer = offsetRepMen;\n//\t\t\t\t\t\t\tSystem.out.println(\"DEFAULT3\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t//other no NER: corefMention is repMenNer because it is closer to original\n\t\t\t\t\t\trepMenNer = corefMention;\n\t\t\t\t\t\toffsetRepMenNer = offsetCorefMention;\n//\t\t\t\t\t\tSystem.out.println(\"DEFAULT4\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t \n \t IaiCorefAnnotation corefAnnotation = new IaiCorefAnnotation(aJCas);\n\t\t\t\n\t\t\t\t\t\n\n\n\t\t\t\t\tcorefAnnotation.setBegin(beginCoref);\n\t\t\t\t\tcorefAnnotation.setEnd(endCoref);\n\t\t\t\t\tcorefAnnotation.setCorefMention(corefMention);\n\t\t\t\t\tcorefAnnotation.setCorefChain(chain);\n\t\t\t\t\t//done below\n//\t\t\t\t\tcorefAnnotation.setRepresentativeMention(repMenNer);\n//\t\t\t\t\tcorefAnnotation.addToIndexes(); \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tlistCorefAnnotation.add(corefAnnotation);\n\t\t\t\t\t\n//\t\t\t\t\tdone below:\n//\t\t\t\t\t offsetToRepMen.put(offsetCorefMention, repMenNer);\n//\t\t\t\t\t RepMen.add(offsetCorefMention);\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t }//end coref mention\n//\t\t System.out.println(\"END Chain \" + chain );\n//\t\t System.out.println(listCorefAnnotation.size());\n\t\t String offsetCorefMention = null;\n\t\t for (int i = 0; i < listCorefAnnotation.size(); i++) {\n\t\t \tIaiCorefAnnotation corefAnnotation = listCorefAnnotation.get(i);\n\t\t \tcorefAnnotation.setRepresentativeMention(repMenNer);\n\t\t \tcorefAnnotation.addToIndexes();\n\t\t \toffsetCorefMention = \"\" + corefAnnotation.getBegin() + \"-\" + corefAnnotation.getEnd();\n\t\t\t\t\thds.offsetToRepMen.put(offsetCorefMention, repMenNer);\n\t\t\t\t\thds.RepMen.add(offsetCorefMention);\n\t\t\t\t\t//COREF\n//\t\t\t\t\tSystem.out.println(\"Chain \" + corefAnnotation.getCorefChain());\n//\t\t\t\t\tSystem.out.println(\"corefMention \" + corefAnnotation.getCorefMention() + offsetCorefMention);\n//\t\t\t\t\tSystem.out.println(\"repMenNer \" + repMenNer);\n\t\t }\n\t\t } //end chains\n\n\n//\t\t System.out.println(\"NOW quote finder\");\n\n\n\t\t\n\t\t///* quote finder: begin find quote relation and quotee\n\t\t// direct quotes\n\t\t\n\t\t\n\t\tString quotee_left = null;\n\t\tString quotee_right = null; \n\t\t\n\t\tString representative_quotee_left = null;\n\t\tString representative_quotee_right = null; \n\t\t\n\t\tString quote_relation_left = null;\n\t\tString quote_relation_right = null;\n\t\t\n\t\tString quoteType = null;\n\t\tint quoteeReliability = 5;\n\t\tint quoteeReliability_left = 5;\n\t\tint quoteeReliability_right = 5;\n\t\tint quotee_end = -5;\n\t\tint quotee_begin = -5;\n\t\t\n\t\tboolean quoteeBeforeQuote = false;\n\n\n\t\n\t\t\n\t\t// these are all the quotes in this document\n\t\tList<CoreMap> quotes = document.get(QuotationsAnnotation.class);\n\t\tfor (CoreMap quote : quotes) {\n\t\t\tif (quote.get(TokensAnnotation.class).size() > 5) {\n\t\t\t\tQuoteAnnotation annotation = new QuoteAnnotation(aJCas);\n\n\t\t\t\tint beginQuote = quote.get(TokensAnnotation.class).get(0)\n\t\t\t\t\t\t.beginPosition();\n\t\t\t\tint endQuote = quote.get(TokensAnnotation.class)\n\t\t\t\t\t\t.get(quote.get(TokensAnnotation.class).size() - 1)\n\t\t\t\t\t\t.endPosition();\n\t\t\t\tannotation.setBegin(beginQuote);\n\t\t\t\tannotation.setEnd(endQuote);\n\t\t\t\tannotation.addToIndexes();\n//\t\t\t}\n//\t\t}\n//\t\t\n//\t\tList<Q> newQuotes = document.get(QuotationsAnnotation.class);\t\t\n//\t\tfor (CoreMap annotation : newQuotes) {\n//\t\t\t\tif (1==1){\n//\t\t\t\tRe-initialize markup variables since they are also used for indirect quotes\n\t\t\t\tquotee_left = null;\n\t\t\t\tquotee_right = null; \n\t\t\t\t\n\t\t\t\trepresentative_quotee_left = null;\n\t\t\t\trepresentative_quotee_right = null;\n\t\t\t\t\n\t\t\t\tquote_relation_left = null;\n\t\t\t\tquote_relation_right = null;\n\t\t\t\tquoteeReliability = 5;\n\t\t\t\tquoteeReliability_left = 5;\n\t\t\t\tquoteeReliability_right = 5;\n\t\t\t\tquotee_end = -5;\n\t\t\t\tquotee_begin = -5;\n\t\t\t\tquoteType = \"direct\";\n\t\t\t\tquoteeBeforeQuote = false;\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tList<Token> directQuoteTokens = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\tToken.class, annotation);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tList<Token> followTokens = JCasUtil.selectFollowing(aJCas,\n\t\t\t\t\t\tToken.class, annotation, 1);\n\t\t\t\t\n \n//\t\t\t\tfor (Token aFollowToken: followTokens){\n//\t\t\t\t\t List<Chunk> chunks = JCasUtil.selectCovering(aJCas,\n//\t\t\t\t\tChunk.class, aFollowToken);\n \n//direct quote quotee right:\n\t\t\t\t\n\t for (Token aFollow2Token: followTokens){\n\t\t\t\t\t List<SentenceAnnotation> sentencesFollowQuote = JCasUtil.selectCovering(aJCas,\n\t\t\t\t\t\t\t SentenceAnnotation.class, aFollow2Token);\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t for (SentenceAnnotation sentenceFollowsQuote: sentencesFollowQuote){\n\t\t\t\t\t\t List<Chunk> chunks = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\tChunk.class, sentenceFollowsQuote);\n//\t\t\tSystem.out.println(\"DIRECT QUOTE RIGHT\");\n\t\t\tString[] quote_annotation_result = determine_quotee_and_quote_relation(\"RIGHT\", \n\t\t\t\t\tchunks, hds, annotation);\n\t\t\tif (quote_annotation_result.length>=4){\n\t\t\t quotee_right = quote_annotation_result[0];\n\t\t\t representative_quotee_right = quote_annotation_result[1];\n\t\t\t quote_relation_right = quote_annotation_result[2];\n\t\t\t try {\n\t\t\t\t quoteeReliability = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t quoteeReliability_right = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t //Will Throw exception!\n\t\t\t //do something! anything to handle the exception.\n\t\t\t\tquoteeReliability = -5;\n\t\t\t\tquoteeReliability_right = -5;\n\t\t\t\t}\t\t\t\t\t \n\t\t\t }\n//\t\t\tSystem.out.println(\"DIRECT QUOTE RIGHT RESULT quotee \" + quotee_right + \" representative_quotee \" + representative_quotee_right\n//\t\t\t\t\t+ \" quote_relation \" + quote_relation_right);\n\t\t \n\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\t \n }\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tList<Token> precedingTokens = JCasUtil.selectPreceding(aJCas,\n\t\t\t\t\t\tToken.class, annotation, 1);\n for (Token aPrecedingToken: precedingTokens){ \n \t\n \tif (directQuoteIntro.contains(aPrecedingToken.getLemma().getValue().toString()) \n \t\t\t|| compLemma.contains(aPrecedingToken.getLemma().getValue().toString())) {\n// \t\tSystem.out.println(\"Hello, World lemma found\" + aPrecedingToken.getLemma().getValue());\n \t\tquoteeBeforeQuote = true;\n \t}\n \t\tList <NamedEntity> namedEntities = null;\n \t\tList <Token> tokens = null;\n \t\tList<Chunk> chunks = null;\n \t\t\n\t\t\t\t List<Sentence> precedingSentences = JCasUtil.selectPreceding(aJCas,\n\t\t\t\t \t\tSentence.class, aPrecedingToken, 1);\n\t\t\t\t \n\t\t\t\t\t\tif (precedingSentences.isEmpty()){\n\t\t\t\t\t\t\tList<Sentence> firstSentence;\n\t\t\t\t \tfirstSentence = JCasUtil.selectCovering(aJCas,\n\t\t\t\t \t\tSentence.class, aPrecedingToken);\n\n\t\t\t\t \tfor (Sentence aSentence: firstSentence){\n\t\t\t\t \t\t\n\n\t\t\t\t\t\t\t\tchunks = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\t\tChunk.class, aSentence.getBegin(), aPrecedingToken.getEnd());\n\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t \t\tnamedEntities = JCasUtil.selectCovered(aJCas,\n\t \t \t\tNamedEntity.class, aSentence.getBegin(), aPrecedingToken.getEnd());\n\t\t\t\t \t\ttokens = JCasUtil.selectCovered(aJCas,\n\t\t\t\t \t\t\t\tToken.class, aSentence.getBegin(), aPrecedingToken.getEnd());\n\t\t\t\t \t\n\t\t\t\t \t}\n\t\t\t\t\t\t}\n\t\t\t\t else {\t\n\t\t\t\t \tfor (Sentence aSentence: precedingSentences){\n//\t\t\t\t \t\tSystem.out.println(\"Hello, World sentence\" + aSentence);\n\t\t\t\t \t\tchunks = JCasUtil.selectBetween(aJCas,\n\t\t\t\t \t\t\t\tChunk.class, aSentence, aPrecedingToken);\n\t\t\t\t \t\tnamedEntities = JCasUtil.selectBetween(aJCas,\n\t\t\t\t \t\t\t\tNamedEntity.class, aSentence, aPrecedingToken);\n\t\t\t\t \t\ttokens = JCasUtil.selectBetween(aJCas,\n\t\t\t\t \t\t\t\tToken.class, aSentence, aPrecedingToken);\n\t\t\t\t \t}\n\t\t\t\t }\n \t\n//\t\t\t\t \n//\t\t\t\t\t\tSystem.out.println(\"DIRECT QUOTE LEFT\");\n\t\t\t\t\t\tString[] quote_annotation_direct_left = determine_quotee_and_quote_relation(\"LEFT\", chunks,\n\t\t\t\t\t\t\t\t hds, annotation\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t );\n//\t\t\t\t\t\tSystem.out.println(\"QUOTE ANNOTATION \" + quote_annotation_direct_left.length);\t\t\n\t\tif (quote_annotation_direct_left.length>=4){\n//\t\t\tSystem.out.println(\"QUOTE ANNOTATION UPDATE \" + quote_annotation_direct_left[0] +\n//\t\t\t\t\t\" \" + quote_annotation_direct_left[1] + \" \" +\n//\t\t\t\t\tquote_annotation_direct_left[2]);\n\t\t quotee_left = quote_annotation_direct_left[0];\n\t\t representative_quotee_left = quote_annotation_direct_left[1];\n\t\t quote_relation_left = quote_annotation_direct_left[2];\n\t\t try {\n\t\t\t quoteeReliability = Integer.parseInt(quote_annotation_direct_left[3]);\n\t\t\t quoteeReliability_left = Integer.parseInt(quote_annotation_direct_left[3]);\n\t\t\t} catch (NumberFormatException e) {\n\t\t //Will Throw exception!\n\t\t //do something! anything to handle the exception.\n\t\t\tquoteeReliability = -5;\n\t\t\tquoteeReliability_left = -5;\n\t\t\t}\t\t\t\t\t \n\t\t }\n//\t\tSystem.out.println(\"DIRECT QUOTE LEFT RESULT quotee \" + quotee_left + \" representative_quotee \" + representative_quotee_left\n//\t\t\t\t+ \" quote_relation \" + quote_relation_left);\n\t\t//no subject - predicate quotee quote_relation, quote introduced with colon: \n\t\tif (quotee_left == null && quote_relation_left == null && representative_quotee_left == null \n\t\t&& directQuoteIntro.contains(aPrecedingToken.getLemma().getValue().toString())){\n//\t\t\tSystem.out.println(\"NER DIRECT QUOTE LEFT COLON\");\n\t\t\tString quoteeCandOffset = null; \n\t\t\tString quoteeCandText = null;\n\t\t if (namedEntities.size() == 1){\n \t \tfor (NamedEntity ne : namedEntities){\n// \t \t\tSystem.out.println(\"ONE NER \" + ne.getCoveredText());\n \t \t\tquoteeCandText = ne.getCoveredText();\n\t\t\t\t\tquote_relation_left = aPrecedingToken.getLemma().getValue().toString();\n\t\t\t\t\tquotee_end = ne.getEnd();\n\t\t\t\t\tquotee_begin = ne.getBegin();\n\t\t\t\t\tquoteeCandOffset = \"\" + quotee_begin + \"-\" + quotee_end;\n\t\t\t\t\tquoteeReliability = 1;\n\t\t\t\t\tquoteeReliability_left = 1;\n \t }\n \t }\n \t else if (namedEntities.size() > 1) {\n \t \tint count = 0;\n \t \tString quotee_cand = null;\n// \t \tSystem.out.println(\"Hello, World ELSE SEVERAL NER\");\n \t \tfor (NamedEntity ner : namedEntities){\n// \t \t\tSystem.out.println(\"Hello, World NER TYPE\" + ner.getValue());\n \t \t\tif (ner.getValue().equals(\"PERSON\")){\n \t \t\t\tcount = count + 1;\n \t \t\t\tquotee_cand = ner.getCoveredText();\n \t \t\t\tquotee_end = ner.getEnd();\n \t \t\t\tquotee_begin = ner.getBegin();\n \t \t\t\tquoteeCandOffset = \"\" + quotee_begin + \"-\" + quotee_end;\n \t \t\t\t\n// \t \t\t\tSystem.out.println(\"Hello, World FOUND PERSON\" + quotee_cand);\n \t \t\t}\n \t \t}\n \t \tif (count == 1){ // there is exactly one NER.PERSON\n// \t \t\tSystem.out.println(\"ONE PERSON, SEVERAL NER \" + quotee_cand);\n \t \t\t\tquoteeCandText = quotee_cand;\n\t\t\t\t\t\tquote_relation_left = aPrecedingToken.getLemma().getValue().toString();\n\t\t\t\t\t\tquoteeReliability = 3;\n\t\t\t\t\t\tquoteeReliability_left = 3;\n \t \t}\n \t }\n\t\t if(quoteeCandOffset != null && quoteeCandText != null ){\n//\t\t \t quotee_left = quoteeCandText;\n\t\t \t String result [] = determineBestRepMenSubject(\n\t\t \t\t\t quoteeCandOffset,quoteeCandOffset, quoteeCandText, hds);\n\t\t \t if (result.length>=2){\n\t\t \t\t quotee_left = result [0];\n\t\t \t\t representative_quotee_left = result [1];\n//\t\t \t System.out.println(\"RESULT2 NER quotee \" + quotee_left + \" representative_quotee \" + representative_quotee_left);\n\t\t \t }\n\t\t }\n\t\t}\n }\n\t\t\n \n\n\t\t\t\t\n\t\t\t\tif (quotee_left != null && quotee_right != null){\n//\t\t\t\t\tSystem.out.println(\"TWO QUOTEES\");\n\t\t\t\t\t\n\t\t\t\t\tif (directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\".\") \n\t\t\t\t\t\t|| \tdirectQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"!\")\n\t\t\t\t\t\t|| directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"?\")\n\t\t\t\t\t\t\t){\n//\t\t\t\t\t\tSystem.out.println(\"PUNCT \" + quotee_left + quote_relation_left + quoteeReliability_left);\n\t\t\t\t\t\tannotation.setQuotee(quotee_left);\n\t\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_left);\n\n\t\t\t\t\t}\n\t\t\t\t\telse if (directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\",\")){\n//\t\t\t\t\t\tSystem.out.println(\"COMMA \" + quotee_right + \" \" + quote_relation_right + \" \" + quoteeReliability_right);\n\t\t\t\t\t\tannotation.setQuotee(quotee_right);\n\t\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_right);\n\t\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_right);\n\t\t\t\t\t}\n\t\t\t\t\telse if (!directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\".\")\n\t\t\t\t\t\t\t&& !directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"!\")\n\t\t\t\t\t\t\t&& !directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"?\")\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t){\n//\t\t\t\t\t\tSystem.out.println(\"NO PUNCT \" + quotee_right + \" \" + quote_relation_right + \" \" + quoteeReliability_right);\n\t\t\t\t\t\tannotation.setQuotee(quotee_right);\n\t\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_right);\n\t\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_right);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n//\t\t\t\t\t\tSystem.out.println(\"UNCLEAR LEFT RIGHT \" + quotee_left + quote_relation_left + quote + quotee_right + quote_relation_right);\n\t\t\t\t\tannotation.setQuotee(\"<unclear>\");\n\t\t\t\t\tannotation.setQuoteRelation(\"<unclear>\");\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (quoteeBeforeQuote == true){\n\t\t\t\t\tannotation.setQuotee(quotee_left);\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t}\n\t\t\t\telse if (quotee_left != null){\n//\t\t\t\t\tSystem.out.println(\"QUOTEE LEFT\" + quotee_left + quote_relation_left + quoteeReliability_left);\n\t\t\t\t\tannotation.setQuotee(quotee_left);\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t}\n\t\t\t\telse if (quotee_right != null){\n//\t\t\t\t\tSystem.out.println(\"QUOTEE RIGHT FOUND\" + quotee_right + \" QUOTE RELATION \" + quote_relation_right + \":\" + quoteeReliability_right);\n\t\t\t\t\tannotation.setQuotee(quotee_right);\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_right);\n\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_right);\n\t\t\t\t}\n\t\t\t\telse if (quote_relation_left != null ){\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n//\t\t\t\t\tSystem.out.println(\"NO QUOTEE FOUND\" + quote + quote_relation_left + quote_relation_right);\n\t\t\t\t}\n\t\t\t\telse if (quote_relation_right != null){\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t}\n\t\t\t\telse if (quoteType != null){\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n//\t\t\t\t\tSystem.out.println(\"Hello, World NO QUOTEE and NO QUOTE RELATION FOUND\" + quote);\n\t\t\t\t}\n\t\t\t\tif (annotation.getRepresentativeQuoteeMention() != null){\n//\t\t\t\t\tSystem.out.println(\"NOW!!\" + annotation.getRepresentativeQuoteeMention());\n\t\t\t\t\tif (hds.dbpediaSurfaceFormToDBpediaLink.containsKey(annotation.getRepresentativeQuoteeMention())){\n\t\t\t\t\t\tannotation.setQuoteeDBpediaUri(hds.dbpediaSurfaceFormToDBpediaLink.get(annotation.getRepresentativeQuoteeMention()));\n//\t\t\t\t\t\tSystem.out.println(\"DBPRED FOUND\" + annotation.getRepresentativeQuoteeMention() + \" URI: \" + annotation.getQuoteeDBpediaUri());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} //for direct quote\n\t\t\n\t\t// annotate indirect quotes: opinion verb + 'that' ... until end of sentence: said that ...\n\n//\t\tList<CoreMap> sentences = document.get(SentencesAnnotation.class); //already instantiated above\nINDIRECTQUOTE:\t\tfor (CoreMap sentence : sentences) {\n//\t\t\tif (sentence.get(TokensAnnotation.class).size() > 5) { \n\t\t\t\tSentenceAnnotation sentenceAnn = new SentenceAnnotation(aJCas);\n\t\t\t\t\n\t\t\t\tint beginSentence = sentence.get(TokensAnnotation.class).get(0)\n\t\t\t\t\t\t.beginPosition();\n\t\t\t\tint endSentence = sentence.get(TokensAnnotation.class)\n\t\t\t\t\t\t.get(sentence.get(TokensAnnotation.class).size() - 1)\n\t\t\t\t\t\t.endPosition();\n\t\t\t\tsentenceAnn.setBegin(beginSentence);\n\t\t\t\tsentenceAnn.setEnd(endSentence);\n//\t\t\t\tsentenceAnn.addToIndexes();\n\t\t\t\t\n\t\t\t\tQuoteAnnotation indirectQuote = new QuoteAnnotation(aJCas);\n\t \tint indirectQuoteBegin = -5;\n\t\t\t\tint indirectQuoteEnd = -5;\n\t\t\t\tboolean subsequentDirectQuoteInstance = false;\n\t\t\t\t\n\t\t\t\tList<Chunk> chunksIQ = JCasUtil.selectCovered(aJCas,\n\t\t\t\tChunk.class, sentenceAnn);\n\t\t\t\tList<Chunk> chunksBeforeIndirectQuote = null;\n\t\t\t\t\n\t\t\t\tint index = 0;\nINDIRECTCHUNK:\tfor (Chunk aChunk : chunksIQ) {\n\t\t\t\t\tindex++;\n\t\t\t\t\t\n//\t\t\t\t\tSystem.out.println(\"INDIRECT QUOTE CHUNK VALUE \" + aChunk.getChunkValue().toString());\n//\t\t\t\t\tif (aChunk.getChunkValue().equals(\"SBAR\")) {\n\t\t\t\t\tif(indirectQuoteIntroChunkValue.contains(aChunk.getChunkValue())){\n//\t\t\t\t\t\tSystem.out.println(\"INDIRECT QUOTE INDEX \" + \"\" + index);\n\t\t\t\t\t\t\n\t\t\t\t\t\tList<Token> tokensSbar = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\tToken.class, aChunk);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (Token aTokenSbar : tokensSbar){\n//\t\t\t\t\t\t\tString that = \"that\";\n\t\t\t\t\t\t\tif (compLemma.contains(aTokenSbar.getLemma().getCoveredText())){\n\t\t\t\t\t\t// VP test: does that clause contain VP?\n//\t\t\t\t\t\t\t\tSystem.out.println(\"TOK1\" + aTokenSbar.getLemma().getCoveredText());\n//\t\t\t \tQuoteAnnotation indirectQuote = new QuoteAnnotation(aJCas);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t indirectQuoteBegin = aChunk.getEnd() + 1;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t chunksBeforeIndirectQuote = chunksIQ.subList(0, index-1);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//NEW\n//\t\t\t\t\t\t\t\tif (LANGUAGE == \"en\")\n\t\t\t\t\t\t\t\tList<Token> precedingSbarTokens = JCasUtil.selectPreceding(aJCas,\n\t\t\t\t\t\t\t\t\t\tToken.class, aChunk, 1);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfor (Token aPrecedingSbarToken: precedingSbarTokens){ \n//\t\t\t\t\t\t\t\t\tSystem.out.println(\"TOK2\" + aPrecedingSbarToken.getLemma().getCoveredText());\n\t\t\t\t \tif (coordLemma.contains(aPrecedingSbarToken.getLemma().getValue().toString())){\n//\t\t\t\t \t\tSystem.out.println(\"TOKK\" + aPrecedingSbarToken.getLemma().getCoveredText());\n\t\t\t\t \t\tchunksBeforeIndirectQuote = chunksIQ.subList(0, index-1);\n\t\t\t\t \t\tint k = 0;\n\t\t\t\t \tSAY:\tfor (Chunk chunkBeforeAndThat : chunksBeforeIndirectQuote){\n//\t\t\t\t \t\t\txxxx\n\t\t\t\t \t\tk++;\n\t\t\t\t \t\t\tif (chunkBeforeAndThat.getChunkValue().equals(\"VP\")){\n\t\t\t\t \t\t\t\t\n\t\t\t\t \t\t\t\tList<Token> tokensInVp = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tToken.class, chunkBeforeAndThat);\n\t\t\t\t\t\t\t\t\t\t\t\tfor (Token aTokenInVp : tokensInVp){\n//\t\t\t\t\t\t\t\t\t\t\t\t\tString and;\n//\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"TOKK\" + aTokenInVp.getLemma().getCoveredText());\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (aTokenInVp.getLemma().getValue().equals(\"say\")){\n//\t\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"SAY OLD\" + indirectQuoteBegin + \":\" + sentenceAnn.getCoveredText());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tchunksBeforeIndirectQuote = chunksIQ.subList(0, k);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tindirectQuoteBegin = chunksBeforeIndirectQuote.get(chunksBeforeIndirectQuote.size()-1).getEnd()+1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"SAY NEW\" + indirectQuoteBegin + \":\" );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak SAY;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t \t\t\t\t\n\t\t\t\t \t\t\t\t\n\t\t\t\t \t\t\t}\n\t\t\t\t \t\t\t\n\t\t\t\t \t\t\t\n\t\t\t\t \t\t}\n\t\t\t\t \t\t\n\t\t\t\t \t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tList<QuoteAnnotation> coveringDirectQuoteChunk = JCasUtil.selectCovering(aJCas,\n\t\t\t\t\t\t\t\t\t\tQuoteAnnotation.class, aChunk);\n\t\t\t\t\t\t\t\tif (coveringDirectQuoteChunk.isEmpty()){\n//\t\t\t\t\t\t\t\t indirectQuoteBegin = aChunk.getEnd() + 1;\n\t\t\t\t\t\t\t\t indirectQuote.setBegin(indirectQuoteBegin);\n//\t\t\t\t\t\t\t\t chunksBeforeIndirectQuote = chunksIQ.subList(0, index-1);\n\t\t\t\t\t\t\t\t indirectQuoteEnd = sentenceAnn.getEnd();\n\t\t\t\t\t\t\t\t indirectQuote.setEnd(indirectQuoteEnd);\n\t\t\t\t\t\t\t\t indirectQuote.addToIndexes();\n\t\t\t\t\t\t\t\t subsequentDirectQuoteInstance = false;\n//\t\t\t\t\t\t\t\t System.out.println(\"SUBSEQUENT FALSE\");\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t List<Token> followTokens = JCasUtil.selectFollowing(aJCas,\n\t\t\t\t\t\t\t\t\t\t\tToken.class, indirectQuote, 1);\n\t\t\t\t\t\t\t\t for (Token aFollow3Token: followTokens){\n\t\t\t\t\t\t\t\t\t List<QuoteAnnotation> subsequentDirectQuotes = JCasUtil.selectCovering(aJCas,\n\t\t\t\t\t\t\t\t\t\t\tQuoteAnnotation.class,aFollow3Token);\n\t\t\t\t\t\t\t\t\t if (!subsequentDirectQuotes.isEmpty()){\n\t\t\t\t\t\t\t\t\t\t for (QuoteAnnotation subsequentDirectQuote: subsequentDirectQuotes){\n\t\t\t\t\t\t\t\t\t\t\t if (subsequentDirectQuote.getRepresentativeQuoteeMention() != null\n\t\t\t\t\t\t\t\t\t\t\t\t && subsequentDirectQuote.getRepresentativeQuoteeMention().equals(\"<unclear>\")){\n//\t\t\t\t\t\t\t\t\t\t\t System.out.println(\"SUBSEQUENT FOUND\"); \n\t\t\t\t\t\t\t\t\t\t\t hds.subsequentDirectQuote = subsequentDirectQuote;\n\t\t\t\t\t\t\t\t\t\t\t subsequentDirectQuoteInstance = true;\n\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t break INDIRECTCHUNK;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\n\t\t\t\t}\n\t\t\t\t\tif (indirectQuoteBegin >= 0 && indirectQuoteEnd >= 0){\n//\t\t\t\t\t\tList<QuoteAnnotation> coveringDirectQuote = JCasUtil.selectCovering(aJCas,\n//\t\t\t\t\t\t\t\tQuoteAnnotation.class, indirectQuote);\n//\t\t\t\t\t\tif (coveringDirectQuote.isEmpty()){\n////\t\t\t\t\t\t\t\n//\t\t\t\t\t\tindirectQuote.addToIndexes();\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\telse {\n//\t\t\t\t\t\t\t//indirect quote is covered by direct quote and therefore discarded\n//\t\t\t\t\t\t\tcontinue INDIRECTQUOTE;\n//\t\t\t\t\t\t}\n\t\t\t\t\tList<QuoteAnnotation> coveredDirectQuotes = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\tQuoteAnnotation.class, indirectQuote);\n\t\t\t\t\tfor (QuoteAnnotation coveredDirectQuote : coveredDirectQuotes){\n//\t\t\t\t\t\tSystem.out.println(\"Hello, World covered direct quote\" + coveredDirectQuote.getCoveredText());\n\t\t\t\t\t\t//delete coveredDirectQuoteIndex\n\t\t\t\t\t\tcoveredDirectQuote.removeFromIndexes();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t//no indirect quote in sentence\n\t\t\t\t\t\tcontinue INDIRECTQUOTE;\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n//\t\t\t\t\t\tRe-initialize markup variables since they are also used for direct quotes\n\t\t\t\t\t\tquotee_left = null;\n\t\t\t\t\t\tquotee_right = null; \n\t\t\t\t\t\t\n\t\t\t\t\t\trepresentative_quotee_left = null;\n\t\t\t\t\t\trepresentative_quotee_right = null;\n\t\t\t\t\t\t\n\t\t\t\t\t\tquote_relation_left = null;\n\t\t\t\t\t\tquote_relation_right = null;\n\t\t\t\t\t\t\n\t\t\t\t\t\tquoteType = \"indirect\";\n\t\t\t\t\t\tquoteeReliability = 5;\n\t\t\t\t\t\tquoteeReliability_left = 5;\n\t\t\t\t\t\tquoteeReliability_right = 5;\n\t\t\t\t\t\tquotee_end = -5;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\tif (chunksBeforeIndirectQuote != null){\n//\t\t\t\t\t\t\tSystem.out.println(\"chunksBeforeIndirectQuote FOUND!! \");\n\t\t\t\t\t\t\tString[] quote_annotation_result = determine_quotee_and_quote_relation(\"LEFT\", chunksBeforeIndirectQuote,\n\t\t\t\t\t\t\t\t\t hds, indirectQuote\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t );\n\t\t\tif (quote_annotation_result.length>=4){\n\t\t\t quotee_left = quote_annotation_result[0];\n\t\t\t representative_quotee_left = quote_annotation_result[1];\n\t\t\t quote_relation_left = quote_annotation_result[2];\n//\t\t\t System.out.println(\"INDIRECT QUOTE LEFT RESULT quotee \" + quotee_left + \" representative_quotee \" + representative_quotee_left\n//\t\t\t\t\t + \" QUOTE RELATION \" + quote_relation_left);\n\t\t\t try {\n\t\t\t\t quoteeReliability = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t quoteeReliability_left = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\tquoteeReliability = -5;\n\t\t\t\tquoteeReliability_left = -5;\n\t\t\t\t}\t\t\t\t\t \n\t\t\t }\n\t\t\t\n\t\t\t}\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (quotee_left != null){\n\t\t\t\t\t\t\tindirectQuote.setQuotee(quotee_left);\n\t\t\t\t\t\t\tindirectQuote.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\t\tindirectQuote.setQuoteType(quoteType);\n\t\t\t\t\t\t\tindirectQuote.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\t\t\tindirectQuote.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//indirect quote followed by direct quote:\n\t\t\t\t\t\t\t//the quotee and quote relation of the indirect quote are copied to the direct quote \n\t\t\t\t\t\t\t//Genetic researcher Otmar Wiestler hopes that the government's strict controls on genetic research \n\t\t\t\t\t\t\t//will be relaxed with the advent of the new ethics commission. \n\t\t\t\t\t\t\t//\"For one thing the government urgently needs advice, because of course it's such an extremely \n\t\t\t\t\t\t\t//complex field. And one of the reasons Chancellor Schröder formed this new commission was without \n\t\t\t\t\t\t\t//a doubt to create his own group of advisors.\"\n\n\t\t\t\t\t\t\tif (subsequentDirectQuoteInstance == true\n\t\t\t\t\t\t\t\t&&\thds.subsequentDirectQuote.getRepresentativeQuoteeMention().equals(\"<unclear>\")\n\t\t\t\t\t\t\t\t&& \thds.subsequentDirectQuote.getQuotee().equals(\"<unclear>\")\n\t\t\t\t\t\t\t\t&& \thds.subsequentDirectQuote.getQuoteRelation().equals(\"<unclear>\")\n\t\t\t\t\t\t\t\t\t){\n//\t\t\t\t\t\t\t\tSystem.out.println(\"SUBSEQUENT UNCLEAR DIR QUOTE FOUND!!\"); \n\t\t\t\t\t\t\t\tint begin = hds.subsequentDirectQuote.getBegin();\n\t\t\t\t\t\t\t\tint end = hds.subsequentDirectQuote.getEnd();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuotee(quotee_left);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuoteType(\"direct\");\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuoteeReliability(quoteeReliability_left + 2);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.addToIndexes();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\tSystem.out.println(\"Hello, World INDIRECT QUOTE \" + quotee_left + quote_relation_left + quoteeReliability);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (quote_relation_left != null){\n\t\t\t\t\t\t\tindirectQuote.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\t\tindirectQuote.setQuoteType(quoteType);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\telse if (quoteType != null){\n\t\t\t\t\t\t\tindirectQuote.setQuoteType(quoteType);\n//\t\t\t\t\t\t\tSystem.out.println(\"Hello, World INDIRECT QUOTE NOT FOUND\" + quote_relation_left);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (indirectQuote.getRepresentativeQuoteeMention() != null){\n//\t\t\t\t\t\t\tSystem.out.println(\"NOW!!\" + indirectQuote.getRepresentativeQuoteeMention());\n\t\t\t\t\t\t\tif (hds.dbpediaSurfaceFormToDBpediaLink.containsKey(indirectQuote.getRepresentativeQuoteeMention())){\n\t\t\t\t\t\t\t\tindirectQuote.setQuoteeDBpediaUri(hds.dbpediaSurfaceFormToDBpediaLink.get(indirectQuote.getRepresentativeQuoteeMention()));\n//\t\t\t\t\t\t\t\tSystem.out.println(\"DBPEDIA \" + indirectQuote.getRepresentativeQuoteeMention() + \" URI: \" + hds.dbpediaSurfaceFormToDBpediaLink.get(indirectQuote.getRepresentativeQuoteeMention()));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t }\n//\t\t\t} //for chunk\n//\t\t\t\tsay without that\n//\t\t\t}\t\t\n\t\t} //Core map sentences indirect quotes\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "@Override\n public void handleSpecialChar(\n com.globalsight.ling.docproc.extractor.html.HtmlObjects.Text t)\n {\n\n }", "public void unmarshall(Element text)\n throws UnmarshallException\n {\n if( ! isInstanceOf(text, localName, Namespaces.NS_ATOM))\n {\n throw new UnmarshallException( \"Not a \" + getQualifiedName() + \" element\" );\n }\n try\n\t {\n // get the attributes\n int attributeCount = text.getAttributeCount();\n Attribute attribute = null; \n for( int i = 0; i < attributeCount; i++ )\n {\n attribute = text.getAttribute(i);\n if( \"type\".equals(attribute.getQualifiedName()))\n {\n String value = attribute.getValue();\n if( ContentType.TEXT.toString().equals(value) )\n {\n type = ContentType.TEXT;\n }\n else if( ContentType.HTML.toString().equals(value) )\n {\n type = ContentType.HTML;\n }\n else if( ContentType.XHTML.toString().equals(value) )\n {\n type = ContentType.XHTML;\n }\n else\n {\n InfoLogger.getLogger().writeError(\"Unable to parse extract type in \" + getQualifiedName() );\n // FIXME - check error handling here\n }\n }\n }\n \n\t\t // retrieve all of the sub-elements\n\t\t int length = text.getChildCount();\n if( length > 0 )\n {\n content = unmarshallString(text);\n }\n // FIXME - the above only handles plain text content. \n\t }\n\t catch( Exception ex )\n\t {\n\t\t InfoLogger.getLogger().writeError(\"Unable to parse an element in \" + getQualifiedName() + \": \" + ex.getMessage());\n\t throw new UnmarshallException(\"Unable to parse an element in \" + getQualifiedName(), ex);\n\t }\n }", "public void getParsed(String text) {\n\t\tAnnotation document = new Annotation(text);\n\n\t\t// run all Annotators on this text\n\t\tpipeline.annotate(document);\n\t\tsentences = document.get(SentencesAnnotation.class);\n\t\tsentIt = sentences.iterator();\n\t}", "@Override\n\t\tprotected void process() throws Exception {\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing - Initializing Models...\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tGlobalVars.initialize();\n\n\t\t\t// Processing Step 1. - CoreNLP\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing CoreNLP.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tString processed_text = Filter\n\t\t\t\t\t.filterdata(GlobalVars.pipeline, text);\n\n\t\t\t// Processing Step 2. - Openie\"\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing Openie.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tStringBuilder openIEOutput = new StringBuilder();\n\t\t\tString temp = \"\";\n\t\t\tfor (String sentence : processed_text.split(\"\\\\. \")) {\n\n\t\t\t\tSeq<Instance> extractions = GlobalVars.openIE.extract(sentence);\n\n\t\t\t\tInstance[] arr = new Instance[extractions.length()];\n\t\t\t\textractions.copyToArray(arr);\n\n\t\t\t\tfor (Instance inst : arr) {\n\t\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\t\tsb.append(inst.sentence() + \"\\n\");\n\t\t\t\t\tDouble conf = inst.confidence();\n\t\t\t\t\tString stringConf = conf.toString().substring(0, 4);\n\t\t\t\t\tsb.append(stringConf).append(\" (\")\n\t\t\t\t\t\t\t.append(inst.extr().arg1().text()).append(\"; \")\n\t\t\t\t\t\t\t.append(inst.extr().rel().text()).append(\"; \");\n\n\t\t\t\t\ttemp += inst.extr().arg1().text() + \"\\n\"\n\t\t\t\t\t\t\t+ inst.extr().rel().text() + \"\\n\";\n\n\t\t\t\t\tPart[] arr2 = new Part[inst.extr().arg2s().length()];\n\t\t\t\t\tinst.extr().arg2s().copyToArray(arr2);\n\t\t\t\t\t/*\n\t\t\t\t\t * for (Part arg : arr2) { sb.append(arg.text()).append(\"\");\n\t\t\t\t\t * System.out.println(\"%\" + arg.text() + \"%\"); }\n\t\t\t\t\t */\n\t\t\t\t\tif (arr2.length != 0) {\n\t\t\t\t\t\tSystem.out.println(\"Hats: \" + arr2[0]);\n\t\t\t\t\t\ttemp += arr2[0] + \"\\n\";\n\t\t\t\t\t\tsb.append(arr2[0]);\n\t\t\t\t\t\tsb.append(\")\\n\\n\");\n\t\t\t\t\t\topenIEOutput.append(sb.toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Processing Step 3. - Rewrite\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing Rewrite.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\t// Load load = new Load();\n\t\t\t// result = load.Loadfilter(openIEOutput.toString());\n\t\t\tresult = temp;\n\t\t}", "protected abstract String transform(final String xmlContent, final Map<String, Object> params) throws YFormProcessorException;", "private void textilizeNonBlankLine () {\n StringBuffer blockMod = new StringBuffer();\n int startPosition = 0;\n int textPosition = 0;\n leftParenPartOfURL = false;\n attributeType = 0;\n klass = new StringBuffer();\n id = new StringBuffer();\n style = new StringBuffer();\n language = new StringBuffer();\n String imageTitle = \"\";\n String imageURL = \"\";\n int endOfImageURL = -1;\n boolean doublePeriod = false;\n int periodPosition = line.indexOf (\".\");\n if (periodPosition >= 0) {\n textPosition = periodPosition + 1;\n if (textPosition < line.length()) {\n if (line.charAt (textPosition) == '.') {\n doublePeriod = true;\n textPosition++;\n }\n if (textPosition < line.length()\n && line.charAt (textPosition) == ' ') {\n textPosition++;\n textIndex = 0;\n while (textIndex < periodPosition\n && (Character.isLetterOrDigit (textChar()))) {\n blockMod.append (textChar());\n textIndex++;\n } // end while more letters and digits\n if (blockMod.toString().equals (\"p\")\n || blockMod.toString().equals (\"bq\")\n || blockMod.toString().equals (\"h1\")\n || blockMod.toString().equals (\"h2\")\n || blockMod.toString().equals (\"h3\")\n || blockMod.toString().equals (\"h4\")\n || blockMod.toString().equals (\"h5\")\n || blockMod.toString().equals (\"h6\")) {\n // look for attributes\n collectAttributes (periodPosition);\n } else {\n blockMod = new StringBuffer();\n textPosition = 0;\n }\n } // end if space follows period(s)\n } // end if not end of line following first period\n } // end if period found\n\n // Start processing at the beginning of the line\n textIndex = 0;\n\n // If we have a block modifier, then generate appropriate HTML\n if (blockMod.length() > 0) {\n lineDelete (textPosition);\n closeOpenBlockQuote();\n closeOpenBlock();\n doLists();\n if (blockMod.toString().equals (\"bq\")) {\n lineInsert (\"<blockquote><p\");\n context.blockQuoting = true;\n } else {\n lineInsert (\"<\" + blockMod.toString());\n }\n if (klass.length() > 0) {\n lineInsert (\" class=\\\"\" + klass.toString() + \"\\\"\");\n }\n lineInsert (\">\");\n if (doublePeriod) {\n context.nextBlock = blockMod.toString();\n } else {\n context.nextBlock = \"p\";\n }\n }\n\n // See if line starts with one or more list characters\n if (blockMod.length() <= 0) {\n while (textIndex < line.length()\n && (textChar() == '*'\n || textChar() == '#'\n || textChar() == ';')) {\n listChars.append (textChar());\n textIndex++;\n }\n if (listChars.length() > 0\n && (textIndex >= line.length()\n || ((! Character.isWhitespace (textChar()))\n && (textChar() != '(')))) {\n listChars = new StringBuffer();\n textIndex = 0;\n }\n int firstSpace = line.indexOf (\" \", textIndex);\n if (listChars.length() > 0) {\n collectAttributes (firstSpace);\n }\n }\n int endDelete = textIndex;\n if (endDelete < line.length()\n && Character.isWhitespace (line.charAt (endDelete))) {\n endDelete++;\n }\n\n if (listChars.length() > 0) {\n lineDelete (0, endDelete);\n }\n doLists();\n if (listChars.length() > 0\n && listChars.charAt(listChars.length() - 1) == ';') {\n lastDefChar = ';';\n } else {\n lastDefChar = ' ';\n }\n\n // See if this line contains a link alias\n if ((blockMod.length() <= 0)\n && ((line.length() - textIndex) >= 4)\n && (textChar() == '[')) {\n int rightBracketIndex = line.indexOf (\"]\", textIndex);\n if (rightBracketIndex > (textIndex + 1)) {\n linkAlias = true;\n String alias = line.substring (textIndex + 1, rightBracketIndex);\n String url = line.substring (rightBracketIndex + 1);\n lineDelete (line.length() - textIndex);\n lineInsert (\"<a alias=\\\"\" + alias + \"\\\" href=\\\"\" + url + \"\\\"> </a>\");\n }\n }\n\n // If no other instructions, use default start for a new line\n if (blockMod.length() <= 0 \n && listChars.length() <= 0\n & (! linkAlias)) {\n // This non-blank line does not start with a block modifier or a list char\n if (context.lastLineBlank) {\n if (context.nextBlock.equals (\"bq\")) {\n lineInsert (\"<p>\");\n } else {\n closeOpenBlockQuote();\n lineInsert (\"<\" + context.nextBlock + \">\");\n }\n } else {\n lineInsert (\"<br />\");\n }\n }\n\n // Now examine the rest of the line\n char last = ' ';\n char c = ' ';\n char next = ' ';\n leftParenPartOfURL = false;\n resetLineIndexArray();\n while (textIndex <= line.length()) {\n // Get current character, last character and next character\n last = c;\n if (textIndex < line.length()) {\n c = textChar();\n } else {\n c = ' ';\n }\n if ((textIndex + 1) < line.length()) {\n next = line.charAt (textIndex + 1);\n } else {\n next = ' ';\n }\n \n // ?? means a citation\n if (c == '?' && last == '?') {\n if (ix [CITATION] >= 0) {\n replaceWithHTML (CITATION, 2);\n } else {\n ix [CITATION] = textIndex - 1;\n textIndex++;\n }\n }\n else\n // __ means italics\n if (c == '_' && last == '_' && ix [QUOTE_COLON] < 0) {\n if (ix [ITALICS] >= 0) {\n replaceWithHTML (ITALICS, 2);\n } else {\n ix [ITALICS] = textIndex - 1;\n textIndex++;\n }\n }\n else\n // ** means bold\n if (c == '*' && last == '*') {\n if (ix [BOLD] >= 0) {\n replaceWithHTML (BOLD, 2);\n } else {\n ix [BOLD] = textIndex - 1;\n textIndex++;\n }\n }\n else\n // _ means emphasis\n if (c == '_' && next != '_' && ix [QUOTE_COLON] < 0) {\n if (ix [EMPHASIS] >= 0) {\n replaceWithHTML (EMPHASIS, 1);\n } else {\n ix [EMPHASIS] = textIndex;\n textIndex++;\n }\n }\n else\n // * means strong\n if (c == '*' && next != '*') {\n if (ix [STRONG] >= 0) {\n replaceWithHTML (STRONG, 1);\n } else {\n ix [STRONG] = textIndex;\n textIndex++;\n }\n }\n else\n // Exclamation points surround image urls\n if (c == '!' && Character.isLetter(next)\n && ix [QUOTE_COLON] < 0 && ix [EXCLAMATION] < 0) {\n // First exclamation point : store its location and move on\n ix [EXCLAMATION] = textIndex;\n textIndex++;\n }\n else\n // Second exclamation point\n if (c == '!'\n && ix [QUOTE_COLON] < 0 && ix [EXCLAMATION] >= 0) {\n // Second exclamation point\n imageTitle = \"\";\n endOfImageURL = textIndex;\n if (last == ')' && ix [EXCLAMATION_LEFT_PAREN] > 0) {\n ix [EXCLAMATION_RIGHT_PAREN] = textIndex - 1;\n endOfImageURL = ix [EXCLAMATION_LEFT_PAREN];\n imageTitle = line.substring\n (ix [EXCLAMATION_LEFT_PAREN] + 1, ix [EXCLAMATION_RIGHT_PAREN]);\n }\n imageURL = line.substring (ix [EXCLAMATION] + 1, endOfImageURL);\n // Delete the image url, title and parentheses,\n // but leave exclamation points for now.\n lineDelete (ix [EXCLAMATION] + 1, textIndex - ix [EXCLAMATION] - 1);\n String titleString = \"\";\n if (imageTitle.length() > 0) {\n titleString = \" title=\\\"\" + imageTitle + \"\\\" alt=\\\"\" + imageTitle + \"\\\"\";\n }\n lineInsert (ix [EXCLAMATION] + 1,\n \"<img src=\\\"\" + imageURL + \"\\\"\" + titleString + \" />\");\n if (next == ':') {\n // Second exclamation followed by a colon -- look for url for link\n ix [QUOTE_COLON] = textIndex;\n ix [LAST_QUOTE] = ix [EXCLAMATION];\n } else {\n lineDelete (ix [EXCLAMATION], 1);\n lineDelete (textIndex, 1);\n }\n ix [EXCLAMATION] = -1;\n ix [EXCLAMATION_LEFT_PAREN] = -1;\n ix [EXCLAMATION_RIGHT_PAREN] = -1;\n textIndex++;\n } // end if second exclamation point\n else\n // Parentheses within exclamation points enclose the image title\n if (c == '(' && ix [EXCLAMATION] > 0 ) {\n ix [EXCLAMATION_LEFT_PAREN] = textIndex;\n textIndex++;\n }\n else\n // Double quotation marks surround linked text\n if (c == '\"' && ix [QUOTE_COLON] < 0) {\n if (next == ':'\n && ix [LAST_QUOTE] >= 0\n && textIndex > (ix [LAST_QUOTE] + 1)) {\n ix [QUOTE_COLON] = textIndex;\n } else {\n ix [LAST_QUOTE] = textIndex;\n }\n textIndex++;\n }\n else\n // Flag a left paren inside of a url\n if (c == '(' && ix [QUOTE_COLON] > 0) {\n leftParenPartOfURL = true;\n textIndex++;\n }\n else\n // Space may indicate end of url\n if (Character.isWhitespace (c)\n && ix [QUOTE_COLON] > 0\n && ix [LAST_QUOTE] >= 0\n && textIndex > (ix [QUOTE_COLON] + 2)) {\n int endOfURL = textIndex - 1;\n // end of url is last character of url\n // do not include any trailing punctuation at end of url\n int backup = 0;\n while ((endOfURL > (ix [QUOTE_COLON] + 2))\n && (! Character.isLetterOrDigit (line.charAt(endOfURL)))\n && (! ((line.charAt(endOfURL) == ')') && (leftParenPartOfURL)))\n && (! (line.charAt(endOfURL) == '/'))) {\n endOfURL--;\n backup++;\n }\n String url = line.substring (ix [QUOTE_COLON] + 2, endOfURL + 1);\n // insert the closing anchor tag\n lineInsert (endOfURL + 1, \"</a>\");\n // Delete the quote, colon and url from the line\n lineDelete (ix [QUOTE_COLON], endOfURL + 1 - ix [QUOTE_COLON]);\n // insert the beginning of the anchor tag\n lineDelete (ix [LAST_QUOTE], 1);\n lineInsert (ix [LAST_QUOTE], \"<a href=\\\"\" + url + \"\\\">\");\n // Reset the pointers\n ix [QUOTE_COLON] = -1;\n ix [LAST_QUOTE] = -1;\n leftParenPartOfURL = false;\n // Increment the index to the next character\n if (backup > 0) {\n textIndex = textIndex - backup;\n } else {\n textIndex++;\n }\n }\n else\n // Look for start of definition\n if ((c == ':' || c == ';')\n && Character.isWhitespace(last)\n && Character.isWhitespace(next)\n && listChars.length() > 0\n && (lastDefChar == ';' || lastDefChar == ':')) {\n lineDelete (textIndex - 1, 3);\n lineInsert (closeDefinitionTag (lastDefChar)\n + openDefinitionTag (c));\n lastDefChar = c;\n }\n /* else\n // -- means an em dash\n if (c == '-' && last == '-') {\n textIndex--;\n lineDelete (2);\n lineInsert (\"&#8212;\");\n } */ else {\n textIndex++;\n }\n }// end while more characters to examine\n\n context.lastLineBlank = false;\n\n }", "private static void processPart (WorkPart part) \n\t\tthrows Exception\n\t{\n\t\tTextWrapper textWrapper = part.getPrimaryText();\n\t\tif (textWrapper == null) return;\n\t\tText primary = textWrapper.getText();\n\t\tint n = primary.getNumLines();\n\t\tTextLine[] primaryLines = primary.getLines();\n\t\tTextLine[] translationLines = new TextLine[n];\n\t\tCollection lines = pm.getLinesInWorkPart(part);\n\t\tint numTranslatedLines = 0;\n\t\tfor (Iterator it = lines.iterator(); it.hasNext(); ) {\n\t\t\tLine line = (Line)it.next();\n\t\t\tTextRange location = line.getLocation();\n\t\t\tif (location == null) continue;\n\t\t\tTextLocation start = location.getStart();\n\t\t\tif (start == null) continue;\n\t\t\tTextLocation end = location.getEnd();\n\t\t\tif (end == null) continue;\n\t\t\tint endIndex = end.getIndex();\n\t\t\tString lineTag = line.getTag();\n\t\t\tif (lineTag == null) continue;\n\t\t\tElement el = (Element)lineTagToElMap.get(lineTag);\n\t\t\tif (el == null) continue;\n\t\t\tlineTagsFound.add(lineTag);\n\t\t\tTextLine translationLine = new BuildParagraph(el, \n\t\t\t\tTextParams.ROMAN,\n\t\t\t\tTextParams.TRANSLATED_LINE_FONT_SIZE);\n\t\t\tTextLine primaryLine = primaryLines[endIndex];\n\t\t\tint primaryIndentation = primaryLine.getIndentation();\n\t\t\ttranslationLine.setIndentation(primaryIndentation +\n\t\t\t\tTextParams.TRANSLATION_INDENTATION);\n\t\t\ttranslationLines[endIndex] = translationLine;\n\t\t\tnumTranslatedLines++;\n\t\t}\n\t\tif (numTranslatedLines == 0) return;\n\t\tText translation = new Text();\n\t\ttranslation.setCollapseBlankLines(false);\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tTextLine translationLine = translationLines[i];\n\t\t\tif (translationLine == null) {\n\t\t\t\ttranslation.appendBlankLine();\n\t\t\t} else {\n\t\t\t\ttranslation.appendLine(translationLine);\n\t\t\t}\n\t\t}\n\t\ttranslation.finalize();\n\t\tpm.begin();\n\t\tTextWrapper translationWrapper = new TextWrapper(translation);\n\t\tpm.save(translationWrapper);\n\t\tpart.addTranslation(translationTag, translationWrapper);\n\t\tpm.commit();\n\t}", "public void parseForm()\n {\n if (mForm.gotoRoot().gotoTag(\"h:head/%1$s:model\", mDefaultPrefix).hasTag(\"%1$s:itext\", mDefaultPrefix)) {\n Log.d(Collect.LOGTAG, t + \"parsing itext form translations...\");\n parseFormTranslations(mForm.gotoRoot().gotoTag(\"h:head/%1$s:model/%1$s:itext\", mDefaultPrefix));\n } else\n Log.d(Collect.LOGTAG, t + \"no form translations to parse\"); \n \n Log.d(Collect.LOGTAG, t + \"parsing form binds...\");\n parseFormBinds(mForm.gotoRoot().gotoTag(\"h:head/%1$s:model\", mDefaultPrefix));\n \n Log.d(Collect.LOGTAG, t + \"parsing form controls...\");\n parseFormControls(mForm.gotoRoot().gotoTag(\"h:body\"));\n \n Log.d(Collect.LOGTAG, t + \"parsing form instance...\");\n parseFormInstance(mForm.gotoRoot().gotoTag(\"h:head/%1$s:model/%1$s:instance\", mDefaultPrefix).gotoChild(), \"/\" + mInstanceRoot);\n Log.d(Collect.LOGTAG, t + \"FINISHED parsing form instance\");\n }", "private void unpackGeneralXmlMarkup(Document doc, RepositioningInfo repInfo,\n RepositioningInfo ampCodingInfo, StatusListener statusListener)\n throws DocumentFormatException {\n boolean docHasContentButNoValidURL = hasContentButNoValidUrl(doc);\n\n XmlDocumentHandler xmlDocHandler = null;\n try {\n\n // Create a new Xml document handler\n xmlDocHandler =\n new XmlDocumentHandler(doc, this.markupElementsMap,\n this.element2StringMap);\n\n // Register a status listener with it\n xmlDocHandler.addStatusListener(statusListener);\n\n // set repositioning object\n xmlDocHandler.setRepositioningInfo(repInfo);\n\n // set the object with ampersand coding positions\n xmlDocHandler.setAmpCodingInfo(ampCodingInfo);\n\n // create the parser\n SAXDocumentParser newxmlParser = new SAXDocumentParser();\n\n // Set up the factory to create the appropriate type of parser\n // Fast Infoset doesn't support validating which is good as we would want\n // it off any way, but we do want it to be namesapace aware\n newxmlParser.setFeature(\"http://xml.org/sax/features/namespaces\", true);\n newxmlParser.setFeature(\"http://xml.org/sax/features/namespace-prefixes\",\n true);\n newxmlParser.setContentHandler(xmlDocHandler);\n newxmlParser.setErrorHandler(xmlDocHandler);\n newxmlParser.setDTDHandler(xmlDocHandler);\n newxmlParser.setEntityResolver(xmlDocHandler);\n\n // Parse the XML Document with the appropriate encoding\n Reader docReader = null;\n try {\n InputSource is;\n if(docHasContentButNoValidURL) {\n // no URL, so parse from string\n is = new InputSource(new StringReader(doc.getContent().toString()));\n } else if(doc instanceof TextualDocument) {\n // textual document - load with user specified encoding\n String docEncoding = ((TextualDocument)doc).getEncoding();\n // don't strip BOM on XML.\n docReader =\n new InputStreamReader(doc.getSourceUrl().openStream(),\n docEncoding);\n is = new InputSource(docReader);\n // must set system ID to allow relative URLs (e.g. to a DTD) to\n // work\n is.setSystemId(doc.getSourceUrl().toString());\n } else {\n // let the parser decide the encoding\n is = new InputSource(doc.getSourceUrl().toString());\n }\n newxmlParser.parse(is);\n } finally {\n // make sure the open streams are closed\n if(docReader != null) docReader.close();\n }\n\n ((DocumentImpl)doc).setNextAnnotationId(xmlDocHandler\n .getCustomObjectsId());\n } catch(SAXException e) {\n doc.getFeatures().put(\"parsingError\", Boolean.TRUE);\n\n Boolean bThrow =\n (Boolean)doc.getFeatures().get(\n GateConstants.THROWEX_FORMAT_PROPERTY_NAME);\n\n if(bThrow != null && bThrow.booleanValue()) {\n throw new DocumentFormatException(e);\n } else {\n Out.println(\"Warning: Document remains unparsed. \\n\"\n + \"\\n Stack Dump: \");\n e.printStackTrace(Out.getPrintWriter());\n }\n\n } catch(IOException e) {\n throw new DocumentFormatException(\"I/O exception for \"\n + doc.getSourceUrl(), e);\n } finally {\n if(xmlDocHandler != null)\n xmlDocHandler.removeStatusListener(statusListener);\n }\n }", "private void checkTextAnnotation(MGraph g, UriRef textAnnotation, String content) {\n Iterator<Triple> selectedTextIterator = g.filter(textAnnotation,\n Properties.ENHANCER_SELECTED_TEXT, null);\n // check if the selected text is added\n assertTrue(selectedTextIterator.hasNext());\n // test if the selected text is part of the TEXT_TO_TEST\n Resource object = selectedTextIterator.next().getObject();\n assertTrue(object instanceof Literal);\n Literal selectedText = (Literal)object;\n object = null;\n assertTrue(content.indexOf(selectedText.getLexicalForm()) >= 0);\n // test if context is added\n //context not present for Zemanta\n// Iterator<Triple> selectionContextIterator = g.filter(textAnnotation,\n// Properties.ENHANCER_SELECTION_CONTEXT, null);\n// assertTrue(selectionContextIterator.hasNext());\n// // test if the selected text is part of the TEXT_TO_TEST\n// object = selectionContextIterator.next().getObject();\n// assertTrue(object instanceof Literal);\n// assertTrue(content.indexOf(((Literal)object).getLexicalForm()) >= 0);\n// object = null;\n //test start/end if present\n Iterator<Triple> startPosIterator = g.filter(textAnnotation,\n ENHANCER_START, null);\n Iterator<Triple> endPosIterator = g.filter(textAnnotation,\n ENHANCER_END, null);\n //start end is optional, but if start is present, that also end needs to be set\n if(startPosIterator.hasNext()){\n Resource resource = startPosIterator.next().getObject();\n //only a single start position is supported\n assertTrue(!startPosIterator.hasNext());\n assertTrue(resource instanceof TypedLiteral);\n TypedLiteral startPosLiteral = (TypedLiteral) resource;\n resource = null;\n int start = LiteralFactory.getInstance().createObject(Integer.class, startPosLiteral);\n startPosLiteral = null;\n //now get the end\n //end must be defined if start is present\n assertTrue(endPosIterator.hasNext());\n resource = endPosIterator.next().getObject();\n //only a single end position is supported\n assertTrue(!endPosIterator.hasNext());\n assertTrue(resource instanceof TypedLiteral);\n TypedLiteral endPosLiteral = (TypedLiteral) resource;\n resource = null;\n int end = LiteralFactory.getInstance().createObject(Integer.class, endPosLiteral);\n endPosLiteral = null;\n //check for equality of the selected text and the text on the selected position in the content\n //System.out.println(\"TA [\"+start+\"|\"+end+\"]\"+selectedText.getLexicalForm()+\"<->\"+content.substring(start,end));\n assertTrue(content.substring(start, end).equals(selectedText.getLexicalForm()));\n } else {\n //if no start position is present, there must also be no end position defined\n assertTrue(!endPosIterator.hasNext());\n }\n }", "public interface Text {\n\n String HELP = \"Sage 'Alexa, weiter', um die nächste Anweisung zu erhalten. \";\n String STOP = \"Lasst euch weiterhin feiern! \";\n String FALLBACK = \"Leider konnte der Herr dich nicht verstehen \";\n\n String PICOLO_START = \"Willkommen bei Picolo! Möchtest du ein neues Spiel starten? \";\n String[] ANZAHL_SPIELER = {\n \"Wie viele Spieler spielen mit?\",\n \"Nenne mir die Anzahl der teilnehmenden Spieler\",\n \"Wie viele Spieler gibt es heute?\"\n };\n String[] SPIELER_NAME_FRAGEN = {\n \"Nenne mir deinen Namen Spieler \",\n \"Bitte sage mir deinen Namen Spieler \",\n \"Sag mir bitte deinen Namen Spieler \"\n };\n String NAECHSTE_AUFGABE = \"Wollt ihr die nächste Aufgabe Wissen? \";\n String ERSTE_ANWEISUNG = \"Alles klar, Los geht´s! \";\n String WIEDERHOLEN_FEHLER = \"Das Spiel wurde noch nicht gestartet. Deswegen kann ich nichts wiederholen. Bitte starte vorher das Spiel. \";\n\n //SSML Aussprache\n\n /**TODO\n * SSML Text bearbeiten\n */\n String HELP_SSML = \"Sage 'Alexa, weiter', um die nächste Anweisung zu erhalten. \";\n String STOP_SSML = \"Lasst euch weiterhin feiern! \";\n String FALLBACK_SSML = \"Ich habe dich leider nicht verstanden. \";\n}", "private void makeReplacementText() throws IOException {\n valueBuf.clear();\n Token t = new Token();\n int start = currentTokenStart + 1;\n final int end = bufStart - 1;\n try {\n for (;;) {\n\tint tok;\n\tint nextStart;\n\ttry {\n\t tok = Tokenizer.tokenizeEntityValue(buf, start, end, t);\n\t nextStart = t.getTokenEnd();\n\t}\n\tcatch (ExtensibleTokenException e) {\n\t tok = e.getTokenType();\n\t nextStart = end;\n\t}\n\thandleEntityValueToken(valueBuf, tok, start, nextStart, t);\n\tstart = nextStart;\n }\n }\n catch (PartialTokenException e) {\n currentTokenStart = end;\n fatal(\"NOT_WELL_FORMED\");\n }\n catch (InvalidTokenException e) {\n currentTokenStart = e.getOffset();\n reportInvalidToken(e);\n }\n catch (EmptyTokenException e) { }\n }", "TextDecoder getTextDecoder();", "public void process (String text) {\n\t\tProperties props = new Properties();\n\t\tprops.put(\"annotators\", \"tokenize, ssplit, pos, lemma, ner, parse, dcoref\");\n\t\tStanfordCoreNLP pipeline = new StanfordCoreNLP(props);\n\t\tAnnotation document = new Annotation(text);\n\t\tpipeline.annotate(document);\n\t\tList<CoreMap> sentences = document.get(SentencesAnnotation.class);\n\t\tfor(CoreMap sentence: sentences) {\n\t\t\tsgs.add(sentence.get(CollapsedCCProcessedDependenciesAnnotation.class));\n\t\t}\n\t\tccg = document.get(CorefChainAnnotation.class);\n\t}", "@Test\n\tpublic void testTextToXml()\n\t{\n\t\tDocument doc = XMLUtil.createEmpty();\n\t\tText text = new Text(\"Steve Unger Smells\");\n\t\tElement element = this.parser.toXML(doc, text);\n\t\tText text2 = this.parser.fromXML(element);\n\t\t\n\t\tassertEquals(\"Steve Unger Smells\", text2.getText());\t\t\n\t}", "private void initializeAnimalIText() {\r\n\t\tiText = lang.newText(new Offset(0, 178, rowText, AnimalScript.DIRECTION_SW), \"\", \"iText\", null);\r\n\t\tiText.hide();\r\n\t}", "@Test\n\tpublic void probandoConParser() {\n\t\tString dBoxUrl = \"/home/julio/Dropbox/julio_box/educacion/maestria_explotacion_datos_uba/materias/cuat_4_text_mining/material/tp3/\";\n\t\tString modelUrl = dBoxUrl + \"NER/models/es-ner-person.bin\";\n\t\tString filesUrl = dBoxUrl + \"NER/archivoPrueba\";\n\t\tString sampleFile = filesUrl + \"/viernes-23-05-14-alan-fitzpatrick-gala-cordoba.html\";\n\t\tList<String> docs = getMyDocsFromSomewhere(filesUrl);\n\n\t\ttry {\n\t\t\t// detecting the file type\n\t\t\tBodyContentHandler handler = new BodyContentHandler();\n\t\t\tMetadata metadata = new Metadata();\n\t\t\tFileInputStream inputstream = new FileInputStream(new File(sampleFile));\n\t\t\tParseContext pcontext = new ParseContext();\n\n\t\t\t// Html parser\n\t\t\tHtmlParser htmlparser = new HtmlParser();\n\t\t\thtmlparser.parse(inputstream, handler, metadata, pcontext);\n\t\t\tSystem.out.println(\"Contents of the document:\" + handler.toString());\n\t\t\tSystem.out.println(\"Metadata of the document:\");\n\t\t\tString[] metadataNames = metadata.names();\n\n\t\t\tfor (String name : metadataNames) {\n\t\t\t\tSystem.out.println(name + \": \" + metadata.get(name));\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tAssert.fail();\n\t\t}\n\n\t}", "@Test\n public void main() throws IOException {\n currentArticle = null;\n\n for(String line: FileUtils.readLines(new File(\"D:\\\\projects\\\\вёрстка томов ИИ\\\\9 том\\\\термины.txt\"))) {\n\n Matcher matcher = compile(\"\\\\|([^\\\\|]+)\\\\|\\\\s[–\\\\-—]\\\\s(.+)\").matcher(line);\n if (matcher.find()) {\n if (currentArticle != null) {\n saveItem();\n currentArticle = null;\n }\n String term = matcher.group(1);\n String body = matcher.group(2);\n if(body.indexOf(\"см. \") != 0) {\n currentArticle = new Article(term, body);\n } /*else {\n String alias = body.replace(\"см. \", \"\").replace(\"«\", \"\").replace(\"»\", \"\").replace(\".\", \"\");\n saveAliases(alias, term);\n }*/\n } else if (currentArticle != null) {\n currentArticle.setContent(currentArticle.getContent() + \"<br/>\"+line);\n }\n }\n if (currentArticle != null) {\n saveItem();\n }\n }", "@Test\n\tpublic void testTextFromXml()\n\t{\n\t\tString xml = \"<text val=\\\"Steve Unger Smells\\\" />\";\t\t\n\t\tDocument doc = XMLUtil.parse(xml);\n\t\tElement element = doc.getDocumentElement();\n\t\tText text = this.parser.fromXML(element);\n\t\t\n\t\tassertEquals(\"Steve Unger Smells\",text.getText());\n\t}", "public String transform(String text){\n for(int i=0; i<transforms.length; i++)\n {\n if(transforms[i].contains(\"fromabbreviation\")){\n text = textTransformerAbbreviation.fromAbbreviation(text);\n }\n if(transforms[i].contains(\"toabbreviation\")){\n text = textTransformerAbbreviation.toAbbreviation(text);\n }\n if(transforms[i].contains(\"inverse\")){\n text = textTransformerInverse.inverse(text);\n }\n if(transforms[i].contains(\"upper\")){\n text = textTransformerLetterSize.upper(text);\n }\n if(transforms[i].contains(\"lower\")){\n text = textTransformerLetterSize.lower(text);\n }\n if(transforms[i].contains(\"capitalize\")) {\n text = textTransformerLetterSize.capitalize(text);\n }\n if(transforms[i].contains(\"latex\")){\n text = textTransformerLatex.toLatex(text);\n }\n if(transforms[i].contains(\"numbers\")){\n text = textTransformerNumbers.toText(text);\n }\n if(transforms[i].contains(\"repetitions\")){\n text = textTransformerRepetition.deleteRepetitions(text);\n }\n logger.debug(\"Text after \" + (i+1) + \" transform: \" + text);\n }\n\n logger.debug(\"Final form: \" + text);\n return text;\n }", "@Override\n \t\t\t\tpublic void modifyText(ModifyEvent e) {\n \t\t\t\t\tString result = fp.getValidator().validate(text.getText());\n \t\t\t\t\tif (result == null)\n \t\t\t\t\t\tdecorator.hide();\n \t\t\t\t\telse {\n \t\t\t\t\t\tdecorator.setDescriptionText(result);\n \t\t\t\t\t\tdecorator.show();\n \t\t\t\t\t}\n \t\t\t\t\tupdateState();\n \t\t\t\t}", "private void buildRTF() {\n\t\n}", "@Override\n public void startElement(String aUri, String aLocalName, String aName,\n Attributes aAttributes)\n throws SAXException\n {\n if (!inTextElement && TAG_TEI_DOC.equals(aName)) {\n if (useXmlId) {\n documentId = aAttributes.getValue(\"xml:id\");\n }\n else if (useFilenameId) {\n documentId = FilenameUtils.getName(currentResource.getPath()) + \"#\"\n + currentTeiElementNumber;\n }\n else {\n documentId = currentResource.getPath() + \"#\" + currentTeiElementNumber;\n }\n }\n else if (!inTextElement && TAG_TITLE.equals(aName)) {\n captureText = true;\n }\n else if (TAG_TEXT.equals(aName)) {\n captureText = true;\n inTextElement = true;\n }\n else if (inTextElement && (TAG_SUNIT.equals(aName) || \n (utterancesAsSentences && TAG_U.equals(aName)))) {\n sentenceStart = getBuffer().length();\n }\n else if (inTextElement && TAG_PARAGRAPH.equals(aName)) {\n paragraphStart = getBuffer().length();\n }\n else if (readNamedEntity && inTextElement && TAG_RS.equals(aName)) {\n NamedEntity ne = new NamedEntity(getJCas());\n ne.setBegin(getBuffer().length());\n ne.setValue(aAttributes.getValue(ATTR_TYPE));\n namedEntities.push(ne);\n }\n else if (readConstituent && inTextElement && TAG_PHRASE.equals(aName)) {\n if (constituents.isEmpty()) {\n ROOT root = new ROOT(getJCas());\n root.setConstituentType(\"ROOT\");\n constituents.push(new ConstituentWrapper(root));\n }\n \n Constituent constituent = new Constituent(getJCas());\n constituent.setConstituentType(aAttributes.getValue(ATTR_TYPE));\n constituent.setSyntacticFunction(aAttributes.getValue(ATTR_FUNCTION));\n constituents.push(new ConstituentWrapper(constituent));\n }\n else if (inTextElement\n && (TAG_WORD.equals(aName) || TAG_CHARACTER.equals(aName) || TAG_MULTIWORD\n .equals(aName))) {\n tokenStart = getBuffer().length();\n if (StringUtils.isNotEmpty(aAttributes.getValue(ATTR_POS))) {\n posTag = aAttributes.getValue(ATTR_POS);\n }\n else {\n posTag = aAttributes.getValue(ATTR_TYPE);\n }\n lemma = aAttributes.getValue(ATTR_LEMMA);\n }\n }", "@Override\npublic\tvoid parseInput() {\n InputStream is = new ByteArrayInputStream(this.body.toString().getBytes());\n\t\t\n\t\t\n\t\ttry {\n\t\t\tthis.domIn = new XMLInputConversion(is);\n\t\t} catch (ParserConfigurationException | SAXException | IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tthis.rootXML = this.domIn.extractDOMContent();\n\t}", "public static void main(String[] args) throws ParseException {\n String text;\n\n File file;\n\n /* pdfStripper = null;\n pdDoc = null;\n cosDoc = null;\n */ String parsed = parseWithTika();\n file = new File(filePath);\n try {\n /* parser = new PDFParser(new FileInputStream(file)); // update for PDFBox V 2.0\n parser.parse();\n cosDoc = parser.getDocument();\n pdfStripper = new PDFTextStripper();\n pdDoc = new PDDocument(cosDoc);\n pdDoc.getNumberOfPages();\n */ //pdfStripper.setStartPage(1);\n //pdfStripper.setEndPage(10);\n /* text = pdfStripper.getText(pdDoc);\n String resultString = text.replaceAll(\"\\\\p{C}|\\\\p{Sm}|\\\\p{Sk}|\\\\p{So}\", \" \");\n */\n\n //testDictionary();\n testOpenNlp(parsed);\n testOpenNlp(\"anas al bassit\");\n testOpenNlp(\"Anas Al Bassit\");\n testOpenNlp(\"barack obama\");\n testOpenNlp(\"Barack Obama\");\n\n\n System.out.println();\n } catch (IOException e) {\n e.printStackTrace();\n }\n// catch (ParseException e) {\n// e.printStackTrace();\n// }\n }", "public void parse(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context)\n\t\tthrows IOException,SAXException,TikaException {\n\n\t\t// Get metadata\n\t\tthis.mdata = metadata;\n\n\t\t// Read in all text\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(stream));\n\t\tString line = reader.readLine();\n\t\tString text = \"\";\n\t\twhile (line != null) {\n\t\t\ttext += line;\n\t\t\tline = reader.readLine();\n\t\t}\n\t\treader.close();\n\n\t\ttry {\n\t\t\t// Get NER results from each NER toolkit.\n\t\t\tthis.openNLPEntities = this.openNLPParse(text);\t\n\t\t\tthis.coreNLPEntities = this.coreNLPParse(text);\t\n\t\t\tthis.nltkEntities = this.nltkParse(text);\n\t\t\tthis.gQMeasurements = this.gQParse(text);\n\n\t\t\t// Combine results and add to metadata.\n\t\t\tMap<String, Map<String,Integer>> combo = combineResults();\n\t\t\tString json = mapToJSON(combo);\n\t\t\tString openNLPJSON = mapToJSON(this.openNLPEntities);\n\t\t\tString coreNLPJSON = mapToJSON(this.coreNLPEntities);\n\t\t\tString nltkJSON = mapToJSON(this.nltkEntities);\n\t\t\tpushToMetadata(\"openNLP entities\", openNLPJSON);\n\t\t\tpushToMetadata(\"coreNLP entities\", coreNLPJSON);\n\t\t\tpushToMetadata(\"nltk entities\", nltkJSON);\n\t\t\tpushToMetadata(\"maxJointAgreement\",json);\n\t\t\tpushToMetadata(\"quantities\", this.gQMeasurements);\n\t\t\n\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t}\n\t}", "static void parseIt() {\n try {\n long start = System.nanoTime();\n int[] modes = {DET_MODE, SUM_MODE, DOUBLES_MODE};\n String[] filePaths = {\"\\\\catalogue_products.xml\", \"\\\\products_to_categories.xml\", \"\\\\doubles.xml\"};\n HashMap<String, String[]> update = buildUpdateMap(remainderFile);\n window.putLog(\"-------------------------------------\\n\" + updateNodes(offerNodes, update) +\n \"\\nФайлы для загрузки:\");\n for (int i = 0; i < filePaths.length; i++) {\n // Define location for output file\n File outputFile = new File(workingDirectory.getParent() + filePaths[i]);\n pushDocumentToFile(outputFile, modes[i]);\n printFileInfo(outputFile);\n }\n window.putLog(\"-------------------------------------\\nВсего обработано уникальных записей: \" +\n offerNodes.size());\n long time = (System.nanoTime() - start) / 1000000;\n window.putLog(\"Завершено без ошибок за \" + time + \" мс.\");\n offerNodes = null;\n //window.workshop.setParseButtonDisabled();\n } catch (TransformerException e) {\n reportException(Thread.currentThread(),\n new RuntimeException(e.getCause() + \" (\" + e.getException() + \")\\n\\t\" + e.getMessageAndLocation()));\n } catch (ParserConfigurationException e) {\n reportException(Thread.currentThread(),\n new RuntimeException(e.getCause() + \"\\n\\t\" + e.getLocalizedMessage()));\n } catch (SAXException e) {\n reportException(Thread.currentThread(),\n new RuntimeException(\"SAXexception: \" + e.getMessage()));\n\n } catch (IOException e) {\n reportException(Thread.currentThread(),\n new RuntimeException(e.getCause() + \"\\n\\t\" + e.getMessage() + \". \" + e.getStackTrace()[0]));\n }\n }", "@Override\n\tprotected Map<Object, Object> rawTextParse(CharSequence text) {\n\n\t\tStanfordCoreNLP pipeline = null;\n\t\ttry {\n\t\t\tpipeline = pipelines.take();\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tAnnotation document = new Annotation(text.toString());\n\t\tpipeline.annotate(document);\n\t\tMap<Object, Object> sentencesMap = new LinkedHashMap<Object, Object>();//maintain sentence order\n\t\tint id = 0;\n\t\tList<CoreMap> sentences = document.get(CoreAnnotations.SentencesAnnotation.class);\n\n\t\tfor (CoreMap sentence : sentences) {\n\t\t\tStringBuilder processedText = new StringBuilder();\n\t\t\tfor (CoreLabel token : sentence.get(CoreAnnotations.TokensAnnotation.class)) {\n\t\t\t\tString word = token.get(CoreAnnotations.TextAnnotation.class);\n\t\t\t\tString lemma = token.get(CoreAnnotations.LemmaAnnotation.class);\n\t\t\t\tString pos = token.get(CoreAnnotations.PartOfSpeechAnnotation.class);\n\t\t\t\t//todo this should really happen after parsing is done, because using lemmas might confuse the parser\n\t\t\t\tif (config().isUseLowercaseEntries()) {\n\t\t\t\t\tword = word.toLowerCase();\n\t\t\t\t\tlemma = lemma.toLowerCase();\n\t\t\t\t}\n\t\t\t\tif (config().isUseLemma()) {\n\t\t\t\t\tword = lemma;\n\t\t\t\t}\n\t\t\t\tprocessedText.append(word).append(POS_DELIMITER).append(lemma).append(POS_DELIMITER).append(pos).append(TOKEN_DELIM);\n //inserts a TOKEN_DELIM at the end too\n\t\t\t}\n\t\t\tsentencesMap.put(id, processedText.toString().trim());//remove the single trailing space\n\t\t\tid++;\n\t\t}\n\t\ttry {\n\t\t\tpipelines.put(pipeline);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn sentencesMap;\n\t}", "@Override\n public void onText(@NonNull final String text)\n throws ParseException {\n try {\n tagStack.peek();\n } catch (EmptyStackException exception) {\n throw new ParseException(\"Unexpected text outside tags!\",\n exception);\n }\n log.debug(\"Handling text information of the tag, tag name = {}.\",\n tagStack.peek().getName());\n switch (tagStack.peek()) {\n case NAME:\n device.setName(text);\n break;\n case DESCRIPTION:\n device.setDescription(text);\n break;\n case RATING:\n device.setRating(Double.parseDouble(text));\n break;\n case CONNECTOR:\n device.getInput().setConnector(Connector.fromValue(text));\n break;\n case ENERGY_USAGE:\n device.getInput().setEnergyUsage(text);\n break;\n case PRICE:\n device.getPrice().setValue(Double.parseDouble(text));\n break;\n case COMPANY:\n device.getManufacture().setCompany(text);\n break;\n case ORIGIN:\n device.getManufacture().setOrigin(text);\n break;\n case DATE:\n device.getManufacture().setDate(text);\n break;\n default:\n //for checkstyle.\n break;\n }\n log.debug(\"Ended tag text information handling.\");\n }", "public interface Text extends TextualElement {\r\n\r\n}", "private static void processText(String line, BufferedWriter wrtr)\n\t\t\tthrows JSONException, IOException {\n\t\tJSONObject topicModel = TopicModelTemplateUtil\n\t\t\t\t.getJSONFromTemplate(line);\n\t\t// populate the WORD vector for the current topic model\n\t\tTopicModelTemplateUtil.geTopicModelFromTemplate(topicModel).forEach(\n\t\t\t\ttpm -> {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tLuceneNLPUtil.getRemovedStopAndStem(tpm.getWord(),\n\t\t\t\t\t\t\t\tLuceneNLPUtil.getDefaultEnglishStopWordList())\n\t\t\t\t\t\t\t\t.forEach(word -> {\n\t\t\t\t\t\t\t\t\tif (VOCABULARY_MAP.containsKey(word)) {\n\t\t\t\t\t\t\t\t\t\tVOCABULARY_MAP.replace(word, 1);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t// dump it to the file\n\t\tdumpTextLine(topicModel.getString(ConfigConstant.JSON_FIELD.BUSINESS_ID\n\t\t\t\t.getFieldName()), wrtr);\n\t}", "public void fromXML(Element altN) {\r\n \t\tthis.fromXML = true;\r\n \t\tRationaleDB db = RationaleDB.getHandle();\r\n \r\n \t\t// add idref ***from the XML***\r\n \t\tString idref = altN.getAttribute(\"id\");\r\n \r\n \t\t// get our name\r\n \t\tname = altN.getAttribute(\"name\");\r\n \r\n \t\t// get our status\r\n \t\tstatus = AlternativeStatus.fromString(altN.getAttribute(\"status\"));\r\n \r\n \t\t// get our evaluation\r\n \t\tevaluation = Float.parseFloat(altN.getAttribute(\"evaluation\"));\r\n \r\n \t\tNode descN = altN.getFirstChild();\r\n \t\t// get the description\r\n \t\t// the text is actually the child of the element, odd...\r\n \t\tNode descT = descN.getFirstChild();\r\n \t\tif (descT instanceof Text) {\r\n \t\t\tText text = (Text) descT;\r\n \t\t\tString data = text.getData();\r\n \t\t\tsetDescription(data);\r\n \t\t}\r\n \r\n \t\t// and last....\r\n \t\tdb.addRef(idref, this); // important to use the ref from the XML file!\r\n \r\n \t\tElement child = (Element) descN.getNextSibling();\r\n \r\n \t\twhile (child != null) {\r\n \r\n \t\t\tString nextName;\r\n \r\n \t\t\tnextName = child.getNodeName();\r\n \t\t\t// here we check the type, then process\r\n \t\t\tif (nextName.compareTo(\"DR:argument\") == 0) {\r\n \t\t\t\tArgument arg = new Argument();\r\n \t\t\t\tdb.addArgument(arg);\r\n \t\t\t\taddArgument(arg);\r\n \t\t\t\targ.fromXML(child);\r\n \t\t\t} else if (nextName.compareTo(\"DR:question\") == 0) {\r\n \t\t\t\tQuestion quest = new Question();\r\n \t\t\t\tdb.addQuestion(quest);\r\n \t\t\t\taddQuestion(quest);\r\n \t\t\t\tquest.fromXML(child);\r\n \t\t\t} else if (nextName.compareTo(\"DR:decisionproblem\") == 0) {\r\n \t\t\t\tDecision dec = new Decision();\r\n \t\t\t\tdb.addDecision(dec);\r\n \t\t\t\taddSubDecision(dec);\r\n \t\t\t\tdec.fromXML(child);\r\n \t\t\t} else if (nextName.compareTo(\"DR:history\") == 0) {\r\n \t\t\t\thistoryFromXML(child);\r\n \t\t\t} else if (nextName.compareTo(\"argref\") == 0) {\r\n \t\t\t\tNode childRef = child.getFirstChild(); // now, get the text\r\n \t\t\t\t// decode the reference\r\n \t\t\t\tText refText = (Text) childRef;\r\n \t\t\t\tString stRef = refText.getData();\r\n \t\t\t\taddArgument((Argument) db.getRef(stRef));\r\n \r\n \t\t\t} else if (nextName.compareTo(\"decref\") == 0) {\r\n \t\t\t\tNode childRef = child.getFirstChild(); // now, get the text\r\n \t\t\t\t// decode the reference\r\n \t\t\t\tText refText = (Text) childRef;\r\n \t\t\t\tString stRef = refText.getData();\r\n \t\t\t\taddSubDecision((Decision) db.getRef(stRef));\r\n \r\n \t\t\t} else if (nextName.compareTo(\"questref\") == 0) {\r\n \t\t\t\tNode childRef = child.getFirstChild(); // now, get the text\r\n \t\t\t\t// decode the reference\r\n \t\t\t\tText refText = (Text) childRef;\r\n \t\t\t\tString stRef = refText.getData();\r\n \t\t\t\taddQuestion((Question) db.getRef(stRef));\r\n \r\n \t\t\t} else {\r\n \t\t\t\tSystem.out.println(\"unrecognized element under alternative!\");\r\n \t\t\t}\r\n \r\n \t\t\tchild = (Element) child.getNextSibling();\r\n \t\t}\r\n \t}", "public void deliverRawText(String text) {\n \n }", "public String getPlainText();", "private void consumeEntity(boolean inAttribute) throws SAXException,\n IOException {\n clearStrBuf();\n appendStrBuf('&');\n /*\n * This section defines how to consume an entity. This definition is\n * used when parsing entities in text and in attributes.\n * \n * The behaviour depends on the identity of the next character (the one\n * immediately after the U+0026 AMPERSAND character):\n */\n char c = read();\n switch (c) {\n case ' ':\n case '\\t':\n case '\\n':\n case '\\u000B':\n case '\\u000C':\n case '<':\n case '&':\n case '\\u0000':\n /*\n * U+0009 CHARACTER TABULATION U+000A LINE FEED (LF) U+000B LINE\n * TABULATION U+000C FORM FEED (FF) U+0020 SPACE U+003C\n * LESS-THAN SIGN U+0026 AMPERSAND EOF Not an entity. No\n * characters are consumed, and nothing is returned. (This is\n * not an error, either.)\n */\n if (inAttribute) {\n appendStrBufToLongStrBuf();\n } else {\n emitStrBuf();\n }\n unread(c);\n return;\n case '#':\n /*\n * U+0023 NUMBER SIGN (#) Consume the U+0023 NUMBER SIGN.\n */\n appendStrBuf('#');\n consumeNCR(inAttribute);\n return;\n default:\n unread(c);\n int entCol = -1;\n int lo = 0;\n int hi = (Entities.NAMES.length - 1);\n int candidate = -1;\n int strBufMark = 0;\n outer: for (;;) {\n entCol++;\n c = read();\n /*\n * Anything else Consume the maximum number of characters\n * possible, with the consumed characters case-sensitively\n * matching one of the identifiers in the first column of\n * the entities table.\n */\n hiloop: for (;;) {\n if (hi == -1) {\n break;\n }\n if (entCol == Entities.NAMES[hi].length()) {\n break hiloop;\n }\n if (entCol > Entities.NAMES[hi].length()) {\n break outer;\n } else if (c < Entities.NAMES[hi].charAt(entCol)) {\n hi--;\n } else {\n break hiloop;\n }\n }\n \n loloop: for (;;) {\n if (hi < lo) {\n break outer;\n }\n if (entCol == Entities.NAMES[lo].length()) {\n candidate = lo;\n strBufMark = strBufLen;\n lo++;\n } else if (entCol > Entities.NAMES[lo].length()) {\n break outer;\n } else if (c > Entities.NAMES[lo].charAt(entCol)) {\n lo++;\n } else {\n break loloop;\n }\n }\n if (hi < lo) {\n break outer;\n }\n appendStrBuf(c);\n }\n unread(c);\n // TODO warn about apos (IE) and TRADE (Opera)\n if (candidate == -1) {\n /* If no match can be made, then this is a parse error. */\n err(\"Text after \\u201C&\\u201D did not match an entity name.\");\n /*\n * No characters are consumed, and nothing is returned.\n */\n if (inAttribute) {\n appendStrBufToLongStrBuf();\n } else {\n emitStrBuf();\n }\n return;\n } else {\n if (!Entities.NAMES[candidate].endsWith(\";\")) {\n /*\n * If the last character matched is not a U+003B\n * SEMICOLON (;), there is a parse error.\n */\n err(\"Entity reference was not terminated by a semicolon.\");\n if (inAttribute) {\n /*\n * If the entity is being consumed as part of an\n * attribute, and the last character matched is not\n * a U+003B SEMICOLON (;),\n */\n if (strBufMark == strBufLen) {\n c = read();\n unread(c);\n } else {\n c = strBuf[strBufMark];\n }\n if ((c >= '0' && c <= '9')\n || (c >= 'A' && c <= 'Z')\n || (c >= 'a' && c <= 'z')) {\n /*\n * and the next character is in the range U+0030\n * DIGIT ZERO to U+0039 DIGIT NINE, U+0041 LATIN\n * CAPITAL LETTER A to U+005A LATIN CAPITAL\n * LETTER Z, or U+0061 LATIN SMALL LETTER A to\n * U+007A LATIN SMALL LETTER Z, then, for\n * historical reasons, all the characters that\n * were matched after the U+0026 AMPERSAND (&)\n * must be unconsumed, and nothing is returned.\n */\n appendStrBufToLongStrBuf();\n return;\n }\n }\n }\n \n /*\n * Otherwise, return a character token for the character\n * corresponding to the entity name (as given by the second\n * column of the entities table).\n */\n char[] val = Entities.VALUES[candidate];\n emitOrAppend(val, inAttribute);\n // this is so complicated!\n if (strBufMark < strBufLen) {\n if (inAttribute) {\n for (int i = strBufMark; i < strBufLen; i++) {\n appendLongStrBuf(strBuf[i]);\n }\n } else {\n tokenHandler.characters(strBuf, strBufMark,\n strBufLen - strBufMark);\n }\n }\n return;\n /*\n * If the markup contains I'm &notit; I tell you, the entity\n * is parsed as \"not\", as in, I'm ¬it; I tell you. But if\n * the markup was I'm &notin; I tell you, the entity would\n * be parsed as \"notin;\", resulting in I'm ∉ I tell you.\n */\n }\n \n }\n }", "public String getTextForDisplay() {\n\t\tif (textForDisplay == null) {\n\t\t\ttextForDisplay = \"\";\n\t\t\tif (text != null) {\n\t\t\t\ttextForDisplay = new String(text);\n\t\t\t}\n\t\t\tif (entities != null) {\n\t\t\t\tif (entities.urls != null) {\n\t\t\t\t\tfor (Url url : entities.urls) {\n\t\t\t\t\t\ttextForDisplay = textForDisplay.replace(url.url,\n\t\t\t\t\t\t\t\turl.display_url);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (entities.media != null) {\n\t\t\t\t\tfor (Media media : entities.media) {\n\t\t\t\t\t\ttextForDisplay = textForDisplay.replace(media.url,\n\t\t\t\t\t\t\t\tmedia.display_url);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\ttextForDisplay = textForDisplay.replace(\"&lt;\", \"<\")\n\t\t\t\t\t.replace(\"&gt;\", \">\").replace(\"&amp;\", \"&\");\n\t\t}\n\t\treturn textForDisplay;\n\t}", "public Map<String, Object> getIE(String text, FallBackListBased pd) {\n\t\ttext = text.replaceAll(\" � \", \", \");\n\t\ttext = text.replaceAll(\"'s \", \" \");\n\t\ttext = text.replaceAll(\"'s\", \"\");\n\t\ttext = text.replaceAll(\"�s \", \" \");\n\t\ttext = text.replaceAll(\"�s \", \" \");\n\t\ttext = text.replaceAll(\"\\\\?\", \"\");\n\t\ttext = text.replaceAll(\":\", \"\");\n\t\tMap<String, Object> entities_map = new TreeMap<String, Object>();\n\t\tMap<String, Object> extractedEntities = new TreeMap<String, Object>();\n\t\tList<TreeMap<String, String>> entities = new ArrayList<TreeMap<String, String>>();\n\t\tList<TreeMap<String, String>> intents= new ArrayList<TreeMap<String, String>>();\n\t\tSet<String> intentsList=new HashSet<String>();\n\t\tSet<String> entitiesList=new HashSet<String>();\n\t\t\n\t\tString input = text;\n\t\t// text=text.replaceAll(\" \", \" \");\n\t\tSpan spanSentences[] = pd.sentenceDetector.sentPosDetect(input);\n\t\tint sentenceId = 1;\n\t\tTreeMap<String, String> intents_map = new TreeMap<String, String>();\n\t\tDouble entites_highest_cofidence = 0.0;\n\t\tDouble intents_highest_cofidence = 0.0;\n\t\tfor (Span sentence : spanSentences) {\n\t\t\tArrayList<PhraseTemplate> phrases = pd.GetPhrases(sentence\n\t\t\t\t\t.getCoveredText(input).toString(), sentenceId++);\n\t\t\t\n\t\t\tfor (PhraseTemplate svo : phrases) {\n\t\t\t\tString key = svo.phrase;\n\t\t\t\tkey = key.replaceAll(\" is \", \"\");\n\t\t\t\tkey = key.replaceAll(\"What \", \"\");\n\t\t\t\tkey = key.replaceAll(\"what \", \"\");\n\t\t\t\tkey = key.replaceAll(\" the \", \"\");\n\n\t\t\t\tif (key.length() > 1) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tString resolvedEntity = lss.resolveEntity(key\n\t\t\t\t\t\t\t\t.toLowerCase().trim().toString(),\n\t\t\t\t\t\t\t\t\"entitesIndex\");\n\t\t\t\t\t\tString tokens[] = resolvedEntity.split(\"__\");\n//\t\t\t\t\t\tSystem.out.println(resolvedEntity+\" :: \"+key);\n\t\t\t\t\t\tif (tokens.length < 2)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tif (tokens[1].trim().startsWith(\"entity\")\n\t\t\t\t\t\t\t\t&& Double.parseDouble(tokens[5].trim())>0.9)\n\t\t\t\t\t\t\tentitiesList.add(tokens[5].trim());\n\t\t\t\t\t\tif (tokens[1].trim().startsWith(\"entity\")\n\t\t\t\t\t\t\t\t&& Double.parseDouble(tokens[5].trim()) > entites_highest_cofidence) {\n\t\t\t\t\t\t\tentities_map.clear();\n\t\t\t\t\t\t\tentities_map.put(\"Entity\", key.trim());\n\t\t\t\t\t\t\tentities_map.put(\"MappedEntity\", tokens[4].trim());\n\t\t\t\t\t\t\tentities_map.put(\"EntityConfidenceScore\", tokens[5].trim());\n\t\t\t\t\t\t\tentities_map.put(\"MappedEntityType\", tokens[2].trim());\n\t\t\t\t\t\t\tentites_highest_cofidence = Double\n\t\t\t\t\t\t\t\t\t.parseDouble(tokens[5].trim());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tokens[1].trim().startsWith(\"intent\")\n\t\t\t\t\t\t\t\t&& Double.parseDouble(tokens[5].trim())>0.9)\n\t\t\t\t\t\t\tintentsList.add(tokens[5].trim());\n\t\t\t\t\t\tif (tokens[1].trim().startsWith(\"intent\")\n\t\t\t\t\t\t\t\t&& Double.parseDouble(tokens[5].trim()) > intents_highest_cofidence) {\n\t\t\t\t\t\t\tintents_map.clear();\n\t\t\t\t\t\t\tintents_map.put(\"Id\", tokens[0].trim());\n\t\t\t\t\t\t\tintents_map.put(\"Extracted Entity\", key.trim());\n\t\t\t\t\t\t\tintents_map.put(\"Mapped Entity\", tokens[4].trim());\n\t\t\t\t\t\t\tintents_map.put(\"Confidence\", tokens[5].trim());\n\t\t\t\t\t\t\tintents_map.put(\"Class\", tokens[1].trim());\n\t\t\t\t\t\t\tintents_highest_cofidence = Double\n\t\t\t\t\t\t\t\t\t.parseDouble(tokens[5].trim());\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tentities_map.put(\"Intent\", intents_map.get(\"Extracted Entity\"));\n\t\tentities_map.put(\"MappedIntent\", intents_map.get(\"Mapped Entity\"));\n\t\tentities_map.put(\"IntentConfidenceScore\", intents_map.get(\"Confidence\"));\n\n\t\treturn entities_map;\n\t}", "private void parse() {\n stack.push(documentNode);\n try {\n Token token = lexer.nextToken();\n boolean tagOpened = false;\n\n while (token.getType() != TokenType.EOF) {\n\n if (token.getType() == TokenType.TEXT) {\n TextNode textNode = new TextNode((String) token.getValue());\n ((Node) stack.peek()).addChild(textNode);\n\n } else if (token.getType() == TokenType.TAG_OPEN) {\n if (tagOpened) {\n throw new SmartScriptParserException(\"The tag was previously open but is not yet closed.\");\n }\n tagOpened = true;\n lexer.setState(LexerState.TAG);\n\n } else if (token.getType() == TokenType.TAG_NAME && token.getValue().equals(\"=\")) {\n parseEchoTag(tagOpened);\n tagOpened = false;\n\n } else if (token.getType() == TokenType.TAG_NAME && ((String) token.getValue()).matches(\"[Ff][Oo][Rr]\")) {\n parseForTag(tagOpened);\n tagOpened = false;\n\n } else if (token.getType() == TokenType.TAG_NAME && ((String) token.getValue()).matches(\"[Ee][Nn][Dd]\")) {\n parseEndTag();\n tagOpened = false;\n } else {\n throw new SmartScriptParserException(PARSE_ERROR);\n }\n token = lexer.nextToken();\n }\n if (!(stack.peek() instanceof DocumentNode)) {\n throw new SmartScriptParserException(PARSE_ERROR);\n }\n } catch (LexerException | EmptyStackException exc) {\n throw new SmartScriptParserException(PARSE_ERROR);\n }\n}", "public ArrayList<String> makeSentences(String text) {\n \t\t/*\n \t\t * Quick check so we're not trying to split up an empty\n \t\t * String. This only happens right before the user types\n \t\t * at the end of a document and we don't have anything to\n \t\t * split, so return.\n \t\t */\n \t\tif (text.equals(\"\")) {\n \t\t\tArrayList<String> sents = new ArrayList<String>();\n \t\t\tsents.add(\"\");\n \t\t\treturn sents;\n \t\t}\n \t\t\n \t\t/**\n \t\t * Because the eosTracker isn't initialized until the TaggedDocument is,\n \t\t * it won't be ready until near the end of DocumentProcessor, in which\n \t\t * case we want to set it to the correct\n \t\t */\n \t\tthis.eosTracker = main.editorDriver.taggedDoc.eosTracker;\n \t\tthis.editorDriver = main.editorDriver;\n \t\t\n \t\tArrayList<String> sents = new ArrayList<String>(ANONConstants.EXPECTED_NUM_OF_SENTENCES);\n \t\tArrayList<String> finalSents = new ArrayList<String>(ANONConstants.EXPECTED_NUM_OF_SENTENCES);\n \t\tboolean mergeNext = false;\n \t\tboolean mergeWithLast = false;\n \t\tboolean forceNoMerge = false;\n \t\tint currentStart = 1;\n \t\tint currentStop = 0;\n \t\tString temp;\n \n \t\t/**\n \t\t * replace unicode format characters that will ruin the regular\n \t\t * expressions (because non-printable characters in the document still\n \t\t * take up indices, but you won't know they're there untill you\n \t\t * \"arrow\" though the document and have to hit the same arrow twice to\n \t\t * move past a certain point. Note that we must use \"Cf\" rather than\n \t\t * \"C\". If we use \"C\" or \"Cc\" (which includes control characters), we\n \t\t * remove our newline characters and this screws up the document. \"Cf\"\n \t\t * is \"other, format\". \"Cc\" is \"other, control\". Using \"C\" will match\n \t\t * both of them.\n \t\t */\n \t\ttext = text.replaceAll(\"\\u201C\",\"\\\"\");\n \t\ttext = text.replaceAll(\"\\u201D\",\"\\\"\");\n \t\ttext = text.replaceAll(\"\\\\p{Cf}\",\"\");\n \n \t\tint lenText = text.length();\n \t\tint index = 0;\n \t\tint buffer = editorDriver.sentIndices[0];\n \t\tString safeString = \"\";\n \t\tMatcher abbreviationFinder = ABBREVIATIONS_PATTERN.matcher(text);\n \t\t\n \t\t//================ SEARCHING FOR ABBREVIATIONS ================\n \t\twhile (index < lenText-1 && abbreviationFinder.find(index)) {\n \t\t\tindex = abbreviationFinder.start();\n \t\t\t\n \t\t\ttry {\n \t\t\t\tint abbrevLength = index;\n \t\t\t\twhile (text.charAt(abbrevLength) != ' ') {\n \t\t\t\t\tabbrevLength--;\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif (ABBREVIATIONS.contains(text.substring(abbrevLength+1, index+1))) {\n \t\t\t\t\teosTracker.setIgnore(index+buffer, true);\n \t\t\t\t}\n \t\t\t} catch (Exception e) {}\n \t\t\t\n \t\t\tindex++;\n \t\t}\t\t\n \t\t\n \t\tMatcher sent = EOS_chars.matcher(text);\n \t\tboolean foundEOS = sent.find(currentStart); // xxx TODO xxx take this EOS character, and if not in quotes, swap it for a permanent replacement, and create and add an EOS to the calling TaggedDocument's eosTracker.\n \t\t\n \t\t/*\n \t\t * We want to check and make sure that the EOS character (if one was found) is not supposed to be ignored. If it is, we will act like we did not\n \t\t * find it. If there are multiple sentences with multiple EOS characters passed it will go through each to check, foundEOS will only be true if\n \t\t * an EOS exists in \"text\" that would normally be an EOS character and is not set to be ignored.\n \t\t */\n \t\t\n \t\tindex = 0;\n \t\tif (foundEOS) {\t\n \t\t\ttry {\n \t\t\t\twhile (index < lenText-1 && sent.find(index)) {\n \t\t\t\t\tindex = sent.start();\n \t\t\t\t\tif (!eosTracker.sentenceEndAtIndex(index+buffer)) {\n \t\t\t\t\t\tfoundEOS = false;\n \t\t\t\t\t} else {\n \t\t\t\t\t\tfoundEOS = true;\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t\tindex++;\n \t\t\t\t}\n \t\t\t} catch (IllegalStateException e) {}\n \t\t}\n \t\t//We need to reset the Matcher for the code below\n \t\tsent = EOS_chars.matcher(text);\n \t\tsent.find(currentStart);\n \t\t\n \t\tMatcher sentEnd;\n \t\tMatcher citationFinder;\n \t\tboolean hasCitation = false;\n \t\tint charNum = 0;\n \t\tint lenTemp = 0;\n \t\tint lastQuoteAt = 0;\n \t\tint lastParenAt = 0;\n \t\tboolean foundQuote = false;\n \t\tboolean foundParentheses = false;\n \t\tboolean isSentence;\n \t\tboolean foundAtLeastOneEOS = foundEOS;\n \t\t\n \t\t/**\n \t\t * Needed otherwise when the user has text like below:\n \t\t * \t\tThis is my sentence one. This is \"My sentence?\" two. This is the last sentence.\n \t\t * and they begin to delete the EOS character as such:\n \t\t * \t\tThis is my sentence one. This is \"My sentence?\" two This is the last sentence.\n \t\t * Everything gets screwed up. This is because the operations below operate as expected only when there actually is an EOS character\n \t\t * at the end of the text, it expects it there in order to function properly. Now usually if there is no EOS character at the end it wouldn't\n \t\t * matter since the while loop and !foundAtLeastOneEOS conditional are executed properly, BUT as you can see the quotes, or more notably the EOS character inside\n \t\t * the quotes, triggers this initial test and thus the operation breaks. This is here just to make sure that does not happen.\n \t\t */\n \t\tString trimmedText = text.trim();\n \t\tint trimmedTextLength = trimmedText.length();\n \n \t\t//We want to make sure that if there is an EOS character at the end that it is not supposed to be ignored\n \t\tboolean EOSAtSentenceEnd = true;\n \t\tif (trimmedTextLength != 0) {\n \t\t\tEOSAtSentenceEnd = EOS.contains(trimmedText.substring(trimmedTextLength-1, trimmedTextLength)) && eosTracker.sentenceEndAtIndex(editorDriver.sentIndices[1]-1);\n \t\t} else {\n \t\t\tEOSAtSentenceEnd = false;\n \t\t}\n \t\t\n \t\t//Needed so that if we are deleting abbreviations like \"Ph.D.\" this is not triggered.\n \t\tif (!EOSAtSentenceEnd && (editorDriver.taggedDoc.watchForEOS == -1))\n \t\t\tEOSAtSentenceEnd = true;\n \n \t\twhile (foundEOS == true) {\n \t\t\tcurrentStop = sent.end();\n \t\t\t\n \t\t\t//We want to make sure currentStop skips over ignored EOS characters and stops only when we hit a true EOS character\n \t\t\ttry {\n \t\t\t\twhile (!eosTracker.sentenceEndAtIndex(currentStop+buffer-1) && currentStop != lenText) {\n \t\t\t\t\tsent.find(currentStop+1);\n \t\t\t\t\tcurrentStop = sent.end();\n \t\t\t\t}\n \t\t\t} catch (Exception e) {}\n \n \t\t\ttemp = text.substring(currentStart-1,currentStop);\n \t\t\tlenTemp = temp.length();\n \t\t\tlastQuoteAt = 0;\n \t\t\tlastParenAt = 0;\n \t\t\tfoundQuote = false;\n \t\t\tfoundParentheses = false;\n \t\t\t\n \t\t\tfor(charNum = 0; charNum < lenTemp; charNum++){\n \t\t\t\tif (temp.charAt(charNum) == '\\\"') {\n \t\t\t\t\tlastQuoteAt = charNum;\n \t\t\t\t\t\n \t\t\t\t\tif (foundQuote == true)\n \t\t\t\t\t\tfoundQuote = false;\n \t\t\t\t\telse\n \t\t\t\t\t\tfoundQuote = true;\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif (temp.charAt(charNum) == '(') {\n \t\t\t\t\tlastParenAt = charNum;\n \t\t\t\t\t\n \t\t\t\t\tif (foundParentheses)\n \t\t\t\t\t\tfoundParentheses = false;\n \t\t\t\t\telse\n \t\t\t\t\t\tfoundParentheses = true;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tif (foundQuote == true && ((temp.indexOf(\"\\\"\",lastQuoteAt+1)) == -1)) { // then we found an EOS character that shouldn't split a sentence because it's within an open quote.\n \t\t\t\tif ((currentStop = text.indexOf(\"\\\"\",currentStart +lastQuoteAt+1)) == -1) {\n \t\t\t\t\tcurrentStop = text.length(); // if we can't find a closing quote in the rest of the input text, then we assume the author forgot to put a closing quote, and act like it's at the end of the input text.\n \t\t\t\t}\n \t\t\t\telse{\n \t\t\t\t\tcurrentStop +=1;\n \t\t\t\t\tmergeNext=true;// the EOS character we are looking for is not in this section of text (section being defined as a substring of 'text' between two EOS characters.)\n \t\t\t\t}\n \t\t\t}\n \t\t\tsafeString = text.substring(currentStart-1,currentStop);\n \t\t\t\n \t\t\tif (foundParentheses && ((temp.indexOf(\")\", lastParenAt+1)) == -1)) {\n \t\t\t\tif ((currentStop = text.indexOf(\")\", currentStart + lastParenAt + 1)) == -1)\n \t\t\t\t\tcurrentStop = text.length();\n \t\t\t\telse {\n \t\t\t\t\tcurrentStop += 1;\n \t\t\t\t\tmergeNext = true;\n \t\t\t\t}\n \t\t\t}\n \t\t\tsafeString = text.substring(currentStart-1,currentStop);\n \n \t\t\tif (foundQuote) {\n \t\t\t\tsentEnd = SENTENCE_QUOTE.matcher(text);\t\n \t\t\t\tisSentence = sentEnd.find(currentStop-2); // -2 so that we match the EOS character before the quotes (not -1 because currentStop is one greater than the last index of the string -- due to the way substring works, which is includes the first index, and excludes the end index: [start,end).)\n \n \t\t\t\tif (isSentence == true) { // If it seems that the text looks like this: He said, \"Hello.\" Then she said, \"Hi.\" \n \t\t\t\t\t// Then we want to split this up into two sentences (it's possible to have a sentence like this: He said, \"Hello.\")\n \t\t\t\t\tcurrentStop = text.indexOf(\"\\\"\",sentEnd.start())+1;\n \t\t\t\t\tsafeString = text.substring(currentStart-1,currentStop);\n \t\t\t\t\tforceNoMerge = true;\n \t\t\t\t\tmergeNext = false;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tif (foundParentheses) {\n \t\t\t\tsentEnd = SENTENCE_PARENTHESES.matcher(text);\n \t\t\t\tisSentence = sentEnd.find(currentStop-2);\n \t\t\t\t\n \t\t\t\tif (isSentence == true) {\n \t\t\t\t\tcurrentStop = text.indexOf(\")\", sentEnd.start()) + 1;\n \t\t\t\t\tsafeString = text.substring(currentStart-1, currentStop);\n \t\t\t\t\tforceNoMerge = true;\n \t\t\t\t\tmergeNext = false;\n \t\t\t\t}\n \t\t\t}\n \n \t\t\t// now check to see if there is a CITATION after the sentence (doesn't just apply to quotes due to paraphrasing)\n \t\t\t// The rule -- at least as of now -- is if after the EOS mark there is a set of parenthesis containing either one word (name) or a name and numbers (name 123) || (123 name) || (123-456 name) || (name 123-456) || etc..\n \t\t\tcitationFinder = CITATION.matcher(text.substring(currentStop));\t\n \t\t\thasCitation = citationFinder.find(); // -2 so that we match the EOS character before the quotes (not -1 because currentStop is one greater than the last index of the string -- due to the way substring works, which is includes the first index, and excludes the end index: [start,end).)\n \t\t\t\n \t\t\tif (hasCitation == true) { // If it seems that the text looks like this: He said, \"Hello.\" Then she said, \"Hi.\" \n \t\t\t\t// Then we want to split this up into two sentences (it's possible to have a sentence like this: He said, \"Hello.\")\n \t\t\t\tcurrentStop = text.indexOf(\")\",citationFinder.start()+currentStop)+1;\n \t\t\t\tsafeString = text.substring(currentStart-1,currentStop);\n \t\t\t\tmergeNext = false;\n \t\t\t}\t\n \t\t\t\n \t\t\tif (mergeWithLast) {\n \t\t\t\tmergeWithLast=false;\n \t\t\t\tString prev=sents.remove(sents.size()-1);\n \t\t\t\tsafeString=prev+safeString;\n \t\t\t}\n \t\t\t\n \t\t\tif (mergeNext && !forceNoMerge) {//makes the merge happen on the next pass through\n \t\t\t\tmergeNext=false;\n \t\t\t\tmergeWithLast=true;\n \t\t\t} else {\n \t\t\t\tforceNoMerge = false;\n \t\t\t\tfinalSents.add(safeString);\n \t\t\t}\n \t\t\n \t\t\tsents.add(safeString);\n \t\t\t\n \t\t\t//// xxx xxx xxx return the safeString_subbedEOS too!!!!\n \t\t\tif (currentStart < 0 || currentStop < 0) {\n \t\t\t\tLogger.logln(NAME+\"Something went really wrong making sentence tokens.\", LogOut.STDERR);\n \t\t\t\tErrorHandler.fatalProcessingError(null);\n \t\t\t}\n \n \t\t\tcurrentStart = currentStop+1;\n \t\t\tif (currentStart >= lenText) {\n \t\t\t\tfoundEOS = false;\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n \t\t\tfoundEOS = sent.find(currentStart);\n \t\t}\n \n \t\tif (!foundAtLeastOneEOS || !EOSAtSentenceEnd) {\n \t\t\tArrayList<String> wrapper = new ArrayList<String>(1);\n \t\t\twrapper.add(text);\n \t\t\treturn wrapper;\n \t\t}\n \t\t\n \t\treturn finalSents;\n \t}", "private static String pipelineMRC(String text, boolean debugMode, boolean onlyConceptTag) {\n\t\tif (debugMode) System.out.println(\"pipelineMRC_POS_NER function \");\n\t\ttext = text.replaceAll(\"&apos;\",\"\\'\");\n\t\tif (debugMode) System.out.println(\"MetaMap extracting concepts\");\n\t\t//String MetaMapText = MetaMapHandler.getAnnotatedXMLTags(text, debugMode);\n\t\tString LocalMetaMapText = LocalMetaMapHandler.getAnnotatedXMLTags(text);\n\n\t\t//Debugging\n\t\t//System.out.println(\"----------------------------------------------------\");\n\t\t//System.out.println(MetaMapText);\n\t\t//System.out.println(LocalMetaMapText);\n\t\t//System.out.println(\"----------------------------------------------------\");\n\t\t//End of Debugging\n\n\t\tif (debugMode) System.out.println(\"MetaMap concepts extracted\");\n\n\t\tif(!onlyConceptTag) {\n\t\t\tLocalMetaMapText = \"<content><text>\" + LocalMetaMapText;\n\t\t\tLocalMetaMapText = LocalMetaMapText.replaceAll(Pattern.quote(\"<concept\"), \"</text><concept\");\n\t\t\tLocalMetaMapText = LocalMetaMapText.replaceAll(Pattern.quote(\"</concept>\"), \"</concept><text>\");\n\t\t\tLocalMetaMapText = LocalMetaMapText + \"</text></content>\";\n\t\t}\n\n\t\treturn LocalMetaMapText;\n\t}", "public EntityAnnotator_V2(){\n init();\n //TODO modify reg_v2.xml to deal with paragraphs. at the moment, it only works if this file has only regulations.\n }", "protected void extract() {\n\t\tfor (ITSState nodeState : doc.iterNodes()) {\n\t\t\tNode node = nodeState.node;\n\t\t\tRuleResolver resolver = resolvers.get(node.getNodeName()); \n\t\t\tif (resolver != null) {\n\t\t\t\tGlobalRule rule = resolver.extractRule(attrReader, parameters, nodeState.node);\n\t\t\t\tapplyRule(resolver, rule);\n\t\t\t}\n\t\t\t\n\t\t\tif (node.getNodeName().equals(\"its:param\")) {\n\t\t\t\tString name = node.getAttributes().getNamedItem(\"name\").getNodeValue();\n\t\t\t\tString value = node.getTextContent();\n\t\t\t\tparameters.add(name, value);\n\t\t\t} else if (attrReader.dialect.isRules(node)) { \n\t\t\t\t// we have external link (xlink:href or link href)\n\t\t\t\tString external = attrReader.dialect.getExternalRules(node);\n\t\t\t\tif (external != null) {\n\t\t\t\t\textractExternalRules(external);\n\t\t\t\t}\n\t\t\t} else if (node.getNodeName().equals(\"script\")) {\n\t\t\t\t// we have embedded\n\t\t\t\tif (node.hasAttributes()) {\n\t\t\t\t\tif (node.getAttributes().getNamedItem(\"type\").getNodeValue().equals(\"application/its+xml\")) {\n\t\t\t\t\t\textractEmbeddedRules(node.getTextContent());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!nodeState.nodePath.contains(\"its:rules\")) {\n\t\t\t\t// unless we're in rules, look at local annotations\n\t\t\t\t// LOCAL\n\t\t\t\textractLocal(nodeState);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// process inheritance\n\t\tfor (ITSState nodeState : doc.iterNodes()) {\n\t\t\t// Elements: handle inheritance \n\t\t\tITSData parentData = getParentState(nodeState);\n\t\t\tif (parentData != null) {\n\t\t\t\t// inherit from parent\n\t\t\t\tITSData thisData = nodeItsData.get(nodeState.nodePath);\n\t\t\t\tif (thisData == null) {\n\t\t\t\t\tthisData = new ITSData();\n\t\t\t\t\tapplyRuleToNode(nodeState.nodePath, thisData);\n\t\t\t\t} \n\t\t\t\tthisData.inherit(parentData);\t\t\t\t\n\t\t\t}\t\n\t\t\t\t\t\t\n\t\t} \n\t\t\n\t\t\n\t}", "private void debugRenderTextInfos() {\n\t\tdebugRenderEntityTextInfosList(layerNegOneEntities);\n\t\tdebugRenderEntityTextInfosList(layerZeroEntities);\n\t\tdebugRenderEntityTextInfosList(layerOneEntities);\n\t}", "private void generateView(String component) {\n Matcher matcher = null;\n\n // Match <h2> tag and separate it if any\n matcher = Pattern.compile(Data.H2_REGEX_MATCHER).matcher(component);\n if (matcher.find()) {\n // h2 has been found\n h2Detected(component, matcher);\n return;\n }\n\n // Match <img> tag and separate it if any\n matcher = Pattern.compile(Data.IMG_REGEX_MATCHER).matcher(component);\n if (matcher.find()) {\n // img thas been found\n imgDetected(matcher);\n return;\n }\n\n // inflate just normal text\n createParagraphView(component);\n }", "private Map<String, Map<String,Integer>> openNLPParse(String text) {\n\t\tMap<String, Map<String,Integer>> result = new HashMap<String, Map<String,Integer>>();\n\t\tString path = \"\";\n\t\t\n\t\tfor (String type : this.entityTypes) {\n\t\t\tpath = \"en-ner-\" + type.toLowerCase() + \".bin\";\n\t\t\tthis.nlp = new OpenNLPNameFinder(type, path);\n\t\t\tMap<String,Integer> entities = nlp.recogniseWithCounts(text);\n\t\t\tresult.put(type, entities);\n\t\t}\n\n\t\treturn result;\n\t}", "private void handleTextHtml(MimePart container, String htmlPartValue) throws MessagingException {\n // container could be MimeBodyPart or MimeMessage\n\n boolean doTransform = false; //?? revisit later\n if (doTransform) {\n htmlPartValue = EmailUtil.transformToTextHtml(\n htmlPartValue,\n this.mDefaultCharset);\n }\n\n if (this.mEmbedImagesInHtml) {\n this.handleMultipartRelated(container, htmlPartValue);\n } else {\n container.setText(htmlPartValue, this.mDefaultCharset, \"html\");\n }\n return;\n }", "TextWithReferences getTextWithReferences();", "@Override\n public String loadTextWidget() {\n /* Get the complete E19 text and display it. */\n String text = getText(E19_ALLPAGES);\n text = text.replace(\"null\", \"\");\n\n return text;\n }", "public static void preprocessWikipediaInformation(LocationDataIO locationData) {\n\t\ttry {\n\t\t\tSAXParserFactory factory = SAXParserFactory.newInstance();\n\t\t\tfactory.setFeature(\"http://xml.org/sax/features/validation\", false);\n\t\t\tfactory.setFeature(\"http://apache.org/xml/features/continue-after-fatal-error\", true);\n\t\t\tfactory.setFeature(\"http://apache.org/xml/features/continue-after-fatal-error\", true);\n\t\t\tSAXParser parser = factory.newSAXParser();\n\n\t\t\tIterator<POI> iter = locationData.getPOIs().iterator();\n\t\t\twhile (iter.hasNext()) {\n\t\t\t\tPOI current = iter.next();\n\t\t\t\tif (current.getURL() != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tSystem.out.print(current.getName());\n\t\t\t\t\t\tURL url = current.getURL();\n\t\t\t\t\t\tURLConnection connection = url.openConnection();\n\t\t\t\t\t\tconnection.connect();\n\t\t\t\t\t\tInputSource input = new InputSource(connection.getInputStream());\n\t\t\t\t\t\tString lang = current.getURL().toExternalForm();\n\t\t\t\t\t\tif (lang.length() > 9 && lang.substring(7, 9).matches(\"[a-zA-Z]{2}\")) {\n\t\t\t\t\t\t\tlang = lang.substring(7, 9);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlang = \"de\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tWikipediaHandler handler = new WikipediaHandler(lang);\n\n\t\t\t\t\t\tparser.parse(input, handler);\n\t\t\t\t\t\tcurrent.setTextInfo(handler.getFirstParagraphs());\n\t\t\t\t\t\tcurrent.setURL(handler.getImageURL());\n\t\t\t\t\t\tSystem.out.print(\" ✓\\n\");\n\t\t\t\t\t} catch (SAXException e) {\n\t\t\t\t\t\tlogger.info(String.format(\"Schwerwiegender Syntaxfehler in %s! Wird ignoriert.\", current.getURL().toExternalForm()));\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tlogger.info(current.getURL().toExternalForm() + \" konnte nicht gelesen werden! Wird ignoriert.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (ParserConfigurationException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SAXNotRecognizedException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SAXNotSupportedException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SAXException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public abstract WordEntry manualTranslate(String text, String from, String to);", "@Override\n public void process(JCas jCas) throws AnalysisEngineProcessException {\n JCas viewJCas = jCas;\n if (!view.equals(VIEW_SYSTEM)) {\n try {\n viewJCas = jCas.getView(view);\n } catch (CASException e) {// just rethrow\n throw new AnalysisEngineProcessException(e);\n }\n }\n\n Collection<de.julielab.jules.types.Sentence> sentences = select(\n viewJCas, de.julielab.jules.types.Sentence.class);\n\n for (de.julielab.jules.types.Sentence julesSentence : sentences) {\n int sentence_start = julesSentence.getBegin();\n\n if (julesSentence.getCoveredText().length() > 0) {\n\n try {\n Sentence sentence = new Sentence(\n julesSentence.getCoveredText());\n bannerTokenizer.tokenize(sentence);\n crfTagger.tag(sentence);// error\n if (postProcessor != null)\n postProcessor.postProcess(sentence);\n\n for (Mention mention : sentence.getMentions()) {\n\n int startChar = mention.getStartChar() + sentence_start;\n int endChar = mention.getEndChar() + sentence_start;\n // LOG.debug(\"found NE:\" + mention.getText() + \" \" +\n // startChar\n // + \":\" + endChar);\n Protein prot = new Protein(viewJCas, startChar, endChar);\n prot.setName(mention.getText());\n prot.setTextualRepresentation(\"⊂PROT⊃\");\n prot.addToIndexes();\n }\n\n } catch (Throwable t) {\n // not sure why, but this happens sometimes after some time\n int docId = getHeaderIntDocId(viewJCas);\n LOG.warn(\"Banner exception at docId {}, skipping. {}\",\n docId, StringUtils.print(t));\n try {\n GarbageCollectorAnnotator.runGC();\n loadTagger(); // reload\n } catch (Exception e) {\n throw new AnalysisEngineProcessException(e);\n }\n }\n }\n }\n }", "private void convertTextBoxes(XWPFParagraph paragraph) {\n XmlCursor cursor = paragraph.getCTP().newCursor();\n cursor.selectPath(\"declare namespace w='http://schemas.openxmlformats.org/wordprocessingml/2006/main' .//*/w:txbxContent/w:p/w:r\");\n\n List<XmlObject> ctrsintxtbx = new ArrayList<>();\n\n while (cursor.hasNextSelection()) {\n cursor.toNextSelection();\n XmlObject obj = cursor.getObject();\n ctrsintxtbx.add(obj);\n }\n for (XmlObject xmlObject : ctrsintxtbx) {\n CTR ctr = null;\n try {\n ctr = CTR.Factory.parse(xmlObject.toString());\n XWPFRun textBoxRun = new XWPFRun(ctr, paragraph);\n// textBoxRun.getText(0);\n String fontFamily = getFontFamily(textBoxRun);\n String[] convertedText = engine.toUnicode(textBoxRun.getText(0), fontFamily);\n String sConvertedText = convertedText[0];\n textBoxRun.setText(sConvertedText, 0);\n// System.out.println(sConvertedText);\n logger.info(\"Text of textbox : \" + textBoxRun.getText(0));\n this.setFontFamily(textBoxRun, convertedText[1]);\n\n xmlObject.set(textBoxRun.getCTR());\n } catch (XmlException e) {\n e.printStackTrace();\n }\n\n }\n }", "void setTextDecoder(TextDecoder decoder);", "@Before\n\tpublic void setUp() throws Exception {\n\t\tList<Paragraph> paragraphs = new ArrayList<Paragraph>();\n\t\tList<Paragraph> paragraphsWithNoSentences = new ArrayList<Paragraph>();\n\t\t\n\t\tScanner sc = null, sc1 = null;\n\t\ttry {\n\t\t\tsc = new Scanner(new File(\"testsearchtext.txt\"));\n\t\t\tsc1 = new Scanner(new File(\"testsearchentity.txt\"));\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tsc.useDelimiter(\"[.]\");\n\t\tsc1.useDelimiter(\"[|]\");\n\t\t\n\t\tList<Sentence> sentences = new ArrayList<Sentence>();\n\t\tint sCount = 0;\n\t\tint pCount = 0;\n\t\twhile(sc.hasNext()){\n\t\t\tString temp = sc.next().trim();\n\n\t\t\tif(sCount > 0 && (sCount%10 == 0 || !sc.hasNext())){\n\t\t\t\tParagraph p = new Paragraph(pCount);\n\t\t\t\tparagraphsWithNoSentences.add(p);\n\t\t\t\t\n\t\t\t\tp = new Paragraph(pCount);\n\t\t\t\tp.setSentences(sentences);\n\t\t\t\tparagraphs.add(p);\n\t\t\t\tpCount++;\n\t\t\t\t\n\t\t\t\tsentences = new ArrayList<Sentence>();\n\t\t\t}\n\t\t\t\n\t\t\tif(!temp.equals(\"\"))\n\t\t\t\tsentences.add(new Sentence((sCount%10), temp));\n\t\t\t\n\t\t\tsCount++;\n\t\t}\n\t\t\n\t\tList<Entity> entities = new ArrayList<Entity>();\n\t\tint currType = -1; \n\t\twhile(sc1.hasNext()){\n\t\t\tString temp = sc1.next().trim();\n\t\t\tif(temp.equals(\"place\")){currType = Entity.PLACE;} else\n\t\t\tif(temp.equals(\"url\")){currType = Entity.URL;} else\n\t\t\tif(temp.equals(\"email\")){currType = Entity.EMAIL;} else\n\t\t\tif(temp.equals(\"address\")){currType = Entity.ADDRESS;} \n\t\t\telse{\n\t\t\t\tentities.add(new Entity(currType, temp));\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tSource s = new Source(\"testsearchtext.txt\", \"testsearchtext.txt\");\n\t\tpt1 = new ProcessedText(s, paragraphs, null); \n\t\t\n\t\ts = new Source(\"testsearchtext1.txt\", \"testsearchtext1.txt\");\n\t\tpt2 = new ProcessedText(s, paragraphsWithNoSentences, null); \n\t\t\n\t\tpt3 = new ProcessedText();\n\t\tpt3.setParagraphs(paragraphs);\n\t\t\n\t\tpt4 = new ProcessedText();\n\t\ts = new Source(\"testsearchtext2.txt\", \"testsearchtext2.txt\");\n\t\tpt4.setMetadata(s);\n\t\t\n\t\ts = new Source(\"testsearchtext3.txt\", \"testsearchtext3.txt\");\n\t\tpt5 = new ProcessedText(s, paragraphs, entities); \n\t\t\n\t\ts = new Source(\"testsearchtext4.txt\", \"testsearchtext4.txt\");\n\t\tpt6 = new ProcessedText(s, null, entities); \n\t}", "public CompiledPage postprocess(\n\t PageId pageId,\n\t String wikitext,\n\t ExpansionCallback callback)\n\t throws CompilerException\n\t{\n\t\tif (pageId == null)\n\t\t\tthrow new NullPointerException();\n\t\t\n\t\tPageTitle title = pageId.getTitle();\n\t\t\n\t\tCompilerLog log = new CompilerLog();\n\t\tlog.setTitle(title.getFullTitle());\n\t\tlog.setRevision(pageId.getRevision());\n\t\t\n\t\tLazyParsedPage pAst;\n\t\ttry\n\t\t{\n\t\t\tEntityMap entityMap = new EntityMap();\n\t\t\t\n\t\t\tString validatedWikitext =\n\t\t\t validate(title, wikitext, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage ppAst =\n\t\t\t preprocess(title, validatedWikitext, false, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage pprAst = ppAst;\n\t\t\tif (callback != null)\n\t\t\t\tpprAst = expand(callback, title, ppAst, entityMap, null, false, log);\n\t\t\t\n\t\t\tpAst = parse(title, pprAst, entityMap, log);\n\t\t\t\n\t\t\tpAst = postprocess(title, pAst, log);\n\t\t}\n\t\tcatch (CompilerException e)\n\t\t{\n\t\t\te.attachLog(log);\n\t\t\tthrow e;\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tthrow new CompilerException(\"Compilation failed!\", e, log);\n\t\t}\n\t\t\n\t\treturn new CompiledPage(\n\t\t new Page(pAst.getContent()),\n\t\t pAst.getWarnings(),\n\t\t log);\n\t}", "@Override\n public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {\n // <document>\n if (localName.equals(\"document\")) {\n curArticle = new ArticleSmallOpinion();\n curTagiot = new ArrayList<Tagit>();\n\n // add values\n if (atts.getValue(\"doc_id\") != null) curArticle.setDoc_id(atts.getValue(\"doc_id\"));\n if (atts.getValue(\"title\") != null) curArticle.setTitle(atts.getValue(\"title\"));\n if (atts.getValue(\"sub_title\") != null) curArticle.setSubTitle(atts.getValue(\"sub_title\"));\n if (atts.getValue(\"f7\") != null) curArticle.setF7(atts.getValue(\"f7\"));\n String author = atts.getValue(\"author_icon\");\n author = extractImageUrl(author);\n if (atts.getValue(\"author_icon\") != null) curArticle.setAuthorImgURL(author);\n if (atts.getValue(\"Created_On\") != null) curArticle.setCreatedOn(atts.getValue(\"Created_On\"));\n\n }\n // <f2>\n else if (localName.equals(\"f2\")) {\n if (atts.getValue(\"src\") != null) curArticle.setF2(atts.getValue(\"src\"));\n\n // currently not holding image photographer via \"title=\"\n }\n // <f3>\n if (localName.equals(\"f3\")) {\n if (atts.getValue(\"src\") != null) curArticle.setF3(atts.getValue(\"src\"));\n // currently not holding image photographer via \"title=\"\n }\n // <f4>\n else if (localName.equals(\"f4\")) {\n if (atts.getValue(\"src\") != null) curArticle.setF4(atts.getValue(\"src\"));\n // currently not holding image photographer via \"title=\"\n }\n // <tagit>\n else if (localName.equals(\"tagit\")) {\n Tagit tagit = new Tagit(atts.getValue(\"id\"), atts.getValue(\"simplified\"), \"\");\n curTagiot.add(tagit);\n }\n\n }", "public void convert() {\r\n if (text != null && !text.isEmpty()) {\r\n // trim spaces at the edges, convert all to lowercase and\r\n // remove all non-alpha numeric characters\r\n String url = text.trim().toLowerCase().replaceAll(\"[^a-z0-9_\\\\s-]\", \"\"); \r\n // change all multiple white spaces to single white space\r\n url = url.replaceAll(\"[\\\\s-]+\", \" \");\r\n // replace all the single white spaces with a dash\r\n seoUrl = url.replaceAll(\"[\\\\s]\", \"-\");\r\n // at this point we will save the product in the database \r\n // with SEO friendly URL appended with the product ID at the end\r\n // Let's say the product ID is 12345\r\n Long productId = 12345L;\r\n seoUrl += \"-\" + productId; \r\n System.out.println(\"SEO Friendly URL --> \" + seoUrl);\r\n } else {\r\n seoUrl = \"Please enter text to convert\";\r\n }\r\n }", "@SuppressWarnings(\"static-access\")\n\tpublic void detection(Request text) {\n\t\t//Fichiertxt fichier;\n\t\ttry {\t\t\t\t\t\n\t\t\t//enregistrement et affichage de la langue dans une variable lang\n\t\t\ttext.setLang(identifyLanguage(text.getCorpText()));\n\t\t\t//Ajoute le fichier traité dans la Base\n\t\t\tajouterTexte(text);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"fichier texte non trouvé\");\n\t e.printStackTrace();\n\t\t}\n\t}", "public static void convertTextParts(TextContainer tc) {\r\n \t\tfor (TextPart textPart : tc) {\r\n \t\t\tconvertTextPart(textPart);\r\n \t\t}\r\n \t}", "public static String transformPlainText(String text) {\r\n\t\t// url auto-linking\r\n\t\ttext = text.replaceAll(\"((http|https)://[0-9A-Za-z-_=\\\\?\\\\.\\\\$#&/]*)\", \"<a href=\\\"$1\\\">$1</a>\");\r\n\t\tString html = \"<pre>\" + text + \"</pre>\";\r\n\t\treturn html;\r\n\t}", "private void createStructuredDocumentTag(CTSdtPr sdtPr, String text) {\n\t\t// The properties contain (among others) aliases (<w:alias>), tag names (w:tag)\n\t\t// and a flag (<w:showingPlcHdr>) whether the content is placeholder or real content.\n\t\tString alias = getCTStringVal(getFirst(sdtPr.getAliasArray()));\n\t\tString tagName = getCTStringVal(getFirst(sdtPr.getTagArray()));\n\t\tboolean isPlaceholder = sdtPr.getShowingPlcHdrArray().length > 0;\n\n\t\tObject value = null;\n\t\t// If placeholder is set, the element is not filled by the user\n\t\tif (!isPlaceholder) {\n\t\t\tvalue = text;\n\n\t\t\t// The following child element can occur and determine the type of the structured\n\t\t\t// document tag: equation, comboBox (*), date (*), docPartObj, docPartList,\n\t\t\t// dropDownList (*), picture, richText (*), text (*), citation, group, bibliography.\n\n\t\t\t// Note that we can't use the typed method (e.g sdtPr.getComboBoxArray()) here\n\t\t\t// because in the small (poi-)ooxml-schemas.jar bundled with POI, the specialized\n\t\t\t// classes (e.g. CTStdComboBox) are missing. Trying to use these methods will fail\n\t\t\t// with a NoClassDefFoundError exception (cf. POI FAQ).\n\t\t\t// But we can work with the plain XmlObjects or DOM nodes, if we extract them by\n\t\t\t// a generic path expression.\n\t\t\tElement sdtType;\n\t\t\tif ((sdtType = getFirstAsDomElement(sdtPr, \"w:text\")) != null\n\t\t\t\t|| (sdtType = getFirstAsDomElement(sdtPr, \"w:richText\")) != null) {\n\t\t\t\t// Value is the text (in the case of richText without formatting)\n\t\t\t} else if ((sdtType = getFirstAsDomElement(sdtPr, \"w:date\")) != null) {\n\t\t\t\t// 17.5.2.7: fullDate contains the \"full date and time last entered\"\n\t\t\t\t// in XML Schema DateTime syntax\n\t\t\t\tString fullDate = sdtType.getAttributeNS(WORDPROCESSINGML_NS, \"fullDate\");\n\t\t\t\tif (fullDate != null) {\n\t\t\t\t\tXMLGregorianCalendar calendar;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tcalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(fullDate);\n\t\t\t\t\t\tlong timeMillis = calendar.toGregorianCalendar(null, null, null).getTimeInMillis();\n\t\t\t\t\t\tfinal String dateText = text;\n\t\t\t\t\t\tvalue = new Date(timeMillis) {\n\t\t\t\t\t\t\t@Override \n\t\t\t\t\t\t\tpublic String toString() { \n\t\t\t\t\t\t\t\treturn dateText; \n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t};\n\t\t\t\t\t} catch(DatatypeConfigurationException e) {\n\t\t\t\t\t\tLOG.warn(\"createStructuredDocumentTag failed: \", e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if ((sdtType = getFirstAsDomElement(sdtPr, \"w:comboBox\")) != null\n\t\t\t\t|| (sdtType = getFirstAsDomElement(sdtPr, \"w:dropDownList\")) != null) {\n\t\t\t\t// 17.5.2.5 (comboBox), 17.5.2.15 (dropDownList)\n\t\t\t\t// Try to find the associated value with the extract text (if possible)\n\t\t\t\tNodeList listItems = sdtType.getElementsByTagNameNS(WORDPROCESSINGML_NS, \"listItem\");\n\t\t\t\tfor (int i = 0, n = listItems.getLength(); i < n; i++) {\n\t\t\t\t\tElement listItem = (Element) listItems.item(i);\n\t\t\t\t\tString displayText = listItem.getAttributeNS(WORDPROCESSINGML_NS, \"displayText\");\n\t\t\t\t\tif (text.equals(displayText)) {\n\t\t\t\t\t\tvalue = listItem.getAttributeNS(WORDPROCESSINGML_NS, \"value\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if ((getFirstAsDomElement(sdtPr, \"equation\") != null)\n\t\t\t\t\t|| (getFirstAsDomElement(sdtPr, \"docPartObj\") != null)\n\t\t\t\t\t|| (getFirstAsDomElement(sdtPr, \"docPartList\") != null)\n\t\t\t\t\t|| (getFirstAsDomElement(sdtPr, \"picture\") != null)\n\t\t\t\t\t|| (getFirstAsDomElement(sdtPr, \"citation\") != null)\n\t\t\t\t\t|| (getFirstAsDomElement(sdtPr, \"group\") != null)\n\t\t\t\t\t|| (getFirstAsDomElement(sdtPr, \"bibliography\") != null)) {\n\t\t\t\t// ignore (unsupported type)\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\t// type is unspecified, treat as text\n\t\t\t}\n\t\t}\n\n\t\tStructuredDocumentTag sdt = new StructuredDocumentTag(alias, tagName, value, text);\n\t\tstructuredDocumentTags.add(sdt);\n\t}", "@Override\n\tpublic Paragraph translateText(String freetext, boolean include) {\n\t\treturn null;\n\t}", "public static String normalizeTextForTagger(String text) {\r\n \ttext = text.replaceAll(\"&amp;\", \"&\");\r\n \ttext = StringEscapeUtils.unescapeHtml4(text);\r\n \treturn text;\r\n }", "public SmartScriptParser(String text) {\n lexer = new SmartScriptLexer(text);\n documentNode = new DocumentNode();\n stack = new ObjectStack();\n parse();\n\n}", "public void convertObjectToXML() throws TransformerException{\r\n\t\tDocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();\r\n\t\ttry {\r\n\t\t\tDocumentBuilder docBuilder = docFactory.newDocumentBuilder();\r\n\r\n\t\t\t// root elements\r\n\t\t\tDocument doc = docBuilder.newDocument();\r\n\t\t\tElement fileElement = doc.createElement(\"TextFile\");\r\n\t\t\tdoc.appendChild(fileElement);\r\n\r\n\t\t\t// set attribute to file element\r\n\t\t\tAttr attr = doc.createAttribute(\"filename\");\r\n\t\t\tattr.setValue(this.fileName);\r\n\t\t\tfileElement.setAttributeNode(attr);\r\n\t\t\t\r\n\t\t\t//Tagged for paragraphs,sentence,word and punctuation\r\n\r\n\t\t\tfor (Paragraph paragraph : paragraphs) { // for each paragraph\r\n\r\n\t\t\t\tElement paragraphElement = doc.createElement(paragraph.getXMLTag());\r\n\t\t\t\tfileElement.appendChild(paragraphElement);\r\n\t\t\t\t//System.out.println(\"PARAGRAPH:\"+paragraph.getSentences().size());\r\n\t\t\t\tfor (Sentence sentence : paragraph.getSentences()) { // for each sentence\r\n\t\t\t\t\tElement sentenceElement = doc.createElement(sentence.getXMLTag());\r\n\t\t\t\t\tparagraphElement.appendChild(sentenceElement);\r\n\t\t\t\t\t//System.out.println(\"Sentence:\"+sentence.getSentencesItems().size());\r\n\t\t\t\t\tfor (Items sentenceItem : sentence.getSentencesItems()) { // for each sentence item\r\n\t\t\t\t\t\tif (sentenceItem instanceof Word) {\r\n\t\t\t\t\t\t\tWord word = (Word)sentenceItem;\r\n\t\t\t\t\t\t\tElement wordElement = doc.createElement(word.getXMLTag());\r\n\t\t\t\t\t\t\twordElement.appendChild(doc.createTextNode(word.getWord()));\r\n\t\t\t\t\t\t\tsentenceElement.appendChild(wordElement); //output text for each word\r\n\t\t\t\t\t\t\t//System.out.println(\"Word:\"+word.getWord());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (sentenceItem instanceof Punctuation) {\r\n\t\t\t\t\t\t\tPunctuation punctuation = (Punctuation)sentenceItem;\r\n\t\t\t\t\t\t\tElement punctuationElement = doc.createElement(punctuation.getXMLTag());\r\n\t\t\t\t\t\t\tpunctuationElement.appendChild(doc.createTextNode(punctuation.getPunctuation()));\r\n\t\t\t\t\t\t\tsentenceElement.appendChild(punctuationElement); //output text for each punctuation\r\n\t\t\t\t\t\t\t//System.out.println(\"Punctuation:\"+punctuation.getPunctuation());\r\n\t\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\t// write the content into xml file\r\n\t\t\tTransformerFactory transformerFactory = TransformerFactory.newInstance();\r\n\t\t\tTransformer transformer = transformerFactory.newTransformer();\r\n\t\t\tDOMSource source = new DOMSource(doc);\r\n\r\n\t\t\t//System.out.println(fileName.lastIndexOf(\"/\"));\r\n\t\t\tStreamResult result = new StreamResult(new File(\"output_\"+fileName.substring(fileName.lastIndexOf(\"/\")+1, fileName.length()-4)+\".xml\"));\r\n\t\t\ttransformer.transform(source, result);\r\n\r\n\t\t\tSystem.out.println(\"File: \"+\"output_\"+fileName.substring(fileName.lastIndexOf(\"/\")+1, fileName.length()-4)+\".xml\"+\" saved!\");\r\n\r\n\t\t}\r\n\t\tcatch (ParserConfigurationException 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\t}", "abstract protected void processHTMLLine(String line);", "private static String pipelinePOS_NER(String text, boolean debugMode) {\n\t\tif (debugMode) System.out.println(\"Starting coreNLP analysis\");\n\n\t\t//POS & NER extraction, Stanford CoreNLP\n\t\tString NePosText = CoreNLPHandler.getXMLwithNERandPOS(text);\n\n\t\treturn NePosText;\n\t}", "public static String createValidContent(final String string) {\n\t\treturn Strings.replace(string, XML_ENTITY_CHARS, XML_ENTITY_REPLACMENTS); //do the replacements for the special XML symbols and return the results\n\t}", "private void trainText() throws Exception\n\t{\n\t\tdbiterator.setDataSource(DBInstanceIterator.DBSource.TEXT);\n\t\tSystem.out.println(\"Starting reading Text Trainingset ..\");\n\n\t\tPipe serialpipe = getTextPipe();\n\t\tInstanceList text_instances = new InstanceList(serialpipe);\n\n\t\tSystem.out.println(\"Preprocessing on Text Trainingset ..\");\n\t\ttext_instances.addThruPipe(dbiterator);\n\n\t\tSystem.out.println(\"Text Training set : \" + text_instances.size());\n\t\tSystem.out.println(\"Saving preprocessed data ..\");\n\t\tsaveinstances(text_instances, Train + \"T.bin\");\n\n\t\tSystem.out.println(\"Saving Features data ..\");\n\t\ttext_instances.getDataAlphabet().dump(new PrintWriter(new File(Attributes + \"text.dat\")));\n\n\t\tNaiveBayesTrainer trainer = new NaiveBayesTrainer();\n\n\t\tSystem.out.println(\"NaiveBayes Starts Training on Text training set ..\");\n\t\tNaiveBayes classifier = trainer.train(text_instances);\n\n\t\tSystem.out.println(\"Targets labels : \\t\"+classifier.getLabelAlphabet());\n\t\tSystem.out.println(\"Saving Naive Bayes Classifier ..\");\n\t\tsaveModel(classifier, Text_Train);\n\t\tSystem.out.println(\"Text classifier saved to : \" + Text_Train);\n\t}", "public interface ResultHandler extends DocumentHandler {\n \n \n /**\n * Signals to receive CDATA characters\n * @param chars the character array containing the characters\n * to receive\n * @param start the index into the character array to start receiving\n * characters at\n * @param length the number of characters to recieve\n **/\n public void cdata(char[] chars, int start, int length);\n \n \n /**\n * Signals to recieve a comment\n * @param data, the content of the comment\n **/\n public void comment(String data);\n \n /**\n * Signals to recieve an entity reference with the given name\n * @param name the name of the entity reference\n **/\n public void entityReference(String name);\n \n \n /**\n * Sets the behavoir of handling character content. If argument is true,\n * character content will be escaped. If false, character content will\n * not be escaped.\n * @param escapeText the flag indicating whether or not to\n * escape character content\n **/\n //public void setEscapeText(boolean escapeText);\n \n /**\n * Sets the indent size for all formatters that perform\n * serialization, in which indentation is applicable.\n * @param indentSize the number of characters to indent\n **/\n public void setIndentSize(short indentSize);\n \n /**\n * Sets the output format information for Formatters that\n * perform serialization.\n * @param format the OutputFormat used to specify properties\n * during serialization\n **/\n public void setOutputFormat(OutputFormat format);\n \n \n /**\n * Signals to receive characters which should not be escaped\n * @param chars the character array containing the characters\n * to receive\n * @param start the index into the character array to start receiving\n * characters at\n * @param length the number of characters to recieve\n **/\n public void unescapedCharacters(char[] chars, int start, int length);\n \n}", "public void run() {\n \n if (Parameter != null && Parameter instanceof ConvertTextUnitsParameter) {\n CastParameter = (ConvertTextUnitsParameter)Parameter;\n }\n else {\n CastParameter = null;\n }\n\n String shortErrorMessage = \"Error: Text Units Cannot be Converted!\";\n this.acceptTask(TaskProgress.INDETERMINATE, \"Initial Preparations\");\n this.validateParameter(Parameter, shortErrorMessage);\n this.openDiasdemCollection(CastParameter.getCollectionFileName());\n this.checkPrerequisitesAndSetDefaultTextUnitsLayer(shortErrorMessage);\n \n if (CastParameter.getConversionType() == ConvertTextUnitsParameter\n .APPLY_REGULAR_EXPRESSION_TO_TEXT_UNITS) {\n RegexPattern = Pattern.compile(CastParameter.getRegularExpression());\n }\n \n if (CastParameter.getConversionType() == ConvertTextUnitsParameter\n .IDENTIFY_SPECIFIED_MULTI_TOKEN_TERMS) {\n // read multi token word: each line contains one multi token word;\n // comment lines start with '#'\n TextFile multiTokenFile = new TextFile(\n new File(CastParameter.getMultiTokenFileName()));\n multiTokenFile.open();\n String line = multiTokenFile.getFirstLineButIgnoreCommentsAndEmptyLines();\n ArrayList list = new ArrayList();\n while (line != null) {\n list.add(line.trim());\n line = multiTokenFile.getNextLineButIgnoreCommentsAndEmptyLines();\n }\n // sort multi token terms by decreasing length\n Collections.sort(list, new SortStringsByDecreasingLength());\n // for (int i = 0; i < list.size(); i++) {\n // System.out.println((String)list.get(i));\n // }\n // System.out.println(list.size());\n String[] multiToken = new String[list.size()];\n for (int i = 0; i < list.size(); i++)\n multiToken[i] = (String)list.get(i);\n multiTokenFile.close();\n MyMultiTokenWordIdentifier = new HeuristicMultiTokenWordIdentifier(\n multiToken);\n }\n else {\n MyMultiTokenWordIdentifier = null;\n }\n \n if (CastParameter.getConversionType() == ConvertTextUnitsParameter\n .FIND_AND_REPLACE_SPECIFIED_TOKENS) {\n // read token replacement file: each line contains the tokens to search \n // for and the replacement tokens separated by a tab stop;\n // comment lines start with '#'\n TextFile tokenReplacementFile = new TextFile(\n new File(CastParameter.getTokenReplacementFileName()));\n tokenReplacementFile.open();\n String line = tokenReplacementFile.getFirstLineButIgnoreCommentsAndEmptyLines();\n HashMap tokensSearchList = new HashMap();\n String[] tokensContents = null;\n while (line != null) {\n tokensContents = line.split(\"\\t\");\n if (tokensContents.length == 2\n && tokensContents[1].trim().length() > 0) {\n try {\n tokensSearchList.put(tokensContents[0].trim(), \n tokensContents[1].trim());\n }\n catch (PatternSyntaxException e) {\n System.out.println(\"[TokenizeTextUnitsTask] Regex syntax error in \"\n + \" file \" + CastParameter.getTokenReplacementFileName() + \": \"\n + \" Line \\\"\" + line + \"\\\"; error message: \" + e.getMessage());\n }\n }\n else {\n System.out.println(\"[TokenizeTextUnitsTask] Error in file \"\n + CastParameter.getTokenReplacementFileName() + \": Line \\\"\"\n + line + \"\\\" does not conform to syntax!\");\n }\n line = tokenReplacementFile.getNextLineButIgnoreCommentsAndEmptyLines();\n }\n // sort multi token terms by decreasing length\n ArrayList list = new ArrayList(tokensSearchList.keySet());\n Collections.sort(list, new SortStringsByDecreasingLength());\n // create arrays for token replacement \n String[] tokensSearch = new String[list.size()];\n String[] tokensReplace = new String[list.size()];\n Iterator iterator = list.iterator();\n int i = 0;\n while (iterator.hasNext()) {\n TmpString = (String)iterator.next();\n tokensSearch[i] = TmpString;\n tokensReplace[i++] = (String)tokensSearchList.get(TmpString);\n }\n tokenReplacementFile.close();\n MyTokenReplacer = new HeuristicTokenReplacer(tokensSearch, tokensReplace);\n }\n else {\n MyTokenReplacer = null;\n }\n \n int counterProgress = 0;\n long maxProgress = DiasdemCollection.getNumberOfDocuments();\n \n DiasdemDocument = DiasdemCollection.getFirstDocument(); \n while (DiasdemDocument != null) {\n \n if (counterProgress == 1 || (counterProgress % 50) == 0) {\n Progress.update( (int)(counterProgress * 100 / maxProgress),\n \"Processing Document \" + counterProgress);\n DiasdemServer.setTaskProgress(Progress, TaskThread);\n }\n\n DiasdemDocument.setActiveTextUnitsLayer(DiasdemProject\n .getActiveTextUnitsLayerIndex());\n DiasdemDocument.backupProcessedTextUnits(DiasdemProject\n .getProcessedTextUnitsRollbackOption());\n \n for (int i = 0; i < DiasdemDocument.getNumberOfProcessedTextUnits(); \n i++) {\n DiasdemTextUnit = DiasdemDocument.getProcessedTextUnit(i);\n switch (CastParameter.getConversionType()) {\n case ConvertTextUnitsParameter.CONVERT_TEXT_UNITS_TO_LOWER_CASE: {\n TextUnitContentsAsString = DiasdemTextUnit.getContentsAsString()\n .toLowerCase();\n break;\n }\n case ConvertTextUnitsParameter.CONVERT_TEXT_UNITS_TO_UPPER_CASE: {\n TextUnitContentsAsString = DiasdemTextUnit.getContentsAsString()\n .toUpperCase();\n break;\n } \n case ConvertTextUnitsParameter.APPLY_REGULAR_EXPRESSION_TO_TEXT_UNITS: {\n RegexMatcher = RegexPattern.matcher(DiasdemTextUnit\n .getContentsAsString());\n TmpStringBuffer = new StringBuffer(DiasdemTextUnit\n .getContentsAsString().length() + 10000);\n while (RegexMatcher.find()) {\n RegexMatcher.appendReplacement(TmpStringBuffer,\n CastParameter.getReplacementString());\n }\n TextUnitContentsAsString = RegexMatcher.appendTail(TmpStringBuffer)\n .toString();\n break;\n }\n case ConvertTextUnitsParameter.IDENTIFY_SPECIFIED_MULTI_TOKEN_TERMS: {\n TextUnitContentsAsString = MyMultiTokenWordIdentifier\n .identifyMultiTokenWords(DiasdemTextUnit.getContentsAsString());\n break;\n } \n case ConvertTextUnitsParameter.FIND_AND_REPLACE_SPECIFIED_TOKENS: {\n TextUnitContentsAsString = MyTokenReplacer\n .replaceTokens(DiasdemTextUnit.getContentsAsString());\n break;\n } \n case ConvertTextUnitsParameter.REMOVE_PART_OF_SPEECH_TAGS_FROM_TOKENS: {\n TextUnitContentsAsString = this.removeTagsFromTokens(\n DiasdemTextUnit.getContentsAsString(), \"/p:\");\n break;\n } \n case ConvertTextUnitsParameter.REMOVE_WORD_SENSE_TAGS_FROM_TOKENS: {\n TextUnitContentsAsString = this.removeTagsFromTokens(\n DiasdemTextUnit.getContentsAsString(), \"/s:\");\n break;\n } \n default: {\n TextUnitContentsAsString = DiasdemTextUnit.getContentsAsString();\n }\n }\n DiasdemTextUnit.setContentsFromString(TextUnitContentsAsString);\n DiasdemDocument.replaceProcessedTextUnit(i, DiasdemTextUnit);\n }\n\n DiasdemCollection.replaceDocument(DiasdemDocument\n .getDiasdemDocumentID(), DiasdemDocument);\n \n DiasdemDocument = DiasdemCollection.getNextDocument();\n counterProgress++;\n \n } // read all documents\n \n super.closeDiasdemCollection();\n \n CastResult = new ConvertTextUnitsResult(TaskResult.FINAL_RESULT,\n \"All processed text units have been converted in the DIAsDEM document\\n\" +\n \" collection \" +\n Tools.shortenFileName(CastParameter.getCollectionFileName(), 55) + \"!\", \n \"Processed text units have been converted.\");\n this.setTaskResult(100, \"All Documents Processed ...\", CastResult,\n TaskResult.FINAL_RESULT, Task.TASK_FINISHED);\n \n }", "private String parseHtmlText(HtmlPage htmlPage) {\n\n Document doc = Jsoup.parse(htmlPage.getRawHTML(), htmlPage.getURL());\n StringBuilder sb = new StringBuilder();\n doc.getElementsByClass(MAIN_CONTENT_CLASS).forEach(element -> {\n element.getElementsByTag(PARAGRAPH_TAG).forEach(paragraph_element -> {\n sb.append(paragraph_element.text()).append(SPACE);\n });\n });\n\n String parsedText = sb.toString();\n // IF case folding is set, perform it\n if (this.isCaseFolding) {\n parsedText = parsedText.toLowerCase();\n }\n\n // IF punctuation handling is set, perform it\n if (this.isPunctuationHandling) {\n parsedText = punctuationHandler(parsedText);\n }\n\n return parsedText;\n }", "private void viterbiParse(Tree<State> tree) {\n\t\tList<State> sentence = tree.getYield();\n\t\tint nword = sentence.size();\n\t\tif (chart != null) {\n\t\t\tchart.clear(nword);\n\t\t} else {\n\t\t\tchart = new Chart(nword, false, true, false);\n\t\t} \n\t\tinferencer.viterbiParse(chart, sentence, nword);\n\t}", "private void filterFeatureswithtext() throws Exception {\n\t\ttry {\r\n\t\t\t//source = dataStore.getFeatureSource(typeName);\r\n\t\t\tString sql = text.getText();\r\n\t\t\tString filtertype = \"include\";\r\n\t\t\tString[] cql = sql.split(\":\");\r\n\t\t\tHints h = new Hints();\r\n \t\t\th.put(Hints.FILTER_FACTORY, ISOFilterFactoryImpl.class);\r\n \t\t\tFilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(h);\r\n \t\t\tWKTReader wktr = new WKTReader(DefaultGeographicCRS.WGS84_3D);\r\n \t\t\tFilter filter = CQL.toFilter(\"include\");\r\n \t\t\tlong start = System.currentTimeMillis();\r\n \t\t\tList<SimpleFeature> sfs = new ArrayList<SimpleFeature>();\r\n \t\t\tSimpleFeatureIterator iterator = currentfeatures.features();\r\n \t\t\t\r\n \t\t\tif(cql.length > 1 && cql[2].startsWith(\"BBOX3D\")) {\r\n \t\t\t cql[2] = cql[2].replaceAll(\"BBOX3D\", \"\");\r\n \t\t\t cql[2] = cql[2].replaceAll(\"\\\\(\", \"\");\r\n \t\t\t cql[2] = cql[2].replaceAll(\"\\\\)\", \"\");\r\n \t\t\t \r\n \t\t\t String[] coords = cql[2].split(\",\");\r\n \t\t\t \r\n \t\t\t String[] lowerStr = coords[0].trim().split(\" \");\r\n \t\t\t String[] upperStr = coords[1].trim().split(\" \");\r\n \t\t\t \r\n \t\t\t double[] lower = new double[3];\r\n \t\t\t double[] upper = new double[3];\r\n \t\t\t \r\n \t\t\t lower[0] = Double.parseDouble(lowerStr[0]);\r\n lower[1] = Double.parseDouble(lowerStr[1]);\r\n lower[2] = Double.parseDouble(lowerStr[2]);\r\n \r\n upper[0] = Double.parseDouble(upperStr[0]);\r\n upper[1] = Double.parseDouble(upperStr[1]);\r\n upper[2] = Double.parseDouble(upperStr[2]);\r\n \r\n DirectPosition lowerCorner = builder.createDirectPosition(lower);\r\n DirectPosition upperCorner = builder.createDirectPosition(upper);\r\n \r\n Solid s = makeFromEnvelope(builder, lowerCorner, upperCorner);\r\n cql[2] = s.toString();\r\n\r\n Document d = encode(s);\r\n //System.out.println(d);\r\n\r\n //System.out.println(cql[2]);\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif(cql[0].equalsIgnoreCase(\"contains\")) {\r\n \t\t\t\tfeatureid = \"\";\r\n \t\t\t\tfilter = ff.contains(cql[1], wktr.read(cql[2]));\r\n \t\t\t\tfiltertype = \"contains \";\r\n \t\t\t}\r\n \t\t\telse if(cql[0].equalsIgnoreCase(\"within\")) {\r\n \t\t\t\tfeatureid = \"\";\r\n \t\t\t\tfilter = ff.within(cql[1], wktr.read(cql[2]));\r\n \t\t\t\tfiltertype = \"within \";\r\n \t\t\t}\r\n \t\t\telse if(cql[0].equalsIgnoreCase(\"equals\")) {\r\n \t\t\t\tfilter = ff.equals(cql[1], wktr.read(cql[2]));\r\n \t\t\t\tfiltertype = \"equals \";\r\n \t\t\t}\r\n \t\t\telse if(cql[0].equalsIgnoreCase(\"intersects\")) {\r\n \t\t\t\tFilter getidfilter = ff.equals(cql[1], wktr.read(cql[2]));\r\n \t\t\t\t\r\n \t\t\t\twhile (iterator.hasNext()) {\r\n \t\t\t\t\tSimpleFeature feature = iterator.next();\r\n \t\t\t\t\t\r\n \t\t\t\t\tif(getidfilter.evaluate(feature)) {\r\n \t\t\t\t\t\tfeatureid = feature.getID();\r\n \t\t\t\t\t\tbreak;\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\tfilter = ff.intersects(cql[1], wktr.read(cql[2]));\r\n \t\t\t\tfiltertype = \"intersects \";\r\n \t\t\t}\r\n \t\t\t\r\n\t\t\t//SimpleFeatureCollection features = source.getFeatures(filter);\r\n \t\t\titerator = currentfeatures.features();\r\n\t\t\twhile (iterator.hasNext()) {\r\n\t\t\t\tSimpleFeature feature = iterator.next();\r\n\t\t\t\tSystem.out.print(featureid + \" : \" + feature.getID() + \" \");\r\n\t\t\t\tif(filter.evaluate(feature)) {\r\n\t\t\t\t\tsfs.add(feature);\r\n\t\t\t\t\tSystem.out.println(\"true\");\r\n\t\t\t\t}else {\r\n\t\t\t\t\tSystem.out.println(\"false\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(sfs.size() == 0) {\r\n\t\t\t\ttable.setModel(new DefaultTableModel(5, 5));\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tSimpleFeatureCollection result = ISODataUtilities.collection(sfs);\r\n \t\t\t\r\n\t\t\tlong end = System.currentTimeMillis();\r\n\t\t\t//System.out.println( \"실행 시간 : \" + ( end - start )/1000.0 );\r\n\t\t\tlabel.setText(filtertype + \"complete : \" + ( end - start )/1000.0 + \" sec\");\r\n\t\t\tFeatureCollectionTableModel model = new FeatureCollectionTableModel(result);\r\n\t\t\ttable.setModel(model);\r\n\t\t\t\r\n\t\t} catch (CQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ParseException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} \r\n\t}", "public ArticleForAnnotation FindFekRegex(ArticleForAnnotation curArticle) throws Exception {\n // Regular expression to be matched\n// Pattern FekPattern = Pattern.compile(\"((\\\\d+\\\\w{1,2}? +)?[νΝ]\\\\. ?\\\\d+/\\\\d+( *\\\\([Α-Ωα-ω]{1,2}[΄΄'’]? ?\\\\d+\\\\))?)\", Pattern.UNICODE_CASE);\n // Matches Laws and POs (ΠΔ)\n// Pattern FekPattern = Pattern.compile(\"(((([Νν][όο]μ)[α-ω]{0,3}|[νΝ])\\\\.?|([Ππ]\\\\.?[Δδ]\\\\.?)) ?\\\\d+\\\\/\\\\d+( *\\\\((ΦΕΚ )?[Α-Ωα-ω]{1,2}[΄`΄'’]? ?\\\\d+((\\\\/|, ?)(\\\\d|\\\\.|-)*)?\\\\))?)\", Pattern.UNICODE_CASE);\n Pattern FekPattern = Pattern.compile(\"(((άρθ[α-ω\\\\.]{0,} ?\\\\d+,? [Α-Ωα-ω0-9, ]*παρ[α-ωά\\\\.]{0,} ?\\\\d+,? [Α-Ωα-ω0-9, ]*)|(παρ[α-ωά\\\\.]{0,} ?\\\\d+,? [Α-Ωα-ω0-9, ]*άρθ[α-ω\\\\.]{0,4} ?\\\\d+,? [Α-Ωα-ω0-9, ]*))?((([Νν][όο]μ)[α-ω]{0,3}|[νΝ])\\\\.?|([Ππ]\\\\.?[Δδ]\\\\.?)) ?\\\\d+\\\\/\\\\d+( *\\\\((ΦΕΚ )?[Α-Ωα-ω]{1,2}[΄`΄'’]? ?\\\\d+((\\\\/|, ?)(\\\\d|\\\\.|-)*)?\\\\))?)\", Pattern.UNICODE_CASE);\n Pattern LawPattern = Pattern.compile(\"((([Νν][όο]μ)[α-ω]{0,3}|[νΝ])\\\\.?|([Ππ]\\\\.?[Δδ]\\\\.?)) ?\\\\d+\\\\/\\\\d+\", Pattern.UNICODE_CASE);\n // Start searching article text\n String articText = curArticle.articleText;\n Matcher m = FekPattern.matcher(articText);\n while (m.find()) {\n String entityFound = m.group(0);\n\n Matcher mLaw = LawPattern.matcher(entityFound);\n if (!mLaw.find()) {\n continue;\n }\n String entityLaw = mLaw.group(0);\n\n String[] FEKparts = entityFound.split(\"/\", 2);\n int startIndex = m.start();\n int endIndex = m.end();\n String FEK_year = \"\";\n String FEK_issue = \"\";\n String FEK_number = null;\n String urlpdf = \"\";\n String entity_Type = \"fek\";\n\n // Get the second part from a FEK annotation (e.g. from ν. 2873/2000 (Α’ 285) the 2000 (Α’ 285) part)\n // and check if FEK issue and number exist (inside parenthesis)\n if (FEKparts[1].contains(\"(\")) {\n // Check inside that part for mached accent characters (΄ or ' or ’)\n // and if so, we get from this string the FEK issue (e.g. A) and FEK number\n FEK_year = FEKparts[1].substring(0, FEKparts[1].lastIndexOf(\"(\")).trim();\n if (FEKparts[1].contains(\"΄\")) {\n FEK_issue = FEKparts[1].substring(FEKparts[1].lastIndexOf(\"(\"), FEKparts[1].lastIndexOf(\"΄\")).trim().replace(\"(\", \"\");\n FEK_number = FEKparts[1].substring(FEKparts[1].lastIndexOf(\"΄\"), FEKparts[1].lastIndexOf(\")\")).replace(\"΄\", \"\").trim();\n } else if (FEKparts[1].contains(\"'\")) {\n FEK_issue = FEKparts[1].substring(FEKparts[1].lastIndexOf(\"(\"), FEKparts[1].lastIndexOf(\"'\")).trim().replace(\"(\", \"\");\n FEK_number = FEKparts[1].substring(FEKparts[1].lastIndexOf(\"'\"), FEKparts[1].lastIndexOf(\")\")).replace(\"'\", \"\").trim();\n } else if (FEKparts[1].contains(\"’\")) {\n FEK_issue = FEKparts[1].substring(FEKparts[1].lastIndexOf(\"(\"), FEKparts[1].lastIndexOf(\"’\")).trim().replace(\"(\", \"\");\n FEK_number = FEKparts[1].substring(FEKparts[1].lastIndexOf(\"’\"), FEKparts[1].lastIndexOf(\")\")).replace(\"’\", \"\").trim();\n } else if (FEKparts[1].contains(\"`\")) {\n FEK_issue = FEKparts[1].substring(FEKparts[1].lastIndexOf(\"(\"), FEKparts[1].lastIndexOf(\"`\")).trim().replace(\"(\", \"\");\n FEK_number = FEKparts[1].substring(FEKparts[1].lastIndexOf(\"`\"), FEKparts[1].lastIndexOf(\")\")).replace(\"`\", \"\").trim();\n } else {\n // If doesn't contain on of these characters then we check for space\n // else we get the first character as the FEK issue (e.g. A, B etc)\n FEK_issue = FEKparts[1].substring(FEKparts[1].lastIndexOf(\"(\"), FEKparts[1].lastIndexOf(\")\")).trim().replace(\"(\", \"\").replace(\")\", \"\");\n if (FEK_issue.startsWith(\"ΦΕΚ \")) {\n FEK_issue = FEK_issue.substring(4);\n } else if (FEK_issue.startsWith(\"ΦΕΚ\")) {\n FEK_issue = FEK_issue.substring(3);\n }\n\n if (FEK_issue.contains(\" \")) {\n String[] splitedIssue = FEK_issue.split(\" \");\n FEK_issue = splitedIssue[0];\n FEK_number = splitedIssue[1];\n } else {\n FEK_number = FEK_issue.substring(1);\n FEK_issue = FEK_issue.substring(0, 1);\n }\n }\n if (FEK_issue.startsWith(\"ΦΕΚ \")) {\n FEK_issue = FEK_issue.substring(4);\n }\n String[] FEK_num_tokens = FEK_number.split(\"(\\\\/|-| |,)\");\n\n FEK_number = FEK_num_tokens[0];\n\n // Set the corresponding issue checkbox based on the FEK issue retrieved above\n String checkBoxIssue = \"\";\n switch (FEK_issue) {\n case \"Α\":\n checkBoxIssue = \"chbIssue_1\";\n break;\n case \"Β\":\n checkBoxIssue = \"chbIssue_2\";\n break;\n case \"Γ\":\n checkBoxIssue = \"chbIssue_3\";\n break;\n case \"Δ\":\n checkBoxIssue = \"chbIssue_4\";\n break;\n case \"\":\n checkBoxIssue = \"\";\n break;\n }\n\n // Perform the POST request\n PostRequestFEK httpRequest = new PostRequestFEK();\n // Get the corresponding pdf url of the FEK\n urlpdf = httpRequest.sendPost3(FEK_year, FEK_issue, FEK_number, checkBoxIssue);\n// if (urlpdf.length() == 0) {\n// urlpdf = \"-1\";\n// }\n } else {\n FEK_year = FEKparts[1];\n String[] toks = entityLaw.split(\"(\\\\.|,| |\\\\/)\");\n if (entityLaw.toLowerCase().startsWith(\"ν\")) {\n entity_Type = \"law\";\n } else if (entityLaw.toLowerCase().startsWith(\"π\")) {\n entity_Type = \"pd\";\n }\n String item_number = toks[toks.length - 2];\n PostRequestFEK httpRequest = new PostRequestFEK();\n urlpdf = httpRequest.sendPost4(FEK_year, item_number, entity_Type);\n }\n // Add the current annotation found into the current article's annotations list\n Annotation currentAnnotation = new Annotation(entityFound, startIndex, endIndex, urlpdf, entity_Type, entityLaw);\n curArticle.annotations.add(currentAnnotation);\n }\n // Return the article back to the process\n return curArticle;\n }", "public static void convertTextPart(TextPart textPart) {\r\n \t\tif (!textPart.isSegment()) {\r\n \t\t\tTextFragment tf = textPart.getContent();\r\n \t\t\tif (tf.hasCode()) return;\r\n \t\t\t\r\n \t\t\t// Move the whole text of text part to a single code\r\n \t\t\ttf.changeToCode(0, tf.getCodedText().length(), \r\n \t\t\t\t\tTagType.PLACEHOLDER, null);\r\n \t\t}\r\n \t}", "public static void main (String[] args) {\r\n try {\r\n BufferedReader in = new BufferedReader(\r\n new InputStreamReader(\r\n new FileInputStream(new File(\"D:\\\\bitext.html\")), \"UTF-8\"));\r\n\r\n String s;\r\n StringBuffer b = new StringBuffer();\r\n while( (s = in.readLine()) != null) {\r\n b.append(s );\r\n }\r\n String page= b.toString();\r\n HTMLParser parser = new HTMLParser(page.getBytes(\"UTF-8\"));\r\n //parser.getTagValue (\"meta\");\r\n //System.out.println();\r\n\r\n System.out.println(parser.htmlParsing (false, null, null, false));\r\n //System.out.println(htmlParsing (page3, \"euc-kr\"));\r\n\r\n\r\n } catch (Throwable t) {\r\n t.printStackTrace ();\r\n }\r\n }", "@Test\n public void InternalNLP_annotate_doesAnnotate() {\n ExtractedText extractedText = null;\n\n String fileUri = \"dummyUri\";\n String fileRef = \"src/test/res/Pasta.txt\";\n File file = new File(fileRef);\n try {\n InputStream inputStream = new FileInputStream(file);\n extractedText = mInternalTextProcessor.processFile(inputStream, fileUri, fileRef\n , \"txt\", false);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (FileTypeNotSupportedException e) {\n e.printStackTrace();\n } catch (DocumentNotSupportedException e) {\n e.printStackTrace();\n }\n\n // Annotate\n mInternalNLP.annotate(extractedText);\n\n if(!extractedText.getTitle().isEmpty()) {\n Assert.assertNotNull(extractedText.getTitleAnnotation());\n }\n\n for (Section section: extractedText.getSections()) {\n if(!section.getBody().isEmpty()) {\n Assert.assertNotNull(section.getBodyAnnotation());\n }\n if(!section.getTitle().isEmpty()) {\n Assert.assertNotNull(section.getTitleAnnotation());\n }\n }\n }", "public abstract void interpret(EvaluationContext context);", "public String convertMarkupToHTML(String text) {\n return text;\n }", "@Override\r\n\tpublic void handleFile(String inFilename, String outFilename) \r\n\t{\n\r\n\r\n\t\tString s = slurpFile(inFilename);\r\n\t\tDocument teiDocument = parsePlainText(s);\r\n\t\ttry \r\n\t\t{\r\n\t\t\tPrintStream pout = new PrintStream(new FileOutputStream(outFilename));\r\n\t\t\tpout.print(XML.documentToString(teiDocument));\r\n\t\t\tpout.close();\r\n\t\t} catch (FileNotFoundException e) \r\n\t\t{\r\n\t\t\te.printStackTrace\r\n\t\t\t();\r\n\r\n\t\t}\t\r\n\t}", "public String cleanHtmlTextForPlayer(String unrefinedHtmlText) {\n\n String figureRemove = replaceAllCharacter(unrefinedHtmlText, ConstantUtil.HTML_EXTRACT_FIGURE_REGEX, ConstantUtil.BLANK);\n String figcaptionRemove = replaceAllCharacter(figureRemove, ConstantUtil.HTML_EXTRACT_FIGCAPTION_REGEX, ConstantUtil.BLANK);\n String almostRefinedText = figcaptionRemove.replaceAll(ConstantUtil.HTML_EXTRACT_IMG_REGEX, ConstantUtil.BLANK);\n return almostRefinedText;\n\n }", "void computeHTMLFeatures() throws Exception{\n\t\tcountTagStatistics();\n\t\thtmlGlobalTagStatistics();\n\t\ttagInHeadStatistics();\n\t\thtmlStatisticsDiv();\n\t\thtmlStaticsticsParagraphs();\n\t\thtmlKeyWords();\n\t\tnormalizeData();\n\t}" ]
[ "0.6156943", "0.5916274", "0.5893522", "0.5769842", "0.5622992", "0.558947", "0.5577122", "0.5531779", "0.5446922", "0.54033804", "0.53683174", "0.5294928", "0.5266639", "0.52584416", "0.5242405", "0.5222163", "0.52220505", "0.5200042", "0.5185533", "0.516881", "0.5161882", "0.51170486", "0.5116753", "0.50747234", "0.50676656", "0.5051303", "0.5038341", "0.50230813", "0.50201565", "0.50060874", "0.49866197", "0.49857038", "0.49715513", "0.49181202", "0.49068052", "0.490592", "0.49051994", "0.49022052", "0.489458", "0.489116", "0.48713973", "0.48675373", "0.48670575", "0.48387372", "0.48266777", "0.48211613", "0.4812847", "0.47999012", "0.47976908", "0.4794434", "0.47744483", "0.47731337", "0.47724542", "0.47686633", "0.47648853", "0.47647586", "0.47502434", "0.47486776", "0.47477734", "0.4741912", "0.4740317", "0.47376955", "0.47292674", "0.4719017", "0.471522", "0.4709945", "0.47092575", "0.4702368", "0.47022295", "0.46989313", "0.46987128", "0.4693586", "0.46888795", "0.46882772", "0.46761483", "0.46749133", "0.46727273", "0.46712705", "0.46646196", "0.46637264", "0.46502745", "0.4640942", "0.46280167", "0.46183527", "0.46150774", "0.46139124", "0.46064764", "0.46054998", "0.45945817", "0.45921385", "0.45871732", "0.45840347", "0.45779076", "0.4574242", "0.45722252", "0.45687705", "0.45645046", "0.4555788", "0.45554093", "0.45533583" ]
0.45858774
91
Takes wikitext and parses the wikitext for viewing. The following steps are performed: Validation Preprocessing (for viewing) Entity substitution Optional: Expansion Parsing Entity substitution Postprocessing
public CompiledPage postprocess( PageId pageId, String wikitext, ExpansionCallback callback) throws CompilerException { if (pageId == null) throw new NullPointerException(); PageTitle title = pageId.getTitle(); CompilerLog log = new CompilerLog(); log.setTitle(title.getFullTitle()); log.setRevision(pageId.getRevision()); LazyParsedPage pAst; try { EntityMap entityMap = new EntityMap(); String validatedWikitext = validate(title, wikitext, entityMap, log); LazyPreprocessedPage ppAst = preprocess(title, validatedWikitext, false, entityMap, log); LazyPreprocessedPage pprAst = ppAst; if (callback != null) pprAst = expand(callback, title, ppAst, entityMap, null, false, log); pAst = parse(title, pprAst, entityMap, log); pAst = postprocess(title, pAst, log); } catch (CompilerException e) { e.attachLog(log); throw e; } catch (Throwable e) { throw new CompilerException("Compilation failed!", e, log); } return new CompiledPage( new Page(pAst.getContent()), pAst.getWarnings(), log); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void processContentEn() {\n if (this.content == null || this.content.equals(\"\")) {\r\n _logger.error(\"{} - The sentence is null or empty\", this.traceId);\r\n }\r\n\r\n // process input using ltp(Segmentation, POS, DP, SRL)\r\n this.nlp = new NLP(this.content, this.traceId, this.setting);\r\n }", "private void parseRawText() {\n\t\t//1-new lines\n\t\t//2-pageObjects\n\t\t//3-sections\n\t\t//Clear any residual data.\n\t\tlinePositions.clear();\n\t\tsections.clear();\n\t\tpageObjects.clear();\n\t\tcategories.clear();\n\t\tinterwikis.clear();\n\t\t\n\t\t//Generate data.\n\t\tparsePageForNewLines();\n\t\tparsePageForPageObjects();\n\t\tparsePageForSections();\n\t}", "private void parseEntities() {\n // See: https://github.com/twitter/twitter-text/tree/master/java\n entities.addExtractedEntities(TweetEntityAbstract.entitiesExtractor.extractCashtagsWithIndices(getText()));\n entities.addExtractedEntities(TweetEntityAbstract.entitiesExtractor.extractHashtagsWithIndices(getText()));\n entities.addExtractedEntities(TweetEntityAbstract.entitiesExtractor.extractMentionedScreennamesWithIndices(getText()));\n }", "protected void importText(String text, Epml epml) {\n\t}", "private void processContentCn() {\n if (this.content == null || this.content.equals(\"\")) {\r\n _logger.error(\"{} - The sentence is null or empty\", this.traceId);\r\n }\r\n\r\n // process input using ltp(Segmentation, POS, DP, SRL)\r\n this.ltp = new LTP(this.content, this.traceId, this.setting);\r\n }", "String getTransformedText();", "public static Patent transform(String patentxml) {\n\t\t patentxml = patentxml.trim();\n\t\t //patentxml = patentxml.replace(\"<!DOCTYPE math PUBLIC \\\"-//W3C//DTD MathML 3.0//EN\\\" \\\"http://www.w3.org/Math/DTD/mathml3/mathml3.dtd\\\">\", \"<!DOCTYPE PATDOC [<!ENTITY nbsp \\\"&#160;\\\" ><!ENTITY iexcl \\\"&#161;\\\" ><!ENTITY cent \\\"&#162;\\\" ><!ENTITY pound \\\"&#163;\\\" ><!ENTITY curren \\\"&#164;\\\" ><!ENTITY yen \\\"&#165;\\\" ><!ENTITY brvbar \\\"&#166;\\\" ><!ENTITY sect \\\"&#167;\\\" ><!ENTITY uml \\\"&#168;\\\" ><!ENTITY copy \\\"&#169;\\\" ><!ENTITY ordf \\\"&#170;\\\" ><!ENTITY laquo \\\"&#171;\\\" ><!ENTITY not \\\"&#172;\\\" ><!ENTITY shy \\\"&#173;\\\" ><!ENTITY reg \\\"&#174;\\\" ><!ENTITY macr \\\"&#175;\\\" ><!ENTITY deg \\\"&#176;\\\" ><!ENTITY plusmn \\\"&#177;\\\" ><!ENTITY sup2 \\\"&#178;\\\" ><!ENTITY sup3 \\\"&#179;\\\" ><!ENTITY acute \\\"&#180;\\\" ><!ENTITY micro \\\"&#181;\\\" ><!ENTITY para \\\"&#182;\\\" ><!ENTITY middot \\\"&#183;\\\" ><!ENTITY cedil \\\"&#184;\\\" ><!ENTITY sup1 \\\"&#185;\\\" ><!ENTITY ordm \\\"&#186;\\\" ><!ENTITY raquo \\\"&#187;\\\" ><!ENTITY frac14 \\\"&#188;\\\" ><!ENTITY frac12 \\\"&#189;\\\" ><!ENTITY frac34 \\\"&#190;\\\" ><!ENTITY iquest \\\"&#191;\\\" ><!ENTITY Agrave \\\"&#192;\\\" ><!ENTITY Aacute \\\"&#193;\\\" ><!ENTITY Acirc \\\"&#194;\\\" ><!ENTITY Atilde \\\"&#195;\\\" ><!ENTITY Auml \\\"&#196;\\\" ><!ENTITY Aring \\\"&#197;\\\" ><!ENTITY AElig \\\"&#198;\\\" ><!ENTITY Ccedil \\\"&#199;\\\" ><!ENTITY Egrave \\\"&#200;\\\" ><!ENTITY Eacute \\\"&#201;\\\" ><!ENTITY Ecirc \\\"&#202;\\\" ><!ENTITY Euml \\\"&#203;\\\" ><!ENTITY Igrave \\\"&#204;\\\" ><!ENTITY Iacute \\\"&#205;\\\" ><!ENTITY Icirc \\\"&#206;\\\" ><!ENTITY Iuml \\\"&#207;\\\" ><!ENTITY ETH \\\"&#208;\\\" ><!ENTITY Ntilde \\\"&#209;\\\" ><!ENTITY Ograve \\\"&#210;\\\" ><!ENTITY Oacute \\\"&#211;\\\" ><!ENTITY Ocirc \\\"&#212;\\\" ><!ENTITY Otilde \\\"&#213;\\\" ><!ENTITY Ouml \\\"&#214;\\\" ><!ENTITY times \\\"&#215;\\\" ><!ENTITY Oslash \\\"&#216;\\\" ><!ENTITY Ugrave \\\"&#217;\\\" ><!ENTITY Uacute \\\"&#218;\\\" ><!ENTITY Ucirc \\\"&#219;\\\" ><!ENTITY Uuml \\\"&#220;\\\" ><!ENTITY Yacute \\\"&#221;\\\" ><!ENTITY THORN \\\"&#222;\\\" ><!ENTITY szlig \\\"&#223;\\\" ><!ENTITY agrave \\\"&#224;\\\" ><!ENTITY aacute \\\"&#225;\\\" ><!ENTITY acirc \\\"&#226;\\\" ><!ENTITY atilde \\\"&#227;\\\" ><!ENTITY auml \\\"&#228;\\\" ><!ENTITY aring \\\"&#229;\\\" ><!ENTITY aelig \\\"&#230;\\\" ><!ENTITY ccedil \\\"&#231;\\\" ><!ENTITY egrave \\\"&#232;\\\" ><!ENTITY eacute \\\"&#233;\\\" ><!ENTITY ecirc \\\"&#234;\\\" ><!ENTITY euml \\\"&#235;\\\" ><!ENTITY igrave \\\"&#236;\\\" ><!ENTITY iacute \\\"&#237;\\\" ><!ENTITY icirc \\\"&#238;\\\" ><!ENTITY iuml \\\"&#239;\\\" ><!ENTITY eth \\\"&#240;\\\" ><!ENTITY ntilde \\\"&#241;\\\" ><!ENTITY ograve \\\"&#242;\\\" ><!ENTITY oacute \\\"&#243;\\\" ><!ENTITY ocirc \\\"&#244;\\\" ><!ENTITY otilde \\\"&#245;\\\" ><!ENTITY ouml \\\"&#246;\\\" ><!ENTITY divide \\\"&#247;\\\" ><!ENTITY oslash \\\"&#248;\\\" ><!ENTITY ugrave \\\"&#249;\\\" ><!ENTITY uacute \\\"&#250;\\\" ><!ENTITY ucirc \\\"&#251;\\\" ><!ENTITY uuml \\\"&#252;\\\" ><!ENTITY yacute \\\"&#253;\\\" ><!ENTITY thorn \\\"&#254;\\\" ><!ENTITY yuml \\\"&#255;\\\" > <!ENTITY lt \\\"&#38;#60;\\\" > <!ENTITY gt \\\"&#62;\\\" > <!ENTITY amp \\\"&#38;#38;\\\" > <!ENTITY apos \\\"&#39;\\\" > <!ENTITY quot \\\"&#34;\\\" > <!ENTITY OElig \\\"&#338;\\\" > <!ENTITY oelig \\\"&#339;\\\" > <!ENTITY Scaron \\\"&#352;\\\" > <!ENTITY scaron \\\"&#353;\\\" > <!ENTITY Yuml \\\"&#376;\\\" > <!ENTITY circ \\\"&#710;\\\" > <!ENTITY tilde \\\"&#732;\\\" > <!ENTITY ensp \\\"&#8194;\\\" > <!ENTITY emsp \\\"&#8195;\\\" > <!ENTITY thinsp \\\"&#8201;\\\" > <!ENTITY zwnj \\\"&#8204;\\\" > <!ENTITY zwj \\\"&#8205;\\\" > <!ENTITY lrm \\\"&#8206;\\\" > <!ENTITY rlm \\\"&#8207;\\\" > <!ENTITY ndash \\\"&#8211;\\\" > <!ENTITY mdash \\\"&#8212;\\\" > <!ENTITY lsquo \\\"&#8216;\\\" > <!ENTITY rsquo \\\"&#8217;\\\" > <!ENTITY sbquo \\\"&#8218;\\\" > <!ENTITY ldquo \\\"&#8220;\\\" > <!ENTITY rdquo \\\"&#8221;\\\" > <!ENTITY bdquo \\\"&#8222;\\\" > <!ENTITY dagger \\\"&#8224;\\\" > <!ENTITY Dagger \\\"&#8225;\\\" > <!ENTITY permil \\\"&#8240;\\\" > <!ENTITY lsaquo \\\"&#8249;\\\" > <!ENTITY rsaquo \\\"&#8250;\\\" > <!ENTITY euro \\\"&#8364;\\\" > <!ENTITY minus \\\"&#43;\\\" > <!ENTITY plus \\\"&#43;\\\" > <!ENTITY equals \\\"&#61;\\\" > <!ENTITY af \\\"\\\" > <!ENTITY it \\\"\\\" ><!ENTITY fnof \\\"&#402;\\\" > <!ENTITY Alpha \\\"&#913;\\\" > <!ENTITY Beta \\\"&#914;\\\" > <!ENTITY Gamma \\\"&#915;\\\" > <!ENTITY Delta \\\"&#916;\\\" > <!ENTITY Epsilon \\\"&#917;\\\" > <!ENTITY Zeta \\\"&#918;\\\" > <!ENTITY Eta \\\"&#919;\\\" > <!ENTITY Theta \\\"&#920;\\\" > <!ENTITY Iota \\\"&#921;\\\" > <!ENTITY Kappa \\\"&#922;\\\" > <!ENTITY Lambda \\\"&#923;\\\" > <!ENTITY Mu \\\"&#924;\\\" > <!ENTITY Nu \\\"&#925;\\\" > <!ENTITY Xi \\\"&#926;\\\" > <!ENTITY Omicron \\\"&#927;\\\" > <!ENTITY Pi \\\"&#928;\\\" > <!ENTITY Rho \\\"&#929;\\\" > <!ENTITY Sigma \\\"&#931;\\\" > <!ENTITY Tau \\\"&#932;\\\" > <!ENTITY Upsilon \\\"&#933;\\\" > <!ENTITY Phi \\\"&#934;\\\" > <!ENTITY Chi \\\"&#935;\\\" > <!ENTITY Psi \\\"&#936;\\\" > <!ENTITY Omega \\\"&#937;\\\" > <!ENTITY alpha \\\"&#945;\\\" > <!ENTITY beta \\\"&#946;\\\" > <!ENTITY gamma \\\"&#947;\\\" > <!ENTITY delta \\\"&#948;\\\" > <!ENTITY epsilon \\\"&#949;\\\" > <!ENTITY zeta \\\"&#950;\\\" > <!ENTITY eta \\\"&#951;\\\" > <!ENTITY theta \\\"&#952;\\\" > <!ENTITY iota \\\"&#953;\\\" > <!ENTITY kappa \\\"&#954;\\\" > <!ENTITY lambda \\\"&#955;\\\" > <!ENTITY mu \\\"&#956;\\\" > <!ENTITY nu \\\"&#957;\\\" > <!ENTITY xi \\\"&#958;\\\" > <!ENTITY omicron \\\"&#959;\\\" > <!ENTITY pi \\\"&#960;\\\" > <!ENTITY rho \\\"&#961;\\\" > <!ENTITY sigmaf \\\"&#962;\\\" > <!ENTITY sigma \\\"&#963;\\\" > <!ENTITY tau \\\"&#964;\\\" > <!ENTITY upsilon \\\"&#965;\\\" > <!ENTITY phi \\\"&#966;\\\" > <!ENTITY chi \\\"&#967;\\\" > <!ENTITY psi \\\"&#968;\\\" > <!ENTITY omega \\\"&#969;\\\" > <!ENTITY thetasym \\\"&#977;\\\" > <!ENTITY upsih \\\"&#978;\\\" > <!ENTITY piv \\\"&#982;\\\" > <!ENTITY bull \\\"&#8226;\\\" > <!ENTITY hellip \\\"&#8230;\\\" > <!ENTITY prime \\\"&#8242;\\\" > <!ENTITY Prime \\\"&#8243;\\\" > <!ENTITY oline \\\"&#8254;\\\" > <!ENTITY frasl \\\"&#8260;\\\" > <!ENTITY weierp \\\"&#8472;\\\" > <!ENTITY image \\\"&#8465;\\\" > <!ENTITY real \\\"&#8476;\\\" > <!ENTITY trade \\\"&#8482;\\\" > <!ENTITY alefsym \\\"&#8501;\\\" > <!ENTITY larr \\\"&#8592;\\\" > <!ENTITY uarr \\\"&#8593;\\\" > <!ENTITY rarr \\\"&#8594;\\\" > <!ENTITY darr \\\"&#8595;\\\" > <!ENTITY harr \\\"&#8596;\\\" > <!ENTITY crarr \\\"&#8629;\\\" > <!ENTITY lArr \\\"&#8656;\\\" > <!ENTITY uArr \\\"&#8657;\\\" > <!ENTITY rArr \\\"&#8658;\\\" > <!ENTITY dArr \\\"&#8659;\\\" > <!ENTITY hArr \\\"&#8660;\\\" > <!ENTITY forall \\\"&#8704;\\\" > <!ENTITY part \\\"&#8706;\\\" > <!ENTITY exist \\\"&#8707;\\\" > <!ENTITY empty \\\"&#8709;\\\" > <!ENTITY nabla \\\"&#8711;\\\" > <!ENTITY isin \\\"&#8712;\\\" > <!ENTITY notin \\\"&#8713;\\\" > <!ENTITY ni \\\"&#8715;\\\" > <!ENTITY prod \\\"&#8719;\\\" > <!ENTITY sum \\\"&#8721;\\\" > <!ENTITY minus \\\"&#8722;\\\" > <!ENTITY lowast \\\"&#8727;\\\" > <!ENTITY radic \\\"&#8730;\\\" > <!ENTITY prop \\\"&#8733;\\\" > <!ENTITY infin \\\"&#8734;\\\" > <!ENTITY ang \\\"&#8736;\\\" > <!ENTITY and \\\"&#8743;\\\" > <!ENTITY or \\\"&#8744;\\\" > <!ENTITY cap \\\"&#8745;\\\" > <!ENTITY cup \\\"&#8746;\\\" > <!ENTITY int \\\"&#8747;\\\" > <!ENTITY there4 \\\"&#8756;\\\" > <!ENTITY sim \\\"&#8764;\\\" > <!ENTITY cong \\\"&#8773;\\\" > <!ENTITY asymp \\\"&#8776;\\\" > <!ENTITY ne \\\"&#8800;\\\" > <!ENTITY equiv \\\"&#8801;\\\" > <!ENTITY le \\\"&#8804;\\\" > <!ENTITY ge \\\"&#8805;\\\" > <!ENTITY sub \\\"&#8834;\\\" > <!ENTITY sup \\\"&#8835;\\\" > <!ENTITY nsub \\\"&#8836;\\\" > <!ENTITY sube \\\"&#8838;\\\" > <!ENTITY supe \\\"&#8839;\\\" > <!ENTITY oplus \\\"&#8853;\\\" > <!ENTITY otimes \\\"&#8855;\\\" > <!ENTITY perp \\\"&#8869;\\\" > <!ENTITY sdot \\\"&#8901;\\\" > <!ENTITY lceil \\\"&#8968;\\\" > <!ENTITY rceil \\\"&#8969;\\\" > <!ENTITY lfloor \\\"&#8970;\\\" > <!ENTITY rfloor \\\"&#8971;\\\" > <!ENTITY lang \\\"&#9001;\\\" > <!ENTITY rang \\\"&#9002;\\\" > <!ENTITY loz \\\"&#9674;\\\" > <!ENTITY spades \\\"&#9824;\\\" > <!ENTITY clubs \\\"&#9827;\\\" > <!ENTITY hearts \\\"&#9829;\\\" > <!ENTITY diams \\\"&#9830;\\\" > <!ENTITY lcub \\\"\\\" > <!ENTITY rcub \\\"\\\" > <!ENTITY excl \\\"\\\" > <!ENTITY quest \\\"\\\" > <!ENTITY num \\\"\\\" >]>\");\n\t\t //patentxml = patentxml.replace(\"<!DOCTYPE math PUBLIC \\\"-//W3C//DTD MathML 3.0//EN\\\" \\\"http://www.w3.org/Math/DTD/mathml3/mathml3.dtd\\\">\", \"<!DOCTYPE math PUBLIC \\\"-//W3C//DTD MathML 2.0//EN\\\" \\\"dtds/mathml2.dtd\\\">\");\n\t\t patentxml = patentxml.replace(\"<!DOCTYPE math PUBLIC \\\"-//W3C//DTD MathML 3.0//EN\\\" \\\"http://www.w3.org/Math/DTD/mathml3/mathml3.dtd\\\">\", \"<!DOCTYPE math PUBLIC \\\"-//W3C//DTD MathML 2.0//EN\\\" \\\"http://10.18.203.79:7070/solr/dtds/mathml2.dtd\\\">\");\n\t\t Patent parsedPatent = null;\n\t if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v4.5 2014-04-03\\\"\")==true) { // patent xml is grant in DTD v4.5\n\t\t\t\tparsedPatent = parseGrantv45(patentxml);\t\t \n\t }\n\t else if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v4.4 2013-05-16\\\"\")==true) { // patent xml is grant in DTD v4.4\n\t \tparsedPatent = parseGrantv44(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v4.3 2012-12-04\\\"\")==true) { // patent xml is grant in DTD v4.3\n\t \tparsedPatent = parseGrantv43(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v4.2 2006-08-23\\\"\")==true) { // patent xml is grant in DTD v4.2\n\t \tparsedPatent = parseGrantv42(patentxml);\n\t }\t\n\t else if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v4.1 2005-08-25\\\"\")==true) { // patent xml is grant in DTD v4.5\n\t \tparsedPatent = parseGrantv41(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v40 2004-12-02\\\"\")==true) { // patent xml is grant in DTD v4.0\n\t \tparsedPatent = parseGrantv40_041202(patentxml);\n\t }\n\t else if(patentxml.contains(\"<PATDOC DTD=\\\"2.5\\\"\")==true) { // patent xml is grant in DTD v2.5\n\t \tparsedPatent = parseGrantv25(patentxml);\t\t \t\t\t\t \n\t }\n\t else if(patentxml.contains(\"<PATDOC DTD=\\\"2.4\\\"\")==true) { // patent xml is grant in DTD v2.5\n\t \tparsedPatent = parseGrantv24(patentxml);\t\t \t\t\t\t \n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.4 2014-04-03\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv44(patentxml);\t\t \n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.3 2012-12-04\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv43(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.2 2006-08-23\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv42(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.1 2005-08-25\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv41(patentxml);\n\t }\t \t \n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.0 2004-12-02\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv40_041202(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.0 2004-10-28\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv40_041028(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.0 2004-09-27\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv40_040927(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.0 2004-09-08\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv40_040908(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.0 2004-04-15\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv40_040415(patentxml);\n\t }\n\t else if(patentxml.indexOf(\"<!DOCTYPE patent-application-publication\")==0 && patentxml.contains(\"pap-v16-2002-01-01.dtd\")==true) { // patent xml is application in DTD v1.6\n\t \tparsedPatent = parseApplicationv16(patentxml);\n\t }\n\t\t return parsedPatent==null? new Patent():parsedPatent;\n\t }", "protected void processXlateText(Hashtable attributes)\n throws SAXException\n {\n\tString key = (String) attributes.get(XMLTag.ID);\n\tif ((xlatedText == null) || (textTag == null))\n\t {\n\t throw new SAXException(\"Encountered xlateText element (id=\" +\n\t\t\t key + \") outside defining element.\");\n\t }\n\tXMLTag tag = (XMLTag) attributes.get(XMLTag.TAG);\n\tString dflt = (String) attributes.get(XMLTag.REMIND);\n\tString substitute = (String) attributes.get(XMLTag.SUBSTITUTE);\n\tString xlated = textSource.getI18NText(key,dflt);\n // ignore lines that are bare accent graves\n if (xlated.compareTo(\"`\") == 0)\n return;\n if (substitute != null)\n\t {\n\t int p1 = xlated.indexOf(\"%1\");\n\t if (p1 < 0)\n\t p1 = xlated.indexOf(\"%s\");\n\t if (p1 < 0)\n\t p1 = xlated.indexOf(\"%d\");\n\t if (p1 >= 0)\n\t {\n int p2 = xlated.indexOf(\" \",p1);\n\t\tif (p2 < 0)\n\t\t {\n xlated = xlated.substring(0,p1) + substitute;\n\t\t }\n\t\telse\n\t\t {\n xlated = xlated.substring(0,p1) + substitute +\n\t\t xlated.substring(p2);\n\t\t }\n\t\t}\n\t else // just append the substitute string.\n\t {\n p1 = xlated.lastIndexOf(\" \");\n\t\tif (p1 < (xlated.length() - 1))\n\t\t {\n\t\t xlated = xlated + \" \";\n\t\t }\n\t\txlated = xlated + substitute;\n\t\t}\n\t }\n\txlatedText.add(xlated);\n\ttextTag.add(tag);\n\ttextKey.add(key);\n\t}", "@Override\n public void onSuccess(Text visionText) {\n\n Log.d(TAG, \"onSuccess: \");\n extractText(visionText);\n }", "protected void processTextElement(XMLTag elementTag)\n throws SAXException\n {\n\tif (elementTag == XMLTag.LABEL)\n\t {\n\t // one line, no formatting, applies to either\n\t // control or menu item.\n\t if (currentControl != null)\n\t {\n\t\tString label = (String) xlatedText.get(0);\n\t\tcurrentControl.setLabelText(label);\n\t\tString labelKey = (String) textKey.get(0);\n\t\tcurrentControl.setLabelKey(labelKey);\n\t\t}\n\t }\n\telse if (elementTag == XMLTag.TITLE)\n\t {\n\t if (currentPanel != null)\n\t {\n\t\tString title = (String) xlatedText.get(0);\n\t\tcurrentPanel.setTitle(title);\n\t\t} \n\t }\n\telse if (elementTag == XMLTag.HELP)\n\t {\n\t // Need to concatenate all strings and format\n\t // as HTML - will be embedded in another HTML\n\t // document, so we can leave off the <HTML> and <BODY>\n\t StringBuffer helpString = new StringBuffer();\n\t String[] keys = new String[textKey.size()];\n boolean bInList = false;\n\t for (int i = 0; i < xlatedText.size(); i++)\n\t {\n\t\tString temp = replaceAngleBrackets((String) xlatedText.get(i));\n\t\tXMLTag tTag = (XMLTag) textTag.get(i);\n\t\tif (tTag == XMLTag.PARAGRAPH)\n\t\t {\n if (bInList)\n\t\t {\n\t\t helpString.append(\"</dl>\\n\"); \n bInList = false;\n\t\t\t}\n\t\t if (i == 0)\n\t\t {\n\t\t\t //~~\t\thelpString.append(\"<P>\");\n\t\t\t}\n\t\t else\n\t\t {\n\t\t helpString.append(\"<p>\");\n\t\t\t}\n helpString.append(temp);\n\t\t }\n\t\telse if (tTag == XMLTag.LISTITEM)\n\t\t {\n if (!bInList)\n\t\t {\n\t\t helpString.append(\"<dl>\\n\");\n\t\t\tbInList = true;\n\t\t\t}\n\t\t if (i > 0)\n\t\t helpString.append(\"\\n\");\n\t\t helpString.append(\"<dd>\" + temp + \"</dd>\\n\");\n\t\t }\n\t\telse\n\t\t {\n\t\t helpString.append(temp);\n\t\t }\n\t\tkeys[i] = (String) textKey.get(i);\n\t\t}\n if (bInList)\n\t {\n helpString.append(\"</dl>\\n\");\n\t\t}\n\t helpString.append(\"</p></FONT>\\n\");\n\t // could apply to either a control or a menu item.\n\t if (currentControl != null)\n\t {\n\t\tcurrentControl.setHelpString(helpString.toString());\n\t\tcurrentControl.setHelpKeys(keys);\n\t\t}\n\t }\n\telse if (elementTag == XMLTag.CHOICES)\n\t {\n\t // only relevant if the current control is a combo, radio,\n\t // or checkbutton\n\t if (currentControl.isChoiceControl())\n\t {\n\t\tString[] keys = new String[textKey.size()];\n\t\tString[] choices = new String[xlatedText.size()];\n\t\tfor (int i = 0; i < xlatedText.size(); i++)\n\t\t {\n\t\t choices[i] = (String) xlatedText.get(i);\n\t\t keys[i] = (String) textKey.get(i);\n\t\t }\n\t\tcurrentControl.setChoiceStrings(choices);\n\t\tcurrentControl.setChoiceKeys(keys);\n\t\t}\n\t }\n\telse if (elementTag == XMLTag.TOOLTIP)\n\t {\n\t // just ignore \n\t // only relevant to menu items\n\n\t }\n\telse if (elementTag == XMLTag.DEFAULT)\n\t {\n if (currentControl != null)\n\t {\n\t\tString text = (String) xlatedText.get(0);\n\t\tcurrentControl.setDefaultValue(text);\n\t\tString key = (String)textKey.get(0);\n\t\tcurrentControl.setDefaultKey(key);\n\t }\n\t }\n\t// get rid of text and tags - we are done with them\n\txlatedText.clear();\n\txlatedText = null;\n\ttextTag.clear();\n\ttextTag = null;\n\t}", "private void processText(){\n if(text == null || text.length() == 0){\n // When posting a tweet, Twitter returns the \"text\" JSON field even if it's not trimmed...\n text = trimmedText;\n }else{\n // Trim the original contents received from Twitter\n text = text.substring(0, text.offsetByCodePoints(0, displayTextRange[1]));\n }\n\n // Transform HTML characters (for some reason Twitter sends those)\n text = org.apache.commons.text.StringEscapeUtils.unescapeHtml4(text);\n }", "public void testGetComplexText() throws Exception {\n \t\tXWPFWordExtractor extractor = \n \t\t\tnew XWPFWordExtractor(xmlB);\n \t\textractor.getText();\n \t\t\n \t\tString text = extractor.getText();\n \t\tassertTrue(text.length() > 0);\n \t\t\n \t\tchar euro = '\\u20ac';\n \t\tSystem.err.println(\"'\"+text.substring(text.length() - 20) + \"'\");\n \t\t\n \t\t// Check contents\n \t\tassertTrue(text.startsWith(\n \t\t\t\t\" \\n(V) ILLUSTRATIVE CASES\\n\\n\"\n \t\t));\n\t\tassertTrue(text.endsWith(\n \t\t\t\t\"As well as gaining \"+euro+\"90 from child benefit increases, he will also receive the early childhood supplement of \"+euro+\"250 per quarter for Vincent for the full four quarters of the year.\\n\\n\\n\\n \\n\\n\\n\"\n \t\t));\n \t\t\n \t\t// Check number of paragraphs\n \t\tint ps = 0;\n \t\tchar[] t = text.toCharArray();\n \t\tfor (int i = 0; i < t.length; i++) {\n \t\t\tif(t[i] == '\\n') { ps++; }\n \t\t}\n\t\tassertEquals(79, ps);\n \t}", "private void textilize () {\n\n textIndex = 0;\n int textEnd = line.length() - 1;\n listChars = new StringBuffer();\n linkAlias = false;\n while (textIndex < line.length()\n && (Character.isWhitespace(textChar()))) {\n textIndex++;\n }\n while (textEnd >= 0\n && textEnd >= textIndex\n && Character.isWhitespace (line.charAt (textEnd))) {\n textEnd--;\n }\n boolean blankLine = (textIndex >= line.length());\n if (blankLine) {\n textilizeBlankLine();\n }\n else\n if ((textIndex > 0)\n || ((line.length() > 0 )\n && (line.charAt(0) == '<'))) {\n // First character is white space of the beginning of an html tag:\n // Doesn't look like textile... process it without modification.\n }\n else\n if (((textEnd - textIndex) == 3)\n && line.substring(textIndex,textEnd + 1).equals (\"----\")) {\n // && (line.substring(textIndex, (textEnd + 1)).equals (\"----\")) {\n textilizeHorizontalRule(textIndex, textEnd);\n } else {\n textilizeNonBlankLine();\n };\n }", "@Override\n\tpublic void process(JCas aJCas) throws AnalysisEngineProcessException {\n\t\tString text = aJCas.getDocumentText();\n\n\t\t// create an empty Annotation just with the given text\n\t\tAnnotation document = new Annotation(text);\n//\t\tAnnotation document = new Annotation(\"Barack Obama was born in Hawaii. He is the president. Obama was elected in 2008.\");\n\n\t\t// run all Annotators on this text\n\t\tpipeline.annotate(document); \n\t\tList<CoreMap> sentences = document.get(SentencesAnnotation.class);\n\t\t HelperDataStructures hds = new HelperDataStructures();\n\n\t\t\n\t\t//SPnew language-specific settings:\n\t\t//SPnew subject tags of the parser\n\t\t HashSet<String> subjTag = new HashSet<String>(); \n\t\t HashSet<String> dirObjTag = new HashSet<String>(); \n\t\t //subordinate conjunction tags\n\t\t HashSet<String> compTag = new HashSet<String>(); \n\t\t //pronoun tags\n\t\t HashSet<String> pronTag = new HashSet<String>(); \n\t\t \n\t\t HashSet<String> passSubjTag = new HashSet<String>();\n\t\t HashSet<String> apposTag = new HashSet<String>(); \n\t\t HashSet<String> verbComplementTag = new HashSet<String>(); \n\t\t HashSet<String> infVerbTag = new HashSet<String>(); \n\t\t HashSet<String> relclauseTag = new HashSet<String>(); \n\t\t HashSet<String> aclauseTag = new HashSet<String>(); \n\t\t \n\t\t HashSet<String> compLemma = new HashSet<String>(); \n\t\t HashSet<String> coordLemma = new HashSet<String>(); \n\t\t HashSet<String> directQuoteIntro = new HashSet<String>(); \n\t\t HashSet<String> indirectQuoteIntroChunkValue = new HashSet<String>();\n\t\t \n//\t\t HashSet<String> finiteVerbTag = new HashSet<String>();\n\t\t \n\n\t\t //OPEN ISSUES PROBLEMS:\n\t\t //the subject - verb relation finding does not account for several specific cases: \n\t\t //opinion verbs with passive subjects as opinion holder are not accounted for,\n\t\t //what is needed is a marker in the lex files like PASSSUBJ\n\t\t //ex: Obama is worried/Merkel is concerned\n\t\t //Many of the poorer countries are concerned that the reduction in structural funds and farm subsidies may be detrimental in their attempts to fulfill the Copenhagen Criteria.\n\t\t //Some of the more well off EU states are also worried about the possible effects a sudden influx of cheap labor may have on their economies. Others are afraid that regional aid may be diverted away from those who currently benefit to the new, poorer countries that join in 2004 and beyond. \n\t\t// Does not account for infinitival constructions, here again a marker is needed to specify\n\t\t //subject versus object equi\n\t\t\t//Christian Noyer was reported to have said that it is ok.\n\t\t\t//Reuters has reported Christian Noyer to have said that it is ok.\n\t\t //Obama is likely to have said.. \n\t\t //Several opinion holder- opinion verb pairs in one sentence are not accounted for, right now the first pair is taken.\n\t\t //what is needed is to run through all dependencies. For inderect quotes the xcomp value of the embedded verb points to the \n\t\t //opinion verb. For direct quotes the offsets closest to thwe quote are relevant.\n\t\t //a specific treatment of inverted subjects is necessary then. Right now the\n\t\t //strategy relies on the fact that after the first subj/dirobj - verb pair the\n\t\t //search is interrupted. Thus, if the direct object precedes the subject, it is taken as subject.\n\t\t // this is the case in incorrectly analysed inverted subjeects as: said Zwickel on Monday\n\t\t //coordination of subject not accounted for:employers and many economists\n\t\t //several subject-opinion verbs:\n\t\t //Zwickel has called the hours discrepancy between east and west a \"fairness gap,\" but employers and many economists point out that many eastern operations have a much lower productivity than their western counterparts.\n\t\t if (language.equals(\"en\")){\n \t subjTag.add(\"nsubj\");\n \t subjTag.add(\"xsubj\");\n \t subjTag.add(\"nmod:agent\");\n \t \n \t dirObjTag.add(\"dobj\"); //for inverted subject: \" \" said IG metall boss Klaus Zwickel on Monday morning.\n \t \t\t\t\t\t\t//works only with break DEPENDENCYSEARCH, otherwise \"Monday\" is nsubj \n \t \t\t\t\t\t\t//for infinitival subject of object equi: Reuters reports Obama to have said\n \tpassSubjTag.add(\"nsubjpass\");\n \tapposTag.add(\"appos\");\n \trelclauseTag.add(\"acl:relcl\");\n \taclauseTag.add(\"acl\");\n \t compTag.add(\"mark\");\n \t pronTag.add(\"prp\");\n \thds.pronTag.add(\"prp\");\n \tcompLemma.add(\"that\");\n \tcoordLemma.add(\"and\");\n \tverbComplementTag.add(\"ccomp\");\n \tverbComplementTag.add(\"parataxis\");\n\n \tinfVerbTag.add(\"xcomp\"); //Reuters reported Merkel to have said\n \tinfVerbTag.add(\"advcl\");\n \tdirectQuoteIntro.add(\":\");\n \tindirectQuoteIntroChunkValue.add(\"SBAR\");\n \thds.objectEqui.add(\"report\");\n \thds.objectEqui.add(\"quote\");\n \thds.potentialIndirectQuoteTrigger.add(\"say\");\n// \thds.objectEqui.add(\"confirm\");\n// \thds.subjectEqui.add(\"promise\");\n// \thds.subjectEqui.add(\"quote\");\n// \thds.subjectEqui.add(\"confirm\");\n }\n\t\t \n\t\t boolean containsSubordinateConjunction = false;\n\t\t\n\t\t \n\t\tfor (CoreMap sentence : sentences) {\n//\t\t\tSystem.out.println(\"PREPROCESSING..\");\n\t\t\t\tSentenceAnnotation sentenceAnn = new SentenceAnnotation(aJCas);\n\t\t\t\t\n\t\t\t\tint beginSentence = sentence.get(TokensAnnotation.class).get(0)\n\t\t\t\t\t\t.beginPosition();\n\t\t\t\tint endSentence = sentence.get(TokensAnnotation.class)\n\t\t\t\t\t\t.get(sentence.get(TokensAnnotation.class).size() - 1)\n\t\t\t\t\t\t.endPosition();\n\t\t\t\tsentenceAnn.setBegin(beginSentence);\n\t\t\t\tsentenceAnn.setEnd(endSentence);\n\t\t\t\tsentenceAnn.addToIndexes();\n\t\t\t\t\n\t\t\t\t//SP Map offsets to NER\n\t\t\t\tList<NamedEntity> ners = JCasUtil.selectCovered(aJCas, //SPnew tut\n\t\t\t\t\t\tNamedEntity.class, sentenceAnn);\n\t\t\t\tfor (NamedEntity ne : ners){\n//\t\t\t\t\tSystem.out.println(\"NER TYPE: \" + ne.jcasType.toString());\n//\t\t\t\t\tSystem.out.println(\"NER TYPE: \" + ne.getCoveredText().toString());\n//\t\t\t\t\tSystem.out.println(\"NER TYPE: \" + ne.jcasType.casTypeCode);\n\t\t\t\t\t//Person is 71, Location is 213, Organization is 68 geht anders besser siehe unten\n\t\t\t\t\tint nerStart = ne\n\t\t\t\t\t\t\t.getBegin();\n\t\t\t\t\tint nerEnd = ne.getEnd();\n//\t\t\t\t\tSystem.out.println(\"NER: \" + ne.getCoveredText() + \" \" + nerStart + \"-\" + nerEnd ); \n\t\t\t\t\tString offsetNer = \"\" + nerStart + \"-\" + nerEnd;\n\t\t\t\t\thds.offsetToNer.put(offsetNer, ne.getCoveredText());\n//\t\t\t\t\tNer.add(offsetNer);\n\t\t\t\t\thds.Ner.add(offsetNer);\n//\t\t\t\t\tSystem.out.println(\"NER: TYPE \" +ne.getValue().toString());\n\t\t\t\t\tif (ne.getValue().equals(\"PERSON\")){\n\t\t\t\t\t\thds.NerPerson.add(offsetNer);\n\t\t\t\t\t}\n\t\t\t\t\telse if (ne.getValue().equals(\"ORGANIZATION\")){\n\t\t\t\t\t\thds.NerOrganization.add(offsetNer);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//DBpediaLink info: map offsets to links\n\t\t\t\tList<DBpediaResource> dbpeds = JCasUtil.selectCovered(aJCas, //SPnew tut\n\t\t\t\t\t\tDBpediaResource.class, sentenceAnn);\n\t\t\t\tfor (DBpediaResource dbped : dbpeds){\n//\t\t\t\t\t\n//\t\t\t\t\tint dbStart = dbped\n//\t\t\t\t\t\t\t.getBegin();\n//\t\t\t\t\tint dbEnd = dbped.getEnd();\n\t\t\t\t\t// not found if dbpedia offsets are wrongly outside than sentences\n//\t\t\t\t\tSystem.out.println(\"DBPED SENT: \" + sentenceAnn.getBegin()+ \"-\" + sentenceAnn.getEnd() ); \n//\t\t\t\t\tString offsetDB = \"\" + dbStart + \"-\" + dbEnd;\n//\t\t\t\t\thds.labelToDBpediaLink.put(dbped.getLabel(), dbped.getUri());\n//\t\t\t\t\tSystem.out.println(\"NOW DBPED: \" + dbped.getLabel() + \"URI: \" + dbped.getUri() ); \n\t\t\t\t\thds.dbpediaSurfaceFormToDBpediaLink.put(dbped.getCoveredText(), dbped.getUri());\n//\t\t\t\t\tSystem.out.println(\"NOW DBPED: \" + dbped.getCoveredText() + \"URI: \" + dbped.getUri() ); \n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//SP Map offsets to lemma of opinion verb/noun; parser does not provide lemma\n\t\t\t\t for (CoreLabel token: sentence.get(TokensAnnotation.class)) {\n//\t\t\t\t\t System.out.println(\"LEMMA \" + token.lemma().toString());\n\t\t\t\t\t int beginTok = token.beginPosition();\n\t\t\t\t\t int endTok = token.endPosition();\n\t\t\t\t\t String offsets = \"\" + beginTok + \"-\" + endTok;\n\t\t\t\t\t hds.offsetToLemma.put(offsets, token.lemma().toString());\n\t\t\t\t\t \n\t\t\t\t\t \t if (opinion_verbs.contains(token.lemma().toString())){\n\t\t\t\t\t\t\t hds.offsetToLemmaOfOpinionVerb.put(offsets, token.lemma().toString());\n\t\t\t\t\t\t\t hds.OpinionExpression.add(offsets);\n\t\t\t\t\t\t\t hds.offsetToLemmaOfOpinionExpression.put(offsets, token.lemma().toString());\n\t\t\t\t\t\t\t \n//\t\t\t \t System.out.println(\"offsetToLemmaOfOpinionVerb \" + token.lemma().toString());\n\t\t\t\t\t \t }\n\t\t\t\t\t \t if (passive_opinion_verbs.contains(token.lemma().toString())){\n\t\t\t\t\t\t\t hds.offsetToLemmaOfPassiveOpinionVerb.put(offsets, token.lemma().toString());\n\t\t\t\t\t\t\t hds.OpinionExpression.add(offsets);\n\t\t\t\t\t\t\t hds.offsetToLemmaOfOpinionExpression.put(offsets, token.lemma().toString());\n//\t\t\t \t System.out.println(\"offsetToLemmaOfPassiveOpinionVerb \" + token.lemma().toString());\n\t\t\t\t\t \t }\n\n\t\t\t\t } \n\n\t\t\t//SPnew parser\n\t\t\tTree tree = sentence.get(TreeAnnotation.class);\n\t\t\tTreebankLanguagePack tlp = new PennTreebankLanguagePack();\n\t\t\tGrammaticalStructureFactory gsf = tlp.grammaticalStructureFactory();\n\t\t\tGrammaticalStructure gs = gsf.newGrammaticalStructure(tree);\n\t\t\tCollection<TypedDependency> td = gs.typedDependenciesCollapsed();\n\n\t\t\t \n//\t\t\tSystem.out.println(\"TYPEDdep\" + td);\n\t\t\t\n\t\t\tObject[] list = td.toArray();\n//\t\t\tSystem.out.println(list.length);\n\t\t\tTypedDependency typedDependency;\nDEPENDENCYSEARCH: for (Object object : list) {\n\t\t\ttypedDependency = (TypedDependency) object;\n//\t\t\tSystem.out.println(\"DEP \" + typedDependency.dep().toString()+ \n//\t\t\t\t\t\" GOV \" + typedDependency.gov().toString()+ \n//\t\t\t\" :: \"+ \" RELN \"+typedDependency.reln().toString());\n\t\t\tString pos = null;\n String[] elements;\n String verbCand = null;\n int beginVerbCand = -5;\n\t\t\tint endVerbCand = -5;\n\t\t\tString offsetVerbCand = null;\n\n if (compTag.contains(typedDependency.reln().toString())) {\n \tcontainsSubordinateConjunction = true;\n// \tSystem.out.println(\"subordConj \" + typedDependency.dep().toString().toLowerCase());\n }\n \n else if (subjTag.contains(typedDependency.reln().toString())){\n \thds.predicateToSubjectChainHead.clear();\n \thds.subjectToPredicateChainHead.clear();\n \t\n \tverbCand = typedDependency.gov().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.gov().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.gov().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n//\t\t\t\tSystem.out.println(\"VERBCand \" + verbCand + offsetVerbCand);\n//\t\t\t\tfor (HashMap.Entry<String, String> entry : hds.offsetToLemma.entrySet()) {\n//\t\t\t\t String key = entry.getKey();\n//\t\t\t\t Object value = entry.getValue();\n//\t\t\t\t System.out.println(\"OFFSET \" + key + \" LEMMA \" + value);\n//\t\t\t\t // FOR LOOP\n//\t\t\t\t}\n//\t\t\t\tif (hds.offsetToLemma.containsKey(offsetVerbCand)){\n//\t\t\t\t\tString verbCandLemma = hds.offsetToLemma.get(offsetVerbCand);\n//\t\t\t\t\tif (hds.objectEqui.contains(verbCandLemma) || hds.subjectEqui.contains(verbCandLemma)){\n//\t\t\t\t\t\tSystem.out.println(\"SUBJCHAIN BEGIN verbCand \" + verbCand);\n//\t\t\t\t\t\tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t\tSystem.out.println(\"SUBJCHAINHEAD1\");\n\t\t\t\tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n//\t\t\t\tSystem.out.println(\"verbCand \" + verbCand);\n\t\t\t\t//hack for subj after obj said Zwickel (obj) on Monday morning (subj)\n\t\t\t\tif (language.equals(\"en\") \n\t\t\t\t\t\t&& hds.predicateToObject.containsKey(offsetVerbCand)\n\t\t\t\t\t\t){\n// \t\tSystem.out.println(\"CONTINUE DEP\");\n \t\tcontinue DEPENDENCYSEARCH;\n \t}\n\t\t\t\telse {\n\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n\t\t\t\t}\n }\n //Merkel is concerned\n else if (passSubjTag.contains(typedDependency.reln().toString())){\n \t//Merkel was reported\n \t//Merkel was concerned\n \t//Merkel was quoted\n \thds.predicateToSubjectChainHead.clear();\n \thds.subjectToPredicateChainHead.clear();\n \tverbCand = typedDependency.gov().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.gov().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.gov().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n//\t\t\t\tSystem.out.println(\"VERBCand \" + verbCand + offsetVerbCand);\n//\t\t\t\tif (hds.offsetToLemma.containsKey(offsetVerbCand)){\n//\t\t\t\t\tString verbCandLemma = hds.offsetToLemma.get(offsetVerbCand);\n////\t\t\t\t\tSystem.out.println(\"LEMMA verbCand \" + verbCandLemma);\n//\t\t\t\t\tif (hds.objectEqui.contains(verbCandLemma) || hds.subjectEqui.contains(verbCandLemma)){\n//\t\t\t\t\t\tSystem.out.println(\"SUBJCHAIN BEGIN verbCand \" + verbCand);\n//\t\t\t\t\t\tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n//\t\t\t\t\t}\n//\t\t\t\t}\n \t\n \tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n// \tSystem.out.println(\"SUBJCHAINHEAD2\");\n \t//Merkel is concerned\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfPassiveOpinionVerb,\n \t\t\thds);\n }\n //Meanwhile, the ECB's vice-president, Christian Noyer, was reported at the start of the week to have said that the bank's future interest-rate moves\n// would depend on the behavior of wage negotiators as well as the pace of the economic recovery.\n\n else if (apposTag.contains(typedDependency.reln().toString())){\n \t\n \tString subjCand = typedDependency.gov().toString().toLowerCase();\n \tint beginSubjCand = typedDependency.gov().beginPosition();\n \tint endSubjCand = typedDependency.gov().endPosition();\n \tString offsetSubjCand = \"\" + beginSubjCand + \"-\" + endSubjCand;\n \tString appo = typedDependency.dep().toString().toLowerCase();\n\t\t\t\tint beginAppo = typedDependency.dep().beginPosition();\n\t\t\t\tint endAppo = typedDependency.dep().endPosition();\n\t\t\t\tString offsetAppo = \"\" + beginAppo + \"-\" + endAppo;\n\t\t\t\t\n// \tSystem.out.println(\"APPOSITION1 \" + subjCand + \"::\"+ appo + \":\" + offsetSubjCand + \" \" + offsetAppo);\n \thds.subjectToApposition.put(offsetSubjCand, offsetAppo);\n }\n else if (relclauseTag.contains(typedDependency.reln().toString())){\n \tString subjCand = typedDependency.gov().toString().toLowerCase();\n \tint beginSubjCand = typedDependency.gov().beginPosition();\n \tint endSubjCand = typedDependency.gov().endPosition();\n \tString offsetSubjCand = \"\" + beginSubjCand + \"-\" + endSubjCand;\n \tverbCand = typedDependency.dep().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.dep().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.dep().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n\t\t\t\tString subjCandPos = null;\n\t\t\t\tif (hds.predicateToSubject.containsKey(offsetVerbCand)){\n\t\t\t\t\t\n\t\t\t\t\tif (subjCand.matches(\".+?/.+?\")) { \n\t\t\t\t\t\telements = subjCand.split(\"/\");\n\t\t\t\t\t\tsubjCand = elements[0];\n\t\t\t\t\t\tsubjCandPos = elements[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tString del = hds.predicateToSubject.get(offsetVerbCand);\n\t\t\t\t\thds.predicateToSubject.remove(offsetVerbCand);\n\t\t\t\t\thds.subjectToPredicate.remove(del);\n\t\t\t\t\thds.normalPredicateToSubject.remove(offsetVerbCand);\n\t\t\t\t\thds.subjectToNormalPredicate.remove(del);\n//\t\t\t\t\tSystem.out.println(\"REMOVE RELPRO \" + verbCand + \"/\" + hds.offsetToLemma.get(del));\n\t\t\t\t\thds.predicateToSubject.put(offsetVerbCand, offsetSubjCand);\n\t\t\t\t\thds.subjectToPredicate.put( offsetSubjCand, offsetVerbCand);\n\t\t\t\t\thds.normalPredicateToSubject.put(offsetVerbCand, offsetSubjCand);\n\t\t\t\t\thds.subjectToNormalPredicate.put( offsetSubjCand, offsetVerbCand);\n//\t\t\t\t\tSystem.out.println(\"RELCLAUSE \" + subjCand + \"::\" + \":\" + verbCand);\n\t\t\t\t\thds.offsetToSubjectHead.put(offsetSubjCand,subjCand);\n\t\t\t\t\thds.SubjectHead.add(offsetSubjCand);\n\t\t\t\t\t\n\t\t\t\t\tif (subjCandPos != null && hds.pronTag.contains(subjCandPos)){\n\t\t\t\t\t\thds.PronominalSubject.add(offsetSubjCand);\n\t\t\t\t\t}\n\t\t\t\t}\n \t\n \t\n }\n \n else if (dirObjTag.contains(typedDependency.reln().toString())\n \t\t){\n \tstoreRelations(typedDependency, hds.predicateToObject, hds.ObjectToPredicate, hds);\n \tverbCand = typedDependency.gov().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.gov().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.gov().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n\t\t\t\t\n\t\t\t\tString objCand = typedDependency.dep().toString().toLowerCase();\n \tint beginObjCand = typedDependency.dep().beginPosition();\n \tint endObjCand = typedDependency.dep().endPosition();\n \tString offsetObjCand = \"\" + beginObjCand + \"-\" + endObjCand;\n \tString objCandPos;\n \tif (objCand.matches(\".+?/.+?\")) { \n\t\t\t\t\telements = objCand.split(\"/\");\n\t\t\t\t\tobjCand = elements[0];\n\t\t\t\t\tobjCandPos = elements[1];\n//\t\t\t\t\tSystem.out.println(\"PRON OBJ \" + objCandPos);\n\t\t\t\t\tif (pronTag.contains(objCandPos)){\n\t\t\t\t\thds.PronominalSubject.add(offsetObjCand);\n\t\t\t\t\t}\n\t\t\t\t\t}\n// \tSystem.out.println(\"DIROBJ STORE ONLY\");\n \t//told Obama\n \t//said IG metall boss Klaus Zwickel\n \t// problem: pointing DO\n \t//explains David Gems, pointing out the genetically manipulated species.\n \t if (language.equals(\"en\") \n \t\t\t\t\t\t&& !hds.normalPredicateToSubject.containsKey(offsetVerbCand)\n \t\t\t\t\t\t){\n// \t\t System.out.println(\"INVERSE SUBJ HACK ENGLISH PREDTOOBJ\");\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n \t }\n }\n //was reported to have said\n else if (infVerbTag.contains(typedDependency.reln().toString())){\n \tstoreRelations(typedDependency, hds.mainToInfinitiveVerb, hds.infinitiveToMainVerb, hds);\n// \tSystem.out.println(\"MAIN-INF\");\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n \t\n }\n else if (aclauseTag.contains(typedDependency.reln().toString())){\n \tstoreRelations(typedDependency, hds.nounToInfinitiveVerb, hds.infinitiveVerbToNoun, hds);\n// \tSystem.out.println(\"NOUN-INF\");\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n \t\n }\n \n \n\n\t\t\t}\n\t\t\t\n//\t\t\tSemanticGraph dependencies = sentence.get(CollapsedCCProcessedDependenciesAnnotation.class);\n//\t\t\tSystem.out.println(\"SEM-DEP \" + dependencies);\t\n\t\t}\n\t\t\n\n\t\tMap<Integer, edu.stanford.nlp.dcoref.CorefChain> corefChains = document.get(CorefChainAnnotation.class);\n\t\t \n\t\t if (corefChains == null) { return; }\n\t\t //SPCOPY\n\t\t for (Entry<Integer, edu.stanford.nlp.dcoref.CorefChain> entry: corefChains.entrySet()) {\n//\t\t System.out.println(\"Chain \" + entry.getKey() + \" \");\n\t\t \tint chain = entry.getKey();\n\t\t String repMenNer = null;\n\t\t String repMen = null;\n\t\t String offsetRepMenNer = null;\n\n\t\t List<IaiCorefAnnotation> listCorefAnnotation = new ArrayList<IaiCorefAnnotation>();\n\t\t \n\t\t for (CorefMention m : entry.getValue().getMentionsInTextualOrder()) {\n\t\t \tboolean corefMentionContainsNer = false;\n\t\t \tboolean repMenContainsNer = false;\n\n//\t\t \n\n\t\t\t\t// We need to subtract one since the indices count from 1 but the Lists start from 0\n\t\t \tList<CoreLabel> tokens = sentences.get(m.sentNum - 1).get(TokensAnnotation.class);\n\t\t // We subtract two for end: one for 0-based indexing, and one because we want last token of mention not one following.\n//\t\t System.out.println(\" \" + m + \", i.e., 0-based character offsets [\" + tokens.get(m.startIndex - 1).beginPosition() +\n//\t\t \", \" + tokens.get(m.endIndex - 2).endPosition() + \")\");\n\t\t \n\t\t int beginCoref = tokens.get(m.startIndex - 1).beginPosition();\n\t\t\t\t int endCoref = tokens.get(m.endIndex - 2).endPosition();\n\t\t\t\t String offsetCorefMention = \"\" + beginCoref + \"-\" + endCoref;\n\t\t\t\t String corefMention = m.mentionSpan;\n\n\t\t\t\t CorefMention RepresentativeMention = entry.getValue().getRepresentativeMention();\n\t\t\t\t repMen = RepresentativeMention.mentionSpan;\n\t\t\t\t List<CoreLabel> repMenTokens = sentences.get(RepresentativeMention.sentNum - 1).get(TokensAnnotation.class);\n//\t\t\t\t System.out.println(\"REPMEN ANNO \" + \"\\\"\" + repMen + \"\\\"\" + \" is representative mention\" +\n// \", i.e., 0-based character offsets [\" + repMenTokens.get(RepresentativeMention.startIndex - 1).beginPosition() +\n//\t\t \", \" + repMenTokens.get(RepresentativeMention.endIndex - 2).endPosition() + \")\");\n\t\t\t\t int beginRepMen = repMenTokens.get(RepresentativeMention.startIndex - 1).beginPosition();\n\t\t\t\t int endRepMen = repMenTokens.get(RepresentativeMention.endIndex - 2).endPosition();\n\t\t\t\t String offsetRepMen = \"\" + beginRepMen + \"-\" + endRepMen;\n\t\t \t \n\t\t\t\t//Determine repMenNer that consists of largest NER (Merkel) to (Angela Merkel)\n\t\t\t\t //and \"Chancellor \"Angela Merkel\" to \"Angela Merkel\"\n\t\t \t //Further reduction to NER as in \"Chancellor Angela Merkel\" to \"Angela Merkel\" is\n\t\t\t\t //done in determineBestSubject. There, Chunk information and subjectHead info is available.\n\t\t\t\t //Chunk info and subjectHead info is used to distinguish \"Chancellor Angela Merkel\" to \"Angela Merkel\"\n\t\t\t\t //from \"The enemies of Angela Merkel\" which is not reduced to \"Angela Merkel\"\n\t\t\t\t //Problem solved: The corefMentions of a particular chain do not necessarily have the same RepMenNer (RepMen) \n\t\t\t\t // any more: Chancellor Angela Merkel repMenNer Chancellor Angela Merkel , then Angela Merkel has RepMenNer Angela Merkel\n\t\t\t\t if (offsetRepMenNer != null && hds.Ner.contains(offsetRepMenNer)){\n//\t\t\t\t\t System.out.println(\"NEWNer.contains(offsetRepMenNer)\");\n\t\t\t\t }\n\t\t\t\t else if (offsetRepMen != null && hds.Ner.contains(offsetRepMen)){\n\t\t\t\t\t repMenNer = repMen;\n\t\t\t\t\t\toffsetRepMenNer = offsetRepMen;\n//\t\t\t\t\t\tSystem.out.println(\"NEWNer.contains(offsetRepMen)\");\n\t\t\t\t }\n\t\t\t\t else if (offsetCorefMention != null && hds.Ner.contains(offsetCorefMention)){\n\t\t\t\t\t\trepMenNer = corefMention;\n\t\t\t\t\t\toffsetRepMenNer = offsetCorefMention;\n//\t\t\t\t\t\tSystem.out.println(\"Ner.contains(offsetCorefMention)\");\n\t\t\t\t\t}\n\t\t\t\t else {\n\t\t\t\t\t corefMentionContainsNer = offsetsContainAnnotation(offsetCorefMention,hds.Ner);\n\t\t\t\t\t repMenContainsNer = offsetsContainAnnotation(offsetRepMen,hds.Ner);\n//\t\t\t\t\t System.out.println(\"ELSE Ner.contains(offsetCorefMention)\");\n\t\t\t\t }\n\t\t\t\t //Determine repMenNer that contains NER\n\t\t\t\t\tif (repMenNer == null){\n\t\t\t\t\t\tif (corefMentionContainsNer){\n\t\t\t\t\t\t\trepMenNer = corefMention;\n\t\t\t\t\t\t\toffsetRepMenNer = offsetCorefMention;\n//\t\t\t\t\t\t\tSystem.out.println(\"DEFAULT1\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (repMenContainsNer){\n\t\t\t\t\t\t\trepMenNer = repMen;\n\t\t\t\t\t\t\toffsetRepMenNer = offsetRepMen;\n//\t\t\t\t\t\t\tSystem.out.println(\"DEFAULT2\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//no NER:\n\t\t\t\t\t\t//Pronoun -> repMen is repMenNer\n\t\t\t\t\t\telse if (hds.PronominalSubject.contains(offsetCorefMention) && repMen != null){\n\t\t\t\t\t\t\trepMenNer = repMen;\n\t\t\t\t\t\t\toffsetRepMenNer = offsetRepMen;\n//\t\t\t\t\t\t\tSystem.out.println(\"DEFAULT3\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t//other no NER: corefMention is repMenNer because it is closer to original\n\t\t\t\t\t\trepMenNer = corefMention;\n\t\t\t\t\t\toffsetRepMenNer = offsetCorefMention;\n//\t\t\t\t\t\tSystem.out.println(\"DEFAULT4\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t \n \t IaiCorefAnnotation corefAnnotation = new IaiCorefAnnotation(aJCas);\n\t\t\t\n\t\t\t\t\t\n\n\n\t\t\t\t\tcorefAnnotation.setBegin(beginCoref);\n\t\t\t\t\tcorefAnnotation.setEnd(endCoref);\n\t\t\t\t\tcorefAnnotation.setCorefMention(corefMention);\n\t\t\t\t\tcorefAnnotation.setCorefChain(chain);\n\t\t\t\t\t//done below\n//\t\t\t\t\tcorefAnnotation.setRepresentativeMention(repMenNer);\n//\t\t\t\t\tcorefAnnotation.addToIndexes(); \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tlistCorefAnnotation.add(corefAnnotation);\n\t\t\t\t\t\n//\t\t\t\t\tdone below:\n//\t\t\t\t\t offsetToRepMen.put(offsetCorefMention, repMenNer);\n//\t\t\t\t\t RepMen.add(offsetCorefMention);\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t }//end coref mention\n//\t\t System.out.println(\"END Chain \" + chain );\n//\t\t System.out.println(listCorefAnnotation.size());\n\t\t String offsetCorefMention = null;\n\t\t for (int i = 0; i < listCorefAnnotation.size(); i++) {\n\t\t \tIaiCorefAnnotation corefAnnotation = listCorefAnnotation.get(i);\n\t\t \tcorefAnnotation.setRepresentativeMention(repMenNer);\n\t\t \tcorefAnnotation.addToIndexes();\n\t\t \toffsetCorefMention = \"\" + corefAnnotation.getBegin() + \"-\" + corefAnnotation.getEnd();\n\t\t\t\t\thds.offsetToRepMen.put(offsetCorefMention, repMenNer);\n\t\t\t\t\thds.RepMen.add(offsetCorefMention);\n\t\t\t\t\t//COREF\n//\t\t\t\t\tSystem.out.println(\"Chain \" + corefAnnotation.getCorefChain());\n//\t\t\t\t\tSystem.out.println(\"corefMention \" + corefAnnotation.getCorefMention() + offsetCorefMention);\n//\t\t\t\t\tSystem.out.println(\"repMenNer \" + repMenNer);\n\t\t }\n\t\t } //end chains\n\n\n//\t\t System.out.println(\"NOW quote finder\");\n\n\n\t\t\n\t\t///* quote finder: begin find quote relation and quotee\n\t\t// direct quotes\n\t\t\n\t\t\n\t\tString quotee_left = null;\n\t\tString quotee_right = null; \n\t\t\n\t\tString representative_quotee_left = null;\n\t\tString representative_quotee_right = null; \n\t\t\n\t\tString quote_relation_left = null;\n\t\tString quote_relation_right = null;\n\t\t\n\t\tString quoteType = null;\n\t\tint quoteeReliability = 5;\n\t\tint quoteeReliability_left = 5;\n\t\tint quoteeReliability_right = 5;\n\t\tint quotee_end = -5;\n\t\tint quotee_begin = -5;\n\t\t\n\t\tboolean quoteeBeforeQuote = false;\n\n\n\t\n\t\t\n\t\t// these are all the quotes in this document\n\t\tList<CoreMap> quotes = document.get(QuotationsAnnotation.class);\n\t\tfor (CoreMap quote : quotes) {\n\t\t\tif (quote.get(TokensAnnotation.class).size() > 5) {\n\t\t\t\tQuoteAnnotation annotation = new QuoteAnnotation(aJCas);\n\n\t\t\t\tint beginQuote = quote.get(TokensAnnotation.class).get(0)\n\t\t\t\t\t\t.beginPosition();\n\t\t\t\tint endQuote = quote.get(TokensAnnotation.class)\n\t\t\t\t\t\t.get(quote.get(TokensAnnotation.class).size() - 1)\n\t\t\t\t\t\t.endPosition();\n\t\t\t\tannotation.setBegin(beginQuote);\n\t\t\t\tannotation.setEnd(endQuote);\n\t\t\t\tannotation.addToIndexes();\n//\t\t\t}\n//\t\t}\n//\t\t\n//\t\tList<Q> newQuotes = document.get(QuotationsAnnotation.class);\t\t\n//\t\tfor (CoreMap annotation : newQuotes) {\n//\t\t\t\tif (1==1){\n//\t\t\t\tRe-initialize markup variables since they are also used for indirect quotes\n\t\t\t\tquotee_left = null;\n\t\t\t\tquotee_right = null; \n\t\t\t\t\n\t\t\t\trepresentative_quotee_left = null;\n\t\t\t\trepresentative_quotee_right = null;\n\t\t\t\t\n\t\t\t\tquote_relation_left = null;\n\t\t\t\tquote_relation_right = null;\n\t\t\t\tquoteeReliability = 5;\n\t\t\t\tquoteeReliability_left = 5;\n\t\t\t\tquoteeReliability_right = 5;\n\t\t\t\tquotee_end = -5;\n\t\t\t\tquotee_begin = -5;\n\t\t\t\tquoteType = \"direct\";\n\t\t\t\tquoteeBeforeQuote = false;\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tList<Token> directQuoteTokens = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\tToken.class, annotation);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tList<Token> followTokens = JCasUtil.selectFollowing(aJCas,\n\t\t\t\t\t\tToken.class, annotation, 1);\n\t\t\t\t\n \n//\t\t\t\tfor (Token aFollowToken: followTokens){\n//\t\t\t\t\t List<Chunk> chunks = JCasUtil.selectCovering(aJCas,\n//\t\t\t\t\tChunk.class, aFollowToken);\n \n//direct quote quotee right:\n\t\t\t\t\n\t for (Token aFollow2Token: followTokens){\n\t\t\t\t\t List<SentenceAnnotation> sentencesFollowQuote = JCasUtil.selectCovering(aJCas,\n\t\t\t\t\t\t\t SentenceAnnotation.class, aFollow2Token);\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t for (SentenceAnnotation sentenceFollowsQuote: sentencesFollowQuote){\n\t\t\t\t\t\t List<Chunk> chunks = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\tChunk.class, sentenceFollowsQuote);\n//\t\t\tSystem.out.println(\"DIRECT QUOTE RIGHT\");\n\t\t\tString[] quote_annotation_result = determine_quotee_and_quote_relation(\"RIGHT\", \n\t\t\t\t\tchunks, hds, annotation);\n\t\t\tif (quote_annotation_result.length>=4){\n\t\t\t quotee_right = quote_annotation_result[0];\n\t\t\t representative_quotee_right = quote_annotation_result[1];\n\t\t\t quote_relation_right = quote_annotation_result[2];\n\t\t\t try {\n\t\t\t\t quoteeReliability = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t quoteeReliability_right = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t //Will Throw exception!\n\t\t\t //do something! anything to handle the exception.\n\t\t\t\tquoteeReliability = -5;\n\t\t\t\tquoteeReliability_right = -5;\n\t\t\t\t}\t\t\t\t\t \n\t\t\t }\n//\t\t\tSystem.out.println(\"DIRECT QUOTE RIGHT RESULT quotee \" + quotee_right + \" representative_quotee \" + representative_quotee_right\n//\t\t\t\t\t+ \" quote_relation \" + quote_relation_right);\n\t\t \n\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\t \n }\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tList<Token> precedingTokens = JCasUtil.selectPreceding(aJCas,\n\t\t\t\t\t\tToken.class, annotation, 1);\n for (Token aPrecedingToken: precedingTokens){ \n \t\n \tif (directQuoteIntro.contains(aPrecedingToken.getLemma().getValue().toString()) \n \t\t\t|| compLemma.contains(aPrecedingToken.getLemma().getValue().toString())) {\n// \t\tSystem.out.println(\"Hello, World lemma found\" + aPrecedingToken.getLemma().getValue());\n \t\tquoteeBeforeQuote = true;\n \t}\n \t\tList <NamedEntity> namedEntities = null;\n \t\tList <Token> tokens = null;\n \t\tList<Chunk> chunks = null;\n \t\t\n\t\t\t\t List<Sentence> precedingSentences = JCasUtil.selectPreceding(aJCas,\n\t\t\t\t \t\tSentence.class, aPrecedingToken, 1);\n\t\t\t\t \n\t\t\t\t\t\tif (precedingSentences.isEmpty()){\n\t\t\t\t\t\t\tList<Sentence> firstSentence;\n\t\t\t\t \tfirstSentence = JCasUtil.selectCovering(aJCas,\n\t\t\t\t \t\tSentence.class, aPrecedingToken);\n\n\t\t\t\t \tfor (Sentence aSentence: firstSentence){\n\t\t\t\t \t\t\n\n\t\t\t\t\t\t\t\tchunks = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\t\tChunk.class, aSentence.getBegin(), aPrecedingToken.getEnd());\n\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t \t\tnamedEntities = JCasUtil.selectCovered(aJCas,\n\t \t \t\tNamedEntity.class, aSentence.getBegin(), aPrecedingToken.getEnd());\n\t\t\t\t \t\ttokens = JCasUtil.selectCovered(aJCas,\n\t\t\t\t \t\t\t\tToken.class, aSentence.getBegin(), aPrecedingToken.getEnd());\n\t\t\t\t \t\n\t\t\t\t \t}\n\t\t\t\t\t\t}\n\t\t\t\t else {\t\n\t\t\t\t \tfor (Sentence aSentence: precedingSentences){\n//\t\t\t\t \t\tSystem.out.println(\"Hello, World sentence\" + aSentence);\n\t\t\t\t \t\tchunks = JCasUtil.selectBetween(aJCas,\n\t\t\t\t \t\t\t\tChunk.class, aSentence, aPrecedingToken);\n\t\t\t\t \t\tnamedEntities = JCasUtil.selectBetween(aJCas,\n\t\t\t\t \t\t\t\tNamedEntity.class, aSentence, aPrecedingToken);\n\t\t\t\t \t\ttokens = JCasUtil.selectBetween(aJCas,\n\t\t\t\t \t\t\t\tToken.class, aSentence, aPrecedingToken);\n\t\t\t\t \t}\n\t\t\t\t }\n \t\n//\t\t\t\t \n//\t\t\t\t\t\tSystem.out.println(\"DIRECT QUOTE LEFT\");\n\t\t\t\t\t\tString[] quote_annotation_direct_left = determine_quotee_and_quote_relation(\"LEFT\", chunks,\n\t\t\t\t\t\t\t\t hds, annotation\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t );\n//\t\t\t\t\t\tSystem.out.println(\"QUOTE ANNOTATION \" + quote_annotation_direct_left.length);\t\t\n\t\tif (quote_annotation_direct_left.length>=4){\n//\t\t\tSystem.out.println(\"QUOTE ANNOTATION UPDATE \" + quote_annotation_direct_left[0] +\n//\t\t\t\t\t\" \" + quote_annotation_direct_left[1] + \" \" +\n//\t\t\t\t\tquote_annotation_direct_left[2]);\n\t\t quotee_left = quote_annotation_direct_left[0];\n\t\t representative_quotee_left = quote_annotation_direct_left[1];\n\t\t quote_relation_left = quote_annotation_direct_left[2];\n\t\t try {\n\t\t\t quoteeReliability = Integer.parseInt(quote_annotation_direct_left[3]);\n\t\t\t quoteeReliability_left = Integer.parseInt(quote_annotation_direct_left[3]);\n\t\t\t} catch (NumberFormatException e) {\n\t\t //Will Throw exception!\n\t\t //do something! anything to handle the exception.\n\t\t\tquoteeReliability = -5;\n\t\t\tquoteeReliability_left = -5;\n\t\t\t}\t\t\t\t\t \n\t\t }\n//\t\tSystem.out.println(\"DIRECT QUOTE LEFT RESULT quotee \" + quotee_left + \" representative_quotee \" + representative_quotee_left\n//\t\t\t\t+ \" quote_relation \" + quote_relation_left);\n\t\t//no subject - predicate quotee quote_relation, quote introduced with colon: \n\t\tif (quotee_left == null && quote_relation_left == null && representative_quotee_left == null \n\t\t&& directQuoteIntro.contains(aPrecedingToken.getLemma().getValue().toString())){\n//\t\t\tSystem.out.println(\"NER DIRECT QUOTE LEFT COLON\");\n\t\t\tString quoteeCandOffset = null; \n\t\t\tString quoteeCandText = null;\n\t\t if (namedEntities.size() == 1){\n \t \tfor (NamedEntity ne : namedEntities){\n// \t \t\tSystem.out.println(\"ONE NER \" + ne.getCoveredText());\n \t \t\tquoteeCandText = ne.getCoveredText();\n\t\t\t\t\tquote_relation_left = aPrecedingToken.getLemma().getValue().toString();\n\t\t\t\t\tquotee_end = ne.getEnd();\n\t\t\t\t\tquotee_begin = ne.getBegin();\n\t\t\t\t\tquoteeCandOffset = \"\" + quotee_begin + \"-\" + quotee_end;\n\t\t\t\t\tquoteeReliability = 1;\n\t\t\t\t\tquoteeReliability_left = 1;\n \t }\n \t }\n \t else if (namedEntities.size() > 1) {\n \t \tint count = 0;\n \t \tString quotee_cand = null;\n// \t \tSystem.out.println(\"Hello, World ELSE SEVERAL NER\");\n \t \tfor (NamedEntity ner : namedEntities){\n// \t \t\tSystem.out.println(\"Hello, World NER TYPE\" + ner.getValue());\n \t \t\tif (ner.getValue().equals(\"PERSON\")){\n \t \t\t\tcount = count + 1;\n \t \t\t\tquotee_cand = ner.getCoveredText();\n \t \t\t\tquotee_end = ner.getEnd();\n \t \t\t\tquotee_begin = ner.getBegin();\n \t \t\t\tquoteeCandOffset = \"\" + quotee_begin + \"-\" + quotee_end;\n \t \t\t\t\n// \t \t\t\tSystem.out.println(\"Hello, World FOUND PERSON\" + quotee_cand);\n \t \t\t}\n \t \t}\n \t \tif (count == 1){ // there is exactly one NER.PERSON\n// \t \t\tSystem.out.println(\"ONE PERSON, SEVERAL NER \" + quotee_cand);\n \t \t\t\tquoteeCandText = quotee_cand;\n\t\t\t\t\t\tquote_relation_left = aPrecedingToken.getLemma().getValue().toString();\n\t\t\t\t\t\tquoteeReliability = 3;\n\t\t\t\t\t\tquoteeReliability_left = 3;\n \t \t}\n \t }\n\t\t if(quoteeCandOffset != null && quoteeCandText != null ){\n//\t\t \t quotee_left = quoteeCandText;\n\t\t \t String result [] = determineBestRepMenSubject(\n\t\t \t\t\t quoteeCandOffset,quoteeCandOffset, quoteeCandText, hds);\n\t\t \t if (result.length>=2){\n\t\t \t\t quotee_left = result [0];\n\t\t \t\t representative_quotee_left = result [1];\n//\t\t \t System.out.println(\"RESULT2 NER quotee \" + quotee_left + \" representative_quotee \" + representative_quotee_left);\n\t\t \t }\n\t\t }\n\t\t}\n }\n\t\t\n \n\n\t\t\t\t\n\t\t\t\tif (quotee_left != null && quotee_right != null){\n//\t\t\t\t\tSystem.out.println(\"TWO QUOTEES\");\n\t\t\t\t\t\n\t\t\t\t\tif (directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\".\") \n\t\t\t\t\t\t|| \tdirectQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"!\")\n\t\t\t\t\t\t|| directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"?\")\n\t\t\t\t\t\t\t){\n//\t\t\t\t\t\tSystem.out.println(\"PUNCT \" + quotee_left + quote_relation_left + quoteeReliability_left);\n\t\t\t\t\t\tannotation.setQuotee(quotee_left);\n\t\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_left);\n\n\t\t\t\t\t}\n\t\t\t\t\telse if (directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\",\")){\n//\t\t\t\t\t\tSystem.out.println(\"COMMA \" + quotee_right + \" \" + quote_relation_right + \" \" + quoteeReliability_right);\n\t\t\t\t\t\tannotation.setQuotee(quotee_right);\n\t\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_right);\n\t\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_right);\n\t\t\t\t\t}\n\t\t\t\t\telse if (!directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\".\")\n\t\t\t\t\t\t\t&& !directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"!\")\n\t\t\t\t\t\t\t&& !directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"?\")\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t){\n//\t\t\t\t\t\tSystem.out.println(\"NO PUNCT \" + quotee_right + \" \" + quote_relation_right + \" \" + quoteeReliability_right);\n\t\t\t\t\t\tannotation.setQuotee(quotee_right);\n\t\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_right);\n\t\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_right);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n//\t\t\t\t\t\tSystem.out.println(\"UNCLEAR LEFT RIGHT \" + quotee_left + quote_relation_left + quote + quotee_right + quote_relation_right);\n\t\t\t\t\tannotation.setQuotee(\"<unclear>\");\n\t\t\t\t\tannotation.setQuoteRelation(\"<unclear>\");\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (quoteeBeforeQuote == true){\n\t\t\t\t\tannotation.setQuotee(quotee_left);\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t}\n\t\t\t\telse if (quotee_left != null){\n//\t\t\t\t\tSystem.out.println(\"QUOTEE LEFT\" + quotee_left + quote_relation_left + quoteeReliability_left);\n\t\t\t\t\tannotation.setQuotee(quotee_left);\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t}\n\t\t\t\telse if (quotee_right != null){\n//\t\t\t\t\tSystem.out.println(\"QUOTEE RIGHT FOUND\" + quotee_right + \" QUOTE RELATION \" + quote_relation_right + \":\" + quoteeReliability_right);\n\t\t\t\t\tannotation.setQuotee(quotee_right);\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_right);\n\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_right);\n\t\t\t\t}\n\t\t\t\telse if (quote_relation_left != null ){\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n//\t\t\t\t\tSystem.out.println(\"NO QUOTEE FOUND\" + quote + quote_relation_left + quote_relation_right);\n\t\t\t\t}\n\t\t\t\telse if (quote_relation_right != null){\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t}\n\t\t\t\telse if (quoteType != null){\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n//\t\t\t\t\tSystem.out.println(\"Hello, World NO QUOTEE and NO QUOTE RELATION FOUND\" + quote);\n\t\t\t\t}\n\t\t\t\tif (annotation.getRepresentativeQuoteeMention() != null){\n//\t\t\t\t\tSystem.out.println(\"NOW!!\" + annotation.getRepresentativeQuoteeMention());\n\t\t\t\t\tif (hds.dbpediaSurfaceFormToDBpediaLink.containsKey(annotation.getRepresentativeQuoteeMention())){\n\t\t\t\t\t\tannotation.setQuoteeDBpediaUri(hds.dbpediaSurfaceFormToDBpediaLink.get(annotation.getRepresentativeQuoteeMention()));\n//\t\t\t\t\t\tSystem.out.println(\"DBPRED FOUND\" + annotation.getRepresentativeQuoteeMention() + \" URI: \" + annotation.getQuoteeDBpediaUri());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} //for direct quote\n\t\t\n\t\t// annotate indirect quotes: opinion verb + 'that' ... until end of sentence: said that ...\n\n//\t\tList<CoreMap> sentences = document.get(SentencesAnnotation.class); //already instantiated above\nINDIRECTQUOTE:\t\tfor (CoreMap sentence : sentences) {\n//\t\t\tif (sentence.get(TokensAnnotation.class).size() > 5) { \n\t\t\t\tSentenceAnnotation sentenceAnn = new SentenceAnnotation(aJCas);\n\t\t\t\t\n\t\t\t\tint beginSentence = sentence.get(TokensAnnotation.class).get(0)\n\t\t\t\t\t\t.beginPosition();\n\t\t\t\tint endSentence = sentence.get(TokensAnnotation.class)\n\t\t\t\t\t\t.get(sentence.get(TokensAnnotation.class).size() - 1)\n\t\t\t\t\t\t.endPosition();\n\t\t\t\tsentenceAnn.setBegin(beginSentence);\n\t\t\t\tsentenceAnn.setEnd(endSentence);\n//\t\t\t\tsentenceAnn.addToIndexes();\n\t\t\t\t\n\t\t\t\tQuoteAnnotation indirectQuote = new QuoteAnnotation(aJCas);\n\t \tint indirectQuoteBegin = -5;\n\t\t\t\tint indirectQuoteEnd = -5;\n\t\t\t\tboolean subsequentDirectQuoteInstance = false;\n\t\t\t\t\n\t\t\t\tList<Chunk> chunksIQ = JCasUtil.selectCovered(aJCas,\n\t\t\t\tChunk.class, sentenceAnn);\n\t\t\t\tList<Chunk> chunksBeforeIndirectQuote = null;\n\t\t\t\t\n\t\t\t\tint index = 0;\nINDIRECTCHUNK:\tfor (Chunk aChunk : chunksIQ) {\n\t\t\t\t\tindex++;\n\t\t\t\t\t\n//\t\t\t\t\tSystem.out.println(\"INDIRECT QUOTE CHUNK VALUE \" + aChunk.getChunkValue().toString());\n//\t\t\t\t\tif (aChunk.getChunkValue().equals(\"SBAR\")) {\n\t\t\t\t\tif(indirectQuoteIntroChunkValue.contains(aChunk.getChunkValue())){\n//\t\t\t\t\t\tSystem.out.println(\"INDIRECT QUOTE INDEX \" + \"\" + index);\n\t\t\t\t\t\t\n\t\t\t\t\t\tList<Token> tokensSbar = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\tToken.class, aChunk);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (Token aTokenSbar : tokensSbar){\n//\t\t\t\t\t\t\tString that = \"that\";\n\t\t\t\t\t\t\tif (compLemma.contains(aTokenSbar.getLemma().getCoveredText())){\n\t\t\t\t\t\t// VP test: does that clause contain VP?\n//\t\t\t\t\t\t\t\tSystem.out.println(\"TOK1\" + aTokenSbar.getLemma().getCoveredText());\n//\t\t\t \tQuoteAnnotation indirectQuote = new QuoteAnnotation(aJCas);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t indirectQuoteBegin = aChunk.getEnd() + 1;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t chunksBeforeIndirectQuote = chunksIQ.subList(0, index-1);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//NEW\n//\t\t\t\t\t\t\t\tif (LANGUAGE == \"en\")\n\t\t\t\t\t\t\t\tList<Token> precedingSbarTokens = JCasUtil.selectPreceding(aJCas,\n\t\t\t\t\t\t\t\t\t\tToken.class, aChunk, 1);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfor (Token aPrecedingSbarToken: precedingSbarTokens){ \n//\t\t\t\t\t\t\t\t\tSystem.out.println(\"TOK2\" + aPrecedingSbarToken.getLemma().getCoveredText());\n\t\t\t\t \tif (coordLemma.contains(aPrecedingSbarToken.getLemma().getValue().toString())){\n//\t\t\t\t \t\tSystem.out.println(\"TOKK\" + aPrecedingSbarToken.getLemma().getCoveredText());\n\t\t\t\t \t\tchunksBeforeIndirectQuote = chunksIQ.subList(0, index-1);\n\t\t\t\t \t\tint k = 0;\n\t\t\t\t \tSAY:\tfor (Chunk chunkBeforeAndThat : chunksBeforeIndirectQuote){\n//\t\t\t\t \t\t\txxxx\n\t\t\t\t \t\tk++;\n\t\t\t\t \t\t\tif (chunkBeforeAndThat.getChunkValue().equals(\"VP\")){\n\t\t\t\t \t\t\t\t\n\t\t\t\t \t\t\t\tList<Token> tokensInVp = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tToken.class, chunkBeforeAndThat);\n\t\t\t\t\t\t\t\t\t\t\t\tfor (Token aTokenInVp : tokensInVp){\n//\t\t\t\t\t\t\t\t\t\t\t\t\tString and;\n//\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"TOKK\" + aTokenInVp.getLemma().getCoveredText());\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (aTokenInVp.getLemma().getValue().equals(\"say\")){\n//\t\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"SAY OLD\" + indirectQuoteBegin + \":\" + sentenceAnn.getCoveredText());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tchunksBeforeIndirectQuote = chunksIQ.subList(0, k);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tindirectQuoteBegin = chunksBeforeIndirectQuote.get(chunksBeforeIndirectQuote.size()-1).getEnd()+1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"SAY NEW\" + indirectQuoteBegin + \":\" );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak SAY;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t \t\t\t\t\n\t\t\t\t \t\t\t\t\n\t\t\t\t \t\t\t}\n\t\t\t\t \t\t\t\n\t\t\t\t \t\t\t\n\t\t\t\t \t\t}\n\t\t\t\t \t\t\n\t\t\t\t \t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tList<QuoteAnnotation> coveringDirectQuoteChunk = JCasUtil.selectCovering(aJCas,\n\t\t\t\t\t\t\t\t\t\tQuoteAnnotation.class, aChunk);\n\t\t\t\t\t\t\t\tif (coveringDirectQuoteChunk.isEmpty()){\n//\t\t\t\t\t\t\t\t indirectQuoteBegin = aChunk.getEnd() + 1;\n\t\t\t\t\t\t\t\t indirectQuote.setBegin(indirectQuoteBegin);\n//\t\t\t\t\t\t\t\t chunksBeforeIndirectQuote = chunksIQ.subList(0, index-1);\n\t\t\t\t\t\t\t\t indirectQuoteEnd = sentenceAnn.getEnd();\n\t\t\t\t\t\t\t\t indirectQuote.setEnd(indirectQuoteEnd);\n\t\t\t\t\t\t\t\t indirectQuote.addToIndexes();\n\t\t\t\t\t\t\t\t subsequentDirectQuoteInstance = false;\n//\t\t\t\t\t\t\t\t System.out.println(\"SUBSEQUENT FALSE\");\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t List<Token> followTokens = JCasUtil.selectFollowing(aJCas,\n\t\t\t\t\t\t\t\t\t\t\tToken.class, indirectQuote, 1);\n\t\t\t\t\t\t\t\t for (Token aFollow3Token: followTokens){\n\t\t\t\t\t\t\t\t\t List<QuoteAnnotation> subsequentDirectQuotes = JCasUtil.selectCovering(aJCas,\n\t\t\t\t\t\t\t\t\t\t\tQuoteAnnotation.class,aFollow3Token);\n\t\t\t\t\t\t\t\t\t if (!subsequentDirectQuotes.isEmpty()){\n\t\t\t\t\t\t\t\t\t\t for (QuoteAnnotation subsequentDirectQuote: subsequentDirectQuotes){\n\t\t\t\t\t\t\t\t\t\t\t if (subsequentDirectQuote.getRepresentativeQuoteeMention() != null\n\t\t\t\t\t\t\t\t\t\t\t\t && subsequentDirectQuote.getRepresentativeQuoteeMention().equals(\"<unclear>\")){\n//\t\t\t\t\t\t\t\t\t\t\t System.out.println(\"SUBSEQUENT FOUND\"); \n\t\t\t\t\t\t\t\t\t\t\t hds.subsequentDirectQuote = subsequentDirectQuote;\n\t\t\t\t\t\t\t\t\t\t\t subsequentDirectQuoteInstance = true;\n\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t break INDIRECTCHUNK;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\n\t\t\t\t}\n\t\t\t\t\tif (indirectQuoteBegin >= 0 && indirectQuoteEnd >= 0){\n//\t\t\t\t\t\tList<QuoteAnnotation> coveringDirectQuote = JCasUtil.selectCovering(aJCas,\n//\t\t\t\t\t\t\t\tQuoteAnnotation.class, indirectQuote);\n//\t\t\t\t\t\tif (coveringDirectQuote.isEmpty()){\n////\t\t\t\t\t\t\t\n//\t\t\t\t\t\tindirectQuote.addToIndexes();\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\telse {\n//\t\t\t\t\t\t\t//indirect quote is covered by direct quote and therefore discarded\n//\t\t\t\t\t\t\tcontinue INDIRECTQUOTE;\n//\t\t\t\t\t\t}\n\t\t\t\t\tList<QuoteAnnotation> coveredDirectQuotes = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\tQuoteAnnotation.class, indirectQuote);\n\t\t\t\t\tfor (QuoteAnnotation coveredDirectQuote : coveredDirectQuotes){\n//\t\t\t\t\t\tSystem.out.println(\"Hello, World covered direct quote\" + coveredDirectQuote.getCoveredText());\n\t\t\t\t\t\t//delete coveredDirectQuoteIndex\n\t\t\t\t\t\tcoveredDirectQuote.removeFromIndexes();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t//no indirect quote in sentence\n\t\t\t\t\t\tcontinue INDIRECTQUOTE;\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n//\t\t\t\t\t\tRe-initialize markup variables since they are also used for direct quotes\n\t\t\t\t\t\tquotee_left = null;\n\t\t\t\t\t\tquotee_right = null; \n\t\t\t\t\t\t\n\t\t\t\t\t\trepresentative_quotee_left = null;\n\t\t\t\t\t\trepresentative_quotee_right = null;\n\t\t\t\t\t\t\n\t\t\t\t\t\tquote_relation_left = null;\n\t\t\t\t\t\tquote_relation_right = null;\n\t\t\t\t\t\t\n\t\t\t\t\t\tquoteType = \"indirect\";\n\t\t\t\t\t\tquoteeReliability = 5;\n\t\t\t\t\t\tquoteeReliability_left = 5;\n\t\t\t\t\t\tquoteeReliability_right = 5;\n\t\t\t\t\t\tquotee_end = -5;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\tif (chunksBeforeIndirectQuote != null){\n//\t\t\t\t\t\t\tSystem.out.println(\"chunksBeforeIndirectQuote FOUND!! \");\n\t\t\t\t\t\t\tString[] quote_annotation_result = determine_quotee_and_quote_relation(\"LEFT\", chunksBeforeIndirectQuote,\n\t\t\t\t\t\t\t\t\t hds, indirectQuote\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t );\n\t\t\tif (quote_annotation_result.length>=4){\n\t\t\t quotee_left = quote_annotation_result[0];\n\t\t\t representative_quotee_left = quote_annotation_result[1];\n\t\t\t quote_relation_left = quote_annotation_result[2];\n//\t\t\t System.out.println(\"INDIRECT QUOTE LEFT RESULT quotee \" + quotee_left + \" representative_quotee \" + representative_quotee_left\n//\t\t\t\t\t + \" QUOTE RELATION \" + quote_relation_left);\n\t\t\t try {\n\t\t\t\t quoteeReliability = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t quoteeReliability_left = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\tquoteeReliability = -5;\n\t\t\t\tquoteeReliability_left = -5;\n\t\t\t\t}\t\t\t\t\t \n\t\t\t }\n\t\t\t\n\t\t\t}\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (quotee_left != null){\n\t\t\t\t\t\t\tindirectQuote.setQuotee(quotee_left);\n\t\t\t\t\t\t\tindirectQuote.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\t\tindirectQuote.setQuoteType(quoteType);\n\t\t\t\t\t\t\tindirectQuote.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\t\t\tindirectQuote.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//indirect quote followed by direct quote:\n\t\t\t\t\t\t\t//the quotee and quote relation of the indirect quote are copied to the direct quote \n\t\t\t\t\t\t\t//Genetic researcher Otmar Wiestler hopes that the government's strict controls on genetic research \n\t\t\t\t\t\t\t//will be relaxed with the advent of the new ethics commission. \n\t\t\t\t\t\t\t//\"For one thing the government urgently needs advice, because of course it's such an extremely \n\t\t\t\t\t\t\t//complex field. And one of the reasons Chancellor Schröder formed this new commission was without \n\t\t\t\t\t\t\t//a doubt to create his own group of advisors.\"\n\n\t\t\t\t\t\t\tif (subsequentDirectQuoteInstance == true\n\t\t\t\t\t\t\t\t&&\thds.subsequentDirectQuote.getRepresentativeQuoteeMention().equals(\"<unclear>\")\n\t\t\t\t\t\t\t\t&& \thds.subsequentDirectQuote.getQuotee().equals(\"<unclear>\")\n\t\t\t\t\t\t\t\t&& \thds.subsequentDirectQuote.getQuoteRelation().equals(\"<unclear>\")\n\t\t\t\t\t\t\t\t\t){\n//\t\t\t\t\t\t\t\tSystem.out.println(\"SUBSEQUENT UNCLEAR DIR QUOTE FOUND!!\"); \n\t\t\t\t\t\t\t\tint begin = hds.subsequentDirectQuote.getBegin();\n\t\t\t\t\t\t\t\tint end = hds.subsequentDirectQuote.getEnd();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuotee(quotee_left);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuoteType(\"direct\");\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuoteeReliability(quoteeReliability_left + 2);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.addToIndexes();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\tSystem.out.println(\"Hello, World INDIRECT QUOTE \" + quotee_left + quote_relation_left + quoteeReliability);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (quote_relation_left != null){\n\t\t\t\t\t\t\tindirectQuote.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\t\tindirectQuote.setQuoteType(quoteType);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\telse if (quoteType != null){\n\t\t\t\t\t\t\tindirectQuote.setQuoteType(quoteType);\n//\t\t\t\t\t\t\tSystem.out.println(\"Hello, World INDIRECT QUOTE NOT FOUND\" + quote_relation_left);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (indirectQuote.getRepresentativeQuoteeMention() != null){\n//\t\t\t\t\t\t\tSystem.out.println(\"NOW!!\" + indirectQuote.getRepresentativeQuoteeMention());\n\t\t\t\t\t\t\tif (hds.dbpediaSurfaceFormToDBpediaLink.containsKey(indirectQuote.getRepresentativeQuoteeMention())){\n\t\t\t\t\t\t\t\tindirectQuote.setQuoteeDBpediaUri(hds.dbpediaSurfaceFormToDBpediaLink.get(indirectQuote.getRepresentativeQuoteeMention()));\n//\t\t\t\t\t\t\t\tSystem.out.println(\"DBPEDIA \" + indirectQuote.getRepresentativeQuoteeMention() + \" URI: \" + hds.dbpediaSurfaceFormToDBpediaLink.get(indirectQuote.getRepresentativeQuoteeMention()));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t }\n//\t\t\t} //for chunk\n//\t\t\t\tsay without that\n//\t\t\t}\t\t\n\t\t} //Core map sentences indirect quotes\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "@Override\n\t\tprotected void process() throws Exception {\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing - Initializing Models...\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tGlobalVars.initialize();\n\n\t\t\t// Processing Step 1. - CoreNLP\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing CoreNLP.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tString processed_text = Filter\n\t\t\t\t\t.filterdata(GlobalVars.pipeline, text);\n\n\t\t\t// Processing Step 2. - Openie\"\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing Openie.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tStringBuilder openIEOutput = new StringBuilder();\n\t\t\tString temp = \"\";\n\t\t\tfor (String sentence : processed_text.split(\"\\\\. \")) {\n\n\t\t\t\tSeq<Instance> extractions = GlobalVars.openIE.extract(sentence);\n\n\t\t\t\tInstance[] arr = new Instance[extractions.length()];\n\t\t\t\textractions.copyToArray(arr);\n\n\t\t\t\tfor (Instance inst : arr) {\n\t\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\t\tsb.append(inst.sentence() + \"\\n\");\n\t\t\t\t\tDouble conf = inst.confidence();\n\t\t\t\t\tString stringConf = conf.toString().substring(0, 4);\n\t\t\t\t\tsb.append(stringConf).append(\" (\")\n\t\t\t\t\t\t\t.append(inst.extr().arg1().text()).append(\"; \")\n\t\t\t\t\t\t\t.append(inst.extr().rel().text()).append(\"; \");\n\n\t\t\t\t\ttemp += inst.extr().arg1().text() + \"\\n\"\n\t\t\t\t\t\t\t+ inst.extr().rel().text() + \"\\n\";\n\n\t\t\t\t\tPart[] arr2 = new Part[inst.extr().arg2s().length()];\n\t\t\t\t\tinst.extr().arg2s().copyToArray(arr2);\n\t\t\t\t\t/*\n\t\t\t\t\t * for (Part arg : arr2) { sb.append(arg.text()).append(\"\");\n\t\t\t\t\t * System.out.println(\"%\" + arg.text() + \"%\"); }\n\t\t\t\t\t */\n\t\t\t\t\tif (arr2.length != 0) {\n\t\t\t\t\t\tSystem.out.println(\"Hats: \" + arr2[0]);\n\t\t\t\t\t\ttemp += arr2[0] + \"\\n\";\n\t\t\t\t\t\tsb.append(arr2[0]);\n\t\t\t\t\t\tsb.append(\")\\n\\n\");\n\t\t\t\t\t\topenIEOutput.append(sb.toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Processing Step 3. - Rewrite\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing Rewrite.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\t// Load load = new Load();\n\t\t\t// result = load.Loadfilter(openIEOutput.toString());\n\t\t\tresult = temp;\n\t\t}", "public void run() {\n try {\r\n TransformerFactory tFactory = TransformerFactory.newInstance();\r\n // Fortify Mod: prevent external entity injection\r\n tFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);\r\n Transformer transformer = tFactory.newTransformer();\r\n transformer.setOutputProperty(\"encoding\", \"UTF-8\");\r\n transformer.setOutputProperty(\"indent\", \"yes\");\r\n transformer.transform(new DOMSource(doc), new StreamResult(\r\n pos));\r\n } catch (Exception e) {\r\n throw new RuntimeException(\r\n \"Error converting Document to InputStream. \"\r\n + e.getMessage());\r\n } finally {\r\n try {\r\n pos.close();\r\n } catch (IOException e) {\r\n\r\n }\r\n }\r\n }", "public void getParsed(String text) {\n\t\tAnnotation document = new Annotation(text);\n\n\t\t// run all Annotators on this text\n\t\tpipeline.annotate(document);\n\t\tsentences = document.get(SentencesAnnotation.class);\n\t\tsentIt = sentences.iterator();\n\t}", "protected abstract String transform(final String xmlContent, final Map<String, Object> params) throws YFormProcessorException;", "@Override\n public void unpackMarkup(Document doc, RepositioningInfo repInfo,\n RepositioningInfo ampCodingInfo) throws DocumentFormatException {\n if((doc == null)\n || (doc.getSourceUrl() == null && doc.getContent() == null)) {\n\n throw new DocumentFormatException(\n \"GATE document is null or no content found. Nothing to parse!\"); }// End\n // if\n\n // Create a status listener\n StatusListener statusListener = new StatusListener() {\n @Override\n public void statusChanged(String text) {\n // This is implemented in DocumentFormat.java and inherited here\n fireStatusChanged(text);\n }\n };\n\n // determine whether we have a GATE format document or not\n /*String content = doc.getContent().toString();\n if(content.length() > 2048) {\n content = content.substring(0, 2048);\n }*/\n boolean gateFormat = isGateFIFormat(doc);\n \n\n if(gateFormat) {\n unpackGateFormatMarkup(doc, statusListener);\n } else {\n unpackGeneralXmlMarkup(doc, repInfo, ampCodingInfo, statusListener);\n }\n }", "@Override\n public void handleSpecialChar(\n com.globalsight.ling.docproc.extractor.html.HtmlObjects.Text t)\n {\n\n }", "@Override\n public SentenceBuilder call(SentenceBuilder builder, Map<String, Object> metadata) throws\n ProcessingException {\n\n /*find all substrings matching XML Escape Entities\n in the SentenceBuilder current String*/\n Matcher m = XMLCharacterEntity.EntityPattern.matcher(builder.toString());\n\n int stringIndex = 0;\n SentenceBuilder.Editor editor = builder.edit();\n\n /*for each entity found,\n * ask the editor to replace the entity text\n * with the character it stands for,\n * obtained by asking it to the XMLCharacterEntity*/\n while (m.find()) {\n int start = m.start();\n int end = m.end();\n\n if (stringIndex < start)\n stringIndex = end;\n\n String entity = m.group();\n String c = XMLCharacterEntity.unescape(entity);\n\n if (c != null)\n editor.replace(start, end - start, c);\n }\n editor.commit();\n return builder;\n }", "private static void processPart (WorkPart part) \n\t\tthrows Exception\n\t{\n\t\tTextWrapper textWrapper = part.getPrimaryText();\n\t\tif (textWrapper == null) return;\n\t\tText primary = textWrapper.getText();\n\t\tint n = primary.getNumLines();\n\t\tTextLine[] primaryLines = primary.getLines();\n\t\tTextLine[] translationLines = new TextLine[n];\n\t\tCollection lines = pm.getLinesInWorkPart(part);\n\t\tint numTranslatedLines = 0;\n\t\tfor (Iterator it = lines.iterator(); it.hasNext(); ) {\n\t\t\tLine line = (Line)it.next();\n\t\t\tTextRange location = line.getLocation();\n\t\t\tif (location == null) continue;\n\t\t\tTextLocation start = location.getStart();\n\t\t\tif (start == null) continue;\n\t\t\tTextLocation end = location.getEnd();\n\t\t\tif (end == null) continue;\n\t\t\tint endIndex = end.getIndex();\n\t\t\tString lineTag = line.getTag();\n\t\t\tif (lineTag == null) continue;\n\t\t\tElement el = (Element)lineTagToElMap.get(lineTag);\n\t\t\tif (el == null) continue;\n\t\t\tlineTagsFound.add(lineTag);\n\t\t\tTextLine translationLine = new BuildParagraph(el, \n\t\t\t\tTextParams.ROMAN,\n\t\t\t\tTextParams.TRANSLATED_LINE_FONT_SIZE);\n\t\t\tTextLine primaryLine = primaryLines[endIndex];\n\t\t\tint primaryIndentation = primaryLine.getIndentation();\n\t\t\ttranslationLine.setIndentation(primaryIndentation +\n\t\t\t\tTextParams.TRANSLATION_INDENTATION);\n\t\t\ttranslationLines[endIndex] = translationLine;\n\t\t\tnumTranslatedLines++;\n\t\t}\n\t\tif (numTranslatedLines == 0) return;\n\t\tText translation = new Text();\n\t\ttranslation.setCollapseBlankLines(false);\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tTextLine translationLine = translationLines[i];\n\t\t\tif (translationLine == null) {\n\t\t\t\ttranslation.appendBlankLine();\n\t\t\t} else {\n\t\t\t\ttranslation.appendLine(translationLine);\n\t\t\t}\n\t\t}\n\t\ttranslation.finalize();\n\t\tpm.begin();\n\t\tTextWrapper translationWrapper = new TextWrapper(translation);\n\t\tpm.save(translationWrapper);\n\t\tpart.addTranslation(translationTag, translationWrapper);\n\t\tpm.commit();\n\t}", "private void textilizeNonBlankLine () {\n StringBuffer blockMod = new StringBuffer();\n int startPosition = 0;\n int textPosition = 0;\n leftParenPartOfURL = false;\n attributeType = 0;\n klass = new StringBuffer();\n id = new StringBuffer();\n style = new StringBuffer();\n language = new StringBuffer();\n String imageTitle = \"\";\n String imageURL = \"\";\n int endOfImageURL = -1;\n boolean doublePeriod = false;\n int periodPosition = line.indexOf (\".\");\n if (periodPosition >= 0) {\n textPosition = periodPosition + 1;\n if (textPosition < line.length()) {\n if (line.charAt (textPosition) == '.') {\n doublePeriod = true;\n textPosition++;\n }\n if (textPosition < line.length()\n && line.charAt (textPosition) == ' ') {\n textPosition++;\n textIndex = 0;\n while (textIndex < periodPosition\n && (Character.isLetterOrDigit (textChar()))) {\n blockMod.append (textChar());\n textIndex++;\n } // end while more letters and digits\n if (blockMod.toString().equals (\"p\")\n || blockMod.toString().equals (\"bq\")\n || blockMod.toString().equals (\"h1\")\n || blockMod.toString().equals (\"h2\")\n || blockMod.toString().equals (\"h3\")\n || blockMod.toString().equals (\"h4\")\n || blockMod.toString().equals (\"h5\")\n || blockMod.toString().equals (\"h6\")) {\n // look for attributes\n collectAttributes (periodPosition);\n } else {\n blockMod = new StringBuffer();\n textPosition = 0;\n }\n } // end if space follows period(s)\n } // end if not end of line following first period\n } // end if period found\n\n // Start processing at the beginning of the line\n textIndex = 0;\n\n // If we have a block modifier, then generate appropriate HTML\n if (blockMod.length() > 0) {\n lineDelete (textPosition);\n closeOpenBlockQuote();\n closeOpenBlock();\n doLists();\n if (blockMod.toString().equals (\"bq\")) {\n lineInsert (\"<blockquote><p\");\n context.blockQuoting = true;\n } else {\n lineInsert (\"<\" + blockMod.toString());\n }\n if (klass.length() > 0) {\n lineInsert (\" class=\\\"\" + klass.toString() + \"\\\"\");\n }\n lineInsert (\">\");\n if (doublePeriod) {\n context.nextBlock = blockMod.toString();\n } else {\n context.nextBlock = \"p\";\n }\n }\n\n // See if line starts with one or more list characters\n if (blockMod.length() <= 0) {\n while (textIndex < line.length()\n && (textChar() == '*'\n || textChar() == '#'\n || textChar() == ';')) {\n listChars.append (textChar());\n textIndex++;\n }\n if (listChars.length() > 0\n && (textIndex >= line.length()\n || ((! Character.isWhitespace (textChar()))\n && (textChar() != '(')))) {\n listChars = new StringBuffer();\n textIndex = 0;\n }\n int firstSpace = line.indexOf (\" \", textIndex);\n if (listChars.length() > 0) {\n collectAttributes (firstSpace);\n }\n }\n int endDelete = textIndex;\n if (endDelete < line.length()\n && Character.isWhitespace (line.charAt (endDelete))) {\n endDelete++;\n }\n\n if (listChars.length() > 0) {\n lineDelete (0, endDelete);\n }\n doLists();\n if (listChars.length() > 0\n && listChars.charAt(listChars.length() - 1) == ';') {\n lastDefChar = ';';\n } else {\n lastDefChar = ' ';\n }\n\n // See if this line contains a link alias\n if ((blockMod.length() <= 0)\n && ((line.length() - textIndex) >= 4)\n && (textChar() == '[')) {\n int rightBracketIndex = line.indexOf (\"]\", textIndex);\n if (rightBracketIndex > (textIndex + 1)) {\n linkAlias = true;\n String alias = line.substring (textIndex + 1, rightBracketIndex);\n String url = line.substring (rightBracketIndex + 1);\n lineDelete (line.length() - textIndex);\n lineInsert (\"<a alias=\\\"\" + alias + \"\\\" href=\\\"\" + url + \"\\\"> </a>\");\n }\n }\n\n // If no other instructions, use default start for a new line\n if (blockMod.length() <= 0 \n && listChars.length() <= 0\n & (! linkAlias)) {\n // This non-blank line does not start with a block modifier or a list char\n if (context.lastLineBlank) {\n if (context.nextBlock.equals (\"bq\")) {\n lineInsert (\"<p>\");\n } else {\n closeOpenBlockQuote();\n lineInsert (\"<\" + context.nextBlock + \">\");\n }\n } else {\n lineInsert (\"<br />\");\n }\n }\n\n // Now examine the rest of the line\n char last = ' ';\n char c = ' ';\n char next = ' ';\n leftParenPartOfURL = false;\n resetLineIndexArray();\n while (textIndex <= line.length()) {\n // Get current character, last character and next character\n last = c;\n if (textIndex < line.length()) {\n c = textChar();\n } else {\n c = ' ';\n }\n if ((textIndex + 1) < line.length()) {\n next = line.charAt (textIndex + 1);\n } else {\n next = ' ';\n }\n \n // ?? means a citation\n if (c == '?' && last == '?') {\n if (ix [CITATION] >= 0) {\n replaceWithHTML (CITATION, 2);\n } else {\n ix [CITATION] = textIndex - 1;\n textIndex++;\n }\n }\n else\n // __ means italics\n if (c == '_' && last == '_' && ix [QUOTE_COLON] < 0) {\n if (ix [ITALICS] >= 0) {\n replaceWithHTML (ITALICS, 2);\n } else {\n ix [ITALICS] = textIndex - 1;\n textIndex++;\n }\n }\n else\n // ** means bold\n if (c == '*' && last == '*') {\n if (ix [BOLD] >= 0) {\n replaceWithHTML (BOLD, 2);\n } else {\n ix [BOLD] = textIndex - 1;\n textIndex++;\n }\n }\n else\n // _ means emphasis\n if (c == '_' && next != '_' && ix [QUOTE_COLON] < 0) {\n if (ix [EMPHASIS] >= 0) {\n replaceWithHTML (EMPHASIS, 1);\n } else {\n ix [EMPHASIS] = textIndex;\n textIndex++;\n }\n }\n else\n // * means strong\n if (c == '*' && next != '*') {\n if (ix [STRONG] >= 0) {\n replaceWithHTML (STRONG, 1);\n } else {\n ix [STRONG] = textIndex;\n textIndex++;\n }\n }\n else\n // Exclamation points surround image urls\n if (c == '!' && Character.isLetter(next)\n && ix [QUOTE_COLON] < 0 && ix [EXCLAMATION] < 0) {\n // First exclamation point : store its location and move on\n ix [EXCLAMATION] = textIndex;\n textIndex++;\n }\n else\n // Second exclamation point\n if (c == '!'\n && ix [QUOTE_COLON] < 0 && ix [EXCLAMATION] >= 0) {\n // Second exclamation point\n imageTitle = \"\";\n endOfImageURL = textIndex;\n if (last == ')' && ix [EXCLAMATION_LEFT_PAREN] > 0) {\n ix [EXCLAMATION_RIGHT_PAREN] = textIndex - 1;\n endOfImageURL = ix [EXCLAMATION_LEFT_PAREN];\n imageTitle = line.substring\n (ix [EXCLAMATION_LEFT_PAREN] + 1, ix [EXCLAMATION_RIGHT_PAREN]);\n }\n imageURL = line.substring (ix [EXCLAMATION] + 1, endOfImageURL);\n // Delete the image url, title and parentheses,\n // but leave exclamation points for now.\n lineDelete (ix [EXCLAMATION] + 1, textIndex - ix [EXCLAMATION] - 1);\n String titleString = \"\";\n if (imageTitle.length() > 0) {\n titleString = \" title=\\\"\" + imageTitle + \"\\\" alt=\\\"\" + imageTitle + \"\\\"\";\n }\n lineInsert (ix [EXCLAMATION] + 1,\n \"<img src=\\\"\" + imageURL + \"\\\"\" + titleString + \" />\");\n if (next == ':') {\n // Second exclamation followed by a colon -- look for url for link\n ix [QUOTE_COLON] = textIndex;\n ix [LAST_QUOTE] = ix [EXCLAMATION];\n } else {\n lineDelete (ix [EXCLAMATION], 1);\n lineDelete (textIndex, 1);\n }\n ix [EXCLAMATION] = -1;\n ix [EXCLAMATION_LEFT_PAREN] = -1;\n ix [EXCLAMATION_RIGHT_PAREN] = -1;\n textIndex++;\n } // end if second exclamation point\n else\n // Parentheses within exclamation points enclose the image title\n if (c == '(' && ix [EXCLAMATION] > 0 ) {\n ix [EXCLAMATION_LEFT_PAREN] = textIndex;\n textIndex++;\n }\n else\n // Double quotation marks surround linked text\n if (c == '\"' && ix [QUOTE_COLON] < 0) {\n if (next == ':'\n && ix [LAST_QUOTE] >= 0\n && textIndex > (ix [LAST_QUOTE] + 1)) {\n ix [QUOTE_COLON] = textIndex;\n } else {\n ix [LAST_QUOTE] = textIndex;\n }\n textIndex++;\n }\n else\n // Flag a left paren inside of a url\n if (c == '(' && ix [QUOTE_COLON] > 0) {\n leftParenPartOfURL = true;\n textIndex++;\n }\n else\n // Space may indicate end of url\n if (Character.isWhitespace (c)\n && ix [QUOTE_COLON] > 0\n && ix [LAST_QUOTE] >= 0\n && textIndex > (ix [QUOTE_COLON] + 2)) {\n int endOfURL = textIndex - 1;\n // end of url is last character of url\n // do not include any trailing punctuation at end of url\n int backup = 0;\n while ((endOfURL > (ix [QUOTE_COLON] + 2))\n && (! Character.isLetterOrDigit (line.charAt(endOfURL)))\n && (! ((line.charAt(endOfURL) == ')') && (leftParenPartOfURL)))\n && (! (line.charAt(endOfURL) == '/'))) {\n endOfURL--;\n backup++;\n }\n String url = line.substring (ix [QUOTE_COLON] + 2, endOfURL + 1);\n // insert the closing anchor tag\n lineInsert (endOfURL + 1, \"</a>\");\n // Delete the quote, colon and url from the line\n lineDelete (ix [QUOTE_COLON], endOfURL + 1 - ix [QUOTE_COLON]);\n // insert the beginning of the anchor tag\n lineDelete (ix [LAST_QUOTE], 1);\n lineInsert (ix [LAST_QUOTE], \"<a href=\\\"\" + url + \"\\\">\");\n // Reset the pointers\n ix [QUOTE_COLON] = -1;\n ix [LAST_QUOTE] = -1;\n leftParenPartOfURL = false;\n // Increment the index to the next character\n if (backup > 0) {\n textIndex = textIndex - backup;\n } else {\n textIndex++;\n }\n }\n else\n // Look for start of definition\n if ((c == ':' || c == ';')\n && Character.isWhitespace(last)\n && Character.isWhitespace(next)\n && listChars.length() > 0\n && (lastDefChar == ';' || lastDefChar == ':')) {\n lineDelete (textIndex - 1, 3);\n lineInsert (closeDefinitionTag (lastDefChar)\n + openDefinitionTag (c));\n lastDefChar = c;\n }\n /* else\n // -- means an em dash\n if (c == '-' && last == '-') {\n textIndex--;\n lineDelete (2);\n lineInsert (\"&#8212;\");\n } */ else {\n textIndex++;\n }\n }// end while more characters to examine\n\n context.lastLineBlank = false;\n\n }", "public void unmarshall(Element text)\n throws UnmarshallException\n {\n if( ! isInstanceOf(text, localName, Namespaces.NS_ATOM))\n {\n throw new UnmarshallException( \"Not a \" + getQualifiedName() + \" element\" );\n }\n try\n\t {\n // get the attributes\n int attributeCount = text.getAttributeCount();\n Attribute attribute = null; \n for( int i = 0; i < attributeCount; i++ )\n {\n attribute = text.getAttribute(i);\n if( \"type\".equals(attribute.getQualifiedName()))\n {\n String value = attribute.getValue();\n if( ContentType.TEXT.toString().equals(value) )\n {\n type = ContentType.TEXT;\n }\n else if( ContentType.HTML.toString().equals(value) )\n {\n type = ContentType.HTML;\n }\n else if( ContentType.XHTML.toString().equals(value) )\n {\n type = ContentType.XHTML;\n }\n else\n {\n InfoLogger.getLogger().writeError(\"Unable to parse extract type in \" + getQualifiedName() );\n // FIXME - check error handling here\n }\n }\n }\n \n\t\t // retrieve all of the sub-elements\n\t\t int length = text.getChildCount();\n if( length > 0 )\n {\n content = unmarshallString(text);\n }\n // FIXME - the above only handles plain text content. \n\t }\n\t catch( Exception ex )\n\t {\n\t\t InfoLogger.getLogger().writeError(\"Unable to parse an element in \" + getQualifiedName() + \": \" + ex.getMessage());\n\t throw new UnmarshallException(\"Unable to parse an element in \" + getQualifiedName(), ex);\n\t }\n }", "public void parseForm()\n {\n if (mForm.gotoRoot().gotoTag(\"h:head/%1$s:model\", mDefaultPrefix).hasTag(\"%1$s:itext\", mDefaultPrefix)) {\n Log.d(Collect.LOGTAG, t + \"parsing itext form translations...\");\n parseFormTranslations(mForm.gotoRoot().gotoTag(\"h:head/%1$s:model/%1$s:itext\", mDefaultPrefix));\n } else\n Log.d(Collect.LOGTAG, t + \"no form translations to parse\"); \n \n Log.d(Collect.LOGTAG, t + \"parsing form binds...\");\n parseFormBinds(mForm.gotoRoot().gotoTag(\"h:head/%1$s:model\", mDefaultPrefix));\n \n Log.d(Collect.LOGTAG, t + \"parsing form controls...\");\n parseFormControls(mForm.gotoRoot().gotoTag(\"h:body\"));\n \n Log.d(Collect.LOGTAG, t + \"parsing form instance...\");\n parseFormInstance(mForm.gotoRoot().gotoTag(\"h:head/%1$s:model/%1$s:instance\", mDefaultPrefix).gotoChild(), \"/\" + mInstanceRoot);\n Log.d(Collect.LOGTAG, t + \"FINISHED parsing form instance\");\n }", "public String transform(String text){\n for(int i=0; i<transforms.length; i++)\n {\n if(transforms[i].contains(\"fromabbreviation\")){\n text = textTransformerAbbreviation.fromAbbreviation(text);\n }\n if(transforms[i].contains(\"toabbreviation\")){\n text = textTransformerAbbreviation.toAbbreviation(text);\n }\n if(transforms[i].contains(\"inverse\")){\n text = textTransformerInverse.inverse(text);\n }\n if(transforms[i].contains(\"upper\")){\n text = textTransformerLetterSize.upper(text);\n }\n if(transforms[i].contains(\"lower\")){\n text = textTransformerLetterSize.lower(text);\n }\n if(transforms[i].contains(\"capitalize\")) {\n text = textTransformerLetterSize.capitalize(text);\n }\n if(transforms[i].contains(\"latex\")){\n text = textTransformerLatex.toLatex(text);\n }\n if(transforms[i].contains(\"numbers\")){\n text = textTransformerNumbers.toText(text);\n }\n if(transforms[i].contains(\"repetitions\")){\n text = textTransformerRepetition.deleteRepetitions(text);\n }\n logger.debug(\"Text after \" + (i+1) + \" transform: \" + text);\n }\n\n logger.debug(\"Final form: \" + text);\n return text;\n }", "public void process (String text) {\n\t\tProperties props = new Properties();\n\t\tprops.put(\"annotators\", \"tokenize, ssplit, pos, lemma, ner, parse, dcoref\");\n\t\tStanfordCoreNLP pipeline = new StanfordCoreNLP(props);\n\t\tAnnotation document = new Annotation(text);\n\t\tpipeline.annotate(document);\n\t\tList<CoreMap> sentences = document.get(SentencesAnnotation.class);\n\t\tfor(CoreMap sentence: sentences) {\n\t\t\tsgs.add(sentence.get(CollapsedCCProcessedDependenciesAnnotation.class));\n\t\t}\n\t\tccg = document.get(CorefChainAnnotation.class);\n\t}", "TextDecoder getTextDecoder();", "public interface Text {\n\n String HELP = \"Sage 'Alexa, weiter', um die nächste Anweisung zu erhalten. \";\n String STOP = \"Lasst euch weiterhin feiern! \";\n String FALLBACK = \"Leider konnte der Herr dich nicht verstehen \";\n\n String PICOLO_START = \"Willkommen bei Picolo! Möchtest du ein neues Spiel starten? \";\n String[] ANZAHL_SPIELER = {\n \"Wie viele Spieler spielen mit?\",\n \"Nenne mir die Anzahl der teilnehmenden Spieler\",\n \"Wie viele Spieler gibt es heute?\"\n };\n String[] SPIELER_NAME_FRAGEN = {\n \"Nenne mir deinen Namen Spieler \",\n \"Bitte sage mir deinen Namen Spieler \",\n \"Sag mir bitte deinen Namen Spieler \"\n };\n String NAECHSTE_AUFGABE = \"Wollt ihr die nächste Aufgabe Wissen? \";\n String ERSTE_ANWEISUNG = \"Alles klar, Los geht´s! \";\n String WIEDERHOLEN_FEHLER = \"Das Spiel wurde noch nicht gestartet. Deswegen kann ich nichts wiederholen. Bitte starte vorher das Spiel. \";\n\n //SSML Aussprache\n\n /**TODO\n * SSML Text bearbeiten\n */\n String HELP_SSML = \"Sage 'Alexa, weiter', um die nächste Anweisung zu erhalten. \";\n String STOP_SSML = \"Lasst euch weiterhin feiern! \";\n String FALLBACK_SSML = \"Ich habe dich leider nicht verstanden. \";\n}", "private void checkTextAnnotation(MGraph g, UriRef textAnnotation, String content) {\n Iterator<Triple> selectedTextIterator = g.filter(textAnnotation,\n Properties.ENHANCER_SELECTED_TEXT, null);\n // check if the selected text is added\n assertTrue(selectedTextIterator.hasNext());\n // test if the selected text is part of the TEXT_TO_TEST\n Resource object = selectedTextIterator.next().getObject();\n assertTrue(object instanceof Literal);\n Literal selectedText = (Literal)object;\n object = null;\n assertTrue(content.indexOf(selectedText.getLexicalForm()) >= 0);\n // test if context is added\n //context not present for Zemanta\n// Iterator<Triple> selectionContextIterator = g.filter(textAnnotation,\n// Properties.ENHANCER_SELECTION_CONTEXT, null);\n// assertTrue(selectionContextIterator.hasNext());\n// // test if the selected text is part of the TEXT_TO_TEST\n// object = selectionContextIterator.next().getObject();\n// assertTrue(object instanceof Literal);\n// assertTrue(content.indexOf(((Literal)object).getLexicalForm()) >= 0);\n// object = null;\n //test start/end if present\n Iterator<Triple> startPosIterator = g.filter(textAnnotation,\n ENHANCER_START, null);\n Iterator<Triple> endPosIterator = g.filter(textAnnotation,\n ENHANCER_END, null);\n //start end is optional, but if start is present, that also end needs to be set\n if(startPosIterator.hasNext()){\n Resource resource = startPosIterator.next().getObject();\n //only a single start position is supported\n assertTrue(!startPosIterator.hasNext());\n assertTrue(resource instanceof TypedLiteral);\n TypedLiteral startPosLiteral = (TypedLiteral) resource;\n resource = null;\n int start = LiteralFactory.getInstance().createObject(Integer.class, startPosLiteral);\n startPosLiteral = null;\n //now get the end\n //end must be defined if start is present\n assertTrue(endPosIterator.hasNext());\n resource = endPosIterator.next().getObject();\n //only a single end position is supported\n assertTrue(!endPosIterator.hasNext());\n assertTrue(resource instanceof TypedLiteral);\n TypedLiteral endPosLiteral = (TypedLiteral) resource;\n resource = null;\n int end = LiteralFactory.getInstance().createObject(Integer.class, endPosLiteral);\n endPosLiteral = null;\n //check for equality of the selected text and the text on the selected position in the content\n //System.out.println(\"TA [\"+start+\"|\"+end+\"]\"+selectedText.getLexicalForm()+\"<->\"+content.substring(start,end));\n assertTrue(content.substring(start, end).equals(selectedText.getLexicalForm()));\n } else {\n //if no start position is present, there must also be no end position defined\n assertTrue(!endPosIterator.hasNext());\n }\n }", "@Test\n\tpublic void testTextToXml()\n\t{\n\t\tDocument doc = XMLUtil.createEmpty();\n\t\tText text = new Text(\"Steve Unger Smells\");\n\t\tElement element = this.parser.toXML(doc, text);\n\t\tText text2 = this.parser.fromXML(element);\n\t\t\n\t\tassertEquals(\"Steve Unger Smells\", text2.getText());\t\t\n\t}", "private void unpackGeneralXmlMarkup(Document doc, RepositioningInfo repInfo,\n RepositioningInfo ampCodingInfo, StatusListener statusListener)\n throws DocumentFormatException {\n boolean docHasContentButNoValidURL = hasContentButNoValidUrl(doc);\n\n XmlDocumentHandler xmlDocHandler = null;\n try {\n\n // Create a new Xml document handler\n xmlDocHandler =\n new XmlDocumentHandler(doc, this.markupElementsMap,\n this.element2StringMap);\n\n // Register a status listener with it\n xmlDocHandler.addStatusListener(statusListener);\n\n // set repositioning object\n xmlDocHandler.setRepositioningInfo(repInfo);\n\n // set the object with ampersand coding positions\n xmlDocHandler.setAmpCodingInfo(ampCodingInfo);\n\n // create the parser\n SAXDocumentParser newxmlParser = new SAXDocumentParser();\n\n // Set up the factory to create the appropriate type of parser\n // Fast Infoset doesn't support validating which is good as we would want\n // it off any way, but we do want it to be namesapace aware\n newxmlParser.setFeature(\"http://xml.org/sax/features/namespaces\", true);\n newxmlParser.setFeature(\"http://xml.org/sax/features/namespace-prefixes\",\n true);\n newxmlParser.setContentHandler(xmlDocHandler);\n newxmlParser.setErrorHandler(xmlDocHandler);\n newxmlParser.setDTDHandler(xmlDocHandler);\n newxmlParser.setEntityResolver(xmlDocHandler);\n\n // Parse the XML Document with the appropriate encoding\n Reader docReader = null;\n try {\n InputSource is;\n if(docHasContentButNoValidURL) {\n // no URL, so parse from string\n is = new InputSource(new StringReader(doc.getContent().toString()));\n } else if(doc instanceof TextualDocument) {\n // textual document - load with user specified encoding\n String docEncoding = ((TextualDocument)doc).getEncoding();\n // don't strip BOM on XML.\n docReader =\n new InputStreamReader(doc.getSourceUrl().openStream(),\n docEncoding);\n is = new InputSource(docReader);\n // must set system ID to allow relative URLs (e.g. to a DTD) to\n // work\n is.setSystemId(doc.getSourceUrl().toString());\n } else {\n // let the parser decide the encoding\n is = new InputSource(doc.getSourceUrl().toString());\n }\n newxmlParser.parse(is);\n } finally {\n // make sure the open streams are closed\n if(docReader != null) docReader.close();\n }\n\n ((DocumentImpl)doc).setNextAnnotationId(xmlDocHandler\n .getCustomObjectsId());\n } catch(SAXException e) {\n doc.getFeatures().put(\"parsingError\", Boolean.TRUE);\n\n Boolean bThrow =\n (Boolean)doc.getFeatures().get(\n GateConstants.THROWEX_FORMAT_PROPERTY_NAME);\n\n if(bThrow != null && bThrow.booleanValue()) {\n throw new DocumentFormatException(e);\n } else {\n Out.println(\"Warning: Document remains unparsed. \\n\"\n + \"\\n Stack Dump: \");\n e.printStackTrace(Out.getPrintWriter());\n }\n\n } catch(IOException e) {\n throw new DocumentFormatException(\"I/O exception for \"\n + doc.getSourceUrl(), e);\n } finally {\n if(xmlDocHandler != null)\n xmlDocHandler.removeStatusListener(statusListener);\n }\n }", "@Test\n\tpublic void probandoConParser() {\n\t\tString dBoxUrl = \"/home/julio/Dropbox/julio_box/educacion/maestria_explotacion_datos_uba/materias/cuat_4_text_mining/material/tp3/\";\n\t\tString modelUrl = dBoxUrl + \"NER/models/es-ner-person.bin\";\n\t\tString filesUrl = dBoxUrl + \"NER/archivoPrueba\";\n\t\tString sampleFile = filesUrl + \"/viernes-23-05-14-alan-fitzpatrick-gala-cordoba.html\";\n\t\tList<String> docs = getMyDocsFromSomewhere(filesUrl);\n\n\t\ttry {\n\t\t\t// detecting the file type\n\t\t\tBodyContentHandler handler = new BodyContentHandler();\n\t\t\tMetadata metadata = new Metadata();\n\t\t\tFileInputStream inputstream = new FileInputStream(new File(sampleFile));\n\t\t\tParseContext pcontext = new ParseContext();\n\n\t\t\t// Html parser\n\t\t\tHtmlParser htmlparser = new HtmlParser();\n\t\t\thtmlparser.parse(inputstream, handler, metadata, pcontext);\n\t\t\tSystem.out.println(\"Contents of the document:\" + handler.toString());\n\t\t\tSystem.out.println(\"Metadata of the document:\");\n\t\t\tString[] metadataNames = metadata.names();\n\n\t\t\tfor (String name : metadataNames) {\n\t\t\t\tSystem.out.println(name + \": \" + metadata.get(name));\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tAssert.fail();\n\t\t}\n\n\t}", "public static void main(String[] args) throws ParseException {\n String text;\n\n File file;\n\n /* pdfStripper = null;\n pdDoc = null;\n cosDoc = null;\n */ String parsed = parseWithTika();\n file = new File(filePath);\n try {\n /* parser = new PDFParser(new FileInputStream(file)); // update for PDFBox V 2.0\n parser.parse();\n cosDoc = parser.getDocument();\n pdfStripper = new PDFTextStripper();\n pdDoc = new PDDocument(cosDoc);\n pdDoc.getNumberOfPages();\n */ //pdfStripper.setStartPage(1);\n //pdfStripper.setEndPage(10);\n /* text = pdfStripper.getText(pdDoc);\n String resultString = text.replaceAll(\"\\\\p{C}|\\\\p{Sm}|\\\\p{Sk}|\\\\p{So}\", \" \");\n */\n\n //testDictionary();\n testOpenNlp(parsed);\n testOpenNlp(\"anas al bassit\");\n testOpenNlp(\"Anas Al Bassit\");\n testOpenNlp(\"barack obama\");\n testOpenNlp(\"Barack Obama\");\n\n\n System.out.println();\n } catch (IOException e) {\n e.printStackTrace();\n }\n// catch (ParseException e) {\n// e.printStackTrace();\n// }\n }", "@Override\n\tprotected Map<Object, Object> rawTextParse(CharSequence text) {\n\n\t\tStanfordCoreNLP pipeline = null;\n\t\ttry {\n\t\t\tpipeline = pipelines.take();\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tAnnotation document = new Annotation(text.toString());\n\t\tpipeline.annotate(document);\n\t\tMap<Object, Object> sentencesMap = new LinkedHashMap<Object, Object>();//maintain sentence order\n\t\tint id = 0;\n\t\tList<CoreMap> sentences = document.get(CoreAnnotations.SentencesAnnotation.class);\n\n\t\tfor (CoreMap sentence : sentences) {\n\t\t\tStringBuilder processedText = new StringBuilder();\n\t\t\tfor (CoreLabel token : sentence.get(CoreAnnotations.TokensAnnotation.class)) {\n\t\t\t\tString word = token.get(CoreAnnotations.TextAnnotation.class);\n\t\t\t\tString lemma = token.get(CoreAnnotations.LemmaAnnotation.class);\n\t\t\t\tString pos = token.get(CoreAnnotations.PartOfSpeechAnnotation.class);\n\t\t\t\t//todo this should really happen after parsing is done, because using lemmas might confuse the parser\n\t\t\t\tif (config().isUseLowercaseEntries()) {\n\t\t\t\t\tword = word.toLowerCase();\n\t\t\t\t\tlemma = lemma.toLowerCase();\n\t\t\t\t}\n\t\t\t\tif (config().isUseLemma()) {\n\t\t\t\t\tword = lemma;\n\t\t\t\t}\n\t\t\t\tprocessedText.append(word).append(POS_DELIMITER).append(lemma).append(POS_DELIMITER).append(pos).append(TOKEN_DELIM);\n //inserts a TOKEN_DELIM at the end too\n\t\t\t}\n\t\t\tsentencesMap.put(id, processedText.toString().trim());//remove the single trailing space\n\t\t\tid++;\n\t\t}\n\t\ttry {\n\t\t\tpipelines.put(pipeline);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn sentencesMap;\n\t}", "@Override\n \t\t\t\tpublic void modifyText(ModifyEvent e) {\n \t\t\t\t\tString result = fp.getValidator().validate(text.getText());\n \t\t\t\t\tif (result == null)\n \t\t\t\t\t\tdecorator.hide();\n \t\t\t\t\telse {\n \t\t\t\t\t\tdecorator.setDescriptionText(result);\n \t\t\t\t\t\tdecorator.show();\n \t\t\t\t\t}\n \t\t\t\t\tupdateState();\n \t\t\t\t}", "private static void processText(String line, BufferedWriter wrtr)\n\t\t\tthrows JSONException, IOException {\n\t\tJSONObject topicModel = TopicModelTemplateUtil\n\t\t\t\t.getJSONFromTemplate(line);\n\t\t// populate the WORD vector for the current topic model\n\t\tTopicModelTemplateUtil.geTopicModelFromTemplate(topicModel).forEach(\n\t\t\t\ttpm -> {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tLuceneNLPUtil.getRemovedStopAndStem(tpm.getWord(),\n\t\t\t\t\t\t\t\tLuceneNLPUtil.getDefaultEnglishStopWordList())\n\t\t\t\t\t\t\t\t.forEach(word -> {\n\t\t\t\t\t\t\t\t\tif (VOCABULARY_MAP.containsKey(word)) {\n\t\t\t\t\t\t\t\t\t\tVOCABULARY_MAP.replace(word, 1);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t// dump it to the file\n\t\tdumpTextLine(topicModel.getString(ConfigConstant.JSON_FIELD.BUSINESS_ID\n\t\t\t\t.getFieldName()), wrtr);\n\t}", "private void buildRTF() {\n\t\n}", "private void makeReplacementText() throws IOException {\n valueBuf.clear();\n Token t = new Token();\n int start = currentTokenStart + 1;\n final int end = bufStart - 1;\n try {\n for (;;) {\n\tint tok;\n\tint nextStart;\n\ttry {\n\t tok = Tokenizer.tokenizeEntityValue(buf, start, end, t);\n\t nextStart = t.getTokenEnd();\n\t}\n\tcatch (ExtensibleTokenException e) {\n\t tok = e.getTokenType();\n\t nextStart = end;\n\t}\n\thandleEntityValueToken(valueBuf, tok, start, nextStart, t);\n\tstart = nextStart;\n }\n }\n catch (PartialTokenException e) {\n currentTokenStart = end;\n fatal(\"NOT_WELL_FORMED\");\n }\n catch (InvalidTokenException e) {\n currentTokenStart = e.getOffset();\n reportInvalidToken(e);\n }\n catch (EmptyTokenException e) { }\n }", "static void parseIt() {\n try {\n long start = System.nanoTime();\n int[] modes = {DET_MODE, SUM_MODE, DOUBLES_MODE};\n String[] filePaths = {\"\\\\catalogue_products.xml\", \"\\\\products_to_categories.xml\", \"\\\\doubles.xml\"};\n HashMap<String, String[]> update = buildUpdateMap(remainderFile);\n window.putLog(\"-------------------------------------\\n\" + updateNodes(offerNodes, update) +\n \"\\nФайлы для загрузки:\");\n for (int i = 0; i < filePaths.length; i++) {\n // Define location for output file\n File outputFile = new File(workingDirectory.getParent() + filePaths[i]);\n pushDocumentToFile(outputFile, modes[i]);\n printFileInfo(outputFile);\n }\n window.putLog(\"-------------------------------------\\nВсего обработано уникальных записей: \" +\n offerNodes.size());\n long time = (System.nanoTime() - start) / 1000000;\n window.putLog(\"Завершено без ошибок за \" + time + \" мс.\");\n offerNodes = null;\n //window.workshop.setParseButtonDisabled();\n } catch (TransformerException e) {\n reportException(Thread.currentThread(),\n new RuntimeException(e.getCause() + \" (\" + e.getException() + \")\\n\\t\" + e.getMessageAndLocation()));\n } catch (ParserConfigurationException e) {\n reportException(Thread.currentThread(),\n new RuntimeException(e.getCause() + \"\\n\\t\" + e.getLocalizedMessage()));\n } catch (SAXException e) {\n reportException(Thread.currentThread(),\n new RuntimeException(\"SAXexception: \" + e.getMessage()));\n\n } catch (IOException e) {\n reportException(Thread.currentThread(),\n new RuntimeException(e.getCause() + \"\\n\\t\" + e.getMessage() + \". \" + e.getStackTrace()[0]));\n }\n }", "private void initializeAnimalIText() {\r\n\t\tiText = lang.newText(new Offset(0, 178, rowText, AnimalScript.DIRECTION_SW), \"\", \"iText\", null);\r\n\t\tiText.hide();\r\n\t}", "public void parse(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context)\n\t\tthrows IOException,SAXException,TikaException {\n\n\t\t// Get metadata\n\t\tthis.mdata = metadata;\n\n\t\t// Read in all text\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(stream));\n\t\tString line = reader.readLine();\n\t\tString text = \"\";\n\t\twhile (line != null) {\n\t\t\ttext += line;\n\t\t\tline = reader.readLine();\n\t\t}\n\t\treader.close();\n\n\t\ttry {\n\t\t\t// Get NER results from each NER toolkit.\n\t\t\tthis.openNLPEntities = this.openNLPParse(text);\t\n\t\t\tthis.coreNLPEntities = this.coreNLPParse(text);\t\n\t\t\tthis.nltkEntities = this.nltkParse(text);\n\t\t\tthis.gQMeasurements = this.gQParse(text);\n\n\t\t\t// Combine results and add to metadata.\n\t\t\tMap<String, Map<String,Integer>> combo = combineResults();\n\t\t\tString json = mapToJSON(combo);\n\t\t\tString openNLPJSON = mapToJSON(this.openNLPEntities);\n\t\t\tString coreNLPJSON = mapToJSON(this.coreNLPEntities);\n\t\t\tString nltkJSON = mapToJSON(this.nltkEntities);\n\t\t\tpushToMetadata(\"openNLP entities\", openNLPJSON);\n\t\t\tpushToMetadata(\"coreNLP entities\", coreNLPJSON);\n\t\t\tpushToMetadata(\"nltk entities\", nltkJSON);\n\t\t\tpushToMetadata(\"maxJointAgreement\",json);\n\t\t\tpushToMetadata(\"quantities\", this.gQMeasurements);\n\t\t\n\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\npublic\tvoid parseInput() {\n InputStream is = new ByteArrayInputStream(this.body.toString().getBytes());\n\t\t\n\t\t\n\t\ttry {\n\t\t\tthis.domIn = new XMLInputConversion(is);\n\t\t} catch (ParserConfigurationException | SAXException | IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tthis.rootXML = this.domIn.extractDOMContent();\n\t}", "protected void extract() {\n\t\tfor (ITSState nodeState : doc.iterNodes()) {\n\t\t\tNode node = nodeState.node;\n\t\t\tRuleResolver resolver = resolvers.get(node.getNodeName()); \n\t\t\tif (resolver != null) {\n\t\t\t\tGlobalRule rule = resolver.extractRule(attrReader, parameters, nodeState.node);\n\t\t\t\tapplyRule(resolver, rule);\n\t\t\t}\n\t\t\t\n\t\t\tif (node.getNodeName().equals(\"its:param\")) {\n\t\t\t\tString name = node.getAttributes().getNamedItem(\"name\").getNodeValue();\n\t\t\t\tString value = node.getTextContent();\n\t\t\t\tparameters.add(name, value);\n\t\t\t} else if (attrReader.dialect.isRules(node)) { \n\t\t\t\t// we have external link (xlink:href or link href)\n\t\t\t\tString external = attrReader.dialect.getExternalRules(node);\n\t\t\t\tif (external != null) {\n\t\t\t\t\textractExternalRules(external);\n\t\t\t\t}\n\t\t\t} else if (node.getNodeName().equals(\"script\")) {\n\t\t\t\t// we have embedded\n\t\t\t\tif (node.hasAttributes()) {\n\t\t\t\t\tif (node.getAttributes().getNamedItem(\"type\").getNodeValue().equals(\"application/its+xml\")) {\n\t\t\t\t\t\textractEmbeddedRules(node.getTextContent());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!nodeState.nodePath.contains(\"its:rules\")) {\n\t\t\t\t// unless we're in rules, look at local annotations\n\t\t\t\t// LOCAL\n\t\t\t\textractLocal(nodeState);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// process inheritance\n\t\tfor (ITSState nodeState : doc.iterNodes()) {\n\t\t\t// Elements: handle inheritance \n\t\t\tITSData parentData = getParentState(nodeState);\n\t\t\tif (parentData != null) {\n\t\t\t\t// inherit from parent\n\t\t\t\tITSData thisData = nodeItsData.get(nodeState.nodePath);\n\t\t\t\tif (thisData == null) {\n\t\t\t\t\tthisData = new ITSData();\n\t\t\t\t\tapplyRuleToNode(nodeState.nodePath, thisData);\n\t\t\t\t} \n\t\t\t\tthisData.inherit(parentData);\t\t\t\t\n\t\t\t}\t\n\t\t\t\t\t\t\n\t\t} \n\t\t\n\t\t\n\t}", "@Test\n public void main() throws IOException {\n currentArticle = null;\n\n for(String line: FileUtils.readLines(new File(\"D:\\\\projects\\\\вёрстка томов ИИ\\\\9 том\\\\термины.txt\"))) {\n\n Matcher matcher = compile(\"\\\\|([^\\\\|]+)\\\\|\\\\s[–\\\\-—]\\\\s(.+)\").matcher(line);\n if (matcher.find()) {\n if (currentArticle != null) {\n saveItem();\n currentArticle = null;\n }\n String term = matcher.group(1);\n String body = matcher.group(2);\n if(body.indexOf(\"см. \") != 0) {\n currentArticle = new Article(term, body);\n } /*else {\n String alias = body.replace(\"см. \", \"\").replace(\"«\", \"\").replace(\"»\", \"\").replace(\".\", \"\");\n saveAliases(alias, term);\n }*/\n } else if (currentArticle != null) {\n currentArticle.setContent(currentArticle.getContent() + \"<br/>\"+line);\n }\n }\n if (currentArticle != null) {\n saveItem();\n }\n }", "@Test\n\tpublic void testTextFromXml()\n\t{\n\t\tString xml = \"<text val=\\\"Steve Unger Smells\\\" />\";\t\t\n\t\tDocument doc = XMLUtil.parse(xml);\n\t\tElement element = doc.getDocumentElement();\n\t\tText text = this.parser.fromXML(element);\n\t\t\n\t\tassertEquals(\"Steve Unger Smells\",text.getText());\n\t}", "public void deliverRawText(String text) {\n \n }", "private void convertTextBoxes(XWPFParagraph paragraph) {\n XmlCursor cursor = paragraph.getCTP().newCursor();\n cursor.selectPath(\"declare namespace w='http://schemas.openxmlformats.org/wordprocessingml/2006/main' .//*/w:txbxContent/w:p/w:r\");\n\n List<XmlObject> ctrsintxtbx = new ArrayList<>();\n\n while (cursor.hasNextSelection()) {\n cursor.toNextSelection();\n XmlObject obj = cursor.getObject();\n ctrsintxtbx.add(obj);\n }\n for (XmlObject xmlObject : ctrsintxtbx) {\n CTR ctr = null;\n try {\n ctr = CTR.Factory.parse(xmlObject.toString());\n XWPFRun textBoxRun = new XWPFRun(ctr, paragraph);\n// textBoxRun.getText(0);\n String fontFamily = getFontFamily(textBoxRun);\n String[] convertedText = engine.toUnicode(textBoxRun.getText(0), fontFamily);\n String sConvertedText = convertedText[0];\n textBoxRun.setText(sConvertedText, 0);\n// System.out.println(sConvertedText);\n logger.info(\"Text of textbox : \" + textBoxRun.getText(0));\n this.setFontFamily(textBoxRun, convertedText[1]);\n\n xmlObject.set(textBoxRun.getCTR());\n } catch (XmlException e) {\n e.printStackTrace();\n }\n\n }\n }", "private void handleTextHtml(MimePart container, String htmlPartValue) throws MessagingException {\n // container could be MimeBodyPart or MimeMessage\n\n boolean doTransform = false; //?? revisit later\n if (doTransform) {\n htmlPartValue = EmailUtil.transformToTextHtml(\n htmlPartValue,\n this.mDefaultCharset);\n }\n\n if (this.mEmbedImagesInHtml) {\n this.handleMultipartRelated(container, htmlPartValue);\n } else {\n container.setText(htmlPartValue, this.mDefaultCharset, \"html\");\n }\n return;\n }", "public ArrayList<String> makeSentences(String text) {\n \t\t/*\n \t\t * Quick check so we're not trying to split up an empty\n \t\t * String. This only happens right before the user types\n \t\t * at the end of a document and we don't have anything to\n \t\t * split, so return.\n \t\t */\n \t\tif (text.equals(\"\")) {\n \t\t\tArrayList<String> sents = new ArrayList<String>();\n \t\t\tsents.add(\"\");\n \t\t\treturn sents;\n \t\t}\n \t\t\n \t\t/**\n \t\t * Because the eosTracker isn't initialized until the TaggedDocument is,\n \t\t * it won't be ready until near the end of DocumentProcessor, in which\n \t\t * case we want to set it to the correct\n \t\t */\n \t\tthis.eosTracker = main.editorDriver.taggedDoc.eosTracker;\n \t\tthis.editorDriver = main.editorDriver;\n \t\t\n \t\tArrayList<String> sents = new ArrayList<String>(ANONConstants.EXPECTED_NUM_OF_SENTENCES);\n \t\tArrayList<String> finalSents = new ArrayList<String>(ANONConstants.EXPECTED_NUM_OF_SENTENCES);\n \t\tboolean mergeNext = false;\n \t\tboolean mergeWithLast = false;\n \t\tboolean forceNoMerge = false;\n \t\tint currentStart = 1;\n \t\tint currentStop = 0;\n \t\tString temp;\n \n \t\t/**\n \t\t * replace unicode format characters that will ruin the regular\n \t\t * expressions (because non-printable characters in the document still\n \t\t * take up indices, but you won't know they're there untill you\n \t\t * \"arrow\" though the document and have to hit the same arrow twice to\n \t\t * move past a certain point. Note that we must use \"Cf\" rather than\n \t\t * \"C\". If we use \"C\" or \"Cc\" (which includes control characters), we\n \t\t * remove our newline characters and this screws up the document. \"Cf\"\n \t\t * is \"other, format\". \"Cc\" is \"other, control\". Using \"C\" will match\n \t\t * both of them.\n \t\t */\n \t\ttext = text.replaceAll(\"\\u201C\",\"\\\"\");\n \t\ttext = text.replaceAll(\"\\u201D\",\"\\\"\");\n \t\ttext = text.replaceAll(\"\\\\p{Cf}\",\"\");\n \n \t\tint lenText = text.length();\n \t\tint index = 0;\n \t\tint buffer = editorDriver.sentIndices[0];\n \t\tString safeString = \"\";\n \t\tMatcher abbreviationFinder = ABBREVIATIONS_PATTERN.matcher(text);\n \t\t\n \t\t//================ SEARCHING FOR ABBREVIATIONS ================\n \t\twhile (index < lenText-1 && abbreviationFinder.find(index)) {\n \t\t\tindex = abbreviationFinder.start();\n \t\t\t\n \t\t\ttry {\n \t\t\t\tint abbrevLength = index;\n \t\t\t\twhile (text.charAt(abbrevLength) != ' ') {\n \t\t\t\t\tabbrevLength--;\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif (ABBREVIATIONS.contains(text.substring(abbrevLength+1, index+1))) {\n \t\t\t\t\teosTracker.setIgnore(index+buffer, true);\n \t\t\t\t}\n \t\t\t} catch (Exception e) {}\n \t\t\t\n \t\t\tindex++;\n \t\t}\t\t\n \t\t\n \t\tMatcher sent = EOS_chars.matcher(text);\n \t\tboolean foundEOS = sent.find(currentStart); // xxx TODO xxx take this EOS character, and if not in quotes, swap it for a permanent replacement, and create and add an EOS to the calling TaggedDocument's eosTracker.\n \t\t\n \t\t/*\n \t\t * We want to check and make sure that the EOS character (if one was found) is not supposed to be ignored. If it is, we will act like we did not\n \t\t * find it. If there are multiple sentences with multiple EOS characters passed it will go through each to check, foundEOS will only be true if\n \t\t * an EOS exists in \"text\" that would normally be an EOS character and is not set to be ignored.\n \t\t */\n \t\t\n \t\tindex = 0;\n \t\tif (foundEOS) {\t\n \t\t\ttry {\n \t\t\t\twhile (index < lenText-1 && sent.find(index)) {\n \t\t\t\t\tindex = sent.start();\n \t\t\t\t\tif (!eosTracker.sentenceEndAtIndex(index+buffer)) {\n \t\t\t\t\t\tfoundEOS = false;\n \t\t\t\t\t} else {\n \t\t\t\t\t\tfoundEOS = true;\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t\tindex++;\n \t\t\t\t}\n \t\t\t} catch (IllegalStateException e) {}\n \t\t}\n \t\t//We need to reset the Matcher for the code below\n \t\tsent = EOS_chars.matcher(text);\n \t\tsent.find(currentStart);\n \t\t\n \t\tMatcher sentEnd;\n \t\tMatcher citationFinder;\n \t\tboolean hasCitation = false;\n \t\tint charNum = 0;\n \t\tint lenTemp = 0;\n \t\tint lastQuoteAt = 0;\n \t\tint lastParenAt = 0;\n \t\tboolean foundQuote = false;\n \t\tboolean foundParentheses = false;\n \t\tboolean isSentence;\n \t\tboolean foundAtLeastOneEOS = foundEOS;\n \t\t\n \t\t/**\n \t\t * Needed otherwise when the user has text like below:\n \t\t * \t\tThis is my sentence one. This is \"My sentence?\" two. This is the last sentence.\n \t\t * and they begin to delete the EOS character as such:\n \t\t * \t\tThis is my sentence one. This is \"My sentence?\" two This is the last sentence.\n \t\t * Everything gets screwed up. This is because the operations below operate as expected only when there actually is an EOS character\n \t\t * at the end of the text, it expects it there in order to function properly. Now usually if there is no EOS character at the end it wouldn't\n \t\t * matter since the while loop and !foundAtLeastOneEOS conditional are executed properly, BUT as you can see the quotes, or more notably the EOS character inside\n \t\t * the quotes, triggers this initial test and thus the operation breaks. This is here just to make sure that does not happen.\n \t\t */\n \t\tString trimmedText = text.trim();\n \t\tint trimmedTextLength = trimmedText.length();\n \n \t\t//We want to make sure that if there is an EOS character at the end that it is not supposed to be ignored\n \t\tboolean EOSAtSentenceEnd = true;\n \t\tif (trimmedTextLength != 0) {\n \t\t\tEOSAtSentenceEnd = EOS.contains(trimmedText.substring(trimmedTextLength-1, trimmedTextLength)) && eosTracker.sentenceEndAtIndex(editorDriver.sentIndices[1]-1);\n \t\t} else {\n \t\t\tEOSAtSentenceEnd = false;\n \t\t}\n \t\t\n \t\t//Needed so that if we are deleting abbreviations like \"Ph.D.\" this is not triggered.\n \t\tif (!EOSAtSentenceEnd && (editorDriver.taggedDoc.watchForEOS == -1))\n \t\t\tEOSAtSentenceEnd = true;\n \n \t\twhile (foundEOS == true) {\n \t\t\tcurrentStop = sent.end();\n \t\t\t\n \t\t\t//We want to make sure currentStop skips over ignored EOS characters and stops only when we hit a true EOS character\n \t\t\ttry {\n \t\t\t\twhile (!eosTracker.sentenceEndAtIndex(currentStop+buffer-1) && currentStop != lenText) {\n \t\t\t\t\tsent.find(currentStop+1);\n \t\t\t\t\tcurrentStop = sent.end();\n \t\t\t\t}\n \t\t\t} catch (Exception e) {}\n \n \t\t\ttemp = text.substring(currentStart-1,currentStop);\n \t\t\tlenTemp = temp.length();\n \t\t\tlastQuoteAt = 0;\n \t\t\tlastParenAt = 0;\n \t\t\tfoundQuote = false;\n \t\t\tfoundParentheses = false;\n \t\t\t\n \t\t\tfor(charNum = 0; charNum < lenTemp; charNum++){\n \t\t\t\tif (temp.charAt(charNum) == '\\\"') {\n \t\t\t\t\tlastQuoteAt = charNum;\n \t\t\t\t\t\n \t\t\t\t\tif (foundQuote == true)\n \t\t\t\t\t\tfoundQuote = false;\n \t\t\t\t\telse\n \t\t\t\t\t\tfoundQuote = true;\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif (temp.charAt(charNum) == '(') {\n \t\t\t\t\tlastParenAt = charNum;\n \t\t\t\t\t\n \t\t\t\t\tif (foundParentheses)\n \t\t\t\t\t\tfoundParentheses = false;\n \t\t\t\t\telse\n \t\t\t\t\t\tfoundParentheses = true;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tif (foundQuote == true && ((temp.indexOf(\"\\\"\",lastQuoteAt+1)) == -1)) { // then we found an EOS character that shouldn't split a sentence because it's within an open quote.\n \t\t\t\tif ((currentStop = text.indexOf(\"\\\"\",currentStart +lastQuoteAt+1)) == -1) {\n \t\t\t\t\tcurrentStop = text.length(); // if we can't find a closing quote in the rest of the input text, then we assume the author forgot to put a closing quote, and act like it's at the end of the input text.\n \t\t\t\t}\n \t\t\t\telse{\n \t\t\t\t\tcurrentStop +=1;\n \t\t\t\t\tmergeNext=true;// the EOS character we are looking for is not in this section of text (section being defined as a substring of 'text' between two EOS characters.)\n \t\t\t\t}\n \t\t\t}\n \t\t\tsafeString = text.substring(currentStart-1,currentStop);\n \t\t\t\n \t\t\tif (foundParentheses && ((temp.indexOf(\")\", lastParenAt+1)) == -1)) {\n \t\t\t\tif ((currentStop = text.indexOf(\")\", currentStart + lastParenAt + 1)) == -1)\n \t\t\t\t\tcurrentStop = text.length();\n \t\t\t\telse {\n \t\t\t\t\tcurrentStop += 1;\n \t\t\t\t\tmergeNext = true;\n \t\t\t\t}\n \t\t\t}\n \t\t\tsafeString = text.substring(currentStart-1,currentStop);\n \n \t\t\tif (foundQuote) {\n \t\t\t\tsentEnd = SENTENCE_QUOTE.matcher(text);\t\n \t\t\t\tisSentence = sentEnd.find(currentStop-2); // -2 so that we match the EOS character before the quotes (not -1 because currentStop is one greater than the last index of the string -- due to the way substring works, which is includes the first index, and excludes the end index: [start,end).)\n \n \t\t\t\tif (isSentence == true) { // If it seems that the text looks like this: He said, \"Hello.\" Then she said, \"Hi.\" \n \t\t\t\t\t// Then we want to split this up into two sentences (it's possible to have a sentence like this: He said, \"Hello.\")\n \t\t\t\t\tcurrentStop = text.indexOf(\"\\\"\",sentEnd.start())+1;\n \t\t\t\t\tsafeString = text.substring(currentStart-1,currentStop);\n \t\t\t\t\tforceNoMerge = true;\n \t\t\t\t\tmergeNext = false;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tif (foundParentheses) {\n \t\t\t\tsentEnd = SENTENCE_PARENTHESES.matcher(text);\n \t\t\t\tisSentence = sentEnd.find(currentStop-2);\n \t\t\t\t\n \t\t\t\tif (isSentence == true) {\n \t\t\t\t\tcurrentStop = text.indexOf(\")\", sentEnd.start()) + 1;\n \t\t\t\t\tsafeString = text.substring(currentStart-1, currentStop);\n \t\t\t\t\tforceNoMerge = true;\n \t\t\t\t\tmergeNext = false;\n \t\t\t\t}\n \t\t\t}\n \n \t\t\t// now check to see if there is a CITATION after the sentence (doesn't just apply to quotes due to paraphrasing)\n \t\t\t// The rule -- at least as of now -- is if after the EOS mark there is a set of parenthesis containing either one word (name) or a name and numbers (name 123) || (123 name) || (123-456 name) || (name 123-456) || etc..\n \t\t\tcitationFinder = CITATION.matcher(text.substring(currentStop));\t\n \t\t\thasCitation = citationFinder.find(); // -2 so that we match the EOS character before the quotes (not -1 because currentStop is one greater than the last index of the string -- due to the way substring works, which is includes the first index, and excludes the end index: [start,end).)\n \t\t\t\n \t\t\tif (hasCitation == true) { // If it seems that the text looks like this: He said, \"Hello.\" Then she said, \"Hi.\" \n \t\t\t\t// Then we want to split this up into two sentences (it's possible to have a sentence like this: He said, \"Hello.\")\n \t\t\t\tcurrentStop = text.indexOf(\")\",citationFinder.start()+currentStop)+1;\n \t\t\t\tsafeString = text.substring(currentStart-1,currentStop);\n \t\t\t\tmergeNext = false;\n \t\t\t}\t\n \t\t\t\n \t\t\tif (mergeWithLast) {\n \t\t\t\tmergeWithLast=false;\n \t\t\t\tString prev=sents.remove(sents.size()-1);\n \t\t\t\tsafeString=prev+safeString;\n \t\t\t}\n \t\t\t\n \t\t\tif (mergeNext && !forceNoMerge) {//makes the merge happen on the next pass through\n \t\t\t\tmergeNext=false;\n \t\t\t\tmergeWithLast=true;\n \t\t\t} else {\n \t\t\t\tforceNoMerge = false;\n \t\t\t\tfinalSents.add(safeString);\n \t\t\t}\n \t\t\n \t\t\tsents.add(safeString);\n \t\t\t\n \t\t\t//// xxx xxx xxx return the safeString_subbedEOS too!!!!\n \t\t\tif (currentStart < 0 || currentStop < 0) {\n \t\t\t\tLogger.logln(NAME+\"Something went really wrong making sentence tokens.\", LogOut.STDERR);\n \t\t\t\tErrorHandler.fatalProcessingError(null);\n \t\t\t}\n \n \t\t\tcurrentStart = currentStop+1;\n \t\t\tif (currentStart >= lenText) {\n \t\t\t\tfoundEOS = false;\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n \t\t\tfoundEOS = sent.find(currentStart);\n \t\t}\n \n \t\tif (!foundAtLeastOneEOS || !EOSAtSentenceEnd) {\n \t\t\tArrayList<String> wrapper = new ArrayList<String>(1);\n \t\t\twrapper.add(text);\n \t\t\treturn wrapper;\n \t\t}\n \t\t\n \t\treturn finalSents;\n \t}", "public String getPlainText();", "public static void convertTextParts(TextContainer tc) {\r\n \t\tfor (TextPart textPart : tc) {\r\n \t\t\tconvertTextPart(textPart);\r\n \t\t}\r\n \t}", "@Override\n public void onText(@NonNull final String text)\n throws ParseException {\n try {\n tagStack.peek();\n } catch (EmptyStackException exception) {\n throw new ParseException(\"Unexpected text outside tags!\",\n exception);\n }\n log.debug(\"Handling text information of the tag, tag name = {}.\",\n tagStack.peek().getName());\n switch (tagStack.peek()) {\n case NAME:\n device.setName(text);\n break;\n case DESCRIPTION:\n device.setDescription(text);\n break;\n case RATING:\n device.setRating(Double.parseDouble(text));\n break;\n case CONNECTOR:\n device.getInput().setConnector(Connector.fromValue(text));\n break;\n case ENERGY_USAGE:\n device.getInput().setEnergyUsage(text);\n break;\n case PRICE:\n device.getPrice().setValue(Double.parseDouble(text));\n break;\n case COMPANY:\n device.getManufacture().setCompany(text);\n break;\n case ORIGIN:\n device.getManufacture().setOrigin(text);\n break;\n case DATE:\n device.getManufacture().setDate(text);\n break;\n default:\n //for checkstyle.\n break;\n }\n log.debug(\"Ended tag text information handling.\");\n }", "private static String pipelineMRC(String text, boolean debugMode, boolean onlyConceptTag) {\n\t\tif (debugMode) System.out.println(\"pipelineMRC_POS_NER function \");\n\t\ttext = text.replaceAll(\"&apos;\",\"\\'\");\n\t\tif (debugMode) System.out.println(\"MetaMap extracting concepts\");\n\t\t//String MetaMapText = MetaMapHandler.getAnnotatedXMLTags(text, debugMode);\n\t\tString LocalMetaMapText = LocalMetaMapHandler.getAnnotatedXMLTags(text);\n\n\t\t//Debugging\n\t\t//System.out.println(\"----------------------------------------------------\");\n\t\t//System.out.println(MetaMapText);\n\t\t//System.out.println(LocalMetaMapText);\n\t\t//System.out.println(\"----------------------------------------------------\");\n\t\t//End of Debugging\n\n\t\tif (debugMode) System.out.println(\"MetaMap concepts extracted\");\n\n\t\tif(!onlyConceptTag) {\n\t\t\tLocalMetaMapText = \"<content><text>\" + LocalMetaMapText;\n\t\t\tLocalMetaMapText = LocalMetaMapText.replaceAll(Pattern.quote(\"<concept\"), \"</text><concept\");\n\t\t\tLocalMetaMapText = LocalMetaMapText.replaceAll(Pattern.quote(\"</concept>\"), \"</concept><text>\");\n\t\t\tLocalMetaMapText = LocalMetaMapText + \"</text></content>\";\n\t\t}\n\n\t\treturn LocalMetaMapText;\n\t}", "public interface Text extends TextualElement {\r\n\r\n}", "public void run() {\n \n if (Parameter != null && Parameter instanceof ConvertTextUnitsParameter) {\n CastParameter = (ConvertTextUnitsParameter)Parameter;\n }\n else {\n CastParameter = null;\n }\n\n String shortErrorMessage = \"Error: Text Units Cannot be Converted!\";\n this.acceptTask(TaskProgress.INDETERMINATE, \"Initial Preparations\");\n this.validateParameter(Parameter, shortErrorMessage);\n this.openDiasdemCollection(CastParameter.getCollectionFileName());\n this.checkPrerequisitesAndSetDefaultTextUnitsLayer(shortErrorMessage);\n \n if (CastParameter.getConversionType() == ConvertTextUnitsParameter\n .APPLY_REGULAR_EXPRESSION_TO_TEXT_UNITS) {\n RegexPattern = Pattern.compile(CastParameter.getRegularExpression());\n }\n \n if (CastParameter.getConversionType() == ConvertTextUnitsParameter\n .IDENTIFY_SPECIFIED_MULTI_TOKEN_TERMS) {\n // read multi token word: each line contains one multi token word;\n // comment lines start with '#'\n TextFile multiTokenFile = new TextFile(\n new File(CastParameter.getMultiTokenFileName()));\n multiTokenFile.open();\n String line = multiTokenFile.getFirstLineButIgnoreCommentsAndEmptyLines();\n ArrayList list = new ArrayList();\n while (line != null) {\n list.add(line.trim());\n line = multiTokenFile.getNextLineButIgnoreCommentsAndEmptyLines();\n }\n // sort multi token terms by decreasing length\n Collections.sort(list, new SortStringsByDecreasingLength());\n // for (int i = 0; i < list.size(); i++) {\n // System.out.println((String)list.get(i));\n // }\n // System.out.println(list.size());\n String[] multiToken = new String[list.size()];\n for (int i = 0; i < list.size(); i++)\n multiToken[i] = (String)list.get(i);\n multiTokenFile.close();\n MyMultiTokenWordIdentifier = new HeuristicMultiTokenWordIdentifier(\n multiToken);\n }\n else {\n MyMultiTokenWordIdentifier = null;\n }\n \n if (CastParameter.getConversionType() == ConvertTextUnitsParameter\n .FIND_AND_REPLACE_SPECIFIED_TOKENS) {\n // read token replacement file: each line contains the tokens to search \n // for and the replacement tokens separated by a tab stop;\n // comment lines start with '#'\n TextFile tokenReplacementFile = new TextFile(\n new File(CastParameter.getTokenReplacementFileName()));\n tokenReplacementFile.open();\n String line = tokenReplacementFile.getFirstLineButIgnoreCommentsAndEmptyLines();\n HashMap tokensSearchList = new HashMap();\n String[] tokensContents = null;\n while (line != null) {\n tokensContents = line.split(\"\\t\");\n if (tokensContents.length == 2\n && tokensContents[1].trim().length() > 0) {\n try {\n tokensSearchList.put(tokensContents[0].trim(), \n tokensContents[1].trim());\n }\n catch (PatternSyntaxException e) {\n System.out.println(\"[TokenizeTextUnitsTask] Regex syntax error in \"\n + \" file \" + CastParameter.getTokenReplacementFileName() + \": \"\n + \" Line \\\"\" + line + \"\\\"; error message: \" + e.getMessage());\n }\n }\n else {\n System.out.println(\"[TokenizeTextUnitsTask] Error in file \"\n + CastParameter.getTokenReplacementFileName() + \": Line \\\"\"\n + line + \"\\\" does not conform to syntax!\");\n }\n line = tokenReplacementFile.getNextLineButIgnoreCommentsAndEmptyLines();\n }\n // sort multi token terms by decreasing length\n ArrayList list = new ArrayList(tokensSearchList.keySet());\n Collections.sort(list, new SortStringsByDecreasingLength());\n // create arrays for token replacement \n String[] tokensSearch = new String[list.size()];\n String[] tokensReplace = new String[list.size()];\n Iterator iterator = list.iterator();\n int i = 0;\n while (iterator.hasNext()) {\n TmpString = (String)iterator.next();\n tokensSearch[i] = TmpString;\n tokensReplace[i++] = (String)tokensSearchList.get(TmpString);\n }\n tokenReplacementFile.close();\n MyTokenReplacer = new HeuristicTokenReplacer(tokensSearch, tokensReplace);\n }\n else {\n MyTokenReplacer = null;\n }\n \n int counterProgress = 0;\n long maxProgress = DiasdemCollection.getNumberOfDocuments();\n \n DiasdemDocument = DiasdemCollection.getFirstDocument(); \n while (DiasdemDocument != null) {\n \n if (counterProgress == 1 || (counterProgress % 50) == 0) {\n Progress.update( (int)(counterProgress * 100 / maxProgress),\n \"Processing Document \" + counterProgress);\n DiasdemServer.setTaskProgress(Progress, TaskThread);\n }\n\n DiasdemDocument.setActiveTextUnitsLayer(DiasdemProject\n .getActiveTextUnitsLayerIndex());\n DiasdemDocument.backupProcessedTextUnits(DiasdemProject\n .getProcessedTextUnitsRollbackOption());\n \n for (int i = 0; i < DiasdemDocument.getNumberOfProcessedTextUnits(); \n i++) {\n DiasdemTextUnit = DiasdemDocument.getProcessedTextUnit(i);\n switch (CastParameter.getConversionType()) {\n case ConvertTextUnitsParameter.CONVERT_TEXT_UNITS_TO_LOWER_CASE: {\n TextUnitContentsAsString = DiasdemTextUnit.getContentsAsString()\n .toLowerCase();\n break;\n }\n case ConvertTextUnitsParameter.CONVERT_TEXT_UNITS_TO_UPPER_CASE: {\n TextUnitContentsAsString = DiasdemTextUnit.getContentsAsString()\n .toUpperCase();\n break;\n } \n case ConvertTextUnitsParameter.APPLY_REGULAR_EXPRESSION_TO_TEXT_UNITS: {\n RegexMatcher = RegexPattern.matcher(DiasdemTextUnit\n .getContentsAsString());\n TmpStringBuffer = new StringBuffer(DiasdemTextUnit\n .getContentsAsString().length() + 10000);\n while (RegexMatcher.find()) {\n RegexMatcher.appendReplacement(TmpStringBuffer,\n CastParameter.getReplacementString());\n }\n TextUnitContentsAsString = RegexMatcher.appendTail(TmpStringBuffer)\n .toString();\n break;\n }\n case ConvertTextUnitsParameter.IDENTIFY_SPECIFIED_MULTI_TOKEN_TERMS: {\n TextUnitContentsAsString = MyMultiTokenWordIdentifier\n .identifyMultiTokenWords(DiasdemTextUnit.getContentsAsString());\n break;\n } \n case ConvertTextUnitsParameter.FIND_AND_REPLACE_SPECIFIED_TOKENS: {\n TextUnitContentsAsString = MyTokenReplacer\n .replaceTokens(DiasdemTextUnit.getContentsAsString());\n break;\n } \n case ConvertTextUnitsParameter.REMOVE_PART_OF_SPEECH_TAGS_FROM_TOKENS: {\n TextUnitContentsAsString = this.removeTagsFromTokens(\n DiasdemTextUnit.getContentsAsString(), \"/p:\");\n break;\n } \n case ConvertTextUnitsParameter.REMOVE_WORD_SENSE_TAGS_FROM_TOKENS: {\n TextUnitContentsAsString = this.removeTagsFromTokens(\n DiasdemTextUnit.getContentsAsString(), \"/s:\");\n break;\n } \n default: {\n TextUnitContentsAsString = DiasdemTextUnit.getContentsAsString();\n }\n }\n DiasdemTextUnit.setContentsFromString(TextUnitContentsAsString);\n DiasdemDocument.replaceProcessedTextUnit(i, DiasdemTextUnit);\n }\n\n DiasdemCollection.replaceDocument(DiasdemDocument\n .getDiasdemDocumentID(), DiasdemDocument);\n \n DiasdemDocument = DiasdemCollection.getNextDocument();\n counterProgress++;\n \n } // read all documents\n \n super.closeDiasdemCollection();\n \n CastResult = new ConvertTextUnitsResult(TaskResult.FINAL_RESULT,\n \"All processed text units have been converted in the DIAsDEM document\\n\" +\n \" collection \" +\n Tools.shortenFileName(CastParameter.getCollectionFileName(), 55) + \"!\", \n \"Processed text units have been converted.\");\n this.setTaskResult(100, \"All Documents Processed ...\", CastResult,\n TaskResult.FINAL_RESULT, Task.TASK_FINISHED);\n \n }", "@Override\n public void process(JCas jCas) throws AnalysisEngineProcessException {\n JCas viewJCas = jCas;\n if (!view.equals(VIEW_SYSTEM)) {\n try {\n viewJCas = jCas.getView(view);\n } catch (CASException e) {// just rethrow\n throw new AnalysisEngineProcessException(e);\n }\n }\n\n Collection<de.julielab.jules.types.Sentence> sentences = select(\n viewJCas, de.julielab.jules.types.Sentence.class);\n\n for (de.julielab.jules.types.Sentence julesSentence : sentences) {\n int sentence_start = julesSentence.getBegin();\n\n if (julesSentence.getCoveredText().length() > 0) {\n\n try {\n Sentence sentence = new Sentence(\n julesSentence.getCoveredText());\n bannerTokenizer.tokenize(sentence);\n crfTagger.tag(sentence);// error\n if (postProcessor != null)\n postProcessor.postProcess(sentence);\n\n for (Mention mention : sentence.getMentions()) {\n\n int startChar = mention.getStartChar() + sentence_start;\n int endChar = mention.getEndChar() + sentence_start;\n // LOG.debug(\"found NE:\" + mention.getText() + \" \" +\n // startChar\n // + \":\" + endChar);\n Protein prot = new Protein(viewJCas, startChar, endChar);\n prot.setName(mention.getText());\n prot.setTextualRepresentation(\"⊂PROT⊃\");\n prot.addToIndexes();\n }\n\n } catch (Throwable t) {\n // not sure why, but this happens sometimes after some time\n int docId = getHeaderIntDocId(viewJCas);\n LOG.warn(\"Banner exception at docId {}, skipping. {}\",\n docId, StringUtils.print(t));\n try {\n GarbageCollectorAnnotator.runGC();\n loadTagger(); // reload\n } catch (Exception e) {\n throw new AnalysisEngineProcessException(e);\n }\n }\n }\n }\n }", "void setTextDecoder(TextDecoder decoder);", "@Override\n public void startElement(String aUri, String aLocalName, String aName,\n Attributes aAttributes)\n throws SAXException\n {\n if (!inTextElement && TAG_TEI_DOC.equals(aName)) {\n if (useXmlId) {\n documentId = aAttributes.getValue(\"xml:id\");\n }\n else if (useFilenameId) {\n documentId = FilenameUtils.getName(currentResource.getPath()) + \"#\"\n + currentTeiElementNumber;\n }\n else {\n documentId = currentResource.getPath() + \"#\" + currentTeiElementNumber;\n }\n }\n else if (!inTextElement && TAG_TITLE.equals(aName)) {\n captureText = true;\n }\n else if (TAG_TEXT.equals(aName)) {\n captureText = true;\n inTextElement = true;\n }\n else if (inTextElement && (TAG_SUNIT.equals(aName) || \n (utterancesAsSentences && TAG_U.equals(aName)))) {\n sentenceStart = getBuffer().length();\n }\n else if (inTextElement && TAG_PARAGRAPH.equals(aName)) {\n paragraphStart = getBuffer().length();\n }\n else if (readNamedEntity && inTextElement && TAG_RS.equals(aName)) {\n NamedEntity ne = new NamedEntity(getJCas());\n ne.setBegin(getBuffer().length());\n ne.setValue(aAttributes.getValue(ATTR_TYPE));\n namedEntities.push(ne);\n }\n else if (readConstituent && inTextElement && TAG_PHRASE.equals(aName)) {\n if (constituents.isEmpty()) {\n ROOT root = new ROOT(getJCas());\n root.setConstituentType(\"ROOT\");\n constituents.push(new ConstituentWrapper(root));\n }\n \n Constituent constituent = new Constituent(getJCas());\n constituent.setConstituentType(aAttributes.getValue(ATTR_TYPE));\n constituent.setSyntacticFunction(aAttributes.getValue(ATTR_FUNCTION));\n constituents.push(new ConstituentWrapper(constituent));\n }\n else if (inTextElement\n && (TAG_WORD.equals(aName) || TAG_CHARACTER.equals(aName) || TAG_MULTIWORD\n .equals(aName))) {\n tokenStart = getBuffer().length();\n if (StringUtils.isNotEmpty(aAttributes.getValue(ATTR_POS))) {\n posTag = aAttributes.getValue(ATTR_POS);\n }\n else {\n posTag = aAttributes.getValue(ATTR_TYPE);\n }\n lemma = aAttributes.getValue(ATTR_LEMMA);\n }\n }", "public Map<String, Object> getIE(String text, FallBackListBased pd) {\n\t\ttext = text.replaceAll(\" � \", \", \");\n\t\ttext = text.replaceAll(\"'s \", \" \");\n\t\ttext = text.replaceAll(\"'s\", \"\");\n\t\ttext = text.replaceAll(\"�s \", \" \");\n\t\ttext = text.replaceAll(\"�s \", \" \");\n\t\ttext = text.replaceAll(\"\\\\?\", \"\");\n\t\ttext = text.replaceAll(\":\", \"\");\n\t\tMap<String, Object> entities_map = new TreeMap<String, Object>();\n\t\tMap<String, Object> extractedEntities = new TreeMap<String, Object>();\n\t\tList<TreeMap<String, String>> entities = new ArrayList<TreeMap<String, String>>();\n\t\tList<TreeMap<String, String>> intents= new ArrayList<TreeMap<String, String>>();\n\t\tSet<String> intentsList=new HashSet<String>();\n\t\tSet<String> entitiesList=new HashSet<String>();\n\t\t\n\t\tString input = text;\n\t\t// text=text.replaceAll(\" \", \" \");\n\t\tSpan spanSentences[] = pd.sentenceDetector.sentPosDetect(input);\n\t\tint sentenceId = 1;\n\t\tTreeMap<String, String> intents_map = new TreeMap<String, String>();\n\t\tDouble entites_highest_cofidence = 0.0;\n\t\tDouble intents_highest_cofidence = 0.0;\n\t\tfor (Span sentence : spanSentences) {\n\t\t\tArrayList<PhraseTemplate> phrases = pd.GetPhrases(sentence\n\t\t\t\t\t.getCoveredText(input).toString(), sentenceId++);\n\t\t\t\n\t\t\tfor (PhraseTemplate svo : phrases) {\n\t\t\t\tString key = svo.phrase;\n\t\t\t\tkey = key.replaceAll(\" is \", \"\");\n\t\t\t\tkey = key.replaceAll(\"What \", \"\");\n\t\t\t\tkey = key.replaceAll(\"what \", \"\");\n\t\t\t\tkey = key.replaceAll(\" the \", \"\");\n\n\t\t\t\tif (key.length() > 1) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tString resolvedEntity = lss.resolveEntity(key\n\t\t\t\t\t\t\t\t.toLowerCase().trim().toString(),\n\t\t\t\t\t\t\t\t\"entitesIndex\");\n\t\t\t\t\t\tString tokens[] = resolvedEntity.split(\"__\");\n//\t\t\t\t\t\tSystem.out.println(resolvedEntity+\" :: \"+key);\n\t\t\t\t\t\tif (tokens.length < 2)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tif (tokens[1].trim().startsWith(\"entity\")\n\t\t\t\t\t\t\t\t&& Double.parseDouble(tokens[5].trim())>0.9)\n\t\t\t\t\t\t\tentitiesList.add(tokens[5].trim());\n\t\t\t\t\t\tif (tokens[1].trim().startsWith(\"entity\")\n\t\t\t\t\t\t\t\t&& Double.parseDouble(tokens[5].trim()) > entites_highest_cofidence) {\n\t\t\t\t\t\t\tentities_map.clear();\n\t\t\t\t\t\t\tentities_map.put(\"Entity\", key.trim());\n\t\t\t\t\t\t\tentities_map.put(\"MappedEntity\", tokens[4].trim());\n\t\t\t\t\t\t\tentities_map.put(\"EntityConfidenceScore\", tokens[5].trim());\n\t\t\t\t\t\t\tentities_map.put(\"MappedEntityType\", tokens[2].trim());\n\t\t\t\t\t\t\tentites_highest_cofidence = Double\n\t\t\t\t\t\t\t\t\t.parseDouble(tokens[5].trim());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tokens[1].trim().startsWith(\"intent\")\n\t\t\t\t\t\t\t\t&& Double.parseDouble(tokens[5].trim())>0.9)\n\t\t\t\t\t\t\tintentsList.add(tokens[5].trim());\n\t\t\t\t\t\tif (tokens[1].trim().startsWith(\"intent\")\n\t\t\t\t\t\t\t\t&& Double.parseDouble(tokens[5].trim()) > intents_highest_cofidence) {\n\t\t\t\t\t\t\tintents_map.clear();\n\t\t\t\t\t\t\tintents_map.put(\"Id\", tokens[0].trim());\n\t\t\t\t\t\t\tintents_map.put(\"Extracted Entity\", key.trim());\n\t\t\t\t\t\t\tintents_map.put(\"Mapped Entity\", tokens[4].trim());\n\t\t\t\t\t\t\tintents_map.put(\"Confidence\", tokens[5].trim());\n\t\t\t\t\t\t\tintents_map.put(\"Class\", tokens[1].trim());\n\t\t\t\t\t\t\tintents_highest_cofidence = Double\n\t\t\t\t\t\t\t\t\t.parseDouble(tokens[5].trim());\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tentities_map.put(\"Intent\", intents_map.get(\"Extracted Entity\"));\n\t\tentities_map.put(\"MappedIntent\", intents_map.get(\"Mapped Entity\"));\n\t\tentities_map.put(\"IntentConfidenceScore\", intents_map.get(\"Confidence\"));\n\n\t\treturn entities_map;\n\t}", "void computeHTMLFeatures() throws Exception{\n\t\tcountTagStatistics();\n\t\thtmlGlobalTagStatistics();\n\t\ttagInHeadStatistics();\n\t\thtmlStatisticsDiv();\n\t\thtmlStaticsticsParagraphs();\n\t\thtmlKeyWords();\n\t\tnormalizeData();\n\t}", "private void debugRenderTextInfos() {\n\t\tdebugRenderEntityTextInfosList(layerNegOneEntities);\n\t\tdebugRenderEntityTextInfosList(layerZeroEntities);\n\t\tdebugRenderEntityTextInfosList(layerOneEntities);\n\t}", "public static void preprocessWikipediaInformation(LocationDataIO locationData) {\n\t\ttry {\n\t\t\tSAXParserFactory factory = SAXParserFactory.newInstance();\n\t\t\tfactory.setFeature(\"http://xml.org/sax/features/validation\", false);\n\t\t\tfactory.setFeature(\"http://apache.org/xml/features/continue-after-fatal-error\", true);\n\t\t\tfactory.setFeature(\"http://apache.org/xml/features/continue-after-fatal-error\", true);\n\t\t\tSAXParser parser = factory.newSAXParser();\n\n\t\t\tIterator<POI> iter = locationData.getPOIs().iterator();\n\t\t\twhile (iter.hasNext()) {\n\t\t\t\tPOI current = iter.next();\n\t\t\t\tif (current.getURL() != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tSystem.out.print(current.getName());\n\t\t\t\t\t\tURL url = current.getURL();\n\t\t\t\t\t\tURLConnection connection = url.openConnection();\n\t\t\t\t\t\tconnection.connect();\n\t\t\t\t\t\tInputSource input = new InputSource(connection.getInputStream());\n\t\t\t\t\t\tString lang = current.getURL().toExternalForm();\n\t\t\t\t\t\tif (lang.length() > 9 && lang.substring(7, 9).matches(\"[a-zA-Z]{2}\")) {\n\t\t\t\t\t\t\tlang = lang.substring(7, 9);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlang = \"de\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tWikipediaHandler handler = new WikipediaHandler(lang);\n\n\t\t\t\t\t\tparser.parse(input, handler);\n\t\t\t\t\t\tcurrent.setTextInfo(handler.getFirstParagraphs());\n\t\t\t\t\t\tcurrent.setURL(handler.getImageURL());\n\t\t\t\t\t\tSystem.out.print(\" ✓\\n\");\n\t\t\t\t\t} catch (SAXException e) {\n\t\t\t\t\t\tlogger.info(String.format(\"Schwerwiegender Syntaxfehler in %s! Wird ignoriert.\", current.getURL().toExternalForm()));\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tlogger.info(current.getURL().toExternalForm() + \" konnte nicht gelesen werden! Wird ignoriert.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (ParserConfigurationException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SAXNotRecognizedException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SAXNotSupportedException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SAXException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void parse() {\n stack.push(documentNode);\n try {\n Token token = lexer.nextToken();\n boolean tagOpened = false;\n\n while (token.getType() != TokenType.EOF) {\n\n if (token.getType() == TokenType.TEXT) {\n TextNode textNode = new TextNode((String) token.getValue());\n ((Node) stack.peek()).addChild(textNode);\n\n } else if (token.getType() == TokenType.TAG_OPEN) {\n if (tagOpened) {\n throw new SmartScriptParserException(\"The tag was previously open but is not yet closed.\");\n }\n tagOpened = true;\n lexer.setState(LexerState.TAG);\n\n } else if (token.getType() == TokenType.TAG_NAME && token.getValue().equals(\"=\")) {\n parseEchoTag(tagOpened);\n tagOpened = false;\n\n } else if (token.getType() == TokenType.TAG_NAME && ((String) token.getValue()).matches(\"[Ff][Oo][Rr]\")) {\n parseForTag(tagOpened);\n tagOpened = false;\n\n } else if (token.getType() == TokenType.TAG_NAME && ((String) token.getValue()).matches(\"[Ee][Nn][Dd]\")) {\n parseEndTag();\n tagOpened = false;\n } else {\n throw new SmartScriptParserException(PARSE_ERROR);\n }\n token = lexer.nextToken();\n }\n if (!(stack.peek() instanceof DocumentNode)) {\n throw new SmartScriptParserException(PARSE_ERROR);\n }\n } catch (LexerException | EmptyStackException exc) {\n throw new SmartScriptParserException(PARSE_ERROR);\n }\n}", "private void generateView(String component) {\n Matcher matcher = null;\n\n // Match <h2> tag and separate it if any\n matcher = Pattern.compile(Data.H2_REGEX_MATCHER).matcher(component);\n if (matcher.find()) {\n // h2 has been found\n h2Detected(component, matcher);\n return;\n }\n\n // Match <img> tag and separate it if any\n matcher = Pattern.compile(Data.IMG_REGEX_MATCHER).matcher(component);\n if (matcher.find()) {\n // img thas been found\n imgDetected(matcher);\n return;\n }\n\n // inflate just normal text\n createParagraphView(component);\n }", "public void convert() {\r\n if (text != null && !text.isEmpty()) {\r\n // trim spaces at the edges, convert all to lowercase and\r\n // remove all non-alpha numeric characters\r\n String url = text.trim().toLowerCase().replaceAll(\"[^a-z0-9_\\\\s-]\", \"\"); \r\n // change all multiple white spaces to single white space\r\n url = url.replaceAll(\"[\\\\s-]+\", \" \");\r\n // replace all the single white spaces with a dash\r\n seoUrl = url.replaceAll(\"[\\\\s]\", \"-\");\r\n // at this point we will save the product in the database \r\n // with SEO friendly URL appended with the product ID at the end\r\n // Let's say the product ID is 12345\r\n Long productId = 12345L;\r\n seoUrl += \"-\" + productId; \r\n System.out.println(\"SEO Friendly URL --> \" + seoUrl);\r\n } else {\r\n seoUrl = \"Please enter text to convert\";\r\n }\r\n }", "private void viterbiParse(Tree<State> tree) {\n\t\tList<State> sentence = tree.getYield();\n\t\tint nword = sentence.size();\n\t\tif (chart != null) {\n\t\t\tchart.clear(nword);\n\t\t} else {\n\t\t\tchart = new Chart(nword, false, true, false);\n\t\t} \n\t\tinferencer.viterbiParse(chart, sentence, nword);\n\t}", "public static String transformPlainText(String text) {\r\n\t\t// url auto-linking\r\n\t\ttext = text.replaceAll(\"((http|https)://[0-9A-Za-z-_=\\\\?\\\\.\\\\$#&/]*)\", \"<a href=\\\"$1\\\">$1</a>\");\r\n\t\tString html = \"<pre>\" + text + \"</pre>\";\r\n\t\treturn html;\r\n\t}", "public static String normalizeTextForTagger(String text) {\r\n \ttext = text.replaceAll(\"&amp;\", \"&\");\r\n \ttext = StringEscapeUtils.unescapeHtml4(text);\r\n \treturn text;\r\n }", "public void convertObjectToXML() throws TransformerException{\r\n\t\tDocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();\r\n\t\ttry {\r\n\t\t\tDocumentBuilder docBuilder = docFactory.newDocumentBuilder();\r\n\r\n\t\t\t// root elements\r\n\t\t\tDocument doc = docBuilder.newDocument();\r\n\t\t\tElement fileElement = doc.createElement(\"TextFile\");\r\n\t\t\tdoc.appendChild(fileElement);\r\n\r\n\t\t\t// set attribute to file element\r\n\t\t\tAttr attr = doc.createAttribute(\"filename\");\r\n\t\t\tattr.setValue(this.fileName);\r\n\t\t\tfileElement.setAttributeNode(attr);\r\n\t\t\t\r\n\t\t\t//Tagged for paragraphs,sentence,word and punctuation\r\n\r\n\t\t\tfor (Paragraph paragraph : paragraphs) { // for each paragraph\r\n\r\n\t\t\t\tElement paragraphElement = doc.createElement(paragraph.getXMLTag());\r\n\t\t\t\tfileElement.appendChild(paragraphElement);\r\n\t\t\t\t//System.out.println(\"PARAGRAPH:\"+paragraph.getSentences().size());\r\n\t\t\t\tfor (Sentence sentence : paragraph.getSentences()) { // for each sentence\r\n\t\t\t\t\tElement sentenceElement = doc.createElement(sentence.getXMLTag());\r\n\t\t\t\t\tparagraphElement.appendChild(sentenceElement);\r\n\t\t\t\t\t//System.out.println(\"Sentence:\"+sentence.getSentencesItems().size());\r\n\t\t\t\t\tfor (Items sentenceItem : sentence.getSentencesItems()) { // for each sentence item\r\n\t\t\t\t\t\tif (sentenceItem instanceof Word) {\r\n\t\t\t\t\t\t\tWord word = (Word)sentenceItem;\r\n\t\t\t\t\t\t\tElement wordElement = doc.createElement(word.getXMLTag());\r\n\t\t\t\t\t\t\twordElement.appendChild(doc.createTextNode(word.getWord()));\r\n\t\t\t\t\t\t\tsentenceElement.appendChild(wordElement); //output text for each word\r\n\t\t\t\t\t\t\t//System.out.println(\"Word:\"+word.getWord());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (sentenceItem instanceof Punctuation) {\r\n\t\t\t\t\t\t\tPunctuation punctuation = (Punctuation)sentenceItem;\r\n\t\t\t\t\t\t\tElement punctuationElement = doc.createElement(punctuation.getXMLTag());\r\n\t\t\t\t\t\t\tpunctuationElement.appendChild(doc.createTextNode(punctuation.getPunctuation()));\r\n\t\t\t\t\t\t\tsentenceElement.appendChild(punctuationElement); //output text for each punctuation\r\n\t\t\t\t\t\t\t//System.out.println(\"Punctuation:\"+punctuation.getPunctuation());\r\n\t\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\t// write the content into xml file\r\n\t\t\tTransformerFactory transformerFactory = TransformerFactory.newInstance();\r\n\t\t\tTransformer transformer = transformerFactory.newTransformer();\r\n\t\t\tDOMSource source = new DOMSource(doc);\r\n\r\n\t\t\t//System.out.println(fileName.lastIndexOf(\"/\"));\r\n\t\t\tStreamResult result = new StreamResult(new File(\"output_\"+fileName.substring(fileName.lastIndexOf(\"/\")+1, fileName.length()-4)+\".xml\"));\r\n\t\t\ttransformer.transform(source, result);\r\n\r\n\t\t\tSystem.out.println(\"File: \"+\"output_\"+fileName.substring(fileName.lastIndexOf(\"/\")+1, fileName.length()-4)+\".xml\"+\" saved!\");\r\n\r\n\t\t}\r\n\t\tcatch (ParserConfigurationException 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\t}", "public void fromXML(Element altN) {\r\n \t\tthis.fromXML = true;\r\n \t\tRationaleDB db = RationaleDB.getHandle();\r\n \r\n \t\t// add idref ***from the XML***\r\n \t\tString idref = altN.getAttribute(\"id\");\r\n \r\n \t\t// get our name\r\n \t\tname = altN.getAttribute(\"name\");\r\n \r\n \t\t// get our status\r\n \t\tstatus = AlternativeStatus.fromString(altN.getAttribute(\"status\"));\r\n \r\n \t\t// get our evaluation\r\n \t\tevaluation = Float.parseFloat(altN.getAttribute(\"evaluation\"));\r\n \r\n \t\tNode descN = altN.getFirstChild();\r\n \t\t// get the description\r\n \t\t// the text is actually the child of the element, odd...\r\n \t\tNode descT = descN.getFirstChild();\r\n \t\tif (descT instanceof Text) {\r\n \t\t\tText text = (Text) descT;\r\n \t\t\tString data = text.getData();\r\n \t\t\tsetDescription(data);\r\n \t\t}\r\n \r\n \t\t// and last....\r\n \t\tdb.addRef(idref, this); // important to use the ref from the XML file!\r\n \r\n \t\tElement child = (Element) descN.getNextSibling();\r\n \r\n \t\twhile (child != null) {\r\n \r\n \t\t\tString nextName;\r\n \r\n \t\t\tnextName = child.getNodeName();\r\n \t\t\t// here we check the type, then process\r\n \t\t\tif (nextName.compareTo(\"DR:argument\") == 0) {\r\n \t\t\t\tArgument arg = new Argument();\r\n \t\t\t\tdb.addArgument(arg);\r\n \t\t\t\taddArgument(arg);\r\n \t\t\t\targ.fromXML(child);\r\n \t\t\t} else if (nextName.compareTo(\"DR:question\") == 0) {\r\n \t\t\t\tQuestion quest = new Question();\r\n \t\t\t\tdb.addQuestion(quest);\r\n \t\t\t\taddQuestion(quest);\r\n \t\t\t\tquest.fromXML(child);\r\n \t\t\t} else if (nextName.compareTo(\"DR:decisionproblem\") == 0) {\r\n \t\t\t\tDecision dec = new Decision();\r\n \t\t\t\tdb.addDecision(dec);\r\n \t\t\t\taddSubDecision(dec);\r\n \t\t\t\tdec.fromXML(child);\r\n \t\t\t} else if (nextName.compareTo(\"DR:history\") == 0) {\r\n \t\t\t\thistoryFromXML(child);\r\n \t\t\t} else if (nextName.compareTo(\"argref\") == 0) {\r\n \t\t\t\tNode childRef = child.getFirstChild(); // now, get the text\r\n \t\t\t\t// decode the reference\r\n \t\t\t\tText refText = (Text) childRef;\r\n \t\t\t\tString stRef = refText.getData();\r\n \t\t\t\taddArgument((Argument) db.getRef(stRef));\r\n \r\n \t\t\t} else if (nextName.compareTo(\"decref\") == 0) {\r\n \t\t\t\tNode childRef = child.getFirstChild(); // now, get the text\r\n \t\t\t\t// decode the reference\r\n \t\t\t\tText refText = (Text) childRef;\r\n \t\t\t\tString stRef = refText.getData();\r\n \t\t\t\taddSubDecision((Decision) db.getRef(stRef));\r\n \r\n \t\t\t} else if (nextName.compareTo(\"questref\") == 0) {\r\n \t\t\t\tNode childRef = child.getFirstChild(); // now, get the text\r\n \t\t\t\t// decode the reference\r\n \t\t\t\tText refText = (Text) childRef;\r\n \t\t\t\tString stRef = refText.getData();\r\n \t\t\t\taddQuestion((Question) db.getRef(stRef));\r\n \r\n \t\t\t} else {\r\n \t\t\t\tSystem.out.println(\"unrecognized element under alternative!\");\r\n \t\t\t}\r\n \r\n \t\t\tchild = (Element) child.getNextSibling();\r\n \t\t}\r\n \t}", "private String parseHtmlText(HtmlPage htmlPage) {\n\n Document doc = Jsoup.parse(htmlPage.getRawHTML(), htmlPage.getURL());\n StringBuilder sb = new StringBuilder();\n doc.getElementsByClass(MAIN_CONTENT_CLASS).forEach(element -> {\n element.getElementsByTag(PARAGRAPH_TAG).forEach(paragraph_element -> {\n sb.append(paragraph_element.text()).append(SPACE);\n });\n });\n\n String parsedText = sb.toString();\n // IF case folding is set, perform it\n if (this.isCaseFolding) {\n parsedText = parsedText.toLowerCase();\n }\n\n // IF punctuation handling is set, perform it\n if (this.isPunctuationHandling) {\n parsedText = punctuationHandler(parsedText);\n }\n\n return parsedText;\n }", "public abstract WordEntry manualTranslate(String text, String from, String to);", "private Map<String, Map<String,Integer>> openNLPParse(String text) {\n\t\tMap<String, Map<String,Integer>> result = new HashMap<String, Map<String,Integer>>();\n\t\tString path = \"\";\n\t\t\n\t\tfor (String type : this.entityTypes) {\n\t\t\tpath = \"en-ner-\" + type.toLowerCase() + \".bin\";\n\t\t\tthis.nlp = new OpenNLPNameFinder(type, path);\n\t\t\tMap<String,Integer> entities = nlp.recogniseWithCounts(text);\n\t\t\tresult.put(type, entities);\n\t\t}\n\n\t\treturn result;\n\t}", "abstract protected void processHTMLLine(String line);", "@SuppressWarnings(\"static-access\")\n\tpublic void detection(Request text) {\n\t\t//Fichiertxt fichier;\n\t\ttry {\t\t\t\t\t\n\t\t\t//enregistrement et affichage de la langue dans une variable lang\n\t\t\ttext.setLang(identifyLanguage(text.getCorpText()));\n\t\t\t//Ajoute le fichier traité dans la Base\n\t\t\tajouterTexte(text);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"fichier texte non trouvé\");\n\t e.printStackTrace();\n\t\t}\n\t}", "TextWithReferences getTextWithReferences();", "public String getTextForDisplay() {\n\t\tif (textForDisplay == null) {\n\t\t\ttextForDisplay = \"\";\n\t\t\tif (text != null) {\n\t\t\t\ttextForDisplay = new String(text);\n\t\t\t}\n\t\t\tif (entities != null) {\n\t\t\t\tif (entities.urls != null) {\n\t\t\t\t\tfor (Url url : entities.urls) {\n\t\t\t\t\t\ttextForDisplay = textForDisplay.replace(url.url,\n\t\t\t\t\t\t\t\turl.display_url);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (entities.media != null) {\n\t\t\t\t\tfor (Media media : entities.media) {\n\t\t\t\t\t\ttextForDisplay = textForDisplay.replace(media.url,\n\t\t\t\t\t\t\t\tmedia.display_url);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\ttextForDisplay = textForDisplay.replace(\"&lt;\", \"<\")\n\t\t\t\t\t.replace(\"&gt;\", \">\").replace(\"&amp;\", \"&\");\n\t\t}\n\t\treturn textForDisplay;\n\t}", "public String cleanHtmlTextForPlayer(String unrefinedHtmlText) {\n\n String figureRemove = replaceAllCharacter(unrefinedHtmlText, ConstantUtil.HTML_EXTRACT_FIGURE_REGEX, ConstantUtil.BLANK);\n String figcaptionRemove = replaceAllCharacter(figureRemove, ConstantUtil.HTML_EXTRACT_FIGCAPTION_REGEX, ConstantUtil.BLANK);\n String almostRefinedText = figcaptionRemove.replaceAll(ConstantUtil.HTML_EXTRACT_IMG_REGEX, ConstantUtil.BLANK);\n return almostRefinedText;\n\n }", "private void createStructuredDocumentTag(CTSdtPr sdtPr, String text) {\n\t\t// The properties contain (among others) aliases (<w:alias>), tag names (w:tag)\n\t\t// and a flag (<w:showingPlcHdr>) whether the content is placeholder or real content.\n\t\tString alias = getCTStringVal(getFirst(sdtPr.getAliasArray()));\n\t\tString tagName = getCTStringVal(getFirst(sdtPr.getTagArray()));\n\t\tboolean isPlaceholder = sdtPr.getShowingPlcHdrArray().length > 0;\n\n\t\tObject value = null;\n\t\t// If placeholder is set, the element is not filled by the user\n\t\tif (!isPlaceholder) {\n\t\t\tvalue = text;\n\n\t\t\t// The following child element can occur and determine the type of the structured\n\t\t\t// document tag: equation, comboBox (*), date (*), docPartObj, docPartList,\n\t\t\t// dropDownList (*), picture, richText (*), text (*), citation, group, bibliography.\n\n\t\t\t// Note that we can't use the typed method (e.g sdtPr.getComboBoxArray()) here\n\t\t\t// because in the small (poi-)ooxml-schemas.jar bundled with POI, the specialized\n\t\t\t// classes (e.g. CTStdComboBox) are missing. Trying to use these methods will fail\n\t\t\t// with a NoClassDefFoundError exception (cf. POI FAQ).\n\t\t\t// But we can work with the plain XmlObjects or DOM nodes, if we extract them by\n\t\t\t// a generic path expression.\n\t\t\tElement sdtType;\n\t\t\tif ((sdtType = getFirstAsDomElement(sdtPr, \"w:text\")) != null\n\t\t\t\t|| (sdtType = getFirstAsDomElement(sdtPr, \"w:richText\")) != null) {\n\t\t\t\t// Value is the text (in the case of richText without formatting)\n\t\t\t} else if ((sdtType = getFirstAsDomElement(sdtPr, \"w:date\")) != null) {\n\t\t\t\t// 17.5.2.7: fullDate contains the \"full date and time last entered\"\n\t\t\t\t// in XML Schema DateTime syntax\n\t\t\t\tString fullDate = sdtType.getAttributeNS(WORDPROCESSINGML_NS, \"fullDate\");\n\t\t\t\tif (fullDate != null) {\n\t\t\t\t\tXMLGregorianCalendar calendar;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tcalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(fullDate);\n\t\t\t\t\t\tlong timeMillis = calendar.toGregorianCalendar(null, null, null).getTimeInMillis();\n\t\t\t\t\t\tfinal String dateText = text;\n\t\t\t\t\t\tvalue = new Date(timeMillis) {\n\t\t\t\t\t\t\t@Override \n\t\t\t\t\t\t\tpublic String toString() { \n\t\t\t\t\t\t\t\treturn dateText; \n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t};\n\t\t\t\t\t} catch(DatatypeConfigurationException e) {\n\t\t\t\t\t\tLOG.warn(\"createStructuredDocumentTag failed: \", e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if ((sdtType = getFirstAsDomElement(sdtPr, \"w:comboBox\")) != null\n\t\t\t\t|| (sdtType = getFirstAsDomElement(sdtPr, \"w:dropDownList\")) != null) {\n\t\t\t\t// 17.5.2.5 (comboBox), 17.5.2.15 (dropDownList)\n\t\t\t\t// Try to find the associated value with the extract text (if possible)\n\t\t\t\tNodeList listItems = sdtType.getElementsByTagNameNS(WORDPROCESSINGML_NS, \"listItem\");\n\t\t\t\tfor (int i = 0, n = listItems.getLength(); i < n; i++) {\n\t\t\t\t\tElement listItem = (Element) listItems.item(i);\n\t\t\t\t\tString displayText = listItem.getAttributeNS(WORDPROCESSINGML_NS, \"displayText\");\n\t\t\t\t\tif (text.equals(displayText)) {\n\t\t\t\t\t\tvalue = listItem.getAttributeNS(WORDPROCESSINGML_NS, \"value\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if ((getFirstAsDomElement(sdtPr, \"equation\") != null)\n\t\t\t\t\t|| (getFirstAsDomElement(sdtPr, \"docPartObj\") != null)\n\t\t\t\t\t|| (getFirstAsDomElement(sdtPr, \"docPartList\") != null)\n\t\t\t\t\t|| (getFirstAsDomElement(sdtPr, \"picture\") != null)\n\t\t\t\t\t|| (getFirstAsDomElement(sdtPr, \"citation\") != null)\n\t\t\t\t\t|| (getFirstAsDomElement(sdtPr, \"group\") != null)\n\t\t\t\t\t|| (getFirstAsDomElement(sdtPr, \"bibliography\") != null)) {\n\t\t\t\t// ignore (unsupported type)\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\t// type is unspecified, treat as text\n\t\t\t}\n\t\t}\n\n\t\tStructuredDocumentTag sdt = new StructuredDocumentTag(alias, tagName, value, text);\n\t\tstructuredDocumentTags.add(sdt);\n\t}", "@Before\n\tpublic void setUp() throws Exception {\n\t\tList<Paragraph> paragraphs = new ArrayList<Paragraph>();\n\t\tList<Paragraph> paragraphsWithNoSentences = new ArrayList<Paragraph>();\n\t\t\n\t\tScanner sc = null, sc1 = null;\n\t\ttry {\n\t\t\tsc = new Scanner(new File(\"testsearchtext.txt\"));\n\t\t\tsc1 = new Scanner(new File(\"testsearchentity.txt\"));\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tsc.useDelimiter(\"[.]\");\n\t\tsc1.useDelimiter(\"[|]\");\n\t\t\n\t\tList<Sentence> sentences = new ArrayList<Sentence>();\n\t\tint sCount = 0;\n\t\tint pCount = 0;\n\t\twhile(sc.hasNext()){\n\t\t\tString temp = sc.next().trim();\n\n\t\t\tif(sCount > 0 && (sCount%10 == 0 || !sc.hasNext())){\n\t\t\t\tParagraph p = new Paragraph(pCount);\n\t\t\t\tparagraphsWithNoSentences.add(p);\n\t\t\t\t\n\t\t\t\tp = new Paragraph(pCount);\n\t\t\t\tp.setSentences(sentences);\n\t\t\t\tparagraphs.add(p);\n\t\t\t\tpCount++;\n\t\t\t\t\n\t\t\t\tsentences = new ArrayList<Sentence>();\n\t\t\t}\n\t\t\t\n\t\t\tif(!temp.equals(\"\"))\n\t\t\t\tsentences.add(new Sentence((sCount%10), temp));\n\t\t\t\n\t\t\tsCount++;\n\t\t}\n\t\t\n\t\tList<Entity> entities = new ArrayList<Entity>();\n\t\tint currType = -1; \n\t\twhile(sc1.hasNext()){\n\t\t\tString temp = sc1.next().trim();\n\t\t\tif(temp.equals(\"place\")){currType = Entity.PLACE;} else\n\t\t\tif(temp.equals(\"url\")){currType = Entity.URL;} else\n\t\t\tif(temp.equals(\"email\")){currType = Entity.EMAIL;} else\n\t\t\tif(temp.equals(\"address\")){currType = Entity.ADDRESS;} \n\t\t\telse{\n\t\t\t\tentities.add(new Entity(currType, temp));\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tSource s = new Source(\"testsearchtext.txt\", \"testsearchtext.txt\");\n\t\tpt1 = new ProcessedText(s, paragraphs, null); \n\t\t\n\t\ts = new Source(\"testsearchtext1.txt\", \"testsearchtext1.txt\");\n\t\tpt2 = new ProcessedText(s, paragraphsWithNoSentences, null); \n\t\t\n\t\tpt3 = new ProcessedText();\n\t\tpt3.setParagraphs(paragraphs);\n\t\t\n\t\tpt4 = new ProcessedText();\n\t\ts = new Source(\"testsearchtext2.txt\", \"testsearchtext2.txt\");\n\t\tpt4.setMetadata(s);\n\t\t\n\t\ts = new Source(\"testsearchtext3.txt\", \"testsearchtext3.txt\");\n\t\tpt5 = new ProcessedText(s, paragraphs, entities); \n\t\t\n\t\ts = new Source(\"testsearchtext4.txt\", \"testsearchtext4.txt\");\n\t\tpt6 = new ProcessedText(s, null, entities); \n\t}", "private void trainText() throws Exception\n\t{\n\t\tdbiterator.setDataSource(DBInstanceIterator.DBSource.TEXT);\n\t\tSystem.out.println(\"Starting reading Text Trainingset ..\");\n\n\t\tPipe serialpipe = getTextPipe();\n\t\tInstanceList text_instances = new InstanceList(serialpipe);\n\n\t\tSystem.out.println(\"Preprocessing on Text Trainingset ..\");\n\t\ttext_instances.addThruPipe(dbiterator);\n\n\t\tSystem.out.println(\"Text Training set : \" + text_instances.size());\n\t\tSystem.out.println(\"Saving preprocessed data ..\");\n\t\tsaveinstances(text_instances, Train + \"T.bin\");\n\n\t\tSystem.out.println(\"Saving Features data ..\");\n\t\ttext_instances.getDataAlphabet().dump(new PrintWriter(new File(Attributes + \"text.dat\")));\n\n\t\tNaiveBayesTrainer trainer = new NaiveBayesTrainer();\n\n\t\tSystem.out.println(\"NaiveBayes Starts Training on Text training set ..\");\n\t\tNaiveBayes classifier = trainer.train(text_instances);\n\n\t\tSystem.out.println(\"Targets labels : \\t\"+classifier.getLabelAlphabet());\n\t\tSystem.out.println(\"Saving Naive Bayes Classifier ..\");\n\t\tsaveModel(classifier, Text_Train);\n\t\tSystem.out.println(\"Text classifier saved to : \" + Text_Train);\n\t}", "@Override\n\tpublic Paragraph translateText(String freetext, boolean include) {\n\t\treturn null;\n\t}", "private void filterFeatureswithtext() throws Exception {\n\t\ttry {\r\n\t\t\t//source = dataStore.getFeatureSource(typeName);\r\n\t\t\tString sql = text.getText();\r\n\t\t\tString filtertype = \"include\";\r\n\t\t\tString[] cql = sql.split(\":\");\r\n\t\t\tHints h = new Hints();\r\n \t\t\th.put(Hints.FILTER_FACTORY, ISOFilterFactoryImpl.class);\r\n \t\t\tFilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(h);\r\n \t\t\tWKTReader wktr = new WKTReader(DefaultGeographicCRS.WGS84_3D);\r\n \t\t\tFilter filter = CQL.toFilter(\"include\");\r\n \t\t\tlong start = System.currentTimeMillis();\r\n \t\t\tList<SimpleFeature> sfs = new ArrayList<SimpleFeature>();\r\n \t\t\tSimpleFeatureIterator iterator = currentfeatures.features();\r\n \t\t\t\r\n \t\t\tif(cql.length > 1 && cql[2].startsWith(\"BBOX3D\")) {\r\n \t\t\t cql[2] = cql[2].replaceAll(\"BBOX3D\", \"\");\r\n \t\t\t cql[2] = cql[2].replaceAll(\"\\\\(\", \"\");\r\n \t\t\t cql[2] = cql[2].replaceAll(\"\\\\)\", \"\");\r\n \t\t\t \r\n \t\t\t String[] coords = cql[2].split(\",\");\r\n \t\t\t \r\n \t\t\t String[] lowerStr = coords[0].trim().split(\" \");\r\n \t\t\t String[] upperStr = coords[1].trim().split(\" \");\r\n \t\t\t \r\n \t\t\t double[] lower = new double[3];\r\n \t\t\t double[] upper = new double[3];\r\n \t\t\t \r\n \t\t\t lower[0] = Double.parseDouble(lowerStr[0]);\r\n lower[1] = Double.parseDouble(lowerStr[1]);\r\n lower[2] = Double.parseDouble(lowerStr[2]);\r\n \r\n upper[0] = Double.parseDouble(upperStr[0]);\r\n upper[1] = Double.parseDouble(upperStr[1]);\r\n upper[2] = Double.parseDouble(upperStr[2]);\r\n \r\n DirectPosition lowerCorner = builder.createDirectPosition(lower);\r\n DirectPosition upperCorner = builder.createDirectPosition(upper);\r\n \r\n Solid s = makeFromEnvelope(builder, lowerCorner, upperCorner);\r\n cql[2] = s.toString();\r\n\r\n Document d = encode(s);\r\n //System.out.println(d);\r\n\r\n //System.out.println(cql[2]);\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif(cql[0].equalsIgnoreCase(\"contains\")) {\r\n \t\t\t\tfeatureid = \"\";\r\n \t\t\t\tfilter = ff.contains(cql[1], wktr.read(cql[2]));\r\n \t\t\t\tfiltertype = \"contains \";\r\n \t\t\t}\r\n \t\t\telse if(cql[0].equalsIgnoreCase(\"within\")) {\r\n \t\t\t\tfeatureid = \"\";\r\n \t\t\t\tfilter = ff.within(cql[1], wktr.read(cql[2]));\r\n \t\t\t\tfiltertype = \"within \";\r\n \t\t\t}\r\n \t\t\telse if(cql[0].equalsIgnoreCase(\"equals\")) {\r\n \t\t\t\tfilter = ff.equals(cql[1], wktr.read(cql[2]));\r\n \t\t\t\tfiltertype = \"equals \";\r\n \t\t\t}\r\n \t\t\telse if(cql[0].equalsIgnoreCase(\"intersects\")) {\r\n \t\t\t\tFilter getidfilter = ff.equals(cql[1], wktr.read(cql[2]));\r\n \t\t\t\t\r\n \t\t\t\twhile (iterator.hasNext()) {\r\n \t\t\t\t\tSimpleFeature feature = iterator.next();\r\n \t\t\t\t\t\r\n \t\t\t\t\tif(getidfilter.evaluate(feature)) {\r\n \t\t\t\t\t\tfeatureid = feature.getID();\r\n \t\t\t\t\t\tbreak;\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\tfilter = ff.intersects(cql[1], wktr.read(cql[2]));\r\n \t\t\t\tfiltertype = \"intersects \";\r\n \t\t\t}\r\n \t\t\t\r\n\t\t\t//SimpleFeatureCollection features = source.getFeatures(filter);\r\n \t\t\titerator = currentfeatures.features();\r\n\t\t\twhile (iterator.hasNext()) {\r\n\t\t\t\tSimpleFeature feature = iterator.next();\r\n\t\t\t\tSystem.out.print(featureid + \" : \" + feature.getID() + \" \");\r\n\t\t\t\tif(filter.evaluate(feature)) {\r\n\t\t\t\t\tsfs.add(feature);\r\n\t\t\t\t\tSystem.out.println(\"true\");\r\n\t\t\t\t}else {\r\n\t\t\t\t\tSystem.out.println(\"false\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(sfs.size() == 0) {\r\n\t\t\t\ttable.setModel(new DefaultTableModel(5, 5));\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tSimpleFeatureCollection result = ISODataUtilities.collection(sfs);\r\n \t\t\t\r\n\t\t\tlong end = System.currentTimeMillis();\r\n\t\t\t//System.out.println( \"실행 시간 : \" + ( end - start )/1000.0 );\r\n\t\t\tlabel.setText(filtertype + \"complete : \" + ( end - start )/1000.0 + \" sec\");\r\n\t\t\tFeatureCollectionTableModel model = new FeatureCollectionTableModel(result);\r\n\t\t\ttable.setModel(model);\r\n\t\t\t\r\n\t\t} catch (CQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ParseException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} \r\n\t}", "public static List<NLText> processTexts(List<String> texts) {\n// IProtocolClient api = ProtocolFactory.getHttpClient(Locale.ENGLISH, \"ui.disi.unitn.it\", 8092);\n LOG.warn(\"TODO - USING HARDCODED ENGLISH when creating sweb client in processTexts\");\n IProtocolClient api = ProtocolFactory.getHttpClient(Locale.ENGLISH);\n\t\tPipelineClient pipelineClient = new PipelineClient(api);\n NLPInput input = new NLPInput();\n input.setText(texts);\n //input.setNlpParameters(params);\n\n// NLText[] result = pipelineClient.run(\"KeywordTextPipeline\", input, 1l);\n NLText[] result = pipelineClient.run(\"ODHPipeline\", input, 1l);\n \n\t\treturn Arrays.asList(result);\n\t}", "public SmartScriptParser(String text) {\n lexer = new SmartScriptLexer(text);\n documentNode = new DocumentNode();\n stack = new ObjectStack();\n parse();\n\n}", "public void processText(org.w3c.dom.Text text)\r\n\tthrows Exception\r\n\t{\r\n\tWriter xml = getWriter();\r\n\txml.write(getIndent());\r\n\txml.write(HDOMUtil.trim(text));\r\n\txml.write(\"\\n\");\r\n\treturn;\r\n\t}", "public abstract void interpret(EvaluationContext context);", "public String convertMarkupToHTML(String text) {\n return text;\n }", "public static void main (String[] args) {\r\n try {\r\n BufferedReader in = new BufferedReader(\r\n new InputStreamReader(\r\n new FileInputStream(new File(\"D:\\\\bitext.html\")), \"UTF-8\"));\r\n\r\n String s;\r\n StringBuffer b = new StringBuffer();\r\n while( (s = in.readLine()) != null) {\r\n b.append(s );\r\n }\r\n String page= b.toString();\r\n HTMLParser parser = new HTMLParser(page.getBytes(\"UTF-8\"));\r\n //parser.getTagValue (\"meta\");\r\n //System.out.println();\r\n\r\n System.out.println(parser.htmlParsing (false, null, null, false));\r\n //System.out.println(htmlParsing (page3, \"euc-kr\"));\r\n\r\n\r\n } catch (Throwable t) {\r\n t.printStackTrace ();\r\n }\r\n }", "public EntityAnnotator_V2(){\n init();\n //TODO modify reg_v2.xml to deal with paragraphs. at the moment, it only works if this file has only regulations.\n }", "public ArticleForAnnotation FindFekRegex(ArticleForAnnotation curArticle) throws Exception {\n // Regular expression to be matched\n// Pattern FekPattern = Pattern.compile(\"((\\\\d+\\\\w{1,2}? +)?[νΝ]\\\\. ?\\\\d+/\\\\d+( *\\\\([Α-Ωα-ω]{1,2}[΄΄'’]? ?\\\\d+\\\\))?)\", Pattern.UNICODE_CASE);\n // Matches Laws and POs (ΠΔ)\n// Pattern FekPattern = Pattern.compile(\"(((([Νν][όο]μ)[α-ω]{0,3}|[νΝ])\\\\.?|([Ππ]\\\\.?[Δδ]\\\\.?)) ?\\\\d+\\\\/\\\\d+( *\\\\((ΦΕΚ )?[Α-Ωα-ω]{1,2}[΄`΄'’]? ?\\\\d+((\\\\/|, ?)(\\\\d|\\\\.|-)*)?\\\\))?)\", Pattern.UNICODE_CASE);\n Pattern FekPattern = Pattern.compile(\"(((άρθ[α-ω\\\\.]{0,} ?\\\\d+,? [Α-Ωα-ω0-9, ]*παρ[α-ωά\\\\.]{0,} ?\\\\d+,? [Α-Ωα-ω0-9, ]*)|(παρ[α-ωά\\\\.]{0,} ?\\\\d+,? [Α-Ωα-ω0-9, ]*άρθ[α-ω\\\\.]{0,4} ?\\\\d+,? [Α-Ωα-ω0-9, ]*))?((([Νν][όο]μ)[α-ω]{0,3}|[νΝ])\\\\.?|([Ππ]\\\\.?[Δδ]\\\\.?)) ?\\\\d+\\\\/\\\\d+( *\\\\((ΦΕΚ )?[Α-Ωα-ω]{1,2}[΄`΄'’]? ?\\\\d+((\\\\/|, ?)(\\\\d|\\\\.|-)*)?\\\\))?)\", Pattern.UNICODE_CASE);\n Pattern LawPattern = Pattern.compile(\"((([Νν][όο]μ)[α-ω]{0,3}|[νΝ])\\\\.?|([Ππ]\\\\.?[Δδ]\\\\.?)) ?\\\\d+\\\\/\\\\d+\", Pattern.UNICODE_CASE);\n // Start searching article text\n String articText = curArticle.articleText;\n Matcher m = FekPattern.matcher(articText);\n while (m.find()) {\n String entityFound = m.group(0);\n\n Matcher mLaw = LawPattern.matcher(entityFound);\n if (!mLaw.find()) {\n continue;\n }\n String entityLaw = mLaw.group(0);\n\n String[] FEKparts = entityFound.split(\"/\", 2);\n int startIndex = m.start();\n int endIndex = m.end();\n String FEK_year = \"\";\n String FEK_issue = \"\";\n String FEK_number = null;\n String urlpdf = \"\";\n String entity_Type = \"fek\";\n\n // Get the second part from a FEK annotation (e.g. from ν. 2873/2000 (Α’ 285) the 2000 (Α’ 285) part)\n // and check if FEK issue and number exist (inside parenthesis)\n if (FEKparts[1].contains(\"(\")) {\n // Check inside that part for mached accent characters (΄ or ' or ’)\n // and if so, we get from this string the FEK issue (e.g. A) and FEK number\n FEK_year = FEKparts[1].substring(0, FEKparts[1].lastIndexOf(\"(\")).trim();\n if (FEKparts[1].contains(\"΄\")) {\n FEK_issue = FEKparts[1].substring(FEKparts[1].lastIndexOf(\"(\"), FEKparts[1].lastIndexOf(\"΄\")).trim().replace(\"(\", \"\");\n FEK_number = FEKparts[1].substring(FEKparts[1].lastIndexOf(\"΄\"), FEKparts[1].lastIndexOf(\")\")).replace(\"΄\", \"\").trim();\n } else if (FEKparts[1].contains(\"'\")) {\n FEK_issue = FEKparts[1].substring(FEKparts[1].lastIndexOf(\"(\"), FEKparts[1].lastIndexOf(\"'\")).trim().replace(\"(\", \"\");\n FEK_number = FEKparts[1].substring(FEKparts[1].lastIndexOf(\"'\"), FEKparts[1].lastIndexOf(\")\")).replace(\"'\", \"\").trim();\n } else if (FEKparts[1].contains(\"’\")) {\n FEK_issue = FEKparts[1].substring(FEKparts[1].lastIndexOf(\"(\"), FEKparts[1].lastIndexOf(\"’\")).trim().replace(\"(\", \"\");\n FEK_number = FEKparts[1].substring(FEKparts[1].lastIndexOf(\"’\"), FEKparts[1].lastIndexOf(\")\")).replace(\"’\", \"\").trim();\n } else if (FEKparts[1].contains(\"`\")) {\n FEK_issue = FEKparts[1].substring(FEKparts[1].lastIndexOf(\"(\"), FEKparts[1].lastIndexOf(\"`\")).trim().replace(\"(\", \"\");\n FEK_number = FEKparts[1].substring(FEKparts[1].lastIndexOf(\"`\"), FEKparts[1].lastIndexOf(\")\")).replace(\"`\", \"\").trim();\n } else {\n // If doesn't contain on of these characters then we check for space\n // else we get the first character as the FEK issue (e.g. A, B etc)\n FEK_issue = FEKparts[1].substring(FEKparts[1].lastIndexOf(\"(\"), FEKparts[1].lastIndexOf(\")\")).trim().replace(\"(\", \"\").replace(\")\", \"\");\n if (FEK_issue.startsWith(\"ΦΕΚ \")) {\n FEK_issue = FEK_issue.substring(4);\n } else if (FEK_issue.startsWith(\"ΦΕΚ\")) {\n FEK_issue = FEK_issue.substring(3);\n }\n\n if (FEK_issue.contains(\" \")) {\n String[] splitedIssue = FEK_issue.split(\" \");\n FEK_issue = splitedIssue[0];\n FEK_number = splitedIssue[1];\n } else {\n FEK_number = FEK_issue.substring(1);\n FEK_issue = FEK_issue.substring(0, 1);\n }\n }\n if (FEK_issue.startsWith(\"ΦΕΚ \")) {\n FEK_issue = FEK_issue.substring(4);\n }\n String[] FEK_num_tokens = FEK_number.split(\"(\\\\/|-| |,)\");\n\n FEK_number = FEK_num_tokens[0];\n\n // Set the corresponding issue checkbox based on the FEK issue retrieved above\n String checkBoxIssue = \"\";\n switch (FEK_issue) {\n case \"Α\":\n checkBoxIssue = \"chbIssue_1\";\n break;\n case \"Β\":\n checkBoxIssue = \"chbIssue_2\";\n break;\n case \"Γ\":\n checkBoxIssue = \"chbIssue_3\";\n break;\n case \"Δ\":\n checkBoxIssue = \"chbIssue_4\";\n break;\n case \"\":\n checkBoxIssue = \"\";\n break;\n }\n\n // Perform the POST request\n PostRequestFEK httpRequest = new PostRequestFEK();\n // Get the corresponding pdf url of the FEK\n urlpdf = httpRequest.sendPost3(FEK_year, FEK_issue, FEK_number, checkBoxIssue);\n// if (urlpdf.length() == 0) {\n// urlpdf = \"-1\";\n// }\n } else {\n FEK_year = FEKparts[1];\n String[] toks = entityLaw.split(\"(\\\\.|,| |\\\\/)\");\n if (entityLaw.toLowerCase().startsWith(\"ν\")) {\n entity_Type = \"law\";\n } else if (entityLaw.toLowerCase().startsWith(\"π\")) {\n entity_Type = \"pd\";\n }\n String item_number = toks[toks.length - 2];\n PostRequestFEK httpRequest = new PostRequestFEK();\n urlpdf = httpRequest.sendPost4(FEK_year, item_number, entity_Type);\n }\n // Add the current annotation found into the current article's annotations list\n Annotation currentAnnotation = new Annotation(entityFound, startIndex, endIndex, urlpdf, entity_Type, entityLaw);\n curArticle.annotations.add(currentAnnotation);\n }\n // Return the article back to the process\n return curArticle;\n }", "@Override\n public String loadTextWidget() {\n /* Get the complete E19 text and display it. */\n String text = getText(E19_ALLPAGES);\n text = text.replace(\"null\", \"\");\n\n return text;\n }", "private static String pipelinePOS_NER(String text, boolean debugMode) {\n\t\tif (debugMode) System.out.println(\"Starting coreNLP analysis\");\n\n\t\t//POS & NER extraction, Stanford CoreNLP\n\t\tString NePosText = CoreNLPHandler.getXMLwithNERandPOS(text);\n\n\t\treturn NePosText;\n\t}", "public interface ResultHandler extends DocumentHandler {\n \n \n /**\n * Signals to receive CDATA characters\n * @param chars the character array containing the characters\n * to receive\n * @param start the index into the character array to start receiving\n * characters at\n * @param length the number of characters to recieve\n **/\n public void cdata(char[] chars, int start, int length);\n \n \n /**\n * Signals to recieve a comment\n * @param data, the content of the comment\n **/\n public void comment(String data);\n \n /**\n * Signals to recieve an entity reference with the given name\n * @param name the name of the entity reference\n **/\n public void entityReference(String name);\n \n \n /**\n * Sets the behavoir of handling character content. If argument is true,\n * character content will be escaped. If false, character content will\n * not be escaped.\n * @param escapeText the flag indicating whether or not to\n * escape character content\n **/\n //public void setEscapeText(boolean escapeText);\n \n /**\n * Sets the indent size for all formatters that perform\n * serialization, in which indentation is applicable.\n * @param indentSize the number of characters to indent\n **/\n public void setIndentSize(short indentSize);\n \n /**\n * Sets the output format information for Formatters that\n * perform serialization.\n * @param format the OutputFormat used to specify properties\n * during serialization\n **/\n public void setOutputFormat(OutputFormat format);\n \n \n /**\n * Signals to receive characters which should not be escaped\n * @param chars the character array containing the characters\n * to receive\n * @param start the index into the character array to start receiving\n * characters at\n * @param length the number of characters to recieve\n **/\n public void unescapedCharacters(char[] chars, int start, int length);\n \n}", "private void processArticle(String rawArticleText, Article article, Context context) throws IOException, InterruptedException {\n if (!rawArticleText.trim().isEmpty()) {\n String[] splitSentences = rawArticleText.split(\"\\\\.\\\\s\");\n PriorityQueue<Sentence> sortedSentences = new PriorityQueue<>();\n\n for (int sentenceIndex = 0; sentenceIndex < splitSentences.length; sentenceIndex++) {\n String rawSentence = splitSentences[sentenceIndex];\n Double sentenceTfIdf = getSentenceTfIdf(rawSentence, article);\n sortedSentences.add(new Sentence(sentenceTfIdf, rawSentence, sentenceIndex));\n }\n\n String summary = topOrderedSentences(sortedSentences);\n context.write(new IntWritable(article.id), new Text(summary));\n }\n }", "private void prepArticle(Element articleContent) {\n // we don't need to do this, we don't care\n cleanStyles(articleContent);\n // this replaces any break element or an nbsp with a plain break\n // element.\n // not needed. We will deal with breaks as we deal with breaks\n // killBreaks(articleContent);\n\n /* Clean out junk from the article content */\n cleanConditionally(articleContent, \"form\");\n clean(articleContent, \"object\");\n clean(articleContent, \"h1\");\n\n /**\n * If there is only one h2, they are probably using it as a header and not a subheader, so remove it\n * since we already have a header.\n ***/\n if (articleContent.getElementsByTag(\"h2\").size() == 1) {\n clean(articleContent, \"h2\");\n }\n clean(articleContent, \"iframe\");\n\n cleanHeaders(articleContent);\n\n /*\n * Do these last as the previous stuff may have removed junk that will affect these\n */\n cleanConditionally(articleContent, \"table\");\n cleanConditionally(articleContent, \"ul\");\n //could have no children, will crash then\n if (articleContent.children().size() != 0) {\n cleanConditionally(articleContent.child(0), \"div\");\n }\n\n /* Remove extra paragraphs */\n Elements articleParagraphs = articleContent.getElementsByTag(\"p\");\n for (Element para : articleParagraphs) {\n int imgCount = para.getElementsByTag(\"img\").size();\n int embedCount = para.getElementsByTag(\"embed\").size();\n int objectCount = para.getElementsByTag(\"object\").size();\n\n if (imgCount == 0 && embedCount == 0 && objectCount == 0 && para.text().matches(\"\\\\s*\")) {\n para.remove();\n }\n }\n\n Elements parasWithPreceedingBreaks = articleContent.getElementsByTag(\"br + p\");\n for (Element pe : parasWithPreceedingBreaks) {\n Element brElement = pe.previousElementSibling();\n brElement.remove();\n }\n }", "String processing();", "@Test\n\tpublic void testStoreProcessText3() {\n\t\tint sourceID = dm.storeProcessedText(pt6);\n\t\tassertTrue(sourceID > 0);\n\t\t\n\t\tds.startSession();\n\t\tSource source = ds.getSource(pt6.getMetadata().getUrl());\n\t\tassertTrue(pt6.getMetadata().getName().equals(source.getName()));\n\t\t\n\t\tList<Entity> entities = (List<Entity>) ds.getEntities(sourceID);\n\t\tassertTrue(pt6.getEntities().size() == entities.size());\n\t\t\n\t\tfor(int i = 0; i < pt6.getEntities().size(); i++){\n\t\t\tEntity originalEntity = pt6.getEntities().get(i);\n\t\t\tEntity retrievedEntity = entities.get(i);\n\t\t\tassertTrue(originalEntity.getContent().equals(retrievedEntity.getContent()));\n\t\t}\n\t\tds.closeSession();\n\t\t\n\t\t\n\t}", "public PostBibTeXParser() {\n\t\tthis.resourceFactory = new ResourceFactory();\n\t}" ]
[ "0.6201405", "0.589367", "0.58061355", "0.5791681", "0.5702356", "0.5678113", "0.55663943", "0.5532644", "0.5498211", "0.54692274", "0.5457174", "0.53920287", "0.53110975", "0.53109646", "0.53030616", "0.52891606", "0.52843595", "0.52536577", "0.5221708", "0.5178143", "0.5154077", "0.51509243", "0.5137525", "0.5129464", "0.51190734", "0.50984937", "0.50720936", "0.5058837", "0.5020197", "0.500265", "0.5001643", "0.4994192", "0.49721515", "0.49715275", "0.4962424", "0.49482775", "0.49429572", "0.49386507", "0.49081227", "0.49021775", "0.4886861", "0.48839122", "0.4882424", "0.48741376", "0.48713106", "0.48566207", "0.48358023", "0.4830828", "0.4830329", "0.4812542", "0.48121187", "0.47826552", "0.47790876", "0.47781885", "0.47771376", "0.47749382", "0.47720364", "0.4766279", "0.4763669", "0.47613424", "0.4758083", "0.47534668", "0.4750746", "0.4750328", "0.47447446", "0.47373965", "0.47349522", "0.47307462", "0.4730202", "0.47291586", "0.4721434", "0.47209474", "0.47184396", "0.47099167", "0.46983498", "0.46928602", "0.4685566", "0.46807498", "0.46792954", "0.46716085", "0.4670724", "0.4667631", "0.46645808", "0.4661525", "0.46528423", "0.46479827", "0.46359646", "0.46337268", "0.4633444", "0.4630217", "0.46235988", "0.4621486", "0.46206692", "0.46159956", "0.46094075", "0.46067485", "0.45957336", "0.45950133", "0.45936856", "0.45932087" ]
0.47934064
51
========================================================================= This function is only called by preprocessor frames to pull in pages for transclusion or redirection. It takes wikitext and parses the wikitext for inclusion or viewing. The following steps are performed: Validation Preprocessing (for inclusion/viewing) Entity substitution Expansion
protected CompiledPage preprocessAndExpand( ExpansionCallback callback, PageId pageId, String wikitext, boolean forInclusion, EntityMap entityMap, Map<String, AstNode> arguments, ExpansionFrame rootFrame, ExpansionFrame parentFrame) throws CompilerException { if (pageId == null) throw new NullPointerException(); if (wikitext == null) throw new NullPointerException(); PageTitle title = pageId.getTitle(); CompilerLog log = new CompilerLog(); log.setTitle(title.getFullTitle()); log.setRevision(pageId.getRevision()); LazyPreprocessedPage pprAst; try { String validatedWikitext = validate(title, wikitext, entityMap, log); LazyPreprocessedPage ppAst = preprocess(title, validatedWikitext, forInclusion, entityMap, log); pprAst = expand( callback, title, ppAst, entityMap, arguments, forInclusion, rootFrame, parentFrame, log); } catch (CompilerException e) { e.attachLog(log); throw e; } catch (Throwable e) { throw new CompilerException("Compilation failed!", e, log); } return new CompiledPage( new Page(pprAst.getContent()), pprAst.getWarnings(), log); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void processPages(PDPageTree pages) throws IOException {\n\n List<ObjectRef> pageRefs = new ArrayList<>();\n //STEP 1: get the page refs\n findPages(pdDocument.getPages().getCOSObject().getItem(COSName.KIDS), pageRefs);\n //confirm the right number of pages was found\n if (pageRefs.size() != pdDocument.getNumberOfPages()) {\n throw new IOException(new TikaException(\n \"Couldn't find the right number of page refs (\" + pageRefs.size() +\n \") for pages (\" + pdDocument.getNumberOfPages() + \")\"));\n }\n\n PDStructureTreeRoot structureTreeRoot =\n pdDocument.getDocumentCatalog().getStructureTreeRoot();\n\n //STEP 2: load the roleMap\n Map<String, HtmlTag> roleMap = loadRoleMap(structureTreeRoot.getRoleMap());\n\n //STEP 3: load all of the text, mapped to MCIDs\n Map<MCID, String> paragraphs = loadTextByMCID(pageRefs);\n\n //STEP 4: now recurse the the structure tree root and output the structure\n //and the text bits from paragraphs\n\n try {\n recurse(structureTreeRoot.getK(), null, 0, paragraphs, roleMap);\n } catch (SAXException e) {\n throw new IOException(e);\n }\n\n //STEP 5: handle all the potentially unprocessed bits\n try {\n if (state.hrefAnchorBuilder.length() > 0) {\n xhtml.startElement(\"p\");\n writeString(state.hrefAnchorBuilder.toString());\n xhtml.endElement(\"p\");\n }\n for (MCID mcid : paragraphs.keySet()) {\n if (!state.processedMCIDs.contains(mcid)) {\n if (mcid.mcid > -1) {\n //TODO: LOG! piece of text that wasn't referenced in the marked content\n // tree\n // but should have been. If mcid == -1, this was a known item not part of\n // content tree.\n }\n\n xhtml.startElement(\"p\");\n writeString(paragraphs.get(mcid));\n xhtml.endElement(\"p\");\n }\n }\n } catch (SAXException e) {\n throw new IOException(e);\n }\n //Step 6: for now, iterate through the pages again and do all the other handling\n //TODO: figure out when we're crossing page boundaries during the recursion\n // step above and do the page by page processing then...rather than dumping this\n // all here.\n for (PDPage page : pdDocument.getPages()) {\n startPage(page);\n endPage(page);\n }\n\n }", "protected void page () throws HTMLParseException {\r\n while (block.restSize () == 0) {\r\n switch (nextToken) {\r\n case END:\r\n return;\r\n case LT:\r\n lastTagStart = tagStart;\r\n tagmode = true;\r\n match (LT);\r\n tag (lastTagStart);\r\n break;\r\n case COMMENT:\r\n //block.addToken (new Token (pagepart, Token.COMMENT, tagStart, stringLength));\r\n // 2009.05.28 by in-koo cho\r\n addTokenCheck(new Token (pagepart, Token.COMMENT, tagStart, stringLength));\r\n match (COMMENT);\r\n break;\r\n case SCRIPT:\r\n //block.addToken (new Token (pagepart, Token.SCRIPT, tagStart, stringLength));\r\n addTokenCheck(new Token (pagepart, Token.SCRIPT, tagStart, stringLength));\r\n match (SCRIPT);\r\n break;\r\n case STRING:\r\n if(stringLength > -1){\r\n //block.addToken (new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n // 2009.05.28 by in-koo cho\r\n addTokenCheck(new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n }\r\n match (nextToken);\r\n break;\r\n case MT:\r\n if(!tagmode) {\r\n scanString();\r\n }\r\n default:\r\n if(stringLength > -1){\r\n //block.addToken (new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n // 2009.05.28 by in-koo cho\r\n addTokenCheck(new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n }\r\n match (nextToken);\r\n }\r\n }\r\n }", "public CompiledPage preprocess(\n\t PageId pageId,\n\t String wikitext,\n\t boolean forInclusion,\n\t ExpansionCallback callback)\n\t throws CompilerException\n\t{\n\t\tif (pageId == null)\n\t\t\tthrow new NullPointerException();\n\t\t\n\t\tPageTitle title = pageId.getTitle();\n\t\t\n\t\tCompilerLog log = new CompilerLog();\n\t\tlog.setTitle(title.getFullTitle());\n\t\tlog.setRevision(pageId.getRevision());\n\t\t\n\t\tLazyPreprocessedPage pprAst;\n\t\ttry\n\t\t{\n\t\t\tEntityMap entityMap = new EntityMap();\n\t\t\t\n\t\t\tString validatedWikitext =\n\t\t\t validate(title, wikitext, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage ppAst =\n\t\t\t preprocess(title, validatedWikitext, forInclusion, entityMap, log);\n\t\t\t\n\t\t\tpprAst = ppAst;\n\t\t\tif (callback != null)\n\t\t\t\tpprAst = expand(callback, title, ppAst, entityMap, null, false, log);\n\t\t}\n\t\tcatch (CompilerException e)\n\t\t{\n\t\t\te.attachLog(log);\n\t\t\tthrow e;\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tthrow new CompilerException(\"Compilation failed!\", e, log);\n\t\t}\n\t\t\n\t\treturn new CompiledPage(\n\t\t new Page(pprAst.getContent()),\n\t\t pprAst.getWarnings(),\n\t\t log);\n\t}", "void retrievePageContents()\n\t{\n\t\tStringBuilder longString = new StringBuilder();\n\t\tfor (int i = 0; i < pageContents.size(); i++)\n\t\t{\n\t\t\tlongString.append(pageContents.get(i));\n\t\t}\n\t\tString pageMarkup = longString.toString().toLowerCase();\n\t\textractComments(pageMarkup);\n\n\t}", "private void processContentEn() {\n if (this.content == null || this.content.equals(\"\")) {\r\n _logger.error(\"{} - The sentence is null or empty\", this.traceId);\r\n }\r\n\r\n // process input using ltp(Segmentation, POS, DP, SRL)\r\n this.nlp = new NLP(this.content, this.traceId, this.setting);\r\n }", "public CompiledPage postprocess(\n\t PageId pageId,\n\t String wikitext,\n\t ExpansionCallback callback)\n\t throws CompilerException\n\t{\n\t\tif (pageId == null)\n\t\t\tthrow new NullPointerException();\n\t\t\n\t\tPageTitle title = pageId.getTitle();\n\t\t\n\t\tCompilerLog log = new CompilerLog();\n\t\tlog.setTitle(title.getFullTitle());\n\t\tlog.setRevision(pageId.getRevision());\n\t\t\n\t\tLazyParsedPage pAst;\n\t\ttry\n\t\t{\n\t\t\tEntityMap entityMap = new EntityMap();\n\t\t\t\n\t\t\tString validatedWikitext =\n\t\t\t validate(title, wikitext, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage ppAst =\n\t\t\t preprocess(title, validatedWikitext, false, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage pprAst = ppAst;\n\t\t\tif (callback != null)\n\t\t\t\tpprAst = expand(callback, title, ppAst, entityMap, null, false, log);\n\t\t\t\n\t\t\tpAst = parse(title, pprAst, entityMap, log);\n\t\t\t\n\t\t\tpAst = postprocess(title, pAst, log);\n\t\t}\n\t\tcatch (CompilerException e)\n\t\t{\n\t\t\te.attachLog(log);\n\t\t\tthrow e;\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tthrow new CompilerException(\"Compilation failed!\", e, log);\n\t\t}\n\t\t\n\t\treturn new CompiledPage(\n\t\t new Page(pAst.getContent()),\n\t\t pAst.getWarnings(),\n\t\t log);\n\t}", "private void parseRawText() {\n\t\t//1-new lines\n\t\t//2-pageObjects\n\t\t//3-sections\n\t\t//Clear any residual data.\n\t\tlinePositions.clear();\n\t\tsections.clear();\n\t\tpageObjects.clear();\n\t\tcategories.clear();\n\t\tinterwikis.clear();\n\t\t\n\t\t//Generate data.\n\t\tparsePageForNewLines();\n\t\tparsePageForPageObjects();\n\t\tparsePageForSections();\n\t}", "private void processContentCn() {\n if (this.content == null || this.content.equals(\"\")) {\r\n _logger.error(\"{} - The sentence is null or empty\", this.traceId);\r\n }\r\n\r\n // process input using ltp(Segmentation, POS, DP, SRL)\r\n this.ltp = new LTP(this.content, this.traceId, this.setting);\r\n }", "@Test\n public void testExtractTextFromDocumentPagewise()\n {\n PDFExtractor instance = new PDFExtractor();\n \n List<String> result = instance.extractTextFromDocumentPagewise(pathToFile);\n List<String> expResult = new ArrayList<>();\n expResult.add(page1);\n expResult.add(page2);\n \n assertEquals(expResult, result);\n }", "public void parsePage() {\n seen = true;\n int first = id.indexOf('_', 0);\n int second = id.indexOf('_', first + 1);\n String firstDir = \"result_\" + id.substring(0, first);\n String secondDir = id.substring(0, second);\n String fileName = id + \".page\";\n String wholePath = pagePath + firstDir + File.separator + secondDir\n + File.separator + fileName;\n try {\n BufferedReader reader = new BufferedReader(new FileReader(wholePath));\n String line = null;\n while((line = reader.readLine()) != null) {\n if (line.equals(\"#ThisURL#\")) {\n url = reader.readLine();\n }\n// else if (line.equals(\"#Length#\")) {\n// length = Integer.parseInt(reader.readLine());\n// }\n else if (line.equals(\"#Title#\")) {\n title = reader.readLine();\n }\n else if (line.equals(\"#Content#\")) {\n content = reader.readLine();\n lowerContent = content.toLowerCase();\n break;\n }\n }\n reader.close();\n if (content == null) {\n return;\n }\n valid = true;\n } catch (IOException e) {\n// System.out.println(\"Parse page \" + id + \" not successful\");\n }\n }", "@Test\n public void testExtractTextFromPage()\n {\n PDFExtractor instance = new PDFExtractor();\n \n int page = 0;\n String expResult = page1;\n String result = instance.extractTextFromPage(pathToFile, page);\n \n assertEquals(expResult, result);\n \n page = 1;\n expResult = page2;\n result = instance.extractTextFromPage(pathToFile, page);\n assertEquals(expResult, result);\n }", "protected void extract() {\n\t\tfor (ITSState nodeState : doc.iterNodes()) {\n\t\t\tNode node = nodeState.node;\n\t\t\tRuleResolver resolver = resolvers.get(node.getNodeName()); \n\t\t\tif (resolver != null) {\n\t\t\t\tGlobalRule rule = resolver.extractRule(attrReader, parameters, nodeState.node);\n\t\t\t\tapplyRule(resolver, rule);\n\t\t\t}\n\t\t\t\n\t\t\tif (node.getNodeName().equals(\"its:param\")) {\n\t\t\t\tString name = node.getAttributes().getNamedItem(\"name\").getNodeValue();\n\t\t\t\tString value = node.getTextContent();\n\t\t\t\tparameters.add(name, value);\n\t\t\t} else if (attrReader.dialect.isRules(node)) { \n\t\t\t\t// we have external link (xlink:href or link href)\n\t\t\t\tString external = attrReader.dialect.getExternalRules(node);\n\t\t\t\tif (external != null) {\n\t\t\t\t\textractExternalRules(external);\n\t\t\t\t}\n\t\t\t} else if (node.getNodeName().equals(\"script\")) {\n\t\t\t\t// we have embedded\n\t\t\t\tif (node.hasAttributes()) {\n\t\t\t\t\tif (node.getAttributes().getNamedItem(\"type\").getNodeValue().equals(\"application/its+xml\")) {\n\t\t\t\t\t\textractEmbeddedRules(node.getTextContent());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!nodeState.nodePath.contains(\"its:rules\")) {\n\t\t\t\t// unless we're in rules, look at local annotations\n\t\t\t\t// LOCAL\n\t\t\t\textractLocal(nodeState);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// process inheritance\n\t\tfor (ITSState nodeState : doc.iterNodes()) {\n\t\t\t// Elements: handle inheritance \n\t\t\tITSData parentData = getParentState(nodeState);\n\t\t\tif (parentData != null) {\n\t\t\t\t// inherit from parent\n\t\t\t\tITSData thisData = nodeItsData.get(nodeState.nodePath);\n\t\t\t\tif (thisData == null) {\n\t\t\t\t\tthisData = new ITSData();\n\t\t\t\t\tapplyRuleToNode(nodeState.nodePath, thisData);\n\t\t\t\t} \n\t\t\t\tthisData.inherit(parentData);\t\t\t\t\n\t\t\t}\t\n\t\t\t\t\t\t\n\t\t} \n\t\t\n\t\t\n\t}", "public CompiledPage parse(\n\t PageId pageId,\n\t String wikitext,\n\t ExpansionCallback callback)\n\t throws CompilerException\n\t{\n\t\tif (pageId == null)\n\t\t\tthrow new NullPointerException();\n\t\t\n\t\tPageTitle title = pageId.getTitle();\n\t\t\n\t\tCompilerLog log = new CompilerLog();\n\t\tlog.setTitle(title.getFullTitle());\n\t\tlog.setRevision(pageId.getRevision());\n\t\t\n\t\tLazyParsedPage pAst;\n\t\ttry\n\t\t{\n\t\t\tEntityMap entityMap = new EntityMap();\n\t\t\t\n\t\t\tString validatedWikitext =\n\t\t\t validate(title, wikitext, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage ppAst =\n\t\t\t preprocess(title, validatedWikitext, false, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage pprAst = ppAst;\n\t\t\tif (callback != null)\n\t\t\t\tpprAst = expand(callback, title, ppAst, entityMap, null, false, log);\n\t\t\t\n\t\t\tpAst = parse(title, pprAst, entityMap, log);\n\t\t}\n\t\tcatch (CompilerException e)\n\t\t{\n\t\t\te.attachLog(log);\n\t\t\tthrow e;\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tthrow new CompilerException(\"Compilation failed!\", e, log);\n\t\t}\n\t\t\n\t\treturn new CompiledPage(\n\t\t new Page(pAst.getContent()),\n\t\t pAst.getWarnings(),\n\t\t log);\n\t}", "private void prepDocument() {\n if (body == null) {\n body = document.appendElement(\"body\");\n }\n\n body.attr(\"id\", \"readabilityBody\");\n\n Elements frames = document.getElementsByTag(\"frame\");\n if (frames.size() > 0) {\n LOG.error(\"Frames. Can't deal. Write code later to look at URLs and fetch\");\n impossible = true;\n return;\n }\n\n Elements stylesheets = document.getElementsByTag(\"style\");\n stylesheets.remove();\n stylesheets = document.select(\"link[rel='stylesheet']\");\n stylesheets.remove();\n\n /* Turn all double br's into p's */\n /*\n * Note, this is pretty costly as far as processing goes. Maybe optimize later.\n */\n handlePP();\n handleDoubleBr();\n fontsToSpans();\n }", "@Override\n\tpublic void process(Page page) {\n\t\tboolean contain=false;\n\t\tint idindex=page.getUrl().toString().lastIndexOf(\"=\");\n\t\tString id=\"\";\n\t\tif(page.getUrl().toString().length()>=(idindex+1))\n\t\t id=page.getUrl().toString().substring(idindex+1);\n\t\tSystem.out.println(id);\n\t\tif(id.contains(\".\"))\n\t\t{\n\t\t\tcontain=true;\n\t\t\tSystem.out.println(\"contain is true\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tString ziduan=page.getHtml().xpath(\"//tbody/tr[3]/td[1]/text()\").all().get(0);\n\t\t\tString legal=\"法律状态:\";\n\t\t\tif(ziduan.equals(legal))\n\t\t\t{\n\t\t\t\tcontain=true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*`patent_name` '专利名称',\n\t\t `patent_type` '专利类型',\n\t\t `legal_status`'法律状态',\n\t\t `abstract` '文摘',\n\t\t `sovereignty` '主权项',\n\t\t `apply_data` '申请日期',\n\t\t `public_data`'公开(公告)日期',\n\t\t `patent_number` '申请(专利)号',\n\t\t `public_number` '公开(公告)号',\n\t\t `main_type_number` '主分类号',\n\t\t `type_number` '分类号',\n\t\t `apply_people` '申请人',\n\t\t `patent_people` '发明人',\n\t\t `people_address` '主申请人地址',\n\t\t `city_code` '省市、代码',\n\t\t */\n\t\t\n\t\tpage.putField(\"patent_name\", page.getHtml().xpath(\"//tbody/tr[1]/td[2]/text()\").all().get(0));\n\t\t\n\t\t//x类\n\t\tif(contain)\n\t\t{\n\t\t\t//专利类型\n\t\t\tpage.putField(\"patent_type\", page.getHtml().xpath(\"//tbody/tr[2]/td[2]/text()\").all().get(0));\n\t\t\t\n\t\t\t//法律状态\n\t\t\tList<String> legal=new ArrayList<String>();\n\t\t\tlegal=page.getHtml().xpath(\"//tbody/tr[3]/td[2]/div/div/span/text()\").all();\n\t\t\tString templegal=\"\";\n\t\t\tfor(int i=0;i<legal.size();i++)\n\t\t\t\ttemplegal+=legal.get(i);\n\t\t\tpage.putField(\"legal_status\",templegal);\n\t\t\t\n\t\t\t//文摘\n\t\t\tpage.putField(\"abstract\", page.getHtml().xpath(\"//tbody/tr[4]/td[2]//*/text()\").all().get(0));\n\t\t\t\n\t\t\t//主权项\n\t\t\tpage.putField(\"sovereignty\", page.getHtml().xpath(\"//tbody/tr[5]/td[2]//*/text()\").all().get(0));\n\t\t\t\n\t\t\t//申请日期\n\t\t\tpage.putField(\"apply_date\", page.getHtml().xpath(\"//tbody/tr[6]/td[2]/span/text()\").all().get(0));\n\t\t\t\n\t\t\t//公开日期\n\t\t\tpage.putField(\"public_date\",page.getHtml().xpath(\"//tbody/tr[7]/td[2]/span/text()\").all().get(0));\n\t\t\t\n\t\t\t//申请号\n\t\t\tpage.putField(\"patent_number\",page.getHtml().xpath(\"//tbody/tr[8]/td[2]/span/text()\").all().get(0));\n\t\t\t\n\t\t\t//公开号\n\t\t\tpage.putField(\"public_number\", page.getHtml().xpath(\"//tbody/tr[9]/td[2]/span/text()\").all().get(0));\n\t\t\t\n\t\t\t//主分类号\n\t\t\tpage.putField(\"main_type_number\",page.getHtml().xpath(\"//tbody/tr[10]/td[2]/span/text()\").all().get(0));\n\t\t\t\n\t\t\t//分类号\n\t\t\tpage.putField(\"type_number\",page.getHtml().xpath(\"//tbody/tr[11]/td[2]/span/text()\").all().get(0));\n\t\t\t\n\t\t\t//申请人\n\t\t\tpage.putField(\"apply_people\",page.getHtml().xpath(\"//tbody/tr[6]/td[4]/span/text()\").all().get(0));\n\t\t\t\n\t\t\t//发明人\n\t\t\tpage.putField(\"patent_people\",page.getHtml().xpath(\"//tbody/tr[7]/td[4]/span/text()\").all().get(0));\n\t\t\t\n\t\t\t//主申请人地址\n\t\t\tpage.putField(\"people_address\", page.getHtml().xpath(\"//tbody/tr[10]/td[4]/span/text()\").all().get(0));\n\t\t\t\n\t\t\t//省市代码\n\t\t\tpage.putField(\"city_code\", page.getHtml().xpath(\"//tbody/tr[11]/td[4]/span/text()\").all().get(0));\n\t\t}\n\t\t//n类\n\t\telse{\n\t\t\t//文摘\n\t\t\tpage.putField(\"abstract\", page.getHtml().xpath(\"//tbody/tr[2]/td[2]//*/text()\").all().get(0));\n\t\t\t\n\t\t\t//申请日期\n\t\t\tpage.putField(\"apply_date\",page.getHtml().xpath(\"//tbody/tr[3]/td[2]/text()\").all().get(0));\n\t\t\t\n\t\t\t//公开日期\n\t\t\tpage.putField(\"public_date\",page.getHtml().xpath(\"//tbody/tr[4]/td[2]/text()\").all().get(0));\n\t\t\t\n\t\t\t//申请号\n\t\t\tpage.putField(\"patent_number\", page.getHtml().xpath(\"//tbody/tr[5]/td[2]/text()\").all().get(0));\n\t\t\t\n\t\t\t//公开号\n\t\t\tpage.putField(\"public_number\", page.getHtml().xpath(\"//tbody/tr[6]/td[2]/text()\").all().get(0));\n\t\t\t\n\t\t\t//主分类号\n\t\t\tpage.putField(\"main_type_number\",page.getHtml().xpath(\"//tbody/tr[7]/td[2]/text()\").all().get(0));\n\t\t\t\n\t\t\t//分类号\n\t\t\tpage.putField(\"type_number\",page.getHtml().xpath(\"//tbody/tr[8]/td[2]/text()\").all().get(0));\n\t\t\t\n\t\t\t//申请人\n\t\t\t//如果申请人为空,则没有span标签\n\t\t\tList<String> apply=new ArrayList<String>();\n\t\t\tapply=page.getHtml().xpath(\"//tbody/tr[10]/td[2]/span/text()\").all();\n\t\t\tif(apply.size()==0)\n\t\t\t{\n\t\t\t\tpage.putField(\"apply_people\",page.getHtml().xpath(\"//tbody/tr[10]/td[2]/text()\").all().get(0));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpage.putField(\"apply_people\",apply.get(0));\n\t\t\t}\n\t\t\t\n\t\t\t//发明人\n\t\t\t//如果发明人为空,则没有span标签\n\t\t\tapply=page.getHtml().xpath(\"//tbody/tr[11]/td[2]/span/text()\").all();\n\t\t\tif(apply.size()==0)\n\t\t\t{\n\t\t\t\tpage.putField(\"patent_people\",page.getHtml().xpath(\"//tbody/tr[11]/td[2]/text()\").all().get(0));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpage.putField(\"patent_people\",apply.get(0));\n\t\t\t}\t\n\t\t}\t\n\t\t\n\t\tpage.putField(\"url\", page.getRequest().getUrl());\n//\t\tSystem.out.println(page.getResultItems().get(\"patent_name\"));\n\t}", "public void refineManualPageBuffer() throws IOException, JSONException {\n\n // parse and refine mark up\n // this.manualPageBuffer -> this.title + this.description ...\n\n String[] lines = manualPageBuffer.split(System.getProperty(\"line.separator\"));\n\n for (int i=0; i < lines.length; i++) {\n\n if (lines[i].contains(\"<h2>\")) {\n if (lines[i].contains(\"Syntax\")) {\n String syn = new String();\n\n while (!lines[i].contains(\"<pre>\")) {\n i++;\n }\n i++;\n if (lines[i].isEmpty()) {\n i++;\n }\n\n while (!lines[i].contains(\"</pre>\")) {\n syn += lines[i];\n i++;\n }\n\n this.syntax = trim(syn);\n System.out.println(\"Syntax : \" + syntax);\n\n }\n else if (lines[i].contains(\"Parameters\")) {\n\n String paramName = \"\";\n String paramInOut = \"\";\n String paramDescription = \"\";\n\n\n\n // TODO retrieve from markup\n\n JsonObject parameters = Json.createObjectBuilder()\n .add(\"name\", paramName)\n .add(\"inout\", paramInOut)\n .add(\"description\", paramDescription)\n .build();\n }\n\n // reference http://www.java2s.com/Tutorials/Java/JSON/0100__JSON_Java.htm\n\n ArrayList<JsonObject> parameters = new ArrayList<JsonObject>();\n\n this.parameters = parameters;\n System.out.println(\"Parameters : \" + this.parameters.toString());\n\n }\n\n\n else if (lines[i].contains(\"Return value\")) {\n\n }\n else if (lines[i].contains(\"Requirements\")) {\n\n }\n else if (lines[i].toLowerCase().contains(\"example\")) {\n\n }\n else if (lines[i].contains(\"See also\")) {\n\n }\n System.out.println(lines[i]);\n }\n\n }", "@Test\n\tpublic void probandoConParser() {\n\t\tString dBoxUrl = \"/home/julio/Dropbox/julio_box/educacion/maestria_explotacion_datos_uba/materias/cuat_4_text_mining/material/tp3/\";\n\t\tString modelUrl = dBoxUrl + \"NER/models/es-ner-person.bin\";\n\t\tString filesUrl = dBoxUrl + \"NER/archivoPrueba\";\n\t\tString sampleFile = filesUrl + \"/viernes-23-05-14-alan-fitzpatrick-gala-cordoba.html\";\n\t\tList<String> docs = getMyDocsFromSomewhere(filesUrl);\n\n\t\ttry {\n\t\t\t// detecting the file type\n\t\t\tBodyContentHandler handler = new BodyContentHandler();\n\t\t\tMetadata metadata = new Metadata();\n\t\t\tFileInputStream inputstream = new FileInputStream(new File(sampleFile));\n\t\t\tParseContext pcontext = new ParseContext();\n\n\t\t\t// Html parser\n\t\t\tHtmlParser htmlparser = new HtmlParser();\n\t\t\thtmlparser.parse(inputstream, handler, metadata, pcontext);\n\t\t\tSystem.out.println(\"Contents of the document:\" + handler.toString());\n\t\t\tSystem.out.println(\"Metadata of the document:\");\n\t\t\tString[] metadataNames = metadata.names();\n\n\t\t\tfor (String name : metadataNames) {\n\t\t\t\tSystem.out.println(name + \": \" + metadata.get(name));\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tAssert.fail();\n\t\t}\n\n\t}", "public static void preprocessWikipediaInformation(LocationDataIO locationData) {\n\t\ttry {\n\t\t\tSAXParserFactory factory = SAXParserFactory.newInstance();\n\t\t\tfactory.setFeature(\"http://xml.org/sax/features/validation\", false);\n\t\t\tfactory.setFeature(\"http://apache.org/xml/features/continue-after-fatal-error\", true);\n\t\t\tfactory.setFeature(\"http://apache.org/xml/features/continue-after-fatal-error\", true);\n\t\t\tSAXParser parser = factory.newSAXParser();\n\n\t\t\tIterator<POI> iter = locationData.getPOIs().iterator();\n\t\t\twhile (iter.hasNext()) {\n\t\t\t\tPOI current = iter.next();\n\t\t\t\tif (current.getURL() != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tSystem.out.print(current.getName());\n\t\t\t\t\t\tURL url = current.getURL();\n\t\t\t\t\t\tURLConnection connection = url.openConnection();\n\t\t\t\t\t\tconnection.connect();\n\t\t\t\t\t\tInputSource input = new InputSource(connection.getInputStream());\n\t\t\t\t\t\tString lang = current.getURL().toExternalForm();\n\t\t\t\t\t\tif (lang.length() > 9 && lang.substring(7, 9).matches(\"[a-zA-Z]{2}\")) {\n\t\t\t\t\t\t\tlang = lang.substring(7, 9);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlang = \"de\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tWikipediaHandler handler = new WikipediaHandler(lang);\n\n\t\t\t\t\t\tparser.parse(input, handler);\n\t\t\t\t\t\tcurrent.setTextInfo(handler.getFirstParagraphs());\n\t\t\t\t\t\tcurrent.setURL(handler.getImageURL());\n\t\t\t\t\t\tSystem.out.print(\" ✓\\n\");\n\t\t\t\t\t} catch (SAXException e) {\n\t\t\t\t\t\tlogger.info(String.format(\"Schwerwiegender Syntaxfehler in %s! Wird ignoriert.\", current.getURL().toExternalForm()));\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tlogger.info(current.getURL().toExternalForm() + \" konnte nicht gelesen werden! Wird ignoriert.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (ParserConfigurationException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SAXNotRecognizedException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SAXNotSupportedException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SAXException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@SuppressWarnings(\"static-method\")\n\tprotected ReferenceContext extractReferencableElements(String text) {\n\t\tfinal ReferenceContext context = new ReferenceContext();\n\n\t\t// Visit the links and record the transformations\n\t\tfinal MutableDataSet options = new MutableDataSet();\n\t\tfinal Parser parser = Parser.builder(options).build();\n\t\tfinal Node document = parser.parse(text);\n\t\tfinal Pattern pattern = Pattern.compile(SECTION_PATTERN_AUTONUMBERING);\n\t\tNodeVisitor visitor = new NodeVisitor(\n\t\t\t\tnew VisitHandler<>(Paragraph.class, it -> {\n\t\t\t\t\tfinal CharSequence paragraphText = it.getContentChars();\n\t\t\t\t\tfinal Matcher matcher = pattern.matcher(paragraphText);\n\t\t\t\t\tif (matcher.find()) {\n\t\t\t\t\t\tfinal String number = matcher.group(2);\n\t\t\t\t\t\tfinal String title = matcher.group(3);\n\t\t\t\t\t\tfinal String key1 = computeHeaderId(number, title);\n\t\t\t\t\t\tfinal String key2 = computeHeaderId(null, title);\n\t\t\t\t\t\tcontext.registerSection(key1, key2, title);\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\tvisitor.visitChildren(document);\n\n\t\tfinal Pattern pattern1 = Pattern.compile(SECTION_PATTERN_TITLE_EXTRACTOR_WITHOUT_MD_PREFIX);\n\t\tvisitor = new NodeVisitor(\n\t\t\t\tnew VisitHandler<>(Heading.class, it -> {\n\t\t\t\t\tString key = it.getAnchorRefId();\n\t\t\t\t\tString title = it.getText().toString();\n\t\t\t\t\t// Sometimes, the title already contains the section number.\n\t\t\t\t\t// It should be removed.\n\t\t\t\t\tfinal Matcher matcher = pattern1.matcher(title);\n\t\t\t\t\tif (matcher.find()) {\n\t\t\t\t\t\tfinal String number = matcher.group(1);\n\t\t\t\t\t\ttitle = matcher.group(2);\n\t\t\t\t\t\tif (Strings.isEmpty(key)) {\n\t\t\t\t\t\t\tkey = computeHeaderId(number, title);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfinal String key2 = computeHeaderId(null, title);\n\t\t\t\t\tif (Strings.isEmpty(key)) {\n\t\t\t\t\t\tkey = key2;\n\t\t\t\t\t}\n\t\t\t\t\tcontext.registerSection(key, key2, title);\n\t\t\t\t}));\n\t\tvisitor.visitChildren(document);\n\n\t\treturn context;\n\t}", "private LazyPreprocessedPage preprocess(\n\t PageTitle title,\n\t String validatedWikitext,\n\t boolean forInclusion,\n\t EntityMap entityMap,\n\t ContentNode parentLog)\n\t throws CompilerException\n\t{\n\t\tPreprocessorLog log = new PreprocessorLog();\n\t\tparentLog.getContent().add(log);\n\t\t\n\t\tlog.setForInclusion(forInclusion);\n\t\t\n\t\tStopWatch stopWatch = new StopWatch();\n\t\tstopWatch.start();\n\t\t\n\t\ttry\n\t\t{\n\t\t\tLazyPreprocessor preprocessor = new LazyPreprocessor(wikiConfig);\n\t\t\t\n\t\t\tLazyPreprocessedPage preprocessedAst =\n\t\t\t (LazyPreprocessedPage) preprocessor.parseArticle(\n\t\t\t validatedWikitext,\n\t\t\t title.getFullTitle(),\n\t\t\t forInclusion);\n\t\t\t\n\t\t\treturn preprocessedAst;\n\t\t}\n\t\tcatch (xtc.parser.ParseException e)\n\t\t{\n\t\t\tlog.getContent().add(new ParseException(e.getMessage()));\n\t\t\t\n\t\t\tthrow new CompilerException(\"Preprocessing failed!\", e);\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tlogger.error(\"Preprocessing failed!\", e);\n\t\t\t\n\t\t\tStringWriter w = new StringWriter();\n\t\t\te.printStackTrace(new PrintWriter(w));\n\t\t\tlog.getContent().add(new UnhandledException(e, w.toString()));\n\t\t\t\n\t\t\tthrow new CompilerException(\"Preprocessing failed!\", e);\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tstopWatch.stop();\n\t\t\tlog.setTimeNeeded(stopWatch.getElapsedTime());\n\t\t}\n\t}", "@Override\n\tpublic void process(Page page){\n\n\t CollectTemplate collectTemplate = templateService.getCollectTemplateById(templateId);\n\t String currentUrl=page.getUrl().toString();\n\t String nextUrlXpath=collectTemplate.getNextUrlXpath();\n \tString contentUrlXpath=collectTemplate.getContentUrlXpath();\n \tString listUrlRegex=collectTemplate.getListUrlRegex();\n \tString contentUrlRegex=collectTemplate.getContentUrlRegex();\n \tList<CollectTemplateField> fields=collectTemplate.getFields();\n \ttry {\n\t \t\t\n\t \tHtml currentHtml= page.getHtml();\n\n\t\t\t//判断是否是列表页\n\t if (currentUrl.matches(listUrlRegex)) {\n\n\t\t\t\t//处理列表页\n\t\t\t\tString nextPageUrl=\"\";\n\t\t\t\ttry{\n\t\t\t\t\tnextPageUrl=currentHtml.xpath(nextUrlXpath).toString();\n\t\t\t\t\tif (nextPageUrl==null||StringUtils.isEmpty(nextPageUrl)){\n\t\t\t\t\t\tthrow new Exception();\n\t\t\t\t\t}\n\t\t\t\t}catch (Exception e){\n\t\t\t\t\tXpath2Selector xpath2Selector = new Xpath2Selector(nextUrlXpath);\n\t\t\t\t\tnextPageUrl = xpath2Selector.select(page.getRawText());\n\n\t\t\t\t\tif (nextPageUrl!=null&&nextPageUrl.startsWith(\"/\")){\n\t\t\t\t\t\tnextPageUrl = \"http://\"+site.getDomain()+nextPageUrl;\n\t\t\t\t\t}\n\n\n\t\t\t\t}\n\n\t \tif (StringUtils.isNotEmpty(nextPageUrl)) {\n\n\t \t\tRequest request=new Request();\n\t \t\trequest.setUrl(nextPageUrl);\n\t \t\trequest.setPriority(-1);\n\t \t\t\n\t \t\tpage.addTargetRequest(request);\n\n\t \t\tlogService.info(projectId,\"get the next page link \"+nextPageUrl+\" and add it to the queue\");\n\n\t\t\t\t}else{\n\t\t\t\t\tlogService.warn(projectId,\"fail to get the next page link\");\n\n\t\t\t\t}\n\t \tList<String> detailPagesUrl;\n\t \ttry{\n\t\t\t\t\tdetailPagesUrl = currentHtml.xpath(contentUrlXpath).all();\n\n\t\t\t\t}catch (Exception e){\n\n\t\t\t\t\tXpath2Selector xpath2Selector2 = new Xpath2Selector(contentUrlXpath);\n\t\t\t\t\tdetailPagesUrl = xpath2Selector2.selectList(currentHtml.getDocument().text());\n\t\t\t\t}\n\n\n\n\t \tif (detailPagesUrl!=null&&detailPagesUrl.size()!=0) {\n\t\t\t\t\t//添加详情页\n\t\t\t\t\tpage.addTargetRequests(detailPagesUrl, 1);\n\n\t\t\t\t\tlogService.info(projectId,\"get \"+detailPagesUrl.size()+\" detail pages\");\n\t\t\t\t}else{\n\t\t\t\t\tlogService.warn(projectId,\"fail to get detail page\");\n\n\t\t\t\t}\n\t\t\t}else if (StringUtils.isEmpty(contentUrlRegex)||currentUrl.matches(contentUrlRegex)) {\n\t \t//处理详情页\n\t\t\t\tcontentPageProcessService.setProjectId(projectId);\n\t\t\t\tcontentPageProcessService.progressContentPage(page,fields);\n\t\t\t}\n\t \t} catch (Exception e) {\n\t\t\t\tSystem.out.println(e);\n\t\t\t}\n\t \n\t }", "public HTMLParser () {\r\n this.pagepart = null;\r\n }", "@Override\n public void unpackMarkup(Document doc, RepositioningInfo repInfo,\n RepositioningInfo ampCodingInfo) throws DocumentFormatException {\n if((doc == null)\n || (doc.getSourceUrl() == null && doc.getContent() == null)) {\n\n throw new DocumentFormatException(\n \"GATE document is null or no content found. Nothing to parse!\"); }// End\n // if\n\n // Create a status listener\n StatusListener statusListener = new StatusListener() {\n @Override\n public void statusChanged(String text) {\n // This is implemented in DocumentFormat.java and inherited here\n fireStatusChanged(text);\n }\n };\n\n // determine whether we have a GATE format document or not\n /*String content = doc.getContent().toString();\n if(content.length() > 2048) {\n content = content.substring(0, 2048);\n }*/\n boolean gateFormat = isGateFIFormat(doc);\n \n\n if(gateFormat) {\n unpackGateFormatMarkup(doc, statusListener);\n } else {\n unpackGeneralXmlMarkup(doc, repInfo, ampCodingInfo, statusListener);\n }\n }", "public void parseForm()\n {\n if (mForm.gotoRoot().gotoTag(\"h:head/%1$s:model\", mDefaultPrefix).hasTag(\"%1$s:itext\", mDefaultPrefix)) {\n Log.d(Collect.LOGTAG, t + \"parsing itext form translations...\");\n parseFormTranslations(mForm.gotoRoot().gotoTag(\"h:head/%1$s:model/%1$s:itext\", mDefaultPrefix));\n } else\n Log.d(Collect.LOGTAG, t + \"no form translations to parse\"); \n \n Log.d(Collect.LOGTAG, t + \"parsing form binds...\");\n parseFormBinds(mForm.gotoRoot().gotoTag(\"h:head/%1$s:model\", mDefaultPrefix));\n \n Log.d(Collect.LOGTAG, t + \"parsing form controls...\");\n parseFormControls(mForm.gotoRoot().gotoTag(\"h:body\"));\n \n Log.d(Collect.LOGTAG, t + \"parsing form instance...\");\n parseFormInstance(mForm.gotoRoot().gotoTag(\"h:head/%1$s:model/%1$s:instance\", mDefaultPrefix).gotoChild(), \"/\" + mInstanceRoot);\n Log.d(Collect.LOGTAG, t + \"FINISHED parsing form instance\");\n }", "private void parseEntities() {\n // See: https://github.com/twitter/twitter-text/tree/master/java\n entities.addExtractedEntities(TweetEntityAbstract.entitiesExtractor.extractCashtagsWithIndices(getText()));\n entities.addExtractedEntities(TweetEntityAbstract.entitiesExtractor.extractHashtagsWithIndices(getText()));\n entities.addExtractedEntities(TweetEntityAbstract.entitiesExtractor.extractMentionedScreennamesWithIndices(getText()));\n }", "@Override\n public void visit(Page page) {\n String url = page.getWebURL().getURL();\n System.out.println(\"URL: \" + url);\n\n try {\n if (page.getParseData() instanceof HtmlParseData) {\n HtmlParseData htmlParseData = (HtmlParseData) page.getParseData();\n\n final Document document = Jsoup.parse(htmlParseData.getHtml());\n\n Transformer transformer = TransformerFactory.newInstance()\n .newTransformer(new StreamSource(getClass().getResourceAsStream(xslPath)));\n\n Writer write = new StringWriter();\n transformer.transform(new DOMSource(new W3CDom().fromJsoup(document)), new StreamResult(write));\n\n String xml = write.toString();\n\n // XML 1.1\n // [#x1-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]\n String xml11pattern = \"[^\"\n + \"\\u0001-\\uD7FF\"\n + \"\\uE000-\\uFFFD\"\n + \"\\ud800\\udc00-\\udbff\\udfff\"\n + \"]+\";\n\n // remove invalid character in xml\n xml = xml.replaceAll(xml11pattern, \"\");\n\n JAXBContext jc = JAXBContext.newInstance(ProxyListDTO.class);\n\n Unmarshaller unmarshaller = jc.createUnmarshaller();\n ProxyListDTO data = (ProxyListDTO) unmarshaller.unmarshal(new StringReader(xml));\n data.getProxies().forEach(p -> p.setSource(source));\n\n\n result.addAll(data.getProxies());\n }\n } catch (Exception e) {\n logger.error(\"fail to visit \" + url, e);\n }\n }", "public void prepareForFeaturesAndOrderCollection() throws Exception {\n\n LOG.info(\" - Preparing phrases...\");\n readPhrases(false);\n collectNumberProps(m_srcPhrs, m_trgPhrs, true, true); \n collectTypeProp(m_srcPhrs, m_trgPhrs); \n\n collectContextEqs();\n prepareSeedDictionary(m_contextSrcEqs, m_contextTrgEqs);\n prepareTranslitDictionary(m_contextSrcEqs);\n filterContextEqs();\n\n collectContextAndTimeProps(m_srcPhrs, m_trgPhrs);\n collectOrderProps(m_srcPhrs, m_trgPhrs);\n }", "private void parsePageForNewLines() {\n\t\tArrayList<String> escapeOpenText = new ArrayList<String>();\n\t\tArrayList<String> escapeCloseText = new ArrayList<String>();\n\t\tescapeOpenText.add(\"<!--\");\n\t\tescapeCloseText.add(\"-->\");\n\n\t\tfor (int i = 0; i != -1; i = rawText.indexOf('\\n', i+1)) {\n\t\t\tif (isPositionParsedAsMediawiki(i, escapeOpenText, escapeCloseText)) {\n\t\t\t\tlinePositions.add(i);\n\t\t\t}\n\t\t}\n\t}", "public void step2(String theHTML)\n {\n this.messageReceiver2.receiveMessage(targetKeyWords+\":initializing the pattern matcher.....\\n\");\n\t patternMatcher=new PatternMatcher();\n\t\tpatternMatcher.output=messageArea;\n//\t\tpatternMatcher.init(theHTML,\".:;<> !#$%&()=^+*/\\\"@[]{}\\n\\r\");\n\t\tpatternMatcher.init(theHTML);\n\t\tthis.tokens=patternMatcher.getTokens();\n\t\tint i;\n\t\tint l=patternMatcher.sequenceLength;\n//\t\tresultArea.setText(\"contents of this page was tokenized.\\n\");\n }", "private void inToTrinhv3(HttpServletRequest request, HttpServletResponse reponse, GiaHanForm giaHanForm, ApplicationContext appConText) throws Exception {\r\n\r\n\t\tString fileIn = request.getRealPath(\"/docin\") + \"\\\\TTNB10.doc\";\r\n\t\tString fileOut = request.getRealPath(\"/docout\") + \"\\\\TTNB10_Out\" + System.currentTimeMillis() + request.getSession().getId() + \".doc\";\r\n\r\n\t\tString fileTemplate = null;\r\n\t\tfileTemplate = \"ttnb10\"; // (ngon, chuan)\r\n\t\tString idCuocTtkt = giaHanForm.getIdCuocTtKt();\r\n\t\tTtktKhCuocTtkt cuocTtkt = CuocTtktService.getCuocTtktWithoutNoiDung(appConText, idCuocTtkt);\r\n\r\n\t\tTtktCbQd cbQd = TtktService.getQuyetDinh(idCuocTtkt, appConText);\r\n\t\tString hinhThuc = (cuocTtkt.getHinhThuc().booleanValue()) ? \"ki\\u1EC3m tra\" : \"thanh tra\";\r\n\t\tStringBuffer sb = new StringBuffer(hinhThuc);\r\n\r\n\t\tMsWordUtils word = new MsWordUtils(fileIn, fileOut);\r\n\t\ttry {\r\n\t\t\tword.put(\"[ten_cqt]\", KtnbUtil.getTenCqtCapTrenTt(appConText).toUpperCase());\r\n\t\t\t// hinh thuc thanh tra kiem tra\r\n\t\t\tif (Formater.isNull(giaHanForm.getSoQd())) {\r\n\t\t\t\tsb.append(\" Q\\u0110 S\\u1ED0......\");\r\n\t\t\t} else {\r\n\t\t\t\tsb.append(\" Q\\u0110 S\\u1ED0 \" + giaHanForm.getSoQd());\r\n\t\t\t}\r\n\t\t\tword.put(\"[doan_ttkt_so]\", sb.toString().toUpperCase());\r\n\r\n\t\t\tword.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[dv_dc_ttkt]\", cuocTtkt.getTenDonViBi());\r\n\t\t\tword.put(\"[thu_truong_cqt_ra_qd]\", KtnbUtil.getTenThuTruongCqtForMauin(appConText).toUpperCase());\r\n\t\t\tword.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tif (Formater.isNull(cbQd.getSoQuyetDinh())) {\r\n\t\t\t\tword.put(\"[qd_so]\", \"............\");\r\n\t\t\t} else {\r\n\t\t\t\tword.put(\"[qd_so]\", cbQd.getSoQuyetDinh());\r\n\t\t\t}\r\n\r\n\t\t\tString ngayxet = Formater.date2str(cbQd.getNgayRaQuyetDnh());\r\n\t\t\tString[] arrngayxet = ngayxet.split(\"/\");\r\n\t\t\tword.put(\"[ngay_qd]\", \"ng\\u00E0y \" + arrngayxet[0] + \" th\\u00E1ng \" + arrngayxet[1] + \" n\\u0103m \" + arrngayxet[2]);\r\n\t\t\tword.put(\"[thu_truong_cqt]\", KtnbUtil.getTenThuTruongCqtForMauin(appConText));\r\n\t\t\tword.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[dv_dc_ttkt]\", cuocTtkt.getTenDonViBi());\r\n\r\n\t\t\tword.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[dv_dc_ttkt]\", cuocTtkt.getTenDonViBi().toString());\r\n\t\t\tword.put(\"[ngay_lv]\", giaHanForm.getSoNgayRaHan());\r\n\t\t\tString tungay = giaHanForm.getRaHanTuNgay();\r\n\t\t\tString[] arrtungay = tungay.split(\"/\");\r\n\t\t\tword.put(\"[tu_ngay]\", \"ng\\u00E0y \" + arrtungay[0] + \" th\\u00E1ng \" + arrtungay[1] + \" n\\u0103m \" + arrtungay[2]);\r\n\t\t\t// den ngay\r\n\t\t\tString denngay = giaHanForm.getRaHanDenNgay();\r\n\t\t\tString[] arrdenngay = denngay.split(\"/\");\r\n\t\t\tword.put(\"[den_ngay]\", \"ng\\u00E0y \" + arrdenngay[0] + \" th\\u00E1ng \" + arrdenngay[1] + \" n\\u0103m \" + arrdenngay[2]);\r\n\t\t\tword.put(\"[ly_do]\", giaHanForm.getLyDoRaHan());\r\n\t\t\tword.put(\"[thu_truong_cqt_ra_qd]\", KtnbUtil.getTenThuTruongCqtForMauin(appConText).toUpperCase());\r\n\t\t\tword.put(\"[noi_duyet]\", giaHanForm.getNoiPheDuyet());\r\n\t\t\t// ngay duyet\r\n\t\t\tString ngayduyet = giaHanForm.getNgayPheDuyet();\r\n\t\t\tString[] arrngayduyet = ngayduyet.split(\"/\");\r\n\t\t\tif (arrngayduyet.length >= 2) {\r\n\t\t\t\tword.put(\"[ngay_duyet]\", \"ng\\u00E0y \" + arrngayduyet[0] + \" th\\u00E1ng \" + arrngayduyet[1] + \" n\\u0103m \" + arrngayduyet[2]);\r\n\t\t\t}\r\n\t\t\tword.put(\"[noi_lap]\", giaHanForm.getNoiTrinh());\r\n\t\t\t// ngay lap to trinh\r\n\t\t\tString ngaylaptotrinh = giaHanForm.getNgayTrinh();\r\n\t\t\tString[] arrngaylaptotrinh = ngaylaptotrinh.split(\"/\");\r\n\t\t\tif (arrngaylaptotrinh.length >= 2) {\r\n\t\t\t\tword.put(\"[ngay_lap_to_trinh]\", \"ng\\u00E0y \" + arrngaylaptotrinh[0] + \" th\\u00E1ng \" + arrngaylaptotrinh[1] + \" n\\u0103m \" + arrngaylaptotrinh[2]);\r\n\t\t\t}\r\n\t\t\tword.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[y_kien_phe_duyet]\", giaHanForm.getKienPheDuyet());\r\n\t\t\tword.put(\"[ten_truong_doan]\", cuocTtkt.getTenTruongDoan());\r\n\t\t\tword.put(\"[chuc_danh_thu_truong]\", KtnbUtil.getChucVuThuTruongByMaCqt(appConText.getMaCqt()).toUpperCase());\r\n\t\t\t// if (Formater.isNull(appConText.getTenThuTruong())) {\r\n\t\t\t// word.put(\"[ten_thu_truong]\", \"\");\r\n\t\t\t// } else {\r\n\t\t\t// word.put(\"[ten_thu_truong]\", appConText.getTenThuTruong());\r\n\t\t\t// }\r\n\t\t\tword.saveAndClose();\r\n\t\t\tword.downloadFile(fileOut, \"Mau TTNB10\", \".doc\", reponse);\r\n\t\t} catch (Exception ex) {\r\n\t\t\t// ex.printStackTrace();\r\n\t\t\tSystem.out.println(\"Download Error: \" + ex.getMessage());\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tword.saveAndClose();\r\n\t\t\t} catch (Exception e) {\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void run() {\n try {\r\n TransformerFactory tFactory = TransformerFactory.newInstance();\r\n // Fortify Mod: prevent external entity injection\r\n tFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);\r\n Transformer transformer = tFactory.newTransformer();\r\n transformer.setOutputProperty(\"encoding\", \"UTF-8\");\r\n transformer.setOutputProperty(\"indent\", \"yes\");\r\n transformer.transform(new DOMSource(doc), new StreamResult(\r\n pos));\r\n } catch (Exception e) {\r\n throw new RuntimeException(\r\n \"Error converting Document to InputStream. \"\r\n + e.getMessage());\r\n } finally {\r\n try {\r\n pos.close();\r\n } catch (IOException e) {\r\n\r\n }\r\n }\r\n }", "String extractContentFromDocument(BotswanaCourtDocument bcd, String htmlfile,int startpage,int endpage){\n\t\t//dom tree structured in two formats example for 1st format(47-98) USA.1947.002 and for 2nd format(1998.25 - 2013) USA.2000.003\n\t\tDocument document = null;\n\t\tFile input = new File(htmlfile);\n\t\tString textContent = null;\n\t \t\n\t\tif( htmlfile == null ){\n\t\t\tSystem.out.println(\"File name is not valid\");\n\t\t}\n\t\telse{\n\t\t\ttry{\n\t\t\t\tdocument = Jsoup.parse(input,\"UTF-8\");\n\t\t\t\tString htmlText = document.body().toString();\n\t\t\t\tString textToBeExtracted = document.select(\"title\").text();\n\t \tSystem.out.println(\"text extracted =\"+textToBeExtracted);\n\t \t\n\t \t\n\t \tPattern pattern = Pattern.compile(\"\\\\((.*?)\\\\)\");\n\t \tMatcher matcher = pattern.matcher(textToBeExtracted);\n\t \tArrayList<String> matchedDataArray = new ArrayList<String>();\n\t \twhile(matcher.find()){\n\t \t\tmatchedDataArray.add(matcher.group());\n\t \t}\n\t \tif(matchedDataArray.size()>0){\n\t \t\tint firstIndex = textToBeExtracted.indexOf(matchedDataArray.get(matchedDataArray.size()-2)); \n\t\t \tif(firstIndex == -1){\n\t\t \t\tbcd.setParticipantsName(textToBeExtracted);\n\t\t \t}\n\t\t \telse{\n\t\t \t\tbcd.setParticipantsName(textToBeExtracted.substring(0,firstIndex-1));\n\t\t \t}\n\t\t \tbcd.setDecisionDate( matchedDataArray.get(matchedDataArray.size()-1));\n\t\t \tbcd.setCaseId(matchedDataArray.get(matchedDataArray.size()-2));\n\t\t \t\n\t \t}\n\t \telse{\n\t \t\tbcd.setParticipantsName(textToBeExtracted);\n\t \t\tbcd.setDecisionDate(\"\");\n\t\t \tbcd.setCaseId(\"\");\n\t \t}\n\t \t\n//\t \tint indexOfParticipantsEnd = textToBeExtracted.indexOf(\"[\");\n//\t \tString participantsName = textToBeExtracted.substring(0,indexOfParticipantsEnd-1);\n//\t \tbcd.setParticipantsName(participantsName);\n//\t \t\n//\t \tint indexOfDateStart = textToBeExtracted.indexOf(\"(\");\n//\t \tint indexOfDateEnd = textToBeExtracted.indexOf(\")\");\n//\t \tString decideDate = textToBeExtracted.substring(indexOfDateStart+1, indexOfDateEnd-1);\n//\t \tbcd.setDecisionDate(decideDate);\n//\t \t\n//\t \t\n//\t \tString caseIDPatternString = \"SC ([0-9]+/[0-9]+|CRI [0-9]+/[0-9]+)\";\n//\t \tPattern caseidPattern = Pattern.compile(caseIDPatternString);\n//\t \tMatcher caseidMatcher = caseidPattern.matcher(htmlText);\n//\t \t\n//\t \tString caseID =\"\";\n//\t \twhile (caseidMatcher.find()) {\n//\t \t\tcaseID = caseidMatcher.group();\n//\t \t \n//\t \t}\n//\t \tbcd.setCaseId(caseID);\n\t \t\n\t \ttextContent = htmlText;\n\t \t\n\t \t\n\t \t}\n\t \tcatch(Exception e){\n\t \t\tSystem.out.println(\"Error in parsing html : \" + e.getMessage());\n\t \t}\n\t\t}\n\t\treturn textContent;\n\t}", "public static void main (String[] args) {\r\n try {\r\n BufferedReader in = new BufferedReader(\r\n new InputStreamReader(\r\n new FileInputStream(new File(\"D:\\\\bitext.html\")), \"UTF-8\"));\r\n\r\n String s;\r\n StringBuffer b = new StringBuffer();\r\n while( (s = in.readLine()) != null) {\r\n b.append(s );\r\n }\r\n String page= b.toString();\r\n HTMLParser parser = new HTMLParser(page.getBytes(\"UTF-8\"));\r\n //parser.getTagValue (\"meta\");\r\n //System.out.println();\r\n\r\n System.out.println(parser.htmlParsing (false, null, null, false));\r\n //System.out.println(htmlParsing (page3, \"euc-kr\"));\r\n\r\n\r\n } catch (Throwable t) {\r\n t.printStackTrace ();\r\n }\r\n }", "public ProcessPage() {\n\t\tPageFactory.initElements(driver, this);\n\t\t \n\n\t}", "@Before\n\tpublic void setUp() throws Exception {\n\t\tList<Paragraph> paragraphs = new ArrayList<Paragraph>();\n\t\tList<Paragraph> paragraphsWithNoSentences = new ArrayList<Paragraph>();\n\t\t\n\t\tScanner sc = null, sc1 = null;\n\t\ttry {\n\t\t\tsc = new Scanner(new File(\"testsearchtext.txt\"));\n\t\t\tsc1 = new Scanner(new File(\"testsearchentity.txt\"));\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tsc.useDelimiter(\"[.]\");\n\t\tsc1.useDelimiter(\"[|]\");\n\t\t\n\t\tList<Sentence> sentences = new ArrayList<Sentence>();\n\t\tint sCount = 0;\n\t\tint pCount = 0;\n\t\twhile(sc.hasNext()){\n\t\t\tString temp = sc.next().trim();\n\n\t\t\tif(sCount > 0 && (sCount%10 == 0 || !sc.hasNext())){\n\t\t\t\tParagraph p = new Paragraph(pCount);\n\t\t\t\tparagraphsWithNoSentences.add(p);\n\t\t\t\t\n\t\t\t\tp = new Paragraph(pCount);\n\t\t\t\tp.setSentences(sentences);\n\t\t\t\tparagraphs.add(p);\n\t\t\t\tpCount++;\n\t\t\t\t\n\t\t\t\tsentences = new ArrayList<Sentence>();\n\t\t\t}\n\t\t\t\n\t\t\tif(!temp.equals(\"\"))\n\t\t\t\tsentences.add(new Sentence((sCount%10), temp));\n\t\t\t\n\t\t\tsCount++;\n\t\t}\n\t\t\n\t\tList<Entity> entities = new ArrayList<Entity>();\n\t\tint currType = -1; \n\t\twhile(sc1.hasNext()){\n\t\t\tString temp = sc1.next().trim();\n\t\t\tif(temp.equals(\"place\")){currType = Entity.PLACE;} else\n\t\t\tif(temp.equals(\"url\")){currType = Entity.URL;} else\n\t\t\tif(temp.equals(\"email\")){currType = Entity.EMAIL;} else\n\t\t\tif(temp.equals(\"address\")){currType = Entity.ADDRESS;} \n\t\t\telse{\n\t\t\t\tentities.add(new Entity(currType, temp));\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tSource s = new Source(\"testsearchtext.txt\", \"testsearchtext.txt\");\n\t\tpt1 = new ProcessedText(s, paragraphs, null); \n\t\t\n\t\ts = new Source(\"testsearchtext1.txt\", \"testsearchtext1.txt\");\n\t\tpt2 = new ProcessedText(s, paragraphsWithNoSentences, null); \n\t\t\n\t\tpt3 = new ProcessedText();\n\t\tpt3.setParagraphs(paragraphs);\n\t\t\n\t\tpt4 = new ProcessedText();\n\t\ts = new Source(\"testsearchtext2.txt\", \"testsearchtext2.txt\");\n\t\tpt4.setMetadata(s);\n\t\t\n\t\ts = new Source(\"testsearchtext3.txt\", \"testsearchtext3.txt\");\n\t\tpt5 = new ProcessedText(s, paragraphs, entities); \n\t\t\n\t\ts = new Source(\"testsearchtext4.txt\", \"testsearchtext4.txt\");\n\t\tpt6 = new ProcessedText(s, null, entities); \n\t}", "public static List<Page> processPDF(byte[] theFile, PageProcessor pp,\n int startPage, int endPage, String encoding, String password,\n List<AdjacencyGraph<GenericSegment>> adjGraphList, boolean GUI)\n throws DocumentProcessingException\n {\n\n\n boolean toConsole = false;\n if (password == null)\n password = \"\";\n if (encoding == null || encoding == \"\")\n encoding = DEFAULT_ENCODING;\n\n if (startPage == 0)\n startPage = 1;\n if (endPage == 0)\n endPage = Integer.MAX_VALUE;\n\n ByteArrayInputStream inStream = new ByteArrayInputStream(theFile);\n PDDocument document = null;\n\n try {\n\n PDFObjectExtractor extractor = new PDFObjectExtractor();\n// PDDocument document = null;\n document = PDDocument.load( inStream );\n // document.print();\n if( document.isEncrypted() )\n {\n try\n {\n document.decrypt( password );\n }\n catch( InvalidPasswordException e )\n {\n if(!(password == null || password == \"\"))//they supplied the wrong password\n {\n throw new DocumentProcessingException\n (\"Error: The supplied password is incorrect.\");\n }\n else\n {\n //they didn't suppply a password and the default of \"\" was wrong.\n throw new DocumentProcessingException\n ( \"Error: The document is encrypted.\" );\n }\n } catch (CryptographyException e) {\n throw new DocumentProcessingException(e);\n }\n }\n\n extractor.setStartPage( startPage );\n extractor.setEndPage( endPage );\n // stripper.writeText( document, output );\n\n List<PDFPage> thePages = extractor.findObjects(document);\n List<Page> theResult = new ArrayList<Page>();\n\n startPage = extractor.getStartPage();\n endPage = extractor.getEndPage();\n\n // now the DU part\n\n Iterator<PDFPage> pageIter = thePages.iterator();\n int currentPage = -1;\n while(pageIter.hasNext())\n {\n currentPage ++;\n PDFPage thePage = pageIter.next();\n\n Page resultPage = pp.processPage(thePage);\n theResult.add(resultPage);\n if (adjGraphList != null)\n adjGraphList.add(pp.getAdjGraph());\n\n }\n\n // 17.11.10 document-wide processing for headers, footers, etc.\n if (!GUI)\n theResult = pp.processDocPages(theResult, null);\n\n // move to finally block somewhere?\n if( document != null )\n {\n document.close();\n }\n return theResult;\n }\n catch (IOException e)\n {\n e.printStackTrace();\n throw new DocumentProcessingException(e);\n }\n\n }", "protected void doAdditionalPageInitialization(IPage page) {\n }", "public void run()\n {\n mkdStack = translateMacroStack(mkdStack);\n //translate mkd to html\n translateMkdToHtml();\n //send html string to global variable\n Compiler.htmlString = htmlStackToString();\n }", "private void inToTrinhv4(HttpServletRequest request, HttpServletResponse reponse, GiaHanForm giaHanForm, ApplicationContext appConText) throws Exception {\r\n\r\n\t\tString fileIn = request.getRealPath(\"/docin/v4\") + \"\\\\TTNB10.doc\";\r\n\t\tString fileOut = request.getRealPath(\"/docout\") + \"\\\\TTNB10_Out\" + System.currentTimeMillis() + request.getSession().getId() + \".doc\";\r\n\r\n\t\tString fileTemplate = null;\r\n\t\tfileTemplate = \"ttnb10\"; // (ngon, chuan)\r\n\t\tString idCuocTtkt = giaHanForm.getIdCuocTtKt();\r\n\t\tTtktKhCuocTtkt cuocTtkt = CuocTtktService.getCuocTtktWithoutNoiDung(appConText, idCuocTtkt);\r\n\r\n\t\tTtktCbQd cbQd = TtktService.getQuyetDinh(idCuocTtkt, appConText);\r\n\t\tString hinhThuc = (cuocTtkt.getHinhThuc().booleanValue()) ? \"ki\\u1EC3m tra\" : \"thanh tra\";\r\n\t\tString hinhthuc_in = (cuocTtkt.getHinhThuc().booleanValue()) ? \"KI\\u1EC2M TRA\" : \"THANH TRA\";\r\n\t\tString hinhthuc_inT = (cuocTtkt.getHinhThuc().booleanValue()) ? \"KT\" : \"TT\";\r\n\t\t//StringBuffer sb = new StringBuffer(\"\\u0110OA\\u0300N\");\r\n\t\t//sb.append(hinhthuc);\r\n\t\tMsWordUtils word = new MsWordUtils(fileIn, fileOut);\r\n\t\ttry {\r\n\t\t\tword.put(\"[ten_cqt]\", KtnbUtil.getTenCqtCapTrenTt(appConText).toUpperCase());\r\n\t\t\t// hinh thuc thanh tra kiem tra\r\n\t\t\tStringBuffer sb = new StringBuffer(\"\\u0110OA\\u0300N \");\r\n\t\t\tsb.append(hinhthuc_inT);\r\n\t\t\t\r\n\t\t\tif (Formater.isNull(giaHanForm.getSoQd())) {\r\n\t\t\t\tsb.append(\" Q\\u0110 S\\u1ED0......\");\r\n\t\t\t} else {\r\n\t\t\t\tsb.append(\" Q\\u0110 S\\u1ED0 \" + giaHanForm.getSoQd());\r\n\t\t\t}\r\n\t\t\tword.put(\"[doan_ttkt_so]\", sb.toString().toUpperCase());\r\n\r\n\t\t\t//word.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[dv_dc_ttkt]\", cuocTtkt.getTenDonViBi());\r\n\t\t\tword.put(\"[thu_truong_cqt_ra_qd]\", KtnbUtil.getTenThuTruongCqtForMauin(appConText).toUpperCase());\r\n\t\t\t//word.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[quyet_dinh_so]\", giaHanForm.getCanCuQd());\r\n\t\t\t\r\n\t\t\tif (Formater.isNull(cbQd.getSoQuyetDinh())) {\r\n\t\t\t\tword.put(\"[qd_so]\", \"............\");\r\n\t\t\t} else {\r\n\t\t\t\tword.put(\"[qd_so]\", cbQd.getSoQuyetDinh());\r\n\t\t\t}\r\n\r\n\t\t\tString ngayxet = Formater.date2str(cbQd.getNgayRaQuyetDnh());\r\n\t\t\tString[] arrngayxet = ngayxet.split(\"/\");\r\n\t\t\tword.put(\"[ngay_qd]\", \"ng\\u00E0y \" + arrngayxet[0] + \" th\\u00E1ng \" + arrngayxet[1] + \" n\\u0103m \" + arrngayxet[2]);\r\n\t\t\tword.put(\"[thu_truong_cqt]\", KtnbUtil.getTenThuTruongCqtForMauin(appConText));\r\n\t\t\t//word.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[dv_dc_ttkt]\", cuocTtkt.getTenDonViBi());\r\n\r\n\t\t\t//word.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[dv_dc_ttkt]\", cuocTtkt.getTenDonViBi().toString());\r\n\t\t\tword.put(\"[ngay_lv]\", giaHanForm.getSoNgayRaHan());\r\n\t\t\tString tungay = giaHanForm.getRaHanTuNgay();\r\n\t\t\tString[] arrtungay = tungay.split(\"/\");\r\n\t\t\tword.put(\"[tu_ngay]\", \"ng\\u00E0y \" + arrtungay[0] + \" th\\u00E1ng \" + arrtungay[1] + \" n\\u0103m \" + arrtungay[2]);\r\n\t\t\t// den ngay\r\n\t\t\tString denngay = giaHanForm.getRaHanDenNgay();\r\n\t\t\tString[] arrdenngay = denngay.split(\"/\");\r\n\t\t\tword.put(\"[den_ngay]\", \"ng\\u00E0y \" + arrdenngay[0] + \" th\\u00E1ng \" + arrdenngay[1] + \" n\\u0103m \" + arrdenngay[2]);\r\n\t\t\tword.put(\"[ly_do]\", giaHanForm.getLyDoRaHan());\r\n\t\t\tword.put(\"[thu_truong_cqt_ra_qd]\", KtnbUtil.getTenThuTruongCqtForMauin(appConText).toLowerCase());\r\n\t\t\tword.put(\"[noi_duyet]\", giaHanForm.getNoiPheDuyet());\r\n\t\t\t// ngay duyet\r\n\t\t\tString ngayduyet = giaHanForm.getNgayPheDuyet();\r\n\t\t\tString[] arrngayduyet = ngayduyet.split(\"/\");\r\n\t\t\tif (arrngayduyet.length >= 2) {\r\n\t\t\t\tword.put(\"[ngay_duyet]\", \"ng\\u00E0y \" + arrngayduyet[0] + \" th\\u00E1ng \" + arrngayduyet[1] + \" n\\u0103m \" + arrngayduyet[2]);\r\n\t\t\t}\r\n\t\t\tword.put(\"[noi_lap]\", giaHanForm.getNoiTrinh());\r\n\t\t\t// ngay lap to trinh\r\n\t\t\tString ngaylaptotrinh = giaHanForm.getNgayTrinh();\r\n\t\t\tString[] arrngaylaptotrinh = ngaylaptotrinh.split(\"/\");\r\n\t\t\tif (arrngaylaptotrinh.length >= 2) {\r\n\t\t\t\tword.put(\"[ngay_lap_to_trinh]\", \"ng\\u00E0y \" + arrngaylaptotrinh[0] + \" th\\u00E1ng \" + arrngaylaptotrinh[1] + \" n\\u0103m \" + arrngaylaptotrinh[2]);\r\n\t\t\t}\r\n\t\t\t//word.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[y_kien_phe_duyet]\", giaHanForm.getKienPheDuyet());\r\n\t\t\tword.put(\"[ten_truong_doan]\", cuocTtkt.getTenTruongDoan());\r\n\t\t\t//word.put(\"[chuc_danh_thu_truong]\", \"ABC\");\r\n\t\t\t//word.put(\"[chuc_danh_thu_truong]\", KtnbUtil.getChucVuThuTruongByMaCqt(appConText.getMaCqt()).toUpperCase());\r\n\t\t\t// if (Formater.isNull(appConText.getTenThuTruong())) {\r\n\t\t\t// word.put(\"[ten_thu_truong]\", \"\");\r\n\t\t\t// } else {\r\n\t\t\t// word.put(\"[ten_thu_truong]\", appConText.getTenThuTruong());\r\n\t\t\t// }\r\n\t\t\tword.saveAndClose();\r\n\t\t\tword.downloadFile(fileOut, \"Mau TTNB10\", \".doc\", reponse);\r\n\t\t} catch (Exception ex) {\r\n\t\t\t// ex.printStackTrace();\r\n\t\t\tSystem.out.println(\"Download Error: \" + ex.getMessage());\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tword.saveAndClose();\r\n\t\t\t} catch (Exception e) {\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n protected void preSequencePreparations() {\n //initializing the HTML sequence report:\n htmlReport = new HtmlSequenceReport(scenarioCount, sequenceCount);\n // updating scenarioCount based on existing HTML files - sequence 1 gets the correct scenarioCount:\n scenarioCount = htmlReport.getScenarioCount();\n }", "private void init()\n {\n wikiContext.runInTenantContext(branch, getWikiSelector(), new CallableX<Void, RuntimeException>()\n {\n @Override\n public Void call() throws RuntimeException\n {\n GWikiElement page = wikiContext.getWikiWeb().getElement(pageId);\n WorkflowPopupActionBean.this.page = page;\n\n // check if dependent objects exists\n List<GWikiElementInfo> childs = wikiContext.getElementFinder().getAllDirectChilds(page.getElementInfo());\n for (final GWikiElementInfo child : childs) {\n getDepObjects().add(wikiContext.getWikiWeb().getElement(child));\n getSubpagesRec(child, 2);\n }\n return null;\n }\n\n /**\n * Recursive fetch of child elements\n */\n private void getSubpagesRec(GWikiElementInfo parent, int curDepth)\n {\n List<GWikiElementInfo> childs = wikiContext.getElementFinder().getAllDirectChilds(parent);\n for (final GWikiElementInfo child : childs) {\n getDepObjects().add(wikiContext.getWikiWeb().getElement(child));\n getSubpagesRec(child, ++curDepth);\n }\n }\n });\n }", "String prepareLegalDocuments();", "@Override\r\n\tpublic void createPages() {\r\n\t\t// Creates the model from the editor input\r\n\t\t//\r\n\t\t\r\n\t\tcreateModel();\r\n\r\n\t\t// Only creates the other pages if there is something that can be edited\r\n\t\t//\r\n\t\t// if (!getEditingDomain().getResourceSet().getResources().isEmpty()) {\r\n\t\tif (editorModel != null) {\r\n\t\t\t// Create a page for the selection tree view.\r\n\t\t\t//\r\n\r\n\t\t\t/*\r\n\t\t\t * Tree tree = new Tree(getContainer(), SWT.MULTI); selectionViewer\r\n\t\t\t * = new TreeViewer(tree); setCurrentViewer(selectionViewer);\r\n\t\t\t * \r\n\t\t\t * selectionViewer.setContentProvider(new\r\n\t\t\t * AdapterFactoryContentProvider(adapterFactory));\r\n\t\t\t * selectionViewer.setLabelProvider(new\r\n\t\t\t * AdapterFactoryLabelProvider(adapterFactory));\r\n\t\t\t * selectionViewer.setInput(editingDomain.getResourceSet());\r\n\t\t\t * selectionViewer.setSelection(new\r\n\t\t\t * StructuredSelection(editingDomain\r\n\t\t\t * .getResourceSet().getResources().get(0)), true);\r\n\t\t\t * \r\n\t\t\t * new AdapterFactoryTreeEditor(selectionViewer.getTree(),\r\n\t\t\t * adapterFactory);\r\n\t\t\t * \r\n\t\t\t * createContextMenuFor(selectionViewer);\r\n\t\t\t */\r\n\t\t\tComposite parent = getContainer();\r\n\t\t\tformToolkit = new FormToolkit(parent.getDisplay());\r\n\t\t\tform = formToolkit.createForm(parent);\r\n//\t\t\tform.setText(\"SETTINGS - View and modify setting values in \"\r\n//\t\t\t\t\t+ editorModel.getName() + \".\");\r\n\t\t\tComposite client = form.getBody();\r\n\t\t\t// client.setBackground(Display.getCurrent().getSystemColor(\r\n\t\t\t// SWT.COLOR_WHITE));\r\n\t\t\tclient.setLayout(new FillLayout());\r\n\t\t\tfeatureViewer = new FeatureViewer(client);\r\n\r\n\t\t\tfeatureViewer.setContentProvider(new FeatureViewerContentProvider(\r\n\t\t\t\t\teditingDomain.getCommandStack(), this));\r\n\t\t\tfeatureViewer.setInput(editorModel);\r\n\t\t\tfeatureViewer.setLabelProvider(new FeatureViewerLabelProvider(CrmlBuilder.getResourceModelRoot()));\r\n\t\t\t// featureViewer.refresh();\r\n\r\n\t\t\tfeatureViewer.addSelectionChangedListener(new ISelectionChangedListener(){\r\n\t\t\t\t\r\n\t\t\t\tpublic void selectionChanged(SelectionChangedEvent event) {\r\n\t\t\t\t\tIStructuredSelection selection = (IStructuredSelection) event\r\n\t\t\t\t\t.getSelection();\r\n\r\n\t\t\t\t\tsetSelection(selection);\r\n\t\t\t\t\t\r\n\t\t\t\t/*\tISelection convertSelection = convertSelectionToMainModel(selection);\r\n\t\t\t\t\tSelectionChangedEvent newEvent = new SelectionChangedEvent(\r\n\t\t\t\t\t\t\tConfmlEditor.this, convertSelection);\r\n\t\t\t\t\tfireSelection(newEvent);*/\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tgetSite().setSelectionProvider(featureViewer);\r\n\t\t\t// create pop up menu actions\r\n\t\t\tresetToDefaults = new ResetToDefaultAction(featureViewer);\r\n\t\t\tmoveUpAction = new MoveUpAction(featureViewer,this);\r\n\t\t\tmoveDownAction = new MoveDownAction(featureViewer,this);\r\n\t\t\tduplicateAction = new DuplicateSequencesAction(featureViewer,this);\r\n\t\t\topenDataConfmlAction = new OpenDataConfmlAction(featureViewer);\r\n\t\t\topenConfmlAction = new OpenConfmlAction(featureViewer);\r\n\t\t\topenImplAction = new OpenImplementationAction(featureViewer);\r\n\t\t\t\r\n\t\t\tIWorkbenchWindow window = getSite().getWorkbenchWindow();\r\n\t\t\tresetToDefaults.init(window);\r\n\t\t\tmoveUpAction.init(window);\r\n\t\t\tmoveDownAction.init(window);\r\n\t\t\tduplicateAction.init(window);\r\n\t\t\topenDataConfmlAction.init(window);\r\n\t\t\topenConfmlAction.init(window);\r\n\t\t\topenImplAction.init(window);\r\n\t\t\tdisableActions();\r\n\t\t\t\r\n\t\t\t// create pop up menu with actions\r\n\t\t\tcontextMenuListener = contextMenuListener(form);\r\n\t\t\tmenuManager = new MenuManager();\r\n\t\t\tmenuManager.addMenuListener(contextMenuListener);\r\n\t\t\tmenuManager.setRemoveAllWhenShown(true);\r\n\t\t\tMenu menu = menuManager.createContextMenu(form);\r\n\t\t\tform.setMenu(menu);\r\n\t\t\t\r\n\t\t\tint pageIndex = addPage(form);\r\n\t\t\tsetPageText(pageIndex, getString(\"_UI_SelectionPage_label\"));\r\n\r\n\t\t\tgetSite().getShell().getDisplay().asyncExec(new Runnable() {\r\n\t\t\t\tpublic void run() {\r\n\t\t\t\t\tsetActivePage(0);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// featureViewer.addDirtyButtonListener(new MouseListener() {\r\n\t\t//\r\n\t\t// public void mouseDoubleClick(MouseEvent e) {\r\n\t\t//\r\n\t\t// }\r\n\t\t//\r\n\t\t// public void mouseDown(MouseEvent e) {\r\n\t\t// LeafGroup selectedGroup = getSelectedGroup();\r\n\t\t// if (selectedGroup != null\r\n\t\t// && !(selectedGroup instanceof SummaryLeafGroup)) {\r\n\t\t// UIGroup group = createDirtyForGroup(selectedGroup);\r\n\t\t// settingsViewer.setInput(group);\r\n\t\t// refreshAndHandleWidgetState();\r\n\t\t// // settingsViewer.refresh();\r\n\t\t// dirtySorting = true;\r\n\t\t// errorSorting = false;\r\n\t\t// notesSorting = false;\r\n\t\t// }\r\n\t\t// }\r\n\t\t//\r\n\t\t// public void mouseUp(MouseEvent e) {\r\n\t\t//\r\n\t\t// }\r\n\t\t//\r\n\t\t// });\r\n\r\n\t\t// Ensures that this editor will only display the page's tab\r\n\t\t// area if there are more than one page\r\n\t\t//\r\n\t\tgetContainer().addControlListener(new ControlAdapter() {\r\n\t\t\tboolean guard = false;\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void controlResized(ControlEvent event) {\r\n\t\t\t\tif (!guard) {\r\n\t\t\t\t\tguard = true;\r\n\t\t\t\t\thideTabs();\r\n\t\t\t\t\tguard = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n//\t\tgetSite().getShell().getDisplay().asyncExec(new Runnable() {\r\n//\t\t\tpublic void run() {\r\n//\t\t\t\tupdateProblemIndication();\r\n//\t\t\t}\r\n//\t\t});\r\n\t\t\r\n\t\tupdateErrors();\r\n\t}", "void commonConstruction () {\n\n if (inFile != null) {\n dataParent = inFile.getParent();\n }\n if (inURL != null) {\n dataParent = \"www\";\n }\n context = new HTMLContext();\n context.setFile(this);\n context.entityTranslation = false;\n\t\thtmlChar = new HTMLCharacter (context);\n }", "@Override\n\tpublic void checkPage() {\n\t}", "private Webpage validatePage(Webpage webpage) {\n Call<ValidatorResult> call;\n boolean hadToForceEncodingAndDoctype = false;\n Response<ValidatorResult> response;\n\n for (int i = 0; i < 3; i++) {\n try {\n //Auto detect charset and doctype\n if (i == 0) {\n if(DEBUG)\n System.out.println(Thread.currentThread().getName() +\" Autodetecting charset and doctype for validation\");\n call = this.service.getTestResult(\"file:/\" +this.toolFolder +\"resources/tempHTML\" + Thread.currentThread().getName() + \".html\");\n }\n //Force UTF-8 charset\n if (i == 1) {\n if(DEBUG)\n System.out.println(Thread.currentThread().getName() +\" Forcing UTF-8 for validation\");\n call = this.service.getTestResultUTF8(\"file:/\" +this.toolFolder +\"resources/tempHTML\" + Thread.currentThread().getName() + \".html\");\n }\n //Force UTF-8 charset and HTML5\n else {\n if(DEBUG)\n System.out.println(Thread.currentThread().getName() +\" Forcing UTF-8 and HTML5 for validation\");\n call = this.service.getTestResultUTF8HTML5(\"file:/\" +this.toolFolder +\"resources/tempHTML\" + Thread.currentThread().getName() + \".html\");\n }\n\n //Submit HTML file for validation\n response = call.execute();\n\n //Successful response, parse results, leave\n if (response.isSuccessful()) {\n webpage = getValidationInformation(webpage, response.body());\n\n //Track number of pages that successfully validated after forcing settings\n if (hadToForceEncodingAndDoctype)\n numForced.incrementAndGet();\n\n return webpage;\n }\n\n } catch (IOException e) {\n if(this.DEBUG) {\n e.printStackTrace();\n System.out.println(Thread.currentThread().getName() +\"-> ERROR: Validation failed for \" + webpage.getWARCname() + \", changing default encoding / DOCTYPE and retrying.\");\n }\n hadToForceEncodingAndDoctype = true;\n }\n }\n if(DEBUG)\n System.out.println(Thread.currentThread().getName() +\"-> ERROR: Validation failed for \" + webpage.getWARCname() + \", skipping it.\");\n\n return null;\n }", "public interface OCR\r\n{\r\n /*\r\n * Method: extractKeywordsAbstract\r\n * Input: String of first PDF page text\r\n * Output: boolean\r\n * Algorithm: The method will take in this string, extract the keywords and abstract\r\n * if they exist, enter them in the DB, and return a boolean explaining if it worked\r\n */\r\n public boolean extractKeywordsAbstract (String firstPage, int paperID);\r\n}", "private static void processPart (WorkPart part) \n\t\tthrows Exception\n\t{\n\t\tTextWrapper textWrapper = part.getPrimaryText();\n\t\tif (textWrapper == null) return;\n\t\tText primary = textWrapper.getText();\n\t\tint n = primary.getNumLines();\n\t\tTextLine[] primaryLines = primary.getLines();\n\t\tTextLine[] translationLines = new TextLine[n];\n\t\tCollection lines = pm.getLinesInWorkPart(part);\n\t\tint numTranslatedLines = 0;\n\t\tfor (Iterator it = lines.iterator(); it.hasNext(); ) {\n\t\t\tLine line = (Line)it.next();\n\t\t\tTextRange location = line.getLocation();\n\t\t\tif (location == null) continue;\n\t\t\tTextLocation start = location.getStart();\n\t\t\tif (start == null) continue;\n\t\t\tTextLocation end = location.getEnd();\n\t\t\tif (end == null) continue;\n\t\t\tint endIndex = end.getIndex();\n\t\t\tString lineTag = line.getTag();\n\t\t\tif (lineTag == null) continue;\n\t\t\tElement el = (Element)lineTagToElMap.get(lineTag);\n\t\t\tif (el == null) continue;\n\t\t\tlineTagsFound.add(lineTag);\n\t\t\tTextLine translationLine = new BuildParagraph(el, \n\t\t\t\tTextParams.ROMAN,\n\t\t\t\tTextParams.TRANSLATED_LINE_FONT_SIZE);\n\t\t\tTextLine primaryLine = primaryLines[endIndex];\n\t\t\tint primaryIndentation = primaryLine.getIndentation();\n\t\t\ttranslationLine.setIndentation(primaryIndentation +\n\t\t\t\tTextParams.TRANSLATION_INDENTATION);\n\t\t\ttranslationLines[endIndex] = translationLine;\n\t\t\tnumTranslatedLines++;\n\t\t}\n\t\tif (numTranslatedLines == 0) return;\n\t\tText translation = new Text();\n\t\ttranslation.setCollapseBlankLines(false);\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tTextLine translationLine = translationLines[i];\n\t\t\tif (translationLine == null) {\n\t\t\t\ttranslation.appendBlankLine();\n\t\t\t} else {\n\t\t\t\ttranslation.appendLine(translationLine);\n\t\t\t}\n\t\t}\n\t\ttranslation.finalize();\n\t\tpm.begin();\n\t\tTextWrapper translationWrapper = new TextWrapper(translation);\n\t\tpm.save(translationWrapper);\n\t\tpart.addTranslation(translationTag, translationWrapper);\n\t\tpm.commit();\n\t}", "@Override\n\tpublic void loadPrePage() {\n\t\t\n\t\tif(curr_content.isFirstPage){\n\t\t\tPigAndroidUtil.showToast(mContext, \"以是第一页:\", 3000);\n\t\t}else{\n\t\t\texchangePre(m_bookFactory.getPrePageContent(pre_content));\n\t\t}\n\t}", "public void preprocess() {\n }", "public void preprocess() {\n }", "public void preprocess() {\n }", "public void preprocess() {\n }", "private void unpackGeneralXmlMarkup(Document doc, RepositioningInfo repInfo,\n RepositioningInfo ampCodingInfo, StatusListener statusListener)\n throws DocumentFormatException {\n boolean docHasContentButNoValidURL = hasContentButNoValidUrl(doc);\n\n XmlDocumentHandler xmlDocHandler = null;\n try {\n\n // Create a new Xml document handler\n xmlDocHandler =\n new XmlDocumentHandler(doc, this.markupElementsMap,\n this.element2StringMap);\n\n // Register a status listener with it\n xmlDocHandler.addStatusListener(statusListener);\n\n // set repositioning object\n xmlDocHandler.setRepositioningInfo(repInfo);\n\n // set the object with ampersand coding positions\n xmlDocHandler.setAmpCodingInfo(ampCodingInfo);\n\n // create the parser\n SAXDocumentParser newxmlParser = new SAXDocumentParser();\n\n // Set up the factory to create the appropriate type of parser\n // Fast Infoset doesn't support validating which is good as we would want\n // it off any way, but we do want it to be namesapace aware\n newxmlParser.setFeature(\"http://xml.org/sax/features/namespaces\", true);\n newxmlParser.setFeature(\"http://xml.org/sax/features/namespace-prefixes\",\n true);\n newxmlParser.setContentHandler(xmlDocHandler);\n newxmlParser.setErrorHandler(xmlDocHandler);\n newxmlParser.setDTDHandler(xmlDocHandler);\n newxmlParser.setEntityResolver(xmlDocHandler);\n\n // Parse the XML Document with the appropriate encoding\n Reader docReader = null;\n try {\n InputSource is;\n if(docHasContentButNoValidURL) {\n // no URL, so parse from string\n is = new InputSource(new StringReader(doc.getContent().toString()));\n } else if(doc instanceof TextualDocument) {\n // textual document - load with user specified encoding\n String docEncoding = ((TextualDocument)doc).getEncoding();\n // don't strip BOM on XML.\n docReader =\n new InputStreamReader(doc.getSourceUrl().openStream(),\n docEncoding);\n is = new InputSource(docReader);\n // must set system ID to allow relative URLs (e.g. to a DTD) to\n // work\n is.setSystemId(doc.getSourceUrl().toString());\n } else {\n // let the parser decide the encoding\n is = new InputSource(doc.getSourceUrl().toString());\n }\n newxmlParser.parse(is);\n } finally {\n // make sure the open streams are closed\n if(docReader != null) docReader.close();\n }\n\n ((DocumentImpl)doc).setNextAnnotationId(xmlDocHandler\n .getCustomObjectsId());\n } catch(SAXException e) {\n doc.getFeatures().put(\"parsingError\", Boolean.TRUE);\n\n Boolean bThrow =\n (Boolean)doc.getFeatures().get(\n GateConstants.THROWEX_FORMAT_PROPERTY_NAME);\n\n if(bThrow != null && bThrow.booleanValue()) {\n throw new DocumentFormatException(e);\n } else {\n Out.println(\"Warning: Document remains unparsed. \\n\"\n + \"\\n Stack Dump: \");\n e.printStackTrace(Out.getPrintWriter());\n }\n\n } catch(IOException e) {\n throw new DocumentFormatException(\"I/O exception for \"\n + doc.getSourceUrl(), e);\n } finally {\n if(xmlDocHandler != null)\n xmlDocHandler.removeStatusListener(statusListener);\n }\n }", "public String getPageText();", "@Override\n\t\tprotected void process() throws Exception {\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing - Initializing Models...\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tGlobalVars.initialize();\n\n\t\t\t// Processing Step 1. - CoreNLP\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing CoreNLP.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tString processed_text = Filter\n\t\t\t\t\t.filterdata(GlobalVars.pipeline, text);\n\n\t\t\t// Processing Step 2. - Openie\"\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing Openie.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tStringBuilder openIEOutput = new StringBuilder();\n\t\t\tString temp = \"\";\n\t\t\tfor (String sentence : processed_text.split(\"\\\\. \")) {\n\n\t\t\t\tSeq<Instance> extractions = GlobalVars.openIE.extract(sentence);\n\n\t\t\t\tInstance[] arr = new Instance[extractions.length()];\n\t\t\t\textractions.copyToArray(arr);\n\n\t\t\t\tfor (Instance inst : arr) {\n\t\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\t\tsb.append(inst.sentence() + \"\\n\");\n\t\t\t\t\tDouble conf = inst.confidence();\n\t\t\t\t\tString stringConf = conf.toString().substring(0, 4);\n\t\t\t\t\tsb.append(stringConf).append(\" (\")\n\t\t\t\t\t\t\t.append(inst.extr().arg1().text()).append(\"; \")\n\t\t\t\t\t\t\t.append(inst.extr().rel().text()).append(\"; \");\n\n\t\t\t\t\ttemp += inst.extr().arg1().text() + \"\\n\"\n\t\t\t\t\t\t\t+ inst.extr().rel().text() + \"\\n\";\n\n\t\t\t\t\tPart[] arr2 = new Part[inst.extr().arg2s().length()];\n\t\t\t\t\tinst.extr().arg2s().copyToArray(arr2);\n\t\t\t\t\t/*\n\t\t\t\t\t * for (Part arg : arr2) { sb.append(arg.text()).append(\"\");\n\t\t\t\t\t * System.out.println(\"%\" + arg.text() + \"%\"); }\n\t\t\t\t\t */\n\t\t\t\t\tif (arr2.length != 0) {\n\t\t\t\t\t\tSystem.out.println(\"Hats: \" + arr2[0]);\n\t\t\t\t\t\ttemp += arr2[0] + \"\\n\";\n\t\t\t\t\t\tsb.append(arr2[0]);\n\t\t\t\t\t\tsb.append(\")\\n\\n\");\n\t\t\t\t\t\topenIEOutput.append(sb.toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Processing Step 3. - Rewrite\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing Rewrite.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\t// Load load = new Load();\n\t\t\t// result = load.Loadfilter(openIEOutput.toString());\n\t\t\tresult = temp;\n\t\t}", "private static String pipelineMRC(String text, boolean debugMode, boolean onlyConceptTag) {\n\t\tif (debugMode) System.out.println(\"pipelineMRC_POS_NER function \");\n\t\ttext = text.replaceAll(\"&apos;\",\"\\'\");\n\t\tif (debugMode) System.out.println(\"MetaMap extracting concepts\");\n\t\t//String MetaMapText = MetaMapHandler.getAnnotatedXMLTags(text, debugMode);\n\t\tString LocalMetaMapText = LocalMetaMapHandler.getAnnotatedXMLTags(text);\n\n\t\t//Debugging\n\t\t//System.out.println(\"----------------------------------------------------\");\n\t\t//System.out.println(MetaMapText);\n\t\t//System.out.println(LocalMetaMapText);\n\t\t//System.out.println(\"----------------------------------------------------\");\n\t\t//End of Debugging\n\n\t\tif (debugMode) System.out.println(\"MetaMap concepts extracted\");\n\n\t\tif(!onlyConceptTag) {\n\t\t\tLocalMetaMapText = \"<content><text>\" + LocalMetaMapText;\n\t\t\tLocalMetaMapText = LocalMetaMapText.replaceAll(Pattern.quote(\"<concept\"), \"</text><concept\");\n\t\t\tLocalMetaMapText = LocalMetaMapText.replaceAll(Pattern.quote(\"</concept>\"), \"</concept><text>\");\n\t\t\tLocalMetaMapText = LocalMetaMapText + \"</text></content>\";\n\t\t}\n\n\t\treturn LocalMetaMapText;\n\t}", "public static By getRP_LNL_TxtInPlaceOrderpage(String text){\n\t\t return By.xpath(\"//div[@class='line-level']//label[contains(text(),'RP_LNL_Txt:')]//p[contains(text(),'\"+text+\"')]\");\n\t }", "@Override\n public String loadTextWidget() {\n /* Get the complete E19 text and display it. */\n String text = getText(E19_ALLPAGES);\n text = text.replace(\"null\", \"\");\n\n return text;\n }", "public static By getRP_HDL_TxtInPlaceOrderPage(String text){\n\t\treturn By.xpath(\"//section[@class='section additional-order-information']//label//span[contains(text(),'RP_HDL_Txt')]/following::p[contains(text(),'\"+text+\"')]\");\n\t }", "public void extractKnowledge()\n {\n }", "@Override\n public void process(Page page) {\n PageStore.prePage = page.getHtml().toString();\n }", "public void startContent() {\n iTextContext.pageNumber().startMainMatter();\n }", "protected void processXlateText(Hashtable attributes)\n throws SAXException\n {\n\tString key = (String) attributes.get(XMLTag.ID);\n\tif ((xlatedText == null) || (textTag == null))\n\t {\n\t throw new SAXException(\"Encountered xlateText element (id=\" +\n\t\t\t key + \") outside defining element.\");\n\t }\n\tXMLTag tag = (XMLTag) attributes.get(XMLTag.TAG);\n\tString dflt = (String) attributes.get(XMLTag.REMIND);\n\tString substitute = (String) attributes.get(XMLTag.SUBSTITUTE);\n\tString xlated = textSource.getI18NText(key,dflt);\n // ignore lines that are bare accent graves\n if (xlated.compareTo(\"`\") == 0)\n return;\n if (substitute != null)\n\t {\n\t int p1 = xlated.indexOf(\"%1\");\n\t if (p1 < 0)\n\t p1 = xlated.indexOf(\"%s\");\n\t if (p1 < 0)\n\t p1 = xlated.indexOf(\"%d\");\n\t if (p1 >= 0)\n\t {\n int p2 = xlated.indexOf(\" \",p1);\n\t\tif (p2 < 0)\n\t\t {\n xlated = xlated.substring(0,p1) + substitute;\n\t\t }\n\t\telse\n\t\t {\n xlated = xlated.substring(0,p1) + substitute +\n\t\t xlated.substring(p2);\n\t\t }\n\t\t}\n\t else // just append the substitute string.\n\t {\n p1 = xlated.lastIndexOf(\" \");\n\t\tif (p1 < (xlated.length() - 1))\n\t\t {\n\t\t xlated = xlated + \" \";\n\t\t }\n\t\txlated = xlated + substitute;\n\t\t}\n\t }\n\txlatedText.add(xlated);\n\ttextTag.add(tag);\n\ttextKey.add(key);\n\t}", "public static void main(String[] args) throws ParseException {\n String text;\n\n File file;\n\n /* pdfStripper = null;\n pdDoc = null;\n cosDoc = null;\n */ String parsed = parseWithTika();\n file = new File(filePath);\n try {\n /* parser = new PDFParser(new FileInputStream(file)); // update for PDFBox V 2.0\n parser.parse();\n cosDoc = parser.getDocument();\n pdfStripper = new PDFTextStripper();\n pdDoc = new PDDocument(cosDoc);\n pdDoc.getNumberOfPages();\n */ //pdfStripper.setStartPage(1);\n //pdfStripper.setEndPage(10);\n /* text = pdfStripper.getText(pdDoc);\n String resultString = text.replaceAll(\"\\\\p{C}|\\\\p{Sm}|\\\\p{Sk}|\\\\p{So}\", \" \");\n */\n\n //testDictionary();\n testOpenNlp(parsed);\n testOpenNlp(\"anas al bassit\");\n testOpenNlp(\"Anas Al Bassit\");\n testOpenNlp(\"barack obama\");\n testOpenNlp(\"Barack Obama\");\n\n\n System.out.println();\n } catch (IOException e) {\n e.printStackTrace();\n }\n// catch (ParseException e) {\n// e.printStackTrace();\n// }\n }", "@Override\n public void run() {\n List<File> files = getContents(TOP_LEVEL + \" and \" + NOT_TRASHED + \" and \" + FOLDER + \" and \" + NOT_SPREADSHEET);\n \n prune(targetDir, files);\n processLanguages(files);\n }", "void getNextWord () \n\t\t\tthrows IOException, FileNotFoundException {\n \n\t\tcontext.word.setLength(0);\n \n // Build the next entity\n while ((context.entityCharCount > 0)\n && (! atEnd)) {\n getNextCharacter();\n }\n \n // See if the word starts with white space\n boolean startingWhiteSpaceForWord\n = (htmlChar.whiteSpace \n && (context.fieldType == HTMLContext.TEXT)\n && (! context.preformatted));\n \n // Capture leading whitespace if appropriate\n if (htmlChar.whiteSpace\n && context.fieldType == HTMLContext.TEXT\n && (context.field.length() > 0\n || context.preformatted)) {\n context.word.append (htmlChar.character);\n }\n \n // If we're dealing with preformatted text, \n // then capture all leading white space\n if (context.preformatted && context.fieldType == HTMLContext.TEXT) {\n while (htmlChar.whiteSpace && (! atEnd)) {\n context.word.append (htmlChar.character);\n getNextCharacter();\n }\n }\n \n // Now skip any remaining white space\n while (((htmlChar.whiteSpace) \n || context.entityCharCount > 0)\n && (! atEnd)) {\n getNextCharacter();\n }\n \n // See if we've got got a quoted attribute value\n\t\tif (context.fieldType == HTMLContext.ATTRIBUTE_VALUE\n && (! htmlChar.translatedEntity)) {\n if (htmlChar.character == GlobalConstants.DOUBLE_QUOTE) {\n context.quoted = true;\n context.startQuoteChar = GlobalConstants.DOUBLE_QUOTE;\n }\n else\n if (htmlChar.character == GlobalConstants.SINGLE_QUOTE) {\n context.quoted = true;\n context.startQuoteChar = GlobalConstants.SINGLE_QUOTE;\n }\n\t\t}\n \n // Now capture the word's content\n\t\twhile (! htmlChar.endsWord) {\n\t\t\tcontext.word.append (htmlChar.character);\n\t\t\tdo {\n getNextCharacter();\n } while ((context.entityCharCount > 0) && (! atEnd));\n\t\t}\n \n\t\tif (context.quoted\n && (! htmlChar.translatedEntity)\n\t\t\t\t&& htmlChar.character == context.startQuoteChar) {\n\t\t\tcontext.word.append (htmlChar.character);\n context.quoted = false;\n\t\t\tdo {\n getNextCharacter();\n } while ((context.entityCharCount > 0) && (! atEnd));\n\t\t}\n if (startingWhiteSpaceForWord\n && context.fieldType == HTMLContext.TEXT\n && context.word.length() > 0\n && (! Character.isWhitespace (context.word.charAt (0)))) {\n context.word.insert (0, ' ');\n }\n\t}", "public void testContentsParsing() throws Throwable {\n long start = System.currentTimeMillis();\n PluginTokenizer tokenizer = new PluginTokenizer();\n\n System.out.println(\"\\nStart extracting contents in \\\"\" + _path + \"\\\"\");\n \n tokenizer.setSource(new InputStreamSource(_reader));\n tokenizer.setParseFlags(Tokenizer.F_NO_CASE | Tokenizer.F_TOKEN_POS_ONLY);\n tokenizer.setWhitespaceHandler(this);\n tokenizer.setSequenceHandler(this);\n\n while (tokenizer.hasMoreToken()) {\n tokenizer.nextToken();\n System.out.println(tokenizer.current());\n assertTrue(\"Method current() returned null.\", tokenizer.current() != null);\n }\n \n long diff = System.currentTimeMillis() - start;\n System.out.println(\"Finished after \" + diff + \" milliseconds\");\n }", "@Override\n\tpublic void process(JCas aJCas) throws AnalysisEngineProcessException {\n\t\tString text = aJCas.getDocumentText();\n\n\t\t// create an empty Annotation just with the given text\n\t\tAnnotation document = new Annotation(text);\n//\t\tAnnotation document = new Annotation(\"Barack Obama was born in Hawaii. He is the president. Obama was elected in 2008.\");\n\n\t\t// run all Annotators on this text\n\t\tpipeline.annotate(document); \n\t\tList<CoreMap> sentences = document.get(SentencesAnnotation.class);\n\t\t HelperDataStructures hds = new HelperDataStructures();\n\n\t\t\n\t\t//SPnew language-specific settings:\n\t\t//SPnew subject tags of the parser\n\t\t HashSet<String> subjTag = new HashSet<String>(); \n\t\t HashSet<String> dirObjTag = new HashSet<String>(); \n\t\t //subordinate conjunction tags\n\t\t HashSet<String> compTag = new HashSet<String>(); \n\t\t //pronoun tags\n\t\t HashSet<String> pronTag = new HashSet<String>(); \n\t\t \n\t\t HashSet<String> passSubjTag = new HashSet<String>();\n\t\t HashSet<String> apposTag = new HashSet<String>(); \n\t\t HashSet<String> verbComplementTag = new HashSet<String>(); \n\t\t HashSet<String> infVerbTag = new HashSet<String>(); \n\t\t HashSet<String> relclauseTag = new HashSet<String>(); \n\t\t HashSet<String> aclauseTag = new HashSet<String>(); \n\t\t \n\t\t HashSet<String> compLemma = new HashSet<String>(); \n\t\t HashSet<String> coordLemma = new HashSet<String>(); \n\t\t HashSet<String> directQuoteIntro = new HashSet<String>(); \n\t\t HashSet<String> indirectQuoteIntroChunkValue = new HashSet<String>();\n\t\t \n//\t\t HashSet<String> finiteVerbTag = new HashSet<String>();\n\t\t \n\n\t\t //OPEN ISSUES PROBLEMS:\n\t\t //the subject - verb relation finding does not account for several specific cases: \n\t\t //opinion verbs with passive subjects as opinion holder are not accounted for,\n\t\t //what is needed is a marker in the lex files like PASSSUBJ\n\t\t //ex: Obama is worried/Merkel is concerned\n\t\t //Many of the poorer countries are concerned that the reduction in structural funds and farm subsidies may be detrimental in their attempts to fulfill the Copenhagen Criteria.\n\t\t //Some of the more well off EU states are also worried about the possible effects a sudden influx of cheap labor may have on their economies. Others are afraid that regional aid may be diverted away from those who currently benefit to the new, poorer countries that join in 2004 and beyond. \n\t\t// Does not account for infinitival constructions, here again a marker is needed to specify\n\t\t //subject versus object equi\n\t\t\t//Christian Noyer was reported to have said that it is ok.\n\t\t\t//Reuters has reported Christian Noyer to have said that it is ok.\n\t\t //Obama is likely to have said.. \n\t\t //Several opinion holder- opinion verb pairs in one sentence are not accounted for, right now the first pair is taken.\n\t\t //what is needed is to run through all dependencies. For inderect quotes the xcomp value of the embedded verb points to the \n\t\t //opinion verb. For direct quotes the offsets closest to thwe quote are relevant.\n\t\t //a specific treatment of inverted subjects is necessary then. Right now the\n\t\t //strategy relies on the fact that after the first subj/dirobj - verb pair the\n\t\t //search is interrupted. Thus, if the direct object precedes the subject, it is taken as subject.\n\t\t // this is the case in incorrectly analysed inverted subjeects as: said Zwickel on Monday\n\t\t //coordination of subject not accounted for:employers and many economists\n\t\t //several subject-opinion verbs:\n\t\t //Zwickel has called the hours discrepancy between east and west a \"fairness gap,\" but employers and many economists point out that many eastern operations have a much lower productivity than their western counterparts.\n\t\t if (language.equals(\"en\")){\n \t subjTag.add(\"nsubj\");\n \t subjTag.add(\"xsubj\");\n \t subjTag.add(\"nmod:agent\");\n \t \n \t dirObjTag.add(\"dobj\"); //for inverted subject: \" \" said IG metall boss Klaus Zwickel on Monday morning.\n \t \t\t\t\t\t\t//works only with break DEPENDENCYSEARCH, otherwise \"Monday\" is nsubj \n \t \t\t\t\t\t\t//for infinitival subject of object equi: Reuters reports Obama to have said\n \tpassSubjTag.add(\"nsubjpass\");\n \tapposTag.add(\"appos\");\n \trelclauseTag.add(\"acl:relcl\");\n \taclauseTag.add(\"acl\");\n \t compTag.add(\"mark\");\n \t pronTag.add(\"prp\");\n \thds.pronTag.add(\"prp\");\n \tcompLemma.add(\"that\");\n \tcoordLemma.add(\"and\");\n \tverbComplementTag.add(\"ccomp\");\n \tverbComplementTag.add(\"parataxis\");\n\n \tinfVerbTag.add(\"xcomp\"); //Reuters reported Merkel to have said\n \tinfVerbTag.add(\"advcl\");\n \tdirectQuoteIntro.add(\":\");\n \tindirectQuoteIntroChunkValue.add(\"SBAR\");\n \thds.objectEqui.add(\"report\");\n \thds.objectEqui.add(\"quote\");\n \thds.potentialIndirectQuoteTrigger.add(\"say\");\n// \thds.objectEqui.add(\"confirm\");\n// \thds.subjectEqui.add(\"promise\");\n// \thds.subjectEqui.add(\"quote\");\n// \thds.subjectEqui.add(\"confirm\");\n }\n\t\t \n\t\t boolean containsSubordinateConjunction = false;\n\t\t\n\t\t \n\t\tfor (CoreMap sentence : sentences) {\n//\t\t\tSystem.out.println(\"PREPROCESSING..\");\n\t\t\t\tSentenceAnnotation sentenceAnn = new SentenceAnnotation(aJCas);\n\t\t\t\t\n\t\t\t\tint beginSentence = sentence.get(TokensAnnotation.class).get(0)\n\t\t\t\t\t\t.beginPosition();\n\t\t\t\tint endSentence = sentence.get(TokensAnnotation.class)\n\t\t\t\t\t\t.get(sentence.get(TokensAnnotation.class).size() - 1)\n\t\t\t\t\t\t.endPosition();\n\t\t\t\tsentenceAnn.setBegin(beginSentence);\n\t\t\t\tsentenceAnn.setEnd(endSentence);\n\t\t\t\tsentenceAnn.addToIndexes();\n\t\t\t\t\n\t\t\t\t//SP Map offsets to NER\n\t\t\t\tList<NamedEntity> ners = JCasUtil.selectCovered(aJCas, //SPnew tut\n\t\t\t\t\t\tNamedEntity.class, sentenceAnn);\n\t\t\t\tfor (NamedEntity ne : ners){\n//\t\t\t\t\tSystem.out.println(\"NER TYPE: \" + ne.jcasType.toString());\n//\t\t\t\t\tSystem.out.println(\"NER TYPE: \" + ne.getCoveredText().toString());\n//\t\t\t\t\tSystem.out.println(\"NER TYPE: \" + ne.jcasType.casTypeCode);\n\t\t\t\t\t//Person is 71, Location is 213, Organization is 68 geht anders besser siehe unten\n\t\t\t\t\tint nerStart = ne\n\t\t\t\t\t\t\t.getBegin();\n\t\t\t\t\tint nerEnd = ne.getEnd();\n//\t\t\t\t\tSystem.out.println(\"NER: \" + ne.getCoveredText() + \" \" + nerStart + \"-\" + nerEnd ); \n\t\t\t\t\tString offsetNer = \"\" + nerStart + \"-\" + nerEnd;\n\t\t\t\t\thds.offsetToNer.put(offsetNer, ne.getCoveredText());\n//\t\t\t\t\tNer.add(offsetNer);\n\t\t\t\t\thds.Ner.add(offsetNer);\n//\t\t\t\t\tSystem.out.println(\"NER: TYPE \" +ne.getValue().toString());\n\t\t\t\t\tif (ne.getValue().equals(\"PERSON\")){\n\t\t\t\t\t\thds.NerPerson.add(offsetNer);\n\t\t\t\t\t}\n\t\t\t\t\telse if (ne.getValue().equals(\"ORGANIZATION\")){\n\t\t\t\t\t\thds.NerOrganization.add(offsetNer);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//DBpediaLink info: map offsets to links\n\t\t\t\tList<DBpediaResource> dbpeds = JCasUtil.selectCovered(aJCas, //SPnew tut\n\t\t\t\t\t\tDBpediaResource.class, sentenceAnn);\n\t\t\t\tfor (DBpediaResource dbped : dbpeds){\n//\t\t\t\t\t\n//\t\t\t\t\tint dbStart = dbped\n//\t\t\t\t\t\t\t.getBegin();\n//\t\t\t\t\tint dbEnd = dbped.getEnd();\n\t\t\t\t\t// not found if dbpedia offsets are wrongly outside than sentences\n//\t\t\t\t\tSystem.out.println(\"DBPED SENT: \" + sentenceAnn.getBegin()+ \"-\" + sentenceAnn.getEnd() ); \n//\t\t\t\t\tString offsetDB = \"\" + dbStart + \"-\" + dbEnd;\n//\t\t\t\t\thds.labelToDBpediaLink.put(dbped.getLabel(), dbped.getUri());\n//\t\t\t\t\tSystem.out.println(\"NOW DBPED: \" + dbped.getLabel() + \"URI: \" + dbped.getUri() ); \n\t\t\t\t\thds.dbpediaSurfaceFormToDBpediaLink.put(dbped.getCoveredText(), dbped.getUri());\n//\t\t\t\t\tSystem.out.println(\"NOW DBPED: \" + dbped.getCoveredText() + \"URI: \" + dbped.getUri() ); \n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//SP Map offsets to lemma of opinion verb/noun; parser does not provide lemma\n\t\t\t\t for (CoreLabel token: sentence.get(TokensAnnotation.class)) {\n//\t\t\t\t\t System.out.println(\"LEMMA \" + token.lemma().toString());\n\t\t\t\t\t int beginTok = token.beginPosition();\n\t\t\t\t\t int endTok = token.endPosition();\n\t\t\t\t\t String offsets = \"\" + beginTok + \"-\" + endTok;\n\t\t\t\t\t hds.offsetToLemma.put(offsets, token.lemma().toString());\n\t\t\t\t\t \n\t\t\t\t\t \t if (opinion_verbs.contains(token.lemma().toString())){\n\t\t\t\t\t\t\t hds.offsetToLemmaOfOpinionVerb.put(offsets, token.lemma().toString());\n\t\t\t\t\t\t\t hds.OpinionExpression.add(offsets);\n\t\t\t\t\t\t\t hds.offsetToLemmaOfOpinionExpression.put(offsets, token.lemma().toString());\n\t\t\t\t\t\t\t \n//\t\t\t \t System.out.println(\"offsetToLemmaOfOpinionVerb \" + token.lemma().toString());\n\t\t\t\t\t \t }\n\t\t\t\t\t \t if (passive_opinion_verbs.contains(token.lemma().toString())){\n\t\t\t\t\t\t\t hds.offsetToLemmaOfPassiveOpinionVerb.put(offsets, token.lemma().toString());\n\t\t\t\t\t\t\t hds.OpinionExpression.add(offsets);\n\t\t\t\t\t\t\t hds.offsetToLemmaOfOpinionExpression.put(offsets, token.lemma().toString());\n//\t\t\t \t System.out.println(\"offsetToLemmaOfPassiveOpinionVerb \" + token.lemma().toString());\n\t\t\t\t\t \t }\n\n\t\t\t\t } \n\n\t\t\t//SPnew parser\n\t\t\tTree tree = sentence.get(TreeAnnotation.class);\n\t\t\tTreebankLanguagePack tlp = new PennTreebankLanguagePack();\n\t\t\tGrammaticalStructureFactory gsf = tlp.grammaticalStructureFactory();\n\t\t\tGrammaticalStructure gs = gsf.newGrammaticalStructure(tree);\n\t\t\tCollection<TypedDependency> td = gs.typedDependenciesCollapsed();\n\n\t\t\t \n//\t\t\tSystem.out.println(\"TYPEDdep\" + td);\n\t\t\t\n\t\t\tObject[] list = td.toArray();\n//\t\t\tSystem.out.println(list.length);\n\t\t\tTypedDependency typedDependency;\nDEPENDENCYSEARCH: for (Object object : list) {\n\t\t\ttypedDependency = (TypedDependency) object;\n//\t\t\tSystem.out.println(\"DEP \" + typedDependency.dep().toString()+ \n//\t\t\t\t\t\" GOV \" + typedDependency.gov().toString()+ \n//\t\t\t\" :: \"+ \" RELN \"+typedDependency.reln().toString());\n\t\t\tString pos = null;\n String[] elements;\n String verbCand = null;\n int beginVerbCand = -5;\n\t\t\tint endVerbCand = -5;\n\t\t\tString offsetVerbCand = null;\n\n if (compTag.contains(typedDependency.reln().toString())) {\n \tcontainsSubordinateConjunction = true;\n// \tSystem.out.println(\"subordConj \" + typedDependency.dep().toString().toLowerCase());\n }\n \n else if (subjTag.contains(typedDependency.reln().toString())){\n \thds.predicateToSubjectChainHead.clear();\n \thds.subjectToPredicateChainHead.clear();\n \t\n \tverbCand = typedDependency.gov().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.gov().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.gov().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n//\t\t\t\tSystem.out.println(\"VERBCand \" + verbCand + offsetVerbCand);\n//\t\t\t\tfor (HashMap.Entry<String, String> entry : hds.offsetToLemma.entrySet()) {\n//\t\t\t\t String key = entry.getKey();\n//\t\t\t\t Object value = entry.getValue();\n//\t\t\t\t System.out.println(\"OFFSET \" + key + \" LEMMA \" + value);\n//\t\t\t\t // FOR LOOP\n//\t\t\t\t}\n//\t\t\t\tif (hds.offsetToLemma.containsKey(offsetVerbCand)){\n//\t\t\t\t\tString verbCandLemma = hds.offsetToLemma.get(offsetVerbCand);\n//\t\t\t\t\tif (hds.objectEqui.contains(verbCandLemma) || hds.subjectEqui.contains(verbCandLemma)){\n//\t\t\t\t\t\tSystem.out.println(\"SUBJCHAIN BEGIN verbCand \" + verbCand);\n//\t\t\t\t\t\tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t\tSystem.out.println(\"SUBJCHAINHEAD1\");\n\t\t\t\tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n//\t\t\t\tSystem.out.println(\"verbCand \" + verbCand);\n\t\t\t\t//hack for subj after obj said Zwickel (obj) on Monday morning (subj)\n\t\t\t\tif (language.equals(\"en\") \n\t\t\t\t\t\t&& hds.predicateToObject.containsKey(offsetVerbCand)\n\t\t\t\t\t\t){\n// \t\tSystem.out.println(\"CONTINUE DEP\");\n \t\tcontinue DEPENDENCYSEARCH;\n \t}\n\t\t\t\telse {\n\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n\t\t\t\t}\n }\n //Merkel is concerned\n else if (passSubjTag.contains(typedDependency.reln().toString())){\n \t//Merkel was reported\n \t//Merkel was concerned\n \t//Merkel was quoted\n \thds.predicateToSubjectChainHead.clear();\n \thds.subjectToPredicateChainHead.clear();\n \tverbCand = typedDependency.gov().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.gov().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.gov().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n//\t\t\t\tSystem.out.println(\"VERBCand \" + verbCand + offsetVerbCand);\n//\t\t\t\tif (hds.offsetToLemma.containsKey(offsetVerbCand)){\n//\t\t\t\t\tString verbCandLemma = hds.offsetToLemma.get(offsetVerbCand);\n////\t\t\t\t\tSystem.out.println(\"LEMMA verbCand \" + verbCandLemma);\n//\t\t\t\t\tif (hds.objectEqui.contains(verbCandLemma) || hds.subjectEqui.contains(verbCandLemma)){\n//\t\t\t\t\t\tSystem.out.println(\"SUBJCHAIN BEGIN verbCand \" + verbCand);\n//\t\t\t\t\t\tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n//\t\t\t\t\t}\n//\t\t\t\t}\n \t\n \tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n// \tSystem.out.println(\"SUBJCHAINHEAD2\");\n \t//Merkel is concerned\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfPassiveOpinionVerb,\n \t\t\thds);\n }\n //Meanwhile, the ECB's vice-president, Christian Noyer, was reported at the start of the week to have said that the bank's future interest-rate moves\n// would depend on the behavior of wage negotiators as well as the pace of the economic recovery.\n\n else if (apposTag.contains(typedDependency.reln().toString())){\n \t\n \tString subjCand = typedDependency.gov().toString().toLowerCase();\n \tint beginSubjCand = typedDependency.gov().beginPosition();\n \tint endSubjCand = typedDependency.gov().endPosition();\n \tString offsetSubjCand = \"\" + beginSubjCand + \"-\" + endSubjCand;\n \tString appo = typedDependency.dep().toString().toLowerCase();\n\t\t\t\tint beginAppo = typedDependency.dep().beginPosition();\n\t\t\t\tint endAppo = typedDependency.dep().endPosition();\n\t\t\t\tString offsetAppo = \"\" + beginAppo + \"-\" + endAppo;\n\t\t\t\t\n// \tSystem.out.println(\"APPOSITION1 \" + subjCand + \"::\"+ appo + \":\" + offsetSubjCand + \" \" + offsetAppo);\n \thds.subjectToApposition.put(offsetSubjCand, offsetAppo);\n }\n else if (relclauseTag.contains(typedDependency.reln().toString())){\n \tString subjCand = typedDependency.gov().toString().toLowerCase();\n \tint beginSubjCand = typedDependency.gov().beginPosition();\n \tint endSubjCand = typedDependency.gov().endPosition();\n \tString offsetSubjCand = \"\" + beginSubjCand + \"-\" + endSubjCand;\n \tverbCand = typedDependency.dep().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.dep().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.dep().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n\t\t\t\tString subjCandPos = null;\n\t\t\t\tif (hds.predicateToSubject.containsKey(offsetVerbCand)){\n\t\t\t\t\t\n\t\t\t\t\tif (subjCand.matches(\".+?/.+?\")) { \n\t\t\t\t\t\telements = subjCand.split(\"/\");\n\t\t\t\t\t\tsubjCand = elements[0];\n\t\t\t\t\t\tsubjCandPos = elements[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tString del = hds.predicateToSubject.get(offsetVerbCand);\n\t\t\t\t\thds.predicateToSubject.remove(offsetVerbCand);\n\t\t\t\t\thds.subjectToPredicate.remove(del);\n\t\t\t\t\thds.normalPredicateToSubject.remove(offsetVerbCand);\n\t\t\t\t\thds.subjectToNormalPredicate.remove(del);\n//\t\t\t\t\tSystem.out.println(\"REMOVE RELPRO \" + verbCand + \"/\" + hds.offsetToLemma.get(del));\n\t\t\t\t\thds.predicateToSubject.put(offsetVerbCand, offsetSubjCand);\n\t\t\t\t\thds.subjectToPredicate.put( offsetSubjCand, offsetVerbCand);\n\t\t\t\t\thds.normalPredicateToSubject.put(offsetVerbCand, offsetSubjCand);\n\t\t\t\t\thds.subjectToNormalPredicate.put( offsetSubjCand, offsetVerbCand);\n//\t\t\t\t\tSystem.out.println(\"RELCLAUSE \" + subjCand + \"::\" + \":\" + verbCand);\n\t\t\t\t\thds.offsetToSubjectHead.put(offsetSubjCand,subjCand);\n\t\t\t\t\thds.SubjectHead.add(offsetSubjCand);\n\t\t\t\t\t\n\t\t\t\t\tif (subjCandPos != null && hds.pronTag.contains(subjCandPos)){\n\t\t\t\t\t\thds.PronominalSubject.add(offsetSubjCand);\n\t\t\t\t\t}\n\t\t\t\t}\n \t\n \t\n }\n \n else if (dirObjTag.contains(typedDependency.reln().toString())\n \t\t){\n \tstoreRelations(typedDependency, hds.predicateToObject, hds.ObjectToPredicate, hds);\n \tverbCand = typedDependency.gov().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.gov().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.gov().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n\t\t\t\t\n\t\t\t\tString objCand = typedDependency.dep().toString().toLowerCase();\n \tint beginObjCand = typedDependency.dep().beginPosition();\n \tint endObjCand = typedDependency.dep().endPosition();\n \tString offsetObjCand = \"\" + beginObjCand + \"-\" + endObjCand;\n \tString objCandPos;\n \tif (objCand.matches(\".+?/.+?\")) { \n\t\t\t\t\telements = objCand.split(\"/\");\n\t\t\t\t\tobjCand = elements[0];\n\t\t\t\t\tobjCandPos = elements[1];\n//\t\t\t\t\tSystem.out.println(\"PRON OBJ \" + objCandPos);\n\t\t\t\t\tif (pronTag.contains(objCandPos)){\n\t\t\t\t\thds.PronominalSubject.add(offsetObjCand);\n\t\t\t\t\t}\n\t\t\t\t\t}\n// \tSystem.out.println(\"DIROBJ STORE ONLY\");\n \t//told Obama\n \t//said IG metall boss Klaus Zwickel\n \t// problem: pointing DO\n \t//explains David Gems, pointing out the genetically manipulated species.\n \t if (language.equals(\"en\") \n \t\t\t\t\t\t&& !hds.normalPredicateToSubject.containsKey(offsetVerbCand)\n \t\t\t\t\t\t){\n// \t\t System.out.println(\"INVERSE SUBJ HACK ENGLISH PREDTOOBJ\");\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n \t }\n }\n //was reported to have said\n else if (infVerbTag.contains(typedDependency.reln().toString())){\n \tstoreRelations(typedDependency, hds.mainToInfinitiveVerb, hds.infinitiveToMainVerb, hds);\n// \tSystem.out.println(\"MAIN-INF\");\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n \t\n }\n else if (aclauseTag.contains(typedDependency.reln().toString())){\n \tstoreRelations(typedDependency, hds.nounToInfinitiveVerb, hds.infinitiveVerbToNoun, hds);\n// \tSystem.out.println(\"NOUN-INF\");\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n \t\n }\n \n \n\n\t\t\t}\n\t\t\t\n//\t\t\tSemanticGraph dependencies = sentence.get(CollapsedCCProcessedDependenciesAnnotation.class);\n//\t\t\tSystem.out.println(\"SEM-DEP \" + dependencies);\t\n\t\t}\n\t\t\n\n\t\tMap<Integer, edu.stanford.nlp.dcoref.CorefChain> corefChains = document.get(CorefChainAnnotation.class);\n\t\t \n\t\t if (corefChains == null) { return; }\n\t\t //SPCOPY\n\t\t for (Entry<Integer, edu.stanford.nlp.dcoref.CorefChain> entry: corefChains.entrySet()) {\n//\t\t System.out.println(\"Chain \" + entry.getKey() + \" \");\n\t\t \tint chain = entry.getKey();\n\t\t String repMenNer = null;\n\t\t String repMen = null;\n\t\t String offsetRepMenNer = null;\n\n\t\t List<IaiCorefAnnotation> listCorefAnnotation = new ArrayList<IaiCorefAnnotation>();\n\t\t \n\t\t for (CorefMention m : entry.getValue().getMentionsInTextualOrder()) {\n\t\t \tboolean corefMentionContainsNer = false;\n\t\t \tboolean repMenContainsNer = false;\n\n//\t\t \n\n\t\t\t\t// We need to subtract one since the indices count from 1 but the Lists start from 0\n\t\t \tList<CoreLabel> tokens = sentences.get(m.sentNum - 1).get(TokensAnnotation.class);\n\t\t // We subtract two for end: one for 0-based indexing, and one because we want last token of mention not one following.\n//\t\t System.out.println(\" \" + m + \", i.e., 0-based character offsets [\" + tokens.get(m.startIndex - 1).beginPosition() +\n//\t\t \", \" + tokens.get(m.endIndex - 2).endPosition() + \")\");\n\t\t \n\t\t int beginCoref = tokens.get(m.startIndex - 1).beginPosition();\n\t\t\t\t int endCoref = tokens.get(m.endIndex - 2).endPosition();\n\t\t\t\t String offsetCorefMention = \"\" + beginCoref + \"-\" + endCoref;\n\t\t\t\t String corefMention = m.mentionSpan;\n\n\t\t\t\t CorefMention RepresentativeMention = entry.getValue().getRepresentativeMention();\n\t\t\t\t repMen = RepresentativeMention.mentionSpan;\n\t\t\t\t List<CoreLabel> repMenTokens = sentences.get(RepresentativeMention.sentNum - 1).get(TokensAnnotation.class);\n//\t\t\t\t System.out.println(\"REPMEN ANNO \" + \"\\\"\" + repMen + \"\\\"\" + \" is representative mention\" +\n// \", i.e., 0-based character offsets [\" + repMenTokens.get(RepresentativeMention.startIndex - 1).beginPosition() +\n//\t\t \", \" + repMenTokens.get(RepresentativeMention.endIndex - 2).endPosition() + \")\");\n\t\t\t\t int beginRepMen = repMenTokens.get(RepresentativeMention.startIndex - 1).beginPosition();\n\t\t\t\t int endRepMen = repMenTokens.get(RepresentativeMention.endIndex - 2).endPosition();\n\t\t\t\t String offsetRepMen = \"\" + beginRepMen + \"-\" + endRepMen;\n\t\t \t \n\t\t\t\t//Determine repMenNer that consists of largest NER (Merkel) to (Angela Merkel)\n\t\t\t\t //and \"Chancellor \"Angela Merkel\" to \"Angela Merkel\"\n\t\t \t //Further reduction to NER as in \"Chancellor Angela Merkel\" to \"Angela Merkel\" is\n\t\t\t\t //done in determineBestSubject. There, Chunk information and subjectHead info is available.\n\t\t\t\t //Chunk info and subjectHead info is used to distinguish \"Chancellor Angela Merkel\" to \"Angela Merkel\"\n\t\t\t\t //from \"The enemies of Angela Merkel\" which is not reduced to \"Angela Merkel\"\n\t\t\t\t //Problem solved: The corefMentions of a particular chain do not necessarily have the same RepMenNer (RepMen) \n\t\t\t\t // any more: Chancellor Angela Merkel repMenNer Chancellor Angela Merkel , then Angela Merkel has RepMenNer Angela Merkel\n\t\t\t\t if (offsetRepMenNer != null && hds.Ner.contains(offsetRepMenNer)){\n//\t\t\t\t\t System.out.println(\"NEWNer.contains(offsetRepMenNer)\");\n\t\t\t\t }\n\t\t\t\t else if (offsetRepMen != null && hds.Ner.contains(offsetRepMen)){\n\t\t\t\t\t repMenNer = repMen;\n\t\t\t\t\t\toffsetRepMenNer = offsetRepMen;\n//\t\t\t\t\t\tSystem.out.println(\"NEWNer.contains(offsetRepMen)\");\n\t\t\t\t }\n\t\t\t\t else if (offsetCorefMention != null && hds.Ner.contains(offsetCorefMention)){\n\t\t\t\t\t\trepMenNer = corefMention;\n\t\t\t\t\t\toffsetRepMenNer = offsetCorefMention;\n//\t\t\t\t\t\tSystem.out.println(\"Ner.contains(offsetCorefMention)\");\n\t\t\t\t\t}\n\t\t\t\t else {\n\t\t\t\t\t corefMentionContainsNer = offsetsContainAnnotation(offsetCorefMention,hds.Ner);\n\t\t\t\t\t repMenContainsNer = offsetsContainAnnotation(offsetRepMen,hds.Ner);\n//\t\t\t\t\t System.out.println(\"ELSE Ner.contains(offsetCorefMention)\");\n\t\t\t\t }\n\t\t\t\t //Determine repMenNer that contains NER\n\t\t\t\t\tif (repMenNer == null){\n\t\t\t\t\t\tif (corefMentionContainsNer){\n\t\t\t\t\t\t\trepMenNer = corefMention;\n\t\t\t\t\t\t\toffsetRepMenNer = offsetCorefMention;\n//\t\t\t\t\t\t\tSystem.out.println(\"DEFAULT1\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (repMenContainsNer){\n\t\t\t\t\t\t\trepMenNer = repMen;\n\t\t\t\t\t\t\toffsetRepMenNer = offsetRepMen;\n//\t\t\t\t\t\t\tSystem.out.println(\"DEFAULT2\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//no NER:\n\t\t\t\t\t\t//Pronoun -> repMen is repMenNer\n\t\t\t\t\t\telse if (hds.PronominalSubject.contains(offsetCorefMention) && repMen != null){\n\t\t\t\t\t\t\trepMenNer = repMen;\n\t\t\t\t\t\t\toffsetRepMenNer = offsetRepMen;\n//\t\t\t\t\t\t\tSystem.out.println(\"DEFAULT3\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t//other no NER: corefMention is repMenNer because it is closer to original\n\t\t\t\t\t\trepMenNer = corefMention;\n\t\t\t\t\t\toffsetRepMenNer = offsetCorefMention;\n//\t\t\t\t\t\tSystem.out.println(\"DEFAULT4\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t \n \t IaiCorefAnnotation corefAnnotation = new IaiCorefAnnotation(aJCas);\n\t\t\t\n\t\t\t\t\t\n\n\n\t\t\t\t\tcorefAnnotation.setBegin(beginCoref);\n\t\t\t\t\tcorefAnnotation.setEnd(endCoref);\n\t\t\t\t\tcorefAnnotation.setCorefMention(corefMention);\n\t\t\t\t\tcorefAnnotation.setCorefChain(chain);\n\t\t\t\t\t//done below\n//\t\t\t\t\tcorefAnnotation.setRepresentativeMention(repMenNer);\n//\t\t\t\t\tcorefAnnotation.addToIndexes(); \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tlistCorefAnnotation.add(corefAnnotation);\n\t\t\t\t\t\n//\t\t\t\t\tdone below:\n//\t\t\t\t\t offsetToRepMen.put(offsetCorefMention, repMenNer);\n//\t\t\t\t\t RepMen.add(offsetCorefMention);\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t }//end coref mention\n//\t\t System.out.println(\"END Chain \" + chain );\n//\t\t System.out.println(listCorefAnnotation.size());\n\t\t String offsetCorefMention = null;\n\t\t for (int i = 0; i < listCorefAnnotation.size(); i++) {\n\t\t \tIaiCorefAnnotation corefAnnotation = listCorefAnnotation.get(i);\n\t\t \tcorefAnnotation.setRepresentativeMention(repMenNer);\n\t\t \tcorefAnnotation.addToIndexes();\n\t\t \toffsetCorefMention = \"\" + corefAnnotation.getBegin() + \"-\" + corefAnnotation.getEnd();\n\t\t\t\t\thds.offsetToRepMen.put(offsetCorefMention, repMenNer);\n\t\t\t\t\thds.RepMen.add(offsetCorefMention);\n\t\t\t\t\t//COREF\n//\t\t\t\t\tSystem.out.println(\"Chain \" + corefAnnotation.getCorefChain());\n//\t\t\t\t\tSystem.out.println(\"corefMention \" + corefAnnotation.getCorefMention() + offsetCorefMention);\n//\t\t\t\t\tSystem.out.println(\"repMenNer \" + repMenNer);\n\t\t }\n\t\t } //end chains\n\n\n//\t\t System.out.println(\"NOW quote finder\");\n\n\n\t\t\n\t\t///* quote finder: begin find quote relation and quotee\n\t\t// direct quotes\n\t\t\n\t\t\n\t\tString quotee_left = null;\n\t\tString quotee_right = null; \n\t\t\n\t\tString representative_quotee_left = null;\n\t\tString representative_quotee_right = null; \n\t\t\n\t\tString quote_relation_left = null;\n\t\tString quote_relation_right = null;\n\t\t\n\t\tString quoteType = null;\n\t\tint quoteeReliability = 5;\n\t\tint quoteeReliability_left = 5;\n\t\tint quoteeReliability_right = 5;\n\t\tint quotee_end = -5;\n\t\tint quotee_begin = -5;\n\t\t\n\t\tboolean quoteeBeforeQuote = false;\n\n\n\t\n\t\t\n\t\t// these are all the quotes in this document\n\t\tList<CoreMap> quotes = document.get(QuotationsAnnotation.class);\n\t\tfor (CoreMap quote : quotes) {\n\t\t\tif (quote.get(TokensAnnotation.class).size() > 5) {\n\t\t\t\tQuoteAnnotation annotation = new QuoteAnnotation(aJCas);\n\n\t\t\t\tint beginQuote = quote.get(TokensAnnotation.class).get(0)\n\t\t\t\t\t\t.beginPosition();\n\t\t\t\tint endQuote = quote.get(TokensAnnotation.class)\n\t\t\t\t\t\t.get(quote.get(TokensAnnotation.class).size() - 1)\n\t\t\t\t\t\t.endPosition();\n\t\t\t\tannotation.setBegin(beginQuote);\n\t\t\t\tannotation.setEnd(endQuote);\n\t\t\t\tannotation.addToIndexes();\n//\t\t\t}\n//\t\t}\n//\t\t\n//\t\tList<Q> newQuotes = document.get(QuotationsAnnotation.class);\t\t\n//\t\tfor (CoreMap annotation : newQuotes) {\n//\t\t\t\tif (1==1){\n//\t\t\t\tRe-initialize markup variables since they are also used for indirect quotes\n\t\t\t\tquotee_left = null;\n\t\t\t\tquotee_right = null; \n\t\t\t\t\n\t\t\t\trepresentative_quotee_left = null;\n\t\t\t\trepresentative_quotee_right = null;\n\t\t\t\t\n\t\t\t\tquote_relation_left = null;\n\t\t\t\tquote_relation_right = null;\n\t\t\t\tquoteeReliability = 5;\n\t\t\t\tquoteeReliability_left = 5;\n\t\t\t\tquoteeReliability_right = 5;\n\t\t\t\tquotee_end = -5;\n\t\t\t\tquotee_begin = -5;\n\t\t\t\tquoteType = \"direct\";\n\t\t\t\tquoteeBeforeQuote = false;\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tList<Token> directQuoteTokens = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\tToken.class, annotation);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tList<Token> followTokens = JCasUtil.selectFollowing(aJCas,\n\t\t\t\t\t\tToken.class, annotation, 1);\n\t\t\t\t\n \n//\t\t\t\tfor (Token aFollowToken: followTokens){\n//\t\t\t\t\t List<Chunk> chunks = JCasUtil.selectCovering(aJCas,\n//\t\t\t\t\tChunk.class, aFollowToken);\n \n//direct quote quotee right:\n\t\t\t\t\n\t for (Token aFollow2Token: followTokens){\n\t\t\t\t\t List<SentenceAnnotation> sentencesFollowQuote = JCasUtil.selectCovering(aJCas,\n\t\t\t\t\t\t\t SentenceAnnotation.class, aFollow2Token);\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t for (SentenceAnnotation sentenceFollowsQuote: sentencesFollowQuote){\n\t\t\t\t\t\t List<Chunk> chunks = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\tChunk.class, sentenceFollowsQuote);\n//\t\t\tSystem.out.println(\"DIRECT QUOTE RIGHT\");\n\t\t\tString[] quote_annotation_result = determine_quotee_and_quote_relation(\"RIGHT\", \n\t\t\t\t\tchunks, hds, annotation);\n\t\t\tif (quote_annotation_result.length>=4){\n\t\t\t quotee_right = quote_annotation_result[0];\n\t\t\t representative_quotee_right = quote_annotation_result[1];\n\t\t\t quote_relation_right = quote_annotation_result[2];\n\t\t\t try {\n\t\t\t\t quoteeReliability = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t quoteeReliability_right = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t //Will Throw exception!\n\t\t\t //do something! anything to handle the exception.\n\t\t\t\tquoteeReliability = -5;\n\t\t\t\tquoteeReliability_right = -5;\n\t\t\t\t}\t\t\t\t\t \n\t\t\t }\n//\t\t\tSystem.out.println(\"DIRECT QUOTE RIGHT RESULT quotee \" + quotee_right + \" representative_quotee \" + representative_quotee_right\n//\t\t\t\t\t+ \" quote_relation \" + quote_relation_right);\n\t\t \n\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\t \n }\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tList<Token> precedingTokens = JCasUtil.selectPreceding(aJCas,\n\t\t\t\t\t\tToken.class, annotation, 1);\n for (Token aPrecedingToken: precedingTokens){ \n \t\n \tif (directQuoteIntro.contains(aPrecedingToken.getLemma().getValue().toString()) \n \t\t\t|| compLemma.contains(aPrecedingToken.getLemma().getValue().toString())) {\n// \t\tSystem.out.println(\"Hello, World lemma found\" + aPrecedingToken.getLemma().getValue());\n \t\tquoteeBeforeQuote = true;\n \t}\n \t\tList <NamedEntity> namedEntities = null;\n \t\tList <Token> tokens = null;\n \t\tList<Chunk> chunks = null;\n \t\t\n\t\t\t\t List<Sentence> precedingSentences = JCasUtil.selectPreceding(aJCas,\n\t\t\t\t \t\tSentence.class, aPrecedingToken, 1);\n\t\t\t\t \n\t\t\t\t\t\tif (precedingSentences.isEmpty()){\n\t\t\t\t\t\t\tList<Sentence> firstSentence;\n\t\t\t\t \tfirstSentence = JCasUtil.selectCovering(aJCas,\n\t\t\t\t \t\tSentence.class, aPrecedingToken);\n\n\t\t\t\t \tfor (Sentence aSentence: firstSentence){\n\t\t\t\t \t\t\n\n\t\t\t\t\t\t\t\tchunks = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\t\tChunk.class, aSentence.getBegin(), aPrecedingToken.getEnd());\n\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t \t\tnamedEntities = JCasUtil.selectCovered(aJCas,\n\t \t \t\tNamedEntity.class, aSentence.getBegin(), aPrecedingToken.getEnd());\n\t\t\t\t \t\ttokens = JCasUtil.selectCovered(aJCas,\n\t\t\t\t \t\t\t\tToken.class, aSentence.getBegin(), aPrecedingToken.getEnd());\n\t\t\t\t \t\n\t\t\t\t \t}\n\t\t\t\t\t\t}\n\t\t\t\t else {\t\n\t\t\t\t \tfor (Sentence aSentence: precedingSentences){\n//\t\t\t\t \t\tSystem.out.println(\"Hello, World sentence\" + aSentence);\n\t\t\t\t \t\tchunks = JCasUtil.selectBetween(aJCas,\n\t\t\t\t \t\t\t\tChunk.class, aSentence, aPrecedingToken);\n\t\t\t\t \t\tnamedEntities = JCasUtil.selectBetween(aJCas,\n\t\t\t\t \t\t\t\tNamedEntity.class, aSentence, aPrecedingToken);\n\t\t\t\t \t\ttokens = JCasUtil.selectBetween(aJCas,\n\t\t\t\t \t\t\t\tToken.class, aSentence, aPrecedingToken);\n\t\t\t\t \t}\n\t\t\t\t }\n \t\n//\t\t\t\t \n//\t\t\t\t\t\tSystem.out.println(\"DIRECT QUOTE LEFT\");\n\t\t\t\t\t\tString[] quote_annotation_direct_left = determine_quotee_and_quote_relation(\"LEFT\", chunks,\n\t\t\t\t\t\t\t\t hds, annotation\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t );\n//\t\t\t\t\t\tSystem.out.println(\"QUOTE ANNOTATION \" + quote_annotation_direct_left.length);\t\t\n\t\tif (quote_annotation_direct_left.length>=4){\n//\t\t\tSystem.out.println(\"QUOTE ANNOTATION UPDATE \" + quote_annotation_direct_left[0] +\n//\t\t\t\t\t\" \" + quote_annotation_direct_left[1] + \" \" +\n//\t\t\t\t\tquote_annotation_direct_left[2]);\n\t\t quotee_left = quote_annotation_direct_left[0];\n\t\t representative_quotee_left = quote_annotation_direct_left[1];\n\t\t quote_relation_left = quote_annotation_direct_left[2];\n\t\t try {\n\t\t\t quoteeReliability = Integer.parseInt(quote_annotation_direct_left[3]);\n\t\t\t quoteeReliability_left = Integer.parseInt(quote_annotation_direct_left[3]);\n\t\t\t} catch (NumberFormatException e) {\n\t\t //Will Throw exception!\n\t\t //do something! anything to handle the exception.\n\t\t\tquoteeReliability = -5;\n\t\t\tquoteeReliability_left = -5;\n\t\t\t}\t\t\t\t\t \n\t\t }\n//\t\tSystem.out.println(\"DIRECT QUOTE LEFT RESULT quotee \" + quotee_left + \" representative_quotee \" + representative_quotee_left\n//\t\t\t\t+ \" quote_relation \" + quote_relation_left);\n\t\t//no subject - predicate quotee quote_relation, quote introduced with colon: \n\t\tif (quotee_left == null && quote_relation_left == null && representative_quotee_left == null \n\t\t&& directQuoteIntro.contains(aPrecedingToken.getLemma().getValue().toString())){\n//\t\t\tSystem.out.println(\"NER DIRECT QUOTE LEFT COLON\");\n\t\t\tString quoteeCandOffset = null; \n\t\t\tString quoteeCandText = null;\n\t\t if (namedEntities.size() == 1){\n \t \tfor (NamedEntity ne : namedEntities){\n// \t \t\tSystem.out.println(\"ONE NER \" + ne.getCoveredText());\n \t \t\tquoteeCandText = ne.getCoveredText();\n\t\t\t\t\tquote_relation_left = aPrecedingToken.getLemma().getValue().toString();\n\t\t\t\t\tquotee_end = ne.getEnd();\n\t\t\t\t\tquotee_begin = ne.getBegin();\n\t\t\t\t\tquoteeCandOffset = \"\" + quotee_begin + \"-\" + quotee_end;\n\t\t\t\t\tquoteeReliability = 1;\n\t\t\t\t\tquoteeReliability_left = 1;\n \t }\n \t }\n \t else if (namedEntities.size() > 1) {\n \t \tint count = 0;\n \t \tString quotee_cand = null;\n// \t \tSystem.out.println(\"Hello, World ELSE SEVERAL NER\");\n \t \tfor (NamedEntity ner : namedEntities){\n// \t \t\tSystem.out.println(\"Hello, World NER TYPE\" + ner.getValue());\n \t \t\tif (ner.getValue().equals(\"PERSON\")){\n \t \t\t\tcount = count + 1;\n \t \t\t\tquotee_cand = ner.getCoveredText();\n \t \t\t\tquotee_end = ner.getEnd();\n \t \t\t\tquotee_begin = ner.getBegin();\n \t \t\t\tquoteeCandOffset = \"\" + quotee_begin + \"-\" + quotee_end;\n \t \t\t\t\n// \t \t\t\tSystem.out.println(\"Hello, World FOUND PERSON\" + quotee_cand);\n \t \t\t}\n \t \t}\n \t \tif (count == 1){ // there is exactly one NER.PERSON\n// \t \t\tSystem.out.println(\"ONE PERSON, SEVERAL NER \" + quotee_cand);\n \t \t\t\tquoteeCandText = quotee_cand;\n\t\t\t\t\t\tquote_relation_left = aPrecedingToken.getLemma().getValue().toString();\n\t\t\t\t\t\tquoteeReliability = 3;\n\t\t\t\t\t\tquoteeReliability_left = 3;\n \t \t}\n \t }\n\t\t if(quoteeCandOffset != null && quoteeCandText != null ){\n//\t\t \t quotee_left = quoteeCandText;\n\t\t \t String result [] = determineBestRepMenSubject(\n\t\t \t\t\t quoteeCandOffset,quoteeCandOffset, quoteeCandText, hds);\n\t\t \t if (result.length>=2){\n\t\t \t\t quotee_left = result [0];\n\t\t \t\t representative_quotee_left = result [1];\n//\t\t \t System.out.println(\"RESULT2 NER quotee \" + quotee_left + \" representative_quotee \" + representative_quotee_left);\n\t\t \t }\n\t\t }\n\t\t}\n }\n\t\t\n \n\n\t\t\t\t\n\t\t\t\tif (quotee_left != null && quotee_right != null){\n//\t\t\t\t\tSystem.out.println(\"TWO QUOTEES\");\n\t\t\t\t\t\n\t\t\t\t\tif (directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\".\") \n\t\t\t\t\t\t|| \tdirectQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"!\")\n\t\t\t\t\t\t|| directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"?\")\n\t\t\t\t\t\t\t){\n//\t\t\t\t\t\tSystem.out.println(\"PUNCT \" + quotee_left + quote_relation_left + quoteeReliability_left);\n\t\t\t\t\t\tannotation.setQuotee(quotee_left);\n\t\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_left);\n\n\t\t\t\t\t}\n\t\t\t\t\telse if (directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\",\")){\n//\t\t\t\t\t\tSystem.out.println(\"COMMA \" + quotee_right + \" \" + quote_relation_right + \" \" + quoteeReliability_right);\n\t\t\t\t\t\tannotation.setQuotee(quotee_right);\n\t\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_right);\n\t\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_right);\n\t\t\t\t\t}\n\t\t\t\t\telse if (!directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\".\")\n\t\t\t\t\t\t\t&& !directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"!\")\n\t\t\t\t\t\t\t&& !directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"?\")\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t){\n//\t\t\t\t\t\tSystem.out.println(\"NO PUNCT \" + quotee_right + \" \" + quote_relation_right + \" \" + quoteeReliability_right);\n\t\t\t\t\t\tannotation.setQuotee(quotee_right);\n\t\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_right);\n\t\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_right);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n//\t\t\t\t\t\tSystem.out.println(\"UNCLEAR LEFT RIGHT \" + quotee_left + quote_relation_left + quote + quotee_right + quote_relation_right);\n\t\t\t\t\tannotation.setQuotee(\"<unclear>\");\n\t\t\t\t\tannotation.setQuoteRelation(\"<unclear>\");\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (quoteeBeforeQuote == true){\n\t\t\t\t\tannotation.setQuotee(quotee_left);\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t}\n\t\t\t\telse if (quotee_left != null){\n//\t\t\t\t\tSystem.out.println(\"QUOTEE LEFT\" + quotee_left + quote_relation_left + quoteeReliability_left);\n\t\t\t\t\tannotation.setQuotee(quotee_left);\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t}\n\t\t\t\telse if (quotee_right != null){\n//\t\t\t\t\tSystem.out.println(\"QUOTEE RIGHT FOUND\" + quotee_right + \" QUOTE RELATION \" + quote_relation_right + \":\" + quoteeReliability_right);\n\t\t\t\t\tannotation.setQuotee(quotee_right);\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_right);\n\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_right);\n\t\t\t\t}\n\t\t\t\telse if (quote_relation_left != null ){\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n//\t\t\t\t\tSystem.out.println(\"NO QUOTEE FOUND\" + quote + quote_relation_left + quote_relation_right);\n\t\t\t\t}\n\t\t\t\telse if (quote_relation_right != null){\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t}\n\t\t\t\telse if (quoteType != null){\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n//\t\t\t\t\tSystem.out.println(\"Hello, World NO QUOTEE and NO QUOTE RELATION FOUND\" + quote);\n\t\t\t\t}\n\t\t\t\tif (annotation.getRepresentativeQuoteeMention() != null){\n//\t\t\t\t\tSystem.out.println(\"NOW!!\" + annotation.getRepresentativeQuoteeMention());\n\t\t\t\t\tif (hds.dbpediaSurfaceFormToDBpediaLink.containsKey(annotation.getRepresentativeQuoteeMention())){\n\t\t\t\t\t\tannotation.setQuoteeDBpediaUri(hds.dbpediaSurfaceFormToDBpediaLink.get(annotation.getRepresentativeQuoteeMention()));\n//\t\t\t\t\t\tSystem.out.println(\"DBPRED FOUND\" + annotation.getRepresentativeQuoteeMention() + \" URI: \" + annotation.getQuoteeDBpediaUri());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} //for direct quote\n\t\t\n\t\t// annotate indirect quotes: opinion verb + 'that' ... until end of sentence: said that ...\n\n//\t\tList<CoreMap> sentences = document.get(SentencesAnnotation.class); //already instantiated above\nINDIRECTQUOTE:\t\tfor (CoreMap sentence : sentences) {\n//\t\t\tif (sentence.get(TokensAnnotation.class).size() > 5) { \n\t\t\t\tSentenceAnnotation sentenceAnn = new SentenceAnnotation(aJCas);\n\t\t\t\t\n\t\t\t\tint beginSentence = sentence.get(TokensAnnotation.class).get(0)\n\t\t\t\t\t\t.beginPosition();\n\t\t\t\tint endSentence = sentence.get(TokensAnnotation.class)\n\t\t\t\t\t\t.get(sentence.get(TokensAnnotation.class).size() - 1)\n\t\t\t\t\t\t.endPosition();\n\t\t\t\tsentenceAnn.setBegin(beginSentence);\n\t\t\t\tsentenceAnn.setEnd(endSentence);\n//\t\t\t\tsentenceAnn.addToIndexes();\n\t\t\t\t\n\t\t\t\tQuoteAnnotation indirectQuote = new QuoteAnnotation(aJCas);\n\t \tint indirectQuoteBegin = -5;\n\t\t\t\tint indirectQuoteEnd = -5;\n\t\t\t\tboolean subsequentDirectQuoteInstance = false;\n\t\t\t\t\n\t\t\t\tList<Chunk> chunksIQ = JCasUtil.selectCovered(aJCas,\n\t\t\t\tChunk.class, sentenceAnn);\n\t\t\t\tList<Chunk> chunksBeforeIndirectQuote = null;\n\t\t\t\t\n\t\t\t\tint index = 0;\nINDIRECTCHUNK:\tfor (Chunk aChunk : chunksIQ) {\n\t\t\t\t\tindex++;\n\t\t\t\t\t\n//\t\t\t\t\tSystem.out.println(\"INDIRECT QUOTE CHUNK VALUE \" + aChunk.getChunkValue().toString());\n//\t\t\t\t\tif (aChunk.getChunkValue().equals(\"SBAR\")) {\n\t\t\t\t\tif(indirectQuoteIntroChunkValue.contains(aChunk.getChunkValue())){\n//\t\t\t\t\t\tSystem.out.println(\"INDIRECT QUOTE INDEX \" + \"\" + index);\n\t\t\t\t\t\t\n\t\t\t\t\t\tList<Token> tokensSbar = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\tToken.class, aChunk);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (Token aTokenSbar : tokensSbar){\n//\t\t\t\t\t\t\tString that = \"that\";\n\t\t\t\t\t\t\tif (compLemma.contains(aTokenSbar.getLemma().getCoveredText())){\n\t\t\t\t\t\t// VP test: does that clause contain VP?\n//\t\t\t\t\t\t\t\tSystem.out.println(\"TOK1\" + aTokenSbar.getLemma().getCoveredText());\n//\t\t\t \tQuoteAnnotation indirectQuote = new QuoteAnnotation(aJCas);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t indirectQuoteBegin = aChunk.getEnd() + 1;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t chunksBeforeIndirectQuote = chunksIQ.subList(0, index-1);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//NEW\n//\t\t\t\t\t\t\t\tif (LANGUAGE == \"en\")\n\t\t\t\t\t\t\t\tList<Token> precedingSbarTokens = JCasUtil.selectPreceding(aJCas,\n\t\t\t\t\t\t\t\t\t\tToken.class, aChunk, 1);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfor (Token aPrecedingSbarToken: precedingSbarTokens){ \n//\t\t\t\t\t\t\t\t\tSystem.out.println(\"TOK2\" + aPrecedingSbarToken.getLemma().getCoveredText());\n\t\t\t\t \tif (coordLemma.contains(aPrecedingSbarToken.getLemma().getValue().toString())){\n//\t\t\t\t \t\tSystem.out.println(\"TOKK\" + aPrecedingSbarToken.getLemma().getCoveredText());\n\t\t\t\t \t\tchunksBeforeIndirectQuote = chunksIQ.subList(0, index-1);\n\t\t\t\t \t\tint k = 0;\n\t\t\t\t \tSAY:\tfor (Chunk chunkBeforeAndThat : chunksBeforeIndirectQuote){\n//\t\t\t\t \t\t\txxxx\n\t\t\t\t \t\tk++;\n\t\t\t\t \t\t\tif (chunkBeforeAndThat.getChunkValue().equals(\"VP\")){\n\t\t\t\t \t\t\t\t\n\t\t\t\t \t\t\t\tList<Token> tokensInVp = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tToken.class, chunkBeforeAndThat);\n\t\t\t\t\t\t\t\t\t\t\t\tfor (Token aTokenInVp : tokensInVp){\n//\t\t\t\t\t\t\t\t\t\t\t\t\tString and;\n//\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"TOKK\" + aTokenInVp.getLemma().getCoveredText());\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (aTokenInVp.getLemma().getValue().equals(\"say\")){\n//\t\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"SAY OLD\" + indirectQuoteBegin + \":\" + sentenceAnn.getCoveredText());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tchunksBeforeIndirectQuote = chunksIQ.subList(0, k);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tindirectQuoteBegin = chunksBeforeIndirectQuote.get(chunksBeforeIndirectQuote.size()-1).getEnd()+1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"SAY NEW\" + indirectQuoteBegin + \":\" );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak SAY;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t \t\t\t\t\n\t\t\t\t \t\t\t\t\n\t\t\t\t \t\t\t}\n\t\t\t\t \t\t\t\n\t\t\t\t \t\t\t\n\t\t\t\t \t\t}\n\t\t\t\t \t\t\n\t\t\t\t \t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tList<QuoteAnnotation> coveringDirectQuoteChunk = JCasUtil.selectCovering(aJCas,\n\t\t\t\t\t\t\t\t\t\tQuoteAnnotation.class, aChunk);\n\t\t\t\t\t\t\t\tif (coveringDirectQuoteChunk.isEmpty()){\n//\t\t\t\t\t\t\t\t indirectQuoteBegin = aChunk.getEnd() + 1;\n\t\t\t\t\t\t\t\t indirectQuote.setBegin(indirectQuoteBegin);\n//\t\t\t\t\t\t\t\t chunksBeforeIndirectQuote = chunksIQ.subList(0, index-1);\n\t\t\t\t\t\t\t\t indirectQuoteEnd = sentenceAnn.getEnd();\n\t\t\t\t\t\t\t\t indirectQuote.setEnd(indirectQuoteEnd);\n\t\t\t\t\t\t\t\t indirectQuote.addToIndexes();\n\t\t\t\t\t\t\t\t subsequentDirectQuoteInstance = false;\n//\t\t\t\t\t\t\t\t System.out.println(\"SUBSEQUENT FALSE\");\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t List<Token> followTokens = JCasUtil.selectFollowing(aJCas,\n\t\t\t\t\t\t\t\t\t\t\tToken.class, indirectQuote, 1);\n\t\t\t\t\t\t\t\t for (Token aFollow3Token: followTokens){\n\t\t\t\t\t\t\t\t\t List<QuoteAnnotation> subsequentDirectQuotes = JCasUtil.selectCovering(aJCas,\n\t\t\t\t\t\t\t\t\t\t\tQuoteAnnotation.class,aFollow3Token);\n\t\t\t\t\t\t\t\t\t if (!subsequentDirectQuotes.isEmpty()){\n\t\t\t\t\t\t\t\t\t\t for (QuoteAnnotation subsequentDirectQuote: subsequentDirectQuotes){\n\t\t\t\t\t\t\t\t\t\t\t if (subsequentDirectQuote.getRepresentativeQuoteeMention() != null\n\t\t\t\t\t\t\t\t\t\t\t\t && subsequentDirectQuote.getRepresentativeQuoteeMention().equals(\"<unclear>\")){\n//\t\t\t\t\t\t\t\t\t\t\t System.out.println(\"SUBSEQUENT FOUND\"); \n\t\t\t\t\t\t\t\t\t\t\t hds.subsequentDirectQuote = subsequentDirectQuote;\n\t\t\t\t\t\t\t\t\t\t\t subsequentDirectQuoteInstance = true;\n\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t break INDIRECTCHUNK;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\n\t\t\t\t}\n\t\t\t\t\tif (indirectQuoteBegin >= 0 && indirectQuoteEnd >= 0){\n//\t\t\t\t\t\tList<QuoteAnnotation> coveringDirectQuote = JCasUtil.selectCovering(aJCas,\n//\t\t\t\t\t\t\t\tQuoteAnnotation.class, indirectQuote);\n//\t\t\t\t\t\tif (coveringDirectQuote.isEmpty()){\n////\t\t\t\t\t\t\t\n//\t\t\t\t\t\tindirectQuote.addToIndexes();\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\telse {\n//\t\t\t\t\t\t\t//indirect quote is covered by direct quote and therefore discarded\n//\t\t\t\t\t\t\tcontinue INDIRECTQUOTE;\n//\t\t\t\t\t\t}\n\t\t\t\t\tList<QuoteAnnotation> coveredDirectQuotes = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\tQuoteAnnotation.class, indirectQuote);\n\t\t\t\t\tfor (QuoteAnnotation coveredDirectQuote : coveredDirectQuotes){\n//\t\t\t\t\t\tSystem.out.println(\"Hello, World covered direct quote\" + coveredDirectQuote.getCoveredText());\n\t\t\t\t\t\t//delete coveredDirectQuoteIndex\n\t\t\t\t\t\tcoveredDirectQuote.removeFromIndexes();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t//no indirect quote in sentence\n\t\t\t\t\t\tcontinue INDIRECTQUOTE;\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n//\t\t\t\t\t\tRe-initialize markup variables since they are also used for direct quotes\n\t\t\t\t\t\tquotee_left = null;\n\t\t\t\t\t\tquotee_right = null; \n\t\t\t\t\t\t\n\t\t\t\t\t\trepresentative_quotee_left = null;\n\t\t\t\t\t\trepresentative_quotee_right = null;\n\t\t\t\t\t\t\n\t\t\t\t\t\tquote_relation_left = null;\n\t\t\t\t\t\tquote_relation_right = null;\n\t\t\t\t\t\t\n\t\t\t\t\t\tquoteType = \"indirect\";\n\t\t\t\t\t\tquoteeReliability = 5;\n\t\t\t\t\t\tquoteeReliability_left = 5;\n\t\t\t\t\t\tquoteeReliability_right = 5;\n\t\t\t\t\t\tquotee_end = -5;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\tif (chunksBeforeIndirectQuote != null){\n//\t\t\t\t\t\t\tSystem.out.println(\"chunksBeforeIndirectQuote FOUND!! \");\n\t\t\t\t\t\t\tString[] quote_annotation_result = determine_quotee_and_quote_relation(\"LEFT\", chunksBeforeIndirectQuote,\n\t\t\t\t\t\t\t\t\t hds, indirectQuote\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t );\n\t\t\tif (quote_annotation_result.length>=4){\n\t\t\t quotee_left = quote_annotation_result[0];\n\t\t\t representative_quotee_left = quote_annotation_result[1];\n\t\t\t quote_relation_left = quote_annotation_result[2];\n//\t\t\t System.out.println(\"INDIRECT QUOTE LEFT RESULT quotee \" + quotee_left + \" representative_quotee \" + representative_quotee_left\n//\t\t\t\t\t + \" QUOTE RELATION \" + quote_relation_left);\n\t\t\t try {\n\t\t\t\t quoteeReliability = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t quoteeReliability_left = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\tquoteeReliability = -5;\n\t\t\t\tquoteeReliability_left = -5;\n\t\t\t\t}\t\t\t\t\t \n\t\t\t }\n\t\t\t\n\t\t\t}\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (quotee_left != null){\n\t\t\t\t\t\t\tindirectQuote.setQuotee(quotee_left);\n\t\t\t\t\t\t\tindirectQuote.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\t\tindirectQuote.setQuoteType(quoteType);\n\t\t\t\t\t\t\tindirectQuote.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\t\t\tindirectQuote.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//indirect quote followed by direct quote:\n\t\t\t\t\t\t\t//the quotee and quote relation of the indirect quote are copied to the direct quote \n\t\t\t\t\t\t\t//Genetic researcher Otmar Wiestler hopes that the government's strict controls on genetic research \n\t\t\t\t\t\t\t//will be relaxed with the advent of the new ethics commission. \n\t\t\t\t\t\t\t//\"For one thing the government urgently needs advice, because of course it's such an extremely \n\t\t\t\t\t\t\t//complex field. And one of the reasons Chancellor Schröder formed this new commission was without \n\t\t\t\t\t\t\t//a doubt to create his own group of advisors.\"\n\n\t\t\t\t\t\t\tif (subsequentDirectQuoteInstance == true\n\t\t\t\t\t\t\t\t&&\thds.subsequentDirectQuote.getRepresentativeQuoteeMention().equals(\"<unclear>\")\n\t\t\t\t\t\t\t\t&& \thds.subsequentDirectQuote.getQuotee().equals(\"<unclear>\")\n\t\t\t\t\t\t\t\t&& \thds.subsequentDirectQuote.getQuoteRelation().equals(\"<unclear>\")\n\t\t\t\t\t\t\t\t\t){\n//\t\t\t\t\t\t\t\tSystem.out.println(\"SUBSEQUENT UNCLEAR DIR QUOTE FOUND!!\"); \n\t\t\t\t\t\t\t\tint begin = hds.subsequentDirectQuote.getBegin();\n\t\t\t\t\t\t\t\tint end = hds.subsequentDirectQuote.getEnd();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuotee(quotee_left);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuoteType(\"direct\");\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuoteeReliability(quoteeReliability_left + 2);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.addToIndexes();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\tSystem.out.println(\"Hello, World INDIRECT QUOTE \" + quotee_left + quote_relation_left + quoteeReliability);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (quote_relation_left != null){\n\t\t\t\t\t\t\tindirectQuote.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\t\tindirectQuote.setQuoteType(quoteType);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\telse if (quoteType != null){\n\t\t\t\t\t\t\tindirectQuote.setQuoteType(quoteType);\n//\t\t\t\t\t\t\tSystem.out.println(\"Hello, World INDIRECT QUOTE NOT FOUND\" + quote_relation_left);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (indirectQuote.getRepresentativeQuoteeMention() != null){\n//\t\t\t\t\t\t\tSystem.out.println(\"NOW!!\" + indirectQuote.getRepresentativeQuoteeMention());\n\t\t\t\t\t\t\tif (hds.dbpediaSurfaceFormToDBpediaLink.containsKey(indirectQuote.getRepresentativeQuoteeMention())){\n\t\t\t\t\t\t\t\tindirectQuote.setQuoteeDBpediaUri(hds.dbpediaSurfaceFormToDBpediaLink.get(indirectQuote.getRepresentativeQuoteeMention()));\n//\t\t\t\t\t\t\t\tSystem.out.println(\"DBPEDIA \" + indirectQuote.getRepresentativeQuoteeMention() + \" URI: \" + hds.dbpediaSurfaceFormToDBpediaLink.get(indirectQuote.getRepresentativeQuoteeMention()));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t }\n//\t\t\t} //for chunk\n//\t\t\t\tsay without that\n//\t\t\t}\t\t\n\t\t} //Core map sentences indirect quotes\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public PoaMaestroMultivaloresHTML() {\n/* 253 */ this(StandardDocumentLoader.getInstance());\n/* */ \n/* 255 */ buildDocument();\n/* */ }", "@Test\n public void testExtractTextFromDocument_String()\n {\n \n PDFExtractor instance = new PDFExtractor();\n \n String expResult = page1 + \"\\n\" + page2;\n String result = instance.extractTextFromDocument(pathToFile);\n \n assertEquals(expResult, result);\n }", "public ArrayList<String> makeSentences(String text) {\n \t\t/*\n \t\t * Quick check so we're not trying to split up an empty\n \t\t * String. This only happens right before the user types\n \t\t * at the end of a document and we don't have anything to\n \t\t * split, so return.\n \t\t */\n \t\tif (text.equals(\"\")) {\n \t\t\tArrayList<String> sents = new ArrayList<String>();\n \t\t\tsents.add(\"\");\n \t\t\treturn sents;\n \t\t}\n \t\t\n \t\t/**\n \t\t * Because the eosTracker isn't initialized until the TaggedDocument is,\n \t\t * it won't be ready until near the end of DocumentProcessor, in which\n \t\t * case we want to set it to the correct\n \t\t */\n \t\tthis.eosTracker = main.editorDriver.taggedDoc.eosTracker;\n \t\tthis.editorDriver = main.editorDriver;\n \t\t\n \t\tArrayList<String> sents = new ArrayList<String>(ANONConstants.EXPECTED_NUM_OF_SENTENCES);\n \t\tArrayList<String> finalSents = new ArrayList<String>(ANONConstants.EXPECTED_NUM_OF_SENTENCES);\n \t\tboolean mergeNext = false;\n \t\tboolean mergeWithLast = false;\n \t\tboolean forceNoMerge = false;\n \t\tint currentStart = 1;\n \t\tint currentStop = 0;\n \t\tString temp;\n \n \t\t/**\n \t\t * replace unicode format characters that will ruin the regular\n \t\t * expressions (because non-printable characters in the document still\n \t\t * take up indices, but you won't know they're there untill you\n \t\t * \"arrow\" though the document and have to hit the same arrow twice to\n \t\t * move past a certain point. Note that we must use \"Cf\" rather than\n \t\t * \"C\". If we use \"C\" or \"Cc\" (which includes control characters), we\n \t\t * remove our newline characters and this screws up the document. \"Cf\"\n \t\t * is \"other, format\". \"Cc\" is \"other, control\". Using \"C\" will match\n \t\t * both of them.\n \t\t */\n \t\ttext = text.replaceAll(\"\\u201C\",\"\\\"\");\n \t\ttext = text.replaceAll(\"\\u201D\",\"\\\"\");\n \t\ttext = text.replaceAll(\"\\\\p{Cf}\",\"\");\n \n \t\tint lenText = text.length();\n \t\tint index = 0;\n \t\tint buffer = editorDriver.sentIndices[0];\n \t\tString safeString = \"\";\n \t\tMatcher abbreviationFinder = ABBREVIATIONS_PATTERN.matcher(text);\n \t\t\n \t\t//================ SEARCHING FOR ABBREVIATIONS ================\n \t\twhile (index < lenText-1 && abbreviationFinder.find(index)) {\n \t\t\tindex = abbreviationFinder.start();\n \t\t\t\n \t\t\ttry {\n \t\t\t\tint abbrevLength = index;\n \t\t\t\twhile (text.charAt(abbrevLength) != ' ') {\n \t\t\t\t\tabbrevLength--;\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif (ABBREVIATIONS.contains(text.substring(abbrevLength+1, index+1))) {\n \t\t\t\t\teosTracker.setIgnore(index+buffer, true);\n \t\t\t\t}\n \t\t\t} catch (Exception e) {}\n \t\t\t\n \t\t\tindex++;\n \t\t}\t\t\n \t\t\n \t\tMatcher sent = EOS_chars.matcher(text);\n \t\tboolean foundEOS = sent.find(currentStart); // xxx TODO xxx take this EOS character, and if not in quotes, swap it for a permanent replacement, and create and add an EOS to the calling TaggedDocument's eosTracker.\n \t\t\n \t\t/*\n \t\t * We want to check and make sure that the EOS character (if one was found) is not supposed to be ignored. If it is, we will act like we did not\n \t\t * find it. If there are multiple sentences with multiple EOS characters passed it will go through each to check, foundEOS will only be true if\n \t\t * an EOS exists in \"text\" that would normally be an EOS character and is not set to be ignored.\n \t\t */\n \t\t\n \t\tindex = 0;\n \t\tif (foundEOS) {\t\n \t\t\ttry {\n \t\t\t\twhile (index < lenText-1 && sent.find(index)) {\n \t\t\t\t\tindex = sent.start();\n \t\t\t\t\tif (!eosTracker.sentenceEndAtIndex(index+buffer)) {\n \t\t\t\t\t\tfoundEOS = false;\n \t\t\t\t\t} else {\n \t\t\t\t\t\tfoundEOS = true;\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t\tindex++;\n \t\t\t\t}\n \t\t\t} catch (IllegalStateException e) {}\n \t\t}\n \t\t//We need to reset the Matcher for the code below\n \t\tsent = EOS_chars.matcher(text);\n \t\tsent.find(currentStart);\n \t\t\n \t\tMatcher sentEnd;\n \t\tMatcher citationFinder;\n \t\tboolean hasCitation = false;\n \t\tint charNum = 0;\n \t\tint lenTemp = 0;\n \t\tint lastQuoteAt = 0;\n \t\tint lastParenAt = 0;\n \t\tboolean foundQuote = false;\n \t\tboolean foundParentheses = false;\n \t\tboolean isSentence;\n \t\tboolean foundAtLeastOneEOS = foundEOS;\n \t\t\n \t\t/**\n \t\t * Needed otherwise when the user has text like below:\n \t\t * \t\tThis is my sentence one. This is \"My sentence?\" two. This is the last sentence.\n \t\t * and they begin to delete the EOS character as such:\n \t\t * \t\tThis is my sentence one. This is \"My sentence?\" two This is the last sentence.\n \t\t * Everything gets screwed up. This is because the operations below operate as expected only when there actually is an EOS character\n \t\t * at the end of the text, it expects it there in order to function properly. Now usually if there is no EOS character at the end it wouldn't\n \t\t * matter since the while loop and !foundAtLeastOneEOS conditional are executed properly, BUT as you can see the quotes, or more notably the EOS character inside\n \t\t * the quotes, triggers this initial test and thus the operation breaks. This is here just to make sure that does not happen.\n \t\t */\n \t\tString trimmedText = text.trim();\n \t\tint trimmedTextLength = trimmedText.length();\n \n \t\t//We want to make sure that if there is an EOS character at the end that it is not supposed to be ignored\n \t\tboolean EOSAtSentenceEnd = true;\n \t\tif (trimmedTextLength != 0) {\n \t\t\tEOSAtSentenceEnd = EOS.contains(trimmedText.substring(trimmedTextLength-1, trimmedTextLength)) && eosTracker.sentenceEndAtIndex(editorDriver.sentIndices[1]-1);\n \t\t} else {\n \t\t\tEOSAtSentenceEnd = false;\n \t\t}\n \t\t\n \t\t//Needed so that if we are deleting abbreviations like \"Ph.D.\" this is not triggered.\n \t\tif (!EOSAtSentenceEnd && (editorDriver.taggedDoc.watchForEOS == -1))\n \t\t\tEOSAtSentenceEnd = true;\n \n \t\twhile (foundEOS == true) {\n \t\t\tcurrentStop = sent.end();\n \t\t\t\n \t\t\t//We want to make sure currentStop skips over ignored EOS characters and stops only when we hit a true EOS character\n \t\t\ttry {\n \t\t\t\twhile (!eosTracker.sentenceEndAtIndex(currentStop+buffer-1) && currentStop != lenText) {\n \t\t\t\t\tsent.find(currentStop+1);\n \t\t\t\t\tcurrentStop = sent.end();\n \t\t\t\t}\n \t\t\t} catch (Exception e) {}\n \n \t\t\ttemp = text.substring(currentStart-1,currentStop);\n \t\t\tlenTemp = temp.length();\n \t\t\tlastQuoteAt = 0;\n \t\t\tlastParenAt = 0;\n \t\t\tfoundQuote = false;\n \t\t\tfoundParentheses = false;\n \t\t\t\n \t\t\tfor(charNum = 0; charNum < lenTemp; charNum++){\n \t\t\t\tif (temp.charAt(charNum) == '\\\"') {\n \t\t\t\t\tlastQuoteAt = charNum;\n \t\t\t\t\t\n \t\t\t\t\tif (foundQuote == true)\n \t\t\t\t\t\tfoundQuote = false;\n \t\t\t\t\telse\n \t\t\t\t\t\tfoundQuote = true;\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif (temp.charAt(charNum) == '(') {\n \t\t\t\t\tlastParenAt = charNum;\n \t\t\t\t\t\n \t\t\t\t\tif (foundParentheses)\n \t\t\t\t\t\tfoundParentheses = false;\n \t\t\t\t\telse\n \t\t\t\t\t\tfoundParentheses = true;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tif (foundQuote == true && ((temp.indexOf(\"\\\"\",lastQuoteAt+1)) == -1)) { // then we found an EOS character that shouldn't split a sentence because it's within an open quote.\n \t\t\t\tif ((currentStop = text.indexOf(\"\\\"\",currentStart +lastQuoteAt+1)) == -1) {\n \t\t\t\t\tcurrentStop = text.length(); // if we can't find a closing quote in the rest of the input text, then we assume the author forgot to put a closing quote, and act like it's at the end of the input text.\n \t\t\t\t}\n \t\t\t\telse{\n \t\t\t\t\tcurrentStop +=1;\n \t\t\t\t\tmergeNext=true;// the EOS character we are looking for is not in this section of text (section being defined as a substring of 'text' between two EOS characters.)\n \t\t\t\t}\n \t\t\t}\n \t\t\tsafeString = text.substring(currentStart-1,currentStop);\n \t\t\t\n \t\t\tif (foundParentheses && ((temp.indexOf(\")\", lastParenAt+1)) == -1)) {\n \t\t\t\tif ((currentStop = text.indexOf(\")\", currentStart + lastParenAt + 1)) == -1)\n \t\t\t\t\tcurrentStop = text.length();\n \t\t\t\telse {\n \t\t\t\t\tcurrentStop += 1;\n \t\t\t\t\tmergeNext = true;\n \t\t\t\t}\n \t\t\t}\n \t\t\tsafeString = text.substring(currentStart-1,currentStop);\n \n \t\t\tif (foundQuote) {\n \t\t\t\tsentEnd = SENTENCE_QUOTE.matcher(text);\t\n \t\t\t\tisSentence = sentEnd.find(currentStop-2); // -2 so that we match the EOS character before the quotes (not -1 because currentStop is one greater than the last index of the string -- due to the way substring works, which is includes the first index, and excludes the end index: [start,end).)\n \n \t\t\t\tif (isSentence == true) { // If it seems that the text looks like this: He said, \"Hello.\" Then she said, \"Hi.\" \n \t\t\t\t\t// Then we want to split this up into two sentences (it's possible to have a sentence like this: He said, \"Hello.\")\n \t\t\t\t\tcurrentStop = text.indexOf(\"\\\"\",sentEnd.start())+1;\n \t\t\t\t\tsafeString = text.substring(currentStart-1,currentStop);\n \t\t\t\t\tforceNoMerge = true;\n \t\t\t\t\tmergeNext = false;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tif (foundParentheses) {\n \t\t\t\tsentEnd = SENTENCE_PARENTHESES.matcher(text);\n \t\t\t\tisSentence = sentEnd.find(currentStop-2);\n \t\t\t\t\n \t\t\t\tif (isSentence == true) {\n \t\t\t\t\tcurrentStop = text.indexOf(\")\", sentEnd.start()) + 1;\n \t\t\t\t\tsafeString = text.substring(currentStart-1, currentStop);\n \t\t\t\t\tforceNoMerge = true;\n \t\t\t\t\tmergeNext = false;\n \t\t\t\t}\n \t\t\t}\n \n \t\t\t// now check to see if there is a CITATION after the sentence (doesn't just apply to quotes due to paraphrasing)\n \t\t\t// The rule -- at least as of now -- is if after the EOS mark there is a set of parenthesis containing either one word (name) or a name and numbers (name 123) || (123 name) || (123-456 name) || (name 123-456) || etc..\n \t\t\tcitationFinder = CITATION.matcher(text.substring(currentStop));\t\n \t\t\thasCitation = citationFinder.find(); // -2 so that we match the EOS character before the quotes (not -1 because currentStop is one greater than the last index of the string -- due to the way substring works, which is includes the first index, and excludes the end index: [start,end).)\n \t\t\t\n \t\t\tif (hasCitation == true) { // If it seems that the text looks like this: He said, \"Hello.\" Then she said, \"Hi.\" \n \t\t\t\t// Then we want to split this up into two sentences (it's possible to have a sentence like this: He said, \"Hello.\")\n \t\t\t\tcurrentStop = text.indexOf(\")\",citationFinder.start()+currentStop)+1;\n \t\t\t\tsafeString = text.substring(currentStart-1,currentStop);\n \t\t\t\tmergeNext = false;\n \t\t\t}\t\n \t\t\t\n \t\t\tif (mergeWithLast) {\n \t\t\t\tmergeWithLast=false;\n \t\t\t\tString prev=sents.remove(sents.size()-1);\n \t\t\t\tsafeString=prev+safeString;\n \t\t\t}\n \t\t\t\n \t\t\tif (mergeNext && !forceNoMerge) {//makes the merge happen on the next pass through\n \t\t\t\tmergeNext=false;\n \t\t\t\tmergeWithLast=true;\n \t\t\t} else {\n \t\t\t\tforceNoMerge = false;\n \t\t\t\tfinalSents.add(safeString);\n \t\t\t}\n \t\t\n \t\t\tsents.add(safeString);\n \t\t\t\n \t\t\t//// xxx xxx xxx return the safeString_subbedEOS too!!!!\n \t\t\tif (currentStart < 0 || currentStop < 0) {\n \t\t\t\tLogger.logln(NAME+\"Something went really wrong making sentence tokens.\", LogOut.STDERR);\n \t\t\t\tErrorHandler.fatalProcessingError(null);\n \t\t\t}\n \n \t\t\tcurrentStart = currentStop+1;\n \t\t\tif (currentStart >= lenText) {\n \t\t\t\tfoundEOS = false;\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n \t\t\tfoundEOS = sent.find(currentStart);\n \t\t}\n \n \t\tif (!foundAtLeastOneEOS || !EOSAtSentenceEnd) {\n \t\t\tArrayList<String> wrapper = new ArrayList<String>(1);\n \t\t\twrapper.add(text);\n \t\t\treturn wrapper;\n \t\t}\n \t\t\n \t\treturn finalSents;\n \t}", "public void testGetComplexText() throws Exception {\n \t\tXWPFWordExtractor extractor = \n \t\t\tnew XWPFWordExtractor(xmlB);\n \t\textractor.getText();\n \t\t\n \t\tString text = extractor.getText();\n \t\tassertTrue(text.length() > 0);\n \t\t\n \t\tchar euro = '\\u20ac';\n \t\tSystem.err.println(\"'\"+text.substring(text.length() - 20) + \"'\");\n \t\t\n \t\t// Check contents\n \t\tassertTrue(text.startsWith(\n \t\t\t\t\" \\n(V) ILLUSTRATIVE CASES\\n\\n\"\n \t\t));\n\t\tassertTrue(text.endsWith(\n \t\t\t\t\"As well as gaining \"+euro+\"90 from child benefit increases, he will also receive the early childhood supplement of \"+euro+\"250 per quarter for Vincent for the full four quarters of the year.\\n\\n\\n\\n \\n\\n\\n\"\n \t\t));\n \t\t\n \t\t// Check number of paragraphs\n \t\tint ps = 0;\n \t\tchar[] t = text.toCharArray();\n \t\tfor (int i = 0; i < t.length; i++) {\n \t\t\tif(t[i] == '\\n') { ps++; }\n \t\t}\n\t\tassertEquals(79, ps);\n \t}", "private void loadAssertPageFile(File f) throws VDDException {\n NodeList nodes;\n\n try {\n DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\n DocumentBuilder db = dbf.newDocumentBuilder();\n Document doc = db.parse(f);\n\n nodes = doc.getDocumentElement().getChildNodes();\n } catch (javax.xml.parsers.ParserConfigurationException e) {\n throw new VDDException(\"XML parser failed to load\", e);\n } catch (org.xml.sax.SAXException e) {\n throw new VDDException(\"Error during XML parsing\", e);\n } catch (java.io.IOException e) {\n throw new VDDException(\"Failed to read page assertion file\", e);\n }\n\n\n for (int k = 0; k < nodes.getLength(); k++) {\n Node node = nodes.item(k);\n String name;\n\n if (node.getNodeType() != Node.ELEMENT_NODE) {\n continue;\n }\n\n name = node.getNodeName().toLowerCase();\n\n if (name.equals(\"checks\")) {\n readEntries(this.assertions, node.getChildNodes());\n } else if (name.equals(\"ignores\")) {\n readEntries(this.whitelist, node.getChildNodes());\n } else {\n throw new VDDException(\"Unknown assert page entry type '\" +\n name + \"'\");\n }\n }\n }", "void computeHTMLFeatures() throws Exception{\n\t\tcountTagStatistics();\n\t\thtmlGlobalTagStatistics();\n\t\ttagInHeadStatistics();\n\t\thtmlStatisticsDiv();\n\t\thtmlStaticsticsParagraphs();\n\t\thtmlKeyWords();\n\t\tnormalizeData();\n\t}", "@SuppressWarnings(\"static-access\")\n\tpublic void detection(Request text) {\n\t\t//Fichiertxt fichier;\n\t\ttry {\t\t\t\t\t\n\t\t\t//enregistrement et affichage de la langue dans une variable lang\n\t\t\ttext.setLang(identifyLanguage(text.getCorpText()));\n\t\t\t//Ajoute le fichier traité dans la Base\n\t\t\tajouterTexte(text);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"fichier texte non trouvé\");\n\t e.printStackTrace();\n\t\t}\n\t}", "private void inQuyetDinhv3(HttpServletRequest request, HttpServletResponse reponse, GiaHanForm giaHanForm, ApplicationContext appConText) throws Exception {\r\n\t\tString fileIn = request.getRealPath(\"/docin\") + \"\\\\TTNB11.doc\";\r\n\t\tString fileOut = request.getRealPath(\"/docout\") + \"\\\\TTNB11_Out\" + System.currentTimeMillis() + request.getSession().getId() + \".doc\";\r\n\r\n\t\tString fileTemplate = null;\r\n\t\tfileTemplate = \"ttnb11\"; // (ngon, chuan)\r\n\t\tString idCuocTtkt = giaHanForm.getIdCuocTtKt();\r\n\t\tTtktKhCuocTtkt cuocTtkt = CuocTtktService.getCuocTtktWithoutNoiDung(appConText, idCuocTtkt);\r\n\r\n\t\tTtktCbQd cbQd = TtktService.getQuyetDinh(idCuocTtkt, appConText);\r\n\t\tString hinhThuc = (cuocTtkt.getHinhThuc().booleanValue()) ? \"ki\\u1EC3m tra\" : \"thanh tra\";\r\n\t\tStringBuffer sb = new StringBuffer(hinhThuc);\r\n\r\n\t\tMsWordUtils word = new MsWordUtils(fileIn, fileOut);\r\n\t\ttry {\r\n\t\t\tword.put(\"[ten_cqt]\", KtnbUtil.getTenCqtCapTrenTt(appConText).toUpperCase());\r\n\t\t\tword.put(\"[cqt_ra_quyet_dinh]\", cuocTtkt.getTenDonViTh().toUpperCase());\r\n\t\t\tif (Formater.isNull(giaHanForm.getSoQd())) {\r\n\t\t\t\tword.put(\"[so_qd]\", \"....../Q\\u0110-.......\");\r\n\t\t\t} else {\r\n\t\t\t\tword.put(\"[so_qd]\", giaHanForm.getSoQd().toString());\r\n\t\t\t}\r\n\t\t\tString ngaylap = giaHanForm.getNgayRaQd();\r\n\t\t\tString[] arrngaylap = ngaylap.split(\"/\");\r\n\t\t\tif (giaHanForm.getNoiRaQd().equals(\"\") && giaHanForm.getNgayRaQd().equals(\"\")) {\r\n\t\t\t\tword.put(\"[noi_ra_qd]\", \".....\");\r\n\t\t\t\tword.put(\"[ngay_ra_qd]\", \"ng\\u00E0y.....th\\u00E1ng.....n\\u0103m.....\");\r\n\t\t\t} else if (!giaHanForm.getNoiRaQd().equals(\"\") && !giaHanForm.getNgayRaQd().equals(\"\")) {\r\n\t\t\t\tword.put(\"[noi_ra_qd]\", giaHanForm.getNoiRaQd());\r\n\t\t\t\tword.put(\"[ngay_ra_qd]\", \"ng\\u00E0y \" + arrngaylap[0] + \" th\\u00E1ng \" + arrngaylap[1] + \" n\\u0103m \" + arrngaylap[2]);\r\n\t\t\t} else if (giaHanForm.getNoiRaQd().equals(\"\") && !giaHanForm.getNgayRaQd().equals(\"\")) {\r\n\t\t\t\tword.put(\"[noi_ra_qd]\", \".....\");\r\n\t\t\t\tword.put(\"[ngay_ra_qd]\", \"ng\\u00E0y \" + arrngaylap[0] + \" th\\u00E1ng \" + arrngaylap[1] + \" n\\u0103m \" + arrngaylap[2]);\r\n\t\t\t} else if (!giaHanForm.getNoiRaQd().equals(\"\") && giaHanForm.getNgayRaQd().equals(\"\")) {\r\n\t\t\t\tword.put(\"[noi_ra_qd]\", giaHanForm.getNoiRaQd());\r\n\t\t\t\tword.put(\"[ngay_ra_qd]\", \"ng\\u00E0y.....th\\u00E1ng.....n\\u0103m.....\");\r\n\t\t\t}\r\n\t\t\tword.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[dv_dc_ttkt]\", cuocTtkt.getTenDonViBi());\r\n\t\t\tword.put(\"[thu_truong_cqt]\", KtnbUtil.getTenThuTruongCqtForMauin(appConText).toUpperCase());\r\n\t\t\tif (CatalogService.getTenDanhMucById(giaHanForm.getVbQdCnNv()).equals(\"N/A\")) {\r\n\t\t\t\tword.put(\"[van_ban_quy_dinh]\", KtnbUtil.inFieldNull(104) + \";\");\r\n\t\t\t} else {\r\n\t\t\t\tword.put(\"[van_ban_quy_dinh]\", CatalogService.getTenDanhMucById(giaHanForm.getVbQdCnNv()));\r\n\t\t\t}\r\n\t\t\tword.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[qd_so]\", cbQd.getSoQuyetDinh());\r\n\t\t\tString ngayxet = Formater.date2str(cbQd.getNgayRaQuyetDnh());\r\n\t\t\tString[] arrngayxet = ngayxet.split(\"/\");\r\n\t\t\tword.put(\"[ngay_qd]\", \"ng\\u00E0y \" + arrngayxet[0] + \" th\\u00E1ng \" + arrngayxet[1] + \" n\\u0103m \" + arrngayxet[2]);\r\n\t\t\tword.put(\"[thu_truong_cqt]\", KtnbUtil.getTenThuTruongCqtForMauin(appConText));\r\n\t\t\tword.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[dv_dc_ttkt]\", cuocTtkt.getTenDonViBi().toString());\r\n\t\t\tword.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[qd_so]\", cbQd.getSoQuyetDinh());\r\n\t\t\tword.put(\"[ngay_qd]\", \"ng\\u00E0y \" + arrngayxet[0] + \" th\\u00E1ng \" + arrngayxet[1] + \" n\\u0103m \" + arrngayxet[2]);\r\n\t\t\tword.put(\"[thu_truong_cqt]\", KtnbUtil.getTenThuTruongCqtForMauin(appConText));\r\n\t\t\tword.put(\"[ttkt1]\", hinhThuc);\r\n\t\t\tword.put(\"[dv_dc_ttkt]\", cuocTtkt.getTenDonViBi().toString());\r\n\t\t\tword.put(\"[ngay_lv]\", giaHanForm.getSoNgayRaHan());\r\n\t\t\t// tu ngay\r\n\t\t\tString tungay = giaHanForm.getRaHanTuNgay();\r\n\t\t\tString[] arrtungay = tungay.split(\"/\");\r\n\t\t\tword.put(\"[tu_ngay]\", \"ng\\u00E0y \" + arrtungay[0] + \" th\\u00E1ng \" + arrtungay[1] + \" n\\u0103m \" + arrtungay[2]);\r\n\t\t\t// den ngay\r\n\t\t\tString denngay = giaHanForm.getRaHanDenNgay();\r\n\t\t\tString[] arrdenngay = denngay.split(\"/\");\r\n\t\t\tword.put(\"[den_ngay]\", \"ng\\u00E0y \" + arrdenngay[0] + \" th\\u00E1ng \" + arrdenngay[1] + \" n\\u0103m \" + arrdenngay[2]);\r\n\t\t\tword.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[dv_dc_ttkt]\", cuocTtkt.getTenDonViBi().toString());\r\n\t\t\tif (Formater.isNull(giaHanForm.getDvCaNhanLq())) {\r\n\t\t\t\tword.put(\"[dv_lien_quan]\", \"\");\r\n\t\t\t} else {\r\n\t\t\t\tword.put(\"[dv_lien_quan]\", \", \" + giaHanForm.getDvCaNhanLq());\r\n\t\t\t}\r\n\t\t\tword.put(\"[ten_cqt]\", KtnbUtil.getTenCqtCapTrenTt(appConText));\r\n\t\t\tword.put(\"[chuc_danh_thu_truong]\", KtnbUtil.getChucVuThuTruongByMaCqt(appConText.getMaCqt()).toUpperCase());\r\n\t\t\t// if (Formater.isNull(appConText.getTenThuTruong())) {\r\n\t\t\t// word.put(\"[ten_thu_truong]\", \"\");\r\n\t\t\t// } else {\r\n\t\t\t// word.put(\"[ten_thu_truong]\", appConText.getTenThuTruong());\r\n\t\t\t// }\r\n\t\t\tword.saveAndClose();\r\n\t\t\tword.downloadFile(fileOut, \"Mau TTNB11\", \".doc\", reponse);\r\n\t\t} catch (Exception ex) {\r\n\t\t\t// ex.printStackTrace();\r\n\t\t\tSystem.out.println(\"Download Error: \" + ex.getMessage());\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tword.saveAndClose();\r\n\t\t\t} catch (Exception e) {\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public String getContent() {\n String s = page;\n\n // Bliki doesn't seem to properly handle inter-language links, so remove manually.\n s = LANG_LINKS.matcher(s).replaceAll(\" \");\n\n wikiModel.setUp();\n s = getTitle() + \"\\n\" + wikiModel.render(textConverter, s);\n wikiModel.tearDown();\n\n // The way the some entities are encoded, we have to unescape twice.\n s = StringEscapeUtils.unescapeHtml(StringEscapeUtils.unescapeHtml(s));\n\n s = REF.matcher(s).replaceAll(\" \");\n s = HTML_COMMENT.matcher(s).replaceAll(\" \");\n\n // Sometimes, URL bumps up against comments e.g., <!-- http://foo.com/-->\n // Therefore, we want to remove the comment first; otherwise the URL pattern might eat up\n // the comment terminator.\n s = URL.matcher(s).replaceAll(\" \");\n s = DOUBLE_CURLY.matcher(s).replaceAll(\" \");\n s = HTML_TAG.matcher(s).replaceAll(\" \");\n\n return s;\n }", "@Override\n\tpublic void process(Page page) {\n\t\t\n\t}", "static void parseIt() {\n try {\n long start = System.nanoTime();\n int[] modes = {DET_MODE, SUM_MODE, DOUBLES_MODE};\n String[] filePaths = {\"\\\\catalogue_products.xml\", \"\\\\products_to_categories.xml\", \"\\\\doubles.xml\"};\n HashMap<String, String[]> update = buildUpdateMap(remainderFile);\n window.putLog(\"-------------------------------------\\n\" + updateNodes(offerNodes, update) +\n \"\\nФайлы для загрузки:\");\n for (int i = 0; i < filePaths.length; i++) {\n // Define location for output file\n File outputFile = new File(workingDirectory.getParent() + filePaths[i]);\n pushDocumentToFile(outputFile, modes[i]);\n printFileInfo(outputFile);\n }\n window.putLog(\"-------------------------------------\\nВсего обработано уникальных записей: \" +\n offerNodes.size());\n long time = (System.nanoTime() - start) / 1000000;\n window.putLog(\"Завершено без ошибок за \" + time + \" мс.\");\n offerNodes = null;\n //window.workshop.setParseButtonDisabled();\n } catch (TransformerException e) {\n reportException(Thread.currentThread(),\n new RuntimeException(e.getCause() + \" (\" + e.getException() + \")\\n\\t\" + e.getMessageAndLocation()));\n } catch (ParserConfigurationException e) {\n reportException(Thread.currentThread(),\n new RuntimeException(e.getCause() + \"\\n\\t\" + e.getLocalizedMessage()));\n } catch (SAXException e) {\n reportException(Thread.currentThread(),\n new RuntimeException(\"SAXexception: \" + e.getMessage()));\n\n } catch (IOException e) {\n reportException(Thread.currentThread(),\n new RuntimeException(e.getCause() + \"\\n\\t\" + e.getMessage() + \". \" + e.getStackTrace()[0]));\n }\n }", "public void buildDocument() {\n/* 310 */ setDocument(getDocumentLoader().getDocument(getClass()), \"text/html\", \"ISO-8859-1\");\n/* */ \n/* 312 */ syncAccessMethods();\n/* */ }", "@Test\n\tpublic void test02_PreviewAPage() {\n\t\tinfo(\"Test 2: Preview a page\");\n\t\t/*Step Number: 1\n\t\t*Step Name: Step 1: Open form to create new page\n\t\t*Step Description: \n\t\t\t- Choose path to add new page\n\t\t\t- Click [Add Page] --> [Blank Page]/[From Template...]\n\t\t*Input Data: \n\t\t\t\n\t\t*Expected Outcome: \n\t\t\tForm to create new page is shown and in the [Rich Text] editor*/\n\t\tinfo(\"Go to Add a Wiki page\");\n\t\tString title = txData.getContentByArrayTypeRandom(1)+getRandomNumber();\n\t\tString content = txData.getContentByArrayTypeRandom(1)+getRandomNumber();\n\t\thp.goToWiki();\n\t\twHome.goToAddBlankPage();\n\t\t\n\t\t/*Step Number: 2\n\t\t*Step Name: Step 2: Create new page\n\t\t*Step Description: \n\t\t\t- Put the title for this page\n\t\t\t- Put the content of page\n\n\t\t*Input Data: \n\t\t\t\n\t\t*Expected Outcome: \n\t\t\tAll fields are inputed with values*/\n\t\trichEditor.addSimplePage(title, content);\n\t\t\n\t\t/*Step Number: 3\n\t\t*Step Name: Step 3: Preview a page\n\t\t*Step Description: \n\t\t\t- Click on Preview \n\t\t*Input Data: \n\t\t\t\n\t\t*Expected Outcome: \n\t\t\tContent of page is shown*/\n\t\t\n\t\twikiMg.PreviewASimplePage(title, content);\n \t}", "private void textilize () {\n\n textIndex = 0;\n int textEnd = line.length() - 1;\n listChars = new StringBuffer();\n linkAlias = false;\n while (textIndex < line.length()\n && (Character.isWhitespace(textChar()))) {\n textIndex++;\n }\n while (textEnd >= 0\n && textEnd >= textIndex\n && Character.isWhitespace (line.charAt (textEnd))) {\n textEnd--;\n }\n boolean blankLine = (textIndex >= line.length());\n if (blankLine) {\n textilizeBlankLine();\n }\n else\n if ((textIndex > 0)\n || ((line.length() > 0 )\n && (line.charAt(0) == '<'))) {\n // First character is white space of the beginning of an html tag:\n // Doesn't look like textile... process it without modification.\n }\n else\n if (((textEnd - textIndex) == 3)\n && line.substring(textIndex,textEnd + 1).equals (\"----\")) {\n // && (line.substring(textIndex, (textEnd + 1)).equals (\"----\")) {\n textilizeHorizontalRule(textIndex, textEnd);\n } else {\n textilizeNonBlankLine();\n };\n }", "@Override\n\tpublic void visit(Page page) {\n\t\t\n\t\ttry{\n\t\t\tfin=\"\";\n\t\t\tif(flag == 0){\n\t\t\t\tfw = new FileWriter(wrtFile);\n\t\t\t\tfw1 = new FileWriter(wrtFile1);\n\t\t\t\tvisit_url = new HashSet<String>();\n\t\t\t\tall_txt = new HashSet<String>();\n\t\t\t\teng_sen = new ArrayList<String>();\n\t\t\t}\n\t\t\tflag++;\n\t\t\tsynchronized (this) {\n\t\t\t\tif(page.getParseData() instanceof HtmlParseData){\n\t\t\t\t\tHtmlParseData htmlParseData = (HtmlParseData) page.getParseData();\n\t\t\t\t\tString html = htmlParseData.getHtml();\n\t\t\t\t\tString url = page.getWebURL().getURL().toLowerCase();\n\t\t\t\t\t//System.out.println(\"VISIT: \"+ url);\n\t\t\t\t\t//System.out.println(\"HTML: \"+ html);\n\t\t\t\t\tDocument doc = Jsoup.parse(html);\n\t\t\t\t\tdoc.removeClass(\"twitter-tweet\");\n\t\t\t\t\tElements links = doc.select(\"div\");\n\t\t\t\t\tIterator<Element> it = links.iterator();\n\t\t\t\t\t\n\t\t\t\t\tString text=\"\";\n\t\t\t\t\tElement link;\n\t\t\t\t\tElements children;\n\t\t\t\t\twhile(it.hasNext()){\n\t\t\t\t\t\tlink = it.next();\n\t\t\t\t\t\tif(link.attr(\"class\").equals(\"desc\")){\n\t\t\t\t\t\t\t//System.out.println(\"Division Class: \"+ link.attr(\"class\"));\n\t\t\t\t\t\t\t//text.replaceAll(\",\", \"(COMMA)\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tchildren = link.children();\n\t\t\t\t\t\t\tif(!children.isEmpty()){\n\t\t\t\t\t\t\t\tIterator<Element> child_it = children.iterator();\n\t\t\t\t\t\t\t\tElement child;\n\t\t\t\t\t\t\t\twhile(child_it.hasNext()){\n\t\t\t\t\t\t\t\t\tchild = child_it.next(); \n\t\t\t\t\t\t\t\t\tif(child.attr(\"data-lang\").equals(\"en\") || child.attr(\"class\").equals(\"instagram-media\") || child.text().contains(\"Read Also\")){\n\t\t\t\t\t\t\t\t\t\tchild.text(\"\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!text.contains(link.text())){\t\t\n\t\t\t\t\t\t\t\tif(!link.text().matches(\".*Updated (Mon|Tue|Wed|Thu|Fri|Sat|Sun).*\")){\n\t\t\t\t\t\t\t\t\ttext += link.text();\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//System.out.println(\"Text: \"+ text);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(link.attr(\"class\").equals(\"caption\")){\n\t\t\t\t\t\t\t//System.out.println(\"Division Class: \"+ link.attr(\"class\"));\n\t\t\t\t\t\t\t//text.replaceAll(\",\", \"(COMMA)\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tchildren = link.children();\n\t\t\t\t\t\t\tif(!children.isEmpty()){\n\t\t\t\t\t\t\t\tIterator<Element> child_it = children.iterator();\n\t\t\t\t\t\t\t\tElement child;\n\t\t\t\t\t\t\t\twhile(child_it.hasNext()){\n\t\t\t\t\t\t\t\t\tchild = child_it.next(); \n\t\t\t\t\t\t\t\t\tif(child.attr(\"data-lang\").equals(\"en\") || child.attr(\"class\").equals(\"instagram-media\") || child.text().contains(\"Read Also\")){\n\t\t\t\t\t\t\t\t\t\tchild.text(\"\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!text.contains(link.text())){\t\t\n\t\t\t\t\t\t\t\tif(!link.text().matches(\".*Updated (Mon|Tue|Wed|Thu|Fri|Sat|Sun).*\")){\n\t\t\t\t\t\t\t\t\ttext += link.text();\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//System.out.println(\"Text: \"+ text);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(text != \"\"){\n\t\t\t\t\t\tif(!visit_url.contains(url) && !all_txt.contains(text)){\n\t\t\t\t\t\t\tfin = text+\"\\n\";\n\t\t\t\t\t\t\tfin1 = url+\"\\n\";\n\t\t\t\t\t\t\t//System.out.println(\"Text: \"+ text);\n\t\t\t\t\t\t\t//System.out.println(\"URL: \"+ url);\n\t\t\t\t\t\t\tFiles.write(Paths.get(wrtFile), fin.getBytes(), StandardOpenOption.APPEND);\n\t\t\t\t\t\t\tFiles.write(Paths.get(wrtFile1), fin1.getBytes(), StandardOpenOption.APPEND);\n\t\t\t\t\t\t\tall_txt.add(text);\n\t\t\t\t\t\t\tvisit_url.add(url);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void getParsed(String text) {\n\t\tAnnotation document = new Annotation(text);\n\n\t\t// run all Annotators on this text\n\t\tpipeline.annotate(document);\n\t\tsentences = document.get(SentencesAnnotation.class);\n\t\tsentIt = sentences.iterator();\n\t}", "public Map<String, Object> getIE(String text, FallBackListBased pd) {\n\t\ttext = text.replaceAll(\" � \", \", \");\n\t\ttext = text.replaceAll(\"'s \", \" \");\n\t\ttext = text.replaceAll(\"'s\", \"\");\n\t\ttext = text.replaceAll(\"�s \", \" \");\n\t\ttext = text.replaceAll(\"�s \", \" \");\n\t\ttext = text.replaceAll(\"\\\\?\", \"\");\n\t\ttext = text.replaceAll(\":\", \"\");\n\t\tMap<String, Object> entities_map = new TreeMap<String, Object>();\n\t\tMap<String, Object> extractedEntities = new TreeMap<String, Object>();\n\t\tList<TreeMap<String, String>> entities = new ArrayList<TreeMap<String, String>>();\n\t\tList<TreeMap<String, String>> intents= new ArrayList<TreeMap<String, String>>();\n\t\tSet<String> intentsList=new HashSet<String>();\n\t\tSet<String> entitiesList=new HashSet<String>();\n\t\t\n\t\tString input = text;\n\t\t// text=text.replaceAll(\" \", \" \");\n\t\tSpan spanSentences[] = pd.sentenceDetector.sentPosDetect(input);\n\t\tint sentenceId = 1;\n\t\tTreeMap<String, String> intents_map = new TreeMap<String, String>();\n\t\tDouble entites_highest_cofidence = 0.0;\n\t\tDouble intents_highest_cofidence = 0.0;\n\t\tfor (Span sentence : spanSentences) {\n\t\t\tArrayList<PhraseTemplate> phrases = pd.GetPhrases(sentence\n\t\t\t\t\t.getCoveredText(input).toString(), sentenceId++);\n\t\t\t\n\t\t\tfor (PhraseTemplate svo : phrases) {\n\t\t\t\tString key = svo.phrase;\n\t\t\t\tkey = key.replaceAll(\" is \", \"\");\n\t\t\t\tkey = key.replaceAll(\"What \", \"\");\n\t\t\t\tkey = key.replaceAll(\"what \", \"\");\n\t\t\t\tkey = key.replaceAll(\" the \", \"\");\n\n\t\t\t\tif (key.length() > 1) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tString resolvedEntity = lss.resolveEntity(key\n\t\t\t\t\t\t\t\t.toLowerCase().trim().toString(),\n\t\t\t\t\t\t\t\t\"entitesIndex\");\n\t\t\t\t\t\tString tokens[] = resolvedEntity.split(\"__\");\n//\t\t\t\t\t\tSystem.out.println(resolvedEntity+\" :: \"+key);\n\t\t\t\t\t\tif (tokens.length < 2)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tif (tokens[1].trim().startsWith(\"entity\")\n\t\t\t\t\t\t\t\t&& Double.parseDouble(tokens[5].trim())>0.9)\n\t\t\t\t\t\t\tentitiesList.add(tokens[5].trim());\n\t\t\t\t\t\tif (tokens[1].trim().startsWith(\"entity\")\n\t\t\t\t\t\t\t\t&& Double.parseDouble(tokens[5].trim()) > entites_highest_cofidence) {\n\t\t\t\t\t\t\tentities_map.clear();\n\t\t\t\t\t\t\tentities_map.put(\"Entity\", key.trim());\n\t\t\t\t\t\t\tentities_map.put(\"MappedEntity\", tokens[4].trim());\n\t\t\t\t\t\t\tentities_map.put(\"EntityConfidenceScore\", tokens[5].trim());\n\t\t\t\t\t\t\tentities_map.put(\"MappedEntityType\", tokens[2].trim());\n\t\t\t\t\t\t\tentites_highest_cofidence = Double\n\t\t\t\t\t\t\t\t\t.parseDouble(tokens[5].trim());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tokens[1].trim().startsWith(\"intent\")\n\t\t\t\t\t\t\t\t&& Double.parseDouble(tokens[5].trim())>0.9)\n\t\t\t\t\t\t\tintentsList.add(tokens[5].trim());\n\t\t\t\t\t\tif (tokens[1].trim().startsWith(\"intent\")\n\t\t\t\t\t\t\t\t&& Double.parseDouble(tokens[5].trim()) > intents_highest_cofidence) {\n\t\t\t\t\t\t\tintents_map.clear();\n\t\t\t\t\t\t\tintents_map.put(\"Id\", tokens[0].trim());\n\t\t\t\t\t\t\tintents_map.put(\"Extracted Entity\", key.trim());\n\t\t\t\t\t\t\tintents_map.put(\"Mapped Entity\", tokens[4].trim());\n\t\t\t\t\t\t\tintents_map.put(\"Confidence\", tokens[5].trim());\n\t\t\t\t\t\t\tintents_map.put(\"Class\", tokens[1].trim());\n\t\t\t\t\t\t\tintents_highest_cofidence = Double\n\t\t\t\t\t\t\t\t\t.parseDouble(tokens[5].trim());\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tentities_map.put(\"Intent\", intents_map.get(\"Extracted Entity\"));\n\t\tentities_map.put(\"MappedIntent\", intents_map.get(\"Mapped Entity\"));\n\t\tentities_map.put(\"IntentConfidenceScore\", intents_map.get(\"Confidence\"));\n\n\t\treturn entities_map;\n\t}", "@Override\n\tpublic void visit(Page page) {\n\t\tint docid = page.getWebURL().getDocid();\n\t\tString url = page.getWebURL().getURL();\n\t\tString domain = page.getWebURL().getDomain();\n\t\tString path = page.getWebURL().getPath();\n\t\tString subDomain = page.getWebURL().getSubDomain();\n\t\tString parentUrl = page.getWebURL().getParentUrl();\n\n\t\tSystem.out.println(\"Docid: \" + docid);\n\t\tSystem.out.println(\"URL: \" + url);\n\t\tSystem.out.println(\"Domain: '\" + domain + \"'\");\n\t\tSystem.out.println(\"Sub-domain: '\" + subDomain + \"'\");\n\t\tSystem.out.println(\"Path: '\" + path + \"'\");\n\t\tSystem.out.println(\"Parent page: \" + parentUrl);\n\n\t\tif(page.getParseData() instanceof JavaScriptParseData) {\n\t\t\tSystem.out.println(\"Got an instance of JS Parse DATA!!!!\");\n\t\t\tSystem.out.println(\"Parent Page of JS data is : \" + page.getWebURL().getParentUrl());\n\n\t\t\tJavaScriptParseData jsParseData = (JavaScriptParseData) page.getParseData();\n\t\t\tString jsText = jsParseData.getJs();\n\n\t\t\ttry {\n\t\t\t\tif(DomainTrackerParser.containsTracker(jsText)){\n\t\t\t\t\tdomainTrackerSet.add(url);\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\tif (page.getParseData() instanceof HtmlParseData) {\n\t\t\tHtmlParseData htmlParseData = (HtmlParseData) page.getParseData();\n\t\t\tString text = htmlParseData.getText();\n\t\t\tString html = htmlParseData.getHtml();\n\t\t\tList<WebURL> links = htmlParseData.getOutgoingUrls();\n\n\t\t\tSystem.out.println(\"Text length: \" + text.length());\n\t\t\tSystem.out.println(\"Html length: \" + html.length());\n\t\t\tSystem.out.println(\"Number of outgoing links: \" + links.size());\n\n\t\t\tfor(WebURL webUrl : links) {\n\t\t\t\tString urlString = webUrl.getURL().toString();\n\n\t\t\t\ttry {\n\t\t\t\t\tif(urlString != null && DomainTrackerParser.containsTracker(urlString)) {\n\t\t\t\t\t\tSystem.out.println(\"added a tracker to the set : \" + urlString);\n\t\t\t\t\t\tdomainTrackerSet.add(urlString);\n\t\t\t\t\t}\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n//\t\t\t\tSystem.out.println(\"Outgoing URL : \" + webUrl);\n//\t\t\t\tSystem.out.println(domainTrackerSet);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"=============\");\n\t}", "private void handleInclude() {\n definedGrammar.include(getGrammar(getAbsPath()));\n }", "public XWPFDocument startConversion() {\n\n convertParagraphs(docx);\n convertFooter(docx);\n convertHeader(docx);\n convertTables(docx);\n updateStylesToNewFont();\n\n\n return docx;\n }", "void readAPFdocument (Document apfDoc, String fileText) {\n\t\tNodeList sourceFileElements = apfDoc.getElementsByTagName(\"source_file\");\n\t\tElement sourceFileElement = (Element) sourceFileElements.item(0);\n\t\tsourceFile = sourceFileElement.getAttribute(\"URI\");\n\t\tsourceType = sourceFileElement.getAttribute(\"SOURCE\");\n\n\t\tNodeList documentElements = apfDoc.getElementsByTagName(\"document\");\n\t\tElement documentElement = (Element) documentElements.item(0);\n\t\tdocID = documentElement.getAttribute(\"DOCID\");\n\n\t\tif (Ace.perfectMentions & !Ace.perfectEntities) {\n\t\t\treadPerfectMentions (apfDoc, fileText);\n\t\t\treturn;\n\t\t}\n\n\t\tNodeList entityElements = apfDoc.getElementsByTagName(\"entity\");\n\t\tfor (int i=0; i<entityElements.getLength(); i++) {\n\t\t\tElement entityElement = (Element) entityElements.item(i);\n\t\t\tAceEntity entity = new AceEntity (entityElement, fileText);\n\t\t\taddEntity(entity);\n\t\t}\n\t\tNodeList valueElements = apfDoc.getElementsByTagName(\"value\");\n\t\tfor (int i=0; i<valueElements.getLength(); i++) {\n\t\t\tElement valueElement = (Element) valueElements.item(i);\n\t\t\tAceValue value = new AceValue (valueElement, fileText);\n\t\t\taddValue(value);\n\t\t}\n\t\tNodeList timexElements = apfDoc.getElementsByTagName(\"timex2\");\n\t\tfor (int i=0; i<timexElements.getLength(); i++) {\n\t\t\tElement timexElement = (Element) timexElements.item(i);\n\t\t\tAceTimex timex = new AceTimex (timexElement, fileText);\n\t\t\taddTimeExpression(timex);\n\t\t}\n\t\tNodeList relationElements = apfDoc.getElementsByTagName(\"relation\");\n\t\tfor (int i=0; i<relationElements.getLength(); i++) {\n\t\t\tElement relationElement = (Element) relationElements.item(i);\n\t\t\tAceRelation relation = new AceRelation (relationElement, this, fileText);\n\t\t\taddRelation(relation);\n\t\t}\n\t\tNodeList eventElements = apfDoc.getElementsByTagName(\"event\");\n\t\tfor (int i=0; i<eventElements.getLength(); i++) {\n\t\t\tElement eventElement = (Element) eventElements.item(i);\n\t\t\tAceEvent event = new AceEvent (eventElement, this, fileText);\n\t\t\taddEvent(event);\n\t\t}\n\t}", "public void buildDocument() {\n/* 248 */ setDocument(getDocumentLoader().getDocument(getClass()), \"text/html\", \"ISO-8859-1\");\n/* */ \n/* 250 */ syncAccessMethods();\n/* */ }", "public abstract boolean Verifypage();", "@Override\n\tprotected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n String description = request.getParameter(\"description\"); // Retrieves <input type=\"text\" name=\"description\">\n Part filePart = request.getPart(\"file\"); // Retrieves <input type=\"file\" name=\"file\">\n // String fileName = Paths.get(filePart.getSubmittedFileName()).getFileName().toString(); // MSIE fix.\n InputStream fileContent = filePart.getInputStream();\n \n int rand =(int)( Math.random()*1000000000);\n String sourcePath = \"C:\\\\tmp\\\\tmp_\"+rand+\".pdf\";\n\n final Path destination = Paths.get(sourcePath);\n\n File file = destination.toFile();\n if(file.exists()){\n file.delete();\n }\n Files.copy(fileContent, destination);\n\n \n String path= PDFMinerController.pdf2text(sourcePath);\n \n \n File source = new File(path);\n System.out.println(\"XML file is readable \"+source.exists());\n List<Reference> refList= ReferenceExctractor.getReferences(source);\n Parser p = new Parser();\n StyleParser hp = new StyleParser();\n ArrayList<OneChar> text = p.parse(source);\n String headline= hp.parseHeadline(text);\n //response.setContentType(\"text/xml\");\n StringBuilder sb =new StringBuilder();\n sb.append(headline).append(\"\\n\");\n System.out.println(\"Reference list size \"+refList.size());\n for(Reference ref:refList ){\n System.out.println(\"Reference \"+ref.toString());\n sb.append(ref.toString()).append(\"\\n\");\n \n \n }\n response.getWriter().println(sb.toString());\n\t\n \n if(file.exists()){\n file.delete();\n System.out.println(\"PDF file deleted\");\n }\n System.out.println(\"Source exist \"+source.exists());\n if(source.exists()){\n source.delete();\n System.out.println(\"Source File deleted\");\n }\n \n }", "@Override\n\tpublic Paragraph translateText(String freetext, boolean include) {\n\t\treturn null;\n\t}", "@Test\n public void testExtractTextFromDocument_String_String()\n {\n String splitCharacter = \"\\n\";\n\n PDFExtractor instance = new PDFExtractor();\n \n String expResult = page1 + splitCharacter + page2;\n String result = instance.extractTextFromDocument(pathToFile, splitCharacter);\n \n assertEquals(expResult, result);\n }", "@Override\n\tpublic TemplatePage extract(String htmlContent) {\n\t\ttry {\n\t\t\t\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tParser parser = new Parser(htmlContent);\n\t\t\tMyNodeVisitor visitor = new MyNodeVisitor(true, true);\n\t\t\tparser.visitAllNodesWith(visitor);\n\t\t\t\n\t\t\tString content = visitor.getContent();\n\t\t\tif ( content == null || content.length() == 0 ) {\n\t\t\t\treturn new TemplatePage(\"\", \"\");\n\t\t\t}\n\t\t\t\n\t\t\tcontent = HtmlContentHelper.escape(content);\t\n\t\t\t\n\t\t\tString title = visitor.getTitle();\n\t\t\tif ( title == null ) {\n\t\t\t\ttitle = \"\";\n\t\t\t} else {\n\t\t\t\ttitle = HtmlContentHelper.escape(title);\n\t\t\t}\n\t\t\t\n\t\t\treturn new TemplatePage(title, content);\n\t\t\t\n\t\t} catch(ParserException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn new TemplatePage(\"\", \"\");\n\t\t\n\t}", "@Test(groups = { \"tree\" })\n\tpublic void testLoadUsingTransformedData() throws Exception {\n\t\t\tstartupTest(\"treeLoadUsingTransformedData.html\",null);\n\n\t\t\t//Verify the url\n\t\t\tString url = getBrowserUrl();\n\t\t\tlog(\"URL##########\"+ url);\n\n\t\t\t// Verify if the title of the page is correct\n\t\t\tverifyTitle(\"Incorrect page title;\", TITLE_TRANSDATA);\n\t\t\tcheckPageContent(TITLE_TRANSDATA);\n\n\t\t\tcommonLoadTestForJson();\n\n\n }", "private void prepArticle(Element articleContent) {\n // we don't need to do this, we don't care\n cleanStyles(articleContent);\n // this replaces any break element or an nbsp with a plain break\n // element.\n // not needed. We will deal with breaks as we deal with breaks\n // killBreaks(articleContent);\n\n /* Clean out junk from the article content */\n cleanConditionally(articleContent, \"form\");\n clean(articleContent, \"object\");\n clean(articleContent, \"h1\");\n\n /**\n * If there is only one h2, they are probably using it as a header and not a subheader, so remove it\n * since we already have a header.\n ***/\n if (articleContent.getElementsByTag(\"h2\").size() == 1) {\n clean(articleContent, \"h2\");\n }\n clean(articleContent, \"iframe\");\n\n cleanHeaders(articleContent);\n\n /*\n * Do these last as the previous stuff may have removed junk that will affect these\n */\n cleanConditionally(articleContent, \"table\");\n cleanConditionally(articleContent, \"ul\");\n //could have no children, will crash then\n if (articleContent.children().size() != 0) {\n cleanConditionally(articleContent.child(0), \"div\");\n }\n\n /* Remove extra paragraphs */\n Elements articleParagraphs = articleContent.getElementsByTag(\"p\");\n for (Element para : articleParagraphs) {\n int imgCount = para.getElementsByTag(\"img\").size();\n int embedCount = para.getElementsByTag(\"embed\").size();\n int objectCount = para.getElementsByTag(\"object\").size();\n\n if (imgCount == 0 && embedCount == 0 && objectCount == 0 && para.text().matches(\"\\\\s*\")) {\n para.remove();\n }\n }\n\n Elements parasWithPreceedingBreaks = articleContent.getElementsByTag(\"br + p\");\n for (Element pe : parasWithPreceedingBreaks) {\n Element brElement = pe.previousElementSibling();\n brElement.remove();\n }\n }", "@Override\r\n protected void parseDocuments()\r\n {\n\r\n }", "private void inQuyetDinhv4(HttpServletRequest request, HttpServletResponse reponse, GiaHanForm giaHanForm, ApplicationContext appConText) throws Exception {\r\n\t\tString fileIn = request.getRealPath(\"/docin/v4\") + \"\\\\TTNB11.doc\";\r\n\t\tString fileOut = request.getRealPath(\"/docout\") + \"\\\\TTNB11_Out\" + System.currentTimeMillis() + request.getSession().getId() + \".doc\";\r\n\r\n\t\tString fileTemplate = null;\r\n\t\tfileTemplate = \"ttnb11\"; // (ngon, chuan)\r\n\t\tString idCuocTtkt = giaHanForm.getIdCuocTtKt();\r\n\t\tTtktKhCuocTtkt cuocTtkt = CuocTtktService.getCuocTtktWithoutNoiDung(appConText, idCuocTtkt);\r\n\r\n\t\tTtktCbQd cbQd = TtktService.getQuyetDinh(idCuocTtkt, appConText);\r\n\t\tString hinhThuc = (cuocTtkt.getHinhThuc().booleanValue()) ? \"ki\\u1EC3m tra\" : \"thanh tra\";\r\n\t\tStringBuffer sb = new StringBuffer(hinhThuc);\r\n\t\t//giaHanForm.setSoQd(KtnbUtil.getMaNvu(appConText, \"Q\\u0110\"));\r\n\t\t//if (Formater.isNull(giaHanForm.getSoQd())) {\r\n\t\t\t//sb.append(\"....../Q\\u0110-.......\");\r\n\t\t//} else {\r\n\t\t\t//sb.append(giaHanForm.getSoQd() + KtnbUtil.getMaNvu(appConText, \"Q\\u0110\") );\r\n\t\t//}\r\n\t\tMsWordUtils word = new MsWordUtils(fileIn, fileOut);\r\n\t\ttry {\r\n\t\t\tword.put(\"[ten_cqt]\", KtnbUtil.getTenCqtCapTrenTt(appConText).toUpperCase());\r\n\t\t\tword.put(\"[cqt_ra_quyet_dinh]\", cuocTtkt.getTenDonViTh().toUpperCase());\r\n\t\t\tif (Formater.isNull(giaHanForm.getSoQd())) {\r\n\t\t\t\tword.put(\"[so_qd]\", \"....../Q\\u0110-.......\");\r\n\t\t\t} else {\r\n\t\t\t\tword.put(\"[so_qd]\", giaHanForm.getSoQd().toString()+KtnbUtil.getMaNvu1(appConText, \"Q\\u0110\") );\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t//word.put(\"[so_qd]\", sb.toString().toUpperCase());\r\n\t\t\tString ngaylap = giaHanForm.getNgayRaQd();\r\n\t\t\tString[] arrngaylap = ngaylap.split(\"/\");\r\n\t\t\tif (giaHanForm.getNoiRaQd().equals(\"\") && giaHanForm.getNgayRaQd().equals(\"\")) {\r\n\t\t\t\tword.put(\"[noi_ra_qd]\", \".....\");\r\n\t\t\t\tword.put(\"[ngay_ra_qd]\", \"ng\\u00E0y.....th\\u00E1ng.....n\\u0103m.....\");\r\n\t\t\t} else if (!giaHanForm.getNoiRaQd().equals(\"\") && !giaHanForm.getNgayRaQd().equals(\"\")) {\r\n\t\t\t\tword.put(\"[noi_ra_qd]\", giaHanForm.getNoiRaQd());\r\n\t\t\t\tword.put(\"[ngay_ra_qd]\", \"ng\\u00E0y \" + arrngaylap[0] + \" th\\u00E1ng \" + arrngaylap[1] + \" n\\u0103m \" + arrngaylap[2]);\r\n\t\t\t} else if (giaHanForm.getNoiRaQd().equals(\"\") && !giaHanForm.getNgayRaQd().equals(\"\")) {\r\n\t\t\t\tword.put(\"[noi_ra_qd]\", \".....\");\r\n\t\t\t\tword.put(\"[ngay_ra_qd]\", \"ng\\u00E0y \" + arrngaylap[0] + \" th\\u00E1ng \" + arrngaylap[1] + \" n\\u0103m \" + arrngaylap[2]);\r\n\t\t\t} else if (!giaHanForm.getNoiRaQd().equals(\"\") && giaHanForm.getNgayRaQd().equals(\"\")) {\r\n\t\t\t\tword.put(\"[noi_ra_qd]\", giaHanForm.getNoiRaQd());\r\n\t\t\t\tword.put(\"[ngay_ra_qd]\", \"ng\\u00E0y.....th\\u00E1ng.....n\\u0103m.....\");\r\n\t\t\t}\r\n\t\t\t//word.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[dv_dc_ttkt]\", cuocTtkt.getTenDonViBi());\r\n\t\t\tword.put(\"[thu_truong_cqt]\", KtnbUtil.getTenThuTruongCqtForMauin(appConText).toUpperCase());\r\n\t\t\tword.put(\"[luat_so]\", giaHanForm.getCanCuLuat());\r\n\t\t\tif (CatalogService.getTenDanhMucById(giaHanForm.getVbQdCnNv()).equals(\"N/A\")) {\r\n\t\t\t\tword.put(\"[van_ban_quy_dinh]\", KtnbUtil.inFieldNull(104) + \";\");\r\n\t\t\t} else {\r\n\t\t\t\tword.put(\"[van_ban_quy_dinh]\", CatalogService.getTenDanhMucById(giaHanForm.getVbQdCnNv()));\r\n\t\t\t}\r\n\t\t\tword.put(\"[qdinh_so]\", giaHanForm.getCanCuQd());\r\n\t\t\t//word.put(\"[ttkt]\", hinhThuc);\r\n\t\t\t//word.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[qd_so]\", cbQd.getSoQuyetDinh());\r\n\t\t\tString ngayxet = Formater.date2str(cbQd.getNgayRaQuyetDnh());\r\n\t\t\tString[] arrngayxet = ngayxet.split(\"/\");\r\n\t\t\tword.put(\"[ngay_qd]\", \"ng\\u00E0y \" + arrngayxet[0] + \" th\\u00E1ng \" + arrngayxet[1] + \" n\\u0103m \" + arrngayxet[2]);\r\n\t\t\tword.put(\"[thu_truong_cqt]\", KtnbUtil.getTenThuTruongCqtForMauin(appConText));\r\n\t\t\t//word.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[dv_dc_ttkt]\", cuocTtkt.getTenDonViBi().toString());\r\n\t\t\t//word.put(\"[ttkt]\", hinhThuc);\r\n\t\t\t//word.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[qd_so]\", cbQd.getSoQuyetDinh());\r\n\t\t\tword.put(\"[ngay_qd]\", \"ng\\u00E0y \" + arrngayxet[0] + \" th\\u00E1ng \" + arrngayxet[1] + \" n\\u0103m \" + arrngayxet[2]);\r\n\t\t\tword.put(\"[thu_truong_cqt]\", KtnbUtil.getTenThuTruongCqtForMauin(appConText));\r\n\t\t\t//word.put(\"[ttkt1]\", hinhThuc);\r\n\t\t\tword.put(\"[dv_dc_ttkt]\", cuocTtkt.getTenDonViBi().toString());\r\n\t\t\tword.put(\"[ngay_lv]\", giaHanForm.getSoNgayRaHan());\r\n\t\t\t// tu ngay\r\n\t\t\tString tungay = giaHanForm.getRaHanTuNgay();\r\n\t\t\tString[] arrtungay = tungay.split(\"/\");\r\n\t\t\tword.put(\"[tu_ngay]\", \"ng\\u00E0y \" + arrtungay[0] + \" th\\u00E1ng \" + arrtungay[1] + \" n\\u0103m \" + arrtungay[2]);\r\n\t\t\t// den ngay\r\n\t\t\tString denngay = giaHanForm.getRaHanDenNgay();\r\n\t\t\tString[] arrdenngay = denngay.split(\"/\");\r\n\t\t\tword.put(\"[den_ngay]\", \"ng\\u00E0y \" + arrdenngay[0] + \" th\\u00E1ng \" + arrdenngay[1] + \" n\\u0103m \" + arrdenngay[2]);\r\n\t\t\t//word.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[dv_dc_ttkt]\", cuocTtkt.getTenDonViBi().toString());\r\n\t\t\tif (Formater.isNull(giaHanForm.getDvCaNhanLq())) {\r\n\t\t\t\tword.put(\"[dv_lien_quan]\", \"\");\r\n\t\t\t} else {\r\n\t\t\t\tword.put(\"[dv_lien_quan]\", \", \" + giaHanForm.getDvCaNhanLq());\r\n\t\t\t}\r\n\t\t\tword.put(\"[ten_cqt]\", KtnbUtil.getTenCqtCapTrenTt(appConText));\r\n\t\t\tword.put(\"[chuc_danh_thu_truong]\", KtnbUtil.getChucVuThuTruongByMaCqt(appConText.getMaCqt()).toUpperCase());\r\n\t\t\t// if (Formater.isNull(appConText.getTenThuTruong())) {\r\n\t\t\t// word.put(\"[ten_thu_truong]\", \"\");\r\n\t\t\t// } else {\r\n\t\t\t// word.put(\"[ten_thu_truong]\", appConText.getTenThuTruong());\r\n\t\t\t// }\r\n\t\t\tword.saveAndClose();\r\n\t\t\tword.downloadFile(fileOut, \"Mau TTNB11\", \".doc\", reponse);\r\n\t\t} catch (Exception ex) {\r\n\t\t\t// ex.printStackTrace();\r\n\t\t\tSystem.out.println(\"Download Error: \" + ex.getMessage());\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tword.saveAndClose();\r\n\t\t\t} catch (Exception e) {\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}" ]
[ "0.5662973", "0.54631287", "0.5404181", "0.53999245", "0.539933", "0.5367749", "0.5348841", "0.5273833", "0.51852137", "0.51468724", "0.50948894", "0.5080133", "0.5069219", "0.4990334", "0.49632734", "0.49574718", "0.49162382", "0.4904332", "0.48819873", "0.48783344", "0.48441753", "0.48343495", "0.48289555", "0.48044187", "0.48032376", "0.4799379", "0.47612974", "0.47575557", "0.47338057", "0.472383", "0.47006252", "0.46991938", "0.46823025", "0.46627125", "0.46556562", "0.46415335", "0.46411455", "0.46189186", "0.4617182", "0.4610169", "0.45992732", "0.45986328", "0.45912814", "0.458956", "0.45848978", "0.45808992", "0.45594937", "0.45540202", "0.45285395", "0.45174357", "0.45174357", "0.45174357", "0.45174357", "0.45137537", "0.45129898", "0.4510361", "0.45033923", "0.4502978", "0.449355", "0.44896847", "0.44840416", "0.44777164", "0.44775283", "0.44682235", "0.44648486", "0.44623423", "0.44566202", "0.4455666", "0.4454945", "0.44547257", "0.44465697", "0.44328892", "0.44320956", "0.44310865", "0.44176975", "0.44162318", "0.44133472", "0.44075888", "0.4407112", "0.4404478", "0.4402004", "0.43917957", "0.43881294", "0.43711796", "0.4367884", "0.43660498", "0.436527", "0.4363622", "0.4362191", "0.4352671", "0.43524584", "0.4346782", "0.434399", "0.4341834", "0.4329087", "0.432476", "0.43145478", "0.4299388", "0.4295761", "0.4294417" ]
0.56656456
0
Preprocesses validated wikitext and substitutes entities.
private LazyPreprocessedPage preprocess( PageTitle title, String validatedWikitext, boolean forInclusion, EntityMap entityMap, ContentNode parentLog) throws CompilerException { PreprocessorLog log = new PreprocessorLog(); parentLog.getContent().add(log); log.setForInclusion(forInclusion); StopWatch stopWatch = new StopWatch(); stopWatch.start(); try { LazyPreprocessor preprocessor = new LazyPreprocessor(wikiConfig); LazyPreprocessedPage preprocessedAst = (LazyPreprocessedPage) preprocessor.parseArticle( validatedWikitext, title.getFullTitle(), forInclusion); return preprocessedAst; } catch (xtc.parser.ParseException e) { log.getContent().add(new ParseException(e.getMessage())); throw new CompilerException("Preprocessing failed!", e); } catch (Throwable e) { logger.error("Preprocessing failed!", e); StringWriter w = new StringWriter(); e.printStackTrace(new PrintWriter(w)); log.getContent().add(new UnhandledException(e, w.toString())); throw new CompilerException("Preprocessing failed!", e); } finally { stopWatch.stop(); log.setTimeNeeded(stopWatch.getElapsedTime()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void processContentEn() {\n if (this.content == null || this.content.equals(\"\")) {\r\n _logger.error(\"{} - The sentence is null or empty\", this.traceId);\r\n }\r\n\r\n // process input using ltp(Segmentation, POS, DP, SRL)\r\n this.nlp = new NLP(this.content, this.traceId, this.setting);\r\n }", "private void processText(){\n if(text == null || text.length() == 0){\n // When posting a tweet, Twitter returns the \"text\" JSON field even if it's not trimmed...\n text = trimmedText;\n }else{\n // Trim the original contents received from Twitter\n text = text.substring(0, text.offsetByCodePoints(0, displayTextRange[1]));\n }\n\n // Transform HTML characters (for some reason Twitter sends those)\n text = org.apache.commons.text.StringEscapeUtils.unescapeHtml4(text);\n }", "protected void importText(String text, Epml epml) {\n\t}", "private void processContentCn() {\n if (this.content == null || this.content.equals(\"\")) {\r\n _logger.error(\"{} - The sentence is null or empty\", this.traceId);\r\n }\r\n\r\n // process input using ltp(Segmentation, POS, DP, SRL)\r\n this.ltp = new LTP(this.content, this.traceId, this.setting);\r\n }", "private void parseEntities() {\n // See: https://github.com/twitter/twitter-text/tree/master/java\n entities.addExtractedEntities(TweetEntityAbstract.entitiesExtractor.extractCashtagsWithIndices(getText()));\n entities.addExtractedEntities(TweetEntityAbstract.entitiesExtractor.extractHashtagsWithIndices(getText()));\n entities.addExtractedEntities(TweetEntityAbstract.entitiesExtractor.extractMentionedScreennamesWithIndices(getText()));\n }", "private void parseRawText() {\n\t\t//1-new lines\n\t\t//2-pageObjects\n\t\t//3-sections\n\t\t//Clear any residual data.\n\t\tlinePositions.clear();\n\t\tsections.clear();\n\t\tpageObjects.clear();\n\t\tcategories.clear();\n\t\tinterwikis.clear();\n\t\t\n\t\t//Generate data.\n\t\tparsePageForNewLines();\n\t\tparsePageForPageObjects();\n\t\tparsePageForSections();\n\t}", "public void preprocess() {\n }", "public void preprocess() {\n }", "public void preprocess() {\n }", "public void preprocess() {\n }", "private void makeReplacementText() throws IOException {\n valueBuf.clear();\n Token t = new Token();\n int start = currentTokenStart + 1;\n final int end = bufStart - 1;\n try {\n for (;;) {\n\tint tok;\n\tint nextStart;\n\ttry {\n\t tok = Tokenizer.tokenizeEntityValue(buf, start, end, t);\n\t nextStart = t.getTokenEnd();\n\t}\n\tcatch (ExtensibleTokenException e) {\n\t tok = e.getTokenType();\n\t nextStart = end;\n\t}\n\thandleEntityValueToken(valueBuf, tok, start, nextStart, t);\n\tstart = nextStart;\n }\n }\n catch (PartialTokenException e) {\n currentTokenStart = end;\n fatal(\"NOT_WELL_FORMED\");\n }\n catch (InvalidTokenException e) {\n currentTokenStart = e.getOffset();\n reportInvalidToken(e);\n }\n catch (EmptyTokenException e) { }\n }", "protected void processXlateText(Hashtable attributes)\n throws SAXException\n {\n\tString key = (String) attributes.get(XMLTag.ID);\n\tif ((xlatedText == null) || (textTag == null))\n\t {\n\t throw new SAXException(\"Encountered xlateText element (id=\" +\n\t\t\t key + \") outside defining element.\");\n\t }\n\tXMLTag tag = (XMLTag) attributes.get(XMLTag.TAG);\n\tString dflt = (String) attributes.get(XMLTag.REMIND);\n\tString substitute = (String) attributes.get(XMLTag.SUBSTITUTE);\n\tString xlated = textSource.getI18NText(key,dflt);\n // ignore lines that are bare accent graves\n if (xlated.compareTo(\"`\") == 0)\n return;\n if (substitute != null)\n\t {\n\t int p1 = xlated.indexOf(\"%1\");\n\t if (p1 < 0)\n\t p1 = xlated.indexOf(\"%s\");\n\t if (p1 < 0)\n\t p1 = xlated.indexOf(\"%d\");\n\t if (p1 >= 0)\n\t {\n int p2 = xlated.indexOf(\" \",p1);\n\t\tif (p2 < 0)\n\t\t {\n xlated = xlated.substring(0,p1) + substitute;\n\t\t }\n\t\telse\n\t\t {\n xlated = xlated.substring(0,p1) + substitute +\n\t\t xlated.substring(p2);\n\t\t }\n\t\t}\n\t else // just append the substitute string.\n\t {\n p1 = xlated.lastIndexOf(\" \");\n\t\tif (p1 < (xlated.length() - 1))\n\t\t {\n\t\t xlated = xlated + \" \";\n\t\t }\n\t\txlated = xlated + substitute;\n\t\t}\n\t }\n\txlatedText.add(xlated);\n\ttextTag.add(tag);\n\ttextKey.add(key);\n\t}", "@Override\n public SentenceBuilder call(SentenceBuilder builder, Map<String, Object> metadata) throws\n ProcessingException {\n\n /*find all substrings matching XML Escape Entities\n in the SentenceBuilder current String*/\n Matcher m = XMLCharacterEntity.EntityPattern.matcher(builder.toString());\n\n int stringIndex = 0;\n SentenceBuilder.Editor editor = builder.edit();\n\n /*for each entity found,\n * ask the editor to replace the entity text\n * with the character it stands for,\n * obtained by asking it to the XMLCharacterEntity*/\n while (m.find()) {\n int start = m.start();\n int end = m.end();\n\n if (stringIndex < start)\n stringIndex = end;\n\n String entity = m.group();\n String c = XMLCharacterEntity.unescape(entity);\n\n if (c != null)\n editor.replace(start, end - start, c);\n }\n editor.commit();\n return builder;\n }", "String getTransformedText();", "public void run() {\n try {\r\n TransformerFactory tFactory = TransformerFactory.newInstance();\r\n // Fortify Mod: prevent external entity injection\r\n tFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);\r\n Transformer transformer = tFactory.newTransformer();\r\n transformer.setOutputProperty(\"encoding\", \"UTF-8\");\r\n transformer.setOutputProperty(\"indent\", \"yes\");\r\n transformer.transform(new DOMSource(doc), new StreamResult(\r\n pos));\r\n } catch (Exception e) {\r\n throw new RuntimeException(\r\n \"Error converting Document to InputStream. \"\r\n + e.getMessage());\r\n } finally {\r\n try {\r\n pos.close();\r\n } catch (IOException e) {\r\n\r\n }\r\n }\r\n }", "protected abstract String transform(final String xmlContent, final Map<String, Object> params) throws YFormProcessorException;", "private void prepArticle(Element articleContent) {\n // we don't need to do this, we don't care\n cleanStyles(articleContent);\n // this replaces any break element or an nbsp with a plain break\n // element.\n // not needed. We will deal with breaks as we deal with breaks\n // killBreaks(articleContent);\n\n /* Clean out junk from the article content */\n cleanConditionally(articleContent, \"form\");\n clean(articleContent, \"object\");\n clean(articleContent, \"h1\");\n\n /**\n * If there is only one h2, they are probably using it as a header and not a subheader, so remove it\n * since we already have a header.\n ***/\n if (articleContent.getElementsByTag(\"h2\").size() == 1) {\n clean(articleContent, \"h2\");\n }\n clean(articleContent, \"iframe\");\n\n cleanHeaders(articleContent);\n\n /*\n * Do these last as the previous stuff may have removed junk that will affect these\n */\n cleanConditionally(articleContent, \"table\");\n cleanConditionally(articleContent, \"ul\");\n //could have no children, will crash then\n if (articleContent.children().size() != 0) {\n cleanConditionally(articleContent.child(0), \"div\");\n }\n\n /* Remove extra paragraphs */\n Elements articleParagraphs = articleContent.getElementsByTag(\"p\");\n for (Element para : articleParagraphs) {\n int imgCount = para.getElementsByTag(\"img\").size();\n int embedCount = para.getElementsByTag(\"embed\").size();\n int objectCount = para.getElementsByTag(\"object\").size();\n\n if (imgCount == 0 && embedCount == 0 && objectCount == 0 && para.text().matches(\"\\\\s*\")) {\n para.remove();\n }\n }\n\n Elements parasWithPreceedingBreaks = articleContent.getElementsByTag(\"br + p\");\n for (Element pe : parasWithPreceedingBreaks) {\n Element brElement = pe.previousElementSibling();\n brElement.remove();\n }\n }", "public abstract WordEntry manualTranslate(String text, String from, String to);", "@Override\n public void preprocess() {\n }", "public static String normalizeTextForTagger(String text) {\r\n \ttext = text.replaceAll(\"&amp;\", \"&\");\r\n \ttext = StringEscapeUtils.unescapeHtml4(text);\r\n \treturn text;\r\n }", "private static void processPart (WorkPart part) \n\t\tthrows Exception\n\t{\n\t\tTextWrapper textWrapper = part.getPrimaryText();\n\t\tif (textWrapper == null) return;\n\t\tText primary = textWrapper.getText();\n\t\tint n = primary.getNumLines();\n\t\tTextLine[] primaryLines = primary.getLines();\n\t\tTextLine[] translationLines = new TextLine[n];\n\t\tCollection lines = pm.getLinesInWorkPart(part);\n\t\tint numTranslatedLines = 0;\n\t\tfor (Iterator it = lines.iterator(); it.hasNext(); ) {\n\t\t\tLine line = (Line)it.next();\n\t\t\tTextRange location = line.getLocation();\n\t\t\tif (location == null) continue;\n\t\t\tTextLocation start = location.getStart();\n\t\t\tif (start == null) continue;\n\t\t\tTextLocation end = location.getEnd();\n\t\t\tif (end == null) continue;\n\t\t\tint endIndex = end.getIndex();\n\t\t\tString lineTag = line.getTag();\n\t\t\tif (lineTag == null) continue;\n\t\t\tElement el = (Element)lineTagToElMap.get(lineTag);\n\t\t\tif (el == null) continue;\n\t\t\tlineTagsFound.add(lineTag);\n\t\t\tTextLine translationLine = new BuildParagraph(el, \n\t\t\t\tTextParams.ROMAN,\n\t\t\t\tTextParams.TRANSLATED_LINE_FONT_SIZE);\n\t\t\tTextLine primaryLine = primaryLines[endIndex];\n\t\t\tint primaryIndentation = primaryLine.getIndentation();\n\t\t\ttranslationLine.setIndentation(primaryIndentation +\n\t\t\t\tTextParams.TRANSLATION_INDENTATION);\n\t\t\ttranslationLines[endIndex] = translationLine;\n\t\t\tnumTranslatedLines++;\n\t\t}\n\t\tif (numTranslatedLines == 0) return;\n\t\tText translation = new Text();\n\t\ttranslation.setCollapseBlankLines(false);\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tTextLine translationLine = translationLines[i];\n\t\t\tif (translationLine == null) {\n\t\t\t\ttranslation.appendBlankLine();\n\t\t\t} else {\n\t\t\t\ttranslation.appendLine(translationLine);\n\t\t\t}\n\t\t}\n\t\ttranslation.finalize();\n\t\tpm.begin();\n\t\tTextWrapper translationWrapper = new TextWrapper(translation);\n\t\tpm.save(translationWrapper);\n\t\tpart.addTranslation(translationTag, translationWrapper);\n\t\tpm.commit();\n\t}", "@Override\n public void handleSpecialChar(\n com.globalsight.ling.docproc.extractor.html.HtmlObjects.Text t)\n {\n\n }", "public static Patent transform(String patentxml) {\n\t\t patentxml = patentxml.trim();\n\t\t //patentxml = patentxml.replace(\"<!DOCTYPE math PUBLIC \\\"-//W3C//DTD MathML 3.0//EN\\\" \\\"http://www.w3.org/Math/DTD/mathml3/mathml3.dtd\\\">\", \"<!DOCTYPE PATDOC [<!ENTITY nbsp \\\"&#160;\\\" ><!ENTITY iexcl \\\"&#161;\\\" ><!ENTITY cent \\\"&#162;\\\" ><!ENTITY pound \\\"&#163;\\\" ><!ENTITY curren \\\"&#164;\\\" ><!ENTITY yen \\\"&#165;\\\" ><!ENTITY brvbar \\\"&#166;\\\" ><!ENTITY sect \\\"&#167;\\\" ><!ENTITY uml \\\"&#168;\\\" ><!ENTITY copy \\\"&#169;\\\" ><!ENTITY ordf \\\"&#170;\\\" ><!ENTITY laquo \\\"&#171;\\\" ><!ENTITY not \\\"&#172;\\\" ><!ENTITY shy \\\"&#173;\\\" ><!ENTITY reg \\\"&#174;\\\" ><!ENTITY macr \\\"&#175;\\\" ><!ENTITY deg \\\"&#176;\\\" ><!ENTITY plusmn \\\"&#177;\\\" ><!ENTITY sup2 \\\"&#178;\\\" ><!ENTITY sup3 \\\"&#179;\\\" ><!ENTITY acute \\\"&#180;\\\" ><!ENTITY micro \\\"&#181;\\\" ><!ENTITY para \\\"&#182;\\\" ><!ENTITY middot \\\"&#183;\\\" ><!ENTITY cedil \\\"&#184;\\\" ><!ENTITY sup1 \\\"&#185;\\\" ><!ENTITY ordm \\\"&#186;\\\" ><!ENTITY raquo \\\"&#187;\\\" ><!ENTITY frac14 \\\"&#188;\\\" ><!ENTITY frac12 \\\"&#189;\\\" ><!ENTITY frac34 \\\"&#190;\\\" ><!ENTITY iquest \\\"&#191;\\\" ><!ENTITY Agrave \\\"&#192;\\\" ><!ENTITY Aacute \\\"&#193;\\\" ><!ENTITY Acirc \\\"&#194;\\\" ><!ENTITY Atilde \\\"&#195;\\\" ><!ENTITY Auml \\\"&#196;\\\" ><!ENTITY Aring \\\"&#197;\\\" ><!ENTITY AElig \\\"&#198;\\\" ><!ENTITY Ccedil \\\"&#199;\\\" ><!ENTITY Egrave \\\"&#200;\\\" ><!ENTITY Eacute \\\"&#201;\\\" ><!ENTITY Ecirc \\\"&#202;\\\" ><!ENTITY Euml \\\"&#203;\\\" ><!ENTITY Igrave \\\"&#204;\\\" ><!ENTITY Iacute \\\"&#205;\\\" ><!ENTITY Icirc \\\"&#206;\\\" ><!ENTITY Iuml \\\"&#207;\\\" ><!ENTITY ETH \\\"&#208;\\\" ><!ENTITY Ntilde \\\"&#209;\\\" ><!ENTITY Ograve \\\"&#210;\\\" ><!ENTITY Oacute \\\"&#211;\\\" ><!ENTITY Ocirc \\\"&#212;\\\" ><!ENTITY Otilde \\\"&#213;\\\" ><!ENTITY Ouml \\\"&#214;\\\" ><!ENTITY times \\\"&#215;\\\" ><!ENTITY Oslash \\\"&#216;\\\" ><!ENTITY Ugrave \\\"&#217;\\\" ><!ENTITY Uacute \\\"&#218;\\\" ><!ENTITY Ucirc \\\"&#219;\\\" ><!ENTITY Uuml \\\"&#220;\\\" ><!ENTITY Yacute \\\"&#221;\\\" ><!ENTITY THORN \\\"&#222;\\\" ><!ENTITY szlig \\\"&#223;\\\" ><!ENTITY agrave \\\"&#224;\\\" ><!ENTITY aacute \\\"&#225;\\\" ><!ENTITY acirc \\\"&#226;\\\" ><!ENTITY atilde \\\"&#227;\\\" ><!ENTITY auml \\\"&#228;\\\" ><!ENTITY aring \\\"&#229;\\\" ><!ENTITY aelig \\\"&#230;\\\" ><!ENTITY ccedil \\\"&#231;\\\" ><!ENTITY egrave \\\"&#232;\\\" ><!ENTITY eacute \\\"&#233;\\\" ><!ENTITY ecirc \\\"&#234;\\\" ><!ENTITY euml \\\"&#235;\\\" ><!ENTITY igrave \\\"&#236;\\\" ><!ENTITY iacute \\\"&#237;\\\" ><!ENTITY icirc \\\"&#238;\\\" ><!ENTITY iuml \\\"&#239;\\\" ><!ENTITY eth \\\"&#240;\\\" ><!ENTITY ntilde \\\"&#241;\\\" ><!ENTITY ograve \\\"&#242;\\\" ><!ENTITY oacute \\\"&#243;\\\" ><!ENTITY ocirc \\\"&#244;\\\" ><!ENTITY otilde \\\"&#245;\\\" ><!ENTITY ouml \\\"&#246;\\\" ><!ENTITY divide \\\"&#247;\\\" ><!ENTITY oslash \\\"&#248;\\\" ><!ENTITY ugrave \\\"&#249;\\\" ><!ENTITY uacute \\\"&#250;\\\" ><!ENTITY ucirc \\\"&#251;\\\" ><!ENTITY uuml \\\"&#252;\\\" ><!ENTITY yacute \\\"&#253;\\\" ><!ENTITY thorn \\\"&#254;\\\" ><!ENTITY yuml \\\"&#255;\\\" > <!ENTITY lt \\\"&#38;#60;\\\" > <!ENTITY gt \\\"&#62;\\\" > <!ENTITY amp \\\"&#38;#38;\\\" > <!ENTITY apos \\\"&#39;\\\" > <!ENTITY quot \\\"&#34;\\\" > <!ENTITY OElig \\\"&#338;\\\" > <!ENTITY oelig \\\"&#339;\\\" > <!ENTITY Scaron \\\"&#352;\\\" > <!ENTITY scaron \\\"&#353;\\\" > <!ENTITY Yuml \\\"&#376;\\\" > <!ENTITY circ \\\"&#710;\\\" > <!ENTITY tilde \\\"&#732;\\\" > <!ENTITY ensp \\\"&#8194;\\\" > <!ENTITY emsp \\\"&#8195;\\\" > <!ENTITY thinsp \\\"&#8201;\\\" > <!ENTITY zwnj \\\"&#8204;\\\" > <!ENTITY zwj \\\"&#8205;\\\" > <!ENTITY lrm \\\"&#8206;\\\" > <!ENTITY rlm \\\"&#8207;\\\" > <!ENTITY ndash \\\"&#8211;\\\" > <!ENTITY mdash \\\"&#8212;\\\" > <!ENTITY lsquo \\\"&#8216;\\\" > <!ENTITY rsquo \\\"&#8217;\\\" > <!ENTITY sbquo \\\"&#8218;\\\" > <!ENTITY ldquo \\\"&#8220;\\\" > <!ENTITY rdquo \\\"&#8221;\\\" > <!ENTITY bdquo \\\"&#8222;\\\" > <!ENTITY dagger \\\"&#8224;\\\" > <!ENTITY Dagger \\\"&#8225;\\\" > <!ENTITY permil \\\"&#8240;\\\" > <!ENTITY lsaquo \\\"&#8249;\\\" > <!ENTITY rsaquo \\\"&#8250;\\\" > <!ENTITY euro \\\"&#8364;\\\" > <!ENTITY minus \\\"&#43;\\\" > <!ENTITY plus \\\"&#43;\\\" > <!ENTITY equals \\\"&#61;\\\" > <!ENTITY af \\\"\\\" > <!ENTITY it \\\"\\\" ><!ENTITY fnof \\\"&#402;\\\" > <!ENTITY Alpha \\\"&#913;\\\" > <!ENTITY Beta \\\"&#914;\\\" > <!ENTITY Gamma \\\"&#915;\\\" > <!ENTITY Delta \\\"&#916;\\\" > <!ENTITY Epsilon \\\"&#917;\\\" > <!ENTITY Zeta \\\"&#918;\\\" > <!ENTITY Eta \\\"&#919;\\\" > <!ENTITY Theta \\\"&#920;\\\" > <!ENTITY Iota \\\"&#921;\\\" > <!ENTITY Kappa \\\"&#922;\\\" > <!ENTITY Lambda \\\"&#923;\\\" > <!ENTITY Mu \\\"&#924;\\\" > <!ENTITY Nu \\\"&#925;\\\" > <!ENTITY Xi \\\"&#926;\\\" > <!ENTITY Omicron \\\"&#927;\\\" > <!ENTITY Pi \\\"&#928;\\\" > <!ENTITY Rho \\\"&#929;\\\" > <!ENTITY Sigma \\\"&#931;\\\" > <!ENTITY Tau \\\"&#932;\\\" > <!ENTITY Upsilon \\\"&#933;\\\" > <!ENTITY Phi \\\"&#934;\\\" > <!ENTITY Chi \\\"&#935;\\\" > <!ENTITY Psi \\\"&#936;\\\" > <!ENTITY Omega \\\"&#937;\\\" > <!ENTITY alpha \\\"&#945;\\\" > <!ENTITY beta \\\"&#946;\\\" > <!ENTITY gamma \\\"&#947;\\\" > <!ENTITY delta \\\"&#948;\\\" > <!ENTITY epsilon \\\"&#949;\\\" > <!ENTITY zeta \\\"&#950;\\\" > <!ENTITY eta \\\"&#951;\\\" > <!ENTITY theta \\\"&#952;\\\" > <!ENTITY iota \\\"&#953;\\\" > <!ENTITY kappa \\\"&#954;\\\" > <!ENTITY lambda \\\"&#955;\\\" > <!ENTITY mu \\\"&#956;\\\" > <!ENTITY nu \\\"&#957;\\\" > <!ENTITY xi \\\"&#958;\\\" > <!ENTITY omicron \\\"&#959;\\\" > <!ENTITY pi \\\"&#960;\\\" > <!ENTITY rho \\\"&#961;\\\" > <!ENTITY sigmaf \\\"&#962;\\\" > <!ENTITY sigma \\\"&#963;\\\" > <!ENTITY tau \\\"&#964;\\\" > <!ENTITY upsilon \\\"&#965;\\\" > <!ENTITY phi \\\"&#966;\\\" > <!ENTITY chi \\\"&#967;\\\" > <!ENTITY psi \\\"&#968;\\\" > <!ENTITY omega \\\"&#969;\\\" > <!ENTITY thetasym \\\"&#977;\\\" > <!ENTITY upsih \\\"&#978;\\\" > <!ENTITY piv \\\"&#982;\\\" > <!ENTITY bull \\\"&#8226;\\\" > <!ENTITY hellip \\\"&#8230;\\\" > <!ENTITY prime \\\"&#8242;\\\" > <!ENTITY Prime \\\"&#8243;\\\" > <!ENTITY oline \\\"&#8254;\\\" > <!ENTITY frasl \\\"&#8260;\\\" > <!ENTITY weierp \\\"&#8472;\\\" > <!ENTITY image \\\"&#8465;\\\" > <!ENTITY real \\\"&#8476;\\\" > <!ENTITY trade \\\"&#8482;\\\" > <!ENTITY alefsym \\\"&#8501;\\\" > <!ENTITY larr \\\"&#8592;\\\" > <!ENTITY uarr \\\"&#8593;\\\" > <!ENTITY rarr \\\"&#8594;\\\" > <!ENTITY darr \\\"&#8595;\\\" > <!ENTITY harr \\\"&#8596;\\\" > <!ENTITY crarr \\\"&#8629;\\\" > <!ENTITY lArr \\\"&#8656;\\\" > <!ENTITY uArr \\\"&#8657;\\\" > <!ENTITY rArr \\\"&#8658;\\\" > <!ENTITY dArr \\\"&#8659;\\\" > <!ENTITY hArr \\\"&#8660;\\\" > <!ENTITY forall \\\"&#8704;\\\" > <!ENTITY part \\\"&#8706;\\\" > <!ENTITY exist \\\"&#8707;\\\" > <!ENTITY empty \\\"&#8709;\\\" > <!ENTITY nabla \\\"&#8711;\\\" > <!ENTITY isin \\\"&#8712;\\\" > <!ENTITY notin \\\"&#8713;\\\" > <!ENTITY ni \\\"&#8715;\\\" > <!ENTITY prod \\\"&#8719;\\\" > <!ENTITY sum \\\"&#8721;\\\" > <!ENTITY minus \\\"&#8722;\\\" > <!ENTITY lowast \\\"&#8727;\\\" > <!ENTITY radic \\\"&#8730;\\\" > <!ENTITY prop \\\"&#8733;\\\" > <!ENTITY infin \\\"&#8734;\\\" > <!ENTITY ang \\\"&#8736;\\\" > <!ENTITY and \\\"&#8743;\\\" > <!ENTITY or \\\"&#8744;\\\" > <!ENTITY cap \\\"&#8745;\\\" > <!ENTITY cup \\\"&#8746;\\\" > <!ENTITY int \\\"&#8747;\\\" > <!ENTITY there4 \\\"&#8756;\\\" > <!ENTITY sim \\\"&#8764;\\\" > <!ENTITY cong \\\"&#8773;\\\" > <!ENTITY asymp \\\"&#8776;\\\" > <!ENTITY ne \\\"&#8800;\\\" > <!ENTITY equiv \\\"&#8801;\\\" > <!ENTITY le \\\"&#8804;\\\" > <!ENTITY ge \\\"&#8805;\\\" > <!ENTITY sub \\\"&#8834;\\\" > <!ENTITY sup \\\"&#8835;\\\" > <!ENTITY nsub \\\"&#8836;\\\" > <!ENTITY sube \\\"&#8838;\\\" > <!ENTITY supe \\\"&#8839;\\\" > <!ENTITY oplus \\\"&#8853;\\\" > <!ENTITY otimes \\\"&#8855;\\\" > <!ENTITY perp \\\"&#8869;\\\" > <!ENTITY sdot \\\"&#8901;\\\" > <!ENTITY lceil \\\"&#8968;\\\" > <!ENTITY rceil \\\"&#8969;\\\" > <!ENTITY lfloor \\\"&#8970;\\\" > <!ENTITY rfloor \\\"&#8971;\\\" > <!ENTITY lang \\\"&#9001;\\\" > <!ENTITY rang \\\"&#9002;\\\" > <!ENTITY loz \\\"&#9674;\\\" > <!ENTITY spades \\\"&#9824;\\\" > <!ENTITY clubs \\\"&#9827;\\\" > <!ENTITY hearts \\\"&#9829;\\\" > <!ENTITY diams \\\"&#9830;\\\" > <!ENTITY lcub \\\"\\\" > <!ENTITY rcub \\\"\\\" > <!ENTITY excl \\\"\\\" > <!ENTITY quest \\\"\\\" > <!ENTITY num \\\"\\\" >]>\");\n\t\t //patentxml = patentxml.replace(\"<!DOCTYPE math PUBLIC \\\"-//W3C//DTD MathML 3.0//EN\\\" \\\"http://www.w3.org/Math/DTD/mathml3/mathml3.dtd\\\">\", \"<!DOCTYPE math PUBLIC \\\"-//W3C//DTD MathML 2.0//EN\\\" \\\"dtds/mathml2.dtd\\\">\");\n\t\t patentxml = patentxml.replace(\"<!DOCTYPE math PUBLIC \\\"-//W3C//DTD MathML 3.0//EN\\\" \\\"http://www.w3.org/Math/DTD/mathml3/mathml3.dtd\\\">\", \"<!DOCTYPE math PUBLIC \\\"-//W3C//DTD MathML 2.0//EN\\\" \\\"http://10.18.203.79:7070/solr/dtds/mathml2.dtd\\\">\");\n\t\t Patent parsedPatent = null;\n\t if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v4.5 2014-04-03\\\"\")==true) { // patent xml is grant in DTD v4.5\n\t\t\t\tparsedPatent = parseGrantv45(patentxml);\t\t \n\t }\n\t else if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v4.4 2013-05-16\\\"\")==true) { // patent xml is grant in DTD v4.4\n\t \tparsedPatent = parseGrantv44(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v4.3 2012-12-04\\\"\")==true) { // patent xml is grant in DTD v4.3\n\t \tparsedPatent = parseGrantv43(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v4.2 2006-08-23\\\"\")==true) { // patent xml is grant in DTD v4.2\n\t \tparsedPatent = parseGrantv42(patentxml);\n\t }\t\n\t else if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v4.1 2005-08-25\\\"\")==true) { // patent xml is grant in DTD v4.5\n\t \tparsedPatent = parseGrantv41(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-grant\") && patentxml.contains(\"dtd-version=\\\"v40 2004-12-02\\\"\")==true) { // patent xml is grant in DTD v4.0\n\t \tparsedPatent = parseGrantv40_041202(patentxml);\n\t }\n\t else if(patentxml.contains(\"<PATDOC DTD=\\\"2.5\\\"\")==true) { // patent xml is grant in DTD v2.5\n\t \tparsedPatent = parseGrantv25(patentxml);\t\t \t\t\t\t \n\t }\n\t else if(patentxml.contains(\"<PATDOC DTD=\\\"2.4\\\"\")==true) { // patent xml is grant in DTD v2.5\n\t \tparsedPatent = parseGrantv24(patentxml);\t\t \t\t\t\t \n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.4 2014-04-03\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv44(patentxml);\t\t \n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.3 2012-12-04\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv43(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.2 2006-08-23\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv42(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.1 2005-08-25\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv41(patentxml);\n\t }\t \t \n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.0 2004-12-02\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv40_041202(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.0 2004-10-28\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv40_041028(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.0 2004-09-27\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv40_040927(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.0 2004-09-08\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv40_040908(patentxml);\n\t }\n\t else if(patentxml.contains(\"us-patent-application\") && patentxml.contains(\"dtd-version=\\\"v4.0 2004-04-15\\\"\")==true) { // patent xml is application in DTD v4.4\n\t \tparsedPatent = parseApplicationv40_040415(patentxml);\n\t }\n\t else if(patentxml.indexOf(\"<!DOCTYPE patent-application-publication\")==0 && patentxml.contains(\"pap-v16-2002-01-01.dtd\")==true) { // patent xml is application in DTD v1.6\n\t \tparsedPatent = parseApplicationv16(patentxml);\n\t }\n\t\t return parsedPatent==null? new Patent():parsedPatent;\n\t }", "public String preProcess( String data );", "public static void preprocessWikipediaInformation(LocationDataIO locationData) {\n\t\ttry {\n\t\t\tSAXParserFactory factory = SAXParserFactory.newInstance();\n\t\t\tfactory.setFeature(\"http://xml.org/sax/features/validation\", false);\n\t\t\tfactory.setFeature(\"http://apache.org/xml/features/continue-after-fatal-error\", true);\n\t\t\tfactory.setFeature(\"http://apache.org/xml/features/continue-after-fatal-error\", true);\n\t\t\tSAXParser parser = factory.newSAXParser();\n\n\t\t\tIterator<POI> iter = locationData.getPOIs().iterator();\n\t\t\twhile (iter.hasNext()) {\n\t\t\t\tPOI current = iter.next();\n\t\t\t\tif (current.getURL() != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tSystem.out.print(current.getName());\n\t\t\t\t\t\tURL url = current.getURL();\n\t\t\t\t\t\tURLConnection connection = url.openConnection();\n\t\t\t\t\t\tconnection.connect();\n\t\t\t\t\t\tInputSource input = new InputSource(connection.getInputStream());\n\t\t\t\t\t\tString lang = current.getURL().toExternalForm();\n\t\t\t\t\t\tif (lang.length() > 9 && lang.substring(7, 9).matches(\"[a-zA-Z]{2}\")) {\n\t\t\t\t\t\t\tlang = lang.substring(7, 9);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlang = \"de\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tWikipediaHandler handler = new WikipediaHandler(lang);\n\n\t\t\t\t\t\tparser.parse(input, handler);\n\t\t\t\t\t\tcurrent.setTextInfo(handler.getFirstParagraphs());\n\t\t\t\t\t\tcurrent.setURL(handler.getImageURL());\n\t\t\t\t\t\tSystem.out.print(\" ✓\\n\");\n\t\t\t\t\t} catch (SAXException e) {\n\t\t\t\t\t\tlogger.info(String.format(\"Schwerwiegender Syntaxfehler in %s! Wird ignoriert.\", current.getURL().toExternalForm()));\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tlogger.info(current.getURL().toExternalForm() + \" konnte nicht gelesen werden! Wird ignoriert.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (ParserConfigurationException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SAXNotRecognizedException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SAXNotSupportedException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SAXException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\npublic\tvoid parseInput() {\n InputStream is = new ByteArrayInputStream(this.body.toString().getBytes());\n\t\t\n\t\t\n\t\ttry {\n\t\t\tthis.domIn = new XMLInputConversion(is);\n\t\t} catch (ParserConfigurationException | SAXException | IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tthis.rootXML = this.domIn.extractDOMContent();\n\t}", "@Override\n public void preprocess() {\n }", "public static String createValidContent(final String string) {\n\t\treturn Strings.replace(string, XML_ENTITY_CHARS, XML_ENTITY_REPLACMENTS); //do the replacements for the special XML symbols and return the results\n\t}", "IParser setDontEncodeElements(Collection<String> theDontEncodeElements);", "public void method1() {\n String s = \"\\uFE64\" + \"script\" + \"\\uFE65\";\n // Validate\n Pattern pattern = Pattern.compile(\"[<>]\"); // Check for angle brackets\n Matcher matcher = pattern.matcher(s);\n if (matcher.find()) {\n // Found black listed tag\n throw new IllegalStateException();\n } else {\n // ...\n }\n // Normalize\n s = Normalizer.normalize(s, Form.NFKC);\n }", "@Override\n\tprotected Map<Object, Object> rawTextParse(CharSequence text) {\n\n\t\tStanfordCoreNLP pipeline = null;\n\t\ttry {\n\t\t\tpipeline = pipelines.take();\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tAnnotation document = new Annotation(text.toString());\n\t\tpipeline.annotate(document);\n\t\tMap<Object, Object> sentencesMap = new LinkedHashMap<Object, Object>();//maintain sentence order\n\t\tint id = 0;\n\t\tList<CoreMap> sentences = document.get(CoreAnnotations.SentencesAnnotation.class);\n\n\t\tfor (CoreMap sentence : sentences) {\n\t\t\tStringBuilder processedText = new StringBuilder();\n\t\t\tfor (CoreLabel token : sentence.get(CoreAnnotations.TokensAnnotation.class)) {\n\t\t\t\tString word = token.get(CoreAnnotations.TextAnnotation.class);\n\t\t\t\tString lemma = token.get(CoreAnnotations.LemmaAnnotation.class);\n\t\t\t\tString pos = token.get(CoreAnnotations.PartOfSpeechAnnotation.class);\n\t\t\t\t//todo this should really happen after parsing is done, because using lemmas might confuse the parser\n\t\t\t\tif (config().isUseLowercaseEntries()) {\n\t\t\t\t\tword = word.toLowerCase();\n\t\t\t\t\tlemma = lemma.toLowerCase();\n\t\t\t\t}\n\t\t\t\tif (config().isUseLemma()) {\n\t\t\t\t\tword = lemma;\n\t\t\t\t}\n\t\t\t\tprocessedText.append(word).append(POS_DELIMITER).append(lemma).append(POS_DELIMITER).append(pos).append(TOKEN_DELIM);\n //inserts a TOKEN_DELIM at the end too\n\t\t\t}\n\t\t\tsentencesMap.put(id, processedText.toString().trim());//remove the single trailing space\n\t\t\tid++;\n\t\t}\n\t\ttry {\n\t\t\tpipelines.put(pipeline);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn sentencesMap;\n\t}", "private void normaliseWhitespace() {\t\t\t\r\n\t\tdocument.normalizeDocument();\r\n\t\t\r\n\t\tif (document.getDocumentElement() == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tfinal Queue<Node> queue = Lists.newLinkedList();\r\n\t\tqueue.add(document.getDocumentElement());\r\n\t\twhile (!queue.isEmpty()) {\r\n\t\t\tfinal Node node = queue.remove();\r\n\t\t\tfinal NodeList children = node.getChildNodes();\r\n\t\t\tfor (int index = 0; index < children.getLength(); index++) {\r\n\t\t\t\tqueue.add(children.item(index));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (node.getNodeType() == Node.TEXT_NODE) {\r\n\t\t\t\tnode.setTextContent(node.getTextContent().trim());\r\n\t\t\t\tif (node.getTextContent().isEmpty()) {\r\n\t\t\t\t\tnode.getParentNode().removeChild(node);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public abstract WordEntry autoTranslate(String text, String to);", "private void processPendingText() throws SAXException {\n if(state==AFTER_START_ELEMENT) {\n for( int i=bufLen-1; i>=0; i-- )\n if( !WhiteSpaceProcessor.isWhiteSpace(buf[i]) ) {\n super.characters(buf, 0, bufLen);\n return;\n }\n }\n }", "public static void convertTextParts(TextContainer tc) {\r\n \t\tfor (TextPart textPart : tc) {\r\n \t\t\tconvertTextPart(textPart);\r\n \t\t}\r\n \t}", "public ArrayList<String> makeSentences(String text) {\n \t\t/*\n \t\t * Quick check so we're not trying to split up an empty\n \t\t * String. This only happens right before the user types\n \t\t * at the end of a document and we don't have anything to\n \t\t * split, so return.\n \t\t */\n \t\tif (text.equals(\"\")) {\n \t\t\tArrayList<String> sents = new ArrayList<String>();\n \t\t\tsents.add(\"\");\n \t\t\treturn sents;\n \t\t}\n \t\t\n \t\t/**\n \t\t * Because the eosTracker isn't initialized until the TaggedDocument is,\n \t\t * it won't be ready until near the end of DocumentProcessor, in which\n \t\t * case we want to set it to the correct\n \t\t */\n \t\tthis.eosTracker = main.editorDriver.taggedDoc.eosTracker;\n \t\tthis.editorDriver = main.editorDriver;\n \t\t\n \t\tArrayList<String> sents = new ArrayList<String>(ANONConstants.EXPECTED_NUM_OF_SENTENCES);\n \t\tArrayList<String> finalSents = new ArrayList<String>(ANONConstants.EXPECTED_NUM_OF_SENTENCES);\n \t\tboolean mergeNext = false;\n \t\tboolean mergeWithLast = false;\n \t\tboolean forceNoMerge = false;\n \t\tint currentStart = 1;\n \t\tint currentStop = 0;\n \t\tString temp;\n \n \t\t/**\n \t\t * replace unicode format characters that will ruin the regular\n \t\t * expressions (because non-printable characters in the document still\n \t\t * take up indices, but you won't know they're there untill you\n \t\t * \"arrow\" though the document and have to hit the same arrow twice to\n \t\t * move past a certain point. Note that we must use \"Cf\" rather than\n \t\t * \"C\". If we use \"C\" or \"Cc\" (which includes control characters), we\n \t\t * remove our newline characters and this screws up the document. \"Cf\"\n \t\t * is \"other, format\". \"Cc\" is \"other, control\". Using \"C\" will match\n \t\t * both of them.\n \t\t */\n \t\ttext = text.replaceAll(\"\\u201C\",\"\\\"\");\n \t\ttext = text.replaceAll(\"\\u201D\",\"\\\"\");\n \t\ttext = text.replaceAll(\"\\\\p{Cf}\",\"\");\n \n \t\tint lenText = text.length();\n \t\tint index = 0;\n \t\tint buffer = editorDriver.sentIndices[0];\n \t\tString safeString = \"\";\n \t\tMatcher abbreviationFinder = ABBREVIATIONS_PATTERN.matcher(text);\n \t\t\n \t\t//================ SEARCHING FOR ABBREVIATIONS ================\n \t\twhile (index < lenText-1 && abbreviationFinder.find(index)) {\n \t\t\tindex = abbreviationFinder.start();\n \t\t\t\n \t\t\ttry {\n \t\t\t\tint abbrevLength = index;\n \t\t\t\twhile (text.charAt(abbrevLength) != ' ') {\n \t\t\t\t\tabbrevLength--;\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif (ABBREVIATIONS.contains(text.substring(abbrevLength+1, index+1))) {\n \t\t\t\t\teosTracker.setIgnore(index+buffer, true);\n \t\t\t\t}\n \t\t\t} catch (Exception e) {}\n \t\t\t\n \t\t\tindex++;\n \t\t}\t\t\n \t\t\n \t\tMatcher sent = EOS_chars.matcher(text);\n \t\tboolean foundEOS = sent.find(currentStart); // xxx TODO xxx take this EOS character, and if not in quotes, swap it for a permanent replacement, and create and add an EOS to the calling TaggedDocument's eosTracker.\n \t\t\n \t\t/*\n \t\t * We want to check and make sure that the EOS character (if one was found) is not supposed to be ignored. If it is, we will act like we did not\n \t\t * find it. If there are multiple sentences with multiple EOS characters passed it will go through each to check, foundEOS will only be true if\n \t\t * an EOS exists in \"text\" that would normally be an EOS character and is not set to be ignored.\n \t\t */\n \t\t\n \t\tindex = 0;\n \t\tif (foundEOS) {\t\n \t\t\ttry {\n \t\t\t\twhile (index < lenText-1 && sent.find(index)) {\n \t\t\t\t\tindex = sent.start();\n \t\t\t\t\tif (!eosTracker.sentenceEndAtIndex(index+buffer)) {\n \t\t\t\t\t\tfoundEOS = false;\n \t\t\t\t\t} else {\n \t\t\t\t\t\tfoundEOS = true;\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t\tindex++;\n \t\t\t\t}\n \t\t\t} catch (IllegalStateException e) {}\n \t\t}\n \t\t//We need to reset the Matcher for the code below\n \t\tsent = EOS_chars.matcher(text);\n \t\tsent.find(currentStart);\n \t\t\n \t\tMatcher sentEnd;\n \t\tMatcher citationFinder;\n \t\tboolean hasCitation = false;\n \t\tint charNum = 0;\n \t\tint lenTemp = 0;\n \t\tint lastQuoteAt = 0;\n \t\tint lastParenAt = 0;\n \t\tboolean foundQuote = false;\n \t\tboolean foundParentheses = false;\n \t\tboolean isSentence;\n \t\tboolean foundAtLeastOneEOS = foundEOS;\n \t\t\n \t\t/**\n \t\t * Needed otherwise when the user has text like below:\n \t\t * \t\tThis is my sentence one. This is \"My sentence?\" two. This is the last sentence.\n \t\t * and they begin to delete the EOS character as such:\n \t\t * \t\tThis is my sentence one. This is \"My sentence?\" two This is the last sentence.\n \t\t * Everything gets screwed up. This is because the operations below operate as expected only when there actually is an EOS character\n \t\t * at the end of the text, it expects it there in order to function properly. Now usually if there is no EOS character at the end it wouldn't\n \t\t * matter since the while loop and !foundAtLeastOneEOS conditional are executed properly, BUT as you can see the quotes, or more notably the EOS character inside\n \t\t * the quotes, triggers this initial test and thus the operation breaks. This is here just to make sure that does not happen.\n \t\t */\n \t\tString trimmedText = text.trim();\n \t\tint trimmedTextLength = trimmedText.length();\n \n \t\t//We want to make sure that if there is an EOS character at the end that it is not supposed to be ignored\n \t\tboolean EOSAtSentenceEnd = true;\n \t\tif (trimmedTextLength != 0) {\n \t\t\tEOSAtSentenceEnd = EOS.contains(trimmedText.substring(trimmedTextLength-1, trimmedTextLength)) && eosTracker.sentenceEndAtIndex(editorDriver.sentIndices[1]-1);\n \t\t} else {\n \t\t\tEOSAtSentenceEnd = false;\n \t\t}\n \t\t\n \t\t//Needed so that if we are deleting abbreviations like \"Ph.D.\" this is not triggered.\n \t\tif (!EOSAtSentenceEnd && (editorDriver.taggedDoc.watchForEOS == -1))\n \t\t\tEOSAtSentenceEnd = true;\n \n \t\twhile (foundEOS == true) {\n \t\t\tcurrentStop = sent.end();\n \t\t\t\n \t\t\t//We want to make sure currentStop skips over ignored EOS characters and stops only when we hit a true EOS character\n \t\t\ttry {\n \t\t\t\twhile (!eosTracker.sentenceEndAtIndex(currentStop+buffer-1) && currentStop != lenText) {\n \t\t\t\t\tsent.find(currentStop+1);\n \t\t\t\t\tcurrentStop = sent.end();\n \t\t\t\t}\n \t\t\t} catch (Exception e) {}\n \n \t\t\ttemp = text.substring(currentStart-1,currentStop);\n \t\t\tlenTemp = temp.length();\n \t\t\tlastQuoteAt = 0;\n \t\t\tlastParenAt = 0;\n \t\t\tfoundQuote = false;\n \t\t\tfoundParentheses = false;\n \t\t\t\n \t\t\tfor(charNum = 0; charNum < lenTemp; charNum++){\n \t\t\t\tif (temp.charAt(charNum) == '\\\"') {\n \t\t\t\t\tlastQuoteAt = charNum;\n \t\t\t\t\t\n \t\t\t\t\tif (foundQuote == true)\n \t\t\t\t\t\tfoundQuote = false;\n \t\t\t\t\telse\n \t\t\t\t\t\tfoundQuote = true;\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif (temp.charAt(charNum) == '(') {\n \t\t\t\t\tlastParenAt = charNum;\n \t\t\t\t\t\n \t\t\t\t\tif (foundParentheses)\n \t\t\t\t\t\tfoundParentheses = false;\n \t\t\t\t\telse\n \t\t\t\t\t\tfoundParentheses = true;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tif (foundQuote == true && ((temp.indexOf(\"\\\"\",lastQuoteAt+1)) == -1)) { // then we found an EOS character that shouldn't split a sentence because it's within an open quote.\n \t\t\t\tif ((currentStop = text.indexOf(\"\\\"\",currentStart +lastQuoteAt+1)) == -1) {\n \t\t\t\t\tcurrentStop = text.length(); // if we can't find a closing quote in the rest of the input text, then we assume the author forgot to put a closing quote, and act like it's at the end of the input text.\n \t\t\t\t}\n \t\t\t\telse{\n \t\t\t\t\tcurrentStop +=1;\n \t\t\t\t\tmergeNext=true;// the EOS character we are looking for is not in this section of text (section being defined as a substring of 'text' between two EOS characters.)\n \t\t\t\t}\n \t\t\t}\n \t\t\tsafeString = text.substring(currentStart-1,currentStop);\n \t\t\t\n \t\t\tif (foundParentheses && ((temp.indexOf(\")\", lastParenAt+1)) == -1)) {\n \t\t\t\tif ((currentStop = text.indexOf(\")\", currentStart + lastParenAt + 1)) == -1)\n \t\t\t\t\tcurrentStop = text.length();\n \t\t\t\telse {\n \t\t\t\t\tcurrentStop += 1;\n \t\t\t\t\tmergeNext = true;\n \t\t\t\t}\n \t\t\t}\n \t\t\tsafeString = text.substring(currentStart-1,currentStop);\n \n \t\t\tif (foundQuote) {\n \t\t\t\tsentEnd = SENTENCE_QUOTE.matcher(text);\t\n \t\t\t\tisSentence = sentEnd.find(currentStop-2); // -2 so that we match the EOS character before the quotes (not -1 because currentStop is one greater than the last index of the string -- due to the way substring works, which is includes the first index, and excludes the end index: [start,end).)\n \n \t\t\t\tif (isSentence == true) { // If it seems that the text looks like this: He said, \"Hello.\" Then she said, \"Hi.\" \n \t\t\t\t\t// Then we want to split this up into two sentences (it's possible to have a sentence like this: He said, \"Hello.\")\n \t\t\t\t\tcurrentStop = text.indexOf(\"\\\"\",sentEnd.start())+1;\n \t\t\t\t\tsafeString = text.substring(currentStart-1,currentStop);\n \t\t\t\t\tforceNoMerge = true;\n \t\t\t\t\tmergeNext = false;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tif (foundParentheses) {\n \t\t\t\tsentEnd = SENTENCE_PARENTHESES.matcher(text);\n \t\t\t\tisSentence = sentEnd.find(currentStop-2);\n \t\t\t\t\n \t\t\t\tif (isSentence == true) {\n \t\t\t\t\tcurrentStop = text.indexOf(\")\", sentEnd.start()) + 1;\n \t\t\t\t\tsafeString = text.substring(currentStart-1, currentStop);\n \t\t\t\t\tforceNoMerge = true;\n \t\t\t\t\tmergeNext = false;\n \t\t\t\t}\n \t\t\t}\n \n \t\t\t// now check to see if there is a CITATION after the sentence (doesn't just apply to quotes due to paraphrasing)\n \t\t\t// The rule -- at least as of now -- is if after the EOS mark there is a set of parenthesis containing either one word (name) or a name and numbers (name 123) || (123 name) || (123-456 name) || (name 123-456) || etc..\n \t\t\tcitationFinder = CITATION.matcher(text.substring(currentStop));\t\n \t\t\thasCitation = citationFinder.find(); // -2 so that we match the EOS character before the quotes (not -1 because currentStop is one greater than the last index of the string -- due to the way substring works, which is includes the first index, and excludes the end index: [start,end).)\n \t\t\t\n \t\t\tif (hasCitation == true) { // If it seems that the text looks like this: He said, \"Hello.\" Then she said, \"Hi.\" \n \t\t\t\t// Then we want to split this up into two sentences (it's possible to have a sentence like this: He said, \"Hello.\")\n \t\t\t\tcurrentStop = text.indexOf(\")\",citationFinder.start()+currentStop)+1;\n \t\t\t\tsafeString = text.substring(currentStart-1,currentStop);\n \t\t\t\tmergeNext = false;\n \t\t\t}\t\n \t\t\t\n \t\t\tif (mergeWithLast) {\n \t\t\t\tmergeWithLast=false;\n \t\t\t\tString prev=sents.remove(sents.size()-1);\n \t\t\t\tsafeString=prev+safeString;\n \t\t\t}\n \t\t\t\n \t\t\tif (mergeNext && !forceNoMerge) {//makes the merge happen on the next pass through\n \t\t\t\tmergeNext=false;\n \t\t\t\tmergeWithLast=true;\n \t\t\t} else {\n \t\t\t\tforceNoMerge = false;\n \t\t\t\tfinalSents.add(safeString);\n \t\t\t}\n \t\t\n \t\t\tsents.add(safeString);\n \t\t\t\n \t\t\t//// xxx xxx xxx return the safeString_subbedEOS too!!!!\n \t\t\tif (currentStart < 0 || currentStop < 0) {\n \t\t\t\tLogger.logln(NAME+\"Something went really wrong making sentence tokens.\", LogOut.STDERR);\n \t\t\t\tErrorHandler.fatalProcessingError(null);\n \t\t\t}\n \n \t\t\tcurrentStart = currentStop+1;\n \t\t\tif (currentStart >= lenText) {\n \t\t\t\tfoundEOS = false;\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n \t\t\tfoundEOS = sent.find(currentStart);\n \t\t}\n \n \t\tif (!foundAtLeastOneEOS || !EOSAtSentenceEnd) {\n \t\t\tArrayList<String> wrapper = new ArrayList<String>(1);\n \t\t\twrapper.add(text);\n \t\t\treturn wrapper;\n \t\t}\n \t\t\n \t\treturn finalSents;\n \t}", "public static void main(String[] args) {\n System.out.println(transform(\"\"));\n System.out.println(transform(\"I cän ©onv&#235;&reg;t - things &#038; stuff: ½. &#x00AE;\"));\n }", "public String transform(String text){\n for(int i=0; i<transforms.length; i++)\n {\n if(transforms[i].contains(\"fromabbreviation\")){\n text = textTransformerAbbreviation.fromAbbreviation(text);\n }\n if(transforms[i].contains(\"toabbreviation\")){\n text = textTransformerAbbreviation.toAbbreviation(text);\n }\n if(transforms[i].contains(\"inverse\")){\n text = textTransformerInverse.inverse(text);\n }\n if(transforms[i].contains(\"upper\")){\n text = textTransformerLetterSize.upper(text);\n }\n if(transforms[i].contains(\"lower\")){\n text = textTransformerLetterSize.lower(text);\n }\n if(transforms[i].contains(\"capitalize\")) {\n text = textTransformerLetterSize.capitalize(text);\n }\n if(transforms[i].contains(\"latex\")){\n text = textTransformerLatex.toLatex(text);\n }\n if(transforms[i].contains(\"numbers\")){\n text = textTransformerNumbers.toText(text);\n }\n if(transforms[i].contains(\"repetitions\")){\n text = textTransformerRepetition.deleteRepetitions(text);\n }\n logger.debug(\"Text after \" + (i+1) + \" transform: \" + text);\n }\n\n logger.debug(\"Final form: \" + text);\n return text;\n }", "protected void processTextElement(XMLTag elementTag)\n throws SAXException\n {\n\tif (elementTag == XMLTag.LABEL)\n\t {\n\t // one line, no formatting, applies to either\n\t // control or menu item.\n\t if (currentControl != null)\n\t {\n\t\tString label = (String) xlatedText.get(0);\n\t\tcurrentControl.setLabelText(label);\n\t\tString labelKey = (String) textKey.get(0);\n\t\tcurrentControl.setLabelKey(labelKey);\n\t\t}\n\t }\n\telse if (elementTag == XMLTag.TITLE)\n\t {\n\t if (currentPanel != null)\n\t {\n\t\tString title = (String) xlatedText.get(0);\n\t\tcurrentPanel.setTitle(title);\n\t\t} \n\t }\n\telse if (elementTag == XMLTag.HELP)\n\t {\n\t // Need to concatenate all strings and format\n\t // as HTML - will be embedded in another HTML\n\t // document, so we can leave off the <HTML> and <BODY>\n\t StringBuffer helpString = new StringBuffer();\n\t String[] keys = new String[textKey.size()];\n boolean bInList = false;\n\t for (int i = 0; i < xlatedText.size(); i++)\n\t {\n\t\tString temp = replaceAngleBrackets((String) xlatedText.get(i));\n\t\tXMLTag tTag = (XMLTag) textTag.get(i);\n\t\tif (tTag == XMLTag.PARAGRAPH)\n\t\t {\n if (bInList)\n\t\t {\n\t\t helpString.append(\"</dl>\\n\"); \n bInList = false;\n\t\t\t}\n\t\t if (i == 0)\n\t\t {\n\t\t\t //~~\t\thelpString.append(\"<P>\");\n\t\t\t}\n\t\t else\n\t\t {\n\t\t helpString.append(\"<p>\");\n\t\t\t}\n helpString.append(temp);\n\t\t }\n\t\telse if (tTag == XMLTag.LISTITEM)\n\t\t {\n if (!bInList)\n\t\t {\n\t\t helpString.append(\"<dl>\\n\");\n\t\t\tbInList = true;\n\t\t\t}\n\t\t if (i > 0)\n\t\t helpString.append(\"\\n\");\n\t\t helpString.append(\"<dd>\" + temp + \"</dd>\\n\");\n\t\t }\n\t\telse\n\t\t {\n\t\t helpString.append(temp);\n\t\t }\n\t\tkeys[i] = (String) textKey.get(i);\n\t\t}\n if (bInList)\n\t {\n helpString.append(\"</dl>\\n\");\n\t\t}\n\t helpString.append(\"</p></FONT>\\n\");\n\t // could apply to either a control or a menu item.\n\t if (currentControl != null)\n\t {\n\t\tcurrentControl.setHelpString(helpString.toString());\n\t\tcurrentControl.setHelpKeys(keys);\n\t\t}\n\t }\n\telse if (elementTag == XMLTag.CHOICES)\n\t {\n\t // only relevant if the current control is a combo, radio,\n\t // or checkbutton\n\t if (currentControl.isChoiceControl())\n\t {\n\t\tString[] keys = new String[textKey.size()];\n\t\tString[] choices = new String[xlatedText.size()];\n\t\tfor (int i = 0; i < xlatedText.size(); i++)\n\t\t {\n\t\t choices[i] = (String) xlatedText.get(i);\n\t\t keys[i] = (String) textKey.get(i);\n\t\t }\n\t\tcurrentControl.setChoiceStrings(choices);\n\t\tcurrentControl.setChoiceKeys(keys);\n\t\t}\n\t }\n\telse if (elementTag == XMLTag.TOOLTIP)\n\t {\n\t // just ignore \n\t // only relevant to menu items\n\n\t }\n\telse if (elementTag == XMLTag.DEFAULT)\n\t {\n if (currentControl != null)\n\t {\n\t\tString text = (String) xlatedText.get(0);\n\t\tcurrentControl.setDefaultValue(text);\n\t\tString key = (String)textKey.get(0);\n\t\tcurrentControl.setDefaultKey(key);\n\t }\n\t }\n\t// get rid of text and tags - we are done with them\n\txlatedText.clear();\n\txlatedText = null;\n\ttextTag.clear();\n\ttextTag = null;\n\t}", "@Test\n\tpublic void testTextToXml()\n\t{\n\t\tDocument doc = XMLUtil.createEmpty();\n\t\tText text = new Text(\"Steve Unger Smells\");\n\t\tElement element = this.parser.toXML(doc, text);\n\t\tText text2 = this.parser.fromXML(element);\n\t\t\n\t\tassertEquals(\"Steve Unger Smells\", text2.getText());\t\t\n\t}", "public void getParsed(String text) {\n\t\tAnnotation document = new Annotation(text);\n\n\t\t// run all Annotators on this text\n\t\tpipeline.annotate(document);\n\t\tsentences = document.get(SentencesAnnotation.class);\n\t\tsentIt = sentences.iterator();\n\t}", "void validate() throws JDOMException, SAXException, IOException {\n\t\tif (oldLangFile != null && addressFactory == null || registerMgr == null) {\n\t\t\treadOldLanguage(false);\n\t\t}\n\t}", "void commonConstruction () {\n\n if (inFile != null) {\n dataParent = inFile.getParent();\n }\n if (inURL != null) {\n dataParent = \"www\";\n }\n context = new HTMLContext();\n context.setFile(this);\n context.entityTranslation = false;\n\t\thtmlChar = new HTMLCharacter (context);\n }", "@Before\n\tpublic void setUp() throws Exception {\n\t\tList<Paragraph> paragraphs = new ArrayList<Paragraph>();\n\t\tList<Paragraph> paragraphsWithNoSentences = new ArrayList<Paragraph>();\n\t\t\n\t\tScanner sc = null, sc1 = null;\n\t\ttry {\n\t\t\tsc = new Scanner(new File(\"testsearchtext.txt\"));\n\t\t\tsc1 = new Scanner(new File(\"testsearchentity.txt\"));\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tsc.useDelimiter(\"[.]\");\n\t\tsc1.useDelimiter(\"[|]\");\n\t\t\n\t\tList<Sentence> sentences = new ArrayList<Sentence>();\n\t\tint sCount = 0;\n\t\tint pCount = 0;\n\t\twhile(sc.hasNext()){\n\t\t\tString temp = sc.next().trim();\n\n\t\t\tif(sCount > 0 && (sCount%10 == 0 || !sc.hasNext())){\n\t\t\t\tParagraph p = new Paragraph(pCount);\n\t\t\t\tparagraphsWithNoSentences.add(p);\n\t\t\t\t\n\t\t\t\tp = new Paragraph(pCount);\n\t\t\t\tp.setSentences(sentences);\n\t\t\t\tparagraphs.add(p);\n\t\t\t\tpCount++;\n\t\t\t\t\n\t\t\t\tsentences = new ArrayList<Sentence>();\n\t\t\t}\n\t\t\t\n\t\t\tif(!temp.equals(\"\"))\n\t\t\t\tsentences.add(new Sentence((sCount%10), temp));\n\t\t\t\n\t\t\tsCount++;\n\t\t}\n\t\t\n\t\tList<Entity> entities = new ArrayList<Entity>();\n\t\tint currType = -1; \n\t\twhile(sc1.hasNext()){\n\t\t\tString temp = sc1.next().trim();\n\t\t\tif(temp.equals(\"place\")){currType = Entity.PLACE;} else\n\t\t\tif(temp.equals(\"url\")){currType = Entity.URL;} else\n\t\t\tif(temp.equals(\"email\")){currType = Entity.EMAIL;} else\n\t\t\tif(temp.equals(\"address\")){currType = Entity.ADDRESS;} \n\t\t\telse{\n\t\t\t\tentities.add(new Entity(currType, temp));\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tSource s = new Source(\"testsearchtext.txt\", \"testsearchtext.txt\");\n\t\tpt1 = new ProcessedText(s, paragraphs, null); \n\t\t\n\t\ts = new Source(\"testsearchtext1.txt\", \"testsearchtext1.txt\");\n\t\tpt2 = new ProcessedText(s, paragraphsWithNoSentences, null); \n\t\t\n\t\tpt3 = new ProcessedText();\n\t\tpt3.setParagraphs(paragraphs);\n\t\t\n\t\tpt4 = new ProcessedText();\n\t\ts = new Source(\"testsearchtext2.txt\", \"testsearchtext2.txt\");\n\t\tpt4.setMetadata(s);\n\t\t\n\t\ts = new Source(\"testsearchtext3.txt\", \"testsearchtext3.txt\");\n\t\tpt5 = new ProcessedText(s, paragraphs, entities); \n\t\t\n\t\ts = new Source(\"testsearchtext4.txt\", \"testsearchtext4.txt\");\n\t\tpt6 = new ProcessedText(s, null, entities); \n\t}", "private void convertTextBoxes(XWPFParagraph paragraph) {\n XmlCursor cursor = paragraph.getCTP().newCursor();\n cursor.selectPath(\"declare namespace w='http://schemas.openxmlformats.org/wordprocessingml/2006/main' .//*/w:txbxContent/w:p/w:r\");\n\n List<XmlObject> ctrsintxtbx = new ArrayList<>();\n\n while (cursor.hasNextSelection()) {\n cursor.toNextSelection();\n XmlObject obj = cursor.getObject();\n ctrsintxtbx.add(obj);\n }\n for (XmlObject xmlObject : ctrsintxtbx) {\n CTR ctr = null;\n try {\n ctr = CTR.Factory.parse(xmlObject.toString());\n XWPFRun textBoxRun = new XWPFRun(ctr, paragraph);\n// textBoxRun.getText(0);\n String fontFamily = getFontFamily(textBoxRun);\n String[] convertedText = engine.toUnicode(textBoxRun.getText(0), fontFamily);\n String sConvertedText = convertedText[0];\n textBoxRun.setText(sConvertedText, 0);\n// System.out.println(sConvertedText);\n logger.info(\"Text of textbox : \" + textBoxRun.getText(0));\n this.setFontFamily(textBoxRun, convertedText[1]);\n\n xmlObject.set(textBoxRun.getCTR());\n } catch (XmlException e) {\n e.printStackTrace();\n }\n\n }\n }", "public synchronized final void process() throws FilterException {\n if (this.result == null)\n throw new FilterException(i18n.getString(\"outputNotSet\"));\n if (this.source == null)\n throw new FilterException(i18n.getString(\"inputNotSet\"));\n\n try {\n // Starts the input interpretation (transformation)\n this.transformer.transform(this.source, this.result);\n } catch (TransformerException e) {\n throw new FilterException(e);\n } finally {\n this.source = null;\n this.result = null;\n }\n }", "private void textilize () {\n\n textIndex = 0;\n int textEnd = line.length() - 1;\n listChars = new StringBuffer();\n linkAlias = false;\n while (textIndex < line.length()\n && (Character.isWhitespace(textChar()))) {\n textIndex++;\n }\n while (textEnd >= 0\n && textEnd >= textIndex\n && Character.isWhitespace (line.charAt (textEnd))) {\n textEnd--;\n }\n boolean blankLine = (textIndex >= line.length());\n if (blankLine) {\n textilizeBlankLine();\n }\n else\n if ((textIndex > 0)\n || ((line.length() > 0 )\n && (line.charAt(0) == '<'))) {\n // First character is white space of the beginning of an html tag:\n // Doesn't look like textile... process it without modification.\n }\n else\n if (((textEnd - textIndex) == 3)\n && line.substring(textIndex,textEnd + 1).equals (\"----\")) {\n // && (line.substring(textIndex, (textEnd + 1)).equals (\"----\")) {\n textilizeHorizontalRule(textIndex, textEnd);\n } else {\n textilizeNonBlankLine();\n };\n }", "@Override\n public void unpackMarkup(Document doc, RepositioningInfo repInfo,\n RepositioningInfo ampCodingInfo) throws DocumentFormatException {\n if((doc == null)\n || (doc.getSourceUrl() == null && doc.getContent() == null)) {\n\n throw new DocumentFormatException(\n \"GATE document is null or no content found. Nothing to parse!\"); }// End\n // if\n\n // Create a status listener\n StatusListener statusListener = new StatusListener() {\n @Override\n public void statusChanged(String text) {\n // This is implemented in DocumentFormat.java and inherited here\n fireStatusChanged(text);\n }\n };\n\n // determine whether we have a GATE format document or not\n /*String content = doc.getContent().toString();\n if(content.length() > 2048) {\n content = content.substring(0, 2048);\n }*/\n boolean gateFormat = isGateFIFormat(doc);\n \n\n if(gateFormat) {\n unpackGateFormatMarkup(doc, statusListener);\n } else {\n unpackGeneralXmlMarkup(doc, repInfo, ampCodingInfo, statusListener);\n }\n }", "private void cleanupRawTags(ArrayList p_tags)\n {\n // Find the paired tags that belong together.\n // !!! DO NOT RELY ON PAIRING STATUS. Some prop changes start\n // after <seg> but close after </seg> and even after </tu>!!!\n assignPairingStatus(p_tags);\n\n // Basic cleanup: remove surrounding <p> and inner <o:p>\n removeParagraphTags(p_tags);\n\n // Remove revision markers when they were ON accidentally\n // before translating documents or during an alignment task\n // (WinAlign).\n removePropRevisionMarkers(p_tags);\n\n // Cleanup INS/DEL revisions similarly.\n removeDelRevisions(p_tags);\n applyInsRevisions(p_tags);\n\n // WinAligned files can contain endnotes (and footnotes, but I\n // think in Word-HTML they're both endnotes).\n removeEndNotes(p_tags);\n\n // Remove empty spans that are created from superfluous\n // original formatting in Word (<span color=blue></span>)\n removeEmptyFormatting(p_tags);\n\n // Leave the rest to the Word-HTML Extractor.\n }", "@Override\n\tpublic void postParse() {\n\t}", "@Override\n\tpublic void postParse() {\n\t}", "private void entityInAttributeValueState() throws SAXException, IOException {\n /*\n * Attempt to consume an entity.\n */\n consumeEntity(true);\n /*\n * If nothing is returned, append a U+0026 AMPERSAND character to the\n * current attribute's value.\n * \n * Otherwise, append the returned character token to the current\n * attribute's value.\n */\n // handled in consumeEntity();\n /*\n * Finally, switch back to the attribute value state that you were in\n * when were switched into this state.\n */\n return;\n }", "private static void processText(String line, BufferedWriter wrtr)\n\t\t\tthrows JSONException, IOException {\n\t\tJSONObject topicModel = TopicModelTemplateUtil\n\t\t\t\t.getJSONFromTemplate(line);\n\t\t// populate the WORD vector for the current topic model\n\t\tTopicModelTemplateUtil.geTopicModelFromTemplate(topicModel).forEach(\n\t\t\t\ttpm -> {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tLuceneNLPUtil.getRemovedStopAndStem(tpm.getWord(),\n\t\t\t\t\t\t\t\tLuceneNLPUtil.getDefaultEnglishStopWordList())\n\t\t\t\t\t\t\t\t.forEach(word -> {\n\t\t\t\t\t\t\t\t\tif (VOCABULARY_MAP.containsKey(word)) {\n\t\t\t\t\t\t\t\t\t\tVOCABULARY_MAP.replace(word, 1);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t// dump it to the file\n\t\tdumpTextLine(topicModel.getString(ConfigConstant.JSON_FIELD.BUSINESS_ID\n\t\t\t\t.getFieldName()), wrtr);\n\t}", "@Override\n public void unpackMarkup(Document doc) throws DocumentFormatException {\n unpackMarkup(doc, (RepositioningInfo)null, (RepositioningInfo)null);\n }", "private void convertParagrpahRuns(List<XWPFRun> runs, XWPFParagraph paragraph){\n\n int currentParagraphPosition = paragraph.getDocument().getPosOfParagraph(paragraph);\n\n if (runs != null) {\n int runsLength = runs.size();\n int i = 0;\n while (i < runsLength) {\n XWPFRun run = runs.get(i);\n String fontFamily = getFontFamily(run);\n\n CTR ctrRun = run.getCTR();\n int sizeOfCtr = ctrRun.sizeOfTArray();\n\n // Fixing the first text position separately because it might have text which should go to previous runners\n String[] convertedText = engine.toUnicode(run.getText(0), fontFamily);\n String sConvertedText = convertedText[0];\n\n // Fixing broken Word issues 1st attempt\n sConvertedText = fixBrokenWordIssue(runs, sConvertedText, currentParagraphPosition , paragraph, i);\n\n //fixing broken word issue 2nd attempt\n sConvertedText = fixBrokenWordIssue(runs, sConvertedText, currentParagraphPosition , paragraph, i);\n\n run.setText(sConvertedText, 0);\n\n //Case where there are multiple wt tags inside the same wr tag\n // In this case broken word errors does not rise, text inside the same wr tag render fine. So not applying that fix here\n for (int runnerTextPosition = 1; runnerTextPosition < sizeOfCtr; runnerTextPosition++) {\n String[] nonZeroPostionedConverted = engine.toUnicode(run.getText(runnerTextPosition), fontFamily);\n String nonZeroPostionedConvertedText = nonZeroPostionedConverted[0];\n\n run.setText(nonZeroPostionedConvertedText, runnerTextPosition);\n\n }\n\n this.setFontFamily(run, convertedText[1]);\n i++;\n }\n }\n }", "public boolean setRawText(String text) {\n\t\ttry {\n\t\t\ttext = text.replace(\" \", \"\");\n\t\t\tString[] line = text.split(\"\\n\");\n\n\t\t\tif (line.length != 2) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tline[0] = replaceWithChars(line[0]);\n\t\t\tline[0] = line[0].substring(5);\n\n\t\t\tString[] names = line[0].split(\"<\");\n\n\t\t\tthis.nume = names[0];\n\n\t\t\tthis.prenume = \"\";\n\t\t\tfor (int i=1; i<names.length; i++) {\n\t\t\t\tif (names[i] != null && ! names[i].equals(\"\")) {\n\t\t\t\t\tthis.prenume += names[i] + \" \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t//\n\t\t\t// Start processing second line. \n\t\t\t//\n\t\t\tnames = line[1].split(\"<\");\n\n\t\t\tif (names.length != 2) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tthis.seria = \"\" + names[0].charAt(0); \n\t\t\tif (names[0].charAt(1) == '0') {\n\t\t\t\tthis.seria += \"D\";\n\t\t\t} else {\n\t\t\t\tthis.seria += names[0].charAt(1);\n\t\t\t}\n\n\t\t\tthis.numarul = replaceWithNumbers( names[0].substring(2) );\n\t\t\tthis.cetatenia = replaceWithNumbers( names[1].substring(0,4) ) ;\n\t\t\tthis.dataNasteri = replaceWithNumbers( names[1].substring(4,10) ) ;\n\t\t\tthis.sex = names[1].charAt(11);\n\t\t\tif (sex == 'H') {\n\t\t\t\tsex = 'M';\n\t\t\t}\n\t\t\t\n\t\t\tthis.valabilitate = replaceWithNumbers(names[1].substring(12,18));\n\n\t\t\tthis.CNP = sex == 'F'?\"2\" : \"1\";\n\t\t\tthis.CNP += this.dataNasteri + replaceWithNumbers( names[1].substring(20,26));\n\t\t\t\n\t\t\tthis.validate();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public abstract void normalizeInput(Operation operation, NormalizedMessage normMsg, DOMSource msgSource)\n throws MessagingException;", "public static void convertTextPart(TextPart textPart) {\r\n \t\tif (!textPart.isSegment()) {\r\n \t\t\tTextFragment tf = textPart.getContent();\r\n \t\t\tif (tf.hasCode()) return;\r\n \t\t\t\r\n \t\t\t// Move the whole text of text part to a single code\r\n \t\t\ttf.changeToCode(0, tf.getCodedText().length(), \r\n \t\t\t\t\tTagType.PLACEHOLDER, null);\r\n \t\t}\r\n \t}", "@Override\n\tpublic Paragraph translateText(String freetext, boolean include) {\n\t\treturn null;\n\t}", "private void translate(String input)\r\n/* 270: */ {\r\n/* 271:229 */ if (input.trim().isEmpty())\r\n/* 272: */ {\r\n/* 273:230 */ Mark.err(new Object[] {\"IMPACT produced nothing to translate\" });\r\n/* 274:231 */ return;\r\n/* 275: */ }\r\n/* 276:233 */ this.things.clear();\r\n/* 277:234 */ this.triples.clear();\r\n/* 278:235 */ this.previousTriple = null;\r\n/* 279:236 */ this.previousTriples.clear();\r\n/* 280: */ \r\n/* 281:238 */ String[] sentences = input.trim().split(\"\\\\)\\\\.\");\r\n/* 282:240 */ for (String s : sentences)\r\n/* 283: */ {\r\n/* 284:241 */ s = s.trim();\r\n/* 285:242 */ Mark.say(new Object[] {\"Sentence:\", s });\r\n/* 286: */ try\r\n/* 287: */ {\r\n/* 288:244 */ String[] parts = s.split(\"\\\\(\");\r\n/* 289:245 */ ThingTimeTriple triple = constructGenesisAction(parts[0].trim(), parts[1].trim());\r\n/* 290:246 */ this.triples.add(triple);\r\n/* 291:247 */ this.tripleList.clear();\r\n/* 292:248 */ this.tripleList.addAll(this.triples);\r\n/* 293: */ }\r\n/* 294: */ catch (Exception e)\r\n/* 295: */ {\r\n/* 296:252 */ Mark.say(new Object[] {\"Blew out trying to process IMPACT result,\", s });\r\n/* 297: */ \r\n/* 298:254 */ e.printStackTrace();\r\n/* 299: */ }\r\n/* 300: */ }\r\n/* 301: */ }", "private void textilizeNonBlankLine () {\n StringBuffer blockMod = new StringBuffer();\n int startPosition = 0;\n int textPosition = 0;\n leftParenPartOfURL = false;\n attributeType = 0;\n klass = new StringBuffer();\n id = new StringBuffer();\n style = new StringBuffer();\n language = new StringBuffer();\n String imageTitle = \"\";\n String imageURL = \"\";\n int endOfImageURL = -1;\n boolean doublePeriod = false;\n int periodPosition = line.indexOf (\".\");\n if (periodPosition >= 0) {\n textPosition = periodPosition + 1;\n if (textPosition < line.length()) {\n if (line.charAt (textPosition) == '.') {\n doublePeriod = true;\n textPosition++;\n }\n if (textPosition < line.length()\n && line.charAt (textPosition) == ' ') {\n textPosition++;\n textIndex = 0;\n while (textIndex < periodPosition\n && (Character.isLetterOrDigit (textChar()))) {\n blockMod.append (textChar());\n textIndex++;\n } // end while more letters and digits\n if (blockMod.toString().equals (\"p\")\n || blockMod.toString().equals (\"bq\")\n || blockMod.toString().equals (\"h1\")\n || blockMod.toString().equals (\"h2\")\n || blockMod.toString().equals (\"h3\")\n || blockMod.toString().equals (\"h4\")\n || blockMod.toString().equals (\"h5\")\n || blockMod.toString().equals (\"h6\")) {\n // look for attributes\n collectAttributes (periodPosition);\n } else {\n blockMod = new StringBuffer();\n textPosition = 0;\n }\n } // end if space follows period(s)\n } // end if not end of line following first period\n } // end if period found\n\n // Start processing at the beginning of the line\n textIndex = 0;\n\n // If we have a block modifier, then generate appropriate HTML\n if (blockMod.length() > 0) {\n lineDelete (textPosition);\n closeOpenBlockQuote();\n closeOpenBlock();\n doLists();\n if (blockMod.toString().equals (\"bq\")) {\n lineInsert (\"<blockquote><p\");\n context.blockQuoting = true;\n } else {\n lineInsert (\"<\" + blockMod.toString());\n }\n if (klass.length() > 0) {\n lineInsert (\" class=\\\"\" + klass.toString() + \"\\\"\");\n }\n lineInsert (\">\");\n if (doublePeriod) {\n context.nextBlock = blockMod.toString();\n } else {\n context.nextBlock = \"p\";\n }\n }\n\n // See if line starts with one or more list characters\n if (blockMod.length() <= 0) {\n while (textIndex < line.length()\n && (textChar() == '*'\n || textChar() == '#'\n || textChar() == ';')) {\n listChars.append (textChar());\n textIndex++;\n }\n if (listChars.length() > 0\n && (textIndex >= line.length()\n || ((! Character.isWhitespace (textChar()))\n && (textChar() != '(')))) {\n listChars = new StringBuffer();\n textIndex = 0;\n }\n int firstSpace = line.indexOf (\" \", textIndex);\n if (listChars.length() > 0) {\n collectAttributes (firstSpace);\n }\n }\n int endDelete = textIndex;\n if (endDelete < line.length()\n && Character.isWhitespace (line.charAt (endDelete))) {\n endDelete++;\n }\n\n if (listChars.length() > 0) {\n lineDelete (0, endDelete);\n }\n doLists();\n if (listChars.length() > 0\n && listChars.charAt(listChars.length() - 1) == ';') {\n lastDefChar = ';';\n } else {\n lastDefChar = ' ';\n }\n\n // See if this line contains a link alias\n if ((blockMod.length() <= 0)\n && ((line.length() - textIndex) >= 4)\n && (textChar() == '[')) {\n int rightBracketIndex = line.indexOf (\"]\", textIndex);\n if (rightBracketIndex > (textIndex + 1)) {\n linkAlias = true;\n String alias = line.substring (textIndex + 1, rightBracketIndex);\n String url = line.substring (rightBracketIndex + 1);\n lineDelete (line.length() - textIndex);\n lineInsert (\"<a alias=\\\"\" + alias + \"\\\" href=\\\"\" + url + \"\\\"> </a>\");\n }\n }\n\n // If no other instructions, use default start for a new line\n if (blockMod.length() <= 0 \n && listChars.length() <= 0\n & (! linkAlias)) {\n // This non-blank line does not start with a block modifier or a list char\n if (context.lastLineBlank) {\n if (context.nextBlock.equals (\"bq\")) {\n lineInsert (\"<p>\");\n } else {\n closeOpenBlockQuote();\n lineInsert (\"<\" + context.nextBlock + \">\");\n }\n } else {\n lineInsert (\"<br />\");\n }\n }\n\n // Now examine the rest of the line\n char last = ' ';\n char c = ' ';\n char next = ' ';\n leftParenPartOfURL = false;\n resetLineIndexArray();\n while (textIndex <= line.length()) {\n // Get current character, last character and next character\n last = c;\n if (textIndex < line.length()) {\n c = textChar();\n } else {\n c = ' ';\n }\n if ((textIndex + 1) < line.length()) {\n next = line.charAt (textIndex + 1);\n } else {\n next = ' ';\n }\n \n // ?? means a citation\n if (c == '?' && last == '?') {\n if (ix [CITATION] >= 0) {\n replaceWithHTML (CITATION, 2);\n } else {\n ix [CITATION] = textIndex - 1;\n textIndex++;\n }\n }\n else\n // __ means italics\n if (c == '_' && last == '_' && ix [QUOTE_COLON] < 0) {\n if (ix [ITALICS] >= 0) {\n replaceWithHTML (ITALICS, 2);\n } else {\n ix [ITALICS] = textIndex - 1;\n textIndex++;\n }\n }\n else\n // ** means bold\n if (c == '*' && last == '*') {\n if (ix [BOLD] >= 0) {\n replaceWithHTML (BOLD, 2);\n } else {\n ix [BOLD] = textIndex - 1;\n textIndex++;\n }\n }\n else\n // _ means emphasis\n if (c == '_' && next != '_' && ix [QUOTE_COLON] < 0) {\n if (ix [EMPHASIS] >= 0) {\n replaceWithHTML (EMPHASIS, 1);\n } else {\n ix [EMPHASIS] = textIndex;\n textIndex++;\n }\n }\n else\n // * means strong\n if (c == '*' && next != '*') {\n if (ix [STRONG] >= 0) {\n replaceWithHTML (STRONG, 1);\n } else {\n ix [STRONG] = textIndex;\n textIndex++;\n }\n }\n else\n // Exclamation points surround image urls\n if (c == '!' && Character.isLetter(next)\n && ix [QUOTE_COLON] < 0 && ix [EXCLAMATION] < 0) {\n // First exclamation point : store its location and move on\n ix [EXCLAMATION] = textIndex;\n textIndex++;\n }\n else\n // Second exclamation point\n if (c == '!'\n && ix [QUOTE_COLON] < 0 && ix [EXCLAMATION] >= 0) {\n // Second exclamation point\n imageTitle = \"\";\n endOfImageURL = textIndex;\n if (last == ')' && ix [EXCLAMATION_LEFT_PAREN] > 0) {\n ix [EXCLAMATION_RIGHT_PAREN] = textIndex - 1;\n endOfImageURL = ix [EXCLAMATION_LEFT_PAREN];\n imageTitle = line.substring\n (ix [EXCLAMATION_LEFT_PAREN] + 1, ix [EXCLAMATION_RIGHT_PAREN]);\n }\n imageURL = line.substring (ix [EXCLAMATION] + 1, endOfImageURL);\n // Delete the image url, title and parentheses,\n // but leave exclamation points for now.\n lineDelete (ix [EXCLAMATION] + 1, textIndex - ix [EXCLAMATION] - 1);\n String titleString = \"\";\n if (imageTitle.length() > 0) {\n titleString = \" title=\\\"\" + imageTitle + \"\\\" alt=\\\"\" + imageTitle + \"\\\"\";\n }\n lineInsert (ix [EXCLAMATION] + 1,\n \"<img src=\\\"\" + imageURL + \"\\\"\" + titleString + \" />\");\n if (next == ':') {\n // Second exclamation followed by a colon -- look for url for link\n ix [QUOTE_COLON] = textIndex;\n ix [LAST_QUOTE] = ix [EXCLAMATION];\n } else {\n lineDelete (ix [EXCLAMATION], 1);\n lineDelete (textIndex, 1);\n }\n ix [EXCLAMATION] = -1;\n ix [EXCLAMATION_LEFT_PAREN] = -1;\n ix [EXCLAMATION_RIGHT_PAREN] = -1;\n textIndex++;\n } // end if second exclamation point\n else\n // Parentheses within exclamation points enclose the image title\n if (c == '(' && ix [EXCLAMATION] > 0 ) {\n ix [EXCLAMATION_LEFT_PAREN] = textIndex;\n textIndex++;\n }\n else\n // Double quotation marks surround linked text\n if (c == '\"' && ix [QUOTE_COLON] < 0) {\n if (next == ':'\n && ix [LAST_QUOTE] >= 0\n && textIndex > (ix [LAST_QUOTE] + 1)) {\n ix [QUOTE_COLON] = textIndex;\n } else {\n ix [LAST_QUOTE] = textIndex;\n }\n textIndex++;\n }\n else\n // Flag a left paren inside of a url\n if (c == '(' && ix [QUOTE_COLON] > 0) {\n leftParenPartOfURL = true;\n textIndex++;\n }\n else\n // Space may indicate end of url\n if (Character.isWhitespace (c)\n && ix [QUOTE_COLON] > 0\n && ix [LAST_QUOTE] >= 0\n && textIndex > (ix [QUOTE_COLON] + 2)) {\n int endOfURL = textIndex - 1;\n // end of url is last character of url\n // do not include any trailing punctuation at end of url\n int backup = 0;\n while ((endOfURL > (ix [QUOTE_COLON] + 2))\n && (! Character.isLetterOrDigit (line.charAt(endOfURL)))\n && (! ((line.charAt(endOfURL) == ')') && (leftParenPartOfURL)))\n && (! (line.charAt(endOfURL) == '/'))) {\n endOfURL--;\n backup++;\n }\n String url = line.substring (ix [QUOTE_COLON] + 2, endOfURL + 1);\n // insert the closing anchor tag\n lineInsert (endOfURL + 1, \"</a>\");\n // Delete the quote, colon and url from the line\n lineDelete (ix [QUOTE_COLON], endOfURL + 1 - ix [QUOTE_COLON]);\n // insert the beginning of the anchor tag\n lineDelete (ix [LAST_QUOTE], 1);\n lineInsert (ix [LAST_QUOTE], \"<a href=\\\"\" + url + \"\\\">\");\n // Reset the pointers\n ix [QUOTE_COLON] = -1;\n ix [LAST_QUOTE] = -1;\n leftParenPartOfURL = false;\n // Increment the index to the next character\n if (backup > 0) {\n textIndex = textIndex - backup;\n } else {\n textIndex++;\n }\n }\n else\n // Look for start of definition\n if ((c == ':' || c == ';')\n && Character.isWhitespace(last)\n && Character.isWhitespace(next)\n && listChars.length() > 0\n && (lastDefChar == ';' || lastDefChar == ':')) {\n lineDelete (textIndex - 1, 3);\n lineInsert (closeDefinitionTag (lastDefChar)\n + openDefinitionTag (c));\n lastDefChar = c;\n }\n /* else\n // -- means an em dash\n if (c == '-' && last == '-') {\n textIndex--;\n lineDelete (2);\n lineInsert (\"&#8212;\");\n } */ else {\n textIndex++;\n }\n }// end while more characters to examine\n\n context.lastLineBlank = false;\n\n }", "public static String preprocessForFormating(String inputText){\n\t\tif (inputText != null) {\n\t\t\treturn inputText.replace(\"''\", \"'\").replace(\"'\", \"''\");\n\t\t} else {\n\t\t\treturn \"\";\n\t\t}\n\t}", "public String cleanHtmlTextForPlayer(String unrefinedHtmlText) {\n\n String figureRemove = replaceAllCharacter(unrefinedHtmlText, ConstantUtil.HTML_EXTRACT_FIGURE_REGEX, ConstantUtil.BLANK);\n String figcaptionRemove = replaceAllCharacter(figureRemove, ConstantUtil.HTML_EXTRACT_FIGCAPTION_REGEX, ConstantUtil.BLANK);\n String almostRefinedText = figcaptionRemove.replaceAll(ConstantUtil.HTML_EXTRACT_IMG_REGEX, ConstantUtil.BLANK);\n return almostRefinedText;\n\n }", "String processing();", "public void processDocument() {\n\n\t\t// compact concepts\n\t\tprocessConcepts(concepts);\n\t}", "private void unpackGeneralXmlMarkup(Document doc, RepositioningInfo repInfo,\n RepositioningInfo ampCodingInfo, StatusListener statusListener)\n throws DocumentFormatException {\n boolean docHasContentButNoValidURL = hasContentButNoValidUrl(doc);\n\n XmlDocumentHandler xmlDocHandler = null;\n try {\n\n // Create a new Xml document handler\n xmlDocHandler =\n new XmlDocumentHandler(doc, this.markupElementsMap,\n this.element2StringMap);\n\n // Register a status listener with it\n xmlDocHandler.addStatusListener(statusListener);\n\n // set repositioning object\n xmlDocHandler.setRepositioningInfo(repInfo);\n\n // set the object with ampersand coding positions\n xmlDocHandler.setAmpCodingInfo(ampCodingInfo);\n\n // create the parser\n SAXDocumentParser newxmlParser = new SAXDocumentParser();\n\n // Set up the factory to create the appropriate type of parser\n // Fast Infoset doesn't support validating which is good as we would want\n // it off any way, but we do want it to be namesapace aware\n newxmlParser.setFeature(\"http://xml.org/sax/features/namespaces\", true);\n newxmlParser.setFeature(\"http://xml.org/sax/features/namespace-prefixes\",\n true);\n newxmlParser.setContentHandler(xmlDocHandler);\n newxmlParser.setErrorHandler(xmlDocHandler);\n newxmlParser.setDTDHandler(xmlDocHandler);\n newxmlParser.setEntityResolver(xmlDocHandler);\n\n // Parse the XML Document with the appropriate encoding\n Reader docReader = null;\n try {\n InputSource is;\n if(docHasContentButNoValidURL) {\n // no URL, so parse from string\n is = new InputSource(new StringReader(doc.getContent().toString()));\n } else if(doc instanceof TextualDocument) {\n // textual document - load with user specified encoding\n String docEncoding = ((TextualDocument)doc).getEncoding();\n // don't strip BOM on XML.\n docReader =\n new InputStreamReader(doc.getSourceUrl().openStream(),\n docEncoding);\n is = new InputSource(docReader);\n // must set system ID to allow relative URLs (e.g. to a DTD) to\n // work\n is.setSystemId(doc.getSourceUrl().toString());\n } else {\n // let the parser decide the encoding\n is = new InputSource(doc.getSourceUrl().toString());\n }\n newxmlParser.parse(is);\n } finally {\n // make sure the open streams are closed\n if(docReader != null) docReader.close();\n }\n\n ((DocumentImpl)doc).setNextAnnotationId(xmlDocHandler\n .getCustomObjectsId());\n } catch(SAXException e) {\n doc.getFeatures().put(\"parsingError\", Boolean.TRUE);\n\n Boolean bThrow =\n (Boolean)doc.getFeatures().get(\n GateConstants.THROWEX_FORMAT_PROPERTY_NAME);\n\n if(bThrow != null && bThrow.booleanValue()) {\n throw new DocumentFormatException(e);\n } else {\n Out.println(\"Warning: Document remains unparsed. \\n\"\n + \"\\n Stack Dump: \");\n e.printStackTrace(Out.getPrintWriter());\n }\n\n } catch(IOException e) {\n throw new DocumentFormatException(\"I/O exception for \"\n + doc.getSourceUrl(), e);\n } finally {\n if(xmlDocHandler != null)\n xmlDocHandler.removeStatusListener(statusListener);\n }\n }", "public void convert() {\r\n if (text != null && !text.isEmpty()) {\r\n // trim spaces at the edges, convert all to lowercase and\r\n // remove all non-alpha numeric characters\r\n String url = text.trim().toLowerCase().replaceAll(\"[^a-z0-9_\\\\s-]\", \"\"); \r\n // change all multiple white spaces to single white space\r\n url = url.replaceAll(\"[\\\\s-]+\", \" \");\r\n // replace all the single white spaces with a dash\r\n seoUrl = url.replaceAll(\"[\\\\s]\", \"-\");\r\n // at this point we will save the product in the database \r\n // with SEO friendly URL appended with the product ID at the end\r\n // Let's say the product ID is 12345\r\n Long productId = 12345L;\r\n seoUrl += \"-\" + productId; \r\n System.out.println(\"SEO Friendly URL --> \" + seoUrl);\r\n } else {\r\n seoUrl = \"Please enter text to convert\";\r\n }\r\n }", "private void handleTextHtml(MimePart container, String htmlPartValue) throws MessagingException {\n // container could be MimeBodyPart or MimeMessage\n\n boolean doTransform = false; //?? revisit later\n if (doTransform) {\n htmlPartValue = EmailUtil.transformToTextHtml(\n htmlPartValue,\n this.mDefaultCharset);\n }\n\n if (this.mEmbedImagesInHtml) {\n this.handleMultipartRelated(container, htmlPartValue);\n } else {\n container.setText(htmlPartValue, this.mDefaultCharset, \"html\");\n }\n return;\n }", "private void prepDocument() {\n if (body == null) {\n body = document.appendElement(\"body\");\n }\n\n body.attr(\"id\", \"readabilityBody\");\n\n Elements frames = document.getElementsByTag(\"frame\");\n if (frames.size() > 0) {\n LOG.error(\"Frames. Can't deal. Write code later to look at URLs and fetch\");\n impossible = true;\n return;\n }\n\n Elements stylesheets = document.getElementsByTag(\"style\");\n stylesheets.remove();\n stylesheets = document.select(\"link[rel='stylesheet']\");\n stylesheets.remove();\n\n /* Turn all double br's into p's */\n /*\n * Note, this is pretty costly as far as processing goes. Maybe optimize later.\n */\n handlePP();\n handleDoubleBr();\n fontsToSpans();\n }", "@Override\n public void characters(char[] ch, int start, int length)\n throws SAXException{\n super.characters(ch, start, length);\n if(length<=0)\n return;\n for(int i=start; i<start+length; i++){\n if(ch[i]=='\\n')\n return;\n }\n\n String str=new String(ch,start,length);\n switch (tagName)\n {\n case \"key\":wordValue.setWord(str); break;\n case \"ps\": if(wordValue.getPsE().length()<=0)\n wordValue.setPsE(str);\n else wordValue.setPsA(str);\n break;\n case \"pron\":if(wordValue.getPronE().length()<=0)\n wordValue.setPronE(str);\n else wordValue.setPronA(str);\n break;\n case \"pos\":isChinese=false;\n interpret+=str+\" \";\n break;\n case \"acceptation\":interpret+=str+\"\\n\";\n interpret=wordValue.getInterpret()+interpret;\n wordValue.setInterpret(interpret);\n interpret=\"\";\n break;\n case \"orig\":orig=wordValue.getSentOrig();\n wordValue.setSentOrig(orig+str+\"\\n\");\n break;\n case \"trans\":trans=wordValue.getSentTrans();\n wordValue.setSentTrans(trans+str+\"\\n\");\n break;\n case \"fy\":isChinese=true;\n wordValue.setInterpret(str);\n }\n }", "public void translate() {\n\t\twhile (!inputBuffer.endOfBuffer()) {\n\t\t\tMsgChar get = inputBuffer.getChar();\n\t\t\tif (get == null) continue;\n\t\t\tif (inputBuffer.isEndOfSentence()) {\n\t\t\t\toutputBuffer.markEndOfSentence();\n\t\t\t} else if (inputBuffer.isEndOfWord()) {\n\t\t\t\toutputBuffer.markEndOfWord();\n\t\t\t} else {\n\t\t\t\toutputBuffer.putChar(get.convert());\n\t\t\t}\n\t\t}\n\t\tinputBuffer.getReader().close();\n\t\toutputBuffer.close();\n\t}", "public ValidationEntity formatXmlService(ValidationEntity validationEntity) {\n try {\n final InputSource src = new InputSource(new StringReader(validationEntity.getInputMessage()));\n DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();\n documentBuilderFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, \"\");\n documentBuilderFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, \"\");\n final Node document = documentBuilderFactory.newDocumentBuilder().parse(src).getDocumentElement();\n final Boolean keepDeclaration = Boolean.valueOf(validationEntity.getInputMessage().startsWith(\"<?xml\"));\n final DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();\n final DOMImplementationLS impl = (DOMImplementationLS) registry.getDOMImplementation(\"LS\");\n final LSSerializer writer = impl.createLSSerializer();\n\n // Set this to true if the output needs to be beautified.\n writer.getDomConfig().setParameter(\"format-pretty-print\", Boolean.TRUE);\n // Set this to true if the declaration is needed to be outputted.\n writer.getDomConfig().setParameter(\"xml-declaration\", keepDeclaration);\n\n log.debug(\"XML Value formatted successfully: {}\", writer.writeToString(document));\n validationEntity.setValid(true);\n validationEntity.setInputMessage(writer.writeToString(document));\n validationEntity.setValidationMessage(\"Formatted XML!!!\");\n } catch (Exception e) {\n validationEntity.setValidationMessage(e.getMessage());\n log.error(EXCEPTION_IN_VALIDATION_MESSAGE, e);\n }\n return validationEntity;\n }", "default void beforeRun(TransformWork work) throws ValidationException, IOException {}", "@Override\n public void execute(TransformerImpl transformerImpl) throws TransformerException {\n if (transformerImpl.getStylesheet().isSecureProcessing()) {\n throw new TransformerException(XSLMessages.createMessage(\"ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING\", new Object[]{this.getRawName()}));\n }\n try {\n transformerImpl.getResultTreeHandler().flushPending();\n Object object = transformerImpl.getExtensionsTable().get(this.m_extns);\n if (object == null) {\n if (this.hasFallbackChildren()) {\n this.executeFallbacks(transformerImpl);\n return;\n }\n object = new TransformerException(XSLMessages.createMessage(\"ER_CALL_TO_EXT_FAILED\", new Object[]{this.getNodeName()}));\n transformerImpl.getErrorListener().fatalError((TransformerException)object);\n return;\n }\n try {\n ((ExtensionHandler)object).processElement(this.getLocalName(), this, transformerImpl, this.getStylesheet(), this);\n return;\n }\n catch (Exception exception) {\n if (this.hasFallbackChildren()) {\n this.executeFallbacks(transformerImpl);\n return;\n }\n if (exception instanceof TransformerException) {\n TransformerException transformerException = (TransformerException)exception;\n if (transformerException.getLocator() == null) {\n transformerException.setLocator(this);\n }\n transformerImpl.getErrorListener().fatalError(transformerException);\n return;\n }\n if (exception instanceof RuntimeException) {\n ErrorListener errorListener = transformerImpl.getErrorListener();\n TransformerException transformerException = new TransformerException(exception);\n errorListener.fatalError(transformerException);\n return;\n }\n ErrorListener errorListener = transformerImpl.getErrorListener();\n TransformerException transformerException = new TransformerException(exception);\n errorListener.warning(transformerException);\n return;\n }\n }\n catch (SAXException sAXException) {\n throw new TransformerException(sAXException);\n }\n catch (TransformerException transformerException) {\n transformerImpl.getErrorListener().fatalError(transformerException);\n }\n }", "@Override\n public InputSource resolveEntity (final String _publicId,\n final String _systemId)\n throws IOException, SAXException\n {\n return new InputSource(new StringReader(\"\"));\n }", "default String getNormalizedText() {\n return meta(\"nlpcraft:nlp:normtext\");\n }", "void initBeforeParsing() {\r\n }", "public void deliverRawText(String text) {\n \n }", "public static String transformPlainText(String text) {\r\n\t\t// url auto-linking\r\n\t\ttext = text.replaceAll(\"((http|https)://[0-9A-Za-z-_=\\\\?\\\\.\\\\$#&/]*)\", \"<a href=\\\"$1\\\">$1</a>\");\r\n\t\tString html = \"<pre>\" + text + \"</pre>\";\r\n\t\treturn html;\r\n\t}", "private void parseAndReplace(final BiTree biTree, final String text,\n final int length) throws ReparseException,\n NonIncrementalElementException {\n BiTree treePart;\n Node domValid;\n BiNode parent;\n final boolean invalidSibling;\n final boolean invalidPrevious;\n\n treePart = SAXBiParser.getInstance().parse(text);\n\n // parse unsuccessful\n if (treePart == null) {\n invalidSibling = this.getSibling() != null\n && this.getSibling().getType() == BiType.NODE\n && ((BiNode) this.getSibling()).invalid;\n\n invalidPrevious = this.getPrevious() != null\n && this.getPrevious().getType() == BiType.NODE\n && ((BiNode) this.getPrevious()).invalid;\n\n // if node & previous or node & sibling are invalid - reparse\n // parent\n if (invalidPrevious || invalidSibling) {\n throw new ReparseException();\n }\n\n if (!this.invalid) {\n this.makeInvalidNode((Document) biTree.getDocument());\n }\n\n this.changeLengthRec(length);\n\n } else {\n\n parent = this.getParent();\n domValid = treePart.getDOMTree((Document) biTree.getDocument());\n treePart.getRoot().addSibling(this.getSibling());\n\n // node is root\n if (parent == null) {\n\n // no emtpy text\n if (this.getPrevious() == null) {\n biTree.setRoot(treePart.getRoot());\n } else {\n // empty text on left side of root\n this.getPrevious().setSibling(treePart.getRoot());\n }\n\n // replace invalid DOM node\n biTree.getDocument().replaceChild(domValid, this.getNode());\n\n } else {\n if (this.getPrevious() == parent) {\n // invalid node is 1st child\n this.getParent().setChild(treePart.getRoot());\n } else {\n // 2nd - nth child\n this.getPrevious().setSibling(treePart.getRoot());\n }\n\n // replace invalid DOM node\n parent.getNode().replaceChild(domValid, this.getNode());\n parent.changeLengthRec(length);\n }\n\n this.invalid = false;\n }\n }", "private void processArticle(String rawArticleText, Article article, Context context) throws IOException, InterruptedException {\n if (!rawArticleText.trim().isEmpty()) {\n String[] splitSentences = rawArticleText.split(\"\\\\.\\\\s\");\n PriorityQueue<Sentence> sortedSentences = new PriorityQueue<>();\n\n for (int sentenceIndex = 0; sentenceIndex < splitSentences.length; sentenceIndex++) {\n String rawSentence = splitSentences[sentenceIndex];\n Double sentenceTfIdf = getSentenceTfIdf(rawSentence, article);\n sortedSentences.add(new Sentence(sentenceTfIdf, rawSentence, sentenceIndex));\n }\n\n String summary = topOrderedSentences(sortedSentences);\n context.write(new IntWritable(article.id), new Text(summary));\n }\n }", "public void prepareForFeaturesAndOrderCollection() throws Exception {\n\n LOG.info(\" - Preparing phrases...\");\n readPhrases(false);\n collectNumberProps(m_srcPhrs, m_trgPhrs, true, true); \n collectTypeProp(m_srcPhrs, m_trgPhrs); \n\n collectContextEqs();\n prepareSeedDictionary(m_contextSrcEqs, m_contextTrgEqs);\n prepareTranslitDictionary(m_contextSrcEqs);\n filterContextEqs();\n\n collectContextAndTimeProps(m_srcPhrs, m_trgPhrs);\n collectOrderProps(m_srcPhrs, m_trgPhrs);\n }", "private String cleanXSS(String unsafe) {\n String safe = Jsoup.clean(unsafe, Whitelist.basic());\n return safe;\n }", "protected abstract MS_LineBuilder prepareContent(MS_LineBuilder lb);", "protected String normalize(String s) \n{\n StringBuffer str = new StringBuffer();\n\n int len = (s != null) ? s.length() : 0;\n for (int i = 0; i < len; i++) \n {\n char ch = s.charAt(i);\n switch (ch) \n {\n case '<': \n {\n str.append(\"&lt;\");\n break;\n }\n case '>': \n {\n str.append(\"&gt;\");\n break;\n }\n case '&': \n {\n str.append(\"&amp;\");\n break;\n }\n case '\"': \n {\n str.append(\"&quot;\");\n break;\n }\n case '\\r':\n case '\\n': \n {\n if (canonical) \n {\n str.append(\"&#\");\n str.append(Integer.toString(ch));\n str.append(';');\n break;\n }\n // else, default append char\n }\n default: \n {\n str.append(ch);\n }\n }\n }\n\n return (str.toString());\n\n}", "@Override\n\tpublic void process(JCas aJCas) throws AnalysisEngineProcessException {\n\t\tString text = aJCas.getDocumentText();\n\n\t\t// create an empty Annotation just with the given text\n\t\tAnnotation document = new Annotation(text);\n//\t\tAnnotation document = new Annotation(\"Barack Obama was born in Hawaii. He is the president. Obama was elected in 2008.\");\n\n\t\t// run all Annotators on this text\n\t\tpipeline.annotate(document); \n\t\tList<CoreMap> sentences = document.get(SentencesAnnotation.class);\n\t\t HelperDataStructures hds = new HelperDataStructures();\n\n\t\t\n\t\t//SPnew language-specific settings:\n\t\t//SPnew subject tags of the parser\n\t\t HashSet<String> subjTag = new HashSet<String>(); \n\t\t HashSet<String> dirObjTag = new HashSet<String>(); \n\t\t //subordinate conjunction tags\n\t\t HashSet<String> compTag = new HashSet<String>(); \n\t\t //pronoun tags\n\t\t HashSet<String> pronTag = new HashSet<String>(); \n\t\t \n\t\t HashSet<String> passSubjTag = new HashSet<String>();\n\t\t HashSet<String> apposTag = new HashSet<String>(); \n\t\t HashSet<String> verbComplementTag = new HashSet<String>(); \n\t\t HashSet<String> infVerbTag = new HashSet<String>(); \n\t\t HashSet<String> relclauseTag = new HashSet<String>(); \n\t\t HashSet<String> aclauseTag = new HashSet<String>(); \n\t\t \n\t\t HashSet<String> compLemma = new HashSet<String>(); \n\t\t HashSet<String> coordLemma = new HashSet<String>(); \n\t\t HashSet<String> directQuoteIntro = new HashSet<String>(); \n\t\t HashSet<String> indirectQuoteIntroChunkValue = new HashSet<String>();\n\t\t \n//\t\t HashSet<String> finiteVerbTag = new HashSet<String>();\n\t\t \n\n\t\t //OPEN ISSUES PROBLEMS:\n\t\t //the subject - verb relation finding does not account for several specific cases: \n\t\t //opinion verbs with passive subjects as opinion holder are not accounted for,\n\t\t //what is needed is a marker in the lex files like PASSSUBJ\n\t\t //ex: Obama is worried/Merkel is concerned\n\t\t //Many of the poorer countries are concerned that the reduction in structural funds and farm subsidies may be detrimental in their attempts to fulfill the Copenhagen Criteria.\n\t\t //Some of the more well off EU states are also worried about the possible effects a sudden influx of cheap labor may have on their economies. Others are afraid that regional aid may be diverted away from those who currently benefit to the new, poorer countries that join in 2004 and beyond. \n\t\t// Does not account for infinitival constructions, here again a marker is needed to specify\n\t\t //subject versus object equi\n\t\t\t//Christian Noyer was reported to have said that it is ok.\n\t\t\t//Reuters has reported Christian Noyer to have said that it is ok.\n\t\t //Obama is likely to have said.. \n\t\t //Several opinion holder- opinion verb pairs in one sentence are not accounted for, right now the first pair is taken.\n\t\t //what is needed is to run through all dependencies. For inderect quotes the xcomp value of the embedded verb points to the \n\t\t //opinion verb. For direct quotes the offsets closest to thwe quote are relevant.\n\t\t //a specific treatment of inverted subjects is necessary then. Right now the\n\t\t //strategy relies on the fact that after the first subj/dirobj - verb pair the\n\t\t //search is interrupted. Thus, if the direct object precedes the subject, it is taken as subject.\n\t\t // this is the case in incorrectly analysed inverted subjeects as: said Zwickel on Monday\n\t\t //coordination of subject not accounted for:employers and many economists\n\t\t //several subject-opinion verbs:\n\t\t //Zwickel has called the hours discrepancy between east and west a \"fairness gap,\" but employers and many economists point out that many eastern operations have a much lower productivity than their western counterparts.\n\t\t if (language.equals(\"en\")){\n \t subjTag.add(\"nsubj\");\n \t subjTag.add(\"xsubj\");\n \t subjTag.add(\"nmod:agent\");\n \t \n \t dirObjTag.add(\"dobj\"); //for inverted subject: \" \" said IG metall boss Klaus Zwickel on Monday morning.\n \t \t\t\t\t\t\t//works only with break DEPENDENCYSEARCH, otherwise \"Monday\" is nsubj \n \t \t\t\t\t\t\t//for infinitival subject of object equi: Reuters reports Obama to have said\n \tpassSubjTag.add(\"nsubjpass\");\n \tapposTag.add(\"appos\");\n \trelclauseTag.add(\"acl:relcl\");\n \taclauseTag.add(\"acl\");\n \t compTag.add(\"mark\");\n \t pronTag.add(\"prp\");\n \thds.pronTag.add(\"prp\");\n \tcompLemma.add(\"that\");\n \tcoordLemma.add(\"and\");\n \tverbComplementTag.add(\"ccomp\");\n \tverbComplementTag.add(\"parataxis\");\n\n \tinfVerbTag.add(\"xcomp\"); //Reuters reported Merkel to have said\n \tinfVerbTag.add(\"advcl\");\n \tdirectQuoteIntro.add(\":\");\n \tindirectQuoteIntroChunkValue.add(\"SBAR\");\n \thds.objectEqui.add(\"report\");\n \thds.objectEqui.add(\"quote\");\n \thds.potentialIndirectQuoteTrigger.add(\"say\");\n// \thds.objectEqui.add(\"confirm\");\n// \thds.subjectEqui.add(\"promise\");\n// \thds.subjectEqui.add(\"quote\");\n// \thds.subjectEqui.add(\"confirm\");\n }\n\t\t \n\t\t boolean containsSubordinateConjunction = false;\n\t\t\n\t\t \n\t\tfor (CoreMap sentence : sentences) {\n//\t\t\tSystem.out.println(\"PREPROCESSING..\");\n\t\t\t\tSentenceAnnotation sentenceAnn = new SentenceAnnotation(aJCas);\n\t\t\t\t\n\t\t\t\tint beginSentence = sentence.get(TokensAnnotation.class).get(0)\n\t\t\t\t\t\t.beginPosition();\n\t\t\t\tint endSentence = sentence.get(TokensAnnotation.class)\n\t\t\t\t\t\t.get(sentence.get(TokensAnnotation.class).size() - 1)\n\t\t\t\t\t\t.endPosition();\n\t\t\t\tsentenceAnn.setBegin(beginSentence);\n\t\t\t\tsentenceAnn.setEnd(endSentence);\n\t\t\t\tsentenceAnn.addToIndexes();\n\t\t\t\t\n\t\t\t\t//SP Map offsets to NER\n\t\t\t\tList<NamedEntity> ners = JCasUtil.selectCovered(aJCas, //SPnew tut\n\t\t\t\t\t\tNamedEntity.class, sentenceAnn);\n\t\t\t\tfor (NamedEntity ne : ners){\n//\t\t\t\t\tSystem.out.println(\"NER TYPE: \" + ne.jcasType.toString());\n//\t\t\t\t\tSystem.out.println(\"NER TYPE: \" + ne.getCoveredText().toString());\n//\t\t\t\t\tSystem.out.println(\"NER TYPE: \" + ne.jcasType.casTypeCode);\n\t\t\t\t\t//Person is 71, Location is 213, Organization is 68 geht anders besser siehe unten\n\t\t\t\t\tint nerStart = ne\n\t\t\t\t\t\t\t.getBegin();\n\t\t\t\t\tint nerEnd = ne.getEnd();\n//\t\t\t\t\tSystem.out.println(\"NER: \" + ne.getCoveredText() + \" \" + nerStart + \"-\" + nerEnd ); \n\t\t\t\t\tString offsetNer = \"\" + nerStart + \"-\" + nerEnd;\n\t\t\t\t\thds.offsetToNer.put(offsetNer, ne.getCoveredText());\n//\t\t\t\t\tNer.add(offsetNer);\n\t\t\t\t\thds.Ner.add(offsetNer);\n//\t\t\t\t\tSystem.out.println(\"NER: TYPE \" +ne.getValue().toString());\n\t\t\t\t\tif (ne.getValue().equals(\"PERSON\")){\n\t\t\t\t\t\thds.NerPerson.add(offsetNer);\n\t\t\t\t\t}\n\t\t\t\t\telse if (ne.getValue().equals(\"ORGANIZATION\")){\n\t\t\t\t\t\thds.NerOrganization.add(offsetNer);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//DBpediaLink info: map offsets to links\n\t\t\t\tList<DBpediaResource> dbpeds = JCasUtil.selectCovered(aJCas, //SPnew tut\n\t\t\t\t\t\tDBpediaResource.class, sentenceAnn);\n\t\t\t\tfor (DBpediaResource dbped : dbpeds){\n//\t\t\t\t\t\n//\t\t\t\t\tint dbStart = dbped\n//\t\t\t\t\t\t\t.getBegin();\n//\t\t\t\t\tint dbEnd = dbped.getEnd();\n\t\t\t\t\t// not found if dbpedia offsets are wrongly outside than sentences\n//\t\t\t\t\tSystem.out.println(\"DBPED SENT: \" + sentenceAnn.getBegin()+ \"-\" + sentenceAnn.getEnd() ); \n//\t\t\t\t\tString offsetDB = \"\" + dbStart + \"-\" + dbEnd;\n//\t\t\t\t\thds.labelToDBpediaLink.put(dbped.getLabel(), dbped.getUri());\n//\t\t\t\t\tSystem.out.println(\"NOW DBPED: \" + dbped.getLabel() + \"URI: \" + dbped.getUri() ); \n\t\t\t\t\thds.dbpediaSurfaceFormToDBpediaLink.put(dbped.getCoveredText(), dbped.getUri());\n//\t\t\t\t\tSystem.out.println(\"NOW DBPED: \" + dbped.getCoveredText() + \"URI: \" + dbped.getUri() ); \n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//SP Map offsets to lemma of opinion verb/noun; parser does not provide lemma\n\t\t\t\t for (CoreLabel token: sentence.get(TokensAnnotation.class)) {\n//\t\t\t\t\t System.out.println(\"LEMMA \" + token.lemma().toString());\n\t\t\t\t\t int beginTok = token.beginPosition();\n\t\t\t\t\t int endTok = token.endPosition();\n\t\t\t\t\t String offsets = \"\" + beginTok + \"-\" + endTok;\n\t\t\t\t\t hds.offsetToLemma.put(offsets, token.lemma().toString());\n\t\t\t\t\t \n\t\t\t\t\t \t if (opinion_verbs.contains(token.lemma().toString())){\n\t\t\t\t\t\t\t hds.offsetToLemmaOfOpinionVerb.put(offsets, token.lemma().toString());\n\t\t\t\t\t\t\t hds.OpinionExpression.add(offsets);\n\t\t\t\t\t\t\t hds.offsetToLemmaOfOpinionExpression.put(offsets, token.lemma().toString());\n\t\t\t\t\t\t\t \n//\t\t\t \t System.out.println(\"offsetToLemmaOfOpinionVerb \" + token.lemma().toString());\n\t\t\t\t\t \t }\n\t\t\t\t\t \t if (passive_opinion_verbs.contains(token.lemma().toString())){\n\t\t\t\t\t\t\t hds.offsetToLemmaOfPassiveOpinionVerb.put(offsets, token.lemma().toString());\n\t\t\t\t\t\t\t hds.OpinionExpression.add(offsets);\n\t\t\t\t\t\t\t hds.offsetToLemmaOfOpinionExpression.put(offsets, token.lemma().toString());\n//\t\t\t \t System.out.println(\"offsetToLemmaOfPassiveOpinionVerb \" + token.lemma().toString());\n\t\t\t\t\t \t }\n\n\t\t\t\t } \n\n\t\t\t//SPnew parser\n\t\t\tTree tree = sentence.get(TreeAnnotation.class);\n\t\t\tTreebankLanguagePack tlp = new PennTreebankLanguagePack();\n\t\t\tGrammaticalStructureFactory gsf = tlp.grammaticalStructureFactory();\n\t\t\tGrammaticalStructure gs = gsf.newGrammaticalStructure(tree);\n\t\t\tCollection<TypedDependency> td = gs.typedDependenciesCollapsed();\n\n\t\t\t \n//\t\t\tSystem.out.println(\"TYPEDdep\" + td);\n\t\t\t\n\t\t\tObject[] list = td.toArray();\n//\t\t\tSystem.out.println(list.length);\n\t\t\tTypedDependency typedDependency;\nDEPENDENCYSEARCH: for (Object object : list) {\n\t\t\ttypedDependency = (TypedDependency) object;\n//\t\t\tSystem.out.println(\"DEP \" + typedDependency.dep().toString()+ \n//\t\t\t\t\t\" GOV \" + typedDependency.gov().toString()+ \n//\t\t\t\" :: \"+ \" RELN \"+typedDependency.reln().toString());\n\t\t\tString pos = null;\n String[] elements;\n String verbCand = null;\n int beginVerbCand = -5;\n\t\t\tint endVerbCand = -5;\n\t\t\tString offsetVerbCand = null;\n\n if (compTag.contains(typedDependency.reln().toString())) {\n \tcontainsSubordinateConjunction = true;\n// \tSystem.out.println(\"subordConj \" + typedDependency.dep().toString().toLowerCase());\n }\n \n else if (subjTag.contains(typedDependency.reln().toString())){\n \thds.predicateToSubjectChainHead.clear();\n \thds.subjectToPredicateChainHead.clear();\n \t\n \tverbCand = typedDependency.gov().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.gov().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.gov().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n//\t\t\t\tSystem.out.println(\"VERBCand \" + verbCand + offsetVerbCand);\n//\t\t\t\tfor (HashMap.Entry<String, String> entry : hds.offsetToLemma.entrySet()) {\n//\t\t\t\t String key = entry.getKey();\n//\t\t\t\t Object value = entry.getValue();\n//\t\t\t\t System.out.println(\"OFFSET \" + key + \" LEMMA \" + value);\n//\t\t\t\t // FOR LOOP\n//\t\t\t\t}\n//\t\t\t\tif (hds.offsetToLemma.containsKey(offsetVerbCand)){\n//\t\t\t\t\tString verbCandLemma = hds.offsetToLemma.get(offsetVerbCand);\n//\t\t\t\t\tif (hds.objectEqui.contains(verbCandLemma) || hds.subjectEqui.contains(verbCandLemma)){\n//\t\t\t\t\t\tSystem.out.println(\"SUBJCHAIN BEGIN verbCand \" + verbCand);\n//\t\t\t\t\t\tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t\tSystem.out.println(\"SUBJCHAINHEAD1\");\n\t\t\t\tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n//\t\t\t\tSystem.out.println(\"verbCand \" + verbCand);\n\t\t\t\t//hack for subj after obj said Zwickel (obj) on Monday morning (subj)\n\t\t\t\tif (language.equals(\"en\") \n\t\t\t\t\t\t&& hds.predicateToObject.containsKey(offsetVerbCand)\n\t\t\t\t\t\t){\n// \t\tSystem.out.println(\"CONTINUE DEP\");\n \t\tcontinue DEPENDENCYSEARCH;\n \t}\n\t\t\t\telse {\n\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n\t\t\t\t}\n }\n //Merkel is concerned\n else if (passSubjTag.contains(typedDependency.reln().toString())){\n \t//Merkel was reported\n \t//Merkel was concerned\n \t//Merkel was quoted\n \thds.predicateToSubjectChainHead.clear();\n \thds.subjectToPredicateChainHead.clear();\n \tverbCand = typedDependency.gov().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.gov().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.gov().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n//\t\t\t\tSystem.out.println(\"VERBCand \" + verbCand + offsetVerbCand);\n//\t\t\t\tif (hds.offsetToLemma.containsKey(offsetVerbCand)){\n//\t\t\t\t\tString verbCandLemma = hds.offsetToLemma.get(offsetVerbCand);\n////\t\t\t\t\tSystem.out.println(\"LEMMA verbCand \" + verbCandLemma);\n//\t\t\t\t\tif (hds.objectEqui.contains(verbCandLemma) || hds.subjectEqui.contains(verbCandLemma)){\n//\t\t\t\t\t\tSystem.out.println(\"SUBJCHAIN BEGIN verbCand \" + verbCand);\n//\t\t\t\t\t\tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n//\t\t\t\t\t}\n//\t\t\t\t}\n \t\n \tstoreRelations(typedDependency, hds.predicateToSubjectChainHead, hds.subjectToPredicateChainHead, hds);\n// \tSystem.out.println(\"SUBJCHAINHEAD2\");\n \t//Merkel is concerned\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfPassiveOpinionVerb,\n \t\t\thds);\n }\n //Meanwhile, the ECB's vice-president, Christian Noyer, was reported at the start of the week to have said that the bank's future interest-rate moves\n// would depend on the behavior of wage negotiators as well as the pace of the economic recovery.\n\n else if (apposTag.contains(typedDependency.reln().toString())){\n \t\n \tString subjCand = typedDependency.gov().toString().toLowerCase();\n \tint beginSubjCand = typedDependency.gov().beginPosition();\n \tint endSubjCand = typedDependency.gov().endPosition();\n \tString offsetSubjCand = \"\" + beginSubjCand + \"-\" + endSubjCand;\n \tString appo = typedDependency.dep().toString().toLowerCase();\n\t\t\t\tint beginAppo = typedDependency.dep().beginPosition();\n\t\t\t\tint endAppo = typedDependency.dep().endPosition();\n\t\t\t\tString offsetAppo = \"\" + beginAppo + \"-\" + endAppo;\n\t\t\t\t\n// \tSystem.out.println(\"APPOSITION1 \" + subjCand + \"::\"+ appo + \":\" + offsetSubjCand + \" \" + offsetAppo);\n \thds.subjectToApposition.put(offsetSubjCand, offsetAppo);\n }\n else if (relclauseTag.contains(typedDependency.reln().toString())){\n \tString subjCand = typedDependency.gov().toString().toLowerCase();\n \tint beginSubjCand = typedDependency.gov().beginPosition();\n \tint endSubjCand = typedDependency.gov().endPosition();\n \tString offsetSubjCand = \"\" + beginSubjCand + \"-\" + endSubjCand;\n \tverbCand = typedDependency.dep().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.dep().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.dep().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n\t\t\t\tString subjCandPos = null;\n\t\t\t\tif (hds.predicateToSubject.containsKey(offsetVerbCand)){\n\t\t\t\t\t\n\t\t\t\t\tif (subjCand.matches(\".+?/.+?\")) { \n\t\t\t\t\t\telements = subjCand.split(\"/\");\n\t\t\t\t\t\tsubjCand = elements[0];\n\t\t\t\t\t\tsubjCandPos = elements[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tString del = hds.predicateToSubject.get(offsetVerbCand);\n\t\t\t\t\thds.predicateToSubject.remove(offsetVerbCand);\n\t\t\t\t\thds.subjectToPredicate.remove(del);\n\t\t\t\t\thds.normalPredicateToSubject.remove(offsetVerbCand);\n\t\t\t\t\thds.subjectToNormalPredicate.remove(del);\n//\t\t\t\t\tSystem.out.println(\"REMOVE RELPRO \" + verbCand + \"/\" + hds.offsetToLemma.get(del));\n\t\t\t\t\thds.predicateToSubject.put(offsetVerbCand, offsetSubjCand);\n\t\t\t\t\thds.subjectToPredicate.put( offsetSubjCand, offsetVerbCand);\n\t\t\t\t\thds.normalPredicateToSubject.put(offsetVerbCand, offsetSubjCand);\n\t\t\t\t\thds.subjectToNormalPredicate.put( offsetSubjCand, offsetVerbCand);\n//\t\t\t\t\tSystem.out.println(\"RELCLAUSE \" + subjCand + \"::\" + \":\" + verbCand);\n\t\t\t\t\thds.offsetToSubjectHead.put(offsetSubjCand,subjCand);\n\t\t\t\t\thds.SubjectHead.add(offsetSubjCand);\n\t\t\t\t\t\n\t\t\t\t\tif (subjCandPos != null && hds.pronTag.contains(subjCandPos)){\n\t\t\t\t\t\thds.PronominalSubject.add(offsetSubjCand);\n\t\t\t\t\t}\n\t\t\t\t}\n \t\n \t\n }\n \n else if (dirObjTag.contains(typedDependency.reln().toString())\n \t\t){\n \tstoreRelations(typedDependency, hds.predicateToObject, hds.ObjectToPredicate, hds);\n \tverbCand = typedDependency.gov().toString().toLowerCase();\n\t\t\t\tbeginVerbCand = typedDependency.gov().beginPosition();\n\t\t\t\tendVerbCand = typedDependency.gov().endPosition();\n\t\t\t\toffsetVerbCand = \"\" + beginVerbCand + \"-\" + endVerbCand;\n\t\t\t\t\n\t\t\t\tString objCand = typedDependency.dep().toString().toLowerCase();\n \tint beginObjCand = typedDependency.dep().beginPosition();\n \tint endObjCand = typedDependency.dep().endPosition();\n \tString offsetObjCand = \"\" + beginObjCand + \"-\" + endObjCand;\n \tString objCandPos;\n \tif (objCand.matches(\".+?/.+?\")) { \n\t\t\t\t\telements = objCand.split(\"/\");\n\t\t\t\t\tobjCand = elements[0];\n\t\t\t\t\tobjCandPos = elements[1];\n//\t\t\t\t\tSystem.out.println(\"PRON OBJ \" + objCandPos);\n\t\t\t\t\tif (pronTag.contains(objCandPos)){\n\t\t\t\t\thds.PronominalSubject.add(offsetObjCand);\n\t\t\t\t\t}\n\t\t\t\t\t}\n// \tSystem.out.println(\"DIROBJ STORE ONLY\");\n \t//told Obama\n \t//said IG metall boss Klaus Zwickel\n \t// problem: pointing DO\n \t//explains David Gems, pointing out the genetically manipulated species.\n \t if (language.equals(\"en\") \n \t\t\t\t\t\t&& !hds.normalPredicateToSubject.containsKey(offsetVerbCand)\n \t\t\t\t\t\t){\n// \t\t System.out.println(\"INVERSE SUBJ HACK ENGLISH PREDTOOBJ\");\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n \t }\n }\n //was reported to have said\n else if (infVerbTag.contains(typedDependency.reln().toString())){\n \tstoreRelations(typedDependency, hds.mainToInfinitiveVerb, hds.infinitiveToMainVerb, hds);\n// \tSystem.out.println(\"MAIN-INF\");\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n \t\n }\n else if (aclauseTag.contains(typedDependency.reln().toString())){\n \tstoreRelations(typedDependency, hds.nounToInfinitiveVerb, hds.infinitiveVerbToNoun, hds);\n// \tSystem.out.println(\"NOUN-INF\");\n \tdetermineSubjectToVerbRelations(typedDependency, \n \t\t\thds.offsetToLemmaOfOpinionVerb,\n \t\t\thds);\n \t\n }\n \n \n\n\t\t\t}\n\t\t\t\n//\t\t\tSemanticGraph dependencies = sentence.get(CollapsedCCProcessedDependenciesAnnotation.class);\n//\t\t\tSystem.out.println(\"SEM-DEP \" + dependencies);\t\n\t\t}\n\t\t\n\n\t\tMap<Integer, edu.stanford.nlp.dcoref.CorefChain> corefChains = document.get(CorefChainAnnotation.class);\n\t\t \n\t\t if (corefChains == null) { return; }\n\t\t //SPCOPY\n\t\t for (Entry<Integer, edu.stanford.nlp.dcoref.CorefChain> entry: corefChains.entrySet()) {\n//\t\t System.out.println(\"Chain \" + entry.getKey() + \" \");\n\t\t \tint chain = entry.getKey();\n\t\t String repMenNer = null;\n\t\t String repMen = null;\n\t\t String offsetRepMenNer = null;\n\n\t\t List<IaiCorefAnnotation> listCorefAnnotation = new ArrayList<IaiCorefAnnotation>();\n\t\t \n\t\t for (CorefMention m : entry.getValue().getMentionsInTextualOrder()) {\n\t\t \tboolean corefMentionContainsNer = false;\n\t\t \tboolean repMenContainsNer = false;\n\n//\t\t \n\n\t\t\t\t// We need to subtract one since the indices count from 1 but the Lists start from 0\n\t\t \tList<CoreLabel> tokens = sentences.get(m.sentNum - 1).get(TokensAnnotation.class);\n\t\t // We subtract two for end: one for 0-based indexing, and one because we want last token of mention not one following.\n//\t\t System.out.println(\" \" + m + \", i.e., 0-based character offsets [\" + tokens.get(m.startIndex - 1).beginPosition() +\n//\t\t \", \" + tokens.get(m.endIndex - 2).endPosition() + \")\");\n\t\t \n\t\t int beginCoref = tokens.get(m.startIndex - 1).beginPosition();\n\t\t\t\t int endCoref = tokens.get(m.endIndex - 2).endPosition();\n\t\t\t\t String offsetCorefMention = \"\" + beginCoref + \"-\" + endCoref;\n\t\t\t\t String corefMention = m.mentionSpan;\n\n\t\t\t\t CorefMention RepresentativeMention = entry.getValue().getRepresentativeMention();\n\t\t\t\t repMen = RepresentativeMention.mentionSpan;\n\t\t\t\t List<CoreLabel> repMenTokens = sentences.get(RepresentativeMention.sentNum - 1).get(TokensAnnotation.class);\n//\t\t\t\t System.out.println(\"REPMEN ANNO \" + \"\\\"\" + repMen + \"\\\"\" + \" is representative mention\" +\n// \", i.e., 0-based character offsets [\" + repMenTokens.get(RepresentativeMention.startIndex - 1).beginPosition() +\n//\t\t \", \" + repMenTokens.get(RepresentativeMention.endIndex - 2).endPosition() + \")\");\n\t\t\t\t int beginRepMen = repMenTokens.get(RepresentativeMention.startIndex - 1).beginPosition();\n\t\t\t\t int endRepMen = repMenTokens.get(RepresentativeMention.endIndex - 2).endPosition();\n\t\t\t\t String offsetRepMen = \"\" + beginRepMen + \"-\" + endRepMen;\n\t\t \t \n\t\t\t\t//Determine repMenNer that consists of largest NER (Merkel) to (Angela Merkel)\n\t\t\t\t //and \"Chancellor \"Angela Merkel\" to \"Angela Merkel\"\n\t\t \t //Further reduction to NER as in \"Chancellor Angela Merkel\" to \"Angela Merkel\" is\n\t\t\t\t //done in determineBestSubject. There, Chunk information and subjectHead info is available.\n\t\t\t\t //Chunk info and subjectHead info is used to distinguish \"Chancellor Angela Merkel\" to \"Angela Merkel\"\n\t\t\t\t //from \"The enemies of Angela Merkel\" which is not reduced to \"Angela Merkel\"\n\t\t\t\t //Problem solved: The corefMentions of a particular chain do not necessarily have the same RepMenNer (RepMen) \n\t\t\t\t // any more: Chancellor Angela Merkel repMenNer Chancellor Angela Merkel , then Angela Merkel has RepMenNer Angela Merkel\n\t\t\t\t if (offsetRepMenNer != null && hds.Ner.contains(offsetRepMenNer)){\n//\t\t\t\t\t System.out.println(\"NEWNer.contains(offsetRepMenNer)\");\n\t\t\t\t }\n\t\t\t\t else if (offsetRepMen != null && hds.Ner.contains(offsetRepMen)){\n\t\t\t\t\t repMenNer = repMen;\n\t\t\t\t\t\toffsetRepMenNer = offsetRepMen;\n//\t\t\t\t\t\tSystem.out.println(\"NEWNer.contains(offsetRepMen)\");\n\t\t\t\t }\n\t\t\t\t else if (offsetCorefMention != null && hds.Ner.contains(offsetCorefMention)){\n\t\t\t\t\t\trepMenNer = corefMention;\n\t\t\t\t\t\toffsetRepMenNer = offsetCorefMention;\n//\t\t\t\t\t\tSystem.out.println(\"Ner.contains(offsetCorefMention)\");\n\t\t\t\t\t}\n\t\t\t\t else {\n\t\t\t\t\t corefMentionContainsNer = offsetsContainAnnotation(offsetCorefMention,hds.Ner);\n\t\t\t\t\t repMenContainsNer = offsetsContainAnnotation(offsetRepMen,hds.Ner);\n//\t\t\t\t\t System.out.println(\"ELSE Ner.contains(offsetCorefMention)\");\n\t\t\t\t }\n\t\t\t\t //Determine repMenNer that contains NER\n\t\t\t\t\tif (repMenNer == null){\n\t\t\t\t\t\tif (corefMentionContainsNer){\n\t\t\t\t\t\t\trepMenNer = corefMention;\n\t\t\t\t\t\t\toffsetRepMenNer = offsetCorefMention;\n//\t\t\t\t\t\t\tSystem.out.println(\"DEFAULT1\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (repMenContainsNer){\n\t\t\t\t\t\t\trepMenNer = repMen;\n\t\t\t\t\t\t\toffsetRepMenNer = offsetRepMen;\n//\t\t\t\t\t\t\tSystem.out.println(\"DEFAULT2\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//no NER:\n\t\t\t\t\t\t//Pronoun -> repMen is repMenNer\n\t\t\t\t\t\telse if (hds.PronominalSubject.contains(offsetCorefMention) && repMen != null){\n\t\t\t\t\t\t\trepMenNer = repMen;\n\t\t\t\t\t\t\toffsetRepMenNer = offsetRepMen;\n//\t\t\t\t\t\t\tSystem.out.println(\"DEFAULT3\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t//other no NER: corefMention is repMenNer because it is closer to original\n\t\t\t\t\t\trepMenNer = corefMention;\n\t\t\t\t\t\toffsetRepMenNer = offsetCorefMention;\n//\t\t\t\t\t\tSystem.out.println(\"DEFAULT4\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t \n \t IaiCorefAnnotation corefAnnotation = new IaiCorefAnnotation(aJCas);\n\t\t\t\n\t\t\t\t\t\n\n\n\t\t\t\t\tcorefAnnotation.setBegin(beginCoref);\n\t\t\t\t\tcorefAnnotation.setEnd(endCoref);\n\t\t\t\t\tcorefAnnotation.setCorefMention(corefMention);\n\t\t\t\t\tcorefAnnotation.setCorefChain(chain);\n\t\t\t\t\t//done below\n//\t\t\t\t\tcorefAnnotation.setRepresentativeMention(repMenNer);\n//\t\t\t\t\tcorefAnnotation.addToIndexes(); \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tlistCorefAnnotation.add(corefAnnotation);\n\t\t\t\t\t\n//\t\t\t\t\tdone below:\n//\t\t\t\t\t offsetToRepMen.put(offsetCorefMention, repMenNer);\n//\t\t\t\t\t RepMen.add(offsetCorefMention);\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t }//end coref mention\n//\t\t System.out.println(\"END Chain \" + chain );\n//\t\t System.out.println(listCorefAnnotation.size());\n\t\t String offsetCorefMention = null;\n\t\t for (int i = 0; i < listCorefAnnotation.size(); i++) {\n\t\t \tIaiCorefAnnotation corefAnnotation = listCorefAnnotation.get(i);\n\t\t \tcorefAnnotation.setRepresentativeMention(repMenNer);\n\t\t \tcorefAnnotation.addToIndexes();\n\t\t \toffsetCorefMention = \"\" + corefAnnotation.getBegin() + \"-\" + corefAnnotation.getEnd();\n\t\t\t\t\thds.offsetToRepMen.put(offsetCorefMention, repMenNer);\n\t\t\t\t\thds.RepMen.add(offsetCorefMention);\n\t\t\t\t\t//COREF\n//\t\t\t\t\tSystem.out.println(\"Chain \" + corefAnnotation.getCorefChain());\n//\t\t\t\t\tSystem.out.println(\"corefMention \" + corefAnnotation.getCorefMention() + offsetCorefMention);\n//\t\t\t\t\tSystem.out.println(\"repMenNer \" + repMenNer);\n\t\t }\n\t\t } //end chains\n\n\n//\t\t System.out.println(\"NOW quote finder\");\n\n\n\t\t\n\t\t///* quote finder: begin find quote relation and quotee\n\t\t// direct quotes\n\t\t\n\t\t\n\t\tString quotee_left = null;\n\t\tString quotee_right = null; \n\t\t\n\t\tString representative_quotee_left = null;\n\t\tString representative_quotee_right = null; \n\t\t\n\t\tString quote_relation_left = null;\n\t\tString quote_relation_right = null;\n\t\t\n\t\tString quoteType = null;\n\t\tint quoteeReliability = 5;\n\t\tint quoteeReliability_left = 5;\n\t\tint quoteeReliability_right = 5;\n\t\tint quotee_end = -5;\n\t\tint quotee_begin = -5;\n\t\t\n\t\tboolean quoteeBeforeQuote = false;\n\n\n\t\n\t\t\n\t\t// these are all the quotes in this document\n\t\tList<CoreMap> quotes = document.get(QuotationsAnnotation.class);\n\t\tfor (CoreMap quote : quotes) {\n\t\t\tif (quote.get(TokensAnnotation.class).size() > 5) {\n\t\t\t\tQuoteAnnotation annotation = new QuoteAnnotation(aJCas);\n\n\t\t\t\tint beginQuote = quote.get(TokensAnnotation.class).get(0)\n\t\t\t\t\t\t.beginPosition();\n\t\t\t\tint endQuote = quote.get(TokensAnnotation.class)\n\t\t\t\t\t\t.get(quote.get(TokensAnnotation.class).size() - 1)\n\t\t\t\t\t\t.endPosition();\n\t\t\t\tannotation.setBegin(beginQuote);\n\t\t\t\tannotation.setEnd(endQuote);\n\t\t\t\tannotation.addToIndexes();\n//\t\t\t}\n//\t\t}\n//\t\t\n//\t\tList<Q> newQuotes = document.get(QuotationsAnnotation.class);\t\t\n//\t\tfor (CoreMap annotation : newQuotes) {\n//\t\t\t\tif (1==1){\n//\t\t\t\tRe-initialize markup variables since they are also used for indirect quotes\n\t\t\t\tquotee_left = null;\n\t\t\t\tquotee_right = null; \n\t\t\t\t\n\t\t\t\trepresentative_quotee_left = null;\n\t\t\t\trepresentative_quotee_right = null;\n\t\t\t\t\n\t\t\t\tquote_relation_left = null;\n\t\t\t\tquote_relation_right = null;\n\t\t\t\tquoteeReliability = 5;\n\t\t\t\tquoteeReliability_left = 5;\n\t\t\t\tquoteeReliability_right = 5;\n\t\t\t\tquotee_end = -5;\n\t\t\t\tquotee_begin = -5;\n\t\t\t\tquoteType = \"direct\";\n\t\t\t\tquoteeBeforeQuote = false;\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tList<Token> directQuoteTokens = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\tToken.class, annotation);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tList<Token> followTokens = JCasUtil.selectFollowing(aJCas,\n\t\t\t\t\t\tToken.class, annotation, 1);\n\t\t\t\t\n \n//\t\t\t\tfor (Token aFollowToken: followTokens){\n//\t\t\t\t\t List<Chunk> chunks = JCasUtil.selectCovering(aJCas,\n//\t\t\t\t\tChunk.class, aFollowToken);\n \n//direct quote quotee right:\n\t\t\t\t\n\t for (Token aFollow2Token: followTokens){\n\t\t\t\t\t List<SentenceAnnotation> sentencesFollowQuote = JCasUtil.selectCovering(aJCas,\n\t\t\t\t\t\t\t SentenceAnnotation.class, aFollow2Token);\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t for (SentenceAnnotation sentenceFollowsQuote: sentencesFollowQuote){\n\t\t\t\t\t\t List<Chunk> chunks = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\tChunk.class, sentenceFollowsQuote);\n//\t\t\tSystem.out.println(\"DIRECT QUOTE RIGHT\");\n\t\t\tString[] quote_annotation_result = determine_quotee_and_quote_relation(\"RIGHT\", \n\t\t\t\t\tchunks, hds, annotation);\n\t\t\tif (quote_annotation_result.length>=4){\n\t\t\t quotee_right = quote_annotation_result[0];\n\t\t\t representative_quotee_right = quote_annotation_result[1];\n\t\t\t quote_relation_right = quote_annotation_result[2];\n\t\t\t try {\n\t\t\t\t quoteeReliability = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t quoteeReliability_right = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t //Will Throw exception!\n\t\t\t //do something! anything to handle the exception.\n\t\t\t\tquoteeReliability = -5;\n\t\t\t\tquoteeReliability_right = -5;\n\t\t\t\t}\t\t\t\t\t \n\t\t\t }\n//\t\t\tSystem.out.println(\"DIRECT QUOTE RIGHT RESULT quotee \" + quotee_right + \" representative_quotee \" + representative_quotee_right\n//\t\t\t\t\t+ \" quote_relation \" + quote_relation_right);\n\t\t \n\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\t \n }\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tList<Token> precedingTokens = JCasUtil.selectPreceding(aJCas,\n\t\t\t\t\t\tToken.class, annotation, 1);\n for (Token aPrecedingToken: precedingTokens){ \n \t\n \tif (directQuoteIntro.contains(aPrecedingToken.getLemma().getValue().toString()) \n \t\t\t|| compLemma.contains(aPrecedingToken.getLemma().getValue().toString())) {\n// \t\tSystem.out.println(\"Hello, World lemma found\" + aPrecedingToken.getLemma().getValue());\n \t\tquoteeBeforeQuote = true;\n \t}\n \t\tList <NamedEntity> namedEntities = null;\n \t\tList <Token> tokens = null;\n \t\tList<Chunk> chunks = null;\n \t\t\n\t\t\t\t List<Sentence> precedingSentences = JCasUtil.selectPreceding(aJCas,\n\t\t\t\t \t\tSentence.class, aPrecedingToken, 1);\n\t\t\t\t \n\t\t\t\t\t\tif (precedingSentences.isEmpty()){\n\t\t\t\t\t\t\tList<Sentence> firstSentence;\n\t\t\t\t \tfirstSentence = JCasUtil.selectCovering(aJCas,\n\t\t\t\t \t\tSentence.class, aPrecedingToken);\n\n\t\t\t\t \tfor (Sentence aSentence: firstSentence){\n\t\t\t\t \t\t\n\n\t\t\t\t\t\t\t\tchunks = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\t\tChunk.class, aSentence.getBegin(), aPrecedingToken.getEnd());\n\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t \t\tnamedEntities = JCasUtil.selectCovered(aJCas,\n\t \t \t\tNamedEntity.class, aSentence.getBegin(), aPrecedingToken.getEnd());\n\t\t\t\t \t\ttokens = JCasUtil.selectCovered(aJCas,\n\t\t\t\t \t\t\t\tToken.class, aSentence.getBegin(), aPrecedingToken.getEnd());\n\t\t\t\t \t\n\t\t\t\t \t}\n\t\t\t\t\t\t}\n\t\t\t\t else {\t\n\t\t\t\t \tfor (Sentence aSentence: precedingSentences){\n//\t\t\t\t \t\tSystem.out.println(\"Hello, World sentence\" + aSentence);\n\t\t\t\t \t\tchunks = JCasUtil.selectBetween(aJCas,\n\t\t\t\t \t\t\t\tChunk.class, aSentence, aPrecedingToken);\n\t\t\t\t \t\tnamedEntities = JCasUtil.selectBetween(aJCas,\n\t\t\t\t \t\t\t\tNamedEntity.class, aSentence, aPrecedingToken);\n\t\t\t\t \t\ttokens = JCasUtil.selectBetween(aJCas,\n\t\t\t\t \t\t\t\tToken.class, aSentence, aPrecedingToken);\n\t\t\t\t \t}\n\t\t\t\t }\n \t\n//\t\t\t\t \n//\t\t\t\t\t\tSystem.out.println(\"DIRECT QUOTE LEFT\");\n\t\t\t\t\t\tString[] quote_annotation_direct_left = determine_quotee_and_quote_relation(\"LEFT\", chunks,\n\t\t\t\t\t\t\t\t hds, annotation\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t );\n//\t\t\t\t\t\tSystem.out.println(\"QUOTE ANNOTATION \" + quote_annotation_direct_left.length);\t\t\n\t\tif (quote_annotation_direct_left.length>=4){\n//\t\t\tSystem.out.println(\"QUOTE ANNOTATION UPDATE \" + quote_annotation_direct_left[0] +\n//\t\t\t\t\t\" \" + quote_annotation_direct_left[1] + \" \" +\n//\t\t\t\t\tquote_annotation_direct_left[2]);\n\t\t quotee_left = quote_annotation_direct_left[0];\n\t\t representative_quotee_left = quote_annotation_direct_left[1];\n\t\t quote_relation_left = quote_annotation_direct_left[2];\n\t\t try {\n\t\t\t quoteeReliability = Integer.parseInt(quote_annotation_direct_left[3]);\n\t\t\t quoteeReliability_left = Integer.parseInt(quote_annotation_direct_left[3]);\n\t\t\t} catch (NumberFormatException e) {\n\t\t //Will Throw exception!\n\t\t //do something! anything to handle the exception.\n\t\t\tquoteeReliability = -5;\n\t\t\tquoteeReliability_left = -5;\n\t\t\t}\t\t\t\t\t \n\t\t }\n//\t\tSystem.out.println(\"DIRECT QUOTE LEFT RESULT quotee \" + quotee_left + \" representative_quotee \" + representative_quotee_left\n//\t\t\t\t+ \" quote_relation \" + quote_relation_left);\n\t\t//no subject - predicate quotee quote_relation, quote introduced with colon: \n\t\tif (quotee_left == null && quote_relation_left == null && representative_quotee_left == null \n\t\t&& directQuoteIntro.contains(aPrecedingToken.getLemma().getValue().toString())){\n//\t\t\tSystem.out.println(\"NER DIRECT QUOTE LEFT COLON\");\n\t\t\tString quoteeCandOffset = null; \n\t\t\tString quoteeCandText = null;\n\t\t if (namedEntities.size() == 1){\n \t \tfor (NamedEntity ne : namedEntities){\n// \t \t\tSystem.out.println(\"ONE NER \" + ne.getCoveredText());\n \t \t\tquoteeCandText = ne.getCoveredText();\n\t\t\t\t\tquote_relation_left = aPrecedingToken.getLemma().getValue().toString();\n\t\t\t\t\tquotee_end = ne.getEnd();\n\t\t\t\t\tquotee_begin = ne.getBegin();\n\t\t\t\t\tquoteeCandOffset = \"\" + quotee_begin + \"-\" + quotee_end;\n\t\t\t\t\tquoteeReliability = 1;\n\t\t\t\t\tquoteeReliability_left = 1;\n \t }\n \t }\n \t else if (namedEntities.size() > 1) {\n \t \tint count = 0;\n \t \tString quotee_cand = null;\n// \t \tSystem.out.println(\"Hello, World ELSE SEVERAL NER\");\n \t \tfor (NamedEntity ner : namedEntities){\n// \t \t\tSystem.out.println(\"Hello, World NER TYPE\" + ner.getValue());\n \t \t\tif (ner.getValue().equals(\"PERSON\")){\n \t \t\t\tcount = count + 1;\n \t \t\t\tquotee_cand = ner.getCoveredText();\n \t \t\t\tquotee_end = ner.getEnd();\n \t \t\t\tquotee_begin = ner.getBegin();\n \t \t\t\tquoteeCandOffset = \"\" + quotee_begin + \"-\" + quotee_end;\n \t \t\t\t\n// \t \t\t\tSystem.out.println(\"Hello, World FOUND PERSON\" + quotee_cand);\n \t \t\t}\n \t \t}\n \t \tif (count == 1){ // there is exactly one NER.PERSON\n// \t \t\tSystem.out.println(\"ONE PERSON, SEVERAL NER \" + quotee_cand);\n \t \t\t\tquoteeCandText = quotee_cand;\n\t\t\t\t\t\tquote_relation_left = aPrecedingToken.getLemma().getValue().toString();\n\t\t\t\t\t\tquoteeReliability = 3;\n\t\t\t\t\t\tquoteeReliability_left = 3;\n \t \t}\n \t }\n\t\t if(quoteeCandOffset != null && quoteeCandText != null ){\n//\t\t \t quotee_left = quoteeCandText;\n\t\t \t String result [] = determineBestRepMenSubject(\n\t\t \t\t\t quoteeCandOffset,quoteeCandOffset, quoteeCandText, hds);\n\t\t \t if (result.length>=2){\n\t\t \t\t quotee_left = result [0];\n\t\t \t\t representative_quotee_left = result [1];\n//\t\t \t System.out.println(\"RESULT2 NER quotee \" + quotee_left + \" representative_quotee \" + representative_quotee_left);\n\t\t \t }\n\t\t }\n\t\t}\n }\n\t\t\n \n\n\t\t\t\t\n\t\t\t\tif (quotee_left != null && quotee_right != null){\n//\t\t\t\t\tSystem.out.println(\"TWO QUOTEES\");\n\t\t\t\t\t\n\t\t\t\t\tif (directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\".\") \n\t\t\t\t\t\t|| \tdirectQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"!\")\n\t\t\t\t\t\t|| directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"?\")\n\t\t\t\t\t\t\t){\n//\t\t\t\t\t\tSystem.out.println(\"PUNCT \" + quotee_left + quote_relation_left + quoteeReliability_left);\n\t\t\t\t\t\tannotation.setQuotee(quotee_left);\n\t\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_left);\n\n\t\t\t\t\t}\n\t\t\t\t\telse if (directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\",\")){\n//\t\t\t\t\t\tSystem.out.println(\"COMMA \" + quotee_right + \" \" + quote_relation_right + \" \" + quoteeReliability_right);\n\t\t\t\t\t\tannotation.setQuotee(quotee_right);\n\t\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_right);\n\t\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_right);\n\t\t\t\t\t}\n\t\t\t\t\telse if (!directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\".\")\n\t\t\t\t\t\t\t&& !directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"!\")\n\t\t\t\t\t\t\t&& !directQuoteTokens.get(directQuoteTokens.size() - 2).getLemma().getValue().equals(\"?\")\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t){\n//\t\t\t\t\t\tSystem.out.println(\"NO PUNCT \" + quotee_right + \" \" + quote_relation_right + \" \" + quoteeReliability_right);\n\t\t\t\t\t\tannotation.setQuotee(quotee_right);\n\t\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_right);\n\t\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_right);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n//\t\t\t\t\t\tSystem.out.println(\"UNCLEAR LEFT RIGHT \" + quotee_left + quote_relation_left + quote + quotee_right + quote_relation_right);\n\t\t\t\t\tannotation.setQuotee(\"<unclear>\");\n\t\t\t\t\tannotation.setQuoteRelation(\"<unclear>\");\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (quoteeBeforeQuote == true){\n\t\t\t\t\tannotation.setQuotee(quotee_left);\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t}\n\t\t\t\telse if (quotee_left != null){\n//\t\t\t\t\tSystem.out.println(\"QUOTEE LEFT\" + quotee_left + quote_relation_left + quoteeReliability_left);\n\t\t\t\t\tannotation.setQuotee(quotee_left);\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t}\n\t\t\t\telse if (quotee_right != null){\n//\t\t\t\t\tSystem.out.println(\"QUOTEE RIGHT FOUND\" + quotee_right + \" QUOTE RELATION \" + quote_relation_right + \":\" + quoteeReliability_right);\n\t\t\t\t\tannotation.setQuotee(quotee_right);\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t\tannotation.setQuoteeReliability(quoteeReliability_right);\n\t\t\t\t\tannotation.setRepresentativeQuoteeMention(representative_quotee_right);\n\t\t\t\t}\n\t\t\t\telse if (quote_relation_left != null ){\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_left);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n//\t\t\t\t\tSystem.out.println(\"NO QUOTEE FOUND\" + quote + quote_relation_left + quote_relation_right);\n\t\t\t\t}\n\t\t\t\telse if (quote_relation_right != null){\n\t\t\t\t\tannotation.setQuoteRelation(quote_relation_right);\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n\t\t\t\t}\n\t\t\t\telse if (quoteType != null){\n\t\t\t\t\tannotation.setQuoteType(quoteType);\n//\t\t\t\t\tSystem.out.println(\"Hello, World NO QUOTEE and NO QUOTE RELATION FOUND\" + quote);\n\t\t\t\t}\n\t\t\t\tif (annotation.getRepresentativeQuoteeMention() != null){\n//\t\t\t\t\tSystem.out.println(\"NOW!!\" + annotation.getRepresentativeQuoteeMention());\n\t\t\t\t\tif (hds.dbpediaSurfaceFormToDBpediaLink.containsKey(annotation.getRepresentativeQuoteeMention())){\n\t\t\t\t\t\tannotation.setQuoteeDBpediaUri(hds.dbpediaSurfaceFormToDBpediaLink.get(annotation.getRepresentativeQuoteeMention()));\n//\t\t\t\t\t\tSystem.out.println(\"DBPRED FOUND\" + annotation.getRepresentativeQuoteeMention() + \" URI: \" + annotation.getQuoteeDBpediaUri());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} //for direct quote\n\t\t\n\t\t// annotate indirect quotes: opinion verb + 'that' ... until end of sentence: said that ...\n\n//\t\tList<CoreMap> sentences = document.get(SentencesAnnotation.class); //already instantiated above\nINDIRECTQUOTE:\t\tfor (CoreMap sentence : sentences) {\n//\t\t\tif (sentence.get(TokensAnnotation.class).size() > 5) { \n\t\t\t\tSentenceAnnotation sentenceAnn = new SentenceAnnotation(aJCas);\n\t\t\t\t\n\t\t\t\tint beginSentence = sentence.get(TokensAnnotation.class).get(0)\n\t\t\t\t\t\t.beginPosition();\n\t\t\t\tint endSentence = sentence.get(TokensAnnotation.class)\n\t\t\t\t\t\t.get(sentence.get(TokensAnnotation.class).size() - 1)\n\t\t\t\t\t\t.endPosition();\n\t\t\t\tsentenceAnn.setBegin(beginSentence);\n\t\t\t\tsentenceAnn.setEnd(endSentence);\n//\t\t\t\tsentenceAnn.addToIndexes();\n\t\t\t\t\n\t\t\t\tQuoteAnnotation indirectQuote = new QuoteAnnotation(aJCas);\n\t \tint indirectQuoteBegin = -5;\n\t\t\t\tint indirectQuoteEnd = -5;\n\t\t\t\tboolean subsequentDirectQuoteInstance = false;\n\t\t\t\t\n\t\t\t\tList<Chunk> chunksIQ = JCasUtil.selectCovered(aJCas,\n\t\t\t\tChunk.class, sentenceAnn);\n\t\t\t\tList<Chunk> chunksBeforeIndirectQuote = null;\n\t\t\t\t\n\t\t\t\tint index = 0;\nINDIRECTCHUNK:\tfor (Chunk aChunk : chunksIQ) {\n\t\t\t\t\tindex++;\n\t\t\t\t\t\n//\t\t\t\t\tSystem.out.println(\"INDIRECT QUOTE CHUNK VALUE \" + aChunk.getChunkValue().toString());\n//\t\t\t\t\tif (aChunk.getChunkValue().equals(\"SBAR\")) {\n\t\t\t\t\tif(indirectQuoteIntroChunkValue.contains(aChunk.getChunkValue())){\n//\t\t\t\t\t\tSystem.out.println(\"INDIRECT QUOTE INDEX \" + \"\" + index);\n\t\t\t\t\t\t\n\t\t\t\t\t\tList<Token> tokensSbar = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\tToken.class, aChunk);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (Token aTokenSbar : tokensSbar){\n//\t\t\t\t\t\t\tString that = \"that\";\n\t\t\t\t\t\t\tif (compLemma.contains(aTokenSbar.getLemma().getCoveredText())){\n\t\t\t\t\t\t// VP test: does that clause contain VP?\n//\t\t\t\t\t\t\t\tSystem.out.println(\"TOK1\" + aTokenSbar.getLemma().getCoveredText());\n//\t\t\t \tQuoteAnnotation indirectQuote = new QuoteAnnotation(aJCas);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t indirectQuoteBegin = aChunk.getEnd() + 1;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t chunksBeforeIndirectQuote = chunksIQ.subList(0, index-1);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//NEW\n//\t\t\t\t\t\t\t\tif (LANGUAGE == \"en\")\n\t\t\t\t\t\t\t\tList<Token> precedingSbarTokens = JCasUtil.selectPreceding(aJCas,\n\t\t\t\t\t\t\t\t\t\tToken.class, aChunk, 1);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfor (Token aPrecedingSbarToken: precedingSbarTokens){ \n//\t\t\t\t\t\t\t\t\tSystem.out.println(\"TOK2\" + aPrecedingSbarToken.getLemma().getCoveredText());\n\t\t\t\t \tif (coordLemma.contains(aPrecedingSbarToken.getLemma().getValue().toString())){\n//\t\t\t\t \t\tSystem.out.println(\"TOKK\" + aPrecedingSbarToken.getLemma().getCoveredText());\n\t\t\t\t \t\tchunksBeforeIndirectQuote = chunksIQ.subList(0, index-1);\n\t\t\t\t \t\tint k = 0;\n\t\t\t\t \tSAY:\tfor (Chunk chunkBeforeAndThat : chunksBeforeIndirectQuote){\n//\t\t\t\t \t\t\txxxx\n\t\t\t\t \t\tk++;\n\t\t\t\t \t\t\tif (chunkBeforeAndThat.getChunkValue().equals(\"VP\")){\n\t\t\t\t \t\t\t\t\n\t\t\t\t \t\t\t\tList<Token> tokensInVp = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tToken.class, chunkBeforeAndThat);\n\t\t\t\t\t\t\t\t\t\t\t\tfor (Token aTokenInVp : tokensInVp){\n//\t\t\t\t\t\t\t\t\t\t\t\t\tString and;\n//\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"TOKK\" + aTokenInVp.getLemma().getCoveredText());\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (aTokenInVp.getLemma().getValue().equals(\"say\")){\n//\t\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"SAY OLD\" + indirectQuoteBegin + \":\" + sentenceAnn.getCoveredText());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tchunksBeforeIndirectQuote = chunksIQ.subList(0, k);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tindirectQuoteBegin = chunksBeforeIndirectQuote.get(chunksBeforeIndirectQuote.size()-1).getEnd()+1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"SAY NEW\" + indirectQuoteBegin + \":\" );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak SAY;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t \t\t\t\t\n\t\t\t\t \t\t\t\t\n\t\t\t\t \t\t\t}\n\t\t\t\t \t\t\t\n\t\t\t\t \t\t\t\n\t\t\t\t \t\t}\n\t\t\t\t \t\t\n\t\t\t\t \t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tList<QuoteAnnotation> coveringDirectQuoteChunk = JCasUtil.selectCovering(aJCas,\n\t\t\t\t\t\t\t\t\t\tQuoteAnnotation.class, aChunk);\n\t\t\t\t\t\t\t\tif (coveringDirectQuoteChunk.isEmpty()){\n//\t\t\t\t\t\t\t\t indirectQuoteBegin = aChunk.getEnd() + 1;\n\t\t\t\t\t\t\t\t indirectQuote.setBegin(indirectQuoteBegin);\n//\t\t\t\t\t\t\t\t chunksBeforeIndirectQuote = chunksIQ.subList(0, index-1);\n\t\t\t\t\t\t\t\t indirectQuoteEnd = sentenceAnn.getEnd();\n\t\t\t\t\t\t\t\t indirectQuote.setEnd(indirectQuoteEnd);\n\t\t\t\t\t\t\t\t indirectQuote.addToIndexes();\n\t\t\t\t\t\t\t\t subsequentDirectQuoteInstance = false;\n//\t\t\t\t\t\t\t\t System.out.println(\"SUBSEQUENT FALSE\");\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t List<Token> followTokens = JCasUtil.selectFollowing(aJCas,\n\t\t\t\t\t\t\t\t\t\t\tToken.class, indirectQuote, 1);\n\t\t\t\t\t\t\t\t for (Token aFollow3Token: followTokens){\n\t\t\t\t\t\t\t\t\t List<QuoteAnnotation> subsequentDirectQuotes = JCasUtil.selectCovering(aJCas,\n\t\t\t\t\t\t\t\t\t\t\tQuoteAnnotation.class,aFollow3Token);\n\t\t\t\t\t\t\t\t\t if (!subsequentDirectQuotes.isEmpty()){\n\t\t\t\t\t\t\t\t\t\t for (QuoteAnnotation subsequentDirectQuote: subsequentDirectQuotes){\n\t\t\t\t\t\t\t\t\t\t\t if (subsequentDirectQuote.getRepresentativeQuoteeMention() != null\n\t\t\t\t\t\t\t\t\t\t\t\t && subsequentDirectQuote.getRepresentativeQuoteeMention().equals(\"<unclear>\")){\n//\t\t\t\t\t\t\t\t\t\t\t System.out.println(\"SUBSEQUENT FOUND\"); \n\t\t\t\t\t\t\t\t\t\t\t hds.subsequentDirectQuote = subsequentDirectQuote;\n\t\t\t\t\t\t\t\t\t\t\t subsequentDirectQuoteInstance = true;\n\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t break INDIRECTCHUNK;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\n\t\t\t\t}\n\t\t\t\t\tif (indirectQuoteBegin >= 0 && indirectQuoteEnd >= 0){\n//\t\t\t\t\t\tList<QuoteAnnotation> coveringDirectQuote = JCasUtil.selectCovering(aJCas,\n//\t\t\t\t\t\t\t\tQuoteAnnotation.class, indirectQuote);\n//\t\t\t\t\t\tif (coveringDirectQuote.isEmpty()){\n////\t\t\t\t\t\t\t\n//\t\t\t\t\t\tindirectQuote.addToIndexes();\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\telse {\n//\t\t\t\t\t\t\t//indirect quote is covered by direct quote and therefore discarded\n//\t\t\t\t\t\t\tcontinue INDIRECTQUOTE;\n//\t\t\t\t\t\t}\n\t\t\t\t\tList<QuoteAnnotation> coveredDirectQuotes = JCasUtil.selectCovered(aJCas,\n\t\t\t\t\t\t\t\tQuoteAnnotation.class, indirectQuote);\n\t\t\t\t\tfor (QuoteAnnotation coveredDirectQuote : coveredDirectQuotes){\n//\t\t\t\t\t\tSystem.out.println(\"Hello, World covered direct quote\" + coveredDirectQuote.getCoveredText());\n\t\t\t\t\t\t//delete coveredDirectQuoteIndex\n\t\t\t\t\t\tcoveredDirectQuote.removeFromIndexes();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t//no indirect quote in sentence\n\t\t\t\t\t\tcontinue INDIRECTQUOTE;\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n//\t\t\t\t\t\tRe-initialize markup variables since they are also used for direct quotes\n\t\t\t\t\t\tquotee_left = null;\n\t\t\t\t\t\tquotee_right = null; \n\t\t\t\t\t\t\n\t\t\t\t\t\trepresentative_quotee_left = null;\n\t\t\t\t\t\trepresentative_quotee_right = null;\n\t\t\t\t\t\t\n\t\t\t\t\t\tquote_relation_left = null;\n\t\t\t\t\t\tquote_relation_right = null;\n\t\t\t\t\t\t\n\t\t\t\t\t\tquoteType = \"indirect\";\n\t\t\t\t\t\tquoteeReliability = 5;\n\t\t\t\t\t\tquoteeReliability_left = 5;\n\t\t\t\t\t\tquoteeReliability_right = 5;\n\t\t\t\t\t\tquotee_end = -5;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\tif (chunksBeforeIndirectQuote != null){\n//\t\t\t\t\t\t\tSystem.out.println(\"chunksBeforeIndirectQuote FOUND!! \");\n\t\t\t\t\t\t\tString[] quote_annotation_result = determine_quotee_and_quote_relation(\"LEFT\", chunksBeforeIndirectQuote,\n\t\t\t\t\t\t\t\t\t hds, indirectQuote\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t );\n\t\t\tif (quote_annotation_result.length>=4){\n\t\t\t quotee_left = quote_annotation_result[0];\n\t\t\t representative_quotee_left = quote_annotation_result[1];\n\t\t\t quote_relation_left = quote_annotation_result[2];\n//\t\t\t System.out.println(\"INDIRECT QUOTE LEFT RESULT quotee \" + quotee_left + \" representative_quotee \" + representative_quotee_left\n//\t\t\t\t\t + \" QUOTE RELATION \" + quote_relation_left);\n\t\t\t try {\n\t\t\t\t quoteeReliability = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t quoteeReliability_left = Integer.parseInt(quote_annotation_result[3]);\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\tquoteeReliability = -5;\n\t\t\t\tquoteeReliability_left = -5;\n\t\t\t\t}\t\t\t\t\t \n\t\t\t }\n\t\t\t\n\t\t\t}\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (quotee_left != null){\n\t\t\t\t\t\t\tindirectQuote.setQuotee(quotee_left);\n\t\t\t\t\t\t\tindirectQuote.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\t\tindirectQuote.setQuoteType(quoteType);\n\t\t\t\t\t\t\tindirectQuote.setQuoteeReliability(quoteeReliability_left);\n\t\t\t\t\t\t\tindirectQuote.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//indirect quote followed by direct quote:\n\t\t\t\t\t\t\t//the quotee and quote relation of the indirect quote are copied to the direct quote \n\t\t\t\t\t\t\t//Genetic researcher Otmar Wiestler hopes that the government's strict controls on genetic research \n\t\t\t\t\t\t\t//will be relaxed with the advent of the new ethics commission. \n\t\t\t\t\t\t\t//\"For one thing the government urgently needs advice, because of course it's such an extremely \n\t\t\t\t\t\t\t//complex field. And one of the reasons Chancellor Schröder formed this new commission was without \n\t\t\t\t\t\t\t//a doubt to create his own group of advisors.\"\n\n\t\t\t\t\t\t\tif (subsequentDirectQuoteInstance == true\n\t\t\t\t\t\t\t\t&&\thds.subsequentDirectQuote.getRepresentativeQuoteeMention().equals(\"<unclear>\")\n\t\t\t\t\t\t\t\t&& \thds.subsequentDirectQuote.getQuotee().equals(\"<unclear>\")\n\t\t\t\t\t\t\t\t&& \thds.subsequentDirectQuote.getQuoteRelation().equals(\"<unclear>\")\n\t\t\t\t\t\t\t\t\t){\n//\t\t\t\t\t\t\t\tSystem.out.println(\"SUBSEQUENT UNCLEAR DIR QUOTE FOUND!!\"); \n\t\t\t\t\t\t\t\tint begin = hds.subsequentDirectQuote.getBegin();\n\t\t\t\t\t\t\t\tint end = hds.subsequentDirectQuote.getEnd();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuotee(quotee_left);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuoteType(\"direct\");\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setQuoteeReliability(quoteeReliability_left + 2);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.setRepresentativeQuoteeMention(representative_quotee_left);\n\t\t\t\t\t\t\t\thds.subsequentDirectQuote.addToIndexes();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\tSystem.out.println(\"Hello, World INDIRECT QUOTE \" + quotee_left + quote_relation_left + quoteeReliability);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (quote_relation_left != null){\n\t\t\t\t\t\t\tindirectQuote.setQuoteRelation(quote_relation_left);\n\t\t\t\t\t\t\tindirectQuote.setQuoteType(quoteType);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\telse if (quoteType != null){\n\t\t\t\t\t\t\tindirectQuote.setQuoteType(quoteType);\n//\t\t\t\t\t\t\tSystem.out.println(\"Hello, World INDIRECT QUOTE NOT FOUND\" + quote_relation_left);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (indirectQuote.getRepresentativeQuoteeMention() != null){\n//\t\t\t\t\t\t\tSystem.out.println(\"NOW!!\" + indirectQuote.getRepresentativeQuoteeMention());\n\t\t\t\t\t\t\tif (hds.dbpediaSurfaceFormToDBpediaLink.containsKey(indirectQuote.getRepresentativeQuoteeMention())){\n\t\t\t\t\t\t\t\tindirectQuote.setQuoteeDBpediaUri(hds.dbpediaSurfaceFormToDBpediaLink.get(indirectQuote.getRepresentativeQuoteeMention()));\n//\t\t\t\t\t\t\t\tSystem.out.println(\"DBPEDIA \" + indirectQuote.getRepresentativeQuoteeMention() + \" URI: \" + hds.dbpediaSurfaceFormToDBpediaLink.get(indirectQuote.getRepresentativeQuoteeMention()));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t }\n//\t\t\t} //for chunk\n//\t\t\t\tsay without that\n//\t\t\t}\t\t\n\t\t} //Core map sentences indirect quotes\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "private void doBeforeProcessValidations(final PhaseEvent arg0) {\n\t}", "public void initializeAllCharacters(Tree story){\n//\t\tfor (Tree subtree : story){\n//\t\t\tif (subtree.label().value().equals(\"NP\")){//extracting all noun phrases to initialize all of the characters.\n//\t\t\t\taddCharacterToMap(subtree);\n//\t\t\t}\n//\t\t}\n//\t\tgetAllVerbPhrases(story);\n\t}", "protected void applyFont() {\n\t\tif (fields != null) {\n\t\t\tIterator<FieldEditor> e = fields.iterator();\n\t\t\twhile (e.hasNext()) {\n\t\t\t\tFieldEditor pe = e.next();\n\t\t\t\t// pe.applyFont();\n\t\t\t}\n\t\t}\n\t}", "public void formatText(String text){\n\t\ttext = text.replaceAll(\"\\\\<[^>]*>\",\"\");\n\t}", "private void setFormatedText(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n formatedText_ = value;\n }", "@Override\n\tpublic void beforeGetText(WebElement arg0, WebDriver arg1) {\n\n\t}", "private void parseAndFormatInput() {\n try {\n String input = getText();\n if (input == null || input.length() == 0) {\n return;\n }\n Number parsedNumber = nf.parse(input);\n BigDecimal newValue = new BigDecimal(parsedNumber.toString());\n setNumber(newValue);\n selectAll();\n } catch (ParseException ex) {\n // If parsing fails keep old number\n setText(nf.format(number.get()));\n }\n }", "public Pre()\r\n {\r\n startTag=\"PRE\";\r\n endTag=\"/PRE\";\r\n }", "private void processStandoffMarkup(Document docExtra) {\n\t\tDOMSnapshot snapExtra = new DOMSnapshot(docExtra, docRoot, new XMLDialect());\n\t\tfor (ITSState itssExtra : snapExtra.iterNodes()) {\n\t\t\tRuleResolver resolver = resolvers.get(itssExtra.node.getNodeName()); \n\t\t\tif (resolver != null) {\n\t\t\t\tGlobalRule rule = resolver.extractRule(snapExtra.attrReader, snapExtra.parameters, itssExtra.node);\n\t\t\t\tapplyRule(resolver, rule);\n\t\t\t}\n\t\t\t\n\t\t\tif (itssExtra.node.getNodeName().equals(\"its:param\")) {\n\t\t\t\tString name = itssExtra.node.getAttributes().getNamedItem(\"name\").getNodeValue();\n\t\t\t\tString value = itssExtra.node.getTextContent();\n\t\t\t\tparameters.add(name, value);\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public void parsePseudocode() {\n\t\tputTokens();\n\t\tsetTokenLength();\n\t\ttokenize();\n\t\tdataToJS();\n\t}", "public void processText(org.w3c.dom.Text text)\r\n\tthrows Exception\r\n\t{\r\n\tWriter xml = getWriter();\r\n\txml.write(getIndent());\r\n\txml.write(HDOMUtil.trim(text));\r\n\txml.write(\"\\n\");\r\n\treturn;\r\n\t}", "public void correctStrings() {\n this.content = StringUtils.correctWhiteSpaces(content);\n }", "protected void undoTextChange() {\n \t\t\ttry {\n \t\t\t\tif (fDocumentUndoManager.fDocument instanceof IDocumentExtension4)\n \t\t\t\t\t((IDocumentExtension4) fDocumentUndoManager.fDocument).replace(fStart, fText\n \t\t\t\t\t\t\t.length(), fPreservedText, fUndoModificationStamp);\n \t\t\t\telse\n \t\t\t\t\tfDocumentUndoManager.fDocument.replace(fStart, fText.length(),\n \t\t\t\t\t\t\tfPreservedText);\n \t\t\t} catch (BadLocationException x) {\n \t\t\t}\n \t\t}", "public abstract void unparsedEntityDecl(String name, String publicId,\n String systemId, String notationName) throws SAXException;" ]
[ "0.60502416", "0.5769483", "0.56554335", "0.55572337", "0.554582", "0.5532467", "0.5488755", "0.5488755", "0.5488755", "0.5488755", "0.5456424", "0.5431741", "0.5380289", "0.5351636", "0.5302748", "0.52596414", "0.5220891", "0.5214609", "0.5211199", "0.52102447", "0.5200294", "0.51854604", "0.5129045", "0.5108641", "0.5058764", "0.50472647", "0.5037219", "0.496153", "0.49594262", "0.49544406", "0.48839456", "0.48735365", "0.48649254", "0.4845278", "0.48252827", "0.4820078", "0.48122904", "0.48039493", "0.48034322", "0.4786098", "0.4777267", "0.47458234", "0.47300833", "0.47285414", "0.4728129", "0.47093594", "0.47043562", "0.46634737", "0.46550706", "0.46530852", "0.46530852", "0.46491373", "0.46440738", "0.46431175", "0.46313423", "0.46257567", "0.46118894", "0.46068043", "0.45971248", "0.45924306", "0.45891783", "0.45781595", "0.45763874", "0.4573008", "0.45481285", "0.45466754", "0.4542167", "0.4538824", "0.4526647", "0.45248303", "0.45175084", "0.45158222", "0.4511304", "0.4505384", "0.45033178", "0.4499936", "0.4497766", "0.4497702", "0.4493936", "0.44877675", "0.44828928", "0.44795063", "0.44658354", "0.4464423", "0.44572377", "0.44486275", "0.44455048", "0.4438776", "0.44371137", "0.4436678", "0.4424594", "0.44238445", "0.44223246", "0.4421143", "0.44196966", "0.4418576", "0.441527", "0.44079518", "0.44047618", "0.44028988" ]
0.4869755
32
Starts the expansion process of a preprocessed page with the preprocessed page as root of the expansion process.
private LazyPreprocessedPage expand( ExpansionCallback callback, PageTitle title, LazyPreprocessedPage ppAst, EntityMap entityMap, LinkedHashMap<String, AstNode> arguments, boolean forInclusion, ContentNode parentLog) throws CompilerException { return expand( callback, title, ppAst, entityMap, arguments, forInclusion, null, null, parentLog); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected CompiledPage preprocessAndExpand(\n\t ExpansionCallback callback,\n\t PageId pageId,\n\t String wikitext,\n\t boolean forInclusion,\n\t EntityMap entityMap,\n\t Map<String, AstNode> arguments,\n\t ExpansionFrame rootFrame,\n\t ExpansionFrame parentFrame)\n\t throws CompilerException\n\t{\n\t\tif (pageId == null)\n\t\t\tthrow new NullPointerException();\n\t\t\n\t\tif (wikitext == null)\n\t\t\tthrow new NullPointerException();\n\t\t\n\t\tPageTitle title = pageId.getTitle();\n\t\t\n\t\tCompilerLog log = new CompilerLog();\n\t\tlog.setTitle(title.getFullTitle());\n\t\tlog.setRevision(pageId.getRevision());\n\t\t\n\t\tLazyPreprocessedPage pprAst;\n\t\ttry\n\t\t{\n\t\t\tString validatedWikitext =\n\t\t\t validate(title, wikitext, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage ppAst =\n\t\t\t preprocess(title, validatedWikitext, forInclusion, entityMap, log);\n\t\t\t\n\t\t\tpprAst = expand(\n\t\t\t callback,\n\t\t\t title,\n\t\t\t ppAst,\n\t\t\t entityMap,\n\t\t\t arguments,\n\t\t\t forInclusion,\n\t\t\t rootFrame,\n\t\t\t parentFrame,\n\t\t\t log);\n\t\t}\n\t\tcatch (CompilerException e)\n\t\t{\n\t\t\te.attachLog(log);\n\t\t\tthrow e;\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tthrow new CompilerException(\"Compilation failed!\", e, log);\n\t\t}\n\t\t\n\t\treturn new CompiledPage(\n\t\t new Page(pprAst.getContent()),\n\t\t pprAst.getWarnings(),\n\t\t log);\n\t}", "private LazyPreprocessedPage expand(\n\t ExpansionCallback callback,\n\t PageTitle title,\n\t LazyPreprocessedPage ppAst,\n\t EntityMap entityMap,\n\t Map<String, AstNode> arguments,\n\t boolean forInclusion,\n\t ExpansionFrame rootFrame,\n\t ExpansionFrame parentFrame,\n\t ContentNode parentLog)\n\t throws CompilerException\n\t{\n\t\tPpResolverLog log = new PpResolverLog();\n\t\tparentLog.getContent().add(log);\n\t\t\n\t\tif (arguments == null)\n\t\t\targuments = new HashMap<String, AstNode>();\n\t\t\n\t\tStopWatch stopWatch = new StopWatch();\n\t\tstopWatch.start();\n\t\t\n\t\ttry\n\t\t{\n\t\t\tExpansionFrame frame;\n\t\t\tif (rootFrame != null)\n\t\t\t{\n\t\t\t\tframe = new ExpansionFrame(\n\t\t\t\t this,\n\t\t\t\t callback,\n\t\t\t\t title,\n\t\t\t\t entityMap,\n\t\t\t\t arguments,\n\t\t\t\t forInclusion,\n\t\t\t\t rootFrame,\n\t\t\t\t parentFrame,\n\t\t\t\t ppAst.getWarnings(),\n\t\t\t\t log);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tframe = new ExpansionFrame(\n\t\t\t\t this,\n\t\t\t\t callback,\n\t\t\t\t title,\n\t\t\t\t entityMap,\n\t\t\t\t ppAst.getWarnings(),\n\t\t\t\t log);\n\t\t\t}\n\t\t\t\n\t\t\tLazyPreprocessedPage expanded =\n\t\t\t (LazyPreprocessedPage) frame.expand(ppAst);\n\t\t\t\n\t\t\treturn expanded;\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tlogger.error(\"Resolution failed!\", e);\n\t\t\t\n\t\t\tStringWriter w = new StringWriter();\n\t\t\te.printStackTrace(new PrintWriter(w));\n\t\t\tlog.getContent().add(new UnhandledException(e, w.toString()));\n\t\t\t\n\t\t\tthrow new CompilerException(\"Resolution failed!\", e);\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tstopWatch.stop();\n\t\t\tlog.setTimeNeeded(stopWatch.getElapsedTime());\n\t\t}\n\t}", "public void startContent() {\n iTextContext.pageNumber().startMainMatter();\n }", "@Override\n public void process(Page page) {\n PageStore.prePage = page.getHtml().toString();\n }", "public void startPage() {\n\t\tthis.dataComposer.startPage();\n\t}", "@Override\n\tpublic void process(Page page) {\n\t\t\n\t}", "private void expandTree() {\n tree.expand();\n }", "public ProcessPage() {\n\t\tPageFactory.initElements(driver, this);\n\t\t \n\n\t}", "public CompiledPage preprocess(\n\t PageId pageId,\n\t String wikitext,\n\t boolean forInclusion,\n\t ExpansionCallback callback)\n\t throws CompilerException\n\t{\n\t\tif (pageId == null)\n\t\t\tthrow new NullPointerException();\n\t\t\n\t\tPageTitle title = pageId.getTitle();\n\t\t\n\t\tCompilerLog log = new CompilerLog();\n\t\tlog.setTitle(title.getFullTitle());\n\t\tlog.setRevision(pageId.getRevision());\n\t\t\n\t\tLazyPreprocessedPage pprAst;\n\t\ttry\n\t\t{\n\t\t\tEntityMap entityMap = new EntityMap();\n\t\t\t\n\t\t\tString validatedWikitext =\n\t\t\t validate(title, wikitext, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage ppAst =\n\t\t\t preprocess(title, validatedWikitext, forInclusion, entityMap, log);\n\t\t\t\n\t\t\tpprAst = ppAst;\n\t\t\tif (callback != null)\n\t\t\t\tpprAst = expand(callback, title, ppAst, entityMap, null, false, log);\n\t\t}\n\t\tcatch (CompilerException e)\n\t\t{\n\t\t\te.attachLog(log);\n\t\t\tthrow e;\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tthrow new CompilerException(\"Compilation failed!\", e, log);\n\t\t}\n\t\t\n\t\treturn new CompiledPage(\n\t\t new Page(pprAst.getContent()),\n\t\t pprAst.getWarnings(),\n\t\t log);\n\t}", "public void process(Page page) {\n\t\t\t\tgetContent(page);\n\t\t\t}", "public void preorder() {\n\t\tpreorder(root);\n\t}", "public void start(){\n\t\tboolean readFromFile = readFromIndex();\r\n\t\tif (!readFromFile){\t\r\n\t\t\tfor (int i = 0;i<1000;++i){\r\n\t\t\t\tString file = \"../crawler/pages/page\"+i+\".html\";\r\n\t\t\t\taddFile(file);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void preorder()\n {\n preorder(root);\n }", "public void preorder()\n {\n preorder(root);\n }", "public void start() {\n process(0);\n }", "public void start() {\n if (editor == null) {\n return;\n }\n \n DocumentManager.register(doc, styledText, documentManager);\n \n preCode = doc.get();\n \n super.start();\n }", "void startPage(RequestContextHolder request);", "public void preorder() {\n root.preorder();\n System.out.println(\"\");\n }", "public void startDocument() {\n _root = null;\n _target = null;\n _prefixMapping = null;\n _parentStack = new Stack<>();\n }", "@Override\n\tpublic void addPages() {\n\t\tthis.mainPage = new SNLFilePage(this.workbench, this.selection);\n\t\tthis.addPage(this.mainPage);\n\t}", "void preProcess();", "@Override\n\tpublic void loadPrePage() {\n\t\t\n\t\tif(curr_content.isFirstPage){\n\t\t\tPigAndroidUtil.showToast(mContext, \"以是第一页:\", 3000);\n\t\t}else{\n\t\t\texchangePre(m_bookFactory.getPrePageContent(pre_content));\n\t\t}\n\t}", "private void preorderSubtree(Position<E> p, List<Position<E>> snapshot) {\n snapshot.add(p);\n for (Position<E> c : children(p)) {\n preorderSubtree(c, snapshot); \n \n }\n }", "public void preOrderTraversal() {\n beginAnimation();\n treePreOrderTraversal(root);\n stopAnimation();\n\n }", "public void PreOrder() {\n\t\tPreOrder(root);\n\t}", "public void run() {\n getPage(page + 1, false);\n }", "public void step(Node<T, V> nodeToExpand) {\r\n\t\tlogger.debug(\"Step starts. Size of OPEN now {}\", open.size());\r\n\t\tif (Thread.interrupted()) {\r\n\t\t\tlogger.debug(\"Received interrupt signal before step.\");\r\n\t\t\tinterrupted = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tlastExpansion.clear();\r\n\t\tassert nodeToExpand == null || !expanded.contains(nodeToExpand.getPoint()) : \"Node selected for expansion already has been expanded: \" + nodeToExpand;\r\n\t\topen.remove(nodeToExpand);\r\n\t\tassert !open.contains(nodeToExpand) : \"The selected node \" + nodeToExpand + \" was not really removed from OPEN!\";\r\n\t\tlogger.debug(\"Removed {} from OPEN for expansion. OPEN size now {}\", nodeToExpand, open.size());\r\n\t\tassert ext2int.containsKey(nodeToExpand.getPoint()) : \"Trying to expand a node whose point is not available in the ext2int map\";\r\n\t\tbeforeExpansion(nodeToExpand);\r\n\t\texpandNode(nodeToExpand);\r\n\t\tafterExpansion(nodeToExpand);\r\n\t\tif (Thread.interrupted()) {\r\n\t\t\tlogger.debug(\"Received interrupt signal during step.\");\r\n\t\t\tinterrupted = true;\r\n\t\t}\r\n\t\tlogger.debug(\"Step ends. Size of OPEN now {}\", open.size());\r\n\t}", "public void run() {\n try {\r\n TransformerFactory tFactory = TransformerFactory.newInstance();\r\n // Fortify Mod: prevent external entity injection\r\n tFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);\r\n Transformer transformer = tFactory.newTransformer();\r\n transformer.setOutputProperty(\"encoding\", \"UTF-8\");\r\n transformer.setOutputProperty(\"indent\", \"yes\");\r\n transformer.transform(new DOMSource(doc), new StreamResult(\r\n pos));\r\n } catch (Exception e) {\r\n throw new RuntimeException(\r\n \"Error converting Document to InputStream. \"\r\n + e.getMessage());\r\n } finally {\r\n try {\r\n pos.close();\r\n } catch (IOException e) {\r\n\r\n }\r\n }\r\n }", "public void preorder()\r\n {\r\n preorder(root);\r\n }", "public void onQsExpansionStarted() {\n onQsExpansionStarted(0);\n }", "void setPageStart(short start);", "public void preOrder() {\r\n\t\tSystem.out.print(\"PRE: \");\r\n\r\n\t\tpreOrder(root);\r\n\t\tSystem.out.println();\r\n\r\n\t}", "public void startContent() throws XPathException {\n if (activeDepth > 0) {\n super.startContent();\n } else if (matched) {\n activeDepth = 1;\n super.startContent();\n }\n }", "public void setStartPage(java.math.BigInteger startPage)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STARTPAGE$12);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(STARTPAGE$12);\n }\n target.setBigIntegerValue(startPage);\n }\n }", "public void run()\n {\n mkdStack = translateMacroStack(mkdStack);\n //translate mkd to html\n translateMkdToHtml();\n //send html string to global variable\n Compiler.htmlString = htmlStackToString();\n }", "public CompiledPage postprocess(\n\t PageId pageId,\n\t String wikitext,\n\t ExpansionCallback callback)\n\t throws CompilerException\n\t{\n\t\tif (pageId == null)\n\t\t\tthrow new NullPointerException();\n\t\t\n\t\tPageTitle title = pageId.getTitle();\n\t\t\n\t\tCompilerLog log = new CompilerLog();\n\t\tlog.setTitle(title.getFullTitle());\n\t\tlog.setRevision(pageId.getRevision());\n\t\t\n\t\tLazyParsedPage pAst;\n\t\ttry\n\t\t{\n\t\t\tEntityMap entityMap = new EntityMap();\n\t\t\t\n\t\t\tString validatedWikitext =\n\t\t\t validate(title, wikitext, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage ppAst =\n\t\t\t preprocess(title, validatedWikitext, false, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage pprAst = ppAst;\n\t\t\tif (callback != null)\n\t\t\t\tpprAst = expand(callback, title, ppAst, entityMap, null, false, log);\n\t\t\t\n\t\t\tpAst = parse(title, pprAst, entityMap, log);\n\t\t\t\n\t\t\tpAst = postprocess(title, pAst, log);\n\t\t}\n\t\tcatch (CompilerException e)\n\t\t{\n\t\t\te.attachLog(log);\n\t\t\tthrow e;\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tthrow new CompilerException(\"Compilation failed!\", e, log);\n\t\t}\n\t\t\n\t\treturn new CompiledPage(\n\t\t new Page(pAst.getContent()),\n\t\t pAst.getWarnings(),\n\t\t log);\n\t}", "public void startProcess() {\r\n\t\tprocess = true;\r\n\t}", "public void startOver() {\n this.pagesRead = 0;\n }", "protected abstract StackManipulation preparation();", "public void xsetStartPage(com.a9.spec.opensearch.x11.QueryType.StartPage startPage)\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.a9.spec.opensearch.x11.QueryType.StartPage target = null;\n target = (com.a9.spec.opensearch.x11.QueryType.StartPage)get_store().find_attribute_user(STARTPAGE$12);\n if (target == null)\n {\n target = (com.a9.spec.opensearch.x11.QueryType.StartPage)get_store().add_attribute_user(STARTPAGE$12);\n }\n target.set(startPage);\n }\n }", "public void preOrder() {\n preOrder(root);\n }", "public void preTraverse() {\n // ensure not an empty tree\n while (root != null) {\n \n }\n }", "public void preorderTraverse(){\n\t\tpreorderHelper(root);\n\t\tSystem.out.println();\n\t}", "@Override\r\n\tpublic void run() {\n \tFile in = new File(\"input.txt\");\r\n\t\t String strLine;\r\n\t\t int k;\r\n\t\t Tree mytree = new Tree();\r\n\t\t try {\r\n\t\t Scanner sc = new Scanner(in);\r\n\t\t while (sc.hasNext()) {\r\n\t\t mytree.insert(sc.nextInt());\r\n\t\t }\r\n\t\t } catch (FileNotFoundException e) {\r\n\t\t e.printStackTrace();\r\n\t\t }\r\n\t\t try(FileWriter fos=new FileWriter(\"output.txt\"))\r\n\t {\r\n\t \r\n\t\t\t mytree.PreOrderTraversal(mytree.root, fos);\r\n\t }\r\n\t catch(IOException ex){\r\n\t \tSystem.out.println(ex.getMessage());\r\n\t }\r\n \t\r\n\t}", "@Override\n\tpublic void startProcessing() {\n\n\t}", "@Override\n\tpublic void process(Task task, Page page) {\n\t\t\n\t}", "private synchronized void buildConcreteProcessor(Environment env) throws Exception {\n if (this.concreteProcessor != null && this.source.getLastModified() == this.lastModified) {\n // Nothing changed\n return;\n }\n\n long startTime = System.currentTimeMillis();\n\n // Dispose the old processor, if any\n if (this.concreteProcessor != null) {\n this.concreteProcessor.markForDisposal();\n }\n\n // Get a builder\n TreeBuilder builder = (TreeBuilder)this.builderSelector.select(\"sitemap\");\n ConcreteTreeProcessor newProcessor = new ConcreteTreeProcessor(this);\n long newLastModified;\n this.setupLogger(newProcessor);\n //FIXME (SW): why do we need to enterProcessor here?\n CocoonComponentManager.enterEnvironment(env, this.manager, this);\n try {\n if (builder instanceof Recomposable) {\n ((Recomposable)builder).recompose(this.manager);\n }\n builder.setProcessor(newProcessor);\n\n newLastModified = this.source.getLastModified();\n\n ProcessingNode root = builder.build(this.source);\n\n newProcessor.setProcessorData(builder.getSitemapComponentManager(), root, builder.getDisposableNodes());\n } finally {\n CocoonComponentManager.leaveEnvironment();\n this.builderSelector.release(builder);\n }\n\n if (this.getLogger().isDebugEnabled()) {\n double time = (this.lastModified - startTime) / 1000.0;\n this.getLogger().debug(\"TreeProcessor built in \" + time + \" secs from \" + this.source.getURI());\n }\n\n // Switch to the new processor (ensure it's never temporarily null)\n this.concreteProcessor = newProcessor;\n this.lastModified = newLastModified;\n }", "protected void prepareToExecuteChildren()\n \t{\n \t\tcollectExecutableElements();\n \t}", "private void init()\n {\n wikiContext.runInTenantContext(branch, getWikiSelector(), new CallableX<Void, RuntimeException>()\n {\n @Override\n public Void call() throws RuntimeException\n {\n GWikiElement page = wikiContext.getWikiWeb().getElement(pageId);\n WorkflowPopupActionBean.this.page = page;\n\n // check if dependent objects exists\n List<GWikiElementInfo> childs = wikiContext.getElementFinder().getAllDirectChilds(page.getElementInfo());\n for (final GWikiElementInfo child : childs) {\n getDepObjects().add(wikiContext.getWikiWeb().getElement(child));\n getSubpagesRec(child, 2);\n }\n return null;\n }\n\n /**\n * Recursive fetch of child elements\n */\n private void getSubpagesRec(GWikiElementInfo parent, int curDepth)\n {\n List<GWikiElementInfo> childs = wikiContext.getElementFinder().getAllDirectChilds(parent);\n for (final GWikiElementInfo child : childs) {\n getDepObjects().add(wikiContext.getWikiWeb().getElement(child));\n getSubpagesRec(child, ++curDepth);\n }\n }\n });\n }", "public Iterator_BuildTextExpansion_ clone(CallContext context);", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\n\t\tmPagefactory.setBgBitmap(BitmapFactory.decodeResource(\n\t\t\t\tthis.getResources(), myImageIds[sPosition]));\n\t\ttry {\n\t\t\tmPagefactory.openbook(mFilenameString);\n\t\t\tmPagefactory.onDraw(mCurPageCanvas);\n\t\t} catch (IOException e1) {\n\t\t\te1.printStackTrace();\n\t\t\tToast.makeText(this, \"error\", Toast.LENGTH_SHORT).show();\n\t\t}\n\t\tmPageWidget.setBitmaps(mCurPageBitmap, mCurPageBitmap);\n\t\tif (sFlag == 1) {\n\t\t\ttry {\n\t\t\t\tmPagefactory.jumpPage(ReaderDataBase.search(this,\n\t\t\t\t\t\t\"LastReadProcess\", mFilenameString));\n\n\t\t\t\tauto();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public PDFPagesTree(PDFFile file) { _dict.put(\"Type\", \"/Pages\"); }", "public void preOrderTraversal() {\n preOrderThroughRoot(root);\n System.out.println();\n }", "public void run() {\n\t\t\twhile (parent.getFileStack().size() > 0) {\n\t\t\t\tFile file = parent.getFileStack().pop();\n\t\t\t\tthis.processFile(file);\n\t\t\t}\n\t\t}", "public void preOrder(){\n preOrder(root);\n System.out.println();\n }", "private LazyPreprocessedPage preprocess(\n\t PageTitle title,\n\t String validatedWikitext,\n\t boolean forInclusion,\n\t EntityMap entityMap,\n\t ContentNode parentLog)\n\t throws CompilerException\n\t{\n\t\tPreprocessorLog log = new PreprocessorLog();\n\t\tparentLog.getContent().add(log);\n\t\t\n\t\tlog.setForInclusion(forInclusion);\n\t\t\n\t\tStopWatch stopWatch = new StopWatch();\n\t\tstopWatch.start();\n\t\t\n\t\ttry\n\t\t{\n\t\t\tLazyPreprocessor preprocessor = new LazyPreprocessor(wikiConfig);\n\t\t\t\n\t\t\tLazyPreprocessedPage preprocessedAst =\n\t\t\t (LazyPreprocessedPage) preprocessor.parseArticle(\n\t\t\t validatedWikitext,\n\t\t\t title.getFullTitle(),\n\t\t\t forInclusion);\n\t\t\t\n\t\t\treturn preprocessedAst;\n\t\t}\n\t\tcatch (xtc.parser.ParseException e)\n\t\t{\n\t\t\tlog.getContent().add(new ParseException(e.getMessage()));\n\t\t\t\n\t\t\tthrow new CompilerException(\"Preprocessing failed!\", e);\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tlogger.error(\"Preprocessing failed!\", e);\n\t\t\t\n\t\t\tStringWriter w = new StringWriter();\n\t\t\te.printStackTrace(new PrintWriter(w));\n\t\t\tlog.getContent().add(new UnhandledException(e, w.toString()));\n\t\t\t\n\t\t\tthrow new CompilerException(\"Preprocessing failed!\", e);\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tstopWatch.stop();\n\t\t\tlog.setTimeNeeded(stopWatch.getElapsedTime());\n\t\t}\n\t}", "@Override\n\tpublic void insertExpand(Expand expand) {\n\t\texpandMapper.insertExpand(expand);\n\t}", "@Override\n public void run() {\n for (int pg = PreviewPanel.this.firstPage; pg < PreviewPanel.this.firstPage\n + PreviewPanel.this.pageRange; pg++) {\n PreviewPanel.this.pagePanels[pg - PreviewPanel.this.firstPage]\n .setPage(pg);\n }\n revalidate();\n }", "public void traversePreOrder() {\n\t\tpreOrder(this);\n\t}", "public void startRecord() {\n\t\tcmd = new StartRecordCommand(editor);\n\t\tinvoker = new MiniEditorInvoker(cmd);\n\t\tinvoker.action();\n\t}", "protected void auto() {\n\t\tmPagefactory.onDraw(mCurPageCanvas);\n\t\tmPageWidget.setBitmaps(mCurPageBitmap, mNextPageBitmap);\n\t\tmPageWidget.startAnimation(1000);\n\t}", "public void preProcess(HttpServletRequest arg0, ContentList contentList) {\n\r\n\t}", "public void preprocess() {\n }", "public void preprocess() {\n }", "public void preprocess() {\n }", "public void preprocess() {\n }", "@Override\r\n\t\t\tpublic void autStartProcess() {\n\t\t\t}", "@Override\n public void eval(final AbraModule module)\n {\n clearSizes(module);\n\n // single pass over everything\n super.eval(module);\n\n // some sizes may have been indeterminable for now due to recursion\n resolveRecursions(module);\n }", "private void start() {\n\t\twhile(!navi.pathCompleted())\n\t\t{\n\t\t\tThread.yield();\n\t\t\t\n\t\t}\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "public void startPrinting()\n {\n printerSimulator.startPrintingProcess();\n }", "@Override\n\tpublic void run() {\n\t\tif (!mainDir.isDirectory()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// inserisco il nome della cartella principale.\n\t\tproduceDirPath(mainDir.getName());\n\t\t\n\t\t// navigo ricorsivamente.\n\t\twalkDir(mainDir);\n\t}", "public void prepare()\n\t{\n\t\tsuper.prepare();\n\n\t\tojTreeNode_prepare();\n\t\tmenu_prepare();\n\t}", "@Override\n public void run() {\n List<File> files = getContents(TOP_LEVEL + \" and \" + NOT_TRASHED + \" and \" + FOLDER + \" and \" + NOT_SPREADSHEET);\n \n prune(targetDir, files);\n processLanguages(files);\n }", "public void pageSwitch(String filename) throws IOException {\n pageSwitch(null, filename, stage);\n }", "private static void preCompileNode(Node n, ArrayList<CommandNode> cmdNode, ArrayList<MemoryNode> memNode, int b) {\n\t\tn.preCompile(cmdNode, memNode, b);\n\t}", "@Override\n protected void processPages(PDPageTree pages) throws IOException {\n\n List<ObjectRef> pageRefs = new ArrayList<>();\n //STEP 1: get the page refs\n findPages(pdDocument.getPages().getCOSObject().getItem(COSName.KIDS), pageRefs);\n //confirm the right number of pages was found\n if (pageRefs.size() != pdDocument.getNumberOfPages()) {\n throw new IOException(new TikaException(\n \"Couldn't find the right number of page refs (\" + pageRefs.size() +\n \") for pages (\" + pdDocument.getNumberOfPages() + \")\"));\n }\n\n PDStructureTreeRoot structureTreeRoot =\n pdDocument.getDocumentCatalog().getStructureTreeRoot();\n\n //STEP 2: load the roleMap\n Map<String, HtmlTag> roleMap = loadRoleMap(structureTreeRoot.getRoleMap());\n\n //STEP 3: load all of the text, mapped to MCIDs\n Map<MCID, String> paragraphs = loadTextByMCID(pageRefs);\n\n //STEP 4: now recurse the the structure tree root and output the structure\n //and the text bits from paragraphs\n\n try {\n recurse(structureTreeRoot.getK(), null, 0, paragraphs, roleMap);\n } catch (SAXException e) {\n throw new IOException(e);\n }\n\n //STEP 5: handle all the potentially unprocessed bits\n try {\n if (state.hrefAnchorBuilder.length() > 0) {\n xhtml.startElement(\"p\");\n writeString(state.hrefAnchorBuilder.toString());\n xhtml.endElement(\"p\");\n }\n for (MCID mcid : paragraphs.keySet()) {\n if (!state.processedMCIDs.contains(mcid)) {\n if (mcid.mcid > -1) {\n //TODO: LOG! piece of text that wasn't referenced in the marked content\n // tree\n // but should have been. If mcid == -1, this was a known item not part of\n // content tree.\n }\n\n xhtml.startElement(\"p\");\n writeString(paragraphs.get(mcid));\n xhtml.endElement(\"p\");\n }\n }\n } catch (SAXException e) {\n throw new IOException(e);\n }\n //Step 6: for now, iterate through the pages again and do all the other handling\n //TODO: figure out when we're crossing page boundaries during the recursion\n // step above and do the page by page processing then...rather than dumping this\n // all here.\n for (PDPage page : pdDocument.getPages()) {\n startPage(page);\n endPage(page);\n }\n\n }", "public void startProcessingImage() {\n if (loadBitmap()) {\n this.mImageProcessHelper.start(this.mBitmap);\n }\n }", "public void startCrawl() throws IOException {\n\t\tElements paragraphs = wf.fetchWikipedia(source);\n\t\tqueueInternalLinks(paragraphs);\n\n\t\t// loop until we index a new page\n\t\tString res;\n\t\tdo {\n\t\t\tres = crawl();\n\n\t\t} while (res == null);\n\t}", "public PDFPageTree(PDFFile file)\n {\n _dict.put(\"Type\", \"/Pages\");\n }", "protected void page () throws HTMLParseException {\r\n while (block.restSize () == 0) {\r\n switch (nextToken) {\r\n case END:\r\n return;\r\n case LT:\r\n lastTagStart = tagStart;\r\n tagmode = true;\r\n match (LT);\r\n tag (lastTagStart);\r\n break;\r\n case COMMENT:\r\n //block.addToken (new Token (pagepart, Token.COMMENT, tagStart, stringLength));\r\n // 2009.05.28 by in-koo cho\r\n addTokenCheck(new Token (pagepart, Token.COMMENT, tagStart, stringLength));\r\n match (COMMENT);\r\n break;\r\n case SCRIPT:\r\n //block.addToken (new Token (pagepart, Token.SCRIPT, tagStart, stringLength));\r\n addTokenCheck(new Token (pagepart, Token.SCRIPT, tagStart, stringLength));\r\n match (SCRIPT);\r\n break;\r\n case STRING:\r\n if(stringLength > -1){\r\n //block.addToken (new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n // 2009.05.28 by in-koo cho\r\n addTokenCheck(new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n }\r\n match (nextToken);\r\n break;\r\n case MT:\r\n if(!tagmode) {\r\n scanString();\r\n }\r\n default:\r\n if(stringLength > -1){\r\n //block.addToken (new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n // 2009.05.28 by in-koo cho\r\n addTokenCheck(new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n }\r\n match (nextToken);\r\n }\r\n }\r\n }", "public Expression preEvaluate(ExpressionVisitor visitor) {\n return this;\n // in principle we could pre-evaluate any call of unparsed-text() with\n // constant arguments. But we don't, because the file contents might\n // change before the stylesheet executes.\n }", "public void startEditingPlanning() {\r\n bpCoordinator.startEditingPlanning();\r\n }", "public static void craft() {\r\n\t\t\r\n\t\tif (ths.page == 5) {\r\n\t\t\tths.page++;\r\n\t\t}\r\n\t}", "public static void expand() {\n Node root = readTrie();\n\n // number of bytes to write\n int length = BinaryStdIn.readInt();\n\n // decode using the Huffman trie\n for (int i = 0; i < length; i++) {\n Node x = root;\n while (!x.isLeaf()) {\n boolean bit = BinaryStdIn.readBoolean();\n if (bit) x = x.right;\n else x = x.left;\n }\n BinaryStdOut.write(x.ch, 8);\n }\n BinaryStdOut.close();\n }", "public void testWithExpansion(String exp, String algo, int fbDocs, int fbTerms, double fbMu, double fbOrigWeight,\n String ref, String fbInitialRankingFile) throws Exception {\n String paramFilePath = generateParameterFile(defaultQueryFilePath, exp, algo, fbDocs, fbTerms, fbMu, fbOrigWeight, ref, fbInitialRankingFile);\n\n // pass the parameter file to main\n String[] args = new String[1];\n args[0] = paramFilePath;\n QryEval.main(args);\n }", "public void partition() \n\t{\n\t\tXPath xPath = getXPathHandler();\n\t\tNodeList parentNodes;\n\t\ttry {\n\t\t\tparentNodes = (NodeList)xPath.compile(this.getParentContainerXPath()).evaluate(this.document, XPathConstants.NODESET);\n\t\t\t\n\t\t\tlogger.info(\">>> \" + this.getPartitionType().name() + \" Partitioner: partition()\");\n\t\t\t\n\t\t\tfor (int i = 0; i < parentNodes.getLength(); i++) \n\t\t\t{ \t\n\t\t\t\tNode parentNode = (Node)parentNodes.item(i);\n\t\t\t\t\n\t\t\t\tif (parentNode instanceof Element)\n\t\t\t\t{\n\t\t\t\t\tString sParentClass = parentNode.getAttributes().getNamedItem(\"class\") != null ? parentNode.getAttributes().getNamedItem(this.getMatchingAttributeName()).getNodeValue() : \"\";\n\t\t\t\t\tlogger.info(\"\\tParent Node Name=\" + parentNode.getNodeName()+\":class=\"+ sParentClass);\n\t\t\t\t\t\n\t\t\t\t\tNodeList nodeList = parentNode.getChildNodes();\n\t\t\t\t\tNode xDivNode = null;\n\t\t\t\t\t\n\t\t\t\t\tNode xIntroDivNode = this.document.createElement(\"div\");\n\t\t\t\t\t((Element)xIntroDivNode).setAttribute(\"class\", this.getPartitionTypeAsString());\n\t\t\t\t\t((Element)xIntroDivNode).setAttribute(\"title\", this.getIntroPartitionTitle());\n\t\t\t\t\t\n\t\t\t\t\tboolean first = true;\n\t\t\t\t\tboolean keepFirst = this.getKeepFirstElements();\n\t\t\t\t\tboolean hasIntroNode = false;\n\t\t\t \n\t\t\t\t\tfor (int j = 0, pCount = 0; j < nodeList.getLength(); j++) \n\t\t\t\t\t{ \t\n\t\t\t \tNode xNode = nodeList.item(j);\n\t\t\t \tif (xNode instanceof Element)\n\t\t\t \t{\n\t\t\t \t\tif (first && keepFirst)\n\t\t\t \t\t{\n\t\t\t \t\t\tif (!hasIntroNode) {\n\t\t\t\t \t\t\t((Element)xIntroDivNode).setAttribute(\"id\", Integer.toString(++pCount));\n\t\t\t \t\t\t\tDomUtils.insertBefore(xIntroDivNode, xNode);\t\t \t\t\t\t\n\t\t\t\t \t\t\tj++;\n\t\t\t\t \t\t\thasIntroNode = true;\n\t\t\t \t\t\t}\n\t\t\t \t\t}\n\t\t\t \t\t\n\t\t\t \t\tString sClass = xNode.getAttributes().getNamedItem(\"class\") != null ? xNode.getAttributes().getNamedItem(this.getMatchingAttributeName()).getNodeValue() : \"\";\n\t\t\t\t \tboolean isTable = xNode.getNodeName().equalsIgnoreCase(\"table\") ? true : false;\n\t\t\t\t \tString sId = isTable && xNode.getAttributes().getNamedItem(\"id\") != null ? xNode.getAttributes().getNamedItem(\"id\").getNodeValue() : \"\";\n\t\t\t\t \t\n\t\t\t\t \tif (sClass != null)\n\t\t\t\t \t{\n\t\t\t\t \t\tlogger.info(\"\\tNode Name=\" + xNode.getNodeName()+\":class=\"+ sClass);\n\t\t\t\t \t\t\n\t\t\t\t \t\tboolean match = false;\n\t\t\t\t \t\tswitch ((TaskExprType)this.getAttributeMatchExpression())\n\t\t\t\t \t\t{\n\t\t\t\t \t\tcase NOT_SET:\n\t\t\t\t \t\tcase STARTS_WITH:\n\t\t\t\t \t\t\tmatch = sClass.startsWith(this.getMatchingAttributeValue());\n\t\t\t\t \t\t\tbreak;\n\t\t\t\t \t\tcase CONTAINS:\n\t\t\t\t \t\t\tmatch = sClass.contains(this.getMatchingAttributeValue());\n\t\t\t\t \t\t\tbreak;\n\t\t\t\t \t\t}\n\t\t\t\t \t\t\n\t\t\t\t \t\t// Process the title name match condition if it exists\n\t\t\t\t \t\tString title = null;\n\t\t\t\t \t\tif (match)\n\t\t\t\t \t\t{\n\t\t\t\t \t\t\ttitle = DomUtils.extractTextChildren(xNode);\n\t\t\t\t \t\t\t\n\t\t\t\t \t\t\tif (this.isTitleNameMatchCondition())\n\t\t\t\t \t\t\t{\n\t\t\t\t\t \t\t\tif (title != null && this.getTitleNameMatchType() == TaskMatchType.EXPR)\n\t\t\t\t\t \t\t\t{\n\t\t\t\t\t \t\t\t\tswitch ((TaskExprType)this.getTitleNameMatchExprType())\n\t\t\t\t\t \t\t\t\t{\n\t\t\t\t\t \t\t\t\t\tcase STARTS_WITH:\n\t\t\t\t\t \t\t\t\t\t\tmatch = title.startsWith(this.getTitleNameMatchExprValue());\n\t\t\t\t\t \t\t\t\t\t\tbreak;\n\t\t\t\t\t \t\t\t\t\tcase CONTAINS:\n\t\t\t\t\t \t\t\t\t\t\tmatch = title.contains(this.getTitleNameMatchExprValue());\n\t\t\t\t\t \t\t\t\t\t\tbreak;\n\t\t\t\t\t \t\t\t\t\tcase NOT_SET:\n\t\t\t\t\t \t\t\t\t\t\tbreak;\n\t\t\t\t\t \t\t\t\t\tdefault:\n\t\t\t\t\t \t\t\t\t\t\tbreak;\n\t\t\t\t\t \t\t\t\t}\n\t\t\t\t\t \t\t\t\t\n\t\t\t\t\t \t\t\t} else if (this.getTitleNameMatchType() == TaskMatchType.REGEX)\n\t\t\t\t\t \t\t\t{\n\t\t\t\t\t\t \t\t\tPattern r = Pattern.compile(this.getTitleNameMatchRegexPattern());\t\t\t \t\t\t\n\t\t\t\t\t\t \t\t\tMatcher m = r.matcher(title);\t\t\t \t\t\t\n\t\t\t\t\t\t \t\t\tmatch = m.matches();\n\t\t\t\t\t \t\t\t}\n\t\t\t\t \t\t\t}\n\t\t\t\t \t\t}\n\t\t\t\t \t\t\n\t\t\t\t \t\tif (match)\n\t\t\t\t \t\t{\n\t\t\t\t \t\t\tif (first)\n\t\t\t\t \t\t\t{\n\t\t\t\t \t\t\t\tPartition partition = new Partition();\n\t\t\t\t \t\t\t\tpartition.setType(this.getPartitionType());\n\t\t\t\t \t\t\t\tpartition.setsId(sId);\n\t\t\t\t \t\t\t\tthis.setFirstPartition(partition);\n\t\t\t\t \t\t\t}\n\n\t\t\t\t \t\t\tfirst = false;\n\t\t\t\t \t\t\t\n\t\t\t\t \t\t\tif (this.isTitleNameReplaceCondition())\n\t\t\t\t \t\t\t{\n\t\t\t\t \t\t\t\tPattern r = Pattern.compile(this.getTitleNameReplaceRegexPattern());\t\t\t \t\t\t\n\t\t\t\t\t \t\t\tMatcher m = r.matcher(title);\t\n\t\t\t\t\t \t\t\ttitle = m.replaceAll(this.getTitleNameReplaceWithRegexPattern());\n\t\t\t\t \t\t\t}\n\t\t\t\t \t\t\t\n\t\t\t\t \t\t\txDivNode = this.document.createElement(\"div\");\n\t\t\t\t \t\t\t((Element)xDivNode).setAttribute(\"class\", getPartitionTypeAsString());\n\t\t\t\t \t\t\t((Element)xDivNode).setAttribute(\"title\", title);\n\t\t\t\t \t\t\t((Element)xDivNode).setAttribute(\"id\", Integer.toString(++pCount));\n\t\t\t\t \t\t\t\n\t\t\t\t \t\t\tDomUtils.insertBefore(xDivNode, xNode);\n\t\t\t\t \t\t\tDomUtils.removeElement((Element) xNode, false);\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// Skip over all nodes leading up to the first Heading1 node\n\t\t\t\t \t\t\tif (!first && xDivNode != null)\n\t\t\t\t \t\t\t{\n\t\t\t\t \t\t\t\txDivNode.appendChild(xNode);\n\t\t\t\t \t\t\t\tj--;\n\t\t\t\t \t\t\t}\n\t\t\t\t \t\t\telse if (first && keepFirst && xIntroDivNode != null)\n\t\t\t\t \t\t\t{\n\t\t\t\t \t\t\t\txIntroDivNode.appendChild(xNode);\n\t\t\t\t \t\t\t\tj--;\n\t\t\t\t \t\t\t}\n\t\t\t\t \t\t}\n\t\t\t\t \t} else if (isTable && sId != null)\n\t\t\t\t \t{\n\t\t\t\t \t\tlogger.info(\"\\t\\tNode Name=\" + xNode.getNodeName()+\":id=\"+ sId);\n\t\t\t \t\t\t// Skip over all nodes leading up to the first Heading1 node\n\t\t\t \t\t\tif (!first && xDivNode != null)\n\t\t\t \t\t\t{\n\t\t\t \t\t\t\txDivNode.appendChild(xNode);\n\t\t\t \t\t\t\tj--;\n\t\t\t \t\t\t}\n\t\t\t \t\t\telse if (first && keepFirst && xIntroDivNode != null)\n\t\t\t \t\t\t{\n\t\t\t \t\t\t\txIntroDivNode.appendChild(xNode);\n\t\t\t \t\t\t\tj--;\n\t\t\t \t\t\t}\n\t\t\t\t \t}\t \t\n\t\t\t \t}\n\t\t\t } // end for j\n\t\t\t\t} // end if parentNode\n\t\t\t} // end for i\n\t\t} catch (XPathExpressionException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\t\n\t\t\n\t}", "@Override\n\tpublic void preorder() {\n\n\t}", "@Override\r\n\tprotected void doPre() {\n\t\t\r\n\t}", "private ContentScanner(\n ContentScanner parentLevel\n )\n {\n this.parentLevel = parentLevel;\n this.contents = parentLevel.contents;\n this.objects = ((CompositeObject)parentLevel.getCurrent()).getObjects();\n\n moveStart();\n }", "protected abstract void preRun();", "@Override\n public void open()\n {\n if (totalPages == 1) {\n Inventory inventory = Bukkit.createInventory(null, calcSize(contents.size()), title);\n int slot = 0;\n for (ItemStack item : contents)\n {\n inventory.setItem(slot++, item);\n }\n player.internalIgnore(InternalType.PAGES);\n player.get().openInventory(inventory);\n player.stopInternalIgnore(InternalType.PAGES);\n return;\n }\n\n int startPoint = (this.page - 1) * 45;\n List<ItemStack> invContents = Lists.newArrayList();\n\n ItemStack item;\n try {\n while ((item = this.contents.get(startPoint++)) != null) {\n invContents.add(item);\n if (startPoint - ((this.page - 1) * 45) == 45) break;\n }\n }\n catch (IndexOutOfBoundsException ignored) {}\n\n Inventory inventory = Bukkit.createInventory(null, 54, this.title);\n\n int slot = 0;\n for (ItemStack invItem : invContents) {\n inventory.setItem(slot++, invItem);\n }\n\n if (this.page > 1) {\n inventory.setItem(45, PageInventory.BACK_BUTTON);\n }\n if (this.page < this.getPages(this.contents.size())) {\n inventory.setItem(53, PageInventory.FORWARD_BUTTON);\n }\n\n player.internalIgnore(InternalType.PAGES);\n player.get().openInventory(inventory);\n player.stopInternalIgnore(InternalType.PAGES);\n }", "public void expandFile()\n throws IOException\n {\n file.seek(FILE_SIZE);\n for (int i = 0; i < BLOCK_SIZE; i++)\n {\n file.write(0);\n }\n FILE_SIZE += BLOCK_SIZE;\n }", "public final native void setRecurrenceExpansionStart(\n DateTime recurrenceExpansionStart) /*-{\n this.setRecurrenceExpansionStart(recurrenceExpansionStart);\n }-*/;", "public void startEnterSplit() {\n update(this.mDisplayController.getDisplayContext(this.mContext.getDisplayId()).getResources().getConfiguration());\n this.mHomeStackResizable = this.mWindowManagerProxy.applyEnterSplit(this.mSplits, this.mSplitLayout);\n }", "public void loadStartPage()\n\t{\n\t}", "private void expandTree() {\n for (int i=0; i<tree.getRowCount(); i++) {\n tree.expandRow(i);\n }\n }", "public void crawlPage() {\n\t\tlogger.info(\"Starting to crawl \" + page.getLink());\n\t\tconsoleLogger.info(\"Starting to crawl \" + page.getLink());\n\n\t\tDocument document = fetchContent(page);\n\t\tif (document == null)\n\t\t\treturn;\n\n\t\tif (shouldSavePage) {\n\t\t\tsavePage(document, page.getLink());\n\t\t}\n\n\t\tlogger.info(\"Done crawling \" + page.getLink());\n\t}", "public PhySortExOp(int BufferPages) {\n\t\tsuper();\n\t\tB = BufferPages;\n\t\tcount++;\n\t\ttempsubdir += \"sub\" + count + \"/\";\n\t\tPath path = Paths.get(tempsubdir);\n\t\ttry {\n\t\t Files.createDirectories(path);\n\t\t} catch (IOException e) {\n\t\t System.err.println(\"Cannot create directories - \" + e);\n\t\t}\n\t}", "public void expand() {\n openItems();\n }", "private <E> void preOrder(Node root,Action<Integer,E> action) {\n\t\tif(root==null)\n\t\t\treturn;\n\t\t\n\t\t//System.out.println(root.value);\n\t\taction.execute(root.value);\n\n\t\tpreOrder(root.left,action);\n\t\t\n\t\tpreOrder(root.right,action);\n\t\t\n\t}" ]
[ "0.56001973", "0.55557406", "0.55117196", "0.5220115", "0.5134528", "0.5066738", "0.4977499", "0.48120797", "0.4781387", "0.4772974", "0.47208568", "0.4704169", "0.46980783", "0.46980783", "0.46677345", "0.46538433", "0.46323854", "0.46284458", "0.46248245", "0.4619657", "0.46111095", "0.46072692", "0.460708", "0.46015757", "0.45868933", "0.45830205", "0.45693654", "0.4562718", "0.4558708", "0.4537192", "0.45261273", "0.45135605", "0.45088014", "0.4469134", "0.446529", "0.44651577", "0.44609633", "0.44480026", "0.44433329", "0.44330493", "0.442792", "0.44166586", "0.44002607", "0.4398614", "0.43870592", "0.4385503", "0.43758798", "0.43661344", "0.43626684", "0.4358901", "0.43527806", "0.43443567", "0.434428", "0.43319488", "0.43263784", "0.43255863", "0.43251517", "0.43208206", "0.43201932", "0.4315468", "0.43094376", "0.43087685", "0.42956287", "0.42956287", "0.42956287", "0.42956287", "0.4293446", "0.42932618", "0.4287591", "0.4275506", "0.42748085", "0.42598668", "0.42544922", "0.42469555", "0.42432103", "0.42317608", "0.4227961", "0.42264855", "0.42243767", "0.41883907", "0.41716826", "0.41688034", "0.4167295", "0.41614363", "0.4157774", "0.41540256", "0.41459158", "0.41229922", "0.41196233", "0.41179544", "0.41164088", "0.41142708", "0.41133282", "0.41118923", "0.4104884", "0.4103599", "0.41019404", "0.40975878", "0.40864402", "0.4086131" ]
0.59526074
0
Starts the expansion process of a preprocessed page.
private LazyPreprocessedPage expand( ExpansionCallback callback, PageTitle title, LazyPreprocessedPage ppAst, EntityMap entityMap, Map<String, AstNode> arguments, boolean forInclusion, ExpansionFrame rootFrame, ExpansionFrame parentFrame, ContentNode parentLog) throws CompilerException { PpResolverLog log = new PpResolverLog(); parentLog.getContent().add(log); if (arguments == null) arguments = new HashMap<String, AstNode>(); StopWatch stopWatch = new StopWatch(); stopWatch.start(); try { ExpansionFrame frame; if (rootFrame != null) { frame = new ExpansionFrame( this, callback, title, entityMap, arguments, forInclusion, rootFrame, parentFrame, ppAst.getWarnings(), log); } else { frame = new ExpansionFrame( this, callback, title, entityMap, ppAst.getWarnings(), log); } LazyPreprocessedPage expanded = (LazyPreprocessedPage) frame.expand(ppAst); return expanded; } catch (Throwable e) { logger.error("Resolution failed!", e); StringWriter w = new StringWriter(); e.printStackTrace(new PrintWriter(w)); log.getContent().add(new UnhandledException(e, w.toString())); throw new CompilerException("Resolution failed!", e); } finally { stopWatch.stop(); log.setTimeNeeded(stopWatch.getElapsedTime()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void startContent() {\n iTextContext.pageNumber().startMainMatter();\n }", "private LazyPreprocessedPage expand(\n\t ExpansionCallback callback,\n\t PageTitle title,\n\t LazyPreprocessedPage ppAst,\n\t EntityMap entityMap,\n\t LinkedHashMap<String, AstNode> arguments,\n\t boolean forInclusion,\n\t ContentNode parentLog)\n\t throws CompilerException\n\t{\n\t\treturn expand(\n\t\t callback,\n\t\t title,\n\t\t ppAst,\n\t\t entityMap,\n\t\t arguments,\n\t\t forInclusion,\n\t\t null,\n\t\t null,\n\t\t parentLog);\n\t}", "protected CompiledPage preprocessAndExpand(\n\t ExpansionCallback callback,\n\t PageId pageId,\n\t String wikitext,\n\t boolean forInclusion,\n\t EntityMap entityMap,\n\t Map<String, AstNode> arguments,\n\t ExpansionFrame rootFrame,\n\t ExpansionFrame parentFrame)\n\t throws CompilerException\n\t{\n\t\tif (pageId == null)\n\t\t\tthrow new NullPointerException();\n\t\t\n\t\tif (wikitext == null)\n\t\t\tthrow new NullPointerException();\n\t\t\n\t\tPageTitle title = pageId.getTitle();\n\t\t\n\t\tCompilerLog log = new CompilerLog();\n\t\tlog.setTitle(title.getFullTitle());\n\t\tlog.setRevision(pageId.getRevision());\n\t\t\n\t\tLazyPreprocessedPage pprAst;\n\t\ttry\n\t\t{\n\t\t\tString validatedWikitext =\n\t\t\t validate(title, wikitext, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage ppAst =\n\t\t\t preprocess(title, validatedWikitext, forInclusion, entityMap, log);\n\t\t\t\n\t\t\tpprAst = expand(\n\t\t\t callback,\n\t\t\t title,\n\t\t\t ppAst,\n\t\t\t entityMap,\n\t\t\t arguments,\n\t\t\t forInclusion,\n\t\t\t rootFrame,\n\t\t\t parentFrame,\n\t\t\t log);\n\t\t}\n\t\tcatch (CompilerException e)\n\t\t{\n\t\t\te.attachLog(log);\n\t\t\tthrow e;\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tthrow new CompilerException(\"Compilation failed!\", e, log);\n\t\t}\n\t\t\n\t\treturn new CompiledPage(\n\t\t new Page(pprAst.getContent()),\n\t\t pprAst.getWarnings(),\n\t\t log);\n\t}", "@Override\n public void process(Page page) {\n PageStore.prePage = page.getHtml().toString();\n }", "@Override\n\tpublic void process(Page page) {\n\t\t\n\t}", "public void startPage() {\n\t\tthis.dataComposer.startPage();\n\t}", "public void process(Page page) {\n\t\t\t\tgetContent(page);\n\t\t\t}", "public ProcessPage() {\n\t\tPageFactory.initElements(driver, this);\n\t\t \n\n\t}", "public void run() {\n getPage(page + 1, false);\n }", "@Override\n\tpublic void loadPrePage() {\n\t\t\n\t\tif(curr_content.isFirstPage){\n\t\t\tPigAndroidUtil.showToast(mContext, \"以是第一页:\", 3000);\n\t\t}else{\n\t\t\texchangePre(m_bookFactory.getPrePageContent(pre_content));\n\t\t}\n\t}", "void preProcess();", "public CompiledPage preprocess(\n\t PageId pageId,\n\t String wikitext,\n\t boolean forInclusion,\n\t ExpansionCallback callback)\n\t throws CompilerException\n\t{\n\t\tif (pageId == null)\n\t\t\tthrow new NullPointerException();\n\t\t\n\t\tPageTitle title = pageId.getTitle();\n\t\t\n\t\tCompilerLog log = new CompilerLog();\n\t\tlog.setTitle(title.getFullTitle());\n\t\tlog.setRevision(pageId.getRevision());\n\t\t\n\t\tLazyPreprocessedPage pprAst;\n\t\ttry\n\t\t{\n\t\t\tEntityMap entityMap = new EntityMap();\n\t\t\t\n\t\t\tString validatedWikitext =\n\t\t\t validate(title, wikitext, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage ppAst =\n\t\t\t preprocess(title, validatedWikitext, forInclusion, entityMap, log);\n\t\t\t\n\t\t\tpprAst = ppAst;\n\t\t\tif (callback != null)\n\t\t\t\tpprAst = expand(callback, title, ppAst, entityMap, null, false, log);\n\t\t}\n\t\tcatch (CompilerException e)\n\t\t{\n\t\t\te.attachLog(log);\n\t\t\tthrow e;\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tthrow new CompilerException(\"Compilation failed!\", e, log);\n\t\t}\n\t\t\n\t\treturn new CompiledPage(\n\t\t new Page(pprAst.getContent()),\n\t\t pprAst.getWarnings(),\n\t\t log);\n\t}", "public void start() {\n if (editor == null) {\n return;\n }\n \n DocumentManager.register(doc, styledText, documentManager);\n \n preCode = doc.get();\n \n super.start();\n }", "public void start(){\n\t\tboolean readFromFile = readFromIndex();\r\n\t\tif (!readFromFile){\t\r\n\t\t\tfor (int i = 0;i<1000;++i){\r\n\t\t\t\tString file = \"../crawler/pages/page\"+i+\".html\";\r\n\t\t\t\taddFile(file);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "void startPage(RequestContextHolder request);", "public void run()\n {\n mkdStack = translateMacroStack(mkdStack);\n //translate mkd to html\n translateMkdToHtml();\n //send html string to global variable\n Compiler.htmlString = htmlStackToString();\n }", "public void startOver() {\n this.pagesRead = 0;\n }", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\n\t\tmPagefactory.setBgBitmap(BitmapFactory.decodeResource(\n\t\t\t\tthis.getResources(), myImageIds[sPosition]));\n\t\ttry {\n\t\t\tmPagefactory.openbook(mFilenameString);\n\t\t\tmPagefactory.onDraw(mCurPageCanvas);\n\t\t} catch (IOException e1) {\n\t\t\te1.printStackTrace();\n\t\t\tToast.makeText(this, \"error\", Toast.LENGTH_SHORT).show();\n\t\t}\n\t\tmPageWidget.setBitmaps(mCurPageBitmap, mCurPageBitmap);\n\t\tif (sFlag == 1) {\n\t\t\ttry {\n\t\t\t\tmPagefactory.jumpPage(ReaderDataBase.search(this,\n\t\t\t\t\t\t\"LastReadProcess\", mFilenameString));\n\n\t\t\t\tauto();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void preprocess() {\n }", "public void preprocess() {\n }", "public void preprocess() {\n }", "public void preprocess() {\n }", "void setPageStart(short start);", "public static void craft() {\r\n\t\t\r\n\t\tif (ths.page == 5) {\r\n\t\t\tths.page++;\r\n\t\t}\r\n\t}", "protected void page () throws HTMLParseException {\r\n while (block.restSize () == 0) {\r\n switch (nextToken) {\r\n case END:\r\n return;\r\n case LT:\r\n lastTagStart = tagStart;\r\n tagmode = true;\r\n match (LT);\r\n tag (lastTagStart);\r\n break;\r\n case COMMENT:\r\n //block.addToken (new Token (pagepart, Token.COMMENT, tagStart, stringLength));\r\n // 2009.05.28 by in-koo cho\r\n addTokenCheck(new Token (pagepart, Token.COMMENT, tagStart, stringLength));\r\n match (COMMENT);\r\n break;\r\n case SCRIPT:\r\n //block.addToken (new Token (pagepart, Token.SCRIPT, tagStart, stringLength));\r\n addTokenCheck(new Token (pagepart, Token.SCRIPT, tagStart, stringLength));\r\n match (SCRIPT);\r\n break;\r\n case STRING:\r\n if(stringLength > -1){\r\n //block.addToken (new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n // 2009.05.28 by in-koo cho\r\n addTokenCheck(new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n }\r\n match (nextToken);\r\n break;\r\n case MT:\r\n if(!tagmode) {\r\n scanString();\r\n }\r\n default:\r\n if(stringLength > -1){\r\n //block.addToken (new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n // 2009.05.28 by in-koo cho\r\n addTokenCheck(new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n }\r\n match (nextToken);\r\n }\r\n }\r\n }", "@Override\n\tpublic void process(Task task, Page page) {\n\t\t\n\t}", "@Override\n\tpublic void addPages() {\n\t\tthis.mainPage = new SNLFilePage(this.workbench, this.selection);\n\t\tthis.addPage(this.mainPage);\n\t}", "public CompiledPage postprocess(\n\t PageId pageId,\n\t String wikitext,\n\t ExpansionCallback callback)\n\t throws CompilerException\n\t{\n\t\tif (pageId == null)\n\t\t\tthrow new NullPointerException();\n\t\t\n\t\tPageTitle title = pageId.getTitle();\n\t\t\n\t\tCompilerLog log = new CompilerLog();\n\t\tlog.setTitle(title.getFullTitle());\n\t\tlog.setRevision(pageId.getRevision());\n\t\t\n\t\tLazyParsedPage pAst;\n\t\ttry\n\t\t{\n\t\t\tEntityMap entityMap = new EntityMap();\n\t\t\t\n\t\t\tString validatedWikitext =\n\t\t\t validate(title, wikitext, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage ppAst =\n\t\t\t preprocess(title, validatedWikitext, false, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage pprAst = ppAst;\n\t\t\tif (callback != null)\n\t\t\t\tpprAst = expand(callback, title, ppAst, entityMap, null, false, log);\n\t\t\t\n\t\t\tpAst = parse(title, pprAst, entityMap, log);\n\t\t\t\n\t\t\tpAst = postprocess(title, pAst, log);\n\t\t}\n\t\tcatch (CompilerException e)\n\t\t{\n\t\t\te.attachLog(log);\n\t\t\tthrow e;\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tthrow new CompilerException(\"Compilation failed!\", e, log);\n\t\t}\n\t\t\n\t\treturn new CompiledPage(\n\t\t new Page(pAst.getContent()),\n\t\t pAst.getWarnings(),\n\t\t log);\n\t}", "@Override\n public void run() {\n for (int pg = PreviewPanel.this.firstPage; pg < PreviewPanel.this.firstPage\n + PreviewPanel.this.pageRange; pg++) {\n PreviewPanel.this.pagePanels[pg - PreviewPanel.this.firstPage]\n .setPage(pg);\n }\n revalidate();\n }", "@Override\n\tpublic void startProcessing() {\n\n\t}", "public void preProcess(HttpServletRequest arg0, ContentList contentList) {\n\r\n\t}", "public void run() {\n try {\r\n TransformerFactory tFactory = TransformerFactory.newInstance();\r\n // Fortify Mod: prevent external entity injection\r\n tFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);\r\n Transformer transformer = tFactory.newTransformer();\r\n transformer.setOutputProperty(\"encoding\", \"UTF-8\");\r\n transformer.setOutputProperty(\"indent\", \"yes\");\r\n transformer.transform(new DOMSource(doc), new StreamResult(\r\n pos));\r\n } catch (Exception e) {\r\n throw new RuntimeException(\r\n \"Error converting Document to InputStream. \"\r\n + e.getMessage());\r\n } finally {\r\n try {\r\n pos.close();\r\n } catch (IOException e) {\r\n\r\n }\r\n }\r\n }", "abstract protected void pre(int code);", "public void start() {\n process(0);\n }", "public void onQsExpansionStarted() {\n onQsExpansionStarted(0);\n }", "protected abstract StackManipulation preparation();", "@Override\n public void open()\n {\n if (totalPages == 1) {\n Inventory inventory = Bukkit.createInventory(null, calcSize(contents.size()), title);\n int slot = 0;\n for (ItemStack item : contents)\n {\n inventory.setItem(slot++, item);\n }\n player.internalIgnore(InternalType.PAGES);\n player.get().openInventory(inventory);\n player.stopInternalIgnore(InternalType.PAGES);\n return;\n }\n\n int startPoint = (this.page - 1) * 45;\n List<ItemStack> invContents = Lists.newArrayList();\n\n ItemStack item;\n try {\n while ((item = this.contents.get(startPoint++)) != null) {\n invContents.add(item);\n if (startPoint - ((this.page - 1) * 45) == 45) break;\n }\n }\n catch (IndexOutOfBoundsException ignored) {}\n\n Inventory inventory = Bukkit.createInventory(null, 54, this.title);\n\n int slot = 0;\n for (ItemStack invItem : invContents) {\n inventory.setItem(slot++, invItem);\n }\n\n if (this.page > 1) {\n inventory.setItem(45, PageInventory.BACK_BUTTON);\n }\n if (this.page < this.getPages(this.contents.size())) {\n inventory.setItem(53, PageInventory.FORWARD_BUTTON);\n }\n\n player.internalIgnore(InternalType.PAGES);\n player.get().openInventory(inventory);\n player.stopInternalIgnore(InternalType.PAGES);\n }", "public void startCrawl() throws IOException {\n\t\tElements paragraphs = wf.fetchWikipedia(source);\n\t\tqueueInternalLinks(paragraphs);\n\n\t\t// loop until we index a new page\n\t\tString res;\n\t\tdo {\n\t\t\tres = crawl();\n\n\t\t} while (res == null);\n\t}", "public void loadStartPage()\n\t{\n\t}", "private LazyPreprocessedPage preprocess(\n\t PageTitle title,\n\t String validatedWikitext,\n\t boolean forInclusion,\n\t EntityMap entityMap,\n\t ContentNode parentLog)\n\t throws CompilerException\n\t{\n\t\tPreprocessorLog log = new PreprocessorLog();\n\t\tparentLog.getContent().add(log);\n\t\t\n\t\tlog.setForInclusion(forInclusion);\n\t\t\n\t\tStopWatch stopWatch = new StopWatch();\n\t\tstopWatch.start();\n\t\t\n\t\ttry\n\t\t{\n\t\t\tLazyPreprocessor preprocessor = new LazyPreprocessor(wikiConfig);\n\t\t\t\n\t\t\tLazyPreprocessedPage preprocessedAst =\n\t\t\t (LazyPreprocessedPage) preprocessor.parseArticle(\n\t\t\t validatedWikitext,\n\t\t\t title.getFullTitle(),\n\t\t\t forInclusion);\n\t\t\t\n\t\t\treturn preprocessedAst;\n\t\t}\n\t\tcatch (xtc.parser.ParseException e)\n\t\t{\n\t\t\tlog.getContent().add(new ParseException(e.getMessage()));\n\t\t\t\n\t\t\tthrow new CompilerException(\"Preprocessing failed!\", e);\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tlogger.error(\"Preprocessing failed!\", e);\n\t\t\t\n\t\t\tStringWriter w = new StringWriter();\n\t\t\te.printStackTrace(new PrintWriter(w));\n\t\t\tlog.getContent().add(new UnhandledException(e, w.toString()));\n\t\t\t\n\t\t\tthrow new CompilerException(\"Preprocessing failed!\", e);\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tstopWatch.stop();\n\t\t\tlog.setTimeNeeded(stopWatch.getElapsedTime());\n\t\t}\n\t}", "public NewCZ_DPPHRProcessPage(){ super(); }", "public void startRecord() {\n\t\tcmd = new StartRecordCommand(editor);\n\t\tinvoker = new MiniEditorInvoker(cmd);\n\t\tinvoker.action();\n\t}", "void retrievePageContents()\n\t{\n\t\tStringBuilder longString = new StringBuilder();\n\t\tfor (int i = 0; i < pageContents.size(); i++)\n\t\t{\n\t\t\tlongString.append(pageContents.get(i));\n\t\t}\n\t\tString pageMarkup = longString.toString().toLowerCase();\n\t\textractComments(pageMarkup);\n\n\t}", "@Override\n public void run() {\n List<File> files = getContents(TOP_LEVEL + \" and \" + NOT_TRASHED + \" and \" + FOLDER + \" and \" + NOT_SPREADSHEET);\n \n prune(targetDir, files);\n processLanguages(files);\n }", "protected void doAdditionalPageInitialization(IPage page) {\n }", "protected abstract void preRun();", "@Test\n public void testExtractTextFromPage()\n {\n PDFExtractor instance = new PDFExtractor();\n \n int page = 0;\n String expResult = page1;\n String result = instance.extractTextFromPage(pathToFile, page);\n \n assertEquals(expResult, result);\n \n page = 1;\n expResult = page2;\n result = instance.extractTextFromPage(pathToFile, page);\n assertEquals(expResult, result);\n }", "protected void auto() {\n\t\tmPagefactory.onDraw(mCurPageCanvas);\n\t\tmPageWidget.setBitmaps(mCurPageBitmap, mNextPageBitmap);\n\t\tmPageWidget.startAnimation(1000);\n\t}", "public void pageSwitch(String filename) throws IOException {\n pageSwitch(null, filename, stage);\n }", "@Override\n public void textFileLoaded(File file, int wc, String contents)\n {\n cur_file = file;\n this.action_panel.setWordCount(wc);\n \n new Thread(new MarkdownProcessor(file, this)).start();\n }", "@Override\n public void preprocess() {\n }", "@Override\n\tpublic void onLoadMore() {\n\t\tpage++;\n\t\texecutorService.submit(new Runnable() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\ttry {\n\t\t\t\t\tgetResultByKeyword(page);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public Iterator_BuildTextExpansion_ clone(CallContext context);", "public void startPrinting()\n {\n printerSimulator.startPrintingProcess();\n }", "public void prepare() {\n this.taskHandler.run(this::inlinePrepare);\n }", "public void startProcess() {\r\n\t\tprocess = true;\r\n\t}", "@Override\r\n\tprotected void doPre() {\n\t\t\r\n\t}", "public demandPaging(int machineSize, int pageSize, int processSize, int numReferencesPerProcess, int jobType, int totalNumPages,\n String replacementType){\n //set all args inputs\n this.machineSize = machineSize;\n this.pageSize = pageSize;\n this.processSize = processSize;\n this.numReferencesPerProcess = numReferencesPerProcess;\n this.jobType = jobType;\n this.totalNumPages = totalNumPages;\n this.replacementType = replacementType;\n\n //initialize processes and frameTable\n processes = new ArrayList<process>();\n frameTable = new frameTable(totalNumPages, totalNumPages);\n\n //fill processes array according to jobMix\n getJobMixAndMakeProcesses();\n\n\n }", "public void process(Page page) {\n \n \tpage.putField(\"title\", page.getHtml().xpath(\"//h1[@id='title']/span[@id='productTitle']/text()\").toString());\n if (page.getResultItems().get(\"title\")==null){\n //skip this page\n page.setSkip(true);\n }\n \n page.putField(\"style\", page.getHtml().xpath(\"//div[@id='variation_style_name']/div[@class='a-row']/span[@class='selection']/text()\"));\n page.putField(\"size\", page.getHtml().xpath(\"//div[@id='variation_size_name']/div[@class='a-row']/span[@class='selection']/text()\"));\n page.putField(\"color\", page.getHtml().xpath(\"//div[@id='variation_color_name']/div[@class='a-row']/span[@class='selection']/text()\"));\n \n page.putField(\"price\", page.getHtml().xpath(\"//span[@id='priceblock_ourprice']/text()\"));\n \n resultItems = page.getResultItems();\n System.out.println(page.getResultItems().toString());\n }", "public void run() {\n int lastpage = 0xFFFFFFFF - 0xFFF;\n Page P = (Page) MAGIC.cast2Struct(lastpage);\n P.data[0] = 2;\n\n }", "public void parsePage() {\n seen = true;\n int first = id.indexOf('_', 0);\n int second = id.indexOf('_', first + 1);\n String firstDir = \"result_\" + id.substring(0, first);\n String secondDir = id.substring(0, second);\n String fileName = id + \".page\";\n String wholePath = pagePath + firstDir + File.separator + secondDir\n + File.separator + fileName;\n try {\n BufferedReader reader = new BufferedReader(new FileReader(wholePath));\n String line = null;\n while((line = reader.readLine()) != null) {\n if (line.equals(\"#ThisURL#\")) {\n url = reader.readLine();\n }\n// else if (line.equals(\"#Length#\")) {\n// length = Integer.parseInt(reader.readLine());\n// }\n else if (line.equals(\"#Title#\")) {\n title = reader.readLine();\n }\n else if (line.equals(\"#Content#\")) {\n content = reader.readLine();\n lowerContent = content.toLowerCase();\n break;\n }\n }\n reader.close();\n if (content == null) {\n return;\n }\n valid = true;\n } catch (IOException e) {\n// System.out.println(\"Parse page \" + id + \" not successful\");\n }\n }", "public void run() {\n\t\t\t\t\t\tif (__delayCounter == _delayCounter[0]) {\r\n\t\t\t\t\t\t\t_pageBook.showPage(__page);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}", "@Override\n\tpublic void process(Page page){\n\n\t CollectTemplate collectTemplate = templateService.getCollectTemplateById(templateId);\n\t String currentUrl=page.getUrl().toString();\n\t String nextUrlXpath=collectTemplate.getNextUrlXpath();\n \tString contentUrlXpath=collectTemplate.getContentUrlXpath();\n \tString listUrlRegex=collectTemplate.getListUrlRegex();\n \tString contentUrlRegex=collectTemplate.getContentUrlRegex();\n \tList<CollectTemplateField> fields=collectTemplate.getFields();\n \ttry {\n\t \t\t\n\t \tHtml currentHtml= page.getHtml();\n\n\t\t\t//判断是否是列表页\n\t if (currentUrl.matches(listUrlRegex)) {\n\n\t\t\t\t//处理列表页\n\t\t\t\tString nextPageUrl=\"\";\n\t\t\t\ttry{\n\t\t\t\t\tnextPageUrl=currentHtml.xpath(nextUrlXpath).toString();\n\t\t\t\t\tif (nextPageUrl==null||StringUtils.isEmpty(nextPageUrl)){\n\t\t\t\t\t\tthrow new Exception();\n\t\t\t\t\t}\n\t\t\t\t}catch (Exception e){\n\t\t\t\t\tXpath2Selector xpath2Selector = new Xpath2Selector(nextUrlXpath);\n\t\t\t\t\tnextPageUrl = xpath2Selector.select(page.getRawText());\n\n\t\t\t\t\tif (nextPageUrl!=null&&nextPageUrl.startsWith(\"/\")){\n\t\t\t\t\t\tnextPageUrl = \"http://\"+site.getDomain()+nextPageUrl;\n\t\t\t\t\t}\n\n\n\t\t\t\t}\n\n\t \tif (StringUtils.isNotEmpty(nextPageUrl)) {\n\n\t \t\tRequest request=new Request();\n\t \t\trequest.setUrl(nextPageUrl);\n\t \t\trequest.setPriority(-1);\n\t \t\t\n\t \t\tpage.addTargetRequest(request);\n\n\t \t\tlogService.info(projectId,\"get the next page link \"+nextPageUrl+\" and add it to the queue\");\n\n\t\t\t\t}else{\n\t\t\t\t\tlogService.warn(projectId,\"fail to get the next page link\");\n\n\t\t\t\t}\n\t \tList<String> detailPagesUrl;\n\t \ttry{\n\t\t\t\t\tdetailPagesUrl = currentHtml.xpath(contentUrlXpath).all();\n\n\t\t\t\t}catch (Exception e){\n\n\t\t\t\t\tXpath2Selector xpath2Selector2 = new Xpath2Selector(contentUrlXpath);\n\t\t\t\t\tdetailPagesUrl = xpath2Selector2.selectList(currentHtml.getDocument().text());\n\t\t\t\t}\n\n\n\n\t \tif (detailPagesUrl!=null&&detailPagesUrl.size()!=0) {\n\t\t\t\t\t//添加详情页\n\t\t\t\t\tpage.addTargetRequests(detailPagesUrl, 1);\n\n\t\t\t\t\tlogService.info(projectId,\"get \"+detailPagesUrl.size()+\" detail pages\");\n\t\t\t\t}else{\n\t\t\t\t\tlogService.warn(projectId,\"fail to get detail page\");\n\n\t\t\t\t}\n\t\t\t}else if (StringUtils.isEmpty(contentUrlRegex)||currentUrl.matches(contentUrlRegex)) {\n\t \t//处理详情页\n\t\t\t\tcontentPageProcessService.setProjectId(projectId);\n\t\t\t\tcontentPageProcessService.progressContentPage(page,fields);\n\t\t\t}\n\t \t} catch (Exception e) {\n\t\t\t\tSystem.out.println(e);\n\t\t\t}\n\t \n\t }", "private void setUpPageItem() {\n displaylimit = xmlhandler.getItemDisplayLimit();\n itemrow = inventory.getItemRow();\n Back.setEnabled(false);\n Begin.setEnabled(false);\n if(getPageEnd()==1) {\n Forward.setEnabled(false);\n End.setEnabled(false);\n }\n }", "public void startpager() {\n\t\thandlers.postDelayed(runnable, 2000);\n// \t final Timer timer = new Timer();\n//\t TimerTask task = new TimerTask(){\n//\t public void run(){\n//\t\n//\t }\n//\t };\n//\t timer.schedule(task, 0,2000);\n\t}", "@Override\n public void preprocess() {\n }", "private void nextPage(int offset) {\n\t\tif (offset == 1) {\n\t\t\tthis.pagesView.doAction(Actions.ACTION_FULL_PAGE_DOWN);\n\t\t} else if (offset == -1) {\n\t\t\tthis.pagesView.doAction(Actions.ACTION_FULL_PAGE_UP);\n\t\t} else {\n\t\t\tthrow new IllegalArgumentException(\"invalid offset: \" + offset);\n\t\t}\n\t\tif (this.textReflowMode) {\n\t\t\tint page = this.pagesView.getCurrentPage();\n\t\t\tString text = this.pdf.getText(page);\n\t\t\tif (text == null) text = \"\";\n\t\t\ttext = text.trim();\n\t\t\tthis.textReflowTextView.setText(text);\n\t\t\tthis.textReflowScrollView.scrollTo(0,0);\n\t\t}\n\t}", "public void nextPage() {\n\t\tthis.skipEntries += NUM_PER_PAGE;\n\t\tloadEntries();\n\t}", "public void crawlPage() {\n\t\tlogger.info(\"Starting to crawl \" + page.getLink());\n\t\tconsoleLogger.info(\"Starting to crawl \" + page.getLink());\n\n\t\tDocument document = fetchContent(page);\n\t\tif (document == null)\n\t\t\treturn;\n\n\t\tif (shouldSavePage) {\n\t\t\tsavePage(document, page.getLink());\n\t\t}\n\n\t\tlogger.info(\"Done crawling \" + page.getLink());\n\t}", "@Override\r\n\tpublic void mypage() {\n\t\t\r\n\t}", "public void setStartPage(java.math.BigInteger startPage)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STARTPAGE$12);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(STARTPAGE$12);\n }\n target.setBigIntegerValue(startPage);\n }\n }", "public void startEditingPlanning() {\r\n bpCoordinator.startEditingPlanning();\r\n }", "@Override\n protected void processPages(PDPageTree pages) throws IOException {\n\n List<ObjectRef> pageRefs = new ArrayList<>();\n //STEP 1: get the page refs\n findPages(pdDocument.getPages().getCOSObject().getItem(COSName.KIDS), pageRefs);\n //confirm the right number of pages was found\n if (pageRefs.size() != pdDocument.getNumberOfPages()) {\n throw new IOException(new TikaException(\n \"Couldn't find the right number of page refs (\" + pageRefs.size() +\n \") for pages (\" + pdDocument.getNumberOfPages() + \")\"));\n }\n\n PDStructureTreeRoot structureTreeRoot =\n pdDocument.getDocumentCatalog().getStructureTreeRoot();\n\n //STEP 2: load the roleMap\n Map<String, HtmlTag> roleMap = loadRoleMap(structureTreeRoot.getRoleMap());\n\n //STEP 3: load all of the text, mapped to MCIDs\n Map<MCID, String> paragraphs = loadTextByMCID(pageRefs);\n\n //STEP 4: now recurse the the structure tree root and output the structure\n //and the text bits from paragraphs\n\n try {\n recurse(structureTreeRoot.getK(), null, 0, paragraphs, roleMap);\n } catch (SAXException e) {\n throw new IOException(e);\n }\n\n //STEP 5: handle all the potentially unprocessed bits\n try {\n if (state.hrefAnchorBuilder.length() > 0) {\n xhtml.startElement(\"p\");\n writeString(state.hrefAnchorBuilder.toString());\n xhtml.endElement(\"p\");\n }\n for (MCID mcid : paragraphs.keySet()) {\n if (!state.processedMCIDs.contains(mcid)) {\n if (mcid.mcid > -1) {\n //TODO: LOG! piece of text that wasn't referenced in the marked content\n // tree\n // but should have been. If mcid == -1, this was a known item not part of\n // content tree.\n }\n\n xhtml.startElement(\"p\");\n writeString(paragraphs.get(mcid));\n xhtml.endElement(\"p\");\n }\n }\n } catch (SAXException e) {\n throw new IOException(e);\n }\n //Step 6: for now, iterate through the pages again and do all the other handling\n //TODO: figure out when we're crossing page boundaries during the recursion\n // step above and do the page by page processing then...rather than dumping this\n // all here.\n for (PDPage page : pdDocument.getPages()) {\n startPage(page);\n endPage(page);\n }\n\n }", "private void forwardPage()\n {\n page++;\n open();\n }", "public void start() {\n currExam = wordExamQueue.poll();\n displayExam(currExam);\n }", "public void setStartPage(int value) {\n this.startPage = value;\n }", "public void prepare() {\n // make sure the user didn't hide the sketch folder\n ensureExistence();\n\n current.setProgram(editor.getText());\n\n // TODO record history here\n //current.history.record(program, SketchHistory.RUN);\n\n // if an external editor is being used, need to grab the\n // latest version of the code from the file.\n if (Preferences.getBoolean(\"editor.external\")) {\n // history gets screwed by the open..\n //String historySaved = history.lastRecorded;\n //handleOpen(sketch);\n //history.lastRecorded = historySaved;\n\n // set current to null so that the tab gets updated\n // http://dev.processing.org/bugs/show_bug.cgi?id=515\n current = null;\n // nuke previous files and settings, just get things loaded\n load();\n }\n\n // in case there were any boogers left behind\n // do this here instead of after exiting, since the exit\n // can happen so many different ways.. and this will be\n // better connected to the dataFolder stuff below.\n cleanup();\n\n// // handle preprocessing the main file's code\n// return build(tempBuildFolder.getAbsolutePath());\n }", "private void outputProcessedCode() {\n\t\tif (isProcessed()) {\n\t\t\tgetLauncher().prettyprint();\n\t\t}\n\t}", "@Override\n protected void preSequencePreparations() {\n //initializing the HTML sequence report:\n htmlReport = new HtmlSequenceReport(scenarioCount, sequenceCount);\n // updating scenarioCount based on existing HTML files - sequence 1 gets the correct scenarioCount:\n scenarioCount = htmlReport.getScenarioCount();\n }", "protected void doPreEntryActions(RequestControlContext context) throws FlowExecutionException {\r\n\r\n\t}", "protected void prepareToExecuteChildren()\n \t{\n \t\tcollectExecutableElements();\n \t}", "@Override\n public void setProcessorContent(ie.gmit.java2.parser.LinesMap lines) {\n this.processor.setLines(lines);\n }", "@Override\n\tpublic void run() {\n\t\tIterable<Page> allPages = new Pages(this.numPages, this.fileName);\n\t\tfor (Page pg : allPages) {\n\t\t\ttry {\n\t\t\t\tqueue.put(pg);\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\tfor(int i=0;i<this.numThread;i++){\n\t\t\ttry {\n\t\t\t\tqueue.put(new PoisonPill());\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}", "public void step() {\n try {\n int code = memory[pc];\n nextCode(code);\n pc++;\n dp.refresh(pc, stackRegister, compareRegister);\n } catch (Exception e) {\n con.cPrintln(\"Error : \" + e.toString());\n\n } catch (Error e) {\n con.cPrintln(\"Error : \" + e.getMessage());\n }\n }", "private void parsePageForNewLines() {\n\t\tArrayList<String> escapeOpenText = new ArrayList<String>();\n\t\tArrayList<String> escapeCloseText = new ArrayList<String>();\n\t\tescapeOpenText.add(\"<!--\");\n\t\tescapeCloseText.add(\"-->\");\n\n\t\tfor (int i = 0; i != -1; i = rawText.indexOf('\\n', i+1)) {\n\t\t\tif (isPositionParsedAsMediawiki(i, escapeOpenText, escapeCloseText)) {\n\t\t\t\tlinePositions.add(i);\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void preExecution() {\n\t\tshowProgressBar();\n\t}", "public void renitialiser() \n\t{\n\t\tbuffer = new byte[Constants.PAGESIZE];\n\t\tidDeLaPage = null;\n\t\tpin_count = 0;\n\t\tflagDirty = 0;\n\t\testCharge = false;\n\t}", "public Expression preEvaluate(ExpressionVisitor visitor) {\n return this;\n // in principle we could pre-evaluate any call of unparsed-text() with\n // constant arguments. But we don't, because the file contents might\n // change before the stylesheet executes.\n }", "@Override\n public void eval(final AbraModule module)\n {\n clearSizes(module);\n\n // single pass over everything\n super.eval(module);\n\n // some sizes may have been indeterminable for now due to recursion\n resolveRecursions(module);\n }", "public void process() {\n\t\tSystem.out.println(\"snapdragonm 888\");\n\n\t}", "private void start() {\n\t\twhile(!navi.pathCompleted())\n\t\t{\n\t\t\tThread.yield();\n\t\t\t\n\t\t}\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "public void entryPanelProcess() {\n\t\tif (nmfkpinds.funKey03() || nmfkpinds.funKey12()) {\n\t\t\treturn;\n\t\t}\n\t\tstateVariable.setZmsage(blanks(78));\n\t\t// Action command keys\n\t\tif (nmfkpinds.pgmInd28()) {\n\t\t\tcmdkey();\n\t\t}\n\t\telse {\n\t\t\t// Else action selections\n\t\t\tzselec();\n\t\t}\n\t\tmainline0();\n\t\treturn;\n\t}", "public ContentScanner(\n Contents contents\n )\n {\n this.parentLevel = null;\n this.objects = this.contents = contents;\n\n moveStart();\n }", "public void xsetStartPage(com.a9.spec.opensearch.x11.QueryType.StartPage startPage)\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.a9.spec.opensearch.x11.QueryType.StartPage target = null;\n target = (com.a9.spec.opensearch.x11.QueryType.StartPage)get_store().find_attribute_user(STARTPAGE$12);\n if (target == null)\n {\n target = (com.a9.spec.opensearch.x11.QueryType.StartPage)get_store().add_attribute_user(STARTPAGE$12);\n }\n target.set(startPage);\n }\n }", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "public void run() {\r\n\t\t\r\n\t\t// While the PC is less than allocated memory and less than SP\r\n\t\twhile (getPC() < getLIM() && getPC() < getSP()) {\r\n\t\t\tm_instr = m_MMU.fetch(getPC());\r\n\t\t\t// Increment PC counter by Instruction Size now\r\n\t\t\t// since nowhere lower does it get called again\r\n\t\t\tsetPC(getPC() + INSTRSIZE);\r\n\t\t\t\r\n\t //increment clock\r\n addTicks(1);\r\n\t\t\t\r\n\t\t\tif (m_verbose) {\r\n\t\t\t\tregDump();\r\n\t\t\t\tprintInstr(m_instr);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Parse and execute instruction\r\n\t\t\texecuteInstr(m_instr);\r\n\t\t\t\r\n\t\t\t// check interrupts\r\n\t\t\tcheckForIOInterrupt();\r\n\t\t}\r\n\t\t\r\n\t}", "public void startProcessingImage() {\n if (loadBitmap()) {\n this.mImageProcessHelper.start(this.mBitmap);\n }\n }", "public CompiledPage parse(\n\t PageId pageId,\n\t String wikitext,\n\t ExpansionCallback callback)\n\t throws CompilerException\n\t{\n\t\tif (pageId == null)\n\t\t\tthrow new NullPointerException();\n\t\t\n\t\tPageTitle title = pageId.getTitle();\n\t\t\n\t\tCompilerLog log = new CompilerLog();\n\t\tlog.setTitle(title.getFullTitle());\n\t\tlog.setRevision(pageId.getRevision());\n\t\t\n\t\tLazyParsedPage pAst;\n\t\ttry\n\t\t{\n\t\t\tEntityMap entityMap = new EntityMap();\n\t\t\t\n\t\t\tString validatedWikitext =\n\t\t\t validate(title, wikitext, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage ppAst =\n\t\t\t preprocess(title, validatedWikitext, false, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage pprAst = ppAst;\n\t\t\tif (callback != null)\n\t\t\t\tpprAst = expand(callback, title, ppAst, entityMap, null, false, log);\n\t\t\t\n\t\t\tpAst = parse(title, pprAst, entityMap, log);\n\t\t}\n\t\tcatch (CompilerException e)\n\t\t{\n\t\t\te.attachLog(log);\n\t\t\tthrow e;\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tthrow new CompilerException(\"Compilation failed!\", e, log);\n\t\t}\n\t\t\n\t\treturn new CompiledPage(\n\t\t new Page(pAst.getContent()),\n\t\t pAst.getWarnings(),\n\t\t log);\n\t}", "public void addPages() {\t\t\n\t\tpage1 = new Opera2ActionsTransformationWizardPage1(selection, operaModel);\n\t\taddPage(page1);\t\n\t}", "public synchronized void showPage() {\n final ShowPageImage viewer = new ShowPageImage();\n\n if (SwingUtilities.isEventDispatchThread()) {\n viewer.run();\n } else {\n SwingUtilities.invokeLater(viewer);\n }\n }" ]
[ "0.59388196", "0.59241074", "0.5800829", "0.5785093", "0.57142055", "0.5620554", "0.5425743", "0.54217523", "0.52921385", "0.526845", "0.52362645", "0.5218579", "0.52119", "0.5202978", "0.5141135", "0.51153296", "0.5107414", "0.5081298", "0.50664496", "0.50664496", "0.50664496", "0.50664496", "0.5043944", "0.50393516", "0.49999166", "0.4977734", "0.4972343", "0.49589363", "0.4955999", "0.4880926", "0.48620087", "0.48605976", "0.48185086", "0.47909415", "0.47899476", "0.47549418", "0.47508353", "0.46772763", "0.4664572", "0.4657018", "0.4653321", "0.46478203", "0.46451905", "0.46440896", "0.46381363", "0.4632992", "0.46287668", "0.4625389", "0.4623766", "0.46061894", "0.46055847", "0.46048334", "0.45975268", "0.45971057", "0.45759302", "0.45717815", "0.45609498", "0.4556691", "0.4554905", "0.45526895", "0.4542864", "0.45404136", "0.45402926", "0.4536665", "0.45212755", "0.4514298", "0.45124328", "0.45109177", "0.4506926", "0.45030484", "0.44977847", "0.44932732", "0.44890177", "0.4480294", "0.4473188", "0.44576138", "0.44562486", "0.44541097", "0.44373822", "0.44365603", "0.44250476", "0.4422539", "0.44190365", "0.44115466", "0.44096228", "0.439124", "0.43871486", "0.43793365", "0.43791363", "0.43781435", "0.43780047", "0.4364496", "0.43570703", "0.43558407", "0.43531492", "0.43438277", "0.43396294", "0.43370947", "0.43369037", "0.43358722" ]
0.55447936
6
Parses a preprocessed page and substitutes entities.
private LazyParsedPage parse( PageTitle title, LazyPreprocessedPage ppAst, EntityMap entityMap, ContentNode parentLog) throws CompilerException { ParserLog log = new ParserLog(); parentLog.getContent().add(log); StopWatch stopWatch = new StopWatch(); stopWatch.start(); try { PreprocessedWikitext preprocessedWikitext = PreprocessorToParserTransformer.transform( ppAst, entityMap, true); LazyParser parser = new LazyParser(wikiConfig); LazyParsedPage parsedAst = (LazyParsedPage) parser.parseArticle( preprocessedWikitext, title.getTitle()); parsedAst.getWarnings().addAll(ppAst.getWarnings()); return parsedAst; } catch (xtc.parser.ParseException e) { log.getContent().add(new ParseException(e.getMessage())); throw new CompilerException("Parsing failed!", e); } catch (Throwable e) { logger.error("Parsing failed!", e); StringWriter w = new StringWriter(); e.printStackTrace(new PrintWriter(w)); log.getContent().add(new UnhandledException(e, w.toString())); throw new CompilerException("Parsing failed!", e); } finally { stopWatch.stop(); log.setTimeNeeded(stopWatch.getElapsedTime()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void process(Page page) {\n PageStore.prePage = page.getHtml().toString();\n }", "@Override\n\tpublic void process(Page page) {\n\t\t\n\t}", "public void process(Page page) {\n\t\t\t\tgetContent(page);\n\t\t\t}", "protected void page () throws HTMLParseException {\r\n while (block.restSize () == 0) {\r\n switch (nextToken) {\r\n case END:\r\n return;\r\n case LT:\r\n lastTagStart = tagStart;\r\n tagmode = true;\r\n match (LT);\r\n tag (lastTagStart);\r\n break;\r\n case COMMENT:\r\n //block.addToken (new Token (pagepart, Token.COMMENT, tagStart, stringLength));\r\n // 2009.05.28 by in-koo cho\r\n addTokenCheck(new Token (pagepart, Token.COMMENT, tagStart, stringLength));\r\n match (COMMENT);\r\n break;\r\n case SCRIPT:\r\n //block.addToken (new Token (pagepart, Token.SCRIPT, tagStart, stringLength));\r\n addTokenCheck(new Token (pagepart, Token.SCRIPT, tagStart, stringLength));\r\n match (SCRIPT);\r\n break;\r\n case STRING:\r\n if(stringLength > -1){\r\n //block.addToken (new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n // 2009.05.28 by in-koo cho\r\n addTokenCheck(new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n }\r\n match (nextToken);\r\n break;\r\n case MT:\r\n if(!tagmode) {\r\n scanString();\r\n }\r\n default:\r\n if(stringLength > -1){\r\n //block.addToken (new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n // 2009.05.28 by in-koo cho\r\n addTokenCheck(new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n }\r\n match (nextToken);\r\n }\r\n }\r\n }", "@Override\n protected void processPages(PDPageTree pages) throws IOException {\n\n List<ObjectRef> pageRefs = new ArrayList<>();\n //STEP 1: get the page refs\n findPages(pdDocument.getPages().getCOSObject().getItem(COSName.KIDS), pageRefs);\n //confirm the right number of pages was found\n if (pageRefs.size() != pdDocument.getNumberOfPages()) {\n throw new IOException(new TikaException(\n \"Couldn't find the right number of page refs (\" + pageRefs.size() +\n \") for pages (\" + pdDocument.getNumberOfPages() + \")\"));\n }\n\n PDStructureTreeRoot structureTreeRoot =\n pdDocument.getDocumentCatalog().getStructureTreeRoot();\n\n //STEP 2: load the roleMap\n Map<String, HtmlTag> roleMap = loadRoleMap(structureTreeRoot.getRoleMap());\n\n //STEP 3: load all of the text, mapped to MCIDs\n Map<MCID, String> paragraphs = loadTextByMCID(pageRefs);\n\n //STEP 4: now recurse the the structure tree root and output the structure\n //and the text bits from paragraphs\n\n try {\n recurse(structureTreeRoot.getK(), null, 0, paragraphs, roleMap);\n } catch (SAXException e) {\n throw new IOException(e);\n }\n\n //STEP 5: handle all the potentially unprocessed bits\n try {\n if (state.hrefAnchorBuilder.length() > 0) {\n xhtml.startElement(\"p\");\n writeString(state.hrefAnchorBuilder.toString());\n xhtml.endElement(\"p\");\n }\n for (MCID mcid : paragraphs.keySet()) {\n if (!state.processedMCIDs.contains(mcid)) {\n if (mcid.mcid > -1) {\n //TODO: LOG! piece of text that wasn't referenced in the marked content\n // tree\n // but should have been. If mcid == -1, this was a known item not part of\n // content tree.\n }\n\n xhtml.startElement(\"p\");\n writeString(paragraphs.get(mcid));\n xhtml.endElement(\"p\");\n }\n }\n } catch (SAXException e) {\n throw new IOException(e);\n }\n //Step 6: for now, iterate through the pages again and do all the other handling\n //TODO: figure out when we're crossing page boundaries during the recursion\n // step above and do the page by page processing then...rather than dumping this\n // all here.\n for (PDPage page : pdDocument.getPages()) {\n startPage(page);\n endPage(page);\n }\n\n }", "private LazyPreprocessedPage preprocess(\n\t PageTitle title,\n\t String validatedWikitext,\n\t boolean forInclusion,\n\t EntityMap entityMap,\n\t ContentNode parentLog)\n\t throws CompilerException\n\t{\n\t\tPreprocessorLog log = new PreprocessorLog();\n\t\tparentLog.getContent().add(log);\n\t\t\n\t\tlog.setForInclusion(forInclusion);\n\t\t\n\t\tStopWatch stopWatch = new StopWatch();\n\t\tstopWatch.start();\n\t\t\n\t\ttry\n\t\t{\n\t\t\tLazyPreprocessor preprocessor = new LazyPreprocessor(wikiConfig);\n\t\t\t\n\t\t\tLazyPreprocessedPage preprocessedAst =\n\t\t\t (LazyPreprocessedPage) preprocessor.parseArticle(\n\t\t\t validatedWikitext,\n\t\t\t title.getFullTitle(),\n\t\t\t forInclusion);\n\t\t\t\n\t\t\treturn preprocessedAst;\n\t\t}\n\t\tcatch (xtc.parser.ParseException e)\n\t\t{\n\t\t\tlog.getContent().add(new ParseException(e.getMessage()));\n\t\t\t\n\t\t\tthrow new CompilerException(\"Preprocessing failed!\", e);\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tlogger.error(\"Preprocessing failed!\", e);\n\t\t\t\n\t\t\tStringWriter w = new StringWriter();\n\t\t\te.printStackTrace(new PrintWriter(w));\n\t\t\tlog.getContent().add(new UnhandledException(e, w.toString()));\n\t\t\t\n\t\t\tthrow new CompilerException(\"Preprocessing failed!\", e);\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tstopWatch.stop();\n\t\t\tlog.setTimeNeeded(stopWatch.getElapsedTime());\n\t\t}\n\t}", "public void parsePage() {\n seen = true;\n int first = id.indexOf('_', 0);\n int second = id.indexOf('_', first + 1);\n String firstDir = \"result_\" + id.substring(0, first);\n String secondDir = id.substring(0, second);\n String fileName = id + \".page\";\n String wholePath = pagePath + firstDir + File.separator + secondDir\n + File.separator + fileName;\n try {\n BufferedReader reader = new BufferedReader(new FileReader(wholePath));\n String line = null;\n while((line = reader.readLine()) != null) {\n if (line.equals(\"#ThisURL#\")) {\n url = reader.readLine();\n }\n// else if (line.equals(\"#Length#\")) {\n// length = Integer.parseInt(reader.readLine());\n// }\n else if (line.equals(\"#Title#\")) {\n title = reader.readLine();\n }\n else if (line.equals(\"#Content#\")) {\n content = reader.readLine();\n lowerContent = content.toLowerCase();\n break;\n }\n }\n reader.close();\n if (content == null) {\n return;\n }\n valid = true;\n } catch (IOException e) {\n// System.out.println(\"Parse page \" + id + \" not successful\");\n }\n }", "@Override\n public void visit(Page page) {\n String url = page.getWebURL().getURL();\n System.out.println(\"URL: \" + url);\n\n try {\n if (page.getParseData() instanceof HtmlParseData) {\n HtmlParseData htmlParseData = (HtmlParseData) page.getParseData();\n\n final Document document = Jsoup.parse(htmlParseData.getHtml());\n\n Transformer transformer = TransformerFactory.newInstance()\n .newTransformer(new StreamSource(getClass().getResourceAsStream(xslPath)));\n\n Writer write = new StringWriter();\n transformer.transform(new DOMSource(new W3CDom().fromJsoup(document)), new StreamResult(write));\n\n String xml = write.toString();\n\n // XML 1.1\n // [#x1-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]\n String xml11pattern = \"[^\"\n + \"\\u0001-\\uD7FF\"\n + \"\\uE000-\\uFFFD\"\n + \"\\ud800\\udc00-\\udbff\\udfff\"\n + \"]+\";\n\n // remove invalid character in xml\n xml = xml.replaceAll(xml11pattern, \"\");\n\n JAXBContext jc = JAXBContext.newInstance(ProxyListDTO.class);\n\n Unmarshaller unmarshaller = jc.createUnmarshaller();\n ProxyListDTO data = (ProxyListDTO) unmarshaller.unmarshal(new StringReader(xml));\n data.getProxies().forEach(p -> p.setSource(source));\n\n\n result.addAll(data.getProxies());\n }\n } catch (Exception e) {\n logger.error(\"fail to visit \" + url, e);\n }\n }", "public Collection<String> parse(Reader page)\r\n\t{\n\r\n\t\ttry\r\n\t\t{\r\n\t\t\t\r\n\t\t\t//create an input source to parse from the stream\r\n\t\t\tInputSource pageInputSource = new InputSource(page);\r\n\t\t\t\r\n\t\t\t// parse page\r\n\t\t\tp.parse(pageInputSource);\r\n\t\t\t\r\n\t\t\treturn linkContextHandler.removeLinkStrings();\r\n\t\t} catch (IOException e)\r\n\t\t{\r\n\r\n\t\t\tLogger.log(0, this.getClass().getSimpleName(), \"parse\",\r\n\t\t\t\t\t\"input error, couldn't parse page: \" + e.toString());\r\n\t\t} catch (SAXException e)\r\n\t\t{\r\n\t\t\tLogger.log(0, this.getClass().getSimpleName(), \"parse\",\r\n\t\t\t\t\t\"SAX exception, tag soup couldn't parse page: \"\r\n\t\t\t\t\t\t\t+ e.toString());\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}", "void retrievePageContents()\n\t{\n\t\tStringBuilder longString = new StringBuilder();\n\t\tfor (int i = 0; i < pageContents.size(); i++)\n\t\t{\n\t\t\tlongString.append(pageContents.get(i));\n\t\t}\n\t\tString pageMarkup = longString.toString().toLowerCase();\n\t\textractComments(pageMarkup);\n\n\t}", "private void parseEntities() {\n // See: https://github.com/twitter/twitter-text/tree/master/java\n entities.addExtractedEntities(TweetEntityAbstract.entitiesExtractor.extractCashtagsWithIndices(getText()));\n entities.addExtractedEntities(TweetEntityAbstract.entitiesExtractor.extractHashtagsWithIndices(getText()));\n entities.addExtractedEntities(TweetEntityAbstract.entitiesExtractor.extractMentionedScreennamesWithIndices(getText()));\n }", "public void process(Page page) {\n \n \tpage.putField(\"title\", page.getHtml().xpath(\"//h1[@id='title']/span[@id='productTitle']/text()\").toString());\n if (page.getResultItems().get(\"title\")==null){\n //skip this page\n page.setSkip(true);\n }\n \n page.putField(\"style\", page.getHtml().xpath(\"//div[@id='variation_style_name']/div[@class='a-row']/span[@class='selection']/text()\"));\n page.putField(\"size\", page.getHtml().xpath(\"//div[@id='variation_size_name']/div[@class='a-row']/span[@class='selection']/text()\"));\n page.putField(\"color\", page.getHtml().xpath(\"//div[@id='variation_color_name']/div[@class='a-row']/span[@class='selection']/text()\"));\n \n page.putField(\"price\", page.getHtml().xpath(\"//span[@id='priceblock_ourprice']/text()\"));\n \n resultItems = page.getResultItems();\n System.out.println(page.getResultItems().toString());\n }", "private void parseRawText() {\n\t\t//1-new lines\n\t\t//2-pageObjects\n\t\t//3-sections\n\t\t//Clear any residual data.\n\t\tlinePositions.clear();\n\t\tsections.clear();\n\t\tpageObjects.clear();\n\t\tcategories.clear();\n\t\tinterwikis.clear();\n\t\t\n\t\t//Generate data.\n\t\tparsePageForNewLines();\n\t\tparsePageForPageObjects();\n\t\tparsePageForSections();\n\t}", "public CompiledPage postprocess(\n\t PageId pageId,\n\t String wikitext,\n\t ExpansionCallback callback)\n\t throws CompilerException\n\t{\n\t\tif (pageId == null)\n\t\t\tthrow new NullPointerException();\n\t\t\n\t\tPageTitle title = pageId.getTitle();\n\t\t\n\t\tCompilerLog log = new CompilerLog();\n\t\tlog.setTitle(title.getFullTitle());\n\t\tlog.setRevision(pageId.getRevision());\n\t\t\n\t\tLazyParsedPage pAst;\n\t\ttry\n\t\t{\n\t\t\tEntityMap entityMap = new EntityMap();\n\t\t\t\n\t\t\tString validatedWikitext =\n\t\t\t validate(title, wikitext, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage ppAst =\n\t\t\t preprocess(title, validatedWikitext, false, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage pprAst = ppAst;\n\t\t\tif (callback != null)\n\t\t\t\tpprAst = expand(callback, title, ppAst, entityMap, null, false, log);\n\t\t\t\n\t\t\tpAst = parse(title, pprAst, entityMap, log);\n\t\t\t\n\t\t\tpAst = postprocess(title, pAst, log);\n\t\t}\n\t\tcatch (CompilerException e)\n\t\t{\n\t\t\te.attachLog(log);\n\t\t\tthrow e;\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tthrow new CompilerException(\"Compilation failed!\", e, log);\n\t\t}\n\t\t\n\t\treturn new CompiledPage(\n\t\t new Page(pAst.getContent()),\n\t\t pAst.getWarnings(),\n\t\t log);\n\t}", "protected CompiledPage preprocessAndExpand(\n\t ExpansionCallback callback,\n\t PageId pageId,\n\t String wikitext,\n\t boolean forInclusion,\n\t EntityMap entityMap,\n\t Map<String, AstNode> arguments,\n\t ExpansionFrame rootFrame,\n\t ExpansionFrame parentFrame)\n\t throws CompilerException\n\t{\n\t\tif (pageId == null)\n\t\t\tthrow new NullPointerException();\n\t\t\n\t\tif (wikitext == null)\n\t\t\tthrow new NullPointerException();\n\t\t\n\t\tPageTitle title = pageId.getTitle();\n\t\t\n\t\tCompilerLog log = new CompilerLog();\n\t\tlog.setTitle(title.getFullTitle());\n\t\tlog.setRevision(pageId.getRevision());\n\t\t\n\t\tLazyPreprocessedPage pprAst;\n\t\ttry\n\t\t{\n\t\t\tString validatedWikitext =\n\t\t\t validate(title, wikitext, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage ppAst =\n\t\t\t preprocess(title, validatedWikitext, forInclusion, entityMap, log);\n\t\t\t\n\t\t\tpprAst = expand(\n\t\t\t callback,\n\t\t\t title,\n\t\t\t ppAst,\n\t\t\t entityMap,\n\t\t\t arguments,\n\t\t\t forInclusion,\n\t\t\t rootFrame,\n\t\t\t parentFrame,\n\t\t\t log);\n\t\t}\n\t\tcatch (CompilerException e)\n\t\t{\n\t\t\te.attachLog(log);\n\t\t\tthrow e;\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tthrow new CompilerException(\"Compilation failed!\", e, log);\n\t\t}\n\t\t\n\t\treturn new CompiledPage(\n\t\t new Page(pprAst.getContent()),\n\t\t pprAst.getWarnings(),\n\t\t log);\n\t}", "public void preprocess() {\n }", "public void preprocess() {\n }", "public void preprocess() {\n }", "public void preprocess() {\n }", "public CompiledPage preprocess(\n\t PageId pageId,\n\t String wikitext,\n\t boolean forInclusion,\n\t ExpansionCallback callback)\n\t throws CompilerException\n\t{\n\t\tif (pageId == null)\n\t\t\tthrow new NullPointerException();\n\t\t\n\t\tPageTitle title = pageId.getTitle();\n\t\t\n\t\tCompilerLog log = new CompilerLog();\n\t\tlog.setTitle(title.getFullTitle());\n\t\tlog.setRevision(pageId.getRevision());\n\t\t\n\t\tLazyPreprocessedPage pprAst;\n\t\ttry\n\t\t{\n\t\t\tEntityMap entityMap = new EntityMap();\n\t\t\t\n\t\t\tString validatedWikitext =\n\t\t\t validate(title, wikitext, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage ppAst =\n\t\t\t preprocess(title, validatedWikitext, forInclusion, entityMap, log);\n\t\t\t\n\t\t\tpprAst = ppAst;\n\t\t\tif (callback != null)\n\t\t\t\tpprAst = expand(callback, title, ppAst, entityMap, null, false, log);\n\t\t}\n\t\tcatch (CompilerException e)\n\t\t{\n\t\t\te.attachLog(log);\n\t\t\tthrow e;\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tthrow new CompilerException(\"Compilation failed!\", e, log);\n\t\t}\n\t\t\n\t\treturn new CompiledPage(\n\t\t new Page(pprAst.getContent()),\n\t\t pprAst.getWarnings(),\n\t\t log);\n\t}", "@Override\r\n\tpublic void visit(Page page) {\r\n\t\t// Some business logic I won't expose here\r\n\t\t// My boss won't be happy ;-)\r\n\t}", "private void processAllPages(final HtmlPage page, final HashMap<String, Object> metaData) {\n int pageNumber = 1;\n\n HtmlPage actualPage = page;\n\n while (actualPage!= null && isPageValid(actualPage)) {\n if (actualPage.getWebResponse().getStatusCode() != HTTP_SUCCESS_CODE) {\n logger.error(\"Received non-200 status code while trying to read from {}.\", actualPage.getUrl());\n throw new UnrecoverableException(\"Crawling failed due to non-200 HTTP response.\");\n }\n\n logger.info(\"Processing page #{}\", pageNumber);\n publishTenders(actualPage, metaData);\n\n logger.debug(\"Data extracted, moving to next page.\");\n pageNumber++;\n\n actualPage = getNextPage(actualPage, pageNumber);\n }\n }", "public ParsedPage parse(String src);", "protected void doAdditionalPageInitialization(IPage page) {\n }", "public ProcessPage() {\n\t\tPageFactory.initElements(driver, this);\n\t\t \n\n\t}", "@Override\n\tpublic void loadPrePage() {\n\t\t\n\t\tif(curr_content.isFirstPage){\n\t\t\tPigAndroidUtil.showToast(mContext, \"以是第一页:\", 3000);\n\t\t}else{\n\t\t\texchangePre(m_bookFactory.getPrePageContent(pre_content));\n\t\t}\n\t}", "@Override\n public void preprocess() {\n }", "public HTMLParser () {\r\n this.pagepart = null;\r\n }", "public HTMLParser (byte[] page) {\r\n //page = parseToHTML(page);\r\n\r\n setText (page);\r\n }", "private void parsePageForNewLines() {\n\t\tArrayList<String> escapeOpenText = new ArrayList<String>();\n\t\tArrayList<String> escapeCloseText = new ArrayList<String>();\n\t\tescapeOpenText.add(\"<!--\");\n\t\tescapeCloseText.add(\"-->\");\n\n\t\tfor (int i = 0; i != -1; i = rawText.indexOf('\\n', i+1)) {\n\t\t\tif (isPositionParsedAsMediawiki(i, escapeOpenText, escapeCloseText)) {\n\t\t\t\tlinePositions.add(i);\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void postParse() {\n\t}", "@Override\n\tpublic void postParse() {\n\t}", "private void handlePP() {\n String inner = document.body().html();\n inner.replaceAll(\"<p></p>\", \"<p>\");\n document.body().html(inner);\n }", "@Override\n\tpublic void visit(Page page) {\n\t\tint docid = page.getWebURL().getDocid();\n\t\tString url = page.getWebURL().getURL();\n\t\tString domain = page.getWebURL().getDomain();\n\t\tString path = page.getWebURL().getPath();\n\t\tString subDomain = page.getWebURL().getSubDomain();\n\t\tString parentUrl = page.getWebURL().getParentUrl();\n\n\t\tSystem.out.println(\"Docid: \" + docid);\n\t\tSystem.out.println(\"URL: \" + url);\n\t\tSystem.out.println(\"Domain: '\" + domain + \"'\");\n\t\tSystem.out.println(\"Sub-domain: '\" + subDomain + \"'\");\n\t\tSystem.out.println(\"Path: '\" + path + \"'\");\n\t\tSystem.out.println(\"Parent page: \" + parentUrl);\n\n\t\tif(page.getParseData() instanceof JavaScriptParseData) {\n\t\t\tSystem.out.println(\"Got an instance of JS Parse DATA!!!!\");\n\t\t\tSystem.out.println(\"Parent Page of JS data is : \" + page.getWebURL().getParentUrl());\n\n\t\t\tJavaScriptParseData jsParseData = (JavaScriptParseData) page.getParseData();\n\t\t\tString jsText = jsParseData.getJs();\n\n\t\t\ttry {\n\t\t\t\tif(DomainTrackerParser.containsTracker(jsText)){\n\t\t\t\t\tdomainTrackerSet.add(url);\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\tif (page.getParseData() instanceof HtmlParseData) {\n\t\t\tHtmlParseData htmlParseData = (HtmlParseData) page.getParseData();\n\t\t\tString text = htmlParseData.getText();\n\t\t\tString html = htmlParseData.getHtml();\n\t\t\tList<WebURL> links = htmlParseData.getOutgoingUrls();\n\n\t\t\tSystem.out.println(\"Text length: \" + text.length());\n\t\t\tSystem.out.println(\"Html length: \" + html.length());\n\t\t\tSystem.out.println(\"Number of outgoing links: \" + links.size());\n\n\t\t\tfor(WebURL webUrl : links) {\n\t\t\t\tString urlString = webUrl.getURL().toString();\n\n\t\t\t\ttry {\n\t\t\t\t\tif(urlString != null && DomainTrackerParser.containsTracker(urlString)) {\n\t\t\t\t\t\tSystem.out.println(\"added a tracker to the set : \" + urlString);\n\t\t\t\t\t\tdomainTrackerSet.add(urlString);\n\t\t\t\t\t}\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n//\t\t\t\tSystem.out.println(\"Outgoing URL : \" + webUrl);\n//\t\t\t\tSystem.out.println(domainTrackerSet);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"=============\");\n\t}", "@Test\n public void testExtractTextFromPage()\n {\n PDFExtractor instance = new PDFExtractor();\n \n int page = 0;\n String expResult = page1;\n String result = instance.extractTextFromPage(pathToFile, page);\n \n assertEquals(expResult, result);\n \n page = 1;\n expResult = page2;\n result = instance.extractTextFromPage(pathToFile, page);\n assertEquals(expResult, result);\n }", "private void processContentEn() {\n if (this.content == null || this.content.equals(\"\")) {\r\n _logger.error(\"{} - The sentence is null or empty\", this.traceId);\r\n }\r\n\r\n // process input using ltp(Segmentation, POS, DP, SRL)\r\n this.nlp = new NLP(this.content, this.traceId, this.setting);\r\n }", "public CompiledPage parse(\n\t PageId pageId,\n\t String wikitext,\n\t ExpansionCallback callback)\n\t throws CompilerException\n\t{\n\t\tif (pageId == null)\n\t\t\tthrow new NullPointerException();\n\t\t\n\t\tPageTitle title = pageId.getTitle();\n\t\t\n\t\tCompilerLog log = new CompilerLog();\n\t\tlog.setTitle(title.getFullTitle());\n\t\tlog.setRevision(pageId.getRevision());\n\t\t\n\t\tLazyParsedPage pAst;\n\t\ttry\n\t\t{\n\t\t\tEntityMap entityMap = new EntityMap();\n\t\t\t\n\t\t\tString validatedWikitext =\n\t\t\t validate(title, wikitext, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage ppAst =\n\t\t\t preprocess(title, validatedWikitext, false, entityMap, log);\n\t\t\t\n\t\t\tLazyPreprocessedPage pprAst = ppAst;\n\t\t\tif (callback != null)\n\t\t\t\tpprAst = expand(callback, title, ppAst, entityMap, null, false, log);\n\t\t\t\n\t\t\tpAst = parse(title, pprAst, entityMap, log);\n\t\t}\n\t\tcatch (CompilerException e)\n\t\t{\n\t\t\te.attachLog(log);\n\t\t\tthrow e;\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tthrow new CompilerException(\"Compilation failed!\", e, log);\n\t\t}\n\t\t\n\t\treturn new CompiledPage(\n\t\t new Page(pAst.getContent()),\n\t\t pAst.getWarnings(),\n\t\t log);\n\t}", "@Override\n\tpublic void process(Page page){\n\n\t CollectTemplate collectTemplate = templateService.getCollectTemplateById(templateId);\n\t String currentUrl=page.getUrl().toString();\n\t String nextUrlXpath=collectTemplate.getNextUrlXpath();\n \tString contentUrlXpath=collectTemplate.getContentUrlXpath();\n \tString listUrlRegex=collectTemplate.getListUrlRegex();\n \tString contentUrlRegex=collectTemplate.getContentUrlRegex();\n \tList<CollectTemplateField> fields=collectTemplate.getFields();\n \ttry {\n\t \t\t\n\t \tHtml currentHtml= page.getHtml();\n\n\t\t\t//判断是否是列表页\n\t if (currentUrl.matches(listUrlRegex)) {\n\n\t\t\t\t//处理列表页\n\t\t\t\tString nextPageUrl=\"\";\n\t\t\t\ttry{\n\t\t\t\t\tnextPageUrl=currentHtml.xpath(nextUrlXpath).toString();\n\t\t\t\t\tif (nextPageUrl==null||StringUtils.isEmpty(nextPageUrl)){\n\t\t\t\t\t\tthrow new Exception();\n\t\t\t\t\t}\n\t\t\t\t}catch (Exception e){\n\t\t\t\t\tXpath2Selector xpath2Selector = new Xpath2Selector(nextUrlXpath);\n\t\t\t\t\tnextPageUrl = xpath2Selector.select(page.getRawText());\n\n\t\t\t\t\tif (nextPageUrl!=null&&nextPageUrl.startsWith(\"/\")){\n\t\t\t\t\t\tnextPageUrl = \"http://\"+site.getDomain()+nextPageUrl;\n\t\t\t\t\t}\n\n\n\t\t\t\t}\n\n\t \tif (StringUtils.isNotEmpty(nextPageUrl)) {\n\n\t \t\tRequest request=new Request();\n\t \t\trequest.setUrl(nextPageUrl);\n\t \t\trequest.setPriority(-1);\n\t \t\t\n\t \t\tpage.addTargetRequest(request);\n\n\t \t\tlogService.info(projectId,\"get the next page link \"+nextPageUrl+\" and add it to the queue\");\n\n\t\t\t\t}else{\n\t\t\t\t\tlogService.warn(projectId,\"fail to get the next page link\");\n\n\t\t\t\t}\n\t \tList<String> detailPagesUrl;\n\t \ttry{\n\t\t\t\t\tdetailPagesUrl = currentHtml.xpath(contentUrlXpath).all();\n\n\t\t\t\t}catch (Exception e){\n\n\t\t\t\t\tXpath2Selector xpath2Selector2 = new Xpath2Selector(contentUrlXpath);\n\t\t\t\t\tdetailPagesUrl = xpath2Selector2.selectList(currentHtml.getDocument().text());\n\t\t\t\t}\n\n\n\n\t \tif (detailPagesUrl!=null&&detailPagesUrl.size()!=0) {\n\t\t\t\t\t//添加详情页\n\t\t\t\t\tpage.addTargetRequests(detailPagesUrl, 1);\n\n\t\t\t\t\tlogService.info(projectId,\"get \"+detailPagesUrl.size()+\" detail pages\");\n\t\t\t\t}else{\n\t\t\t\t\tlogService.warn(projectId,\"fail to get detail page\");\n\n\t\t\t\t}\n\t\t\t}else if (StringUtils.isEmpty(contentUrlRegex)||currentUrl.matches(contentUrlRegex)) {\n\t \t//处理详情页\n\t\t\t\tcontentPageProcessService.setProjectId(projectId);\n\t\t\t\tcontentPageProcessService.progressContentPage(page,fields);\n\t\t\t}\n\t \t} catch (Exception e) {\n\t\t\t\tSystem.out.println(e);\n\t\t\t}\n\t \n\t }", "@Override\n public void preprocess() {\n }", "abstract protected void processHTMLLine(String line);", "public void processDocument(String url) throws PageReadException {\n // TODO: reset the results.\n impossible = false;\n givenUrl = url;\n nextPageLink = null;\n if (!notFirstPage) {\n xmlImages = new ArrayList<String>();\n title = null;\n }\n\n String content = pageReader.readPage(url);\n\n document = Jsoup.parse(content);\n\n if (document.getElementsByTag(\"body\").size() == 0) {\n LOG.error(\"no body to parse \" + url);\n impossible = true;\n throw new PageReadException(\"no body to parse\");\n }\n\n init(); // this needs another name, it does all the work.\n if (readAllPages && nextPageLink != null) {\n try {\n String textSoFar = articleText;\n notFirstPage = true;\n processDocument(nextPageLink);\n if (articleText != null) {\n articleText = textSoFar + articleText;\n }\n } finally {\n notFirstPage = false;\n System.out.println(articleText);\n }\n }\n\n }", "@Before\n\tpublic void setUp() throws Exception {\n\t\tList<Paragraph> paragraphs = new ArrayList<Paragraph>();\n\t\tList<Paragraph> paragraphsWithNoSentences = new ArrayList<Paragraph>();\n\t\t\n\t\tScanner sc = null, sc1 = null;\n\t\ttry {\n\t\t\tsc = new Scanner(new File(\"testsearchtext.txt\"));\n\t\t\tsc1 = new Scanner(new File(\"testsearchentity.txt\"));\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tsc.useDelimiter(\"[.]\");\n\t\tsc1.useDelimiter(\"[|]\");\n\t\t\n\t\tList<Sentence> sentences = new ArrayList<Sentence>();\n\t\tint sCount = 0;\n\t\tint pCount = 0;\n\t\twhile(sc.hasNext()){\n\t\t\tString temp = sc.next().trim();\n\n\t\t\tif(sCount > 0 && (sCount%10 == 0 || !sc.hasNext())){\n\t\t\t\tParagraph p = new Paragraph(pCount);\n\t\t\t\tparagraphsWithNoSentences.add(p);\n\t\t\t\t\n\t\t\t\tp = new Paragraph(pCount);\n\t\t\t\tp.setSentences(sentences);\n\t\t\t\tparagraphs.add(p);\n\t\t\t\tpCount++;\n\t\t\t\t\n\t\t\t\tsentences = new ArrayList<Sentence>();\n\t\t\t}\n\t\t\t\n\t\t\tif(!temp.equals(\"\"))\n\t\t\t\tsentences.add(new Sentence((sCount%10), temp));\n\t\t\t\n\t\t\tsCount++;\n\t\t}\n\t\t\n\t\tList<Entity> entities = new ArrayList<Entity>();\n\t\tint currType = -1; \n\t\twhile(sc1.hasNext()){\n\t\t\tString temp = sc1.next().trim();\n\t\t\tif(temp.equals(\"place\")){currType = Entity.PLACE;} else\n\t\t\tif(temp.equals(\"url\")){currType = Entity.URL;} else\n\t\t\tif(temp.equals(\"email\")){currType = Entity.EMAIL;} else\n\t\t\tif(temp.equals(\"address\")){currType = Entity.ADDRESS;} \n\t\t\telse{\n\t\t\t\tentities.add(new Entity(currType, temp));\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tSource s = new Source(\"testsearchtext.txt\", \"testsearchtext.txt\");\n\t\tpt1 = new ProcessedText(s, paragraphs, null); \n\t\t\n\t\ts = new Source(\"testsearchtext1.txt\", \"testsearchtext1.txt\");\n\t\tpt2 = new ProcessedText(s, paragraphsWithNoSentences, null); \n\t\t\n\t\tpt3 = new ProcessedText();\n\t\tpt3.setParagraphs(paragraphs);\n\t\t\n\t\tpt4 = new ProcessedText();\n\t\ts = new Source(\"testsearchtext2.txt\", \"testsearchtext2.txt\");\n\t\tpt4.setMetadata(s);\n\t\t\n\t\ts = new Source(\"testsearchtext3.txt\", \"testsearchtext3.txt\");\n\t\tpt5 = new ProcessedText(s, paragraphs, entities); \n\t\t\n\t\ts = new Source(\"testsearchtext4.txt\", \"testsearchtext4.txt\");\n\t\tpt6 = new ProcessedText(s, null, entities); \n\t}", "public void handleStatuScode(Page page);", "@Override\n public Page extractPage(String link) {\n\n return new Page(link, extract(link));\n }", "public void refineManualPageBuffer() throws IOException, JSONException {\n\n // parse and refine mark up\n // this.manualPageBuffer -> this.title + this.description ...\n\n String[] lines = manualPageBuffer.split(System.getProperty(\"line.separator\"));\n\n for (int i=0; i < lines.length; i++) {\n\n if (lines[i].contains(\"<h2>\")) {\n if (lines[i].contains(\"Syntax\")) {\n String syn = new String();\n\n while (!lines[i].contains(\"<pre>\")) {\n i++;\n }\n i++;\n if (lines[i].isEmpty()) {\n i++;\n }\n\n while (!lines[i].contains(\"</pre>\")) {\n syn += lines[i];\n i++;\n }\n\n this.syntax = trim(syn);\n System.out.println(\"Syntax : \" + syntax);\n\n }\n else if (lines[i].contains(\"Parameters\")) {\n\n String paramName = \"\";\n String paramInOut = \"\";\n String paramDescription = \"\";\n\n\n\n // TODO retrieve from markup\n\n JsonObject parameters = Json.createObjectBuilder()\n .add(\"name\", paramName)\n .add(\"inout\", paramInOut)\n .add(\"description\", paramDescription)\n .build();\n }\n\n // reference http://www.java2s.com/Tutorials/Java/JSON/0100__JSON_Java.htm\n\n ArrayList<JsonObject> parameters = new ArrayList<JsonObject>();\n\n this.parameters = parameters;\n System.out.println(\"Parameters : \" + this.parameters.toString());\n\n }\n\n\n else if (lines[i].contains(\"Return value\")) {\n\n }\n else if (lines[i].contains(\"Requirements\")) {\n\n }\n else if (lines[i].toLowerCase().contains(\"example\")) {\n\n }\n else if (lines[i].contains(\"See also\")) {\n\n }\n System.out.println(lines[i]);\n }\n\n }", "private void setPageSettings() {\n\n List<Element> paragraphs = br.ufrgs.artic.utils.FileUtils.getElementsByTagName(\"para\", omniPageXMLDocument.getDocumentElement());\n\n int lineCounter = 0;\n int fontSizeSum = 0;\n if (paragraphs != null && !paragraphs.isEmpty()) {\n\n int biggestTop = 0;\n int biggestLeft = 0;\n for (Element paragraphElement : paragraphs) {\n\n List<Element> linesOfParagraph = br.ufrgs.artic.utils.FileUtils.getElementsByTagName(\"ln\", paragraphElement);\n\n if (linesOfParagraph != null && !linesOfParagraph.isEmpty()) {\n for (Element lineElement : linesOfParagraph) {\n String fontFace = lineElement.getAttribute(\"fontFace\");\n\n if (fontFace == null || fontFace.isEmpty()) { //if yes, start run merge process\n augmentLineElement(lineElement);\n }\n\n if (lineElement.getAttribute(\"t\") != null && !lineElement.getAttribute(\"t\").isEmpty() &&\n lineElement.getAttribute(\"l\") != null && !lineElement.getAttribute(\"l\").isEmpty()) {\n int top = Integer.parseInt(lineElement.getAttribute(\"t\").replaceAll(\",\", \"\\\\.\"));\n\n if (top > biggestTop) {\n biggestTop = top;\n }\n\n int left = Integer.parseInt(lineElement.getAttribute(\"l\").replaceAll(\",\", \"\\\\.\"));\n\n if (left > biggestLeft) {\n biggestLeft = left;\n }\n }\n\n double fontSize = 0;\n if (lineElement.getAttribute(\"fontSize\") != null && !lineElement.getAttribute(\"fontSize\").isEmpty()) {\n fontSize = Double.valueOf(lineElement.getAttribute(\"fontSize\").replaceAll(\",\", \"\\\\.\"));\n }\n\n\n fontSizeSum += fontSize;\n lineCounter++;\n }\n }\n }\n\n averagePageFontSize = (double) fontSizeSum / lineCounter;\n\n topBucketSize = (biggestTop / 8) + 1;\n leftBucketSize = (biggestLeft / 8) + 1;\n } else {\n averagePageFontSize = null;\n }\n\n\n }", "@Override\n\tprotected Map<Object, Object> rawTextParse(CharSequence text) {\n\n\t\tStanfordCoreNLP pipeline = null;\n\t\ttry {\n\t\t\tpipeline = pipelines.take();\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tAnnotation document = new Annotation(text.toString());\n\t\tpipeline.annotate(document);\n\t\tMap<Object, Object> sentencesMap = new LinkedHashMap<Object, Object>();//maintain sentence order\n\t\tint id = 0;\n\t\tList<CoreMap> sentences = document.get(CoreAnnotations.SentencesAnnotation.class);\n\n\t\tfor (CoreMap sentence : sentences) {\n\t\t\tStringBuilder processedText = new StringBuilder();\n\t\t\tfor (CoreLabel token : sentence.get(CoreAnnotations.TokensAnnotation.class)) {\n\t\t\t\tString word = token.get(CoreAnnotations.TextAnnotation.class);\n\t\t\t\tString lemma = token.get(CoreAnnotations.LemmaAnnotation.class);\n\t\t\t\tString pos = token.get(CoreAnnotations.PartOfSpeechAnnotation.class);\n\t\t\t\t//todo this should really happen after parsing is done, because using lemmas might confuse the parser\n\t\t\t\tif (config().isUseLowercaseEntries()) {\n\t\t\t\t\tword = word.toLowerCase();\n\t\t\t\t\tlemma = lemma.toLowerCase();\n\t\t\t\t}\n\t\t\t\tif (config().isUseLemma()) {\n\t\t\t\t\tword = lemma;\n\t\t\t\t}\n\t\t\t\tprocessedText.append(word).append(POS_DELIMITER).append(lemma).append(POS_DELIMITER).append(pos).append(TOKEN_DELIM);\n //inserts a TOKEN_DELIM at the end too\n\t\t\t}\n\t\t\tsentencesMap.put(id, processedText.toString().trim());//remove the single trailing space\n\t\t\tid++;\n\t\t}\n\t\ttry {\n\t\t\tpipelines.put(pipeline);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn sentencesMap;\n\t}", "private void putObjectFromPages(JSONArray pageArray) {\n\n for (int i = 0; i < pageArray.length(); i++) {\n JSONObject page = pageArray.optJSONObject(i);\n String pName = page.optString(\"name\");\n JSONArray pageElementArray = page.optJSONArray(\"uiObjects\");\n\n Map<String, PageElement> pageElements = new HashMap<String, PageElement>();\n pageElementsMap.put(pName, pageElements);\n // Searching for the target element in the current page\n for (int j = 0; j < pageElementArray.length(); j++) {\n JSONObject pageElement = pageElementArray.optJSONObject(j);\n String name = pageElement.optString(\"name\");\n\n PageElement element = new PageElement();\n element.setName(name);\n element.setType(pageElement.optString(\"type\"));\n element.setLocatorType(pageElement.optString(\"locatorType\"));\n element.setLocatorValue(pageElement.optString(\"locatorValue\"));\n pageElements.put(name, element);\n }\n\n }\n }", "public static void parsepage(String sourcecode) {\r\n\t\tint indexfrom = 0;\r\n\t\tint indexto = 0;\r\n\t\t\r\n\t\tindexfrom = sourcecode.indexOf(\"<title>\", indexfrom + 1);\r\n\t\tindexto = sourcecode.indexOf(\"</title>\", indexto + 1);\r\n\t\tif(indexfrom != -1 && indexto != -1) {\r\n\t\t\tSystem.out.println(sourcecode.substring(indexfrom + 7, indexto) + \"\\n\\r\");\r\n\t\t}\r\n\r\n\t\tindexfrom = 0;\r\n\t\tindexto = 0;\r\n\t\twhile(true) {\r\n\t\t\tindexfrom = sourcecode.indexOf(\"<\", indexfrom + 1);\r\n\t\t\tif(indexfrom != -1) {\r\n\t\t\t\tif(sourcecode.substring(indexfrom, indexfrom+6).contains(\"<p>\")) {\r\n\t\t\t\t\tindexto = sourcecode.indexOf(\"</p>\", indexfrom + 2);\r\n\t\t\t\t\tif(indexto != -1) {\r\n\t\t\t\t\t\tSystem.out.println(sourcecode.substring(indexfrom + 3, indexto) + \"\\n\\r\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(sourcecode.substring(indexfrom, indexfrom+6).contains(\"<img\")) {\r\n\r\n\t\t\t\t\tindexto = sourcecode.indexOf(\"src=\\\"\", indexfrom + 2);\r\n\t\t\t\t\tif(indexto != -1) {\r\n\t\t\t\t\t\tString imagepath = sourcecode.substring(indexto+5, sourcecode.indexOf(\"\\\"\", indexto+5));\r\n\t\t\t\t\t\tif(!imagepath.contains(host)) {\r\n\t\t\t\t\t\t\tif(imagepath.contains(\":\")) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tString[] tokens = url.split(\"\\\\/(?=[^\\\\/]+$)\");\r\n\t\t\t\t\t\t\t\thost = tokens[0];\r\n\t\t\t\t\t\t\t\tif(host.startsWith(\"http://\")) {\r\n\t\t\t\t\t\t\t\t\thost = host.substring(host.indexOf(\"//\") + 2);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif(!host.startsWith(\"www.\")) {\r\n\t\t\t\t\t\t\t\t\thost = \"www.\" + host;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif(imagepath.startsWith(\"/\")) {\r\n\t\t\t\t\t\t\t\t\timagepath = \"http://\" + host + imagepath;\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tif(host.endsWith(\"/\")) {\r\n\t\t\t\t\t\t\t\t\t\timagepath = \"http://\" + host + imagepath;\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\timagepath = \"http://\" + host + \"/\" + imagepath;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tdownloadimage(imagepath);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcatch(IOException e) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}", "@Override\n\tpublic void process(Task task, Page page) {\n\t\t\n\t}", "public void resolvePageReferences()\n{\n int count = _pages.size();\n while(count-- > 0)\n getPage(count).resolvePageReferences(this);\n}", "private String parseHtmlText(HtmlPage htmlPage) {\n\n Document doc = Jsoup.parse(htmlPage.getRawHTML(), htmlPage.getURL());\n StringBuilder sb = new StringBuilder();\n doc.getElementsByClass(MAIN_CONTENT_CLASS).forEach(element -> {\n element.getElementsByTag(PARAGRAPH_TAG).forEach(paragraph_element -> {\n sb.append(paragraph_element.text()).append(SPACE);\n });\n });\n\n String parsedText = sb.toString();\n // IF case folding is set, perform it\n if (this.isCaseFolding) {\n parsedText = parsedText.toLowerCase();\n }\n\n // IF punctuation handling is set, perform it\n if (this.isPunctuationHandling) {\n parsedText = punctuationHandler(parsedText);\n }\n\n return parsedText;\n }", "private void processContentCn() {\n if (this.content == null || this.content.equals(\"\")) {\r\n _logger.error(\"{} - The sentence is null or empty\", this.traceId);\r\n }\r\n\r\n // process input using ltp(Segmentation, POS, DP, SRL)\r\n this.ltp = new LTP(this.content, this.traceId, this.setting);\r\n }", "public void resolvePageReferences()\n {\n int count = _pages.size();\n while (count-- > 0)\n getPage(count).resolvePageReferences(this);\n }", "@Override\n\tpublic void process(Page page) {\n\t\tboolean contain=false;\n\t\tint idindex=page.getUrl().toString().lastIndexOf(\"=\");\n\t\tString id=\"\";\n\t\tif(page.getUrl().toString().length()>=(idindex+1))\n\t\t id=page.getUrl().toString().substring(idindex+1);\n\t\tSystem.out.println(id);\n\t\tif(id.contains(\".\"))\n\t\t{\n\t\t\tcontain=true;\n\t\t\tSystem.out.println(\"contain is true\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tString ziduan=page.getHtml().xpath(\"//tbody/tr[3]/td[1]/text()\").all().get(0);\n\t\t\tString legal=\"法律状态:\";\n\t\t\tif(ziduan.equals(legal))\n\t\t\t{\n\t\t\t\tcontain=true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*`patent_name` '专利名称',\n\t\t `patent_type` '专利类型',\n\t\t `legal_status`'法律状态',\n\t\t `abstract` '文摘',\n\t\t `sovereignty` '主权项',\n\t\t `apply_data` '申请日期',\n\t\t `public_data`'公开(公告)日期',\n\t\t `patent_number` '申请(专利)号',\n\t\t `public_number` '公开(公告)号',\n\t\t `main_type_number` '主分类号',\n\t\t `type_number` '分类号',\n\t\t `apply_people` '申请人',\n\t\t `patent_people` '发明人',\n\t\t `people_address` '主申请人地址',\n\t\t `city_code` '省市、代码',\n\t\t */\n\t\t\n\t\tpage.putField(\"patent_name\", page.getHtml().xpath(\"//tbody/tr[1]/td[2]/text()\").all().get(0));\n\t\t\n\t\t//x类\n\t\tif(contain)\n\t\t{\n\t\t\t//专利类型\n\t\t\tpage.putField(\"patent_type\", page.getHtml().xpath(\"//tbody/tr[2]/td[2]/text()\").all().get(0));\n\t\t\t\n\t\t\t//法律状态\n\t\t\tList<String> legal=new ArrayList<String>();\n\t\t\tlegal=page.getHtml().xpath(\"//tbody/tr[3]/td[2]/div/div/span/text()\").all();\n\t\t\tString templegal=\"\";\n\t\t\tfor(int i=0;i<legal.size();i++)\n\t\t\t\ttemplegal+=legal.get(i);\n\t\t\tpage.putField(\"legal_status\",templegal);\n\t\t\t\n\t\t\t//文摘\n\t\t\tpage.putField(\"abstract\", page.getHtml().xpath(\"//tbody/tr[4]/td[2]//*/text()\").all().get(0));\n\t\t\t\n\t\t\t//主权项\n\t\t\tpage.putField(\"sovereignty\", page.getHtml().xpath(\"//tbody/tr[5]/td[2]//*/text()\").all().get(0));\n\t\t\t\n\t\t\t//申请日期\n\t\t\tpage.putField(\"apply_date\", page.getHtml().xpath(\"//tbody/tr[6]/td[2]/span/text()\").all().get(0));\n\t\t\t\n\t\t\t//公开日期\n\t\t\tpage.putField(\"public_date\",page.getHtml().xpath(\"//tbody/tr[7]/td[2]/span/text()\").all().get(0));\n\t\t\t\n\t\t\t//申请号\n\t\t\tpage.putField(\"patent_number\",page.getHtml().xpath(\"//tbody/tr[8]/td[2]/span/text()\").all().get(0));\n\t\t\t\n\t\t\t//公开号\n\t\t\tpage.putField(\"public_number\", page.getHtml().xpath(\"//tbody/tr[9]/td[2]/span/text()\").all().get(0));\n\t\t\t\n\t\t\t//主分类号\n\t\t\tpage.putField(\"main_type_number\",page.getHtml().xpath(\"//tbody/tr[10]/td[2]/span/text()\").all().get(0));\n\t\t\t\n\t\t\t//分类号\n\t\t\tpage.putField(\"type_number\",page.getHtml().xpath(\"//tbody/tr[11]/td[2]/span/text()\").all().get(0));\n\t\t\t\n\t\t\t//申请人\n\t\t\tpage.putField(\"apply_people\",page.getHtml().xpath(\"//tbody/tr[6]/td[4]/span/text()\").all().get(0));\n\t\t\t\n\t\t\t//发明人\n\t\t\tpage.putField(\"patent_people\",page.getHtml().xpath(\"//tbody/tr[7]/td[4]/span/text()\").all().get(0));\n\t\t\t\n\t\t\t//主申请人地址\n\t\t\tpage.putField(\"people_address\", page.getHtml().xpath(\"//tbody/tr[10]/td[4]/span/text()\").all().get(0));\n\t\t\t\n\t\t\t//省市代码\n\t\t\tpage.putField(\"city_code\", page.getHtml().xpath(\"//tbody/tr[11]/td[4]/span/text()\").all().get(0));\n\t\t}\n\t\t//n类\n\t\telse{\n\t\t\t//文摘\n\t\t\tpage.putField(\"abstract\", page.getHtml().xpath(\"//tbody/tr[2]/td[2]//*/text()\").all().get(0));\n\t\t\t\n\t\t\t//申请日期\n\t\t\tpage.putField(\"apply_date\",page.getHtml().xpath(\"//tbody/tr[3]/td[2]/text()\").all().get(0));\n\t\t\t\n\t\t\t//公开日期\n\t\t\tpage.putField(\"public_date\",page.getHtml().xpath(\"//tbody/tr[4]/td[2]/text()\").all().get(0));\n\t\t\t\n\t\t\t//申请号\n\t\t\tpage.putField(\"patent_number\", page.getHtml().xpath(\"//tbody/tr[5]/td[2]/text()\").all().get(0));\n\t\t\t\n\t\t\t//公开号\n\t\t\tpage.putField(\"public_number\", page.getHtml().xpath(\"//tbody/tr[6]/td[2]/text()\").all().get(0));\n\t\t\t\n\t\t\t//主分类号\n\t\t\tpage.putField(\"main_type_number\",page.getHtml().xpath(\"//tbody/tr[7]/td[2]/text()\").all().get(0));\n\t\t\t\n\t\t\t//分类号\n\t\t\tpage.putField(\"type_number\",page.getHtml().xpath(\"//tbody/tr[8]/td[2]/text()\").all().get(0));\n\t\t\t\n\t\t\t//申请人\n\t\t\t//如果申请人为空,则没有span标签\n\t\t\tList<String> apply=new ArrayList<String>();\n\t\t\tapply=page.getHtml().xpath(\"//tbody/tr[10]/td[2]/span/text()\").all();\n\t\t\tif(apply.size()==0)\n\t\t\t{\n\t\t\t\tpage.putField(\"apply_people\",page.getHtml().xpath(\"//tbody/tr[10]/td[2]/text()\").all().get(0));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpage.putField(\"apply_people\",apply.get(0));\n\t\t\t}\n\t\t\t\n\t\t\t//发明人\n\t\t\t//如果发明人为空,则没有span标签\n\t\t\tapply=page.getHtml().xpath(\"//tbody/tr[11]/td[2]/span/text()\").all();\n\t\t\tif(apply.size()==0)\n\t\t\t{\n\t\t\t\tpage.putField(\"patent_people\",page.getHtml().xpath(\"//tbody/tr[11]/td[2]/text()\").all().get(0));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpage.putField(\"patent_people\",apply.get(0));\n\t\t\t}\t\n\t\t}\t\n\t\t\n\t\tpage.putField(\"url\", page.getRequest().getUrl());\n//\t\tSystem.out.println(page.getResultItems().get(\"patent_name\"));\n\t}", "public static void preprocessWikipediaInformation(LocationDataIO locationData) {\n\t\ttry {\n\t\t\tSAXParserFactory factory = SAXParserFactory.newInstance();\n\t\t\tfactory.setFeature(\"http://xml.org/sax/features/validation\", false);\n\t\t\tfactory.setFeature(\"http://apache.org/xml/features/continue-after-fatal-error\", true);\n\t\t\tfactory.setFeature(\"http://apache.org/xml/features/continue-after-fatal-error\", true);\n\t\t\tSAXParser parser = factory.newSAXParser();\n\n\t\t\tIterator<POI> iter = locationData.getPOIs().iterator();\n\t\t\twhile (iter.hasNext()) {\n\t\t\t\tPOI current = iter.next();\n\t\t\t\tif (current.getURL() != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tSystem.out.print(current.getName());\n\t\t\t\t\t\tURL url = current.getURL();\n\t\t\t\t\t\tURLConnection connection = url.openConnection();\n\t\t\t\t\t\tconnection.connect();\n\t\t\t\t\t\tInputSource input = new InputSource(connection.getInputStream());\n\t\t\t\t\t\tString lang = current.getURL().toExternalForm();\n\t\t\t\t\t\tif (lang.length() > 9 && lang.substring(7, 9).matches(\"[a-zA-Z]{2}\")) {\n\t\t\t\t\t\t\tlang = lang.substring(7, 9);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlang = \"de\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tWikipediaHandler handler = new WikipediaHandler(lang);\n\n\t\t\t\t\t\tparser.parse(input, handler);\n\t\t\t\t\t\tcurrent.setTextInfo(handler.getFirstParagraphs());\n\t\t\t\t\t\tcurrent.setURL(handler.getImageURL());\n\t\t\t\t\t\tSystem.out.print(\" ✓\\n\");\n\t\t\t\t\t} catch (SAXException e) {\n\t\t\t\t\t\tlogger.info(String.format(\"Schwerwiegender Syntaxfehler in %s! Wird ignoriert.\", current.getURL().toExternalForm()));\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tlogger.info(current.getURL().toExternalForm() + \" konnte nicht gelesen werden! Wird ignoriert.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (ParserConfigurationException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SAXNotRecognizedException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SAXNotSupportedException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SAXException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void run() {\n try {\r\n TransformerFactory tFactory = TransformerFactory.newInstance();\r\n // Fortify Mod: prevent external entity injection\r\n tFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);\r\n Transformer transformer = tFactory.newTransformer();\r\n transformer.setOutputProperty(\"encoding\", \"UTF-8\");\r\n transformer.setOutputProperty(\"indent\", \"yes\");\r\n transformer.transform(new DOMSource(doc), new StreamResult(\r\n pos));\r\n } catch (Exception e) {\r\n throw new RuntimeException(\r\n \"Error converting Document to InputStream. \"\r\n + e.getMessage());\r\n } finally {\r\n try {\r\n pos.close();\r\n } catch (IOException e) {\r\n\r\n }\r\n }\r\n }", "public void setPage(String page) {\r\n pageEL = page;\r\n }", "public static void resolveInPlace(Document in) \n throws BadParseAttributeException, InclusionLoopException, \n IOException, NoIncludeLocationException, ParsingException, \n UnsupportedEncodingException, XIncludeException { \n resolveInPlace(in, new Builder());\n }", "public PageList() { \n// fileIO = new CharFileIO(\"utf-8\");\n// We are not currently using this to extract 'title' because it doesn't work \n// for whose title and meta-description tags are not explicitly specified;\n// Such as pages written in scripting languages like .jsp, .asp etc \n// parseJob = new ParseJob();\n }", "protected void prepareEntityToNodeMap()\r\n\t{\n\t}", "public Page(PageInformation pageInfo)\n\t{\n\t\tthis.pageInfo = pageInfo;\n\t\tthis.contentInstructions = new ArrayList<ContentInstruction>();\n\t\tthis.pageContent = new HashMap<Integer, Content>();\n\t\tnextContentNumber = 0;\n\t}", "@Override\n\tpublic TemplatePage extract(String htmlContent) {\n\t\ttry {\n\t\t\t\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tParser parser = new Parser(htmlContent);\n\t\t\tMyNodeVisitor visitor = new MyNodeVisitor(true, true);\n\t\t\tparser.visitAllNodesWith(visitor);\n\t\t\t\n\t\t\tString content = visitor.getContent();\n\t\t\tif ( content == null || content.length() == 0 ) {\n\t\t\t\treturn new TemplatePage(\"\", \"\");\n\t\t\t}\n\t\t\t\n\t\t\tcontent = HtmlContentHelper.escape(content);\t\n\t\t\t\n\t\t\tString title = visitor.getTitle();\n\t\t\tif ( title == null ) {\n\t\t\t\ttitle = \"\";\n\t\t\t} else {\n\t\t\t\ttitle = HtmlContentHelper.escape(title);\n\t\t\t}\n\t\t\t\n\t\t\treturn new TemplatePage(title, content);\n\t\t\t\n\t\t} catch(ParserException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn new TemplatePage(\"\", \"\");\n\t\t\n\t}", "@Override\n\t\tpublic void visitTag(Tag tag) {\n\t\t\tsuper.visitTag(tag);\n\t\t\tif ( engine.isPageContent(tag) ) {\n\t\t\t\tString tcontent = extractText(tag, 0);\n\t\t\t\tif ( tcontent == null ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( content == null || content.length() < tcontent.length() ) {\n\t\t\t\t\tcontent = tcontent; \n\t\t\t\t}\n\t\t\t} else if ( engine.isPageTitle(tag) ) {\n\t\t\t\tString ttitle = extractText(tag, 0);\n\t\t\t\tif ( ttitle == null ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( title == null || title.length() < ttitle.length() ) {\n\t\t\t\t\ttitle = ttitle;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public void assertPage(String page) {\n for (TextFinder m: this.whitelist) {\n page = m.replaceAll(page, \"\");\n }\n\n for (TextFinder m: this.assertions) {\n if (m.find(page)) {\n this.reporter.Assert(\"Page Assert found match for '\" +\n m.toString() + \"'\",\n true, false);\n }\n }\n }", "private void makeReplacementText() throws IOException {\n valueBuf.clear();\n Token t = new Token();\n int start = currentTokenStart + 1;\n final int end = bufStart - 1;\n try {\n for (;;) {\n\tint tok;\n\tint nextStart;\n\ttry {\n\t tok = Tokenizer.tokenizeEntityValue(buf, start, end, t);\n\t nextStart = t.getTokenEnd();\n\t}\n\tcatch (ExtensibleTokenException e) {\n\t tok = e.getTokenType();\n\t nextStart = end;\n\t}\n\thandleEntityValueToken(valueBuf, tok, start, nextStart, t);\n\tstart = nextStart;\n }\n }\n catch (PartialTokenException e) {\n currentTokenStart = end;\n fatal(\"NOT_WELL_FORMED\");\n }\n catch (InvalidTokenException e) {\n currentTokenStart = e.getOffset();\n reportInvalidToken(e);\n }\n catch (EmptyTokenException e) { }\n }", "protected void postParse(T fileParsed) {\n\t}", "static void renderPage(BasePage page,PrintWriter pw){\n try{\n page.$render(pw);\n }catch(Throwable ex){\n String pn = page.getPageName();\n $renderError(ex,pn,null,true, -1);\n }finally {\n page.request = null;\n } //try\n}", "@Override\n\t\t\t\t\t\tpublic void read(WikiPage page) throws BreakException {\n\t\t\t\t\t\t\tif (page.getTitle().contains(\":\")) {\n\t\t\t\t\t\t\t\treturn; // SKIP Template page\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcount++;\n\t\t\t\t\t\t\tif (count > 3) { // YOUR BREAK CONDITION HERE\n\t\t\t\t\t\t\t\tthrow new BreakException();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tSystem.out.println(page.getTitle());\n\t\t\t\t\t\t\tSystem.out.println(page.getText());\n\t\t\t\t\t\t}", "public void parsePseudocode() {\n\t\tputTokens();\n\t\tsetTokenLength();\n\t\ttokenize();\n\t\tdataToJS();\n\t}", "public void parse() {\n }", "public void pageElementsLoader(String fileName) {\n InputStream inpStream = RepositoryParser.class.getClassLoader().getResourceAsStream(fileName);\n JSONObject locatorRepository = null;\n try {\n locatorRepository = new JSONObject(IOUtils.toString(inpStream, \"UTF-8\"));\n } catch (JSONException e) {\n Log.error(\"Error in parsing JSOn file \" + e.getMessage());\n } catch (IOException e) {\n Log.error(\"IO Exception encounred \" + e.getMessage());\n } finally {\n CustomAssert.assertTrue(locatorRepository != null, \"Error in reading locator repository \"\n + fileName);\n }\n\n JSONArray pageArray = locatorRepository.optJSONArray(\"pages\");\n CustomAssert.assertTrue(pageArray != null, \"Error in parsing locator repository pages \"\n + fileName);\n\n putObjectFromPages(pageArray);\n }", "private void prepArticle(Element articleContent) {\n // we don't need to do this, we don't care\n cleanStyles(articleContent);\n // this replaces any break element or an nbsp with a plain break\n // element.\n // not needed. We will deal with breaks as we deal with breaks\n // killBreaks(articleContent);\n\n /* Clean out junk from the article content */\n cleanConditionally(articleContent, \"form\");\n clean(articleContent, \"object\");\n clean(articleContent, \"h1\");\n\n /**\n * If there is only one h2, they are probably using it as a header and not a subheader, so remove it\n * since we already have a header.\n ***/\n if (articleContent.getElementsByTag(\"h2\").size() == 1) {\n clean(articleContent, \"h2\");\n }\n clean(articleContent, \"iframe\");\n\n cleanHeaders(articleContent);\n\n /*\n * Do these last as the previous stuff may have removed junk that will affect these\n */\n cleanConditionally(articleContent, \"table\");\n cleanConditionally(articleContent, \"ul\");\n //could have no children, will crash then\n if (articleContent.children().size() != 0) {\n cleanConditionally(articleContent.child(0), \"div\");\n }\n\n /* Remove extra paragraphs */\n Elements articleParagraphs = articleContent.getElementsByTag(\"p\");\n for (Element para : articleParagraphs) {\n int imgCount = para.getElementsByTag(\"img\").size();\n int embedCount = para.getElementsByTag(\"embed\").size();\n int objectCount = para.getElementsByTag(\"object\").size();\n\n if (imgCount == 0 && embedCount == 0 && objectCount == 0 && para.text().matches(\"\\\\s*\")) {\n para.remove();\n }\n }\n\n Elements parasWithPreceedingBreaks = articleContent.getElementsByTag(\"br + p\");\n for (Element pe : parasWithPreceedingBreaks) {\n Element brElement = pe.previousElementSibling();\n brElement.remove();\n }\n }", "public interface ResponsePostprocessor {\r\n String postprocess(Page page, String postprocess);\r\n}", "private Map<String, Map<String,Integer>> openNLPParse(String text) {\n\t\tMap<String, Map<String,Integer>> result = new HashMap<String, Map<String,Integer>>();\n\t\tString path = \"\";\n\t\t\n\t\tfor (String type : this.entityTypes) {\n\t\t\tpath = \"en-ner-\" + type.toLowerCase() + \".bin\";\n\t\t\tthis.nlp = new OpenNLPNameFinder(type, path);\n\t\t\tMap<String,Integer> entities = nlp.recogniseWithCounts(text);\n\t\t\tresult.put(type, entities);\n\t\t}\n\n\t\treturn result;\n\t}", "Builder addMainEntityOfPage(URL value);", "Builder addMainEntityOfPage(String value);", "public void getParsed(String text) {\n\t\tAnnotation document = new Annotation(text);\n\n\t\t// run all Annotators on this text\n\t\tpipeline.annotate(document);\n\t\tsentences = document.get(SentencesAnnotation.class);\n\t\tsentIt = sentences.iterator();\n\t}", "private LazyPreprocessedPage expand(\n\t ExpansionCallback callback,\n\t PageTitle title,\n\t LazyPreprocessedPage ppAst,\n\t EntityMap entityMap,\n\t Map<String, AstNode> arguments,\n\t boolean forInclusion,\n\t ExpansionFrame rootFrame,\n\t ExpansionFrame parentFrame,\n\t ContentNode parentLog)\n\t throws CompilerException\n\t{\n\t\tPpResolverLog log = new PpResolverLog();\n\t\tparentLog.getContent().add(log);\n\t\t\n\t\tif (arguments == null)\n\t\t\targuments = new HashMap<String, AstNode>();\n\t\t\n\t\tStopWatch stopWatch = new StopWatch();\n\t\tstopWatch.start();\n\t\t\n\t\ttry\n\t\t{\n\t\t\tExpansionFrame frame;\n\t\t\tif (rootFrame != null)\n\t\t\t{\n\t\t\t\tframe = new ExpansionFrame(\n\t\t\t\t this,\n\t\t\t\t callback,\n\t\t\t\t title,\n\t\t\t\t entityMap,\n\t\t\t\t arguments,\n\t\t\t\t forInclusion,\n\t\t\t\t rootFrame,\n\t\t\t\t parentFrame,\n\t\t\t\t ppAst.getWarnings(),\n\t\t\t\t log);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tframe = new ExpansionFrame(\n\t\t\t\t this,\n\t\t\t\t callback,\n\t\t\t\t title,\n\t\t\t\t entityMap,\n\t\t\t\t ppAst.getWarnings(),\n\t\t\t\t log);\n\t\t\t}\n\t\t\t\n\t\t\tLazyPreprocessedPage expanded =\n\t\t\t (LazyPreprocessedPage) frame.expand(ppAst);\n\t\t\t\n\t\t\treturn expanded;\n\t\t}\n\t\tcatch (Throwable e)\n\t\t{\n\t\t\tlogger.error(\"Resolution failed!\", e);\n\t\t\t\n\t\t\tStringWriter w = new StringWriter();\n\t\t\te.printStackTrace(new PrintWriter(w));\n\t\t\tlog.getContent().add(new UnhandledException(e, w.toString()));\n\t\t\t\n\t\t\tthrow new CompilerException(\"Resolution failed!\", e);\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tstopWatch.stop();\n\t\t\tlog.setTimeNeeded(stopWatch.getElapsedTime());\n\t\t}\n\t}", "PageAgent getPage();", "public String preProcess( String data );", "@Override\n public void processPages(File imageFile, File outputFile) throws Exception {\n instance.setDatapath(datapath);\n instance.setLanguage(language);\n instance.setPageSegMode(Integer.parseInt(pageSegMode));\n instance.setOcrEngineMode(Integer.parseInt(ocrEngineMode));\n\n List<RenderedFormat> renderedFormats = new ArrayList<RenderedFormat>();\n\n for (String format : outputFormats.toUpperCase().split(\",\")) {\n renderedFormats.add(RenderedFormat.valueOf(format));\n }\n\n instance.createDocuments(imageFile.getPath(), outputFile.getPath(), renderedFormats);\n }", "public void setPage(Page page) {this.page = page;}", "public void parseDocument(String fileLocation) {\n List<Object> objects = FileUtility.readObjectsFromFile(fileLocation);\n new File(FILE_DIRECTORY_NAME).mkdir();\n\n // TODO: Parellize the processing of html parsing for each html page\n\n objects.parallelStream().forEach((object) -> {\n HtmlPage htmlPage = (HtmlPage) object;\n String title = DocumentUtility.extractDocumentID(htmlPage.getURL());\n String parsedText = parseTitle(title) + NEWLINE + parseHtmlText(htmlPage);\n parsedHtmlPages.add(new ParsedHtmlPage(title, parsedText));\n });\n }", "void preProcess();", "private PSTemplate importTemplate(String siteId, FileItem item)\n\t throws PSExtractHTMLException\n\t {\n\n\t PSTemplate convertedTemplate = new PSTemplate();\n\t \n\t try(InputStream fileInput = item.getInputStream())\n\t {\n\n\t \t //Build a string with the InputStream\n\t \t BufferedReader br = new BufferedReader(new InputStreamReader(item.getInputStream()));\n\t \t StringBuilder sb = new StringBuilder();\n\t \t String line = null;\n\t \t while ((line = br.readLine()) != null) {\n\t \t sb.append(line).append(\"\\n\");\n\t \t }\n\t \t br.close();\n\t \t \n\t \t String validStringXml = sb.toString();\n\t \t validStringXml = validStringXml.trim().replaceFirst(\"^([\\\\W]+)<\",\"<\");\n\t \t convertedTemplate = PSSerializerUtils.unmarshal(validStringXml, PSTemplate.class);\n\n\t \t //Import the template\n\t return templateService.importTemplate(convertedTemplate,siteId);\n\n\t } catch (PSDataServiceException | IPSPathService.PSPathNotFoundServiceException | IOException e) {\n\t\t\tthrow new PSExtractHTMLException(e);\n\t\t }\n\t }", "public void assertPage(String page, VDDHash whitelist) {\n this.addWhitelistEntries(whitelist);\n assertPage(page);\n }", "public RepositoryParser() {\n pageElementsMap = new HashMap<String, Map<String, PageElement>>();\n }", "public final void page() throws RecognitionException {\n try {\n // css21.g:79:5: ( PAGE_SYM ( pseudoPage )? LBRACE declaration SEMI ( declaration SEMI )* RBRACE )\n // css21.g:79:7: PAGE_SYM ( pseudoPage )? LBRACE declaration SEMI ( declaration SEMI )* RBRACE\n {\n match(input,PAGE_SYM,FOLLOW_PAGE_SYM_in_page317); if (state.failed) return ;\n\n // css21.g:79:16: ( pseudoPage )?\n int alt8=2;\n int LA8_0 = input.LA(1);\n\n if ( (LA8_0==COLON) ) {\n alt8=1;\n }\n switch (alt8) {\n case 1 :\n // css21.g:79:16: pseudoPage\n {\n pushFollow(FOLLOW_pseudoPage_in_page319);\n pseudoPage();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n break;\n\n }\n\n\n match(input,LBRACE,FOLLOW_LBRACE_in_page330); if (state.failed) return ;\n\n pushFollow(FOLLOW_declaration_in_page344);\n declaration();\n\n state._fsp--;\n if (state.failed) return ;\n\n match(input,SEMI,FOLLOW_SEMI_in_page346); if (state.failed) return ;\n\n // css21.g:81:30: ( declaration SEMI )*\n loop9:\n do {\n int alt9=2;\n int LA9_0 = input.LA(1);\n\n if ( (LA9_0==IDENT) ) {\n alt9=1;\n }\n\n\n switch (alt9) {\n \tcase 1 :\n \t // css21.g:81:31: declaration SEMI\n \t {\n \t pushFollow(FOLLOW_declaration_in_page349);\n \t declaration();\n\n \t state._fsp--;\n \t if (state.failed) return ;\n\n \t match(input,SEMI,FOLLOW_SEMI_in_page351); if (state.failed) return ;\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop9;\n }\n } while (true);\n\n\n match(input,RBRACE,FOLLOW_RBRACE_in_page363); if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n\n finally {\n \t// do for sure before leaving\n }\n return ;\n }", "void initBeforeParsing() {\r\n }", "Page getPage();", "@Before\n public void setUp() throws Exception {\n setUpPrerequisites();\n metadata = new ArrayList<ResourceMetadata<?>>();\n pageXml = IOUtils.toString(getClass().getResourceAsStream(\"/page.xml\"));\n ResourceURI uri = new PageURIImpl(site, path, id, Resource.LIVE);\n pageItem = new PageSearchResultItemImpl(uri, url, relevance, source, metadata);\n item = pageItem;\n item.setTitle(title);\n item.setPreview(previewData);\n item.setPreviewRenderer(renderer);\n pageItem.setResourceXml(pageXml);\n }", "@Override\n public void visit(Page page) {\n\t visitObject.visitUrls(page);\n\t String url = page.getWebURL().getURL();\n\t System.out.println(\"URL: \" + url);\n\t if (page.getParseData() instanceof HtmlParseData) {\n\t\t HtmlParseData htmlParseData = (HtmlParseData) page.getParseData();\n\t\t String text = htmlParseData.getText();\n\t\t String html = htmlParseData.getHtml();\n\t\t Set<WebURL> links = htmlParseData.getOutgoingUrls();\n\t\t System.out.println(\"Text length: \" + text.length());\n\t\t System.out.println(\"Html length: \" + html.length());\n\t\t System.out.println(\"Number of outgoing links: \" + links.size());\n\t\t }\n }", "private void handleAllStartTags(Tag tagReturnedFromParse, MutableAttributeSet attributeSetReturnedFromParse, int pos) {\n\tif (StepsToFollow == null) {\n\t initializeStepsToFollow();\n\t}\n\tStepsToFollow.processNextStep();\n\ttry {\n\t if (StepsToFollow.tagToFind == null) {\n\t\tthis.strImageDate = StepsToFollow.getStrImageDate();\n\t\tthis.strImageUrl = StepsToFollow.getStrImageUrl();\n//\t\tthis.ldImageDate = StepsToFollow.getLdImageDate();\n\t\tthis.setStrImageWebPageUrlForPreviousDay(StepsToFollow.getStrPrevWebPageUrl());\n\t } else {\n\t\tif (StepsToFollow.tagToFind.equals(tagReturnedFromParse)) {\n\t\t if (MyTestStepToCheck != StepsToFollow.intNextStepToCheck) {\n\t\t\tString strTagToFind = StepsToFollow.tagToFind.toString();\n\t\t\tMyTestResults += strTagToFind + \"|\";\n\t\t\tMyTestStepToCheck = StepsToFollow.intNextStepToCheck;\n\t\t }\n\t\t MyResults = objProcessStartTags.processThisTag(tagReturnedFromParse, attributeSetReturnedFromParse, StepsToFollow.tagToFind, StepsToFollow.attributeToFind, StepsToFollow.strValueToFind, StepsToFollow.intLengthOfValueToFind, StepsToFollow.attributeToGetValueFrom);\n\t\t StepsToFollow.checkReturnValues(MyResults);\n\t\t}\n\t }\n\t} catch (Exception e) {\n\t // TODO Auto-generated catch block\n\t // e.printStackTrace();\n\t String myMsg = \"Error:\";\n\t myMsg += NL + \"ArcamaxWebPageHtmlParser\";\n//\t myMsg += NL + \"imageName: \" + this.strImageName;\n\t myMsg += NL + \"Tag returned: \" + tagReturnedFromParse;\n\t myMsg += NL + \"Tag to find: \" + StepsToFollow.tagToFind;\n\t myMsg += NL + \"Next step to check: \" + StepsToFollow.intNextStepToCheck;\n\t System.out.println(myMsg);\n\t}\n\n }", "void parse();", "static TreeSet<Preposition> parsePrepositions(Scanner data){\n\t\tArrayList<String[]> raw = parseDataToArray(data);\n\t\tTreeSet<Preposition> output = new TreeSet<Preposition>();\n\n\t\tfor(String[] current : raw){ //iterate over each line from the original file.\n\n\t\t\tif(current.length != Values.PREPOSITION_DATA_ARRAY_LENGTH_CORRECT){\n\t\t\t\tSystem.err.println(\"Error parsing a line.\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//System.out.println(\"Raw: \" + Arrays.toString(current));\n\n\t\t\t//current[] contains a split based on tabs. Generally {chapter, nom/gen/gender, definition}.\n\n\t\t\tint chapter = 0;\n\t\t\tString Preposition;\n\t\t\tint caseTaken = 0;\n\t\t\tArrayList<String> definitions = new ArrayList<String>();\n\n\t\t\t//Values.betterStringArrayPrint(current);\n\n\t\t\ttry{ //try to read a noun, assuming that the chapter IS specified\n\t\t\t\tchapter = Integer.parseInt(current[0]);\n\t\t\t\tPreposition = current[1].split(\" \\\\+ \")[0];\n\t\t\t\tcaseTaken = Values.getCaseFromString(current[1].split(\" \\\\+ \")[1]);\n\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t} catch(NumberFormatException e){ //can happen if a chapter isn't specified. Read the noun from a null chapter.\n\t\t\t\tchapter = Values.CHAPTER_VOID;\n\t\t\t\tPreposition = current[1].split(\" \\\\+ \")[0];\n\t\t\t\tcaseTaken = Values.getCaseFromString(current[1].split(\" \\\\+ \")[1]);\n\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t} catch(Exception e){\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.err.println(\"Could not read a line!\");\n\t\t\t\tcontinue; //We can't make a noun out of the botrked line.\n\t\t\t}\n\t\t\ttrimAll(definitions);\n\t\t\tPreposition currentPreposition = new Preposition(Preposition, caseTaken, chapter, definitions);\n\t\t\tSystem.out.println(\"Added: \" + currentPreposition);\n\t\t\toutput.add(currentPreposition);\n\t\t}\n\n\t\treturn output;\n\t}", "public static String pagefilter(String content){\n //String p = System.getProperty(\"line.separator\") ; //\\r\\n in windows jp\n\n content = content.replaceAll(\"&\",\"&amp;\"); \n content = content.replaceAll(\"<\",\"&lt;\");\n content = content.replaceAll(\">\",\"&gt;\"); \n content = content.replaceAll(\"\\n\",\"<br/>\");\n content = content.replaceAll(\" \",\"&nbsp;\");\n \n \n return content;\n }", "@Override\n\tpublic void process(Page page) {\n\t\tDocument doc = Jsoup.parse(page.getHtml().getFirstSourceText());\n\n\t\tif (isFirst) {\n\t\t\tSystem.out.println(\"添加所有列表链接\");\n\t\t\tArrayList<String> urls = new ArrayList<String>();\n\t\t\t// 33\n\t\t\tfor (int i = 2; i < 30; i++) {\n\t\t\t\turls.add(\"http://zyjy.jiangmen.gov.cn//szqjszbgg/index_\" + i + \".htm\");\n\t\t\t}\n\t\t\tpage.addTargetRequests(urls);\n\t\t\tSystem.out.println(\"这一页一共有 \" + urls.size() + \" 条数据\");\n\n\t\t\tisFirst = false;\n\t\t}\n\n\t\tif (page.getUrl().regex(URL_LIST).match() || page.getUrl().toString().trim().equals(url)) {\n\t\t\tSystem.out.println(\"获取列表数据\");\n\n\t\t\tElements uls = doc.getElementsByAttributeValue(\"class\", \"c1-bline\");\n\t\t\tfor (Element ul : uls) {\n\t\t\t\tString url = ul.getElementsByAttributeValue(\"class\", \"f-left\").get(0).select(\"a\").attr(\"href\").trim();\n\t\t\t\tString title = ul.getElementsByAttributeValue(\"class\", \"f-left\").get(0).text();\n\t\t\t\tString data = ul.getElementsByAttributeValue(\"class\", \"f-right\").get(0).text();\n\t\t\t\tCacheHashMap.cache.put(url, title + \"###\" + data);\n\t\t\t\tMyUtils.addRequestToPage(page, url);\n\t\t\t\tSystem.out.println(url + \" \" + CacheHashMap.cache.get(url));\n\t\t\t}\n\n\t\t}\n\t\tif (page.getUrl().regex(URL_DETAILS).match()) {\n\n\t\t\tProject project = new Project();\n\t\t\tStringBuffer project_article = new StringBuffer();\n\n\t\t\tString urldetails = CacheHashMap.cache.get(page.getUrl().toString().trim());\n\t\t\tSystem.out.println(\"url\" + page.getUrl().toString().trim());\n\t\t\tSystem.out.println(\"urldetails \" + urldetails);\n\n\t\t\tString[] value = urldetails.split(\"###\");\n\t\t\tif (value != null && value.length > 1) {\n\t\t\t\tproject.setProjectName(value[0]);\n\t\t\t\tproject.setPublicStart(value[1]);\n\t\t\t}\n\n\t\t\tElements divs = doc.getElementsByAttributeValue(\"class\", \"contlist minheight\");\n\t\t\tfor (Element div : divs.get(0).children()) {\n\t\t\t\tif (div.nodeName().equals(\"table\")) {\n\t\t\t\t\tElements trs = divs.select(\"tbody\").select(\"tr\");\n\t\t\t\t\tfor (Element tr : trs) {\n\t\t\t\t\t\tproject_article.append(tr.text()).append(\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tproject_article.append(div.text()).append(\"\\n\");\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tproject.setUrl(page.getUrl().toString().trim());\n\t\t\tproject.setState(0);\n\t\t\tproject.setWebsiteType(\"江门市\");\n\t\t\tproject.setTime(MyUtils.getcurentTime());\n\t\t\tproject.setRawHtml(divs.toString());\n\n\t\t\tproject.setArticle(project_article.toString());\n\t\t\tSystem.out.println(project);\n\n\t\t\tHibernateUtil.save2Hibernate(project);\n\n\t\t}\n\n\t}", "protected void importText(String text, Epml epml) {\n\t}", "protected void handleEntitiesIndividually() {\n\n\t\tfinal Set<Long> originalBatch = getUidsToLoad();\n\t\tfinal Set<Long> batchOfOne = new HashSet<Long>();\n\n\t\t/**\n\t\t * We replace the batch of all the uids with our own which we'll only put one uid at a time.\n\t\t */\n\t\tsetBatch(batchOfOne);\n\n\t\tLOG.info(\"Loading \" + originalBatch.size() + \" entities individually\");\n\n\t\tfor (final Long uid : originalBatch) {\n\n\t\t\ttry {\n\n\t\t\t\tbatchOfOne.clear();\n\t\t\t\tbatchOfOne.add(uid);\n\n\t\t\t\tfinal Collection<ENTITY> loadedEntity = loadBatch();\n\t\t\t\tgetPipelinePerformance().addCount(\"loader:entities_loaded_individually\", loadedEntity.size());\n\n\t\t\t\tfor (final ENTITY entity : loadedEntity) {\n\t\t\t\t\tgetNextStage().send(entity);\n\t\t\t\t\tgetPipelinePerformance().addCount(\"loader:entities_out\", 1);\n\n\t\t\t\t}\n\t\t\t} catch (final Exception e) {\n\t\t\t\tgetPipelinePerformance().addCount(\"loader:individual_entity_loading_failures\", 1);\n\n\t\t\t\tLOG.error(\"Could not load entity with uid \" + uid + \" for indexing, this entity will not be indexed. \", e);\n\t\t\t}\n\n\t\t}\n\n\t\t/** Put the original set of uids back. */\n\t\tsetBatch(originalBatch);\n\n\t}" ]
[ "0.66664255", "0.6190152", "0.6033476", "0.58750385", "0.57559055", "0.5581218", "0.5572146", "0.5566908", "0.55580235", "0.55273014", "0.54997677", "0.5488561", "0.5476644", "0.5441978", "0.5418276", "0.5406624", "0.5406624", "0.5406624", "0.5406624", "0.5307978", "0.5253149", "0.52321386", "0.5154895", "0.5089471", "0.5077778", "0.5068618", "0.5064976", "0.5038299", "0.5014097", "0.50093704", "0.5008021", "0.5008021", "0.49981776", "0.4974738", "0.49715808", "0.49462652", "0.49206725", "0.49188274", "0.49151346", "0.48836723", "0.48542723", "0.4851989", "0.48465642", "0.47823825", "0.47731066", "0.47362474", "0.4731667", "0.47246882", "0.47234318", "0.47232932", "0.4707181", "0.46963793", "0.46725988", "0.46701843", "0.46696967", "0.46469176", "0.4645818", "0.4645641", "0.46375266", "0.4631479", "0.46243936", "0.46214765", "0.4617607", "0.46005517", "0.45785928", "0.45752525", "0.45477876", "0.4546508", "0.45350686", "0.45298493", "0.45129997", "0.4507947", "0.4505593", "0.4483838", "0.44831735", "0.4482647", "0.44641805", "0.4462872", "0.4461136", "0.44594032", "0.4434705", "0.44202647", "0.44165602", "0.43997496", "0.43990377", "0.43896773", "0.43838292", "0.43739754", "0.4363764", "0.43582267", "0.43531793", "0.43525738", "0.43513623", "0.43494737", "0.43363267", "0.43362626", "0.4335348", "0.4333522", "0.43224147", "0.43197063" ]
0.5571765
7
The default view of a question in the quiz creator
public QuizCreatorView() { answerInput1.setText(""); answerInput2.setText(""); answerInput3.setText(""); answerInput4.setText(""); optionsGroup = new ButtonGroup(); optionsGroup.add(OptionA); optionsGroup.add(OptionB); optionsGroup.add(OptionC); optionsGroup.add(OptionD); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String init() {\n\t\tif (question == null) {\n\t\t\treturn indexView;\n\t\t}\n\t\treturn \"\";\n\t}", "public QuestionModel getDefaultQuestion() {\n\t\treturn questionList.get(0);\n\t}", "public String viewAction(long id) {\n quiz = quizEJB.getQuizById(id);\n return \"quiz.xhtml\";\n }", "public QuizMeAction() {\n\t\tsuper(\"Quiz Me...\", null); \n\t}", "public DecideQuestion(){\n\t\tsuper(0); /** call relation -> PromptQuestion.java */\n\t}", "@Override\n\tpublic Questions showQuestion(Test onlineTest, BigInteger questionId) throws UserException {\n\t\treturn null;\n\t}", "private void displayQuestion(Question question) {\n String query = question.getQuery();\n TextView queryTextView = getTextViewById(\"quiz_query\");\n queryTextView.setText(query);\n\n //Setting text for quiz options\n Iterator<String> options = question.getOptions().iterator();\n RadioButton A = getRadioButtonById(\"optionA\");\n RadioButton B = getRadioButtonById(\"optionB\");\n RadioButton C = getRadioButtonById(\"optionC\");\n RadioButton D = getRadioButtonById(\"optionD\");\n A.setText(options.next());\n B.setText(options.next());\n C.setText(options.next());\n D.setText(options.next());\n }", "public void displayQuestion() {\n Question question = getCurrentQuestion();\n String type = question.getType();\n System.out.println(question);\n switch (type) {\n case \"multiple_choice\":\n optionFragment = new MulitipleChoiceFragment();\n break;\n case \"multiple_select\":\n optionFragment = new MultipleSelectQuestionFragment();\n break;\n case \"open\":\n optionFragment = new OpenQuestionFragment();\n break;\n case \"time\":\n optionFragment = new TimeQuestionFragment();\n break;\n case \"date\":\n optionFragment = new DateQuestionFragment();\n break;\n case \"datetime\":\n break; //TODO: datetime answer\n case \"image\":\n optionFragment = new TakePhotoFragment();\n break;\n case \"video\":\n optionFragment = new RecordVideoFragment();\n break;\n case \"audio\":\n optionFragment = new RecordAudioFragment();\n break;\n case \"infoscreen\":\n optionFragment = new InfoscreenFragment();\n break;\n case \"accelerometer\":\n optionFragment = new AccelerometerFragment();\n break;\n case \"gps\":\n optionFragment = new GlobalPositioningSystemFragment();\n break;\n case \"lightsensor\":\n optionFragment = new LightSensorFragment();\n break;\n case \"compassensor\":\n optionFragment = new CompasSensorFragment();\n break;\n case \"gyroscope\":\n optionFragment = new GyroscopeFragment();\n break;\n default:\n break; //TODO: add default\n }\n //add the question object to the fragment object through bundle\n Bundle questionBundle = new Bundle();\n questionBundle.putParcelable(\"question\", question);\n optionFragment.setArguments(questionBundle);\n\n //place fragment in the layout\n FragmentTransaction transaction = getFragmentManager().beginTransaction();\n transaction.replace(R.id.question_answer, optionFragment);\n transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);\n transaction.commit();\n }", "Question getFirstQuestion();", "private void setQuestionView()\n\t{\n txtQNumber.setText(qid + 1 + \"/\" + numberOfQuestions);\n\t\ttxtQuestion.setText(currentQ.getQUESTION());\n\t\ttxtReference.setText(currentQ.getREFERENCE());\n\t\trda.setText(currentQ.getOPTA());\n\t\trdb.setText(currentQ.getOPTB());\n\t\trdc.setText(currentQ.getOPTC());\n\t\trdd.setText(currentQ.getOPTD());\n\t\tqid++;\n\t}", "Question getQuestion();", "public abstract void editQuestion();", "public String getQuestion() {\n return question;\n }", "public TwentyQuestionsView() {\n\t\tsuper(new BorderLayout());\n\t\t// brings in image 20Q.jpg\n//\t\timage = new Image(\"20Q.jpg\");\n\t\t// makes a new instace of the controller\n\t\tcontroller = new TwentyQuestionsController();\n\t\t// starts at the root of the treee\n\t\tcurrent = controller.tree.getRoot();\n\t\t// calls the method which initializes the GUI\n\t\tinitGUI();\n\n\t}", "public String getQuestion() {\n return question;\n }", "private void intializeQuizView() {\n\t\tfor (Question question : quiz.getQuestionList()) {\n\t\t\tQuestionJPanel panel = null;\n\t\t\tswitch (question.getQuestionType()) {\n\t\t\tcase MultipleChoice:\n\t\t\t\tpanel = new MultipleChoicePanel(question);\n\t\t\t\tbreak;\n\t\t\tcase ExclusiveChoice:\n\t\t\t\tpanel = new ExclusiveChoicePanel(question);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new RuntimeException(\"Not implemented\");\n\t\t\t}\n\t\t\tpanelList.add(panel);\n\t\t\tquestionsPanel.add(panel);\n\t\t}\n\t}", "private void setQuestion() {\n Question.setText(gen.getQuestion() + \"\\t\\tProblem # \" + currentQuestion + \"/\" + numQuestions);\n }", "public abstract void generateQuestion();", "public String getQuestion() {\n\t\treturn question;\n\t}", "public void setQuestion(String question) {\n this.question = question;\n }", "public Question getQuestion() {\n return this.question;\n }", "public void setQuestion(){\n\n\n triggerReport(); //Check if max questions are displayed, if yes then show report\n\n MyDatabase db = new MyDatabase(QuizCorner.this);\n Cursor words = db.getQuizQuestion();\n TextView question_text = (TextView) findViewById(R.id.question_text);\n RadioButton rb;\n resetOptions();\n disableCheck();\n enableRadioButtons();\n hideAnswer();\n words.moveToFirst();\n word = words.getString(words.getColumnIndex(\"word\"));\n correct_answer = words.getString(words.getColumnIndex(\"meaning\"));\n question_text.setText(word + \" means:\");\n for (int i = 0; i < 4; i++){\n answers[i] = words.getString(words.getColumnIndex(\"meaning\"));\n words.moveToNext();\n }\n answers = randomizeArray(answers);\n for (int i = 0; i < 4; i++){\n rb = (RadioButton) findViewById(options[i]);\n rb.setText(answers[i]);\n }\n question_displayed_count++;\n }", "@Override\n\tpublic String getQuestionAnswerText() {\n\t\treturn null;\n\t}", "public void quizCreate(View view)\n {\n //Create screen\n correctOption = r.nextInt(4) + 1;\n int rand = generateRandom(r);\n\n setContentView(R.layout.quiz_layout1);\n ImageView pokeImage = (ImageView) findViewById(R.id.quiz_image);\n if (rand <= 0) {\n return;\n }\n int imageInt = getResources().getIdentifier(imageFilePrefix + rand, \"drawable\", getPackageName());\n pokeImage.setImageResource(imageInt);\n Button correctButton = (Button) findViewById(options.get(correctOption));\n correctButton.setText(myDbHelper.queryName(rand));\n\n }", "public abstract void selectQuestion();", "public seViewAnswerUI() {\n initComponents();\n }", "public Question getQuestion() {\n\t\treturn questionToAsk;\n\t}", "private void setQuestionView() {\n textView.setText(currentQuestion.getQuestion());\n buttonA.setText(currentQuestion.getOptA());\n buttonB.setText(currentQuestion.getOptB());\n buttonC.setText(currentQuestion.getOptC());\n numberText.setText(\"Question \" + (questionID + 1) + \" of \" + questionList.size());\n questionID++;\n }", "public void showQuestion(int i) {\n i--;\n VocabularyQuiz question = gui.getQuiz().viewQuiz(i);\n JLabel header = new JLabel(\"Question\" + (i + 1));\n gui.getConstraints().insets = new Insets(10, 10,40,10);\n header.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 28));\n gui.getConstraints().gridx = 0;\n gui.getConstraints().gridy = 0;\n gui.getPanel().add(header, gui.getConstraints());\n JTextArea description = new JTextArea(\"What is meaning of \\\"\" + question.getVocabulary().getVocab() + \"\\\"?\");\n description.setEditable(false);\n description.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 18));\n gui.getConstraints().gridy = 1;\n gui.getPanel().add(description, gui.getConstraints());\n showChoices(question);\n }", "public abstract String chooseAnswer();", "@RequestMapping\n\tprotected String defaultView(RenderRequest renderRequest) {\n\t\tString tipoReplicador;\n\t\ttipoReplicador = renderRequest.getPreferences().getValue(\"tipoReplicador\", \"\");\n\n\t\trenderRequest.setAttribute(\"tipoReplicador\", tipoReplicador);\n\t\t// JSonUtil.LogAuditoria(renderRequest, indicadorPortlet, indicadorController);\n\n\t\treturn \"edit\";\n\t}", "public TextField getQuestion() {\r\n\t\tquestion.setPromptText(\"question\");\r\n\t\treturn question;\r\n\t}", "Question getQuestion(String questionId);", "private void fetchNewQuestion()\r\n\t{\r\n\t\t//Gets question and answers from model\r\n\t\tString[] question = quizModel.getNewQuestion();\r\n\t\t\r\n\t\t//Allocates answers to a new ArrayList then shuffles them randomly\r\n\t\tArrayList<String> answers = new ArrayList<String>();\r\n\t\tanswers.add(question[1]);\r\n\t\tanswers.add(question[2]);\r\n\t\tanswers.add(question[3]);\r\n\t\tanswers.add(question[4]);\r\n\t\tCollections.shuffle(answers);\r\n\t\t\r\n\t\t//Allocates north label to the question\r\n\t\tnorthLabel.setText(\"<html><div style='text-align: center;'>\" + question[0] + \"</div></html>\");\r\n\t\t\r\n\t\t//Allocates each radio button to a possible answer. Based on strings, so randomly generated questions...\r\n\t\t//...which by chance repeat a correct answer in two slots, either will award the user a point.\r\n\t\toption1.setText(answers.get(0));\r\n\t\toption2.setText(answers.get(1));\r\n\t\toption3.setText(answers.get(2));\r\n\t\toption4.setText(answers.get(3));\r\n\t\toption1.setActionCommand(answers.get(0));\r\n\t\toption2.setActionCommand(answers.get(1));\r\n\t\toption3.setActionCommand(answers.get(2));\r\n\t\toption4.setActionCommand(answers.get(3));\r\n\t\toption1.setSelected(true);\r\n\t\t\r\n\t\t//Update score\r\n\t\tscoreLabel.setText(\"<html><div style='text-align: center;'>\" + \"Score = \" + quizModel.getScore() + \"</div></html>\");\r\n\t}", "public String getQuestion() {\n return mQuestion;\n }", "public static void hitQuiz()\n\t{\n\t\tQuestion q = Home.questionList.get((int)(Math.random()*Home.questionList.size()));\n\t\tQuizQuestion q1= new QuizQuestion(q);\n\t\tq1.setAlwaysOnTop(true);\n\t\tq1.setVisible(true);\n\t\tsuspend();\n\t}", "public void showCorrectAnswers() {\n holders.forEach(QuizViewHolder::showCorrectAnswer);\n }", "public void chooseAnswer(View view)\n {\n\n if(view.getTag().toString().equals(Integer.toString(pos_of_correct)))\n {\n //Log.i(\"Result\",\"Correct Answer\");\n correct++;\n noOfQues++;\n correct();\n }\n else\n {\n //Log.i(\"Result\",\"Incorrect Answer\");\n //resluttextview.setText(\"Incorrect!\");\n incorrect();\n noOfQues++;\n }\n pointtextView.setText(Integer.toString(correct)+\"/\"+Integer.toString(noOfQues));\n if(tag==4)\n generateAdditionQuestion();\n if(tag==5)\n generateSubtractionQuestion();\n if(tag==6)\n generateMultiplicationQuestion();\n if(tag==7)\n generateDivisionQuestion();\n\n }", "@Override\n\tpublic String getInitialViewKml() {\n\t\treturn null;\n\t}", "public void question() {\n\t\tlead.answer(this);\n\t}", "public interface IQuestionnaireView {\n /**\n * This interface helps to update view on Questioner View\n * */\n void startProgress();\n void stopProgress();\n\n /**\n * Each question index should match with the index of HashMap\n * Integer\n *\n * @param questions : header for questionnaire\n * @param listItems : each sub item of header\n * */\n void questionerDownloadedSuccessfully(ArrayList<MQuestion> questions, HashMap<Integer, ArrayList<MListItem>> listItems);\n void problemOccurredWhileFetchingQuestionnaire(String problem);\n void questionerAnswerUploadedSuccessfully(String exitMessage);\n void problemOccurredWhilePushingQuestionnaireAnswer(ArrayList<MQuesRespWarning> error, String e);\n}", "public void showQuestion()\n\t{\n\t\tSystem.out.println(ans);\n\t\tfor(int k = 0; k<numAns; k++)\n\t\t{\n\t\t\tSystem.out.println(k+\". \"+answers[k]);\n\t\t}\n\t}", "public Question getQuestion()\n {\n return currentQuestion;\n }", "public abstract String getView();", "public void setQuestion(String question) {\n\t\tthis.question = question;\n\t}", "public interface View{\n void setupViews();\n void onClickSubmitReview();\n void showSuccessfullReviewSubmit();\n void showErrorSubmitReview();\n }", "@GetMapping(value=\"/getQuestion/{questionId}\")\n\tpublic Question getQuestion(@PathVariable(\"questionId\") int id) throws QuestionException{\n\t\tLOGGER.info(\"Viewing Question By Id\");\n\t\treturn questionObj.viewQuestionById(id);\n\t}", "@Override\r\n\tpublic String toString() {\r\n\t\treturn question;\r\n\t}", "@Override\r\n\tpublic String getType() {\r\n\t\treturn \"QuestionInExam\";\r\n\t}", "public QuestionPanel (int surveyId, final int questionIndex)\n {\n setStyleName(\"question\");\n setWidth(\"100%\");\n setSpacing(10);\n\n // show a loading message and load em up\n add(MsoyUI.createLabel(_msgs.loadingSurvey(), null));\n _cache.getQuestions(surveyId, new AsyncCallback<SurveyWithQuestions>() {\n public void onSuccess(SurveyWithQuestions result) {\n clear();\n _questionIndex = questionIndex;\n init(result.survey, result.getQuestion(questionIndex));\n }\n public void onFailure(Throwable caught) {\n clear();\n add(MsoyUI.createLabel(_msgs.errSurveyNotLoaded(caught.getMessage()), null));\n }\n });\n }", "public Question() {\n\t\tthis(\"QUESTION\", null);\n\t}", "public void toQuiz(View view) throws Error {\n myDbHelper = new DataBaseHelper(this);\n try {\n myDbHelper.createDataBase();\n } catch (IOException ioe) {\n throw new Error(\"Unable to create database\");\n }\n myDbHelper.openDataBase();\n\n r = new Random();\n nums = new LinkedList<Integer>();\n for(int i=1;i<number_pokemon+1;i++)\n {\n nums.add(i);\n }\n options = new HashMap<Integer, Integer>();\n options.put(R.id.quiz_option1,1);\n options.put(R.id.quiz_option2,2);\n options.put(R.id.quiz_option3,3);\n options.put(R.id.quiz_option4,4);\n options.put(1,R.id.quiz_option1);\n options.put(2,R.id.quiz_option2);\n options.put(3,R.id.quiz_option3);\n options.put(4,R.id.quiz_option4);\n\n quizCreate(view);\n }", "public SurveyQuestion getQuestion (int idx)\n {\n if (idx >= 0 && idx < questions.size()) {\n return questions.get(idx);\n }\n return null;\n }", "public String handleDefault() \n throws HttpPresentationException \n {\n\t return showEditPage(null);\n }", "public void setQuestion(){\n String welcomeTextString = \"Welcome \" + getIntent().getStringExtra(\"name\") + \"!\";\n welcomeText.setText(welcomeTextString);\n\n //Setting Question title, description, and answers\n questionTitle.setText(questions[currentQuestion-1][0]);\n questionDescription.setText(questions[currentQuestion-1][1]);\n ans1.setText(questions[currentQuestion-1][2]);\n ans2.setText(questions[currentQuestion-1][3]);\n ans3.setText(questions[currentQuestion-1][4]);\n\n //Save correct answer\n correctAnswer = questions[currentQuestion-1][5];\n\n //Set progress bar and progress text\n progressBar.setProgress(currentQuestion);\n progressText.setText(currentQuestion.toString() + \"/5\");\n\n //Clear selection of buttons if any are already selected\n ans1.setBackgroundColor(getResources().getColor(R.color.ans_btn));\n ans2.setBackgroundColor(getResources().getColor(R.color.ans_btn));\n ans3.setBackgroundColor(getResources().getColor(R.color.ans_btn));\n }", "private void setQuestionView() {\n\n if (currentQ.getIsImageQuestion()) {\n\n radioGroup.clearCheck();\n\n byte [] imageInByte = questionList.get(qid).getImageResource();\n\n ByteArrayInputStream imageStream = new ByteArrayInputStream(imageInByte);\n Bitmap theImage = BitmapFactory.decodeStream(imageStream);\n imageView.setImageBitmap(theImage);\n imageView.setVisibility(View.VISIBLE);\n\n txtQuestionNumber.setText(\"Question \" + (qid + 1));\n question.setText(currentQ.getQuestion());\n radio0.setText(currentQ.getA1());\n radio1.setText(currentQ.getA2());\n radio2.setText(currentQ.getA3());\n radio3.setText(currentQ.getA4());\n\n qid++;\n\n }else {\n\n radioGroup.clearCheck();\n\n imageView.setVisibility(View.GONE);\n\n txtQuestionNumber.setText(\"Question \" + (qid + 1));\n question.setText(currentQ.getQuestion());\n radio0.setText(currentQ.getA1());\n radio1.setText(currentQ.getA2());\n radio2.setText(currentQ.getA3());\n radio3.setText(currentQ.getA4());\n\n qid++;\n\n\n }\n }", "@Override\r\n public boolean getDefaultAnswer() {\n return true;\r\n }", "public void addQuestion(View view) {\n startActivity(new Intent(MainActivity.this, DicebreakerQuestions.class));\n\n }", "private void creatingNewQuestion() {\r\n AbstractStatement<?> s;\r\n ListQuestions lq = new ListQuestions(ThemesController.getThemeSelected());\r\n switch ((String) typeQuestion.getValue()) {\r\n case \"TrueFalse\":\r\n // just to be sure the answer corresponds to the json file\r\n Boolean answer = CorrectAnswer.getText().equalsIgnoreCase(\"true\");\r\n s = new TrueFalse<>(Text.getText(), answer);\r\n break;\r\n\r\n case \"MCQ\":\r\n s = new MCQ<>(Text.getText(), TextAnswer1.getText(), TextAnswer2.getText(), TextAnswer3.getText(), CorrectAnswer.getText());\r\n break;\r\n\r\n default:\r\n s = new ShortAnswer<>(Text.getText(), CorrectAnswer.getText());\r\n break;\r\n }\r\n lq.addQuestion(new Question(s, ThemesController.getThemeSelected(), Difficulty.fromInteger((Integer) difficulty.getValue()) ));\r\n lq.writeJson(ThemesController.getThemeSelected());\r\n }", "public String getQuestionname() {\n return questionname;\n }", "public String getView();", "public String getView();", "public Quiz() {\n\t\tcreateAndLayoutComponents();\n\n\t\t// stretch spelling on words to let 2nd language learners have more time to process an unfamiliar language\n\t\ttheVoiceStretch = 1.2;\n\t\ttheVoicePitch = 95;\n\t\ttheVoiceRange = 15;\n\n\t\t// initialise voice generator for VoxSpell\n\t\tvoiceGen = new VoiceGenerator(theVoice,theVoiceStretch,theVoicePitch,theVoiceRange);\n\n\t\t// initialise voice generator for the respell button\n\t\trespellGen = new VoiceGenerator(theVoice,theVoiceStretch,theVoicePitch,theVoiceRange);\n\t\t// immediately cancel it to allow the respell button to work on the first try to only work when \n\t\t// none of the voice generators are in action\n\t\trespellGen.cancel(true); \n\n\n\t\t// enable input accepting when enter button is pressed\n\t\tuserInput.addKeyListener(this);\n\t\tthis.setFocusable(true);\n\t\tthis.addKeyListener(this);\n\n\t\tapplyTheme();\n\t\t\n\t\t// Initialise spellList model which all questions will be asked from and answers will be checked against\n\t\tspellList = new SpellList();\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tgotoFAQView();\n\t\t\t}", "@Override\n public final GameQuestion getActiveQuestion() {\n return this.activeQuestion;\n }", "@GetMapping(\"/quiz/all/{qid}\")\n\tpublic ResponseEntity<?> getQuestionsOfQuizAdmin(@PathVariable(\"qid\") Long qid){\n\t\tQuiz quiz = new Quiz();\n\t\tquiz.setqId(qid);\n\t\tSet<Question> questionsOfQuiz = this.questionService.getQuestionOfQuiz(quiz);\n\t\treturn ResponseEntity.ok(questionsOfQuiz);\t\t\n\t}", "public QuestionPanel (int surveyId)\n {\n this(surveyId, -1);\n }", "public int getIdQuestion() {\r\n return idQuestion;\r\n }", "public String getQuestionContent() {\n return questionContent;\n }", "public Map<BigInteger, Question> showQuestions() throws UserException {\n\t\treturn null;\r\n\t}", "protected ReliedOnView() {}", "Question getQuestionInDraw(String questionId);", "public void execute(View view){\n //method in view to show the choice\n }", "public int getQuestionType() {\r\n\t\treturn questionType;\r\n\t}", "public QuestionLearningObjectiveSubViewImpl getQuestionLearningObjectiveSubViewImpl();", "public String getQuestionType() {\n return questionType;\n }", "@GetMapping(\"/quiz/{qid}\")\n\tpublic ResponseEntity<?> getQuestionsOfQuiz(@PathVariable(\"qid\") Long qid){\n\t\tQuiz quiz = this.quizService.getQuiz(qid);\n\t\tSet<Question> questions = quiz.getQuestions();\n\t\tList<Question> list = new ArrayList<>(questions);\n\t\tif(list.size() > Integer.parseInt(quiz.getNumberOfQuestions())) {\n\t\t\tlist = list.subList(0, Integer.parseInt(quiz.getNumberOfQuestions()));\n\t\t}\n\t\t\n\t\tlist.forEach((q)-> {\n\t\t\tq.setAnswer(\"\");\n\t\t});\n\t\t\n\t\tCollections.shuffle(list);\n\t\treturn ResponseEntity.ok(list);\n\t}", "public FAQ(String question, String answer){\n\t\tthis.question = question;\n\t\tthis.answer = answer;\n\t}", "public TextQuestionHolder(View view) {\n super(view);\n questionTextView = view.findViewById(R.id.questionTextView);\n questionIcon = view.findViewById(R.id.questionIcon);\n answerEditText = view.findViewById(R.id.answerEditText);\n answerDisplayer = view.findViewById(R.id.answerDisplayerTextView);\n possibleSolutionLayout = view.findViewById(R.id.solutionDisplayerLayout);\n //can't change theme in exams, so this can be done once, here\n if (ThemeUtils.isDarkTheme()) {\n int accent = ContextCompat.getColor(view.getContext(), R.color.colorPrimaryDark_Dark);\n view.findViewById(R.id.questionSep1).setBackgroundColor(accent);\n view.findViewById(R.id.questionSep2).setBackgroundColor(accent);\n view.setBackground(ContextCompat.getDrawable(view.getContext(), R.drawable.question_background_dark));\n }\n }", "public int getIdQuestion() {\n return idQuestion;\n }", "@Override\n public String ask(String question) {\n return answers[position++];\n }", "private ShowCreateAnswerPage() {\n this.service = UserService.retrieve();\n this.validator = Validator.retrieve();\n }", "public void SetUpNewView(ArrayList<QuestionModel> questionBank ,QuestionModel questionModel) throws IOException {\n questionModel.setQuestionType(\"Fill in The Blank\");\n questionBank.add(questionModel);\n DBObject.getInstance().setQuestionBank(questionBank);\n\n FXMLLoader parentLoader = new FXMLLoader(getClass().getResource(\"/question/views/first.fxml\"));\n Parent nextSceneParent = parentLoader.load();\n Scene nextScene = new Scene(nextSceneParent);\n\n QuestionController test = parentLoader.getController();\n test.populateInterface(currStage);\n test.setUpTable();\n\n currStage.setScene(nextScene);\n currStage.show();\n }", "public Model() {\n\t\t\n\t\t\n\t\t\n\t\t\n\tquestionMap = new HashMap<String, Question>();\n\t\n\tQuestion q1 = new Question(\"Climate\");\n\tq1.setContent(\"Do you prefer hot Climate to Cold Climate?\");\n\tquestionMap.put(q1.getAbbrev(), q1);\n\t\n\tQuestion q2 = new Question(\"Cost of Living\");\n\tq2.setContent(\"Do you prefer high cost of living areas?\");\n\tquestionMap.put(q2.getAbbrev(), q2);\n\t\n\tQuestion q3 = new Question(\"Population Density\");\n\tq3.setContent(\"Do you prefer high population to low population density areas?\");\n\tquestionMap.put(q3.getAbbrev(), q3);\n\t\n\tQuestion q4 = new Question(\"Job Opportunity\");\n\tq4.setContent(\"Do you prefer higher Job Opportunity areas?\");\n\tquestionMap.put(q4.getAbbrev(), q4);\n\t\n\tQuestion q5 = new Question(\"Crime Rates\");\n\tq5.setContent(\"Do you prefer high crime rate areas?\");\n\tquestionMap.put(q5.getAbbrev(), q5);\n\n\t\n\t}", "@Override\n public Fragment getItem(int position) {\n Fragment frag = null;\n Log.d(\"Mike\", \"getItem is called \"+position);\n if (position==0){ // First survey question\n frag=new Question1();\n }\n if (position==1){// 2nd survey question\n frag=new Question2();\n }\n if (position==2){// 3rd survey question\n frag=new Question3();\n }\n if (position==3){// 4th survey question\n frag=new Question4();\n }\n if (position==4){ // ect...\n frag=new Question5();\n }\n if (position==5){\n frag=new Question6();\n }\n if (position==6){\n frag=new Question7();\n }\n if (position==7){\n frag=new Question8();\n }\n if (position==8){\n frag=new Question9();\n }\n if (position==9){\n frag=new Question10();\n }\n return frag;\n }", "public void setQuestion(){\n txt_question.setText(arrayList.get(quesAttempted).getQuestion());\n txt_optionA.setText(arrayList.get(quesAttempted).getOptionA());\n txt_optionB.setText(arrayList.get(quesAttempted).getOptionB());\n txt_optionC.setText(arrayList.get(quesAttempted).getOptionC());\n txt_optionD.setText(arrayList.get(quesAttempted).getOptionD());\n txt_que_count.setText(\"Que: \"+(quesAttempted+1)+\"/\"+totalQues);\n txt_score.setText(\"Score: \"+setScore);\n }", "View getActiveView();", "public QuestionsScreen() {\n initComponents();\n\n \n File file = new File(\"summativeCSQuestions.xml\");\n readXML(file);\n\n \n \n \n questionNumber = 1;\n \n String question = questions.get(questionNumber - 1).getFirstChildElement(\"actualQuestion\").getValue();\n\n String optionA = questions.get(questionNumber - 1).getFirstChildElement(\"optionA\").getValue();\n String optionB = questions.get(questionNumber - 1).getFirstChildElement(\"optionB\").getValue();\n String optionC = questions.get(questionNumber - 1).getFirstChildElement(\"optionC\").getValue();\n String optionD = questions.get(questionNumber - 1).getFirstChildElement(\"optionD\").getValue();\n\n jTextAreaQuestion.setText(question);\n jTextAreaOptionA.setText(optionA);\n jTextAreaOptionB.setText(optionB);\n jTextAreaOptionC.setText(optionC);\n jTextAreaOptionD.setText(optionD);\n\n jTextFieldQuestionNum.setText(\"\" + questionNumber );\n jTextFieldScore.setText(\"\" + score);\n jTextFieldAnswerChecked.setText(\"Select an Answer.\");\n jButtonNext.setText(\"Check Answer\");\n \n\n }", "public int getQuestionId() {\n return questionId;\n }", "public int getQuestionId() {\n return questionId;\n }", "public void printQuestion() {\n\t\tSystem.out.println(question);\n\t}", "public QuestionaireImpl() {\n\t\t//cannot use working constructor because title could not be set\n\t\t//to an empty string through setTitle\n\t\tfTitle = \"\";\n\t\tsetQuestions(QuestionFactory.createCollection());\n\t\tsetAuthor(PersonFactory.getNullPerson());\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v= inflater.inflate(R.layout.fragment_quiz, container, false);\n\n\n coordinatorLayout = v.findViewById(R.id.layout_coordinate_quiz_question);\n\n //Firebase\n database = FirebaseDatabase.getInstance();\n questions = database.getReference(\"Questions\");\n//\n// if (ActivityCompat.checkSelfPermission(getActivity(), android.Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {\n// ActivityCompat.requestPermissions(getActivity(), new String[]{Manifest.permission.CAMERA}, 1);\n// Toast.makeText(getActivity(), \"Permission not granted!\\n Grant permission and restart app\", Toast.LENGTH_SHORT).show();\n// }else{\n// init();\n// }\n\n //Views\n txtScore = v.findViewById(R.id.txt_score);\n txtQuestionNum = v.findViewById(R.id.txt_total_question);\n questionText = v.findViewById(R.id.tv_question_display);\n\n progressBar = v.findViewById(R.id.progress_bar);\n\n btnA = v.findViewById(R.id.btn_option1);\n btnB = v.findViewById(R.id.btn_option2);\n btnC = v.findViewById(R.id.btn_option3);\n btnD = v.findViewById(R.id.btn_option4);\n\n btnA.setOnClickListener(this);\n btnB.setOnClickListener(this);\n btnC.setOnClickListener(this);\n btnD.setOnClickListener(this);\n\n return v;\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_answer_question);\n queId = getIntent().getStringExtra(\"id\");\n initView();\n getAnswerCache();\n }", "private void goToSelectedQuestion(int questionindex){\n radioGroup.setEnabled(true);\n saveAnswer();\n mQuestionIndex = questionindex;\n unSelectRadioButtons();\n updateQuestion();\n\n loadRadioButtonSelection();\n\n\n }", "private void initViews() {\n questionOne = findViewById(R.id.questionOneTV);\n questionTwo = findViewById(R.id.questionTwoTV);\n questionThree = findViewById(R.id.questionThreeTV);\n questionFour = findViewById(R.id.questionFourTV);\n questionFive = findViewById(R.id.questionFiveTV);\n questionSix = findViewById(R.id.questionSixTV);\n\n answerOne = findViewById(R.id.answerOneTIET);\n answerFour = findViewById(R.id.answerFourTIET);\n\n answerTwo = findViewById(R.id.answerTwoRG);\n answerTwoOptionA = findViewById(R.id.answerTwoRB1);\n answerTwoOptionB = findViewById(R.id.answerTwoRB2);\n answerTwoOptionC = findViewById(R.id.answerTwoRB3);\n answerTwoOptionD = findViewById(R.id.answerTwoRB4);\n\n answerThreeOptionA = findViewById(R.id.answerThreeCB1);\n answerThreeOptionB = findViewById(R.id.answerThreeCB2);\n answerThreeOptionC = findViewById(R.id.answerThreeCB3);\n answerThreeOptionD = findViewById(R.id.answerThreeCB4);\n\n answerFive = findViewById(R.id.answerFiveRG);\n answerFiveOptionA = findViewById(R.id.answerFiveRB1);\n answerFiveOptionB = findViewById(R.id.answerFiveRB2);\n answerFiveOptionC = findViewById(R.id.answerFiveRB3);\n answerFiveOptionD = findViewById(R.id.answerFiveRB4);\n\n answerSixOptionA = findViewById(R.id.answerSixCB1);\n answerSixOptionB = findViewById(R.id.answerSixCB2);\n answerSixOptionC = findViewById(R.id.answerSixCB3);\n answerSixOptionD = findViewById(R.id.answerSixCB4);\n\n submitButton = findViewById(R.id.submitButton);\n submitButton.setOnClickListener(this);\n\n }", "@FXML\n\tprivate void answerQuestion() {\n\t\tint correctAnsID = 0;\n\t\ttry {\n\t\t\tswitch (((RadioButton) answerGroup.getSelectedToggle()).getId()) {\n\t\t\tcase \"ans1Check\":\n\t\t\t\tcorrectAnsID = 1;\n\t\t\t\tbreak;\n\t\t\tcase \"ans2Check\":\n\t\t\t\tcorrectAnsID = 2;\n\t\t\t\tbreak;\n\t\t\tcase \"ans3Check\":\n\t\t\t\tcorrectAnsID = 3;\n\t\t\t\tbreak;\n\t\t\tcase \"ans4Check\":\n\t\t\t\tcorrectAnsID = 4;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\terrorLabel.setVisible(true);\n\t\t}\n\n\t\t// nothing is selected\n\t\tif (correctAnsID == 0) { \n\t\t\terrorLabel.setVisible(true);\n\t\t\t// correct answer\n\t\t} else if (question.getCorrect_ans() == correctAnsID) {\n\t\t\tcontrol.setScore(control.getScore() + question.getScore());\n\t\t\thandleAlertAndWindow(AlertType.INFORMATION, \"Congrats! :D\",\n\t\t\t\t\t\"You received \" + question.getScore() + \" points\");\n\t\t\t// wrong answer\n\t\t} else {\n\t\t\tcontrol.setScore(control.getScore() + question.getPenalty());\n\n\t\t\thandleAlertAndWindow(AlertType.ERROR, \"Uh oh! :(\",\n\t\t\t\t\t\"You lost \" + question.getPenalty() + \" points\");\n\t\t}\n\n\t\t// reset the eaten question\n\t\tViewLogic.playGameController.getControl().setQuestionEaten(null);\n\t}", "public void takeAction() {\n mRelativeLayout.setVisibility(View.INVISIBLE);\n currentQuestion = questionList.get(questionID);\n textView = findViewById(R.id.questionText);\n buttonA = findViewById(R.id.radioA);\n buttonB = findViewById(R.id.radioB);\n buttonC = findViewById(R.id.radioC);\n button = findViewById(R.id.button);\n setQuestionView();\n button.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n RadioGroup radioGroup = findViewById(R.id.radioGroup);\n\n if (radioGroup.getCheckedRadioButtonId() == -1) {\n return;\n }\n\n RadioButton answer = findViewById(radioGroup.getCheckedRadioButtonId());\n\n radioGroup.clearCheck();\n\n if (currentQuestion.getAnswer().equals(answer.getText())) {\n score++;\n }\n\n // checks if all questions have been answered and opens the result page\n if (questionID < questionList.size()) {\n currentQuestion = questionList.get(questionID);\n setQuestionView();\n } else {\n Intent intent = new Intent(QuizActivity.this, ResultActivity.class);\n Bundle bundle = new Bundle();\n ResultHolder answers = new ResultHolder(questionList);\n bundle.putSerializable(\"answers\", answers);\n bundle.putInt(\"score\", score);\n intent.putExtras(bundle);\n startActivity(intent);\n finish();\n }\n }\n });\n\n }", "public void showNextQuestion() {\n currentQuiz++;\n gui.setUp();\n if (currentQuiz <= VocabularyQuizList.MAX_NUMBER_QUIZ) {\n showQuestion(currentQuiz);\n } else {\n result();\n }\n gui.getFrame().setVisible(true);\n }", "public void testEmptyQuiz(){\n onView(withId(R.id.quiz_button)).perform(click());\n onView(withId(R.id.quiz_make)).perform(click());\n onView(withId(R.id.submit_button)).perform(click());\n Activity current = getActivity();\n assertNotNull(current);\n onView(withId(R.id.homeButton));\n }" ]
[ "0.69674885", "0.61653924", "0.6074775", "0.60687137", "0.6056943", "0.60542214", "0.6026235", "0.6006747", "0.5944213", "0.5890796", "0.58550847", "0.5804639", "0.5716986", "0.5700818", "0.5675621", "0.5666096", "0.5660063", "0.5632518", "0.56234735", "0.56120026", "0.55987537", "0.5577651", "0.55651486", "0.5563475", "0.555475", "0.5552929", "0.55432755", "0.55199826", "0.55010444", "0.5498008", "0.5497067", "0.54740906", "0.5470599", "0.54685813", "0.5466905", "0.54637897", "0.54574376", "0.5445534", "0.5443042", "0.54271257", "0.54255265", "0.5415242", "0.54069936", "0.54055446", "0.53969693", "0.53966707", "0.5390121", "0.5389755", "0.5386306", "0.53703445", "0.5366751", "0.5363998", "0.5363763", "0.5363131", "0.53623956", "0.5357996", "0.5349107", "0.53441095", "0.533956", "0.53361017", "0.5330121", "0.5330121", "0.5325262", "0.53216904", "0.530789", "0.52930266", "0.5292491", "0.5291132", "0.5287723", "0.5287135", "0.52806515", "0.52777946", "0.52748597", "0.5273917", "0.52665484", "0.5265139", "0.52647924", "0.52612734", "0.524565", "0.52388906", "0.52255934", "0.5215833", "0.52122617", "0.521058", "0.52064925", "0.5201579", "0.5201451", "0.5200779", "0.5193083", "0.51910406", "0.5187072", "0.51860577", "0.5183077", "0.5182197", "0.5179923", "0.51736736", "0.5170999", "0.5169831", "0.5165446", "0.516089" ]
0.59243745
9
Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR call it in your code!
private void $$$setupUI$$$() { panel_ProfessorApp = new JPanel(); panel_ProfessorApp.setLayout(new GridLayoutManager(4, 1, new Insets(0, 0, 0, 0), -1, -1)); final JPanel panel1 = new JPanel(); panel1.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); panel_ProfessorApp.add(panel1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); questionNumberLabel = new JLabel(); questionNumberLabel.setText("Question 1"); panel1.add(questionNumberLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); QuestionInput = new JTextArea(); QuestionInput.setText(""); panel_ProfessorApp.add(QuestionInput, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(150, 50), null, 0, false)); final JPanel panel2 = new JPanel(); panel2.setLayout(new GridLayoutManager(4, 2, new Insets(0, 0, 0, 0), -1, -1)); panel_ProfessorApp.add(panel2, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); answerInput1 = new JTextField(); answerInput1.setText("Answer Text"); panel2.add(answerInput1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); answerInput2 = new JTextField(); answerInput2.setText("Answer Text"); panel2.add(answerInput2, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); answerInput3 = new JTextField(); answerInput3.setText("Answer Text"); panel2.add(answerInput3, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); answerInput4 = new JTextField(); answerInput4.setText("Answer Text"); panel2.add(answerInput4, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); OptionA = new JRadioButton(); OptionA.setText("A"); panel2.add(OptionA, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); OptionB = new JRadioButton(); OptionB.setText("B"); panel2.add(OptionB, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); OptionC = new JRadioButton(); OptionC.setText("C"); panel2.add(OptionC, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); OptionD = new JRadioButton(); OptionD.setText("D"); panel2.add(OptionD, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); final JPanel panel3 = new JPanel(); panel3.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1)); panel_ProfessorApp.add(panel3, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); nextButton = new JButton(); nextButton.setText("Next"); panel3.add(nextButton, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); final Spacer spacer1 = new Spacer(); panel3.add(spacer1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); saveButton = new JButton(); saveButton.setText("Save"); panel3.add(saveButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); ButtonGroup buttonGroup; buttonGroup = new ButtonGroup(); buttonGroup.add(OptionA); buttonGroup.add(OptionB); buttonGroup.add(OptionC); buttonGroup.add(OptionD); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tprotected void UpdateUI() {\n\t\t\n\t}", "@Override\n\tprotected void UpdateUI() {\n\t\t\n\t}", "@Override\n\tpublic void guiTinNhan() {\n\n\t}", "@Override\n\tprotected void setValueOnUi() {\n\n\t}", "@Override\n public void initGUI() {\n\n }", "private void $$$setupUI$$$() {\n ST = new JPanel();\n ST.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(6, 7, new Insets(0, 0, 0, 0), -1, -1));\n final com.intellij.uiDesigner.core.Spacer spacer1 = new com.intellij.uiDesigner.core.Spacer();\n ST.add(spacer1, new com.intellij.uiDesigner.core.GridConstraints(3, 0, 2, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer2 = new com.intellij.uiDesigner.core.Spacer();\n ST.add(spacer2, new com.intellij.uiDesigner.core.GridConstraints(1, 2, 1, 4, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer3 = new com.intellij.uiDesigner.core.Spacer();\n ST.add(spacer3, new com.intellij.uiDesigner.core.GridConstraints(1, 6, 4, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n enrereButton = new JButton();\n enrereButton.setText(\"Enrere\");\n ST.add(enrereButton, new com.intellij.uiDesigner.core.GridConstraints(4, 5, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer4 = new com.intellij.uiDesigner.core.Spacer();\n ST.add(spacer4, new com.intellij.uiDesigner.core.GridConstraints(5, 0, 1, 7, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer5 = new com.intellij.uiDesigner.core.Spacer();\n ST.add(spacer5, new com.intellij.uiDesigner.core.GridConstraints(4, 3, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer6 = new com.intellij.uiDesigner.core.Spacer();\n ST.add(spacer6, new com.intellij.uiDesigner.core.GridConstraints(4, 1, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n okButton = new JButton();\n okButton.setText(\"Ok\");\n ST.add(okButton, new com.intellij.uiDesigner.core.GridConstraints(4, 4, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n SP = new JScrollPane();\n ST.add(SP, new com.intellij.uiDesigner.core.GridConstraints(2, 1, 2, 5, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n list1 = new JList();\n SP.setViewportView(list1);\n TriaDiff = new JComboBox();\n final DefaultComboBoxModel defaultComboBoxModel1 = new DefaultComboBoxModel();\n defaultComboBoxModel1.addElement(\"Tria una dificultat...\");\n defaultComboBoxModel1.addElement(\"Fàcil\");\n defaultComboBoxModel1.addElement(\"Mitjà\");\n defaultComboBoxModel1.addElement(\"Dificil\");\n TriaDiff.setModel(defaultComboBoxModel1);\n ST.add(TriaDiff, new com.intellij.uiDesigner.core.GridConstraints(0, 3, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n }", "@Override\n public void initGui()\n {\n super.initGui();\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "@Override\r\n\tprotected void initUI() {\n\r\n\t}", "private void $$$setupUI$$$() {\n RG = new JPanel();\n RG.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(6, 6, new Insets(0, 0, 0, 0), -1, -1));\n RG.setOpaque(true);\n RG.setPreferredSize(new Dimension(348, 136));\n enrereButton = new JButton();\n enrereButton.setText(\"Enrere\");\n RG.add(enrereButton, new com.intellij.uiDesigner.core.GridConstraints(4, 2, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label1 = new JLabel();\n label1.setText(\"Nombre d'usuaris registrats:\");\n RG.add(label1, new com.intellij.uiDesigner.core.GridConstraints(0, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label2 = new JLabel();\n label2.setText(\"Nombre de partides jugades totals:\");\n RG.add(label2, new com.intellij.uiDesigner.core.GridConstraints(1, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n Jocs = new JLabel();\n Jocs.setText(\"Label\");\n RG.add(Jocs, new com.intellij.uiDesigner.core.GridConstraints(2, 3, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n Eljoc = new JLabel();\n Eljoc.setText(\"Label\");\n RG.add(Eljoc, new com.intellij.uiDesigner.core.GridConstraints(3, 3, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n Partides = new JLabel();\n Partides.setText(\"Label\");\n RG.add(Partides, new com.intellij.uiDesigner.core.GridConstraints(1, 3, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n Usuaris = new JLabel();\n Usuaris.setText(\"Label\");\n RG.add(Usuaris, new com.intellij.uiDesigner.core.GridConstraints(0, 3, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label3 = new JLabel();\n label3.setText(\"Joc més popular:\");\n RG.add(label3, new com.intellij.uiDesigner.core.GridConstraints(3, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label4 = new JLabel();\n label4.setText(\"Nombre de jocs totals:\");\n RG.add(label4, new com.intellij.uiDesigner.core.GridConstraints(2, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer1 = new com.intellij.uiDesigner.core.Spacer();\n RG.add(spacer1, new com.intellij.uiDesigner.core.GridConstraints(4, 4, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer2 = new com.intellij.uiDesigner.core.Spacer();\n RG.add(spacer2, new com.intellij.uiDesigner.core.GridConstraints(4, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer3 = new com.intellij.uiDesigner.core.Spacer();\n RG.add(spacer3, new com.intellij.uiDesigner.core.GridConstraints(1, 4, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer4 = new com.intellij.uiDesigner.core.Spacer();\n RG.add(spacer4, new com.intellij.uiDesigner.core.GridConstraints(0, 4, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer5 = new com.intellij.uiDesigner.core.Spacer();\n RG.add(spacer5, new com.intellij.uiDesigner.core.GridConstraints(2, 4, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer6 = new com.intellij.uiDesigner.core.Spacer();\n RG.add(spacer6, new com.intellij.uiDesigner.core.GridConstraints(3, 4, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer7 = new com.intellij.uiDesigner.core.Spacer();\n RG.add(spacer7, new com.intellij.uiDesigner.core.GridConstraints(3, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer8 = new com.intellij.uiDesigner.core.Spacer();\n RG.add(spacer8, new com.intellij.uiDesigner.core.GridConstraints(2, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer9 = new com.intellij.uiDesigner.core.Spacer();\n RG.add(spacer9, new com.intellij.uiDesigner.core.GridConstraints(1, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer10 = new com.intellij.uiDesigner.core.Spacer();\n RG.add(spacer10, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer11 = new com.intellij.uiDesigner.core.Spacer();\n RG.add(spacer11, new com.intellij.uiDesigner.core.GridConstraints(3, 5, 2, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer12 = new com.intellij.uiDesigner.core.Spacer();\n RG.add(spacer12, new com.intellij.uiDesigner.core.GridConstraints(2, 5, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer13 = new com.intellij.uiDesigner.core.Spacer();\n RG.add(spacer13, new com.intellij.uiDesigner.core.GridConstraints(1, 5, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer14 = new com.intellij.uiDesigner.core.Spacer();\n RG.add(spacer14, new com.intellij.uiDesigner.core.GridConstraints(0, 5, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer15 = new com.intellij.uiDesigner.core.Spacer();\n RG.add(spacer15, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer16 = new com.intellij.uiDesigner.core.Spacer();\n RG.add(spacer16, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer17 = new com.intellij.uiDesigner.core.Spacer();\n RG.add(spacer17, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer18 = new com.intellij.uiDesigner.core.Spacer();\n RG.add(spacer18, new com.intellij.uiDesigner.core.GridConstraints(3, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer19 = new com.intellij.uiDesigner.core.Spacer();\n RG.add(spacer19, new com.intellij.uiDesigner.core.GridConstraints(5, 0, 1, 6, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n }", "private void $$$setupUI$$$() {\n linea = new JPanel();\n linea.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(4, 3, new Insets(0, 0, 0, 0), -1, -1));\n addLineaButton = new JButton();\n addLineaButton.setText(\"addLinea\");\n linea.add(addLineaButton, new com.intellij.uiDesigner.core.GridConstraints(2, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n numLinea = new JTextField();\n linea.add(numLinea, new com.intellij.uiDesigner.core.GridConstraints(1, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer1 = new com.intellij.uiDesigner.core.Spacer();\n linea.add(spacer1, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer2 = new com.intellij.uiDesigner.core.Spacer();\n linea.add(spacer2, new com.intellij.uiDesigner.core.GridConstraints(2, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer3 = new com.intellij.uiDesigner.core.Spacer();\n linea.add(spacer3, new com.intellij.uiDesigner.core.GridConstraints(1, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer4 = new com.intellij.uiDesigner.core.Spacer();\n linea.add(spacer4, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer5 = new com.intellij.uiDesigner.core.Spacer();\n linea.add(spacer5, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer6 = new com.intellij.uiDesigner.core.Spacer();\n linea.add(spacer6, new com.intellij.uiDesigner.core.GridConstraints(3, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n }", "@Override\r\n public void updateUI() {\r\n }", "public void designerInputModified(DesignerEvent e);", "protected void setupUI() {\n\n }", "private void $$$setupUI$$$() {\n mainPanel = new JPanel();\n mainPanel.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(14, 6, new Insets(0, 0, 0, 0), -1, -1));\n final com.intellij.uiDesigner.core.Spacer spacer1 = new com.intellij.uiDesigner.core.Spacer();\n mainPanel.add(spacer1, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, new Dimension(-1, 20), new Dimension(20, -1), null, 0, false));\n final JLabel label1 = new JLabel();\n label1.setText(\"EUID\");\n mainPanel.add(label1, new com.intellij.uiDesigner.core.GridConstraints(2, 1, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n EUIDText = new JLabel();\n EUIDText.setText(\"Label\");\n mainPanel.add(EUIDText, new com.intellij.uiDesigner.core.GridConstraints(2, 3, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_EAST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label2 = new JLabel();\n label2.setText(\"x-coordinate\");\n mainPanel.add(label2, new com.intellij.uiDesigner.core.GridConstraints(3, 1, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n xPosSpinner = new JSpinner();\n mainPanel.add(xPosSpinner, new com.intellij.uiDesigner.core.GridConstraints(3, 3, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer2 = new com.intellij.uiDesigner.core.Spacer();\n mainPanel.add(spacer2, new com.intellij.uiDesigner.core.GridConstraints(3, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, new Dimension(10, -1), new Dimension(10, -1), null, 0, false));\n longitudeLabel = new JLabel();\n longitudeLabel.setText(\"Label\");\n mainPanel.add(longitudeLabel, new com.intellij.uiDesigner.core.GridConstraints(3, 4, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer3 = new com.intellij.uiDesigner.core.Spacer();\n mainPanel.add(spacer3, new com.intellij.uiDesigner.core.GridConstraints(3, 5, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, new Dimension(10, -1), new Dimension(10, -1), null, 0, false));\n final JLabel label3 = new JLabel();\n label3.setText(\"y-coordinate\");\n mainPanel.add(label3, new com.intellij.uiDesigner.core.GridConstraints(4, 1, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n yPosSpinner = new JSpinner();\n mainPanel.add(yPosSpinner, new com.intellij.uiDesigner.core.GridConstraints(4, 3, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n latitudeLabel = new JLabel();\n latitudeLabel.setText(\"Label\");\n mainPanel.add(latitudeLabel, new com.intellij.uiDesigner.core.GridConstraints(4, 4, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n powerSpinner = new JSpinner();\n mainPanel.add(powerSpinner, new com.intellij.uiDesigner.core.GridConstraints(5, 3, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label4 = new JLabel();\n label4.setText(\"Powersetting\");\n mainPanel.add(label4, new com.intellij.uiDesigner.core.GridConstraints(5, 1, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label5 = new JLabel();\n label5.setText(\"Spreading factor\");\n mainPanel.add(label5, new com.intellij.uiDesigner.core.GridConstraints(6, 1, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n SFSpinner = new JSpinner();\n mainPanel.add(SFSpinner, new com.intellij.uiDesigner.core.GridConstraints(6, 3, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n TPThresholdText = new JLabel();\n TPThresholdText.setText(\"Label\");\n mainPanel.add(TPThresholdText, new com.intellij.uiDesigner.core.GridConstraints(7, 3, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_EAST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label6 = new JLabel();\n label6.setText(\"Transmission power threshold\");\n mainPanel.add(label6, new com.intellij.uiDesigner.core.GridConstraints(7, 1, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n saveButton = new JButton();\n saveButton.setText(\"Save\");\n mainPanel.add(saveButton, new com.intellij.uiDesigner.core.GridConstraints(12, 3, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer4 = new com.intellij.uiDesigner.core.Spacer();\n mainPanel.add(spacer4, new com.intellij.uiDesigner.core.GridConstraints(13, 1, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, new Dimension(-1, 20), new Dimension(-1, 20), null, 0, false));\n final JLabel label7 = new JLabel();\n label7.setText(\"Mote \");\n mainPanel.add(label7, new com.intellij.uiDesigner.core.GridConstraints(1, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n moteNumberLabel = new JLabel();\n moteNumberLabel.setText(\"Label\");\n mainPanel.add(moteNumberLabel, new com.intellij.uiDesigner.core.GridConstraints(1, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label8 = new JLabel();\n label8.setText(\"Sensors:\");\n mainPanel.add(label8, new com.intellij.uiDesigner.core.GridConstraints(10, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n addButton = new JButton();\n addButton.setText(\"Add\");\n mainPanel.add(addButton, new com.intellij.uiDesigner.core.GridConstraints(10, 4, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n sensorSpinner = new JComboBox();\n final DefaultComboBoxModel defaultComboBoxModel1 = new DefaultComboBoxModel();\n sensorSpinner.setModel(defaultComboBoxModel1);\n mainPanel.add(sensorSpinner, new com.intellij.uiDesigner.core.GridConstraints(10, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label9 = new JLabel();\n label9.setText(\"Sampling rate\");\n mainPanel.add(label9, new com.intellij.uiDesigner.core.GridConstraints(8, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label10 = new JLabel();\n label10.setText(\"Movement speed\");\n mainPanel.add(label10, new com.intellij.uiDesigner.core.GridConstraints(9, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n samplingSpinner = new JSpinner();\n mainPanel.add(samplingSpinner, new com.intellij.uiDesigner.core.GridConstraints(8, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n movementSpinner = new JSpinner();\n mainPanel.add(movementSpinner, new com.intellij.uiDesigner.core.GridConstraints(9, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label11 = new JLabel();\n label11.setText(\"m/s\");\n mainPanel.add(label11, new com.intellij.uiDesigner.core.GridConstraints(9, 3, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label12 = new JLabel();\n label12.setText(\"m\");\n mainPanel.add(label12, new com.intellij.uiDesigner.core.GridConstraints(8, 3, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JScrollPane scrollPane1 = new JScrollPane();\n scrollPane1.setHorizontalScrollBarPolicy(31);\n mainPanel.add(scrollPane1, new com.intellij.uiDesigner.core.GridConstraints(11, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, new Dimension(-1, 90), 0, false));\n sensorList = new JList();\n scrollPane1.setViewportView(sensorList);\n }", "public static void designTextEditor() {\n\t\t\n\t}", "private void $$$setupUI$$$() {\n zakupioneBiletyFrame = new JPanel();\n zakupioneBiletyFrame.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(2, 2, new Insets(0, 0, 0, 0), -1, -1));\n zakupioneLabel = new JLabel();\n zakupioneLabel.setText(\"Zakupione Bilety\");\n zakupioneBiletyFrame.add(zakupioneLabel, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n zakupioneBiletyTable = new JTable();\n zakupioneBiletyTable.setAutoCreateRowSorter(false);\n zakupioneBiletyTable.setAutoResizeMode(4);\n zakupioneBiletyFrame.add(zakupioneBiletyTable, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(150, 50), null, 0, false));\n scroll1 = new JScrollPane();\n zakupioneBiletyFrame.add(scroll1, new com.intellij.uiDesigner.core.GridConstraints(1, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n }", "private void $$$setupUI$$$() {\n createUIComponents();\n contentPane = new JPanel();\n contentPane.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(13, 1, new Insets(10, 10, 10, 10), -1, -1));\n final JLabel label1 = new JLabel();\n label1.setText(\"Connection re-express probability when crossed.\");\n contentPane.add(label1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer1 = new com.intellij.uiDesigner.core.Spacer();\n contentPane.add(spacer1, new com.intellij.uiDesigner.core.GridConstraints(12, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n contentPane.add(connectionReexpressSlider, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n final JLabel label2 = new JLabel();\n label2.setText(\"Mutation probability when crossed.\");\n contentPane.add(label2, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n contentPane.add(mutationWhenCrossedSlider, new com.intellij.uiDesigner.core.GridConstraints(3, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n final JLabel label3 = new JLabel();\n label3.setText(\"Diff excess gene count factor.\");\n contentPane.add(label3, new com.intellij.uiDesigner.core.GridConstraints(4, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(195, 22), null, 0, false));\n diffExcessFactorField = new FloatTextField();\n contentPane.add(diffExcessFactorField, new com.intellij.uiDesigner.core.GridConstraints(5, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n final JLabel label4 = new JLabel();\n label4.setText(\"Diff disjoint gene count factor.\");\n contentPane.add(label4, new com.intellij.uiDesigner.core.GridConstraints(6, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n diffDisjointFactorField = new FloatTextField();\n contentPane.add(diffDisjointFactorField, new com.intellij.uiDesigner.core.GridConstraints(7, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n final JLabel label5 = new JLabel();\n label5.setText(\"Diff weight factor.\");\n contentPane.add(label5, new com.intellij.uiDesigner.core.GridConstraints(8, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n diffWeightFactorField = new FloatTextField();\n contentPane.add(diffWeightFactorField, new com.intellij.uiDesigner.core.GridConstraints(9, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n final JLabel label6 = new JLabel();\n label6.setText(\"Diff normalize gene count threshold.\");\n contentPane.add(label6, new com.intellij.uiDesigner.core.GridConstraints(10, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n diffNormalizeThresholdField = new IntTextField();\n contentPane.add(diffNormalizeThresholdField, new com.intellij.uiDesigner.core.GridConstraints(11, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n }", "private void $$$setupUI$$$() {\n createUIComponents();\n overCounterForm = new JPanel();\n overCounterForm.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(16, 2, new Insets(30, 30, 30, 30), -1, -1));\n overCounterForm.setMinimumSize(new Dimension(450, 650));\n overCounterForm.setPreferredSize(new Dimension(450, 650));\n final com.intellij.uiDesigner.core.Spacer spacer1 = new com.intellij.uiDesigner.core.Spacer();\n overCounterForm.add(spacer1, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n medicineicon.setHorizontalAlignment(10);\n medicineicon.setText(\"\");\n overCounterForm.add(medicineicon, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer2 = new com.intellij.uiDesigner.core.Spacer();\n overCounterForm.add(spacer2, new com.intellij.uiDesigner.core.GridConstraints(2, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer3 = new com.intellij.uiDesigner.core.Spacer();\n overCounterForm.add(spacer3, new com.intellij.uiDesigner.core.GridConstraints(12, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n final JLabel label1 = new JLabel();\n label1.setHorizontalAlignment(10);\n label1.setText(\"Check Over-The-Counter Medication\");\n overCounterForm.add(label1, new com.intellij.uiDesigner.core.GridConstraints(3, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer4 = new com.intellij.uiDesigner.core.Spacer();\n overCounterForm.add(spacer4, new com.intellij.uiDesigner.core.GridConstraints(14, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n prescriptionNameTextField = new JTextField();\n prescriptionNameTextField.setHorizontalAlignment(0);\n prescriptionNameTextField.setMargin(new Insets(5, 5, 5, 5));\n prescriptionNameTextField.setText(\"Prescription Name\");\n overCounterForm.add(prescriptionNameTextField, new com.intellij.uiDesigner.core.GridConstraints(7, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n enterMedicationDetailsManuallyButton = new JButton();\n enterMedicationDetailsManuallyButton.setMargin(new Insets(5, 14, 5, 14));\n enterMedicationDetailsManuallyButton.setText(\"Enter Medication Details Manually\");\n enterMedicationDetailsManuallyButton.setToolTipText(\"Brings up a form where you can fill up the details for the over-the-counter medication manually.\");\n overCounterForm.add(enterMedicationDetailsManuallyButton, new com.intellij.uiDesigner.core.GridConstraints(13, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer5 = new com.intellij.uiDesigner.core.Spacer();\n overCounterForm.add(spacer5, new com.intellij.uiDesigner.core.GridConstraints(6, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer6 = new com.intellij.uiDesigner.core.Spacer();\n overCounterForm.add(spacer6, new com.intellij.uiDesigner.core.GridConstraints(4, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n final JLabel label2 = new JLabel();\n label2.setEnabled(false);\n label2.setHorizontalAlignment(0);\n label2.setHorizontalTextPosition(0);\n label2.setText(\"Please provide the following information:\");\n overCounterForm.add(label2, new com.intellij.uiDesigner.core.GridConstraints(5, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label3 = new JLabel();\n label3.setText(\"Name of prescription\");\n overCounterForm.add(label3, new com.intellij.uiDesigner.core.GridConstraints(7, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label4 = new JLabel();\n label4.setText(\"Barcode value\");\n overCounterForm.add(label4, new com.intellij.uiDesigner.core.GridConstraints(8, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n a13DigitsFormattedTextField = new JFormattedTextField();\n a13DigitsFormattedTextField.setHorizontalAlignment(0);\n a13DigitsFormattedTextField.setMargin(new Insets(5, 5, 5, 5));\n a13DigitsFormattedTextField.setText(\"13 digits\");\n overCounterForm.add(a13DigitsFormattedTextField, new com.intellij.uiDesigner.core.GridConstraints(8, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n manufacturerNameFormattedTextField = new JFormattedTextField();\n manufacturerNameFormattedTextField.setHorizontalAlignment(0);\n manufacturerNameFormattedTextField.setMargin(new Insets(5, 5, 5, 5));\n manufacturerNameFormattedTextField.setText(\"Manufacturer Name\");\n overCounterForm.add(manufacturerNameFormattedTextField, new com.intellij.uiDesigner.core.GridConstraints(9, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n formattedTextField3 = new JFormattedTextField();\n formattedTextField3.setMargin(new Insets(5, 5, 5, 5));\n overCounterForm.add(formattedTextField3, new com.intellij.uiDesigner.core.GridConstraints(10, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n numberOfTabletsInFormattedTextField = new JFormattedTextField();\n numberOfTabletsInFormattedTextField.setHorizontalAlignment(0);\n numberOfTabletsInFormattedTextField.setMargin(new Insets(5, 5, 5, 5));\n numberOfTabletsInFormattedTextField.setText(\"Number of tablets in packet\");\n overCounterForm.add(numberOfTabletsInFormattedTextField, new com.intellij.uiDesigner.core.GridConstraints(11, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n final JLabel label5 = new JLabel();\n label5.setText(\"Name of manufacturer\");\n overCounterForm.add(label5, new com.intellij.uiDesigner.core.GridConstraints(9, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label6 = new JLabel();\n label6.setText(\"Prescription strength\");\n overCounterForm.add(label6, new com.intellij.uiDesigner.core.GridConstraints(10, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label7 = new JLabel();\n label7.setText(\"Tablets in packet\");\n overCounterForm.add(label7, new com.intellij.uiDesigner.core.GridConstraints(11, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n cancelButton = new JButton();\n cancelButton.setMargin(new Insets(5, 14, 5, 14));\n cancelButton.setText(\"Cancel\");\n overCounterForm.add(cancelButton, new com.intellij.uiDesigner.core.GridConstraints(15, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n }", "@Override\n public void updateUi() {\n\n }", "@Override\n public void updateUi() {\n\n }", "@Override\n public void updateUi() {\n\n }", "private void $$$setupUI$$$() {\n mainPanel = new JPanel();\n mainPanel.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(2, 2, new Insets(0, 0, 0, 0), -1, -1));\n final JPanel panel1 = new JPanel();\n panel1.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(2, 3, new Insets(0, 0, 0, 0), -1, -1));\n panel1.setBackground(new Color(-1184275));\n panel1.setForeground(new Color(-4473925));\n mainPanel.add(panel1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n final JLabel label1 = new JLabel();\n label1.setBackground(new Color(-12828863));\n Font label1Font = this.$$$getFont$$$(\"Georgia\", Font.BOLD, 16, label1.getFont());\n if (label1Font != null) label1.setFont(label1Font);\n label1.setForeground(new Color(-12828863));\n label1.setText(\"Scheduler\");\n panel1.add(label1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 2, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label2 = new JLabel();\n Font label2Font = this.$$$getFont$$$(\"Georgia\", -1, 14, label2.getFont());\n if (label2Font != null) label2.setFont(label2Font);\n label2.setText(\"Select the Type of Scheduler \");\n panel1.add(label2, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n dropDown = new JComboBox();\n Font dropDownFont = this.$$$getFont$$$(\"Georgia\", -1, 14, dropDown.getFont());\n if (dropDownFont != null) dropDown.setFont(dropDownFont);\n final DefaultComboBoxModel defaultComboBoxModel1 = new DefaultComboBoxModel();\n defaultComboBoxModel1.addElement(\"Shortest Remaining Process Time\");\n defaultComboBoxModel1.addElement(\"Earliest Deadline First\");\n defaultComboBoxModel1.addElement(\"Deadline Monotonic\");\n dropDown.setModel(defaultComboBoxModel1);\n panel1.add(dropDown, new com.intellij.uiDesigner.core.GridConstraints(0, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label3 = new JLabel();\n Font label3Font = this.$$$getFont$$$(\"Georgia\", -1, 14, label3.getFont());\n if (label3Font != null) label3.setFont(label3Font);\n label3.setText(\"Current Task\");\n panel1.add(label3, new com.intellij.uiDesigner.core.GridConstraints(1, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n currentField = new JTextField();\n currentField.setBackground(new Color(-3873281));\n currentField.setEditable(false);\n Font currentFieldFont = this.$$$getFont$$$(\"Georgia\", Font.BOLD, 14, currentField.getFont());\n if (currentFieldFont != null) currentField.setFont(currentFieldFont);\n panel1.add(currentField, new com.intellij.uiDesigner.core.GridConstraints(1, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n final JPanel panel2 = new JPanel();\n panel2.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(4, 3, new Insets(0, 0, 0, 0), -1, -1));\n mainPanel.add(panel2, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n final JLabel label4 = new JLabel();\n Font label4Font = this.$$$getFont$$$(\"Georgia\", -1, 14, label4.getFont());\n if (label4Font != null) label4.setFont(label4Font);\n label4.setText(\"Current Task Progress \");\n panel2.add(label4, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 3, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n progressBar1 = new JProgressBar();\n panel2.add(progressBar1, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 3, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n taskList = new JList();\n taskList.setBackground(new Color(-5186305));\n Font taskListFont = this.$$$getFont$$$(\"Georgia\", -1, 14, taskList.getFont());\n if (taskListFont != null) taskList.setFont(taskListFont);\n final DefaultListModel defaultListModel1 = new DefaultListModel();\n taskList.setModel(defaultListModel1);\n taskList.setSelectionBackground(new Color(-13220097));\n taskList.setSelectionForeground(new Color(-1));\n taskList.setSelectionMode(0);\n panel2.add(taskList, new com.intellij.uiDesigner.core.GridConstraints(3, 0, 1, 3, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(150, 50), null, 0, false));\n tickButton = new JButton();\n Font tickButtonFont = this.$$$getFont$$$(\"Georgia\", Font.BOLD, 14, tickButton.getFont());\n if (tickButtonFont != null) tickButton.setFont(tickButtonFont);\n tickButton.setText(\"Tick\");\n panel2.add(tickButton, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n switchButton = new JButton();\n Font switchButtonFont = this.$$$getFont$$$(\"Georgia\", Font.BOLD, 14, switchButton.getFont());\n if (switchButtonFont != null) switchButton.setFont(switchButtonFont);\n switchButton.setText(\"Switch\");\n panel2.add(switchButton, new com.intellij.uiDesigner.core.GridConstraints(2, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n delButton = new JButton();\n Font delButtonFont = this.$$$getFont$$$(\"Georgia\", Font.BOLD, 14, delButton.getFont());\n if (delButtonFont != null) delButton.setFont(delButtonFont);\n delButton.setText(\"Delete\");\n panel2.add(delButton, new com.intellij.uiDesigner.core.GridConstraints(2, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JPanel panel3 = new JPanel();\n panel3.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(8, 2, new Insets(0, 0, 0, 0), -1, -1));\n mainPanel.add(panel3, new com.intellij.uiDesigner.core.GridConstraints(1, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n final JLabel label5 = new JLabel();\n Font label5Font = this.$$$getFont$$$(\"Georgia\", Font.BOLD, 14, label5.getFont());\n if (label5Font != null) label5.setFont(label5Font);\n label5.setText(\"Add New Tasks\");\n panel3.add(label5, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label6 = new JLabel();\n Font label6Font = this.$$$getFont$$$(\"Georgia\", -1, 14, label6.getFont());\n if (label6Font != null) label6.setFont(label6Font);\n label6.setText(\"Task\");\n panel3.add(label6, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n taskName = new JTextField();\n Font taskNameFont = this.$$$getFont$$$(\"Georgia\", -1, 14, taskName.getFont());\n if (taskNameFont != null) taskName.setFont(taskNameFont);\n panel3.add(taskName, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n final JLabel label7 = new JLabel();\n Font label7Font = this.$$$getFont$$$(\"Georgia\", -1, 14, label7.getFont());\n if (label7Font != null) label7.setFont(label7Font);\n label7.setText(\"Estimated Completion Time (hours) \");\n panel3.add(label7, new com.intellij.uiDesigner.core.GridConstraints(3, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n RemTime = new JTextField();\n Font RemTimeFont = this.$$$getFont$$$(\"Georgia\", -1, 14, RemTime.getFont());\n if (RemTimeFont != null) RemTime.setFont(RemTimeFont);\n panel3.add(RemTime, new com.intellij.uiDesigner.core.GridConstraints(4, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n final JLabel label8 = new JLabel();\n Font label8Font = this.$$$getFont$$$(\"Georgia\", -1, 14, label8.getFont());\n if (label8Font != null) label8.setFont(label8Font);\n label8.setText(\"Time Till Task is Due (hours)\");\n panel3.add(label8, new com.intellij.uiDesigner.core.GridConstraints(5, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n relDeadline = new JTextField();\n Font relDeadlineFont = this.$$$getFont$$$(\"Georgia\", -1, 14, relDeadline.getFont());\n if (relDeadlineFont != null) relDeadline.setFont(relDeadlineFont);\n panel3.add(relDeadline, new com.intellij.uiDesigner.core.GridConstraints(6, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n saveNewButton = new JButton();\n Font saveNewButtonFont = this.$$$getFont$$$(\"Georgia\", Font.BOLD, 14, saveNewButton.getFont());\n if (saveNewButtonFont != null) saveNewButton.setFont(saveNewButtonFont);\n saveNewButton.setText(\"Save New\");\n panel3.add(saveNewButton, new com.intellij.uiDesigner.core.GridConstraints(7, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n saveExistingButton = new JButton();\n Font saveExistingButtonFont = this.$$$getFont$$$(\"Georgia\", Font.BOLD, 14, saveExistingButton.getFont());\n if (saveExistingButtonFont != null) saveExistingButton.setFont(saveExistingButtonFont);\n saveExistingButton.setText(\"Save Existing\");\n panel3.add(saveExistingButton, new com.intellij.uiDesigner.core.GridConstraints(7, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n clearButton = new JButton();\n Font clearButtonFont = this.$$$getFont$$$(\"Georgia\", Font.BOLD, 14, clearButton.getFont());\n if (clearButtonFont != null) clearButton.setFont(clearButtonFont);\n clearButton.setText(\"Clear Form\");\n panel3.add(clearButton, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n }", "public OffertoryGUI() {\n initComponents();\n setTypes();\n }", "private void $$$setupUI$$$() {\n contentPane = new JPanel();\n contentPane.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(2, 1, new Insets(10, 10, 10, 10), -1, -1));\n final JPanel panel1 = new JPanel();\n panel1.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));\n contentPane.add(panel1, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer1 = new com.intellij.uiDesigner.core.Spacer();\n panel1.add(spacer1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n final JPanel panel2 = new JPanel();\n panel2.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1, true, false));\n panel1.add(panel2, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n buttonOK = new JButton();\n buttonOK.setText(\"OK\");\n panel2.add(buttonOK, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n buttonCancel = new JButton();\n buttonCancel.setText(\"Cancel\");\n panel2.add(buttonCancel, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JScrollPane scrollPane1 = new JScrollPane();\n contentPane.add(scrollPane1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n final JPanel panel3 = new JPanel();\n panel3.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(3, 4, new Insets(0, 0, 0, 0), 5, 5));\n scrollPane1.setViewportView(panel3);\n final JLabel label1 = new JLabel();\n label1.setFont(new Font(label1.getFont().getName(), Font.BOLD, label1.getFont().getSize()));\n label1.setText(\"mlocarna:\");\n panel3.add(label1, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer2 = new com.intellij.uiDesigner.core.Spacer();\n panel3.add(spacer2, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 4, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n final JLabel label2 = new JLabel();\n label2.setBackground(new Color(-65485));\n label2.setFont(new Font(label2.getFont().getName(), Font.BOLD, label2.getFont().getSize()));\n label2.setOpaque(false);\n label2.setText(\"RNAsubopt:\");\n panel3.add(label2, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n random_sample = new JComboBox();\n final DefaultComboBoxModel defaultComboBoxModel1 = new DefaultComboBoxModel();\n defaultComboBoxModel1.addElement(\"5\");\n defaultComboBoxModel1.addElement(\"10\");\n defaultComboBoxModel1.addElement(\"15\");\n defaultComboBoxModel1.addElement(\"20\");\n random_sample.setModel(defaultComboBoxModel1);\n panel3.add(random_sample, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_EAST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n useMlocarna = new JCheckBox();\n useMlocarna.setSelected(true);\n useMlocarna.setText(\"\");\n panel3.add(useMlocarna, new com.intellij.uiDesigner.core.GridConstraints(1, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_EAST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label3 = new JLabel();\n label3.setText(\"suboptimal structures computed\");\n panel3.add(label3, new com.intellij.uiDesigner.core.GridConstraints(0, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label4 = new JLabel();\n label4.setText(\"use to compute the folding landscape \");\n panel3.add(label4, new com.intellij.uiDesigner.core.GridConstraints(1, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer3 = new com.intellij.uiDesigner.core.Spacer();\n panel3.add(spacer3, new com.intellij.uiDesigner.core.GridConstraints(0, 3, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer4 = new com.intellij.uiDesigner.core.Spacer();\n panel3.add(spacer4, new com.intellij.uiDesigner.core.GridConstraints(1, 3, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n }", "@Override\n protected void windowInit ()\n {\n }", "private void initUI() {\r\n\t\tthis.form = new XdevGridLayout();\r\n\t\tthis.comboBoxState = new XdevComboBox<>();\r\n\t\tthis.lblSbxValidFrom = new XdevLabel();\r\n\t\tthis.dateSbxValidFrom = new XdevPopupDateField();\r\n\t\tthis.lblSbxAgeStartYear = new XdevLabel();\r\n\t\tthis.txtSbxAgeStartYear = new XdevTextField();\r\n\t\tthis.lblSbxCompany = new XdevLabel();\r\n\t\tthis.txtSbxCompany = new XdevTextField();\r\n\t\tthis.lblSbxWorker = new XdevLabel();\r\n\t\tthis.txtSbxWorker = new XdevTextField();\r\n\t\tthis.lblSbxState = new XdevLabel();\r\n\t\tthis.horizontalLayout = new XdevHorizontalLayout();\r\n\t\tthis.cmdSave = new XdevButton();\r\n\t\tthis.cmdClose = new XdevButton();\r\n\t\tthis.fieldGroup = new XdevFieldGroup<>(SalaryBvgBaseLine.class);\r\n\t\r\n\t\tthis.lblSbxValidFrom.setValue(\"Gültig ab\");\r\n\t\tthis.dateSbxValidFrom.setTabIndex(2);\r\n\t\tthis.lblSbxAgeStartYear.setValue(\"Alter ab\");\r\n\t\tthis.txtSbxAgeStartYear.setTabIndex(3);\r\n\t\tthis.lblSbxCompany.setValue(\"Arbeitgeber %\");\r\n\t\tthis.txtSbxCompany.setConverter(ConverterBuilder.stringToDouble().build());\r\n\t\tthis.txtSbxCompany.setTabIndex(4);\r\n\t\tthis.lblSbxWorker.setValue(\"Arbeitnehmer %\");\r\n\t\tthis.txtSbxWorker.setConverter(ConverterBuilder.stringToDouble().build());\r\n\t\tthis.txtSbxWorker.setTabIndex(5);\r\n\t\tthis.lblSbxState.setValue(\"Status\");\r\n\t\tthis.horizontalLayout.setMargin(new MarginInfo(false));\r\n\t\tthis.cmdSave.setIcon(FontAwesome.SAVE);\r\n\t\tthis.cmdSave.setCaption(\"Speichern\");\r\n\t\tthis.cmdSave.setTabIndex(8);\r\n\t\tthis.cmdSave.setClickShortcut(ShortcutAction.KeyCode.ENTER);\r\n\t\tthis.cmdClose.setIcon(FontAwesome.CLOSE);\r\n\t\tthis.cmdClose.setCaption(\"Schliessen\");\r\n\t\tthis.cmdClose.setClickShortcut(ShortcutAction.KeyCode.ESCAPE);\r\n\t\tthis.fieldGroup.bind(this.dateSbxValidFrom, SalaryBvgBaseLine_.sbxValidFrom.getName());\r\n\t\tthis.fieldGroup.bind(this.txtSbxAgeStartYear, SalaryBvgBaseLine_.sbxAgeStartYear.getName());\r\n\t\tthis.fieldGroup.bind(this.txtSbxCompany, SalaryBvgBaseLine_.sbxCompany.getName());\r\n\t\tthis.fieldGroup.bind(this.txtSbxWorker, SalaryBvgBaseLine_.sbxWorker.getName());\r\n\t\tthis.fieldGroup.bind(this.comboBoxState, SalaryBvgBaseLine_.sbxState.getName());\r\n\t\r\n\t\tthis.cmdSave.setSizeUndefined();\r\n\t\tthis.horizontalLayout.addComponent(this.cmdSave);\r\n\t\tthis.horizontalLayout.setComponentAlignment(this.cmdSave, Alignment.MIDDLE_LEFT);\r\n\t\tthis.cmdClose.setSizeUndefined();\r\n\t\tthis.horizontalLayout.addComponent(this.cmdClose);\r\n\t\tthis.horizontalLayout.setComponentAlignment(this.cmdClose, Alignment.MIDDLE_LEFT);\r\n\t\tthis.form.setColumns(2);\r\n\t\tthis.form.setRows(7);\r\n\t\tthis.comboBoxState.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.comboBoxState, 1, 4);\r\n\t\tthis.lblSbxValidFrom.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.lblSbxValidFrom, 0, 0);\r\n\t\tthis.dateSbxValidFrom.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.dateSbxValidFrom, 1, 0);\r\n\t\tthis.lblSbxAgeStartYear.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.lblSbxAgeStartYear, 0, 1);\r\n\t\tthis.txtSbxAgeStartYear.setWidth(100, Unit.PERCENTAGE);\r\n\t\tthis.txtSbxAgeStartYear.setHeight(-1, Unit.PIXELS);\r\n\t\tthis.form.addComponent(this.txtSbxAgeStartYear, 1, 1);\r\n\t\tthis.lblSbxCompany.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.lblSbxCompany, 0, 2);\r\n\t\tthis.txtSbxCompany.setWidth(100, Unit.PERCENTAGE);\r\n\t\tthis.txtSbxCompany.setHeight(-1, Unit.PIXELS);\r\n\t\tthis.form.addComponent(this.txtSbxCompany, 1, 2);\r\n\t\tthis.lblSbxWorker.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.lblSbxWorker, 0, 3);\r\n\t\tthis.txtSbxWorker.setWidth(100, Unit.PERCENTAGE);\r\n\t\tthis.txtSbxWorker.setHeight(-1, Unit.PIXELS);\r\n\t\tthis.form.addComponent(this.txtSbxWorker, 1, 3);\r\n\t\tthis.lblSbxState.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.lblSbxState, 0, 4);\r\n\t\tthis.horizontalLayout.setSizeUndefined();\r\n\t\tthis.form.addComponent(this.horizontalLayout, 0, 5, 1, 5);\r\n\t\tthis.form.setComponentAlignment(this.horizontalLayout, Alignment.TOP_CENTER);\r\n\t\tthis.form.setColumnExpandRatio(1, 100.0F);\r\n\t\tfinal CustomComponent form_vSpacer = new CustomComponent();\r\n\t\tform_vSpacer.setSizeFull();\r\n\t\tthis.form.addComponent(form_vSpacer, 0, 6, 1, 6);\r\n\t\tthis.form.setRowExpandRatio(6, 1.0F);\r\n\t\tthis.form.setSizeFull();\r\n\t\tthis.setContent(this.form);\r\n\t\tthis.setSizeFull();\r\n\t\r\n\t\tthis.cmdSave.addClickListener(event -> this.cmdSave_buttonClick(event));\r\n\t\tthis.cmdClose.addClickListener(event -> this.cmdClose_buttonClick(event));\r\n\t}", "private void designBtnActionPerformed(ActionEvent evt) {\n }", "public void buildGui() {\n\t}", "public guiProntuarioVirtual() {\n initComponents();\n \n }", "public void designerAdded(DesignerEvent e);", "private void $$$setupUI$$$() {\n createUIComponents();\n wrapperPanel = new JPanel();\n wrapperPanel.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(2, 2, new Insets(0, 0, 0, 0), -1, -1));\n wrapperPanel.setMinimumSize(new Dimension(640, 480));\n wrapperPanel.setPreferredSize(new Dimension(800, 600));\n boringPanel = new JPanel();\n boringPanel.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(5, 2, new Insets(0, 0, 0, 0), -1, -1));\n boringPanel.setInheritsPopupMenu(false);\n boringPanel.setMaximumSize(new Dimension(200, 2147483647));\n boringPanel.setMinimumSize(new Dimension(100, 174));\n boringPanel.setOpaque(false);\n boringPanel.setPreferredSize(new Dimension(150, 228));\n boringPanel.setRequestFocusEnabled(true);\n wrapperPanel.add(boringPanel, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, new Dimension(100, -1), new Dimension(150, -1), new Dimension(200, -1), 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer1 = new com.intellij.uiDesigner.core.Spacer();\n boringPanel.add(spacer1, new com.intellij.uiDesigner.core.GridConstraints(4, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n captionLabel = new JLabel();\n captionLabel.setText(\"Label\");\n boringPanel.add(captionLabel, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n numberOfLayersCaptionLabel = new JLabel();\n numberOfLayersCaptionLabel.setText(\"Label\");\n boringPanel.add(numberOfLayersCaptionLabel, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(82, 14), null, 0, false));\n numberOfLayersLabel = new JLabel();\n numberOfLayersLabel.setText(\"\");\n boringPanel.add(numberOfLayersLabel, new com.intellij.uiDesigner.core.GridConstraints(2, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_EAST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n matrixTextArea = new JTextArea();\n boringPanel.add(matrixTextArea, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(82, 50), null, 0, false));\n commitButton = new JButton();\n commitButton.setText(\"Button\");\n boringPanel.add(commitButton, new com.intellij.uiDesigner.core.GridConstraints(3, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n graphPanel.setBackground(new Color(-1));\n graphPanel.setMinimumSize(new Dimension(530, 24));\n graphPanel.setOpaque(true);\n wrapperPanel.add(graphPanel, new com.intellij.uiDesigner.core.GridConstraints(1, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n final JToolBar toolBar1 = new JToolBar();\n toolBar1.setFloatable(false);\n wrapperPanel.add(toolBar1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(-1, 20), null, 0, false));\n loadButton = new JButton();\n loadButton.setText(\"Button\");\n toolBar1.add(loadButton);\n }", "private void actionComboboxChangedImage ()\r\n\t{\r\n\r\n\t\tint tableSize = DataController.getTable().getTableSize();\r\n\r\n\t\t//---- Check if the project is empty or not\r\n\t\tif (tableSize != 0)\r\n\t\t{\r\n\t\t\tif (isDisplaySamples) { helperDisplayDetectedSamples(); }\r\n\t\t\telse { helperDisplayInputImage(); }\r\n\r\n\t\t\thelperDisplaySamplesCombobox();\r\n\t\t\thelperDisplayResults();\r\n\t\t\thelperDisplayChart(true);\r\n\t\t}\r\n\t}", "private InstructGui() {\n }", "public hesapekrani() {\n initComponents();\n getedits();\n \n \n }", "private void setUpGUI() {\n \n removePrecursorPeakCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n enzymeTypeCmb.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n useFlankingCmb.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n removePrecursorPeakCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n monoPrecursorCmb.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n peptideListCmb.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n decoyFormatCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n keepTerminalAaCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n removeMethionineCmb.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n exactPvalueCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n spScoreCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n chargesCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n useNeutralLossCmb.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n outputFormatCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n removeTempFoldersCmb.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n \n minPepLengthTxt.setEditable(editable);\n minPepLengthTxt.setEnabled(editable);\n maxPepLengthTxt.setEditable(editable);\n maxPepLengthTxt.setEnabled(editable);\n minPrecursorMassTxt.setEditable(editable);\n minPrecursorMassTxt.setEnabled(editable);\n maxPrecursorMassTxt.setEditable(editable);\n maxPrecursorMassTxt.setEnabled(editable);\n monoPrecursorCmb.setEnabled(editable);\n removeMethionineCmb.setEnabled(editable);\n //minPtmsPerPeptideTxt.setEditable(editable);\n //minPtmsPerPeptideTxt.setEnabled(editable);\n maxPtmsPerPeptideTxt.setEditable(editable);\n maxPtmsPerPeptideTxt.setEnabled(editable);\n maxVariablePtmsPerTypeTxt.setEditable(editable);\n maxVariablePtmsPerTypeTxt.setEnabled(editable);\n enzymeTypeCmb.setEnabled(editable);\n peptideListCmb.setEnabled(editable);\n decoyFormatCombo.setEnabled(editable);\n keepTerminalAaCombo.setEnabled(editable);\n decoySeedTxt.setEditable(editable);\n decoySeedTxt.setEnabled(editable);\n removeTempFoldersCmb.setEnabled(editable);\n exactPvalueCombo.setEnabled(editable);\n spScoreCombo.setEnabled(editable);\n minSpectrumMzTxt.setEditable(editable);\n minSpectrumMzTxt.setEnabled(editable);\n maxSpectrumMzTxt.setEditable(editable);\n maxSpectrumMzTxt.setEnabled(editable);\n minPeaksTxt.setEditable(editable);\n minPeaksTxt.setEnabled(editable);\n chargesCombo.setEnabled(editable);\n removePrecursorPeakCombo.setEnabled(editable);\n removePrecursorPeakToleranceTxt.setEditable(editable);\n removePrecursorPeakToleranceTxt.setEnabled(editable);\n useFlankingCmb.setEnabled(editable);\n useNeutralLossCmb.setEnabled(editable);\n mzBinWidthTxt.setEditable(editable);\n mzBinWidthTxt.setEnabled(editable);\n mzBinOffsetTxt.setEditable(editable);\n mzBinOffsetTxt.setEnabled(editable);\n numberMatchesTxt.setEditable(editable);\n numberMatchesTxt.setEnabled(editable);\n outputFormatCombo.setEnabled(editable);\n \n }", "@Override\n public void actionPerformed(ActionEvent e) {\n \n }", "@Override\n public void actionPerformed(ActionEvent e)\n {\n \n }", "private void $$$setupUI$$$() {\n rootPanel = new JPanel();\n rootPanel.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(11, 3, new Insets(0, 0, 0, 0), -1, -1));\n bKillSession = new JButton();\n bKillSession.setText(\"Убить сессии\");\n rootPanel.add(bKillSession, new com.intellij.uiDesigner.core.GridConstraints(0, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n bGetAll = new JButton();\n bGetAll.setText(\"Получить график\");\n rootPanel.add(bGetAll, new com.intellij.uiDesigner.core.GridConstraints(1, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n bStartBS = new JButton();\n bStartBS.setText(\"Старт БС\");\n rootPanel.add(bStartBS, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n bSetFreq = new JButton();\n bSetFreq.setText(\"Установить частоту\");\n rootPanel.add(bSetFreq, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n tfFreq = new JTextField();\n rootPanel.add(tfFreq, new com.intellij.uiDesigner.core.GridConstraints(2, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n cbDefaultBS = new JCheckBox();\n cbDefaultBS.setSelected(true);\n cbDefaultBS.setText(\"Использовать БС из конфига\");\n rootPanel.add(cbDefaultBS, new com.intellij.uiDesigner.core.GridConstraints(4, 0, 1, 3, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer1 = new com.intellij.uiDesigner.core.Spacer();\n rootPanel.add(spacer1, new com.intellij.uiDesigner.core.GridConstraints(7, 2, 4, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n cbListMethods = new JComboBox();\n rootPanel.add(cbListMethods, new com.intellij.uiDesigner.core.GridConstraints(5, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label1 = new JLabel();\n label1.setText(\"Запускаемый метод:\");\n rootPanel.add(label1, new com.intellij.uiDesigner.core.GridConstraints(5, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer2 = new com.intellij.uiDesigner.core.Spacer();\n rootPanel.add(spacer2, new com.intellij.uiDesigner.core.GridConstraints(7, 0, 4, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n lblParams = new JLabel();\n lblParams.setText(\"Label\");\n rootPanel.add(lblParams, new com.intellij.uiDesigner.core.GridConstraints(6, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JPanel panel1 = new JPanel();\n panel1.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));\n rootPanel.add(panel1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n bPause = new JButton();\n bPause.setText(\"Пауза\");\n panel1.add(bPause, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n bStart = new JButton();\n bStart.setText(\"Старт\");\n panel1.add(bStart, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JSeparator separator1 = new JSeparator();\n rootPanel.add(separator1, new com.intellij.uiDesigner.core.GridConstraints(3, 0, 1, 3, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n }", "public GUI_Edit_Tour(){\n init();\n }", "private void updateGUI() {\n\t\tsfrDlg.readSFRTableFromCPU();\n\t\tsourceCodeDlg.updateRowSelection(cpu.PC);\n\t\tsourceCodeDlg.getCyclesLabel().setText(\"Cycles count : \" + cpu.getCyclesCount());\n\t\tdataMemDlg.fillDataMemory();\n\t\t//ioPortsDlg.fillIOPorts();\t\t\n\t\tIterator iter = seg7DlgList.iterator();\n\t\twhile(iter.hasNext())\n\t\t\t((GUI_7SegDisplay)iter.next()).drawSeg();\n\t}", "private void $$$setupUI$$$() {\n contentPane = new JPanel();\n contentPane.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(3, 1, new Insets(10, 10, 10, 10), -1, -1));\n btnPanel = new JPanel();\n btnPanel.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));\n contentPane.add(btnPanel, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer1 = new com.intellij.uiDesigner.core.Spacer();\n btnPanel.add(spacer1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n btnPanel2 = new JPanel();\n btnPanel2.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));\n btnPanel.add(btnPanel2, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n buttonOK = new JButton();\n buttonOK.setText(\"OK\");\n btnPanel2.add(buttonOK, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n contentPanel = new JPanel();\n contentPanel.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));\n contentPane.add(contentPanel, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n content = new JTextArea();\n content.setBackground(new Color(-1118482));\n content.setEditable(false);\n contentPanel.add(content, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(150, 50), null, 0, false));\n title = new JLabel();\n Font titleFont = this.$$$getFont$$$(null, -1, 20, title.getFont());\n if (titleFont != null) title.setFont(titleFont);\n title.setText(\"Invalid Number of Players\");\n contentPane.add(title, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n }", "private static void initAndShowGUI() {\n }", "private GUIAltaHabitacion() {\r\n\t initComponents();\r\n\t }", "@Override\n\tpublic void transitToGUI(int i) {\n\t\t\n\t}", "public DatabaseGUI() {\n initComponents();\n refreshDatabaseTables();\n\n }", "public History_GUI(){\n super();\n InitializeComponents();\n ConfigureWin();\n\n }", "private void initUI() {\n }", "public VisualizarLlamada() {\n initComponents();\n }", "public CuacaGUI() throws ClassNotFoundException, SQLException {\n initComponents();\n \n }", "@Override\n public void actionPerformed(ActionEvent e) {\n \n }", "@Override\n public void actionPerformed(ActionEvent e) {\n \n }", "@Override\n public void actionPerformed(ActionEvent e) {\n \n }", "public void designerStateModified(DesignerEvent e);", "public EditorBarajasGUI() {\n\t\t//dibujamos el cursor\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/puntero.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(0, 0), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t\ttry {\n\t\t\tjbInit();\n\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n\tpublic void serializeUI() {\n\t\t\n\t}", "@Override\n public void stateChanged(javax.swing.event.ChangeEvent e) {\n }", "private void $$$setupUI$$$() {\n createUIComponents();\n contentPane = new JPanel();\n contentPane.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 1, new Insets(10, 10, 10, 10), -1, -1));\n final JPanel panel1 = new JPanel();\n panel1.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));\n contentPane.add(panel1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n final JScrollPane scrollPane1 = new JScrollPane();\n panel1.add(scrollPane1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n table1.setAutoscrolls(true);\n table1.setColumnSelectionAllowed(false);\n scrollPane1.setViewportView(table1);\n }", "private void $$$setupUI$$$() {\n final JPanel panel1 = new JPanel();\n panel1.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t}", "public quotaGUI() {\n initComponents();\n }", "public FinishedGoodMaster_old () {\n initComponents ();\n \n jTextField1.setNextFocusableComponent ( jTextField3 );\n jTextField3.setNextFocusableComponent ( jTextField2 );\n jTextField2.setNextFocusableComponent ( jComboBox1 );\n jComboBox1.setNextFocusableComponent ( jTextField4 );\n }", "@Override\n public void setupPanel()\n {\n\n }", "private void $$$setupUI$$$() {\n contentPane = new JPanel();\n contentPane.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(4, 2, new Insets(10, 10, 10, 10), -1, -1));\n contentPane.setBackground(new Color(-16316665));\n contentPane.setMinimumSize(new Dimension(450, 500));\n final JPanel panel1 = new JPanel();\n panel1.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 5, new Insets(0, 0, 0, 0), 0, 0));\n panel1.setAlignmentY(0.0f);\n panel1.setAutoscrolls(true);\n panel1.setBackground(new Color(-16316665));\n contentPane.add(panel1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 4, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_NORTH, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n stopButton = new JButton();\n stopButton.setBackground(new Color(-16316665));\n stopButton.setForeground(new Color(-1041));\n stopButton.setText(\"Stop\");\n panel1.add(stopButton, new com.intellij.uiDesigner.core.GridConstraints(0, 4, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n pauseButton = new JButton();\n pauseButton.setBackground(new Color(-16316665));\n pauseButton.setForeground(new Color(-1041));\n pauseButton.setText(\"Pause\");\n panel1.add(pauseButton, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n startButton = new JButton();\n startButton.setBackground(new Color(-16316665));\n startButton.setForeground(new Color(-1041));\n startButton.setText(\"Start\");\n panel1.add(startButton, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n textArea1 = new JTextArea();\n textArea1.setBackground(new Color(-16316665));\n textArea1.setDisabledTextColor(new Color(-1041));\n textArea1.setEditable(false);\n textArea1.setForeground(new Color(-1041));\n panel1.add(textArea1, new com.intellij.uiDesigner.core.GridConstraints(0, 2, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n board = new JPanel();\n board.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));\n board.setBackground(new Color(-16316665));\n contentPane.add(board, new com.intellij.uiDesigner.core.GridConstraints(3, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n board.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(new Color(-1041)), null, TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, new Color(-16777216)));\n textArea2 = new JTextArea();\n textArea2.setBackground(new Color(-16316665));\n textArea2.setFont(new Font(textArea2.getFont().getName(), textArea2.getFont().getStyle(), 22));\n board.add(textArea2, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(150, 50), null, 0, false));\n }", "public ModifyProductFrame() {\n initComponents();\n setIcon();\n }", "private void editLibraries() {\n\t\tJOptionPane.showMessageDialog(this, \"No implemented yet!\");\n\t}", "public PropsGUI() {\n initComponents();\n }", "public Visualize() {\n initComponents();\n \n }", "public JFrame_05_Mayor_De_10() {\n initComponents();\n \n }", "public orgGui() {\n initComponents();\n }", "private void jButton14ActionPerformed(java.awt.event.ActionEvent evt) {\n }", "private void basicUIButtonActionPerformed() {\n dbCopyFrame basicFrame = new dbCopyFrame(mainFrame, true);\n basicFrame.pack();\n basicFrame.setVisible(true);\n }", "public Modify() {\n initComponents();\n }", "@Override\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) {\n\t\t\t\t\n\t\t\t}", "private void actionComboboxChangedSample ()\r\n\t{\r\n\t\tint tableSize = DataController.getTable().getTableSize();\r\n\r\n\t\t//---- Check if the project is empty or not\r\n\t\tif (tableSize != 0)\r\n\t\t{\r\n\t\t\thelperDisplaySampleLocation();\r\n\t\t\thelperDisplayResults();\r\n\t\t}\r\n\t}", "private void $$$setupUI$$$() {\n createUIComponents();\n panel1 = new JPanel();\n panel1.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));\n panel1.setOpaque(true);\n panel1.setPreferredSize(new Dimension(980, 660));\n LeftPane = new JPanel();\n LeftPane.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(4, 1, new Insets(0, 0, 0, 0), -1, -1, true, false));\n panel1.add(LeftPane, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n LeftPane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(new Color(-4473925)), null));\n Stats = new JPanel();\n Stats.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(5, 2, new Insets(0, 0, 0, 0), -1, -1));\n LeftPane.add(Stats, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n final JLabel label1 = new JLabel();\n Font label1Font = this.$$$getFont$$$(\"Stencil\", -1, 12, label1.getFont());\n if (label1Font != null) label1.setFont(label1Font);\n label1.setText(\"Player:\");\n Stats.add(label1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label2 = new JLabel();\n Font label2Font = this.$$$getFont$$$(\"Stencil\", -1, 12, label2.getFont());\n if (label2Font != null) label2.setFont(label2Font);\n label2.setText(\"Highscore:\");\n Stats.add(label2, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n highScore = new JTextField();\n highScore.setEditable(false);\n highScore.setHorizontalAlignment(0);\n Stats.add(highScore, new com.intellij.uiDesigner.core.GridConstraints(1, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n playerName = new JTextField();\n playerName.setEditable(false);\n playerName.setHorizontalAlignment(0);\n playerName.setText(\"\");\n Stats.add(playerName, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n final JLabel label3 = new JLabel();\n Font label3Font = this.$$$getFont$$$(\"Stencil\", -1, 12, label3.getFont());\n if (label3Font != null) label3.setFont(label3Font);\n label3.setText(\"Level:\");\n Stats.add(label3, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n levelId = new JTextField();\n levelId.setEditable(false);\n levelId.setHorizontalAlignment(0);\n Stats.add(levelId, new com.intellij.uiDesigner.core.GridConstraints(2, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n final JLabel label4 = new JLabel();\n Font label4Font = this.$$$getFont$$$(\"Stencil\", -1, 12, label4.getFont());\n if (label4Font != null) label4.setFont(label4Font);\n label4.setText(\"Time:\");\n Stats.add(label4, new com.intellij.uiDesigner.core.GridConstraints(4, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n timeLeft = new JTextField();\n timeLeft.setEditable(false);\n timeLeft.setEnabled(true);\n timeLeft.setFocusable(true);\n timeLeft.setHorizontalAlignment(0);\n timeLeft.setOpaque(true);\n Stats.add(timeLeft, new com.intellij.uiDesigner.core.GridConstraints(4, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n final JLabel label5 = new JLabel();\n Font label5Font = this.$$$getFont$$$(\"Stencil\", -1, 12, label5.getFont());\n if (label5Font != null) label5.setFont(label5Font);\n label5.setHorizontalAlignment(10);\n label5.setText(\"Score:\");\n Stats.add(label5, new com.intellij.uiDesigner.core.GridConstraints(3, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n scoreField = new JTextField();\n scoreField.setEditable(false);\n scoreField.setHorizontalAlignment(0);\n Stats.add(scoreField, new com.intellij.uiDesigner.core.GridConstraints(3, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n final JLabel label6 = new JLabel();\n Font label6Font = this.$$$getFont$$$(\"Stencil\", -1, 18, label6.getFont());\n if (label6Font != null) label6.setFont(label6Font);\n label6.setText(\"Molecule:\");\n LeftPane.add(label6, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n moleculeName = new JTextField();\n moleculeName.setEditable(false);\n moleculeName.setFocusable(true);\n Font moleculeNameFont = this.$$$getFont$$$(\"Stencil\", -1, 18, moleculeName.getFont());\n if (moleculeNameFont != null) moleculeName.setFont(moleculeNameFont);\n moleculeName.setHorizontalAlignment(0);\n moleculeName.setOpaque(true);\n moleculeName.setRequestFocusEnabled(true);\n moleculeName.setText(\"\");\n moleculeName.setVisible(true);\n moleculeName.putClientProperty(\"caretWidth\", new Integer(0));\n LeftPane.add(moleculeName, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n molPane = new JPanel();\n molPane.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));\n LeftPane.add(molPane, new com.intellij.uiDesigner.core.GridConstraints(3, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n molPane.add(moleculePanel1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, new Dimension(160, 96), null, null, 0, false));\n RightPane = new JPanel();\n RightPane.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(3, 1, new Insets(0, 0, 0, 0), -1, -1));\n panel1.add(RightPane, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer1 = new com.intellij.uiDesigner.core.Spacer();\n RightPane.add(spacer1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer2 = new com.intellij.uiDesigner.core.Spacer();\n RightPane.add(spacer2, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n gamePane = new JPanel();\n gamePane.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));\n RightPane.add(gamePane, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, new Dimension(640, 600), null, new Dimension(800, 640), 0, false));\n gamePane.add(gamePanel1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, new Dimension(640, 609), null, new Dimension(980, 680), 0, false));\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\n protected void actionPerformed(GuiButton button)\n {\n super.actionPerformed(button);\n }", "@Override\n public void componentShown(ComponentEvent e) {\n\n }", "private void initComponents() {\n\t\t\n\t}", "private void initComponents() {\n\t\t\n\t}", "private void JTextField(String string) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "public GraphicUI() {\n initComponents();\n jPanelAddr.setVisible(false);\n jButtonDBToAddr.setVisible(false);\n jFrameMap.setVisible(false);\n\n selectedFormat = 0;\n quickSearch = false;\n \ttextFieldDefaults = setFieldDefaults();\n \ttextFieldCurrents = setFieldDefaults();;\n\n }", "public soal2GUI() {\n initComponents();\n }", "public abstract String getManipulatorButtonLabel();", "private void configureComponents() {\n save.setStyleName(ValoTheme.BUTTON_PRIMARY);\n save.setClickShortcut(ShortcutAction.KeyCode.ENTER);\n setVisible(false);\n }", "private void setupGUI()\n\t{\n\t\t//initializes labelNumberOfASCII and adds to frame \n\t\tlabelNumberOfASCII = new JLabel();\n\t\tlabelNumberOfASCII.setLocation(12, 8);\n\t\tlabelNumberOfASCII.setSize(191,26);\n\t\tlabelNumberOfASCII.setText(\"Number of ASCII characters used\");\n\t\tgetContentPane().add(labelNumberOfASCII);\n\t\t\n\t\t//initialized comboCharSet and adds to frame\n\t\tString comboCharSet_tmp[]={\"Small\", \"Medium\", \"Large\"};\n\t\tcomboCharSet = new JComboBox<String>(comboCharSet_tmp);\n\t\tcomboCharSet.setLocation(294, 12);\n\t\tcomboCharSet.setSize(96, 25);\n\t\tcomboCharSet.setEditable(true);\n\t\tcomboCharSet.addActionListener(this);\n\t\tgetContentPane().add(comboCharSet);\n\n\t\t//initializes labelNumberofPixels and adds to frame\n\t\tlabelNumberOfPixels = new JLabel();\n\t\tlabelNumberOfPixels.setLocation(12,28);\n\t\tlabelNumberOfPixels.setSize(240,51);\n\t\tlabelNumberOfPixels.setText(\"Number of pixels per ASCII character: \");\n\t\tgetContentPane().add(labelNumberOfPixels);\n\t\t\n\t\t//initializes comboNumberOfPixels and adds to frame\n\t\tString comboNumberOfPixels_tmp[]={\"1\",\"3\",\"5\",\"7\",\"10\"};\n\t\tcomboNumberOfPixels = new JComboBox<String>(comboNumberOfPixels_tmp);\n\t\tcomboNumberOfPixels.setLocation(294,40);\n\t\tcomboNumberOfPixels.setSize(96,25);\n\t\tcomboNumberOfPixels.setEditable(true);\n\t\tcomboNumberOfPixels.addActionListener(this);\n\t\tgetContentPane().add(comboNumberOfPixels);\n\n\t\t//initializes outputPathLabel and adds to frame\n\t\toutputPathLabel = new JLabel();\n\t\toutputPathLabel.setLocation(12, 55);\n\t\toutputPathLabel.setText(\"Output folder:\");\n\t\toutputPathLabel.setSize(218, 51);\n\t\toutputPathLabel.setVisible(true);\n\t\tgetContentPane().add(outputPathLabel);\n\n\t\t//initializes outputPathTextField and adds to frame\n\t\toutputPathTextField = new JTextField();\n\t\tString initPath;\n\t\t//sets default output to default directory, created in Main.java. looks according to operating system.\n\t\tif (OSUtils.isUnixOrLinux())\n\t\t\tinitPath = System.getProperty(\"user.home\") + \"/.picture-to-ascii/output\";\n\t\telse if (OSUtils.isWindows())\n\t\t\tinitPath = System.getProperty(\"user.home\") + \"\\\\My Documents\\\\picture-to-ascii\\\\output\";\n\t\telse\n\t\t\tinitPath = \"(output path)\";\n\t\t//if the directory failed to create for reasons other than incompatible OS, we want (output path).\n\t\tif (!new File(initPath).isDirectory())\n\t\t\tinitPath = \"(output path)\";\n\n\t\toutputPathTextField.setLocation(150, 70);\n\t\toutputPathTextField.setSize(240,25);\n\t\toutputPathTextField.setText(initPath);\n\t\tgetContentPane().add(outputPathTextField);\n\n\t\tfontSizeTextField = new JTextField();\n\t\tfontSizeTextField.setLocation(150, 100);\n\t\tfontSizeTextField.setSize(240,25);\n\t\tfontSizeTextField.setText(\"5\");\n\t\tgetContentPane().add(fontSizeTextField);\n\n\t\tfontSizeLabel = new JLabel();\n\t\tfontSizeLabel.setText(\"Font size:\");\n\t\tfontSizeLabel.setSize(125, 51);\n\t\tfontSizeLabel.setLocation(12, 85);\n\t\tfontSizeLabel.setVisible(true);\n\t\tgetContentPane().add(fontSizeLabel);\n\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n\n }", "public Designer() {\n initComponents();\n }", "public BBDJPAAdminGUI() {\n initComponents();\n\n myInit();\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "public static void OptionsComponents() {\n\t\tInterface.controls.setPreferredSize(Interface.dim);\n\t\tInterface.controls.setIcon(new ImageIcon(Interface.Button));\n\t\tInterface.controls.setHorizontalTextPosition(JButton.CENTER);\n\t\tInterface.controls.setVerticalTextPosition(JButton.CENTER);\n\t\tInterface.controls.setForeground(Color.white);\n\t\t\n\t\tInterface.controls2.setPreferredSize(Interface.dim);\n\t\tInterface.controls2.setIcon(new ImageIcon(Interface.Button));\n\t\tInterface.controls2.setHorizontalTextPosition(JButton.CENTER);\n\t\tInterface.controls2.setVerticalTextPosition(JButton.CENTER);\n\t\tInterface.controls2.setForeground(Color.white);\n\t\t\n\t\t\n\t\tInterface.sound.setPreferredSize(Interface.dim);\n\t\tInterface.sound.setIcon(new ImageIcon(Interface.Button));\n\t\tInterface.sound.setHorizontalTextPosition(JButton.CENTER);\n\t\tInterface.sound.setVerticalTextPosition(JButton.CENTER);\n\t\tInterface.sound.setForeground(Color.white);\n\t\t\n\t\tInterface.soundOn.setPreferredSize(Interface.dim);\n\t\tInterface.soundOn.setIcon(new ImageIcon(Interface.Button));\n\t\tInterface.soundOn.setHorizontalTextPosition(JButton.CENTER);\n\t\tInterface.soundOn.setVerticalTextPosition(JButton.CENTER);\n\t\tInterface.soundOn.setForeground(Color.white);\n\t\t\n\t\tInterface.soundOff.setPreferredSize(Interface.dim);\n\t\tInterface.soundOff.setIcon(new ImageIcon(Interface.Button));\n\t\tInterface.soundOff.setHorizontalTextPosition(JButton.CENTER);\n\t\tInterface.soundOff.setVerticalTextPosition(JButton.CENTER);\n\t\tInterface.soundOff.setForeground(Color.white);\n\t\t\n\t\t\n\t\tInterface.backtomain.setPreferredSize(Interface.dim);\n\t\tInterface.backtomain.setIcon(new ImageIcon(Interface.Button));\n\t\tInterface.backtomain.setHorizontalTextPosition(JButton.CENTER);\n\t\tInterface.backtomain.setVerticalTextPosition(JButton.CENTER);\n\t\tInterface.backtomain.setForeground(Color.white);\n\t\t\n\t\t\n\t\tInterface.save.setPreferredSize(Interface.dim);\n\t\tInterface.save.setIcon(new ImageIcon(Interface.Button));\n\t\tInterface.save.setHorizontalTextPosition(JButton.CENTER);\n\t\tInterface.save.setVerticalTextPosition(JButton.CENTER);\n\t\tInterface.save.setForeground(Color.white);\n\t\t\n\t\t\n\t\tInterface.backtooptions.setPreferredSize(Interface.dim);\n\t\tInterface.backtooptions.setIcon(new ImageIcon(Interface.Button));\n\t\tInterface.backtooptions.setHorizontalTextPosition(JButton.CENTER);\n\t\tInterface.backtooptions.setVerticalTextPosition(JButton.CENTER);\n\t\tInterface.backtooptions.setForeground(Color.white);\n\t\t\n\t\t\n\t\tInterface.player1.setForeground(Color.white);\n\t\tInterface.player2.setForeground(Color.white);\n\t\tInterface.up1.setForeground(Color.white);\n\t\tInterface.up2.setForeground(Color.white);\n\t\tInterface.down1.setForeground(Color.white);\n\t\tInterface.down2.setForeground(Color.white);\n\t\tInterface.right1.setForeground(Color.white);\n\t\tInterface.right2.setForeground(Color.white);\n\t\tInterface.left1.setForeground(Color.white);\n\t\tInterface.left2.setForeground(Color.white);\n\t\tInterface.bomb1.setForeground(Color.white);\n\t\tInterface.bomb2.setForeground(Color.white);\n\t\tInterface.boxNumber.setForeground(Color.white);\n\t\tInterface.getUp1.setEditable(false);\n\t\tInterface.getUp2.setEditable(false);\n\t\tInterface.getDown1.setEditable(false);\n\t\tInterface.getDown2.setEditable(false);\n\t\tInterface.getRight1.setEditable(false);\n\t\tInterface.getRight2.setEditable(false);\n\t\tInterface.getLeft1.setEditable(false);\n\t\tInterface.getLeft2.setEditable(false);\n\t\tInterface.getBomb1.setEditable(false);\n\t\tInterface.getBomb2.setEditable(false);\n\t}", "private void initComponentsCustom() {\n SGuiUtils.setWindowBounds(this, 480, 300);\n\n moTextUnitSymbol.setTextSettings(jlUnitSymbol.getText(), 15, 1);\n moTextUnitName.setTextSettings(jlName.getText(), 150, 1);\n moTextShortName.setTextSettings(SGuiUtils.getLabelName(jlAnalysisShortName.getText()), 10, 1);\n moTextName.setTextSettings(SGuiUtils.getLabelName(jlName.getText()), 100, 1);\n moKeyAnalysisType.setKeySettings(miClient, SGuiUtils.getLabelName(jlAnalysisType), true);\n\n moFields.addField(moTextUnitSymbol);\n moFields.addField(moTextUnitName);\n \n moFields.addField(moTextShortName);\n moFields.addField(moTextName);\n \n moFields.addField(moKeyAnalysisType);\n\n moFields.setFormButton(jbSave);\n }", "public void iniciaGUISesion() {\n\t\ttabbed.removeTabAt(1);\n\t\ttabbed.removeTabAt(1);\n\t\ttabbed.insertTab(\"Evolución bolsa\", null, getPanelControl(), \"Control de los usuarios\", 1);\n\t\ttabbed.insertTab(\"Eventos\", null, getPanelEventos(), \"Control de los eventos\", 2);\n\t}", "@Override\n public void settings() {\n // TODO Auto-generated method stub\n \n }", "@Override\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}" ]
[ "0.6945711", "0.6945711", "0.67775035", "0.6600435", "0.6543906", "0.6495166", "0.6455184", "0.6454877", "0.6438183", "0.64098823", "0.6362733", "0.63262373", "0.62928987", "0.6284876", "0.62815857", "0.6250616", "0.62096184", "0.6169255", "0.61455745", "0.6137502", "0.6137502", "0.6137502", "0.61340636", "0.6130521", "0.60837024", "0.60721886", "0.6065925", "0.6062181", "0.60580325", "0.6056803", "0.6042364", "0.60283947", "0.6019344", "0.600459", "0.59961927", "0.5983099", "0.5981781", "0.59812766", "0.5973068", "0.5969433", "0.5965001", "0.59643966", "0.59594214", "0.59585226", "0.5953358", "0.5932076", "0.5913057", "0.5903125", "0.5897153", "0.589512", "0.589167", "0.589167", "0.589167", "0.5889764", "0.5888894", "0.58870995", "0.5884698", "0.58845997", "0.58748627", "0.5873059", "0.5861053", "0.58562416", "0.58525825", "0.5852257", "0.5849285", "0.58484674", "0.5838999", "0.5819963", "0.5818645", "0.58181274", "0.5817643", "0.58164024", "0.5815435", "0.5810696", "0.5803756", "0.580275", "0.58000636", "0.5794397", "0.5786977", "0.5786765", "0.5786765", "0.5785485", "0.5783976", "0.57815224", "0.5779704", "0.5779583", "0.5778915", "0.5777328", "0.5777295", "0.5767247", "0.57635766", "0.57635766", "0.57635766", "0.57635766", "0.5763283", "0.57620966", "0.57580715", "0.5756756", "0.57550055", "0.57550055", "0.5751331" ]
0.0
-1
TODO Autogenerated method stub
public void setAlarm() { id.toAlarm(); }
{ "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
Retourne le nombre de ligne affecte par l'ajout
public int ajouter(Activite activite) { int rowAffected = super.executeUpdate(String.format( "INSERT INTO activite(nom, detail, dateDebut, dateFin, heureDebut, heureFin)" + "VALUES ('%s', '%s', '%s', '%s', '%s', '%s')", activite.getNom(), activite.getDetail(), activite.getDateDebut(), activite.getDateFin(), activite.getHeureDebut(), activite.getHeureFin() )); return rowAffected; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int enAttente() {\n\t\treturn nbmsg;\n\t}", "public int getNoOfRelevantLines() { return this.noOfRelevantLines; }", "private int numOnglet(){\n int selIndex = jTabPane_Accueil.getSelectedIndex();\n return selIndex;\n }", "public int number_of_lines() {\r\n\t\treturn line_index.size() - 1;\r\n\t}", "public int getLineNo();", "public int compterAnimaux(){\r\n\t\treturn noms.size();\r\n\t}", "public int getLineNo()\n\t{\n\t\treturn getIntColumn(OFF_LINE_NO, LEN_LINE_NO);\n\t}", "public void setNoOfRelevantLines(int norl) { this.noOfRelevantLines = norl; }", "public int contaPercorre() {\n\t\tint contaM = 0;\n\t\tCampusModel aux = inicio;\n\t\tString r = \" \";\n\t\twhile (aux != null) {\n\t\t\tr = r + \"\\n\" + aux.getNomeCampus();\n\t\t\taux = aux.getProx();\n\t\t\tcontaM++;\n\t\t}\n\t\treturn contaM;\n\t}", "public int obtenirLigne() {\n return this.ligne;\n }", "public int getIncline() { return incline; }", "public int getLines() {\n\t\treturn this.linhas;\n\t}", "int getEditsCount();", "public int calculerKgsNourritureParJour(){\r\n\t\treturn noms.size() * 10;\r\n\t}", "public int getNumLines ();", "public String afficherInfoFichierTexte(){\n\t\tString fichierComplet = \"\";\n\t\tfor (Joueur j: ListJoueur) {\n\t\t\tfichierComplet += j.afficherFichierTexte();\n\t\t}\n\t\treturn fichierComplet;\n\t}", "public int getLineNumber() {\n return line;\n }", "@Override\n\tpublic long getNumeroContrato() {\n\t\t// TODO Auto-generated method stub\n\t\treturn super.getNumeroContrato();\n\t}", "public int lineNum() {\n return myId.lineNum();\n }", "public int getNumMaille(float i, float j) {\n\n\t\tint deltai=(int) (this.mailleobservateur_i-i);\n\t\tint deltaj=(int) (this.mailleobservateur_j-j); \n\t\t\n\t\tint pos_reli = this.centre_relatif + deltai;\n\t\tint pos_relj = this.centre_relatif + deltaj;\nSystem.out.println(mailleobservateur_i +\" \"+ mailleobservateur_j +\" / \"+ deltai +\" \"+ deltaj);\t\t\t\nSystem.out.println(\" i-j: \"+ i + \" \"+ j);\n\nSystem.out.println(\" crel: \"+ centre_relatif);\n\nSystem.out.println(pos_reli +\" \"+ pos_relj);\t\t\t\n\t\tint nummaille = matrice_indexation[pos_reli][pos_relj];\nSystem.out.println(\"nummaille=\"+nummaille);\n\t\n\t\treturn nummaille;\n\t}", "public int getLineNumber() {\n return lineNumber;\n }", "public int MostrarUltimoValorIngresado() {\r\n return UltimoValorIngresado.informacion;\r\n }", "public Integer linesForEditing() {\n return this.linesForEditing;\n }", "public int getReceveur() {\r\n\t\treturn receveur;\r\n\t}", "int getNumberOfLines();", "private int contar(String nombre) {\n int c = 0;\n for (Nodo<Integer, Reservacion> th1 : this.th) {\n if (th1 != null && th1.value.Cliente().equals(nombre)) {\n c++;\n }\n }\n return c;\n }", "public String getLineNumber() \n\t{\n\t\treturn getNumber().substring(9,13);\n\t}", "public int getLineNr() {\n return this.lineNr;\n }", "public int getEtat() {\n\t\tint libres = this.nbLibres();\n\t\tint disponibles = this.nbDisponibles();\n\t\tif(disponibles > 0 && libres == 0) {\n\t\t\treturn 2; // toutes les voitures dispo\n\t\t} else if(disponibles > 0 && libres > 0) {\n\t\t\treturn 1; // voitures dispo et places libres\n\t\t} else {\n\t\t\treturn 0; // aucune voiture disponible\n\t\t}\n\t}", "public int lineNum() {\n return myLineNum;\n }", "int getNombreLignesPlateau();", "public int getLineNumber()\r\n {\r\n return lineNum;\r\n }", "public int getPartieEntier() {\n return partieEntier;\n }", "public String afficherTout()\n\t{\n\t\tString total = \"\";\n\t\tfor(Joueur j : ListJoueur)\n\t\t{\n\t\t\ttotal += \"\\n\" + j.afficherJoueur();\n\t\t}\n\t\treturn total;\n\t}", "public int getCouts(){\r\n\t\treturn listeEleves.size();\r\n\t}", "int getLineNumber();", "public int getLineNumber() {\n return lineNumber; \n }", "public void zugInWerkstatt() {\n werkstatt++;\n }", "public final int getLineNumber()\n {\n return _lineNumber + 1;\n }", "public int getLineNumber() {\n return line;\n }", "private static void statistique(){\n\t\tfor(int i = 0; i<7; i++){\n\t\t\tfor(int j = 0; j<7; j++){\n\t\t\t\tfor(int l=0; l<jeu.getJoueurs().length; l++){\n\t\t\t\t\tif(jeu.cases[i][j].getCouleurTapis() == jeu.getJoueurs()[l].getNumJoueur()){\n\t\t\t\t\t\tjeu.getJoueurs()[l].setTapis(jeu.getJoueurs()[l].getTapisRest()+1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tJoueur j;\n\t\tSystem.out.println(\"// Fin de la partie //\");\n\t\tfor(int i=0; i<jeu.getJoueurs().length; i++) {\n\t\t\tj =jeu.getJoueurs()[i];\n\t\t\tSystem.out.println(\"Joueur \"+ (j.getNumJoueur()+1) + \" a obtenue \"+j.getTapisRest()+j.getMonnaie()+\" points\" );\n\t\t}\n\t}", "int getLinesCount();", "@Override\n\tpublic String getInformeVendedor() {\n\t\treturn \"Informe trimestre 3\";\n\t}", "public int getNombreLiaison()\t{\r\n \treturn this.routes.size();\r\n }", "public int line() {\r\n return line;\r\n }", "public int getLineID()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(LINEID$2, 0);\n if (target == null)\n {\n return 0;\n }\n return target.getIntValue();\n }\n }", "public int conta()\n\t{\n\t\treturn posicoes.size();\n\t}", "public int getNombreNoeud()\t{\r\n \treturn this.noeuds.size();\r\n }", "public int getNrLoja() {\n return nrLoja;\n }", "public org.apache.xmlbeans.XmlInt addNewDependLineID()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlInt target = null;\n target = (org.apache.xmlbeans.XmlInt)get_store().add_element_user(DEPENDLINEID$26);\n return target;\n }\n }", "public int getHauteur() {\r\n\t\treturn this.hauteur;\r\n\t}", "public int getLineNumber()\n {\n // LineNumberReader counts lines from 0. So add 1\n\n return lineNumberReader.getLineNumber() + 1;\n }", "public int getLine() {\n return lineNum;\n }", "public int getAddEditMenuText();", "public int getLineNumber(){\n\t\treturn lineNumber;\n\t}", "public int rekisteroi() {\r\n alId = seuraavaNro;\r\n seuraavaNro++;\r\n\r\n return seuraavaNro;\r\n }", "public int getLineNumber() {\n return lineNumber;\n }", "public int getNumLines() {\n\t\treturn numLines;\n\t}", "public int lireCount() {\n\t\treturn cpt;\n\t}", "public int maiorGrau() {\n return poli.lastKey();\n }", "public int getLineNumber();", "public int AnzahlWerkstoffe()\n {\n if (liste.size() == 1)\n {\n System.out.println(\"Die Datenbank enthält \" + liste.size() + \" Werkstoff.\"); \n }\n else \n {\n System.out.println(\"Die Datenbank enthält \" + liste.size() + \" Werkstoffe.\");\n }\n return (int)liste.size();\n }", "@Override\r\n\tpublic String getMessage() {\r\n\t\treturn \"Veuillez entrer un nombre positif\";\r\n\t}", "public void nommerHeros() {\n\t\tSystem.out.println(\"\\nComment voulez vous appeler votre personnage ?\");\n\t\tthis.nom = Clavier.entrerClavierString();\n\t\tSystem.out.println(\"\\n*********Bienvenue dans le labyrinthe \" + getNom()+\"*********\");\n\t}", "public int extraer ()\n {\n if (raiz!=null)\n {\n int informacion = raiz.edad;\n raiz = raiz.sig;\n return informacion;\n }\n else\n {\n System.out.println(\"La lista se encuentra vacia\");\n return 0;\n }\n }", "public int getNumOrdine() {\n\t\t\treturn numOrdine;\n\t\t}", "public int getNumNucleiToAdd() {\n return updateCount - numNucleiToRemove;\n }", "public int getLineNumber() {\n return lineNumber;\n }", "public int getNumGruppoPacchetti();", "public int getLineWeight()\n {\n return lineaspessore;\n }", "public int lancia() {\r\n\t\tlancio = dado.tiraDado();\r\n\t\tthis.numLanci++;\r\n\t\treturn lancio;\r\n\t}", "public int getNrow(){\r\n \treturn this.nrow;\r\n \t}", "public int getAnnoIscrizione() {\n\t\treturn annoIscrizione;\n\t}", "public java.lang.String getNrContrato() {\n return nrContrato;\n }", "public void Nouvelleligne() {\n int maxEleve = retourneMaxNumber() + 1;\n try {\n Connector1.statement.executeUpdate(\"Insert INTO eleve(id_el) VALUES (\" + maxEleve + \")\");\n Object[] val = {maxEleve, \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"};\n effaceTable(jTable2, mode);\n mode.addRow(val);\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"ERROR \\n\" + e.getMessage());\n\n }\n\n }", "public int getLineNumber()\n {\n return parser.getLineNumber();\n }", "int getNombreColonnesPlateau();", "public String updateRowCount() {\n return null;\n }", "public int getLine() {\r\n\t\treturn line;\r\n\t}", "public int getEditClickCount() {\r\n \t\treturn graph.getEditClickCount();\r\n \t}", "public int getLine() {\n return line;\n }", "public int chercherCouleur(String nom){\n // Lecture dans le fichier \"utilisateurs.txt\"\n try (BufferedReader reader = new BufferedReader(new FileReader(\"utilisateurs.txt\"))) {\n String line = \"\";\n\n // Tant qu'on lit des choses dans le fichier\n while ((line = reader.readLine()) != null) {\n String[] tmp = (line.split(\":\")); // decoupage de la chaine pour recuperer le nom et la couleur associee\n\n String s = tmp[0]; // on recupere le nom de la personne\n if(s.equalsIgnoreCase(nom)){\n return Integer.valueOf(tmp[1]); // on recupere la couleur de la personne\n }\n }\n\n } catch (Exception ex) {\n ex.printStackTrace();\n System.out.println(ex.getMessage());\n }\n return 0; //retourne 0 si on n'a pas trouve le nom dans la liste\n }", "int getAfterLineNumber();", "public int getLine() {\n\t\treturn line;\n\t}", "public Integer getLineNumber() {\r\n return this.lineNumber;\r\n }", "@Override\r\n public int getRowCount() {\n if (leitores != null) {\r\n return leitores.size();\r\n }\r\n return 0;\r\n }", "private int getLineNumber() {\n int line = 0;\n if (_locator != null)\n line = _locator.getLineNumber();\n return line;\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 int getRowNo() {\n return rowIndex+1;\n }", "public int getLine() {\r\n return line;\r\n }", "public int numeroOcupado() {\n int i = 0;\n for (Map.Entry e : lista.entrySet()) {\n Equipamento eq = (Equipamento) e.getValue();\n if (eq.getEstado().equals(\"Ocupado\"))\n i++;\n }\n return i;\n }", "int getClientMsgNo();", "public int getLineNum() {\n\t\treturn lineNum;\n\t}", "public Integer getLineNumber() {\n return lineNumber;\n }", "public int getLineNumber() {\n\t\treturn lineNumber;\n\t}", "public int getLineNumber() {\n\t\treturn lineNumber;\n\t}", "public int EliminarNodo() {\r\n int auxiliar = UltimoValorIngresado.informacion;\r\n UltimoValorIngresado = UltimoValorIngresado.siguiente;\r\n tamaño--;\r\n return auxiliar;\r\n }", "public int getIndice() {\n\t\treturn this.indice;\n\t}", "public int getLine() {\n return line;\n }", "public int getCyclomaticNumber() {\n\t\treturn (this.getKrawedzie().size() - this.getWierzcholki().size() + this.iloscSpojnychSkladowych());\n\t}", "public Integer getMaxLineNo(CriteriaSC criteriaSC) throws BaseException\r\n\t{\r\n\t\tint lineNo = 0;\r\n\t\t\r\n\t\tlineNo = NumberUtil.nullToZero(criteriaDAO.getMaxLineNo(criteriaSC));\r\n\t\t\r\n\t\tlineNo++;\r\n\t\t\r\n\t\treturn lineNo;\r\n\t}" ]
[ "0.64481974", "0.61774606", "0.5947751", "0.58409655", "0.57334197", "0.56842166", "0.565416", "0.5602513", "0.56001085", "0.5581155", "0.5567902", "0.55664325", "0.5539962", "0.5455634", "0.5452461", "0.5435421", "0.54218876", "0.5415605", "0.5415122", "0.5413209", "0.5404319", "0.5398201", "0.53966236", "0.5391845", "0.538809", "0.5384345", "0.5372137", "0.53718233", "0.5367696", "0.53638685", "0.53568375", "0.5356611", "0.5351227", "0.53491014", "0.5348981", "0.5346704", "0.5344266", "0.5340994", "0.5335255", "0.5333258", "0.53300977", "0.5320935", "0.5317042", "0.53046495", "0.5302932", "0.5298387", "0.5296467", "0.52740926", "0.5269541", "0.5264936", "0.5259653", "0.5258846", "0.5258774", "0.5258008", "0.5250118", "0.52354807", "0.52353215", "0.5233688", "0.52314746", "0.5231439", "0.522884", "0.52120805", "0.52096355", "0.52073747", "0.52034014", "0.51904655", "0.5187399", "0.51823336", "0.5174105", "0.5172217", "0.51650345", "0.51584387", "0.5154512", "0.5154334", "0.51539665", "0.51530075", "0.5147113", "0.5134169", "0.5125624", "0.5123646", "0.5113815", "0.5110775", "0.510572", "0.5105158", "0.51029515", "0.51026624", "0.5099192", "0.50978184", "0.5094611", "0.5093562", "0.5093531", "0.5088504", "0.50802124", "0.507741", "0.5077082", "0.5077082", "0.50713223", "0.50681525", "0.50674415", "0.5055971", "0.50556254" ]
0.0
-1
recursion describes when a method/function calls itself in its implementation
public static void addOne(int x) { // i want to keep adding one to x // until x is 10 // you can do a while loop, or you can do a for loop System.out.println(x); if (x < 10) { addOne(x + 1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static void p(){\n System.out.println(\"My recursion example 1\");\n p();\n }", "static void recursive(SootMethod method){\r\n \tvisited.put(method.getSignature(),true);\r\n \tIterator <MethodOrMethodContext> target_1=new Targets(cg.edgesOutOf(method));\r\n \r\n \tif(target_1!=null){\r\n \t\twhile(target_1.hasNext())\r\n \t\t{\r\n \t\t\tSootMethod target_2=(SootMethod)target_1.next();\r\n \t\t\tSystem.out.println(\"\\t\"+ target_2.getSignature().toString());\r\n \t\t\tif(!visited.containsKey(target_2.getSignature()))\r\n \t\t\t\trecursive(target_2);\r\n \t\t}\r\n \t}\r\n \t}", "@Test public void selfRecursive() {\n check(\"declare function local:f($i) { if($i eq 12345) then $i else local:f($i+1) };\" +\n \"local:f(0)\",\n\n 12345,\n\n exists(Util.className(If.class) + '/' + Util.className(StaticFuncCall.class) +\n \"[@tailCall eq 'true']\")\n );\n }", "boolean isRecursive();", "@Test public void mixedSelfRecursive() {\n check(\"declare function local:inc($i) { $i + 1 };\" +\n \"declare function local:f($i) { if($i eq 12345) then $i \" +\n \"else local:f(local:inc($i)) };\" +\n \"local:f(0)\",\n\n 12345,\n\n exists(Util.className(If.class) + '/' + Util.className(StaticFuncCall.class) +\n \"[@tailCall eq 'true']\")\n );\n }", "@Test\n public void testRecursion() throws Exception {\n//TODO: Test goes here... \n/* \ntry { \n Method method = Solution.getClass().getMethod(\"recursion\", ArrayList<Integer>.class, TreeNode.class); \n method.setAccessible(true); \n method.invoke(<Object>, <Parameters>); \n} catch(NoSuchMethodException e) { \n} catch(IllegalAccessException e) { \n} catch(InvocationTargetException e) { \n} \n*/\n }", "boolean hasRecursive();", "public static String recursiveMethod(String str) {\n\t\tif (str.length() == 0) {\n\t\t\treturn \"\";\n\t\t}\n\t\treturn str.substring(str.length() - 1) + recursiveMethod(str.substring(0, str.length() - 1));\n\t}", "public static int recursiveFactorial(int num){\n\n //base case\n if(num == 0){\n return 1;\n }\n\n //recursive call\n return num * recursiveFactorial(num-1);\n\n //int 3 would be recursing down to recursiveFactorial(0), checking each time for base case\n //adding to call stack, then recursing up in reverse order through the\n // call stack to recursiveFactorial(3) with 3 * 2\n // or num - 1\n\n //sample call stack\n //recursiveFactorial(0) = returns right away, then pops and recurses up\n //recursiveFactorial(1)\n // recursiveFactorial(2)\n //recursiveFactorial(3)\n }", "public void callP(){\n super.walks(\"called parent method\");\n }", "static long factorialRecurse(int n) {\r\n if (n == 0 || n == 1) {\r\n return 1;\r\n }\r\n return factorialRecurse(n - 1) * n;\r\n }", "@Test\n\t\tpublic void applyRecursivelyGoal() {\n\t\t\tassertSuccess(\" ;H; ;S; s ⊆ ℤ |- r∈s ↔ s\",\n\t\t\t\t\trm(\"\", ri(\"\", rm(\"2.1\", empty))));\n\t\t}", "@Trace(excludeFromTransactionTrace = true, leaf = true, rollupMetricName = { \"Dude\", \"Man\" })\n private void fastMethod(boolean call) {\n AgentBridge.getAgent().getTracedMethod().nameTransaction(TransactionNamePriority.FRAMEWORK_HIGH);\n\n // and use the public api to access the current method\n NewRelic.getAgent().getTracedMethod().setMetricName(\n NewRelic.getAgent().getTracedMethod().getMetricName() + \"Dude\");\n\n // since this is a leaf, child calls should be ignored. Verify that with our counts\n if (call) {\n fastMethod(false);\n }\n }", "int getRecursionDepth();", "public boolean isRecursive ()\n {\n return m_bRecursive;\n }", "@Override\n\tpublic void VisitMethodCallNode(MethodCallNode Node) {\n\n\t}", "public void inOrderTraverseRecursive();", "private void incRecursion(int amount) {\n if (amount < 0) {\n Assert.assertTrue(recursion - amount >= 0,\n amount + \" cannot be subtracted from recursion \" + recursion);\n }\n recursion += amount;\n }", "boolean hasRecursionDepth();", "public class_4 method_9() {\n return this.method_17();\n }", "public static long factorialUsingRecursion (int num){\n\n if(num < 0){\n throw new UnsupportedOperationException(Util.NEGATIVE_MESSAGE);\n }\n\n if(num == 0)\n return 1;\n\n return num*factorialUsingRecursion(num-1);\n\n }", "static int recursiva1(int n)\n\t\t{\n\t\tif (n==0)\n\t\t\treturn 10; \n\t\tif (n==1)\n\t\t\treturn 20; \n\t\treturn recursiva1(n-1) - recursiva1 (n-2);\t\t\n\t\t}", "private static int recursion(int x) {\n\t\tif(x == 1) return 0;\n\n\t\tif(dp[x] != -1) return dp[x];\n\t\tint result = Integer.MAX_VALUE;\n\n\t\tif(x % 3 == 0) result = Math.min(recursion(x / 3), result);\n\t\tif(x % 2 == 0) result = Math.min(recursion(x >> 1), result);\n\t\tif(x >= 1) result = Math.min(recursion(x - 1), result);\n\n\t\treturn dp[x] = result + 1;\n\t}", "public List< FunctionCall > getFunctionCallsRecursively() {\r\n List< FunctionCall > calls = new ArrayList< FunctionCall >();\r\n calls.add( this );\r\n if ( arguments != null ) {\r\n for ( Object arg : arguments ) {\r\n FunctionCall argCall = null;\r\n try {\r\n argCall = Expression.evaluate( arg, FunctionCall.class, false, false );\r\n } catch ( IllegalAccessException e ) {\r\n // TODO Auto-generated catch block\r\n //e.printStackTrace();\r\n } catch ( InvocationTargetException e ) {\r\n // TODO Auto-generated catch block\r\n //e.printStackTrace();\r\n } catch ( InstantiationException e ) {\r\n // TODO Auto-generated catch block\r\n //e.printStackTrace();\r\n } catch ( ClassCastException e ) {\r\n ; // ignore -- this is expected\r\n }\r\n if ( argCall != null ) {\r\n calls.addAll( argCall.getFunctionCallsRecursively() );\r\n }\r\n }\r\n }\r\n return calls;\r\n }", "public boolean isRecursive() {\n return mIsRecursive;\n }", "@Test\r\n\tpublic void test02_fib() {\r\n\t\tRecursiveMethods rm = new RecursiveMethods();\r\n\t\tassertEquals(1, +rm.fib(1));\r\n\t\tassertEquals(1, +rm.fib(2));\r\n\t\tassertEquals(2, +rm.fib(3));\r\n\t\tassertEquals(3, +rm.fib(4));\r\n\t\tassertEquals(5, +rm.fib(5));\r\n\t\tassertEquals(8, +rm.fib(6));\r\n\t}", "public int recursive(int n) {\r\n //base case: return n if <= 1\r\n if (n <= 1) {\r\n return n;\r\n }\r\n //else return result of of two previous #s being added to each other\r\n return recursive(n - 1) + recursive(n - 2);\r\n }", "@Override\n\tpublic Void visit(MethodCall method) {\n\t\tprintIndent(\".\");\n\t\tindent++;\n\t\tmethod.caller.accept(this);\n\t\tmethod.type.accept(this);\n\t\tmethod.methodName.accept(this);\n\t\tfor (var v : method.args) \n\t\t\tv.accept(this);\n\t\tindent--;\n\t\treturn null;\n\t}", "int fact(int n) {\n if (n <= 1)\n return 1;\n else\n return n * fact(n-1);\n}", "@Test\r\n\tpublic void test05_occurrencesOf() {\r\n\t\tRecursiveMethods rm = new RecursiveMethods();\r\n\r\n\t\tassertEquals(0, rm.occurrencesOf(\"\", 'a'));\r\n\t\tassertEquals(1, rm.occurrencesOf(\"a\", 'a'));\r\n\t\tassertEquals(0, rm.occurrencesOf(\"b\", 'a'));\r\n\t\tassertEquals(3, rm.occurrencesOf(\"baaba\", 'a'));\r\n\t\tassertEquals(2, rm.occurrencesOf(\"baaba\", 'b'));\r\n\t\tassertEquals(0, rm.occurrencesOf(\"baaba\", 'c'));\r\n\t}", "public static void main(String[] args) {\n\t\trecursion(1,5);\n\t\t\t}", "public void visit(Call call) {}", "public void aMethod(){\n\t\tSystem.out.println(\"this is the parent aMethod()\");\n\t}", "public boolean isHierarchical() {\n/* 2889 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public void levelOneMethod() {\n\t\tSystem.out.println(\"level one method\");\n\t}", "public boolean supportsCallee(SootMethod method);", "private static void checkRecursion(RolapEvaluator eval, int c) {\n RolapMember[] members = eval.currentMembers.clone();\n Member expanding = eval.expandingMember;\n\n // Find an ancestor evaluator that has identical context to this one:\n // same member context, and expanding the same calculation.\n while (true) {\n if (c < 0) {\n eval = eval.parent;\n if (eval == null) {\n return;\n }\n c = eval.commandCount - 1;\n } else {\n Command command = (Command) eval.commands[c];\n switch (command) {\n case SET_CONTEXT:\n int memberOrdinal = (Integer) eval.commands[c - 1];\n RolapMember member = (RolapMember) eval.commands[c - 2];\n members[memberOrdinal] = member;\n break;\n case SET_EXPANDING:\n expanding = (RolapMember) eval.commands[c - 2];\n if (Arrays.equals(members, eval.currentMembers)\n && expanding == eval.expandingMember)\n {\n throw FunUtil.newEvalException(\n null,\n \"Infinite loop while evaluating calculated member '\"\n + eval.expandingMember + \"'; context stack is \"\n + eval.getContextString());\n }\n }\n c -= command.width;\n }\n }\n }", "private static int factorial(int num) {\n /**\n * validation\n */\n if (num < 0) {\n throw new IllegalArgumentException(\"num is invalid\");\n }\n\n /**\n * base case\n */\n if (num == 0) {\n return 1;\n }\n\n /**\n * recursive case\n */\n\n return num * factorial(num - 1);\n }", "private static String getCallingMethod(int depth) {\n return getTraceMethod(Thread.currentThread().getStackTrace(), DEPTH_ADD + depth);\n }", "public void callit();", "public Recusive_Methods(){\n int[][] array = {\n {1,2,3,4},\n {5,6,7,8},\n {9,10,11,12},\n {13,14,15,16},\n {17,18,19,20},\n };\n printer(array,0,0,array[0].length-1,array.length-1,0);\n\n StringReverse(\"this function writes the sentence in reverse\");\n StringReverse(\"selam alp emir bilek ben\");\n\n elfish(\"alpemir\",0,0,0);\n elfish(\"leaf\",0,0,0);\n elfish(\"waffles\",0,0,0);\n }", "public boolean isRecursive() {\n return this.recursive;\n }", "public boolean hasRecursive() {\n return recursive_ != null;\n }", "private void g()\r\n/* 30: */ {\r\n/* 31: 40 */ if (this.n) {\r\n/* 32: 41 */ return;\r\n/* 33: */ }\r\n/* 34: 45 */ if (this.l != null)\r\n/* 35: */ {\r\n/* 36: 47 */ if (this.f != null) {\r\n/* 37: 48 */ c();\r\n/* 38: */ }\r\n/* 39: 51 */ cuj.a(super.b(), this.l);\r\n/* 40: 52 */ this.n = true;\r\n/* 41: */ }\r\n/* 42: */ }", "private void propagateFeatures () {\n Logger.log(\"Propagating invocations through the Call Graph - DFS\");\n Set<SootMethod> calculated = new HashSet<SootMethod>();\n Chain<SootClass> classes = Scene.v().getApplicationClasses();\n SootClass c = null;\n SootMethod m = null;\n try {\n for (SootClass sclass : classes) {\n c = sclass;\n List<SootMethod> methods = sclass.getMethods();\n for (SootMethod method : methods) {\n m = method;\n if (!calculated.contains(method)) {\n propagateFeatures(method, calculated);\n }\n }\n }\n } catch (Exception e) {\n // handling\n }\n }", "private static int fab_recursive_2(int kth) {\n\n\t\tif (kth == 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (kth == 1) {\n\t\t\treturn fab_recursive_2(kth - 1) + 1;\n\t\t}\n\t\treturn fab_recursive_2(kth-1) + fab_recursive_2(kth-2);\n\t}", "public boolean isRecursive() {\n return this.recursive;\n }", "public boolean isRecursive() {\n return this.recursive;\n }", "public boolean isRecursive() {\n return this.recursive;\n }", "@Test\r\n\tpublic void test01_fact() {\r\n\t\tRecursiveMethods rm = new RecursiveMethods();\r\n\t\tassertEquals(1, rm.factorial(0));\r\n\t\tassertEquals(1, rm.factorial(1));\r\n\t\tassertEquals(2, rm.factorial(2));\r\n\t\tassertEquals(6, rm.factorial(3));\r\n\t\tassertEquals(24, rm.factorial(4));\r\n\t\tassertEquals(120, rm.factorial(5));\r\n\t}", "private static boolean superCallOrFieldInitializer_0_1(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"superCallOrFieldInitializer_0_1\")) return false;\n superCallOrFieldInitializer_0_1_0(b, l + 1);\n return true;\n }", "public void increaseNestingLevel() {\n\t\tthis.nestingLevel++;\n\t\tthis.resolvableType = null;\n\t\tif (this.methodParameter != null) {\n\t\t\tthis.methodParameter = this.methodParameter.nested();\n\t\t}\n\t}", "public boolean hasSelfLoops();", "private boolean check_only_call_relatives(Element element){\n\t\tArrayList<Element> relatives = new ArrayList<Element>();\n\t\tfor(Element elem_called : element.getRefFromThis()){\n\t\t\t//if they are brothers\n\t\t\tif(element.getParentName() != null && elem_called.getParentName() != null && element.getParentName().equals(elem_called.getParentName())){\n\t\t\t\trelatives.add(elem_called);\n\t\t\t}\n\t\t\t//if they are son - father\n\t\t\tif(element.getParentName() != null && element.getParentName().equals(elem_called.getIdentifier())){\n\t\t\t\trelatives.add(elem_called);\n\t\t\t}\t\t\t\n\t\t}\n\t\tif (relatives.size() == element.getRefFromThis().size()){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Override\r\n\tprotected void parentMethod() {\n\t\tsuper.parentMethod();\r\n\t\tSystem.out.println(\"ChildParentMethod\");\r\n\t}", "public boolean hasRecursionDepth() {\n return ((bitField0_ & 0x00000008) == 0x00000008);\n }", "public abstract void call();", "public static void reduceByOne(int n) {\n if (n >= 0) {\n reduceByOne(n - 1); //recursion function\n }\n System.out.println(\"Completed call using rec:\" + n);\n }", "static boolean isOuterMethodCall(AST node)\n {\n JavaNode call = getLastMethodCall((JavaNode) node);\n\n if (call.getPreviousSibling().getType() == JavaTokenTypes.LPAREN)\n {\n return false;\n }\n\n JavaNode expr = call.getParent();\n\n // if the topmost parent is no ELIST we know we can savely wrap and\n // align\n return getChainParent(expr).getType() != JavaTokenTypes.ELIST;\n }", "public boolean\n hasCall()\n {\n //##62 return hasCallInSubp;\n if (fCallCount > 0)\n return true;\n else\n return false;\n }", "StackManipulation virtual(TypeDescription invocationTarget);", "@Test\r\n\tpublic void test06_allPositive() {\r\n\t\tRecursiveMethods rm = new RecursiveMethods();\r\n\r\n\t\tint[] a1 = {};\r\n\t\tassertTrue(rm.allPositive(a1));\r\n\t\tint[] a2 = { 1, 2, 3, 4, 5 };\r\n\t\tassertTrue(rm.allPositive(a2));\r\n\t\tint[] a3 = { 1, 2, -3, 4, 5 };\r\n\t\tassertFalse(rm.allPositive(a3));\r\n\t}", "private static int numberOfWaysRecursive(int n) {\n\t\tif(n<0)\n\t\t\treturn 0;\n\t\tif(n==0)\n\t\t\treturn 1;\n\t\telse\n\t\t\treturn numberOfWaysRecursive(n-1) + numberOfWaysRecursive(n-2) + numberOfWaysRecursive(n-3);\n\t}", "public static JavaNode getLastMethodCall(JavaNode node)\n {\n JavaNode parent = node.getParent();\n\n switch (parent.getType())\n {\n case JavaTokenTypes.DOT :\n return getLastMethodCall(parent.getParent());\n\n default :\n return node;\n }\n }", "@Override\n\tpublic void call() {\n\t\t\n\t}", "public void method_6349() {\r\n super.method_6349();\r\n }", "@Test public void dynFuncCall() {\n check(\"let $sum :=\" +\n \" function($seq) {\" +\n \" let $go :=\" +\n \" function($seq, $acc, $go) {\" +\n \" if(empty($seq)) then $acc\" +\n \" else $go(tail($seq), $acc + head($seq), $go)\" +\n \" }\" +\n \" return $go($seq, 0, $go)\" +\n \" }\" +\n \"return $sum(1 to 100000)\",\n\n 5000050000L,\n\n empty(Util.className(FuncItem.class) + \"//\" + Util.className(DynFuncCall.class) +\n \"[@tailCall eq 'false']\")\n );\n }", "@Test\n public void withRecursion() {\n assertThat(ReturnKthtoLast.withRecursion(list, 4), is(2));\n }", "public void callmetoo(){\r\n\tSystem.out.println(\"This is a concrete method\");\r\n\t}", "public static long pureRecursive (int n)\r\n {\r\n if (n<1)\r\n throw new IllegalArgumentException(\"Number is non-positive!\");\r\n else if (n==1)\r\n return (n);\r\n else\r\n return (n * pureRecursive(n-1));\r\n }", "public static void getStackOverFlowErrorNoRecursion() {\n LOGGER.info(String.format(MESSAGE, \"StackOverflowError\", \"instantiating object whose constructor instantiates the object\"));\n new StackOverFlowObject();\n }", "@Override\n public void onRecursionEnd(int faces)\n {\n if(faces > previousResult)\n previousResult = faces;\n }", "static int recursion(int steps, int arrLen, int index, int[][] dp) {\n\n if (steps == 0 && index == 0) {\n return 1;\n }\n\n // extra base condition is index> steps , because we cannot return from there at all.\n if (steps == 0 || index < 0 || index >= arrLen || index > steps) return 0;\n\n if (dp[steps][index] != -1) return dp[steps][index];\n\n int ans = 0;\n\n // we can go either left , right or stay there itself.\n ans = (ans + recursion(steps - 1, arrLen, index, dp)) % MOD;\n ans = (ans + recursion(steps - 1, arrLen, index + 1, dp)) % MOD;\n ans = (ans + recursion(steps - 1, arrLen, index - 1, dp)) % MOD;\n dp[steps][index] = ans % MOD;\n return dp[steps][index];\n }", "void calculating(int depth);", "public T caseOperationCallOnSelfExpCS(OperationCallOnSelfExpCS object) {\r\n return null;\r\n }", "public static void main(String[] args){\n LinkedListDeque<String> lld = new LinkedListDeque<>();\n lld.addFirst(\"Hello\");\n lld.addLast(\"Java\");\n lld.addLast(\"!\");\n\n String s0 = lld.getRecursive(0);\n String s1 = lld.getRecursive(1);\n String s2 = lld.getRecursive(2);\n System.out.println(s0 + s1 + s2);\n System.out.println(lld.getRecursive(556));\n //lld.getRecursive(2);\n }", "public void setRecursive(boolean recursive)\n { this.recursive=recursive;\n }", "abstract protected boolean checkMethod();", "boolean isCalledNext();", "void check () {\r\n OzcError.setLineNumber (body.line_no);\r\n\r\n check_constructor:\r\n\r\n if (method.isNew () && !method.wasCalledSuper ()) {\r\n ClassType c = method.getDefinedClass ();\r\n ClassImplementation ci;\r\n if (c.isClassInterface ()) \r\n\tci = ((ClassInterface) c).getImplementation ();\r\n else \r\n\tci = (ClassImplementation) c;\r\n do {\r\n\tci = ci.getSuperClass ();\r\n\tif (ci == null || School.isSystem (ci)) break check_constructor;\r\n } while (!ci.hasConstructor ());\r\n\r\n OzcError.constructorMustCallSuper (method);\r\n }\r\n\r\n /* need return statement as last statement */\r\n try {\r\n body.check (this);\r\n } catch (Unreachable e) {\r\n Statement st = e.getStatement ();\r\n if (st != null) \r\n\tOzcError.unreachableSt (st);\r\n else if (method.isNew () && need_return)\r\n\tOzcError.unreachableLastSt (body.line_no);\r\n }\r\n }", "public boolean hasRecursionDepth() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public void method_1449() {\r\n super.method_1449();\r\n }", "public void method_1449() {\r\n super.method_1449();\r\n }", "public void method_1449() {\r\n super.method_1449();\r\n }", "@Override\n\tpublic Set<NFAState> eClosure(NFAState s) {\n\t\tSet<NFAState> visited = new TreeSet<NFAState>();\n\t\t//invoke recursive helper\n\t\tvisited = eClosureHelper(s, visited);\n\t\t\n\t\treturn visited;\n\t}", "private static int factorial(int n) {\n if (n == 1 || n == 0)\n return 1;\n else\n return n * factorial(n - 1);\n }", "private static boolean superCallOrFieldInitializer_0_1_0(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"superCallOrFieldInitializer_0_1_0\")) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = consumeToken(b, DOT);\n r = r && superCallOrFieldInitializer_0_1_0_1(b, l + 1);\n exit_section_(b, m, null, r);\n return r;\n }", "public static int fibonacciRecursion(int n) {\r\n if (n == 0) {\r\n return 0;\r\n }\r\n if (n == 1 || n == 2) {\r\n return 1;\r\n }\r\n return fibonacciRecursion(n - 2) + fibonacciRecursion(n - 1);\r\n }", "public static int factorialiterativa(int n){\n if(n>0){\r\n factorialrecursiva(n-1);//LLAMO A LA RECURSIVA\r\n }else {\r\n return 1;\r\n }\r\nreturn factorialrecursiva(n-1);\r\n }", "abstract int firstMethod(int c);", "public int b()\r\n/* 45: */ {\r\n/* 46: 58 */ g();\r\n/* 47: */ \r\n/* 48: 60 */ return super.b();\r\n/* 49: */ }", "public void inOrderTraverseIterative();", "public boolean hasRecursive() {\n return recursiveBuilder_ != null || recursive_ != null;\n }", "public int getRecursionDepth() {\n return recursionDepth_;\n }", "static int fact1(int n)\n {\n if(n == 0 || n == 1)\n return 1;\n return n * fact1(n-1);\n }", "public static void print_recursion(int a){\r\n if(a<2){\r\n array.add(a);\r\n for(int i=1;i<=array.size();i++){\r\n System.out.print(array.get(array.size()-i));\r\n }\r\n System.out.println(\"\");\r\n }\r\n else{\r\n array.add(a%2);\r\n print_recursion(a/2);\r\n }\r\n }", "private boolean helperDFS(Node current){\n\n if(expandedNode.size() == 999){\n //limit has been reached. jump out of recursion.\n expandedNode.add(current);\n System.out.println(\"No solution found.\");\n printExpanded(expandedNode);\n System.exit(0);\n return false;\n }\n\n boolean b = cycleCheck(current,expandedNode);\n\n if(!b){\n expandedNode.add(current);\n }else{\n return false;\n }\n\n if(current.getDigit().getDigitString().equals(goalNode.getDigit().getDigitString())){\n //goal reached.\n //expandedNode.add(current);\n solutionPath(current);\n printExpanded(expandedNode);\n System.exit(0);\n }\n\n //Now make the children.\n\n if(!forbidden.contains(current.getDigit().getDigitString())){\n\n if(current.getDigit().last_changed != 0){\n\n if ((Integer.parseInt(current.getDigit().getFirst_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseFirstDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(0);\n if(!forbidden.contains(child_node.getDigit().getDigitString()) && helperDFS(child_node)){\n return true;\n }\n }\n\n //+1 child first digit\n if ((Integer.parseInt(current.getDigit().getFirst_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseFirstDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(0);\n if(!forbidden.contains(child_node.getDigit().getDigitString()) && helperDFS(child_node)){\n return true;\n }\n }\n }\n\n if(current.getDigit().last_changed != 1){\n if ((Integer.parseInt(current.getDigit().getSecond_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseSecondDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(1);\n if(!forbidden.contains(child_node.getDigit().getDigitString()) && helperDFS(child_node)){\n return true;\n }\n }\n\n //+1 child\n if ((Integer.parseInt(current.getDigit().getSecond_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseSecondDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(1);\n if(!forbidden.contains(child_node.getDigit().getDigitString()) && helperDFS(child_node)){\n return true;\n }\n }\n }\n\n if(current.getDigit().last_changed != 2){\n if ((Integer.parseInt(current.getDigit().getThird_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseThirdDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(2);\n if(!forbidden.contains(child_node.getDigit().getDigitString()) && helperDFS(child_node)){\n return true;\n }\n }\n //+1 child\n if ((Integer.parseInt(current.getDigit().getThird_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseThirdDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(2);\n if(!forbidden.contains(child_node.getDigit().getDigitString()) && helperDFS(child_node)){\n return true;\n }\n }\n }\n }\n return false;\n }", "@Override\r\n\tpublic void visit(FunctionCallExpression functionCallExpression) {\n\r\n\t}", "static void factorial(){\n\t}", "public boolean isSetRecursive() {\n return EncodingUtils.testBit(__isset_bitfield, __RECURSIVE_ISSET_ID);\n }", "public boolean isSetRecursive() {\n return EncodingUtils.testBit(__isset_bitfield, __RECURSIVE_ISSET_ID);\n }" ]
[ "0.68401325", "0.6828552", "0.6730225", "0.6638348", "0.65532345", "0.6201839", "0.61692923", "0.6138372", "0.60736877", "0.6062668", "0.60094225", "0.5862496", "0.57639414", "0.5703706", "0.5686687", "0.56665456", "0.5655776", "0.56365454", "0.5599599", "0.5579719", "0.5542551", "0.55235815", "0.5458243", "0.5434491", "0.54290736", "0.5407634", "0.5400519", "0.5385788", "0.53828853", "0.5374266", "0.5348211", "0.5342153", "0.53199", "0.5308398", "0.5289611", "0.52704203", "0.5250372", "0.52353156", "0.52256316", "0.52236956", "0.5222996", "0.52222604", "0.52167916", "0.52137506", "0.52069396", "0.5206017", "0.5205095", "0.5205095", "0.5205095", "0.52041453", "0.5194129", "0.51866746", "0.5182746", "0.5171399", "0.5121987", "0.5121771", "0.51197386", "0.5118784", "0.5110162", "0.51066494", "0.5105393", "0.5103441", "0.5089286", "0.5084943", "0.50839925", "0.50706947", "0.50694615", "0.50473845", "0.50408685", "0.50314724", "0.5030766", "0.50258696", "0.5021004", "0.5020295", "0.5014938", "0.50144297", "0.5010413", "0.49979624", "0.49911645", "0.4987901", "0.4985683", "0.49796793", "0.49796793", "0.49796793", "0.4978967", "0.4975137", "0.49651182", "0.49614194", "0.49600658", "0.495968", "0.494914", "0.49474114", "0.49430314", "0.49427518", "0.49395487", "0.49337006", "0.49280638", "0.49278483", "0.492693", "0.49241498", "0.49241498" ]
0.0
-1
Installs Garbage collector event that increments counter for each collection.
public static void install(final TaskInputOutputContext context) { if (handlerInstalled) { LOG.debug("GC handler already installed"); return; } synchronized (GCMonitoring.class) { if (handlerInstalled) { return; } LOG.debug("installing GC handler"); handlerInstalled = true; GCMonitoring instance = new GCMonitoring(); List<GarbageCollectorMXBean> gcbeans = java.lang.management.ManagementFactory.getGarbageCollectorMXBeans(); for (GarbageCollectorMXBean gcbean : gcbeans) { LOG.debug("Registering to GC bean:" + gcbean); NotificationEmitter emitter = (NotificationEmitter) gcbean; NotificationListener listener = makeListener(instance, context); emitter.addNotificationListener(listener, null, null); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void runGarbageCollection()\n {\n // see if we need to run the collector...\n //----------------------------------------\n if (bRunCollector())\n {\n String sStaleDuration = \"\";\n int iStaleDuration = 0;\n \n try\n {\n sStaleDuration = PropertyAccessor.getProperty(GATEWAY_PROPERTY_FILE, GARBAGE_COLLECT_STALE_DURATION);\n iStaleDuration = Integer.parseInt(sStaleDuration);\n } \n catch (Exception e)\n {\n String sErrorMessage = \"Failed to read and parse property: \" + GARBAGE_COLLECT_STALE_DURATION +\n \" from PropertyFile: \" + GATEWAY_PROPERTY_FILE + \".propertues. No \" +\n \"garbage collection will be done on the aggregator tables.\";\n log.error(sErrorMessage);\n return;\n }\n \n if ((sStaleDuration == null) ||\n (sStaleDuration.length() <= 0))\n {\n String sErrorMessage = \"Failed to read and parse property: \" + GARBAGE_COLLECT_STALE_DURATION +\n \" from PropertyFile: \" + GATEWAY_PROPERTY_FILE + \".propertues. No \" +\n \"garbage collection will be done on the aggregator tables.\";\n log.error(sErrorMessage);\n return;\n }\n \n Calendar oCal = Calendar.getInstance();\n oCal.add(Calendar.SECOND, (-1) * iStaleDuration);\n \n log.debug(\"Running aggregator garbage collection thread now.\");\n \n GarbageCollectorThread oCollectorThread = new GarbageCollectorThread(oCal.getTime());\n oCollectorThread.run();\n dtLastRun = new Date();\n \n }\n }", "void doGarbageCollection(GCType type);", "private void incrementGcCounter() {\n if (null == PSAgentContext.get().getMetrics()) {\n return; // nothing to do.\n }\n long elapsedGc = getElapsedGc();\n long totalGc = 0;\n String gc_time = PSAgentContext.get().getMetrics().get(AngelCounter.GC_TIME_MILLIS);\n if (gc_time != null) {\n totalGc = elapsedGc + Long.parseLong(gc_time);\n } else {\n totalGc = elapsedGc;\n }\n PSAgentContext.get().getMetrics().put(AngelCounter.GC_TIME_MILLIS, Long.toString(totalGc));\n }", "void scheduleGarbageCollection(GCType type, long delay);", "public BoundEventListener addGarbageCollectionControl(final Runnable r)\n {\n DiscreteEventAdapter gcRequestListener = new DiscreteEventAdapter(\"System\", \"Request Garbage Collect\",\n \"Requests that the JVM run the garbage collector\")\n {\n @Override\n public void eventOccurred(InputEvent event)\n {\n r.run();\n }\n };\n\n ControlContext context = myToolbox.getControlRegistry().getControlContext(ControlRegistry.GLOBE_CONTROL_CONTEXT);\n context.addListener(gcRequestListener, new DefaultKeyPressedBinding(KeyEvent.VK_G));\n\n return gcRequestListener;\n }", "public void incrMetaCacheNumClearServer() {\n metaCacheNumClearServer.inc();\n }", "public FileGarbageCollector(){\n\t\tthis.maxAge = 0;\n\t\tthis.dirs = new Vector<File>();\n\t}", "private static void runGC () throws Exception \r\n {\n for (int r = 0; r < 4; ++ r) _runGC (); \r\n }", "void incrementAddedCount() {\n addedCount.incrementAndGet();\n }", "@Override\r\n\tpublic void debit() {\n\t\tSystem.out.println(\"Core Method of GC\");\r\n\t}", "public static void gc() {\n // Collecting RAM before collecting EEPROM means that only live objects\n // in RAM with pointers to EEPROM will be considered as roots while\n // marking EEPROM objects.\n Native.gc();\n\n int wordSize = Native.getPersistentMemorySize()/4;\n try {\n int[] bitVector = new int[(wordSize / 32) + 2];\n int[] markingStack = new int[GC_MARK_STACK_SIZE];\n Native.gcPersistentMemory(bitVector, markingStack);\n } catch (OutOfMemoryError oome) {\n throw new OutOfMemoryError(\"Cannot allocate auxillary data structures for persistent gc\");\n }\n }", "void collect(MetricsCollector collector);", "protected final void addCollectableComponentModelListeners() {\n\t\tfor (CollectableComponentModel clctcompmodel : this.getCollectableComponentModels()) {\n\t\t\t// clctcompmodel.addCollectableComponentModelListener(this.getCollectableComponentModelListener());\n\t\t\tListenerUtil.registerCollectableComponentModelListener(clctcompmodel, null, getCollectableComponentModelListener());\n\t\t}\n\t}", "private void garbageColl(){\n\t\tfor(Page p: pageList){\n\t\t\tp.garbageColl();\n\t\t}\n\t\tpageIndex = 0;\n\t}", "public void counterAddup(){\n\t\tfor (int i=0; i<window.size(); i++){\n\t\t\tif ( window.get(i).acked == false ){\n\t\t\t\twindow.get(i).counter = window.get(i).counter+1;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn ;\n\t}", "private void totalCPUCores_EntityChanged(Object sender, EventArgs args) {\n removeCPUListeners();\n\n behavior.totalCpuCoresChanged();\n\n // start listening again\n addCPUListeners();\n }", "public void collect(int amount){\n this.collectedItems += amount;\n }", "synchronized static public void markCollectable(String name, Object ref) {\n Objects.requireNonNull(ref);\n\n CollectableEntry entry = new CollectableEntry(new Date(), name);\n AssertCollectableLive pRef = new AssertCollectableLive(name, ref, () -> {\n removeCollectable(entry);\n });\n collectables.add(entry);\n CleanupDetector.onCleanup(pRef);\n }", "public void scheduleCollectNow() {\r\n\t\tif (monitoringDisabled) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tfinal TimerTask collectTask = new TimerTask() {\r\n\t\t\t/** {@inheritDoc} */\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\t// errors must not happen in this task\r\n\t\t\t\tcollectWithoutErrors();\r\n\t\t\t}\r\n\t\t};\r\n\t\ttimer.schedule(collectTask, 0);\r\n\t}", "@Override\n\tvoid collect() {\n\t\t\n\t}", "public void gc();", "private void collectGarbageInCache() {\n CacheReference r;\n while ((r = (CacheReference)queue.poll()) != null) {\n fontCache.remove(r.getKey());\n }\n }", "public static void initializeMetrics()\n {\n // Get the Java runtime\n Runtime runtime = Runtime.getRuntime();\n // Run the garbage collector\n runtime.gc();\n \tstartingMemory = runtime.totalMemory() - runtime.freeMemory();\n }", "public static void performanceCountEnable(int event) { }", "@Override\n public void sizeChanged(IntBuffer collection) {\n semaphore.release();\n }", "protected final void removeCollectableComponentModelListeners() {\n\t\tfor (CollectableComponentModel clctcompmodel : this.getCollectableComponentModels()) {\n\t\t\tclctcompmodel.removeCollectableComponentModelListener(this.getCollectableComponentModelListener());\n\t\t}\n\t}", "public void init(GameContainer gc) throws SlickException{\n\t\tfor(@SuppressWarnings(\"unused\") CollectibleType t : CollectibleType.values()){\n\t\t\ttimeSinceLastSpawns.add(0);\n\t\t}\n\t}", "public void notifyCounter() {\n if (counter > 0) {\n this.counter = this.counter - 1;\n }\n }", "@Override\n public void componentOpened() {\n MemoryManager.addMemoryManagerListener(this);\n updateObjectCounts();\n }", "public void incrRefCounter() {\n\t\tthis.refCounter++;\n\t}", "private int collect(XQueue in, int oid) {\n long tm;\n int id = -1, k, n;\n n = 0;\n while ((id = pool.collect(-1L)) >= 0) {\n tm = System.currentTimeMillis();\n k = collect(tm, id, in, oid);\n if (k >= 0)\n n ++;\n else\n new Event(Event.ERR, name+\" failed to collect from \"+id).send();\n }\n if (n > 0 && (debug & DEBUG_COLL) > 0)\n new Event(Event.DEBUG, name + \" collected \" + n + \" tasks\").send();\n return n;\n }", "public synchronized void clear() {\n collected.clear();\n }", "public void mo14070E() {\n this.f15664t0.onGatheringCleared();\n }", "public void markFinalizePartitionCounters() {\n finalizePartitionCounters = true;\n }", "@Test\n public void eventNoMemory() throws Exception {\n GCEvent event = new GCEvent();\n event.setType(G1_YOUNG_INITIAL_MARK);\n event.setTimestamp(0.5);\n event.setPause(0.2);\n // but no memory information -> all values zero there\n GCModel model = new GCModel();\n model.add(event);\n DoubleData initiatingOccupancyFraction = model.getCmsInitiatingOccupancyFraction();\n Assert.assertEquals(\"fraction\", 0, initiatingOccupancyFraction.getSum(), 0.1);\n }", "public void clearCollected(){\n\t\tcollected.clear();\n\t}", "@Override\n\tpublic int drainTo(Collection<? super E> c) {\n\t\treturn 0;\n\t}", "void generateGC(UDPAddress sender, int gcNum) {\n // PRAGMA [DEBUG] Debug.out.println(\"Sending GC message to \" + sender + \" with val \" + gcNum);\n generateControlMessage(sender, gcNum, UDPTransportLayer.MESSAGE_TYPE_GC);\n }", "@Override\n public final void onHit(final K key) {\n if (!freqHitMap.containsKey(key)) {\n freqHitMap.put(key, 1);\n return;\n }\n\n // Add 1 to times used in map\n freqHitMap.put(key, freqHitMap.get(key) + 1);\n }", "void decrementAddedCount() {\n addedCount.decrementAndGet();\n }", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tcounter.accumulate(1);\n\t\t\t\t}", "private void updateStatsCAE(){\n\t\tupdateQueueSize();\n\t}", "public void terminateCollect(){\n\t\t\ttry {\n\t\t\t\tdumpHandler.breakLoop();\t\t\t\t\n\t\t\t\tdumpHandler.close();\n\t\t\t\tlog.info(\"terminate!\");\n\t\t\t\t \n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\t\n\t\t\t\n\n\t}", "void updateFrequencyCount() {\n //Always increments by 1 so there is no need for a parameter to specify a number\n this.count++;\n }", "void startGCThread() {\n Enumeration<?> nextReq;\n UDPAddress senderAddr;\n Integer packetSeq;\n Hashtable<Integer, DatagramPacket> heldMsgs;\n Integer gClast;\n int bound;\n\n // This thread only exits when the foundry crashes\n while (true) {\n // Wait until there is a new GC packet\n try {\n\tsynchronized (gcPackets) {\n\t if (gcPackets.empty()) \n\t gcPackets.wait();\n\t}\n } catch (InterruptedException e) {\n\tDebug.exit(\"GC thread should never be interrupted!: \" + e.toString());\n }\n\n nextReq = (Enumeration<?>) gcPackets.dequeue();\n senderAddr = (UDPAddress) nextReq.nextElement();\n packetSeq = (Integer) nextReq.nextElement();\n heldMsgs = (Hashtable<Integer, DatagramPacket>) notGCd.get(senderAddr);\n bound = packetSeq.intValue();\n\n if (heldMsgs == null) {\n\theldMsgs = new Hashtable<Integer, DatagramPacket>();\n\tnotGCd.put(senderAddr, heldMsgs);\n }\n gClast = (Integer) lastGCd.get(senderAddr);\n if (gClast == null)\n\tgClast = new Integer(-1);\n\n // PRAGMA [DEBUG] Debug.out.println(\"Message sent from: \" + senderAddr);\n // PRAGMA [DEBUG] Debug.out.println(\"GC messages <= \" + packetSeq);\n\n if (bound > gClast.intValue()) {\n\t// Now remove any messages satisfying:\n\t// gClast < msg_num <= packetSeq\n\tfor(int rem=gClast.intValue() + 1; rem <= bound; rem++) {\n\t // PRAGMA [DEBUG] Debug.out.println(\"Removing message with ID: \" + rem);\n\t notGCd.remove(new Integer(rem));\n\t}\n\n\t// Update lastGCd\n\tlastGCd.put(senderAddr, packetSeq);\n }\n }\n }", "private synchronized void incVMCount() {\n if (!VMCounted) {\n statistics().incInt(VM_COUNT, 1);\n VMCounted = true;\n }\n }", "public static void startCaching() {\n\t\t/*\n\t\t * component caching happens if the collection exists\n\t\t */\n\t\tfor (ComponentType aType : ComponentType.values()) {\n\t\t\tif (aType.preLoaded == false) {\n\t\t\t\taType.cachedOnes = new HashMap<String, Object>();\n\t\t\t}\n\t\t}\n\t}", "public void addCounter(ModelCounter c) {\r\n\t\tcounters.add(c);\r\n\t}", "@Override\n public void run($ collection) {\n\n CleanupRunnable.run();\n }", "void incCount() {\n ++refCount;\n }", "public final void onDeregistration()\n {\n onObjectDeregistration();\n this.container = null;\n }", "public void incrMetaCacheNumClearRegion() {\n metaCacheNumClearRegion.inc();\n }", "public void setPriorityCollect()\n\t{\n\t\tsetCollect(_Prefix + HardZone.PRIORITY.toString(), \"\");\n\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\tfor(int i = 0; i < 1000; i++) {\r\n\t\t\t\t\tfinal BasicDBObject doc = new BasicDBObject(\"_id\", i);\r\n\t\t\t\t\tdoc.put(\"ts\", new Date());\r\n\t\t\t\t\tcoll.insert(doc);\r\n\t\t\t\t}\r\n\t\t\t}", "private void eventLookupStarted() {\n\t\tsynchronized(lookupCounterMutex) {\n\t\t\tlookupCounter++;\n\t\t}\n\t}", "@Override\n public final void onPut(final K key, final V value) {\n if (!freqPutMap.containsKey(key)) {\n freqPutMap.put(key, 1);\n return;\n }\n\n // Add 1 to times used in map\n freqPutMap.put(key, freqPutMap.get(key) + 1);\n }", "@Override\n public void initialize() {\n counter = 0;\n }", "@Override\n public void initialize() {\n counter = 0;\n }", "public void garbageCollectOrphans() {\r\n /**\r\n * The list of orphaned queues was assembled in the browser session \r\n * preceding the current one. At this point it is safe to get rid \r\n * of them; their windows must have long since being destroyed.\r\n */\r\n for (SeleneseQueue q : orphanedQueues) {\r\n q.endOfLife();\r\n }\r\n orphanedQueues.clear();\r\n }", "public synchronized void collectionRemoved(int collectionNum) {\n\n\t}", "private void setupCollector() {\n outList = new ArrayList<>();\n }", "public static void main(String[] args) {\n\tRuntime rt = Runtime.getRuntime();\n\t\n\tSystem.out.println(\"Available Free Memory: \" + rt.freeMemory());\n\t\n\tfor(int i=0; i<10000; i++ ) {\n\tGC1 x = new GC1(i);\n\t}\n\n\tSystem.out.println(\"Free Memory before call to gc(): \" +rt.freeMemory());\n\tSystem.runFinalization();\n\tSystem.gc();\n\tSystem.out.println(\" Free Memory after call to gc(): \" +\n\trt.freeMemory());\n\n\t}", "public void incrementDeaths() {\n stats.put(deathsKey, (Integer)stats.get(deathsKey)+1);\n }", "@External\r\n\t@ClientFunc\r\n\tpublic MetaVar __gc();", "public KeyStatsListener() {\n sortedSet = new TreeSet<Map.Entry<K, Integer>>(\n new Comparator<Map.Entry<K, Integer>>() {\n\n @Override\n public int compare(final Map.Entry<K, Integer> e1,\n final Map.Entry<K, Integer> e2) {\n\n if (e1.getValue().compareTo(e2.getValue()) != 0) {\n return -1 * e1.getValue().compareTo(e2.getValue());\n }\n\n return 1;\n }\n });\n\n freqHitMap = new TreeMap<K, Integer>();\n freqMissMap = new TreeMap<K, Integer>();\n freqPutMap = new TreeMap<K, Integer>();\n }", "public static void main(String[] args) {\n\r\n\t\tGarbagecollection g1 = new Garbagecollection();\r\n\t\t\r\n\t\tGarbagecollection g2 = new Garbagecollection();\r\n\t\t\r\n\t\tg1=null;\r\n\t\tg2=null;\r\n\t\tSystem.gc();\r\n\t}", "@java.lang.Override\n public long getNextCollectTimestampMs() {\n return nextCollectTimestampMs_;\n }", "@Override\n public void onProcess(final OIFitsCollectionManagerEvent event) {\n logger.debug(\"onProcess {}\", event);\n\n switch (event.getType()) {\n case COLLECTION_CHANGED:\n // update collection analysis:\n oiFitsCollection.analyzeCollection();\n\n // TODO: see if the \"GUI\" manager decide to create objects itself ?\n // TODO: remove ASAP:\n // initialize current objects: subsetDefinition, plotDefinition, plot if NOT PRESENT:\n getCurrentPlotRef();\n\n // CASCADE EVENTS:\n // SubsetDefinition:\n for (SubsetDefinition subsetDefinition : getSubsetDefinitionList()) {\n // force fireSubsetChanged, update plot reference and firePlotChanged:\n updateSubsetDefinitionRef(this, subsetDefinition);\n }\n\n // PlotDefinition:\n for (PlotDefinition plotDefinition : getPlotDefinitionList()) {\n // force PlotDefinitionChanged, update plot reference and firePlotChanged:\n updatePlotDefinitionRef(this, plotDefinition);\n }\n\n // Note: no explicit firePlotChanged event fired as done in updateSubsetDefinitionRef and updatePlotDefinitionRef\n break;\n default:\n }\n logger.debug(\"onProcess {} - done\", event);\n }", "@Override\n public void addNew(int latency) {\n count.getAndIncrement();\n }", "@Override\r\n public void processRemoveAll()\r\n {\r\n final ICacheEvent<String> cacheEvent =\r\n createICacheEvent(getCacheName(), \"all\", ICacheEventLogger.REMOVEALL_EVENT);\r\n try\r\n {\r\n reset();\r\n }\r\n finally\r\n {\r\n logICacheEvent(cacheEvent);\r\n }\r\n }", "public void processScheduledEvent(HttpArtifactCacheEvent.Scheduled event) {\n if (event.getOperation() != ArtifactCacheEvent.Operation.STORE) {\n return;\n }\n\n scheduledCount.incrementAndGet();\n }", "public void clear(){\n this.collected.clear();\n }", "@java.lang.Override\n public long getNextCollectTimestampMs() {\n return nextCollectTimestampMs_;\n }", "public void collect() {\n _collectorMotor.set(collectSpeed);\n //system..out.println(\"Collector Power: \" + _collectorMotor.get());\n }", "public void resetCounters()\n {\n cacheHits = 0;\n cacheMisses = 0;\n }", "public synchronized void incrementCount() {\r\n\t\tcount++;\r\n\t\tnotifyAll();\r\n\t}", "public static void performanceCountReset() { }", "@Override\r\n\tpublic void updateCounter(CounterModel cm) {\n\t\thomedao.updateCounter(cm);\r\n\t}", "private void cleanGarbageInfos()\r\n\t{\r\n\t\tfinal Iterator<SubscriberInfo> lIter = this.subscriberInfos.iterator();\r\n\t\twhile (lIter.hasNext())\r\n\t\t{\r\n\t\t\tfinal SubscriberInfo lInfo = lIter.next();\r\n\t\t\tif (lInfo.isGarbage())\r\n\t\t\t{\r\n\t\t\t\tlIter.remove();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n public void accept(T event) {\n synchronized(this) {\n collected.add(event);\n }\n }", "private void incrementCounter()\r\n\t{\r\n\t\tthis.counter++;\r\n\t}", "void garbageCollector() {\n Enemy ETR = null;\n Sprite BTR = null;\n Medkit MTR = null;\n for (Enemy e: enemies) {\n if (e.eTank.getX() < -100) {\n ETR = e;\n }\n }\n for (Sprite c: smBullets) {\n if (c.getX() > width + 100) {\n BTR = c;\n }\n if (c.getY() > height + 100) {\n BTR = c;\n }\n if (c.getX() < -100) {\n BTR = c;\n }\n if (c.getY() < -100) {\n BTR = c;\n }\n }\n \n for (Medkit med : health) {\n if (med.timer <= 0) {\n MTR = med;\n }\n }\n //gets rid of bullets that went off-screen\n if (BTR != null) {\n smBullets.remove(BTR);\n println(\"Deleted bullet\");\n }\n if (ETR != null) {\n enemies.remove(ETR);\n }\n //Medkits to despawn\n if (MTR != null) {\n health.remove(MTR);\n }\n}", "private EventsCollector() {\n\t\tsuper();\n\t}", "private void distribute( final BindingEvent event, final BindingPublisher publisher, final int rank )\n {\n for ( final Iterator<XRankedBindings> itr = bindingsCache.values().iterator(); itr.hasNext(); )\n {\n final XRankedBindings bindings = itr.next();\n if ( bindings.isActive() )\n {\n notify( bindings, event, publisher, rank );\n }\n else\n {\n itr.remove(); // cleanup up stale entries\n }\n }\n\n for ( int i = 0; i < watchedBeans.size(); i++ )\n {\n final XWatchedBeans beans = watchedBeans.get( i );\n if ( beans.isActive() )\n {\n notify( beans, event, publisher, rank );\n }\n else\n {\n watchedBeans.remove( i-- ); // cleanup up stale entries\n }\n }\n }", "private void increment() {\n for (int i=0; i < 10000; i++) {\n count++;\n }\n }", "private static void startCleanUp() {\n\n if (!isEventTrackerRunning) {\n var ttrcker = new EventTrackInfoHandler();\n timer = new Timer(true);\n timer.scheduleAtFixedRate(ttrcker, timerDelayTime, checkInterval);\n debugLogger.info(\"EventTrackInfoHandler begins! : {}\", new Date());\n } else {\n debugLogger.info(\"Timer is still running : {}\", new Date());\n\n }\n }", "public final void addRef() { refCount.incrementAndGet(); }", "public void startCollection() {\n if (recordHandler != null)\n recordHandler.startCollection();\n }", "private void eventProcessingStarted() {\n\t\tsynchronized(processingCounterMutex) {\n\t\t\tprocessingCounter++;\n\t\t}\n\t}", "public static void main(String[] args) {\nGarbagecollection s1=new Garbagecollection();\r\nGarbagecollection s2=new Garbagecollection();\r\ns1=null;\r\ns2=null;\r\nSystem.gc();\r\n\t}", "private void maintain() {\n SoftObject obj;\n int count = 0;\n\n while ((obj = (SoftObject)queue.poll()) != null) {\n count++;\n collection.remove(obj);\n }\n\n if (count != 0) {\n // some temporary debugging fluff\n System.err.println(\"vm reclaimed \" + count + \" objects\");\n }\n }", "@SuppressWarnings(\"deprecation\")\n private void updateResourceCounters() {\n updateHeapUsageCounter();\n\n // Updating resources specified in ResourceCalculatorProcessTree\n if (pTree == null) {\n return;\n }\n pTree.updateProcessTree();\n long cpuTime = pTree.getCumulativeCpuTime();\n long pMem = pTree.getCumulativeRssmem();\n long vMem = pTree.getCumulativeVmem();\n // Remove the CPU time consumed previously by JVM reuse\n cpuTime -= initCpuCumulativeTime;\n PSAgentContext.get().getMetrics().put(AngelCounter.CPU_MILLISECONDS, Long.toString(cpuTime));\n PSAgentContext.get().getMetrics().put(AngelCounter.PHYSICAL_MEMORY_BYTES, Long.toString(pMem));\n PSAgentContext.get().getMetrics().put(AngelCounter.VIRTUAL_MEMORY_BYTES, Long.toString(vMem));\n }", "public HitCounter() {\n q = new ArrayDeque();\n map = new HashMap();\n PERIOD = 300;\n hits = 0;\n }", "@RefreshScope\n @Bean\n public MetricRegistry metrics() {\n final MetricRegistry metrics = new MetricRegistry();\n metrics.register(\"jvm.gc\", new GarbageCollectorMetricSet());\n metrics.register(\"jvm.memory\", new MemoryUsageGaugeSet());\n metrics.register(\"thread-states\", new ThreadStatesGaugeSet());\n metrics.register(\"jvm.fd.usage\", new FileDescriptorRatioGauge());\n return metrics;\n }", "public static void main(String[] args) {\n\t\tMonkey m1 = new Monkey(\"Money\");\r\n\t\tMonkey m2 = new Monkey(\"Peter\");\r\n\t\tMonkey m3 = new Monkey(\"CCR\");\r\n\t\tSystem.out.println(Monkey.count);\r\n\t\tm1=null;\r\n\t\tm2=null;\r\n\t\tm3=null;\r\n\t\tSystem.gc();\r\n\t\tSystem.out.println(Monkey.count);\r\n\t}", "@Override\n public void afterPropertiesSet() throws Exception {\n GuavaCacheMetrics.monitor(\n registry,\n cache,\n \"serialLookupCache\",\n Collections.singleton(Tag.of(StoreMetrics.TAG_STORE_KEY, StoreMetrics.TAG_STORE_VALUE)));\n }", "@Override\r\n\tpublic void cleanUp(Event event) {\n\t\t\r\n\t}", "@Override\n\tpublic void resetEventListener() {\n\t\tcreateHists();\n\t}", "public synchronized void onReleased(int cycle, File file)\n {\n chronicleStoreFiles.offer(file);\n //This isn't accurate because the files are sparse, but it's at least pessimistic\n bytesInStoreFiles += file.length();\n logger.debug(\"Chronicle store file {} rolled file size {}\", file.getPath(), file.length());\n while (bytesInStoreFiles > maxLogSize & !chronicleStoreFiles.isEmpty())\n {\n File toDelete = chronicleStoreFiles.poll();\n long toDeleteLength = toDelete.length();\n if (!toDelete.delete())\n {\n logger.error(\"Failed to delete chronicle store file: {} store file size: {} bytes in store files: {}. \" +\n \"You will need to clean this up manually or reset full query logging.\",\n toDelete.getPath(), toDeleteLength, bytesInStoreFiles);\n }\n else\n {\n bytesInStoreFiles -= toDeleteLength;\n logger.info(\"Deleted chronicle store file: {} store file size: {} bytes in store files: {} max log size: {}.\",\n file.getPath(), toDeleteLength, bytesInStoreFiles, maxLogSize);\n }\n }\n }", "public void collect() {\n\t\tthis.getOwnerArea().unregisterActor(this);\n\t\t\n\t}" ]
[ "0.64879483", "0.64799714", "0.63705295", "0.601352", "0.57589006", "0.5526497", "0.5517205", "0.54808307", "0.54694784", "0.5384901", "0.53117347", "0.5304652", "0.5289047", "0.5264701", "0.52548057", "0.5217465", "0.52076995", "0.5185102", "0.51681167", "0.5158581", "0.51340353", "0.5099903", "0.508412", "0.50540453", "0.50523764", "0.5018876", "0.50115913", "0.4997022", "0.49809796", "0.49756217", "0.49615532", "0.4950613", "0.4945634", "0.49456015", "0.4926749", "0.4922612", "0.49209282", "0.4914344", "0.49093795", "0.49009234", "0.48868632", "0.48862374", "0.48778784", "0.48634666", "0.48473534", "0.48439753", "0.48298725", "0.48293683", "0.48279205", "0.4825065", "0.4817651", "0.48039547", "0.48016128", "0.4799372", "0.47982857", "0.47826955", "0.4779792", "0.4779792", "0.47782755", "0.47720915", "0.47708622", "0.47691512", "0.4759125", "0.47478282", "0.47444123", "0.47441784", "0.4740111", "0.47389397", "0.47384495", "0.47358385", "0.4732533", "0.47312412", "0.47274855", "0.472422", "0.47231033", "0.47186235", "0.47182572", "0.47165367", "0.47139663", "0.47108018", "0.47040817", "0.4701439", "0.46744415", "0.46730727", "0.4669122", "0.46642467", "0.46515784", "0.4647786", "0.4634012", "0.4628914", "0.46183264", "0.46131456", "0.46084782", "0.46045092", "0.45950302", "0.458795", "0.45869192", "0.45856708", "0.45730248", "0.45689252" ]
0.54951626
7
In general, if this method returns true for two distinct C3P0ProxyConnections, it indicates a c3p0 bug. Once a proxy Connection is close()ed, it should not permit any sort of operation. Prior to Connection close(), there should be at most one valid proxy Connection associated with a given physical Connection.
public static boolean samePhysicalConnection( C3P0ProxyConnection con1, C3P0ProxyConnection con2 ) throws SQLException { try { Object out = con1.rawConnectionOperation( IPCFP, null, new Object[] { C3P0ProxyConnection.RAW_CONNECTION, con2 } ); return ((Boolean) out).booleanValue(); } catch (Exception e) { e.printStackTrace(); throw SqlUtils.toSQLException( e ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tprotected boolean closeConnection(String connectionOwnerKey)\r\n\t\tthrows DSPException {\n\t\tif (StringUtils.isNullOrEmpty(connectionOwnerKey)\r\n\t\t\t&& DataStoreContext.isReusableDataStoreContext()) {\r\n\t\t\t// TODO: Log error - the call should not reach here\r\n\t\t\t// , the checks should have been done earlier\r\n\t\t\tSystem.out.println(\"Bug in Code, Trying to close a re-usable data store connection\");\r\n\t\t\tthrow new DSPException(new BugInCodeErrorObject(\"Bug in Code, Trying to close a re-usable data store connection\"));\r\n\t\t}\r\n\t\t\r\n\t\tif (StringUtils.isNullOrEmpty(connectionOwnerKey)) {\r\n\t\t\t// TODO: Log error - Owner key should not be null\r\n\t\t\tSystem.out.println(\"Bug in Code, Trying to close a data store connection with null/empty owner key\");\r\n\t\t\tthrow new DSPException(new BugInCodeErrorObject(\"Bug in Code, Trying to close a data store connection with null/empty owner key\"));\r\n\t\t}\r\n\t\t\r\n\t\tif (this.connectionOwnerKey.equals(connectionOwnerKey)) {\r\n\t\t\ttry {\r\n\t\t\t\tgetConnection().close();\r\n\t\t\t\tthis.connectionOwnerKey = null;\r\n\t\t\t\treturn true;\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\tSystem.out.println(\"Error closing connection : TID=\" + Thread.currentThread().getName() + \" : Exception : \" + e.getMessage());\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t\tthrow new DSPException(\"Error closing connection : TID=\" + Thread.currentThread().getName(), e);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"Bug in code: Trying to close connection by non-owner : TID=\" + Thread.currentThread().getName());\r\n\t\t\tthrow new DSPException(new BugInCodeErrorObject(\"Trying to close connection by non-owner : TID=\" + Thread.currentThread().getName()));\r\n\t\t}\r\n\t}", "protected boolean shouldCloseConnection(HttpConnection conn) {\n return true;\n }", "public boolean shouldClose(Connection conn) {\n return true;\n }", "protected boolean shouldCloseConnection(HttpConnection conn) {\n\n // if we are not chunked and there is no content length the connection\n // cannot be reused\n if (responseHeaders.getFirstHeader(\"Transfer-Encoding\") == null \n && getResponseContentLength() < 0) {\n LOG.debug(\"Should close connection as content-length is missing.\");\n return true;\n }\n\n Header connectionHeader = null;\n // In case being connected via a proxy server\n if (!conn.isTransparent()) {\n // Check for 'proxy-connection' directive\n connectionHeader = responseHeaders.getFirstHeader(\"proxy-connection\");\n }\n // In all cases Check for 'connection' directive\n // some non-complaint proxy servers send it instread of\n // expected 'proxy-connection' directive\n if (connectionHeader == null) {\n connectionHeader = responseHeaders.getFirstHeader(\"connection\");\n }\n if (connectionHeader != null) {\n if (connectionHeader.getValue().equalsIgnoreCase(\"close\")) {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"Should close connection in response to \" \n + connectionHeader.toExternalForm());\n }\n return true;\n } else if (connectionHeader.getValue().equalsIgnoreCase(\"keep-alive\")) {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"Should NOT close connection in response to \" \n + connectionHeader.toExternalForm());\n }\n return false;\n } else {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"Unknown directive: \" + connectionHeader.toExternalForm());\n }\n }\n }\n LOG.debug(\"Resorting to protocol version default close connection policy\");\n // missing or invalid connection header, do the default\n if (http11) {\n LOG.debug(\"Should NOT close connection, using HTTP/1.1.\");\n } else {\n LOG.debug(\"Should close connection, using HTTP/1.0.\");\n }\n return !http11;\n }", "public boolean connectionChange()\n {\n if(isDestroyed) throw new RuntimeException(\"pvaClientMultiChannel was destroyed\");\n for(int i=0; i<numChannel; ++i) {\n PvaClientChannel pvaClientChannel = pvaClientChannelArray[i];\n Channel channel = pvaClientChannel.getChannel();\n ConnectionState stateNow = channel.getConnectionState();\n boolean connectedNow = stateNow==ConnectionState.CONNECTED ? true : false;\n if(connectedNow!=isConnected[i]) return true;\n }\n return false;\n }", "private boolean canConnect() {\n \t\treturn (currentlyConnectingSockets.get() < maxConnectingSockets)\n \t\t\t\t&& (currentlyOpenSockets.get() < maxOpenSockets);\n \t}", "private boolean hasTooManyConnections()\n\t{\n\t\treturn (config.getMaxConnections() > -1 && \n\t\t\t\tgetNumberOfConnections() >= config.getMaxConnections());\n\t}", "public boolean closeConnection(){\n try{\n conn.close();\n }catch(SQLException sqle){\n DLException dle = new DLException(sqle, \"Unable to conclude this operation\");\n return false;\n }\n \n return true;\n }", "@Test\n\tpublic void testCloseInternalSQLConnection() throws SQLException {\n\t\tConnection connection = pool.getConnection(config.getConnectionTimeout());\n\t\tint count = pool.idleConnectionsCount();\n\t\tconnection.close();\n\t\tAssert.assertEquals(count + 1, pool.idleConnectionsCount());\n\t\tAssert.assertEquals(((ConnectionItem) connection).state().get(), ConnectionItem.STATE_NOT_IN_USE);\n\t}", "public boolean needsConnectionLeftOpen() {\n return false;\n }", "@Generated\n @Selector(\"isProxyConnection\")\n public native boolean isProxyConnection();", "@Test(timeout = 4000)\n public void test083() throws Throwable {\n jdbcConnection jdbcConnection0 = new jdbcConnection((Session) null);\n DBUtil.close((Connection) jdbcConnection0);\n assertFalse(jdbcConnection0.isClosed());\n }", "public boolean allConnected()\n {\n if(isDestroyed) throw new RuntimeException(\"pvaClientMultiChannel was destroyed\");\n return (numConnected==numChannel) ? true : false;\n }", "public abstract boolean isDataConnectionAsDesired();", "public boolean checkConnection() {\n\t\ttry {\n\t\t\tif (con.isClosed() || !isAlive) {\n\t\t\t\treturn connect();\n\t\t\t}\n\t\t\treturn true;\n\t\t} catch (SQLException e) {\n\t\t\treturn false;\n\t\t}\n\t}", "public void testTwoPCSuccess() throws Exception {\n tm.begin();\n tm.setTransactionTimeout(10); // TX must not timeout\n\n Connection connection1 = poolingDataSource1.getConnection();\n connection1.createStatement();\n\n Connection connection2 = poolingDataSource2.getConnection();\n PooledConnectionProxy handle = (PooledConnectionProxy) connection2;\n XAConnection xaConnection2 = (XAConnection) AbstractMockJdbcTest.getWrappedXAConnectionOf(handle.getPooledConnection());\n connection2.createStatement();\n\n tm.commit();\n\n }", "public synchronized void close() throws SQLException {\n\t\tif (isClosedInternal()) {\n\t\t\t// already close\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tboolean isUnderlyingConnectionClosed;\n\t\t\n\t\ttry {\n\t\t\tisUnderlyingConnectionClosed = this.getDelegateInternal().isClosed();\n\t\t} catch (SQLException e) {\n\t\t\ttry {\n\t\t\t\tpool.invalidateObject(this); // remove from pool\n\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t// probably pool is closed\n\t\t\t\tpassivateAdnClose();\n\t\t\t} catch (Exception ie) {\n\t\t\t\t// DO NOTHING, exception will be thrown\n\t\t\t}\n\t\t\tthrow new SQLException(\"Cannot close connection (isClosed throw exception\", e);\n\t\t}\n\t\t\n\t\tif (isUnderlyingConnectionClosed) {\n\t\t\t// Abnormal close: underlying connection close unexpectedly\n\t\t\t// must destroy this proxy\n\t\t\ttry {\n\t\t\t\tthis.pool.invalidateObject(this);\n\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t// probably pool is closed\n\t\t\t\tpassivateAdnClose();\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new SQLException(\"Cannot close connection (invalidate object failed)\", e);\n\t\t\t}\n\t\t} else {\n\t\t\t// Normal close: return proxy to pool\n\t\t\ttry {\n\t\t\t\tthis.pool.returnObject(this);\n\t\t\t} catch (IllegalStateException ise) {\n\t\t\t\t// probably pool is closed\n\t\t\t\tpassivateAdnClose();\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new SQLException(\"Cannot close connection (return to pool failed)\", e);\n\t\t\t}\n\t\t}\n\t}", "private boolean managingConnections() {\n\n if (configWrapper.getConfig().getConnectionInfo().getDataSource() == null) {\n return false;\n }\n\n return true;\n\n }", "@Test\n\tpublic void testConnectionsExistOnPoolCreation() {\n\t\tAssert.assertTrue(pool.totalConnections() > 0); \n\t}", "public boolean canClose(){\n return true;\n }", "@Override\r\n public boolean reconnect()\r\n {\n return state.isConnected();\r\n }", "protected boolean isConnected() {\n/* 160 */ return this.delegate.isConnected();\n/* */ }", "protected boolean close() {\n try {\n if(this.connection != null) {\n this.connection.close();\n this.connection = null;\n }\n if(this.statement != null) {\n this.statement.close();\n this.statement = null;\n }\n if(this.prepared != null) {\n this.prepared.close();\n this.prepared = null;\n }\n if(this.resultSet != null) {\n this.resultSet.close();\n this.resultSet = null;\n }\n } catch(SQLException ex) {\n Logger.getLogger(MySQLMariaDBConnector.class.getName()).log(Level.SEVERE, null, ex);\n return false;\n }\n return true;\n }", "public static boolean hasConnection() {\n \t\treturn connPool.getConnectionCount() > 0;\n \t}", "final boolean checkAlive() {\r\n\t\t\r\n\t\tif (this.conn == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tif (this.conn.isClosed()) {\r\n\t\t\t\tthis.conn = null;\r\n\t\t\t\treturn false;\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 = null;\r\n\t\t\t\treturn false;\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\treturn true;\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\tthis.conn = null;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public boolean isConnectable(){\n\t\tif((System.currentTimeMillis() - this.lastTry) > retryBackoff){\n\t\t\tthis.lastTry = System.currentTimeMillis();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "boolean isConnectionLost()\n\t{\n\t\tboolean lost = false;\n\n\t\tif (m_session != null && !m_session.isConnected())\n\t\t\tlost = true;\n\n\t\treturn lost;\n\t}", "public boolean isConnecting() {\n PublishSubscriber<T> c = state.current;\n return c.connecting && !c.connected && !c.done && !c.isDisposed();\n }", "public boolean checkConnection() {\n\treturn getBoolean(ATTR_CONNECTION, false);\n }", "public void testConnecitonFails() {\n\t\ttry {\n\t\t\t@SuppressWarnings(\"unused\")\n\t\t\tConnection c = new Connection(\"localhost\", 4444, this, this);\n\t\t\t// this connection should fail... wait for that:\n\t\t\tfor (int i=0; i<10; i++) {\n\t\t\t\t// if we have a result before our max-wait-time, break\n\t\t\t\tif (connectionStatus != null)\n\t\t\t\t\tbreak;\n\t\t\t\tThread.sleep(500);\n\t\t\t}\n\t\t\t\n\t\t\tassertTrue(connectionStatus != null && connectionStatus.booleanValue() == false);\n\t\t} catch (Exception e) {\n\t\t\tassertTrue(\"should not get an exception\", false);\n\t\t}\n\t}", "private boolean validateConnection() {\n boolean success = _vcVlsi.testConnection();\n if (!success) {\n _log.log(Level.WARNING, \"Found VC connection dropped; reconnecting\");\n return connect();\n }\n return success;\n }", "public boolean hasAtLeastOneConnector() {\n return (this.connectors.size() > 0 || this.sslConnectors.size() > 0);\n }", "public boolean isConnected()\n {\n return connectionId != GatewayProcess.NO_CONNECTION_ID;\n }", "@Override\n\tpublic boolean disconnect() {\n\t\treturn false;\n\t}", "protected synchronized boolean checkConnectivity() {\n return this.connect();\n }", "private boolean checkOpen(boolean recordException) {\n/* 650 */ if (!isOpen()) {\n/* 651 */ if (recordException) {\n/* 652 */ recordException(new ClosedChannelException());\n/* */ }\n/* 654 */ return false;\n/* */ } \n/* */ \n/* 657 */ return true;\n/* */ }", "@Override\r\n\tpublic boolean isConnected() {\n\t\treturn false;\r\n\t}", "protected abstract boolean isConnected();", "private boolean checkConnection() {\n return isConnected = ConnectionReceiver.isConnected();\n }", "private boolean checkConnection() {\n return isConnected = ConnectionReceiver.isConnected();\n }", "public boolean disconnectDB(){\n\t \n\tif (rs != null) {\n try {\n rs.close();\n } catch (SQLException e) { \n\t\t\treturn false; //???\n\t\t}\n }\n if (ps != null) {\n try {\n ps.close();\n } catch (SQLException e) {\n\t\t\treturn false; //???\n\t\t}\n }\n if (connection != null) {\n try {\n connection.close();\n } catch (SQLException e) { \n\t\t\treturn false;\n\t\t}\n }\n\n return true; \n }", "public boolean hasConnProps() {\n return connPropsBuilder_ != null || connProps_ != null;\n }", "public boolean close() {\n\t\ttry {\n\t\t\tconnection.close();\n\t\t\treturn connection.isClosed();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t}", "private static void checkConn() {\n try {\n if (conns.isClosed()) conns = Connect.getConnect();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public boolean checkConnected() {\n boolean isClosed = true;\n boolean isValid = false;\n boolean exists = (connection != null);\n\n // If we're waiting for server to recover then leave early\n if (nextReconnectTimestamp > 0 && nextReconnectTimestamp > System.nanoTime()) {\n return false;\n }\n\n if (exists) {\n try {\n isClosed = connection.isClosed();\n }\n catch (SQLException e) {\n isClosed = true;\n e.printStackTrace();\n printErrors(e);\n }\n\n if (!isClosed) {\n try {\n isValid = connection.isValid(VALID_TIMEOUT);\n }\n catch (SQLException e) {\n // Don't print stack trace because it's valid to lose idle connections to the server and have to restart them.\n isValid = false;\n }\n }\n }\n\n // Leave if all ok\n if (exists && !isClosed && isValid) {\n // Housekeeping\n nextReconnectTimestamp = 0;\n reconnectAttempt = 0;\n return true;\n }\n\n // Cleanup after ourselves for GC and MySQL's sake\n if (exists && !isClosed) {\n try {\n connection.close();\n }\n catch (SQLException ex) {\n // This is a housekeeping exercise, ignore errors\n }\n }\n\n // Try to connect again\n connect();\n\n // Leave if connection is good\n try {\n if (connection != null && !connection.isClosed()) {\n // Schedule a database save if we really had an outage\n if (reconnectAttempt > 1) {\n new SQLReconnectTask().runTaskLater(Assassin.p, 5);\n }\n nextReconnectTimestamp = 0;\n reconnectAttempt = 0;\n return true;\n }\n }\n catch (SQLException e) {\n // Failed to check isClosed, so presume connection is bad and attempt later\n e.printStackTrace();\n printErrors(e);\n }\n\n reconnectAttempt++;\n nextReconnectTimestamp = (long) (System.nanoTime() + Math.min(MAX_WAIT, (reconnectAttempt * SCALING_FACTOR * MIN_WAIT)));\n return false;\n }", "protected synchronized boolean isSockOpen(){\n\t\ttry{\n\t\t\tif(out.checkError()){\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\treturn true;\n\t}", "@Override\n\tpublic boolean isSourceReconnectable(final ConnectionWidget connectionWidget)\n\t{\n\t\treturn false;\n\t}", "boolean hasDisconnect();", "public boolean isConnectionOpen() throws SQLException{\r\n return connection != null && !connection.isClosed();\r\n }", "private boolean isConnect(ConnectionSpec connectionSpec) {\r\n\t\tif (connectionSpec == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tJRedis jredis = new JRedisClient(connectionSpec.getAddress().getHostAddress(), connectionSpec.getPort());\r\n\t\ttry {\r\n\t\t\tjredis.ping();\r\n\t\t\tjredis.quit();\r\n\t\t} catch (Exception e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public boolean disconnect(){\n \n try{\n \n if(this.connection.isClosed() == false){\n this.connection.close();\n }\n \n }catch(SQLException e){\n \n System.out.println(e.getMessage());\n return false;\n }\n \n System.out.println(\"Disconnection success\");\n \n return true;\n }", "@Override\n\tpublic boolean isConnected() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isConnected() {\n\t\treturn false;\n\t}", "public boolean disconnect() {\n\t\ttry {\n\t\t\tthis.m.close();\n\t\t} catch (Exception e) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public boolean close() {\n BleMultiConnector bleMultiConnector = this.bleMultiConnector;\n this.bleMultiConnector = null;\n boolean result = bleMultiConnector != null && bleMultiConnector.close(address);\n if (result){\n address = null;\n }\n return result;\n }", "public boolean isConnected() {\r\n\t\treturn backend != null;\r\n\t}", "void checkClosed() throws SQLException {\n\n if (result == null) { throw Message.getSQLException(ErrorCode.OBJECT_CLOSED); }\n if (stat != null) {\n stat.checkClosed();\n }\n if (conn != null) {\n conn.checkClosed();\n }\n }", "public boolean isConnecting ()\r\n\t{\r\n\t\tsynchronized (this)\r\n\t\t{\r\n\t\t\treturn _roboCOM!=null;\r\n\t\t}\r\n\t}", "public boolean hasConnProps() {\n return connProps_ != null;\n }", "public boolean isKeepAlive()\r\n/* 147: */ {\r\n/* 148: */ try\r\n/* 149: */ {\r\n/* 150:167 */ return this.javaSocket.getKeepAlive();\r\n/* 151: */ }\r\n/* 152: */ catch (SocketException e)\r\n/* 153: */ {\r\n/* 154:169 */ throw new ChannelException(e);\r\n/* 155: */ }\r\n/* 156: */ }", "@Override\n\tprotected boolean handleDisconnect(Connection conn) {\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean close() throws SQLException {\n\t\treturn false;\n\t}", "public boolean closeClientConnections(IngresVectorwiseLoaderData data){ Close the output streams if still needed.\n //\n try {\n if (data.fifoStream!=null) {\n data.fifoStream.close();\n }\n \n // Stop the SQL execution thread\n //\n if (data.sqlRunner!= null) {\n data.sqlRunner.join();\n data.sqlRunner = null;\n }\n \n if(data.sqlProcess != null){\n data.sqlProcess.waitFor();\n }\n \n // remove the fifo file...\n //\n try {\n if (data.fifoFilename!=null) {\n new File(data.fifoFilename).delete();\n }\n } catch(Exception e) {\n logError(\"Unable to delete FIFO file : \"+data.fifoFilename, e);\n }\n }\n catch(Exception e) {\n setErrors(1L);\n logError(\"Unexpected error encountered while closing the client connection\", e);\n return false;\n }\n return true;\n }", "@Test\n\tpublic void testReleaseConnection() throws SQLException {\n\t\tConnection connection = pool.getConnection(config.getConnectionTimeout());\n\t\tint count = pool.idleConnectionsCount();\n\t\tpool.releaseConnection(connection);\n\t\tAssert.assertEquals(count + 1, pool.idleConnectionsCount());\n\t\tAssert.assertEquals(((ConnectionItem) connection).state().get(), ConnectionItem.STATE_NOT_IN_USE);\n\t}", "public boolean percolates() throws Exception {\n if (SIZE != 1 && ufVirtual.connected(0, SIZE - 1))\n return true;\n else if (SIZE == 1 && isOpen(1, 1))\n return true;\n return false;\n }", "@Override\n\tpublic boolean canConnect() {\n return false;\n }", "public boolean testConnection(){\n\t\tboolean connected = false;\n\t\ttry {\t\t\t\n\t\t\tmMysqlConnection = DriverManager\n\t\t\t\t.getConnection(getConnectionURI());\n\t\t\t\n\t\t\tconnected = true;\n\t\t} catch (SQLException e) {\n\t\t\tLOGGER.severe(\"!EXCEPTION: \" + e.getMessage());\n\t\t}\n\n\t\treturn connected;\n\t}", "boolean hasConnProps();", "protected abstract boolean sharedConnectionEnabled();", "@WebMethod(operationName = \"CheckConnection\")\n public boolean CheckConnection() {\n return true;\n }", "public boolean connectionAlive() throws RemoteException;", "public boolean isKeepAlive(){\n if(contains(\"Connection\")) {\n return !contains(\"Connection\", \"close\");\n } else if(getMajor() > 1) {\n return true; \n } else if(getMajor() == 1) {\n return getMinor() > 0;\n }\n return false;\n }", "@Override\n protected boolean closeLast() {\n if (!super.closeLast()) {\n return false;\n }\n\n // close the corresponding session object.\n // NOTE:\n // because the Session.close() method eventually call this method\n // indirectly after setting the session's open flag to false.\n // So call Session.close() ONLY if the session is open to avoid\n // recursion.\n Session session = getQLEditorSupport().getSession();\n if (session.isOpen()) {\n try {\n session.close();\n } catch (ConnectionException ex) {\n\n // TODO: handle exception\n Exceptions.printStackTrace(ex);\n }\n }\n\n return true;\n }", "private void ensureConnectionRelease() {\n if (responseConnection != null) {\n responseConnection.releaseConnection();\n responseConnection = null;\n }\n }", "public boolean safeToClose(){\n if(hashMapOfAllAccts.isEmpty()){\n return true;\n }\n return false;\n }", "@Override\n public boolean isValid() {\n return (connection != null && session != null && session.isOpen());\n }", "public boolean isNativeConnectionNecessaryForNativeCallableStatements()\r\n/* 26: */ {\r\n/* 27: 79 */ return false;\r\n/* 28: */ }", "public boolean testConnection()\r\n { \r\n try {\r\n myConn = DriverManager.getConnection(getconn + \"?user=\" + user + \"&password=\" + pass);\r\n //Connection successfully connected check sourced from Stack Overflow\r\n //Source: https://stackoverflow.com/questions/7764671/java-jdbc-connection-status\r\n if (!myConn.isClosed() || myConn != null)\r\n return true;\r\n return false;\r\n //End borrowed code\r\n } catch (SQLException ex) {\r\n ex.printStackTrace();\r\n //Logger.getLogger(SQLConnector.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return false;\r\n }", "public void ensureOpen() throws JSchException {\n for ( TunnelConnection tunnelConnection : tunnelConnections ) {\n if ( !tunnelConnection.isOpen() ) {\n tunnelConnection.reopen();\n }\n }\n }", "public boolean percolates() {\n return mainObject.connected(vsite1, vsite2);\n }", "@Override\n\tpublic boolean autoCommitFailureClosesAllResultSets() throws SQLException {\n\t\treturn false;\n\t}", "public boolean validate_connection() {\n throw new NO_IMPLEMENT(reason);\n }", "void shouldUseSocksProxyInSecondPage() {\n }", "void shouldUseSocksProxy() {\n }", "@Override\n\tpublic boolean connect() {\n\t\treturn false;\n\t}", "public boolean endConnection() throws CommunicationException;", "private void checkProxyClasses() throws SQLException {\r\n try {\r\n boolean classInitialize = false;\r\n ClassLoader classLoader = getClass().getClassLoader();\r\n Class.forName(\"cn.beecp.pool.Borrower\", classInitialize, classLoader);\r\n Class.forName(\"cn.beecp.pool.PooledConnection\", classInitialize, classLoader);\r\n Class.forName(\"cn.beecp.pool.ProxyConnection\", classInitialize, classLoader);\r\n Class.forName(\"cn.beecp.pool.ProxyStatement\", classInitialize, classLoader);\r\n Class.forName(\"cn.beecp.pool.ProxyPsStatement\", classInitialize, classLoader);\r\n Class.forName(\"cn.beecp.pool.ProxyCsStatement\", classInitialize, classLoader);\r\n Class.forName(\"cn.beecp.pool.ProxyDatabaseMetaData\", classInitialize, classLoader);\r\n Class.forName(\"cn.beecp.pool.ProxyResultSet\", classInitialize, classLoader);\r\n } catch (ClassNotFoundException e) {\r\n throw new SQLException(\"Jdbc proxy classes missed\", e);\r\n }\r\n }", "public boolean disconnectDB() {\n\t\ttry {\n\t\t\t\trs.close();\n\t\t\t\tps.close();\n\t\t\t\tconnection.close();\n\t\t\t// System.out.println(\"closed\");\n\t\t\treturn true;\n\t\t} catch (SQLException se) {\n\n\t\t}\n\t\treturn false;\n\t}", "public boolean isConnected() {\n\t\tif (m == null) return false;\n\t\telse return true;\n\t}", "@Override\n\tpublic boolean isPoolable()\n\t\tthrows SQLException {\n return false;\n }", "public boolean updateDatabaseConnections() {\n WorkspaceConfig workspace = mvc.model.getWorkspace();\n if (workspace != null && workspace.database != null) {\n DatabaseConfig config = workspace.database;\n try {\n mvc.controller.database.refreshConnections(config, 10);\n return true;\n } catch (SQLException e) {\n // falls through to return false\n }\n }\n mvc.controller.database.closeConnections();\n return false;\n }", "@Override\r\n\tpublic boolean isPoolable() throws SQLException {\n\t\treturn false;\r\n\t}", "@Override\r\n\tpublic boolean isPoolable() throws SQLException {\n\t\treturn false;\r\n\t}", "@Override\n public synchronized void close() {\n mOpenConnections--;\n if (mOpenConnections == 0) {\n super.close();\n }\n }", "@Override\n public synchronized void close() {\n mOpenConnections--;\n if (mOpenConnections == 0) {\n super.close();\n }\n }", "public boolean willNotBeResurrected() {\n return state == State.FRESH || state == State.ERROR;\n }", "private void closeConnections() {\r\n for (Iterator<Connection> it = connections.values().iterator(); it.hasNext();) {\r\n TransConnection conn = (TransConnection) it.next();\r\n try {\r\n conn.setCloseAllowed(true);\r\n conn.close();\r\n } catch (SQLException ex) {\r\n log.severe(\"Connection close failure: \" + ex.getMessage());\r\n }\r\n }\r\n connections.clear();\r\n }", "public boolean isConnected() {\n\t\treturn conn != null;\n\t}", "@Override\n\tpublic boolean isPoolable() throws SQLException {\n\t\treturn false;\n\t}", "private boolean disconnect() {\r\n\r\n try {\r\n\r\n if (mFolder.isOpen()) {\r\n mFolder.close(true);\r\n }\r\n\r\n mStore.close();\r\n // Disconnect from POP3 server succeeded!\r\n return true;\r\n }\r\n catch (Exception e) {\r\n // Unknown error when disconnecting from POP3 server\r\n return false;\r\n }\r\n\r\n }" ]
[ "0.63613087", "0.62061375", "0.61008835", "0.5948042", "0.580913", "0.57645553", "0.57408905", "0.57209593", "0.5692303", "0.5639969", "0.5633724", "0.56161267", "0.55101156", "0.54751706", "0.54663247", "0.5464868", "0.54535824", "0.5442075", "0.5440176", "0.542596", "0.5424315", "0.54073757", "0.53979903", "0.5394332", "0.5372504", "0.53700274", "0.5369733", "0.5362225", "0.5351831", "0.5348164", "0.53409433", "0.5335642", "0.5332693", "0.5325815", "0.5317714", "0.53153116", "0.5315139", "0.5295895", "0.52771056", "0.52771056", "0.52637", "0.52613306", "0.5260533", "0.52585214", "0.52576214", "0.52461606", "0.52451783", "0.5233806", "0.52312195", "0.5224623", "0.5224037", "0.5220665", "0.5220665", "0.52010375", "0.5182613", "0.51646805", "0.5161158", "0.51598394", "0.51515466", "0.51514626", "0.51386607", "0.5130037", "0.51270086", "0.5123726", "0.51205456", "0.51152414", "0.5114234", "0.51107514", "0.51071084", "0.50997466", "0.50930434", "0.5087942", "0.50752336", "0.50732386", "0.5057358", "0.5052501", "0.5051441", "0.50512433", "0.50360805", "0.50322235", "0.50269556", "0.50231314", "0.5022809", "0.50182116", "0.50132746", "0.50087434", "0.5006773", "0.5005782", "0.49979004", "0.49976474", "0.49974057", "0.49965063", "0.49965063", "0.49940765", "0.49940765", "0.4992835", "0.4981873", "0.498083", "0.4972663", "0.4970134" ]
0.63558125
1
TODO: Delete item from list
@Override public void onClick(View v) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void deleteItem() {\n\t\taPList.remove();\r\n\t}", "public void deleteItem(ActionEvent actionEvent) {\n // find the list that the item belongs in\n // removeItem() from its parenting list\n }", "@Override\n\tpublic void deleteItem(Object toDelete) {}", "@Override\n\t\tpublic void deleteItem(int index) {\n\t\t\tmGuanzhuList.remove(index);\n\t\t}", "void delete(int index) throws ListException;", "protected abstract void removeItem();", "public boolean deleteItem(int index);", "@Override\r\n\t\tpublic boolean deleteItem() {\n\t\t\treturn false;\r\n\t\t}", "@Override\n public void deleteItem(P_CK t) {\n \n }", "public void removeItem(int id);", "public void delete(MainItemOrdered mainItemOrdered);", "@FXML\r\n\tpublic void deleteItem() {\r\n\t\tcontroller.deleteWishlistItem(listView.getSelectionModel().getSelectedItem().getId());\r\n\t\tlistView.setItems(controller.getWishlistWatchesForCurrentUser());\r\n\t\tlistView.getSelectionModel().select(-1);\r\n\t}", "public void deleteItem(ToDoList item) {\n SQLiteDatabase db = this.getWritableDatabase();\n db.delete(TABLE_NAME, KEY_ID + \" = ?\",\n new String[]{String.valueOf(item.getId())});\n db.close();\n }", "public void remove()\r\n { Exceptions.unmodifiable(\"list\"); }", "protected void deleteItem(Emotion emotion,ArrayList<Emotion> list){\n// Iterates through the arraylist and tries to match the object date. Once a match is found, the item is removed.\n for (int i=0; i<list.size();i++){\n Emotion object = list.get(i);\n if (object.getDate().equals(emotion.getDate())){\n list.remove(i);\n }\n }\n }", "void deleteItem(IDAOSession session, int id);", "public void deleteItem(int index) {\n this.items.remove(index);\n }", "public void removeItem(){\n\t\tthis.item = null;\n\t}", "public void deleteTodoItem(TodoItem item) {\n todoItems.remove(item);\n }", "private void delete() {\n\t\tfor (int i = 0; i < list.size(); i++) {\r\n\t\t\tif (list.get(i).toString().equals(lu.toString())) {\r\n\t\t\t\tlist.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tll.makeXml(list);\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tinitTableView();\r\n\t}", "public void deleteItem(String nomItem) {\r\n \t\titems.removeItem(nomItem);\r\n \t}", "private void deleteItem(Item item) {\n updateItemInStoreList(item, DELETE_ITEM_OP);\n itemListViewModel.setList(storeList);\n }", "public DoublyLinkedListHeader deleteObj(DoublyLinkedListHeader list) {\r\n\t\tSystem.out.println(\"Enter an index!\");\r\n\t\tint index = scanInt();\r\n\t\tDNode temp= list.delete(index);\r\n\t\tif(temp == null) {\r\n\t\t\tSystem.out.println(\"Invalid Index! The list is not modified\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"The list has been modified!\");\r\n\t\t}\r\n\t\treturn list;\r\n\t}", "private void deleteItem()\n {\n System.out.println(\"Delete item with the ID: \");\n\n BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));\n try {\n Long id = Long.valueOf(bufferRead.readLine());\n ctrl.deleteItem(id);\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n\n }", "private void deleteItem(int position){\n deleteItem(dataset.get(position),position);\n }", "public void onDeleteList() {\n ListsManager listManager = ListsManager.getInstance(context);\n listManager.deleteTable(deletePosition,context);\n Toast.makeText(context, \"deleted TodoList\", Toast.LENGTH_SHORT).show();\n data.remove(deletePosition);\n notifyItemRemoved(deletePosition);\n }", "void onItemDeleted();", "void onItemDelete(int position);", "public void deleteItem() {\n\t\tIntent intent = new Intent(this, AlarmActivity.class);\n\t\tint alarmId = itemsAdapter.getSelectedItem().getId();\n\t\tLog.d(TAG, \"Cancelling Alarm with ID \" + alarmId); \n\t\tPendingIntent sender = PendingIntent.getBroadcast(this, alarmId, intent, 0);\n\t\tAlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);\n\t\talarmManager.cancel(sender);\n\t\t\n\t\titemsAdapter.remove(itemsAdapter.getSelectedPosition());\n\t\titemsAdapter.unsetSelectedPosition();\n\t\tgetActionBar().hide();\n\t}", "public void deleteItem(MySmsMessage item){\n if(dataset.contains(item)){\n int pos=dataset.indexOf(item);\n dataset.remove(pos);\n notifyItemRemoved(pos);\n }\n }", "public void removeItem() {\n if (this.size() == 0) {\n System.out.println(\"Empty List.\");\n return;\n }\n this.print();\n String code;\n System.out.println(\"Enter the code of removed item: \");\n code = sc.nextLine().toUpperCase();\n int pos = find(code);\n if (pos < 0) {\n System.out.println(\"This code does not exist.\");\n } else {\n this.remove(pos);\n System.out.println(\"The item \" + code + \" has been removed.\");\n\n }\n }", "void delete()\n\t{\n\t\tif (length == 0) \n\t\t{\n\t\t\tthrow new RuntimeException(\"List Error: cannot call delete() on empty List\");\n\t\t}\n\t\tif (cursor == null) \n\t\t{\n\t\t\tthrow new RuntimeException(\"List Error: cannot call delete() on cursor that is off the list\");\n\t\t}\n\t\tif (cursor == front) \n\t\t{\n\t\t\tdeleteFront(); //deletes the front if the cursor is at the front\n\n\t\t}\n\t\telse if(cursor == back)\n\t\t{\n\t\t\tdeleteBack(); //deletes the back if the cursor is at the back\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcursor.prev.next=cursor.next; \n\t\t\tcursor.next.prev=cursor.prev;\n\t\t\tcursor = null; \n\t\t\tindex = -1;\n\t\t\tlength--;\n\t\t}\n\t\t\n\t}", "public void deleteItem(String string) {\n itemArrayList.remove(string);\n saveArrayList(itemArrayList, \"itemArrayList\");\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\tItemType i = getSelectedItem();\n\t\t\t\tif(i != null)\n\t\t\t\t{\t\n\n\t\t\t\t\tfinal String msg = \"Delete \"+i.getName() + \"?\";\n\t\t\t\t\tif(!confirmDelete(msg))\n\t\t\t\t\t\treturn;\n\t\t\t\t\ti.removeContainer(GeneralItemList.this);\n\t\t\t\t\ti.destroy();\n\t\t\t\t}\n\t\t\t\titems.remove(i);\n\t\t\t\tlist.clearSelection();\n\t\t\t\tlist.repaint(100);\t\t\t\t\n\t\t\t}", "@Override\n public void onClick(View view) {\n long result = typeBookDAO.deleteTypeBook(typeBook.id);\n\n if (result < 0) {\n\n Toast.makeText(context,\"Xoa ko thanh cong!!!\",Toast.LENGTH_SHORT).show();\n\n } else {\n Toast.makeText(context,\"Xoa thanh cong!!!\",Toast.LENGTH_SHORT).show();\n // xoa typebook trong arraylist\n arrayList.remove(position);\n\n // f5 adapter\n notifyDataSetChanged();\n\n }\n\n\n\n }", "@Test\n public void deleteByIndex(){\n List <Integer> list = new ArrayList<>();\n list.add(1);\n list.add(2);\n list.add(3);\n list.add(4);\n list.add(5);\n assertEquals(1,(int)list.get(0));\n\n list.remove(0);\n assertEquals(2,(int)list.get(0));\n }", "@FXML\n public void removeListItem(ActionEvent event) throws IOException {\n int removeItemIndex = unseenPacketList.getSelectionModel().getSelectedIndex();\n if (removeItemIndex < 0) {\n \tJOptionPane.showMessageDialog(null, \"Cannot remove from already empty list.\");\n } else {\n \tUpdateHandler.getAllPacketsList().remove(removeItemIndex);\n unseenPacketList.getItems().remove(removeItemIndex);\n UpdateHandler.getUnseenPacketListIndex().remove(removeItemIndex);\n }\n \n }", "public void deleteItem(LibraryItem item){\r\n\t\tif(this.inverntory.empty())\r\n\t\t\tthrow new RuntimeException(\"Inventory is empty.\");\r\n\t\t// as long as the list is not empty\r\n\t\twhile(!this.inverntory.endpos()){\r\n\t\t\t// check if current head of list is item you want deleted\r\n\t\t\tif(this.inverntory.elem() == item){\r\n\t\t\t\t// if it is, then delete item and report deletion\r\n\t\t\t\tthis.inverntory.delete();\r\n\t\t\t\tSystem.out.println(item+\" removed from inventory.\");\r\n\t\t\t}\r\n\t\t\t// if it is not head of list, advance in list\r\n\t\t\telse{\r\n\t\t\t\tthis.inverntory.advance();\r\n\t\t\t}\r\n\t\t// do so until you reach end of list/inventory\r\n\t\t}\r\n\t}", "public void hapusItem(Item objItem) {\n arrItem.remove(objItem); //buang item\n }", "@Override\n public void delete(ArrayList<League> leagues) {\n\n }", "@After(value = \"@deleteList\", order = 1)\n public void deleteList() {\n String listId = context.getDataCollection((\"list\")).get(\"id\");\n context.setRequestSpec(AuthenticationUtils.getLoggedReqSpec());\n given(context.getRequestSpecification()).when().delete(\"/lists/\".concat(listId));\n }", "void removeList(ShoppingList _ShoppingList);", "private void deleteitem() {\n if (mCurrentItemInfoUri != null) {\n DialogInterface.OnClickListener yesButtonClickListener =\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n mProgressbarView.setVisibility(View.VISIBLE);\n ContentValues values = null;\n new updateDeleteItemToDbTask().execute(values);\n }\n };\n // Show dialog that there are unsaved changes\n showConfirmationDeleteDialog(yesButtonClickListener);\n }\n }", "private void deleteItemFromList(View v, final int position) {\n\n AlertDialog.Builder builder = new AlertDialog.Builder(v.getContext());\n\n //builder.setTitle(\"Dlete \");\n builder.setMessage(\"Delete Item ?\")\n .setCancelable(false)\n .setPositiveButton(\"CONFIRM\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n\n exercise_list.remove(position);\n notifyDataSetChanged();\n\n }\n })\n .setNegativeButton(\"CANCEL\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n\n\n }\n });\n\n builder.show();\n\n }", "public void deleteReminderItem(int position){\n reminderItems.remove(position);\n recyclerAdapter.notifyDataSetChanged();\n }", "int deleteElement(int list, int node) {\n\t\tint prev = getPrev(node);\n\t\tint next = getNext(node);\n\t\tif (prev != nullNode())\n\t\t\tsetNext_(prev, next);\n\t\telse\n\t\t\tm_lists.setField(list, 0, next);// change head\n\t\tif (next != nullNode())\n\t\t\tsetPrev_(next, prev);\n\t\telse\n\t\t\tm_lists.setField(list, 1, prev);// change tail\n\n\t\tfreeNode_(node);\n\t\tsetListSize_(list, getListSize(list) - 1);\n\t\treturn next;\n\t}", "public void remove(ItemData data) {\n int position = list.indexOf(data);\n list.remove(position);\n notifyItemRemoved(position);\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n mAdapter.notifyItemRemoved(position); //item removed from recylcerview\n mAdapter.removeItem(position);\n dataList.remove(position); //then remove item\n mAdapter.notifyDataSetChanged();\n deleteEntry(dataList.get(position).getDocId());\n }", "@Override\n public void delete(int position) {\n Upload selectItem=uploadList.get(position);\n\n //get for selected item key\n final String key=selectItem.getKey();\n\n StorageReference storageReference=firebaseStorage.getReferenceFromUrl(selectItem.getImageUri());\n storageReference.delete().addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n databaseReference.child(key).removeValue();\n }\n });\n }", "@Override\n public void onDeleteClick(PrescriptionPost prescriptionPost, int position) {\n String id = adapter.getItemAt(position).getId();\n Log.d(\"ID\",\"Id is \"+id);\n Call<Void> call1= jsonPlaceholderApi.deletePrescription(id,\"Bearer \"+token);\n call1.enqueue(new Callback<Void>() {\n @Override\n public void onResponse(Call<Void> call, Response<Void> response) {\n\n mlistview.remove(position);\n adapter.notifyItemRemoved(position);\n //Log.d(\"body\",response.body().toString());\n }\n\n @Override\n public void onFailure(Call<Void> call, Throwable t) {\n Toast.makeText(getContext(), t.getMessage(), Toast.LENGTH_SHORT).show();\n }\n });\n\n }", "@Override\n\t\t\tpublic boolean onActionItemClicked(ActionMode mode, MenuItem item) {\n\t\t\n\t\t\t\t \n\t\t\t\tswitch (item.getItemId()) {\n\t\t\t\tcase R.id.delete:\n\t\t\t\t\t\n\t\t\t\t\tfor(messagewrapper obje:dummyList){\n\t\t\t\t\t\t\n\t\t\t\t\t\tmAdapter.remove(obje);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tcheckedCount=0;\n\t\t\t\t\t\n\t\t\t\t\tmode.finish();\n\t\t\t\t\treturn true;\n\t\t\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "protected void removeItemFromList(final int position) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(getString(R.string.str_title_delete_dialog));\n builder.setMessage(getString(R.string.str_delete_safezone))\n .setPositiveButton(getString(R.string.fire_yes), new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n //Toast.makeText(getActivity(), \"delete device \" + deletePosition, Toast.LENGTH_SHORT).show();\n //Device.deleteDevice(deviceList.get(deletePosition).deviceID);\n Safezone.delete(safezoneArrayList.get(position).get_id());\n }\n })\n .setNegativeButton(getString(R.string.fire_no), new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n }\n });\n // Create the AlertDialog object and return it\n builder.show();\n }", "private void deleteItem(){\n //Only perform the delete if this is an existing item.\n if(mCurrentItemUri != null){\n //Call the ContentResolver to delete the item at the given content URI.\n //Pass in null for the selection and selection args because the mCurrentItemUri\n //content URI already identifies the item that we want.\n int rowsDeleted = getContentResolver().delete(mCurrentItemUri, null, null);\n\n //Show a toast message depending on weather 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, \"Error with deleting item\",\n Toast.LENGTH_SHORT).show();\n }else {\n //Otherwise, the delete was successful and we can display a toast\n Toast.makeText(this, \"Item deleted\",\n Toast.LENGTH_LONG).show();\n }\n }\n //Close the activity\n finish();\n }", "public void deleteItem() {\n\t\t\tAsyncCallback<BmUpdateResult> callback = new AsyncCallback<BmUpdateResult>() {\n\t\t\t\t@Override\n\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\tstopLoading();\n\t\t\t\t\tshowErrorMessage(this.getClass().getName() + \"-deleteItem(): ERROR \" + caught.toString());\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onSuccess(BmUpdateResult result) {\n\t\t\t\t\tstopLoading();\n\t\t\t\t\tprocessItemDelete(result);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Llamada al servicio RPC\n\t\t\ttry {\n\t\t\t\tif (!isLoading()) {\n\t\t\t\t\tstartLoading();\n\t\t\t\t\tgetUiParams().getBmObjectServiceAsync().delete(bmoRequisitionItem.getPmClass(), bmoRequisitionItem, callback);\n\t\t\t\t}\n\t\t\t} catch (SFException e) {\n\t\t\t\tstopLoading();\n\t\t\t\tshowErrorMessage(this.getClass().getName() + \"-deleteItem(): ERROR \" + e.toString());\n\t\t\t}\n\t\t}", "@Override\n\tpublic Item delete() {\n\t\treadAll();\n\t\tLOGGER.info(\"\\n\");\n\t\t//user can select either to delete a customer from system with either their id or name\n\t\tLOGGER.info(\"Do you want to delete record by Item ID\");\n\t\tlong id = util.getLong();\n\t\titemDAO.deleteById(id);\n\t\t\t\t\n\t\t\t\t\n\t\treturn null;\n\t}", "public void removeItem() {\r\n\t\tlog.info(\"Remove item\");\r\n\t\tsu.waitElementClickableAndClick(LocatorType.Xpath, CartSplitViewField.Remove.getName());\r\n\t}", "private void removeItemFromList(int position) {\n final int index = position;\n AlertDialog.Builder alert = new AlertDialog.Builder(\n AddMedicationActivity.this);\n \n alert.setTitle(\"Delete\");\n alert.setMessage(\"Do you want delete this item?\");\n alert.setNegativeButton(\"YES\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n // TOD O Auto-generated method stub\n \n // main code on after clicking yes\n //list.remove(deletePosition);\n //adapter.notifyDataSetChanged();\n //adapter.notifyDataSetInvalidated();\n \t\tif (index == 9) \n \t\t\tcurrentConflictions[9] = \" \";\n \t\telse {\n \t\t\tfor (int a = index + 1; a <= 9; a++)\n {\n \t\t\t\tcurrentConflictions[a-1] = currentConflictions[a];\n }\n \t\t\tcurrentConflictions[9] = \" \";\n \t\t}\n \n \n conCount--;\n setCon();\n \n \n }\n });\n alert.setPositiveButton(\"CANCEL\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n // TODO Auto-generated method stub\n dialog.dismiss();\n }\n });\n \n alert.show();\n \n }", "@FXML\n public void handleDeleteButton(ActionEvent event) {\n if (cList.getItems().size() == 0) {\n alert(\"Error\", \"Invalid selection.\", \"The list is already empty.\");\n return;\n }\n\n String s = (String) cList.getSelectionModel().getSelectedItem();\n\n if (cList.getSelectionModel().getSelectedIndex() == -1) {\n alert(\"Error\", \"Invalid selection.\", \"Please select an item to delete.\");\n return;\n }\n\n String parts[] = s.split(\"=\");\n Tag delete = null;\n for (Tag t : tags) {\n if (t.getType().equals(parts[0]) && t.getValue().equals(parts[1])) {\n obsList.remove(s);\n }\n }\n tags.remove(delete);\n cList.setItems(obsList);\n\n\n }", "public Object removeItem (String key);", "public void delete(T ob) throws ToDoListException;", "public void deleteTDList(ActionEvent actionEvent) {\n // find the tdlist being referenced by the button,\n // removeList() from it's parenting group\n }", "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\r\n\tpublic void deleteWishList(int wishNo) throws Exception {\n\r\n\t}", "public void removeItem(int idx)\n\t{\n\t\titemList.remove(idx);\n\t\t\n\t}", "void notifyListItemRemoved(int position);", "private DefaultListModel<String> removeItem(JList<String> list, DefaultListModel<String> listModel) {\r\n\t\tint[] selectedItems = list.getSelectedIndices();\r\n\t\tfor(int i=selectedItems.length; i>0; i--)\r\n\t\t\tlistModel.removeElementAt(selectedItems[i-1]);\r\n\t\treturn listModel;\r\n\t}", "public void deleteSelection() {\n deleteFurniture(Home.getFurnitureSubList(this.home.getSelectedItems())); \n }", "public void excluirItem(Cerveja cerveja){\r\n\t\tint indice = IntStream.range(0, itens.size())\r\n\t\t\t\t.filter(i -> itens.get(i).getCerveja().equals(cerveja)) \r\n\t\t .findAny().getAsInt(); // getAsInt forca o retornar o valor do indice\r\n\t\t\r\n\t\t// remove o item da lista, pelo indice do item passado como parametro\r\n\t\titens.remove(indice);\r\n\t}", "public void deleteListObject(List<Student> list1)\r\n\t{\r\n\t\tlist1.remove(s2);\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"after removing\");\r\n\t\tfor(Student s:list1)\r\n\t\t{\r\n\t\t\tSystem.out.println(s);\r\n\t\t}\r\n\t}", "@Override\n public void deleteItem(int position) {\n GlobalValue.arrMyMenuShop.remove(position);\n shopAdapter.notifyDataSetChanged();\n }", "public void remove()\n {\n list.remove(cursor);\n cursor--;\n }", "@Override\n\t\tpublic void deleteItem(int index) {\n\t\t\tmFiles.remove(index);\n\t\t}", "public T delete(T item) \r\n {\r\n \tint code = item.hashCode(); // The hash code for the item\r\n \t\r\n \t// If the hashcode is negative\r\n \tif(code < 0)\r\n \t{\r\n \t\tcode = -code;\r\n \t}\r\n \t\r\n \tcode = code % size;\r\n \t\r\n \tif(hashTable[code].contains(item))\r\n \t{\r\n \t\tT temp = hashTable[code].get(hashTable[code].indexOf(item));\r\n \t\thashTable[code].remove(hashTable[code].indexOf(item));\r\n \t\tnumItems--;\r\n \t\treturn temp;\r\n \t}\r\n \telse\r\n \t{\r\n \t\treturn null;\r\n \t}\r\n }", "public void deleteItem(int position) {\n Expense expense = expenses.get(position);\n expense.deleteInBackground();\n \n }", "int deleteByExample(HpItemParamItemExample example);", "public void deleteItem() {\n\t\tMobileElement el = driver.findElement(By.xpath(\"//android.view.View[@resource-id='\" + deleteButton + \"']\"));\n\t\tel.findElementByClassName(\"android.widget.Button\").click();\n\t\ttry {\n\t\t\tThread.sleep(2000);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void delTask(ArrayList<Task> taskList) {\n // String response; // String variable for the user's input\n String prompt = \"delete\"; // initializing the type of prompt to the user\n int index = promptIndex(taskList, prompt); // prompting, receiving, and error checking the user's input\n if (index != -1) { // if there was not an invalid index value\n taskList.remove(index); // remove the element at this index\n }\n System.out.print(\"\\n\"); // printing a newline for formatting \n pause(); // pausing the screen\n }", "private void deleteItem() {\n // Only perform the delete if this is an existing inventory item\n if (mCurrentInventoryUri != null) {\n // Call the ContentResolver to delete the inventory item at the given content URI.\n // Pass in null for the selection and selection args because the mCurrentInventoryUri\n // content URI already identifies the inventory item that we want.\n int rowsDeleted = getContentResolver().delete(mCurrentInventoryUri, 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_inventory_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_inventory_successful),\n Toast.LENGTH_SHORT).show();\n }\n }\n\n // Close the activity\n finish();\n }", "public void deletelist(){\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:- current list should be deleted\");\r\n\t\ttry{\r\n\r\n\t\t\twaitForElement(locator_split(\"lnkdeletelist\"));\r\n\t\t\tclick(locator_split(\"lnkdeletelist\"));\r\n\r\n\t\t\tThread.sleep(3000);\r\n\t\t\twaitForElement(locator_split(\"btnconfirmdeletelist\"));\r\n\t\t\tclick(locator_split(\"btnconfirmdeletelist\"));\r\n\r\n\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- list is deleted\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- list is not deleted \"+elementProperties.getProperty(\"lnkdeletelist\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"lnkdeletelist\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\t\r\n\r\n\r\n\t}", "private void deleteShoppingList() {\n //Dialog to confirm delete\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n builder.setTitle(getResources().getString(R.string.dialog_title))\n .setMessage(getResources().getString(R.string.dialog_message))\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n //Se elimina la lista de la compra\n shoppingLists.remove(position);\n\n //update user\n user.setShoppingLists(shoppingLists);\n dataController.saveUser(user);\n\n //go to home fragment\n Fragment homeFragement = new HomeFragment();\n navigationController.changeFragment(getActivity(), homeFragement, null, Constants.HOME_STATES.HOME_STATE);\n }\n })\n .setNegativeButton(\"CANCELAR\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n }\n }).show();\n }", "public void deleteItem(int index) {\n messages.remove(index);\n notifyItemRemoved(index);\n }", "private void deleteList(){\n new Thread(() -> agenda.getConnector().deleteItem(currentList)).start();\n numberOfLists--;\n for(Component c:window.getComponents()){\n if (c.getName().equals(comboBox.getSelectedItem().toString())){\n window.remove(c);\n }\n }\n if(comboBox.getItemCount() == 1){\n comboBox = new JComboBox();\n }else {\n comboBox.removeItemAt(comboBox.getSelectedIndex());\n }\n setUpHeader();\n this.updateComponent(header);\n }", "public void onClick(DialogInterface dialog, int id) {\n study1.delete(l_name);\n listItems.remove(l_name);\n adapter.notifyDataSetChanged();\n }", "@Override\n\t\t\t\t\tpublic void OnSelectItem(Item item) {\n\n\t\t\t\t\t\tif(!toDelete.contains(item))\n\t\t\t\t\t\t\ttoDelete.add(item);\n\t\t\t\t\t}", "public void deleteCommandMutable(int index) {\n int correctIndex = index - 1;\n assertIndexInRange(correctIndex);\n this.listItems.remove(correctIndex);\n }", "@Override\n\tpublic void delete(List<Field> entity) {\n\t\t\n\t}", "@Override\r\n\tpublic void onSongListDeleteClick(View v) {\n\t\tint position = (Integer) ((ImageView)v).getTag();\r\n\t\tMPService.SongList.remove(position);\r\n\t\tadapter.notifyDataSetChanged();\r\n\t\ttv_songlist.setText(\"播放列表(\" + MPService.SongList.size() + \")\" );\r\n\t}", "private void onDeleteElement(View view) {\n\n\n Node exist = arSceneView.getScene().findByName(TEMP_LINE_STRING);\n if(exist !=null)\n\n {\n arSceneView.getScene().removeChild(exist);\n\n tempLine = null;\n\n }\n\n if(listElements.size()<1) {\n Toast.makeText(MainActivity.this, \"List empty\", Toast.LENGTH_SHORT).show();\n return;\n }\n\n Description r = listElements.get(listElements.size() - 1);\n if (r != null) {\n arSceneView.getScene().removeChild(r.getNode());\n r.getNode().setParent(null);\n listElements.remove(listElements.size() - 1);\n\n }\n\n\n\n\n\n\n\n\n }", "public void deleteWholeList()\n {\n head = null;\n }", "public static void deleteItem()\r\n\t{\r\n\t\tif(receiptList.getSelectedIndex() < listModel.getSize()-4 && receiptList.getSelectedIndex() > -1)\r\n\t\t{\r\n\t\t\tString itemPrice = receiptList.getSelectedValue().substring(0,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treceiptList.getSelectedValue().indexOf(\" \"));\r\n\t\t\t\r\n\t\t\tsubtotalAmount = subtotalAmount - Functions.toAmount(itemPrice);\r\n\t\t\tupdateTotals();\r\n\t\t\t\r\n\t\t\tlistModel.removeElementAt(receiptList.getSelectedIndex());\r\n\t\t\tif(listModel.getSize() == 4)\r\n\t\t\t\tclearReceipt();\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tfor(int count=0; count < 4; count++)\r\n\t\t\t\t\tlistModel.removeElementAt(listModel.getSize()-1);\r\n\t\t\t\tlistModel.addElement(\" \");\r\n\t\t\t\tlistModel.addElement(Functions.toMoney(subtotalAmount) + manualTab(Functions.toMoney(subtotalAmount)) + \"Subtotal \");\r\n\t\t\t\tlistModel.addElement(Functions.toMoney(taxAmount) + manualTab(Functions.toMoney(taxAmount)) + \"Tax\");\r\n\t\t\t\tlistModel.addElement(Functions.toMoney(totalAmount) + manualTab(Functions.toMoney(totalAmount)) + \"Total\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void removeItem(Word w)\r\n {\n currentDB.deleteWord(w);\r\n finish();\r\n startActivity(getIntent());\r\n Toast.makeText(getApplicationContext(), getResources().getString(R.string.str_removed_word)+\": \"+w.strNative, Toast.LENGTH_SHORT).show();\r\n }", "@Test\n void testRemoveDeletesElement() {\n MyList l = new MyList();\n l.put(\"key\", \"value\");\n l.remove(\"key\");\n\n assertEquals(false, l.contains(\"key\"));\n }", "public void deleteBook(int num)\n { \n bookList.remove(num); \n }", "@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tSMSDao mSMSDao = new SMSDao(mContext);\n\t\t\t\t\t\tmSMSDao.deleteSMS(String.valueOf(mSMSList.get(position).getSort()));\n\t\t\t\t\t\tmSMSList.remove(position);\n\t\t\t\t\t\tmyAdapter.notifyDataSetChanged();\n\t\t\t\t\t}", "@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tSMSDao mSMSDao = new SMSDao(mContext);\n\t\t\t\t\t\tmSMSDao.deleteSMS(String.valueOf(mSMSList.get(position).getSort()));\n\t\t\t\t\t\tmSMSList.remove(position);\n\t\t\t\t\t\tmyAdapter.notifyDataSetChanged();\n\t\t\t\t\t}", "@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 }", "boolean removAble(InputItem item);", "void onDeleteItem(E itemElementView);", "private void delete() {\n AltDatabase.getInstance().getAlts().remove(getCurrentAsEditable());\n if (selectedAccountIndex > 0)\n selectedAccountIndex--;\n updateQueried();\n updateButtons();\n }", "public void testRemoveObj() {\r\n list.add(\"A\");\r\n list.add(\"B\");\r\n assertTrue(list.remove(\"A\"));\r\n assertEquals( \"B\", list.get(0));\r\n assertEquals( 1, list.size());\r\n list.add(\"C\");\r\n assertTrue(list.remove(\"C\"));\r\n assertEquals(\"B\", list.get(0));\r\n }", "@Override\n public void delete(int i) throws IndexOutOfBoundsException, IllegalStateException {\n validIndex(i);\n if (this.isEmpty()){\n throw new IllegalStateException(\"List is empty\");\n }\n for (int j = i; j < size - 1; j++){\n data[j] = data[j + 1];\n }\n data[size - 1] = null;\n size--;\n }" ]
[ "0.85112876", "0.7739133", "0.7692827", "0.75185037", "0.7471983", "0.7393248", "0.737645", "0.7353746", "0.73497194", "0.73453885", "0.7269308", "0.71792984", "0.716405", "0.71390647", "0.7125159", "0.7063365", "0.7049601", "0.70286787", "0.7025161", "0.6999571", "0.6999432", "0.6978782", "0.6976449", "0.69550943", "0.69279253", "0.6918253", "0.6910879", "0.6884035", "0.6877417", "0.6875732", "0.68666595", "0.6862271", "0.68600464", "0.6853147", "0.68480587", "0.6841362", "0.6839448", "0.68034995", "0.67966175", "0.67911583", "0.6788242", "0.67870283", "0.6779892", "0.67795265", "0.6754396", "0.6750533", "0.6746013", "0.674346", "0.6739619", "0.67300683", "0.6728992", "0.6727177", "0.67258096", "0.671487", "0.6714145", "0.66978055", "0.6682738", "0.6679902", "0.66761905", "0.66747254", "0.6672834", "0.66654885", "0.66627717", "0.6659505", "0.66471", "0.66451496", "0.66336465", "0.6631122", "0.6627107", "0.6622416", "0.661288", "0.6605487", "0.66037476", "0.6594344", "0.6592913", "0.65817434", "0.6580544", "0.65763026", "0.65706724", "0.6565831", "0.655632", "0.6554741", "0.655284", "0.65493435", "0.65493256", "0.6547485", "0.65459734", "0.65383005", "0.6527548", "0.65258825", "0.6513078", "0.65067106", "0.6506655", "0.6506635", "0.6506635", "0.65057564", "0.650534", "0.6503008", "0.6501532", "0.6497838", "0.6491207" ]
0.0
-1
TODO Autogenerated method stub
@Override public List<CursoAsignatura> listar() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public Optional<CursoAsignatura> listarId(int id) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public int save(CursoAsignatura ca) { return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void delete(int id) { }
{ "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
Do something with the result here
@Override public void handleResult(Result rawResult) { Toast.makeText(this,rawResult.getText(),Toast.LENGTH_LONG).show(); // Toast.makeText(this,rawResult.getBarcodeFormat().toString(),Toast.LENGTH_LONG).show(); if (rawResult.getText().equals("admin")) { Intent intent = new Intent(ScannerActivity.this, ExamPage.class); startActivity(intent); finish(); } else { Toast.makeText(this,"Wrong QR Code",Toast.LENGTH_LONG).show(); Intent intent = new Intent(ScannerActivity.this, ScannerActivity.class); startActivity(intent); finish(); } SharedPreferences sp = getSharedPreferences("PREF_NAME", Context.MODE_PRIVATE); String qrText = sp.getString("QR_Code", String.valueOf(-1)); Toast.makeText(this,qrText,Toast.LENGTH_LONG).show(); Log.v("Scan", rawResult.getText()); // Prints scan results Log.v("Scan", rawResult.getBarcodeFormat().toString()); // Prints the scan format (qrcode, pdf417 etc.) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void ComputeResult(Object result);", "@Override\n\tprotected void parseResult() {\n\t\t\n\t}", "@Override\n \tpublic Object getResult() {\n \t\treturn result;\n \t}", "Result getResult();", "public void setResult() {\n }", "void mo24178a(ResultData resultdata);", "V result() throws Exception;", "public abstract String getResult();", "protected R getResult() {\n\t\treturn result;\n\t}", "java.lang.String getResult();", "public int getResult(){\r\n\t\t return result;\r\n\t }", "protected abstract O getResult();", "private void retrieveResult() {\n if (result == null) {\n this.setResult(((DocumentBuilder)this.getHandler()).getResult());\n }\n }", "int getResult();", "@Override\n public void setResult(Object result) throws EngineException {\n \n }", "public String getResult();", "public String getResult();", "public String getResult();", "public int getResult(){\n return localResult;\n }", "public abstract void displayResult(Result result);", "public void doResult() throws Exception {\n\t\tJSONObject map=new JSONObject(getResult());\n\t\tif(!\"ok\".equalsIgnoreCase(map.getString(\"status\"))){\n\t\t\tdoFailureResult();\n\t\t\treturn;\n\t\t}\n\t\tif(getHandler()!=null){\n\t\t\tMessage hmsg=getHandler().obtainMessage();\n\t\t\thmsg.obj=map;\n\t\t\thmsg.arg1=1;\n\t\t\tgetHandler().sendMessage(hmsg);\n\t\t\tsetHandler(null);\n\t\t}\n\t}", "public void mo5062c(Result result) {\n }", "protected void setResult(R result) {\n _result = result;\n }", "public T getResult();", "public void returnResult() {\n\t\tSystem.out.printf(\"Result of your Numbers are: %d\", result());\n\t}", "void onResult(T result);", "void onResult(T result);", "public Object getResult()\n/* */ {\n/* 129 */ Object resultToCheck = this.result;\n/* 130 */ return resultToCheck != RESULT_NONE ? resultToCheck : null;\n/* */ }", "public String process() throws Exception\r\n\t{\r\n\t\treturn result;\r\n\t}", "public void setResult(Object result) {\n this.result = result;\n }", "public abstract boolean mo66251a(Result<T> result);", "T getResult();", "T getResult();", "@Override\n protected void run(Result result) throws Throwable {\n }", "@Override\r\n\tpublic int getResult() {\n\t\treturn 0;\r\n\t}", "public IStatus getResult();", "int getResult() {\n return result;\n }", "@Override\n public boolean getResult() {\n return result_;\n }", "void newResult(Result result);", "@Override\n\tpublic String getResult() {\n\t\treturn result;\n\t}", "protected void handleResult(String result) {}", "@Override\n public boolean getResult() {\n return result_;\n }", "public T result() {\n return result;\n }", "void onResult(int ret);", "abstract protected void reportResult(Result result);", "public int getresult(){\n return result;}", "protected SimulatorValue giveResult() {\n\tthis.evalExpression();\n\treturn value;\n }", "private static Response process(Object result) {\n if (result == null) return Response.serverError().build();\n if (result instanceof Response.Status) return Response.status((Response.Status) result).build();\n return Response.ok(result).build();\n }", "com.rpg.framework.database.Protocol.ResponseCode getResult();", "com.rpg.framework.database.Protocol.ResponseCode getResult();", "com.rpg.framework.database.Protocol.ResponseCode getResult();", "com.rpg.framework.database.Protocol.ResponseCode getResult();", "com.rpg.framework.database.Protocol.ResponseCode getResult();", "@Override\n\tpublic Result getResult() {\n\t\treturn m_Result;\n\t}", "public void setResult(Result result) {\n this.result = result;\n }", "@Override\n\t\t\t\tpublic void result(String result) {\n\t\t\t\tLog.e(TAG,result);\t\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void result(String result) {\n\t\t\t\tLog.e(TAG,result);\t\n\t\t\t\t}", "public static void resultMessage (int result) {\n System.out.println(\"The result of choosed operation is: \" + result);\n }", "public void setResult(T result) {\n this.result = result;\n }", "public E getResult(){\r\n\t\treturn this.result;\r\n\t}", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "public void setResult(String result)\n {\n this.result = result;\n }", "@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic String getResult() {\n\t\treturn this.result;\r\n\r\n\t}", "public Result getResults()\r\n {\r\n return result;\r\n }", "public MatchOther processResult(ResultItems resultItems, Task task);", "public Object runAndGetResult() {\n run();\n return getResult();\n }", "public void setResult(String result) {\n this.result = result;\n }", "public void setResult(String result) {\n this.result = result;\n }", "boolean getResult();", "boolean getResult();", "boolean getResult();", "boolean getResult();", "public void setResult (String Result);", "public T getResult() {\n return result;\n }", "public T getResult() {\n return result;\n }", "@Override\r\n\tpublic void process(ResultItems arg0, Task arg1) {\n\t\t\r\n\t}", "@Override\n\tpublic void getResultat() {\n\t\tcalcul();\n\t}", "@Override\n\t\t\t\t\t\tpublic void result(String result) {\n\t\t\t\t\t\t\tLog.e(TAG,result);\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void result(String result) {\n\t\t\t\t\t\t\tLog.e(TAG,result);\n\t\t\t\t\t\t}", "public void setResult(String result)\r\n\t{\r\n\t\tthis.result = result;\r\n\t}", "protected T retrieve() {\n return _result;\n }", "protected boolean gotResult (SurveyQuestion result) {\n _cache.questionUpdated(_survey, _questionIndex, result);\n Link.replace(Pages.ADMINZ, \"survey\", \"e\", _survey.surveyId);\n return true;\n }", "public int getResult() {\r\n\t\t\treturn result_;\r\n\t\t}", "public int getResult() {return resultCode;}", "public Result getResult() {\n return result;\n }", "public int getResult() {\n return result;\n }", "public int getResult() {\r\n\t\t\t\treturn result_;\r\n\t\t\t}", "public void receiveResultexecute(\n loadbalance.LoadBalanceStub.ExecuteResponse result\n ) {\n }", "@Override\n\tpublic void result(ContactResult arg0) {\n\t\t\n\t}", "public boolean getResult() {\r\n\treturn result;\r\n }" ]
[ "0.7276043", "0.70556283", "0.70493454", "0.7012322", "0.6800602", "0.6772198", "0.67579854", "0.6736088", "0.67356104", "0.67345554", "0.6721033", "0.6720543", "0.6691392", "0.66840917", "0.66544855", "0.6641104", "0.6641104", "0.6641104", "0.6637591", "0.66330343", "0.65645105", "0.65274876", "0.6500096", "0.64931875", "0.6490716", "0.64787805", "0.64787805", "0.6464198", "0.6430416", "0.6425363", "0.64174443", "0.6411279", "0.6411279", "0.64059776", "0.6398941", "0.639048", "0.6382052", "0.6374859", "0.6349543", "0.63381106", "0.6327316", "0.63255537", "0.6322833", "0.632133", "0.6317779", "0.6277116", "0.62755173", "0.62600994", "0.62483203", "0.6247671", "0.6247671", "0.62476635", "0.62476635", "0.62448895", "0.62409455", "0.6237415", "0.6237415", "0.6223448", "0.62216645", "0.6219468", "0.62132305", "0.62132305", "0.62132305", "0.62132305", "0.62132305", "0.62132305", "0.62132305", "0.62132305", "0.62132305", "0.62132305", "0.62132305", "0.62132305", "0.62118614", "0.620095", "0.61972904", "0.6177706", "0.61776626", "0.61519617", "0.61447614", "0.61430883", "0.61430883", "0.61430883", "0.61430883", "0.61373067", "0.61365014", "0.61365014", "0.6132066", "0.6125669", "0.6116537", "0.6116537", "0.6103242", "0.6101851", "0.6091862", "0.6078741", "0.60642546", "0.6058076", "0.6055831", "0.605285", "0.60518885", "0.6048463", "0.6038948" ]
0.0
-1
Use the application context, which will ensure that you don't accidentally leak an Activity's context. See this article for more information:
public static FieldGuideDatabase getInstance(Context ctx) { if (mInstance == null) { mInstance = new FieldGuideDatabase(ctx.getApplicationContext()); } return mInstance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected Activity getContext() {\n return contextWeakReference.get();\n }", "public static Context getAppContext() {\n return mContext;\n }", "private Context getContext() {\n return mContext;\n }", "private Context getContext() {\n return mContext;\n }", "public static Activity getContext() {\n return instance;\n\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n context=getContext();\n\n }", "@Override\n public Context getContext() {\n return this.getApplicationContext();\n }", "private Context getApplicationContext() {\n\t\treturn this.cordova.getActivity().getApplicationContext();\n\t}", "private Context getApplicationContext() {\n\t\treturn this.cordova.getActivity().getApplicationContext();\n\t}", "@Override\r\n\tpublic Context getContext()\r\n\t{\n\t\treturn this.getActivity().getApplicationContext();\r\n\t}", "@Override\n public Context getApplicationContext() {\n return mView.get().getApplicationContext();\n }", "AndroidAppInterface(Context context) {\n this.mContext = context;\n }", "public static Context getContext(){\n return appContext;\n }", "Context getContext() {\n Context context = mContextRef.get();\n return context != null ? context : AppUtil.getAppContext();\n }", "public final Context getContext() {\n return mContext;\n }", "public static Context getApplicationContext() { return mApplicationContext; }", "public Context getApplicationContext();", "public MyApp() {\n sContext = this;\n }", "public Context getContext() {\n return mContext;\n }", "public static Context getAppContext() {\n return _BaseApplication.context;\n }", "public static AndroidContext instance() {\n // 确保Context已经被赋值。\n if (sInstance == null) {\n throw new IllegalStateException(\"Android context was not initialized.\");\n }\n return sInstance;\n }", "public static void initialize(@Nullable Context context) {\n if (sInstance == null) {\n sInstance = new AndroidContext(context);\n }\n }", "private Context getContextAsync() {\n return getActivity() == null ? IotSensorsApplication.getApplication().getApplicationContext() : getActivity();\n }", "public Context getContext() {\n\t\treturn mContext;\n\t}", "@Override\n\tpublic BaseActivity getContext() {\n\t\treturn this;\n\t}", "@Override\n\tpublic BaseActivity getContext() {\n\t\treturn this;\n\t}", "public void setContext(Context _context) {\n context = _context;\n }", "static synchronized Context getContext() {\n checkState();\n return sInstance.mContext;\n }", "public static void initializeApp(Context context) {\n }", "@Override\n public void onContext() {\n }", "@Override\r\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\r\n\t\tcontext=this;\r\n\t}", "public void setContext(Context context) {\n this.context = context;\n }", "static Application getContext() {\n if (ctx == null)\n // TODO: 2019/6/18\n// throw new RuntimeException(\"please init LogXixi\");\n return null;\n else\n return ctx;\n }", "@Override\n protected void onResume() {\n// super.onResume();\n MyApplication.getInstance().setcontext(this);\n // Log.e(\"act_tenth_TAG\", \"onResume of :\" + this.getClass().getSimpleName().toString());\n\n\n super.onResume();\n }", "@Provides\n @Singleton\n @ApplicationScope\n public Context provideApplicationContext() {\n return mApp.getApplicationContext();\n }", "public void mo28521a(Context context) {\n this.f11181a = context != null ? context.getApplicationContext() : null;\n }", "private AppContext()\n {\n }", "public void setContext(Context context) {\n this.contextMain = context;\n }", "public static Context getContext() {\r\n\t\tif (mContext == null)\r\n\t\t\treturn null;\r\n\t\telse\r\n\t\t\treturn mContext;\r\n\r\n\t}", "@Override\r\n\tpublic void setContext(Context context) {\r\n\t\tthis.context = context;\r\n\t}", "@Override\n public void onAttach(Activity activity) {\n super.onAttach(activity);\n this.context = activity;\n }", "@Override\n\tpublic Void setContext(Context context) {\n\t\treturn null;\n\t}", "@Override\n\tpublic void starctActivity(Context context) {\n\n\t}", "public static ApplicationContext getApplicationContext() {\r\n\t\treturn applicationContext;\r\n\t}", "@Override\n\tpublic void starctActivity(Context context) {\n\t\t\n\t}", "public void initializeContext(Context context) {\n this.context = context;\n }", "public static ApplicationContext getApplicationContext() {\n return appContext;\n }", "private SingletonApp( Context context ) {\n mMB = MessageBroker.getInstance( context );\n }", "@Override\n\tpublic void onAttach(Activity activity) {\n\t\tsuper.onAttach(activity);\n\t\tcontext = activity;\n\t}", "public static Context getContext() {\n\t\treturn context;\n\t}", "public static Context getContext() {\n\t\treturn context;\n\t}", "public synchronized static void setContext(Context con){\n\t\tcontext = con;\n\t}", "@Override\n public Context getContext() {\n return null;\n }", "public Context getContext() {\n return this.mContext;\n }", "public Context getContext() {\n return this.mContext;\n }", "public void setApplicationContext(final ApplicationContext inApplicationContext)\n {\n ctx = inApplicationContext;\n }", "private Activity m33657b(Context context) {\n if (context instanceof Activity) {\n return (Activity) context;\n }\n if (context instanceof ContextWrapper) {\n return m33657b(((ContextWrapper) context).getBaseContext());\n }\n return null;\n }", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tcontext = getApplicationContext();\n\t\t\n\t\tApplicationContextUtils.init(context);\n\t}", "public static void init(@NonNull final Context context) {\n BlankjUtils.sApplication = (Application) context.getApplicationContext();\n }", "@Override\n\tpublic void onAttach(Activity activity) {\n\t\tsuper.onAttach(activity);\n\n\t\tcontext = activity;\n\t}", "void setContext(Context context) {\n\t\tthis.context = context;\n\t}", "@Override\n\tprotected Context getContext() {\n\t\treturn getActivity();\n\t}", "public static Context getContext() {\n\t\treturn instance;\n\t}", "@Override\n\tpublic void initContext(Activity act) {\n\t\tthis._activity = act;\n\t}", "long getCurrentContext();", "void mo25261a(Context context);", "void setAppCtx(ApplicationContext appCtx);", "public void activityCreated(Context ctx){\n //set Activity context - in this case there is only MainActivity\n mActivityContext = ctx;\n }", "public static final void onCreate(@NonNull Activity context) {\n if (sInstance == null) {\n onCreate(context.getApplication());\n }\n }", "public static void initialize(Context ctx) {\n\t\tmContext = ctx;\n\t}", "ApplicationContext getAppCtx();", "@Override\n public void onCreate() {\n super.onCreate();\n mContext = getApplicationContext();\n mLockApplication = (LockApplication) mContext.getApplicationContext();\n mWinMng = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);\n\n }", "Builder(Activity activity) {\n this.context = activity;\n }", "public static void setApplicationContext( ApplicationContext context ){\n\t\t\tctx = context;\n//\t\telse{\n//\t\t\tSystem.out.println(\"Error, ApplicationContext already has been set\");\n//\t\t}\n\t}", "public ApplicationContext getApplicationContext()\n {\n return this.applicationContext;\n }", "Context createContext();", "Context createContext();", "public Context getActivityContext(){\n return mActivityContext;\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n mContext=this;\n \n invokeWeChat();\n }", "Context getContext();", "public ApplicationContext getApplicationContext() {\n return applicationContext;\n }", "Context context();", "Context context();", "@Test\n public void useAppContext() throws Exception {\n Context appContext = InstrumentationRegistry.getTargetContext();\n\n assertEquals(\"com.mbientlab.bletoolbox.androidbtle.test\", appContext.getPackageName());\n }", "@Override\r\n\tpublic Context getContext() {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic Context getContext() {\r\n\t\treturn this.context;\r\n\t}", "@NonNull\n public final AutoRef<Context> getContext() throws IllegalStateException, ReferenceNullException {\n return AutoRef.of(getView().get().getContext());\n }", "void getContext() {\n playerName = getIntent().getExtras().getString(\"player_name\");\n Log.i(\"DiplomaActivity\", \"getContext - Player name: \" + playerName);\n }", "public abstract void mo36026a(Context context);", "@Test\n public void useAppContext() {\n Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();\n assertEquals(\"uk.ac.bham.student.starmegabucks\", appContext.getPackageName());\n }", "@Override\n public void setApplicationContext(ApplicationContext applicationContext) {\n super.setApplicationContext(applicationContext);\n this.applicationContext = applicationContext;\n }", "@Test\n public void useAppContext() throws Exception {\n Context appContext = InstrumentationRegistry.getTargetContext();\n\n assertEquals(\"es.marser.backgroundtools.test\", appContext.getPackageName());\n }", "public CH340Application() {\n sContext = this;\n }", "public Context getContext() {\n return this.mService.mContext;\n }", "@Override\n public void onCreate() {\n super.onCreate();\n application = this;\n }", "public Context getContext() {\n\t\treturn null;\n\t}", "public MyServiceDataSingleton(Context context) {\r\n myContext = context;\r\n }", "@Override\n\tpublic void setApplicationContext(ApplicationContext applicationContext) {\n\t\tthis.applicationContext = applicationContext;\n\t}", "public Context getContext() {\n return context;\n }", "public static void m6916a(Context context) {\n f5051b = null;\n f5052c = null;\n f5053d = null;\n f5054e = null;\n C2820e.m11776a();\n f5055f = context.getApplicationContext();\n C2253z.m9684a();\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tmDataMgrApp = (MainApplication) getApplicationContext();\n\t}" ]
[ "0.7450419", "0.7265197", "0.7242151", "0.7242151", "0.7192599", "0.71887004", "0.71683455", "0.7133464", "0.7133464", "0.7084064", "0.7042796", "0.6963435", "0.6941001", "0.6937693", "0.6885214", "0.68333215", "0.682995", "0.6794881", "0.6727338", "0.67211115", "0.66428316", "0.66024685", "0.6585672", "0.657675", "0.6552815", "0.6552815", "0.6501026", "0.6490615", "0.6484197", "0.6474731", "0.6455546", "0.64146423", "0.63883656", "0.6381954", "0.63818717", "0.63707876", "0.63201344", "0.6294423", "0.6289125", "0.62874246", "0.62821484", "0.6280645", "0.62759006", "0.62671936", "0.6266223", "0.626389", "0.6258539", "0.6201124", "0.61881405", "0.61856914", "0.61856914", "0.6180674", "0.6169101", "0.6151318", "0.6151318", "0.61333615", "0.61231923", "0.61197746", "0.6118447", "0.6118321", "0.6117233", "0.61152136", "0.6114439", "0.61097515", "0.6105365", "0.6101457", "0.60827965", "0.6069014", "0.6049791", "0.6049663", "0.60369027", "0.60114455", "0.6001282", "0.5998132", "0.59959745", "0.59893495", "0.59893495", "0.5988928", "0.5980281", "0.5976696", "0.5976679", "0.59690344", "0.59690344", "0.5925376", "0.591846", "0.5915638", "0.5915465", "0.58916783", "0.586724", "0.5853163", "0.5851048", "0.5849811", "0.58377206", "0.5836129", "0.5828948", "0.5825031", "0.581927", "0.58180016", "0.58160204", "0.5800148", "0.5789455" ]
0.0
-1
Performs a database query.
private Cursor query(String tables, String[] columns, String selection, String[] selectionArgs, String groupBy, String orderBy) { /* * The SQLiteBuilder provides a map for all possible columns requested * to actual columns in the database, creating a simple column alias * mechanism by which the ContentProvider does not need to know the real * column names */ SQLiteQueryBuilder builder = new SQLiteQueryBuilder(); builder.setTables(tables); Cursor cursor = builder.query(mDatabaseOpenHelper.getReadableDatabase(), columns, selection, selectionArgs, groupBy, null, orderBy); if (cursor == null) { Log.w(TAG, "No data available from the query"); return null; } else if (!cursor.moveToFirst()) { Log.w(TAG, "No data available from the query"); cursor.close(); return null; } Log.d(TAG, "Returning " + cursor.getCount() + " records"); return cursor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Query query();", "void runQueries();", "public abstract ResultList executeQuery(DatabaseQuery query);", "private void executeQuery() {\n }", "Query queryOn(Connection connection);", "ResultSet runSQL(String query) {\n try {\n return connection.prepareStatement(query).executeQuery();\n }\n catch (SQLException e) {\n System.err.println(e.getMessage());\n return null;\n }\n }", "public abstract ResultList executeSQL(RawQuery rawQuery);", "public ResultSet query (String query) throws java.sql.SQLException {\n /*\n if (query.indexOf('(') != -1)\n Logger.write(\"VERBOSE\", \"DB\", \"query(\\\"\" + query.substring(0,query.indexOf('(')) + \"...\\\")\");\n else\n Logger.write(\"VERBOSE\", \"DB\", \"query(\\\"\" + query.substring(0,20) + \"...\\\")\");\n */\n Logger.write(\"VERBOSE\", \"DB\", \"query(\\\"\" + query + \"\\\")\");\n \n try {\n Statement statement = dbConnection.createStatement();\n statement.setQueryTimeout(30);\n ResultSet r = statement.executeQuery(query);\n return r;\n } catch (java.sql.SQLException e) {\n Logger.write(\"RED\", \"DB\", \"Failed to query database: \" + e);\n throw e;\n }\n }", "public void Query() {\n }", "private void executeSelect(String query){\n try {\n statement = connection.createStatement();\n rs = statement.executeQuery(query);\n } catch (SQLException e) {\n throw new RuntimeException(e);\n } \n }", "public abstract Statement queryToRetrieveData();", "public List<IEntity> query(IQuery query) throws SQLException;", "public void runQuery(String query, String db) throws SQLException {\n if (null == conn) {\n throw new IllegalStateException(\"No connection open\");\n }\n Statement stmt = conn.createStatement();\n\n // Should use a prepared statement\n stmt.execute(\"use \" + db);\n try {\n if (stmt.execute(query)) {\n ResultSet resultSet = stmt.getResultSet();\n ResultSetMetaData metadata = resultSet.getMetaData();\n int cols = metadata.getColumnCount();\n while (resultSet.next()) {\n for (int c = 1; c <= cols; ++c) {\n System.out.print(resultSet.getObject(c).toString());\n if (c != cols) System.out.print(\"\\t\");\n else System.out.println();\n }\n }\n } else {\n System.err.println(\"Query failed\");\n System.err.println(\"Warnings: \" + stmt.getWarnings());\n }\n } finally {\n stmt.close();\n }\n }", "DBCursor execute();", "@Override\r\n public void query(String strSQL)\r\n {\r\n try\r\n {\r\n dbRecordset = dbCmdText.executeQuery(strSQL);\r\n status(\"epic wonder \"+ strSQL);\r\n }\r\n catch (Exception ex)\r\n {status(\"Query fail\");\r\n }\r\n }", "public void query(String sql) throws SQLException {\r\n Statement st = con.createStatement();\r\n ResultSet rs = st.executeQuery(sql);\r\n\r\n while (rs.next()){\r\n System.out.println(rs.getInt(\"id\")+\" \"+rs.getString(\"name\")+\" \"+rs.getString(\"surname\")+\" \"+rs.getFloat(\"grade\"));\r\n }\r\n\r\n }", "T queryForId(ID id) throws SQLException, DaoException;", "public ResultSet executeQuery() throws SQLException {\n return statement.executeQuery();\n }", "public ResultSet executeQuery(String request) {\n try {\r\n return st.executeQuery(request);\r\n } catch (SQLException ex) {\r\n Logger.getLogger(Database.class.getName()).log(Level.SEVERE, null, ex);\r\n return null;\r\n }\r\n }", "public ORM executeQuery(String query) {\n ResultSet rs = null;\n this.query =query;\n System.out.println(\"run: \" + this.query);\n //this.curId = 0;\n Statement statement;\n try {\n statement = this.conn.createStatement();\n rs = statement.executeQuery(this.query);\n //this.saveLog(0,\"\",query);\n } catch (SQLException e) {\n System.out.println( ColorCodes.ANSI_RED +\"ERROR in SQL: \" + this.query);\n // e.printStackTrace();\n }\n lastResultSet=rs;\n this.fields_values = \"\";\n return this;\n\n }", "public ResultSet executeSQL() {\t\t\n\t\tif (rs != null) {\n\t\t\ttry {\n\t\t\t\trs.close();\n\t\t\t} catch(SQLException se) {\n\t\t\t} finally {\n\t\t\t\trs = null;\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\trs = pstmt.executeQuery();\n\t\t} catch (SQLException se) {\n\t\t\tse.printStackTrace();\n\t\t}\n\t\treturn rs;\n\t}", "private ResultSet executeQuery(String query) {\r\n Statement stmt;\r\n ResultSet result = null;\r\n try {\r\n// System.out.print(\"Connect DB .... \");\r\n conn = openConnect();\r\n// System.out.println(\"successfully \");\r\n stmt = conn.createStatement();\r\n result = stmt.executeQuery(query);\r\n } catch (SQLException | ClassNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n return result;\r\n }", "private void sampleQuery(final SQLManager sqlManager, final HttpServletResponse resp)\n throws IOException {\n try (Connection sql = sqlManager.getConnection()) {\n\n // Execute the query.\n final String query = \"SELECT 'Hello, world'\";\n try (PreparedStatement statement = sql.prepareStatement(query)) {\n \n // Gather results.\n try (ResultSet result = statement.executeQuery()) {\n if (result.next()) {\n resp.getWriter().println(result.getString(1));\n }\n }\n }\n \n } catch (SQLException e) {\n LOG.log(Level.SEVERE, \"SQLException\", e);\n resp.getWriter().println(\"Failed to execute database query.\");\n }\n }", "protected final void executeQuery() {\n\ttry {\n\t executeQuery(queryBox.getText());\n\t} catch(SQLException e) {\n\t e.printStackTrace();\n\t clearTable();\n\t JOptionPane.showMessageDialog(\n\t\tnull, e.getMessage(),\n\t\t\"Database Error\",\n\t\tJOptionPane.ERROR_MESSAGE);\n\t}\n }", "ResultSet executeQuery() throws SQLException;", "public ResultSet executeQuery(String query) {\n ResultSet rs = null;\n \ttry {\n rs = st.executeQuery(query);\n } catch(Exception e) {\n \te.printStackTrace();\n }\n return rs;\n }", "Object executeSelectQuery(String sql) { return null;}", "public ResultSet executeQuery(String query)\n\t{\n\t\tStatement statement = null;\n\t\tResultSet resultSet = null;\n\t\t\n\t\ttry\n\t\t{\n\t\t\t//System.out.println(\"Performing query: \" + query);\n\t\t\tstatement = getConnection().createStatement();\n\t\t\tresultSet = statement.executeQuery(query);\n\t\t\t//System.out.println(\"Query performed\");\n\t\t\t\n\t\t\treturn resultSet;\n\t\t}\n\t\tcatch(SQLException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "@Override\n\t\tpublic void executeQuery(String query) {\n\t\t\t\n\t\t}", "public<T> T execute() throws DatabaseException;", "public ResultSet runQuery(String sql){\n\n try {\n\n Statement stmt = conn.createStatement();\n\n return stmt.executeQuery(sql);\n\n } catch (SQLException e) {\n e.printStackTrace(System.out);\n return null;\n }\n\n }", "public ResultSet executeQuery(String query) throws SQLException {\n Connection con = this.getConnection();\n\n if (con == null) {\n throw new SQLException(\"Can't get database connection\");\n }\n\n Statement statement = con.createStatement();\n\n ResultSet result = statement.executeQuery(query);\n con.close(); // Not sure if allowed to close connection before result.\n // MAKE SURE to close result after using it! result.close();\n return result;\n }", "public ResultSet execute(String query)\n\t{\n\t\tResultSet resultSet = null;\n\t\ttry {\n\t\tStatement statement = this.connection.createStatement();\n\t\tresultSet = statement.executeQuery(query);\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"Error while executing query.\" +e.getMessage());\n\t\t}\n\t\treturn resultSet;\n\t}", "public ResultSet doQuery( String sql) throws SQLException {\r\n\t\tif (dbConnection == null)\r\n\t\t\treturn null;\r\n\t\t// prepare sql statement\r\n\t\toutstmt = dbConnection.prepareStatement(sql);\r\n\t\tif (outstmt == null)\r\n\t\t\treturn null;\r\n\t\tif (outstmt.execute()){\r\n\t\t\t//return stmt.getResultSet(); //old\r\n\t\t\toutrs = outstmt.getResultSet();\r\n\t\t}\r\n\t\telse\r\n\t\t\treturn null;\r\n\t\treturn outrs;\r\n\t}", "public static ResultSet Execute(String query) throws SQLException{\r\n\t\ttry {\r\n\t\t\tinitConnection();\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println(e.toString());\r\n\t\t}\r\n\t\tStatement state = dbCon.createStatement();\r\n\t\treturn state.executeQuery(query);\t\t\t\r\n\t}", "public ResultSet query(String sQLQuery) throws SQLException {\n\t Statement stmt = c.createStatement();\n\t ResultSet ret = stmt.executeQuery(sQLQuery);\n\t stmt.close();\n\t return ret;\n\t}", "DBObject executeSingle();", "public SingleQuery query(String sql, Object... params) {\r\n PreparedStatement stmt = prepare(sql);\r\n\r\n try {\r\n if (params != null && params.length > 0) {\r\n for (int i = 0; i < params.length; i++) {\r\n stmt.setObject(i + 1, params[i]);\r\n }\r\n }\r\n } catch (SQLException e1) {\r\n throw new DbException(e1);\r\n }\r\n\r\n return runQuery(stmt);\r\n }", "public ResultSet doQuery(String sql, Object[] params) throws SQLException {\r\n\t\t\r\n\t/*\tSystem.out.println(\"doQuery_sql: \" + sql);\r\n\t\tfor (int i = 0 ;i< params.length; i++)\r\n\t\t\tSystem.out.println(\"param: \" + params[i]);\t\r\n\t\t\r\n\t\t*/\r\n\t\tif (dbConnection == null)\r\n\t\t\treturn null;\r\n\t\toutstmt = dbConnection.prepareStatement(sql);\r\n\t\t// stuff parameters in\r\n\t\tfor (int i=0; i<params.length; i++){\r\n\t\t\toutstmt.setObject(i + 1,params[i]);\r\n\t\t}\r\n\t\t\r\n\t\tif (outstmt == null){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t// return a collection that can be iterated on\r\n\t\tif (outstmt.execute()){\r\n\t\t\t//return stmt.getResultSet();\r\n\t\t\toutrs = outstmt.getResultSet();\r\n\t\t}\r\n\t\telse\r\n\t\t\treturn null;\r\n\t\treturn outrs;\r\n\t}", "public static ResultSet executeQuery(String query) {\n\t\t\n\t\tString url = \"jdbc:postgresql://localhost:5432/postgres\";\n String user = \"postgres\";\n String password = \"admin\";\n \n ResultSet rs = null;\n\n try {\n \tConnection con = DriverManager.getConnection(url, user, password);\n \t\tStatement st = con.createStatement();\n \t\n rs = st.executeQuery(query);\n\n\t\t\t/*\n\t\t\t * if (rs.next()) { System.out.println(rs.getString(1)); }\n\t\t\t */\n \n \n\n } catch (SQLException ex) {\n \n System.out.println(\"Exception occured while running query\");\n ex.printStackTrace();\n }\n \n return rs;\n\t}", "public void executeQuery_Other(String query) {\n\n \n Connection con = DBconnect.connectdb();\n Statement st;\n\n try {\n st = con.createStatement();\n st.executeUpdate(query);\n\n \n } catch (Exception e) {\n //JOptionPane.showMessageDialog(null, e);\n\n }\n\n }", "public void runQuery(String query) throws SQLException {\n runQuery(query, \"default\");\n }", "public ResultSet ExecuteQuery(String statement) throws SQLException{\r\n\t\treturn _dbStatement.executeQuery(statement);\r\n\t}", "private ResultSet GetData(String query){\n\t\ttry{\n\t\t\tstat = connection.createStatement();\n\t\t\treturn stat.executeQuery(query);\n\t\t}catch (Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t\treturn null;\n\t\t}\n\t}", "public ResultSet executeQuery() throws SQLException {\n return currentPreparedStatement.executeQuery();\n }", "public boolean query(String query, Object... parameters) throws SQLException {\n refreshConnection();\n\n PreparedStatement ps = conn.prepareStatement(query);\n\n for (int i = 0; i < parameters.length; i++) {\n ps.setObject(i + 1, parameters[i]);\n }\n\n if (!keepConnected)\n disconnect();\n return ps.execute();\n }", "protected ResultSet executeQuery(String query) {\n ResultSet rs = null;\n \n try {\n Statement stmt = getConnection().createStatement();\n rs = stmt.executeQuery(query);\n } catch (SQLException e) {\n String msg = \"Failed to execute query: \" + query;\n _logger.error(msg, e);\n throw new TSSException(msg, e);\n } \n \n return rs;\n }", "public QueryTableResults executeQuery(BasicQuery query,\n\t\t\tUserInfo userInfo) throws DatastoreException, NotFoundException, JSONObjectAdapterException;", "public ResultSet execute(PreparedStatement query)\r\n {\r\n try\r\n {\r\n return query.executeQuery();\r\n } catch(SQLException exception)\r\n {\r\n LOG.log(Level.SEVERE, \"\", exception);\r\n }\r\n return null;\r\n }", "public static List<?> queryDatabase(String sql, Map<String, Object> params) {\r\n final Session session = sessionFactory.isClosed() ? sessionFactory.openSession() : sessionFactory.getCurrentSession();\r\n session.beginTransaction();\r\n try {\r\n final Query query = session.createQuery(sql);\r\n if (params != null) {\r\n params.forEach(query::setParameter);\r\n }\r\n return query.list();\r\n } finally {\r\n session.getTransaction().commit();\r\n }\r\n }", "public interface IDBQuery {\n String query();\n}", "public ResultSet executeQuery(String sql) throws Exception {\n\n\t\tResultSet rs = stmt.executeQuery(sql);\n\t\t// stmt.close();\n\t\treturn rs;\n\t}", "public ResultSet obtainDB() throws SQLException {\n Statement state = connection.createStatement();\n ResultSet resultSet = ((Statement) state).executeQuery(\"select * from criteriaSearchDB\");\n return resultSet;\n }", "private void executeQuery()\n {\n ResultSet rs = null;\n try\n { \n String author = (String) authors.getSelectedItem();\n String publisher = (String) publishers.getSelectedItem();\n if (!author.equals(\"Any\") && !publisher.equals(\"Any\"))\n { \n if (authorPublisherQueryStmt == null)\n authorPublisherQueryStmt = conn.prepareStatement(authorPublisherQuery);\n authorPublisherQueryStmt.setString(1, author);\n authorPublisherQueryStmt.setString(2, publisher);\n rs = authorPublisherQueryStmt.executeQuery();\n }\n else if (!author.equals(\"Any\") && publisher.equals(\"Any\"))\n { \n if (authorQueryStmt == null)\n authorQueryStmt = conn.prepareStatement(authorQuery);\n authorQueryStmt.setString(1, author);\n rs = authorQueryStmt.executeQuery();\n }\n else if (author.equals(\"Any\") && !publisher.equals(\"Any\"))\n { \n if (publisherQueryStmt == null)\n publisherQueryStmt = conn.prepareStatement(publisherQuery);\n publisherQueryStmt.setString(1, publisher);\n rs = publisherQueryStmt.executeQuery();\n }\n else\n { \n if (allQueryStmt == null)\n allQueryStmt = conn.prepareStatement(allQuery);\n rs = allQueryStmt.executeQuery();\n }\n\n result.setText(\"\");\n while (rs.next())\n {\n result.append(rs.getString(1));\n result.append(\", \");\n result.append(rs.getString(2));\n result.append(\"\\n\");\n }\n rs.close();\n }\n catch (SQLException e)\n {\n result.setText(\"\");\n while (e != null)\n {\n result.append(\"\" + e);\n e = e.getNextException();\n }\n }\n }", "public static void main(String[] args) {\n Connection conection = createConnection(\"people.db\");\n \n try {\n conection.createStatement().executeQuery(\"SELECT * FROM people\");\n \n } catch (SQLException ex) {\n System.out.println(\"PRINT AN ERROR HERE\");\n }\n}", "public static ResultSet executeSelectQuery(String query){\n\t\tStatement statement = null;\n\t\tResultSet resultSet = null;\n\t\tCachedRowSetImpl cachedRowSet = null;\n\t\ttry{\n\t\t\tconnectDatabase();\n\t\t\tstatement = connection.createStatement();\n\t\t\tresultSet = statement.executeQuery(query);\n\t\t\tcachedRowSet = new CachedRowSetImpl(); // cache the resultset\n\t\t\tcachedRowSet.populate(resultSet);\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}finally {\n\t\t\ttry{\n\t\t\t\t// close the connections\n\t\t\t\tif (resultSet != null) resultSet.close();\n\t\t\t\tif (statement != null) statement.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tdisconnectDatabase();\n\t\t}\n\t\treturn cachedRowSet;\n\t}", "@Test\n\tpublic void db_query_scale() throws Exception\n\t{\n\t\tTemplate t = T(\"<?for row in db.query('select 0.5 as x from dual')?><?print row.x > 0?><?end for?>\");\n\n\t\tConnection db = getDatabaseConnection();\n\n\t\tif (db != null)\n\t\t\tcheckOutput(\"True\", t, V(\"db\", db));\n\t}", "private static void selectRecordsFromDbUserTable() throws SQLException {\n\n\t\tConnection dbConnection = null;\n\t\tStatement statement = null;\n\n\t\tString selectTableSQL = \"SELECT * from spelers\";\n\n\t\ttry {\n\t\t\tdbConnection = getDBConnection();\n\t\t\tstatement = dbConnection.createStatement();\n\n\t\t\tSystem.out.println(selectTableSQL);\n\n\t\t\t// execute select SQL stetement\n\t\t\tResultSet rs = statement.executeQuery(selectTableSQL);\n\n\t\t\twhile (rs.next()) {\n \n String naam = rs.getString(\"naam\");\n\t\t\t\tint punten = rs.getInt(\"punten\");\n \n System.out.println(\"naam : \" + naam);\n\t\t\t\tSystem.out.println(\"punten : \" + punten);\n\t\t\t\t\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\n\t\t\tSystem.out.println(e.getMessage());\n\n\t\t} finally {\n\n\t\t\tif (statement != null) {\n\t\t\t\tstatement.close();\n\t\t\t}\n\n\t\t\tif (dbConnection != null) {\n\t\t\t\tdbConnection.close();\n\t\t\t}\n\n\t\t}\n\n\t}", "public void callQuery(String query) throws SQLException {\n for(int i = 0; i < queryHistory.size(); i++) {\n if(queryHistory.get(i).equalsIgnoreCase(query))\n data.get(i).OUPUTQUERY(data.get(i).getConversionArray(), data.get(i).getResultSet());\n }\n }", "public void getSelect(String query, ArrayList<Object> params) {\r\n\t\tif (null != connection) {\r\n\t\t\tSystem.out.println(QueryProcessor.exec(connection, query, params));\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"Hubo algún error con la conexión...\");\r\n\t\t}\r\n\t}", "SelectQuery createSelectQuery();", "public String execute() throws SQLException {\n try { \n results = postDBSearcher.searchSpecific(title, class_num, class_name, school);\n\n //If the search does not find any results tries the partial search\n if (results.isEmpty()){\n results = postDBSearcher.searchPartiallyGeneral(title, class_num, class_name, school);\n }\n\n //If the partial search did not find anything, then it tries to make a general search\n if (results.isEmpty()){\n results = postDBSearcher.searchGeneral(title, class_num, class_name, school);\n }\n }\n catch (SQLException e) {\n e.printStackTrace();\n }\n return SUCCESS;\n }", "private QueryResult performMappedQuery() throws VizException {\n\n if (database == null) {\n throw new VizException(\"Database not specified for query\");\n }\n if (query == null) {\n throw new VizException(\"Cannot execute null query\");\n }\n\n QlServerRequest request = new QlServerRequest(query);\n request.setDatabase(database);\n request.setType(QueryType.QUERY);\n request.setParamMap(paramMap);\n\n // set the mode so the handler knows what to do\n if (queryLanguage == null) {\n throw new VizException(\"Query language not specified\");\n } else if (queryLanguage.equals(QueryLanguage.HQL)) {\n request.setLang(QlServerRequest.QueryLanguage.HQL);\n } else {\n request.setLang(QlServerRequest.QueryLanguage.SQL);\n }\n\n // create request object\n QueryResult retVal = null;\n // get result\n AbstractResponseMessage response = (AbstractResponseMessage) ThriftClient\n .sendRequest(request);\n\n if (response instanceof ResponseMessageGeneric) {\n retVal = (QueryResult) ((ResponseMessageGeneric) response)\n .getContents();\n\n } else if (response instanceof ResponseMessageError) {\n ResponseMessageError rme = (ResponseMessageError) response;\n VizServerSideException innerException = new VizServerSideException(\n rme.toString());\n throw new VizServerSideException(rme.getErrorMsg(), innerException);\n }\n\n return retVal;\n }", "public abstract DbQuery getQuery(String queryName);", "public void run() {\n List<Map> queries = (List<Map>) server.get(\"queries\");\n Connection connection = null;\n if (queries != null && !queries.isEmpty()) {\n String dbServerDisplayName = (String) server.get(\"displayName\");\n try {\n long timeBeforeConnection = System.currentTimeMillis();\n connection = getConnection();\n long timeAfterConnection = System.currentTimeMillis();\n logger.debug(\"Time taken to get Connection: \" + (timeAfterConnection - timeBeforeConnection));\n\n logger.debug(\"Time taken to get Connection for \" + dbServerDisplayName + \" : \" + (timeAfterConnection - timeBeforeConnection));\n\n if (connection != null) {\n logger.debug(\" Connection successful for server: \" + dbServerDisplayName);\n for (Map query : queries)\n executeQuery(connection, query);\n } else {\n\n logger.debug(\"Null Connection returned for server: \" + dbServerDisplayName);\n }\n\n } catch (SQLException e) {\n logger.error(\"Error Opening connection\", e);\n status = false;\n } catch (ClassNotFoundException e) {\n logger.error(\"Class not found while opening connection\", e);\n status = false;\n } catch (Exception e) {\n logger.error(\"Error collecting metrics for \"+dbServerDisplayName, e);\n status = false;\n }\n finally {\n try {\n if (connection != null) {\n closeConnection(connection);\n }\n } catch (Exception e) {\n logger.error(\"Issue closing the connection\", e);\n }\n }\n }\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}", "public void execute() throws SQLException {\n\t\tif (this.ds == null) {\n\t\t\tthrow new RuntimeException(\n\t\t\t\"Please pass a DataSource to the ListSqlHelper!\");\n\t\t}\n\t\t\n\t\texecuteCountSql();\n\t\texecuteItemRangeSql();\n\t}", "public ResultSet getDatabase(){\n\t\tString join = \"select* from responses natural join projects\";\n\t\tPreparedStatement database = null;\n\t\ttry{\n\t\t\tdatabase = conn.prepareStatement(join);\n\t\t\tResultSet rs = database.executeQuery();\n\t\t\treturn rs;\n\t\t}catch (SQLException e){\n\t\t\treturn null;\n\t\t}\n\t}", "public static ResultSet query(String command) {\r\n\t\tif (isConnected()) try {\r\n\t\t\tConsole.sql(command);\r\n\t\t\treturn con.createStatement().executeQuery(command);\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public ResultSet query(String cql, Object ... values) {\n\t\tLog.v(LOG_TAG, \" Query: \" + cql);\n\t\tList<Object> cqlSafeValues = this.getCqlSafeValues(values);\n\t\ttry {\t\t\t\n\t\t\tPreparedStatement prepared = this.getSession().prepare(cql);\n\t\t\tBoundStatement boundStatement = new BoundStatement(prepared);\n\t\t\tResultSet results;\n\t\t\tif (cqlSafeValues.size() > 0) {\n\t\t\t\tresults = this.getSession().execute(boundStatement.bind(cqlSafeValues.toArray()));\n\t\t\t} else {\n\t\t\t\tresults = this.getSession().execute(boundStatement);\n\t\t\t}\n\t\t\treturn results;\n\t\t} catch (Exception e) {\n\t\t\tLog.e(LOG_TAG, e);\n\t\t\tthrow new DatastoreServiceException(e);\t\t\t\n\t\t}\t\t\n\t}", "public ResultSet executeQuery(String sql) throws SQLException {\n return currentPreparedStatement.executeQuery(sql);\n }", "public void search() throws SQLException;", "public void selectQuery(String query) {\n\t\tQuery q = QueryFactory.create(query);\n\t\tQueryExecution qe = QueryExecutionFactory.create(q, model);\n\t\tResultSet result = qe.execSelect();\n\t\tprintResultSet(result);\n\t\tqe.close();\n\t}", "public ResultSet queryResults(String query, Object... parameters) throws SQLException {\n refreshConnection();\n\n PreparedStatement ps = conn.prepareStatement(query);\n\n for (int i = 0; i < parameters.length; i++) {\n ps.setObject(i + 1, parameters[i]);\n }\n\n if (!keepConnected)\n disconnect();\n return ps.executeQuery();\n }", "public boolean querySql(String sql){\r\n boolean result = true;\r\n try{\r\n stm = con.createStatement();\r\n rss = stm.executeQuery(sql);\r\n }catch(SQLException e){\r\n report = e.toString();\r\n result = false;\r\n }\r\n return result;\r\n }", "public ResultSet ejecutarQuery(String query) throws Exception {\n ResultSet rs = null;\n rs = stmt.executeQuery(query);\n return rs;\n }", "public ResultSet querySelect(String query) throws SQLException {\n\t \t\t// Création de l'objet gérant les requêtes\n\t \t\tstatement = cnx.createStatement();\n\t \t\t\n\t \t\t// Exécution d'une requête de lecture\n\t \t\tResultSet result = statement.executeQuery(query);\n\t \t\t\n\t \t\treturn result;\n\t \t}", "public void query()\n\t{\n\t\tJSONObject queryInfo = new JSONObject();\n\t\t\n\t\ttry\n\t\t{\n\t\t\tqueryInfo.put(\"type\", \"query\");\n\t\t\t\n\t\t\tos.println(queryInfo.toString());\n\t\t\tos.flush();\n\t\t\t\n\t\t\tSystem.out.println(\"send query request : \" + queryInfo.toString());\n\t\t}\n\t\tcatch (JSONException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void execute(Context context) throws SQLException;", "@Override\n public void query(Connection c, SQLEngine engine, Record val, ImmutableList.Builder<Record> result) throws DataException {\n \n Variant varcat = val.get(\"TABLE_CAT\");\n String cat = Variants.isNull(varcat) ? null : varcat.asString();\n \n Variant varschem = val.get(\"TABLE_SCHEM\");\n String schem = Variants.isNull(varschem) ? null : varschem.asString();\n \n Variant varname = val.get(\"TABLE_NAME\");\n String name = Variants.isNull(varname) ? null : varname.asString();\n \n Variant vartype = val.get(\"TABLE_TYPE\");\n String[] tabletypes = Variants.isNull(vartype) ? TABLE_TYPES : new String[]{ vartype.asString() };\n\n try (ResultSet resultset = c.getMetaData().getTables(cat, schem, name, tabletypes)) {\n while (resultset.next()) {\n result.add(read(resultset, val));\n } \n } catch (SQLException ex) {\n throw new DataException(ex);\n }\n }", "private void executeRequest(String sql) {\n\t}", "String queryInformation(String tableName,String queryname){\n Connection con = GetDBConnection.connectDB(\"booklibrarymanager\",\"root\",\"HanDong85\");\n String tar;\n if(tableName.equals(\"authorinformation\"))\n tar = \"author\";\n else if(tableName.equals(\"classificationinformation\"))\n tar = \"classification\";\n else tar = \"press\";\n String sql = \"select \" + tar + \"Id\" + \" from \" + tableName + \" where \";\n if(tableName.equals(\"authorinformation\"))\n sql += \"authorName = ?;\";\n else if(tableName.equals(\"classificationinformation\"))\n sql += \"classifcationName = ?;\";\n else sql += \"pressName = ?;\";\n System.out.println(sql);\n PreparedStatement preSQL;\n try{\n preSQL = con.prepareStatement(sql);\n preSQL.setString(1,queryname);\n ResultSet rs = preSQL.executeQuery();\n rs.beforeFirst();\n if(rs.next()){\n String ans = rs.getString(1);\n GetDBConnection.closeCon(con);\n return ans;\n }\n else{\n GetDBConnection.closeCon(con);\n return ERROR_TIP;\n }\n }\n catch (SQLException e){\n GetDBConnection.closeCon(con);\n return ERROR_TIP;\n }\n }", "public void execute() throws SQLException {\n\t\ttry {\n\t\t\tselect.setUsername(\"INTRANET\");\n\t\t\tselect.setPassword(\"INTRANET\");\n\t\t\tselect.execute();\n\t\t}\n\n\t\t// Liberar recursos del objeto select.\n\t\tfinally {\n\t\t\tselect.close();\n\t\t}\n\t}", "public ResultSet retrieve(Connection con, String query) {\n ResultSet result = null;\n try {\n Statement state = con.createStatement();\n result = state.executeQuery(query); \n } catch (SQLException e) {\n System.err.println(e);\n }\n return result;\n\n }", "public int executeQuery (String query) throws SQLException {\n // creates a statement object\n Statement stmt = this._connection.createStatement ();\n\n // issues the query instruction\n ResultSet rs = stmt.executeQuery (query);\n\n int rowCount = 0;\n\n // iterates through the result set and count nuber of results.\n if(rs.next()){\n rowCount++;\n }//end while\n stmt.close ();\n return rowCount;\n }", "public abstract IStatus performQuery(AbstractRepositoryQuery query, TaskRepository repository,\n \t\t\tIProgressMonitor monitor, ITaskCollector resultCollector);", "@Override\n\tvoid executeQuery(String query) {\n\t\tSystem.out.println(\"Mssql ==> \" + query);\n\t}", "public void fetch(){ \n for(int i = 0; i < this.queries.size(); i++){\n fetch(i);\n }\n }", "public List<T> find(DBObject dbObjectQuery) throws NoSQLException;", "private String stageDetailsFromDB(String queryString){\n\t\tString RET=\"\";\n\t\ttry\n\t\t{\n\t\t\tcon = Globals.getDatasource().getConnection();\n\t\t\tps = con.prepareStatement(queryString); \n\t\t\tresult = ps.executeQuery();\n\t\t\tif (result.first()) {\n\t\t\t\tRET = result.getString(1);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\tcatch(SQLException sqle){sqle.printStackTrace();}\n\t\tfinally {\n\t\t Globals.closeQuietly(con, ps, result);\n\t\t}\n\t\treturn RET;\n\t}", "protected int execSQLHelper(\n \t\tint databaseHandle,\n \t\tString sql,\n \t\tObject[] params)\n \t{\n \t\tif (!hasDatabase(databaseHandle))\n \t\t{\n \t\t\treturn MA_DB_ERROR;\n \t\t}\n \n \t\tMoDatabase database = getDatabase(databaseHandle);\n \n \t\ttry\n \t\t{\n \t\t\t//Log.i(\"@@@@@\", \"execSQLHelper query: \" + sql);\n \t\t\tMoCursor cursor = database.execQuery(sql, params);\n \t\t\tif (null != cursor)\n \t\t\t{\n \t\t\t\t++mCursorCounter;\n \t\t\t\taddCursor(mCursorCounter, cursor);\n \t\t\t\treturn mCursorCounter;\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\treturn MA_DB_OK;\n \t\t\t}\n \t\t}\n \t\tcatch (SQLiteException ex)\n \t\t{\n \t\t\tLog.e(\"@@@@@\", \"execSQLHelper exception: \" + ex);\n \t\t\tex.printStackTrace();\n \n \t\t\tlogStackTrace(ex);\n \t\t\treturn MA_DB_ERROR;\n \t\t}\n \t}", "public ResultSet app(Long broker_id)throws SQLException {\n\trs=DbConnect.getStatement().executeQuery(\"select * from broker where broker_id=\"+broker_id+\"\");\r\n\treturn rs;\r\n}", "public abstract void applyToQuery(DatabaseQuery theQuery, GenerationContext context);", "public void execute (String query) throws java.sql.SQLException {\n try {\n /*\n if (query.indexOf('(') != -1)\n Logger.write(\"VERBOSE\", \"DB\", \"execute(\\\"\" + query.substring(0,query.indexOf('(')) + \"...\\\")\");\n else\n Logger.write(\"VERBOSE\", \"DB\", \"execute(\\\"\" + query.substring(0,20) + \"...\\\")\");\n */\n Logger.write(\"VERBOSE\", \"DB\", \"execute(\\\"\" + query + \"\\\")\");\n \n Statement statement = dbConnection.createStatement();\n statement.setQueryTimeout(30);\n dbConnection.setAutoCommit(false);\n statement.executeUpdate(query);\n dbConnection.commit();\n dbConnection.setAutoCommit(true);\n } catch (java.sql.SQLException e) {\n Logger.write(\"ERROR\", \"DB\", \"SQLException: \" + e);\n throw e;\n }\n }", "BoundQuery<?,Ttuple> query(Query q,Focus<?> context)\n throws DataException;", "public ResultSet executeQueryStatement(String statement) throws SQLException {\n\t\tStatement sqlStmt = connection.createStatement();\n\n\t\t// execute the statement and check whether there is a result\n\t\treturn sqlStmt.executeQuery(statement);\n\t}", "public void query(ComplexCar[] cars) throws DatabaseTestException;", "private DbQuery() {}", "public DatabaseQuery getQuery() {\n return query;\n }", "public boolean query(String sql, boolean showResult) {\r\n \t\tStatement st = null;\r\n \t\tResultSet rs = null;\r\n \t\tboolean hasContent = false;\r\n \t\ttry {\r\n \t\t\tst = conn.createStatement();\r\n \t\t\tMsg.debugMsg(DB_REGULAR.class, \"executing query: \" + sql);\r\n \t\t\trs = st.executeQuery(sql);\r\n \t\t\thasContent = !rs.isBeforeFirst();\r\n \t\t\tif (showResult) {\r\n \t\t\t\tshowResultSetContent(rs);\r\n \t\t\t}\r\n \t\t\treturn hasContent;\r\n \t\t} catch (SQLException e) {\r\n \t\t\te.printStackTrace();\r\n \t\t} finally {\r\n \t\t\ttry {\r\n \t\t\t\tst.close();\r\n \t\t\t} catch (SQLException e) {\r\n \t\t\t\te.printStackTrace();\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn showResult;\r\n \r\n \t}", "public void run()\n\t\t\t{\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(5000);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\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 * Process Query Here\n\t\t\t\t * \n\t\t\t\t **/\n\t\t\t}" ]
[ "0.7636167", "0.70980203", "0.695933", "0.6812034", "0.67661244", "0.6430422", "0.64062285", "0.632048", "0.6315168", "0.63119686", "0.6260086", "0.6256128", "0.6237437", "0.6226796", "0.61848885", "0.61839455", "0.617273", "0.61486346", "0.6135229", "0.60870165", "0.60856587", "0.6084572", "0.60560983", "0.60511905", "0.6035016", "0.6032104", "0.6031921", "0.60065055", "0.60059446", "0.60014564", "0.59772116", "0.59217376", "0.5911719", "0.5859898", "0.5853393", "0.5847637", "0.5842085", "0.5836696", "0.5836662", "0.5830623", "0.5811728", "0.57914585", "0.57909966", "0.5787805", "0.5760143", "0.5755528", "0.57439804", "0.5738776", "0.5737193", "0.5726487", "0.57246476", "0.5695791", "0.569183", "0.5680413", "0.56788963", "0.56774807", "0.56514263", "0.56452435", "0.5645011", "0.5642045", "0.5639379", "0.5631213", "0.5628", "0.5617803", "0.5616906", "0.56129223", "0.56073314", "0.55898255", "0.5586966", "0.55844533", "0.55808365", "0.5576856", "0.5574781", "0.5570066", "0.5563196", "0.5544622", "0.552798", "0.55275387", "0.5505952", "0.55042946", "0.5503028", "0.5491435", "0.54913384", "0.54793906", "0.5477757", "0.5475728", "0.54649866", "0.5464068", "0.54521865", "0.5446049", "0.5426858", "0.5424772", "0.5420231", "0.5418237", "0.5413856", "0.540824", "0.54073286", "0.53946596", "0.539365", "0.5388059", "0.5386215" ]
0.0
-1
Returns a Cursor positioned at the species detail specified by rowId
public Cursor getSpeciesDetails(String identifier, String[] columns) { String selection = BaseColumns._ID + " = ?"; String[] selectionArgs = new String[] { identifier }; Log.d(TAG, "Getting species details for: " + identifier); return query(SPECIES_TABLE_NAME, columns, selection, selectionArgs, null, null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Cursor fetchById(long rowId) {\n\t\tCursor cursor = db.query(tableName, fields, fields[0] + \" = \" + rowId, null, null, null, null);\n\t\tif (cursor != null) {\n\t\t\tcursor.moveToFirst();\n\t\t}\n\t\treturn cursor;\n\t}", "public Cursor fetchPreg(long rowId) throws SQLException {\n\n Cursor mCursor =\n\n mDb.query(true, DATABASE_TABLE, new String[] {KEY_ROWID,\n KEY_TITLE, KEY_TIME, KEY_BODY}, KEY_ROWID + \"=\" + rowId, null,\n null, null, null, null);\n if (mCursor != null) {\n mCursor.moveToFirst();\n }\n return mCursor;\n\n }", "public Cursor getItem(long rowId) throws SQLException {\n\t\tCursor mCursor = db.query(true, TABLE_EVENTS, new String[] { ROW_ID,ROW_TITLE, ROW_DATE, ROW_TIME, ROW_DATETIME, ROW_INFO,\n\t\t\tROW_REPEAT,ROW_REPEAT_TEXT, ROW_REPEAT_CNT, ROW_REPEAT_TYPE_ID,ROW_REPEAT_TYPE_TEXT,\n\t\t\tROW_BEFORE,ROW_BEFORE_TEXT, ROW_BEFORE_CNT,ROW_BEFORE_TYPE_ID,ROW_BEFORE_TYPE_TEXT,\n\t\t\t\t\t\t\t\t ROW_ACTIVE }, ROW_ID + \"=\"\n\t\t\t\t+ rowId, null, null, null, null, null);\n\t\tif (mCursor != null) {\n\t\t\tmCursor.moveToFirst();\n\t\t}\n\t\treturn mCursor;\n\t}", "public Cursor fetchEntry(long rowId) throws SQLException {\n\t return mDb.query(true, DATABASE_TABLE, null, KEY_ROWID + \"=\" + rowId, null, null, null, null, null);\n }", "public Cursor getPlayer(long rowId) throws SQLException {\r\n\r\n\t\tCursor mCursor =\r\n\n this.mDb.query(true, DATABASE_TABLE, new String[] { ROW_ID, USERNAME,PASSWORD,FIRSTNAME,\r\n \t\tFAMILYNAME,MAIL,RELIABILITY,POSITION,CITY,BIRTHDATE, IMGPATH}, \r\n \t\tROW_ID + \"=\" + rowId, null, null, null, null, null);\r\n if (mCursor != null) {\r\n mCursor.moveToFirst();\r\n }\r\n return mCursor;\r\n }", "public Cursor getDriveSequence(long rowId) {\n \t\n \tSQLiteQueryBuilder queryBuilder = new SQLiteQueryBuilder();\n \t\n \tqueryBuilder.setTables(\n \t\t\tTABLE_DRIVESEQ + \" LEFT OUTER JOIN \" + TABLE_VEHICLETYPE + \n \t\t\t\" ON \" + DS_VEHICLE_TYPE_ID + \" = \" + VT_FULL_ID\n \t\t\t);\n \t\n \tCursor mCursor = queryBuilder.query(mDb, null, DS_FULL_ID + \"=\" + rowId, null, null, null, null);\n\n \treturn mCursor;\n }", "public Cursor fetchById(long rowId) {\n\t\tCursor cursor = db.query(CertificationConstants.DB_TABLE, CertificationConstants.fields(), CertificationConstants.FIELD_ROWID + \" = \" + rowId, null, null, null, null);\n\t\tif (cursor != null) {\n\t\t\tcursor.moveToFirst();\n\t\t}\n\t\treturn cursor;\n\t}", "public Cursor getRowData(long rowId) {\n\n String where = KEY_ROWID + \"=\" + rowId;\n Cursor c = db.query(true, DATA_TABLE, null, where, null, null, null, null, null);\n if (c != null) {\n c.moveToFirst();\n }\n return c;\n\n }", "public Cursor ObtenerDato(long rowId) throws SQLException\n {\n Cursor mCursor =\n db.query(true, DATABASE_TABLE, new String[] {KEY_ROWID,\n KEY_ATRIBUTO01, KEY_ATRIBUTO02}, KEY_ROWID + \"=\" + rowId, null,\n null, null, null, null);\n if (mCursor != null) {\n mCursor.moveToFirst();\n }\n return mCursor;\n }", "public Cursor getContact(long rowId) throws SQLException\n {\n Cursor mCursor = db.query(true, DATABASE_TABLE, new String[] {KEY_ROWID,\n KEY_NAME,KEY_EMAIL},KEY_ROWID + \"=\" + rowId,null,null,null,null,null);\n if(mCursor != null)\n {\n mCursor.moveToFirst();\n }\n return mCursor;\n }", "public Cursor fetchById(long rowId) {\n\t\tCursor cursor = db.query(UserConstants.DB_TABLE, UserConstants.fields(), UserConstants.FIELD_ROWID + \" = \" + rowId, null, null, null, null);\n\t\tif (cursor != null) {\n\t\t\tcursor.moveToFirst();\n\t\t}\n\t\treturn cursor;\n\t}", "public Cursor getConfig(long rowId) throws SQLException {\n\t\tCursor mCursor = db.query(true, TABLE_NAME, new String[] { ROW_ID,\n\t\t\t\tROW_NAMES[0], ROW_NAMES[1], ROW_NAMES[2], ROW_NAMES[3],\n\t\t\t\tROW_NAMES[4], ROW_NAMES[5], ROW_NAMES[6] }, ROW_ID + \"=\"\n\t\t\t\t+ rowId, null, null, null, null, null);\n\t\tif (mCursor != null) {\n\t\t\tmCursor.moveToFirst();\n\t\t}\n\t\treturn mCursor;\n\t}", "public Cursor fetchHotel(long rowId) throws SQLException {\r\n\r\n Cursor mCursor =\r\n\r\n mDb.query(true, DATABASE_TABLE, new String[] {KEY_ROWID, KEY_TYPE,\r\n KEY_NAME, KEY_DESC, KEY_ADDR, KEY_MINS, KEY_RATE, KEY_PHONE, KEY_WEB}, KEY_ROWID + \"=\" + rowId, null,\r\n null, null, null, null);\r\n if (mCursor != null) {\r\n mCursor.moveToFirst();\r\n }\r\n return mCursor;\r\n\r\n }", "static public Cursor readCursor(Context context, int[] id) {\r\n // Build WHERE clause\r\n StringBuilder positionSelBuilder = new StringBuilder();\r\n ArrayList<String> positionSelArgsList = new ArrayList<String>();\r\n positionSelBuilder.append(GuardTrackerContract.PositionTable._ID);\r\n positionSelBuilder.append(\" LIKE ?\");\r\n positionSelArgsList.add(\"\" + id[0]);\r\n for (int i = 1; i < id.length; i++) {\r\n // Define columns WHERE clause.\r\n positionSelBuilder.append(\" OR \");\r\n positionSelBuilder.append(GuardTrackerContract.PositionTable._ID);\r\n positionSelBuilder.append(\" LIKE ?\");\r\n positionSelArgsList.add(\"\" + id[i]);\r\n }\r\n // Define columns WHERE clause.\r\n String positionSelection = positionSelBuilder.toString();\r\n // Define values WHERE clause.\r\n String[] positionSelArgs = new String[positionSelArgsList.size()];\r\n positionSelArgs = positionSelArgsList.toArray(positionSelArgs);\r\n Cursor cursor = readRawCursor(context, positionSelection, positionSelArgs);\r\n return cursor;\r\n }", "public Cursor fetchNote(long rowId) throws SQLException {\n\n Cursor mCursor = database.query(true, NOTES_TABLE, new String[] {KEY_NOTES_ROWID, KEY_NOTES_TITLE, KEY_NOTES_BODY}, KEY_NOTES_ROWID + \"=\" + rowId, null,\n null, null, null, null);\n if (mCursor != null) {\n mCursor.moveToFirst();\n }\n return mCursor;\n\n }", "public Cursor fetchFavorite(long rowId) throws SQLException {\n\n Cursor mCursor =\n\n mDb.query(true, DATABASE_TABLE_FAVORITES, new String[] {KEY_ROWID,\n KEY_TITLE, KEY_BODY}, KEY_ROWID + \"=\" + rowId, null,\n null, null, null, null);\n if (mCursor != null) {\n mCursor.moveToFirst();\n }\n return mCursor;\n\n }", "public Cursor fetchOneEntry(long rowId) throws SQLException {\n /*\n Cursor cursor = database.query(\n true, \n DATABASE_TABLE, \n new String[] {ROWID, LATITUDE, LONGITUDE, FREQUENCY, SIGNAL },\n ROWID + \"=\" + rowId, \n null, \n null, \n null, \n null, \n null);\n if (cursor != null) {\n cursor.moveToFirst();\n }\n return cursor;\n */\n \n // sql must NOT be ';' terminated\n String sql = \"SELECT \"+ ROWID + \", \" + MAC_ADDRESS + \", \" + LATITUDE + \", \" + LONGITUDE + \", \" \n + NETWORK_NAME + \", \" + CAPABILITIES + \", \" + FREQUENCY + \", \" + SIGNAL + \" \"\n + \"FROM \" + DATABASE_TABLE + \" \"\n + \"WHERE \" + ROWID + \" = \" + rowId;\n return database.rawQuery(sql, null);\n }", "public Cursor getFenStringsById(int rowId) throws SQLException {\n Cursor mCursor = db.query(true, DATABASE_TABLE_FENLIST, new String[]{\n fenList_GameId, fenList_FenString, fenList_timerOne, fenList_timerTwo}, fenList_GameId + \"=\" + rowId, null, null, null, null, null);\n if (mCursor != null) {\n mCursor.moveToFirst();\n }\n return mCursor;\n }", "public abstract Cursor buildCursor();", "Position selectByPrimaryKey(Integer id);", "public Cursor fetchCourse(long rowId) throws SQLException\r\n{\r\nCursor mCursor = database.query(true, DATABASE_TABLE, new String[] { KEY_ROWID, KEY_CATEGORY, KEY_COURSENAME, KEY_ASSIGNMENTNAME, KEY_DESCRIPTION, KEY_DUEDATE, KEY_COMPLETED }, null, null, null,\r\nnull, null, null);\r\nif (mCursor != null)\r\n{\r\nmCursor.moveToFirst();\r\n}\r\nreturn mCursor;\r\n}", "public Cursor getAgency(long rowId) throws SQLException {\n\t\t\tCursor mCursor = \n\t\t\t\tdb.query(true, AGENCIES_TABLE, new String[] {\n\t\t\t\t\tKEY_ROWID,\n\t\t\t\t\tKEY_AGENCYID,\n\t\t\t\t\tKEY_AGENCYNAME,\n\t\t\t\t\tKEY_AGENCYURL,\n\t\t\t\t\tKEY_AGENCYTIMEZONE,\n\t\t\t\t\tKEY_AGENCYLANG,\n\t\t\t\t\tKEY_AGENCYPHONE}, \n\t\t\t\t\tKEY_ROWID + \"=\" + rowId,\n\t\t\t\t\tnull,\n\t\t\t\t\tnull,\n\t\t\t\t\tnull,\n\t\t\t\t\tnull,\n\t\t\t\t\tnull);\n\t\t\tif (mCursor != null) {\n\t\t\t\tmCursor.moveToFirst();\n\t\t\t}\n\t\t\treturn mCursor;\n\t\t}", "public abstract long getCursor();", "BannerPosition selectBannerPositionByPrimaryKey(Integer id) throws SQLException;", "TCpySpouse selectByPrimaryKey(Integer id);", "public Cursor queryTheCursorLocation() { \n\t Cursor c = db.rawQuery(\"SELECT * FROM \"+ DBEntryContract.LocationEntry.TABLE_NAME, null); \n\t return c; \n\t}", "public Cursor queryTheCursorLocation(int locationID) { \n\t Cursor c = db.rawQuery(\"SELECT * FROM \"+ DBEntryContract.LocationEntry.TABLE_NAME + \" WHERE \" + DBEntryContract.LocationEntry._ID + \" = \" + String.valueOf(locationID), null); \n\t return c; \n\t}", "public Cursor getAllShirtsCursor() {\n String selectQuery = \"SELECT * FROM \" + ShirtEntry.TABLE_NAME;\n\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor c = db.rawQuery(selectQuery, null);\n\n return c;\n }", "private Cursor getCursorObject() {\n SQLiteDatabase db = mDbHelper.getReadableDatabase();\n\n // Define a projection that specifies which columns from the database\n // you will actually use after this query.\n String[] projection = {\n HabbitContract.HabbitEntry._ID,\n HabbitContract.HabbitEntry.COLUMN_HAD_BREAKFAST,\n HabbitContract.HabbitEntry.COLUMN_BREAKFAST_MEAL,\n HabbitContract.HabbitEntry.COLUMN_HAD_LUNCH,\n HabbitContract.HabbitEntry.COLUMN_LUNCH_MEAL,\n HabbitContract.HabbitEntry.COLUMN_HAD_SUPPER,\n HabbitContract.HabbitEntry.COLUMN_SUPPER_MEAL,\n HabbitContract.HabbitEntry.COLUMN_ADDITIONAL_DATA,\n HabbitContract.HabbitEntry.COLUMN_DATETIME_STAMP};\n\n // Perform a query on the nutrition table\n Cursor cursor = db.query(\n HabbitContract.HabbitEntry.TABLE_NAME, // The table to query\n projection, // The columns to return\n null, // The columns for the WHERE clause\n null, // The values for the WHERE clause\n null, // Don't group the rows\n null, // Don't filter by row groups\n null); // The sort order\n\n return cursor;\n }", "public Cursor getSettingsById(int rowId) throws SQLException {\n Cursor mCursor = db.query(true, DATABASE_TABLE_GAMES, new String[]{\n games_GameMode, games_LearningTool, games_ThemeId, games_TimeLimit}, games_GameId+ \"=\" + rowId, null, null, null, null, null);\n if (mCursor != null) {\n mCursor.moveToFirst();\n }\n return mCursor;\n }", "public Cursor getInventoryItemsCursor(int characterId) {\n\n\t\tCursor invCursor = getReadableDatabase()\n\t\t\t\t.rawQuery(\n\t\t\t\t\t\t\"SELECT \"\n\t\t\t\t\t\t\t\t+ \"character.character_id,\"\n\t\t\t\t\t\t\t\t+ \"inventory_item._id,\"\n\t\t\t\t\t\t\t\t+ \"inventory_item.name AS 'item_name',\"\n\t\t\t\t\t\t\t\t+ \"inventory_item.description AS 'item_description'\"\n\t\t\t\t\t\t\t\t+ \"FROM character \"\n\t\t\t\t\t\t\t\t+ \"INNER JOIN inventory_item ON inventory_item.character_id = character.character_id \"\n\t\t\t\t\t\t\t\t+ \"WHERE character.character_id = ?\",\n\t\t\t\t\t\tnew String[] { \"\" + characterId });\n\t\tinvCursor.moveToFirst();\n\n\t\treturn invCursor;\n\t}", "public int getCursor() { return curs; }", "public Cursor getSpecificStatForCharacterCursor(int charId, int statId) {\n\t\tSQLiteDatabase db = getReadableDatabase();\n\t\tString[] whereArgs = new String[2];\n\t\twhereArgs[0] = Integer.toString(charId);\n\t\twhereArgs[1] = Integer.toString(statId);\n\t\tCursor statCursor = db.rawQuery(\n \"SELECT * FROM character_stat WHERE character_id=? and _id=?\",\n whereArgs);\n statCursor.moveToFirst();\n return statCursor;\n\t}", "public CampusEvent fetchEventByIndex(long rowId) throws SQLException {\n SQLiteDatabase dbObj = getReadableDatabase();\n CampusEvent event = null;\n\n Cursor cursor = dbObj.query(true, TABLE_EVENT_ENTRIES, mColumnList,\n KEY_ROWID + \"=\" + rowId, null, null, null, null, null);\n\n if (cursor.moveToFirst()) {\n event = cursorToEvent(cursor);\n }\n\n cursor.close();\n dbObj.close();\n\n return event;\n }", "public Cursor getState( final String rowId, final String[] columns ) {\n String selection = \"rowid = ?\";\n String[] selectionArgs = new String[] {rowId};\n\n return query(selection, selectionArgs, columns);\n }", "Procdef selectByPrimaryKey(String id);", "private Cursor getCursorData() {\n\t\tDBAdventureHelper enclosingInstance = new DBAdventureHelper();\r\n\t\tDBAdventureHelper.AdventureDBHelper mDbHelper = enclosingInstance.new AdventureDBHelper(this);\r\n\t\t// Get the data repository in read mode\r\n\t\tSQLiteDatabase db = mDbHelper.getReadableDatabase();\r\n\r\n\t\t// Projection defines which DB cols you will be pulled from the query\r\n\t\t// Cursor queries the database with the provided parameters; pulling record where ID col == Adventure ID\r\n\t\tCursor c = db.query(\r\n\t\t\t\tAdventureContract.AdventuresTable.ADVENTURES_TABLE_NAME, \t\t\t\t\t\t\t\t\t// The table to query\r\n\t\t\t projection, \t\t\t\t\t\t\t\t\t\t\t\t\t// The columns to return\r\n\t\t\t null,\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The columns for the WHERE clause\r\n\t\t\t null, \t \t\t\t\t\t\t\t\t \t\t\t\t\t\t\t// The values for the WHERE clause\r\n\t\t\t null, \t\t\t\t\t\t\t\t\t\t\t\t\t// don't group the rows\r\n\t\t\t null, \t\t\t\t\t\t\t\t\t\t\t\t\t// don't filter by row groups\r\n\t\t\t \"DESC\" \t\t \t\t\t\t\t\t\t\t\t\t\t\t\t// The sort order\r\n\t\t);\r\n\t\tc.moveToFirst();\r\n\t return c;\r\n\t }", "public Cursor getCursor()\n {\n// Object localObject1;\n// if (!this.mCursorValid)\n// {\n// this.mCursor = new EsMatrixCursor(PROJECTION);\n// this.mCursorValid = true;\n// if ((this.mLocalProfilesLoaded) && (this.mGaiaIdsAndCirclesLoaded))\n// {\n// localObject1 = new HashSet();\n// HashSet localHashSet = new HashSet();\n// Object localObject3 = this.mLocalProfiles.iterator();\n// while (true)\n// {\n// long l1;\n// if (!((Iterator)localObject3).hasNext())\n// {\n// localObject5 = this.mContacts.iterator();\n// while (true)\n// {\n// if (!((Iterator)localObject5).hasNext())\n// {\n// localObject2 = this.mPublicProfiles.iterator();\n// while (true)\n// {\n// if (!((Iterator)localObject2).hasNext())\n// {\n// localObject3 = this.mPublicProfiles.iterator();\n// while (true)\n// {\n// if (!((Iterator)localObject3).hasNext())\n// {\n// localObject1 = this.mCursor;\n// break;\n// }\n// localObject4 = (PublicProfile)((Iterator)localObject3).next();\n// localObject2 = ((PublicProfile)localObject4).gaiaId;\n// if (((HashSet)localObject1).contains(localObject2))\n// continue;\n// localObject5 = this.mCursor;\n// arrayOfObject = new Object[11];\n// l1 = this.mNextId;\n// this.mNextId = (1L + l1);\n// arrayOfObject[0] = Long.valueOf(l1);\n// arrayOfObject[1] = ((PublicProfile)localObject4).personId;\n// arrayOfObject[2] = null;\n// arrayOfObject[3] = localObject2;\n// arrayOfObject[4] = ((PublicProfile)localObject4).name;\n// arrayOfObject[5] = null;\n// arrayOfObject[6] = null;\n// arrayOfObject[7] = null;\n// arrayOfObject[8] = null;\n// arrayOfObject[9] = null;\n// arrayOfObject[10] = ((PublicProfile)localObject4).snippet;\n// ((EsMatrixCursor)localObject5).addRow(arrayOfObject);\n// }\n// }\n// localObject3 = (PublicProfile)((Iterator)localObject2).next();\n// localObject5 = ((PublicProfile)localObject3).gaiaId;\n// localObject4 = (String)this.mGaiaIdsAndCircles.get(localObject5);\n// if ((((HashSet)localObject1).contains(localObject5)) || (TextUtils.isEmpty((CharSequence)localObject4)))\n// continue;\n// ((HashSet)localObject1).add(localObject5);\n// localObject6 = this.mCursor;\n// Object[] arrayOfObject = new Object[11];\n// l1 = this.mNextId;\n// this.mNextId = (1L + l1);\n// arrayOfObject[0] = Long.valueOf(l1);\n// arrayOfObject[1] = ((PublicProfile)localObject3).personId;\n// arrayOfObject[2] = null;\n// arrayOfObject[3] = localObject5;\n// arrayOfObject[4] = ((PublicProfile)localObject3).name;\n// arrayOfObject[5] = localObject4;\n// arrayOfObject[6] = null;\n// arrayOfObject[7] = null;\n// arrayOfObject[8] = null;\n// arrayOfObject[9] = null;\n// arrayOfObject[10] = null;\n// ((EsMatrixCursor)localObject6).addRow(arrayOfObject);\n// }\n// }\n// localObject3 = (Contact)((Iterator)localObject5).next();\n// if (l1.contains(((Contact)localObject3).name))\n// continue;\n// localObject2 = this.mCursor;\n// localObject4 = new Object[11];\n// l2 = this.mNextId;\n// this.mNextId = (1L + l2);\n// localObject4[0] = Long.valueOf(l2);\n// localObject4[1] = ((Contact)localObject3).personId;\n// localObject4[2] = ((Contact)localObject3).lookupKey;\n// localObject4[3] = null;\n// localObject4[4] = ((Contact)localObject3).name;\n// localObject4[5] = null;\n// localObject4[6] = null;\n// localObject4[7] = ((Contact)localObject3).email;\n// localObject4[8] = ((Contact)localObject3).phoneNumber;\n// localObject4[9] = ((Contact)localObject3).phoneType;\n// localObject4[10] = null;\n// ((EsMatrixCursor)localObject2).addRow(localObject4);\n// }\n// }\n// Object localObject6 = (LocalProfile)((Iterator)localObject3).next();\n// Object localObject2 = ((LocalProfile)localObject6).gaiaId;\n// ((HashSet)localObject1).add(localObject2);\n// l1.add(((LocalProfile)localObject6).name);\n// Object localObject4 = this.mCursor;\n// Object localObject5 = new Object[11];\n// long l2 = this.mNextId;\n// this.mNextId = (1L + l2);\n// localObject5[0] = Long.valueOf(l2);\n// localObject5[1] = ((LocalProfile)localObject6).personId;\n// localObject5[2] = null;\n// localObject5[3] = localObject2;\n// localObject5[4] = ((LocalProfile)localObject6).name;\n// localObject5[5] = ((LocalProfile)localObject6).packedCircleIds;\n// localObject5[6] = ((LocalProfile)localObject6).email;\n// localObject5[7] = null;\n// localObject5[8] = ((LocalProfile)localObject6).phoneNumber;\n// localObject5[9] = ((LocalProfile)localObject6).phoneType;\n// localObject5[10] = null;\n// ((EsMatrixCursor)localObject4).addRow(localObject5);\n// }\n// }\n// localObject1 = this.mCursor;\n// }\n// else\n// {\n// localObject1 = this.mCursor;\n// }\n// return (Cursor)(Cursor)(Cursor)(Cursor)(Cursor)(Cursor)localObject1;\n return null;\n }", "@Nullable\n\tprotected abstract T readCursor(ResultSet rs, int currentRow) throws SQLException;", "public Cursor getCursor() throws SQLException\n {\n Cursor c = db.query( true, C_TABLA, columnas, null, null, null, null, null, null);\n\n return c;\n }", "public Cursor getRecord(int id) {\n Cursor res = db.rawQuery( \"select * from TRACKRECORD where TRACKID=\"+id+\"\", null );\n return res;\n }", "BaseCountract selectByPrimaryKey(Integer cId);", "public Cursor fetchFeed(int rowId) throws SQLException {\r\n final Cursor mCursor = mDB.query(true, Tables.FEED_SOURCE, new String[] {KEY_ROWID,\r\n FEED_NAME, FEED_URL,XML_ENCODING}, KEY_ROWID + \"=\" + rowId, null,\r\n null, null, null, null);\r\n if (mCursor != null) {\r\n mCursor.moveToFirst();\r\n }\r\n return mCursor;\r\n }", "public Cursor queryTheCursorLocationFromCategory(int categoryID) { \n\t Cursor c = db.rawQuery(\"SELECT * FROM \"+ DBEntryContract.LocationEntry.TABLE_NAME + \" WHERE \" + DBEntryContract.LocationEntry.COLUMN_NAME_CATEGORY + \" = \" + String.valueOf(categoryID), null); \n\t return c; \n\t}", "public Cursor getForwadEntry(String idi) {\n\t\tString countQuery = \"SELECT * FROM \" + DATABASE_TABLE5 +\" WHERE \"+Sales_Id+\" = '\"+idi+\"'\";\n\n\t Cursor cursor = ourDatabase.rawQuery(countQuery, null);\n\t \n\t\treturn cursor;\n\t\n\t}", "DataFrameCursor<R,C> cursor();", "public int cursor();", "public Cursor getNotesDataCursor(int characterId) {\n\t\t// Log.i(\"AlterEgos::CharacterDBHelper::characterId\", \"characterId \" + characterId);\n\t\t// Verify that the name and description columns exist\n\t\t// This is done here because\n\t\tCursor notesCursor = getReadableDatabase()\n\t\t\t\t.rawQuery(\n\t\t\t\t\t\t\"SELECT \"\n\t\t\t\t\t\t\t\t+ \"character.character_id,\"\n\t\t\t\t\t\t\t\t+ \"notes_data._id,\"\n\t\t\t\t\t\t\t\t+ \"notes_data.subject AS 'notes_subject',\"\n\t\t\t\t\t\t\t\t+ \"notes_data.description AS 'notes_description'\"\n\t\t\t\t\t\t\t\t+ \"FROM character \"\n\t\t\t\t\t\t\t\t+ \"INNER JOIN notes_data ON notes_data.character_id = character.character_id \"\n\t\t\t\t\t\t\t\t+ \"WHERE character.character_id = ?\",\n\t\t\t\t\t\tnew String[] { \"\" + characterId });\n\t\tnotesCursor.moveToFirst();\n\n\t\treturn notesCursor;\n\t}", "int getRowId();", "int getRowId();", "int getRowId();", "int getRowId();", "int getRowId();", "public Cursor getPersonById(int personId) throws SQLException {\r\n\t\tCursor mCursor = db.query(true, DATABASE_TABLE, new String[] {\r\n\t\t\t\tKEY_PERSON_ID, KEY_NAME, KEY_GROUP_ID, KEY_GIFTEE_1_ID,\r\n\t\t\t\tKEY_GIFTEE_2_ID, KEY_NUM_TIMES_SELECTED }, KEY_PERSON_ID + \"=\"\r\n\t\t\t\t+ personId, null, null, null, null, null);\r\n\t\treturn mCursor;\r\n\t}", "SpecialCircumstance selectByPrimaryKey(Long id);", "public ZyCorporation selectByPrimaryKey(Integer rowid) {\r\n ZyCorporation key = new ZyCorporation();\r\n key.setRowid(rowid);\r\n ZyCorporation record = (ZyCorporation) getSqlMapClientTemplate().queryForObject(\"zy_corporation.selectByPrimaryKey\", key);\r\n return record;\r\n }", "public Cursor getdumEntry(String idi) {\n\t\tString countQuery = \"SELECT * FROM \" + DATABASE_TABLE +\" WHERE \"+Drum_RowID+\" = \"+idi;\n\n\t Cursor cursor = ourDatabase.rawQuery(countQuery, null);\n\t \n\t\treturn cursor;\n\t\n\t}", "public void setCursor(int row, int col);", "public Cursor getCursor() throws RelationException;", "Tourst selectByPrimaryKey(String id);", "TRepairs selectByPrimaryKey(Integer id);", "public Cursor getCells(String location) { \t\n \treturn db.query(DATABASE_TABLE_CELL, new String[] {KEY_CELL_ROWID, KEY_CELL_LOCATION, KEY_CELL_LAC, KEY_CELL_CELLID}, KEY_CELL_LOCATION + \"=\" + location , null, null, null, null); \n }", "public SingleRowCursor(Row row) {\n this.row = row;\n }", "HelpInfo selectByPrimaryKey(Integer hId);", "public Cursor getSalesEntry(String id) {\n\t\tString countQuery = \"SELECT * FROM \" + DATABASE_TABLE2 +\" WHERE \"+Sales_Id+\" = \"+id;\n\n\t Cursor cursor = ourDatabase.rawQuery(countQuery, null);\n\t \n\t\treturn cursor;\n\t\n\t}", "public String getIdForRow(int row);", "SysCode selectByPrimaryKey(String id);", "public Cursor fetch(Long failedActionParameterID) {\n if (failedActionParameterID == null) {\n throw new IllegalArgumentException(\"primary key null.\");\n }\n // Set selectionArgs, groupBy, having, orderBy and limit to be null.\n Cursor mCursor = database.query(true, DATABASE_TABLE, KEYS, KEY_FAILEDACTIONPARAMETERID + \"=\"\n + failedActionParameterID, null, null, null, null, null);\n if (mCursor != null) {\n mCursor.moveToFirst();\n }\n return mCursor;\n }", "public Cursor getStatsForCharacterCursor(int charId) {\n\t\tSQLiteDatabase db = getReadableDatabase();\n\t\tString[] whereArgs = new String[1];\n\t\twhereArgs[0] = Integer.toString(charId);\n\t\tCursor statCursor = db\n\t\t\t\t.rawQuery(\n\t\t\t\t\t\t\"SELECT * FROM character_stat WHERE character_id=?\",\n\t\t\t\t\t\twhereArgs);\n statCursor.moveToFirst();\n return statCursor;\n\t}", "ClinicalData selectByPrimaryKey(Long id);", "PrhFree selectByPrimaryKey(Integer id);", "YzStiveExplosion selectByPrimaryKey(Integer id);", "public Cursor loadRecipe(int id){\r\n Cursor c = db.query(recipes.TABLENAME, new String[]{recipes.TITLE, recipes.IMAGE, recipes.INGREDIENTS, recipes.STEPS, recipes.TYPE, recipes.TIME, recipes.PEOPLE, recipes.IDRECIPE}, recipes.IDRECIPE + \"=\" + id, null, null, null, null);\r\n if (c != null) c.moveToFirst();\r\n return c;\r\n }", "private Cursor getAccessibleHoard() {\n String[] result_columns = new String[] { \n KEY_ID, KEY_GOLD_HOARD_ACCESSIBLE_COLUMN, KEY_GOLD_HOARDED_COLUMN }; \n \n // Specify the where clause that will limit our results.\n String where = KEY_GOLD_HOARD_ACCESSIBLE_COLUMN + \"=\" + 1;\n \n // Replace these with valid SQL statements as necessary.\n String whereArgs[] = null;\n String groupBy = null;\n String having = null;\n String order = null;\n \n SQLiteDatabase db = hoardDBOpenHelper.getWritableDatabase();\n Cursor cursor = db.query(HoardDBOpenHelper.DATABASE_TABLE, \n result_columns, where,\n whereArgs, groupBy, having, order);\n //\n return cursor;\n }", "public java.lang.String getCursor() {\n return cursor_;\n }", "public Cursor getAllTrousersCursor() {\n String selectQuery = \"SELECT * FROM \" + TrouserEntry.TABLE_NAME;\n\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor c = db.rawQuery(selectQuery, null);\n\n return c;\n }", "ItemStockDO selectByPrimaryKey(Integer id);", "ItemStockDO selectByPrimaryKey(Integer id);", "SupplierInfo selectByPrimaryKey(Long id);", "Owner selectByPrimaryKey(String id);", "Dress selectByPrimaryKey(Integer did);", "public Cursor findTermCursor (String table, String constraint) {\n // Select All Query\n // Source: http://stackoverflow.com/questions/5186310/android-nearest-match-query-from-sqlite-db-if-input-string-value-is-bigger-tha\n String selectQuery = \"SELECT \" + KEY_ID + \" FROM \" + table\n + \" WHERE \" + KEY_TERM + \" = '\" + constraint + \"'\";\n\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor cursor = db.rawQuery(selectQuery, null);\n\n // return the cursor\n return cursor;\n }", "Cursor mo9429a(Uri uri);", "public int getObject(int targetId)\n\t{\n for(String skey: searchBufs.keySet()){\n String[] keys = skey.split(\"\\\\s+\"); //separted by any white space\n\t\t\t// check the key and assign different method\n ByteBuffer buf = searchBufs.get(skey);\n int bound = buf.position();\n ByteBuffer readBuf = buf.asReadOnlyBuffer();\n readBuf.position(0);\n int oid = 0;\n long longnum = 0;\n \n while(readBuf.position() < bound) {\n oid = readBuf.getInt();\n //System.out.print(\"current cursor: Rowid \"+oid+\" key \"+skey);\n if(oid > targetId)\n break; // already found all of the target row , assume monotonous increase\n if(oid == targetId)\n System.out.print(\"Row \"+oid);\n \n for(int i=0; i<keys.length; i++){\n String type = types.get(keys[i]);\n if(type.equals(\"STRING\")){\n }\n else if(type.equals(\"LONG\")){\n longnum = readBuf.getLong();\n if(oid == targetId){\n System.out.print(longnum + \" \");\n }\n }\n else if(type.equals(\"DOUBLE\")){\n }\n else if(type.equals(\"BOOL\")){\n }\n }\n if(oid == targetId)\n System.out.println(\"\");\n } //end while\n } // end for\n return 0;\n }", "Dish selectByPrimaryKey(String id);", "public Cursor retrieve()\n {\n String[] columns={Constants.ROW_ID,Constants.FIRSTNAME,Constants.LASTNAME};\n Cursor c=null;\n c=db.query(Constants.TB_NAME,columns,null,null,null,null,null);\n return c;\n }", "public Cursor getCursor(){\n return mCursor;\n }", "PathologyInfo selectByPrimaryKey(Integer id);", "Caiwu selectByPrimaryKey(Integer id);", "PaasCustomAutomationRecord selectByPrimaryKey(Integer id);", "FctWorkguide selectByPrimaryKey(Long autoid);", "@Override\n public Cursor query(Uri uri, String[] projection, String selection,\n String[] selectionArgs, String sortOrder) {\n // Open a read-only database.\n SQLiteDatabase db = myOpenHelper.getWritableDatabase();\n\n // Replace these with valid SQL statements if necessary.\n String groupBy = null;\n String having = null;\n \n SQLiteQueryBuilder queryBuilder = new SQLiteQueryBuilder();\n queryBuilder.setTables(MySQLiteOpenHelper.DATABASE_TABLE);\n \n // If this is a row query, limit the result set to the passed in row.\n switch (uriMatcher.match(uri)) {\n case SINGLE_ROW : \n String rowID = uri.getPathSegments().get(1);\n queryBuilder.appendWhere(KEY_ID + \"=\" + rowID);\n break;\n case SEARCH : \n String query = uri.getPathSegments().get(1);\n queryBuilder.appendWhere(KEY_SEARCH_COLUMN + \n \" LIKE \\\"%\" + query + \"%\\\"\");\n queryBuilder.setProjectionMap(SEARCH_SUGGEST_PROJECTION_MAP); \n break;\n default: break;\n }\n \n Cursor cursor = queryBuilder.query(db, projection, selection,\n selectionArgs, groupBy, having, sortOrder);\n\n return cursor;\n }", "public int getRowId() {\n return rowId_;\n }", "public int getRowId() {\n return rowId_;\n }", "public int getRowId() {\n return rowId_;\n }", "public int getRowId() {\n return rowId_;\n }", "public int getRowId() {\n return rowId_;\n }", "HpItemParamItem selectByPrimaryKey(Long id);", "@Override\n\tprotected Cursor loadCursor() {\n\t\treturn DataManager.get().queryLocations();\n\t}", "public Cursor getAllStops(long rowId) throws SQLException {\n\t\treturn\tdb.query(STOPS_TABLE, new String[] {\n\t\t\t\tKEY_STOPID,\n\t\t\t\tKEY_SAGENCYID,\n\t\t\t\tKEY_STOPCODE,\n\t\t\t\tKEY_STOPNAME,\n\t\t\t\tKEY_STOPDESC}, \n\t\t\t\tKEY_SAGENCYID + \"=\" + rowId,\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tnull);\n\t\t}" ]
[ "0.7119913", "0.6931847", "0.6833526", "0.6732264", "0.6713878", "0.64774424", "0.64530206", "0.6366142", "0.6325639", "0.62926775", "0.6277708", "0.6229189", "0.6225522", "0.6133958", "0.6125395", "0.61127734", "0.6038288", "0.6038201", "0.6019151", "0.60160005", "0.5999178", "0.587825", "0.5806558", "0.5739937", "0.5735952", "0.5701381", "0.56632954", "0.5650016", "0.562957", "0.5622308", "0.5599649", "0.5550977", "0.5516388", "0.5505609", "0.54990387", "0.5488429", "0.54860204", "0.5476296", "0.5441516", "0.5362756", "0.53465235", "0.53191286", "0.53135484", "0.5291624", "0.52898306", "0.52889466", "0.52616084", "0.5255014", "0.52180827", "0.52180827", "0.52180827", "0.52180827", "0.52180827", "0.5212875", "0.5194857", "0.51804316", "0.5157497", "0.5154729", "0.51512975", "0.5147754", "0.5144288", "0.5136077", "0.5127181", "0.5108341", "0.5103206", "0.5091145", "0.5088199", "0.50824106", "0.5074521", "0.5072947", "0.50643003", "0.5063735", "0.50636226", "0.50619596", "0.5059732", "0.50548834", "0.50517344", "0.50517344", "0.5044812", "0.5028226", "0.5022857", "0.50217074", "0.5016743", "0.5016023", "0.50143707", "0.5001041", "0.5000349", "0.4998328", "0.49956408", "0.49899912", "0.4987766", "0.49870265", "0.49867147", "0.49867147", "0.49867147", "0.49867147", "0.49867147", "0.49824828", "0.49790767", "0.49785137" ]
0.5172191
56
Starts a thread to load the database table with words
private void loadFieldGuideData() { new Thread(new Runnable() { public void run() { try { Log.d(TAG, "Loading data via loadData()"); loadData(); } catch (IOException e) { throw new RuntimeException(e); } catch (JSONException e) { throw new RuntimeException(e); } } }).start(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void loadStateDatabase() {\n new Thread( new Runnable() {\n public void run() {\n try {\n loadStates();\n } catch ( final IOException e ) {\n throw new RuntimeException( e );\n }\n }\n }).start();\n }", "private void loadDatabase() {\n Runnable load = new Runnable() {\n public void run() {\n try {\n boolean isSuccess = false;\n File data = Environment.getDataDirectory();\n\n String currentDbPath = \"//data//com.udacity.adcs.app.goodintents//databases//goodintents.db\";\n\n File currentDb = new File(data, currentDbPath);\n File restoreDb = getFileFromAsset(mActivity, mActivity.getExternalFilesDir(null) + \"/\", \"goodintents.db\");\n\n if (restoreDb != null ? restoreDb.exists() : false) {\n FileInputStream is = new FileInputStream(restoreDb);\n FileOutputStream os = new FileOutputStream(currentDb);\n\n FileChannel src = is.getChannel();\n FileChannel dst = os.getChannel();\n dst.transferFrom(src, 0, src.size());\n\n is.close();\n os.close();\n src.close();\n dst.close();\n isSuccess = true;\n }\n\n if (isSuccess) {\n PreferencesUtils.setBoolean(mActivity, R.string.initial_db_load_key, true);\n }\n } catch (Exception ex) {\n ex.printStackTrace();\n } finally {\n mActivity.runOnUiThread(loadDatabaseRunnable);\n }\n }\n };\n\n Thread thread = new Thread(null, load, \"loadDatabase\");\n thread.start();\n }", "public static void loadDB() throws Exception {\n\t\t// Remove previously loaded data\n\t\tcolToData.clear();\n\t\t// Load dictionary from disk\n\t\tloadDictionary();\n\t\t// Collect columns to load in parallel\n\t\tList<ColumnRef> colsToLoad = new ArrayList<ColumnRef>();\n\t\tfor (TableInfo table : CatalogManager.currentDB.nameToTable.values()) {\n\t\t\tString tableName = table.name;\n\t\t\tfor (ColumnInfo column : table.nameToCol.values()) {\n\t\t\t\tString columnName = column.name;\n\t\t\t\tcolsToLoad.add(new ColumnRef(tableName, columnName));\n\t\t\t}\n\t\t}\n\t\t// Load columns\n\t\tcolsToLoad.stream().parallel().forEach((colRef) -> {\n\t\t\ttry {\n\t\t\t\tSystem.out.println(\"Loading column \" + colRef.toString());\n\t\t\t\tloadColumn(colRef);\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.err.println(\"Error loading column \" + colRef.toString());\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t});\n\t\tSystem.out.println(\"Loaded database.\");\n\t}", "public static void fetchWords() {\n wordList = new ArrayList<String>();\n try {\n //problems with reading into method\n WordFetcher.readInto(wordList); \n } catch(Exception e) {\n System.out.println(e);\n }\n }", "public void start(){\n dbConnector = new DBConnector();\n tables = new HashSet<String>();\n tables.add(ALGORITHMS_TABLE);\n tables.add(DATA_STRUCTURES_TABLE);\n tables.add(SOFTWARE_DESIGN_TABLE);\n tables.add(USER_TABLE);\n }", "private void preloadDb() {\n String[] branches = getResources().getStringArray(R.array.branches);\n //Insertion from xml\n for (String b : branches)\n {\n dataSource.getTherapyBranchTable().insertTherapyBranch(b);\n }\n String[] illnesses = getResources().getStringArray(R.array.illnesses);\n for (String i : illnesses)\n {\n dataSource.getIllnessTable().insertIllness(i);\n }\n String[] drugs = getResources().getStringArray(R.array.drugs);\n for (String d : drugs)\n {\n dataSource.getDrugTable().insertDrug(d);\n }\n }", "private void loadWords(Future<Void> future) {\n if (wordsLocation == null || ! wordsLocation.exists() ) {\n future.fail(\"wordsLocation[\" + wordsLocation + \"] does not exist\");\n return;\n }\n\n try (InputStream wis = wordsLocation.getInputStream();\n InputStreamReader isr = new InputStreamReader(wis);\n BufferedReader br = new BufferedReader(isr)) {\n\n String word;\n int wc = 0;\n while ((word = br.readLine()) != null) {\n LOG.debug(\"adding \" + word + \"to WordFinder\");\n wordFinder.add(word);\n wc++;\n }\n\n LOG.info(\"Loaded \" + wc + \" words into WordFinder\");\n\n future.complete();\n } catch (IOException e) {\n String msg = \"an error occurred while trying to read the words\";\n LOG.warn(msg, e);\n future.fail(e);\n }\n }", "@Override\n public void run() {\n addDelay();\n\n AppDatabase appDatabase = AppDatabase.getInstance(appContext, executors);\n\n List<WeatherEntry> weathers = DataGenerator.generateWeathers();\n\n Log.d(TAG, \"Codelab AppDatabase insertAll - begin\");\n\n insertAll(appDatabase, weathers);\n\n // notify that the database was created and it's ready to be used\n appDatabase.setDatabaseCreated();\n }", "public static void main(String... args) {\n try{ //this makes it so that all the console output will be printed to a file\n //PrintStream out = new PrintStream(new FileOutputStream(WORD_COUNT_TABLE_FILE.toString()));\n //System.setOut(out);\n }\n catch (Exception e){\n e.printStackTrace();\n }\n\n long start = System.currentTimeMillis();\n\n\n\n Map<String, List<Integer>> allWords = new ConcurrentHashMap<>(); //the HashMap that will contain all the words and list of occurrences\n List<String> listOfFiles = getFilesFromDirectory(); //the list of files from the given folder\n List<Thread> threadList = new LinkedList<>();\n\n runWithThreads(allWords, listOfFiles, NUMBER_OF_THREADS);\n\n TreeMap<String, List<Integer>> sortedMap = new TreeMap<>(allWords);\n Set<Entry<String, List<Integer>>> sortedEntries = sortedMap.entrySet();\n\n long end = System.currentTimeMillis();\n\n System.out.print(Table.makeTable(sortedEntries, listOfFiles));\n System.out.println(\"\\nTime: \" + (end-start));\n\n\n\n }", "public int loadDatabase(){\n\n try {\n BufferedReader bufferedReader = new BufferedReader(new FileReader(databaseFileName));\n String line = bufferedReader.readLine();\n while (line != null) {\n HashMap<String,String> activityString = parseStatement(line);\n System.out.println(activityString);\n Activity activity = new Activity();\n activity.create(activityString);\n allActivities.add(activity);\n line = bufferedReader.readLine();\n\n }\n }\n catch(Exception e){\n System.out.println(e);\n return -1;\n }\n\n\n //TODO: write utility to load database, including loading csv hashes into activity classes. Activity class - > needs list of accepted attr?\n\n return 0;\n }", "private void doDBProcessing() throws InterruptedException {\n\t\tThread.sleep(5000);\r\n\t\t\r\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\twhile(true) {\n\t\t\t\t\tinsert_sql_covid_table();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(10000); // 갱신의 시간\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public void insertRecords(){\n InsertToDB insertRecords= new InsertToDB(mDbhelper,mRecord);\n Log.i(TAG, \"starting insertion on a new Thread!!\");\n idlingResource.increment();\n new Thread(insertRecords).start();\n\n }", "public void start() {\n try {\n long start = System.currentTimeMillis();\n readFile();\n result = wordStorage.getTopNWords(3);\n long end = System.currentTimeMillis();\n long timeTaken = ((end - start) / 1000);\n logger.info(\"time taken to run program: \" + timeTaken);\n display.displayTimeTaken(timeTaken);\n display.displayTopNWords(result);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Override\n protected Void doInBackground (Void[] params) {\n if (checkFirstRun()) {\n try {\n\n runOnUiThread(new Runnable() {\n @Override\n public void run () {\n List<InitializeDataBase> initializeDataBase = InitializeDataBase.listAll(InitializeDataBase.class);\n }\n });\n } catch (Exception e) {\n e.printStackTrace();\n }\n } else {\n try {\n Thread.sleep(2000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n\n\n return null;\n }", "public static void loadDatabase(){\n\t\ttry(BufferedReader reader = new BufferedReader(new FileReader(filePath))){\n\t\t\tfor(String line; (line = reader.readLine()) != null; ){\n\t\t\t\tString[] info = line.split(Pattern.quote(\"|\"));\n\t\t\t\tString path = info[0].trim();\n\t\t\t\tString fileID = info[1];\n\t\t\t\tInteger nOfChunks = Integer.parseInt(info[2]);\n\t\t\t\tPair<FileID, Integer> pair = new Pair<FileID, Integer>(new FileID(fileID), nOfChunks);\n\t\t\t\tPeer.fileList.put(path, pair);\n\t\t\t}\n\t\t\treader.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}\n\t\t/*\n\t\t * LOAD THE CHUNK LIST\n\t\t */\n\t\ttry(BufferedReader reader = new BufferedReader(new FileReader(chunkPath))){\n\t\t\tfor(String line; (line = reader.readLine()) != null; ){\n\t\t\t\tString[] info = line.split(Pattern.quote(\"|\"));\n\t\t\t\tString fileID = info[0].trim();\n\t\t\t\tInteger chunkNo = Integer.parseInt(info[1]);\n\t\t\t\tInteger drd = Integer.parseInt(info[2]);\n\t\t\t\tInteger ard = Integer.parseInt(info[3]);\n\t\t\t\tChunkInfo ci = new ChunkInfo(fileID,chunkNo,drd,ard);\n\t\t\t\tPeer.chunks.add(ci);\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void train()\n\t{\n\t\tdbiterator = DBInstanceIterator.getInstance();\n System.out.println(\"Start Training ..\");\n\n\t\ttry {\n\t\t\tSystem.out.println(\"Training Text %..\");\n\t\t\ttrainText();\n\n\t\t\tSystem.out.println(\"Training Complex %..\");\n\t\t\ttrainCombined();\n\n\t\t\tSystem.out.println(\"Training Feature %..\");\n\t\t\ttrainFeatures();\n\n\t\t\tSystem.out.println(\"Training Lexicon %..\");\n\t\t\t//trainLexicon();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void loadFromDatabase(){\r\n /**\r\n * Open the file streams to the three files\r\n * Recover the state of data structures\r\n * Close the file streams\r\n */\r\n\r\n try{\r\n //Recover the state of unfinished set from unfinished.dat\r\n unfinishedFileInputStream = new FileInputStream(UNFINISHED_FILE_PATH);\r\n unfinishedSetInputStream = new ObjectInputStream(unfinishedFileInputStream);\r\n unfinished = (Set<Task>)unfinishedSetInputStream.readObject();\r\n unfinishedSetInputStream.close();\r\n unfinishedFileInputStream.close();\r\n\r\n //Recover the state of finished list from finished.dat\r\n finishedFileInputStream = new FileInputStream(FINISHED_FILE_PATH);\r\n finishedListInputStream = new ObjectInputStream(finishedFileInputStream);\r\n finished = (ArrayList<Task>)finishedListInputStream.readObject();\r\n finishedListInputStream.close();\r\n finishedFileInputStream.close();\r\n\r\n //Recover the state of activities list from activities.dat\r\n activitiesFileInputStream = new FileInputStream(ACTIVITIES_FILE_PATH);\r\n activitiesListInputStream = new ObjectInputStream(activitiesFileInputStream);\r\n activities = (ArrayList<Activity>)activitiesListInputStream.readObject();\r\n activitiesListInputStream.close();\r\n activitiesFileInputStream.close();\r\n\r\n generateWeeklySchedule();\r\n }\r\n catch(Exception e){\r\n System.out.println(e.getMessage());\r\n }\r\n }", "private void loadNotesFromDB(){\n AppDB appDB = Room.databaseBuilder(getApplicationContext(), AppDB.class, \"app-database\").build();\n\n new Thread(new Runnable() {\n @Override\n public void run() {\n List<Note> notes = appDB.notesDao().getAllNotes();\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n // TODO: setup My RecyclerView\n setupNotesRecyclerView(notes);\n Log.d(\"MainActivity\", \"Notes Count: \" + notes.size());\n }\n });\n }\n }).start();\n }", "private void run()\n {\n searchLexDb(\"^providing_\", true);\n }", "@Override\n public LogbookEntry loadInBackground() {\n this.database = this.databaseSchemaHelper.getReadableDatabase();\n return SchemaQueries.getLogbook(this.database);\n }", "public void loadList () {\r\n ArrayList<String> list = fileManager.loadWordList();\r\n if (list != null) {\r\n for (String s : list) {\r\n addWord(s);\r\n }\r\n }\r\n }", "public static void threadstorer()\r\n\r\n\t{\r\n\t\tThread threadstoreData = new Thread(){\r\n\t\t\tpublic void run(){\r\n\t\t\t\ttry {\r\n\t\t\t\t\t//loadData(inputFile1);\r\n\t\t\t\t\tUtility.writeTofile(wordList, outputFile1);\r\n\t\t\t\t\tSystem.out.println(\"Word Stored\");\r\n\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tSystem.err.println(\"Error in storing data: \"+e.getMessage());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tThread threadstorePattern = new Thread(){\r\n\t\t\tpublic void run(){\r\n\t\t\t\ttry {\r\n\t\t\t\t\tUtility.writeTofile(patternOut, outputFile2);\r\n\t\t\t\t\tSystem.out.println(\"Pattern stored\");\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tSystem.err.println(\"Error in storing pattern: \"+e.getMessage());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tthreadstoreData.run();\r\n\t\tthreadstorePattern.run();\r\n\t}", "protected void startInsertRunnable() {\n\t}", "private void loadDatabase()\n\t{\n\t\ttry\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Check to make sure the Bmod Database is there, if not, try \n\t\t\t\t// downloading from the website.\n\t\t\t\tif(!Files.exists(m_databaseFile))\n\t\t\t\t{\n\t\t\t\t\tFiles.createDirectories(m_databaseFile.getParent());\n\t\t\t\t\n\t\t\t\t\tbyte[] file = ExtensionPoints.readURLAsBytes(\"http://\" + Constants.API_HOST + HSQL_DATABASE_PATH);\n\t\t\t\t\tif(file.length != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tFiles.deleteIfExists(m_databaseFile);\n\t\t\t\t\t\tFiles.write(m_databaseFile, file, StandardOpenOption.CREATE, StandardOpenOption.WRITE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// make sure we have the proper scriptformat.\n\t\t\t\tsetScriptFormatCorrectly();\n\t\t\t}catch(NullPointerException|IOException ex)\n\t\t\t{\n\t\t\t\tm_logger.error(\"Could not fetch database from web.\", ex);\n\t\t\t}\n\t\t\t\n\t\n\t\t\t\n\t\t\tClass.forName(\"org.hsqldb.jdbcDriver\");\n\t\t\n\t\t\t\n\t\t\tString db = ExtensionPoints.getBmodDirectory(\"database\").toUri().getPath();\n\t\t\tconnection = DriverManager.getConnection(\"jdbc:hsqldb:file:\" + db, \"sa\", \"\");\n\t\t\t\n\t\t\t// Setup Connection\n\t\t\tCSVRecordLoader ldr = new CSVRecordLoader();\n\t\t\n\t\t\t// Load all of the building independent plugins\n\t\t\tfor(Record<?> cp : ldr.getRecordPluginManagers())\n\t\t\t{\n\t\t\t\tm_logger.debug(\"Creating table: \" + cp.getTableName());\n\t\t\t\t// Create a new table\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tgetPreparedStatement(cp.getSQLTableDefn()).execute();\n\t\t\t\t} catch(SQLException ex)\n\t\t\t\t{\n\t\t\t\t\t// Table exists\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tm_logger.debug(\"Doing index:\" + cp.getIndexDefn());\n\t\t\t\t\tif(cp.getIndexDefn() != null)\n\t\t\t\t\t\tgetPreparedStatement(cp.getIndexDefn()).execute();\n\t\t\t\t}catch(SQLException ex)\n\t\t\t\t{\t// index exists\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\n\t\t} catch (Exception ex)\n\t\t{\n\t\t\tex.printStackTrace();\n\t\t\tif(ex instanceof DatabaseIntegrityException)\n\t\t\t\tDatabase.handleCriticalError((DatabaseIntegrityException)ex);\n\t\t\telse\n\t\t\t\tDatabase.handleCriticalError(new DatabaseIntegrityException(ex));\n\t\t}\n\t\t\n\t}", "private static void initializeDatabase() {\n\t\tArrayList<String> data = DatabaseHandler.readDatabase(DATABASE_NAME);\n\t\tAbstractSerializer serializer = new CineplexSerializer();\n\t\trecords = serializer.deserialize(data);\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_full_loading);\n\n getSupportActionBar().hide();\n dBase = Room.databaseBuilder(this, DBase.class, \"database\").allowMainThreadQueries().build();\n\n textViewText = (TextView) findViewById(R.id.fullloading_text);\n switch (isPage) {\n case 0:\n textViewText.setText(getString(R.string.loading_level));\n break;\n case 1:\n textViewText.setText(getString(R.string.loading_levels));\n break;\n case 2:\n textViewText.setText(getString(R.string.loading_level));\n break;\n }\n\n new Thread(new Runnable() {\n @Override\n public void run() {\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n switch (isPage) {\n case 0:\n LoadSection();\n break;\n case 1:\n LoadSections();\n break;\n case 2:\n LoadSectionGame();\n break;\n }\n }\n }, 300);\n }\n }).run();\n }", "public MultiThreadedTabuSearch() {}", "@Override\n public void run() {\n try {\n List<String> list = Lists.newArrayList();\n for (; ; ) {\n String url = Engine.routeQueue.poll();\n if (url == null && list.size() > 0) {\n File file = new File(\"./half-moil.db\");\n if (!file.exists()) file.createNewFile();\n FileWriter writer = new FileWriter(file, true);\n\n writer.write(Joiner.on(\"\\r\\n\").join(list) + \"\\r\\n\");\n writer.flush();\n writer.close();\n writer = null;\n logger.info(\"文件已保存,新增{}条\", list.size());\n list.clear();\n } else if (url != null) {\n list.add(url);\n } else {\n Thread.sleep(5000L);\n }\n }\n } catch (Exception e) {\n logger.error(e);\n }\n }", "@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tReadKnownDLLs();\n\t\t} catch (RegistryException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\ttablemodels.fireTableDataChanged();\n\t}", "public abstract void loadFromDatabase();", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t Map<String, String> map=new HashMap<String, String>();\n\t\t\t\t map=CatchHtml.getListHtmlText(address);\n\t\t\t\t ListInfo listInfo=new ListInfo();\n\t\t\t\t listInfo.setTitle(map.get(\"singht_title\"));\n\t\t\t\t listInfo.setIntroduce(map.get(\"singht_intro\"));\n\t\t\t\t listInfo.setAddress(map.get(\"singht_address\"));\n\t\t\t\t listInfo.setTime(map.get(\"singht_time\"));\n\t\t\t\t listInfo.setId(id);\n\t\t\t\t db.saveSinght(listInfo,contentString);\n\t\t\t}", "@Override\n public void run() {\n ArticleHeaders.loadData(getApplicationContext());\n CustomerHeaders.loadData(getApplicationContext());\n OrderReasons.loadData(getApplicationContext());\n }", "public void startColumnsThreads(){\n addCars.start();\n gasStation.startWorkColumns();\n }", "@Override\n public void onCreate(@NonNull SupportSQLiteDatabase db) {\n super.onCreate(db);\n\n executors.getDiskIOExecutor().execute(new Runnable() {\n @Override\n public void run() {\n\n // Add a delay to simulate a long-running operation\n addDelay();\n\n AppDatabase appDatabase = AppDatabase.getInstance(appContext, executors);\n\n List<WeatherEntry> weathers = DataGenerator.generateWeathers();\n\n Log.d(TAG, \"Codelab AppDatabase insertAll - begin\");\n\n insertAll(appDatabase, weathers);\n\n // notify that the database was created and it's ready to be used\n appDatabase.setDatabaseCreated();\n }\n });\n }", "private static void bannedWordsDownload() {\n new Thread(new Runnable() {\n @Override\n public void run() {\n Properties properties = new Properties();\n try(BufferedInputStream stream =\n new BufferedInputStream(new FileInputStream(new File(PROPERTIES_PATH)))) {\n properties.load(stream);\n\n String wordsPath = properties.getProperty(BANNED_WORDS_SOURCE);\n BufferedReader reader = new BufferedReader(new FileReader(new File(wordsPath)));\n\n bannedWords = Collections.synchronizedList(new ArrayList<>());\n String line;\n while ((line = reader.readLine()) != null) {\n bannedWords.add(line);\n }\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }).start();\n }", "public static void populateWordDictionary(net.sqlcipher.database.SQLiteDatabase r7) {\n /*\n r0 = 0\n java.io.BufferedReader r1 = new java.io.BufferedReader // Catch:{ IOException -> 0x0051 }\n java.io.InputStreamReader r2 = new java.io.InputStreamReader // Catch:{ IOException -> 0x0051 }\n com.masterlock.ble.app.MasterLockApp r3 = com.masterlock.ble.app.MasterLockApp.get() // Catch:{ IOException -> 0x0051 }\n android.content.res.AssetManager r3 = r3.getAssets() // Catch:{ IOException -> 0x0051 }\n java.lang.String r4 = \"word_dictionary/words.txt\"\n java.io.InputStream r3 = r3.open(r4) // Catch:{ IOException -> 0x0051 }\n java.lang.String r4 = \"UTF-8\"\n r2.<init>(r3, r4) // Catch:{ IOException -> 0x0051 }\n r1.<init>(r2) // Catch:{ IOException -> 0x0051 }\n r2 = 0\n L_0x001c:\n java.lang.String r3 = r1.readLine() // Catch:{ IOException -> 0x004b, all -> 0x0049 }\n if (r3 == 0) goto L_0x0045\n if (r3 == 0) goto L_0x0042\n boolean r4 = r3.isEmpty() // Catch:{ IOException -> 0x004b, all -> 0x0049 }\n if (r4 != 0) goto L_0x0042\n android.content.ContentValues r4 = new android.content.ContentValues // Catch:{ IOException -> 0x004b, all -> 0x0049 }\n r4.<init>() // Catch:{ IOException -> 0x004b, all -> 0x0049 }\n java.lang.String r5 = \"word_dictionary_id\"\n java.lang.Integer r6 = java.lang.Integer.valueOf(r2) // Catch:{ IOException -> 0x004b, all -> 0x0049 }\n r4.put(r5, r6) // Catch:{ IOException -> 0x004b, all -> 0x0049 }\n java.lang.String r5 = \"word_dictionary_word\"\n r4.put(r5, r3) // Catch:{ IOException -> 0x004b, all -> 0x0049 }\n java.lang.String r3 = \"word_dictionary\"\n r7.insert(r3, r0, r4) // Catch:{ IOException -> 0x004b, all -> 0x0049 }\n L_0x0042:\n int r2 = r2 + 1\n goto L_0x001c\n L_0x0045:\n r1.close() // Catch:{ IOException -> 0x005b }\n goto L_0x005f\n L_0x0049:\n r7 = move-exception\n goto L_0x0060\n L_0x004b:\n r7 = move-exception\n r0 = r1\n goto L_0x0052\n L_0x004e:\n r7 = move-exception\n r1 = r0\n goto L_0x0060\n L_0x0051:\n r7 = move-exception\n L_0x0052:\n r7.printStackTrace() // Catch:{ all -> 0x004e }\n if (r0 == 0) goto L_0x005f\n r0.close() // Catch:{ IOException -> 0x005b }\n goto L_0x005f\n L_0x005b:\n r7 = move-exception\n r7.printStackTrace()\n L_0x005f:\n return\n L_0x0060:\n if (r1 == 0) goto L_0x006a\n r1.close() // Catch:{ IOException -> 0x0066 }\n goto L_0x006a\n L_0x0066:\n r0 = move-exception\n r0.printStackTrace()\n L_0x006a:\n throw r7\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.masterlock.ble.app.util.DBUtil.populateWordDictionary(net.sqlcipher.database.SQLiteDatabase):void\");\n }", "public void createT4(int rows) {\n\t\tExecutorService dataExecutor = Executors.newFixedThreadPool(NTHREDS);\n\t\tRunnable worker1 = new RepeatDataThread(3, Application.THREAD_ONE_PATH\n\t\t\t\t+ \"t4\", 42);\n\t\tRunnable worker2 = new RepeatDataThread(3, Application.THREAD_TWO_PATH\n\t\t\t\t+ \"t4\", 42);\n\t\tRunnable worker3 = new RepeatDataThread(3,\n\t\t\t\tApplication.THREAD_THREE_PATH + \"t4\", 42);\n\t\tRunnable worker4 = new RepeatDataThread(3, Application.THREAD_FOUR_PATH\n\t\t\t\t+ \"t4\", 42);\n\t\tdataExecutor.execute(worker1);\n\t\tdataExecutor.execute(worker2);\n\t\tdataExecutor.execute(worker3);\n\t\tdataExecutor.execute(worker4);\n\t\tdataExecutor.shutdown();\n\t\ttry {\n\t\t\tdataExecutor.awaitTermination(1, TimeUnit.MINUTES);\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\t// find directory that contains data\n\t\tFile[] files = new File[4];\n\t\tfiles[0] = new File(Application.THREAD_ONE_PATH + \"t4\");\n\t\tfiles[1] = new File(Application.THREAD_TWO_PATH + \"t4\");\n\t\tfiles[2] = new File(Application.THREAD_THREE_PATH + \"t4\");\n\t\tfiles[3] = new File(Application.THREAD_FOUR_PATH + \"t4\");\n\t\tFile outputFile = null;\n\n\t\tfor (File f : files) {\n\t\t\tif (FileUtils.folderSize(f) > 0) {\n\t\t\t\toutputFile = new File(f.toString());\n\t\t\t}\n\t\t}\n\n\t\tif (outputFile == null) {\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"unable to avoid initialization exception for table 4.\");\n\t\t}\n\t\t\n\t\tExecutorService loadExecutor = Executors.newFixedThreadPool(NTHREDS);\n\t\tRunnable loadWorker = new LoadThread(outputFile.toString());\n\t\tloadExecutor.execute(loadWorker);\n\t\tloadExecutor.shutdown();\n\t\ttry {\n\t\t\tloadExecutor.awaitTermination(10, TimeUnit.MINUTES);\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\tcleanDirs();\n\t}", "public void run() {\n startConnectionToMSSQL();\n }", "private void run(){\n AccessLogParser accessLogParser = new AccessLogParser(accessLog);\n accessLogParser.parse();\n\n search();\n\n\n HibernateUtil.shutdown();\n }", "public static void loadDictionary() throws Exception {\n\t\t// Check whether database has associated dictionary\n\t\tif (CatalogManager.currentDB.compressed) {\n\t\t\tSystem.out.println(\"Loading dictionary ...\");\n\t\t\tlong startMillis = System.currentTimeMillis();\n\t\t\tString dictionaryPath = PathUtil.dictionaryPath;\n\t\t\tObject object = DiskUtil.loadObject(dictionaryPath);\n\t\t\tdictionary = (Dictionary)object;\n\t\t\tlong totalMillis = System.currentTimeMillis() - startMillis;\n\t\t\tSystem.out.println(\"Loaded dictionary in \" + totalMillis + \" ms.\");\t\n\t\t\t// Generate debugging output\n\t\t\tlog(\"*** String dictionary sample ***\");\n\t\t\tint sampleSize = Math.min(10, dictionary.strings.length);\n\t\t\tfor (int i=0; i<sampleSize; ++i) {\n\t\t\t\tlog(i + \"\\t\" + dictionary.getString(i));\n\t\t\t}\n\t\t\tlog(\"******\");\n\t\t} else {\n\t\t\tSystem.out.println(\"No data dictionary found.\");\n\t\t}\n\t}", "protected void setup(Context context) throws IOException,InterruptedException{\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(\"/home/u2/hadoop_installs/hadoop-2.7.4/TrainingData_word_GR_sort/TrainingData_word_GR_sort.txt\")), \"UTF-8\"));\n String lineTxt = null;\n int get_line=0;\n while (((lineTxt = br.readLine()) != null)&&(get_line<1000)) {\n \t\n \tString[] getword = lineTxt.toString().split(\"\\t\");\n \ttop_ig_words[get_line] = new String(getword[1]);\n \tget_line++;\n }\n br.close();\n } catch (Exception e) {\n System.err.println(\"read errors :\" + e);\n }\n }", "public static void load() {\n\n\t\ttry {\n\t\t\tnew Thread() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tObjectDef.loadConfig();\n\t\t\t\t\t\tObjectConstants.declare();\n\t\t\t\t\t\tMapLoading.load();\n\t\t\t\t\t\tRegion.sort();\n\t\t\t\t\t\tObjectManager.declare();\n\t\t\t\t\t\tGameDefinitionLoader.loadNpcSpawns();\n\t\t\t\t\t\tNpc.spawnBosses();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}.start();\n\n\t\t\tGlobalItemHandler.spawn();\n\t\t\tTriviaBot.start();\n\t\t\tAchievements.declare();\n\n\t\t\tGameDefinitionLoader.loadItemValues();\n\t\t\tGameDefinitionLoader.loadNpcDefinitions();\n\t\t\tGameDefinitionLoader.loadItemDefinitions();\n\t\t\tGameDefinitionLoader.loadEquipmentDefinitions();\n\t\t\tGameDefinitionLoader.loadShopDefinitions();\n\t\t\tGameDefinitionLoader.setRequirements();\n\t\t\tGameDefinitionLoader.loadWeaponDefinitions();\n\t\t\tGameDefinitionLoader.loadSpecialAttackDefinitions();\n\t\t\tGameDefinitionLoader.loadRangedStrengthDefinitions();\n\t\t\tGameDefinitionLoader.loadSpecialAttackDefinitions();\n\t\t\tGameDefinitionLoader.loadCombatSpellDefinitions();\n\t\t\tGameDefinitionLoader.loadRangedWeaponDefinitions();\n\t\t\tGameDefinitionLoader.loadNpcCombatDefinitions();\n\t\t\tGameDefinitionLoader.loadItemBonusDefinitions();\n\n\t\t\tNPCDrops.parseDrops().load();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void threadloader()\r\n\r\n\t{\r\n\t\tThread threadloadData = new Thread(){\r\n\t\t\tpublic void run(){\r\n\t\t\t\ttry {\r\n\t\t\t\t\tloadData(inputFile1);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tSystem.err.println(\"Error in loading data: \"+e.getMessage());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tThread threadloadPattern = new Thread(){\r\n\t\t\tpublic void run(){\r\n\t\t\t\ttry {\r\n\t\t\t\t\tloadPattern(inputFile2);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tSystem.err.println(\"Error in loading pattern: \"+e.getMessage());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tthreadloadData.run();\r\n\t\tthreadloadPattern.run();\r\n\t}", "public void load() {\n\t\tif (!dbNode.isLogined()) {\n\t\t\treturn;\n\t\t}\n\n\t\tString tablesFolderId = dbNode.getId()\n\t\t\t\t+ CubridTablesFolderLoader.TABLES_FULL_FOLDER_SUFFIX_ID;\n\t\tfinal ICubridNode tablesFolder = dbNode.getChild(tablesFolderId);\n\t\tif (null == tablesFolder) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (tablesFolder.getChildren().size() < 1) {\n\t\t\tfinal TreeViewer tv = getTreeView();\n\t\t\tDisplay.getDefault().syncExec(new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\ttv.expandToLevel(tablesFolder, 1);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "public static void init() {\r\n\r\n types = new HashMap();\r\n ConnectionManager manager = ConnectionManager.getInstance();\r\n DatabaseConnection con = manager.get();\r\n\r\n String str = \"select ChWord ,ChWordSpell from PtWordSpell\";\r\n try\r\n {\r\n RecordSet rs = con.executeQuery(str);\r\n \r\n while (rs.next()) {\r\n String PolyChWord = rs.getString(\"ChWord\");\r\n String enuDesc = rs.getString(\"ChWordSpell\");\r\n \r\n types.put(PolyChWord, enuDesc);\r\n \r\n }\r\n rs.close();\r\n }catch(Exception e)\r\n {\r\n e.printStackTrace();\r\n }\r\n\r\n \r\n manager.release();\r\n\r\n\r\n }", "public void loadRows(String fname) {\n\t\tint goodWordCount = 0;\n\t\ttry {\n\t\t\tBufferedReader wordsReader = new BufferedReader(new FileReader(fname));\n\n\t\t\twordsReader.readLine(); // get first line\n\t \n\t\t\tfor ( ; ; ) {\n\t\t\t\tString line = wordsReader.readLine();\n\t\n\t\t\t\tif (line == null) {\n\t\t\t\t\twordsReader.close();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\n\t\t\t\telse {\n\t\t\t\t\tString parts[] = line.split(\";\");\n\t\t\t\t\t//System.out.println(line);\n\t\t\t\t\twords.add(parts[0]);\n\t\t\t\t\tdouble wordCount = Double.parseDouble(parts[2]);\n\t\t\t\t\twordsCount.add(wordCount);\n\t\t\t\t\tif(!stopWords.contains(parts[0]) && binDst.existsWord(parts[0])){\n\t\t\t\t\t\tlegitWords += wordCount;\n\t\t\t\t\t\tgoodWords.add(true);\n\t\t\t\t\t\tgoodWordCount++;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tgoodWords.add(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t} catch (Exception e) {\n\t \t LOGGER.warning(e.getMessage());\n\t\t}\n\t\tLOGGER.info(\"Unique training words: \" + goodWordCount);\n\t\tLOGGER.info(\"Total words: \" + words.size());\n\t\tLOGGER.info(\"Occurrences of training words: \" + legitWords);\n\t}", "public static void main(String[] args) {\n Table table = new Table();\n MyThread1 t1 = new MyThread1(table);\n MyThread1 t2 = new MyThread1(table);\n MyThread1 t3 = new MyThread1(table);\n MyThread1 t4 = new MyThread1(table);\n\n t1.start();\n t2.start();\n t3.start();\n t4.start();\n\n }", "public RecipeDataBase(){\n //recipes = new ArrayList<>();\n loadDatabase();\n \n }", "private void loadData() {\n Log.d(LOG_TAG, \"loadData()\");\n /* If the device does not have an internet connection, then... */\n if (!NetworkUtils.hasInternetConnection(this)){\n showErrorMessage(true);\n return;\n }\n /* Make the View for the data visible and hide the error message */\n showDataView();\n\n /* Fetch the data from the web asynchronous using Retrofit */\n TMDBApi the_movie_database_api = new TMDBApi(new FetchDataTaskCompleteListener());\n /* Start the network transactions */\n the_movie_database_api.start(sortOrderCurrent);\n\n /* Display the loading indicator */\n displayLoadingIndicator(true);\n }", "public void start() {\n initDb();\n try {\n VacancyLoader vl = new VacancyLoader(this.connection, this.vacancies);\n vl.start();\n parse(checkDate());\n } catch (IOException e) {\n LOG.error(e.getMessage());\n }\n }", "public static void main(String[] args) {\n\t\tMonitor_DB monitor = new Monitor_DB(monitor_delay);\r\n\t\tThread monitorThread = new Thread(monitor);\r\n\t\tmonitorThread.start();\r\n\t}", "public void loadMovieDescriptions()\r\n/* 162: */ {\r\n/* 163: */ try\r\n/* 164: */ {\r\n/* 165:160 */ if (this.gauntlet != null) {\r\n/* 166:161 */ this.gauntlet.closeInterface();\r\n/* 167: */ }\r\n/* 168:163 */ Thread thread = new GetTheMovies();\r\n/* 169:164 */ thread.start();\r\n/* 170: */ }\r\n/* 171: */ catch (Exception localException) {}\r\n/* 172: */ }", "private static void insertCebuanoWords1(Context context)\n {\n WordRepository.create(context,\"i\", \"ako\",2);\n WordRepository.create(context,\"you\", \"ikaw\",2);\n WordRepository.create(context,\"mine\", \"akoa\",2);\n WordRepository.create(context,\"ours\", \"kita\",2);\n WordRepository.create(context,\"there's\", \"adunay\",2);\n WordRepository.create(context,\"your's\", \"imong\",2);\n WordRepository.create(context,\"eat\", \"kaon\",2);\n WordRepository.create(context,\"sleep\", \"pagkatulog\",2);\n WordRepository.create(context,\"run\", \"pagdagan\",2);\n WordRepository.create(context,\"enter\", \"pagsulod\",2);\n WordRepository.create(context,\"in love\", \"sa gugma\",2);\n WordRepository.create(context,\"walk\", \"lakaw\",2);\n WordRepository.create(context,\"push\", \"pagduso\",2);\n WordRepository.create(context,\"old\", \"tigulang na\",2);\n WordRepository.create(context,\"generous\", \"manggihatagon\",2);\n WordRepository.create(context,\"brave\", \"maisog\",2);\n WordRepository.create(context,\"funny\", \"kataw-anan\",2);\n WordRepository.create(context,\"evil\", \"daotan\",2);\n WordRepository.create(context,\"rich\", \"dato\",2);\n WordRepository.create(context,\"poor\", \"kabus\",2);\n WordRepository.create(context,\"shy\", \"maulaw\",2);\n WordRepository.create(context,\"ugly\", \"pangit\",2);\n WordRepository.create(context,\"dirty\", \"hugaw\",2);\n WordRepository.create(context,\"clean\", \"limpyo\",2);\n WordRepository.create(context,\"handsome\", \"gwapo\",2);\n WordRepository.create(context,\"smiling\", \"nagpahiyom\",2);\n WordRepository.create(context,\"beautiful\", \"matahum\",2);\n WordRepository.create(context,\"slouch\", \"pahuway\",2);\n WordRepository.create(context,\"tense\", \"labi\",2);\n WordRepository.create(context,\"short\", \"mubo\",2);\n WordRepository.create(context,\"tall\", \"taas\",2);\n WordRepository.create(context,\"big\", \"dako\",2);\n WordRepository.create(context,\"skinny\", \"panit\",2);\n WordRepository.create(context,\"small\", \"gamay\",2);\n WordRepository.create(context,\"deep\", \"lawom\",2);\n WordRepository.create(context,\"wide\", \"sa gilapdon\",2);\n WordRepository.create(context,\"roud\", \"makusog\",2);\n WordRepository.create(context,\"straight\", \"tul-id\",2);\n WordRepository.create(context,\"spicy\", \"maanindot\",2);\n WordRepository.create(context,\"salty\", \"asin\",2);\n WordRepository.create(context,\"sweet\", \"matam-is\",2);\n WordRepository.create(context,\"bitter\", \"pait\",2);\n WordRepository.create(context,\"harug\", \"harug\",2);\n WordRepository.create(context,\"cold\", \"kabugnaw\",2);\n WordRepository.create(context,\"hot\", \"init\",2);\n WordRepository.create(context,\"soft\", \"humok\",2);\n WordRepository.create(context,\"hard\", \"lisud\",2);\n WordRepository.create(context,\"dry\", \"uga nga\",2);\n WordRepository.create(context,\"smooth\", \"hamis nga\",2);\n WordRepository.create(context,\"rought\", \"gihunahuna\",2);\n WordRepository.create(context,\"wet\", \"basa\",2);\n WordRepository.create(context,\"silent\", \"hilom\",2);\n WordRepository.create(context,\"loud\", \"kusog\",2);\n WordRepository.create(context,\"noisy\", \"lanog\",2);\n WordRepository.create(context,\"awful\", \"makalilisang\",2);\n WordRepository.create(context,\"tingog\", \"kinabuhi\",2);\n WordRepository.create(context,\"whisper\", \"paghunghong\",2);\n WordRepository.create(context,\"few\", \"diyutay\",2);\n WordRepository.create(context,\"some\", \"pipila\",2);\n WordRepository.create(context,\"multiple\", \"daghang\",2);\n WordRepository.create(context,\"plenty\", \"daghan\",2);\n WordRepository.create(context,\"many\", \"daghan\",2);\n WordRepository.create(context,\"one\", \"sa usa ka\",2);\n WordRepository.create(context,\"several\", \"ubay-ubay\",2);\n WordRepository.create(context,\"each\", \"matag usa\",2);\n WordRepository.create(context,\"all\", \"tanan\",2);\n WordRepository.create(context,\"nasty\", \"dili maayo\",2);\n WordRepository.create(context,\"waiting\", \"naghulat\",2);\n WordRepository.create(context,\"horrible\", \"makalilisang\",2);\n WordRepository.create(context,\"artisimple\", \"artipisyal\",2);\n WordRepository.create(context,\"doubtfully\", \"pagduhaduha\",2);\n WordRepository.create(context,\"rainy\", \"ulan,\",2);\n WordRepository.create(context,\"dangerous\", \"delikado\",2);\n WordRepository.create(context,\"angry\", \"nasuko\",2);\n WordRepository.create(context,\"hurt\", \"nasakitan\",2);\n WordRepository.create(context,\"selfish\", \"hakog\",2);\n WordRepository.create(context,\"scary\", \"makahadlok\",2);\n WordRepository.create(context,\"confused\", \"naglibog\",2);\n WordRepository.create(context,\"tired\", \"gikapoy\",2);\n WordRepository.create(context,\"embarass\", \"panghimaraot\",2);\n WordRepository.create(context,\"afraid\", \"nahadlok\",2);\n WordRepository.create(context,\"lazy\", \"tapolan\",2);\n }", "@NonNull\n @MainThread\n protected abstract LiveData<ResultType> loadFromDb();", "public void loadTermsFromCSV(String table, String dictionary) {\n // Get csv file\n String[] dictionaryList = myContext.getResources().getStringArray(R.array.dictionary_names);\n String[] csvList = myContext.getResources().getStringArray(R.array.dictionary_csv);\n int index = Arrays.asList(dictionaryList).indexOf(dictionary);\n String dictionaryCSV = csvList[index];\n\n // Get database object\n SQLiteDatabase db = this.getWritableDatabase();\n\n // Prepare sql statment\n String sql = \"INSERT INTO \" + table + \" (\" +\n KEY_DICTIONARY + \", \" + KEY_TERM + \", \" + KEY_SUBJECT + \", \" + KEY_DEFINITION + \", \" + KEY_SYNONYMS +\n \") VALUES (?, ?, ?, ?, ?)\";\n\n // Compile sql statment\n SQLiteStatement statement = db.compileStatement(sql);\n\n // Start transaction\n db.beginTransaction();\n try {\n // Source: http://www.simplecodestuffs.com/read-write-csv-file-in-java-using-opencsv-library\n CSVReader reader;\n try {\n reader = new CSVReader(new InputStreamReader(myContext.getAssets().open(dictionaryCSV)));\n String[] row;\n\n while ((row = reader.readNext()) != null) {\n // Clear statment bindings\n statement.clearBindings();\n // Bind corresponding values to sql statement\n statement.bindString(1, dictionary);\n statement.bindString(2, row[1]);\n statement.bindString(3, row[0]);\n statement.bindString(4, row[7] + \";\" + row[8] + \";\" + row[9]);\n statement.bindString(5, row[5]);\n // Execute sql statement\n statement.execute();\n }\n }\n catch (FileNotFoundException e) { }\n catch (IOException e) { }\n\n statement.close();\n db.setTransactionSuccessful();\n } finally {\n // End transaction\n db.endTransaction();\n }\n }", "public void run() {\n\n if (Thread.interrupted()) { //Check if thread is interrupted.\n System.out.println(Thread.currentThread().getName() + \" is interrupted\");\n return;\n }\n\n String stringHtml;\n DBConnection db4 = DBConnection.getInstance();\n\n lock.lock(); //Lock area for multithreading.Only 1 thread can enter here each time.Without this lock, [SQLITE_BUSY]-database is locked errors occurs.\n try {\n\n //Search the URL for the keywords\n stringHtml = Jsoup.connect(db4.selectUrlbyID(selectedUrlId)).timeout(0).get().text();\n\n\n int k = 0;\n int count = 0;\n String impressionsStr; // String with 100 characters search for positive-negative impressions .\n\n int keywordsInsertId;\n ArrayList<Integer> negativeTermsId= new ArrayList<>();\n ArrayList<Integer> positiveTermsId= new ArrayList<>();\n\n int negid, posid;\n\n\n //Loop through all the keywords given by the user.\n for (String keyword : keyArrayList) {\n\n if (Thread.interrupted()) { //Check if thread is interrupted.\n System.out.println(Thread.currentThread().getName() + \" is interrupted\");\n return;\n }\n\n //Regular expressions\n Pattern ptrn = Pattern.compile(keyword, CASE_INSENSITIVE);\n Matcher mtchr = ptrn.matcher(stringHtml);\n keywordsInsertId = db4.insertKeyword(selectedUrlId, keyword, 0); //Inserts a new row in keywords table and returns its id .\n\n while (mtchr.find(k)) { //Resets this matcher and then attempts to find the next subsequence of the input sequence that matches the pattern, starting at the specified index.\n count++;\n k = mtchr.start() + 1; //Returns the start index of the previous match(start()).\n\n //Create the String(impressionStr) that will be used for negative-positive impression checking.\n if (k > 50 && stringHtml.length() > k + 50) {\n impressionsStr = stringHtml.substring(k - 50, k + 50);\n } else if (k < 50 && stringHtml.length() > k + 50) {\n impressionsStr = stringHtml.substring(0, k + 50);\n } else if (k > 50 && stringHtml.length() < k + 50) {\n impressionsStr = stringHtml.substring(k - 50, stringHtml.length());\n } else {\n impressionsStr = stringHtml.substring(0, stringHtml.length());\n }\n\n\n negid = db4.searchNegativeImpressions(selectedUrlId, keywordsInsertId, impressionsStr); //Get the id of the negative term found, or -1 if no term was found.\n posid = db4.searchPositiveImpressions(selectedUrlId, keywordsInsertId, impressionsStr); //Get the id of the positive term found, or -1 if no term was found.\n\n //Add the term id to the negative and positive ArrayLists.\n if(negid != -1)\n negativeTermsId.add(negid);\n if(posid != -1)\n positiveTermsId.add(posid);\n }\n\n if(count != 0){\n db4.updateKeywordsCountById(count,keywordsInsertId); //Update the keywords database table with the number of times the keyword was found in the URL.\n\n }\n\n //Print the results of keyword and positive-negative term search.\n System.out.println(\"\\n==========Keywords Count==========\");\n System.out.println(\"URL: \"+ db4.selectUrlbyID(selectedUrlId)+\" ,Keyword: \"+keyword+\" ,Times Shown: \"+count);\n\n System.out.println(\"==========Negative Terms==========\");\n if(negativeTermsId.isEmpty()){\n System.out.println(\"No negative terms were found.\");\n }\n else{\n for(int nterm : negativeTermsId){\n System.out.println(\"Negative term id:\" + nterm);\n System.out.println(\"URL: \"+db4.selectUrlbyID(selectedUrlId)+\" Keyword: \"+keyword+\" Negative term: \"+db4.selectNegativeTermByID(nterm));\n }\n }\n\n System.out.println(\"==========Positive Terms==========\");\n if(positiveTermsId.isEmpty()){\n System.out.println(\"No positive terms were found.\");\n }\n else{\n for(int pterm : positiveTermsId){\n System.out.println(\"Positive term id:\" + pterm);\n System.out.println(\"URL: \"+db4.selectUrlbyID(selectedUrlId)+\" Keyword: \"+keyword+\" Positive term: \"+db4.selectPositiveTermByID(pterm));\n }\n }\n\n k = 0;\n count = 0;\n negativeTermsId.clear(); //Clear ArrayLists that store negative-positive term ids.\n positiveTermsId.clear();\n\n\n }\n } catch (IllegalArgumentException e) {\n e.printStackTrace();\n return;\n } catch (IOException e) {\n e.printStackTrace();\n return;\n } catch(Exception e){\n e.printStackTrace();\n return;\n }\n finally{\n lock.unlock(); //Unlock area.\n }\n\n }", "void runQueries();", "public void loadTasks()\r\n\t{\n\t\ttable = loadTable(\"../data/tasks.csv\", \"header\");\r\n\t\t\r\n\t\t//gets amount of data rows in table\r\n\t\trow_count = table.getRowCount();\r\n\t\t//println(row_count);\r\n\t\t\r\n\t\t//put each row in table into Task class objects and initialise them\r\n\t\tfor(TableRow r : table.rows()){\r\n\t\t\ttasks.add(new Task(r));\r\n\t\t}\r\n\t\t\r\n\t}", "public void initFromDb() {\n // Get load list of symbols to query\n new AsyncTask<ContentResolver, Void, Void>() {\n @Override\n protected Void doInBackground(ContentResolver... params) {\n Cursor cursor = null;\n try {\n ContentResolver cr = params[0];\n int shownPositionBookmark = Utility.getShownPositionBookmark(cr);\n\n // Query db for data up to the list position bookmark;\n cursor = cr.query(\n StockEntry.CONTENT_URI,\n ListManipulator.STOCK_PROJECTION,\n StockProvider.LIST_POSITION_SELECTION,\n new String[]{Integer.toString(shownPositionBookmark)},\n StockProvider.ORDER_BY_LIST_POSITION_ASC_ID_DESC);\n\n // Extract StockChange data from cursor\n if (cursor != null) {\n int cursorCount = cursor.getCount();\n if (cursorCount > 0) {\n mListManipulator.setShownListCursor(cursor);\n mListManipulator.setLoadList(getLoadListFromDb(cr));\n mListManipulator.addToLoadListPositionBookmark(cursorCount);\n }\n }\n } finally {\n if (cursor != null) {\n cursor.close();\n }\n }\n return null;\n }\n\n @Override\n protected void onPostExecute(Void aVoid) {\n ListEventQueue.getInstance().post(new InitLoadFromDbFinishedEvent(\n MyApplication.getInstance().getSessionId()));\n }\n }.execute(getActivity().getContentResolver());\n }", "public void load (Word word, int distance, int lookahead)\n\t\tthrows PersistenceException\n\t{\n\t\tInfo info = (Info)map.get(word);\n\t\tif (info == null || info.loaded) return;\n\t\tList list = info.list;\n\t\tint listSize = list.size();\n\t\tint pos = info.pos;\n\t\tint lastPos = Math.min(listSize, pos + lookahead + 1);\n\t\tArrayList words = new ArrayList();\n\t\tfor (int i = pos; i < lastPos; i++) {\n\t\t\tword = (Word)list.get(i);\n\t\t\tinfo = (Info)map.get(word);\n\t\t\tif (!info.loaded) {\n\t\t\t\twords.add(word);\n\t\t\t\tinfo.loaded = true;\n\t\t\t}\n\t\t}\n\t\tpm.getColocates(words, distance);\n//\t\tCollocateUtils.getColocates(pm, words, distance);\n\t}", "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 void setupDBs()\n {\n\t mSetupDBTask = new SetupDBTask(this);\n\t\tmSetupDBTask.execute((Void[])null);\n }", "public void getAlchemyTone() throws SQLException {\n\t\tfor (List<PageExtract> splitList : CommonFunctions.split(getList(), 30)) {\n\t\t\tgetDocumentSentimentThreadList(splitList);\n\t\t}\n\t}", "private void buildWordTable(Scanner source)\n {\n int linenum = 0;\n String currentline = \"\";\n String[] splitsent;\n //Scans file line by line\n while(source.hasNextLine())\n {\n //line number of the file\n linenum++;\n //reads the current line of the file\n currentline = source.nextLine();\n //replaces all punctions to \"\" so the file doesnt read it\n currentline = currentline.replace(\",\", \"\");\n currentline = currentline.replace(\".\", \"\");\n currentline = currentline.replace(\";\", \"\");\n currentline = currentline.replace(\":\", \"\");\n currentline = currentline.replace(\"?\", \"\");\n currentline = currentline.replace(\"!\", \"\");\n //split the line into an array whereever there is a space\n splitsent = currentline.split(\" \");\n for(String run : splitsent)\n {\n update(run,linenum);\n }\n }\n }", "public static void main(String[] args) throws SQLException {\n\t\tConnection con = getCon();\r\n\t\tStatement stmt = con.createStatement();\r\n\t\tMap<String, String> maps = new HashMap<String, String>();\r\n\t\tmaps.put(\"word\", \"String\");\r\n\t\tmaps.put(\"user\", \"String\");\r\n\t\tmaps.put(\"tfidf\", \"String\");\r\n//\t\tdropTable(con, \"hivetest324\");\r\n//\t\tSystem.out.println(createTable(con, \"hivetest324\", maps));\r\n\t\tString sql = \"select num from mytest\";\r\n\t\tselectTable(con, sql);\r\n\t\t\r\n//\t\tsql = \"load data local inpath 'E:/work/tfidf' overwrite into table tfidf\";\r\n//\t\tSystem.out.println(loadData(con, sql));\r\n\t\t\r\n//\t\tsql = \"show tables\";\r\n//\t\tResultSet res = stmt.executeQuery(sql);\r\n//\t\twhile(res.next()){\r\n//\t\t\tSystem.out.println(res.getString(1));\r\n//\t\t}\r\n\t}", "public void beginInitialization() {\n SQLiteDatabase db = this.helper.getWritableDatabase();\n db.beginTransaction();\n populateMeasurementVersionsCache(db);\n }", "public void start() {\n \n for (Object obj: bufferedQueries) {\n \n switch(obj.getClass().getName()) {\n case \"uzh.tomdb.db.operations.Insert\":\n if (inserts == null) {\n inserts = new ArrayList<>();\n }\n inserts.add((Insert) obj);\n break;\n case \"uzh.tomdb.db.operations.CreateTable\":\n if (creates == null) {\n creates = new ArrayList<>();\n }\n creates.add((CreateTable) obj);\n break;\n case \"uzh.tomdb.db.operations.Update\":\n if (updates == null) {\n updates = new ArrayList<>();\n }\n updates.add((Update) obj);\n break;\n case \"uzh.tomdb.db.operations.Delete\":\n if (deletes == null) {\n deletes = new ArrayList<>();\n }\n deletes.add((Delete) obj);\n break;\n }\n }\n \n if (inserts != null) {\n inserts();\n }\n if (creates != null) {\n creates();\n }\n if (updates != null) {\n updates();\n }\n if (deletes != null) {\n deletes();\n }\n }", "private void createDocWords() {\n\t\tArrayList<DocWords> docList=new ArrayList<>();\n\t\ttry {\n\t\t\tBufferedReader in = new BufferedReader(new FileReader(\"E:\\\\graduate\\\\cloud\\\\project\\\\data\\\\docWords.txt\"));\n\t\t\tString line = \"\";\n\t\t\twhile ((line = in.readLine()) != null) {\n\t\t\t\tString parts[] = line.split(\" \");\n\t\t\t\tDocWords docWords=new DocWords();\n\t\t\t\tdocWords.setDocName(parts[0].replace(\".txt\", \"\"));\n\t\t\t\tdocWords.setCount(Float.parseFloat(parts[1]));\n\t\t\t\tdocList.add(docWords);\n\t\t\t}\n\t\t\tin.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tDBUtil.insertDocWords(docList);\n\t}", "private Thread createThread() {\n return new Thread(this::_loadCatalog, \"CDS Hooks Catalog Retrieval\"\n );\n }", "private void startRetrieve() {\n final Thread retrieveThread = new Thread(new FutureThread());\n retrieveThread.start();\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 setupDb(){\n try {\n openConnection();\n s.executeUpdate(\"CREATE TABLE IF NOT EXISTS LIB (NAME text UNIQUE , TYPE text, LANGUAGE text, INTRUSIVE text, OPENSOURCE text)\");\n }catch (SQLException e) {\n System.err.println(e.getMessage());\n }finally {\n if (c != null){\n close(c);\n }\n }\n }", "private void getIBMToneThreadList(final List<PageExtract> pl) {\n\t\ttry {\n\t\t\tfinal DbConnector db = new DbConnector();\n\n\t\t\tnew Thread() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tfor (PageExtract p : pl) {\n\t\t\t\t\t\tString content = p.getContent();\n\t\t\t\t\t\tif (!content.equals(\"\")) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tToneAnalysis a = ToneAnalyzerUtil.getInstance().getTone(content);\n\n\t\t\t\t\t\t\t\tdb.executeUpdate(SqlConstants.PAGE_IBM_TONE_UPDATE,\n\t\t\t\t\t\t\t\t\t\tArrays.asList(a.toString(), String.valueOf(p.getPageId())));\n\t\t\t\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}.start();\n\t\t} catch (ClassNotFoundException | SQLException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t}", "private void loadDatabase(){\n \t\n String db = jFieldDBFile.getText().trim();\n boolean badzip = false;\n \n Collection<String> zf = new LinkedList<String>();\n \n // handle zipcodes if zip filtering specified\n if(jCheckBoxZipFilter.isSelected()){\n\t \n \tString zips = jTextFieldZipcodes.getText().trim();\n\t \n\t String[] z = zips.split(\",\");\n\t for(int i = 0; i < z.length; i++){\n\t \tzf.add(z[i].trim());\n\t }\n\t \n\t for(String s : zf){\n\t \tif(s.length() != 5){\n\t \t\tbadzip = true;\n\t \t}\n\t \ttry{\n\t \t\tInteger.parseInt(s);\n\t \t}catch(NumberFormatException ex){\n\t \t\tbadzip = true;\n\t \t}\n\t }\n\t \n }\n \n // if the zipcode input is bad\n if(badzip){\n \toutputResults(\"Please check your zipcodes.\\nA zipcode must be a 5 digit number...\\n\");\n \tjButtonDBLoad.setForeground(new java.awt.Color(255, 37, 37));\n \tjButtonDBLoad.setText(\"Check Zipcodes\");\n }else{\n\t // attempt to load database\n\t try{\n\t \t\n\t \tif(DEBUG_SETDB) db = DEBUG_DB;\n\t \t\n\t \tjButtonDBLoad.setForeground(Color.BLACK);\n\t \tjButtonDBLoad.setText(\"Loading...\");\n\t \tvirtualGPS = DirectionsFinder.getDirectionsFinder(db, zf);\n\t jButtonDBLoad.setText(\"Load Database\");\n\t \n\t \tjPanelAddr.setVisible(true);\n\t \tjPanelDB.setVisible(false);\n\t jButtonDBToAddr.setVisible(true);\n\t \t\n\t }catch(InvalidDatabaseException ex){\n\t \toutputResults(\"Please check the database path.\\nThe path name must refer \" +\n\t \t\t\t\"to a valid Tiger Database...\\n\");\n\t jButtonDBLoad.setForeground(new java.awt.Color(255, 37, 37));\n\t jButtonDBLoad.setText(\"Check Database\");\n\t }\n }\n \t\n }", "public void run() {\n\t\t\tJTable jt = new JTable();\n\t\t\n\t\t}", "public static void main(String[] args){\n\r\n StringDB Database = new StringDB();\r\n Database.execute(\"INSERT INTO teachers VALUES ( 'Martin_Aumüller' , 'maau' ) ;\");\r\n\r\n\r\n\r\n }", "private void ejecutorDeServicio(){\r\n dbExeccutor = Executors.newFixedThreadPool(\r\n 1, \r\n new databaseThreadFactory()\r\n ); \r\n }", "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 }", "private void loadDataFromDatabase() {\n mSwipeRefreshLayout.setRefreshing(true);\n mPresenter.loadDataFromDatabase();\n }", "private static void loadDiscoveryDataFromProtexServer(\r\n\t\t\tProjectDiscoveryController pProjectDiscoveryController, \r\n\t\t\tUIResponseObserver observer) {\n\t\tString projectName = pProjectDiscoveryController.getProjectName();\r\n\t\tIdentificationDBManager.init(projectName);\r\n\t\tReportAPIWrapper.discardAllDataForProject(projectName);\r\n\t\t\r\n\t\tlog.debug(\"@@@ table generation start (loading from Protex Server- \"+new java.util.Date());\r\n\t\t\r\n\t\tobserver.setMessageHeader(\"Update Identification Table from Protex Server...\\n\");\r\n\t\tobserver.pushMessageWithHeader(\" > Generating Match Table from Protex Server.\\n\");\r\n\t\tlog.debug(\" > Generating Match Table.\");\r\n\t\t\r\n\t\tReportEntityList identifiedFiles = ReportAPIWrapper.getIdentifiedFiles(projectName, new DefaultUIResponseObserver(), true);\r\n\t\tReportEntityList stringSearch = ReportAPIWrapper.getStringSearches(projectName, new DefaultUIResponseObserver(), true);\r\n\t\tReportEntityList compareCodeMatches = ReportAPIWrapper.getCompareCodeMatches(projectName,observer, true);\r\n//\t\tReportEntityList codeMatchesPrecision = ReportAPIWrapper.getCodeMatchesPrecision(projectName,observer, true);\r\n\t\tReportEntityList codeMatchesPrecision = ReportAPIWrapper.precessCodeMatchesPrecision(projectName,observer, true);\r\n\t\tReportEntityList patternMatchesPendingFiles = ReportAPIWrapper.getPatternMatchesPendingFiles(projectName, new DefaultUIResponseObserver(), true);\r\n\t\t\r\n\t\tArrayList<DiscoveryControllerLoaderThread> discoveryDataLoader = new ArrayList<DiscoveryControllerLoaderThread>();\r\n\t\t\r\n\t\tdiscoveryDataLoader.add(\r\n\t\t\t\tnew StringSearchDiscoveryControllerLoaderThread(\r\n\t\t\t\t\t\tpProjectDiscoveryController,\r\n\t\t\t\t\t\tobserver,\r\n\t\t\t\t\t\tidentifiedFiles, \r\n\t\t\t\t\t\tstringSearch,\r\n\t\t\t\t\t\tcompareCodeMatches,\r\n\t\t\t\t\t\tcodeMatchesPrecision,\r\n\t\t\t\t\t\tpatternMatchesPendingFiles\r\n\t\t\t\t\t\t));\r\n\t\t\r\n\t\tdiscoveryDataLoader.add(\r\n\t\t\t\tnew CodeMatchDiscoveryControllerLoaderThread(\r\n\t\t\t\t\t\tpProjectDiscoveryController,\r\n\t\t\t\t\t\tobserver,\r\n\t\t\t\t\t\tidentifiedFiles, \r\n\t\t\t\t\t\tstringSearch,\r\n\t\t\t\t\t\tcompareCodeMatches,\r\n\t\t\t\t\t\tcodeMatchesPrecision,\r\n\t\t\t\t\t\tpatternMatchesPendingFiles\r\n\t\t\t\t\t\t));\r\n\t\t\r\n\t\tdiscoveryDataLoader.add(\r\n\t\t\t\tnew PatternMatchDiscoveryControllerLoaderThread(\r\n\t\t\t\t\t\tpProjectDiscoveryController,\r\n\t\t\t\t\t\tobserver,\r\n\t\t\t\t\t\tidentifiedFiles, \r\n\t\t\t\t\t\tstringSearch,\r\n\t\t\t\t\t\tcompareCodeMatches,\r\n\t\t\t\t\t\tcodeMatchesPrecision,\r\n\t\t\t\t\t\tpatternMatchesPendingFiles\r\n\t\t\t\t\t\t));\t\t\t\t\r\n\t\t\r\n\t\ttry {\r\n\t\t\t// starting loaders\r\n\t\t\tfor(int i=0; i<discoveryDataLoader.size(); i++) {\r\n\t\t\t\tdiscoveryDataLoader.get(i).start();\r\n\t\t\t}\r\n\t\t\t// waiting for finishing loaders.\r\n\t\t\tfor(int i=0; i<discoveryDataLoader.size(); i++) {\r\n\t\t\t\tlog.debug(\"@@@ DiscoveryControllerThread joining : \" + discoveryDataLoader.get(i).getClass().getName());\r\n\t\t\t\tdiscoveryDataLoader.get(i).join();\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tlog.warn(e);\r\n\t\t}\r\n\t\tlog.debug(\"@@@ table generate end - \"+new java.util.Date());\r\n\t}", "private void getAllNewsFromDatabase() {\n new GetAllNewsAsyncTask(newsDao).execute(newsList);\n }", "@Query(\"SELECT * from english_word ORDER BY word ASC limit 300\")\n List<StoredEnglishWord> findAllWords();", "public void run()\n\t\t\t{\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(5000);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\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 * Process Query Here\n\t\t\t\t * \n\t\t\t\t **/\n\t\t\t}", "private void getDocumentSentimentThreadList(final List<PageExtract> pl) {\n\t\ttry {\n\t\t\tfinal DbConnector db = new DbConnector();\n\n\t\t\tnew Thread() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tfor (PageExtract p : pl) {\n\t\t\t\t\t\tString content = p.getContent();\n\t\t\t\t\t\tif (!content.equals(\"\")) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t * Put string into map and get tone\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\tMap<String, Object> params = new HashMap<String, Object>();\n\t\t\t\t\t\t\t\tparams.put(AlchemyLanguage.TEXT, content);\n\t\t\t\t\t\t\t\tDocumentSentiment docSentiment = AlchemyLanguageUtil.getInstance()\n\t\t\t\t\t\t\t\t\t\t.getDocumentSentiment(params);\n\n\t\t\t\t\t\t\t\tdb.executeUpdate(SqlConstants.PAGE_ALCHEMY_TONE_UPDATE,\n\t\t\t\t\t\t\t\t\t\tArrays.asList(docSentiment.toString(), String.valueOf(p.getPageId())));\n\t\t\t\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}.start();\n\t\t} catch (ClassNotFoundException | SQLException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t}", "private void stream(int i, int[] seeds) throws Exception {\n\n\t\tExecutorService dataExecutor = Executors.newFixedThreadPool(NTHREDS);\n\t\t/**\n\t\t * which table we're currently working on\n\t\t */\n\t\tint tableType = i % 3;\n\t\tRunnable worker1 = new RepeatDataThread(tableType,\n\t\t\t\tApplication.THREAD_ONE_PATH + \"t\" + (tableType + 1), seeds[0]);\n\t\tRunnable worker2 = new RepeatDataThread(tableType,\n\t\t\t\tApplication.THREAD_TWO_PATH + \"t\" + (tableType + 1), seeds[1]);\n\t\tRunnable worker3 = new RepeatDataThread(tableType,\n\t\t\t\tApplication.THREAD_THREE_PATH + \"t\" + (tableType + 1), seeds[2]);\n\t\tRunnable worker4 = new RepeatDataThread(tableType,\n\t\t\t\tApplication.THREAD_FOUR_PATH + \"t\" + (tableType + 1), seeds[3]);\n\t\tdataExecutor.execute(worker1);\n\t\tdataExecutor.execute(worker2);\n\t\tdataExecutor.execute(worker3);\n\t\tdataExecutor.execute(worker4);\n\t\tdataExecutor.shutdown();\n\t\t// Wait until all threads are finish\n\t\t// if a table takes more than (approx) 40mins then the row size\n\t\t// is set too high, and load may fail.\n\t\tdataExecutor.awaitTermination(40, TimeUnit.MINUTES);\n\t\tSystem.out.println(\"loading tables\");\n\t\tExecutorService loadExecutor = Executors.newFixedThreadPool(NTHREDS);\n\t\tRunnable loadWorker1 = new LoadThread(Application.THREAD_ONE_PATH + \"t\" + (tableType + 1)); \n\t\tRunnable loadWorker2 = new LoadThread(Application.THREAD_TWO_PATH + \"t\" + (tableType + 1));\n\t\tRunnable loadWorker3 = new LoadThread(Application.THREAD_THREE_PATH + \"t\" + (tableType + 1)); \n\t\tRunnable loadWorker4 = new LoadThread(Application.THREAD_FOUR_PATH + \"t\" + (tableType + 1));\n\t\tloadExecutor.execute(loadWorker1); \n\t\tloadExecutor.execute(loadWorker2);\n\t\tloadExecutor.execute(loadWorker3); \n\t\tloadExecutor.execute(loadWorker4);\n\t\tloadExecutor.shutdown(); \n\t\tloadExecutor.awaitTermination(40,TimeUnit.MINUTES);\n\t\tcleanDirs();\n\n\t\tSystem.out.println(\"Finished all threads\");\n\n\t}", "public void buildDB(){\n db = Room.databaseBuilder(getApplicationContext(),\n AppDatabase.class, \"classattendance\").allowMainThreadQueries().build();\n }", "public synchronized void run() {\n\t\ttry {\n\t\t\tcnnode.BroadCastTable(cnnode.TimeStamp1,cnnode.RouteTable1);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\ttry {\n\t\t\tThread.sleep(100);\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\tcnnode.PrintRouteTable(cnnode.RouteTable1);\n\t}", "public CancellaTuttoThreadDB(AppDatabase db){\n this.db = db;\n running = true;\n }", "public static void main(String[] args) {\n Bahasa kata = new Bahasa(\"Thread 1\");\n English word = new English(\"Thread 2\");\n\n // calling getWord method to accept user input\n// kata.getWord();\n// word.getWord();\n\n //objects call start method from the Thread class\n// kata.start();\n// word.start();\n\n// kata.printword();\n// word.printword();\n\n }", "public void loadDatabaseRecords() {\n // Database credentials\n String pass = \"\";\n\n InputStream passPath = Controller.class.getResourceAsStream(\"/password.txt\");\n if (passPath == null) {\n System.out.println(\"Could not find password in resources folder\");\n }\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(passPath));\n String line = null;\n while (true) {\n try {\n if (!((line = reader.readLine()) != null)) {\n break;\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n System.out.println(line);\n if (line != null) {\n pass = line;\n System.out.println(\"Password login: \" + line);\n break;\n }\n }\n\n Connection conn;\n //Connection conn = null; //Temporary\n Statement stmt = null; //Temporary\n\n try {\n // STEP 1: Register JDBC driver\n Class.forName(\"org.h2.Driver\");\n\n //STEP 2: Open a connection\n conn = DriverManager.getConnection(\"jdbc:h2:./res/HR\", \"\",\n pass);\n\n stmt = conn.createStatement();\n ResultSet rs = stmt.executeQuery(\n \"SELECT * FROM PRODUCTIONRECORD\");\n\n int tempCounter = 0;\n while (rs.next()) {\n String prodNum = rs.getString(\"PRODUCTION_NUM\");\n String prodID = rs.getString(\"PRODUCT_ID\");\n String prodSerialNum = rs.getString(\"SERIAL_NUM\").toString();\n String prodDate = rs.getString(\"DATE_PRODUCED\").toString();\n String empUsername = rs.getString(\"USERNAME\").toString();\n textLog.setText(\n textLog.getText() + \"\\n\" + \"Prod. Num: \" + prodNum + \" Product ID: \" + prodID\n + \" Serial Num: \" + prodSerialNum + \" \" + prodDate + \" \" + empUsername);\n tempCounter++;\n }\n globalProductCount = tempCounter;\n productTable.setItems(productLine);\n listProduce.setItems(productLine);\n\n stmt.close(); //Close\n conn.close(); //Close\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "private void loadDictWords(String dictFile) {\n try {\n BufferedReader reader = new BufferedReader(new FileReader(dictFile));\n\n String word = reader.readLine();\n while (word != null) {\n word = word.trim().toLowerCase();\n wordsList.add(word);\n\n word = reader.readLine();\n }\n reader.close();\n } catch (FileNotFoundException e) {\n System.out.println(\"Error: Cannot find dictionary file at location: \" + dictFile);\n } catch (IOException e) {\n System.out.println(\"Error: Failed to open and read dictionary file at location: \" + dictFile);\n }\n }", "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 }", "public void start()\n {\n VoltDB.instance().schedulePriorityWork(\n this,\n 1,\n 1,\n TimeUnit.SECONDS);\n }", "public void playDB(){\n\t\tboolean emptyPot = false;\n\t\tint points = myPC.count(myPC.createWords(myField.getTiles(), myField.getNewWords()), myField.getTiles(), myField.getNewWords().size());\n\t\tint turn = DBCommunicator.requestInt(\"SELECT id FROM beurt WHERE spel_id = \" + id + \" AND account_naam = '\" + app.getCurrentAccount().getUsername() + \"' ORDER BY id DESC\");\n\t\tturn += 2;\n\t\t\n\t\tDBCommunicator.writeData(\"INSERT INTO beurt (id, spel_id, account_naam, score, aktie_type) VALUES (\" + turn + \", \" + id + \", '\" + app.getCurrentAccount().getUsername() + \"', \" + points + \", 'Word')\");\n\t\t\n\t\tHashMap<String, GameStone> newWords = myField.getNewWords();\n\t\tSystem.out.println(newWords);\n\t\tArrayList<Integer> addedInts = new ArrayList<Integer>();\n\t\t\n\t\tfor(Entry<String, GameStone> word : newWords.entrySet()){\n\t\t\tSystem.out.println(word.getKey());\n\t\t\tString key = word.getKey();\n\t\t\tint x = 0;\n\t\t\tint y = 0;\n\t\t\t\n\t\t\tString[] cords = key.split(\",\");\n\t\t\tx = Integer.parseInt(cords[0]);\n\t\t\ty = Integer.parseInt(cords[1]);\n\t\t\t\n\t\t\t\n\t\t\tint stoneID = word.getValue().getID();\n\t\t\tSystem.out.println(stoneID);\n\t\t\tString character = DBCommunicator.requestData(\"SELECT letterType_karakter FROM letter WHERE id = \" + stoneID + \" AND spel_id = \" + id);\n\t\t\tSystem.out.println(character);\n\t\t\tif(!character.equals(\"?\")){\n\t\t\t\tDBCommunicator.writeData(\"INSERT INTO gelegdeletter (letter_id, spel_id, beurt_id, tegel_x, tegel_y, tegel_bord_naam, blancoletterkarakter)\"\n\t\t\t\t\t\t+ \" VALUES(\" + stoneID + \", \" + id + \", \" + turn + \", \" + x + \", \" + y + \", 'Standard', NULL)\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\tDBCommunicator.writeData(\"INSERT INTO gelegdeletter (letter_id, spel_id, beurt_id, tegel_x, tegel_y, tegel_bord_naam, blancoletterkarakter)\"\n\t\t\t\t\t\t+ \" VALUES(\" + stoneID + \", \" + id + \", \" + turn + \", \" + x + \", \" + y + \", 'Standard', '\" + word.getValue().getLetter() + \"')\");\n\t\t\t}\n\t\t\t\n\t\t\tfor(int e = 0; e < gameStones.size(); e++){\n\t\t\t\tif(gameStones.get(e) == stoneID){\n\t\t\t\t\t\n\t\t\t\t\tint potSize = DBCommunicator.requestInt(\"SELECT COUNT(letter_id) FROM pot WHERE spel_id = \" + id);\n\t\t\t\t\tif(potSize != 0){\n\t\t\t\t\t\tboolean added = false;\n\t\t\t\t\t\twhile(!added){\n\t\t\t\t\t\t\tint letterID = (int) (Math.random() * 105);\n\t\t\t\t\t\t\tSystem.out.println(letterID);\n\t\t\t\t\t\t\tString randCharacter = DBCommunicator.requestData(\"SELECT karakter FROM pot WHERE spel_id = \" + id + \" AND letter_id = \" + letterID);\n\t\t\t\t\t\t\tif(randCharacter != null){\n\t\t\t\t\t\t\t\tboolean inStones = false;\n\t\t\t\t\t\t\t\tfor(int a = 0; a < gameStones.size(); a++){\n\t\t\t\t\t\t\t\t\tSystem.out.println(gameStones.get(a));\n\t\t\t\t\t\t\t\t\tif(gameStones.get(a) == letterID){\n\t\t\t\t\t\t\t\t\t\tinStones = true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(!inStones){\n\t\t\t\t\t\t\t\t\tgameStones.set(e,letterID);\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"PLACE \"+ id +\" \"+ letterID +\" \"+ turn);\n\t\t\t\t\t\t\t\t\tDBCommunicator.writeData(\"INSERT INTO letterbakjeletter (spel_id, letter_id, beurt_id) VALUES (\" + id + \", \" + letterID + \", \" + turn + \")\");\n\t\t\t\t\t\t\t\t\taddedInts.add(letterID);\n\t\t\t\t\t\t\t\t\tadded = true;\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\telse{\n\t\t\t\t\t\temptyPot = true;\n\t\t\t\t\t\tgameStones.remove(e);\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\n\t\tArrayList<Integer> nonAddedInts = new ArrayList<Integer>();\n\t\tfor(int e : gameStones){\n\t\t\tnonAddedInts.add(e);\n\t\t}\n\t\t\n\t\tfor(int a : addedInts){\n\t\t\tfor(int e = 0; e < nonAddedInts.size(); e++){\n\t\t\t\tif(a == nonAddedInts.get(e)){\n\t\t\t\t\tnonAddedInts.remove(e);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int e : nonAddedInts){\n\t\t\tSystem.out.println(\"PLACE \"+ id +\" \"+ e +\" \"+ turn);\n\t\t\tDBCommunicator.writeData(\"INSERT INTO letterbakjeletter (spel_id, letter_id, beurt_id) VALUES (\" + id + \", \" + e + \", \" + turn + \")\");\n\t\t}\n\t\t\t\t\n\t\tif(emptyPot && (gameStones.size() == 0)){\n\t\t\tDBCommunicator.writeData(\"UPDATE spel SET toestand_type = 'Finished' WHERE id = \" + id );\n\t\t\tendGame(true);\n\t\t}\n\t\telse{\n\t\t\tthis.setStoneLetters();\n\t\t\tthis.fillStoneChars();\n\t\t}\n\t}", "public void run() throws DatabaseException, FileNotFoundException {\n new File(FileName).delete();\n\n // Create the database object.\n // There is no environment for this simple example.\n DatabaseConfig config = new DatabaseConfig();\n config.setErrorStream(System.err);\n config.setErrorPrefix(\"BulkAccessExample\");\n config.setType(DatabaseType.BTREE);\n config.setAllowCreate(true);\n config.setMode(0644);\n Database table = new Database(FileName, null, config);\n\n //\n // Insert records into the database, where the key is the user\n // input and the data is the user input in reverse order.\n //\n InputStreamReader reader = new InputStreamReader(System.in);\n\n for (;;) {\n String line = askForLine(reader, System.out, \"input> \");\n if (line == null || (line.compareToIgnoreCase(\"end\") == 0))\n break;\n\n String reversed = (new StringBuffer(line)).reverse().toString();\n\n // See definition of StringEntry below\n //\n StringEntry key = new StringEntry(line);\n StringEntry data = new StringEntry(reversed);\n\n try {\n if (table.putNoOverwrite(null, key, data) == OperationStatus.KEYEXIST)\n System.out.println(\"Key \" + line + \" already exists.\");\n } catch (DatabaseException dbe) {\n System.out.println(dbe.toString());\n }\n System.out.println(\"\");\n }\n\n // Acquire a cursor for the table.\n Cursor cursor = table.openCursor(null, null);\n DatabaseEntry foo = new DatabaseEntry();\n\n MultipleKeyDataEntry bulk_data = new MultipleKeyDataEntry();\n bulk_data.setData(new byte[1024 * 1024]);\n bulk_data.setUserBuffer(1024 * 1024, true);\n\n // Walk through the table, printing the key/data pairs.\n //\n while (cursor.getNext(foo, bulk_data, null) == OperationStatus.SUCCESS) {\n StringEntry key, data;\n key = new StringEntry();\n data = new StringEntry();\n\n while (bulk_data.next(key, data))\n System.out.println(key.getString() + \" : \" + data.getString());\n }\n cursor.close();\n table.close();\n }", "static void Do(){\n \trow1.start(); \n \trow2.start();\t \n \trow3.start(); \n \t}", "public int initDb(KeywordFactory kwf, Reader csv) \n throws InterruptedException, IOException\n {\n int ex = 0;\n ex = createTable(kwf);\n if (ex > 0) return ex;\n\n ex = loadData(csv, kwf);\n return ex;\n }", "@Override\n public void run() {\n try (Connection db = DriverManager.getConnection(\n \"jdbc:mysql://127.0.0.1:3306/temperature\", \"root\", \"\")) {\n\n if (db != null) {\n System.out.println(\"Thread status: \" + threadName + \" connected to the Temperature database!\");\n } else {\n System.out.println(\"Thread status: \" + threadName + \" failed to make Temperature database connection!\");\n }\n\n PreparedStatement cmd = db.prepareStatement(\"SELECT COUNT(*) FROM temperature\");\n ResultSet rd = cmd.executeQuery();\n rd.next();\n int data = rd.getInt(1);\n System.out.println(\"Thread status: \" + threadName + \" Temperature database entries: \" + data);\n\n while(data < 11000) {\n\n long offset = Timestamp.valueOf(\"2010-01-01 00:00:00\").getTime();\n long end = Timestamp.valueOf(\"2020-01-01 00:00:00\").getTime();\n long diff = end - offset + 1;\n Timestamp randomTS = new Timestamp(offset + (long)(Math.random() * diff));\n\n double min = -10.0;\n double max = 35.0;\n double randomTemp = Math.round((min + Math.random() * (max - min)) * 10) / 10.0;\n\n data++;\n\n cmd = db.prepareStatement(\"INSERT INTO temperature (id, temperature, timestamp) VALUES (?, ?, ?)\");\n cmd.setInt(1, data);\n cmd.setDouble(2,randomTemp);\n cmd.setTimestamp(3,randomTS);\n\n cmd.executeUpdate();\n }\n\n rd.close();\n cmd.close();\n // db.close(); // is redundant\n\n } catch (SQLException e) {\n System.err.format(\"SQL State: %s\\n%s\", e.getSQLState(), e.getMessage());\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void execute() {\n stoppingReverseEngineering = false;\n\n // load schemas...\n LongRunningTask loadSchemasTask = new LoadSchemasTask(Application\n .getFrame(), \"Loading Schemas\");\n\n loadSchemasTask.startAndWait();\n\n if (stoppingReverseEngineering) {\n return;\n }\n\n final DbLoaderOptionsDialog dialog = new DbLoaderOptionsDialog(\n schemas,\n dbUserName,\n false);\n\n try {\n // since we are not inside EventDisptahcer Thread, must run it via\n // SwingUtilities\n SwingUtilities.invokeAndWait(new Runnable() {\n\n public void run() {\n dialog.show();\n dialog.dispose();\n }\n });\n }\n catch (Throwable th) {\n processException(th, \"Error Reengineering Database\");\n return;\n }\n\n if (dialog.getChoice() == DbLoaderOptionsDialog.CANCEL) {\n return;\n }\n\n this.schemaName = dialog.getSelectedSchema();\n this.tableNamePattern = dialog.getTableNamePattern();\n this.loadProcedures = dialog.isLoadingProcedures();\n this.procedureNamePattern = dialog.getProcedureNamePattern();\n\n // load DataMap...\n LongRunningTask loadDataMapTask = new LoadDataMapTask(Application\n .getFrame(), \"Reengineering DB\");\n loadDataMapTask.startAndWait();\n }" ]
[ "0.646914", "0.6232113", "0.59667283", "0.586673", "0.5818426", "0.5817052", "0.5776084", "0.57476985", "0.5736809", "0.56584555", "0.56373584", "0.562386", "0.5571357", "0.5530334", "0.55205894", "0.5467379", "0.54672974", "0.54671776", "0.5448674", "0.5424202", "0.54191136", "0.5394097", "0.53784895", "0.5375414", "0.53677166", "0.53596103", "0.53434634", "0.5339325", "0.5314854", "0.5310937", "0.529311", "0.52900064", "0.52656615", "0.526316", "0.52626276", "0.5247938", "0.52446866", "0.5228345", "0.521362", "0.52105314", "0.5210303", "0.5209727", "0.520348", "0.51953495", "0.51634276", "0.5147318", "0.5125113", "0.5116012", "0.5109878", "0.50990415", "0.5098962", "0.50873023", "0.50744665", "0.505453", "0.502903", "0.5025773", "0.50246257", "0.502287", "0.50196105", "0.5017501", "0.5014102", "0.5011019", "0.50086266", "0.5000985", "0.49982154", "0.49962792", "0.49897248", "0.49892497", "0.49889952", "0.49875313", "0.498441", "0.49690047", "0.4962085", "0.4958127", "0.49556005", "0.49476966", "0.4947127", "0.49422622", "0.49389026", "0.49361077", "0.49349958", "0.4932311", "0.49304715", "0.49247795", "0.4924094", "0.4921835", "0.49206007", "0.49087408", "0.4898563", "0.48941144", "0.48932666", "0.48930186", "0.4892742", "0.4879607", "0.48663422", "0.4862029", "0.48602486", "0.4856236", "0.48558155", "0.48555595" ]
0.51036566
49
RuntimeException type of exception that the compiler dont forces u to treat; Exception the compiler forces u to treat this type of exception; Type serializable needs to have a version number ID: seriazable classes need can be converted to bytes(...);
public DomainException(String msg) { super(msg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ByteArrayConversionException() {\n super();\n }", "public RuntimeMBeanException(RuntimeException paramRuntimeException, String paramString) {\n/* 66 */ super(paramString);\n/* 67 */ this.runtimeException = paramRuntimeException;\n/* */ }", "public WrappedRuntimeException(Exception e)\n {\n\n super(e.getMessage());\n\n m_exception = e;\n }", "public RuntimeException processException(RuntimeException e)\n\n {\n\treturn new RuntimeException(e);\n }", "private static void handleRuntimeExceptionOrError(Throwable e)\n {\n // is already of throwable type\n if (e instanceof RuntimeOperationsException)\n throw (RuntimeOperationsException)e;\n if (e instanceof RuntimeErrorException)\n throw (RuntimeErrorException)e;\n if (e instanceof RuntimeMBeanException)\n throw (RuntimeMBeanException)e;\n\n // wrap java core runtime exceptions\n if (e instanceof IllegalArgumentException)\n throw new RuntimeOperationsException((IllegalArgumentException)e);\n if (e instanceof IndexOutOfBoundsException)\n throw new RuntimeOperationsException((IndexOutOfBoundsException)e);\n if (e instanceof NullPointerException)\n throw new RuntimeOperationsException((NullPointerException)e);\n\n // wrap any error\n if (e instanceof Error)\n throw new RuntimeErrorException((Error)e);\n\n // wrap any runtime exception\n if (e instanceof RuntimeException)\n throw new RuntimeMBeanException((RuntimeException)e);\n }", "public ConcurrentRuntimeException(String msg, Throwable cause) {\n/* 70 */ super(msg, ConcurrentUtils.checkedException(cause));\n/* */ }", "public ResourceRuntimeException(String message) {\n super(message);\n }", "@Override\n public RuntimeException convert(PersistenceException exception, Object entity) {\n return exception;\n }", "public CoderException(Throwable cause) {\n super(cause);\n }", "private static Throwable reconstitute(Throwable t) {\n Throwable result = null;\n try(ByteArrayOutputStream bout = new ByteArrayOutputStream();\n ObjectOutputStream out = new ObjectOutputStream(bout)) {\n out.writeObject(t);\n out.flush();\n try(ByteArrayInputStream bin =\n new ByteArrayInputStream(bout.toByteArray());\n ObjectInputStream in = new ObjectInputStream(bin)) {\n result = (Throwable) in.readObject();\n }\n } catch(IOException | ClassNotFoundException e) {\n throw new RuntimeException(e);\n }\n return result;\n }", "@Override\n protected void onExceptionSwallowed(RuntimeException exception) {\n throw exception;\n }", "public SerializationException(String msg) {\n super(msg);\n }", "private SSLException convert(final RuntimeException ex) {\n Throwable cause = ex.getCause();\n if (cause == null) {\n cause = ex;\n }\n return new SSLException(cause);\n }", "static Error unchecked (Throwable e) {\n if (e instanceof Error) {\n throw (Error) e;\n }\n if (e instanceof RuntimeException) {\n throw (RuntimeException) e;\n }\n throw new RuntimeException(e);\n }", "private void readObject(java.io.ObjectInputStream in) throws NotSerializableException {\n throw new NotSerializableException(\"Not serializable.\");\n }", "public ByteArrayConversionException(String message) {\n super(message);\n }", "public void testSerializeAndDeserializeWithoutCause() {\n Exception e = new RuntimeException(\"My message\");\n RemoteTestResult original = new RemoteTestResult();\n original.setException(e);\n\n RemoteTestResult recreated = RemoteTestResult.fromXML(original.toXML());\n assertEquals(original.successful(), recreated.successful());\n assertExceptionInfoIsEqual(original.getExceptionInfo(), recreated.getExceptionInfo());\n\n assertStackTracesAreIdentical(e, recreated.recreateException());\n }", "public static void rethrowRuntimeException(Throwable ex) {\n if (ex instanceof RuntimeException) {\n throw (RuntimeException) ex;\n }\n if (ex instanceof Error) {\n throw (Error) ex;\n }\n throw new UndeclaredThrowableException(ex);\n }", "public ConversionNotSupportedException(Object value, Class requiredType, Throwable cause)\r\n/* 14: */ {\r\n/* 15:47 */ super(value, requiredType, cause);\r\n/* 16: */ }", "public CannotInvokeException(ClassNotFoundException e) {\n super(\"by \" + e.toString());\n err = e;\n }", "private void writeObject(java.io.ObjectOutputStream out) throws IOException {\n throw new NotSerializableException();\n }", "private void m152569a(RuntimeException runtimeException) {\n m152578e(m152573b(500));\n mo133097c(-1, runtimeException.getMessage(), false);\n }", "public void throwRuntimeException(Context context) {\n }", "protected OCSRuntimeException extractRuntimeException(Throwable t) {\n\t\tif (t instanceof OCSRuntimeException) {\n\t\t\treturn (OCSRuntimeException) t;\n\t\t} else if (t.getCause() != null) {\n\t\t\treturn extractRuntimeException(t.getCause());\n\t\t}\n\t\treturn null;\n\t}", "public SerializationException(String msg, Throwable cause) {\n super(msg, cause);\n }", "public abstract RuntimeException getException(String message);", "public ByteArrayConversionException(String message, Throwable cause) {\n super(message, cause);\n }", "public IORuntimeException(String message) {\n super(message);\n }", "private void writeObject(java.io.ObjectOutputStream out) throws NotSerializableException {\n throw new NotSerializableException(\"Not serializable.\");\n }", "private byte[] serialize(Serializable object) throws Exception {\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n ObjectOutputStream objectStream = new ObjectOutputStream(stream);\n objectStream.writeObject(object);\n objectStream.flush();\n return stream.toByteArray();\n }", "public KscRuntimeException(int i, String str, Throwable th) {\n super(r0.toString(), KscException.getSerial(th));\n String str2;\n StringBuilder sb = new StringBuilder();\n sb.append(\"ErrCode:\");\n sb.append(i);\n if (str == null) {\n str2 = \"\";\n } else {\n str2 = \" details:\" + str;\n }\n sb.append(str2);\n this.errCode = i;\n this.detailMessage = str;\n }", "public ValueConversionException(String message, Throwable cause) {\n/* 52 */ super(message, cause);\n/* */ }", "void Crash(T ex) throws T;", "void method() throws /*RuntimeException* (working)//*Exception(not working)*/ArithmeticException\n { \n System.out.println(\"SubClass\"); \n }", "public ConfigurationRuntimeException(String message) {\n super(message);\n }", "void mo57276a(Exception exc);", "com.palantir.paxos.persistence.generated.PaxosPersistence.ExceptionProto getException();", "public KscRuntimeException(int i, Throwable th) {\n this(i, th == null ? null : th.toString(), th);\n }", "public interface TransientExceptionDetector {\n /**\n * Determine if the condition is a transient error.\n *\n * @param e the exception to inspect\n * @return true if the exception is transient, false otherwise\n */\n boolean isTransient(Exception e);\n}", "public CoderException(String message) {\n super(message);\n }", "static RuntimeException exception(EntityType entityType, ExceptionType exceptionType, String... args) {\n return SystemException.throwException(entityType, exceptionType, args);\n }", "public JavaException()\r\n\t{\r\n\t\tsuper();\r\n\t}", "private static void checkVersionable(Object o) {\r\n if (!isVersionable(o))\r\n throw new IllegalArgumentException(\"passed non-versionable object\");\r\n }", "public interface Serializable {\n /** Convert object into byte sequence. */\n void serialize(@NotNull OutputStream out) throws IOException;\n /** Replace object with one converted from byte sequence. */\n void deserialize(@NotNull InputStream in) throws IOException;\n}", "@Test(timeout = 4000)\n public void test029() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(16777267);\n Type type0 = Type.VOID_TYPE;\n Type type1 = Type.BYTE_TYPE;\n Type.getObjectType(\"The prefix must not be null\");\n Type type2 = Type.INT_TYPE;\n Item item0 = new Item();\n frame0.execute(132, 164, classWriter0, item0);\n Class<ObjectInputStream> class0 = ObjectInputStream.class;\n Type.getType(class0);\n Type.getType(\")UBbE;._%G\");\n Type type3 = Type.BYTE_TYPE;\n Type type4 = Type.INT_TYPE;\n // Undeclared exception!\n try { \n type0.getElementType();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "public ObjectNotFoundException() {\r\n super(\"ObjectNotFound Exception\");\r\n }", "public int getObjectFormatCode() {\n/* 116 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public Parcelable mo5381n() {\n throw null;\n }", "private static void rethrowRunTimeException( RuntimeException e, String msg )\n \t\t\tthrows OdaException\n \t{\n \t\tOdaException odaException = new OdaException( msg );\n \t\todaException.initCause( e );\n \t\tlogger.logp( java.util.logging.Level.FINE,\n \t\t\t\tStatement.class.getName( ),\n \t\t\t\t\"rethrowRunTimeException\",\n \t\t\t\tmsg,\n \t\t\t\todaException );\n \t\tthrow odaException;\n \t}", "public ViaturaExistenteException(){\n super();\n }", "public interface Serializer {\n /**\n * Serializes given serializable object into the byte array.\n *\n * @param object object that will be serialized\n * @return serialized byte array\n */\n byte[] serialize(Serializable object);\n\n /**\n * Deserializes byte array that serialized by {@link #serialize(Serializable)} method.\n *\n * @param bytes byte array that will be deserialized\n * @return deserialized object\n */\n Object deserialize(byte[] bytes);\n}", "public interface Message extends Serializable {\r\n\t\r\n\t/**\r\n\t * An unique serial number.\r\n\t */\r\n\tstatic final long serialVersionUID = -2075547926990832957L;\r\n\r\n}", "public CoderException(String message, Throwable cause) {\n super(message, cause);\n }", "public void testSimpleSerializableMessage() {\n String handlerId = \"u7p3$\";\n String requestId = \"i0-s@\";\n SimpleSerializableMessage message = new SimpleSerializableMessage(handlerId, requestId);\n\n assertTrue(\"Message is not serialzable.\", message instanceof Serializable);\n\n assertEquals(\"Incorrect handler id.\", handlerId, message.getHandlerId());\n assertEquals(\"Incorrect request id.\", requestId, message.getRequestId());\n\n assertEquals(\"Incorrect serializer type.\", SerializableMessageSerializer.class.getName(), message.getSerializerType());\n }", "private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {\n throw new NotSerializableException();\n }", "public ObjectNotFoundException(String s) {\r\n super(s);\r\n }", "@Override\n\tpublic byte[] toByteArray() throws OpException {\n\t\ttry\n\t\t{\n\t\t\treturn serialize();\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\tOpException eop = new OpException(e.getMessage());\n\t\t\teop.setStackTrace(e.getStackTrace());\n\t\t\tthrow eop;\n\t\t}\n\t}", "void checkReconstructible() throws InvalidObjectException {\n // subclasses can override\n }", "public void writeToParcel(Parcel parcel, int flags) {\n/* 1845 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public interface Serializable {\n\n\t/**\n\t * Method to convert the object into a stream\n\t *\n\t * @param out OutputSerializer to write the object to\n\t * @throws IOException in case of an IO-error\n\t */\n\tvoid writeObject(OutputSerializer out) throws java.io.IOException;\n\n\t/** \n\t * Method to build the object from a stream of bytes\n\t *\n\t * @param in InputSerializer to read from\n\t * @throws IOException in case of an IO-error\n\t */\n\tvoid readObject(InputSerializer in) throws java.io.IOException;\n}", "byte[] serialize(Serializable object);", "public TypeConversionException(String message) {\n super(message);\n }", "@Override\n\tpublic void demoRunTimeException() throws RuntimeException {\n\n\t}", "@Override\n public byte[] serialize() throws IOException {\n throw new UnsupportedOperationException(\"Not implemented\");\n }", "public PanicException(Object payload, Throwable cause, Node location) {\n super(null, cause, UNLIMITED_STACK_TRACE, location);\n if (!InteropLibrary.isValidValue(payload)) {\n CompilerDirectives.transferToInterpreter();\n throw new IllegalArgumentException(\"Only interop values are supported: \" + payload);\n }\n this.payload = payload;\n }", "public static int catchRuntimeExceptionWithException(){\n int x =1;\n try{\n if (true){throw new RuntimeException();}\n x *=2;\n }\n catch (Exception e){\n x*=3;\n }\n x*=5;\n return x; // x==15\n }", "public RemocaoDocumentoException(){\n\t\tsuper(\"Não é permitida a remoção deste tipo de documento!\");\n\t}", "public ClassNotFoundException () {\n\t\tsuper((Throwable)null); // Disallow initCause\n\t}", "Object loadObject() throws Exception;", "public TypeException() {\n }", "@Test(timeout = 4000)\n public void test263() throws Throwable {\n Form form0 = new Form((String) null);\n Submit submit0 = new Submit(form0, \"http://xmlpull.org/v1/doc/properties.html#serializer-indentation\", \"z=OF5Ty4t\");\n // Undeclared exception!\n try { \n submit0.u((Object) form0);\n fail(\"Expecting exception: ClassCastException\");\n \n } catch(ClassCastException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "@Test\n public void testConstructorWithMessageAndCause()\n {\n final RuntimeException cause = new RuntimeException();\n final LoaderException e = new LoaderException(\"Custom message\", cause);\n assertEquals(\"Custom message\", e.getMessage());\n assertEquals(cause, e.getCause());\n }", "public SMSLibException(Throwable originalE)\n/* 17: */ {\n/* 18:45 */ this.originalE = originalE;\n/* 19: */ }", "public CodecException(String msg) {\n\t\tsuper(msg);\n\t}", "@Override\r\n public byte[] encodeToBytes(Object object) throws Exception {\n return null;\r\n }", "public RuntimeException getTargetException() {\n/* 76 */ return this.runtimeException;\n/* */ }", "@Override\r\n\t\t\tpublic void serializar() {\n\r\n\t\t\t}", "public TechnicalException() {\r\n }", "@Test(timeout = 4000)\n public void test017() throws Throwable {\n Frame frame0 = new Frame();\n ClassWriter classWriter0 = new ClassWriter(1432);\n Type type0 = Type.BYTE_TYPE;\n classWriter0.toByteArray();\n // Undeclared exception!\n try { \n frame0.execute(24, (-338), classWriter0, (Item) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.asm.Frame\", e);\n }\n }", "public DataConversionException(String msg) {\n super(msg);\n }", "public String toString() {\n/* 356 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public abstract byte[] toBytes() throws Exception;", "static <T extends JSONSerializable> String serialize(T serializable) throws Exception { return serializable.jsonSerialize(); }", "public interface Serialization {\n\n byte[] serialize(Object obj);\n\n default void serialize(Object obj, OutputStream outputStream) {\n throw new UnsupportedOperationException();\n }\n\n <T> T deserialize(byte[] in, Class<T> type);\n\n @SuppressWarnings(\"unchecked\")\n default <T> T deserialize(byte[] in, Type type) {\n if (type instanceof Class) {\n return this.deserialize(in, (Class<T>) type);\n } else {\n throw new UnsupportedOperationException();\n }\n }\n\n default <T> T deserialize(InputStream input, Type type) {\n throw new UnsupportedOperationException();\n }\n\n default <T> T deserialize(InputStream input, Class<T> type) {\n throw new UnsupportedOperationException();\n }\n}", "V call() throws StatusRuntimeException;", "ResolvedType getSpecifiedException(int index);", "private V e() throws com.amap.api.col.n3.gh {\n /*\n r6 = this;\n r0 = 0\n r1 = 0\n L_0x0002:\n int r2 = r6.b\n if (r1 >= r2) goto L_0x00cd\n com.amap.api.col.n3.ki r2 = com.amap.api.col.n3.ki.c() // Catch:{ ic -> 0x0043, gh -> 0x0032, Throwable -> 0x002a }\n android.content.Context r3 = r6.d // Catch:{ ic -> 0x0043, gh -> 0x0032, Throwable -> 0x002a }\n java.net.Proxy r3 = com.amap.api.col.n3.ik.a(r3) // Catch:{ ic -> 0x0043, gh -> 0x0032, Throwable -> 0x002a }\n r6.a((java.net.Proxy) r3) // Catch:{ ic -> 0x0043, gh -> 0x0032, Throwable -> 0x002a }\n byte[] r2 = r2.a((com.amap.api.col.n3.kj) r6) // Catch:{ ic -> 0x0043, gh -> 0x0032, Throwable -> 0x002a }\n java.lang.Object r2 = r6.a((byte[]) r2) // Catch:{ ic -> 0x0043, gh -> 0x0032, Throwable -> 0x002a }\n int r0 = r6.b // Catch:{ ic -> 0x0025, gh -> 0x0020, Throwable -> 0x002a }\n r1 = r0\n r0 = r2\n goto L_0x0002\n L_0x0020:\n r0 = move-exception\n r5 = r2\n r2 = r0\n r0 = r5\n goto L_0x0033\n L_0x0025:\n r0 = move-exception\n r5 = r2\n r2 = r0\n r0 = r5\n goto L_0x0044\n L_0x002a:\n com.amap.api.col.n3.gh r0 = new com.amap.api.col.n3.gh\n java.lang.String r1 = \"未知错误\"\n r0.<init>(r1)\n throw r0\n L_0x0032:\n r2 = move-exception\n L_0x0033:\n int r1 = r1 + 1\n int r3 = r6.b\n if (r1 < r3) goto L_0x0002\n com.amap.api.col.n3.gh r0 = new com.amap.api.col.n3.gh\n java.lang.String r1 = r2.a()\n r0.<init>(r1)\n throw r0\n L_0x0043:\n r2 = move-exception\n L_0x0044:\n int r1 = r1 + 1\n int r3 = r6.b\n if (r1 >= r3) goto L_0x008a\n int r3 = r6.e // Catch:{ InterruptedException -> 0x0053 }\n int r3 = r3 * 1000\n long r3 = (long) r3 // Catch:{ InterruptedException -> 0x0053 }\n java.lang.Thread.sleep(r3) // Catch:{ InterruptedException -> 0x0053 }\n goto L_0x0002\n L_0x0053:\n java.lang.String r0 = \"http连接失败 - ConnectionException\"\n java.lang.String r1 = r2.getMessage()\n boolean r0 = r0.equals(r1)\n if (r0 != 0) goto L_0x0082\n java.lang.String r0 = \"socket 连接异常 - SocketException\"\n java.lang.String r1 = r2.getMessage()\n boolean r0 = r0.equals(r1)\n if (r0 != 0) goto L_0x0082\n java.lang.String r0 = \"服务器连接失败 - UnknownServiceException\"\n java.lang.String r1 = r2.getMessage()\n boolean r0 = r0.equals(r1)\n if (r0 == 0) goto L_0x0078\n goto L_0x0082\n L_0x0078:\n com.amap.api.col.n3.gh r0 = new com.amap.api.col.n3.gh\n java.lang.String r1 = r2.a()\n r0.<init>(r1)\n throw r0\n L_0x0082:\n com.amap.api.col.n3.gh r0 = new com.amap.api.col.n3.gh\n java.lang.String r1 = \"http或socket连接失败 - ConnectionException\"\n r0.<init>(r1)\n throw r0\n L_0x008a:\n java.lang.String r0 = \"http连接失败 - ConnectionException\"\n java.lang.String r1 = r2.getMessage()\n boolean r0 = r0.equals(r1)\n if (r0 != 0) goto L_0x00c5\n java.lang.String r0 = \"socket 连接异常 - SocketException\"\n java.lang.String r1 = r2.getMessage()\n boolean r0 = r0.equals(r1)\n if (r0 != 0) goto L_0x00c5\n java.lang.String r0 = \"未知的错误\"\n java.lang.String r1 = r2.a()\n boolean r0 = r0.equals(r1)\n if (r0 != 0) goto L_0x00c5\n java.lang.String r0 = \"服务器连接失败 - UnknownServiceException\"\n java.lang.String r1 = r2.getMessage()\n boolean r0 = r0.equals(r1)\n if (r0 == 0) goto L_0x00bb\n goto L_0x00c5\n L_0x00bb:\n com.amap.api.col.n3.gh r0 = new com.amap.api.col.n3.gh\n java.lang.String r1 = r2.a()\n r0.<init>(r1)\n throw r0\n L_0x00c5:\n com.amap.api.col.n3.gh r0 = new com.amap.api.col.n3.gh\n java.lang.String r1 = \"http或socket连接失败 - ConnectionException\"\n r0.<init>(r1)\n throw r0\n L_0x00cd:\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.amap.api.col.n3.gi.e():java.lang.Object\");\n }", "private ClassFileReadRuntimeException dataFormatError() {\n\n return classFileReadException(\"Data format error\"); // NOI18N\n }", "protected byte[] serialize(Object o) {\n\t\tif (o == null) {\n\t\t\tthrow new NullPointerException(\"SPYMemcached JAVA Serialization error : Can't serialize null\");\n\t\t}\n\t\tbyte[] rv = null;\n\t\tByteArrayOutputStream bos = null;\n\t\tObjectOutputStream os = null;\n\t\ttry {\n\t\t\tbos = new ByteArrayOutputStream();\n\t\t\tos = new ObjectOutputStream(bos);\n\t\t\tos.writeObject(o);\n\t\t\tos.close();\n\t\t\tbos.close();\n\t\t\trv = bos.toByteArray();\n\t\t} catch (IOException e) {\n\t\t\tthrow new IllegalArgumentException(\"SPYMemcached JAVA Serialization error : Non-serializable object\", e);\n\t\t} finally {\n\t\t\tif (os != null) {\n\t\t\t\ttry {\n\t\t\t\t\tos.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tLOGGER.info(\"JAVA Serializer error : close ObjectOutputStream\", e);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (bos != null) {\n\t\t\t\ttry {\n\t\t\t\t\tbos.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tLOGGER.info(\"JAVA Serializer error : close ByteArrayOutputStream\", e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn rv;\n\t}", "@Override\r\n\tpublic void serializar() {\n\r\n\t}", "@Test(timeout = 4000)\n public void test082() throws Throwable {\n XmlEntityRef xmlEntityRef0 = new XmlEntityRef(\"java.lang.String@0000000005\");\n Submit submit0 = new Submit(xmlEntityRef0, \"java.lang.String@0000000005\", \"java.lang.String@0000000005\");\n // Undeclared exception!\n try { \n submit0.rawText(\"java.lang.String@0000000005\");\n fail(\"Expecting exception: ClassCastException\");\n \n } catch(ClassCastException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "public ExceptionSubVersion() {\n this(\"EcologicaExcepciones\");\n }", "@Test(timeout = 4000)\n public void test166() throws Throwable {\n Checkbox checkbox0 = new Checkbox((Component) null, \"F\\\"\", \"F\\\"\");\n Checkbox checkbox1 = new Checkbox(checkbox0, \"F\\\"\", \"F\\\"\");\n // Undeclared exception!\n try { \n checkbox1.body();\n fail(\"Expecting exception: ClassCastException\");\n \n } catch(ClassCastException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "public PreparationException() {\n\t\tsuper();\n\t}", "public void testTransformWithInvalidElementType() throws Exception {\n try {\n instance.transform(\"invalid\", document, caller);\n fail(\"ClassCastException is excepted.\");\n } catch (ClassCastException cce) {\n // pass\n }\n }", "public int getType() {\n/* 96 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "@Test(timeout = 4000)\n public void test169() throws Throwable {\n XmlEntityRef xmlEntityRef0 = new XmlEntityRef(\"&!a0Q!<8UDk+%_*<Z'\");\n Radio radio0 = new Radio(xmlEntityRef0, \"bdo\", \"&!a0Q!<8UDk+%_*<Z'\");\n // Undeclared exception!\n try { \n radio0.big((Object) \"bdo\");\n fail(\"Expecting exception: ClassCastException\");\n \n } catch(ClassCastException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }", "public Bundle getExtras() {\n/* 1775 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public interface Response extends Serializable{}", "private static boolean m20205b(java.lang.Throwable r3) {\n /*\n r0 = r3\n L_0x0001:\n if (r0 == 0) goto L_0x0015\n boolean r1 = r0 instanceof com.google.android.exoplayer2.upstream.DataSourceException\n if (r1 == 0) goto L_0x0010\n r1 = r0\n com.google.android.exoplayer2.upstream.DataSourceException r1 = (com.google.android.exoplayer2.upstream.DataSourceException) r1\n int r1 = r1.f18593a\n if (r1 != 0) goto L_0x0010\n r2 = 1\n return r2\n L_0x0010:\n java.lang.Throwable r0 = r0.getCause()\n goto L_0x0001\n L_0x0015:\n r1 = 0\n return r1\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.exoplayer2.upstream.cache.C8465b.m20205b(java.io.IOException):boolean\");\n }", "public TypeException(String msg) {\n super(msg);\n }" ]
[ "0.6132802", "0.60258186", "0.5978802", "0.59517217", "0.5942518", "0.5898292", "0.5765943", "0.5761527", "0.5729902", "0.5675424", "0.56165856", "0.5594187", "0.55198485", "0.5503609", "0.54509294", "0.541228", "0.5367348", "0.53530896", "0.5352402", "0.5351858", "0.5346869", "0.5341594", "0.53331655", "0.5331471", "0.530886", "0.5273819", "0.5271985", "0.5211669", "0.521049", "0.5189723", "0.5188239", "0.51839226", "0.517673", "0.5157928", "0.51472807", "0.5128502", "0.5120769", "0.5117428", "0.51084864", "0.50983137", "0.50978374", "0.50932974", "0.50886333", "0.5086017", "0.50725025", "0.50696397", "0.5059686", "0.5059298", "0.50524247", "0.50280595", "0.5006352", "0.5003963", "0.49782032", "0.49761987", "0.4972009", "0.49616307", "0.4958089", "0.49553937", "0.49472195", "0.49458688", "0.4933442", "0.49252987", "0.49196327", "0.49195057", "0.49157485", "0.49127316", "0.49126408", "0.490938", "0.4903891", "0.4900604", "0.4899511", "0.48776305", "0.48696887", "0.4860131", "0.4856311", "0.48518285", "0.48500806", "0.48490667", "0.48479205", "0.48398158", "0.48346823", "0.4832464", "0.48319593", "0.48240146", "0.48229235", "0.48226523", "0.4806095", "0.48023412", "0.4798246", "0.47886774", "0.4787011", "0.4779638", "0.47782636", "0.47706303", "0.4762279", "0.4755508", "0.4755423", "0.4744076", "0.47412872", "0.47377947", "0.47349644" ]
0.0
-1
Creates new form AdminPanel
public AdminPanel() { Object paint[][] = {}; jtModel = new DefaultTableModel(paint,columnNames) { @Override public boolean isCellEditable(int row, int column) { return false; } @Override public Class getColumnClass(int column) { switch (column) { case 2: /* This is for the price column sorting */ return Integer.class; default: return String.class;//This is for the name column sorting. } } }; initComponents(); jt.getTableHeader().setResizingAllowed(false); jt.getTableHeader().setReorderingAllowed(false); TableRowSorter<TableModel> sorting = new TableRowSorter<>(jt.getModel()); jt.setRowSorter(sorting); // These column can't be sorted. sorting.setSortable(0, false); sorting.setSortable(3, false); sorting.setSortable(4, false); sorting.setSortable(5, false); sorting.setSortable(6, false); sorting.setSortable(7, false); sorting.setSortable(8, false); addFile(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createAdminPanel() {\n username = new JTextField(8);\n password = new JPasswordField(8);\n JPanel loginArea = adminLoginPanels();\n JPanel buttons = adminLoginButtons();\n loginFrame = new JFrame();\n loginFrame.setLayout(new BorderLayout());\n loginFrame.getRootPane().setBorder(BorderFactory.createEmptyBorder(10,10,10,10));\n loginLabel = new JLabel(\"Please log in as administrator\", SwingConstants.CENTER);\n loginFrame.getContentPane().add(loginLabel, BorderLayout.NORTH);\n loginFrame.getContentPane().add(loginArea, BorderLayout.CENTER);\n loginFrame.getContentPane().add(buttons, BorderLayout.SOUTH);\n loginFrame.setVisible(true);\n loginFrame.pack();\n }", "@Override\r\n\t\tpublic void onClick(ClickEvent event) {\n\t\t\tRootPanel.get(\"details\").clear();\r\n\t\t\thome = new AdminDashboardForm();\r\n\t\t\tRootPanel.get(\"details\").add(home);\r\n\t\t}", "@RequestMapping(params = \"new\", method = RequestMethod.GET)\n\t@PreAuthorize(\"hasRole('ADMIN')\")\n\tpublic String createProductForm(Model model) { \t\n \t\n\t\t//Security information\n\t\tmodel.addAttribute(\"admin\",security.isAdmin()); \n\t\tmodel.addAttribute(\"loggedUser\", security.getLoggedInUser());\n\t\t\n\t model.addAttribute(\"product\", new Product());\n\t return \"products/newProduct\";\n\t}", "FORM createFORM();", "public C_AdminForm() {\n initComponents();\n }", "public void createAndShowGUI() {\n frame= new JFrame(\"TabAdmin\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.setLocation(200,50);\n //Create and set up the content pane.\n \n addComponentToPane(frame.getContentPane());\n \n //Display the window.\n frame.pack();\n frame.setVisible(true);\n //create admin to operate \n \n }", "public AdminProfile_panel() {\n initComponents();\n \n }", "void createGebruikersBeheerPanel() {\n frame.add(gebruikersBeheerView.createGebruikersBeheerPanel());\n frame.setTitle(gebruikersBeheerModel.getTitle());\n }", "@RequestMapping(value={\"/projects/add\"}, method= RequestMethod.GET)\r\n\tpublic String createProjectForm(Model model) {\r\n\t\tUser loggedUser= sessionData.getLoggedUser();\r\n\t\tmodel.addAttribute(\"loggedUser\", loggedUser);\r\n\t\tmodel.addAttribute(\"projectForm\", new Project());\r\n\t\treturn \"addProject\";\r\n\t}", "public CreateAccountPanel() {\n initComponents();\n initializeDateChooser();\n }", "public static Result newForm() {\n return ok(newForm.render(palletForm, setOfArticleForm));\n }", "private void adminOperations() {\n adminOps = new JFrame(\"Administrator Frame\");\n adminOps.getRootPane().setBorder(BorderFactory.createEmptyBorder(10,10,10,10));\n JTabbedPane adminPane = new JTabbedPane();\n adminPane.addTab(\"Withdraw $\", withdrawMoney());\n adminPane.addTab(\"Update Inventory\", updateInventoryPanel());\n adminOps.getContentPane().add(adminPane);\n adminOps.setVisible(true);\n adminOps.pack();\n }", "@RequestMapping(value = { \"/newModule\" }, method = RequestMethod.GET)\n\t\tpublic String newModule(ModelMap model) {\n\t\t\tModule module = new Module();\n\t\t\tmodel.addAttribute(\"module\", module);\n\t\t\tmodel.addAttribute(\"edit\", false);\n\t\t\t\n\t\t\treturn \"addNewModule\";\n\t\t}", "@Override\n public void buttonClick(ClickEvent event) {\n \n \ttry {\n\t\t\t\t\tUI.getCurrent().getNavigator().addView(_nombreSeccion + \"Adm/\" + _titulo.getCaption(), new AdministradorClase(new Lista_Mensaje_V_Administrador(it.getIdTema())));\n\t\t\t\t} catch (PersistentException 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\tUI.getCurrent().getNavigator().navigateTo(_nombreSeccion+ \"Adm/\" + _titulo.getCaption());\n \t\n \t\n }", "@Override\n public ResultMessage createNewAdmin(NewAdminCommand command) {\n String currentAdmin = command.getCurrentAdmin();\n if (!adminDao.hasHighestAuthority(currentAdmin))\n return ResultMessage.failure(\"Permission denied\");\n\n // Permission passed\n if (adminDao.addAdmin(command.getNewAdminName(),\n encryptor.encrypt(command.getPassword(), command.getNewAdminName()))) {\n log.info(\"New administrator is created successfully\");\n return ResultMessage.success();\n }\n\n return ResultMessage.failure();\n }", "public void onNew() {\t\t\n\t\tdesignWidget.addNewForm();\n\t}", "public frmAdminAccount() {\n initComponents();\n }", "private JPanel adminLoginPanels() {\n JPanel admin = new JPanel();\n JPanel usernamePanel = new JPanel();\n usernamePanel.add(new JLabel(\"Username:\"));\n usernamePanel.add(Box.createHorizontalStrut(15));\n usernamePanel.add(username);\n usernamePanel.add(Box.createHorizontalStrut(15));\n JPanel pwPanel = new JPanel();\n pwPanel.add(new JLabel(\"Password:\"));\n pwPanel.add(Box.createHorizontalStrut(15));\n pwPanel.add(password);\n admin.add(usernamePanel);\n admin.add(pwPanel);\n return admin;\n }", "public Result addNewRoomType() {\n\n DynamicForm dynamicform = Form.form().bindFromRequest();\n if (dynamicform.get(\"AdminAddRoom\") != null) {\n\n return ok(views.html.AddRoomType.render());\n }\n\n\n return ok(\"Something went wrong\");\n }", "public PanelAdmin() {\n initComponents();\n tfUsuario.setText(DatosList[0]);\n tfNombre.setText(DatosList[1]);\n tfApellido.setText(DatosList[2]);\n if (DatosList[4].equals(\"1\"))\n {\n jlRol2.setText(\"Administrador\");\n }\n else\n {\n jlRol2.setText(\"común\");\n }\n tfFecha.setText(DatosList[5]);\n tfCorreo.setText(DatosList[6]);\n tfTeléfono.setText(DatosList[7]);\n Image img = new ImageIcon(DatosList[8]).getImage();\n ImageIcon Profile = new ImageIcon(img.getScaledInstance(100, 100, Image.SCALE_SMOOTH));\n tfFoto.setIcon(Profile);\n taDescripción.setText(DatosList[9]);\n if (DatosList[10].equals(\"1\"))\n {\n jlEstado2.setText(\"Activo\");\n }\n else\n {\n jlEstado2.setText(\"Inactivo\");\n }\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tADMLE.Admin_DDL_Create();\n\t\t\t\tADML.setVisible(false);\n\t\t\t}", "public AdminPage() {\n initComponents();\n }", "public frmAdministracion() {\n initComponents();\n skin();\n DaoAdministracion da = new DaoAdministracion();\n da.setAdministracion(txtMedioAdministracion.getText());\n tblAdministracion.setModel(da.listar());\n\n }", "private void jmiAdministrarHuespedActionPerformed(java.awt.event.ActionEvent evt) {\n if(adminHuesped == null){\n adminHuesped = new HuespedAdministrar();\n jdpPrincipal.add(adminHuesped);\n adminHuesped.show();\n }else{\n adminHuesped.dispose();\n adminHuesped = new HuespedAdministrar();\n jdpPrincipal.add(adminHuesped);\n adminHuesped.show();\n } \n }", "public Admin_SignUp() {\n initComponents();\n }", "Dashboard createDashboard();", "public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "public AdminPanel() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "AdminConsole createAdminConsole();", "public Frame_Ajouter_Administrateur() {\n initComponents();\n }", "public Admin() {\n initComponents();\n }", "public Admin() {\n initComponents();\n }", "public Admin() {\n initComponents();\n }", "public void clickCreate() {\n\t\tbtnCreate.click();\n\t}", "public void addAdmin(Admin admin);", "public password_akses_admin_form() {\n initComponents();\n }", "public void verDatosAdministrador()\r\n\t{\r\n\t\tcrearadmin = new CrearAdministrador(this);\r\n\t\tcrearadmin.setVisible(true);\r\n\t}", "@GetMapping(\"/directorForm\")\n public String addDirectors(Model model) {\n\n model.addAttribute(\"newDirector\", new Director());\n return \"directorForm\";\n }", "public static void create(Formulario form){\n daoFormulario.create(form);\n }", "public Admin() {\r\n initComponents();\r\n \r\n }", "public Admin_MainPage() {\n initComponents();\n }", "@Override\r\n\t\tpublic void onClick(ClickEvent event) {\n\t\t\tRootPanel.get(\"details\").clear();\r\n\t\t\tuf = new UserForm(AktuellerAnwender.getAnwender());\r\n\t\t\tRootPanel.get(\"details\").add(uf);\r\n\t\t}", "public formAdmin() {\n initComponents();\n setExtendedState(MAXIMIZED_BOTH);\n initForm();\n }", "public MainFrameAdmin() {\n\t\tsuper(\"Stock Xtreme: Administrador\");\n\t}", "private void createBtnActionPerformed(java.awt.event.ActionEvent evt) {\n\n staff.setName(regName.getText());\n staff.setID(regID.getText());\n staff.setPassword(regPwd.getText());\n staff.setPosition(regPos.getSelectedItem().toString());\n staff.setGender(regGender.getSelectedItem().toString());\n staff.setEmail(regEmail.getText());\n staff.setPhoneNo(regPhone.getText());\n staff.addStaff();\n if (staff.getPosition().equals(\"Vet\")) {\n Vet vet = new Vet();\n vet.setExpertise(regExp.getSelectedItem().toString());\n vet.setExpertise_2(regExp2.getSelectedItem().toString());\n vet.addExpertise(staff.getID());\n }\n JOptionPane.showMessageDialog(null, \"User added to database\");\n updateJTable();\n }", "public FormInserir() {\n initComponents();\n }", "private HorizontalPanel createContent() {\n\t\tfinal HorizontalPanel panel = new HorizontalPanel();\n\t\tfinal VerticalPanel form = new VerticalPanel();\n\t\tpanel.add(form);\n\t\t\n\t\tfinal Label titleLabel = new Label(CONSTANTS.actorLabel());\n\t\ttitleLabel.addStyleName(AbstractField.CSS.cbtAbstractPopupLabel());\n\t\tform.add(titleLabel);\n\t\t\n\t\tfinal Label closeButton = new Label();\n\t\tcloseButton.addClickHandler(new ClickHandler() {\n\t\t\t@Override\n\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\tActorPopup.this.hide();\n\t\t\t}\n\t\t});\n\t\tcloseButton.addStyleName(AbstractField.CSS.cbtAbstractPopupClose());\n\t\tform.add(closeButton);\n\t\t\n\t\t//-----------------------------------------------\n\t\t// Party field\n\t\t//-----------------------------------------------\n\t\tpartyField = new SuggestField(this, null,\n\t\t\t\tnew NameIdAction(Service.PARTY),\n\t\t\t\tCONSTANTS.partynameLabel(),\n\t\t\t\t20,\n\t\t\t\ttab++);\n\t\tpartyField.setReadOption(Party.CREATED, true);\n\t\tpartyField.setDoubleclickable(true);\n\t\tpartyField.setHelpText(CONSTANTS.partynameHelp());\n\t\tform.add(partyField);\n\n\t\t//-----------------------------------------------\n\t\t// Email Address field\n\t\t//-----------------------------------------------\n\t\temailaddressField = new TextField(this, null,\n\t\t\t\tCONSTANTS.emailaddressLabel(),\n\t\t\t\ttab++);\n\t\temailaddressField.setMaxLength(100);\n\t\temailaddressField.setHelpText(CONSTANTS.emailaddressHelp());\n\t\tform.add(emailaddressField);\n\n\t\t//-----------------------------------------------\n\t\t// Password field\n\t\t//-----------------------------------------------\n\t\tpasswordField = new PasswordField(this, null,\n\t\t\t\tCONSTANTS.passwordLabel(),\n\t\t\t\ttab++);\n\t\tpasswordField.setSecure(true);\n\t\tpasswordField.setHelpText(CONSTANTS.passwordHelp());\n\t\tform.add(passwordField);\n\n\t\t//-----------------------------------------------\n\t\t// Check Password field\n\t\t//-----------------------------------------------\n\t\tcheckpasswordField = new PasswordField(this, null,\n\t\t\t\tCONSTANTS.checkpasswordLabel(),\n\t\t\t\ttab++);\n\t\tcheckpasswordField.setSecure(true);\n\t\tcheckpasswordField.setHelpText(CONSTANTS.checkpasswordHelp());\n\t\tform.add(checkpasswordField);\n\n\t\t//-----------------------------------------------\n\t\t// Date Format field\n\t\t//-----------------------------------------------\n\t\tformatdateField = new ListField(this, null,\n\t\t\t\tNameId.getList(Party.DATE_FORMATS, Party.DATE_FORMATS),\n\t\t\t\tCONSTANTS.formatdateLabel(),\n\t\t\t\tfalse,\n\t\t\t\ttab++);\n\t\tformatdateField.setDefaultValue(Party.MM_DD_YYYY);\n\t\tformatdateField.setFieldHalf();\n\t\tformatdateField.setHelpText(CONSTANTS.formatdateHelp());\n\t\t\n\t\t//-----------------------------------------------\n\t\t// Phone Format field\n\t\t//-----------------------------------------------\n\t\tformatphoneField = new TextField(this, null,\n\t\t\t\tCONSTANTS.formatphoneLabel(),\n\t\t\t\ttab++);\n\t\tformatphoneField.setMaxLength(25);\n\t\tformatphoneField.setFieldHalf();\n\t\tformatphoneField.setHelpText(CONSTANTS.formatphoneHelp());\n\n\t\tHorizontalPanel ff = new HorizontalPanel();\n\t\tff.add(formatdateField);\n\t\tff.add(formatphoneField);\n\t\tform.add(ff);\n\t\t\n\t\t//-----------------------------------------------\n\t\t// Roles option selector\n\t\t//-----------------------------------------------\n\t\trolesField = new OptionField(this, null,\n\t\t\t\tAbstractRoot.hasPermission(AccessControl.AGENCY) ? getAgentroles() : getOrganizationroles(),\n\t\t\t\tCONSTANTS.roleLabel(),\n\t\t\t\ttab++);\n\t\trolesField.setHelpText(CONSTANTS.roleHelp());\n\t\tform.add(rolesField);\n\n\t\tform.add(createCommands());\n\t\t\n\t\tonRefresh();\n\t\tonReset(Party.CREATED);\n\t\treturn panel;\n\t}", "public void buildAndShowMenuForm() {\n SimpleForm.Builder builder =\n SimpleForm.builder()\n .translator(MinecraftLocale::getLocaleString, session.locale())\n .title(\"gui.advancements\");\n\n List<String> rootAdvancementIds = new ArrayList<>();\n for (Map.Entry<String, GeyserAdvancement> advancement : storedAdvancements.entrySet()) {\n if (advancement.getValue().getParentId() == null) { // No parent means this is a root advancement\n builder.button(MessageTranslator.convertMessage(advancement.getValue().getDisplayData().getTitle(), session.locale()));\n rootAdvancementIds.add(advancement.getKey());\n }\n }\n\n if (rootAdvancementIds.isEmpty()) {\n builder.content(\"advancements.empty\");\n }\n\n builder.validResultHandler((response) -> {\n String id = rootAdvancementIds.get(response.clickedButtonId());\n if (!id.equals(\"\")) {\n if (id.equals(currentAdvancementCategoryId)) {\n // The server thinks we are already on this tab\n buildAndShowListForm();\n } else {\n // Send a packet indicating that we intend to open this particular advancement window\n ServerboundSeenAdvancementsPacket packet = new ServerboundSeenAdvancementsPacket(id);\n session.sendDownstreamPacket(packet);\n // Wait for a response there\n }\n }\n });\n\n session.sendForm(builder);\n }", "java.lang.String getNewAdmin();", "private Admin createNewAdmin(AdminRequest adminRequest, User user, PersonalData personalData) {\n\n Admin newAdmin = new Admin();\n newAdmin.setPersonalData(personalData);\n newAdmin.setUser(user);\n\n newAdmin.setEnabled(true);\n newAdmin.setDeleted(false);\n\n // Save on DB\n return saveAdmin(newAdmin);\n }", "private void createpanel2() {\r\n\t\tpanels[1].setLayout(new GridLayout(1, 2));\r\n\r\n\t\tdescription[0] = new JLabel(\"Accountname: \");\r\n\t\tdescription[0].setFont(smallfont);\r\n\t\tdescription[0].setHorizontalAlignment(JLabel.CENTER);\r\n\t\tuserinfo = new JTextField() {\r\n\t\t\tprivate static final long serialVersionUID = 1L;\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void paint(Graphics g) {\r\n\t\t\t\tg.drawImage(ImageLoader.getImage(\"black_0.4\"), 0, 0, null);\r\n\t\t\t\tsuper.paint(g);\r\n\t\t\t}\r\n\t\t};\r\n\t\tif (System.getProperty(\"os.name\").startsWith(\"Windows\")) {\r\n\t\t\tuserinfo.setForeground(Color.WHITE);\r\n\t\t} else {\r\n\t\t\tuserinfo.setForeground(Color.BLACK);\r\n\t\t}\r\n\t\tuserinfo.setOpaque(false);\r\n\t\tuserinfo.setFont(smallfont);\r\n\t\tpanels[1].add(description[0]);\r\n\t\tpanels[1].add(userinfo);\r\n\t\tpanels[1].setOpaque(false);\r\n\t\tallComponents.add(panels[1]);\r\n\t\tpanels[0].revalidate();\r\n\t}", "private JPanel makePanel()\n {\n JPanel mainPanel = new JPanel();\n mainPanel.add(myLoginPanel);\n\n return mainPanel;\n }", "private void btnNewActionPerformed(java.awt.event.ActionEvent evt) {\n\n initPanel();\n }", "public VAdmin() {\n initComponents();\n }", "public String handleAdd() \n throws HttpPresentationException, webschedulePresentationException\n { \n\t try {\n\t Project project = new Project();\n saveProject(project);\n throw new ClientPageRedirectException(PROJECT_ADMIN_PAGE);\n\t } catch(Exception ex) {\n return showAddPage(\"You must fill out all fields to add this project\");\n }\n }", "@Override\n public List<UpdatableItem> createPopup() {\n final List<UpdatableItem> items = new ArrayList<UpdatableItem>();\n \n /* host wizard */\n final MyMenuItem newHostWizardItem =\n new MyMenuItem(Tools.getString(\"EmptyBrowser.NewHostWizard\"),\n HOST_ICON,\n null,\n new AccessMode(ConfigData.AccessType.RO, false),\n new AccessMode(ConfigData.AccessType.RO, false)) {\n private static final long serialVersionUID = 1L;\n \n @Override\n public String enablePredicate() {\n return null;\n }\n \n @Override\n public void action() {\n final AddHostDialog dialog = new AddHostDialog(new Host());\n dialog.showDialogs();\n }\n };\n items.add(newHostWizardItem);\n Tools.getGUIData().registerAddHostButton(newHostWizardItem);\n return items;\n }", "public createNew(){\n\t\tsuper(\"Create\"); // title for the frame\n\t\t//layout as null\n\t\tgetContentPane().setLayout(null);\n\t\t//get the background image\n\t\ttry {\n\t\t\tbackground =\n\t\t\t\t\tnew ImageIcon (ImageIO.read(getClass().getResource(\"Wallpaper.jpg\")));\n\t\t}//Catch for file error\n\t\tcatch (IOException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tJOptionPane.showMessageDialog(null, \n\t\t\t\t\t\"ERROR: File(s) Not Found\\n Please Check Your File Format\\n\"\n\t\t\t\t\t\t\t+ \"and The File Name!\");\n\t\t}\n\t\t//Initialize all of the compenents \n\t\tlblBackground = new JLabel (background);\n\t\tlblTitle = new JLabel (\"Create Menu\");\n\t\tlblTitle.setFont(new Font(\"ARIAL\",Font.ITALIC, 30));\n\t\tlblName = new JLabel(\"Please Enter Your First Name.\");\n\t\tlblLastName= new JLabel (\"Please Enter Your Last Name.\");\n\t\tlblPhoneNumber = new JLabel (\"Please Enter Your Phone Number.\");\n\t\tlblAddress = new JLabel (\"Please Enter Your Address.\");\n\t\tlblMiddle = new JLabel (\"Please Enter Your Middle Name (Optional).\");\n\t\tbtnCreate = new JButton (\"Create\");\n\t\tbtnBack = new JButton (\"Back\");\n\t\t//set the font\n\t\tlblName.setFont(new Font(\"Times New Roman\",Font.BOLD, 18));\n\t\tlblLastName.setFont(new Font(\"Times New Roman\",Font.BOLD, 18));\n\t\tlblPhoneNumber.setFont(new Font(\"Times New Roman\",Font.BOLD, 18));\n\t\tlblAddress.setFont(new Font(\"Times New Roman\",Font.BOLD, 18));\n\t\tlblMiddle.setFont(new Font(\"Times New Roman\",Font.BOLD, 18));\n\n\t\t//add action listener\n\t\tbtnCreate.addActionListener(this);\n\t\tbtnBack.addActionListener(this);\n\t\t//set bounds for all the components\n\t\tbtnCreate.setBounds(393, 594, 220, 36);\n\t\ttxtMiddle.setBounds(333, 249, 342, 36);\n\t\ttxtName.setBounds(333, 158, 342, 36);\n\t\ttxtLastName.setBounds(333, 339, 342, 36);\n\t\ttxtPhoneNumber.setBounds(333, 429, 342, 36);\n\t\ttxtAddress.setBounds(333, 511, 342, 36);\n\t\tbtnBack.setBounds(6,716,64,36);\n\t\tlblTitle.setBounds(417, 0, 182, 50);\n\t\tlblMiddle.setBounds(333, 201, 342, 36);\n\t\tlblName.setBounds(387, 110, 239, 36);\n\t\tlblLastName.setBounds(387, 297, 239, 36);\n\t\tlblPhoneNumber.setBounds(369, 387, 269, 36);\n\t\tlblAddress.setBounds(393, 477, 215, 30);\n\t\tbtnBack.setBounds(6,716,64,36);\n\t\tlblTitle.setBounds(417, 0, 182, 50);\n\t\tlblBackground.setBounds(0, 0, 1000, 1000);\n\t\t//add components to frame\n\t\tgetContentPane().add(btnCreate);\n\t\tgetContentPane().add(txtMiddle);\n\t\tgetContentPane().add(txtLastName);\n\t\tgetContentPane().add(txtAddress);\n\t\tgetContentPane().add(txtPhoneNumber);\n\t\tgetContentPane().add(txtName);\n\t\tgetContentPane().add(lblMiddle);\n\t\tgetContentPane().add(lblLastName);\n\t\tgetContentPane().add(lblAddress);\n\t\tgetContentPane().add(lblPhoneNumber);\n\t\tgetContentPane().add(lblName);\n\t\tgetContentPane().add(btnBack);\n\t\tgetContentPane().add(lblTitle);\n\t\tgetContentPane().add(lblBackground);\n\t\t//set size, visible and action for close\n\t\tsetSize(1000,1000);\n\t\tsetVisible(true);\n\t\tsetDefaultCloseOperation(EXIT_ON_CLOSE);\n\n\t}", "public void crearPanel(){\n\n panel = new JPanel();\n this.getContentPane().add(panel);\n panel.setBackground(Color.CYAN);\n panel.setLayout(null);\n }", "public NewUserPanel() throws Exception {\n\t\tdatabase = new Database();\n\t\t\n\t\ttxtEmailAddress = new JTextField();\n\t\ttxtEmailAddress.setText(\"Email Address\");\n\t\ttxtEmailAddress.setColumns(10);\n\t\ttxtEmailAddress.addMouseListener(new MouseAdapter(){\n @Override\n public void mouseClicked(MouseEvent e){\n txtEmailAddress.setText(\"\");\n }\n });\n\t\t\n\t\ttxtPassword = new JTextField();\n\t\ttxtPassword.setText(\"Password\");\n\t\ttxtPassword.setColumns(10);\n\t\ttxtPassword.addMouseListener(new MouseAdapter(){\n @Override\n public void mouseClicked(MouseEvent e){\n \ttxtPassword.setText(\"\");\n }\n });\n\t\t\n\t\ttxtConfirmPassword = new JTextField();\n\t\ttxtConfirmPassword.setText(\"Confirm Password\");\n\t\ttxtConfirmPassword.setColumns(10);\n\t\ttxtConfirmPassword.addMouseListener(new MouseAdapter(){\n @Override\n public void mouseClicked(MouseEvent e){\n \ttxtConfirmPassword.setText(\"\");\n }\n });\n\t\t\n\t\ttxtBirthdayxxxxxxxx = new JTextField();\n\t\ttxtBirthdayxxxxxxxx.setText(\"Birthday (YYYY-MM-DD)\");\n\t\ttxtBirthdayxxxxxxxx.setColumns(12);\n\t\ttxtBirthdayxxxxxxxx.addMouseListener(new MouseAdapter(){\n @Override\n public void mouseClicked(MouseEvent e){\n \ttxtBirthdayxxxxxxxx.setText(\"\");\n }\n });\n\t\t\n\t\ttxtDisplayName = new JTextField();\n\t\ttxtDisplayName.setText(\"Display Name\");\n\t\ttxtDisplayName.setColumns(10);\n\t\ttxtDisplayName.addMouseListener(new MouseAdapter(){\n @Override\n public void mouseClicked(MouseEvent e){\n \ttxtDisplayName.setText(\"\");\n }\n });\n\t\t\n\t\tJCheckBox chckbxMusicArtist = new JCheckBox(\"Music Artist\");\n\t\t\n\t\tJCheckBox chckbxProducer = new JCheckBox(\"Producer\");\n\t\t\n\t\tJButton btnNext = new JButton(\"Next ->\");\n\t\tbtnNext.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) { \n\t\t\t //Check booleans\n\t\t\t\tif (chckbxMusicArtist.isSelected() && !chckbxProducer.isSelected()) {\n\t\t\t\t\t//Music artist only\n\t\t\t\t\tString recordCompany = JOptionPane.showInputDialog(getParent(),\n\t\t\t\t\t\t \"Who is your record company? (Leave blank if not signed).\");\n\t\t\t\t\t\n\t\t\t\t\tString password = txtPassword.getText();\n\t\t\t\t\tString copyPassword = txtConfirmPassword.getText();\n\t\t\t\t\tif (password.equals(copyPassword)) {\n\t\t\t\t\t\t// Creating normal user\n\t\t\t\t\t\tString email = txtEmailAddress.getText();\n\t\t\t\t\t\tString displayName = txtDisplayName.getText();\n\t\t\t\t\t\tString dob = txtBirthdayxxxxxxxx.getText();\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tConnection con = database.getConnection();\n\t\t\t\t\t\t\tPreparedStatement insert = con.prepareStatement(\"INSERT INTO User VALUES ('\"+email+\"', '\"+password+\"', '\"+displayName+\"', '\"+ dob +\"');\");\t\t\t\t\t\t\t\t\tinsert.executeUpdate();\n\t\t\t\t\t\t\tinsert.executeUpdate();\n\t\t\t\t\t\n\t\t\t\t\t\t} catch (Exception error) {\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tConnection con = database.getConnection();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tPreparedStatement insertArt = con.prepareStatement(\"INSERT INTO Artist VALUES ('\" + email + \"', '\" + recordCompany + \"');\");\n\t\t\t\t\t\t\tinsertArt.executeUpdate();\n\t\t\t\t\t\t\t// Display Finished Screen\n\t\t\t\t\t\t\tFinishedNewUserPanel finish = new FinishedNewUserPanel();\n\t\t\t\t\t\t\tJFrame frame = (JFrame) getTopLevelAncestor();\n\t\t\t\t\t\t\tframe.setContentPane(finish);\n\t\t\t\t\t\t\tframe.repaint();\n\t\t\t\t\t\t\tframe.printAll(frame.getGraphics());\n\t\t\t\t\t\t} catch (Exception error) {\n\n\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(getParent(),\n\t\t\t\t\t\t\t \"Passwords do not match.\");\n\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 (!chckbxMusicArtist.isSelected() && chckbxProducer.isSelected()) {\n\t\t\t\t\t//Producer only\n\t\t\t\t\tString companyName = JOptionPane.showInputDialog(getParent(),\n\t\t\t\t\t\t \"What is your company name?\");\n\t\t\t\t\tString contactInfo = JOptionPane.showInputDialog(getParent(), \n\t\t\t\t\t\t\t\"Contact Information?\");\n\t\t\t\t\t\n\t\t\t\t\tString password = txtPassword.getText();\n\t\t\t\t\tString copyPassword = txtConfirmPassword.getText();\n\t\t\t\t\tif (password.equals(copyPassword)) {\n\t\t\t\t\t\t// Creating normal user\n\t\t\t\t\t\tString email = txtEmailAddress.getText();\n\t\t\t\t\t\tString displayName = txtDisplayName.getText();\n\t\t\t\t\t\tString dob = txtBirthdayxxxxxxxx.getText();\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tConnection con = database.getConnection();\n\t\t\t\t\t\t\tPreparedStatement insert = con.prepareStatement(\"INSERT INTO User VALUES ('\"+email+\"', '\"+password+\"', '\"+displayName+\"', '\"+ dob +\"');\");\t\t\t\t\t\t\t\t\tinsert.executeUpdate();\n\t\t\t\t\t\t\tinsert.executeUpdate();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} catch (Exception error) {\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tConnection con = database.getConnection();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tPreparedStatement insertPro = con.prepareStatement(\"INSERT INTO Producer VALUES ('\" + email + \"', '\" + companyName + \"', '\" + contactInfo + \"');\");\n\t\t\t\t\t\t\tinsertPro.executeUpdate();\n\t\t\t\t\t\t\t// Display Finished Screen\n\t\t\t\t\t\t\tFinishedNewUserPanel finish = new FinishedNewUserPanel();\n\t\t\t\t\t\t\tJFrame frame = (JFrame) getTopLevelAncestor();\n\t\t\t\t\t\t\tframe.setContentPane(finish);\n\t\t\t\t\t\t\tframe.repaint();\n\t\t\t\t\t\t\tframe.printAll(frame.getGraphics());\n\t\t\t\t\t\t} catch (Exception error) {\n\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(getParent(),\n\t\t\t\t\t\t\t \"Passwords do not match.\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else if (chckbxMusicArtist.isSelected() && chckbxProducer.isSelected()) {\n\t\t\t\t\t//Both\n\t\t\t\t\tJOptionPane.showMessageDialog(getParent(), \"Cannot be both a artist and a producer\");\n\t\t\t\t} else {\n\t\t\t\t\t//None\n\t\t\t\t\tString password = txtPassword.getText();\n\t\t\t\t\tString copyPassword = txtConfirmPassword.getText();\n\t\t\t\t\tif (password.equals(copyPassword)) {\n\t\t\t\t\t\t// Creating normal user\n\t\t\t\t\t\tString email = txtEmailAddress.getText();\n\t\t\t\t\t\tString displayName = txtDisplayName.getText();\n\t\t\t\t\t\tString dob = txtBirthdayxxxxxxxx.getText();\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tConnection con = database.getConnection();\n\t\t\t\t\t\t\tPreparedStatement insert = con.prepareStatement(\"INSERT INTO User VALUES ('\"+email+\"', '\"+password+\"', '\"+displayName+\"', '\"+ dob +\"');\");\t\t\t\t\t\t\t\t\tinsert.executeUpdate();\n\t\t\t\t\t\t\tinsert.executeUpdate();\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Display Finished Screen\n\t\t\t\t\t\t\tFinishedNewUserPanel finish = new FinishedNewUserPanel();\n\t\t\t\t\t\t\tJFrame frame = (JFrame) getTopLevelAncestor();\n\t\t\t\t\t\t\tframe.setContentPane(finish);\n\t\t\t\t\t\t\tframe.repaint();\n\t\t\t\t\t\t\tframe.printAll(frame.getGraphics());\n\t\t\t\t\t\t} catch (Exception error) {\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(getParent(),\n\t\t\t\t\t\t\t\t \"This email address has already been registered!\");\n\t\t\t\t\t\t}\n\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(getParent(),\n\t\t\t\t\t\t\t \"Passwords do not match.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tJLabel lblNewUser = new JLabel(\"New User\");\n\t\t\n\t\tJButton button = new JButton(\"<- Back\");\n\t\tbutton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) { \n\t\t\t //Return back to Login Screen\n\t\t\t\tLoginPanel back;\n\t\t\t\ttry {\n\t\t\t\t\tback = new LoginPanel();\n\t\t\t\t\tJFrame frame = (JFrame) getTopLevelAncestor();\n\t\t\t\t\tframe.setContentPane(back);\n\t\t\t\t\tframe.repaint();\n\t\t\t\t\tframe.printAll(frame.getGraphics());\n\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\n\t\t\t}\n\t\t});\n\t\t\n\t\tGroupLayout groupLayout = new GroupLayout(this);\n\t\tgroupLayout.setHorizontalGroup(\n\t\t\tgroupLayout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t.addGroup(groupLayout.createSequentialGroup()\n\t\t\t\t\t.addContainerGap(230, Short.MAX_VALUE)\n\t\t\t\t\t.addComponent(button)\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t.addComponent(btnNext)\n\t\t\t\t\t.addContainerGap())\n\t\t\t\t.addGroup(Alignment.LEADING, groupLayout.createSequentialGroup()\n\t\t\t\t\t.addGap(35)\n\t\t\t\t\t.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t.addComponent(lblNewUser)\n\t\t\t\t\t\t.addComponent(chckbxProducer)\n\t\t\t\t\t\t.addComponent(chckbxMusicArtist)\n\t\t\t\t\t\t.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t.addComponent(txtDisplayName, Alignment.LEADING)\n\t\t\t\t\t\t\t.addComponent(txtBirthdayxxxxxxxx, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 252, Short.MAX_VALUE)\n\t\t\t\t\t\t\t.addComponent(txtConfirmPassword, Alignment.LEADING)\n\t\t\t\t\t\t\t.addComponent(txtPassword, Alignment.LEADING)\n\t\t\t\t\t\t\t.addComponent(txtEmailAddress, Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 371, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t.addContainerGap(44, Short.MAX_VALUE))\n\t\t);\n\t\tgroupLayout.setVerticalGroup(\n\t\t\tgroupLayout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(groupLayout.createSequentialGroup()\n\t\t\t\t\t.addGap(20)\n\t\t\t\t\t.addComponent(lblNewUser)\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t.addComponent(txtEmailAddress, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t.addGroup(groupLayout.createSequentialGroup()\n\t\t\t\t\t\t\t.addComponent(txtPassword, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t.addComponent(txtConfirmPassword, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t.addComponent(txtBirthdayxxxxxxxx, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t.addComponent(txtDisplayName, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t.addComponent(chckbxMusicArtist)\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t.addComponent(chckbxProducer)\n\t\t\t\t\t\t\t.addContainerGap(36, Short.MAX_VALUE))\n\t\t\t\t\t\t.addGroup(groupLayout.createSequentialGroup()\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 189, Short.MAX_VALUE)\n\t\t\t\t\t\t\t.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t\t\t.addComponent(btnNext)\n\t\t\t\t\t\t\t\t.addComponent(button))\n\t\t\t\t\t\t\t.addContainerGap())))\n\t\t);\n\t\tsetLayout(groupLayout);\n\n\t}", "public void createHomePage(){\n\t\tsetLayout(new GridBagLayout());\n\t\tGridBagConstraints c = new GridBagConstraints(); \n\t\t//insert username and password fields\n\t\tJLabel title;\n\n\t\t//build the title panel\n\t\ttitlePanel = new JPanel();\n\t\ttitle = new JLabel(\"Budgie\");\n\t\ttitle.setSize(new Dimension(40, 40));\n\t\ttitlePanel.add(title);\n\n\t\tc.anchor = GridBagConstraints.CENTER;\n\t\tc.gridy = 0;\n\t\tc.weighty = .5;\n\t\tadd(titlePanel, c);\n\n\t\tinputField = addinputField();\n\n\t\t//positioning of the grid field\n\t\tc.fill = GridBagConstraints.HORIZONTAL;\n\t\tc.gridy = 1;\n\t\tc.ipady = 10;\n\t\tc.weighty = .5;\n\t\tadd(inputField, c);\n\n\t\tc.gridy++;\n\t\tJButton debug = new JButton(\"Debug\");\n\t\tdebug.addActionListener(new ActionListener(){\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tDebugPrinter.toggleDebug();\n\t\t\t}\n\n\t\t});\n\t\tadd(debug,c);\n\n\n\t\tpack();\n\n\n\t}", "public Add_E() {\n initComponents();\n this.setTitle(\"Add Engineer\");\n }", "private void creatingElements() {\n\t\ttf1 = new JTextField(20);\n\t\ttf2 = new JTextField(20);\n\t\ttf3 = new JTextField(20);\n\t\tJButton btn = new JButton(\"Add\");\n\t\tbtn.addActionListener(control);\n\t\tbtn.setActionCommand(\"add\");\n\t\t\n\t\tJPanel panel = new JPanel();\n\t\tpanel.add(tf1);\n\t\tpanel.add(tf2);\n\t\tpanel.add(btn);\n\t\tpanel.add(tf3);\n\t\t\n\t\tthis.add(panel);\n\t\t\n\t\tthis.validate();\n\t\tthis.repaint();\t\t\n\t\t\n\t}", "public Form getCreationForm() throws ProcessManagerException {\r\n try {\r\n Action creation = processModel.getCreateAction();\r\n return processModel.getPublicationForm(creation.getName(), currentRole,\r\n getLanguage());\r\n } catch (WorkflowException e) {\r\n throw new ProcessManagerException(\"SessionController\",\r\n \"processManager.ERR_NO_CREATION_FORM\", e);\r\n }\r\n }", "@RequestMapping(\"/new\")\n\tpublic String displayProjectForm(Model model) {\n\t\tProject aproject = new Project();\n\t//Iterable<Employee> employees = \tpro.getall();\n\t\n\t\tmodel.addAttribute(\"project\", aproject);\n\n\t\t//model.addAttribute(\"allEmployees\", employees);\n\t\t\n\t\t\n\t\treturn \"newproject\";\n\t\t\n\t}", "public void onAddByWebSitePressed( ) {\n Router.Instance().changeView(Router.Views.AddFromWebSite);\n }", "public ControladorPanel() { }", "public Administrador() {\n //título da tela Administrador\n setTitle(\"Administrador\");\n //Inicializa os componentes da tela\n initComponents();\n //Inicializa o combo box contendo os instrutores cadastrados\n initComboBox();\n //inicia tela no centro\n this.setLocationRelativeTo(null);\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel2 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n jPanel1 = new javax.swing.JPanel();\n jPanel3 = new javax.swing.JPanel();\n jPanel4 = new javax.swing.JPanel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jButton1 = new javax.swing.JButton();\n admin_id = new javax.swing.JTextField();\n jButton2 = new javax.swing.JButton();\n jButton3 = new javax.swing.JButton();\n password = new javax.swing.JPasswordField();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n\n jPanel2.setBackground(new java.awt.Color(0, 0, 255));\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 1, 24)); // NOI18N\n jLabel1.setForeground(new java.awt.Color(255, 204, 0));\n jLabel1.setText(\"WELCOME ADMIN \");\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()\n .addContainerGap(296, Short.MAX_VALUE)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 645, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(230, 230, 230))\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()\n .addContainerGap(50, Short.MAX_VALUE)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(26, 26, 26))\n );\n\n jPanel1.setBackground(new java.awt.Color(51, 204, 255));\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 180, Short.MAX_VALUE)\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 0, Short.MAX_VALUE)\n );\n\n jPanel3.setBackground(new java.awt.Color(0, 0, 0));\n jPanel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 3));\n\n jPanel4.setBackground(new java.awt.Color(51, 204, 255));\n jPanel4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 3));\n jPanel4.setForeground(new java.awt.Color(51, 204, 255));\n\n jLabel2.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel2.setText(\"ADMIN ID\");\n\n jLabel3.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel3.setText(\"PASSWORD\");\n\n jButton1.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jButton1.setText(\"LOGIN\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n admin_id.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n\n jButton2.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jButton2.setText(\"EXIT\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n jButton3.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jButton3.setText(\"BACK\");\n jButton3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton3ActionPerformed(evt);\n }\n });\n\n password.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n\n javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);\n jPanel4.setLayout(jPanel4Layout);\n jPanel4Layout.setHorizontalGroup(\n jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addContainerGap())\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()\n .addGap(93, 93, 93)\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(jLabel2))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 124, Short.MAX_VALUE)\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jButton1)\n .addComponent(admin_id, javax.swing.GroupLayout.DEFAULT_SIZE, 301, Short.MAX_VALUE)\n .addComponent(password))\n .addGap(68, 68, 68))\n );\n jPanel4Layout.setVerticalGroup(\n jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addGap(44, 44, 44)\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(admin_id, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(73, 73, 73)\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel3)\n .addComponent(password, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 69, Short.MAX_VALUE)\n .addComponent(jButton1)\n .addGap(7, 7, 7)\n .addComponent(jButton3)\n .addGap(18, 18, 18)\n .addComponent(jButton2)\n .addContainerGap())\n );\n\n javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);\n jPanel3.setLayout(jPanel3Layout);\n jPanel3Layout.setHorizontalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addContainerGap())\n );\n jPanel3Layout.setVerticalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addContainerGap())\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGap(210, 210, 210)\n .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(74, 74, 74)\n .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 202, Short.MAX_VALUE))\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n\n pack();\n }", "@RequestMapping(value = \"/new\", method = RequestMethod.GET)\n public String newRole(Model model) {\n model.addAttribute(\"roleCreate\", new CreateRoleDTO());\n return (WebUrls.URL_ROLE+\"/new\");\n }", "public Admin createAdmin(){\n\t\ttry {\n\t\t\treturn conn.getAdmin();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "public abstract void addEditorForm();", "public adminUsuarios() {\n initComponents();\n showUsuarios();\n }", "@Token(save = true, validate = false)\n @Execute\n public HtmlResponse createpage(final SuggestBadWordEditForm form) {\n form.initialize();\n form.crudMode = CrudMode.CREATE;\n return asHtml(path_AdminSuggestbadword_EditJsp);\n }", "@Override\r\n protected void createDbContentCreateEdit() {\n DbContentCreateEdit dbContentCreateEdit = new DbContentCreateEdit();\r\n dbContentCreateEdit.init(null);\r\n form.getModelObject().setDbContentCreateEdit(dbContentCreateEdit);\r\n dbContentCreateEdit.setParent(form.getModelObject());\r\n ruServiceHelper.updateDbEntity(form.getModelObject()); \r\n }", "@GetMapping(\"/showFormForAdd\")\n public String showFormForAdd(Model theModel) {\n Categories theCategories = new Categories();\n theModel.addAttribute(\"categories\", theCategories);\n //theModel.addAttribute(\"update\", false);\n return \"loaisanpham-form\"; }", "public signadmin() {\n initComponents();\n }", "public AdminLogInPage() {\n initComponents();\n }", "public Project_Create() {\n initComponents();\n }", "@Command\n\tpublic void nuevoAnalista(){\n\t\tMap<String, Object> parametros = new HashMap<String, Object>();\n\n\t\t//parametros.put(\"recordMode\", \"NEW\");\n\t\tllamarFormulario(\"formularioAnalistas.zul\", null);\n\t}", "public DataPresensiAdmin() {\n initComponents();\n }", "@Override\r\n\t\tpublic void onClick(ClickEvent event) {\n\t\t\tdropdown.clear();\r\n\t\t\tRootPanel.get(\"details\").clear();\r\n\t\t\tSpielplanErstellenForm erstellen = new SpielplanErstellenForm();\r\n\r\n\t\t\tRootPanel.get(\"details\").add(erstellen);\r\n\t\t}", "public frmNewArtist() {\n initComponents();\n lblID.setText(Controller.Agent.ManageController.getNewArtistID());\n lblGreeting.setText(\"Dear \"+iMuzaMusic.getLoggedUser().getFirstName()+\", please use the form below to add an artist to your ranks.\");\n \n }", "public AdminUI() {\n initComponents();\n wdh=new WebDataHandler();\n initList();\n }", "public void add_admin(String admin_id, String admin_name, String admin_address, String admin_designation,\n\t\t\t double salary, String contact, boolean status_vacancy, String password,String admin_project_key)\n {\n\t\t\n \tadm_list.insert(new Admin(admin_id,admin_name,admin_address,admin_designation, salary,contact,status_vacancy,password,admin_project_key));\n \twrite_adm_file();\n }", "public AdministrationPanel(JFrame parent) {\n this.parent = parent;\n initComponents();\n\n tv = new TabView();\n eap = new EmployeeAdministrationPanel(parent);\n vap = new CarAdministrationPanel(parent);\n tv.addNewTab(\"Medarbejder\", eap);\n tv.addNewTab(\"Biler\", vap);\n\n add(tv, BorderLayout.CENTER);\n }", "public void saveAndCreateNew() throws Exception {\n\t\topenPrimaryButtonDropdown();\n\t\tgetControl(\"saveAndCreateNewButton\").click();\n\t}", "public JPanelCreateClient() {\r\n\t\tsuper(new BorderLayout());\r\n\t\tthis.title = new CustomLabel(ConstantView.TITLE_CREATE_CLIENT, null, Color.decode(\"#2E5569\"));\r\n\t\tthis.okButton = new JButton(\"REGISTRAR CLIENTE\");\r\n\t\tthis.returnButton = new JButton(ConstantView.BUTTON_RETURN_SIGNIN);\r\n\t\tthis.jPanelFormClient = new JPanelFormClient();\r\n\t\tControlClient.getInstance().setjPanelCreateClient(this);\r\n\t\tthis.init();\r\n\t}", "public static void create() {\n Application.currentUserCan( 1 );\n \n String author = session.get(\"userEmail\");\n String title = params.get( \"course[title]\", String.class );\n String content = params.get( \"course[content]\", String.class );\n \n if( title.length() > 0 && content.length() > 0 ) {\n Course course = new Course(title, content, author);\n course.save();\n }\n \n index();\n }", "@FXML\n\tvoid createAdministratorAccount(ActionEvent event) throws IOException,Exception {\n\t\tString adEmail = emailAdmin.getText();\n\t\tString adPassword = passwordAdmin.getText(); \n\t\t\n\t\tif(adEmail.isBlank()) {\n\t\t\tInfoBox.infoBoxW(\"A valid email must be provided\",\"Missing email\",\"Missing information\");\n\t\t}else {\n\t\t\tif(adPassword.isBlank()) {\n\t\t\t\tInfoBox.infoBoxW(\"A valid password must be provided\",\"Missing password\",\"Missing information\");\n\t\t\t}else {\n\t\t\t\tif(!adEmail.matches(\"^([a-zA-Z0-9_\\\\-\\\\.]+)@([a-zA-Z0-9_\\\\-\\\\.]+)\\\\.([a-zA-Z]{2,5})$\")) {\n\t\t\t\t\tInfoBox.infoBoxW(\"An email with valid syntax expected\",\"Email syntax invalid\",\"Invalid syntax\");\n\t\t\t\t}else {\n\t\t\t\t\tif(!adPassword.matches(\"([a-z]|[A-Z]|[0-9])*\")){\n\t\t\t\t\t\tInfoBox.infoBoxW(\"A password with valid syntax expected\",\"Password syntax invalid\",\"Invalid syntax\");\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tUserFacade uf = new UserFacade();\n\t\t\t\t\t\tboolean isDone = uf.registerAdministrator(adEmail, HashPassword.hashPassword(adPassword));\n\t\t\t\t\t\tif(isDone) {\n\t\t\t\t\t\t\tInfoBox.infoBoxI(\"Admin created\", \"Admin created\", \"Admin Created\");\n\t\t\t\t\t\t\tTheWerewolvesOfMillersHollow.setScene(getClass().getResource(\"../view/AdministratorMenuView.fxml\"));\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\tInfoBox.infoBoxE(\"Creation failed, retry later\",\"Creation failed\",\"Creation Error\");\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}", "@RequestMapping(value = { \"/new\"}, method = RequestMethod.GET)\n\tpublic String newEntity(ModelMap model) {\n\t\tENTITY entity = createEntity();\n\n\t\tmodel.addAttribute(\"entity\", entity);\n\t\tmodel.addAttribute(\"edit\", false);\n\t\tmodel.addAttribute(\"loggedinuser\", getPrincipal());\n\t\treturn viewBaseLocation + \"/form\";\n\t}", "@RequestMapping(\"/save\")\n\tpublic String createProjectForm(Project project, Model model) {\n\t\t\n\tproRep.save(project);\n\tList<Project> getall = (List<Project>) proRep.getAll();\n\tmodel.addAttribute(\"projects\", getall);\n\t\n\treturn \"listproject\";\n\t\t\n\t}", "public HarvesterAdminForm() {\n\n\t\tsetShSet(\"split\");\n\n\t\tprtln(\"HarvesterAdminForm() \");\n\n\t}", "public static AssessmentCreationForm openFillCreationForm(Assessment assm) {\n openCreationSearchForm(Roles.STAFF, WingsTopMenu.WingsStaffMenuItem.P_ASSESSMENTS, Popup.Create);\n\n Logger.getInstance().info(\"Fill out the required fields with valid data\");\n AssessmentCreationForm creationForm = new AssessmentCreationForm();\n creationForm.fillAssessmentInformation(new User(Roles.STAFF), assm);\n\n return new AssessmentCreationForm();\n }", "@RequestMapping(value = \"/report.create\", method = RequestMethod.GET)\n @ResponseBody public ModelAndView newreportForm(HttpSession session) throws Exception {\n ModelAndView mav = new ModelAndView();\n mav.setViewName(\"/sysAdmin/reports/details\");\n\n //Create a new blank provider.\n reports report = new reports();\n \n mav.addObject(\"btnValue\", \"Create\");\n mav.addObject(\"reportdetails\", report);\n\n return mav;\n }", "@Command\n public void nuevaMateria() {\n\t\t\n\t\tWindow window = (Window)Executions.createComponents(\n \"/WEB-INF/include/Mantenimiento/Materias/vtnMaterias.zul\", null, null);\n window.doModal();\n }", "public AdministradorView() {\n initComponents();\n }", "public String nuevo() {\n\n\t\tLOG.info(\"Submitado formulario, accion nuevo\");\n\t\tString view = \"/alumno/form\";\n\n\t\t// las validaciones son correctas, por lo cual los datos del formulario estan en\n\t\t// el atributo alumno\n\n\t\t// TODO simular index de la bbdd\n\t\tint id = this.alumnos.size();\n\t\tthis.alumno.setId(id);\n\n\t\tLOG.debug(\"alumno: \" + this.alumno);\n\n\t\t// TODO comprobar edad y fecha\n\n\t\talumnos.add(alumno);\n\t\tview = VIEW_LISTADO;\n\t\tmockAlumno();\n\n\t\t// mensaje flash\n\t\tFacesContext facesContext = FacesContext.getCurrentInstance();\n\t\tExternalContext externalContext = facesContext.getExternalContext();\n\t\texternalContext.getFlash().put(\"alertTipo\", \"success\");\n\t\texternalContext.getFlash().put(\"alertMensaje\", \"Alumno \" + this.alumno.getNombre() + \" creado con exito\");\n\n\t\treturn view + \"?faces-redirect=true\";\n\t}", "@RequestMapping(value = { \"/newuser\" }, method = RequestMethod.GET)\n\t@PreAuthorize(\"hasRole('ADMIN')\")\n\tpublic String newUser(ModelMap model) {\n\t\tUser user = new User();\n\t\tmodel.addAttribute(\"user\", user);\n\t\tmodel.addAttribute(\"edit\", false);\n\t\treturn \"registration\";\n\t}", "public void Create(View view) {\n disableButton = findViewById(R.id.newAccountButton);\n disableButton.setEnabled(false);\n username = ((EditText)findViewById(R.id.createName)).getText().toString();\n password = ((EditText)findViewById(R.id.createPassword)).getText().toString();\n String password2 = ((EditText)findViewById(R.id.recreatePassword)).getText().toString();\n if (username.length() == 0 || password.length() == 0) {\n Toast.makeText(this, \"Fill in all boxes\", Toast.LENGTH_SHORT).show();\n disableButton.setEnabled(true);\n } else if (!password.equals(password2)) {\n Toast.makeText(this, \"passwords must be the same\", Toast.LENGTH_SHORT).show();\n disableButton.setEnabled(true);\n } else {\n PostuserHelper helper = new PostuserHelper(username, password, getApplicationContext(),\n NewaccountActivity.this);\n }\n }", "public static void creaAdmin(Admin admin) {\n\t\ttry {\n\t\t\tRequestContent rp = new RequestContent();\n\t\t\trp.type = RequestType.CREATE_USER;\n\t\t\trp.userType = UserType.ADMIN;\n\t\t\trp.parameters = new Object[] { admin };\n\t\t\tsend(rp);\n\t\t} catch (Exception e) {\n\n\t\t}\n\t}" ]
[ "0.6713568", "0.6207267", "0.61880684", "0.6089925", "0.6038003", "0.60357803", "0.60243505", "0.59518546", "0.59221596", "0.5855683", "0.58510786", "0.5826542", "0.5812991", "0.5804792", "0.57977474", "0.5796036", "0.5789724", "0.57805145", "0.5779931", "0.57758266", "0.57743746", "0.5741158", "0.5729292", "0.57200766", "0.5711442", "0.57008356", "0.56976235", "0.56893677", "0.56872284", "0.5681299", "0.5670648", "0.566625", "0.566625", "0.566625", "0.5648691", "0.56464565", "0.5625742", "0.5616889", "0.5609058", "0.55799484", "0.5577064", "0.5570439", "0.5569623", "0.5554331", "0.5548932", "0.55433315", "0.55373704", "0.5536657", "0.55353105", "0.55029714", "0.5498625", "0.54971045", "0.5495078", "0.54904723", "0.54818594", "0.54786015", "0.5471837", "0.547061", "0.54690915", "0.5463207", "0.5439292", "0.5432494", "0.5429707", "0.54267776", "0.5413876", "0.5409773", "0.5399813", "0.5395634", "0.5393403", "0.5392192", "0.53894114", "0.5383991", "0.53827226", "0.5382522", "0.53823835", "0.5376361", "0.53716785", "0.53691447", "0.5367458", "0.5364427", "0.5364384", "0.5363008", "0.5362258", "0.5362163", "0.5351474", "0.5350334", "0.53465503", "0.5346244", "0.5342947", "0.5340868", "0.53400725", "0.5335927", "0.53241795", "0.5322054", "0.5314659", "0.5309202", "0.53080463", "0.5307482", "0.5306261", "0.53049284", "0.5301509" ]
0.0
-1
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jRadioButtonMenuItem1 = new javax.swing.JRadioButtonMenuItem(); bg = new javax.swing.ButtonGroup(); jMenuItem3 = new javax.swing.JMenuItem(); jMenu3 = new javax.swing.JMenu(); framePanel = new javax.swing.JPanel(); inputPanel = new javax.swing.JPanel(); tfName = new javax.swing.JTextField(); tfPaintId = new javax.swing.JTextField(); add = new javax.swing.JButton(); clear = new javax.swing.JButton(); tfQuantity = new javax.swing.JTextField(); bCombo = new javax.swing.JComboBox<>(); paintID1 = new javax.swing.JLabel(); name1 = new javax.swing.JLabel(); color1 = new javax.swing.JLabel(); brand1 = new javax.swing.JLabel(); price1 = new javax.swing.JLabel(); typeCombo = new javax.swing.JComboBox<>(); type1 = new javax.swing.JLabel(); rwCombo = new javax.swing.JComboBox<>(); rw = new javax.swing.JLabel(); medium = new javax.swing.JRadioButton(); high = new javax.swing.JRadioButton(); mild = new javax.swing.JRadioButton(); quality1 = new javax.swing.JLabel(); tfColor = new javax.swing.JTextField(); tfPrice = new javax.swing.JTextField(); quantity1 = new javax.swing.JLabel(); detailPanel = new javax.swing.JPanel(); jLabel10 = new javax.swing.JLabel(); btnDelete = new javax.swing.JButton(); btnEdit = new javax.swing.JButton(); jScrollPane2 = new javax.swing.JScrollPane(); jt = new javax.swing.JTable(); searchPanel = new javax.swing.JPanel(); jLabel9 = new javax.swing.JLabel(); searchValueTF = new javax.swing.JTextField(); btnSearch = new javax.swing.JButton(); searchCombo = new javax.swing.JComboBox<>(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); save = new javax.swing.JMenuItem(); custPanel = new javax.swing.JMenuItem(); btnExit = new javax.swing.JMenuItem(); about = new javax.swing.JMenu(); subAbout = new javax.swing.JMenuItem(); help = new javax.swing.JMenuItem(); jRadioButtonMenuItem1.setSelected(true); jRadioButtonMenuItem1.setText("jRadioButtonMenuItem1"); jMenuItem3.setText("jMenuItem3"); jMenu3.setText("jMenu3"); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Hyolmo Paint Store"); setName("jFrameAdmin"); // NOI18N setResizable(false); framePanel.setBackground(new java.awt.Color(223, 238, 253)); inputPanel.setBackground(new java.awt.Color(252, 252, 252)); inputPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder()); add.setText("Add"); add.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { addActionPerformed(evt); } }); clear.setText("Clear"); clear.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clearActionPerformed(evt); } }); bCombo.setForeground(new java.awt.Color(51, 51, 255)); bCombo.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Select", "Asian Paint", "Kensai Nerolac", "Pashupati Paint", "Apollo Paint" })); paintID1.setText("Paint ID:"); name1.setText("Name"); color1.setText("Color"); brand1.setText("Brand"); price1.setText("Price"); typeCombo.setForeground(new java.awt.Color(0, 0, 255)); typeCombo.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Select", "Wall Paint", "House Paint", "Spray Paint", "Auto Mobiles" })); type1.setText("Type"); rwCombo.setForeground(new java.awt.Color(0, 51, 255)); rwCombo.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Select", "Epoxy", "Calcium", "Acrylic" })); rw.setText("Raw Material"); bg.add(medium); medium.setText("Medium"); bg.add(high); high.setText("High"); bg.add(mild); mild.setText("Mild"); quality1.setText("Quality"); quantity1.setText("Quantity"); javax.swing.GroupLayout inputPanelLayout = new javax.swing.GroupLayout(inputPanel); inputPanel.setLayout(inputPanelLayout); inputPanelLayout.setHorizontalGroup( inputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(inputPanelLayout.createSequentialGroup() .addGroup(inputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, inputPanelLayout.createSequentialGroup() .addGroup(inputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(inputPanelLayout.createSequentialGroup() .addGap(19, 19, 19) .addGroup(inputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(name1) .addComponent(paintID1, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(49, 49, 49) .addGroup(inputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(tfPaintId, javax.swing.GroupLayout.DEFAULT_SIZE, 215, Short.MAX_VALUE) .addComponent(tfName))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, inputPanelLayout.createSequentialGroup() .addComponent(rw) .addGap(42, 42, 42) .addComponent(rwCombo, javax.swing.GroupLayout.PREFERRED_SIZE, 215, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(inputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(inputPanelLayout.createSequentialGroup() .addGap(54, 54, 54) .addGroup(inputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(brand1, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(price1))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, inputPanelLayout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(color1, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18))) .addGroup(inputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(tfPrice, javax.swing.GroupLayout.DEFAULT_SIZE, 215, Short.MAX_VALUE) .addComponent(bCombo, 0, 215, Short.MAX_VALUE) .addComponent(tfColor))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, inputPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(add, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(clear, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(66, 66, 66))) .addGap(30, 30, 30) .addGroup(inputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(type1, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(quality1) .addComponent(quantity1)) .addGap(39, 39, 39) .addGroup(inputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, inputPanelLayout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(high) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(medium) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(mild, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(typeCombo, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(tfQuantity)) .addGap(29, 29, 29)) ); inputPanelLayout.setVerticalGroup( inputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(inputPanelLayout.createSequentialGroup() .addGap(22, 22, 22) .addGroup(inputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(typeCombo) .addGroup(inputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(brand1, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(bCombo, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tfPaintId, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(type1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(paintID1, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(inputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(inputPanelLayout.createSequentialGroup() .addGroup(inputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(price1) .addComponent(tfName, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tfPrice, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(name1, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(inputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(color1, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(rwCombo, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(rw, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tfColor, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(inputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(clear, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(add, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(inputPanelLayout.createSequentialGroup() .addGroup(inputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(tfQuantity, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(quantity1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(inputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(inputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(medium) .addComponent(mild) .addComponent(high)) .addComponent(quality1, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addGap(48, 48, 48)) ); detailPanel.setBackground(new java.awt.Color(255, 255, 255)); detailPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jLabel10.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel10.setText("Details:"); btnDelete.setText("Delete"); btnDelete.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnDeleteActionPerformed(evt); } }); btnEdit.setText("Update"); btnEdit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnEditActionPerformed(evt); } }); jt.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jt.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jt.setForeground(new java.awt.Color(0, 0, 255)); jt.setModel(jtModel); jt.setGridColor(new java.awt.Color(0, 0, 0)); jt.setRowHeight(30); jt.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jtMouseClicked(evt); } }); jScrollPane2.setViewportView(jt); javax.swing.GroupLayout detailPanelLayout = new javax.swing.GroupLayout(detailPanel); detailPanel.setLayout(detailPanelLayout); detailPanelLayout.setHorizontalGroup( detailPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(detailPanelLayout.createSequentialGroup() .addContainerGap() .addGroup(detailPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane2) .addGroup(detailPanelLayout.createSequentialGroup() .addGap(14, 14, 14) .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 680, Short.MAX_VALUE) .addComponent(btnEdit, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnDelete, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); detailPanelLayout.setVerticalGroup( detailPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(detailPanelLayout.createSequentialGroup() .addContainerGap() .addGroup(detailPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, detailPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnEdit, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(btnDelete, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 335, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); searchPanel.setBackground(new java.awt.Color(255, 255, 255)); searchPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jLabel9.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel9.setText("Find By Name/Brand:"); btnSearch.setText("Search"); btnSearch.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnSearchActionPerformed(evt); } }); searchCombo.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Product ID", "Price", "Brand" })); javax.swing.GroupLayout searchPanelLayout = new javax.swing.GroupLayout(searchPanel); searchPanel.setLayout(searchPanelLayout); searchPanelLayout.setHorizontalGroup( searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(searchPanelLayout.createSequentialGroup() .addGap(20, 20, 20) .addComponent(jLabel9) .addGap(50, 50, 50) .addComponent(searchCombo, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(42, 42, 42) .addComponent(searchValueTF, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(80, 80, 80) .addComponent(btnSearch, javax.swing.GroupLayout.DEFAULT_SIZE, 218, Short.MAX_VALUE) .addContainerGap()) ); searchPanelLayout.setVerticalGroup( searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(searchPanelLayout.createSequentialGroup() .addContainerGap() .addGroup(searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(btnSearch, javax.swing.GroupLayout.DEFAULT_SIZE, 37, Short.MAX_VALUE) .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(searchValueTF, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(searchCombo)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); javax.swing.GroupLayout framePanelLayout = new javax.swing.GroupLayout(framePanel); framePanel.setLayout(framePanelLayout); framePanelLayout.setHorizontalGroup( framePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(framePanelLayout.createSequentialGroup() .addContainerGap() .addGroup(framePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(searchPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(detailPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(inputPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) ); framePanelLayout.setVerticalGroup( framePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(framePanelLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(inputPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(searchPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(detailPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(17, 17, 17)) ); jMenuBar1.setBorder(null); jMenuBar1.setName(""); // NOI18N jMenu1.setText("File"); save.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK)); save.setText("Save"); save.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveActionPerformed(evt); } }); jMenu1.add(save); custPanel.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B, java.awt.event.InputEvent.CTRL_MASK)); custPanel.setText("Customer Panel"); custPanel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { custPanelActionPerformed(evt); } }); jMenu1.add(custPanel); btnExit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK)); btnExit.setText("Exit"); btnExit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnExitActionPerformed(evt); } }); jMenu1.add(btnExit); jMenuBar1.add(jMenu1); about.setText(" About"); subAbout.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK)); subAbout.setText("About "); subAbout.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { subAboutActionPerformed(evt); } }); about.add(subAbout); help.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_H, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK)); help.setText("Help"); help.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { helpActionPerformed(evt); } }); about.add(help); jMenuBar1.add(about); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(framePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(framePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) ); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n initComponents();\n }", "public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "public FormListRemarking() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n \n }", "public FormPemilihan() {\n initComponents();\n }", "public GUIForm() { \n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public FormCompra() {\n initComponents();\n }", "public muveletek() {\n initComponents();\n }", "public Interfax_D() {\n initComponents();\n }", "public quanlixe_form() {\n initComponents();\n }", "public SettingsForm() {\n initComponents();\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Soru1() {\n initComponents();\n }", "public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }", "public soal2GUI() {\n initComponents();\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public MechanicForm() {\n initComponents();\n }", "public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }", "public BloodDonationGUI() {\n initComponents();\n }", "public quotaGUI() {\n initComponents();\n }", "public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }", "public PatientUI() {\n initComponents();\n }", "public Oddeven() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public Magasin() {\n initComponents();\n }", "public intrebarea() {\n initComponents();\n }", "public RadioUI()\n {\n initComponents();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public ZobrazUdalost() {\n initComponents();\n }", "public FormUtama() {\n initComponents();\n }", "public p0() {\n initComponents();\n }", "public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }", "public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }", "public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }", "public form2() {\n initComponents();\n }", "public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}", "public kunde() {\n initComponents();\n }", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }", "public MusteriEkle() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public DESHBORDPANAL() {\n initComponents();\n }", "public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }", "public frmVenda() {\n initComponents();\n }", "public Botonera() {\n initComponents();\n }", "public FrmMenu() {\n initComponents();\n }", "public OffertoryGUI() {\n initComponents();\n setTypes();\n }", "public JFFornecedores() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public vpemesanan1() {\n initComponents();\n }", "public Kost() {\n initComponents();\n }", "public FormHorarioSSE() {\n initComponents();\n }", "public frmacceso() {\n initComponents();\n }", "public HW3() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public sinavlar2() {\n initComponents();\n }", "public P0405() {\n initComponents();\n }", "public MiFrame2() {\n initComponents();\n }", "public IssueBookForm() {\n initComponents();\n }", "public Choose1() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n\n String oldAuthor = prefs.get(\"AUTHOR\", \"\");\n if(oldAuthor != null) {\n this.authorTextField.setText(oldAuthor);\n }\n String oldBook = prefs.get(\"BOOK\", \"\");\n if(oldBook != null) {\n this.bookTextField.setText(oldBook);\n }\n String oldDisc = prefs.get(\"DISC\", \"\");\n if(oldDisc != null) {\n try {\n int oldDiscNum = Integer.parseInt(oldDisc);\n oldDiscNum++;\n this.discNumberTextField.setText(Integer.toString(oldDiscNum));\n } catch (Exception ex) {\n this.discNumberTextField.setText(oldDisc);\n }\n this.bookTextField.setText(oldBook);\n }\n\n\n }", "public GUI_StudentInfo() {\n initComponents();\n }", "public Lihat_Dokter_Keseluruhan() {\n initComponents();\n }", "public JFrmPrincipal() {\n initComponents();\n }", "public bt526() {\n initComponents();\n }", "public Pemilihan_Dokter() {\n initComponents();\n }", "public Ablak() {\n initComponents();\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\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.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\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.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel23,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}", "public Pregunta23() {\n initComponents();\n }", "public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }", "public AvtekOkno() {\n initComponents();\n }", "public busdet() {\n initComponents();\n }", "public ViewPrescriptionForm() {\n initComponents();\n }", "public Ventaform() {\n initComponents();\n }", "public Kuis2() {\n initComponents();\n }", "public CreateAccount_GUI() {\n initComponents();\n }", "public POS1() {\n initComponents();\n }", "public Carrera() {\n initComponents();\n }", "public EqGUI() {\n initComponents();\n }", "public JFriau() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setTitle(\"BuNus - Budaya Nusantara\");\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }", "public nokno() {\n initComponents();\n }", "public dokter() {\n initComponents();\n }", "public ConverterGUI() {\n initComponents();\n }", "public hitungan() {\n initComponents();\n }", "public Modify() {\n initComponents();\n }", "public frmAddIncidencias() {\n initComponents();\n }", "public FP_Calculator_GUI() {\n initComponents();\n \n setVisible(true);\n }" ]
[ "0.73208135", "0.7291972", "0.7291972", "0.7291972", "0.7287118", "0.72494483", "0.7214677", "0.72086734", "0.7197058", "0.71912485", "0.7185818", "0.71596724", "0.71489036", "0.7094215", "0.7082007", "0.70579666", "0.6988024", "0.6978225", "0.6955616", "0.6955434", "0.69458616", "0.69446844", "0.6937443", "0.69325924", "0.69280547", "0.69266534", "0.69264925", "0.6912501", "0.6911917", "0.6894212", "0.6893167", "0.68922186", "0.6892184", "0.6890009", "0.688444", "0.6883334", "0.68823224", "0.6879555", "0.68768615", "0.6875667", "0.68722147", "0.6860655", "0.68569547", "0.6856804", "0.6856167", "0.6855431", "0.6854634", "0.68536645", "0.68536645", "0.684493", "0.6837617", "0.68372554", "0.68303156", "0.6828861", "0.6827668", "0.68246883", "0.68245596", "0.6818436", "0.6818284", "0.6812057", "0.681017", "0.68095857", "0.68093693", "0.6809163", "0.68027467", "0.67963576", "0.6794979", "0.6793972", "0.6792247", "0.67903155", "0.67896885", "0.67893314", "0.6783135", "0.6767654", "0.67672074", "0.67655265", "0.6757984", "0.6757062", "0.6754005", "0.67513984", "0.674334", "0.6740801", "0.6737678", "0.6737453", "0.6734575", "0.67281", "0.6727845", "0.67219335", "0.67169774", "0.67163646", "0.6715783", "0.67106164", "0.6708574", "0.6705358", "0.67030907", "0.6701408", "0.6700769", "0.66998196", "0.6695165", "0.66917574", "0.6691252" ]
0.0
-1
//GENEND:initComponents to add in JTable
private void addActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addActionPerformed add(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ARCTable() {\n initComponents();\n table = new MyJTable();\n tableScrollPane.setViewportView(table);\n }", "private void initComponent() {\n\t\t// Create Table Model (rows, columns...)\n\t\ttableur = new DefaultTableModel();\n\t\t// Add title column\n\t\ttableur.addColumn(fileNumber);\n\t\ttableur.addColumn(fileName);\n\t\ttableur.addColumn(\"\");\n\t\t// Add line of Action History with NodeStructureDTO\n\t\twhile(rootNode != null){\n\t\t\ttableur.addRow(new Object[] {rootNode.getId() , rootNode.getCompletePath()});\n\t\t\trootNode = rootNode.getNextNode();\n\t\t}\n\t\t//Create JTable \n\t\ttableHistory = new JTable(tableur);\n\t\t//Change the renderer of third cells whith grey font \n\t\ttableHistory.getColumn(\"\").setCellRenderer(new ButtonRenderer());\n\t\t//Make a CheckBox in this cell\n\t\ttableHistory.getColumn(\"\").setCellEditor(new ButtonEditor(new JCheckBox()));\n\t\t//Block reordering\n\t\ttableHistory.getTableHeader().setReorderingAllowed(false);\n\t\ttableHistory.setPreferredScrollableViewportSize(new Dimension(600 , 400));\n\t\tadd(new JScrollPane(tableHistory) , BorderLayout.CENTER);\n\t}", "public void addTableGui() {\n\t\tDefaultTableModel mTableModel = new DefaultTableModel();\r\n\t\tmTable = new JTable(mTableModel);\r\n\r\n\t\tmTableModel.addColumn(\"MSSV\");\r\n\t\tmTableModel.addColumn(\"HoTen\");\r\n\t\tmTableModel.addColumn(\"GioiTinh\");\r\n\t\tmTableModel.addColumn(\"NTNS\");\r\n\t\tJScrollPane mJScrollPane = new JScrollPane(mTable);\r\n\t\tmJScrollPane.setPreferredSize(new Dimension(760, 310));\r\n\t\tc.fill = GridBagConstraints.HORIZONTAL;\r\n\t\tc.ipady = 40; //make this component tall\r\n\t\tc.weightx = 0.0;\r\n\t\tc.gridwidth = 3;\r\n\t\tc.gridx = 0;\r\n\t\tc.gridy = 1;\r\n\t\tpanel.add(mJScrollPane,c);\r\n\t}", "public DisplayTable() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n table = new org.jdesktop.swingx.JXTable();\n\n table.setModel(createModel());\n table.setEditable(false);\n configureTable(table);\n setViewportView(table);\n }", "public Practice_JTable() {\n initComponents();\n }", "private void addTable()\r\n {\r\n // Create the table\r\n table = new JTable();\r\n table.setAutoCreateRowSorter(true);\r\n table.setColumnSelectionAllowed(false);\r\n table.getTableHeader().setReorderingAllowed(false);\r\n table.setModel(new JarModel());\r\n \r\n // Center the column headings\r\n ((DefaultTableCellRenderer) table.getTableHeader().\r\n getDefaultRenderer()).setHorizontalAlignment(SwingConstants.CENTER);\r\n \r\n // Set the column widths\r\n table.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);\r\n table.getColumnModel().getColumn(0).setPreferredWidth(100);\r\n table.getColumnModel().getColumn(0).setMaxWidth(250);\r\n table.getColumnModel().getColumn(2).setPreferredWidth(140);\r\n table.getColumnModel().getColumn(2).setMaxWidth(250);\r\n table.getColumnModel().getColumn(3).setPreferredWidth(100);\r\n table.getColumnModel().getColumn(3).setMaxWidth(250);\r\n table.getColumnModel().getColumn(4).setPreferredWidth(100);\r\n table.getColumnModel().getColumn(4).setMaxWidth(250);\r\n \r\n // Sort on the first column\r\n table.getRowSorter().toggleSortOrder(0);\r\n \r\n table.getColumnModel().getColumn(0).setCellRenderer(new BooleanColorCellRenderer());\r\n table.getColumnModel().getColumn(2).setCellRenderer(new DateCellRenderer());\r\n \r\n // Add the table to the panel\r\n add(new JScrollPane(table), BorderLayout.CENTER);\r\n }", "public table() {\n initComponents();\n }", "private void initComponents() {//GEN-BEGIN:initComponents\n jScrollPane1 = new javax.swing.JScrollPane();\n vectorTable = new javax.swing.JTable();\n\n setLayout(new java.awt.BorderLayout());\n\n vectorTable.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Name\", \"Title 2\"\n }\n ));\n jScrollPane1.setViewportView(vectorTable);\n\n add(jScrollPane1, java.awt.BorderLayout.CENTER);\n\n }", "@Override\n\tpublic void init() {\n\t\ttable = new JTable(dm);\n\t\tJScrollPane scrollPane = new JScrollPane(table);\n\n\t\tadd(scrollPane);\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 tablaVentas = new javax.swing.JTable();\n\n setClosable(true);\n setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);\n\n tablaVentas.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(tablaVentas);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 378, Short.MAX_VALUE)\n );\n\n pack();\n }", "private void initComponents() {\n\t\tfixedSizeTable = new FixedSizeTable();\r\n\t\tdataModel = new NonEditableTableModel();\r\n\t\t\r\n\t\tfixedSizeTable.getTable().setModel(dataModel);\r\n\t\tfixedSizeTable.getTable().setEnabled(false);\r\n\t\r\n\t\t// initialize selection listener\r\n\t\ttableMouseListener = new TableMouseListener();\r\n\t\t\r\n\t\t// add it to the panel so that it is centered left right and top down\r\n\t\tsetOpaque(false);\r\n\t\tsetLayout(new GridBagLayout());\r\n\t\tadd(fixedSizeTable, new GridBagConstraints());\r\n\t}", "public Window_Table() {\n initComponents();\n \n \n \n }", "private void initTable() {\n\t\tDefaultTableModel dtm = (DefaultTableModel)table.getModel();\n\t\tdtm.setRowCount(0);\t\t\n\t\tfor(int i=0;i<MainUi.controller.sale.items.size();i++){\n\t\t\tVector v1 = new Vector();\n\t\t\tv1.add(MainUi.controller.sale.items.get(i).getProdSpec().getTitle());\n\t\t\tv1.add(MainUi.controller.sale.items.get(i).getCopies());\n\t\t\tdtm.addRow(v1);\n\t\t}\n\t\tlblNewLabel.setText(\"\"+MainUi.controller.sale.getTotal());\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n tableScrollPane = new javax.swing.JScrollPane();\n\n setMinimumSize(new java.awt.Dimension(25, 500));\n setLayout(new java.awt.GridLayout(1, 1));\n add(tableScrollPane);\n }", "@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 tblResult = new javax.swing.JTable();\n\n tblResult.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(tblResult);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 407, Short.MAX_VALUE)\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 264, Short.MAX_VALUE)\n .addContainerGap())\n );\n }", "public JTable () {\r\n\t\t// Initialisation de la taille de la banque du milieu de table\r\n\t\tbanque = new JBanque(TAILLE*5, TAILLE);\r\n\t\t\r\n\t\t// Initialisation des collections de joueurs et de cartes\r\n\t\tcartes = new HashMap<Integer, JPanel>();\r\n\t\tjoueurs = new HashMap<Integer, JPanel>();\r\n\t\tfor (int i = 0; i < 10; i++) {\r\n\t\t\tjoueurs.put(i, new JVide(joueur_lg, joueur_ht));\r\n\t\t\tif (i < 5) {\r\n\t\t\t\tcartes.put(i, new JVide(carte_lg, carte_ht));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Récupération de l'image de la table pour le fond\r\n\t\ttable = Toolkit.getDefaultToolkit().getImage(\"Images/poker1.png\");\r\n\t\tresized = table.getScaledInstance(1000, 500, Image.SCALE_DEFAULT);\r\n\t\t\r\n\t\t// Affichage des cartes et des joueurs\r\n\t\tthis.formerTable();\r\n\t\t\r\n\t\tthis.setPreferredSize(new Dimension(1000, 500));\r\n\t\tthis.setVisible(true);\r\n\t}", "public void initTable() {\n this.table.setSelectable(true);\n this.table.setImmediate(true);\n this.table.setWidth(\"100%\");\n this.table.addListener(this);\n this.table.setDropHandler(this);\n this.table.addActionHandler(this);\n this.table.setDragMode(TableDragMode.ROW);\n this.table.setSizeFull();\n\n this.table.setColumnCollapsingAllowed(true);\n // table.setColumnReorderingAllowed(true);\n\n // BReiten definieren\n this.table.setColumnExpandRatio(LABEL_ICON, 1);\n this.table.setColumnExpandRatio(LABEL_DATEINAME, 3);\n this.table.setColumnExpandRatio(LABEL_DATUM, 2);\n this.table.setColumnExpandRatio(LABEL_GROESSE, 1);\n this.table.setColumnExpandRatio(LABEL_ACCESS_MODES, 1);\n this.table.setColumnHeader(LABEL_ICON, \"\");\n }", "private void buildIngredientTable(){\n\n //IL=IM.getIngredientItemArrayList();\n\n\n\n ingredientTable = new JTable();\n ingredientTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);\n\n ingredientTable.getTableHeader().setReorderingAllowed(false);\n\n DTM = IM.getIngDTM();\n ingredientTable.setModel(DTM);\n\n ingredientTable.setRowSelectionAllowed(true);\n\n ingredientTable.setPreferredScrollableViewportSize(new Dimension(500, 50));\n ingredientTable.setDragEnabled(false);\n ingredientTable.setDefaultEditor(Object.class, null);\n //TODO\n\n TableColumnModel columnModel = ingredientTable.getColumnModel();\n columnModel.getColumn(1).setWidth(500);\n\n scrollPane = new JScrollPane(ingredientTable,ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);\n scrollPane.setPreferredSize(new Dimension(450, 450));\n\n }", "void setup() {\n TableColumnModel cm = new DefaultTableColumnModel() {\r\n boolean first = true;\r\n public void addColumn(TableColumn tc) {\r\n if (first) {\r\n first = false;\r\n return;\r\n }\r\n tc.setMinWidth(ROW_WIDTH);\r\n super.addColumn(tc);\r\n }\r\n };\r\n\r\n // setup the columns for the row header table\r\n TableColumnModel rowHeaderModel = new DefaultTableColumnModel() {\r\n boolean first = true;\r\n public void addColumn(TableColumn tc) {\r\n if (first) {\r\n super.addColumn(tc);\r\n first = false;\r\n }\r\n }\r\n };\r\n\r\n tblModel = new ObjectiveModel();\r\n\r\n JComboBox combobox = new JComboBox();\r\n\r\n // setup the row header table\r\n headerColumn = new JTable(tblModel, rowHeaderModel);\r\n headerColumn.setRowHeight(ROW_HEIGHT);\r\n headerColumn.setRowSelectionAllowed(false);\r\n headerColumn.setColumnSelectionAllowed(false);\r\n headerColumn.setCellSelectionEnabled(false);\r\n headerColumn.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);\r\n headerColumn.getTableHeader().setReorderingAllowed(false);\r\n headerColumn.createDefaultColumnsFromModel();\r\n headerColumn.setDefaultRenderer(String.class,\r\n new RotatedLabelRenderer());\r\n headerColumn.setDefaultEditor(String.class,\r\n new DefaultCellEditor(combobox));\r\n\r\n // setup the graph matrix\r\n jTable = new JTable(tblModel, cm);\r\n jTable.createDefaultColumnsFromModel();\r\n //jTable.setDefaultRenderer(ImageIcon.class, new GraphRenderer());\r\n jTable.setDefaultRenderer(JPanel.class, new ComponentRenderer());\r\n jTable.setDefaultEditor(JPanel.class, new ComponentEditor());\r\n\r\n jTable.setRowHeight(ROW_HEIGHT);\r\n jTable.setRowSelectionAllowed(false);\r\n jTable.setColumnSelectionAllowed(false);\r\n jTable.setCellSelectionEnabled(false);\r\n\r\n //jTable.addMouseListener(this);\r\n jTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);\r\n\r\n TableColumnModel columnModel = jTable.getColumnModel();\r\n jTable.setTableHeader(new EditableHeader(columnModel));\r\n\r\n String[] items = {\r\n \"ff\", \"fg\"};\r\n JComboBox combo = new JComboBox(items);\r\n\r\n EditableHeaderTableColumn col;\r\n // column 0\r\n col = (EditableHeaderTableColumn) jTable.getColumnModel().getColumn(0);\r\n col.setHeaderValue(items[0]);\r\n col.setHeaderEditor(new DefaultCellEditor(combo));\r\n\r\n // column 1\r\n col = (EditableHeaderTableColumn) jTable.getColumnModel().getColumn(1);\r\n col.setHeaderValue(items[0]);\r\n col.setHeaderEditor(new DefaultCellEditor(combo));\r\n\r\n int numRows = jTable.getModel().getRowCount();\r\n int numColumns = jTable.getModel().getColumnCount();\r\n\r\n int longest = 0;\r\n // we know that the first column will only contain\r\n // JLabels...so create them and find the longest\r\n // preferred width\r\n\r\n TableColumn column;\r\n // set the default column widths\r\n for (int i = 0; i < numColumns; i++) {\r\n if (i == 0) {\r\n column = headerColumn.getColumnModel().getColumn(i);\r\n column.setPreferredWidth(20);\r\n }\r\n else {\r\n column = jTable.getColumnModel().getColumn(i - 1);\r\n column.setPreferredWidth(ROW_WIDTH);\r\n }\r\n }\r\n\r\n jTable.setPreferredScrollableViewportSize(new Dimension(\r\n ROW_WIDTH * 2, ROW_HEIGHT * 2));\r\n\r\n // put the row headers in the viewport\r\n JViewport jv = new JViewport();\r\n jv.setView(headerColumn);\r\n jv.setPreferredSize(headerColumn.getPreferredSize());\r\n\r\n // setup the scroll pane\r\n JScrollPane sp = new JScrollPane(jTable);\r\n sp.setRowHeader(jv);\r\n sp.setHorizontalScrollBarPolicy(\r\n JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);\r\n sp.setVerticalScrollBarPolicy(\r\n JScrollPane.VERTICAL_SCROLLBAR_NEVER);\r\n\r\n this.add(sp, BorderLayout.CENTER);\r\n }", "public void setUpTheTable() {\n articleTable = new JTable();\n\n // Get the data from the Data Set\n data = getTableData();\n\n // Create a model of the data.\n articleTableModel = new AbstractTableModel() {\n\n /**\n\t\t * \n\t\t */\n\t\tprivate static final long serialVersionUID = -8868431326664067555L;\n\n\t// These methods always need to be implemented.\n public int getColumnCount() {\n return columnNameList.length;\n }\n\n public int getRowCount() {\n return data.length;\n }\n\n public Object getValueAt(int theRow, int theCol) {\n return data[theRow][theCol];\n }\n\n // The default implementations of these methods in\n // AbstractTableModel would work, but we can refine them.\n public String getColumnName(int theCol) {\n return columnNameList[theCol];\n }\n\n public Class<? extends Object> getColumnClass(int theCol) {\n return getValueAt(0, theCol).getClass();\n }\n\n public boolean isCellEditable(int theRow, int theCol) {\n boolean canEdit = false;\n\n switch (theCol) {\n case COL_SUBJECTID :\n case COL_SCOREID :\n canEdit = false;\n break;\n case COL_RATINGID :\n canEdit = true;\n break;\n default :\n canEdit = false;\n break;\n } // endswitch\n return canEdit;\n }\n\n public void setValueAt(Object theValue, int theRow, int theCol) {\n String lclString = ((String) theValue).trim();\n\n switch (theCol) {\n case COL_SUBJECTID :\n break;\n case COL_SCOREID :\n break;\n case COL_RATINGID :\n data[theRow][theCol] = lclString;\n if (currentArt != null) {\n currentArt.setUserRating(lclString);\n }\n break;\n } // end switch\n }\n };\n articleTable = new JTable(articleTableModel);\n articleTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n\n // add code to detect table selection events\n // may be able to remove this **FIX** jpb\n ListSelectionModel rowSM = articleTable.getSelectionModel();\n\n rowSM.addListSelectionListener(new ListSelectionListener() {\n public void valueChanged(ListSelectionEvent e) {\n\n // ignore extra messages\n if (e.getValueIsAdjusting()) {\n return;\n }\n ListSelectionModel lsm = (ListSelectionModel) e.getSource();\n\n if (lsm.isSelectionEmpty()) {\n\n // no rows selected\n } else {\n int selectedRow = lsm.getMinSelectionIndex();\n\n if (selectedRow == -1) {\n return; //nothing selected\n }\n if (articles.size() > 0) {\n currentArt = (NewsArticle) articles.elementAt(selectedRow);\n articleTextArea.setText(currentArt.body); // clear the display area\n articleTextArea.setCaretPosition(0); // move cursor to start of article\n // updateTable();\n } else {\n currentArt = null;\n }\n }\n }\n });\n (articleTable.getColumn(COL_SUBJECT)).setPreferredWidth(200);\n (articleTable.getColumn(COL_SCORE)).setPreferredWidth(30);\n (articleTable.getColumn(COL_RATING)).setPreferredWidth(30);\n JComboBox<String> lclClassComboBox = new JComboBox<String>();\n\n lclClassComboBox.addItem(FilterAgent.USELESS_RATING);\n lclClassComboBox.addItem(FilterAgent.NOTVERY_RATING);\n lclClassComboBox.addItem(FilterAgent.NEUTRAL_RATING);\n lclClassComboBox.addItem(FilterAgent.MILDLY_RATING);\n lclClassComboBox.addItem(FilterAgent.INTERESTING_RATING);\n (articleTable.getColumnModel().getColumn(COL_RATINGID)).setCellEditor(new DefaultCellEditor(lclClassComboBox));\n articleTable.setCellSelectionEnabled(true);\n }", "private void buildTablePanel() {\n \t\tJPanel panel = new JPanel();\n \t\t\n \t\t// settings:\n \t\theader.setReorderingAllowed(false); // no moving.\n \t\ttable.setColumnSelectionAllowed(true);\n \t\ttable.setRowSelectionAllowed(true);\n \t\ttable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n \t\t\n \t\theader.addMouseListener(tableModel.new SortColumnAdapter());\n \t\t\t\n \t\tTableCellRenderer renderer = new TableCellRenderer() {\n \n \t\t\tJLabel label = new JLabel();\n \t\t\t\n \t\t\t@Override\n \t public JComponent getTableCellRendererComponent(JTable table,\n \t Object value, boolean isSelected, boolean hasFocus,\n \t int row, int column) {\n \t \n \t\t\t\tif (table.isRowSelected(row)) {\n \t\t\t\t\tlabel.setBackground(Color.RED);\n \t\t\t\t} else {\n \t\t\t\t\tlabel.setBackground(UIManager.getColor(\"Table.background\"));\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tlabel.setOpaque(true);\n \t\t\t\tlabel.setText(\"\" + value);\n \t\t\t\t\n \t return label;\n \t }\n \n \t };\n \t table.setDefaultRenderer(Object.class, renderer);\n \t \n \t JScrollPane scroll = new JScrollPane(table);\n \t\t\n \t\tpanel.setLayout(new BorderLayout(5, 5));\n \t\tpanel.add(scroll, BorderLayout.CENTER);\n \t \n \t add(panel, BorderLayout.CENTER);\n \t}", "private void initialize() {\r\n\t\t\r\n\t\tString[] columnNames = {\"First Name\",\r\n \"Last Name\",\r\n \"Sport\",\r\n \"# of Years\",\r\n \"Vegetarian\"};\r\n\t\t\r\n\t\tObject[][] data = {\r\n\t\t\t {\"Kathy\", \"Smith\",\r\n\t\t\t \"Snowboarding\", new Integer(5), new Boolean(false)},\r\n\t\t\t {\"John\", \"Doe\",\r\n\t\t\t \"Rowing\", new Integer(3), new Boolean(true)},\r\n\t\t\t {\"Sue\", \"Black\",\r\n\t\t\t \"Knitting\", new Integer(2), new Boolean(false)},\r\n\t\t\t {\"Jane\", \"White\",\r\n\t\t\t \"Speed reading\", new Integer(20), new Boolean(true)},\r\n\t\t\t {\"Joe\", \"Brown\",\r\n\t\t\t \"Pool\", new Integer(10), new Boolean(false)}\r\n\t\t\t};\t\t\r\n\r\n\t\t//JTable \r\n\t\t\r\n\t\t\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(100, 100, 544, 432);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(new BorderLayout(0, 0));\r\n\t\t\r\n\t\tJTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);\r\n\t\tframe.getContentPane().add(tabbedPane);\r\n\t\t\r\n\t\tJPanel panel = new JPanel();\r\n\t\ttabbedPane.addTab(\"New tab\", null, panel, null);\r\n\t\t\r\n\t\ttable = new JTable(data, columnNames);\r\n\t\t\r\n\t\ttable_1 = new JTable(data, columnNames);\r\n\t\t\r\n\t\ttable_2 = new JTable(data, columnNames);\r\n\t\tGroupLayout gl_panel = new GroupLayout(panel);\r\n\t\tgl_panel.setHorizontalGroup(\r\n\t\t\tgl_panel.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t.addComponent(table_2, GroupLayout.PREFERRED_SIZE, 523, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t.addGroup(gl_panel.createSequentialGroup()\r\n\t\t\t\t\t.addGap(148)\r\n\t\t\t\t\t.addComponent(table_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\r\n\t\t\t\t.addComponent(table, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t);\r\n\t\tgl_panel.setVerticalGroup(\r\n\t\t\tgl_panel.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t.addGroup(gl_panel.createSequentialGroup()\r\n\t\t\t\t\t.addComponent(table_2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t.addGroup(gl_panel.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t\t\t.addComponent(table_1, GroupLayout.DEFAULT_SIZE, 285, Short.MAX_VALUE)\r\n\t\t\t\t\t\t.addComponent(table, GroupLayout.PREFERRED_SIZE, 285, GroupLayout.PREFERRED_SIZE)))\r\n\t\t);\r\n\t\tpanel.setLayout(gl_panel);\r\n\t\t\r\n\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "private void setupTable() {\n\t\tString[] columns = { \"Course Name\", \"Course Number\" };\n\n\t\ttableModel = new DefaultTableModel(null, columns) {\n\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\t@Override\n\t\t\tpublic boolean isCellEditable(int row, int column) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\n\t\ttable = new JTable(tableModel);\n\t\ttable.setColumnSelectionAllowed(false);\n\t\ttable.setRowSelectionAllowed(true);\n\t\ttable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n\n\t\ttable.getSelectionModel().addListSelectionListener((ListSelectionEvent event) -> {\n\t\t\tif (table.getSelectedRow() >= 0) {\n\t\t\t\tString name = table.getValueAt(table.getSelectedRow(), 0).toString();\n\t\t\t\tint num = Integer.parseInt(table.getValueAt(table.getSelectedRow(), 1).toString());\n\t\t\t\tupdateTextArea((Course) adCon.search(name, num));\n\t\t\t}\n\t\t});\n\n\t\tJScrollPane scrollPane = new JScrollPane(table);\n\t\tscrollPane.setPreferredSize(new Dimension(350, 175));\n\t\tdisplay.add(scrollPane);\n\t}", "public void init2(){\n dateTextField.setText(String.valueOf(dateFormat.format(d)));\n Object [][] temp = new Object[realizarVenda.compra.size()][9];\n finalPurchaseTable.setModel(new javax.swing.table.DefaultTableModel(\n temp,\n new String [] {\n \"Pct#\", \"Nome\", \"Descrição\", \"Tamanho\", \"Valor\", \"Qntd\", \"Gênero\", \"Departamento\", \"Loja\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Object.class, java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.String.class\n };\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false, false, false, false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n finalPurchaseTable.setToolTipText(\"Pacote, Nome, Descrição, Tamanho, Valor, Quantidade, Gênero, Departamento, Loja\");\n finalPurchaseTable.getTableHeader().setReorderingAllowed(false);\n jScrollPane1.setViewportView(finalPurchaseTable);\n if (finalPurchaseTable.getColumnModel().getColumnCount() > 0) {\n finalPurchaseTable.getColumnModel().getColumn(0).setPreferredWidth(35);\n finalPurchaseTable.getColumnModel().getColumn(0).setMaxWidth(35);\n finalPurchaseTable.getColumnModel().getColumn(3).setPreferredWidth(45);\n finalPurchaseTable.getColumnModel().getColumn(3).setMaxWidth(45);\n finalPurchaseTable.getColumnModel().getColumn(4).setPreferredWidth(75);\n finalPurchaseTable.getColumnModel().getColumn(4).setMaxWidth(95);\n finalPurchaseTable.getColumnModel().getColumn(5).setPreferredWidth(45);\n finalPurchaseTable.getColumnModel().getColumn(5).setMaxWidth(45);\n finalPurchaseTable.getColumnModel().getColumn(6).setPreferredWidth(50);\n finalPurchaseTable.getColumnModel().getColumn(6).setMaxWidth(50);\n finalPurchaseTable.getColumnModel().getColumn(7).setPreferredWidth(70);\n finalPurchaseTable.getColumnModel().getColumn(7).setMaxWidth(70);\n finalPurchaseTable.getColumnModel().getColumn(8).setPreferredWidth(60);\n finalPurchaseTable.getColumnModel().getColumn(8).setMaxWidth(60);\n }\n for(int row = 0, col = 1;row<realizarVenda.compra.size();row++){\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).remessa, row, 0);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).nome, row, col);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).desc, row, col+1);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).tamanho, row, col+2);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).valor.valor_final, row, col+ 3);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).quantidade, row, col+4);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).sexo, row, col+5);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).dept, row, col+6);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).loja, row, col+7);\n }\n percentLabel.setText(String.valueOf(taxa)+\"%\");\n }", "public SurgeriesListPanel_EN() {\n\n //<editor-fold defaultstate=\"collapsed\" desc=\"Initialize variables\">\n this.surgeriesTableModelEN = new MyUneditableTableModel(\n new String[]{\"Surgery\", \"Pathology\", \"Avrage duration (min)\", \"Standard deviation (min)\"},\n 0) //<editor-fold defaultstate=\"collapsed\" desc=\"set column classes\">\n {\n @Override\n public Class getColumnClass(int col) {\n String name = surgeriesTableModelEN.getColumnName(col);\n\n if (name.equals(\"Pathology\") || name.equals(\"Surgery\")) {\n return java.lang.String.class;\n } else {\n return java.lang.Integer.class;\n }\n }\n } //</editor-fold> \n ;\n //</editor-fold>\n\n initComponents();\n\n // <editor-fold defaultstate=\"collapsed\" desc=\"Load data from data base\">\n updateSurgeriesTable();\n\n TableRowSorter<MyUneditableTableModel> sorter = new TableRowSorter<>(surgeriesTableModelEN);\n surgeryTable.setRowSorter(sorter);\n sorter.setSortable(2, false);\n sorter.setSortable(3, false);\n //</editor-fold>\n\n DefaultTableCellRenderer centerRender = new DefaultTableCellRenderer() {\n @Override\n public Component getTableCellRendererComponent(JTable arg0, Object arg1, boolean arg2, boolean arg3, int arg4, int arg5) {\n Component tableCellRendererComponent = super.getTableCellRendererComponent(arg0, arg1, arg2, arg3, arg4, arg5);\n int align = DefaultTableCellRenderer.CENTER;\n ((DefaultTableCellRenderer) tableCellRendererComponent).setHorizontalAlignment(align);\n return tableCellRendererComponent;\n }\n };\n surgeryTable.getColumnModel().getColumn(0).setCellRenderer(centerRender);\n surgeryTable.getColumnModel().getColumn(1).setCellRenderer(centerRender);\n surgeryTable.getColumnModel().getColumn(2).setCellRenderer(centerRender);\n surgeryTable.getColumnModel().getColumn(3).setCellRenderer(centerRender);\n\n if (Planning_EN.currentUserType.equals(Utils.UserType.ASSISTANT)) {\n addButton.setEnabled(false);\n updateRemoveButton.setEnabled(false);\n }\n }", "public ResultsTable() {\n// this.achievementsArr = new ArrayList <Achievement>();\n initComponents();\n resultsTable = (DefaultTableModel) rTable.getModel();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n JpnTable = new javax.swing.JPanel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n javax.swing.GroupLayout JpnTableLayout = new javax.swing.GroupLayout(JpnTable);\n JpnTable.setLayout(JpnTableLayout);\n JpnTableLayout.setHorizontalGroup(\n JpnTableLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n JpnTableLayout.setVerticalGroup(\n JpnTableLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(JpnTable, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(JpnTable, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n\n pack();\n }", "public CustomJTable(final String[] columnnames, final int[] columnsizes, final Object[][] data) { \n super();\n dataModel = new AbstractTableModel() {\n // Met de volgende functies wordt het tablemodel gemaakt, niets wijzigen\n /**\n * Haalt het aantal kolommen op\n */\n @Override\n public int getColumnCount() { return columnnames.length; }\n /**\n * Haalt het aantal rijen op\n */\n @Override\n public int getRowCount() { return data.length; }\n /**\n * Haalt een bepaalde waarde op van een rij en een kolom (beide als intergers opgeven)\n * @param row Interger van de rij\n * @param column Interger van de kolom\n */\n @Override\n public Object getValueAt(int row, int column) { return data[row][column]; }\n /**\n * Haal de kolomnaam op\n * @param column Interger van de kolom\n */\n @Override\n public String getColumnName(int column) { return columnnames[column]; }\n /**\n * Zet een waarde op de plaats van een rij en een kolom (beide als intergers opgeven)\n * @param value Waarde die geplaatst moet worden\n * @param row Interger van de rij van de plaats\n * @param colum Interger van de kolom van de plaats\n */\n @Override\n public void setValueAt(Object value, int row, int column) { data[row][column] = value; }\n };\n this.setSize(800, 600);\n this.setModal(true);\n this.setLayout(new BorderLayout());\n \n // Vult de tabel aan\n jTable = new javax.swing.JTable(dataModel);\n jTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);\n // Implementeer de grote van de kolommen\n for (int i = 0; i <= (dataModel.getColumnCount() - 1); i++) {\n jTable.getColumnModel().getColumn(i).setPreferredWidth(columnsizes[i]);\n }\n \n // Voegt de tabel toe aan het panel in een scrollpane\n this.add(new JScrollPane(jTable));\n \n ListSelectionModel listMod;\n // Dit is de list selectioner, die kijkt of je iets selecteert\n listMod = jTable.getSelectionModel();\n // Hierdoor kan je maar 1 regel selecteren\n listMod.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n // Voegt de listener toe aan het frame\n listMod.addListSelectionListener(this);\n\n Center.add(new JScrollPane(jTable));\n South.add(selecteer);\n selecteer.addActionListener(this);\n \n this.add(North, BorderLayout.NORTH);\n this.add(Center, BorderLayout.CENTER);\n this.add(South, BorderLayout.SOUTH);\n this.setVisible(true);\n }", "@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 tabla = new javax.swing.JTable();\n jButton1 = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n tabla.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {},\n {},\n {},\n {}\n },\n new String [] {\n\n }\n ));\n jScrollPane1.setViewportView(tabla);\n\n getContentPane().add(jScrollPane1);\n jScrollPane1.setBounds(20, 20, 950, 540);\n\n jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/vista/img/bCancelar.png\"))); // NOI18N\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);\n jButton1.setBounds(20, 580, 200, 50);\n\n jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/vista/img/SmallClean.png\"))); // NOI18N\n getContentPane().add(jLabel1);\n jLabel1.setBounds(0, 0, 1000, 650);\n\n pack();\n }", "public TableForm() {\n initComponents();\n \n setMyTable();\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 jLabel4 = new javax.swing.JLabel();\n jLabel1 = new javax.swing.JLabel();\n jButton3 = new javax.swing.JButton();\n jButton4 = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n\n jScrollPane1.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n jScrollPane1KeyPressed(evt);\n }\n });\n\n jTable1.setFont(new java.awt.Font(\"Dialog\", 1, 10)); // NOI18N\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"#\", \"Product Code\", \"Product Name\", \"Quantity Open\", \"Price\", \"Total\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.Boolean.class, java.lang.String.class, java.lang.String.class, java.lang.Double.class, java.lang.Double.class, java.lang.Double.class\n };\n boolean[] canEdit = new boolean [] {\n true, false, false, false, false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n jTable1.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);\n jTable1.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jTable1MouseClicked(evt);\n }\n });\n jTable1.addPropertyChangeListener(new java.beans.PropertyChangeListener() {\n public void propertyChange(java.beans.PropertyChangeEvent evt) {\n jTable1PropertyChange(evt);\n }\n });\n jTable1.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n jTable1KeyPressed(evt);\n }\n });\n jScrollPane1.setViewportView(jTable1);\n jTable1.getColumnModel().getColumn(0).setMinWidth(50);\n jTable1.getColumnModel().getColumn(0).setPreferredWidth(50);\n jTable1.getColumnModel().getColumn(0).setMaxWidth(50);\n jTable1.getColumnModel().getColumn(1).setMinWidth(150);\n jTable1.getColumnModel().getColumn(1).setPreferredWidth(150);\n jTable1.getColumnModel().getColumn(1).setMaxWidth(150);\n jTable1.getColumnModel().getColumn(2).setMinWidth(200);\n jTable1.getColumnModel().getColumn(2).setPreferredWidth(200);\n jTable1.getColumnModel().getColumn(2).setMaxWidth(200);\n jTable1.getColumnModel().getColumn(3).setMinWidth(130);\n jTable1.getColumnModel().getColumn(3).setPreferredWidth(130);\n jTable1.getColumnModel().getColumn(3).setMaxWidth(130);\n jTable1.getColumnModel().getColumn(4).setMinWidth(130);\n jTable1.getColumnModel().getColumn(4).setPreferredWidth(130);\n jTable1.getColumnModel().getColumn(4).setMaxWidth(130);\n jTable1.getColumnModel().getColumn(5).setMinWidth(130);\n jTable1.getColumnModel().getColumn(5).setPreferredWidth(130);\n jTable1.getColumnModel().getColumn(5).setMaxWidth(130);\n\n jButton1.setFont(new java.awt.Font(\"Dialog\", 1, 10));\n jButton1.setText(\"Select\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jButton2.setFont(new java.awt.Font(\"Dialog\", 1, 10));\n jButton2.setText(\"Cancel\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n jLabel4.setFont(new java.awt.Font(\"Dialog\", 1, 10));\n jLabel4.setText(\"Number of Records Found : \");\n\n jLabel1.setFont(new java.awt.Font(\"Dialog\", 1, 10));\n jLabel1.setText(\"Browse Document Details\");\n\n jButton3.setFont(new java.awt.Font(\"Dialog\", 1, 10));\n jButton3.setText(\"Select All\");\n jButton3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton3ActionPerformed(evt);\n }\n });\n\n jButton4.setFont(new java.awt.Font(\"Dialog\", 1, 10));\n jButton4.setText(\"Un Select All\");\n jButton4.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton4ActionPerformed(evt);\n }\n });\n\n org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(layout.createSequentialGroup()\n .addContainerGap()\n .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(layout.createSequentialGroup()\n .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(org.jdesktop.layout.GroupLayout.TRAILING, jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 808, Short.MAX_VALUE)\n .add(jLabel1))\n .addContainerGap())\n .add(layout.createSequentialGroup()\n .add(jButton1)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(jButton2)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(jButton3)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(jButton4)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 234, Short.MAX_VALUE)\n .add(jLabel4)\n .add(169, 169, 169))))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .add(jLabel1)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 362, Short.MAX_VALUE)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)\n .add(jButton1)\n .add(jButton2)\n .add(jLabel4)\n .add(jButton3)\n .add(jButton4))\n .addContainerGap())\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n btnAgregarAlumno = new javax.swing.JButton();\n btnModificarAlumno = new javax.swing.JButton();\n btnEliminarAlumno = new javax.swing.JButton();\n jScrollPane1 = new javax.swing.JScrollPane();\n tblAlumnos = new javax.swing.JTable();\n lblDescripcion = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n btnAgregarAlumno.setText(\"Agregar\");\n btnAgregarAlumno.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnAgregarAlumnoActionPerformed(evt);\n }\n });\n\n btnModificarAlumno.setText(\"Modificar\");\n\n btnEliminarAlumno.setText(\"Eliminar\");\n\n tblAlumnos.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(tblAlumnos);\n\n lblDescripcion.setText(\"Ventana para agregar a los alumnos\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(84, 84, 84)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jScrollPane1)\n .addGroup(layout.createSequentialGroup()\n .addComponent(btnAgregarAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(100, 100, 100)\n .addComponent(btnModificarAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(91, 91, 91)\n .addComponent(btnEliminarAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGroup(layout.createSequentialGroup()\n .addGap(223, 223, 223)\n .addComponent(lblDescripcion)))\n .addContainerGap(99, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(32, 32, 32)\n .addComponent(lblDescripcion)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btnAgregarAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnModificarAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnEliminarAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(44, 44, 44)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 323, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(27, 27, 27))\n );\n\n pack();\n }", "public formArticulo() {\r\n initComponents();\r\n this.tableModel = (javax.swing.table.DefaultTableModel)tblArt.getModel();\r\n }", "private void initTable(DefaultTableModel dmodel) {\n\t\tString[] COLUMN_NAMES = new String[] { \"#\", \"Date\", \"Product ID\", \"Name\", \"Quantity\", \"Total\" };\n\t\tfor (String string : COLUMN_NAMES)\n\t\t\tdmodel.addColumn(string);\n\t}", "private void initialize()\n {\n orderList = new ArrayList<OrderData>( );\n setBounds(100, 100, 530, 370);\n setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n setResizable(false);\n\n JLabel lblNewLabel = new JLabel(\"Order\");\n lblNewLabel.setFont(new Font(\"Lucida Grande\", Font.PLAIN, 15));\n lblNewLabel.setBounds(22, 18, 61, 16);\n getContentPane().add(lblNewLabel);\n\n JScrollPane scrollPane = new JScrollPane();\n scrollPane.setBounds(22, 47, 497, 189);\n getContentPane().add(scrollPane);\n\n table = new JTable();\n scrollPane.setViewportView(table);\n table.setModel(new DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Order ID\", \"Customer Username\", \"Total Price\", \"Status\", \"Payment Type\", \"Delivery Type\"\n })\n {\n Class[] types = new Class [] {\n String.class, String.class, Float.class, String.class, String.class, String.class\n };\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n\n table.addMouseListener(new MouseAdapter() {\n public void mouseClicked(MouseEvent evt) {\n//\t\t\t\tproductsTableMouseClicked(evt);\n }\n });\n orderTableModel = (DefaultTableModel) table.getModel();\n table.setFillsViewportHeight(true);\n\n scrollPane.setViewportView(table);\n if (table.getColumnModel().getColumnCount() > 0) {\n table.getColumnModel().getColumn(0).setResizable(false);\n table.getColumnModel().getColumn(1).setResizable(false);\n table.getColumnModel().getColumn(2).setResizable(false);\n table.getColumnModel().getColumn(3).setResizable(false);\n table.getColumnModel().getColumn(4).setResizable(false);\n table.getColumnModel().getColumn(5).setResizable(false);\n }\n table.setSelectionModel( new ForcedListSelectionModel());\n\n\n pendingRadioButton = new JRadioButton(\"Pending\");\n pendingRadioButton.setBounds(22, 248, 141, 23);\n getContentPane().add(pendingRadioButton);\n pendingRadioButton.setSelected( true );\n\n shippingRadioButton = new JRadioButton(\"Shipping\");\n shippingRadioButton.setBounds(22, 280, 141, 23);\n getContentPane().add(shippingRadioButton);\n\n ButtonGroup group = new ButtonGroup();\n group.add( pendingRadioButton );\n group.add( shippingRadioButton );\n\n viewButton = new JButton(\"View\");\n viewButton.setBounds(308, 265, 90, 29);\n getContentPane().add(viewButton);\n\n statusButton = new JButton(\"Set Status\");\n statusButton.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n }\n });\n statusButton.setBounds(308, 312, 90, 29);\n getContentPane().add(statusButton);\n\n backButton = new JButton(\"Back\");\n backButton.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n }\n });\n backButton.setBounds(429, 312, 90, 29);\n getContentPane().add(backButton);\n }", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\"\n\t// desc=\"Generated Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tfixedColumnTableModel = new com.mwq.stat.mwing.FixedColumnTableModel();\n\t\tfloatColumnTableModel = new com.mwq.stat.mwing.FloatColumnTableModel();\n\t\ttableToolBar = new javax.swing.JToolBar();\n\t\texcelButton = new javax.swing.JButton();\n\t\texcelButton.setText(\"生成Excel\");\n\t\texcelButton.setPressedIcon(SwingResourceManager.getIcon(StatTablePanel.class, \"img/excel_selected.png\"));\n\t\texcelButton.setRolloverIcon(SwingResourceManager.getIcon(StatTablePanel.class, \"img/excel_on.png\"));\n\t\texcelButton.setToolTipText(\"利用表格生成Excel文件\");\n\t\texcelButton.setIcon(SwingResourceManager.getIcon(StatTablePanel.class, \"img/excel.png\"));\n\t\tpdfButton = new javax.swing.JButton();\n\t\tpdfButton.setText(\" 生成PDF \");\n\t\tpdfButton.setToolTipText(\"利用表格和统计图生成PDF文件\");\n\t\tpdfButton.setRolloverIcon(SwingResourceManager.getIcon(StatTablePanel.class, \"img/pdf_on.png\"));\n\t\tpdfButton.setPressedIcon(SwingResourceManager.getIcon(StatTablePanel.class, \"img/pdf_selected.png\"));\n\t\tpdfButton.setIcon(SwingResourceManager.getIcon(StatTablePanel.class, \"img/pdf.png\"));\n\t\theadingButton = new javax.swing.JButton();\n\t\theadingButton.setText(\"修改表题\");\n\t\theadingButton.setToolTipText(\"修改表格标题\");\n\t\theadingButton.setRolloverIcon(SwingResourceManager.getIcon(StatTablePanel.class, \"img/title_on.png\"));\n\t\theadingButton.setPressedIcon(SwingResourceManager.getIcon(StatTablePanel.class, \"img/title_selected.png\"));\n\t\theadingButton.setIcon(SwingResourceManager.getIcon(StatTablePanel.class, \"img/title.png\"));\n\t\tcolumnComboBox = new javax.swing.JComboBox();\n\t\ttablePanel = new javax.swing.JPanel();\n\t\theadingPanel = new javax.swing.JPanel();\n\t\theadingLabel = new javax.swing.JLabel();\n\t\tsubheadingLabel = new javax.swing.JLabel();\n\t\tdateLabel = new javax.swing.JLabel();\n\t\ttableScrollPane = new javax.swing.JScrollPane();\n\t\tfloatColumnTable = new com.mwq.stat.mwing.MTable();\n\n\t\tsetLayout(new java.awt.BorderLayout());\n\n\t\ttableToolBar.setFloatable(false);\n\t\ttableToolBar.setRollover(true);\n\n\t\texcelButton.setFocusable(false);\n\t\texcelButton\n\t\t\t\t.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n\t\texcelButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n\t\texcelButton.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\texcelButtonActionPerformed(evt);\n\t\t\t}\n\t\t});\n\t\ttableToolBar.add(excelButton);\n\n\t\tpdfButton.setFocusable(false);\n\t\tpdfButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n\t\tpdfButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n\t\tpdfButton.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tpdfButtonActionPerformed(evt);\n\t\t\t}\n\t\t});\n\t\ttableToolBar.add(pdfButton);\n\t\t\n\t\ttableToolBar.add( new javax.swing.JToolBar.Separator());\n\n\t\theadingButton.setFocusable(false);\n\t\theadingButton\n\t\t\t\t.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n\t\theadingButton\n\t\t\t\t.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n\t\theadingButton.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\theadingButtonActionPerformed(evt);\n\t\t\t}\n\t\t});\n\t\ttableToolBar.add(headingButton);\n\t\t\n\t\ttableToolBar.add( new javax.swing.JToolBar.Separator());\n\n\t\tString[] columnComboBoxItems = new String[fixedColumnTableModel\n\t\t\t\t.getColumnCount()\n\t\t\t\t+ floatColumnTableModel.getColumnCount() + 1];\n\t\tfor (int column = 0; column < columnComboBoxItems.length; column++) {\n\t\t\tcolumnComboBoxItems[column] = column + \"\";\n\t\t}\n\t\tcolumnComboBoxItems[1] = \"<固定列数量>\";\n\t\tcolumnComboBox.setModel(new javax.swing.DefaultComboBoxModel(\n\t\t\t\tcolumnComboBoxItems));\n\t\tcolumnComboBox.setSelectedItem(\"<固定列数量>\");\n\t\tcolumnComboBox.setMaximumSize(new java.awt.Dimension(100, 30));\n\t\tcolumnComboBox.addItemListener(new java.awt.event.ItemListener() {\n\t\t\tpublic void itemStateChanged(java.awt.event.ItemEvent evt) {\n\t\t\t\tcolumnComboBoxItemStateChanged(evt);\n\t\t\t}\n\t\t});\n\t\ttableToolBar.add(columnComboBox);\n\n\t\tadd(tableToolBar, java.awt.BorderLayout.PAGE_START);\n\n\t\ttablePanel.setLayout(new java.awt.BorderLayout());\n\n\t\theadingPanel.setLayout(new java.awt.BorderLayout());\n\n\t\theadingLabel.setFont(new java.awt.Font(\"宋体\", 1, 18));\n\t\theadingLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n\t\theadingLabel.setText(\"<主标题>\");\n\t\theadingLabel.setBorder(javax.swing.BorderFactory.createEmptyBorder(6,\n\t\t\t\t1, 1, 1));\n\t\theadingPanel.add(headingLabel, java.awt.BorderLayout.PAGE_START);\n\n\t\tsubheadingLabel.setFont(new java.awt.Font(\"宋体\", 0, 14));\n\t\tsubheadingLabel\n\t\t\t\t.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n\t\tsubheadingLabel.setText(\"<副标题>\");\n\t\tsubheadingLabel.setBorder(javax.swing.BorderFactory.createEmptyBorder(\n\t\t\t\t3, 1, 3, 1));\n\t\theadingPanel.add(subheadingLabel, java.awt.BorderLayout.CENTER);\n\n\t\tdateLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n\t\tdateLabel.setText(\"—— 2008年8月8日 \");\n\t\tdateLabel.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1,\n\t\t\t\t1, 1));\n\t\theadingPanel.add(dateLabel, java.awt.BorderLayout.PAGE_END);\n\n\t\ttablePanel.add(headingPanel, java.awt.BorderLayout.PAGE_START);\n\n\t\tfloatColumnTable.setModel(floatColumnTableModel);\n\t\ttableScrollPane.setViewportView(floatColumnTable);\n\n\t\ttablePanel.add(tableScrollPane, java.awt.BorderLayout.CENTER);\n\t\tfixedColumnTable = new MTable();\n\n\t\tfixedColumnTable.setModel(fixedColumnTableModel);\n\n\t\ttableScrollPane.setCorner(JScrollPane.UPPER_LEFT_CORNER,\n\t\t\t\tfixedColumnTable.getTableHeader()); // 将固定列表格头放到滚动面版的左上方\n\n\t\tfixedColumnTableViewport = new JViewport();// 创建一个用来显示基础信息的视口对象\n\n\t\tfixedColumnTableViewport.setView(fixedColumnTable);// 将固定列表格添加到视口中\n\n\t\tfixedColumnTableViewport.setPreferredSize(fixedColumnTable\n\t\t\t\t.getPreferredSize());// 设置视口的首选大小为固定列表格的首选大小\n\n\t\ttableScrollPane.setRowHeaderView(fixedColumnTableViewport);// 将视口添加到滚动面版的标题视口中\n\n\t\tadd(tablePanel, java.awt.BorderLayout.CENTER);\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane2 = new javax.swing.JScrollPane();\n fuelTable = new javax.swing.JTable();\n jLoadButton = new javax.swing.JButton();\n jAddButton = new javax.swing.JButton();\n jSaveCompanyButton = new javax.swing.JButton();\n jRemoveButton = new javax.swing.JButton();\n\n fuelTable.setModel(tableModel);\n fuelTable.getTableHeader().setReorderingAllowed(false);\n jScrollPane2.setViewportView(fuelTable);\n\n jLoadButton.setText(\"Pakrauti\");\n jLoadButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jLoadButtonActionPerformed(evt);\n }\n });\n\n jAddButton.setText(\"Pridėti\");\n jAddButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jAddButtonActionPerformed(evt);\n }\n });\n\n jSaveCompanyButton.setText(\"Išsaugoti\");\n jSaveCompanyButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jSaveCompanyButtonActionPerformed(evt);\n }\n });\n\n jRemoveButton.setText(\"Trinti\");\n jRemoveButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jRemoveButtonActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 350, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jAddButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jRemoveButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jSaveCompanyButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLoadButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 318, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jAddButton)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jRemoveButton)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jSaveCompanyButton)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLoadButton)\n .addContainerGap())\n );\n }", "private void initTable(){\n TableCellEditor nonSelEditor = new TableCellEditor() {\n @Override\n public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {\n return null;\n }\n @Override\n public Object getCellEditorValue() {return null; }\n\n @Override\n public boolean isCellEditable(EventObject anEvent) {return false;}\n\n @Override\n public boolean shouldSelectCell(EventObject anEvent) {return false;}\n\n @Override\n public boolean stopCellEditing() {return false;}\n\n @Override\n public void cancelCellEditing() {/*NOP*/}\n\n @Override\n public void addCellEditorListener(CellEditorListener l) {/*NOP*/}\n\n @Override\n public void removeCellEditorListener(CellEditorListener l) {/*NOP*/}\n };\n\n tableModelArrays = new DefaultTableModel();\n\n String[] columns = {\"N\", \"Data type\", \"Length\", \"State\",\"Kit\"};\n for(String s : columns){\n tableModelArrays.addColumn(s);\n }\n\n /*\n * Add information about have generated structures to the table model\n */\n if(dataList != null){\n for(int i = 0; i<dataList.getLength(); i++){\n tableModelArrays.addRow(new String[]{\n Integer.toString(i + 1),\n dataList.getData(i).getType(),\n Integer.toString(dataList.getData(i).getLength(0)),\n dataList.getData(i).getState()\n });\n }\n }\n\n /*\n * Create table from table model\n */\n final JTable tableArrays = new JTable(tableModelArrays);\n\n /*\n * Runs popup menu for edition notices which contain in table.\n */\n tableArrays.addMouseListener(new PopupMenu(popupMenu){\n @Override\n public void maybeShowPopup(MouseEvent e) {\n if (e.isPopupTrigger()) {\n popupMenu.show(e.getComponent(),\n e.getX(), e.getY());\n if (e.getButton() == MouseEvent.BUTTON3) {\n Point point = e.getPoint();\n int column = tableArrays.columnAtPoint(point);\n int row = tableArrays.rowAtPoint(point);\n tableArrays.setColumnSelectionInterval(column, column);\n tableArrays.setRowSelectionInterval(row, row);\n selectedRow = tableArrays.getSelectedRow();\n }\n }\n }\n });\n\n tableArrays.setRowHeight(20);\n tableArrays.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n\n /*\n * Changes width all the columns in the table\n */\n tableArrays.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);\n tableArrays.getColumnModel().getColumn(0).setPreferredWidth(23);\n tableArrays.getColumnModel().getColumn(1).setPreferredWidth(67);\n tableArrays.getColumnModel().getColumn(2).setPreferredWidth(70);\n tableArrays.getColumnModel().getColumn(3).setPreferredWidth(65);\n tableArrays.getColumnModel().getColumn(4).setPreferredWidth(27);\n\n /*\n * Each notice sets as manually no editable\n */\n for (int i = 0; i<tableArrays.getColumnCount(); i++ ){\n tableArrays.getColumnModel().getColumn(i).setCellEditor(nonSelEditor);\n }\n\n /*\n * Add scroll controls to table\n */\n JScrollPane scrollTable = new JScrollPane(tableArrays);\n scrollTable.setSize(TABLE_WIDTH,getHeight()-FIELD_HEIGHT-150);\n scrollTable.setLocation(getWidth()-scrollTable.getWidth()-15, FIELD_HEIGHT+60);\n\n /*\n * Add table to frame\n */\n add(scrollTable);\n\n }", "private void criaJTable() {\n tabela = new JTable(modelo);\n modelo.addColumn(\"Codigo:\");\n modelo.addColumn(\"Data inicio:\");\n modelo.addColumn(\"Data Fim:\");\n modelo.addColumn(\"Valor produto:\");\n modelo.addColumn(\"Quantidade:\");\n\n preencherJTable();\n }", "private void initTable() {\n \t\t// init table\n \t\ttable.setCaption(TABLE_CAPTION);\n \t\ttable.setPageLength(10);\n \t\ttable.setSelectable(true);\n \t\ttable.setRowHeaderMode(Table.ROW_HEADER_MODE_INDEX);\n \t\ttable.setColumnCollapsingAllowed(true);\n \t\ttable.setColumnReorderingAllowed(true);\n \t\ttable.setSelectable(true);\n \t\t// this class handles table actions (see handleActions method below)\n \t\ttable.addActionHandler(this);\n \t\ttable.setDescription(ACTION_DESCRIPTION);\n \n \t\t// populate Toolkit table component with test SQL table rows\n \t\ttry {\n \t\t\tQueryContainer qc = new QueryContainer(\"SELECT * FROM employee\",\n \t\t\t\t\tsampleDatabase.getConnection());\n \t\t\ttable.setContainerDataSource(qc);\n \t\t} catch (SQLException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t\t// define which columns should be visible on Table component\n \t\ttable.setVisibleColumns(new Object[] { \"FIRSTNAME\", \"LASTNAME\",\n \t\t\t\t\"TITLE\", \"UNIT\" });\n \t\ttable.setItemCaptionPropertyId(\"ID\");\n \t}", "public JfAeroports() {\n initComponents();\n tableUpdate();\n }", "private void Table()\n{\n Object [] Kolom = {\"Nama\", \"No. Telp\", \"Kota Asal\"};\n Table = new DefaultTableModel(null, Kolom);\n Tabel.setModel(Table);\n}", "@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 organizationJTable = new javax.swing.JTable();\n backJButton = new javax.swing.JButton();\n enterpriseLabel1 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n\n setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n organizationJTable.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n organizationJTable.setForeground(new java.awt.Color(0, 51, 204));\n organizationJTable.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"ID\", \"Name\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.String.class, java.lang.String.class\n };\n boolean[] canEdit = new boolean [] {\n false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n jScrollPane1.setViewportView(organizationJTable);\n if (organizationJTable.getColumnModel().getColumnCount() > 0) {\n organizationJTable.getColumnModel().getColumn(0).setResizable(false);\n organizationJTable.getColumnModel().getColumn(1).setResizable(false);\n }\n\n add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 210, 480, 190));\n\n backJButton.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n backJButton.setText(\"<< Back\");\n backJButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n backJButtonActionPerformed(evt);\n }\n });\n add(backJButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 590, -1, -1));\n\n enterpriseLabel1.setFont(new java.awt.Font(\"Tahoma\", 1, 24)); // NOI18N\n enterpriseLabel1.setForeground(new java.awt.Color(51, 0, 153));\n enterpriseLabel1.setText(\"View Organizations\");\n add(enterpriseLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 150, 430, 30));\n\n jLabel5.setFont(new java.awt.Font(\"Copperplate Gothic Bold\", 0, 48)); // NOI18N\n jLabel5.setForeground(new java.awt.Color(102, 0, 102));\n jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel5.setText(\"Smart Health Care System\");\n add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 820, 100));\n }", "private void makeTable() {\n String [] cols = new String[] {\"Planets\", \"Weights (in lbs)\", \"Weights (in kgs)\"};\n model = new DefaultTableModel(result,cols) {\n @Override\n public boolean isCellEditable(int row, int column) {\n return false;\n }\n };\n table = new JTable(model);\n JScrollPane scrollPane = new JScrollPane(table);\n scrollPane.setPreferredSize(new Dimension(310,155));\n middlePanel.add(scrollPane);\n revalidate();\n repaint();\n }", "@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 resultTable = new javax.swing.JTable();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Open payments\");\n\n resultTable.setModel(tableModel);\n resultTable.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n resultTableMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(resultTable);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 527, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE)\n );\n\n pack();\n }", "private void createTable(){\n Object[][] data = new Object[0][8];\n int i = 0;\n for (Grupo grupo : etapa.getGrupos()) {\n Object[][] dataAux = new Object[data.length+1][8];\n System.arraycopy(data, 0, dataAux, 0, data.length);\n dataAux[i++] = new Object[]{grupo.getNum(),grupo.getAtletas().size(),\"Registar Valores\",\"Selecionar Vencedores\", \"Selecionar Atletas\"};\n data = dataAux.clone();\n }\n\n //COLUMN HEADERS\n String columnHeaders[]={\"Numero do Grupo\",\"Número de Atletas\",\"\",\"\",\"\"};\n\n tableEventos.setModel(new DefaultTableModel(\n data,columnHeaders\n ));\n //SET CUSTOM RENDERER TO TEAMS COLUMN\n tableEventos.getColumnModel().getColumn(2).setCellRenderer(new ButtonRenderer());\n tableEventos.getColumnModel().getColumn(3).setCellRenderer(new ButtonRenderer());\n tableEventos.getColumnModel().getColumn(4).setCellRenderer(new ButtonRenderer());\n\n //SET CUSTOM EDITOR TO TEAMS COLUMN\n tableEventos.getColumnModel().getColumn(2).setCellEditor(new ButtonEditor(new JTextField(), this.etapa));\n tableEventos.getColumnModel().getColumn(3).setCellEditor(new ButtonEditor(new JTextField(), this.etapa));\n tableEventos.getColumnModel().getColumn(4).setCellEditor(new ButtonEditor(new JTextField(), this.etapa));\n\n }", "@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 tblsubject = new javax.swing.JTable();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n lblenrollid = new javax.swing.JLabel();\n lblname = new javax.swing.JLabel();\n lblyearlevel = new javax.swing.JLabel();\n jButton1 = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setUndecorated(true);\n\n tblsubject.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Subject ID\", \"Title\", \"Teacher\", \"Yearlevel\"\n }\n ));\n jScrollPane1.setViewportView(tblsubject);\n\n jLabel1.setFont(new java.awt.Font(\"Arial\", 0, 20)); // NOI18N\n jLabel1.setText(\"Enroll ID\");\n\n jLabel2.setFont(new java.awt.Font(\"Arial\", 0, 20)); // NOI18N\n jLabel2.setText(\"Name\");\n\n jLabel3.setFont(new java.awt.Font(\"Arial\", 0, 20)); // NOI18N\n jLabel3.setText(\"Yearlevel\");\n\n lblenrollid.setFont(new java.awt.Font(\"Arial\", 0, 20)); // NOI18N\n\n lblname.setFont(new java.awt.Font(\"Arial\", 0, 20)); // NOI18N\n\n lblyearlevel.setFont(new java.awt.Font(\"Arial\", 0, 20)); // NOI18N\n\n jButton1.setText(\"Enroll Subject\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 526, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(jLabel2))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(lblenrollid, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(lblname, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGap(18, 18, 18)\n .addComponent(jLabel3)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(lblyearlevel, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 203, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(148, 148, 148))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGap(26, 26, 26)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(jLabel3)\n .addComponent(lblyearlevel, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(lblenrollid, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(lblname, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 269, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }", "public PantallaPaginas() {\r\n initComponents();\r\n framePaginas=new DefaultTableModel();\r\n framePaginas.addColumn(\"Num Pagina\");\r\n framePaginas.addColumn(\"Bit Residencia\");\r\n framePaginas.addColumn(\"Info Relevante\"); \r\n framePaginas.addRow(new Object []{null, null, null});\r\n tablaPaginas.setModel(framePaginas);\r\n Window[] w=PantallaProcesos.getWindows();\r\n w[1].setLocation(w[0].getWidth()+5, w[0].getY());\r\n\r\n TableColumn tcol;\r\n //va recrriendo las columnas\r\n for(int i=0;i<3;i++)\r\n {\r\n tcol= tablaPaginas.getColumnModel().getColumn(i);\r\n tcol.setCellRenderer(new CustomTableCellRenderer());\r\n }\r\n }", "private void initComponents() {\n\n btn_start = new javax.swing.JButton();\n jScrollPane2 = new javax.swing.JScrollPane();\n table_inventory = new javax.swing.JTable();\n btn_clear = new javax.swing.JButton();\n lbl_tagrate = new javax.swing.JLabel();\n jLabel1 = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n table_rate = new javax.swing.JTable();\n cb_debuglog = new javax.swing.JCheckBox();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);\n setTitle(\"Inventory\");\n setBackground(java.awt.SystemColor.info);\n setBounds(new java.awt.Rectangle(0, 0, 320, 240));\n setResizable(false);\n addWindowListener(new java.awt.event.WindowAdapter() {\n public void windowClosing(java.awt.event.WindowEvent evt) {\n formWindowClosing(evt);\n }\n public void windowOpened(java.awt.event.WindowEvent evt) {\n formWindowOpened(evt);\n }\n });\n\n btn_start.setBackground(new java.awt.Color(0, 192, 0));\n btn_start.setFont(new java.awt.Font(\"Arial\", 0, 18)); // NOI18N\n btn_start.setText(\"Start\");\n btn_start.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_startActionPerformed(evt);\n }\n });\n\n table_inventory.setAutoCreateRowSorter(true);\n table_inventory.setFont(new java.awt.Font(\"Arial\", 0, 18)); // NOI18N\n table_inventory.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Index\", \"PC\", \"EPC\", \"RSSI\", \"Count\", \"Source\", \"Port\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.Float.class, java.lang.Integer.class, java.lang.String.class, java.lang.Integer.class\n };\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false, false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n table_inventory.setRowHeight(25);\n table_inventory.getTableHeader().setReorderingAllowed(false);\n jScrollPane2.setViewportView(table_inventory);\n if (table_inventory.getColumnModel().getColumnCount() > 0) {\n table_inventory.getColumnModel().getColumn(0).setPreferredWidth(40);\n table_inventory.getColumnModel().getColumn(1).setPreferredWidth(40);\n table_inventory.getColumnModel().getColumn(2).setPreferredWidth(320);\n table_inventory.getColumnModel().getColumn(3).setPreferredWidth(40);\n table_inventory.getColumnModel().getColumn(4).setPreferredWidth(40);\n table_inventory.getColumnModel().getColumn(5).setPreferredWidth(130);\n table_inventory.getColumnModel().getColumn(6).setPreferredWidth(40);\n }\n\n btn_clear.setBackground(java.awt.Color.cyan);\n btn_clear.setFont(new java.awt.Font(\"Arial\", 0, 18)); // NOI18N\n btn_clear.setText(\"Clear\");\n btn_clear.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_clearActionPerformed(evt);\n }\n });\n\n lbl_tagrate.setFont(new java.awt.Font(\"Arial\", 0, 18)); // NOI18N\n lbl_tagrate.setText(\"0 tag/s\");\n lbl_tagrate.setInheritsPopupMenu(false);\n lbl_tagrate.setOpaque(true);\n\n jLabel1.setFont(new java.awt.Font(\"Arial\", 0, 18)); // NOI18N\n jLabel1.setText(\"Total Tag Rate:\");\n jLabel1.setInheritsPopupMenu(false);\n jLabel1.setOpaque(true);\n\n table_rate.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Source\", \"Device Name\", \"Rate (tag/s)\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.String.class, java.lang.String.class, java.lang.Integer.class\n };\n boolean[] canEdit = new boolean [] {\n false, false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n jScrollPane1.setViewportView(table_rate);\n if (table_rate.getColumnModel().getColumnCount() > 0) {\n table_rate.getColumnModel().getColumn(0).setResizable(false);\n table_rate.getColumnModel().getColumn(1).setResizable(false);\n table_rate.getColumnModel().getColumn(2).setResizable(false);\n }\n\n cb_debuglog.setText(\"Save debug log\");\n\n org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 755, Short.MAX_VALUE)\n .add(layout.createSequentialGroup()\n .addContainerGap()\n .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(layout.createSequentialGroup()\n .add(btn_start, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 80, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(btn_clear, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 80, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)\n .add(jLabel1)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(lbl_tagrate)\n .add(0, 0, Short.MAX_VALUE))\n .add(layout.createSequentialGroup()\n .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .add(cb_debuglog, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 114, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(layout.createSequentialGroup()\n .add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 366, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)\n .add(layout.createSequentialGroup()\n .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)\n .add(btn_start)\n .add(btn_clear)\n .add(jLabel1)\n .add(lbl_tagrate))\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 99, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))\n .add(cb_debuglog))\n .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }", "public jpQLHoKhau() {\n initComponents();\n tableModel = (DefaultTableModel) tblDG.getModel();\n tableModel2 = (DefaultTableModel) tblTP.getModel();\n fillTblDG();\n fillTblTP();\n }", "public addConstructor() {\n\n\n \n initComponents();\n\n DefaultTableModel dt = (DefaultTableModel) tble.getModel();\n dt.setRowCount(0);\n\n try{\n Statement state = DB.getCon().createStatement();\n ResultSet rset = state.executeQuery(\"SELECT * FROM contractor \");\n\n while(rset.next()){\n Vector v = new Vector();\n v.add(rset.getString(\"ContractorID\"));\n v.add(rset.getString(\"CompanyName\"));\n v.add(rset.getString(\"CompanyAddress\"));\n\n dt.addRow(v);\n }\n } catch(Exception e) {\n System.out.println(e);\n }\n\n\n }", "public tabla2() {\n initComponents();\n this.setLocationRelativeTo(this);\n }", "public JP1Table( TableModel model )\n {\n super( model );\n setSelectionMode( ListSelectionModel.SINGLE_SELECTION );\n // getSelectionModel().addListSelectionListener( this );\n setCellSelectionEnabled( true );\n setSurrendersFocusOnKeystroke( true );\n setAutoResizeMode( JTable.AUTO_RESIZE_LAST_COLUMN );\n tableHeader.setReorderingAllowed( false );\n DefaultCellEditor e = ( DefaultCellEditor )getDefaultEditor( String.class );\n new TextPopupMenu( ( JTextComponent )e.getComponent() );\n }", "void initialize() {\r\n\t\t\r\n\t\t\r\n\t\tframe_bl = new JFrame();\r\n\t\tframe_bl.setVisible(true);\r\n\t\tframe_bl.setBounds(100, 100, 1143, 760);\r\n\t\tframe_bl.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe_bl.getContentPane().setLayout(null);\r\n\t\tframe_bl.setLocationRelativeTo(null);\r\n\r\n\t\tTable.buildTable();\r\n\t\tTable.table.setModel(Table.Tablemodel);\r\n\t\t\r\n\t\t\r\n\t\tPanel panel_1 = new Panel();\r\n\t\tpanel_1.setBackground(new Color(255,224,210));\r\n\t\tpanel_1.setBounds(223, 0, 904, 721);\r\n\t\tframe_bl.getContentPane().add(panel_1);\r\n\t\tpanel_1.setLayout(null);\r\n\t\t\r\n\t\tJScrollPane scrollPane_1 = new JScrollPane();\r\n\t\tscrollPane_1.setBounds(72, 239, 770, 445);\r\n\t\tpanel_1.add(scrollPane_1);\r\n\t\t\r\n\t\ttable_1 = new JTable();\r\n\t\tString[] Column= {\"#\", \"ISBN\", \"ID\", \"Due To\"};\r\n\t\tDefaultTableModel f=new DefaultTableModel(Column,0); \r\n\t\ttable_1.setModel(f); \t\t\t\r\n\t\t\r\n\t\tscrollPane_1.setViewportView(table_1);\r\n\t\ttable_1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r\n\t\ttable_1.setOpaque(false);\r\n\t\ttable_1.setFont(new Font(\"Century Gothic\", Font.PLAIN, 13));\r\n\t\ttable_1.setBorder(null);\r\n\t\ttable_1.setBackground(Color.WHITE);\r\n\t\t\r\n\t\r\n\t\tJLabel lblWelcomeToThe = new JLabel(\"Welcome to the Library Management System!\\r\\n\");\r\n\t\tlblWelcomeToThe.setFont(new Font(\"Century751 BT\", Font.ITALIC, 23));\r\n\t\tlblWelcomeToThe.setBounds(20, 11, 476, 116);\r\n\t\tpanel_1.add(lblWelcomeToThe);\r\n\t\t\r\n\t\tPanel panel = new Panel();\r\n\t\tpanel.setBackground(Color.black);\r\n\t\tpanel.setBackground(new Color(0,0,0));\r\n\t\tpanel.setBounds(0, 0, 228, 721);\r\n\t\tframe_bl.getContentPane().add(panel);\r\n\t\tpanel.setLayout(null);\r\n\t\t\r\n\t\tlblLogout = new JLabel(\"Back\");\r\n\t\tlblLogout.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));\r\n\t\tlblLogout.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseEntered(MouseEvent e) {\r\n\t\t\t\tlblLogout.setForeground(new Color(255, 255, 0));\r\n\t\t\t\tlblLogout.setBorder(new BevelBorder(BevelBorder.RAISED, new Color(255, 255, 102), null, null, null));\r\n\t\t\t}\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseExited(MouseEvent e) {\r\n\t\t\t\tlblLogout.setForeground(new Color(204, 204, 204));\r\n\t\t\t\tlblLogout.setBorder(null);\r\n\t\t\t}\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseClicked(MouseEvent e) {\r\n\t\t\t\tframe_bl.setVisible(false);\r\n\t\t\t\tLibrarianMain back=new LibrarianMain(); //CHTO TO TUT NE TAK\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t\tlblLogout.setIcon(new ImageIcon(\"icons\\\\arrow-85-24.png\"));\r\n\t\tlblLogout.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\tlblLogout.setForeground(Color.LIGHT_GRAY);\r\n\t\tlblLogout.setFont(new Font(\"Century Gothic\", Font.PLAIN, 20));\r\n\t\tlblLogout.setBounds(0, 603, 228, 118);\r\n\t\tpanel.add(lblLogout);\r\n\t\t\r\n\t\tlblIssuedBooks = new JLabel(\"Issue\");\r\n\t\tlblIssuedBooks.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));\r\n\t\tlblIssuedBooks.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseEntered(MouseEvent e) {\r\n\t\t\t\tif(getRow()>=0){\r\n\t\t\t\tlblIssuedBooks.setForeground(new Color(255, 255, 0));\r\n\t\t\t\tlblIssuedBooks.setBorder(new BevelBorder(BevelBorder.RAISED, new Color(255, 255, 102), null, null, null));\r\n\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseExited(MouseEvent e) {\r\n\t\t\t\tlblIssuedBooks.setForeground(new Color(204, 204, 204));\r\n\t\t\t\tlblIssuedBooks.setBorder(null);\r\n\t\t\t}\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseClicked(MouseEvent e) {\r\n\t\t\t\t\r\n\t\t\t\t \r\n\t\t\t\tif(getRow()>=0){\r\n\t\t\t\t\tlabel_1.setEnabled(false);\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\tlblIssuedBooks.setIcon(new ImageIcon(\"issue.png\"));\r\n\t\tlblIssuedBooks.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\tlblIssuedBooks.setForeground(Color.LIGHT_GRAY);\r\n\t\tlblIssuedBooks.setFont(new Font(\"Century Gothic\", Font.PLAIN, 20));\r\n\t\tlblIssuedBooks.setBounds(0, 234, 228, 118);\r\n\t\tpanel.add(lblIssuedBooks);\r\n\t\t\r\n\t\tlabel_1 = new JLabel(\"Edit\");\r\n\t\tlabel_1.setBackground(new Color(204, 255, 153));\r\n\t\tlabel_1.setForeground(Color.RED);\r\n\t\tlabel_1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));\r\n\t\tlabel_1.setEnabled(true);\r\n\t\t\r\n\t\t\tlabel_1.addMouseListener(new MouseAdapter() {\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tpublic void mouseClicked(MouseEvent arg0) {\r\n\t\t\t\t\tif(getRow()>=0){\r\n\t\t\t\t\t\tlabel_1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));\r\n\t\t\t\t\t\tlabel_1.setEnabled(false);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void mouseEntered(MouseEvent e) { // ÂÎÒ ÇÄÅÑÜ ÖÂÅÒ ÝÄÈÒÀ\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(getRow()>=0){\r\n\t\t\t\t\tlabel_1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));\r\n\t\t\t\t\tlabel_1.setForeground(new Color(255, 255, 0));\r\n\t\t\t\t\t//label_1.setOpaque(true);\r\n\t\t\t\t\tlabel_1.setBorder(new BevelBorder(BevelBorder.RAISED, new Color(255, 255, 102), null, null, null));}\r\n\t\t\t\t}\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void mouseExited(MouseEvent e) {\r\n\t\t\t\t\tif(getRow()>=0){\r\n\t\t\t\t\t\tlabel_1.setOpaque(false);\r\n\t\t\t\t\tlabel_1.setForeground(new Color(204, 204, 204));\r\n\t\t\t\t\tlabel_1.setBorder(null);}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t\t\tlabel_1.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\t\t\t\tlabel_1.setIcon(new ImageIcon(\"icons\\\\edit-24.png\"));\r\n\t\t\t\t\tlabel_1.setForeground(Color.LIGHT_GRAY);\r\n\t\t\t\t\tlabel_1.setFont(new Font(\"Century Gothic\", Font.PLAIN, 20));\r\n\t\t\t\t\tlabel_1.setBounds(0, 117, 228, 118);\r\n\t\t\t\t\tpanel.add(label_1);\r\n\t\t\t\t\t\r\n\t\t\t\t\tlblBookList = new JLabel(\"Add Book\");\r\n\t\t\t\t\tlblBookList.addMouseListener(new MouseAdapter() {\r\n\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\tpublic void mouseClicked(MouseEvent e) {\r\n\t\t\t\t\t\t\tlblBookList.setForeground(new Color(255, 255, 0));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\tpublic void mouseEntered(MouseEvent e) {\r\n\t\t\t\t\t\t\tlblBookList.setForeground(new Color(255, 255, 0));\r\n\t\t\t\t\t\t\tlblBookList.setBorder(new BevelBorder(BevelBorder.RAISED, new Color(255, 255, 102), null, null, null));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\tpublic void mouseExited(MouseEvent e) {\r\n\t\t\t\t\t\t\tlblBookList.setForeground(new Color(204, 204, 204));\r\n\t\t\t\t\t\t\tlblBookList.setBorder(null);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tlblBookList.setForeground(new Color(204, 204, 204));\r\n\t\t\t\t\tlblBookList.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\t\t\t\tlblBookList.setFont(new Font(\"Century Gothic\", Font.PLAIN, 20));\r\n\t\t\t\t\tlblBookList.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));\r\n\t\t\t\t\tlblBookList.setIcon(new ImageIcon(\"booklist.png\"));\r\n\t\t\t\t\tlblBookList.setBounds(0, 0, 228, 118);\r\n\t\t\t\t\tpanel.add(lblBookList);\r\n\t\t\t\t\t\r\n\t\t\t\t\tJLabel label = new JLabel();\r\n\t\t\t\t\tlabel.setIcon(new ImageIcon(\"librarian.png\"));\r\n\t\t\t\t\tlabel.setBounds(46, 38, 142, 128);\r\n\t\t\t\t\tpanel.add(label);\r\n\t\t\t\t\t\r\n\t\t\t\t\t lblReturn = new JLabel(\"Delete\");\r\n\t\t\t\t\tlblReturn.addMouseListener(new MouseAdapter() {\r\n\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\tpublic void mouseEntered(MouseEvent e) {\r\n\t\t\t\t\t\t\tlblReturn.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));\r\n\t\t\t\t\t\t\tlblReturn.setForeground(new Color(255, 255, 0));\r\n\t\t\t\t\t\t\tlblReturn.setBorder(new BevelBorder(BevelBorder.RAISED, new Color(255, 255, 102), null, null, null));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\tpublic void mouseExited(MouseEvent e) {\r\n\t\t\t\t\t\t\tlblReturn.setForeground(new Color(204, 204, 204));\r\n\t\t\t\t\t\t\tlblReturn.setBorder(null);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\tpublic void mouseClicked(MouseEvent e) {\r\n\t\t\t\t\t\t\tif(getRow()>=0){\r\n\t\t\t\t\t\t\t\tlabel_1.setEnabled(false);\r\n\t\t\t\t\t\t\t\t//BookDelete d=new BookDelete();\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\tlblReturn.setIcon(new ImageIcon(\"icons\\\\delete-24.png\"));\r\n\t\t\t\t\tlblReturn.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\t\t\t\tlblReturn.setForeground(Color.LIGHT_GRAY);\r\n\t\t\t\t\tlblReturn.setFont(new Font(\"Century Gothic\", Font.PLAIN, 20));\r\n\t\t\t\t\tlblReturn.setBounds(0, 353, 228, 118);\r\n\t\t\t\t\tpanel.add(lblReturn);\r\n\t\t\t\t\t\r\n\t\t\t\t\t lblReset = new JLabel(\"Reset\");\r\n\t\t\t\t\tlblReset.addMouseListener(new MouseAdapter() {\r\n\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\tpublic void mouseEntered(MouseEvent e) {\r\n\t\t\t\t\t\t\tlblReset.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));\r\n\t\t\t\t\t\t\tlblReset.setForeground(new Color(255, 255, 0));\r\n\t\t\t\t\t\t\tlblReset.setBorder(new BevelBorder(BevelBorder.RAISED, new Color(255, 255, 102), null, null, null));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\tpublic void mouseExited(MouseEvent e) {\r\n\t\t\t\t\t\t\tlblReset.setForeground(new Color(204, 204, 204));\r\n\t\t\t\t\t\t\tlblReset.setBorder(null);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\tpublic void mouseClicked(MouseEvent e) {\r\n\t\t\t\t\t\t\t/*frame_bl.setVisible(false);\r\n\t\t\t\t\t\t\tBookList back=new BookList(); */\r\n\t\t\t\t\t\t\tTable.table.clearSelection();\r\n\t\t\t\t\t\t\tTable.table.repaint();//ÎÍ ÌÅÍß ÍÀÏÐßÃÀÅÒ: ÒÎËÜÊÎ ÒÝÉÁË ÐÅÑÅÒÈÒ\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\tlblReset.setIcon(new ImageIcon(\"icons\\\\undo-4-24.png\"));\r\n\t\t\t\t\tlblReset.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\t\t\t\tlblReset.setForeground(Color.LIGHT_GRAY);\r\n\t\t\t\t\tlblReset.setFont(new Font(\"Century Gothic\", Font.PLAIN, 20));\r\n\t\t\t\t\tlblReset.setBounds(0, 474, 228, 118);\r\n\t\t\t\t\tpanel.add(lblReset);\r\n\t\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public MyJTable createResultJTable(){\r\n\t\tmodel = new DefaultTableModel(getTableData(getRowNumber(), getTitle(), getAuthor(), getHyperLink(), getYear(), getAbstract(), getPublisher(), getMark(), getIsDuplicate(), getDigitalLibrary()), getColumnName()) {\r\n\t\tprivate static final long serialVersionUID = 1L;\r\n\t\t\tClass<?>[] types = new Class<?>[] { Integer.class, String.class, String.class, URL.class, String.class, String.class, String.class, Boolean.class, Boolean.class, String.class};\r\n\r\n\t\t\tpublic Class<?> getColumnClass(int columnIndex) {\r\n\t\t\t\treturn types[columnIndex];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/*public Class getColumnClass(int col) {\r\n\t\t\t\tif (col == 6) return Boolean.class;\r\n\t\t\t\telse return Object.class;\r\n\t\t\t}*/\r\n\t\t};\r\n\t\t\r\n\t\tMyJTable table = new MyJTable(model);\r\n\t\t//Sap xep noi dung cac dong trong table theo thu tu alpha B.\r\n\t\t//Cho phep sap xep theo tu cot rieng biet\r\n\t\tTableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>(table.getModel());\r\n\t\ttable.setRowSorter(sorter);\r\n\t\t\r\n\t\t/*\r\n\t\t * Set width of table column \r\n\t\t */\r\n\t\ttable.setShowGrid(true);\r\n\t\ttable.setShowVerticalLines(true);\r\n\t\ttable.setShowHorizontalLines(true);\r\n\t\ttable.setRowHeight(25);\r\n\t\t//table.getColumn(\"links\")//;\r\n\t\tDefaultTableCellRenderer dtcr = new DefaultTableCellRenderer(); \r\n\t\tdtcr.setHorizontalAlignment(SwingConstants.CENTER); \r\n\t\t\r\n\t\tTableCellRenderer tcr = table.getDefaultRenderer(Integer.class);\r\n\t\tDefaultTableCellRenderer renderer = (DefaultTableCellRenderer)tcr; \r\n\t\trenderer.setHorizontalAlignment(SwingConstants.CENTER); \r\n\t\t\r\n\t\ttable.getColumn(DBSAResourceBundle.res.getString(\"duplicate\")).setWidth(0);\r\n\t\ttable.getColumn(DBSAResourceBundle.res.getString(\"duplicate\")).setMinWidth(0);\r\n\t\ttable.getColumn(DBSAResourceBundle.res.getString(\"duplicate\")).setMaxWidth(0);\r\n\t\t\r\n\t\ttable.getColumn(\"dlsName\").setWidth(0);\r\n\t\ttable.getColumn(\"dlsName\").setMinWidth(0);\r\n\t\ttable.getColumn(\"dlsName\").setMaxWidth(0);\r\n\t\t\r\n\t\tfor(int i = 0; i < 8; i++){\r\n\t\t\tTableColumn col = table.getColumnModel().getColumn(i);\r\n\t\t\tif(i == 0){\r\n\t\t\t\tcol.setPreferredWidth(5);\r\n\t\t\t}else if(i == 1){\r\n\t\t\t\tcol.setPreferredWidth(200);\r\n\t\t\t}else if(i == 2){\r\n\t\t\t\tcol.setPreferredWidth(150);\r\n\t\t\t}else if(i == 3){\r\n\t\t\t\tcol.setPreferredWidth(150);\r\n\t\t\t}else if(i == 4){\r\n\t\t\t\tcol.setPreferredWidth(20);\r\n\t\t\t}else if (i == 5){\r\n\t\t\t\tcol.setPreferredWidth(400);\r\n\t\t\t}else if(i == 6){\r\n\t\t\t\tcol.setPreferredWidth(70);\r\n\t\t\t}else if(i == 7){\r\n\t\t\t\tcol.setPreferredWidth(5);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn table;\r\n\t}", "public Patients_Data_Frame() {\n initComponents();\n Show_Products_in_jTable();\n }", "public MyJTable createResultJTable(){\r\n\t\tmodel = new DefaultTableModel(getTableData(getRowNumber(), getTitle(), getAuthor(), getHyperLink(), getYear(), getAbstract(), getPublisher(), getMark(), getIsDuplicate(), getID()), getColumnName()) {\r\n\t\tprivate static final long serialVersionUID = 1L;\r\n\t\t\tClass<?>[] types = new Class<?>[] { Integer.class, String.class, String.class, URL.class, String.class, String.class, String.class, Boolean.class, Boolean.class, Integer.class};\r\n\r\n\t\t\tpublic Class<?> getColumnClass(int columnIndex) {\r\n\t\t\t\treturn types[columnIndex];\r\n\t\t\t}\r\n\t\t\r\n\t\t};\r\n\t\t\r\n\t\tMyJTable table = new MyJTable(model);\r\n\t\t//Sap xep noi dung cac dong trong table theo thu tu alpha B.\r\n\t\t//Cho phep sap xep theo tu cot rieng biet\r\n\t\tTableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>(table.getModel());\r\n\t\ttable.setRowSorter(sorter);\r\n\t\t\r\n\t\t/*\r\n\t\t * Set width of table column \r\n\t\t */\r\n\t\ttable.setShowGrid(true);\r\n\t\ttable.setShowVerticalLines(true);\r\n\t\ttable.setShowHorizontalLines(true);\r\n\t\ttable.setRowHeight(25);\r\n\t\t//table.getColumn(\"links\")//;\r\n\t\tDefaultTableCellRenderer dtcr = new DefaultTableCellRenderer(); \r\n\t\tdtcr.setHorizontalAlignment(SwingConstants.CENTER); \r\n\t\t\r\n\t\tTableCellRenderer tcr = table.getDefaultRenderer(Integer.class);\r\n\t\tDefaultTableCellRenderer renderer = (DefaultTableCellRenderer)tcr; \r\n\t\trenderer.setHorizontalAlignment(SwingConstants.CENTER); \r\n\t\t\r\n\t\ttable.getColumn((\"duplicate\")).setWidth(0);\r\n\t\ttable.getColumn((\"duplicate\")).setMinWidth(0);\r\n\t\ttable.getColumn((\"duplicate\")).setMaxWidth(0);\r\n\t\t\r\n\t\ttable.getColumn((\"id\")).setWidth(0);\r\n\t\ttable.getColumn((\"id\")).setMinWidth(0);\r\n\t\ttable.getColumn((\"id\")).setMaxWidth(0);\r\n\t\t\r\n\t\tfor(int i = 0; i < 8; i++){\r\n\t\t\tTableColumn col = table.getColumnModel().getColumn(i);\r\n\t\t\tif(i == 0){\r\n\t\t\t\tcol.setPreferredWidth(30);\r\n\t\t\t}else if(i == 1){\r\n\t\t\t\tcol.setPreferredWidth(300);\r\n\t\t\t}else if(i == 2){\r\n\t\t\t\tcol.setPreferredWidth(200);\r\n\t\t\t}else if(i == 3){\r\n\t\t\t\tcol.setPreferredWidth(150);\r\n\t\t\t}else if(i == 4){\r\n\t\t\t\tcol.setPreferredWidth(60);\r\n\t\t\t}else if (i == 5){\r\n\t\t\t\tcol.setPreferredWidth(150);\r\n\t\t\t}else if(i == 6){\r\n\t\t\t\tcol.setPreferredWidth(80);\r\n\t\t\t}else if(i == 7){\r\n\t\t\t\tcol.setPreferredWidth(30);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn table;\r\n\t}", "@Override\r\n\tpublic void initializeTableContents() {\n\t\t\r\n\t}", "public Travellers() {\n initComponents();\n table1 = (DefaultTableModel) jTable1.getModel();\n }", "private ByaTableModel() {\n\t}", "public AdminTable(AdminManager Amanager) {\r\n\t\tsetTitle(\"Admin Table\");\r\n\t\tsetDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\r\n\t\tsetBounds(100, 100, 450, 456);\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\tJScrollPane scrollPane = new JScrollPane();\r\n\t\tscrollPane.setBounds(28, 53, 378, 200);\r\n\t\tcontentPane.add(scrollPane);\r\n\r\n\t\ttable = new JTable();\r\n\t\ttable.setModel(new DefaultTableModel(\r\n\t\t\t\tnew Object[][] {\r\n\t\t\t\t},\r\n\t\t\t\tnew String[] {\r\n\t\t\t\t\t\t\"Username\", \"Branch\"\r\n\t\t\t\t}\r\n\t\t\t\t));\r\n\t\ttable.getColumnModel().getColumn(0).setPreferredWidth(125);\r\n\t\ttable.getColumnModel().getColumn(1).setPreferredWidth(125);\r\n\t\tscrollPane.setViewportView(table);\r\n\r\n\t\tfor(int i = 0; i<Amanager.getAdminList().size(); i++) {\r\n\t\t\tString username = Amanager.getAdmin(i).getUsername();\r\n\t\t\tString branch = Amanager.getAdmin(i).getBranch();\r\n\r\n\t\t\tObject[] data = {username, branch};\r\n\t\t\tDefaultTableModel model = (DefaultTableModel)table.getModel();\r\n\t\t\tmodel.addRow(data); \r\n\t\t}\r\n\r\n\t\tJLabel lblNewUsernameField = new JLabel(\"New admin field\");\r\n\t\tlblNewUsernameField.setFont(new Font(\"Tahoma\", Font.PLAIN, 16));\r\n\t\tlblNewUsernameField.setBounds(33, 269, 125, 17);\r\n\t\tcontentPane.add(lblNewUsernameField);\r\n\r\n\t\tJLabel lblNewLabel = new JLabel(\"Username\");\r\n\t\tlblNewLabel.setFont(new Font(\"Tahoma\", Font.PLAIN, 14));\r\n\t\tlblNewLabel.setBounds(33, 305, 76, 17);\r\n\t\tcontentPane.add(lblNewLabel);\r\n\r\n\t\tusernameField = new JTextField();\r\n\t\tusernameField.setBounds(119, 305, 175, 20);\r\n\t\tcontentPane.add(usernameField);\r\n\t\tusernameField.setColumns(10);\r\n\r\n\t\tJLabel lblPassword = new JLabel(\"Password\");\r\n\t\tlblPassword.setFont(new Font(\"Tahoma\", Font.PLAIN, 14));\r\n\t\tlblPassword.setBounds(33, 346, 76, 14);\r\n\t\tcontentPane.add(lblPassword);\r\n\r\n\t\tpasswordField = new JTextField();\r\n\t\tpasswordField.setBounds(119, 345, 175, 20);\r\n\t\tcontentPane.add(passwordField);\r\n\t\tpasswordField.setColumns(10);\r\n\r\n\t\tJLabel lblBranch = new JLabel(\"Branch\");\r\n\t\tlblBranch.setFont(new Font(\"Tahoma\", Font.PLAIN, 14));\r\n\t\tlblBranch.setBounds(33, 387, 76, 14);\r\n\t\tcontentPane.add(lblBranch);\r\n\r\n\t\tbranchField = new JTextField();\r\n\t\tbranchField.setBounds(119, 386, 175, 20);\r\n\t\tcontentPane.add(branchField);\r\n\t\tbranchField.setColumns(10);\r\n\r\n\r\n\t\tJButton btnAdd = new JButton(\"Add\");\r\n\t\tbtnAdd.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tfinal String adminFilepath = \"./Database/Admin/AdminList.csv\";\r\n\t\t\t\tString username = usernameField.getText();\r\n\t\t\t\tString password = passwordField.getText();\r\n\t\t\t\tString branch = branchField.getText();\r\n\t\t\t\tboolean emp;\r\n\t\t\t\tboolean exist1 = DatabaseTools.uniqueUsernameCheck(adminFilepath, username);\r\n\t\t\t\tboolean exist2 = Amanager.uniqueAdminUsername(username);\r\n\t\t\t\tif(username.equals(\"\")||password.equals(\"\")||branch.equals(\"\"))\r\n\t\t\t\t\temp = true;\r\n\t\t\t\telse \r\n\t\t\t\t\temp = false;\r\n\r\n\t\t\t\tif(emp)\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Make sure to fill all boxes before proceeding.\", \"Error\", JOptionPane.WARNING_MESSAGE);\r\n\t\t\t\telse \r\n\t\t\t\t{\r\n\t\t\t\t\tif(exist1||exist2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Username taken.\", \"Error\", JOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tboolean stat = DatabaseTools.register(username, password, branch);\r\n\t\t\t\t\t\tif(stat) {\r\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Account created.\", \"Error\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\t\t\t\t\tAdmin hold = new Admin(username, password, branch);\r\n\t\t\t\t\t\t\tAmanager.addAdmin(hold);\r\n\t\t\t\t\t\t\tAdminTable.emptyFields();\r\n\r\n\t\t\t\t\t\t\tAdminTable.showAll(table, Amanager);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Account cannot be created.\", \"Error\", JOptionPane.WARNING_MESSAGE);\r\n\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tbtnAdd.setBounds(317, 264, 89, 23);\r\n\t\tcontentPane.add(btnAdd);\r\n\r\n\t\tJLabel lblAdminList = new JLabel(\"Admin list\");\r\n\t\tlblAdminList.setFont(new Font(\"Tahoma\", Font.PLAIN, 20));\r\n\t\tlblAdminList.setBounds(175, 11, 89, 31);\r\n\t\tcontentPane.add(lblAdminList);\r\n\t\tsetVisible(true);\r\n\t}", "public Complementos() {\n initComponents();\n String cabecera []={\"Producto\",\"Precio\"};\nString datos[][]={};\nboolean t=true;\nboolean f=false;\nmodelo = new Tablachida(datos,cabecera);\ntabla.setModel(modelo);\nTableColumnModel columnModel = tabla.getColumnModel();\ncolumnModel.getColumn(0).setPreferredWidth(250);\ntabla.setRowHeight(40);\n\n }", "private void setUpTable()\n {\n //Setting the outlook of the table\n bookTable.setColumnReorderingAllowed(true);\n bookTable.setColumnCollapsingAllowed(true);\n \n \n bookTable.setContainerDataSource(allBooksBean);\n \n \n //Setting up the table data row and column\n /*bookTable.addContainerProperty(\"id\", Integer.class, null);\n bookTable.addContainerProperty(\"book name\",String.class, null);\n bookTable.addContainerProperty(\"author name\", String.class, null);\n bookTable.addContainerProperty(\"description\", String.class, null);\n bookTable.addContainerProperty(\"book genres\", String.class, null);\n */\n //The initial values in the table \n db.connectDB();\n try{\n allBooks = db.getAllBooks();\n }catch(SQLException ex)\n {\n ex.printStackTrace();\n }\n db.closeDB();\n allBooksBean.addAll(allBooks);\n \n //Set Visible columns (show certain columnes)\n bookTable.setVisibleColumns(new Object[]{\"id\",\"bookName\", \"authorName\", \"description\" ,\"bookGenreString\"});\n \n //Set height and width\n bookTable.setHeight(\"370px\");\n bookTable.setWidth(\"1000px\");\n \n //Allow the data in the table to be selected\n bookTable.setSelectable(true);\n \n //Save the selected row by saving the change Immediately\n bookTable.setImmediate(true);\n //Set the table on listener for value change\n bookTable.addValueChangeListener(new Property.ValueChangeListener()\n {\n public void valueChange(ValueChangeEvent event) {\n \n }\n\n });\n }", "private JScrollPane prepareTable() throws SQLException {\r\n\t\tmetaData = rows.getMetaData();\r\n\t\tif (metaData == null) {\r\n\t\t\tSystem.out.println(\"TableView: Error. No row metadata.\");\r\n\t\t\treturn new JScrollPane(new JLabel(\"ERROR\"));\r\n\t\t}\r\n\r\n\t\ttotalColumns = metaData.getColumnCount();\r\n\r\n\t\tcolumns = new String[totalColumns + totalButtons];\r\n\t\tfor(int i=1; i<=totalColumns; i++)\r\n\t\t\tcolumns[i-1] = metaData.getColumnName(i);\r\n\r\n\t\tfor(int i=0; i<totalButtons; i++)\r\n\t\t\tcolumns[totalColumns + i] = \"\";\r\n\r\n\t\tdTableModel = new DefaultTableModel(databaseInfo, columns);\r\n\r\n\t\t// Temporarily holds the row results\r\n\t\tObject[] tempRow;\r\n\r\n\t\twhile(rows.next()){ \t\r\n\t\t\ttempRow = new Object[totalColumns];\r\n\t\t\tfor(int i=0; i<totalColumns; i++)\r\n\t\t\t\ttempRow[i] = rows.getString(i+1);\r\n\t\t\tdTableModel.addRow(tempRow);\r\n\t\t}\r\n\r\n\t\ttable = new JTable(dTableModel){ \r\n\t\t\tprivate static final long serialVersionUID = 1L;\r\n\r\n\t\t\tpublic boolean isCellEditable(int row,int column){ \r\n\t\t\t\tif(column < totalColumns) return false;//the 4th column is not editable \r\n\t\t\t\treturn true; \r\n\t\t\t} \r\n\t\t}; \r\n\r\n\r\n\t\ttable.setFont(new Font(\"Serif\", Font.PLAIN, 20));\r\n\r\n\t\ttable.setRowHeight(table.getRowHeight()+10);\r\n\r\n\t\t/* Sorting rows are screwing buttons up */\r\n\t\ttable.setAutoCreateRowSorter( (totalButtons == 0) );\r\n\r\n\t\tfor(int i=0; i<totalButtons; i++) {\r\n\t\t\ttable.getColumnModel().getColumn(totalColumns + i).setPreferredWidth(100);\r\n\t\t\tnew ButtonColumn(table, buttonAction[i], buttonTitle[i], totalColumns + i);\r\n\t\t}\r\n\r\n\t\tJScrollPane scrollPane = new JScrollPane(table);\r\n\t\t\r\n\t\treturn scrollPane;\r\n\t}", "public JTable create() {\n\n Object[] colName = null;\n int columnsNumber = 0;\n\n columnsNumber = 2;\n colName = new Object[columnsNumber];\n\n colName[0] = MessagesManager.get(\"name\");\n colName[1] = MessagesManager.get(\"value\");\n\n Properties p = System.getProperties();\n\n Enumeration keys = p.keys();\n\n List<String> listKeys = new Vector<String>();\n\n while (keys.hasMoreElements()) {\n String key = (String) keys.nextElement();\n listKeys.add(key);\n }\n\n Collections.sort(listKeys);\n\n Object[][] data = new Object[listKeys.size()][columnsNumber];\n\n for (int i = 0; i < listKeys.size(); i++) {\n String key = listKeys.get(i);\n String value = p.getProperty(key);\n\n data[i][0] = key;\n data[i][1] = value;\n\n }\n\n // TableSorter is a tool class to sort columns by clicking on headers\n TableSorter sorter = new TableSorter(new TableModelNonEditable(data, colName));\n\n // We will create out own getCellRenderer() in the JTable, so that it can call\n // PgeepTableCellRenderer\n// JTable jTable1 = new JTable(sorter) \n// {\n// public TableCellRenderer getCellRenderer(int row, int column) \n// {\n// return new PgeepTableCellRenderer(owner);\n// } \n// };\n\n JTable jTable1 = new JTable(sorter);\n\n // Set the Table Header Display\n Font fontHeader = new Font(m_font.getName(), Font.PLAIN, m_font.getSize());\n JTableHeader jTableHeader = jTable1.getTableHeader();\n jTableHeader.setFont(fontHeader);\n sorter.setTableHeader(jTableHeader);\n\n jTable1.setFont(m_font);\n jTable1.setColumnSelectionAllowed(false);\n jTable1.setRowSelectionAllowed(true);\n jTable1.setAutoscrolls(true);\n\n //jTable1.setColumnModel(new MyTableColumnModel());\n //jTable1.setAutoCreateColumnsFromModel(true);\n\n jTable1.setShowHorizontalLines(false);\n jTable1.setShowVerticalLines(true);\n\n jTable1.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);\n\n // Resize last column (if necessary)\n jTable1.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);\n\n // use an Expansion factor of 1.3x for change between 12 and Arial,17 \n JTableUtil.calcColumnWidths(jTable1, 1.00);\n\n return jTable1;\n }", "@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 TbData = new javax.swing.JTable();\n jLabel1 = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n TbData.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\", \"Title 5\"\n }\n ));\n jScrollPane1.setViewportView(TbData);\n\n jLabel1.setText(\"Datos\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)\n .addContainerGap())\n .addGroup(layout.createSequentialGroup()\n .addGap(174, 174, 174)\n .addComponent(jLabel1)\n .addContainerGap(193, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(16, Short.MAX_VALUE)\n .addComponent(jLabel1)\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n\n pack();\n }", "public AttlistTableModel () {\n super();\n }", "@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 officerTable = new javax.swing.JTable();\n\n setLayout(new java.awt.GridLayout(1, 0));\n\n officerTable.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(officerTable);\n\n add(jScrollPane1);\n }", "private static void setTableWithData()\n {\n /* Se establecen el tamaño de la tabla */\n table.setSize(1280, 630);\n table.setMaximumSize(new Dimension(1280, 630));\n table.setMinimumSize(new Dimension(1280, 630));\n\n /* Se garantiza que cada fila (album) tiene un alto proporcional de acuerdo con el numero de cancioens */\n Iterator iteratorPerRow = listSizePerRow.iterator();\n int sizePerRow, i;\n i = 0;\n while (iteratorPerRow.hasNext())\n {\n sizePerRow = (Integer) iteratorPerRow.next(); \n table.setRowHeight(i, sizePerRow);\n i++;\n }\n\n /* Se setea el ancho de cada columna */\n setSize(table, JSoundsMainWindowViewController.ALBUM_COVER_COLUMN, 200);\n setSize(table, JSoundsMainWindowViewController.ALBUM_INFO_COLUMN, 230);\n setSize(table, JSoundsMainWindowViewController.NUMBER_SONG_COLUMN, 50);\n setSize(table, JSoundsMainWindowViewController.LIST_SONG_COLUMN, 400);\n setSize(table, JSoundsMainWindowViewController.GENDER_SONG_COLUMN, 230);\n\n /* Renderizado del la imagen del album */\n JLabelTableRenderer jltcr = new JLabelTableRenderer();\n jltcr.setVerticalAlignment(SwingConstants.TOP);\n jltcr.setHorizontalAlignment(SwingConstants.CENTER);\n\n table.getColumnModel().getColumn(0).setCellRenderer(jltcr);\n\n\n /* Renderizados de cada columna */\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.ALBUM_INFO_COLUMN).setCellRenderer(new JListTableRenderer());\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.ALBUM_INFO_COLUMN).setCellEditor(new JListTableEditor());\n\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.NUMBER_SONG_COLUMN).setCellRenderer(new JListTableRenderer());\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.NUMBER_SONG_COLUMN).setCellEditor(new JListTableEditor());\n\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.LIST_SONG_COLUMN).setCellRenderer(new JListTableRenderer());\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.LIST_SONG_COLUMN).setCellEditor(new JListTableEditor());\n\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.GENDER_SONG_COLUMN).setCellRenderer(new JListTableRenderer());\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.GENDER_SONG_COLUMN).setCellEditor(new JListTableEditor());\n\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.LAST_PLAYED_SONG_COLUMN).setCellRenderer(new JListTableRenderer());\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.LAST_PLAYED_SONG_COLUMN).setCellEditor(new JListTableEditor()); \n }", "private void initComponents() {\n\n dataScrollPane = new javax.swing.JScrollPane();\n dataTable = new com.cosmos.acacia.gui.AcaciaTable();\n buttonsPanel = new com.cosmos.swingb.JBPanel();\n closeButton = new com.cosmos.swingb.JBButton();\n refreshButton = new com.cosmos.swingb.JBButton();\n deleteButton = new com.cosmos.swingb.JBButton();\n modifyButton = new com.cosmos.swingb.JBButton();\n newButton = new com.cosmos.swingb.JBButton();\n selectButton = new com.cosmos.swingb.JBButton();\n unselectButton = new com.cosmos.swingb.JBButton();\n classifyButton = new com.cosmos.swingb.JBButton();\n specialFunctionalityButton = new com.cosmos.swingb.JBButton();\n filterButton = new com.cosmos.swingb.JBButton();\n\n setName(\"Form\"); // NOI18N\n addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n onKeyPressed(evt);\n }\n });\n setLayout(new java.awt.BorderLayout());\n\n dataScrollPane.setName(\"dataScrollPane\"); // NOI18N\n\n dataTable.setName(\"dataTable\"); // NOI18N\n dataTable.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n onKeyPressed(evt);\n }\n });\n dataScrollPane.setViewportView(dataTable);\n\n add(dataScrollPane, java.awt.BorderLayout.CENTER);\n\n buttonsPanel.setName(\"buttonsPanel\"); // NOI18N\n\n javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(com.cosmos.acacia.crm.gui.AcaciaApplication.class).getContext().getActionMap(AbstractTablePanel.class, this);\n closeButton.setAction(actionMap.get(\"closeAction\")); // NOI18N\n closeButton.setName(\"closeButton\"); // NOI18N\n\n refreshButton.setAction(actionMap.get(\"refreshAction\")); // NOI18N\n refreshButton.setName(\"refreshButton\"); // NOI18N\n\n deleteButton.setAction(actionMap.get(\"deleteAction\")); // NOI18N\n deleteButton.setName(\"deleteButton\"); // NOI18N\n\n modifyButton.setAction(actionMap.get(\"modifyAction\")); // NOI18N\n modifyButton.setName(\"modifyButton\"); // NOI18N\n\n newButton.setAction(actionMap.get(\"newAction\")); // NOI18N\n newButton.setName(\"newButton\"); // NOI18N\n\n selectButton.setAction(actionMap.get(\"selectAction\")); // NOI18N\n selectButton.setName(\"selectButton\"); // NOI18N\n\n unselectButton.setAction(actionMap.get(\"unselectAction\")); // NOI18N\n unselectButton.setName(\"unselectButton\"); // NOI18N\n\n classifyButton.setAction(actionMap.get(\"classifyAction\")); // NOI18N\n org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(com.cosmos.acacia.crm.gui.AcaciaApplication.class).getContext().getResourceMap(AbstractTablePanel.class);\n classifyButton.setText(resourceMap.getString(\"classifyButton.text\")); // NOI18N\n classifyButton.setName(\"classifyButton\"); // NOI18N\n\n specialFunctionalityButton.setAction(actionMap.get(\"specialAction\")); // NOI18N\n specialFunctionalityButton.setName(\"specialFunctionalityButton\"); // NOI18N\n\n filterButton.setAction(actionMap.get(\"filter\")); // NOI18N\n filterButton.setName(\"filterButton\"); // NOI18N\n\n javax.swing.GroupLayout buttonsPanelLayout = new javax.swing.GroupLayout(buttonsPanel);\n buttonsPanel.setLayout(buttonsPanelLayout);\n buttonsPanelLayout.setHorizontalGroup(\n buttonsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, buttonsPanelLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(selectButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(unselectButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 51, Short.MAX_VALUE)\n .addComponent(specialFunctionalityButton, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(filterButton, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(classifyButton, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(newButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(modifyButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(deleteButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(refreshButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(closeButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n\n buttonsPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {closeButton, deleteButton, modifyButton, newButton, refreshButton, selectButton});\n\n buttonsPanelLayout.setVerticalGroup(\n buttonsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, buttonsPanelLayout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(buttonsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(closeButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(selectButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(refreshButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(deleteButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(modifyButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(newButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(unselectButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(classifyButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(filterButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(specialFunctionalityButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap())\n );\n\n buttonsPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {closeButton, deleteButton, modifyButton, newButton, refreshButton, selectButton, unselectButton});\n\n add(buttonsPanel, java.awt.BorderLayout.PAGE_END);\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\"> \n private void initComponents() {\n\n jMenuItem1 = new javax.swing.JMenuItem();\n jMenu3 = new javax.swing.JMenu();\n jSeparator1 = new javax.swing.JSeparator();\n jFileChooser1 = new javax.swing.JFileChooser();\n jScrollPane2 = new javax.swing.JScrollPane();\n jTable2 = new javax.swing.JTable();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n jScrollPane3 = new javax.swing.JScrollPane();\n jTable3 = new javax.swing.JTable();\n jScrollPane4 = new javax.swing.JScrollPane();\n jTable4 = new javax.swing.JTable();\n jScrollPane5 = new javax.swing.JScrollPane();\n jTable5 = new javax.swing.JTable();\n button1 = new java.awt.Button();\n jMenuBar1 = new javax.swing.JMenuBar();\n jMenu1 = new javax.swing.JMenu();\n jMenuItem2 = new javax.swing.JMenuItem();\n jMenu2 = new javax.swing.JMenu();\n\n jMenuItem1.setText(\"jMenuItem1\");\n\n jMenu3.setText(\"jMenu3\");\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jTable2.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {\"\", null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null}\n },\n new String [] {\n \"Linha\", \"Instrução\", \"Atributo #1\", \"Atributo #2\", \"Comentário\"\n }\n ));\n jScrollPane2.setViewportView(jTable2);\n\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null},\n {null, null},\n {null, null},\n {null, null},\n {null, null},\n {null, null},\n {null, null},\n {null, null},\n {null, null}\n },\n new String [] {\n \"Endereço\", \"Valor\"\n }\n ));\n jScrollPane1.setViewportView(jTable1);\n\n jTable3.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null},\n {null},\n {null},\n {null}\n },\n new String [] {\n \"Break Points\"\n }\n ));\n jScrollPane3.setViewportView(jTable3);\n\n jTable4.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null},\n {null},\n {null},\n {null}\n },\n new String [] {\n \"Janela de entrada\"\n }\n ));\n jScrollPane4.setViewportView(jTable4);\n\n jTable5.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null},\n {null},\n {null},\n {null}\n },\n new String [] {\n \"Janela de Saída\"\n }\n ));\n jScrollPane5.setViewportView(jTable5);\n\n button1.setLabel(\"Continuar\");\n button1.setName(\"button1\"); // NOI18N\n button1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n button1ActionPerformed(evt);\n }\n });\n\n jMenu1.setText(\"File\");\n\n jMenuItem2.setLabel(\"Selecionar Arquivo\");\n jMenuItem2.setName(\"\"); // NOI18N\n jMenuItem2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItem2ActionPerformed(evt);\n }\n });\n jMenu1.add(jMenuItem2);\n\n jMenuBar1.add(jMenu1);\n\n jMenu2.setText(\"Executar\");\n jMenuBar1.add(jMenu2);\n\n setJMenuBar(jMenuBar1);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 227, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(36, 36, 36)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 227, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 569, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGap(210, 210, 210)\n .addComponent(button1, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 237, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 515, Short.MAX_VALUE)))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 172, Short.MAX_VALUE)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))\n .addGap(37, 37, 37)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(19, 19, 19)\n .addComponent(button1, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(29, Short.MAX_VALUE))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(208, 208, 208)\n .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(73, Short.MAX_VALUE)))\n );\n\n button1.getAccessibleContext().setAccessibleName(\"button1\");\n button1.getAccessibleContext().setAccessibleDescription(\"\");\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n lblMisTutores = new javax.swing.JLabel();\n jSeparator1 = new javax.swing.JSeparator();\n lblImagenMen = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n tblMisTutores = new javax.swing.JTable();\n\n setBackground(new java.awt.Color(204, 255, 255));\n\n lblMisTutores.setFont(new java.awt.Font(\"Century Gothic\", 0, 48)); // NOI18N\n lblMisTutores.setText(\"Mis tutores\");\n\n jSeparator1.setBackground(new java.awt.Color(0, 153, 153));\n jSeparator1.setForeground(new java.awt.Color(0, 153, 153));\n\n lblImagenMen.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n lblImagenMen.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagenes/aquii_1.PNG\"))); // NOI18N\n lblImagenMen.setToolTipText(\"\");\n\n tblMisTutores.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(tblMisTutores);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addComponent(lblImagenMen, javax.swing.GroupLayout.PREFERRED_SIZE, 230, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 341, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(25, 25, 25)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 550, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(6, 6, 6))\n .addGroup(layout.createSequentialGroup()\n .addComponent(lblMisTutores)\n .addGap(312, 312, 312)))))\n .addContainerGap(19, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(12, 12, 12)\n .addComponent(lblMisTutores)\n .addGap(18, 18, 18)\n .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 141, Short.MAX_VALUE)\n .addComponent(lblImagenMen, javax.swing.GroupLayout.PREFERRED_SIZE, 287, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(77, 77, 77)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))))\n );\n }", "@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 tblCalendar = new javax.swing.JTable();\n kuukausi = new javax.swing.JLabel();\n jButton1 = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n\n tblCalendar.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(tblCalendar);\n\n kuukausi.setText(\"Kuukausi\");\n\n jButton1.setText(\">>\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jButton2.setText(\"<<\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(33, 33, 33)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 1029, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(31, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jButton2)\n .addGap(18, 18, 18)\n .addComponent(kuukausi, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jButton1)\n .addGap(452, 452, 452))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(kuukausi)\n .addComponent(jButton1)\n .addComponent(jButton2))\n .addGap(14, 14, 14)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 514, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(18, Short.MAX_VALUE))\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n airlinerTable = new javax.swing.JTable();\n backjButton2 = new javax.swing.JButton();\n removeairliner = new javax.swing.JButton();\n addairliner = new javax.swing.JButton();\n\n setBackground(new java.awt.Color(204, 204, 204));\n\n jLabel1.setFont(new java.awt.Font(\"Arial Black\", 1, 18)); // NOI18N\n jLabel1.setText(\"Manage Airliner Work Area\");\n\n airlinerTable.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null},\n {null},\n {null},\n {null},\n {null},\n {null},\n {null},\n {null},\n {null},\n {null}\n },\n new String [] {\n \"Airliner Name\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n jScrollPane1.setViewportView(airlinerTable);\n\n backjButton2.setText(\"<<Back\");\n backjButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n backjButton2ActionPerformed(evt);\n }\n });\n\n removeairliner.setText(\"Remove\");\n removeairliner.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n removeairlinerActionPerformed(evt);\n }\n });\n\n addairliner.setText(\"Add Airliner\");\n addairliner.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n addairlinerActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(31, 31, 31)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(backjButton2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(removeairliner)\n .addGap(103, 103, 103)\n .addComponent(addairliner))\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 335, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 313, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(393, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(18, 18, 18)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(56, 56, 56)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(backjButton2)\n .addComponent(removeairliner)\n .addComponent(addairliner))\n .addContainerGap(237, Short.MAX_VALUE))\n );\n }", "@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 tableticket = new javax.swing.JTable();\n\n setClosable(true);\n setIconifiable(true);\n setTitle(\"View Ticket Details\");\n\n tableticket.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n tableticket.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n tableticketMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(tableticket);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 722, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n\n pack();\n }", "public void disTable () {\n\t\t\t\tJScrollPane scrollPane = new JScrollPane(table);\n\t\t\t\tvalues = new Vector();\n\t\t\t\tvalues.add(\"20\"); values.add(\"20\"); values.add(\"20\"); values.add(\"20\"); values.add(\"20\");values.add(\"20\");values.add(new Boolean(false));\n\t\t\t\tmyModel.addRow(values ); // more practicle, vector can take only objects.\n\t\t myModel.addRow(data);\n\n\n\t\t\t\tgetContentPane().add(scrollPane, BorderLayout.CENTER);\n\n\t\t\t\t addWindowListener(new WindowAdapter() {\n\t\t\t\t\t\t\tpublic void windowClosing(WindowEvent e) {\n\t\t\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t\t\t}\n\t\t\t\t });\n\t}", "private void initComponents() {\n\n scrollTableDocumentMetadata = new javax.swing.JScrollPane();\n tableDocumentMetadata = new javax.swing.JTable();\n lblDescDocMetadata = new javax.swing.JLabel();\n btnEditMetadata = new javax.swing.JButton();\n\n tableDocumentMetadata.setFont(new java.awt.Font(\"DejaVu Sans\", 0, 11));\n tableDocumentMetadata.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n scrollTableDocumentMetadata.setViewportView(tableDocumentMetadata);\n\n lblDescDocMetadata.setFont(new java.awt.Font(\"DejaVu Sans\", 0, 11));\n lblDescDocMetadata.setText(\"Document Metadata\");\n\n btnEditMetadata.setFont(new java.awt.Font(\"DejaVu Sans\", 0, 10));\n btnEditMetadata.setText(\"Edit Document Metadata\");\n btnEditMetadata.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnEditMetadataActionPerformed(evt);\n }\n });\n\n org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(layout.createSequentialGroup()\n .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(lblDescDocMetadata, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 196, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .add(layout.createSequentialGroup()\n .add(12, 12, 12)\n .add(scrollTableDocumentMetadata, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 213, Short.MAX_VALUE))\n .add(layout.createSequentialGroup()\n .add(46, 46, 46)\n .add(btnEditMetadata)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(layout.createSequentialGroup()\n .add(lblDescDocMetadata)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(scrollTableDocumentMetadata, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 231, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)\n .add(btnEditMetadata)\n .addContainerGap(27, Short.MAX_VALUE))\n );\n\n getAccessibleContext().setAccessibleDescription(\"Doc Metadata\");\n }", "public AdminPanel() {\n Object paint[][] = {};\n jtModel = new DefaultTableModel(paint,columnNames)\n {\n @Override\n public boolean isCellEditable(int row, int column) {\n return false;\n } \n @Override\n public Class getColumnClass(int column) {\n switch (column) {\n case 2:\n /* This is for the price column sorting */\n return Integer.class;\n default:\n return String.class;//This is for the name column sorting.\n }\n }\n \n };\n initComponents();\n jt.getTableHeader().setResizingAllowed(false);\n jt.getTableHeader().setReorderingAllowed(false);\n \n TableRowSorter<TableModel> sorting = new TableRowSorter<>(jt.getModel());\n jt.setRowSorter(sorting); \n \n // These column can't be sorted.\n sorting.setSortable(0, false);\n sorting.setSortable(3, false);\n sorting.setSortable(4, false);\n sorting.setSortable(5, false);\n sorting.setSortable(6, false);\n sorting.setSortable(7, false);\n sorting.setSortable(8, false);\n addFile();\n }", "private void initComponents() {\r\n\t\tjScrollPane1 = new javax.swing.JScrollPane();\r\n\t\ttableSessionOutcomes = new javax.swing.JTable();\r\n\r\n\t\tgetContentPane().setLayout(new javax.swing.BoxLayout(getContentPane(), javax.swing.BoxLayout.X_AXIS));\r\n\r\n\t\tsetDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\r\n\t\tsetTitle(\"Negotiation results\");\r\n\t\ttableSessionOutcomes.setModel(new javax.swing.table.DefaultTableModel(\r\n\t\t\t\tnew Object [][] {\r\n\t\t\t\t\t\t{null, null, null, null},\r\n\t\t\t\t\t\t{null, null, null, null},\r\n\t\t\t\t\t\t{null, null, null, null},\r\n\t\t\t\t\t\t{null, null, null, null}\r\n\t\t\t\t},\r\n\t\t\t\tnew String [] {\r\n\t\t\t\t\t\t\"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\r\n\t\t\t\t}\r\n\t\t));\r\n\t\tjScrollPane1.setViewportView(tableSessionOutcomes);\r\n\r\n\t\tgetContentPane().add(jScrollPane1);\r\n\r\n\t\tpack();\r\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n jMenuBar1 = new javax.swing.JMenuBar();\n jMenu1 = new javax.swing.JMenu();\n jMenu2 = new javax.swing.JMenu();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jPanel1.setLayout(new java.awt.BorderLayout());\n\n jTable1.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(jTable1);\n\n jPanel1.add(jScrollPane1, java.awt.BorderLayout.CENTER);\n\n getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);\n\n jMenu1.setText(\"File\");\n jMenuBar1.add(jMenu1);\n\n jMenu2.setText(\"Edit\");\n jMenuBar1.add(jMenu2);\n\n setJMenuBar(jMenuBar1);\n\n pack();\n }", "public void actionPerformed(ActionEvent event){\n tableModel.addRow(blank);\r\n }", "public ExibeTarefas() {\n initComponents();\n DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel();\n jTable1.setRowSorter(new TableRowSorter(modelo));\n readJTable();\n readItemBox();\n }", "public void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 806, 499);\n\t\tframe.setDefaultCloseOperation(1);\n\t\tframe.getContentPane().setLayout(null);\n\t\ttry {\n\t\t\tUIManager.setLookAndFeel(\"javax.swing.plaf.nimbus.NimbusLookAndFeel\");\n\t\t} catch (ClassNotFoundException | InstantiationException | IllegalAccessException\n\t\t\t\t| UnsupportedLookAndFeelException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tJPanel panel = new JPanel();\n\t\tpanel.setBounds(0, 243, 790, 217);\n\t\tframe.getContentPane().add(panel);\n\t\tpanel.setLayout(null);\n\t\t\n\t\tJScrollPane scrollPane = new JScrollPane();\n\t\tscrollPane.setBounds(10, 11, 770, 169);\n\t\tpanel.add(scrollPane);\n\t\t\n\t\ttable = new JTable();\n\t\ttable.setModel(model);\n\t\tmodel.setColumnIdentifiers(inventory);\n\t\tscrollPane.setViewportView(table);\n\t\ttable.getColumnModel().getColumn(0).setPreferredWidth(100);\n\t\ttable.getColumnModel().getColumn(1).setPreferredWidth(120);\n\t\ttable.getColumnModel().getColumn(2).setPreferredWidth(120);\n\t\ttable.getColumnModel().getColumn(3).setPreferredWidth(110);\n\t\ttable.getColumnModel().getColumn(4).setPreferredWidth(120);\n\t\ttable.getColumnModel().getColumn(5).setPreferredWidth(100);\n\t\ttable.getColumnModel().getColumn(6).setPreferredWidth(110);\n\t\ttable.getColumnModel().getColumn(7).setPreferredWidth(120);\n\t\ttable.getColumnModel().getColumn(7).setPreferredWidth(120);\n\n//\n//\t\ttable.setShowGrid(false);\n//\t\ttable.setShowHorizontalLines(true);\n//\t\ttable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);\n\t\ttable.setDefaultEditor(Object.class, null);\n\t\tscrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);\n\t\t\n\t\tJPanel panel_1 = new JPanel();\n\t\tpanel_1.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED, new Color(255, 255, 255), new Color(160, 160, 160)), \"Add New Item\", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 205)));\n\t\tpanel_1.setBounds(10, 11, 770, 194);\n\t\tframe.getContentPane().add(panel_1);\n\t\tpanel_1.setLayout(null);\n\t\t\n\t\tdrugIDGen = new JTextField();\n\t\tdrugIDGen.setBounds(123, 32, 146, 26);\n\t\tpanel_1.add(drugIDGen);\n\t\tdrugIDGen.setColumns(10);\n\t\t\n\t\texDate = new JTextField();\n\t\texDate.setColumns(10);\n\t\texDate.setBounds(123, 143, 146, 26);\n\t\tpanel_1.add(exDate);\n\t\t\n\t\tdate = new JTextField();\n\t\tdate.setColumns(10);\n\t\tdate.setBounds(388, 143, 146, 26);\n\t\tpanel_1.add(date);\n\t\t\n\t\tdrugname = new JTextField();\n\t\tdrugname.setColumns(10);\n\t\tdrugname.setBounds(123, 69, 146, 26);\n\t\tpanel_1.add(drugname);\n\t\t\n\t\tuPrice = new JTextField();\n\t\tuPrice.setColumns(10);\n\t\tuPrice.setBounds(388, 32, 146, 26);\n\t\tpanel_1.add(uPrice);\n\t\t\n\t\tqSold = new JTextField();\n\t\tqSold.setColumns(10);\n\t\tqSold.setBounds(388, 69, 146, 26);\n\t\tpanel_1.add(qSold);\n\t\tqSold.setText(0+\"\");\n\t\tqSold.setEditable(false);\n\t\t\n\t\tgrammage = new JTextField();\n\t\tgrammage.setColumns(10);\n\t\tgrammage.setBounds(123, 106, 146, 26);\n\t\tpanel_1.add(grammage);\n\t\t\n\t\tqRemaining = new JTextField();\n\t\tqRemaining.setColumns(10);\n\t\tqRemaining.setBounds(388, 106, 146, 26);\n\t\tpanel_1.add(qRemaining);\n\t\t\n\t\tdrugidTxt = new JLabel(\"Drug ID\");\n\t\tdrugidTxt.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\n\t\tdrugidTxt.setBounds(10, 33, 103, 20);\n\t\tpanel_1.add(drugidTxt);\n\t\t\n\t\tdrugnameTxt_1 = new JLabel(\"Drug Name\");\n\t\tdrugnameTxt_1.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\n\t\tdrugnameTxt_1.setBounds(10, 75, 103, 20);\n\t\tpanel_1.add(drugnameTxt_1);\n\t\t\n\t\tdrugnameTxt = new JLabel(\"Grammage\");\n\t\tdrugnameTxt.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\n\t\tdrugnameTxt.setBounds(10, 112, 103, 20);\n\t\tpanel_1.add(drugnameTxt);\n\t\t\n\t\tlblExpiryDate = new JLabel(\"Expiry Date\");\n\t\tlblExpiryDate.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\n\t\tlblExpiryDate.setBounds(10, 149, 103, 20);\n\t\tpanel_1.add(lblExpiryDate);\n\t\t\n\t\tunitpriceTxt = new JLabel(\"Unit Price\");\n\t\tunitpriceTxt.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\n\t\tunitpriceTxt.setBounds(279, 32, 103, 20);\n\t\tpanel_1.add(unitpriceTxt);\n\t\t\n\t\tlblQtySold = new JLabel(\"QTY Sold\");\n\t\tlblQtySold.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\n\t\tlblQtySold.setBounds(279, 69, 103, 20);\n\t\tpanel_1.add(lblQtySold);\n\t\t\n\t\tlblQtyReamin = new JLabel(\"Drug QTY \");\n\t\tlblQtyReamin.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\n\t\tlblQtyReamin.setBounds(275, 107, 103, 20);\n\t\tpanel_1.add(lblQtyReamin);\n\t\t\n\t\tlblPurchDate = new JLabel(\"Purch. Date\");\n\t\tlblPurchDate.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\n\t\tlblPurchDate.setBounds(279, 144, 103, 20);\n\t\tpanel_1.add(lblPurchDate);\n\t\t\n\t\tpanel_2 = new JPanel();\n\t\tpanel_2.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED, new Color(255, 255, 255), new Color(160, 160, 160)), \"Menu\", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 205)));\n\t\tpanel_2.setBounds(544, 32, 216, 138);\n\t\tpanel_1.add(panel_2);\n\t\tpanel_2.setLayout(null);\n\t\t\n\t\tbtnNewButton = new JButton(\"Generate ID\");\n\t\tbtnNewButton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t\tdouble num = Math.floor(Math.random() * 1600);\n\t\t\t\tint runout = (int) num;\n\t\t\t\tString coll = drugname.getText();\n\t\t\t\tString output = \"\";\n\t\t\t\t\n\t\t\t\tif(drugname.getText().isEmpty()) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Enter Drug Name in order to generate ID\");\n\t\t\t\t}\n\t\t\t\telse {\t\t\t\t\n\t\t\t\tif(coll.length()>=4) {\n\t\t\t\t\toutput = coll.substring(0, 4);\n\t\t\t\t\tdrugIDGen.setText(output + runout+\"\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\toutput = coll.substring(0, 3);\n\t\t\t\t\tdrugIDGen.setText(output + runout+\"\");\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbtnNewButton.setBackground(new Color(50, 205, 50));\n\t\tbtnNewButton.setFont(new Font(\"Tahoma\", Font.PLAIN, 14));\n\t\tbtnNewButton.setBounds(10, 20, 196, 29);\n\t\tpanel_2.add(btnNewButton);\n\t\t\n\t\tbtnAddDrugs = new JButton(\"Add New\");\n\t\tbtnAddDrugs.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\taddNewDrug();\n\t\t\t}\n\t\t});\n\t\tbtnAddDrugs.setBackground(new Color(50, 205, 50));\n\t\tbtnAddDrugs.setFont(new Font(\"Tahoma\", Font.PLAIN, 15));\n\t\tbtnAddDrugs.setBounds(10, 60, 196, 29);\n\t\tpanel_2.add(btnAddDrugs);\n\t\t\n\t\tbtnNewButton_2 = new JButton(\"View Details\");\n\t\tbtnNewButton_2.setBackground(new Color(50, 205, 50));\n\t\tbtnNewButton_2.setFont(new Font(\"Tahoma\", Font.PLAIN, 15));\n\t\tbtnNewButton_2.setBounds(10, 100, 196, 29);\n\t\tpanel_2.add(btnNewButton_2);\n\t\t\n\t\tlblNewLabel = new JLabel(\"Enter drug name to generate drug ID\");\n\t\tlblNewLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 11));\n\t\tlblNewLabel.setBounds(544, 11, 216, 20);\n\t\tpanel_1.add(lblNewLabel);\n\t\t\n\t\ttextField = new JTextField();\n\t\ttextField.setColumns(10);\n\t\ttextField.setBounds(78, 210, 199, 26);\n\t\tframe.getContentPane().add(textField);\n\t\t\n\t\tlblSearch = new JLabel(\"Search\");\n\t\tlblSearch.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\n\t\tlblSearch.setBounds(20, 212, 63, 20);\n\t\tframe.getContentPane().add(lblSearch);\n\t\tmodel.setColumnIdentifiers(inventory);\n\t}", "public TablesPanel() {\n\n tableModel = new TablesTableModel(); \n matchesModel = new MatchesTableModel();\n gameChooser = new GameChooser();\n\n initComponents();\n // tableModel.setSession(session);\n\n // formater\n // change default just now from 60 to 30 secs\n // see workaround for 4.0 versions: https://github.com/ocpsoft/prettytime/issues/152\n TimeFormat timeFormat = timeFormater.removeUnit(JustNow.class);\n JustNow newJustNow = new JustNow();\n newJustNow.setMaxQuantity(1000L * 30L); // 30 seconds gap (show \"just now\" from 0 to 30 secs)\n timeFormater.registerUnit(newJustNow, timeFormat);\n\n // 1. TABLE CURRENT\n tableTables.createDefaultColumnsFromModel();\n ((MageTable)tableTables).setTableInfo(tableInfo);\n \n activeTablesSorter = new MageTableRowSorter(tableModel) {\n @Override\n public void toggleSortOrder(int column) {\n // special sort for created and seat column\n if (column == TablesTableModel.COLUMN_CREATED || column == TablesTableModel.COLUMN_SEATS) {\n List<? extends SortKey> sortKeys = getSortKeys();\n if (sortKeys.size() == 2) {\n // clear sort on second click\n setSortKeys(null);\n } else {\n // setup sort on first click\n List<SortKey> list = new ArrayList<>();\n list.add(new RowSorter.SortKey(TablesTableModel.COLUMN_SEATS, SortOrder.ASCENDING));\n list.add(new RowSorter.SortKey(TablesTableModel.COLUMN_CREATED, SortOrder.DESCENDING));\n setSortKeys(list);\n }\n } else {\n super.toggleSortOrder(column);\n }\n }\n };\n tableTables.setRowSorter(activeTablesSorter);\n\n // time ago\n tableTables.getColumnModel().getColumn(TablesTableModel.COLUMN_CREATED).setCellRenderer(timeAgoCellRenderer);\n // skill level\n tableTables.getColumnModel().getColumn(TablesTableModel.COLUMN_SKILL).setCellRenderer(skillCellRenderer);\n // seats\n tableTables.getColumnModel().getColumn(TablesTableModel.COLUMN_SEATS).setCellRenderer(seatsCellRenderer);\n\n /* date sorter (not need, default is good - see getColumnClass)\n activeTablesSorter.setComparator(TablesTableModel.COLUMN_CREATED, new Comparator<Date>() {\n @Override\n public int compare(Date v1, Date v2) {\n return v1.compareTo(v2);\n }\n\n });*/\n\n // seats sorter (free tables must be first)\n activeTablesSorter.setComparator(TablesTableModel.COLUMN_SEATS, new Comparator<String>() {\n @Override\n public int compare(String v1, String v2) {\n int[] seats1 = parseSeatsInfo(v1);\n int[] seats2 = parseSeatsInfo(v2);\n boolean free1 = seats1[0] != seats1[1];\n boolean free2 = seats2[0] != seats2[1];\n\n // free seats go first\n if (free1 || free2) {\n return Boolean.compare(free2, free1);\n }\n\n // all other seats go without sorts\n return 0;\n }\n });\n\n // default sort by created date (last games from above)\n ArrayList list = new ArrayList<>();\n list.add(new RowSorter.SortKey(TablesTableModel.COLUMN_SEATS, SortOrder.ASCENDING));\n list.add(new RowSorter.SortKey(TablesTableModel.COLUMN_CREATED, SortOrder.DESCENDING));\n activeTablesSorter.setSortKeys(list);\n\n TableUtil.setColumnWidthAndOrder(tableTables, DEFAULT_COLUMNS_WIDTH, KEY_TABLES_COLUMNS_WIDTH, KEY_TABLES_COLUMNS_ORDER);\n\n // 2. TABLE COMPLETED\n completedTablesSorter = new MageTableRowSorter(matchesModel);\n tableCompleted.setRowSorter(completedTablesSorter);\n\n // duration\n tableCompleted.getColumnModel().getColumn(MatchesTableModel.COLUMN_DURATION).setCellRenderer(durationCellRenderer);\n // start-end\n tableCompleted.getColumnModel().getColumn(MatchesTableModel.COLUMN_START).setCellRenderer(datetimeCellRenderer);\n tableCompleted.getColumnModel().getColumn(MatchesTableModel.COLUMN_END).setCellRenderer(datetimeCellRenderer);\n // default sort by ended date (last games from above)\n ArrayList list2 = new ArrayList<>();\n list2.add(new RowSorter.SortKey(MatchesTableModel.COLUMN_END, SortOrder.DESCENDING));\n completedTablesSorter.setSortKeys(list2);\n\n // 3. CHAT\n chatPanelMain.getUserChatPanel().useExtendedView(ChatPanelBasic.VIEW_MODE.NONE);\n chatPanelMain.getUserChatPanel().setBorder(null);\n chatPanelMain.getUserChatPanel().setChatType(ChatPanelBasic.ChatType.TABLES);\n\n // 4. BUTTONS (add new buttons to the end of the list -- if not then users lost their filter settings)\n filterButtons = new JToggleButton[]{btnStateWaiting, btnStateActive, btnStateFinished,\n btnTypeMatch, btnTypeTourneyConstructed, btnTypeTourneyLimited,\n btnFormatBlock, btnFormatStandard, btnFormatModern, btnFormatLegacy, btnFormatVintage, btnFormatPremodern, btnFormatCommander, btnFormatTinyLeader, btnFormatLimited, btnFormatOther,\n btnSkillBeginner, btnSkillCasual, btnSkillSerious, btnRated, btnUnrated, btnOpen, btnPassword, btnFormatOathbreaker, btnFormatPioneer};\n\n JComponent[] components = new JComponent[]{chatPanelMain, jSplitPane1, jScrollPaneTablesActive, jScrollPaneTablesFinished, jPanelTop, jPanelTables};\n for (JComponent component : components) {\n component.setOpaque(false);\n }\n\n jScrollPaneTablesActive.getViewport().setBackground(new Color(255, 255, 255, 50));\n jScrollPaneTablesFinished.getViewport().setBackground(new Color(255, 255, 255, 50));\n\n restoreFilters();\n setGUISize();\n\n Action openTableAction;\n openTableAction = new AbstractAction() {\n @Override\n public void actionPerformed(ActionEvent e) {\n String searchID = e.getActionCommand();\n int modelRow = TablesUtil.findTableRowFromSearchId(tableModel, searchID);\n if (modelRow == -1) {\n return;\n }\n UUID tableId = (UUID) tableModel.getValueAt(modelRow, TablesTableModel.ACTION_COLUMN + 3);\n UUID gameId = (UUID) tableModel.getValueAt(modelRow, TablesTableModel.ACTION_COLUMN + 2);\n String action = (String) tableModel.getValueAt(modelRow, TablesTableModel.ACTION_COLUMN);\n String gameType = (String) tableModel.getValueAt(modelRow, TablesTableModel.COLUMN_GAME_TYPE);\n boolean isTournament = (Boolean) tableModel.getValueAt(modelRow, TablesTableModel.ACTION_COLUMN + 1);\n String owner = (String) tableModel.getValueAt(modelRow, TablesTableModel.COLUMN_OWNER);\n String pwdColumn = (String) tableModel.getValueAt(modelRow, TablesTableModel.COLUMN_PASSWORD);\n switch (action) {\n case \"Join\":\n if (owner.equals(SessionHandler.getUserName()) || owner.startsWith(SessionHandler.getUserName() + ',')) {\n try {\n JDesktopPane desktopPane = (JDesktopPane) MageFrame.getUI().getComponent(MageComponents.DESKTOP_PANE);\n JInternalFrame[] windows = desktopPane.getAllFramesInLayer(javax.swing.JLayeredPane.DEFAULT_LAYER);\n for (JInternalFrame frame : windows) {\n if (frame.getTitle().equals(\"Waiting for players\")) {\n frame.toFront();\n frame.setVisible(true);\n try {\n frame.setSelected(true);\n } catch (PropertyVetoException ve) {\n LOGGER.error(ve);\n }\n }\n\n }\n } catch (InterruptedException ex) {\n LOGGER.error(ex);\n }\n return;\n }\n if (isTournament) {\n LOGGER.info(\"Joining tournament \" + tableId);\n if (!gameType.startsWith(\"Constructed\")) {\n if (TablesTableModel.PASSWORD_VALUE_YES.equals(pwdColumn)) {\n joinTableDialog.showDialog(roomId, tableId, true, !gameType.startsWith(\"Constructed\"));\n } else {\n SessionHandler.joinTournamentTable(roomId, tableId, SessionHandler.getUserName(), PlayerType.HUMAN, 1, null, \"\");\n }\n } else {\n joinTableDialog.showDialog(roomId, tableId, true, !gameType.startsWith(\"Constructed\"));\n }\n } else {\n LOGGER.info(\"Joining table \" + tableId);\n joinTableDialog.showDialog(roomId, tableId, false, false);\n }\n break;\n case \"Remove\":\n UserRequestMessage message = new UserRequestMessage(\"Removing table\", \"Are you sure you want to remove table?\");\n message.setButton1(\"No\", null);\n message.setButton2(\"Yes\", PlayerAction.CLIENT_REMOVE_TABLE);\n MageFrame.getInstance().showUserRequestDialog(message);\n break;\n case \"Show\":\n if (isTournament) {\n LOGGER.info(\"Showing tournament table \" + tableId);\n SessionHandler.watchTable(roomId, tableId);\n }\n break;\n case \"Watch\":\n if (!isTournament) {\n LOGGER.info(\"Watching table \" + tableId);\n SessionHandler.watchTable(roomId, tableId);\n }\n break;\n case \"Replay\":\n LOGGER.info(\"Replaying game \" + gameId);\n SessionHandler.replayGame(gameId);\n break;\n }\n }\n };\n\n Action closedTableAction;\n closedTableAction = new AbstractAction() {\n @Override\n public void actionPerformed(ActionEvent e) {\n String searchID = e.getActionCommand();\n int modelRow = TablesUtil.findTableRowFromSearchId(matchesModel, searchID);\n if (modelRow == -1) {\n return;\n }\n String action = (String) matchesModel.getValueAt(modelRow, MatchesTableModel.COLUMN_ACTION);\n switch (action) {\n case \"Replay\":\n java.util.List<UUID> gameList = matchesModel.getListofGames(modelRow);\n if (gameList != null && !gameList.isEmpty()) {\n if (gameList.size() == 1) {\n SessionHandler.replayGame(gameList.get(0));\n } else {\n gameChooser.show(gameList, MageFrame.getDesktop().getMousePosition());\n }\n }\n // MageFrame.getDesktop().showTournament(tournamentId);\n break;\n case \"Show\":\n if (matchesModel.isTournament(modelRow)) {\n LOGGER.info(\"Showing tournament table \" + matchesModel.getTableId(modelRow));\n SessionHandler.watchTable(roomId, matchesModel.getTableId(modelRow));\n }\n break;\n }\n }\n };\n\n // !!!! adds action buttons to the table panel (don't delete this)\n actionButton1 = new TablesButtonColumn(tableTables, openTableAction, tableTables.convertColumnIndexToView(TablesTableModel.ACTION_COLUMN));\n actionButton2 = new TablesButtonColumn(tableCompleted, closedTableAction, tableCompleted.convertColumnIndexToView(MatchesTableModel.COLUMN_ACTION));\n // selection\n tablesLastSelection.put(tableTables, \"\");\n tablesLastSelection.put(tableCompleted, \"\");\n addTableSelectListener(tableTables);\n addTableSelectListener(tableCompleted);\n // double click\n addTableDoubleClickListener(tableTables, openTableAction);\n addTableDoubleClickListener(tableCompleted, closedTableAction);\n }", "public TestFrame() {\n\n final String[] columnNames = {\"Nombre\",\n \"Apellido\",\n \"webeo\",\n \"Años de Practica\",\n \"Soltero(a)\"};\n final Object[][] data = {\n\n {\"Lhucas\", \"Huml\",\n \"Patinar\", new Integer(3), new Boolean(true)},\n {\"Kathya\", \"Walrath\",\n \"Escalar\", new Integer(2), new Boolean(false)},\n {\"Marcus\", \"Andrews\",\n \"Correr\", new Integer(7), new Boolean(true)},\n {\"Angela\", \"Lalth\",\n \"Nadar\", new Integer(4), new Boolean(false)}\n };\n\n Vector dataV1 = new Vector();\n dataV1.add(\"XXXX\");\n dataV1.add(\"YYYY\");\n dataV1.add(\"JJJJ\");\n\n Vector dataV2 = new Vector();\n dataV2.add(\"XX2XX\");\n dataV2.add(\"Y2YYY\");\n dataV2.add(\"J2JJJ\");\n\n List dataF = new ArrayList();\n dataF.add(dataV1);\n dataF.add(dataV2);\n\n /*Vector dataC = new Vector();\n dataC.add(\"1\");\n dataC.add(\"2\");\n dataC.add(\"J23JJJ\");\n\n //model = new ModeloDatosTabla(data, true);\n model = new TableModel_1_1(dataC, dataF);\n model2 = new TableModel(columnNames, data, false);\n*/\n\n\n\n initComponents();\n\n\n }", "@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 tablaproveedor = new javax.swing.JTable();\n jButton1 = new javax.swing.JButton();\n txtBuscar = new javax.swing.JTextField();\n\n getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n tablaproveedor.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n\n }\n ));\n tablaproveedor.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n tablaproveedorMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(tablaproveedor);\n\n getContentPane().add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 204, 385, 206));\n\n jButton1.setText(\"Buscar\");\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(322, 106, -1, -1));\n getContentPane().add(txtBuscar, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 110, 130, -1));\n\n pack();\n }", "private void initComponents() {\n\n jScrollPane2 = new javax.swing.JScrollPane();\n jTable2 = new javax.swing.JTable();\n jTextField1 = new javax.swing.JTextField();\n jMenuBar2 = new javax.swing.JMenuBar();\n jMenu4 = new javax.swing.JMenu();\n jMenuItem1 = new javax.swing.JMenuItem();\n jMenuItem2 = new javax.swing.JMenuItem();\n jMenu5 = new javax.swing.JMenu();\n jMenuItem3 = new javax.swing.JMenuItem();\n jMenuItem4 = new javax.swing.JMenuItem();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Таблица\");\n\n jTable2.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Имя\", \"eMail\", \"Номер Паспорта\", \"Номер Телефона\"\n }\n ));\n jScrollPane2.setViewportView(jTable2);\n\n jMenu4.setText(\"Изменить\");\n\n jMenuItem1.setText(\"Добавить\");\n jMenuItem1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItem1ActionPerformed(evt);\n }\n });\n jMenu4.add(jMenuItem1);\n\n jMenuItem2.setText(\"Удалить\");\n jMenuItem2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItem2ActionPerformed(evt);\n }\n });\n jMenu4.add(jMenuItem2);\n\n jMenuBar2.add(jMenu4);\n\n jMenu5.setText(\"Поиск\");\n\n jMenuItem3.setText(\"По паспорту (дерево)\");\n jMenuItem3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItem3ActionPerformed(evt);\n }\n });\n jMenu5.add(jMenuItem3);\n\n jMenuItem4.setText(\"По номеру (хэш)\");\n jMenuItem4.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItem4ActionPerformed(evt);\n }\n });\n jMenu5.add(jMenuItem4);\n\n jMenuBar2.add(jMenu5);\n\n setJMenuBar(jMenuBar2);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jTextField1, javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 583, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 284, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel2 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n jPanel1 = new javax.swing.JPanel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n tbl_shu = new javax.swing.JTable();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jPanel2.setBackground(new java.awt.Color(0, 102, 51));\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel1.setForeground(new java.awt.Color(255, 255, 255));\n jLabel1.setText(\"DAFTAR PERINCIAN SHU ANGGOTA KOPERASI\");\n\n jPanel1.setBackground(new java.awt.Color(204, 204, 204));\n\n jLabel2.setText(\"Untuk Jasa Simpanan\");\n\n jLabel3.setText(\"Untuk Jasa Pinjaman\");\n\n jLabel4.setText(\"Jumlah\");\n\n jLabel5.setText(\":\");\n\n jLabel6.setText(\":\");\n\n jLabel7.setText(\":\");\n\n tbl_shu.setBackground(new java.awt.Color(153, 255, 51));\n tbl_shu.setFont(new java.awt.Font(\"Century Gothic\", 0, 13)); // NOI18N\n tbl_shu.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n tbl_shu.setFillsViewportHeight(true);\n tbl_shu.setGridColor(new java.awt.Color(0, 102, 51));\n tbl_shu.setRowSelectionAllowed(false);\n tbl_shu.setSelectionBackground(new java.awt.Color(255, 255, 255));\n tbl_shu.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n tbl_shuMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(tbl_shu);\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 732, Short.MAX_VALUE)\n .addContainerGap())\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(33, 33, 33)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addComponent(jLabel3)\n .addComponent(jLabel4))\n .addGap(45, 45, 45)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel7)\n .addComponent(jLabel6)\n .addComponent(jLabel5))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(jLabel5))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(jLabel6))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel4)\n .addComponent(jLabel7))\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 332, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(20, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 38, Short.MAX_VALUE)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n\n pack();\n }", "@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 usrTable = new javax.swing.JTable();\n retBtn = new javax.swing.JButton();\n\n setPreferredSize(new java.awt.Dimension(472, 341));\n\n usrTable.setModel(new MyTableModel());\n jScrollPane1.setViewportView(usrTable);\n\n retBtn.setText(\"Επιστροφή\");\n retBtn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n retBtnActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1)\n .addComponent(retBtn, javax.swing.GroupLayout.Alignment.TRAILING))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 290, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(retBtn)\n .addContainerGap())\n );\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jScrollPane1 = new javax.swing.JScrollPane();\n tblAnimales = new javax.swing.JTable();\n cmbSeleccion = new javax.swing.JComboBox<>();\n cmbFiltro = new javax.swing.JComboBox<>();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n\n setBackground(new java.awt.Color(212, 255, 204));\n setPreferredSize(new java.awt.Dimension(850, 560));\n setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n jPanel1.setBackground(new java.awt.Color(0, 153, 102));\n jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n tblAnimales.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(tblAnimales);\n\n jPanel1.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 100, 770, 400));\n\n cmbSeleccion.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n jPanel1.add(cmbSeleccion, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 60, 160, -1));\n\n cmbFiltro.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n jPanel1.add(cmbFiltro, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 60, 160, -1));\n\n jLabel1.setFont(new java.awt.Font(\"Segoe UI Black\", 0, 18)); // NOI18N\n jLabel1.setForeground(new java.awt.Color(255, 255, 255));\n jLabel1.setText(\"Filtro\");\n jPanel1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 60, -1, -1));\n\n jLabel2.setBackground(new java.awt.Color(0, 51, 51));\n jLabel2.setFont(new java.awt.Font(\"Segoe UI\", 0, 20)); // NOI18N\n jLabel2.setForeground(new java.awt.Color(255, 255, 255));\n jLabel2.setText(\" Animales\");\n jLabel2.setOpaque(true);\n jPanel1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 810, 40));\n\n add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 20, 810, 520));\n }", "private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(100, 100, 450, 337);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.setResizable(false);\r\n\t\tframe.setLocationRelativeTo(null);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\t\r\n\t\tscrollPane = new JScrollPane();\r\n\t\tscrollPane.setBounds(10, 11, 424, 250);\r\n\t\tframe.getContentPane().add(scrollPane);\r\n\t\t\r\n\t\ttable = new JTable();\r\n\t\ttable.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\ttable.setModel(new DefaultTableModel(\r\n\t\t\tnew Object[][] {\r\n\t\t\t},\r\n\t\t\tnew String[] {\r\n\t\t\t\t\"ID\", \"Nome\", \"Sexo\", \"E-mail\", \"Endere\\u00E7o\"\r\n\t\t\t}\r\n\t\t));\r\n\t\tscrollPane.setViewportView(table);\r\n\t\t\r\n\t\tbtnRecarregar = new JButton(\"Recarregar\");\r\n\t\tbtnRecarregar.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tpreencherTabela();\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnRecarregar.setFont(new Font(\"Tahoma\", Font.BOLD, 12));\r\n\t\tbtnRecarregar.setBounds(328, 272, 106, 26);\r\n\t\tframe.getContentPane().add(btnRecarregar);\r\n\t\t\r\n\t\t\r\n\t\tpreencherTabela();\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 tableResult = new javax.swing.JTable();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"Histórico Parcelas a Liberar\");\n\n tableResult.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Valor\", \"Data Vencimento\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.String.class, java.lang.String.class\n };\n boolean[] canEdit = new boolean [] {\n false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n jScrollPane1.setViewportView(tableResult);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 333, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 278, Short.MAX_VALUE)\n .addContainerGap())\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n scroolPane = new javax.swing.JScrollPane();\n bookTable = new javax.swing.JTable();\n jScrollPane1 = new javax.swing.JScrollPane();\n TabelAnggota = new javax.swing.JTable();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n MasterData = new javax.swing.JLabel();\n bDashboard = new javax.swing.JLabel();\n bLogout = new javax.swing.JLabel();\n bDataPinjam = new javax.swing.JLabel();\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 jPanel1.setBackground(new java.awt.Color(255, 255, 255));\n\n bookTable.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n bookTable.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n bookTableMouseClicked(evt);\n }\n });\n scroolPane.setViewportView(bookTable);\n\n TabelAnggota.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n TabelAnggota.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n TabelAnggotaMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(TabelAnggota);\n\n jLabel4.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n jLabel4.setText(\"Data Anggota\");\n\n jLabel5.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n jLabel5.setText(\"Data Buku\");\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(42, 42, 42)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(scroolPane, javax.swing.GroupLayout.DEFAULT_SIZE, 786, Short.MAX_VALUE)\n .addComponent(jLabel4)\n .addComponent(jLabel5)\n .addComponent(jScrollPane1))\n .addContainerGap(58, Short.MAX_VALUE))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addComponent(jLabel5)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(scroolPane, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(48, 48, 48)\n .addComponent(jLabel4)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(160, Short.MAX_VALUE))\n );\n\n getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(265, 120, 886, 442));\n\n MasterData.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n MasterDataMouseClicked(evt);\n }\n });\n getContentPane().add(MasterData, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 281, 236, 58));\n\n bDashboard.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n bDashboardMouseClicked(evt);\n }\n });\n getContentPane().add(bDashboard, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 163, 236, 58));\n\n bLogout.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n bLogoutMouseClicked(evt);\n }\n });\n getContentPane().add(bLogout, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 384, 236, 58));\n\n bDataPinjam.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n bDataPinjamMouseClicked(evt);\n }\n });\n getContentPane().add(bDataPinjam, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 222, 236, 58));\n\n jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/assets/mKepalaMaster.jpg\"))); // NOI18N\n getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1181, 590));\n\n pack();\n setLocationRelativeTo(null);\n }", "@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 table = new javax.swing.JTable();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"Item - ROL\");\n setResizable(false);\n\n table.setFont(new java.awt.Font(\"Arial\", 0, 16)); // NOI18N\n table.setForeground(new java.awt.Color(0, 0, 51));\n table.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Item Code\", \"Description\", \"ROL\", \"Available Qty\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false, false, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n table.setRowHeight(25);\n table.setSelectionBackground(new java.awt.Color(0, 153, 102));\n table.setSelectionForeground(new java.awt.Color(255, 255, 204));\n table.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);\n table.getTableHeader().setReorderingAllowed(false);\n jScrollPane1.setViewportView(table);\n if (table.getColumnModel().getColumnCount() > 0) {\n table.getColumnModel().getColumn(0).setResizable(false);\n table.getColumnModel().getColumn(1).setResizable(false);\n table.getColumnModel().getColumn(3).setResizable(false);\n }\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 607, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)\n );\n\n pack();\n }", "private void prepareTable() {\n TeamsRepository tr = new TeamsRepository();\n //ka uradim ovo dle odma mi samo inicijalizuje tabelu\n// tblTeams.setModel(new TeamsTableModel(tr.getTeams()));\n// ni ovaj kod mi nista nije radio\n// TeamsTableModel ttm = new TeamsTableModel(tr.getTeams());\n TableColumnModel tcm = tblTeams.getColumnModel();\n TableColumn tc = tcm.getColumn(1);\n TableCellEditor tce = new DefaultCellEditor(getComboBox());\n tc.setCellEditor(tce);\n }", "void initTable();", "private void AdditionalSetUpTable() {\n TableColumnModel stuffcm = stuffTable.getColumnModel();\n \n //update: 22 juni 2006 add column code and modal so we can remove them in propertiesComboBox\n //ActionPerformed when we click \"Additonal Properties\"\n //we have to reference name column so we can put category and code column\n //in the left of the name column\n category = stuffcm.getColumn(0);\n code = stuffcm.getColumn(1);\n \n modal = stuffcm.getColumn(3);\n sale = stuffcm.getColumn(4);\n quantity = stuffcm.getColumn(5);\n \n //update: 2 july 2006, add two column; s = t, Third T\n s_t = stuffcm.getColumn(17);\n third = stuffcm.getColumn(18);\n \n //make it middle\n class MiddleCellEditor extends DefaultTableCellRenderer {\n MiddleCellEditor() {\n super();\n setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n }\n }\n quantity.setCellRenderer( new MiddleCellEditor() );\n \n length = stuffcm.getColumn(8);\n length.setCellRenderer( new MiddleCellEditor() );\n width = stuffcm.getColumn(9);\n width.setCellRenderer( new MiddleCellEditor() );\n height = stuffcm.getColumn(10);\n height.setCellRenderer( new MiddleCellEditor() );\n volume = stuffcm.getColumn(11);\n volume.setCellRenderer( new MiddleCellEditor() );\n primary = stuffcm.getColumn(12);\n measurement = stuffcm.getColumn(13);\n measurement.setCellRenderer( new MiddleCellEditor() );\n secondary = stuffcm.getColumn(14);\n produceritem = stuffcm.getColumn(15);\n selleritem = stuffcm.getColumn(16);\n //index column\n TableColumn stuffcol = stuffcm.getColumn(7);\n stuffTable.removeColumn(stuffcol);\n //comment column\n stufftc = stuffTable.getColumnModel().getColumn(6);\n if(!displayComment.isSelected())\n stuffTable.removeColumn(stufftc);\n \n //remove all column first for the first time\n stuffTable.removeColumn(modal);\n stuffTable.removeColumn(sale);\n stuffTable.removeColumn(quantity);\n stuffTable.removeColumn(code);\n stuffTable.removeColumn(category);\n stuffTable.removeColumn(s_t);\n stuffTable.removeColumn(third);\n \n propertiesComboBoxActionPerformed(null);\n \n //additional setup for \"index\" and \"comment\" column on employeeTable\n TableColumnModel employeecm = employeeTable.getColumnModel();\n //index column\n TableColumn employeecol = employeecm.getColumn(9);\n employeeTable.removeColumn(employeecol);\n //comment column\n employeetc = employeecm.getColumn(8);\n if(!displayCommentEmployee.isSelected())\n employeeTable.removeColumn(employeetc);\n \n //additional setup for sellerTable\n TableColumnModel sellercm = sellerTable.getColumnModel();\n //index column\n TableColumn sellercol = sellercm.getColumn(4);\n sellerTable.removeColumn(sellercol);\n //comment column\n sellertc = sellercm.getColumn(3);\n if(!displayCommentSeller.isSelected())\n sellerTable.removeColumn(sellertc);\n \n //additional setup for salesmanTable\n TableColumnModel salesmancm = salesmanTable.getColumnModel();\n //index column\n TableColumn salesmancol = salesmancm.getColumn(8);\n salesmanTable.removeColumn(salesmancol);\n //comment column\n salesmantc = salesmancm.getColumn(7);\n if(!displayCommentSeller.isSelected())\n salesmanTable.removeColumn(salesmantc);\n \n //additional setup for ProducerTable\n TableColumnModel producercm = ProducerTable.getColumnModel();\n //index column\n TableColumn producercol = producercm.getColumn(4);\n ProducerTable.removeColumn(producercol);\n //comment column\n producertc = producercm.getColumn(3);\n if(!DisplayCommentProducer.isSelected())\n ProducerTable.removeColumn(producertc);\n \n //additional setup for customerTable\n TableColumnModel customercm = customerTable.getColumnModel();\n //index column\n TableColumn customercol = customercm.getColumn(4);\n customerTable.removeColumn(customercol);\n //comment column\n customertc = customercm.getColumn(3);\n if(!displayCommentCustomer.isSelected())\n customerTable.removeColumn(customertc);\n \n //additional setup for commisionerTable\n TableColumnModel commisionercm = commisionerTable.getColumnModel();\n //index column\n TableColumn commisionercol = commisionercm.getColumn(4);\n commisionerTable.removeColumn(commisionercol);\n //comment columnlist\n commisionertc = commisionercm.getColumn(3);\n if(!displayCommentCommisioner.isSelected())\n commisionerTable.removeColumn(commisionertc);\n \n //additional setup for debtcreditTable\n// TableColumn debtcreditcol = DebtCreditTable.getColumnModel().getColumn(5);\n// DebtCreditTable.removeColumn(debtcreditcol);\n \n //additional setup for debt table\n TableColumn debtcol = DebtTable.getColumnModel().getColumn(5);\n DebtTable.removeColumn(debtcol);\n \n //additional setup for sale ( edit trans ) table\n TableColumn salecol = SaleTable.getColumnModel().getColumn(6);\n SaleTable.removeColumn(salecol);\n \n //additional setup for purchase ( edit trans ) table\n TableColumn purchasecol = PurchaseTable.getColumnModel().getColumn(6);\n PurchaseTable.removeColumn(purchasecol);\n \n //additional setup for credit table\n TableColumn creditcol = CreditTable.getColumnModel().getColumn(5);\n CreditTable.removeColumn(creditcol);\n \n //additional setup for warehouseTB\n TableColumn warehouseindexcol = WarehouseTB.getColumnModel().getColumn(3);\n WarehouseTB.removeColumn(warehouseindexcol);\n \n //additional setup for containerTB\n TableColumn containerindexcol = ContainerTB.getColumnModel().getColumn(4);\n ContainerTB.removeColumn(containerindexcol);\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n scrollPane = new javax.swing.JScrollPane();\n gridview = new javax.swing.JTable();\n\n gridview.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n scrollPane.setViewportView(gridview);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(16, 16, 16)\n .addComponent(scrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 913, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(23, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(22, 22, 22)\n .addComponent(scrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 572, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(27, Short.MAX_VALUE))\n );\n }", "public TabelaDoces() {\n initComponents();\n }", "@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 tbl_listado = new javax.swing.JTable();\n jLabel1 = new javax.swing.JLabel();\n btn_mostrar = new javax.swing.JButton();\n btn_agregar = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);\n jScrollPane1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);\n\n tbl_listado.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {\"Borrador\", new Float(12500.0), new Integer(50), null, null},\n {\"Marcador\", new Float(1500.0), new Integer(170), null, null},\n {\"Hoja carta\", new Float(2580.0), new Integer(9000), null, null},\n {\"Cartuchera\", new Float(2580.0), new Integer(60), null, null}\n },\n new String [] {\n \"Producto\", \"Precio\", \"Existenia\", \"Excento\", \"Iva\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.Object.class, java.lang.Float.class, java.lang.Integer.class, java.lang.Boolean.class, java.lang.Float.class\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n });\n tbl_listado.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n tbl_listadoMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(tbl_listado);\n\n jLabel1.setText(\"Listado de productos\");\n\n btn_mostrar.setText(\"Mostrar\");\n btn_mostrar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_mostrarActionPerformed(evt);\n }\n });\n\n btn_agregar.setText(\"Agregar\");\n btn_agregar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_agregarActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(btn_mostrar)\n .addGap(78, 78, 78))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(btn_agregar)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 543, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(35, 35, 35))))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(44, 44, 44)\n .addComponent(btn_agregar)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE)\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(31, 31, 31)\n .addComponent(btn_mostrar)\n .addGap(67, 67, 67))\n );\n\n pack();\n }" ]
[ "0.7800868", "0.7678735", "0.7626001", "0.75820327", "0.7552147", "0.75517416", "0.7513352", "0.7512483", "0.73573434", "0.73411417", "0.7323721", "0.7253802", "0.72468495", "0.72462815", "0.7206039", "0.72052056", "0.720464", "0.7167837", "0.71605504", "0.7144345", "0.7143619", "0.71415865", "0.71410745", "0.71346164", "0.71089405", "0.7097956", "0.7079864", "0.707203", "0.7062632", "0.7058589", "0.70508075", "0.7035618", "0.70216745", "0.70201725", "0.70005393", "0.6989902", "0.69781756", "0.6977763", "0.69654864", "0.6960791", "0.69535625", "0.695258", "0.6952086", "0.6937725", "0.692122", "0.69204193", "0.6903682", "0.68973434", "0.6893423", "0.6892624", "0.68674344", "0.6867251", "0.6865813", "0.68615705", "0.685908", "0.6858821", "0.6842712", "0.6837218", "0.68148685", "0.67994934", "0.6797372", "0.6794781", "0.6790739", "0.67667025", "0.6762006", "0.6753692", "0.67348903", "0.67308766", "0.6729992", "0.67295253", "0.67276615", "0.67204773", "0.6719611", "0.6716646", "0.67095584", "0.6702555", "0.6701664", "0.6699702", "0.6697593", "0.6691281", "0.668101", "0.6680281", "0.6679398", "0.6678061", "0.66737866", "0.6672102", "0.6664817", "0.6651015", "0.6645432", "0.66354674", "0.66266805", "0.66262496", "0.6624067", "0.66196656", "0.66195333", "0.66191363", "0.6617106", "0.6616802", "0.6613582", "0.6612806", "0.6610316" ]
0.0
-1
GENLAST:event_clearActionPerformed to Select a particular item
private void jtMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jtMouseClicked selectDetailWithMouse(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void btn_clearitemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_clearitemActionPerformed\n //Code to remove only item detailsdsfsdf\n txt_iniId.setText(\"\");\n cbo_iniName.setSelectedItem(0);\n txt_inQty.setText(\"\");\n }", "public void selectItem(int i) {\n checkIndex(i);\n selectedItem = i;\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tROOM.setSelectedItem(\"\");\n\t\t\t\ttxtrent.setText(\"\");\n\t\t\t\ttxtSeat.setText(\"\");\n\t\t\t\tgrp.clearSelection();\n\t\t\t}", "@Override\n public void selectItem(String selection) {\n vendingMachine.setSelectedItem(selection);\n vendingMachine.changeToHasSelectionState();\n }", "@Override\r\n\t\t\tpublic void seleccionar() {\n\r\n\t\t\t}", "@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tif (jcb.isSelected()) {\n\t\t\t\t\t\tselectList.add(new Integer(site));\n\t\t\t\t\t\t//System.out.println(selectList);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tselectList.remove(new Integer(site));\n\t\t\t\t\t\t//System.out.println(selectList);\n\t\t\t\t\t}\n\t\t\t\t}", "public void invSelected()\n {\n\t\t//informaPreUpdate();\n \tisSelected = !isSelected;\n\t\t//informaPostUpdate();\n }", "@Override\r\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tListSelectionModel lsm = list.getSelectionModel();\r\n\t\t\tint selected = lsm.getMinSelectionIndex();\r\n\r\n\t\t\tItemView itemView = (ItemView) list.getModel().getElementAt(selected);\r\n\r\n\t\t\t// change item\r\n\t\t\tJOptionPane options = new JOptionPane();\r\n\t\t\tObject[] addFields = { \"Name: \", nameTextField, \"Price: \", priceTextField, \"URL: \", urlTextField, };\r\n\t\t\tint option = JOptionPane.showConfirmDialog(null, addFields, \"Edit item\", JOptionPane.OK_CANCEL_OPTION);\r\n\t\t\tif (option == JOptionPane.OK_OPTION) {\r\n\t\t\t\tString name = nameTextField.getText();\r\n\t\t\t\tString price = priceTextField.getText();\r\n\t\t\t\tString url = urlTextField.getText();\r\n\r\n\t\t\t\tdouble doublePrice = Double.parseDouble(price);\r\n\r\n\t\t\t\titemView.getItem().setName(name);\r\n\t\t\t\titemView.getItem().setCurrentPrice(doublePrice);\r\n\t\t\t\titemView.getItem().setUrl(url);\r\n\t\t\t\t// clear text fields\r\n\t\t\t\tnameTextField.setText(\"\");\r\n\t\t\t\tpriceTextField.setText(\"\");\r\n\t\t\t\turlTextField.setText(\"\");\r\n\t\t\t}\r\n\t\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tjtp.setSelectedIndex(1);\r\n\t\t\t}", "private void doSelect() {\n this.setVisible(false);\n }", "public void itemSelected(boolean selected);", "public void selected(String action);", "public void consoleSelectItem() throws SQLException{\n System.out.println(\"came here\");\n ConsoleClass obj = new ConsoleClass();\n String item = console_actionItemList.getSelectionModel().getSelectedItem();\n obj.consoleSelectItem(this,item);\n }", "private void ComboUserActionPerformed(java.awt.event.ActionEvent evt) {\n if(ComboUser.getSelectedItem().equals(\"title\")){\n \n selected=1;\n }\n else if(ComboUser.getSelectedItem().equals(\"author\"))\n {\n selected=2;\n }\n else if(ComboUser.getSelectedItem().equals(\"subject\"))\n {\n selected=3;\n }\n }", "@FXML\n\tpublic void setSelectedItem(MouseEvent event) {\n\t\ttry {\n\t\t\tString s=inventoryList.getSelectionModel().getSelectedItem();\t// Get selected item\n\t\t\tItem i=Item.getItem(ItemList, s);\n\t\t\titemselect.setText(s);\t// Set selected item information\n\t\t\tif(i.getStat().equals(\"HP\"))\n\t\t\t\titemStats.setText(\"+\"+i.getChange()+\" Health\");\n\t\t\telse if(i.getStat().equals(\"DMG\"))\n\t\t\t\titemStats.setText(\"+\"+i.getChange()+\" Damage\");\n\t\t\telse\n\t\t\t\titemStats.setText(\"+\"+i.getChange()+\" Evasion\");\n\t\t} catch(Exception e) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t}", "@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 actionPerformed(ActionEvent e) {\n\t\t\t\t\tpistaseleccionada = (int) pista.getSelectedItem();\r\n\r\n\t\t\t\t}", "public void select(int index) {\r\n\t\tindirect = true;\r\n\t\tcombo.select(index);\r\n\t\tindirect = false;\r\n\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t\tItemType i = getSelectedItem();\n\t\t\t\tif(i != null)\n\t\t\t\t{\t\n\n\t\t\t\t\tfinal String msg = \"Delete \"+i.getName() + \"?\";\n\t\t\t\t\tif(!confirmDelete(msg))\n\t\t\t\t\t\treturn;\n\t\t\t\t\ti.removeContainer(GeneralItemList.this);\n\t\t\t\t\ti.destroy();\n\t\t\t\t}\n\t\t\t\titems.remove(i);\n\t\t\t\tlist.clearSelection();\n\t\t\t\tlist.repaint(100);\t\t\t\t\n\t\t\t}", "@Override\n\tpublic void itemStateChanged(ItemEvent e) {\n\t\tString res = jc.getSelectedItem().toString();\n\t\tjt.setText(res);\n\n\t}", "@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}", "public void setSelectedItem(int selectedItem) {\n setSelectedItem(selectedItem, true);\n }", "protected void ACTION_B_SELECT(ActionEvent arg0) {\n\t\tchoseInterface();\r\n\t}", "@Override\n\t\t\tpublic void itemStateChanged(ItemEvent e) {\n\t\t\t\tint state = e.getStateChange();\n\t\t\t\tif(state == ItemEvent.SELECTED){\n\t\t\t\t\tsetGoodsId();\n\t\t\t\t}else{\n\t\t\t\t\tgoods_id=null;\n\t\t\t\t}\n\t\t\t}", "@Override\n public void valueChanged(javax.swing.event.ListSelectionEvent e)\n {\n this.choice = e.getFirstIndex();\n }", "public void removeSelectedItem() {\r\n\t\tint i = getSelectedIndex();\r\n\t\tif(i != -1)\r\n\t\t\tlistModel.removeElementAt(i);\r\n\t}", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n selectItem(position);\n }", "public void selectItem() throws Exception {\n\t\tQTiumAutomation.sleep(5);\n\t\tthis.removeHeader();\n\t\tSystem.out.println(\"select an item at RankingPage...\");\n\t\tQTiumAutomation.clickRandomItem(RankingPageEntity.ITEM_LINK, 10);\n\t}", "public void setSelectedItem(Gnome selectedItem) {\n this.selectedItem = selectedItem;\n }", "private void itemSelected(){\n \t//* count selected items\n \tint c=0;\n \tfor (int i = 0; i<jTable4.getRowCount(); i++){\n \t\tif((Boolean)jTable4.getModel().getValueAt(i, 0)){\n \t\t\tc++;\n \t\t}\n \t}\n \tif(c==0){\n \t\treturn; //* if no item selected then do nothing\n \t}\n \t\n \t//* get the new selected items\n \tString[][] tmp1=new String[c][2];\n \tfor (int i = 0, j=0; i<jTable4.getRowCount(); i++){\n \t\tif((Boolean)jTable4.getModel().getValueAt(i, 0)){\n \t\t\ttmp1[j]=new String[2];\n \t\t\ttmp1[j][0]=jTable4.getModel().getValueAt(i, 1).toString();\n \t\t\ttmp1[j++][1]=\"0\";\n \t\t}\n \t}\n \t\n \t//* get the previously selected items\n \tString[][] tmp2=new String[jTable3.getModel()==null? 0: jTable3.getModel().getRowCount()][9];\n \tfor (int i = 0; i<tmp2.length; i++){\n \t\ttmp2[i]=new String[9];\n \t\ttmp2[i][0]=jTable3.getModel().getValueAt(i, 1).toString();\n \t\ttmp2[i][1]=jTable3.getModel().getValueAt(i, 2).toString();\n \t\ttmp2[i][2]=jTable3.getModel().getValueAt(i, 3).toString();\n \t\ttmp2[i][3]=jTable3.getModel().getValueAt(i, 5).toString();\n \t\ttmp2[i][4]=jTable3.getModel().getValueAt(i, 7).toString();\n \t\ttmp2[i][5]=jTable3.getModel().getValueAt(i, 9).toString();\n \t\ttmp2[i][6]=jTable3.getModel().getValueAt(i, 11).toString();\n \t\ttmp2[i][7]=jTable3.getModel().getValueAt(i, 13).toString();\n \t\ttmp2[i][8]=jTable3.getModel().getValueAt(i, 15).toString();\n \t}\n \tfillPoDet(tmp2, tmp1); //* reconstruct PO table\n \tjTabbedPane1.setSelectedIndex(0);\n }", "@Override\n\t\t\t\t\tpublic void OnSelectItem(Item item) {\n\n\t\t\t\t\t\tif(!toDelete.contains(item))\n\t\t\t\t\t\t\ttoDelete.add(item);\n\t\t\t\t\t}", "@Override\r\n @Test\r\n public void testSelectedOnClearItemsSingle() {\r\n int index = 2;\r\n getSelectionModel().select(index);\r\n TreeItem parent = getSelectedItem().getParent();\r\n int parentIndex = getView().getRow(parent);\r\n clearItems();\r\n if (getSelectionModel().isEmpty()) {\r\n assertTrue(\"selection must be empty\", getSelectionModel().isEmpty());\r\n assertEquals(-1, getSelectedIndex());\r\n assertEquals(null, getSelectedItem());\r\n assertTrue(\"\", getSelectedIndices().isEmpty());\r\n assertTrue(\"\", getSelectedItems().isEmpty());\r\n// assertEquals(\"focus must be cleared\", -1, getFocusModel()\r\n// .getFocusedIndex());\r\n } else {\r\n assertEquals(\"selectedIndex at parentIndex\", parentIndex, getSelectedIndex());\r\n assertEquals(\"parent must be selected after clearing \", parent, \r\n getSelectedItem());\r\n }\r\n }", "@Override\r\n\tpublic void itemStateChanged(ItemEvent e) {\n\t\tif(e.getStateChange()== ItemEvent.SELECTED){\r\n\t\t\tcargarCantidades();\r\n\t\t\tactivarBoton();\r\n\t\t}\r\n\t}", "public void showSelection () {\n checkWidget();\n if( selectedIndex != -1 ) {\n showItem( getSelection() );\n }\n }", "@Override\n public void deselectGolem() {\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}", "public void actionPerformed(ActionEvent e) {\n\t\t\treplaceSelection(\"\");\n\t\t}", "private void cbo_iniNameItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cbo_iniNameItemStateChanged\n if(listLoaded) {\n String sql = \"select * from item where iName=?\";\n \n try {\n pst = conn.prepareStatement(sql);\n pst.setString(1,cbo_iniName.getSelectedItem().toString());\n rs = pst.executeQuery();\n rs.next(); //Move resultset to the first pointer\n\n txt_iniId.setText(rs.getString(1));\n\n }catch(Exception e) {\n JOptionPane.showMessageDialog(null,\"Item details cannot be found\");\n }finally {\n try{\n rs.close();\n pst.close();\n }catch(Exception e) {}\n }\n }\n }", "@Override\n public void selectGolem(int id) {\n }", "private void select(ActionEvent e){\r\n // Mark this client as an existing client since they are in the list\r\n existingClient = true;\r\n // To bring data to Management Screen we will modify the text fields\r\n NAME_FIELD.setText(client.getName());\r\n ADDRESS_1_FIELD.setText(client.getAddress1());\r\n ADDRESS_2_FIELD.setText(client.getAddress2());\r\n CITY_FIELD.setText(client.getCity());\r\n ZIP_FIELD.setText(client.getZip());\r\n COUNTRY_FIELD.setText(client.getCountry());\r\n PHONE_FIELD.setText(client.getPhone());\r\n // client.setAddressID();\r\n client.setClientID(Client.getClientID(client.getName(), client.getAddressID()));\r\n // Pass client information to Client Management Screen\r\n currClient = client;\r\n back(e);\r\n }", "@Override\r\n\t\t\tpublic void itemStateChanged(ItemEvent e) {\n\t\t\t\tif (e.getStateChange() == ItemEvent.SELECTED) { \r\n\t\t\t\t\tselectSource(e.getItem());\r\n\t\t\t\t}\r\n\t\t\t}", "protected void select() {\n\t\tcleanValues();\n\t\tint row = m_table.getSelectedRow();\n\t\tboolean enabled = row != -1;\n\t\tif (enabled)\n\t\t{\n\t\t\tInteger ID = m_table.getSelectedRowKey();\n\t\t\tif (ID != null)\n\t\t\t{\n\t\t\t\tm_C_Order_ID = ID.intValue();\n\t\t\t}\n\t\t}\n\t\tlog.info(\"ID=\" + m_C_Order_ID); \n\t}", "public void select(T item) {\n getElement().select(SerDes.mirror(item));\n }", "public void itemStateChanged (ItemEvent event)\n {\n ((GroupItem)gbox.getSelectedItem()).activate();\n }", "public void selectItem(int index) {\n for (int i = 0; i < getWidgetCount(); i++) {\n Widget item = getWidget(i);\n\n if (item instanceof AbstractListItem) {\n ((AbstractListItem) item).setActive(i == index);\n }\n }\n }", "public void mouseClicked(MouseEvent event) {\n\t\tif (toSelectOrNot) {\n\t \t\tPoint p = event.getPoint();\n\t \t\tselectCmd.addToSet(dwg, p);\n\t \t\trepaint();\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}", "default public void clickSelect() {\n\t\tremoteControlAction(RemoteControlKeyword.SELECT);\n\t}", "public void setSelectedItem(BrowseItem selectedItem)\r\n\t{\r\n\t\tthis.selectedItem = selectedItem;\r\n\t}", "public void select(int action) {\n\t\tselected = true;\n\t\tthis.action = action;\n\t}", "@Override\n public void onNothingSelected(AdapterView<?> parent) {\n choice=0;\n }", "@Override\r\n\tpublic void itemStateChanged(ItemEvent e) {\n\t\tint a=c1.getSelectedIndex();\r\n\t\tString b=c1.getItemAt(a).toString();\r\n\t\tl1.setText(\"\"+b);\r\n\t}", "@Override\n public void pickItem(int position) {\n setProductPicked(-1, position);\n }", "@Override\r\n\t\t\tpublic void itemStateChanged(ItemEvent e) {\n\t\t\t\tif(e.getStateChange() == ItemEvent.SELECTED)\r\n\t\t\t\t\tcodigoResponsavel = responsaveis.get(jcResponsavel.getSelectedIndex() -1 ).getCodigo();\r\n\t\t\t}", "public void actionPerformed(ActionEvent ae) {\n rb_selection = ae.getActionCommand(); \t \n }", "@Override\n\t\t\tpublic void itemStateChanged(ItemEvent e) {\n\t\t\t\tif(e.getStateChange() == ItemEvent.SELECTED){\n\t\t\t\t\tint box_index = namedaction_ComboBox.getSelectedIndex();\n\t\t\t\t\tNode n = rm.applySelectionCases(rule_namedaction_node, box_index);\n\t\t\t\t\trule_namedaction_node.replace(n);\n\t\t\t\t}\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\tint selectedRow = table.getSelectedRow();//获得选中行的索引\n\t\t\t\tif(selectedRow!= -1) //是否存在选中行\n\t\t\t {\n\t\t\t Object oa = tableModel.getValueAt(selectedRow, 0);\n\t\t\t Object ob = tableModel.getValueAt(selectedRow, 1);\n\t\t\t comboBox_1.setSelectedItem(oa.toString());\n\t\t\t textField2.setText(ob.toString());\n\t\t\t }\n\t\t\t else{\n\t\t\t textField2.setText(\"\");\n\t\t\t }\n\t\t\t}", "@Override\r\n protected TreeItem getSelectedItem() {\r\n return getSelectionModel().getSelectedItem();\r\n }", "void itemSelected(OutlineItem item);", "public void deselect(T item) {\n getElement().deselect(SerDes.mirror(item));\n }", "@Override\r\n\tpublic void setSelectedItem(Object anItem) {\n c=(Category) anItem;\r\n\t}", "public void itemsSelected() {\n getEntitySelect().close();\n Collection<T> selectedValues = getEntitySelect().getResults().getSelectedValues();\n setReferencesToParentAndPersist((T[]) selectedValues.toArray());\n showAddSuccessful();\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n optionEnvoi = choixMessage.getItemAt(choixMessage.getSelectedIndex());\n }", "@Override\n public void onNothingSelected(AdapterView<?> parent) {\n mFruit = FruitEntry.TYPE_NOTSELECTED;\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent cb_e) {\n\t\t\t\tinx3 = cb[3].getSelectedIndex();\n\t\t\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 selectTDList(ActionEvent actionEvent) {\n // we will have to update the viewer so that it is displaying the list that was just selected\n // it will go something like...\n // grab the list that was clicked by the button (again, using the relationship between buttons and lists)\n // and then displayTODOs(list)\n }", "private void selectDetailWithMouse() {\n int selectedRowIndex=jt.convertRowIndexToModel(jt.getSelectedRow());\n String[] choices={\"Update Row\",\"Delete\",\"Cancel\"};\n int option=JOptionPane.showOptionDialog(rootPane, \"Product ID: \"+jtModel.getValueAt(selectedRowIndex, 0).toString()+\"\\n\"+\"Product Name: \"+jtModel.getValueAt(selectedRowIndex,1), \"View Data\", WIDTH, HEIGHT,null , choices, NORMAL);\n if(option==0)\n {\n tfPaintId.setText(jtModel.getValueAt(selectedRowIndex,0).toString());\n tfName.setText(jtModel.getValueAt(selectedRowIndex, 1).toString());\n tfPrice.setText(jtModel.getValueAt(selectedRowIndex, 2).toString());\n tfColor.setText(jtModel.getValueAt(selectedRowIndex, 3).toString());\n tfQuantity.setText(jtModel.getValueAt(selectedRowIndex, 8).toString());\n rwCombo.setSelectedItem(jtModel.getValueAt(selectedRowIndex, 4));\n typeCombo.setSelectedItem(jtModel.getValueAt(selectedRowIndex, 6));\n bCombo.setSelectedItem(jtModel.getValueAt(selectedRowIndex, 5));\n switch(jtModel.getValueAt(selectedRowIndex, 7).toString()) {\n case \"High\":\n high.setSelected(true);\n break;\n case \"Mild\":\n mild.setSelected(true);\n break;\n case \"Medium\":\n medium.setSelected(true);\n break;\n }\n }\n else if(option==1)\n {\n jtModel.removeRow(selectedRowIndex);\n JOptionPane.showMessageDialog(rootPane,\" Detail successfully deleted\");\n }\n else \n {\n \n } \n }", "@Override\n\tpublic void selecciona() {\n\t\tClienteProxy bean = grid.getSelectionModel().getSelectedObject();\n\t\tif(bean!=null){\t\t\t\t\n\t\tuiHomePrestamo.getHeader().getLblTitulo().setText(\"Devolpay\");\n\t\tuiHomePrestamo.getHeader().setVisibleBtnMenu(true);\t\t\n\t\tuiHomePrestamo.getUIMantPrestamoImpl().setBeanCliente(bean);\n\t\tuiHomePrestamo.getContainer().showWidget(1);\t\t\n\t\t}else{\n\t\t\t//Dialogs.alert(constants.alerta(), constants.seleccioneCliente(), null);\n\t\t\t//Window.alert(constants.seleccioneCliente());\n\t\t\tNotification not=new Notification(Notification.ALERT,constants.seleccioneCliente());\n\t\t\tnot.showPopup();\n\t\t}\n\t}", "void onItemSelected(int index, T item) throws RemoteException;", "public void widgetSelected(SelectionEvent e) {\n table.setSelection(new TableItem[]{cursor.getRow()});\n }", "public void emptyMovieSelected(){\n //get empty movie item\n mMovie = mMovieStaff.getEmptyMovie();\n\n //show movie item\n showMovieInfo(mMovie);\n }", "@Override\n\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,\n\t\t\t\t\t\t\t\t\t\t\t\tint which) {\n\t\t\t\t\t\t\t\tadapter.setSelectedItem(which);\n\t\t\t\t\t\t\t\tadapter.notifyDataSetChanged();\n\t\t\t\t\t\t\t\tadapter.notifyDataSetInvalidated();\n\t\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,\n\t\t\t\t\t\t\t\t\t\t\t\tint which) {\n\t\t\t\t\t\t\t\tadapter.setSelectedItem(which);\n\t\t\t\t\t\t\t\tadapter.notifyDataSetChanged();\n\t\t\t\t\t\t\t\tadapter.notifyDataSetInvalidated();\n\t\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,\n\t\t\t\t\t\t\t\t\t\t\t\tint which) {\n\t\t\t\t\t\t\t\tadapter.setSelectedItem(which);\n\t\t\t\t\t\t\t\tadapter.notifyDataSetChanged();\n\t\t\t\t\t\t\t\tadapter.notifyDataSetInvalidated();\n\t\t\t\t\t\t\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t\t\trutaseleccionada = (String) rodadura.getSelectedItem();\r\n\r\n\t\t\t\t}", "private void select(int row, int column) {\n \n if (recordList != null && entryForm != null) {\n currentColumn = column;\n if (currentRow != row) {\n currentRow = row;\n recordList.setSelectedIndex(row);\n }\n recordForm.setFocusAt(column);\n }\n \n }", "private void materiaSelecionada(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_materiaSelecionada\n if (cbox1Materia.getSelectedIndex() != 0) {\n materiaSeleccionada = true;\n buscarEvaluacion();\n vaciarTabla();\n } else {\n materiaSeleccionada = false;\n vaciarTabla();\n cbox3Evaluacion.removeAllItems();\n cbox3Evaluacion.addItem(\"Seleccione una opción\");\n }\n\n }", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\tselect();\n\t\te.consume();\n\t}", "public void selectAt(MouseEvent e) {\r\n \t\tactivateSelect();\r\n \t\tmouseListner.mousePressed(e);\r\n \t}", "public void setSelectedItem(Object anItem)\n/* */ {\n/* 49 */ this.c = ((Category)anItem);\n/* */ }", "@Test(groups = \"smoke\")\n public void testKeepSelected() {\n String textSource = pickList.advanced().getSourceList().getItem(0).getText();\n pickList.add(0);\n ListItem item = pickList.advanced().getTargetList().getItem(0);\n assertTrue(item.getRootElement().getAttribute(\"class\").contains(\"rf-pick-sel\"));\n assertEquals(item.getText(), textSource);\n\n pickList.remove(0);\n item = pickList.advanced().getSourceList().getItem(ChoicePickerHelper.byIndex().last());\n assertTrue(item.getRootElement().getAttribute(\"class\").contains(\"rf-pick-sel\"));\n assertEquals(item.getText(), textSource);\n assertEquals(Utils.getIndexOfElement(item.getRootElement()), pickList\n .advanced().getSourceList().size() - 1, \"Index of removed item.\");\n }", "@Override\n\tpublic void unselect() {\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tgsv.startSelectState();\n\t\t\t}", "public void itemStateChanged(ItemEvent ie) {\n JCheckBox check = (JCheckBox)ie.getSource();\n cb_selection = check.getText(); \n }", "public void setSelection(int index) {\n checkWidget();\n int count = OS.SendMessage(handle, OS.TCM_GETITEMCOUNT, 0, 0);\n if (!(0 <= index && index < count))\n return;\n setSelection(index, false);\n }", "public void clearSelection()\n\t{\n\t\tgetObject().clearSelection();\n\t\treturn;\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent cb_e) {\n\t\t\t\tinx0 = cb[0].getSelectedIndex();\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tString input = (String)comboBoxProductTitle.getSelectedItem();\n\t\t\t\t//String input = productTitleTextField.getText();\n\t\t\t\t\n\t\t\t\tif(input.trim().equals(\"Select\")){ \n\t\t\t\t\tproductTextArea.setText(\"\");\n\t\t\t\t\tproductTextArea.setCaretPosition(0);\n\t\t\t\t\tlistOfProdIds.setSelectedItem(\"Select\");\n\t\t\t\t\tlistOfProductAuthor.setSelectedItem(\"Select\");\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Please Select Product Title From Drop Down Menu\");\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\tproductTextArea.setText(product.viewProductByTitle(input, products));\t//viewInvoiceByCustomer() is in the Invoice class\n\t\t\t\t\tproductTextArea.setCaretPosition(0);\n\t\t\t\t\tlistOfProdIds.setSelectedItem(\"Select\");\n\t\t\t\t\tlistofProductTitle.setSelectedItem(\"Select\");\n\t\t\t\t\tlistOfProductAuthor.setSelectedItem(\"Select\");\n\t\t\t\t\tpriceRange.clearSelection();\n\t\t\t\t\tquantity.clearSelection();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}", "public void selectPressed() {\n\t\tif (edit) {\n\t\t\tdisplayCardHelp = !displayCardHelp;\n\t\t} else {\n\t\t\tSoundPlayer.playSound(SoundMap.MENU_ERROR);\n\t\t}\n\t}", "@Override\n public void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\ttable.setSelection(new TableItem[] {tcursor.getRow()});\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif(cbElPuesto.getSelectedIndex()!=0) {\n\t\t\t\t\tString eliminar=((String) cbElPuesto.getSelectedItem());\n\t\t\t\t\tSystem.out.println(eliminar);\n\t\t\t\t\tdata.setQuery(\"DELETE FROM TipoPuesto WHERE puesto='\"+eliminar+\"'\");\n\t\t\t\t\tcbElPuesto.removeAllItems();\n\t\t\t\t\tcbEdPuesto.removeAllItems();\n\t\t\t\t\tcbElPuesto.addItem(\"Seleccione un hospital...\");\n\t\t\t\t\tcbEdPuesto.addItem(\"Seleccione un hospital...\");\n\t\t\t\t\tJOptionPane.showMessageDialog(btnEliminar,\"Eliminación exitosa\");\n\t\t\t\t\tregistros=(ResultSet) data.getQuery(\"Select * from TipoPuesto\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\twhile(registros.next()) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcbElPuesto.addItem(registros.getString(\"puesto\"));\n\t\t\t\t\t\t\tcbEdPuesto.addItem(registros.getString(\"puesto\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (SQLException e1) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t}else {\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t}", "@SuppressWarnings(\"rawtypes\")\n\t@Override\n\tpublic void itemStateChanged(ItemEvent arg0) {\n\n\t\t/* If it is a selection event, and not a de-selection event (both are typically fired\n\t\t * when the combo box is changed) */\n\t\tif (arg0.getStateChange() == ItemEvent.SELECTED) {\n\n\t\t\t/* Set the selected STCA (program-wide for simplicity) */\n\t\t\tGlobalAttributes.automata=((JComboBox)(arg0.getSource())).getSelectedIndex();\n\t\t\tMainFrame.automata.setSelectedIndex(GlobalAttributes.automata);\n\t\t\tMainFrame.cellSpace.repaint();\n\t\t}\n\t}", "@Override\r\n\t\t\t\t\t\t\t\tpublic void handle(ActionEvent arg0) {\n\r\n\t\t\t\t\t\t\t\t\tProducts data=(Products) tbl_view.getItems().get(getIndex());\r\n\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\t\t\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\t\t\t\t\t\tif(ConnectionManager.queryInsert(conn, \"DELETE FROM dbo.product WHERE id=\"+data.getId())>0) {\r\n\t\t\t\t\t\t\t\t\t\ttxt_cost.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_date.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_name.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_price.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_qty.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_search.clear();\r\n\t\t\t\t\t\t\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}", "public Item getSelectedItem() { return this.getSelectedSlot().getMappedItem(); }", "public void selectSlot() {\n\t\t\r\n\t}", "public void getSelected() {\n for (int i = 0; i < list.size(); i++) {\n if (selectColumn.getCellObservableValue(i).getValue().isSelected()) {\n selectedIngredients.add(i + 1);\n }\n }\n }", "private void selection(int level, int item) {\n switch (level) {\n case 0:\n if (domaineSelectionne != null && item < tvComptes.getItems().size())\n tvComptes.getSelectionModel().select(item);\n break;\n case 1:\n if (donneesActives != null && item < lvDomaines.getItems().size())\n lvDomaines.getSelectionModel().select(item);\n break;\n }\n }", "@Override\r\n\t\t\tpublic void widgetSelected(SelectionEvent arg0) {\n\t\t\t\tInputDialog id1=new InputDialog(sShell,\"删除商品\",\"输入商品编号\",\"\",null);\r\n\t\t\t\tif(id1.open()==0){\r\n\t\t\t\t\tinput=id1.getValue();\r\n\t\t\t\t\tif(input.equals(\"\")) return;\r\n\t\t\t\t}\r\n\t\t\t\telse return;\r\n\t\t\t\t\r\n\t\t\t\tCommonADO ado=CommonADO.getCommonADO();\r\n\t\t\t\tString sql=\"delete from Goods where GoodsNo='\"+input+\"'\";\r\n\t\t\t\tado.executeUpdate(sql);\r\n\t\t\t\t//createCompositeGoodsShow();\r\n\t\t\t\tcompositeGoodsShow.dispose();\t\t\t\t\r\n\t\t\t\tcreateCompositeGoodsShow();\r\n\t\t\t\t\r\n\t\t\t\tcompositeGoodsMange.layout(true);\r\n\t\t\t}", "@Override\n\tpublic void deleteSelected() {\n\n\t}" ]
[ "0.70120066", "0.69862473", "0.69284016", "0.6717095", "0.664304", "0.6641891", "0.6632706", "0.6605646", "0.65447134", "0.65401125", "0.65390146", "0.63935953", "0.63870084", "0.63649136", "0.6323729", "0.6322483", "0.6306573", "0.62956107", "0.6293801", "0.62926644", "0.62802255", "0.62518036", "0.6246366", "0.62232965", "0.62189245", "0.62058705", "0.6205456", "0.6202082", "0.6191958", "0.61909956", "0.6183673", "0.61808205", "0.6180561", "0.6177849", "0.6175849", "0.6170197", "0.61699766", "0.61689186", "0.61670685", "0.616549", "0.61641556", "0.6161573", "0.6158248", "0.6152835", "0.6151346", "0.61509526", "0.6144425", "0.6144425", "0.61391896", "0.6138125", "0.613723", "0.6130485", "0.6122089", "0.61214715", "0.61204094", "0.61138827", "0.61099035", "0.6104389", "0.6101569", "0.6100838", "0.6097225", "0.60869664", "0.607734", "0.60742444", "0.6071419", "0.6061651", "0.6060961", "0.60600346", "0.60600126", "0.6057441", "0.6051912", "0.604607", "0.60442394", "0.60381514", "0.60381514", "0.60381514", "0.60351586", "0.6033037", "0.60306054", "0.6026671", "0.6022099", "0.6017382", "0.60168046", "0.6007274", "0.6003322", "0.60029775", "0.60000473", "0.5995457", "0.59949815", "0.5986553", "0.5983134", "0.5963229", "0.5962374", "0.5961594", "0.5960052", "0.595923", "0.59539914", "0.59515774", "0.5951236", "0.5951033", "0.5947849" ]
0.0
-1
GENLAST:event_jtMouseClicked to delete index
public void toDeletIndex() { try { //DefaultTableModel model=(DefaultTableModel)jt.getModel(); //jt.getModel(); int num=Integer.parseInt(JOptionPane.showInputDialog(rootPane,"Enter the row number")); jtModel.removeRow(num-1); JOptionPane.showMessageDialog(rootPane,"Successfully deleted selected row number " +num); } catch(NumberFormatException ex) { JOptionPane.showMessageDialog(rootPane,"Enter integer not alphabet"); } catch(ArrayIndexOutOfBoundsException ex) { JOptionPane.showMessageDialog(rootPane,"This row dosent exist"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void delete (int index);", "private void toDelete() {\n if(toCount()==0)\n {\n JOptionPane.showMessageDialog(rootPane,\"No paint detail has been currently added\");\n }\n else\n {\n String[] choices={\"Delete First Row\",\"Delete Last Row\",\"Delete With Index\"};\n int option=JOptionPane.showOptionDialog(rootPane, \"How would you like to delete data?\", \"Delete Data\", WIDTH, HEIGHT,null , choices, NORMAL);\n if(option==0)\n {\n jtModel.removeRow(toCount()-toCount());\n JOptionPane.showMessageDialog(rootPane,\"Successfully deleted first row\");\n }\n else if(option==1)\n {\n jtModel.removeRow(toCount()-1);\n JOptionPane.showMessageDialog(rootPane,\"Successfully deleted last row\");\n }\n else if(option==2)\n {\n toDeletIndex();\n }\n else\n {\n \n }\n }\n }", "public void deleteItem(int index) {\n\t\tDefaultTreeModel model = (DefaultTreeModel) getModel();\n\t\tDefaultMutableTreeNode root = (TreeNode) model.getRoot();\n\t\troot.remove(index);\n\t\tmodel.reload();\n\t}", "public boolean deleteItem(int index);", "@Override\n\t\tpublic void deleteItem(int index) {\n\t\t\tmGuanzhuList.remove(index);\n\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tdelete();\n\t\t\t}", "@Override\n\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\tdelete();\n\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tdelRow();\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tdelRow();\n\t\t\t}", "public void removeIndex(int i) {\n // YOUR CODE HERE\n }", "private void btnEliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarActionPerformed\n e=libCancion.getSelectedIndex();\n System.out.println(e);\n lista.remove(e); \n libCancion.setModel(lista);\n \n cancion.eliminarCancion(e);// TODO add your handling code here:\n i--;\n System.out.println(cancion.getSize());\n }", "@Override\n\t\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\t\tint removeIndex = listdir.indexOf(rowb);\n\t\t\t\t\tlistdir.remove(removeIndex);\n\t\t\t\t\tgetView().getDireccion().removeRow(removeIndex + 1);\n\t\t\t\t}", "public void remove(int index);", "private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {// GEN\n // -\n // FIRST\n // :\n // event_deleteButtonActionPerformed\n int rowIndex = headerTable.getSelectedRow();\n if (rowIndex > -1) {\n removeRow(rowIndex);\n }\n }", "@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tfor(int i = 0; i <deleteButtons.size(); i++) {\n\t\t\t\t\t\tif(e.getSource() == deleteButtons.get(i)) {\n\t\t\t\t\t\t\tdutchList.remove(i + 1);\n\t\t\t\t\t\t\tdutchList.revalidate();\n\t\t\t\t\t\t\tsetSize(getSize().width, getSize().height - 40);\n\t\t\t\t\t\t\tdeleteButtons.remove(i);\n\t\t\t\t\t\t\tlist.remove(i + 1);\n\t\t\t\t\t\t\tSystem.out.println(deleteButtons.size());\n\t\t\t\t\t\t\tSystem.out.println(list.size());\n\t\t\t\t\t\t\tcalculateDutch();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\tremoveRowsIsSelected();\r\n\t\t\t\t\told_Num_Total=0;\r\n\t\t\t\t\tdeleteJButton.setEnabled(false);\r\n\t\t\t\t}", "@Override\n\tpublic void deleteClick(int id) {\n\t\t\n\t}", "public void actionPerformed(ActionEvent e) {\n model.deleteRow();\n }", "@FXML\n\tprivate void handleDeleteTaxi() {\n\t\tint selectedIndex = TaxiTable.getSelectionModel().getSelectedIndex();\n\t\tif (selectedIndex >= 0) {\n\t\t\tTaxiTable.getItems().remove(selectedIndex);\n\t\t} else {\n\t\t\t// Nothing selected.\n\t\t}\n\t}", "@Override\r\n\tpublic void removeToIndex(int index) {\n\t}", "public void remove(int index) {\n\n\t}", "@Override\n\t\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\t\tint removeIndex = listpag.indexOf(rowb);\n\t\t\t\t\tlistpag.remove(removeIndex);\n\t\t\t\t\tgetView().getPaginaweb().removeRow(removeIndex + 1);\n\t\t\t\t}", "void deleteButton_actionPerformed(ActionEvent e) {\n doDelete();\n }", "void remove( int index );", "private void removeJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeJButtonActionPerformed\n //remove current index from name and temp then redo edge and graph\n //check enabled\n int index = cityJList.getSelectedIndex();\n //determine if user still wants to delte employee\n int result = JOptionPane.showConfirmDialog(null, \"Are you sure you want\"\n + \" to delete city: \"\n + namesArray.get(index) + \" (\" + tempArray.get(index).get(0) \n + \", \" + tempArray.get(index).get(1) +\")?\",\n \"Delete City\", JOptionPane.YES_NO_OPTION);\n\n if(result == JOptionPane.YES_OPTION)\n {\n namesArray.remove(index);\n tempArray.remove(index);\n //make list of edges\n makeEdgeList(namesArray, tempArray);\n //make weighted graph object\n graph = new WeightedGraph(namesArray, edgeArray);\n loadJList();\n checkEnabled();\n clearStats();\n calculateJButton.doClick();\n }\n }", "private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {\n int index = jList1.getSelectedIndex();\n \n String idCategory = listIDCategory.get(index);\n deleteCategory(idCategory);\n \n }", "void delete(int index) throws ListException;", "public void deleteTDList(ActionEvent actionEvent) {\n // find the tdlist being referenced by the button,\n // removeList() from it's parenting group\n }", "@Override\r\n\tpublic void deleteObjectListener(ActionEvent e) {\n\t\t\r\n\t}", "@Override\n\t\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\t\tint removeIndex = listema.indexOf(rowb);\n\t\t\t\t\tlistema.remove(removeIndex);\n\t\t\t\t\tgetView().getEmail().removeRow(removeIndex + 1);\n\t\t\t\t}", "@Override\r\n\tpublic void delete(int r_idx) throws Exception {\n\r\n\t}", "void remove(int index);", "void remove(int index);", "void remove(int index);", "void remove(int index);", "@Override\n\t\tpublic void deleteItem(int index) {\n\t\t\tmFiles.remove(index);\n\t\t}", "public void actionPerformed(ActionEvent e) {\n if(newTable.getRowCount() == 0){\n Toolkit.getDefaultToolkit().beep();\n return;\n }\n int index = table.getSelectedRow();\n int size = newTable.getRowCount();\n if(index > size || index < 0){\n table.setRowSelectionInterval(0,0);\n index = table.getSelectedRow();\n }\n newTable.removeRow(index);\n \n\n //Select an index.\n index--;\n if(index < 0){\n index++;\n }\n if(newTable.getRowCount() != 0){\n table.setRowSelectionInterval(index, index);\n }\n }", "public void deleteItem(int index) {\n this.items.remove(index);\n }", "abstract void remove(int index);", "public void actionPerformed(ActionEvent e) {\r\n\t\t\tinstr.setText(\"Previous content is removed.\");\r\n\t\t\tcanvas.arr = new int[8];\r\n\t\t\tcanvas.annotations.clear();\r\n\t\t\tcanvas.repaint();\r\n\t\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n graph.addUndoableEdit(new DeleteUndoableEdit(graph));\n }", "public void supprimerJoueur(ActionEvent e)\n\t{\n\tint index = tableJoueurs.getSelectedRow();\n\tindex = sorter.modelIndex(index);\n\t\tif (index != -1)\n\t\t{\n\t\t\t((JoueursTableModel)sorter.getTableModel()).removeJoueur(index);\n\t\t\t((JoueursTableModel)sorter.getTableModel()).fireTableDataChanged();\n\t\t}\n\t}", "public View removeGuest(int anIndex) { return _scroller.removeGuest(anIndex); }", "public int deleteIndex(FeatureRow row) {\n return deleteIndex(row.getId());\n }", "private void deleteElement(int index) {\n Object[] first = new Object[index];\n System.arraycopy(this.container, 0, first, 0, index);\n\n Object[] second = new Object[this.container.length - index - 1];\n System.arraycopy(this.container, index + 1, second, 0, second.length);\n\n this.container = new Object[this.container.length];\n System.arraycopy(first, 0, this.container, 0, first.length);\n System.arraycopy(second, 0, this.container, index, second.length);\n\n this.position--;\n }", "@Override\n\tpublic void deleteSelected() {\n\n\t}", "@Override\n\tpublic void deleteClick(Object id) {\n\t\t\n\t}", "@Override\n public void mousePressed(MouseEvent e) {\n idx = getIdx(e);\n }", "@Override\n\t\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\t\tint removeIndex = listtel.indexOf(rowb);\n\t\t\t\t\tlisttel.remove(removeIndex);\n\t\t\t\t\tgetView().getTelefono().removeRow(removeIndex + 1);\n\t\t\t\t}", "String delete(int index);", "public void deleteCt() {\n\t\tlog.info(\"-----deleteCt()-----\");\n\t\t//int index = selected.getCtXuatKho().getCtxuatkhoThutu().intValue() - 1;\n\t\tlistCtKhoLeTraEx.remove(selected);\n\t\tthis.count = listCtKhoLeTraEx.size();\n\t\ttinhTien();\n\t}", "@Override\r\n\tpublic void onClick(View v) {\n\t\tlist.remove(index);\r\n\t\tact.showOrderList(toView, list, act);\r\n\t}", "public void deleteAtIndex(int index) {\n if (index < 0 || index >= size) throw new IllegalArgumentException(\"Add filed, index is illegal\");\n Node prev = dummyHead;\n for (int i = 0; i < index; i++) {\n prev = prev.next;\n }\n Node retNode = prev.next;\n prev.next = retNode.next;\n retNode.next = null; //loitering object != memory leak\n size--;\n }", "void onItemDelete(int position);", "public void deleteCommandMutable(int index) {\n int correctIndex = index - 1;\n assertIndexInRange(correctIndex);\n this.listItems.remove(correctIndex);\n }", "@Override\r\n\tprotected ActionListener deleteBtnAction() {\n\t\treturn null;\r\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSystem.out.println(\"btnDelete\");\n\t\t\t\tint i = table.getSelectedRow();\n\t\t\t\tif (i >= 0) {\n\t\t\t\t\tSystem.out.println(\"row-Delete\" + i);\n\t\t\t\t\tSystem.out.println(\"row-Delete\" + textSuppD.getText());\n\t\t\t\t\tint suppID = Integer.parseInt(textSuppD.getText().trim());\n\n\t\t\t\t\tDatabase db = new Database();\n\t\t\t\t\tSuppliersDAO suppDAO = new SuppliersDAO(db);\n\t\t\t\t\tSuppliersModel suppModel = new SuppliersModel();\n\t\t\t\t\tsuppModel.setSuppliers_id(suppID);\n\t\t\t\t\tsuppDAO.Delete(suppModel);\n\t\t\t\t\tdb.commit();\n\t\t\t\t\tdb.close();\n\n\t\t\t\t\tmodel.removeRow(i);\n\t\t\t\t} else {\n\t\t\t\t}\n\t\t\t}", "void remove(int idx);", "@Override\r\n\tpublic int deleteOne(int idx) throws SQLException {\n\t\treturn 0;\r\n\t}", "public void evt_DeleteCurrentObject()\r\n {\r\n rh2EventPos.hoOiList.oilNumOfSelected -= 1;\t\t\t\t\t// Un de moins dans l'OiList\r\n if (rh2EventPrev != null)\r\n {\r\n rh2EventPrev.hoNextSelected = rh2EventPos.hoNextSelected;\r\n rh2EventPos = rh2EventPrev; // Car le courant est vire!\r\n }\r\n else\r\n {\r\n// rhPtr.rhOiList[rh2EventPosOiList].oilListSelected=rh2EventPos.hoNextSelected;\r\n rh2EventPrevOiList.oilListSelected = rh2EventPos.hoNextSelected;\r\n rh2EventPos = null;\r\n }\r\n }", "@Override\n public void deleteVertex(int vertex) {\n\n }", "protected void fireEventDelete(int index) {\n\t\tfor(ActionCellListener listener : actionCellListeners)\n\t\t\tlistener.eventDelete(index);\n\t}", "@ZenCodeType.Method\n default void remove(int index) {\n \n doesNot(\"support removal by index\");\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif(tblTickets.getSelectedRow() != -1) {\n\t\t\t\t\tint id = Integer.parseInt(tblTickets.getValueAt(tblTickets.getSelectedRow(), 0).toString());\n\t\t\t\t\tdeleteTicket(id);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tdelete();\n\t\t\t}", "@Override\r\n\tpublic void delete(int eno) {\n\r\n\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t\tItemType i = getSelectedItem();\n\t\t\t\tif(i != null)\n\t\t\t\t{\t\n\n\t\t\t\t\tfinal String msg = \"Delete \"+i.getName() + \"?\";\n\t\t\t\t\tif(!confirmDelete(msg))\n\t\t\t\t\t\treturn;\n\t\t\t\t\ti.removeContainer(GeneralItemList.this);\n\t\t\t\t\ti.destroy();\n\t\t\t\t}\n\t\t\t\titems.remove(i);\n\t\t\t\tlist.clearSelection();\n\t\t\t\tlist.repaint(100);\t\t\t\t\n\t\t\t}", "void onDeleteClicked();", "public void actionPerformed(ActionEvent e) {\n\t\t\t\t Database.RemoveItem(Integer.toString(Database.IDs[table.getSelectedRow()]));\t\n\t\t\t\t Login.Refresh();\n\t\t\t }", "public void myanwDelete(int idx) {\n\t\tdao.myanwDelete(idx);\r\n\t}", "public void deleteItem(ActionEvent actionEvent) {\n // find the list that the item belongs in\n // removeItem() from its parenting list\n }", "Feature removeFeature(int index);", "@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\titemdeleteListener.itemDelClick(position);\r\n\t\t\t}", "public void deleteFromIndex(int index) {\n int counter = 0;\n if (index < 0 || index > (this.size() - 1)) {\n throw new NoSuchElementException(\"No such element.\");\n }\n //trivial, use deleteFromStart() method\n if (index == 0) {\n deleteFromStart();\n }\n //if head==null, list is empty so no elements to delete\n else if (head == null) {\n System.out.println(\"List is empty, nothing to delete.\");\n }\n //Actual case\n else {\n Iterator2 i = new Iterator2();\n while (counter < (index)) {\n counter++;\n i.next();\n }\n //Sets link from \"previous\" element to the one following the index\n //Remove references from deleted object\n //Garbage collector takes it away\n i.previous.next = i.position.next;\n i.position = i.position.next;\n }\n //Decrement size of list\n size--;\n\n }", "@Override\r\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\tfor(int i=0;i<favorites.size();i++){\r\n\t\t\t\t\t\tif(e.getSource().equals(deleteButtons.get(i))){\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tClient client=new Client();\r\n\t\t\t\t\t\t\t\tclient.deleteCollection(favorites.get(i).getFoodName());\r\n\t\t\t\t\t\t\t\tnew MYCollection(customer).setVisible(true);\r\n\t\t\t\t\t\t\t\tclose();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} catch (Exception e1) {\r\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\t\te1.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\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "@Override\n\tpublic void onPreNodeDelete(NodeModel oldParent, NodeModel selectedNode, int index) {\n\n\t}", "public DeleteCommand(int index) {\n this.index = index;\n }", "public DeleteCommand(int index) {\n this.index = index;\n }", "public DeleteCommand(int index) {\n this.index = index;\n }", "public void deleteTask() {\r\n int selected = list.getSelectedIndex();\r\n if (selected >= 0) {\r\n Task task = myTodo.getTaskByIndex(selected + 1);\r\n myTodo.getTodo().remove(task.getHashKey());\r\n playSound(\"click.wav\");\r\n }\r\n todoListGui();\r\n }", "public void removeIndex(int i)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(INDEX$12, i);\r\n }\r\n }", "public void deleteIndex(int index) {\n if (index < arraySize) {\n for (int i = index; i < arraySize - 1; i++) {\n theArray[i] = theArray[i + 1];\n }\n arraySize--;\n }\n }", "public void delete(int index) {\n\t\tNode node = getNode(index+1);\n\t\tNode parentOfLast = getNode(size >> 1);\n\t\tnode.data = parentOfLast.right != null ? parentOfLast.right.data : parentOfLast.left.data;\n\t\tif (parentOfLast.right != null) {\n\t\t\tparentOfLast.right = null;\n\t\t}\n\t\telse {\n\t\t\tparentOfLast.left = null;\n\t\t}\n\t}", "@Override\n\t\t\t\t\tpublic void onClick(ClickEvent click) {\n\t\t\t\t\t\tcom.google.gwt.user.client.ui.HTMLTable.Cell cell = tripleTable.getCellForEvent(event);\n\t\t\t\t\t\tint cellIndex = cell.getCellIndex();\n\t\t\t\t\t\tint rowIndex = cell.getRowIndex();\n\t\t\t\t\t\tlogger.log(Level.SEVERE, \"cell:\" + cellIndex);\n\t\t\t\t\t\tif (cellIndex == 3) {\n\t\t\t\t\t\t\ttripleTable.removeRow(rowIndex);\n\t\t\t\t\t\t}\n\t\t\t\t\t\trowIndex = tripleTable.getRowCount();\n\n\t\t\t\t\t\ttripleTable.setWidget(rowIndex - 1, 5, save);\n\t\t\t\t\t}", "public void deleteExample(String classKey, int index, String type);", "@Override\n\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\tdeleteBook(position);\n\t\t\t\t\tcandelete =-1;\n\t\t\t\t}", "public void onIndexReset();", "public void deleteEntry(int entryIndex) {\n\t\ttoDoList.remove(entryIndex);\n\t}", "public LinkedListElement deleteAt(int Index) throws IndexOutOfBoundsException {\n throw new IndexOutOfBoundsException(\"Methode deleteAt: Dieser Index existiert nicht!\");\n }", "private void popupDelete() {\n\t\taufzugschacht.removeElement(this);\n\t}", "@SuppressWarnings(\"BooleanParameter\")\n public void deleteSelected(boolean notify, int index) {\n if (index >= 0) {\n foundItems.remove(index);\n if (foundItems.isEmpty()) {\n foundItems.add(createNewEmptyRecord());\n }\n if (recordIndex >= foundItems.size()) {\n recordIndex--; // Should we call setRecordIndex() here?\n assert recordIndex >= 0;\n // if (recordIndex < 0) {\n // recordIndex = 0;\n // }\n if (notify) {\n fireIndexChanged(recordIndex, index);\n }\n }\n if (notify) {\n fireModelListChanged();\n }\n }\n }", "@FXML\n\tvoid RemoveVisitor_Button_Clicked(ActionEvent event) {\n\t\tint index = listViewVisitors.getSelectionModel().getSelectedIndex();\n\t\tif (index == -1 || index == 0) {\n\t\t\tPopUp.showInformation(\"Visitor remove\", \"Visitor remove\", \"Please select one of the additional visitor\");\n\t\t\treturn;\n\t\t}\n\t\tif (listViewVisitors.getItems().size() == 2) {\n\t\t\tPlaceOrder_Button.setDisable(true);\n\t\t\tRemoveVisitor_Button.setDisable(true);\n\t\t}\n\t\tstringList.remove(listViewVisitors.getSelectionModel().getSelectedItem());\n\t\tvisitorsIDArray.remove(index);\n\t\tvisitorsCounter--;\n\t}", "public native String removeItem(Number index);", "@Override\n public void mouseClicked(MouseEvent e) {\n if (e.getClickCount()==1) {\n this.datos();\n }\n if (e.getClickCount()==2) {\n this.eliminar(); \n } \n \n }", "@FXML\n\tpublic void handleExcluir(MouseEvent event) {\n\t\tif(colNome.getCellData(jtvIngredienteTable.getSelectionModel().getSelectedIndex()) != null){\n\t\t\tingredienteService = new IngredienteService();\n\t\t\tIngrediente ingrediente = jtvIngredienteTable.getSelectionModel().getSelectedItem();\n\t\t\tingredienteService.delete(ingrediente.getId());\n\t\t\tatualizarTable();\n\t\t}else{\n\t\t\tScreenUtils.janelaInformação(spDialog, Internationalization.getMessage(\"header_erro3\"), Internationalization.getMessage(\"item_nao_selecionado\"), Internationalization.getMessage(\"erro_button2\"));\n//\t\t\tScreenUtils.janelaInformação(spDialog, \"Ops\", \"Por favor, selecione um item.\", \"Sem problemas\");\n\t\t}\n\t}", "private void delete() {\n AltDatabase.getInstance().getAlts().remove(getCurrentAsEditable());\n if (selectedAccountIndex > 0)\n selectedAccountIndex--;\n updateQueried();\n updateButtons();\n }", "@Override\n public void unDraw() {\n index--;\n }", "@Override\r\n\tpublic void delete(Integer arg0) {\n\t\t\r\n\t}", "@Override\n\tpublic void posDelete() {\n\t\t\n\t}", "@Override\n\tpublic void posDelete() {\n\t\t\n\t}" ]
[ "0.7139126", "0.70314825", "0.67585397", "0.67578816", "0.6701447", "0.6693487", "0.66568094", "0.66300076", "0.66300076", "0.66058594", "0.6563702", "0.65483826", "0.6469664", "0.646224", "0.6426563", "0.6425344", "0.6421734", "0.6412499", "0.640285", "0.63926965", "0.63901466", "0.63795537", "0.63614726", "0.6340698", "0.6339731", "0.63374877", "0.63081133", "0.6298852", "0.62889135", "0.6286808", "0.6273135", "0.6268108", "0.6268108", "0.6268108", "0.6268108", "0.62676096", "0.6264046", "0.62257445", "0.62184095", "0.6216628", "0.6178903", "0.61779195", "0.6164612", "0.6149721", "0.6139937", "0.6135739", "0.6124501", "0.6123443", "0.61181176", "0.61110115", "0.60987675", "0.6096713", "0.6086646", "0.60855025", "0.60800153", "0.6077761", "0.6076619", "0.603608", "0.6031279", "0.6026151", "0.6025208", "0.6014054", "0.60091853", "0.6008564", "0.5995118", "0.5994916", "0.5990088", "0.5985972", "0.59853446", "0.59807277", "0.5972721", "0.5970791", "0.5970383", "0.5970115", "0.5959109", "0.5954512", "0.59538555", "0.59538555", "0.59538555", "0.5952803", "0.59498847", "0.5949319", "0.5928529", "0.59270173", "0.59227854", "0.5894572", "0.58796996", "0.58759075", "0.58703023", "0.5869243", "0.5862889", "0.58625984", "0.58621746", "0.5861325", "0.58578324", "0.58530086", "0.58493805", "0.5845385", "0.58442396", "0.58442396" ]
0.67803293
2
GENLAST:event_custPanelActionPerformed To save the file
private void saveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveActionPerformed toSave(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tsaveFile();\n\t\t\t}", "@Override\n\tpublic void actionPerformed (ActionEvent e)\n\t{\n\t\n\t\t// Create the File Save dialog.\n\t\tFileDialog fd = new FileDialog(\n\t\t\tAppContext.cartogramWizard, \n\t\t\t\"Save Computation Report As...\", \n\t\t\tFileDialog.SAVE);\n\n\t\tfd.setModal(true);\n\t\tfd.setBounds(20, 30, 150, 200);\n\t\tfd.setVisible(true);\n\t\t\n\t\t// Get the selected File name.\n\t\tif (fd.getFile() == null)\n\t\t\treturn;\n\t\t\n\t\tString path = fd.getDirectory() + fd.getFile();\n\t\tif (path.endsWith(\".txt\") == false)\n\t\t\tpath = path + \".txt\";\n\t\t\n\t\t\n\t\t// Write the report to the file.\n\t\ttry\n\t\t{\n\t\t\tBufferedWriter out = new BufferedWriter(new FileWriter(path));\n\t\t\tout.write(AppContext.cartogramWizard.getCartogram().getComputationReport());\n\t\t\tout.close();\n\t\t} \n\t\tcatch (IOException exc)\n\t\t{\n\t\t}\n\n\t\t\n\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}", "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 }", "private void menuSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuSaveActionPerformed\n saveDataToFile();\n }", "public void onSaveButtonClick(ActionEvent e){\n\t\tsaveFile(false);\n\t}", "public void SaveActionPerformed(java.awt.event.ActionEvent evt) {\n if (jfcSave.showSaveDialog(this) == JFileChooser.APPROVE_OPTION){\r\n //get selected file name\r\n File fileSave = jfcSave.getSelectedFile();\r\n String fileSaveName = fileSave.toString();\r\n\r\n try {\r\n SaveScreenShot(drawingPanel,fileSaveName);\r\n } catch (Exception e){\r\n System.out.println(\"image failed to save!\");\r\n }\r\n }\r\n }", "private void saveJMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveJMenuItemActionPerformed\n //save the current points\n myWriter.saveToFile(FILE_PATH, namesArray, tempArray);\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSave();\n\t\t\t}", "private void savePressed(){\n\t\t\n\t\tJFileChooser fileChooser = new JFileChooser(System.getProperty(\"user.dir\"));\n\t\tFileNameExtensionFilter extentions = new FileNameExtensionFilter(\"SuperCalcSave\", \"scalcsave\");\n\t\tfileChooser.setFileFilter(extentions);\n\t\tint retunedVal = fileChooser.showSaveDialog(this);\n\t\tFile file = null;\n\t\tif(retunedVal == JFileChooser.APPROVE_OPTION){\n\t\t\tfile = fileChooser.getSelectedFile();\n\t\t\t//make sure file has the right extention\n\t\t\tif(file.getAbsolutePath().contains(\".scalcsave\"))\n\t\t\t\tfile = new File(file.getAbsolutePath());\n\t\t\telse\n\t\t\t\tfile = new File(file.getAbsolutePath()+\".scalcsave\");\n\t\t}\n\t\t//only continue if a file is selected\n\t\tif(file != null){\t\n\t\t\ttry {\n\t\t\t\t//read in file\n\t\t\t\tObjectOutputStream output = new ObjectOutputStream(new FileOutputStream(file));\n\t\t\t\toutput.writeObject(SaveFile.getSaveFile());\n\t\t\t\toutput.close();\n\t\t\t\tSystem.out.println(\"Save Success\");\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent ae) {\n\t\tFile file = FileChooser.SaveCsvFile();\r\n\t\tif(file==null)\r\n\t\t\treturn;\r\n\t\tBufferedWriter bw = null;\r\n\t\ttry {\r\n\t\t\tbw = new BufferedWriter(new FileWriter(file));\r\n\t\t\tSystem.out.println(file.getAbsolutePath());\r\n\t\t\tbw.write(\"Phonenumber\");\r\n\t\t\tbw.newLine();\r\n\t\t\tfor(int i = 0;i<CSVFrame.model.getRowCount();i++) {\r\n\t\t\t\tRecord r = CSVFrame.model.getRowAt(i);\r\n\t\t\t\tSystem.out.println(r.getPhone());\r\n\t\t\t\tbw.write(r.getPhone());\r\n\t\t\t\tbw.newLine();\r\n\t\t\t}\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Finished creating suppression file\");\r\n\t\t} catch(IOException ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\ttry {\r\n\t\t\t\tbw.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {\n }", "private void jButtonBrowseOutputFileActionPerformed(ActionEvent e) {\n\t\tJFileChooser fileChooser = new JFileChooser();\n\t\tint result = fileChooser.showSaveDialog(this);\n\t\tif (result == JFileChooser.APPROVE_OPTION) {\n\t\t\tFile file = fileChooser.getSelectedFile();\n\t\t\tjTextFieldOutputFile.setText(file.getAbsolutePath());\n\t\t}\n\t}", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\tfile.save();\r\n\t\t\t\tclose();\r\n//\t\t\t\tfile.de = true;\r\n\r\n\t\t\t}", "@Override\r\n\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\tif(e.getSource() == writeToFile){\r\n\t\t\t\ttry {\r\n\t\t\t\t\tdata.writeHouseInfo(\"housing_updated.txt\", copyEstateAgent);\r\n\t\t\t\t} catch (FileNotFoundException e1) {\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\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 Save(){\n\tJFileChooser j = new JFileChooser(\"\"); \n\t// Invoke the showsSaveDialog function to show the save dialog \n\tint r = j.showSaveDialog(null);\n \n\tif (r == JFileChooser.APPROVE_OPTION) { \n\n\t// Set the label to the path of the selected directory \n File fi = new File(j.getSelectedFile().getAbsolutePath()); \n\n try { \n\t\t// Create a file writer \n\t\tFileWriter wr = new FileWriter(fi, false); \n\n\t\t// Create buffered writer to write \n\t\tBufferedWriter w = new BufferedWriter(wr); \n\n\t\t// Write\n\t\tw.write(t.getText()); \n\n\t\tw.flush(); \n\t\tw.close(); \n } \n catch (Exception evt) { \n\t\tJOptionPane.showMessageDialog(f, evt.getMessage()); \n } \n\t} \n\t// If the user cancelled the operation \n\telse\n JOptionPane.showMessageDialog(f, \"the user cancelled the operation\"); \n\t\t\n }", "@FXML\n public void saveFile(Event e) {\n String outputData = output.getText();\n\n File file = chooser.showSaveDialog(save.getScene().getWindow());\n\n if(file != null) {\n createFile(outputData, file);\n }\n }", "protected void ACTION_B_SAVE(ActionEvent arg0) {\n\t\tString capturedata = textArea_1.getText();\r\n\t\ttry\r\n\t\t{\r\n\t\t\tFile DATA = new File(\"capturedata.txt\");\r\n\t\t\tFileOutputStream datastream = new FileOutputStream(DATA);\r\n\t\t\tPrintStream out = new PrintStream(datastream);\r\n\t\t\tout.print(capturedata);\r\n\t\t\tout.close();\r\n\t\t\tdatastream.close();\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Data Saved Successfully\");\r\n\t\t\t\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tJOptionPane.showMessageDialog(null, \"File Access Error ! Could not save data\");\r\n\t\t}\r\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tString cmd = e.getActionCommand();\n\t\tFile file;\n\t\tfile = jfc.getSelectedFile();\n\t\tswitch (cmd) {\n\t\tcase \"저장\":\n\t\t\tsaveFile();\n\t\t\tbreak;\n\t\tcase \"열기\":\n\t\t\t\n\t\t\topenFile();\n\t\t\t\n\t\t\tbreak;\n\t\tcase \"새파일\":\n\t\t\tjta.setText(\"\");\n\t\t\tbreak;\n\t\tcase \"종료\":\n\t\t\tSystem.exit(0);\n\t\t\tbreak;\n\t\t}\n\t\t/*if(cmd.equals(\"저장\"))\n\t\t{\n\t\ttry {\n\t\t\tFileWriter fw = new FileWriter(\"c:/output/notepad.txt\");\n\t\t\tfw.write(jta.getText());\n\t\t\tfw.close();\n\t\t\tSystem.out.println(\"파일을 생성하였습니다\");\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\t}\n\t\t*/\n\t}", "void save_to_file() {\n\t\tthis.setAlwaysOnTop(false);\n\t\t\n\t\t/**\n\t\t * chose file with file selector \n\t\t */\n\t\t\n\t\tFileDialog fd = new FileDialog(this, \"Choose a save directory\", FileDialog.SAVE);\n\t\t\n\t\t//default path is current directory\n\t\tfd.setDirectory(System.getProperty(\"user.dir\"));\n\t\tfd.setFile(\"*.cmakro\");\n\t\tfd.setVisible(true);\n\t\t\n\t\t\n\t\tString filename = fd.getFile();\n\t\tString path = fd.getDirectory();\n\t\tString file_withpath = path + filename;\n\t\t\n\t\tif (filename != null) {\n\t\t\t System.out.println(\"save path: \" + file_withpath);\n\t\t\t \n\t\ttry {\n\t\t\tObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(file_withpath));\n\n\t\t\tout.writeObject(Key_Lists);\n\t\t\t\n\t\t\tout.close();\n\t\t\t\n\t\t\tinfo_label.setForeground(green);\n\t\t\tinfo_label.setText(\"file saved :D\");\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tthis.setAlwaysOnTop(true);\n\t\t\n\t}", "private void mnuFileSaveActionPerformed(java.awt.event.ActionEvent evt) {\n if (fileOpened){\n saveFile(openFile);\n }else{\n JOptionPane.showConfirmDialog(this, \"No file currently open! doing \\\"Save as\\\" instead\");\n saveNewFile();\n }\n }", "private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed\r\n\r\n int returnVal = getOutChooser().showOpenDialog(this);\r\n \r\n if(returnVal == JFileChooser.APPROVE_OPTION) {\r\n try {\r\n Utils.saveFile(blackWords.getText(), getOutChooser().getSelectedFile());\r\n \r\n } catch (FileNotFoundException ex) {\r\n ex.printStackTrace();\r\n } catch (IOException ex) {\r\n ex.printStackTrace();\r\n }\r\n }\r\n \r\n putWizardData(\"blacksaved\", \"false\");\r\n }", "public void save(){\n\tif(currentFile == null){\n\t // TODO: add popup to select where to save file and file name\n\t // currentFile = new TextFile(os, title, null);\n\t}else{\n\t currentFile.setBody(textArea.getText());\n\t}\n }", "private void jMenuItem2ActionPerformed(ActionEvent evt) {\n\t\tif (outputFile == null) {\n\t\t\tSystem.err.println(\"Error!! No file to save\");\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tBufferedImage bi = (BufferedImage) entry.getImage();\n\t\t\tImageIO.write(bi, fileExtension, outputFile);\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Error!! File not saved\");\n\t\t}\n\t}", "public static void writeToFile(JPanel owner) {\n\n boolean proceed = true;\n JFileChooser fileChooser = new JFileChooser(new File(\".\"));\n fileChooser.setAcceptAllFileFilterUsed(false);\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"Text files\", \"txt\");\n fileChooser.addChoosableFileFilter(filter);\n\n int returnValue = fileChooser.showSaveDialog(owner);\n if (returnValue == JFileChooser.APPROVE_OPTION) {\n \n // Need to add extension; not done automatically\n File fileToSave = fileChooser.getSelectedFile();\n if (!fileToSave.getAbsolutePath().endsWith(\".txt\")) {\n fileToSave = new File(fileToSave + \".txt\");\n }\n \n // Handle overwrite scenario\n if (fileToSave.exists()) {\n proceed = false;\n int confirm = JOptionPane.showConfirmDialog(owner, \"File exists, overwrite?\", \"File exists\", JOptionPane.YES_NO_OPTION);\n if (confirm == JOptionPane.YES_OPTION) {\n proceed = true;\n }\n }\n\n try {\n // Collect information to write\n String contents = \"\";\n if (canvasListModel.getSize() != 0) {\n contents += canvasListModel.get(0) + \"\\n\"; // only one item\n }\n if (drawListModel.getSize() != 0) {\n for(int instrIdx = 0; instrIdx < drawListModel.size(); instrIdx++) {\n contents += drawListModel.get(instrIdx) + \"\\n\";\n }\n }\n\n // Write information to the file\n PrintStream ps = new PrintStream(fileToSave);\n ps.print(contents);\n ps.close();\n }\n catch (FileNotFoundException e) {\n JOptionPane.showMessageDialog(owner, \"File could not be written; check permissions\");\n }\n }\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tdosave();\n\t\t\t\t}\n\t\t\t\tcatch(Exception ex)\n\t\t\t\t{\n\t\t\t\t\tex.printStackTrace();\n\t\t\t\t}\n\t\t\t}", "private static void saveActionPerformed(){\r\n JFileChooser chooser = new JFileChooser();\r\n chooser.setDialogType(JFileChooser.OPEN_DIALOG);\r\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"Text files\", \"txt\");\r\n chooser.setFileFilter(filter);\r\n int returnVal = chooser.showOpenDialog(frame);\r\n if (returnVal == JFileChooser.APPROVE_OPTION) { \r\n try(BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(chooser.getSelectedFile()), \"UTF-8\"))){\r\n writeChosenSchedule(bw); \r\n \r\n JOptionPane.showMessageDialog(null, \"The schedule was successfully saved.\",\r\n \"Info\", JOptionPane.INFORMATION_MESSAGE);\r\n }\r\n catch(IOException e){\r\n Logger.getLogger(\"File saving\").log(Level.WARNING, \"Could not write to the file\", e);\r\n JOptionPane.showMessageDialog(null, \"Failed to save the schedule to the chosen file!\",\r\n \"Error\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n }\r\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tcontroller.writeExcelFile();\r\n\t\t\t}", "private void jButton_SaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_SaveActionPerformed\n // TODO add your handling code here:\n saveToFile();\n //new FittingCriteria(this.digPopGUIInformation, this.currentMarkovChainId).setVisible(true);\n new StepThree(this.digPopGUIInformation).setVisible(true);\n dispose();\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n int id = waiterGraphicalUserInterface.getId();\n Order order = restaurant.getOrder(id);\n FileWriter fileWriter = new FileWriter(restaurant,order);\n }", "public void save()\r\n {\r\n \tfc=new JFileChooser();\r\n\t fc.setCurrentDirectory(new File(\"\"));\r\n\t if(fc.showSaveDialog(this)==JFileChooser.APPROVE_OPTION)\r\n\t \t//Try-Catch Block\r\n\t try\r\n\t {\r\n\t pw=new PrintWriter(new FileWriter(fc.getSelectedFile()+\".txt\")); //Print to the user-selected file\r\n\t\t \tfor(Organism o: e.getTree()) //IN PROGESS\r\n\t\t \t{\r\n\t\t\t\t\tint[] genes=o.getGenes(); //Getting genes from \r\n\t\t\t\t\tfor(int i=0; i<genes.length; i++)\r\n\t\t\t\t\t\tpw.print(genes[i]+\" \"); //Print each gene value in a line\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tpw.println(); //Starts printing on a new line\r\n\t\t\t\t}\r\n\t\t\t\tpw.close(); //Closes the File\r\n\t }\r\n\t catch (Exception ex) //Catch Any Exception\r\n\t {\r\n\t ex.printStackTrace();\r\n\t }\r\n }", "private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {\n rom.save(obstacle, frog);\n isSaved = true;\n }", "public void saveFile() {\t\n\t\tString fileloc = \"\";\n\t\tif(!prf.foldername.getText().equals(\"\"))\n\t\t\tfileloc += prf.foldername.getText()+\"/\";\n\t\tfileloc += ((MinLFile) tabbedPane.getSelectedComponent()).filename;;\t\t\n\t\tFile fl = new File(fileloc);\n\t\t\n\t\ttry {\n\t\t\tif(fl.exists()) {\n\t\t\t\tint option = JOptionPane.showConfirmDialog(null, \"The file with this name already exists, do you want to overwrite it?\", \"Save File\", JOptionPane.YES_NO_OPTION);\n\t\t\t\tif(option == 0) {\n\t\t\t\t\tFiles.delete(fl.toPath());\n\t\t\t\t\ttry {\n\t\t\t\t\t\t\n\t\t\t\t\t\tFileWriter fw = new FileWriter(fileloc);\n\t\t\t\t\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\t\t\t\t\tbw.write(((MinLFile) tabbedPane.getSelectedComponent()).CodeArea.getText());\n\t\t\t\t\t\tbw.close();\n\t\t\t\t\t\tfw.close();\n\t\t\t\t\t\t((MinLFile) tabbedPane.getSelectedComponent()).filechanged = false;\n\t\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tFileWriter fw = new FileWriter(fileloc);\n\t\t\t\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\t\t\t\tbw.write(((MinLFile) tabbedPane.getSelectedComponent()).CodeArea.getText());\n\t\t\t\t\tbw.close();\n\t\t\t\t\tfw.close();\n\t\t\t\t\t((MinLFile) tabbedPane.getSelectedComponent()).filechanged = false;\n\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"The specified folder doesnt exist.\");\n\t\t\t\t\te1.printStackTrace();\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}", "public void onSaveFile(){\n\n\t\t\n\t\tFormUtil.dlg.setText(\"Saving...\");\n\t\tFormUtil.dlg.show();\n\t\tGWT.runAsync(new RunAsyncCallback() {\n\t public void onFailure(Throwable caught) {}\n\t public void onSuccess() {\t \n\t\t\t\t//DeferredCommand.addCommand(new Command() {\n\t \t Scheduler scheduler = Scheduler.get();\n\t \t scheduler.scheduleDeferred(new Command() {\n\t\t\t\t\tpublic void execute() {\n\t\t\t\t\t FormDef form = controller.getSelectedForm();\t\t\t\t \t\t\t\t\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\tif(form != null){\n\t\t\t\t\t\t\t\tsaveFile(false);\n\t\t\t\t\t\t\t\tFormUtil.dlg.hide();\n\t\t\n\t\t\t\t\t\t\t\tString fileName = \"filename\";\n\t\t\t\t\t\t\t\tfileName = form.getName();\n\t\t\t\t\t\t\t\tString xmlFormStr = FormHandler.writeToXML(form);\n\t\t\t\t\t\t\t\tSaveToFileDialog dlg = SaveToFileDialog.getInstnace(xmlFormStr, fileName);\n\t\t\t\t\t\t\t\tdlg.center();\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\tFormUtil.dlg.hide();\n\t\t\t\t\t\t\t\tWindow.alert(\"No form to save\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch(Exception ex){\n\t\t\t\t\t\t\tFormUtil.displayException(ex);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t }\n\t\t});\n\t}", "private void toSave() {\n File file4=new File(\"trial.txt\");\n try\n {\n String row;\n BufferedWriter bw=new BufferedWriter(new FileWriter(file4));\n for(int i=0;i<jt.getRowCount();i++)\n {\n row = \"\";\n for(int j=0;j<jt.getColumnCount();j++)\n {\n row += (jt.getValueAt(i, j) +\",\");\n }\n row = row.substring(0, row.length()-1);\n //System.out.println(row);\n bw.write(row);\n bw.newLine();\n }\n bw.close();\n \n \n JOptionPane.showMessageDialog(rootPane,\"Details saved succesfully\");\n }\n \n catch(Exception ex)\n {\n JOptionPane.showMessageDialog(rootPane,\"Exception occured\");\n }\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tFile projectFile;\n\t\t\t\tint rVal = fileChooser.showSaveDialog(OldTimeTableApp.this);\n\t\t\t\tif(rVal == JFileChooser.APPROVE_OPTION) {\n\t\t\t\t\tprojectFile = fileChooser.getSelectedFile();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tProjectController.saveProject(currentProject, projectFile.getPath());\n\t\t\t\t\t\tcurrentProjectFilePath = projectFile.getPath();\n\t\t\t\t\t\tupdatePanel(currentProjectFilePath, currentProject.getCourseDetailsFileName(), currentProject.getStudentAllocationDetailsFileName());\n\t\t\t\t\t} catch (IOException error) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\tJOptionPane.showMessageDialog(OldTimeTableApp.this, error, \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}", "public void actionPerformed(ActionEvent e)\n {\n MapArchitect.save();\n }", "public void fileSave()\n {\n try\n {\n // construct the default file name using the instance name + current date and time\n StringBuffer currentDT = new StringBuffer();\n try {\n currentDT = new StringBuffer(ConnectWindow.getDatabase().getSYSDate());\n }\n catch (Exception e) {\n displayError(e,this) ;\n }\n\n // construct a default file name\n String defaultFileName;\n if (ConnectWindow.isLinux()) {\n defaultFileName = ConnectWindow.getBaseDir() + \"/Output/RichMon \" + instanceName + \" \" + currentDT.toString() + \".html\";\n }\n else {\n defaultFileName = ConnectWindow.getBaseDir() + \"\\\\Output\\\\RichMon \" + instanceName + \" \" + currentDT.toString() + \".html\";\n }\n JFileChooser fileChooser = new JFileChooser();\n fileChooser.setSelectedFile(new File(defaultFileName));\n File saveFile;\n BufferedWriter save;\n\n // prompt the user to choose a file name\n int option = fileChooser.showSaveDialog(this);\n if (option == JFileChooser.APPROVE_OPTION)\n {\n saveFile = fileChooser.getSelectedFile();\n\n // force the user to use a new file name if the specified filename already exists\n while (saveFile.exists())\n {\n JOptionPane.showConfirmDialog(this,\"File already exists\",\"File Already Exists\",JOptionPane.ERROR_MESSAGE);\n option = fileChooser.showOpenDialog(this);\n if (option == JFileChooser.APPROVE_OPTION)\n {\n saveFile = fileChooser.getSelectedFile();\n }\n }\n save = new BufferedWriter(new FileWriter(saveFile));\n saveFile.createNewFile();\n\n // create a process to format the output and write the file\n try {\n OutputHTML outputHTML = new OutputHTML(saveFile,save,\"Database\",databasePanel.getResultCache());\n outputHTML.savePanel(\"Performance\",performancePanel.getResultCache(),null);\n// outputHTML.savePanel(\"Scratch\",scratchPanel.getResultCache(),scratchPanel.getSQLCache());\n\n JTabbedPane scratchTP = ScratchPanel.getScratchTP();\n \n for (int i=0; i < scratchTP.getComponentCount(); i++) {\n try {\n System.out.println(\"i=\" + i + \" class: \" + scratchTP.getComponentAt(i).getClass());\n if (scratchTP.getComponentAt(i) instanceof ScratchDetailPanel) {\n ScratchDetailPanel t = (ScratchDetailPanel)scratchTP.getComponentAt(i);\n System.out.println(\"Saving: \" + scratchTP.getTitleAt(i));\n outputHTML.savePanel(scratchTP.getTitleAt(i), t.getResultCache(), t.getSQLCache());\n }\n } catch (Exception e) {\n // do nothing \n }\n }\n }\n catch (Exception e) {\n displayError(e,this);\n }\n\n // close the file\n save.close();\n }\n }\n catch (IOException e)\n {\n displayError(e,this);\n }\n }", "@Override\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tJOptionPane.showMessageDialog(null, \"保存成功\");\n\t\t}", "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}", "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 }", "@Override\r\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tsaveChanges();\r\n\t\t\t\t\t\r\n\t\t\t\t}", "private void outputFileLocActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_outputFileLocActionPerformed\n // Autogenerated code, no need to do anything here\n }", "@FXML\n void exportFile(ActionEvent event) {\n \tFileChooser chooser = new FileChooser();\n\t\tchooser.setTitle(\"Open Target File for the Export\");\n\t\tchooser.getExtensionFilters().addAll(new ExtensionFilter(\"Text Files\", \"*.txt\"),\n\t\t\t\tnew ExtensionFilter(\"All Files\", \"*.*\"));\n\t\tStage stage = new Stage();\n\t\t\n\t\t//get the reference of the target file\n\t\tFile targeFile = chooser.showSaveDialog(stage); \n\t\t\n\t\t\n\t\t//writes accounts to text file and exports\n\t\ttry {\n\t\t\t\n\t\t\tBufferedWriter bf = new BufferedWriter(new FileWriter(targeFile));\n\t\t\tbf.write(db.printFormattedAccounts());\n\t\t\tbf.flush();\n\t\t\tbf.close();\n\t\t\t\n\t\t\tmessageArea.appendText(\"File successfully exported.\\n\");\n\t\t\t\n\t\t} catch (IOException e) {\n \t\tmessageArea.appendText(\"Unable to export transactions to file.\\n\");\n\t\t}\n\t\tcatch (NullPointerException e) {\n\t\t\tmessageArea.appendText(\"File not selected, unable to export transactions to file.\\n\");\n\t\t}\n\t\t\n\t\t\n }", "void saveAs() {\n writeFile.Export();\n }", "private void actionSaveOutput ()\r\n\t{\r\n\t\ttry\r\n\t\t{\t\t\t\r\n\t\t\tint tableSize = DataController.getTable().getTableSize();\r\n\r\n\t\t\tif (tableSize != 0)\r\n\t\t\t{\r\n\t\t\t\tJFileChooser saveFileChooser = new JFileChooser();\r\n\r\n\t\t\t\tFileNameExtensionFilter typeCSV = new FileNameExtensionFilter(\"CSV\", \"csv\", \"CSV\");\r\n\t\t\t\tsaveFileChooser.addChoosableFileFilter(typeCSV);\r\n\r\n\t\t\t\tFileNameExtensionFilter typeTXT = new FileNameExtensionFilter(\"TXT\", \"txt\", \"TXT\");\r\n\t\t\t\tsaveFileChooser.addChoosableFileFilter(typeTXT);\r\n\r\n\t\t\t\tsaveFileChooser.setAcceptAllFileFilterUsed(false);\r\n\t\t\t\tsaveFileChooser.setFileFilter(typeCSV);\r\n\r\n\t\t\t\tint isOpen = saveFileChooser.showOpenDialog(saveFileChooser);\r\n\r\n\t\t\t\tif (isOpen == JFileChooser.APPROVE_OPTION) \r\n\t\t\t\t{\r\n\t\t\t\t\tString filePath = saveFileChooser.getSelectedFile().getPath();\r\n\r\n\t\t\t\t\tint indexImage = mainFormLink.getComponentPanelLeft().getComponentComboboxFileName().getSelectedIndex();\r\n\r\n\t\t\t\t\t/*!*/DebugLogger.logMessage(\"Saving output of a single image \" + indexImage + \" to file \" + filePath, LOG_MESSAGE_TYPE.INFO);\r\n\r\n\t\t\t\t\tif (indexImage >= 0 && indexImage < tableSize)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (saveFileChooser.getFileFilter().equals(typeCSV))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (!filePath.substring(filePath.length() - 4).equals(\".csv\")) { filePath += \".csv\"; }\r\n\r\n\t\t\t\t\t\t\t//---- Save file in a CSV format\r\n\t\t\t\t\t\t\tOutputController.saveFile(filePath, DataController.getTable(), indexImage, OutputController.OUTPUT_FORMAT.CSV);\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\tif (!filePath.substring(filePath.length() - 4).equals(\".txt\")) { filePath += \".txt\"; }\r\n\r\n\t\t\t\t\t\t\t//---- Save file in a txt format\r\n\t\t\t\t\t\t\tOutputController.saveFile(filePath, DataController.getTable(), indexImage, OutputController.OUTPUT_FORMAT.TXT);\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\tcatch (ExceptionMessage exception)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(exception);\r\n\t\t}\r\n\t}", "private void saveCSV(ActionEvent actionEvent) {\n JFileChooser fileChooser = new JFileChooser();\n fileChooser.setCurrentDirectory(new File(System.getProperty(\"user.home\")));\n int result = fileChooser.showOpenDialog(this);\n if (result == JFileChooser.APPROVE_OPTION) {\n String selectedFile = fileChooser.getSelectedFile().getAbsolutePath();\n StatisticsFile statisticsFile = new StatisticsFile(selectedFile);\n try{\n statisticsFile.writeInCvs(my_map.getSettlements());\n }catch(IOException ioException){\n ioException.printStackTrace();\n }\n }\n }", "private void saveFile(boolean showWindow) {\n\n\t\tFormDef form = controller.getSelectedForm();\n\t\tif(form == null)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tString xml = FormHandler.writeToXML(form);\n\n\t\t\n\t\titextWidget.loadItext(Context.getItextList());\n\n\t\txformsWidget.setXform(xml);\n\t\tif (showWindow) {\n\t\t\txformsWidget.showWindow();\n\t\t}\n\t}", "public void saveData(){\n reporter.info(\"Save edited form\");\n clickOnElement(LOCATORS.getBy(COMPONENT_NAME,\"SAVE_BUTTON\"));\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 saveFile() {\r\n File savedFile = new File(fileName);\r\n\r\n try (FileWriter fw = new FileWriter(savedFile)) {\r\n fw.write(workSpace.getText());\r\n\r\n fw.close();\r\n } catch (IOException ex) {\r\n JOptionPane.showMessageDialog(null, \"There was an error saving the file\");\r\n }\r\n }", "public static void saveAs(){\n\t\tFile saveFile;\n\t\tJFileChooser saveChooser = new JFileChooser();\n\t\tFileNameExtensionFilter saveFilter = new FileNameExtensionFilter(\"Sensormap Files (.stuff)\", \"stuff\");\n\t\tFileNameExtensionFilter saveFilter2 = new FileNameExtensionFilter(\"Gzipped Sensormap Files (.stuff.gz)\", \"stuff.gz\");\n\t\tsaveChooser.setFileFilter(saveFilter);\n\t\tsaveChooser.setFileFilter(saveFilter2);\n\t\tint saveReturnVal = saveChooser.showSaveDialog(ControlPanelFrame.getFrame());\n\t\tif(saveReturnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\tif(saveChooser.getFileFilter() == saveFilter && saveChooser.getSelectedFile().getName().endsWith(\".stuff\")==false){\n\t\t\t\tsaveFile = new File(saveChooser.getSelectedFile().getAbsolutePath()+\".stuff\");\n\t\t\t} else if(saveChooser.getFileFilter() == saveFilter2 && saveChooser.getSelectedFile().getName().endsWith(\".stuff.gz\")==false){\n\t\t\t\tsaveFile = new File(saveChooser.getSelectedFile().getAbsolutePath()+\".stuff.gz\");\n\t\t\t} else {\n\t\t\t\tsaveFile = saveChooser.getSelectedFile();\n\t\t\t}\n\t\t\tXMLSaver.saveSensorList(saveFile);\n\t\t\tGUIReferences.viewPort.halfTitle = saveFile.getName();\n\t\t\tGUIReferences.viewPort.setTitle(saveFile.getName());\n\t\t\tGUIReferences.currentFile = saveFile;\n\t\t\tGUIReferences.saveMenuItem.setEnabled(false);\n\t\t}\n\t}", "private void saveFile(){\n\tif (numPlayers == 1 && 0 < numNPCs && numNPCs < 6){\n\t int returnVal = fileChooser.showSaveDialog(this);\n\t if (returnVal == JFileChooser.APPROVE_OPTION) {\n\t\ttry {\n\t\t FileWriter writer =\n\t\t\tnew FileWriter(fileChooser.getSelectedFile());\n\t\t writer.write(this.toXML());\n\t\t writer.close();\n\t\t} catch (Exception ex) {\n\t\t ex.printStackTrace();\n\t\t}\n\t }\n\t} else {\n\t //If it wouldn't make a valid game, warn the user\n\t JFrame f = new JFrame();\n\t JOptionPane.showMessageDialog(f,\n\t\t\t\t\t \"You must have exactly one playable\\n\"\n\t\t\t\t\t + \"character and 1-5 NPCs.\\n\" +\n\t\t\t\t\t \"Current PCs= \" + numPlayers +\n\t\t\t\t\t \", NPCs = \" + numNPCs,\n\t\t\t\t\t \"Improper Game Configuration\",\n\t\t\t\t\t JOptionPane.WARNING_MESSAGE);\t \n\t}\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n JFileChooser j = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory());\n\n // invoke the showsSaveDialog function to show the save dialog\n int r = j.showSaveDialog(null);\n\n if (r == JFileChooser.APPROVE_OPTION) {\n // set the label to the path of the selected directory\n dataFile.setText(j.getSelectedFile().getAbsolutePath());\n }\n // if the user cancelled the operation\n else\n dataFile.setText(\"the user cancelled the operation\");\n }", "public void actionPerformed(java.awt.event.ActionEvent evt) {\n if (!askSave()) {\n return;\n }\n setSaveTitle(\"*untilted\");\n text.setText(\"\");\n file = null;\n }", "private void saveLblMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_saveLblMouseClicked\n FileHandling.saveToFile(this, HF);\n }", "private void saveComponentsToFile(String fileName) {\n\t\tFile fileToSave = new File(\"./saved/\" + fileName);\n\t\ttry {\n\t\t\tif (!fileToSave.createNewFile()) {\n\t\t\t\tDialogsUtil.showErrorMessage(\"File already exists.\");\n\t\t\t} else {\n\t\t\t\tFileWriter fileWriter = new FileWriter(\"./saved/\" + fileName);\n\n\t\t\t\tList<Component> canvasItems = Arrays.asList(CanvasPanel.getInstance().getComponents());\n\n\t\t\t\tfor (Component item : canvasItems) {\n\t\t\t\t\tTransferableItemButton designElement = (TransferableItemButton) item;\n\n\t\t\t\t\tString elementImageAddress = FileUtil.designElementsDirectory + \"\\\\\" + designElement.getName()\n\t\t\t\t\t\t\t+ FileUtil.imageExtension;\n\n\t\t\t\t\tDesignElement elementToSave = new DesignElement(designElement.getX(), designElement.getY(),\n\t\t\t\t\t\t\tdesignElement.getWidth(), designElement.getHeight());\n\t\t\t\t\telementToSave.setLayer(CanvasPanel.getLayer(designElement));\n\t\t\t\t\telementToSave.setImageAddress(elementImageAddress);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfileWriter.write(elementToSave.toString() + \"\\n\");\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tDialogsUtil.showErrorMessage(\"Something went wrong.\");\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfileWriter.close();\n\t\t\t\tDialogsUtil.showMessage(\"Success!\");\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tDialogsUtil.showErrorMessage(\"Something went wrong.\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private void jMenuItemGuardarBDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemGuardarBDActionPerformed\n LOG.trace(evt.paramString());\n\n jfc.showSaveDialog(this);\n File f = jfc.getSelectedFile();\n\n try (FileOutputStream fos = new FileOutputStream(f);\n ObjectOutputStream oos = new ObjectOutputStream(fos)) {\n\n oos.writeObject(listaDeportes);\n\n } catch (HeadlessException | IOException e) {\n LOG.error(e.getMessage(), e);\n }\n}", "@Override\n\tpublic void actionPerformed(ActionEvent arg0) \n\t{\n\t\t\n\t\t\n\t\tJFileChooser fileChooser = new JFileChooser(); //fichero a grabar.\n\t\t\n\t\tint seleccion=fileChooser.showSaveDialog(null);\t\t\n\t\t\n\t\t\n\t\tString mensajeError=\"\";\n\t\tswitch (seleccion) {// si es o.k pues lo guardo.\n\t\tcase JFileChooser.APPROVE_OPTION:\t\t\t\t\t\n\t\t\ttry {\n\t\t\t\telementosBackup.getClasificacion().escribirFicheroTexto(fileChooser.getSelectedFile().getPath()+\".txt\");\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\tif(mensajeError.length()==0) {\n\t\t\t\tJLabel label = new JLabel(\"Datos guardados correctamente en \"+fileChooser.getSelectedFile().getPath()+\".txt\");\n\t\t\t\tObject[] ob = {label};\n\t\t\t\tJOptionPane.showMessageDialog(null, ob, \"Guardar datos\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t}\n\t\t\telse \n\t\t\t\n\t\t\t{\n\t\t\t\tJOptionPane.showMessageDialog(null, mensajeError, \"Guardar datos\", JOptionPane.ERROR_MESSAGE);\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\n\t\t}\n\t}", "public ActionSaveAs() {\r\n putValue(SMALL_ICON, IconFactory.get().create(\"fa:floppy-o\"));\r\n Messages.get().message(\"saveAs\").subscribe((msg) -> {\r\n putValue(NAME, msg);\r\n });\r\n }", "public void actionPerformed(ActionEvent InputEvent)\r\n {\n String DefaultSaveFileName = createDefaultSaveFileName();\r\n File DefaultSaveFile = new File(FilePathnameString\r\n + File.separatorChar\r\n + DefaultSaveFileName);\r\n\t\t JFileChooser SaveFileChooser = new JFileChooser(DefaultSaveFile);\r\n SaveFileChooser.setDialogTitle(\"Select file into which to save search results\");\r\n SaveFileChooser.setSelectedFile(DefaultSaveFile);\r\n SaveFileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);\r\n\t\t int ChooseState = SaveFileChooser.showSaveDialog(MainFrame);\r\n\t\t if (ChooseState == JFileChooser.APPROVE_OPTION)\r\n\t\t {\r\n\t\t\t File SaveFile = SaveFileChooser.getSelectedFile();\r\n\t\t\t if (SaveFile == null)\r\n\t\t JOptionPane.showMessageDialog(MainFrame,\r\n\t\t \"No file chosen - no save performed\");\r\n\t\t\t else\r\n\t\t\t {\r\n String ResultsString = getResultsString();\r\n if (ResultsString == null)\r\n \t\t JOptionPane.showMessageDialog(MainFrame,\r\n\t\t \"No search results to save\");\r\n else\r\n {\r\n \t\t\t String SavePathString = SaveFile.getPath();\r\n try\r\n {\r\n FileWriter SaveFileWriter = new FileWriter(SavePathString);\r\n SaveFileWriter.write(ResultsString);\r\n SaveFileWriter.close();\r\n }\r\n catch (Exception InputException)\r\n {\r\n \t\t JOptionPane.showMessageDialog(MainFrame,\r\n\t\t \"Error writing results file \"\r\n + SavePathString\r\n + \": \"\r\n + InputException);\r\n }\r\n }\r\n\t\t\t }\r\n\t\t }\r\n }", "@Override\r\n\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\tSaveAction();\r\n\t\t\t\r\n\t\t}", "void doSaveAs() {\r\n\t\tMapOpenSaveDialog dlg = new MapOpenSaveDialog(true, labels, saveSettings);\r\n\t\tdlg.setLocationRelativeTo(this);\r\n\t\tdlg.setVisible(true);\r\n\t\tif (dlg.saveSettings != null) {\r\n\t\t\tsaveSettings = dlg.saveSettings;\r\n\t\t\tfinal String fn = dlg.saveSettings.fileName.getPath();\r\n\t\t\taddRecentEntry(fn);\r\n\t\t\tdoSave();\r\n\t\t}\r\n\t}", "public void saveAs() {\n\t\tJFileChooser fc = new JFileChooser(\"./\");\n\t\tBufferedWriter bw = null;\n\t\tFileWriter fw = null;\n\t\tint returnValue = fc.showSaveDialog(contentPane);\n\t\t\n\t\tif(returnValue == JFileChooser.APPROVE_OPTION) {\n\t\t\ttry {\n\t\t\t\tString path = fc.getCurrentDirectory().getAbsolutePath();\n\t\t\t\tString name = fc.getSelectedFile().getName();\n\t\t\t\tif(!name.endsWith(\".txt\")) {\n\t\t\t\t\tname += \".txt\";\n\t\t\t\t}\n\t\t\t\tFile file = new File(path,name);\n\t\t\t\t\n\t\t\t\tfw = new FileWriter(file);\n\t\t\t\tbw = new BufferedWriter(fw);\n\t\t\t\t//string to hold each line to write on new file\n\t\t\t\tString text = textArea.getText();\n\t\t\t\t//write file\n\t\t\t\tif (text != null) {\n\t\t\t\t\tbw.write(text);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException ie) {\n\t\t\t\tie.printStackTrace();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\ttry {\n\t\t\t\t\tif (bw != null) {\n\t\t\t\t\t\tbw.close();\n\t\t\t\t\t\tfw.close();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (IOException ie2) {\n\t\t\t\t\tie2.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tImage imagen = panelCamara.getImage();\n\t\t\t\tFile fichero = new File(\"usuarios/\"+nick+\".jpg\");\n\t\t\t\tString formato = \"jpg\";\n\t\t\t\ttry {\n\t\t\t\t\tImageIO.write((RenderedImage)imagen, formato, fichero);\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\t\n\t\t\t\tBD.btnGuardar(\"usuarios/\"+nick+\".jpg\",nick);\n\t\t\t}", "public void SaveBtn(MouseEvent event) {\n\t}", "private JButton getSaveButton() {\r\n\t\tif (saveButton == null) {\r\n\t\t\tsaveButton = new JButton();\r\n\t\t\tsaveButton.setIcon(new ImageIcon(getClass().getResource(\"/img/icon/saveFile.png\")));\r\n\t\t\tsaveButton.setToolTipText(\"保存\");\r\n\t\t\tsaveButton.addActionListener(new ActionListener(){\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\t\tif(file == null){\r\n\t\t\t\t\t\tJFileChooser chooser = new JFileChooser();\r\n\t\t\t\t chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);//设置选择模式,既可以选择文件又可以选择文件夹\r\n\t\t\t\t\t\tString fileFormat[] = { \"txt\" };\r\n\t\t\t\t\t\tFileFilter filter = new FileNameExtensionFilter( \"TXT文件\",fileFormat);\r\n\t\t\t\t chooser.setFileFilter(filter);//设置文件后缀过滤器\r\n\t\t\t\t int retval = chooser.showOpenDialog(null);//显示\"保存文件\"对话框\r\n\t\t\t\t if(retval == JFileChooser.APPROVE_OPTION) {//若成功打开\r\n\t\t\t\t \tfile = chooser.getSelectedFile();//得到选择的文件名\r\n\t\t\t }\r\n\t\t\t\t\t\tif(file == null){\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t OutputStream os;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tos = new FileOutputStream(file);\r\n\t\t\t\t\t byte[] b = content.getBytes();\r\n\t\t\t\t\t os.write(b);\r\n\t\t\t\t\t os.flush();\r\n\t\t\t\t\t os.close();\r\n\t\t\t\t\t} catch (FileNotFoundException e1) {\r\n\t\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t\t} catch (IOException e2) {\r\n\t\t\t\t\t\te2.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn saveButton;\r\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent ae) {\n\t\t\t\tJFileChooser chooser = new JFileChooser();\n\t\t\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\"HALTING Files\", EXT);\n\t\t\t\tchooser.setFileFilter(filter);\n\t\t\t\tint choice = chooser.showSaveDialog(MainWindow.this);\n\t\t\t\tif (choice != JFileChooser.APPROVE_OPTION)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\t// ensure correct extension\n\t\t\t\tFile file = chooser.getSelectedFile();\n\t\t\t\tif (! file.getName().endsWith(\".\" + EXT))\n\t\t\t\t\tfile = new File(file + \".\" + EXT);\n\t\t\t\tString filename = file.getAbsolutePath();\n\n\t\t\t\t// attempt to output automaton to file\n\t\t\t\ttry {\n\t\t\t\t\toutputToFile(filename);\n\t\t\t\t\t\n\t\t\t\t\t// delete the original (if overwriting)\n\t\t\t\t\tif (file.exists())\n\t\t\t\t\t\tFiles.delete(file.toPath());\n\t\t\t\t\t\n\t\t\t\t\t// rename the tmp file\n\t\t\t\t\tFile newFile = new File(filename + \".tmp\");\n\t\t\t\t\tif (!newFile.renameTo(file))\n\t\t\t\t\t\tthrow new FileError(file.getAbsolutePath(), true);\n\t\t\t\t}\n\t\t\t\t// warn the user about a failure\n\t\t\t\tcatch (Exception e) {\n\t\t\t\t\tString msg = e.getMessage();\n\t\t\t\t\treportException(new FileError(msg == null ? filename \n\t\t\t\t\t\t\t : msg, true));\n\t\t\t\t}\n\t\t\t}", "private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed\n boolean flag = this.cutiController.save(txtCutiID.getText(), (txtTglAwal.getText()), (txtTglAkhir.getText()),\n txtKet.getText(), cmbCutiKhususID.getSelectedIndex());\n String message = \"Failed to save data...\";\n if (flag){\n message = \"Success to save data...\";\n }\n JOptionPane.showMessageDialog(this, message, \"Allert / Notification\", \n JOptionPane.INFORMATION_MESSAGE);\n \n bindingTable();\n reset();\n }", "void handleSaveClicked(ActionEvent event);", "private void outputFileNameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_outputFileNameActionPerformed\n // Autogenerated code, no need to do anything here\n }", "@Override\n public void actionPerformed(ActionEvent e){\n JFileChooser fileChooser = new JFileChooser();\n int status = fileChooser.showSaveDialog(null);\n \n //Check if they actually saved the file\n if (status == JFileChooser.APPROVE_OPTION) {\n File fileToSave = fileChooser.getSelectedFile();\n \n //Try block to make sure file actually exists\n try {\n FileOutputStream fos = new FileOutputStream(fileToSave);\n ObjectOutputStream out = new ObjectOutputStream(fos);\n out.writeObject(games);\n \n //Close the file\n fos.close();\n out.close();\n } catch (FileNotFoundException ex) {\n JOptionPane.showMessageDialog(null, \"Error: File not found\");\n } catch (IOException ex) {\n JOptionPane.showMessageDialog(null, \"Error: File I/O problem\");\n }\n \n //Tell the user it saved successfully\n JOptionPane.showMessageDialog(null, \"Saved as file: \" + fileToSave.getAbsolutePath());\n }\n }", "void saveFile () {\r\n\r\n\t\ttry {\r\n\t\t\tFileOutputStream fos = new FileOutputStream (\"Bank.dat\", true);\r\n\t\t\tDataOutputStream dos = new DataOutputStream (fos);\r\n\t\t\tdos.writeUTF (saves[count][0]);\r\n\t\t\tdos.writeUTF (saves[count][1]);\r\n\t\t\tdos.writeUTF (saves[count][2]);\r\n\t\t\tdos.writeUTF (saves[count][3]);\r\n\t\t\tdos.writeUTF (saves[count][4]);\r\n\t\t\tdos.writeUTF (saves[count][5]);\r\n\t\t\tJOptionPane.showMessageDialog (this, \"The Record has been Saved Successfully\",\r\n\t\t\t\t\t\t\"BankSystem - Record Saved\", JOptionPane.PLAIN_MESSAGE);\r\n\t\t\ttxtClear ();\r\n\t\t\tdos.close();\r\n\t\t\tfos.close();\r\n\t\t}\r\n\t\tcatch (IOException ioe) {\r\n\t\t\tJOptionPane.showMessageDialog (this, \"There are Some Problem with File\",\r\n\t\t\t\t\t\t\"BankSystem - Problem\", JOptionPane.PLAIN_MESSAGE);\r\n\t\t}\r\n\r\n\t}", "private void jButtonBrowseFileNameActionPerformed(ActionEvent e) {\n\t\tJFileChooser fileChooser = new JFileChooser();\n\t\tint result = fileChooser.showSaveDialog(this);\n\t\tif (result == JFileChooser.APPROVE_OPTION) {\n\t\t\tFile file = fileChooser.getSelectedFile();\n\t\t\tjTextFieldFileName.setText(file.getAbsolutePath());\n\t\t}\n\t}", "public void actionPerformed(final ActionEvent e) {\r\n\t\tFileDialog chooser = new FileDialog(this,\r\n\t\t\t\t\"Use a .png or .jpg extension\", FileDialog.SAVE);\r\n\t\tchooser.setVisible(true);\r\n\t\tif (chooser.getFile() != null) {\r\n\t\t\tsave(chooser.getDirectory() + File.separator + chooser.getFile());\r\n\t\t}\r\n\t}", "void saveFile() {\n\t\tJFileChooser fileChooser = new JFileChooser(desktopPath);\n\t\tint returnVal = fileChooser.showSaveDialog(null);\n\t\tif(returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\tFile filePath = fileChooser.getSelectedFile();\n\t\t\ttry {\n\t\t\t\tPrintWriter writer = new PrintWriter(filePath);\n\t\t\t\tScanner out = new Scanner(textEditor.getText());\n\t\t\t\twhile(out.hasNextLine()) {\n\t\t\t\t\twriter.println(out.nextLine());\n\t\t\t\t}\n\t\t\t\tout.close();\n\t\t\t\twriter.close();\n\t\t\t\ttextAreaChanged =false;\n\t\t\t\tsavedFilePath = filePath.getPath();\n\t\t\t\terrorTextArea.setText(\"\");\n\t\t\t} catch (Exception ex) {\n\t\t\t\terrorTextArea.setForeground(Color.RED);\n\t\t\t\terrorTextArea.setText(\"Error saving file\");\n\t\t\t}\n\t\t}\n\t}", "public String saveFile( Component parent )\n\t{\n\t\t\n\t JFileChooser fc = new JFileChooser();\n\t fc.setFileSelectionMode( JFileChooser.DIRECTORIES_ONLY);\n\t String s=null;\n\t //if( fc.showSaveDialog( parent ) == JFileChooser.SAVE_DIALOG )\n\t //{\n\t // return fc.getSelectedFile().getAbsolutePath();\n\t //}\n\t int rVal = fc.showSaveDialog(frame);\n\t if (rVal == JFileChooser.APPROVE_OPTION) {\n\t \n\t s=fc.getCurrentDirectory().toString()+\"/\"+fc.getSelectedFile().getName();\n\t }\n\t if (rVal == JFileChooser.CANCEL_OPTION) {\n\t \t JOptionPane.showMessageDialog(frame,\"you have pressed cancel,nothing will get saved\");\n\t }\n\t \n\n\t return s;\n\t}", "@Override\r\n\tpublic void exportar(ActionEvent actionEvent) {\n\t\t\r\n\t}", "private void saveProject()\n\t{\n\t\t\n\t\tint fileChooserReturnValue =\n\t\t\twindowTemplate\n\t\t\t\t.getFileChooser()\n\t\t\t\t.showSaveDialog(windowTemplate);\n\t\t\n\t\tif(fileChooserReturnValue == JFileChooser.APPROVE_OPTION) {\n\t\t\t\n\t\t\t// Get the file that the user selected\n\t\t\tFile file = windowTemplate.getFileChooser().getSelectedFile();\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\t// Open the output streams\n\t\t\t\tFileOutputStream fileOutput = new FileOutputStream(file.getAbsolutePath());\n\t\t\t\tObjectOutputStream objectOutput = new ObjectOutputStream(fileOutput);\n\t\t\t\n\t\t\t\t// Write the objects\n\t\t\t\tfor(int i = 0; i < cards.size(); i++) {\n\t\t\t\t\tobjectOutput.writeObject(cards.get(i));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Close the output streams\n\t\t\t\tobjectOutput.close();\n\t\t\t\tfileOutput.close();\n\t\t\t\t\n\t\t\t\t// Update the title of the frame to reflect the file name\n\t\t\t\twindowTemplate.setTitle(file.getName());\n\t\t\t\t\n\t\t\t} catch (IOException e1) {\n\t\t\t\tJOptionPane.showMessageDialog(windowTemplate, \"Could not save the file.\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "public void save() {\n\t\tBufferedWriter bw = null;\n\t\tFileWriter fw = null;\n\t\ttry {\n\t\t\tFile file = new File(\"fileSave.txt\");\n\t\t\tif(!file.exists()) {\n\t\t\t\tfile.createNewFile();\n\t\t\t}\n\t\t\tfw = new FileWriter(file);\n\t\t\tbw = new BufferedWriter(fw);\n\t\t\t//string to hold text to write on new file\n\t\t\tString text = textArea.getText();\n\t\t\t//write file\n\t\t\tif (text != null) {\n\t\t\t\tbw.write(text);\n\t\t\t}\n\t\t}\n\t\tcatch (IOException ie) {\n\t\t\tie.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tif (bw != null) {\n\t\t\t\t\tbw.close();\n\t\t\t\t\tfw.close();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException ie2) {\n\t\t\t\tie2.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t\tif (e.getSource() == this.openFile) {\r\n\t\t\tJFileChooser open = new JFileChooser();\r\n\t\t\tint option = open.showOpenDialog(this); // optiuni posibile selectate: approve sau cancel\r\n\t\t\t\r\n\t\t\tif (option == JFileChooser.APPROVE_OPTION) {\r\n\t\t\t\tthis.textArea.setText(\"\");\r\n\t\t\t\ttry {\r\n\t\t\t\t\tScanner scan = new Scanner(new FileReader(open.getSelectedFile().getPath()));\r\n\t\t\t\t\twhile (scan.hasNext()) {\r\n\t\t\t\t\t\tthis.textArea.append(scan.nextLine() + \"\\n\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tscan.close();\r\n\t\t\t\t} catch (Exception ex) {\r\n\t\t\t\t\tSystem.out.println(ex.getMessage());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\telse if (e.getSource() == this.saveFile) {\r\n\t\t\tJFileChooser save = new JFileChooser();\r\n\t\t\tint option = save.showSaveDialog(this); // atentie, e showSAVEdialog, nu ca sus, cu OPEN\r\n\t\t\t\r\n\t\t\tif (option == JFileChooser.APPROVE_OPTION) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tBufferedWriter out = new BufferedWriter(new FileWriter(save.getSelectedFile().getPath()));\r\n\t\t\t\t\tout.write(this.textArea.getText());\r\n\t\t\t\t\tout.close();\r\n\t\t\t\t} catch (Exception ex) {\r\n\t\t\t\t\tSystem.out.println(ex.getMessage());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\telse if (e.getSource() == this.exit) {\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t\t\r\n\t\telse if (e.getSource() == this.about) {\r\n\t\t\tJOptionPane.showMessageDialog(this, \"Dragos' Notepad v0.2\\nPerju Dragoș-Ștefan\");\r\n\t\t}\r\n\t}", "@SuppressWarnings(\"unchecked\")\n\tprivate void jMenuItem7ActionPerformed(ActionEvent evt) {\n\t\tJFileChooser _fileChooser = new JFileChooser();\n\t\tint retval = _fileChooser.showSaveDialog(Main.this);\n\n\t\tfinal String[] okFileExtensions = new String[] { \"jpg\", \"png\", \"gif\", \"bmp\", \"jpeg\" };\n\t\tFile file;\n\n\t\tif (retval == JFileChooser.APPROVE_OPTION) {\n\t\t\tfile = _fileChooser.getSelectedFile();\n\t\t\tBoolean flag = false;\n\t\t\tfor (String extension : okFileExtensions) {\n\t\t\t\tif (file.getName().toLowerCase().endsWith(extension)) {\n\t\t\t\t\tif (outputFile == null) {\n\t\t\t\t\t\tSystem.err.println(\"Error!! No file to save\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\toutputFile = file;\n\t\t\t\t\t\tfileExtension = extension;\n\t\t\t\t\t\tBufferedImage bi = (BufferedImage) entry.getImage();\n\t\t\t\t\t\tImageIO.write(bi, fileExtension, outputFile);\n\t\t\t\t\t\tSystem.out.println(\"Saved\");\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tSystem.err.println(\"Error!! File not saved\");\n\t\t\t\t\t}\n\n\t\t\t\t\tflag = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!flag) {\n\t\t\t\tJOptionPane.showMessageDialog(this, \"Please choose a jpg, jpeg, png, bmp or gif file only.\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t}", "@Override\n\t public void actionPerformed(ActionEvent arg0) {\n\t\t JFileChooser j = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory()); \n\t\t\n\t\t // invoke the showsOpenDialog function to show the save dialog \n\t\t int r = j.showOpenDialog(null); \n\t\t\n\t\t // if the user selects a file \n\t\t if (r == JFileChooser.APPROVE_OPTION) \n\t\t\n\t\t { \n\t\t // set the label to the path of the selected file \n\t\t textfield.setText(j.getSelectedFile().getAbsolutePath()); \n\t\t\n\t\t } \n\t\t // if the user cancelled the operation \n\t\t \n\t\t //\n\t\t \n\t\t }", "private void saveOutputFile() {\n FileChooser fileChooser = new FileChooser();\n if (textMergeScript.hasCurrentDirectory()) {\n fileChooser.setInitialDirectory (textMergeScript.getCurrentDirectory());\n }\n chosenOutputFile = fileChooser.showSaveDialog (ownerWindow);\n if (fileChooser != null) {\n writeOutput();\n openOutputDataName.setText (tabNameOutput);\n }\n }", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tString target = e.getActionCommand();\n\t\tswitch (target) {\n\t\tcase \"保存\":\n\t\t\tif(customerNameTf.getText().trim().equals(\"\")||\n\t\t\t\t\taddressTf.getText().trim().equals(\"\")||\n\t\t\t\t\tshortsTf.getText().trim().equals(\"\")||\n\t\t\t\t\tzipTf.getText().trim().equals(\"\")||\n\t\t\t\t\ttelTf.getText().trim().equals(\"\")||\n\t\t\t\t\tfaxTf.getText().trim().equals(\"\")||\n\t\t\t\t\tcontactsTf.getText().trim().equals(\"\")||\n\t\t\t\t\tphoneTf.getText().trim().equals(\"\")||\n\t\t\t\t\temailTf.getText().trim().equals(\"\")||\n\t\t\t\t\tbankTf.getText().trim().equals(\"\")||\n\t\t\t\t\taccountTf.getText().trim().equals(\"\")) {\n\t\t\t\t\n\t\t\t\tJOptionPane.showMessageDialog(null, \"请填写全部信息\",\"温馨提示\",JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//客户编号\n\t\t\tString id = customerService.getCustomerId();\n\t\t\t//将客户添加到数据库\n\t\t\tCustomer customer = new Customer(id, customerNameTf.getText().trim(), shortsTf.getText().trim(), addressTf.getText().trim(), \n\t\t\t\t\tzipTf.getText().trim(), telTf.getText().trim(), faxTf.getText().trim(), contactsTf.getText().trim(), \n\t\t\t\t\tphoneTf.getText().trim(), bankTf.getText().trim(), accountTf.getText().trim(), \n\t\t\t\t\temailTf.getText().trim(), 1);\n\t\t\tboolean result;\n\t\t\ttry {\n\t\t\t\tresult = customerService.addCustomer(customer);\n\t\t\t} catch (CustomerExistException e1) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\tJOptionPane.showMessageDialog(null, e1.getMessage(),\"警告\",JOptionPane.WARNING_MESSAGE);\n\t\t\t}\n\t\t\tif(result=true) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"客户信息添加成功\",\"提示\",JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\tsetNull();\n\t\t\t}else {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"客户信息添加失败\",\"警告\",JOptionPane.WARNING_MESSAGE);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"重置\":\n\t\t\tsetNull();\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}", "private void txttenfileActionPerformed(java.awt.event.ActionEvent evt) {\n }", "private void saveToFile(){\n this.currentMarkovChain.setMarkovName(this.txtMarkovChainName.getText());\n saveMarkovToCSVFileInformation();\n \n //Save to file\n Result result = DigPopGUIUtilityClass.saveDigPopGUIInformationSaveFile(\n this.digPopGUIInformation,\n this.digPopGUIInformation.getFilePath());\n }", "void saveSet() {\n if( file==null ) {\n int returnVal = fc.showSaveDialog(this);\n if (returnVal != JFileChooser.APPROVE_OPTION) {\n System.out.println(\"Open command cancelled by user.\");\n return;\n }\n file = fc.getSelectedFile();\n }\n System.out.println(\"Saving to: \" + file.getName());\n try {\n int count = tabbedPane.getTabCount();\n ArrayList l = new ArrayList();\n for(int i=0; i< count; i++) {\n rrpanel= (RoombaRecorderPanel)tabbedPane.getComponentAt(i);\n l.add(rrpanel.copy());\n }\n FileOutputStream fos = new FileOutputStream(file);\n ObjectOutputStream oos = new ObjectOutputStream(fos);\n //oos.writeObject(loopButton);\n //oos.writeObject(\n oos.writeObject(l);\n oos.close();\n } catch( Exception e ) {\n System.out.println(\"Save error \"+e);\n }\n }", "public void actionPerformed(java.awt.event.ActionEvent evt) {\n if (!askSave()) {\n return;\n }\n //loop until user choose valid file\n while (true) {\n int result = chooser.showOpenDialog(form);\n //check if user chooser approve option\n if (result == JFileChooser.APPROVE_OPTION) {\n File openFile = chooser.getSelectedFile();\n //check if open file is exist\n if (openFile.exists()) {\n file = openFile;\n text.setText(\"\");\n setSaveTitle(openFile.getName());\n writeToTextArea(openFile);\n saved = true;\n break;\n } else {\n JOptionPane.showMessageDialog(form, \"File not found\", \"Open\", JOptionPane.OK_OPTION);\n }\n } else {\n break;\n }\n\n }\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n if(!src.isEmpty()) {\n String texto= textArea.getText();\n String[] textArray= texto.split(\"\\n\");\n WriteFile data= new WriteFile(src,true);\n File file= new File(src);\n file.delete();\n for(int i=0;i<textArray.length;i++) {\n //System.out.println(\"lineas\");\n //System.out.println(textArray[i]);\n try {\n data.writeToFile(textArray[i]);\n } catch (IOException e1) {\n e1.printStackTrace();\n }\n }\n textSalida.append(\"\\nguardado exitoso\");\n }\n else\n {\n src=guardarGUI();\n if(!src.isEmpty()) {\n\t String texto= textArea.getText();\n\t String[] textArray= texto.split(\"\\n\");\n\t WriteFile data= new WriteFile(src,true);\n\t File file= new File(src);\n\t file.delete();\n\t for(int i=0;i<textArray.length;i++) {\n\t //System.out.println(\"lineas\");\n\t //System.out.println(textArray[i]);\n\t try {\n\t data.writeToFile(textArray[i]);\n\t } catch (IOException e1) {\n\t e1.printStackTrace();\n\t }\n\t }\n\t textSalida.append(\"\\nguardado exitoso\");\n }\n }\n }", "private void save()\n\t{\n\t\t//get the text\n\t\tString spssTxt = spssText.getText();\n\t\t//save it to a JS place where Java can find it\n\t\tsaveToJS(spssTxt);\n\t\t//make up a file name\n\t\tString fileName = form.getText().replace(\" \", \"_\").replace(\"\\\\\", \"\").replace(\"/\",\"\").replace(\"*\", \"\").replace(\"\\\"\", \"\")\n\t\t\t\t.replace(\"<\", \"\").replace(\">\", \"\").replace(\"#\", \"\").replace(\"'\", \"\") + \".spss\";\t\t\n\t\t\n\t\t\n\t\t\n\t\tappletHtml.setHTML(\"<APPLET codebase=\\\"fileioapplets/\\\"+\" +\n\t\t\t\t\" archive=\\\"kobo_fileIOApplets.jar, plugin.jar\\\" \"+\n\t\t\t\t\" code=\\\"org.oyrm.kobo.fileIOApplets.ui.FileSaveApplet.class\\\" \"+\n\t\t\t\t\" width=\\\"5\\\" HEIGHT=\\\"5\\\" MAYSCRIPT> \"+\n\t\t\t\t\"<param name=\\\"formName\\\" value=\\\"\"+fileName+\"\\\"/>\"+\n\t\t\t\t\"<param name=\\\"save\\\" value=\\\"\"+LocaleText.get(\"SaveSPSSFile\")+\"\\\"/>\"+\n\t\t\t\t\"</APPLET>\");\n\t}", "@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 void actionPerformed(ActionEvent e) {\r\n\t\tboolean saveTitle = saveTile();\r\n\t\tPlotConfiguration config = plot.getPlotConfiguration();\r\n\t\tFile file = FileChooserUtilities.getSaveFile(Tools.getConfigFolder(config));\r\n\r\n\t\tif (file != null) {\r\n\t\t\ttry {\r\n\t\t\t\tconfig.save(file, saveTitle);\r\n\t\t\t} catch (IOException ex) {\r\n\t\t\t\tLogger.error(\"Error saving configuration \" + ex.getMessage());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@FXML\n\tprivate void onSaveClicked(){\n\t\tPrintWriter writer = null;\n\t\ttry {\n\t\t\tFile file = new File(\"log.txt\");\n\t\t\tif (!file.exists()) {\n\t\t\t\tfile.createNewFile();\n\t\t\t}\n\t\t\tFileWriter fw = new FileWriter(file, true);\n\t\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\t\twriter = new PrintWriter(bw);\n\t\t\twriter.println(\"New record\");\n\t\t\tfor (int i = 0; i < list.size(); i++) {\n\n\t\t\t\twriter.println(list.get(i) +\" & \"+ (dat.get(i)));\n\t\t\t}\n\t\t} catch (IOException ioe) {\n\t\t\ttextArea.setText(\"Exception occurred:\" + ioe.getMessage());\n\t\t} finally {\n\t\t\tif (writer != null) {\n\t\t\t\twriter.close();\n\t\t\t}\n\t\t}\n\n\t}", "@FXML\n private void saveFile() {\n FileHandler.saveFileData(stage, dRegister);\n }", "public void saveNewFile() {\n\t\tJFileChooser choose = new JFileChooser();\n\t\tif(choose.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) {\n\t\ttry {\n\t\t\t\tdir=choose.getCurrentDirectory().toString();\n\t\t\t\tString fileName =dir+ \"\\\\\" + choose.getSelectedFile().getName();\n\t\t\t File file = new File(fileName);\n\t\t\t if(file.exists()) {\n\t\t\t \tint confirm = JOptionPane.showConfirmDialog(null, \n\t\t\t \t\t\t\"File already exists. Do you want to overwrite it?\",\n\t\t\t \t\t\t\"Choose one\",JOptionPane.YES_NO_OPTION);\n\t\t\t \tif(confirm == JOptionPane.NO_OPTION)return;\n\t\t\t }\n\t\t\t\tPrintWriter writer = new PrintWriter(file);\n\t\t\t\twriter.write(frame.textArea.getText());\n\t\t\t\twriter.close();\n\t\t\t\tframe.setTitle(choose.getSelectedFile().getName()+\"-Text Editor\");\n\t\t\t\tframe.originalText=frame.textArea.getText();\n\t\t\t} catch (FileNotFoundException e1) {\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "private void saveDialog() {\n JFileChooser chooser = new JFileChooser();\n \n FileFilter ff = new FileFilter() {\n\n @Override\n public boolean accept(File f) {\n // TODO Auto-generated method stub\n return f.getName().endsWith(FILE_EXTENSION);\n }\n\n @Override\n public String getDescription() {\n return \"CSV\";\n }\n\n };\n chooser.addChoosableFileFilter(ff);\n chooser.setAcceptAllFileFilterUsed(true);\n chooser.setFileFilter(ff);\n chooser.showSaveDialog(null);\n this.file = chooser.getSelectedFile();\n //this.file = new File(chooser.getSelectedFile().getName() + INSTANCE.FILE_EXTENSION);\n\n\n try {\n\n if (file != null) {\n this.saveData();\n this.isModifed = false;\n }\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, e.getMessage(), \"Error Saving File\", JOptionPane.ERROR_MESSAGE);\n\n }\n\n }", "private void saveListener() {\n buttonPanel.getSave().addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n toDoList.saveAll(fileLocation);\n }\n });\n }", "private void saveAsButton(){\n SaveAsLabNameTextField.setText(\"\");\n SaveAsErrorLabel.setVisible(false);\n SaveAsDialog.setVisible(true);\n }" ]
[ "0.7734016", "0.75014573", "0.7446818", "0.74432725", "0.73747116", "0.73527575", "0.7322843", "0.7192904", "0.71382093", "0.71199644", "0.71042", "0.7090001", "0.7071987", "0.70126927", "0.6950616", "0.6935624", "0.69007266", "0.6855498", "0.68500113", "0.68279064", "0.6822784", "0.67938554", "0.67898846", "0.676382", "0.6757825", "0.6744901", "0.6734285", "0.67274153", "0.6701287", "0.6694499", "0.66857105", "0.664031", "0.6621287", "0.6548643", "0.6531948", "0.6518754", "0.6516903", "0.6515061", "0.65137583", "0.65068936", "0.6504223", "0.6495895", "0.64841455", "0.6480725", "0.64772934", "0.64738715", "0.645829", "0.64415735", "0.64371693", "0.64341307", "0.643317", "0.6430689", "0.64292014", "0.64278764", "0.64213574", "0.6418714", "0.64169115", "0.6407405", "0.64000726", "0.63892895", "0.6388595", "0.63757145", "0.63699967", "0.6366427", "0.6359923", "0.63482535", "0.63472533", "0.6345819", "0.63346297", "0.633425", "0.6325648", "0.6320576", "0.63152504", "0.6306076", "0.63040584", "0.62945527", "0.6285814", "0.62816703", "0.6278836", "0.6278206", "0.6273198", "0.62620693", "0.62554026", "0.6253035", "0.6248947", "0.6234193", "0.62341547", "0.6230227", "0.62241536", "0.6221123", "0.62183934", "0.6211672", "0.6209652", "0.6208323", "0.6193505", "0.6187529", "0.61840856", "0.61770195", "0.6174183", "0.61700153" ]
0.72294384
7
GENLAST:event_btnExitActionPerformed It will count the row of JTable
public int toCount() { int count=jt.getRowCount(); return count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int getJTableNumberOfRows() {\n\n\t\tint count = 0; /* create a integer object for rows count */\n\t\tConnection connection = null;\n\t\tStatement statement = null;\n\t\ttry {\n\t\t\tconnection = DriverManager.getConnection(DATABASE_URL, UserName_SQL, Password_SQL);\n\t\t\tstatement = connection.createStatement();\n\t\t\tResultSet resultSet = statement.executeQuery(\"SELECT COUNT(*) as numberOfRows FROM invoice\");\n\t\t\tresultSet.next();\n\t\t\tcount = resultSet.getInt(\"numberOfRows\");\n\t\t\tresultSet.close();\n\t\t} // end try\n\t\tcatch (SQLException sqlException) {\n\t\t\tsqlException.printStackTrace();\n\t\t\tSystem.exit(1);\n\t\t} // end catch\n\t\tfinally // ensure statement and connection are closed properly\n\t\t{\n\t\t\ttry {\n\t\t\t\tstatement.close();\n\t\t\t\tconnection.close();\n\t\t\t} // end try\n\t\t\tcatch (Exception exception) {\n\t\t\t\texception.printStackTrace();\n\t\t\t\tSystem.exit(1);\n\t\t\t} // end catch\n\t\t} // end finally\n\t\treturn count; /* return the result of rows count */\n\t}", "private int numRows(){\n return attrTable.getModel().getRowCount();\n }", "@Override\n public int getRowCount() {\n return data.length-1; \n }", "int getRowCount();", "int getRowCount();", "int getRowCount();", "int getRowCount();", "int getRowCount();", "int getRowCount();", "int getRowCount();", "public int getRowCount();", "public int getRowCount() \n\t{ return rowcounter; }", "int rowCount();", "public int getRowCount() {\n return 0;\n }", "public int getRowCount() { return this.underlying.getRowCount(); }", "public int getRowCount() {\r\n int currentRowCount = this.table.getRowCount();\r\n if (currentRowCount > rowCount) {\r\n rowCount = currentRowCount;\r\n }\r\n return rowCount;\r\n }", "@Override\r\n public int getRowCount() {\n return this.rowData.size();\r\n }", "public static int getRowCount(){\n \n int row=0;\n boolean empty=false; //row is not empty \n do{\n String b = (String) jTable1.getValueAt(row, 0);\n if (b != null && b.length() != 0) {\n row++; //row count\n } else {\n empty = true;\n }\n }while (!empty);\n return row; //returns row value\n }", "@Override\n public int getRowCount() {\n return (model == null) ? 0 : model.getRowCount(); \n }", "public int getRowCount() {\r\n //return outputs.length;\r\n return NUM_ROW;\r\n }", "public int getRowCount() {\r\n return this.rowCount;\r\n }", "public int getRowCount()\n {\n return getModel().getSize();\n }", "@Override\n\t\t\tpublic int getRow() {\n\t\t\t\treturn count;\n\t\t\t}", "double getRowCount();", "public static int getTableRowCount() {\n\t\treturn TABLE_ROW_COUNT;\n\t}", "public int getRowCount()\r\n\t{\r\n\t\treturn rowCount;\r\n\t}", "public int getRowCount(){\n return dataEntries.length;\n }", "@Override\n\tpublic int getRowCount() {\n\t\treturn rowCount;\n\t}", "@Override\n\tpublic int getRowCount() {\n\t\treturn rowCount;\n\t}", "public int rowCount() {\n\t\treturn n_;\n\t}", "@Override\n\tpublic int getRowCount() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int getRowCount() {\n\t\treturn 0;\n\t}", "public int getRowCount() {\n return this.rowCount;\n }", "public abstract int getModelRowCount();", "@Override\n public int getRowCount() {\n return this.filas.size();\n \n }", "@Override\n\tpublic int getRowCount() {\n\t\treturn rowData.size();\n\t}", "public int getRowCount() {\n return row_.size();\n }", "public int getRowCount() {\n return row_.size();\n }", "public int getRowCount() {\n return row_.size();\n }", "public int getRowCount() {\n return row_.size();\n }", "public int getRowCount() {\n return row_.size();\n }", "public int getRowCount() {\n return row_.size();\n }", "@Override\r\n\tpublic int getRowCount() {\n\t\treturn rowData.length;\r\n\t}", "public int getRowCount() {\r\n\t\treturn(noOfRows);\r\n\t}", "@Override\n\tpublic int getRowCount() {\n\t\treturn rh.size();\n\t}", "private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(0,0,1500,1500);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\tframe.setVisible(true);\r\n\t\tJLabel label = new JLabel(\"\");\r\n\t\tlabel.setIcon(new ImageIcon(\"iou.png\"));\r\n\t\tlabel.setBounds(528, 36, 392, 384);\r\n\t\tframe.getContentPane().add(label);\r\n\t\tJButton b=new JButton(\"Return\");\r\n\t\tb.setBounds(1100,600,100,20);\r\n\t\t b.addActionListener(new ActionListener(){ \r\n\t\t\t public void actionPerformed(ActionEvent e){\r\n\t\t\t \t frame.dispose();\r\n\t\t\t \tPockets f4=new Pockets(5);\r\n\t\t\t\t\t\r\n\t\t\t } \r\n\t\t\t });\r\n\t\t frame.add(b);\r\n\t\t\r\n\t\t\tString Sa[][]=new String [10][4];\r\n\t\t Sa[0][0]= \"IOU\";\r\n\t\t Sa[0][1]=\"Amount\";\r\n\t\t Sa[0][2]=\"UOMe\";\r\n\t\t Sa[0][3]=\"Amount\";\r\n\t\t for(Entry<String, DATA> entry:DATA.map.entrySet()){ \r\n\t\t\t String key=entry.getKey(); \r\n\t\t\t DATA ba=entry.getValue(); \r\n\t\t\t int a;\r\n\t\t\t if(key.contentEquals(Pockets.NAME)){\r\n\t\t\t \tif(ba.count1>ba.count2) {\r\n\t\t\t \t\ta=ba.count1;\r\n\t\t\t \t}\r\n\t\t\t \telse\r\n\t\t\t \t\ta=ba.count2;\r\n\t\t\t \tSystem.out.println(a);\r\n\t\t\t for(int i=0;i<a;i++) {\r\n\t\t\t \tfor(int j=0;j<4;j++) {\r\n\t\t\t \t\tSa[i+1][j]=ba.S[i][j];\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 }\r\n\t\t\t \r\n\t\t\t }}\r\n\t\t\t\r\n\t\r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t table = new JTable(Sa,new String[] {\r\n\t\t\t\t\t\"IOU\", \"Amount\", \"UOMe\", \"Amount\"\r\n\t\t\t\t});\r\n//\t\ttable.setModel(new DefaultTableModel(\r\n//\t\t\tS,\r\n//\t\t\tnew String[] {\r\n//\t\t\t\t\"IOU\", \"Amount\", \"UOMe\", \"Amount\"\r\n//\t\t\t}\r\n//\t\t));\r\n//\t\t\r\n\t\r\n\t\t\r\n\t\ttable.setBounds(484, 484, 516, 160);\r\n\t\tframe.getContentPane().add(table);\r\n\t\t\r\n\t\tJLabel lblNewLabel = new JLabel(\"KEEP TRACK OF WHO OWES YOU MONEY!\");\r\n\t\tlblNewLabel.setFont(new Font(\"Stencil\", Font.BOLD | Font.ITALIC, 20));\r\n\t\tlblNewLabel.setBounds(101, 142, 419, 39);\r\n\t\tframe.getContentPane().add(lblNewLabel);\r\n\t\t\r\n\t\tJLabel lblNewLabel_1 = new JLabel(\"SO YOU NEVER FORGET PAYIN EM BACK!\");\r\n\t\tlblNewLabel_1.setFont(new Font(\"Stencil\", Font.BOLD | Font.ITALIC, 21));\r\n\t\tlblNewLabel_1.setBounds(930, 288, 430, 39);\r\n\t\tframe.getContentPane().add(lblNewLabel_1);\r\n\t}", "@Override\n\t\tpublic int getRowCount() \n\t\t{\n\t\t\treturn tables.size();\n\t\t}", "public String updateRowCount() {\n return null;\n }", "public int getRowCount() {\r\n return this.data.length;\r\n }", "int getRowsCount();", "public void toDeletIndex()\n {\n try\n { \n //DefaultTableModel model=(DefaultTableModel)jt.getModel(); \n //jt.getModel();\n int num=Integer.parseInt(JOptionPane.showInputDialog(rootPane,\"Enter the row number\")); \n jtModel.removeRow(num-1);\n JOptionPane.showMessageDialog(rootPane,\"Successfully deleted selected row number \" +num);\n }\n catch(NumberFormatException ex)\n {\n JOptionPane.showMessageDialog(rootPane,\"Enter integer not alphabet\");\n } \n catch(ArrayIndexOutOfBoundsException ex)\n {\n JOptionPane.showMessageDialog(rootPane,\"This row dosent exist\");\n }\n }", "public int getRowCount() {\n\t\treturn(data.length);\n\t}", "@Override\n\tpublic int getRowCnt() {\n\t\treturn invBaseStockDao.getRowCnt();\n\t}", "public int getRowCount()\n\t{\n\t\treturn m_data.rows.size();\n\t}", "public int getNrow(){\r\n \treturn this.nrow;\r\n \t}", "public int getRowCount() {\n return _data.size();\n }", "public int getRowCount()\n {\n return numRows;\n }", "public int getRowCount() {\n\t\treturn(data.size());\n\t}", "public int getRowCount() {\n\t\treturn rowcount;\n\t}", "int totalRows(){\n return row;\n }", "@Override\n\tpublic int getNumRows() {\n\t\treturn 0;\n\t}", "public int getRowCount() {\n return noeuds.size();\n }", "public int getNumRows() { \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Getter for the number of rows\n\t\treturn numRows; \n\t}", "public int getRowCount() {\n\t\treturn this.records.size();\n\t}", "public abstract int getNumOfRows();", "@Override\n public int getRowCount() {\n return this.data.length;\n }", "public int getRowCount()\n\t{\n\t\treturn datas.size();\n\t}", "int getTotalsRowCount();", "@Override\n\tpublic int getRowCount() {\n\t\treturn data.length;\n\t}", "@Override\n\tpublic int getRowCount() {\n\t\treturn data.length;\n\t}", "@Override\n\tpublic int getRowCount() {\n\t\tint i = 0;\n\t\tfor(i=0;;i++){\n\t\t\tif(dataAll[i][0]==null)\n\t\t\t\tbreak;\n\t\t}\n\t\treturn i;\n\t}", "public int getRowCount() {\n\t\treturn _rowCount;\n\t}", "public int getRowCount() {\n\t\treturn _rowCount;\n\t}", "public int getRowCount() {\n return data.size();\n }", "public int getRowNo() {\n return rowIndex+1;\n }", "@Override\r\n public int getRowCount() {\n if (leitores != null) {\r\n return leitores.size();\r\n }\r\n return 0;\r\n }", "public void actionPerformed(ActionEvent arg0) {\n\t\t \r\n\t\t\t\tmodelo =(DefaultTableModel) table.getModel();\r\n\t\t\t\tmodelo.addRow(new Object[filas]);\r\n\t\t\t\tfor (int x=0;x<table.getColumnCount()-1;x++) {\r\n\t\t\t\t\tmodelo.setValueAt(\"001\",filas,0);\r\n\t\t\t\t\tmodelo.setValueAt(\"\",filas,1);\r\n\t\t\t\t\tmodelo.setValueAt(\"\",filas,2);\r\n\t\t\t\t\tmodelo.setValueAt(\"\",filas,3);\r\n\t\t\t\t\tmodelo.setValueAt(\"\",filas,4);\r\n\t\t\t\t\tmodelo.setValueAt(\"\",filas,5);\r\n\t\t\t\t\tmodelo.setValueAt(\"\",filas,6);\r\n\t\t\t\t}\r\n\t\t\t\tfilas++;\r\n\t\t\t}", "private void rowCountTextFldActionPerformed(java.awt.event.ActionEvent evt) {\n }", "public int getRowCount() {\n return data.length;\n }", "public void actionPerformed(ActionEvent e) {\n if(newTable.getRowCount() == 0){\n Toolkit.getDefaultToolkit().beep();\n return;\n }\n int index = table.getSelectedRow();\n int size = newTable.getRowCount();\n if(index > size || index < 0){\n table.setRowSelectionInterval(0,0);\n index = table.getSelectedRow();\n }\n newTable.removeRow(index);\n \n\n //Select an index.\n index--;\n if(index < 0){\n index++;\n }\n if(newTable.getRowCount() != 0){\n table.setRowSelectionInterval(index, index);\n }\n }", "public abstract int getNumRows();", "public int getTotalRowCount() {\r\n return totalRowCount;\r\n }", "@Override\r\n\tpublic void updateNbCol() {\r\n\t\treturn;\r\n\t}", "@Override\r\n public int getRowCount() {\n return fixHashtables.length;\r\n }", "public int numberOfRows() {\n\t\treturn rowCount;\n\t}", "@Override\n public int getRowCount() {\n \n return data.size();\n }", "public int getNumRows() { return numRows; }", "@Override\n public int getRowCount() {\n return sessionRow.size();\n }", "public int getRowCount(){\n \treturn calculators.length;\n }", "public int getTotalRows();", "@Override\n\t\tpublic int getColumnCount() {\n\t\t\treturn app.graph.verticesCount + 1;\n\t\t}", "@Override\r\n\tpublic int getRowCount() {\n\t\t\r\n\t\treturn variableData.size();\r\n\t}", "void setTotalsRowCount(int count);", "@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 jtbViewStockDetails = new javax.swing.JTable();\n jbtnExit = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Stock Details\");\n\n jtbViewStockDetails.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n\n }\n ));\n jScrollPane1.setViewportView(jtbViewStockDetails);\n\n jbtnExit.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n jbtnExit.setText(\"Exit\");\n jbtnExit.setPreferredSize(new java.awt.Dimension(55, 30));\n jbtnExit.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbtnExitActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 707, Short.MAX_VALUE)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jbtnExit, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 276, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jbtnExit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }", "@Override\n\tpublic int getRowCount() {\n\t\treturn records.size();\n\t}", "public int getRowCount()\n {\n return al.size();\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tdelRow();\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tdelRow();\n\t\t\t}", "@Override\n public int getRowCount() { return data.length; }", "public void mouseClicked(MouseEvent e) {\n\t\t\tif(e.getSource()==exit){\n\t\t\t\tm.jumpTomanagerMenuUI();\t\t\t\n\t\t\t}else if(e.getSource()==logtable){\n\t\t\t\tint a = logtable.getSelectedRow();System.out.println(\"被选中的行数:\"+a);\n\t\t\t}\t\t\t\n\t\t\trepaint();\n\t\t}" ]
[ "0.70017624", "0.6796478", "0.6620771", "0.66158754", "0.66158754", "0.66158754", "0.66158754", "0.66158754", "0.66158754", "0.66158754", "0.6611008", "0.65827936", "0.65499634", "0.6540624", "0.64922994", "0.6432249", "0.6413549", "0.6403884", "0.6393546", "0.63693106", "0.63143575", "0.631105", "0.63041776", "0.63011414", "0.6299641", "0.6293218", "0.6291619", "0.6284603", "0.6284603", "0.62740934", "0.6264377", "0.6264377", "0.62610817", "0.6238242", "0.623476", "0.6223907", "0.62228924", "0.62228924", "0.62228924", "0.62228924", "0.62228924", "0.62228924", "0.6218101", "0.62157285", "0.6206906", "0.61887914", "0.6181584", "0.6173676", "0.6148587", "0.6145614", "0.6137379", "0.61350846", "0.6129152", "0.6128184", "0.61225677", "0.61207503", "0.6106707", "0.60890865", "0.60857517", "0.6072869", "0.6065779", "0.604565", "0.60452664", "0.60450464", "0.6042203", "0.6034731", "0.6030513", "0.60264355", "0.6017271", "0.6017271", "0.60157734", "0.60147667", "0.60147667", "0.60133046", "0.601034", "0.600174", "0.59985405", "0.59897035", "0.59878266", "0.59832895", "0.597971", "0.5967205", "0.5962567", "0.59530014", "0.5949147", "0.59486336", "0.5945434", "0.5933056", "0.5932854", "0.5929225", "0.5921922", "0.5920163", "0.59151644", "0.5910435", "0.5908874", "0.5904667", "0.5900318", "0.5900318", "0.58992064", "0.5898149" ]
0.6353952
20
to add quality details which will return the value
private String getQuality() { if(high.isSelected()) { return "High"; } else if(medium.isSelected()) { return "Medium"; } else if(mild.isSelected()) { return "Mild"; } else { return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getQuality();", "public float getQuality();", "public int getQuality() {\n return quality;\n }", "public int getQuality() {\n return quality;\n }", "public int getQuality() {\n return quality;\n }", "public double getQuality() {\n return quality;\n }", "Quality getQ();", "public String getQuality()\n\t{\n\t\treturn quality.getText();\n\t}", "java.lang.String getQualityMax();", "public void setQuality(float quality);", "public void setQuality(int quality) {\n this.quality = quality;\n }", "public void setQuality(int quality) {\n this.quality = quality;\n }", "public void setQuality(Integer quality) {\n this.quality = quality;\n }", "public com.google.protobuf.ByteString\n getQualityBytes() {\n java.lang.Object ref = quality_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n quality_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public java.lang.String getQuality() {\n java.lang.Object ref = quality_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n quality_ = s;\n }\n return s;\n }\n }", "public java.lang.String getQuality() {\n java.lang.Object ref = quality_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n quality_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public void setQuality(int value) {\n this.quality = value;\n }", "public com.google.protobuf.ByteString\n getQualityBytes() {\n java.lang.Object ref = quality_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n quality_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public int get_quality() {\n return (int)getUIntBEElement(offsetBits_quality(), 16);\n }", "com.google.protobuf.ByteString\n getQualityBytes();", "int getImageQualityPref();", "boolean hasQuality();", "boolean hasQuality();", "public String computeQualityChangeExpression() {\n\t\tif (getQualityChangeExpression() != null)\n\t\t\treturn getQualityChangeExpression();\n\n\t\tif (category.getQualityChangeExpression() != null)\n\t\t\treturn category.getQualityChangeExpression();\n\n\t\treturn null;\n\t}", "public int getQuality()\n {\n int sleeplatencyScore = getSleepLatencyScore();\n int sleepDurationScore = getSleepDurationScore();\n int sleepEfficiencyScore= getSleepEfficiencyScore();\n int sleepDeepsleepRatioScore = getDeepSleepRatioScore();\n int nightTimeWakeScore = getNightTimeAwakeningScore();\n int sum = sleeplatencyScore + sleepDurationScore+ sleepEfficiencyScore+ sleepDeepsleepRatioScore+ nightTimeWakeScore;\n sum = sum *4;\n return sum;\n }", "public String getHistologicalQuality()\r\n \t{\r\n \t\treturn histologicalQuality;\r\n \t}", "public String initialVideoQuality() {\n int backCameraId = CameraHolder.instance().getBackCameraId();\n String defaultStr = null;\n if (mCameraId == backCameraId) {\n// defaultStr = mContext.getString(R.string.pref_back_video_quality_default);\n defaultStr = SystemProperties.get(BACK_CAMERA_DEFAULT_VIDEO_QUALITY_VALUE,\"\");\n } else {\n// defaultStr = mContext.getString(R.string.pref_front_video_quality_default);\n defaultStr = SystemProperties.get(FRONT_CAMERA_DEFAULT_VIDEO_QUALITY_VALUE,\"\");\n }\n int quality = 0;\n if(defaultStr == null || defaultStr.length() < 1) {\n ArrayList<String> supprotedQuality = getSupportedVideoQuality();\n String[] candidateArray = (mCameraId == backCameraId) ?\n mContext.getResources().getStringArray(R.array.pref_video_quality_entryvalues) :\n mContext.getResources().getStringArray(R.array.pref_front_video_quality_entryvalues);\n\n for(String candidate:candidateArray) {\n if(supprotedQuality.indexOf(candidate) >= 0) {\n defaultStr = candidate;\n break;\n }\n }\n }\n if(defaultStr != null) {\n quality = Integer.valueOf(defaultStr);\n if (CamcorderProfile.hasProfile(mCameraId, quality)) {\n SharedPreferences.Editor editor = ComboPreferences\n .get(mContext).edit();\n editor.putString(KEY_VIDEO_QUALITY, defaultStr);\n editor.apply();\n return defaultStr;\n }\n }\n return Integer.toString(CamcorderProfile.QUALITY_HIGH);\n }", "public int getProfileQuality() {\n String videoQualityKey;\n SettingsManager settingsManager = this.mActivity.getSettingsManager();\n if (isCameraFrontFacing()) {\n videoQualityKey = Keys.KEY_VIDEO_QUALITY_FRONT;\n } else {\n videoQualityKey = Keys.KEY_VIDEO_QUALITY_BACK;\n }\n int videoQuality = settingsManager.getInteger(SettingsManager.SCOPE_GLOBAL, videoQualityKey).intValue();\n Tag tag = TAG;\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"Selected video quality for '\");\n stringBuilder.append(videoQuality);\n Log.d(tag, stringBuilder.toString());\n return videoQuality;\n }", "@Override\n public void eCGSignalQuality(int value, int timestamp) {\n }", "public DriftCheckModelQuality getModelQuality() {\n return this.modelQuality;\n }", "public Collection getQualityResults()\r\n {\r\n return mQualityResults;\r\n }", "QualityScenario createQualityScenario();", "public static int offset_quality() {\n return (48 / 8);\n }", "boolean hasQualityMax();", "@Test\n\tpublic void testQualityOf50() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Backstage passes to a TAFKAL80ETC concert\", 1, 49));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality has increased by one\n\t\tassertEquals(\"Quality with quality under 0 Concert passes\", 50, quality);\n\t}", "private void increaseQualityByOne(Item item) {\n item.quality = item.quality + 1;\n }", "public Builder setQuality(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00004000;\n quality_ = value;\n onChanged();\n return this;\n }", "private static double getOEEQuality(Batch batch) {\n double quality = ((double) batch.getAccepted()) / (((double) batch.getAccepted()) + ((double) batch.getDefect()));\n\n return quality;\n }", "public String getSrcQualityRating() {\r\n return (String) getAttributeInternal(SRCQUALITYRATING);\r\n }", "private void readQuality ()\n{\n // Reset the quality length.\n quality.setLength ( 0 );\n\n // Skip the BQ line.\n line = ace_file.getLine ();\n\n // Read in the quality array until the first blank line.\n while ( line.length () > 0 )\n {\n // Append the current line to the sequence.\n quality.append ( line.toString ().trim () + \" \" );\n\n // Get the next line of the ace file.\n line = ace_file.getLine ();\n } /* while */\n\n // Create a SequenceQuality entry for the Contig sequence.\n xml_file.write_XML_entry ( \"SequenceQuality\" );\n xml_file.write_XML_field ( \"sequence_quality_type\", \"Phrap\" );\n\n // Create the sequence_quality field.\n xml_file.write_XML_qual_field ( \"sequence_quality\", quality.toString () );\n\n // End the SequenceQuality table entry.\n xml_file.write_XML_entry_end ();\n\n // End the Sequence table entry.\n xml_file.write_XML_entry_end ();\n\n // Write the AlignmentSequence entry for the Contig sequence.l\n writeAlignmentSequence ( null, contigName.toString (), 1, contig.length (),\n contig.length (), \"+\", 1, contig.length () );\n}", "public String getQual() {\n return qual;\n }", "QualityControl getQualityControl(CallPeer peer);", "public static String initialVideoQuality(Context context, int currentCameraId) {\n int backCameraId = CameraHolder.instance().getBackCameraId();\n String defaultStr = null;\n if (currentCameraId == backCameraId) {\n// defaultStr = context.getString(R.string.pref_back_video_quality_default);\n defaultStr = SystemProperties.get(BACK_CAMERA_DEFAULT_VIDEO_QUALITY_VALUE,\"\");\n } else {\n// defaultStr = context.getString(R.string.pref_front_video_quality_default);\n defaultStr = SystemProperties.get(FRONT_CAMERA_DEFAULT_VIDEO_QUALITY_VALUE,\"\");\n }\n int quality = 0;\n if(defaultStr == null || defaultStr.length() < 1) {\n ArrayList<String> supprotedQuality = getSupportedVideoQuality();\n String[] candidateArray = (currentCameraId == backCameraId) ? \n context.getResources().getStringArray(R.array.pref_video_quality_entryvalues):\n context.getResources().getStringArray(R.array.pref_front_video_quality_entryvalues);\n for(String candidate:candidateArray) {\n if(supprotedQuality.indexOf(candidate) >= 0) {\n defaultStr = candidate;\n break;\n }\n }\n }\n\n if(defaultStr != null) {\n quality = Integer.valueOf(defaultStr);\n if (CamcorderProfile.hasProfile(currentCameraId, quality)) {\n SharedPreferences.Editor editor = ComboPreferences\n .get(context).edit();\n editor.putString(KEY_VIDEO_QUALITY, defaultStr);\n editor.apply();\n return defaultStr;\n }\n }\n return Integer.toString(CamcorderProfile.QUALITY_HIGH);\n }", "private void getClosestSupportedQuality(Camera.Parameters parameters) {\n\n\t\t// Resolutions\n\t\tString supportedSizesStr = \"Supported resolutions: \";\n\t\tList<Size> supportedSizes = parameters.getSupportedPreviewSizes();\n\t\tfor (Iterator<Size> it = supportedSizes.iterator(); it.hasNext();) {\n\t\t\tSize size = it.next();\n\t\t\tsupportedSizesStr += size.width+\"x\"+size.height+(it.hasNext()?\", \":\"\");\n\t\t}\n\t\tLog.v(TAG,supportedSizesStr);\n\n\t\t// Frame rates\n\t\tString supportedFrameRatesStr = \"Supported frame rates: \";\n\t\tList<Integer> supportedFrameRates = parameters.getSupportedPreviewFrameRates();\n\t\tfor (Iterator<Integer> it = supportedFrameRates.iterator(); it.hasNext();) {\n\t\t\tsupportedFrameRatesStr += it.next()+\"fps\"+(it.hasNext()?\", \":\"\");\n\t\t}\n\t\t//Log.v(TAG,supportedFrameRatesStr);\n\n\t\tint minDist = Integer.MAX_VALUE, newFps = mQuality.framerate;\n\t\tif (!supportedFrameRates.contains(mQuality.framerate)) {\n\t\t\tfor (Iterator<Integer> it = supportedFrameRates.iterator(); it.hasNext();) {\n\t\t\t\tint fps = it.next();\n\t\t\t\tint dist = Math.abs(fps - mQuality.framerate);\n\t\t\t\tif (dist<minDist) {\n\t\t\t\t\tminDist = dist;\n\t\t\t\t\tnewFps = fps;\n\t\t\t\t}\n\t\t\t}\n\t\t\tLog.v(TAG,\"Frame rate modified: \"+mQuality.framerate+\"->\"+newFps);\n\t\t\t//mQuality.framerate = newFps;\n\t\t}\n\n\t}", "public double[] getQualityScores() {\n return null;\n }", "public double[] getQualityScores() {\n return null;\n }", "public DriftCheckModelDataQuality getModelDataQuality() {\n return this.modelDataQuality;\n }", "com.google.protobuf.ByteString\n getQualityMaxBytes();", "@MavlinkFieldInfo(\n position = 7,\n unitSize = 1,\n description = \"JPEG quality. Values: [1-100].\"\n )\n public final int jpgQuality() {\n return this.jpgQuality;\n }", "public void set_quality(int value) {\n setUIntBEElement(offsetBits_quality(), 16, value);\n }", "@Test\n\tpublic void testConsertPassQuality() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Backstage passes to a TAFKAL80ETC concert\", 10, 20));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality has increased by two (perhaps should be one)\n\t\tassertEquals(\"Quality consert backstage passes\", 22, quality);\n\t}", "public Builder setQualityBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00004000;\n quality_ = value;\n onChanged();\n return this;\n }", "@Deprecated\r\n\tpublic QualityValue(){\r\n\t\tsuper();\r\n\t}", "public java.lang.String getQualityMax() {\n java.lang.Object ref = qualityMax_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n qualityMax_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public VideoQuality getVideoQuality() {\n\t\treturn mQuality;\n\t}", "public static int offsetBits_quality() {\n return 48;\n }", "private GATKRead addBaseQuality(final GATKRead read) {\n\n // convert to a flow base read\n final FlowBasedReadUtils.ReadGroupInfo rgInfo = FlowBasedReadUtils.getReadGroupInfo(getHeaderForReads(), read);\n final FlowBasedRead fbRead = new FlowBasedRead(read, rgInfo.flowOrder, rgInfo.maxClass, fbargs);\n final int flowOrderLength = calcFlowOrderLength(rgInfo.flowOrder);\n\n // generate base quality\n final double[] baseErrorProb = generateBaseErrorProbability(fbRead, flowOrderLength);\n final byte[] phred = convertErrorProbToPhred(baseErrorProb);\n\n // install in read\n if ( !replaceQualityMode ) {\n read.setAttribute(BASE_QUALITY_ATTRIBUTE_NAME, convertPhredToString(phred));\n } else {\n read.setAttribute(OLD_QUALITY_ATTRIBUTE_NAME, convertPhredToString(read.getBaseQualitiesNoCopy()));\n read.setBaseQualities(phred);\n }\n\n // return reused read\n return read;\n }", "private String getQuantityFromWeighScale() {\r\n // Read data from weigh scale through serial port\r\n\r\n // Convert data to string and return the value to calling function\r\n\r\n return \"1\";\r\n }", "public java.lang.String getQualityMax() {\n java.lang.Object ref = qualityMax_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n qualityMax_ = s;\n }\n return s;\n }\n }", "public void setQuality(int value)\n\t{\n\t\tconfigManager.setQuality(value);\n\t\tupdatePreviewSize();\n\t}", "public String toString()\n\t{\n\t\treturn this.defline + \"\\n\" + this.sequence + \"\\n + \\n\" + this.quality + \"\\n\";\n\t}", "@Test\n\tpublic void testQualityWithSellInUnder0QualityUnder50Brie() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Aged Brie\", -1, 40));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality has increased by 2\n\t\tassertEquals(\"Quality with sellIn under 0 brie\", 42, quality);\n\t}", "@Test\n\tpublic void testQuality1SellInUnder0() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Sulfuras, Hand of Ragnaros\", -11, 1));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality remains the same\n\t\tassertEquals(\"Quality with quality 0 Sulfuras\", 1, quality);\n\t}", "@Override\r\n\tpublic Map<Integer, String> getOrderQualityList() {\n\t\treturn null;\r\n\t}", "@Test\n\tpublic void testQualityWithSellInUnder0Concert() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Backstage passes to a TAFKAL80ETC concert\", -1, 100));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality has decreased to 0\n\t\tassertEquals(\"Quality with sellIn under 0 concert passes\", 0, quality);\n\t}", "@Override\n\tpublic String getInfo()\n\t{\n\t\tString result = \"Adjust image levels, gamma, and/or change bit depth\";\n\t\treturn result;\n\t}", "public static int size_quality() {\n return (16 / 8);\n }", "@Test\n\tpublic void testQualityUnder0() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Conjured Mana Cake\", 1, -1));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality remains the same\n\t\tassertEquals(\"Quality with quality under 0 Conjured Mana Cake\", -1, quality);\n\t}", "public static ItemQuality getItemValue(ItemStack stack){\n\t\tswitch(stack.getType()){\n\t\t\tcase LEATHER_HELMET :\n\t\t\tcase LEATHER_CHESTPLATE :\n\t\t\tcase LEATHER_LEGGINGS :\n\t\t\tcase LEATHER_BOOTS : return ItemQuality.Leather;\n\t\t\t\n\t\t\tcase CHAINMAIL_HELMET :\n\t\t\tcase CHAINMAIL_CHESTPLATE :\n\t\t\tcase CHAINMAIL_LEGGINGS :\n\t\t\tcase CHAINMAIL_BOOTS : return ItemQuality.Chain;\n\t\t\t\n\t\t\tcase IRON_HELMET :\n\t\t\tcase IRON_CHESTPLATE :\n\t\t\tcase IRON_LEGGINGS :\n\t\t\tcase IRON_BOOTS : return ItemQuality.Iron;\n\t\t\t\n\t\t\tcase DIAMOND_HELMET :\n\t\t\tcase DIAMOND_CHESTPLATE :\n\t\t\tcase DIAMOND_LEGGINGS :\n\t\t\tcase DIAMOND_BOOTS : return ItemQuality.Diamond;\n\t\t\t\n\t\t\tcase GOLD_HELMET :\n\t\t\tcase GOLD_CHESTPLATE :\n\t\t\tcase GOLD_LEGGINGS :\n\t\t\tcase GOLD_BOOTS : return ItemQuality.Gold;\n\t\t\n\t\t\tdefault: return ItemQuality.None;\n\t\t}\n\t}", "public double resolution(final Slit slit, final double imgQuality) {\n return resolution(slit);\n }", "private void decreaseQualityIfPositiveValue(Item item) {\n if (item.quality > 0) {\n decreaseQualityIfItemIsNotSulfuras(item);\n }\n }", "int getRatioQuantity();", "public QualityGridBO getQualityGrid()\r\n {\r\n return mQualityGrid;\r\n }", "private void getphoneinformaition() {\n\t\ttry {\n\t\t\tsoftVersion = this.getPackageManager().getPackageInfo(\n\t\t\t\t\tthis.getPackageName(), 0).versionName;\n\t\t} catch (NameNotFoundException e) {\n\t\t\tsoftVersion = \"NULL\";\n\t\t}\n\n\t\tif (Build.BRAND != null) {\n\t\t\tphoneBrand = Build.BRAND;\n\t\t}\n\t\tif (Build.MODEL != null) {\n\t\t\tphoneModel = Build.MODEL;\n\t\t}\n\t\tif (Build.VERSION.RELEASE != null) {\n\t\t\tphoneOs = Build.VERSION.RELEASE;\n\t\t}\n\n\t\ttry {\n\t\t\tDisplayMetrics metric = new DisplayMetrics();\n\t\t\tgetWindowManager().getDefaultDisplay().getMetrics(metric);\n\t\t\tint width = metric.widthPixels; // 屏幕宽度(像素)\n\t\t\tint height = metric.heightPixels; // 屏幕高度(像素)\n\t\t\tString w = String.valueOf(width);\n\t\t\tString h = String.valueOf(height);\n\t\t\tStringBuffer s = new StringBuffer();\n\t\t\ts.append(w);\n\t\t\ts.append(\"*\");\n\t\t\ts.append(h);\n\t\t\tphoneResolution = s.toString();\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tphoneResolution = \"NULL\";\n\t\t}\n\n\t\tFileLog.i(TAG, softVersion);\n\t\tFileLog.i(TAG, phoneBrand);\n\t\tFileLog.i(TAG, phoneModel);\n\t\tFileLog.i(TAG, phoneOs);\n\t\tFileLog.i(TAG, phoneResolution);\n\n\t}", "public boolean hasQuality() {\n return ((bitField0_ & 0x00004000) == 0x00004000);\n }", "@Test\n\tpublic void testQualityWithSellInUnder0() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Conjured Mana Cake\", -1, 6));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality has decreased by two\n\t\tassertEquals(\"Quality with sellIn under 0 Conjured Mana Cake\", 4, quality);\n\t}", "QualityRisk createQualityRisk();", "public String computeGrade(double quality) {\n\t\tString grade = \"\";\n\t\t\t\t\n\t\tif (quality < -3)\n\t\t\tgrade = \"C-\";\n\t\telse if (quality < -2)\n\t\t\tgrade = \"C+\";\n\t\telse if (quality < -1)\n\t\t\tgrade = \"C+\";\n\t\telse if (quality < -1)\n\t\t\tgrade = \"B-\";\n\t\telse if (quality < 0)\n\t\t\tgrade = \"B\";\n\t\telse if (quality < 1)\n\t\t\tgrade = \"B+\";\n\t\telse if (quality < 2)\n\t\t\tgrade = \"A-\";\n\t\telse if (quality < 3)\n\t\t\tgrade = \"A\";\n\t\telse //if (quality < 4)\n\t\t\tgrade = \"A+\";\n\t\t\t\t\n\t\treturn grade;\n\t}", "public com.google.protobuf.ByteString\n getQualityMaxBytes() {\n java.lang.Object ref = qualityMax_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n qualityMax_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public void setCompressionQuality(float quality) {\n if (quality < 0.0F || quality > 1.0F) {\n throw new IllegalArgumentException(\"Quality out-of-bounds!\");\n }\n this.compressionQuality = 256 - (quality * 256);\n }", "public float getMicGainDb();", "long getQuantite();", "public com.google.protobuf.ByteString\n getQualityMaxBytes() {\n java.lang.Object ref = qualityMax_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n qualityMax_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "int getQuantite();", "int getQuantite();", "private void getQualStats(String qualStr) {\n\t\tascii = qualStr.toCharArray();\n\t\tminQ = 0;\n\t\tavgQ = 0.0;\n\t\tminL = 0;\n\t\ttotalQ = 0;\n\t\tqp = 0.0;\n\n\t\tfor (int i=0; i < ascii.length; i++) {\n\t\t\tint qual = (int) ascii[i] - 33;\n\t\t\tif (minQ == 0 || minQ > qual) {\n\t\t\t\tminQ = qual;\n\t\t\t}\n\t\t\tif (qual >= IOParameters.MIN_BASE_QUAL) {\n\t\t\t\tminL++;\n\t\t\t\tqp++;\n\t\t\t}\n\t\t\ttotalQ += qual;\n\t\t}\n\t\tqp = qp / qualStr.length() * 100;\n\t\tavgQ = (double) (totalQ / qualStr.length());\n\t}", "public NM getExternalScalingFactorTechnicalPart() { \r\n\t\tNM retVal = this.getTypedField(42, 0);\r\n\t\treturn retVal;\r\n }", "public short getResolutionUnit()\r\n\t{\r\n\t\treturn super.getShort(0);\r\n\t}", "@Test(timeout = 4000)\n public void test050() throws Throwable {\n HomeEnvironment homeEnvironment0 = new HomeEnvironment();\n homeEnvironment0.setVideoQuality((-5305));\n int int0 = homeEnvironment0.getVideoQuality();\n assertEquals((-5305), int0);\n }", "public String toString()\n {\n return channel + \" \" + (volume / 512.0) + \" db with \" + (peakVolumeSize == PeakVolumeSize.SIZE_NONE ? \" no peak volume\" : \"32 bit peak volume of \" + peakVolume);\n }", "@Override\n public byte[] getValue() {\n return MetricUtils.concat2(topologyId, getTag(), sampleRate).getBytes();\n }", "@Test\n void maxQuality() {\n Item[] items = new Item[]{\n new Item(\"Aged Brie\", 10, 50),\n new Item(\"Backstage passes to a TAFKAL80ETC concert\", 5, 49),\n new Item(\"Aged Brie\", 10, 40)\n };\n GildedRose app = new GildedRose(items);\n app.updateQuality();\n\n for (Item item : app.items) {\n assertTrue(50 >= item.quality, \"Quality shouldn't overtake its max capacity\");\n }\n }", "public int getCustomInformationTransferRate();", "org.hl7.fhir.Ratio addNewValueRatio();", "public int getResolution() {\n return resolution;\n }", "@Test\n\tpublic void testQuality0SellInUnder0() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Sulfuras, Hand of Ragnaros\", -11, 0));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality remains the same\n\t\tassertEquals(\"Quality with quality 0 Sulfuras\", 0, quality);\n\t}", "public String toString() {\n\t\tif(scale=='K'||scale=='k'){\r\n\t\t\treturn String.format(\"%.2f %s\"+\"ilograms\", wValue, scale);\r\n\t\t} else {\r\n\t\t\tscale=Character.toUpperCase(scale);\r\n\t\t\treturn String.format(\"%.2f %s\"+\"ounds\", wValue, scale);\r\n\t\t}\r\n\t}", "public float getRate() {\n\treturn durationStretch * nominalRate;\n }", "@Test\n\tpublic void testQualityOver50SellInUnder0() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Aged Brie\", -11, 51));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality remains the same\n\t\tassertEquals(\"Quality with quality 0 Brie\", 51, quality);\n\t}", "public String getResolution() {\n return resolution;\n }" ]
[ "0.8202828", "0.7865988", "0.78026843", "0.78026843", "0.78026843", "0.7762862", "0.7437929", "0.7432808", "0.7176327", "0.71567315", "0.71372837", "0.71372837", "0.7088715", "0.7056557", "0.70319784", "0.702232", "0.7003056", "0.6955419", "0.6930181", "0.6925352", "0.6870215", "0.67874855", "0.67874855", "0.66101193", "0.65792376", "0.6541561", "0.65165365", "0.6479676", "0.6367514", "0.6303286", "0.62931305", "0.62902004", "0.6256312", "0.6241733", "0.6223006", "0.6194206", "0.61342275", "0.61048657", "0.6089487", "0.6060589", "0.6044682", "0.6022323", "0.6005102", "0.5994618", "0.59931326", "0.59931326", "0.598859", "0.5956267", "0.59495926", "0.59434795", "0.5900961", "0.5893225", "0.5880999", "0.5870521", "0.5869901", "0.58585197", "0.58456147", "0.5835419", "0.5831343", "0.5780796", "0.5777517", "0.57758135", "0.5770205", "0.57648337", "0.57469773", "0.573897", "0.57368296", "0.57228327", "0.571783", "0.5690426", "0.5665762", "0.56607515", "0.56315607", "0.562694", "0.5602141", "0.55966264", "0.559555", "0.55881464", "0.55846286", "0.55622756", "0.55471134", "0.5534307", "0.55243826", "0.5516334", "0.5516334", "0.5495285", "0.54754627", "0.5471522", "0.5470996", "0.54622525", "0.5457616", "0.545207", "0.5445635", "0.5432177", "0.54283625", "0.54280883", "0.5427951", "0.54273224", "0.5426349", "0.5419337" ]
0.7260918
8
It will clear all the Textfiled
private void toClear() { tfPaintId.setText(""); tfName.setText(""); tfPrice.setText(""); tfColor.setText(""); rwCombo.setSelectedIndex(0); bCombo.setSelectedIndex(0); typeCombo.setSelectedIndex(0); tfQuantity.setText(""); bg.clearSelection(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void clear() {\n\t\ttxtId.setText(\"\");\n\t\ttxtAlert.setText(\"\");\n\t\ttxtNbMax.setText(\"\");\n\t\t\n\t}", "private void clearAllTextField() {\n ManufactureTxt.setText(\"\");\n ManuYearTxt.setText(\"\");\n SeatNumTxt.setText(\"\");\n SerialNumTxt.setText(\"\");\n ModelTxt.setText(\"\");\n UpdateDateTxt.setText(\"\");\n ExpDateTxt.setText(\"\");\n //AvailableCheckBox.setText(\"\");\n LatitudeTxt.setText(\"\");\n LongitudeTxt.setText(\"\");\n CityTxt.setText(\"\");\n//To change body of generated methods, choose Tools | Templates.\n }", "public void text_clear()\n {\n C_ID.setText(\"\");\n C_Name.setText(\"\");\n C_NIC.setText(\"\");\n C_P_Id.setText(\"\");\n C_P_Name.setText(\"\");\n C_Address.setText(\"\");\n C_TelNo.setText(\"\");\n C_Age.setText(\"\");\n }", "private void clearTextField() {\n txtOrder.setText(\"\");\n txtName.setText(\"\");\n txtWeight.setText(\"\");\n txtGallon.setText(\"\");\n txtPersent.setText(\"\");\n txtPrice.setText(\"\");\n \n }", "void animals_textBoxs_clearText() {\r\n this.nameAnimal_textBox.setText(null);\r\n this.alimentAnimal_textBox.setText(null);\r\n this.especie_textBox.setText(null);\r\n this.idadeAnimal_textBox.setText(null);\r\n this.sexo_textBox.setText(null);\r\n }", "private void clearText() {\n \n text_ = getDefaultInstance().getText();\n }", "public void clearFields()\n {\n txtDate.setText(\"\");\n txtIC.setText(\"\");\n txtBrand.setText(\"\");\n txtSerial.setText(\"\");\n txtCPT.setText(\"\");\n txtRMB.setText(\"\");\n txtRTYP.setText(\"\");\n txtCap.setText(\"\");\n txtSpeed.setText(\"\");\n txtWar.setText(\"\");\n txtRemarks.setText(\"\");\n }", "private void clear() {\r\n\t\tareaTexto.setText(\"\");\r\n\t}", "public void clearText()\n {\n for (int i = 0; i < 10; i++) \n {\n userInput[i] = \"\";\n textFields[i].clear(); \n }\n }", "public void clearTextFields() {\n placeBidField.setText(\"\");\n }", "public void ClearTextFieldCreate() {\n txtFGameName.setText(\"\");\n txtFMovements.setText(\"\");\n }", "void resetTextFields();", "public void clearFields()\r\n {\r\n\t txtID.setText(\"\");\r\n\t txtName.setText(\"\");\r\n\t txtYear.setText(\"\");\r\n\t txtMonth.setText(\"\");\r\n\t txtPDate.setText(\"\");\r\n txtFees.setText(\"0\");\r\n }", "public void clear() {\n\t\tdestName.setText(\"\");\n\t\tedtTextZip.setText(\"\");\n\t\tedtTextMemos.setText(\"\");\n\t\tedtTextStreetAdress.setText(\"\");\n\t\tedtTextCity.setText(\"\");\n\t}", "private void clearFields() {\n this.subjectField.setText(\"\");\n this.descrField.setText(\"\");\n this.nameField.setText(\"\");\n }", "public void clearTextFields()\n\t{\n\t\tfirstNameTextField.setText(\"\");\n\t\tlastNameTextField.setText(\"\");\n\t\troomNoTextField.setText(\"\");\n\t\tphoneTextField.setText(\"\");\n\t\tstudentIDTextField.setText(\"\");\n\t\tcreatePasswordTextField.setText(\"\");\n\t\tconfirmPasswordTextField.setText(\"\");\n\t}", "private void clearAll(){\n ImplLogger.enterMethod(); \n pharmaNameTextField.setText(ImplConst.EMPTY);\n userNameTextField.setText(ImplConst.EMPTY);\n passwordField.setText(ImplConst.EMPTY);\n confirmPasswordField.setText(ImplConst.EMPTY);\n addressLine1TextField.setText(ImplConst.EMPTY);\n addressLine2TextField.setText(ImplConst.EMPTY);\n regionComboBox.setSelectedIndex(0);\n emailTextField.setText(ImplConst.EMPTY);\n contactTextField.setText(ImplConst.EMPTY);\n zipCodeTextField.setText(ImplConst.EMPTY);\n ImplLogger.exitMethod();\n }", "private void resetValues() {\n this.teaIDText.setText(\"\");\n this.teaNameText.setText(\"\");\n this.teaCollegeText.setText(\"\");\n this.teaDepartmentText.setText(\"\");\n this.teaTypeText.setText(\"\");\n this.teaPhoneText.setText(\"\");\n this.teaRemarkText.setText(\"\");\n }", "void txtClear () {\r\n\r\n\t\ttxtNo.setText (\"\");\r\n\t\ttxtName.setText (\"\");\r\n\t\ttxtDeposit.setText (\"\");\r\n\t\ttxtNo.requestFocus ();\r\n\r\n\t}", "public void clearTextFields(){\n //Clears all text from the EditText\n textInputEditText_full_name.setText(\"\");\n textInputEditText_student_id.setText(\"\");\n textInputEditText_pin.setText(\"\");\n textInputEditText_confirm_pin.setText(\"\");\n }", "private void Clear() {\n AAccLevel_AdEdRe_TextF_AccLevelID.setText(\"\");\n AAccLevel_AdEdRe_TextF_AccLevelName.setText(\"\");\n AAccLevel_AdEdRe_TextA_Discription.setText(\"\");\n }", "private void clearTextBox(){\n txtBox.setText(\"\");\n }", "private void clearFields() {\r\n jTextFieldID.setText(\"\");\r\n jTextFieldNome.setText(\"\");\r\n jTextFieldPreco.setText(\"\");\r\n jTextFieldDescricao.setText(\"\");\r\n }", "public void clearText() {\n this.mBinding.text.setText(\"\");\n }", "private void clearFormatedText() {\n \n formatedText_ = getDefaultInstance().getFormatedText();\n }", "private void clearHocSinh() {\n\t\ttxtMa.setText(\"\");\n\t\ttxtTen.setText(\"\");\n\t\ttxtTuoi.setText(\"\");\n\t\ttxtSdt.setText(\"\");\n\t\ttxtDiaChi.setText(\"\");\n\t\ttxtEmail.setText(\"\");\n\t}", "public void clearEditTextBoxes()\n {\n \ttaskName.setText(\"\");\n \ttaskDetails.setText(\"\");\n \ttaskId.setText(\"\");\n \t//TODO Add alarm stuff here\n }", "private void clearTextInput() {\n\t\ttextInput.setText(\"\");\n\t}", "public void clear()\n{\n\ttextArea().setText(\"\");\n}", "private void clearFields(){\n\t\tmiMatriculaLabel.setText(\"-\");\n\t\tmatriculaSearch.setText(\"\");\n\t\tmarcaText.setText(\"\");\n\t\tmodeloText.setText(\"\");\n\t\tanioText.setText(\"\");\n\t\titvText.setText(\"\");\n\t\tvehiculoSelected = null;\n\t\tchangeFieldsState(false);\n\t}", "public void clear()\n\t{\n\t\treadout.setText(\"\");\n\t\ttxtArea.setText(\"\");\n\t}", "public void clear() {\n\t\ttextArea.setText(\"\");\n\t}", "public void clearAnswer(){\r\n textField1.setText(\"\");\r\n }", "public void resetTextFields()\n {\n formattedFirstName.setValue(null);\n formattedLastName.setValue(null);\n formattedTitleOfWork.setValue(null);\n }", "public void clearAll() {\n usernameField.setText(\"\");\n passwordField.setText(\"\");\n errorMessageLabel.clear();\n }", "public void clearText(){\n EditText userIdEntry = findViewById(R.id.userIDEntry);\n userIdEntry.getText().clear();\n }", "public void reset() {\r\n dogNameField.clear();\r\n dogText.clear();\r\n }", "private void clear()\n\t{\n\t\tComponent[] comp = contentPanel.getComponents();\n\t\tfor(Component c:comp)\n\t\t{\n\t\t\tif(c instanceof JTextField)\n\t\t\t\t((JTextField)c).setText(\"\");\n\t\t}\n\t\t\n\t}", "private void clear() {\n\t\tmRegister.setText(\"\");\n\t\tmName.setText(\"\");\n\t\tmUsername.setText(\"\");\n\t\tmPassword.setText(\"\");\n\t\tmPhone.setText(\"\");\n\t\tmEmail.setText(\"\");\n\t}", "public void emptyTextField(){\n spelerIDField.setText(\"\");\n typeField.setText(\"\");\n codeField.setText(\"\");\n heeftBetaaldField.setText(\"\");\n }", "public void emptyTextFields() {\n clientFirstNameTextField.setText(\"\");\n clientLastNameTextField.setText(\"\");\n clientBSNTextField.setText(\"\");\n clientAddressTextField.setText(\"\");\n clientPostCodeTextField.setText(\"\");\n clientCityTextField.setText(\"\");\n clientTelTextField.setText(\"\");\n clientEmailTextField.setText(\"\");\n clientIBANTextField.setText(\"\");\n }", "private void clearFields() {\n this.upperTextField.setText(\"\");\n this.bottomTextField.setText(\"\");\n this.titleTextField.setText(\"\");\n this.tagTextField.setText(\"\");\n this.imageStackPane.getChildren().clear();\n }", "private void clearEverything(){\n partTime.setSelected(false);\n fullTime.setSelected(false);\n management.setSelected(false);\n addIT.setSelected(false);\n addCS.setSelected(false);\n addECE.setSelected(false);\n dateAddText.clear();\n nameAddText.clear();\n hourlyAddText.clear();\n annualAddText.clear();\n managerRadio.setSelected(false);\n dHeadRadio.setSelected(false);\n directorRadio.setSelected(false);\n\n removeCS.setSelected(false);\n removeECE.setSelected(false);\n removeIT.setSelected(false);\n dateRemoveText.clear();\n nameRemoveText.clear();\n\n setCS.setSelected(false);\n setECE.setSelected(false);\n setIT.setSelected(false);\n dateSetText.clear();\n nameSetText.clear();\n hoursSetText.clear();\n\n }", "public static void clear() {\n doEdit();\n mEditor.clear();\n doCommit();\n }", "public void clear()\n\t\t{\n\t\t\ttxtCustomerName.setText(\"\");\n\t\t\ttxtAddress.setText(\"\");\n\t\t\ttxtContact.setText(\"\");\n\t\t\ttxtProduct.setText(\"\");\n\t\t\ttxtSerialNo.setText(\"\");\n\t\t\ttxtModuleNo.setText(\"\");\n\t\t\ttxtComplaintNo.setText(\"\");\n\t\t\tCategorycomboBox.setSelectedItem(\"Sent\");\n\t\t}", "private void ClearForm() {\n supplierName.setText(\"\");\n supplierDiscription.setText(\"\");\n }", "private void clean() {\n ((EditText)findViewById(R.id.textName)).getText().clear();\n ((EditText)findViewById(R.id.textPhone)).getText().clear();\n ((Spinner)findViewById(R.id.spinnerSchooling)).setSelection(0);\n ((RadioButton)findViewById(R.id.radioMale)).setChecked(true);\n ((AutoCompleteTextView)findViewById(R.id.autoTextBooks)).getEditableText().clear();\n ((CheckedTextView)findViewById(R.id.checkedTextView)).setChecked(false);\n }", "public void limpaTextFields() {\n tfMatricula.setText(\"\");\n tfNome.setText(\"\");\n tfDataNascimento.setText(\"\");\n tfTelefone.setText(\"\");\n tfSalario.setText(\"\");\n }", "public void reset() {\n\t\t\t// clear the field\n\t\t\ttextField.setValue(null);\n\t\t}", "private void clear() {//将文本框等状态置零\n\t\tusername.setText(\"\");\n\t\tpass.setText(\"\");\n\t\tname.setText(\"\");\n\t\tsex1.setSelected(true);\n\t\ttel.setText(\"\");\n\t\taddr.setText(\"\");\n\t\trole.setSelectedIndex(0);\n\t\tusername.grabFocus();\n\t}", "private void clearEditTexts() {\n mEmail_Edt.setText(\"\");\n mPassword_Edt.setText(\"\");\n }", "private void clearTextFields() {\r\n\r\n\t\ttxfLoginEmail.clear();\r\n\t\ttxfLoginEmail.setPromptText(\"[email protected]\");\r\n\t\tpwfLoginPassword.clear();\r\n\t\ttxfFName.clear();\r\n\t\ttxfFName.setPromptText(\"Enter First Name\");\r\n\t\ttxfSName.clear();\r\n\t\ttxfSName.setPromptText(\"Enter Surname\");\r\n\t\ttxfEmail.clear();\r\n\t\ttxfEmail.setPromptText(\"Enter Email Address\");\r\n\t\ttxfPassword.clear();\r\n\t\ttxfPassword.setPromptText(\"Enter Password\");\r\n\t}", "@Override\n public void clear() {\n view.setText(\"\");\n view.setSelection(view.getText().length());\n }", "@Override\n public void limpiar() {\n txtIdioma.setText(\"\");\n txtBusqueda.setText(\"\");\n }", "public void clearUpdateFields() {\n\tupdateCityTextField.setText(\"\");\n\tupdatePhoneTextField.setText(\"\");\n\tupdateStreetAddressTextField.setText(\"\");\n\tupdateAptTextField.setText(\"\");\n\tupdateStateTextField.setText(\"\");\n\tupdateCountryTextField.setText(\"\");\n\tupdatePostalCodeTextField.setText(\"\");\n\tupdateTerritorytextField.setText(\"\");\n\tofficeConsoleTextArea.append(\"*cleared text fields for update employee. \\n\");\n}", "@Override\n public void actionPerformed(ActionEvent e) {\n textField1.setText(\"\");\n textField3.setText(\"\");\n }", "public void clearFields(){\n PlayerID.setText(\"\");\n passwordField.setText(\"\");\n }", "private void clearAll(){\n txtBox.setText(\"\");\n calc.setNum1(0);\n calc.setNum2(0);\n calc.setOperator('0');\n operatorPressed = false;\n initialised = false;\n equals = false;\n }", "private void resetFields() {\n userText.setText(\"\");\n passwordText.setText(\"\");\n userText.clearFocus();\n passwordText.clearFocus();\n }", "private void clearPCIDFields() {\n jTextField1.setText(\"\");\n jTextField2.setText(\"\");\n jTextField3.setText(\"\");\n jTextField4.setText(\"\");\n }", "@Override\n public void clearAllFields() {\n FeedbackBox.clear();\n }", "private void eraseFieldsContent() {\r\n\t\ttxPassword.setText(\"\");\r\n\t\ttxUsuario.setText(\"\");\r\n\t\tcheckAdmin.setIndeterminate(true);\r\n\t\tcheckTPV.setIndeterminate(true);\r\n\t}", "private void clear() {\n \tnameEditText.setText(\"\");\n \tidEditText.setText(\"\");\n \tdiscoveryDateEdit.setValue(null);\n \tcoordinatesEditText.setText(\"\");\n \t\n \ttableCivilizations.getItems().clear();\n \ttableStars.getItems().clear();\n \ttablePlanets.getItems().clear();\n \t\n \tcivilizationsTemp = new ArrayList<>();\n \tstarsTemp = new ArrayList<>();\n \tplanetsTemp = new ArrayList<>();\n \t\n \tnewCivilizationNameTextField.clear();\n \tnewPlanetTextField.clear();\n \tnewStarTextField.clear();\n \t\n \tt1.setSelected(false);\n \tt2.setSelected(false);\n \tt3.setSelected(false); \n \tnameEditCB.setSelected(false);\n \tcivilizationsEditCB.setSelected(false);\n \tdiscoveryDateEditCB.setSelected(false);\n \tcoordinatesEditCB.setSelected(false);\n \tplanetsEditCB.setSelected(false);\n \tstarsEditCB.setSelected(false);\n \t\n }", "public void clearText() {\n\t\tthis.pass.setText(\"\");\n\t}", "private void limpiar() {\r\n view.txtTexto.setText(\"\");\r\n }", "public void clearFields() {\n tags.clear();\n tagText.setText(\"\");\n ((ImageView)findViewById(R.id.picture)).setImageResource(android.R.color.transparent);\n }", "private void vaciarCampos() {\n\t\t// TODO Auto-generated method stub\n\t\ttxtCedula.clear();\n\t\ttxtNombre.clear();\n\t\ttxtApellidos.clear();\n\t\ttxtTelefono.clear();\n\t\ttxtCorreo.clear();\n\t\ttxtDireccion.clear();\n\t\ttxtUsuario.clear();\n\t\ttxtContrasenia.clear();\n\t}", "private static void clearFields() {\n resetFields();\n fieldsEnabled(false);\n lbl_message.setText(\"\");\n }", "private void clearFields() {\r\n keywords = \"\";\r\n searchBy = \"\";\r\n }", "private void clearFields() {\r\n\t\tmCardNoValue1.setText(\"\");\r\n\t\tmCardNoValue1.setHint(\"-\");\r\n\t\tmCardNoValue2.setText(\"\");\r\n\t\tmCardNoValue2.setHint(\"-\");\r\n\t\tmCardNoValue3.setText(\"\");\r\n\t\tmCardNoValue3.setHint(\"-\");\r\n\t\tmCardNoValue4.setText(\"\");\r\n\t\tmCardNoValue4.setHint(\"-\");\r\n\t\tmZipCodeValue.setText(\"\");\r\n\t\tmZipCodeValue.setHint(\"Zipcode\");\r\n\t\tmCVVNoValue.setText(\"\");\r\n\t\tmCVVNoValue.setHint(\"CVV\");\r\n\t}", "private void resetFields() {\n tf_diachi_user.setText(\"\");\n tf_hoten_user.setText(\"\");\n tf_socmtnd_user.setText(\"\");\n tf_sotienkhoitao.setText(\"\");\n tp.setText(\"\");\n ngaysinh.setText(\"\");\n \n }", "public void clearRent()\n {\n this.rentDescriptiontxt.setText(\"\");\n this.rentManufacturertxt.setText(\"\");\n this.downPaymenttxt.setText(\"\");\n this.dailyRatetxt.setText(\"\");\n this.rentCustomertxt.setText(\"\"); \n this.hireDatetxt.setText(\"\"); \n this.returnDatetxt.setText(\"\");\n this.noOfDaystxt.setText(\"\");\n this.rentEquipmentNumtxt.setText(\"\");\n }", "public void deleteAll(){\n editor.clear();\n editor.apply();\n }", "public void reset() {\n\t\ttfLogradouro.setText(\"\");\n\t\ttfCidade.setText(\"\");\n\t\ttfBairro.setText(\"\");\n\t\ttfEmail.setText(\"\");\n\t\tftfRg.setText(\"\");\n\t\ttfEmitente.setText(\"\");\n\t\tftfCpf.setText(\"\");\n\t\tftfTipo.setText(\"\");\n\t\tdateChooser.setCalendar(null);\n\t\tftfNumero.setText(\"\");\n\t\tftfTelResidencial.setText(\"\");\n\t\tftfCep.setText(\"\");\n\t\tftfTelCelular.setText(\"\");\n\t\tftfDataCadastro.setText(getDataAtual());\n\t\ttfComplemento.setText(\"\");\n\t\ttfEmitente.requestFocus();\n\t\t\n\t}", "public void resetField() {\n txtFirstname.setText(\"\");\n txtLastname.setText(\"\");\n txtEmail.setText(\"\");\n }", "public void reset() {\n txtCutiID.setText(\"\");\n txtTglAwal.setText(\"\");\n txtTglAkhir.setText(\"\");\n txtKet.setText(\"\");\n cmbCutiKhususID.setSelectedItem(\"\");\n }", "private void resetAll() {\n\t\trightHandNavPanel.clear();\n\t\tmainFlowPanel.clear();\n\t\tparameterNameTxtArea.setText(\"\");\n\t\tdefineNameTxtArea.setText(\"\");\n\t\tfuncNameTxtArea.setText(\"\");\n\t\t\n\t\tdefineAceEditor.setText(\"\");\n\t\tparameterAceEditor.setText(\"\");\n\t\tSystem.out.println(\" in resetAll doing setText\");\n\t\tcqlAceEditor.setText(\"\");\n\t\tfunctionBodyAceEditor.setText(\"\");\n\t\t\n\t\tviewParameterList.clear();\n\t\tviewDefinitions.clear();\n\t\tviewFunctions.clear();\n\t\t\n\t\tif (paramCollapse != null) {\n\t\t\tparamCollapse.clear();\n\t\t}\n\t\tif (defineCollapse != null) {\n\t\t\tdefineCollapse.clear();\n\t\t}\n\t\tif (functionCollapse != null) {\n\t\t\tfunctionCollapse.clear();\n\t\t}\n\t\t\n\t\tsetIsPageDirty(false);\n\t\tresetMessageDisplay();\n\t}", "private void ClearFields() {\n txtGRNNO.setText(null);\n dccGRNDate.setCalendar(null);\n\n txtGRNNO.requestFocus();\n }", "private void btnClearActionPerformed(java.awt.event.ActionEvent evt) {\n txtSentence.setText(\"\");\n Result.setText(\"\");\n Vowel.setSelected(false);\n Notvowel.setSelected(false);\n V3.setSelected(false);\n }", "@Override\n public void clearText() {\n textMap.clear();\n render();\n }", "private void btClearActionPerformed(java.awt.event.ActionEvent evt) {\n if(tbphieuphat.isEnabled())\n txMaPM.setText(\"\");\n /*if(EditOrSearch==0){\n tf.setText(\"\");\n txSoLuongMax.setText(\"\");\n txDonGiaMax.setText(\"\");\n }*/\n txMaPM.setText(\"\");\n txTongTien.setText(\"\");\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\ttextField_1.setText(\"\");\r\n\t\t\t\ttextField.setText(\"\");\r\n\t\t\t}", "private void empty_field() {\n tf_id_kategori.setText(null);\n tf_nama_kategori.setText(null);\n tf_keterangan.setText(null);\n pencarian.setText(null);\n }", "private void clearForm() {\n mViewerSalutation.setText(getString(R.string.viewer_info_salutation) + \" \" + Integer.toString(mViewers.size() + 1) + \",\");\n mNameEditText.setText(null);\n mEmailEditText.setText(null);\n mNameEditText.requestFocus();\n }", "private void clearRent(){\r\n\r\n fieldRent_Advance.setText(\"\");\r\n fieldRent_Customer.setText(\"\");\r\n fieldRent_hireDate.setText(\"\");\r\n fieldRent_Manufacturer.setText(\"\");\r\n fieldRent_dailyRate.setText(\"\");\r\n fieldRent_returnDate.setText(\"\");\r\n fieldRent_hardwareDeviceNo.setText(\"\");\r\n fieldRent_hardwareDeviceNoToReturn.setText(\"\");\r\n fieldRent_noOfDays.setText(\"\");\r\n fieldRent_Description.setText(\"\");\r\n\r\n }", "public void clearSell()\n {\n this.sellDescriptiontxt.setText(\"\");\n this.sellManufacturertxt.setText(\"\");\n this.pricetxt.setText(\"\");\n this.taxtxt.setText(\"\");\n this.sellCustomertxt.setText(\"\"); \n this.dateOfSelltxt.setText(\"\");\n this.sellEquipmentNumtxt.setText(\"\");\n }", "private void setFieldsEmpty(){\n nameInput.setText(\"\");\n frontTrackInput.setText(\"\");\n cornerWeightFLInput.setText(\"\");\n cornerWeightRLInput.setText(\"\");\n rearTrackInput.setText(\"\");\n cornerWeightRRInput.setText(\"\");\n cornerWeightFRInput.setText(\"\");\n cogInput.setText(\"\");\n frontRollDistInput.setText(\"\");\n wheelBaseInput.setText(\"\");\n }", "public void setClear()\n\t{\n\t\tsbm_consignCom1.db.remove(text_BookingID.getSelectedItem());\n\t\tsbm_consignCom1.cb.setSelectedItem(\"\");\n\t\ttext_advance.setText(\"\");\n\t\ttext_adults.setText(\"\");\n\t\ttext_children.setText(\"\");\n\t}", "public void clearTextBytes();", "public void reset(){\n try {\n getDocument().remove(0,getDocument().getLength()); \n if(defaultText != null){\n getDocument().insertString(0,defaultText,null); \n }\n }catch (BadLocationException ble){\n System.err.println(\"Reset ist fehlgeschlagen!\");\n }\n }", "private void Bersih() {\n jTextField1.setText(\"\");\n jTextField2.setText(\"\");\n \n }", "public void clear() {\n lb.setText(\"\");\n }", "private void limpiarCampos() {\n Component[] componentes = this.getContentPane().getComponents();\n \n for (Component componente : componentes) {\n if(componente instanceof JTextField) {\n ((JTextField) componente).setText(\"\");\n }\n }\n }", "public void clearStats()\n {\n pathJTextArea.setText(\"\");\n costJTextField.setText(\"\");\n timeJTextField.setText(\"\");\n }", "@Override\n\tpublic void clearForm() {\n\n\t\ttxtStockCenterName.setText(\"\");\n\t\trdBtnPreferredNo.setSelection(true);\n\t\trdBtnPreferredYes.setSelection(false);\n\n\t\t// clear the text fields\n\t\ttxtPharmacyName.setText(\"\");\n\t\ttxtStreetAdd.setText(\"\");\n\t\ttxtCity.setText(\"\");\n\t\ttxtTel.setText(\"\");\n\t\ttxtPharmacistName1.setText(\"\");\n\t\ttxtPharmacyAssistant.setText(\"\");\n\t\tlblCanvasPharmName.setText(\"Facility Name\");\n\t\tlblCanvasPharmacist.setText(\"Pharmacist\");\n\t\tlblCanvasAddress.setText(\"Physical Address\");\n\n\t\tfieldsChanged = false;\n\t\tenableFields();\n\n\t}", "private void clearButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clearButtonActionPerformed\n textArea.setText(null);\n }", "public void clearText() {\r\n\t\tSystem.out.println(\"UNIMPLEMENTED: clear displayed text\");\r\n\t\t// TODO implement text clearing\r\n\t}", "public void clear() {\n this.updateComment(\"\");\n this.mdlCtrlr.clearTable();\n this.repaint();\n }", "private void resetFields(){\n\t\tsetDirectoryInfoLabel(\"\");\n\t\tregexFrom.setText(\"\");\n\t\tregexTo.setText(\"\");\n\t\ttextArea.setText(\"\");\n\t\tlastChoosedDirectory = null;\n\t\tcheckboxSaveStateOn.setEnabled(false);\n\t\tsetMessage(translations.getFieldsHasBeenReset());\n\t}", "private void clearFields(){\r\n fields.forEach(e -> e.clear());\r\n }" ]
[ "0.83206624", "0.8294102", "0.8254999", "0.8241177", "0.82144374", "0.81868726", "0.8088251", "0.8036174", "0.8034334", "0.7994028", "0.7979017", "0.7972536", "0.79270357", "0.7886122", "0.78826714", "0.78671086", "0.7857441", "0.783649", "0.78083473", "0.7791349", "0.77908283", "0.7778852", "0.77714396", "0.77540374", "0.7723605", "0.77035743", "0.76996267", "0.7692568", "0.7661573", "0.7648213", "0.7648197", "0.76432353", "0.7632805", "0.75986296", "0.757856", "0.7572689", "0.7557575", "0.75444794", "0.7539572", "0.75359297", "0.7535218", "0.7500484", "0.7500168", "0.74876106", "0.7476162", "0.7464729", "0.7460243", "0.7454785", "0.74514216", "0.74399966", "0.7431149", "0.7428763", "0.74100804", "0.7395057", "0.7381314", "0.73748994", "0.73748016", "0.7355242", "0.7340419", "0.7298659", "0.7290671", "0.7288504", "0.7281453", "0.7267365", "0.72565687", "0.72482115", "0.7244962", "0.7244587", "0.7232933", "0.72308105", "0.7228292", "0.72250473", "0.72217155", "0.7188826", "0.7188213", "0.71866226", "0.7182334", "0.71811825", "0.7167449", "0.71585137", "0.7149863", "0.7148248", "0.71414363", "0.71361804", "0.7126463", "0.71252877", "0.71252316", "0.71127474", "0.7106587", "0.70923245", "0.7080808", "0.70798707", "0.70786077", "0.70772105", "0.70670104", "0.7065974", "0.70570207", "0.70552826", "0.7041248", "0.7040777" ]
0.76958275
27
This function will add detials in JTable
private void add() { //"Product ID","Name","Price","Colour","RawMaterial","Brand","Type","Quality","Quantity" String paintId,name,colour,rawMaterial,brand,type,quality; int quantity,price; if(tfPaintId.getText().isEmpty()) { JOptionPane.showMessageDialog(rootPane,"Please! Enter the Paint ID"); } else if(tfName.getText().isEmpty()) { JOptionPane.showMessageDialog(rootPane,"Please! Enter the Product name"); } else if(rwCombo.getSelectedItem().toString().equals("Select")) { JOptionPane.showMessageDialog(rootPane,"Please! Select the raw materials used"); } else if(bCombo.getSelectedItem().toString().equals("Select")) { JOptionPane.showMessageDialog(rootPane,"Please! select the brand you want"); } else if(tfPrice.getText().isEmpty()) { JOptionPane.showMessageDialog(rootPane,"Please! Enter the price"); } else if(tfColor.getText().isEmpty()) { JOptionPane.showMessageDialog(rootPane,"Please! Enter the colour"); } else if(typeCombo.getSelectedItem().toString().equals("Select")) { JOptionPane.showMessageDialog(rootPane,"Select something from paint type"); } else if(getQuality()==null) { JOptionPane.showMessageDialog(rootPane,"Quality is not selected"); } else if(tfQuantity.getText().isEmpty()) { JOptionPane.showMessageDialog(rootPane,"Please! Enter the quantity"); } else { try { paintId = tfPaintId.getText(); name=tfName.getText(); price=Integer.valueOf(tfPrice.getText()); colour=tfColor.getText(); rawMaterial=rwCombo.getSelectedItem().toString(); brand=bCombo.getSelectedItem().toString(); type=typeCombo.getSelectedItem().toString(); quality=getQuality(); quantity=Integer.valueOf(tfQuantity.getText()); boolean exist=false; for (int i=0; i<toCount(); i++) { if(jtModel.getValueAt(i,0).equals(paintId)) { exist = true; break; } else { } } if(!exist) { jtModel.addRow(new Object[]{paintId,name,price,colour,rawMaterial,brand,type,quality,quantity}); JOptionPane.showMessageDialog(rootPane,"Paint detail successfully added"); toClear(); } else { JOptionPane.showMessageDialog(rootPane,"Paint ID should be unique."); } } catch(NumberFormatException ex) { JOptionPane.showMessageDialog(rootPane, "Expected Integer but entered other character at price or quantity."); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void carregarTabela() {\n try {\n\n Vector<String> cabecalho = new Vector();\n cabecalho.add(\"Id\");\n cabecalho.add(\"Nome\");\n cabecalho.add(\"Telefone\");\n cabecalho.add(\"Titular\");\n cabecalho.add(\"Data de Nascimento\");\n\n Vector detalhe = new Vector();\n\n for (Dependente dependente : new NDependente().listar()) {\n Vector<String> linha = new Vector();\n\n linha.add(dependente.getId() + \"\");\n linha.add(dependente.getNome());\n linha.add(dependente.getTelefone());\n linha.add(new NCliente().consultar(dependente.getCliente_id()).getNome());\n linha.add(dependente.getDataNascimento().toString());\n detalhe.add(linha);\n\n }\n\n tblDependentes.setModel(new DefaultTableModel(detalhe, cabecalho));\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, e.getMessage());\n }\n\n }", "public void popularTabela() {\n\n try {\n\n RelatorioRN relatorioRN = new RelatorioRN();\n\n ArrayList<PedidoVO> pedidos = relatorioRN.buscarPedidos();\n\n javax.swing.table.DefaultTableModel dtm = (javax.swing.table.DefaultTableModel) tRelatorio.getModel();\n dtm.fireTableDataChanged();\n dtm.setRowCount(0);\n\n for (PedidoVO pedidoVO : pedidos) {\n\n String[] linha = {\"\" + pedidoVO.getIdpedido(), \"\" + pedidoVO.getData(), \"\" + pedidoVO.getCliente(), \"\" + pedidoVO.getValor()};\n dtm.addRow(linha);\n }\n\n } catch (SQLException sqle) {\n\n JOptionPane.showMessageDialog(null, \"Erro: \" + sqle.getMessage(), \"Bordas\", JOptionPane.ERROR_MESSAGE);\n \n } catch (Exception e) {\n\n JOptionPane.showMessageDialog(null, \"Erro: \" + e.getMessage(), \"Bordas\", JOptionPane.ERROR_MESSAGE);\n }\n }", "public void Show_Products_in_jTable()\n {\n ArrayList<Patient> list = getPatientList();\n DefaultTableModel model = (DefaultTableModel) jTablePatient.getModel();\n //Clear jTable;\n model.setRowCount(0);\n Object[] row = new Object[5];\n for(int i=0;i<list.size();i++)\n {\n row[0] = list.get(i).getID();\n row[1] = list.get(i).getName();\n row[2] = list.get(i).getAge();\n row[3] = list.get(i).getContactNumber();\n row[4] = list.get(i).getDoctor();\n \n model.addRow(row);\n }\n }", "public void disTable () {\n\t\t\t\tJScrollPane scrollPane = new JScrollPane(table);\n\t\t\t\tvalues = new Vector();\n\t\t\t\tvalues.add(\"20\"); values.add(\"20\"); values.add(\"20\"); values.add(\"20\"); values.add(\"20\");values.add(\"20\");values.add(new Boolean(false));\n\t\t\t\tmyModel.addRow(values ); // more practicle, vector can take only objects.\n\t\t myModel.addRow(data);\n\n\n\t\t\t\tgetContentPane().add(scrollPane, BorderLayout.CENTER);\n\n\t\t\t\t addWindowListener(new WindowAdapter() {\n\t\t\t\t\t\t\tpublic void windowClosing(WindowEvent e) {\n\t\t\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t\t\t}\n\t\t\t\t });\n\t}", "private void buildIngredientTable(){\n\n //IL=IM.getIngredientItemArrayList();\n\n\n\n ingredientTable = new JTable();\n ingredientTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);\n\n ingredientTable.getTableHeader().setReorderingAllowed(false);\n\n DTM = IM.getIngDTM();\n ingredientTable.setModel(DTM);\n\n ingredientTable.setRowSelectionAllowed(true);\n\n ingredientTable.setPreferredScrollableViewportSize(new Dimension(500, 50));\n ingredientTable.setDragEnabled(false);\n ingredientTable.setDefaultEditor(Object.class, null);\n //TODO\n\n TableColumnModel columnModel = ingredientTable.getColumnModel();\n columnModel.getColumn(1).setWidth(500);\n\n scrollPane = new JScrollPane(ingredientTable,ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);\n scrollPane.setPreferredSize(new Dimension(450, 450));\n\n }", "public void updateTable() {\n\t\ttable.getSelectionModel().removeListSelectionListener(lsl);\n\t\tdtm = new DefaultTableModel();\n\t\td = new Diet();\n\t\tdtm.addColumn(\"Id\");\n\t\tdtm.addColumn(\"Meal Id\");\n\t\tdtm.addColumn(\"Meal Type\");\n\t\tdtm.addColumn(\"Food Name\");\n\t\tdtm.addColumn(\"Food Type\");\n\t\tdtm.addColumn(\"Food Category\");\n\t\tdtm.addColumn(\"Ready Time\");\n\t\tdtm.addColumn(\"Calories (g)\");\t\t\n\t\tdtm.addColumn(\"Protein (g)\");\n\t\tdtm.addColumn(\"Fat (g)\");\n\t\tdtm.addColumn(\"Carbohydrates\");\n\t\tdtm.addColumn(\"VitaminA\");\n\t\tdtm.addColumn(\"VitaminC\");\n\t\tdtm.addColumn(\"Calcium\");\n\t\tdtm.addColumn(\"Iron\");\n\t\tdtm.addColumn(\"Author\");\n\t\tArrayList<Diet> dietList = dI.getDietList();\n\t\tif(isOrder && orderby!=\"\")\n\t\t{\t\t\t\n\t\t\tSystem.out.println(\"entering ----------------\"+orderby);\n\t\t\tdietList=dI.getDietOrderedList(type,orderby);\n\t\t\tfor (Diet d : dietList) {\t\n\t\t\t\tSystem.out.println(d.getId()+\" ------ \"+d.getCalories());\n\t\t\t}\n\t\t}\n\t\tif(isFiltered)\n\t\t{\n\t\t\tif(mealtypeSel!=\"\")\n\t\t\tdietList=dI.getFilteredMealTypeList(mealtypeSel);\n\t\t\tif(foodtypeSel!=\"\")\n\t\t\t\tdietList=dI.getFilteredFoodTypeList(foodtypeSel);\n\t\t\tif(authorSel!=\"\")\n\t\t\t\tdietList=dI.getFilteredauthorList(authorSel);\n\t\t\tif(foodCategorySel!=\"\")\n\t\t\t\tdietList=dI.getFilterFoodCategoryList(foodCategorySel);\n\t\t\t\n\t\t}\n\t\t\n\t\tfor (Diet d : dietList) {\t\n\t\t\tdtm.addRow(d.getVector());\n\t\t}\n\t\ttable.setModel(dtm);\n\n\t\ttable.getSelectionModel().addListSelectionListener(lsl);\n\n\t}", "private void fillTable(){\n tblModel.setRowCount(0);// xoa cac hang trong bang\n \n for(Student st: list){\n tblModel.addRow(new String[]{st.getStudentId(), st.getName(), st.getMajor(),\"\"\n + st.getMark(), st.getCapacity(), \"\" + st.isBonnus()});\n // them (\"\" + )de chuyen doi kieu float va boolean sang string\n \n }\n tblModel.fireTableDataChanged();\n }", "public void carga_bd_empleados(){\n try {\n Connection conectar = Conexion.conectar();\n PreparedStatement pst = conectar.prepareStatement(\n \"select nombre, edad, cargo, direccion, telefono from empleados\");\n\n ResultSet rs = pst.executeQuery();\n\n table = new JTable(model);\n jScrollPane1.setViewportView(table);\n table.setBackground(Color.yellow);\n\n model.addColumn(\"Nombre\");\n model.addColumn(\"Edad\");\n model.addColumn(\"Cargo\");\n model.addColumn(\"Direccion\");\n model.addColumn(\"Telefono\");\n\n while (rs.next()) {\n Object[] fila = new Object[8];\n //material mimaterial = new material();\n\n for (int i = 0; i < 5; i++) {\n fila[i] = rs.getObject(i + 1);\n }\n\n// model.addRow(fila);\n Empleado mimaterial = this.ChangetoEmpleado(fila);\n this.AddToArrayTableEmpleado(mimaterial);\n\n }\n\n conectar.close();\n \n } catch (SQLException e) {\n System.err.println(\"Error al llenar tabla\" + e);\n JOptionPane.showMessageDialog(null, \"Error al mostrar informacion\");\n\n }\n }", "private void onShowTableDetail(ViewNodeJSO viewNode) { \n TableTools.createDataProvider(viewNode).addDataDisplay(cellTable);\n }", "private void makeTable() {\n String [] cols = new String[] {\"Planets\", \"Weights (in lbs)\", \"Weights (in kgs)\"};\n model = new DefaultTableModel(result,cols) {\n @Override\n public boolean isCellEditable(int row, int column) {\n return false;\n }\n };\n table = new JTable(model);\n JScrollPane scrollPane = new JScrollPane(table);\n scrollPane.setPreferredSize(new Dimension(310,155));\n middlePanel.add(scrollPane);\n revalidate();\n repaint();\n }", "public void setUpTheTable() {\n articleTable = new JTable();\n\n // Get the data from the Data Set\n data = getTableData();\n\n // Create a model of the data.\n articleTableModel = new AbstractTableModel() {\n\n /**\n\t\t * \n\t\t */\n\t\tprivate static final long serialVersionUID = -8868431326664067555L;\n\n\t// These methods always need to be implemented.\n public int getColumnCount() {\n return columnNameList.length;\n }\n\n public int getRowCount() {\n return data.length;\n }\n\n public Object getValueAt(int theRow, int theCol) {\n return data[theRow][theCol];\n }\n\n // The default implementations of these methods in\n // AbstractTableModel would work, but we can refine them.\n public String getColumnName(int theCol) {\n return columnNameList[theCol];\n }\n\n public Class<? extends Object> getColumnClass(int theCol) {\n return getValueAt(0, theCol).getClass();\n }\n\n public boolean isCellEditable(int theRow, int theCol) {\n boolean canEdit = false;\n\n switch (theCol) {\n case COL_SUBJECTID :\n case COL_SCOREID :\n canEdit = false;\n break;\n case COL_RATINGID :\n canEdit = true;\n break;\n default :\n canEdit = false;\n break;\n } // endswitch\n return canEdit;\n }\n\n public void setValueAt(Object theValue, int theRow, int theCol) {\n String lclString = ((String) theValue).trim();\n\n switch (theCol) {\n case COL_SUBJECTID :\n break;\n case COL_SCOREID :\n break;\n case COL_RATINGID :\n data[theRow][theCol] = lclString;\n if (currentArt != null) {\n currentArt.setUserRating(lclString);\n }\n break;\n } // end switch\n }\n };\n articleTable = new JTable(articleTableModel);\n articleTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n\n // add code to detect table selection events\n // may be able to remove this **FIX** jpb\n ListSelectionModel rowSM = articleTable.getSelectionModel();\n\n rowSM.addListSelectionListener(new ListSelectionListener() {\n public void valueChanged(ListSelectionEvent e) {\n\n // ignore extra messages\n if (e.getValueIsAdjusting()) {\n return;\n }\n ListSelectionModel lsm = (ListSelectionModel) e.getSource();\n\n if (lsm.isSelectionEmpty()) {\n\n // no rows selected\n } else {\n int selectedRow = lsm.getMinSelectionIndex();\n\n if (selectedRow == -1) {\n return; //nothing selected\n }\n if (articles.size() > 0) {\n currentArt = (NewsArticle) articles.elementAt(selectedRow);\n articleTextArea.setText(currentArt.body); // clear the display area\n articleTextArea.setCaretPosition(0); // move cursor to start of article\n // updateTable();\n } else {\n currentArt = null;\n }\n }\n }\n });\n (articleTable.getColumn(COL_SUBJECT)).setPreferredWidth(200);\n (articleTable.getColumn(COL_SCORE)).setPreferredWidth(30);\n (articleTable.getColumn(COL_RATING)).setPreferredWidth(30);\n JComboBox<String> lclClassComboBox = new JComboBox<String>();\n\n lclClassComboBox.addItem(FilterAgent.USELESS_RATING);\n lclClassComboBox.addItem(FilterAgent.NOTVERY_RATING);\n lclClassComboBox.addItem(FilterAgent.NEUTRAL_RATING);\n lclClassComboBox.addItem(FilterAgent.MILDLY_RATING);\n lclClassComboBox.addItem(FilterAgent.INTERESTING_RATING);\n (articleTable.getColumnModel().getColumn(COL_RATINGID)).setCellEditor(new DefaultCellEditor(lclClassComboBox));\n articleTable.setCellSelectionEnabled(true);\n }", "public void addTableGui() {\n\t\tDefaultTableModel mTableModel = new DefaultTableModel();\r\n\t\tmTable = new JTable(mTableModel);\r\n\r\n\t\tmTableModel.addColumn(\"MSSV\");\r\n\t\tmTableModel.addColumn(\"HoTen\");\r\n\t\tmTableModel.addColumn(\"GioiTinh\");\r\n\t\tmTableModel.addColumn(\"NTNS\");\r\n\t\tJScrollPane mJScrollPane = new JScrollPane(mTable);\r\n\t\tmJScrollPane.setPreferredSize(new Dimension(760, 310));\r\n\t\tc.fill = GridBagConstraints.HORIZONTAL;\r\n\t\tc.ipady = 40; //make this component tall\r\n\t\tc.weightx = 0.0;\r\n\t\tc.gridwidth = 3;\r\n\t\tc.gridx = 0;\r\n\t\tc.gridy = 1;\r\n\t\tpanel.add(mJScrollPane,c);\r\n\t}", "private void addData(){\n\n for (Recipe obj : frecipes)\n {\n /** Create a TableRow dynamically **/\n tr = new TableRow(this);\n tr.setLayoutParams(new TableRow.LayoutParams(\n TableRow.LayoutParams.MATCH_PARENT,\n TableRow.LayoutParams.WRAP_CONTENT));\n\n /** Creating a TextView to add to the row **/\n name = new TextView(this);\n name.setText(obj.getName());\n name.setWidth(320);\n name.setTypeface(Typeface.DEFAULT, Typeface.NORMAL);\n name.setPadding(5, 5, 5, 5);\n tr.addView(name); // Adding textView to tablerow.\n\n // Add the TableRow to the TableLayout\n tl.addView(tr, new TableLayout.LayoutParams(\n TableRow.LayoutParams.MATCH_PARENT,\n TableRow.LayoutParams.WRAP_CONTENT));\n }\n }", "public void List(JTable tableD)\r\n {\n DefaultTableModel modeloT = new DefaultTableModel();\r\n //agreagar el modelo a la tablaD\r\n tableD.setModel(modeloT);\r\n \r\n //Agregar al modelo las 17 columnas\r\n modeloT.addColumn(\"ID\");\r\n modeloT.addColumn(\"Name\");\r\n modeloT.addColumn(\"Food Preference\");\r\n \r\n Object[] columna = new Object[3];\r\n \r\n //numero de registros recuperado desde la db\r\n int numRegistros = LD.List().size();\r\n \r\n for (int i = 0; i < numRegistros; i++) \r\n {\r\n columna[0] = LD.List().get(i).getID_person();\r\n columna[1] = LD.List().get(i).getName_person();\r\n columna[2] = LD.List().get(i).getFood_Preference_person();\r\n \r\n modeloT.addRow(columna);\r\n }\r\n }", "private void Table()\n{\n Object [] Kolom = {\"Nama\", \"No. Telp\", \"Kota Asal\"};\n Table = new DefaultTableModel(null, Kolom);\n Tabel.setModel(Table);\n}", "public void displayPatients() {\n DefaultTableModel dm = new DefaultTableModel(0, 0);\n String header[] = new String[]{\"\", \"Nom:\", \"Prénom:\", \"Dg:\", \"Séance:\", \"Date visit\"};\n dm.setColumnIdentifiers(header);\n jTable1.setModel(dm);\n\n \n \n //set the data in the table =>rows\n\n for (int i = 0; i < patients.size(); i++) {\n Patient patient = patients.get(i);\n\n Vector<Object> data = new Vector<Object>();\n data.add(patient.getId());\n data.add(patient.getNom());\n data.add(patient.getPrenom());\n data.add(patient.getDg());\n data.add(patient.getNombre_seance());\n data.add(patient.getDate_visit());\n dm.addRow(data);\n \n }\n }", "private void carregarTabela() {\n try {\n\n Vector<String> cabecalho = new Vector();\n cabecalho.add(\"Id\");\n cabecalho.add(\"Nome\");\n cabecalho.add(\"CPF\");\n cabecalho.add(\"Telefone\");\n cabecalho.add(\"Endereço\");\n cabecalho.add(\"E-mail\");\n cabecalho.add(\"Data de Nascimento\");\n\n Vector detalhe = new Vector();\n\n for (Cliente cliente : new NCliente().listar()) {\n Vector<String> linha = new Vector();\n\n linha.add(cliente.getId() + \"\");\n linha.add(cliente.getNome());\n linha.add(cliente.getCpf());\n linha.add(cliente.getTelefone());\n linha.add(cliente.getEndereco());\n linha.add(cliente.getEmail());\n linha.add(cliente.getData_nascimento().toString());\n detalhe.add(linha);\n\n }\n\n tblClientes.setModel(new DefaultTableModel(detalhe, cabecalho));\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, e.getMessage());\n }\n\n }", "public void loadData() {\n String[] header = {\"Tên Cty\", \"Mã Cty\", \"Cty mẹ\", \"Giám đốc\", \"Logo\", \"Slogan\"};\n model = new DefaultTableModel(header, 0);\n List<Enterprise> list = new ArrayList<Enterprise>();\n list = enterpriseBN.getAllEnterprise();\n for (Enterprise bean : list) {\n Enterprise enterprise = enterpriseBN.getEnterpriseByID(bean.getEnterpriseParent()); // Lấy ra 1 Enterprise theo mã\n Person person1 = personBN.getPersonByID(bean.getDirector());\n Object[] rows = {bean.getEnterpriseName(), bean.getEnterpriseID(), enterprise, person1, bean.getPicture(), bean.getSlogan()};\n model.addRow(rows);\n }\n listEnterprisePanel.getTableListE().setModel(model);\n setupTable();\n }", "public void fillAnimalDetailTable() {\n\t\tfinal AnimalDetailTable table = new AnimalDetailTable();\n\t\ttable.setColumnsWidth();\n\n\t\tnew AsyncTask() {\n\t\t\tList<AnimalModel> models = new ArrayList<>();\n\n\t\t\t@Override\n\t\t\tprotected Boolean doInBackground() throws Exception {\n\t\t\t\ttry {\n\t\t\t\t\tmodels = dataManager.getAnimalHistory(selectedAnimalModel.getId());\n\t\t\t\t\treturn true;\n\t\t\t\t} catch (DataManagerException e) {\n\t\t\t\t\tLogger.createLog(Logger.ERROR_LOG, e.getMessage());\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tprotected void onDone(boolean success) {\n\t\t\t\tif (models != null && models.size() > 0) {\n\t\t\t\t\tfor (AnimalModel model : models) {\n\t\t\t\t\t\ttable.addAnimalModel(model);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tanimalDetailPanel.setAnimalDetailTable(table);\n\t\t\t}\n\t\t}.start();\n\t}", "public void echantillon_zone(){\n\n JLabel lbl_Echantillon = new JLabel(\"Offre d'\\u00E9chantillons :\");\n lbl_Echantillon.setBounds(340, 170, 119, 16);\n add(lbl_Echantillon);\n\n // MODEL\n final DefaultTableModel model = new DefaultTableModel();\n final DefaultTableCellRenderer rightRenderer = new DefaultTableCellRenderer();\n rightRenderer.setHorizontalAlignment(JLabel.RIGHT);\n Object[][] o = new Object[sizeVector][2];\n for(int i = 0; i < sizeVector; i++){\n o[i][0] = medicaments.get(i)[0];\n o[i][1] = medicaments.get(i)[1];\n }\n // TABLE DATA\n model.setDataVector(o, new Object[]{\"M\\u00E9dicament\",\"Qt\\u00E9\"});\n\n\n // TABLE\n result_table = new JTable(model);\n result_table.setBounds(475, 170, 200, 150);\n result_table.getColumnModel().getColumn(1).setMaxWidth(40);\n result_table.getColumnModel().getColumn(1).setCellRenderer(rightRenderer);\n result_table.setEnabled(false);\n add(result_table);\n\n\n // SCROLLPANE\n JScrollPane apne= new JScrollPane(result_table);\n apne.setBounds(475, 170, 200, 150);\n add(apne);\n\n\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tMyButtonEditor.this.fireEditingCanceled(); \n\t\t\t\t//查看详情\n\t\t\t\t\n\t\t\t\tif(mdtjf!=null){\n\t\t\t\t\tmdtjf.dispose();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tMyTableModel model = (MyTableModel) jtb.getModel();\n\t\t\t\t\t\n\t\t\t\t\tVector<List<String>> data = model.getTableData();\n\t\t\t\t\t\n\t\t\t\t\tVector<List<String>> newData = new Vector<List<String>>();\n\t\t\t\t\t\n\t\t\t\t\tList<String> list = data.get(jtb.getSelectedRow());\n\t\t\t\t\t\n\t\t\t\t\tString name = list.get(0).split(\"×\")[0];\n\t\t\t\t\t\n\t\t\t\t\tList<String> newList = new ArrayList<String>();\n\t\t\t\t\t\n\t\t\t\t\t//添加菜名\n\t\t\t\t\tnewList.add(name);\n\t\t\t\t\t//添加份数为1份,即查看每份所需材料,Order中已对数据进行处理,故无需管后面几项\n\t\t\t\t\t//Order中处理只根据菜名和份数,即可算出所需的所有东西\n\t\t\t\t\t//这里直接添加菜名+份数1份,利用order可查看1份菜品所需的材料\n\t\t\t\t\tnewList.add(\"1\");\n\t\t\t\t\t\n\t\t\t\t\tnewData.add(newList);\n\t\t\t\t\t\n\t\t\t\t\tMyTableModel newModel = new MyTableModel(jf);\n\t\t\t\t\tnewModel.setTableData(newData);\n\t\t\t\t\t\n\t\t\t\t\tOrder order = new Order(jf, newModel, ALL_DISHES);\n\t\t\t\t\t\n\t\t\t\t\tmdtjf = new MyDetailTableJF(order);\n\t\t\t\t\tmdtjf.setVisible(true);\n\t\t\t\t\t\n\t\t\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 tbl_listado = new javax.swing.JTable();\n jLabel1 = new javax.swing.JLabel();\n btn_mostrar = new javax.swing.JButton();\n btn_agregar = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);\n jScrollPane1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);\n\n tbl_listado.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {\"Borrador\", new Float(12500.0), new Integer(50), null, null},\n {\"Marcador\", new Float(1500.0), new Integer(170), null, null},\n {\"Hoja carta\", new Float(2580.0), new Integer(9000), null, null},\n {\"Cartuchera\", new Float(2580.0), new Integer(60), null, null}\n },\n new String [] {\n \"Producto\", \"Precio\", \"Existenia\", \"Excento\", \"Iva\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.Object.class, java.lang.Float.class, java.lang.Integer.class, java.lang.Boolean.class, java.lang.Float.class\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n });\n tbl_listado.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n tbl_listadoMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(tbl_listado);\n\n jLabel1.setText(\"Listado de productos\");\n\n btn_mostrar.setText(\"Mostrar\");\n btn_mostrar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_mostrarActionPerformed(evt);\n }\n });\n\n btn_agregar.setText(\"Agregar\");\n btn_agregar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_agregarActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(btn_mostrar)\n .addGap(78, 78, 78))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(btn_agregar)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 543, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(35, 35, 35))))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(44, 44, 44)\n .addComponent(btn_agregar)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE)\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(31, 31, 31)\n .addComponent(btn_mostrar)\n .addGap(67, 67, 67))\n );\n\n pack();\n }", "private void llenar_tabla() {\n \n try {\n DefaultTableModel modelo;\n conexion cnx = new conexion();\n Connection registros = cnx.conexion();\n String[] nombre_atributos = {\"id_producto\", \"nombre\",\"id_categoria\"};\n String sql = (\"SELECT *FROM producto\");\n modelo = new DefaultTableModel(null, nombre_atributos);\n Statement st = (Statement) registros.createStatement();\n ResultSet rs = st.executeQuery(sql);\n String[] filas = new String[3];\n\n while (rs.next()) {\n filas[0] = rs.getString(\"id_producto\");\n filas[1] = rs.getString(\"nombre\");\n filas[2] = rs.getString(\"id_categoria\");\n modelo.addRow(filas);\n\n }\n jtabla.setModel(modelo);\n registros.close();\n } catch (SQLException ex) {\n Logger.getLogger(responsable.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }", "private void addToArticleTable(QuotationDetailsDTO detail) {\n\t\tdecimalFormat = new DecimalFormat(\"0.00\");\n\t\tTableItem[] items = tblArticle.getItems();\n\t\tint len = items.length;\n\t\tboolean isPresent = false;\n\t\tTableItem tiArticle;\n\t\tint index = 0;\n\t\tfor (int i = 0; i < len; i++) {\n\t\t\tif (detail.getArticleName().equalsIgnoreCase(items[i].getText(0))) {\n\t\t\t\tisPresent = true;\n\t\t\t\t/*if (detail.getChargedWeight() != Float.parseFloat(items[i].getText(1))) {\n\t\t\t\t\tif (quotationDTO != null) {\n\t\t\t\t\t\tQuotationDetailsDTO[] quotDetails = quotationDTO.getQuotationDetails();\n\t\t\t\t\t\tquotDetails[i].setBft(null);\n\t\t\t\t\t}\n\t\t\t\t}*/\n\t\t\t\tindex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t\tif (!isPresent) {\n\t\t\ttiArticle = new TableItem(tblArticle, SWT.NONE);\n\n\t\t\ttiArticle.setText(0, detail.getArticleName());\n\t\t\ttiArticle.setText(1, decimalFormat.format(detail.getChargedWeight()));\n\t\t\ttiArticle.setText(2, optionB[detail.getCcchargeType()]);\n\t\t\ttiArticle.setText(3, decimalFormat.format(detail.getCcchargeValue()));\n\t\t\ttiArticle.setText(4, optionB[detail.getDcchargeType()]);\n\t\t\ttiArticle.setText(5, decimalFormat.format(detail.getDcchargeValue()));\n\t\t\ttiArticle.setText(6, optionB[detail.getIechargeType()]);\n\t\t\ttiArticle.setText(7, decimalFormat.format(detail.getIechargeValue()));\n\t\t\ttiArticle.setText(8, optionB[detail.getLcchargeType()]);\n\t\t\ttiArticle.setText(9, decimalFormat.format(detail.getLcchargeValue()));\n\t\t\ttiArticle.setText(10, optionC[detail.getDdchargeType()]);\n\t\t\ttiArticle.setText(11, decimalFormat.format(detail.getMinDdchargeValue()));\n\t\t\ttiArticle.setText(12, decimalFormat.format(detail.getDdchargeArticle()));\n\t\t} else {\n\n\t\t\tTableItem item = tblArticle.getItem(index);\n\t\t\titem.setText(0, detail.getArticleName());\n\t\t\titem.setText(1, decimalFormat.format(detail.getChargedWeight()));\n\t\t\titem.setText(2, optionB[detail.getCcchargeType()]);\n\t\t\titem.setText(3, decimalFormat.format(detail.getCcchargeValue()));\n\t\t\titem.setText(4, optionB[detail.getDcchargeType()]);\n\t\t\titem.setText(5, decimalFormat.format(detail.getDcchargeValue()));\n\t\t\titem.setText(6, optionB[detail.getIechargeType()]);\n\t\t\titem.setText(7, decimalFormat.format(detail.getIechargeValue()));\n\t\t\titem.setText(8, optionB[detail.getLcchargeType()]);\n\t\t\titem.setText(9, decimalFormat.format(detail.getLcchargeValue()));\n\t\t\titem.setText(10, optionC[detail.getDdchargeType()]);\n\t\t\titem.setText(11, decimalFormat.format(detail.getMinDdchargeValue()));\n\t\t\titem.setText(12, decimalFormat.format(detail.getDdchargeArticle()));\n\t\t}\n\n\t}", "public void updateTable() {\n tabelModel.setRowCount(0);\n Link current = result.first;\n for (int i = 0; current != null; i++) {\n Object[] row = {current.getMasjid(), current.getAlamat()};\n tabelModel.addRow(row);\n current = current.next;\n }\n }", "private void initTable() {\n\t\tDefaultTableModel dtm = (DefaultTableModel)table.getModel();\n\t\tdtm.setRowCount(0);\t\t\n\t\tfor(int i=0;i<MainUi.controller.sale.items.size();i++){\n\t\t\tVector v1 = new Vector();\n\t\t\tv1.add(MainUi.controller.sale.items.get(i).getProdSpec().getTitle());\n\t\t\tv1.add(MainUi.controller.sale.items.get(i).getCopies());\n\t\t\tdtm.addRow(v1);\n\t\t}\n\t\tlblNewLabel.setText(\"\"+MainUi.controller.sale.getTotal());\n\t}", "public MyJTable createResultJTable(){\r\n\t\tmodel = new DefaultTableModel(getTableData(getRowNumber(), getTitle(), getAuthor(), getHyperLink(), getYear(), getAbstract(), getPublisher(), getMark(), getIsDuplicate(), getDigitalLibrary()), getColumnName()) {\r\n\t\tprivate static final long serialVersionUID = 1L;\r\n\t\t\tClass<?>[] types = new Class<?>[] { Integer.class, String.class, String.class, URL.class, String.class, String.class, String.class, Boolean.class, Boolean.class, String.class};\r\n\r\n\t\t\tpublic Class<?> getColumnClass(int columnIndex) {\r\n\t\t\t\treturn types[columnIndex];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/*public Class getColumnClass(int col) {\r\n\t\t\t\tif (col == 6) return Boolean.class;\r\n\t\t\t\telse return Object.class;\r\n\t\t\t}*/\r\n\t\t};\r\n\t\t\r\n\t\tMyJTable table = new MyJTable(model);\r\n\t\t//Sap xep noi dung cac dong trong table theo thu tu alpha B.\r\n\t\t//Cho phep sap xep theo tu cot rieng biet\r\n\t\tTableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>(table.getModel());\r\n\t\ttable.setRowSorter(sorter);\r\n\t\t\r\n\t\t/*\r\n\t\t * Set width of table column \r\n\t\t */\r\n\t\ttable.setShowGrid(true);\r\n\t\ttable.setShowVerticalLines(true);\r\n\t\ttable.setShowHorizontalLines(true);\r\n\t\ttable.setRowHeight(25);\r\n\t\t//table.getColumn(\"links\")//;\r\n\t\tDefaultTableCellRenderer dtcr = new DefaultTableCellRenderer(); \r\n\t\tdtcr.setHorizontalAlignment(SwingConstants.CENTER); \r\n\t\t\r\n\t\tTableCellRenderer tcr = table.getDefaultRenderer(Integer.class);\r\n\t\tDefaultTableCellRenderer renderer = (DefaultTableCellRenderer)tcr; \r\n\t\trenderer.setHorizontalAlignment(SwingConstants.CENTER); \r\n\t\t\r\n\t\ttable.getColumn(DBSAResourceBundle.res.getString(\"duplicate\")).setWidth(0);\r\n\t\ttable.getColumn(DBSAResourceBundle.res.getString(\"duplicate\")).setMinWidth(0);\r\n\t\ttable.getColumn(DBSAResourceBundle.res.getString(\"duplicate\")).setMaxWidth(0);\r\n\t\t\r\n\t\ttable.getColumn(\"dlsName\").setWidth(0);\r\n\t\ttable.getColumn(\"dlsName\").setMinWidth(0);\r\n\t\ttable.getColumn(\"dlsName\").setMaxWidth(0);\r\n\t\t\r\n\t\tfor(int i = 0; i < 8; i++){\r\n\t\t\tTableColumn col = table.getColumnModel().getColumn(i);\r\n\t\t\tif(i == 0){\r\n\t\t\t\tcol.setPreferredWidth(5);\r\n\t\t\t}else if(i == 1){\r\n\t\t\t\tcol.setPreferredWidth(200);\r\n\t\t\t}else if(i == 2){\r\n\t\t\t\tcol.setPreferredWidth(150);\r\n\t\t\t}else if(i == 3){\r\n\t\t\t\tcol.setPreferredWidth(150);\r\n\t\t\t}else if(i == 4){\r\n\t\t\t\tcol.setPreferredWidth(20);\r\n\t\t\t}else if (i == 5){\r\n\t\t\t\tcol.setPreferredWidth(400);\r\n\t\t\t}else if(i == 6){\r\n\t\t\t\tcol.setPreferredWidth(70);\r\n\t\t\t}else if(i == 7){\r\n\t\t\t\tcol.setPreferredWidth(5);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn table;\r\n\t}", "public void tabelaktivitas() {\n DefaultTableModel tbl= new DefaultTableModel();\n tbl.addColumn(\"Group\");\n tbl.addColumn(\"Compart\");\n tbl.addColumn(\"Activity\");\n tbl.addColumn(\"HA\");\n tbl.addColumn(\"Harga\");\n tbl.addColumn(\"Total\");\n tblaktivitas.setModel(tbl);\n try{\n java.sql.Statement statement=(java.sql.Statement)conek.GetConnection().createStatement();\n ResultSet res=statement.executeQuery(\"select * from tblaktivitas\");\n while(res.next())\n {\n tbl.addRow(new Object[]{\n res.getString(\"nama_grup\"),\n res.getString(\"compart\"),\n res.getString(\"pekerjaan\"),\n res.getInt(\"ha\"),\n res.getInt(\"harga\"),\n res.getInt(\"total\")\n });\n tblaktivitas.setModel(tbl); \n }\n }catch (Exception e){\n JOptionPane.showMessageDialog(rootPane,\"Salah\");\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTblRep = new javax.swing.JTable();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Liste des représentations\");\n\n jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n jTblRep.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n jTblRep.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Date\", \"Représentation\", \"Nb Réservations\", \"NbPlaces\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.String.class, java.lang.String.class, java.lang.Object.class, java.lang.Object.class\n };\n boolean[] canEdit = new boolean [] {\n false, false, false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n jTblRep.setRowMargin(2);\n jTblRep.setRowSelectionAllowed(false);\n jScrollPane1.setViewportView(jTblRep);\n\n jPanel1.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 23, 629, 250));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 650, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n );\n\n pack();\n }", "public MyJTable createResultJTable(){\r\n\t\tmodel = new DefaultTableModel(getTableData(getRowNumber(), getTitle(), getAuthor(), getHyperLink(), getYear(), getAbstract(), getPublisher(), getMark(), getIsDuplicate(), getID()), getColumnName()) {\r\n\t\tprivate static final long serialVersionUID = 1L;\r\n\t\t\tClass<?>[] types = new Class<?>[] { Integer.class, String.class, String.class, URL.class, String.class, String.class, String.class, Boolean.class, Boolean.class, Integer.class};\r\n\r\n\t\t\tpublic Class<?> getColumnClass(int columnIndex) {\r\n\t\t\t\treturn types[columnIndex];\r\n\t\t\t}\r\n\t\t\r\n\t\t};\r\n\t\t\r\n\t\tMyJTable table = new MyJTable(model);\r\n\t\t//Sap xep noi dung cac dong trong table theo thu tu alpha B.\r\n\t\t//Cho phep sap xep theo tu cot rieng biet\r\n\t\tTableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>(table.getModel());\r\n\t\ttable.setRowSorter(sorter);\r\n\t\t\r\n\t\t/*\r\n\t\t * Set width of table column \r\n\t\t */\r\n\t\ttable.setShowGrid(true);\r\n\t\ttable.setShowVerticalLines(true);\r\n\t\ttable.setShowHorizontalLines(true);\r\n\t\ttable.setRowHeight(25);\r\n\t\t//table.getColumn(\"links\")//;\r\n\t\tDefaultTableCellRenderer dtcr = new DefaultTableCellRenderer(); \r\n\t\tdtcr.setHorizontalAlignment(SwingConstants.CENTER); \r\n\t\t\r\n\t\tTableCellRenderer tcr = table.getDefaultRenderer(Integer.class);\r\n\t\tDefaultTableCellRenderer renderer = (DefaultTableCellRenderer)tcr; \r\n\t\trenderer.setHorizontalAlignment(SwingConstants.CENTER); \r\n\t\t\r\n\t\ttable.getColumn((\"duplicate\")).setWidth(0);\r\n\t\ttable.getColumn((\"duplicate\")).setMinWidth(0);\r\n\t\ttable.getColumn((\"duplicate\")).setMaxWidth(0);\r\n\t\t\r\n\t\ttable.getColumn((\"id\")).setWidth(0);\r\n\t\ttable.getColumn((\"id\")).setMinWidth(0);\r\n\t\ttable.getColumn((\"id\")).setMaxWidth(0);\r\n\t\t\r\n\t\tfor(int i = 0; i < 8; i++){\r\n\t\t\tTableColumn col = table.getColumnModel().getColumn(i);\r\n\t\t\tif(i == 0){\r\n\t\t\t\tcol.setPreferredWidth(30);\r\n\t\t\t}else if(i == 1){\r\n\t\t\t\tcol.setPreferredWidth(300);\r\n\t\t\t}else if(i == 2){\r\n\t\t\t\tcol.setPreferredWidth(200);\r\n\t\t\t}else if(i == 3){\r\n\t\t\t\tcol.setPreferredWidth(150);\r\n\t\t\t}else if(i == 4){\r\n\t\t\t\tcol.setPreferredWidth(60);\r\n\t\t\t}else if (i == 5){\r\n\t\t\t\tcol.setPreferredWidth(150);\r\n\t\t\t}else if(i == 6){\r\n\t\t\t\tcol.setPreferredWidth(80);\r\n\t\t\t}else if(i == 7){\r\n\t\t\t\tcol.setPreferredWidth(30);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn table;\r\n\t}", "public TestFrame() {\n\n final String[] columnNames = {\"Nombre\",\n \"Apellido\",\n \"webeo\",\n \"Años de Practica\",\n \"Soltero(a)\"};\n final Object[][] data = {\n\n {\"Lhucas\", \"Huml\",\n \"Patinar\", new Integer(3), new Boolean(true)},\n {\"Kathya\", \"Walrath\",\n \"Escalar\", new Integer(2), new Boolean(false)},\n {\"Marcus\", \"Andrews\",\n \"Correr\", new Integer(7), new Boolean(true)},\n {\"Angela\", \"Lalth\",\n \"Nadar\", new Integer(4), new Boolean(false)}\n };\n\n Vector dataV1 = new Vector();\n dataV1.add(\"XXXX\");\n dataV1.add(\"YYYY\");\n dataV1.add(\"JJJJ\");\n\n Vector dataV2 = new Vector();\n dataV2.add(\"XX2XX\");\n dataV2.add(\"Y2YYY\");\n dataV2.add(\"J2JJJ\");\n\n List dataF = new ArrayList();\n dataF.add(dataV1);\n dataF.add(dataV2);\n\n /*Vector dataC = new Vector();\n dataC.add(\"1\");\n dataC.add(\"2\");\n dataC.add(\"J23JJJ\");\n\n //model = new ModeloDatosTabla(data, true);\n model = new TableModel_1_1(dataC, dataF);\n model2 = new TableModel(columnNames, data, false);\n*/\n\n\n\n initComponents();\n\n\n }", "public void llenadoDeTablas() {\n DefaultTableModel modelo = new DefaultTableModel();\n modelo.addColumn(\"ID Articulo\");\n modelo.addColumn(\"Fecha Ingreso\");\n modelo.addColumn(\"Nombre Articulo\");\n modelo.addColumn(\"Talla XS\");\n modelo.addColumn(\"Talla S\");\n modelo.addColumn(\"Talla M\");\n modelo.addColumn(\"Talla L\");\n modelo.addColumn(\"Talla XL\");\n modelo.addColumn(\"Color Articulo\");\n modelo.addColumn(\"Nombre Proveedor\");\n modelo.addColumn(\"Existencias\");\n\n RegistroArticuloDAO registroarcticuloDAO = new RegistroArticuloDAO();\n\n List<RegistroArticulo> registroarticulos = registroarcticuloDAO.select();\n TablaArticulo.setModel(modelo);\n String[] dato = new String[11];\n for (int i = 0; i < registroarticulos.size(); i++) {\n dato[0] = Integer.toString(registroarticulos.get(i).getPK_id_articulo());\n dato[1] = registroarticulos.get(i).getFecha_ingreso();\n dato[2] = registroarticulos.get(i).getNombre_articulo();\n dato[3] = registroarticulos.get(i).getTalla_articuloXS();\n dato[4] = registroarticulos.get(i).getTalla_articuloS();\n dato[5] = registroarticulos.get(i).getTalla_articuloM();\n dato[6] = registroarticulos.get(i).getTalla_articuloL();\n dato[7] = registroarticulos.get(i).getTalla_articuloXL();\n dato[8] = registroarticulos.get(i).getColor_articulo();\n dato[9] = registroarticulos.get(i).getNombre_proveedor();\n dato[10] = registroarticulos.get(i).getExistencia_articulo();\n\n //System.out.println(\"vendedor:\" + vendedores);\n modelo.addRow(dato);\n }\n }", "private void setupTable() {\n\t\tString[] columns = { \"Course Name\", \"Course Number\" };\n\n\t\ttableModel = new DefaultTableModel(null, columns) {\n\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\t@Override\n\t\t\tpublic boolean isCellEditable(int row, int column) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\n\t\ttable = new JTable(tableModel);\n\t\ttable.setColumnSelectionAllowed(false);\n\t\ttable.setRowSelectionAllowed(true);\n\t\ttable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n\n\t\ttable.getSelectionModel().addListSelectionListener((ListSelectionEvent event) -> {\n\t\t\tif (table.getSelectedRow() >= 0) {\n\t\t\t\tString name = table.getValueAt(table.getSelectedRow(), 0).toString();\n\t\t\t\tint num = Integer.parseInt(table.getValueAt(table.getSelectedRow(), 1).toString());\n\t\t\t\tupdateTextArea((Course) adCon.search(name, num));\n\t\t\t}\n\t\t});\n\n\t\tJScrollPane scrollPane = new JScrollPane(table);\n\t\tscrollPane.setPreferredSize(new Dimension(350, 175));\n\t\tdisplay.add(scrollPane);\n\t}", "public add_category() throws SQLException, ClassNotFoundException {\n initComponents();\n /////////////////////////////////////////////////////\n /*\n method to populate List\n */\n this.setAlwaysOnTop (true);\n Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();\nthis.setLocation(dim.width/2-this.getSize().width/2, dim.height/2-this.getSize().height/2);\n tree=jTree1;\n populateArrayList(data);\n /*\n add data to Jtree\n */\n DefaultMutableTreeNode root = new DefaultMutableTreeNode(\"Found Nodes\");\n\n createTreeNodesForElement(root, getElementTreeFromPlainList());\n\n jTree1.setModel(new DefaultTreeModel(root));\n jTree1.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);\n // add(tree);\n \n \n \n \n \n \n \n ////////////////////////////////////////////////////\n \n expandAllNodes(jTree1, 0, jTree1.getRowCount());\n \n \n }", "private static void setTableWithData()\n {\n /* Se establecen el tamaño de la tabla */\n table.setSize(1280, 630);\n table.setMaximumSize(new Dimension(1280, 630));\n table.setMinimumSize(new Dimension(1280, 630));\n\n /* Se garantiza que cada fila (album) tiene un alto proporcional de acuerdo con el numero de cancioens */\n Iterator iteratorPerRow = listSizePerRow.iterator();\n int sizePerRow, i;\n i = 0;\n while (iteratorPerRow.hasNext())\n {\n sizePerRow = (Integer) iteratorPerRow.next(); \n table.setRowHeight(i, sizePerRow);\n i++;\n }\n\n /* Se setea el ancho de cada columna */\n setSize(table, JSoundsMainWindowViewController.ALBUM_COVER_COLUMN, 200);\n setSize(table, JSoundsMainWindowViewController.ALBUM_INFO_COLUMN, 230);\n setSize(table, JSoundsMainWindowViewController.NUMBER_SONG_COLUMN, 50);\n setSize(table, JSoundsMainWindowViewController.LIST_SONG_COLUMN, 400);\n setSize(table, JSoundsMainWindowViewController.GENDER_SONG_COLUMN, 230);\n\n /* Renderizado del la imagen del album */\n JLabelTableRenderer jltcr = new JLabelTableRenderer();\n jltcr.setVerticalAlignment(SwingConstants.TOP);\n jltcr.setHorizontalAlignment(SwingConstants.CENTER);\n\n table.getColumnModel().getColumn(0).setCellRenderer(jltcr);\n\n\n /* Renderizados de cada columna */\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.ALBUM_INFO_COLUMN).setCellRenderer(new JListTableRenderer());\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.ALBUM_INFO_COLUMN).setCellEditor(new JListTableEditor());\n\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.NUMBER_SONG_COLUMN).setCellRenderer(new JListTableRenderer());\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.NUMBER_SONG_COLUMN).setCellEditor(new JListTableEditor());\n\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.LIST_SONG_COLUMN).setCellRenderer(new JListTableRenderer());\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.LIST_SONG_COLUMN).setCellEditor(new JListTableEditor());\n\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.GENDER_SONG_COLUMN).setCellRenderer(new JListTableRenderer());\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.GENDER_SONG_COLUMN).setCellEditor(new JListTableEditor());\n\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.LAST_PLAYED_SONG_COLUMN).setCellRenderer(new JListTableRenderer());\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.LAST_PLAYED_SONG_COLUMN).setCellEditor(new JListTableEditor()); \n }", "public MostrarDatosJTable() {\n\t\t// Configuracion del JFrame\n\t\tthis.setLayout(null);\n\t\tthis.setSize(340, 260);\n\t\tthis.setTitle(\" Ejemplo de JScrollPane \");\n\t\tconfigurarJScrollPane();\n\t}", "public void ShowOrderDetailInJTable(){\n ArrayList<OrderDetail> list = getOrderDetailList();\n \n Object[] row = new Object[5];\n for (int i = 0; i < list.size(); i++) {\n row[0] = list.get(i).getOrderNumber();\n row[1] = list.get(i).getProductID();\n row[2] = \"Rp. \" + list.get(i).getUnitPrice();\n row[3] = list.get(i).getQuantity();\n row[4] = list.get(i).getDiscount()==0.05 ? \"5%\" : \"30%\";\n //total price\n double tempDiscount = list.get(i).getUnitPrice()*list.get(i).getQuantity()*list.get(i).getDiscount();\n// System.out.println(String.format(\"%.2f\",tempDiscount));\n double tempTotal = list.get(i).getUnitPrice()*list.get(i).getQuantity() - tempDiscount;\n// System.out.println(String.format(\"%.2f\", tempTotal));\n total=tempTotal+total;\n \n \n model2.addRow(row);\n }\n }", "private void populateTableData() {\n DefaultTableModel model = (DefaultTableModel) jTable1.getModel();\n model.setRowCount(0);\n for (Organization o : organizationDirectory.getOrganizationList()) {\n Object[] row = new Object[1];\n row[0] = o;\n //row[1] = o.getOrgName();\n model.addRow(row);\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n btnAgregarAlumno = new javax.swing.JButton();\n btnModificarAlumno = new javax.swing.JButton();\n btnEliminarAlumno = new javax.swing.JButton();\n jScrollPane1 = new javax.swing.JScrollPane();\n tblAlumnos = new javax.swing.JTable();\n lblDescripcion = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n btnAgregarAlumno.setText(\"Agregar\");\n btnAgregarAlumno.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnAgregarAlumnoActionPerformed(evt);\n }\n });\n\n btnModificarAlumno.setText(\"Modificar\");\n\n btnEliminarAlumno.setText(\"Eliminar\");\n\n tblAlumnos.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(tblAlumnos);\n\n lblDescripcion.setText(\"Ventana para agregar a los alumnos\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(84, 84, 84)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jScrollPane1)\n .addGroup(layout.createSequentialGroup()\n .addComponent(btnAgregarAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(100, 100, 100)\n .addComponent(btnModificarAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(91, 91, 91)\n .addComponent(btnEliminarAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGroup(layout.createSequentialGroup()\n .addGap(223, 223, 223)\n .addComponent(lblDescripcion)))\n .addContainerGap(99, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(32, 32, 32)\n .addComponent(lblDescripcion)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btnAgregarAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnModificarAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnEliminarAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(44, 44, 44)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 323, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(27, 27, 27))\n );\n\n pack();\n }", "public void populateDiseaseTable() {\r\n DefaultTableModel dtm = (DefaultTableModel) tblDisease.getModel();\r\n dtm.setRowCount(0);\r\n for (Conditions disease : system.getConditionsList().getConditionList()) {\r\n Object[] row = new Object[2];\r\n row[0] = disease;\r\n row[1] = disease.getDiseaseId();\r\n dtm.addRow(row);\r\n }\r\n }", "public void PreencherTabela2() throws SQLException {\n\n String[] colunas = new String[]{\"ID do Pedido\", \"Numero Grafica\", \"Data Emissao\",\"Boleto\"};\n ArrayList dados = new ArrayList();\n Connection connection = ConnectionFactory.getConnection();\n PedidoDAO pedidoDAO = new PedidoDAO(connection);\n ModeloPedido modeloPedido = new ModeloPedido();\n modeloPedido = pedidoDAO.buscaPorId(idPedidoClasse);\n SimpleDateFormat format = new SimpleDateFormat(\"dd/MM/yyyy\");\n\n dados.add(new Object[]{modeloPedido.getId(), modeloPedido.getNumeroGrafica(), format.format(modeloPedido.getDataEmissao()), modeloPedido.isBoleto()});\n\n ModeloTabela modelo = new ModeloTabela(dados, colunas);\n\n jTablePedido.setModel(modelo);\n jTablePedido.setRowSorter(new TableRowSorter(modelo));\n jTablePedido.getColumnModel().getColumn(0).setPreferredWidth(2);\n jTablePedido.getColumnModel().getColumn(0).setResizable(false);\n jTablePedido.getColumnModel().getColumn(1).setPreferredWidth(20);\n jTablePedido.getColumnModel().getColumn(1).setResizable(false);\n\n jTablePedido.getTableHeader().setReorderingAllowed(false);\n connection.close();\n }", "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 }", "private void displayAllTable() {\n\n nhacungcap = new NhaCungCap();\n nhacungcap.setVisible(true);\n jDestopTable.add(nhacungcap);\n\n thuoc = new SanPham();\n thuoc.setVisible(true);\n jDestopTable.add(thuoc);\n\n khachHang = new KhachHang();\n khachHang.setVisible(true);\n jDestopTable.add(khachHang);\n\n hoaDon = new HoaDon();\n hoaDon.setVisible(true);\n jDestopTable.add(hoaDon);\n\n }", "public void cargarDatos() {\n \n if(drogasIncautadoList==null){\n return;\n }\n \n \n \n List<Droga> datos = drogasIncautadoList;\n\n Object[][] matriz = new Object[datos.size()][4];\n \n for (int i = 0; i < datos.size(); i++) {\n \n \n //System.out.println(s[0]);\n \n matriz[i][0] = datos.get(i).getTipoDroga();\n matriz[i][1] = datos.get(i).getKgDroga();\n matriz[i][2] = datos.get(i).getQuetesDroga();\n matriz[i][3] = datos.get(i).getDescripcion();\n \n }\n Object[][] data = matriz;\n String[] cabecera = {\"Tipo Droga\",\"KG\", \"Quetes\", \"Descripción\"};\n dtm = new DefaultTableModel(data, cabecera);\n tableDatos.setModel(dtm);\n }", "public void ShowProductInJTable(){\n ArrayList<Product> list = getProductList();\n \n Object[] row = new Object[5];\n for (int i = 0; i < list.size(); i++) {\n row[0] = list.get(i).getPid();\n row[1] = list.get(i).getPname();\n row[2] = \"Rp. \" + list.get(i).getPprice();\n row[3] = list.get(i).getPstock();\n row[4] = list.get(i).getPcatid();\n \n model1.addRow(row);\n }\n }", "@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 tablaVentas = new javax.swing.JTable();\n\n setClosable(true);\n setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);\n\n tablaVentas.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(tablaVentas);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 378, Short.MAX_VALUE)\n );\n\n pack();\n }", "private void tablaConsultasMouseClicked(java.awt.event.MouseEvent evt) {\n datosconsulta = new DefaultTableModel();\n datosconsulta.addColumn(\"Cod Mascota\");\n datosconsulta.addColumn(\"Mascota\");\n datosconsulta.addColumn(\"Cod Enfermedad\");\n datosconsulta.addColumn(\"Enfermedad\");\n datosconsulta.addColumn(\"Diagnostico\");\n datosconsulta.addColumn(\"Notas\");\n datosconsulta.addColumn(\"Cod Vacuna\");\n datosconsulta.addColumn(\"Vacuna\");\n datosconsulta.addColumn(\"Aplicación\");\n datosconsulta.addColumn(\"Proxima\");\n tablaDatosDeconsulta.setModel(datosconsulta);\n cargarDatos();\n }", "@SuppressWarnings(\"unchecked\")\n private void showDuLieu(){\n try {\n tableMain.removeAll();\n String[] arr= {\"Mã Bạn Đọc \",\"Mã Tài Khoản\",\"Tên Bạn Đọc\" ,\"Địa Chỉ\",\"Số Điện Thoại\",\"Ngày Sinh\"};\n \n DefaultTableModel model = new DefaultTableModel(arr, 0);\n Connection connection = DBConnection.getConnection();\n String query = \"SELECT * FROM dbo.BanDoc20173329\";\n PreparedStatement ps = connection.prepareStatement(query);\n ResultSet rs = ps.executeQuery();\n while(rs.next()){\n Vector vector = new Vector();\n vector.add(rs.getString(\"MABANDOc20173329\"));\n vector.add(rs.getString(\"mataikhoan20173329\"));\n vector.add(rs.getString(\"tenbandoc20173329\"));\n vector.add(rs.getString(\"diachi20173329\"));\n vector.add(rs.getString(\"sodienthoai20173329\"));\n vector.add(rs.getString(\"ngaysinh20173329\"));\n model.addRow(vector);\n }\n DBConnection.closeConnection(connection);\n tableMain.setModel(model);\n tableMain.getSelectionModel().addListSelectionListener(new ListSelectionListener() {\n\n @Override\n public void valueChanged(ListSelectionEvent e) {\n if (tableMain.getSelectedRow()>=0) {\n tfMaBanDoc.setText(tableMain.getValueAt(tableMain.getSelectedRow(),0)+\"\");\n tfmataikhoan.setText(tableMain.getValueAt(tableMain.getSelectedRow(),1)+\"\");\n tftenbandoc.setText(tableMain.getValueAt(tableMain.getSelectedRow(),2)+\"\");\n tfdiachi.setText(tableMain.getValueAt(tableMain.getSelectedRow(),3)+\"\");\n tfsodienthoai.setText(tableMain.getValueAt(tableMain.getSelectedRow(),4)+\"\");\n tfngaysinh.setText(tableMain.getValueAt(tableMain.getSelectedRow(),5)+\"\");\n }\n }\n });\n \n } catch (SQLException ex) {\n Logger.getLogger(QuanLyBangSach.class.getName()).log(Level.SEVERE, null, ex);\n }}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\"> \n private void initComponents() {\n\n jMenuItem1 = new javax.swing.JMenuItem();\n jMenu3 = new javax.swing.JMenu();\n jSeparator1 = new javax.swing.JSeparator();\n jFileChooser1 = new javax.swing.JFileChooser();\n jScrollPane2 = new javax.swing.JScrollPane();\n jTable2 = new javax.swing.JTable();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n jScrollPane3 = new javax.swing.JScrollPane();\n jTable3 = new javax.swing.JTable();\n jScrollPane4 = new javax.swing.JScrollPane();\n jTable4 = new javax.swing.JTable();\n jScrollPane5 = new javax.swing.JScrollPane();\n jTable5 = new javax.swing.JTable();\n button1 = new java.awt.Button();\n jMenuBar1 = new javax.swing.JMenuBar();\n jMenu1 = new javax.swing.JMenu();\n jMenuItem2 = new javax.swing.JMenuItem();\n jMenu2 = new javax.swing.JMenu();\n\n jMenuItem1.setText(\"jMenuItem1\");\n\n jMenu3.setText(\"jMenu3\");\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jTable2.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {\"\", null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null}\n },\n new String [] {\n \"Linha\", \"Instrução\", \"Atributo #1\", \"Atributo #2\", \"Comentário\"\n }\n ));\n jScrollPane2.setViewportView(jTable2);\n\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null},\n {null, null},\n {null, null},\n {null, null},\n {null, null},\n {null, null},\n {null, null},\n {null, null},\n {null, null}\n },\n new String [] {\n \"Endereço\", \"Valor\"\n }\n ));\n jScrollPane1.setViewportView(jTable1);\n\n jTable3.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null},\n {null},\n {null},\n {null}\n },\n new String [] {\n \"Break Points\"\n }\n ));\n jScrollPane3.setViewportView(jTable3);\n\n jTable4.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null},\n {null},\n {null},\n {null}\n },\n new String [] {\n \"Janela de entrada\"\n }\n ));\n jScrollPane4.setViewportView(jTable4);\n\n jTable5.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null},\n {null},\n {null},\n {null}\n },\n new String [] {\n \"Janela de Saída\"\n }\n ));\n jScrollPane5.setViewportView(jTable5);\n\n button1.setLabel(\"Continuar\");\n button1.setName(\"button1\"); // NOI18N\n button1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n button1ActionPerformed(evt);\n }\n });\n\n jMenu1.setText(\"File\");\n\n jMenuItem2.setLabel(\"Selecionar Arquivo\");\n jMenuItem2.setName(\"\"); // NOI18N\n jMenuItem2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItem2ActionPerformed(evt);\n }\n });\n jMenu1.add(jMenuItem2);\n\n jMenuBar1.add(jMenu1);\n\n jMenu2.setText(\"Executar\");\n jMenuBar1.add(jMenu2);\n\n setJMenuBar(jMenuBar1);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 227, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(36, 36, 36)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 227, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 569, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGap(210, 210, 210)\n .addComponent(button1, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 237, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 515, Short.MAX_VALUE)))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 172, Short.MAX_VALUE)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))\n .addGap(37, 37, 37)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(19, 19, 19)\n .addComponent(button1, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(29, Short.MAX_VALUE))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(208, 208, 208)\n .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(73, Short.MAX_VALUE)))\n );\n\n button1.getAccessibleContext().setAccessibleName(\"button1\");\n button1.getAccessibleContext().setAccessibleDescription(\"\");\n\n pack();\n }", "public void LlenarPagos(){\n datos=new DefaultTableModel();\n LlenarModelo();\n this.TablaPagos.setModel(datos);\n }", "private void createTable(){\n Object[][] data = new Object[0][8];\n int i = 0;\n for (Grupo grupo : etapa.getGrupos()) {\n Object[][] dataAux = new Object[data.length+1][8];\n System.arraycopy(data, 0, dataAux, 0, data.length);\n dataAux[i++] = new Object[]{grupo.getNum(),grupo.getAtletas().size(),\"Registar Valores\",\"Selecionar Vencedores\", \"Selecionar Atletas\"};\n data = dataAux.clone();\n }\n\n //COLUMN HEADERS\n String columnHeaders[]={\"Numero do Grupo\",\"Número de Atletas\",\"\",\"\",\"\"};\n\n tableEventos.setModel(new DefaultTableModel(\n data,columnHeaders\n ));\n //SET CUSTOM RENDERER TO TEAMS COLUMN\n tableEventos.getColumnModel().getColumn(2).setCellRenderer(new ButtonRenderer());\n tableEventos.getColumnModel().getColumn(3).setCellRenderer(new ButtonRenderer());\n tableEventos.getColumnModel().getColumn(4).setCellRenderer(new ButtonRenderer());\n\n //SET CUSTOM EDITOR TO TEAMS COLUMN\n tableEventos.getColumnModel().getColumn(2).setCellEditor(new ButtonEditor(new JTextField(), this.etapa));\n tableEventos.getColumnModel().getColumn(3).setCellEditor(new ButtonEditor(new JTextField(), this.etapa));\n tableEventos.getColumnModel().getColumn(4).setCellEditor(new ButtonEditor(new JTextField(), this.etapa));\n\n }", "private void cargar(List<Personas> listaP) {\n int total= listaP.size();\n Object [][] tab = new Object [total][10];\n int i=0;\n Iterator iter = listaP.iterator();\n while (iter.hasNext()){\n Object objeto = iter.next();\n Personas pro = (Personas) objeto;\n\n tab[i][0]=pro.getLocalidadesid().getProvinciasId();\n tab[i][1]=pro.getLocalidadesid();\n tab[i][2]=pro.getCuilcuit();\n tab[i][3]=pro.getApellido();\n tab[i][4]=pro.getNombres();\n tab[i][5]=pro.getCalle();\n tab[i][6]=pro.getAltura();\n tab[i][7]=pro.getPiso();\n tab[i][8]=pro.getEmail();\n// if(pro.getEmpleados().equals(\"\")){\n tab[i][9]=\"Cliente\";\n // }else{\n // tab[i][7]=\"Empleado\";\n // }\n i++;\n }\njTable1 = new javax.swing.JTable();\n\njTable1.setModel(new javax.swing.table.DefaultTableModel(\ntab,\nnew String [] {\n \"Provincia\", \"Localidad\", \"DNI/Cuit\", \"Apellido\", \"Nombres\", \"Calle\", \"Altura\", \"Piso\", \"Email\", \"Tipo\"\n}\n));\n jScrollPane1.setViewportView(jTable1);\n }", "public ExibeTarefas() {\n initComponents();\n DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel();\n jTable1.setRowSorter(new TableRowSorter(modelo));\n readJTable();\n readItemBox();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n titulojLabel = new javax.swing.JLabel();\n jSeparator1 = new javax.swing.JSeparator();\n jScrollPane1 = new javax.swing.JScrollPane();\n medicosjTable = new javax.swing.JTable();\n editajButton = new javax.swing.JButton();\n voltarjButton = new javax.swing.JButton();\n excluirjButton = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n titulojLabel.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n titulojLabel.setText(\" LISTA DE MEDICOS CADASTRADOS\");\n\n medicosjTable.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null}\n },\n new String [] {\n \"Codigo\", \"Crm\", \"Nome\", \"Endereco\", \"Especialidade\", \"Convenio\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n medicosjTable.setColumnSelectionAllowed(true);\n medicosjTable.getTableHeader().setReorderingAllowed(false);\n jScrollPane1.setViewportView(medicosjTable);\n medicosjTable.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);\n\n editajButton.setText(\"Editar\");\n editajButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n editajButtonActionPerformed(evt);\n }\n });\n\n voltarjButton.setText(\"Voltar\");\n voltarjButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n voltarjButtonActionPerformed(evt);\n }\n });\n\n excluirjButton.setText(\"Excluir\");\n excluirjButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n excluirjButtonActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jSeparator1)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 486, Short.MAX_VALUE)\n .addComponent(titulojLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addContainerGap())\n .addGroup(layout.createSequentialGroup()\n .addGap(30, 30, 30)\n .addComponent(editajButton)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(voltarjButton)\n .addGap(135, 135, 135)\n .addComponent(excluirjButton)\n .addGap(27, 27, 27))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(titulojLabel)\n .addGap(14, 14, 14)\n .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 187, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(editajButton)\n .addComponent(voltarjButton)\n .addComponent(excluirjButton))\n .addGap(22, 22, 22))\n );\n\n pack();\n }", "private void popularTabela() {\n\n if (CadastroCliente.listaAluno.isEmpty()) {\n DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel();\n modelo.setNumRows(0);\n }\n int t = 0;\n DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel();\n modelo.setNumRows(0);\n int aux = CadastroCliente.listaAluno.size();\n\n while (t < aux) {\n aluno = CadastroCliente.listaAluno.get(t);\n modelo.addRow(new Object[]{aluno.getMatricula(), aluno.getNome(), aluno.getCpf(), aluno.getTel()});\n t++;\n }\n }", "private void tampilkan() {\n //To change body of generated methods, choose Tools | Templates.\n DefaultTableModel tabelpegawai = new DefaultTableModel();\n tabelpegawai.addColumn(\"NAMA\");\n tabelpegawai.addColumn(\"ALAMAT\");\n tabelpegawai.addColumn(\"HP\");\n tabelpegawai.addColumn(\"BBM\");\n tabelpegawai.addColumn(\"SITUS\");\n \n \n try {\n conek getCnn = new conek();\n con= null;\n con= (com.mysql.jdbc.Connection) getCnn.getConnection();\n String sql = \"select * from toko \";\n Statement stat = con.createStatement();\n ResultSet res=stat.executeQuery(sql);\n while (res.next()){\n tabelpegawai.addRow(new Object[]{res.getString(1),res.getString(2),res.getString(3),res.getString(4),res.getString(5)});\n }\n jTable1.setModel(tabelpegawai);\n } catch(Exception e){}\n }", "private void showAllDataStok() {\n tableStok.getSelectionModel().removeListSelectionListener(this);\n listStok = daoStok.getAllStok();\n dtmStok.getDataVector().removeAllElements();\n for (Stokdigudang s : listStok) {\n dtmStok.addRow(new Object[]{\n s.getIDBarang(),\n s.getNamaBarang(),\n s.getStok(),\n s.getBrand(),\n s.getHarga(),\n s.getIDKategori().getNamaKategori(),\n s.getIDSupplier().getNamaPerusahaan(),\n s.getTanggalDidapat()\n });\n }\n tableStok.getSelectionModel().addListSelectionListener(this);\n }", "@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 tblDependentes = new javax.swing.JTable();\n btnFechar = new javax.swing.JButton();\n\n setTitle(\"Lista de Dependentes\");\n\n tblDependentes.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {},\n {},\n {},\n {}\n },\n new String [] {\n\n }\n ));\n tblDependentes.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n tblDependentesMousePressed(evt);\n }\n });\n jScrollPane1.setViewportView(tblDependentes);\n\n btnFechar.setText(\"Fechar\");\n btnFechar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnFecharActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1032, Short.MAX_VALUE)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnFechar)\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 271, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(btnFechar)\n .addContainerGap(14, Short.MAX_VALUE))\n );\n\n pack();\n }", "public void init2(){\n dateTextField.setText(String.valueOf(dateFormat.format(d)));\n Object [][] temp = new Object[realizarVenda.compra.size()][9];\n finalPurchaseTable.setModel(new javax.swing.table.DefaultTableModel(\n temp,\n new String [] {\n \"Pct#\", \"Nome\", \"Descrição\", \"Tamanho\", \"Valor\", \"Qntd\", \"Gênero\", \"Departamento\", \"Loja\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Object.class, java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.String.class\n };\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false, false, false, false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n finalPurchaseTable.setToolTipText(\"Pacote, Nome, Descrição, Tamanho, Valor, Quantidade, Gênero, Departamento, Loja\");\n finalPurchaseTable.getTableHeader().setReorderingAllowed(false);\n jScrollPane1.setViewportView(finalPurchaseTable);\n if (finalPurchaseTable.getColumnModel().getColumnCount() > 0) {\n finalPurchaseTable.getColumnModel().getColumn(0).setPreferredWidth(35);\n finalPurchaseTable.getColumnModel().getColumn(0).setMaxWidth(35);\n finalPurchaseTable.getColumnModel().getColumn(3).setPreferredWidth(45);\n finalPurchaseTable.getColumnModel().getColumn(3).setMaxWidth(45);\n finalPurchaseTable.getColumnModel().getColumn(4).setPreferredWidth(75);\n finalPurchaseTable.getColumnModel().getColumn(4).setMaxWidth(95);\n finalPurchaseTable.getColumnModel().getColumn(5).setPreferredWidth(45);\n finalPurchaseTable.getColumnModel().getColumn(5).setMaxWidth(45);\n finalPurchaseTable.getColumnModel().getColumn(6).setPreferredWidth(50);\n finalPurchaseTable.getColumnModel().getColumn(6).setMaxWidth(50);\n finalPurchaseTable.getColumnModel().getColumn(7).setPreferredWidth(70);\n finalPurchaseTable.getColumnModel().getColumn(7).setMaxWidth(70);\n finalPurchaseTable.getColumnModel().getColumn(8).setPreferredWidth(60);\n finalPurchaseTable.getColumnModel().getColumn(8).setMaxWidth(60);\n }\n for(int row = 0, col = 1;row<realizarVenda.compra.size();row++){\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).remessa, row, 0);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).nome, row, col);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).desc, row, col+1);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).tamanho, row, col+2);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).valor.valor_final, row, col+ 3);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).quantidade, row, col+4);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).sexo, row, col+5);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).dept, row, col+6);\n finalPurchaseTable.setValueAt(realizarVenda.compra.get(row).loja, row, col+7);\n }\n percentLabel.setText(String.valueOf(taxa)+\"%\");\n }", "public final void detalleTabla()\n {\n \n try\n {\n ResultSet obj=nueva.executeQuery(\"SELECT cli_nit,cli_razon_social FROM clientes.cliente ORDER BY cli_razon_social ASC\");\n \n while (obj.next()) \n {\n \n Object [] datos = new Object[2];\n \n \n for (int i=0;i<2;i++)\n {\n datos[i] =obj.getObject(i+1);\n }\n\n modelo.addRow(datos);\n \n }\n tabla_cliente.setModel(modelo);\n nueva.desconectar();\n \n \n \n }catch(Exception e)\n {\n JOptionPane.showMessageDialog(null, e, \"Error\", JOptionPane.ERROR_MESSAGE);\n }\n }", "private void TampilData() {\n DefaultTableModel model = new DefaultTableModel();\n model.addColumn(\"NO\");\n model.addColumn(\"ID\");\n model.addColumn(\"NAME\");\n model.addColumn(\"USERNAME\");\n tabelakses.setModel(model);\n\n //menampilkan data database kedalam tabel\n try {\n int i=1;\n java.sql.Connection conn = new DBConnection().connect();\n java.sql.Statement stat = conn.createStatement();\n ResultSet data = stat.executeQuery(\"SELECT * FROM p_login order by Id asc\");\n while (data.next()) {\n model.addRow(new Object[]{\n (\"\" + i++),\n data.getString(\"Id\"),\n data.getString(\"Name\"),\n data.getString(\"Username\")\n });\n tabelakses.setModel(model);\n }\n } catch (Exception e) {\n System.err.println(\"ERROR:\" + e);\n }\n }", "private void load_anggota(){\n Object header[] = {\"ID ANGGOTA\",\"NIS\",\"NAMA ANGGOTA\",\"JK\",\"TINGKAT\",\"JURUSAN\",\"NO HP\",\"STATUS\"};\n DefaultTableModel tableModel = new DefaultTableModel(null, header);\n TabelAnggota.setModel(tableModel);\n\n String sql_data=\"SELECT * FROM tbl_anggota\";\n try{\n Connection kon = koneksi.getConnection();\n Statement st=kon.createStatement();\n ResultSet rs=st.executeQuery(sql_data);\n while(rs.next()){\n String d1=rs.getString(1);\n String d2=rs.getString(2);\n String d3=rs.getString(3);\n String d4=rs.getString(4);\n String d5=rs.getString(5);\n String d6=rs.getString(6);\n String d7=rs.getString(7);\n String d8=rs.getString(8);\n \n String d[]={d1,d2,d3,d4,d5,d6,d7,d8};\n tableModel.addRow(d);\n }\n }catch(Exception e){\n JOptionPane.showMessageDialog(null, e);\n }\n }", "public JTable getJrTbl() {\n\t\tForMngJrArticleModel fmngJr = new ForMngJrArticleModel();\n\t\tDefaultTableModel defModel = new DefaultTableModel(0,7);\n\t\tJTable jTblForJr = new JTable(defModel);\n\t\tfor(int i =0; i<getJrArtArrayList().size();i++) {\n\t\t\tfmngJr = getJrArtArrayList().get(i);\n\t\t\t//condition to check if there is id of the logged in researcher in the loaned out to column \n\t\t\tif(fmngJr.getNmOfRe().contains(loggedReseId)) {\n\t\t\t\tObject[] objData = {fmngJr.getArNmOfJr(), fmngJr.getAuthNmOfJr(),fmngJr.getNmOfJr(), fmngJr.getYrOfJr(), fmngJr.getVolOfJr(),fmngJr.getIssOfJr(),fmngJr.getPgOfJr()};\n\t\t\t\tdefModel.addRow(objData);\n\t\t\t}\n\t\t}\n\n\t\tString reColTitles[] = {\"Name of Article\", \"Author/s\",\"Journal Title\", \"<html>Publication<br>Year</html>\",\"Volume No.\",\"Issue No.\",\"Page No.\"};\n\t\tdefModel.setColumnIdentifiers(reColTitles);\n\t\tjTblForJr.setRowHeight(28);\n\n\t\tJTableHeader tblHeader = jTblForJr.getTableHeader();\n\t\ttblHeader.setPreferredSize(new Dimension(100,35));\n\t\ttblHeader.setBackground(new Color(21, 34, 49));\n\t\ttblHeader.setForeground(Color.WHITE);\n\n\t\treturn jTblForJr;\n\t}", "private void initialize() {\r\n\t\t\r\n\t\tString[] columnNames = {\"First Name\",\r\n \"Last Name\",\r\n \"Sport\",\r\n \"# of Years\",\r\n \"Vegetarian\"};\r\n\t\t\r\n\t\tObject[][] data = {\r\n\t\t\t {\"Kathy\", \"Smith\",\r\n\t\t\t \"Snowboarding\", new Integer(5), new Boolean(false)},\r\n\t\t\t {\"John\", \"Doe\",\r\n\t\t\t \"Rowing\", new Integer(3), new Boolean(true)},\r\n\t\t\t {\"Sue\", \"Black\",\r\n\t\t\t \"Knitting\", new Integer(2), new Boolean(false)},\r\n\t\t\t {\"Jane\", \"White\",\r\n\t\t\t \"Speed reading\", new Integer(20), new Boolean(true)},\r\n\t\t\t {\"Joe\", \"Brown\",\r\n\t\t\t \"Pool\", new Integer(10), new Boolean(false)}\r\n\t\t\t};\t\t\r\n\r\n\t\t//JTable \r\n\t\t\r\n\t\t\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(100, 100, 544, 432);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(new BorderLayout(0, 0));\r\n\t\t\r\n\t\tJTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);\r\n\t\tframe.getContentPane().add(tabbedPane);\r\n\t\t\r\n\t\tJPanel panel = new JPanel();\r\n\t\ttabbedPane.addTab(\"New tab\", null, panel, null);\r\n\t\t\r\n\t\ttable = new JTable(data, columnNames);\r\n\t\t\r\n\t\ttable_1 = new JTable(data, columnNames);\r\n\t\t\r\n\t\ttable_2 = new JTable(data, columnNames);\r\n\t\tGroupLayout gl_panel = new GroupLayout(panel);\r\n\t\tgl_panel.setHorizontalGroup(\r\n\t\t\tgl_panel.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t.addComponent(table_2, GroupLayout.PREFERRED_SIZE, 523, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t.addGroup(gl_panel.createSequentialGroup()\r\n\t\t\t\t\t.addGap(148)\r\n\t\t\t\t\t.addComponent(table_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\r\n\t\t\t\t.addComponent(table, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t);\r\n\t\tgl_panel.setVerticalGroup(\r\n\t\t\tgl_panel.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t.addGroup(gl_panel.createSequentialGroup()\r\n\t\t\t\t\t.addComponent(table_2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t.addGroup(gl_panel.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t\t\t.addComponent(table_1, GroupLayout.DEFAULT_SIZE, 285, Short.MAX_VALUE)\r\n\t\t\t\t\t\t.addComponent(table, GroupLayout.PREFERRED_SIZE, 285, GroupLayout.PREFERRED_SIZE)))\r\n\t\t);\r\n\t\tpanel.setLayout(gl_panel);\r\n\t\t\r\n\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tsearch_textField1.setText(\"\");\n\t\t\t\tsearch_textField2.setText(\"\");\n\t\t\t\tint num=tableModel.getRowCount();\n\t\t\t\twhile(num--!=0){tableModel.removeRow(0);}\n\t\t\t\t\n\t\t\t\ttry {//插入\n\t\t\t\t\t\n\t\t Connection con = DriverManager.getConnection(conURL, Test.mysqlname, Test.mysqlpassword); // 连接数据库\n\n\t\t Statement s = con.createStatement(); // Statement类用来提交SQL语句\n\n\t\t ResultSet rs = s.executeQuery(\"select * from goods\"); // 提交查询,返回的表格保存在rs中\n\t\t \n\t\t while(rs.next()) { // ResultSet指针指向下一个“行”\n\t\t \t\n\t\t \tVector<String> rowV = new Vector<String>();\n\t\t \trowV.add(rs.getString(\"lei\"));\n\t\t \t\t\trowV.add(rs.getString(\"name\"));\n\t\t \t\t\ttableValueV.add(rowV);\n\t\t }\n\t\t tableModel.setDataVector(tableValueV,columnNameV); \n\t \t\t\tint rowCount = table.getRowCount(); \n\t \t\t\ttable.getSelectionModel().setSelectionInterval(rowCount-1 , rowCount- 1 ); \n\t \t\t\tRectangle rect = table.getCellRect(rowCount-1 , 0 , true );\n\t \t\t\ttable.scrollRectToVisible(rect); \n\t\t s.close(); // 释放Statement对象\n\t\t con.close(); // 关闭到MySQL服务器的连接\n\t\t TableColumnModel cm = table.getColumnModel(); \n\t\t \t\tTableColumn column = cm.getColumn(0);//得到第i个列对象 \n\t\t \t\t column.setPreferredWidth(210);//将此列的首选宽度设置为 preferredWidth。\n\t\t \t\t TableColumn column1 = cm.getColumn(1);//得到第i个列对象 \n\t\t \t\t column1.setPreferredWidth(210);//将此列的首选宽度设置为 preferredWidth。\n\t\t \t\t \n\t\t \t\t \n\t\t }\n\t\t catch(SQLException sql_e) { // 都是SQLExceptionss\n\t\t System.out.println(sql_e);\n\t\t }\n\t\t\t}", "private void initButton() {\n\t\tthis.btn_detail = new JButton(); \n\t\tthis.btn_detail.setBounds(5, 5, 60, 20);\n\t\tthis.btn_detail.setFont(new Font(\"微软雅黑\",Font.PLAIN,12));\n\t\tthis.btn_detail.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tMyButtonEditor.this.fireEditingCanceled(); \n\t\t\t\t//查看详情\n\t\t\t\t\n\t\t\t\tif(mdtjf!=null){\n\t\t\t\t\tmdtjf.dispose();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tMyTableModel model = (MyTableModel) jtb.getModel();\n\t\t\t\t\t\n\t\t\t\t\tVector<List<String>> data = model.getTableData();\n\t\t\t\t\t\n\t\t\t\t\tVector<List<String>> newData = new Vector<List<String>>();\n\t\t\t\t\t\n\t\t\t\t\tList<String> list = data.get(jtb.getSelectedRow());\n\t\t\t\t\t\n\t\t\t\t\tString name = list.get(0).split(\"×\")[0];\n\t\t\t\t\t\n\t\t\t\t\tList<String> newList = new ArrayList<String>();\n\t\t\t\t\t\n\t\t\t\t\t//添加菜名\n\t\t\t\t\tnewList.add(name);\n\t\t\t\t\t//添加份数为1份,即查看每份所需材料,Order中已对数据进行处理,故无需管后面几项\n\t\t\t\t\t//Order中处理只根据菜名和份数,即可算出所需的所有东西\n\t\t\t\t\t//这里直接添加菜名+份数1份,利用order可查看1份菜品所需的材料\n\t\t\t\t\tnewList.add(\"1\");\n\t\t\t\t\t\n\t\t\t\t\tnewData.add(newList);\n\t\t\t\t\t\n\t\t\t\t\tMyTableModel newModel = new MyTableModel(jf);\n\t\t\t\t\tnewModel.setTableData(newData);\n\t\t\t\t\t\n\t\t\t\t\tOrder order = new Order(jf, newModel, ALL_DISHES);\n\t\t\t\t\t\n\t\t\t\t\tmdtjf = new MyDetailTableJF(order);\n\t\t\t\t\tmdtjf.setVisible(true);\n\t\t\t\t\t\n\t\t\t}\n\t\t});\n\n\t\tthis.btn_delete = new JButton(); \n\t\tthis.btn_delete.setBounds(70, 5, 60, 20);\n\t\tthis.btn_delete.setFont(new Font(\"微软雅黑\",Font.PLAIN,12));\n\t\tthis.btn_delete.addActionListener(new ActionListener() {\n\n\t\t\t@SuppressWarnings(\"deprecation\")\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tMyButtonEditor.this.fireEditingCanceled(); \n\t\t\t\tnew WarningDialog(jtb).jd.show();\n\t\t\t}\n\t\t});\n\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 tblDatos = new javax.swing.JTable();\n btnListar = new javax.swing.JButton();\n\n setClosable(true);\n setTitle(\"Listado\");\n\n tblDatos.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Rut\", \"Numero\", \"Becado\", \"Ciudad\", \"Sexo\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.String.class, java.lang.Integer.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class\n };\n boolean[] canEdit = new boolean [] {\n false, false, true, true, true\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n jScrollPane1.setViewportView(tblDatos);\n\n btnListar.setText(\"Listar\");\n btnListar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnListarActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(btnListar)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(0, 27, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(19, 19, 19)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 220, Short.MAX_VALUE)\n .addGap(29, 29, 29)\n .addComponent(btnListar)\n .addGap(32, 32, 32))\n );\n\n pack();\n }", "public fDetalhePedido(java.awt.Frame parent, boolean modal, int id, String nome, String data, int num, int nf) {\n super(parent, modal);\n initComponents();\n\n DefaultTableModel modelo2 = (DefaultTableModel) jTable2.getModel();\n jTable2.setRowSorter(new TableRowSorter(modelo2));\n\n jLabel4.setText(id + \" - \" + nome);\n jLabel7.setText(\"NF: \" + nf);\n jLabel8.setText(\"Pedido: \" + num);\n jLabel9.setText(data);\n\n itensPedidoDAO idao = new itensPedidoDAO();\n\n Double total = 0.0;\n\n for (itensPedido i : idao.carrinho(num)) {\n\n modelo2.addRow(new Object[]{\n i.getQuantidade(),\n i.getDescricao(),\n i.getPreco(),\n i.getPreco() * i.getQuantidade()\n\n });\n\n total += i.getPreco() * i.getQuantidade();\n\n String tot = Double.toString(total);\n jLabel5.setText(tot);\n\n }\n }", "public void bindingTable(){\n String[] header={\"Region Id\",\"Region Name\"};\n DefaultTableModel defaultTableModel = new DefaultTableModel(header, 0);\n for (Region region : regionController.binding()) {\n// for (Region binding : regionController.binding(\"region_id\",\"asc\")) {\n Object[] region1 ={\n region.getRegionId(),region.getRegionName()\n };\n defaultTableModel.addRow(region1);\n }\n tableRegion.setModel(defaultTableModel);\n }", "public void populate(){\n DefaultTableModel dtms = (DefaultTableModel)ticketTable.getModel();\n dtms.setRowCount(0);\n for(Ticket a:ticket)\n {\n Object[] row = new Object[dtms.getColumnCount()];\n row[0]=a;\n row[1]=a.getAirlineNO();\n row[2]=a.getCustomer();\n row[3]=a.getSeat();\n row[4]=a.getAirlineAgency();\n out.println(a+\" \"+a.getAirlineNO()+\" \"+a.getCustomer()+\" \"+a.getSeat()+\" \"+a.getAirlineAgency());\n dtms.addRow(row);\n }\n }", "public void llenadoDeTablas() {\n \n DefaultTableModel modelo1 = new DefaultTableModel();\n modelo1 = new DefaultTableModel();\n modelo1.addColumn(\"ID Usuario\");\n modelo1.addColumn(\"NOMBRE\");\n UsuarioDAO asignaciondao = new UsuarioDAO();\n List<Usuario> asignaciones = asignaciondao.select();\n TablaPerfiles.setModel(modelo1);\n String[] dato = new String[2];\n for (int i = 0; i < asignaciones.size(); i++) {\n dato[0] = (Integer.toString(asignaciones.get(i).getId_usuario()));\n dato[1] = asignaciones.get(i).getNombre_usuario();\n\n modelo1.addRow(dato);\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n inpName = new javax.swing.JTextField();\n jButton1 = new javax.swing.JButton();\n jScrollPane1 = new javax.swing.JScrollPane();\n tblSupplier = new javax.swing.JTable();\n jButton2 = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabel1.setText(\"Tìm Nhà cung cấp nguyên liệu\");\n\n jLabel2.setText(\"Từ khóa: \");\n\n jButton1.setText(\"Tìm kiếm\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n tblSupplier.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"ID\", \"Tên nhà cung cấp\", \"Số điện thoại \", \"Địa chỉ\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n });\n tblSupplier.setColumnSelectionAllowed(true);\n tblSupplier.setRowHeight(30);\n tblSupplier.getTableHeader().setReorderingAllowed(false);\n tblSupplier.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n tblSupplierMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(tblSupplier);\n tblSupplier.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);\n\n jButton2.setText(\"Thêm \");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(47, 47, 47)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(inpName, javax.swing.GroupLayout.PREFERRED_SIZE, 333, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(108, 108, 108)\n .addComponent(jButton1)\n .addGap(33, 33, 33)\n .addComponent(jButton2)))\n .addContainerGap(194, Short.MAX_VALUE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(28, 28, 28)\n .addComponent(jScrollPane1)\n .addContainerGap())\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(27, 27, 27)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(inpName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jButton1)\n .addComponent(jButton2))\n .addGap(33, 33, 33)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE)\n .addGap(75, 75, 75))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n );\n\n pack();\n }", "public void tampil_tb_mahasiswa(){\n Object []baris = {\"No Bp\",\"Nama\",\"Tempat Lahir\",\"Tanggal Lhair\",\"Jurusan\",\"Tanggal Masuk\"};\n tabmode = new DefaultTableModel(null, baris);\n //tb_mahasiswa.setModel(tabmode);\n try {\n Connection con = new koneksi().getConnection();\n String sql = \"select * from tb_mahasiswa order by no_bp asc\";\n java.sql.Statement stat = con.createStatement();\n java.sql.ResultSet hasil = stat.executeQuery(sql);\n while (hasil.next()){\n String no_bp = hasil.getString(\"no_bp\");\n String nama = hasil.getString(\"nama\");\n String tempat_lahir = hasil.getString(\"tempat_lahir\");\n String tanggal_lahir = hasil.getString(\"tanggal_lahir\");\n String jurusan = hasil.getString(\"jurusan\"); \n String tanggal_masuk = hasil.getString(\"tanggal_masuk\");\n String[] data = {no_bp, nama, tempat_lahir, tanggal_lahir, jurusan, tanggal_masuk};\n tabmode.addRow(data);\n }\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"Menampilkan data GAGAL\",\"Informasi\", JOptionPane.INFORMATION_MESSAGE);\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n scroolPane = new javax.swing.JScrollPane();\n bookTable = new javax.swing.JTable();\n jScrollPane1 = new javax.swing.JScrollPane();\n TabelAnggota = new javax.swing.JTable();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n MasterData = new javax.swing.JLabel();\n bDashboard = new javax.swing.JLabel();\n bLogout = new javax.swing.JLabel();\n bDataPinjam = new javax.swing.JLabel();\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 jPanel1.setBackground(new java.awt.Color(255, 255, 255));\n\n bookTable.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n bookTable.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n bookTableMouseClicked(evt);\n }\n });\n scroolPane.setViewportView(bookTable);\n\n TabelAnggota.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n TabelAnggota.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n TabelAnggotaMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(TabelAnggota);\n\n jLabel4.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n jLabel4.setText(\"Data Anggota\");\n\n jLabel5.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n jLabel5.setText(\"Data Buku\");\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(42, 42, 42)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(scroolPane, javax.swing.GroupLayout.DEFAULT_SIZE, 786, Short.MAX_VALUE)\n .addComponent(jLabel4)\n .addComponent(jLabel5)\n .addComponent(jScrollPane1))\n .addContainerGap(58, Short.MAX_VALUE))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addComponent(jLabel5)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(scroolPane, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(48, 48, 48)\n .addComponent(jLabel4)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(160, Short.MAX_VALUE))\n );\n\n getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(265, 120, 886, 442));\n\n MasterData.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n MasterDataMouseClicked(evt);\n }\n });\n getContentPane().add(MasterData, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 281, 236, 58));\n\n bDashboard.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n bDashboardMouseClicked(evt);\n }\n });\n getContentPane().add(bDashboard, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 163, 236, 58));\n\n bLogout.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n bLogoutMouseClicked(evt);\n }\n });\n getContentPane().add(bLogout, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 384, 236, 58));\n\n bDataPinjam.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n bDataPinjamMouseClicked(evt);\n }\n });\n getContentPane().add(bDataPinjam, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 222, 236, 58));\n\n jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/assets/mKepalaMaster.jpg\"))); // NOI18N\n getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1181, 590));\n\n pack();\n setLocationRelativeTo(null);\n }", "public PanelTableProduct(JTable tProductos, ArrayList productList) {\n\n // ToolsInterface\n InterfaceTools tools = new InterfaceTools();\n\n ModelTableProduct tmodel = new ModelTableProduct(productList);\n tProductos.setModel(tmodel);\n\n /// PanelTableProduct model = new PanelTableProduct();\n\n\n // BaseDatosProducto baseDatos = new BaseDatosProducto();\n\n // Modificar encabezado\n tProductos.getTableHeader().setReorderingAllowed(false);\n\n tProductos.getTableHeader().setBackground(tools.getColorThree());\n tProductos.getTableHeader().setForeground(tools.getColorFour());\n\n\n tProductos.getTableHeader().setFont(new Font(\"Arial\",Font.PLAIN,14));\n // tProductos.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n tProductos.setSelectionBackground(tools.getColorOne());\n\n\n // tProductos.setEnabled(false);\n tProductos.setRowHeight(20);\n\n\n // Alinear a la Izquierda columna precios e inventario\n\n DefaultTableCellRenderer alignRight = new DefaultTableCellRenderer();\n alignRight.setHorizontalAlignment(SwingConstants.RIGHT);\n tProductos.getColumnModel().getColumn(1).setCellRenderer(alignRight);\n tProductos.getColumnModel().getColumn(2).setCellRenderer(alignRight);\n\n // Edición de celdas\n\n JScrollPane scrollPane = new JScrollPane(tProductos);\n\n scrollPane.setPreferredSize(new Dimension(450,363));\n scrollPane.setViewportView(tProductos);\n\n\n add(scrollPane);\n\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jScrollPane1 = new javax.swing.JScrollPane();\n cTable = new javax.swing.JTable();\n jLabel1 = new javax.swing.JLabel();\n jButton1 = new javax.swing.JButton();\n jPanel2 = new javax.swing.JPanel();\n jLabel2 = new javax.swing.JLabel();\n jScrollPane2 = new javax.swing.JScrollPane();\n cTable1 = new javax.swing.JTable();\n jPanel3 = new javax.swing.JPanel();\n jLabel3 = new javax.swing.JLabel();\n jScrollPane3 = new javax.swing.JScrollPane();\n cTable2 = new javax.swing.JTable();\n jMenuBar1 = new javax.swing.JMenuBar();\n jMenu1 = new javax.swing.JMenu();\n jMenuItem1 = new javax.swing.JMenuItem();\n jMenuItem2 = new javax.swing.JMenuItem();\n jMenuItem3 = new javax.swing.JMenuItem();\n jMenu2 = new javax.swing.JMenu();\n jMenuItem4 = new javax.swing.JMenuItem();\n jMenuItem5 = new javax.swing.JMenuItem();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n addWindowListener(new java.awt.event.WindowAdapter() {\n public void windowClosing(java.awt.event.WindowEvent evt) {\n formWindowClosing(evt);\n }\n public void windowActivated(java.awt.event.WindowEvent evt) {\n formWindowActivated(evt);\n }\n });\n getContentPane().setLayout(new java.awt.CardLayout());\n\n jPanel1.setBackground(new java.awt.Color(204, 204, 255));\n\n cTable.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));\n cTable.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Complaint ID\", \"Complaint Type\", \"Complainer ID\", \"Complainer Name\", \"Status\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class\n };\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n cTable.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseReleased(java.awt.event.MouseEvent evt) {\n cTableMouseReleased(evt);\n }\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n cTableMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(cTable);\n if (cTable.getColumnModel().getColumnCount() > 0) {\n cTable.getColumnModel().getColumn(0).setMinWidth(30);\n cTable.getColumnModel().getColumn(0).setPreferredWidth(30);\n }\n\n jLabel1.setFont(new java.awt.Font(\"Lucida Grande\", 1, 36)); // NOI18N\n jLabel1.setForeground(new java.awt.Color(0, 153, 153));\n jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel1.setText(\"Complains Submitted\");\n\n jButton1.setBackground(new java.awt.Color(0, 102, 0));\n jButton1.setFont(new java.awt.Font(\"Lucida Grande\", 1, 18)); // NOI18N\n jButton1.setForeground(new java.awt.Color(51, 51, 0));\n jButton1.setText(\"View Complain\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING))\n .addContainerGap())\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(297, 297, 297)\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(250, Short.MAX_VALUE))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 7, Short.MAX_VALUE)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 460, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n\n getContentPane().add(jPanel1, \"0\");\n\n jPanel2.setBackground(new java.awt.Color(153, 204, 0));\n jPanel2.setForeground(new java.awt.Color(0, 204, 102));\n\n jLabel2.setFont(new java.awt.Font(\"Lucida Grande\", 1, 36)); // NOI18N\n jLabel2.setForeground(new java.awt.Color(0, 153, 153));\n jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel2.setText(\"Complains Approved\");\n\n cTable1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));\n cTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Complaint ID\", \"Complaint Type\", \"Complainer ID\", \"Complainer Name\", \"Status\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class\n };\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n cTable1.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseReleased(java.awt.event.MouseEvent evt) {\n cTable1MouseReleased(evt);\n }\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n cTable1MouseClicked(evt);\n }\n });\n jScrollPane2.setViewportView(cTable1);\n if (cTable1.getColumnModel().getColumnCount() > 0) {\n cTable1.getColumnModel().getColumn(0).setMinWidth(30);\n cTable1.getColumnModel().getColumn(0).setPreferredWidth(30);\n }\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 735, Short.MAX_VALUE))\n .addContainerGap())\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 7, Short.MAX_VALUE)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 460, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(72, 72, 72))\n );\n\n getContentPane().add(jPanel2, \"1\");\n\n jPanel3.setBackground(new java.awt.Color(255, 153, 102));\n\n jLabel3.setFont(new java.awt.Font(\"Lucida Grande\", 1, 36)); // NOI18N\n jLabel3.setForeground(new java.awt.Color(102, 102, 0));\n jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel3.setText(\"Complains Ignored\");\n\n cTable2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));\n cTable2.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Complaint ID\", \"Complaint Type\", \"Complainer ID\", \"Complainer Name\", \"Status\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class\n };\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n cTable2.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseReleased(java.awt.event.MouseEvent evt) {\n cTable2MouseReleased(evt);\n }\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n cTable2MouseClicked(evt);\n }\n });\n jScrollPane3.setViewportView(cTable2);\n if (cTable2.getColumnModel().getColumnCount() > 0) {\n cTable2.getColumnModel().getColumn(0).setMinWidth(30);\n cTable2.getColumnModel().getColumn(0).setPreferredWidth(30);\n }\n\n javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);\n jPanel3.setLayout(jPanel3Layout);\n jPanel3Layout.setHorizontalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 735, Short.MAX_VALUE))\n .addContainerGap())\n );\n jPanel3Layout.setVerticalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 7, Short.MAX_VALUE)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 460, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(72, 72, 72))\n );\n\n getContentPane().add(jPanel3, \"2\");\n\n jMenu1.setText(\"Complains\");\n\n jMenuItem1.setText(\"Submitted Complains\");\n jMenuItem1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItem1ActionPerformed(evt);\n }\n });\n jMenu1.add(jMenuItem1);\n\n jMenuItem2.setText(\"Approved Complains\");\n jMenuItem2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItem2ActionPerformed(evt);\n }\n });\n jMenu1.add(jMenuItem2);\n\n jMenuItem3.setText(\"Ignored Complains\");\n jMenuItem3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItem3ActionPerformed(evt);\n }\n });\n jMenu1.add(jMenuItem3);\n\n jMenuBar1.add(jMenu1);\n\n jMenu2.setText(\"Setting\");\n\n jMenuItem4.setText(\"Logout\");\n jMenuItem4.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItem4ActionPerformed(evt);\n }\n });\n jMenu2.add(jMenuItem4);\n\n jMenuItem5.setText(\"About\");\n jMenuItem5.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItem5ActionPerformed(evt);\n }\n });\n jMenu2.add(jMenuItem5);\n\n jMenuBar1.add(jMenu2);\n\n setJMenuBar(jMenuBar1);\n\n pack();\n }", "public void atualizarTabelaRespostas(){\n resposta = new Resposta(); \n\n try{\n if(txtIdPergunta.getText().isEmpty()){\n listaRespostas = respostaDao.ListaResposta(0);\n \n }else{\n listaRespostas = respostaDao.ListaResposta(Integer.parseInt(txtIdPergunta.getText()));\n \n }\n }catch (SQLException ex){\n Logger.getLogger(PerguntaView.class.getName()).log(Level.SEVERE, null, ex);\n } \nString dados [][] = new String[listaRespostas.size()][0];\nint i = 0;\nfor(Resposta resposta : listaRespostas){\n dados[i][0] = String.valueOf(resposta.getId());\n dados[i][1] = resposta.getDescricao();\n \n i++;\n}\nString tituloColuna[] ={\"ID Resposta\", \"Resposta\"};\nDefaultTableModel tabelaresposta = new DefaultTableModel();\ntabelaresposta.setDataVector(dados, tituloColuna);\n \n\n tabela_respostas.setModel(new DefaultTableModel(dados, tituloColuna){\n boolean[] canEdit = new boolean[]{\n false, false};\n \n public boolean isCellEditable(int rowIndex, int columnIndex){\n return canEdit[columnIndex];\n }\n \n\n });\ntabela_respostas.getColumnModel().getColumn(0).setPreferredWidth(100);\ntabela_respostas.getColumnModel().getColumn(1).setPreferredWidth(400);\n\nDefaultTableCellRenderer alinhamentoCentro = new DefaultTableCellRenderer();\nalinhamentoCentro.setHorizontalAlignment(SwingConstants.CENTER);\n\n\ntabela_respostas.getColumnModel().getColumn(0).setCellRenderer(alinhamentoCentro);\n\n\ntabela_respostas.setRowHeight(25);\ntabela_respostas.updateUI();\n }", "private static void popuniTabelu() {\r\n\t\tDefaultTableModel dfm = (DefaultTableModel) teretanaGui.getTable().getModel();\r\n\r\n\t\tdfm.setRowCount(0);\r\n\r\n\t\tfor (int i = 0; i < listaClanova.size(); i++) {\r\n\t\t\tClan c = listaClanova.getClan(i);\r\n\t\t\tdfm.addRow(new Object[] { c.getBrojClanskeKarte(), c.getIme(), c.getPrezime(), c.getPol() });\r\n\t\t}\r\n\t\tcentrirajTabelu();\r\n\t}", "public InformationResultPanel(GenericResult result) {\n this();\n fieldsNotToDisplay.add(\"id\");\n fieldsNotToDisplay.add(\"the_geom\");\n this.tblResult.removeAll();\n DefaultTableModel tableModel = new DefaultTableModel();\n List<Integer> indexListToShow = new ArrayList<Integer>();\n\n //Add columns\n for (Integer fieldInd = 0; fieldInd < result.getFieldNames().size(); fieldInd++) {\n String fieldName = result.getFieldNames().get(fieldInd);\n if (fieldsNotToDisplay.contains(fieldName)) {\n continue;\n }\n tableModel.addColumn(fieldName);\n indexListToShow.add(fieldInd);\n }\n\n //Add values\n for (Object row : result.getValues()) {\n StringArray rowAsArray = (StringArray) row;\n String[] rowToAdd = new String[indexListToShow.size()];\n for (Integer fieldIndIndex = 0; \n fieldIndIndex < indexListToShow.size(); fieldIndIndex++) {\n rowToAdd[fieldIndIndex] = \n rowAsArray.getItem().get(indexListToShow.get(fieldIndIndex));\n }\n tableModel.addRow(rowToAdd);\n }\n this.tblResult.setModel(tableModel);\n }", "public JTable getJrTbl2() {\n\t\tForMngJrArticleModel fmngJr = new ForMngJrArticleModel();\n\t\tDefaultTableModel defModel = new DefaultTableModel(0,8);\n\t\tJTable jTblForJr = new JTable(defModel);\n\t\tfor(int i =0; i<getJrArtArrayList().size();i++) {\n\t\t\tfmngJr = getJrArtArrayList().get(i);\n\t\t\t//condition to check if there is availability of articles that the logged in researcher has not hired\n\t\t\tif(!fmngJr.getNmOfRe().contains(loggedReseId) && !fmngJr.getNoOfJr().contentEquals(\"0\")) {\n\t\t\t\tObject[] objData = {fmngJr.getArNmOfJr(), fmngJr.getAuthNmOfJr(),fmngJr.getNmOfJr(), fmngJr.getYrOfJr(), fmngJr.getVolOfJr(),fmngJr.getIssOfJr(),fmngJr.getPgOfJr(),fmngJr.getNoOfJr()};\n\t\t\t\tdefModel.addRow(objData);\n\t\t\t}\n\t\t}\n\n\t\tString reColTitles[] = {\"Name of Article\", \"Author/s\",\"Journal Title\", \"<html>Publication<br>Year</html>\",\"Volume No.\",\"Issue No.\",\"Page No.\",\"<html>No. of Articles<br>Available</html>\"};\n\t\tdefModel.setColumnIdentifiers(reColTitles);\n\t\tjTblForJr.setRowHeight(28);\n\n\t\tJTableHeader tblHeader = jTblForJr.getTableHeader();\n\t\ttblHeader.setPreferredSize(new Dimension(100,35));\n\t\ttblHeader.setBackground(new Color(21, 34, 49));\n\t\ttblHeader.setForeground(Color.WHITE);\n\n\t\treturn jTblForJr;\n\t}", "private void addTable()\r\n {\r\n // Create the table\r\n table = new JTable();\r\n table.setAutoCreateRowSorter(true);\r\n table.setColumnSelectionAllowed(false);\r\n table.getTableHeader().setReorderingAllowed(false);\r\n table.setModel(new JarModel());\r\n \r\n // Center the column headings\r\n ((DefaultTableCellRenderer) table.getTableHeader().\r\n getDefaultRenderer()).setHorizontalAlignment(SwingConstants.CENTER);\r\n \r\n // Set the column widths\r\n table.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);\r\n table.getColumnModel().getColumn(0).setPreferredWidth(100);\r\n table.getColumnModel().getColumn(0).setMaxWidth(250);\r\n table.getColumnModel().getColumn(2).setPreferredWidth(140);\r\n table.getColumnModel().getColumn(2).setMaxWidth(250);\r\n table.getColumnModel().getColumn(3).setPreferredWidth(100);\r\n table.getColumnModel().getColumn(3).setMaxWidth(250);\r\n table.getColumnModel().getColumn(4).setPreferredWidth(100);\r\n table.getColumnModel().getColumn(4).setMaxWidth(250);\r\n \r\n // Sort on the first column\r\n table.getRowSorter().toggleSortOrder(0);\r\n \r\n table.getColumnModel().getColumn(0).setCellRenderer(new BooleanColorCellRenderer());\r\n table.getColumnModel().getColumn(2).setCellRenderer(new DateCellRenderer());\r\n \r\n // Add the table to the panel\r\n add(new JScrollPane(table), BorderLayout.CENTER);\r\n }", "private void popuniTabelu() {\n try {\n List<PutnikEntity> putnici=Controller.vratiSvePutnike();\n TableModel tm=new PutnikTableModel(putnici);\n jtblPutnici.setModel(tm);\n } catch (Exception ex) {\n Logger.getLogger(FIzaberiLet.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n tableModel.addRow(new Object[] { idf.getText(), lnamef.getText(), fnamef.getText(), vtypef.getText(),\n vdatef.getText(), vlocationf.getText() });\n idf.setText(\"\");\n lnamef.setText(\"\");\n fnamef.setText(\"\");\n vtypef.setText(\"\");\n vdatef.setText(\"\");\n vlocationf.setText(\"\");\n\n p.remove(layout.getLayoutComponent(BorderLayout.CENTER));\n p.add(sp, BorderLayout.CENTER);\n p.repaint();\n p.revalidate();\n }", "public void addTable(String columns[], String data[][]) {\n\t\tDefaultTableModel model = new DefaultTableModel(data, columns);\n\t\tmodel.setColumnCount(2);\n\t\tmodel.setNumRows(10);\n\t\tcontainer.add(new JTable(model));\n\t\trefreshView();\n\t}", "private void mostrarTabla(double[][] tabla) {\n DefaultTableModel model = (DefaultTableModel) jTable1.getModel();\n for (int i = 0; i < tabla.length; i++) {\n model.addRow(new Object[]{\n tabla[i][0],\n tabla[i][1],\n tabla[i][2],\n tabla[i][3],\n tabla[i][4],\n tabla[i][5],\n tabla[i][6],\n tabla[i][7],\n tabla[i][8],\n tabla[i][9],\n tabla[i][10],\n tabla[i][11],\n tabla[i][12]\n });\n }\n }", "private void initTable(DefaultTableModel dmodel) {\n\t\tString[] COLUMN_NAMES = new String[] { \"#\", \"Date\", \"Product ID\", \"Name\", \"Quantity\", \"Total\" };\n\t\tfor (String string : COLUMN_NAMES)\n\t\t\tdmodel.addColumn(string);\n\t}", "private void addGeneSetInfo(DefaultMutableTreeNode root) {\n Object[][] results = new Object[this.resultMatrix.A.length][this.resultMatrix.A[0].length+1];\r\n for (int i=0; i<results.length; i++){\r\n \tfor (int j=1; j<results[0].length; j++){\r\n \t\tresults[i][j]= resultMatrix.A[i][j-1];\r\n \t}\r\n }\r\n\r\n for (int i=0; i<results.length; i++){\r\n \tresults[i][0] = geneListNames[i];\r\n }\r\n String[] columns = {\"Gene List\",\"Gene Count\", \"F-value\", \"p-value (permutation)\", \"p-value (approximate)\"};\r\n \r\n IViewer tabViewer = new GLOBALANCResultTable(results,columns);\r\n \troot.add(new DefaultMutableTreeNode(new LeafInfo(\"Results Table\", tabViewer, new Integer(0))));\r\n\t\t\r\n\t}", "private void buildTable() {\n rowData = new Object[4];\n infoTable = new JTable();\n tableModel = new DefaultTableModel();\n tableModel.setColumnIdentifiers(columnNames);\n infoTable.setModel(tableModel);\n String line;\n \n try {\n FileInputStream fin = new FileInputStream(\"ContactInfo.txt\");\n BufferedReader br = new BufferedReader(new InputStreamReader(fin)); \n \n while((line = br.readLine()) != null)\n {\n rowData[0] = line;\n for(int i = 1; i < 4; i++) {\n rowData[i] = br.readLine();\n }\n tableModel.addRow(rowData);\n } \n br.close();\n }\n catch (FileNotFoundException e) {\n JOptionPane.showMessageDialog(null, e.getMessage());\n }\n catch (IOException e) {\n JOptionPane.showMessageDialog(null, e.getMessage());\n }\n }", "public IndexFrame() {\n initComponents();\n \n /*\n * Definition d'un nouveau modele pour la jTable\n */\n \n \n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n \n },\n new String [] {\n \"Lemme \", \"Document n° \", \" TF \",\n }){\n boolean[] canEdit = new boolean [] {\n false, false\n };\n \n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n \n DefaultTableModel model = (DefaultTableModel) jTable1.getModel();\n \n \n try{\n FileInputStream fis=new FileInputStream(\"C:/ressources/indexOptim.ser\");\n ObjectInputStream ois= new ObjectInputStream(fis);\n \n HashMap temp=new HashMap();\n \n HashMap h=new HashMap();\n h=(HashMap)ois.readObject();\n for (Object k : h.keySet())\n {\n temp=(HashMap)h.get(k);\n for (Object k2 : temp.keySet())\n {\n model.insertRow(0, new Object [] {(String) k,(Integer )k2,(Integer)temp.get(k2) });\n }\n }\n \n \n }\n catch(Exception e )\n {e.printStackTrace();\n }\n \n }", "private void buildTable() {\n\t\tObservableList<Record> data;\r\n\t\tdata = FXCollections.observableArrayList();\r\n\r\n\t\t// get records from the database\r\n\t\tArrayList<Record> list = new ArrayList<Record>();\r\n\t\tlist = getItemsToAdd();\r\n\r\n\t\t// add records to the table\r\n\t\tfor (Record i : list) {\r\n\t\t\tSystem.out.println(\"Add row: \" + i);\r\n\t\t\tdata.add(i);\r\n\t\t}\r\n\t\ttableView.setItems(data);\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 jPanel1 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n btClose = new javax.swing.JButton();\n jScrollPane2 = new javax.swing.JScrollPane();\n ListLivre = new javax.swing.JTable();\n txtTitre = new javax.swing.JTextField();\n txtAuteur = new javax.swing.JTextField();\n btAdd = new javax.swing.JButton();\n jLabel3 = new javax.swing.JLabel();\n txtIdLivre = new javax.swing.JTextField();\n BtEdit = new javax.swing.JButton();\n Btsupp = new javax.swing.JButton();\n\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(jTable1);\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(\"Ajouter Livre\"));\n\n jLabel1.setText(\"Titre\");\n jLabel1.setToolTipText(\"\");\n\n jLabel2.setText(\"Auteur\");\n\n btClose.setText(\"Annuler\");\n btClose.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btCloseActionPerformed(evt);\n }\n });\n\n ListLivre.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null},\n {null, null, null},\n {null, null, null},\n {null, null, null}\n },\n new String [] {\n \"idLivre\", \"Nom Livre\", \"Auteur\"\n }\n ));\n jScrollPane2.setViewportView(ListLivre);\n\n btAdd.setText(\"Ajouter \");\n btAdd.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btAddActionPerformed(evt);\n }\n });\n\n jLabel3.setText(\"id Livre\");\n\n BtEdit.setText(\"Modifier\");\n BtEdit.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n BtEditActionPerformed(evt);\n }\n });\n\n Btsupp.setText(\"Supprimer\");\n Btsupp.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n BtsuppActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(jLabel2))\n .addGap(34, 34, 34)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txtTitre)\n .addComponent(txtAuteur)))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(btClose)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btAdd))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel3)\n .addGap(33, 33, 33)\n .addComponent(txtIdLivre)))\n .addContainerGap())\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addGap(21, 21, 21)\n .addComponent(BtEdit, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 126, Short.MAX_VALUE)\n .addComponent(Btsupp, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(25, 25, 25))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(txtIdLivre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(13, 13, 13)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(txtTitre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(txtAuteur, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btClose)\n .addComponent(btAdd))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(19, 19, 19)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(BtEdit)\n .addComponent(Btsupp))\n .addContainerGap(33, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n\n pack();\n }", "@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 TbData = new javax.swing.JTable();\n jLabel1 = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n TbData.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\", \"Title 5\"\n }\n ));\n jScrollPane1.setViewportView(TbData);\n\n jLabel1.setText(\"Datos\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)\n .addContainerGap())\n .addGroup(layout.createSequentialGroup()\n .addGap(174, 174, 174)\n .addComponent(jLabel1)\n .addContainerGap(193, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(16, Short.MAX_VALUE)\n .addComponent(jLabel1)\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n\n pack();\n }", "private void mostrar() {\n //DefaultTableModel m = new DefaultTableModel();\n m = new DefaultTableModel(){\n @Override\n public boolean isCellEditable(int row, int column) {\n if (column==6) {\n return true;\n }else{\n return false;\n }\n }\n \n };\n tr = new TableRowSorter(m);\n m.setColumnCount(0);\n m.addColumn(\"Id\");\n m.addColumn(\"Nombre\");\n m.addColumn(\"Apellido\");\n m.addColumn(\"Direccion\");\n m.addColumn(\"Correo\");\n m.addColumn(\"Clave\");\n for (ClienteVO cvo : cdao.consultarTabla()) {\n m.addRow(new Object[]{cvo.getId_cliente(),cvo.getNombre_cliente(),cvo.getApellido_cliente(),cvo.getDireccion_cliente(),cvo.getCorreo_cliente(),cvo.getClave_cliente()});\n }\n vista.tblClientes.setModel(m);\n vista.tblClientes.setRowSorter(tr);\n }", "private void criaJTable() {\n tabela = new JTable(modelo);\n modelo.addColumn(\"Codigo:\");\n modelo.addColumn(\"Data inicio:\");\n modelo.addColumn(\"Data Fim:\");\n modelo.addColumn(\"Valor produto:\");\n modelo.addColumn(\"Quantidade:\");\n\n preencherJTable();\n }", "public donorList() {\n initComponents();\n try {\n Class.forName(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\");\n Connection connection = DriverManager.getConnection( \"jdbc:sqlserver://localhost:1433;user=sa;password=123456;\" +\n \"databaseName=BloodBankMS;\");\n \n \n Statement statement = connection.createStatement(); \n \n ResultSet rs = statement.executeQuery(\"SELECT DonorID , DonorName ,DonorGender ,DonorAddress ,DonorBloodGroup , DonorArea , DonorPhoneNumber, DonorAge, DonorWeight from DONOR\"); \n ResultSetMetaData rsmetadata = rs.getMetaData(); \n int columns = rsmetadata.getColumnCount(); \n DefaultTableModel dtm = new DefaultTableModel(); \n Vector columns_name=new Vector();\n Vector data_rows=new Vector();\n for(int i= 1; i < columns+1; i++) \n { \n columns_name.addElement (rsmetadata.getColumnLabel(i)); \n } \n \n dtm.setColumnIdentifiers(columns_name);\n while (rs.next()) \n { \n data_rows = new Vector(); \n for (int j = 1; j <columns+1; j++) \n { \n data_rows.addElement(rs.getString(j)) ;\n } \n dtm.addRow(data_rows); \n \n } \n donorTable.setModel(dtm); \n \n } catch (Exception e) { \n e.printStackTrace(); \n }\n }", "private JComponent createInfoTable() {\r\n\t\tm_model = new JETATableModel();\r\n\r\n\t\tString[] names = new String[2];\r\n\t\tnames[0] = I18N.getLocalizedMessage(\"Property\");\r\n\t\tnames[1] = I18N.getLocalizedMessage(\"Value\");\r\n\t\tm_model.setColumnNames(names);\r\n\r\n\t\tClass[] coltypes = new Class[2];\r\n\t\tcoltypes[0] = String.class;\r\n\t\tcoltypes[1] = String.class;\r\n\t\tm_model.setColumnTypes(coltypes);\r\n\r\n\t\treturn new javax.swing.JScrollPane(TableUtils.createBasicTablePanel(m_model, true));\r\n\t}", "public void popular(){\n DAO dao = new DAO();\n modelo.setNumRows(0);\n\n for(Manuais m: dao.selecTudoManuaisVenda()){\n modelo.addRow(new Object[]{m.getId(),m.getNome(),m.getClasse(),m.getEditora(),m.getPreco()+\".00 MZN\"});\n \n }\n }", "public void populateTable() {\n DefaultTableModel dtm = (DefaultTableModel)tblSalesPersonCommision.getModel();\n dtm.setRowCount(0);\n // for(OrderList orderlist:salesperson.getOrderlistcatalog().getSalesPersonOrder()){\n // for(Order order:salesperson.getOrderListSalesPerson().getOrderList()){ \n // for(OrderList orderlist:salesperson.getOrderlistcatalog().getOrCatalog()){\n // for(SalesPerson salesperson :business.getEmployeedirectory().getSalesPersonList()){\n \n for(OrderList orderlist:salesperson.getOrderlistcatalog().getOrCatalog()){\n Object [] row = new Object[4];\n // row[0]=.getCustomer().getCustomerId();\n // row[1]= market.getCustomer().getCustomerName();\n row[0]=orderlist;\n row[1]=orderlist.getOrdertotalprice();\n row[2]=orderlist.getSalespersoncomission();\n row[3]=orderlist.getTotalorderlistquantity();\n //3 tcomission = tcomission + orderlist.getSalespersoncomission();\n //3 totalquantity = totalquantity + orderlist.getTotalorderlistquantity();\n //3 totalorderprice = totalorderprice + orderlist.getOrdertotalprice();\n \n // row[0]=order;\n // row[1]=order.getAmountprice();\n \n dtm.addRow(row);\n // }\n // }\n } \n //2 salesperson.getOrderlistcatalog().setTotalquantitypersalesperson(totalquantity);\n //2 salesperson.getOrderlistcatalog().setTotalcommision(tcomission);\n //2 salesperson.getOrderlistcatalog().setTotalorderlistcsatalogprice(totalorderprice);\n}", "private void initTable(){\n TableCellEditor nonSelEditor = new TableCellEditor() {\n @Override\n public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {\n return null;\n }\n @Override\n public Object getCellEditorValue() {return null; }\n\n @Override\n public boolean isCellEditable(EventObject anEvent) {return false;}\n\n @Override\n public boolean shouldSelectCell(EventObject anEvent) {return false;}\n\n @Override\n public boolean stopCellEditing() {return false;}\n\n @Override\n public void cancelCellEditing() {/*NOP*/}\n\n @Override\n public void addCellEditorListener(CellEditorListener l) {/*NOP*/}\n\n @Override\n public void removeCellEditorListener(CellEditorListener l) {/*NOP*/}\n };\n\n tableModelArrays = new DefaultTableModel();\n\n String[] columns = {\"N\", \"Data type\", \"Length\", \"State\",\"Kit\"};\n for(String s : columns){\n tableModelArrays.addColumn(s);\n }\n\n /*\n * Add information about have generated structures to the table model\n */\n if(dataList != null){\n for(int i = 0; i<dataList.getLength(); i++){\n tableModelArrays.addRow(new String[]{\n Integer.toString(i + 1),\n dataList.getData(i).getType(),\n Integer.toString(dataList.getData(i).getLength(0)),\n dataList.getData(i).getState()\n });\n }\n }\n\n /*\n * Create table from table model\n */\n final JTable tableArrays = new JTable(tableModelArrays);\n\n /*\n * Runs popup menu for edition notices which contain in table.\n */\n tableArrays.addMouseListener(new PopupMenu(popupMenu){\n @Override\n public void maybeShowPopup(MouseEvent e) {\n if (e.isPopupTrigger()) {\n popupMenu.show(e.getComponent(),\n e.getX(), e.getY());\n if (e.getButton() == MouseEvent.BUTTON3) {\n Point point = e.getPoint();\n int column = tableArrays.columnAtPoint(point);\n int row = tableArrays.rowAtPoint(point);\n tableArrays.setColumnSelectionInterval(column, column);\n tableArrays.setRowSelectionInterval(row, row);\n selectedRow = tableArrays.getSelectedRow();\n }\n }\n }\n });\n\n tableArrays.setRowHeight(20);\n tableArrays.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n\n /*\n * Changes width all the columns in the table\n */\n tableArrays.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);\n tableArrays.getColumnModel().getColumn(0).setPreferredWidth(23);\n tableArrays.getColumnModel().getColumn(1).setPreferredWidth(67);\n tableArrays.getColumnModel().getColumn(2).setPreferredWidth(70);\n tableArrays.getColumnModel().getColumn(3).setPreferredWidth(65);\n tableArrays.getColumnModel().getColumn(4).setPreferredWidth(27);\n\n /*\n * Each notice sets as manually no editable\n */\n for (int i = 0; i<tableArrays.getColumnCount(); i++ ){\n tableArrays.getColumnModel().getColumn(i).setCellEditor(nonSelEditor);\n }\n\n /*\n * Add scroll controls to table\n */\n JScrollPane scrollTable = new JScrollPane(tableArrays);\n scrollTable.setSize(TABLE_WIDTH,getHeight()-FIELD_HEIGHT-150);\n scrollTable.setLocation(getWidth()-scrollTable.getWidth()-15, FIELD_HEIGHT+60);\n\n /*\n * Add table to frame\n */\n add(scrollTable);\n\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n tableAlbums = new javax.swing.JTable();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n jLabel1.setText(\"OrpheusStore\");\n\n tableAlbums.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Album\", \"Artist\", \"Tanggal Rilis\", \"Harga\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class\n };\n boolean[] canEdit = new boolean [] {\n false, false, false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n tableAlbums.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n tableAlbumsMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(tableAlbums);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 472, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel1))\n .addContainerGap(23, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 379, Short.MAX_VALUE))\n );\n\n pack();\n }", "public Complementos() {\n initComponents();\n String cabecera []={\"Producto\",\"Precio\"};\nString datos[][]={};\nboolean t=true;\nboolean f=false;\nmodelo = new Tablachida(datos,cabecera);\ntabla.setModel(modelo);\nTableColumnModel columnModel = tabla.getColumnModel();\ncolumnModel.getColumn(0).setPreferredWidth(250);\ntabla.setRowHeight(40);\n\n }" ]
[ "0.67286724", "0.66751325", "0.663905", "0.6631858", "0.65546274", "0.6503003", "0.64864695", "0.6480156", "0.63959736", "0.6393253", "0.63898665", "0.63831013", "0.63529426", "0.6292415", "0.6279764", "0.6224238", "0.62162125", "0.62138015", "0.61820596", "0.61731386", "0.61457765", "0.614248", "0.6142219", "0.61393917", "0.61203396", "0.61196095", "0.6102118", "0.609502", "0.60773605", "0.60765356", "0.6057845", "0.605527", "0.6052153", "0.6051923", "0.6047228", "0.6038532", "0.6032694", "0.6028697", "0.60267586", "0.60220563", "0.6014312", "0.6014162", "0.6002057", "0.5985092", "0.5977614", "0.5975208", "0.59746945", "0.5969556", "0.5962966", "0.5952838", "0.5947571", "0.59429574", "0.59396553", "0.5938534", "0.5936032", "0.5932365", "0.5927613", "0.59262574", "0.5917779", "0.5916551", "0.59097606", "0.59067", "0.5903264", "0.5896921", "0.58968943", "0.5892554", "0.5888202", "0.5879979", "0.5876328", "0.58698565", "0.5867753", "0.58672804", "0.5863146", "0.58605164", "0.5859355", "0.5854297", "0.5851963", "0.58474517", "0.58435", "0.58340776", "0.5832361", "0.58297753", "0.58270526", "0.5825902", "0.5825312", "0.58249736", "0.5824192", "0.582173", "0.58212173", "0.5818998", "0.58179903", "0.58151275", "0.581235", "0.5811302", "0.58053184", "0.5803755", "0.58029026", "0.5801127", "0.5798163", "0.57949406", "0.57933056" ]
0.0
-1
End of variables declaration//GENEND:variables Display the .txt file in JTable
public void addFile() { try { //JFileChooser jf=new JFileChooser(); //jf.showOpenDialog(null); // String fp=jf.getSelectedFile().getAbsolutePath(); File file2=new File("trial.txt"); BufferedReader br=new BufferedReader(new FileReader (file2)); Object[] tableLines=br.lines().toArray(); for (Object tableLine : tableLines) { String line = tableLine.toString().trim(); String[] dataRow=line.split(","); jtModel.addRow(dataRow); jtModel.setValueAt(Integer.valueOf(dataRow[2]), jtModel.getRowCount()-1, 2); } br.close(); } catch(Exception ex) { JOptionPane.showMessageDialog(rootPane,"Nothing was selected"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void buildTable() {\n rowData = new Object[4];\n infoTable = new JTable();\n tableModel = new DefaultTableModel();\n tableModel.setColumnIdentifiers(columnNames);\n infoTable.setModel(tableModel);\n String line;\n \n try {\n FileInputStream fin = new FileInputStream(\"ContactInfo.txt\");\n BufferedReader br = new BufferedReader(new InputStreamReader(fin)); \n \n while((line = br.readLine()) != null)\n {\n rowData[0] = line;\n for(int i = 1; i < 4; i++) {\n rowData[i] = br.readLine();\n }\n tableModel.addRow(rowData);\n } \n br.close();\n }\n catch (FileNotFoundException e) {\n JOptionPane.showMessageDialog(null, e.getMessage());\n }\n catch (IOException e) {\n JOptionPane.showMessageDialog(null, e.getMessage());\n }\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n int returnVal = fc.showOpenDialog(panel);\n if(returnVal == JFileChooser.APPROVE_OPTION){\n file = fc.getSelectedFile();\n System.out.println(file);\n \n try {\n Scanner scanner = new Scanner(file);\n String appendString = \"\";\n \n while(scanner.hasNext()){\n String oneString = scanner.nextLine();\n txtArea.append(oneString + \"\\n\");\n }\n \n try {\n read_characters(file.toString());\n } catch (IOException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n \n resultArea.append(resultString);\n resultPane.setText(resultString);\n } catch (FileNotFoundException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n \n //Print ID table\n Map<String,Integer> map = new TreeMap<String,Integer>(userDefinedWords);\n identifierTableArea.append(\"Number of Occurences \" + \"\\t\" +\n \t\t\t\t\t\t\t\"Symbol\" + \"\\n\\n\");\n Iterator iter = \n \t\tmap.entrySet().iterator();\n while(iter.hasNext()){\n \t Map.Entry pair = \n \t\t\t (Map.Entry)iter.next();\n \t identifierTableArea.append(\n \t\t\t pair.getValue() + \"\\t\\t\" + pair.getKey() + \"\\n\");\n }\n \n }\n }", "public void showTableData()\n{\n model = new DefaultTableModel();\nString[] columnNames = {\"Sr No.\",\"File Name\",\"Size\",\"Date\"};\n\n\nmodel.setColumnIdentifiers(columnNames);\n//JTable table = new JTable();\n\n//JScrollPane scroll = new JScrollPane();\n//listfiles.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);\n//listfiles.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);\n//table.setBounds(10, 10, 800, 300);\nString name= \"\";\nString date = \"\";\nlong size = 0;\nint i=0;\ntry\n{ \n Connection Con= ConnectDB.connect();\n Statement st=Con.createStatement();String filen=\"\";\n ResultSet ty=st.executeQuery(\"SELECT * from servers where Sr_no='\"+1+\"'\");\n if(ty.next())\n {\n filen=ty.getString(\"server_path\");\n filen=filen+UserID+\"/\";\n }\n System.out.println(\"ggg \"+filen);\n sftp.connect(ty.getString(\"server_ip\"),ty.getInt(\"server_port\") , ty.getString(\"server_user\"), ty.getString(\"server_pass\"));\n \n \n \n Vector<LsEntry> list = sftp.listFile(filen);\n int j; \nfor (LsEntry item : list)\n{\n j=i+1;\nname = item.getFilename();\nsize = item.getAttrs().getSize();\ndouble size1 = (double)size/1024;\ndate = item.getAttrs().getAtimeString();\nmodel.addRow(new Object[]{j,name,size1,date});\nSystem.out.println(\"- \" +name);\ni++; \n}\nif(i <1)\n{\nJOptionPane.showMessageDialog(null, \"No Record Found\",\"Error\",JOptionPane.ERROR_MESSAGE);\n}\nif(i ==1)\n{\nSystem.out.println(i+\" Record Found\");\n}\nelse\n{\nSystem.out.println(i+\" Records Found\");\n}\n}\ncatch(Exception ex)\n{\n JOptionPane.showMessageDialog(rootPane, \"Error: \"+ex);\n//JOptionPane.showMessageDialog(, ex.getMessage(),\"Error\",JOptionPane.ERROR_MESSAGE);\n}\n\n\n//listfiles.getViewport().add(table);\n//listfiles.add(scroll,BorderLayout.CENTER);\n\n}", "public void Open(){\n\tJFileChooser j = new JFileChooser(\"\"); \n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"txt\", \"TXT\");\n j.setFileFilter(filter); \n\n\t// Invoke the showsOpenDialog function to show the save dialog \n int r = j.showOpenDialog(null); \n\n\t// If the user selects a file \n\tif (r == JFileChooser.APPROVE_OPTION) { \n // Set the label to the path of the selected directory \n File fi = new File(j.getSelectedFile().getAbsolutePath()); \n\n try { \n\t\t// String \n\t\tString s1 = \"\", sl = \"\"; \n\n\t\t// File reader \n\t\tFileReader fr = new FileReader(fi); \n\n\t\t// Buffered reader \n\t\tBufferedReader br = new BufferedReader(fr); \n\n\t\t// Initilize sl \n\t\tsl = br.readLine(); \n\n\t\t// Take the input from the file \n\t\twhile ((s1 = br.readLine()) != null) { \n \t\tsl = sl + \"\\n\" + s1; \n\t\t} \n\n\t\t// Set the text \n\t\tt.setText(sl); \n } \n catch (Exception evt) { \n\t\tJOptionPane.showMessageDialog(f, evt.getMessage()); \n } \n\t} \n\t// If the user cancelled the operation \n\telse\n JOptionPane.showMessageDialog(f, \"the user cancelled the operation\"); \n\t\t\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jPanel2 = new javax.swing.JPanel();\n jLabel3 = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n Table = new javax.swing.JTable();\n remove = new javax.swing.JLabel();\n add = new javax.swing.JLabel();\n EncryptStatus = new javax.swing.JLabel();\n jSeparator1 = new javax.swing.JSeparator();\n jLabel4 = new javax.swing.JLabel();\n IconLogo = new javax.swing.JLabel();\n FileName = new javax.swing.JLabel();\n type = new javax.swing.JLabel();\n Type = new javax.swing.JLabel();\n Size = new javax.swing.JLabel();\n sizee = new javax.swing.JLabel();\n adon = new javax.swing.JLabel();\n DateTime = new javax.swing.JLabel();\n EncryptButton = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"My Files\");\n addWindowListener(new java.awt.event.WindowAdapter() {\n public void windowClosing(java.awt.event.WindowEvent evt) {\n formWindowClosing(evt);\n }\n });\n getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n jPanel1.setBackground(new java.awt.Color(255, 255, 255));\n\n jPanel2.setBackground(new java.awt.Color(255, 255, 255));\n jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n jLabel3.setFont(new java.awt.Font(\"Segoe UI\", 0, 36)); // NOI18N\n jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/icons/folder.png\"))); // NOI18N\n jLabel3.setText(\" MY FILES\");\n jPanel2.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(239, 14, -1, -1));\n\n Table.setAutoCreateRowSorter(true);\n Table.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"FileName\", \"Path\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.String.class, java.lang.String.class\n };\n boolean[] canEdit = new boolean [] {\n false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n Table.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);\n Table.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n Table.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n TableMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(Table);\n if (Table.getColumnModel().getColumnCount() > 0) {\n Table.getColumnModel().getColumn(0).setResizable(false);\n Table.getColumnModel().getColumn(0).setPreferredWidth(250);\n Table.getColumnModel().getColumn(1).setResizable(false);\n Table.getColumnModel().getColumn(1).setPreferredWidth(439);\n }\n\n jPanel2.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 89, 700, 228));\n\n remove.setFont(new java.awt.Font(\"Times New Roman\", 0, 12)); // NOI18N\n remove.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/icons/file-removexs.png\"))); // NOI18N\n remove.setText(\"REMOVE FILE\");\n remove.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n removeMouseClicked(evt);\n }\n });\n jPanel2.add(remove, new org.netbeans.lib.awtextra.AbsoluteConstraints(128, 325, 125, -1));\n\n add.setFont(new java.awt.Font(\"Times New Roman\", 0, 12)); // NOI18N\n add.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/icons/filexs.png\"))); // NOI18N\n add.setText(\"Add File\");\n add.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n addMouseClicked(evt);\n }\n });\n jPanel2.add(add, new org.netbeans.lib.awtextra.AbsoluteConstraints(19, 325, 102, -1));\n\n EncryptStatus.setFont(new java.awt.Font(\"Segoe UI\", 0, 14)); // NOI18N\n EncryptStatus.setForeground(new java.awt.Color(153, 0, 0));\n EncryptStatus.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n EncryptStatus.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/icons/fileicons/file-lock.png\"))); // NOI18N\n EncryptStatus.setText(\" ENCRYPTED\");\n jPanel2.add(EncryptStatus, new org.netbeans.lib.awtextra.AbsoluteConstraints(581, 323, -1, -1));\n\n jSeparator1.setForeground(new java.awt.Color(153, 153, 153));\n jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);\n\n jLabel4.setFont(new java.awt.Font(\"Segoe UI\", 0, 24)); // NOI18N\n jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/icons/customer-service.png\"))); // NOI18N\n jLabel4.setText(\" FILE INFO\");\n\n IconLogo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n IconLogo.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/icons/bluetooth.png\"))); // NOI18N\n\n FileName.setFont(new java.awt.Font(\"Segoe UI\", 1, 12)); // NOI18N\n FileName.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n FileName.setText(\"_________SELECT A FILE FROM LIST___________\");\n\n type.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n type.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n type.setText(\"TYPE :\");\n\n Type.setFont(new java.awt.Font(\"Segoe UI\", 1, 12)); // NOI18N\n Type.setText(\"-----------\");\n\n Size.setFont(new java.awt.Font(\"Segoe UI\", 1, 12)); // NOI18N\n Size.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);\n Size.setText(\"-----------\");\n\n sizee.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n sizee.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n sizee.setText(\"SIZE :\");\n\n adon.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n adon.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n adon.setText(\"ADDED ON :\");\n\n DateTime.setFont(new java.awt.Font(\"Segoe UI\", 1, 12)); // NOI18N\n DateTime.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);\n DateTime.setText(\"XX.XX.XXXX XX:XX XX\");\n\n EncryptButton.setFont(new java.awt.Font(\"Segoe UI\", 0, 14)); // NOI18N\n EncryptButton.setForeground(new java.awt.Color(153, 0, 0));\n EncryptButton.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);\n EncryptButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/icons/fileicons/file-lock.png\"))); // NOI18N\n EncryptButton.setText(\"DECRYPT FILE \");\n EncryptButton.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n EncryptButtonMouseClicked(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(65, 65, 65)\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(69, 69, 69)\n .addComponent(IconLogo))\n .addComponent(FileName, javax.swing.GroupLayout.PREFERRED_SIZE, 262, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(76, 76, 76)\n .addComponent(type, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(10, 10, 10)\n .addComponent(Type, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(61, 61, 61)\n .addComponent(sizee, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(10, 10, 10)\n .addComponent(Size, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(46, 46, 46)\n .addComponent(adon)\n .addGap(10, 10, 10)\n .addComponent(DateTime))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(64, 64, 64)\n .addComponent(EncryptButton, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)))))\n .addContainerGap(31, Short.MAX_VALUE))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jSeparator1)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(22, 22, 22)\n .addComponent(jLabel4)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(IconLogo)\n .addGap(11, 11, 11)\n .addComponent(FileName)\n .addGap(11, 11, 11)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(1, 1, 1)\n .addComponent(type))\n .addComponent(Type))\n .addGap(11, 11, 11)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(1, 1, 1)\n .addComponent(sizee))\n .addComponent(Size))\n .addGap(11, 11, 11)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(1, 1, 1)\n .addComponent(adon))\n .addComponent(DateTime))\n .addGap(18, 18, 18)\n .addComponent(EncryptButton)\n .addContainerGap(17, Short.MAX_VALUE))\n );\n\n getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1030, 370));\n\n pack();\n }", "public FileViewer()\n {\n // initialise instance variables\n super(\"File Viewer 1.0\");\n setSize(300,400);\n getContentPane().add(txtIsiFile);\n try{\n txtIsiFile.setText(fl1.bacaFile(\"data.txt\"));\n }catch(Exception e){e.printStackTrace();}\n setVisible(true);\n }", "private void displayContents(String file)throws CoeusException, MalformedURLException{\r\n int selectedRow = subAwardBudget.tblSubAwardBudget.getSelectedRow();\r\n if(selectedRow == -1) {\r\n CoeusOptionPane.showInfoDialog(\"Select a Row\");\r\n return ;\r\n }\r\n BudgetSubAwardBean budgetSubAwardBean= (BudgetSubAwardBean)this.data.get(selectedRow);\r\n if(file.equals(BudgetSubAwardConstants.PDF) && budgetSubAwardBean.getPdfAcType() != null) {\r\n //PDF Updated. open file from local filesystem\r\n File fileObj = new File(budgetSubAwardBean.getPdfFileName());\r\n URL url = fileObj.toURL();\r\n URLOpener.openUrl(url);\r\n }else {\r\n displayContents(file, budgetSubAwardBean);\r\n }\r\n }", "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 openFile() {\n\t\t\n\t\n\t\t\t\n\t\tFile file = jfc.getSelectedFile();\n\t\tint a = -1;\n\t\tif(file==null&&!jta.getText().equals(\"\"))\n\t\t{\n\t\t\ta = JOptionPane.showConfirmDialog(this, \"저장?\");\n\t\t\n\t\t}\n\t\tswitch (a){\n\t\tcase 0:\n\t\t\ttry {\n\t\t\t\tint c = -1;\n\t\t\t\tif(file==null)\n\t\t\t\t{\n\t\t\t\t\tc = jfc.showSaveDialog(this);\n\t\t\t\t}\n\t\t\t\tif(file!= null || c ==0)\n\t\t\t\t{\t\n\t\t\t\t\tFileWriter fw = new FileWriter(jfc.getSelectedFile());\n\t\t\t\t\tfw.write(jta.getText());\n\t\t\t\t\tfw.close();\n\t\t\t\t\tSystem.out.println(\"파일을 저장하였습니다\");\n\t\t\t\t}\n\t\t\t} catch (Exception e2) {\n\t\t\t\t// TODO: handle exception\n\t\t\t\tSystem.out.println(e2.getMessage());\n\t\t\t}\n\t\tbreak;\n\t\tcase 1:\n\t\t\ttry {\n\t\t\t\tint j=-1;\n\t\t\t\tif(file==null)\n\t\t\t\t{\n\t\t\t\t\tj = jfc.showOpenDialog(this);\n\t\t\t\t}\n\t\t\t\tif(file!= null || j == 1)\n\t\t\t\t{\t\n\t\t\t\t\tFileReader fr = new FileReader(file);\n\n\t\t\t\t\tString str=\"\";\n\t\t\t\t\twhile((j=fr.read())!=-1)\n\t\t\t\t\t{\n\t\t\t\t\t\tstr = str+(char)j;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tjta.setText(str);\n\t\t\t\t\t\n\t\t\t\t\tsetTitle(file.getName());\n\t\t\t\t\t\n\t\t\t\t\tfr.close();\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tcatch (Exception e2) {\n\t\t\t\t// TODO: handle exception\n\t\t\t\tSystem.out.println(e2.getMessage());\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tint d= jfc.showOpenDialog(this);\n\t\t\n\t\tif(d==0)\n\t\t\ttry {\n\t\t\t\tFileReader fr = new FileReader(jfc.getSelectedFile());\n\t\t\t\tint l;\n\t\t\t\tString str=\"\";\n\t\t\t\twhile((l=fr.read())!=-1)\n\t\t\t\t{\n\t\t\t\t\tstr = str+(char)l;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tjta.setText(str);\n\t\t\t\t\n\t\t\t\tfr.close();\n\t\n\t\t\t\t\t\n\t\t\t} catch (Exception e2) {\n\t\t\t\t// TODO: handle exception\n\t\t\t\tSystem.out.println(e2.getMessage());\n\t\t\t}\n\t}", "public void actionPerformed(ActionEvent ae) {\n\t\t\t\t\tThread runner = new Thread() {\n //private OpenFile opf;\n private OutputToFile otf;\n\n\t\t\t\t\t\t\tpublic void run() {\n \n otf = new OutputToFile();\n if(!otf.takeFilePath().trim().contentEquals(\"\")){\n System.out.println(\" Show File Path : \"+otf.takeFilePath()+\" >>>>\");\n centerPanel.setBorder(BorderFactory.createTitledBorder(\"Wrong Data :\"+otf.takeFilePath()));\n textArea.setText(\"\");\n datainFile=new File(otf.takeFilePath());\n \n\n try {\n fis = new FileInputStream(datainFile);\n reader = new BufferedReader(new InputStreamReader(fis));\n //StringBuilder out = new StringBuilder();\n String line;\n while ((line = reader.readLine()) != null) {\n //out.append(line);\n \n //textArea.setText(line+System.getProperty( \"line.separator\"));\n textArea.append(line+System.getProperty( \"line.separator\"));\n \n }\n //System.out.println(out.toString()); //Prints the string content read from input stream\n reader.close();\n \n \n\n \n \n \n } catch (FileNotFoundException ex) {\n Logger.getLogger(MakeTable.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IOException ex) {\n Logger.getLogger(MakeTable.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n \n \n }else \n {\n JOptionPane.showMessageDialog(null, \"Əvvəlcədən [XML] uzantılı fayıl emal edilməlidir\", \"Xəbərdarlıq\", JOptionPane.WARNING_MESSAGE);\n }\nSystem.out.println(\" Button clicked\");\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\trunner.start();\n\t\t\t\t\t\n\t\t\t\t\t//JOptionPane.showMessageDialog(null, \"Please, complete the information\", \"Warning\", JOptionPane.WARNING_MESSAGE);\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t\tint re = jfc.showOpenDialog(f);\n\t\t\t\tfile = jfc.getSelectedFile();\n\t\t\t\tif (re == 0) {\n\t\t\t\t\ttry {\n\n\t\t\t\t\t\tFileReader fr = new FileReader(file);\n\t\t\t\t\t\tint ch;\n\t\t\t\t\t\tString str = \"\";\n\n\t\t\t\t\t\twhile ((ch = fr.read()) != -1) {\n\t\t\t\t\t\t\tstr += (char) ch;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tta.setText(str);\n\t\t\t\t\t\tfr.close();\n\t\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t\tSystem.out.println(ex.getMessage());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "@Override\n\tpublic void print(String text) {\n\t\tString[] headLine = SQLPull.getHeadline().split(\"\\t\");\n\t\t\n\t\t//split the data\n\t\tString[] rows = text.split(\"\\n\");\n\t\tString[][] data = new String[rows.length][headLine.length];\n\t\tfor (int i=0; i<rows.length; i++)\n\t\t\tdata[i] = rows[i].split(\"\\t\");\n\t\t\n\t\t//insert to table\t\t\n\t\ttable = new JTable(data, headLine);\n\t\tjsp = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);\n\t\tadd(jsp, BorderLayout.CENTER);\n\t\t\n\t\t//setSize\n\t\tsetSize(800, 83+17*data.length);\n\t\t\n\t\tsetVisible(true);\n\t}", "public void openFile() {\n\t\tJFileChooser choose = new JFileChooser();\n\t\t if(choose.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {\n\t\t\t\ttry {\n\t\t\t\t\tFile selectedFile = choose.getSelectedFile();\n\t\t\t\t\tdir=choose.getCurrentDirectory().toString();\n\t\t\t\t\tScanner readFile = new Scanner(selectedFile);\n\t\t\t\t\tif(!frame.textArea.getText().isEmpty()) {\n\t\t\t\t\t\tframe.textArea.setText(\"\");\n\t\t\t\t\t}\n\t\t\t\t\twhile(readFile.hasNext()) {\n\t\t\t\t\t\tString currentLine = readFile.nextLine();\n\t\t\t\t\t\tframe.textArea.append(currentLine+\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t\tframe.setTitle(selectedFile.getName()+\"-Text Editor\");\n\t\t\t\t\tframe.originalText=frame.textArea.getText();\n\t\t\t\t\treadFile.close();\n\t\t\t\t} catch (FileNotFoundException ex) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"File Not Found\");\n\t\t\t\t}\n\n\t\t }\n\t}", "public void showSelectedFiles() {\n\t\tCIVLTable tbl_fileTable = (CIVLTable) getComponentByName(\"tbl_fileTable\");\n\t\tDefaultTableModel fileModel = (DefaultTableModel) tbl_fileTable\n\t\t\t\t.getModel();\n\t\tif (fileModel.getRowCount() != 0) {\n\t\t\tfileModel.setRowCount(0);\n\t\t\ttbl_fileTable.clearSelection();\n\t\t}\n\n\t\tArrayList<File> files = currConfig.getSelectedFiles();\n\t\tfor (int i = 0; i < files.size(); i++) {\n\t\t\tFile f = files.get(i);\n\t\t\tfileModel\n\t\t\t\t\t.addRow(new Object[] { f.getName(), f.getPath(), \"Delete\" });\n\t\t}\n\t}", "private void createGoogleDriveFilesTable(){\n cellTableOfGoogleDriveFile.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);\n\n // Add a text columns to show the details.\n TextColumn<GoogleDriveFile> columnFirstLine = new TextColumn<GoogleDriveFile>() {\n @Override\n public String getValue(GoogleDriveFile object) {\n return object.getId();\n }\n };\n cellTableOfGoogleDriveFile.addColumn(columnFirstLine, \"ID\");\n\n TextColumn<GoogleDriveFile> columnSecondLine = new TextColumn<GoogleDriveFile>() {\n @Override\n public String getValue(GoogleDriveFile object) {\n return object.getName();\n }\n };\n cellTableOfGoogleDriveFile.addColumn(columnSecondLine, \"Name\");\n\n TextColumn<GoogleDriveFile> townColumn = new TextColumn<GoogleDriveFile>() {\n @Override\n public String getValue(GoogleDriveFile object) {\n return object.getKind();\n }\n };\n cellTableOfGoogleDriveFile.addColumn(townColumn, \"Kind\");\n\n TextColumn<GoogleDriveFile> countryColumn = new TextColumn<GoogleDriveFile>() {\n @Override\n public String getValue(GoogleDriveFile object) {\n return object.getMimeType();\n }\n };\n cellTableOfGoogleDriveFile.addColumn(countryColumn, \"MimeType\");\n\n final SingleSelectionModel<GoogleDriveFile> selectionModel = new SingleSelectionModel<>();\n cellTableOfGoogleDriveFile.setSelectionModel(selectionModel);\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n fileopen = new javax.swing.JFileChooser();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n rowcnt = new javax.swing.JTextField();\n colcnt = new javax.swing.JTextField();\n Create = new javax.swing.JButton();\n Count = new javax.swing.JButton();\n Fromfile = new javax.swing.JButton();\n\n fileopen.setCurrentDirectory(new java.io.File(\"/home/andrey/Программирование/task3_java\"));\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Backtracking\");\n setResizable(false);\n\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n\n }\n ));\n jTable1.setCellSelectionEnabled(true);\n jTable1.addComponentListener(new java.awt.event.ComponentAdapter() {\n public void componentResized(java.awt.event.ComponentEvent evt) {\n jTable1ComponentResized(evt);\n }\n });\n jScrollPane1.setViewportView(jTable1);\n\n jLabel1.setText(\"Кол-во строк\");\n\n jLabel2.setText(\"Кол-во столбцов\");\n\n Create.setText(\"Создать таблицу\");\n Create.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n CreateActionPerformed(evt);\n }\n });\n\n Count.setText(\"Посчитать\");\n Count.setEnabled(false);\n Count.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n CountActionPerformed(evt);\n }\n });\n\n Fromfile.setText(\"Из файла\");\n Fromfile.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n FromfileActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(jScrollPane1)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addGap(3, 3, 3)\n .addComponent(rowcnt, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(3, 3, 3)\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(colcnt, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(Create)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(Fromfile)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(Count)))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(jLabel2)\n .addComponent(rowcnt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(colcnt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(Create)\n .addComponent(Count)\n .addComponent(Fromfile))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 670, Short.MAX_VALUE))\n );\n\n pack();\n }", "public ifrm_historial() {\n initComponents();\n this.setTitle(\"Historial bitacoraCalculadora.txt\");\n File archivo;\n try{\n final BufferedReader lector = new BufferedReader(new FileReader(\"bitacoraCalculadora.txt\"));\n String line = \"\";\n while ((line = lector.readLine()) != null){\n //txt_mostrar.setText(line);\n txt_mostrar.append(line +\"\\n\");\n }lector.close();\n }catch(FileNotFoundException e){\n e.printStackTrace();\n } catch(IOException e){\n e.printStackTrace();\n }\n }", "public void displayText(String filename) {\r\n\t\tSystem.out.println(\"UNIMPLEMENTED: display text from file \" + filename);\r\n\t\t// TODO implement text display\r\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n mainPanel = new javax.swing.JPanel();\n jScrollPane1 = new javax.swing.JScrollPane();\n mainTable = new javax.swing.JTable();\n jMenuBar1 = new javax.swing.JMenuBar();\n menuFile = new javax.swing.JMenu();\n menuItemOpen = new javax.swing.JMenuItem();\n menuItemExit = new javax.swing.JMenuItem();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n mainTable.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n\n }\n ));\n jScrollPane1.setViewportView(mainTable);\n\n javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);\n mainPanel.setLayout(mainPanelLayout);\n mainPanelLayout.setHorizontalGroup(\n mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 544, Short.MAX_VALUE)\n .addContainerGap())\n );\n mainPanelLayout.setVerticalGroup(\n mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 334, Short.MAX_VALUE)\n .addContainerGap())\n );\n\n menuFile.setText(\"File\");\n\n menuItemOpen.setText(\"Open\");\n menuItemOpen.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n menuItemOpenActionPerformed(evt);\n }\n });\n menuFile.add(menuItemOpen);\n\n menuItemExit.setText(\"Exit\");\n menuItemExit.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n menuItemExitActionPerformed(evt);\n }\n });\n menuFile.add(menuItemExit);\n\n jMenuBar1.add(menuFile);\n\n setJMenuBar(jMenuBar1);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(mainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(mainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addContainerGap())\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jFileChooser1 = new javax.swing.JFileChooser();\n jPanel1 = new javax.swing.JPanel();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n btn_baru = new javax.swing.JButton();\n btn_ubah = new javax.swing.JButton();\n btn_hapus = new javax.swing.JButton();\n jPanel2 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n btn_upload = new javax.swing.JButton();\n jPanel3 = new javax.swing.JPanel();\n btn_kembali = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n addWindowListener(new java.awt.event.WindowAdapter() {\n public void windowOpened(java.awt.event.WindowEvent evt) {\n formWindowOpened(evt);\n }\n });\n\n jPanel1.setBackground(new java.awt.Color(0, 51, 51));\n\n jTable1.setBackground(new java.awt.Color(204, 255, 204));\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jTable1.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jTable1MouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(jTable1);\n\n btn_baru.setFont(new java.awt.Font(\"Agency FB\", 1, 18)); // NOI18N\n btn_baru.setText(\"Baru\");\n btn_baru.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_baruActionPerformed(evt);\n }\n });\n\n btn_ubah.setFont(new java.awt.Font(\"Agency FB\", 1, 18)); // NOI18N\n btn_ubah.setText(\"Ubah\");\n btn_ubah.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_ubahActionPerformed(evt);\n }\n });\n\n btn_hapus.setFont(new java.awt.Font(\"Agency FB\", 1, 18)); // NOI18N\n btn_hapus.setText(\"Hapus\");\n btn_hapus.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_hapusActionPerformed(evt);\n }\n });\n\n jPanel2.setBackground(new java.awt.Color(255, 255, 204));\n\n jLabel1.setFont(new java.awt.Font(\"Agency FB\", 1, 36)); // NOI18N\n jLabel1.setForeground(new java.awt.Color(51, 153, 255));\n jLabel1.setText(\"Daftar Penduduk\");\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 332, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1)\n .addContainerGap(22, Short.MAX_VALUE))\n );\n\n btn_upload.setFont(new java.awt.Font(\"Agency FB\", 1, 18)); // NOI18N\n btn_upload.setText(\"Upload\");\n btn_upload.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_uploadActionPerformed(evt);\n }\n });\n\n jPanel3.setBackground(new java.awt.Color(255, 255, 204));\n jPanel3.setPreferredSize(new java.awt.Dimension(160, 52));\n\n btn_kembali.setBackground(new java.awt.Color(0, 0, 0));\n btn_kembali.setFont(new java.awt.Font(\"Agency FB\", 1, 18)); // NOI18N\n btn_kembali.setForeground(new java.awt.Color(51, 153, 255));\n btn_kembali.setText(\"Kembali\");\n btn_kembali.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_kembaliActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);\n jPanel3.setLayout(jPanel3Layout);\n jPanel3Layout.setHorizontalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(btn_kembali, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n jPanel3Layout.setVerticalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(btn_kembali)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(btn_baru, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(btn_ubah, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(btn_hapus, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(btn_upload, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 681, Short.MAX_VALUE))\n .addContainerGap())\n .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, 701, Short.MAX_VALUE)\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 395, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btn_baru)\n .addComponent(btn_ubah)\n .addComponent(btn_hapus)\n .addComponent(btn_upload))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n\n pack();\n }", "private void readFile(){\n\t\tQuestionlistModel = new DefaultListModel();\n\t\tJFileChooser fc=new JFileChooser();\n\t\tfc.setDialogTitle(\"Choose file\");\n\t\t\n\t\tint returnVal=fc.showOpenDialog(new JFrame());\n\t\tif (returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t File file = fc.getSelectedFile();\t\t\n\t\t\ttry {\n\t\t\n \tBufferedReader br = new BufferedReader(new FileReader(file));\n String strLine;\n //Read File Line By Line\n while ((strLine = br.readLine()) != null) {\n \t//Skipping blank lines\n \tif(strLine.length()>0){\n \t\t//Skipping buffered lines\n\t \tif(strLine.charAt(0) != '#'){\n\t if(strLine.equals(\"CTS\")){\n\t \tint i = 0;\n\t \tint j = (int) this.countLines(\"CTS\", \"CTE\",file);\n\t \tConditionTree = new String[j][6];\n\t \t//filling conditions tree\n\t \twhile(!(strLine = br.readLine()).equals(\"CTE\")){\n\t \t\t\n\t \t\ttry{\n\t\t \t\tString Cond[] = strLine.split(\",\");\n\t\t \t\tConditionTree[i][0] = Cond[0].trim(); \n\t\t \t\tConditionTree[i][1] = Cond[1].trim(); \n\t\t \t\tConditionTree[i][2] = Cond[2].trim(); \n\t\t \t\tConditionTree[i][3] = Cond[3].trim(); \n\t\t \t\tConditionTree[i][4] = Cond[4].trim(); \n\t\t \t\tConditionTree[i][5] = Cond[5].trim(); \n\n\t\t \t\ti++;\n\t \t\t}catch(NullPointerException ex){\n\t \t \tSystem.out.println(\"Error at line: \"+ i);//donothing\n\t \t } \n\t \t}\n\t }else if(strLine.equals(\"QTS\")){\n\t \tint i = 0;\n\t \tint j = (int) this.countLines(\"QTS\", \"QTE\",file);\n\t \tQuestionsTree = new String[j][2];\n\t \t//filling Questions tree \n\t \twhile(!(strLine = br.readLine()).equals(\"QTE\")){\n\t \t\t\n\t \t\ttry{\n\t\t \t\tString Qes[] = strLine.split(\",\");\n\t\t \t\tQuestionsTree[i][0] = Qes[0].trim(); \n\t\t \t\tQuestionsTree[i][1] = Qes[1].trim(); \n\n\t\t \t\ti++;\n\t \t\t}catch(NullPointerException ex){\n\t \t \t//donothing\n\t \t } \n\t \t}\n\t \t\n\t \t\n\t }\n\t \n\t \t}\n \t}\n }\n\t\tQuestionList.setModel(QuestionlistModel);\n }catch(java.lang.StringIndexOutOfBoundsException ex){\n \tSystem.out.println(\"String index out of bond.\");\n }\n\tcatch (Exception e) {\n\t\te.printStackTrace();\n }\n\t}\n\t\n}", "public void display_names()\n {\n //delare variables to hold file types\n BufferedReader br = null;\n \n \n //try to open the file for reading\n try\n {\n br = new BufferedReader(new FileReader(filename)); \n \n }\n catch(IOException ioe)\n {\n System.out.println(\"display_names: Exception opening the file\");\n }\n /*\n try to read each record and display the field values.\n a) display all the lastName, firstName paired fields in the file; \n display with the format lastName, firstName\n count each record that is read \n */\n int counter = 0; //record counter\n try\n {\n //read the first record\n String line = br.readLine();\n //while the record is not null, display the record, count the record\n while(line != null)\n {\n System.out.print(\"\\n\" + line);\n counter += 1;\n line = br.readLine();\n }\n System.out.println(\"\\n\\nTotal records read: \" + counter);\n \n \n \n }\n catch(IOException ioe)\n {\n System.out.println(\"display_names: Exception reading the file\");\n }\n \n //try to close the file\n try\n {\n br.close(); \n \n }\n catch(IOException ioe)\n {\n System.out.println(\"display_names: Exception closing the file\");\n }\n //dislay a count of the records read\n \n }", "@Override\n public void importFromFile(SpreadsheetTable focusOwner, UIController uiController) {\n\n List<List<String>> listString = null;\n try {\n listString = readFile();\n } catch (FileNotFoundException ex) {\n Logger.getLogger(ImportExportTextLinkStrategy.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n if (listString.isEmpty()) {\n return;\n }\n\n int initrow = focusOwner.getSelectedRow();\n int initCol = focusOwner.getSelectedColumn();\n int start = 0;\n if (this.header) {\n start++;\n }\n \n this.selectedCells = new Cell[listString.size()][listString.get(0).size()];\n \n for (int i = start; i < listString.size(); i++, initrow++) {\n for (int j = 0; j < listString.get(i).size(); j++, initCol++) {\n try {\n uiController.getActiveSpreadsheet().getCell(initCol, initrow).setContent(listString.get(i).get(j));\n \n this.selectedCells[i][j] = uiController.getActiveSpreadsheet().getCell(initCol, initrow);\n \n } catch (FormulaCompilationException ex) {\n Logger.getLogger(ImportExportTextLinkStrategy.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }\n initCol = focusOwner.getSelectedColumn();\n }\n }", "public void openFile() {\n\t\tfc.setCurrentDirectory(new File(System.getProperty(\"user.dir\")));\n\t\tint returnVal = fc.showOpenDialog(null);\n\t\tif (returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\tFile file = fc.getSelectedFile();\n\t filename.setText(file.getName());\n\t try {\n\t\t\t\tmodel.FileContent(file);\t//read the content of the input file\n\t\t\t\tplotContent.repaint();\t//repaint the JComponent\n\t\t\t\t\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void showData()\n\t\t{\n\t\t\ttry {\n\t\t\t\tcon=DriverManager.getConnection(\"jdbc:mysql://localhost:3306/MundheElectronics1\",\"root\",\"vishakha\");\n\t\t\t\tString sql=\"select *from ComplaintsData\";\n\t\t\t\tps=con.prepareStatement(sql);\n\t\t\t\trs=ps.executeQuery();\n\t\t\t\ttable.setModel(DbUtils.resultSetToTableModel(rs));\n\t\t\t\t\n\t\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}", "public void gettableconteudo(){\n \n int selecionada = jtablearquivos.getSelectedRow();\n if (selecionada == -1) {\n JOptionPane.showMessageDialog(null,\" Arquivo não selecionado corretamente !\");\n } \n String id = jtablearquivos.getValueAt(selecionada, 0).toString();\n id1 = id;\n String titulo = jtablearquivos.getValueAt(selecionada, 1).toString();\n titulo1 = titulo;\n \n \n \n }", "public TextStarTable( DataSource datsrc ) throws IOException {\n \n /* Get the input stream. */\n InputStream stream = datsrc.getInputStream();\n \n /* Configure from the data source. */\n setName( datsrc.getName() );\n setURL( datsrc.getURL() );\n \n /* Get a List of Lists of Strings for the table data. */\n readStringCells( stream );\n \n /* Turn it into a List of Lists of typed objects. */\n Class[] types = typifyCells();\n \n /* Turn it into a List of arrays of Objects. */\n for ( int i = 0; i < rows.size(); i++ ) {\n rows.set( i, ((List) rows.get( i )).toArray() );\n }\n \n /* Set up a default set of column info objects. */\n colinfos = new ColumnInfo[ ncol ];\n for ( int i = 0; i < ncol; i++ ) {\n colinfos[ i ] = \n new ColumnInfo( \"col\" + ( i + 1 ), types[ i ], null );\n }\n \n /* Try to make sense of any comment lines. */\n interpretComments();\n }", "@Override\r\n\t\tpublic void actionPerformed(ActionEvent event)\r\n\t\t{\n\t\t\tString filePath = filePathField.getText();\r\n\t\t\tif(filePath.isBlank())\r\n\t\t\t{\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Input cannot be blank. Please enter a valid file path.\",\r\n\t\t\t\t\t\t\"Invalid Input\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Create file from given filePath and read through it using Scanner.\r\n\t\t\t\tFile file = new File(filePath);\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tString fileText = \"\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Read contents of file and create string containing all lines of text.\r\n\t\t\t\t\tScanner scan = new Scanner(file);\r\n\t\t\t\t\twhile (scan.hasNextLine())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tString line = scan.nextLine() + \"\\n\";\r\n\t\t\t\t\t\tfileText += line;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tscan.close();\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Set the text of the text area to the string we just created.\r\n\t\t\t\t\tfilePreviewTextArea.setText(fileText);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Set the cursor/caret position to the top to fix annoying bug where scroll bar is at bottom\r\n\t\t\t\t\tfilePreviewTextArea.setCaretPosition(0);\r\n\t\t\t\t}\r\n\t\t\t\tcatch(FileNotFoundException e)\r\n\t\t\t\t{\r\n\t\t\t\t\tfilePreviewTextArea.setText(\"Could not open file: \" + file.getPath());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n dataSetLocation = new javax.swing.JTextField();\n fileButton = new javax.swing.JButton();\n jScrollPane1 = new javax.swing.JScrollPane();\n dataTable = new javax.swing.JTable();\n jPanel2 = new javax.swing.JPanel();\n jScrollPane2 = new javax.swing.JScrollPane();\n principalComponentsTable = new javax.swing.JTable();\n jScrollPane3 = new javax.swing.JScrollPane();\n dataInPCATable = new javax.swing.JTable();\n\n jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(\"Data Set\"));\n\n jLabel1.setText(\"File :\");\n\n dataSetLocation.setText(\"jTextField1\");\n dataSetLocation.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n dataSetLocationActionPerformed(evt);\n }\n });\n\n fileButton.setText(\"File\");\n fileButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n fileButtonActionPerformed(evt);\n }\n });\n\n dataTable.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null, null, null, null},\n {null, null, null, null, null, null, null},\n {null, null, null, null, null, null, null},\n {null, null, null, null, null, null, null}\n },\n new String [] {\n \"Date\", \"Open\", \"High\", \"Low\", \"Close\", \"Volume\", \"Adj Close\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false, false, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n dataTable.setEnabled(false);\n jScrollPane1.setViewportView(dataTable);\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 677, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(dataSetLocation)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(fileButton)))\n .addGap(6, 6, 6))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(dataSetLocation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(fileButton))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 152, Short.MAX_VALUE))\n );\n\n jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(\"Principal Component Analysis\"));\n\n principalComponentsTable.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null},\n {null, null, null},\n {null, null, null},\n {null, null, null}\n },\n new String [] {\n \"Eige.\", \"Con.r\", \"C-con.r\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n principalComponentsTable.setEnabled(false);\n jScrollPane2.setViewportView(principalComponentsTable);\n\n dataInPCATable.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n dataInPCATable.setEnabled(false);\n jScrollPane3.setViewportView(dataInPCATable);\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 351, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 227, Short.MAX_VALUE)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n }", "void exporter(JTable tab, File file) {\n try {\r\n\r\n TableModel model = tab.getModel();\r\n FileWriter out = new FileWriter(file);\r\n for (int i = 0; i < model.getColumnCount(); i++) {\r\n out.write(model.getColumnName(i) + \"\\t\");\r\n }\r\n out.write(\"\\n\");\r\n\r\n for (int i = 0; i < model.getRowCount(); i++) {\r\n for (int j = 0; j < model.getColumnCount(); j++) {\r\n out.write(model.getValueAt(i, j).toString() + \"\\t\");\r\n }\r\n out.write(\"\\n\");\r\n }\r\n\r\n out.close();\r\n } catch (Exception err) {\r\n err.printStackTrace();\r\n }\r\n }", "public void actionPerformed(ActionEvent e)\n {\n\t\t\n\n\t\t\n\t\ttry {\n\t\t\tgetclandata.loadClanData();\n\t\t\tFile file = new File(control.text2.getText()+\"\\\\\" + control.text1.getText() +tankTable.giveName(tank_id)+\".txt\");\n\t\t\tif (file.exists())\n\t\t\t{\n\t\t\t\treadPlayerData(file,tank_id);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\twritePlayerData();\n\t\t\t}\n\t\t\tString[] colums ={\"Name\",\"Damage/Battles\",\"Battles\"};\n\t\t\tObject[][] data = new Object[100][3];\n\t\t\tfor (int i=0;i<100;i++)\n\t\t\t{\n\t\t\t\tdata[i][0] = stats[i].getAccount_name();\n\t\t\t\tdata[i][1] = stats[i].getDamage_dealt();\n\t\t\t\tdata[i][2] = stats[i].getBattles();\n\t\t\t}\n\t\t\tDefaultTableModel model;\n\t\t\tmodel = new DefaultTableModel(data,colums);\n\t\t\t//control.table = new JTable(data,colums);\n\t control.table.setModel(model);\n\t\t\t\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t} catch (IOException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\t\n }", "public void actionPerformed(ActionEvent e) { \t\r\n \tif (EDIT.equals(e.getActionCommand())) {\r\n //The user has clicked the cell, so\r\n //bring up the dialog.\r\n \t\tfileChooser.setVisible(true);\r\n \t\t//abre la ventana de archivos\r\n \t\tfileChooser.showOpenDialog(null);\r\n \t\t\r\n int iFinTrim = fileChooser.getSelectedFile().getAbsolutePath().lastIndexOf(\"resources\\\\\"); \r\n String ruta = fileChooser.getSelectedFile().getAbsolutePath().substring(iFinTrim+10,fileChooser.getSelectedFile().getAbsolutePath().length());\r\n \t jtextfield.setText(ruta);\r\n \t jtextfield.setBackground(currentColor); \r\n //Make the renderer reappear.\r\n fireEditingStopped();\r\n }\r\n }", "private void updateDataPreview(File file) throws IOException {\n\n\t\t\tfileLabel.setText(\"\");\n\t\t\tString fileName = file.getName();\n\n\t\t\tStringBuilder contents = new StringBuilder();\n\t\t\tBufferedReader reader = null;\n\n\t\t\ttry {\n\t\t\t\treader = new BufferedReader(new InputStreamReader(\n\t\t\t\t\t\tnew FileInputStream(file), Charsets.getUtf8()));\n\t\t\t\tString text;\n\t\t\t\tint lineCount = 0;\n\t\t\t\t// read at most 20 lines\n\t\t\t\twhile ((text = reader.readLine()) != null && lineCount < 20) {\n\t\t\t\t\tcontents.append(text)\n\t\t\t\t\t\t\t.append(System.getProperty(\"line.separator\"));\n\t\t\t\t\tlineCount++;\n\t\t\t\t}\n\n\t\t\t\tStringBuilder fileInfo = new StringBuilder();\n\n\t\t\t\tif (fileName.length() > 20) {\n\t\t\t\t\tfileInfo.append(fileName.substring(0, 20));\n\t\t\t\t\tfileInfo.append(\"..\");\n\t\t\t\t} else {\n\t\t\t\t\tfileInfo.append(fileName);\n\t\t\t\t}\n\n\t\t\t\tfileLabel.setText(fileInfo.toString());\n\n\t\t\t\tif (contents.length() == 0) {\n\t\t\t\t\tcontents.append(app.getLocalization()\n\t\t\t\t\t\t\t.getMenu(\"PreviewUnavailable\"));\n\t\t\t\t}\n\n\t\t\t\tdataPreviewPanel.setText(contents.toString());\n\t\t\t\tdataPreviewPanel.setCaretPosition(0);\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (reader != null) {\n\t\t\t\t\t\treader.close();\n\t\t\t\t\t}\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\n\t\t}", "public adduser() {\n initComponents();\n this.setTitle(\"Borrow Book\");\n \n try{\n f=new Functions();\n }\n catch(java.io.IOException e){\n JOptionPane.showMessageDialog(this,\"Some text file is missing!\");\n }\n \n \n// TableColumnModel l=jTable1.getColumnModel();\n// l.getColumn(0).setPreferredWidth(1);\n// l.getColumn(1).setPreferredWidth(60);\n// l.getColumn(2).setPreferredWidth(64);\n// l.getColumn(4).setPreferredWidth(70);\n \n }", "public void loadFile(File file) {\n\t\ttry {\n\t\t\tBufferedReader in = new BufferedReader(new FileReader(file));\n\t\t\t\n\t\t\t// read the column names\n\t\t\tList<String> first = stringToList(in.readLine());\n\t\t\tcolNames = first;\n\t\t\t\n\t\t\t// each line makes a row in the data model\n\t\t\tString line;\n\t\t\tdata = new ArrayList<List>();\n\t\t\twhile ((line = in.readLine()) != null) {\n\t\t\t\tdata.add(stringToList(line));\n\t\t\t}\n\t\t\t\n\t\t\tin.close();\n\t\t\t\n\t\t\t// Send notifications that the whole table is now different\n\t\t\tfireTableStructureChanged();\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void projectPropertiesDisplay()\n\t{\n\t\ttree.setModel(null);\n\t\tredoProjectProperties();\n\t\tFileTree model = new FileTree(currentProject.toString()); //Create a new FileTree using the Selected File\n tree.setModel(model); //Set the model as the FileTree class model\n /***************************************************************************************\n * Title: FileSelectorModel \n * Author: S�bastien Le Callonnec\n * Date: September 18, 2019\n * Code version: version 1.0\n * Availability: https://www.weblogism.com/item/300/use-jtree-to-display-files-in-filesystem-ii\n * Modified slightly by the team to work with our project\n ***************************************************************************************/\n JLabel status = new JLabel(currentProject.toString());\n tree.addTreeSelectionListener(new TreeSelectionListener() \n {\n public void valueChanged(TreeSelectionEvent e) \n {\n folderNameGetter selectedNode = (folderNameGetter) tree.getLastSelectedPathComponent();\n if(selectedNode != null)\n {\n \tstatus.setText(selectedNode.getAbsolutePath());\n if (selectedNode.isFile()) \n {\n try \n {\n \tcurrentFile.setLength(0);\n \tcurrentFile.append(selectedNode);\n \tresetFileTitle();\n BufferedReader br = new BufferedReader(new FileReader(selectedNode.getAbsolutePath()));\n String line = \"\";\n String l = \"\";\n while ((line = br.readLine()) != null) \n {\n \tl += line + \"\\n\" ;\n }\n displayText(l);\n br.close();\n } \n catch (Exception exc) \n {\n exc.printStackTrace();\n }\n }\n }\n }\n });\n//*********************************************************************************************************************************************************************************************************************************\n spectralFilesScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); //Show scroll bars when necessary\n projectProperties.add(spectralFilesScrollPane); //Add to projectProperties JPanel\n redoProjectProperties();\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 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 static boolean showTable(String tableName){\n try{\n File table = new File(tableName+\"Data.csv\");\n Scanner tableReader = new Scanner(table);\n while (tableReader.hasNextLine()){\n System.out.println(tableReader.nextLine());\n }\n tableReader.close();\n return true;\n }catch(IOException e){\n e.printStackTrace();\n return false;\n }\n }", "public static void open() {\n JFileChooser fileChooser;\n String fileContent;\n String path = FileLoader.loadFile(\"path.txt\");\n if (path != null) {\n fileChooser = new JFileChooser(path);\n } else {\n fileChooser = new JFileChooser((FileSystemView.getFileSystemView().getHomeDirectory()));\n }\n\n fileChooser.setDialogTitle(\"Select text file\");\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"Text files\",\"mytxt\");\n fileChooser.addChoosableFileFilter(filter);\n fileChooser.setAcceptAllFileFilterUsed(true);\n\n if (fileChooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {\n path = fileChooser.getSelectedFile().getParent();\n FileLoader.saveFile(\"path.txt\", path, false);\n fileContent = FileLoader.loadFile(fileChooser.getSelectedFile().getAbsolutePath());\n TextEditor.setFileName(fileChooser.getSelectedFile().getAbsolutePath());\n TextEditor.getTextArea().setText(fileContent);\n }\n }", "public void open() {\n\t\tJFileChooser fc = new JFileChooser(\"./\");\n\t\tBufferedReader br = null;\n\t\tFileReader fr = null;\n\t\tfc.showOpenDialog(null);\n\t\ttry {\n\t\t\tfr = new FileReader(fc.getSelectedFile().getAbsolutePath());\n\t\t\tbr = new BufferedReader(fr);\n\t\t\t//make sure textArea is empty\n\t\t\ttextArea.setText(\"\");\n\t\t\t//loop to read all lines in file\n\t\t\twhile(br.readLine() != null) {\n\t\t\t\ttextArea.append(br.readLine() + \"\\n\");\n\t\t\t}\n\t\t}\n\t\tcatch (IOException ie) {\n\t\t\tie.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tif (br != null) {\n\t\t\t\t\tbr.close();\n\t\t\t\t\tfr.close();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException e1) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "private void toSave() {\n File file4=new File(\"trial.txt\");\n try\n {\n String row;\n BufferedWriter bw=new BufferedWriter(new FileWriter(file4));\n for(int i=0;i<jt.getRowCount();i++)\n {\n row = \"\";\n for(int j=0;j<jt.getColumnCount();j++)\n {\n row += (jt.getValueAt(i, j) +\",\");\n }\n row = row.substring(0, row.length()-1);\n //System.out.println(row);\n bw.write(row);\n bw.newLine();\n }\n bw.close();\n \n \n JOptionPane.showMessageDialog(rootPane,\"Details saved succesfully\");\n }\n \n catch(Exception ex)\n {\n JOptionPane.showMessageDialog(rootPane,\"Exception occured\");\n }\n }", "public Baitap1_1() {\n initComponents();\n _tfMaSinhVien.setEnabled(false);\n _tfTenSinhVien.setEnabled(false);\n _tfNgaySinh.setEnabled(false);\n _btHuy.setVisible(false);\n modelTable = new DefaultTableModel();\n modelTable.addColumn(\"Mã sinh viên\");\n modelTable.addColumn(\"Tên sinh viên\");\n modelTable.addColumn(\"Ngày sinh\");\n _FileChooser.setFileFilter(new FileNameExtensionFilter(\"*.txt\", \"txt\"));\n _tbleDanhSachSinhVien.getSelectionModel().addListSelectionListener(new ListSelectionListener(){\n public void valueChanged(ListSelectionEvent event) {\n _tfMaSinhVien.setText(_tbleDanhSachSinhVien.getValueAt(_tbleDanhSachSinhVien.getSelectedRow(), 0).toString());\n _tfTenSinhVien.setText(_tbleDanhSachSinhVien.getValueAt(_tbleDanhSachSinhVien.getSelectedRow(), 1).toString());\n _tfNgaySinh.setText(_tbleDanhSachSinhVien.getValueAt(_tbleDanhSachSinhVien.getSelectedRow(), 2).toString());\n }\n });\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n seletorArquivos = new javax.swing.JFileChooser();\n toolBar = new javax.swing.JToolBar();\n buttonAbrir = new javax.swing.JButton();\n butonSalvar = new javax.swing.JButton();\n jSeparator1 = new javax.swing.JToolBar.Separator();\n buttonAddTime = new javax.swing.JButton();\n buttonAtualizar = new javax.swing.JButton();\n buttonDistancias1 = new javax.swing.JButton();\n jSeparator2 = new javax.swing.JToolBar.Separator();\n buttonDistancias = new javax.swing.JButton();\n buttonTabela = new javax.swing.JButton();\n desktopPane = new javax.swing.JDesktopPane();\n jScrollPane1 = new javax.swing.JScrollPane();\n tableTimes = new javax.swing.JTable();\n jButton1 = new javax.swing.JButton();\n menuBar = new javax.swing.JMenuBar();\n menuArquivo = new javax.swing.JMenu();\n itemAddTime = new javax.swing.JMenuItem();\n itemDistancias = new javax.swing.JMenuItem();\n separatorUm = new javax.swing.JPopupMenu.Separator();\n itemTabela = new javax.swing.JMenuItem();\n separatorDois = new javax.swing.JPopupMenu.Separator();\n itemAbrir = new javax.swing.JMenuItem();\n itemSalvar = new javax.swing.JMenuItem();\n itemSalvarComo = new javax.swing.JMenuItem();\n itemSair = new javax.swing.JMenuItem();\n menuAjuda = new javax.swing.JMenu();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Gerador de Tabelas\");\n setBackground(new java.awt.Color(255, 255, 255));\n\n toolBar.setForeground(new java.awt.Color(255, 255, 255));\n toolBar.setRollover(true);\n toolBar.setToolTipText(\"\");\n\n buttonAbrir.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/poc/view/icons/abrir.png\"))); // NOI18N\n buttonAbrir.setToolTipText(\"Abrir...\\n\");\n buttonAbrir.setFocusable(false);\n buttonAbrir.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n buttonAbrir.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n buttonAbrir.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n buttonAbrirActionPerformed(evt);\n }\n });\n toolBar.add(buttonAbrir);\n\n butonSalvar.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/poc/view/icons/salvar.png\"))); // NOI18N\n butonSalvar.setToolTipText(\"Salvar\");\n butonSalvar.setFocusable(false);\n butonSalvar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n butonSalvar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n butonSalvar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n butonSalvarActionPerformed(evt);\n }\n });\n toolBar.add(butonSalvar);\n toolBar.add(jSeparator1);\n\n buttonAddTime.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/poc/view/icons/addTime.png\"))); // NOI18N\n buttonAddTime.setToolTipText(\"Adicionar Time\");\n buttonAddTime.setFocusable(false);\n buttonAddTime.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n buttonAddTime.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n buttonAddTime.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n buttonAddTimeActionPerformed(evt);\n }\n });\n toolBar.add(buttonAddTime);\n\n buttonAtualizar.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/poc/view/icons/atualizar.png\"))); // NOI18N\n buttonAtualizar.setToolTipText(\"Atualizar\");\n buttonAtualizar.setFocusable(false);\n buttonAtualizar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n buttonAtualizar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n buttonAtualizar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n buttonAtualizarActionPerformed(evt);\n }\n });\n toolBar.add(buttonAtualizar);\n\n buttonDistancias1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/poc/view/icons/excluirTime.png\"))); // NOI18N\n buttonDistancias1.setToolTipText(\"Excluir Times\");\n buttonDistancias1.setFocusable(false);\n buttonDistancias1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n buttonDistancias1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n buttonDistancias1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n buttonDistancias1ActionPerformed(evt);\n }\n });\n toolBar.add(buttonDistancias1);\n toolBar.add(jSeparator2);\n\n buttonDistancias.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/poc/view/icons/distancia.png\"))); // NOI18N\n buttonDistancias.setToolTipText(\"Cadastrar Distâncias\");\n buttonDistancias.setFocusable(false);\n buttonDistancias.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n buttonDistancias.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n buttonDistancias.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n buttonDistanciasActionPerformed(evt);\n }\n });\n toolBar.add(buttonDistancias);\n\n buttonTabela.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/poc/view/icons/gerarTabela.png\"))); // NOI18N\n buttonTabela.setToolTipText(\"Gerar Tabela\");\n buttonTabela.setFocusable(false);\n buttonTabela.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n buttonTabela.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n buttonTabela.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n buttonTabelaActionPerformed(evt);\n }\n });\n toolBar.add(buttonTabela);\n\n desktopPane.addComponentListener(new java.awt.event.ComponentAdapter() {\n public void componentResized(java.awt.event.ComponentEvent evt) {\n desktopPaneComponentResized(evt);\n }\n });\n\n tableTimes.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null},\n {null, null, null},\n {null, null, null},\n {null, null, null}\n },\n new String [] {\n \"Códigos\", \"Times\", \"Prioridade\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.Object.class, java.lang.String.class, java.lang.String.class\n };\n boolean[] canEdit = new boolean [] {\n false, false, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n jScrollPane1.setViewportView(tableTimes);\n\n desktopPane.setLayer(jScrollPane1, javax.swing.JLayeredPane.DEFAULT_LAYER);\n\n javax.swing.GroupLayout desktopPaneLayout = new javax.swing.GroupLayout(desktopPane);\n desktopPane.setLayout(desktopPaneLayout);\n desktopPaneLayout.setHorizontalGroup(\n desktopPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING)\n );\n desktopPaneLayout.setVerticalGroup(\n desktopPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 348, Short.MAX_VALUE)\n );\n\n jButton1.setText(\"Atualizar Tabela\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n menuBar.setBackground(new java.awt.Color(255, 255, 255));\n menuBar.setForeground(new java.awt.Color(255, 255, 255));\n\n menuArquivo.setText(\"Arquivo\");\n\n itemAddTime.setText(\"Adicionar Time\");\n menuArquivo.add(itemAddTime);\n\n itemDistancias.setText(\"Cadastrar Distâncias\");\n menuArquivo.add(itemDistancias);\n menuArquivo.add(separatorUm);\n\n itemTabela.setText(\"Gerar Tabela\");\n menuArquivo.add(itemTabela);\n menuArquivo.add(separatorDois);\n\n itemAbrir.setText(\"Abrir...\");\n itemAbrir.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n itemAbrirActionPerformed(evt);\n }\n });\n menuArquivo.add(itemAbrir);\n\n itemSalvar.setText(\"Salvar\");\n menuArquivo.add(itemSalvar);\n\n itemSalvarComo.setText(\"Salvar como...\");\n menuArquivo.add(itemSalvarComo);\n\n itemSair.setText(\"Sair\");\n itemSair.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n itemSairActionPerformed(evt);\n }\n });\n menuArquivo.add(itemSair);\n\n menuBar.add(menuArquivo);\n\n menuAjuda.setText(\"Ajuda\");\n menuBar.add(menuAjuda);\n\n setJMenuBar(menuBar);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(toolBar, javax.swing.GroupLayout.DEFAULT_SIZE, 778, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(desktopPane, javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(toolBar, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(desktopPane)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton1))\n );\n\n pack();\n setLocationRelativeTo(null);\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\ttry {\n\t\t\t\t\t//CSVFileStream fs = new CSVFileStream();\n\t\t\t\t\tOldTimeTable.setOutputStream(new CSVFileWriter().getStream(\"D:\\\\Work\\\\Mithril\\\\Unnati\\\\Docs\\\\myOutput.csv\"));\n\t\t\t\t\tOldTimeTable.createTimeTable(currentProject.getCourseDetailsFileName(), currentProject.getStudentAllocationDetailsFileName());\n\t\t\t\t} catch (Throwable error) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\tJOptionPane.showMessageDialog(OldTimeTableApp.this, error, \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t}\n\t\t\t}", "private void loadDataFromFile(File file) {\n\t\tString fileName = file.getName();\n\t\tQuickParser test = new QuickParser();\n\n\t\tif(fileName.trim().toUpperCase().startsWith(\"INV\")) {\n\t\t\tfileType = FileType.INVENTORY;\n\t\t\ttableView.getColumns().clear();\n\t\t\ttableView.getColumns().addAll(rfid,campus,building,room,lastScannedOn,lastScannedBy,purchaseOrder,serviceTag,comments);\n\t\t\tmasterInventoryData.clear();\n\t\t\tmasterInventoryData = test.Parse(file, fileType);\n\t\t\tpresentationInventoryData.clear();\n\t\t\tpresentationInventoryData.addAll(masterInventoryData);\n\t\t\tswitch (fileType) {\n\t\t\tcase INVENTORY:\n\t\t\t\tcurrentTabScreen = CurrentTabScreen.INVENTORY;\n\t\t\t\tbreak;\n\t\t\tcase INITIAL:\n\t\t\t\tcurrentTabScreen = CurrentTabScreen.INITIAL;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t} // End switch statement \n\t\t} // End if statement\n\t\telse if(fileName.toUpperCase().startsWith(\"INI\")) {\n\t\t\tfileType = FileType.INITIAL;\n\t\t\ttableView.getColumns().clear();\n\t\t\ttableView.getColumns().addAll(rfid,campus,building,room,lastScannedOn,lastScannedBy,purchaseOrder,serviceTag,comments);\n\t\t\tmasterInitialData.clear();\n\t\t\tmasterInitialData = test.Parse(file, fileType);\n\t\t\tpresentationInitialData.clear();\n\t\t\tpresentationInitialData.addAll(masterInitialData);\n\t\t\tswitch (fileType) {\n\t\t\tcase INVENTORY:\n\t\t\t\tcurrentTabScreen = CurrentTabScreen.INVENTORY;\n\t\t\t\tbreak;\n\t\t\tcase INITIAL:\n\t\t\t\tcurrentTabScreen = CurrentTabScreen.INITIAL;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t} // End switch statement \n\t\t} // End else if statement \n\t\telse {\n\t\t\tfileType = FileType.UNASSIGNED;\n\t\t} // End else statement\n\t\tchangeToScanTable();\n\t}", "public releasetxt(java.awt.Frame parent, boolean modal) {\n super(parent, modal);\n initComponents();\n \n // release.txt einlesen und darstellen\n BufferedReader in = null;\n try {\n in = new BufferedReader(new FileReader(\"release.txt\"));\n String zeile = null;\n while ((zeile = in.readLine()) != null) {\n jTextArea1.append(zeile+\"\\n\");\n System.out.println(\"Gelesene Zeile: \" + zeile);\n }\n jTextArea1.setCaretPosition(0);\n \n } catch (IOException ex) {\n Logger.getLogger(invoiceIT.class.getName()).log(Level.SEVERE, null, ex);\n } finally {\n try {\n in.close();\n } catch (IOException ex) {\n Logger.getLogger(invoiceIT.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }", "private void selectTXTFile() {\n JFileChooser jfc = new JFileChooser();\n File curDir;\n if (readFile != null) curDir = new File(readFile.getParent()); else curDir = new File(System.getProperty(\"user.home\"));\n jfc.setCurrentDirectory(curDir);\n jfc.setFileFilter(new TXTFilter());\n jfc.setMultiSelectionEnabled(false);\n int ret = jfc.showDialog(this, \"Save\");\n if (ret == 0) {\n outputField.setText(jfc.getSelectedFile().getAbsolutePath() + \".txt\");\n }\n }", "public JFormatTextFiledFrame() {\n initComponents();\n\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n jButton1 = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 3, 18)); // NOI18N\n jLabel1.setText(\"Liste des Contracts Actifs\");\n\n jTable1.setModel(this.tm);\n jScrollPane1.setViewportView(jTable1);\n\n jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/img/file delete.png\"))); // NOI18N\n jButton1.setText(\"Resilier\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/img/display down.png\"))); // NOI18N\n jButton2.setText(\"PDF\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)\n .addContainerGap())\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 237, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(73, 73, 73))))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGap(36, 36, 36)\n .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 68, Short.MAX_VALUE)\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(29, 29, 29))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 181, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jButton1)\n .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(32, Short.MAX_VALUE))\n );\n }", "@Override\r\n public void actionPerformed(ActionEvent e) {\r\n model.setText(view.txtTexto.getText());\r\n model.Content();\r\n Object []object = new Object[1];\r\n object [0] = view.txtTexto.getText();\r\n table.addRow(object);\r\n limpiar();\r\n }", "public void openFile(ActionEvent e) {\r\n JFileChooser chooser = new JFileChooser();\r\n\r\n int returnVal = chooser.showOpenDialog(null);\r\n if (returnVal == JFileChooser.APPROVE_OPTION) {\r\n this.is_alg_started = false;\r\n this.is_already_renumbered = false;\r\n if (e.getActionCommand().equals(\"nodelist\")) {\r\n this.nodefileText.setText(chooser.getSelectedFile().getAbsolutePath());\r\n }\r\n if (e.getActionCommand().equals(\"edgelist\")) {\r\n this.edgeFileText.setText(chooser.getSelectedFile().getAbsolutePath());\r\n }\r\n }\r\n }", "public void load()\r\n {\r\n \tfc.setAcceptAllFileFilterUsed(false);\r\n\t\tfc.setDialogTitle(\"Select the text file representing your organism!\");\r\n\t\tfc.setFileFilter(new FileNameExtensionFilter(\"Text Files (Organism)\", new String[]{\"txt\"}));\r\n\t\tif(fc.showOpenDialog(this)==JFileChooser.APPROVE_OPTION)\r\n\t\t\t//Try-Catch Block\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tbr=new BufferedReader(new FileReader(fc.getSelectedFile()));\r\n\t\t\t\tArrayList<Organism> treeTemp=new ArrayList<Organism>();\r\n\t\t \tString line=br.readLine();\r\n\t\t \tint x=0;\r\n\t\t \twhile(line!=null)\r\n\t\t \t{\r\n\t\t \t\t\tString[] genesSt=line.split(\" \");\r\n\t\t \t\t\tint[] genes=new int[genesSt.length];\r\n\t\t \t\t\tfor(int y=0; y<genesSt.length; y++)\r\n\t\t \t\t\t\tgenes[y]=Integer.parseInt(genesSt[y]);\r\n\t\t \t\t\t\t\r\n\t\t \t\t\ttreeTemp.add(new Organism(genes,x));\r\n\t\t \t\tline=br.readLine();\r\n\t\t \t\tx++;\r\n\t\t \t}\r\n\t\t \tbr.close();\r\n\t\t \te.setTree(treeTemp);\r\n\t\t \te.setParent(treeTemp.get(treeTemp.size()-1));\r\n\t\t\t\trepaint();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tcatch(Exception ex)\r\n\t\t\t{\r\n\t\t\t\tex.printStackTrace();\r\n\t\t\t}\r\n }", "@FXML\n\tpublic void openFile() {\n\t\tFileChooser openFileChooser = new FileChooser();\n\t\topenFileChooser.setInitialDirectory(userWorkspace);\n\t\topenFileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter(\"Text doc(*.txt)\", \"*.txt\"));\n\t\tfile = openFileChooser.showOpenDialog(ap.getScene().getWindow());\n\n\t\tuserText.clear();\n\n\t\tif (file != null) {\n\t\t\tif (file.getName().endsWith(\".txt\")) {\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\twriteToUserText();\n\t\t\t}\n\t\t}\n\t}", "public void exportResultsToFile(){\r\n\t\t\t\t\r\n\t\t// This if clause shouldn't fire as the icon is grayed out if there is no tab open\r\n\t\tif(currentView == null \r\n\t\t\t\t|| currentView.getDynamicModelView() == null \r\n\t\t\t\t|| currentView.getDynamicModelView().getModel() == null){\r\n\t\t\tJOptionPane.showMessageDialog(this, \"A tab must be open, and a model and table must be present before results can be exported\", \"Information\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(currentView.getDynamicModelView().getModel().getDefaultHistory() == null){\r\n\t\t\tJOptionPane.showMessageDialog(this, \"A table must be present before results can be exported\", \"Information\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tDynamicModelHistory history = currentView.getDynamicModelView().getModel().getDefaultHistory();\r\n\r\n\t\tStringBuffer buffer = new StringBuffer(30000);\r\n\r\n\t\tif(history != null && history.getTimePointCount() > 0 && history.getSnapshot(0) != null){\r\n\t\t\r\n\t\t\t// Get the filename\r\n\t\t\tYorkGUIUtils guiUtils = new YorkGUIUtils();\r\n\t\t\tString selectedFile = guiUtils.getUserToDefineFilename(this, propertiesMemento.getBaseDir(), \"txt csv\", \"Results files (.txt, .csv)\", JFileChooser.SAVE_DIALOG);\r\n\r\n\t\t\tif(selectedFile == null || guiUtils.wasCancelled()){\r\n\t\t\t\trequestFocusInWindow();\r\n\t\t\t\treturn;\r\n\t\t\t}\t\t\t\r\n\t\t\tlogger.info(\"Selected file for exporting results:\" + selectedFile);\r\n\t\t\r\n\t\t\tbuffer.append(\"time point\").append(\"\\t\");\r\n\t\t\tfor(int t = 0; t < history.getTimePointCount(); t++){\r\n\t\t\t\tbuffer.append(t).append(\"\\t\");\r\n\t\t\t}\r\n\t\t\tbuffer.append(\"\\n\");\r\n\t\t\t\r\n\t\t\tfor(Iterator<String> it = history.getSnapshot(0).keySet().iterator(); it.hasNext();){\r\n\t\t\t\tString name = it.next();\r\n\t\t\t\tbuffer.append(name).append(\"\\t\");\r\n\t\t\t\t// For all time points\r\n\t\t\t\tfor(int t = 0; t < history.getTimePointCount(); t++){\r\n\t\t\t\t\tbuffer.append(history.getSnapshot(t).get(name).getOutputValue()).append(\"\\t\");\r\n\t\t\t\t}\r\n\t\t\t\tbuffer.append(\"\\n\");\r\n\t\t\t}\r\n\t\t\tFileLoader.save(selectedFile, buffer.toString());\r\n\t\t}\r\n\t\telse{\r\n\t\t\tJOptionPane.showMessageDialog(this, \"No results available in the selected tab. Run the model first.\", \"Warning\", JOptionPane.WARNING_MESSAGE);\r\n\t\t\t\r\n\t\t}\r\n\t}", "private String readFile(File file){\n StringBuilder stringBuffer = new StringBuilder();\n BufferedReader bufferedReader = null;\n\n try {\n\n bufferedReader = new BufferedReader(new FileReader(file));\n\n String text;\n while ((text = bufferedReader.readLine()) != null) {\n stringBuffer.append(text.replaceAll(\"\\t\", miTab) + \"\\n\");\n }\n\n } catch (FileNotFoundException ex) {\n Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IOException ex) {\n Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);\n } finally {\n try {\n bufferedReader.close();\n } catch (IOException ex) {\n Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n\n return stringBuffer.toString();\n }", "public void openFile(File file) {\n// new FileSystem().readFile(addressBook, file);\n// addressBook.fireTableDataChanged();\n }", "public void fromFile(String fileName)\n {\n //definir dados\n int i;\n int j;\n int lin;\n int col;\n String linha;\n FILE arquivo;\n\n arquivo = new FILE(FILE.INPUT, fileName);\n\n //obter dimensoes\n lin = lines();\n col = columns();\n\n //verificar se dimensoes validas\n if( lin <= 0 || col <= 0 )\n {\n IO.println(\"ERRO: Tamanho invalido. \");\n } //end\n else\n {\n //verificar se arquivo e' valido\n if( arquivo == null )\n {\n IO.println(\"ERRO: Arquivo invalido. \");\n } //end\n else\n {\n //ler a primeira linha do arquivo\n linha = arquivo.readln();\n\n //verificar se ha' dados\n if( linha == null )\n {\n IO.println(\"ERRO: Arquivo vazio. \");\n } //end\n else\n {\n linha = arquivo.readln();\n for( i = 0; i < lin; i++)\n {\n for( j = 0; j < col; j++)\n {\n //ler linha do arquivo\n linha = arquivo.readln();\n table[ i ][ j ] = linha;\n } //end repetir\n } //end repetir\n //fechar arquivo (indispensavel)\n arquivo.close();\n } //end se\n } //end se\n } //end se\n }", "private ActionListener loadFile() {\n\t\treturn new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t\tFile file = null;\n\t\t\t\tJFileChooser chooser = new JFileChooser();\n\t\t\t\tchooser.setCurrentDirectory(new File(\".\"));\n\n\t\t\t\tchooser.setFileFilter(new FileFilter() {\n\t\t\t\t\tpublic boolean accept(File f) {\n\t\t\t\t\t\treturn f.getName().toLowerCase().endsWith(\".txt\") || f.isDirectory();\n\t\t\t\t\t}\n\n\t\t\t\t\tpublic String getDescription() {\n\t\t\t\t\t\treturn \".txt File\";\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tint r = chooser.showOpenDialog(new JFrame());\n\t\t\t\tif (r == JFileChooser.APPROVE_OPTION) {\n\t\t\t\t\tfile = chooser.getSelectedFile();\n\t\t\t\t}\n\n\t\t\t\ttry (BufferedReader br = new BufferedReader(new FileReader(file))) {\n\t\t\t\t\tString line;\n\t\t\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\t\t\t// Math Class;2014;1;2;MWF;17;18;\n\t\t\t\t\t\tString[] inputStrs = line.split(\";\");\n\t\t\t\t\t\tString content = inputStrs[0].trim();\n\t\t\t\t\t\tArrayList<String> days = parseDays(inputStrs[1].trim(), inputStrs[2].trim(),\n\t\t\t\t\t\t\t\tinputStrs[3].trim(), inputStrs[4].trim());\n\t\t\t\t\t\tString startTime = inputStrs[5].trim();\n\t\t\t\t\t\tString endTime = inputStrs[6].trim();\n\t\t\t\t\t\tif (eventsData.isConflict(days, Integer.parseInt(startTime), Integer.parseInt(endTime))) {\n\t\t\t\t\t\t\tthrow new IllegalArgumentException(\"There is schedule during \" + startTime + \":00 and \"\n\t\t\t\t\t\t\t\t\t+ endTime + \":00.\" + \"\\n\" + \"Please reschedule.\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfor (int i = 0; i < days.size(); i++) {\n\t\t\t\t\t\t\t\teventsData.addEvent(new Event(days.get(i), startTime, endTime, content));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tupdateEventsView(eventsRender);\n\t\t\t\t\t}\n\t\t\t\t} catch (FileNotFoundException e1) {\n\t\t\t\t promptMsg(e1.getMessage(), \"Error\");\n\t\t\t\t} catch (IOException e1) {\n\t\t\t\t promptMsg(e1.getMessage(), \"Error\");\n\t\t\t\t} catch (IllegalArgumentException e1) {\n\t\t\t\t promptMsg(e1.getMessage(), \"Error\");\n\t\t\t\t} catch (Exception e1) {\n\t\t\t\t promptMsg(e1.getMessage(), \"Error\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Method to parse through the text file to add events\n\t\t\t * @param y the event\n\t\t\t * @param startMonth starting month\n\t\t\t * @param endMonth ending month\n\t\t\t * @param weekDays weekdays where event occurs\n\t\t\t * @return arraylist contaiing events\n\t\t\t */\n\t\t\tprivate ArrayList<String> parseDays(String y, String startMonth, String endMonth, String weekDays) {\n\t\t\t\tArrayList<String> result = new ArrayList<>();\n\t\t\t\tint year = Integer.parseInt(y);\n\t\t\t\tint startM = Integer.parseInt(startMonth) - 1;\n\t\t\t\tint endM = Integer.parseInt(endMonth) - 1;\n\n\t\t\t\tMap<String, Integer> weekMap = new HashMap<>();\n\t\t\t\tweekMap.put(\"S\", 1);\n\t\t\t\tweekMap.put(\"M\", 2);\n\t\t\t\tweekMap.put(\"T\", 3);\n\t\t\t\tweekMap.put(\"W\", 4);\n\t\t\t\tweekMap.put(\"H\", 5);\n\t\t\t\tweekMap.put(\"F\", 6);\n\t\t\t\tweekMap.put(\"A\", 7);\n\n\t\t\t\tSet<Integer> set = new HashSet<>();\n\t\t\t\tfor (int i = 0; i < weekDays.length(); i++) {\n\t\t\t\t\tset.add(weekMap.get(weekDays.substring(i, i + 1)));\n\t\t\t\t}\n\n\t\t\t\tCalendar cal = new GregorianCalendar(year, startM, 1);\n\t\t\t\tdo {\n\t\t\t\t\tint day = cal.get(Calendar.DAY_OF_WEEK);\n\t\t\t\t\tif (set.contains(day)) {\n\t\t\t\t\t\tresult.add(\"\" + y + parseToTwoInteger((cal.get(Calendar.MONTH) + 1))\n\t\t\t\t\t\t\t\t+ parseToTwoInteger(cal.get(Calendar.DAY_OF_MONTH)));\n\t\t\t\t\t}\n\t\t\t\t\tcal.add(Calendar.DAY_OF_YEAR, 1);\n\t\t\t\t} while (cal.get(Calendar.MONTH) <= endM);\n\n\t\t\t\treturn result;\n\n\t\t\t}\n\t\t};\n\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 tv = new javax.swing.JTable();\n jScrollPane2 = new javax.swing.JScrollPane();\n tv2 = new javax.swing.JTable();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jScrollPane3 = new javax.swing.JScrollPane();\n txt = new javax.swing.JTextArea();\n jLabel3 = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n jScrollPane1.setBackground(new java.awt.Color(114, 98, 83));\n\n tv.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(tv);\n\n getContentPane().add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 70, 404, 206));\n\n jScrollPane2.setBackground(new java.awt.Color(98, 87, 76));\n\n tv2.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane2.setViewportView(tv2);\n\n getContentPane().add(jScrollPane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 70, 464, 206));\n\n jLabel1.setFont(new java.awt.Font(\"Ubuntu\", 1, 18)); // NOI18N\n jLabel1.setText(\"Errores sintatico\");\n getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(610, 30, -1, -1));\n\n jLabel2.setFont(new java.awt.Font(\"Ubuntu\", 1, 18)); // NOI18N\n jLabel2.setText(\"Errores lexico\");\n getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 30, -1, -1));\n\n txt.setColumns(20);\n txt.setRows(5);\n jScrollPane3.setViewportView(txt);\n\n getContentPane().add(jScrollPane3, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 320, 590, 170));\n\n jLabel3.setFont(new java.awt.Font(\"Ubuntu\", 1, 18)); // NOI18N\n jLabel3.setText(\"Estructura\");\n getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 290, -1, -1));\n\n pack();\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\tfinal JFileChooser fc = new JFileChooser();\r\n\t\t\t\t\r\n\t\t\t\tif(currentDirectory != null) fc.setCurrentDirectory(currentDirectory);\r\n\t\t\t\t\r\n\t\t\t\t//In response to a button click:\r\n\t\t\t\tint returnVal = fc.showOpenDialog(null);\r\n\t\t\t\tcurrentDirectory = fc.getCurrentDirectory();\r\n\t\t\t\t\r\n\t\t if (returnVal == JFileChooser.APPROVE_OPTION) {\t\t \t\r\n\t\t \tList<String> lines = null;\r\n\t\t File file = fc.getSelectedFile();\r\n\t\t Path path = Paths.get(file.getAbsolutePath());\r\n\t\t int loopLength = antennaArray.phase.length;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tlines = Files.readAllLines(path, StandardCharsets.UTF_8);\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(lines.size() < antennaArray.phase.length) {\r\n\t\t\t\t\t\t\tint difference = antennaArray.phase.length - lines.size();\r\n\t\t\t\t\t\t\tfor(int addition = 0; addition < difference; addition++)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tlines.add(\"0\");\r\n\t\t\t\t\t\t\t}\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\tfor (int conversion = 0; conversion < loopLength; conversion++) {\r\n\t\t\t\t\t\t\tdouble phaseFromFile = 0;\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\tphaseFromFile = Double.parseDouble(lines.get(conversion));\r\n\t\t\t\t\t\t\t} catch (NumberFormatException ex) {\r\n\t\t\t\t\t\t\t\tphaseFromFile = 0;\r\n\t\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\tantennaArray.phase[conversion] = phaseFromFile;\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\trefreshPhaseTable();\r\n\t\t\t\t\t\tdrawPlotWithInitialParameterValues();\t\t\t\t\t\t\r\n\t\t\t\t\t} catch (IOException ex) {\r\n\t\t\t\t\t\tex.printStackTrace();\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t } else {\r\n\t\t // Cancelled by the user.\r\n\t\t }\t\r\n\t\t\t}", "public IndexFrame() {\n initComponents();\n \n /*\n * Definition d'un nouveau modele pour la jTable\n */\n \n \n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n \n },\n new String [] {\n \"Lemme \", \"Document n° \", \" TF \",\n }){\n boolean[] canEdit = new boolean [] {\n false, false\n };\n \n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n \n DefaultTableModel model = (DefaultTableModel) jTable1.getModel();\n \n \n try{\n FileInputStream fis=new FileInputStream(\"C:/ressources/indexOptim.ser\");\n ObjectInputStream ois= new ObjectInputStream(fis);\n \n HashMap temp=new HashMap();\n \n HashMap h=new HashMap();\n h=(HashMap)ois.readObject();\n for (Object k : h.keySet())\n {\n temp=(HashMap)h.get(k);\n for (Object k2 : temp.keySet())\n {\n model.insertRow(0, new Object [] {(String) k,(Integer )k2,(Integer)temp.get(k2) });\n }\n }\n \n \n }\n catch(Exception e )\n {e.printStackTrace();\n }\n \n }", "@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t\tFileDialog dialog = new FileDialog(shlFaststone,SWT.OPEN); \n\t\t\t\tdialog.setFilterPath(System.getProperty(\"user_home\"));//设置初始路径\n\t\t\t\tdialog.setFilterNames(new String[] {\"文本文档(*txt)\",\"所有文档\"}); \n\t\t\t\tdialog.setFilterExtensions(new String[]{\"*.exe\",\"*.xls\",\"*.*\"});\n\t\t\t\tString path=dialog.open();\n\t\t\t\tString s=null;\n\t\t\t\tFile f=null;\n\t\t\t\tif(path==null||\"\".equals(path)) {\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t\ttry{\n\t\t\t f=new File(path);\n\t\t\t\tbyte[] bs=Fileutil.readFile(f);\n\t\t\t s=new String(bs,\"UTF-8\");\n\t\t\t\t}catch (Exception e1) {\n\t\t\t\t\t// TODO: handle exception\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\tMessageDialog.openError(shlFaststone, \"出错了\", \"打开\"+path+\"出错了\");\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t \n\t\t\t\ttext = new Text(composite_4, SWT.BORDER | SWT.WRAP\n\t\t\t\t\t\t| SWT.H_SCROLL | SWT.V_SCROLL | SWT.CANCEL\n\t\t\t\t\t\t| SWT.MULTI);\n\t\t\t\ttext.setText(s);\n\t\t\t\tcomposite_1.layout();\n\t\t\t\tshlFaststone.setText(shlFaststone.getText()+\"\\t\"+f.getName());\n\t\t\t\t\t\n\t\t\t\tFile f1=new File(path);\n\t\t\t\tImageData imageData;\n\t\t\t\ttry {\n\t\t\t\t\timageData = new ImageData( new FileInputStream( f1));\n\t\t\t\t\tImage image=new Image(shlFaststone.getDisplay(),imageData);\n\t\t\t\t\tlblNewLabel_3.setImage(image);\n\t\t\t\t} catch (FileNotFoundException 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\n\t\t\t}", "public String getTableFile() \n\t{\n\t return tableFile ;\n\t}", "void openFile() {\n\t\tJFileChooser fileChooser = new JFileChooser(desktopPath);\n\t\tint returnVal = fileChooser.showOpenDialog(null);\n if(returnVal == JFileChooser.APPROVE_OPTION) {\n \tString filePath = fileChooser.getSelectedFile().getPath();\n File file = new File(filePath);\n textEditor.setText(\"\");\n try {\n \tScanner in = new Scanner(file);\n \twhile(in.hasNextLine()) {\n \t\ttextEditor.append(in.nextLine()+'\\n');\n \t}\n \tin.close();\n \ttextAreaChanged = false;\n \tsavedFilePath = filePath;\n } catch (Exception ex) {\n \terrorTextArea.setForeground(Color.RED);\n\t\t\t\terrorTextArea.setText(\"Error loding file\");\n\t\t\t}\n }\n\t}", "void open() {\n \tJFileChooser fileopen = new JFileChooser();\n int ret = fileopen.showDialog(null, \"Open file\");\n\n if (ret == JFileChooser.APPROVE_OPTION) {\n document.setFile(fileopen.getSelectedFile());\n textArea.setText(document.getContent());\n }\n }", "private void loadFiles() {\n User user = ConnectionManager.getInstance().getUser();\n List<NoteFile> files = DatabaseManager.getInstance().getSharedFiles(user);\n ObservableList<GuiFile> guiFiles = FXCollections.observableArrayList();\n\n for (NoteFile file : files)\n guiFiles.add(new GuiFile(file));\n\n tableFiles.setItems(guiFiles);\n GUIUtils.autoResizeColumns(tableFiles);\n }", "public void loadFile(File file) throws FileNotFoundException\n {\n FileReader reader = new FileReader(file);\n\n // Clear table to make sure it only shows tasks from file\n Item.getToDoList().clear();\n if(this.listView != null)\n {\n listView.getItems().clear();\n }\n\n index = 0;\n\n try(BufferedReader temp = new BufferedReader(reader))\n {\n String info;\n boolean check;\n\n while((info = temp.readLine()) != null)\n {\n // Make an array of values\n String[] values = info.split(\",\");\n\n //Array length is 3, since 3 columns. If not that then incorrect file\n if(values.length != 3)\n {\n if(this.status != null)\n {\n status.setText(\"Incompatible File. \");\n }\n break;\n }\n\n // If correct, add information from file to list\n else\n {\n check = !values[2].equals(\"false\");\n Item.getToDoList().add(new Item(values[0], values[1], check));\n }\n }\n\n } catch (IOException exception)\n {\n // If error, let user know\n if(this.status != null)\n {\n status.setText(\"File not found. \");\n }\n\n exception.printStackTrace();\n }\n }", "private void openItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openItemActionPerformed\n if (fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {\n File file = fileChooser.getSelectedFile();\n String t = \"\";\n if (file.isFile()) {\n if ((file.getName().toLowerCase().endsWith(\".jpg\")\n || file.getName().toLowerCase().endsWith(\".png\"))) {\n files.add(file.getAbsolutePath());\n flist.add(file);\n } else if (file.getName().toLowerCase().endsWith(\".pdf\")) {\n parsePDF(file.getAbsolutePath());\n flist.add(file);\n }\n t += file.getAbsolutePath() + \"\\n\";\n } else {\n for (File f : file.listFiles()) {\n if (f.isFile() && (f.getName().toLowerCase().endsWith(\".jpg\")\n || f.getName().toLowerCase().endsWith(\".png\"))) {\n files.add(f.getAbsolutePath());\n flist.add(f);\n t += f.getAbsolutePath() + \"\\n\";\n } else if (f.isFile() && f.getName().toLowerCase().endsWith(\".pdf\")) {\n parsePDF(f.getAbsolutePath());\n flist.add(f);\n t += f.getAbsolutePath() + \"\\n\";\n }\n }\n }\n textArea.setText(t);\n } else {\n System.out.println(\"File access cancelled.\");\n }\n }", "public FileDB(String []str, int length, int open,String fileName){\n \n super(new BorderLayout());\n\tthis.open = open;\n\tselecStr = \"\";\n\tflag = true;\n listModel = new DefaultListModel();\n\tfor(int i=0;i<length;i++)\n\t\tlistModel.addElement(str[i]);\n list = new JList(listModel);\n list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n list.setSelectedIndex(0);\n list.addListSelectionListener(this);\n list.setVisibleRowCount(8);\n JScrollPane listScrollPane = new JScrollPane(list);\n JButton ok = new JButton(\"OK\");\n\n ok.setActionCommand(\"ok\");\n ok.addActionListener(this);\n/*\tok.setMinimumSize(new Dimension(this.getWidth()/2,this.getHeight()/4));\n\tok.setPreferredSize(new Dimension(this.getWidth()/2,this.getHeight()/4));\n\tok.setMaximumSize(new Dimension(this.getWidth()/2,this.getHeight()/4));*/\n JButton cancel = new JButton(\"Cancel\");\n cancel.setActionCommand(\"cancel\");\n cancel.addActionListener(this);\n/*\tcancel.setMinimumSize(new Dimension(this.getWidth()/2,this.getHeight()/4));\n\tcancel.setPreferredSize(new Dimension(this.getWidth()/2,this.getHeight()/4));\n\tcancel.setMaximumSize(new Dimension(this.getWidth()/2,this.getHeight()/4));*/\n JPanel buttonPane = new JPanel(); \n\tif(open==1){\n\n\t\tSystem.out.println(\"Filename is \"+fileName);\n\t\tif(fileName!=null){\n\t\t\tStringTokenizer st = new StringTokenizer(fileName,\" :\");\n\t\t\tta = new TextArea(st.nextToken());\n\t\t}\n\t\telse\n\t\t\tta = new TextArea(\"iConc\");\n\t}\n\telse if(open == 0){\n\t\n\t\tta = new TextArea(\"iConc\");\n\t}\n\tbuttonPane.add(ta);\n buttonPane.add(ok);\n buttonPane.add(cancel);\n add(listScrollPane, BorderLayout.CENTER);\n add(buttonPane, BorderLayout.PAGE_END);\n\tcreateAndShowGUI();\n }", "private void fromFileJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fromFileJButtonActionPerformed\n //load new database\n JFileChooser chooser = new JFileChooser(\"src/Cities\");\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\n \"text Files\", \"txt\");\n chooser.setFileFilter(filter);\n int choice = chooser.showOpenDialog(null);\n if(choice == JFileChooser.APPROVE_OPTION)\n {\n namesArray = new ArrayList<>();\n tempArray = new ArrayList<>();\n File chosenFile = chooser.getSelectedFile();\n fileName = \"src/Cities/\" + chosenFile.getName();\n //read file into array list\n myReader.readFromFile(fileName);\n namesArray = myReader.getStringArr();\n tempArray = myReader.getNumberArr();\n \n \n if(namesArray == null || tempArray == null) //if try to open an empty file\n {\n JOptionPane.showMessageDialog(null, \"File you are trying to \"\n + \"open is empty\", \" File Error\", \n JOptionPane.INFORMATION_MESSAGE);\n }\n else\n {\n //make list of edges\n makeEdgeList(namesArray, tempArray);\n //make weighted graph object\n graph = new WeightedGraph(namesArray, edgeArray);\n loadJList();\n checkEnabled();\n clearStats();\n calculateJButton.doClick();\n //check what should be selected\n }\n }\n else\n {\n JOptionPane.showMessageDialog(null, \"Unable to open file\", \" File \"\n + \"Input Error\", JOptionPane.INFORMATION_MESSAGE);\n }\n }", "@Override\r\n\t\t\t\r\n\t\t \r\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t JFileChooser fc=new JFileChooser();\r\n\t\t\t \r\n\t\t\t //Indicamos que podemos seleccionar varios ficheros\r\n\t\t\t fc.setMultiSelectionEnabled(true);\r\n\t\t\t \r\n\t\t\t //Indicamos lo que podemos seleccionar\r\n\t\t\t fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);\r\n\t\t\t \r\n\t\t\t \r\n\t\t\t //Abrimos la ventana, guardamos la opcion seleccionada por el usuario\r\n\t\t\t int seleccion=fc.showOpenDialog(contentPane);\r\n\t\t\t \r\n\t\t\t //Si el usuario, pincha en aceptar\r\n\t\t\t \r\n\t\t\t /*formato nomre fichero sesiones. \r\n\t\t\t * IdPaciente_IdSesion_Fecha_Hora*/\r\n\t\t\t if(seleccion==JFileChooser.APPROVE_OPTION){\r\n\t\t\t \t fichero=fc.getSelectedFile();\r\n\t\t\t \t ManejadorDeFicheros mf = new ManejadorDeFicheros();\r\n\t\t\t \t ArrayList<Sesion> sesiones = mf.buscaSesiones(fichero);\r\n\t\t\t \t\t tiempos = GestionDatos.obtenerTiempos(sesiones);\r\n\t\t\t \t\t \r\n\t\t\t \t\t velocidades = GestionDatos.obtenerVelocidades(sesiones);\r\n\t\t\t \t String nombreFichero = fichero.getName();\r\n\t\t\t \t String sesion = \"Sesion \"+Integer.parseInt(nombreFichero.substring(3,5));\r\n\t\t\t \t String fecha = nombreFichero.substring(6,8)+\"/\"+ nombreFichero.substring(8, 10)+\"/\"+nombreFichero.substring(10,14);\r\n\t\t\t \t String hora = nombreFichero.substring(15,17)+\":\"+ nombreFichero.substring(17,19)+\":\"+nombreFichero.substring(19,21);\r\n\t\t\t \t modelo.addRow(new Object[]{sesion, fecha, hora});\r\n\t\t\t \t \r\n\t\t\t \t\t \r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t \r\n\t\t\t \r\n\t\t\t}", "private void initComponents() {\n\n jTextField1 = new javax.swing.JTextField();\n jButton1 = new javax.swing.JButton();\n jScrollPane2 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n jSpinner1 = new javax.swing.JSpinner();\n jLabel1 = new javax.swing.JLabel();\n jTextField2 = new javax.swing.JTextField();\n jButton2 = new javax.swing.JButton();\n jScrollPane3 = new javax.swing.JScrollPane();\n jTable2 = new javax.swing.JTable();\n jPanel1 = new javax.swing.JPanel();\n jButton3 = new javax.swing.JButton();\n jLabel3 = new javax.swing.JLabel();\n jPanel2 = new javax.swing.JPanel();\n jPanel3 = new javax.swing.JPanel();\n jCheckBox1 = new javax.swing.JCheckBox();\n jPanel4 = new javax.swing.JPanel();\n jCheckBox2 = new javax.swing.JCheckBox();\n\n jTextField1.setText(org.openide.util.NbBundle.getMessage(TestFileTopComponent.class, \"TestFileTopComponent.jTextField1.text\")); // NOI18N\n\n org.openide.awt.Mnemonics.setLocalizedText(jButton1, org.openide.util.NbBundle.getMessage(TestFileTopComponent.class, \"TestFileTopComponent.text\")); // NOI18N\n jButton1.setName(\"\"); // NOI18N\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Word\", \"Frequency\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.String.class, java.lang.String.class\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n });\n jScrollPane2.setViewportView(jTable1);\n if (jTable1.getColumnModel().getColumnCount() > 0) {\n jTable1.getColumnModel().getColumn(0).setHeaderValue(org.openide.util.NbBundle.getMessage(TestFileTopComponent.class, \"TestFileTopComponent.jTable1.columnModel.title0\")); // NOI18N\n jTable1.getColumnModel().getColumn(1).setHeaderValue(org.openide.util.NbBundle.getMessage(TestFileTopComponent.class, \"TestFileTopComponent.jTable1.columnModel.title3\")); // NOI18N\n }\n\n jSpinner1.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(0), Integer.valueOf(0), null, Integer.valueOf(5)));\n jSpinner1.addPropertyChangeListener(new java.beans.PropertyChangeListener() {\n public void propertyChange(java.beans.PropertyChangeEvent evt) {\n jSpinner1PropertyChange(evt);\n }\n });\n\n org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(TestFileTopComponent.class, \"TestFileTopComponent.jLabel1.text\")); // NOI18N\n\n jTextField2.setText(org.openide.util.NbBundle.getMessage(TestFileTopComponent.class, \"TestFileTopComponent.jTextField2.text\")); // NOI18N\n\n org.openide.awt.Mnemonics.setLocalizedText(jButton2, org.openide.util.NbBundle.getMessage(TestFileTopComponent.class, \"TestFileTopComponent.jButton2.text\")); // NOI18N\n jButton2.setName(\"\"); // NOI18N\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n jTable2.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Word\", \"Frequency\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.String.class, java.lang.String.class\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n });\n jScrollPane3.setViewportView(jTable2);\n if (jTable2.getColumnModel().getColumnCount() > 0) {\n jTable2.getColumnModel().getColumn(0).setHeaderValue(org.openide.util.NbBundle.getMessage(TestFileTopComponent.class, \"TestFileTopComponent.jTable1.columnModel.title0\")); // NOI18N\n jTable2.getColumnModel().getColumn(1).setHeaderValue(org.openide.util.NbBundle.getMessage(TestFileTopComponent.class, \"TestFileTopComponent.jTable1.columnModel.title3\")); // NOI18N\n }\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 0, Short.MAX_VALUE)\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 0, Short.MAX_VALUE)\n );\n\n org.openide.awt.Mnemonics.setLocalizedText(jButton3, org.openide.util.NbBundle.getMessage(TestFileTopComponent.class, \"TestFileTopComponent.jButton3.text\")); // NOI18N\n jButton3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton3ActionPerformed(evt);\n }\n });\n\n jLabel3.setFont(new java.awt.Font(\"Tahoma\", 1, 24)); // NOI18N\n org.openide.awt.Mnemonics.setLocalizedText(jLabel3, org.openide.util.NbBundle.getMessage(TestFileTopComponent.class, \"TestFileTopComponent.jLabel3.text\")); // NOI18N\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 324, Short.MAX_VALUE)\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 323, Short.MAX_VALUE)\n );\n\n jPanel3.setMaximumSize(new java.awt.Dimension(0, 418));\n\n javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);\n jPanel3.setLayout(jPanel3Layout);\n jPanel3Layout.setHorizontalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 0, Short.MAX_VALUE)\n );\n jPanel3Layout.setVerticalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 418, Short.MAX_VALUE)\n );\n\n org.openide.awt.Mnemonics.setLocalizedText(jCheckBox1, org.openide.util.NbBundle.getMessage(TestFileTopComponent.class, \"TestFileTopComponent.jCheckBox1.text\")); // NOI18N\n jCheckBox1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jCheckBox1ActionPerformed(evt);\n }\n });\n\n jPanel4.setPreferredSize(new java.awt.Dimension(0, 418));\n\n javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);\n jPanel4.setLayout(jPanel4Layout);\n jPanel4Layout.setHorizontalGroup(\n jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 0, Short.MAX_VALUE)\n );\n jPanel4Layout.setVerticalGroup(\n jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 418, Short.MAX_VALUE)\n );\n\n org.openide.awt.Mnemonics.setLocalizedText(jCheckBox2, org.openide.util.NbBundle.getMessage(TestFileTopComponent.class, \"TestFileTopComponent.jCheckBox2.text\")); // NOI18N\n jCheckBox2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jCheckBox2ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jCheckBox1)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 327, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton1))\n .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 320, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 320, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jLabel1)\n .addGap(0, 0, Short.MAX_VALUE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 327, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton2))\n .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, 398, Short.MAX_VALUE)))\n .addGroup(layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(jCheckBox2)))\n .addGap(22, 22, 22))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jButton2))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 13, Short.MAX_VALUE)\n .addComponent(jCheckBox2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 239, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jButton1)\n .addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel1))\n .addGap(9, 9, 9)\n .addComponent(jCheckBox1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(26, 26, 26)\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 232, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(0, 0, Short.MAX_VALUE)))))\n .addContainerGap())\n );\n }", "public void cargarTabla(String servidor){\n String base_de_datos1=cbBaseDeDatos.getSelectedItem().toString();\n String sql =\"USE [\"+base_de_datos1+\"]\\n\" +\n \"SELECT name FROM sysobjects where xtype='U' and category <> 2\";\n // JOptionPane.showMessageDialog(null,\"SQL cargarbases \"+sql);\n Conexion cc = new Conexion();\n Connection cn=cc.conectarBase(servidor, base_de_datos1);\n modeloTabla=new DefaultTableModel();\n String fila[]=new String[1] ;\n String[] titulos={\"Tablas\"} ;\n try {\n Statement psd = cn.createStatement();\n ResultSet rs=psd.executeQuery(sql);\n if(modeloTabla.getColumnCount()<2){\n modeloTabla.addColumn(titulos[0]);\n //modeloTabla.addColumn(titulos[1]);\n }\n while(rs.next()){\n fila[0]=rs.getString(\"name\");\n // fila[1]=\"1\";\n modeloTabla.addRow(fila);\n }\n tblTablas.setModel(modeloTabla);\n }catch(Exception ex){\n JOptionPane.showMessageDialog(null, ex+\" al cargar tabla\");\n }\n }", "public void displayToFile(){\n String data = \"\";\n try{\n FileWriter fstream = new FileWriter(\"output.txt\", true);\n BufferedWriter out = new BufferedWriter(fstream);\n\n for (int i=0 ; i<40; i++) {\n for (int j=0; j<146 ;j++ ){\n if (board.getCharacter(j,i) == '0') {\n data += '-';\n } else {\n data += board.getCharacter(j,i);\n }\n }\n out.write(data);\n data = \"\";\n }\t\n out.close();\n } catch (Exception e){\n System.err.println(\"Error: \" + e.getMessage());\n }\n }", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tString cmd = e.getActionCommand();\n\t\tFile file;\n\t\tfile = jfc.getSelectedFile();\n\t\tswitch (cmd) {\n\t\tcase \"저장\":\n\t\t\tsaveFile();\n\t\t\tbreak;\n\t\tcase \"열기\":\n\t\t\t\n\t\t\topenFile();\n\t\t\t\n\t\t\tbreak;\n\t\tcase \"새파일\":\n\t\t\tjta.setText(\"\");\n\t\t\tbreak;\n\t\tcase \"종료\":\n\t\t\tSystem.exit(0);\n\t\t\tbreak;\n\t\t}\n\t\t/*if(cmd.equals(\"저장\"))\n\t\t{\n\t\ttry {\n\t\t\tFileWriter fw = new FileWriter(\"c:/output/notepad.txt\");\n\t\t\tfw.write(jta.getText());\n\t\t\tfw.close();\n\t\t\tSystem.out.println(\"파일을 생성하였습니다\");\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\t}\n\t\t*/\n\t}", "public void preenchercomlike(){\n \n \n javax.swing.table.DefaultTableModel dtm4 = (javax.swing.table.DefaultTableModel)jtablearquivos.getModel(); \n dtm4.setNumRows(0); \n \n int k=0;\n try{\n conexao.Conectar();\n conexao.sql = \"SELECT data,nomefile FROM arquivo WHERE nomefile LIKE ? \";\n conexao.ps = conexao.con.prepareStatement(conexao.sql); \n ps.setString(1,\"%\"+jTextField2.getText()+\"%\");\n conexao.rs = conexao.ps.executeQuery();\n \n \n \n while(conexao.rs.next())\n {\n \n dtm4.addRow(new Object[]{\" \",\" \",\" \"}); \n jtablearquivos.setValueAt(conexao.rs.getString(1),k,0); \n jtablearquivos.setValueAt(conexao.rs.getString(2),k,1); \n k++;\n }\n \n \n }catch(SQLException ex){\n JOptionPane.showMessageDialog(rootPane, ex.getMessage(), \"Erro ao popular tabelas!\", JOptionPane.ERROR_MESSAGE);\n }\n \n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\tfinal JFileChooser fc = new JFileChooser();\r\n\t\t\t\t\r\n\t\t\t\tif(currentDirectory != null) fc.setCurrentDirectory(currentDirectory);\r\n\t\t\t\t\r\n\t\t\t\t//In response to a button click:\r\n\t\t\t\tint returnVal = fc.showOpenDialog(null);\r\n\t\t\t\tcurrentDirectory = fc.getCurrentDirectory();\r\n\t\t\t\t\r\n\t\t if (returnVal == JFileChooser.APPROVE_OPTION) {\t\t \t\r\n\t\t \tList<String> lines = null;\r\n\t\t File file = fc.getSelectedFile();\r\n\t\t Path path = Paths.get(file.getAbsolutePath());\r\n\t\t int loopLength = antennaArray.position.length;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tlines = Files.readAllLines(path, StandardCharsets.UTF_8);\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(lines.size() < antennaArray.position.length) {\r\n\t\t\t\t\t\t\tint difference = antennaArray.position.length - lines.size();\r\n\t\t\t\t\t\t\tfor(int addition = 0; addition < difference; addition++)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tlines.add(\"0\");\r\n\t\t\t\t\t\t\t}\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\tfor (int conversion = 0; conversion < loopLength; conversion++) {\r\n\t\t\t\t\t\t\tdouble positionFromFile = 0;\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\tpositionFromFile = Double.parseDouble(lines.get(conversion));\r\n\t\t\t\t\t\t\t} catch (NumberFormatException ex) {\r\n\t\t\t\t\t\t\t\tpositionFromFile = 0;\r\n\t\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\tantennaArray.position[conversion] = positionFromFile;\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\trefreshPositionTable();\r\n\t\t\t\t\t\tdrawPlotWithInitialParameterValues();\t\t\t\t\t\t\r\n\t\t\t\t\t} catch (IOException ex) {\r\n\t\t\t\t\t\tex.printStackTrace();\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t } else {\r\n\t\t // Cancelled by the user.\r\n\t\t }\r\n\t\t\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tString s=e.getActionCommand();\r\n\t\r\n\t\tif(s.equalsIgnoreCase(\"open\"))\r\n\t\t{\r\n\t\t\ttry\r\n\t\t\r\n\t\t{\r\n\t\t\tstr=\"\";msg=\"\";\r\n\t\t\tFileDialog fd=new FileDialog(this,\"openfile\",FileDialog.LOAD);\r\n\t\t//to be added\r\n\t\t\tfd.setVisible(true);\r\n\t\t\tdir=fd.getDirectory();\r\n\t\t\t//path is got by directory\r\n\t\t\tfname=fd.getFile();\r\n\t\t\t//fname will get the name of the file so together we get teh full location\r\n\t\t\tFileInputStream fis=new FileInputStream(dir+fname);\r\n\t\t\t//file inputstream reader class obj is fis \r\n\t\t\tDataInputStream dis=new DataInputStream(fis);\r\n\t\t\t//here input it to datastream reader it is must\r\n\t\t\tstr=dis.readLine();\r\n\t\t\twhile(str!=null)\r\n\t\t\t{\r\n\t\t\t\tmsg=msg+str+\"\\n\";\r\n\t\t\t\tstr=dis.readLine();\r\n\t\t\t}\r\n\t\t\tta1.setText(msg);\r\n\t\t\tdis.close();\r\n\t\t\tfis.close();\r\n\t\t}\r\n\t\tcatch(Exception a)\r\n\t\t{\r\n\t\t\ta.printStackTrace();\r\n\t\t}\r\n\t\r\n\t\t}\r\n\t\tif(s.equalsIgnoreCase(\"save\"))\r\n\t\t{\ttry\r\n\t\t{\r\n\t\t\tFileDialog fd=new FileDialog(this,\"savefile\",FileDialog.SAVE);\r\n\t\t//to be added\r\n\t\t\tfd.setVisible(true);\r\n\t\t\ttxt=ta1.getText();\r\n\t\t\tdir=fd.getDirectory();\r\n\t\t\t//path is got by directory\r\n\t\t\tfname=fd.getFile();\r\n\t\t\t//fname will get the name of the file so together we get teh full location\r\n\t\t\tFileOutputStream fis=new FileOutputStream(dir+fname);\r\n\t\t\t//file inputstream reader class obj is fis \r\n\t\t\tDataOutputStream dis=new DataOutputStream(fis);\r\n\t\t\t//here input it to datastream reader it is must\r\n\t\t\t//str=dis.readLine();\r\n\t\t\t/*while(str!=null)\r\n\t\t\t{\r\n\t\t\t\tmsg=msg+str+\"\\n\";\r\n\t\t\t\tstr=dis.readLine();\r\n\t\t\t}\r\n\t\t\tta1.setText(msg);*/\r\n\t\t\tdis.writeBytes(txt);\r\n\t\t\tdis.close();\r\n\t\t\tfis.close();\r\n\t\t}\r\n\t\tcatch(Exception a)\r\n\t\t{\r\n\t\t\ta.printStackTrace();\r\n\t\t}\r\n\t\r\n\r\n\t\t}\r\n\t\r\n\tif (s.equalsIgnoreCase(\"cut\"))\r\n\t{\r\n\t\tmsg=ta1.getSelectedText();\r\n\t\tif(msg==null)\r\n\t\t\tJOptionPane.showMessageDialog(this,\"select text\");\r\n\t\telse\r\n\t\t\tta1.replaceRange(\"\", ta1.getSelectionStart(), ta1.getSelectionEnd());\r\n\t\t\t\t\r\n\t}\r\n\r\n\tif (s.equalsIgnoreCase(\"copy\"))\r\n\t{\r\n\t\tmsg=ta1.getSelectedText();\r\n\t\tif(msg==null)\r\n\t\t\tJOptionPane.showMessageDialog(this,\"select text\");\r\n\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t}\r\n\t\r\n\tif (s.equalsIgnoreCase(\"paste\"))\r\n\t{\r\n\t\t\r\n\t\tta1.replaceRange(msg, ta1.getSelectionStart(), ta1.getSelectionEnd());\r\n\t\t\t\r\n\t\t\t\t\r\n\t}\r\n\t\r\n\t\r\n}", "public JComponent getContentComponent() {\r\n JPanel panel = new JPanel();\r\n panel.setBackground(Color.white);\r\n GridBagConstraints constraints = new GridBagConstraints();\r\n GridBagLayout gridbag = new GridBagLayout();\r\n panel.setLayout(gridbag);\r\n constraints.fill = GridBagConstraints.HORIZONTAL;\r\n constraints.anchor = GridBagConstraints.NORTH;\r\n buildConstraints(constraints, 0, 0, 1, 1, 100, 100);\r\n gridbag.setConstraints(pAndRValuesTable, constraints);\r\n panel.add(pAndRValuesTable);\r\n \r\n final JFileChooser fc = new JFileChooser(TMEV.getDataPath());\r\n fc.setDialogTitle(\"Save p and R values\");\r\n \r\n popup = new JPopupMenu();\r\n JMenuItem menuItem = new JMenuItem(\"Save p and R values\", GUIFactory.getIcon(\"save16.gif\"));\r\n menuItem.addActionListener(new ActionListener() {\r\n public void actionPerformed(ActionEvent evt) {\r\n int returnVal = fc.showSaveDialog(PTMGeneStatsTableViewer.this.getHeaderComponent());\r\n if (returnVal == JFileChooser.APPROVE_OPTION) {\r\n File file = fc.getSelectedFile();\r\n try {\r\n PrintWriter out = new PrintWriter(new FileOutputStream(file));\r\n for (int i = 0; i < fieldNames.length; i++) {\r\n out.print(fieldNames[i]);\r\n if (i < fieldNames.length - 1) {\r\n \r\n out.print(\"\\t\");\r\n }\r\n }\r\n //System.out.println(\"auxTitles.length = \" + auxTitles.length);\r\n for (int i = 0; i < auxTitles.length; i++) {\r\n out.print(\"\\t\" + auxTitles[i]);\r\n //System.out.println(auxTitles[i]);\r\n /*\r\n if (i < auxTitles.length - 1) {\r\n out.print(\"\\t\");\r\n }\r\n */\r\n }\r\n out.print(\"\\n\");\r\n \r\n //if (tTestDesign == TtestInitDialog.BETWEEN_SUBJECTS) {\r\n //out.print(\"\\tGroupA mean\\tGroupA std.dev.\\tGroupB mean\\tGroupB std.dev.\\tt-ratio\\tdf\\tp-value\\n\");\r\n //} else if (tTestDesign == TtestInitDialog.ONE_CLASS) {\r\n //out.print(\"\\tGene mean\\tGene std.dev.\\tt-ratio\\tdf\\tp-value\\n\");\r\n //}\r\n for (int i = 0; i < rows.length; i++) {\r\n for (int k = 0; k < fieldNames.length; k++) {\r\n out.print(data.getElementAttribute(experiment.getGeneIndexMappedToData(rows[i]), k));\r\n if (k < fieldNames.length - 1) {\r\n out.print(\"\\t\");\r\n }\r\n }\r\n for (int j = 0; j < auxData[rows[i]].length; j++) {\r\n out.print(\"\\t\" + ((Float)(auxData[rows[i]][j])).floatValue());\r\n }\r\n /*\r\n if (tTestDesign == TtestInitDialog.BETWEEN_SUBJECTS) {\r\n out.print(\"\\t\" + ((Float)(meansA.get(rows[i]))).floatValue());\r\n out.print(\"\\t\" + ((Float)(sdA.get(rows[i]))).floatValue());\r\n out.print(\"\\t\" + ((Float)(meansB.get(rows[i]))).floatValue());\r\n out.print(\"\\t\" + ((Float)(sdB.get(rows[i]))).floatValue());\r\n } else if (tTestDesign == TtestInitDialog.ONE_CLASS) {\r\n out.print(\"\\t\" + ((Float)(oneClassMeans.get(rows[i]))).floatValue());\r\n out.print(\"\\t\" + ((Float)(oneClassSDs.get(rows[i]))).floatValue()); \r\n }\r\n out.print(\"\\t\" + ((Float)(tValues.get(rows[i]))).floatValue());\r\n out.print(\"\\t\" + ((Float)(dfValues.get(rows[i]))).intValue());\r\n out.print(\"\\t\" + ((Float)(pValues.get(rows[i]))).floatValue());\r\n */\r\n out.print(\"\\n\");\r\n \r\n }\r\n out.println();\r\n out.flush();\r\n out.close();\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n //this is where a real application would save the file.\r\n //log.append(\"Saving: \" + file.getName() + \".\" + newline);\r\n } else {\r\n //log.append(\"Save command cancelled by user.\" + newline);\r\n }\r\n }\r\n });\r\n \r\n popup.add(menuItem);\r\n \r\n pAndRValuesTable.addMouseListener(new MouseAdapter() {\r\n public void mousePressed(MouseEvent e) {\r\n maybeShowPopup(e);\r\n }\r\n \r\n public void mouseReleased(MouseEvent e) {\r\n maybeShowPopup(e);\r\n }\r\n \r\n private void maybeShowPopup(MouseEvent e) {\r\n if (e.isPopupTrigger()) {\r\n popup.show(e.getComponent(),\r\n e.getX(), e.getY());\r\n }\r\n }\r\n \r\n });\r\n \r\n return panel;\r\n //return tValuesTable;\r\n //return content;\r\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n jMenuBar1 = new javax.swing.JMenuBar();\n jMenu1 = new javax.swing.JMenu();\n jMenu2 = new javax.swing.JMenu();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jPanel1.setLayout(new java.awt.BorderLayout());\n\n jTable1.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(jTable1);\n\n jPanel1.add(jScrollPane1, java.awt.BorderLayout.CENTER);\n\n getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);\n\n jMenu1.setText(\"File\");\n jMenuBar1.add(jMenu1);\n\n jMenu2.setText(\"Edit\");\n jMenuBar1.add(jMenu2);\n\n setJMenuBar(jMenuBar1);\n\n pack();\n }", "public void llenadoDeTablas() {\n \n DefaultTableModel modelo1 = new DefaultTableModel();\n modelo1 = new DefaultTableModel();\n modelo1.addColumn(\"ID Usuario\");\n modelo1.addColumn(\"NOMBRE\");\n UsuarioDAO asignaciondao = new UsuarioDAO();\n List<Usuario> asignaciones = asignaciondao.select();\n TablaPerfiles.setModel(modelo1);\n String[] dato = new String[2];\n for (int i = 0; i < asignaciones.size(); i++) {\n dato[0] = (Integer.toString(asignaciones.get(i).getId_usuario()));\n dato[1] = asignaciones.get(i).getNombre_usuario();\n\n modelo1.addRow(dato);\n }\n }", "private void save()\n {\n String saveFile = FileBrowser.chooseFile( false );\n try{\n PrintWriter output = new PrintWriter( new File( saveFile ) );\n \n output.println( numRows + \" \" + numCols );\n\n for( int r=0; r<numRows; r++ )\n output.println( rowLabels[r] );\n\n for( int c=0; c<numCols; c++ )\n output.println( colLabels[c] );\n\n for( int r=0; r<numRows; r++ )\n {\n for( int c=0; c<numCols; c++ )\n output.print( a[r][c] + \" \" );\n output.println();\n }\n output.close();\n }\n catch(Exception e)\n {\n System.out.println(\"Uh-oh, save failed for some reason\");\n e.printStackTrace();\n }\n }", "@SuppressWarnings(\"unchecked\")\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\"> \r\n private void initComponents() {\r\n \t//UI design\r\n contentPane = new javax.swing.JPanel();\r\n pane_fileState = new javax.swing.JPanel();\r\n lab_fileState = new javax.swing.JLabel();\r\n lab_android = new javax.swing.JLabel();\r\n lab_moodle = new javax.swing.JLabel();\r\n pane_graphic = new javax.swing.JPanel();\r\n combox_graphic = new javax.swing.JComboBox();\r\n lab_graphic = new javax.swing.JLabel();\r\n btn_view = new javax.swing.JButton();\r\n ck_ip = new javax.swing.JCheckBox();\r\n ck_bt = new javax.swing.JCheckBox();\r\n ck_st = new javax.swing.JCheckBox();\r\n btn_viewimage = new javax.swing.JButton();\r\n pane_buttons = new javax.swing.JPanel();\r\n btn_readFile = new javax.swing.JButton();\r\n btn_export = new javax.swing.JButton();\r\n btn_clear = new javax.swing.JButton();\r\n btn_exit = new javax.swing.JButton();\r\n pane_canvas = new javax.swing.JScrollPane();\r\n pane_fileList = new javax.swing.JScrollPane();\r\n animetable = new javax.swing.JTable();\r\n topMenuBar = new javax.swing.JMenuBar();\r\n topMenu_1 = new javax.swing.JMenu();\r\n tpm1_menuItem2 = new javax.swing.JMenu();\r\n\r\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\r\n\r\n pane_fileState.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));\r\n\r\n lab_fileState.setText(\"File State\");\r\n\r\n lab_android.setText(\"Android Read In\");\r\n\r\n lab_moodle.setText(\"Moodle Read In\");\r\n\r\n javax.swing.GroupLayout pane_fileStateLayout = new javax.swing.GroupLayout(pane_fileState);\r\n pane_fileState.setLayout(pane_fileStateLayout);\r\n pane_fileStateLayout.setHorizontalGroup(\r\n pane_fileStateLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(pane_fileStateLayout.createSequentialGroup()\r\n .addGap(32, 32, 32)\r\n .addGroup(pane_fileStateLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\r\n .addComponent(lab_fileState, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\r\n .addComponent(lab_android, javax.swing.GroupLayout.DEFAULT_SIZE, 99, Short.MAX_VALUE)\r\n .addComponent(lab_moodle, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\r\n .addContainerGap(27, Short.MAX_VALUE))\r\n );\r\n pane_fileStateLayout.setVerticalGroup(\r\n pane_fileStateLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(pane_fileStateLayout.createSequentialGroup()\r\n .addContainerGap()\r\n .addComponent(lab_fileState, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\r\n .addComponent(lab_android, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\r\n .addComponent(lab_moodle, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\r\n );\r\n\r\n pane_graphic.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));\r\n\r\n combox_graphic.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Log\", \"User\", \"Webpage\", \"User Act\"}));\r\n combox_graphic.addItemListener(new java.awt.event.ItemListener() {\r\n public void itemStateChanged(java.awt.event.ItemEvent evt) {\r\n combox_graphicItemStateChanged(evt);\r\n }\r\n });\r\n\r\n lab_graphic.setText(\"Choose display option\");\r\n\r\n btn_view.setText(\"View Table\");\r\n btn_view.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n btn_viewMouseClicked(evt);\r\n }\r\n });\r\n\r\n ck_ip.setText(\"IP\");\r\n\r\n ck_bt.setText(\"Browser type\");\r\n\r\n ck_st.setText(\"System type\");\r\n\r\n btn_viewimage.setText(\"View Image\");\r\n btn_viewimage.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n btn_viewimageMouseClicked(evt);\r\n }\r\n });\r\n\r\n javax.swing.GroupLayout pane_graphicLayout = new javax.swing.GroupLayout(pane_graphic);\r\n pane_graphic.setLayout(pane_graphicLayout);\r\n pane_graphicLayout.setHorizontalGroup(\r\n pane_graphicLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(pane_graphicLayout.createSequentialGroup()\r\n .addGap(23, 23, 23)\r\n .addGroup(pane_graphicLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\r\n .addComponent(combox_graphic, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\r\n .addComponent(lab_graphic, javax.swing.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE))\r\n .addGroup(pane_graphicLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(pane_graphicLayout.createSequentialGroup()\r\n .addGap(44, 44, 44)\r\n .addComponent(ck_ip)\r\n .addGap(55, 55, 55)\r\n .addComponent(ck_bt)\r\n .addGap(18, 18, 18)\r\n .addComponent(ck_st)\r\n .addContainerGap(64, Short.MAX_VALUE))\r\n .addGroup(pane_graphicLayout.createSequentialGroup()\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\r\n .addComponent(btn_viewimage, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addGap(42, 42, 42)\r\n .addComponent(btn_view, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addGap(85, 85, 85))))\r\n );\r\n pane_graphicLayout.setVerticalGroup(\r\n pane_graphicLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(pane_graphicLayout.createSequentialGroup()\r\n .addGap(32, 32, 32)\r\n .addGroup(pane_graphicLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(pane_graphicLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\r\n .addComponent(ck_bt)\r\n .addComponent(ck_st)\r\n .addComponent(ck_ip))\r\n .addComponent(lab_graphic, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))\r\n .addGap(18, 18, 18)\r\n .addGroup(pane_graphicLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addComponent(combox_graphic, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addGroup(pane_graphicLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\r\n .addComponent(btn_viewimage, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addComponent(btn_view, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)))\r\n .addContainerGap(18, Short.MAX_VALUE))\r\n );\r\n\r\n pane_buttons.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));\r\n\r\n btn_readFile.setText(\"Read Files\");\r\n btn_readFile.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n btn_readFileMouseClicked(evt);\r\n }\r\n });\r\n\r\n btn_export.setText(\"Export\");\r\n btn_export.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n btn_exportMouseClicked(evt);\r\n }\r\n });\r\n\r\n btn_clear.setText(\"Clear Data\");\r\n btn_clear.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n btn_clearMouseClicked(evt);\r\n }\r\n });\r\n\r\n btn_exit.setText(\"Exit\");\r\n btn_exit.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n btn_exitMouseClicked(evt);\r\n }\r\n });\r\n\r\n javax.swing.GroupLayout pane_buttonsLayout = new javax.swing.GroupLayout(pane_buttons);\r\n pane_buttons.setLayout(pane_buttonsLayout);\r\n pane_buttonsLayout.setHorizontalGroup(\r\n pane_buttonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(pane_buttonsLayout.createSequentialGroup()\r\n .addContainerGap()\r\n .addGroup(pane_buttonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\r\n .addComponent(btn_export, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\r\n .addComponent(btn_readFile, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\r\n .addGap(18, 28, Short.MAX_VALUE)\r\n .addGroup(pane_buttonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\r\n .addComponent(btn_clear, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\r\n .addComponent(btn_exit, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\r\n .addContainerGap())\r\n );\r\n pane_buttonsLayout.setVerticalGroup(\r\n pane_buttonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(pane_buttonsLayout.createSequentialGroup()\r\n .addGap(29, 29, 29)\r\n .addGroup(pane_buttonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\r\n .addComponent(btn_clear, javax.swing.GroupLayout.DEFAULT_SIZE, 40, Short.MAX_VALUE)\r\n .addComponent(btn_readFile, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\r\n .addGap(18, 18, 18)\r\n .addGroup(pane_buttonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\r\n .addComponent(btn_export, javax.swing.GroupLayout.DEFAULT_SIZE, 40, Short.MAX_VALUE)\r\n .addComponent(btn_exit, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\r\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\r\n );\r\n\r\n pane_canvas.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));\r\n\r\n animetable.setModel(new javax.swing.table.DefaultTableModel(\r\n new Object [][] {\r\n {},\r\n {},\r\n {},\r\n {}\r\n },\r\n new String [] {\r\n\r\n }\r\n ));\r\n \r\n pane_fileList.setViewportView(animetable);\r\n\r\n javax.swing.GroupLayout contentPaneLayout = new javax.swing.GroupLayout(contentPane);\r\n contentPane.setLayout(contentPaneLayout);\r\n contentPaneLayout.setHorizontalGroup(\r\n contentPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(contentPaneLayout.createSequentialGroup()\r\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\r\n .addGroup(contentPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\r\n .addComponent(pane_fileList, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)\r\n .addComponent(pane_fileState, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\r\n .addGap(6, 6, 6)\r\n .addGroup(contentPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\r\n .addGroup(contentPaneLayout.createSequentialGroup()\r\n .addComponent(pane_graphic, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\r\n .addComponent(pane_buttons, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addGap(8, 8, 8))\r\n .addGroup(contentPaneLayout.createSequentialGroup()\r\n .addComponent(pane_canvas)\r\n .addContainerGap())))\r\n );\r\n contentPaneLayout.setVerticalGroup(\r\n contentPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()\r\n .addGroup(contentPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addComponent(pane_canvas, javax.swing.GroupLayout.PREFERRED_SIZE, 330, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addComponent(pane_fileList, javax.swing.GroupLayout.PREFERRED_SIZE, 330, javax.swing.GroupLayout.PREFERRED_SIZE))\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\r\n .addGroup(contentPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\r\n .addComponent(pane_graphic, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\r\n .addComponent(pane_fileState, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\r\n .addComponent(pane_buttons, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\r\n .addContainerGap())\r\n );\r\n\r\n topMenu_1.setText(\"File\");\r\n\r\n tpm1_menuItem2.setText(\"Exit\");\r\n tpm1_menuItem2.addMouseListener(new java.awt.event.MouseAdapter() {\r\n public void mouseClicked(java.awt.event.MouseEvent evt) {\r\n tpm1_menuItem2MouseClicked(evt);\r\n }\r\n });\r\n topMenu_1.add(tpm1_menuItem2);\r\n\r\n topMenuBar.add(topMenu_1);\r\n\r\n setJMenuBar(topMenuBar);\r\n\r\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\r\n getContentPane().setLayout(layout);\r\n layout.setHorizontalGroup(\r\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addComponent(contentPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n );\r\n layout.setVerticalGroup(\r\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addComponent(contentPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n );\r\n\r\n pack();\r\n }", "public ExibeTarefas() {\n initComponents();\n DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel();\n jTable1.setRowSorter(new TableRowSorter(modelo));\n readJTable();\n readItemBox();\n }", "private void ReadTextFile(String FilePath) {\n\t\t\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\"> \n private void initComponents() {\n\n jMenuItem1 = new javax.swing.JMenuItem();\n jMenu3 = new javax.swing.JMenu();\n jSeparator1 = new javax.swing.JSeparator();\n jFileChooser1 = new javax.swing.JFileChooser();\n jScrollPane2 = new javax.swing.JScrollPane();\n jTable2 = new javax.swing.JTable();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n jScrollPane3 = new javax.swing.JScrollPane();\n jTable3 = new javax.swing.JTable();\n jScrollPane4 = new javax.swing.JScrollPane();\n jTable4 = new javax.swing.JTable();\n jScrollPane5 = new javax.swing.JScrollPane();\n jTable5 = new javax.swing.JTable();\n button1 = new java.awt.Button();\n jMenuBar1 = new javax.swing.JMenuBar();\n jMenu1 = new javax.swing.JMenu();\n jMenuItem2 = new javax.swing.JMenuItem();\n jMenu2 = new javax.swing.JMenu();\n\n jMenuItem1.setText(\"jMenuItem1\");\n\n jMenu3.setText(\"jMenu3\");\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jTable2.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {\"\", null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null}\n },\n new String [] {\n \"Linha\", \"Instrução\", \"Atributo #1\", \"Atributo #2\", \"Comentário\"\n }\n ));\n jScrollPane2.setViewportView(jTable2);\n\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null},\n {null, null},\n {null, null},\n {null, null},\n {null, null},\n {null, null},\n {null, null},\n {null, null},\n {null, null}\n },\n new String [] {\n \"Endereço\", \"Valor\"\n }\n ));\n jScrollPane1.setViewportView(jTable1);\n\n jTable3.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null},\n {null},\n {null},\n {null}\n },\n new String [] {\n \"Break Points\"\n }\n ));\n jScrollPane3.setViewportView(jTable3);\n\n jTable4.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null},\n {null},\n {null},\n {null}\n },\n new String [] {\n \"Janela de entrada\"\n }\n ));\n jScrollPane4.setViewportView(jTable4);\n\n jTable5.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null},\n {null},\n {null},\n {null}\n },\n new String [] {\n \"Janela de Saída\"\n }\n ));\n jScrollPane5.setViewportView(jTable5);\n\n button1.setLabel(\"Continuar\");\n button1.setName(\"button1\"); // NOI18N\n button1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n button1ActionPerformed(evt);\n }\n });\n\n jMenu1.setText(\"File\");\n\n jMenuItem2.setLabel(\"Selecionar Arquivo\");\n jMenuItem2.setName(\"\"); // NOI18N\n jMenuItem2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItem2ActionPerformed(evt);\n }\n });\n jMenu1.add(jMenuItem2);\n\n jMenuBar1.add(jMenu1);\n\n jMenu2.setText(\"Executar\");\n jMenuBar1.add(jMenu2);\n\n setJMenuBar(jMenuBar1);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 227, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(36, 36, 36)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 227, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 569, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGap(210, 210, 210)\n .addComponent(button1, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 237, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 515, Short.MAX_VALUE)))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 172, Short.MAX_VALUE)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))\n .addGap(37, 37, 37)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(19, 19, 19)\n .addComponent(button1, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(29, Short.MAX_VALUE))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(208, 208, 208)\n .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(73, Short.MAX_VALUE)))\n );\n\n button1.getAccessibleContext().setAccessibleName(\"button1\");\n button1.getAccessibleContext().setAccessibleDescription(\"\");\n\n pack();\n }", "public void toFile (String nameFile)\n {\n //definir dados\n int i, j;\n int lin;\n int col;\n FILE arquivo;\n\n //obter dimensoes\n lin = lines();\n col = columns();\n\n //verificar se as dimensoes sao validas\n if( lin <= 0 || col <= 0 )\n {\n IO.println(\"ERRO: Tamanho(s) invalido(s). \");\n } //end\n else\n {\n //verificar se tabela e' valida\n if( table == null )\n {\n IO.println(\"ERRO: Matriz invalida. \" );\n } //end\n else\n {\n arquivo = new FILE(FILE.OUTPUT, nameFile);\n arquivo.println(\"\"+ lin);\n arquivo.println(\"\"+ col);\n\n //pecorre para preencher a matriz\n for( i = 0; i < lin; i++)\n {\n for(j = 0; j < col; j++)\n {\n arquivo.println(\"\" + table[ i ][ j ]);\n } //end repetir\n } //end repetir\n //fechar arquivo (indispensavel)\n arquivo.close();\n } //end se\n } //end se\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n _FileChooser = new javax.swing.JFileChooser();\n jPanel1 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n _tfTenSinhVien = new javax.swing.JTextField();\n _tfNgaySinh = new javax.swing.JTextField();\n _tfMaSinhVien = new javax.swing.JTextField();\n jLabel5 = new javax.swing.JLabel();\n _btLuu = new javax.swing.JButton();\n _btSua = new javax.swing.JButton();\n _btThem = new javax.swing.JButton();\n _btXoa = new javax.swing.JButton();\n jPanel2 = new javax.swing.JPanel();\n jLabel6 = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n _tbleDanhSachSinhVien = new javax.swing.JTable();\n _btMoFile = new javax.swing.JButton();\n _btLuuFile = new javax.swing.JButton();\n _btThoat = new javax.swing.JButton();\n _btHuy = new javax.swing.JButton();\n\n _FileChooser.setDialogTitle(\"\");\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n\n jLabel1.setText(\"Thông tin sinh viên\");\n\n jLabel2.setText(\"Mã sinh viên:\");\n\n jLabel3.setText(\"Tên sinh viên:\");\n\n jLabel4.setText(\"Ngày sinh:\");\n\n jLabel5.setText(\"(MM/dd/yyyy)\");\n\n _btLuu.setText(\"Lưu\");\n _btLuu.setEnabled(false);\n _btLuu.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n _btLuuActionPerformed(evt);\n }\n });\n\n _btSua.setText(\"Sửa\");\n _btSua.setEnabled(false);\n _btSua.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n _btSuaActionPerformed(evt);\n }\n });\n\n _btThem.setText(\"Thêm\");\n _btThem.setEnabled(false);\n _btThem.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n _btThemActionPerformed(evt);\n }\n });\n\n _btXoa.setText(\"Xóa\");\n _btXoa.setEnabled(false);\n _btXoa.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n _btXoaActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(jLabel4)\n .addComponent(jLabel2))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(_tfMaSinhVien, javax.swing.GroupLayout.PREFERRED_SIZE, 217, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(_tfTenSinhVien, javax.swing.GroupLayout.PREFERRED_SIZE, 217, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(_tfNgaySinh, javax.swing.GroupLayout.PREFERRED_SIZE, 252, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel5))))))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(77, 77, 77)\n .addComponent(_btThem, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(_btLuu, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(_btSua, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(_btXoa, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(_tfMaSinhVien, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(_tfTenSinhVien, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(_tfNgaySinh, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(_btLuu, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE)\n .addComponent(_btSua, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE)\n .addComponent(_btThem, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE)\n .addComponent(_btXoa, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE))\n .addContainerGap())\n );\n\n jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n\n jLabel6.setText(\"Danh sách sinh viên\");\n\n _tbleDanhSachSinhVien.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Mã sinh viên\", \"Tên sinh viên\", \"Ngày sinh\"\n }\n ));\n jScrollPane1.setViewportView(_tbleDanhSachSinhVien);\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addComponent(jLabel6)\n .addGap(0, 0, Short.MAX_VALUE))\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 566, Short.MAX_VALUE))\n .addContainerGap())\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addComponent(jLabel6)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 152, Short.MAX_VALUE)\n .addContainerGap())\n );\n\n _btMoFile.setText(\"File\");\n _btMoFile.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n _btMoFileActionPerformed(evt);\n }\n });\n\n _btLuuFile.setText(\"CSDL\");\n _btLuuFile.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n _btLuuFileActionPerformed(evt);\n }\n });\n\n _btThoat.setText(\"Thoát\");\n _btThoat.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n _btThoatActionPerformed(evt);\n }\n });\n\n _btHuy.setText(\"Hủy\");\n _btHuy.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n _btHuyActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(26, 26, 26)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(_btMoFile, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(_btLuuFile, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(22, 22, 22)\n .addComponent(_btHuy, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(226, 226, 226)\n .addComponent(_btThoat, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))\n .addContainerGap(24, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(21, 21, 21)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(_btMoFile, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(_btLuuFile, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(_btThoat, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(_btHuy, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap())\n );\n\n pack();\n }", "private void initComponent() {\n\t\t// Create Table Model (rows, columns...)\n\t\ttableur = new DefaultTableModel();\n\t\t// Add title column\n\t\ttableur.addColumn(fileNumber);\n\t\ttableur.addColumn(fileName);\n\t\ttableur.addColumn(\"\");\n\t\t// Add line of Action History with NodeStructureDTO\n\t\twhile(rootNode != null){\n\t\t\ttableur.addRow(new Object[] {rootNode.getId() , rootNode.getCompletePath()});\n\t\t\trootNode = rootNode.getNextNode();\n\t\t}\n\t\t//Create JTable \n\t\ttableHistory = new JTable(tableur);\n\t\t//Change the renderer of third cells whith grey font \n\t\ttableHistory.getColumn(\"\").setCellRenderer(new ButtonRenderer());\n\t\t//Make a CheckBox in this cell\n\t\ttableHistory.getColumn(\"\").setCellEditor(new ButtonEditor(new JCheckBox()));\n\t\t//Block reordering\n\t\ttableHistory.getTableHeader().setReorderingAllowed(false);\n\t\ttableHistory.setPreferredScrollableViewportSize(new Dimension(600 , 400));\n\t\tadd(new JScrollPane(tableHistory) , BorderLayout.CENTER);\n\t}", "private void openMenuActionPerformed(java.awt.event.ActionEvent evt) {\n \n \n \n String[] colunas = new String[]{\"Linha\",\"Instrução\",\"Atributo 1\",\"Atributo 2\",\"Comentário\"};\n \n int returnVal = escolherArquivo.showOpenDialog(this);\n if (returnVal == JFileChooser.APPROVE_OPTION) {\n File file = escolherArquivo.getSelectedFile();\n\n try {\n FileReader arq = new FileReader(file);\n BufferedReader lerArq = new BufferedReader(arq);\n\n \n\n lerArq.mark(50000);\n\n LineNumberReader lnr = new LineNumberReader(lerArq);\n lnr.skip(Long.MAX_VALUE);\n int retorno = lnr.getLineNumber();\n int caractere=0;\n Character character;\n \n String linhas[][] = new String[retorno + 2][5];\n String count = \"\";\n String linha;\n \n lerArq.reset();\n int cont = 0;\n caractere=proximoCaractere(lerArq);\n \n while (caractere != -1) {\n linha = \"\";\n \n while(Character.isLetterOrDigit(((char)caractere))){\n linha+=(char)caractere;\n caractere=proximoCaractere(lerArq);\n //System.out.println((char)caractere);\n }\n \n if(linha.equals(\"\\n\")){\n caractere=proximoCaractere(lerArq); \n cont++; \n //System.out.println(\"contador\"+cont);\n }\n if(linha.equals(\"NULL\"))\n {\n linhas[cont][2] = linha;\n }\n else{\n linhas[cont][1] = linha;\n //System.out.println(linha);\n }\n \n if(linha.equals(\"ALLOC\") || linha.equals(\"DALLOC\")) // verificacao pra ver se o comando é alloc ou dalloc pq esse comando precisa de 2 atributos\n { linha=\"\";\n \n while((char)caractere==' ')\n caractere=proximoCaractere(lerArq);\n \n if(Character.isDigit((char)caractere))\n while(Character.isDigit((char)caractere)){\n linha+=(char)caractere;\n caractere=proximoCaractere(lerArq);\n }\n \n linhas[cont][2] = linha; // coloco o valor no primeiro atributo\n //System.out.println(linha);\n linha=\"\";\n \n while(!Character.isDigit((char)caractere)) // enquanto nao for numero ele percorre o arquivo\n caractere=proximoCaractere(lerArq);\n \n \n while(Character.isDigit((char)caractere)){\n linha+=(char)caractere;\n caractere=proximoCaractere(lerArq);\n }\n \n linhas[cont][3] = linha; // coloco o valor no segundo atributo\n //System.out.println(linha);\n linha=\"\";\n \n \n }\n \n if(linha.equals(\"JMP\")||linha.equals(\"JMPF\")||linha.equals(\"CALL\")||linha.equals(\"LDV\")||linha.equals(\"LDC\")||linha.equals(\"STR\"))\n {\n linha=\"\";\n \n while(!Character.isLetterOrDigit((char)caractere)) \n caractere=proximoCaractere(lerArq);\n //System.out.println(\"I: \"+(char)caractere); \n while(Character.isLetterOrDigit((char)caractere))\n {\n // System.out.println(\"W: \"+(char)caractere); \n \n linha += (char)caractere;\n caractere=proximoCaractere(lerArq);\n }\n \n linhas[cont][2] = linha; // coloco o valor no segundo atributo\n //System.out.println(linha);\n //linha=\"\";\n \n }\n \n count+= cont;\n linhas[cont][0]=count;\n \n while(!Character.isLetterOrDigit((char)caractere)&& caractere!=-1){\n if((char)caractere=='\\n'){\n cont++; \n }\n caractere=proximoCaractere(lerArq);\n }\n \n \n if(caractere==-1)\n break;\n \n count=\"\";\n }\n\n DefaultTableModel modelo = new DefaultTableModel(linhas, colunas);\n\n grade.setModel(modelo);\n arq.close();\n\n } catch (IOException e) {\n System.err.printf(\"Erro na abertura do arquivo: %s.\\n\", e.getMessage());\n }\n\n } else {\n System.out.println(\"File access cancelled by user.\");\n }\n \n botaoExecutar.setEnabled(true);\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tnumb = 1;\r\n\t\t\t\ttry {\r\n\t\t\t\t\trs = null;\r\n\t\t\t\t\tconn = DriverManager.getConnection(URL, USERNAME, PASSWORD);\r\n\t\t\t\t\tstmt = conn.createStatement();\r\n\t\t\t\t\tString sql = \"select sqlTableName from sqlTable\";\r\n\t\t\t\t\trs = stmt.executeQuery(sql);\r\n\t\t\t\t\tString str_show = \"\";\r\n\t\t\t\t\twhile(rs.next()) {\r\n\t\t\t\t\t\tstr_show += rs.getString(\"sqlTableName\").trim() + \" \";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tshowFileName.setText(str_show);\r\n\t\t\t\t\tconn.close();\r\n\t\t\t\t\tstmt.close();\r\n\t\t\t\t\tupJFrame();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}", "public void vlist(String cid) { \n\t\tString[][] datas = {};\n\t\tString[] titles = {\"Username\",\"User ID\",\"Status\"};\n\t\tvmodel = new DefaultTableModel(datas,titles);\n\t\tvlist = new JTable(vmodel);\n\t\tvlist.setPreferredScrollableViewportSize(new Dimension(400, 200));\n\t\ttry {\n\t\t\t\n\t\t\tFileReader file = new FileReader(\"all.txt\");\n\t\t\tBufferedReader bfr = new BufferedReader(file);\n\t\t\tif(cid.equals(\"\")) {\n\t\t\t\tfor(oneline = bfr.readLine();oneline != null;oneline = bfr.readLine()) {\n\t\t\t\t\treadconsumerinfo = oneline.split(\" \");\n\t\t\t\t\tif(readconsumerinfo[0].equals(\"p\") == false) {\n\t\t\t\t\t\tvmodel.addRow(new String[] {readconsumerinfo[2],readconsumerinfo[0],\" \"});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfor(oneline = bfr.readLine();oneline != null;oneline = bfr.readLine()) {\n\t\t\t\t\treadconsumerinfo = oneline.split(\" \");\n\t\t\t\t\tif(readconsumerinfo[0].equals(cid) == true) {\n\t\t\t\t\t\tvmodel.addRow(new String[] {readconsumerinfo[2],readconsumerinfo[0],\" \"});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbfr.close();\n\t\t\tfile.close();\n\t\t\t\n\t\t}\n\t\tcatch(IOException|ArrayIndexOutOfBoundsException e) {\n\t\t\tSystem.out.print(\"Error occured in vlist()\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tjspanview = new JScrollPane(vlist);\n\t}", "@Override\n public String toString(){\n\n ArrayList<String> headers = new ArrayList<>();\n ArrayList<String[]> records = new ArrayList<>();\n\n for(Col col : columns){\n headers.add(col.getName());\n }\n\n if(getRecordSize() < 1){\n return headers.toString();\n }\n\n for(int i = 0; i < getRecordSize(); i++){\n\n ArrayList<Rec> recs = getRecordsByRowIndex(i);\n String[] r = new String[recs.size()];\n\n for(int j = 0; j < recs.size(); j++){\n r[j] = recs.get(j).getLastEntry().getData();\n }\n\n records.add(r);\n\n }\n\n return displayTable(headers, records);\n\n }", "public void show() {\n if(heading.isEmpty()) {\r\n System.out.println(\"Error:Table:show:no data in heading, nothing to show\");\r\n return;\r\n }\r\n if(rows.isEmpty()) {\r\n System.out.println(\"Error:Table:show:no data in rows, nothing to show\");\r\n return;\r\n }\r\n for(String h : heading) {\r\n System.out.print(h + \" | \");\r\n }\r\n System.out.println(\"\");\r\n Set<String> keys = rows.keySet();\r\n for(String k : keys) {\r\n rows.get(k).show();\r\n System.out.println(\"\");\r\n }\r\n System.out.println(\"\");\r\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\tfinal JFileChooser fc = new JFileChooser();\r\n\t\t\t\t\r\n\t\t\t\tif(currentDirectory != null) fc.setCurrentDirectory(currentDirectory);\r\n\t\t\t\t\r\n\t\t\t\t//In response to a button click:\r\n\t\t\t\tint returnVal = fc.showOpenDialog(null);\r\n\t\t\t\tcurrentDirectory = fc.getCurrentDirectory();\r\n\t\t\t\t\r\n\t\t if (returnVal == JFileChooser.APPROVE_OPTION) {\t\t \t\r\n\t\t \tList<String> lines = null;\r\n\t\t File file = fc.getSelectedFile();\r\n\t\t Path path = Paths.get(file.getAbsolutePath());\r\n\t\t int loopLength = antennaArray.amplitude.length;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tlines = Files.readAllLines(path, StandardCharsets.UTF_8);\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(lines.size() < antennaArray.amplitude.length) {\r\n\t\t\t\t\t\t\tint difference = antennaArray.amplitude.length - lines.size();\r\n\t\t\t\t\t\t\tfor(int addition = 0; addition < difference; addition++)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tlines.add(\"0\");\r\n\t\t\t\t\t\t\t}\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\tfor (int conversion = 0; conversion < loopLength; conversion++) {\r\n\t\t\t\t\t\t\tdouble amplitudeFromFile = 0;\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\tamplitudeFromFile = Double.parseDouble(lines.get(conversion));\r\n\t\t\t\t\t\t\t} catch (NumberFormatException ex) {\r\n\t\t\t\t\t\t\t\tamplitudeFromFile = 0;\r\n\t\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\tantennaArray.amplitude[conversion] = amplitudeFromFile;\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\trefreshAmplitudeTable();\r\n\t\t\t\t\t\tdrawPlotWithInitialParameterValues();\t\t\t\t\t\t\r\n\t\t\t\t\t} catch (IOException ex) {\r\n\t\t\t\t\t\tex.printStackTrace();\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t } else {\r\n\t\t // Cancelled by the user.\r\n\t\t }\r\n\t\t\t}", "public String getDescription() {\n return \"Text file (.text)\";\n }", "@FXML\n public void openFile(Event e) {\n String inputData = \"\";\n File file = chooser.showOpenDialog(open.getScene().getWindow());\n\n try {\n inputData = new String(Files.readAllBytes(file.toPath()));\n } catch (IOException error) {\n error.getSuppressed();\n }\n\n input.setFont(Font.font(\"monospaced\"));\n input.setText(inputData);\n\n Stage primary = (Stage) open.getScene().getWindow();\n primary.setTitle(file.getName());\n }", "private void txttenfileActionPerformed(java.awt.event.ActionEvent evt) {\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n controlPnl = new javax.swing.JPanel();\n selectFolderBtn = new javax.swing.JButton();\n runTestBtn = new javax.swing.JButton();\n Pnl = new javax.swing.JPanel();\n filePnl = new javax.swing.JScrollPane();\n fileTbl = new javax.swing.JTable();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n selectFolderBtn.setText(\"Select Folder\");\n selectFolderBtn.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n selectFolderBtnMouseClicked(evt);\n }\n });\n\n runTestBtn.setText(\"Run Test\");\n runTestBtn.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n runTestBtnMouseClicked(evt);\n }\n });\n\n javax.swing.GroupLayout PnlLayout = new javax.swing.GroupLayout(Pnl);\n Pnl.setLayout(PnlLayout);\n PnlLayout.setHorizontalGroup(\n PnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 0, Short.MAX_VALUE)\n );\n PnlLayout.setVerticalGroup(\n PnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 100, Short.MAX_VALUE)\n );\n\n javax.swing.GroupLayout controlPnlLayout = new javax.swing.GroupLayout(controlPnl);\n controlPnl.setLayout(controlPnlLayout);\n controlPnlLayout.setHorizontalGroup(\n controlPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(controlPnlLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(controlPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(Pnl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(runTestBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, controlPnlLayout.createSequentialGroup()\n .addGap(0, 1, Short.MAX_VALUE)\n .addComponent(selectFolderBtn)))\n .addContainerGap())\n );\n controlPnlLayout.setVerticalGroup(\n controlPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(controlPnlLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(Pnl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(selectFolderBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(runTestBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(32, 32, 32))\n );\n\n filePnl.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);\n filePnl.setFocusCycleRoot(true);\n\n fileTbl.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null}\n },\n new String [] {\n \"Selected\", \"Filename\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.Boolean.class, java.lang.String.class\n };\n boolean[] canEdit = new boolean [] {\n true, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n fileTbl.getTableHeader().setReorderingAllowed(false);\n filePnl.setViewportView(fileTbl);\n if (fileTbl.getColumnModel().getColumnCount() > 0) {\n fileTbl.getColumnModel().getColumn(0).setResizable(false);\n fileTbl.getColumnModel().getColumn(0).setPreferredWidth(50);\n fileTbl.getColumnModel().getColumn(1).setResizable(false);\n fileTbl.getColumnModel().getColumn(1).setPreferredWidth(350);\n }\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(controlPnl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(filePnl, javax.swing.GroupLayout.DEFAULT_SIZE, 449, Short.MAX_VALUE)\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(controlPnl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(filePnl, javax.swing.GroupLayout.DEFAULT_SIZE, 424, Short.MAX_VALUE)\n .addContainerGap())\n );\n\n pack();\n }" ]
[ "0.6958581", "0.649773", "0.6400067", "0.6299498", "0.6123295", "0.60948503", "0.6044121", "0.6033374", "0.6014293", "0.59963524", "0.59483325", "0.5930581", "0.5907319", "0.58948576", "0.58914083", "0.5866483", "0.58387303", "0.5830527", "0.58005786", "0.5783319", "0.57769585", "0.5774837", "0.5774404", "0.5773775", "0.5758019", "0.57480735", "0.57106733", "0.57016104", "0.56777275", "0.56758386", "0.56582004", "0.5636802", "0.5631101", "0.56291246", "0.5626698", "0.56167424", "0.5615079", "0.56121457", "0.5603806", "0.5602257", "0.559467", "0.55888397", "0.5578839", "0.5575873", "0.55665153", "0.5566325", "0.5564788", "0.55616766", "0.55545586", "0.5552414", "0.55480015", "0.5521148", "0.55208206", "0.5517796", "0.55094296", "0.55088305", "0.5500146", "0.5498731", "0.5492731", "0.5487352", "0.5483396", "0.54816794", "0.5481189", "0.54704267", "0.5462802", "0.5453172", "0.5451431", "0.5450318", "0.54370856", "0.5434261", "0.5429206", "0.5425347", "0.54241633", "0.54220694", "0.5421195", "0.54074514", "0.5404115", "0.54038554", "0.5400727", "0.5393922", "0.5389567", "0.5385862", "0.5384408", "0.5379789", "0.53706086", "0.5367811", "0.536267", "0.53509206", "0.53492653", "0.53464264", "0.53447276", "0.53355813", "0.5334939", "0.5332579", "0.5331421", "0.53304154", "0.5328044", "0.53261626", "0.5324534", "0.53245103" ]
0.6923112
1
This method will close the program.
public void toExit() { int sure=JOptionPane.showConfirmDialog(rootPane,"Are you sure to Exit?"); if(sure==JOptionPane.YES_OPTION) { System.exit(0); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void closeProgram()\n {\n window.close();\n }", "public void close() {\n System.exit(0);\n }", "public void exitProgram() {\n System.out.println(\"Closing Ranking....\");\n ScannerInputs.closeScanner();\n System.exit(0);\n }", "public void exitProgram() {\n\t\tgoOffline();\n\t\tmainWindow.dispose();\n\t\tif (config_ok)\n\t\t\tsaveConnectionConfiguration();\n\t\tSystem.exit(0);\n\t\t\n\t}", "public void close() {\n myProcess.destroy();\n }", "private void closeProgram() {\n\t\tSystem.out.println(\"Cancel Button clicked\");\n\t\tif (ConfirmBox.display( \"Exit\", \"Are you sure you want to exit?\")) {\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "public void Exit(){\n\t\t\t\tclose();\n\t\t\t}", "private void closeProgram(){\n Alert alert = new Alert(Alert.AlertType.CONFIRMATION, \"Are you sure you want to quit?\", ButtonType.YES, ButtonType.NO, ButtonType.CANCEL);\n alert.setTitle(\"Exit\");\n alert.setHeaderText(null);\n\n alert.showAndWait();\n\n if (alert.getResult() == ButtonType.YES){\n try {\n db.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n window.close();\n System.exit(0);\n }\n }", "public void close() {\n this.octaveExec.close();\n }", "private void closeProgram(){\n boolean answer = ConfirmBox.display(\"Title\", \"Sure you want to exit?\");\n if(answer==true){\n window.close();\n }\n }", "public void exitTheProgram(){\n System.exit(0);\n }", "@Override\n public void programClosed() {\n super.programClosed();\n }", "public void exit() {\r\n\t\tdispose();\r\n\t}", "private void programShutdown(){\n\n am.finishAllActivity();\n activity .moveTaskToBack(true);\n activity .finish();\n android.os.Process.killProcess(android.os.Process.myPid());\n System.exit(0);\n\n\n }", "@Override\n public void execute() {\n System.out.println(\"programm closed\");\n System.exit(0);\n }", "private void close() {\r\n this.dispose();\r\n MainClass.gamesPlayed++;\r\n Examples2018.menu();\r\n }", "@Override\n public void terminateProgram() {\n \n }", "private static void Close () {\n frame.setVisible (false);\n frame.dispose();\n System.exit(0);\n }", "private void closeProgram(Stage primaryStage) {\n primaryStage.close();\n }", "public static void End()\n\t{\n\t\ttry\n\t\t{\n\t\t\tSystem.out.println(\"End of java application\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void close()\n {\n // Display a farewell message before closing the application \n super.close();\n }", "public void close() {\t\t\n\t}", "public void close() {\n\n\t}", "public void close() {\n\n\t}", "public static void exitProgram() {\n\r\n System.out.println(\"Thank you for using 'Covid 19 Vaccination Center Program'. \\n Stay safe!\");\r\n System.exit(0);\r\n }", "public void close() {\n\t\tSystem.out.println(\"Scraper terminated\");\n\t}", "private void Exit() {\r\n this.dispose();\r\n app.setVisible(true);\r\n }", "private static void exit(){\n\t\t\n\t\tMain.run=false;\n\t\t\n\t}", "private static void quitProgram(Scanner input) {\n System.out.println(\"Thank you, ending session.\");\n input.close();\n System.exit(0);\n }", "public void close() {\r\n\t}", "void closeApp();", "public void closeUp(){\n\t\ttry{\n\t\t\tif (socket!=null){\n\t\t\t\tsocket.close();\n\t\t\t}\n\t\t\tif (input!=null){\n\t\t\t\tinput.close();\n\t\t\t}\n\t\t\tif (output!=null){\n\t\t\t\toutput.close();\n\t\t\t}\n\t\t}\n\t\tcatch(IOException e){\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\tmainDialog.dispose();\n\t\tmainDialog.dispose();\n\t\tSystem.exit(0);\n\t}", "private void exitApplication()\r\n {\r\n System.exit(0);\r\n }", "public void close() {\n\t\t}", "public void quit(){\n this.println(\"Bad news!!! The library has been cancelled!\");\n System.exit(0);\n\n }", "private void exitApplication() {\n\t\tBPCC_Logger.logInfoMessage(classNameForLogger, logMessage_applicationFrameClosed);\r\n\t\tSystem.exit(0);\r\n\t}", "private void closeFrame()\n\t{\n\t\tSystem.exit(0);\n\t}", "private void closeApp() {\n\t\tcurrentBoard.storeXMLfil();\n\t\tzipBackUp( currentBoard.getBoardFile() );\n\t\tlogConcoleOutput();\n\t\t//\n\t\tif( funcBoard != null ){\n\t\t\tfuncBoard.close();\n\t\t\tzipBackUp( funcBoard.getBoardFile() );\n\t\t}\n\t}", "private void exit() {\n dispose();\r\n }", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "void close();", "private void processQuit() {\n System.exit(0);\n }", "public void exitApp() {\n\t\tSystem.out.println(\"Exiting PhoneBook\");\n\n\t}", "public void close() {\n\t\t\n\t}", "public void close() {\n\t\t\n\t}", "public void close() {\n\t\t\n\t}", "@FXML public void closeApplication() {\n\t\tPlatform.exit();\n System.exit(0);\n\t}", "public void close() {\n\t}", "public void quit() {\n\t\tSystem.exit(0);\n\t}", "public void quitProgram(){}", "public void close() throws IOException {\r\n\t\tUIConfiguration.save();\r\n\t\tLogger.instance().debug(\"Application terminated\");\r\n\t\tLogSerializer.archive();\r\n\t}", "public void close()\n {\n try\n {\n stop();\n }\n catch (IOException ioex)\n {\n logger.error(\"Failed to stop \" + getClass().getSimpleName(), ioex);\n }\n }", "public void close() {}", "public void close() {\n\t\t\r\n\t}", "public void close()\n\t\t{\n\t\t}", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();", "public void close();" ]
[ "0.8360869", "0.7946999", "0.7539718", "0.7523235", "0.7481823", "0.74721014", "0.74715036", "0.74112296", "0.721856", "0.7170127", "0.7113988", "0.7081755", "0.7030141", "0.6998089", "0.69932926", "0.6964223", "0.69324744", "0.6926639", "0.68619066", "0.6845216", "0.68447876", "0.68247294", "0.6814843", "0.6814843", "0.6813626", "0.67874974", "0.6786154", "0.6783605", "0.6778668", "0.6776915", "0.6769398", "0.67681795", "0.6761165", "0.6754341", "0.6754078", "0.675313", "0.6750696", "0.6745763", "0.6736232", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.6736106", "0.672764", "0.6723291", "0.67193234", "0.67193234", "0.67193234", "0.67003846", "0.6686319", "0.6680207", "0.6670152", "0.6666398", "0.6662351", "0.66618323", "0.6660655", "0.66591394", "0.66581005", "0.66581005", "0.66581005", "0.66581005", "0.66581005", "0.66581005", "0.66581005", "0.66581005", "0.66581005", "0.66581005", "0.66581005", "0.66581005", "0.66581005" ]
0.0
-1
This method will take back to customer Panel.
private void backToCustomer() { new CustomerPanel().setVisible(true); this.setVisible(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Secured(\"@\")\n public void doBackPage() {\n infoOrderDetail = false;\n haveDepositPrice = false;\n orderStockTag.resetOrderStock();\n }", "private void goBack() {\n View.clearViews();\n View.cambiar(\"operador.cliente\", new RegistrarClientes(operador));\n }", "private void backActionPerformed(ActionEvent e) {\r\n ctr_pres.principal();\r\n setVisible(false);\r\n }", "public void cancelBankDdPrintLocation() {\n\t\tSystem.out.println(\"inside cancel \");\n\t\ttry{\n\t\t\tExternalContext context = FacesContext.getCurrentInstance().getExternalContext(); \n\t\t\tcontext.redirect(\"../login/login.xhtml\");\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void cancel(ActionEvent e){\r\n // Clear textfields\r\n clearFields();\r\n // If coming from appt management screen, go back there\r\n if (fromAppt){\r\n goToManageApptScreen();\r\n }\r\n // Otherwise, set the current client to null and go to the landing page \r\n else {\r\n currClient = null;\r\n LandingPage.returnToLandingPage();\r\n }\r\n }", "@Override\n public void onBackPressed() {\n replaceUseCase(meetingManager);\n replaceUseCase(traderManager);\n super.onBackPressed();\n }", "public void naviagteBackToPage() {\n\t\tgetDriver().close();\n\t}", "public void returnToMenu()\n\t{\n\t\tchangePanels(menu);\n\t}", "public void back() {\n Views.goBack();\n }", "public void back(){\n\t\tswitch(state){\n\t\tcase LOGINID:\n\t\t\tbreak; //do nothing, already at top menu\n\t\tcase LOGINPIN:\n\t\t\tloginMenu();\n\t\t\tbreak;\n\t\tcase TRANSACTION:\n\t\t\tbreak; //do nothing, user must enter the choice to log out\n\t\tcase DEPOSIT:\n\t\t\ttransactionMenu();\n\t\t\tbreak;\n\t\tcase DEPOSITNOTIFICATION:\n\t\t\tbreak; //do nothing, user must press ok\n\t\tcase WITHDRAW:\n\t\t\ttransactionMenu();\n\t\t\tbreak;\n\t\tcase BALANCE:\n\t\t\tbreak; //do nothing, user must press ok\n\t\tcase WITHDRAWALNOTIFICATION:\n\t\t\tbreak; //do onthing, user must press ok\n\t\t}\n\t\t\n\t\tcurrentInput = \"\";\n\t}", "@Override\n\tpublic void goToBack() {\n\t\tif(uiHomePrestamo!=null){\n\t\tuiHomePrestamo.getHeader().getLblTitulo().setText(constants.prestamos());\n\t\tuiHomePrestamo.getHeader().setVisibleBtnMenu(true);\n\t\tuiHomePrestamo.getContainer().showWidget(1);\n\t\t}else if(uiHomeCobrador!=null){\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tuiHomeCobrador.getContainer().showWidget(2);\n\t\t\tuiHomeCobrador.getUiClienteImpl().cargarClientesAsignados();\n\t\t\tuiHomeCobrador.getUiClienteImpl().reloadTitleCobrador();\n\t\t}\n\t}", "private void btn_BackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_BackActionPerformed\n // go back to database access screen\n SS.StudentScreenPopulate();\n SS.setVisible(true);\n this.setVisible(false);\n\n }", "public void back()\r\n\t{\r\n\t\tparentPanel.setState(GameState.Menu);\r\n parentPanel.initScene(GameState.Menu);\r\n\t\t\t\r\n\t}", "public void navigateToBack() {\n WebDriverManager.getDriver().navigate().back();\n }", "public void back()\n\t{\n\t\tdriver.findElementById(OR.getProperty(\"BackButton\")).click();\n\t}", "public void backbutton(ActionEvent event) throws Exception{\n\t\t\n\t\tcustomermainpage main = new customermainpage();\n\t\tmain.setgui();\n\t}", "public void back() {\n driver.navigate().back();\n }", "@Override\n\tpublic void onBackPressed() {\n\treturn;\n\t}", "@Override\n public void handleOnBackPressed() {\n Intent intent = new Intent(context, AdminSessionEdit.class);\n startActivity(intent);\n }", "public void back(ActionEvent actionEvent) throws IOException {\n new PageLoader().load(\"Login\");\n }", "private void btnBackActionPerformed(java.awt.event.ActionEvent evt) {\n userProcessContainer.remove(this);\n Component[] componentArray = userProcessContainer.getComponents();\n Component component = componentArray[componentArray.length - 1];\n SelectNetworkForm panel = (SelectNetworkForm) component;\n panel.populateNetwork();\n CardLayout layout = (CardLayout) userProcessContainer.getLayout();\n layout.previous(userProcessContainer);\n }", "@Override\n public void onBackPressed() {\n Intent intent = new Intent(getApplicationContext(), MerchantJobs.class);\n startActivity(intent);\n finish();\n\n return;\n }", "private void backButtonAction() {\n CurrentUI.changeScene(SceneNames.LOGIN);\n }", "public void actionPerformed(ActionEvent e){\r\n JButton eventSource = (JButton) e.getSource();\r\n HelperControl control = new HelperControl();\r\n //Turn to OrderMenu\r\n if(eventSource.equals(customerButton)){\r\n this.setVisible(false);\r\n \r\n control.skipOrderMenu();\r\n System.out.println(\"Turn to 2nd page: OrderMenu\"); \r\n }\r\n //Turn to manager\r\n else if(eventSource.equals(managerButton)){\r\n this.setVisible(false);\r\n // manager mng = new manager();\r\n // mng.setVisible(true);\r\n control.skipManager();\r\n System.out.println(\"Turn to 7Th page: manager\");\r\n }\r\n \r\n }", "@Override\n\tpublic void onBackPressed() {\n\t\treturn;\n\t}", "private void backJButton1ActionPerformed(java.awt.event.ActionEvent evt) {\n\n userProcessContainer.remove(this);\n CardLayout layout = (CardLayout) userProcessContainer.getLayout();\n layout.previous(userProcessContainer);\n }", "protected void goBack() {\r\n\t\tfinish();\r\n\t}", "public void leavepage() {\n this.setVisible(false);\n }", "private void btnReturnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnReturnActionPerformed\n ViewProducts viewProducts = new ViewProducts(loggedInCustomer);\n this.dispose();\n viewProducts.setVisible(true);\n }", "@Override\n public void onBackPressed() {\n return;\n }", "@Override\n public void onBackPressed() {\n return;\n }", "@Override\n public void onBackPressed() {\n return;\n }", "@Override\n public void onBackPressed() {\n return;\n }", "@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t\treturn;\n\t}", "@Override\n public void goBack() {\n\n }", "public void endSession(){\n currentUser = null;\n ui.returnCard();\n }", "public void GoBack(){\n if (prev_hostgui != null){\n this.setVisible(false);\n prev_hostgui.setVisible(true);\n } else{\n this.setVisible(false);\n prev_guestgui.setVisible(true);\n }\n }", "@Override\r\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\r\n\t\tif (cmd == ConstantTool.PAY_SUCCESS) {\r\n\t\t\tIntent intent = new Intent(OrderList.this, Homemenu.class);\r\n\t\t\tstartActivity(intent);\r\n\t\t}\r\n\t}", "public void backToLoginWindow(ActionEvent event) {\n loadLogin();\n // hides current stage (window)\n ((Node) (event.getSource())).getScene().getWindow().hide();\n\n }", "private void backToMenu() {\n game.setScreen(new StartScreen(game));\n }", "private void backToMenu()\n\t{\n\t\t//switch to menu screen\n\t\tgame.setScreen(new MenuScreen(game));\n\t}", "public void redirectToPlan() {\n setResponsePage( new RedirectPage( \"plan\" ) );\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tf1.dispose();\n\t\t\t\tnew Gui().customer_frame(name);\n\t\t\t}", "private void setupBack() {\n\t\tmakeButton(\"Back\", (ActionEvent e) -> {\n\t\t\tchangeView(\"login\");\n\t\t});\n\t}", "@FXML\n void onActGoBack(ActionEvent event) throws IOException {\n sceneManage(\"/View/Reports.fxml\", event);\n }", "@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t\t finish();\n\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tcustomerFrame cf = new customerFrame(user);\r\n\t\t\t\tcf.setVisible(true);\r\n\t\t\t\tsetVisible(false);\r\n\t\t\t}", "@Override\n\t\tpublic void onBackPressed() {\n\t\t\tIntent homeScreenIntent = new Intent(ActivityDeleteDeliveryList.this, ActivityAdminHomeScreen.class);\n\t\t\thomeScreenIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n\t\t\tstartActivity(homeScreenIntent);\n\t\t\tfinish();\t\t\t\t\t\n\t\t}", "public void navigate_back() throws CheetahException {\n\t\ttry {\n\t\t\tCheetahEngine.getDriverInstance().navigate().back();\n\t\t} catch (Exception e) {\n\t\t\tthrow new CheetahException(e);\n\t\t}\n\t}", "public void goBack() {\n goBackBtn();\n }", "public static void back() {\n driver.navigate().back();\n }", "private void backButton() {\n navigate.goPrev(this.getClass(), stage);\n }", "@Override\r\n\tpublic void onBackPressed() {\r\n\t\tsuper.onBackPressed();\r\n\t\tlogout();\r\n\t}", "@FXML\r\n public void goBack(ActionEvent event) throws Exception {\r\n transitionTo(new PlanetController());\r\n }", "@Override\r\n\tpublic void backButton() {\n\t\t\r\n\t}", "@Override\n\tprotected void cancel() {\n\t\tsuper.cancel();\n\t\tif(ELSComfirmDialog.showConfirmDlg(GetPanelUtil.getFunctionPanel(this),\n\t\t\t\t\"取消添加\", \"确认退出新增界面?\")){\n\t\t\tback();\n\t\t}\n\t}", "@Override\n\tpublic void afterNavigateBack(WebDriver driver) {\n\t\t\n\t}", "public void back(){\n\t\tIntent mainIntent = new Intent().setClass(DatosAuto.this, BuscaPlacaTexto.class);\n\t\tstartActivity(mainIntent);\n\t\tpager=null;\n\t\tDatosAuto.this.finish();\n\t\tDialogos.Toast(DatosAuto.this, getResources().getString(R.string.mapa_inicio_de_viaje_no_tomado), Toast.LENGTH_LONG);\n\t\tsuper.onBackPressed();\n\t}", "public void onGoBackClicked() {\r\n EnterChange();\r\n\r\n //condition to check if time is entered by customer\r\n if(textTime.getText().length() > 0){\r\n _ReservationList.load();\r\n\r\n EnterChange();\r\n Stage stage = (Stage) btnGoBack.getScene().getWindow();\r\n stage.close();\r\n }\r\n }", "@Override\n public void onBackPressed() {\n return;\n // super.onBackPressed();\n }", "@Override\n\tpublic void onBackPressed() {\n\t\tIntent i = new Intent(this, PayOptions.class);\n\t\tstartActivity(i);\n\t\treturn;\n\t}", "@Override\r\n\tpublic void onBackPressed() {\n\t\tfinish();\r\n\t}", "@Override\r\n\tpublic void onBackPressed() {\n\t\tfinish();\r\n\t}", "@Override\n public void onBackPressed() {\n return;\n }", "private void navigationAdminScreen(UserInfo usn) {\n finish();\n }", "@Override\n\tpublic void afterNavigateBack(WebDriver arg0) {\n\n\t}", "@Override\n public void onBackPressed() {\n return;\n //super.onBackPressed();\n }", "public void back() {\n\t\tstate.back();\n\t}", "public void returnToMenu(){\n client.moveToState(ClientState.WELCOME_SCREEN);\n }", "@Override\n public void onBackPressed() {\n super.onBackPressed();\n Intent intent = new Intent(MainActivitySell.this, MainActivity.class);\n startActivity(intent);\n finish();\n }", "@Override\n\tpublic void onBackPressed() {\n\t\tBack();\n\t}", "@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t\tfinish();\n\t}", "@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t\tfinish();\n\t}", "@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t\tfinish();\n\t}", "public void goBack(ActionEvent event) {\n\t\ttry {\n\t\t\tFXMLLoader loader = new FXMLLoader(getClass().getResource(\"/application/walkin/BasicInfoPrompt.fxml\"));\n\t\t\tParent root = (Parent) loader.load();\n\t\t\t\n\t\t\tGenerateReportController reportVariables = loader.getController();\n\t\t\treportVariables.getReport(newReport2);\n\t\t\t\n\t\t\tStage stage = (Stage)((Node)event.getSource()).getScene().getWindow();\n\t\t\tstage.setScene(new Scene(root));\n\t\t\tstage.show();\n\t\t} \n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void logout() {\n\t\tsetToViewMode();\n\t\t\n\t\tif(supplierList.getModel().getSize() > 0){\n\t\t\tsupplierList.clearSelection();\n\t\t\tsupplierList.setSelectedValue(supplierList.getModel().getElementAt(0), true);\t\t\n\t\t} else {\n\t\t\tString empty = \"\";\n\t\t\tsetNameTF(empty);\n\t\t\tsetAddressTF(empty);\n\t\t\tseteMailTF(empty);\n\t\t\tsetIDTF(empty);\n\t\t\ttelTF.setText(empty);\n\t\t}\n\t}", "@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\n\t\t\n\t}", "public void logout() {\n \n FacesContext.getCurrentInstance().getExternalContext().invalidateSession();\n try {\n FacesContext.getCurrentInstance().getExternalContext()\n .redirect(\"/BookStorePelikSangat/faces/admin/loginadmin.xhtml\");\n } \n catch (IOException e) {}\n\t}", "@Override\n public void onBackPressed() {\n exitReveal();\n\n super.onBackPressed();\n }", "@Override\n\tpublic void onBackPressed() {\n\t\tfinish();\n\t\tsuper.onBackPressed();\n\t}", "@Override\n\tpublic void onBackPressed() {\n\t\tfinish();\n\t\tsuper.onBackPressed();\n\t}", "@Override\r\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\r\n\t}", "@Override\r\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\r\n\t}", "@FXML\r\n private void handleBackButton() {\r\n\r\n CommonFunctions.showAdminMenu(backButton);\r\n\r\n }", "public void back() {\n //noinspection ResultOfMethodCallIgnored\n previous();\n }", "@Override\n public void onBackPressed() {\n if (!ecPagerView.collapse())\n super.onBackPressed();\n }", "@Override\n public void onBackPressed() {\n super.onBackPressed();\n finish();\n }", "public void goBack() {\n setEditor(currentEditor.getParentEditor());\n }", "@Override\r\n\tpublic void back() {\nPizzaHut.main(null);\r\n\t}", "private void Back() {\n this.dispose();\n tmrTime.stop();\n }", "@Override\n protected boolean canGoBack() {\n return false;\n }", "@Override\n\t\tpublic void onBackPressed() {\n\t\t\tsuper.onBackPressed();\n\t\t\t\n\t\t\tIntent intent = new Intent(this, DailyentryMenuActivity.class);\n\t\t\tstartActivity(intent);\n\t\t\tSkuDisplay.this.finish();\n\t\t\t\n\t\t\t\n\t\t}", "@Override\n public void onBackPressed()\n {\t\n \t//Return tu login activity\n \tif(mlv.getUsersView())\n \t\tthis.finish();\n \telse\n \t{\n \t\t//Return to users view\n \t\tmlv.activateUsersView(); \t\t\n \t}\n }", "private void backToAllCourses() {\n\t\tnew AllCourses(ms, user).setVisible(true);\n\t}", "@Override\n public void onBackPressed() {\n showEndShiftDialog();\n }", "public void returnToPrev(){\r\n Stage stage = (Stage) exitButton.getScene().getWindow();\r\n stage.close();\r\n }", "@Override\n public void onBackPressed() {\n super.onBackPressed();\n LessonService.disableToRestoreState();\n }", "private void shopExitButtonClicked() {\n finish();\n }", "@Override\n public void onBackPressed() {\n chamarTelaInicial(status_recreate);\n }", "@Override\n public void onBackPressed() {\n changeForm(R.id.btnSignInForm);\n }" ]
[ "0.6669712", "0.6652661", "0.66271967", "0.6608291", "0.6549293", "0.64491737", "0.64159393", "0.641241", "0.6362106", "0.63550377", "0.633105", "0.63034743", "0.6275819", "0.6247041", "0.6209265", "0.6177392", "0.6170174", "0.61608046", "0.61573803", "0.6135988", "0.6120247", "0.61150676", "0.6103779", "0.6100733", "0.60988766", "0.60932297", "0.6090498", "0.60669035", "0.6030458", "0.60076576", "0.60076576", "0.60076576", "0.60076576", "0.600401", "0.5998895", "0.59974957", "0.5997355", "0.599238", "0.5987421", "0.59872884", "0.5983219", "0.59828126", "0.5961057", "0.595892", "0.59540397", "0.5952472", "0.5946012", "0.5945095", "0.59418076", "0.5939417", "0.5913538", "0.5912229", "0.5910538", "0.5908937", "0.590845", "0.5904485", "0.59000593", "0.58925104", "0.58917385", "0.58910364", "0.5876568", "0.5869955", "0.5869955", "0.5868394", "0.58672416", "0.5856565", "0.58526844", "0.58513093", "0.5850736", "0.584905", "0.58483416", "0.58451277", "0.58451277", "0.58451277", "0.58430934", "0.5839816", "0.5835776", "0.58288366", "0.5826925", "0.58259976", "0.58259976", "0.58242434", "0.58242434", "0.5823894", "0.5819142", "0.58169234", "0.5816343", "0.58160645", "0.58151", "0.5809628", "0.5809148", "0.58080584", "0.5806878", "0.5796763", "0.5792751", "0.57844234", "0.5782489", "0.5782472", "0.5777542", "0.5776302" ]
0.78751796
0
This method will write back to that .txt file.
private void toSave() { File file4=new File("trial.txt"); try { String row; BufferedWriter bw=new BufferedWriter(new FileWriter(file4)); for(int i=0;i<jt.getRowCount();i++) { row = ""; for(int j=0;j<jt.getColumnCount();j++) { row += (jt.getValueAt(i, j) +","); } row = row.substring(0, row.length()-1); //System.out.println(row); bw.write(row); bw.newLine(); } bw.close(); JOptionPane.showMessageDialog(rootPane,"Details saved succesfully"); } catch(Exception ex) { JOptionPane.showMessageDialog(rootPane,"Exception occured"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "@Override\n public void writeDataToTxtFile() {\n\n }", "public void save() {\n\t\tBufferedWriter bw = null;\n\t\tFileWriter fw = null;\n\t\ttry {\n\t\t\tFile file = new File(\"fileSave.txt\");\n\t\t\tif(!file.exists()) {\n\t\t\t\tfile.createNewFile();\n\t\t\t}\n\t\t\tfw = new FileWriter(file);\n\t\t\tbw = new BufferedWriter(fw);\n\t\t\t//string to hold text to write on new file\n\t\t\tString text = textArea.getText();\n\t\t\t//write file\n\t\t\tif (text != null) {\n\t\t\t\tbw.write(text);\n\t\t\t}\n\t\t}\n\t\tcatch (IOException ie) {\n\t\t\tie.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tif (bw != null) {\n\t\t\t\t\tbw.close();\n\t\t\t\t\tfw.close();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException ie2) {\n\t\t\t\tie2.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "void writeToFile () throws IOException{\n FileWriter deleteFile = new FileWriter(\"Resolved Ticket of \" + this.resovedDate + \".txt\");\n BufferedWriter FileDeleted = new BufferedWriter(deleteFile);\n\n FileDeleted.write(\"Resolution: \" + this.Resolution + \" ; Date: \" + this.resovedDate);\n FileDeleted.close();\n }", "public void writeToTextFile(String filename){\n try{\n FileWriter myWriter = new FileWriter(filename); \n myWriter.write(toString());\n myWriter.close();\n } \n catch(IOException e) { \n System.out.println(\"An error occurred.\"); \n e.printStackTrace();\n } \n }", "public void toFile() throws IOException {\n toFile(null);\n }", "public void saveFile() {\n\t\tPrintWriter output = null;\n\t\ttry {\n\t\t\toutput = new PrintWriter(\"/Users/katejeon/Documents/Spring_2020/CPSC_35339/avengers_project/game_result.txt\");\n\t\t\toutput.println(textArea.getText());\n\t\t\toutput.flush();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"File doesn't exist.\");\n\t\t} finally {\n\t\t\toutput.close();\n\t\t}\n\t}", "public void recordOrder(){ \n PrintWriter output = null;\n try{\n output = \n new PrintWriter(new FileOutputStream(\"record.txt\", true));\n }\n catch(Exception e){\n System.out.println(\"File not found\");\n System.exit(0);\n }\n output.println(Tea);//writes into the file contents of String Tea\n output.close();//closes file\n }", "public void close(){\r\n\t\tif (this.fileWriter != null){\r\n\t\t\ttry {\r\n\t\t\t\tthis.fileWriter.flush();\r\n\t\t\t\tthis.fileWriter.close();\r\n\t\t\t\tthis.fileWriter = null;\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tlogger.error(\"Cannot close the file handle \"+this.myfilename+\". Your results might be lost. Cause: \"+e.getMessage());\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\r\n\t\t}\r\n\t}", "public void saveFile(File file, String text) {\r\n\t\t\r\n\t\tif (file==null){\r\n\t\t\treturn;\t\r\n\t\t}\r\n\r\n\t\ttry (BufferedWriter bw = new BufferedWriter(new FileWriter(file))) {\r\n\r\n\t\t\tbw.write(text);\r\n\r\n\t\t} catch (IOException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}", "private static void eraseFile() throws IOException {\n\t\tif (!scores.exists()) scores.createNewFile();\r\n\t\tFileWriter overwrite = new FileWriter(scores, false);\r\n\t\t// Inputs to the FileWriter class: file, append? (write to next line or overwrite)\r\n\t\t// append is set to false in order to overwrite\r\n\t\toverwrite.write(\"\");\r\n\t\toverwrite.close();\r\n\t}", "void writeToFile() throws IOException{\n\t\tString fileName = f.getTitle() + \".txt\";\n\t\tfileWrite = new BufferedWriter( new FileWriter(fileName));\n\t\tfileWrite.write(history);\n\t\tSystem.out.println(fileName + \" File Writing Successful!!\");\n\t\tSystem.out.println(\"Data in file :\\n\" + history);\n\t\tfileWrite.flush();\n\t\tFile file = new File(fileName);\n\t\tjava.awt.Desktop.getDesktop().open(file);\n\n\t}", "public void writeFile()\n\t{\n\t\t//Printwriter object\n\t\tPrintWriter writer = FileUtils.openToWrite(\"TobaccoUse.txt\");\n\t\twriter.print(\"Year, State, Abbreviation, Percentage of Tobacco Use\\n\");\n\t\tfor(int i = 0; i < tobacco.size(); i++)\n\t\t{\n\t\t\tStateTobacco state = tobacco.get(i);\n\t\t\tString name = state.getState();\n\t\t\tString abbr = state.getAbbreviation();\n\t\t\tdouble percent = state.getPercentUse();\n\t\t\tint year = state.getYear();\n\t\t\twriter.print(\"\"+ year + \", \" + name + \", \" + abbr + \", \" + percent + \"\\n\");\n\t\t} \n\t\twriter.close(); //closes printwriter object\n\t}", "public void finish() {\n if (rnaFile != null) {\n try {\n FileWriter writer = new FileWriter(rnaFile);\n writer.write(rna.toString());\n writer.close();\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }\n\n System.exit(0);\n }", "public abstract void saveToFile(PrintWriter out);", "public void reopen() throws IOException {\r\n writer.close();\r\n writer = new BufferedWriter(new java.io.FileWriter(file));\r\n }", "public void toTextFile(Path path) throws IOException {\n\t\tFiles.write(path, toString().getBytes());\n\t}", "private void writeToFile(){\n try(BufferedWriter br = new BufferedWriter(new FileWriter(filename))){\n for(Teme x:getAll())\n br.write(x.toString()+\"\\n\");\n br.close();\n }catch (IOException e){\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void executeOp() {\n try {\n // Make a bunch of shit that will allow us to write to the file\n FileWriter fw = new FileWriter(file.getAbsoluteFile());\n BufferedWriter bw = new BufferedWriter(fw);\n\n // Write the text that's in our notepad to the file\n bw.write(textArea.getText());\n\n // Close the \"stream\"\n bw.close();\n\n // If the attempt fails, display the error message - then give up.\n } catch (IOException ioe) {\n JOptionPane.showMessageDialog(frame, \"PROBLEM SAVING\");\n }\n\t}", "public void saveFile()\n\t{\n\t\tStringBuilder sb = new StringBuilder();\n\t\tString newLine = System.getProperty(\"line.separator\");\n\t\t\n\t\tfor(CSVItem cItem : itemList)\n\t\t{\n\t\t\tsb.append(cItem.buildCSVString()).append(newLine);\n\t\t\t\n\t\t}\n\t\tString fileString = sb.toString();\n\t\t\n\t\t File newTextFile = new File(filePath);\n\n FileWriter fw;\n\t\ttry {\n\t\t\tfw = new FileWriter(newTextFile);\n\t\t\t fw.write(fileString);\n\t\t fw.close();\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\n\t}", "private void removeContentsFromFile() {\n Log.d(\"debugMode\", \"deleting entire file contents...\");\n try {\n FileOutputStream openFileInput = openFileOutput(\"Locations.txt\", MODE_PRIVATE);\n PrintWriter printWriter = new PrintWriter(openFileInput);\n printWriter.print(\"\");\n printWriter.close();\n Log.d(\"debugMode\", \"deleting entire file contents successful\");\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }", "public void writeFile(String data){\n\t\t\n\t\tcurrentLine = data;\n\t\t\n\t\t\ttry{ \n\t\t\t\tFile file = new File(\"/Users/bpfruin/Documents/CSPP51036/hw3-bpfruin/src/phfmm/output.txt\");\n \n\t\t\t\t//if file doesnt exists, then create it\n\t\t\t\tif(!file.exists()){\n\t\t\t\t\tfile.createNewFile();\n\t\t\t\t}\n \n\t\t\t\t//true = append file\n\t\t\t\tFileWriter fileWriter = new FileWriter(file,true);\n \t \tBufferedWriter bufferWriter = new BufferedWriter(fileWriter);\n \t \tbufferWriter.write(data);\n \t \tbufferWriter.close();\n \n \n\t\t\t}catch(IOException e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\n\t\t\n\t}", "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 static void writeToOutput() {\r\n FileWriter salida = null;\r\n String archivo;\r\n JFileChooser jFC = new JFileChooser();\r\n jFC.setDialogTitle(\"KWIC - Seleccione el archivo de salida\");\r\n jFC.setCurrentDirectory(new File(\"src\"));\r\n int res = jFC.showSaveDialog(null);\r\n if (res == JFileChooser.APPROVE_OPTION) {\r\n archivo = jFC.getSelectedFile().getPath();\r\n } else {\r\n archivo = \"src/output.txt\";\r\n }\r\n try {\r\n salida = new FileWriter(archivo);\r\n PrintWriter bfw = new PrintWriter(salida);\r\n System.out.println(\"Índice-KWIC:\");\r\n for (String sentence : kwicIndex) {\r\n bfw.println(sentence);\r\n System.out.println(sentence);\r\n }\r\n bfw.close();\r\n System.out.println(\"Se ha creado satisfactoriamente el archivo de texto\");\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "public void recordOrder(){\n PrintWriter output = null;\n try{\n output = \n new PrintWriter(new FileOutputStream(\"record.txt\", true));\n }\n catch(Exception e){//throws exception\n System.out.println(\"File not found\");\n System.exit(0);\n }\n output.println(Coffee);//prints in file contents of Coffee\n output.close();//closes file\n }", "private void saveToFile(File file) throws IOException {\n FileWriter fileWriter = null;\n try {\n fileWriter = new FileWriter(file);\n fileWriter.write(getSaveString());\n }\n finally {\n if (fileWriter != null) {\n fileWriter.close();\n }\n }\n }", "public void save(String newFilePath) {\r\n File deletedFile = new File(path);\r\n deletedFile.delete();\r\n path = newFilePath;\r\n File dataFile = new File(path);\r\n File tempFile = new File(path.substring(0, path.lastIndexOf(\"/\")) + \"/myTempFile.txt\");\r\n\r\n try {\r\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(\r\n new FileOutputStream(tempFile), \"UTF-8\"));\r\n\r\n for (String line : data) {\r\n bw.write(line);\r\n bw.newLine();\r\n }\r\n\r\n bw.close();\r\n dataFile.delete();\r\n tempFile.renameTo(dataFile);\r\n } catch (IOException ex) {\r\n System.out.println(\"IOException in save2 : FileData\");\r\n }\r\n }", "public static void writeFile(String outFile, String text) {\n try{\n FileWriter fileWriter = new FileWriter(outFile,false);\n PrintWriter pw = new PrintWriter(fileWriter,true);\n \n if (text==null) {\n pw.println();\n }\n else\n {\n pw.println(text);\n }\n \n pw.close();\n fileWriter.close();\n }\n catch(Exception e) {\n e.printStackTrace();\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}", "String saveToFile () throws Exception {\n\n File backupFile = new File(\"../dataBackup.txt\");\n\n// checks if backup file exists, if yes, it attempts to delete it\n if (backupFile.exists() && !backupFile.delete())\n return (\"Save terminated: backup could not be deleted\");\n// attempts to rename file to backup file\n if (!file.renameTo(backupFile))\n return (\"Save terminated: backup could not be created\");\n\n// creates custom writer\n Writer writer = new Writer(new FileWriter(file));\n\n// cycles through all timelines and all their events, writing all into the same file\n for (Timeline timeline : timelines) {\n writer.writeTimeline(timeline);\n for (Event event : timeline.events) {\n writer.writeEvent(event);\n }\n }\n\n writer.close();\n return (\"Save finished successfully\");\n }", "public void save() {\n UTILS.write(FILE.getAbsolutePath(), data);\n }", "public void save() throws FileNotFoundException {\n PrintWriter myWriter = new PrintWriter(\"duke.txt\");\n for (Task t : TaskList.getTasklist()) {\n myWriter.println(t.toString());\n }\n myWriter.flush();\n myWriter.close();\n }", "public void writeToFile(File file) {\n\n\t}", "private static void writeOutput(String text) {\n try {\n FileWriter outputWriter = new FileWriter(\"output.txt\", true);\n outputWriter.write(text);\n outputWriter.close();\n } catch (Exception e) {\n System.out.println(\"Could not write to file output.txt\");\n }\n }", "public void saveCurrentFile(File file) {\n\t\tPrintWriter writer;\n\t\ttry {\n\t\t\twriter = new PrintWriter(file);\n\t\t\twriter.write(frame.textArea.getText());\n\t\t\tframe.originalText=frame.textArea.getText();\n\t\t\twriter.close();\n\t\t} catch (FileNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t}", "public static void ereaseFile(File file) {\r\n try (PrintWriter printWriter = new PrintWriter(file)) {\r\n printWriter.print(\"\");\r\n System.out.println(\"File: \" + file.toString() + \" was ereased.File is now empty\");\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "protected void fileSet() throws IOException {\n//\t\tfos = new FileOutputStream(outFile, false);\n//\t\tdos = new DataOutputStream(fos);\n\t\trealWriter = new BufferedWriter(new FileWriter(outFile.getAbsolutePath()));\n\t}", "private void outputFile() {\n // Define output file name\n Scanner sc = new Scanner(System.in);\n System.out.println(\"What do you want to call this file?\");\n String name = sc.nextLine();\n\n // Output to file\n Path outputFile = Paths.get(\"submissions/\" + name + \".java\");\n try {\n Files.write(outputFile, imports);\n if (imports.size() > 0)\n Files.write(outputFile, Collections.singletonList(\"\"), StandardOpenOption.APPEND);\n Files.write(outputFile, lines, StandardOpenOption.APPEND);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "protected abstract void writeFile();", "public static void files() throws IOException {\n\n\n try {\n BufferedReader reader = new BufferedReader(new FileReader(\"D:\\\\Text.txt\"));\n String line;\n while ((line = reader.readLine()) != null) {\n Palindroms.palindromeByReverse(line);\n BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(\"D:\\\\output.txt\")));\n writer.append(line);\n writer.close();\n }\n reader.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n System.out.println(\"Bye!\");\n }\n }", "public void save() {\r\n File distDataFile = new File(path);\r\n\r\n //String basePath = path;\r\n String endOfPath = path.substring(path.lastIndexOf(\"/\"));\r\n\r\n File rootDataFile;\r\n if (!path.contains(\"artists\")) {\r\n rootDataFile = new File(BASEDIR + \"/resources/data\" + endOfPath);\r\n } else {\r\n rootDataFile = new File(BASEDIR + \"/resources/data/artists\" + endOfPath);\r\n }\r\n\r\n File distTempFile = new File(path.substring(0, path.lastIndexOf(\"/\")) + \"/myTempFile.txt\");\r\n\r\n File rootTempFile;\r\n if (!path.contains(\"artists\")) {\r\n rootTempFile = new File(BASEDIR + \"/resources/data/myTempFile.txt\");\r\n } else {\r\n rootTempFile = new File(BASEDIR + \"/resources/data/artists/myTempFile.txt\");\r\n }\r\n \r\n try {\r\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(\r\n new FileOutputStream(distTempFile), \"UTF-8\"));\r\n\r\n for (String line : data) {\r\n bw.write(line);\r\n bw.newLine();\r\n }\r\n\r\n bw.close();\r\n distDataFile.delete();\r\n distTempFile.renameTo(distDataFile);\r\n\r\n BufferedWriter bw2 = new BufferedWriter(new OutputStreamWriter(\r\n new FileOutputStream(rootTempFile), \"UTF-8\"));\r\n\r\n for (String line : data) {\r\n bw2.write(line);\r\n bw2.newLine();\r\n }\r\n\r\n bw2.close();\r\n rootDataFile.delete();\r\n rootTempFile.renameTo(rootDataFile);\r\n } catch (IOException ex) {\r\n System.out.println(\"IOExceptoin in save1 : FileData\");\r\n }\r\n }", "public void SerialWriteFile() {\r\n\r\n PrintWriter pwrite = null;\r\n File fileObject = new File(getName());\r\n QuizPlayer q = new QuizPlayer(getName(), getNickname(), getTotalScore());\r\n\r\n try {\r\n ObjectOutputStream outputStream =\r\n new ObjectOutputStream(new FileOutputStream(fileObject));\r\n\r\n outputStream.writeObject(q); //Writes the object to the serialized file.\r\n outputStream.close();\r\n\r\n\r\n } catch (IOException e) {\r\n System.out.println(\"Problem with file output.\");\r\n }\r\n\r\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}", "void saveAs() {\n writeFile.Export();\n }", "public void writeToFile(StringBuilder text)throws IOException{\n\n Path filePath = Paths.get(\"index.txt\");\n if (!Files.exists(filePath)) {\n \t Files.createFile(filePath);\n \t}\n \tFiles.write(filePath, text.toString().getBytes(), StandardOpenOption.APPEND);\n }", "public void saveText() {\n\t\t\tapp.saveStrings(\"./data/exports/ID_Order.txt\", saveIDOrder);\n\t\t\t//Saving the new name text\n\t\t\tapp.saveStrings(\"./data/exports/Name_Order.txt\", saveNameOrder);\n\t\t\t//Saving the new breed text\n\t\t\tapp.saveStrings(\"./data/exports/Breed_Order.txt\", saveBreedOrder);\n\t\t\t//Saving the new date text\n\t\t\tapp.saveStrings(\"./data/exports/Date_Order.txt\", saveDateOrder);\n\t\t\n\t}", "private void saveTextToFile(String content, File file) {\n try {\n PrintWriter writer;\n writer = new PrintWriter(file);\n writer.println(content);\n writer.close();\n } catch (IOException ex) {\n Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void updateFile() {\n try {\n FileWriter fw = new FileWriter(path);\n for (Task t : taskList.getTasks()) {\n fw.write(t.toTxt());\n }\n fw.close();\n } catch (IOException e) {\n System.out.println(\"File cannot be found\");\n }\n }", "public void Write_data() {\n // add-write text into file\n try {\n FileOutputStream fileout=openFileOutput(\"savedata11.txt\", MODE_PRIVATE);\n OutputStreamWriter outputWriter=new OutputStreamWriter(fileout);\n outputWriter.write(Integer.toString(_cnt));\n outputWriter.close();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void save(String filename) {\n\n PrintWriter out = null;\n\n try {\n out = new PrintWriter(new BufferedWriter(new FileWriter(filename)));\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n out.println(undoCommands);\n out.close();\n }", "private void writeToFile(){\r\n File file = new File(\"leaderboard.txt\");\r\n\r\n try {\r\n FileWriter fr = new FileWriter(file, true);\r\n BufferedWriter br = new BufferedWriter(fr);\r\n for(Player player : this.sortedPlayers){\r\n br.write(player.toString());\r\n br.write(\"\\n\");\r\n }\r\n br.close();\r\n fr.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n }", "public void tempSaveToFile() {\n try {\n ObjectOutputStream outputStream = new ObjectOutputStream(\n this.openFileOutput(MenuActivity2048.TEMP_SAVE_FILENAME, MODE_PRIVATE));\n outputStream.writeObject(boardManager);\n outputStream.close();\n } catch (IOException e) {\n Log.e(\"Exception\", \"File write failed: \" + e.toString());\n }\n }", "public void signOut(){\n File coachStatusFile =new File(\"src/main/java/sample/data/LoginStatusCoach.json\");\n try {\n FileWriter fileWriter =new FileWriter(coachStatusFile);\n fileWriter.write(\"\");\n fileWriter.flush();\n fileWriter.close();\n System.out.println(\"file Clear!\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n application.gotoAboutUs();\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 }", "private void updateFile() {\n\t\tPrintWriter outfile;\n\t\ttry {\n\t\t\toutfile = new PrintWriter(new BufferedWriter(new FileWriter(\"stats.txt\")));\n\t\t\toutfile.println(\"15\"); // this is the number\n\t\t\tfor (Integer i : storeInfo) {\n\t\t\t\toutfile.println(i); // we overwrite the existing files\n\t\t\t}\n\t\t\tfor (String s : charBought) {\n\t\t\t\toutfile.println(s); // overwrite the character\n\t\t\t}\n\t\t\tfor (String s : miscBought) {\n\t\t\t\toutfile.println(s);\n\t\t\t}\n\t\t\toutfile.close();\n\t\t}\n\t\tcatch (IOException ex) {\n\t\t\tSystem.out.println(ex);\n\t\t}\n\t}", "public void save() {\n // Convert the settings to a string\n String output = readSettings();\n \n try {\n // Make sure the file exists\n if (!settingsFile.exists()) {\n File parent = settingsFile.getParentFile();\n parent.mkdirs();\n settingsFile.createNewFile(); \n }\n \n // Write the data into the file\n BufferedWriter writer = new BufferedWriter(new FileWriter(settingsFile));\n writer.write(output);\n writer.close(); \n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public static void endWrite()\r\n\t{\r\n\t\r\n\t}", "public static void writeFile(String text) throws IOException {\n\t\tWriter out = null;\n\t\ttry {\n\t\t\tout = new BufferedWriter(\n\t\t\t\t\tnew OutputStreamWriter(new FileOutputStream(\"toTranslate.txt\"), StandardCharsets.UTF_8));\n\t\t} catch (FileNotFoundException e1) {\n\t\t\tLOGGER.log(Level.WARNING, \"FileNotFoundException\", e1);\n\t\t\t;\n\t\t}\n\t\ttry {\n\t\t\tif (out != null)\n\t\t\t\tout.write(text);\n\t\t\telse\n\t\t\t\tSystem.out.println();\n\t\t} catch (IOException e) {\n\t\t\tLOGGER.log(Level.WARNING, \"IOException\", e);\n\t\t\t;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (out != null)\n\t\t\t\t\tout.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tLOGGER.log(Level.WARNING, \"IOException\", e);\n\t\t\t\tThread.currentThread().interrupt();\n\t\t\t}\n\t\t}\n\t}", "@FXML\n\tprivate void onSaveClicked(){\n\t\tPrintWriter writer = null;\n\t\ttry {\n\t\t\tFile file = new File(\"log.txt\");\n\t\t\tif (!file.exists()) {\n\t\t\t\tfile.createNewFile();\n\t\t\t}\n\t\t\tFileWriter fw = new FileWriter(file, true);\n\t\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\t\twriter = new PrintWriter(bw);\n\t\t\twriter.println(\"New record\");\n\t\t\tfor (int i = 0; i < list.size(); i++) {\n\n\t\t\t\twriter.println(list.get(i) +\" & \"+ (dat.get(i)));\n\t\t\t}\n\t\t} catch (IOException ioe) {\n\t\t\ttextArea.setText(\"Exception occurred:\" + ioe.getMessage());\n\t\t} finally {\n\t\t\tif (writer != null) {\n\t\t\t\twriter.close();\n\t\t\t}\n\t\t}\n\n\t}", "public static void saveDataToFile() {\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy MM dd, HH mm\");\n Date date = new Date();\n String fileName= dateFormat.format(date)+\".txt\";\n\n try {\n PrintWriter writer = new PrintWriter(fileName, \"UTF-8\");\n writer.print(\"Wins: \");\n writer.println(wins);\n writer.print(\"Draws: \");\n writer.println(draws);\n writer.print(\"Losses: \");\n writer.println(loses);\n writer.close();\n System.out.println(\"File Write Successful\");\n } catch (IOException e) {\n\n }\n\n\n }", "public void saveFile() throws FileNotFoundException {\r\n try {\r\n PrintWriter out = new PrintWriter(FILE_NAME);\r\n //This puts back the labels that the loadFile removed\r\n out.println(\"date,cust_email,cust_location,product_id,product_quantity\");\r\n int i = 0;\r\n\r\n while (i < orderInfo.size()) {\r\n String saved = orderInfo.get(i).toString();\r\n out.println(saved);\r\n i++;\r\n }\r\n out.close();\r\n } catch (FileNotFoundException e) {\r\n }\r\n\r\n }", "private void reportToFile() {\n try {\n fileWriter = new FileWriter(\"GameStats.txt\");\n fileWriter.write(reportContent);\n fileWriter.close();\n }\n catch (IOException ioe) {\n System.err.println(\"IO Exception thrown while trying to write to file GameStats.txt\");\n }\n }", "public final void saveToFile() {\n\t\tWrite.midi(getScore(), getName()+\".mid\"); \n\t}", "private void saveData( ) throws IOException {\n \tString FILENAME = \"data_file\";\n String stringT = Long.toString((SystemClock.elapsedRealtime() - timer.getBase())/1000)+\"\\n\";\n String stringS = textView.getText().toString()+\"\\n\";\n String stringD = Long.toString(System.currentTimeMillis())+\"\\n\";\n FileOutputStream fos;\n\t\ttry {\n\t\t\tfos = openFileOutput(FILENAME, Context.MODE_APPEND); //MODE_APPEND\n\t\t\tfos.write(stringS.getBytes());\n\t\t\tfos.write(stringT.getBytes());\n\t\t\tfos.write(stringD.getBytes());\n\t\t\tfos.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n }", "public static void writeTextAreaToFile() {\n PrintWriter pwriter;\n try {\n pwriter = new PrintWriter(new FileWriter(textFile));\n pwriter.print(textArea.getText());\n pwriter.close();\n } catch (IOException e) {\n System.err.println(\"Could not open file '\" + textFile + \"' for writing.\");\n }\n originalContent = textArea.getText();\n updateWriteButton();\n }", "public void close(){\n\t\ttry {\n\t\t\tout.close();\n\t\t\tout = null;\n\t\t}\n\t\tcatch (IOException e){\n\t\t\tSystem.out.println(\"Problem closing file.\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "public static void writeTextToFile() {\n try {\n FileOutputStream outputStream = new FileOutputStream(\"ex1.txt\");\n int number = Integer.parseInt(\"2f5\");\n outputStream.write(String.valueOf(number).getBytes());\n\n } catch (IOException | NumberFormatException e) {\n // handle exception\n } finally {\n System.out.println(\"Finally block\");\n }\n }", "public void saveFile() {\r\n File savedFile = new File(fileName);\r\n\r\n try (FileWriter fw = new FileWriter(savedFile)) {\r\n fw.write(workSpace.getText());\r\n\r\n fw.close();\r\n } catch (IOException ex) {\r\n JOptionPane.showMessageDialog(null, \"There was an error saving the file\");\r\n }\r\n }", "public void writeFile(){\n try{\n FileWriter writer = new FileWriter(\"Highscores.txt\");\n for (int i = 0; i<10; i++){\n if (i >= this.highscores.size()){\n break;\n }\n writer.write(String.valueOf(this.highscores.get(i)) + \"\\n\");\n }\n writer.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void close() {\n this.fileName = \"\";\n System.out.println(\"Closing the settings file\");\n }", "private void writeToFile() {\n boolean flag = true;\n int expectedPacket = (lastPacket)? sequenceNo: Constants.WINDOW_SIZE;\n for (int i = 0; i < expectedPacket; i++) {\n if(!receivedPacketList.containsKey(i)) {\n flag = false;\n }\n }\n if (flag) {\n System.out.println(\"Time: \" + System.currentTimeMillis() + \"\\t\" + \"Write to file Possible\");\n try (BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(fileSavePath, true))) {\n for (int i = 0; i < receivedPacketList.size(); i++) {\n //System.out.println(new String(receivedPacketList.get(i)));\n stream.write(receivedPacketList.get(i));\n }\n receivedPacketList.clear();\n stream.close();\n } catch (FileNotFoundException ex) {\n \n } catch (IOException ex) {\n \n }\n receivedPacketList.clear();\n expectedList.clear();\n }\n }", "private static void dosyaYazici(String text)\n {\n File log = new File(\"log.txt\");\n try\n {\n if (!log.exists())\n {\n log.createNewFile();\n }\n FileWriter fileWriter = new FileWriter(log,true);\n BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);\n bufferedWriter.append(text+\"\\n\");\n bufferedWriter.close();\n //System.out.print(\"TEST\");\n }\n catch (IOException e)\n {\n System.out.print(\"DOSYA HATASI!\");\n e.printStackTrace();\n }\n\n }", "public void close() throws IOException {\n FileOutputStream out = new FileOutputStream(fileName);\n wb.write(out);\n\n out.close();\n wb.close();\n }", "public void save(){\n\tif(currentFile == null){\n\t // TODO: add popup to select where to save file and file name\n\t // currentFile = new TextFile(os, title, null);\n\t}else{\n\t currentFile.setBody(textArea.getText());\n\t}\n }", "public void saveFile() {\r\n final String file = \"respuestaConjuntoDeDatosCon\" + this.numberOfBees + \"abejas.txt\";\r\n try {\r\n int count = 0;\r\n PrintWriter writer = new PrintWriter(file, \"UTF-8\");\r\n for (int i = 0; i < this.numberOfBees; i++) {\r\n if (beesArray[i].isInCollisionRisk()) {\r\n writer.println(beesArray[i].getLatitude() + \",\" + beesArray[i].getLongitude() + \",\" + beesArray[i].getHeight());\r\n count++;\r\n }\r\n }\r\n System.out.println(\"Number of bees in collision risk: \" + count);\r\n writer.close();\r\n } catch (IOException ioe) {\r\n System.out.println(\"Something went wrong writing the exit file\");\r\n }\r\n }", "private void saveOutputFile() {\n FileChooser fileChooser = new FileChooser();\n if (textMergeScript.hasCurrentDirectory()) {\n fileChooser.setInitialDirectory (textMergeScript.getCurrentDirectory());\n }\n chosenOutputFile = fileChooser.showSaveDialog (ownerWindow);\n if (fileChooser != null) {\n writeOutput();\n openOutputDataName.setText (tabNameOutput);\n }\n }", "synchronized public void saveToFile() {\n try {\n saveObjToFile(this, saveFilePath);\n } catch (IOException e) {\n e.printStackTrace();\n log(\"error saving resource to file\");\n }\n }", "void saveOption()\n{\n if(fname==null)\n saveFile();\n else\n { try{\n fname1=fname;\n int l=fname1.lastIndexOf(\"\\\\\");\n fname1= fname1.substring(l+1, fname1.length()-5);\n \n FileWriter fw= new FileWriter(fname);\n String s=textArea.getText();\n PrintWriter p =new PrintWriter(fw);\n p.println(s);\n p.flush();\n }\n catch(Exception e9)\n {\n System.out.println(e9);}\n \n \n\n }\n}", "public void printDataToFile(){\n\ttry {\n\t File file = new File(\"media/gameOutput.txt\");\n \n\t // if file doesnt exists, then create it\n\t if (!file.exists()) {\n\t\tfile.createNewFile();\n\t }\n \n\t FileWriter fw = new FileWriter(file.getAbsoluteFile());\n\t BufferedWriter bw = new BufferedWriter(fw);\n\t bw.write(printString);\n\t bw.close();\n\t} catch (IOException e) {\n\t e.printStackTrace();\n\t}\n }", "public void save(View v,String name) {\n String question = \"Question:\" + mQuestionView.getText().toString();\n String choice1 = \"Choice1:\" + mButtonChoice1.getText().toString();\n String choice2 = \"Choice2:\" + mButtonChoice2.getText().toString();\n String choice3 = \"Choice3:\" + mButtonChoice3.getText().toString();\n String choice4 = \"Choice4:\" + mButtonChoice4.getText().toString();\n String correctAnswer = \"correct answer:\" +mAnswer;\n File file = new File(getFilesDir() + \"/\" + name); //path where it is save\n String lineSeparator = System.getProperty(\"line.separator\"); //new line\n FileOutputStream fos = null;\n try {\n fos = new FileOutputStream(file, true);\n fos = openFileOutput(name, MODE_APPEND);\n fos.write(question.getBytes());//display the questions\n fos.write(lineSeparator.getBytes());//creates a new line\n fos.write(choice1.getBytes());//display the choices\n fos.write(lineSeparator.getBytes());\n fos.write(choice2.getBytes());\n fos.write(lineSeparator.getBytes());\n fos.write(choice3.getBytes());\n fos.write(lineSeparator.getBytes());\n fos.write(choice4.getBytes());\n fos.write(lineSeparator.getBytes());\n fos.write(correctAnswer.getBytes());\n fos.write(lineSeparator.getBytes());\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (fos != null) {\n try {\n fos.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n }", "public void clearFile(File file){\n try{\n PrintWriter writer = new PrintWriter(file);\n writer.close();\n }\n catch(IOException e){\n System.out.println(\"IOException\");\n }\n }", "private void writeToFile(){\n Calendar c = Calendar.getInstance();\n String dateMedTaken = DateFormat.getDateInstance(DateFormat.FULL).format(c);\n FileOutputStream fos = null;\n\n try {\n fos = openFileOutput(FILE_NAME, MODE_APPEND);\n fos.write(dateMedTaken.getBytes());\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if(fos != null){\n try {\n fos.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n }", "private static void textFilesOutput() {\n\n // make output directory if it doesn't already exist\n new File(\"output\").mkdirs();\n\n Output airportFlightCounter = new AirportFlightCounter(airports);\n Output flightInventory = new FlightInventory(flights);\n Output flightPassengerCounter = new FlightPassengerCounter(flights);\n Output mileageCounter = new MileageCounter(flights, airports);\n\n try {\n airportFlightCounter.toTextFile();\n flightInventory.toTextFile();\n flightPassengerCounter.toTextFile();\n mileageCounter.toTextFile();\n } catch (FileNotFoundException e) {\n logger.error(\"Could not write to one or more text files - please close any open instances of that file\");\n e.printStackTrace();\n }\n\n logger.info(\"Output to text files completed\");\n }", "public static void WriteToFile(){\r\n try {\r\n File file = new File(\"output.txt\");\r\n file.createNewFile();\r\n \r\n FileWriter fw = new FileWriter(file.getAbsoluteFile());\r\n BufferedWriter bw = new BufferedWriter(fw);\r\n String[] FinalBoard = new String[Board.ReportBoardValues().length];\r\n FinalBoard = Board.ReportBoardValues();\r\n for(int i = 0; i < Board.ReportBoardValues().length; i++){\r\n bw.write(FinalBoard[i]);\r\n bw.newLine();\r\n }\r\n bw.close();\r\n fw.close();\r\n \r\n }\r\n catch (IOException e) {\r\n System.out.println (\"Output error\");\r\n }\r\n }", "private void saveFile(File file){\n\t\ttry{\r\n\t\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(file));\r\n\t\t\t\r\n\t\t\tfor(QuizCard card:cardList){\r\n\t\t\t\twriter.write(card.getQuestion() + \"/\");\r\n\t\t\t\twriter.write(card.getAnswer() + \"\\n\");\r\n\t\t\t}\r\n\t\t\twriter.close();\r\n\t\t} catch (IOException ex){\r\n\t\t\tSystem.out.println(\"couldn't write the cardList out\");\r\n\t\t\tex.printStackTrace();}\r\n\t}", "public void write(String filename, String text) {\n\n try (FileWriter writer = new FileWriter(filename)) {\n writer.write(text);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public void overWriteLine(String tag, String newtext) throws Exception{\n\t\t\n\t\tPrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter(this.scholarship + \" \" + this.student + \".temp\")));\n\t\tBufferedReader br = new BufferedReader(new FileReader(this.appfile));\n\t\t\n\t\tString line;\n\t\t\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tif (line.equals(tag)) {\n\t\t\t\twriter.println(line);\n\t\t\t\tline = br.readLine();\n\t\t\t\tline = newtext;\n\t\t\t}\n\t\t\n\t\t\twriter.println(line);\n\t\t}\n\t\t\n\t\tbr.close();\n\t\twriter.close();\t\n\t\t\n\t\tFile f = new File(this.appfile);\n\t\tboolean b = f.delete();\n\t\tFile f1 = new File(this.appfile);\n\t\tFile f2 = new File(this.scholarship + \" \" + this.student + \".temp\");\n\t\tb = f2.renameTo(f1);\n\t\tFile f3 = new File(this.scholarship + \" \" + this.student + \".temp\");\n\t\tb = f3.delete();\n\t}", "private void fecharArquivoEscrita(BufferedWriter file) {\n\t\ttry {\n\t\t\tfile.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void updateFile() {\n try {\n this.taskStorage.save(this.taskList);\n this.aliasStorage.save(this.parser);\n } catch (IOException e) {\n System.out.println(\"Master i am unable to save the file!\");\n }\n }", "private void writeToFile() {\n try {\n FileOutputStream fos = new FileOutputStream(f);\n String toWrite = myJSON.toString(4);\n byte[] b = toWrite.getBytes();\n fos.write(b);\n fos.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void writeScoreToFile(){\n\t\ttry{\n\t\t\tFile file = new File(\"conversation_file.txt\");\n\t\t\tFileWriter f = new FileWriter(file.getAbsoluteFile());\n\t\t\tBufferedWriter b = new BufferedWriter(f);\n\t\t\tif(score > highScore)\n\t\t\t\tb.write(String.valueOf(score));\n\t\t\telse\n\t\t\t\tb.write(String.valueOf(highScore));\n\t\t\tb.close();\n\t\t} catch (IOException e){}\n\t\tSystem.out.println(\"File written, highScore \" + highScore + \" or Score \" + score + \" saved to file.\");\n\t}", "public static void writeTextToFile(String fileName,String text){\r\n File file=new File(fileName);\r\n log.fine(\"Writing to file: \"+fileName);\r\n try { if (!file.exists()){\r\n file.createNewFile();\r\n }\r\n PrintWriter out=new PrintWriter(file.getAbsoluteFile());\r\n try {\r\n out.print(text);\r\n }finally {\r\n out.close();\r\n }\r\n }catch (IOException e){\r\n throw new RuntimeException(e);\r\n }\r\n }", "private void fileModify(String text) throws IOException {\n text += \"\\n\";\n try {\n File filePath;\n filePath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS);\n if (!filePath.exists()) {\n if (filePath.mkdir()) ; //directory is created;\n }\n\n fileOutputStream = new FileOutputStream(file);\n fileOutputStream.write(text.getBytes());\n\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n fileOutputStream.flush();\n try {\n fileOutputStream.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "static void writeFile(){\n try{\n Path contactsListPath = Paths.get(\"contacts\",\"contacts.txt\");\n Files.write(contactsListPath, contactList);\n } catch(IOException ioe){\n ioe.printStackTrace();\n }\n //refreshes list of Contact objs\n fileToContactObjs();\n }", "void saveFile () {\r\n\r\n\t\ttry {\r\n\t\t\tFileOutputStream fos = new FileOutputStream (\"Bank.dat\", true);\r\n\t\t\tDataOutputStream dos = new DataOutputStream (fos);\r\n\t\t\tdos.writeUTF (saves[count][0]);\r\n\t\t\tdos.writeUTF (saves[count][1]);\r\n\t\t\tdos.writeUTF (saves[count][2]);\r\n\t\t\tdos.writeUTF (saves[count][3]);\r\n\t\t\tdos.writeUTF (saves[count][4]);\r\n\t\t\tdos.writeUTF (saves[count][5]);\r\n\t\t\tJOptionPane.showMessageDialog (this, \"The Record has been Saved Successfully\",\r\n\t\t\t\t\t\t\"BankSystem - Record Saved\", JOptionPane.PLAIN_MESSAGE);\r\n\t\t\ttxtClear ();\r\n\t\t\tdos.close();\r\n\t\t\tfos.close();\r\n\t\t}\r\n\t\tcatch (IOException ioe) {\r\n\t\t\tJOptionPane.showMessageDialog (this, \"There are Some Problem with File\",\r\n\t\t\t\t\t\t\"BankSystem - Problem\", JOptionPane.PLAIN_MESSAGE);\r\n\t\t}\r\n\r\n\t}", "private void saveIt(String text, File file) {\n String[] line = text.split(\"\\n\");\n System.out.println(\"the size of string array is \" + line.length );\n if (file == null) {\n logger.debug(\"Null return because Closed the save stage\");\n return;\n }\n try {\n logger.info(\"saving file...\");\n PrintStream stream = new PrintStream(file);\n stream.write(text.getBytes());\n } catch(IOException io) {\n logger.error(io.getMessage());\n }\n logger.info(\"saved\");\n }", "public abstract void writeToFile( );", "private static void saveTranscations() {\n\t\tSystem.out.println(\"All Transcations saved in a File named transcation.txt \");\n\t}", "@Override\n\tpublic void flush() {\n\t\ttry {\n\t\t\tFile f = new File(path);\n\t\t\tFileWriter fw = new FileWriter(f);\n\t\t\tfw.write(\"\");\n\t\t\tfw.close();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t \n\t \n\t\n\t try {\n\t\t \n\t\t\n\t\t \n\t\t\tObjectOutputStream os;\n\t\t\tFile file = new File(path);\n\t\t\tFileOutputStream fos = new FileOutputStream(file, true);\n\t\t\tif (file.length() < 1) {\n\t\t\t\tos = new ObjectOutputStream(fos);\n\t\t\t} else {\n\t\t\t\tos = new MyObjectOutputStream(fos);\n\t\t\t}\n\t\t\tos.writeObject(constantPO);\n\t\t\tos.flush();\n\t\t\tos.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}\n\t}", "public String writeFileUnderGrad(String fileName) {\n Formatter f = new Formatter();//Use Formatter\r\n f.format(\"%s (%d, %s, %s)%n\", super.getStudentName(), super.getStudentNumber(), super.getStudentSex(), super.getStudentDOB());//Format Student Output\r\n //System.out.println(f);\r\n BufferedWriter out = null; //BufferedWriter\r\n PrintWriter out1 = null; //Use PrintWriter\r\n //Try and Catch method to create the txt file, flush and close\r\n try {\r\n\r\n out = new BufferedWriter(new FileWriter(fileName, true));\r\n out1 = new PrintWriter(out);\r\n out1.write(f.toString());\r\n out1.flush();//Flush text file\r\n } catch (IOException e) {\r\n System.out.println(\"Exception \");\r\n } finally {\r\n try {\r\n out.close();\r\n out1.close();\r\n } catch (IOException ex) {\r\n Logger.getLogger(UnderGraduate.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n return \"\";\r\n\r\n }" ]
[ "0.72260505", "0.71449405", "0.6854727", "0.68528485", "0.6847532", "0.66589856", "0.6559203", "0.6557837", "0.6554788", "0.6540643", "0.65273976", "0.64871085", "0.6486883", "0.64812076", "0.6447853", "0.6446415", "0.6421534", "0.63908815", "0.6361345", "0.6347869", "0.6331447", "0.6303766", "0.62980425", "0.6285205", "0.6267163", "0.6264008", "0.6258772", "0.6248721", "0.6218691", "0.62174875", "0.6209851", "0.62083596", "0.6187076", "0.61692405", "0.61581004", "0.61458844", "0.6145703", "0.6141347", "0.61320615", "0.6131003", "0.6127141", "0.61060584", "0.61008173", "0.6098702", "0.60967755", "0.60844445", "0.608354", "0.6076406", "0.60723263", "0.6069477", "0.6060493", "0.60535926", "0.60508335", "0.60453886", "0.6036892", "0.60346496", "0.6033951", "0.6031905", "0.60202813", "0.6014993", "0.60132104", "0.6012004", "0.5993255", "0.5992385", "0.5992225", "0.5989971", "0.59871495", "0.59840715", "0.59795827", "0.5971688", "0.5963485", "0.59623235", "0.5958924", "0.595694", "0.5954973", "0.5953718", "0.5951797", "0.5945866", "0.5944107", "0.59431714", "0.5941893", "0.59415084", "0.59353447", "0.59337455", "0.5929226", "0.59222746", "0.59212804", "0.59210455", "0.5919097", "0.5918849", "0.5917993", "0.5913617", "0.5901696", "0.5901615", "0.5900208", "0.58983463", "0.5890028", "0.5889545", "0.5886282", "0.5875229" ]
0.6146189
35
This method will delete the row
private void toDelete() { if(toCount()==0) { JOptionPane.showMessageDialog(rootPane,"No paint detail has been currently added"); } else { String[] choices={"Delete First Row","Delete Last Row","Delete With Index"}; int option=JOptionPane.showOptionDialog(rootPane, "How would you like to delete data?", "Delete Data", WIDTH, HEIGHT,null , choices, NORMAL); if(option==0) { jtModel.removeRow(toCount()-toCount()); JOptionPane.showMessageDialog(rootPane,"Successfully deleted first row"); } else if(option==1) { jtModel.removeRow(toCount()-1); JOptionPane.showMessageDialog(rootPane,"Successfully deleted last row"); } else if(option==2) { toDeletIndex(); } else { } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void deleteRow() throws SQLException\n {\n m_rs.deleteRow();\n }", "public void actionPerformed(ActionEvent e) {\n model.deleteRow();\n }", "public native void deleteRow(int row) /*-{\n\t\tvar jso = [email protected]::getJsObj()();\n\t\tjso.deleteRow(row);\n }-*/;", "public void deleteRow(int row) throws IndexOutOfBoundsException{\r\n data.remove(row);\r\n fireTableRowsDeleted(row,row);\r\n }", "public void deleteRow(Row _deleteThis){\r\n if(!validTable()){\r\n System.out.println(\"Error:Table:deleteRow: table invalid, nothing done\");\r\n return;\r\n }\r\n Set<String> keys = rows.keySet();\r\n //Searches for row to delete and then removes it\r\n for(String k : keys) {\r\n if(_deleteThis.getData() == rows.get(k).getData()){\r\n rows.remove(k);\r\n return;\r\n }\r\n }\r\n System.out.println(\"Error:Table:deleteRow: Unable to find passed row, no row deleted\");\r\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tdelRow();\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tdelRow();\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSystem.out.println(\"btnDelete\");\n\t\t\t\tint i = table.getSelectedRow();\n\t\t\t\tif (i >= 0) {\n\t\t\t\t\tSystem.out.println(\"row-Delete\" + i);\n\t\t\t\t\tSystem.out.println(\"row-Delete\" + textSuppD.getText());\n\t\t\t\t\tint suppID = Integer.parseInt(textSuppD.getText().trim());\n\n\t\t\t\t\tDatabase db = new Database();\n\t\t\t\t\tSuppliersDAO suppDAO = new SuppliersDAO(db);\n\t\t\t\t\tSuppliersModel suppModel = new SuppliersModel();\n\t\t\t\t\tsuppModel.setSuppliers_id(suppID);\n\t\t\t\t\tsuppDAO.Delete(suppModel);\n\t\t\t\t\tdb.commit();\n\t\t\t\t\tdb.close();\n\n\t\t\t\t\tmodel.removeRow(i);\n\t\t\t\t} else {\n\t\t\t\t}\n\t\t\t}", "private void deleteRow(int selectedRow){\r\n BudgetSubAwardBean budgetSubAwardBean = (BudgetSubAwardBean)data.get(selectedRow);\r\n if(budgetSubAwardBean.getAcType() == null || budgetSubAwardBean.getAcType().equals(TypeConstants.UPDATE_RECORD)){\r\n budgetSubAwardBean.setAcType(TypeConstants.DELETE_RECORD);\r\n budgetSubAwardBean.setUpdateUser(userId);\r\n if(deletedData ==null) {\r\n deletedData = new ArrayList();\r\n }\r\n deletedData.add(budgetSubAwardBean);\r\n }\r\n data.remove(selectedRow);\r\n \r\n //If Last Row nothing to do\r\n //else Update Sub Award Number for rest of the Rows\r\n /*int size = data.size();\r\n if(selectedRow != size) {\r\n for(int index = selectedRow; index < size; index++) {\r\n budgetSubAwardBean = (BudgetSubAwardBean)data.get(index);\r\n budgetSubAwardBean.setSubAwardNumber(index + 1);\r\n if(budgetSubAwardBean.getAcType() == null) {\r\n budgetSubAwardBean.setAcType(TypeConstants.UPDATE_RECORD);\r\n }\r\n }//End For\r\n }//End If\r\n */\r\n \r\n subAwardBudgetTableModel.fireTableRowsDeleted(selectedRow, selectedRow);\r\n }", "private void delete(int selectedRow) {\r\n removing = true;\r\n deletingRow = selectedRow;\r\n //subAwardBudgetTableModel.deleteRow(selectedRow);\r\n deleteRow(selectedRow);\r\n \r\n //Select a Row\r\n int selectRow = 0;\r\n int rowCount = subAwardBudgetTableModel.getRowCount();\r\n if(selectedRow == 0 && rowCount > 0) {\r\n //Select First Row\r\n selectRow = 0;\r\n }else if(selectedRow == rowCount) {\r\n //Select Last Row\r\n selectRow = rowCount - 1;\r\n }else {\r\n //Select This Row\r\n selectRow = selectedRow;\r\n }\r\n removing = false;\r\n if(selectRow != -1) {\r\n subAwardBudget.tblSubAwardBudget.setRowSelectionInterval(selectRow, selectRow);\r\n }else{\r\n //If All rows Deleted, then Details panel should be cleared\r\n displayDetails();\r\n }\r\n deletingRow = -1;\r\n }", "public boolean deleteRow(int row) {\n try {\n resultSet.absolute(row + 1);\n resultSet.deleteRow();\n //tell table to redraw itself\n fireTableDataChanged();\n return true;\n } catch (SQLException se) {\n System.out.println(\"Delete row error \" + se);\n return false;\n }\n }", "public void deleteRow(String row) {\n database.delete(ORDER_MASTER, ORDER_ID + \"=\" + row, null);\n }", "public void deleteCartRow() {\n CarComponent selectedRow = cartTable.getSelectionModel().getSelectedItem();\n cartTable.getItems().remove(selectedRow);\n componentsCart.remove(selectedRow);\n\n updateTotal();\n }", "public void delete()\n\t{\n\t\t_Status = DBRowStatus.Deleted;\n\t}", "public void delete(JTable tblUser)\n {\n int i = tblUser.getSelectedRow();\n \n if(i != -1)\n {\n usersDto = users[i];\n \n if(usersDto.getState() != 3)\n {\n if(JOptionPane.showConfirmDialog(null, \"¿Está seguro que desea eliminar el registro?\", \"Eliminar\", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION)\n {\n try {\n usersDto.setState((short) 3);\n \n if(usersDao.update(usersDto.createPk(), usersDto)) {\n tableModel = (DefaultTableModel) tblUser.getModel();\n tableModel.setValueAt(\"*\", i, 6);\n }\n \n } catch (UsersDaoException exception) {}\n }\n \n } else { JOptionPane.showMessageDialog(null, \"El registro ya está eliminado\", \"ERROR\", JOptionPane.ERROR_MESSAGE); }\n \n } else { JOptionPane.showMessageDialog(null, \"Seleccione un registro a eliminar\", \"ERROR\", JOptionPane.ERROR_MESSAGE); }\n }", "public void deleteRow(int row) {\n\t\tif (row == -1) return;\n\t\t\n\t\tdata.remove(row);\n\t\tfireTableRowsDeleted(row, row);\n\t}", "public void deleteRow() throws SQLException {\n\n try {\n debugCodeCall(\"deleteRow\");\n checkClosed();\n if (insertRow != null) { throw Message.getSQLException(ErrorCode.NOT_ON_UPDATABLE_ROW); }\n checkOnValidRow();\n getUpdatableRow().deleteRow(result.currentRow());\n updateRow = null;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public void deleteRow(MyItem row) {\n\n\t\tif (MyItemAdapter.rows.contains(row)) {\n\t\t\tMyItemAdapter.rows.remove(row);\n\t\t}\n\n\t}", "void row_delete(int id){\n\t\t//Delete tuple by executing SQL command\n\t\tStatement stm=null;\n\t\tString sql=\"delete from \"+tableName+\" where id=\"+id;\n\t\ttry{\n\t \t stm=con.createStatement(); \n\t \t System.out.println(\"sql: \"+sql); \n\t \t stm.executeUpdate(sql);\n\t \t \n\t \t //Append SQL command and time stamp on log file\n\t \t outfile.write(\"TIMESTAMP: \"+getTimestamp());\n\t\t\t outfile.newLine();\n\t\t\t outfile.write(sql);\n\t\t\t outfile.newLine();\n\t\t\t outfile.newLine();\n\t\t \n\t\t //Catch SQL exception\t \t \n\t }catch (SQLException e ) {\n\t \t e.printStackTrace();\n\t //Catch I/O exception\n\t } catch(IOException ioe){ \n\t \t ioe.printStackTrace();\n\t }finally {\n\t \t try{\n\t if (stm != null) stm.close(); \n\t }\n\t \t catch (SQLException e ) {\n\t \t\t e.printStackTrace();\n\t\t }\n\t }\t\n\t\t \n\t }", "private void jbtn_deleteActionPerformed(ActionEvent evt) {\n\t\tDefaultTableModel RecordTable=(DefaultTableModel)jTable1.getModel();\n\t\tint Selectedrow=jTable1.getSelectedRow();\n\t\t\n\t\ttry\n\t\t{\n\t\t\tid=RecordTable.getValueAt(Selectedrow,0).toString();\n\t\t\tdeleteItem=JOptionPane.showConfirmDialog(this,\"Confirm if you want to delete the record\",\"Warning\",JOptionPane.YES_NO_OPTION);\n\t\t\t\n\t\t\tif(deleteItem==JOptionPane.YES_OPTION)\n\t\t\t{\n\t\t\t\tconn cc=new conn();\n\t\t\t\tpst=cc.c.prepareStatement(\"delete from medicine where medicine_name=?\");\n\t\t\t pst.setString(1,id);\n\t\t\t\tpst.executeUpdate();\n\t\t\t\tJOptionPane.showMessageDialog(this,\"Record Updated\");\n\t\t\t\tupDateDB();\n\t\t\t\ttxtblank();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t\t\n\t}", "private void DeletebuttonActionPerformed(ActionEvent e) {\n int row = userTable.getSelectedRow();\n\n if (row == -1) {\n JOptionPane.showMessageDialog(ListUserForm.this, \"Vui lòng chọn user\", \"lỗi\", JOptionPane.ERROR_MESSAGE);\n } else {\n int confirm = JOptionPane.showConfirmDialog(ListUserForm.this, \"Bạn có chắc chắn xoá?\");\n\n if (confirm == JOptionPane.YES_OPTION) {\n\n int userid = Integer.parseInt(String.valueOf(userTable.getValueAt(row, 0)));\n\n userService.deleteUser(userid);\n\n defaultTableModel.setRowCount(0);\n setData(userService.getAllUsers());\n }\n }\n }", "@Override\n\tpublic boolean delete() {\n\t\tString sql=\"DELETE FROM tc_student where id=\"+id;\n\t\t//`\n\t\t\n\t\tSystem.out.println(sql);\n\t\treturn mysql.execute(sql);\n\t}", "public native void deleteRow(int row, TableViewAnimation animation) /*-{\n\t\tvar jso = [email protected]::getJsObj()();\n\t\tjso\n\t\t\t\t.deleteRow(\n\t\t\t\t\t\trow,\n\t\t\t\t\t\[email protected]::getJsObj()());\n }-*/;", "public void removeRow(String rowName);", "public void dbDeleteRow(EdaContext xContext)\n\tthrows IcofException{\n\n\t\t// Create the SQL query in the PreparedStatement.\n\t\tsetDeleteStatement(xContext);\n\t\ttry {\n\t\t\tgetStatement().setLong(1, getId());\n\n\t\t}\n\t\tcatch(SQLException trap) {\n\t\t\tIcofException ie = new IcofException(this.getClass().getName(),\n\t\t\t \"dbDeleteRow()\",\n\t\t\t IcofException.SEVERE,\n\t\t\t \"Unable to prepare SQL statement.\",\n\t\t\t IcofException.printStackTraceAsString(trap) + \n\t\t\t \"\\n\" + getQuery());\n\t\t\txContext.getSessionLog().log(ie);\n\t\t\tthrow ie;\n\t\t}\n\n\t\t// Run the query.\n\t\tif (! insertRow(xContext)) {\n\t\t\tIcofException ie = new IcofException(this.getClass().getName(),\n\t\t\t \"dbDeleteRow()\",\n\t\t\t IcofException.SEVERE,\n\t\t\t \"Unable to delete row.\\n\",\n\t\t\t \"QUERY: \" + getQuery());\n\t\t\txContext.getSessionLog().log(ie);\n\t\t\tthrow ie;\n\t\t}\n\n\t\t// Close the PreparedStatement.\n\t\tcloseStatement(xContext);\n\n\t}", "public void deleteEntry(int rowid) {\n\t\t\tourDatabase.delete(DATABASE_TABLE1, KEY_ID + \"=\" + rowid, null);\n\t\t}", "public void deleteEntry(long row) {\n database.delete(ORDER_MASTER, ROW_ID + \"=\" + row, null);\n }", "private void delete()\n\t{\n\t\ttry\n\t\t{\n\t\t\tConnection con = Connector.DBcon();\n\t\t\tString query = \"select * from items where IT_ID=?\";\n\t\t\t\n\t\t\tPreparedStatement pst = con.prepareStatement(query);\n\t\t\tpst.setString(1, txticode.getText());\n\t\t\tResultSet rs = pst.executeQuery();\n\t\t\t\n\t\t\tint count = 0;\n\t\t\twhile(rs.next())\n\t\t\t{\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\t\n\t\t\tif(count == 1)\n\t\t\t{\n\t\t\t\tint choice = JOptionPane.showConfirmDialog(null, \"Are you sure you want to delete selected item data?\", \"ALERT\", JOptionPane.YES_NO_OPTION);\n\t\t\t\tif(choice==JOptionPane.YES_OPTION)\n\t\t\t\t{\n\t\t\t\t\tquery=\"delete from items where IT_ID=?\";\n\t\t\t\t\tpst = con.prepareStatement(query);\n\t\t\t\t\t\n\t\t\t\t\tpst.setString(1, txticode.getText());\n\t\t\t\t\t\n\t\t\t\t\tpst.execute();\n\t\t\t\t\t\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Deleted Successfully\", \"RESULT\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tloadData();\n\t\t\t\t\n\t\t\t\trs.close();\n\t\t\t\tpst.close();\n\t\t\t\tcon.close();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\telse\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Record Not Found!\", \"Alert\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\n\t\t\trs.close();\n\t\t\tpst.close();\n\t\t\tcon.close();\n\t\t\t\n\t\t} \n\t\tcatch (Exception e)\n\t\t{\n\t\t\tJOptionPane.showMessageDialog(null, e);\n\t\t}\n\t}", "private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {// GEN\n // -\n // FIRST\n // :\n // event_deleteButtonActionPerformed\n int rowIndex = headerTable.getSelectedRow();\n if (rowIndex > -1) {\n removeRow(rowIndex);\n }\n }", "public void delete() throws SQLException {\r\n\t\t//SQL Statement\r\n\r\n\t\tString sql = \"DELETE FROM \" + table+ \" WHERE \" + col_genreID + \" = ?\";\r\n\t\tPreparedStatement stmt = DBConnection.getConnection().prepareStatement(sql);\r\n\t\tstmt.setInt(1, this.getGenreID());\r\n\r\n\t\tint rowsDeleted = stmt.executeUpdate();\r\n\t\tSystem.out.println(\"Es wurden \"+rowsDeleted+ \"Zeilen gelöscht\");\r\n\t\tstmt.close();\r\n\t}", "public int deleteIndex(FeatureRow row) {\n return deleteIndex(row.getId());\n }", "public DResult delete(byte[] row, long startId) throws IOException;", "public static void deleteRow(HTable table, String rowKey) throws Exception {\n\t\tDelete delete = new Delete(Bytes.toBytes(rowKey));\n\t\ttable.delete(delete);\n\t\tSystem.out.println(\"Delete row: \" + rowKey);\n\t}", "public void toDeletIndex()\n {\n try\n { \n //DefaultTableModel model=(DefaultTableModel)jt.getModel(); \n //jt.getModel();\n int num=Integer.parseInt(JOptionPane.showInputDialog(rootPane,\"Enter the row number\")); \n jtModel.removeRow(num-1);\n JOptionPane.showMessageDialog(rootPane,\"Successfully deleted selected row number \" +num);\n }\n catch(NumberFormatException ex)\n {\n JOptionPane.showMessageDialog(rootPane,\"Enter integer not alphabet\");\n } \n catch(ArrayIndexOutOfBoundsException ex)\n {\n JOptionPane.showMessageDialog(rootPane,\"This row dosent exist\");\n }\n }", "public String onDelete(final DataTableCRUDRow<R> row) {\n try {\n getModel().setRowClicked(row);\n if (!row.isNewRow()) {\n delete(row.getElement());\n } else {\n row.setReadonly(true);\n }\n row.setDeleted(true);\n } catch (final MessageLabelException e) {\n log.trace(e.getMessage(), e);\n getFacesMessages().message(e);\n }\n return \"\";\n }", "@FXML\n private void deleteRow(ActionEvent event){\n if(facilitiesView.getSelectionModel().getSelectedItem()==null){\n errorBox(\"Feil\", \"Det er ingen rader som er markert\", \"Vennligst marker en rad i tabellen\");\n }\n else{\n Alert mb = new Alert(Alert.AlertType.CONFIRMATION);\n mb.setTitle(\"Bekreft\");\n mb.setHeaderText(\"Du har trykket slett på \"+ facilitiesView.getSelectionModel().getSelectedItem().getFacilityName());\n mb.setContentText(\"Ønsker du virkerlig å slette dette lokalet?\");\n mb.showAndWait().ifPresent(response -> {\n if(response== ButtonType.OK){\n observableList.remove(facilitiesView.getSelectionModel().getSelectedItem());\n\n File file = new File(EditedFiles.getActiveFacilityFile());\n file.delete();\n try {\n WriterThreadRunner.WriterThreadRunner(getFacilities(), EditedFiles.getActiveFacilityFile());\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n }\n });\n }\n }", "@Override\n public void delete(Integer key) throws SQLException {\n //Ei toteutettu\n }", "private void delete(ByteBuffer rowKey,\n Clustering<?> clustering,\n Cell<?> cell,\n WriteContext ctx,\n long nowInSec)\n {\n DecoratedKey valueKey = getIndexKeyFor(getIndexedValue(rowKey,\n clustering,\n cell));\n doDelete(valueKey,\n buildIndexClustering(rowKey, clustering, cell),\n DeletionTime.build(cell.timestamp(), nowInSec),\n ctx);\n }", "@Override\n public void onClick(View v) {\n\n CouSyncDb.getInstance(getApplicationContext()).deleteSync(bean1, new OnOperateFinish() {\n @Override\n public void onFinish(int operateType, Object result) {\n text.setText(\"delete row ID = \" + result.toString());\n }\n });\n }", "@Override\r\n\tpublic void removeRow(int row) {\r\n\t\tsuper.removeRow(row);\r\n\t\telenco = lista.getElenco();\r\n\t\tPersona removable = new Persona();\r\n\t\tremovable.setNome(elenco.elementAt(row).getNome());\r\n\t\tremovable.setCognome(elenco.elementAt(row).getCognome());\r\n\t\tremovable.setTelefono(elenco.elementAt(row).getTelefono());\r\n\t\tremovable.setIndirizzo(elenco.elementAt(row).getIndirizzo());\r\n\t\tremovable.setEta(elenco.elementAt(row).getEta());\r\n\t\ttry {\r\n\t\t\tlista.delete(removable, row);\r\n\t\t\t}\r\n\t\t\tcatch (ArrayIndexOutOfBoundsException aioe) {\r\n\t\t\t\tString message = AIOE_MESSAGE\r\n\t\t\t\t\t\t+row + \" on table \"\r\n\t\t\t\t\t\t+lista.getElenco().indexOf(removable)\r\n\t\t\t\t\t\t+ \" on Lista \";\r\n\t\t\t\tJOptionPane.showMessageDialog(null, message);\r\n\t\t\t}\r\n\t}", "public void deleteButtonPushed() {\r\n ObservableList<Student> allStudents;\r\n Student selectedRow;\r\n allStudents = tableView.getItems();\r\n \r\n // This gives us the row that was selected\r\n selectedRow = tableView.getSelectionModel().getSelectedItems().get(0);\r\n \r\n\r\n try {\r\n covidMngrService.deleteStudent(selectedRow);\r\n \r\n // Remove the Student object from the table\r\n allStudents.remove(selectedRow);\r\n } catch (RemoteException ex) {\r\n Logger.getLogger(SecretaryStudentsTableCntrl.class.getName()).\r\n log(Level.SEVERE, null, ex);\r\n }\r\n }", "@Override\n public void remove() throws IOException {\n int i = listEnterprisePanel.getTableListE().getSelectedRow(); // chọn hàng để xóa\n if (i >= 0) {\n String strID = listEnterprisePanel.getTableListE().getValueAt(i, 1).toString().trim(); // lấy ID\n Enterprise enterprise = enterpriseBN.getEnterpriseByID(strID); // Tìm kiếm Enterprise theo ID\n content.set(Collections.singleton(enterprise), null);\n enterpriseBN.deleteEnterprise(enterprise);\n model.removeRow(i);\n loadData();\n }\n\n }", "public boolean delete(long rowId) {\n\t\treturn db.delete(tableName, fields[0] + \" = \" + String.valueOf(rowId), null) > 0;\t\t\n\t}", "@FXML\r\n public void deleteTreatmentButton(){\r\n int sIndex = treatmentTabletv.getSelectionModel().getSelectedIndex();\r\n String sID = treatmentData.get(sIndex).getIdProperty();\r\n\r\n String deleteTreatment = \"delete from treatment where treatmentID = ?\";\r\n try{\r\n ps = mysql.prepareStatement(deleteTreatment);\r\n ps.setString(1,sID);\r\n ps.executeUpdate();\r\n ps.close();\r\n ps = null;\r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n //maybe more in this exception\r\n }\r\n\r\n treatmentData.remove(sIndex);\r\n }", "private void tampilkan() {\n int row = table.getRowCount();\n for(int a= 0; a<row;a++){\n model.removeRow(0);\n }\n \n \n }", "private void delete_btnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_delete_btnActionPerformed\n // pull current table model\n DefaultTableModel model = (DefaultTableModel) remindersTable.getModel();\n if (remindersTable.getSelectedRow() == -1) {\n if (remindersTable.getRowCount() == 0) {\n dm.messageEmptyTable();\n } else {\n dm.messageSelectLine();\n }\n } else {\n int input = JOptionPane.showConfirmDialog(frame, \"Do you want to Delete!\");\n // 0 = yes, 1 = no, 2 = cancel\n if (input == 0) {\n model.removeRow(remindersTable.getSelectedRow());\n dm.messageReminderDeleted();// user message;\n saveDataToFile();// Save changes to file\n getSum(); // Update projected balance\n } else {\n // delete canceled\n }\n }\n }", "void removeRow(int row_index) throws IOException;", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tint RowNum=jt.getSelectedRow();\n\t\t\t\tif(RowNum==-1){\n\t\t\t\t\tJOptionPane.showMessageDialog(jt, \"请选择一行\");\n\t\t\t\t return ;\n\t\t\t }\n\t\t\t\t\n\t\t\t\tint isDelete=JOptionPane.showConfirmDialog(null, \"是否确定删除该专业以及该专业所有班级与学生信息?\");\n\t\t\t\t\n\t\t\t\tif(isDelete==JOptionPane.YES_OPTION){\n\t\t\t\t\tString majorName=(String)mit.getValueAt(RowNum, 1);\n\t\t\t\t\tString deleteSql=\"delete from majorinfo where grade='\"+Tool.getGrade(userId)+\"' and majorName=?\";\n\t\t\t\t\tString deleteclass=\"delete from classinfo where grade='\"+Tool.getGrade(userId)+\"' and major=?\";\n\t\t\t\t\tString deletejob=\"delete from jobinfo where grade='\"+Tool.getGrade(userId)+\"' and major=?\";\n\t\t\t\t\t\n\t\t\t\t\tString[] dleteParas={Tool.string2UTF8(majorName)};\n\t\t\t\t\t\n\t\t\t\t\tmit.Update(deleteclass, dleteParas);\n\t\t\t\t\tmit.Update(deletejob, dleteParas);\n\t\t\t\t\t\n\t\t\t\t\tif(mit.Update(deleteSql, dleteParas)){\n\t\t\t\t\t\trefresh(jt);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tJOptionPane.showMessageDialog(jt, \"删除失败\");\n\t\t\t\t\t}\n\n\t\t\t\t\trefresh(jt);\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t}", "@Override\n\tpublic void delete(String... args) throws SQLException {\n\t\t\n\t}", "public void removeRow(int row) {\r\n\t\tdata.remove(row);\r\n\t}", "private void btnDelete1ActionPerformed(java.awt.event.ActionEvent evt) throws IOException {// GEN-FIRST:event_btnDelete1ActionPerformed\n\t\t// TODO add your handling code here:\n\t\tint i = tblBollard.getSelectedRow();\n\t\tif (i >= 0) {\n\t\t\tint option = JOptionPane.showConfirmDialog(rootPane, \"Are you sure you want to Delete?\",\n\t\t\t\t\t\"Delete confirmation\", JOptionPane.YES_NO_OPTION);\n\t\t\tif (option == 0) {\n\t\t\t\tTableModel model = tblBollard.getModel();\n\n\t\t\t\tString id = model.getValueAt(i, 0).toString();\n\t\t\t\tif (tblBollard.getSelectedRows().length == 1) {\n\t\t\t\t\t\n\t\t\t\t\tdelete(id,client);\n\t\t\t\t\t\n\t\t\t\t\tDefaultTableModel model1 = (DefaultTableModel) tblBollard.getModel();\n\t\t\t\t\tmodel1.setRowCount(0);\n\t\t\t\t\tfetch(client);\n\t\t\t\t\t//client.stopConnection();\n\t\t\t\t\tclear();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\talert(\"Please select a row to delete\");\n\t\t}\n\t}", "public void removeRow(T obj) {\r\n\t\t\r\n\t\tlogger.trace(\"Enter removeRow - T obj\");\r\n\t\t\r\n\t\tint row = data.indexOf(obj);\r\n\t\tif (row >= 0) {\r\n\t\t\tdata.remove(row);\r\n\t\t\tfireTableRowsDeleted(row, row);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.trace(\"Exit removeRow - T obj\");\r\n\t}", "public int deleteDBrow(Long rowId) {\n SQLiteDatabase db = mDbHelper.getWritableDatabase();\n\n // Define 'where' part of query.\n String selection = FeedEntry._ID + \" LIKE ?\";\n // Specify arguments in placeholder order.\n String[] selectionArgs = {rowId.toString()};\n // Issue SQL statement.\n return db.delete(FeedEntry.TABLE_NAME, selection, selectionArgs);\n }", "@Override\n\tpublic void delete(DhtmlxGridForm f) throws Exception {\n\t}", "private void eliminar() {\n\n int row = vista.tblClientes.getSelectedRow();\n cvo.setId_cliente(Integer.parseInt(vista.tblClientes.getValueAt(row, 0).toString()));\n int men = JOptionPane.showConfirmDialog(null, \"Estas seguro que deceas eliminar el registro?\", \"pregunta\", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);\n\n if (men == JOptionPane.YES_OPTION) {\n try {\n cdao.eliminar(cvo);\n cvo.setId_cliente(row);\n } catch (Exception e) {\n System.out.println(\"Mensaje eliminar\" + e.getMessage());\n }\n }\n }", "private void delete() {\n AltDatabase.getInstance().getAlts().remove(getCurrentAsEditable());\n if (selectedAccountIndex > 0)\n selectedAccountIndex--;\n updateQueried();\n updateButtons();\n }", "public static void removeRow(String fileName) {\n tableModel.removeRow(fileName);\n }", "@Kroll.method\n\tpublic void deleteRow(Object rowObj, @Kroll.argument(optional = true) KrollDict animation)\n\t{\n\t\tif (rowObj instanceof Integer) {\n\t\t\tfinal int index = ((Integer) rowObj).intValue();\n\n\t\t\tdeleteRow(getRowByIndex(index), null);\n\t\t} else {\n\t\t\tfinal TableViewRowProxy row = processRow(rowObj);\n\n\t\t\tif (row == null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfinal TiViewProxy parent = row.getParent();\n\n\t\t\tif (parent != null) {\n\t\t\t\tif (parent instanceof TableViewSectionProxy) {\n\t\t\t\t\tfinal TableViewSectionProxy section = (TableViewSectionProxy) parent;\n\n\t\t\t\t\t// Row is in section, modify section rows.\n\t\t\t\t\tsection.remove(row);\n\n\t\t\t\t\t// Notify TableView of update.\n\t\t\t\t\tupdate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "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 }", "private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {\n if(!search_table.getSelectionModel().isSelectionEmpty()){\n // TODO add your handling code here:\n int op = JOptionPane.showConfirmDialog(null, \"ARE YOU SURE YOU WANT TO DELETE?\", \"DELETE\", JOptionPane.YES_NO_OPTION);\n if(op==0){\n try{\n int i = search_table.getSelectedRow();\n TableModel model = search_table.getModel();\n \n String sql2 = \"DELETE FROM Lecturer WHERE id = '\"+model.getValueAt(i, 0).toString()+\"'\";\n st.executeUpdate(sql2);\n JOptionPane.showMessageDialog(null, \"DELETED SUCCESSFULLY\");\n \n DefaultTableModel model1= (DefaultTableModel) search_table.getModel();\n model1.setRowCount(0);\n viedetail_txt.setText(null);\n }\n catch(HeadlessException | SQLException ex){\n JOptionPane.showMessageDialog(null, ex);\n }\n }\n }\n else\n JOptionPane.showMessageDialog(null, \"NOTHING SPECIFIED TO DELETE\");\n \n \n }", "@Override\n public void delete(UltraSearchSessions.Session session, UltraSearchBackendEntry.Row entry) {\n List<Object> idParts = this.idColumnValue(entry.id());\n if (idParts.size() > 1 || entry.columns().size() > 0) {\n super.delete(session, entry);\n return;\n }\n\n // The only element is label\n this.deleteEdgesByLabel(session, entry.id());\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 }", "private void deleteActionPerformed(ActionEvent evt) throws Exception {\n String teaID = this.teaIDText.getText();\n if(StringUtil.isEmpty(teaID)){\n JOptionPane.showMessageDialog(null, \"请先选择一条老师信息!\");\n return;\n }\n int confirm = JOptionPane.showConfirmDialog(null, \"确认删除?\");\n if(confirm == 0){//确认删除\n Connection con = dbUtil.getConnection();\n int delete = teacherInfo.deleteInfo(con, teaID);\n if(delete == 1){\n JOptionPane.showMessageDialog(null, \"删除成功!\");\n resetValues();\n }\n else{\n JOptionPane.showMessageDialog(null, \"删除失败!\");\n return;\n }\n initTable(new Teacher());//初始化表格\n }\n }", "@Override\n\tpublic Item delete() {\n\t\treadAll();\n\t\tLOGGER.info(\"\\n\");\n\t\t//user can select either to delete a customer from system with either their id or name\n\t\tLOGGER.info(\"Do you want to delete record by Item ID\");\n\t\tlong id = util.getLong();\n\t\titemDAO.deleteById(id);\n\t\t\t\t\n\t\t\t\t\n\t\treturn null;\n\t}", "@Override\n\tpublic boolean deleteRecord(long rowId){\n\t\tLog.d(TAG, \"Delete transaction with record Id: \" + rowId);\n\t\treturn mSplitsDbAdapter.deleteSplitsForTransaction(rowId) &&\n deleteRecord(TransactionEntry.TABLE_NAME, rowId);\n\t}", "protected void deleteRow( NewOrder newOrder ) {\n String query = \"delete from tpcc_new_order where no_o_id = \" + newOrder.getNO_O_ID() + \" and no_d_id=\" + newOrder.getNO_D_ID() + \" and no_w_id=\" + newOrder.getNO_W_ID();\n executeAndLogStatement( query, QueryType.QUERYTYPEDELETE );\n }", "public void deleteRowPaymentReq(Number rowId) {\n Row[] deleteRows = null;\n deleteRows = getFilteredRows(\"Id\", rowId);\n if (deleteRows.length > 0) {\n deleteRows[0].remove();\n }\n }", "@Override\r\n\tpublic int deleteOne(int idx) throws SQLException {\n\t\treturn 0;\r\n\t}", "@Override\n\tpublic boolean delete(Item obj) {\n\t\ttry{\n\t\t\tString query=\"DELETE FROM items WHERE id = ?\";\n\t\t\tPreparedStatement state = conn.prepareStatement(query,ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n\t\t\tstate.setInt(1, obj.getIndex());\n\t\t\tint nb_rows = state.executeUpdate();\n\t\t\tSystem.out.println(\"Deleted \"+nb_rows+\" lines\");\n\t\t\tstate.close();\n\t\t\t\n\t\t\t// Notify the Dispatcher on a suitable channel.\n\t\t\tthis.publish(EntityEnum.ITEM.getValue());\n\t\t\t\n\t\t\treturn true;\n\t\t} catch (SQLException e){\n\t\t\tJOptionPane jop = new JOptionPane();\n\t\t\tjop.showMessageDialog(null, e.getMessage(),\"PostgreSQLItemDao.delete -- ERROR!\",JOptionPane.ERROR_MESSAGE);\n\t\t\treturn false;\n\t\t} catch (Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\t\n\t}", "@Override\n\tpublic void delete(Long primaryKey) {\n\t\t\n\t}", "public boolean deleteRow(long rowId, String tableName) {\n String row_ID = KEY_ROWID + \"=\" + rowId;\n return db.delete(tableName.replaceAll(\"\\\\s\", \"_\"), row_ID, null) != 0;\n }", "public void deleteRecord() throws LRException\n\t{\n\t\tDataHRecordData myData=(DataHRecordData)getData();\n\t\tgetBackground();\n\t\ttry\n\t\t{\n\t\t\tmyData.record.delete(background.getClient());\n\t\t}\n\t\tcatch (LDBException e) { setStatus(e); }\n\t}", "@Override\r\n\tpublic void delete(TQssql sql) {\n\r\n\t}", "public static void delRecord(String tableName, String rowKey)\n\t\t\tthrows IOException {\n\t\tHTable table = connectTable(tableName);\n\t\tDelete del = new Delete(Bytes.toBytes(rowKey));\n\t\ttable.delete(del);\n\t\treleaseTable(table);\n\t\tLOG.info(\"delete recored \" + rowKey + \" from table[\" + tableName\n\t\t\t\t+ \"] ok.\");\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif(tblTickets.getSelectedRow() != -1) {\n\t\t\t\t\tint id = Integer.parseInt(tblTickets.getValueAt(tblTickets.getSelectedRow(), 0).toString());\n\t\t\t\t\tdeleteTicket(id);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}", "private void deleteHocSinh() {\n\t\tString username = (String) table1\n\t\t\t\t.getValueAt(table1.getSelectedRow(), 0);\n\t\thocsinhdao.deleteUser(username);\n\t}", "public void deleteCertainRow(String itemname, String tableName, String columnName) throws SQLException\n {\n\n String deletetStr=\"DELETE FROM \"+tableName+\" WHERE \"+columnName+\" = \"+quotate(itemname);\n stmt.executeUpdate(deletetStr);\n return;\n\n }", "private void deleteBtnMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_deleteBtnMouseClicked\n\n String id = searchidTxt.getText();\n try {\n\n String Query = \"DELETE from stock where Product_ID =?\";\n\n pstm = con.prepareStatement(Query);\n pstm.setInt(1, Integer.parseInt(id));\n pstm.executeUpdate();\n\n } catch (Exception ex) {\n JOptionPane.showMessageDialog(null, \"ID Not Found \");\n }\n //Refresh Table\n refTable();\n\n //by Default hide Update button\n deleteBtn.setVisible(false);\n\n //Clear all Fields\n clearFields();\n }", "@Override\n\tpublic void delete() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "public void deleteSelectionRowTable(boolean status) {\n tableList.deleteSelectionItem(status);\n }", "public String deleteTimesheetRow(TimesheetRow thisRow) {\n\t\tservice.removeTimesheetRow(thisRow);\n\t\ttimesheetRowList.remove(thisRow);\n\t\treturn \"\";\n\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tString RemoveOrder=\"Delete from UserFace1 where (ID=?)\";\r\n\t\t\t\ttry {\r\n\t\t\t\t\tst=con.prepareStatement(RemoveOrder);\r\n\t\t\t\t\tst.setInt(1,Integer.parseInt(idField.getText()));\r\n\t\t\t\t\tint i = st.executeUpdate();\r\n //Executing MySQL Update Query\t\t\t\t\t\t+++++++++++++++++++++++\r\n if(i==1){\r\n JOptionPane.showMessageDialog(panel,\"Successfully Removed\");\r\n }\r\n \r\n refreshTable();\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (SQLException e1) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}", "public void eliminar(){\n conexion = base.GetConnection();\n try{\n PreparedStatement borrar = conexion.prepareStatement(\"DELETE from usuarios where Cedula='\"+this.Cedula+\"'\" );\n \n borrar.executeUpdate();\n // JOptionPane.showMessageDialog(null,\"borrado\");\n }catch(SQLException ex){\n System.err.println(\"Ocurrió un error al borrar: \"+ex.getMessage());\n \n }\n }", "public void deleteIscrizione() throws SQLException {\r\n\r\n\t\tPreparedStatement pstmt = null;\r\n\r\n\t\ttry {\r\n\t\t\tpstmt = con.prepareStatement(STATEMENTDEL);\r\n\t\t\t\r\n\t\t\tpstmt.setString(1, i.getGiocatore());\r\n\t\t\tpstmt.setInt(2, i.getTorneo());\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\tpstmt.execute();\r\n\r\n\t\t} finally {\r\n\t\t\tif (pstmt != null) {\r\n\t\t\t\tpstmt.close();\r\n\t\t\t}\r\n\r\n\t\t\tcon.close();\r\n\t\t}\r\n\r\n\t}", "@Override\n\tpublic void delete(String key) throws SQLException {\n\t\t\n\t}", "public void removeRow(int ind) throws SQLException {\n/* 417 */ notSupported();\n/* */ }", "public boolean BorrarDato(long rowId)\n {\n return db.delete(DATABASE_TABLE, KEY_ROWID + \"=\" + rowId, null) > 0;\n }", "@Override\r\n\tpublic void delete() {\n\t\tString delete=\"DELETE FROM members WHERE id =?\";\r\n\t\t try(Connection connection=db.getConnection();) {\r\n\t\t\t\t\r\n\t\t\t\tpreparedStatement=connection.prepareStatement(delete);\r\n\t\t\t\tpreparedStatement.setString(1, super.getIdString());\r\n\t\t \tpreparedStatement.executeUpdate();\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Transaction successful\");\r\n\t\t\t\t\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Something went wrong\");\r\n\t\t\t}\r\n\t}", "@Override\n\tpublic void delete(Integer id) throws SQLException {\n\t\t\n\t}", "public void delete() throws SQLException {\n Statement stmtIn = DatabaseConnector.getInstance().getStatementIn();\n int safeCheck = BusinessFacade.getInstance().checkIDinDB(this.goodID,\n \"orders\", \"goods_id\");\n if (safeCheck == -1) {\n stmtIn.executeUpdate(\"DELETE FROM ngaccount.goods WHERE goods.goods_id = \" +\n this.goodID + \" LIMIT 1;\");\n }\n }", "int deleteByPrimaryKey(String taxregcode);", "private void btnDeleteActionPerformed(java.awt.event.ActionEvent evt) {\n String delete = TabelSiswa.getValueAt(baris, 1).toString();\n try{\n Statement stmt = koneksi.createStatement();\n String query = \"DELETE FROM pasien WHERE nis = '\" + delete + \"'\";\n int berhasil = stmt.executeUpdate(query);\n if(berhasil == 1){\n JOptionPane.showMessageDialog(null, \"Data berhasil dihapus\");\n dtm.getDataVector().removeAllElements();\n showData();\n showStok();\n }else{\n JOptionPane.showMessageDialog(null, \"Data gagal dihapus\");\n }\n }catch(SQLException ex){\n ex.printStackTrace();\n JOptionPane.showMessageDialog(null, \"Terjadi kesalahan\", \"ERROR\", JOptionPane.ERROR_MESSAGE);\n }\n }", "@FXML\r\n private void bRemCell() throws SQLException {\n int index = tableView.getSelectionModel().getSelectedIndex();\r\n if(index>=0)\r\n {\r\n calc calc = data.get(index);\r\n Alert alert = new Alert(Alert.AlertType.CONFIRMATION);\r\n alert.setTitle(\"Delete cell\");\r\n alert.setHeaderText(\"Start of Day: \" + String.valueOf(calc.getStartDay()) + \"\\n\" +\r\n \"End of Day: \" + String.valueOf(calc.getOverDay()) + \"\\n\" +\r\n \"Start of Receipt: \" + String.valueOf(calc.getStartOfReceipt()) + \"\\n\" +\r\n \"End of Receipt: \" + String.valueOf(calc.getEndOfReceipt()) + \"\\n\" +\r\n \"Sum of Receipt: \" + String.valueOf(calc.getSumReceipt()) + \"\\n\" +\r\n \"User: \" + String.valueOf(calc.getUser()) + \"\\n\" +\r\n \"Date: \" + String.valueOf(calc.getDate()) + \"\\n\" +\r\n \"Comment: \" + String.valueOf(calc.getComment()));\r\n alert.setContentText(\"Are you sure you want to delete cell with data?\");\r\n Optional<ButtonType> result = alert.showAndWait();\r\n if(result.get() == ButtonType.OK)\r\n {\r\n delete(String.valueOf(calc.getDate()));\r\n refresh();\r\n }\r\n else\r\n {\r\n refresh();\r\n }\r\n }else\r\n {\r\n Alert alert = new Alert(Alert.AlertType.ERROR);\r\n alert.setTitle(\"ERROR\");\r\n alert.setContentText(\"Nothing Selected!!!\");\r\n alert.showAndWait();\r\n }\r\n }", "@FXML\n private void setRemoveButton() {\n Coach selectedRow = coachesTable.getSelectionModel().getSelectedItem();\n try {\n Connection conn = DatabaseHandler.getInstance().getConnection();\n try (Statement st = conn.createStatement()) {\n st.execute(\"delete from szkolka.uzytkownik where id_u=\" + selectedRow.getId() + \";\");\n coachesTable.getItems().remove(coachesTable.getSelectionModel().getSelectedItem());\n removeButton.setDisable(true);\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "private void deleteSelectedRows() {\n int[] rows = constantsTable.getSelectedRows();\n constantsTable.clearSelection();\n currentCellEditor.cancelCellEditing();\n for (int i = rows.length - 1; i >= 0; i--) {\n if (rows[i] > -1) {\n getTableModel().removeRow(rows[i]);\n }\n }\n }", "@Override\n\tpublic int delete(int id) throws SQLException {\n\t\treturn 0;\n\t}", "int deleteByPrimaryKey(String maht);", "int deleteByPrimaryKey(String fucno);", "@Override\r\n\tpublic void delete(int r_idx) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void delete(int no) {\n\t\tsqlSession.delete(namespace + \".delete\", no);\r\n\t}" ]
[ "0.75971216", "0.75470424", "0.74872404", "0.7397116", "0.7396533", "0.7376787", "0.7376787", "0.7373064", "0.7328737", "0.72546554", "0.71825296", "0.71783584", "0.71778935", "0.7177639", "0.7134619", "0.7124204", "0.71224046", "0.710592", "0.70564586", "0.70230293", "0.6953163", "0.69191724", "0.6918535", "0.6917191", "0.68660015", "0.6838771", "0.6811018", "0.676081", "0.6758312", "0.67578816", "0.67574763", "0.6753574", "0.67429805", "0.6719004", "0.67037296", "0.6665402", "0.666083", "0.6648378", "0.66401684", "0.6626601", "0.6613746", "0.65926164", "0.6579347", "0.65790135", "0.65770835", "0.65725523", "0.65637046", "0.6562104", "0.65586203", "0.6544576", "0.65445215", "0.6537904", "0.65325814", "0.65303046", "0.6529496", "0.6502363", "0.6493319", "0.6491072", "0.64797336", "0.6465988", "0.64444745", "0.6443091", "0.6442512", "0.64346385", "0.6428666", "0.6426195", "0.64201266", "0.6419587", "0.64175606", "0.6415088", "0.6409909", "0.64018", "0.63933605", "0.6392559", "0.6385194", "0.6382512", "0.6380202", "0.6368726", "0.6368671", "0.6366945", "0.63621426", "0.6360272", "0.63569707", "0.63562644", "0.6354741", "0.6352924", "0.6349778", "0.63494325", "0.6349114", "0.63420737", "0.63299876", "0.63259506", "0.63125443", "0.6305656", "0.6304804", "0.6304619", "0.6298353", "0.62980074", "0.62972814", "0.6290804" ]
0.7171436
14
this method will update and delete the particular selected row.
private void selectDetailWithMouse() { int selectedRowIndex=jt.convertRowIndexToModel(jt.getSelectedRow()); String[] choices={"Update Row","Delete","Cancel"}; int option=JOptionPane.showOptionDialog(rootPane, "Product ID: "+jtModel.getValueAt(selectedRowIndex, 0).toString()+"\n"+"Product Name: "+jtModel.getValueAt(selectedRowIndex,1), "View Data", WIDTH, HEIGHT,null , choices, NORMAL); if(option==0) { tfPaintId.setText(jtModel.getValueAt(selectedRowIndex,0).toString()); tfName.setText(jtModel.getValueAt(selectedRowIndex, 1).toString()); tfPrice.setText(jtModel.getValueAt(selectedRowIndex, 2).toString()); tfColor.setText(jtModel.getValueAt(selectedRowIndex, 3).toString()); tfQuantity.setText(jtModel.getValueAt(selectedRowIndex, 8).toString()); rwCombo.setSelectedItem(jtModel.getValueAt(selectedRowIndex, 4)); typeCombo.setSelectedItem(jtModel.getValueAt(selectedRowIndex, 6)); bCombo.setSelectedItem(jtModel.getValueAt(selectedRowIndex, 5)); switch(jtModel.getValueAt(selectedRowIndex, 7).toString()) { case "High": high.setSelected(true); break; case "Mild": mild.setSelected(true); break; case "Medium": medium.setSelected(true); break; } } else if(option==1) { jtModel.removeRow(selectedRowIndex); JOptionPane.showMessageDialog(rootPane," Detail successfully deleted"); } else { } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void deleteRow(int selectedRow){\r\n BudgetSubAwardBean budgetSubAwardBean = (BudgetSubAwardBean)data.get(selectedRow);\r\n if(budgetSubAwardBean.getAcType() == null || budgetSubAwardBean.getAcType().equals(TypeConstants.UPDATE_RECORD)){\r\n budgetSubAwardBean.setAcType(TypeConstants.DELETE_RECORD);\r\n budgetSubAwardBean.setUpdateUser(userId);\r\n if(deletedData ==null) {\r\n deletedData = new ArrayList();\r\n }\r\n deletedData.add(budgetSubAwardBean);\r\n }\r\n data.remove(selectedRow);\r\n \r\n //If Last Row nothing to do\r\n //else Update Sub Award Number for rest of the Rows\r\n /*int size = data.size();\r\n if(selectedRow != size) {\r\n for(int index = selectedRow; index < size; index++) {\r\n budgetSubAwardBean = (BudgetSubAwardBean)data.get(index);\r\n budgetSubAwardBean.setSubAwardNumber(index + 1);\r\n if(budgetSubAwardBean.getAcType() == null) {\r\n budgetSubAwardBean.setAcType(TypeConstants.UPDATE_RECORD);\r\n }\r\n }//End For\r\n }//End If\r\n */\r\n \r\n subAwardBudgetTableModel.fireTableRowsDeleted(selectedRow, selectedRow);\r\n }", "private void delete(int selectedRow) {\r\n removing = true;\r\n deletingRow = selectedRow;\r\n //subAwardBudgetTableModel.deleteRow(selectedRow);\r\n deleteRow(selectedRow);\r\n \r\n //Select a Row\r\n int selectRow = 0;\r\n int rowCount = subAwardBudgetTableModel.getRowCount();\r\n if(selectedRow == 0 && rowCount > 0) {\r\n //Select First Row\r\n selectRow = 0;\r\n }else if(selectedRow == rowCount) {\r\n //Select Last Row\r\n selectRow = rowCount - 1;\r\n }else {\r\n //Select This Row\r\n selectRow = selectedRow;\r\n }\r\n removing = false;\r\n if(selectRow != -1) {\r\n subAwardBudget.tblSubAwardBudget.setRowSelectionInterval(selectRow, selectRow);\r\n }else{\r\n //If All rows Deleted, then Details panel should be cleared\r\n displayDetails();\r\n }\r\n deletingRow = -1;\r\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tint RowNum=jt.getSelectedRow();\n\t\t\t\tif(RowNum==-1){\n\t\t\t\t\tJOptionPane.showMessageDialog(jt, \"请选择一行\");\n\t\t\t\t return ;\n\t\t\t }\n\t\t\t\t\n\t\t\t\tint isDelete=JOptionPane.showConfirmDialog(null, \"是否确定删除该专业以及该专业所有班级与学生信息?\");\n\t\t\t\t\n\t\t\t\tif(isDelete==JOptionPane.YES_OPTION){\n\t\t\t\t\tString majorName=(String)mit.getValueAt(RowNum, 1);\n\t\t\t\t\tString deleteSql=\"delete from majorinfo where grade='\"+Tool.getGrade(userId)+\"' and majorName=?\";\n\t\t\t\t\tString deleteclass=\"delete from classinfo where grade='\"+Tool.getGrade(userId)+\"' and major=?\";\n\t\t\t\t\tString deletejob=\"delete from jobinfo where grade='\"+Tool.getGrade(userId)+\"' and major=?\";\n\t\t\t\t\t\n\t\t\t\t\tString[] dleteParas={Tool.string2UTF8(majorName)};\n\t\t\t\t\t\n\t\t\t\t\tmit.Update(deleteclass, dleteParas);\n\t\t\t\t\tmit.Update(deletejob, dleteParas);\n\t\t\t\t\t\n\t\t\t\t\tif(mit.Update(deleteSql, dleteParas)){\n\t\t\t\t\t\trefresh(jt);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tJOptionPane.showMessageDialog(jt, \"删除失败\");\n\t\t\t\t\t}\n\n\t\t\t\t\trefresh(jt);\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSystem.out.println(\"btnDelete\");\n\t\t\t\tint i = table.getSelectedRow();\n\t\t\t\tif (i >= 0) {\n\t\t\t\t\tSystem.out.println(\"row-Delete\" + i);\n\t\t\t\t\tSystem.out.println(\"row-Delete\" + textSuppD.getText());\n\t\t\t\t\tint suppID = Integer.parseInt(textSuppD.getText().trim());\n\n\t\t\t\t\tDatabase db = new Database();\n\t\t\t\t\tSuppliersDAO suppDAO = new SuppliersDAO(db);\n\t\t\t\t\tSuppliersModel suppModel = new SuppliersModel();\n\t\t\t\t\tsuppModel.setSuppliers_id(suppID);\n\t\t\t\t\tsuppDAO.Delete(suppModel);\n\t\t\t\t\tdb.commit();\n\t\t\t\t\tdb.close();\n\n\t\t\t\t\tmodel.removeRow(i);\n\t\t\t\t} else {\n\t\t\t\t}\n\t\t\t}", "private void jbtn_deleteActionPerformed(ActionEvent evt) {\n\t\tDefaultTableModel RecordTable=(DefaultTableModel)jTable1.getModel();\n\t\tint Selectedrow=jTable1.getSelectedRow();\n\t\t\n\t\ttry\n\t\t{\n\t\t\tid=RecordTable.getValueAt(Selectedrow,0).toString();\n\t\t\tdeleteItem=JOptionPane.showConfirmDialog(this,\"Confirm if you want to delete the record\",\"Warning\",JOptionPane.YES_NO_OPTION);\n\t\t\t\n\t\t\tif(deleteItem==JOptionPane.YES_OPTION)\n\t\t\t{\n\t\t\t\tconn cc=new conn();\n\t\t\t\tpst=cc.c.prepareStatement(\"delete from medicine where medicine_name=?\");\n\t\t\t pst.setString(1,id);\n\t\t\t\tpst.executeUpdate();\n\t\t\t\tJOptionPane.showMessageDialog(this,\"Record Updated\");\n\t\t\t\tupDateDB();\n\t\t\t\ttxtblank();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t\t\n\t}", "public void actionPerformed(ActionEvent e) {\n model.deleteRow();\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSystem.out.println(\"btnUpdate\");\n\t\t\t\tint i = table.getSelectedRow();\n\t\t\t\tif (i >= 0) {\n\t\t\t\t\tSystem.out.println(\"row-update-select\" + i);\n\t\t\t\t\tSystem.out.println(\"row-update-supp-id\" + textSuppD.getText());\n\t\t\t\t\tint suppID = Integer.parseInt(textSuppD.getText().trim());\n\t\t\t\t\tString suppName = textSuppName.getText();\n\t\t\t\t\tString suppAddr = textSuppAddr.getText();\n\t\t\t\t\tString suppPhone = textSuppPhone.getText();\n\t\t\t\t\tString suppEmail = textSuppEmail.getText();\n\n\t\t\t\t\tDatabase db = new Database();\n\t\t\t\t\tSuppliersDAO suppDAO = new SuppliersDAO(db);\n\t\t\t\t\tSuppliersModel suppModel = new SuppliersModel();\n\t\t\t\t\tsuppModel.setSuppliers_id(suppID);\n\t\t\t\t\tsuppModel.setName(suppName);\n\t\t\t\t\tsuppModel.setAddress(suppAddr);\n\t\t\t\t\tsuppModel.setPhone(suppPhone);\n\t\t\t\t\tsuppModel.setEmail(suppEmail);\n\n\t\t\t\t\tsuppDAO.Update(suppModel);\n\n\t\t\t\t\tdb.commit();\n\t\t\t\t\tdb.close();\n\n\t\t\t\t\tsetTableGet(i, model);\n\t\t\t\t} else {\n\n\t\t\t\t}\n\t\t\t}", "private void toDelete() {\n if(toCount()==0)\n {\n JOptionPane.showMessageDialog(rootPane,\"No paint detail has been currently added\");\n }\n else\n {\n String[] choices={\"Delete First Row\",\"Delete Last Row\",\"Delete With Index\"};\n int option=JOptionPane.showOptionDialog(rootPane, \"How would you like to delete data?\", \"Delete Data\", WIDTH, HEIGHT,null , choices, NORMAL);\n if(option==0)\n {\n jtModel.removeRow(toCount()-toCount());\n JOptionPane.showMessageDialog(rootPane,\"Successfully deleted first row\");\n }\n else if(option==1)\n {\n jtModel.removeRow(toCount()-1);\n JOptionPane.showMessageDialog(rootPane,\"Successfully deleted last row\");\n }\n else if(option==2)\n {\n toDeletIndex();\n }\n else\n {\n \n }\n }\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif(tblTickets.getSelectedRow() != -1) {\n\t\t\t\t\tint id = Integer.parseInt(tblTickets.getValueAt(tblTickets.getSelectedRow(), 0).toString());\n\t\t\t\t\tdeleteTicket(id);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}", "public void deleteCartRow() {\n CarComponent selectedRow = cartTable.getSelectionModel().getSelectedItem();\n cartTable.getItems().remove(selectedRow);\n componentsCart.remove(selectedRow);\n\n updateTotal();\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tdelRow();\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tdelRow();\n\t\t\t}", "public void delete(JTable tblUser)\n {\n int i = tblUser.getSelectedRow();\n \n if(i != -1)\n {\n usersDto = users[i];\n \n if(usersDto.getState() != 3)\n {\n if(JOptionPane.showConfirmDialog(null, \"¿Está seguro que desea eliminar el registro?\", \"Eliminar\", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION)\n {\n try {\n usersDto.setState((short) 3);\n \n if(usersDao.update(usersDto.createPk(), usersDto)) {\n tableModel = (DefaultTableModel) tblUser.getModel();\n tableModel.setValueAt(\"*\", i, 6);\n }\n \n } catch (UsersDaoException exception) {}\n }\n \n } else { JOptionPane.showMessageDialog(null, \"El registro ya está eliminado\", \"ERROR\", JOptionPane.ERROR_MESSAGE); }\n \n } else { JOptionPane.showMessageDialog(null, \"Seleccione un registro a eliminar\", \"ERROR\", JOptionPane.ERROR_MESSAGE); }\n }", "private void delete() {\n AltDatabase.getInstance().getAlts().remove(getCurrentAsEditable());\n if (selectedAccountIndex > 0)\n selectedAccountIndex--;\n updateQueried();\n updateButtons();\n }", "@Override\r\n\t\t\t\t\t\t\t\tpublic void handle(ActionEvent arg0) {\n\r\n\t\t\t\t\t\t\t\t\tProducts data=(Products) tbl_view.getItems().get(getIndex());\r\n\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\t\t\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\t\t\t\t\t\tif(ConnectionManager.queryInsert(conn, \"DELETE FROM dbo.product WHERE id=\"+data.getId())>0) {\r\n\t\t\t\t\t\t\t\t\t\ttxt_cost.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_date.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_name.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_price.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_qty.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_search.clear();\r\n\t\t\t\t\t\t\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}", "private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {\n if(!search_table.getSelectionModel().isSelectionEmpty()){\n // TODO add your handling code here:\n int op = JOptionPane.showConfirmDialog(null, \"ARE YOU SURE YOU WANT TO DELETE?\", \"DELETE\", JOptionPane.YES_NO_OPTION);\n if(op==0){\n try{\n int i = search_table.getSelectedRow();\n TableModel model = search_table.getModel();\n \n String sql2 = \"DELETE FROM Lecturer WHERE id = '\"+model.getValueAt(i, 0).toString()+\"'\";\n st.executeUpdate(sql2);\n JOptionPane.showMessageDialog(null, \"DELETED SUCCESSFULLY\");\n \n DefaultTableModel model1= (DefaultTableModel) search_table.getModel();\n model1.setRowCount(0);\n viedetail_txt.setText(null);\n }\n catch(HeadlessException | SQLException ex){\n JOptionPane.showMessageDialog(null, ex);\n }\n }\n }\n else\n JOptionPane.showMessageDialog(null, \"NOTHING SPECIFIED TO DELETE\");\n \n \n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tString RemoveOrder=\"Delete from UserFace1 where (ID=?)\";\r\n\t\t\t\ttry {\r\n\t\t\t\t\tst=con.prepareStatement(RemoveOrder);\r\n\t\t\t\t\tst.setInt(1,Integer.parseInt(idField.getText()));\r\n\t\t\t\t\tint i = st.executeUpdate();\r\n //Executing MySQL Update Query\t\t\t\t\t\t+++++++++++++++++++++++\r\n if(i==1){\r\n JOptionPane.showMessageDialog(panel,\"Successfully Removed\");\r\n }\r\n \r\n refreshTable();\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (SQLException e1) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\t\t\tprotected void updateItem(Object arg0, boolean arg1) {\n\t\t\t\t\t\tsuper.updateItem(arg0, arg1);\r\n\t\t\t\t\t\tif (arg1) {\r\n\t\t\t\t\t\t\tsetGraphic(null);\r\n\t\t\t\t\t\t\tsetText(null);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tbtn.setOnAction(new EventHandler<ActionEvent>() {\r\n\r\n\t\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\t\tpublic void handle(ActionEvent arg0) {\r\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\r\n\t\t\t\t\t\t\t\t\tProducts data=(Products) tbl_view.getItems().get(getIndex());\r\n\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\t\t\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\t\t\t\t\t\tif(ConnectionManager.queryInsert(conn, \"DELETE FROM dbo.product WHERE id=\"+data.getId())>0) {\r\n\t\t\t\t\t\t\t\t\t\ttxt_cost.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_date.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_name.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_price.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_qty.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_search.clear();\r\n\t\t\t\t\t\t\t\t\t\tfetchData(FETCH_DATA);\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\r\n\t\t\t\t\t\t\tsetGraphic(btn);\r\n\t\t\t\t\t\t\tsetText(null);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}", "public void deleteButtonPushed() {\r\n ObservableList<Student> allStudents;\r\n Student selectedRow;\r\n allStudents = tableView.getItems();\r\n \r\n // This gives us the row that was selected\r\n selectedRow = tableView.getSelectionModel().getSelectedItems().get(0);\r\n \r\n\r\n try {\r\n covidMngrService.deleteStudent(selectedRow);\r\n \r\n // Remove the Student object from the table\r\n allStudents.remove(selectedRow);\r\n } catch (RemoteException ex) {\r\n Logger.getLogger(SecretaryStudentsTableCntrl.class.getName()).\r\n log(Level.SEVERE, null, ex);\r\n }\r\n }", "public void deleteRow(Row _deleteThis){\r\n if(!validTable()){\r\n System.out.println(\"Error:Table:deleteRow: table invalid, nothing done\");\r\n return;\r\n }\r\n Set<String> keys = rows.keySet();\r\n //Searches for row to delete and then removes it\r\n for(String k : keys) {\r\n if(_deleteThis.getData() == rows.get(k).getData()){\r\n rows.remove(k);\r\n return;\r\n }\r\n }\r\n System.out.println(\"Error:Table:deleteRow: Unable to find passed row, no row deleted\");\r\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tTableRow selected=null;\n\t\t\t\tfor(int i=0;i<table.getChildCount() && selected==null;i++){\n\t\t\t\t\tTableRow row = (TableRow)table.getChildAt(i);\n\t\t\t\t\tif(row.isSelected()){\n\t\t\t\t\t\tselected=row;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(selected==null){\n\t\t\t\t\t//Creamos un toast para avisar\n\t\t\t\t\tResources res = getResources();\n\t\t\t\t\tString text = String.format(res.getString(R.string.selectBill));\n\t\t\t\t\tToast msg = Toast.makeText(getBaseContext(),text, Toast.LENGTH_LONG);\n\t\t\t\t\tmsg.show();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tTextView idFactura = (TextView) selected.getChildAt(1);\n\t\t\t\t\tTextView nameClient = (TextView) selected.getChildAt(0);\n\t\t\t\t\t\n\t\t\t\t\tGlobalStatic data = (GlobalStatic) getApplicationContext();\n\t\t\t\t\t\n\t\t\t\t\tdata.cliente = data.getCliente((String)nameClient.getText());\n\t\t\t\t\tdata.factura = data.getFacturasId(data.cliente, Integer.parseInt((String)idFactura.getText()));\n\t\t\t\t\t\n\t\t\t\t\tdata.db.removeBill(data);\n\t\t\t\t\tdata.cliente.removeFactura(data.factura);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\ttable.removeView(selected);\n\t\t\t\t}\n\t\t\t\n\t\t\t}", "@Override\n\tpublic void deleteSelected() {\n\n\t}", "private void DeletebuttonActionPerformed(ActionEvent e) {\n int row = userTable.getSelectedRow();\n\n if (row == -1) {\n JOptionPane.showMessageDialog(ListUserForm.this, \"Vui lòng chọn user\", \"lỗi\", JOptionPane.ERROR_MESSAGE);\n } else {\n int confirm = JOptionPane.showConfirmDialog(ListUserForm.this, \"Bạn có chắc chắn xoá?\");\n\n if (confirm == JOptionPane.YES_OPTION) {\n\n int userid = Integer.parseInt(String.valueOf(userTable.getValueAt(row, 0)));\n\n userService.deleteUser(userid);\n\n defaultTableModel.setRowCount(0);\n setData(userService.getAllUsers());\n }\n }\n }", "private void editButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editButtonActionPerformed\n try ( Connection con = DbCon.getConnection()) {\n int rowCount = flightsTable.getRowCount();\n selectedRow = flightsTable.getSelectedRow();\n //if row is chosen\n if (selectedRow >= 0) {\n\n PreparedStatement pst = con.prepareStatement(\"update Flights set departure = '\"\n + flightsDftTblMdl.getValueAt(selectedRow, 0)\n + \"', destination = '\"\n + flightsDftTblMdl.getValueAt(selectedRow, 1)\n + \"', depTime = '\"\n + flightsDftTblMdl.getValueAt(selectedRow, 2)\n + \"', arrTime = '\"\n + flightsDftTblMdl.getValueAt(selectedRow, 3)\n + \"', number = '\"\n + flightsDftTblMdl.getValueAt(selectedRow, 4)\n + \"', price = '\"\n + flightsDftTblMdl.getValueAt(selectedRow, 5)\n + \"' where number = '\" + flightsDftTblMdl.getValueAt(selectedRow, 4) + \"'\");\n\n pst.execute();\n initFlightsTable();//refresh the table after edit\n } else {\n JOptionPane.showMessageDialog(null, \"Please select row first\");\n }\n\n } catch (ClassNotFoundException | SQLException ex) {\n Logger.getLogger(CustomerRecords.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n }", "private void deleteExec(){\r\n\t\tList<HashMap<String,String>> selectedDatas=ViewUtil.getSelectedData(jTable1);\r\n\t\tif(selectedDatas.size()<1){\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Please select at least 1 item to delete\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tint options = 1;\r\n\t\tif(selectedDatas.size() ==1 ){\r\n\t\t\toptions = JOptionPane.showConfirmDialog(null, \"Are you sure to delete this Item ?\", \"Info\",JOptionPane.YES_NO_OPTION);\r\n\t\t}else{\r\n\t\t\toptions = JOptionPane.showConfirmDialog(null, \"Are you sure to delete these \"+selectedDatas.size()+\" Items ?\", \"Info\",JOptionPane.YES_NO_OPTION);\r\n\t\t}\r\n\t\tif(options==1){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tfor(HashMap<String,String> map:selectedDatas){\r\n\t\t\t\r\n\t\t\tdiscountService.deleteDiscountByMap(NameConverter.convertViewMap2PhysicMap(map, \"Discount\"));\r\n\t\t}\r\n\t\tthis.initDatas();\r\n\t}", "@FXML\r\n private void bRemCell() throws SQLException {\n int index = tableView.getSelectionModel().getSelectedIndex();\r\n if(index>=0)\r\n {\r\n calc calc = data.get(index);\r\n Alert alert = new Alert(Alert.AlertType.CONFIRMATION);\r\n alert.setTitle(\"Delete cell\");\r\n alert.setHeaderText(\"Start of Day: \" + String.valueOf(calc.getStartDay()) + \"\\n\" +\r\n \"End of Day: \" + String.valueOf(calc.getOverDay()) + \"\\n\" +\r\n \"Start of Receipt: \" + String.valueOf(calc.getStartOfReceipt()) + \"\\n\" +\r\n \"End of Receipt: \" + String.valueOf(calc.getEndOfReceipt()) + \"\\n\" +\r\n \"Sum of Receipt: \" + String.valueOf(calc.getSumReceipt()) + \"\\n\" +\r\n \"User: \" + String.valueOf(calc.getUser()) + \"\\n\" +\r\n \"Date: \" + String.valueOf(calc.getDate()) + \"\\n\" +\r\n \"Comment: \" + String.valueOf(calc.getComment()));\r\n alert.setContentText(\"Are you sure you want to delete cell with data?\");\r\n Optional<ButtonType> result = alert.showAndWait();\r\n if(result.get() == ButtonType.OK)\r\n {\r\n delete(String.valueOf(calc.getDate()));\r\n refresh();\r\n }\r\n else\r\n {\r\n refresh();\r\n }\r\n }else\r\n {\r\n Alert alert = new Alert(Alert.AlertType.ERROR);\r\n alert.setTitle(\"ERROR\");\r\n alert.setContentText(\"Nothing Selected!!!\");\r\n alert.showAndWait();\r\n }\r\n }", "private void btnDelete1ActionPerformed(java.awt.event.ActionEvent evt) throws IOException {// GEN-FIRST:event_btnDelete1ActionPerformed\n\t\t// TODO add your handling code here:\n\t\tint i = tblBollard.getSelectedRow();\n\t\tif (i >= 0) {\n\t\t\tint option = JOptionPane.showConfirmDialog(rootPane, \"Are you sure you want to Delete?\",\n\t\t\t\t\t\"Delete confirmation\", JOptionPane.YES_NO_OPTION);\n\t\t\tif (option == 0) {\n\t\t\t\tTableModel model = tblBollard.getModel();\n\n\t\t\t\tString id = model.getValueAt(i, 0).toString();\n\t\t\t\tif (tblBollard.getSelectedRows().length == 1) {\n\t\t\t\t\t\n\t\t\t\t\tdelete(id,client);\n\t\t\t\t\t\n\t\t\t\t\tDefaultTableModel model1 = (DefaultTableModel) tblBollard.getModel();\n\t\t\t\t\tmodel1.setRowCount(0);\n\t\t\t\t\tfetch(client);\n\t\t\t\t\t//client.stopConnection();\n\t\t\t\t\tclear();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\talert(\"Please select a row to delete\");\n\t\t}\n\t}", "@FXML\n private void deleteRow(ActionEvent event){\n if(facilitiesView.getSelectionModel().getSelectedItem()==null){\n errorBox(\"Feil\", \"Det er ingen rader som er markert\", \"Vennligst marker en rad i tabellen\");\n }\n else{\n Alert mb = new Alert(Alert.AlertType.CONFIRMATION);\n mb.setTitle(\"Bekreft\");\n mb.setHeaderText(\"Du har trykket slett på \"+ facilitiesView.getSelectionModel().getSelectedItem().getFacilityName());\n mb.setContentText(\"Ønsker du virkerlig å slette dette lokalet?\");\n mb.showAndWait().ifPresent(response -> {\n if(response== ButtonType.OK){\n observableList.remove(facilitiesView.getSelectionModel().getSelectedItem());\n\n File file = new File(EditedFiles.getActiveFacilityFile());\n file.delete();\n try {\n WriterThreadRunner.WriterThreadRunner(getFacilities(), EditedFiles.getActiveFacilityFile());\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n }\n });\n }\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\t Database.RemoveItem(Integer.toString(Database.IDs[table.getSelectedRow()]));\t\n\t\t\t\t Login.Refresh();\n\t\t\t }", "private void delete_btnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_delete_btnActionPerformed\n // pull current table model\n DefaultTableModel model = (DefaultTableModel) remindersTable.getModel();\n if (remindersTable.getSelectedRow() == -1) {\n if (remindersTable.getRowCount() == 0) {\n dm.messageEmptyTable();\n } else {\n dm.messageSelectLine();\n }\n } else {\n int input = JOptionPane.showConfirmDialog(frame, \"Do you want to Delete!\");\n // 0 = yes, 1 = no, 2 = cancel\n if (input == 0) {\n model.removeRow(remindersTable.getSelectedRow());\n dm.messageReminderDeleted();// user message;\n saveDataToFile();// Save changes to file\n getSum(); // Update projected balance\n } else {\n // delete canceled\n }\n }\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t\tint RowNum=jt.getSelectedRow();\n\t\t\t\tif(RowNum==-1){\n\t\t\t\t\tJOptionPane.showMessageDialog(jt, \"请选择一行\");\n\t\t\t\t return ;\n\t\t\t }\n\t\t \n\t\t String info=((String)mit.getValueAt(RowNum, 1));\n\t\t \n\t\t\t\tString majorNewIn=JOptionPane.showInputDialog(\"请修改专业\",info);\n\t\t\t\tif(majorNewIn!=null)\n\t\t\t\t{\n\t\t\t\t\tif(!majorNewIn.equals(\"\")){\n\t\t\t\t\t\t\n\t\t\t\t\t\tString majorIdSql=\"select id from majorinfo where majorName='\"+Tool.string2UTF8(info)+\"'\";\n\t\t\t\t\t\tString majorid=SqlModel.getInfo(majorIdSql);\n\t\t\t\t\t\t\n\t\t\t\t\t\tString mclassSql=\"update classinfo set major='\"+Tool.string2UTF8(majorNewIn)+\"' where major='\"+Tool.string2UTF8(info)+\"'\";\n\t\t\t\t\t\tString mjobSql=\"update jobinfo set major='\"+Tool.string2UTF8(majorNewIn)+\"' where major='\"+Tool.string2UTF8(info)+\"'\";\n\t\t\t\t\t\tString mmajorSql=\"update majorinfo set majorName='\"+Tool.string2UTF8(majorNewIn)+\"' where id='\"+majorid+\"'\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tSqlModel.updateInfo(mclassSql);\n\t\t\t\t\t\tSqlModel.updateInfo(mjobSql);\n\t\t\t\t\t\tif(SqlModel.updateInfo(mmajorSql)){\n\t\t\t\t\t\t\trefresh(jt);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"修改失败\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t \n\t\t\t}", "public void deleteRow(int row) throws IndexOutOfBoundsException{\r\n data.remove(row);\r\n fireTableRowsDeleted(row,row);\r\n }", "private void deleteActionPerformed(ActionEvent evt) throws Exception {\n String teaID = this.teaIDText.getText();\n if(StringUtil.isEmpty(teaID)){\n JOptionPane.showMessageDialog(null, \"请先选择一条老师信息!\");\n return;\n }\n int confirm = JOptionPane.showConfirmDialog(null, \"确认删除?\");\n if(confirm == 0){//确认删除\n Connection con = dbUtil.getConnection();\n int delete = teacherInfo.deleteInfo(con, teaID);\n if(delete == 1){\n JOptionPane.showMessageDialog(null, \"删除成功!\");\n resetValues();\n }\n else{\n JOptionPane.showMessageDialog(null, \"删除失败!\");\n return;\n }\n initTable(new Teacher());//初始化表格\n }\n }", "private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteButtonActionPerformed\n // TODO add your handling code here:\n final LocationsDialog frame = this;\n\n SwingUtilities.invokeLater(new Runnable()\n {\n public void run()\n {\n LocationsTableModel model = (LocationsTableModel) locationsTable.getModel();\n int row = locationsTable.getSelectedRow();\n if (row == -1){\n JOptionPane.showMessageDialog(frame,\n \"Please select a location from the table to delete \",\n \"No selection made\",\n JOptionPane.ERROR_MESSAGE);\n }\n else\n {\n Location location = editLocationRequest(row);\n // TODO add delete Location handling code here:\n String msg = \"Are sure to delete this Location?\";\n\n int n = JOptionPane.showConfirmDialog(\n null,\n msg,\n \"Confirm\",\n JOptionPane.YES_NO_OPTION);\n\n if (n == 1) {\n return;\n }\n\n try{\n WorkletContext context = WorkletContext.getInstance();\n if (!Helper.delete(location, \"Locations\", context)) {\n System.out.print(\"Delete failed!\");\n }\n else\n {\n System.out.print(\"Delete successful\");\n }\n\n }catch(Exception ex){\n\n }\n }\n refreshLocations();\n model.fireTableDataChanged();\n\n }\n\n });\n\n }", "private void delete()\n\t{\n\t\ttry\n\t\t{\n\t\t\tConnection con = Connector.DBcon();\n\t\t\tString query = \"select * from items where IT_ID=?\";\n\t\t\t\n\t\t\tPreparedStatement pst = con.prepareStatement(query);\n\t\t\tpst.setString(1, txticode.getText());\n\t\t\tResultSet rs = pst.executeQuery();\n\t\t\t\n\t\t\tint count = 0;\n\t\t\twhile(rs.next())\n\t\t\t{\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\t\n\t\t\tif(count == 1)\n\t\t\t{\n\t\t\t\tint choice = JOptionPane.showConfirmDialog(null, \"Are you sure you want to delete selected item data?\", \"ALERT\", JOptionPane.YES_NO_OPTION);\n\t\t\t\tif(choice==JOptionPane.YES_OPTION)\n\t\t\t\t{\n\t\t\t\t\tquery=\"delete from items where IT_ID=?\";\n\t\t\t\t\tpst = con.prepareStatement(query);\n\t\t\t\t\t\n\t\t\t\t\tpst.setString(1, txticode.getText());\n\t\t\t\t\t\n\t\t\t\t\tpst.execute();\n\t\t\t\t\t\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Deleted Successfully\", \"RESULT\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tloadData();\n\t\t\t\t\n\t\t\t\trs.close();\n\t\t\t\tpst.close();\n\t\t\t\tcon.close();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\telse\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Record Not Found!\", \"Alert\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\n\t\t\trs.close();\n\t\t\tpst.close();\n\t\t\tcon.close();\n\t\t\t\n\t\t} \n\t\tcatch (Exception e)\n\t\t{\n\t\t\tJOptionPane.showMessageDialog(null, e);\n\t\t}\n\t}", "@FXML\n\tprivate void handleDeleteTaxi() {\n\t\tint selectedIndex = TaxiTable.getSelectionModel().getSelectedIndex();\n\t\tif (selectedIndex >= 0) {\n\t\t\tTaxiTable.getItems().remove(selectedIndex);\n\t\t} else {\n\t\t\t// Nothing selected.\n\t\t}\n\t}", "public void deleteRow() throws SQLException {\n\n try {\n debugCodeCall(\"deleteRow\");\n checkClosed();\n if (insertRow != null) { throw Message.getSQLException(ErrorCode.NOT_ON_UPDATABLE_ROW); }\n checkOnValidRow();\n getUpdatableRow().deleteRow(result.currentRow());\n updateRow = null;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "protected void submitDeleteAct(ActionEvent ae) {\n\t\tint index = stuClassListTable.getSelectedRow();\r\n\t\tif (index == -1) {// 未选中时,为-1\r\n\t\t\tJOptionPane.showMessageDialog(this, \"请选中要删除的数据!!!\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (JOptionPane.showConfirmDialog(this, \"确认要删除吗?\") == JOptionPane.OK_OPTION) {\r\n\t\t\tDefaultTableModel dft = (DefaultTableModel) stuClassListTable.getModel();\r\n\t\t\tint id = Integer.parseInt(dft.getValueAt(stuClassListTable.getSelectedRow(), 0).toString());\r\n\t\t\tStuClassDao<StuClass> stuClassDao = new StuClassDao<StuClass>();\r\n\t\t\tif (stuClassDao.delete(id)) {\r\n\t\t\t\tJOptionPane.showMessageDialog(this, \"删除成功!\");\r\n\t\t\t} else {\r\n\t\t\t\tJOptionPane.showMessageDialog(this, \"删除失败!\");\r\n\t\t\t}\r\n\t\t\tstuClassDao.closeDao();\r\n\t\t\tsetTable(new StuClass());\r\n\t\t} else {\r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\teditRow();\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\teditRow();\n\t\t\t}", "@FXML\n private void rowSelected() {\n if (coachesTable.getSelectionModel().getSelectedItem() != null) {\n removeButton.setDisable(false);\n }\n }", "@FXML\r\n public void deleteTreatmentButton(){\r\n int sIndex = treatmentTabletv.getSelectionModel().getSelectedIndex();\r\n String sID = treatmentData.get(sIndex).getIdProperty();\r\n\r\n String deleteTreatment = \"delete from treatment where treatmentID = ?\";\r\n try{\r\n ps = mysql.prepareStatement(deleteTreatment);\r\n ps.setString(1,sID);\r\n ps.executeUpdate();\r\n ps.close();\r\n ps = null;\r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n //maybe more in this exception\r\n }\r\n\r\n treatmentData.remove(sIndex);\r\n }", "@Override\r\n\t\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\tremoveRowsIsSelected();\r\n\t\t\t\t\told_Num_Total=0;\r\n\t\t\t\t\tdeleteJButton.setEnabled(false);\r\n\t\t\t\t}", "public void deleteSelectedAndRefresh()\n\t{\n\t\tDisplayThreeSQLHandler.changeRoom(\"CREATURE\", selectedCreature, -1);\n\t\t\n\t\tremoveElement(thingsInColumn.indexOf(selectedCreature));\n\t\t\n\t\tselectedCreature = thingsInColumn.get(itemsVisible[buttonLastPressed]);\n\t\t\n\t\tDisplayThree.getInstance().addBox.changeContents(\"CREATURE\", false);\n\t\t;\n\t\t\n\t\tthis.updateButtons();\n\t}", "private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {// GEN\n // -\n // FIRST\n // :\n // event_deleteButtonActionPerformed\n int rowIndex = headerTable.getSelectedRow();\n if (rowIndex > -1) {\n removeRow(rowIndex);\n }\n }", "@FXML\n private void setRemoveButton() {\n Coach selectedRow = coachesTable.getSelectionModel().getSelectedItem();\n try {\n Connection conn = DatabaseHandler.getInstance().getConnection();\n try (Statement st = conn.createStatement()) {\n st.execute(\"delete from szkolka.uzytkownik where id_u=\" + selectedRow.getId() + \";\");\n coachesTable.getItems().remove(coachesTable.getSelectionModel().getSelectedItem());\n removeButton.setDisable(true);\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public void delete()\n\t{\n\t\t_Status = DBRowStatus.Deleted;\n\t}", "public native void deleteRow(int row) /*-{\n\t\tvar jso = [email protected]::getJsObj()();\n\t\tjso.deleteRow(row);\n }-*/;", "@Action\n public void modifyAction() {\n E rowObject = (E) dataTable.getSelectedRowObject();\n if (rowObject != null) {\n rowObject = (E) rowObject.clone();\n\n if (viewRowState) {\n viewRow(rowObject);\n } else {\n E newRowObject = modifyRow(rowObject);\n if (newRowObject != null) {\n replaceTableObject(newRowObject);\n fireModify(newRowObject);\n }\n }\n }\n }", "private void eliminar() {\n\n int row = vista.tblClientes.getSelectedRow();\n cvo.setId_cliente(Integer.parseInt(vista.tblClientes.getValueAt(row, 0).toString()));\n int men = JOptionPane.showConfirmDialog(null, \"Estas seguro que deceas eliminar el registro?\", \"pregunta\", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);\n\n if (men == JOptionPane.YES_OPTION) {\n try {\n cdao.eliminar(cvo);\n cvo.setId_cliente(row);\n } catch (Exception e) {\n System.out.println(\"Mensaje eliminar\" + e.getMessage());\n }\n }\n }", "public void update(int rowSelected, Posto p) {\n postos.set(rowSelected, p);\n fireTableRowsUpdated(rowSelected, rowSelected);\n }", "private void deleteBtnMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_deleteBtnMouseClicked\n\n String id = searchidTxt.getText();\n try {\n\n String Query = \"DELETE from stock where Product_ID =?\";\n\n pstm = con.prepareStatement(Query);\n pstm.setInt(1, Integer.parseInt(id));\n pstm.executeUpdate();\n\n } catch (Exception ex) {\n JOptionPane.showMessageDialog(null, \"ID Not Found \");\n }\n //Refresh Table\n refTable();\n\n //by Default hide Update button\n deleteBtn.setVisible(false);\n\n //Clear all Fields\n clearFields();\n }", "private void deleteSelectedRows() {\n int[] rows = constantsTable.getSelectedRows();\n constantsTable.clearSelection();\n currentCellEditor.cancelCellEditing();\n for (int i = rows.length - 1; i >= 0; i--) {\n if (rows[i] > -1) {\n getTableModel().removeRow(rows[i]);\n }\n }\n }", "public void mouseClicked(MouseEvent arg0){\n int r = table.getSelectedRow();\r\n if(r>=0){ \r\n// deletebtnButton.setEnabled(true);\r\n deletebtn.setEnabled(true); \r\n\r\n //Fetching records from Table on Fields\r\n idField.setText(\"\"+table.getModel().getValueAt(r,0));\r\n \t}\r\n }", "public void deleteSelectedFile(int row) {\n\t\tArrayList<File> files = currConfig.getSelectedFiles();\n\t\tfiles.remove(row);\n\t}", "public void onClick(DialogInterface dialog, int which) {\n\r\n TableRow tr = (TableRow) v1.getParent();\r\n TextView ItemNumber = (TextView) tr.getChildAt(0);\r\n\r\n DeletedKOT objDeletedKOT = new DeletedKOT();\r\n objDeletedKOT.setReason(\"Billing Mode is 3 or 4\");\r\n objDeletedKOT.setEmployeeId(0);\r\n objDeletedKOT.setTableNumber(0);//Integer.parseInt(tvTableNumber.getText().toString()));\r\n objDeletedKOT.setSubUdfNumber(Integer.parseInt(tvSubUdfValue.getText().toString()));\r\n objDeletedKOT.setTokenNumber(iTokenNumber);\r\n objDeletedKOT.setTime(String.format(\"%tR\", Time));\r\n long lResult = db.addDeletedKOT_new(objDeletedKOT);\r\n Log.v(\"VoidKOT\", \"Deleted KOT added, Row ID:\" + lResult);\r\n lResult = db.deleteKOTItemsByItemToken_new(ItemNumber.getText().toString(), iTokenNumber,\r\n Integer.parseInt(tvSubUdfValue.getText().toString()));\r\n\r\n CustomerDetailsFilled = true;\r\n DisplayModifyKOT();\r\n\r\n }", "public void actionPerformed(ActionEvent e) {\n if(newTable.getRowCount() == 0){\n Toolkit.getDefaultToolkit().beep();\n return;\n }\n int index = table.getSelectedRow();\n int size = newTable.getRowCount();\n if(index > size || index < 0){\n table.setRowSelectionInterval(0,0);\n index = table.getSelectedRow();\n }\n newTable.removeRow(index);\n \n\n //Select an index.\n index--;\n if(index < 0){\n index++;\n }\n if(newTable.getRowCount() != 0){\n table.setRowSelectionInterval(index, index);\n }\n }", "public void toDeletIndex()\n {\n try\n { \n //DefaultTableModel model=(DefaultTableModel)jt.getModel(); \n //jt.getModel();\n int num=Integer.parseInt(JOptionPane.showInputDialog(rootPane,\"Enter the row number\")); \n jtModel.removeRow(num-1);\n JOptionPane.showMessageDialog(rootPane,\"Successfully deleted selected row number \" +num);\n }\n catch(NumberFormatException ex)\n {\n JOptionPane.showMessageDialog(rootPane,\"Enter integer not alphabet\");\n } \n catch(ArrayIndexOutOfBoundsException ex)\n {\n JOptionPane.showMessageDialog(rootPane,\"This row dosent exist\");\n }\n }", "public void deleteSelectionRowTable(boolean status) {\n tableList.deleteSelectionItem(status);\n }", "@FXML\r\n private void bRem() throws SQLException {\n int index = tableView.getSelectionModel().getSelectedIndex();\r\n if(index>=0)\r\n {\r\n calc calc = data.get(index);\r\n String tmp = calc.getComment();\r\n try{\r\n UpdateDb(tmp.substring(0,tmp.lastIndexOf(\"\\n\")), calc.getDate());\r\n }catch (StringIndexOutOfBoundsException e)\r\n {\r\n UpdateDb(\"\", calc.getDate());\r\n }\r\n refresh();\r\n }else\r\n {\r\n Alert alert = new Alert(Alert.AlertType.ERROR);\r\n alert.setTitle(\"ERROR\");\r\n alert.setContentText(\"Nothing Selected!!!\");\r\n alert.showAndWait();\r\n }\r\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tint choice = JOptionPane.showConfirmDialog(frame, \n\t\t\t\t\t\t\"Do you want to delete the selected projects?\\nThis action cannot be undone!\", \n\t\t\t\t\t\t\"Delete Selected\", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);\n\t\t\t\tif(choice == 0){\n\t\t\t\t\tSystem.out.println(\"Delete\");\n\t\t\t\t\tString[] selected = sel.getSelected(); \n\t\t\t\t\tfor(int i=0;i<selected.length;i++) {\n\t\t\t\t\t\n\t\t\t\t\t\tint index = portfolio.findByCode(selected[i]);\n\t\t\t\t\t\tportfolio.remove(index, config.isUpdateDB());\n\t\t\t\t\t\tsel.remove(index);\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfpTable.setModel((TableModel) new ProjectTableModel(portfolio.getFinishedProjects()));\n\t\t\t\topTable.setModel((TableModel) new ProjectTableModel(portfolio.getOngoingProjects()));\n\t\t\t\ttoggleSaved(false);\n\t\t\t}", "protected void submitEditAct(ActionEvent ae) {\n\t\tint index = stuClassListTable.getSelectedRow();\r\n\t\tif (index == -1) {// 未选中时,为-1\r\n\t\t\tJOptionPane.showMessageDialog(this, \"请选中要删除的数据!!!\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tDefaultTableModel dft = (DefaultTableModel) stuClassListTable.getModel();\r\n\t\tint id = Integer.parseInt(dft.getValueAt(stuClassListTable.getSelectedRow(), 0).toString());\r\n\t\tString stuClassName = dft.getValueAt(stuClassListTable.getSelectedRow(), 1).toString();\r\n\t\tString stuClassInfo = dft.getValueAt(stuClassListTable.getSelectedRow(), 2).toString();\r\n\t\tString editStuClassName = editStuClassNameTextField.getText();\r\n\t\tString editStuClassInfo = editStuClassInfoTextArea.getText();\r\n\t\tif (stuClassName.equals(editStuClassName) && stuClassInfo.equals(editStuClassInfo)) {\r\n\t\t\tJOptionPane.showMessageDialog(this, \"还未进行任何修改\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(StringUtil.isEmpty(editStuClassName)) {\r\n\t\t\tJOptionPane.showMessageDialog(this, \"班级姓名不可为空\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (JOptionPane.showConfirmDialog(this, \"确认要更改吗?\") == JOptionPane.OK_OPTION) {\r\n\t\t\tStuClass stuClass = new StuClass();\r\n\t\t\tstuClass.setId(id);\r\n\t\t\tstuClass.setName(editStuClassName);\r\n\t\t\tstuClass.setInfo(editStuClassInfo);\r\n\t\t\tStuClassDao<StuClass> stuClassDao = new StuClassDao<StuClass>();\r\n\t\t\tif (stuClassDao.update(stuClass)) {\r\n\t\t\t\tJOptionPane.showMessageDialog(this, \"更新成功!\");\r\n\t\t\t\teditStuClassNameTextField.setText(\"\");\r\n\t\t\t\teditStuClassInfoTextArea.setText(\"\");\r\n\t\t\t} else {\r\n\t\t\t\tJOptionPane.showMessageDialog(this, \"更新失败!\");\r\n\t\t\t}\r\n\t\t\tstuClassDao.closeDao();\r\n\t\t\tsetTable(new StuClass());\r\n\t\t} else {\r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "@Override\n public void onClick(View v) {\n\n CouSyncDb.getInstance(getApplicationContext()).deleteSync(bean1, new OnOperateFinish() {\n @Override\n public void onFinish(int operateType, Object result) {\n text.setText(\"delete row ID = \" + result.toString());\n }\n });\n }", "public void update(int rowSelected, Combustivel c) {\n combs.set(rowSelected, c);\n fireTableRowsUpdated(rowSelected, rowSelected);\n }", "public void deleteRow(MyItem row) {\n\n\t\tif (MyItemAdapter.rows.contains(row)) {\n\t\t\tMyItemAdapter.rows.remove(row);\n\t\t}\n\n\t}", "public void deleteRow() throws SQLException\n {\n m_rs.deleteRow();\n }", "public void doDelete() throws Exception {\r\n\t\t_ds.deleteRow();\r\n\t\tdoDataStoreUpdate();\r\n\t\tif (_mode == MODE_LIST_ON_PAGE) {\r\n\t\t\tif (_listForm != null && _listForm.getDataStore() != _ds) {\r\n\t\t\t\t//different datastores on list and detail\r\n\t\t\t\tDataStoreBuffer listDs = _listForm.getDataStore();\r\n\t\t\t\tif (_listSelectedRow != null) {\r\n\t\t\t\t\tfor (int i = 0; i < listDs.getRowCount(); i++) {\r\n\t\t\t\t\t\tif (listDs.getDataStoreRow(i, DataStoreBuffer.BUFFER_STANDARD).getDSDataRow() == _listSelectedRow.getDSDataRow()) {\r\n\t\t\t\t\t\t\tlistDs.removeRow(i);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (listDs.getRowCount() == 0)\r\n\t\t\t\t\tsetVisible(false);\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (listDs.getRow() == -1)\r\n\t\t\t\t\t\tlistDs.gotoRow(listDs.getRowCount() - 1);\r\n\t\t\t\t\t_listForm.setRowToEdit(listDs.getRow());\r\n\t\t\t\t\tdoEdit();\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t//list and detail share the same datastore\r\n\t\t\t\tif (_ds.getRowCount() == 0)\r\n\t\t\t\t\tsetVisible(false);\r\n\t\t\t\telse\r\n\t\t\t\t\tscrollToMe();\r\n\t\t\t}\r\n\t\t\tsyncListFormPage();\r\n\t\t} else {\r\n\t\t\treturnToListPage(true);\r\n\t\t}\r\n\t}", "public boolean deleteRow(int row) {\n try {\n resultSet.absolute(row + 1);\n resultSet.deleteRow();\n //tell table to redraw itself\n fireTableDataChanged();\n return true;\n } catch (SQLException se) {\n System.out.println(\"Delete row error \" + se);\n return false;\n }\n }", "private void btnRemoveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRemoveActionPerformed\n if(tblOrders.getSelectedRow() == -1)\n {\n lblMessage.setText(\"Select Product First\");\n }\n else\n {\n DefaultTableModel model = (DefaultTableModel)tblOrders.getModel();\n int productId = \n Integer.parseInt(String.valueOf(model.getValueAt(tblOrders.getSelectedRow(), 0)));\n \n loggedInCustomer.findLatestOrder().removeOrderLine(productId);\n \n model.removeRow(tblOrders.getSelectedRow());\n \n lblMessage.setText(\"Product Has Been Removed\");\n lblTotalCost.setText(\"£\" + String.format(\"%.02f\",loggedInCustomer.findLatestOrder().getOrderTotal()));\n }\n }", "public void deletePart()\n {\n ObservableList<Part> partRowSelected;\n partRowSelected = partTableView.getSelectionModel().getSelectedItems();\n if(partRowSelected.isEmpty())\n {\n alert.setAlertType(Alert.AlertType.ERROR);\n alert.setContentText(\"Please select the Part you want to delete.\");\n alert.show();\n } else {\n int index = partTableView.getSelectionModel().getFocusedIndex();\n Part part = Inventory.getAllParts().get(index);\n alert.setAlertType(Alert.AlertType.CONFIRMATION);\n alert.setContentText(\"Are you sure you want to delete this Part?\");\n alert.showAndWait();\n ButtonType result = alert.getResult();\n if (result == ButtonType.OK) {\n Inventory.deletePart(part);\n }\n }\n }", "public String onDelete(final DataTableCRUDRow<R> row) {\n try {\n getModel().setRowClicked(row);\n if (!row.isNewRow()) {\n delete(row.getElement());\n } else {\n row.setReadonly(true);\n }\n row.setDeleted(true);\n } catch (final MessageLabelException e) {\n log.trace(e.getMessage(), e);\n getFacesMessages().message(e);\n }\n return \"\";\n }", "@Override\n public void remove() throws IOException {\n int i = listEnterprisePanel.getTableListE().getSelectedRow(); // chọn hàng để xóa\n if (i >= 0) {\n String strID = listEnterprisePanel.getTableListE().getValueAt(i, 1).toString().trim(); // lấy ID\n Enterprise enterprise = enterpriseBN.getEnterpriseByID(strID); // Tìm kiếm Enterprise theo ID\n content.set(Collections.singleton(enterprise), null);\n enterpriseBN.deleteEnterprise(enterprise);\n model.removeRow(i);\n loadData();\n }\n\n }", "public void removeBtn(){\r\n\t\t\r\n\t\tWorkflowEntry entryToBeRemoved = (WorkflowEntry) tableView.getSelectionModel().getSelectedItem();\r\n\t\t\r\n\t\tdata.remove(entryToBeRemoved);\r\n\t\t\r\n\t}", "private void selectedRowInvoice(){\r\n //numOrdenInv = tb_factura.getSelectionModel().getSelectedIndex();\r\n }", "public void deleteRow(String row) {\n database.delete(ORDER_MASTER, ORDER_ID + \"=\" + row, null);\n }", "public void dbDeleteRow(EdaContext xContext)\n\tthrows IcofException{\n\n\t\t// Create the SQL query in the PreparedStatement.\n\t\tsetDeleteStatement(xContext);\n\t\ttry {\n\t\t\tgetStatement().setLong(1, getId());\n\n\t\t}\n\t\tcatch(SQLException trap) {\n\t\t\tIcofException ie = new IcofException(this.getClass().getName(),\n\t\t\t \"dbDeleteRow()\",\n\t\t\t IcofException.SEVERE,\n\t\t\t \"Unable to prepare SQL statement.\",\n\t\t\t IcofException.printStackTraceAsString(trap) + \n\t\t\t \"\\n\" + getQuery());\n\t\t\txContext.getSessionLog().log(ie);\n\t\t\tthrow ie;\n\t\t}\n\n\t\t// Run the query.\n\t\tif (! insertRow(xContext)) {\n\t\t\tIcofException ie = new IcofException(this.getClass().getName(),\n\t\t\t \"dbDeleteRow()\",\n\t\t\t IcofException.SEVERE,\n\t\t\t \"Unable to delete row.\\n\",\n\t\t\t \"QUERY: \" + getQuery());\n\t\t\txContext.getSessionLog().log(ie);\n\t\t\tthrow ie;\n\t\t}\n\n\t\t// Close the PreparedStatement.\n\t\tcloseStatement(xContext);\n\n\t}", "@Override\n\tpublic Item delete() {\n\t\treadAll();\n\t\tLOGGER.info(\"\\n\");\n\t\t//user can select either to delete a customer from system with either their id or name\n\t\tLOGGER.info(\"Do you want to delete record by Item ID\");\n\t\tlong id = util.getLong();\n\t\titemDAO.deleteById(id);\n\t\t\t\t\n\t\t\t\t\n\t\treturn null;\n\t}", "private void popupMenuDeleteData(int rowIndex, int columnIndex) {\n\t\t//\n\t\t// Display the dialog\n\t\t//\n\t\tDeleteDataDialog deleteDataDialog = new DeleteDataDialog(parent.getShell());\n\t\tif (deleteDataDialog.open() != Window.OK)\n\t\t\treturn;\n\t\tint delSize = deleteDataDialog.getResult();\n\n\t\tif (delSize == 0) {\n\t\t\t//\n\t\t\t// Cancel button pressed - do nothing\n\t\t\t//\n\t\t\treturn;\n\t\t}\n\n\t\t//\n\t\t// Delete data from the table\n\t\tdelete(rowIndex, columnIndex - 1, delSize);\n\n\t\t//\n\t\t// Update the status panel\n\t\t//\n\t\tupdateStatusPanel();\n\t}", "@Override\n\t\t\t\t\tpublic void tableChanged(TableModelEvent e) {\n\t\t\t\t\t\tif (currConfig != null) {\n\t\t\t\t\t\t\tif (((CIVLTable) tbl_fileTable).deleting\n\t\t\t\t\t\t\t\t\t&& e.getType() == TableModelEvent.DELETE) {\n\t\t\t\t\t\t\t\tdeleteSelectedFile(e.getLastRow());\n\n\t\t\t\t\t\t\t\tDefaultTableModel inputModel = (DefaultTableModel) tbl_inputTable\n\t\t\t\t\t\t\t\t\t\t.getModel();\n\n\t\t\t\t\t\t\t\tif (inputModel.getRowCount() != 0) {\n\t\t\t\t\t\t\t\t\tinputModel.setRowCount(0);\n\t\t\t\t\t\t\t\t\ttbl_inputTable.clearSelection();\n\t\t\t\t\t\t\t\t\ttbl_inputTable.revalidate();\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}", "private void toEdit() {\n int i=jt.getSelectedRow();\n if(toCount()==0)\n {\n JOptionPane.showMessageDialog(rootPane,\"No data has been added to the details\");\n }\n else if(i==-1)\n {\n JOptionPane.showMessageDialog(rootPane,\"No item has been selected for the update\");\n }\n else\n {\n if(tfPaintId.getText().isEmpty())\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Enter the Paint ID\");\n }\n else if(tfName.getText().isEmpty())\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Enter the Product name\");\n }\n else if(rwCombo.getSelectedItem().toString().equals(\"Select\"))\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Select the raw materials used\");\n }\n else if(bCombo.getSelectedItem().toString().equals(\"Select\"))\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! select the brand you want\");\n }\n else if(tfPrice.getText().isEmpty())\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Enter the price\");\n }\n else if(tfColor.getText().isEmpty())\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Enter the colour\");\n }\n else if(typeCombo.getSelectedItem().toString().equals(\"Select\"))\n {\n JOptionPane.showMessageDialog(rootPane,\"Select something from paint type\");\n }\n else if(getQuality()==null) \n {\n JOptionPane.showMessageDialog(rootPane,\"Quality is not selected\");\n }\n else if(tfQuantity.getText().isEmpty())\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Enter the quantity\");\n }\n else\n {\n try\n {\n jtModel.setValueAt(tfPaintId.getText(),i,0);\n jtModel.setValueAt(tfName.getText(),i,1);\n jtModel.setValueAt(Integer.valueOf(tfPrice.getText()),i,2);\n jtModel.setValueAt(tfColor.getText(),i,3);\n jtModel.setValueAt(rwCombo.getSelectedItem(),i,4);\n jtModel.setValueAt(bCombo.getSelectedItem(),i,5);\n jtModel.setValueAt(typeCombo.getSelectedItem(),i,6);\n jtModel.setValueAt(getQuality(),i,7);\n jtModel.setValueAt(Integer.valueOf(tfQuantity.getText()),i,8);\n JOptionPane.showMessageDialog(rootPane,\"Successfully updated the data in details\");\n toClear();\n }\n catch(Exception ex)\n {\n JOptionPane.showMessageDialog(rootPane,\"Excepted integer but entered another character at price or quantity.\");\n }\n }\n }\n }", "protected void select() {\n\t\tcleanValues();\n\t\tint row = m_table.getSelectedRow();\n\t\tboolean enabled = row != -1;\n\t\tif (enabled)\n\t\t{\n\t\t\tInteger ID = m_table.getSelectedRowKey();\n\t\t\tif (ID != null)\n\t\t\t{\n\t\t\t\tm_C_Order_ID = ID.intValue();\n\t\t\t}\n\t\t}\n\t\tlog.info(\"ID=\" + m_C_Order_ID); \n\t}", "private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {\n try{\n Class.forName(driver);\n Connection con = DriverManager.getConnection(url,user,pass); \n if( TableDisplayEmp.getSelectedRow() > 0 ){\n rowSelected = TableDisplayEmp.getSelectedRow();\n }\n // loi doan nay ne em, tại vì khi em nhấn Update thì cái cai table no da bỏ chọn rồi, row = -1 ý, nên nó ko lấy đc dòng nào cần chọn\n String value = (TableDisplayEmp.getModel().getValueAt(rowSelected, 0).toString());\n \n //System.out.println( rowSelected );\n String query1 = \"UPDATE Em_Contact SET Phone = ?, Email = ? WHERE Employee_ID = ? \";\n PreparedStatement pst1 = con.prepareStatement(query1); \n pst1.setString(1, txtContact.getText());\n pst1.setString(2, txtEmail.getText());\n pst1.setString(3, txtEmployee_ID.getText());\n pst1.executeUpdate();\n \n String query = \"UPDATE Employee SET LastName = ?, FirstName = ?, Gender = ?, Dob = ?, Address = ? WHERE Employee_ID = ?\";\n PreparedStatement pst = con.prepareStatement(query); \n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n String date = sdf.format(txtDob.getDate()); \n pst.setString(1, txtLastName.getText());\n pst.setString(2, txtFirstName.getText());\n String Gender = txtGender.getSelectedItem().toString();\n pst.setString(3, Gender); \n pst.setString(4, date);\n pst.setString(5, txtAddress.getText());\n //pst.setBytes(6, person_image);\n pst.setString(6, txtEmployee_ID.getText());\n pst.executeUpdate();\n \n \n userList = userList();\n \n DefaultTableModel dm = (DefaultTableModel)TableDisplayEmp.getModel();\n while(dm.getRowCount() > 0)\n {\n dm.removeRow(0);\n }\n \n show_user(userList);\n JOptionPane.showMessageDialog(this,\"Save Successfully!!!\");\n } catch (Exception e){\n //System.out.println(e.getMessage());\n JOptionPane.showMessageDialog(this,e.getMessage());\n }\n }", "@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setQuantity(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET quantity='\"+data.getQuantity()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}", "@FXML\n private void handleDeleteFilm() {\n int selectedIndex = filmTable.getSelectionModel().getSelectedIndex();\n if (selectedIndex >= 0) {\n \tfilmTable.getItems().remove(selectedIndex);\n \tsave();\n } else {\n // Nothing selected.\n Dialogs.create()\n .title(\"No Selection\")\n .masthead(\"No Person Selected\")\n .message(\"Please select a person in the table.\")\n .showWarning();\n }\n }", "@Override\r\n\tpublic void adminSelectDelete() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\tbtnEdit.setEnabled(true);\r\n\t\t\t\tbtnDelete.setEnabled(true);\r\n\t\t\t\trow = table.getSelectedRow();\r\n\t\t\t\tDefaultTableModel model = (DefaultTableModel) table.getModel();\r\n\t\t\t\tString SelectedName = model.getValueAt(row, 1).toString();\r\n\t\t\t\tString S = model.getValueAt(row, 2).toString() + \":00\";\r\n\t\t\t\tString E = model.getValueAt(row, 3).toString() + \":00\";\r\n\t\t\t\ttxtName.setText(SelectedName);\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\td1 = format.parse(S);\r\n\t\t\t\t} catch (java.text.ParseException 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\t\t\t\ttry {\r\n\t\t\t\t\td2 = format.parse(E);\r\n\t\t\t\t} catch (java.text.ParseException e1) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tint rSHours = d1.getHours();\r\n\t\t\t\tcmbSHour.setSelectedItem(rSHours);\r\n\t\t\t\tint rSMin = d1.getMinutes();\r\n\t\t\t\tcmbSMin.setSelectedItem(rSMin);\r\n\t\t\t\tint rEHours = d2.getHours();\r\n\t\t\t\tcmbEHour.setSelectedItem(rEHours);\r\n\t\t\t\tint rEMin = d2.getMinutes();\r\n\t\t\t\tcmbEMin.setSelectedItem(rEMin);\r\n\t\t\t\tSelectedId = (model.getValueAt(row, 0)).toString();\r\n\t\t\t\tid_tag = (model.getValueAt(row, 5)).toString();\r\n\t\t\t\tSystem.out.println(id_tag);\r\n\t\t\t\ttry {\r\n\r\n\t\t\t\t\tPreparedStatement query = db.getConnection()\r\n\t\t\t\t\t\t\t.prepareStatement(\r\n\t\t\t\t\t\t\t\t\t\"select * from Tag where Id=\"\r\n\t\t\t\t\t\t\t\t\t\t\t+ id_tag);\r\n\t\t\t\t\tResultSet rs = query.executeQuery();\r\n\t\t\t\t\tif (!rs.isBeforeFirst()) {\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\twhile (rs.next()) {\r\n\t\t\t\t\t\t\tcmb.setSelectedItem(rs.getString(\"Name\"));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} catch (Exception e2) {\r\n\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t}\r\n\t\t\t}", "private void bomSelected(int selectedRow){\n \tbomDet=new inventorycontroller.function.BillOfMaterialProcessor(dbInterface1)\n \t .getBomDescForPoMaster(jTable1.getModel().getValueAt(selectedRow, 3).toString());\n \t\n \tadjustAddedQty(); //* adjusts the item qty. which are already added.\n \t\n \tjTable2.setModel(new javax.swing.table.DefaultTableModel(\n bomDet,\n new String [] {\n \"Select\", \"Material\", \"Reqd. Quantity\", \"Purchase Requirement\", \"Remark\"\n }\n ) {\n Class[] types = new Class [] {\n \tjava.lang.Boolean.class, \n \tjava.lang.String.class, \n java.lang.Long.class, \n java.lang.Long.class,\n java.lang.String.class\n };\n \n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return columnIndex==0 ? true : false ;\n }\n });\n }", "private void btnDeleteActionPerformed(java.awt.event.ActionEvent evt) {\n String delete = TabelSiswa.getValueAt(baris, 1).toString();\n try{\n Statement stmt = koneksi.createStatement();\n String query = \"DELETE FROM pasien WHERE nis = '\" + delete + \"'\";\n int berhasil = stmt.executeUpdate(query);\n if(berhasil == 1){\n JOptionPane.showMessageDialog(null, \"Data berhasil dihapus\");\n dtm.getDataVector().removeAllElements();\n showData();\n showStok();\n }else{\n JOptionPane.showMessageDialog(null, \"Data gagal dihapus\");\n }\n }catch(SQLException ex){\n ex.printStackTrace();\n JOptionPane.showMessageDialog(null, \"Terjadi kesalahan\", \"ERROR\", JOptionPane.ERROR_MESSAGE);\n }\n }", "void row_delete(int id){\n\t\t//Delete tuple by executing SQL command\n\t\tStatement stm=null;\n\t\tString sql=\"delete from \"+tableName+\" where id=\"+id;\n\t\ttry{\n\t \t stm=con.createStatement(); \n\t \t System.out.println(\"sql: \"+sql); \n\t \t stm.executeUpdate(sql);\n\t \t \n\t \t //Append SQL command and time stamp on log file\n\t \t outfile.write(\"TIMESTAMP: \"+getTimestamp());\n\t\t\t outfile.newLine();\n\t\t\t outfile.write(sql);\n\t\t\t outfile.newLine();\n\t\t\t outfile.newLine();\n\t\t \n\t\t //Catch SQL exception\t \t \n\t }catch (SQLException e ) {\n\t \t e.printStackTrace();\n\t //Catch I/O exception\n\t } catch(IOException ioe){ \n\t \t ioe.printStackTrace();\n\t }finally {\n\t \t try{\n\t if (stm != null) stm.close(); \n\t }\n\t \t catch (SQLException e ) {\n\t \t\t e.printStackTrace();\n\t\t }\n\t }\t\n\t\t \n\t }", "public void onClick(DialogInterface dialog, int id) {\n cbh.getSwipeToDeleteListener().deletePendingRow(position);\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e)\n\t\t\t{\n\t\t\t\tint row = deckTable.getSelectedRow();\n\t\t\t\tif (row >= 0) {\n\t\t\t\t\tdeck.removeCard(((String)deckTable.getValueAt(row, 0)));\n\t\t\t\t\tSystem.out.println(((String)deckTable.getValueAt(row, 0)));\n\t\t\t\t\tArrayList<Object[]> objs = new ArrayList<Object[]>();\n\t\t\t\t\t\n\t\t\t\t\t// update the dcek table\n\t\t\t\t\tDeckObject[] deckRows = deck.getTable();\n\t\t\t\t\tfor (int i = 0; i < deckRows.length; i++) {\n\t\t\t\t\t\tobjs.add(deckRows[i].get());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tString[][] rows = objs.toArray(new String[0][0]);\n\t\t\t\t\t\n\t\t\t\t\t// display the new table\n\t\t\t\t\tdeckTable.setModel(new UneditableTableModel(rows, deckColumns));\n\t\t\t\t\tint newSelectRow = row;\n\t\t\t\t\tif (row == deckTable.getRowCount())\n\t\t\t\t\t\tnewSelectRow = deckTable.getRowCount()-1;\n\t\t\t\t\t\n\t\t\t\t\t// select the next item on the table\n\t\t\t\t\tif (newSelectRow >= 0)\n\t\t\t\t\t\tdeckTable.setRowSelectionInterval(newSelectRow,newSelectRow);\n\t\t\t\t\tSystem.out.println(deckTable.getRowCount());\n\t\t\t\t}\n\t\t\t}", "@Override\n\t\t\tpublic void handle(ActionEvent arg0) {\n\n\t\t\t\tAlert alert = new Alert(AlertType.CONFIRMATION);\n\t\t\t\talert.setTitle(\"Confirm\");\n\t\t\t\talert.setHeaderText(null);\n\t\t\t\talert.setContentText(\"Delete this accout?\");\n\t\t\t\tOptional<ButtonType> result = alert.showAndWait();\n\t\t\t\tif (result.get() == ButtonType.OK) {\n\t\t\t\t\tUser employee = table.getSelectionModel().getSelectedItem();\n\n\t\t\t\t\tif (employee == null) {\n\t\t\t\t\t\tAlert alert1 = new Alert(AlertType.INFORMATION);\n\t\t\t\t\t\talert1.setHeaderText(null);\n\t\t\t\t\t\talert1.setTitle(\"Customer Remove\");\n\t\t\t\t\t\talert1.setContentText(\"Please select a row in the table\");\n\t\t\t\t\t\talert1.showAndWait();\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tint username = employee.getId();\n\n\t\t\t\t\t\tuser.deleteUser(\"\" + username);\n\n\t\t\t\t\t\tObservableList<User> data = FXCollections.observableArrayList(employeeManager.getAllEmployees());\n\n\t\t\t\t\t\ttable.setItems(data);\n\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e)\n\t\t\t{\n\t\t\t\tint row = deckTable.getSelectedRow();\n\t\t\t\tif (row >= 0) {\n\t\t\t\t\t// remove a single copy of the card\n\t\t\t\t\tdeck.removeCard(((String)deckTable.getValueAt(row, 0)), 1);\n\t\t\t\t\tSystem.out.println(((String)deckTable.getValueAt(row, 0)));\n\t\t\t\t\tArrayList<Object[]> objs = new ArrayList<Object[]>();\n\t\t\t\t\t\n\t\t\t\t\t// update the deck list\n\t\t\t\t\tDeckObject[] deckRows = deck.getTable();\n\t\t\t\t\tfor (int i = 0; i < deckRows.length; i++) {\n\t\t\t\t\t\tobjs.add(deckRows[i].get());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tString[][] rows = objs.toArray(new String[0][0]);\n\n\t\t\t\t\t// update the table\n\t\t\t\t\tdeckTable.setModel(new UneditableTableModel(rows, deckColumns));\n\t\t\t\t\tint newSelectRow = row;\n\t\t\t\t\tif (row == deckTable.getRowCount())\n\t\t\t\t\t\tnewSelectRow = deckTable.getRowCount()-1;\n\t\t\t\t\t\n\t\t\t\t\t// select the next object in table\n\t\t\t\t\tif (newSelectRow >= 0)\n\t\t\t\t\t\tdeckTable.setRowSelectionInterval(newSelectRow,newSelectRow);\n\t\t\t\t\tSystem.out.println(deckTable.getRowCount());\n\t\t\t\t}\n\t\t\t}", "@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setName(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET name='\"+data.getName()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif(tblSessions.getSelectedRow() != -1) {\n\t\t\t\t\tint id = Integer.parseInt(tblSessions.getValueAt(tblSessions.getSelectedRow(), 0).toString());\n\t\t\t\t\t\n\t\t\t\t\tdeleteSession(id);\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Deletado com sucesso!\");\n\t\t\t\t}\n\t\t\t}", "public void Delete(View v) {\r\n CheckBox MenuCode;\r\n\r\n for (int iRow = 0; iRow < tblOrderItems.getChildCount(); iRow++) {\r\n\r\n TableRow Row = (TableRow) tblOrderItems.getChildAt(iRow);\r\n\r\n if (Row.getChildAt(0) != null) {\r\n\r\n MenuCode = (CheckBox) Row.getChildAt(0);\r\n\r\n if (MenuCode.isChecked()) {\r\n\r\n // Remove all the view present in the row.\r\n Row.removeAllViews();\r\n\r\n // Remove the row\r\n tblOrderItems.removeView(Row);\r\n\r\n // Exit from the loop\r\n // break;\r\n }\r\n } else {\r\n continue;\r\n }\r\n\r\n }\r\n\r\n CalculateTotalAmount();\r\n }", "public void deleteRow(int row) {\n\t\tif (row == -1) return;\n\t\t\n\t\tdata.remove(row);\n\t\tfireTableRowsDeleted(row, row);\n\t}", "@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tString row= diveRow.get(position);\n\t\t\t\t\t\tIntent i = new Intent(\"android.intent.action.VIEWSELECTEDDIVE\");\n\t\t\t\t\t\tBundle extras = new Bundle();\n\t\t\t\t\t\textras.putString(\"row\", row);\n\t\t\t\t\t\ti.putExtras(extras);\n\t\t\t\t\t\tstartActivityForResult(i, 0);\n\t\t\t\t\t\t//Toast.makeText(getBaseContext(), \"Row selected: \"+ row, Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t//cursor.close();\n\t\t\t\t\t\t//dataBaseCursor.close();\n\t\t\t\t\t\tfinish();//free resources\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public void deleteProduct()\n {\n ObservableList<Product> productRowSelected;\n productRowSelected = productTableView.getSelectionModel().getSelectedItems();\n int index = productTableView.getSelectionModel().getFocusedIndex();\n Product product = productTableView.getItems().get(index);\n if(productRowSelected.isEmpty())\n {\n alert.setAlertType(Alert.AlertType.ERROR);\n alert.setContentText(\"Please select the Product you want to delete.\");\n alert.show();\n } else if (!product.getAllAssociatedParts().isEmpty())\n {\n alert.setAlertType(Alert.AlertType.ERROR);\n alert.setContentText(\"This Product still has a Part associated with it. \\n\" +\n \"Please modify the Product and remove the Part.\");\n alert.show();\n } else {\n alert.setAlertType(Alert.AlertType.CONFIRMATION);\n alert.setContentText(\"Are you sure you want to delete this Product?\");\n alert.showAndWait();\n ButtonType result = alert.getResult();\n if(result == ButtonType.OK)\n {\n Inventory.deleteProduct(product);\n }\n }\n }", "@Override\r\n\t\t\tpublic void widgetSelected(SelectionEvent arg0) {\n\t\t\t\tInputDialog id1=new InputDialog(sShell,\"删除商品\",\"输入商品编号\",\"\",null);\r\n\t\t\t\tif(id1.open()==0){\r\n\t\t\t\t\tinput=id1.getValue();\r\n\t\t\t\t\tif(input.equals(\"\")) return;\r\n\t\t\t\t}\r\n\t\t\t\telse return;\r\n\t\t\t\t\r\n\t\t\t\tCommonADO ado=CommonADO.getCommonADO();\r\n\t\t\t\tString sql=\"delete from Goods where GoodsNo='\"+input+\"'\";\r\n\t\t\t\tado.executeUpdate(sql);\r\n\t\t\t\t//createCompositeGoodsShow();\r\n\t\t\t\tcompositeGoodsShow.dispose();\t\t\t\t\r\n\t\t\t\tcreateCompositeGoodsShow();\r\n\t\t\t\t\r\n\t\t\t\tcompositeGoodsMange.layout(true);\r\n\t\t\t}" ]
[ "0.77516", "0.74133444", "0.7310846", "0.7132183", "0.6999333", "0.67715883", "0.67296344", "0.6673643", "0.6637245", "0.6623526", "0.659551", "0.659551", "0.6585734", "0.65584606", "0.6542161", "0.65098256", "0.6453465", "0.6438111", "0.64379084", "0.6402964", "0.63993615", "0.6398868", "0.6396343", "0.63902193", "0.637739", "0.6374495", "0.636874", "0.63681287", "0.63500315", "0.6345914", "0.63309556", "0.62525225", "0.6251333", "0.6246751", "0.62141937", "0.6212873", "0.61990696", "0.61982095", "0.61869836", "0.61869836", "0.61811924", "0.6177679", "0.6173543", "0.6171679", "0.6165069", "0.61463106", "0.6141646", "0.61297", "0.61248326", "0.6119787", "0.61183244", "0.61090285", "0.61032104", "0.60996026", "0.6093104", "0.6088078", "0.608557", "0.6076902", "0.6067921", "0.60651404", "0.6024825", "0.6011579", "0.60060024", "0.6001563", "0.6000437", "0.59988654", "0.59979653", "0.599116", "0.598688", "0.5966358", "0.5956028", "0.5946824", "0.5940419", "0.5927583", "0.59123397", "0.590108", "0.5894791", "0.5888338", "0.5879613", "0.5876126", "0.5874901", "0.5872527", "0.58702445", "0.5863814", "0.58525383", "0.5817237", "0.5816703", "0.5798256", "0.5797133", "0.57969016", "0.57835317", "0.5761285", "0.57586604", "0.57554775", "0.57505745", "0.57463914", "0.57434475", "0.5737257", "0.5732504", "0.57305604" ]
0.6369485
26
This method will search for the coloumn index from its name.
private int getSearchIndex() { String selected = searchCombo.getSelectedItem().toString(); for(int i = 0; i<columnNames.length; i++) { if(selected.equals(columnNames[i])) { return i; } } return -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getColumnIndex(String name);", "@Override\n public int findColumn(final String columnName) {\n for (int index = 0; index < _columns.size(); index++) {\n if (_columns.get(index).compareTo(columnName) == 0) {\n return index;\n }\n }\n return -1;\n }", "int getColumnIndex (String columnName);", "String getColumn(int index);", "String getColumn(int index);", "int getColumnIndex();", "int getColumnIndex();", "int getColumnIndex();", "protected int findColumn(ResultSet resultSet, String columnName) throws SQLException {\r\n if (columnIndexes == null) {\r\n buildIndexes(resultSet);\r\n }\r\n Integer index = columnIndexes.get(columnName);\r\n if (index == null) return -1;\r\n return index;\r\n }", "int indexOf(String column);", "int indexOf(String column);", "protected Integer getColumnIndex(String header){\n for (Map.Entry<String, Integer> entry: headerMap.entrySet()){\n if (header.toLowerCase().equals(entry.getKey().toLowerCase())) return entry.getValue();\n }\n return -1;\n }", "private int indexOf(String columnName) {\n\t\tfor (int i = 0; i < columnNames.length; ++i)\n\t\t\tif (columnNames[i].equals(columnName))\n\t\t\t\treturn i;\n\n\t\tthrow new IndexOutOfBoundsException(\"Column (\" + columnName + \") doesn't exist in \" + tableName);\n\t}", "private int getColumnIndex(Cursor cursor, String columnName) {\n return cursor.getColumnIndexOrThrow(columnName);\n }", "public int getColumnIndex (String columnName)\n\t{\n\t\tif (columnName == null || columnName.length() == 0)\n\t\t\treturn -1;\n\t\t//\n\t\tfor (int i = 0; i < m_data.cols.size(); i++)\n\t\t{\n\t\t\tRColumn rc = (RColumn)m_data.cols.get(i);\n\t\t//\tlog.fine( \"Column \" + i + \" \" + rc.getColSQL() + \" ? \" + columnName);\n\t\t\tif (rc.getColSQL().startsWith(columnName))\n\t\t\t{\n\t\t\t\tlog.fine( \"Column \" + i + \" \" + rc.getColSQL() + \" = \" + columnName);\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "public int findColumn(String columnName) throws SQLException {\n\n try {\n debugCodeCall(\"findColumn\", columnName);\n return getColumnIndex(columnName);\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "Column getColumns(int index);", "protected int getColumnOrderIndex(String name) {\n \tArrayList list = getColumnOrderNames();\n \tfor (int m = 0; m < list.size(); m++) {\n \t\tif (name.equals(list.get(m).toString())) {\n \t\t\treturn m;\n \t\t}\n \t}\n \treturn -1;\n\t}", "protected Integer getColumnIndex(String header, boolean caseSensitive){\n if (caseSensitive) return headerMap.getOrDefault(header, -1);\n else return getColumnIndex(header);\n }", "int getColumnPosition(String path);", "public int getColumnIndex() {\n return table.findColumnIndex(getName());\n }", "@Override\n @Nullable\n public Column findColumn(String name)\n {\n if (columnCache.containsKey(name)) {\n return columnCache.get(name);\n } else {\n final Column column = rac.findColumn(name);\n if (column == null) {\n columnCache.put(name, null);\n return null;\n }\n\n final ColumnAccessor accessor = column.toAccessor();\n return new ColumnAccessorBasedColumn(\n new ColumnAccessor()\n {\n @Override\n public ColumnType getType()\n {\n return accessor.getType();\n }\n\n @Override\n public int numRows()\n {\n return end - start;\n }\n\n @Override\n public boolean isNull(int rowNum)\n {\n return accessor.isNull(pointers[start + rowNum]);\n }\n\n @Nullable\n @Override\n public Object getObject(int rowNum)\n {\n return accessor.getObject(pointers[start + rowNum]);\n }\n\n @Override\n public double getDouble(int rowNum)\n {\n return accessor.getDouble(pointers[start + rowNum]);\n }\n\n @Override\n public float getFloat(int rowNum)\n {\n return accessor.getFloat(pointers[start + rowNum]);\n }\n\n @Override\n public long getLong(int rowNum)\n {\n return accessor.getLong(pointers[start + rowNum]);\n }\n\n @Override\n public int getInt(int rowNum)\n {\n return accessor.getInt(pointers[start + rowNum]);\n }\n\n @Override\n public int compareRows(int lhsRowNum, int rhsRowNum)\n {\n return accessor.compareRows(pointers[lhsRowNum], pointers[start + rhsRowNum]);\n }\n }\n );\n }\n }", "String getColumn();", "private int nameToPropertiesColumnIndex(String name) {\n \tInteger index = (Integer)nameToPropertiesColumnIndex.get(name);\n return (index != null) ? index.intValue() : -1;\n }", "DataFrameColumn<R,C> colAt(int colIOrdinal);", "public int getIndexFromName(String fieldName) throws NoSuchElementException {\n for(int i = 0; i < columns.size(); i++) {\n String name = columns.get(i).getName();\n if(fieldName.equals(name)) {\n return i;\n }\n }\n throw new NoSuchElementException();\n }", "public void searchAndVerifyColumnHeader()\r\n\t{\r\n\t\tselectCriteriaAndSearchValue();\r\n\t\tsearchColumnHeaderValidation();\r\n\t}", "Table setColumn(int index, String name);", "private int getDocIdColumnIndex(String[] columnNames, String docIdColumnName) throws PersistenceException {\n int itemIdColNum = -1;\n if (docIdColumnName != null) {\n for (int i = 0; i < columnNames.length; i++) {\n if (columnNames[i].equals(docIdColumnName)) {\n itemIdColNum = i + 1; // + 1 for JDBC\n break;\n }\n }\n if (itemIdColNum == -1) {\n throw new PersistenceException(\n String.format(\"The document ID column could not be found in the SQL result set. docIdColumn: '%s', SQL: %s, columns: %s.\",\n docIdColumnName, sqlStatement, String.join(\", \", columnNames)));\n }\n }\n return itemIdColNum;\n }", "private int getColumn(char columnName) {\r\n\t\tint result = -1;\r\n\t\tif (columnName > 64 && columnName < 91) {\r\n\t\t\tresult = columnName - 65;\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "java.lang.String getColumn();", "int atColumn();", "public int findDataColumnIndex(String varName) throws NoSuchFieldException {\n\t\tint columnIdx = -1;\n\t\tfor (int i = 0; i < numDataCols; i++ ) {\n\t\t\tif ( dataTypes[i].typeNameEquals(varName)) {\n\t\t\t\tcolumnIdx = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n//\t\tif ( columnIdx == -1 ) {\n//\t\t\tthrow new NoSuchFieldException(\"No standard type found for \" + varName);\n//\t\t}\n\t\treturn columnIdx;\n\t}", "void setColumnIndex(int index);", "protected String getColumnHeader(Integer index){\n for (Map.Entry<String, Integer> entry: headerMap.entrySet()){\n if (index.equals(entry.getValue())) return entry.getKey();\n }\n return null;\n }", "@Override\n public String getColumnName(int columnIndex) {\n return nomeColunas[columnIndex];\n }", "@Override\n public String getColumnName(int columnIndex) {\n return nomeColunas[columnIndex];\n }", "@Override\n public String getColumnName(int column) { return columnnames[column]; }", "public int getColumn();", "public String getColumnName(int col) { return columnNames[col]; }", "public int getColIndex() {\r\n\t\treturn colIndex;\r\n\t}", "private void searchFor(int colIndex, String value) \n {\n if(colIndex == 2)\n {\n try\n {\n Integer.valueOf(value);\n } \n catch(NumberFormatException e)\n {\n JOptionPane.showMessageDialog(null,\"Expected integer\");\n return;\n }\n }\n ArrayList<String[]> jtData = getTableRowData();\n sortBubble(jtData, colIndex);\n int valueIndex = searchBinary(jtData, colIndex, value);\n if (valueIndex == -1)\n {\n JOptionPane.showMessageDialog(null, \"Not found\");\n }\n else \n {\n displayPaintInfo(jtData.get(valueIndex));\n }\n }", "int getColumn();", "public PgColumn getColumn(final String name) {\n PgColumn column = null;\n \n for (PgColumn curColumn : columns) {\n if (curColumn.getName().equals(name)) {\n column = curColumn;\n \n break;\n }\n }\n \n return column;\n }", "public static int getColumnIndex( @NonNull final String[] projection, @NonNull final String column ) {\n\t\tif( projection.length == 0 || TextUtils.isEmpty( column ) ) {\n\t\t\treturn -1;\n\t\t}\n\n\t\tfinal int size = projection.length;\n\t\tfor( int index = 0; index < size; index++ ) {\n\t\t\tif( projection[index].equalsIgnoreCase( column ) ) {\n\t\t\t\treturn index;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "public int findColumn(String columnName) throws SQLException\n {\n return m_rs.findColumn(columnName);\n }", "@Override\n public String getColumnName(int column) {\n return colName[column];\n }", "int getCol();", "public final AstValidator.col_index_return col_index() throws RecognitionException {\n AstValidator.col_index_return retval = new AstValidator.col_index_return();\n retval.start = input.LT(1);\n\n\n CommonTree root_0 = null;\n\n CommonTree _first_0 = null;\n CommonTree _last = null;\n\n CommonTree DOLLARVAR261=null;\n\n CommonTree DOLLARVAR261_tree=null;\n\n try {\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:448:11: ( DOLLARVAR )\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:448:13: DOLLARVAR\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n _last = (CommonTree)input.LT(1);\n DOLLARVAR261=(CommonTree)match(input,DOLLARVAR,FOLLOW_DOLLARVAR_in_col_index2240); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n DOLLARVAR261_tree = (CommonTree)adaptor.dupNode(DOLLARVAR261);\n\n\n adaptor.addChild(root_0, DOLLARVAR261_tree);\n }\n\n\n if ( state.backtracking==0 ) {\n }\n }\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n }\n\n }\n\n catch(RecognitionException re) {\n throw re;\n }\n\n finally {\n \t// do for sure before leaving\n }\n return retval;\n }", "public static int getColNumFromTxt(String headerName, ArrayList<ArrayList<String>> datas) {\n\r\n int i = 0;\r\n for (i = 0; i < datas.get(0).size(); i++) {\r\n //System.out.println(datas.get(0).get(i));\r\n if (datas.get(0).get(i).toLowerCase().equals(headerName.toLowerCase())) {\r\n return i;\r\n }\r\n }\r\n return 9999;\r\n }", "public static String getColNameFromIndex(int index, ArrayList<ArrayList<String>> datas) {\n\r\n String columnHeaderName = datas.get(0).get(index);\r\n return columnHeaderName;\r\n }", "public Integer getColIndex() {\r\n\t\treturn colIndex;\r\n\t}", "final int getColumnIdx( int column ) throws SQLException{\n\t\tif(column < 1 || column > columns.size())\n\t\t\tthrow SmallSQLException.create( Language.COL_IDX_OUT_RANGE, String.valueOf(column));\n\t\treturn column-1;\n\t}", "public int findColumn(String sql, int end) {\n String extraChars = \"'`\\\".\";\n int pos = end - 1;\n char c;\n \n while (pos >= 0) {\n c = sql.charAt(pos);\n if (!Character.isJavaIdentifierPart(c) && extraChars.indexOf(c) < 0) {\n pos++;\n break;\n }\n pos--;\n }\n if (pos < end) {\n return pos;\n } else {\n return -1;\n }\n }", "public abstract int getColumn();", "private static TextColumnBuilder getColumnByNameField(String nameField){ \n return drColumns.get(nameField);\n }", "public Column getColumn(int pos) { return columns[pos]; }", "public Column getColumn(String columnName);", "private static int getColumn(String s) {\n int i = -1;\n try {\n i = Integer.parseInt(s);\n } catch (Exception e) {\n return -1;\n }\n if (i>GameBoardMainArea.NUMCOLS) {\n return -1;\n }\n if (i<1) {\n return -1;\n }\n return i;\n }", "@Override\n\tpublic String getColumnName(int arg0) throws SQLException {\n\t\treturn columns[arg0-1];\n\t}", "public int getColumnIndex(Comparable key) {\n/* 174 */ int index = this.underlying.getColumnIndex(key);\n/* 175 */ if (index >= this.firstCategoryIndex && index <= lastCategoryIndex()) {\n/* 176 */ return index - this.firstCategoryIndex;\n/* */ }\n/* 178 */ return -1;\n/* */ }", "private int obtemIndiceColuna(String colunaNome, String nomeTabela) {\n WebElement tabela = obtemTabela(nomeTabela);\n List<WebElement> colunas = tabela.findElements(By.xpath(\".//th\"));\n int idColuna = -1;\n for(int i=0;i<colunas.size();i++) {\n if(colunas.get(i).getText().equals(colunaNome)) {\n idColuna = i+1;\n break;\n }\n }\n\n return idColuna;\n }", "public String getColumnName(int index)\n {\n return header[index];\n }", "public ColumnInTable getColumn(String colName) throws ParseException {\n String[] cit = colName.split(\"\\\\.\");\n String tName = null;\n String columnName;\n ColumnInTable res = null;\n \n if (cit.length == 1) {\n columnName = cit[0];\n }\n else {\n tName = cit[0];\n columnName = cit[1];\n }\n \n if (tName == null) {\n res = getColumn(null, columnName);\n }\n else {\n ArrayList<Integer> indices = getIndices(cit[0]);\n if (indices.isEmpty()) {\n throw new ParseException(Message.getMessage(Message.WHERE_TABLE_NOT_SPECIFIED));\n }\n res = getColumn(indices, cit[1]);\n }\n \n if (res == null) {\n throw new ParseException(Message.getMessage(Message.WHERE_COLUMN_NOT_EXIST));\n }\n \n return res;\n }", "public int mapColumnIndex(int parsedIndex) {\n\t\treturn parsedIndex - getFirstColumnIndex();\n\t}", "@Override\n public String getColumnName(int aColumn) {\n return model.getColumnName(aColumn); \n }", "com.factset.protobuf.stach.v2.table.ColumnDefinitionProto.ColumnDefinition getColumns(int index);", "public String getColumnName(int columnIndex){\n return COLUMN_NAMES[columnIndex];\n }", "public String getColumnName(int theCol) {\n return columnNameList[theCol];\n }", "public String getColumnName(int col) {\n return columns[col] ;\n }", "public IColumn getColumnByIndex(int idx) throws ETLException {\r\n\t\tIColumn col = columnIndexMap.get(idx);\r\n\t\tif (col == null) {\r\n\t\t\tthrow new ETLException(\"A column with the index \" + idx + \" does not exist.\");\r\n\t\t}\r\n\t\treturn col;\r\n\t}", "@Override\n\tpublic String getColumnName(int col)\n\t{\n\t\treturn nomColonnes[col];\n\t}", "public boolean containsColumn(final String name) {\n boolean found = false;\n \n for (PgColumn column : columns) {\n if (column.getName().equals(name)) {\n found = true;\n \n break;\n }\n }\n \n return found;\n }", "@Override\r\n\tpublic String getColumnName(int column) {\n\t\treturn columnName[column];\r\n\t}", "@Override\r\n\tpublic String getColumnName(int column) {\n\t\treturn columnName[column];\r\n\t}", "String getColumnName();", "@Override\n\tpublic String getColumnName(int col) throws SQLException {\n\t\tif (col <= this.width && col >= 1) {\n\n\t\t\tcol--;\n\t\t\tString str = table[0][col];\n\t\t\tStringTokenizer token = new StringTokenizer(str, \",\");\n\t\t\tString label = token.nextToken();\n\n\t\t\treturn label;\n\n\t\t} else\n\t\t\tthrow new SQLException(\"column requested out of table bounds \");\n\t}", "public int nameIndex();", "@Override\n public String getColumnName(int column) {\n return columnNames[column];\n }", "@Override\n public String getColumnName(int column) {\n return columnNames[column];\n }", "@Override\r\n public String getColumnName(int col) {\r\n return title[col];\r\n }", "void setColumnIndex(int newIndex);", "public int getColumnNumber(String sheetName, String Columnname)\n\t{\n\t\t// check if sheet exists\n\t\tif(!isSheetExist(sheetName))\n\t\t return -1;\n\t\t\n\t\tsheet = workbook.getSheet(sheetName);\n\t\trow = sheet.getRow(0);\n\t\t\n\t\tif(row==null)\n\t\t\treturn -1;\n\t\tint i;\n\t\tfor(i=0;i < row.getLastCellNum();i++)\n\t\t{\n\t\t\tif(row.getCell(i).getStringCellValue().toString().equals(Columnname))\n\t\t\t\tbreak;\n\t\t}\n\t\tif (i==row.getLastCellNum())\n\t\t\treturn -1;\n\t\telse\n\t\treturn i;\t\t\n\t}", "@Override\n\tpublic String getColumnName(int col) {\n\t\treturn NOMICOLONNE[col];\n\t}", "public String getColumnName(int c) {\n\treturn columnNames[c];\n}", "public int getColumn() {\n // YOUR CODE HERE\n return this.column;\n }", "@Override\n public String getColumnName(int columnIndex) {\n return columnNames[columnIndex];\n }", "public int getColumn() { return cc; }", "Column getColumnForAttribute(String name) {\n name = Strings.underscore(name);\n for (Column column : getColumns()) {\n if (column.getName().equals(name)) return column;\n }\n return null;\n }", "void incrementColumnIndex();", "void incrementColumnIndex();", "private static String getIndex() {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(App.getAppContext());\n String defaultValue = Strings.getStringByRId(R.string.c_elastic_search_index_name_default_value);\n String value = Strings.getStringByRId(R.string.c_select_elastic_search_index_name);\n String index = sp.getString(value, defaultValue);\n return index;\n }", "private int getIndex(int row,int column,int maxColumn)\n {\n \tint rownumber = row*maxColumn+column;\n \treturn rownumber;\n }", "public Set<String> getColumnIndices() {\n Set<String> columnIndices = new HashSet<>();\n for (String index : indices) {\n columnIndices.add(escapeIndex(index));\n }\n return columnIndices;\n }", "private int getCol(int index) {\n return index & (chunkSize - 1);\n }", "private static List<Integer> getColumn(int colIndex, int[][] m) {\r\n List<Integer> col = new ArrayList<Integer>(m[0].length);\r\n for (int i = 0; i < m.length; ++i) {\r\n col.add(m[i][colIndex]);\r\n }\r\n\r\n return col;\r\n }", "public String getColumnName(int col) {\n\t return columnNames[col];\n }", "public int getCol() {\n\t\treturn j;\n\t}", "com.google.devtools.kythe.proto.Filecontext.ContextDependentVersion.Column getColumn(int index);", "private int nameToPropertiesRowIndex(String name) {\n \tInteger index = (Integer)nameToPropertiesRowIndex.get(name);\n return (index != null) ? index.intValue() : -1;\n }" ]
[ "0.74611855", "0.7194375", "0.7016336", "0.66594887", "0.66594887", "0.665217", "0.665217", "0.665217", "0.6629026", "0.657483", "0.657483", "0.65541935", "0.6527966", "0.65148926", "0.6477213", "0.6337101", "0.63285476", "0.6297527", "0.6276535", "0.61842704", "0.61576957", "0.6077", "0.60630375", "0.60569274", "0.6041869", "0.6029475", "0.5987979", "0.59790695", "0.5964861", "0.5932846", "0.59285", "0.5926533", "0.590409", "0.58871454", "0.5838717", "0.5835045", "0.5835045", "0.5823943", "0.5819077", "0.5817957", "0.57784206", "0.5773731", "0.5769272", "0.5767532", "0.5755832", "0.5747055", "0.5738695", "0.573391", "0.5722365", "0.57110316", "0.57061213", "0.5705916", "0.57053065", "0.57000685", "0.5695903", "0.56949574", "0.5689887", "0.5668507", "0.56676036", "0.56650126", "0.5649707", "0.5614169", "0.5609947", "0.560802", "0.55994606", "0.55930597", "0.55818444", "0.5562712", "0.5555916", "0.5540838", "0.5536742", "0.55300313", "0.55262053", "0.551679", "0.551679", "0.55163085", "0.5511204", "0.5494239", "0.54911506", "0.54911506", "0.54907787", "0.5490542", "0.5482576", "0.54771376", "0.5465885", "0.5465794", "0.5449879", "0.54472464", "0.5432889", "0.5431374", "0.5431374", "0.54252017", "0.54247516", "0.5421966", "0.539789", "0.53973895", "0.5381172", "0.537802", "0.53776366", "0.5376788" ]
0.6390447
15
This method will search for the entered value in array.
private void searchFor(int colIndex, String value) { if(colIndex == 2) { try { Integer.valueOf(value); } catch(NumberFormatException e) { JOptionPane.showMessageDialog(null,"Expected integer"); return; } } ArrayList<String[]> jtData = getTableRowData(); sortBubble(jtData, colIndex); int valueIndex = searchBinary(jtData, colIndex, value); if (valueIndex == -1) { JOptionPane.showMessageDialog(null, "Not found"); } else { displayPaintInfo(jtData.get(valueIndex)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args){\n int arrayLength = -1;\r\n \r\n while(arrayLength <=0){\r\n System.out.print(\"Enter an integer for the number of elements of your array.\");\r\n arrayLength = console.nextInt();\r\n }\r\n \r\n int[] array = new int[arrayLength];\r\n \r\n for(int i = 0; i < array.length; i++){\r\n System.out.print(\"Enter your elements.\");\r\n array[i] = console.nextInt();\r\n }\r\n \r\n System.out.print(\"Enter a value for which to search within the array\");\r\n int value = console.nextInt();\r\n \r\n int lostOrFound = indexOf(array, value);\r\n if(lostOrFound != -1) {\r\n System.out.println(\"We found your value within the array!:\" + array[lostOrFound]);\r\n }else{\r\n System.out.println(\"We DID NOT find your value within the array!\");\r\n }\r\n }", "public static void main(String[] args) {\n int[] a = new int[15];\n int searchV = 0, index;\n System.out.println(\"Enter 15 numbers\");\n\n //now we put all th value in a previous define array with help of scanner class\n Scanner input = new Scanner(System.in);\n for (int i = 0; i < a.length; i++) {\n a[i] = input.nextInt();\n }\n\n System.out.print(\"Enter a number to search for: \");\n // take the user input which he want to search\n searchV = input.nextInt();\n index = binarySearch(a, searchV);\n if (index != -1) {\n System.out.println(\"Found at index: \" + index);\n } else {\n System.out.println(\"Not Found\");\n }\n }", "public static void main(String[] args) {\n System.out.println(\"How many number are you going to enter? \");\n Random rand = new Random()\n //Create the scanner instance and the array of numbers\n Scanner scanner = new Scanner(System.in);\n int len = scanner.nextInt();\n int[] array = new int[len];\n\n for(int x=0; x<len; x++){\n array[x] = rand.nextInt();\n }\n System.out.println(Arrays.toString(array));\n System.out.println(\"Enter a number to search for\");\n int find = scanner.nextInt();\n //Linear search\n boolean found = false;\n for(int x=0; x<len; x++){\n if(array[x]==find){\n found = true;\n System.out.println(\"Found at index: \"+x);\n }\n }\n if(!found){\n System.out.println(\"Not found\");\n }\n //Close the scanner\n scanner.close();\n }", "private void search(Object value)\r\n\t\t{\n\r\n\t\t}", "private void arraySearch(MyArrayList myArrayList, Results results, int value) {\r\n if(myArrayList.search(value)) { \r\n results.storeNewResult(\"ArraySearch test case: PASSED\");\r\n }\r\n else { \r\n results.storeNewResult(\"ArraySearch test case: FAILED\");\r\n }\r\n }", "public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t\tint[] values;\n\t\tSystem.out.println(\"How many numbers do you want to save? (digit only): \");\n\t\tint index = Integer.parseInt(input.nextLine());\n\t\t\n\t\tvalues = new int[index];\n\t\tSystem.out.println();\n\t\t\n\t\tfor(int i = 0; i < values.length; i++) {\n\t\t\tSystem.out.print(\"Enter number: \");\n\t\t\tvalues [i] = Integer.parseInt(input.nextLine());\n\t\t}\t\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Enter search number: \");\n\t\tint search = Integer.parseInt(input.nextLine());\n\t\t\n\t\tboolean found = false;\n\t\tint count = 0;\n\t\t// search value in array\n\t\tfor(int i =0;i<values.length; i++) {\n\t\t\tif(values[i]==search) {\n\t\t\t\t\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcount++;\n\t\t}\n\t\t\n\t\tSystem.out.println(count);\n\t\tif(found) {\n\t\t\tSystem.out.println(\"Search Number: \"+ search +\" is found in array.\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"Search Number: \"+ search + \"is not found in array.\");\n\t\t}\n\t}", "private void search(String[] searchItem)\n {\n }", "private boolean contains(List<NodeId> array, NodeId searchValue) {\n return array != null && array.contains(searchValue);\n }", "public static void main( String args[] )\n{\n Scanner input = new Scanner( System.in );\n \n int searchInt; // search key\n int position; // location of search key in array\n\n // create array and output it\n BinaryArray searchArray = new BinaryArray( 15 );\n System.out.println( searchArray );\n\n // get input from user\n System.out.print( \n \"Please enter an integer value (-1 to quit): \" );\n searchInt = input.nextInt(); // read an int from user\n System.out.println();\n\n // repeatedly input an integer; -1 terminates the program\n while ( searchInt != -1 )\n {\n // use binary search to try to find integer\n position = searchArray.binarySearch( searchInt );\n\n // return value of -1 indicates integer was not found\n if ( position == -1 )\n System.out.println( \"The integer \" + searchInt + \n \" was not found.\\n\" );\n else\n System.out.println( \"The integer \" + searchInt + \n \" was found in position \" + position + \".\\n\" );\n\n // get input from user\n System.out.print( \n \"Please enter an integer value (-1 to quit): \" );\n searchInt = input.nextInt(); // read an int from user\n System.out.println();\n } // end while\n}", "private static void search(int arr[],int element)\n {\n for(int i=0;i<arr.length;i++)\n {\n if(arr[i]==element)\n {\n System.out.println(\"The \"+element+\" is located at the position of \"+i);\n System.exit(0);\n }\n }\n }", "public static void main(String[] args) {\n\t\tint[] a ;\n\t int size;\n\t \n\t System.out.println(\"Enter size of array\");\n\t Scanner obj = new Scanner(System.in);\n\t size=obj.nextInt();\n\t a=new int[size];\n\t System.out.println(\"Enter the values of array\");\n\t for(int i=0;i<a.length;i++)\n\t {\n\t Scanner obj1 = new Scanner(System.in);\n\t a[i]=obj1.nextInt();\n\t }\n\t System.out.println(\"Enter the number to find in array\");\n\t Scanner obj2 = new Scanner(System.in);\n\t int number=obj2.nextInt();\n\t int k=0;\n\t for (int i=0;i<a.length;i++)\n\t {\n\t if(a[i]==number) \n\t {\n\t System.out.println(number + \"found at location \" + i);\n\t k=1;\n\t }\n\t \n\t }\n\t if(k==0)\n\t {\n\t System.out.println(number + \" not found\");\n\t }\n\t \n\t}", "public static void main(String[] args) {\n\t\t\tScanner input=new Scanner(System.in);\r\n\t\t\tSystem.out.println(\"Enter the size of array\");\r\n\t\t\tint n=input.nextInt();\r\n\t\t\tSystem.out.println(\"Enter the element to search\");\r\n\t\t\tint k=input.nextInt();\r\n\t\t\tSystem.out.println(\"Enter the array\");\r\n\t\t\tint [] arr=new int[n];\r\n\t\t\tfor(int i=0;i<n;i++)\r\n\t\t\t{\r\n\t\t\t\tarr[i]=input.nextInt();\r\n\t\t\t}\r\n\t\t\tfor(int i=0;i<n;i++)\r\n\t\t\t{\r\n\t\t\t if(arr[i]==k)\r\n\t\t\t {\r\n\t\t\t\t System.out.println(i+1);\r\n\t\t\t\t break;\r\n\t\t\t\t \r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t System.out.println(\"Element not found\");\r\n\t\t\t\t break;\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 static boolean searchInput (String search, String[] array, int length){\n\t\tboolean result = false;\n\t\tfor (int i = 0; i<length; i++){\n\t\t\tif (search.equals(array[i])){\n\t\t\t\tresult = true;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "public static void main(String[] args) {\n \r\n String outPut = \"\";\r\n \r\n int arrLength = 0;\r\n \r\n Scanner scanSomething = new Scanner(System.in);\r\n\r\n \r\n System.out.println(\"Enter length of array.\");\r\n \r\n arrLength = scanSomething.nextInt();\r\n \r\n System.out.println(\"Enter the array values.\");\r\n \r\n String[] stringArr = new String[arrLength];\r\n \r\n for (int i = 0; i < stringArr.length; i++) {\r\n stringArr[i] = scanSomething.next();\r\n }\r\n \r\n System.out.println(\"Enter the sought value.\");\r\n \r\n String sought = scanSomething.next();\r\n \r\n \r\n for (int i = 0; i < stringArr.length; i++) {\r\n if (stringArr[i].equals(sought)) {\r\n outPut = String.valueOf(i);\r\n break;\r\n }\r\n }\r\n \r\n \r\n \r\n System.out.println(outPut);\r\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tint[] arr = {2,4,6,8,9,12};\r\n\t\tSystem.out.println(\"Enter number to be searched:\\n\");\r\n\t\tScanner scanner = new Scanner(System.in);\r\n\t\tint num = scanner.nextInt();\r\n\t\t\r\n\t\tSystem.out.println(\"Number is \"+num);\r\n\t\t\r\n\t\tif(binarySearch(arr, num , 0 , arr.length-1)){\r\n\t\t\tSystem.out.println(\"Number is present\");\r\n\t\t}\r\n\t\telse{\r\n\t\t\tSystem.out.println(\"Number is not present\");\r\n\t\t}\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tScanner k = new Scanner(System.in);\r\n\t\tCharge c1 = new Charge();\r\n\t\t\r\n\t\tint input;\r\n\t\t\r\n\t\t//do while loop that determines if the account number is present in the array\r\n\t\tdo{\r\n\t\tSystem.out.println(\"Enter your charge account number: \");\r\n\t\tinput = k.nextInt();\r\n\t\tif(c1.sequentialSearch(input) == -1){;\r\n\t\tSystem.out.println(\"The account number is not present.\");\r\n\t\t}else{\r\n\t\t\tSystem.out.println(\"The charge account number exists.\");\r\n\t\t}\r\n\t\t}while(input != 9999999);\r\n\t\t\r\n\t\r\n\t}", "public static boolean search(int[] array, int numberToSearchFor) {\n\n// Enhanced Loop. Iterates through array and each time assigns\n// the current element to 'value'\n for(int value : array){\n if(value == numberToSearchFor){\n return true;\n }\n\n }\n\n// if we've reached this point, then the entire array was search and the value was not found.\n return false;\n }", "public static void main(String[] args) {\n Scanner sc=new Scanner(System.in);\n int nums[] = new int[5];\n\n for(int i = 0; i < nums.length; i++) {\n nums[i] = sc.nextInt();\n }\n\n System.out.println(\"Enter a number to search: \");\n int numtocheck = sc.nextInt();\n\n boolean found = false;\n for(int i = 0; i < nums.length; i++) {\n if(numtocheck == nums[i]) {\n found = true;\n }\n }\n\n if(found == true) {\n System.out.println(\"We found the number!\");\n }else {\n System.out.println(\"The number isn't there.\");\n }\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tint[] arr = {2,7,4,9,36,3,0,24,65,6};\r\n\t\tSystem.out.println(\"Enter number to be searched:\\n\");\r\n\t\tScanner scanner = new Scanner(System.in);\r\n\t\tint num = scanner.nextInt();\r\n\t\t\r\n\t\tSystem.out.println(\"Number is \"+num);\r\n\t\t\r\n\t\tif(linearSearch(arr,num)){\r\n\t\t\tSystem.out.println(\"Number is present\");\r\n\t\t}\r\n\t\telse{\r\n\t\t\tSystem.out.println(\"Number is not present\");\r\n\t\t}\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter the size of array...\");\n\t\tint size = scanner.nextInt();\n\t\tint[] arr = new int[size];\n\t\tfor(int i=0;i<arr.length;i++) {\n\t\t\tarr[i] = new SecureRandom().nextInt(100);\n\t\t}\n\t\tSystem.out.println(\"array is created with size: \" + size + \" and limited to 100...\");\n\t\tprintArray(arr);\n\t\tSystem.out.println(\"Enter the number to be sarched...\");\n\t\tint number = scanner.nextInt();\n\t\t\n\t\t/* boolean searched = binarySearch(arr , \n\t\t\t\tnumber);*/\n\t\tArrays.sort(arr);\n\t\tboolean searched = binarySearchRecurion(arr, number, \n\t\t\t\t0, arr.length-1);\n\t\tif(!searched) {\n\t\t\tSystem.out.println(\"number is not prsent in array...\");\n\t\t}else {\n\t\t\tSystem.out.println(\"number is present...\");\n\t\t}\n\t\tscanner.close();\n\t}", "public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n System.out.println(\"Enter number of elements\");\n int i = sc.nextInt();\n int[] array = new int[i];\n\n\n System.out.println(\"Enter \" + i + \" integers\");\n\n for (int c = 0; c < i; c++) {\n array[c] = sc.nextInt();\n }\n\n System.out.println(\"Enter value to find\");\n int search = sc.nextInt();\n\n MyBinarySearch mbs = new MyBinarySearch();\n Arrays.sort(array);\n System.out.println(search + \" was found at index \" + mbs.binarySearch(array, search) + \" in array \" + Arrays.toString(array));\n\n\n// MyBinarySearch mbs = new MyBinarySearch();\n// int[] arr = {2, 4, 6, 8, 10, 12, 14, 16};\n// System.out.println(\"Key 14's position: \"+mbs.binarySearch(arr, 14));\n// int[] arr1 = {6,34,78,123,432,900};\n// System.out.println(\"Key 432's position: \"+mbs.binarySearch(arr1, 432));\n }", "public static void main(String[] args) {\n\t\tint n;\n\t\tint k;\n\t\tScanner sc = new Scanner(System.in);\n\t\tn=sc.nextInt();\n\t\tk=sc.nextInt();\n\t\tint [] arr = new int [n];\n\t\t\n\t\tfor(int i=0;i<arr.length;i++){\n\t\t\tarr[i]=sc.nextInt();\n\t\t}\n\t\tint i=search(arr, 0, n-1,k);\n\t\tif(i==-1){\n\t\t\tSystem.out.println(\"key doesnt exist\");\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"Element found at Index ----->\"+i);\n\t\t\t\n\t\t}\n\t\t\n\n\t}", "public static void main(String[] args) {\n\t\tArrayList<Integer> al=new ArrayList<Integer>();\r\n\t\tal.add(100);\r\n\t\tal.add(50);\r\n\t\tal.add(2,90);\r\n\t\tal.add(20);\r\n\t\tal.add(53);\r\n\t\tal.add(70);\r\n\t\tal.add(10);\r\n\t\tSystem.out.println(al);\r\n\t\tSystem.out.println(\"Enter the key:\");\r\n\t\tScanner s=new Scanner(System.in);\r\n\t\tint[] ar=new int[al.size()];\r\n\t\tfor(int i=0;i<al.size();i++)\r\n\t\t{\r\n\t\t\tar[i]=al.get(i);\r\n\t\t}\r\n\t\tArrays.sort(ar);\r\n\t\tint key=s.nextInt();\r\n\t\tint index=Arrays.binarySearch(ar,key);//binarySearch is only applicable if the array is sorted \r\n\t\tif(index>=0)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Element found at\"+\" \"+index);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Element not found\");\r\n\t\t}\r\n\t\t//System.out.println(index);\r\n\t}", "public static int findValue(int [] array, int value){\n int index = -1;\n for(int i = 0; i < array.length; i++){\n if(value == array[i]){\n index = i + 1;\n System.out.println(Arrays.toString(array));\n }\n }\n return index;\n }", "private void searchFunction() {\n\t\t\r\n\t}", "private int indexValue(String value) {\n int loc = openHashCode(value);\n //if the searchVal exist\n if (this.openHashSetArray[loc] == null||!this.openHashSetArray[loc].myList.contains(value))\n return -1;\n else\n return loc;\n\n }", "public static void main(String[] args) {\n\n\t\torderArray array = new orderArray(10);\n\t\tarray.insert(50);\n\t\tarray.insert(20);\n\t\tarray.insert(30);\n\t\tarray.insert(55);\n\t\tarray.insert(45);\n\t\tint searchKey = 48;\n\n\t\tif (array.find(searchKey) != array.size())\n\t\t\tSystem.out.println(\"Found \" + searchKey);\n\t\telse\n\t\t\tSystem.out.println(\"Can't find\");\n\n\t}", "public static void main(String[] args) {\n\t\tint arr[];\r\n\t\tarr = new int[10];// Initializes all elements in the array to chosen numbers.\r\n\t\tarr[0] = 12;\r\n\t\tarr[1] = 21;\r\n\t\tarr[2] = 34;\r\n\t\tarr[3] = 2;\r\n\t\tarr[4] = 5;\r\n\t\tarr[5] = 67;\r\n\t\tarr[6] = 31;\r\n\t\tarr[7] = 9;\r\n\t\tarr[8] = 87;\r\n\t\tarr[9] = 94;\r\n\t\tint f = arr.length;\r\n\r\n\t\tfor (int i = 0; i < f - 1; i++) {// This is the selection sort algorithm used to sort the array.\r\n\r\n\t\t\tint min = i;\r\n\t\t\tfor (int j = i + 1; j < f; j++)\r\n\t\t\t\tif (arr[j] < arr[min])\r\n\t\t\t\t\tmin = j;\r\n\r\n\t\t\tint temp = arr[min];\r\n\t\t\tarr[min] = arr[i];\r\n\t\t\tarr[i] = temp;\r\n\t\t}\r\n\t\tfor(int i = 0; i < arr.length; i++) {\r\n\t\t\tSystem.out.println(arr[i]);\r\n\t\t}\r\n\t\t// The below code will allow the user to search for a value in the array by typing in what they want to find,\r\n\t\t// and will use binary search to find it. Binary search is its own function.\r\n\t\tScanner inp = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Which number do you want to look for?\");\r\n\t\tint lookNum = inp.nextInt();\r\n\t\t\r\n\t\tif(binarySearch(arr, 0, arr.length - 1, lookNum) != -1) {\r\n\t\t\tSystem.out.println(\"Number Found\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"Number not found!\");\r\n\t\t}\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tint[] abc = {2,3,4,2,5,5};\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.println(\"enter searching index\");\n\t\tint n = sc.nextInt();\n\t\tSystem.out.println(abc[n]);\n\t\t\n\t\tint num = sc.nextInt();\n\t\tfor(int i=0;i<abc.length;i++)\n\t\t{\n\t\t\tif(num==abc[i])\n\t\t\t{\n\t\t\t\tSystem.out.println(i);\n\t\t\t}\n\t\t}\n\t}", "private void performSearch() {\n String text = txtSearch.getText();\n String haystack = field.getText();\n \n // Is this case sensitive?\n if (!chkMatchCase.isSelected()) {\n text = text.toLowerCase();\n haystack = haystack.toLowerCase();\n }\n \n // Check if it is a new string that the user is searching for.\n if (!text.equals(needle)) {\n needle = text;\n curr_index = 0;\n }\n \n // Grab the list of places where we found it.\n populateFoundList(haystack);\n \n // Nothing was found.\n if (found.isEmpty()) {\n Debug.println(\"FINDING\", \"No occurrences of \" + needle + \" found.\");\n JOptionPane.showMessageDialog(null, \"No occurrences of \" + needle + \" found.\",\n \"Nothing found\", JOptionPane.INFORMATION_MESSAGE);\n \n return;\n }\n \n // Loop back the indexes if we have reached the end.\n if (curr_index == found.size()) {\n curr_index = 0;\n }\n \n // Go through the findings one at a time.\n int indexes[] = found.get(curr_index);\n field.select(indexes[0], indexes[1]);\n curr_index++;\n }", "public static void linearSearch(int[] array,int key){\n for(int i=0;i<array.length;i++){\n if(array[i]==key){\n System.out.println(key+\" was found in the list with \"+(i+1)+\" iterations\");break;}\n else if(i==array.length-1&&array[i]!=key){\n System.out.println(key+\" was not found in the list with \"+(i+1)+\" iterations\"); }\n }\n }", "public static int doSearch(int[] array, int targetValue) {\r\n int min = 0;\r\n System.out.println(Arrays.toString(array));\r\n int max = array.length - 1;\r\n return findNumber(array, max, min, targetValue);\r\n }", "private static <V> int buscarPosicion(V pValue, V[] pArray) {\n for (int x = 0; x < pArray.length; x++) {\n if (pArray[x].equals(pValue)) {\n return x;\n }\n }\n return -1;\n }", "java.lang.String getSearchValue();", "void findRec () {\r\n\r\n\t\tboolean found = false;\r\n\t\tfor (int x = 0; x < total; x++) {\r\n\t\t\tif (records[x][0].equals (txtNo.getText())) {\r\n\t\t\t\tfound = true;\r\n\t\t\t\tJOptionPane.showMessageDialog (this, \"Account No. \" + txtNo.getText () + \" is Already Exist.\",\r\n\t\t\t\t\t\t\t\"BankSystem - WrongNo\", JOptionPane.PLAIN_MESSAGE);\r\n\t\t\t\ttxtClear ();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (found == false) {\r\n\t\t\tsaveArray ();\r\n\t\t}\r\n\r\n\t}", "void searchNotes(Note arr[]){\n\n }", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int elem = scanner.nextInt();\n ArrayList<Integer> list = new ArrayList<>();\n while (scanner.hasNextInt()) {\n list.add(scanner.nextInt());\n }\n int[] array = new int[list.size()];\n for (int i = 0; i < array.length; i++) {\n array[i] = list.get(i);\n }\n System.out.println(binarySearch(array,elem));\n }", "@Override\n public boolean inputCheck(ArrayList<Integer> arr, int input,int index){\n if(arr.get(index) == input){return true;}\n return false;\n }", "@In String search();", "public void searchValue(ActionEvent actionEvent) {\n RadioButton selectedRadioButton = (RadioButton) radioSelector.getSelectedToggle();\n String toogleGroupValue = selectedRadioButton.getText();\n boolean valueSearch = false;\n if (toogleGroupValue.equals(\"Value\")) {\n valueSearch = true;\n }\n String text = searchText.getText();\n DataBase dataBase = new DataBase(file);\n ArrayList <KeyValue> data = dataBase.searchData(text, valueSearch);\n tableKeyValue.getItems().clear();\n if (data.size() > 0) {\n this.list.addAll(data);\n }\n\n }", "public String linearSearchForValue(int value) {\n String indexWithValue = \"\";\n boolean found = false;\n for(int i= 0; i < arraySize; i++){\n if(theArray[i] == value){\n found = true;\n indexWithValue += i + \" \";\n }\n printHorizontalArray(i, -1);\n }\n\n if(!found){\n indexWithValue = \"None\";\n }\n System.out.println(\"The value was found in the following: \" + indexWithValue);\n System.out.println();\n\n return indexWithValue;\n }", "@Override\n\tpublic int find(int pValueToFind) {\n\t\tfor (int n = 0; n < pointer; ++n) {\n\t\t\tif (values[n] == pValueToFind) {\n\t\t\t\t// this returns the index position\n\t\t\t\treturn n;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "public static boolean checkIfPresent(int[][] arr, int key) {\n\t\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\t\tScanner sc=new Scanner(System.in) ;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tint flag=0 ;\n\t\t\t\t//System.out.print(\"Enter number to find\" );\n\t\t\t\t//int key=sc.nextInt() ;\n\t\t\t\tfor(int i=0;i<2;i++)\n\t\t\t\t{\n\t\t\t\t\tfor(int j=0;j<2;j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(arr[i][j]==key)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn true ;\n//\t\t\t\t\t\t\tflag=1 ;\n//\t\t\t\t\t\t\tbreak ;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn false ;\t\n\t\t\t\t\n\t\t\t\t\n\n}", "public void search() {\r\n \t\r\n }", "public static void main(String[] args) {\n\n Random rand = new Random();\n ArrayList<Integer> listNumbers = new ArrayList<Integer>();\n\n int i = 0;\n while (i < 10) {\n int num = rand.nextInt(50) + 1;\n listNumbers.add(num);\n i++;\n }\n\n System.out.println(listNumbers);\n\n Scanner scan = new Scanner(System.in);\n System.out.print(\"Value to find: \");\n int num = scan.nextInt();\n\n for (Integer number : listNumbers) {\n if (num == number) {\n System.out.println(num + \" is in the array list.\");\n }\n }\n }", "while (!found && index < valid.length)\n {\n if (valid[index] == number)\n found = true;\n else\n index++;\n }", "boolean linearSearch(int[] arr, int searchNumber) {\r\n\t\tint size = arr.length;\r\n\r\n\t\tfor (int index = 0; index < size; index++) {\r\n\r\n\t\t\tif (arr[index] == searchNumber) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\r\n\t}", "static boolean contains(int[] a, int value){\n int i;\n\n for(i = 0; i < a.length; i++){\n if(a[i] == value) {\n return true;\n }\n }\n\n return false;\n }", "private void findEntry() {\n String desiredId = idField.getText();\n Student student = studentHashMap.get(desiredId);\n\n try {\n if (student == null) {\n throw new NoMatchFoundException();\n } else if (this.checkInput(student) == false) {\n throw new InputMismatchException();\n } else if (studentHashMap.containsKey(desiredId)) {\n this.displayStatusPanel(\n \"EMPLID: \" + desiredId + \"\\n\" + student.toString(),\n \"Find\",\n JOptionPane.INFORMATION_MESSAGE\n );\n } else {\n throw new NoMatchFoundException();\n }\n } catch(NoMatchFoundException ex) {\n this.displayStatusPanel(\n \"Error: Entry not found.\",\n \"Error\",\n JOptionPane.WARNING_MESSAGE\n );\n } catch(InputMismatchException e) {\n this.displayStatusPanel(\n \"Error: Information does not match data on file.\",\n \"Error\",\n JOptionPane.WARNING_MESSAGE\n );\n }\n }", "public static void main(String[] args) {\n\t\tint[] arr = { 13, 35, 15, 11, 26, 72, 78, 13, 61, 90 };\t\t\t\t\n\t\t\n\t\t// 위에 숫자 다 출력해주는 거랑 아래 78 찾는거 ! \n\t\t// 그리고 6번째 숫자라는건 i의 값이랑 똑같으니까 따로 변수에 안담아줘도 돼용\n\t\t// 스캐너 안써도 되고 그냥 for문으로 arr[i] 전체 출력 !하고\n\t\t// 78찾고 -> i번째 \n\t\tint search = 78;\n\t\tfor (int i = 0; i < arr.length; i++) {\t\t\t\n\t\t\tif (arr[i] == search) {\n\t\t\t\tSystem.out.println(search+\"는 \"+i+\"번째 숫자 입니다.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int a = in.nextInt();\n int n = in.nextInt();\n int[] arr = new int[n];\n for(int a_i=0; a_i < n; a_i++){\n arr[a_i] = in.nextInt();\n }\n\n for(int a0 = 0; a0 < n; a0++){\n if(arr[a0]==a){\n System.out.println(a0);\n break;\n }\n }\n }", "public void searchByAccount() {\n\t\t\n\t\tlog.log(Level.INFO, \"Please Enter the account number you want to search: \");\n\t\tint searchAccountNumber = scan.nextInt();\n\t\tbankop.search(searchAccountNumber);\n\n\t}", "public boolean search(int searchNo) {\r\n\t\t\r\n\t\t int n = array.length;\r\n\t\t \r\n\t int step = (int)Math.floor(Math.sqrt(n));\r\n\t int prev = 0;\r\n\t while (array[Math.min(step, n)-1] < searchNo)\r\n\t {\r\n\t prev = step;\r\n\t step += (int)Math.floor(Math.sqrt(n));\r\n\t if (prev >= n)\r\n\t return false;\r\n\t }\r\n\t \r\n\t while (array[prev] < searchNo)\r\n\t {\r\n\t prev++;\r\n\t if (prev == Math.min(step, n))\r\n\t return false;\r\n\t }\r\n\t if (array[prev] == searchNo)\r\n\t return true;\r\n\t \r\n\t\treturn false;\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tint n, search, array[];\n\t\t \n\t Scanner in = new Scanner(System.in);\n\t System.out.println(\"Enter number of elements\");\n\t n = in.nextInt();\n\t array = new int[n];\n\t \n\t System.out.println(\"Enter the elements in ascending order\");\n\t \n\t for (int i = 0; i < n; i++)\n\t array[i] = in.nextInt();\n\t \n\t System.out.println(\"Enter element to be searched\");\n\t search = in.nextInt();\n\t\n\t int low = 0, high = n - 1;\n\t while(low <= high) {\n\t \tint mid = (low + high)/2;\n\t \tif(array[mid] > search) {\n\t \t\thigh = mid - 1;\n\t \t}else if(array[mid] < search) {\n\t \t\tlow = mid + 1;\n\t \t}else {\n\t \t\tSystem.out.println(\"Element found at index \" + mid);\n\t \t\treturn;\n\t \t}\n\t }\n\t \n\t System.out.println(\"Element not present\");\n\t}", "private void fillInArray(int[] myArray, int searchedValue) {\n\t\t\n\t\tmyArray[0] = searchedValue;\n\t\t\n\t\tfor(int i=1; i<myArray.length; i++) {\n\t\t\tint valueTemp = (int) (Math.random() * myArray.length);\n\t\t\t\n\t\t\tmyArray[i] = valueTemp;\t\t\t\n\t\t}\n\t}", "public int search(char value)\n {\n for(int i = 0; i < this.raw_value.length; i++)\n {\n if(this.raw_value[i] == value) return i;\n }\n return -1;\n }", "protected int findIndex(A val) {\n int index = 0;\n boolean found = false;\n \n \n if (elems[0] == null || elems[0] == val){\n return index;\n }\n else{\n \n }\n \n \n\n return index; \n }", "boolean hasSearchValue();", "public int search(int[] arr, int num){\n\t\t\n\t\tsortingAlgo.sort(arr);\n\t\t\n\t\t// search algorithm\n\t\t\n\t\treturn 5;\n\t}", "include<stdio.h>\nint main()\n{\n int a[50],i,j,x,n;\n scanf(\"%d\",&n);\n for(i=1;i<=n;i++)\n {\n scanf(\"%d\",&a[i]);\n }\n scanf(\"%d\",&x);\n for(i=1;i<=n;i++)\n {\n if(a[i]==x)\n {\n printf(\"%d\",i);\n return 0;\n }\n }\n \n printf(\"%d isn't present in the array.\",x);\n return 0;\n}", "public void inputSearchText(String searchValue) {\n try {\n clickElement(eleToDoSearchInput, \"click to eleToDoSearchInput\");\n sendKeyTextBox(eleToDoSearchInput, searchValue, \"send key to searchTextToDoListPage\");\n Thread.sleep(smallerTimeOut);\n NXGReports.addStep(\"Ending Input Search.\", LogAs.PASSED, null);\n } catch (Exception e) {\n AbstractService.sStatusCnt++;\n NXGReports.addStep(\"Ending Input Search.\", LogAs.FAILED, new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n }\n }", "public static void searchPhone(Contact[] myContacts, String find)\n {\n int counter = 0;\n System.out.println(\"Find results: \");\n for(int i = 0; i<myContacts.length; i++)\n {\n if(myContacts[i].getPhone().equals(find))\n {\n System.out.println(myContacts[i]);\n counter++;\n }\n }\n if(counter == 0)\n {\n System.out.println(\"There are no listings for \"+find);\n }\n else if(counter == 1)\n {\n System.out.println(\"There was \"+counter+\" listing for \"+find);\n }\n else\n {\n System.out.println(\"There were \"+counter+\" listings for \"+find);\n }\n }", "public void searchItem(String itemnum){\t\r\n\t\tString searchitem = getValue(itemnum);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+searchitem);\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Item should be searched in the search box\");\r\n\t\ttry{\r\n\t\t\t//editSubmit(locator_split(\"txtSearch\"));\r\n\t\t\twaitforElementVisible(locator_split(\"txtSearch\"));\r\n\t\t\tclearWebEdit(locator_split(\"txtSearch\"));\r\n\t\t\tsendKeys(locator_split(\"txtSearch\"), searchitem);\r\n\t\t\tThread.sleep(2000);\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Item is searched in the search box\");\r\n\t\t\tSystem.out.println(\"Search item - \"+searchitem+\" is entered\");\r\n\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Item is not entered in the search box \"+elementProperties.getProperty(\"txtSearch\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtSearch\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t}", "public abstract int search(String[] words, String wordToFind) throws ItemNotFoundException;", "private void selectArrayElement()\n {\n String response = DialogManager.askString(this, \"ask-index\");\n\n if (response != null) {\n try {\n int slot = Integer.parseInt(response);\n // check if within bounds of array\n if (slot >= 0 && slot < obj.getElementCount()) {\n // if its an object set as current object\n if (! obj.getElementType().isPrimitive() && ! obj.getElementObject(slot).isNullObject()) {\n boolean isPublic = getButton.isEnabled();\n InvokerRecord newIr = new ArrayElementInspectorRecord(ir, slot);\n setCurrentObj(obj.getElementObject(slot), \"[\" + slot + \"]\", obj.getElementType().toString());\n inspectorManager.getInspectorInstance(selectedField, selectedFieldName, pkg,\n isPublic ? newIr : null, this);\n }\n else {\n // it is not an object - a primitive, so lets\n // just display it in the array list display\n setButtonsEnabled(false, false);\n //arraySet.add(new Integer(slot));\n // TODO: this is currently broken. Primitive array elements re just\n // not displayed right now. Would need to be added to display list.\n update();\n }\n }\n else { // not within array bounds\n DialogManager.showError(this, \"out-of-bounds\");\n }\n }\n catch (NumberFormatException e) {\n // input could not be parsed, eg. non integer value\n setCurrentObj(null, null, null);\n DialogManager.showError(this, \"cannot-access-element\");\n }\n }\n else {\n // set current object to null to avoid re-inspection of\n // previously selected wildcard\n setCurrentObj(null, null, null);\n }\n }", "public boolean search(int[] A, int target) {\n \n for (int i = 0; i < A.length; i++) {\n if (A[i] == target) {\n return true;\n }\n }\n return false;\n }", "public int showIndex(int userInputElement){\n int i;\n for(i=0; i<sirDeLa1La100.length; i++) {\n if (userInputElement == sirDeLa1La100[i]) {\n return i;\n }\n }\n return -1;\n }", "void search();", "void search();", "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}", "public int search(int key){\n\t\treturn searchUtil(key,0,arr.length-1);\n\t}", "public void actionPerformed(ActionEvent e) {\r\n\t\t\tinstr.setText(\"Click anywhere on the canvas to open the search dialog.\");\r\n\t\t\tdefaultVar(canvas);\r\n\t\t\tJFrame addQuery = new JFrame(\"Find a value\");\r\n\t\t\tString insertPlace = JOptionPane.showInputDialog(addQuery, \"What integer are you looking for?\");\r\n\t\t\tif (insertPlace != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tint index = Integer.valueOf(insertPlace);\r\n\t\t\t\t\tcanvas.arrSearch(index);\r\n\t\t\t\t} catch(NumberFormatException error) {\r\n\t\t\t\t\tJFrame frame2 = new JFrame(\"\");\r\n\t\t\t\t\t// Warning\r\n\t\t\t\t\tJOptionPane.showMessageDialog(frame2,\r\n\t\t\t\t\t\t\t\"Searched value is not a valid number\",\r\n\t\t\t\t\t\t\t\"Input Warning\",\r\n\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "public boolean contains(T value) {\n for (T tmp : arr) {\n if (tmp.equals(value)) {\n return true;\n }\n }\n return false;\n }", "public static void main(String[] args) throws NumberFormatException, IOException {\n\t\tBufferedReader br =new BufferedReader(new InputStreamReader(System.in));\r\n\t\t\r\n\t\tSystem.out.println(\"Enter Number of Elelment in Array: \");\r\n\t\tint sizearr=Integer.parseInt(br.readLine());\r\n\t\t\r\n\t\tSystem.out.println(sizearr);\r\n\t\tSystem.out.println(\"Enter Number : \");\r\n\t\tint num=Integer.parseInt(br.readLine());\r\n\t\tSystem.out.println(\"Enter Number in Array : \");\r\n\t\tint arr []=new int[sizearr];\r\n\t\tfor (int i = 0; i < arr.length; i++) {\r\n\t\t\tarr[i]=Integer.parseInt(br.readLine());\r\n\t\t}\r\n\t\tfor (int i = 0; i < arr.length; i++) {\r\n\t\t\tif(arr[i]== num) {\r\n\t\t\t\tSystem.out.println(\"index\"+i);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static int Find(int[] array, int value) {\r\n\t\tint j = -1;\r\n\t\tfor (int i = 0; i < array.length; i++) {\r\n\t\t\tif (array[i] == value) {\r\n\t\t\t\tj = i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn j;\r\n\t}", "public static void main(String[] args) {\n\t\tint arr[] = {4, 5, 6, 7, 8, 9, 1, 2, 3};\n int n = arr.length;\n int key = 6;\n \n int i = search(arr, 0, n-1, key);\n if (i != -1) \n System.out.println(\"Index: \" + i);\n else\n System.out.println(\"Key not found\");\n\t}", "private void arrayIndex(MyArrayList myArrayList, Results results, int value) {\r\n int index = myArrayList.indexOf(value);\r\n if(index != -1) { \r\n results.storeNewResult(\"ArrayIndex test case: PASSED\");\r\n }\r\n else {\r\n results.storeNewResult(\"ArrayIndex test case: FAILED\");\r\n }\r\n }", "private static int exponentialSearch(int[] inputs, int value) {\n\t\t\n\t\t// find range :- \n\t\t// 1. start with index 0\n\t\tif(inputs[0]==value ) {\n\t\t\treturn 0;\n\t\t}\n\t\t// 2. doubling method\n\t\tint i =1;\n\t\twhile(i<inputs.length && inputs[i] <= value) {\n\t\t\ti = i *2;\n\t\t}\n\t\t// apply binary search on range element\n\t\treturn Arrays.binarySearch(inputs, i/2, Math.min(i,inputs.length), value);\n\t}", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n\n scanner.nextLine();\n int[] numbers = Arrays.stream(scanner.nextLine().split(\" \"))\n .mapToInt(Integer::parseInt).toArray();\n\n for (int i = 0; i < numbers.length; i++) {\n if (binarySearch(numbers, i) == i) {\n System.out.println(true);\n return;\n }\n }\n\n System.out.println(false);\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tScanner scan =new Scanner(System.in);\r\n\t\t\r\n\t\tint size,i=0,temp=0;\r\n\t\t\t\t\r\n\t\t\r\n\t\tSystem.out.println(\"Enter terms\");\r\n\t\tsize=scan.nextInt();\r\n\t\tSystem.out.println(\"Enter input value\");\r\n\t\tString inputValue[] = new String[size];\r\n\t\tfor(i=0;i<size;i++){\r\n\t\t\tinputValue[i] = scan.next();\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"Duplicate value\");\r\n\t\tfor( i=0;i<inputValue.length;i++){\r\n\t\t\tfor(int j=i+1;j<inputValue.length;j++){\r\n\t\t\t\tif(inputValue[i].equals(inputValue[j]))\r\n\t\t\t\t{\r\n\t\t\t\t\tString value=inputValue[j];\r\n\t\t\t\t\tSystem.out.println(\"Duplicate Array is \"+value+\", position\"+i+\",\"+j);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\r\n\t\t}\r\n\r\n\t}", "@Override\n public int find(T t) {\n for(int i = 0; i < arrayList.length; i++) {\n if(t.equals(arrayList[i])) {\n return i;\n }\n }\n return -1;\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Enter size of string array\");\r\n\t\tScanner sc=new Scanner(System.in);\r\n\t\tn=sc.nextInt();\r\n\t\tarr= new String[n];\r\n\t\tSystem.out.println(\"Enter elements of string array\");\r\n\t\t\r\n\t\tfor(int i=0;i<n;i++){\r\n\t\t\tarr[i]=sc.next();\r\n\t\t}\r\n\t\t\r\n\t\tSearchArray s=new SearchArray();\r\n\t\ts.search_array();\r\n\t}", "private void searchRoutine() {\n String s = (String) JOptionPane.showInputDialog(\n this,\n \"Enter the name of the routine:\",\n \"Search\",\n JOptionPane.PLAIN_MESSAGE,\n null, null, null);\n\n if (s != null) {\n try {\n Routine r = collection.search(s);\n list.setSelectedValue(r, true);\n } catch (DoesNotExistException ee) {\n JOptionPane.showMessageDialog(this, \"Routine with given name does not exist.\");\n }\n }\n }", "@Override\n public boolean contains(T item) {\n //iterate through the array and look for the item\n for(int i = 0; i < numItems; i++){\n //if it is found, return true\n if(item.equals(arr[i]))\n return true;\n }\n return false;\n }", "public String[] wordSearch(String word,String[] arrayInput){\n\t\t\r\n\t\tString[] TempArray1 = new String[arrayInput.length];\r\n\t\tString[] TempArray2;\r\n\t\tint count1=0;\r\n\t\tint count2=0;\r\n\t\t\r\n\t\tfor(int i=0;i<arrayInput.length;i++){\r\n\t\t\t//create an array of all the words found in the input array\r\n\t\t\t//*note, this array is the same length as the input, therefore contains NULL values\r\n\t\t\tif(arrayInput[i].toLowerCase().contains(word.toLowerCase())){\r\n\t\t\t\tTempArray1[count1] = arrayInput[i];\r\n\t\t\t\tcount1++;\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t\r\n\t\tif (count1>0){\r\n\t\t\t//1. check to see if anything was found\r\n\t\t\t//2. If found, add all the values found to a correctly sized array\r\n\t\t\t//3.return\r\n\t\t\tTempArray2 = new String[count1];\r\n\t\t\tfor(int i=0;i<arrayInput.length;i++){\r\n\t\t\t\tif(TempArray1[i] != null){\r\n\t\t\t\t\tcount2++;\r\n\t\t\t\t\tTempArray2[count2-1] = TempArray1[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn TempArray2;\r\n\t\t}\r\n\t\telse{\r\n\t\t\t//nothing found, return\r\n\t\t\tTempArray1 = new String[1];\r\n\t\t\tTempArray1[0]=\"Empty\";\r\n\t\t\treturn TempArray1;\r\n\t\t}\r\n\t}", "public void search() {\n }", "public String askArrFilter();", "public boolean arrayContainsChar(char[] arr, char targetValue) {\n for(char s: arr){\n if(s == targetValue) {\n return true;\n }\n }\n return false;\n }", "public static void main(String[] args) {\n \n\t\tSearchInInfiniteArray child =new SearchInInfiniteArray();\n\t\tint arr[]= {3,5,7,9,10,90,100,130,140,160,170};\n\t\t\n\t\tint ans = child.findPos(arr, 100);\n\t\t\n\t\tif(ans == -1)\n\t\t\tSystem.out.println(\"element not found\");\n\t\telse\n\t\t\tSystem.out.println(\"element found at index : \" + ans);\n\t\t\n\t}", "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\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}", "private boolean valueIsInArray(String token, String[] array, boolean ignorecase) {\n boolean retval = false;\n\n if (array != null) {\n if (token != null) {\n for (int x = 0; x < array.length; x++) {\n if (ignorecase) {\n if (token.equalsIgnoreCase(array[x])) {\n retval = true;\n break;\n }\n } else {\n if (token.equals(array[x])) {\n retval = true;\n break;\n }\n }\n }\n } else {\n for (int x = 0; x < array.length; x++) {\n if (array[x] == null) {\n retval = true;\n break;\n }\n }\n }\n } else {\n if (token == null) {\n retval = true;\n } else {\n retval = false;\n }\n }\n return retval;\n }", "public static int search(Student[] student,int studentID){\n for(int i=0;i<student.length;i++){\n if(student[i].getStudentID()==studentID){\n return i;\n } \n }\n return -1;//if there is not student id in array,this result will be -1\n }", "public static void main(String args[])\n\t{\n\t\t// searching data set \n\t\tint[] data = {0,4,7,12,32,44,56,77,89,102,155};\n\t\t\n\t\t// search item\n\t\tint searchItem = 155;\n\t\t\n\t\t// binarySearch( Array , initial-position, max-position , item to be search)\n\t\tint result = binarySearch(data,0,data.length-1,searchItem);\n\t\t\n\t\tif (result == -1)\n\t\t\tSystem.out.println(\"Element not present\");\n\t\telse\n\t\t\tSystem.out.println(\"Element found at index : \" + result);\n\t}", "public int Search(int key)\n {\n for(int i=0; i<n; i++)\n {\n if(a[i]==key)\n return 1;\n }\n return 0;\n }", "public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in, \"UTF-8\");\n\t\tSystem.out.println(\"Enter the number x:\");\n\t\tint x = input.nextInt();\n\t\tint hits = 0;\n\t\t\n\t\t/*\n\t\tint[] array = new int[15];\n\t\t\n\t\tfor(int i = 0; i < array.length; i++){\n\t\t\tarray[i] = i;\n\t\t}\n\t\t*/\n\t\t\n\t\tint[] array = {0,2,5,6,7,3,4,5,23,567,890,545,23,45,56}; \n\t\t\n\t\t\n\t\tfor(int i = 0; i < array.length; i++){\n\t\t\tif (array[i] == x){\n\t\t\t\tSystem.out.print(\"A[\" + i + \"] \");\n\t\t\t\thits++;\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\tSystem.out.println();\n\t\t\n\t\tif (hits != 0){\n\t\t\tSystem.out.println(\"x is present \" + hits + \" time(s) in the array!\");\n\t\t} else {\n\t\t\tSystem.out.println(\"x is not present in the array!\");\n\t\t}\n\n\t}", "public static void Search(ArrayList<Integer> list, int val)\n{\n // Your code here\n int result = -1;\n for(int i=0; i<list.size(); i++)\n {\n if(list.get(i) == val)\n {\n result = i;\n break;\n }\n }\n System.out.print(result + \" \");\n \n}", "public static void main(String[] args) {\n String name[]= {\"Liam\", \"Emma\", \"Noah\", \"Olivia\", \"William\"};\n Scanner input= new Scanner(System.in);\n System.out.println(\" please enter a name: \");\n String user= input.next();\n System.out.println(\" please enter a index number: \");\n int number= input.nextInt();\n for (int i = 0; i < name.length ; i++) {\n if(number==i){\n name[i]=user;\n\n }\n\n }\n System.out.println(Arrays.toString(name));\n }", "private void searchCode() {\n }", "public static void main(String[] args) {\n\t\tint [][] input = {\r\n\t\t\t\t{1,2,3},\r\n\t\t\t\t{4,5,6},\r\n\t\t\t\t{7,8,9}\t\t\t\t\r\n\t\t};\r\n\t\tSystem.out.println(Find(input,13));\r\n\r\n\t}" ]
[ "0.7449326", "0.679125", "0.66145474", "0.6580026", "0.6578243", "0.64844805", "0.64809775", "0.64446235", "0.64007425", "0.63451004", "0.633462", "0.6234016", "0.62269795", "0.6131768", "0.6106405", "0.6070417", "0.60621214", "0.6058776", "0.6046371", "0.60235786", "0.6015892", "0.5968435", "0.5936138", "0.5857506", "0.57963496", "0.57709664", "0.5735027", "0.57290643", "0.5718003", "0.5711595", "0.571052", "0.57100713", "0.57053626", "0.57051915", "0.5690931", "0.5677878", "0.5668646", "0.5666231", "0.5653078", "0.56511927", "0.5639539", "0.5638297", "0.56150395", "0.561239", "0.55663604", "0.555457", "0.5542336", "0.55421203", "0.5515946", "0.5513113", "0.5506062", "0.55024236", "0.54875433", "0.54792404", "0.5478451", "0.54766285", "0.5436473", "0.543575", "0.5430456", "0.5430093", "0.54244554", "0.5421261", "0.5405297", "0.5402016", "0.53953743", "0.5386349", "0.5372838", "0.5356859", "0.5356859", "0.53429615", "0.5341403", "0.5337607", "0.5335245", "0.5329507", "0.532799", "0.53259826", "0.5319006", "0.5307043", "0.5304986", "0.52988267", "0.5290483", "0.52864504", "0.5281971", "0.5281395", "0.5280165", "0.5273406", "0.5271701", "0.5262036", "0.52517986", "0.5249371", "0.52387077", "0.5236694", "0.522983", "0.5228893", "0.522467", "0.5214251", "0.5208515", "0.5204699", "0.5192159", "0.5190265" ]
0.5837823
24
Creating and adding data in arraylist
private ArrayList<String[]> getTableRowData() { int numRow, numCol; ArrayList<String[]> data = new ArrayList<>(); numRow = jtModel.getRowCount(); numCol = jtModel.getColumnCount(); String[] row; for(int i = 0; i< numRow; i++) { row = new String[numCol]; for(int j = 0; j< numCol; j++) { row[j] = jtModel.getValueAt(i, j).toString(); } data.add(row); } return data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addData() {\n Details d1 = new Details(\"Arpitha\", \"+91-9448907664\", \"25/05/1997\");\n Details d2 = new Details(\"Abhijith\", \"+91-993602342\", \"05/10/1992\");\n details.add(d1);\n details.add(d2);\n }", "public void createListData()\n {\n List<SinhVien> listSinhvien=new ArrayList<>();\n for(int i=0;i<10;i++){\n SinhVien sv=new SinhVien(i+\"\",\"123\",\"0123\",i+1.0f);\n listSinhvien.add(sv);\n }\n PresenterImplDangXuat.onLoadSucess(listSinhvien);\n }", "public void setListData() {\n \n for (int i = 0; i < 11; i++) {\n \n final NotificationLogMessage alert = new NotificationLogMessage();\n \n /******* Firstly take data in model object ******/\n alert.setMessageTitle(\"Message Title \"+i);\n alert.setDateAndTime(i+\":00am \"+i+\"/\"+i+\"/\"+\"2014\");\n alert.setMessageBody(\"There are now \" + i + \" messages\");\n \n /******** Take Model Object in ArrayList **********/\n testArr.add( alert );\n }\n \n }", "public void create() {\n String[] arrays = new String[100];\n ArrayList<String> list1 = new ArrayList(); //Object[10]\n list1.size(); //0\n list1.add(\"Vivek\"); //object[0] = \"Vivek\"\n list1.size(); //1\n list1.get(0);//\"Vivek\"\n\n list1.remove(1);\n\n list1.add(0, \"Vivek\");\n\n\n ArrayList<String> list3 = new ArrayList<String>(list1);\n\n ArrayList<Student> list = new ArrayList<Student>();\n\n\n\n }", "private ArrayList<SearchModel> initData() {\n // items in the arraylist\n ArrayList<SearchModel> foodList = new ArrayList<>();\n List<FoodModel> foods = foodModelList;\n for(int i=0; i< foods.size(); i++)\n {\n foodList.add(new SearchModel(foods.get(i).getName()));\n }\n return foodList;\n }", "public ArrayList<Integer> createList(){\r\n \tArrayList<Integer> test = new ArrayList<>();\r\n \tstarLabels = new ArrayList<>();\r\n \tconstLabels = new ArrayList<>();\r\n \tplanetLabels = new ArrayList<>();\r\n \tmesrLabels = new ArrayList<>();\r\n \tmoonLabel = new ArrayList<>();\r\n \t\r\n \tint a = 0;\r\n \tint b = 1;\r\n \tint c = 2;\r\n \tint d = 3;\r\n \t\r\n \tint size;\r\n \t\r\n \t//Go through the spaceobjectlist\r\n \tfor(int i = 0; i < AlexxWork2.spaceObjList.size(); i++) {\r\n \t\t\r\n \t\t//If object is visible and object has positive altitude continue\r\n \t\tif(AlexxWork2.spaceObjList.get(i).getMagnitude() != null \r\n \t\t\t\t&& (Double.valueOf(AlexxWork2.spaceObjList.get(i).getMagnitude()) <= 6.0) \r\n \t\t\t\t&& AlexxWork2.spaceObjList.get(i).getAltitude() > 0.5) {\r\n\t \t\t\r\n \t\t\t\r\n \t\t\t//Calculate X and Y\r\n \t\t\tint x = getX(2250, 2250, 1000, \r\n \t\t\t\t\t(int)AlexxWork2.spaceObjList.get(i).getAzimuth(), \r\n \t\t\t\t\t(int)AlexxWork2.spaceObjList.get(i).getAltitude());\r\n \t\t\t\r\n\t\t\t\tint y = getY(2250, 2250, 1000, \r\n\t\t\t\t\t\t(int)AlexxWork2.spaceObjList.get(i).getAzimuth(), \r\n\t\t\t\t\t\t(int)AlexxWork2.spaceObjList.get(i).getAltitude());\r\n\t\t\t\t\r\n\t\t\t\t//Load stars\r\n\t\t\t\tif(AlexxWork2.spaceObjList.get(i).getType() == \"STAR\" \r\n\t\t\t\t\t\t&& AlexxWork2.spaceObjList.get(i).getProperName() != null \r\n\t\t\t\t\t\t&& AlexxWork2.spaceObjList.get(i).getProperName() != \"\") {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(AlexxWork2.starNamesCB \r\n\t\t\t\t\t\t\t&& Double.valueOf(AlexxWork2.spaceObjList.get(i).getMagnitude()) <= 6.0) {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t//Filter out number only star names\r\n\t\t\t\t\t\t\tint testInt = Integer.parseInt(AlexxWork2.spaceObjList.get(i).getProperName());\r\n\t\t\t\t\t\t\t} catch (NumberFormatException | NullPointerException nfe) {\r\n\t\t\t\t\t\t\t\tstarLabels.add(AlexxWork2.spaceObjList.get(i).getProperName());\r\n\t\t\t\t\t\t\t\tstarLabels.add(String.valueOf(x));\r\n\t\t\t\t\t\t\t\tstarLabels.add(String.valueOf(y));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Load constellation data\r\n\t\t\t\t\tif(herculesNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tString name = AlexxWork2.spaceObjList.get(i).getProperName();\r\n\t\t\t\t\t\tloadHerculesLocation(name, x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(ursaMinorNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tString name = AlexxWork2.spaceObjList.get(i).getProperName();\r\n\t\t\t\t\t\tloadUrsaMinorLocation(name, x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(ursaMajorNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tString name = AlexxWork2.spaceObjList.get(i).getProperName();\r\n\t\t\t\t\t\tloadUrsaMajorLocation(name, x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(libraNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tString name = AlexxWork2.spaceObjList.get(i).getProperName();\r\n\t\t\t\t\t\tloadLibraLocation(name, x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(andromedaNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadAndromedaLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(aquariusNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadAquariusLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(aquilaNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadAquilaLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(ariesNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadAriesLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(aurigaNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadAurigaLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(bootesNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadBootesLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(cancerNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadCancerLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(canisMajorNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadCanisMajorLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(canisMinorNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadCanisMinorLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(capricornusNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadCapricornusLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(cassiopeiaNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadCassiopeiaLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(centaurusNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadCentaurusLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(cepheusNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadCepheusLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(cruxNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadCruxLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(cygnusNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadCygnusLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(dracoNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadDracoLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(geminiNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadGeminiLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(hydraNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadHydraLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(leoNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadLeoLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(lyraNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadLyraLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(orionNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadOrionLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(pegasusNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadPegasusLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(perseusNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadPerseusLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(piscesNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadPiscesLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(sagittariusNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadSagittariusLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(scorpioNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadScorpioLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(taurusNames.contains(AlexxWork2.spaceObjList.get(i).getProperName())) {\r\n\t\t\t\t\t\tloadTaurusLocation(AlexxWork2.spaceObjList.get(i).getProperName(), x, y);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//Add coordinates to list\r\n\t \t\ttest.add(a, x);\r\n\t \t\ttest.add(b, y);\r\n\t \t\t\r\n\t \t\t//Add moon information if visible\r\n\t \t\tif(AlexxWork2.spaceObjList.get(i).getProperName() == \"MOON\") {\r\n size = 22;\r\n String moonName = AlexxWork2.spaceObjList.get(i).getProperName() + \": \" + AlexxWork2.spaceObjList.get(i).getType();\r\n moonLabel.add(0, moonName);\r\n moonLabel.add(1, String.valueOf(x));\r\n moonLabel.add(2, String.valueOf(y));\r\n }\r\n\t \t\t\r\n\t \t\t//If object is planet, set the size\r\n\t \t\telse if(AlexxWork2.spaceObjList.get(i).getType() == \"PLAN\"){\r\n\t \t\t\tsize = 16;\r\n\t \t\t}\r\n\t \t\t\r\n\t \t\t//Else set size based on mag\r\n\t \t\telse{\r\n\t \t\t\tsize = getSize(Double.valueOf(AlexxWork2.spaceObjList.get(i).getMagnitude()));\r\n\t \t\t}\r\n\t \t\t\r\n\t \t\t//Add size to list\r\n\t \t\ttest.add(c, size);\r\n\t \t\ttest.add(d, size);\r\n\t \t\ta = d + 1;\r\n\t \t\tb = a + 1;\r\n\t \t\tc = b + 1;\r\n\t \t\td = c + 1;\r\n \t\t}\r\n \t\t\r\n \t\t//Load constellation labels\r\n \t\tif(AlexxWork2.constellationsCB) {\r\n\t\t\t\tif(AlexxWork2.spaceObjList.get(i).getType() == \"CONST\" \r\n\t\t\t\t\t\t&& AlexxWork2.spaceObjList.get(i).getConstName() != null \r\n\t\t\t\t\t\t&& AlexxWork2.spaceObjList.get(i).getConstName() != \"\"\r\n\t\t\t\t\t\t&& AlexxWork2.spaceObjList.get(i).getAltitude() > 1) {\r\n\t\t\t\t\tint x = getX(2250, 2250, 1000, (int)AlexxWork2.spaceObjList.get(i).getAzimuth(), (int)AlexxWork2.spaceObjList.get(i).getAltitude());\r\n\t\t\t\t\tint y = getY(2250, 2250, 1000, (int)AlexxWork2.spaceObjList.get(i).getAzimuth(), (int)AlexxWork2.spaceObjList.get(i).getAltitude());\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\tconstLabels.add(AlexxWork2.spaceObjList.get(i).getConstName());\r\n\t\t\t\t\tconstLabels.add(String.valueOf(x));\r\n\t\t\t\t\tconstLabels.add(String.valueOf(y));\r\n\t\t\t\t}\r\n\t\t\t}\r\n \t\t\r\n \t\t//Load planet labels\r\n \t\tif(AlexxWork2.planetsCB) {\r\n\t\t\t\tif(AlexxWork2.spaceObjList.get(i).getType() == \"PLAN\" \r\n\t\t\t\t\t\t&& AlexxWork2.spaceObjList.get(i).getProperName() != null \r\n\t\t\t\t\t\t&& AlexxWork2.spaceObjList.get(i).getProperName() != \"\"\r\n\t\t\t\t\t\t&& AlexxWork2.spaceObjList.get(i).getAltitude() > 1) {\r\n\t\t\t\t\tint x = getX(2250, 2250, 1000, (int)AlexxWork2.spaceObjList.get(i).getAzimuth(), (int)AlexxWork2.spaceObjList.get(i).getAltitude());\r\n\t\t\t\t\tint y = getY(2250, 2250, 1000, (int)AlexxWork2.spaceObjList.get(i).getAzimuth(), (int)AlexxWork2.spaceObjList.get(i).getAltitude());\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\tplanetLabels.add(AlexxWork2.spaceObjList.get(i).getProperName());\r\n\t\t\t\t\tplanetLabels.add(String.valueOf(x));\r\n\t\t\t\t\tplanetLabels.add(String.valueOf(y));\r\n\t\t\t\t}\r\n\t\t\t}\r\n \t\t\r\n \t\t//Load messier labels\r\n \t\tif(AlexxWork2.messierCB) {\r\n\t\t\t\tif(AlexxWork2.spaceObjList.get(i).getType() == \"MESR\" \r\n\t\t\t\t\t\t&& AlexxWork2.spaceObjList.get(i).getProperName() != null \r\n\t\t\t\t\t\t&& AlexxWork2.spaceObjList.get(i).getProperName() != \"\"\r\n\t\t\t\t\t\t&& AlexxWork2.spaceObjList.get(i).getAltitude() > 1) {\r\n\t\t\t\t\tint x = getX(2250, 2250, 1000, (int)AlexxWork2.spaceObjList.get(i).getAzimuth(), (int)AlexxWork2.spaceObjList.get(i).getAltitude());\r\n\t\t\t\t\tint y = getY(2250, 2250, 1000, (int)AlexxWork2.spaceObjList.get(i).getAzimuth(), (int)AlexxWork2.spaceObjList.get(i).getAltitude());\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\tmesrLabels.add(AlexxWork2.spaceObjList.get(i).getProperName());\r\n\t\t\t\t\tmesrLabels.add(String.valueOf(x));\r\n\t\t\t\t\tmesrLabels.add(String.valueOf(y));\r\n\t\t\t\t}\r\n\t\t\t}\r\n \t}\r\n \t\r\n \t//Return list \r\n \treturn test;\r\n }", "public void addDatatoArrayList(ArrayList<Object> ar1) {\n\t\tar1.add(1);\n\t\tar1.add(\"anu\");\n\t\tar1.add(1.3);\n\t\tar1.add(true);\n\t\tar1.add('&');\n\t\tar1.add(false);\n\t\tSystem.out.println(\"Data aaded to ArrayList\");\n\t}", "public void addListDataToDB() {\n\n for (int i = 1; i < 10; i++) {\n TimerDisplay timer = new TimerDisplay();\n timer.setCurrentDate(\"Jan 0\" + i + \" 2017 00:00\");\n timer.setEndDate(\"Jan 0\" + (i + 2) + \" 2017 00:00\");\n timer.setPercentage();\n\n databaseHelper.addDate(timer);\n //listTimers.add(timer);\n }\n }", "void addData();", "private ArrayList<Record> getItemsToAdd() {\r\n\t\tArrayList<Record> list = new ArrayList<Record>();\r\n\r\n\t\tlist = myConn.populateRecords();\r\n\t\t//myConn.connectionClose();\r\n\r\n\t\treturn list;\r\n\t}", "DataList createDataList();", "private List<Integer> createData() {\r\n\t\tList<Integer> data = new ArrayList<Integer>();\r\n\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\tdata.add(i);\r\n\t\t}\r\n\t\treturn data;\r\n\t}", "public void add(){\n //Declare an ArrayList which contains string objects\n \n ArrayList<Employee> employeesList = new ArrayList<Employee>();\n \n Employee emp = new Employee();\n emp.setName(\"Marc\");\n emp.setSalary_complement(100);\n \n emp.setName(\"Paco\");\n emp.setSalary_complement(120);\n \n emp.setName(\"David\");\n emp.setSalary_complement(400);\n \n emp.setName(\"Albert\");\n emp.setSalary_complement(110);\n \n emp.setName(\"Javi\");\n emp.setSalary_complement(20);\n \n emp.setName(\"Jose\");\n emp.setSalary_complement(170);\n \n emp.setName(\"Raul\");\n emp.setSalary_complement(101);\n \n emp.setName(\"Enric\");\n emp.setSalary_complement(80);\n \n emp.setName(\"Javier\");\n emp.setSalary_complement(10);\n \n emp.setName(\"Daniel\");\n emp.setSalary_complement(120);\n \n \n employeesList.add(emp);\n /* \n ArrayList<String> employeesList = new ArrayList<>();\n employeesList.add(200,\"Marc\") ArrayList<Employee> employeesList = new ArrayList<Employee>();\n ;\n employeesList.add(250,\"Cristian\");\n employeesList.add(100,\"Paco\");\n employeesList.add(400,\"Roberto\");\n */\n }", "@SuppressWarnings(\"unchecked\")\n\tprotected void grow(){\n\t\t// makes new arraylist\n\t\tT[] temp = (T[]) new Object[data.length *2];\n\t\tfor(int i = 0; i < data.length; i++ ){\n\t\t\ttemp[i] = data[i];\n\t\t}\n\t\tdata = temp;\n\t}", "private void addToArrayList(String getName) {\n\t\tUser newUser = new User(getName);\n\t\tmgUsr.arrList.add(newUser);\n\t\tobs = FXCollections.observableArrayList(mgUsr.arrList);\n\n\t\tsetOnListView();\n\t}", "public void initArrayList()\n {\n\tSQLiteDatabase db = getWritableDatabase();\n\tCursor cursor = db.rawQuery(\"SELECT * FROM \" + TABLE_NAME, null);\n\n\tif (cursor.moveToFirst())\n\t{\n\t do\n\t {\n\t\tJacocDBLocation newLocation = new JacocDBLocation();\n\t\tnewLocation.setLocationName(cursor.getString(1));\n\t\tnewLocation.setRealLocation(new LocationBorder(new LatLng(cursor.getDouble(2), cursor.getDouble(3)), new LatLng(cursor.getDouble(4), cursor.getDouble(5))));\n\t\tnewLocation.setMapLocation(new LocationBorder(new LatLng(cursor.getInt(6), cursor.getInt(7)), new LatLng(cursor.getInt(8), cursor.getInt(9))));\n\t\tnewLocation.setHighSpectrumRange(cursor.getDouble(10));\n\t\tnewLocation.setLowSpectrumRange(cursor.getDouble(11));\n\n\t\t// adding the new Location to the collection\n\t\tlocationList.add(newLocation);\n\t }\n\t while (cursor.moveToNext()); // move to the next row in the DB\n\n\t}\n\tcursor.close();\n\tdb.close();\n }", "public void AddDataToTILData(){\n ArrayList<ArrayList<Double>> TILList = ReturnTILList();\n System.out.println(\"\\nAdding Data:\");\n DisplayTimeInLevelList(TILList);\n //first, get the average for each level and add them to an arraylist\n ArrayList<Double> LeveltimeAvg = new ArrayList<Double>();\n \n System.out.println(\"Leveltime average, size \"+TILList.size());\n for(ArrayList<Double> tl : TILList){ // tl for time list\n LeveltimeAvg.add(Mean(tl));\n System.out.println(Mean(tl));\n }\n System.out.println(\"critpoints:\");\n for(Long p: TILData.critpoints){\n System.out.println(\"\"+p);\n }\n \n //then write a new line using the subject's id, avg's, and crit_points\n TILData.AddSubjectData(Subject_ID,LeveltimeAvg,TILData.critpoints);\n \n }", "public ArrayList<CategoryData> addData(){\n return databaseManager.retrieveInfo();\n }", "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}", "public void createNewHouseAndAddToList(){\n\t\t\tHouse newHouse = new House();\r\n\t\t\tString id = createAutomaticallyID().trim();\r\n\t\t\tnewHouse.setId(id);\r\n\t\t\tnewHouse.setPrice(Double.parseDouble(priceTextField.getText().trim()));\r\n\t\t\tnewHouse.setNumberOfBathrooms(Integer.parseInt(bathroomsTextField.getText().trim()));\r\n\t\t\tnewHouse.setAirConditionerFeature(airConditionerComboBox.getSelectedItem().toString());\r\n\t\t\tnewHouse.setNumberOfRooms(Integer.parseInt(roomsTextField.getText().trim()));\r\n\t\t\tnewHouse.setSize(Double.parseDouble(sizeTextField.getText().trim()));\r\n\t\t\t\r\n\t\t\toriginalHouseList.add(newHouse);//first adding newHouse to arrayList\r\n\t\t\tcopyEstateAgent.setHouseList(originalHouseList);//then set new arrayList in copyEstateAgent\r\n\r\n\t\t}", "public void readdata(ArrayList<AddData> daftar){\n Cursor crsr = this.getReadableDatabase().rawQuery(\"select todo, description, priority from \"+nama_tabel, null);\n while (crsr.moveToNext()){\n daftar.add(new AddData(crsr.getString(0), crsr.getString(1), crsr.getString(2)));\n }\n }", "@SuppressWarnings(\"unchecked\")\r\n public void createList() {\r\n items = new int[MAX_LIST];\r\n NumItems = 0;\r\n }", "public MyArrayList() {\n data = new Object[10];\n }", "private ArrayList<Item> getData() { // generates an array containing 3 Item class objects\n\n // cost\n String[] cost = getResources().getStringArray(R.array.elvCostItems);\n Item i1=new Item(cost[0], new ArrayList<>(Collections.singletonList(cost[5])),false); // Define an Item object call i1\n i1.elements.add(cost[1]); // child elements below\n i1.elements.add(cost[2]);\n i1.elements.add(cost[3]);\n i1.elements.add(cost[4]);\n i1.elements.add(cost[5]);\n i1.elements.add(cost[6]);\n\n // activity or event\n String[] category = getResources().getStringArray(R.array.elvCategoryItems);\n Item i2=new Item(category[0], new ArrayList<>(Arrays.asList(category[1],category[2])),true); // Item.Option is set by the arg1 and default selection is set by arg 2\n i2.elements.add(category[1]);\n i2.elements.add(category[2]);\n\n // city\n String[] location = getResources().getStringArray(R.array.elvLocationItems);\n Item i4=new Item(location[0],new ArrayList<>(Collections.singletonList(location[1])),false);\n i4.elements.add(location[1]);\n\n // distance away\n String[] distance = getResources().getStringArray(R.array.elvDistanceItems);\n Item i5=new Item(distance[0],new ArrayList<>(Collections.singletonList(distance[4])),false);\n i5.elements.add(distance[1]);\n i5.elements.add(distance[2]);\n i5.elements.add(distance[3]);\n i5.elements.add(distance[4]);\n i5.elements.add(distance[5]);\n\n // other - disabled access, indoors, etc\n String[] other = getResources().getStringArray(R.array.elvOtherItems);\n ArrayList<String> temp = new ArrayList<>();\n Item i6=new Item(other[0], temp,true);\n i6.elements.add(other[1]);\n i6.elements.add(other[2]);\n i6.elements.add(other[3]);\n i6.elements.add(other[4]);\n i6.elements.add(other[5]);\n i6.elements.add(other[6]);\n\n // add items to the elv\n ArrayList<Item> allItems=new ArrayList<>(); // append all Item objects into an ArrayList\n allItems.add(i1);\n allItems.add(i2);\n allItems.add(i4);\n allItems.add(i5);\n allItems.add(i6);\n\n return allItems;\n }", "private ArrayList<BibleStudy> CreateBibleStudyList() {\n\n // Create a list with a capacity of 3\n ArrayList<BibleStudy> bibleStudyList = new ArrayList<>(3);\n\n // Create new items with information filled out for each item\n BibleStudy bibleStudy = new BibleStudy();\n bibleStudy.setLanguage(Language.Romanian);\n bibleStudy.setLogoId(R.drawable.bible_study_1);\n bibleStudy.setTitleRo(getString(R.string.bible_study_1_name));\n bibleStudy.setTitleRu(\"Господь, я хочу знать Тебя\");\n bibleStudy.setTitleEn(\"Lord, I Want To Know You\");\n bibleStudy.setDescriptionRo(getString(R.string.bible_study_1_description));\n bibleStudy.setPhone(getString(R.string.bible_study_1_phone));\n bibleStudy.setWebAddress(getString(R.string.bible_study_1_webaddress));\n bibleStudy.setEmail(getString(R.string.bible_study_1_email));\n bibleStudy.setLocation(getString(R.string.bible_study_1_location));\n bibleStudyList.add(bibleStudy);\n\n bibleStudy = new BibleStudy();\n bibleStudy.setLanguage(Language.Romanian);\n bibleStudy.setLogoId(R.drawable.bible_study_2);\n bibleStudy.setDescriptionRo(getString(R.string.bible_study_2_description));\n bibleStudy.setTitleRo(getString(R.string.bible_study_2_name));\n bibleStudy.setTitleRu(\"Небеса, ад и жизнь после смерти\");\n bibleStudy.setPhone(getString(R.string.bible_study_2_phone));\n bibleStudy.setWebAddress(getString(R.string.bible_study_2_webaddress));\n bibleStudy.setEmail(getString(R.string.bible_study_2_email));\n bibleStudy.setLocation(getString(R.string.bible_study_2_location));\n bibleStudyList.add(bibleStudy);\n\n bibleStudy = new BibleStudy();\n bibleStudy.setLanguage(Language.Romanian);\n bibleStudy.setLogoId(R.drawable.bible_study_3);\n bibleStudy.setDescriptionRo(getString(R.string.bible_study_3_description));\n bibleStudy.setTitleRo(getString(R.string.bible_study_3_name));\n bibleStudy.setPhone(getString(R.string.bible_study_3_phone));\n bibleStudy.setWebAddress(getString(R.string.bible_study_3_webaddress));\n bibleStudy.setEmail(getString(R.string.bible_study_3_email));\n bibleStudy.setLocation(getString(R.string.bible_study_3_location));\n bibleStudyList.add(bibleStudy);\n\n return bibleStudyList;\n }", "private void filllist() {\n mAlLocationBox.clear();\n DatabaseHandler databaseHandler=new DatabaseHandler(this);\n ArrayList<ArrayList<Object>> data = databaseHandler.listIitems();\n\n for (int p = 0; p < data.size(); p++) {\n mLocationBox = new LocationBox();\n ArrayList<Object> temp = data.get(p);\n Log.e(\"List\", temp.get(0).toString());\n Log.e(\"List\", temp.get(1).toString());\n Log.e(\"List\", temp.get(2).toString());\n Log.e(\"List\", temp.get(3).toString());\n mLocationBox.setId(Integer.valueOf(temp.get(0).toString()));\n mLocationBox.setName(temp.get(1).toString());\n mLocationBox.setMode(temp.get(2).toString());\n mLocationBox.setStatus(temp.get(3).toString());\n mAlLocationBox.add(mLocationBox);\n }\n LocationBoxAdapter locationBoxAdapter = new LocationBoxAdapter(LocationBoxListActivity.this,mAlLocationBox);\n listcontent.setAdapter(locationBoxAdapter);\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 }", "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 }", "private static void storeData()\n {\n listItems = new String[ITEMS.size()];\n int i = 0;\n\n for (SalesOrder element : ITEMS)\n {\n //Store SalesOrder objects in a HashMap\n ITEM_MAP.put(element.getSalesOrderId(), element);\n\n //Store SalesOrderID in a String array\n listItems[i] = element.getSalesOrderId();\n i++;\n }\n //logItems();\n Log.i(TAG, String.format(\"Stored %d items in HashMap\", i));\n\n }", "private void LoopData() {\n\t\tfor (int i = 0; i < drawable.length; i++) {\n\t\t\titems_list items_list = new items_list();\n\t\t\titems_list.setDrawable(getResources().getDrawable(drawable[i]));\n\t\t\titems_list.setLek(string[i]);\n\t\t\tlists.add(items_list);\n\t\t}\n\n\t}", "public void bulkAdd(){\n employees.add(new Employee(23.0, 15000.0, \"Shayan\"));\n employees.add(new Employee(22.0, 60000.0, \"Rishabh\"));\n employees.add(new Employee(23.0, 45000.0, \"Ammar\"));\n employees.add(new Employee(25.0, 30000.0, \"Fahad\"));\n employees.add(new Employee(21.0, 50000.0, \"Ankur\"));\n }", "private void createClinicList(){\n\n ArrayList<Clinic> clinics = LogIn.clinicDAO.getAllClinics();\n for(Clinic cn : clinics){\n double avgRating = LogIn.rateDAO.getAvgRating(cn.getClinicID());\n clinicList.add(new ClinicItem(cn.getClinicName(), drawable.clinic_logo, \"Singapore\", Double.toString(avgRating)));\n }\n }", "private void prepareListData() {\n mCategoryList = new ArrayList<>();\n mFullList = new ArrayList<>();\n for (Category cat : fileSystem.getLocalInformationList())\n {\n List<Object> phraseList = cat.phraseList;\n mCategoryList.add(new Category(phraseList, cat.name));\n }\n mFullList.addAll(mCategoryList);\n\n }", "private void CreateStudentList() {\r\n\t\tStudentList=new ArrayList<Student>();\t\r\n}", "private synchronized void addResultToMultiList() {\n\t addObjectToMultiList(resultArrayList);\r\n\t }", "void addAll(List<News> data) {\n\t\t// Traverse the data list to add news item to the adapter's data set\n\t\tfor (int i = 0; i < data.size(); i++) {\n\t\t\t// Get the book at current index\n\t\t\tNews newsStory = data.get(i);\n\t\t\t// Add the book to the data set\n\t\t\tmNewsList.add(newsStory);\n\n\t\t\t// Notify the adapter of the change in the data set\n\t\t\t// so that it repopulates the view with the updated data set\n\t\t\tnotifyDataSetChanged();\n\t\t}\n\t}", "private void populateData() {\n\t\tList<TrafficRecord> l = TestHelper.getSampleData();\r\n\t\tfor(TrafficRecord tr: l){\r\n\t\t\tput(tr);\r\n\t\t}\r\n\t\t \r\n\t}", "@Override\n\tpublic void addDataItem(FinanceData newdata) {\n\t\tlist_fr.add(0, newdata);\n\t}", "@Override\n public ArrayList<String> Crear(){\n setVida(3500);\n Creado.add(0, Integer.toString(getVida()));\n Creado.add(1,\"150\");\n Creado.add(2,\"100\");\n Creado.add(3,\"70\");\n return Creado;\n }", "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 }", "testarray() {\r\n \tarrayList = new Arraylist();\t\r\n\t}", "public void populateList()\r\n {\n Cursor c = sqLiteDatabase.query(Company_constant.TABLE_NAME, null, null, null, null, null, null);\r\n if (c != null && c.moveToFirst()) {\r\n do {\r\n\r\n int id = c.getInt(c.getColumnIndex(Company_constant.COL_ID));\r\n String name = c.getString(c.getColumnIndex(Company_constant.COL_NAME));\r\n int sal = c.getInt(c.getColumnIndex(Company_constant.COL_SALARY));\r\n // sb.append(id + \"\" + name + \"\" + sal + \"\");\r\n cp=new Company(name,id,sal);\r\n companylist.add(cp);\r\n\r\n\r\n }\r\n\r\n while (c.moveToNext());\r\n }\r\n // Toast.makeText(this, \"\" + sb.toString(), Toast.LENGTH_LONG).show();\r\n ArrayAdapter<Company>ad=new ArrayAdapter<Company>(this,android.R.layout.simple_list_item_1,companylist);\r\n listData.setAdapter(ad);\r\n c.close();\r\n }", "private void loadData() {\n this.financeDataList = new ArrayList<>();\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 }", "public static void initializeData() {\n\t\tList list;\n\t\tint i;\n\t\tList data = new ArrayList<>();\n\t\tString filename = \".\\\\data\\\\ticketType.dat\";\n\t\t\n\t\tMovieType movieType;\n\t\tCinemaClass cinemaClass;\n\t\tMovieGoerGroup[] movieGoerGroupL;\n\t\tString[] dayOfWeekL;\n\t\tString[] isPublicHolidayL;\n\t\tdouble price;\n\t\tTicketType ticketType, temp;\n\t\t\n\t\t//Type 1\n\t\tmovieType = MovieType.REG;\n\t\tcinemaClass = CinemaClass.REG;\n\t\tmovieGoerGroupL = new MovieGoerGroup[] {MovieGoerGroup.SENIOR};\n\t\tdayOfWeekL = new String[] {\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\"};\n\t\tisPublicHolidayL = new String[] {\"false\"};\n\t\tprice = 5;\n\t\tticketType = new TicketType(movieType,cinemaClass,movieGoerGroupL,dayOfWeekL,isPublicHolidayL,price);\n\t\tdata.add(ticketType);\n\t\t\n\t\t//Type 2\n\t\tmovieType = MovieType.REG;\n\t\tcinemaClass = CinemaClass.REG;\n\t\tmovieGoerGroupL = new MovieGoerGroup[] {MovieGoerGroup.STUDENT};\n\t\tdayOfWeekL = new String[] {\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\"};\n\t\tisPublicHolidayL = new String[] {\"false\"};\n\t\tprice = 7;\n\t\tticketType = new TicketType(movieType,cinemaClass,movieGoerGroupL,dayOfWeekL,isPublicHolidayL,price);\n\t\tdata.add(ticketType);\n\t\t\n\t\t//Type 3\n\t\tmovieType = MovieType.REG;\n\t\tcinemaClass = CinemaClass.REG;\n\t\tmovieGoerGroupL = new MovieGoerGroup[] {MovieGoerGroup.ADULT};\n\t\tdayOfWeekL = new String[] {\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\"};\n\t\tisPublicHolidayL = new String[] {\"false\"};\n\t\tprice = 9;\n\t\tticketType = new TicketType(movieType,cinemaClass,movieGoerGroupL,dayOfWeekL,isPublicHolidayL,price);\n\t\tdata.add(ticketType);\n\t\t\n\t\t//Type 4: Sat, Sun \n\t\tmovieType = MovieType.REG;\n\t\tcinemaClass = CinemaClass.REG;\n\t\tmovieGoerGroupL = new MovieGoerGroup[] {MovieGoerGroup.STUDENT, MovieGoerGroup.ADULT, MovieGoerGroup.SENIOR};\n\t\tdayOfWeekL = new String[] {\"Sat\", \"Sun\"};\n\t\tisPublicHolidayL = new String[] {\"false\"};\n\t\tprice = 13;\n\t\tticketType = new TicketType(movieType,cinemaClass,movieGoerGroupL,dayOfWeekL,isPublicHolidayL,price);\n\t\tdata.add(ticketType);\n\t\t\n\t\t//Type 5: public holiday \n\t\tmovieType = MovieType.REG;\n\t\tcinemaClass = CinemaClass.REG;\n\t\tmovieGoerGroupL = new MovieGoerGroup[] {MovieGoerGroup.STUDENT, MovieGoerGroup.ADULT, MovieGoerGroup.SENIOR};\n\t\tdayOfWeekL = new String[] {\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"};\n\t\tisPublicHolidayL = new String[] {\"true\"}; //public holiday\n\t\tprice = 13;\n\t\tticketType = new TicketType(movieType,cinemaClass,movieGoerGroupL,dayOfWeekL,isPublicHolidayL,price);\n\t\tdata.add(ticketType);\n\t\t\n\t\t//Type 6: Atmos cinemaType\n\t\tmovieType = MovieType.REG;\n\t\tcinemaClass = CinemaClass.ATMOS;\n\t\tmovieGoerGroupL = new MovieGoerGroup[] {MovieGoerGroup.STUDENT, MovieGoerGroup.ADULT, MovieGoerGroup.SENIOR};\n\t\tdayOfWeekL = new String[] {\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"};\n\t\tisPublicHolidayL = new String[] {\"true\", \"false\"}; \n\t\tprice = 14;\n\t\tticketType = new TicketType(movieType,cinemaClass,movieGoerGroupL,dayOfWeekL,isPublicHolidayL,price);\n\t\tdata.add(ticketType);\n\t\t\n\t\t//Type 7: Platinum cinemaType\n\t\tmovieType = MovieType.REG;\n\t\tcinemaClass = CinemaClass.PLATINUM;\n\t\tmovieGoerGroupL = new MovieGoerGroup[] {MovieGoerGroup.STUDENT, MovieGoerGroup.ADULT, MovieGoerGroup.SENIOR};\n\t\tdayOfWeekL = new String[] {\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"};\n\t\tisPublicHolidayL = new String[] {\"true\", \"false\"}; \n\t\tprice = 28;\n\t\tticketType = new TicketType(movieType,cinemaClass,movieGoerGroupL,dayOfWeekL,isPublicHolidayL,price);\n\t\tdata.add(ticketType);\n\t\t\n\t\t//3D movie: price + 2\n\t\tfor(i = 0 ; i < 7 ; i++) {\n\t\t\ttemp = (TicketType) data.get(i);\n\t\t\tticketType = new TicketType(MovieType._3D, temp.getCinemaClass(), temp.getMovieGoerGroupL(),\n\t\t\t\t\t\t\t\t\t\ttemp.getDayOfWeekL(), temp.getIsPublicHolidayL(), temp.getPrice() + 2);\n\t\t\tdata.add(ticketType);\n\t\t}\n\t\t\n\t\t//Blockbuster movie: price + 1\n\t\tfor(i = 0 ; i < 7 ; i++) {\n\t\t\ttemp = (TicketType) data.get(i);\n\t\t\tticketType = new TicketType(MovieType.BLOCKBUSTER, temp.getCinemaClass(), temp.getMovieGoerGroupL(),\n\t\t\t\t\t\t\t\t\t\ttemp.getDayOfWeekL(), temp.getIsPublicHolidayL(), temp.getPrice() + 2);\n\t\t\tdata.add(ticketType);\n\t\t}\n\t\t\n\t\tSerializeDB.writeSerializedObject(filename, data); //Write data\n\t}", "private void fillTrackingList(String [] dataEntry){\n\n boolean check = true;\n double longtitude;\n double latitude;\n double altitude;\n double speed;\n\n for (String entry: dataEntry) {\n String [] entryValues = entry.split(\",\");\n\n // Needed to kick out a null Value\n if(check){\n String [] str = entryValues[0].split(\"null\");\n Log.d(\"CheckValue\",str[1]);\n longtitude = Double.parseDouble(str[1]);\n }else{\n longtitude = Double.parseDouble(entryValues[0]);\n }\n\n // Rest of the data is parsed\n latitude = Double.parseDouble(entryValues[1]);\n altitude = Double.parseDouble(entryValues[2]);\n speed = Double.parseDouble(entryValues[3]);\n\n // Adds Entry to the List\n TrackingEntry trackingEntry = new TrackingEntry(longtitude,latitude,altitude,speed);\n trackingList.add(trackingEntry);\n Log.d(\"CheckValue\",entryValues[0]);\n Log.d(\"lines\",\"Added: \"+trackingEntry.toString());\n\n check = false;\n }\n }", "public void addDataFromDBToList(ArrayList<SingleParty> partiesList){\n SingleParty p=new SingleParty();\n partiesList.add(p);\n partiesList.add(p);\n partiesList.add(p);\n partiesList.add(p);\n partiesList.add(p);\n partiesList.add(p);\n\n }", "public MyArrayList() {\n this.IntList = new int[10];\n this.CharList = new Character[10];\n this.StringList = new String[5];\n \n // fill all 3 arrays with data\n for(int i = 0; i < IntList.length; i++) {\n IntList[i] = (int) (Math.random()*52);\n }\n\t \n // Populate char array\n for(int i = 0; i < CharList.length; i++) {\n \n Random random = new Random();\n CharList[i] = (char)(random.nextInt(26) + 'a');\n }\n\t \n // Populate String array\n StringList[0] = \"joe\";\n StringList[1] = \"mark\";\n StringList[2] = \"abbey\";\n StringList[3] = \"tony\";\n StringList[4] = \"kevin\"; \n }", "@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 initializeData() {\n String[] sportsList = getResources().getStringArray(R.array.track_title);\n String[] sportsInfo = getResources().getStringArray(R.array.track_category);\n\n // Clear the existing data (to avoid duplication).\n mSportsData.clear();\n\n TypedArray trackImageResources =\n getResources().obtainTypedArray(R.array.track_image);\n\n // Create the ArrayList of Sports objects with titles and\n // information about each sport.\n for (int i = 0; i < sportsList.length; i++) {\n for (int j = 0; j < workout.size(); j++) {\n if (workout.get(j).equals(sportsList[i])) {\n mSportsData.add(new Track(sportsList[i], sportsInfo[i], trackImageResources.getResourceId(i, 0)));\n }\n }\n }\n\n // Notify the adapter of the change.\n mAdapter.notifyDataSetChanged();\n\n trackImageResources.recycle();\n }", "public void addToList() {\n loadClubList();\n\n Intent intent = getIntent();\n String name = intent.getStringExtra(AddClub.NAME);\n String description = intent.getStringExtra(AddClub.DESCRIPTION);\n int image = intent.getIntExtra(AddClub.IMAGE, 0);\n\n if (name != null & description != null & image != 0) {\n clubList.add(new Club(name, description, image));\n }\n\n saveClubList();\n }", "public void creatList()\n\t{\n\t\tbowlers.add(new Bowler(\"A\",44));\n\t\tbowlers.add(new Bowler(\"B\",25));\n\t\tbowlers.add(new Bowler(\"C\",2));\n\t\tbowlers.add(new Bowler(\"D\",10));\n\t\tbowlers.add(new Bowler(\"E\",6));\n\t}", "private void createList(DataSnapshot dataSnapshot) {\n if (daList.isEmpty()) {\n Item item = dataSnapshot.getValue(LostItem.class);\n daList.add(item);\n adapter.notifyDataSetChanged();\n } else {\n Item item = dataSnapshot.getValue(LostItem.class);\n daList.add(item);\n adapter.notifyDataSetChanged();\n }\n }", "private void addMockData() {\n League league1 = new League(\"1\", \"Premier League\");\n League league2 = new League(\"2\", \"La Liga\");\n League league3 = new League(\"3\", \"Bundesliga\");\n\n leagueList.add(league1);\n leagueList.add(league2);\n leagueList.add(league3);\n }", "public ArrayListAddressBookDataStore() {\n dataStore = new ArrayList<Person>();\n }", "public ArrayList<Item> createItemList() {\n return itemLines\n .stream()\n .map(this::writeLineItemNumber)\n .map(this::createItem)\n .collect(Collectors.toCollection(ArrayList::new));\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 }", "@Override\r\n\tpublic void fill(ArrayList<T> list) {\r\n\t\t//Copy of list\r\n\t\tArrayList<T> copyData = list;\r\n\t\t// Add copy of list to the Stack\r\n\t\tfor (T e: copyData) {\r\n\t\t\tdata.add(e);\r\n\t\t}\r\n\t}", "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 }", "public MyArrayList(int length) {\n data = new Object[length];\n }", "private void prepareArrayLits(){\t\n\t\tprogressDialog_1 = ProgressDialog.show(SlyThemesActivity.this, \"\",Constants.PROCESSING_REQUEST);\n\n\t\tadapter = new ListViewNewRestaurantAdapter(this, itemList);\n\t\tlistview.setAdapter(adapter);\n\t\tprogressDialog_1.dismiss();\n\t}", "public void AddToArray(Balanza mimaterial) {\n this.list.add(mimaterial);\n\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}", "public void addIngredientRecipe(ArrayList<IngredientRecipePOJO> ingr);", "private void initializeData() {\n String[] storeTitles = getResources().getStringArray(R.array.store_titles);\n String[] storeDescriptions = getResources().getStringArray(R.array.store_descriptions);\n TypedArray storeImages = getResources().obtainTypedArray(R.array.stores_images);\n\n //Clear existing data to avoid duplication\n storeData.clear();\n\n //Create an array list of dessert recipes with title, description and images\n for(int i = 0; i < storeTitles.length; i++){\n storeData.add(new Store(storeImages.getResourceId(i,0), storeTitles[i],storeDescriptions[i]));\n }\n\n //Clear up data in the typed array\n storeImages.recycle();\n\n //Notify the adapter of the change in the data set\n storeAdapter.notifyDataSetChanged();\n }", "public synchronized void addItem(ArrayList<Start.Ingredients> obj) {\r\n\t\t// Only add if the table is empty\r\n\t\twhile (!empty && count < 20) {\r\n\t\t\ttry {\r\n\t\t\t\twait();\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (count >= 20) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Set the contents and notifyAll()\r\n\t\tcontents = obj;\r\n\t\tempty = false;\r\n\t\tnotifyAll();\r\n\r\n\t}", "public void initializeList() {\n listitems.clear();\n int medicationsSize = Medications.length;\n for(int i =0;i<medicationsSize;i++){\n Medication Med = new Medication(Medications[i]);\n listitems.add(Med);\n }\n\n }", "private void insertLatestData() {\n String[] names = new String[feedbacks.size()];\n String[] ratings = new String[feedbacks.size()];\n String[] reviews = new String[feedbacks.size()];\n for (int i = 0; i < feedbacks.size(); i++) {\n names[i] = \"Name: \" + feedbacks.get(i).getName();\n ratings[i] = \"Rating: \" + feedbacks.get(i).getRatingBar();\n reviews[i] = \"Review: \" + feedbacks.get(i).getReview();\n }\n feedbackListAdapter = new FeedbackListAdapter(ViewPsmFeedbackActivity.this, names, ratings, reviews);\n listFeedback.setAdapter(feedbackListAdapter);\n }", "private void addData(){\n\n for (Recipe obj : frecipes)\n {\n /** Create a TableRow dynamically **/\n tr = new TableRow(this);\n tr.setLayoutParams(new TableRow.LayoutParams(\n TableRow.LayoutParams.MATCH_PARENT,\n TableRow.LayoutParams.WRAP_CONTENT));\n\n /** Creating a TextView to add to the row **/\n name = new TextView(this);\n name.setText(obj.getName());\n name.setWidth(320);\n name.setTypeface(Typeface.DEFAULT, Typeface.NORMAL);\n name.setPadding(5, 5, 5, 5);\n tr.addView(name); // Adding textView to tablerow.\n\n // Add the TableRow to the TableLayout\n tl.addView(tr, new TableLayout.LayoutParams(\n TableRow.LayoutParams.MATCH_PARENT,\n TableRow.LayoutParams.WRAP_CONTENT));\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 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 boolean addList(ArrayList<Npcinfo> NpcinfoList);", "private void prepareAlbums() {\n\n Album a;\n\n for(HashMap.Entry<String,ArrayList<String>> entry : Test.subcatList.get(name).entrySet()){\n key = entry.getKey();\n value = entry.getValue();\n a = new Album(key , value.get(2));\n albumList.add(a);\n System.out.println(\"dddd : \" + key + \" \" + value.get(2));\n }\n\n adapter.notifyDataSetChanged();\n\n }", "void populate() {\n daftarNotifikasi.add(new DaftarNotifikasi(\"Ludfi Ika P\", \"Hari ini mau gathering dimana?\", 2, R.drawable.profil_2));\n daftarNotifikasi.add(new DaftarNotifikasi(\"Erinda\", \"Ada pagelaran di kota\", 6, R.drawable.profil_3));\n daftarNotifikasi.add(new DaftarNotifikasi(\"Aleq\", \"Saya punya solusi untuk itu\", 10, R.drawable.profil_1));\n }", "private ArrayList<Alimento> initLista() {\n try {\n File file = new File(\"C:\\\\Users\\\\Gabri\\\\OneDrive\\\\Ambiente de Trabalho\\\\Calorie\\\\src\\\\Assets\\\\alimentos.txt\");\n FileReader fr = new FileReader(file);\n BufferedReader br = new BufferedReader(fr);\n\n ArrayList<Alimento> lista = new ArrayList<>();\n\n int noLines = Integer.parseInt(br.readLine());\n for(int l=0; l<noLines; l++) {\n String[] alimTks = (br.readLine()).split(\",\");\n\n Alimento alimento = new Alimento(idAlimCounter++,alimTks[0],100,Integer.parseInt(alimTks[1]),Float.parseFloat(alimTks[2]),Float.parseFloat(alimTks[3]),Float.parseFloat(alimTks[4]));\n lista.add(alimento);\n }\n\n return lista;\n }catch (Exception e) {\n System.out.println(\"Sistema - getLista() : \"+e.toString());\n }\n return null;\n }", "public void setArrayList(ArrayList<Chalet> arrayList) {\n this.arrayList.addAll(arrayList);\n notifyDataSetChanged();// to update the sutats\n }", "public void addTo(String list, String[] data) {\n if (\"settings\".equals(list)) {\n this.settings.add(data);\n } else if (\"bots\".equals(list)) {\n this.bots.add(data);\n } else if (\"scripts\".equals(list)) {\n this.scripts.add(data);\n } else if (\"styles\".equals(list)) {\n this.styles.add(data);\n } else if (\"og\".equals(list)) {\n this.og.add(data);\n } else if (\"og_video\".equals(list)) {\n this.og_video.add(data);\n } else if (\"og_audio\".equals(list)) {\n this.og_audio.add(data);\n } else if (\"og_location\".equals(list)) {\n this.og_location.add(data);\n } else if (\"og_contact\".equals(list)) {\n this.og_contact.add(data);\n } else if (\"rss\".equals(list)) {\n this.rss.add(data);\n } else {\n this.meta.add(data);\n }\n }", "private void addItem() {\n\t\tString message = edtMessage.getText().toString();\n\t\t// build the human\n\t\tHuman hum = new Human(message, humans.size());\n\t\t// 1° method\n\t\tarrayAdapter.add(hum);\n\t\t// 2° method\n\t\t// messages.add(message);\n\t\t// arrayAdapter.notifyDataSetChanged();\n\t\t// and flush\n\t\tedtMessage.setText(\"\");\n\t}", "private void initializeData() {\n\n TypedArray sportsImageResources = getResources().obtainTypedArray(R.array.sports_images);\n String[] sportsList = getResources().getStringArray(R.array.sports_title);\n String[] sportsInfo = getResources().getStringArray(R.array.sports_info);\n\n //clear the existing data(to avoid the duplication)\n mSportsData.clear();\n\n //create the arraylist of sports objects with titles and information\n for(int i = 0; i<sportsList.length;i++){\n mSportsData.add(new Sport(sportsList[i], sportsInfo[i], sportsImageResources.getResourceId(i, 0)));\n }\n\n //Notify the change to the adapter\n mAdapter.notifyDataSetChanged();\n sportsImageResources.recycle(); //avoid duplication, works fine without it\n }", "private void populateData() {\r\n\t\tfor(int i = 0; i < this.incomeRanges.length; i++) {\r\n\t\t\tthis.addData(new Data(incomeRanges[i], 0), true);\r\n\t\t}\t// end for\r\n\t}", "public ArrayListStack(){\r\n theData = new ArrayList<E>();\r\n }", "public void populateList(){\n\t\tfor (int i = 0; i < 10; i++){\n\t\t\tscoreList.add(-1);\t\t\t\n\t\t\tnameList.add(\"\");\n\t\t}\n\t\tint i=0; \n\t\ttry {\n\t\t\tScanner results = new Scanner(new File(\"results.txt\"));\n\t\t\twhile (results.hasNext()){\n\t\t\t\tnameList.set(i, results.next());\n\t\t\t\tscoreList.set(i, results.nextInt());\n\t\t\t\ti++;\n\t\t\t}\n\t\t} catch (FileNotFoundException e1){\n\t\t\te1.printStackTrace();\n\t\t}\n\t}", "private void doCreateList() {\n String lengthStr = textfieldLength.getText();\n try {\n int length = Integer.parseInt(lengthStr);\n testSort.LegeArrayAn(length);\n } catch (Exception e) {\n testSort.LegeArrayAn(10);\n }\n switch(comboboxCase.getSelectedIndex()) {\n case 0:\n testSort.MischeArray(\"averagecase\");\n break;\n case 1:\n testSort.MischeArray(\"bestcase\");\n break;\n case 2:\n testSort.MischeArray(\"worstcase\");\n break;\n }\n int[] array = testSort.getZahlenfeld();\n Integer[] arrayObj = Arrays.stream(array).boxed().toArray(Integer[]::new);\n listUnsorted.setListData(arrayObj);\n listSorted.setListData(new Object[0]);\n }", "public void populateVehicleList() {\n\t\tfor (int i = 0; i < VEHICLE_LIST_SIZE; i++) {\n\t\t\tvehicleList[i] = createNewVehicle();\n\t\t}\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}", "public void populate(List<? super DataType> list, int count) {\n\t\tif (list == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (list.size() >= count) {\n\t\t\treturn;\n\t\t}\n\n\t\tint toAdd = count - list.size();\n\n\t\tfor (int i = 0; i < toAdd; i++) {\n\t\t\tlist.add(this.objectCreator.get());\n\t\t}\n\t}", "private void populatePlantList(){\n\n for (Document doc : getPlantList()) {\n String picture = doc.getString(\"picture_url\");\n String name = doc.getString(\"plant_name\");\n String description = doc.getString(\"description\");\n ArrayList sunlightArray = doc.get(\"sunlight\", ArrayList.class);\n String min_sun = sunlightArray.get(0).toString();\n String max_sun = sunlightArray.get(1).toString();\n ArrayList temperatureArray = doc.get(\"temperature\", ArrayList.class);\n String min_temp = temperatureArray.get(0).toString();\n String max_temp = temperatureArray.get(1).toString();\n ArrayList humidityArray = doc.get(\"humidity\", ArrayList.class);\n String min_humidity = humidityArray.get(0).toString();\n String max_humidity = humidityArray.get(1).toString();\n\n listOfPlants.add(new RecyclerViewPlantItem(picture, name, description, min_sun, max_sun, min_temp, max_temp, min_humidity, max_humidity));\n }\n }", "private void fillArrayLists(){\n titlesList = new ArrayList<>();\n fragmentsList = new ArrayList<>();\n\n titlesList.add(getString(R.string.basic));\n titlesList.add(getString(R.string.easy));\n titlesList.add(getString(R.string.normal));\n titlesList.add(getString(R.string.hard));\n\n fragmentsList.add(LevelBasicFragment.newInstance(basicLevelWord, basicLevelType, language));\n fragmentsList.add(LevelEasyFragment.newInstance(easyLevelWord, easyLevelType, language));\n fragmentsList.add(LevelNormalFragment.newInstance(normalLevelWord, normalLevelType, language));\n fragmentsList.add(LevelHardFragment.newInstance(hardLevelWord, hardLevelType, language));\n }", "public DaftarMhs_list(ArrayList<NamaMhs_Obj> list_data) {\n\n this.list_data = list_data;\n\n\n }", "public static ArrayList<Book> fillBooksArray(ArrayList<Book> bookArrayList){\n\n bookArrayList.add(PrepareData.book1);\n bookArrayList.add(PrepareData.book2);\n bookArrayList.add(PrepareData.book3);\n bookArrayList.add(PrepareData.book4);\n bookArrayList.add(PrepareData.book5);\n bookArrayList.add(PrepareData.book6);\n\n\n return bookArrayList;\n\n\n\n }", "public void addNewData(List<PublicPollResponseModel.Data> data) {\n //remove footer view\n this.removeFooterView(footer);\n //Add all data into the adapter\n adapter.addAll(data);\n //Notifies the attached observers that the underlying\n // data has been changed and any View reflecting the data set should refresh itself.\n adapter.notifyDataSetChanged();\n isLoading = false;\n }", "public void addData (Object obj)\n {\n\tif (front == null) {\n\t front = new ListItem (obj);\n\t rear = front;\n\t}\n\telse {\n\t rear.next = new ListItem (obj);\n\t rear = rear.next;\n\t}\n\tnumItems++;\n }", "private void addToEmptyList(T data) {\n this.first = this.last = new Node(data);\n this.nrOfElements++;\n }", "private void add() {\n\n\t}", "a(ArrayList arrayList) {\n super(1);\n this.$result = arrayList;\n }", "private void createLoanList() {\n\t\tArrayList<Object> loans = new ArrayList<Object>(Arrays.asList(loanArray));\n\t\tfor (int i = 0; i < loans.size(); i++)\n\t\t\tif (((Loan) loans.get(i)).getFineAmount() == 0)\n\t\t\t\tloans.remove(i);\n\t\tlist = new LoanList();\n\t\tlist.setItems(loans);\n\t\tadd(list);\n\t}", "private void initializeData() {\n\n /**\n * Food\n */\n mFoodArrayList = new ArrayList<>();\n HashMap<String, String> hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"1\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_1));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"2\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_2));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"3\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_3));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"4\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_4));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"5\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_5));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"6\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_6));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"7\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_7));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"8\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_8));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"9\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_9));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"10\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_10));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"11\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_11));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"12\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_12));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"13\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_13));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"14\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_14));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"15\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_15));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"16\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_16));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"17\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_17));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"18\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_18));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"19\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_19));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"20\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_20));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"21\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_21));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"22\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_22));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"23\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_23));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"24\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_24));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"25\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_25));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"26\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_26));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"27\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_27));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"28\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_28));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"29\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_29));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"30\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_30));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"31\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_31));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"32\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_32));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"33\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_33));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"34\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_34));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"35\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_35));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"36\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_36));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"37\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_37));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"38\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_38));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"39\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_39));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"40\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_40));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"41\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_41));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"42\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_42));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"43\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_43));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"44\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_44));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"45\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_45));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"46\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_46));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"47\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_47));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"48\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_48));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"49\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_49));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"50\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_50));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"51\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_51));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"52\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_52));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"53\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_53));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"54\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_54));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n hashMapac = new HashMap<String, String>();\n\n hashMapac.put(\"id\", \"55\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_55));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"56\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_56));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"57\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_57));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"58\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_58));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"59\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_59));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"60\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_60));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"61\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_61));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"62\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_62));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"63\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_63));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"64\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_64));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"65\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_65));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"66\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_66));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"67\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_67));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"68\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_68));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"69\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_69));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"70\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_70));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"71\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_71));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"72\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_72));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"73\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_73));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"74\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_74));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"75\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_75));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"76\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_76));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"77\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_77));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"78\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_78));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"79\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_79));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"80\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_80));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"81\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_81));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"82\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_82));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"83\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_83));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"84\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_84));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"85\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_85));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"86\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_86));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"87\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_87));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"88\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_88));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"89\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_89));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"90\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_90));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"91\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_91));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"92\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_92));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"93\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_93));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"94\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_94));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"95\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_95));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"96\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_96));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"97\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_97));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"98\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_98));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"99\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_99));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"127\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_127));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n\n /**\n * Environment\n */\n mEnvironmentArrayList = new ArrayList<HashMap<String, String>>();\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"109\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_109));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"110\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_110));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"111\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_111));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"112\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_112));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"113\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_113));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"114\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_114));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"115\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_115));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"116\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_116));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"117\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_117));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"118\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_118));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"119\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_119));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"120\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_120));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"121\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_121));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"122\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_122));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"123\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_123));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"124\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_124));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"125\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_125));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"126\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_126));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"128\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_128));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n\n /**\n * Medication\n */\n mMedicationArrayList = new ArrayList<HashMap<String, String>>();\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"100\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_medication_100));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_medication_url));\n mMedicationArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"101\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_medication_101));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_medication_url));\n mMedicationArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"102\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_medication_102));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_medication_url));\n mMedicationArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"103\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_medication_103));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_medication_url));\n mMedicationArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"104\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_medication_104));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_medication_url));\n mMedicationArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"105\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_medication_105));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_medication_url));\n mMedicationArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"106\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_medication_106));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_medication_url));\n mMedicationArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"107\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_medication_107));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_medication_url));\n mMedicationArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"108\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_medication_108));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_medication_url));\n mMedicationArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"129\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_medication_129));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_medication_url));\n mMedicationArrayList.add(hashMapac);\n }", "private void loadData(){\n\t\t \n\t\t model.getDataVector().clear();\n\t\t ArrayList<Person> personList = DataBase.getInstance().getPersonList();\n\t\t for(Person person : personList){\n\t\t\t addRow(person.toBasicInfoStringArray());\n\t\t }\n\t\t \n\t }", "public BookList(ObservableList<Book> oList){\r\n //Instantiate the bookList attribute\r\n bookList = new ArrayList<Book>();\r\n //if the parameter oList is not null, then loop through it and create a new Book object from each element,\r\n //using the getters. The enhanced for-loop works great here See Chapter 7.13. Add the new Book to the attribute\r\n //called bookList\r\n if(oList != null){\r\n for(Book bk: oList){\r\n bookList.add(new Book(bk.getTitle(), bk.getPrice()));\r\n }\r\n }\r\n\r\n }", "public static void addList() {\n\t}", "public void createList () {\n imageLocs = new ArrayList <Location> ();\n for (int i = xC; i < xLength * getPixelSize() + xC; i+=getPixelSize()) {\n for (int j = yC; j < yLength * getPixelSize() + yC; j+=getPixelSize()) {\n Location loc = new Location (i, j, LocationType.POWERUP, true);\n\n imageLocs.add (loc);\n getGridCache().add(loc);\n \n }\n }\n }" ]
[ "0.6781279", "0.6750182", "0.65485126", "0.64831907", "0.6442077", "0.63915205", "0.63493586", "0.6332302", "0.63281727", "0.6293871", "0.6279271", "0.6271021", "0.6253244", "0.62422264", "0.62416995", "0.621308", "0.6200115", "0.6199605", "0.61745435", "0.6158262", "0.6138247", "0.6135211", "0.6129942", "0.61273986", "0.61256045", "0.6118123", "0.6107206", "0.610622", "0.60791725", "0.60742784", "0.6017715", "0.59986836", "0.5993916", "0.59881806", "0.59853595", "0.59816325", "0.5973059", "0.5971919", "0.5969092", "0.5953934", "0.59485215", "0.59475935", "0.5947545", "0.59344214", "0.5927367", "0.59259653", "0.5921468", "0.5911925", "0.5909208", "0.5905823", "0.58973074", "0.58852184", "0.58843684", "0.5877579", "0.5876229", "0.587493", "0.5873073", "0.58657706", "0.58637035", "0.5859729", "0.5858564", "0.585464", "0.5852029", "0.58465517", "0.5845277", "0.58435434", "0.583635", "0.58336866", "0.5832421", "0.58311486", "0.5829983", "0.5816467", "0.58157617", "0.581313", "0.5800343", "0.5799973", "0.5789439", "0.57879287", "0.57807434", "0.57776684", "0.5775852", "0.5774858", "0.57510567", "0.5748119", "0.57430947", "0.57413095", "0.574117", "0.57396567", "0.5737963", "0.5730977", "0.57282484", "0.57259625", "0.57249653", "0.57219553", "0.5717213", "0.5712296", "0.57014644", "0.5696796", "0.56950283", "0.5692104", "0.56853336" ]
0.0
-1
Sort the array using bubble sorting.
private void sortBubble(ArrayList<String[]> jtData, int col) { String first, second; for(int i=0; i < jtData.size();i++) { for(int j=1; j < (jtData.size()-i); j++) { first = jtData.get(j-1)[col]; second = jtData.get(j)[col]; if(col == 2) { // Price is integer int x = Integer.valueOf(first); int y = Integer.valueOf(second); if(x < y) { Collections.swap(jtData, j, j-1); } } else if (first.compareToIgnoreCase(second) > 0) { // For Strings Collections.swap(jtData, j, j-1); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void bubbleSort() {\n boolean unordered = false;\n do {\n unordered = false;\n for (int i = 0; i < array.length - 1; i++) {\n if (((Comparable) array[i]).compareTo(array[i + 1]) > 0) {\n T temp = array[i + 1];\n array[i + 1] = array[i];\n array[i] = temp;\n unordered = true;\n }\n }\n } while (unordered);\n }", "public void bubbleSort() {\n\t\tint n = data.size();\n\t\tfor (int i = 0; i < data.size(); i++) {\n\t\t\tfor (int j = 1; j < n - i; j++) {\n\t\t\t\tif (data.get(j - 1) > data.get(j)) {\n\t\t\t\t\tswap(j, j - 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}", "public void bubbleSort(){\n for(int i = arraySize -1; i > 1; i--){\n for(int j = 0; j < i; j++){\n // Use < to change it to Descending order\n if(theArray[j] > theArray[j+1]){\n swapValues(j, j+1);\n printHorizontalArray(i, j);\n }\n printHorizontalArray(i, j);\n }\n }\n }", "private void bubbleSort(T[] arr) {\n boolean swaps;\n for (int i = 0; i < n - 1; i++) { // since we always compare two elements, we will need to iterate up to (n - 1) times\n swaps = false;\n for (int j = 1; j < n - i; j++) // we reduce the inspected area by one element at each loop, because the largest element will already be pushed to the right\n if (arr[j].compareTo(arr[j - 1]) < 0) {\n swap(arr, j, j - 1); // the swap method is implemented further\n swaps = true;\n }\n if (!swaps) break; // we stop if there were no swaps during the last iteration\n }\n }", "public static <T extends Comparable<T>> void bubbleSort(T[] arrayToSort) {\n for(int i = 0; i < arrayToSort.length - 1; i++)\n for(int j = arrayToSort.length - 1; j > i + 1; j--)\n if(arrayToSort[j].compareTo(arrayToSort[j - 1]) < 0) {\n T value = arrayToSort[j];\n arrayToSort[j] = arrayToSort[j - 1];\n arrayToSort[j - 1] = value;\n }\n }", "public static void bubbleSort(int[] arr){\r\n \tfor(int i = 0; i< arr.length - 1;i++)\r\n \t{\r\n \t\tfor(int j = 0; j< arr.length - 1; j++)\r\n \t\t{\r\n \t\t\tif(arr[j] > arr[j + 1])\r\n \t\t\t{\r\n \t\t\t\tint temp = arr[j];\r\n \t\t\t\tarr[j] = arr[j + 1];\r\n \t\t\t\tarr[j + 1] = temp;\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n }", "public static <T extends Comparable<T>> void myBubbleSort(T[] arrayToSort) {\n boolean isNotSorted = true;\n while(isNotSorted) {\n isNotSorted = false;\n for(int i = 0; i < arrayToSort.length - 1; i++)\n if(arrayToSort[i].compareTo(arrayToSort[i + 1]) > 0) {\n T value = arrayToSort[i];\n arrayToSort[i] = arrayToSort[i + 1];\n arrayToSort[i + 1] = value;\n isNotSorted = true;\n }\n }\n }", "@Test\n public void testBubbleSort() {\n BubbleSort<Integer> testing = new BubbleSort<>();\n\n testing.sort(array, new Comparator<Integer>() {\n @Override\n public int compare(Integer i1, Integer i2) {\n return i1.compareTo(i2);\n }\n });\n\n checkArray(\"Bubble sort doesn't work!\", array);\n }", "public static void bubbleSortAlgo(int[] arr) {\n for(int i = 1; i<arr.length-1; i++){\n // inner loop to compare each element with it's next one in every iteration in one complete outer loop\n for(int j = 0; j<arr.length -1; j++){\n if(isSmaller(arr, j+1, j)){ // compares the jth element from it's next element\n swap(arr, j+1, j); // if ismaller condition is true swaps both the elements\n }\n }\n }\n \n }", "public void bubbleSort(int [] array) {\n\t\t\n\t\tfor(int i=0; i<array.length - 1; i++) {\n\t\t\t\n\t\t\tfor(int j=0; j<array.length-i-1; j++) {\n\t\t\t\t\n\t\t\t\tif(array[j]>array[j+1]) {\n\t\t\t\t\t\n\t\t\t\t\tint temp = array[j];\n\t\t\t\t\tarray[j] = array[j+1];\n\t\t\t\t\tarray[j+1] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(Arrays.toString(array));\n\t\t}\n\t}", "public static void bubbleSort(int[] arr)\n\t{\n\t\tint len=arr.length;\n\t\tboolean swapped=true;\n\t\twhile(swapped){\n\t\t\tswapped=false;\n\t\t\tfor(int j=1;j<len;j++){\n\t\t\t\tif(arr[j-1]>arr[j]){\n\t\t\t\t\tint temp=arr[j-1];\n\t\t\t\t\tarr[j-1]=arr[j];\n\t\t\t\t\tarr[j]=temp;\n\t\t\t\t\tswapped=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void bubbleSort(Array a) {\n int temp;\n for (int i = 0; i < a.length - 1; i++) { // for passes\n int flag = 0;\n for (int j = 0; j < a.length - 1 - i; j++) { // for iteration\n if (a.get(j) > a.get(j + 1)) {\n temp = a.get(j);\n a.set(j, a.get(j + 1));\n a.set(j + 1, temp);\n flag = 1;\n }\n }\n if (flag == 0) break; // if the list is already sorted\n }\n }", "public void setBubbleSort() \n\t{\n\t\tint last = recordCount + NOT_FOUND; //array.length() - 1\n\n\t\twhile(last > RESET_VALUE) //last > 0\n\t\t{\n\t\t\tint localIndex = RESET_VALUE; \n\t\t\tboolean swap = false;\n\n\t\t\twhile(localIndex < last) \n\t\t\t{\n\t\t\t\tif(itemIDs[localIndex] > itemIDs[localIndex + 1]) \n\t\t\t\t{\n\t\t\t\t\tsetSwapArrayElements(localIndex);\n\t\t\t\t\tswap = true;\n\t\t\t\t}\n\t\t\t\tlocalIndex++;\n\t\t\t}\n\n\t\t\tif(swap == false) \n\t\t\t{\n\t\t\t\tlast = RESET_VALUE;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tlast = last + NOT_FOUND;\n\t\t\t}\n\n\t\t}//END while(last > RESET_VALUE)\n\t\treturn;\n\t}", "public void bubbleSort() {\n \tfor (int i = 0; i < contarElementos()-1; i++) {\n\t\t\tboolean intercambiado= false;\n\t\t\tfor (int j = 0; j < contarElementos()-1; j++) {\n\t\t\t\tif (encontrarNodoEnElndice(j).getElemento().compareTo(encontrarNodoEnElndice(j+1).getElemento())>0) {\n\t\t\t\t\tintercambiar(j, j+1);\n\t\t\t\t\tintercambiado=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!intercambiado) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n }", "public static int[] bubbleSort(int array[]) {\n \t\t// TODO S1 implements bubble sort\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tfor (int j = 0; j < array.length - i - 1; j++) {\n\t\t\t\tif (array[j] > array[j + 1]) {\n\t\t\t\t\tint smaller = array[j + 1];\n\t\t\t\t\tint larger = array[j];\n\t\t\t\t\tarray[j] = smaller;\n\t\t\t\t\tarray[j + 1] = larger;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n \t return array;\n \t}", "public void myBubbleSort(int array[]) {\n for (int i = 0; i < array.length - 1; i++) {\n //Iterate through the array to the index to the left of i\n for (int j = 0; j < array.length - i - 1; j++) {\n //Check if the value of the index on the left is less than the index on the right\n if (array[j] > array[j + 1]) {\n //If so, swap them.\n int temp = array[j];\n array[j] = array[j + 1];\n array[j + 1] = temp;\n\n }\n }\n }\n }", "public static void BubbleSort(int[] a) {\n\t int n = a.length;\n\t int temp = 0;\n\n\t for(int i = 0; i < n; i++) {\n\t for(int j=1; j < (n-i); j++) {\n\t if(a[j-1] > a[j]) {\n\t temp = a[j-1];\n\t a[j-1] = a[j];\n\t a[j] = temp;\n\t }\n\t }\n\t }\n\t}", "public static void bubbleSort(int[] array) {\n boolean swapped = true;\n for (int i = 0; i < array.length && swapped != false; i++) {\n swapped = false;\n for (int j = 1; j < (array.length - i); j++) {\n if (array[j - 1] > array[j]) {\n swap(array, j, j - 1);\n swapped = true;\n }\n }\n }\n }", "public static int[] BubbleSort(int[] array){\n int j;\n int temp;\n boolean flag=false;\n while ( flag )\n {\n flag= false;\n for( j=0;j<array.length-1;j++ )\n {\n if ( array[j] < array[j+1] )\n {\n temp = array[j];\n array[j] = array[j+1];\n array[j+1] = temp;\n flag = true;\n }\n }\n }\n return array;\n }", "public static void bubbleSort(String[] words) {\n \n for(int i=0; i< words.length-1; i++) {\n for(int j=i+1; j<words.length; j++) {\n if(words[j].compareTo(words[i]) < 0) {\n String s = words[j];\n words[j] = words[i];\n words[i] = s;\n }\n } \n }\n }", "private void bubbleSort() {\r\n\r\n int n = leaderboardScores.size();\r\n int intChange;\r\n String stringChange;\r\n\r\n for (int i = 0 ; i < n - 1 ; i ++ ) {\r\n for (int j = 0 ; j < n - i - 1 ; j ++ ) {\r\n\r\n if (leaderboardScores.get(j) > leaderboardScores.get(j + 1)) {\r\n // swap arr[j+1] and arr[i]\r\n intChange = leaderboardScores.get(j);\r\n leaderboardScores.set(j, leaderboardScores.get(j + 1));\r\n leaderboardScores.set(j + 1, intChange);\r\n\r\n stringChange = leaderboardUsers.get(j);\r\n leaderboardUsers.set(j, leaderboardUsers.get(j + 1));\r\n leaderboardUsers.set(j + 1, stringChange);\r\n }\r\n\r\n }\r\n }\r\n }", "public static void bubbleSort(int[] arr) {\r\n for (int i = 0; i < arr.length; i++) {\r\n boolean swapped = false;\r\n for (int j = 1; j < arr.length - i; j++) {\r\n if (arr[j] < arr[j - 1]) {\r\n swap(arr, j, j - 1);\r\n swapped = true;\r\n }\r\n }\r\n if (!swapped) {\r\n break;\r\n }\r\n }\r\n }", "static void bubbleSort(int[] arr) {\n\t\tboolean swapped; //using swapped for optimization, inner loop will continue only if swapping is possible\n\t\tfor(int i=0;i<arr.length-1;i++) {\n\t\t\tswapped =false;\n\t\t\tfor(int j =0;j<arr.length-i-1;j++) {\n\t\t\t\tif(arr[j]>arr[j+1]) {\n\t\t\t\t\tint temp = arr[j+1]; \n\t\t arr[j+1] = arr[j]; \n\t\t arr[j] = temp;\n\t\t swapped = true;\n\t\t\t\t}\n\t\t\t\t// IF no two elements were \n\t // swapped by inner loop, then break \n\t\t\t\t if (swapped == false) \n\t\t break;\n\t\t\t}\n\t\t}\n\t\tfor(int a:arr) \n\t\t{ \n\t\t\tSystem.out.print(a+ \" \");\n\t\t}\n\t\tSystem.out.println();\n\t\t\n\t}", "public void bubbleSort(int[] array){\n int last = array.length;\r\n // boolean to flag a swap\r\n boolean swap = true;\r\n // continue if a swap has been made\r\n while(swap){\r\n // assume no swaps will be done\r\n swap = false;\r\n // look for swaps\r\n for(int i = 0; i < last - 1; i++){\r\n // find a bigger value?\r\n if(array[i] > array[i+1]){\r\n // swap\r\n swap(array, i, i+1);\r\n // set flag to true\r\n swap = true;\r\n }\r\n }\r\n // move the last position tracker\r\n last--;\r\n }\r\n }", "public static void bubbleSort(int[] arr){\n\n\t\tboolean swaps = true; //setting boolean swaps to true \n\t\tint l = arr.length; //varibale to hold the length of the array \n\n\t\twhile (swaps == true) { //goes through while swaps is true \n\n\t\t\tswaps = false; //setting swaps to false \n\n\t\t\tfor(int i = 0; i < l-1; i++) { //iterates through the length of the array \n\t\t\t\t\n\t\t\t\tif (arr[i + 1] < arr[i]) { //if the element on the right is less than the one on the left (54321)\n\n\n\t\t\t\t\tint temp = arr[i]; //holds the value of element at that index position \n\t\t\t\t\tarr[i] = arr[i+1]; //swaps the elments over \n\t\t\t\t\tarr[i+1] = temp; //moves onto the next element \n\n\t\t\t\t\tswaps = true; //as n-1, moves back and repeats to do the last element \n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t}", "public void bubbleSort(long [] a){\n\t\tint upperBound=a.length-1;\n\t\tint lowerBound =0;\n\t\tint swaps=0;\n\t\tint iterations=0;\n\t\twhile(upperBound>=lowerBound){\n\t\t\tfor(int i=0,j=1;i<=upperBound && j<=upperBound; j++,i++){\n\t\t\t\tlong lowerOrderElement = a[i];\n\t\t\t\tlong upperOrderElement = a[j];\n\t\t\t\titerations++;\n\t\t\t\tif(lowerOrderElement>upperOrderElement){ //swap positions\n\t\t\t\t\ta[i] = a[j];\n\t\t\t\t\ta[j]= lowerOrderElement;\n\t\t\t\t\tswaps=swaps+1;\n\t\t\t\t}\n\t\t\t\telse{ // sorted.\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tupperBound--;\n//\t\tSystem.out.println(\"upperBound:- \" +upperBound);\n//\t\tSystem.out.println(\"lowerBound:- \" +lowerBound);\n\t\t}displayArr(a);\n\t\t\n\t\tSystem.out.println(\"Total Swaps:- \" + swaps);\n\t\tSystem.out.println(\"Total Iterations:- \" + iterations);\n\t}", "static void BubbleSort(int[] arr){\n for(int i = 0; i< arr.length-1;i++){\n int numberOfSwaps = 0;\n for(int j = 0; j<arr.length-i-1;j++){\n if(arr[j]>arr[j+1]){\n Swap(arr, j, j+1);\n numberOfSwaps++;\n }\n }\n if(numberOfSwaps == 0){\n break;\n }\n }\n }", "public static int[] bubble(int[] arr)\n {\n int l=arr.length;\n\n for (int i = 0; i <l-1; i++)\n {\n for (int j=0; j<l-1-i; j++)\n {\n if (arr[j] > arr[j + 1])\n {\n swap(j, j+ 1, arr);\n }\n }\n }\n return arr;\n }", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\t@Override\n\tpublic void sort() {\n\t\t\n\t\t// create maxHeap\n\t\tHeap<E> maxHeap = new MaxHeap<E>(arr);\n\t\t\n\t\telapsedTime = System.nanoTime(); // get time of start\n\t\t\n\t\tfor (int i = length - 1; i > 0; i--) {\n\n\t\t\tmaxHeap.swap(arr, 0, i);\n\t\t\tmaxHeap.heapSize--;\n\t\t\t((MaxHeap) maxHeap).maxHeapify(arr, 0);\n\n\t\t}\n\t\t\n\t\telapsedTime = System.nanoTime() - elapsedTime; // get elapsed time\n\t\t\n\t\tprint(); // print sorted array\n\t\tprintElapsedTime(); // print elapsed time\n\t\t\n\t\t\n\t}", "static int[] bubbleSort(int[] a) {\n int n = a.length;\n while(n > 0) {\n int newLastN = 0; // if no swap occurred in last step we won't need to run next iteration\n for (int i = 1; i < n; i++) {\n comparisonCount++;\n if (a[i - 1] > a[i]) {\n swapCount++;\n swap(a, i - 1, i);\n newLastN = i;\n }\n }\n n = newLastN;\n }\n return a;\n }", "public int[] bubbleSort(int[] a) {\r\n\t\t boolean sorted = false;\r\n\t\t int temp;\r\n\t\t while(!sorted) {\r\n\t\t sorted = true;\r\n\t\t for (int i = 0; i < a.length - 1; i++) {\r\n\t\t if (a[i] > a[i+1]) {\r\n\t\t temp = a[i];\r\n\t\t a[i] = a[i+1];\r\n\t\t a[i+1] = temp;\r\n\t\t sorted = false;\r\n\t\t }\r\n\t\t }\r\n\t\t }\r\n\t\t\treturn a;\r\n\t\t}", "public static void sortBubble(int[] tab) {\n boolean alreadySorted=false;\n int temp;\n int n=tab.length;\n int i=0;\n if(tab.length!=0){\n while (i<n-1 && !alreadySorted){\n alreadySorted=true;\n for (int j=0; j<n-1-i;j++){\n if (tab[j]>tab[j+1]){\n alreadySorted=false;\n temp=tab[j];\n tab[j]=tab[j+1];\n tab[j+1]=temp;\n }\n }\n i=i+1;\n }\n }\n}", "public void printSortedByBubbleSort(int[] array){\r\n\t\tint temp;\r\n\t\tfor (int i = 0; i < array.length; i++) {\r\n\t\t\tfor (int j = 0; j < array.length - 1; j++) {\r\n\t\t\t\tif(array[j] > array[j + 1]){\r\n\t\t\t\t\ttemp = array[j];\r\n\t\t\t\t\tarray[j] = array[j + 1];\r\n\t\t\t\t\tarray[j + 1] = temp;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"\\nSorted by BubleSort: \");\r\n\t\tfor (int i = 0; i < array.length; i++) {\r\n\t\t\tSystem.out.print(array[i] + \" \");\r\n\t\t}\r\n\t}", "public static void bubbleSort(int[] a) {\n\t\tboolean loop;\n\t\tdo {\n\t\t\tloop = false;\n\t\t\tfor (int i = 0; i < a.length - 1; i ++) {\n\t\t\t\tif (a[i] > a[i + 1]) {\n\t\t\t\t\tint temp = a[i];\n\t\t\t\t\ta[i] = a[i + 1];\n\t\t\t\t\ta[i + 1] = temp;\n\t\t\t\t\tloop = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} while (loop);\n\t}", "public static void BubbleSort(int[] input) {\r\n for (int i = input.length - 1; i > 0; i--) {\r\n for (int j = 0; j < i; i++) {\r\n if (input[j] > input[j + 1]) {\r\n swap(input, j, j + 1);\r\n }\r\n }\r\n }\r\n }", "public void sortArray(){\n\t\tfor (int i=0; i<population.length;i++){\n\n\t\t\tfor (int j=0; j<population.length-i-1;j++){\n\n\t\t\t\tif(population[j].computeFitness()>population[j+1].computeFitness()) {\n\t\t\t\t\t//swap their positions in the array\n\t\t\t\t\tChromosome temp1 = population[j];\n\t\t\t\t\tpopulation[j] = population[j+1];\n\t\t\t\t\tpopulation[j+1] = temp1;\n\t\t\t\t}//end if\n\n\t\t\t}//end j for\n\n\t\t}//end i for\n\t}", "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}", "public void sort(){\n for(int i = array.length-1;i >= 0;i--){\n sink(i);\n }\n while(size > 0){\n swap(0, size-1);\n size -= 1;\n sink(0);\n }\n }", "public static void bubbleSort(int [] arr){\n int temp = 0; //temporary variable\n boolean flag = false; //mark if any reversion has happened\n for (int i = 0; i < arr.length - 1;i++){\n\n for (int j = 0; j < arr.length - 1-i; j++) {\n //if the previous number is bigger than the latter, reverse\n if (arr[j] > arr[j + 1]) {\n flag = true;\n temp = arr[j];\n arr[j] = arr[j + 1];\n arr[j + 1] = temp;\n }\n }\n\n //System.out.printf(\"After the %d round of sorting\",i+1);\n //System.out.println(Arrays.toString(arr));\n\n if(!flag){\n break;\n } else {\n flag = false;\n //reset flag to true to do the next check\n }\n }\n }", "public static void bubbleSort(int[] a) {\r\n boolean swapped; // keeps track of when array values are swapped \r\n int i; // a loop counter\r\n int temp; // catalyst variable for String swapping\r\n\r\n // Each iteration of the outer do loop is is one pass through the loop. \r\n // If anything was swapped, it makes another pass\r\n do {\r\n // set swapped to false before each pass\r\n swapped = false;\r\n\r\n // the for loop is a pass through the array to the second to last element\r\n for (i = 0; (i < a.length - 1); i++) {\r\n // if the two items are out of order see page 16 for String compareTo() \r\n if (a[i + 1] < (a[i])) {\r\n // swap the two items and set swapped to true \r\n temp = a[i];//catalyst variable assignment to item\r\n a[i] = a[i + 1];//copy second item to first item slot\r\n a[i + 1] = temp;//copy catalyst variable to second slot\r\n\r\n swapped = true; //something was swapped!\r\n\r\n } // end if\r\n } // end for\r\n\r\n // the outer loop will repeat if a swap was made – another passs\r\n } while (swapped);\r\n\r\n }", "public static void main(String[] args) {\r\n int[] numbers = {25, 43, 29, 50, -6, 32, -20, 43, 8, -6};\r\n\t\r\n\tSystem.out.print(\"before sorting: \");\r\n\toutputArray(numbers);\r\n \r\n\tbubbleSort(numbers);\r\n\t\r\n\tSystem.out.print(\"after sorting: \");\r\n\toutputArray(numbers);\r\n }", "void sort() {\n\t\tint n = array.length;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 1; j < (n - i); j++) {\n\t\t\t\tif (array[j - 1] > array[j]) { // if the first term is larger\n\t\t\t\t\t\t\t\t\t\t\t\t// than the last term, then the\n\t\t\t\t\t\t\t\t\t\t\t\t// temp holds the previous term\n\t\t\t\t\ttemp = array[j - 1];\n\t\t\t\t\tarray[j - 1] = array[j];// swaps places within the array\n\t\t\t\t\tarray[j] = temp;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "public static int[] bubbleSortBasic(int [] arrayToSort , SorterObject results)\n {\n \t// Create a copy of array than was send\n int [] arr = Arrays.copyOf(arrayToSort,arrayToSort.length);\n // Start the timer\n long startTime = System.currentTimeMillis(); \n // Variable used for swaping elements\n int temp = 0; \n // Outer loop\n for(int i=0; i < arr.length-1; i++)\n { \n // inner loop\n for(int j=0; j < arr.length-1; j++)\n { \n \t// Increase number of comparisons\n \tresults.numberOfComparisons++;\n if(arr[j] > arr[j+1])\n { \n\t temp = arr[j]; \n\t arr[j] = arr[j+1]; \n\t arr[j+1] = temp; \n\t // Increase number of swaps\n\t results.numberOfSwaps++;\n }\n }\n } \n // Stop the timer\n long stopTime = System.currentTimeMillis();\n // Calculate time \n long elapsedTime = stopTime - startTime;\n // Save time elapsed in global results object\n results.time = elapsedTime;\n // Return sorted array\n return arr;\n \n }", "public static int[] bubbleSort(int[] inputArray) {\n boolean done = false;\n\n for (int i = 0; i < inputArray.length && !done; i++) {\n done = true;\n for (int j = 0; j < inputArray.length - i - 1; j++) {\n if (inputArray[j] > inputArray[j + 1]) {\n int temp = inputArray[j];\n inputArray[j] = inputArray[j + 1];\n inputArray[j + 1] = temp;\n done = false;\n }\n }\n }\n return inputArray;\n\n }", "private void createArrays(){\n array1 = new BubbleSort(CreateIntArray.fillArray(15)).bubbleSort();\n array2 = new BubbleSort(CreateIntArray.fillArray(15)).bubbleSort();\n BubbleSort.listArrayElements(array1);\n BubbleSort.listArrayElements(array2);\n\n int[] array = new int[array1.length + array2.length];\n\n int i = 0, j = 0;\n for (int k = 0; k < array.length; k++){\n if(i > array1.length - 1){\n array[k] = array2[j];\n j++;\n } else if(j > array2.length - 1){\n array[k] = array1[i];\n i++;\n } else if (array1[i] < array2[j]){\n array[k] = array1[i];\n i++;\n } else {\n array[k] = array2[j];\n j++;\n }\n\n }\n BubbleSort.listArrayElements(array);\n\n\n }", "@Override\n \tpublic void sort() {\n \t\tArrays.sort(data);\n \t}", "public static int[] sortBubble(int[] tab) {\n int n=tab.length;\n\t\tint i=0;\n\t\tboolean dejatrie=false;\n\t\twhile(i<n-1 && !dejatrie) {\n\t\t\tdejatrie=true;\n\t\t\tfor (int j=0; j<n-1;j++) {\n\t\t\t\tif (tab[j]>tab[j+1]) {\n\t\t\t\t\techanger(tab,j,j+1); //méthode d'échange de deux élément en 3 lignes\n\t\t\t\t\tdejatrie=false;\n\t\t\t\t}\n\t\t\t}\n\t\t\ti=i+1;\n\t\t}\n\t\treturn tab;\n }", "@Override\n public void sort() {\n for (int i = 0; i < size; i++) {\n for (int j = i + 1; j < size; j++) {\n if (((Comparable) data[i]).compareTo(data[j]) > 0) {\n E c = data[i];\n data[i] = data[j];\n data[j] = c;\n\n }\n }\n }\n }", "public static void bubbleSort() {\r\n\t\tfor(int i = nodeArrList.size() -1; i > 0; i--) {\r\n\t\t\tfor(int j = 0; j < i; j++) {\r\n\t\t\t\tif(nodeArrList.get(j).frequency > nodeArrList.get(j +1).frequency) {\r\n\t\t\t\t\tHuffmanNode temp = nodeArrList.get(j);\r\n\t\t\t\t\tnodeArrList.set(j, nodeArrList.get(j + 1));\r\n\t\t\t\t\tnodeArrList.set(j + 1, temp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "void bubbleSort(int arr[]) {\r\n\r\n int n = arr.length;\r\n boolean swapped;\r\n for(int i = 0; i < n-1; i++) { //denotes pass #\r\n for(int j = 0; j < n-i-1; j++) { //denotes element in the pass\r\n if(arr[j] > arr[j+1]) {\r\n //swapping of the element\r\n arr[j] += arr[j+1];\r\n arr[j+1] = arr[j] - arr[j+1];\r\n arr[j] -= arr[j+1];\r\n swapped = true;\r\n\r\n } //end of if block\r\n }//end of element checking loop\r\n //if no 2 elements were swapped by inner loop, then break\r\n if (swapped == false)\r\n break;\r\n }//end of pass loop\r\n }", "static int[] Bubble_sort(int[] input) {\n\t\t//int n=input.length;\t\t\t\t\t//length of the array\n\t\tfor(int i=0;i<input.length;i++)\n\t\t{\t\t\t\t\t\t\t\t\n\t\t\tint pos=0;\t\t\t//setting the first element as the Max element\n\t\t\tint max=input[pos];\n\t\t\tfor(int j=0;j<input.length-i;j++)\n\t\t\t{\t\t\t\t\t//traversing the array to find the max element\n\t\t\t\tif(input[j]>max)\n\t\t\t\t{\n\t\t\t\t\tpos=j;\n\t\t\t\t\tmax=input[pos];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\t//swapping the Max element with input.length-i-1 position\n\t\t\tinput[pos]=input[input.length-i-1];\n\t\t\tinput[input.length-i-1]=max;\n\t\t}\n\t\treturn input;\n\t}", "private static void BubbleIter(int[] arr) {\n\t\t\n\t\tint size = arr.length;\n\t for (int i=1; i<size; ++i) {\n\t for (int j=0; j<size-i; ++j) {\n\t \t// Sorts the array arr[first] through arr[last] iteratively.\n\t \t// Last index changes by i pass\n\t if (arr[j]>arr[j+1]) swap(arr, j);\n\t }\n\t }\n\t}", "public static int[] bubbleSort(int[] values) {\n int temp;\n boolean nextPass = true;\n \n for (int i = 1; i < values.length && nextPass; i++) { // terminate loop if at end of array or a new pass is not needed\n nextPass = false;\n for (int j = 0; j < values.length - i; j++) {\n if (values[j] > values[j + 1]) { // current value greater than the next? swap values\n temp = values[j];\n values[j] = values[j + 1];\n values[j + 1] = temp;\n nextPass = true; \n }\n }\n }\n \n return values;\n }", "public static void main(String[] args) {\n // auxIntArr is found in AuxPkg.AuxFuncs\n int[] arr = auxIntArr.clone();\n\n System.out.println(\"BubbleSort:\");\n System.out.print(\"Before: \");\n printIntArr(arr);\n\n // Main loop where the index will grow smaller as the array gets sorted\n for( int lastUnsortedIdx = arr.length -1;\n lastUnsortedIdx > 0;\n lastUnsortedIdx--)\n {\n // Nested loop for bubbling highest values to the next sorted slot\n // in the main loop\n for(int idx = 0; idx < lastUnsortedIdx; idx++)\n {\n if(arr[idx] > arr[idx+1])\n {\n swap(arr, idx, idx+1);\n }\n }\n }\n\n System.out.print(\"After: \");\n printIntArr(arr);\n System.out.println();\n }", "public void sort() {\n\t\t\tfor (int j = nowLength - 1; j > 1; j--) {\n\t\t\t\tfor (int i = 0; i < j; i++) {\n\t\t\t\t\tif (ray[i] > ray[i+1]) {\n\t\t\t\t\t\tint tmp = ray [i];\n\t\t\t\t\t\tray[i] = ray[i+1];\n\t\t\t\t\t\tray[i+1] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tprint();\n\t\t\t}\n\t}", "private static void allSorts(int[] array) {\n\t\tSystem.out.printf(\"%12d\",array.length);\n\t\tint[] temp;\n\t\tStopWatch1 timer;\n\t\t\n\t\t//Performs bubble sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.bubbleSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\t\tfourSorts(array);\n\t\tSystem.out.println();\n\t}", "@SuppressWarnings(\"static-access\")\r\n\t@Test\r\n\tpublic void testbubbleSort_Sorted() {\r\n\t\tItem[] input = new Item[]{new Item(2),new Item(9),new Item(12),new Item(41),new Item(55)};\r\n\t\tobj.bubbleSort(input);\r\n\t\tassertTrue(expected[1].key == input[1].key);\r\n\t\tassertTrue(expected[2].key == input[2].key);\r\n\t\tassertTrue(expected[3].key == input[3].key);\r\n\t\tassertTrue(expected[4].key == input[4].key);\r\n\t}", "public void bubbleSort(int [] intArray)\n {\n int n = intArray.length;\n int temp = 0;\n try\n {\n for(int i=0; i < n; i++)\n {\n thread.sleep(100); //sleep the thread to particular to view the results in panel\n this.setThreadState();\n for(int j=1; j < (n-i); j++)\n { \n if(!orderPanel) //check for Descending order\n {\n if(intArray[j-1] > intArray[j])\n {\n //swap the elements!\n temp = intArray[j-1];\n intArray[j-1] = intArray[j];\n intArray[j] = temp;\n repaint();\n \n \n }\n }\n else if(intArray[j-1] < intArray[j]) //check for Ascending order\n {\n temp = intArray[j-1]; \n intArray[j-1] = intArray[j];\n intArray[j] = temp;\n repaint();\n \n }\n \n }\n }\n }\n catch(Exception e)\n {\n System.out.println(\"Exception occured\" + e);\n }\n }", "@Override\n public <T extends Comparable<T>> T[] sort(T[] arr) {\n for (int i=1 ; i<arr.length ; i++) {\n\n T card = arr[i];\n int j = i - 1;\n \n //Kucuk degeri sola kaydirma\n while (j >= 0 && Sort.less(card, arr[j])) {\n arr[j + 1] = arr[j];\n j--;\n }\n arr[j + 1] = card;\n }\n return arr;\n }", "private static Integer[] optimisedBubbleSort(Integer[] n) {\n int len = n.length - 1;\n boolean swapped = false;\n for (int i = 0; i < len; i++) {\n for (int j = 0; j < len - i; j++) {\n if (n[j] > n[j + 1]) {\n int temp = n[j];\n n[j] = n[j + 1];\n n[j + 1] = temp;\n swapped = true;\n }\n }\n if(swapped == false) {\n break;\n }\n }\n return n;\n }", "private void sorter(int[] array){\r\n\r\n for (int i = 0; i < array.length-1; i++)\r\n for (int j = 0; j < array.length-i-1; j++)\r\n if (array[j] > array[j+1])\r\n {\r\n int temp = array[j];\r\n array[j] = array[j+1];\r\n array[j+1] = temp;\r\n }\r\n }", "public static void sort(int[] arr){\n\n for(int i=1;i<arr.length;i++){\n int current=arr[i];\n int j=i-1;\n\n while(j>=0 && arr[j]>current){\n arr[j+1]=arr[j];\n j--;\n }\n\n arr[j+1]=current;\n }\n\n\n\n }", "public static void bubbleSort(String [] list1)\r\n\t{\r\n\t\t\r\n\t String temp;\r\n\t int swap=1000;\r\n\t while(swap>0) \r\n\t {\r\n\t \tswap=0;\r\n\t \tfor(int outside=0; outside<list1.length-1; outside++)\r\n\t \t{\r\n\t \t\tif(list1[outside+1].compareTo(list1[outside])<0)\r\n\t \t\t{\r\n\t \t\t\tswap++;\r\n\t \t\t\ttemp=list1[outside];\r\n\t \t\t\tlist1[outside]=list1[outside+1];\r\n\t \t\t\tlist1[outside+1]=temp;\r\n\t \t\t}\r\n\t \t}\r\n\t }\r\n\t \r\n\t}", "public static int[] bubbleSort(int[] arr, int n){\n for(int j=1; j<n; j++) {\n for (int i = 1; i < n; i++) {\n if (arr[i - 1] > arr[i]) {\n int temp = arr[i - 1];\n arr[i - 1] = arr[i];\n arr[i] = temp;\n }\n }\n }\n return arr;\n }", "@Override\n public void sort(int[] array) {\n for (int i = 0; i < array.length - 1; ++i) {\n for (int j = i + 1; j < array.length; ++j) {\n if (array[i] > array[j]) {\n int tmp = array[i];\n array[i] = array[j];\n array[j] = tmp;\n }\n }\n }\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tSystem.out.println(\"Bubble Sort\");\r\n\t\tint[] arr1 = {8,3,2,1,4,6,5,7};\r\n\t\tSystem.out.println(Arrays.toString(arr1));\r\n\t\tBubble.sort(arr1);\r\n\t\tSystem.out.println(Arrays.toString(arr1));\r\n\t\t\r\n\t\tSystem.out.println(\"Select Sort\");\r\n\t\tint[] arr2 = {8,3,2,1,4,6,5,7};\r\n\t\tSystem.out.println(Arrays.toString(arr2));\r\n\t\tSelect.sort(arr2);\r\n\t\tSystem.out.println(Arrays.toString(arr2));\r\n\t\t\r\n\t\tSystem.out.println(\"Insert Sort\");\r\n\t\tint[] arr3 = {8,3,2,1,4,6,5,7};\r\n\t\tSystem.out.println(Arrays.toString(arr3));\r\n\t\tInsert.sort(arr3);\r\n\t\tSystem.out.println(Arrays.toString(arr3));\r\n\t\t\r\n\t\tSystem.out.println(\"Quick Sort\");\r\n\t\tint[] arr4 = {8,3,2,1,4,6,5,7};\r\n\t\tSystem.out.println(Arrays.toString(arr4));\r\n\t\tQuickSort.sort(arr4, 0, arr4.length-1);\r\n\t\tSystem.out.println(Arrays.toString(arr4));\r\n\t\t\r\n\t\tbyte b = -127;\r\n\t\tb = (byte) (b << 1);\r\n\t\tSystem.out.println(b);\r\n\t}", "public void bubbleSort(ArrayList <Comparable> list){\r\n\t\tsteps += 2; //init, check condition\r\n\t\tfor (int i = list.size() - 1; i >= 0; i --){\r\n\t\t\tsteps += 2; //init, check condition\r\n\t\t\tfor (int j = 0; j < i ; j ++){\r\n\t\t\t\tsteps += 5;\r\n\t\t\t\tif (list.get(j).compareTo(list.get(j + 1)) < 0){\r\n\t\t\t\t\tsteps += 2;\r\n\t\t\t\t\tswap(list, j, j + 1);\r\n\t\t\t\t\tsteps += 5;\r\n\t\t\t\t}\r\n\t\t\t\tsteps += 2;\r\n\t\t\t}\r\n\t\t\tsteps += 2;\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Bubble Sort\");\r\n\t\tSystem.out.println();\r\n\t}", "public static void sort(int[] arr){\n\t\tint temp;\n\t\tfor(int i=0; i<arr.length; i++){\n\t\t\tfor(int j=1; j<arr.length-i; j++)\n\t\t\tif(arr[j-1] > arr[j]){\n\t\t\t\ttemp = arr[j-1];\n\t\t\t\tarr[j-1] = arr[j];\n\t\t\t\tarr[j] = temp;\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "static void sort(int[] a)\n {\n for ( int j = 1; j<a.length; j++)\n {\n int i = j - 1;\n while(i>=0 && a[i]>a[i+1])\n {\n int temp = a[i];\n a[i] = a[i+1];\n a[i+1] = temp;\n i--;\n }\n }\n }", "public void sort(int array[]){\n for(int i=1;i < array.length;i++){\n int j=i-1;\n int cur=i;\n while(array[cur] < array[j] && j >=0 ){\n swap(array,cur,j);\n cur--;\n j--;\n }\n\n }\n }", "public String[] bubbleSortString(String[] input){\r\n\t\tString temp=\"\";\r\n\t\tfor(int i=0;i<input.length;i++){\r\n\t\t\tfor(int j=i+1;j<input.length;j++){\r\n\t if(input[i].compareTo(input[j])>0){\r\n\t \t temp=input[i];\r\n\t \t input[i]=input[j];\r\n\t \t input[j]=temp;\r\n\t }\r\n\t\t\t}\r\n\t\t}return input;\r\n\t}", "void bubblesort(int arr[],int n)\n {\n for(int i=0;i<n;i++)\n {\n for(int j=0;j<n-1;j++) //after its 1st iteration we have our maximum value sorted\n {\n if(arr[j]>arr[j+1]) // if value at present index is > the next index value then its swap the value \n {\n int temp=arr[j];\n arr[j]=arr[j+1];\n arr[j+1]=temp;\n }\n }\n }\n }", "public void sort() {\n\t\tdivider(0, array.size() - 1);\n\t}", "public T[] sort (T[] array) {\r\n\t\tHeapSet<T> heap = new HeapSet<T> (new ArrayList<T> (_list), _listeners);\r\n\t\tint start = 0;\r\n\t\tfor (++start; start <= heap.size () - 2; ++start) {\r\n\t\t\tsiftUp (heap, start);\r\n\t\t}\r\n\t\tfor (int end = heap.size () - 1; end > 0; --end) {\r\n\t\t\tCollections.swap (heap._list, 0, end);\r\n\t\t\tHeapSet.fireEvent (heap, 0, end);\r\n\t\t\tsiftDown (heap, 0, end);\r\n\t\t}\r\n\t\treturn heap.toArray (array);\r\n\t}", "@Override\n\tpublic void sort(T[] nums) {\n\t\tsort(nums,0,nums.length - 1);\n\t}", "public static void main(String[] args) {\n\t\tint[] sortArray = new int[] {1,-5,10,2,8};\r\n\t\tBubbleSort.sort(sortArray);\r\n\t\tfor(int elm:sortArray){\r\n\t\t\tSystem.out.println(\"Sorted Array \"+elm);\r\n\t\t}\r\n\r\n\r\n\t}", "@Override\n protected void runAlgorithm() {\n for (int i = 0; i < getArray().length; i++) {\n for (int j = i + 1; j < getArray().length; j++) {\n if (applySortingOperator(getValue(j), getValue(i))) {\n swap(i, j);\n }\n }\n }\n }", "public void bubbleSort(ArrayList<Pokemon> p);", "@Override\r\n\tpublic void sortDESC(int[] array) {\n\t\tfor (int i = 0; i < array.length; i++) {\r\n\t\t\tfor (int j = i + 1; j < array.length; j++) {\r\n\t\t\t\t\r\n\t\t\t\tif (array[i] < array[j]) {\r\n\t\t\t\t\tint temp = array[i];\r\n\t\t\t\t\tarray[i] = array[j];\r\n\t\t\t\t\tarray[j] = temp;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void bubbleSort(int[] src) {\n if (src == null || src.length <= 1) return;\n\n for (int i = 0; i < src.length; ++i) {\n boolean flag = false;\n for (int j = 0; j < src.length - i - 1; ++j) {\n if (src[j] > src[j + 1]) {\n Utils.swap(src, j, j + 1);\n flag = true;\n }\n }\n\n if (!flag) return;\n }\n }", "public static void bubbleSort(int arr[], int n)\n {\n for (int i = 0; i < n - 1; i++) { \n\t\t\tfor (int j = 0; j < n - i - 1; j++) { \n\t\t\t\tif (arr[j] > arr[j + 1]) { \n\t\t\t\t\tint temp = arr[j]; \n\t\t\t\t\tarr[j] = arr[j + 1]; \n\t\t\t\t\tarr[j + 1] = temp; \n\t\t\t\t} \n\t\t\t} \n\t\t} \n }", "private void sort(int[] arrayToSort) {\n\n output.printUnsortedArray(arrayToSort);\n // loop through all numbers in the range 0 to the length of the array\n for (int i = 0; i < arrayToSort.length - 1; i++) {\n // loop through all numbers in the range 0 to the length of the array\n for (int j = 0; j < arrayToSort.length - 1; j++) {\n int current = j;\n int next = j + 1;\n boolean swap = false;\n // check if the last number in the array is greater than the current number\n if (arrayToSort[current] > arrayToSort[next]) {\n // swap the two numbers\n int temp = arrayToSort[current];\n arrayToSort[current] = arrayToSort[next];\n arrayToSort[next] = temp;\n swap = true;\n }\n output.printPass(i, current, next, arrayToSort, swap);\n }\n output.printUpdatedArray(arrayToSort, i);\n }\n output.printSortedArray(arrayToSort);\n }", "public void mergeSort() {\n this.array = mergeSort(array);\n }", "public static void main(String[] args) {\r\n\t\tint arr[] = {1,0,5,6,3,2,3,7,9,8,4};\r\n\t\tint temp;\r\n\t\t\r\n\t\tfor(int i = 0; i < 10; i ++) {\r\n\t\t\tfor(int j = 0; j < 10 - i; j ++) {\r\n\t\t\t\tif(arr[j] > arr[j+1]){\r\n\t\t\t\t\ttemp = arr[j+1];\r\n\t\t\t\t\tarr[j+1] = arr[j];\r\n\t\t\t\t\tarr[j] = temp;\r\n\t\t\t\t}\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < 11; i ++) {\r\n\t\t\tSystem.out.println(arr[i]);\r\n\t\t}\r\n\t}", "private static Planet[] bubbleSort(Planet ar[], Planet p) {\n for (int i = (ar.length - 1); i >= 0; i--) {\n for (int j = 1; j <= i; j++) {\n if (ar[j - 1].calculateDistance(p) > ar[j].calculateDistance(p)) {\n Planet temp = ar[j - 1];\n ar[j - 1] = ar[j];\n ar[j] = temp;\n }\n }\n }\n /*\n * System.out.println(\"Bubble-Sorted Planets:\"); for (Planet pl: ar) {\n * int dist = (int)pl.calculateDistance(p); System.out.println(\"Dist: \"\n * + dist); System.out.println(pl); }\n */\n return ar;\n }", "@Override\n\tpublic T[] sort(T[] input) {\n\t\tfor(int i = 1; i < input.length; i++){\n\t\t\t//compare with the previous one, if smaller, switch with it.\n\t\t\tfor(int j = i; j > 0 && input[j-1].compareTo( input[j]) > 0; j--){\n\t\t\t\t//add the condition input[j-1] > input[j] in the for loop;\n\t\t\t\t//cause if j-1th < jth, j-2th < jth(left part is ordered)\n\t\t\t\tswap(input, j, j-1);\n\t\t\t}\n\t\t}\n\t\treturn input;\n\t}", "private static void BubbleIterMod(int[] arr) {\n\t\t\n\t\tboolean pass = true;\n\t while (pass) {\n\t pass = false; //assume this is last pass over array\n\t for (int j=0; j<arr.length-1; ++j) {\n\t if (arr[j] > arr[j+1]) { \n\t \tswap(arr, j);\n\t \tpass = true; //after an exchange, must look again\n\t }\n\t }\n\t }\n\t}", "@Test\n public void testReverseOrderSort() {\n BubbleSort<Integer> testing = new BubbleSort<>();\n\n testing.sort(array, new Comparator<Integer>() {\n @Override\n public int compare(Integer i1, Integer i2) {\n return i2.compareTo(i1);\n }\n });\n\n checkReverseOrder(\"Bubble sort doesn't work with other comparator!\", array);\n }", "@Override\n\tvoid sort(int[] arr, SortingVisualizer display) {\n\t\tint current = 0;\n\t\tint x;\n\t\tint y;\n\t\tboolean complete = false;\n\t\twhile(complete == false) {\n\t\t\tcurrent = 0;\n\t\t\tcomplete = true;\n\t\t\tfor(int i = 0 ; i < arr.length; i ++) {\n\t\t\t\tdisplay.updateDisplay();\n\t\t\t\tif(arr[current] > arr[i]) {\n\t\t\t\t\tx = arr[i];\n\t\t\t\t\ty = arr[current];\n\t\t\t\t\tarr[i] = y;\n\t\t\t\t\tarr[current] = x;\n\t\t\t\t\tcomplete = false;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\tcurrent = i;\n\t\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "public static void main(String[] args) {\n \n int swap = 0;\n \n Scanner scan = new Scanner(System.in);\n System.out.print(\"Kaç elemanlı = \");\n int max = scan.nextInt();\n\n int[] toSortArray = new int[max];\n\n toSortArray[0] = 0;\n\n for (int i = 1; i < max; i++) {\n\n toSortArray[i] = (int) (Math.random() * 100);\n toSortArray[0]++; //holds the number of values in the array;\n\n int index = i;\n\n while (toSortArray[index / 2] < toSortArray[index] && (index / 2) != 0) {\n\n int temp = toSortArray[index / 2];\n toSortArray[index / 2] = toSortArray[index];\n toSortArray[index] = temp;\n index = index / 2;\n\n }\n\n\t\t\t//Hence the heap is created!\n }\n\n System.out.println(\"The array to be sorted is:\");\n\n for (int i = 0; i < max; i++) {\n\n System.out.print(\" | \" + toSortArray[i]);\n\n }\n\n System.out.println(\" | \");\n\n\t\t//Start\n\t\t//Let's Sort it out now!\n while (toSortArray[0] > 0) {\n\n int temp = toSortArray[1];\n toSortArray[1] = toSortArray[toSortArray[0]];\n toSortArray[toSortArray[0]] = temp;\n\n for (int i = 1; i < toSortArray[0]; i++) {\n\n int index = i;\n\n while (toSortArray[index / 2] < toSortArray[index] && (index / 2) != 0) {\n\n int temp1 = toSortArray[index / 2];\n toSortArray[index / 2] = toSortArray[index];\n toSortArray[index] = temp1;\n index = index / 2;\n swap = swap+1;\n\n }\n\n }\n\n toSortArray[0]--;\n\n }\n\n\t\t//End\n System.out.println(\"The sorted array is: \");\n\n for (int i = 0; i < max; i++) {\n\n System.out.print(\" | \" + toSortArray[i]);\n }\n\n System.out.println(\" | \");\n System.out.println(max + \" eleman için \"+ swap + \" adet eleman yerdeğiştirildi. \" );\n\n }", "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 recursiveBubbleSort(int[] numbers) {\n boolean sorted = false;\n int posA;\n int posB;\n\n for(int i = 0; i < numbers.length - 1; i++) {\n if(numbers[i] > numbers[i + 1] && numbers[i] != numbers.length) {\n posA = numbers[i];\n posB = numbers[i + 1];\n numbers[i] = posB;\n numbers[i + 1] = posA;\n sorted = true;\n }\n }\n if (sorted) {\n recursiveBubbleSort(numbers);\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 static int[] sortBubble(int[] tab) {\n boolean estTrie = false;\n while(!estTrie) {\n estTrie = true;\n \n for(int k=0; k < tab.length-1; k++) {\n if(tab[k] > tab[k+1]) {\n echanger(tab, k, k+1);\n estTrie = false;\n }\n }\n }\n return tab;\n }", "@Override\n public int[] sort(int[] array) {\n\n int n = array.length;\n\n for (int i = 1; i <= n - 1; i++) {\n int j = i - 1;\n\n while (j >= 0 && array[j] > array[j + 1]) {\n swap(array, j, j + 1);\n j--;\n }\n }\n\n return array;\n }", "public void bubbleSort(int start, int stop) {\n\t\tfor (int n = stop; n > start + 1; n--) {\n\t\t\tfor (int i = start; i < n; i++) {\n\t\t\t\taddComparison();\n\t\t\t\tif (sequence[i] > sequence[i + 1]) {\n\t\t\t\t\tswapAt(i, i + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic void sort(int[] demo) {\n\t\tint temp;\r\n\t\tfor(int gap = 5;gap > 0;gap /= 2){\r\n\t\t\tfor(int i = gap;i < demo.length;i++){\r\n\t\t\t\tfor(int j = i - gap;j >= 0;j -= gap){\r\n\t\t\t\t\tif (demo[j] > demo[j + gap]) {\r\n\t\t\t\t\t\ttemp =demo[j];\r\n\t\t\t\t\t\tdemo[j] =demo[j + gap];\r\n\t\t\t\t\t\tdemo[j + gap] = temp;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(Arrays.toString(demo));\r\n\t}", "@Test\n public void testPrueba1(){\n \n System.out.println(\"Prueba 1\");\n int[] input = new int[]{1, 2, 3, 5, 4};\n int[] expectedResult = new int[]{1, 2, 3, 4, 5};\n int[] actualResult = BubbleSort.sortBasic(input);\n assertArrayEquals(expectedResult, actualResult);\n \n }", "@Override\n\tpublic void sort(int[] array) {\n\n\t}", "public void jsort() {\n\tArrays.sort(data);\n }" ]
[ "0.8332054", "0.8211548", "0.7853043", "0.772414", "0.7704909", "0.7658165", "0.7606062", "0.7598816", "0.7591859", "0.7585766", "0.757032", "0.7523012", "0.7510214", "0.74936545", "0.7471898", "0.746424", "0.7457841", "0.74410856", "0.74227154", "0.74198246", "0.7419017", "0.7359193", "0.7347465", "0.7340273", "0.73275805", "0.7326511", "0.7294808", "0.72919524", "0.72296876", "0.72118187", "0.7196475", "0.71841043", "0.71809196", "0.71740437", "0.716469", "0.716297", "0.7155033", "0.70983225", "0.70981336", "0.70891654", "0.70749944", "0.704627", "0.7042048", "0.70268", "0.69824487", "0.69773585", "0.69773126", "0.69739115", "0.6965584", "0.6944765", "0.69342756", "0.69191325", "0.6888696", "0.6886776", "0.6877445", "0.6856481", "0.6856322", "0.6836916", "0.6819805", "0.6805099", "0.6803889", "0.68016106", "0.67903286", "0.67829627", "0.6764995", "0.6764372", "0.67626625", "0.6762624", "0.6759225", "0.67580646", "0.67555624", "0.6751927", "0.6742655", "0.6737163", "0.6726633", "0.67248696", "0.67109525", "0.67082894", "0.67061096", "0.66811574", "0.66753066", "0.6674985", "0.66712314", "0.66672057", "0.6664836", "0.66526616", "0.66450375", "0.6639429", "0.6630135", "0.6627189", "0.6626311", "0.6616547", "0.65980613", "0.6596713", "0.6595862", "0.65817976", "0.6579027", "0.65726477", "0.6560874", "0.65442514" ]
0.67948395
62
This method will print the arraylist in console
private void showArray(ArrayList<String[]> arr) { for(String[] row: arr){ for(String x: row){ System.out.print(x + "\t\t"); } System.out.println(); } System.out.println("------------------------------------"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void print()\n {\n for (int i=0; i<list.length; i++)\n System.out.println(i + \":\\t\" + list[i]);\n }", "private void displayArrays(ArrayList list){}", "public void printData(){\n for(int i=0; i<list.size(); i++){\n System.out.print(list.get(i) + \" \");\n }\n System.out.println();\n }", "private static void displayList(ArrayList list) {\n System.out.println(\"The list contains \" + list.getCurrentSize()\n + \" string(s), as follows:\");\n Object[] listArray = list.toArray();\n for (int index = 0; index < listArray.length; index++) {\n System.out.print(listArray[index] + \" \");\n } // end for\n System.out.println();\n }", "void printList();", "public static void printList(ArrayList list) {\n String output = \"[ \";\n for (int i = 0; i < list.size(); i++) {\n if (i != 0) {\n output += \", \" + list.get(i);\n }\n else {\n output += list.get(i);\n }\n }\n output += \" ]\";\n System.out.println(output);\n }", "private void printArrayList(ArrayList<String> printThis) {\n for(int i = 0; i < printThis.size(); i++) {\n System.out.print(printThis.get(i) + \"\\t\");\n }\n\n }", "public void printList(){\n System.out.println(\"Printing the list\");\n for(int i = 0; i<adjacentcyList.length;i++){\n System.out.println(adjacentcyList[i].value);\n }\n }", "public String toString()\n\t{\n\t\tSystem.out.print(\"Array list contains: [ \");\n\t\tfor(int i=0; i<size; i++)\n\t\t\tSystem.out.print(myArray[i]+ \", \");\n\t\treturn\" ]\";\n\t}", "public static void main(String[] args) {\n ArrayList<Integer> items = new ArrayList<>();\n items.add(1);\n items.add(2);\n items.add(3);\n items.add(4);\n items.add(5);\n items.add(6);\n items.add(7);\n items.add(8);\n\n\n printArray(items);\n }", "public void print()\n\t{\n\t\tStringBuffer print = new StringBuffer();\n\t\tif (arraySize != 0)\n\t\t{\n\t\t\tfor (int index = 0; index < arraySize - 1; index++) \n\t\t\t{ \n\t\t\t\tprint.append(array[index] + \", \");\n\t\t\t}\n\t\t\tprint.append(array[arraySize - 1]);\n\t\t\tSystem.out.println(print.toString());\n\t\t}\n\t}", "static void print(List list)\r\n\t{\n\t\tfor(int i= 0; i < list.size(); i++){\r\n\t\t\tSystem.out.println(list.get(i));\r\n\t\t}\r\n\t}", "private static void listFormat() {\n\t\tSystem.out.println(\"List of all your movies\");\n\t\tSystem.out.println(\"=======================\");\n\t\tfor (int i = 0; i < movList.size(); i++) {\n\t\t\tSystem.out.println(movList.get(i));\n\t\t}\n\t}", "public static <E> void showArrayList(ArrayList<E> arr)\n {\n System.out.println(\"...........................................\");\n\n for (int i = 0; i < arr.size(); i++)\n {\n System.out.format(\"\\nElement #%d = [%s]%n\", i, arr.get(i).toString());\n } //for\n\n System.out.println();\n\n\n }", "private void showArray() {\n\t\tSystem.out.println(Arrays.toString(this.array));\n\n\t}", "public void print(){\n\t\tfor (int i=0; i<_size; i++){\n\t\t\tSystem.out.print(_a[i].getKey()+\"; \");\n\t\t}\n\t\tSystem.out.println();\n\t}", "public static void listToPrint() {\r\n for (int i = 0; i < ListeElem.size(); i++) {\r\n ListeElem.get(i).toPrint();\r\n }\r\n\r\n }", "public void print() {\r\n\t\tSystem.out.print(\"|\");\r\n\t\t//loop executes until all elements of the list are printed\r\n\t\tfor (int i=0;i<capacity;i++) {\r\n\t\t\tSystem.out.print(list[i]+\" |\");\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "public static void printList(){\n ui.showToUser(ui.DIVIDER, \"Here are the tasks in your list:\");\n for (int i=0; i<Tasks.size(); ++i){\n Task task = Tasks.get(i);\n Integer taskNumber = i+1;\n ui.showToUser(taskNumber + \".\" + task.toString());\n }\n ui.showToUser(ui.DIVIDER);\n }", "public void printList()\n {\n tasks.forEach(task -> System.out.println(task.getDetails()));\n }", "public void display()\n {\n for (int i = 0; i < length; i++)\n {\n System.out.print(list[i] + \" \");\n }\n\n System.out.println();\n }", "void printArray(CatalogueItem arr[])\r\n {\r\n int n = arr.length;\r\n for (int i=0; i<n; ++i)\r\n System.out.print(\r\n \"id: \" + arr[i].getItemId() + \" \"\r\n + \"name: \" + arr[i].getItemName() + \" \"\r\n + \"category: \" + arr[i].getCategory() + \"\\n\");\r\n System.out.println();\r\n System.out.println();\r\n }", "public void print(){\n\t\tif(isEmpty()) System.out.println(\"[vazio]\");\n\t\telse{\n\t\t\tSystem.out.print(\"A = [\" + A[0]);\n\t\t\tfor(int i=1; i<size; i++)\n\t\t\t\tSystem.out.print(\", \"+ A[i]);\n\t\t\tSystem.out.println(\"]\");\n\t\t}\n\t}", "private void printArrayList(ArrayList<String> x) {\n String line = \"\";\n for (String word : x) {\n line += word + \" \";\n }\n System.out.println(\"'\" + line.substring(0,line.length()-1) + \"'\\n\");\n }", "public void printList(){\n myList.forEach(System.out::println);\n }", "private static void printArray(ArrayList<Integer> list) {\n for (int i : list) {\n System.out.println(i * 3);\n }\n\n }", "public static void printList(List l)\r\n\t{\r\n\t\tSystem.out.print(\"[\");\r\n\t\tif(l.size()>0)\r\n\t\t{\r\n\t\t\tfor(int i = 0; i < l.size()-1; i++)\r\n\t\t\t\tSystem.out.print(l.get(i) + \", \");\r\n\t\t\tSystem.out.print(l.get(l.size()-1));\r\n\t\t}\r\n\t\tSystem.out.print(\"]\\n\");\r\n\t\t\r\n\t}", "public void print() {\n System.out.println(\"**List of books in the library.\");\n for (Book b : books){\n if(b != null) {\n System.out.println(b);\n }\n }\n System.out.println(\"**End of list\");\n }", "private void displayArray() {\r\n System.out.println(\"CEK ARRAY : \");\r\n for (i = 0; i < array.length; i++) {\r\n System.out.print(array[i]+\",\");\r\n }\r\n }", "public String toString()\n {\n String s = \"\";\n for (int i=0; i<list.length; i++)\n s += i + \":\\t\" + list[i] + \"\\n\";\n return s;\n }", "public void print() {\r\n\t\tint size = list.size();\r\n\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"┌───────────────────────────┐\");\r\n\t\tSystem.out.println(\"│ \t\t\t성적 출력 \t\t │\");\r\n\t\tSystem.out.println(\"└───────────────────────────┘\");\r\n\r\n\t\tfor (int i = 0; i < size; i++) {\r\n\r\n\t\t\tExam exam = list.get(i);\r\n\t\t\tint kor = exam.getKor();\r\n\t\t\tint eng = exam.getEng();\r\n\t\t\tint math = exam.getMath();\r\n\r\n\t\t\tint total = exam.total();// kor + eng + math;\r\n\t\t\tfloat avg = exam.avg();// total / 3.0f;\r\n\t\t\tSystem.out.printf(\"성적%d > 국어:%d, 영어:%d, 수학:%d\", i + 1, kor, eng, math);\r\n\t\t\tonPrint(exam);\r\n\t\t\tSystem.out.printf(\"총점:%d, 평균:%.4f\\n\", total, avg);\r\n\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"─────────────────────────────\");\r\n\r\n\t}", "public void printFormatedList()\r\n{\r\n System.out.println(\"[\");\r\n for(int i = 0; i < JustifiedList.size(); i++)\r\n {\r\n System.out.println(\"\\\"\" + JustifiedList.get(i) + \"\\\"\");\r\n }\r\n System.out.println(\"]\");\r\n}", "public void display() {\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tSystem.out.print(a[i] + \"\\t\");\n\t\t}\n\t\tSystem.out.println();\n\t}", "public void print() {\n\t\tif (cs213.isEmpty()) {\n\t\t\tSystem.out.println(\"List is empty!\");\n\t\t\treturn;\n\t\t}\n\t\telse {\n\t\t\tcs213.print();\n\t\t}\n\t\treturn;\n\t\t}", "public void printItems();", "public void print() {\n for (int i = 0; i < size; i++)\n System.out.print(elements[i] + \" \");\n System.out.println();\n }", "public static void printItems(ArrayList<Integer>[] items)\n\t{\n\t\tSystem.out.println(\"Starting Items:\");\n\t\tfor(int i = 0; i < items.length; i++)\n\t\t{\n\t\t\tSystem.out.print(i + \":\");\n\t\t\tfor(int j = 0; j < items[i].size(); j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(items[i].get(j) + \", \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void printList() {\n\t\t//sort alphabetically\n\t\tCollections.sort(listStr); \n\t\t//cast the array list to a linked list\n\t\tLinkedList<Object> linkedString = new LinkedList<Object>(listStr);\n \t//while there is something in the LinkedList, run following code\n \twhile (linkedString.size() > 0) {\n \t\t//print out the current first in \"queue\" word\n \t\tSystem.out.print(linkedString.get(0) + \" \");\n \t\t//remove the first item in the linked list\n \t \t\tlinkedString.removeFirst();\n \t}\n \t//print out a new blank line for better readability\n \tSystem.out.println(\"\\n\");\n\t}", "public void displayAsList()\n\t{\n\t\tSystem.out.println(\"Printing all vertices\");\n\t\tvertices.show();\n\t}", "public static void printArray(int[] array) {\r\n\t\tSystem.out.print(\"4. All values stored in the array is: \");\r\n\t\tfor (int i = 0; i < myList.length; i++) {\r\n\t\t\tSystem.out.print(myList[i] + \" \");\r\n\t\t}\r\n\t}", "public void display(){\n \tfor(int i=0;i<size;i++){\n \tSystem.out.print(elements[i]+\" \");\n \t}\n\t}", "public void print() {\n for (Entry entry : listentries) {\n System.out.println(\"These are the tasks currently on your lists:\");\n System.out.println(\"Name of Task:\" + entry.getName());\n System.out.println(\"Status:\" + entry.getStatus());\n System.out.println(\"Due Date:\" + entry.getDueDate());\n System.out.println(\"Days Left To do Tasks:\" + entry.getDaysLeft());\n }\n }", "public static void showD(ArrayList<ArrayList<String>> data){\n\t\tfor(int i = 0; i<data.get(0).size(); i++){\r\n\t\t\tfor(int j = 0; j<data.size(); j++){\r\n\t\t\t\tSystem.out.print(data.get(j).get(i));\r\n\t\t\t\tSystem.out.print(\"\\t\");\r\n\t\t\t}\r\n\t\t\tSystem.out.print(\"\\n\");\r\n\t\t}\r\n\t\treturn;\r\n\t}", "@Override\n public final String toString() {\n final int[] temp = new int[size];\n for (int i = 0; i < size; i++) {\n temp[i] = arrayList[i];\n }\n return Arrays.toString(temp);\n }", "public void printElements() {\r\n for (int i = 0; i < pageList.size(); i++) {\r\n System.out.println(i + \" : \" + pageList.get(i));\r\n }\r\n }", "public void print() {\r\n \tfor (int i = 0; i < arbres.size(); i++) {\r\n \t\tSystem.out.println(\"Ordre de \" + arbres.get(i).ordre + \":\");\r\n \t\tarbres.get(i).print(\"\");\r\n \t\tSystem.out.println();\r\n \t}\r\n }", "public void printAnswerList(){\n if(answerList.isEmpty()){\n System.out.println(\"Answer list is empty.\");\n }\n else {\n for (int i = 1; i < answerList.size() + 1; i++) {\n System.out.println(i + \") \" + answerList.get(i - 1));\n }\n }\n }", "@Override\n public String toString()\n {\n StringBuilder builder = new StringBuilder();\n builder.append('[');\n for (Object item : list)\n {\n builder.append(item.toString());\n builder.append(\", \");\n }\n builder.append(']');\n return builder.toString();\n }", "public void print()\n {\n System.out.println(name + \"\\n\");\n for(int iterator = 0; iterator < bookList.size() ; iterator++)\n {\n System.out.println((iterator+1) +\". \" + bookList.get(iterator).getTitle()+\" by \" +bookList.get(iterator).getAuthor()); \n }\n }", "private static void show(Comparable[] a) {\n for (int i = 0; i < a.length; i++) {\n System.out.printf(\"a[%d] = %s\\n\", i + 1, a[i].toString());\n }\n System.out.println();\n }", "public void printStudentList()\n {\n for(int i = 0; i < students.size(); i++)\n System.out.println( (i + 1) + \". \" + students.get(i).getName());\n }", "public void printArray()\n {\n for (int i=0;i<array.length; i++)\n {\n System.out.print(array[i] + \" \"); \n }\n System.out.println();\n }", "@Override\n public String toString(){\n String result = \"\";\n for(int i = 0; i < numItems; i++){\n result += arr[i] + \" \";\n }\n return result;\n }", "private void printList(ArrayList<String> allSongs) {\n int i=1;\n for(String s : allSongs){\n System.out.println((i++)+\". \"+s);\n }\n }", "public void printAll(){\nfor(int i=0;i<size ;i++){\n System.out.println(\"a[%d]\"+data[i]); \n}\n System.out.println(\"size\"+size); \n}", "public static void main(String[] args) {\n\t List<Integer> al = new ArrayList<>(Arrays.asList(1,2,3,4,5,6,7,8,9,10));\n\t\t//System.out.println(al);\n\t\t\n\t\t\t\n\t\t\t\tSystem.out.println(al);\n\t\t\t\n\t\t\n\t\t\n\t\n\t}", "public static void Output(LinkedList<Integer> list) {\n\t\tfor (int i = 0; i < list.size(); i++) {\n\t\t\tSystem.out.print(list.get(i) + \"\\t\");\n\t\t}\n\t}", "@Override\n public String toString() {\n return list.toString();\n }", "public static void printList(List<?> list) { \n\t for (Object elem: list) \n\t System.out.print(elem + \" \");\n\t System.out.println(); \n\t }", "public static void main(String[] args) {\n\r\n\t\tArrayList<String> l=new ArrayList<>();\r\n\t\tl.add(\"Selenium\");\r\n\t\tl.add(\"Krish\");\r\n\t\tl.add(\"Infosys\");\r\n\t\tl.add(\"Hyderabad\");\r\n\t\t\r\n\t\tSystem.out.println(l.size()); // To print the size of an array\r\n\t\tfor (int i = 0; i < l.size(); i++) {\r\n\t\t\tSystem.out.println(l.get(i)); //To Print the elements in the array\r\n\t\t}\r\n\t}", "@SuppressWarnings({ \"rawtypes\", \"unused\" })\r\n\tprivate void printToConsole(List cellDataList) {\r\n\t\tfor (int i = 0; i < cellDataList.size(); i++) {\r\n\t\t\tList cellTempList = (List) cellDataList.get(i);\r\n\t\t\tfor (int j = 0; j < cellTempList.size(); j++) {\r\n\t\t\t\tHSSFCell hssfCell = (HSSFCell) cellTempList.get(j);\r\n\t\t\t\tString stringCellValue = hssfCell.toString();\r\n\t\t\t\tSystem.out.print(stringCellValue + \"\\t\");\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "public static void printArray(ArrayList<String> temp) {\n for (int i = 0; i < temp.size(); i++) {\n System.out.println(i + \") \" + temp.get(i));\n }\n }", "public static void printContactList()\n {\n if(myList.size() < 1)\n System.out.println(\"~empty list~\");\n else\n {\n System.out.println(\"Current Items\");\n System.out.println(\"-------------\");\n for(int i = 0; i < myList.size(); i++)\n {\n System.out.printf(i+\")\");\n Item itemPrint = myList.get(i);\n itemPrint.printItem(itemPrint.getFirstName(), itemPrint.getLastName(), itemPrint.getPhoneNumber(), itemPrint.getEmail());\n }\n }\n }", "static void printStrList(MyList<String> list) {\n\t\t\n\t\t// PRUEBA IMPLICITA DE iterator() (aunque tambien se prueba en remove() )\n\t\tListIterator<String> iter = list.iterator();\n\t\t\n\t\twhile (iter.hasNext()) {\n\t\t\tSystem.out.print(iter.next() + \", \");\n\t\t}\n\t\tSystem.out.println();\n\t}", "void printList() {\n Entry<T> node = header;\n while(node!=null){\n System.out.print(node.element+\" \");\n node = node.next;\n }\n }", "public ArrayList<String> printList(ArrayList<String> list) {\n ArrayList<String> newList = new ArrayList<String>();\n for(String p: list) {\n newList.add(p);\n }\n return newList;\n }", "public void displayList() {\n\n\t\tIterator<SimplePacket> itr = list.iterator();\n\n\t\twhile(itr.hasNext()) {\n\t\t\tSimplePacket packet = itr.next();\n\t\t\tif(!packet.isValidCheckSum()){\n\t\t\t\tSystem.out.print(\"[\" + packet.getSeq() + \"], \");\n\t\t\t}else{\n\t\t\t\tSystem.out.print(packet.getSeq() + \", \");\n\t\t\t}\n\t\t}\n\t}", "public void printObjectList(){\n\t\tfor (int i = 0; i < gameObjectsList.size(); i++){\n\t\t\tSystem.out.println(i + \", \" + gameObjectsList.get(i).getCategory() + \" : Type:\" + gameObjectsList.get(i).getObjecttype() + \" X:\" + gameObjectsList.get(i).getX() + \" Y:\" + gameObjectsList.get(i).getY());\n\t\t}\n\t}", "public void printQuestionList(){\n if(questionList.isEmpty()) {\n System.out.println(\"Question list is empty.\");\n }\n else{\n for (int i = 1; i < questionList.size()+1; i++) {\n System.out.println(i + \") \" + questionList.get(i - 1));\n }\n }\n\n }", "public static void print(ArrayList<Course> list) {\r\n\r\n\t\tif (list.isEmpty()) {\r\n\t\t\tSystem.out.println(\"Your Course list is empty :( \");\r\n\t\t}\r\n\r\n\t\tfor (Course course : list) {\r\n\t\t\tSystem.out.println(course.numberOfStudents + \" \" + course.courseName + \" \" + course.courseLecturer + \" \");\r\n\t\t}\r\n\t}", "public void printList(List<String> gameList) {\n for (int i = 0; i < gameList.size(); i++) {\n System.out.println(gameList.get(i));\n }\n }", "public void dump() {\n for(Object object : results) {\n System.out.println( object );\n }\n }", "public void printChecklist() {\n\t\tfor(String str : checklist.keySet()) {\n\t\t\tMyUtils.Log(\"[Checklist] \"+str+\", \"+checklist.get(str));\n\t\t}\n\t}", "public void print_list() {\n \t \n \t//define current node as\n \t node<Type> current_node = new node<>();\n \t \n \t //now keep for loop and print the answer\n \t current_node = head;\n \t \n \t //print first element\n \t System.out.println(current_node.show_element());\n \t \n \t //now run for loop\n \t for (int i = 1 ; i <= len - 1 ; i ++) {\n \t\t \n \t\t //change current node\n \t\t current_node = current_node.show_next();\n \t\t \n \t\t //just print the answer\n \t\t System.out.println(current_node.show_element());\n \t }\n }", "private static void printListOfList(ArrayList<ArrayList<Integer>> inputList) {\n\t\tIterator< ArrayList<Integer>> itor = inputList.iterator();\n\t\twhile(itor.hasNext()) {\n\t\t\tArrayList<Integer> current = itor.next();\n\t\t\tIterator<Integer> eleItor = current.iterator();\n\t\t\twhile(eleItor.hasNext()) {\n\t\t\t\tint currentElement = eleItor.next();\n\t\t\t\tSystem.out.print(currentElement + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\t\n\t}", "private static void printList(Student[] students)\r\n {\r\n for(int index = 0; index < students.length; index++)\r\n {\r\n System.out.println(students[index].toString());\r\n }\r\n }", "public void print() {\n\t\tfor (int i = 0; i < TABLE_SIZE; i++) {\n\t\t\tSystem.out.print(\"|\");\n\t\t\tif (array[i] != null) {\n\t\t\t\tSystem.out.print(array[i].value);\n\t\t\t} else {\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.print(\"|\\n\");\n\t}", "public static void main(String[] args)\n\t{\n\t\tArrayList ar=new ArrayList();\n\t\tSystem.out.println(ar.size());\n\t\tar.add(23);\n\t\tar.add(30);\n\t\tar.add(40);\n\t\tSystem.out.println(ar.size());\n\t\t// We can add duplicates values also.\n\t\tar.add(23);\n\t\tar.get(1);\n\t\tSystem.out.println(\"whats the output\"+ar.get(1));\n\t\tSystem.out.println(ar);\n\t\t\n\t\t\n\t\t\n\n\t}", "public void print() {\n for (int i=0; i<lines.size(); i++)\n {\n System.out.println(lines.get(i));\n }\n }", "public String toString() {\n\t\treturn list.toString();\n\t}", "public void print () \r\n\t{\r\n\t\tfor (int index = 0; index < count; index++)\r\n\t\t{\r\n\t\t\tif (index % 5 == 0) // print 5 columns\r\n\t\t\t\tSystem.out.println();\r\n\r\n\t\t\tSystem.out.print(array[index] + \"\\t\");\t// print next element\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "public void printClientList(){\n for(String client : clientList){\n System.out.println(client);\n }\n System.out.println();\n }", "public abstract ArrayList<String[]> toStrings();", "public void printList() {\n\t\tNode tnode = head;\n\t\twhile (tnode != null) {\n\t\t\tSystem.out.print(tnode.data + \"->\");\n\t\t\ttnode = tnode.next;\n\t\t}\n\t}", "public String toString() {\n if (size > 0) {\n String display = \"[\";\n for (int i = 0; i < size - 1; i++) {\n display += list[i] + \",\";\n } display += list[size - 1] + \"]\";\n return display;\n }\n return \"[]\";\n }", "public void listAll(){\n /*\n for(int i=0;i<employeesList.size();i++){\n System.out.println(i);\n Employee employee=(Employee)employeesList.get(i);\n System.out.print(employeesList.get(i));\n */ \n \n \n //for used to traverse employList in order to print all employee's data\n for (int i = 0; i < employeesList.size(); i++) {\n System.out.println(\"Name: \" + employeesList.get(i).getName()); \n System.out.println(\"Salary_complement: \"+employeesList.get(i).getSalary_complement()); \n \n }\n \n \n }", "private static <T> void show(Comparable<T>[] a) {\n\t\tfor(int i=0; i<a.length; i++) \r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\tSystem.out.println();\r\n\t}", "public void print() {\r\n\t\tfor (int i = front; i <= rear; i++) {\r\n\t\t\tSystem.out.print(arr[i].getData() + \"\\t\");\r\n\t\t}\r\n\t}", "public static void show(Comparable[] a) {\n StringBuilder s= new StringBuilder();\n s.append(\"[\");\n for (int i = 0; i < a.length-1; i++) {\n s.append(a[i] + \", \");\n }\n s.append(a[a.length-1] + \"]\\n\");\n System.out.println(s.toString());\n }", "public void displayList (String [] list, int count, String message){\n \n //Print utiliy\n System.out.println(\"\\n\\t\" + message);\n for (int i = 0; i < count; i++){\n System.out.println(\"\\t\" + (i+1) + \"\\t\" + list[i]);\n }//End for loop\n \n }", "@Override\r\n public String toString() {\r\n String output = \"[ \";\r\n for (int i = 0; i < count; i++) {\r\n output += list[i] + \", \";\r\n }\r\n if (count > 0) {\r\n output = output.substring(0, output.length() - 2);\r\n } else {\r\n output = output.substring(0, output.length() - 1);\r\n }\r\n output += \" ]\";\r\n return output;\r\n }", "@Override\n\tpublic void printContent(List<Object> stingList) {\n\t\t\n\t}", "public void print() \r\n\t{\r\n\t\tif(debug)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Debug - Starting print\");\r\n\t\t}\r\n\t\t\r\n\t\tfor (int index = 0; index < count; index++) \r\n\t\t{\r\n\t\t\tif (index % 5 == 0) \r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\r\n\t\t\tif(debug)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"\\nDebug - numArray[index] = \" + numArray[index]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.print(numArray[index] + \"\\t\");\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println();\r\n\t\t\r\n\t\tif(debug)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Debug - Ending print\");\r\n\t\t}\r\n\t}", "public void printAllValues(ArrayList<Object> ar1) {\n\t\tSystem.out.println(\"To print all values: \" + ar1);\n\t}", "private static void printArray(Integer[] a) {\n\t\tfor (int k = 0; k < a.length; k++) {\n\t\t\tSystem.out.print(a[k] + \" \");\n\t\t}\n\t\tSystem.out.println();\n\t}", "public static void showNodeArrayList(ArrayList<Node> arr)\n {\n for (int i = 0; i < arr.size(); i++)\n {\n Node node = arr.get(i);\n System.out.format(\"Element #%d = [%s]%n\", i, node.getNodeID());\n } //for\n\n }", "public static void main(String[] args) {\n\t\tArrayList arl=new ArrayList();\n\t\tarl.add(\"Red\");\n\t\tarl.add(\"Pink\");\n\t\tarl.add(\"Blue\");\n\t\tSystem.out.println(arl);\n\n\t}", "public static void main(String[] args) {\nArrayList<String>mylist =new ArrayList<String>();\r\nmylist.add(\"anu\");\r\nmylist.add(\"ammu\");\r\nmylist.add(\"renu\");\r\nSystem.out.println(mylist);\r\nfor(int i=0;i<3;i++)\r\n{\r\n\tSystem.out.println(i+\"=\" + mylist.get(i));\r\n}\r\n\t}", "public static void printArrays() {\r\n\t\tIterator it = arrayMap.entrySet().iterator();\r\n\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tMap.Entry<Integer, ArrayList<Integer>> pair = (Map.Entry<Integer, ArrayList<Integer>>) it\r\n\t\t\t\t\t.next();\r\n\t\t\tArrayList<Integer> list = pair.getValue();\r\n\t\t\tIterator liter = list.iterator();\r\n\t\t\twhile (liter.hasNext()) {\r\n\t\t\t\tSystem.out.print(liter.next() + \" \");\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "protected static void show(Comparable[] a) {\n\t\t\r\n\t\tString retStr = \"\";\r\n\t\tfor(int i=0 ; i< a.length; i++)\r\n\t\t\tretStr+=\" \"+a[i];\r\n\t\t\r\n\t\tSystem.out.println(retStr);\r\n\t\t\r\n\t}" ]
[ "0.7651011", "0.7648134", "0.75763464", "0.74323744", "0.7379018", "0.7307797", "0.7292304", "0.7219552", "0.717175", "0.71425337", "0.7130579", "0.7126584", "0.70902973", "0.706946", "0.70560765", "0.7012622", "0.7006285", "0.6982291", "0.69728255", "0.6926321", "0.6912511", "0.6876545", "0.6839592", "0.6835141", "0.6833097", "0.68314505", "0.6806229", "0.6792007", "0.6767146", "0.67635334", "0.67215425", "0.67111534", "0.6702425", "0.6697702", "0.6697696", "0.66936153", "0.66935736", "0.66775477", "0.66693765", "0.6635868", "0.66262156", "0.6622435", "0.6616702", "0.66136175", "0.6610993", "0.6608638", "0.6599265", "0.65987796", "0.65809", "0.65675", "0.65666807", "0.65608966", "0.655725", "0.6546609", "0.65308315", "0.65248096", "0.65236807", "0.6517033", "0.65167767", "0.65057874", "0.6503205", "0.64995176", "0.64984304", "0.6495123", "0.64935213", "0.6490676", "0.6488526", "0.6486587", "0.64863133", "0.6473697", "0.64731055", "0.64604926", "0.6447493", "0.6443568", "0.6440259", "0.6439584", "0.6439024", "0.6437169", "0.6409526", "0.64058053", "0.6399115", "0.6398676", "0.6389341", "0.6384884", "0.63652766", "0.63649696", "0.6363797", "0.636139", "0.63592696", "0.6359106", "0.6358335", "0.6356161", "0.63521045", "0.6348721", "0.6347461", "0.6344148", "0.63362676", "0.63349074", "0.633394", "0.63323927" ]
0.7060709
14
This method will update the selected row.
private void toEdit() { int i=jt.getSelectedRow(); if(toCount()==0) { JOptionPane.showMessageDialog(rootPane,"No data has been added to the details"); } else if(i==-1) { JOptionPane.showMessageDialog(rootPane,"No item has been selected for the update"); } else { if(tfPaintId.getText().isEmpty()) { JOptionPane.showMessageDialog(rootPane,"Please! Enter the Paint ID"); } else if(tfName.getText().isEmpty()) { JOptionPane.showMessageDialog(rootPane,"Please! Enter the Product name"); } else if(rwCombo.getSelectedItem().toString().equals("Select")) { JOptionPane.showMessageDialog(rootPane,"Please! Select the raw materials used"); } else if(bCombo.getSelectedItem().toString().equals("Select")) { JOptionPane.showMessageDialog(rootPane,"Please! select the brand you want"); } else if(tfPrice.getText().isEmpty()) { JOptionPane.showMessageDialog(rootPane,"Please! Enter the price"); } else if(tfColor.getText().isEmpty()) { JOptionPane.showMessageDialog(rootPane,"Please! Enter the colour"); } else if(typeCombo.getSelectedItem().toString().equals("Select")) { JOptionPane.showMessageDialog(rootPane,"Select something from paint type"); } else if(getQuality()==null) { JOptionPane.showMessageDialog(rootPane,"Quality is not selected"); } else if(tfQuantity.getText().isEmpty()) { JOptionPane.showMessageDialog(rootPane,"Please! Enter the quantity"); } else { try { jtModel.setValueAt(tfPaintId.getText(),i,0); jtModel.setValueAt(tfName.getText(),i,1); jtModel.setValueAt(Integer.valueOf(tfPrice.getText()),i,2); jtModel.setValueAt(tfColor.getText(),i,3); jtModel.setValueAt(rwCombo.getSelectedItem(),i,4); jtModel.setValueAt(bCombo.getSelectedItem(),i,5); jtModel.setValueAt(typeCombo.getSelectedItem(),i,6); jtModel.setValueAt(getQuality(),i,7); jtModel.setValueAt(Integer.valueOf(tfQuantity.getText()),i,8); JOptionPane.showMessageDialog(rootPane,"Successfully updated the data in details"); toClear(); } catch(Exception ex) { JOptionPane.showMessageDialog(rootPane,"Excepted integer but entered another character at price or quantity."); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void updateSelection() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSystem.out.println(\"btnUpdate\");\n\t\t\t\tint i = table.getSelectedRow();\n\t\t\t\tif (i >= 0) {\n\t\t\t\t\tSystem.out.println(\"row-update-select\" + i);\n\t\t\t\t\tSystem.out.println(\"row-update-supp-id\" + textSuppD.getText());\n\t\t\t\t\tint suppID = Integer.parseInt(textSuppD.getText().trim());\n\t\t\t\t\tString suppName = textSuppName.getText();\n\t\t\t\t\tString suppAddr = textSuppAddr.getText();\n\t\t\t\t\tString suppPhone = textSuppPhone.getText();\n\t\t\t\t\tString suppEmail = textSuppEmail.getText();\n\n\t\t\t\t\tDatabase db = new Database();\n\t\t\t\t\tSuppliersDAO suppDAO = new SuppliersDAO(db);\n\t\t\t\t\tSuppliersModel suppModel = new SuppliersModel();\n\t\t\t\t\tsuppModel.setSuppliers_id(suppID);\n\t\t\t\t\tsuppModel.setName(suppName);\n\t\t\t\t\tsuppModel.setAddress(suppAddr);\n\t\t\t\t\tsuppModel.setPhone(suppPhone);\n\t\t\t\t\tsuppModel.setEmail(suppEmail);\n\n\t\t\t\t\tsuppDAO.Update(suppModel);\n\n\t\t\t\t\tdb.commit();\n\t\t\t\t\tdb.close();\n\n\t\t\t\t\tsetTableGet(i, model);\n\t\t\t\t} else {\n\n\t\t\t\t}\n\t\t\t}", "protected void select() {\n\t\tcleanValues();\n\t\tint row = m_table.getSelectedRow();\n\t\tboolean enabled = row != -1;\n\t\tif (enabled)\n\t\t{\n\t\t\tInteger ID = m_table.getSelectedRowKey();\n\t\t\tif (ID != null)\n\t\t\t{\n\t\t\t\tm_C_Order_ID = ID.intValue();\n\t\t\t}\n\t\t}\n\t\tlog.info(\"ID=\" + m_C_Order_ID); \n\t}", "public void update(int rowSelected, Combustivel c) {\n combs.set(rowSelected, c);\n fireTableRowsUpdated(rowSelected, rowSelected);\n }", "public void update(int rowSelected, Posto p) {\n postos.set(rowSelected, p);\n fireTableRowsUpdated(rowSelected, rowSelected);\n }", "@Action\n public void modifyAction() {\n E rowObject = (E) dataTable.getSelectedRowObject();\n if (rowObject != null) {\n rowObject = (E) rowObject.clone();\n\n if (viewRowState) {\n viewRow(rowObject);\n } else {\n E newRowObject = modifyRow(rowObject);\n if (newRowObject != null) {\n replaceTableObject(newRowObject);\n fireModify(newRowObject);\n }\n }\n }\n }", "@Override\n\tpublic void selectionChanged(ActionEvent e) {\n\t\tif (dm != null && dm.getRowSelected() >= 0) {\n\t\t\trowList.removeListSelectionListener(rowSelectListener); \n\t\t\t// disable listener temporarily to prevent looping.\n\t\t\t\n\t\t\tint row = dm.getRowSelected();\n\t\t\tint column = dm.getColSelected();\n\t\t\trowElements.get(column).requestFocus();\n\t\t\tfor (int i = 0; i < rowElements.size(); i++) {\n\t\t\t\tString value = dm.getValue(i, row);\n\t\t\t\trowElements.get(i).setText(value);\n\t\t\t}\n\t\t\trowList.setSelectedIndex(row);\n\t\t\trowList.addListSelectionListener(rowSelectListener);\n\t\t}\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t\tint RowNum=jt.getSelectedRow();\n\t\t\t\tif(RowNum==-1){\n\t\t\t\t\tJOptionPane.showMessageDialog(jt, \"请选择一行\");\n\t\t\t\t return ;\n\t\t\t }\n\t\t \n\t\t String info=((String)mit.getValueAt(RowNum, 1));\n\t\t \n\t\t\t\tString majorNewIn=JOptionPane.showInputDialog(\"请修改专业\",info);\n\t\t\t\tif(majorNewIn!=null)\n\t\t\t\t{\n\t\t\t\t\tif(!majorNewIn.equals(\"\")){\n\t\t\t\t\t\t\n\t\t\t\t\t\tString majorIdSql=\"select id from majorinfo where majorName='\"+Tool.string2UTF8(info)+\"'\";\n\t\t\t\t\t\tString majorid=SqlModel.getInfo(majorIdSql);\n\t\t\t\t\t\t\n\t\t\t\t\t\tString mclassSql=\"update classinfo set major='\"+Tool.string2UTF8(majorNewIn)+\"' where major='\"+Tool.string2UTF8(info)+\"'\";\n\t\t\t\t\t\tString mjobSql=\"update jobinfo set major='\"+Tool.string2UTF8(majorNewIn)+\"' where major='\"+Tool.string2UTF8(info)+\"'\";\n\t\t\t\t\t\tString mmajorSql=\"update majorinfo set majorName='\"+Tool.string2UTF8(majorNewIn)+\"' where id='\"+majorid+\"'\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tSqlModel.updateInfo(mclassSql);\n\t\t\t\t\t\tSqlModel.updateInfo(mjobSql);\n\t\t\t\t\t\tif(SqlModel.updateInfo(mmajorSql)){\n\t\t\t\t\t\t\trefresh(jt);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"修改失败\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t \n\t\t\t}", "public void editSelectedItem() {\n\t\tfinal ColumnInfo oldinfo = m_view.getSelectedItem();\n\t\tif (oldinfo != null) {\n\t\t\tfinal TableId tableid = m_view.getModel().getTableId();\n\t\t\tfinal TSConnection tsconn = m_view.getModel().getConnection();\n\t\t\tSQLCommandDialog dlg = SQLCommandDialog.createDialog(tsconn, true);\n\t\t\tdlg.setMessage(I18N.getLocalizedMessage(\"Modify Column\"));\n\n\t\t\tModelerFactory factory = ModelerFactory.getFactory(tsconn);\n\t\t\tfinal ColumnPanel panel = factory.createColumnPanel(tsconn, tableid, oldinfo, false);\n\t\t\tdlg.setPrimaryPanel(panel);\n\t\t\tdlg.addValidator(panel);\n\t\t\tdlg.setSize(dlg.getPreferredSize());\n\t\t\tdlg.addDialogListener(new SQLDialogListener() {\n\t\t\t\tpublic boolean cmdOk() throws SQLException {\n\t\t\t\t\tTSTable tablesrv = (TSTable) tsconn.getImplementation(TSTable.COMPONENT_ID);\n\t\t\t\t\tColumnInfo newinfo = panel.getColumnInfo();\n\t\t\t\t\ttablesrv.modifyColumn(tableid, newinfo, oldinfo);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t});\n\t\t\tdlg.showCenter();\n\t\t\tif (dlg.isOk()) {\n\t\t\t\tSystem.out.println(\"AlterColumnsController.editSelected item: \" + tableid);\n\t\t\t\ttsconn.getModel(tableid.getCatalog()).reloadTable(tableid);\n\t\t\t\tm_view.getModel().setTableId(tableid);\n\t\t\t}\n\t\t}\n\t}", "private void editButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editButtonActionPerformed\n try ( Connection con = DbCon.getConnection()) {\n int rowCount = flightsTable.getRowCount();\n selectedRow = flightsTable.getSelectedRow();\n //if row is chosen\n if (selectedRow >= 0) {\n\n PreparedStatement pst = con.prepareStatement(\"update Flights set departure = '\"\n + flightsDftTblMdl.getValueAt(selectedRow, 0)\n + \"', destination = '\"\n + flightsDftTblMdl.getValueAt(selectedRow, 1)\n + \"', depTime = '\"\n + flightsDftTblMdl.getValueAt(selectedRow, 2)\n + \"', arrTime = '\"\n + flightsDftTblMdl.getValueAt(selectedRow, 3)\n + \"', number = '\"\n + flightsDftTblMdl.getValueAt(selectedRow, 4)\n + \"', price = '\"\n + flightsDftTblMdl.getValueAt(selectedRow, 5)\n + \"' where number = '\" + flightsDftTblMdl.getValueAt(selectedRow, 4) + \"'\");\n\n pst.execute();\n initFlightsTable();//refresh the table after edit\n } else {\n JOptionPane.showMessageDialog(null, \"Please select row first\");\n }\n\n } catch (ClassNotFoundException | SQLException ex) {\n Logger.getLogger(CustomerRecords.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n }", "void setRowSelection(int index, String value) {\r\n int val;\r\n try {\r\n val = ( (Integer) nameToIndexMap.get(value)).intValue();\r\n }\r\n catch (Exception e) {\r\n return;\r\n }\r\n ySelections[index] = val;\r\n\r\n // now, for all the plots in this row, update the objectives\r\n for (int i = 0; i < 2; i++) {\r\n plots[index][i].setObjectives(xSelections[i], val);\r\n /////////////////////////////////\r\n plots[index][i].redraw();\r\n /////////////////////////////////\r\n }\r\n fireTableDataChanged();\r\n }", "private void selectedRowInvoice(){\r\n //numOrdenInv = tb_factura.getSelectionModel().getSelectedIndex();\r\n }", "@Override\n public void valueChanged(ListSelectionEvent e) {\n currentRow = recordList.getSelectedIndex();\n setRowValues(currentRow, currentColumn);\n if (selectionAction == WAITING_ON_SELECTION) {\n selectionAction = SENDING_SELECTION;\n }\n if (selectionAction == SENDING_SELECTION) {\n selectionAction = FINISHED_SELECTION;\n cellNotifier.select(currentRow, currentColumn); // Notify GUI to select\n }\n \n \n }", "public void widgetSelected(SelectionEvent e) {\n Control oldEditor = editor.getEditor();\n \n TableItem item = (TableItem) e.item;\n if (item == null) {\n return;\n }\n \n if (oldEditor != null) {\n oldEditor.dispose(); // FIX the focus\n }\n // Identify the selected row\n \n // The control that will be the editor must be a child of the\n // Table\n final Text textNewEditor = new Text(table, SWT.NONE);\n \n textNewEditor.setText(item.getText(EDITABLECOLUMN));\n textNewEditor.addModifyListener(new ModifyListener() {\n public void modifyText(ModifyEvent me) {\n Text text = (Text) editor.getEditor();\n editor.getItem()\n .setText(EDITABLECOLUMN, text.getText());\n }\n });\n \n /*\n * TODO FIX the focus\n */\n textNewEditor.selectAll();\n // newEditor.setFocus();\n editor.setEditor(textNewEditor, item, EDITABLECOLUMN);\n }", "public void setSelectedRow(String s) {\n\t\tuRow = s;\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\teditRow();\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\teditRow();\n\t\t\t}", "private void selectTableRow () {\n int selectedRow = itemTable.getSelectedRow();\n if (selectedRow >= 0 && selectedRow < clubEventList.size()) {\n boolean modOK = modIfChanged();\n if (modOK) {\n position = clubEventList.positionUsingListIndex (selectedRow);\n positionAndDisplay();\n }\n }\n }", "public void widgetSelected(SelectionEvent e) {\n table.setSelection(new TableItem[]{cursor.getRow()});\n }", "private void bomSelected(int selectedRow){\n \tbomDet=new inventorycontroller.function.BillOfMaterialProcessor(dbInterface1)\n \t .getBomDescForPoMaster(jTable1.getModel().getValueAt(selectedRow, 3).toString());\n \t\n \tadjustAddedQty(); //* adjusts the item qty. which are already added.\n \t\n \tjTable2.setModel(new javax.swing.table.DefaultTableModel(\n bomDet,\n new String [] {\n \"Select\", \"Material\", \"Reqd. Quantity\", \"Purchase Requirement\", \"Remark\"\n }\n ) {\n Class[] types = new Class [] {\n \tjava.lang.Boolean.class, \n \tjava.lang.String.class, \n java.lang.Long.class, \n java.lang.Long.class,\n java.lang.String.class\n };\n \n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return columnIndex==0 ? true : false ;\n }\n });\n }", "private void select(int row, int column) {\n \n if (recordList != null && entryForm != null) {\n currentColumn = column;\n if (currentRow != row) {\n currentRow = row;\n recordList.setSelectedIndex(row);\n }\n recordForm.setFocusAt(column);\n }\n \n }", "public native void selectRow(int row) /*-{\n\t\tvar jso = [email protected]::getJsObj()();\n\t\tjso.selectRow(row);\n }-*/;", "public void updateRow() throws SQLException\n {\n m_rs.updateRow();\n }", "private void selectDetailWithMouse() {\n int selectedRowIndex=jt.convertRowIndexToModel(jt.getSelectedRow());\n String[] choices={\"Update Row\",\"Delete\",\"Cancel\"};\n int option=JOptionPane.showOptionDialog(rootPane, \"Product ID: \"+jtModel.getValueAt(selectedRowIndex, 0).toString()+\"\\n\"+\"Product Name: \"+jtModel.getValueAt(selectedRowIndex,1), \"View Data\", WIDTH, HEIGHT,null , choices, NORMAL);\n if(option==0)\n {\n tfPaintId.setText(jtModel.getValueAt(selectedRowIndex,0).toString());\n tfName.setText(jtModel.getValueAt(selectedRowIndex, 1).toString());\n tfPrice.setText(jtModel.getValueAt(selectedRowIndex, 2).toString());\n tfColor.setText(jtModel.getValueAt(selectedRowIndex, 3).toString());\n tfQuantity.setText(jtModel.getValueAt(selectedRowIndex, 8).toString());\n rwCombo.setSelectedItem(jtModel.getValueAt(selectedRowIndex, 4));\n typeCombo.setSelectedItem(jtModel.getValueAt(selectedRowIndex, 6));\n bCombo.setSelectedItem(jtModel.getValueAt(selectedRowIndex, 5));\n switch(jtModel.getValueAt(selectedRowIndex, 7).toString()) {\n case \"High\":\n high.setSelected(true);\n break;\n case \"Mild\":\n mild.setSelected(true);\n break;\n case \"Medium\":\n medium.setSelected(true);\n break;\n }\n }\n else if(option==1)\n {\n jtModel.removeRow(selectedRowIndex);\n JOptionPane.showMessageDialog(rootPane,\" Detail successfully deleted\");\n }\n else \n {\n \n } \n }", "private void enableSelectedRowForUpdate(ComponentEvent evt) {\n\t\tint tipoRolSeleccionado = getTblTipoRol().getSelectedRow(); \r\n\t\tif ( tipoRolSeleccionado != -1) {\r\n\t\t\ttipoRolSeleccionado = getTblTipoRol().convertRowIndexToModel(tipoRolSeleccionado); \r\n\t\t\ttipoRolIf = (TipoRolIf) tipoRolVector.get(tipoRolSeleccionado);\r\n\t\t\tgetTxtCodigo().setText(tipoRolIf.getCodigo());\r\n\t\t\tgetTxtNombre().setText(tipoRolIf.getNombre());\r\n\t\t\tgetTxtNemonico().setText(tipoRolIf.getNemonico());\r\n\t\t\t\r\n\t\t\tgetCmbFechaInicio().setDate(tipoRolIf.getFechaInicio());\r\n\t\t\tgetCmbFechaInicio().repaint();\r\n\t\t\t\r\n\t\t\tgetCmbFechaFin().setDate(tipoRolIf.getFechaFin());\r\n\t\t\tgetCmbFechaFin().repaint();\r\n\t\t\t\r\n\t\t\tString rubroEventual = tipoRolIf.getRubroEventual(); \r\n\t\t\tif ( rubroEventual != null ){\r\n\t\t\t\tif( RUBRO_EVENTUAL_SI.substring(0,1).equals(rubroEventual) ){\r\n\t\t\t\t\tgetCmbRubroEventual().setSelectedItem(RUBRO_EVENTUAL_SI);\r\n\t\t\t\t}else if( RUBRO_EVENTUAL_NO.substring(0,1).equals(rubroEventual) ){\r\n\t\t\t\t\tgetCmbRubroEventual().setSelectedItem(RUBRO_EVENTUAL_NO);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tgetCmbRubroEventual().setSelectedItem(null);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tString provisionado = tipoRolIf.getRubroProvisionado();\r\n\t\t\tif ( provisionado != null ){\r\n\t\t\t\tif( TipoRolProvisionado.SI.getLetra().equals(provisionado) ){\r\n\t\t\t\t\tgetCmbRubroProvisionado().setSelectedItem(TipoRolProvisionado.SI);\r\n\t\t\t\t}else if( TipoRolProvisionado.NO.getLetra().equals(provisionado) ){\r\n\t\t\t\t\tgetCmbRubroProvisionado().setSelectedItem(TipoRolProvisionado.NO);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tgetCmbRubroProvisionado().setSelectedItem(null);\r\n\t\t\t}\r\n\t\t\tgetCmbRubroProvisionado().repaint();\r\n\t\t\t\r\n\t\t\tString formaPagoLetra = tipoRolIf.getFormaPago();\r\n\t\t\tif (formaPagoLetra != null){\r\n\t\t\t\ttry {\r\n\t\t\t\t\tTipoRolFormaPago formaPago = TipoRolFormaPago.getTipoRolPagoByLetra(formaPagoLetra);\r\n\t\t\t\t\tgetCmbFormaPago().setSelectedItem(formaPago);\r\n\t\t\t\t} catch (GenericBusinessException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\tSpiritAlert.createAlert(e.getMessage(), SpiritAlert.ERROR);\r\n\t\t\t\t}\r\n\t\t\t} else \r\n\t\t\t\tgetCmbFormaPago().setSelectedItem(null);\r\n\t\t\tgetCmbFormaPago().repaint();\r\n\t\t\t\r\n\t\t\tsetUpdateMode();\r\n\t\t}\r\n\t}", "public void updateButtonActionPerformed(ActionEvent evt)\n {\n int row = rateMediaTable.getSelectedRow();\n double rating = Double.parseDouble(ratingTextField.getText());\n String theName = nameTextField.getText();\n String theArtist = artistTextField.getText();\n double theLength = Double.parseDouble(lengthTextField.getText());\n \n if(row >= 0) \n {\n if(rating > 5)\n {\n System.err.println(\"Update Error. ENTER RATING LESSER OR EQUAL TO 5.\");\n }\n else\n {\n if(theName.equalsIgnoreCase(\"Select Row\") || theArtist.equalsIgnoreCase(\"Select Row\") || theLength == 0)\n {\n System.err.println(\"Update Error. SELECT A ROW.\");\n }\n else if(row == -1)\n {\n System.err.println(\"Update Error. SELECT A ROW.\");\n }\n else\n {\n theMediaListCntl.updateName(nameTextField.getText(), row, 0);\n theMediaListCntl.updateArtist(artistTextField.getText(), row, 1);\n theMediaListCntl.updateDoubleLength(lengthTextField.getText(), row, 2);\n theMediaListCntl.updateDoubleRating(ratingTextField.getText(), row, 3);\n }\n \n }\n }\n else\n {\n System.err.println(\"Update Error. SELECT A ROW.\");\n }\n \n }", "@Override\r\n\tpublic void mousePressed(MouseEvent e) {\r\n\t\tJTable table = (JTable) e.getSource();\r\n\t\tthis.selectedRow = table.getSelectedRow();\r\n\t}", "@Override\n public void valueChanged(ListSelectionEvent e) {\n TableModel tm = jTable.getModel();\n // Bepaalt de geselecteerde rij en vult een array met alle waardes\n int[] selRows = jTable.getSelectedRows();\n // Dit vult selectedID\n this.result = tm.getValueAt(selRows[0],0);\n }", "@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setQuantity(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET quantity='\"+data.getQuantity()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}", "private void deleteRow(int selectedRow){\r\n BudgetSubAwardBean budgetSubAwardBean = (BudgetSubAwardBean)data.get(selectedRow);\r\n if(budgetSubAwardBean.getAcType() == null || budgetSubAwardBean.getAcType().equals(TypeConstants.UPDATE_RECORD)){\r\n budgetSubAwardBean.setAcType(TypeConstants.DELETE_RECORD);\r\n budgetSubAwardBean.setUpdateUser(userId);\r\n if(deletedData ==null) {\r\n deletedData = new ArrayList();\r\n }\r\n deletedData.add(budgetSubAwardBean);\r\n }\r\n data.remove(selectedRow);\r\n \r\n //If Last Row nothing to do\r\n //else Update Sub Award Number for rest of the Rows\r\n /*int size = data.size();\r\n if(selectedRow != size) {\r\n for(int index = selectedRow; index < size; index++) {\r\n budgetSubAwardBean = (BudgetSubAwardBean)data.get(index);\r\n budgetSubAwardBean.setSubAwardNumber(index + 1);\r\n if(budgetSubAwardBean.getAcType() == null) {\r\n budgetSubAwardBean.setAcType(TypeConstants.UPDATE_RECORD);\r\n }\r\n }//End For\r\n }//End If\r\n */\r\n \r\n subAwardBudgetTableModel.fireTableRowsDeleted(selectedRow, selectedRow);\r\n }", "@Override\n public void mousePressed(MouseEvent e) {\n if (e.getButton() == MouseEvent.BUTTON3) {\n int rowUnderMouse = getTable().rowAtPoint(e.getPoint());\n// if (rowUnderMouse != -1 && !getTable().isRowSelected(rowUnderMouse)) {\n// selected = rowUnderMouse;\n// }\n selected = rowUnderMouse;\n }\n }", "@Override\n public void focusGained(FocusEvent fe) {\n if (!table.getSelectionModel().isSelectionEmpty()) \n Order.selectedBookingIDRow = (int) table.getValueAt(table.getSelectedRow(), 0);\n }", "void updateSelected(Coord c) {\n this.selected = c;\n }", "public void valueChanged(ListSelectionEvent e) {\n if (!e.getValueIsAdjusting()) {\n selRow = table.getSelectedRow();\n }\n }", "@Override\n protected void updateModelFromUi(@Nullable Selection<DataType> selection) {\n try {\n selection.setSelected(theCheckBox.isChecked());\n Logger.debug(\"Updated selection: \" + selection.toString());\n\n } catch (Exception e) {\n Logger.error(\"Failed to update selection\", e);\n }\n }", "@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setReorder_level(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET reorder_level='\"+data.getReorder_level()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}", "@Override\r\n\tpublic void adminSelectUpdate() {\n\t\t\r\n\t}", "public void selectionChanged() {\r\n int fila = menuCursos.tablaCursos.getSelectedRow();\r\n try {\r\n actual=(Cursos) rs.get(fila);\r\n if(actual.getCodigo()!=null){\r\n MostrarRegistro();\r\n menuCursos.botonCursosBorrar.setEnabled(fila != -1);\r\n menuCursos.botonCursosModificar.setEnabled(fila != -1);\r\n }\r\n } catch (Exception e) {\r\n actual = null;\r\n }\r\n }", "@Kroll.method\n\tpublic void selectRow(int index)\n\t{\n\t\tscrollToIndex(index, null);\n\n\t\tfinal TableViewRowProxy row = getRowByIndex(index);\n\n\t\tif (row != null) {\n\t\t\tfinal TiTableView tableView = getTableView();\n\n\t\t\tif (tableView != null) {\n\t\t\t\tfinal Runnable action = () -> {\n\t\t\t\t\tfinal SelectionTracker tracker = tableView.getTracker();\n\t\t\t\t\tfinal TiUIView rowView = row.peekView();\n\t\t\t\t\tfinal boolean visible = rowView != null && rowView.getNativeView().isShown();\n\n\t\t\t\t\tif (!visible) {\n\t\t\t\t\t\tscrollToIndex(index, null);\n\t\t\t\t\t}\n\t\t\t\t\tif (tracker != null) {\n\t\t\t\t\t\ttracker.select(row);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\t// This is a workaround for when `EDITING` mode is set, as it recreates the TableView.\n\t\t\t\t// We need to listen for when it has updated before testing visibility/scrolling.\n\t\t\t\tif (!tableView.getHasLaidOutChildren()) {\n\t\t\t\t\ttableView.addOnLayoutChangeListener(new View.OnLayoutChangeListener()\n\t\t\t\t\t{\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void onLayoutChange(View view, int i, int i1, int i2, int i3, int i4, int i5, int i6,\n\t\t\t\t\t\t\t\t\t\t\t\t int i7)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\taction.run();\n\t\t\t\t\t\t\ttableView.removeOnLayoutChangeListener(this);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\taction.run();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void dataSelect(){\n //deklarasi variabel\n int i = tblKembali.getSelectedRow();\n \n //uji adakah data di tabel?\n if(i == -1){\n //tidak ada yang terpilih atau dipilih.\n return;\n }\n txtNama.setText(\"\"+model.getValueAt(i,0));\n txtAlamat.setText(\"\"+model.getValueAt(i,1));\n txtNo.setText(\"\"+model.getValueAt(i,2));\n txtKamera.setText(\"\"+model.getValueAt(i,3));\n txtKode.setText(\"\"+model.getValueAt(i,4));\n txtdisewa.setText(\"\"+model.getValueAt(i,5));\n txtLama.setText(\"\"+model.getValueAt(i,6));\n txtLambat.setText(\"\"+model.getValueAt(i,7));\n \n }", "public void updateUserSelTable() {\n\t\n\t\tUserSelDietTable.getSelectionModel().removeListSelectionListener(lsl_userT);\n\t\tdtm = new DefaultTableModel();\n\t\tudI=new UserDietDAOImpl();\n\t\tdtm.addColumn(\"Id\");\t\t\n\t\tdtm.addColumn(\"Diet Id\");\n\t\tdtm.addColumn(\"Meal Type\");\n\t\tdtm.addColumn(\"Food Name\");\n\t\tdtm.addColumn(\"Calories (g)\");\n\t\tdtm.addColumn(\"Date\");\n\t\tdtm.addColumn(\"Author\");\n\t\tArrayList<UserDiet> dietList=new ArrayList<UserDiet>();\n\t\tif(currentUEmail.length>0)\n\t\t{\n\t\t\tString currDate=(String) comboBoxDate.getSelectedItem();\t\t\t\n\t\t\tSystem.out.println(currDate+\" item count \"+comboBoxDate.getItemCount());\n\t\tdietList =udI.getUserDietList(currentUEmail[0],currDate);\n\t\t}\n\t\tfor (UserDiet ud : dietList) {\t\n\t\t\tdtm.addRow(ud.getVector());\n\t\t}\n\t\tUserSelDietTable.setModel(dtm);\n\n\t\tUserSelDietTable.getSelectionModel().addListSelectionListener(lsl_userT);\n\n\n\t}", "private void itemSelected(){\n \t//* count selected items\n \tint c=0;\n \tfor (int i = 0; i<jTable4.getRowCount(); i++){\n \t\tif((Boolean)jTable4.getModel().getValueAt(i, 0)){\n \t\t\tc++;\n \t\t}\n \t}\n \tif(c==0){\n \t\treturn; //* if no item selected then do nothing\n \t}\n \t\n \t//* get the new selected items\n \tString[][] tmp1=new String[c][2];\n \tfor (int i = 0, j=0; i<jTable4.getRowCount(); i++){\n \t\tif((Boolean)jTable4.getModel().getValueAt(i, 0)){\n \t\t\ttmp1[j]=new String[2];\n \t\t\ttmp1[j][0]=jTable4.getModel().getValueAt(i, 1).toString();\n \t\t\ttmp1[j++][1]=\"0\";\n \t\t}\n \t}\n \t\n \t//* get the previously selected items\n \tString[][] tmp2=new String[jTable3.getModel()==null? 0: jTable3.getModel().getRowCount()][9];\n \tfor (int i = 0; i<tmp2.length; i++){\n \t\ttmp2[i]=new String[9];\n \t\ttmp2[i][0]=jTable3.getModel().getValueAt(i, 1).toString();\n \t\ttmp2[i][1]=jTable3.getModel().getValueAt(i, 2).toString();\n \t\ttmp2[i][2]=jTable3.getModel().getValueAt(i, 3).toString();\n \t\ttmp2[i][3]=jTable3.getModel().getValueAt(i, 5).toString();\n \t\ttmp2[i][4]=jTable3.getModel().getValueAt(i, 7).toString();\n \t\ttmp2[i][5]=jTable3.getModel().getValueAt(i, 9).toString();\n \t\ttmp2[i][6]=jTable3.getModel().getValueAt(i, 11).toString();\n \t\ttmp2[i][7]=jTable3.getModel().getValueAt(i, 13).toString();\n \t\ttmp2[i][8]=jTable3.getModel().getValueAt(i, 15).toString();\n \t}\n \tfillPoDet(tmp2, tmp1); //* reconstruct PO table\n \tjTabbedPane1.setSelectedIndex(0);\n }", "@Override\r\n\t\t\t\t\tprotected void updateItem(Object arg0, boolean arg1) {\n\t\t\t\t\t\tsuper.updateItem(arg0, arg1);\r\n\t\t\t\t\t\tif (arg1) {\r\n\t\t\t\t\t\t\tsetGraphic(null);\r\n\t\t\t\t\t\t\tsetText(null);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tbtn.setOnAction(new EventHandler<ActionEvent>() {\r\n\r\n\t\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\t\tpublic void handle(ActionEvent arg0) {\r\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\r\n\t\t\t\t\t\t\t\t\tProducts data=(Products) tbl_view.getItems().get(getIndex());\r\n\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\t\t\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\t\t\t\t\t\tif(ConnectionManager.queryInsert(conn, \"DELETE FROM dbo.product WHERE id=\"+data.getId())>0) {\r\n\t\t\t\t\t\t\t\t\t\ttxt_cost.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_date.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_name.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_price.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_qty.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_search.clear();\r\n\t\t\t\t\t\t\t\t\t\tfetchData(FETCH_DATA);\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\r\n\t\t\t\t\t\t\tsetGraphic(btn);\r\n\t\t\t\t\t\t\tsetText(null);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}", "private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {\n DefaultTableModel model = (DefaultTableModel)jTable1.getModel();\n // get the selected row index\n int selectedRowIndex = jTable1.getSelectedRow();\n // set the selected row data into jtextfields\n ID_USER =Integer.parseInt(model.getValueAt(selectedRowIndex, 0).toString()) ; \n CL_USER =model.getValueAt(selectedRowIndex, 1).toString(); \n\n }", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\tint selectedRow = table.getSelectedRow();//获得选中行的索引\n\t\t\t\tif(selectedRow!= -1) //是否存在选中行\n\t\t\t {\n\t\t\t Object oa = tableModel.getValueAt(selectedRow, 0);\n\t\t\t Object ob = tableModel.getValueAt(selectedRow, 1);\n\t\t\t comboBox_1.setSelectedItem(oa.toString());\n\t\t\t textField2.setText(ob.toString());\n\t\t\t }\n\t\t\t else{\n\t\t\t textField2.setText(\"\");\n\t\t\t }\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t int selectedRow = table.getSelectedRow();//获得选中行的索引\n\t\t\t\t if(selectedRow!= -1) //是否存在选中行\n\t\t\t\t {\n\t\t\t\t //修改指定的值:\n\t\t\t\t String a=tableModel.getValueAt(selectedRow, 0).toString();\n\t\t\t\t String b=tableModel.getValueAt(selectedRow, 1).toString();\n\t\t\t\t \n\t\t\t\t tableModel.setValueAt(comboBox_1.getSelectedItem(), selectedRow, 0);\n\t\t\t\t tableModel.setValueAt(textField2.getText(), selectedRow, 1);\n\t\t\t\t \n\t\t\t\t try {\n\t\t\t\t Connection con = DriverManager.getConnection(conURL,Test.mysqlname, Test.mysqlpassword); // 连接数据库\n\n\t\t\t\t Statement s = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); // Statement类用来提交SQL语句\n\t\t\t\t \n\t\t\t\t ResultSet rs = s.executeQuery(\"select lei,name from goods\"); // 提交查询,返回的表格保存在rs中\n\n\t\t\t\t while(rs.next()) { // ResultSet指针指向下一个“行”\n\t\t\t\t if(rs.getString(\"lei\").equals(a)&&rs.getString(\"name\").equals(b)){\n\t\t\t\t \trs.updateString(\"lei\", comboBox_1.getSelectedItem().toString());\n\t\t\t\t \trs.updateString(\"name\", textField2.getText());\n\t\t\t\t \trs.updateRow();\n\t\t\t\t \t Statement s2 = con.createStatement(); // Statement类用来提交SQL语句\n\t\t\t\t\t\t \t\t SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");//设置日期格式\n\t\t\t\t\t\t \t\t//System.out.println(\"insert into news(time,news,limit) values('\"+df.format(new Date())+\"','\"+Name+\"登入系统\"+\"','\"+limite+\"')\");\n\t\t\t\t\t\t \t\tString insert1 = \"insert into news(time,news,limite) values('\"+df.format(new Date())+\"','\"+Testmysql.limite+Testmysql.Name+\"修改商品信息\"+a+\":\"+b+\"成功\"+\"','\"+Testmysql.limite+\"')\"; \n\t\t\t\t\t\t \t\ts2.executeUpdate(insert1);\n\t\t\t\t\t\t \t\t\t\n\t\t\t\t\t\t s2.close(); // 释放Statement对象\n\t\t\t\t \tbreak;\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 s.close(); // 释放Statement对象\n\t\t\t\t con.close(); // 关闭到MySQL服务器的连接\n\t\t\t\t }\n\t\t\t\t catch(SQLException sql_e) { // 都是SQLException\n\t\t\t\t System.out.println(sql_e);\n\t\t\t\t }\n\t\t\t\t //table.setValueAt(arg0, arg1, arg2)\n\t\t\t\t }\n\t\t\t\t \n\t\t\t}", "@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setPrice(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET price='\"+data.getPrice()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}", "protected void memberRowSelected(int row) {\r\n\t\tdisplayValidityReport();\r\n\t\tsetMemberActionsEnabled(true);\r\n\t}", "private void selectedRowGuide(){\r\n xy log_guide_rel_inv = tb_guias.getSelectionModel().getSelectedItem(); \r\n loadTables(log_guide_rel_inv.getGuias());\r\n loadCarga(log_guide_rel_inv.getGuias());\r\n \r\n List<Fxp_Archguid_gfc> data = Ln.getList_log_Archguid_gfc(Ln.getInstance().find_Archguid_gfc(log_guide_rel_inv.getGuias()));\r\n\r\n tp_factura.setText(\r\n \"Relación de Guia / Facturas / Clientes \" + \r\n \" - \" + \r\n data.size() + \" / \" + \r\n data.get(0).getNumfact() + \" / \" + \r\n data.get(0).getNumclie());\r\n\r\n tp_factura.setExpanded(true);\r\n \r\n }", "@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setName(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET name='\"+data.getName()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}", "private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {\n int indexrow=jTable1.getSelectedRow();\n DefaultTableModel model = (DefaultTableModel)jTable1.getModel();\n id=model.getValueAt(indexrow,0).toString();\n txt_id.setText(model.getValueAt(indexrow,0).toString());\n txt_class.setText(model.getValueAt(indexrow,1).toString());\n txt_section.setText(model.getValueAt(indexrow, 2).toString());\n }", "public void rowField()\n\t{ \n\t\tviewTable.addMouseListener(new MouseAdapter() {\n\t\t\tpublic void mouseClicked(MouseEvent e)\n\t\t\t{\n\t\t\t\tint c;\n\t\t\t\tString id ,oldname,oladdress,oldcontact,oldemail,oldusername, oldpassword;\n\t\t\t\tDefaultTableModel viewTablemodel = (DefaultTableModel)viewTable.getModel();\n\t\t\t\tc=viewTable.getSelectedRow();\n\t\t\t\tid= viewTablemodel.getValueAt(c, 1).toString();\n\t\t\t\toldname= viewTablemodel.getValueAt(c,2).toString();\n\t\t\t\toldcontact= viewTablemodel.getValueAt(c,3).toString();\n\t\t\t\toladdress= viewTablemodel.getValueAt(c,4).toString();\n\t\t\t\toldemail= viewTablemodel.getValueAt(c,5).toString();\n\t\t\t\toldusername= viewTablemodel.getValueAt(c,6).toString();\n\t\t\t\toldpassword= viewTablemodel.getValueAt(c,7).toString();\n\t\t\t\tupdatePanel(id, oldname, oldcontact, oladdress, oldemail, oldusername, oldpassword);\n\t\t\t\tsetRowCount(viewTable.getSelectedRow());\n\t\t\t}\n\t\t});\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tint RowNum=jt.getSelectedRow();\n\t\t\t\tif(RowNum==-1){\n\t\t\t\t\tJOptionPane.showMessageDialog(jt, \"请选择一行\");\n\t\t\t\t return ;\n\t\t\t }\n\t\t\t\t\n\t\t\t\tint isDelete=JOptionPane.showConfirmDialog(null, \"是否确定删除该专业以及该专业所有班级与学生信息?\");\n\t\t\t\t\n\t\t\t\tif(isDelete==JOptionPane.YES_OPTION){\n\t\t\t\t\tString majorName=(String)mit.getValueAt(RowNum, 1);\n\t\t\t\t\tString deleteSql=\"delete from majorinfo where grade='\"+Tool.getGrade(userId)+\"' and majorName=?\";\n\t\t\t\t\tString deleteclass=\"delete from classinfo where grade='\"+Tool.getGrade(userId)+\"' and major=?\";\n\t\t\t\t\tString deletejob=\"delete from jobinfo where grade='\"+Tool.getGrade(userId)+\"' and major=?\";\n\t\t\t\t\t\n\t\t\t\t\tString[] dleteParas={Tool.string2UTF8(majorName)};\n\t\t\t\t\t\n\t\t\t\t\tmit.Update(deleteclass, dleteParas);\n\t\t\t\t\tmit.Update(deletejob, dleteParas);\n\t\t\t\t\t\n\t\t\t\t\tif(mit.Update(deleteSql, dleteParas)){\n\t\t\t\t\t\trefresh(jt);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tJOptionPane.showMessageDialog(jt, \"删除失败\");\n\t\t\t\t\t}\n\n\t\t\t\t\trefresh(jt);\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t}", "private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {\n try{\n Class.forName(driver);\n Connection con = DriverManager.getConnection(url,user,pass); \n if( TableDisplayEmp.getSelectedRow() > 0 ){\n rowSelected = TableDisplayEmp.getSelectedRow();\n }\n // loi doan nay ne em, tại vì khi em nhấn Update thì cái cai table no da bỏ chọn rồi, row = -1 ý, nên nó ko lấy đc dòng nào cần chọn\n String value = (TableDisplayEmp.getModel().getValueAt(rowSelected, 0).toString());\n \n //System.out.println( rowSelected );\n String query1 = \"UPDATE Em_Contact SET Phone = ?, Email = ? WHERE Employee_ID = ? \";\n PreparedStatement pst1 = con.prepareStatement(query1); \n pst1.setString(1, txtContact.getText());\n pst1.setString(2, txtEmail.getText());\n pst1.setString(3, txtEmployee_ID.getText());\n pst1.executeUpdate();\n \n String query = \"UPDATE Employee SET LastName = ?, FirstName = ?, Gender = ?, Dob = ?, Address = ? WHERE Employee_ID = ?\";\n PreparedStatement pst = con.prepareStatement(query); \n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n String date = sdf.format(txtDob.getDate()); \n pst.setString(1, txtLastName.getText());\n pst.setString(2, txtFirstName.getText());\n String Gender = txtGender.getSelectedItem().toString();\n pst.setString(3, Gender); \n pst.setString(4, date);\n pst.setString(5, txtAddress.getText());\n //pst.setBytes(6, person_image);\n pst.setString(6, txtEmployee_ID.getText());\n pst.executeUpdate();\n \n \n userList = userList();\n \n DefaultTableModel dm = (DefaultTableModel)TableDisplayEmp.getModel();\n while(dm.getRowCount() > 0)\n {\n dm.removeRow(0);\n }\n \n show_user(userList);\n JOptionPane.showMessageDialog(this,\"Save Successfully!!!\");\n } catch (Exception e){\n //System.out.println(e.getMessage());\n JOptionPane.showMessageDialog(this,e.getMessage());\n }\n }", "public void fireTableRowSelected(Object source, int iRowIndex, int iSelectionType);", "public void updateSelection()\n {\n \trectForSelection.setRect(rettangoloX,rettangoloY,larghezza,altezza);\n \trectSelTopLeft.setRect(rettangoloX-3,rettangoloY-3,6,6);\n \trectSelBottomLeft.setRect(rettangoloX-3,rettangoloY+altezza-3,6,6);\n \trectSelTopRight.setRect(rettangoloX+larghezza-3,rettangoloY-3,6,6);\n \trectSelBottomRight.setRect(rettangoloX+larghezza-3,rettangoloY+altezza-3,6,6);\n }", "@Override\n\tpublic void updateSelective(TblMulitData t) throws SQLException {\n\n\t}", "@Override\n public void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\ttable.setSelection(new TableItem[] {tcursor.getRow()});\n\t\t\t}", "public void setEditRow(int row) {\n this.editRow = row;\n }", "@FXML\n private void rowSelected() {\n if (coachesTable.getSelectionModel().getSelectedItem() != null) {\n removeButton.setDisable(false);\n }\n }", "@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setCost(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET cost='\"+data.getCost()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}", "@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tString row= diveRow.get(position);\n\t\t\t\t\t\tIntent i = new Intent(\"android.intent.action.VIEWSELECTEDDIVE\");\n\t\t\t\t\t\tBundle extras = new Bundle();\n\t\t\t\t\t\textras.putString(\"row\", row);\n\t\t\t\t\t\ti.putExtras(extras);\n\t\t\t\t\t\tstartActivityForResult(i, 0);\n\t\t\t\t\t\t//Toast.makeText(getBaseContext(), \"Row selected: \"+ row, Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t//cursor.close();\n\t\t\t\t\t\t//dataBaseCursor.close();\n\t\t\t\t\t\tfinish();//free resources\n\t\t\t\t\t\t\n\t\t\t\t\t}", "private void updateStoryTable() {\n List<Story> stories = getModel().getAllStories();\n observableStories.setAll(stories);\n\n if (selectedStory.get() != null) {\n storyTable.getSelectionModel().select(selectedStory.get());\n }\n\n }", "public void populateForm(Appointment row){\n selectedRow = row;\n idText.setText(Integer.toString(row.getId()));\n titleText.setText(row.getTitle());\n descriptionText.setText(row.getDescription());\n for(Location item : locationCombo.getItems()){\n if(item.getCity_state().equals(row.getLocation())){\n locationCombo.getSelectionModel().select(item);\n break;\n }\n }\n for(Contact person : contactCombo.getItems()){\n if(person.getName().equals(row.getContact())){\n contactCombo.getSelectionModel().select(person);\n break;\n }\n }\n for(Type meeting : typeCombo.getItems()){\n if(meeting.getAppointment_type().equals(row.getType())){\n typeCombo.getSelectionModel().select(meeting);\n break;\n }\n }\n for(Customer cust : customerCombo.getItems()){\n if(cust.getId() == row.getCustomer()){\n customerCombo.getSelectionModel().select(cust);\n break;\n }\n }\n for(User user : userCombo.getItems()){\n if(user.getId() == row.getUser()){\n userCombo.getSelectionModel().select(user);\n break;\n }\n }\n startLDT = LocalDateTime.parse(row.getStart(), formatter);\n endLDT = LocalDateTime.parse(row.getEnd(), formatter);\n dateBox.setValue(startLDT.toLocalDate());\n setPrevSpinner = true;\n setSpinners();\n }", "synchronized void refresh() {\n\n\t\t// We must not call fireTableDataChanged, because that would clear the\n\t\t// selection in the task window\n\t\tfireTableRowsUpdated(0, size - 1);\n\n\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n int row = table.convertRowIndexToModel( table.getEditingRow() );\n }", "public int getSelectedRow()\n {\n \treturn this.getSelectedIndex();\n }", "public void invSelected()\n {\n\t\t//informaPreUpdate();\n \tisSelected = !isSelected;\n\t\t//informaPostUpdate();\n }", "private void setInfo(int row)\n {\n String ID=table.getModel().getValueAt(row, 0).toString();\n String Name=table.getModel().getValueAt(row, 1).toString(); \n idText.setText(ID);\n nameText.setText(Name);\n }", "public void update() {\n tableChanged(new TableModelEvent(this));\n }", "protected void setSelectedObjects() {\r\n\t\tint index, arrayLength;\r\n\t\tVector oldObjects = (Vector) getSelectedObjects().clone();\r\n\t\tgetSelectedObjects().removeAllElements();\r\n\t\tint[] intArray = table.getSelectedRows();\r\n\t\tarrayLength = intArray.length;\r\n\t\tfor (int i = 0; i < arrayLength; i++) {\r\n\t\t\tindex = intArray[i];\r\n\t\t\tif (index >= 0) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (dataObjects.size() > 0)\r\n\t\t\t\t\t\tselectedObjects.addElement(dataObjects.elementAt(index));\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tselectedObjects.addElement(null);\r\n\t\t\t\t} catch (Throwable t) {\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Object newSingleSelection = getSelectedRowObject();\r\n\t\tnotifySelectedObjectsChanged(oldObjects, selectedObjects);\r\n\t\tnotifySelectedObjectChanged(oldObjects, selectedObjects);\r\n\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n int selection = statsTable.getSelectedRow();\n if (selection != -1) {\n int modelIndex = statsTable.getRowSorter().convertRowIndexToModel(selection);\n String set = (String) statsTable.getModel().getValueAt(modelIndex, 0);\n int index = map.getSettlement(set);\n String number = JOptionPane.showInputDialog(\"Please enter number of Dose Vaccine to add :\");\n map.getSettlements()[index].setNumberVaccineDose(Integer.parseInt(number));\n }\n else\n JOptionPane.showMessageDialog(new JFrame(), \"Select a row!\", \"Statistics Error\",\n JOptionPane.ERROR_MESSAGE);\n }", "@Override\n public void changed(ObservableValue observableValue, Object oldValue, Object newValue) {\n if(table_progressive.getSelectionModel().getSelectedItem() != null) \n { \n TableViewSelectionModel selectionModel = table_progressive.getSelectionModel();\n ObservableList selectedCells = selectionModel.getSelectedCells();\n TablePosition tablePosition = (TablePosition) selectedCells.get(0); \n String[] liste_value=newValue.toString().split(\",\");\n selected_row_table_progressive=tablePosition.getRow()+1; \n selected_row_table_progressive_nom=liste_value[1].trim();\n selected_row_table_progressive_prenom=liste_value[2].trim();\n // Object val = tablePosition.getTableColumn().getCellData(newValue); \n }\n }", "@Override\n public void changed(ObservableValue observableValue, Object oldValue, Object newValue) {\n if(table_progressive.getSelectionModel().getSelectedItem() != null) \n { \n TableViewSelectionModel selectionModel = table_progressive.getSelectionModel();\n ObservableList selectedCells = selectionModel.getSelectedCells();\n TablePosition tablePosition = (TablePosition) selectedCells.get(0); \n String[] liste_value=newValue.toString().split(\",\");\n selected_row_table_progressive=tablePosition.getRow()+1; \n selected_row_table_progressive_nom=liste_value[1].trim();\n selected_row_table_progressive_prenom=liste_value[2].trim();\n // Object val = tablePosition.getTableColumn().getCellData(newValue); \n }\n }", "private void datos() {\n int row;\n row = vista.tblClientes.getSelectedRow();\n cvo.setId_cliente(Integer.parseInt(vista.tblClientes.getValueAt(row, 0).toString()));\n vista.txtNombre.setText(String.valueOf(vista.tblClientes.getValueAt(row, 1)));\n vista.txtApellido.setText(String.valueOf(vista.tblClientes.getValueAt(row, 2)));\n vista.txtDireccion.setText(String.valueOf(vista.tblClientes.getValueAt(row, 3)));\n vista.txtCorreo.setText(String.valueOf(vista.tblClientes.getValueAt(row, 4)));\n vista.txtClave.setText(String.valueOf(vista.tblClientes.getValueAt(row, 5)));\n }", "public void DoEdit() {\n \n int Row[] = tb_User.getSelectedRows();\n if (Row.length > 1) {\n JOptionPane.showMessageDialog(null, \"You can choose only one user edit at same time!\");\n return;\n }\n if (tb_User.getSelectedRow() >= 0) {\n EditUser eu = new EditUser(this);\n eu.setVisible(true);\n\n } else {\n JOptionPane.showMessageDialog(null, \"You have not choose any User to edit\");\n }\n }", "@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setExpiry_date(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET expiry_date='\"+data.getExpiry_date()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t\tif(table.getSelectedRow() != -1) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tatualizar(repo);\n\t\t\t\t\t} catch (RuntimeException re) {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, re.getMessage(), \"Erro ao atualizar!\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Selecione a linha a ser alterada.\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "public void setSelectedCell(Coord c) {\n this.selected = c;\n }", "protected void selectCell( int row, int column )\n {\n validateCell( row, column );\n if ( row < 0 || column < 0 )\n {\n return;\n }\n\n final int r = row;\n final int c = column;\n SwingUtilities.invokeLater(\n new Runnable()\n {\n @Override\n public void run()\n {\n treeTable.changeSelection( r, c, false, false );\n }\n } );\n }", "@Override\r\n\tpublic boolean updateTable() {\r\n\t\t/*\r\n\t\t * VERSION 1\r\n\t\t *\r\n\t\tobjectCollection.clear();\r\n\t\tobjectCollection.addAll(retrieveObjects());\r\n\t\trefreshTable();*/\r\n\t\tlong size=objectCollection.size();\r\n\t\tobjectCollection.clear();\r\n\t\tint index=getSelectionIndex();\r\n\t\tupdateTable(SWT.DEFAULT);\r\n\t\tselectElement(index);\r\n\t\treturn objectCollection.size()!=size;\r\n\t}", "public void getSelected() {\n for (int i = 0; i < list.size(); i++) {\n if (selectColumn.getCellObservableValue(i).getValue().isSelected()) {\n selectedIngredients.add(i + 1);\n }\n }\n }", "public void updateDataCell();", "@Override\n public void update() {\n selectedLevel.update();\n }", "private void updateItemScreen(long rowId) {\n \tIntent intent = new Intent(this, ItemEditor.class);\n \tintent.putExtra(INTENT_ID_KEY, rowId);\n \tstartActivity(intent);\n }", "private void fillEdit(int rowSelected) {\n\n SQLiteDatabase database = new DatabaseSQLiteHelper(this).getReadableDatabase();\n\n Cursor cursor = database.rawQuery(\"SELECT * FROM \" + Database.Student.TABLE_NAME , null);\n\n\n cursor.moveToPosition(rowSelected);\n String dpSrc = cursor.getString(cursor.getColumnIndex(Database.Student.COL_DP));\n int studentId = cursor.getInt(cursor.getColumnIndex(Database.Student._ID));\n String fname = cursor.getString(cursor.getColumnIndex(Database.Student.COL_FIRST_NAME));\n String lname = cursor.getString(cursor.getColumnIndex(Database.Student.COL_LAST_NAME));\n String gender = cursor.getString(cursor.getColumnIndex(Database.Student.COL_GENDER));\n String course = cursor.getString(cursor.getColumnIndex(Database.Student.COL_COURSE));\n int age = cursor.getInt(cursor.getColumnIndex(Database.Student.COL_AGE));\n String address = cursor.getString(cursor.getColumnIndex(Database.Student.COL_ADDRESS));\n\n\n// String name = cursor.getString(cursor.getColumnIndex(Database.Student.COL_FIRST_NAME));\n\n int id = this.getResources().getIdentifier(\"drawable/\"+ dpSrc, null, this.getPackageName());\n\n dp.setImageResource(id);\n studentIdTv.setText(Integer.toString(studentId));\n fnameEt.setText(fname.toString());\n lnameEt.setText(lname);\n courseEt.setText(course);\n if(gender.toString().equals(\"Male\")) {\n radio.check(R.id.radioMaleEdit);\n } else {\n radio.check(R.id.radioFemaleEdit);\n }\n ageEt.setText(Integer.toString(age));\n addressEt.setText(address);\n\n\n }", "public void getRow(MouseEvent e) {\n\t\tconn = MySqlConnection.ConnectDb();\n\t\tindex = tableTransactions.getSelectionModel().getSelectedIndex();\n\n\t\tif (index <= -1)\n\t\t\treturn;\n\n\t\ttxt_transactionID.setText(col_transactionID.getCellData(index).toString());\n\t\ttxt_date.setPromptText(col_date.getCellData(index).toString());\n\t\ttxt_description.setText(col_description.getCellData(index).toString());\n\t\ttxt_category.setPromptText(col_category.getCellData(index).toString());\n\t\ttxt_amount.setText(col_amount.getCellData(index).toString());\n\t}", "public void updateParts()\n {\n ObservableList<Part> inventoryParts = this.inventory.getAllParts();\n\n // Configure part table and bind with inventory parts\n partIDColumn.setCellValueFactory(new PropertyValueFactory<Part,String>(\"id\"));\n partNameColumn.setCellValueFactory(new PropertyValueFactory<Part, String>(\"name\"));\n partInventoryColumn.setCellValueFactory(new PropertyValueFactory<Part, String>(\"stock\"));\n partCostColumn.setCellValueFactory(new PropertyValueFactory<Part, String>(\"price\"));\n\n partTable.setItems(inventory.getAllParts());\n // Unselect parts in table after part is deleted\n partTable.getSelectionModel().clearSelection();\n partTable.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);\n }", "protected void saveSelection ()\t{\n\t\t//\tAlready disposed\n\t\tif (m_table == null)\n\t\t\treturn;\n\n\t\tm_results.addAll(getSelectedRowKeys());\n\n\t\t//\tSave Settings of detail info screens\n//\t\tsaveSelectionDetail();\n\t\t\n\t}", "public void setSelectedCell(Cell c) {\n //First event can be bogus (from system placing focus on first item)\n if (!selectionEnabled)c=null;\n menuBar.updateCellMenu(c);\n // deselect previous cell\n if (selectedCell != null) {\n selectedCell.setSelected(false);\n }\n // select new cell\n selectedCell = c;\n if (selectedCell != null) {\n selectedCell.setSelected(true);\n }\n // Return focus to the frame, just in case it gets set somewhere else\n // (like the buttons)\n requestFocus();\n }", "private void updateEqualRows(String tableName, String[][] tableData, String[][] selectedCells) \n {\n String[][] modifiedCells = new String[selectedCells.length][selectedCells[0].length];\n// int cont = 0;\n for (int i = 0; i < selectedCells.length; i++) \n {\n for (int j = 0; j < selectedCells[0].length; j++) \n {\n if (!selectedCells[i][j].toString().equals(tableData[i][j].toString())) \n {\n adapter.updateRow(tableName, tableData[0][j], selectedCells[i][j], tableData[i][0]);\n// cont++;\n// System.out.println(\"GOT HERE: \" + cont);\n// System.out.println(\"table name: \" + tableName);\n// System.out.println(\"table data 0j: \" + tableData[0][j]);\n// System.out.println(\"selected cells ij: \" + selectedCells[i][j]);\n// System.out.println(\"tabledata i0: \" + tableData[i][0]);\n// System.out.println(\"\\n\");\n }\n }\n// cont = 0;\n }\n }", "private void respondToClick(int row)\r\n\t{\r\n\t\tif(isOnMainPage) \r\n\t\t{\r\n\t\t\tisOnMainPage = false;\r\n\t\t\tindexOfSelectedSubBand = row;\r\n\t\t\tclearTable();\r\n\t\t\taddSubBandContents();\r\n\t\t}else\r\n\t\t{\r\n\t\t\tindexOfSelectedBranch = row;\r\n\t\t\tnew AddBranchJDialog(450, 660, \"Edit Branch\", ICON, indexOfSelectedSubBand, indexOfSelectedBranch);\r\n\t\t\tclearTable();\r\n\t\t\taddSubBandContents();\r\n\t\t}\r\n\t}", "private void delete(int selectedRow) {\r\n removing = true;\r\n deletingRow = selectedRow;\r\n //subAwardBudgetTableModel.deleteRow(selectedRow);\r\n deleteRow(selectedRow);\r\n \r\n //Select a Row\r\n int selectRow = 0;\r\n int rowCount = subAwardBudgetTableModel.getRowCount();\r\n if(selectedRow == 0 && rowCount > 0) {\r\n //Select First Row\r\n selectRow = 0;\r\n }else if(selectedRow == rowCount) {\r\n //Select Last Row\r\n selectRow = rowCount - 1;\r\n }else {\r\n //Select This Row\r\n selectRow = selectedRow;\r\n }\r\n removing = false;\r\n if(selectRow != -1) {\r\n subAwardBudget.tblSubAwardBudget.setRowSelectionInterval(selectRow, selectRow);\r\n }else{\r\n //If All rows Deleted, then Details panel should be cleared\r\n displayDetails();\r\n }\r\n deletingRow = -1;\r\n }", "@Override\r\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tint row = Integer.valueOf(e.getActionCommand());\r\n\t\t\t//LibriTableModel model = (LibriTableModel) table.getModel();\r\n\t\t\tModelMethods.aggiungiCarrello(row);\r\n\t\t\tVenditeView.aggiornaLabels();\r\n\t\t\tLibriJPanJTab.refresh();\r\n\t\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tTableRow selected=null;\n\t\t\t\tfor(int i=0;i<table.getChildCount() && selected==null;i++){\n\t\t\t\t\tTableRow row = (TableRow)table.getChildAt(i);\n\t\t\t\t\tif(row.isSelected()){\n\t\t\t\t\t\tselected=row;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Si no se ha seleccionado ninguna columna\n\t\t\t\tif(selected==null){\n\t\t\t\t\t//Creamos un toast para avisar\n\t\t\t\t\tResources res = getResources();\n\t\t\t\t\tString text = String.format(res.getString(R.string.selectBill));\n\t\t\t\t\tToast msg = Toast.makeText(getBaseContext(),text, Toast.LENGTH_LONG);\n\t\t\t\t\tmsg.show();\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\t//Obtenemos los datos necesarios para\n\t\t\t\t\t//Localizar la factura a imprimir\n\t\t\t\t\tTextView idFactura = (TextView) selected.getChildAt(1);\n\t\t\t\t\tTextView nameClient = (TextView) selected.getChildAt(0);\n\t\t\t\t\t\n\t\t\t\t\tGlobalStatic data = (GlobalStatic) getApplicationContext();\n\t\t\t\t\tdata.cliente = data.getCliente((String)nameClient.getText());\n\t\t\t\t\tdata.factura = data.getFacturasId(data.cliente, Integer.parseInt((String)idFactura.getText()));\n\t\t\t\t\t//Creamos el pdf y lo imprimimos\n\t\t\t\t\ttry {\n\t\t\t\t\t\tdata.crearFacturaDiaria(data);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t//Creamos un toast para avisar\n\t\t\t\t\tResources res = getResources();\n\t\t\t\t\tString text = String.format(res.getString(R.string.printing));\n\t\t\t\t\tToast msg = Toast.makeText(getBaseContext(),text, Toast.LENGTH_LONG);\n\t\t\t\t\tmsg.show();\n\t\t\t\t\n\t\t\t\t}\n\t\t\t}", "@Override\n public void valueChanged(ListSelectionEvent e) {\n ListSelectionModel mSelectionModel = (ListSelectionModel)e.getSource();\n \n if (mSelectionModel.isSelectionEmpty() == false) {\n // Find out which indexes are selected.\n int mMinIndex = mSelectionModel.getMinSelectionIndex();\n int mMaxIndex = mSelectionModel.getMaxSelectionIndex();\n \n if (mMinIndex == mMaxIndex) {\n if (mSelectionModel.isSelectedIndex(mMinIndex)) {\n try {\n fillContactDetails(mMinIndex);\n } catch (SQLException ex) {\n Logger.getLogger(frmContacts.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n //Save the selected row for the case that the next action after this is cancel.\n pSelectedRow = mMinIndex;\n }\n }\n }\n }", "@FXML\r\n private void bRem() throws SQLException {\n int index = tableView.getSelectionModel().getSelectedIndex();\r\n if(index>=0)\r\n {\r\n calc calc = data.get(index);\r\n String tmp = calc.getComment();\r\n try{\r\n UpdateDb(tmp.substring(0,tmp.lastIndexOf(\"\\n\")), calc.getDate());\r\n }catch (StringIndexOutOfBoundsException e)\r\n {\r\n UpdateDb(\"\", calc.getDate());\r\n }\r\n refresh();\r\n }else\r\n {\r\n Alert alert = new Alert(Alert.AlertType.ERROR);\r\n alert.setTitle(\"ERROR\");\r\n alert.setContentText(\"Nothing Selected!!!\");\r\n alert.showAndWait();\r\n }\r\n }", "public void actionPerformed(ActionEvent e) {\n if(newTable.getRowCount() == 0){\n Toolkit.getDefaultToolkit().beep();\n return;\n }\n int index = table.getSelectedRow();\n int size = newTable.getRowCount();\n if(index > size || index < 0){\n table.setRowSelectionInterval(0,0);\n index = table.getSelectedRow();\n }\n newTable.removeRow(index);\n \n\n //Select an index.\n index--;\n if(index < 0){\n index++;\n }\n if(newTable.getRowCount() != 0){\n table.setRowSelectionInterval(index, index);\n }\n }", "private void tblSachMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblSachMouseClicked\n int row = tblSach.getSelectedRow();\n txbMaSach.setText(tblSach.getValueAt(row, 0).toString());\n txbTenSach.setText(tblSach.getValueAt(row, 1).toString());\n cbTheLoai.setSelectedItem(tblSach.getValueAt(row, 2));\n tbxTacGia.setText(tblSach.getValueAt(row, 3).toString());\n txbSoLuong.setText(tblSach.getValueAt(row, 5).toString());\n txbGia.setText(tblSach.getValueAt(row, 4).toString());\n cbxNXB.setSelectedItem(tblSach.getValueAt(row, 6));\n controlTxb(false);\n }", "private void selectLastUsed() {\n // Set the initial selection of the table:\n if (initSelection != null) {\n boolean found = false;\n for (int i = 0; i < table.getRowCount(); i++) {\n if (tableModel.getElementAt(i).getFile().getPath().\n equals(initSelection)) {\n table.setRowSelectionInterval(i, i);\n found = true;\n break;\n }\n }\n if (!found && (table.getRowCount() > 0)) {\n table.setRowSelectionInterval(0, 0);\n }\n }\n else {\n if (table.getRowCount() > 0) {\n table.setRowSelectionInterval(0, 0);\n }\n }\n }" ]
[ "0.71582675", "0.7064201", "0.6986963", "0.6941872", "0.6933481", "0.6846358", "0.6822106", "0.6817472", "0.67116684", "0.66329926", "0.65691954", "0.6562548", "0.65613824", "0.6546707", "0.6530762", "0.6504571", "0.6504571", "0.64985543", "0.649457", "0.63827604", "0.6373469", "0.63550586", "0.63184804", "0.63154215", "0.6296743", "0.6282425", "0.62684196", "0.62639534", "0.6254663", "0.62276804", "0.62049466", "0.61925304", "0.61799693", "0.6139243", "0.61040336", "0.61008286", "0.6087254", "0.6075079", "0.60724497", "0.6062957", "0.6061897", "0.6028287", "0.6026416", "0.6022061", "0.6018935", "0.6000667", "0.59990734", "0.5984982", "0.598429", "0.59831494", "0.59722906", "0.59689355", "0.5967345", "0.5965596", "0.5964812", "0.5960692", "0.5940334", "0.5922017", "0.5904512", "0.5899541", "0.5897425", "0.5893842", "0.58898294", "0.5887218", "0.5883198", "0.5880273", "0.58742774", "0.58658105", "0.5863792", "0.5853883", "0.58424807", "0.5837409", "0.58305603", "0.58305603", "0.58250546", "0.5822284", "0.58203685", "0.58100706", "0.580565", "0.5800328", "0.57983726", "0.5796661", "0.57655776", "0.5763732", "0.57595855", "0.5759245", "0.5759151", "0.57562965", "0.575136", "0.5742182", "0.57358706", "0.5732813", "0.57291853", "0.5725424", "0.57230026", "0.5722809", "0.57204473", "0.5711881", "0.57106173", "0.57099414" ]
0.62845707
25
this method will open pdf file for about.
private void popAbout() { try { //File file=new File(filepath); Desktop.getDesktop().open(new java.io.File("about.pdf")); } catch (IOException ex) { JOptionPane.showMessageDialog(rootPane,"File not found or supported"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void popHelp() {\n try {\n //File file=new File(filepath);\n Desktop.getDesktop().open(new java.io.File(\"help.pdf\"));\n } catch (IOException ex) {\n JOptionPane.showMessageDialog(rootPane,\"File not found or supported\");\n }\n }", "private void jBtnHelpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnHelpActionPerformed\n // TODO add your handling code here:\n if (Desktop.isDesktopSupported()) {\n try {\n File myFile = new File(\"help.txt\");\n Desktop.getDesktop().open(myFile);\n } catch (IOException ex) {\n // no application registered for PDFs\n }\n }\n }", "private void getPDF() {\n //for greater than lolipop versions we need the permissions asked on runtime\n //so if the permission is not available user will go to the screen to allow storage permission\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && ContextCompat.checkSelfPermission(this,\n Manifest.permission.READ_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED) {\n Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,\n Uri.parse(\"package:\" + getPackageName()));\n startActivity(intent);\n return;\n }\n\n //creating an intent for file chooser\n Intent intent = new Intent();\n intent.setType(\"application/pdf\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select PDF File\"), PICK_PDF_CODE);\n }", "@Override\r\n public void actionPerformed(ActionEvent e) {\n \r\n if (Desktop.isDesktopSupported()) {\r\n try {\r\n File myFile = new File(\"E:\");\r\n Desktop.getDesktop().open(myFile);\r\n \r\n } catch (IOException ex) {\r\n // no application registered for PDFs\r\n }\r\n}\r\n \r\n \r\n }", "private void launchPdfFile(File pdfFile){\n String dstPath = (Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_DOWNLOADS) + \"/\" + pdfFile.getName());\n File dstFile = new File(dstPath);\n if (dstFile.exists()){ //if file exists\n Uri path = Uri.fromFile(dstFile); //path of file\n Intent objIntent = new Intent(Intent.ACTION_VIEW); //intent to launch pdf file\n objIntent.setDataAndType(path, \"application/pdf\");\n objIntent.setFlags(Intent. FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(objIntent);//Starting the pdf viewer\n } else {\n Toast.makeText(this, \"Error: This file does not exists.\",\n Toast.LENGTH_SHORT).show();\n }\n }", "public void showPdfChooser() {\n Intent intent2 = new Intent();\n intent2.setType(\"application/pdf\");\n intent2.setAction(\"android.intent.action.GET_CONTENT\");\n startActivityForResult(Intent.createChooser(intent2, \"Select Document\"), PICK_IMAGE_REQUEST);\n }", "public void actionPerformed(ActionEvent arg0) {\n\t\t \t \ttry {\n\t\t\t\t\t\tDesktop.getDesktop().open(new File(new File(\"\").getAbsolutePath() + \n\t\t\t\t\t\t\t\t\"\\\\src\\\\pdf\\\\DocumentationUtilisateur.pdf\"));\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t }", "@FXML\n\tpublic void OpenHelpContentPage() {\n\n\t\tif (!Desktop.isDesktopSupported()) {\n\t\t\tSystem.out.println(\"Desktop not supported\");\n\t\t\treturn;\n\t\t}\n\n\t\tif (!Desktop.getDesktop().isSupported(Desktop.Action.OPEN)) {\n\t\t\tSystem.out.println(\"File opening not supported\");\n\t\t\treturn;\n\t\t}\n\n\t\tfinal Task<Void> task = new Task<Void>() {\n\t\t\t@Override\n\t\t\tpublic Void call() throws Exception {\n\t\t\t\ttry {\n\t\t\t\t\tFile sx3InstallLocation = SX3Manager.getInstance().getInstallLocation().getParentFile()\n\t\t\t\t\t\t\t.getAbsoluteFile();\n\t\t\t\t\tDesktop.getDesktop().open(new File(\n\t\t\t\t\t\t\tsx3InstallLocation + File.separator + \"Cypress_EZ-USB_SX3_ConfigurationUtility.pdf\"));\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tSystem.err.println(e.toString());\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t};\n\n\t\tfinal Thread thread = new Thread(task);\n\t\tthread.setDaemon(true);\n\t\tthread.start();\n\t}", "private void selectPdf() {\n\n Intent intent = new Intent();\n intent.setType(\"application/pdf\");\n intent.setAction(Intent.ACTION_GET_CONTENT);//to fetch files\n startActivityForResult(intent,86);\n\n\n\n }", "private void openFile(String name){\n File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);\n File file = new File(path, \"\"+name);\n\n Intent install = new Intent(Intent.ACTION_VIEW);\n install.setDataAndType(Uri.fromFile(file), \"application/pdf\");\n install.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(install);\n\n }", "public void onClick(View v) {\n\t\t\t\topenThisFileFromSD(\"maintainguideactivity.pdf\");\n\t\t\t}", "@Override\n public void onClick(View view) {\n\n //Check if a paper was actually saved to the device\n if (view.findViewById(R.id.md_title) != null) {\n String paperTitle = (String) view.findViewById(R.id.md_title).getTag();\n PDFViewer viewer = new PDFViewer();\n viewer.openPDF(\"\", paperTitle, view);\n\n }\n else\n {\n CharSequence paperMissingText = \"File not found.\";\n Toast toast = Toast.makeText(mContext, paperMissingText, Toast.LENGTH_SHORT);\n toast.show();\n }\n }", "private void openAbout() {\r\n \tIntent intent = new Intent(this, AboutActivity.class);\r\n \tstartActivity(intent);\r\n }", "public void cargarPdf() {\n\t\tif (pdf != null) {\n\t\t\tFacesMessage message = new FacesMessage(\"Se cargo \", pdf.getFileName() + \" correctamente.\");\n\t\t\tFacesContext.getCurrentInstance().addMessage(null, message);\n\t\t}\n\t}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tIntent intent = new Intent(getApplicationContext(),Routine.class);\n\t\t\t\tintent.putExtra(\"pdf\", \"http://www.aust.edu/bba/class_routine_mba.pdf\");\n\t\t\t\tstartActivity(intent);\n\t\t\t}", "private void openAbout() {\r\n\t\tJDialogAbout jDialogAbout = new JDialogAbout();\r\n\t\tjDialogAbout.setVisible(true);\r\n\t}", "public void loadPdfFile() {\n PDFView.Configurator configurator;\n RelativeLayout relativeLayout = (RelativeLayout)this.pdfView.getParent();\n this.errorTextView = (TextView)relativeLayout.findViewById(2131296408);\n this.progressBar = (ProgressBar)relativeLayout.findViewById(2131296534);\n this.sharedPreferences = Factory.getInstance().getMainNavigationActivity().getSharedPreferences(\"AppsgeyserPrefs\", 0);\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"pdf_saved_page_\");\n stringBuilder.append(this.initialTabId);\n savedPageKey = stringBuilder.toString();\n if (this.pathFile.startsWith(\"file:///\")) {\n String string2 = this.pathFile.replace((CharSequence)\"file:///android_asset/\", (CharSequence)\"\");\n configurator = this.pdfView.fromAsset(string2);\n } else {\n boolean bl = this.pathFile.startsWith(\"http\");\n configurator = null;\n if (bl) {\n String string3 = this.pathFile;\n new LoaderPdf().execute((Object[])new String[]{string3});\n }\n }\n this.pdfView.useBestQuality(true);\n if (configurator == null) return;\n try {\n this.loadConfigurator(configurator);\n return;\n }\n catch (Exception exception) {\n exception.printStackTrace();\n this.progressBar.setVisibility(8);\n }\n }", "@FXML\n\tpublic void generarPDFClick(ActionEvent event) {\n\t\tString htmlContent = this.examen.getTitolHtml()+this.examen.getEnunciatHtml()+System.lineSeparator();\n\n\t\tPdfManager manager;\n\t\ttry {\n\t\t\tmanager = new PdfManager(\"Examen.pdf\");\n\n\t\t\tmanager.generarPDF( htmlContent );\n\n\t\t\tFile pdfGenerat = new File(\"Examen.pdf\");\n\n\t\t\tHostServices hostServices = Model.getInstance().getApp().getHostServices();\n\t hostServices.showDocument(pdfGenerat.getAbsolutePath());\n\n\t\t} catch (Excepcio e) {\n\t\t\t//e.printStackTrace();\n\t\t MenuController.mostrarError(\"Examen a PDF\", \"Error generant el document. \"+e.getMessage());\n\t\t}\n\t}", "void selectPDF()\n {\n Intent intent=new Intent();\n intent.setType(\"application/pdf\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(intent,9);\n }", "private PDF getPDF() {\n final Intent intent = getIntent();\n\t\tUri uri = intent.getData(); \t\n\t\tfilePath = uri.getPath();\n\t\tif (uri.getScheme().equals(\"file\")) {\n\t\t\tif (history) {\n\t\t\t\tRecent recent = new Recent(this);\n\t\t\t\trecent.add(0, filePath);\n\t\t\t\trecent.commit();\n\t\t\t}\n\t\t\treturn new PDF(new File(filePath), this.box);\n \t} else if (uri.getScheme().equals(\"content\")) {\n \t\tContentResolver cr = this.getContentResolver();\n \t\tFileDescriptor fileDescriptor;\n\t\t\ttry {\n\t\t\t\tfileDescriptor = cr.openFileDescriptor(uri, \"r\").getFileDescriptor();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tthrow new RuntimeException(e); // TODO: handle errors\n\t\t\t}\n \t\treturn new PDF(fileDescriptor, this.box);\n \t} else {\n \t\tthrow new RuntimeException(\"don't know how to get filename from \" + uri);\n \t}\n }", "private void generarDocP(){\n generarPdf(this.getNombre());\n }", "public static void showAboutUs() throws IOException {\n Main.FxmlLoader(ABOUTUSPAGE_PATH);\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tString url = \"file:///C:/Users/J1637009/Desktop/aaaaa.pdf\";\n\t\t\t\tString url2 = \"file:///N:/AE/2017/‹l•[/ƒJƒPƒnƒVAEƒG[ƒWƒFƒ“ƒg‹l•[/doubLeiƒNƒŠƒGƒCƒeƒBƒuEj_18.pdf\";\n\t\t\t\t\n\t\t\t\t\n\t\t try {\n\t\t\t\t\tjava.awt.Desktop.getDesktop().browse(java.net.URI.create(url2));\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\t\n\t\t\t}", "@SuppressLint(\"InlinedApi\")\n @Override\n public void onDataLoaded(Uri pdfUri) {\n if (mAlreadyOpenedPdf) {\n return;\n }\n\n // Open in external application\n mAlreadyOpenedPdf = true;\n if (pdfUri == null) {\n Toast.makeText(getActivity(), R.string.cannot_download_pdf, Toast.LENGTH_SHORT).show();\n } else {\n try {\n startActivity(\n new Intent(Intent.ACTION_VIEW, pdfUri)\n .addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION)\n );\n } catch (ActivityNotFoundException e) {\n Toast.makeText(getActivity(), R.string.cannot_open_pdf, Toast.LENGTH_SHORT).show();\n }\n }\n\n // Dismiss this dialog (we already dismiss ourselves if there's any saved state so loss here is ok)\n dismissAllowingStateLoss();\n }", "@Override\r\n\t\tprotected void onPostExecute(File result) {\n\t\t\tsuper.onPostExecute(result);\r\n\t\t\tpDialog.dismiss();\r\n\t\t\t Uri path = Uri.fromFile(file);\r\n\t\t\ttry {\r\n\t Intent intent = new Intent(Intent.ACTION_VIEW);\r\n\t intent.setDataAndType(path, \"application/pdf\");\r\n\t intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n\t startActivity(intent);\r\n\t \r\n\t } catch (ActivityNotFoundException e) {\r\n\t \r\n\t }\r\n\t\t\t\r\n\t\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_pdf, container, false);\n\n try {\n Bundle bundle = getArguments();\n String filename = bundle.getString(\"FILE_NAME\");\n pdfView = view.findViewById(R.id.pdfView);\n File pdf = new File(filename);\n pdfView.fromFile(pdf)\n .enableDoubletap(true)\n .enableSwipe(true)\n .load();\n } catch (Exception ex) {\n Snackbar.make(getActivity().getWindow().getDecorView(), \"فایل خراب است\", Snackbar.LENGTH_LONG).show();\n }\n return view;\n }", "public void showAbout() {\n\t\t/* track \"About\" */\n\t\ttracker.trackEvent(\"Listings\", \"Click\", \"About\", 0);\n\n\t\tUri uri = Uri.parse(\"http://static.flipzu.com/about-android.html\");\n\t\tIntent intent = new Intent(Intent.ACTION_VIEW, uri);\n\t\tstartActivity(intent);\n\t}", "void open() {\n \tJFileChooser fileopen = new JFileChooser();\n int ret = fileopen.showDialog(null, \"Open file\");\n\n if (ret == JFileChooser.APPROVE_OPTION) {\n document.setFile(fileopen.getSelectedFile());\n textArea.setText(document.getContent());\n }\n }", "public void onCreatePdf(View view) {\n\n\t\t// Images used in the PDF should be JPG images, stored as Assets\n\t\tbyte[] stickerBmp = Pdf.getAssetJpgBytes(this, JPG_SRC);\n\n\t\t// Create a new PDF\n\t\tPdf pdf = new Pdf();\n\t\tStream stream = pdf.addPage();\n\n\t\t// Add some text at a specific position\n\t\t// The coordinate system is setup where the origin (0,0) is at the\n\t\t// bottom left corner\n\t\tstream.addText(\"This is a test pdf.\", PDF_HEADER_FONT_SIZE, 100, 50, RED);\n\n\t\t// Add some text with a different color\n\t\tstream.addText(userText.getText().toString(), BLUE, PDF_HEADER_FONT_SIZE);\n\n\t\t// Add a line with a color and a width\n\t\tstream.addHorizontalLine(GREEN, LINE_WIDTH);\n\n\t\t// Add an image at a specific coordinate (top right corner of the page)\n\t\tstream.addBmpImage(Pages.PAGE_WIDTH - (int) Stream.MARGIN_HORIZONTAL - JPG_WIDTH, Pages.PAGE_HEIGHT - (int) Stream.MARGIN_VERTICAL - JPG_HEIGHT,\n\t\t\t\tJPG_WIDTH, JPG_HEIGHT, stickerBmp);\n\n\t\t// Get the raw PDF bytes like this:\n\t\tbyte[] pdfBytes = pdf.getPDF();\n\n\t\t// Optionally, write the bytes out to a file:\n\t\tFile file = Pdf.writePdf(this, pdfBytes, PDF_PDFNAME);\n\n\t\t// Show the PDF in an external viewer\n\t\tIntent intent = new Intent(Intent.ACTION_VIEW);\n\t\tUri uri = Uri.fromFile(file);\n\t\tintent.setDataAndType(uri, MIME_TYPE_PDF);\n\t\tstartActivity(intent);\n\n\t}", "@Override\n public void handle(ActionEvent t) {\n \n try {\n Runtime.getRuntime().exec(\"rundll32 url.dll,FileProtocolHandler \" + \"src\\\\multimedia\\\\Manual de usuario.pdf\");\n} catch (IOException e) {\n e.printStackTrace();\n}\n\n}", "public void genPDF(String qfname)\r\n\t{\n\t\tboolean res = loadQg(qfname);\r\n\t\tif(!res)\r\n\t\t{\r\n\t\t\tmsg = \"(PDFW:GenPDF) Can not load questions from: \"+qfname;\r\n\t\t\tJOptionPane.showMessageDialog(null, msg);\r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "private void tbsOpenFile(){\n String path = Environment.getExternalStorageDirectory().getPath() + \"/\" + \"android面试题及答案.docx\";\n File file=new File(path);\n if (file.exists()){\n\n\n Bundle bundle=new Bundle();\n bundle.putString(\"filePath\", file.getPath());\n bundle.putString(\"tempPath\", Environment.getExternalStorageDirectory().getPath());\n boolean result = mTbsReaderView.preOpen(\"doc\", false);//Word类型的是“doc” 、 PDF的类型是“pdf”\n\n mTbsReaderView.openFile(bundle);\n\n }else {\n Toast.makeText(this,\"文件不存在\",Toast.LENGTH_SHORT).show();\n }\n\n }", "public static void main(String[] args) throws IOException {\n\t PDDocument document = new PDDocument();\n\n\t //Creating a blank page\n\t PDPage blankPage = new PDPage();\n\t \n\t //Adding the blank page to the document\n\t document.addPage( blankPage );\n\n\t //Creating the PDDocumentInformation object \n\t PDDocumentInformation pdd = document.getDocumentInformation();\n\n\t //Setting the author of the document\n\t pdd.setAuthor(\"Tutorialspoint\");\n\t \n\t // Setting the title of the document\n\t pdd.setTitle(\"Sample document\"); \n\t \n\t //Setting the creator of the document \n\t pdd.setCreator(\"PDF Examples\"); \n\t \n\t //Setting the subject of the document \n\t pdd.setSubject(\"Example document\"); \n\t \n\t //Setting the created date of the document \n\t Calendar date = new GregorianCalendar();\n\t date.set(2015, 11, 5); \n\t pdd.setCreationDate(date);\n\t //Setting the modified date of the document \n\t date.set(2016, 6, 5); \n\t pdd.setModificationDate(date); \n\t \n\t //Setting keywords for the document \n\t pdd.setKeywords(\"sample, first example, my pdf\"); \n\t \n\t \n\t PDPageContentStream contentStream = new PDPageContentStream(document, blankPage);\n\t \n\t //Begin the Content stream \n\t contentStream.beginText(); \n\t \n\t //Setting the font to the Content stream \n\t contentStream.setFont(PDType1Font.TIMES_ROMAN, 12);\n\n\t //Setting the position for the line \n\t contentStream.newLineAtOffset(25, 500);\n\n\t String text = \"This is the sample document and we are adding content to it.\";\n\n\t //Adding text in the form of string \n\t contentStream.showText(text); \n\n\t //Ending the content stream\n\t contentStream.endText();\n\n\t System.out.println(\"Content added\");\n\n\t //Closing the content stream\n\t contentStream.close();\n\t \n\t //Saving the document \n\t document.save(\"doc_attributes.pdf\");\n\n\t System.out.println(\"Properties added successfully \");\n\t \n\t //Closing the document\n\t document.close();\n\t}", "@Override\n\tpublic void openDocument(String path, String name) {\n\t\t\n\t}", "public void PDF() {\n try {\r\n /* try {\r\n ImageIO.write(Imagen, \"png\", new File(Path + \"1\" + \".png\"));\r\n } catch (IOException ex) {\r\n Logger.getLogger(panelprincipal.getName()).log(Level.SEVERE, null, ex);\r\n }*/\r\n Image imagen = Image.getInstance(jfc.getSelectedFile().getPath() + \"#\" + \".png\");\r\n imagen.scaleAbsolute(500, 400);\r\n imagen.setAlignment(Element.ALIGN_CENTER);\r\n FileOutputStream archivo = new FileOutputStream(jfc.getSelectedFile().getPath() + \".PDF\");\r\n Document d = new Document();\r\n PdfWriter.getInstance(d, archivo);\r\n PDF creacion = new PDF();\r\n d.open();\r\n d.setPageSize(PageSize.LETTER);\r\n d.add(creacion.setTitulo(nombrediagrama));\r\n //doc.add(new Paragraph(\" Carlos Wilfredo Romero Maradiaga \\n\"));\r\n d.add(imagen);\r\n // doc.add(pdf.getCuerpo(\"\\nCódigo Generado:\\n\"));\r\n /* if (codigo.length()<2) {\r\n doc.add(pdf.getCuerpo(\"Para poder visualizar el código, primero debe generarlo desde el Sistema y vuelva a guardar el archivo.\"));\r\n } else {\r\n doc.add(pdf.getCuerpo(codigo));\r\n */\r\n d.close();\r\n JOptionPane.showMessageDialog(null, \"El PDF se genero excelente\", \"Excelente\", JOptionPane.INFORMATION_MESSAGE);\r\n } catch (Exception e) {\r\n }\r\n }", "public static void readPDF() throws IOException {\n File file = new File(\"Testdaten_Rechnungseinreichung.pdf\");\n FileInputStream fileInputStream = new FileInputStream(file);\n PDDocument pdfDocument = PDDocument.load(fileInputStream);\n\n System.out.println(\"Number of Pages: \" +pdfDocument.getPages().getCount());\n\n PDFTextStripper pdfTextStripper = new PDFTextStripper();\n\n String TextDocument = pdfTextStripper.getText(pdfDocument);\n\n PerformCheck performCheck = new PerformCheck(TextDocument);\n performCheck.checkIBAN();\n pdfDocument.close();\n fileInputStream.close();\n }", "private void addMetaData() {\r\n\t\tdocument.open();\r\n\t\tdocument.addTitle(\"My first PDF\");\r\n\t\tdocument.addSubject(\"Using iText\");\r\n\t\tdocument.addKeywords(\"Java, PDF, iText\");\r\n\t\tdocument.addAuthor(\"Lars Vogel\");\r\n\t\tdocument.addCreator(\"Lars Vogel\");\r\n\t\tdocument.close();\r\n\t}", "public void testCreate () throws IOException {\n\t PDDocument document = new PDDocument(); \r\n\t \r\n\t //Saving the document\r\n\t document.save(\"./my_doc.pdf\");\r\n\t \r\n\t System.out.println(\"PDF created\"); \r\n\t \r\n\t //Closing the document \r\n\t document.close();\r\n\t}", "void aboutMenuItem_actionPerformed(ActionEvent e) {\n AboutDialog dlg = new AboutDialog(this, \"About InfoFilter Application\", true);\n Point loc = this.getLocation();\n\n dlg.setLocation(loc.x + 50, loc.y + 50);\n dlg.show();\n }", "public static void openDocument(Context context, String strFilePath, String strFileType) {\n try {\n File file = new File(strFilePath);\n Intent intent = new Intent(Intent.ACTION_VIEW);\n /* if (strFileType.equals(\"pdf\")) {\n intent.setDataAndType(Uri.fromFile(file), \"application/pdf\");\n } else if (strFileType.equals(\"doc\") || strFileType.equals(\"docx\")) {\n MimeTypeMap myMime = MimeTypeMap.getSingleton();\n String mimeType = myMime.getMimeTypeFromExtension(strFilePath);\n intent.setDataAndType(Uri.fromFile(file), mimeType);\n } else {\n intent.setDataAndType(Uri.fromFile(file), \"application/*\");\n }*/\n intent.setDataAndType(Uri.fromFile(file), \"application/*\");\n intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);\n context.startActivity(intent);\n } catch (ActivityNotFoundException activityNotFoundException) {\n activityNotFoundException.printStackTrace();\n throw activityNotFoundException;\n } catch (Exception otherException) {\n otherException.printStackTrace();\n throw otherException;\n }\n }", "@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\tif (core == null) {\n\t\t\tcore = (MuPDFCore) getLastNonConfigurationInstance();\n\n\t\t\tif (savedInstanceState != null && savedInstanceState.containsKey(\"FileName\")) {\n\t\t\t\tmFileName = savedInstanceState.getString(\"FileName\");\n\t\t\t}\n\t\t}\n\t\tif (core == null) {\n\t\t\tcore = openFile(getIntent().getStringExtra(PATH));\n\n\t\t\tif (core != null && core.needsPassword()) {\n\t\t\t\trequestPassword(savedInstanceState);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (core != null && core.countPages() == 0) {\n\t\t\t\tcore = null;\n\t\t\t}\n\t\t}\n\t\tif (core == null) {\n\t\t\tAlertDialog alert = new AlertDialog.Builder(this).create();\n\t\t\talert.setTitle(\"문서를 열 수 없음\");\n\t\t\talert.setButton(AlertDialog.BUTTON_POSITIVE, \"dismiss\", new DialogInterface.OnClickListener() {\n\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\tfinish();\n\t\t\t\t}\n\t\t\t});\n\t\t\talert.show();\n\t\t\treturn;\n\t\t}\n\n\t\tcreateUI(savedInstanceState);\n\t}", "public void onClick(View v) {\n\t\t\topenPDF();\n\t\t}", "private void showOpenFileDialog() {\n Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);\n intent.addCategory(Intent.CATEGORY_OPENABLE);\n intent.setType(\"*/*\");\n // We accept PDF files and images (for image documents).\n intent.putExtra(Intent.EXTRA_MIME_TYPES, new String[] {\"application/pdf\", \"image/*\"});\n\n // Set of the intent for result, so we can retrieve the Uri of the selected document.\n startActivityForResult(intent, REQUEST_OPEN_DOCUMENT);\n }", "private void detectionPDF() {\n\t\tif (sourcePDF.getText().equals(\"\")){\n\t\t\tlockButton();\n\t\t\tmessage.setText(\"<html><span color='red'>Pas de PDF</span></html>\");\n\t\t}\n\t\telse{\n\t\t\tif(new File(sourcePDF.getText()).exists()){\n\t\t\t\tmessage.setText(\"<html><head><meta charset=\\\"UTF-8\\\"><span color='green'>Fichier PDF détecté</span></html>\");\n\t\t\t\tunlockButton();\n\t\t\t}\n\t\t\telse\n\t\t\t\tmessage.setText(\"<html><span color='red'>le fichier \"+ sourcePDF.getText() +\" n'existe pas</span></html>\");\n\t\t}\n\t}", "private void getPDF(){\r\n\t\t\r\n\t\tif(request.getParameter(\"exportType\").equals(PDFGenerator.EXPORT_ADMIN)){\r\n\t\t\tgetAdministration(); // pdf uses same data\r\n\t\t} else if(request.getParameter(\"exportType\").equals(PDFGenerator.EXPORT_TEACHER)){\r\n\t\t\tgetEventRegistration(); // pdf uses same data\r\n\t\t}\r\n\t\t\r\n\t\tPDFGenerator pdfGen = new PDFGenerator();\r\n\t\tpdfGen.createDocument(request, response);\r\n\t\t\r\n\t\tString eventTitle = \"all\";\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n PdfFile pdfFile=new PdfFile(\"PDF File\");\n pdfFile.open();\n pdfFile.close();\n pdfFile.edit();\n WordFile wordFile=new WordFile(\"Word File\");\n wordFile.open();\n wordFile.close();\n wordFile.edit();\n JavaFile javaFile=new JavaFile(\"Java File\");\n javaFile.open();\n javaFile.close();\n javaFile.edit();\n\n }", "public static void main(String[] args) {\n PdfDocument pdf = new PdfDocument();\r\n\r\n PdfPageBase page = pdf.getPages().add();\r\n\r\n Rectangle2D rectangle2D = new Rectangle.Float();\r\n rectangle2D.setFrame(new Point2D.Double(10,10),new Dimension(100,100));\r\n\r\n PdfPopupAnnotation annotation = new PdfPopupAnnotation(rectangle2D, \"test\");\r\n annotation.setIcon(PdfPopupIcon.Help);\r\n annotation.setOpen(true);\r\n annotation.setAuthor(\"e-iceblue\");\r\n annotation.setSubject(\"subject_popup\");\r\n annotation.setColor(new PdfRGBColor(255,0,150));\r\n\r\n page.getAnnotationsWidget().add(annotation);\r\n String result = \"output/setAuthorAndSubjectForPdfPopupAnnotation.pdf\";\r\n\r\n //Save the document\r\n pdf.saveToFile(result);\r\n\t}", "public void createPdf() {\n\t\tDocument document = new Document();\n\t\ttry {\n\t\t\tPdfWriter.getInstance(document, new FileOutputStream(fileName));\n\t\t\tFont header = new Font(Font.FontFamily.HELVETICA, 15, Font.BOLD);\n\t\t\tdocument.open();\n\t\t\t// set the title on the page as \"My Albums\"\n\t\t\tif (state.equals(\"a\")) {\n\t\t\t\tParagraph aHead = new Paragraph();\n\t\t\t\taHead.setFont(header);\n\t\t\t\taHead.add(\"My Albums\\n\\n\");\n\t\t\t\tdocument.add(aHead);\n\t\t\t}\n\t\t\t// or set the title on the page as \"My Publications\"\n\t\t\telse if (state.equals(\"p\")) {\n\t\t\t\tParagraph pHead = new Paragraph();\n\t\t\t\tpHead.setFont(header);\n\t\t\t\tpHead.add(\"My Publications\\n\\n\");\n\t\t\t\tdocument.add(pHead);\n\t\t\t}\n\t\t\t// create the table of albums/publications\n\t\t\tdocument.add(createTable());\n\t\t\tdocument.close();\n\t\t\tFile f = new File(fileName);\n\t\t\ttry {\n\t\t\t\tDesktop.getDesktop().browse(f.toURI());\n\t\t\t}\n\t\t\tcatch(IOException e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (DocumentException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "protected void aboutUs(ActionEvent ae) {\n\t\tString info = \"【猿来入此】出品\\n\";\n\t\tinfo += \"网址:http://programmer.ischoolbar.com \\n\";\n\t\tinfo += \"每天更新一个项目,并附带视频教程!\";\n\t\tString[] buttons = {\"迫不及待去看看!\",\"心情不好以后再说!\"};\n\t\tint ret = JOptionPane.showOptionDialog(this, info, \"关于我们\", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.DEFAULT_OPTION, new ImageIcon(LoginFrm.class.getResource(\"/images/logo.png\")), buttons, null);\n\t\tif(ret == 0){\n\t\t\t//采用Java 调用系统浏览器打开制定\n\t\t\ttry {\n\t\t\t\tURI uri = new URI(\"http://programmer.ischoolbar.com\");\n\t\t\t\tDesktop.getDesktop().browse(uri);\n\t\t\t\t//Runtime.getRuntime().exec(\"explorer http://programmer.ischoolbar.com\");\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}else{\n\t\t\tJOptionPane.showMessageDialog(this, \"你真是狠心,坏淫!\");\n\t\t}\n\t}", "public PDF()\n {\n \n i_hdl = create_Handler();\n }", "private void readPdfFile(String path) {\n\n try {\n PdfReader pdfReader = new PdfReader(path);\n fileTextContent = PdfTextExtractor.getTextFromPage(pdfReader, 1).trim();\n Log.i(\"PDF_CONTENTS\", \"The pdf content: \"+ fileTextContent);\n pdfReader.close();\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void open()\n {\n }", "public static void main(String[] args) {\n\t\tString path = \"Test1.pdf\";\n\t\t\n\n\t}", "public void helpAbout_actionPerformed(ActionEvent e) {\n AboutDialog dlg = new AboutDialog(this, \"About InfoFilter Application\", true);\n Point loc = this.getLocation();\n\n dlg.setLocation(loc.x + 50, loc.y + 50);\n dlg.show();\n }", "private void displayFromAsset(String assetFileName) {\n pdfFileName = assetFileName;\n\n pdfView.fromAsset(SAMPLE_FILE)\n .defaultPage(pageNumber)\n .enableSwipe(true)\n\n .swipeHorizontal(false)\n .enableAnnotationRendering(true)\n .scrollHandle(new DefaultScrollHandle(this))\n .load();\n\n }", "public void create() {\n PDDocument document = new PDDocument();\n PDPage page = new PDPage();\n document.addPage(page);\n\n // Create a new font object selecting one of the PDF base fonts\n PDFont font = PDType1Font.HELVETICA_BOLD;\n try (document) {\n // Start a new content stream which will \"hold\" the to be created content\n writeDataToDocument(document, page, font);\n // Save the results and ensure that the document is properly closed:\n document.save(\"Hello World.pdf\");\n } catch (IOException ioException) {\n ioException.printStackTrace();\n }\n }", "private void verPDFFrame(String filePath) {\n SwingController c = new SwingController();\n c.setIsEmbeddedComponent(true);\n\n PropertiesManager prop = new PropertiesManager(\n System.getProperties(),\n ResourceBundle.getBundle(PropertiesManager.DEFAULT_MESSAGE_BUNDLE));\n\n prop.set(PropertiesManager.PROPERTY_DEFAULT_ZOOM_LEVEL, \"1.25\");\n prop.setBoolean(PropertiesManager.PROPERTY_VIEWPREF_FITWINDOW, Boolean.TRUE);\n prop.setBoolean(PropertiesManager.PROPERTY_SHOW_TOOLBAR_ANNOTATION, Boolean.FALSE);\n prop.setBoolean(PropertiesManager.PROPERTY_SHOW_TOOLBAR_FIT, Boolean.FALSE);\n prop.setBoolean(PropertiesManager.PROPERTY_SHOW_TOOLBAR_ROTATE, Boolean.FALSE);\n prop.setBoolean(PropertiesManager.PROPERTY_SHOW_TOOLBAR_TOOL, Boolean.FALSE);\n prop.setBoolean(PropertiesManager.PROPERTY_SHOW_UTILITY_UPANE, Boolean.FALSE);\n prop.setBoolean(PropertiesManager.PROPERTY_SHOW_UTILITY_SEARCH, Boolean.FALSE);\n\n SwingViewBuilder fac = new SwingViewBuilder(c, prop);\n\n // add interactive mouse link annotation support via callback\n c.getDocumentViewController().setAnnotationCallback(\n new org.icepdf.ri.common.MyAnnotationCallback(c.getDocumentViewController()));\n javax.swing.JPanel viewerComponentPanel = fac.buildViewerPanel();\n JFrame applicationFrame = new JFrame();\n\n applicationFrame.setDefaultCloseOperation(DISPOSE_ON_CLOSE);\n applicationFrame.getContentPane().add(viewerComponentPanel);\n // Now that the GUI is all in place, we can try openning a PDF\n c.setPageFitMode(DocumentViewController.PAGE_FIT_WINDOW_WIDTH, false);\n c.openDocument(filePath);\n // show the component\n applicationFrame.pack();\n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n applicationFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);\n applicationFrame.setSize(screenSize);\n applicationFrame.setLocationRelativeTo(null);\n applicationFrame.setResizable(false);\n applicationFrame.setVisible(true);\n\n }", "public static void main(String args[]) throws Exception {\n\t String filePath = \"test.pdf\";\r\n\t \r\n\t String pdfText = FileReader.getFile(filePath, 581, 584); \r\n\t text_position.position(580, 584);\r\n\t \r\n//\t String pdfText = FileReader.getFile(filePath, 396, 407); \r\n//\t text_position.position(395, 407);\r\n\r\n\t txtCreate.creatTxtFile(\"test\");\r\n\t txtCreate.writeTxtFile(pdfText);\r\n\t xmlCreater.getXML(\"test.txt\");\r\n }", "private void showFileChooser() {\n // Intent intent = new Intent();\n\n /* intent.setType(\"application/pdf\");\n intent.setType(\"docx*//*\");*/\n\n Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);\n intent.addCategory(Intent.CATEGORY_OPENABLE);\n String [] mimeTypes = {\"application/pdf/docx\"};\n intent.setType(\"*/*\");\n intent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes);\n\n\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"), PICK_IMAGE_REQUEST);\n }", "@FXML public void showAbout() {\n\t\tPopupMessage.getInstance().showAlert(AlertType.INFORMATION, \n\t\t\t\t\t\t\t\t\t\t\taboutTitle,\n\t\t\t\t\t\t\t\t\t\t\taboutHeader, \n\t\t\t\t\t\t\t\t\t\t\taboutDetails);\n\t}", "protected void open()\n {\n }", "private void createPdf(String sometext) {\n PdfDocument document = new PdfDocument();\n // crate a page description\n PdfDocument.PageInfo pageInfo = new PdfDocument.PageInfo.Builder(300, 600, 1).create();\n // start a page\n PdfDocument.Page page = document.startPage(pageInfo);\n Canvas canvas = page.getCanvas();\n Paint paint = new Paint();\n paint.setColor(Color.RED);\n canvas.drawCircle(50, 50, 30, paint);\n paint.setColor(Color.BLACK);\n canvas.drawText(sometext, 80, 50, paint);\n //canvas.drawt\n // finish the page\n document.finishPage(page);\n // draw text on the graphics object of the page\n // Create Page 2\n pageInfo = new PdfDocument.PageInfo.Builder(300, 600, 2).create();\n page = document.startPage(pageInfo);\n canvas = page.getCanvas();\n paint = new Paint();\n paint.setColor(Color.BLUE);\n canvas.drawCircle(100, 100, 100, paint);\n document.finishPage(page);\n\n // write the document content\n String directory_path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + \"/mypdf/\";\n File file = new File(directory_path);\n if (!file.exists()) {\n file.mkdirs();\n }\n double random_double = Math.random() * (999999 - 999 + 1) + 999;\n String targetPdf = directory_path + String.valueOf(random_double) + \".pdf\";\n File filePath = new File(targetPdf);\n try {\n document.writeTo(new FileOutputStream(filePath));\n Toast.makeText(this, \"Done\", Toast.LENGTH_LONG).show();\n } catch (IOException e) {\n Log.e(\"main\", \"error \" + e.toString());\n Toast.makeText(this, \"Something wrong: \" + e.toString(), Toast.LENGTH_LONG).show();\n }\n // close the document\n document.close();\n }", "public void printCard(String name, String number, String age, String grade, \n\t\t\tString country, String bio, String filepath) {\n\t\tPDFCreator p = new PDFCreator(name,number,age,grade,country,bio,filepath);\n\t}", "public void onClick(View v) {\n\t\t\t\t\t try {\n\t\t\t\t\t\texistingEntry = mApi.metadata(\"/Getting Started.pdf\", 1, null, false, null);\n\t\t\t\t\t} catch (DropboxException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\tLog.i(\"DbExampleLog\", \"The file's rev is now: \" + existingEntry.rev);\n\t\t\t\t\tLog.i(\"DbExampleLog\", \"The file's rev is now: \" + existingEntry.size); \n\t\t\t\t\tLog.i(\"DbExampleLog\", \"The file's rev is now: \" + existingEntry.fileName());\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t /*startActivity(intent);\n\t\t\t\t\t finish();*/\n\t\t\t\t }", "public void processAbout() {\n AppMessageDialogSingleton dialog = AppMessageDialogSingleton.getSingleton();\n \n // POP UP THE DIALOG\n dialog.show(\"About This Application\", \"Application Name: Metro Map Maker\\n\"\n + \"Written By: Myungsuk Moon and Richard McKenna\\n\"\n + \"Framework Used: DesktopJavaFramework (by Richard McKenna)\\n\"\n + \"Year of Work: 2017\");\n }", "public void crearPDF()\r\n\t{\r\n\t\tif (!new File(ruta).exists())\r\n\t\t\t(new File(ruta)).mkdirs();\r\n\r\n\t\tFile[] files = (new File(ruta)).listFiles();\r\n\t\tString ruta = \"\";\r\n\t\tif (files.length == 0) {\r\n\t\t\truta = this.ruta + huesped + \"0\" + \".pdf\";\r\n\t\t} else {\r\n\t\t\tString path = files[files.length - 1].getAbsolutePath();\r\n\t\t\tString num = path.substring(path.length() - 5, path.length() - 4);\r\n\r\n\t\t\truta = this.ruta + huesped + (Integer.parseInt(num) + 1) + \".pdf\";\r\n\t\t}\r\n\r\n\t\tSimpleDateFormat formato = new SimpleDateFormat(\"dd/MM/YYYY\");\r\n\t\t\r\n\t\tcabecera = \"\\n\"+\"Resonance Home\" + \"\\n\"+ \r\n \"Armenia, Quindio\" + \"\\n\" + \r\n \"Colombia\" + \"\\n\\n\" + \r\n\t\t\t\t\"Fecha \" + reserva.getFecha().toString() + \"\\n\\n\\n\";\r\n\t\tcontenido = \"Reserva de hospedaje: \"+ reserva.getHospedaje().getId() + \"\\n\" + \r\n \t\"Titulo del Hospedaje: \" + reserva.getHospedaje().getTitulo() + \" \" + \"\\n\" +\r\n \t\"Dirección: \" + reserva.getHospedaje().getDireccion().getDireccion() + \", \" + reserva.getHospedaje().getDireccion().toString() + \"\\n\" +\r\n\t\t\t\t\"Anfitrion: \" + nombreAnfitrion + \"\\n\" + \"Correo: \" + emailAnfitrion + \"\\n\\n\\n\" + \"Huesped: \"\r\n\t\t\t\t+ nombreHuesped + \"\\n\" +\r\n \t\"Metodo de pago: \" + reserva.getTarjeta().getNumeroT() + \" Tarjeta de credito\" + \"\\n\\n\" +\r\n \tformato.format(reserva.getFechaInicial()) + \" hasta \"+ formato.format(reserva.getFechaFinal()) +\"\\n\\n\" +\r\n \t\"Descripcion\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalor\" + \"\\n\\n\" + \r\n\t\t\t\t\"Huespedes\" + \"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"\r\n\t\t\t\t+ reserva.getNumeroHuespedes() + \"\\n\" +\r\n\t\t\t\t\"Alojamiento\" + \"\t\t\t\t\t\t\t\t\t\t\t\t\t \" + precioCompleto + \"\\n\"\r\n\t\t\t\t+ \"Tarifa de limpieza\" + \"\t\t\t\t \t \" + precioLimpieza + \"\\n\" + \"Comision por servicio\"\r\n\t\t\t\t+ \"\t\t\t\t\t\" + precioComision + \"\\n\\n\";\r\n\t\tpiePagina = \"TOTAL \" + \" \" + \"$ \" + reserva.getValor() + \"\\n\" ;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tFileOutputStream archivo = new FileOutputStream(ruta);\r\n\t\t\tDocument doc = new Document(PageSize.A5, 10, 10, 10, 10);\r\n\t\t\tPdfWriter.getInstance(doc, archivo);\r\n\t\t\tdoc.open();\r\n\t\t\tdoc.add(obtenerCabecera(cabecera));\r\n\t\t\tdoc.add(obtenerContenido(contenido));\r\n\t\t\tdoc.add(obtenerPiePagina(piePagina));\r\n\t\t\tdoc.close();\r\n\t\t\tthis.ruta = ruta;\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tSystem.out.println(\"\" + e);\r\n\t\t}\r\n\r\n\t}", "@Override\r\n\tpublic File createPDF() {\n\t\treturn null;\r\n\t}", "private void popupMenuAbout() {\n\t\t//\n\t\t// Display the dialog\n\t\t//\n\t\tAboutDialog aboutDialog = new AboutDialog(parent.getShell(), SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM);\n\t\taboutDialog.open();\n\t}", "public void createPDF(Loan loan, boolean isSwedish, String path, int count, String pathname) \n throws FileNotFoundException, DocumentException {\n log.info(\"createPDF : {} -- {}\", path, isSwedish);\n\n this.isSwedish = isSwedish;\n\n switch (pathname) {\n case \"local\":\n externalPath = LOCAL_EXTERNAL_FILES;\n break;\n case \"dina-loans\":\n externalPath = REMOTE_EXTERNAL_FILES_LOANS;\n break;\n default:\n externalPath = REMOTE_EXTERNAL_FILES_AS;\n break;\n }\n\n StringBuilder sb = new StringBuilder();\n sb.append(path);\n sb.append(\"/loanrequest_\");\n sb.append(loan.getId());\n\n File summaryAdminFile = new File(sb.toString() + \"_admin.pdf\"); \n sb.append(\".pdf\");\n File summaryFile = new File(sb.toString().trim()); \n\n document = new Document(PageSize.LETTER);\n adminDocument = new Document(PageSize.LETTER);\n PdfWriter.getInstance(document, new FileOutputStream(summaryFile));\n PdfWriter.getInstance(adminDocument, new FileOutputStream(summaryAdminFile));\n document.open();\n adminDocument.open();\n\n addTitle(loan);\n addContact(loan);\n\n switch (count) {\n case 9:\n addLoanRequestForScientificPurpose(loan);\n addLoanSampleList(loan);\n if (!RequestType.Information.isInformation(loan.getType())) {\n if (RequestType.Physical.isPhysical(loan.getType())) {\n addDestructiveInformation(loan);\n } else {\n addPhotoInformation(loan);\n }\n addCITESInformation(loan);\n } break;\n case 7:\n addEducationRequest(loan);\n break;\n default:\n addCommercialInformation(loan);\n break;\n }\n\n if (!RequestType.Information.isInformation(loan.getType())) {\n addTermsOfLoanAgreement();\n }\n document.close();\n adminDocument.close();\n }", "public void aboutApp() {\n\n\t\tFXMLLoader loader = new FXMLLoader(getClass().getResource(\"/view/AboutApp.fxml\"), I18n.getResourceBundle());\n\n\t\tUtilMethods.createDialog(loader, controller.getStage());\n\n\t}", "@Override\n public void onRequestHandlePathOz(@NotNull PathOz pathOz, @Nullable Throwable throwable) {\n readPdfFile(pathOz.getPath());\n mButtonReadText.setVisibility(View.VISIBLE);\n mHighlightedTextView.setVisibility(View.VISIBLE);\n mFragmentWallpaperTextView.setVisibility(View.INVISIBLE);\n mHighlightedTextView.setText(fileTextContent);\n Toast.makeText(getActivity(), \"File Uploaded Successfully !\", Toast.LENGTH_SHORT).show();\n Log.e(\"URI\", \"The URI path: \"+pathOz.getPath());\n }", "@Override\n\tpublic void createPDF(){\n File xsltFile = new File(RESOURCES_DIR + \"/pdfBook.xsl\");\n \n // the XML file which provides the input\n StreamSource xmlSource = new StreamSource(file);\n \n // create an instance of fop factory\n FopFactory fopFactory = FopFactory.newInstance();\n \n // a user agent is needed for transformation\n FOUserAgent foUserAgent = fopFactory.newFOUserAgent();\n \n // Setup output\n OutputStream out = null;\n try {\n\t\t\tout = new java.io.FileOutputStream(OUTPUT_DIR + \"/output.pdf\");\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\n try {\n // Construct fop with desired output format\n Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);\n\n // Setup XSLT\n TransformerFactory factory = TransformerFactory.newInstance();\n Transformer transformer = factory.newTransformer(new StreamSource(xsltFile));\n\n // Resulting SAX events (the generated FO) must be piped through to\n // FOP\n Result res = new SAXResult(fop.getDefaultHandler());\n\n // Start XSLT transformation and FOP processing\n // That's where the XML is first transformed to XSL-FO and then\n // PDF is created\n try {\n\t\t\t\ttransformer.transform(xmlSource, res);\n\t\t\t} catch (TransformerException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n } catch (FOPException | TransformerConfigurationException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t} finally {\n try {\n\t\t\t\tout.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n }\n }", "public void handleAbout() {\n displayAuxiliaryWindow(aboutWindow);\n }", "public File createPDF(File file) {\n //\tReportEngine re = ReportEngine.get (getCtx(), ReportEngine.PAYMENT, getC_Payment_ID());\n //\tif (re == null)\n return null;\n //\treturn re.getPDF(file);\n }", "private void showAbout() {\n toolbar.setTitle(R.string.about);\n AboutFragment aboutFragment = new AboutFragment();\n displaySelectedFragment(aboutFragment);\n }", "public void open() {\r\n\t}", "public static void main(String[] args) throws IOException {\n\t\tPdf pdf1 = new Pdf();\n\t\t// Assign a security instance to Pdf object\n\t\tpdf1.setSecurity(new Security());\n\t\t// Restrict annotation modification\n\t\tpdf1.getSecurity().isAnnotationsModifyingAllowed(false);\n\t\t// Restrict contents modification\n\t\tpdf1.getSecurity().isContentsModifyingAllowed(false);\n\t\t// Restrict copying the data\n\t\tpdf1.getSecurity().isCopyingAllowed(false);\n\t\t// Allow to print the document\n\t\tpdf1.getSecurity().isCopyingAllowed(true);\n\t\t// Restrict form filling\n\t\tpdf1.getSecurity().isFormFillingAllowed(false);\n\t\t// Add a section in the Pdf\n\t\tSection sec1 = pdf1.getSections().add();\n\t\t// Create a text paragraph\n\t\tText text1 = new Text(sec1, \"this is text content\");\n\t\t// Set the top maring of text paragraph to 30\n\t\ttext1.getMargin().setTop(30);\n\t\t// Add the text paragraph to the section\n\t\tsec1.getParagraphs().add(text1);\n\t\t// Save the Pdf\n\t\tFileOutputStream fileOut = new FileOutputStream(new File(\"Test.pdf\"));\n\t\tpdf1.save(fileOut);\n\t}", "private void createPDF(OutputStream os,String htmlFileName) {\n\t\tLog.info(\"url : \"+htmlFileName);\r\n //String HTML_TO_PDF = \"D:\\\\ConvertedFile.pdf\";\r\n // OutputStream os = new FileOutputStream(HTML_TO_PDF); \r\n \r\n /* File myhtml = new File(htmlFileName);\r\n FileInputStream fileinput = null;\r\n BufferedInputStream mybuffer = null;\r\n DataInputStream datainput = null;\r\n\r\n fileinput = new FileInputStream(myhtml);\r\n mybuffer = new BufferedInputStream(fileinput);\r\n datainput = new DataInputStream(mybuffer);\r\n\r\n while (datainput.available() != 0) {\r\n \t\r\n \tif(datainput.readLine().)\r\n \tSystem.out.println(datainput.readLine());\r\n \t}\r\n*/\r\n try {\r\n\t ITextRenderer renderer = new ITextRenderer();\r\n\t Log.info(\"Skill PDF Export->Create PDF->File name: \" + htmlFileName);\r\n\t renderer.setDocument(new File(htmlFileName)); \r\n\t renderer.layout();\r\n\t renderer.createPDF(os); \r\n\t os.close();\r\n }catch (Exception e) {\r\n \tLog.error(\"Error in SkillPdfExport\",e);\r\n }\r\n\t}", "private void pdfActionPerformed(java.awt.event.ActionEvent evt) {\n\n try{\n prepareFile();\n relv.GeneratePDF(path, Client.getNom() + \" \" + Client.getPrenom(), Client.getCin(), operations, periode, from, to);\n JOptionPane.showMessageDialog(this,\"Votre relevé en format PDF a été généré avec Succes\",\"Succes\", JOptionPane.INFORMATION_MESSAGE); \n } catch (SQLException ex) {\n JOptionPane.showMessageDialog(this, \"Échec lors de l'écriture dans la base de données. Veuillez réessayer plus tard\", \"Echec de l'opération\", JOptionPane.ERROR_MESSAGE);\n } catch (Exception ex) {\n System.out.println(\"error \"+ex.getMessage());\n } \n }", "public void onClick(DialogInterface dialog,int id) {\n Intent in = new Intent(OpenBookMark.this,PDFViewActivity_.class);\n startActivity(in);\n Toast.makeText(getApplicationContext(),\"go\", Toast.LENGTH_LONG).show();\n //dialogBookmark.dismiss();\n // OpenBookMark.this.finish();\n }", "public void aboutOnClick(View view) {\n // Configure \"About\" dialog\n AlertDialog.Builder dialog = new AlertDialog.Builder(this);\n dialog.setTitle(getResources().getString(R.string.about_title));\n dialog.setCancelable(false);\n dialog.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n\n @Override\n public void onClick(DialogInterface dialog, int which) {\n // Do nothing, just dismiss the dialog\n }\n });\n\n dialog.setMessage(getDeviceReport());\n\n dialog.show();\n }", "@Override\n\tpublic void buildPdfDocument(Map<String, Object> model, Document doc, PdfWriter writer,\n\t\t\tHttpServletRequest request, HttpServletResponse response) throws Exception {\n\t\tExportExam exportExam = (ExportExam) model.get(\"exportExam\");\n\t\tExportExam exportExam2 = (ExportExam) model.get(\"exportExam2\");\n\t\tListExam listExam = null;\n\t\tListExam listExam2 = null;\n\t\tif(exportExam!=null){\n\t\tlistExam = exportExam.listExam;\n\t\t}\n\t if(exportExam2!=null){\n\t\tlistExam2 = exportExam2.listExam;\n\t\t}\n\t\n\t\tString url = request.getRequestURL().toString();\n\t\tString baseURL = url.substring(0, url.length() - request.getRequestURI().length()) + request.getContextPath();\n\t\tString path = baseURL + \"/resources/fonts/vuArial.ttf\";\n\t\tFontFactory.register(path);\n\t\t\n\t\t//\"C:\\\\Users\\\\HennessyVox\\\\Downloads\\\\Compressed\\\\vuArial.ttf\"\n\t\t//Font fontHeader = FontFactory.getFont(FONT, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);\n\t\tBaseFont base = BaseFont.createFont(path, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);\n\t\t Font fontHeader = new Font(base, 10, Font.NORMAL);\n\t\t Font fontHeader2 = new Font(base, 10, Font.UNDERLINE);\n\t\t Font fontContent = new Font(base, 11, Font.NORMAL);\n\t\t Font fontAnswent = new Font(base, 11, Font.NORMAL, BaseColor.RED);\n\t\t Font fontTitle = new Font(base, 12, Font.BOLD);\n\t\t Font fontNumber = new Font(base, 11, Font.BOLD);\n\t\t//Font fontHeader = new Font(FontFamily.TIMES_ROMAN, 12, Font.NORMAL);\n\t String SchoolHeader = \"TRƯỜNG ĐẠI HỌC BÁCH KHOA TP HCM\";\n\t\t\n\t // Get faulty info.\n\t\n\t \n\t\ttry {\n\t\t\t\n\t\t\t if(listExam!=null){\n\t\t\t\t System.out.println(\"=============================================================\");\n\t\t\t\t int CoutExam = 1;\n\t\t\t String FacultyHeader = exportExam.getFaulty().toUpperCase();\n\t\t\t \t\n\t\t\t /// String FacultyHeader = \"KHOA KHOA HỌC VÀ KỸ THUẬT MÁY TÍNH\";\n\t\t\t String InfoStudentHeader1 = \"Họ Tên : ..........................\";\n\t\t\t String InfoStudentHeader2 = \"MSSV : ..........................\";\n\t\t\t PdfPTable table = new PdfPTable(new float[] { 75, 25 });\n\t\t\t table.setWidthPercentage(100);\n\t\t\t \n\t\t\t table.addCell(getCell(new Paragraph(SchoolHeader,fontHeader), PdfPCell.ALIGN_LEFT));\n\t\t\t \n\t\t\t table.addCell(getCell(new Paragraph(InfoStudentHeader1,fontHeader), PdfPCell.ALIGN_RIGHT));\n\t\t\t table.addCell(getCell(new Paragraph(FacultyHeader,fontHeader2), PdfPCell.ALIGN_LEFT));\n\t\t\t table.addCell(getCell(new Paragraph(InfoStudentHeader2,fontHeader), PdfPCell.ALIGN_RIGHT));\n\t\t\t table.setSpacingAfter(10);\n\t\t\t doc.add(table);\n\t\t\t \n\t\t\t // ADD title\n\t\t\t //Font fontTitle = FontFactory.getFont(FONT, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);\n\t\t\t //String titleExam = \"ĐỀ KIỂM TRA CUỐI KÌ 2017\";\n\t\t\t // System.out.println(exportExam.getExamName().toUpperCase());\n\t\t\t String titleExam = exportExam.getExamName().toUpperCase();\n\t\t\t \n\t\t\t Paragraph pHeader = new Paragraph(titleExam,fontTitle);\n\t\t\t pHeader.setAlignment(Paragraph.ALIGN_CENTER);\n\t\t\t doc.add(pHeader);\n\t\t\t \n\t\t\t String SubjectExam = \"Môn Thi : \" +exportExam.getSubjectName();\n\t\t\t String CodeExam = \"Mã đề : \" + exportExam.getCode();\n\t\t\t String timeExam = \"Thời gian : \" + exportExam.getTime();\n\t\t\t Font fontSubject = new Font(base, 10, Font.NORMAL);\n\t\t\t Font fontExam = new Font(base, 10, Font.NORMAL);\n\t\t\t \n\t\t\t PdfPTable table2 = new PdfPTable(2);\n\t\t\t table2.setWidthPercentage(80);\n\t\t\t //System.out.println(Charset.forName(\"UTF-8\").encode(SchoolHeader));\n\n\t\t\t table2.addCell(getCell(new Paragraph(SubjectExam,fontSubject), PdfPCell.ALIGN_LEFT));\n\t\t\t \n\t\t\t table2.addCell(getCell(new Paragraph(timeExam,fontExam), PdfPCell.ALIGN_RIGHT));\n\t\t\t table2.addCell(getCell(new Paragraph(CodeExam,fontExam), PdfPCell.ALIGN_LEFT));\n\t\t\t table2.addCell(getCell(new Paragraph(\"\",fontHeader), PdfPCell.ALIGN_RIGHT));\n\t\t\t table2.setSpacingBefore(5);\n\t\t\t doc.add(table2);\n\t\t\t \n\t\t\t String noteExam = exportExam.getNoteExam();\n\t\t\t Font fontNote = new Font(base, 8, Font.ITALIC);\n\t\t\t \n\t\t\t Paragraph pNote = new Paragraph(noteExam, fontNote);\n\t\t\t pNote.setAlignment(Paragraph.ALIGN_MIDDLE);\n\t\t\t doc.add(pNote);\n\t\t\t PdfPTable table3 = new PdfPTable(1);\n\t\t\t table3.setSpacingBefore(5);\n\t\t\t table3.setWidthPercentage(80);\n\t\t\t Font finalExam = new Font(base, 10, Font.NORMAL);\n\t\t\t table3.addCell(getCell(new Paragraph(\"*****\",finalExam), PdfPCell.ALIGN_CENTER));\n\t\t\t doc.add(table3);\n\t\t\t\t \n\t\t\t for(int i = 0; i < listExam.blockRootQuestion.size() ; i++){\n\t\t\t\t System.out.println(\"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\");\n\t\t\t\t \n\t\t\t\t List listBlock = new List(List.UNORDERED);\n\t\t\t\t listBlock.setAutoindent(false);\n\t\t\t\t // listBlock.setSymbolIndent(20);\t\n\t\t\t\t listBlock.add(new ListItem(new Paragraph(listExam.blockRootQuestion.get(i).rootQuestionBlock.getContent(),fontContent)));\n\t\t\t System.out.println(\"########### Block NAME \" +listExam.blockRootQuestion.get(i).rootQuestionBlock.getContent());\n\t\t\t\t \n\t\t\t\t doc.add(listBlock);\n\t\t\t \n\t\t\t \n\t\t \tSystem.out.println(\"########### SIZE QUESTION \" +listExam.blockRootQuestion.get(i).questionList.size());\n \n\t\t\t for(int j = 0 ; j < listExam.blockRootQuestion.get(i).questionList.size(); j++){\t\n\t\t\t \tSystem.out.println(\"########### QUESTION NAME \" +listExam.blockRootQuestion.get(i).questionList.get(j).question.getContent());\n\t\t\t\t\t\t\n\t\t\t \t List listQuestion = new List(List.UNORDERED);\n\t\t\t\t\t listQuestion.setListSymbol(\"\");\n\t\t\t \t\n\t\t\t \t//SingleQuestion questionPDF = null;\n\t\t\t \t//questionPDF = listExam.blockRootQuestion.get(i).questionList.get(j);\n\t\t\t \tStringBuilder sb = new StringBuilder();\n\t\t\t\t\t\tsb.append(\"Câu \");\n\t\t\t\t\t\tsb.append(CoutExam);\n\t\t\t\t\t\tsb.append(\". \");\n\t\t\t\t\t\tString strI = sb.toString();\n\t\t\t \t//strI = new Paragraph(strI, fontNumber);\n\t\t\t \t//listQuestion.setPostSymbol(strI);\n\t\t\t \tSystem.out.println(strI);\n\t\t\t listQuestion.add(new ListItem(new Paragraph(strI + listExam.blockRootQuestion.get(i).questionList.get(j).question.getContent(), fontContent)));\n\t\t\t listQuestion.setIndentationLeft(10);\n\t\t\t doc.add(listQuestion);\n\t\t\t List listAnswerPDF = new List(List.ORDERED, List.ALPHABETICAL);\n\t\t\t for(int k = 0; k < listExam.blockRootQuestion.get(i).questionList.get(j).answerList.size(); k++){\n\t\t\t\t\t System.out.println(\"########### Answer NAME \" +listExam.blockRootQuestion.get(i).questionList.get(j).answerList.get(k).getContent());\n\t\t\t \t listAnswerPDF.add(new ListItem(new Paragraph(listExam.blockRootQuestion.get(i).questionList.get(j).answerList.get(k).getContent(), fontContent))); \t \n\t\t\t }\n\t\t\t listAnswerPDF.setIndentationLeft(25);\n\t\t\t doc.add(listAnswerPDF);\n\t\t\t CoutExam++;\n\t\t\t }\n\t\t\t doc.add( Chunk.NEWLINE ); \n\t\t\t }\n\t\t\t // doc.close();\n\t\t\t listExam =null;\n\t\t\t }\n\t\t\t /*\n\t\t\t * Export Answer\n\t\t\t */\n\t\t\telse if(listExam2!=null){\n\t\t\t\t int CoutExam = 1;\n\t\t\t\t System.out.println(\"#######################################################\");\n\t\t\t\t String FacultyHeader = exportExam2.getFaulty().toUpperCase();\n\t\t\t \t\n\t\t\t\t /// String FacultyHeader = \"KHOA KHOA HỌC VÀ KỸ THUẬT MÁY TÍNH\";\n\t\t\t\t String InfoStudentHeader1 = \"Họ Tên : ..........................\";\n\t\t\t\t String InfoStudentHeader2 = \"MSSV : ..........................\";\n\t\t\t\t PdfPTable table = new PdfPTable(new float[] { 75, 25 });\n\t\t\t\t table.setWidthPercentage(100);\n\t\t\t\t \n\t\t\t\t table.addCell(getCell(new Paragraph(SchoolHeader,fontHeader), PdfPCell.ALIGN_LEFT));\n\t\t\t\t \n\t\t\t\t table.addCell(getCell(new Paragraph(InfoStudentHeader1,fontHeader), PdfPCell.ALIGN_RIGHT));\n\t\t\t\t table.addCell(getCell(new Paragraph(FacultyHeader,fontHeader2), PdfPCell.ALIGN_LEFT));\n\t\t\t\t table.addCell(getCell(new Paragraph(InfoStudentHeader2,fontHeader), PdfPCell.ALIGN_RIGHT));\n\t\t\t\t table.setSpacingAfter(10);\n\t\t\t\t doc.add(table);\n\t\t\t\t \n\t\t\t\t // ADD title\n\t\t\t\t //Font fontTitle = FontFactory.getFont(FONT, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);\n\t\t\t\t //String titleExam = \"ĐỀ KIỂM TRA CUỐI KÌ 2017\";\n\t\t\t\t // System.out.println(exportExam.getExamName().toUpperCase());\n\t\t\t\t String titleExam = exportExam2.getExamName().toUpperCase();\n\t\t\t\t \n\t\t\t\t Paragraph pHeader = new Paragraph(titleExam,fontTitle);\n\t\t\t\t pHeader.setAlignment(Paragraph.ALIGN_CENTER);\n\t\t\t\t doc.add(pHeader);\n\t\t\t\t \n\t\t\t\t String SubjectExam = \"Môn Thi : \" +exportExam2.getSubjectName();\n\t\t\t\t String CodeExam = \"Mã đề : \" + exportExam2.getCode();\n\t\t\t\t String timeExam = \"Thời gian : \" + exportExam2.getTime();\n\t\t\t\t Font fontSubject = new Font(base, 10, Font.NORMAL);\n\t\t\t\t Font fontExam = new Font(base, 10, Font.NORMAL);\n\t\t\t\t \n\t\t\t\t PdfPTable table2 = new PdfPTable(2);\n\t\t\t\t table2.setWidthPercentage(80);\n\t\t\t\t //System.out.println(Charset.forName(\"UTF-8\").encode(SchoolHeader));\n\n\t\t\t\t table2.addCell(getCell(new Paragraph(SubjectExam,fontSubject), PdfPCell.ALIGN_LEFT));\n\t\t\t\t \n\t\t\t\t table2.addCell(getCell(new Paragraph(timeExam,fontExam), PdfPCell.ALIGN_RIGHT));\n\t\t\t\t table2.addCell(getCell(new Paragraph(CodeExam,fontExam), PdfPCell.ALIGN_LEFT));\n\t\t\t\t table2.addCell(getCell(new Paragraph(\"\",fontHeader), PdfPCell.ALIGN_RIGHT));\n\t\t\t\t table2.setSpacingBefore(5);\n\t\t\t\t doc.add(table2);\n\t\t\t\t \n\t\t\t\t String noteExam = exportExam2.getNoteExam();\n\t\t\t\t Font fontNote = new Font(base, 8, Font.ITALIC);\n\t\t\t\t \n\t\t\t\t Paragraph pNote = new Paragraph(noteExam, fontNote);\n\t\t\t\t pNote.setAlignment(Paragraph.ALIGN_MIDDLE);\n\t\t\t\t doc.add(pNote);\n\t\t\t\t PdfPTable table3 = new PdfPTable(1);\n\t\t\t\t table3.setSpacingBefore(5);\n\t\t\t\t table3.setWidthPercentage(80);\n\t\t\t\t Font finalExam = new Font(base, 10, Font.NORMAL);\n\t\t\t\t table3.addCell(getCell(new Paragraph(\"*****\",finalExam), PdfPCell.ALIGN_CENTER));\n\t\t\t\t doc.add(table3);\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t for(int i = 0; i < listExam2.blockRootQuestion.size() ; i++){\n\t\t\t\t\t System.out.println(\"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\");\n\t\t\t\t\t \n\t\t\t\t\t List listBlock = new List(List.UNORDERED);\n\t\t\t\t\t listBlock.setAutoindent(false);\n\t\t\t\t\t // listBlock.setSymbolIndent(20);\t\n\t\t\t\t\t listBlock.add(new ListItem(new Paragraph(listExam2.blockRootQuestion.get(i).rootQuestionBlock.getContent(),fontContent)));\n\t\t\t\t System.out.println(\"########### Block NAME \" +listExam2.blockRootQuestion.get(i).rootQuestionBlock.getContent());\n\t\t\t\t\t \n\t\t\t\t\t doc.add(listBlock);\n\t\t\t\t \n\t\t\t\t \n\t\t\t \tSystem.out.println(\"########### SIZE QUESTION \" +listExam2.blockRootQuestion.get(i).questionList.size());\n\t \n\t\t\t\t for(int j = 0 ; j < listExam2.blockRootQuestion.get(i).questionList.size(); j++){\t\n\t\t\t\t \tSystem.out.println(\"########### QUESTION NAME \" +listExam2.blockRootQuestion.get(i).questionList.get(j).question.getContent());\n\t\t\t\t\t\t\t\n\t\t\t\t \t List listQuestion = new List(List.UNORDERED);\n\t\t\t\t\t\t listQuestion.setListSymbol(\"\");\n\t\t\t\t \t\n\t\t\t\t \t//SingleQuestion questionPDF = null;\n\t\t\t\t \t//questionPDF = listExam.blockRootQuestion.get(i).questionList.get(j);\n\t\t\t\t \tStringBuilder sb = new StringBuilder();\n\t\t\t\t\t\t\tsb.append(\"Câu \");\n\t\t\t\t\t\t\tsb.append(CoutExam);\n\t\t\t\t\t\t\tsb.append(\". \");\n\t\t\t\t\t\t\tString strI = sb.toString();\n\t\t\t\t \t//strI = new Paragraph(strI, fontNumber);\n\t\t\t\t \t//listQuestion.setPostSymbol(strI);\n\t\t\t\t \tSystem.out.println(strI);\n\t\t\t\t listQuestion.add(new ListItem(new Paragraph(strI + listExam2.blockRootQuestion.get(i).questionList.get(j).question.getContent(), fontContent)));\n\t\t\t\t listQuestion.setIndentationLeft(10);\n\t\t\t\t doc.add(listQuestion);\n\t\t\t\t List listAnswerPDF = new List(List.ORDERED, List.ALPHABETICAL);\n\t\t\t\t for(int k = 0; k < listExam2.blockRootQuestion.get(i).questionList.get(j).answerList.size(); k++){\n\t\t\t\t\t\t System.out.println(\"########### Answer NAME \" +listExam2.blockRootQuestion.get(i).questionList.get(j).answerList.get(k).getContent());\n\t\t\t\t\t\t if(listExam2.blockRootQuestion.get(i).questionList.get(j).answerList.get(k).getIssolution())\n\t\t\t\t \t listAnswerPDF.add(new ListItem(new Paragraph(listExam2.blockRootQuestion.get(i).questionList.get(j).answerList.get(k).getContent(), fontAnswent)));\n\t\t\t\t \t else \n\t\t\t\t\t \tlistAnswerPDF.add(new ListItem(new Paragraph(listExam2.blockRootQuestion.get(i).questionList.get(j).answerList.get(k).getContent(), fontContent)));\n\t\t\t\t }\n\t\t\t\t listAnswerPDF.setIndentationLeft(25);\n\t\t\t\t doc.add(listAnswerPDF);\n\t\t\t\t CoutExam++;\n\t\t\t\t }\n\t\t\t\t doc.add( Chunk.NEWLINE );\n\t\t\t\t }\n\t\t\t\t doc.close();\n\t\t\t\t listExam2=null;\n\t\t\t }\n\t\t\t model.clear();\n\t\t\t doc.close();\n\t\t\t exportExam = null;\n\t\t\t// exportExam2 = null;\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"ERROR \"+ e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void generatePDF(String directory, String nameOfTheDocument) throws Exception{\n\t\t\n\t\t//Create empty document (instance of Document classe from Apose.Words)\n\t\tDocument doc = new Document();\n\t\t\n\t\t//Every word document have section, so now we are creating section\n\t\tSection section = new Section(doc);\n\t\tdoc.appendChild(section);\n\t\t\n\t\tsection.getPageSetup().setPaperSize(PaperSize.A4);\n\t\tsection.getPageSetup().setHeaderDistance (35.4); // 1.25 cm\n\t\tsection.getPageSetup().setFooterDistance (35.4); // 1.25 cm\n\t\t\n\t\t//Crating the body of section\n\t\tBody body = new Body(doc);\n\t\tsection.appendChild(body);\n\t\t\n\t\t//Crating paragraph\n\t\tParagraph paragraph = new Paragraph(doc);\n\t\t\n\t\tparagraph.getParagraphFormat().setStyleName(\"Heading 1\");\n\t\tparagraph.getParagraphFormat().setAlignment(ParagraphAlignment.CENTER);\n\t\t//Crating styles\n\t\tStyle style = doc.getStyles().add(StyleType.PARAGRAPH, \"Style1\");\n\t\tstyle.getFont().setSize(24);\n\t\tstyle.getFont().setBold(true);\n\t\tstyle.getFont().setColor(Color.RED);\n\t\t//paragraph.getParagraphFormat().setStyle(style);\n\t\tbody.appendChild(paragraph);\n\t\t\n\t\tStyle styleForIntroduction = doc.getStyles().add(StyleType.PARAGRAPH, \"Style2\");\n\t\tstyle.getFont().setSize(40);\n\t\tstyle.getFont().setBold(false);\n\t\tstyle.getFont().setItalic(true);\n\t\tstyle.getFont().setColor(Color.CYAN);\n\t\t\n\t\tStyle styleForText = doc.getStyles().add(StyleType.PARAGRAPH, \"Style3\");\n\t\tstyle.getFont().setSize(15);\n\t\tstyle.getFont().setBold(false);\n\t\tstyle.getFont().setItalic(false);\n\t\tstyle.getFont().setColor(Color.BLACK);\n\t\t\n\t\t//Crating run of text\n\t\tRun textRunHeadin1 = new Run(doc);\n\t\ttry {\n\t\t\ttextRunHeadin1.setText(\"Probni test fajl\" + \"\\r\\r\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tparagraph.appendChild(textRunHeadin1);\n\t\t\n\t\t\n\t\t//Creating paragraph1 for every question in list\n\t\tfor (Question question : questions) {\n\t\t\t\n\t\t\t\n\t\t\t\t//Paragraph for Instruction Question\n\t\t\t\tParagraph paragraphForInstruction = new Paragraph(doc);\n\t\t\t\tparagraphForInstruction.getParagraphFormat().setStyleName(\"Heading 1\");\n\t\t\t\tparagraphForInstruction.getParagraphFormat().setAlignment(ParagraphAlignment.LEFT);\n\t\t\t\tparagraphForInstruction.getParagraphFormat().setStyle(styleForIntroduction);\n\t\t\t\tparagraphForInstruction.getParagraphFormat().setStyleName(\"Heading 3\");\n\t\t\t\t\n\t\t\t\tRun runIntroduction = new Run(doc);\n\t\t\t\t\n\t\t\t\trunIntroduction.getFont().setColor(Color.BLUE);\n\t\t\t\ttry {\n\t\t\t\t\trunIntroduction.setText(((Question)question).getTextInstructionForQuestion()+\"\\r\");\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tparagraphForInstruction.appendChild(runIntroduction);\n\t\t\t\tbody.appendChild(paragraphForInstruction);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Paragraph for Question\n\t\t\t\tParagraph paragraphForQuestion = new Paragraph(doc);\n\t\t\t\tparagraphForQuestion.getParagraphFormat().setStyleName(\"Heading 1\");\n\t\t\t\tparagraphForQuestion.getParagraphFormat().setAlignment(ParagraphAlignment.LEFT);\n\t\t\t\tparagraphForQuestion.getParagraphFormat().setStyle(styleForText);\n\t\t\t\tparagraphForQuestion.getParagraphFormat().setStyleName(\"Normal\");\n\t\t\t\t\n\t\t\t\tRun runText = new Run(doc);\n\t\t\t\tif(question instanceof QuestionBasic){\n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\trunText.setText(((QuestionBasic)question).toStringForDocument()+\"\\r\");\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\tif(question instanceof QuestionFillTheBlank){\n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\trunText.setText(((QuestionFillTheBlank)question).toStringForDocument());\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\tif(question instanceof QuestionMatching){\n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\trunText.setText(((QuestionMatching)question).toStringForDocument());\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\tif(question instanceof QuestionTrueOrFalse){\n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\trunText.setText(((QuestionTrueOrFalse)question).toStringForDocument());\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\tparagraphForQuestion.appendChild(runText);\n\t\t\t\tbody.appendChild(paragraphForQuestion);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tdoc.save(directory + nameOfTheDocument +\".pdf\");\n\t\t\n\t}", "public void doOpen() {\n\n if (!canChangeDocuments()) {\n return;\n }\n\n TextDocument document = fApplication.openDocument(this);\n\n if (document != null) {\n setDocument(document);\n }\n }", "private void about() {\n System.out.println(Strings.MAIN_ABOUT_MESSAGE);\n System.out.println();\n }", "private void init() {\n\t\tClassLoader loader = LegalDialog.class.getClassLoader();\n\t\tthisURL = loader.getResource(\"disclaimer.htm\");\n\t\ttry {\n\t\t\tthisEditor = new JEditorPane( thisURL );\n\t\t\tthisEditor.setEditable( false );\n\t\t\t// needed to open browser via clicking on a link\n\t\t\tthisEditor.addHyperlinkListener(new HyperlinkListener() {\n\t\t\t\t@Override\n\t\t\t\tpublic void hyperlinkUpdate(HyperlinkEvent e) {\n\t\t\t\t\tURL url = e.getURL();\n\t\t\t\t\tif (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (url.sameFile(thisURL))\n\t\t\t\t\t\t\t\tthisEditor.setPage(url);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tDesktop.getDesktop().browse(url.toURI());\n\t\t\t\t\t\t} catch (IOException ex) {\n\t\t\t\t\t\t} catch (URISyntaxException ex) {\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (e.getEventType() == HyperlinkEvent.EventType.ENTERED) {\n\t\t\t\t\t\tif (url.sameFile(thisURL))\n\t\t\t\t\t\t\tthisEditor.setToolTipText(url.getRef());\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tthisEditor.setToolTipText(url.toExternalForm());\n\t\t\t\t\t} else if (e.getEventType() == HyperlinkEvent.EventType.EXITED) {\n\t\t\t\t\t\tthisEditor.setToolTipText(null);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tjScrollPane.setViewportView(thisEditor); // Generated\n\t\t} catch (IOException ex) {ex.printStackTrace();};\n\t}", "private void showAboutDialog() {\n\n view.aboutDialog();\n }", "private void fetchingData() {\n loadingDialog.startLoadingDialog();\n\n FirebaseStorage.getInstance().getReference().child(\"course-details\").child(\"course-details.pdf\")\n .getBytes(1024 * 1024).addOnSuccessListener(bytes -> {\n loadingDialog.dismissDialog();\n Toast.makeText(getApplicationContext(), \"Zoom out !!\", Toast.LENGTH_LONG).show();\n pdfView.fromBytes(bytes).load();\n }).addOnFailureListener(e ->\n Toast.makeText(getApplicationContext(), \"download unsuccessful\", Toast.LENGTH_LONG).show());\n }", "public void createPdf(String filePath) throws DocumentException, FileNotFoundException, BadElementException, IOException, SQLException {\r\n Calendar date = Calendar.getInstance();\r\n String dato;\r\n dato = \"\"+date.get(Calendar.YEAR)+\"-\"+MyUtil.p0(date.get(Calendar.MONTH)+1)+\"-\"+MyUtil.p0((date.get(Calendar.DAY_OF_MONTH)))+\"-\";\r\n \r\n String name = fal.getFiremanById(model.getTimeSheet(0).getEmployeeId()).getFirstName() +\" \"+ fal.getFiremanById(model.getTimeSheet(0).getEmployeeId()).getLastName();\r\n fileName = dato + name + \".pdf\";\r\n \r\n Document document = new Document();\r\n PdfWriter.getInstance(document, new FileOutputStream(filePath+fileName));\r\n document.open();\r\n addContent(document);\r\n document.close();\r\n\r\n }", "@Override\n\tprotected void openPage(PageLocator arg0, Object... arg1) {\n\t\t\n\t}", "public void open();", "public void open();", "public static boolean canDisplayPdf(Context context) {\n\t\tPackageManager packageManager = context.getPackageManager();\n\t\tIntent testIntent = new Intent(Intent.ACTION_VIEW);\n\t\ttestIntent.setType(MIME_TYPE_PDF);\n\t\tif (packageManager.queryIntentActivities(testIntent,\n\t\t\t\tPackageManager.MATCH_DEFAULT_ONLY).size() > 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public abstract String about();", "public void openFile() {\n\t\tfc.setCurrentDirectory(new File(System.getProperty(\"user.dir\")));\n\t\tint returnVal = fc.showOpenDialog(null);\n\t\tif (returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\tFile file = fc.getSelectedFile();\n\t filename.setText(file.getName());\n\t try {\n\t\t\t\tmodel.FileContent(file);\t//read the content of the input file\n\t\t\t\tplotContent.repaint();\t//repaint the JComponent\n\t\t\t\t\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void showAbout(View view){\n startActivity(intent);\n }", "public void open() {\n\t}", "public String open() {\n\t\tUtilGUI.centerShell(DocFetcher.getInstance().getShell(), shell);\n\t\tshell.open();\n\t\twhile (! shell.isDisposed()) {\n\t\t\tif (! shell.getDisplay().readAndDispatch())\n\t\t\t\tshell.getDisplay().sleep();\n\t\t}\n\t\treturn answer;\n\t}", "private void jMenuItem_ShowProspectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem_ShowProspectActionPerformed\n File fProspect = new File(\"Propsect_Relance.csv\");\n try {\n Desktop.getDesktop().open(fProspect);\n } catch (IOException ex) {\n Logger.getLogger(JFrame_Accueil.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@RequestMapping(\"/pdf\")\r\n\tpublic ModelAndView showPdf(@RequestParam(required=false) Integer id) {\r\n\t\tList<UomType> uoms=null;\r\n\t\tif(id==null)\r\n\t\t\tuoms=service.getAllUomTypes();\r\n\t\telse\r\n\t\t\tuoms=Arrays.asList(service.getOneUomType(id));\r\n\t\t//read data from db\r\n\t\tModelAndView m=new ModelAndView();\r\n\t\tm.setView(new UomTypePdfView());\r\n\t\tm.addObject(\"list\", uoms);\r\n\t\treturn m;\r\n\t\t\r\n\t}" ]
[ "0.6737086", "0.65742207", "0.65269184", "0.6440809", "0.64085096", "0.63848823", "0.63628376", "0.6304479", "0.6265345", "0.62604505", "0.6258198", "0.6164074", "0.612713", "0.61138856", "0.6086409", "0.5968854", "0.5957355", "0.59398884", "0.5910773", "0.58832586", "0.58743936", "0.5792042", "0.5724868", "0.57204986", "0.56881183", "0.56551015", "0.5640724", "0.56333023", "0.5611103", "0.56088287", "0.55996317", "0.5585301", "0.5585264", "0.5527994", "0.55226684", "0.55068505", "0.5474723", "0.5454981", "0.54473436", "0.5433639", "0.54179424", "0.54120934", "0.5377358", "0.537054", "0.5367535", "0.5362419", "0.53568953", "0.5336318", "0.5325826", "0.5307991", "0.5307352", "0.52982444", "0.52810556", "0.52626777", "0.52594703", "0.5255357", "0.5245176", "0.5244584", "0.5243116", "0.5242192", "0.5233721", "0.52259296", "0.5218813", "0.52063584", "0.52036345", "0.52033675", "0.51972884", "0.5191838", "0.5188208", "0.51859224", "0.5176935", "0.5169499", "0.51632065", "0.51618993", "0.51570284", "0.51551247", "0.51388884", "0.5136163", "0.5130614", "0.5128114", "0.51280427", "0.51187", "0.5116904", "0.5116241", "0.51084477", "0.5105693", "0.51051426", "0.5099988", "0.5092214", "0.50889707", "0.5078816", "0.5078816", "0.507382", "0.50678885", "0.50593394", "0.50584906", "0.5052673", "0.5048406", "0.5039829", "0.5034995" ]
0.78418213
0
this method will open pdf file for Help.
private void popHelp() { try { //File file=new File(filepath); Desktop.getDesktop().open(new java.io.File("help.pdf")); } catch (IOException ex) { JOptionPane.showMessageDialog(rootPane,"File not found or supported"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void jBtnHelpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnHelpActionPerformed\n // TODO add your handling code here:\n if (Desktop.isDesktopSupported()) {\n try {\n File myFile = new File(\"help.txt\");\n Desktop.getDesktop().open(myFile);\n } catch (IOException ex) {\n // no application registered for PDFs\n }\n }\n }", "private void popAbout() {\n try {\n //File file=new File(filepath);\n Desktop.getDesktop().open(new java.io.File(\"about.pdf\"));\n } catch (IOException ex) {\n JOptionPane.showMessageDialog(rootPane,\"File not found or supported\");\n }\n }", "@FXML\n\tpublic void OpenHelpContentPage() {\n\n\t\tif (!Desktop.isDesktopSupported()) {\n\t\t\tSystem.out.println(\"Desktop not supported\");\n\t\t\treturn;\n\t\t}\n\n\t\tif (!Desktop.getDesktop().isSupported(Desktop.Action.OPEN)) {\n\t\t\tSystem.out.println(\"File opening not supported\");\n\t\t\treturn;\n\t\t}\n\n\t\tfinal Task<Void> task = new Task<Void>() {\n\t\t\t@Override\n\t\t\tpublic Void call() throws Exception {\n\t\t\t\ttry {\n\t\t\t\t\tFile sx3InstallLocation = SX3Manager.getInstance().getInstallLocation().getParentFile()\n\t\t\t\t\t\t\t.getAbsoluteFile();\n\t\t\t\t\tDesktop.getDesktop().open(new File(\n\t\t\t\t\t\t\tsx3InstallLocation + File.separator + \"Cypress_EZ-USB_SX3_ConfigurationUtility.pdf\"));\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tSystem.err.println(e.toString());\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t};\n\n\t\tfinal Thread thread = new Thread(task);\n\t\tthread.setDaemon(true);\n\t\tthread.start();\n\t}", "@Override\r\n public void actionPerformed(ActionEvent e) {\n \r\n if (Desktop.isDesktopSupported()) {\r\n try {\r\n File myFile = new File(\"E:\");\r\n Desktop.getDesktop().open(myFile);\r\n \r\n } catch (IOException ex) {\r\n // no application registered for PDFs\r\n }\r\n}\r\n \r\n \r\n }", "private void getPDF() {\n //for greater than lolipop versions we need the permissions asked on runtime\n //so if the permission is not available user will go to the screen to allow storage permission\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && ContextCompat.checkSelfPermission(this,\n Manifest.permission.READ_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED) {\n Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,\n Uri.parse(\"package:\" + getPackageName()));\n startActivity(intent);\n return;\n }\n\n //creating an intent for file chooser\n Intent intent = new Intent();\n intent.setType(\"application/pdf\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select PDF File\"), PICK_PDF_CODE);\n }", "public void actionPerformed(ActionEvent arg0) {\n\t\t \t \ttry {\n\t\t\t\t\t\tDesktop.getDesktop().open(new File(new File(\"\").getAbsolutePath() + \n\t\t\t\t\t\t\t\t\"\\\\src\\\\pdf\\\\DocumentationUtilisateur.pdf\"));\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t }", "private void launchPdfFile(File pdfFile){\n String dstPath = (Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_DOWNLOADS) + \"/\" + pdfFile.getName());\n File dstFile = new File(dstPath);\n if (dstFile.exists()){ //if file exists\n Uri path = Uri.fromFile(dstFile); //path of file\n Intent objIntent = new Intent(Intent.ACTION_VIEW); //intent to launch pdf file\n objIntent.setDataAndType(path, \"application/pdf\");\n objIntent.setFlags(Intent. FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(objIntent);//Starting the pdf viewer\n } else {\n Toast.makeText(this, \"Error: This file does not exists.\",\n Toast.LENGTH_SHORT).show();\n }\n }", "private void selectPdf() {\n\n Intent intent = new Intent();\n intent.setType(\"application/pdf\");\n intent.setAction(Intent.ACTION_GET_CONTENT);//to fetch files\n startActivityForResult(intent,86);\n\n\n\n }", "public void showPdfChooser() {\n Intent intent2 = new Intent();\n intent2.setType(\"application/pdf\");\n intent2.setAction(\"android.intent.action.GET_CONTENT\");\n startActivityForResult(Intent.createChooser(intent2, \"Select Document\"), PICK_IMAGE_REQUEST);\n }", "void selectPDF()\n {\n Intent intent=new Intent();\n intent.setType(\"application/pdf\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(intent,9);\n }", "private PDF getPDF() {\n final Intent intent = getIntent();\n\t\tUri uri = intent.getData(); \t\n\t\tfilePath = uri.getPath();\n\t\tif (uri.getScheme().equals(\"file\")) {\n\t\t\tif (history) {\n\t\t\t\tRecent recent = new Recent(this);\n\t\t\t\trecent.add(0, filePath);\n\t\t\t\trecent.commit();\n\t\t\t}\n\t\t\treturn new PDF(new File(filePath), this.box);\n \t} else if (uri.getScheme().equals(\"content\")) {\n \t\tContentResolver cr = this.getContentResolver();\n \t\tFileDescriptor fileDescriptor;\n\t\t\ttry {\n\t\t\t\tfileDescriptor = cr.openFileDescriptor(uri, \"r\").getFileDescriptor();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tthrow new RuntimeException(e); // TODO: handle errors\n\t\t\t}\n \t\treturn new PDF(fileDescriptor, this.box);\n \t} else {\n \t\tthrow new RuntimeException(\"don't know how to get filename from \" + uri);\n \t}\n }", "private void tbsOpenFile(){\n String path = Environment.getExternalStorageDirectory().getPath() + \"/\" + \"android面试题及答案.docx\";\n File file=new File(path);\n if (file.exists()){\n\n\n Bundle bundle=new Bundle();\n bundle.putString(\"filePath\", file.getPath());\n bundle.putString(\"tempPath\", Environment.getExternalStorageDirectory().getPath());\n boolean result = mTbsReaderView.preOpen(\"doc\", false);//Word类型的是“doc” 、 PDF的类型是“pdf”\n\n mTbsReaderView.openFile(bundle);\n\n }else {\n Toast.makeText(this,\"文件不存在\",Toast.LENGTH_SHORT).show();\n }\n\n }", "@Override\n public void handle(ActionEvent t) {\n \n try {\n Runtime.getRuntime().exec(\"rundll32 url.dll,FileProtocolHandler \" + \"src\\\\multimedia\\\\Manual de usuario.pdf\");\n} catch (IOException e) {\n e.printStackTrace();\n}\n\n}", "private void doHelp()\r\n {\r\n Help.showHelp(page, ref, null);\r\n }", "private void showOpenFileDialog() {\n Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);\n intent.addCategory(Intent.CATEGORY_OPENABLE);\n intent.setType(\"*/*\");\n // We accept PDF files and images (for image documents).\n intent.putExtra(Intent.EXTRA_MIME_TYPES, new String[] {\"application/pdf\", \"image/*\"});\n\n // Set of the intent for result, so we can retrieve the Uri of the selected document.\n startActivityForResult(intent, REQUEST_OPEN_DOCUMENT);\n }", "public static void openDocument(Context context, String strFilePath, String strFileType) {\n try {\n File file = new File(strFilePath);\n Intent intent = new Intent(Intent.ACTION_VIEW);\n /* if (strFileType.equals(\"pdf\")) {\n intent.setDataAndType(Uri.fromFile(file), \"application/pdf\");\n } else if (strFileType.equals(\"doc\") || strFileType.equals(\"docx\")) {\n MimeTypeMap myMime = MimeTypeMap.getSingleton();\n String mimeType = myMime.getMimeTypeFromExtension(strFilePath);\n intent.setDataAndType(Uri.fromFile(file), mimeType);\n } else {\n intent.setDataAndType(Uri.fromFile(file), \"application/*\");\n }*/\n intent.setDataAndType(Uri.fromFile(file), \"application/*\");\n intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);\n context.startActivity(intent);\n } catch (ActivityNotFoundException activityNotFoundException) {\n activityNotFoundException.printStackTrace();\n throw activityNotFoundException;\n } catch (Exception otherException) {\n otherException.printStackTrace();\n throw otherException;\n }\n }", "public void openHelpDialog(String deviceName, String fileName, boolean extractBase) {\r\n\t\tfinal String $METHOD_NAME = \"openHelpDialog\"; //$NON-NLS-1$\r\n\t\ttry {\r\n\t\t\tif (this.helpDialog == null || this.helpDialog.isDisposed()) {\r\n\t\t\t\tthis.helpDialog = new HelpInfoDialog(GDE.shell, SWT.NONE);\r\n\t\t\t}\r\n\t\t\tthis.helpDialog.open(deviceName, fileName, SWT.NONE, extractBase);\r\n\t\t}\r\n\t\tcatch (Error e) {\r\n\t\t\tif (log.isLoggable(Level.FINE)) log.logp(Level.FINE, $CLASS_NAME, $METHOD_NAME, \"using OS registered web browser\"); //$NON-NLS-1$\r\n\t\t\tWebBrowser.openURL(deviceName, fileName);\r\n\t\t\tapplication.openMessageDialogAsync(Messages.getString(MessageIds.GDE_MSGI0025));\r\n\t\t}\r\n\t\tcatch (Throwable t) {\r\n\t\t\tapplication.openMessageDialog(Messages.getString(MessageIds.GDE_MSGE0007) + t.getClass().getSimpleName() + GDE.STRING_MESSAGE_CONCAT + t.getMessage());\r\n\t\t}\r\n\t}", "private void generarDocP(){\n generarPdf(this.getNombre());\n }", "public void openHelpDialog(String deviceName, String fileName) {\r\n\t\tfinal String $METHOD_NAME = \"openHelpDialog\"; //$NON-NLS-1$\r\n\t\ttry {\r\n\t\t\tif (this.helpDialog == null || this.helpDialog.isDisposed()) {\r\n\t\t\t\tthis.helpDialog = new HelpInfoDialog(GDE.shell, SWT.NONE);\r\n\t\t\t}\r\n\t\t\tthis.helpDialog.open(deviceName, fileName, SWT.NONE, false);\r\n\t\t}\r\n\t\tcatch (Error e) {\r\n\t\t\tif (log.isLoggable(Level.FINE)) log.logp(Level.FINE, $CLASS_NAME, $METHOD_NAME, \"using OS registered web browser\"); //$NON-NLS-1$\r\n\t\t\tWebBrowser.openURL(deviceName, fileName);\r\n\t\t\tapplication.openMessageDialogAsync(Messages.getString(MessageIds.GDE_MSGI0025));\r\n\t\t}\r\n\t\tcatch (Throwable t) {\r\n\t\t\tapplication.openMessageDialog(Messages.getString(MessageIds.GDE_MSGE0007) + t.getClass().getSimpleName() + GDE.STRING_MESSAGE_CONCAT + t.getMessage());\r\n\t\t}\r\n\t}", "void help() {\n // FIXME\n try {\n FileReader help = new FileReader(\"loa/Help.txt\");\n Scanner helpPls = new Scanner(help);\n while (helpPls.hasNextLine()) {\n System.out.println(helpPls.nextLine());\n }\n } catch (FileNotFoundException e) {\n System.out.println(\"Help file not found.\");\n }\n\n }", "Help(String fname) {\n helpfile = fname;\n }", "@Override\r\n\t\tprotected void onPostExecute(File result) {\n\t\t\tsuper.onPostExecute(result);\r\n\t\t\tpDialog.dismiss();\r\n\t\t\t Uri path = Uri.fromFile(file);\r\n\t\t\ttry {\r\n\t Intent intent = new Intent(Intent.ACTION_VIEW);\r\n\t intent.setDataAndType(path, \"application/pdf\");\r\n\t intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n\t startActivity(intent);\r\n\t \r\n\t } catch (ActivityNotFoundException e) {\r\n\t \r\n\t }\r\n\t\t\t\r\n\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tString url = \"file:///C:/Users/J1637009/Desktop/aaaaa.pdf\";\n\t\t\t\tString url2 = \"file:///N:/AE/2017/‹l•[/ƒJƒPƒnƒVAEƒG[ƒWƒFƒ“ƒg‹l•[/doubLeiƒNƒŠƒGƒCƒeƒBƒuEj_18.pdf\";\n\t\t\t\t\n\t\t\t\t\n\t\t try {\n\t\t\t\t\tjava.awt.Desktop.getDesktop().browse(java.net.URI.create(url2));\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\t\n\t\t\t}", "public void loadPdfFile() {\n PDFView.Configurator configurator;\n RelativeLayout relativeLayout = (RelativeLayout)this.pdfView.getParent();\n this.errorTextView = (TextView)relativeLayout.findViewById(2131296408);\n this.progressBar = (ProgressBar)relativeLayout.findViewById(2131296534);\n this.sharedPreferences = Factory.getInstance().getMainNavigationActivity().getSharedPreferences(\"AppsgeyserPrefs\", 0);\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"pdf_saved_page_\");\n stringBuilder.append(this.initialTabId);\n savedPageKey = stringBuilder.toString();\n if (this.pathFile.startsWith(\"file:///\")) {\n String string2 = this.pathFile.replace((CharSequence)\"file:///android_asset/\", (CharSequence)\"\");\n configurator = this.pdfView.fromAsset(string2);\n } else {\n boolean bl = this.pathFile.startsWith(\"http\");\n configurator = null;\n if (bl) {\n String string3 = this.pathFile;\n new LoaderPdf().execute((Object[])new String[]{string3});\n }\n }\n this.pdfView.useBestQuality(true);\n if (configurator == null) return;\n try {\n this.loadConfigurator(configurator);\n return;\n }\n catch (Exception exception) {\n exception.printStackTrace();\n this.progressBar.setVisibility(8);\n }\n }", "public void cargarPdf() {\n\t\tif (pdf != null) {\n\t\t\tFacesMessage message = new FacesMessage(\"Se cargo \", pdf.getFileName() + \" correctamente.\");\n\t\t\tFacesContext.getCurrentInstance().addMessage(null, message);\n\t\t}\n\t}", "private void openFile(String name){\n File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);\n File file = new File(path, \"\"+name);\n\n Intent install = new Intent(Intent.ACTION_VIEW);\n install.setDataAndType(Uri.fromFile(file), \"application/pdf\");\n install.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(install);\n\n }", "protected void showHelp() {\n try {\n String appletPath = getClass().getName().replace('.', '/');\n URL url = new URL(getCodeBase(), appletPath+\"Help.html\");\n getAppletContext().showDocument(url, \"Help\");\n } catch (IOException e) {\n showStatus(\"Help file not found\");\n }\n\n }", "private void verPDFFrame(String filePath) {\n SwingController c = new SwingController();\n c.setIsEmbeddedComponent(true);\n\n PropertiesManager prop = new PropertiesManager(\n System.getProperties(),\n ResourceBundle.getBundle(PropertiesManager.DEFAULT_MESSAGE_BUNDLE));\n\n prop.set(PropertiesManager.PROPERTY_DEFAULT_ZOOM_LEVEL, \"1.25\");\n prop.setBoolean(PropertiesManager.PROPERTY_VIEWPREF_FITWINDOW, Boolean.TRUE);\n prop.setBoolean(PropertiesManager.PROPERTY_SHOW_TOOLBAR_ANNOTATION, Boolean.FALSE);\n prop.setBoolean(PropertiesManager.PROPERTY_SHOW_TOOLBAR_FIT, Boolean.FALSE);\n prop.setBoolean(PropertiesManager.PROPERTY_SHOW_TOOLBAR_ROTATE, Boolean.FALSE);\n prop.setBoolean(PropertiesManager.PROPERTY_SHOW_TOOLBAR_TOOL, Boolean.FALSE);\n prop.setBoolean(PropertiesManager.PROPERTY_SHOW_UTILITY_UPANE, Boolean.FALSE);\n prop.setBoolean(PropertiesManager.PROPERTY_SHOW_UTILITY_SEARCH, Boolean.FALSE);\n\n SwingViewBuilder fac = new SwingViewBuilder(c, prop);\n\n // add interactive mouse link annotation support via callback\n c.getDocumentViewController().setAnnotationCallback(\n new org.icepdf.ri.common.MyAnnotationCallback(c.getDocumentViewController()));\n javax.swing.JPanel viewerComponentPanel = fac.buildViewerPanel();\n JFrame applicationFrame = new JFrame();\n\n applicationFrame.setDefaultCloseOperation(DISPOSE_ON_CLOSE);\n applicationFrame.getContentPane().add(viewerComponentPanel);\n // Now that the GUI is all in place, we can try openning a PDF\n c.setPageFitMode(DocumentViewController.PAGE_FIT_WINDOW_WIDTH, false);\n c.openDocument(filePath);\n // show the component\n applicationFrame.pack();\n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n applicationFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);\n applicationFrame.setSize(screenSize);\n applicationFrame.setLocationRelativeTo(null);\n applicationFrame.setResizable(false);\n applicationFrame.setVisible(true);\n\n }", "public void genPDF(String qfname)\r\n\t{\n\t\tboolean res = loadQg(qfname);\r\n\t\tif(!res)\r\n\t\t{\r\n\t\t\tmsg = \"(PDFW:GenPDF) Can not load questions from: \"+qfname;\r\n\t\t\tJOptionPane.showMessageDialog(null, msg);\r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "public void onClick(View v) {\n\t\t\t\topenThisFileFromSD(\"maintainguideactivity.pdf\");\n\t\t\t}", "private void showFileChooser() {\n // Intent intent = new Intent();\n\n /* intent.setType(\"application/pdf\");\n intent.setType(\"docx*//*\");*/\n\n Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);\n intent.addCategory(Intent.CATEGORY_OPENABLE);\n String [] mimeTypes = {\"application/pdf/docx\"};\n intent.setType(\"*/*\");\n intent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes);\n\n\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"), PICK_IMAGE_REQUEST);\n }", "void open() {\n \tJFileChooser fileopen = new JFileChooser();\n int ret = fileopen.showDialog(null, \"Open file\");\n\n if (ret == JFileChooser.APPROVE_OPTION) {\n document.setFile(fileopen.getSelectedFile());\n textArea.setText(document.getContent());\n }\n }", "private void detectionPDF() {\n\t\tif (sourcePDF.getText().equals(\"\")){\n\t\t\tlockButton();\n\t\t\tmessage.setText(\"<html><span color='red'>Pas de PDF</span></html>\");\n\t\t}\n\t\telse{\n\t\t\tif(new File(sourcePDF.getText()).exists()){\n\t\t\t\tmessage.setText(\"<html><head><meta charset=\\\"UTF-8\\\"><span color='green'>Fichier PDF détecté</span></html>\");\n\t\t\t\tunlockButton();\n\t\t\t}\n\t\t\telse\n\t\t\t\tmessage.setText(\"<html><span color='red'>le fichier \"+ sourcePDF.getText() +\" n'existe pas</span></html>\");\n\t\t}\n\t}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tIntent intent = new Intent(getApplicationContext(),Routine.class);\n\t\t\t\tintent.putExtra(\"pdf\", \"http://www.aust.edu/bba/class_routine_mba.pdf\");\n\t\t\t\tstartActivity(intent);\n\t\t\t}", "public static void main(String[] args) {\n PdfFile pdfFile=new PdfFile(\"PDF File\");\n pdfFile.open();\n pdfFile.close();\n pdfFile.edit();\n WordFile wordFile=new WordFile(\"Word File\");\n wordFile.open();\n wordFile.close();\n wordFile.edit();\n JavaFile javaFile=new JavaFile(\"Java File\");\n javaFile.open();\n javaFile.close();\n javaFile.edit();\n\n }", "@Override\n public void onClick(View view) {\n\n //Check if a paper was actually saved to the device\n if (view.findViewById(R.id.md_title) != null) {\n String paperTitle = (String) view.findViewById(R.id.md_title).getTag();\n PDFViewer viewer = new PDFViewer();\n viewer.openPDF(\"\", paperTitle, view);\n\n }\n else\n {\n CharSequence paperMissingText = \"File not found.\";\n Toast toast = Toast.makeText(mContext, paperMissingText, Toast.LENGTH_SHORT);\n toast.show();\n }\n }", "public PDF()\n {\n \n i_hdl = create_Handler();\n }", "private void showHelp() {\n\t\tJOptionPane.showMessageDialog(this, \"Created by Mario Bobić\", \"About File Encryptor\", JOptionPane.INFORMATION_MESSAGE);\n\t}", "public void openHelp(){\n\n Intent helpIntent = new Intent(this, Help.class);\n startActivity(helpIntent);\n\n }", "public void PDF() {\n try {\r\n /* try {\r\n ImageIO.write(Imagen, \"png\", new File(Path + \"1\" + \".png\"));\r\n } catch (IOException ex) {\r\n Logger.getLogger(panelprincipal.getName()).log(Level.SEVERE, null, ex);\r\n }*/\r\n Image imagen = Image.getInstance(jfc.getSelectedFile().getPath() + \"#\" + \".png\");\r\n imagen.scaleAbsolute(500, 400);\r\n imagen.setAlignment(Element.ALIGN_CENTER);\r\n FileOutputStream archivo = new FileOutputStream(jfc.getSelectedFile().getPath() + \".PDF\");\r\n Document d = new Document();\r\n PdfWriter.getInstance(d, archivo);\r\n PDF creacion = new PDF();\r\n d.open();\r\n d.setPageSize(PageSize.LETTER);\r\n d.add(creacion.setTitulo(nombrediagrama));\r\n //doc.add(new Paragraph(\" Carlos Wilfredo Romero Maradiaga \\n\"));\r\n d.add(imagen);\r\n // doc.add(pdf.getCuerpo(\"\\nCódigo Generado:\\n\"));\r\n /* if (codigo.length()<2) {\r\n doc.add(pdf.getCuerpo(\"Para poder visualizar el código, primero debe generarlo desde el Sistema y vuelva a guardar el archivo.\"));\r\n } else {\r\n doc.add(pdf.getCuerpo(codigo));\r\n */\r\n d.close();\r\n JOptionPane.showMessageDialog(null, \"El PDF se genero excelente\", \"Excelente\", JOptionPane.INFORMATION_MESSAGE);\r\n } catch (Exception e) {\r\n }\r\n }", "public HelpWindow(File file) \n {\n setFrameIcon(); //set the icon shown on the top left side of the frame\n \n this.initComponents(); //initialises various components\n\n /*\n * Set the page to the JEditorPane\n */\n try \n {\n currentPage = file.toURI().toURL(); //URL of the html to be displayed\n \n this.mainEditorPane.setContentType(\"txt/html\");\n //this.mainEditorPane.setText(defaultURL);\n \n this.mainEditorPane.setPage(currentPage);\n } \n catch (IOException ex) \n {\n ex.printStackTrace();\n }\n }", "@Override\r\n\tpublic File createPDF() {\n\t\treturn null;\r\n\t}", "@Override\n public String getHelpFile() {\n final String filePath = \"/descriptor/au.com.centrumsystems.hudson.plugin.buildpipeline.trigger.BuildPipelineTrigger/help\";\n final String fileName = \"buildPipeline.html\";\n return String.format(\"%s/%s\", filePath, fileName);\n }", "public static void main(String[] args) {\n\t\tString path = \"Test1.pdf\";\n\t\t\n\n\t}", "private void selectPDFFile() {\n JFileChooser jfc = new JFileChooser();\n jfc.setFileFilter(new PDFFilter());\n jfc.setMultiSelectionEnabled(false);\n int ret = jfc.showDialog(this, \"Open\");\n if (ret == 0) {\n readFile = jfc.getSelectedFile();\n inputField.setText(readFile.getAbsolutePath());\n String outString = readFile.getAbsolutePath();\n outString = outString.substring(0, outString.length() - 3);\n outString = outString + \"txt\";\n outputField.setText(outString);\n progressLabel.setBackground(INFO);\n progressLabel.setText(PRESS_EXTRACT);\n } else {\n System.out.println(NO_FILE_SELECTED);\n progressLabel.setBackground(WARNING);\n progressLabel.setText(SELECT_FILE);\n }\n }", "public static boolean canDisplayPdf(Context context) {\n\t\tPackageManager packageManager = context.getPackageManager();\n\t\tIntent testIntent = new Intent(Intent.ACTION_VIEW);\n\t\ttestIntent.setType(MIME_TYPE_PDF);\n\t\tif (packageManager.queryIntentActivities(testIntent,\n\t\t\t\tPackageManager.MATCH_DEFAULT_ONLY).size() > 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public String open() {\n\t\tUtilGUI.centerShell(DocFetcher.getInstance().getShell(), shell);\n\t\tshell.open();\n\t\twhile (! shell.isDisposed()) {\n\t\t\tif (! shell.getDisplay().readAndDispatch())\n\t\t\t\tshell.getDisplay().sleep();\n\t\t}\n\t\treturn answer;\n\t}", "private void createPDF(OutputStream os,String htmlFileName) {\n\t\tLog.info(\"url : \"+htmlFileName);\r\n //String HTML_TO_PDF = \"D:\\\\ConvertedFile.pdf\";\r\n // OutputStream os = new FileOutputStream(HTML_TO_PDF); \r\n \r\n /* File myhtml = new File(htmlFileName);\r\n FileInputStream fileinput = null;\r\n BufferedInputStream mybuffer = null;\r\n DataInputStream datainput = null;\r\n\r\n fileinput = new FileInputStream(myhtml);\r\n mybuffer = new BufferedInputStream(fileinput);\r\n datainput = new DataInputStream(mybuffer);\r\n\r\n while (datainput.available() != 0) {\r\n \t\r\n \tif(datainput.readLine().)\r\n \tSystem.out.println(datainput.readLine());\r\n \t}\r\n*/\r\n try {\r\n\t ITextRenderer renderer = new ITextRenderer();\r\n\t Log.info(\"Skill PDF Export->Create PDF->File name: \" + htmlFileName);\r\n\t renderer.setDocument(new File(htmlFileName)); \r\n\t renderer.layout();\r\n\t renderer.createPDF(os); \r\n\t os.close();\r\n }catch (Exception e) {\r\n \tLog.error(\"Error in SkillPdfExport\",e);\r\n }\r\n\t}", "@FXML\n\tpublic void generarPDFClick(ActionEvent event) {\n\t\tString htmlContent = this.examen.getTitolHtml()+this.examen.getEnunciatHtml()+System.lineSeparator();\n\n\t\tPdfManager manager;\n\t\ttry {\n\t\t\tmanager = new PdfManager(\"Examen.pdf\");\n\n\t\t\tmanager.generarPDF( htmlContent );\n\n\t\t\tFile pdfGenerat = new File(\"Examen.pdf\");\n\n\t\t\tHostServices hostServices = Model.getInstance().getApp().getHostServices();\n\t hostServices.showDocument(pdfGenerat.getAbsolutePath());\n\n\t\t} catch (Excepcio e) {\n\t\t\t//e.printStackTrace();\n\t\t MenuController.mostrarError(\"Examen a PDF\", \"Error generant el document. \"+e.getMessage());\n\t\t}\n\t}", "public File createPDF(File file) {\n //\tReportEngine re = ReportEngine.get (getCtx(), ReportEngine.PAYMENT, getC_Payment_ID());\n //\tif (re == null)\n return null;\n //\treturn re.getPDF(file);\n }", "@Override\n\tpublic void openDocument(String path, String name) {\n\t\t\n\t}", "@Override\n void execute() {\n doc.open();\n }", "public static void readPDF() throws IOException {\n File file = new File(\"Testdaten_Rechnungseinreichung.pdf\");\n FileInputStream fileInputStream = new FileInputStream(file);\n PDDocument pdfDocument = PDDocument.load(fileInputStream);\n\n System.out.println(\"Number of Pages: \" +pdfDocument.getPages().getCount());\n\n PDFTextStripper pdfTextStripper = new PDFTextStripper();\n\n String TextDocument = pdfTextStripper.getText(pdfDocument);\n\n PerformCheck performCheck = new PerformCheck(TextDocument);\n performCheck.checkIBAN();\n pdfDocument.close();\n fileInputStream.close();\n }", "@FXML\n private void openFile() {\n try {\n \tFile file = new File(filmTable.getSelectionModel().getSelectedItem().getLocation());\n desktop.open(file);\n } catch (IOException ex) {\n \tex.printStackTrace();\n }\n }", "public void clickOnPdfFormatButton()\n \t{\n \t\tproductRequirementsPageLocators.clickOnpdfFormatButton.click();\n\n \t}", "private void pdfActionPerformed(java.awt.event.ActionEvent evt) {\n\n try{\n prepareFile();\n relv.GeneratePDF(path, Client.getNom() + \" \" + Client.getPrenom(), Client.getCin(), operations, periode, from, to);\n JOptionPane.showMessageDialog(this,\"Votre relevé en format PDF a été généré avec Succes\",\"Succes\", JOptionPane.INFORMATION_MESSAGE); \n } catch (SQLException ex) {\n JOptionPane.showMessageDialog(this, \"Échec lors de l'écriture dans la base de données. Veuillez réessayer plus tard\", \"Echec de l'opération\", JOptionPane.ERROR_MESSAGE);\n } catch (Exception ex) {\n System.out.println(\"error \"+ex.getMessage());\n } \n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_pdf, container, false);\n\n try {\n Bundle bundle = getArguments();\n String filename = bundle.getString(\"FILE_NAME\");\n pdfView = view.findViewById(R.id.pdfView);\n File pdf = new File(filename);\n pdfView.fromFile(pdf)\n .enableDoubletap(true)\n .enableSwipe(true)\n .load();\n } catch (Exception ex) {\n Snackbar.make(getActivity().getWindow().getDecorView(), \"فایل خراب است\", Snackbar.LENGTH_LONG).show();\n }\n return view;\n }", "private void showHelpDialog() {\n\n view.helpDialog();\n }", "@Override\r\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tString Btn = e.getActionCommand();\r\n\t\t\tif(Btn.equals(\"Find\"))\r\n\t\t\t{\r\n\t\t\t\tFrame frame = getFrame();\r\n\t\t\t\tJFileChooser chooser = new JFileChooser();\r\n\t\t\t\tchooser.setDialogTitle(\"Find PDF\");\r\n\t\t\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\"PDF files\",\"PDF\");\r\n\t\t\t\tchooser.setFileFilter(filter);\r\n\t\t\t\tchooser.setAcceptAllFileFilterUsed(false);\r\n\t\t\t\tint ret = chooser.showOpenDialog(frame);\t\t\t\t\r\n\t\t\t\tif (ret != JFileChooser.APPROVE_OPTION) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\ttry {\r\n\t\t\t\t\tpdfSouce = chooser.getSelectedFile();\r\n\t\t\t\t\tFile file = new File(pdfSouce.getAbsolutePath());\r\n\t\t\t\t\tRandomAccessFile raf = new RandomAccessFile(file, \"r\");\r\n\t\t\t\t\tFileChannel channel = raf.getChannel();\r\n\t\t\t\t\tMappedByteBuffer buf = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size());\r\n\t\t\t\t\tpdffile = new PDFFile(buf);\r\n\t\t\t\t\tString pdfInfo = pdffile.getStringMetadata(\"Producer\");\r\n\t\t\t\t\tif(pdfInfo.contains(\"PowerPoint\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(this, \"PPT形式のPDFは変更できません。\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tinputLocation.setEnabled(true);\r\n\t\t\t\t\t\tinputLocation.setText(pdfSouce.getAbsolutePath());\r\n\t\t\t\t}\r\n\t\t\t\t} \r\n\t\t\t\tcatch (IOException e1) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(Btn.equals(\"Out\"))\r\n\t\t\t{\r\n\t\t\t\timagePath = pdfSouce.getAbsolutePath();\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tif(inputLocation.getText()==null)\r\n\t\t\t\t\t{\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\texportsDir = chooseDir(imagePath, this, true); \r\n\t\t\t\t\tif (exportsDir == null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\toutLocation.setEnabled(true);\r\n\t\t\t\t\toutLocation.setText(exportsDir.getAbsolutePath());\r\n\t\t\t\t}\r\n\t\t\t\tfinally\r\n\t\t\t\t{\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\tFile file = new File(pdfSouce.getAbsolutePath());\r\n\t\t\t\t\tRandomAccessFile raf = new RandomAccessFile(file, \"r\");\r\n\t\t\t\t\tFileChannel channel = raf.getChannel();\r\n\t\t\t\t\tMappedByteBuffer buf = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size());\r\n\t\t\t\t\tpdffile = new PDFFile(buf);\r\n\r\n\r\n\t\t\t\t} catch (IOException e1) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// draw the first page to an image\r\n\t\t\t\tfor(int i = 1 ;i<=pdffile.getNumPages();i++ )\r\n\t\t\t\t{\t\t\t\t\r\n\t\t\t\t\tPDFPage page = pdffile.getPage(i);\r\n\r\n\t\t\t\t\t//get the width and height for the doc at the default zoom \r\n\t\t\t\t\tRectangle rect = new Rectangle(0,0,\r\n\t\t\t\t\t\t\t(int)page.getBBox().getWidth(),\r\n\t\t\t\t\t\t\t(int)page.getBBox().getHeight());\r\n\r\n\t\t\t\t\t//generate the image\r\n\r\n\t\t\t\t\tImage image = page.getImage(\r\n\t\t\t\t\t\t\trect.width, rect.height, //width & height\r\n\t\t\t\t\t\t\trect, // clip rect\r\n\t\t\t\t\t\t\tnull, // null for the ImageObserver\r\n\t\t\t\t\t\t\ttrue, // fill background with white\r\n\t\t\t\t\t\t\ttrue // block until drawing is done\r\n\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\tint w = image.getWidth(null);\r\n\t\t\t\t\tint h = image.getHeight(null);\r\n\t\t\t\t\tBufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);\r\n\t\t\t\t\tGraphics2D g2 = bi.createGraphics();\r\n\t\t\t\t\tg2.drawImage(image, 0, 0, null);\r\n\t\t\t\t\tg2.dispose();\r\n\t\t\t\t\ttry\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tImageIO.write(bi, \"PNG\", new File(exportsDir.getAbsolutePath(),pdfSouce.getName().replaceAll(\".pdf\", \"_\")+i+\".png\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch(IOException ioe)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"write: \" + ioe.getMessage());\r\n\t\t\t\t\t} \r\n\t\t\t\t}\r\n\t\t\t\tCompress zip = new Compress();\r\n\t\t\t\tzip.Zip();\r\n\t\t\t\tDelfiles();\r\n\t\t\t\tJOptionPane.showMessageDialog(this, \"Files were exported to:\\n\" + exportsDir.getAbsolutePath());\r\n\t\t\t}\r\n\t\t}", "@SuppressLint(\"InlinedApi\")\n @Override\n public void onDataLoaded(Uri pdfUri) {\n if (mAlreadyOpenedPdf) {\n return;\n }\n\n // Open in external application\n mAlreadyOpenedPdf = true;\n if (pdfUri == null) {\n Toast.makeText(getActivity(), R.string.cannot_download_pdf, Toast.LENGTH_SHORT).show();\n } else {\n try {\n startActivity(\n new Intent(Intent.ACTION_VIEW, pdfUri)\n .addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION)\n );\n } catch (ActivityNotFoundException e) {\n Toast.makeText(getActivity(), R.string.cannot_open_pdf, Toast.LENGTH_SHORT).show();\n }\n }\n\n // Dismiss this dialog (we already dismiss ourselves if there's any saved state so loss here is ok)\n dismissAllowingStateLoss();\n }", "@Override\n public void execute () {\n if (Desktop.isDesktopSupported()) {\n try {\n Desktop.getDesktop().browse(new URI(HELP_URL));\n }\n catch (Exception e) {\n\n }\n }\n }", "private static void usage()\n {\n System.err.println( \"Usage: java at.ac.tuwien.dbai.pdfwrap.ProcessFile [OPTIONS] <PDF file> [Text File]\\n\" +\n \" -password <password> Password to decrypt document\\n\" +\n \" -encoding <output encoding> (ISO-8859-1,UTF-16BE,UTF-16LE,...)\\n\" +\n \" -xmillum output XMIllum XML (instead of XHTML)\\n\" +\n \" -norulinglines do not process ruling lines\\n\" +\n \" -spaces split low-level segments according to spaces\\n\" +\n \" -console Send text to console instead of file\\n\" +\n \" -startPage <number> The first page to start extraction(1 based)\\n\" +\n \" -endPage <number> The last page to extract(inclusive)\\n\" +\n \" <PDF file> The PDF document to use\\n\" +\n \" [Text File] The file to write the text to\\n\"\n );\n System.exit( 1 );\n }", "private void openHelpDialog() {\r\n\t\t// Get view and put relevant information into the view.\r\n\t\tLayoutInflater li = LayoutInflater.from(this);\r\n\t\tView view = li.inflate(R.layout.archive_help_dialog, null);\r\n\r\n\t\tnew AlertDialog.Builder(this)\r\n\t\t\t\t.setTitle(\r\n\t\t\t\t\t\tgetResources().getString(R.string.action_archive)\r\n\t\t\t\t\t\t\t\t+ \" \"\r\n\t\t\t\t\t\t\t\t+ getResources()\r\n\t\t\t\t\t\t\t\t\t\t.getString(R.string.action_help))\r\n\t\t\t\t.setIcon(R.drawable.icon)\r\n\t\t\t\t.setView(view)\r\n\t\t\t\t.setNegativeButton(R.string.dialog_general_button_close,\r\n\t\t\t\t\t\tnew DialogInterface.OnClickListener() {\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,\r\n\t\t\t\t\t\t\t\t\tint whichButton) {\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}).show();\r\n\t}", "public void testCreate () throws IOException {\n\t PDDocument document = new PDDocument(); \r\n\t \r\n\t //Saving the document\r\n\t document.save(\"./my_doc.pdf\");\r\n\t \r\n\t System.out.println(\"PDF created\"); \r\n\t \r\n\t //Closing the document \r\n\t document.close();\r\n\t}", "public static void main(String args[]) throws Exception {\n\t String filePath = \"test.pdf\";\r\n\t \r\n\t String pdfText = FileReader.getFile(filePath, 581, 584); \r\n\t text_position.position(580, 584);\r\n\t \r\n//\t String pdfText = FileReader.getFile(filePath, 396, 407); \r\n//\t text_position.position(395, 407);\r\n\r\n\t txtCreate.creatTxtFile(\"test\");\r\n\t txtCreate.writeTxtFile(pdfText);\r\n\t xmlCreater.getXML(\"test.txt\");\r\n }", "public void consult(String strFilePath)\r\n {\r\n m_consoleCtrl.openFile(strFilePath);\r\n }", "public interface PdfProvider {\n /**\n * Create a thumbnail image for a given PDF file.\n *\n * @param inputFile Input file.\n * @param outputStream OutputStream, to which the thumbnail is written. Important: Stream is not closed!\n * @param format Output file format given as a MIME type.\n * @param width Width in pixel.\n * @param height Height in pixel.\n * @param quality Quality factor for output compression.\n * @param speedHint Speed factor for conversion.\n * @throws Exception on any error opening the file, converting the file or writing to the output.\n */\n\n void createThumbNail(File inputFile, OutputStream outputStream,\n String format, int width, int height,\n ConversionCommand.CompressionQuality quality,\n ConversionCommand.SpeedHint speedHint) throws Exception;\n\n PdfDocumentInformation getDocumentInformation(File pdfFile) throws Exception;\n\n int countPages(File pdfFile) throws Exception;\n\n void createPdfFromImages(File[] imageFiles, PdfDocumentInformation documentInformation, File outputPdfFile) throws Exception;\n\n void createPdfFromImages(byte[][] imageFileByteArrays, PdfDocumentInformation documentInformation,\n int width, int height, OutputStream outputStream) throws Exception;\n}", "public void openDocument(L documentLocation) throws IOException;", "public static void showHelpPage(Player targetChar, String filename)\n\t{\n\t\tfinal NpcHtmlMessage html = new NpcHtmlMessage(0);\n\t\thtml.setFile(\"data/html/admin/\" + filename);\n\t\ttargetChar.sendPacket(html);\n\t}", "public void createPdf(String filePath) throws DocumentException, FileNotFoundException, BadElementException, IOException, SQLException {\r\n Calendar date = Calendar.getInstance();\r\n String dato;\r\n dato = \"\"+date.get(Calendar.YEAR)+\"-\"+MyUtil.p0(date.get(Calendar.MONTH)+1)+\"-\"+MyUtil.p0((date.get(Calendar.DAY_OF_MONTH)))+\"-\";\r\n \r\n String name = fal.getFiremanById(model.getTimeSheet(0).getEmployeeId()).getFirstName() +\" \"+ fal.getFiremanById(model.getTimeSheet(0).getEmployeeId()).getLastName();\r\n fileName = dato + name + \".pdf\";\r\n \r\n Document document = new Document();\r\n PdfWriter.getInstance(document, new FileOutputStream(filePath+fileName));\r\n document.open();\r\n addContent(document);\r\n document.close();\r\n\r\n }", "public void openFile() {\n\t\tfc.setCurrentDirectory(new File(System.getProperty(\"user.dir\")));\n\t\tint returnVal = fc.showOpenDialog(null);\n\t\tif (returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\tFile file = fc.getSelectedFile();\n\t filename.setText(file.getName());\n\t try {\n\t\t\t\tmodel.FileContent(file);\t//read the content of the input file\n\t\t\t\tplotContent.repaint();\t//repaint the JComponent\n\t\t\t\t\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\r\n\t\t\t\t\"Please provide a path to password protected PDF file in an appriopriate format i.e. C:\\\\Users\\\\User\\\\Documents\\\\File.pdf\");\r\n\t\tSystem.out.println(\"or press 'q' to quit to main menu\");\r\n\t\tString filePath = input.next();\r\n\t\t// if statement allowing to go back to main menu instead of typing in\r\n\t\t// file directory\r\n\t\tif (filePath.equals(\"q\") || (filePath.equals(\"Q\"))) {\r\n\t\t} else {\r\n\t\t\tstartAttack(filePath);\r\n\t\t}\r\n\t}", "public void openFile(File selectedFile) {\n System.err.println(\"selected: \" + selectedFile);\n }", "public void onClick(View v) {\n\t\t\topenPDF();\n\t\t}", "@Override\n\tpublic void buildPdfDocument(Map<String, Object> model, Document doc, PdfWriter writer,\n\t\t\tHttpServletRequest request, HttpServletResponse response) throws Exception {\n\t\tExportExam exportExam = (ExportExam) model.get(\"exportExam\");\n\t\tExportExam exportExam2 = (ExportExam) model.get(\"exportExam2\");\n\t\tListExam listExam = null;\n\t\tListExam listExam2 = null;\n\t\tif(exportExam!=null){\n\t\tlistExam = exportExam.listExam;\n\t\t}\n\t if(exportExam2!=null){\n\t\tlistExam2 = exportExam2.listExam;\n\t\t}\n\t\n\t\tString url = request.getRequestURL().toString();\n\t\tString baseURL = url.substring(0, url.length() - request.getRequestURI().length()) + request.getContextPath();\n\t\tString path = baseURL + \"/resources/fonts/vuArial.ttf\";\n\t\tFontFactory.register(path);\n\t\t\n\t\t//\"C:\\\\Users\\\\HennessyVox\\\\Downloads\\\\Compressed\\\\vuArial.ttf\"\n\t\t//Font fontHeader = FontFactory.getFont(FONT, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);\n\t\tBaseFont base = BaseFont.createFont(path, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);\n\t\t Font fontHeader = new Font(base, 10, Font.NORMAL);\n\t\t Font fontHeader2 = new Font(base, 10, Font.UNDERLINE);\n\t\t Font fontContent = new Font(base, 11, Font.NORMAL);\n\t\t Font fontAnswent = new Font(base, 11, Font.NORMAL, BaseColor.RED);\n\t\t Font fontTitle = new Font(base, 12, Font.BOLD);\n\t\t Font fontNumber = new Font(base, 11, Font.BOLD);\n\t\t//Font fontHeader = new Font(FontFamily.TIMES_ROMAN, 12, Font.NORMAL);\n\t String SchoolHeader = \"TRƯỜNG ĐẠI HỌC BÁCH KHOA TP HCM\";\n\t\t\n\t // Get faulty info.\n\t\n\t \n\t\ttry {\n\t\t\t\n\t\t\t if(listExam!=null){\n\t\t\t\t System.out.println(\"=============================================================\");\n\t\t\t\t int CoutExam = 1;\n\t\t\t String FacultyHeader = exportExam.getFaulty().toUpperCase();\n\t\t\t \t\n\t\t\t /// String FacultyHeader = \"KHOA KHOA HỌC VÀ KỸ THUẬT MÁY TÍNH\";\n\t\t\t String InfoStudentHeader1 = \"Họ Tên : ..........................\";\n\t\t\t String InfoStudentHeader2 = \"MSSV : ..........................\";\n\t\t\t PdfPTable table = new PdfPTable(new float[] { 75, 25 });\n\t\t\t table.setWidthPercentage(100);\n\t\t\t \n\t\t\t table.addCell(getCell(new Paragraph(SchoolHeader,fontHeader), PdfPCell.ALIGN_LEFT));\n\t\t\t \n\t\t\t table.addCell(getCell(new Paragraph(InfoStudentHeader1,fontHeader), PdfPCell.ALIGN_RIGHT));\n\t\t\t table.addCell(getCell(new Paragraph(FacultyHeader,fontHeader2), PdfPCell.ALIGN_LEFT));\n\t\t\t table.addCell(getCell(new Paragraph(InfoStudentHeader2,fontHeader), PdfPCell.ALIGN_RIGHT));\n\t\t\t table.setSpacingAfter(10);\n\t\t\t doc.add(table);\n\t\t\t \n\t\t\t // ADD title\n\t\t\t //Font fontTitle = FontFactory.getFont(FONT, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);\n\t\t\t //String titleExam = \"ĐỀ KIỂM TRA CUỐI KÌ 2017\";\n\t\t\t // System.out.println(exportExam.getExamName().toUpperCase());\n\t\t\t String titleExam = exportExam.getExamName().toUpperCase();\n\t\t\t \n\t\t\t Paragraph pHeader = new Paragraph(titleExam,fontTitle);\n\t\t\t pHeader.setAlignment(Paragraph.ALIGN_CENTER);\n\t\t\t doc.add(pHeader);\n\t\t\t \n\t\t\t String SubjectExam = \"Môn Thi : \" +exportExam.getSubjectName();\n\t\t\t String CodeExam = \"Mã đề : \" + exportExam.getCode();\n\t\t\t String timeExam = \"Thời gian : \" + exportExam.getTime();\n\t\t\t Font fontSubject = new Font(base, 10, Font.NORMAL);\n\t\t\t Font fontExam = new Font(base, 10, Font.NORMAL);\n\t\t\t \n\t\t\t PdfPTable table2 = new PdfPTable(2);\n\t\t\t table2.setWidthPercentage(80);\n\t\t\t //System.out.println(Charset.forName(\"UTF-8\").encode(SchoolHeader));\n\n\t\t\t table2.addCell(getCell(new Paragraph(SubjectExam,fontSubject), PdfPCell.ALIGN_LEFT));\n\t\t\t \n\t\t\t table2.addCell(getCell(new Paragraph(timeExam,fontExam), PdfPCell.ALIGN_RIGHT));\n\t\t\t table2.addCell(getCell(new Paragraph(CodeExam,fontExam), PdfPCell.ALIGN_LEFT));\n\t\t\t table2.addCell(getCell(new Paragraph(\"\",fontHeader), PdfPCell.ALIGN_RIGHT));\n\t\t\t table2.setSpacingBefore(5);\n\t\t\t doc.add(table2);\n\t\t\t \n\t\t\t String noteExam = exportExam.getNoteExam();\n\t\t\t Font fontNote = new Font(base, 8, Font.ITALIC);\n\t\t\t \n\t\t\t Paragraph pNote = new Paragraph(noteExam, fontNote);\n\t\t\t pNote.setAlignment(Paragraph.ALIGN_MIDDLE);\n\t\t\t doc.add(pNote);\n\t\t\t PdfPTable table3 = new PdfPTable(1);\n\t\t\t table3.setSpacingBefore(5);\n\t\t\t table3.setWidthPercentage(80);\n\t\t\t Font finalExam = new Font(base, 10, Font.NORMAL);\n\t\t\t table3.addCell(getCell(new Paragraph(\"*****\",finalExam), PdfPCell.ALIGN_CENTER));\n\t\t\t doc.add(table3);\n\t\t\t\t \n\t\t\t for(int i = 0; i < listExam.blockRootQuestion.size() ; i++){\n\t\t\t\t System.out.println(\"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\");\n\t\t\t\t \n\t\t\t\t List listBlock = new List(List.UNORDERED);\n\t\t\t\t listBlock.setAutoindent(false);\n\t\t\t\t // listBlock.setSymbolIndent(20);\t\n\t\t\t\t listBlock.add(new ListItem(new Paragraph(listExam.blockRootQuestion.get(i).rootQuestionBlock.getContent(),fontContent)));\n\t\t\t System.out.println(\"########### Block NAME \" +listExam.blockRootQuestion.get(i).rootQuestionBlock.getContent());\n\t\t\t\t \n\t\t\t\t doc.add(listBlock);\n\t\t\t \n\t\t\t \n\t\t \tSystem.out.println(\"########### SIZE QUESTION \" +listExam.blockRootQuestion.get(i).questionList.size());\n \n\t\t\t for(int j = 0 ; j < listExam.blockRootQuestion.get(i).questionList.size(); j++){\t\n\t\t\t \tSystem.out.println(\"########### QUESTION NAME \" +listExam.blockRootQuestion.get(i).questionList.get(j).question.getContent());\n\t\t\t\t\t\t\n\t\t\t \t List listQuestion = new List(List.UNORDERED);\n\t\t\t\t\t listQuestion.setListSymbol(\"\");\n\t\t\t \t\n\t\t\t \t//SingleQuestion questionPDF = null;\n\t\t\t \t//questionPDF = listExam.blockRootQuestion.get(i).questionList.get(j);\n\t\t\t \tStringBuilder sb = new StringBuilder();\n\t\t\t\t\t\tsb.append(\"Câu \");\n\t\t\t\t\t\tsb.append(CoutExam);\n\t\t\t\t\t\tsb.append(\". \");\n\t\t\t\t\t\tString strI = sb.toString();\n\t\t\t \t//strI = new Paragraph(strI, fontNumber);\n\t\t\t \t//listQuestion.setPostSymbol(strI);\n\t\t\t \tSystem.out.println(strI);\n\t\t\t listQuestion.add(new ListItem(new Paragraph(strI + listExam.blockRootQuestion.get(i).questionList.get(j).question.getContent(), fontContent)));\n\t\t\t listQuestion.setIndentationLeft(10);\n\t\t\t doc.add(listQuestion);\n\t\t\t List listAnswerPDF = new List(List.ORDERED, List.ALPHABETICAL);\n\t\t\t for(int k = 0; k < listExam.blockRootQuestion.get(i).questionList.get(j).answerList.size(); k++){\n\t\t\t\t\t System.out.println(\"########### Answer NAME \" +listExam.blockRootQuestion.get(i).questionList.get(j).answerList.get(k).getContent());\n\t\t\t \t listAnswerPDF.add(new ListItem(new Paragraph(listExam.blockRootQuestion.get(i).questionList.get(j).answerList.get(k).getContent(), fontContent))); \t \n\t\t\t }\n\t\t\t listAnswerPDF.setIndentationLeft(25);\n\t\t\t doc.add(listAnswerPDF);\n\t\t\t CoutExam++;\n\t\t\t }\n\t\t\t doc.add( Chunk.NEWLINE ); \n\t\t\t }\n\t\t\t // doc.close();\n\t\t\t listExam =null;\n\t\t\t }\n\t\t\t /*\n\t\t\t * Export Answer\n\t\t\t */\n\t\t\telse if(listExam2!=null){\n\t\t\t\t int CoutExam = 1;\n\t\t\t\t System.out.println(\"#######################################################\");\n\t\t\t\t String FacultyHeader = exportExam2.getFaulty().toUpperCase();\n\t\t\t \t\n\t\t\t\t /// String FacultyHeader = \"KHOA KHOA HỌC VÀ KỸ THUẬT MÁY TÍNH\";\n\t\t\t\t String InfoStudentHeader1 = \"Họ Tên : ..........................\";\n\t\t\t\t String InfoStudentHeader2 = \"MSSV : ..........................\";\n\t\t\t\t PdfPTable table = new PdfPTable(new float[] { 75, 25 });\n\t\t\t\t table.setWidthPercentage(100);\n\t\t\t\t \n\t\t\t\t table.addCell(getCell(new Paragraph(SchoolHeader,fontHeader), PdfPCell.ALIGN_LEFT));\n\t\t\t\t \n\t\t\t\t table.addCell(getCell(new Paragraph(InfoStudentHeader1,fontHeader), PdfPCell.ALIGN_RIGHT));\n\t\t\t\t table.addCell(getCell(new Paragraph(FacultyHeader,fontHeader2), PdfPCell.ALIGN_LEFT));\n\t\t\t\t table.addCell(getCell(new Paragraph(InfoStudentHeader2,fontHeader), PdfPCell.ALIGN_RIGHT));\n\t\t\t\t table.setSpacingAfter(10);\n\t\t\t\t doc.add(table);\n\t\t\t\t \n\t\t\t\t // ADD title\n\t\t\t\t //Font fontTitle = FontFactory.getFont(FONT, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);\n\t\t\t\t //String titleExam = \"ĐỀ KIỂM TRA CUỐI KÌ 2017\";\n\t\t\t\t // System.out.println(exportExam.getExamName().toUpperCase());\n\t\t\t\t String titleExam = exportExam2.getExamName().toUpperCase();\n\t\t\t\t \n\t\t\t\t Paragraph pHeader = new Paragraph(titleExam,fontTitle);\n\t\t\t\t pHeader.setAlignment(Paragraph.ALIGN_CENTER);\n\t\t\t\t doc.add(pHeader);\n\t\t\t\t \n\t\t\t\t String SubjectExam = \"Môn Thi : \" +exportExam2.getSubjectName();\n\t\t\t\t String CodeExam = \"Mã đề : \" + exportExam2.getCode();\n\t\t\t\t String timeExam = \"Thời gian : \" + exportExam2.getTime();\n\t\t\t\t Font fontSubject = new Font(base, 10, Font.NORMAL);\n\t\t\t\t Font fontExam = new Font(base, 10, Font.NORMAL);\n\t\t\t\t \n\t\t\t\t PdfPTable table2 = new PdfPTable(2);\n\t\t\t\t table2.setWidthPercentage(80);\n\t\t\t\t //System.out.println(Charset.forName(\"UTF-8\").encode(SchoolHeader));\n\n\t\t\t\t table2.addCell(getCell(new Paragraph(SubjectExam,fontSubject), PdfPCell.ALIGN_LEFT));\n\t\t\t\t \n\t\t\t\t table2.addCell(getCell(new Paragraph(timeExam,fontExam), PdfPCell.ALIGN_RIGHT));\n\t\t\t\t table2.addCell(getCell(new Paragraph(CodeExam,fontExam), PdfPCell.ALIGN_LEFT));\n\t\t\t\t table2.addCell(getCell(new Paragraph(\"\",fontHeader), PdfPCell.ALIGN_RIGHT));\n\t\t\t\t table2.setSpacingBefore(5);\n\t\t\t\t doc.add(table2);\n\t\t\t\t \n\t\t\t\t String noteExam = exportExam2.getNoteExam();\n\t\t\t\t Font fontNote = new Font(base, 8, Font.ITALIC);\n\t\t\t\t \n\t\t\t\t Paragraph pNote = new Paragraph(noteExam, fontNote);\n\t\t\t\t pNote.setAlignment(Paragraph.ALIGN_MIDDLE);\n\t\t\t\t doc.add(pNote);\n\t\t\t\t PdfPTable table3 = new PdfPTable(1);\n\t\t\t\t table3.setSpacingBefore(5);\n\t\t\t\t table3.setWidthPercentage(80);\n\t\t\t\t Font finalExam = new Font(base, 10, Font.NORMAL);\n\t\t\t\t table3.addCell(getCell(new Paragraph(\"*****\",finalExam), PdfPCell.ALIGN_CENTER));\n\t\t\t\t doc.add(table3);\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t for(int i = 0; i < listExam2.blockRootQuestion.size() ; i++){\n\t\t\t\t\t System.out.println(\"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\");\n\t\t\t\t\t \n\t\t\t\t\t List listBlock = new List(List.UNORDERED);\n\t\t\t\t\t listBlock.setAutoindent(false);\n\t\t\t\t\t // listBlock.setSymbolIndent(20);\t\n\t\t\t\t\t listBlock.add(new ListItem(new Paragraph(listExam2.blockRootQuestion.get(i).rootQuestionBlock.getContent(),fontContent)));\n\t\t\t\t System.out.println(\"########### Block NAME \" +listExam2.blockRootQuestion.get(i).rootQuestionBlock.getContent());\n\t\t\t\t\t \n\t\t\t\t\t doc.add(listBlock);\n\t\t\t\t \n\t\t\t\t \n\t\t\t \tSystem.out.println(\"########### SIZE QUESTION \" +listExam2.blockRootQuestion.get(i).questionList.size());\n\t \n\t\t\t\t for(int j = 0 ; j < listExam2.blockRootQuestion.get(i).questionList.size(); j++){\t\n\t\t\t\t \tSystem.out.println(\"########### QUESTION NAME \" +listExam2.blockRootQuestion.get(i).questionList.get(j).question.getContent());\n\t\t\t\t\t\t\t\n\t\t\t\t \t List listQuestion = new List(List.UNORDERED);\n\t\t\t\t\t\t listQuestion.setListSymbol(\"\");\n\t\t\t\t \t\n\t\t\t\t \t//SingleQuestion questionPDF = null;\n\t\t\t\t \t//questionPDF = listExam.blockRootQuestion.get(i).questionList.get(j);\n\t\t\t\t \tStringBuilder sb = new StringBuilder();\n\t\t\t\t\t\t\tsb.append(\"Câu \");\n\t\t\t\t\t\t\tsb.append(CoutExam);\n\t\t\t\t\t\t\tsb.append(\". \");\n\t\t\t\t\t\t\tString strI = sb.toString();\n\t\t\t\t \t//strI = new Paragraph(strI, fontNumber);\n\t\t\t\t \t//listQuestion.setPostSymbol(strI);\n\t\t\t\t \tSystem.out.println(strI);\n\t\t\t\t listQuestion.add(new ListItem(new Paragraph(strI + listExam2.blockRootQuestion.get(i).questionList.get(j).question.getContent(), fontContent)));\n\t\t\t\t listQuestion.setIndentationLeft(10);\n\t\t\t\t doc.add(listQuestion);\n\t\t\t\t List listAnswerPDF = new List(List.ORDERED, List.ALPHABETICAL);\n\t\t\t\t for(int k = 0; k < listExam2.blockRootQuestion.get(i).questionList.get(j).answerList.size(); k++){\n\t\t\t\t\t\t System.out.println(\"########### Answer NAME \" +listExam2.blockRootQuestion.get(i).questionList.get(j).answerList.get(k).getContent());\n\t\t\t\t\t\t if(listExam2.blockRootQuestion.get(i).questionList.get(j).answerList.get(k).getIssolution())\n\t\t\t\t \t listAnswerPDF.add(new ListItem(new Paragraph(listExam2.blockRootQuestion.get(i).questionList.get(j).answerList.get(k).getContent(), fontAnswent)));\n\t\t\t\t \t else \n\t\t\t\t\t \tlistAnswerPDF.add(new ListItem(new Paragraph(listExam2.blockRootQuestion.get(i).questionList.get(j).answerList.get(k).getContent(), fontContent)));\n\t\t\t\t }\n\t\t\t\t listAnswerPDF.setIndentationLeft(25);\n\t\t\t\t doc.add(listAnswerPDF);\n\t\t\t\t CoutExam++;\n\t\t\t\t }\n\t\t\t\t doc.add( Chunk.NEWLINE );\n\t\t\t\t }\n\t\t\t\t doc.close();\n\t\t\t\t listExam2=null;\n\t\t\t }\n\t\t\t model.clear();\n\t\t\t doc.close();\n\t\t\t exportExam = null;\n\t\t\t// exportExam2 = null;\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"ERROR \"+ e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "@Override\n \t\t\t\tpublic void doHelp() {\n \n \t\t\t\t}", "public static void openFile(Context context, File url) throws IOException {\n\n if ( null == url ) {\n QNotifications.showShortToast(context, \"Cannot read file\");\n return;\n }\n\n // Create URI\n File file = url;\n Uri uri = Uri.fromFile(file);\n\n Intent intent = new Intent(Intent.ACTION_VIEW);\n // Check what kind of file you are trying to open, by comparing the url with extensions.\n // When the if condition is matched, plugin sets the correct intent (mime) type,\n // so Android knew what application to use to open the file\n if ( url.toString().endsWith(\".doc\") || url.toString().contains(\".docx\") ) {\n // Word document\n intent.setDataAndType(uri, \"application/msword\");\n } else if ( url.toString().endsWith(\".pdf\") ) {\n // PDF file\n intent.setDataAndType(uri, \"application/pdf\");\n } else if ( url.toString().endsWith(\".ppt\") || url.toString().contains(\".pptx\") ) {\n // Powerpoint file\n intent.setDataAndType(uri, \"application/vnd.ms-powerpoint\");\n } else if ( url.toString().endsWith(\".xls\") || url.toString().contains(\".xlsx\") ) {\n // Excel file\n intent.setDataAndType(uri, \"application/vnd.ms-excel\");\n } else if ( url.toString().endsWith(\".zip\") || url.toString().contains(\".rar\") ) {\n // ZIP Files\n intent.setDataAndType(uri, \"application/zip\");\n } else if ( url.toString().endsWith(\".rtf\") ) {\n // RTF file\n intent.setDataAndType(uri, \"application/rtf\");\n } else if ( url.toString().endsWith(\".wav\") || url.toString().contains(\".mp3\") ) {\n // WAV audio file\n intent.setDataAndType(uri, \"audio/x-wav\");\n } else if ( url.toString().endsWith(\".gif\") ) {\n // GIF file\n intent.setDataAndType(uri, \"image/gif\");\n } else if ( url.toString().endsWith(\".jpg\") || url.toString().contains(\".jpeg\") || url.toString().contains(\".png\") ) {\n // JPG file\n intent.setDataAndType(uri, \"image/jpeg\");\n } else if ( url.toString().endsWith(\".txt\") ) {\n // Text file\n intent.setDataAndType(uri, \"text/plain\");\n } else if ( url.toString().endsWith(\".3gp\") || url.toString().contains(\".mpg\") || url.toString().contains(\".mpeg\") || url.toString().contains(\".mpe\") || url.toString().contains(\".mp4\") || url.toString().contains(\".avi\") ) {\n // Video files\n intent.setDataAndType(uri, \"video/*\");\n } else {\n // if you want you can also define the intent type for any other file\n\n // additionally use else clause below, to manage other unknown extensions\n // in this case, Android will show all applications installed on the device\n // so you can choose which application to use\n intent.setDataAndType(uri, \"*/*\");\n }\n\n intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(intent);\n }", "public static void main(String[] args) throws IOException {\n\t PDDocument document = new PDDocument();\n\n\t //Creating a blank page\n\t PDPage blankPage = new PDPage();\n\t \n\t //Adding the blank page to the document\n\t document.addPage( blankPage );\n\n\t //Creating the PDDocumentInformation object \n\t PDDocumentInformation pdd = document.getDocumentInformation();\n\n\t //Setting the author of the document\n\t pdd.setAuthor(\"Tutorialspoint\");\n\t \n\t // Setting the title of the document\n\t pdd.setTitle(\"Sample document\"); \n\t \n\t //Setting the creator of the document \n\t pdd.setCreator(\"PDF Examples\"); \n\t \n\t //Setting the subject of the document \n\t pdd.setSubject(\"Example document\"); \n\t \n\t //Setting the created date of the document \n\t Calendar date = new GregorianCalendar();\n\t date.set(2015, 11, 5); \n\t pdd.setCreationDate(date);\n\t //Setting the modified date of the document \n\t date.set(2016, 6, 5); \n\t pdd.setModificationDate(date); \n\t \n\t //Setting keywords for the document \n\t pdd.setKeywords(\"sample, first example, my pdf\"); \n\t \n\t \n\t PDPageContentStream contentStream = new PDPageContentStream(document, blankPage);\n\t \n\t //Begin the Content stream \n\t contentStream.beginText(); \n\t \n\t //Setting the font to the Content stream \n\t contentStream.setFont(PDType1Font.TIMES_ROMAN, 12);\n\n\t //Setting the position for the line \n\t contentStream.newLineAtOffset(25, 500);\n\n\t String text = \"This is the sample document and we are adding content to it.\";\n\n\t //Adding text in the form of string \n\t contentStream.showText(text); \n\n\t //Ending the content stream\n\t contentStream.endText();\n\n\t System.out.println(\"Content added\");\n\n\t //Closing the content stream\n\t contentStream.close();\n\t \n\t //Saving the document \n\t document.save(\"doc_attributes.pdf\");\n\n\t System.out.println(\"Properties added successfully \");\n\t \n\t //Closing the document\n\t document.close();\n\t}", "private static void usage() {\n System.err.println(\"Usage: java org.apache.pdfbox.examples.pdmodel.PrintTextLocations <input-pdf>\");\n }", "private void pickFile() {\n\n String[] mimeTypes = {\"application/pdf\"};\n\n Intent intent = new Intent(Intent.ACTION_GET_CONTENT);\n intent.addCategory(Intent.CATEGORY_OPENABLE);\n intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE,false);\n intent.setType(\"*/*\");\n intent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes);\n startActivityForResult(intent, 2);\n\n\n }", "public void openURLByFile(String url)\n {\n getAppleMenu().activate();\n getAppleMenu().select(Menu.FILE);\n getAppleMenu().open(Menu.OPEN_URL);\n logger.debug(\"Open Office document from URL: \" + url);\n getLdtp().enterString(url);\n getLdtp().generateKeyEvent(\"<enter>\");\n }", "private void getPDF(){\r\n\t\t\r\n\t\tif(request.getParameter(\"exportType\").equals(PDFGenerator.EXPORT_ADMIN)){\r\n\t\t\tgetAdministration(); // pdf uses same data\r\n\t\t} else if(request.getParameter(\"exportType\").equals(PDFGenerator.EXPORT_TEACHER)){\r\n\t\t\tgetEventRegistration(); // pdf uses same data\r\n\t\t}\r\n\t\t\r\n\t\tPDFGenerator pdfGen = new PDFGenerator();\r\n\t\tpdfGen.createDocument(request, response);\r\n\t\t\r\n\t\tString eventTitle = \"all\";\r\n\t\t\r\n\t}", "@Override\r\n public void doHelpAction() {\n BIReportService.getInstance().traceHelpClick(project.getBasePath(), ConversionHelpEnum.PATH_SETTING);\r\n\r\n ApplicationManager.getApplication().invokeLater(() -> {\r\n BrowserUtil.browse(allianceDomain + HmsConvertorBundle.message(\"directory_url\"));\r\n }, ModalityState.any());\r\n }", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Users\\\\sameera\\\\Downloads\\\\chromedriver_win32\\\\chromedriver.exe\");\n\t\tWebDriver driver = new ChromeDriver();\n\t\tdriver.get(\"https://www.smallpdf.com/pdf-to-word\");\n\t\tdriver.manage().window().fullscreen();\n\t\t\n\t\t//WebElement chooseFile = \n\t\t\t\tdriver.findElement(By.xpath(\"//*[@id=\\\"__picker-input\\\"]\")).sendKeys(\"C:\\\\Users\\\\sameera\\\\Downloads\\\\Fido-Jan27_2020.pdf\");\n\t//\tdriver.findElement(By.name(\"Scanned pages will appear as images.\")).click();\n\t\t//driver.findElement(By.id(\"__rk0\")).click();\t\t(//div[@class='__-zhab'])\n\t\t\t\n\t//\t\tWebElement radio = \tdriver.findElement(By.cssSelector(\"#__-zhab\"));\n\t\t\t\t\t\t\n\t\t\tWebElement radio = \tdriver.findElement(By.cssSelector(\"#sc-18us72i-0 cnzToN\"));\t\n\t\t\tradio.click();\n\t}", "private File openFileChooser(String filetype) throws IOException {\n JFileChooser chooser = new JFileChooser(projectController.getProjectInfo().getPdf());\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\n filetype.toUpperCase(), filetype.toLowerCase());\n chooser.setFileFilter(filter);\n int returnVal = chooser.showOpenDialog(null);\n File output = null;\n if (returnVal == JFileChooser.APPROVE_OPTION) {\n output = chooser.getSelectedFile();\n }\n\n if (output == null) {\n throw new IOException(\"user aborted pdf selection process\");\n }\n\n return output;\n }", "public void open()\n {\n }", "public void showHelp();", "@Override\n\tpublic void createPDF(){\n File xsltFile = new File(RESOURCES_DIR + \"/pdfBook.xsl\");\n \n // the XML file which provides the input\n StreamSource xmlSource = new StreamSource(file);\n \n // create an instance of fop factory\n FopFactory fopFactory = FopFactory.newInstance();\n \n // a user agent is needed for transformation\n FOUserAgent foUserAgent = fopFactory.newFOUserAgent();\n \n // Setup output\n OutputStream out = null;\n try {\n\t\t\tout = new java.io.FileOutputStream(OUTPUT_DIR + \"/output.pdf\");\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\n try {\n // Construct fop with desired output format\n Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);\n\n // Setup XSLT\n TransformerFactory factory = TransformerFactory.newInstance();\n Transformer transformer = factory.newTransformer(new StreamSource(xsltFile));\n\n // Resulting SAX events (the generated FO) must be piped through to\n // FOP\n Result res = new SAXResult(fop.getDefaultHandler());\n\n // Start XSLT transformation and FOP processing\n // That's where the XML is first transformed to XSL-FO and then\n // PDF is created\n try {\n\t\t\t\ttransformer.transform(xmlSource, res);\n\t\t\t} catch (TransformerException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n } catch (FOPException | TransformerConfigurationException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t} finally {\n try {\n\t\t\t\tout.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n }\n }", "@RequestMapping(method = RequestMethod.GET, params = { \"pdf\" })\n\tpublic ModelAndView pdfMethod() {\n\t\tList<Book> listBooks = new ArrayList<Book>();\n\t\tlistBooks.add(new Book(\"Spring in Action\", \"Craig Walls\", \"1935182358\", \"June 29th 2011\", 31.98F));\n\t\tlistBooks.add(\n\t\t\t\tnew Book(\"Spring in Practice\", \"Willie Wheeler, Joshua White\", \"1935182056\", \"May 16th 2013\", 31.95F));\n\t\tlistBooks.add(new Book(\"Pro Spring 3\", \"Clarence Ho, Rob Harrop\", \"1430241071\", \"April 18th 2012\", 31.85F));\n\t\tlistBooks.add(\n\t\t\t\tnew Book(\"Spring Integration in Action\", \"Mark Fisher\", \"1935182439\", \"September 26th 2012\", 28.73F));\n\n\t\t// return a view which will be resolved by an excel view resolver\n\t\treturn new ModelAndView(\"pdfView\", \"listBooks\", listBooks);\n\n\t}", "public void displayHelp(int pageNum) {\n\t\tJFrame help = new JFrame();\n\t\thelp.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n\t\thelp.setTitle(\"Help\");\n help.setSize(750,875);\n help.setLocationRelativeTo(null);\t\n help.setVisible(true);\n \n //Set up JPanel to hold Tutor object\n JPanel helpPanel = new JPanel();\n help.add(helpPanel);\n \n //Create tutor object and set to the correct page number\n Tutor helpTut = new Tutor();\n helpPanel.add(helpTut);\n //helpTut.displayPageNum(pageNum);\n \n\t}", "public void doOpen() {\n\n if (!canChangeDocuments()) {\n return;\n }\n\n TextDocument document = fApplication.openDocument(this);\n\n if (document != null) {\n setDocument(document);\n }\n }", "public manageDoc() {\r\r\r\n\r\r\r\n }", "protected void open()\n {\n }", "@RequestMapping(value = \"/getpdfopenpdf\", method = RequestMethod.GET,\n produces = MediaType.APPLICATION_PDF_VALUE)\n public ResponseEntity<InputStreamResource> getOpenPdfReports() {\n\n List<City> cities = CityService.getCities();\n\n ByteArrayInputStream bis = GeneratePdfOpenPdf.getOpenPdfReport();\n\n HttpHeaders headers = new HttpHeaders();\n headers.add(\"Content-Disposition\", \"inline; filename=citiesreport.pdf\");\n\n return ResponseEntity\n .ok()\n .headers(headers)\n .contentType(MediaType.APPLICATION_PDF)\n .body(new InputStreamResource(bis));\n }", "public void open() {\r\n\t}", "public void launchHelp(View view){\n Intent intent = new Intent(this, HelpActivity.class);\n startActivity(intent);\n }", "private void printHelp() {\n TablePrinter helpTableHead = new TablePrinter(\"Command Name : \", \"textconvert\");\n helpTableHead.addRow(\"SYNOPSIS : \", \"textconvert [OPTION]...\");\n helpTableHead.addRow(\"DESCRIPTION : \", \"Convert text/file to Binary, Hexadecimal, Base64.\");\n helpTableHead.print();\n TablePrinter helpTable = new TablePrinter(\"Short Opt\", \"Long Opt\", \"Argument\", \"Desc\", \"Short Option Example\", \"Long Option Example\");\n helpTable.addRow(\"-h\", \"--help\", \"not required\", \"Show this help.\", \"help -h\", \"help --help\");\n helpTable.addRow(\"-f\", \"--file\", \"required\", \"Path to file\", \"textconvert -f /PATH/TO/FILE\", \"textconvert --file /PATH/TO/FILE\");\n helpTable.addRow(\"-ttb\", \"--texttobinary\", \"not required\", \"Convert text to Binary\", \"textconvert -ttb -f /PATH/TO/FILE\", \"textconvert --texttobinary --file /PATH/To/File\");\n helpTable.addRow(\"-btt\", \"--binarytotext\", \"not required\", \"Convert Binary to text\", \"textconvert -btt -f /PATH/To/FileWithBinaryData\", \"textconvert --binarytotext --file /PATH/To/FileWithBinaryData\");\n helpTable.print();\n this.done = true;\n }", "@RequestMapping(\"/pdf\")\r\n\tpublic ModelAndView showPdf(@RequestParam(required=false) Integer id) {\r\n\t\tList<UomType> uoms=null;\r\n\t\tif(id==null)\r\n\t\t\tuoms=service.getAllUomTypes();\r\n\t\telse\r\n\t\t\tuoms=Arrays.asList(service.getOneUomType(id));\r\n\t\t//read data from db\r\n\t\tModelAndView m=new ModelAndView();\r\n\t\tm.setView(new UomTypePdfView());\r\n\t\tm.addObject(\"list\", uoms);\r\n\t\treturn m;\r\n\t\t\r\n\t}", "@Test\r\n\tpublic void testCreatePdf(){\n\t}", "@FXML\n\tpublic void openFile() {\n\t\tFileChooser openFileChooser = new FileChooser();\n\t\topenFileChooser.setInitialDirectory(userWorkspace);\n\t\topenFileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter(\"Text doc(*.txt)\", \"*.txt\"));\n\t\tfile = openFileChooser.showOpenDialog(ap.getScene().getWindow());\n\n\t\tuserText.clear();\n\n\t\tif (file != null) {\n\t\t\tif (file.getName().endsWith(\".txt\")) {\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\twriteToUserText();\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.7735319", "0.75172824", "0.69957644", "0.6876686", "0.64818794", "0.64294505", "0.6385626", "0.6382948", "0.63724065", "0.6153353", "0.6094183", "0.6065573", "0.60525954", "0.601025", "0.5999101", "0.59760547", "0.59611785", "0.5922065", "0.59090084", "0.5880736", "0.5880034", "0.58744526", "0.5843675", "0.5839914", "0.5811666", "0.5805198", "0.5792108", "0.57827145", "0.57683897", "0.57523173", "0.57335114", "0.568376", "0.56254894", "0.56245494", "0.56180334", "0.55840343", "0.55797565", "0.55217063", "0.5519429", "0.55179834", "0.54969", "0.547568", "0.5444768", "0.5439654", "0.54391336", "0.54376704", "0.54143524", "0.54133016", "0.5409554", "0.5406923", "0.53869194", "0.5382973", "0.5379095", "0.5367965", "0.53470147", "0.533452", "0.5334154", "0.5315148", "0.5312952", "0.530633", "0.52905476", "0.5281509", "0.52716726", "0.5270675", "0.5256763", "0.52367514", "0.5230702", "0.5230235", "0.5217393", "0.5215035", "0.5208621", "0.5207442", "0.5196566", "0.5195404", "0.5189837", "0.5177001", "0.5163263", "0.5158147", "0.51561457", "0.51549363", "0.51376104", "0.5136872", "0.5129719", "0.51219136", "0.5118487", "0.5118386", "0.511618", "0.51140034", "0.5098162", "0.5079995", "0.50784963", "0.5077978", "0.5072391", "0.50579906", "0.5055784", "0.50502074", "0.5042208", "0.5040783", "0.50402147", "0.50361305" ]
0.81847245
0
for flag, landing is 0, take off is 1
public Point(int time, int flag) { this.time = time; this.flag = flag; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void switchOffFlag(int flag) {\r\n\t\tsim40.memory[Simulator.STATUS_ADDRESS] = ~(~sim40.memory[Simulator.STATUS_ADDRESS] | (1<<flag));\r\n\t}", "private void switchOnFlag(int flag) {\r\n\t\tsim40.memory[Simulator.STATUS_ADDRESS]|= (1<<flag);\r\n\t}", "public boolean isLegOut()\n{\n if (jumpState == 1)\n return true;\n return false;\n}", "boolean canFall();", "public boolean isWalking(){\n if (jumpState < 2)\n return true;\n else\n return false;\n}", "public void switchAtm(boolean flag);", "public void buyFarm(){\n bought = !bought;\n }", "public void landFromLatch() {\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 }", "void object_calculations_touch_ground(){\n\n if (down_angle < 0 && up_angle > 0)//base case\n {\n double temp = up_angle;\n up_angle = down_angle;\n down_angle = temp;\n base_case();\n } else if ((down_angle > 0 && up_angle > 0) && (down_angle < up_angle))//smaller object\n {\n double temp = up_angle;\n up_angle = down_angle;\n down_angle = temp;\n measure_small_object();\n } else if (up_angle < 0 && down_angle > 0)//base case\n base_case();\n else //smaller object\n measure_small_object();\n }", "private void controlLift()\n {\n if (gamepad1.dpad_up) {\n liftMotor.setPower(-0.5);\n } else if (gamepad1.dpad_down) {\n liftMotor.setPower(0.5);\n } else {++backInc;\n liftMotor.setPower(0);\n }\n }", "boolean outOfSight();", "public boolean isJumping(){\n if (jumpState == 2)\n return true;\n return false;\n\n}", "public boolean checkReached(float xTile, float yTile)\r\n/* 134: */ {\r\n/* 135:149 */ if ((this.mission) && (tileReachObjectives(xTile, yTile)))\r\n/* 136: */ {\r\n/* 137:152 */ this.reach[((int)xTile)][((int)yTile)] = 0;\r\n/* 138:153 */ this.reachablePlaces -= 1;\r\n/* 139:154 */ if (this.reachablePlaces == 0) {\r\n/* 140:156 */ return true;\r\n/* 141: */ }\r\n/* 142: */ }\r\n/* 143:160 */ return false;\r\n/* 144: */ }", "public void startTurn() {\n nMovesBeforeGrabbing = 1;\n nMovesBeforeShooting = 0;\n\n if (damages.size() > 2)\n nMovesBeforeGrabbing = 2;\n\n if (damages.size() > 5)\n nMovesBeforeShooting = 1;\n\n playerStatus.isActive = true;\n }", "public void land() {\n Game currentGame = this.getGame();\n this.setHasBeenVisited(true);\n currentGame.setMode( Game.Mode.GAME_WON);\n\n }", "private void fullRepaired() { //full life\n this.active = true;\n this.damageState = DamageState.FULL;\n }", "boolean land();", "@Override\r\n\tpublic boolean guardMovement() {\r\n\r\n\t\tif(stop == 0) {\r\n\t\t\tstate = 'G';\r\n\t\t\t\r\n\t\t\tRandom rand = new Random();\r\n\t\t\tint tmp = rand.nextInt(10) + 1;\r\n\t\t\t\r\n\t\t\tif(tmp > 8) { \r\n\t\t\t\tstate = 'g';\r\n\t\t\t\tstop = rand.nextInt(3) + 1;\r\n\t\t\t\tdirection = rand.nextBoolean();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\treturn checkAndMove();\r\n\t\t}\r\n\t\telse \r\n\t\t\tstop--;\r\n\r\n\t\treturn false;\r\n\t}", "public void onFlagCheck(IRobot robot){\n TiledMapTileLayer flagLayer = (TiledMapTileLayer) tiledMap.getLayers().get(\"Flag\");\n if(flagLayer.getCell(robot.getXPos(),robot.getYPos()) != null){\n robot.heal();\n robot.setRespawnPoint(robot.getPos());\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 }", "boolean getStraight();", "public static boolean terrain_has_flag(int terr, terrain_flag_id flag){\r\n\t\t\t //\t BV_ISSET(get_tile_type(terr)->flags, flag)\r\n\t\t\t return false;\r\n}", "public void liftArm(){armLifty.set(-drivePad.getThrottle());}", "@Override\n public boolean isFinished() {\n \n boolean thereYet = false;\n\n double time = timer.get();\n\n \n if (Math.abs(targetDistance - distanceTraveled) <= 4){\n\n thereYet = true;\n\n // else if(Math.abs(targetDistance - distanceTraveled) <= 24){\n\n //shifter.shiftDown();\n \n //}\n\n \n\n } else if (stopTime <= time - startTime){\n\n thereYet = true;\n }\n SmartDashboard.putNumber(\"Distance Traveled\", distanceTraveled);\n\n return thereYet;\n\n }", "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 boolean tileFence(float xTile, float yTile)\r\n/* 202: */ {\r\n/* 203:226 */ return (tileInBounds(xTile, yTile)) && (this.door[((int)xTile)][((int)yTile)] != 0);\r\n/* 204: */ }", "@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 void goToAngle(){\n currentAngle = getAverageVoltage2(); \r\n if (Math.abs(elevationTarget - currentAngle) <= .1){//TODO: check angle\r\n off();\r\n // System.out.println(\"off\");\r\n } else if (elevationTarget > currentAngle && elevationTarget < maxLimit){\r\n raise();\r\n //System.out.println(\"raise\");\r\n } else if (elevationTarget < currentAngle && elevationTarget > minLimit){\r\n //System.out.println(\"lower\");\r\n } \r\n \r\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 playerMissedBall(){ active = false;}", "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 flashlightSwitch()\n {\n usingFlashlight = !usingFlashlight;\n }", "private void inAvanti() {\n\t\tif (Game.getInstance().isOnGround) {\n\t\t\tjump=false;\n\t\t\tGame.getInstance().getPersonaggio().setStato(Protagonista.RUN);\n\t\t\tGraficaProtagonista.getInstance().cambiaAnimazioni(Protagonista.RUN);\n\t\t}\n\t}", "public void startAttack() {\n if(toSpot == 0) {\n \tst = new RedAlienState.Attacking(this.x, this.y);\n toSpot++;\n this.column = this.x;\n this.row = this.y;\n isAttacking = true;\n }\n }", "public void pull() {\r\n\t\tif(!SpeedCord.getCurrentSpeed().equals(\"Off\")) {\r\n\t\t/* Update the current speed of fan after pulling cord to fit in range of [Off, speed1, speed2] */\r\n\t\tcurrentDirection = direction.get((((List<String>) direction).indexOf(currentDirection)+1)%2);\r\n\t\tSystem.out.println(\"Direction of fan changed to: \" + currentDirection);\r\n\t\t}\r\n\t\t\r\n\t\t/* Direction of fan cannot be changed if fan is Off*/\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"Fan is Off, so direction can't be changed!\");\r\n\t\t}\r\n\t}", "boolean canSnowFallOn();", "public void planted(){\r\n\t\tenable = false; \r\n\t\tcount = 0; \r\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 boolean poleSwitchEngaged(){\n return true; //poleSwitch.get();\n }", "public void setReached(boolean reached);", "@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}", "public boolean isHitFree()\n {\n // TODO: replace this line with your code\n }", "public boolean isHolding();", "public void sharkAttack() {\n if (fins>0) \n fins--;\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 boolean hitSide()\n {\n if(accel.getAcceleration(ADXL345_I2C.Axes.kX)>0)\n return true;\n else\n return false;\n }", "public void deadcheck()\n\t{\n\t\tif (this.shield <= 0)\n\t\t{\n\t\t\tthis.drawMissile = false;\n\t\t}\n\t\telse \n\t\t\tthis.drawMissile = true;\n\t}", "protected void toggleLaser() {\n laserOn = !laserOn;\n }", "private void breakSpecialState() {\n this.inSpecialState = false;\n this.resetXMovement();\n }", "public void setIntakeLights(){\n \tintakeLights.set(true);\n }", "public boolean isSwitchAhead() {\r\n\t\treturn robotStartPos == Position.Middle || robotStartPos == switchPos;\r\n\t}", "public void checkState() {\r\n\t\tout.println(state);\r\n\t\tif(getEnergy() < 80 && getOthers() > 5) {\r\n\t\t\tstate = 1;\r\n\t\t\tturnLeft(getHeading() % 90);\r\n\t\t\tahead(moveAmount);\r\n\t\t}\r\n\t\telse if(getEnergy() < 80 && getOthers() < 5) {\r\n\t\t\tstate = 0;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tstate = 0;\r\n\t\t}\r\n\t\t\r\n\t}", "public void switchLight(){\r\n _switchedOn = !_switchedOn;\r\n }", "boolean wasHit();", "private void thinkAboutNext(ArrayList<Point> pos, boolean hit, boolean destroyedIt) {\n if (!searching && hit) {\n betweenTwo = false;\n System.out.println(\"WAS A NEW TARGET\");\n if(!destroyedIt) {\n int[] d = Direction.DOWN.getDirectionVector();\n Point n = new Point(justBefore.x + d[0], justBefore.y + d[1]);\n if (inBounds(n) && pos.contains(n))\n directionsToGo.add(Direction.DOWN);\n\n d = Direction.UP.getDirectionVector();\n n = new Point(justBefore.x + d[0], justBefore.y + d[1]);\n if (inBounds(n) && pos.contains(n))\n directionsToGo.add(Direction.UP);\n\n d = Direction.LEFT.getDirectionVector();\n n = new Point(justBefore.x + d[0], justBefore.y + d[1]);\n if (inBounds(n) && pos.contains(n))\n directionsToGo.add(Direction.LEFT);\n\n d = Direction.RIGHT.getDirectionVector();\n n = new Point(justBefore.x + d[0], justBefore.y + d[1]);\n if (inBounds(n) && pos.contains(n))\n directionsToGo.add(Direction.RIGHT);\n\n directionLooking = directionsToGo.get(directionsToGo.size() - 1);\n }\n }\n else if (searching) {\n //FILTER OUT ALREADY ATTACKED\n\n System.out.println(\"WAS AN OLD TARGET\");\n\n //FAILED\n if(!hit) {\n justBefore = firstHit;\n int size = directionsToGo.size();\n\n for(int i = size - 1; i >= 0; i--){\n Point n = new Point(justBefore.x + directionsToGo.get(i).getDirectionVector()[0],\n justBefore.y + directionsToGo.get(i).getDirectionVector()[1]);\n if(!pos.contains(n))\n directionsToGo.remove(i);\n }\n directionLooking = directionsToGo.get(0);\n }\n else\n if(!pos.contains(pWD(justBefore, directionLooking))) {\n justBefore = firstHit;\n directionLooking = directionLooking.getOpposite();\n }\n\n }\n if(hit) {\n searching = !destroyedIt;\n }\n }", "void base_case() {\n down_angle=Math.abs(down_angle);\n up_angle=Math.abs(up_angle);\n distance_from_object = human_length / Math.tan(Math.toRadians(down_angle));\n length_of_object = human_length + Math.tan(Math.toRadians(up_angle)) * distance_from_object;\n if(length_of_object/100>0) {\n ORI.setText(\"length_of_object :\\n\" + String.valueOf(String.format(\"%.2f\", (length_of_object / 100)) + \" M\" +\n \"\\n\" + \"distance_from_object :\\n\" + String.valueOf(String.format(\"%.2f\", (distance_from_object / 100))) + \" M\"));\n ORI.setVisibility(View.VISIBLE);\n }\n else {\n Toast.makeText(Online.this, \"Move Forward\", Toast.LENGTH_LONG).show();\n down_angle = 0;\n up_angle = 0;\n touch_ground_switch.setVisibility(View.VISIBLE);\n }\n\n\n }", "public boolean isReached();", "public void lift(){\n\t\twhile(Math.abs(robot.lift1.getCurrentPosition()-robot.startingHeight)<3900&&opModeIsActive()){\n\t\t\trobot.lift1.setPower(1);\n\t\t\trobot.lift2.setPower(1);\n\t\t}\n\t\tlift(\"stop\");\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}", "private static void incrementFlightTakeOffCounter()\r\n\t{\r\n\t\tflightTakeOffCounter++;\r\n\t}", "@Override\n public void run() {\n ElapsedTime time = new ElapsedTime();\n time.reset();\n sleep(3000);\n sh.hitRing();\n sleep(600);\n sh.hitRing();\n sleep(600);\n sh.hitRing();\n sleep(600);\n //sh.pivotStop.setPosition(.55);\n sh.hitRing();\n sleep(500);\n //sh.pivotDown();\n sh.hitRing();\n sleep(500);\n sh.withdraw();\n sh.lift.setPower(0);\n sh.lift.setPower(0);\n wobble.wobbleUp();\n sh.pivotStop.setPosition(1);\n loop.end();\n\n\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 }", "void object_calculations_doesnt_touch_ground(){\n if(angle_with_ground>0&&down_angle>0&&up_angle<0)\n object_on_eyes_level_calc();\n else if(angle_with_ground>0&&down_angle<0&&up_angle<0)\n object_upper_eyes_level_calc();\n else if(angle_with_ground>0&&down_angle>0&&up_angle>0)\n object_below_eyes_level_calc();\n }", "private void stateReturnToHomeBase() {\n\t\tif (isCloserToBall()) {\n\t\t\tstate = State.ATTACKING;\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isCloseTo(playerDeafaultPosition)) {\n\t\t\tif (isAlignedTo(playerDeafaultPosition)) {\n\t\t\t\tcommander.doDashBlocking(50.0d);\n\t\t\t} else {\n\t\t\t\tturnTo(playerDeafaultPosition);\n\t\t\t}\n\t\t}\n\t}", "void toggleInAir() {\n inAir = !inAir;\n }", "public void setCargoIntakeState() {\n blueLED.set(false);\n greenLED.set(false);\n if (!redLED.get() && timer.get() >= pulseTime) {\n redLED.startPulse();\n timer.stop();\n timer.reset();\n }\n else if (redLED.get() && timer.get() > pulseTime) {\n redLED.set(false);\n }\n else {\n timer.start();\n }\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}", "@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 boolean takeControl() {\n\t\treturn (Math.abs(Motor.A.getTachoCount() - Settings.motorAAngle) > 5 || (Motor.A.getTachoCount() == 0 && Settings.motorAAngle == -90));\n\t}", "static void stop(){\n stop=true;\n firstPass=true;\n }", "public boolean isOnFight();", "public void checkIfShowerOn(){\n double currentSMA = mySMA.currentAverage();\n Log.d(LOGTAG,\"currentSMA: \"+currentSMA);\n Log.d(LOGTAG,\"isShowerOn: \"+ isShowerOn);\n if (currentSMA>SMA_THRESHOLD && !isShowerOn){\n //Initialize stuff to do once shower is on\n isShowerOn=true;\n startShower();\n } else if (currentSMA<SMA_THRESHOLD && isShowerOn){\n //Shutdown\n isShowerOn=false;\n endShower();\n }\n }", "boolean complete() {\n return start2D != null && stop2D != null;// && start3D!=null && stop3D!=null;\n }", "private void setDirection() {\r\n\t\tif (destinationFloor > initialFloor){\r\n\t\t\tdirection = 1;\r\n\t\t} else {\r\n\t\t\tdirection = -1;\r\n\t\t}\r\n\t}", "protected void finishFlags() {\r\n\r\n \tif (!doAutoComplete) {\r\n \t\treturn;\r\n \t}\r\n \t\r\n for (int i=0; i < width; i++) {\r\n for (int j=0; j < height; j++) {\r\n Location l = new Location(i,j);\r\n if (query(l) == GameStateModel.HIDDEN) {\r\n \tplaceFlag(l);\r\n }\r\n }\r\n } \r\n \r\n }", "boolean isStraight();", "@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}", "void driveTracker()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tlong time = System.currentTimeMillis();\r\n\t\t\tint last_direction = 0;\r\n\t\t\twhile(System.currentTimeMillis()-time < 20000 && status.equals(\"wait\"))\r\n\t\t\t{\r\n\t\t\t\tint direction = -1;\r\n\t\t\t\tint flow_min = Main.MAX_INT;\r\n\t\t\t\tif((loc.i-1)>=0 && BFS.adj_const[(loc.i-1)*80+loc.j][loc.i*80+loc.j]==1 && Flow.flows[loc.i-1][loc.j][1] < flow_min)\r\n\t\t\t\t{\r\n\t\t\t\t\tdirection = 0;//up\r\n\t\t\t\t\tflow_min = Flow.flows[loc.i-1][loc.j][1];\r\n\t\t\t\t}\r\n\t\t\t\tif((loc.i+1)<80 && BFS.adj_const[(loc.i+1)*80+loc.j][loc.i*80+loc.j]==1 && Flow.flows[loc.i][loc.j][1] < flow_min)\r\n\t\t\t\t{\t\r\n\t\t\t\t\tdirection = 1;//down\r\n\t\t\t\t\tflow_min = Flow.flows[loc.i][loc.j][1];\r\n\t\t\t\t}\r\n\t\t\t\tif((loc.j-1)>=0 && BFS.adj_const[loc.i*80+loc.j][loc.i*80+loc.j-1]==1 && Flow.flows[loc.i][loc.j-1][0] < flow_min)\r\n\t\t\t\t{\t\r\n\t\t\t\t\tdirection = 2;//left\r\n\t\t\t\t\tflow_min = Flow.flows[loc.i][loc.j-1][0];\r\n\t\t\t\t}\r\n\t\t\t\tif((loc.j+1)<80 && BFS.adj_const[loc.i*80+loc.j][loc.i*80+loc.j+1]==1 && Flow.flows[loc.i][loc.j][0] < flow_min)\r\n\t\t\t\t{\r\n\t\t\t\t\tdirection = 3;//right\r\n\t\t\t\t\tflow_min = Flow.flows[loc.i][loc.j][0];\r\n\t\t\t\t}\r\n\t\t\t\tLight light = Traffic.findLight(loc.i,loc.j);\r\n\t\t\t\tif(light!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\twhile(!leaveLight(light,last_direction,direction))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmeet_light = true;\r\n\t\t\t\t\t\tThread.sleep(100);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmeet_light = false;\r\n\t\t\t\t}\r\n\t\t\t\tswitch(direction)\r\n\t\t\t\t{\r\n\t\t\t\tcase 0 ://up\r\n\t\t\t\t\tif(BFS.adj_matrix[(loc.i-1)*80+loc.j][loc.i*80+loc.j] == 1)//open_road\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tFlow.flows[loc.i-1][loc.j][1]++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tloc.i -= 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 1 ://down\r\n\t\t\t\t\tif(BFS.adj_matrix[(loc.i+1)*80+loc.j][loc.i*80+loc.j] == 1)//open_road\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tFlow.flows[loc.i][loc.j][1]++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tloc.i += 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2 ://left\r\n\t\t\t\t\tif(BFS.adj_matrix[loc.i*80+loc.j][loc.i*80+loc.j-1] == 1)//open_road\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tFlow.flows[loc.i][loc.j-1][0]++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tloc.j -= 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3 ://right\r\n\t\t\t\t\tif(BFS.adj_matrix[loc.i*80+loc.j][loc.i*80+loc.j+1] == 1)//open_road\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tFlow.flows[loc.i][loc.j][0]++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tloc.j += 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tThread.sleep(100);\r\n\t\t\t\tlast_direction = direction;\r\n\t\t\t}\r\n\t\t\tif(status.equals(\"wait\"))\r\n\t\t\t{\r\n\t\t\t\tstatus = \"stop\";\r\n\t\t\t\tThread.sleep(1000);//stop\r\n\t\t\t\tstatus = \"wait\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttransStatus();\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Sorry to catch Exception!\");\r\n\t\t}\r\n\t}", "public void switchSampling(boolean start_or_dont) {\r\n //save a boolean for the loop's state before changes\r\n boolean weShouldReadold = this.weShouldRead;\r\n this.weShouldRead = start_or_dont;\r\n //if it's switching on from being previously off, start the loop again\r\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}", "public void onSingleTapUp(android.view.View r5, int r6, int r7) {\n /*\n r4 = this;\n r0 = r4.mPaused;\n if (r0 != 0) goto L_0x0096;\n L_0x0004:\n r0 = r4.mCameraDevice;\n if (r0 == 0) goto L_0x0096;\n L_0x0008:\n r0 = r4.mFirstTimeInitialized;\n if (r0 == 0) goto L_0x0096;\n L_0x000c:\n r0 = r4.mCameraState;\n r1 = 3;\n if (r0 == r1) goto L_0x0096;\n L_0x0011:\n r0 = r4.mCameraState;\n r1 = 7;\n if (r0 == r1) goto L_0x0096;\n L_0x0016:\n r0 = r4.mCameraState;\n r1 = 8;\n if (r0 == r1) goto L_0x0096;\n L_0x001c:\n r0 = r4.mCameraState;\n r1 = 9;\n if (r0 == r1) goto L_0x0096;\n L_0x0022:\n r0 = r4.mCameraState;\n r1 = 10;\n if (r0 == r1) goto L_0x0096;\n L_0x0028:\n r0 = r4.mCameraState;\n r1 = 4;\n if (r0 == r1) goto L_0x0096;\n L_0x002d:\n r0 = r4.mCameraState;\n if (r0 != 0) goto L_0x0032;\n L_0x0031:\n goto L_0x0096;\n L_0x0032:\n r0 = r4.mIsInIntentReviewUI;\n if (r0 == 0) goto L_0x0037;\n L_0x0036:\n return;\n L_0x0037:\n r0 = r4.isCameraFrontFacing();\n if (r0 == 0) goto L_0x0053;\n L_0x003d:\n r0 = r4.mAppController;\n r0 = r0.getHelpTipsManager();\n if (r0 == 0) goto L_0x0053;\n L_0x0045:\n r1 = r0.isHelpTipShowExist();\n if (r1 == 0) goto L_0x0053;\n L_0x004b:\n r1 = TAG;\n r2 = \"helptip exists and cancels shutterbutton click\";\n com.hmdglobal.app.camera.debug.Log.e(r1, r2);\n return;\n L_0x0053:\n r0 = r4.mUI;\n r0.clearEvoPendingUI();\n r0 = r4.mEvoFlashLock;\n r1 = 0;\n if (r0 == 0) goto L_0x007b;\n L_0x005d:\n r0 = r4.mAppController;\n r0 = r0.getButtonManager();\n r0 = r0.isFlashButtonHidden();\n if (r0 != 0) goto L_0x007b;\n L_0x0069:\n r0 = r4.mAppController;\n r0 = r0.getButtonManager();\n r2 = r4.mEvoFlashLock;\n r2 = r2.intValue();\n r0.enableButtonWithToken(r1, r2);\n r0 = 0;\n r4.mEvoFlashLock = r0;\n L_0x007b:\n r0 = r4.mUI;\n r2 = (float) r6;\n r3 = (float) r7;\n r0.initEvoSlider(r2, r3);\n r0 = r4.mFocusAreaSupported;\n if (r0 != 0) goto L_0x008b;\n L_0x0086:\n r0 = r4.mMeteringAreaSupported;\n if (r0 != 0) goto L_0x008b;\n L_0x008a:\n return;\n L_0x008b:\n r0 = r4.mFocusManager;\n r0.setAeAwbLock(r1);\n r0 = r4.mFocusManager;\n r0.onSingleTapUp(r6, r7);\n return;\n L_0x0096:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.hmdglobal.app.camera.PhotoModule.onSingleTapUp(android.view.View, int, int):void\");\n }", "protected Vec3 maybeBackOffFromEdge(Vec3 debug1, MoverType debug2) {\n/* 1102 */ if (!this.abilities.flying && (debug2 == MoverType.SELF || debug2 == MoverType.PLAYER) && isStayingOnGroundSurface() && isAboveGround()) {\n/* 1103 */ double debug3 = debug1.x;\n/* 1104 */ double debug5 = debug1.z;\n/* 1105 */ double debug7 = 0.05D;\n/* */ \n/* */ \n/* */ \n/* */ \n/* 1110 */ while (debug3 != 0.0D && this.level.noCollision((Entity)this, getBoundingBox().move(debug3, -this.maxUpStep, 0.0D))) {\n/* 1111 */ if (debug3 < 0.05D && debug3 >= -0.05D) {\n/* 1112 */ debug3 = 0.0D; continue;\n/* 1113 */ } if (debug3 > 0.0D) {\n/* 1114 */ debug3 -= 0.05D; continue;\n/* */ } \n/* 1116 */ debug3 += 0.05D;\n/* */ } \n/* */ \n/* */ \n/* */ \n/* 1121 */ while (debug5 != 0.0D && this.level.noCollision((Entity)this, getBoundingBox().move(0.0D, -this.maxUpStep, debug5))) {\n/* 1122 */ if (debug5 < 0.05D && debug5 >= -0.05D) {\n/* 1123 */ debug5 = 0.0D; continue;\n/* 1124 */ } if (debug5 > 0.0D) {\n/* 1125 */ debug5 -= 0.05D; continue;\n/* */ } \n/* 1127 */ debug5 += 0.05D;\n/* */ } \n/* */ \n/* */ \n/* */ \n/* 1132 */ while (debug3 != 0.0D && debug5 != 0.0D && this.level.noCollision((Entity)this, getBoundingBox().move(debug3, -this.maxUpStep, debug5))) {\n/* 1133 */ if (debug3 < 0.05D && debug3 >= -0.05D) {\n/* 1134 */ debug3 = 0.0D;\n/* 1135 */ } else if (debug3 > 0.0D) {\n/* 1136 */ debug3 -= 0.05D;\n/* */ } else {\n/* 1138 */ debug3 += 0.05D;\n/* */ } \n/* */ \n/* 1141 */ if (debug5 < 0.05D && debug5 >= -0.05D) {\n/* 1142 */ debug5 = 0.0D; continue;\n/* 1143 */ } if (debug5 > 0.0D) {\n/* 1144 */ debug5 -= 0.05D; continue;\n/* */ } \n/* 1146 */ debug5 += 0.05D;\n/* */ } \n/* */ \n/* 1149 */ debug1 = new Vec3(debug3, debug1.y, debug5);\n/* */ } \n/* 1151 */ return debug1;\n/* */ }", "public void setCanStop() {\n \tleftCanMotor.set(0.0);\n \trightCanMotor.set(0.0); \n\t}", "private void checkMovement()\n {\n if (frames % 600 == 0)\n {\n \n ifAllowedToMove = true;\n \n \n }\n \n }", "public void breakWall() {\r\n\tbustedWall = true;\r\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 isShivering();", "public void checkForBounce()\n {\n if (isTouching(mid.class)){\n \n bounce = 1;\n \n \n }\n \n \n \n \n if (getY() <= 0 || getY() >= getWorld().getHeight() -1 )\n {\n \n dY = -dY;\n \n }\n \n \n if(isTouching(Pad1.class )){\n \n if (bounce == 1){\n \n \n Greenfoot.playSound(\"paddleHit.wav\"); \n dX = -dX;\n bounce = 0;\n change(); \n }\n \n \n }\n \n \n \n }", "public HitWall() {\n\t\ttouch_r = Settings.TOUCH_R;\n\t\ttouch_l = Settings.TOUCH_L;\n\t\tpilot = Settings.PILOT;\n\t}", "public void turnStrobeOn(){\n if (!WatchFlags.gestureSensingOn){\n Log.d(TAG, \"Gesture sensing mode is off, aborting start strobe command\");\n return;\n }\n if (WatchFlags.strobeIsOn == false) {\n startActivity(new Intent(this, wSignalingActivity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));\n }\n }", "@Override\n\tpublic void drive() {\n\t\tif (gasoline > 0) {\n\t\t\tsetAccelerate(true);\n\t\t}\n\t}", "void check(){\n if(!data.up.isEmpty()){\r\n if(data.floor == data.up.get(0)){\r\n data.up.remove(0);\r\n data.state = 0;\r\n data.statePrv = 1;\r\n data.isMoving = false;\r\n }\r\n }\r\n if(!data.down.isEmpty()){\r\n if(data.floor == data.down.get(0)){\r\n data.down.remove(0);\r\n data.state = 0;\r\n data.statePrv = -1;\r\n data.isMoving = false;\r\n }\r\n }\r\n }", "public void setDirection(){\n\n if (gameStatus != demoPlay)\n client_sb.i_Button = direct;\n\n TankMoveDelay++;\n StarGun_GSR loc=(StarGun_GSR)client_sb.getGameStateRecord();\n\n if (TankMoveDelay >= 1 &&\n loc.getPlayerX() < StarGun_SB.PLAYER_RIGHT_BORDER &&\n\t loc.getPlayerX() > 0) {\n TankMoveDelay = 0;\n switch (direct) {\n\tcase StarGun_SB.DIRECT_LEFT:\n\t if (TankPos==0)TankPos=iTankAmount-1;\n\t else TankPos--;\n\t\t\t\t break;\n case StarGun_SB.DIRECT_RIGHT:\n\t if (TankPos==iTankAmount-1)TankPos=0;\n\t else TankPos++;\n\t\t\t\t break;\n }\n }\n }", "public boolean land() {\n\t\treturn ( Math.random() > this.crashProb);\r\n\t}", "public void toggleGrab(){\n \tif (isClosed == true){\n \t\ttriggerTimer.reset();\n \t\tisClosed = false;\n \t\tClawAct.set(false);\n \t\tRobot.oi.armRumble(RUMBLE_DURATION);\n\n \t} else {\n \t\tisClosed = true;\n \t\tClawAct.set(true);\n \t\tRobot.oi.armRumble(RUMBLE_DURATION);\n\n \t}\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}", "private void testGrab()\n {\n if(gamepad1.y) {\n //move to position where it touches block ----might have to change angle based on trial----\n //Drastic angles at the moment for testing\n servoLeft.setPosition(0.5);\n //servoRight.setPosition(0.5);\n }\n }", "private void combinedEdgeDetection() {\n if(isDetectingEdge())\n {\n if(currentCount == 0)\n {\n debugTimer.start();\n }\n currentCount++;\n// SmartDashboard.putInt(\"current count: \", currentCount);\n }\n else{//otherwise, leave the count at 0\n currentCount = 0;\n }\n //once the count reaches the minimum required for detection\n if(currentCount >= minDetectionCount)\n {\n //invert the current state of detection\n currentlyDetecting = !currentlyDetecting;\n// SmartDashboard.putDouble(\"timer count: \", debugTimer.get());\n debugTimer.stop();\n debugTimer.reset();\n }\n\t}", "@Override\n protected boolean isFinished() {\n if(direction){\n if(leftTarget <= Robot.driveTrain.getLeftEncoderDistanceInches() || rightTarget <= Robot.driveTrain.getRightEncoderDistanceInches()){\n turnPID.resetPID();\n return true;\n } else{\n return false;\n }\n \n } else{\n if(leftTarget >= Robot.driveTrain.getLeftEncoderDistanceInches() || rightTarget >= Robot.driveTrain.getRightEncoderDistanceInches()){\n turnPID.resetPID();\n return true;\n } else{\n return false;\n }\n }\n \n \n }", "boolean motorsAreBusy();" ]
[ "0.6176251", "0.6116983", "0.6065997", "0.57808733", "0.5770442", "0.57644755", "0.5752118", "0.57457423", "0.570759", "0.57044506", "0.5667836", "0.56666553", "0.565929", "0.5659123", "0.5636012", "0.5621863", "0.5559673", "0.55135435", "0.5512996", "0.5508715", "0.5497586", "0.5475996", "0.5468851", "0.5454176", "0.54530776", "0.54500043", "0.5447316", "0.5443476", "0.54427606", "0.54325837", "0.54062283", "0.5395903", "0.53941447", "0.5387702", "0.538617", "0.5384903", "0.5368169", "0.536357", "0.53633547", "0.5353789", "0.53491986", "0.53269696", "0.53240615", "0.5322284", "0.5320308", "0.5319774", "0.5316548", "0.53141284", "0.5300091", "0.529675", "0.52917457", "0.52900445", "0.52891624", "0.52855", "0.52846956", "0.5280573", "0.52776134", "0.52661026", "0.5259736", "0.5254641", "0.5253824", "0.5245262", "0.52391243", "0.52358353", "0.5218666", "0.5218236", "0.5214157", "0.52118456", "0.5209284", "0.5209097", "0.5203651", "0.51975965", "0.519683", "0.5196148", "0.5194232", "0.51929015", "0.51842237", "0.5183072", "0.5174531", "0.5172995", "0.51729894", "0.5167817", "0.5163926", "0.51576173", "0.5157605", "0.5151906", "0.51517427", "0.5149863", "0.514749", "0.5145292", "0.51445967", "0.51417273", "0.51374143", "0.5135346", "0.5131653", "0.51240325", "0.51212156", "0.5115437", "0.51131314", "0.51105", "0.51096314" ]
0.0
-1
Action Listener for button
@Override public void actionPerformed(ActionEvent e) { if (e.getSource() == submit) { int score = answerCheck(); try { Submit submitButton = new Submit(userid, user.getText(), totalScore.getText(), score); setVisible(false); } catch (SQLException ex) { Logger.getLogger(Play.class.getName()).log(Level.SEVERE, null, ex); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void enablButtonListener();", "public void buttonClicked();", "@Override\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tJButton btn = (JButton) e.getSource();\n\t lev_no = (int) btn.getClientProperty(\"column\") + 3 * ((int) btn.getClientProperty(\"row\"));\n\t\t\tselect.setVisible(false);\n\t\t\ttitle.setVisible(true);\n\t\t\tstart.setVisible(true);\n\t\t\texit.setVisible(true);\n\t\t\tlev_button.setVisible(true);\n\t \n\t\t}", "void configureButtonListener();", "private void devBtnActionPerformed(ActionEvent evt) {\n }", "public void buttonClicked() {\n mSanitizorGame.buttonClicked();\n }", "public void buttonChangeStatus(ActionEvent actionEvent) {\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override\npublic void actionPerformed(ActionEvent e) {\n\nJButton b1 = (JButton)(e.getSource());\n\tString text = b1.getText();\n\tSystem.out.println(\"buttn pressed \"+ text);\n\tcm.addADigit(text);\n\n\tcv.update();\n\n}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[0])){\n\t\t\tperformButton(0);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[1])){\n\t\t\tperformButton(1);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[2])){\n\t\t\tperformButton(2);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[3])){\n\t\t\tperformButton(3);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[4])){\n\t\t\tperformButton(4);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[5])){\n\t\t\tperformButton(5);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[6])){\n\t\t\tperformButton(6);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[7])){\n\t\t\tperformButton(7);\n\t\t}\n\t\tif(e.getSource().equals(ClientWindow.retButtons()[8])){\n\t\t\tperformButton(8);\n\t\t}\n\t}", "public static void scheduleButtonListener(ActionEvent evt){\r\n MyButton button = (MyButton) evt.getSource();\r\n button.switchChosen();\r\n if(button.isChosen()){\r\n checkCollisions(button);\r\n }\r\n setButtonsColor();\r\n }", "public void actionPerformed(ActionEvent e) {\n \n // YOUR CODE HERE\n\n }", "@Override\n\tprotected void on_button_pressed(String button_name) {\n\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n if(e.getSource().equals(btnQuayLai)){\n btnquaylaiclick();}\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) { // ueberprueft das Event fuer den Button\r\n\t\t\t\tif (e.getSource() == alarm \r\n\t\t\t\t\t\t&& alarm.getText().equals(\"Alarm setzen\")) { // schaut ob der geklickte Button den gleichen Text hat wieder der Alarmbutton\r\n\t\t\t\t\tabfrageFenster(); // bei Uebereinstimmung wird Abfragefenster aufgerufen\r\n\t\t\t\t}\r\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t\t\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tJButton btn = (JButton)e.getSource();\r\n\t\tif(btn==btnVclListen)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"ExerciseVocabulary_listen --> btnlisten_Click\");\r\n\t\t}\r\n\t\telse if(btn == btnFinal){\r\n\t\t\tSystem.out.println(\"ExerciseVocabulary_listen --> btnfinal_Click\");\r\n\t\t\t//Vocabulary vocabulary = new Vocabulary();\r\n\t\t}\r\n\t\telse if(btn == btnOpenfile){\r\n\t\t\tSystem.out.println(\"ExerciseVocabulary_listen --> btnOpen_Click\");\r\n\t\t\t//Vocabulary vocabulary = new Vocabulary();\r\n\t\t}\r\n\t\telse if(btn == btnHome){\r\n\t\t\tSystem.out.println(\"ExerciseVocabulary_listen --> btnHome_Click\");\r\n\t\t\tExVclListen.frame.setVisible(false);\r\n\t\t\tmenuVocabulary vcl = new menuVocabulary();\r\n\t\t\t\r\n\t\t\t//Vocabulary vocabulary = new Vocabulary();\r\n\t\t}\r\n\t}", "void buttonGo_actionPerformed(ActionEvent e) {\n\n\n }", "@Override\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n String comando = e.getActionCommand();\n\n if (comando == \"Novo labirinto\")\n this.btnNovoLabirinto();\n else if (comando == \"Abrir labirinto\")\n this.btnAbrirLabirinto();\n else if (comando == \"Salvar labirinto\")\n this.btnSalvarLabirinto();\n else // comando==\"Executar labirinto\"\n this.btnExecutarLabirinto();\n }", "abstract void botonAyuda_actionPerformed(ActionEvent e);", "@Override\r\n\tpublic void actionPerformed(GuiButton button) {\r\n switch (button.id) {\r\n case 0:\r\n GuiYesNo confirmGui = new GuiYesNo(this, \"Delete Waypoints\", \"Are you sure you want to delete the selected waypoints?\", \"Yes\", \"No\", 0);\r\n confirmGui.setButtonDelay(5);\r\n this.mc.displayGuiScreen(confirmGui);\r\n break;\r\n }\r\n\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tButton button = (Button)e.getSource();\n\t\t\n\t\t/* Filter / Periksa komponen sesuai button event-nya masing2 */\n\t\tif(b == button)\n\t\t\tSystem.out.println(\"Button b\");\n\t\t\n\t\tif(c == button)\n\t\t\tSystem.out.println(\"Button c\");\n\n\t}", "private void button1ActionPerformed(ActionEvent e) {\n }", "private void button1MouseClicked(MouseEvent e) {\n\t}", "@Override\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tSystem.out.println(e.getSource());\n\t\t\tif(e.getSource() == Jbutton1) {\n\t\t\t\tCuteness.showDucks();\n\t\t\t\tSystem.out.println(\"Hi\");\n\t\t\t}\n\t\t\telse if(e.getSource() == Jbutton2) {\n\t\t\t\tCuteness.showFrog();\n\t\t\t\tSystem.out.println(\"Hi\");\n\t\t\t}\n\t\t\telse if(e.getSource() == Jbutton3) {\n\t\t\t\tCuteness.showFluffyUnicorns();\n\t\t\t}\n\t\t\t\n\t\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n JButton button = (JButton) e.getSource();\n System.out.println(button.getText());\n frame.getjLabelTop().setText( button.getText() + \" Was Clicked\");\n frame.getjLabelBottom().setText(e.paramString());\n }", "public void buttonClickHandler (ActionEvent evt) {\n\t\tButton clickedButton = (Button) evt.getTarget();\n\t\tString buttonLabel = clickedButton.getText();\n\t\t\n\t\tswitch(buttonLabel) {\n\t\t\tcase(\"Instructions\"): openInstructionsWindow(); break;\n\t\t\tcase(\"About\"): openAboutWindow(); break;\n\t\t\tcase(\"Quit\"): GameScreenController.quitWindow(); break;\n\t\t}\t\n\t}", "public void actionPerformed(ActionEvent e) {\n // Ask the event which button was the source that generated it\n if (e.getActionCommand().equals(\"Press Me\"))\n System.out.println(\"That felt good!\");\n else\n System.out.println(\"Ouch! Stop that!\");\n }", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif (e.getSource() == button1) {\n\t\t prefDisplay();\n\t\t }\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent event) {\n\t\t\t\tgetControleur(). saisirOuvrage() ;}", "@Override\r\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\r\n\t\t}", "@Override\n protected void actionPerformed(GuiButton button)\n {\n super.actionPerformed(button);\n }", "void buttonPressed(ButtonType type);", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "private void btnInventarioActionPerformed(java.awt.event.ActionEvent evt) {\n }", "public void actionPerformed(ActionEvent e)\n\t\t {\n\t\t System.out.println(\"Presionaste un botton\");\n\t\t }", "public void buttonShowComplete(ActionEvent actionEvent) {\n }", "@Override\n\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void actionPerformed(ActionEvent e) \n\t\t{\n\t\t\t\n\t\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t\ttextField.setText(((JButton) e.getSource()).getText() + \" button was clicked.\");\r\n\t\t\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t\ttextField.setText(((JButton) e.getSource()).getText() + \" button was clicked.\");\r\n\t\t\t}", "public void actionPerformed(ActionEvent e) {\r\n\t\t\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n \n }", "@Override\n public void actionPerformed(ActionEvent e) {\n \n }", "@Override\n public void actionPerformed(ActionEvent e) {\n \n }", "public void actionPerformed(ActionEvent e) {\n }", "@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\tButtonPress();\n\t}", "abstract void boton1Jugador_actionPerformed(ActionEvent e);", "@Override\n public void actionPerformed(ActionEvent e) {\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n }", "@Override\n public void actionPerformed(ActionEvent ev) {\n }", "@Override\r\n public void actionPerformed(ActionEvent e) {\r\n\r\n if (e.getActionCommand() == \"button1\"){\r\n JOptionPane.showMessageDialog(null,\"Button1 hit\");\r\n }else {\r\n JOptionPane.showMessageDialog(null,\"Button2 hit\");\r\n }\r\n\r\n }", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif(e.getSource()==btn_pause) {\n\t\t\n\t\t\tgamePause();\n\t\t}\n\t\tif(e.getSource()==btn_continue) {\n\t\t\tgameContinue();\n\t\t}\n\t\tif(e.getSource()==btn_restart) {\n\t\t\tgameResTart();\n\t\t}\n\t\tif(e.getSource()==btn_rank) {\n\t\t\tgameRank();\n\t\t}\n\t\tif(e.getSource()==btn_admin) {\n\t\t\tgameAdmin();\n\t\t}\n\t\t\n\t}", "private void button1MouseClicked(MouseEvent e) {\n }", "public void actionPerformed(ActionEvent e){}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tObject source = e.getSource();\r\n\t\tif(source==button) {\r\n\t\t\tlabel.setText(\"You clicked the button\");\r\n\t\t} else {\r\n\t\t\tlabel.setText(\"You pressed Enter\");\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\r\n \t\tpublic void actionPerformed(ActionEvent e) {\n \t\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n \n }", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n if (e.getActionCommand().equals(\"Up\")){\n //System.out.println(\"Up button clicked!!\");\n jLabel.setText(\"You pressed the up button\");\n }\n // else if -> for several buttons...\n else {\n //System.out.println(\"Down button clicked!!\");\n jLabel.setText(\"You pressed the down button\");\n }\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\t}", "public void actionPerformed(ActionEvent e)\n {\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n\n }", "@Override\n\tpublic void actionPerformed(ActionEvent e) \n\t{\n\t\t\n\t\tJButton button = (JButton)e.getSource();\n\t\t\n\t\tif(button.equals(buttonInvia))\n\t\t{\n\t\t\tareaRisposta.setText(this.getTestoRisposta(areaDomanda.getText()));\t\t\n\t\t}\t\t\t\t\n\t\telse\n\t\t\tif(button.equals(buttonReset))\n\t\t\t{\n\t\t\t\tareaDomanda.setText(\"\");\n\t\t\t\tareaRisposta.setText(\"\");\n\t\t\t}\n\t\t\t\n\t}", "@Override\n\t\tpublic void actionPerformed(ActionEvent arg0) \n\t\t{\n\t\t\t\n\t\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t}" ]
[ "0.77375287", "0.7534994", "0.73342276", "0.7313117", "0.7291331", "0.7275364", "0.7263127", "0.7249275", "0.7249275", "0.7249275", "0.7249275", "0.72486305", "0.724562", "0.7217411", "0.7216276", "0.7200492", "0.7200286", "0.71916664", "0.71845084", "0.71845084", "0.71845084", "0.7151855", "0.7145133", "0.71407217", "0.71407217", "0.7139541", "0.71374226", "0.7125996", "0.7119645", "0.711461", "0.71114284", "0.7104229", "0.708285", "0.7082192", "0.70763975", "0.7069791", "0.7060122", "0.70528495", "0.7050306", "0.70470655", "0.7035246", "0.703085", "0.7030253", "0.7029089", "0.7009587", "0.7009587", "0.7009587", "0.7009587", "0.7009587", "0.7009587", "0.7009587", "0.7009587", "0.7009587", "0.7009587", "0.6998549", "0.6997278", "0.6996179", "0.69929415", "0.69929415", "0.69918674", "0.6980617", "0.6980617", "0.6977899", "0.69753695", "0.69753695", "0.69753695", "0.6974328", "0.69691014", "0.6964864", "0.6956978", "0.6956978", "0.69532645", "0.69514596", "0.6948938", "0.69479835", "0.694494", "0.6940309", "0.69400066", "0.69368094", "0.6932301", "0.6931758", "0.6931758", "0.6931758", "0.6931758", "0.6931758", "0.6931758", "0.6931758", "0.6931758", "0.6931758", "0.6931758", "0.6931758", "0.69312626", "0.6929883", "0.6928669", "0.6928229", "0.6927537", "0.6924922", "0.6924257", "0.6920965", "0.6920965", "0.6920965" ]
0.0
-1
For answer checking and counting game score.
public int answerCheck() { int score = -36; // 36 squares already filled in game. char[][] userAnswer = new char[9][9]; for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { userAnswer[i][j] = index[i][j].getText().charAt(0); } } for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { if(answer[i][j] == userAnswer[i][j]){ score++; } } } return score; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int computeScore() {\n int score = 0;\n for (int i = 0; i < MainActivity.DEFAULT_SIZE; i++) {\n TextView answerView = (TextView) findViewById(MainActivity.NAME_VIEWS[i]);\n String answer = answerView.getText().toString();\n String solution = getQuizCountries().get(i).getName();\n if (answer.equals(solution)) {\n score++;\n }\n }\n return score;\n }", "double scoreAnswer(Question question, Answer answer);", "public void countPoints() {\n points = 0;\n checkAnswerOne();\n checkAnswerTwo();\n checkAnswerThree();\n checkAnswerFour();\n checkAnswerFive();\n checkAnswerSix();\n checkAnswerSeven();\n checkAnswerEight();\n checkAnswerNine();\n checkAnswerTen();\n }", "protected void checkScore () {\n if (mCurrentIndex == questions.length-1) {\n NumberFormat pct = NumberFormat.getPercentInstance();\n double result = (double) correct/questions.length;\n Toast res = new Toast(getApplicationContext());\n res.makeText(QuizActivity.this, \"Your score: \" + pct.format(result), Toast.LENGTH_LONG).show();\n correct = 0; // resets the score when you go back to first question.\n }\n }", "private void calculateScore() {\n EditText editText1 = (EditText) findViewById(R.id.edit_text1);\n String answer1 = editText1.getText().toString().toLowerCase().trim();\n if (answer1.equals( getResources().getText(R.string.answer1))) {\n score += 3;\n } else {\n //show false\n }\n\n RadioGroup radioGroup2 = (RadioGroup) findViewById(R.id.radio_group2);\n int checkedRadioButtonId2 = radioGroup2.getCheckedRadioButtonId();\n if (checkedRadioButtonId2 == R.id.rb21) {\n score += 1;\n } else {\n //show false\n }\n\n CheckBox checkBox3b = (CheckBox) findViewById(R.id.cb32);\n CheckBox checkBox3d = (CheckBox) findViewById(R.id.cb34);\n if (checkBox3b.isChecked() && checkBox3d.isChecked()) {\n score += 2;\n } else {\n //show false\n }\n\n RadioGroup radioGroup4 = (RadioGroup) findViewById(R.id.radio_group4);\n int checkedRadioButtonId4 = radioGroup4.getCheckedRadioButtonId();\n if (checkedRadioButtonId4 == R.id.rb41) {\n score += 1;\n } else {\n //show false\n }\n }", "public void checkAnswer(int answer) {\n int correctAns = Integer.MIN_VALUE;\n \n switch (currentOperator) {\n case PLUS: correctAns = leftNumPanel.num + rightNumPanel.num; break;\n case MINUS: correctAns = leftNumPanel.num - rightNumPanel.num; break;\n case TIMES: correctAns = leftNumPanel.num * rightNumPanel.num; break;\n case DIVIDE: correctAns = leftNumPanel.num / rightNumPanel.num;\n }\n \n boolean gotItRight = (answer == correctAns);\n feedbackPanel.showFeedback(gotItRight);\n if (gotItRight) {\n setNewNumbers();\n score++;\n \n switch (currentOperator) {\n case PLUS: correctCount[0]++; break;\n case MINUS: correctCount[1]++; break;\n case TIMES: correctCount[2]++; break;\n case DIVIDE: correctCount[3]++; break;\n }\n \n if (inGame) {\n clockPanel.giveBonusTime();\n }\n \n } else {\n // got it wrong\n if (inGame) {\n clockPanel.takeOffTime();\n }\n }\n }", "protected int checkIfCorrect(String answer, String correctAns)\r\n {\r\n if (correctAns.equals(answer))\r\n {\r\n System.out.println(\"Awsome job!\");\r\n return score++;\r\n }\r\n else \r\n { \r\n System.out.println(\"opps\"); \r\n return score;\r\n }\r\n \r\n }", "private void validateQuiz() {\n int score = 0;\n String answer1 = answerOne.getText().toString();\n int answer2 = answerTwo.getCheckedRadioButtonId();\n boolean answer3 = answerThreeOptionA.isChecked() && answerThreeOptionD.isChecked() && !answerThreeOptionB.isChecked() && !answerThreeOptionC.isChecked();\n String answer4 = answerFour.getText().toString();\n int answer5 = answerFive.getCheckedRadioButtonId();\n boolean answer6 = answerSixOptionA.isChecked() && answerSixOptionB.isChecked() && answerSixOptionD.isChecked() && !answerSixOptionC.isChecked();\n if (answer1.equalsIgnoreCase(getString(R.string.answerOne))) {\n score++;\n }\n if (answer2 == answerTwoOptionA.getId()) {\n score++;\n }\n if (answer3) {\n score++;\n }\n if (answer4.equalsIgnoreCase(getString(R.string.answerFour))) {\n score++;\n }\n if (answer5 == answerFiveOptionD.getId()) {\n score++;\n }\n if (answer6) {\n score++;\n }\n String result = getString(R.string.result, score, questionList.size());\n Toast.makeText(this, result, Toast.LENGTH_SHORT).show();\n }", "int score();", "int score();", "private int calculateScore(boolean answerOne, boolean answerTwo, boolean answerThree, boolean answerFour, boolean answerFiveA, boolean answerFiveB, boolean answerFiveC, boolean answerFiveD, boolean answerSix, boolean answerSeven, boolean answerEight, boolean answerNine, String answerTen) {\n int score = 0;\n\n if (answerOne) {\n score += 10;\n Log.v(\"MainActivity\", \"1\");\n }\n\n if (answerTwo) {\n score += 10;\n Log.v(\"MainActivity\", \"2\");\n }\n\n if (answerThree) {\n score += 10;\n Log.v(\"MainActivity\", \"3\");\n }\n\n if (answerFour) {\n score += 10;\n Log.v(\"MainActivity\", \"4\");\n }\n\n if (answerFiveA && !answerFiveB && !answerFiveC && answerFiveD) {\n score += 10;\n Log.v(\"MainActivity\", \"5\");\n }\n\n if (answerSix) {\n score += 10;\n Log.v(\"MainActivity\", \"6\");\n }\n\n if (answerSeven) {\n score += 10;\n Log.v(\"MainActivity\", \"7\");\n }\n\n if (answerEight) {\n score += 10;\n Log.v(\"MainActivity\", \"8\");\n }\n\n if (answerNine) {\n score += 10;\n Log.v(\"MainActivity\", \"9\");\n }\n\n if (answerTen.equals(\"Norbert\")) {\n score += 10;\n Log.v(\"MainActivity\", \"10\");\n }\n\n return score;\n }", "public long getScoreEssay(Essay essay, String answer)\n {\n return 0;\n }", "private double getScore() {\n double score = 0;\n score += getRBAnswers(R.id.radiogroup1, R.id.radiobutton_answer12);\n score += getRBAnswers(R.id.radiogroup2, R.id.radiobutton_answer21);\n score += getRBAnswers(R.id.radiogroup3, R.id.radiobutton_answer33);\n score += getRBAnswers(R.id.radiogroup4, R.id.radiobutton_answer41);\n score += getCBAnswers();\n score += getTextAns();\n score = Math.round(score / .0006);\n score = score / 100;\n return score;\n }", "private int calculateScore() {\n int total;\n int score = getGameScore();\n int correct = getCorrectGuesses();\n int wrong = getWrongGuesses();\n GameDifficulty difficulty = Hangman.getGameDifficulty();\n\n // Calculate points\n switch (difficulty) {\n case EASY : total = score; break;\n case NORMAL : total = (2 * score) + correct - wrong; break;\n case HARD : total = (3 * score) + (2 * correct) - (2 * wrong); break;\n default : total = score;\n }\n\n return total;\n }", "public void checkScore(View view) {\n //Question Nr. 1 radio button\n RadioButton true1AnswerOne = (RadioButton) findViewById(R.id.q1a1);\n Boolean is1OneTrue = true1AnswerOne.isChecked();\n if (is1OneTrue) {\n\n }\n\n RadioButton true1AnswerTwo = (RadioButton) findViewById(R.id.q1a2);\n Boolean is1TwoTrue = true1AnswerTwo.isChecked();\n if (is1TwoTrue) {\n\n }\n\n RadioButton true1AnswerThree = (RadioButton) findViewById(R.id.q1a3);\n Boolean is1ThreeTrue = true1AnswerThree.isChecked();\n if (is1ThreeTrue) {\n score = score + 2;\n }\n\n RadioButton true1AnswerFour = (RadioButton) findViewById(R.id.q1a4);\n Boolean is1FourTrue = true1AnswerFour.isChecked();\n if (is1FourTrue) {\n score++;\n }\n\n //Question Nr. 2 radio button\n RadioButton true2AnswerOne = (RadioButton) findViewById(R.id.q2a1);\n Boolean is2OneTrue = true2AnswerOne.isChecked();\n if (is2OneTrue) {\n\n }\n\n RadioButton true2AnswerTwo = (RadioButton) findViewById(R.id.q2a2);\n Boolean is2TwoTrue = true2AnswerTwo.isChecked();\n if (is2TwoTrue) {\n\n }\n\n RadioButton true2AnswerThree = (RadioButton) findViewById(R.id.q2a3);\n Boolean is2ThreeTrue = true2AnswerThree.isChecked();\n if (is2ThreeTrue) {\n score++;\n }\n\n RadioButton true2AnswerFour = (RadioButton) findViewById(R.id.q2a4);\n Boolean is2FourTrue = true2AnswerFour.isChecked();\n if (is2FourTrue) {\n score = score + 2;\n }\n\n //Question Nr. 3 radio button\n RadioButton true3AnswerOne = (RadioButton) findViewById(R.id.q3a1);\n Boolean is3OneTrue = true3AnswerOne.isChecked();\n if (is3OneTrue) {\n\n }\n\n RadioButton true3AnswerTwo = (RadioButton) findViewById(R.id.q3a2);\n Boolean is3TwoTrue = true3AnswerTwo.isChecked();\n if (is3TwoTrue) {\n\n }\n\n RadioButton true3AnswerThree = (RadioButton) findViewById(R.id.q3a3);\n Boolean is3ThreeTrue = true3AnswerThree.isChecked();\n if (is3ThreeTrue) {\n score++;\n }\n\n RadioButton true3AnswerFour = (RadioButton) findViewById(R.id.q3a4);\n Boolean is3FourTrue = true3AnswerFour.isChecked();\n if (is3FourTrue) {\n score = score + 2;\n }\n\n //Question Nr. 4 radio button\n RadioButton true4AnswerOne = (RadioButton) findViewById(R.id.q4a1);\n Boolean is4OneTrue = true4AnswerOne.isChecked();\n if (is4OneTrue) {\n\n }\n\n RadioButton true4AnswerTwo = (RadioButton) findViewById(R.id.q4a2);\n Boolean is4TwoTrue = true4AnswerTwo.isChecked();\n if (is4TwoTrue) {\n\n }\n\n RadioButton true4AnswerThree = (RadioButton) findViewById(R.id.q4a3);\n Boolean is4ThreeTrue = true4AnswerThree.isChecked();\n if (is4ThreeTrue) {\n score++;\n }\n\n RadioButton true4AnswerFour = (RadioButton) findViewById(R.id.q4a4);\n Boolean is4FourTrue = true4AnswerFour.isChecked();\n if (is4FourTrue) {\n score = score + 2;\n }\n\n //Question Nr. 5 radio button\n RadioButton true5AnswerOne = (RadioButton) findViewById(R.id.q5a1);\n Boolean is5OneTrue = true5AnswerOne.isChecked();\n if (is5OneTrue) {\n\n }\n\n RadioButton true5AnswerTwo = (RadioButton) findViewById(R.id.q5a2);\n Boolean is5TwoTrue = true5AnswerTwo.isChecked();\n if (is5TwoTrue) {\n score = score + 2;\n }\n\n RadioButton true5AnswerThree = (RadioButton) findViewById(R.id.q5a3);\n Boolean is5ThreeTrue = true5AnswerThree.isChecked();\n if (is5ThreeTrue) {\n score++;\n }\n\n RadioButton true5AnswerFour = (RadioButton) findViewById(R.id.q5a4);\n Boolean is5FourTrue = true5AnswerFour.isChecked();\n if (is5FourTrue) {\n\n }\n\n //Question Nr. 6 radio button\n RadioButton true6AnswerOne = (RadioButton) findViewById(R.id.q6a1);\n Boolean is6OneTrue = true6AnswerOne.isChecked();\n if (is6OneTrue) {\n score = score + 2;\n }\n\n RadioButton true6AnswerTwo = (RadioButton) findViewById(R.id.q6a2);\n Boolean is6TwoTrue = true6AnswerTwo.isChecked();\n if (is6TwoTrue) {\n score++;\n }\n\n RadioButton true6AnswerThree = (RadioButton) findViewById(R.id.q6a3);\n Boolean is6ThreeTrue = true6AnswerThree.isChecked();\n if (is6ThreeTrue) {\n\n }\n\n RadioButton true6AnswerFour = (RadioButton) findViewById(R.id.q6a4);\n Boolean is6FourTrue = true6AnswerFour.isChecked();\n if (is6FourTrue) {\n\n }\n\n //Question Nr. 7 check box\n CheckBox trueAnswerSeven1 = (CheckBox) findViewById(R.id.trueq7a1);\n Boolean isSeven1True = trueAnswerSeven1.isChecked();\n CheckBox trueAnswerSeven2 = (CheckBox) findViewById(R.id.trueq7a2);\n Boolean isSeven2True = trueAnswerSeven2.isChecked();\n CheckBox trueAnswerSeven3 = (CheckBox) findViewById(R.id.trueq7a3);\n Boolean isSeven3True = trueAnswerSeven3.isChecked();\n CheckBox trueAnswerSeven4 = (CheckBox) findViewById(R.id.trueq7a4);\n Boolean isSeven4True = trueAnswerSeven4.isChecked();\n if (isSeven1True) {\n score++;\n }\n\n if (isSeven2True) {\n score++;\n }\n\n if (isSeven3True) {\n score++;\n }\n\n if (isSeven4True) {\n score++;\n }\n\n //Question Nr. 8 edit text\n EditText trueAnswerEight = (EditText) findViewById(R.id.q8a1);\n String isEightTrue = trueAnswerEight.getText().toString();\n if (isEightTrue.equals(\"Love You\")) {\n score++;\n }\n\n //Text of the message after the Check your score button is clicked.\n if (score < 6) {\n Toast.makeText(this, \"You scored \" + score + \" points out of 17. One of you might be caught in so called \\\"Passion trap\\\" (search for it in the internet). You both need to work on your relationships to improve the balance.\", Toast.LENGTH_LONG).show();\n } else if (score < 12) {\n Toast.makeText(this, \"Good! You scored \" + score + \" points out of 17! Your relationship probably needs a bit of work to take it from good to great. Search for \\\"Relationship balance or Passion trap in the internet.\", Toast.LENGTH_LONG).show();\n } else {\n Toast.makeText(this, \"Congratulations! You scored \" + score + \" points out of 17! You seem to have a good and balanced relationship with your partner.\", Toast.LENGTH_LONG).show();\n }\n score = 0;\n }", "public void checkQuiz(View view) {\n int score = computeScore();\n ((TextView) findViewById(R.id.scoreTitle)).setText(R.string.score_title);\n ((TextView) findViewById(R.id.score)).setText(score + \"/\" + getQuizCountries().size());\n }", "public void scoresForGameModes() {\r\n \tCalculateScore myScore = new CalculateScore();\r\n \tthis.score = myScore.giveScore();\r\n \tif (gamemode == 1) {\r\n \t\treturn;\r\n \t}\r\n \tif (gamemode ==2 ) {\r\n \t\tthis.score = this.score - (10 * (currentGraph.getCNumber() - set.size()));\r\n \t}\r\n \tif (gamemode ==3) {\r\n \t\tthis.score = this.score - (10 * (currentGraph.getCNumber() -set.size()));\r\n \t}\r\n }", "private void countAnswers(){\n\t\tfor(Student student: students){\n\t\t\tif(isCorrectAnswer(student.getAnswers())){\n\t\t\t\tcorrectAnswers+=1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\twrongAnswers+=1;\n\t\t\t}\n\t\t}\n\t}", "private void checkAnswer()\r\n\t{\r\n\t\t//Submission to the model and getting 'true' if correct and 'false' otherwise\r\n\t\tboolean response = quizModel.isCorrect(group.getSelection().getActionCommand());\r\n\t\t\r\n\t\t//Updating score label based on result\r\n\t\tif (response == true)\r\n\t\t{\r\n\t\t\tscoreLabel.setText(\"<html><div style='text-align: center;'>\" + \"Score = \" + quizModel.getScore() + \"<br>Correct answer!\" + \"</div></html>\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tscoreLabel.setText(\"<html><div style='text-align: center;'>\" + \"Score = \" + quizModel.getScore() + \"<br>Incorrect answer!\" + \"</div></html>\");\r\n\t\t}\r\n\t}", "public void score(){\r\n\t\tint playerLocation = player.getLocationX();\r\n\t\tint obstacleX = obstacle.getLocationX();\r\n\t\tint obstacleY = obstacle.getLocationY();\r\n\r\n\r\n\t\tstr =\"\" + countCoins;\r\n\r\n\t\t//if you hit a coin, the number of points goes up by one.\r\n\t\tif(obstacleY == 280 && obstacleX==300 && playerLocation == 250){\r\n\t\t\tcountCoins++;\r\n\t\t}\r\n\t\tif(obstacleY== 450 && obstacleX==300 && playerLocation ==450){\r\n\t\t\tcountCoins++;\r\n\t\t}\r\n\r\n\t\t//if you hit the green monster, you lose one point.\r\n\t\tif((obstacleX-50) == 250 && (obstacleY-240) == 250 && playerLocation ==250){\r\n\t\t\tcountCoins--;\r\n\t\t}\r\n\r\n\t\t//if you hit the blue monster, you lose 3 points.\r\n\t\tif((obstacleX+180) == 480 && (obstacleY+180) == 250 && playerLocation ==450){\r\n\t\t\tcountCoins-=3;\r\n\t\t}\r\n\t}", "public void checkAnswers(View view){\n int result = 0;\n\n if (checkRadioButtonAnswer(R.id.first_answer, R.id.first_answer3)){\n result = result + 1;\n }\n\n if (checkTextViewAnswer(R.id.second_answer, \"lions\")){\n result = result + 1;\n }\n\n if (checkRadioButtonAnswer(R.id.third_answer, R.id.third_answer1)){\n result = result + 1;\n }\n\n if (checkRadioButtonAnswer(R.id.fourth_answer, R.id.fourth_answer3)){\n result = result + 1;\n }\n\n if (checkRadioButtonAnswer(R.id.fifth_answer, R.id.fifth_answer3)){\n result = result + 1;\n }\n\n if (checkRadioButtonAnswer(R.id.sixth_answer, R.id.sixth_answer2)){\n result = result + 1;\n }\n\n if (checkCheckBoxAnswer(R.id.seventh_answer1, true) &&\n checkCheckBoxAnswer(R.id.seventh_answer2, true) &&\n checkCheckBoxAnswer(R.id.seventh_answer3, true) &&\n checkCheckBoxAnswer(R.id.seventh_answer4, false)){\n result = result + 1;\n }\n\n /**\n * A toast message is shown which represents the scored points out of the total 7.\n */\n Toast.makeText(this, \"Result: \" + Integer.toString(result) + \"/7\", Toast.LENGTH_SHORT).show();\n }", "private void calculateScoreForRadioButtons(boolean question2_option3, boolean question6_option2,\n boolean question7_option1) {\n\n\n // if user picks option 3 in question 2, add 1 to score.\n if (question2_option3) {\n score += 1;\n }\n\n\n\n // if user picks option 1 in question 6, add 1 to score.\n if (question6_option2) {\n score += 1;\n }\n\n\n // if user picks option 1 in question 7, add 1 to score.\n if (question7_option1) {\n score += 1;\n }\n\n // calculate the total value of score\n }", "public static void main(String[] args) {\n\t\t\n\t\tint startGame;\n\n\n\t\t\n\t\tScanner numb = new Scanner(System.in);\n\t\tScanner str = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Please to start enter a username: \");\n\t\tusername = str.nextLine();\n\t\tSystem.out.println(\"\\n\\n\\t\\t\"+username+\", You are welcome to....\\n\\t\\tWho Wins A Million!!\");\n\t\tSystem.out.println(\"\\n\\t\\tPress 1 to enter\\n\\t\\t(Or 0 to quit)\");\n\t\tstartGame = numb.nextInt();\n\t\t\n\t\t\n\t\tif (startGame == 1) {\n\t\t\t\n\t\t\t//if(totalScore >= 0) {\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"So how well do you know Cameroon ?\\n\\n\");\n\t\t\t\t\n\t\t\t\tquestionNo = 1;\n\t\t\t\tSystem.out.println(questionNo+\". Who is the President of Cameroon? \\n\\na. Maurice Kamto \\tb. Paul Biya \\nc. Cabral Libii \\td. Joshua Oshi\");\n\t\t\t\tuserAnswer = str.nextLine();\n\t\t\t\tanswerTest();\n\t\t\t\tquestionScores();\n\t\t\t\tSystem.out.println(\"\\t\\t\\tScore: \"+userScore()+\"\\n\\n\");\n\t\t\t\tquestionNo++;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tSystem.out.println(questionNo+\". How many administrative divisions does Cameroon have ?\\n\\na. 15 \\t\\t\\tb. 12 \\nc. 8 \\t\\t\\td. 10\");\n\t\t\t\tuserAnswer = str.nextLine();\n\t\t\t\tanswerTest();\n\t\t\t\tquestionScores();\n\t\t\t\tSystem.out.println(\"\\t\\t\\tScore: \"+userScore()+\"\\n\\n\");\n\t\t\t\tquestionNo++;\n\t\t\t\t\n\t\t\t\tSystem.out.println(questionNo+\". Which of the following is the most populated town ?\\n\\na. Yaounde \\t\\tb. Bafoussam \\nc. Douala \\t\\td. Bamenda\");\n\t\t\t\tuserAnswer = str.nextLine();\n\t\t\t\tanswerTest();\n\t\t\t\tquestionScores();\n\t\t\t\tSystem.out.println(\"\\t\\t\\tScore: \"+userScore()+\"\\n\\n\");\n\t\t\t\tquestionNo++;\n\t\t\t\t\n\t\t\t\tSystem.out.println(questionNo+\". When did Cameroon gained its independence ?\\n\\na. 1950 \\t\\tb. 1960 \\nc. 1961 \\t\\td. 1951\");\n\t\t\t\tuserAnswer = str.nextLine();\n\t\t\t\tanswerTest();\n\t\t\t\tquestionScores();\n\t\t\t\tSystem.out.println(\"\\t\\t\\tScore: \"+userScore()+\"\\n\\n\");\n\t\t\t\tquestionNo++;\n\t\t\t\t\n\t\t\t\tSystem.out.println(questionNo+\". What is the total area of Cameroon in square kilometers ?\\n\\na. 475 441 \\t\\tb. 475 442 \\nc. 475 443 \\t\\td. 475 444\");\n\t\t\t\tuserAnswer = str.nextLine();\n\t\t\t\tanswerTest();\n\t\t\t\tquestionScores();\n\t\t\t\tSystem.out.println(\"\\t\\t\\tScore: \"+userScore()+\"\\n\\n\");\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tSystem.out.println(\".....................................\");\n\t\t\t\tSystem.out.println(username+\" Statistics\");\n\t\t\t\tSystem.out.println(\".....................................\\n\");\n\t\t\t\tSystem.out.println(\"Total Questions Attempted: \"+questionNo);\n\t\t\t\tSystem.out.println(\"Total Correct Answers: \"+correctQuestions);\n\t\t\t\tSystem.out.println(\"Total Score: \"+totalScore);\n\t\t\t\tSystem.out.println(\"Money obtained: \"+prizeMoney);\n\t\t\t\t\n\t\t\t//}\n\t\t\t\n\t\t\n\t\t}else System.out.println(\"Exiting\");\n\t\t\n\t\tSystem.out.println(\"\\nEnd of the game!\");\n\t}", "public int calculScore(Deck deck)\n {\n return 0;\n }", "public void finishQuiz(View view){\n if(((RadioButton) findViewById(R.id.radio_new_york_city)).isChecked()) {\n score++;\n }\n\n //Anser for question 2\n if(((RadioButton) findViewById(R.id.radio_food_cart)).isChecked()) score++;\n\n //Anser for question 3\n if(((CheckBox) findViewById(R.id.check_chicken)).isChecked()\n && ((CheckBox) findViewById(R.id.check_gyro)).isChecked()\n && !((CheckBox) findViewById(R.id.check_pork)).isChecked()) score++;\n\n //Anser for question 4\n String answer4 = ((EditText) findViewById(R.id.edit_bread)).getText().toString().toLowerCase();\n if(answer4.equals(\"pita\")) score++;\n\n //Anser for question 5\n if(((CheckBox) findViewById(R.id.check_red)).isChecked()\n && ((CheckBox) findViewById(R.id.check_yellow)).isChecked()\n && !((CheckBox) findViewById(R.id.check_white)).isChecked()) score++;\n\n\n //Anser for question 6\n if(((RadioButton) findViewById(R.id.radio_large)).isChecked()) score++;\n\n //Display the Toast\n Context context = getApplicationContext();\n\n CharSequence text;\n if(score == 6) {\n text = \"Congrats! Your Score was \" + score + \" out of 6!\";\n } else {\n text = \"You only have \" + score + \" out of 6! Try again!\";\n }\n int duration = Toast.LENGTH_LONG;\n Toast toast = Toast.makeText(context, text, duration);\n toast.show();\n\n //Resest score to 0\n\n score = 0;\n }", "void calculateScore(){\r\n playerScore = 0;\r\n for(int i = 1; i<=10; i++) {\r\n scoreQuestion(i);\r\n }\r\n }", "public void quiz() {\n\t\t\t\t\tcorrectans = 0;\n\t\t\t\t\tint k = 0;\n\t\t\t\t\tint j = 0;\n\t\t\t\t\tint M = 0;\n\t\t\t\t\tj = readDifficulty();\n\t\t\t\t\tM = readProblemType();\n\t\t\t\t\t//ask the student to solve 10 different problems, as determined by the problem type\n\t\t\t for(int i = 0; i < 10; i++ ) {\n\t\t\t \t//contain two numbers sampled from a uniform random distribution with bounds determined by the problem difficulty\n\t\t\t \tint x = rand.nextInt(j); \n\t\t\t\t int y = rand.nextInt(j);\n\t\t\t\t int O = askquestion(j, M,x,y);\n\t\t\t\t if(M == 4) {\n\t\t\t\t \t float floatans = readdivision();\n\t\t\t\t \tk = divisionsol(floatans, x, y);\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t int userin = readResponse();\n\t\t\t k = isnanswercorrect(O , userin);\n\t\t\t }\n\t\t\t if(k == 1) {\n\t\t\t \t correctans++;\n\t\t\t }\n\t\t\t }\n\t\t\t int L = 0;\n\t\t\t L = displayCompletionMessage(correctans);\n\t\t\t if ( L == 1) {\n\t\t\t \tquiz();\n\t\t\t }\n\t\t\t else {\n\t\t\t \treturn;\n\t\t\t }\n\t\t\t \n\t\t\t\t}", "@Override\n public void actionPerformed(ActionEvent ae)\n {\n total++;\n String display = \"\";\n if(jt.getText().trim().equals(qs.getAnswer().trim()))\n {\n score++;\n display += \"Score : \"+score+ \" / \" +total;\n //myDialog.setTitle(\"ok \"+score+\" / \"+total);\n }else{\n display += \"Score : \"+score+ \" / \" +total;\n display += \" prev answer : \"+qs.getAnswer().trim();\n }\n scoreBoard.setText(display);\n addDataTolist();\n\n }", "@Override\n\tpublic void checkScore() {\n\t\t\n\t}", "int getWrongAnswers();", "static private void calculateMissionScore() {\n\n HashMap<String, Boolean> missionStatus = allMissions.missionStatus;\n\n for (String i : missionStatus.keySet()) {\n\n if (missionStatus.get(i) == true) {\n score.addToPoints(250);\n }\n }\n }", "public static void main(String[] args) {\n\t\tint score = 0;\n\t\t// 2. Ask the user a question\n\t\tString q1 = JOptionPane.showInputDialog(\"what is the square root of nine ?\");\n\t\tif (q1.equals(\"three\") || q1.equals(\"3\")) {\n\t\t\tJOptionPane.showMessageDialog(null, \"you got it right!!\");\n\t\t\tscore++;\n\t\t} else {\n\t\t\tJOptionPane.showMessageDialog(null, \"sorry you were wrong\");\n\t\t}\n\t\tString q2 = JOptionPane.showInputDialog(\"12 x 12\");\n\t\tif (q2.equals(\"144\")) {\n\t\t\tJOptionPane.showMessageDialog(null, \"you got it right!!\");\n\t\t\tscore++;\n\t\t} else {\n\t\t\tJOptionPane.showMessageDialog(null, \"sorry you were wrong\");\n\t\t}\n\t\tString q3 = JOptionPane.showInputDialog(\"what is 1+2+3+4+5+6+7+8+9+10 ?\");\n\t\tif (q3.equals(\"55\")) {\n\t\t\tJOptionPane.showMessageDialog(null, \"you got it right!!\");\n\t\t\tscore++;\n\t\t} else {\n\t\t\tJOptionPane.showMessageDialog(null, \"sorry you were wrong\");\n\t\t}\n\t\tString q4 = JOptionPane.showInputDialog(\"what is the strongest substance on earth ?\");\n\t\tif (q4.equals(\"diamond\")) {\n\t\t\tJOptionPane.showMessageDialog(null, \"you got it right!!\");\n\t\t\tscore++;\n\t\t} else {\n\t\t\tJOptionPane.showMessageDialog(null, \"sorry you were wrong\");\n\t\t}\n\t\t// 3. Use an if statement to check if their answer is correct\n\n\t\t// 4. if the user's answer is correct\n\n\t\t// -- add one to their score\n\n\t\t// 5. Create more questions by repeating steps 1, 2, and 3 below.\n\n\t\t// 6. After all the questions have been asked, print the user's score\n\t\tJOptionPane.showMessageDialog(null, \"you got \" + score + \" out of 4, great job!\");\n\t}", "private int scoreCounter(int result) {\n result +=1;\n return result;\n }", "public void calculateScore() {\n\n turnScore();\n\n if (turn == 1) {\n p1.setScore(p1.getScore() - turnScore);\n\n } else if (turn == 2) {\n p2.setScore(p2.getScore() - turnScore);\n\n }\n\n\n }", "public static void takeTest(Question [] questions) {\n int score = 0;\n Scanner keyboardInput = new Scanner(System.in);\n for(int i = 0; i < questions.length; i++){\n System.out.println(questions[i].prompt);\n String answer = keyboardInput.nextLine();\n if(answer.equals(questions[i].answer)) {\n score++;\n }\n\n }\n System.out.println(\"Voce conseguiu \" + score + \"/\" + questions.length + \"pontos\");\n\n }", "private void determineButtonPress(boolean answer){\n boolean expectedAnswer = currentQuestion.isAnswer();\n String result;\n if (answer == expectedAnswer){\n result=\"Correct\";\n score++;\n txtScore.setText(\"Score: \" + score);\n } else {\n result=\"False\";\n }\n //call this function to display the result to the player\n answerResultAlert(result);\n\n }", "private void showResults() {\n if (!sent) {\n if(checkAnswerOne()) {\n nbOfCorrectAnswers++;\n }\n if(checkAnswerTwo()) {\n nbOfCorrectAnswers++;\n }\n if(checkAnswerThree()) {\n nbOfCorrectAnswers++;\n }\n if(checkAnswerFour()) {\n nbOfCorrectAnswers++;\n }\n\n showResultAsToast(nbOfCorrectAnswers);\n\n } else {\n showResultAsToast(nbOfCorrectAnswers);\n }\n }", "public static void main(String[] args) {\n\t\tint score = 0;\n\t\t// 2. Ask the user a question\n\t\tString input = JOptionPane.showInputDialog(null, \"What is a?: 2a-18=-4a:\");\n\t\t// 3. Use an if statement to check if their answer is correct\n\t\tif (input.equals(\"3\")) {\n\t\t\tJOptionPane.showMessageDialog(null, \"You are correct, good job!\");\n\n\t\t\tscore++;\n\n\t\t} else {\n\t\t\tJOptionPane.showMessageDialog(null,\n\t\t\t\t\t\"You are incorrect, sorry. But don't worry, every mistake is a learning experience!\");\n\t\t}\n\t\t// 4. if the user's answer was correct, add one to their score\n\n\t\t// 5. Create more questions by repeating steps 1, 2, and 3 below.\n\t\tString answer = JOptionPane.showInputDialog(null, \"Which side of the Roman Empire fell? A: Eastern B: Western\");\n\t\tif (answer.equals(\"B\")) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Congrants, you got it correct!\");\n\t\t\tscore++;\n\n\t\t} else {\n\t\t\tJOptionPane.showMessageDialog(null, \"Sorry, but wrong answer. Nice try though!\");\n\t\t}\n\t\tJOptionPane.showMessageDialog(null,\"You have now completed the quiz, good job!\");\n\t\t// 6. After all the questions have been asked, print the user's score\n\t\tSystem.out.println(score);\n\t}", "public void Enter() {\n\t\tEndTimer();\n\t\tif (Question >= 10) {\n\n\t\t\tSystem.out.println(\"This is Game\" + Score);\n\t\t\tIntent TheScore = new Intent(this, Score.class).putExtra(\"Score\",\n\t\t\t\t\tInteger.toString(Score));\n\t\t\tEndTimer();\n\t\t\tstartActivity(TheScore);\n\t\t\tfinish();\n\t\t} else {\n\n\t\t\tEditText editText22 = (EditText) findViewById(R.id.editText1);\n\t\t\tInteger Guess = 0;\n\t\t\ttry {\n\t\t\t\tGuess = Integer.parseInt(editText22.getText().toString());\n\t\t\t} catch (NumberFormatException nfe) {\n\t\t\t}\n\n\t\t\tTextView CorrectOrNot = (TextView) findViewById(R.id.textView1);\n\t\t\t/*\n\t\t\t * If the Hints is on it will allow the user to try each question 4\n\t\t\t * times. Below checks if the Hints is on or off.\n\t\t\t */\n\t\t\tif (Prefs.getHints(this)) {\n\t\t\t\tif (Answer == Guess) {\n\t\t\t\t\tCorrectOrNot.setTextColor(Color.GREEN);\n\t\t\t\t\tCorrectOrNot.setText(\"Correct\");\n\t\t\t\t\tCorrect++;\n\t\t\t\t\t/*\n\t\t\t\t\t * The score is worked out by 100 divided by 10 take away\n\t\t\t\t\t * from how much time was left.\n\t\t\t\t\t */\n\t\t\t\t\tScore = Score + 100 / (10 - TimeLeft);\n\t\t\t\t\tQuestion++;\n\t\t\t\t\treset();\n\t\t\t\t\t/*\n\t\t\t\t\t * Should the user enter the wrong answer it will allow them\n\t\t\t\t\t * to retry as well as tell them if the answer they entered\n\t\t\t\t\t * is greater or less then the actual answer.\n\t\t\t\t\t */\n\t\t\t\t} else if (Tries < 4) {\n\t\t\t\t\tif (Guess > Answer) {\n\t\t\t\t\t\tCorrectOrNot.setTextColor(Color.MAGENTA);\n\t\t\t\t\t\tCorrectOrNot.setText(\"Greater\");\n\t\t\t\t\t\tTries = Tries + 1;\n\t\t\t\t\t\tEndTimer();\n\t\t\t\t\t\tStartTimer();\n\n\t\t\t\t\t}\n\t\t\t\t\tif (Guess < Answer) {\n\t\t\t\t\t\tCorrectOrNot.setTextColor(Color.MAGENTA);\n\t\t\t\t\t\tCorrectOrNot.setText(\"less\");\n\t\t\t\t\t\tTries = Tries + 1;\n\t\t\t\t\t\tEndTimer();\n\t\t\t\t\t\tStartTimer();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\t * Once the 4 tries is over, it will check if the last answer is\n\t\t\t\t * correct or not and act accordingly\n\t\t\t\t */\n\t\t\t\tif (Tries >= 4) {\n\t\t\t\t\tif (Answer == Guess) {\n\t\t\t\t\t\tCorrectOrNot.setTextColor(Color.GREEN);\n\t\t\t\t\t\tCorrectOrNot.setText(\"Correct\");\n\t\t\t\t\t\tCorrect++;\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * The score is worked out by 100 divided by 10 take\n\t\t\t\t\t\t * away from how much time was left.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tScore = Score + 100 / (10 - TimeLeft);\n\t\t\t\t\t\tQuestion++;\n\t\t\t\t\t\treset();\n\t\t\t\t\t} else if (Answer != Guess) {\n\t\t\t\t\t\tQuestion++;\n\t\t\t\t\t\tCorrectOrNot.setTextColor(Color.RED);\n\t\t\t\t\t\tCorrectOrNot.setText(\"Incorrect\");\n\t\t\t\t\t\tTries = 0;\n\t\t\t\t\t\treset();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tif (Answer == Guess) {\n\t\t\t\t\tCorrectOrNot.setTextColor(Color.GREEN);\n\t\t\t\t\tCorrectOrNot.setText(\"Correct\");\n\t\t\t\t\tCorrect++;\n\t\t\t\t\t/*\n\t\t\t\t\t * The score is worked out by 100 divided by 10 take away\n\t\t\t\t\t * from how much time was left.\n\t\t\t\t\t */\n\t\t\t\t\tScore = Score + 100 / (10 - TimeLeft);\n\t\t\t\t\tSystem.out.println(Score);\n\t\t\t\t\tQuestion++;\n\t\t\t\t\tSystem.out.println(\"Correct \" + Correct);\n\t\t\t\t\treset();\n\t\t\t\t} else {\n\t\t\t\t\tQuestion++;\n\t\t\t\t\tCorrectOrNot.setTextColor(Color.RED);\n\t\t\t\t\tCorrectOrNot.setText(\"Incorrect\");\n\t\t\t\t\treset();\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "public void checkAnswer() {\n }", "private void checkMyScore() {\n\n int[] scores = ar.checkMyScore();\n System.out.println(\" My score: \");\n int level = 1;\n for (int i : scores) {\n System.out.println(\" level \" + level + \" \" + i);\n if (i > 0)\n solved[level - 1] = 1;\n level++;\n }\n }", "private void calculateScoreForCheckBoxes(boolean question3_option1, boolean question3_option3,\n boolean question3_option4, boolean question4_option1,\n boolean question4_option2, boolean question4_option4,\n boolean question8_option1, boolean question8_option3) {\n // if user picks option 1 in question 3, add 1 to score.\n if (question3_option1) {\n score += 1;\n }\n\n // if user picks option 3 in question 3, add 1 to score.\n if (question3_option3) {\n score += 1;\n }\n\n // if user picks option 4 in question 3, add 1 to score.\n if (question3_option4) {\n score += 1;\n }\n\n // if user picks option 1 in question 4, add 1 to score.\n if (question4_option1) {\n score += 1;\n }\n\n // if user picks option 2 in question 4, add 1 to score.\n if (question4_option2) {\n score += 1;\n }\n\n // if user picks option 4 in question 4, add 1 to score.\n if (question4_option4) {\n score += 1;\n }\n // if user picks option 2 in question 4, add 1 to score.\n if (question8_option1) {\n score += 1;\n }\n // if user picks option 2 in question 4, add 1 to score.\n if (question8_option3) {\n score += 1;\n }\n\n }", "protected AnswerScore() {/* intentionally empty block */}", "int getScore();", "private void checkAnswer(int i) {\n\tswitch(i){\r\n\tcase 1:\r\n\t\t Button answer=(Button)findViewById(R.id.radio0);\r\n\t\t Log.d(\"yourans\", currentQ.getANSWER()+\" \"+answer.getText());\r\n\t\t if(currentQ.getANSWER().contentEquals(answer.getText()))\r\n\t\t \t {\r\n\t\t \t scoreSci++;\r\n\t\t \t String d=String.valueOf(scoreSci);\r\n\t\t\t \tEditor editor=mGameSettings.edit();\r\n\t\t\t \teditor.putString(GAME_PREFERENCES_SCORE_SCI,d);\r\n\t\t\t \teditor.commit();\r\n\t\t\t\t\tLog.d(DEBUG_TAG, \"Score is : \"\r\n\t\t\t + mGameSettings.getString(GAME_PREFERENCES_SCORE_SCI, \"Not set\"));\r\n\t\t \t Toast.makeText(getApplicationContext(),\"correct\",Toast.LENGTH_SHORT).show();\r\n\t\t\t }\r\n\t\t \t else{\r\n\t\t \t\tString d=\"The correct answer is\\n\"+currentQ.getANSWER();\r\n\t\t \t\tEditor editor2=mGameSettings.edit();\r\n\t\t\t \teditor2.putString(GAME_CURRENT_ANS_SCI,d);\r\n\t\t\t \teditor2.commit();\r\n\t\t\t \tQuizActivitySci.this.showDialog(GET_WRONG);\r\n\t\t \t }\r\n\t Log.d(\"score\", \"Your score\"+scoreSci);\r\n\t\tbreak;\r\n\tcase 2:\r\n\t\t Button answer1=(Button)findViewById(R.id.radio1);\r\n\t \t Log.d(\"yourans\", currentQ.getANSWER()+\" \"+answer1.getText()); \t\r\n\t if(currentQ.getANSWER().contentEquals(answer1.getText()))\r\n\t \t {\r\n\t \t scoreSci++;\r\n\t \t String d=String.valueOf(scoreSci);\r\n\t \tEditor editor=mGameSettings.edit();\r\n\t \teditor.putString(GAME_PREFERENCES_SCORE_SCI,d);\r\n\t \teditor.commit();\r\n\t\t\t Log.d(\"score\", \"Your score\"+scoreSci);\r\n\t\t\t Log.d(DEBUG_TAG, \"Score is : \"\r\n\t + mGameSettings.getString(GAME_PREFERENCES_SCORE_SCI, \"Not set\"));\r\n\t\t\t Toast.makeText(getApplicationContext(),\"correct\",Toast.LENGTH_SHORT).show();\r\n\t\t }else{\r\n\t\t\t String d=\"The correct answer is\\n\"+currentQ.getANSWER();\r\n\t\t \t\tEditor editor2=mGameSettings.edit();\r\n\t\t\t \teditor2.putString(GAME_CURRENT_ANS_SCI,d);\r\n\t\t\t \teditor2.commit();\r\n\t\t\t \tQuizActivitySci.this.showDialog(GET_WRONG);\r\n\t \t }\r\n\t Log.d(\"score\", \"Your score\"+scoreSci);\r\n\t\tbreak;\r\n\tcase 3:\r\n\t\tButton answer11=(Button)findViewById(R.id.radio2);\r\n\t \t Log.d(\"yourans\", currentQ.getANSWER()+\" \"+answer11.getText()); \r\n\t \t if(currentQ.getANSWER().contentEquals(answer11.getText()))\r\n\t \t {\r\n\t \t scoreSci++;\r\n\t \tString d=String.valueOf(scoreSci);\r\n\t \tEditor editor=mGameSettings.edit();\r\n\t \teditor.putString(GAME_PREFERENCES_SCORE_SCI,d);\r\n\t \teditor.commit();\r\n\t\t\t Log.d(\"score\", \"Your score\"+scoreSci);\r\n\t\t\t Log.d(DEBUG_TAG, \"Score is : \"\r\n\t + mGameSettings.getString(GAME_PREFERENCES_SCORE_SCI, \"Not set\"));\r\n\t\t\t Toast.makeText(getApplicationContext(),\"correct\",Toast.LENGTH_SHORT).show();\r\n\t\t }else{\r\n\t\t\t String d=\"The correct answer is\\n\"+currentQ.getANSWER();\r\n\t\t \t\tEditor editor2=mGameSettings.edit();\r\n\t\t\t \teditor2.putString(GAME_CURRENT_ANS_SCI,d);\r\n\t\t\t \teditor2.commit();\r\n\t\t\t \tQuizActivitySci.this.showDialog(GET_WRONG);\r\n\t \t\t}\r\n\t \tLog.d(\"score\", \"Your score\"+scoreSci);\r\n\t\tbreak;\r\n\tcase 4:\r\n\t\tButton answer111=(Button)findViewById(R.id.radio3);\r\n\t \t Log.d(\"yourans\", currentQ.getANSWER()+\" \"+answer111.getText()); \t\r\n\t \t if(currentQ.getANSWER().contentEquals(answer111.getText()))\r\n\t \t {\r\n\t \t scoreSci++;\r\n\t \tString d=String.valueOf(scoreSci);\r\n\t \tEditor editor=mGameSettings.edit();\r\n\t \teditor.putString(GAME_PREFERENCES_SCORE_SCI,d);\r\n\t \teditor.commit();\r\n\t\t\t Log.d(\"score\", \"Your score\"+scoreSci);\r\n\t\t\t Log.d(DEBUG_TAG, \"Score is : \"\r\n\t + mGameSettings.getString(GAME_PREFERENCES_SCORE_SCI, \"Not set\"));\r\n\t\t\t Toast.makeText(getApplicationContext(),\"correct\",Toast.LENGTH_SHORT).show();\r\n\t\t }else{\r\n\t\t\t String d=\"The correct answer is\\n\"+currentQ.getANSWER();\r\n\t\t \t\tEditor editor2=mGameSettings.edit();\r\n\t\t\t \teditor2.putString(GAME_CURRENT_ANS_SCI,d);\r\n\t\t\t \teditor2.commit();\r\n\t\t\t \tQuizActivitySci.this.showDialog(GET_WRONG);\r\n\t \t\t }\r\n\t \tLog.d(\"score\", \"Your score\"+scoreSci);\r\n\t\tbreak;\r\n\t\t\r\n}\r\n\t\r\n}", "private void checkResults() {\n\n if (Dealer.calcTotal() == p1.calcTotal()) {\n System.out.println(\"You and the dealer Tie, Here is your money back.\");\n System.out.println(\"Total Winnings: \" + totalWinnings + \"\\n\");\n } else if (p1.calcTotal() > Dealer.calcTotal() && !bust) {\n System.out.println(\"You win!\");\n totalWinnings += betNum;\n p1.addPointCount(betNum);\n System.out.println(\"Total Winnings: \" + totalWinnings + \"\\n\");\n } else if (Dealer.calcTotal() > 31) {\n System.out.println(\"Dealer busts. You Win!\");\n totalWinnings += betNum;\n p1.addPointCount(betNum);\n System.out.println(\"Total Winnings: \" + totalWinnings + \"\\n\");\n } else if (Dealer.getTotal() > p1.calcTotal() && Dealer.getTotal() < 32) {\n System.out.println(\"Dealer Wins.\");\n System.out.println(\"Total Winnings: \" + totalWinnings + \"\\n\");\n p1.subPointCount(betNum);\n }\n }", "public static void checkResult() {\n\t\tint sum = PlayerBean.PLAYERONE - PlayerBean.PLAYERTWO;\n\n\t\tif (sum == 1 || sum == -2) {\n\t\t\tScoreBean.addWin();\n\t\t\tresult = \"player one wins\";\n\t\t} else {\n\t\t\tScoreBean.addLoss();\n\t\t\tresult = \"player two wins\";\n\t\t}\n\t}", "private void gameHelper(int ranNum){\n\t\tif(questionAnsweredCount>=25){\n\t\t\treturn;\n\t\t}\n\t\tSystem.out.println(\"It is \" + teams[ranNum].getName() + \"'s turn to choose a question\");\n\t\t//find category\n\t\tSystem.out.println(\"Please choose a category you would like to answer: \");\n\t\tint categoryIdx = getCategory();\n\t\t//find points\n\t\tSystem.out.println(\"Please enter the dollar value of the question you wish to answer\");\n\t\tint pointIdx = getPointsIndex();\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t//now check if the question is answer knowing dollar and cat is valid\n\t\tboolean answered = board[categoryIdx][pointIdx].answeredYet();\n\t\tif(!answered){\n\t\t\tint point = points[pointIdx];\n\t\t\tSystem.out.println(board[categoryIdx][pointIdx].getQeustion());\n\t\t\tSystem.out.println(\"Enter your answer. Remember to pose it as a question.\");\n\t\t\tString ans = sc.nextLine();\n\t\t\treadExitCommand(ans); // check if the user wants to exit any point\n\t\t\treadReplayCommand(ans);\n\t\t\tboard[categoryIdx][pointIdx].answerQuestion(ans); //ask Q\n\t\t\tif(!board[categoryIdx][pointIdx].getRight()&&board[categoryIdx][pointIdx].getWarned()){\n\t\t\t\t//not in question format. give one more chance\n\t\t\t\tans = sc.nextLine();\n\t\t\t\treadExitCommand(ans);\n\t\t\t\treadReplayCommand(ans);\n\t\t\t\tboard[categoryIdx][pointIdx].answerQuestion(ans);\n\t\t\t}\n\t\t\tif(board[categoryIdx][pointIdx].getRight()){\n\t\t\t\tSystem.out.println(\"You answered it right! \" + point + \" will be added to your total\");\n\t\t\t\tquestionAnsweredCount+= 10;\n\t\t\t\tteams[ranNum].addDollars(point);\n\t\t\t\tprintDollars();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"Wrong Answer!\");\n\t\t\t\tquestionAnsweredCount++; \n\t\t\t\tteams[ranNum].minusDollars(point);\n\t\t\t\tprintDollars();\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"Question already answered. Choose it again\");\n\t\t\tgameHelper(ranNum); //same team choose a question again\n\t\t}\n\t\tint nextIdx = (ranNum+1)%(teams.length);\n\t\tgameHelper(nextIdx);\n\t}", "public void countScore(TechnicalTest technicalTest)\n {\n long maxScore=0;\n long score=0;\n\n String scoreEachAnswer = \"\";\n List<Problem> problems = technicalTest.getProblems();\n\n String applicantAnswer = technicalTest.getApplicantAnswer();\n\n List<String> answerList = helper.parseAnswer(applicantAnswer);\n\n for(int i=0; i<problems.size();i++){\n long tmpScore;\n maxScore = maxScore + problems.get(i).getMaxScore();\n if(problems.get(i) instanceof MultipleChoices){\n tmpScore = getScoreMultipleChoices((MultipleChoices) problems.get(i), answerList.get(i));\n score = score + tmpScore;\n if(i!=problems.size()-1)\n scoreEachAnswer = scoreEachAnswer + String.valueOf(tmpScore) + \"|\";\n else scoreEachAnswer = scoreEachAnswer + String.valueOf(tmpScore);\n }\n else if(problems.get(i) instanceof ProblemGenerator){\n tmpScore = getScoreMultipleChoices((MultipleChoices) problems.get(i), answerList.get(i));\n score = score + tmpScore;\n if(i!=problems.size()-1)\n scoreEachAnswer = scoreEachAnswer + String.valueOf(tmpScore) + \"|\";\n else scoreEachAnswer = scoreEachAnswer + String.valueOf(tmpScore);\n }\n else{\n tmpScore = getScoreEssay((Essay) problems.get(i), answerList.get(i));\n score = score + tmpScore;\n if(i!=problems.size()-1)\n scoreEachAnswer = scoreEachAnswer + String.valueOf(tmpScore) + \"|\";\n else scoreEachAnswer = scoreEachAnswer + String.valueOf(tmpScore);\n }\n\n }\n\n long persen = score*100/maxScore;\n\n technicalTest.setScore(persen);\n technicalTest.setScoreEachAnswer(scoreEachAnswer);\n\n technicalTestRepository.save(technicalTest);\n\n }", "public static void main(String[] args) {\n\t\tint score = 0;\n\t\t// 2. Ask the user a question \n\t\tString answer = JOptionPane.showInputDialog(\"Who is the greatest basketball player of all time?\");\n\t\t// 3. Use an if statement to check if their answer is correct\n\t\tif (answer.equalsIgnoreCase(\"Michael Jordan\") || answer.equalsIgnoreCase(\"Jordan\") ) {\n\t\t// 4. if the user's answer was correct, add one to their score \n\t\t\tscore = score + 1; }\n\t\t// 5. Create more questions by repeating steps 1, 2, and 3 below. \n\t\tanswer = JOptionPane.showInputDialog(\"How many rings does Michael Jordan have?\");\n\t\tif (answer.equalsIgnoreCase(\"6\") || answer.equalsIgnoreCase(\"six\") ) {\n\t\tscore = score + 1; \n\t\t}\n\t\tanswer = JOptionPane.showInputDialog(\"What player scored the most points in one game?\");\n\t\tif (answer.equalsIgnoreCase(\"Wilt Chamberlain\")) {\n\t\tscore = score + 1;\n\t\t}\n\t\tanswer = JOptionPane.showInputDialog(\"Who won the most career NBA championships as a player?\");\n\t\tif (answer.equalsIgnoreCase(\"Bill Russell\")) {\n\t\tscore = score + 1;\n\t\t}\n\t\tanswer = JOptionPane.showInputDialog(\"What team drafted Kobe Brayant?\");\n\t\tif (answer.equalsIgnoreCase(\"Charlotte Hornets\") || answer.equalsIgnoreCase(\"Hornets\") ) {\n\t\tscore = score + 1;\n\t\t}\n\t\tanswer = JOptionPane.showInputDialog(\"Who is the shortest player of all-time?\");\n\t\tif (answer.equalsIgnoreCase(\"Muggsy Bogues\") || answer.equalsIgnoreCase(\"Tyrone Bogues\") ) {\n\t\tscore = score + 1;\n\t\t}\n\t\t// 6. After all the questions have been asked, print the user's score\n\t\tJOptionPane.showMessageDialog(null, \"You scored \" + score + \".\");\n\t\t\n\t}", "public void checkScore() {\n\n whatIsTurnScore();\n\n if (turn == 1) {\n\n if ((p1.getScore() - turnScore < 0) || (p1.getScore() - turnScore == 1)) {\n newScore.setText(null);\n\n displayScore();\n\n\n Toast.makeText(this, \"Bust\", Toast.LENGTH_SHORT).show();\n } else if (p1.getScore() - turnScore > 1) {\n if ((turnScore > 99) && (turnScore < 140)) {\n p1.setHundres(p1.getHundres() + 1);\n } else if ((turnScore > 139) && (turnScore < 180)) {\n p1.setOneforties(p1.getOneforties() + 1);\n } else if (turnScore == 180) {\n p1.setOneeighties(p1.getOneeighties() + 1);\n }\n calculateScore();\n\n\n displayScore();\n } else if (p1.getScore() - turnScore == 0) {\n p1.setScore(0);\n }\n }\n\n if (turn == 2) {\n if ((p2.getScore() - turnScore < 0) || (p2.getScore() - turnScore == 1)) {\n newScore.setText(null);\n teamBCheckout.setText(checkOut(p2.getScore()));\n displayScore();\n\n\n Toast.makeText(this, \"Bust\", Toast.LENGTH_SHORT).show();\n } else if (p2.getScore() - turnScore > 1) {\n\n if ((turnScore > 99) && (turnScore < 140)) {\n p2.setHundres(p2.getHundres() + 1);\n } else if ((turnScore > 139) && (turnScore < 180)) {\n p2.setOneforties(p2.getOneforties() + 1);\n } else if (turnScore == 180) {\n p2.setOneeighties(p2.getOneeighties() + 1);\n }\n calculateScore();\n\n displayScore();\n\n } else if (p2.getScore() - turnScore == 0) {\n p2.setScore(0);\n }\n\n }\n\n\n }", "public String countScore() {\n String str =\"\";\n System.out.println(\"Game has ended\");\n int playerOneCount = 0;\n int playerTwoCount = 0;\n System.out.println(\"this is size of computer board\" + player2.playerTwoDomino.size());\n System.out.println(\"this is size of boneyard \" + allElements.size());\n System.out.println(\"this is size of human board \" + human1.playerOneDomino.size());\n System.out.println(\"this is size of game board \" + gameBoard.size());\n for (int i = 0; i < human1.playerOneDomino.size(); i++) {\n playerOneCount = playerOneCount + human1.playerOneDomino.get(i).getX() + human1.playerOneDomino.get(i).getX();\n }\n for (int j = 0; j < player2.playerTwoDomino.size(); j++) {\n playerTwoCount = playerTwoCount + player2.playerTwoDomino.get(j).getX() + player2.playerTwoDomino.get(j).getY();\n }\n\n if (playerOneCount < playerTwoCount) {\n str = \"Winner is Human by \" + (playerTwoCount - playerOneCount) + \" points\";\n\n\n } else {\n str = \"Winner is Computer by \" + (playerOneCount - playerTwoCount) + \" points\";\n\n }\n\n return str;\n }", "public void submitAnswers(View view) {\n\n //Initializing the correct answers in RadioGroups\n questionOneAnswerThree = findViewById(R.id.questionOneAnswerThreeButton);\n questionTwoAnswerFour = findViewById(R.id.questionTwoAnswerFourButton);\n questionThreeAnswerOne = findViewById(R.id.questionThreeAnswerOneButton);\n questionFourAnswerTwo = findViewById(R.id.questionFourAnswerTwoButton);\n questionFiveAnswerFour = findViewById(R.id.questionFiveAnswerFourButton);\n questionSixAnswerTwo = findViewById(R.id.questionSixAnswerTwoButton);\n questionSevenAnswerOne = findViewById(R.id.questionSevenAnswerOneButton);\n\n //Calculating score questions 1-7\n if (questionOneAnswerThree.isChecked()) {\n score++;\n }\n\n if (questionTwoAnswerFour.isChecked()) {\n score++;\n }\n\n if (questionThreeAnswerOne.isChecked()) {\n score++;\n }\n\n if (questionFourAnswerTwo.isChecked()) {\n score++;\n }\n\n if (questionFiveAnswerFour.isChecked()) {\n score++;\n }\n\n if (questionSixAnswerTwo.isChecked()) {\n score++;\n }\n\n if (questionSevenAnswerOne.isChecked()) {\n score++;\n }\n\n // +1 for correct answer\n if (questionEightAnswer.getText().toString().equals(\"1999\")) {\n score++;\n }\n\n //Calculating score if 3 correct answers are checked and 1 incorrect answer is unchecked\n if (questionNineAnswerOne.isChecked() && questionNineAnswerTwo.isChecked() && !questionNineAnswerThree.isChecked() && questionNineAnswerFour.isChecked()) {\n score++;\n }\n\n if (!questionTenAnswerOne.isChecked() && questionTenAnswerTwo.isChecked() && questionTenAnswerThree.isChecked() && questionTenAnswerFour.isChecked()) {\n score++;\n }\n\n //Toast message with score\n Toast.makeText(this, \"Your score: \" + score + \" out of 10 correct!\", Toast.LENGTH_LONG).show();\n\n score = 0;\n }", "public abstract void scoreAnswer(Question q, Answer answer, JCas jcas);", "public void phaseTwoCheck() {\r\n String guess = phaseTwoAnswer.toString();\r\n int length = guess.length();\r\n\r\n // check if valid word\r\n if (length >= 3) { // check if the length of the word is >= 3\r\n if (dictionary.contains(guess.toLowerCase())) { // check if the dictionary contains the word\r\n mSoundPool.play(mSoundCorrect, mVolume, mVolume, 1, 0, 1f); // chime when correct\r\n // set amount of points\r\n int bonus = 0;\r\n for (char c : guess.toCharArray()) {\r\n if (c == 'E' || c == 'A' || c == 'I' || c == 'O' || c == 'N' || c == 'R' || c == 'T' || c == 'L' || c == 'S') {\r\n pointsScore += 1; // bonus for x, y, or z in word\r\n } else if (c == 'D' || c == 'G') {\r\n pointsScore += 2;\r\n } else if (c == 'B' || c == 'C' || c == 'M' || c == 'P') {\r\n pointsScore += 3;\r\n } else if (c == 'F' || c == 'H' || c == 'V' || c == 'W' || c == 'Y') {\r\n pointsScore += 4;\r\n } else if (c == 'K') {\r\n pointsScore += 5;\r\n } else if (c == 'J' || c == 'X') {\r\n pointsScore += 8;\r\n } else {\r\n pointsScore += 10;\r\n }\r\n }\r\n if (length == 9 && phase == 1) bonus += length; // bonus for 9 letter word during phase 1\r\n pointsScore += (length + bonus) * 2; // calculate total score\r\n scoreBoard.setText(\"\"+pointsScore); // set scoreboard to total\r\n timer.cancel();\r\n timer.onFinish();\r\n }\r\n } else {\r\n mSoundPool.play(mSoundIncorrect, mVolume, mVolume, 1, 0, 1f); // quack when incorrect\r\n pointsScore -= 3; // penalize for submitting an incorrect word\r\n scoreBoard.setText(\"\"+pointsScore); // set scoreboard to total\r\n }\r\n }", "long getScore();", "long getScore();", "long getScore();", "long getScore();", "int getScoresCount();", "public static void calculateScore(){\n boolean gameOver = false;\n int score = 3000;\n int levelCompleted = 8;\n int bonus = 200;\n\n System.out.println(\"Running method calculateScore: \");\n\n if(score < 4000){\n int finalScore = score + (levelCompleted*bonus);\n System.out.println(\"Your final score = \" + finalScore);\n }else{\n System.out.println(\"The game is still on\");\n }\n\n System.out.println(\"Exit method calculateScore--\\n\");\n }", "@Override\r\n\tpublic void checkAnswer() {\n\t\t\r\n\t}", "public static void displayScore(final Quiz quiz) {\n\t\tint qNumber = 0;\n\t\tint totScore = 0;\n\t\tfor (question q : quiz.getQList()) {\n\t\t\tSystem.out.println(q.qText);\n\t\t\tif (q.corrChoice.equals(quiz.getAnswers(qNumber))) {\n\t\t\t\tSystem.out.println(\" Correct Answer! - Marks Awarded: \" + q.maxMarks);\n\t\t\t\ttotScore += Integer.parseInt(q.maxMarks);\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\" Wrong Answer! - Penalty: \" + q.penalty);\n\t\t\t\ttotScore += Integer.parseInt(q.penalty);\n\t\t\t}\n\t\t\tqNumber += 1;\n\t\t}\n\t\tSystem.out.println(\"Total Score: \" + totScore);\n\t}", "public int score(){\r\n\t\t//to be implemented: should return game score \r\n\t\tfor(int i=0; i<10; i++)\r\n\t\t{\r\n\t\t\tscore= frames.get(i).score();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn score + bonusGame;\r\n\t}", "public int totalScore() {\n return 0;\n }", "public void checkAnswer(){\n int selectedRadioButtonId = radioTermGroup.getCheckedRadioButtonId();\n\n // find the radiobutton by returned id\n RadioButton radioSelected = findViewById(selectedRadioButtonId);\n\n String term = radioSelected.getText().toString();\n String definition = tvDefinition.getText().toString();\n\n if (Objects.equals(termsAndDefinitionsHashMap.get(term), definition)) {\n correctAnswers += 1;\n Toast.makeText(ActivityQuiz.this, \"Correct\", Toast.LENGTH_SHORT).show();\n }\n else {\n Toast.makeText(ActivityQuiz.this, \"Incorrect\", Toast.LENGTH_SHORT).show();\n }\n\n tvCorrectAnswer.setText(String.format(\"%s\", correctAnswers));\n }", "private String submitAnswersScore(int calculatedScore) {\n String totalMessagePerfect = \"Great Job! You finished with a score of \" + calculatedScore + \" out of 6!\";\n totalMessagePerfect += \"\\nYou really know your Bears history!\";\n totalMessagePerfect += \"\\nThanks for taking my quiz!\";\n\n String totalMessageAlmost = \"Great Try! You finished with a score of \" +calculatedScore + \" out of 6.\";\n totalMessageAlmost += \"\\nThanks for taking my quiz!\";\n\n if (calculatedScore == 6) {\n return totalMessagePerfect;\n }\n else {\n return totalMessageAlmost;\n }\n }", "public void checkAnswerOne() {\n RadioGroup ans1 = findViewById(R.id.radio_gr_q1);\n int radioButtonId = ans1.getCheckedRadioButtonId();\n\n if (radioButtonId == R.id.a2_q1) {\n points++;\n }\n }", "protected abstract void calcScores();", "public double testQuiz(Quiz quiz) {\n\t\t// System.out.println(\"Testing quiz: \" + quiz + \"\\n\" +\n\t\t// quiz.display() + \"\\nwith QuizTester: \" + id\n\t\t// + \" SearchString: \" + searchString);\n\t\tdouble score = 0;\n\t\tfor (Question question : quiz.getQuestionList()) {\n\t\t\tboolean guess = question.getPrompt().contains(searchString);\n\t\t\tif (question.isAnswer() == guess) {\n\t\t\t\t++score;\n\t\t\t}\n\t\t}\n\t\t// System.out.println(\"Completed testing quiz: \" + quiz + \"\\nFinal Score: \" +\n\t\t// score + \" / \" + quiz.getQuestionList().size() + \" AKA: \" + (score /\n\t\t// quiz.getQuestionList().size()) );\n\t\treturn score / quiz.getQuestionList().size();\n\t}", "public void submitQuiz(View view) {\n\n if(parentKiller()) {\n question1 = 1;\n } else{\n question1 = 0;\n }\n\n if(jokerKills()) {\n question2 = 1;\n } else {\n question2 = 0;\n }\n\n if (batCity()) {\n question3 = 1;\n } else {\n question3 = 0;\n }\n\n if (checkboxQuestion()) {\n question4 = 1;\n } else {\n question4 = 0;\n }\n\n if (nameEntry()) {\n question5 = 1;\n } else {\n question5 = 0;\n }\n\n correctPoints = question1 + question2 + question3 + question4 + question5;\n\n Toast toastScore = Toast.makeText(getApplicationContext(), \"You scored \" + correctPoints + \" points!\", Toast.LENGTH_SHORT);\n toastScore.show();\n }", "void scoreQuestion(int questionNumber){\r\n switch(questionNumber){\r\n case 1:\r\n RadioButton radioButtonQ1 = (RadioButton) findViewById(R.id.soccer_question_1_correct_answer);\r\n if (radioButtonQ1.isChecked()){\r\n playerScore += 10;\r\n }\r\n break;\r\n case 2:\r\n CheckBox checkBoxQ2 = (CheckBox) findViewById(R.id.soccer_question_2_wrong_answer_1);\r\n if(checkBoxQ2.isChecked()){\r\n return;\r\n }\r\n checkBoxQ2 = (CheckBox) findViewById(R.id.soccer_question_2_wrong_answer_2);\r\n if(checkBoxQ2.isChecked()){\r\n return;\r\n }\r\n checkBoxQ2 = (CheckBox) findViewById(R.id.soccer_question_2_correct_answer_1);\r\n if(checkBoxQ2.isChecked()){\r\n playerScore += 5;\r\n }\r\n checkBoxQ2 = (CheckBox) findViewById(R.id.soccer_question_2_correct_answer_2);\r\n if(checkBoxQ2.isChecked()){\r\n playerScore += 5;\r\n }\r\n break;\r\n case 3:\r\n RadioButton radioButtonQ3 = (RadioButton) findViewById(R.id.soccer_question_3_correct_answer);\r\n if (radioButtonQ3.isChecked()){\r\n playerScore += 10;\r\n }\r\n break;\r\n case 4:\r\n RadioButton radioButtonQ4 = (RadioButton) findViewById(R.id.basketball_question_1_correct_answer);\r\n if (radioButtonQ4.isChecked()){\r\n playerScore += 10;\r\n }\r\n break;\r\n case 5:\r\n RadioButton radioButtonQ5 = (RadioButton) findViewById(R.id.basketball_question_2_correct_answer);\r\n if (radioButtonQ5.isChecked()){\r\n playerScore += 10;\r\n }\r\n break;\r\n case 6:\r\n EditText editTextQ6 = (EditText) findViewById(R.id.basketball_question_3);\r\n String answerQ6 = getString(R.string.basketball_question_3_correct_answer);\r\n if(answerQ6.equalsIgnoreCase(editTextQ6.getText().toString())){\r\n playerScore += 10;\r\n }\r\n break;\r\n case 7:\r\n RadioButton radioButtonQ7 = (RadioButton) findViewById(R.id.volleyball_question_1_correct_answer);\r\n if (radioButtonQ7.isChecked()){\r\n playerScore += 10;\r\n }\r\n break;\r\n case 8:\r\n RadioButton radioButtonQ8 = (RadioButton) findViewById(R.id.volleyball_question_2_correct_answer);\r\n if (radioButtonQ8.isChecked()){\r\n playerScore += 10;\r\n }\r\n break;\r\n case 9:\r\n RadioButton radioButtonQ9 = (RadioButton) findViewById(R.id.tenis_question_1_correct_answer);\r\n if (radioButtonQ9.isChecked()){\r\n playerScore += 10;\r\n }\r\n break;\r\n case 10:\r\n EditText editTextQ10 = (EditText) findViewById(R.id.boxe_question_1);\r\n String answerQ10 = getString(R.string.boxe_question_1_correct_answer);\r\n if(answerQ10.equalsIgnoreCase(editTextQ10.getText().toString())){\r\n playerScore += 10;\r\n }\r\n break;\r\n default:\r\n break;\r\n }\r\n }", "public static void score() {\n\t\tSystem.out.println(\"SCORE: \");\n\t\tSystem.out.println(player1 + \": \" + score1);\n\t\tSystem.out.println(player2 + \": \" + score2);\n\t}", "public void updatescore() {\n scorelabel.setText(\"\" + score + \" points\");\n if (100 - score <= 10) win();\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 }", "static int SetScore(int p){\n\t\tif (p==1) {\n\t\t\tp1Score=p1Score+4;\n\t\t\tlblp1Score.setText(Integer.toString(p1Score));\n\t\t\t\n\t\t\t//check whether the score reaches to destination score or not..........\n\t\t\t\n\t\t\tif(p1Score>=destinationScore){\n\t\t\t\tfrmCardGame.dispose();\n\t\t\t\tnew EndGame(p,p1Score,destinationScore).setVisible(true);\n\t\t\t}\n\t\t}\n\t\telse if(p==2){\n\t\t\tp2Score=p2Score+4;\n\t\t\tlblp2Score.setText(Integer.toString(p2Score));\n\t\t\t\n\t\t\tif(p2Score>=destinationScore){\n\t\t\t\tfrmCardGame.dispose();\n\t\t\t\tnew EndGame(p,p2Score,destinationScore).setVisible(true);\n\t\t\t}\n\t\t}\n\t\telse if(p==3){\n\t\t\tp3Score=p3Score+4;\n\t\t\tlblp3Score.setText(Integer.toString(p3Score));\n\t\t\t\n\t\t\tif(p3Score>=destinationScore){\n\t\t\t\tfrmCardGame.dispose();\n\t\t\t\tnew EndGame(p,p3Score,destinationScore).setVisible(true);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tp4Score=p4Score+4;\n\t\t\tlblp4Score.setText(Integer.toString(p4Score));\n\t\t\t\n\t\t\tif(p4Score>=destinationScore){\n\t\t\t\tfrmCardGame.dispose();\n\t\t\t\tnew EndGame(p,p4Score,destinationScore).setVisible(true);\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "private int calculateScore(){\n int score = 0;\n for(Card card : hand){\n score += card.getScore();\n }\n return score;\n }", "abstract void handleTheScore(ArrayList<Player> players, Question question);", "private void showGameScore() {\n System.out.println(messageProvider.provideMessage(\"score\"));\n System.out.println(settings.getPlayers().get(0).getScore()\n + \" vs \" + settings.getPlayers().get(1).getScore());\n }", "private void rightAnswerButtonOnClick()\r\n {\r\n //if the button clicked has the correct answer, then do the following;\r\n\r\n yesMPlayer.start();\r\n updateQuestion();\r\n\r\n Toast.makeText(getApplicationContext(), \"CORRECT!\", Toast.LENGTH_SHORT).show();\r\n\r\n score += 100;\r\n scoreEditText.setText(score + \"\");\r\n\r\n streak += 1;\r\n streakEditText.setText(streak + \"\");\r\n\r\n questionPos += 1;\r\n questionNoTV.setText(\"Question \" + noOfQuestion + \" of 10\");\r\n\r\n if (score == 1000) {\r\n newPlayer.insertPlayerStatsToDatabase(player, year, score + \"\", streak + \"\");\r\n //Toast.makeText(getApplicationContext(), \"OVERRRRRR\\t\" + score, Toast.LENGTH_SHORT).show();\r\n }\r\n }", "@Override\n\tpublic int getScore(ArrayList<String> ansList) {\n\t\tString ans = ansList.get(0);\n\t\tif (ans.matches(answer)) {\n\t\t\treturn score;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "private void scoreCounter(int playerName, int category, int score) {\n\t\t// firstly it will update the category score.\n\t\tdisplay.updateScorecard(category, playerName, score);\n\t\t// if the category is lower than upper score it means that player chose\n\t\t// one to six, and we calculate than the upper score.\n\t\tif (category < UPPER_SCORE) {\n\t\t\tupperScore[playerName] += score;\n\t\t\tdisplay.updateScorecard(UPPER_SCORE, playerName,\n\t\t\t\t\tupperScore[playerName]);\n\t\t\t// if the category is more than upper score it means that player\n\t\t\t// chose and we calculate than the lower score.\n\t\t} else if (category > UPPER_SCORE) {\n\t\t\tlowerScore[playerName] += score;\n\t\t\tdisplay.updateScorecard(LOWER_SCORE, playerName,\n\t\t\t\t\tlowerScore[playerName]);\n\t\t}\n\t\t// here we calculate total score by summing upper and lower scores.\n\t\ttotalScore[playerName] = upperScore[playerName]\n\t\t\t\t+ lowerScore[playerName];\n\t\t// if upper score is more than 63 it means player got the bonus.\n\t\tif (upperScore[playerName] >= 63) {\n\t\t\tdisplay.updateScorecard(UPPER_BONUS, playerName, 63);\n\t\t\t// we plus that bonus to total score.\n\t\t\ttotalScore[playerName] += 63;\n\t\t} else {\n\t\t\t// if upper score is lower than 63 it means player didn't get bonus,\n\t\t\t// and it means that bonus=0.\n\t\t\tdisplay.updateScorecard(UPPER_BONUS, playerName, 0);\n\t\t}\n\t\t// and finally we display total score.\n\t\tdisplay.updateScorecard(TOTAL, playerName, totalScore[playerName]);\n\t}", "public int returnPoints()\n {\n return score ;\n }", "public int getTotalScore(){\r\n return totalScore;\r\n }", "public void addScore(){\n\n // ong nuoc 1\n if(birdS.getX() == waterPipeS.getX1() +50){\n bl = true;\n }\n if (bl == true && birdS.getX() > waterPipeS.getX1() + 50){\n score++;\n bl = false;\n }\n\n //ong nuoc 2\n if(birdS.getX() == waterPipeS.getX2() +50){\n bl = true;\n }\n if (bl == true && birdS.getX() > waterPipeS.getX2() + 50){\n score++;\n bl = false;\n }\n\n // ong nuoc 3\n if(birdS.getX() == waterPipeS.getX3() +50){\n bl = true;\n }\n if (bl == true && birdS.getX() > waterPipeS.getX3() + 50){\n score++;\n bl = false;\n }\n\n }", "private void doMatch() {\n // Remember how many games in this session\n mGameCounter++;\n\n PebbleDictionary resultDict = new PebbleDictionary();\n\n switch (mChoice) {\n case Keys.CHOICE_ROCK:\n switch(mP2Choice) {\n case Keys.CHOICE_ROCK:\n mInstructionView.setText(\"It's a tie!\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_TIE);\n break;\n case Keys.CHOICE_PAPER:\n mInstructionView.setText(\"You lose!\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_WIN); // Inform Pebble of opposite result\n break;\n case Keys.CHOICE_SCISSORS:\n mWinCounter++;\n mInstructionView.setText(\"You win! (\" + mWinCounter + \" of \" + mGameCounter + \")\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_LOSE);\n break;\n }\n break;\n case Keys.CHOICE_PAPER:\n switch(mP2Choice) {\n case Keys.CHOICE_ROCK:\n mWinCounter++;\n mInstructionView.setText(\"You win! (\" + mWinCounter + \" of \" + mGameCounter + \")\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_LOSE);\n break;\n case Keys.CHOICE_PAPER:\n mInstructionView.setText(\"It's a tie!\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_TIE);\n break;\n case Keys.CHOICE_SCISSORS:\n mInstructionView.setText(\"You lose!\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_WIN);\n break;\n }\n break;\n case Keys.CHOICE_SCISSORS:\n switch(mP2Choice) {\n case Keys.CHOICE_ROCK:\n mInstructionView.setText(\"You lose!\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_WIN);\n break;\n case Keys.CHOICE_PAPER:\n mWinCounter++;\n mInstructionView.setText(\"You win! (\" + mWinCounter + \" of \" + mGameCounter + \")\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_LOSE);\n break;\n case Keys.CHOICE_SCISSORS:\n mInstructionView.setText(\"It's a tie!\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_TIE);\n break;\n }\n break;\n }\n\n // Inform Pebble of result\n PebbleKit.sendDataToPebble(getApplicationContext(), APP_UUID, resultDict);\n\n // Finally reset both\n mChoice = Keys.CHOICE_WAITING;\n mP2Choice = Keys.CHOICE_WAITING;\n\n // Leave announcement for 5 seconds\n mHandler.postDelayed(new Runnable() {\n\n @Override\n public void run() {\n updateUI();\n }\n\n }, 5000);\n }", "public static void main(String[] args) {\n\t\tint score = 0;\n\n\t\t// 3. Ask the user a riddle. Here are some ideas: bit.ly/some-riddles\n\t\tString answer1 = JOptionPane.showInputDialog(\"What gets wetter and wetter the more it dries?\");\n\n\t\t// 4. If they got the answer right, pop up \"correct!\" and increase the score by one\n\t\t// 5. Otherwise, say \"wrong\" and tell them the answer\n\t\tif (answer1.equals(\"towel\")) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Correct!\");\n\t\t\tscore++;\n\t\t} else {\n\t\t\tJOptionPane.showMessageDialog(null, \"Wrong! The correct answer is: towel.\");\n\t\t}\n\n\t\t// 6. Add some more riddles\n\n\t\tString answer2 = JOptionPane.showInputDialog(\"What kind of room has no doors or windows?\");\n\n\t\tif (answer2.equals(\"mushroom\")) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Correct!\");\n\t\t\tscore++;\n\t\t} else {\n\t\t\tJOptionPane.showMessageDialog(null, \"Wrong! The correct answer is: mushroom.\");\n\t\t}\n\n\t\tString answer3 = JOptionPane.showInputDialog(\"Which word in the dictionary is spelled incorrectly?\");\n\n\t\tif (answer3.equals(\"incorrectly\")) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Correct!\");\n\t\t\tscore++;\n\t\t} else {\n\t\t\tJOptionPane.showMessageDialog(null, \"Wrong! The correct answer is: incorrectly.\");\n\t\t}\n\n\t\tString answer4 = JOptionPane.showInputDialog(\"What invention lets you look right through a wall?\");\n\n\t\tif (answer4.equals(\"window\")) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Correct!\");\n\t\t\tscore++;\n\t\t} else {\n\t\t\tJOptionPane.showMessageDialog(null, \"Wrong! The correct answer is: window.\");\n\t\t}\n\n\t\tString answer5 = JOptionPane.showInputDialog(\"What has a neck but no head?\");\n\n\t\tif (answer5.equals(\"bottle\")) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Correct!\");\n\t\t\tscore++;\n\t\t} else {\n\t\t\tJOptionPane.showMessageDialog(null, \"Wrong! The correct answer is: bottle.\");\n\t\t}\n\n\t\t// 2. Make a pop up to show the score.\n\t\tJOptionPane.showMessageDialog(null, \"Your score is: \" + score);\n\n\t}", "public int getHomeScore();", "private void calculateScoreForEditTextAnswers(String questionOne, String questionFive , String questionNine) {\n // Get the real answer of questions 1, 5 and 9 stored in strings.xml\n String answer1 = getString(R.string.answer1);\n String answer5 = getString(R.string.answer5);\n String answer9 = getString(R.string.answer9);\n\n // if answer entered for question 1 is correct, update the value of score and add 3.\n\n if(questionOne.trim().equalsIgnoreCase(answer1)) {\n score +=5;\n }\n // if answer entered for question 5 is correct, update the value of score and add 3.\n if (questionFive.trim().equalsIgnoreCase(answer5)) {\n score += 5;\n }\n // if answer entered for question 9 is correct, update the value of score and add 3..\n if (questionNine.trim().equalsIgnoreCase(answer9)) {\n score += 5;\n }\n\n // calculate the total value of score\n }", "private void scoreDialog() {\n JPanel jp = new JPanel();\n \n Box verticalBox = Box.createVerticalBox();\n \n JLabel scoreTitle = new JLabel(\"<html><font size=13><center>Score: \" + challengeModel.getChallenge().getScore().getScorePoints() + \"</center></font></html>\");\n scoreTitle.setAlignmentX(CENTER_ALIGNMENT);\n verticalBox.add(scoreTitle);\n \n Box horizontalBox = Box.createHorizontalBox();\n String scoreResult = \"\" + challengeModel.getChallenge().getScore().getGold() + challengeModel.getChallenge().getScore().getSilver() + challengeModel.getChallenge().getScore().getBronze();\n switch(Integer.parseInt(scoreResult)) {\n case 111: // Gold, Silver, Bronze\n horizontalBox.add(new JLabel(Resources.getImageMedalGold()));\n case 11: // Silver, Bronze\n horizontalBox.add(new JLabel(Resources.getImageMedalSilver()));\n case 1: // Bronze\n horizontalBox.add(new JLabel(Resources.getImageMedalBronze()));\n break;\n default:\n break;\n }\n \n verticalBox.add(horizontalBox);\n \n jp.add(verticalBox);\n \n int value = JOptionPane.showOptionDialog(null, jp, \"Fim do desafio\", JOptionPane.NO_OPTION, JOptionPane.PLAIN_MESSAGE, null, new String[] {\"Novo Desafio\"}, 1);\n \n hideAnswerResult(false);\n \n if (value == 0)\n challengeModel.newGame();\n }", "public int getPlayerScore();", "public int getTotalScore(){\n return totalScore;\n }", "public int score() {\n return score;\n }", "public static int getScore()\n {\n return score;\n }", "float getScore();", "float getScore();", "public void submitAnswers(View view) {\n\n // Question one\n // Get String given in the first EditText field and turn it into lower case\n EditText firstAnswerField = (EditText) findViewById(R.id.answer_one);\n Editable firstAnswerEditable = firstAnswerField.getText();\n String firstAnswer = firstAnswerEditable.toString().toLowerCase();\n\n // Check if the answer given in the first EditText field is correct and if it is, add one\n // point\n if (firstAnswer.contains(\"baltic\")) {\n points++;\n }\n\n // Question two\n // Get String given in the second EditText field and turn it into lower case\n EditText secondAnswerField = (EditText) findViewById(R.id.answer_two);\n Editable secondAnswerEditable = secondAnswerField.getText();\n String secondAnswer = secondAnswerEditable.toString().toLowerCase();\n\n // Check if the answer given in the second EditText field is correct and if it is, add one\n // point\n if (secondAnswer.contains(\"basketball\")) {\n points++;\n }\n\n // Question three\n // Check if the correct answer is given\n RadioButton thirdQuestionCorrectAnswer = (RadioButton)\n findViewById(R.id.question_3_radio_button_3);\n boolean isThirdQuestionCorrectAnswer = thirdQuestionCorrectAnswer.isChecked();\n // If the correct answer is given, add one point\n if (isThirdQuestionCorrectAnswer) {\n points++;\n }\n\n // Question four\n // Check if the correct answer is given\n RadioButton fourthQuestionCorrectAnswer = (RadioButton)\n findViewById(R.id.question_4_radio_button_2);\n boolean isFourthQuestionCorrectAnswer = fourthQuestionCorrectAnswer.isChecked();\n\n // If the correct answer is given, add one point\n if (isFourthQuestionCorrectAnswer) {\n points++;\n }\n\n // Question five\n // Find check boxes\n CheckBox fifthQuestionCheckBoxOne = (CheckBox) findViewById(R.id.question_5_check_box_1);\n\n CheckBox fifthQuestionCheckBoxTwo = (CheckBox) findViewById(R.id.question_5_check_box_2);\n\n CheckBox fifthQuestionCheckBoxThree = (CheckBox) findViewById(R.id.question_5_check_box_3);\n\n CheckBox fifthQuestionCheckBoxFour = (CheckBox) findViewById(R.id.question_5_check_box_4);\n\n // If correct answers are given, add one point,\n // if incorrect answers are given, do not add points\n\n if (fifthQuestionCheckBoxThree.isChecked() && fifthQuestionCheckBoxFour.isChecked()\n && !fifthQuestionCheckBoxOne.isChecked() && !fifthQuestionCheckBoxTwo.isChecked()){\n points++;\n }\n\n // Question six\n // Find check boxes\n CheckBox sixthQuestionCheckBoxOne = (CheckBox) findViewById(R.id.question_6_check_box_1);\n\n CheckBox sixthQuestionCheckBoxTwo = (CheckBox) findViewById(R.id.question_6_check_box_2);\n\n CheckBox sixthQuestionCheckBoxThree = (CheckBox) findViewById(R.id.question_6_check_box_3);\n\n CheckBox sixthQuestionCheckBoxFour = (CheckBox) findViewById(R.id.question_6_check_box_4);\n\n // If correct answers are given, add one point,\n // if incorrect answers are given, do not add points\n if (sixthQuestionCheckBoxOne.isChecked() && sixthQuestionCheckBoxTwo.isChecked()\n && sixthQuestionCheckBoxFour.isChecked() && !sixthQuestionCheckBoxThree.isChecked()){\n points++;\n }\n\n // If the user answers all questions correctly, show toast message with congratulations\n if (points == 6){\n Toast.makeText(this, \"Congratulations! You have earned 6 points.\" +\n \"\\n\" + \"It is the maximum number of points in this quiz.\",\n Toast.LENGTH_SHORT).show();\n }\n\n // If the user does not answer all questions correctly, show users's points, total points\n // possible and advise to check answers\n else {\n Toast.makeText(this, \"Your points: \" + points + \"\\n\" + \"Total points possible: 6\" +\n \"\\n\" + \"Check your answers or spelling again.\", Toast.LENGTH_SHORT).show();\n }\n\n // Reset points to 0\n points = 0;\n }", "public static void main(String[] args){\n Scanner keyboard = new Scanner(System.in);\n //declare variables for the answer, user's guess, and number fo guesses\n int answer;\n int guess;\n int numOfGuess = 0;\n \n boolean done = false;\n answer = (int)(100*Math.random())+1;\n \n //print an introduction that tells the user how to play this game\n System.out.println(\"Hello user! I will generate a number between 1-100 inclusive and you will try to guess it! I will tell you if your answer is too low or too high after each incorrect guess!\");\n do \n {\n System.out.print(\"Please enter your guess:\");\n guess = keyboard.nextInt();\n if (guess > answer){\n System.out.println(\"Too high!\");\n }\n else if( guess < answer){\n System.out.println(\"Too low!\");\n }\n else{\n done = true;\n }\n numOfGuess += 1;\n } while (done == false);\n \n System.out.println(\"Congratulations! You're score is \" + numOfGuess);\n if (numOfGuess >= 20){\n System.out.println(\"Rating: You are terrible at this game!\");\n }\n else if (numOfGuess >= 10 && numOfGuess <=19){\n System.out.println(\"Rating: You need more practice!\");\n }\n else if (numOfGuess >= 5 && numOfGuess <= 9){\n System.out.println(\"Rating: Not too bad, But can you get it in fewer than 5 guesses?\");\n }\n else if (numOfGuess >= 2 && numOfGuess <= 4){\n System.out.println(\"Rating: AWESOME. You win a trip to Hawaii!\");\n }\n else{\n System.out.println(\"Rating: That was pure LUCK and you know it!\");\n }\n \n }", "public int getAwayScore();", "public void calculateScores()\r\n {\r\n for(int i = 0; i < gameBoard.getBoardRows(); i++)\r\n for(int j = 0; j < gameBoard.getBoardCols(); j++)\r\n {\r\n if(gameBoard.tilePlayer(i,j) == 0)\r\n currentRedScore = currentRedScore + gameBoard.tileScore(i,j);\r\n if(gameBoard.tilePlayer(i,j) == 1)\r\n currentBlueScore = currentBlueScore + gameBoard.tileScore(i,j);\r\n }\r\n }" ]
[ "0.7496431", "0.7440643", "0.72333467", "0.7207126", "0.7206139", "0.7111497", "0.69787043", "0.69036585", "0.69011766", "0.69011766", "0.69002914", "0.6897225", "0.68864757", "0.6865306", "0.6836751", "0.6810332", "0.68055516", "0.68027353", "0.67964756", "0.6795791", "0.6782365", "0.67485934", "0.66741306", "0.6649342", "0.6640221", "0.66063416", "0.6600675", "0.65943116", "0.6578716", "0.65766066", "0.65730286", "0.6566141", "0.65514886", "0.654028", "0.65215397", "0.6509298", "0.6487271", "0.647288", "0.6467337", "0.645792", "0.645242", "0.6452381", "0.6442478", "0.643052", "0.64267427", "0.641825", "0.6409785", "0.640781", "0.63931406", "0.6384962", "0.63808227", "0.6371136", "0.6366928", "0.63635516", "0.6359711", "0.6359319", "0.6359319", "0.6359319", "0.6359319", "0.6358863", "0.63578326", "0.63558286", "0.6349479", "0.63393754", "0.6333711", "0.6331168", "0.63290393", "0.63259834", "0.6320573", "0.63172084", "0.63166064", "0.6300713", "0.6286146", "0.6285119", "0.62583435", "0.6250849", "0.6243127", "0.62377983", "0.623596", "0.6223641", "0.62220335", "0.6221333", "0.62203515", "0.621359", "0.62089014", "0.61832404", "0.61832255", "0.6182449", "0.6177634", "0.61672145", "0.6163013", "0.6161643", "0.61588156", "0.61580783", "0.61541325", "0.61541325", "0.6149892", "0.61496335", "0.61488837", "0.61475116" ]
0.70208555
6
Created by hugo on 1/22/16.
public interface SearchUserView { void showMessage(String message); void showProgressIndicator(); void hideProgressIndicator(); void showUsers(List<User> users); void startUserDetailsActivity(String username); Context getContext(); }
{ "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}", "@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}", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n public void func_104112_b() {\n \n }", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "private void poetries() {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "public void mo38117a() {\n }", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\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\tpublic void jugar() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "private void kk12() {\n\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "private void m50366E() {\n }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "public void mo4359a() {\n }", "private void init() {\n\n\t}", "private void strin() {\n\n\t}", "@Override\n public void init() {\n }", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\r\n\tpublic void init() {}", "@Override\n protected void initialize() {\n\n \n }", "@Override\n public void init() {}", "@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\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n void init() {\n }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\n protected void init() {\n }", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "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\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\tprotected void initialize() {\n\n\t}", "public void method_4270() {}", "@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\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tpublic void init() {\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "public void mo21877s() {\n }", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "public void mo6081a() {\n }", "public abstract void mo70713b();", "protected void mo6255a() {\n }", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n\t\tpublic void init() {\n\t\t}", "@Override\n public void initialize() { \n }", "public void mo55254a() {\n }" ]
[ "0.5952657", "0.5904876", "0.58965737", "0.5777314", "0.5701104", "0.5701104", "0.566421", "0.56508887", "0.5630734", "0.56237745", "0.5620713", "0.56109595", "0.56108606", "0.55940515", "0.55881554", "0.5575716", "0.55548257", "0.55482453", "0.5544936", "0.5538272", "0.55309725", "0.5530921", "0.5530921", "0.5530921", "0.5530921", "0.5530921", "0.5516905", "0.54921293", "0.5489885", "0.54724216", "0.54709476", "0.54706115", "0.54645234", "0.54645234", "0.5460151", "0.54517376", "0.5451118", "0.5436961", "0.54364127", "0.54345226", "0.54274756", "0.5418158", "0.5417856", "0.5403284", "0.53982264", "0.53875643", "0.5383967", "0.5382941", "0.5382819", "0.5382819", "0.5382819", "0.5382819", "0.5382819", "0.5382819", "0.53784055", "0.53741926", "0.5372082", "0.5372082", "0.5371096", "0.53696674", "0.5369228", "0.5369228", "0.5369228", "0.5358731", "0.5358731", "0.5358731", "0.5358731", "0.5358731", "0.5358731", "0.5358731", "0.5352156", "0.5352156", "0.5352156", "0.53503036", "0.5345404", "0.53453034", "0.53453034", "0.53453034", "0.5332612", "0.5321462", "0.5321462", "0.5316784", "0.53095734", "0.5306601", "0.5303734", "0.53002036", "0.528826", "0.52863926", "0.52695554", "0.52683324", "0.5262724", "0.52585185", "0.52557296", "0.5245768", "0.5245768", "0.52381605", "0.5234171", "0.5233166", "0.52179796", "0.5211262", "0.52108604" ]
0.0
-1
Test of encrypt method, of class Crypto.
@Test public void testEncrypt() throws Exception { System.out.println("encrypt"); String seed = ""; String cleartext = ""; String expResult = ""; String result = Crypto.encrypt(seed, cleartext); assertEquals(expResult, result); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n public void testEncrypt()\r\n {\r\n System.out.println(\"encrypt\");\r\n String input = \"Hello how are you?\";\r\n KeyMaker km = new KeyMaker();\r\n SecretKeySpec sks = new SecretKeySpec(km.makeKeyDriver(\"myPassword\"), \"AES\");\r\n EncyptDecrypt instance = new EncyptDecrypt();\r\n String expResult = \"0fqylTncsgycZJQ+J5pS7v6/fj8M/fz4bavB/SnIBOQ=\";\r\n String result = instance.encrypt(input, sks);\r\n assertEquals(expResult, result);\r\n }", "Encryption encryption();", "@Test\n\tpublic void doEncrypt() {\n\t\tString src = \"18903193260\";\n\t\tString des = \"9oytDznWiJfLkOQspiKRtQ==\";\n\t\tAssert.assertEquals(Encryptor.getEncryptedString(KEY, src), des);\n\n\t\t/* Encrypt some plain texts */\n\t\tList<String> list = new ArrayList<String>();\n\t\tlist.add(\"18963144219\");\n\t\tlist.add(\"13331673185\");\n\t\tlist.add(\"18914027730\");\n\t\tlist.add(\"13353260117\");\n\t\tlist.add(\"13370052053\");\n\t\tlist.add(\"18192080531\");\n\t\tlist.add(\"18066874640\");\n\t\tlist.add(\"15357963496\");\n\t\tlist.add(\"13337179174\");\n\t\tfor (String str : list) {\n\t\t\tSystem.out.println(Encryptor.getEncryptedString(KEY, str));\n\t\t}\n\t}", "@org.junit.Test\n public void testCipher() {\n Assert.assertEquals(\"DITISGEHEIM\", Vigenere.cipher(\"DITISGEHEIM\", \"A\", true));\n Assert.assertEquals(\"DITISGEHEIM\", Vigenere.cipher(\"DITISGEHEIM\", \"A\", false));\n\n Assert.assertEquals(\"B\", Vigenere.cipher(\"A\", \"B\", true));\n Assert.assertEquals(\"A\", Vigenere.cipher(\"B\", \"B\", false));\n\n String plain = \"DUCOFIJMA\";\n String key = \"ABC\";\n String shouldEncryptTo = \"DVEOGKJNC\";\n String actualEncrypted = Vigenere.cipher(plain, key, true);\n Assert.assertEquals(shouldEncryptTo, actualEncrypted);\n String decrypted = Vigenere.cipher(shouldEncryptTo, key, false);\n Assert.assertEquals(plain, decrypted);\n }", "@Test\n public void testAesEncryptForInputKey() throws Exception {\n byte[] key = Cryptos.generateAesKey();\n String input = \"foo message\";\n\n byte[] encryptResult = Cryptos.aesEncrypt(input.getBytes(\"UTF-8\"), key);\n String descryptResult = Cryptos.aesDecrypt(encryptResult, key);\n\n System.out.println(key);\n System.out.println(descryptResult);\n }", "@Test\r\n public void testEncryptDecryptPlaintext() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n byte[] add = \"Random authenticated additional data\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n CryptoDetached result = instance.encryptPlaintext(data, add, keys);\r\n String message = instance.decryptPlaintext(result, add, keys);\r\n assertEquals(message, \"Hola caracola\");\r\n }", "@Test\n\tpublic void testEncryptDecrypt() {\n\t\tfor (int i = 0; i < CONFIDENCE; ++i) {\n\t\t\tP plain = getRandomPlaintext();\n\t\t\tR rnd = getPK().getRandom(getRand());\n\t\t\tC cipher = getPK().encrypt(plain, rnd);\n\t\t\t\n\t\t\tP plain2 = getSK().decrypt(cipher);\n\t\t\t\n\t\t\tassertTrue(\"Decryption didn't work\", plain.equals(plain2));\n\t\t}\n\t}", "@Test\n public void testEncryptDecrypt3() throws InvalidCipherTextException {\n\n // password generation using KDF\n String password = \"Aa1234567890#\";\n byte[] kdf = Password.generateKeyDerivation(password.getBytes(), 32);\n\n byte[] plain = \"0123456789\".getBytes();\n byte[] plainBytes = new byte[100000000];\n for (int i = 0; i < plainBytes.length / plain.length; i++) {\n System.arraycopy(plain, 0, plainBytes, i * plain.length, plain.length);\n }\n\n byte[] encData = AESEncrypt.encrypt(plainBytes, kdf);\n byte[] plainData = AESEncrypt.decrypt(encData, kdf);\n\n assertArrayEquals(plainBytes, plainData);\n\n }", "public void testCaesar(){\n String msg = \"At noon be in the conference room with your hat on for a surprise party. YELL LOUD!\";\n \n /*String encrypted = encrypt(msg, key);\n System.out.println(\"encrypted \" +encrypted);\n \n String decrypted = encrypt(encrypted, 26-key);\n System.out.println(\"decrypted \" + decrypted);*/\n \n \n String encrypted = encrypt(msg, 15);\n System.out.println(\"encrypted \" +encrypted);\n \n }", "String encrypt(String input) throws IllegalArgumentException, EncryptionException;", "@Test\r\n public void testEncryptDecryptPlaintextBadCipher() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"\".getBytes();\r\n byte[] add = \"Random authenticated additional data\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n CryptoDetached result = instance.encryptPlaintext(data, add, keys);\r\n result.cipher = Base64.getEncoder().encodeToString(\"bad cipher\".getBytes());\r\n\r\n Assertions.assertThrows(SodiumException.class, () -> {\r\n instance.decryptPlaintext(result, add, keys);\r\n });\r\n }", "@Test\n public void testAesEncryptForInputKeyIv() throws Exception {\n//TODO: Test goes here... \n }", "@Test\n public void testDesEncrypt() {\n\n }", "public EncryptorReturn encrypt(String in) throws CustomizeEncryptorException;", "byte[] encrypt(String plaintext);", "public String encrypt(String plainText);", "@Test\r\n public void testEncryptDecryptPlaintextBadKey() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"\".getBytes();\r\n byte[] add = \"Random authenticated additional data\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n CryptoDetached result = instance.encryptPlaintext(data, add, keys);\r\n Keys keys1 = instance.createKeys(null);\r\n String message = instance.decryptPlaintext(result, add, keys);\r\n Assertions.assertThrows(SodiumException.class, new Executable() {\r\n @Override\r\n public void execute() throws Throwable {\r\n instance.decryptPlaintext(result, add, keys1);\r\n }\r\n });\r\n }", "@Test\r\n public void testEncryptDecryptPlaintextNull() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"\".getBytes();\r\n byte[] add = \"Random authenticated additional data\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n CryptoDetached result = instance.encryptPlaintext(data, add, keys);\r\n String message = instance.decryptPlaintext(result, add, keys);\r\n assertEquals(message, \"\");\r\n }", "@Test\n public void testDecrypt() throws Exception {\n System.out.println(\"decrypt\");\n String seed = \"\";\n String encrypted = \"\";\n String expResult = \"\";\n String result = Crypto.decrypt(seed, encrypted);\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 }", "@Test\r\n public void testEncrypt_decrypt_plaintext_bad_nonce() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"\".getBytes();\r\n byte[] add = \"Random authenticated additional data\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n CryptoDetached result = instance.encryptPlaintext(data, add, keys);\r\n result.nonce = Base64.getEncoder().encodeToString(\"bad nonce\".getBytes());\r\n Assertions.assertThrows(SodiumException.class, () -> {\r\n instance.decryptPlaintext(result, add, keys);\r\n });\r\n }", "public String encrypt() {\n StringBuilder encryptedText = new StringBuilder();\n //Make sure the key is valid.\n if (key < 0 || key > 25) {\n Log.d(\"TAG\", \"encrypt: Error in Keu=y \");\n return \"Key Must be 0 : 25\";\n }\n if (plaintext.length() <= 0) {\n Log.d(\"TAG\", \"encrypt: Error in Plain\");\n return \"Error in Plaintext\";\n }\n //Eliminates any whitespace and non alpha char's.\n plaintext = plaintext.trim();\n plaintext = plaintext.replaceAll(\"\\\\W\", \"\");\n if (plaintext.contains(\" \")) {\n plaintext = plaintext.replaceAll(\" \", \"\");\n }\n //Makes sure that all the letters are uppercase.\n plaintext = plaintext.toUpperCase();\n Log.i(\"Caesar\", \"encrypt: plainis : \" + plaintext);\n for (int i = 0; i < plaintext.length(); i++) {\n char letter = plaintext.charAt(i);\n if (charMap.containsKey(letter) && charMap.get(letter) != null) {\n int lookUp = (charMap.get(letter) + key) % 26;\n encryptedText.append(encryptionArr[lookUp]);\n }\n }\n Log.d(\"Caesar.java\", \"encrypt: the Data is \" + encryptedText.toString());\n return encryptedText.toString();\n }", "@Test\r\n public void testEncryptDecryptPlaintextBadAdd() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"\".getBytes();\r\n byte[] add = \"Random authenticated additional data\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n CryptoDetached result = instance.encryptPlaintext(data, add, keys);\r\n byte[] add1 = \"bad add\".getBytes();\r\n Assertions.assertThrows(SodiumException.class, () -> {\r\n instance.decryptPlaintext(result, add1, keys);\r\n });\r\n }", "@Test\r\n public void testEncryptDecryptPlaintextBadTag() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"\".getBytes();\r\n byte[] add = \"Random authenticated additional data\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n CryptoDetached result = instance.encryptPlaintext(data, add, keys);\r\n result.tag = Base64.getEncoder().encodeToString(\"bad tag\".getBytes());\r\n Assertions.assertThrows(SodiumException.class, () -> {\r\n instance.decryptPlaintext(result, add, keys);\r\n });\r\n }", "public void testCaesar(){\n int key1 = 23;\n int key2 = 17;\n String encrypted = encrypt(\"At noon be in the conference room with your hat on for a surprise party. YELL LOUD!\", 15);\n System.out.println(\"key is 15\" + \"\\n\" + encrypted);\n String encrypted2 = encryptTwoKeys(\"At noon be in the conference room with your hat on for a surprise party. YELL LOUD!\", 8, 21);\n System.out.println(\"key are 8 and 21\" + \"\\n\" + encrypted2);\n }", "public void test() {\n\t\ttry {\n\t\t\tString plainText = \"Sensitive information\";\n\t\t\tint keySize = 128;\n\t\t\t// Generate a key for AES\n\t\t\tKeyGenerator keygenerator = KeyGenerator.getInstance(\"AES\");\n\t\t\tkeygenerator.init(keySize);\n\t\t\tSecretKey key = keygenerator.generateKey();\n\t\t\t// Encrypt the plain text with AES\n\t\t\tCipher aesChipher;\n\t\t\taesChipher = Cipher.getInstance(\"AES\");\n\t\t\taesChipher.init(Cipher.ENCRYPT_MODE, key);\n\t\t\tbyte[] encrypted= aesChipher.doFinal(plainText.getBytes());\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (NoSuchPaddingException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (InvalidKeyException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalBlockSizeException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (BadPaddingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Test\n public void testEncryptPassword() {\n String pass1 = user2.getPassword();\n user2.encryptPassword();\n String pass2 = user2.getPassword();\n if (pass1.equals(pass2))\n fail(\"Password encryption failed\");\n }", "public static String encrypt(String seed, String plain) throws Exception {\r\nbyte[] rawKey = getRawKey(seed.getBytes());\r\nbyte[] encrypted = encrypt(rawKey, plain.getBytes());\r\nreturn Base64.encodeToString(encrypted, Base64.DEFAULT);\r\n}", "@Override\n\tpublic void Encrypt(Object key) {\n\n\t}", "String encryption(Long key, String encryptionContent);", "@Test\n public void testAesForInputKeyMode() throws Exception {\n//TODO: Test goes here... \n/* \ntry { \n Method method = Cryptos.getClass().getMethod(\"aes\", byte[].class, byte[].class, int.class); \n method.setAccessible(true); \n method.invoke(<Object>, <Parameters>); \n} catch(NoSuchMethodException e) { \n} catch(IllegalAccessException e) { \n} catch(InvocationTargetException e) { \n} \n*/\n }", "@Test\r\n public void testDecrypt()\r\n {\r\n System.out.println(\"decrypt\");\r\n String input = \"0fqylTncsgycZJQ+J5pS7v6/fj8M/fz4bavB/SnIBOQ=\";\r\n KeyMaker km = new KeyMaker();\r\n SecretKeySpec sks = new SecretKeySpec(km.makeKeyDriver(\"myPassword\"), \"AES\");\r\n EncyptDecrypt instance = new EncyptDecrypt();\r\n String expResult = \"Hello how are you?\";\r\n String result = instance.decrypt(input, sks);\r\n assertEquals(expResult, result);\r\n }", "public String encrypt(String geheimtext);", "@Test\n public void testAesForInputKeyIvMode() throws Exception {\n//TODO: Test goes here... \n/* \ntry { \n Method method = Cryptos.getClass().getMethod(\"aes\", byte[].class, byte[].class, byte[].class, int.class); \n method.setAccessible(true); \n method.invoke(<Object>, <Parameters>); \n} catch(NoSuchMethodException e) { \n} catch(IllegalAccessException e) { \n} catch(InvocationTargetException e) { \n} \n*/\n }", "byte[] encrypt(final byte[] dataToEncrypt) throws RegBaseCheckedException;", "public static byte[] encryptText(String plainText,SecretKey secKey) throws Exception{\n\r\n Cipher aesCipher = Cipher.getInstance(\"AES\");\r\n\r\n aesCipher.init(Cipher.ENCRYPT_MODE, secKey);\r\n\r\n byte[] byteCipherText = aesCipher.doFinal(plainText.getBytes());\r\n\r\n return byteCipherText;\r\n\r\n}", "@Test\r\n\tpublic void testSimple() throws IOException, URISyntaxException, IllegalKeyException{\r\n\t\tbyte data [] = {97,98,99,100};\r\n\t\tbyte [] keys = {50};\r\n\t\tEncryptionDecryptionManager man = new AlgoritemManaging();\r\n\t\tCaesarEncryption ce = new CaesarEncryption(man);\r\n\t\tbyte[] encData = ce.Encrypt(keys,data);\r\n\t\t\r\n\t\tCaesarDecryption c = new CaesarDecryption(man);\r\n\t\tbyte[] decData = c.Decrypt(keys,encData);\r\n\t\tassert decData [0] == (byte)(97);\r\n\t\tassert decData [1] == (byte)(98);\r\n\t\tassert decData [2] == (byte)(99);\r\n\t\tassert decData [3] == (byte)(100);\r\n\t}", "public interface EncryptionAlgorithm {\n\n public String encrypt(String plaintext);\n\n}", "public CryptObject reencrypt(Ciphertext ciphertext);", "String encryptString(String toEncrypt) throws NoUserSelectedException;", "@Test\n public void testCrypto() throws Exception {\n Security.addProvider(new MymeeCrypto());\n MessageDigest digest;\n try {\n digest = MessageDigest.getInstance(\"SHA-224\", \"MymeeCrypto\");\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n return;\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n return;\n }\n byte[] result;\n\n result = digest.digest(\"flxtest5i88vzf8orqj\".getBytes());\n\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < result.length; i++)\n sb.append(String.format(\"%02x\", result[i]));\n assertTrue(\"fbfc986da9dc02cb5f6395d926f349b1674727be2fefda8d6044187d\".equals(sb.toString()));\n }", "void encrypt(ChannelBuffer buffer, Channel c);", "@Test\n public void testAesDecryptForInputKey() throws Exception {\n//TODO: Test goes here... \n }", "@Test\r\n public void testCryptoBoxSeal() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] result = instance.cryptoBoxSeal(keys, data);\r\n assertNotNull(result);\r\n }", "@Override\n public void encrypt() {\n algo.encrypt();\n String cypher = vigenereAlgo(true);\n this.setValue(cypher);\n }", "public abstract String encryptMsg(String msg);", "@Test\r\n public void testCryptoBox() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys sender = instance.createKeys(null);\r\n Keys receiver = instance.createKeys(null);\r\n CryptoBox result = instance.cryptoBox(data, sender, receiver);\r\n assertNotNull(result);\r\n }", "@Test\n public void testAesDecryptForInputKeyIv() throws Exception {\n//TODO: Test goes here... \n }", "public void test() {\n\t\t// super.onCreate(savedInstanceState);\n\t\t// setContentView(R.layout.main);\n\t\tString masterPassword = \"abcdefghijklmn\";\n\t\tString originalText = \"i see qinhubao eat milk!\";\n\t\tbyte[] text = new byte[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };\n\t\tbyte[] password = new byte[] { 'a' };\n\t\ttry {\n\t\t\tString encryptingCode = encrypt(masterPassword, originalText);\n\t\t\t// System.out.println(\"加密结果为 \" + encryptingCode);\n\t\t\tLog.i(\"加密结果为 \", encryptingCode);\n\t\t\tString decryptingCode = decrypt(masterPassword, encryptingCode);\n\t\t\tSystem.out.println(\"解密结果为 \" + decryptingCode);\n\t\t\tLog.i(\"解密结果\", decryptingCode);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public interface ICryptoEngine \n{\n\t/**\n\t * Initialize the \n\t * \n\t * @param forEncryption should the engine be initialized for encryption (true) or decryption (false)\n\t * @param key - symmetric encryption key\n\t * \n\t * @throws IllegalStateException - if any initialization parameters are invalid\n\t */\n\tpublic void init(boolean forEncryption, byte[] key) throws IllegalStateException;\n\t\n\t/**\n\t * @return name of the encryption algorithm\n\t */\n\tpublic String getAlgorithmName();\n\t\n\t/**\n\t * @return block size of the encryption algorithm\n\t */\n\tpublic int getBlockSize();\n\t\n\t/**\n\t * Performs an encryption or decryption of a block.\n\t * The amount of processed data depends on the actual algorithm's block size \n\t * \n\t * @param in - buffer with the data to be processed\n\t * @param inOff - starting position of the data at 'in'\n\t * @param out - preallocated buffer to store the processed data\n\t * @param outOff - starting position at 'out'\n\t * \n\t * @return size of processed data (typically algorithm's block size)\n\t * \n\t * @throws IllegalStateException if engine was not initialized or buffers are invalid\n\t */\n\tpublic int processBlock(byte[] in, int inOff, byte[] out, int outOff) throws IllegalStateException;\n\t\n\t/**\n\t * Resets the encryption engine (if required by the implementation)\n\t */\n\tpublic void reset();\n}", "@Test\n public void producerEncryptionKeyNameTest() {\n // TODO: test producerEncryptionKeyName\n }", "PBEncryptStorage encrypt(String inputString, String password, byte[] salt);", "@Override\n public byte[] encrypt(byte[] plaintext) {\n java.security.spec.ECPoint point = hashIntoTheCurveInternal(plaintext);\n return encrypt(convertECPoint(point));\n }", "public interface EncryptionCommonBusiness\n{\n // ---------------------------------------------------------------------------||\n // Contracts -----------------------------------------------------------------||\n // ---------------------------------------------------------------------------||\n\n /**\n * Encrypts the specified String, returning the result \n * \n * @param input\n * @return\n * @throws IllegalArgumentException If no input was provided (null)\n * @throws EncryptionException If some problem occurred with encryption\n */\n String encrypt(String input) throws IllegalArgumentException, EncryptionException;\n\n /**\n * Decrypts the specified String, returning the result. The general\n * contract is that the result of decrypting a String encrypted with\n * {@link EncryptionCommonBusiness#encrypt(String)} will be equal \n * by value to the original input (round trip).\n * \n * @param input\n * @return\n * @throws IllegalArgumentException If no input was provided (null)\n * @throws EncryptionException If some problem occurred with decryption\n */\n String decrypt(String input) throws IllegalArgumentException, EncryptionException;\n\n /**\n * Returns a one-way hash of the specified argument. Useful\n * for safely storing passwords.\n * \n * @param input\n * @return\n * @throws IllegalArgumentException If no input was provided (null)\n * @throws EncryptionException If some problem occurred making the hash\n */\n String hash(String input) throws IllegalArgumentException, EncryptionException;\n\n /**\n * Returns whether or not the specified input matches the specified \n * hash. Useful for validating passwords against a \n * securely-stored hash. \n * \n * @param hash\n * @param input\n * @return\n * @throws IllegalArgumentException If either the hash or input is not provided (null)\n * @throws EncryptionException If some problem occurred making the hash\n */\n boolean compare(String hash, String input) throws IllegalArgumentException, EncryptionException;\n\n /*\n * This comment applies to all below this marker.\n * \n * In real life it's a security risk to expose these internals, \n * but they're in place here for testing and to show \n * functionality described by the examples.\n */\n\n /**\n * Obtains the passphrase to be used in the key for\n * the symmetric encryption/decryption ciphers\n * \n * @return\n */\n String getCiphersPassphrase();\n\n /**\n * Obtains the algorithm to be used in performing\n * one-way hashing\n * \n * @return\n */\n String getMessageDigestAlgorithm();\n\n}", "@Override\n public String encrypt(String s) throws NotInAlphabetException{ \n passwordPos = 0; //initialize to 0\n return super.encrypt(s); //invoke parent\n }", "@SuppressWarnings(\"deprecation\")\n @Test\n public void AesBlock() throws IOException {\n byte[] bytes = \"hello, my name is inigo montoya\".getBytes();\n\n SecureRandom rand = new SecureRandom(entropySeed.getBytes());\n\n PaddedBufferedBlockCipher aesEngine = new PaddedBufferedBlockCipher(new CBCBlockCipher(new AESFastEngine()));\n\n byte[] key = new byte[32];\n byte[] iv = new byte[16];\n\n // note: the IV needs to be VERY unique!\n rand.nextBytes(key); // 256bit key\n rand.nextBytes(iv); // 16bit block size\n\n\n byte[] encryptAES = CryptoAES.encrypt(aesEngine, key, iv, bytes, logger);\n byte[] decryptAES = CryptoAES.decrypt(aesEngine, key, iv, encryptAES, logger);\n\n if (Arrays.equals(bytes, encryptAES)) {\n fail(\"bytes should not be equal\");\n }\n\n if (!Arrays.equals(bytes, decryptAES)) {\n fail(\"bytes not equal\");\n }\n }", "@Override\n public void encrypt(byte[] text) throws IllegalArgumentException {\n if ( text.length != blockSize()) throw new IllegalArgumentException(\"text.length != cipher.blockSize())\");\n ciper.setKey(key);\n xor_nonce(text);\n ciper.encrypt(text);\n System.arraycopy(text, 0, nonce, 0, blockSize());\n }", "@Test\n public void testToHex_String() {\n System.out.println(\"toHex\");\n String txt = \"\";\n String expResult = \"\";\n String result = Crypto.toHex(txt);\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 }", "@Test\n public void testSuccessEncryption() throws NoSuchAlgorithmException, ComponentInitializationException {\n ActionTestingSupport.assertProceedEvent(action.execute(requestCtx));\n Assert.assertNotNull(profileRequestCtx.getSubcontext(RelyingPartyContext.class)\n .getSubcontext(EncryptionContext.class).getAssertionEncryptionParameters());\n }", "public interface Encryptor {\n void encrypt();\n\n}", "public CryptObject encrypt(BigIntegerMod message);", "@Test\n public void testCipherNew() throws Exception {\n long start = System.currentTimeMillis();\n for(int i=0; i<max; i++) {\n Cipher cipher = Cipher.getInstance(\"AES/OFB8/NoPadding\"); // corresponds to the protection initialized above\n cipher.init(Cipher.ENCRYPT_MODE, key, iv); \n byte[] ciphertext = cipher.doFinal(plaintext);\n }\n long stop = System.currentTimeMillis();\n log.debug(\"testCipherNew {} ms\", stop-start);\n }", "public String Crypt(String s);", "@Test\r\n public void testCryptoBoxSealOpen() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] cipher = instance.cryptoBoxSeal(keys, data);\r\n byte[] result = instance.cryptoBoxSealOpen(keys, cipher);\r\n assertArrayEquals(result, data);\r\n }", "public static String encrypt(String data){\n\t\tif (data.equals(\"\") || data.equals(\"null\"))\n\t\t\treturn data;\n\t\ttry{\n\t\t\tjavax.crypto.Cipher cipher = javax.crypto.Cipher.getInstance(CIPHER);\n\t\t\tcipher.init(javax.crypto.Cipher.ENCRYPT_MODE, new SecretKeySpec(ENCRYPTION_KEY.getBytes(Charset.forName(\"UTF-8\")), \"AES\"), new IvParameterSpec(new byte[16]));\n\t\t\tbyte[] encryptedBytes = cipher.doFinal(data.getBytes(Charset.forName(\"UTF-8\")));\n\t\t\treturn ENCRYPTION_PREFIX + new String(Base64.encodeBase64(encryptedBytes), Charset.forName(\"UTF-8\"));\n\t\t}catch (Exception e) {\n\t\t\tSystem.err.println( \"Error in EncryptionUtil.encrypt: \" + e );\n\t\t\treturn data;\n\t\t}\n\t}", "private EncryptionUtility(){\r\n\t\treturn;\t\t\r\n\t}", "@SuppressWarnings(\"deprecation\")\n @Test\n public void AesWithIVBlock() throws IOException {\n byte[] bytes = \"hello, my name is inigo montoya\".getBytes();\n\n SecureRandom rand = new SecureRandom(entropySeed.getBytes());\n\n PaddedBufferedBlockCipher aesEngine = new PaddedBufferedBlockCipher(new CBCBlockCipher(new AESFastEngine()));\n\n byte[] key = new byte[32]; // 256bit key\n byte[] iv = new byte[aesEngine.getUnderlyingCipher().getBlockSize()];\n\n // note: the IV needs to be VERY unique!\n rand.nextBytes(key);\n rand.nextBytes(iv);\n\n\n byte[] encryptAES = CryptoAES.encryptWithIV(aesEngine, key, iv, bytes, logger);\n byte[] decryptAES = CryptoAES.decryptWithIV(aesEngine, key, encryptAES, logger);\n\n if (Arrays.equals(bytes, encryptAES)) {\n fail(\"bytes should not be equal\");\n }\n\n if (!Arrays.equals(bytes, decryptAES)) {\n fail(\"bytes not equal\");\n }\n }", "public String encrypt() throws LRException\n\t{\n\t\treturn LUEncrypt.encrypt(getFields(),\n\t\t\t((DataHRecordData)getData()).encryptKey.getStringValue());\n\t}", "public String encrypt(String plaintext) {\n\t\tCipher rsaCipher, aesCipher;\n\t\ttry {\n\t\t\t// Create AES key\n\t\t\tKeyGenerator keyGen = KeyGenerator.getInstance(\"AES\");\n\t\t\tkeyGen.init(AES_BITS);\n\t\t\tKey aesKey = keyGen.generateKey();\n\n\t\t\t// Create Random IV\n\t\t\tbyte[] iv = SecureRandom.getSeed(16);\n\t\t\tIvParameterSpec ivSpec = new IvParameterSpec(iv);\n\n\t\t\t// Encrypt data using AES\n\t\t\taesCipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\n\t\t\taesCipher.init(Cipher.ENCRYPT_MODE, aesKey, ivSpec);\n\t\t\tbyte[] data = aesCipher.doFinal(plaintext.getBytes());\n\n\t\t\t// Encrypt AES key using RSA public key\n\t\t\trsaCipher = Cipher.getInstance(\"RSA/NONE/PKCS1Padding\");\n\t\t\trsaCipher.init(Cipher.ENCRYPT_MODE, this.pubKey);\n\t\t\tbyte[] encKey = rsaCipher.doFinal(aesKey.getEncoded());\n\n\t\t\t// Create output\n\t\t\tString keyResult = new String(Base64.encodeBytes(encKey, 0));\n\t\t\tString ivResult = new String(Base64.encodeBytes(iv, 0));\n\t\t\tString dataResult = new String(Base64.encodeBytes(data, 0));\n\t\t\tString result = FORMAT_ID + \"|\" + VERSION + \"|\" + this.keyId + \"|\"\n\t\t\t\t\t+ keyResult + \"|\" + ivResult + \"|\" + dataResult;\n\t\t\treturn Base64.encodeBytes(result.getBytes(), Base64.URL_SAFE);\n\t\t} catch (InvalidKeyException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (NoSuchPaddingException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalBlockSizeException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (BadPaddingException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (InvalidAlgorithmParameterException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn \"Encryption_Failed\";\n\t}", "@SuppressWarnings(\"deprecation\")\n @Test\n public void AesBlockStream() throws IOException {\n byte[] originalBytes = \"hello, my name is inigo montoya\".getBytes();\n ByteArrayInputStream inputStream = new ByteArrayInputStream(originalBytes);\n ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n\n SecureRandom rand = new SecureRandom(entropySeed.getBytes());\n\n PaddedBufferedBlockCipher aesEngine = new PaddedBufferedBlockCipher(new CBCBlockCipher(new AESFastEngine()));\n\n byte[] key = new byte[32];\n byte[] iv = new byte[16];\n\n // note: the IV needs to be VERY unique!\n rand.nextBytes(key); // 256bit key\n rand.nextBytes(iv); // 128bit block size\n\n\n boolean success = CryptoAES.encryptStream(aesEngine, key, iv, inputStream, outputStream, logger);\n\n if (!success) {\n fail(\"crypto was not successful\");\n }\n\n byte[] encryptBytes = outputStream.toByteArray();\n\n inputStream = new ByteArrayInputStream(outputStream.toByteArray());\n outputStream = new ByteArrayOutputStream();\n\n success = CryptoAES.decryptStream(aesEngine, key, iv, inputStream, outputStream, logger);\n\n\n if (!success) {\n fail(\"crypto was not successful\");\n }\n\n byte[] decryptBytes = outputStream.toByteArray();\n\n if (Arrays.equals(originalBytes, encryptBytes)) {\n fail(\"bytes should not be equal\");\n }\n\n if (!Arrays.equals(originalBytes, decryptBytes)) {\n fail(\"bytes not equal\");\n }\n }", "@Test\n public void testDesDecrypt() {\n\n }", "public String encrypt(String text) {\n return content.encrypt(text);\n }", "public synchronized void encryptText() {\n setSalt(ContentCrypto.generateSalt());\n try {\n mText = ContentCrypto.encrypt(mText, getSalt(), Passphrase.INSTANCE.getPassPhrase().toCharArray());\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "public String encrypt(String value) throws Exception \n\t{\n\t\treturn value;\n\t}", "public interface ICrypto\n{\n\t/**\n\t *\n\t * @return\ttrue for Public/Private key and false for password style encryption\n\t */\n\tboolean isPublic();\n\n\t/**\n\t * @param clearText\t\tClear text\n\t * @return\t\t\t\tStringized (BasicBase64) version of the cipher for the clear text\n\t */\n\tString encrypt(String clearText);\n\n\t/**\n\t * @param cipherText\tClear text\n\t * @return\t\t\t\tClear text from the stringized (BasicBase64) version of the cipherTetxt\n\t */\n\tString decrypt(String cipherText);\n\n\t/**\n\t * @return\tThe cryptography algorithm\n\t */\n\tString getAlgorithm();\n\n\t/**\n\t *\n\t * @return\tThe name by which this combination algorithm/key are known.\n\t */\n\tString getAliasName();\n}", "private String encrypt(String plainData) throws Exception {\n Key key = generateKey();\n Cipher c = Cipher.getInstance(ALGO);\n c.init(Cipher.ENCRYPT_MODE, key);\n byte[] encValue = c.doFinal(plainData.getBytes());\n return Base64.getEncoder().encodeToString(encValue);\n }", "public static String Encrypt(String inputText, String key) {\n String retVal = \"\";\n try {\n Cipher cipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\n byte[] keyBytes = new byte[16];\n byte[] b = key.getBytes();\n int len = b.length;\n if (len > keyBytes.length) {\n len = keyBytes.length;\n }\n System.arraycopy(b, 0, keyBytes, 0, len);\n SecretKeySpec keySpec = new SecretKeySpec(keyBytes, \"AES\");\n IvParameterSpec ivSpec = new IvParameterSpec(keyBytes);\n cipher.init(Cipher.ENCRYPT_MODE, keySpec, ivSpec);\n BASE64Encoder _64e = new BASE64Encoder();\n byte[] encryptedData = cipher.doFinal(inputText.getBytes());\n retVal = _64e.encode(encryptedData);\n\n } catch (Exception ex) {\n ApiLog.One.WriteException(ex);\n }\n return retVal;\n }", "private native int native_crypt(long cookie, byte[] in, int inOffset,\n byte[] out, int outOffset, boolean encrypt);", "@SuppressWarnings(\"deprecation\")\n @Test\n public void AesWithIVBlockStream() throws IOException {\n byte[] originalBytes = \"hello, my name is inigo montoya\".getBytes();\n ByteArrayInputStream inputStream = new ByteArrayInputStream(originalBytes);\n ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n\n SecureRandom rand = new SecureRandom(entropySeed.getBytes());\n\n PaddedBufferedBlockCipher aesEngine = new PaddedBufferedBlockCipher(new CBCBlockCipher(new AESFastEngine()));\n\n byte[] key = new byte[32];\n byte[] iv = new byte[16];\n\n // note: the IV needs to be VERY unique!\n rand.nextBytes(key); // 256bit key\n rand.nextBytes(iv); // 128bit block size\n\n\n boolean success = CryptoAES.encryptStreamWithIV(aesEngine, key, iv, inputStream, outputStream, logger);\n\n if (!success) {\n fail(\"crypto was not successful\");\n }\n\n byte[] encryptBytes = outputStream.toByteArray();\n\n inputStream = new ByteArrayInputStream(outputStream.toByteArray());\n outputStream = new ByteArrayOutputStream();\n\n success = CryptoAES.decryptStreamWithIV(aesEngine, key, inputStream, outputStream, logger);\n\n\n if (!success) {\n fail(\"crypto was not successful\");\n }\n\n byte[] decryptBytes = outputStream.toByteArray();\n\n if (Arrays.equals(originalBytes, encryptBytes)) {\n fail(\"bytes should not be equal\");\n }\n\n if (!Arrays.equals(originalBytes, decryptBytes)) {\n fail(\"bytes not equal\");\n }\n }", "@Test\n public void defaultEncoding() throws SecureCellException {\n String passphrase = \"\\u6697\\u53F7\";\n SecureCell.Seal cellA = SecureCell.SealWithPassphrase(passphrase);\n SecureCell.Seal cellB = SecureCell.SealWithPassphrase(passphrase.getBytes(StandardCharsets.UTF_8));\n byte[] message = \"All your base are belong to us!\".getBytes(StandardCharsets.UTF_8);\n\n byte[] encrypted = cellA.encrypt(message);\n byte[] decrypted = cellB.decrypt(encrypted);\n\n assertArrayEquals(message, decrypted);\n }", "Update withEncryption(Encryption encryption);", "@Test\n public void testFromHex() {\n System.out.println(\"fromHex\");\n String hex = \"\";\n String expResult = \"\";\n String result = Crypto.fromHex(hex);\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 String encrypt(String text) {\n if (StringUtils.isBlank(text)) {\n return null;\n }\n\n try {\n byte[] iv = new byte[GCM_IV_LENGTH];\n RandomUtils.RANDOM.nextBytes(iv);\n\n Cipher cipher = Cipher.getInstance(ENCRYPT_ALGORITHM);\n GCMParameterSpec ivSpec = new GCMParameterSpec(GCM_TAG_LENGTH * Byte.SIZE, iv);\n cipher.init(Cipher.ENCRYPT_MODE, getKeyFromPassword(), ivSpec);\n\n byte[] ciphertext = cipher.doFinal(text.getBytes(StandardCharsets.UTF_8));\n byte[] encrypted = new byte[iv.length + ciphertext.length];\n System.arraycopy(iv, 0, encrypted, 0, iv.length);\n System.arraycopy(ciphertext, 0, encrypted, iv.length, ciphertext.length);\n\n return Base64.getEncoder().encodeToString(encrypted);\n } catch (NoSuchAlgorithmException\n | IllegalArgumentException\n | InvalidKeyException\n | InvalidAlgorithmParameterException\n | IllegalBlockSizeException\n | BadPaddingException\n | NoSuchPaddingException e) {\n LOG.debug(ERROR_ENCRYPTING_DATA, e);\n throw new EncryptionException(e);\n }\n }", "public CryptObject encrypt(BigIntegerMod message, BigIntegerMod r);", "@Override\n public String encryptMsg(String msg) {\n if (msg.length() == 0) {\n return msg;\n } else {\n char[] encMsg = new char[msg.length()];\n for (int ind = 0; ind < msg.length(); ++ind) {\n char letter = msg.charAt(ind);\n if (letter >= 'a' && letter <= 'z') {\n encMsg[ind] = (char) ('a' + ((letter - 'a' + key) % 26));\n } else if (letter >= 'A' && letter <= 'Z') {\n encMsg[ind] = (char) ('A' + ((letter - 'A' + key) % 26));\n } else {\n encMsg[ind] = letter;\n }\n }\n return new String(encMsg);\n }\n }", "@Test\n public void testTest1BC() throws Exception {\n\n PrivateKey privKey = MBouncy.getPrivateKey(PemUtil.getBlockAsString(t1PrivateKey));\n PublicKey publKey = MBouncy.getPublicKey(PemUtil.getBlockAsString(t1PublicKey));\n\n byte[] secure = MBouncy.encryptRsa(MString.toBytes(t1Secret), publKey);\n System.out.println(Base64.encode(secure));\n\n String secret =\n MString.byteToString(\n MBouncy.decryptRsa(secure, privKey, MBouncy.RSA_KEY_SIZE.B1024));\n\n assertEquals(t1Secret, secret);\n }", "@Test\n public void testCryptographyNegative()\n {\n byte[] sensitiveBytes = sensitiveString.getBytes();\n byte[] secure = StateUtils.encrypt(sensitiveBytes, externalContext);\n \n secure[secure.length-5] = (byte) 1;\n try\n {\n byte[] insecure = StateUtils.decrypt(secure, externalContext);\n Assertions.assertFalse(Arrays.equals(insecure, sensitiveBytes));\n }\n catch (Exception e)\n {\n // do nothing\n }\n }", "@Test\n public void testCheckPassword1() {\n user2.encryptPassword();\n assertEquals(\"Password check should result true\", true, user2.checkPassword(\"d\"));\n }", "public String ebcEncrypt(String plaintext, String key) {\n\t\treturn AESEBC.AESEncrypt(plaintext, key);\n\t}", "public abstract void setEncryptMode();", "public doEncryptNotifdeEncode() {\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 }", "private void encryptionAlgorithm() {\n\t\ttry {\n\t\t\t\n\t\t\tFileInputStream fileInputStream2=new FileInputStream(\"D:\\\\program\\\\key.txt\");\n\t\t\tchar key=(char)fileInputStream2.read();\n\t\t\tSystem.out.println(key);\n\t\t\tFileInputStream fileInputStream1=new FileInputStream(\"D:\\\\program\\\\message.txt\");\n\t\t\tint i=0;\n\t\t\t\n\t\t\tStringBuilder message=new StringBuilder();\n\t\t\twhile((i= fileInputStream1.read())!= -1 )\n\t\t\t{\n\t\t\t\tmessage.append((char)i);\n\t\t\t}\n\t\t\tString s=message.toString();\n\t\t\tchar[] letters=new char[s.length()];\n\t\t\tStringBuilder en=new StringBuilder();\n\t\t\tfor(int j = 0;j < letters.length;j++)\n\t\t\t{\n\t\t\t\ten.append((char)(byte)letters[j]+key);\n\t\t\t}\t\t\n\t\t\tFileOutputStream fileoutput=new FileOutputStream(\"D:\\\\program\\\\encryptedfile.txt\");\n\t\t\t\n\t\t\tfileInputStream1.close();\n\t\t\tfileInputStream2.close();\n\t\t\t\n\t\t}\n\t\tcatch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t\n\t}", "@Override\n protected void assertEncrypted(Path path) throws IOException {\n S3AFileSystem fs = getFileSystem();\n Configuration c = fs.getConf();\n String kmsKey = getS3EncryptionKey(getTestBucketName(c), c);\n EncryptionTestUtils.assertEncrypted(fs, path, SSE_KMS, kmsKey);\n }", "public String encrypt (String input) {\n // parameter checks. If input has nothing, or both keys\n // are zero, we have no work to do.\n if (!hasValue(input)) return \"\";\n if (mainKey1 == 0 && mainKey2 == 0) return input;\n\n // Start with a StringBuilder we can update below.\n StringBuilder encrypted = new StringBuilder(input);\n\n // Walk the input string and transform each letter that exists in\n // our alphabet\n for (int i = 0; i < encrypted.length(); i++) {\n char currChar = encrypted.charAt(i);\n int idx = alphabet.indexOf(currChar);\n if (idx != -1) {\n // Which alphabet do I use? even i is key1, odd i is key2\n String shiftedAlphabet = (i % 2 == 0) ? shiftedAlphabet1: shiftedAlphabet2;\n char newChar = shiftedAlphabet.charAt(idx);\n encrypted.setCharAt(i, newChar);\n }\n }\n\n return encrypted.toString();\n }", "public static byte [] encrypt(byte [] plainText, char [] password){\r\n\t\t// create a secret key using a random salt\r\n\t\tbyte [] salt = new byte[SEED_LENGTH];\r\n\t\tSecureRandom random = new SecureRandom();\r\n\t\trandom.nextBytes(salt);\r\n\t\tSecretKey key = generateSecretKey(salt, password);\r\n\t\ttry {\r\n\t\t\tCipher cipher = Cipher.getInstance(symmetricKeyCryptoMode);\r\n\t\t\tcipher.init(Cipher.ENCRYPT_MODE, key, new IvParameterSpec(salt));\r\n\t\t\tbyte [] encoded = cipher.doFinal(plainText);\r\n\t\t\tbyte [] cipherText = new byte[encoded.length+salt.length+4];\r\n\t\t\tint cursor = 0;\r\n\t\t\t// pack the salt dataValue and the encoded values to create the cipher text\r\n\t\t\tcursor = packToByteArray(salt, cipherText, cursor);\r\n\t\t\tpackToByteArray(encoded,cipherText,cursor);\r\n\t\t\treturn cipherText;\r\n\t\t} catch (Exception e){\r\n\t\t\tthrow new ModelException(\"Error encrypting plainText \"+plainText,e);\r\n\t\t}\r\n\t}", "@Override\n public String encryptMsg(String msg) {\n if (msg.length() == 0) {\n return msg;\n } else {\n char[] encMsg = new char[msg.length()];\n for (int ind = 0; ind < msg.length(); ++ind) {\n char letter = msg.charAt(ind);\n encMsg[ind] = (char) ((letter + key) % 65536);\n }\n return new String(encMsg);\n }\n }", "@Test\r\n public void testVerifyCryptoType() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }", "public String encrypt(String value) throws Exception\n {\n if ( key == null )\n {\n throw new Exception(\"CodecUtil must be initialised with the storeKey first.\");\n }\n try\n {\n Cipher pbeCipher = Cipher.getInstance(\"PBEWithMD5AndDES\");\n pbeCipher.init(Cipher.ENCRYPT_MODE, key, new PBEParameterSpec(salt, 20));\n return base64Encode(pbeCipher.doFinal(value.getBytes(\"UTF-8\")));\n }\n catch (Exception e)\n {\n throw new Exception(\"Encryption error :\" + e.getMessage());\n }\n }", "private static void crypting(boolean encrypt, String filename, String cryptedFilename) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tSystem.out.println(\"Please provide password as hex-encoded text (16 bytes, i.e. 32 hex-digits): \");\n\t\tSystem.out.print(\">\");\n\t\tString keyText = sc.nextLine();\n\n\t\tSystem.out.println(\"Please provide initialization vector as hex-encoded text (32 hex-digits): \");\n\t\tSystem.out.print(\">\");\n\t\tString ivText = sc.nextLine();\n\t\tsc.close();\n\n\t\tSecretKeySpec keySpec = new SecretKeySpec(Util.hextobyte(keyText), \"AES\");\n\t\tAlgorithmParameterSpec paramSpec = new IvParameterSpec(Util.hextobyte(ivText));\n\t\tCipher cipher = null;\n\n\t\ttry {\n\t\t\tcipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\n\t\t\tcipher.init(encrypt ? Cipher.ENCRYPT_MODE : Cipher.DECRYPT_MODE, keySpec, paramSpec);\n\n\t\t} catch (NoSuchAlgorithmException | NoSuchPaddingException exc) {\n\t\t\tSystem.out.println(\"Transformation is in invalid format or contains padding scheme that is unavailable. \");\n\t\t\tSystem.exit(1);\n\t\t} catch (InvalidKeyException | InvalidAlgorithmParameterException exc) {\n\t\t\tSystem.out.println(\"Given key or algorithm is invalid for this cipher.\");\n\t\t\tSystem.exit(1);\n\n\t\t}\n\n\t\ttry (InputStream inputStream = new BufferedInputStream(new FileInputStream(filename));\n\t\t\t\tOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(cryptedFilename))) {\n\n\t\t\tint nRead;\n\t\t\tbyte[] buffer = new byte[4096];\n\t\t\tbyte[] inputfile = null;\n\n\t\t\twhile ((nRead = inputStream.read(buffer, 0, buffer.length)) != -1) {\n\t\t\t\tinputfile = cipher.update(buffer, 0, nRead);\n\t\t\t\toutputStream.write(inputfile);\n\t\t\t}\n\n\t\t\tinputfile = cipher.doFinal();\n\t\t\toutputStream.write(inputfile);\n\n\t\t} catch (FileNotFoundException exc) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"File does not exist, is a directory rather than a regular file, or cannot be opened for reading because of some other reason. \");\n\t\t\tSystem.exit(1);\n\n\t\t} catch (IOException exc) {\n\t\t\tSystem.out.println(\"Input stream couldn't be initialized.\");\n\t\t\tSystem.exit(1);\n\n\t\t} catch (IllegalBlockSizeException | BadPaddingException e) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"Encryption algorithm is unable to process the input data provided or the decrypted data is not bounded by the appropriate padding bytes. \");\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t\tif (encrypt) {\n\t\t\tSystem.out.printf(\"Encryption completed. Generated file %s based on file %s.\\n\", cryptedFilename, filename);\n\t\t} else {\n\t\t\tSystem.out.printf(\"Decryption completed. Generated file %s based on file %s.\\n\", cryptedFilename, filename);\n\t\t}\n\n\t}", "public void encrypt() throws Exception {\n\t\tLogWriter = new BufferedWriter(new FileWriter(localWorkingDirectoryPath + \"\\\\Log_Encryption.txt\"));\n\t\tFileOutputStream configurationFileOutputStream = null;\n\n\t\t// Loading the store with the giving arguments\n\t\twriteToLog(\"Step 1: Loading the store with the giving arguments\");\n\t\tloadStore();\n\n\t\t// Getting the receiver's public-key\n\t\twriteToLog(\"Step 2: Getting the receiver's public-key\");\n\t\tCertificate receiverCert = keyStore.getCertificate(receiverSelfSignedCertAlias);\n\t\tif (receiverCert == null) {\n\t\t\twriteToLog(\"The entered certificate alias: \\\"\" + receiverSelfSignedCertAlias\n\t\t\t\t\t+ \"\\\" dose not exist in the keys store.\");\n\t\t\tLogWriter.close();\n\t\t\tthrow new Exception(\"The entered certificate alias: \\\"\" + receiverSelfSignedCertAlias\n\t\t\t\t\t+ \"\\\" dose not exist in the keys store.\");\n\t\t}\n\t\tPublicKey receiverPublicKey = receiverCert.getPublicKey();\n\n\t\t// Getting my private key in order to generate a signature\n\t\twriteToLog(\"Step 3: Getting the encryptor's private-key\");\n\t\tPrivateKey myPrivateKey = getMyPrivateKey();\n\t\t\n\t\t// Generating a symmetric key\n\t\twriteToLog(\"Step 4: Generating a symmetric key\");\n\t\tKeyGenerator kg = KeyGenerator.getInstance(\"AES\");\n\t\tSecretKey semetricKey = kg.generateKey();\n\n\t\t// Generating a random IV\n\t\twriteToLog(\"Step 5: Generating a random IV\");\n\t\tbyte[] iv = generateRandomIV();\n\n\t\t// Initializing the cipher\n\t\twriteToLog(\"Step 6: Initilatzing the cipher Object\");\n\t\ttry {\n\t\t\tmyCipher = createCipher();\n\t\t\tmyCipher.init(Cipher.ENCRYPT_MODE, semetricKey, new IvParameterSpec(iv));\n\t\t}catch(Exception e) {\n\t\t\twriteToLog(\"Error While tring to Initializing the cipher with the giving arguments: \" + e.getMessage());\n\t\t\tLogWriter.close();\n\t\t\tthrow new Exception(\"Error: While tring to Initializing the cipher with the giving arguments\",e);\n\t\t}\n\t\t\n\n\t\t// Initializing the signature with my private-key\n\t\twriteToLog(\"Step 7: Initilatzing the signature Object with the encryptor's private-key\");\n\t\tSignature dataSigner = Signature.getInstance(\"SHA256withRSA\");\n\t\tdataSigner.initSign(myPrivateKey);\n\n\t\t// Encrypting\n\t\twriteToLog(\"Step 8: Encrypting... \");\n\t\tFile fileToEncrrypt = new File(fileToEncryptPath);\n\t\tencryptingData(fileToEncrrypt, dataSigner);\n\n\t\t// Signing on the encrypted data\n\t\twriteToLog(\"Step 9: Signing on the encrypted data \");\n\t\tbyte[] mySignature = dataSigner.sign();\n\n\t\t// Encrypt the symmetric key with the public of the receiver\n\t\twriteToLog(\"Step 10: Encrypt the symmetric key with the public of the receiver \");\n\t\tbyte[] encryptedSymmetricKey = encryptSymmetricKey(receiverPublicKey, semetricKey);\n\n\t\t// Saving the IV, Encrypted Symmetric-Key and Signature to the configurations file\n\t\twriteToLog(\"Step 11: Saving the IV, Encrypted Semetric-Key and Signature to the configurations file \");\n\t\tsavingToConfigurationsFile(configurationFileOutputStream, iv, encryptedSymmetricKey, mySignature);\n\n\t\tLogWriter.write(\"Encryption completed, No Errors Were Found\");\n\t\tLogWriter.close();\n\t}" ]
[ "0.8136862", "0.75770295", "0.75458914", "0.73905766", "0.72637564", "0.72331953", "0.7183118", "0.7131244", "0.7053811", "0.7040405", "0.7035396", "0.70022935", "0.6876742", "0.685927", "0.6855389", "0.67885196", "0.67624384", "0.6756386", "0.66828865", "0.66560614", "0.6655958", "0.6652217", "0.66503096", "0.65449846", "0.65283334", "0.6477903", "0.6469728", "0.6451645", "0.6433309", "0.64208704", "0.64174426", "0.6414583", "0.6398909", "0.6394841", "0.63920224", "0.63849396", "0.6341078", "0.6325837", "0.63217276", "0.6320858", "0.62485677", "0.6222734", "0.6221988", "0.62154394", "0.6210807", "0.61885977", "0.6156933", "0.6154191", "0.6153964", "0.611567", "0.6111302", "0.6098319", "0.60916305", "0.60910845", "0.6088515", "0.6072735", "0.60515255", "0.60511464", "0.60473377", "0.6047152", "0.60431457", "0.60366136", "0.6027713", "0.6023644", "0.59570295", "0.5948041", "0.5941829", "0.59282935", "0.59216744", "0.5915104", "0.5908154", "0.5898177", "0.58969104", "0.5889743", "0.5884824", "0.5875105", "0.5871846", "0.58555716", "0.5845287", "0.58354074", "0.58337885", "0.5830146", "0.581781", "0.58154726", "0.580346", "0.57948625", "0.57878864", "0.5786317", "0.57793397", "0.57786787", "0.57727367", "0.5757118", "0.5752905", "0.57462513", "0.57403785", "0.57352513", "0.5733113", "0.5732653", "0.5722476", "0.5717012" ]
0.83639693
0
Test of decrypt method, of class Crypto.
@Test public void testDecrypt() throws Exception { System.out.println("decrypt"); String seed = ""; String encrypted = ""; String expResult = ""; String result = Crypto.decrypt(seed, encrypted); assertEquals(expResult, result); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n public void testDecrypt()\r\n {\r\n System.out.println(\"decrypt\");\r\n String input = \"0fqylTncsgycZJQ+J5pS7v6/fj8M/fz4bavB/SnIBOQ=\";\r\n KeyMaker km = new KeyMaker();\r\n SecretKeySpec sks = new SecretKeySpec(km.makeKeyDriver(\"myPassword\"), \"AES\");\r\n EncyptDecrypt instance = new EncyptDecrypt();\r\n String expResult = \"Hello how are you?\";\r\n String result = instance.decrypt(input, sks);\r\n assertEquals(expResult, result);\r\n }", "@Test\n\tpublic void testDecrypt() throws GeneralSecurityException, IOException {\n\t\tString cipher = \"4VGdDR9qJlq36bQGI+Sx3A==\";\n\t\tString key = \"io.github.odys-z\";\n\t\tString iv = \"DITVJZA2mSDAw496hBz6BA==\";\n\t\tString plain = AESHelper.decrypt(cipher, key,\n\t\t\t\t\t\t\tAESHelper.decode64(iv));\n\t\tassertEquals(\"Plain Text\", plain.trim());\n\n\t\tplain = \"-----------admin\";\n\t\tkey = \"----------123456\";\n\t\tiv = \"ZqlZsmoC3SNd2YeTTCkbVw==\";\n\t\t// PCKS7 Padding results not suitable for here - AES-128/CBC/NoPadding\n\t\tassertNotEquals(\"3A0hfZiaozpwMeYs3nXdAb8mGtVc1KyGTyad7GZI8oM=\",\n\t\t\t\tAESHelper.encrypt(plain, key, AESHelper.decode64(iv)));\n\t\t\n\t\tiv = \"CTpAnB/jSRQTvelFwmJnlA==\";\n\t\tassertEquals(\"WQiXlFCt5AGCabjSCkVh0Q==\",\n\t\t\t\tAESHelper.encrypt(plain, key, AESHelper.decode64(iv)));\n\t}", "@Test\n public void testDesDecrypt() {\n\n }", "@Test\n\tpublic void testEncryptDecrypt() {\n\t\tfor (int i = 0; i < CONFIDENCE; ++i) {\n\t\t\tP plain = getRandomPlaintext();\n\t\t\tR rnd = getPK().getRandom(getRand());\n\t\t\tC cipher = getPK().encrypt(plain, rnd);\n\t\t\t\n\t\t\tP plain2 = getSK().decrypt(cipher);\n\t\t\t\n\t\t\tassertTrue(\"Decryption didn't work\", plain.equals(plain2));\n\t\t}\n\t}", "@Test\n public void testAesDecryptForInputKey() throws Exception {\n//TODO: Test goes here... \n }", "@Test\n public void testAesDecryptForInputKeyIv() throws Exception {\n//TODO: Test goes here... \n }", "public String Decrypt(String s);", "public String decrypt(String cipherText);", "@Test\n public void testEncryptDecrypt3() throws InvalidCipherTextException {\n\n // password generation using KDF\n String password = \"Aa1234567890#\";\n byte[] kdf = Password.generateKeyDerivation(password.getBytes(), 32);\n\n byte[] plain = \"0123456789\".getBytes();\n byte[] plainBytes = new byte[100000000];\n for (int i = 0; i < plainBytes.length / plain.length; i++) {\n System.arraycopy(plain, 0, plainBytes, i * plain.length, plain.length);\n }\n\n byte[] encData = AESEncrypt.encrypt(plainBytes, kdf);\n byte[] plainData = AESEncrypt.decrypt(encData, kdf);\n\n assertArrayEquals(plainBytes, plainData);\n\n }", "public String decrypt(String key);", "@Test\r\n public void testEncrypt()\r\n {\r\n System.out.println(\"encrypt\");\r\n String input = \"Hello how are you?\";\r\n KeyMaker km = new KeyMaker();\r\n SecretKeySpec sks = new SecretKeySpec(km.makeKeyDriver(\"myPassword\"), \"AES\");\r\n EncyptDecrypt instance = new EncyptDecrypt();\r\n String expResult = \"0fqylTncsgycZJQ+J5pS7v6/fj8M/fz4bavB/SnIBOQ=\";\r\n String result = instance.encrypt(input, sks);\r\n assertEquals(expResult, result);\r\n }", "public static String decrypt(String seed, String encrypted)\r\nthrows Exception {\r\nbyte[] rawKey = getRawKey(seed.getBytes());\r\nbyte[] enc = Base64.decode(encrypted.getBytes(), Base64.DEFAULT);\r\nbyte[] result = decrypt(rawKey, enc);\r\nreturn new String(result);\r\n}", "String decryptString(String toDecrypt) throws NoUserSelectedException, IllegalValueException;", "@Test\n public void testSuccessDecryption() throws NoSuchAlgorithmException, ComponentInitializationException {\n action = new PopulateOIDCEncryptionParameters();\n action.setForDecryption(true);\n action.setEncryptionParametersResolver(new MockEncryptionParametersResolver());\n action.initialize();\n\n ActionTestingSupport.assertProceedEvent(action.execute(requestCtx));\n Assert.assertNotNull(profileRequestCtx.getSubcontext(RelyingPartyContext.class)\n .getSubcontext(EncryptionContext.class).getAttributeEncryptionParameters());\n }", "@Test\r\n public void testEncryptDecryptPlaintext() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n byte[] add = \"Random authenticated additional data\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n CryptoDetached result = instance.encryptPlaintext(data, add, keys);\r\n String message = instance.decryptPlaintext(result, add, keys);\r\n assertEquals(message, \"Hola caracola\");\r\n }", "void decrypt(ChannelBuffer buffer, Channel c);", "void decryptMessage(String Password);", "@Override\n\tpublic double decrypt(String encryptedText) {\n\t\treturn cryptoProvider.decrypt(encryptedText);\n\t}", "public static String decryptText(byte[] byteCipherText, SecretKey secKey) throws Exception {\n\r\n Cipher aesCipher = Cipher.getInstance(\"AES\");\r\n\r\n aesCipher.init(Cipher.DECRYPT_MODE, secKey);\r\n\r\n byte[] bytePlainText = aesCipher.doFinal(byteCipherText);\r\n\r\n return new String(bytePlainText);\r\n\r\n}", "@Test\n public void testDesEncrypt() {\n\n }", "public BigIntegerMod decrypt(Ciphertext ciphertext);", "@Override\n\tpublic void Decrypt(Object key) {\n\n\t}", "@Override\n public void decrypt() {\n algo.decrypt();\n String cypher = vigenereAlgo(false);\n this.setValue(cypher);\n }", "@org.junit.Test\n public void testCipher() {\n Assert.assertEquals(\"DITISGEHEIM\", Vigenere.cipher(\"DITISGEHEIM\", \"A\", true));\n Assert.assertEquals(\"DITISGEHEIM\", Vigenere.cipher(\"DITISGEHEIM\", \"A\", false));\n\n Assert.assertEquals(\"B\", Vigenere.cipher(\"A\", \"B\", true));\n Assert.assertEquals(\"A\", Vigenere.cipher(\"B\", \"B\", false));\n\n String plain = \"DUCOFIJMA\";\n String key = \"ABC\";\n String shouldEncryptTo = \"DVEOGKJNC\";\n String actualEncrypted = Vigenere.cipher(plain, key, true);\n Assert.assertEquals(shouldEncryptTo, actualEncrypted);\n String decrypted = Vigenere.cipher(shouldEncryptTo, key, false);\n Assert.assertEquals(plain, decrypted);\n }", "public int decryptStorage(String password) throws RemoteException;", "public byte[] decrypt(byte[] data) throws Exception {\n // call overriden function with offset = 0\n return decrypt(data, 0);\n }", "@Test\r\n public void testEncryptDecryptPlaintextBadCipher() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"\".getBytes();\r\n byte[] add = \"Random authenticated additional data\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n CryptoDetached result = instance.encryptPlaintext(data, add, keys);\r\n result.cipher = Base64.getEncoder().encodeToString(\"bad cipher\".getBytes());\r\n\r\n Assertions.assertThrows(SodiumException.class, () -> {\r\n instance.decryptPlaintext(result, add, keys);\r\n });\r\n }", "String decrypt(PBEncryptStorage pbeStorage, String password, byte[] salt);", "@Test\r\n\tpublic void testSimple() throws IOException, URISyntaxException, IllegalKeyException{\r\n\t\tbyte data [] = {97,98,99,100};\r\n\t\tbyte [] keys = {50};\r\n\t\tEncryptionDecryptionManager man = new AlgoritemManaging();\r\n\t\tCaesarEncryption ce = new CaesarEncryption(man);\r\n\t\tbyte[] encData = ce.Encrypt(keys,data);\r\n\t\t\r\n\t\tCaesarDecryption c = new CaesarDecryption(man);\r\n\t\tbyte[] decData = c.Decrypt(keys,encData);\r\n\t\tassert decData [0] == (byte)(97);\r\n\t\tassert decData [1] == (byte)(98);\r\n\t\tassert decData [2] == (byte)(99);\r\n\t\tassert decData [3] == (byte)(100);\r\n\t}", "static String decrypt(byte[] cipherTextArray, PrivateKey privateKey) throws Exception {\n Cipher cipher = Cipher.getInstance(RSA__PADDING);\n\n //Initialize Cipher for DECRYPT_MODE\n cipher.init(Cipher.DECRYPT_MODE, privateKey);\n\n //Perform Decryption\n byte[] decryptedTextArray = cipher.doFinal(cipherTextArray);\n\n return new String(decryptedTextArray);\n }", "@Test\n public void testDecToHex() {\n Assert.assertEquals(\"41\", Cipher_Helper.decToHex(65));\n Assert.assertEquals(\"5A\", Cipher_Helper.decToHex(90));\n Assert.assertEquals(\"4D\", Cipher_Helper.decToHex(77));\n }", "@Test\n public void testEncrypt() throws Exception {\n System.out.println(\"encrypt\");\n String seed = \"\";\n String cleartext = \"\";\n String expResult = \"\";\n String result = Crypto.encrypt(seed, cleartext);\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 int finalDecrypt(byte[] text) {\n if ( text.length != blockSize()) throw new IllegalArgumentException(\"text.length != cipher.blockSize())\");\n decrypt(text);\n int n = 0;\n for(int i = text.length-1; text[i] == 0x00; --i){\n n += 1;\n }\n return text.length - n - 1;\n }", "public abstract String decryptMsg(String msg);", "@Test public void useAppContext() throws Exception {\n Endecrypt test = new Endecrypt();\r\n String oldString = \"lingyang1218yj@\";\r\n System.out.println(\"1、SPKEY为: \" + SPKEY);\r\n System.out.println(\"2、明文密码为: \" + oldString);\r\n String reValue = test.get3DESEncrypt(oldString, SPKEY);\r\n reValue = reValue.trim().intern();\r\n System.out.println(\"3、进行3-DES加密后的内容: \" + reValue);\r\n String reValue2 = test.get3DESDecrypt(reValue, SPKEY);\r\n System.out.println(\"4、进行3-DES解密后的内容: \" + reValue2);\r\n }", "public String decrypt(String encryptedString) throws Exception\n {\n if ( key == null )\n {\n throw new Exception(\"CodecUtil must be initialised with the storeKey first.\");\n }\n try\n {\n Cipher pbeCipher = Cipher.getInstance(\"PBEWithMD5AndDES\");\n pbeCipher.init(Cipher.DECRYPT_MODE, key, new PBEParameterSpec(salt, 20));\n return new String(pbeCipher.doFinal(base64Decode(encryptedString)), \"UTF-8\");\n }\n catch (Exception e)\n {\n throw new Exception(\"Decryption error :\" + e.getMessage());\n }\n }", "public static void main(String[] args) {\n System.out.println(decryptFunction());\n //decryptFunction();\n\n }", "@Test\n public void testCryptographyNegative()\n {\n byte[] sensitiveBytes = sensitiveString.getBytes();\n byte[] secure = StateUtils.encrypt(sensitiveBytes, externalContext);\n \n secure[secure.length-5] = (byte) 1;\n try\n {\n byte[] insecure = StateUtils.decrypt(secure, externalContext);\n Assertions.assertFalse(Arrays.equals(insecure, sensitiveBytes));\n }\n catch (Exception e)\n {\n // do nothing\n }\n }", "@Override\n public byte[] decrypt(byte[] ciphertext) {\n ECPoint point = checkPointOnCurve(ciphertext);\n BigInteger privateKeyInverse = privateKey.getS().modInverse(privateKey.getParams().getOrder());\n return point.multiply(privateKeyInverse).getEncoded(true);\n }", "@Override\r\n\tpublic String decrypt(String cipher) {\n\t\treturn null;\r\n\t}", "@Test\n public void testAesForInputKeyIvMode() throws Exception {\n//TODO: Test goes here... \n/* \ntry { \n Method method = Cryptos.getClass().getMethod(\"aes\", byte[].class, byte[].class, byte[].class, int.class); \n method.setAccessible(true); \n method.invoke(<Object>, <Parameters>); \n} catch(NoSuchMethodException e) { \n} catch(IllegalAccessException e) { \n} catch(InvocationTargetException e) { \n} \n*/\n }", "public static byte[] decrypt(byte[] decrypt, SecretKeySpec keySpec)\n {\n\tbyte[] message = null;\n\t\t\n\ttry {\n\t // Extract the cipher parameters from the end of the input array\n\t byte[] cipherText = new byte[decrypt.length - AES_PARAM_LEN];\n\t byte[] paramsEnc = new byte[AES_PARAM_LEN];\n\t\t\t\n\t System.arraycopy(decrypt, 0, cipherText, 0, cipherText.length);\n\t System.arraycopy(decrypt, cipherText.length, paramsEnc, 0, paramsEnc.length);\n\n\t // Initialize the parameters\n\t AlgorithmParameters params = AlgorithmParameters.getInstance(\"AES\");\n\t params.init(paramsEnc);\n\t \n\t // Initialize the cipher for decryption\n\t Cipher cipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\n\t cipher.init(Cipher.DECRYPT_MODE, keySpec, params);\n\t\t\t\n\t // Decrypt the ciphertext\n\t message = cipher.doFinal(cipherText);\n\n\t} catch (Exception e) {\n\t e.printStackTrace();\n\t}\n\t\t\n\treturn message;\n }", "@Override\n public String decrypt(String s) throws NotInAlphabetException{\n passwordPos = 0; //initialize to 0\n return super.decrypt(s); //invoke parent\n }", "public String decrypt(String value) throws Exception {\r\n\t\tif (value == null || value.equals(\"\"))\r\n\t\t\tthrow new Exception(\"The cipher string can not be null or an empty string.\");\r\n\r\n\t\t// Initialize the cryptography algorithm.\r\n\t\tthis.rijndael.init(Cipher.DECRYPT_MODE, this.key, this.initalVector);\r\n\r\n\t\t// Get an encrypted byte array from a base64 encoded string.\r\n\t\tbyte[] encryptedValue = Base64Encoder.decode(value);\r\n\r\n\t\t// Decrypt the byte array.\r\n\t\tbyte[] decryptedValue = this.rijndael.doFinal(encryptedValue);\r\n\r\n\t\t// Return a string converted from the UTF-8 byte array.\r\n\t\treturn new String(decryptedValue, \"UTF8\");\r\n\t}", "public String ebcDecrypt(String ciphertext, String key) {\n\t\treturn AESEBC.AESDecrypt(ciphertext, key);\n\t}", "@Test\r\n public void testEncryptDecryptPlaintextBadKey() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"\".getBytes();\r\n byte[] add = \"Random authenticated additional data\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n CryptoDetached result = instance.encryptPlaintext(data, add, keys);\r\n Keys keys1 = instance.createKeys(null);\r\n String message = instance.decryptPlaintext(result, add, keys);\r\n Assertions.assertThrows(SodiumException.class, new Executable() {\r\n @Override\r\n public void execute() throws Throwable {\r\n instance.decryptPlaintext(result, add, keys1);\r\n }\r\n });\r\n }", "private String decrypt(String encryptedData) throws Exception {\n Key key = generateKey();\n Cipher c = Cipher.getInstance(ALGO);\n c.init(Cipher.DECRYPT_MODE, key);\n byte[] decordedValue = Base64.getDecoder().decode(encryptedData);\n byte[] decValue = c.doFinal(decordedValue);\n String result = new String(decValue);\n return result;\n }", "public static String decryptText(byte[] byteCipherText, SecretKey secKey) throws Exception {\n\t\t\n\t\t\n\n\t\tSystem.out.println(secKey.toString());\n\n\t\tCipher aesCipher = Cipher.getInstance(\"AES\");\n\n\t\taesCipher.init(Cipher.DECRYPT_MODE, secKey);\n\n\t\tbyte[] bytePlainText = aesCipher.doFinal(byteCipherText);\n\t\t\n\t\t\n\n\t\treturn new String(bytePlainText);\n\n\t}", "private static String decryptAES() {\n\t\tString inFilename = \"7hex.txt\";\n\t\ttry {\n\t\t\tFileReader fr = new FileReader(inFilename);\n\t\t\tBufferedReader br = new BufferedReader(fr);\n\n\t\t\tfinal String keyHex = asciiToHex(\"YELLOW SUBMARINE\");\n\t\t\tfinal String cipherHex = br.readLine();\n\n\t\t\tSecretKey key = new SecretKeySpec(DatatypeConverter.parseHexBinary(keyHex), \"AES\");\n\t\t\tCipher cipher = Cipher.getInstance(\"AES/ECB/NoPadding\");\n\t\t\tcipher.init(Cipher.DECRYPT_MODE, key);\n\t\t\tbyte[] result = cipher.doFinal(DatatypeConverter.parseHexBinary(cipherHex));\n\n\t\t\tbr.close();\n\t\t\tfr.close();\n\n\t\t\treturn new String(result);\n\t\t} catch (Exception e) {\n\t\t\treturn null;\n\t\t}\n\t}", "public static byte [] decrypt(byte [] cipherText, SecretKey key){\r\n\t\ttry {\r\n\t\t\tbyte [] initVector = unpackFromByteArray(cipherText, 0);\r\n\t\t\tint cursor = initVector.length+2;\t\t\t\r\n\t\t\tCipher cipher = Cipher.getInstance(symmetricKeyCryptoMode);\r\n\t\t\tcipher.init(Cipher.DECRYPT_MODE, key, new IvParameterSpec(initVector));\t\t\t\r\n\t\t\treturn cipher.doFinal(cipherText,cursor,cipherText.length-cursor);\r\n\t\t} catch (Exception e){\r\n\t\t\tthrow new ModelException(ExceptionReason.INVALID_PARAMETER, \"Error decrypting cipherText \"+cipherText,e);\r\n\t\t}\r\n\t}", "public void decrypt() {\n try {\n // Create input and output streams\n System.out.println(\"Loading files\");\n FileInputStream in = new FileInputStream(this.input);\n FileOutputStream out = new FileOutputStream(this.output);\n\n // Skip IV values\n in.getChannel().position(cipher.getBlockSize());\n\n /*\n Using CipherInputStream object to read from encrypted file\n cipherIn reads data from input stream and and returns the decrypted value\n */\n System.out.println(\"Creating cipher stream\");\n CipherInputStream cipherIn = new CipherInputStream(in, this.cipher);\n\n System.out.println(\"Starting file decryption\");\n byte[] buffer = new byte[Common.BLOCK_SIZE];\n int len;\n // Reading from the input stream\n while ((len = cipherIn.read(buffer)) != -1)\n // Write the decrypted message to output stream\n out.write(buffer, 0, len);\n\n // Close all streams\n System.out.println(\"Closing file streams\");\n cipherIn.close();\n out.flush();\n out.close();\n\n System.out.println(\"Decryption complete\");\n } catch (Exception e) {\n System.out.println(\"Error: \" + e.getMessage());\n }\n }", "public String decrypt(String text) {\n return content.decrypt(text);\n }", "@Override\n\tpublic String decryptAES(byte[] key, String cipherText) {\n\t\ttry{\n\t\t\tbyte[] encryptedIvTextBytes = DatatypeConverter.parseHexBinary(cipherText);\n\t int ivSize = 16;\n\n\t byte[] iv = new byte[ivSize];\n\t System.arraycopy(encryptedIvTextBytes, 0, iv, 0, iv.length);\n\t IvParameterSpec ivParameterSpec = new IvParameterSpec(iv);\n\t int encryptedSize = encryptedIvTextBytes.length - ivSize;\n\t byte[] encryptedBytes = new byte[encryptedSize];\n\t System.arraycopy(encryptedIvTextBytes, ivSize, encryptedBytes, 0, encryptedSize);\n\t SecretKeySpec secretKeySpec = new SecretKeySpec(key, \"AES\");\n\t Cipher cipherDecrypt = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\n\t cipherDecrypt.init(Cipher.DECRYPT_MODE, secretKeySpec, ivParameterSpec);\n\t byte[] decrypted = cipherDecrypt.doFinal(encryptedBytes);\n\n\t return new String(decrypted);\n\t\t}catch(Exception e) {\n\t\t\t\n\t\t}\n\t\treturn null;\n\t}", "public String decrypt( String nonce, String ciphertext ) throws Exception\n\t{\n\t\t// read key from file\n\t\tBufferedReader buf = new BufferedReader( new FileReader(keyFile) );\n\t\tString keystr = buf.readLine();\n\t\tbuf.close();\n\n\t\t// create secret key\n\t\tString keyType = \"PBEWithMD5AndDES\";\n\t\tchar[] keyChars = keystr.toCharArray();\n\t\tbyte[] nonceBytes = nonce.getBytes();\n \tSecretKeyFactory factory = SecretKeyFactory.getInstance( keyType );\n \tPBEKeySpec spec = new PBEKeySpec( keyChars, nonceBytes, 1024, 128 );\n \tSecretKey raw = factory.generateSecret( spec );\n \tSecretKey key = new SecretKeySpec( raw.getEncoded(), \"AES\" );\n\n\t\t// decode and decrypt\n\t\tbyte[] decoded = Base64.decodeBase64( ciphertext );\n\t\tCipher cipher = Cipher.getInstance( \"AES/CBC/PKCS5Padding\" );\n\t\tIvParameterSpec params = new IvParameterSpec( nonceBytes );\n\t\tcipher.init( Cipher.DECRYPT_MODE, key, params );\n\t\treturn new String( cipher.doFinal(decoded) );\n\t}", "public String decrypt(final PrivateKeyInterface key, final String data)\n throws DecryptionFailedException\n {\n return this.decryptionCipher().decrypt(key, data);\n }", "@Around(\"decryptPointCut()\")\n public Object aroundDecrypt(ProceedingJoinPoint joinPoint) throws Throwable {\n Object responseObj = joinPoint.proceed(); // 方法执行\n handleDecrypt(responseObj); // 解密CryptField注解字段\n return responseObj;\n\n }", "@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 [] decrypt(byte [] cipherText, char [] password){\r\n\t\tint cursor = 0;\r\n\t\tbyte [] salt = unpackFromByteArray(cipherText,cursor);\r\n\t\tSecretKey key = generateSecretKey(salt, password);\r\n\t\tcursor += salt.length+2;\r\n\t\tbyte [] encoded = unpackFromByteArray(cipherText,cursor);\r\n\t\ttry {\r\n\t\t\tCipher cipher = Cipher.getInstance(symmetricKeyCryptoMode);\r\n\t\t\tcipher.init(Cipher.DECRYPT_MODE, key, new IvParameterSpec(salt) );\r\n\t\t\treturn cipher.doFinal(encoded);\r\n\t\t} catch (Exception e){\r\n\t\t\tthrow new ModelException(\"Error decrypting cipherText \"+cipherText,e);\r\n\t\t}\r\n\t}", "public String decrypt(String text) {\n byte[] dectyptedText = null;\n try {\n // decrypt the text using the private key\n cipher.init(Cipher.DECRYPT_MODE, publicKey);\n byte[] data=Base64.decode(text, Base64.NO_WRAP);\n String str=\"\";\n for(int i=0;i<data.length;i++)\n {\n str+=data[i]+\"\\n\";\n }\n android.util.Log.d(\"ali\",str);\n dectyptedText = cipher.doFinal(Base64.decode(text, Base64.NO_WRAP));\n return new String(dectyptedText);\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n return null;\n }", "public String decrypt(String input)\n {\n CaesarCipherTwo cipher = new CaesarCipherTwo(26 - mainKey1, 26 - mainKey2);\n return cipher.encrypt(input);\n }", "@Override\n public void decrypt(byte[] text) {\n if ( text.length != blockSize()) throw new IllegalArgumentException(\"text.length != cipher.blockSize())\");\n byte []temp = new byte[nonce.length];\n System.arraycopy(text, 0, temp, 0, blockSize());\n ciper.setKey(key);\n ciper.decrypt(text);\n xor_nonce(text);\n System.arraycopy(temp, 0, nonce, 0, blockSize());\n }", "public static byte[] aesDecrypt(byte[] ciphertext, SecretKey decryptionKey) {\n\t\t\n\t\tbyte[] result = null;\n\t\tCipher cipher;\n\t\ttry {\n\t\t\t// Using our custom-constant salt and iteration count\n\t\t\tcipher = Cipher.getInstance(\"PBEWithSHA256And256BitAES-CBC-BC\");\n\t\t\tbyte[] salt = \"Extr3m3lyS3cr3tSalt!\".getBytes();\n\t\t\tint count = 20;\n\t\t\tPBEParameterSpec pbeParamSpec = new PBEParameterSpec(salt, count);\n\t\t\tcipher.init(Cipher.DECRYPT_MODE, decryptionKey, pbeParamSpec);\n\t\t\tresult = cipher.doFinal(ciphertext);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\n\t\treturn result;\n\t}", "private String teaDecrypt(String ciphertext, String password) {\n if (ciphertext.length() == 0) {\n return (\"\");\n }\n int[] v = hexStrToLongs(ciphertext);\n int[] k = strToLongs(password.substring(0, 16).toLowerCase());\n int n = v.length;\n\n // int z = v[n - 1], y = v[0], delta = 0x9E3779B9;\n // int mx, e, q = (int) Math.floor(6 + 52 / n), sum = q * delta;\n int z = v[n - 1];\n int y = v[0];\n int delta = 0x9E3779B9;\n int mx;\n int e;\n int q = (int) Math.floor(6 + 52 / n);\n int sum = q * delta;\n\n while (sum != 0) {\n e = sum >>> 2 & 3;\n for (int p = n - 1; p >= 0; p--) {\n z = v[p > 0 ? p - 1 : n - 1];\n mx = (z >>> 5 ^ y << 2) + (y >>> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z);\n y = v[p] -= mx;\n }\n sum -= delta;\n }\n\n String plaintext = longsToStr(v);\n\n // strip trailing null chars resulting from filling 4-char blocks:\n\n return plaintext;\n }", "@Test\r\n public void testEncryptDecryptPlaintextBadTag() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"\".getBytes();\r\n byte[] add = \"Random authenticated additional data\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n CryptoDetached result = instance.encryptPlaintext(data, add, keys);\r\n result.tag = Base64.getEncoder().encodeToString(\"bad tag\".getBytes());\r\n Assertions.assertThrows(SodiumException.class, () -> {\r\n instance.decryptPlaintext(result, add, keys);\r\n });\r\n }", "public byte[] decrypt(byte[] input, Key privKey) throws Exception {\n\t\tcipher.init(Cipher.DECRYPT_MODE, privKey);\n\t\treturn cipher.doFinal(input);\t\n\t}", "@Test\r\n public void testEncryptDecryptPlaintextNull() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"\".getBytes();\r\n byte[] add = \"Random authenticated additional data\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n CryptoDetached result = instance.encryptPlaintext(data, add, keys);\r\n String message = instance.decryptPlaintext(result, add, keys);\r\n assertEquals(message, \"\");\r\n }", "@Test\n public void testAesForInputKeyMode() throws Exception {\n//TODO: Test goes here... \n/* \ntry { \n Method method = Cryptos.getClass().getMethod(\"aes\", byte[].class, byte[].class, int.class); \n method.setAccessible(true); \n method.invoke(<Object>, <Parameters>); \n} catch(NoSuchMethodException e) { \n} catch(IllegalAccessException e) { \n} catch(InvocationTargetException e) { \n} \n*/\n }", "char decipher(int charToDeCipher);", "public static String decrypt(String encrypted, Keys keys) throws GeneralSecurityException {\n Cipher cipher = Cipher.getInstance(ENC_SYSTEM);\n String[] data = COLON.split(encrypted);\n if (data.length != 3) {\n throw new GeneralSecurityException(\"Invalid encrypted data!\");\n }\n String mac = data[0];\n String iv = data[1];\n String cipherText = data[2];\n\n // Verify that the ciphertext and IV haven't been tampered with first\n String dataToAuth = iv + \":\" + cipherText;\n if (!computeMac(dataToAuth, keys.getMacKey()).equals(mac)) {\n throw new GeneralSecurityException(\"Incorrect MAC!\");\n }\n\n // Decrypt the ciphertext\n byte[] ivBytes = decodeBase64(iv);\n cipher.init(Cipher.DECRYPT_MODE, keys.getEncKey(), new IvParameterSpec(ivBytes));\n byte[] bytes = cipher.doFinal(decodeBase64(cipherText));\n\n // Decode the plaintext bytes into a String\n CharsetDecoder decoder = Charset.defaultCharset().newDecoder();\n decoder.onMalformedInput(CodingErrorAction.REPORT);\n decoder.onUnmappableCharacter(CodingErrorAction.REPORT);\n /*\n * We are coding UTF-8 (guaranteed to be the default charset on\n * Android) to Java chars (UTF-16, 2 bytes per char). For valid UTF-8\n * sequences, then:\n * 1 byte in UTF-8 (US-ASCII) -> 1 char in UTF-16\n * 2-3 bytes in UTF-8 (BMP) -> 1 char in UTF-16\n * 4 bytes in UTF-8 (non-BMP) -> 2 chars in UTF-16 (surrogate pair)\n * The decoded output is therefore guaranteed to fit into a char\n * array the same length as the input byte array.\n */\n CharBuffer out = CharBuffer.allocate(bytes.length);\n CoderResult result = decoder.decode(ByteBuffer.wrap(bytes), out, true);\n if (result.isError()) {\n /* The input was supposed to be the result of encrypting a String,\n * so something is very wrong if it cannot be decoded into one! */\n throw new GeneralSecurityException(\"Corrupt decrypted data!\");\n }\n decoder.flush(out);\n return out.flip().toString();\n }", "public String tableDecrypt(String ciphertext, String key) {\n\t\treturn AESMain2.AESDecrypt(ciphertext, key);\n\t}", "@Test\n public void testAesEncryptForInputKey() throws Exception {\n byte[] key = Cryptos.generateAesKey();\n String input = \"foo message\";\n\n byte[] encryptResult = Cryptos.aesEncrypt(input.getBytes(\"UTF-8\"), key);\n String descryptResult = Cryptos.aesDecrypt(encryptResult, key);\n\n System.out.println(key);\n System.out.println(descryptResult);\n }", "public byte[] decrypt(final PrivateKeyInterface key, final byte[] data)\n throws DecryptionFailedException\n {\n return this.decryptionCipher().decrypt(key, data);\n }", "@Test\n public void testAesEncryptForInputKeyIv() throws Exception {\n//TODO: Test goes here... \n }", "public String decrypt(String encrypted) {\n try {\n IvParameterSpec iv = new IvParameterSpec(initVector);\n SecretKeySpec skeySpec = new SecretKeySpec(privateKey, \"AES\");\n\n Cipher cipher = Cipher.getInstance(\"AES/CBC/PKCS5PADDING\");\n cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv);\n\n byte[] original = cipher.doFinal(Base64Coder.decode(encrypted));\n\n return new String(original);\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n\n return null;\n }", "public void decrypt(String s)\n\t{\n\t\tchar chars[] = s.toCharArray();\n\t\tString message = \"\";\n\t\tfor(int i = 0; i < chars.length; i++)\n\t\t{\n\t\t\tif(chars[i] == (char)32)\n\t\t\t{\n\t\t\t\tBigInteger encrypted = new BigInteger(message);\n\t\t\t\tconvertToString(encrypted.modPow(privateKey, publicKey).toString());\n\t\t\t\tmessage = \"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmessage += chars[i];\n\t\t\t}\n\t\t}\n\t\tmyView.setDecryptText(myDecryptedMessage);\n\t\tmyDecryptedMessage = \"\";\n\t}", "public void runDecrypt(String filePath) {\n try {\n byte[] paramArrayOfbyte = Files.readAllBytes(Paths.get(filePath));\n if (paramArrayOfbyte.length >= 1024 && ((paramArrayOfbyte[0] == 73 && paramArrayOfbyte[1] == 71\n && paramArrayOfbyte[2] == 69 && paramArrayOfbyte[3] == 70)\n || (paramArrayOfbyte[0] == 67 && paramArrayOfbyte[1] == 68 && paramArrayOfbyte[2] == 69\n && paramArrayOfbyte[3] == 70))) {\n // TODO: figure out why it only selects 1024 bytes.\n if (paramArrayOfbyte.length != 1024) {\n byte[] arrayOfByte = new byte[1024];\n System.arraycopy(paramArrayOfbyte, 0, arrayOfByte, 0, 1024);\n paramArrayOfbyte = arrayOfByte;\n }\n\n // Not sure why needing this section?\n byte[] arrayOfByte1 = new byte[12];\n byte[] arrayOfByte2 = new byte[12];\n System.arraycopy(paramArrayOfbyte, 4, arrayOfByte1, 0, 12);\n System.arraycopy(paramArrayOfbyte, 16, arrayOfByte2, 0, 12);\n\n // Init the most important object.\n com.b.a.b.aa.a h = new com.b.a.b.aa.a(new com.b.a.b.aa.b() {\n public byte[] a() {\n return null;\n }\n\n public int b() {\n return 3;\n }\n });\n\n String str1 = (new String(paramArrayOfbyte, 28, 32)).intern();\n // String str2 = a.a(this.n, str1);\n String str2 = Decrypt.DECRYPTION_KEY;\n int i = h.a(str2.getBytes());\n byte[] guessResult = h.b();\n h.b(guessResult); // Digest, this also sets com.b.a.a.aa.a.b. (The hashmap)\n if (i != 0)\n System.out.println(Dumper.dump(h.a(i)));\n else\n System.out.println(\"error in i.\");\n\n // Using the official file reader.\n net.zamasoft.reader.book.a.b randomAccessFile = new net.zamasoft.reader.book.a.b(new File(filePath));\n System.out.println(\"file length: \" + randomAccessFile.length());\n System.out.println(\"key: \" + com.b.a.a.a.c.a.getBLatest());\n ArrayList<Byte> bytes = new ArrayList<>();\n while (!randomAccessFile.isEOF()) {\n byte b = (byte) randomAccessFile.read();\n bytes.add(b);\n }\n assert randomAccessFile.length() == bytes.size();\n byte[] bs = new byte[bytes.size()];\n for (int ii = 0; ii < bs.length; ii++) {\n bs[ii] = bytes.get(ii);\n }\n System.out.println(\"bytes length: \" + bytes.size());\n System.out.println(new String(bs, \"utf-8\"));\n } else {\n System.out.println(\"NOOOOOOOO!\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "private static byte[] decrypt(byte[] bytes, SecretKey aesKey) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, InvalidAlgorithmParameterException {\n Cipher cipher = Cipher.getInstance(decodeBytesToString(new byte[]{-70, -77, -122, -114, 56, 56, -114, 7, 53, -68, -80, -117, 10, 32, 58, -72, 62, 59, 60, 86})); // AES/CBC/PKCS5Padding\n IvParameterSpec ivSpec = new IvParameterSpec(decodeBytesToString(IV).getBytes());\n cipher.init(Cipher.DECRYPT_MODE, aesKey, ivSpec);\n return cipher.doFinal(bytes);\n }", "public static byte[] decrypt(byte[] cipherText)\r\n {\r\n try {\r\n SecretKeySpec secretKey = new SecretKeySpec(key, ALGORITHM);\r\n Cipher cipher = Cipher.getInstance(ALGORITHM);\r\n cipher.init(Cipher.DECRYPT_MODE, secretKey);\r\n return cipher.doFinal(cipherText);\r\n \r\n } catch (Exception exc) {\r\n exc.printStackTrace();\r\n }\r\n return null;\r\n }", "private BigInteger decrypt(BigInteger encrypted, BigInteger privateKey, BigInteger modulus){\n return encrypted.modPow(privateKey, modulus);\n }", "public static String decrypt(String strToDecrypt)\n {\n try\n {\n Cipher cipher = Cipher.getInstance(\"AES/ECB/PKCS5PADDING\");\n final SecretKeySpec secretKey = new SecretKeySpec(key, \"AES\");\n cipher.init(Cipher.DECRYPT_MODE, secretKey);\n final String decryptedString = new String(cipher.doFinal(Base64.decodeBase64(strToDecrypt)));\n return decryptedString;\n }\n catch (Exception e)\n {\n e.printStackTrace();\n\n }\n return null;\n }", "@Test\n\tpublic void doEncrypt() {\n\t\tString src = \"18903193260\";\n\t\tString des = \"9oytDznWiJfLkOQspiKRtQ==\";\n\t\tAssert.assertEquals(Encryptor.getEncryptedString(KEY, src), des);\n\n\t\t/* Encrypt some plain texts */\n\t\tList<String> list = new ArrayList<String>();\n\t\tlist.add(\"18963144219\");\n\t\tlist.add(\"13331673185\");\n\t\tlist.add(\"18914027730\");\n\t\tlist.add(\"13353260117\");\n\t\tlist.add(\"13370052053\");\n\t\tlist.add(\"18192080531\");\n\t\tlist.add(\"18066874640\");\n\t\tlist.add(\"15357963496\");\n\t\tlist.add(\"13337179174\");\n\t\tfor (String str : list) {\n\t\t\tSystem.out.println(Encryptor.getEncryptedString(KEY, str));\n\t\t}\n\t}", "@Test\r\n public void testCryptoBoxSeal() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] result = instance.cryptoBoxSeal(keys, data);\r\n assertNotNull(result);\r\n }", "public String tselDecrypt(String key, String message)\n\t{\n\n\t\tif (key == null || key.equals(\"\")) \n\t\t{\n\t\t\treturn message;\n\t\t}\n\n\t\tif (message == null || message.equals(\"\")) \n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t\tCryptoUtils enc = new CryptoUtils(key, Cipher.DECRYPT_MODE);\n\t\tString messageEnc = enc.process(message);\n\n\t\treturn messageEnc;\n\t}", "public static void dec(String cipherText, String key) {\n char msg[] = cipherText.toCharArray();\n int msglen = msg.length;\n int i,j;\n \n // Creating new char arrays\n char keygenerator[] = new char[msglen];\n char encMsg[] = new char[msglen];\n char decdMsg[] = new char[msglen];\n \n /* Generate key, using keyword in cyclic manner equal to the length of original message i.e plaintext */\n for(i = 0, j = 0; i <msglen; ++i, ++j)\n {\n if(j == key.length() - 1)\n {\n j = 0;\n }\n keygenerator[i] = key.charAt(j);\n }\n \n //Decryption\n for(i = 0; i < msglen; ++i) {\n decdMsg[i] = (char)((((encMsg[i] - keygenerator[i]) + 26) % 26) + 'A');\n }\n\n System.out.println(\"Decrypted Message: \" + String.valueOf(decdMsg));\n }", "@Test\r\n public void testEncrypt_decrypt_plaintext_bad_nonce() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"\".getBytes();\r\n byte[] add = \"Random authenticated additional data\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n CryptoDetached result = instance.encryptPlaintext(data, add, keys);\r\n result.nonce = Base64.getEncoder().encodeToString(\"bad nonce\".getBytes());\r\n Assertions.assertThrows(SodiumException.class, () -> {\r\n instance.decryptPlaintext(result, add, keys);\r\n });\r\n }", "@Test\r\n public void testEncryptDecryptPlaintextBadAdd() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"\".getBytes();\r\n byte[] add = \"Random authenticated additional data\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n CryptoDetached result = instance.encryptPlaintext(data, add, keys);\r\n byte[] add1 = \"bad add\".getBytes();\r\n Assertions.assertThrows(SodiumException.class, () -> {\r\n instance.decryptPlaintext(result, add1, keys);\r\n });\r\n }", "private static byte[] passwordDecrypt(char[] password, byte[] ciphertext) throws Exception {\n\n\t\t// Read in the salt.\n\t\tbyte[] salt = new byte[8];\n\t\tByteArrayInputStream bais = new ByteArrayInputStream(ciphertext);\n\t\tbais.read(salt, 0, 8);\n\n\t\t// The remaining bytes are the actual ciphertext.\n\t\tbyte[] remainingCiphertext = new byte[ciphertext.length - 8];\n\t\tbais.read(remainingCiphertext, 0, ciphertext.length - 8);\n\n\t\t// Create a PBE cipher to decrypt the byte array.\n\t\tPBEKeySpec keySpec = new PBEKeySpec(password);\n\t\tSecretKeyFactory keyFactory = SecretKeyFactory.getInstance(\"PBEWithSHAAndTwofish-CBC\");\n\t\tSecretKey key = keyFactory.generateSecret(keySpec);\n\t\tPBEParameterSpec paramSpec = new PBEParameterSpec(salt, ITERATIONS);\n\t\tCipher cipher = Cipher.getInstance(\"PBEWithSHAAndTwofish-CBC\");\n\n\t\t// Perform the actual decryption.\n\t\tcipher.init(Cipher.DECRYPT_MODE, key, paramSpec);\n\t\treturn cipher.doFinal(remainingCiphertext);\n\t}", "public String decrypt(String text) {\n\t\t\n\t\t//Porta encryption is symmetric so no additional decryption implementation is necessary\n\t\treturn encrypt(text);\n\t}", "public DecryptionCipherInterface decryptionCipher()\n {\n return this.decryptionCipher;\n }", "@Test\r\n public void testVerify() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }", "public EncryptorReturn decrytp(String in) throws CustomizeEncryptorException;", "@Override\n public void onClick(final View arg0) {\n if (key != null) {\n if (encrypt != null) {\n decrypt = key.decrypt(encrypt);\n messageTxt.setText(new String(decrypt.toByteArray()));\n } else if (messageTxt.getText().length() > 0\n && !messageTxt.getText().equals(\"\")) {\n String encryptedMessage = messageTxt.getText().toString();\n encryptedMessage = encryptedMessage.replace(\" \", \"\");\n encryptedMessage = encryptedMessage.trim();\n Log.i(\"encryptedMessage\", encryptedMessage);\n try {\n decrypt = (BigInteger) key.decrypt(new BigInteger(\n encryptedMessage));\n messageTxt.setText(new String(decrypt.toByteArray()));\n } catch (Exception e) {\n e.printStackTrace();\n Toast.makeText(ShhActivity.this, \"Your text cannot be decrypted\",\n Toast.LENGTH_SHORT).show();\n }\n } else {\n Toast.makeText(ShhActivity.this, \"Your text cannot be decrypted\",\n Toast.LENGTH_SHORT).show();\n }\n }\n }", "public String decrypt(final String encryptedBlob)\n throws GeneralSecurityException, IOException {\n final String methodName = \":decrypt\";\n Logger.v(TAG + methodName, \"Starting decryption\");\n\n if (StringExtensions.isNullOrBlank(encryptedBlob)) {\n throw new IllegalArgumentException(\"Input is empty or null\");\n }\n\n int encodeVersionLength = encryptedBlob.charAt(0) - 'a';\n if (encodeVersionLength <= 0) {\n final String message = String.format(\n \"Encode version length: '%s' is not valid, it must be greater of equal to 0. \" +\n \"Assuming string is not encrypted. Returning input blob.\",\n encodeVersionLength\n );\n Logger.w(TAG + methodName, message);\n return encryptedBlob;\n }\n\n if (!encryptedBlob.substring(1, 1 + encodeVersionLength).equals(ENCODE_VERSION)) {\n final String message = String.format(\n \"Unsupported encode version received. Encode version supported is: %s. \" +\n \"Assuming string is not encrypted. Returning input blob.\",\n ENCODE_VERSION\n );\n Logger.w(TAG + methodName, message);\n return encryptedBlob;\n }\n\n final byte[] bytes = Base64\n .decode(encryptedBlob.substring(1 + encodeVersionLength), Base64.DEFAULT);\n\n // get key version used for this data. If user upgraded to different\n // API level, data needs to be updated\n final String keyVersion = new String(bytes, 0, KEY_VERSION_BLOB_LENGTH,\n AuthenticationConstants.ENCODING_UTF8);\n Logger.i(TAG + methodName, \"\", \"Encrypt version:\" + keyVersion);\n\n final SecretKey secretKey = getKey(keyVersion);\n final SecretKey hmacKey = getHMacKey(secretKey);\n\n // byte input array: encryptedData-iv-macDigest\n final int ivIndex = bytes.length - DATA_KEY_LENGTH - HMAC_LENGTH;\n final int macIndex = bytes.length - HMAC_LENGTH;\n final int encryptedLength = ivIndex - KEY_VERSION_BLOB_LENGTH;\n if (ivIndex < 0 || macIndex < 0 || encryptedLength < 0) {\n throw new IOException(\"Invalid byte array input for decryption.\");\n }\n\n // Calculate digest again and compare to the appended value\n // incoming message: version+encryptedData+IV+Digest\n // Digest of EncryptedData+IV excluding key Version and digest\n final Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);\n final Mac mac = Mac.getInstance(HMAC_ALGORITHM);\n mac.init(hmacKey);\n mac.update(bytes, 0, macIndex);\n final byte[] macDigest = mac.doFinal();\n\n // Compare digest of input message and calculated digest\n assertHMac(bytes, macIndex, bytes.length, macDigest);\n\n // Get IV related bytes from the end and set to decrypt mode with\n // that IV.\n // It is using same cipher for different version since version# change\n // will mean upgrade to AndroidKeyStore and new Key.\n cipher.init(Cipher.DECRYPT_MODE, secretKey, new IvParameterSpec(bytes, ivIndex,\n DATA_KEY_LENGTH));\n\n // Decrypt data bytes from 0 to ivindex\n final String decrypted = new String(cipher.doFinal(bytes, KEY_VERSION_BLOB_LENGTH,\n encryptedLength), AuthenticationConstants.ENCODING_UTF8);\n Logger.v(TAG + methodName, \"Finished decryption\");\n return decrypted;\n }", "public void testCaesar(){\n String msg = \"At noon be in the conference room with your hat on for a surprise party. YELL LOUD!\";\n \n /*String encrypted = encrypt(msg, key);\n System.out.println(\"encrypted \" +encrypted);\n \n String decrypted = encrypt(encrypted, 26-key);\n System.out.println(\"decrypted \" + decrypted);*/\n \n \n String encrypted = encrypt(msg, 15);\n System.out.println(\"encrypted \" +encrypted);\n \n }", "@Override\n public String decrypt(String encryptedText) {\n if (StringUtils.isBlank(encryptedText)) {\n return null;\n }\n\n try {\n byte[] decoded = Base64.getDecoder().decode(encryptedText);\n\n byte[] iv = Arrays.copyOfRange(decoded, 0, GCM_IV_LENGTH);\n\n Cipher cipher = Cipher.getInstance(ENCRYPT_ALGORITHM);\n GCMParameterSpec ivSpec = new GCMParameterSpec(GCM_TAG_LENGTH * Byte.SIZE, iv);\n cipher.init(Cipher.DECRYPT_MODE, getKeyFromPassword(), ivSpec);\n\n byte[] ciphertext = cipher.doFinal(decoded, GCM_IV_LENGTH, decoded.length - GCM_IV_LENGTH);\n\n return new String(ciphertext, StandardCharsets.UTF_8);\n } catch (NoSuchAlgorithmException\n | IllegalArgumentException\n | InvalidKeyException\n | InvalidAlgorithmParameterException\n | IllegalBlockSizeException\n | BadPaddingException\n | NoSuchPaddingException e) {\n LOG.debug(ERROR_DECRYPTING_DATA, e);\n throw new EncryptionException(e);\n }\n }", "@Test\r\n public void testCryptoBox() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys sender = instance.createKeys(null);\r\n Keys receiver = instance.createKeys(null);\r\n CryptoBox result = instance.cryptoBox(data, sender, receiver);\r\n assertNotNull(result);\r\n }", "public static byte[] decryptByte (byte[] cipherText, SecretKey key,byte[] IV) throws Exception\n {\n //Create cipher for AES with PKCS Padding\n Cipher cipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\n //Get the spec of the genetated key, required for ciper\n SecretKeySpec keySpec = new SecretKeySpec(key.getEncoded(), \"AES\");\n //Get the spec of the generated iv, reuired for ciper\n IvParameterSpec ivSpec = new IvParameterSpec(IV);\n \n //use cipher to decrypt\n cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec);\n byte[] decryptedText = cipher.doFinal(cipherText);\n return decryptedText;\n }", "protected byte[] decryptAES(byte[] cipherText, byte[] iv, SecretKey secretKey) throws GeneralSecurityException {\n // Instantiate Cipher with the AES Instance and IvParameterSpec with the iv\n final Cipher cipher = Cipher.getInstance(AES_MODE);\n final IvParameterSpec ivParameterSpec = new IvParameterSpec(iv);\n // Initialize cipher with the desired parameters\n cipher.init(Cipher.DECRYPT_MODE, secretKey, ivParameterSpec);\n // Return plaintext\n try {\n return cipher.doFinal(cipherText);\n } catch (BadPaddingException e) {\n throw new BadPaddingException(WRONG_INTEGRITY_MODE);\n }\n }", "@NonNull\n @Override\n protected String decryptBytes(@NonNull final Key key, @NonNull final byte[] bytes,\n @Nullable final DecryptBytesHandler handler)\n throws GeneralSecurityException, IOException {\n final Cipher cipher = getCachedInstance();\n\n try {\n // read the initialization vector from bytes array\n final IvParameterSpec iv = IV.readIv(bytes);\n cipher.init(Cipher.DECRYPT_MODE, key, iv);\n\n // decrypt the bytes using cipher.doFinal(). Using a CipherInputStream for decryption has historically led to issues\n // on the Pixel family of devices.\n // see https://github.com/oblador/react-native-keychain/issues/383\n byte[] decryptedBytes = cipher.doFinal(bytes, IV.IV_LENGTH, bytes.length - IV.IV_LENGTH);\n return new String(decryptedBytes, UTF8);\n } catch (Throwable fail) {\n Log.w(LOG_TAG, fail.getMessage(), fail);\n\n throw fail;\n }\n }", "public byte[] decrypt(byte[] data, int offset) throws Exception {\n // check if there is data to decrypt after the offset and iv\n if (data.length <= BLOCK_SIZE_BYTES + offset) {\n throw new Exception(\"No data to decrypt\");\n }\n\n // get iv value from the beggining of data\n byte[] iv = new byte[BLOCK_SIZE_BYTES];\n System.arraycopy(data, offset, iv, 0, BLOCK_SIZE_BYTES);\n\n // init cipher instance\n m_cipher.init(javax.crypto.Cipher.DECRYPT_MODE, m_keySpec, new IvParameterSpec(iv));\n\n // return decrypted value\n return m_cipher.doFinal(data, (BLOCK_SIZE_BYTES + offset), data.length - (BLOCK_SIZE_BYTES + offset));\n }" ]
[ "0.8240913", "0.7780352", "0.7598784", "0.7242583", "0.7037228", "0.6987527", "0.688776", "0.6871873", "0.68228567", "0.6771486", "0.66644937", "0.6545095", "0.65263474", "0.6524514", "0.648626", "0.6464579", "0.6450357", "0.6441873", "0.6427253", "0.63712853", "0.63608485", "0.6358652", "0.62992126", "0.6293352", "0.6277651", "0.62769085", "0.6272351", "0.61946183", "0.6184578", "0.6155277", "0.6154894", "0.61543006", "0.61503947", "0.6097772", "0.6090128", "0.6076618", "0.6072423", "0.60705405", "0.60661995", "0.60655874", "0.60611254", "0.60515726", "0.6046536", "0.6045297", "0.6043155", "0.6040604", "0.60399556", "0.60120237", "0.6000522", "0.59778255", "0.59668005", "0.59538144", "0.59467226", "0.5924485", "0.59204257", "0.5917991", "0.59028596", "0.5897139", "0.58815217", "0.5880682", "0.5879092", "0.5876039", "0.5870598", "0.5869935", "0.58614826", "0.58370984", "0.5837003", "0.58314323", "0.58293265", "0.5827244", "0.5813191", "0.58098596", "0.5803596", "0.5800206", "0.5798773", "0.57975644", "0.5797179", "0.57966", "0.57956237", "0.578293", "0.5777423", "0.57672477", "0.5746693", "0.5739696", "0.57365596", "0.57344854", "0.5729006", "0.5724054", "0.5714423", "0.56945187", "0.56904584", "0.5684809", "0.56748813", "0.5674684", "0.5673038", "0.56653047", "0.56631386", "0.5662074", "0.565887", "0.56522405" ]
0.84106624
0
Test of toHex method, of class Crypto.
@Test public void testToHex_String() { System.out.println("toHex"); String txt = ""; String expResult = ""; String result = Crypto.toHex(txt); assertEquals(expResult, result); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testFromHex() {\n System.out.println(\"fromHex\");\n String hex = \"\";\n String expResult = \"\";\n String result = Crypto.fromHex(hex);\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 }", "@Test\n public void testToHex() \n {\n System.out.println(\"toHex\");\n String argument = \"12\";\n Converter instance = new Converter();\n String expResult = \"C\";\n String result = instance.toHex(argument);\n \n //assert that the result we expect comes out. If the result that is expecte is generated then the test will pass. If not, then it will fail\n assertEquals(expResult, result);\n assertEquals(\"D\", instance.toHex(\"13\"));\n assertEquals(\"7B\", instance.toHex(\"123\"));\n assertEquals(\"D\", instance.toHex(\"13\"));\n assertEquals(\"2710\", instance.toHex(\"10000\"));\n }", "@Test\n public void testToHex_byteArr() {\n System.out.println(\"toHex\");\n byte[] buf = null;\n String expResult = \"\";\n String result = Crypto.toHex(buf);\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 }", "@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 }", "@Test\n public void testBytesToHexString() {\n String testHex = ByteUtils.bytesToHexString(testBytes); \n assertEquals(testHex.length(), testBytes.length * 2);\n }", "@Test\n public void testDecToHex() {\n Assert.assertEquals(\"41\", Cipher_Helper.decToHex(65));\n Assert.assertEquals(\"5A\", Cipher_Helper.decToHex(90));\n Assert.assertEquals(\"4D\", Cipher_Helper.decToHex(77));\n }", "@Test\n public void testHexAndBytesTransformation() {\n byte[] bytes = ByteUtils.stringToBytes(ByteUtils.bytesToHexString(testBytes));\n assertArrayEquals(testBytes, bytes); \n }", "@Test\n\tpublic void testBytesToHexStringForSrcMode() throws Exception {\n//TODO: Test goes here... \n\t}", "@Test(dataProvider = \"dataForHexadecimal\")\n public void testToHexadecimal(int num, String hexadecimal) {\n String result = Tools.toHexadecimal(num);\n assertEquals(result, hexadecimal);\n System.out.println(\"testToHexadecimal()\");\n }", "public void binToHex(){\n\t\tthis.inputBin();\n\t\tif(checkValue()==true){\n\t\t\tthis.toHex();\n\t\t\tthis.outHex();\n\t\t}\n\t}", "private static String pasarAHexadecimal(byte[] digest){\n String hash = \"\";\n for(byte aux : digest) {\n int b = aux & 0xff;\n if (Integer.toHexString(b).length() == 1) hash += \"0\";\n hash += Integer.toHexString(b);\n }\n return hash;\n }", "@Test\n public void testCrypto() throws Exception {\n Security.addProvider(new MymeeCrypto());\n MessageDigest digest;\n try {\n digest = MessageDigest.getInstance(\"SHA-224\", \"MymeeCrypto\");\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n return;\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n return;\n }\n byte[] result;\n\n result = digest.digest(\"flxtest5i88vzf8orqj\".getBytes());\n\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < result.length; i++)\n sb.append(String.format(\"%02x\", result[i]));\n assertTrue(\"fbfc986da9dc02cb5f6395d926f349b1674727be2fefda8d6044187d\".equals(sb.toString()));\n }", "private static String toHex(byte[] hash) {\n StringBuilder hashedInput = new StringBuilder(\"\");\n for (int i = 0; i < hash.length; i++) {\n String hex = Integer.toHexString(0xff & hash[i]);\n if (hex.length() == 1) {\n hashedInput.append('0');\n }\n hashedInput.append(hex);\n }\n return hashedInput.toString();\n }", "public String toHex(String arg) throws UnsupportedEncodingException {\n\t return String.format(\"%064x\", new BigInteger(1, arg.getBytes(\"UTF8\")));\n\t}", "private boolean hex() {\r\n return ALT(GO() && decimal() || OK() && SET(\"ABCDEFabcdef\"));\r\n }", "private String toHex(byte[] data) {\r\n char[] chars = new char[data.length * 2];\r\n for (int i = 0; i < data.length; i++) {\r\n chars[i * 2] = HEX_DIGITS[(data[i] >> 4) & 0xf];\r\n chars[i * 2 + 1] = HEX_DIGITS[data[i] & 0xf];\r\n }\r\n return new String(chars);\r\n}", "public static String crypt(String str) {\n if (str == null || str.length() == 0) {\n throw new IllegalArgumentException(\"String to encript cannot be null or zero length\");\n }\n StringBuffer hexString = new StringBuffer();\n try {\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n md.update(str.getBytes());\n byte[] hash = md.digest();\n for (int i = 0; i < hash.length; i++) {\n if ((0xff & hash[i]) < 0x10) {\n hexString.append(\"0\" + Integer.toHexString((0xFF & hash[i])));\n } else {\n hexString.append(Integer.toHexString(0xFF & hash[i]));\n }\n }\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n return hexString.toString();\n }", "private static String convertToHex(byte[] data) throws IOException {\n //create new instance of string buffer\n StringBuffer stringBuffer = new StringBuffer();\n String hex = \"\";\n\n //encode byte data with base64\n hex = Base64.getEncoder().encodeToString(data);\n stringBuffer.append(hex);\n\n //return string\n return stringBuffer.toString();\n }", "@Test(timeout = 4000)\n public void test116() throws Throwable {\n int int0 = JavaCharStream.hexval('8');\n assertEquals(8, int0);\n }", "private void outHex(){\n\t\tSystem.out.println(binary);\n\t\tpw.println(binary);\n\t\t\n\t}", "public void invoke() throws Exception {\n\tchar[] DIGITS = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };\n\t \ntry\n{\n int l = in_data.length;\n\n char[] out = new char[l << 1];\n\n // two characters form the hex value.\n for (int i = 0, j = 0; i < l; i++) {\n out[j++] = DIGITS[(0xF0 & in_data[i]) >>> 4];\n out[j++] = DIGITS[0x0F & in_data[i]];\n }\n\n\tout_data = new String(out);\n\n} catch (Exception e) {\n\t System.out.println(\"-------------------------\");\n\t System.out.println(\"doEncryptNotif ERROR: \" + e.getMessage() + \".\");\n\t System.out.println(\"-------------------------\");\n\t throw e;\n} \n\n\t}", "@Test\n public void testEncrypt() throws Exception {\n System.out.println(\"encrypt\");\n String seed = \"\";\n String cleartext = \"\";\n String expResult = \"\";\n String result = Crypto.encrypt(seed, cleartext);\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 ToHexString() {\n this(true);\n }", "@Test\n public void testSomeMethod() throws Exception {\n String test= Hash.getSaltedHash(\"UND123\");\n \n System.out.println(\"------------------------------------\");\n System.out.println(\"Hash code \\n\");\n System.out.println(test +\"\\n\");\n assertEquals(true,Hash.check(\"UND123\", \"P1Rlnnlc9wJZXmieTCsZwFs0ppnQpOXjLPIuju0BaFE=$WuRG4kAGPpkR2XxRMH4Dz7T39iHttGzCrDIMaEMYvhA=\"));\n }", "@Test(timeout = 4000)\n public void test115() throws Throwable {\n int int0 = JavaCharStream.hexval('9');\n assertEquals(9, int0);\n }", "@Test(timeout = 4000)\n public void test122() throws Throwable {\n int int0 = JavaCharStream.hexval('2');\n assertEquals(2, int0);\n }", "@Test(timeout = 4000)\n public void test121() throws Throwable {\n int int0 = JavaCharStream.hexval('3');\n assertEquals(3, int0);\n }", "protected byte[] binaryToHex(byte[] digest) throws UnsupportedEncodingException {\n StringBuffer digestString = new StringBuffer();\n for (int i = 0; i < digest.length; i++) {\n if ((digest[i] & 0x000000ff) < 0x10) {\n digestString.append(\"0\" + Integer.toHexString(digest[i] & 0x000000ff));\n } else {\n digestString.append(Integer.toHexString(digest[i] & 0x000000ff));\n }\n }\n return digestString.toString().getBytes(encoding);\n }", "public String Crypt(String s);", "public CodePointIterator hexEncode() {\n return hexEncode(false);\n }", "private static String toHex(byte[] array) throws NoSuchAlgorithmException {\n\n BigInteger bi = new BigInteger(1, array);\n String hex = bi.toString(16);\n int paddingLength = (array.length * 2) - hex.length();\n if (paddingLength > 0) {\n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n } else {\n return hex;\n }\n }", "private static String convertToHex(byte[] data) {\r\n StringBuffer buf = new StringBuffer();\r\n for (int i = 0; i < data.length; i++) {\r\n int halfbyte = (data[i] >>> 4) & 0x0F;\r\n int two_halfs = 0;\r\n do {\r\n if ((0 <= halfbyte) && (halfbyte <= 9)) {\r\n buf.append((char) ('0' + halfbyte));\r\n }\r\n else {\r\n buf.append((char) ('a' + (halfbyte - 10)));\r\n }\r\n halfbyte = data[i] & 0x0F;\r\n } while(two_halfs++ < 1);\r\n }\r\n return buf.toString();\r\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/* */ }", "public String getHex() {\n return hex;\n }", "@Test(timeout = 4000)\n public void test105() throws Throwable {\n int int0 = JavaCharStream.hexval('C');\n assertEquals(12, int0);\n }", "@Test(timeout = 4000)\n public void test118() throws Throwable {\n int int0 = JavaCharStream.hexval('6');\n assertEquals(6, int0);\n }", "public static String convertToHex(byte[] otp) {\n return ByteIterator.ofBytes(otp).hexEncode().drainToString();\n }", "@Test(timeout = 4000)\n public void test125() throws Throwable {\n int int0 = JavaCharStream.hexval('0');\n assertEquals(0, int0);\n }", "static String hexSha256Msg(String text) {\n String str=null;\n byte[] data = text.getBytes();\n try {\n MessageDigest md = MessageDigest.getInstance(\"SHA-256\");\n md.update(data);\n byte[] bytes = md.digest();\n str = byteToHex(bytes);\n }catch (NoSuchAlgorithmException e){\n e.printStackTrace();\n }\n System.out.println(str);\n return str ;\n }", "private static String byteToHexString(final byte hash) {\n\t\tint n = hash;\n\t\tif (n < 0) {\n\t\t\tn = 256 + n;\n\t\t}\n\t\tint d1 = n / 16;\n\t\tint d2 = n % 16;\n\t\treturn FileHashingUtils.hexDigits[d1] + FileHashingUtils.hexDigits[d2];\n\t}", "private static byte[] fromHex(String hex) throws NoSuchAlgorithmException\n {\n byte[] bytes = new byte[hex.length() / 2];\n for(int i = 0; i<bytes.length ;i++)\n {\n bytes[i] = (byte)Integer.parseInt(hex.substring(2 * i, 2 * i + 2), 16);\n }\n return bytes;\n }", "@Test(timeout = 4000)\n public void test119() throws Throwable {\n int int0 = JavaCharStream.hexval('5');\n assertEquals(5, int0);\n }", "@Test(timeout = 4000)\n public void test103() throws Throwable {\n int int0 = JavaCharStream.hexval('E');\n assertEquals(14, int0);\n }", "@Test(timeout = 4000)\n public void test117() throws Throwable {\n int int0 = JavaCharStream.hexval('7');\n assertEquals(7, int0);\n }", "public boolean isHex()\n {\n return hex;\n }", "protected static String convertHex( String base )\r\n\t{\r\n\t\treturn \"H\" + HexConvertor.convertHex( base.getBytes() ); \r\n\t}", "@Test(timeout = 4000)\n public void test106() throws Throwable {\n int int0 = JavaCharStream.hexval('B');\n assertEquals(11, int0);\n }", "@Test(timeout = 4000)\n public void test076() throws Throwable {\n int int0 = JavaCharStream.hexval('a');\n assertEquals(10, int0);\n }", "@Test(timeout = 4000)\n public void test123() throws Throwable {\n int int0 = JavaCharStream.hexval('1');\n assertEquals(1, int0);\n }", "@Test\n public void testHash() \n\t{\n\tLaboonCoin l = new LaboonCoin();\n\t\tint hash = l.hash(\"boo\");\n\t\tint result = 1428150834;\n\t\tassertEquals(result, hash);\n }", "public String binToHex(String input) {\r\n int decimal = Integer.parseInt(input,2);\t\r\n\t\treturn Integer.toString(decimal,16);\t\r\n\t}", "private static String HashIt(String token) {\n\t\tStringBuffer hexString = new StringBuffer();\n\t\ttry {\n\t\t\tMessageDigest digest = MessageDigest.getInstance(\"SHA-256\");\n\t\t\tbyte[] hash = digest.digest(token.getBytes(StandardCharsets.UTF_8));\n\t\t\t\n\t\t\t// Convert to hex\n\t\t for (int i = 0; i < hash.length; i++) {\n\t\t\t String hex = Integer.toHexString(0xff & hash[i]);\n\t\t\t if(hex.length() == 1) {\n\t\t\t \thexString.append('0');\n\t\t\t }\n\t\t\t hexString.append(hex);\n\t\t }\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\tSystem.err.println(e.getStackTrace());\n\t\t\thexString.setLength(0);\n\t\t}\n\t return hexString.toString();\t\t\n\t}", "public String toHexString()\n\t{\n\t\t// holds the string builder object to return\n\t\tStringBuilder sb = new StringBuilder();\n\t\t\n\t\t// for every byte\n\t\tfor (int i = 0; i < bytes.length; i++)\n\t\t{\n\t\t\tint intCurrent = bytes[i] & 0xFF;\n\t\t\t\n\t\t\t// check to see if a leading 0 is needed\n\t\t\tif (intCurrent < 0x10)\n\t\t\t{\n\t\t\t\t// append a 0\n\t\t\t\tsb.append(0);\n\t\t\t}\n\t\t\t\n\t\t\tString s = Integer.toHexString(intCurrent).toUpperCase();\n\t\t\t\n\t\t\t// append the character\n\t\t\tsb.append(s);\n\t\t}\n\t\t\n\t\t// return the string\n\t\treturn sb.toString();\n\t}", "private String toHex(byte[] array)\n {\n BigInteger bi = new BigInteger(1, array);\n String hex = bi.toString(16);\n int paddingLength = (array.length * 2) - hex.length();\n if(paddingLength > 0) \n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n else\n return hex;\n }", "public static String asciiToHex(String asciiValue)\n \t{\n \t char[] chars = asciiValue.toCharArray();\n \t StringBuffer hex = new StringBuffer();\n \t for (int i = 0; i < chars.length; i++)\n \t {\n \t hex.append(Integer.toHexString((int) chars[i]));\n \t }\n \t return hex.toString();\n \t}", "public String toString() {\n return Util.bytesToHex(getByteArray());\n }", "@Test(timeout = 4000)\n public void test104() throws Throwable {\n int int0 = JavaCharStream.hexval('D');\n assertEquals(13, int0);\n }", "public String getHexValue() {\n return hexValue;\n }", "@Test\r\n public void testVerifyCryptoType() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }", "private static byte[] fromHex(String hex) throws NoSuchAlgorithmException {\n byte[] bytes = new byte[hex.length() / 2];\n for (int i = 0; i < bytes.length; i++) {\n bytes[i] = (byte) Integer.parseInt(hex.substring(2 * i, 2 * i + 2), 16);\n }\n return bytes;\n }", "public String toHexString() {\n\treturn ByteUtils.toHexString(toByteArray());\n }", "@Test(timeout = 4000)\n public void test102() throws Throwable {\n int int0 = JavaCharStream.hexval('F');\n assertEquals(15, int0);\n }", "private String makeHex(byte[] buffer) {\n byte current;\n int length = buffer.length;\n String blank = \"\"; // it's easier to change\n StringBuffer ret = new StringBuffer(2*length);\n\n // do for each half byte\n for(int i=0;i<(2*length);i++)\n {\n\t// mask half byte and move it to the right\n\tcurrent = i%2==1 ? (byte) (buffer[(i/2)] & 0x0F)\n\t : (byte) ((buffer[(i/2)] >> 4) & 0x0F);\n\t\n\t// convert half byte to ASCII char\t\t \n\tret.append((char) (current < 0x0A ? current+0x30 : current+0x37) + (i%2==1 ? blank : \"\"));\n }\n return ret.toString();\n }", "@Test\r\n public void testCryptoBox() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys sender = instance.createKeys(null);\r\n Keys receiver = instance.createKeys(null);\r\n CryptoBox result = instance.cryptoBox(data, sender, receiver);\r\n assertNotNull(result);\r\n }", "@Test(timeout = 4000)\n public void test075() throws Throwable {\n int int0 = JavaCharStream.hexval('b');\n assertEquals(11, int0);\n }", "@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 }", "private static String toHex(byte[] array)\n\t {\n\t BigInteger bi = new BigInteger(1, array);\n\t String hex = bi.toString(16);\n\t int paddingLength = (array.length * 2) - hex.length();\n\t if(paddingLength > 0)\n\t return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n\t else\n\t return hex;\n\t }", "private static String toHex(final byte[] array) {\n final BigInteger bi = new BigInteger(1, array);\n final String hex = bi.toString(16);\n final int paddingLength = (array.length * 2) - hex.length();\n if (paddingLength > 0) {\n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n } else {\n return hex;\n }\n }", "private String hexify(byte bytes[]) {\n\n char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7',\n '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};\n\n StringBuilder buf = new StringBuilder(bytes.length * 2);\n\n for (byte aByte : bytes) {\n buf.append(hexDigits[(aByte & 0xf0) >> 4]);\n buf.append(hexDigits[aByte & 0x0f]);\n }\n\n return buf.toString();\n }", "private static String hexify(byte bytes[]) {\n\n char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7',\n '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};\n\n StringBuilder buf = new StringBuilder(bytes.length * 2);\n for (byte aByte : bytes) {\n buf.append(hexDigits[(aByte & 0xf0) >> 4]);\n buf.append(hexDigits[aByte & 0x0f]);\n }\n return buf.toString();\n }", "@Test(timeout = 4000)\n public void test120() throws Throwable {\n int int0 = JavaCharStream.hexval('4');\n assertEquals(4, int0);\n }", "@Test\n public void testCreateSha1() throws Exception {\n MessageDigest sha1 = MessageDigest.getInstance(MASTER_KEY_GENERATION_ALG);\n byte[] sha1Result = sha1.digest(SHA_1_INPUT);\n assertFalse(Arrays.equals(SHA_1_INPUT, sha1Result));\n }", "public TimeCryptoProofSHA256(String hexSalt) {\n super(hexSalt);\n }", "public static String encryptPassword(String input) {\n\t\tStringBuilder hexadecimalString = null;\n\t\tbyte[] byteArray;\n\t\t\n\t\ttry {\n\t\t\t//convert input string into a SHA encrypted byte array\n\t\t\tMessageDigest messageDigest = MessageDigest.getInstance(\"SHA-256\");\n\t\t\tbyteArray = messageDigest.digest(input.getBytes(StandardCharsets.UTF_8));\n\t\t\t\n\t\t\t//Now convert that byte array into hexadecimal\n\t\t\thexadecimalString = new StringBuilder(2 * byteArray.length);\n\t\t\tfor(byte i : byteArray) {\n\t\t\t\t//Hex value of a byte\n\t\t\t\tString hexValue = Integer.toHexString(0xff & i);\n\t\t\t\t\n\t\t\t\t//If the hex value is only a single digit, add a 0\n\t\t\t\tif(hexValue.length() == 1) \n\t\t\t\t\thexadecimalString.append('0');\n\t\t\t\t\n\t\t\t\t//Add the hex value to the entire string of hex values\n\t\t\t\thexadecimalString.append(hexValue);\n\t\t\t}\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn hexadecimalString.toString();\n\t}", "private String calchash() {\r\n String a0 = String.valueOf(bindex);\r\n a0 += String.valueOf(bdate);\r\n a0 += bdata;\r\n a0 += String.valueOf(bonce);\r\n a0 += blasthash;\r\n String a1;\r\n a1 = \"\";\r\n try {\r\n a1 = sha256(a0);\r\n } catch (NoSuchAlgorithmException ex) {\r\n Logger.getLogger(Block.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return a1;\r\n\r\n }", "public boolean isHexBinary() {\n return false;\n }", "private static String convertStringToHex(String input){\n\t\tchar[] chars = input.toCharArray();\n\t\tStringBuffer hexOutput = new StringBuffer();\n\t\t\n\t\tfor(int i = 0; i < chars.length; i++){\n\t\t\thexOutput.append(Integer.toHexString((int)chars[i]));\n\t\t}\n\n\t\treturn hexOutput.toString();\n\t}", "public String hex() {\r\n return this.hex;\r\n }", "public static final String toHex(byte hash[]) {\r\n StringBuffer buf = new StringBuffer(hash.length * 2);\r\n int i;\r\n\r\n for (i = 0; i < hash.length; i++) {\r\n if (((int) hash[i] & 0xff) < 0x10) {\r\n buf.append(\"0\");\r\n }\r\n buf.append(Long.toString((int) hash[i] & 0xff, 16));\r\n }\r\n return buf.toString();\r\n }", "private static String binToHex(String bin) {\n\t\tString hex = \"\";\n\t\twhile (bin.length() % 4 != 0) { // comprueba si la cadena tiene longitud multiplo de 4\n\t\t\tbin = \"0\" + bin; // si no, le aņado un cero y vuelvo a comprobar si es multiplo de 4\n\t\t}\n\t\t// este while va cogiendo cachitos de 4, los pasa a hexadecimal y acumula en la variable hex\n\t\twhile (bin.length() != 0) { // el while continua hasta que la cadena tenga longitud cero\n\t\t\tString four = bin.substring(bin.length()-4); // cojo los 4 ultimos\n\t\t\thex = byteToHex(four) + hex; // paso 4 bits a hexadecimal y acumulo en hex\n\t\t\tbin = bin.substring(0, bin.length() - 4); // al string original le quito los cuatro bits que ya he procesado\n\t\t}\n\t\treturn hex; // cuando ha terminado el while, en hex tengo el hexadecimal completo\n\t\t\n\t}", "public String getHexCode() {\r\n return this.hexCode;\r\n }", "@Test(timeout = 4000)\n public void test107() throws Throwable {\n int int0 = JavaCharStream.hexval('A');\n assertEquals(10, int0);\n }", "@Test\n public void testCreateHmacSha1() throws Exception {\n Mac macAlgorithm = Mac.getInstance(MAC_ALGORITHM_STRING);\n macAlgorithm.init(new SecretKeySpec(K_AUT, MAC_ALGORITHM_STRING));\n byte[] mac = macAlgorithm.doFinal(MAC_INPUT);\n assertFalse(Arrays.equals(MAC_INPUT, mac));\n }", "private static String toHex(byte[] digest) {\n\t\tchar[] result = new char[digest.length * 2];\n\t\tint pos = 0;\n\t\tfor (int i = 0; i < digest.length; i++) {\n\t\t\tresult[pos++] = hexChar((digest[i] & 0xf0) >> 4);\n\t\t\tresult[pos++] = hexChar(digest[i] & 0x0f);\n\t\t}\n\t\treturn new String(result);\n\t}", "public static String toHexString(BigInteger data) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"0x\").append(data.toString(16));\n return sb.toString();\n }", "private BigInteger hextodecimal(String hex) {\n\t\treturn new BigInteger(hex,16);\n\t}", "@Test\n public void testHashingAvPassord() {\n String passordTilHash = \"passord\";\n String salt = null;\n String salt2 = null;\n try{\n salt = HashPassord.getSalt();\n salt2 = HashPassord.getSalt();\n }catch(NoSuchAlgorithmException | NoSuchProviderException | java.security.NoSuchProviderException e){\n e.printStackTrace();\n }\n String sikkertPassord = getSecurePassword(passordTilHash, salt);\n String sikkertPassord2 = getSecurePassword(passordTilHash, salt2);\n String regenerertPassordVerifisering = getSecurePassword(passordTilHash, salt);\n \n System.out.println( sikkertPassord+ \":\" + salt); //skriver 83ee5baeea20b6c21635e4ea67847f66\n System.out.println( sikkertPassord2+ \":\" + salt2);\n System.out.println(regenerertPassordVerifisering + \":\" + salt); //skriver 83ee5baeea20b6c21635e4ea67847f66\n \n assertEquals(sikkertPassord, regenerertPassordVerifisering);\n assertNotSame(salt, salt2);\n assertNotSame(sikkertPassord, sikkertPassord2);\n System.out.println(\"//TEST//: testHashingAvPassord() = funker!\");\n \n }", "private static String byteToHex(byte b) {\n\t\tchar hexDigit[] = {\n\t\t\t\t'0', '1', '2', '3', '4', '5', '6', '7',\n\t\t\t\t'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'\n\t\t};\n\t\tchar[] array = {hexDigit[(b >> 4) & 0x0f], hexDigit[b & 0x0f]};\n\t\treturn new String(array);\n\t}", "private static String _bytesToHex( ByteBuffer buf )\n {\n final int offset = buf.position();\n final int size = buf.remaining();\n final char[] hexChars = new char[size * 2];\n\n for (int j = 0; j < size; j++) {\n int v = buf.get(j + offset) & 0xFF;\n hexChars[j * 2] = hexArray[v >>> 4];\n hexChars[j * 2 + 1] = hexArray[v & 0x0F];\n }\n\n return new String(hexChars);\n }", "public static String hexaToString(byte[] digest ){\n\t StringBuffer hexString = new StringBuffer();\n\t for (int i = 0; i < digest.length; i++) {\n\t if ((0xff & digest[i]) < 0x10) {\n\t hexString.append(\"0\" + Integer.toHexString((0xFF & digest[i])));\n\t } else {\n\t hexString.append(Integer.toHexString(0xFF & digest[i]));\n\t }\n\t } \n\t return hexString.toString(); \n\t }", "public static void main(String[] args) throws Exception {\n\t\t\r\n\t\tString str = hexStr2binaryStr(\"33\");\r\n\t\tSystem.out.println(str);\r\n\t}", "private void toHex(){\n\t\tStringBuilder sb = new StringBuilder();\n\t\tStringBuilder tempsb = new StringBuilder(binary);\n\t\t\n\t\t\tfor (int i = 0;i<binary.length();i+=4){//maps each nibble to its binary value\n\t\t\t\tif (tempsb.substring(i,i+4).equals(\"0000\")) \n\t\t\t\t\tsb.append('0');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0001\"))\n\t\t\t\t\tsb.append('1');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0010\"))\n\t\t\t\t\tsb.append('2');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0011\"))\n\t\t\t\t\tsb.append('3');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0100\"))\n\t\t\t\t\tsb.append('4');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0101\"))\n\t\t\t\t\tsb.append('5');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0110\"))\n\t\t\t\t\tsb.append('6');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0111\"))\n\t\t\t\t\tsb.append('7');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1000\"))\n\t\t\t\t\tsb.append('8');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1001\"))\n\t\t\t\t\tsb.append('9');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1010\"))\n\t\t\t\t\tsb.append('A');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1011\"))\n\t\t\t\t\tsb.append('B');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1100\"))\n\t\t\t\t\tsb.append('C');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1101\"))\n\t\t\t\t\tsb.append('D');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1110\"))\n\t\t\t\t\tsb.append('E');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1111\"))\n\t\t\t\t\tsb.append('F');\n\t\t\t}\n\t\t\tsb.insert(0,\"0x\");\n\t\t\tbinary = sb.toString();\n\t}", "public String binarioToHexa(String binario) {\n\t\tSystem.out.print(\"Convirtiendo binario (\" + binario + \") a hexadecimal >> \");\n\t\tInteger numero = 0;\n\t\ttry{\n\t\t\tnumero = Integer.valueOf(binario, 2);\n\t\t}catch (NumberFormatException e) {\n\t\t\tSystem.err.print(\"\\nERROR : El numero \" + binario + \" no es binario\");\n\t\t}\n\t\treturn Integer.toHexString(numero);\n\t}", "@Test\n public void testAesEncryptForInputKey() throws Exception {\n byte[] key = Cryptos.generateAesKey();\n String input = \"foo message\";\n\n byte[] encryptResult = Cryptos.aesEncrypt(input.getBytes(\"UTF-8\"), key);\n String descryptResult = Cryptos.aesDecrypt(encryptResult, key);\n\n System.out.println(key);\n System.out.println(descryptResult);\n }", "private static String validateHexStr(String hexStr) throws UnsignedBigIntUtilsException {\n String tmpStr = RegExp.replaceAll(\"[ \\\\|\\\\t\\\\n]+\", hexStr, \"\");\n tmpStr = RegExp.replaceFirst(\"0[xX]\", tmpStr, \"\");\n if (tmpStr.matches(\"[0-9a-fA-F]+\") == false) {\n String msg = \"ERROR: Invalid HEX characters in input => \" + tmpStr + \"\\n\";\n throw new UnsignedBigIntUtilsException(msg);\n }\n return (tmpStr);\n }", "private static String toHex(byte[] array) {\r\n\t\tBigInteger bi = new BigInteger(1, array);\r\n\t\tString hex = bi.toString(16);\r\n\t\tint paddingLength = (array.length * 2) - hex.length();\r\n\t\tif (paddingLength > 0)\r\n\t\t\treturn String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\r\n\t\telse\r\n\t\t\treturn hex;\r\n\t}", "public static String unHex(String arg) { \r\n\t String str = \"\";\r\n\t for(int i=0;i<arg.length();i+=2)\r\n\t {\r\n\t String s = arg.substring(i, (i + 2));\r\n\t int decimal = Integer.parseInt(s, 16);\r\n\t str = str + (char) decimal;\r\n\t } \r\n\t return str;\r\n\t}", "private static String CalHash(byte[] passSalt) throws NoSuchAlgorithmException, UnsupportedEncodingException {\n //get the instance value corresponding to Algorithm selected\n MessageDigest key = MessageDigest.getInstance(\"SHA-256\");\n //Reference:https://stackoverflow.com/questions/415953/how-can-i-generate-an-md5-hash\n //update the digest using specified array of bytes\n key.update(passSalt);\n String PassSaltHash = javax.xml.bind.DatatypeConverter.printHexBinary(key.digest());\n return PassSaltHash;\n }", "@Test(timeout = 4000)\n public void test087() throws Throwable {\n try { \n JavaCharStream.hexval('V');\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "@Test(timeout = 4000)\n public void test073() throws Throwable {\n int int0 = JavaCharStream.hexval('d');\n assertEquals(13, int0);\n }" ]
[ "0.79971147", "0.7571973", "0.748612", "0.7261664", "0.6909193", "0.6856248", "0.68255866", "0.6566911", "0.64269215", "0.63029885", "0.6211425", "0.6113202", "0.6025854", "0.60250723", "0.59859276", "0.59672326", "0.5938996", "0.5933515", "0.5922233", "0.5870849", "0.5857477", "0.58484274", "0.5843856", "0.58397", "0.5831545", "0.5815697", "0.57877254", "0.5765514", "0.57604116", "0.57565206", "0.5755328", "0.57436556", "0.57205373", "0.57106024", "0.5684909", "0.56716627", "0.56504333", "0.56495047", "0.56300247", "0.56159025", "0.5603038", "0.5600321", "0.558738", "0.55824107", "0.5581671", "0.55697507", "0.55682445", "0.55596936", "0.5556749", "0.5546121", "0.5544332", "0.55159", "0.54906684", "0.5489143", "0.54846567", "0.5480021", "0.5476289", "0.5473022", "0.54693127", "0.54558885", "0.54543877", "0.54524225", "0.5451303", "0.5447862", "0.5445821", "0.5438509", "0.5432785", "0.5428329", "0.5421494", "0.54211974", "0.54166", "0.5411591", "0.5402766", "0.5402321", "0.53868824", "0.53848785", "0.5383518", "0.53797984", "0.537005", "0.53664666", "0.5364345", "0.53629124", "0.53594047", "0.53462976", "0.5340312", "0.5339666", "0.5334553", "0.5327417", "0.531935", "0.53169364", "0.5310334", "0.5308746", "0.5305991", "0.5305315", "0.5300009", "0.5294747", "0.5289701", "0.5287913", "0.5279263", "0.52779436" ]
0.80246377
0
Test of fromHex method, of class Crypto.
@Test public void testFromHex() { System.out.println("fromHex"); String hex = ""; String expResult = ""; String result = Crypto.fromHex(hex); assertEquals(expResult, result); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testToHex_String() {\n System.out.println(\"toHex\");\n String txt = \"\";\n String expResult = \"\";\n String result = Crypto.toHex(txt);\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 }", "@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 }", "@Test\n public void testToHex() \n {\n System.out.println(\"toHex\");\n String argument = \"12\";\n Converter instance = new Converter();\n String expResult = \"C\";\n String result = instance.toHex(argument);\n \n //assert that the result we expect comes out. If the result that is expecte is generated then the test will pass. If not, then it will fail\n assertEquals(expResult, result);\n assertEquals(\"D\", instance.toHex(\"13\"));\n assertEquals(\"7B\", instance.toHex(\"123\"));\n assertEquals(\"D\", instance.toHex(\"13\"));\n assertEquals(\"2710\", instance.toHex(\"10000\"));\n }", "@Test\n public void testToHex_byteArr() {\n System.out.println(\"toHex\");\n byte[] buf = null;\n String expResult = \"\";\n String result = Crypto.toHex(buf);\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 }", "@Test\n public void testHexAndBytesTransformation() {\n byte[] bytes = ByteUtils.stringToBytes(ByteUtils.bytesToHexString(testBytes));\n assertArrayEquals(testBytes, bytes); \n }", "@Test\n public void testDecToHex() {\n Assert.assertEquals(\"41\", Cipher_Helper.decToHex(65));\n Assert.assertEquals(\"5A\", Cipher_Helper.decToHex(90));\n Assert.assertEquals(\"4D\", Cipher_Helper.decToHex(77));\n }", "private static byte[] fromHex(String hex) throws NoSuchAlgorithmException\n {\n byte[] bytes = new byte[hex.length() / 2];\n for(int i = 0; i<bytes.length ;i++)\n {\n bytes[i] = (byte)Integer.parseInt(hex.substring(2 * i, 2 * i + 2), 16);\n }\n return bytes;\n }", "@Test\n public void testBytesToHexString() {\n String testHex = ByteUtils.bytesToHexString(testBytes); \n assertEquals(testHex.length(), testBytes.length * 2);\n }", "@Test(timeout = 4000)\n public void test116() throws Throwable {\n int int0 = JavaCharStream.hexval('8');\n assertEquals(8, int0);\n }", "private static byte[] fromHex(String hex) throws NoSuchAlgorithmException {\n byte[] bytes = new byte[hex.length() / 2];\n for (int i = 0; i < bytes.length; i++) {\n bytes[i] = (byte) Integer.parseInt(hex.substring(2 * i, 2 * i + 2), 16);\n }\n return bytes;\n }", "@Test\n public void testCrypto() throws Exception {\n Security.addProvider(new MymeeCrypto());\n MessageDigest digest;\n try {\n digest = MessageDigest.getInstance(\"SHA-224\", \"MymeeCrypto\");\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n return;\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n return;\n }\n byte[] result;\n\n result = digest.digest(\"flxtest5i88vzf8orqj\".getBytes());\n\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < result.length; i++)\n sb.append(String.format(\"%02x\", result[i]));\n assertTrue(\"fbfc986da9dc02cb5f6395d926f349b1674727be2fefda8d6044187d\".equals(sb.toString()));\n }", "@Test(timeout = 4000)\n public void test122() throws Throwable {\n int int0 = JavaCharStream.hexval('2');\n assertEquals(2, int0);\n }", "@Test(timeout = 4000)\n public void test115() throws Throwable {\n int int0 = JavaCharStream.hexval('9');\n assertEquals(9, int0);\n }", "@Test\n\tpublic void testBytesToHexStringForSrcMode() throws Exception {\n//TODO: Test goes here... \n\t}", "@Test(timeout = 4000)\n public void test121() throws Throwable {\n int int0 = JavaCharStream.hexval('3');\n assertEquals(3, int0);\n }", "@Test(timeout = 4000)\n public void test118() throws Throwable {\n int int0 = JavaCharStream.hexval('6');\n assertEquals(6, int0);\n }", "@Test(dataProvider = \"dataForHexadecimal\")\n public void testToHexadecimal(int num, String hexadecimal) {\n String result = Tools.toHexadecimal(num);\n assertEquals(result, hexadecimal);\n System.out.println(\"testToHexadecimal()\");\n }", "@Test(timeout = 4000)\n public void test119() throws Throwable {\n int int0 = JavaCharStream.hexval('5');\n assertEquals(5, int0);\n }", "private static String validateHexStr(String hexStr) throws UnsignedBigIntUtilsException {\n String tmpStr = RegExp.replaceAll(\"[ \\\\|\\\\t\\\\n]+\", hexStr, \"\");\n tmpStr = RegExp.replaceFirst(\"0[xX]\", tmpStr, \"\");\n if (tmpStr.matches(\"[0-9a-fA-F]+\") == false) {\n String msg = \"ERROR: Invalid HEX characters in input => \" + tmpStr + \"\\n\";\n throw new UnsignedBigIntUtilsException(msg);\n }\n return (tmpStr);\n }", "@Test\r\n public void testVerifyCryptoType() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }", "@Test(timeout = 4000)\n public void test105() throws Throwable {\n int int0 = JavaCharStream.hexval('C');\n assertEquals(12, int0);\n }", "@Test(timeout = 4000)\n public void test103() throws Throwable {\n int int0 = JavaCharStream.hexval('E');\n assertEquals(14, int0);\n }", "@Test(timeout = 4000)\n public void test117() throws Throwable {\n int int0 = JavaCharStream.hexval('7');\n assertEquals(7, int0);\n }", "@Test(timeout = 4000)\n public void test125() throws Throwable {\n int int0 = JavaCharStream.hexval('0');\n assertEquals(0, int0);\n }", "@Test(timeout = 4000)\n public void test123() throws Throwable {\n int int0 = JavaCharStream.hexval('1');\n assertEquals(1, int0);\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(timeout = 4000)\n public void test106() throws Throwable {\n int int0 = JavaCharStream.hexval('B');\n assertEquals(11, int0);\n }", "private byte[] fromHex(String hex)\n {\n byte[] binary = new byte[hex.length() / 2];\n for(int i = 0; i < binary.length; i++)\n {\n binary[i] = (byte)Integer.parseInt(hex.substring(2*i, 2*i+2), 16);\n }\n return binary;\n }", "@Test(timeout = 4000)\n public void test104() throws Throwable {\n int int0 = JavaCharStream.hexval('D');\n assertEquals(13, int0);\n }", "private boolean hex() {\r\n return ALT(GO() && decimal() || OK() && SET(\"ABCDEFabcdef\"));\r\n }", "@Test(timeout = 4000)\n public void test076() throws Throwable {\n int int0 = JavaCharStream.hexval('a');\n assertEquals(10, int0);\n }", "@Test\n public void testSomeMethod() throws Exception {\n String test= Hash.getSaltedHash(\"UND123\");\n \n System.out.println(\"------------------------------------\");\n System.out.println(\"Hash code \\n\");\n System.out.println(test +\"\\n\");\n assertEquals(true,Hash.check(\"UND123\", \"P1Rlnnlc9wJZXmieTCsZwFs0ppnQpOXjLPIuju0BaFE=$WuRG4kAGPpkR2XxRMH4Dz7T39iHttGzCrDIMaEMYvhA=\"));\n }", "public TimeCryptoProofSHA256(String hexSalt) {\n super(hexSalt);\n }", "@Test(timeout = 4000)\n public void test102() throws Throwable {\n int int0 = JavaCharStream.hexval('F');\n assertEquals(15, int0);\n }", "@Test(timeout = 4000)\n public void test120() throws Throwable {\n int int0 = JavaCharStream.hexval('4');\n assertEquals(4, int0);\n }", "@Test(timeout = 4000)\n public void test075() throws Throwable {\n int int0 = JavaCharStream.hexval('b');\n assertEquals(11, int0);\n }", "public static byte[] convertFromHex(String otp) throws SaslException {\n final CodePointIterator cpi = CodePointIterator.ofString(otp);\n final CodePointIterator di = cpi.delimitedBy(DELIMS);\n // Remove any white space\n final StringBuilder sb = new StringBuilder();\n while (di.hasNext()) {\n di.drainTo(sb);\n skipDelims(di, cpi);\n }\n return CodePointIterator.ofString(sb.toString()).hexDecode().drain();\n }", "void isHexadecimal(String stringhex){\n \t\tif(stringhex.charAt(2) == '0') {\n \t\t\t// on skip 0x0.\n \t\t\tbeginZeroHex(stringhex.substring(4));\n \t\t}\n \t\telse {\n \t\t\tbeginNonZeroHex(stringhex.substring(2));\n \t\t}\n \t}", "private static byte[] fromHex(String hex) {\n byte[] bytes = new byte[hex.length() / 2];\n for (int i = 0; i < bytes.length; i++) {\n bytes[i] = (byte) Integer.parseInt(hex.substring(2 * i, 2 * i + 2), 16);\n }\n return bytes;\n }", "@Test\r\n public void testCryptoBox() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys sender = instance.createKeys(null);\r\n Keys receiver = instance.createKeys(null);\r\n CryptoBox result = instance.cryptoBox(data, sender, receiver);\r\n assertNotNull(result);\r\n }", "private static byte[] fromHex(final String hex) {\n final byte[] binary = new byte[hex.length() / 2];\n for (int i = 0; i < binary.length; i++) {\n binary[i] = (byte) Integer.parseInt(hex.substring(2 * i, 2 * i + 2), 16);\n }\n return binary;\n }", "public String Crypt(String s);", "public void convert_Hex_To_Binary(String hex) {\n String binary_string = hexToBinary(hex, true);\n int[] data = new int[64];\n for (int k = 0; k < data.length; k++)\n data[k] = Character.getNumericValue(binary_string.charAt(k));\n key_user = data;\n }", "private static String pasarAHexadecimal(byte[] digest){\n String hash = \"\";\n for(byte aux : digest) {\n int b = aux & 0xff;\n if (Integer.toHexString(b).length() == 1) hash += \"0\";\n hash += Integer.toHexString(b);\n }\n return hash;\n }", "@Test\r\n public void testVerify() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }", "@Test(timeout = 4000)\n public void test107() throws Throwable {\n int int0 = JavaCharStream.hexval('A');\n assertEquals(10, int0);\n }", "private static byte[] fromHex(String hex)\n\t {\n\t byte[] binary = new byte[hex.length() / 2];\n\t for(int i = 0; i < binary.length; i++)\n\t {\n\t binary[i] = (byte)Integer.parseInt(hex.substring(2*i, 2*i+2), 16);\n\t }\n\t return binary;\n\t }", "public InvalidHexException(String invalid) {\r\n\t\tsuper(invalid);\r\n\t\tSystem.err.println(\"Invalid input: Hex values can only have characters 0-9 and A-F\");\r\n\t}", "@Test(timeout = 4000)\n public void test072() throws Throwable {\n int int0 = JavaCharStream.hexval('e');\n assertEquals(14, int0);\n }", "@Test(timeout = 4000)\n public void test073() throws Throwable {\n int int0 = JavaCharStream.hexval('d');\n assertEquals(13, int0);\n }", "private BigInteger hextodecimal(String hex) {\n\t\treturn new BigInteger(hex,16);\n\t}", "@Test\r\n public void testCryptoBoxSeal() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] result = instance.cryptoBoxSeal(keys, data);\r\n assertNotNull(result);\r\n }", "@Test(timeout = 4000)\n public void test074() throws Throwable {\n int int0 = JavaCharStream.hexval('c');\n assertEquals(12, int0);\n }", "@Test(timeout = 4000)\n public void test087() throws Throwable {\n try { \n JavaCharStream.hexval('V');\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "public void invoke() throws Exception {\n\tchar[] DIGITS = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };\n\t \ntry\n{\n int l = in_data.length;\n\n char[] out = new char[l << 1];\n\n // two characters form the hex value.\n for (int i = 0, j = 0; i < l; i++) {\n out[j++] = DIGITS[(0xF0 & in_data[i]) >>> 4];\n out[j++] = DIGITS[0x0F & in_data[i]];\n }\n\n\tout_data = new String(out);\n\n} catch (Exception e) {\n\t System.out.println(\"-------------------------\");\n\t System.out.println(\"doEncryptNotif ERROR: \" + e.getMessage() + \".\");\n\t System.out.println(\"-------------------------\");\n\t throw e;\n} \n\n\t}", "@Override\n public int hexToInt(String source) {\n try {\n return Integer.parseInt(source, 16);\n } catch (NumberFormatException nfe) {\n return 0;\n }\n }", "private static byte[] fromHex(String hex) {\r\n byte[] binary = new byte[hex.length() / 2];\r\n for (int i = 0; i < binary.length; i++) {\r\n binary[i] = (byte) Integer.parseInt(hex.substring(2 * i, 2 * i + 2), 16);\r\n }\r\n return binary;\r\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}", "@Test(expected = IllegalArgumentException.class)\n public void testNonceBytesValidation() {\n new DataChannelNonce(ByteBuffer.wrap(new byte[] { 0x0 }));\n }", "@Test(timeout = 4000)\n public void test071() throws Throwable {\n int int0 = JavaCharStream.hexval('f');\n assertEquals(15, int0);\n }", "@Test\n public void testHMacValidate() throws Exception {\n System.out.println(\"hMacValidate\");\n String key = \"secret\";\n boolean expResult = true;\n boolean result = instance.hMacValidate(key);\n assertEquals(expResult, result);\n }", "public static void main(String[] args) {\n\t\tPattern p = Pattern.compile(\"^0x[0-9a-fA-F]{1,10}\");\n\t\t// Next we create matcher, that will be check our String by Pattern\n\t\tMatcher m_1 = p.matcher(\"0x12423\");\n\t\tMatcher m_2 = p.matcher(\"23\");\n\t\t// Run checker\n\t\tboolean match_1 = m_1.matches();\n\t\tboolean match_2 = m_2.matches();\n\t\tSystem.out.println(\"0x12423 is HEX notation: \" + match_1);\n\t\tSystem.out.println(\"23 is HEX notation: \" + match_2);\n\t}", "public Hexadecimal(String hexString){\n this.hexString = new StringBuilder(hexString.toUpperCase());\n HexadecConverter hexCon = new HexadecConverter();\n this.decimal = hexCon.strToDec(hexString);\n }", "@Test\n public void testHashingAvPassord() {\n String passordTilHash = \"passord\";\n String salt = null;\n String salt2 = null;\n try{\n salt = HashPassord.getSalt();\n salt2 = HashPassord.getSalt();\n }catch(NoSuchAlgorithmException | NoSuchProviderException | java.security.NoSuchProviderException e){\n e.printStackTrace();\n }\n String sikkertPassord = getSecurePassword(passordTilHash, salt);\n String sikkertPassord2 = getSecurePassword(passordTilHash, salt2);\n String regenerertPassordVerifisering = getSecurePassword(passordTilHash, salt);\n \n System.out.println( sikkertPassord+ \":\" + salt); //skriver 83ee5baeea20b6c21635e4ea67847f66\n System.out.println( sikkertPassord2+ \":\" + salt2);\n System.out.println(regenerertPassordVerifisering + \":\" + salt); //skriver 83ee5baeea20b6c21635e4ea67847f66\n \n assertEquals(sikkertPassord, regenerertPassordVerifisering);\n assertNotSame(salt, salt2);\n assertNotSame(sikkertPassord, sikkertPassord2);\n System.out.println(\"//TEST//: testHashingAvPassord() = funker!\");\n \n }", "public static String unHex(String arg) { \r\n\t String str = \"\";\r\n\t for(int i=0;i<arg.length();i+=2)\r\n\t {\r\n\t String s = arg.substring(i, (i + 2));\r\n\t int decimal = Integer.parseInt(s, 16);\r\n\t str = str + (char) decimal;\r\n\t } \r\n\t return str;\r\n\t}", "public Sha256Hash(String hexString) {\n checkArgument(hexString.length() == 64);\n this.bytes = Hex.decode(hexString);\n }", "@Test\n public void stringFromBytesArray() {\n byte[] input = new byte[]{\n 12,\n -68,\n 102,\n 17,\n -11,\n 84,\n 11,\n -48,\n -128,\n -102,\n 56,\n -115,\n -55,\n 90,\n 97,\n 91\n };\n\n assertEquals(\n \"0cbc6611f5540bd0809a388dc95a615b\",\n JdkHashTools.getStringFromByteArray(input)\n );\n }", "@Test\n public void testHash() \n\t{\n\tLaboonCoin l = new LaboonCoin();\n\t\tint hash = l.hash(\"boo\");\n\t\tint result = 1428150834;\n\t\tassertEquals(result, hash);\n }", "private byte[] fromHex(String hexString) {\n int len = hexString.length() / 2;\n byte[] ret = new byte[len];\n for (int i = 0; i < len; i++) {\n ret[i] = (byte) Short.parseShort(hexString.substring(i * 2, i *\n 2 + 2), 16);\n }\n return ret;\n }", "public void binToHex(){\n\t\tthis.inputBin();\n\t\tif(checkValue()==true){\n\t\t\tthis.toHex();\n\t\t\tthis.outHex();\n\t\t}\n\t}", "@Test(timeout = 4000)\n public void test112() throws Throwable {\n try { \n JavaCharStream.hexval('<');\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "public boolean isHex()\n {\n return hex;\n }", "@Test(timeout = 4000)\n public void test114() throws Throwable {\n try { \n JavaCharStream.hexval(':');\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "private\n static\n boolean\n isHexChar( char ch )\n {\n return ( ch >= '0' && ch <= '9' ) ||\n ( ch >= 'a' && ch <= 'f' ) ||\n ( ch >= 'A' && ch <= 'F' );\n }", "public abstract byte[] mo32305a(String str);", "@Test(timeout = 4000)\n public void test098() throws Throwable {\n try { \n JavaCharStream.hexval('J');\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "@Test(timeout = 4000)\n public void test111() throws Throwable {\n try { \n JavaCharStream.hexval('=');\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "@Test(timeout = 4000)\n public void test088() throws Throwable {\n try { \n JavaCharStream.hexval('U');\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "@Test\n public void testCreateSha1() throws Exception {\n MessageDigest sha1 = MessageDigest.getInstance(MASTER_KEY_GENERATION_ALG);\n byte[] sha1Result = sha1.digest(SHA_1_INPUT);\n assertFalse(Arrays.equals(SHA_1_INPUT, sha1Result));\n }", "@Test(timeout = 4000)\n public void test085() throws Throwable {\n try { \n JavaCharStream.hexval('X');\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "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 boolean isHexBinary() {\n return false;\n }", "@Test\n public void testValidHashZero() \n\t{\n\tLaboonCoin l = new LaboonCoin();\n\tboolean result = l.validHash(0,8);\n\tassertEquals(result, true);\n }", "private static int transformHexCharToInt(byte val) throws HyracksDataException {\n switch (val) {\n case '0':\n return 0;\n case '1':\n return 1;\n case '2':\n return 2;\n case '3':\n return 3;\n case '4':\n return 4;\n case '5':\n return 5;\n case '6':\n return 6;\n case '7':\n return 7;\n case '8':\n return 8;\n case '9':\n return 9;\n case 'a':\n case 'A':\n return 10;\n case 'b':\n case 'B':\n return 11;\n case 'c':\n case 'C':\n return 12;\n case 'd':\n case 'D':\n return 13;\n case 'e':\n case 'E':\n return 14;\n case 'f':\n case 'F':\n return 15;\n default:\n throw new RuntimeDataException(ErrorCode.INVALID_FORMAT);\n }\n }", "@Test\n public void testAesEncryptForInputKey() throws Exception {\n byte[] key = Cryptos.generateAesKey();\n String input = \"foo message\";\n\n byte[] encryptResult = Cryptos.aesEncrypt(input.getBytes(\"UTF-8\"), key);\n String descryptResult = Cryptos.aesDecrypt(encryptResult, key);\n\n System.out.println(key);\n System.out.println(descryptResult);\n }", "@Test(timeout = 4000)\n public void test089() throws Throwable {\n try { \n JavaCharStream.hexval('T');\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "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}", "@Test\n public void testEntireRecord() throws NonObjectJSONException, ParseException, IOException, CryptoException {\n String inputString = \"{\\\"sortindex\\\": 131, \\\"payload\\\": \\\"{\\\\\\\"ciphertext\\\\\\\":\\\\\\\"YJB4dr0vZEIWPirfU2FCJvfzeSLiOP5QWasol2R6ILUxdHsJWuUuvTZVhxYQfTVNou6hVV67jfAvi5Cs+bqhhQsv7icZTiZhPTiTdVGt+uuMotxauVA5OryNGVEZgCCTvT3upzhDFdDbJzVd9O3/gU/b7r/CmAHykX8bTlthlbWeZ8oz6gwHJB5tPRU15nM/m/qW1vyKIw5pw/ZwtAy630AieRehGIGDk+33PWqsfyuT4EUFY9/Ly+8JlnqzxfiBCunIfuXGdLuqTjJOxgrK8mI4wccRFEdFEnmHvh5x7fjl1ID52qumFNQl8zkB75C8XK25alXqwvRR6/AQSP+BgQ==\\\\\\\",\\\\\\\"IV\\\\\\\":\\\\\\\"v/0BFgicqYQsd70T39rraA==\\\\\\\",\\\\\\\"hmac\\\\\\\":\\\\\\\"59605ed696f6e0e6e062a03510cff742bf6b50d695c042e8372a93f4c2d37dac\\\\\\\"}\\\", \\\"id\\\": \\\"0-P9fabp9vJD\\\", \\\"modified\\\": 1326254123.65}\";\n CryptoRecord record = CryptoRecord.fromJSONRecord(inputString);\n assertEquals(\"0-P9fabp9vJD\", record.guid);\n assertEquals(1326254123650L, record.lastModified);\n assertEquals(131, record.sortIndex);\n\n String b64E = \"0A7mU5SZ/tu7ZqwXW1og4qHVHN+zgEi4Xwfwjw+vEJw=\";\n String b64H = \"11GN34O9QWXkjR06g8t0gWE1sGgQeWL0qxxWwl8Dmxs=\";\n record.keyBundle = KeyBundle.fromBase64EncodedKeys(b64E, b64H);\n record.decrypt();\n\n assertEquals(\"0-P9fabp9vJD\", record.guid);\n assertEquals(1326254123650L, record.lastModified);\n assertEquals(131, record.sortIndex);\n\n assertEquals(\"Customize Firefox\", record.payload.get(\"title\"));\n assertEquals(\"0-P9fabp9vJD\", record.payload.get(\"id\"));\n assertTrue(record.payload.get(\"tags\") instanceof JSONArray);\n }", "@Test(timeout = 4000)\n public void test099() throws Throwable {\n try { \n JavaCharStream.hexval('I');\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "@Test\r\n public void testCryptoBoxOpenWithType() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys sender = instance.createKeys(null);\r\n Keys receiver = instance.createKeys(null);\r\n CryptoBox box = instance.cryptoBox(data, sender, receiver);\r\n byte[] result = instance.cryptoBoxOpen(box.cipher, box.nonce, sender, receiver);\r\n assertArrayEquals(result, data);\r\n }", "@Test(timeout = 4000)\n public void test096() throws Throwable {\n try { \n JavaCharStream.hexval('M');\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "public static byte[] fromHexString( String s ) \r\n { \r\n int stringLength = s.length(); \r\n if ( ( stringLength & 0x1 ) != 0 ) \r\n { \r\n throw new IllegalArgumentException( \"fromHexString requires an even number of hex characters\" ); \r\n } \r\n byte[] bytes = new byte[stringLength / 2]; \r\n \r\n for ( int i = 0, j = 0; i < stringLength; i += 2, j++ ) \r\n { \r\n int high = charToNibble( s.charAt( i ) ); \r\n int low = charToNibble( s.charAt( i + 1 ) ); \r\n // You can store either unsigned 0..255 or signed -128..127 bytes in a byte type. \r\n bytes[ j ] = ( byte ) ( ( high << 4 ) | low ); \r\n } \r\n return bytes; \r\n }", "@Test(timeout = 4000)\n public void test077() throws Throwable {\n try { \n JavaCharStream.hexval('`');\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "@Test\r\n public void testCrypto_box_open() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys sender = instance.createKeys(null);\r\n Keys receiver = instance.createKeys(null);\r\n CryptoBox box = instance.cryptoBox(data, sender, receiver);\r\n byte[] result = instance.cryptoBoxOpen(box.cipher, box.nonce, receiver, sender);\r\n assertArrayEquals(result, data);\r\n }", "@Test(timeout = 4000)\n public void test095() throws Throwable {\n try { \n JavaCharStream.hexval('N');\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "private static String decryptAES() {\n\t\tString inFilename = \"7hex.txt\";\n\t\ttry {\n\t\t\tFileReader fr = new FileReader(inFilename);\n\t\t\tBufferedReader br = new BufferedReader(fr);\n\n\t\t\tfinal String keyHex = asciiToHex(\"YELLOW SUBMARINE\");\n\t\t\tfinal String cipherHex = br.readLine();\n\n\t\t\tSecretKey key = new SecretKeySpec(DatatypeConverter.parseHexBinary(keyHex), \"AES\");\n\t\t\tCipher cipher = Cipher.getInstance(\"AES/ECB/NoPadding\");\n\t\t\tcipher.init(Cipher.DECRYPT_MODE, key);\n\t\t\tbyte[] result = cipher.doFinal(DatatypeConverter.parseHexBinary(cipherHex));\n\n\t\t\tbr.close();\n\t\t\tfr.close();\n\n\t\t\treturn new String(result);\n\t\t} catch (Exception e) {\n\t\t\treturn null;\n\t\t}\n\t}", "public String getHexCode() {\r\n return this.hexCode;\r\n }", "@Test(timeout = 4000)\n public void test086() throws Throwable {\n try { \n JavaCharStream.hexval('W');\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "@Test(timeout = 4000)\n public void test079() throws Throwable {\n try { \n JavaCharStream.hexval('^');\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "public static void main(String[] args) throws Exception {\n\t\t\r\n\t\tString str = hexStr2binaryStr(\"33\");\r\n\t\tSystem.out.println(str);\r\n\t}" ]
[ "0.72850317", "0.69650483", "0.6867656", "0.6581343", "0.6549225", "0.650478", "0.63511515", "0.63037324", "0.61848927", "0.61652714", "0.61503094", "0.6129225", "0.6118742", "0.60595906", "0.60431415", "0.60272574", "0.59995", "0.5930524", "0.5929355", "0.59036386", "0.58904755", "0.5880823", "0.58606", "0.58579683", "0.58471125", "0.5837805", "0.5820224", "0.5800002", "0.5776648", "0.5751931", "0.57385296", "0.5722017", "0.5712074", "0.570739", "0.56983525", "0.56976473", "0.5693562", "0.56728387", "0.5672494", "0.5648311", "0.56385034", "0.56260073", "0.56178206", "0.55988854", "0.55892706", "0.555605", "0.5513153", "0.5495994", "0.5495784", "0.54882365", "0.54812706", "0.54686415", "0.5467986", "0.54628307", "0.54508203", "0.5446226", "0.54293936", "0.5405713", "0.53913426", "0.53869116", "0.5383508", "0.5382484", "0.53819597", "0.5361617", "0.5325915", "0.53167635", "0.5311358", "0.5311126", "0.53061616", "0.5303886", "0.52894944", "0.5279849", "0.5278914", "0.52716583", "0.5268291", "0.5267389", "0.52607256", "0.52605116", "0.52582157", "0.5242692", "0.5241065", "0.52223325", "0.52220845", "0.52215004", "0.52178735", "0.52115214", "0.5209759", "0.52026635", "0.51923513", "0.5179291", "0.51744175", "0.51722765", "0.5170673", "0.51667106", "0.51654905", "0.51612747", "0.5161106", "0.51607573", "0.51572406", "0.515682" ]
0.8494838
0
Test of toByte method, of class Crypto.
@Test public void testToByte() { System.out.println("toByte"); String hexString = ""; byte[] expResult = null; byte[] result = Crypto.toByte(hexString); assertEquals(expResult, result); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testToHex_byteArr() {\n System.out.println(\"toHex\");\n byte[] buf = null;\n String expResult = \"\";\n String result = Crypto.toHex(buf);\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 void testToByte(){\t\r\n\t\t\r\n\t\tbyte[] lRes = ByteUtil.intToByteArray(fIntToTest);\r\n\t\t\r\n\t\tfor(int lCnt =0; lCnt< lRes.length; lCnt++){\r\n\t\t\tassertEquals(lRes[lCnt], fIntToTestByteArray[lCnt]);\r\n\t\t}\r\n\t\t\r\n\t}", "byte decodeByte();", "byte toByteValue() {\n return (byte) value;\n }", "public abstract byte[] toBytes() throws Exception;", "@Test\n public void testHexAndBytesTransformation() {\n byte[] bytes = ByteUtils.stringToBytes(ByteUtils.bytesToHexString(testBytes));\n assertArrayEquals(testBytes, bytes); \n }", "@Test\n public void testFromHex() {\n System.out.println(\"fromHex\");\n String hex = \"\";\n String expResult = \"\";\n String result = Crypto.fromHex(hex);\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 }", "@Test\n public void testBytesToHexString() {\n String testHex = ByteUtils.bytesToHexString(testBytes); \n assertEquals(testHex.length(), testBytes.length * 2);\n }", "@ZenCodeType.Caster\n @ZenCodeType.Method\n default @ZenCodeType.Unsigned byte asByte() {\n \n return notSupportedCast(BasicTypeID.BYTE);\n }", "@Test\r\n public void testVerifyCryptoType() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }", "byte getEByte();", "@Test\n public void testToHex_String() {\n System.out.println(\"toHex\");\n String txt = \"\";\n String expResult = \"\";\n String result = Crypto.toHex(txt);\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 int toByte(){\n return toByte(0);\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 }", "public ArrayGetByte()\n {\n super(\"ArrayGetByte\");\n }", "@Test\n\tpublic void testBytesToHexStringForSrcMode() throws Exception {\n//TODO: Test goes here... \n\t}", "public abstract byte[] toByteArray();", "public abstract byte[] toByteArray();", "byte readByte();", "public interface ByteAdaptable {\n\n byte[] SetToByte();\n}", "byte[] getBytes();", "byte[] getBytes();", "@Test\n public void testToHex() \n {\n System.out.println(\"toHex\");\n String argument = \"12\";\n Converter instance = new Converter();\n String expResult = \"C\";\n String result = instance.toHex(argument);\n \n //assert that the result we expect comes out. If the result that is expecte is generated then the test will pass. If not, then it will fail\n assertEquals(expResult, result);\n assertEquals(\"D\", instance.toHex(\"13\"));\n assertEquals(\"7B\", instance.toHex(\"123\"));\n assertEquals(\"D\", instance.toHex(\"13\"));\n assertEquals(\"2710\", instance.toHex(\"10000\"));\n }", "boolean hasByte();", "static public void assertEquals(byte expected, byte actual) {\n assertEquals(null, expected, actual);\n }", "byte mo30283c();", "public byte getByte(String key)\n {\n return getByte(key, (byte) 0);\n }", "public native byte __byteMethod( long __swiftObject, byte arg );", "@Test\n\tpublic void getByteOf_Test() {\n\t\tfinal short value = 8738;\n\t\t\n\t\t// Should be 0010 0010 = 34\n\t\tfinal byte value0 = FlagUtils.getByteOf(value, 0);\n\t\tassertThat(value0, is((byte) 34));\n\t\t\n\t\t// The same like above\n\t\tfinal byte value1 = FlagUtils.getByteOf(value, 1);\n\t\tassertThat(value1, is((byte) 34));\n\t}", "byte toStringValue() {\n return (byte) String.valueOf(value).charAt(0);\n }", "private byte nextByte(ByteBuffer inputBuffer) throws IOException {\n getAtLeastBytes(inputBuffer, 1);\n return inputBuffer.get();\n }", "@Test\r\n public void testCryptoBox() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys sender = instance.createKeys(null);\r\n Keys receiver = instance.createKeys(null);\r\n CryptoBox result = instance.cryptoBox(data, sender, receiver);\r\n assertNotNull(result);\r\n }", "@Test\n public void testDecToHex() {\n Assert.assertEquals(\"41\", Cipher_Helper.decToHex(65));\n Assert.assertEquals(\"5A\", Cipher_Helper.decToHex(90));\n Assert.assertEquals(\"4D\", Cipher_Helper.decToHex(77));\n }", "public byte getByte(String key) {\n Object value = get(key);\n return ((value instanceof Long) ? (byte)((Long)value).intValue() : 0);\n }", "byte[] encrypt(String plaintext);", "public abstract void mo4360a(byte b);", "@Test\n public void testFromBytes() throws Exception {\n assertEquals(\"1 a\", undertest2.fromBytes(intsToBytes(0), 0, 3));\n // 16->0b00001000->0b001 => 0b00->0->\"1\", 0b1->1->\"b\"\n assertEquals(\"1 b\", undertest2.fromBytes(intsToBytes(16), 2, 5));\n // 8->0b00010000->0b100 => 0b10->1->\"2\", 0b0->0->\"a\"\n assertEquals(\"2 a\", undertest2.fromBytes(intsToBytes(8), 3, 6));\n // 32->0b00000100->0b010 => 0b01->2->\"3\", 0b0->0->\"a\"\n assertEquals(\"3 a\", undertest2.fromBytes(intsToBytes(32), 4, 7));\n // 8->0b00010000->0b000 => 0b00->0->\"1\", 0b0->0->\"a\"\n assertEquals(\"1 a\", undertest2.fromBytes(intsToBytes(8), 0, 3));\n // 255->0b11111111->0b111 => 0b11->3->\"4\", 0b1->1->\"b\"\n assertEquals(\"4 b\", undertest2.fromBytes(intsToBytes(255), 0, 3));\n }", "public Self aByte(int b) {\n return aByte((byte) b);\n }", "@Test\r\n public void testCryptoBoxSeal() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] result = instance.cryptoBoxSeal(keys, data);\r\n assertNotNull(result);\r\n }", "ByteConstant createByteConstant();", "boolean verify(byte[] expected);", "public byte toByte() {\n return this.toByteArray()[0];\n }", "byte[] IntToByte(int i)\r\n {\r\n return Integer.toString(i).getBytes();\r\n }", "@Test\n\tpublic void getByteOf_Test2() {\n\t\tfinal short value = 8930;\n\t\t\n\t\t// Should be 1110 0010 = -30\n\t\tfinal byte value0 = FlagUtils.getByteOf(value, 0);\n\t\tassertThat(value0, is((byte) -30));\n\t\t\n\t\t// Should be 0010 0010 = 34\n\t\tfinal byte value1 = FlagUtils.getByteOf(value, 1);\n\t\tassertThat(value1, is((byte) 34));\n\t}", "final byte getByte(int column) {\n switch (jdbcTypes_[column - 1]) {\n case Types.BOOLEAN:\n return CrossConverters.getByteFromBoolean(get_BOOLEAN(column));\n case Types.SMALLINT:\n int smallInt = get_SMALLINT(column);\n if (smallInt > Byte.MAX_VALUE || smallInt < Byte.MIN_VALUE)\n throw new IllegalArgumentException(\"Value outside of byte range: \" + smallInt);\n return (byte) smallInt;\n case Types.INTEGER:\n int i = get_INTEGER(column);\n if (i > Byte.MAX_VALUE || i < Byte.MIN_VALUE)\n throw new IllegalArgumentException(\"Value outside of byte range: \" + i);\n return (byte) i;\n case Types.BIGINT:\n long l = get_BIGINT(column);\n if (l > Byte.MAX_VALUE || l < Byte.MIN_VALUE)\n throw new IllegalArgumentException(\"Value outside of byte range: \" + l);\n return (byte) l;\n case Types.REAL:\n float f = get_FLOAT(column);\n if (f > Byte.MAX_VALUE || f < Byte.MIN_VALUE)\n throw new IllegalArgumentException(\"Value outside of byte range: \" + f);\n return (byte) f;\n case Types.DOUBLE:\n double d = get_DOUBLE(column);\n if (d > Byte.MAX_VALUE || d < Byte.MIN_VALUE)\n throw new IllegalArgumentException(\"Value outside of byte range: \" + d);\n return (byte) d;\n case Types.DECIMAL:\n // For performance we don't materialize the BigDecimal, but convert directly from decimal bytes to a long.\n long ld = getLongFromDECIMAL(column, \"byte\");\n if (ld > Byte.MAX_VALUE || ld < Byte.MIN_VALUE)\n throw new IllegalArgumentException(\"Value outside of byte range: \" + ld);\n return (byte) ld;\n case Types.CHAR:\n return CrossConverters.getByteFromString(get_CHAR(column));\n case Types.VARCHAR:\n case Types.LONGVARCHAR:\n return CrossConverters.getByteFromString(get_VARCHAR(column));\n default:\n throw coercionError( \"byte\", column );\n }\n }", "@Test\n public void testTest1BC() throws Exception {\n\n PrivateKey privKey = MBouncy.getPrivateKey(PemUtil.getBlockAsString(t1PrivateKey));\n PublicKey publKey = MBouncy.getPublicKey(PemUtil.getBlockAsString(t1PublicKey));\n\n byte[] secure = MBouncy.encryptRsa(MString.toBytes(t1Secret), publKey);\n System.out.println(Base64.encode(secure));\n\n String secret =\n MString.byteToString(\n MBouncy.decryptRsa(secure, privKey, MBouncy.RSA_KEY_SIZE.B1024));\n\n assertEquals(t1Secret, secret);\n }", "@Test\r\n public void testVerify() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }", "public Byte _parseByte(JsonParser jVar, DeserializationContext gVar) throws IOException {\n JsonToken l = jVar.mo29328l();\n if (l == JsonToken.VALUE_STRING) {\n String trim = jVar.mo29334t().trim();\n if (_hasTextualNull(trim)) {\n return (Byte) _coerceTextualNull(gVar, this._primitive);\n }\n if (trim.length() == 0) {\n return (Byte) _coerceEmptyString(gVar, this._primitive);\n }\n _verifyStringForScalarCoercion(gVar, trim);\n try {\n int a = NumberInput.m23779a(trim);\n if (_byteOverflow(a)) {\n return (Byte) gVar.mo31517b(this._valueClass, trim, \"overflow, value cannot be represented as 8-bit value\", new Object[0]);\n }\n return Byte.valueOf((byte) a);\n } catch (IllegalArgumentException unused) {\n return (Byte) gVar.mo31517b(this._valueClass, trim, \"not a valid Byte value\", new Object[0]);\n }\n } else if (l == JsonToken.VALUE_NUMBER_FLOAT) {\n if (!gVar.mo31509a(DeserializationFeature.ACCEPT_FLOAT_AS_INT)) {\n _failDoubleToIntCoercion(jVar, gVar, \"Byte\");\n }\n return Byte.valueOf(jVar.mo29335A());\n } else if (l == JsonToken.VALUE_NULL) {\n return (Byte) _coerceNullToken(gVar, this._primitive);\n } else {\n if (l == JsonToken.START_ARRAY) {\n return (Byte) _deserializeFromArray(jVar, gVar);\n }\n if (l == JsonToken.VALUE_NUMBER_INT) {\n return Byte.valueOf(jVar.mo29335A());\n }\n return (Byte) gVar.mo31493a(this._valueClass, jVar);\n }\n }", "@Test\n public void testDecrypt() throws Exception {\n System.out.println(\"decrypt\");\n String seed = \"\";\n String encrypted = \"\";\n String expResult = \"\";\n String result = Crypto.decrypt(seed, encrypted);\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 }", "@Test\n public void testWriteReadBytesToFile() throws Exception {\n File testFile = new File(\"byteutils_test.bin\");\n testFile.deleteOnExit();\n \n ByteUtils.writeBytesToFile(testFile, testBytes);\n byte[] bytes = ByteUtils.readBytesFromFile(testFile);\n \n assertArrayEquals(testBytes, bytes);\n }", "private static byte charToByte(char c) {\n return (byte) \"0123456789ABCDEF\".indexOf(c);\n }", "private static byte charToByte(char c) {\n return (byte) \"0123456789ABCDEF\".indexOf(c);\n }", "private static byte charToByte(char c) {\n return (byte) \"0123456789ABCDEF\".indexOf(c);\n }", "@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 }", "private static byte charToByte(char c) {\r\n\t\treturn (byte) \"0123456789ABCDEF\".indexOf(c);\r\n\t}", "@Override\n public byte byteValue() {\n return value;\n }", "private static byte charToByte(char c) {\n\t\treturn (byte) \"0123456789ABCDEF\".indexOf(c);\n\t}", "public abstract void mo9798a(byte b);", "public static byte GetByte()\n\t{\n\t Random rand = new Random();\n\t return (byte)rand.nextInt(127);\n\t}", "public String Crypt(String s);", "@Test\n public void testWriteByteArray() {\n System.out.println(\"writeByteArray\");\n /** Positive testing. */\n String bytes = \"spam\";\n String expResult = \"4:spam\";\n String result = Bencoder.writeByteArray(bytes.getBytes(BConst.ASCII));\n assertEquals(expResult, result);\n bytes = \"\";\n expResult = \"0:\";\n result = Bencoder.writeByteArray(bytes.getBytes(BConst.ASCII));\n assertEquals(expResult, result);\n }", "byte[] mo38566a();", "@Test\n public void testEncrypt() throws Exception {\n System.out.println(\"encrypt\");\n String seed = \"\";\n String cleartext = \"\";\n String expResult = \"\";\n String result = Crypto.encrypt(seed, cleartext);\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 }", "byte[] get_secure_random_bytes();", "public String byteToChar(byte b[], String encoding);", "public byte[] charToByte(char char1, String encoding);", "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 getByteValue(double angle) {\n int maxVol = 127;\n return (new Integer(\n (int)Math.round(\n Math.sin(angle)*maxVol))).\n byteValue();\n }", "public static byte getUniqueByte() {\n return (byte) getUniqueChar();\n }", "public abstract void accept(byte value);", "public static byte[] ECP_to_byte(ECP ecp){\n byte[] temp = new byte[65];\n ecp.toBytes(temp, false);\n return temp;\n }", "@Test\n\tpublic void testRoundOneSubBytes(){\n\t\tbyte[][] state = new byte[][]{\n\t\t\t\t\t\t\t\t\t\t{(byte) 0x19,(byte) 0xa0,(byte) 0x9a,(byte) 0xe9},\n\t\t\t\t\t\t\t\t\t\t{(byte) 0x3d,(byte) 0xf4,(byte) 0xc6,(byte) 0xf8},\n\t\t\t\t\t\t\t\t\t\t{(byte) 0xe3,(byte) 0xe2,(byte) 0x8d,(byte) 0x48},\n\t\t\t\t\t\t\t\t\t\t{(byte) 0xbe,(byte) 0x2b,(byte) 0x2a,(byte) 0x08}};\n\t\t\n\t\tbyte[][] result = new byte[][]{\n\t\t\t\t\t\t\t\t\t\t{(byte) 0xd4,(byte) 0xe0,(byte) 0xb8,(byte) 0x1e},\n\t\t\t\t\t\t\t\t\t\t{(byte) 0x27,(byte) 0xbf,(byte) 0xb4,(byte) 0x41},\n\t\t\t\t\t\t\t\t\t\t{(byte) 0x11,(byte) 0x98,(byte) 0x5d,(byte) 0x52},\n\t\t\t\t\t\t\t\t\t\t{(byte) 0xae,(byte) 0xf1,(byte) 0xe5,(byte) 0x30}};\n\t\tint Nr = 0;\n\t\tAESCipher ac = new AESCipher(cipherkey, Nr);\n\t\tClass[] acarg = new Class[1];\n\t\tacarg[0] = byte[][].class;\n\t\tMethod method;\n\t\ttry {\n\t\t\tmethod = ac.getClass().getDeclaredMethod(\"subBytes\", acarg);\n\t\t\tmethod.setAccessible(true);\n\t\t\t\n\t\t\t\n\t\t\tObject o = method.invoke(ac, state);\n\t\t\t\n\t\t\tfor(int i = 0; i<state.length; i++){\n\t\t\t\tfor(int j = 0; j<state[i].length; j++){\n\t\t\t\t\tassertEquals(\"Current index is: (\"+i+\",\"+j+\").\",result[i][j], state[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (NoSuchMethodException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (SecurityException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalAccessException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (InvocationTargetException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private static char toChar(byte theByte) {\n if (theByte < 0) {\n return (char) (256 + theByte);\n } else {\n return (char) theByte;\n }\n }", "public abstract byte[] getEncoded();", "public Byte getByteAttribute();", "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 }", "@Test\n public void testCrypto() throws Exception {\n Security.addProvider(new MymeeCrypto());\n MessageDigest digest;\n try {\n digest = MessageDigest.getInstance(\"SHA-224\", \"MymeeCrypto\");\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n return;\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n return;\n }\n byte[] result;\n\n result = digest.digest(\"flxtest5i88vzf8orqj\".getBytes());\n\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < result.length; i++)\n sb.append(String.format(\"%02x\", result[i]));\n assertTrue(\"fbfc986da9dc02cb5f6395d926f349b1674727be2fefda8d6044187d\".equals(sb.toString()));\n }", "byte mo25264b(int i);", "public byte readScalarByte() throws java.io.IOException;", "Encryption encryption();", "public static BiFunction<String, Message, Object> byteProvider(Function<byte[], Object> fun)\n {\n \n return (string, msg) -> {\n byte[] src = null;\n if (string != null)\n src = StringUtil.toUtfBytes(string);\n else\n src = msg.bytes();\n \n return fun.apply(src);\n };\n \n }", "void mo4520a(byte[] bArr);", "@Test\n public void stringFromBytesArray() {\n byte[] input = new byte[]{\n 12,\n -68,\n 102,\n 17,\n -11,\n 84,\n 11,\n -48,\n -128,\n -102,\n 56,\n -115,\n -55,\n 90,\n 97,\n 91\n };\n\n assertEquals(\n \"0cbc6611f5540bd0809a388dc95a615b\",\n JdkHashTools.getStringFromByteArray(input)\n );\n }", "@Test\n public void testAesForInputKeyMode() throws Exception {\n//TODO: Test goes here... \n/* \ntry { \n Method method = Cryptos.getClass().getMethod(\"aes\", byte[].class, byte[].class, int.class); \n method.setAccessible(true); \n method.invoke(<Object>, <Parameters>); \n} catch(NoSuchMethodException e) { \n} catch(IllegalAccessException e) { \n} catch(InvocationTargetException e) { \n} \n*/\n }", "public byte getByte(int index)\r\n/* 317: */ {\r\n/* 318:331 */ ensureAccessible();\r\n/* 319:332 */ return _getByte(index);\r\n/* 320: */ }", "void writeByte(byte value);", "@Test\n public void testCryptographyNegative()\n {\n byte[] sensitiveBytes = sensitiveString.getBytes();\n byte[] secure = StateUtils.encrypt(sensitiveBytes, externalContext);\n \n secure[secure.length-5] = (byte) 1;\n try\n {\n byte[] insecure = StateUtils.decrypt(secure, externalContext);\n Assertions.assertFalse(Arrays.equals(insecure, sensitiveBytes));\n }\n catch (Exception e)\n {\n // do nothing\n }\n }", "@OfMethod({\"getByte(java.lang.String)\", \"getByte(int)\"})\n public void testGetByte() throws Exception {\n CallableStatement instance = newClosedCall();\n\n try {\n instance.getByte(getParameterName());\n fail(\"Allowed get byte by parameter name after close.\");\n } catch (SQLException ex) {\n checkException(ex);\n }\n\n try {\n instance.getByte(getParameterIndex());\n fail(\"Allowed get byte by parameter index after close.\");\n } catch (SQLException ex) {\n checkException(ex);\n }\n }", "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 }", "@Test\n\tpublic void test1(){\n\t\t\n\t\tString str = \"abc\";\n\t\tbyte[] vs = str.getBytes();\n\t\tchar[] ca = str.toCharArray();\n\t\tfor (byte b : vs) {\n\t\t\tSystem.out.println(b);\n\t\t}\n\t\tfor (char c : ca) {\n\t\t\tSystem.out.println(c);\n\t\t}\n\t\tSystem.out.println(Arrays.toString(ca));\n\t\t\n\t}", "public byte[] charToByte(String text, String encoding);", "byte[] decodeBytes();", "@OfMethod({\"getBytes(java.lang.String)\", \"getBytes(int)\"})\n public void testGetBytes() throws Exception {\n CallableStatement instance = newClosedCall();\n\n try {\n instance.getBytes(getParameterName());\n fail(\"Allowed get bytes by parameter name after close.\");\n } catch (SQLException ex) {\n checkException(ex);\n }\n\n try {\n instance.getBytes(getParameterIndex());\n fail(\"Allowed get bytes by parameter index after close.\");\n } catch (SQLException ex) {\n checkException(ex);\n }\n }", "public void testToByteArray()\n {\n // we'll test making a couple EthernetAddresses and then check that the\n // toByteArray returns the same value in byte form as used to create it\n \n // first we'll test the null EthernetAddress\n EthernetAddress ethernet_address = new EthernetAddress(0L);\n assertEquals(\"Expected length of returned array wrong\",\n ETHERNET_ADDRESS_ARRAY_LENGTH,\n ethernet_address.toByteArray().length);\n assertEthernetAddressArraysAreEqual(\n NULL_ETHERNET_ADDRESS_BYTE_ARRAY, 0,\n ethernet_address.toByteArray(), 0);\n \n // now test a non-null EthernetAddress\n ethernet_address = new EthernetAddress(VALID_ETHERNET_ADDRESS_LONG);\n assertEquals(\"Expected length of returned array wrong\",\n ETHERNET_ADDRESS_ARRAY_LENGTH,\n ethernet_address.toByteArray().length);\n assertEthernetAddressArraysAreEqual(\n VALID_ETHERNET_ADDRESS_BYTE_ARRAY, 0,\n ethernet_address.toByteArray(), 0);\n \n // let's make sure that changing the returned array doesn't mess with\n // the wrapped EthernetAddress's internals\n byte[] ethernet_address_byte_array = ethernet_address.toByteArray();\n // we'll just stir it up a bit and then check that the original\n // EthernetAddress was not changed in the process.\n // The easiest stir is to sort it ;)\n Arrays.sort(ethernet_address_byte_array);\n assertEthernetAddressArraysAreNotEqual(\n VALID_ETHERNET_ADDRESS_BYTE_ARRAY, 0,\n ethernet_address_byte_array, 0);\n assertEthernetAddressArraysAreNotEqual(\n ethernet_address.toByteArray(), 0,\n ethernet_address_byte_array, 0);\n assertEthernetAddressArraysAreEqual(\n VALID_ETHERNET_ADDRESS_BYTE_ARRAY, 0,\n ethernet_address.toByteArray(), 0);\n }", "public abstract byte read_octet();", "@Test\n public void testToBinary() {\n Object[][] datas = new Object[][]{\n {0, \"0\"},\n {5, \"101\"},\n {10, \"1010\"},\n {11, \"1011\"}\n };\n for (Object[] data : datas) {\n String result = Tools.toBinary((int) data[0]); //Actual\n String expResult = (String) data[1]; //Expected\n assertEquals(result, expResult);\n System.out.println(\"testToBinary()\");\n }\n }", "@Test void byteSmall() {\n\t\tAztecCode marker = new AztecEncoder().\n\t\t\t\taddUpper(\"A\").addBytes(new byte[]{1, 100, (byte)200}, 0, 3).addLower(\"a\").fixate();\n\n\t\t// clear the old data\n\t\tclearMarker(marker);\n\n\t\tassertTrue(new AztecDecoder().process(marker));\n\n\t\tassertEquals('A', marker.message.charAt(0));\n\t\tassertEquals(1, (int)marker.message.charAt(1));\n\t\tassertEquals(100, (int)marker.message.charAt(2));\n\t\tassertEquals(200, (int)marker.message.charAt(3));\n\t\tassertEquals('a', marker.message.charAt(4));\n\t}", "private static byte charToByte(char c) {\n if (c >= 0x30 && c <= 0x39) {\n return (byte) (c - 0x30);\n } else if (c >= 0x41 && c <= 0x46) {\n return (byte) (c - 0x37);\n } else if (c >= 0x61 && c <= 0x66) {\n return (byte) (c - 0x57);\n }\n return 0;\n }", "@ZenCodeType.Caster\n @ZenCodeType.Method\n default byte[] asByteArray() {\n //TODO this is actually sbyte[], but @Unsigned doesn't work on arrays right now\n return notSupportedCast(\"byte[]\");\n }", "@Test\n public void testAesForInputKeyIvMode() throws Exception {\n//TODO: Test goes here... \n/* \ntry { \n Method method = Cryptos.getClass().getMethod(\"aes\", byte[].class, byte[].class, byte[].class, int.class); \n method.setAccessible(true); \n method.invoke(<Object>, <Parameters>); \n} catch(NoSuchMethodException e) { \n} catch(IllegalAccessException e) { \n} catch(InvocationTargetException e) { \n} \n*/\n }" ]
[ "0.6742011", "0.6476061", "0.63524246", "0.6322485", "0.6279421", "0.61941034", "0.6147805", "0.6094473", "0.60599387", "0.5974516", "0.59715104", "0.5942498", "0.59272057", "0.5899346", "0.5824341", "0.582243", "0.58186203", "0.58186203", "0.57942307", "0.5768116", "0.5753376", "0.5753376", "0.57464254", "0.57095057", "0.56989247", "0.56976724", "0.56873745", "0.56501573", "0.5645784", "0.56367236", "0.56316125", "0.56181765", "0.5616913", "0.5605137", "0.5554733", "0.55545217", "0.55221236", "0.5506167", "0.55061096", "0.55056643", "0.54902935", "0.54885817", "0.54645777", "0.54525375", "0.54503226", "0.5448155", "0.54475266", "0.54471195", "0.54447216", "0.5441494", "0.5430749", "0.5430749", "0.5430749", "0.5420838", "0.5418936", "0.5416879", "0.54112774", "0.5405635", "0.53787667", "0.5377966", "0.536699", "0.5357087", "0.5351699", "0.5347042", "0.5337077", "0.53180903", "0.53152376", "0.529076", "0.5290034", "0.52771854", "0.5271889", "0.52659404", "0.5264112", "0.5247766", "0.52383155", "0.52349627", "0.52272844", "0.52250934", "0.52219385", "0.52197355", "0.5208215", "0.5206706", "0.52044356", "0.5202449", "0.5201521", "0.5196703", "0.51951206", "0.5183454", "0.51807904", "0.5162986", "0.51620185", "0.51590884", "0.5158138", "0.5152831", "0.5149892", "0.5148815", "0.5145328", "0.5143225", "0.5142999", "0.51265" ]
0.8435078
0
Test of toHex method, of class Crypto.
@Test public void testToHex_byteArr() { System.out.println("toHex"); byte[] buf = null; String expResult = ""; String result = Crypto.toHex(buf); assertEquals(expResult, result); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testToHex_String() {\n System.out.println(\"toHex\");\n String txt = \"\";\n String expResult = \"\";\n String result = Crypto.toHex(txt);\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 }", "@Test\n public void testFromHex() {\n System.out.println(\"fromHex\");\n String hex = \"\";\n String expResult = \"\";\n String result = Crypto.fromHex(hex);\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 }", "@Test\n public void testToHex() \n {\n System.out.println(\"toHex\");\n String argument = \"12\";\n Converter instance = new Converter();\n String expResult = \"C\";\n String result = instance.toHex(argument);\n \n //assert that the result we expect comes out. If the result that is expecte is generated then the test will pass. If not, then it will fail\n assertEquals(expResult, result);\n assertEquals(\"D\", instance.toHex(\"13\"));\n assertEquals(\"7B\", instance.toHex(\"123\"));\n assertEquals(\"D\", instance.toHex(\"13\"));\n assertEquals(\"2710\", instance.toHex(\"10000\"));\n }", "@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 }", "@Test\n public void testBytesToHexString() {\n String testHex = ByteUtils.bytesToHexString(testBytes); \n assertEquals(testHex.length(), testBytes.length * 2);\n }", "@Test\n public void testDecToHex() {\n Assert.assertEquals(\"41\", Cipher_Helper.decToHex(65));\n Assert.assertEquals(\"5A\", Cipher_Helper.decToHex(90));\n Assert.assertEquals(\"4D\", Cipher_Helper.decToHex(77));\n }", "@Test\n public void testHexAndBytesTransformation() {\n byte[] bytes = ByteUtils.stringToBytes(ByteUtils.bytesToHexString(testBytes));\n assertArrayEquals(testBytes, bytes); \n }", "@Test\n\tpublic void testBytesToHexStringForSrcMode() throws Exception {\n//TODO: Test goes here... \n\t}", "@Test(dataProvider = \"dataForHexadecimal\")\n public void testToHexadecimal(int num, String hexadecimal) {\n String result = Tools.toHexadecimal(num);\n assertEquals(result, hexadecimal);\n System.out.println(\"testToHexadecimal()\");\n }", "public void binToHex(){\n\t\tthis.inputBin();\n\t\tif(checkValue()==true){\n\t\t\tthis.toHex();\n\t\t\tthis.outHex();\n\t\t}\n\t}", "private static String pasarAHexadecimal(byte[] digest){\n String hash = \"\";\n for(byte aux : digest) {\n int b = aux & 0xff;\n if (Integer.toHexString(b).length() == 1) hash += \"0\";\n hash += Integer.toHexString(b);\n }\n return hash;\n }", "@Test\n public void testCrypto() throws Exception {\n Security.addProvider(new MymeeCrypto());\n MessageDigest digest;\n try {\n digest = MessageDigest.getInstance(\"SHA-224\", \"MymeeCrypto\");\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n return;\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n return;\n }\n byte[] result;\n\n result = digest.digest(\"flxtest5i88vzf8orqj\".getBytes());\n\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < result.length; i++)\n sb.append(String.format(\"%02x\", result[i]));\n assertTrue(\"fbfc986da9dc02cb5f6395d926f349b1674727be2fefda8d6044187d\".equals(sb.toString()));\n }", "private static String toHex(byte[] hash) {\n StringBuilder hashedInput = new StringBuilder(\"\");\n for (int i = 0; i < hash.length; i++) {\n String hex = Integer.toHexString(0xff & hash[i]);\n if (hex.length() == 1) {\n hashedInput.append('0');\n }\n hashedInput.append(hex);\n }\n return hashedInput.toString();\n }", "public String toHex(String arg) throws UnsupportedEncodingException {\n\t return String.format(\"%064x\", new BigInteger(1, arg.getBytes(\"UTF8\")));\n\t}", "private boolean hex() {\r\n return ALT(GO() && decimal() || OK() && SET(\"ABCDEFabcdef\"));\r\n }", "private String toHex(byte[] data) {\r\n char[] chars = new char[data.length * 2];\r\n for (int i = 0; i < data.length; i++) {\r\n chars[i * 2] = HEX_DIGITS[(data[i] >> 4) & 0xf];\r\n chars[i * 2 + 1] = HEX_DIGITS[data[i] & 0xf];\r\n }\r\n return new String(chars);\r\n}", "public static String crypt(String str) {\n if (str == null || str.length() == 0) {\n throw new IllegalArgumentException(\"String to encript cannot be null or zero length\");\n }\n StringBuffer hexString = new StringBuffer();\n try {\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n md.update(str.getBytes());\n byte[] hash = md.digest();\n for (int i = 0; i < hash.length; i++) {\n if ((0xff & hash[i]) < 0x10) {\n hexString.append(\"0\" + Integer.toHexString((0xFF & hash[i])));\n } else {\n hexString.append(Integer.toHexString(0xFF & hash[i]));\n }\n }\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n return hexString.toString();\n }", "private static String convertToHex(byte[] data) throws IOException {\n //create new instance of string buffer\n StringBuffer stringBuffer = new StringBuffer();\n String hex = \"\";\n\n //encode byte data with base64\n hex = Base64.getEncoder().encodeToString(data);\n stringBuffer.append(hex);\n\n //return string\n return stringBuffer.toString();\n }", "@Test(timeout = 4000)\n public void test116() throws Throwable {\n int int0 = JavaCharStream.hexval('8');\n assertEquals(8, int0);\n }", "private void outHex(){\n\t\tSystem.out.println(binary);\n\t\tpw.println(binary);\n\t\t\n\t}", "public void invoke() throws Exception {\n\tchar[] DIGITS = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };\n\t \ntry\n{\n int l = in_data.length;\n\n char[] out = new char[l << 1];\n\n // two characters form the hex value.\n for (int i = 0, j = 0; i < l; i++) {\n out[j++] = DIGITS[(0xF0 & in_data[i]) >>> 4];\n out[j++] = DIGITS[0x0F & in_data[i]];\n }\n\n\tout_data = new String(out);\n\n} catch (Exception e) {\n\t System.out.println(\"-------------------------\");\n\t System.out.println(\"doEncryptNotif ERROR: \" + e.getMessage() + \".\");\n\t System.out.println(\"-------------------------\");\n\t throw e;\n} \n\n\t}", "@Test\n public void testEncrypt() throws Exception {\n System.out.println(\"encrypt\");\n String seed = \"\";\n String cleartext = \"\";\n String expResult = \"\";\n String result = Crypto.encrypt(seed, cleartext);\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 ToHexString() {\n this(true);\n }", "@Test\n public void testSomeMethod() throws Exception {\n String test= Hash.getSaltedHash(\"UND123\");\n \n System.out.println(\"------------------------------------\");\n System.out.println(\"Hash code \\n\");\n System.out.println(test +\"\\n\");\n assertEquals(true,Hash.check(\"UND123\", \"P1Rlnnlc9wJZXmieTCsZwFs0ppnQpOXjLPIuju0BaFE=$WuRG4kAGPpkR2XxRMH4Dz7T39iHttGzCrDIMaEMYvhA=\"));\n }", "@Test(timeout = 4000)\n public void test115() throws Throwable {\n int int0 = JavaCharStream.hexval('9');\n assertEquals(9, int0);\n }", "@Test(timeout = 4000)\n public void test122() throws Throwable {\n int int0 = JavaCharStream.hexval('2');\n assertEquals(2, int0);\n }", "@Test(timeout = 4000)\n public void test121() throws Throwable {\n int int0 = JavaCharStream.hexval('3');\n assertEquals(3, int0);\n }", "protected byte[] binaryToHex(byte[] digest) throws UnsupportedEncodingException {\n StringBuffer digestString = new StringBuffer();\n for (int i = 0; i < digest.length; i++) {\n if ((digest[i] & 0x000000ff) < 0x10) {\n digestString.append(\"0\" + Integer.toHexString(digest[i] & 0x000000ff));\n } else {\n digestString.append(Integer.toHexString(digest[i] & 0x000000ff));\n }\n }\n return digestString.toString().getBytes(encoding);\n }", "public String Crypt(String s);", "public CodePointIterator hexEncode() {\n return hexEncode(false);\n }", "private static String toHex(byte[] array) throws NoSuchAlgorithmException {\n\n BigInteger bi = new BigInteger(1, array);\n String hex = bi.toString(16);\n int paddingLength = (array.length * 2) - hex.length();\n if (paddingLength > 0) {\n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n } else {\n return hex;\n }\n }", "private static String convertToHex(byte[] data) {\r\n StringBuffer buf = new StringBuffer();\r\n for (int i = 0; i < data.length; i++) {\r\n int halfbyte = (data[i] >>> 4) & 0x0F;\r\n int two_halfs = 0;\r\n do {\r\n if ((0 <= halfbyte) && (halfbyte <= 9)) {\r\n buf.append((char) ('0' + halfbyte));\r\n }\r\n else {\r\n buf.append((char) ('a' + (halfbyte - 10)));\r\n }\r\n halfbyte = data[i] & 0x0F;\r\n } while(two_halfs++ < 1);\r\n }\r\n return buf.toString();\r\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/* */ }", "public String getHex() {\n return hex;\n }", "@Test(timeout = 4000)\n public void test105() throws Throwable {\n int int0 = JavaCharStream.hexval('C');\n assertEquals(12, int0);\n }", "@Test(timeout = 4000)\n public void test118() throws Throwable {\n int int0 = JavaCharStream.hexval('6');\n assertEquals(6, int0);\n }", "public static String convertToHex(byte[] otp) {\n return ByteIterator.ofBytes(otp).hexEncode().drainToString();\n }", "@Test(timeout = 4000)\n public void test125() throws Throwable {\n int int0 = JavaCharStream.hexval('0');\n assertEquals(0, int0);\n }", "static String hexSha256Msg(String text) {\n String str=null;\n byte[] data = text.getBytes();\n try {\n MessageDigest md = MessageDigest.getInstance(\"SHA-256\");\n md.update(data);\n byte[] bytes = md.digest();\n str = byteToHex(bytes);\n }catch (NoSuchAlgorithmException e){\n e.printStackTrace();\n }\n System.out.println(str);\n return str ;\n }", "private static String byteToHexString(final byte hash) {\n\t\tint n = hash;\n\t\tif (n < 0) {\n\t\t\tn = 256 + n;\n\t\t}\n\t\tint d1 = n / 16;\n\t\tint d2 = n % 16;\n\t\treturn FileHashingUtils.hexDigits[d1] + FileHashingUtils.hexDigits[d2];\n\t}", "private static byte[] fromHex(String hex) throws NoSuchAlgorithmException\n {\n byte[] bytes = new byte[hex.length() / 2];\n for(int i = 0; i<bytes.length ;i++)\n {\n bytes[i] = (byte)Integer.parseInt(hex.substring(2 * i, 2 * i + 2), 16);\n }\n return bytes;\n }", "@Test(timeout = 4000)\n public void test119() throws Throwable {\n int int0 = JavaCharStream.hexval('5');\n assertEquals(5, int0);\n }", "@Test(timeout = 4000)\n public void test103() throws Throwable {\n int int0 = JavaCharStream.hexval('E');\n assertEquals(14, int0);\n }", "@Test(timeout = 4000)\n public void test117() throws Throwable {\n int int0 = JavaCharStream.hexval('7');\n assertEquals(7, int0);\n }", "public boolean isHex()\n {\n return hex;\n }", "protected static String convertHex( String base )\r\n\t{\r\n\t\treturn \"H\" + HexConvertor.convertHex( base.getBytes() ); \r\n\t}", "@Test(timeout = 4000)\n public void test106() throws Throwable {\n int int0 = JavaCharStream.hexval('B');\n assertEquals(11, int0);\n }", "@Test(timeout = 4000)\n public void test076() throws Throwable {\n int int0 = JavaCharStream.hexval('a');\n assertEquals(10, int0);\n }", "@Test(timeout = 4000)\n public void test123() throws Throwable {\n int int0 = JavaCharStream.hexval('1');\n assertEquals(1, int0);\n }", "@Test\n public void testHash() \n\t{\n\tLaboonCoin l = new LaboonCoin();\n\t\tint hash = l.hash(\"boo\");\n\t\tint result = 1428150834;\n\t\tassertEquals(result, hash);\n }", "public String binToHex(String input) {\r\n int decimal = Integer.parseInt(input,2);\t\r\n\t\treturn Integer.toString(decimal,16);\t\r\n\t}", "private static String HashIt(String token) {\n\t\tStringBuffer hexString = new StringBuffer();\n\t\ttry {\n\t\t\tMessageDigest digest = MessageDigest.getInstance(\"SHA-256\");\n\t\t\tbyte[] hash = digest.digest(token.getBytes(StandardCharsets.UTF_8));\n\t\t\t\n\t\t\t// Convert to hex\n\t\t for (int i = 0; i < hash.length; i++) {\n\t\t\t String hex = Integer.toHexString(0xff & hash[i]);\n\t\t\t if(hex.length() == 1) {\n\t\t\t \thexString.append('0');\n\t\t\t }\n\t\t\t hexString.append(hex);\n\t\t }\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\tSystem.err.println(e.getStackTrace());\n\t\t\thexString.setLength(0);\n\t\t}\n\t return hexString.toString();\t\t\n\t}", "public String toHexString()\n\t{\n\t\t// holds the string builder object to return\n\t\tStringBuilder sb = new StringBuilder();\n\t\t\n\t\t// for every byte\n\t\tfor (int i = 0; i < bytes.length; i++)\n\t\t{\n\t\t\tint intCurrent = bytes[i] & 0xFF;\n\t\t\t\n\t\t\t// check to see if a leading 0 is needed\n\t\t\tif (intCurrent < 0x10)\n\t\t\t{\n\t\t\t\t// append a 0\n\t\t\t\tsb.append(0);\n\t\t\t}\n\t\t\t\n\t\t\tString s = Integer.toHexString(intCurrent).toUpperCase();\n\t\t\t\n\t\t\t// append the character\n\t\t\tsb.append(s);\n\t\t}\n\t\t\n\t\t// return the string\n\t\treturn sb.toString();\n\t}", "private String toHex(byte[] array)\n {\n BigInteger bi = new BigInteger(1, array);\n String hex = bi.toString(16);\n int paddingLength = (array.length * 2) - hex.length();\n if(paddingLength > 0) \n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n else\n return hex;\n }", "public static String asciiToHex(String asciiValue)\n \t{\n \t char[] chars = asciiValue.toCharArray();\n \t StringBuffer hex = new StringBuffer();\n \t for (int i = 0; i < chars.length; i++)\n \t {\n \t hex.append(Integer.toHexString((int) chars[i]));\n \t }\n \t return hex.toString();\n \t}", "public String toString() {\n return Util.bytesToHex(getByteArray());\n }", "@Test(timeout = 4000)\n public void test104() throws Throwable {\n int int0 = JavaCharStream.hexval('D');\n assertEquals(13, int0);\n }", "public String getHexValue() {\n return hexValue;\n }", "@Test\r\n public void testVerifyCryptoType() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }", "private static byte[] fromHex(String hex) throws NoSuchAlgorithmException {\n byte[] bytes = new byte[hex.length() / 2];\n for (int i = 0; i < bytes.length; i++) {\n bytes[i] = (byte) Integer.parseInt(hex.substring(2 * i, 2 * i + 2), 16);\n }\n return bytes;\n }", "public String toHexString() {\n\treturn ByteUtils.toHexString(toByteArray());\n }", "@Test(timeout = 4000)\n public void test102() throws Throwable {\n int int0 = JavaCharStream.hexval('F');\n assertEquals(15, int0);\n }", "private String makeHex(byte[] buffer) {\n byte current;\n int length = buffer.length;\n String blank = \"\"; // it's easier to change\n StringBuffer ret = new StringBuffer(2*length);\n\n // do for each half byte\n for(int i=0;i<(2*length);i++)\n {\n\t// mask half byte and move it to the right\n\tcurrent = i%2==1 ? (byte) (buffer[(i/2)] & 0x0F)\n\t : (byte) ((buffer[(i/2)] >> 4) & 0x0F);\n\t\n\t// convert half byte to ASCII char\t\t \n\tret.append((char) (current < 0x0A ? current+0x30 : current+0x37) + (i%2==1 ? blank : \"\"));\n }\n return ret.toString();\n }", "@Test\r\n public void testCryptoBox() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys sender = instance.createKeys(null);\r\n Keys receiver = instance.createKeys(null);\r\n CryptoBox result = instance.cryptoBox(data, sender, receiver);\r\n assertNotNull(result);\r\n }", "@Test(timeout = 4000)\n public void test075() throws Throwable {\n int int0 = JavaCharStream.hexval('b');\n assertEquals(11, int0);\n }", "@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 }", "private static String toHex(byte[] array)\n\t {\n\t BigInteger bi = new BigInteger(1, array);\n\t String hex = bi.toString(16);\n\t int paddingLength = (array.length * 2) - hex.length();\n\t if(paddingLength > 0)\n\t return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n\t else\n\t return hex;\n\t }", "private static String toHex(final byte[] array) {\n final BigInteger bi = new BigInteger(1, array);\n final String hex = bi.toString(16);\n final int paddingLength = (array.length * 2) - hex.length();\n if (paddingLength > 0) {\n return String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\n } else {\n return hex;\n }\n }", "private String hexify(byte bytes[]) {\n\n char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7',\n '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};\n\n StringBuilder buf = new StringBuilder(bytes.length * 2);\n\n for (byte aByte : bytes) {\n buf.append(hexDigits[(aByte & 0xf0) >> 4]);\n buf.append(hexDigits[aByte & 0x0f]);\n }\n\n return buf.toString();\n }", "private static String hexify(byte bytes[]) {\n\n char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7',\n '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};\n\n StringBuilder buf = new StringBuilder(bytes.length * 2);\n for (byte aByte : bytes) {\n buf.append(hexDigits[(aByte & 0xf0) >> 4]);\n buf.append(hexDigits[aByte & 0x0f]);\n }\n return buf.toString();\n }", "@Test(timeout = 4000)\n public void test120() throws Throwable {\n int int0 = JavaCharStream.hexval('4');\n assertEquals(4, int0);\n }", "@Test\n public void testCreateSha1() throws Exception {\n MessageDigest sha1 = MessageDigest.getInstance(MASTER_KEY_GENERATION_ALG);\n byte[] sha1Result = sha1.digest(SHA_1_INPUT);\n assertFalse(Arrays.equals(SHA_1_INPUT, sha1Result));\n }", "public TimeCryptoProofSHA256(String hexSalt) {\n super(hexSalt);\n }", "public static String encryptPassword(String input) {\n\t\tStringBuilder hexadecimalString = null;\n\t\tbyte[] byteArray;\n\t\t\n\t\ttry {\n\t\t\t//convert input string into a SHA encrypted byte array\n\t\t\tMessageDigest messageDigest = MessageDigest.getInstance(\"SHA-256\");\n\t\t\tbyteArray = messageDigest.digest(input.getBytes(StandardCharsets.UTF_8));\n\t\t\t\n\t\t\t//Now convert that byte array into hexadecimal\n\t\t\thexadecimalString = new StringBuilder(2 * byteArray.length);\n\t\t\tfor(byte i : byteArray) {\n\t\t\t\t//Hex value of a byte\n\t\t\t\tString hexValue = Integer.toHexString(0xff & i);\n\t\t\t\t\n\t\t\t\t//If the hex value is only a single digit, add a 0\n\t\t\t\tif(hexValue.length() == 1) \n\t\t\t\t\thexadecimalString.append('0');\n\t\t\t\t\n\t\t\t\t//Add the hex value to the entire string of hex values\n\t\t\t\thexadecimalString.append(hexValue);\n\t\t\t}\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn hexadecimalString.toString();\n\t}", "private String calchash() {\r\n String a0 = String.valueOf(bindex);\r\n a0 += String.valueOf(bdate);\r\n a0 += bdata;\r\n a0 += String.valueOf(bonce);\r\n a0 += blasthash;\r\n String a1;\r\n a1 = \"\";\r\n try {\r\n a1 = sha256(a0);\r\n } catch (NoSuchAlgorithmException ex) {\r\n Logger.getLogger(Block.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return a1;\r\n\r\n }", "public boolean isHexBinary() {\n return false;\n }", "private static String convertStringToHex(String input){\n\t\tchar[] chars = input.toCharArray();\n\t\tStringBuffer hexOutput = new StringBuffer();\n\t\t\n\t\tfor(int i = 0; i < chars.length; i++){\n\t\t\thexOutput.append(Integer.toHexString((int)chars[i]));\n\t\t}\n\n\t\treturn hexOutput.toString();\n\t}", "public String hex() {\r\n return this.hex;\r\n }", "public static final String toHex(byte hash[]) {\r\n StringBuffer buf = new StringBuffer(hash.length * 2);\r\n int i;\r\n\r\n for (i = 0; i < hash.length; i++) {\r\n if (((int) hash[i] & 0xff) < 0x10) {\r\n buf.append(\"0\");\r\n }\r\n buf.append(Long.toString((int) hash[i] & 0xff, 16));\r\n }\r\n return buf.toString();\r\n }", "private static String binToHex(String bin) {\n\t\tString hex = \"\";\n\t\twhile (bin.length() % 4 != 0) { // comprueba si la cadena tiene longitud multiplo de 4\n\t\t\tbin = \"0\" + bin; // si no, le aņado un cero y vuelvo a comprobar si es multiplo de 4\n\t\t}\n\t\t// este while va cogiendo cachitos de 4, los pasa a hexadecimal y acumula en la variable hex\n\t\twhile (bin.length() != 0) { // el while continua hasta que la cadena tenga longitud cero\n\t\t\tString four = bin.substring(bin.length()-4); // cojo los 4 ultimos\n\t\t\thex = byteToHex(four) + hex; // paso 4 bits a hexadecimal y acumulo en hex\n\t\t\tbin = bin.substring(0, bin.length() - 4); // al string original le quito los cuatro bits que ya he procesado\n\t\t}\n\t\treturn hex; // cuando ha terminado el while, en hex tengo el hexadecimal completo\n\t\t\n\t}", "public String getHexCode() {\r\n return this.hexCode;\r\n }", "@Test(timeout = 4000)\n public void test107() throws Throwable {\n int int0 = JavaCharStream.hexval('A');\n assertEquals(10, int0);\n }", "@Test\n public void testCreateHmacSha1() throws Exception {\n Mac macAlgorithm = Mac.getInstance(MAC_ALGORITHM_STRING);\n macAlgorithm.init(new SecretKeySpec(K_AUT, MAC_ALGORITHM_STRING));\n byte[] mac = macAlgorithm.doFinal(MAC_INPUT);\n assertFalse(Arrays.equals(MAC_INPUT, mac));\n }", "private static String toHex(byte[] digest) {\n\t\tchar[] result = new char[digest.length * 2];\n\t\tint pos = 0;\n\t\tfor (int i = 0; i < digest.length; i++) {\n\t\t\tresult[pos++] = hexChar((digest[i] & 0xf0) >> 4);\n\t\t\tresult[pos++] = hexChar(digest[i] & 0x0f);\n\t\t}\n\t\treturn new String(result);\n\t}", "public static String toHexString(BigInteger data) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"0x\").append(data.toString(16));\n return sb.toString();\n }", "private BigInteger hextodecimal(String hex) {\n\t\treturn new BigInteger(hex,16);\n\t}", "@Test\n public void testHashingAvPassord() {\n String passordTilHash = \"passord\";\n String salt = null;\n String salt2 = null;\n try{\n salt = HashPassord.getSalt();\n salt2 = HashPassord.getSalt();\n }catch(NoSuchAlgorithmException | NoSuchProviderException | java.security.NoSuchProviderException e){\n e.printStackTrace();\n }\n String sikkertPassord = getSecurePassword(passordTilHash, salt);\n String sikkertPassord2 = getSecurePassword(passordTilHash, salt2);\n String regenerertPassordVerifisering = getSecurePassword(passordTilHash, salt);\n \n System.out.println( sikkertPassord+ \":\" + salt); //skriver 83ee5baeea20b6c21635e4ea67847f66\n System.out.println( sikkertPassord2+ \":\" + salt2);\n System.out.println(regenerertPassordVerifisering + \":\" + salt); //skriver 83ee5baeea20b6c21635e4ea67847f66\n \n assertEquals(sikkertPassord, regenerertPassordVerifisering);\n assertNotSame(salt, salt2);\n assertNotSame(sikkertPassord, sikkertPassord2);\n System.out.println(\"//TEST//: testHashingAvPassord() = funker!\");\n \n }", "private static String byteToHex(byte b) {\n\t\tchar hexDigit[] = {\n\t\t\t\t'0', '1', '2', '3', '4', '5', '6', '7',\n\t\t\t\t'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'\n\t\t};\n\t\tchar[] array = {hexDigit[(b >> 4) & 0x0f], hexDigit[b & 0x0f]};\n\t\treturn new String(array);\n\t}", "private static String _bytesToHex( ByteBuffer buf )\n {\n final int offset = buf.position();\n final int size = buf.remaining();\n final char[] hexChars = new char[size * 2];\n\n for (int j = 0; j < size; j++) {\n int v = buf.get(j + offset) & 0xFF;\n hexChars[j * 2] = hexArray[v >>> 4];\n hexChars[j * 2 + 1] = hexArray[v & 0x0F];\n }\n\n return new String(hexChars);\n }", "public static String hexaToString(byte[] digest ){\n\t StringBuffer hexString = new StringBuffer();\n\t for (int i = 0; i < digest.length; i++) {\n\t if ((0xff & digest[i]) < 0x10) {\n\t hexString.append(\"0\" + Integer.toHexString((0xFF & digest[i])));\n\t } else {\n\t hexString.append(Integer.toHexString(0xFF & digest[i]));\n\t }\n\t } \n\t return hexString.toString(); \n\t }", "public static void main(String[] args) throws Exception {\n\t\t\r\n\t\tString str = hexStr2binaryStr(\"33\");\r\n\t\tSystem.out.println(str);\r\n\t}", "private void toHex(){\n\t\tStringBuilder sb = new StringBuilder();\n\t\tStringBuilder tempsb = new StringBuilder(binary);\n\t\t\n\t\t\tfor (int i = 0;i<binary.length();i+=4){//maps each nibble to its binary value\n\t\t\t\tif (tempsb.substring(i,i+4).equals(\"0000\")) \n\t\t\t\t\tsb.append('0');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0001\"))\n\t\t\t\t\tsb.append('1');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0010\"))\n\t\t\t\t\tsb.append('2');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0011\"))\n\t\t\t\t\tsb.append('3');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0100\"))\n\t\t\t\t\tsb.append('4');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0101\"))\n\t\t\t\t\tsb.append('5');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0110\"))\n\t\t\t\t\tsb.append('6');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0111\"))\n\t\t\t\t\tsb.append('7');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1000\"))\n\t\t\t\t\tsb.append('8');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1001\"))\n\t\t\t\t\tsb.append('9');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1010\"))\n\t\t\t\t\tsb.append('A');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1011\"))\n\t\t\t\t\tsb.append('B');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1100\"))\n\t\t\t\t\tsb.append('C');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1101\"))\n\t\t\t\t\tsb.append('D');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1110\"))\n\t\t\t\t\tsb.append('E');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1111\"))\n\t\t\t\t\tsb.append('F');\n\t\t\t}\n\t\t\tsb.insert(0,\"0x\");\n\t\t\tbinary = sb.toString();\n\t}", "public String binarioToHexa(String binario) {\n\t\tSystem.out.print(\"Convirtiendo binario (\" + binario + \") a hexadecimal >> \");\n\t\tInteger numero = 0;\n\t\ttry{\n\t\t\tnumero = Integer.valueOf(binario, 2);\n\t\t}catch (NumberFormatException e) {\n\t\t\tSystem.err.print(\"\\nERROR : El numero \" + binario + \" no es binario\");\n\t\t}\n\t\treturn Integer.toHexString(numero);\n\t}", "@Test\n public void testAesEncryptForInputKey() throws Exception {\n byte[] key = Cryptos.generateAesKey();\n String input = \"foo message\";\n\n byte[] encryptResult = Cryptos.aesEncrypt(input.getBytes(\"UTF-8\"), key);\n String descryptResult = Cryptos.aesDecrypt(encryptResult, key);\n\n System.out.println(key);\n System.out.println(descryptResult);\n }", "private static String validateHexStr(String hexStr) throws UnsignedBigIntUtilsException {\n String tmpStr = RegExp.replaceAll(\"[ \\\\|\\\\t\\\\n]+\", hexStr, \"\");\n tmpStr = RegExp.replaceFirst(\"0[xX]\", tmpStr, \"\");\n if (tmpStr.matches(\"[0-9a-fA-F]+\") == false) {\n String msg = \"ERROR: Invalid HEX characters in input => \" + tmpStr + \"\\n\";\n throw new UnsignedBigIntUtilsException(msg);\n }\n return (tmpStr);\n }", "private static String toHex(byte[] array) {\r\n\t\tBigInteger bi = new BigInteger(1, array);\r\n\t\tString hex = bi.toString(16);\r\n\t\tint paddingLength = (array.length * 2) - hex.length();\r\n\t\tif (paddingLength > 0)\r\n\t\t\treturn String.format(\"%0\" + paddingLength + \"d\", 0) + hex;\r\n\t\telse\r\n\t\t\treturn hex;\r\n\t}", "public static String unHex(String arg) { \r\n\t String str = \"\";\r\n\t for(int i=0;i<arg.length();i+=2)\r\n\t {\r\n\t String s = arg.substring(i, (i + 2));\r\n\t int decimal = Integer.parseInt(s, 16);\r\n\t str = str + (char) decimal;\r\n\t } \r\n\t return str;\r\n\t}", "private static String CalHash(byte[] passSalt) throws NoSuchAlgorithmException, UnsupportedEncodingException {\n //get the instance value corresponding to Algorithm selected\n MessageDigest key = MessageDigest.getInstance(\"SHA-256\");\n //Reference:https://stackoverflow.com/questions/415953/how-can-i-generate-an-md5-hash\n //update the digest using specified array of bytes\n key.update(passSalt);\n String PassSaltHash = javax.xml.bind.DatatypeConverter.printHexBinary(key.digest());\n return PassSaltHash;\n }", "@Test(timeout = 4000)\n public void test087() throws Throwable {\n try { \n JavaCharStream.hexval('V');\n fail(\"Expecting exception: IOException\");\n \n } catch(IOException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaCharStream\", e);\n }\n }", "@Test(timeout = 4000)\n public void test073() throws Throwable {\n int int0 = JavaCharStream.hexval('d');\n assertEquals(13, int0);\n }" ]
[ "0.80246377", "0.79971147", "0.7571973", "0.7261664", "0.6909193", "0.6856248", "0.68255866", "0.6566911", "0.64269215", "0.63029885", "0.6211425", "0.6113202", "0.6025854", "0.60250723", "0.59859276", "0.59672326", "0.5938996", "0.5933515", "0.5922233", "0.5870849", "0.5857477", "0.58484274", "0.5843856", "0.58397", "0.5831545", "0.5815697", "0.57877254", "0.5765514", "0.57604116", "0.57565206", "0.5755328", "0.57436556", "0.57205373", "0.57106024", "0.5684909", "0.56716627", "0.56504333", "0.56495047", "0.56300247", "0.56159025", "0.5603038", "0.5600321", "0.558738", "0.55824107", "0.5581671", "0.55697507", "0.55682445", "0.55596936", "0.5556749", "0.5546121", "0.5544332", "0.55159", "0.54906684", "0.5489143", "0.54846567", "0.5480021", "0.5476289", "0.5473022", "0.54693127", "0.54558885", "0.54543877", "0.54524225", "0.5451303", "0.5447862", "0.5445821", "0.5438509", "0.5432785", "0.5428329", "0.5421494", "0.54211974", "0.54166", "0.5411591", "0.5402766", "0.5402321", "0.53868824", "0.53848785", "0.5383518", "0.53797984", "0.537005", "0.53664666", "0.5364345", "0.53629124", "0.53594047", "0.53462976", "0.5340312", "0.5339666", "0.5334553", "0.5327417", "0.531935", "0.53169364", "0.5310334", "0.5308746", "0.5305991", "0.5305315", "0.5300009", "0.5294747", "0.5289701", "0.5287913", "0.5279263", "0.52779436" ]
0.748612
3
with any HTTP ClientServer
public static String uploadByHttpClient(String toUrl, File[] files, String[] names) { // HttpClient httpclient = new DefaultHttpClient(); // try { // HttpPost httppost = new HttpPost(toUrl); // // MultipartEntity reqEntity = new MultipartEntity(); // for (int i = 0; i < files.length; i++) // reqEntity.addPart(names[i], new FileBody(files[i])); //// reqEntity.addPart("filename", new StringBody(file.getName())); // // httppost.setEntity(reqEntity); // System.out.println("executing request " + httppost.getRequestLine()); // HttpResponse response = httpclient.execute(httppost); // // //response // System.out.println(response.getStatusLine()); // HttpEntity resEntity = response.getEntity(); // if (resEntity != null) { // return getContent(resEntity.getContent()); // } // } catch(IOException e){ // e.printStackTrace(); // } finally { // // When HttpClient instance is no longer needed, // // shut down the connection manager to ensure // // immediate deallocation of all system resources // httpclient.getConnectionManager().shutdown(); // } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static HttpClient createClient() {\n return HttpClients.createMinimal();\n }", "public interface Client {\n\n\t/**\n\t * @throws Http2Exception\n\t */\n\tvoid init() throws Http2Exception;\n\n\t/**\n\t * @return\n\t * @throws Http2Exception\n\t */\n\tboolean start() throws Http2Exception;\n\n\t/**\n\t * @param request\n\t * @return\n\t * @throws Http2Exception\n\t */\n\t Http2Response request(Http2Request request) throws Http2Exception;\n\n\t/**\n\t * @return\n\t * @throws Http2Exception\n\t */\n\tboolean isRuning() throws Http2Exception;\n\n\t/**\n\t * @return\n\t * @throws Http2Exception\n\t */\n\tboolean shutdown() throws Http2Exception;\n\n}", "public void setHttpClient( HttpClient req ) {\r\n\tclient=req;\r\n }", "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 }", "public static void main(String... args) {\n HttpServer httpServer = httpServerBuilder()\n .setPort(8080).build();\n\n /* Setting up a request Consumer with Java 8 Lambda expression. */\n httpServer.setHttpRequestConsumer(httpRequest -> {\n\n Map<String, Object> results = new HashMap<>();\n results.put(\"method\", httpRequest.getMethod());\n results.put(\"uri\", httpRequest.getUri());\n results.put(\"body\", httpRequest.getBodyAsString());\n results.put(\"headers\", httpRequest.getHeaders());\n results.put(\"params\", httpRequest.getParams());\n httpRequest.getReceiver().response(200, \"application/json\", toJson(results));\n });\n\n /* Start the server. */\n httpServer.start();\n\n\n /* Setup an httpClient. */\n HttpClient httpClient = httpClientBuilder().setHost(\"localhost\").setPort(8080).build();\n httpClient.startClient();\n\n sendGets(httpClient);\n sendPosts(httpClient);\n sendPuts(httpClient);\n\n\n Sys.sleep(1000);\n\n httpServer.stop();\n httpClient.stop();\n }", "public abstract Client getClient();", "public interface HttpClient {\n\n\torg.apache.http.client.HttpClient getClient();\n\n\tString fetch(URI uri) throws IOException;\n\n\tvoid init() throws KeyManagementException, NoSuchAlgorithmException;\n}", "public static void main(String[] args) {\n\n Client client = ClientBuilder.newClient();\n WebTarget target = client.target(\"http\");\n\n }", "private static HttpClient getNewHttpClient(){\n HttpParams params = new BasicHttpParams();\n return new DefaultHttpClient(params);\n }", "public void startServer() {\n System.out.println(\"Inicie\");\n httpServer = new HttpServer();\n httpServer.registerProessor(\"/App\", this);\n try {\n httpServer.start();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public TestHttpServer (HttpCallback cb) throws IOException {\n this (cb, 1, 10, 0);\n }", "private void runClient(final HttpMethod httpMethod, final ByteBuf content, final String uri) {\n EventLoopGroup group = new NioEventLoopGroup();\n try {\n final Bootstrap client = new Bootstrap();\n client.group(group)\n .channel(NioSocketChannel.class)\n .handler(new ClientHandler());\n\n final FullHttpRequest request =\n new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, httpMethod, uri, content);\n final HttpHeaders headers = request.headers();\n headers.set(HttpHeaders.Names.CONTENT_TYPE, \"application/json; charset=UTF-8\");\n headers.set(HttpHeaders.Names.HOST, host);\n headers.set(HttpHeaders.Names.CONTENT_LENGTH, String.valueOf(content.readableBytes()));\n\n final Channel clientChannel = client.connect(host, port).sync().channel();\n clientChannel.writeAndFlush(request);\n clientChannel.closeFuture().awaitUninterruptibly();\n group.shutdownGracefully();\n } catch (InterruptedException e) {\n Assert.fail(\"The client failure: \" + e.getMessage());\n }\n }", "public DefaultHttpClientImpl() {\n SchemeRegistry schemeRegistry = new SchemeRegistry();\n schemeRegistry.register(new Scheme(\n \"http\", PlainSocketFactory.getSocketFactory(), 80));\n\n schemeRegistry.register(new Scheme(\n \"https\", SSLSocketFactory.getSocketFactory(), 443));\n conman = new ThreadSafeClientConnManager(params, schemeRegistry);\n }", "Client getClient();", "private void initialize(){\n if(uri != null)\n httpUriRequest = getHttpGet(uri);\n httpClient = HttpClients.createDefault();\n }", "public HttpGetSocket(SocketHandler h)\r\n {\r\n super(h);\r\n }", "public interface ZmoteHTTPDRequestHandler{\n\tpublic String getURI();\n\tpublic Response serve(String uri, String method, Properties header, Properties parms, Properties files, ZmoteHTTPD httpd);\t\n\tpublic ZmoteHTTPDRequestHandler clone();\n}", "@Override\n\t\t\t\t\tpublic void run() {\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tList<String> headers = readRequest(client);\n\t\t\t\t\t\t\tif (headers != null && headers.size() >= 1) {\n\t\t\t\t\t\t\t\tString requestURL = getRequestURL(headers.get(0));\n\t\t\t\t\t\t\t\tLog.d(TAG, requestURL);\n\n\t\t\t\t\t\t\t\tif (requestURL.startsWith(\"http://\")) {\n\n\t\t\t\t\t\t\t\t\t// HttpRequest request = new\n\t\t\t\t\t\t\t\t\t// BasicHttpRequest(\"GET\", requestURL);\n\n\t\t\t\t\t\t\t\t\tprocessHttpRequest(requestURL, client, headers);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tprocessFileRequest(requestURL, client, headers);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} catch (IllegalStateException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "private void handleClient() {\n\t\t//Socket link = null;\n\t\tRequestRecord reqRec = new RequestRecord();\n\t\tResponder respondR = new Responder();\n\t\t\n\t\ttry {\n\t\t\t// STEP 1 : accepting client request in client socket\n\t\t\t//link = servSock.accept(); //-----> already done in *ThreadExecutor*\n\t\t\t\n\t\t\t// STEP 2 : creating i/o stream for socket\n\t\t\tScanner input = new Scanner(link.getInputStream());\n\t\t\tdo{\n\t\t\t\t//PrintWriter output = new PrintWriter(link.getOutputStream(),true);\n\t\t\t\t//DataOutputStream ds = new DataOutputStream(link.getOutputStream());\n\t\t\t\tint numMsg = 0;\n\t\t\t\tString msg = input.nextLine();\n\t\t\t\t\n\t\t\t\t//to write all requests to a File\n\t\t\t\tFileOutputStream reqFile = new FileOutputStream(\"reqFile.txt\");\n\t\t\t\tDataOutputStream dat = new DataOutputStream(reqFile);\n\t\t\t\t\n\t\t\t\t// STEP 4 : listening iteratively till close string send\n\t\t\t\twhile(msg.length()>0){\n\t\t\t\t\tnumMsg++;\n\t\t\t\t\tdat.writeChars(msg + \"\\n\");\n\t\t\t\t\tSystem.out.println(\"\\nNew Message Received\");\n\t\t\t\t\tif(reqRec.setRecord(msg)==false)\n\t\t\t\t\t\tSystem.out.println(\"\\n-----\\nMsg#\"+numMsg+\": \"+msg+\":Error with Request Header Parsing\\n-----\\n\");\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(\"Msg#\" + numMsg + \": \" + msg);\n\t\t\t\t\tmsg = input.nextLine();\n\t\t\t\t};\n\t\t\t\tdat.writeChars(\"\\n-*-*-*-*-*-*-*-*-*-*-*-*-*-\\n\\n\");\n\t\t\t\tdat.close();\n\t\t\t\treqFile.close();\n\t\t\t\tSystem.out.println(\"---newEST : \" + reqRec.getResource());\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"\\n==========Send HTTP Response for Get Request of\\n\"+reqRec.getResource()+\"\\n***********\\n\");\n\t\t\t\tif(respondR.sendHTTPResponseGET(reqRec.getResource(), link)==true)//RES, ds)==true)\n\t\t\t\t\tSystem.out.println(\"-----------Resource Read\");\n\t\t\t\tSystem.out.println(\"Total Messages Transferred: \" + numMsg);\n\t\t\t\t//link.close();\n\t\t\t\tif(reqRec.getConnection().equalsIgnoreCase(\"Keep-Alive\")==true && respondR.isResourceExisting(reqRec.getResource())==true)\n\t\t\t\t\tlink.setKeepAlive(true);\n\t\t\t\telse\n\t\t\t\t\tbreak;\n\t\t\t}while(true);\n\t\t\tSystem.out.print(\"Request Link Over as Connection: \" + reqRec.getConnection());\n\t\t} catch (IOException e) {\n\t\t\tif(link.isClosed())\n\t\t\t\tSystem.out.print(\"\\n\\nCritical(report it to developer):: link closed at exception\\n\\n\");\n\t\t\tSystem.out.println(\"Error in listening.\\n {Error may be here or with RespondR}\\nTraceString: \");\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\t// STEP 5 : closing the connection\n\t\t\tSystem.out.println(\"\\nClosing Connection\\n\");\n\t\t\ttry {\t\t\t\t\n\t\t\t\tlink.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(\"Unable to disconnect.\\nTraceString: \");\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}/*ends :: try...catch...finally*/\n\t\t\n\t}", "public interface HttpClientFactory {\n CloseableHttpClient newHttpClient();\n}", "public static void main(String[] args) throws ClientProtocolException,\n\t\t\tIOException {\n\t\tString url = \"http://localhost:4444/index.html\";\n\t\tString url2 = \"http://posttestserver.com/post.php\";\n\t\t// creates new client\n\t\tG52APRClient client = new G52APRClient();\n\n\t\t// GET\n\t\tSystem.out.println(client.httpGet(url));\n\n\t\t// HEAD\n\t\t//System.out.println(client.httpHead(url));\n\n\t\t// POST\n\t\tString dataBody = \"Testing POST method, it worked. \";\n\t\t//System.out.println(client.httpPost(url, dataBody));\n\n\t\t// POSTARRAY\n\t\t// creating ArrayList\n\t\tArrayList<NameValuePair> dataArray = new ArrayList<NameValuePair>();\n\t\tdataArray.add(new BasicNameValuePair(\"Name\", \"Natalia\"));\n\t\tdataArray.add(new BasicNameValuePair(\"Course\", \"Computer Science\"));\n\t\tdataArray.add(new BasicNameValuePair(\"Age\", \"19\"));\n\t\t//System.out.println(client.httpPost(url, dataArray));\n\n\t\t// getConditional*******************************************\n\n\t\t// date which should return the body (last read before it was last\n\t\t// modified)\n\t\tString date1 = \"Sun Nov 16 21:31:815 GMT 2013\";\n\n\t\t// date which should return the 304 status line (last read after it was\n\t\t// last modified)\n\t\tString date2 = \"Sun Nov 16 21:31:815 GMT 2015\";\n\t\t\n\t\t//System.out.println(client.httpGetConditional(url, date1));\n\t\t\n\t\t//System.out.println(client.httpGetConditional(url, date2));\n\n\t\t// RUN TESTS FROM THIS MAIN TO ClientTests (testing for part 2 of\n\t\t// coursework)\n\t\t//ClientTests ct = new ClientTests(new G52APRClient());\n\t\t//ct.runTests(\"http://cs.nott.ac.uk/~syn/webfiles/index.html\");\n\n\t}", "@Test\n public void testHttpHappyPathOnce() throws Exception {\n final String testAddr = UUID.randomUUID().toString();\n final Subscription server = TestHttpUtil.createTestServerWith(testAddr, \n responseBy(\"text/plain\", HttpTestServer.CONTENT),\n ENABLE_LOGGING);\n final DefaultHttpClient client = new DefaultHttpClient(new TestChannelCreator(), ENABLE_LOGGING);\n try {\n \n final Iterator<HttpObject> itr = \n client.defineInteraction(\n new LocalAddress(testAddr), \n Observable.just(fullHttpRequest()))\n .map(RxNettys.<HttpObject>retainer())\n .toBlocking().toIterable().iterator();\n \n final byte[] bytes = RxNettys.httpObjectsAsBytes(itr);\n \n assertTrue(Arrays.equals(bytes, HttpTestServer.CONTENT));\n } finally {\n client.close();\n server.unsubscribe();\n }\n }", "private HttpClient prepareHttpClient() {\n\t\tHttpClientParams htcParams = new HttpClientParams();\n\t\tmHttpClient = new HttpClient();\n\t\thtcParams.setConnectionManagerTimeout(300000);\n\t\thtcParams.setSoTimeout(300000);\n\t\tmHttpClient.setParams(htcParams);\n\t\treturn mHttpClient;\n\t}", "protected RestClient()\n\t{\n\t\tclient = new HttpClient();\n\t\tclient.setIdleTimeout(3000000);\n\t\t// for possible future use:\n\t\t//exchange_get = new ContentExchange()\n\t\t{\n\t\t\t// define the callback method to process the response when you get it back\n\t\t\t// protected void onResponseComplete() throws IOException\n\t\t\t// {\n\t\t\t// super.onResponseComplete();\n\t\t\t// int responseStatus = this.getStatus();\n\n\t\t\t// do something with the response content\n\t\t\t//System.out.println(\"Response status: \" + responseStatus);\n\t\t\t//System.out.println(this.getResponseContent());\n\t\t\t//\t }\n\t\t};\n\t}", "public HttpConnector(){\n super();\n }", "private HttpClient() {\n\t}", "public interface HttpRequestHandler {\n public boolean canHandle(String uri);\n public httpResponse handle(httpRequest request);\n}", "public static void main(String[] args) {\n int port = 8899;\n ServerBootstrap serverBootstrap = new ServerBootstrap();\n EventLoopGroup boss = new NioEventLoopGroup();\n EventLoopGroup work = new NioEventLoopGroup();\n\n try {\n serverBootstrap.group(boss, work)\n .channel(NioServerSocketChannel.class)\n .localAddress(new InetSocketAddress(port))\n .childHandler(new ChannelInitializer() {\n\n @Override\n protected void initChannel(Channel ch) throws Exception {\n ch.pipeline()\n .addLast(\"codec\", new HttpServerCodec()) // HTTP 编解码\n .addLast(\"compressor\", new HttpContentCompressor()) // HttpContent 压缩\n .addLast(\"aggregator\", new HttpObjectAggregator(65536)) // HTTP 消息聚合\n .addLast(\"handler\", new HttpServerHandler());\n }\n })\n .childOption(ChannelOption.SO_KEEPALIVE, true);\n\n ChannelFuture f = serverBootstrap.bind().sync();\n System.out.println(\"Http Server started, Listening on \" + port);\n f.channel().closeFuture().sync();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n work.shutdownGracefully();\n boss.shutdownGracefully();\n }\n }", "public static void main(String[] args) {\n\n Request getReq = new Request();\n\n try {\n// getReq.sendReq(\"127.0.0.1\", \"/\", 80);\n getReq.sendReq(\"127.0.0.1\", \"/\", 40289);\n } catch (IOException e) {\n\n e.printStackTrace();\n }\n\n\n }", "public void setHttpServer(String httpServer) {\n this.httpServer = httpServer;\n }", "public void serve() throws IOException {\n int req = 0;\n while (req<maxreq) {\n //block intil a client connects\n final Socket socket = serversocket.accept();\n //create a new thread to handle the client\n\n Thread handler = new Thread(new Runnable() {\n public void run() {\n try {\n try {\n handle(socket);\n } finally {\n socket.close();\n }\n } catch (IOException ioe) {\n // this exception wouldn't terminate serve(),\n // since we're now on a different thread, but\n // we still need to handle it\n ioe.printStackTrace();\n }\n }\n });\n // start the thread\n handler.start();\n req++;\n }\n\n }", "public static HttpServer startServer() {\n // create a resource config that scans for JAX-RS resources and providers\n // in com.example.rest package\n final ResourceConfig rc = new ResourceConfig().packages(\"com.assignment.backend\");\n rc.register(org.glassfish.jersey.moxy.json.MoxyJsonFeature.class);\n rc.register(getAbstractBinder());\n rc.property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);\n rc.property(ServerProperties.BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK, true);\n\n // create and start a new instance of grizzly http server\n // exposing the Jersey application at BASE_URI\n return GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);\n }", "public interface HttpClientable {\n\n void get(String url);\n\n void get(String url, ParamStore params);\n\n void get(String url, ParamStore params, String tag);\n\n void post(String url, SparseArray<String> params);\n\n void post(String url, SparseArray<String> params, String tag);\n\n void upload(String url, HashMap<String, Object> params);\n\n void upload(String url, HashMap<String, Object> params, String tag);\n\n void download(String url);\n\n void download(String url, String tag);\n\n void cancelAll();\n\n void cancel(String tag);\n\n}", "private HttpClient getTemplateServerClient(String remoteSource) throws IOException {\n\n SocketFactory factory = (SocketFactory)mSocketFactories.get(remoteSource);\n\n if (factory == null) {\n\n int port = 80;\n String host = remoteSource.substring(TEMPLATE_LOAD_PROTOCOL.length());\n\n int portIndex = host.indexOf(\"/\");\n \n if (portIndex >= 0) {\n host = host.substring(0,portIndex); \n }\n String hostPort = host; \n portIndex = host.indexOf(\":\");\n if (portIndex >= 0) {\n try {\n port = Integer.parseInt(host.substring(portIndex+1));\n }\n catch (NumberFormatException nfe) {\n System.out.println(\"Invalid port number specified\");\n }\n host = host.substring(0,portIndex);\n }\n factory = new PooledSocketFactory(new PlainSocketFactory(InetAddress.getByName(host), \n port, 5000));\n \n if (factory != null) {\n mSocketFactories.put(hostPort, factory);\n }\n }\n return new HttpClient(factory);\n }", "@Bean\n public HttpClient httpClient() {\n return new HttpClient(multiThreadedHttpConnectionManager());\n }", "@Before\n public void buildClient() {\n BasicCookieStore cookieStore = new BasicCookieStore();\n\n // Build Apache Http Client to execute requests\n this.httpClient = HttpClientBuilder.create()\n .setDefaultCookieStore(cookieStore)\n .setRedirectStrategy(new LaxRedirectStrategy())\n .build();\n }", "public HttpClient(String host, int port)\n\t{\n\t\tsuper(host, port);\n\t\tclient = new org.apache.commons.httpclient.HttpClient();\n\t}", "private HttpProxy createHttpServerConnection() {\n\n final HttpProxy httpProxy = httpConnectionFactory.create();\n\n // TODO: add configurable number of attempts, instead of looping forever\n boolean connected = false;\n while (!connected) {\n LOGGER.debug(\"Attempting connection to HTTP server...\");\n connected = httpProxy.connect();\n }\n\n LOGGER.debug(\"Connected to HTTP server\");\n\n return httpProxy;\n }", "ServerTransport serverTransport(TransportResources resources);", "S getServer();", "public static void main(String[] args) throws IOException, URISyntaxException {\n try {\r\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n } catch (Exception e) { \r\n \tSystem.out.println(\"algo no jalo\"); \t\r\n }\r\n\t\t\r\n \tHost host=new Host();\r\n \t \t \t\r\n \thttpServer = HttpServer.create(new InetSocketAddress(puerto), 0);\r\n \t\r\n \thttpServer.createContext(\"/\", new Principal());\t\t//esta es la pagina principal\r\n \thttpServer.createContext(\"/apagado\", new Apagado());\r\n \thttpServer.createContext(\"/descarga\", new Descarga());// llama a la pagina como video1.mp4\r\n \thttpServer.createContext(\"/openFileDialog\", new OpenFileDialog());\r\n \r\n \thttpServer.setExecutor(null);\r\n \thttpServer.start();\r\n \t\r\n\r\n \thost.abreLocalHost();\r\n \thost.cargaGPIO();\r\n\t}", "private CloseableHttpClient getHttpClient() {\n return HttpClients.custom()\n .setConnectionManager(httpClientConnectionManager)\n .setConnectionManagerShared(true)\n .build();\n }", "public TestHttpServer (HttpCallback cb, int threads, int cperthread)\n throws IOException {\n this (cb, threads, cperthread, 0);\n }", "private void handleHttpRequest(ChannelHandlerContext ctx, HttpRequest req) throws Exception {\n\t\tif (req.getMethod() != HttpMethod.GET) {\n\t\t\tresponseSender.sendResponse(ctx.getChannel(), HttpResponseStatus.FORBIDDEN);\n\t\t\treturn;\n\t\t}\n\n\t\t// Send the demo page and favicon.ico\n\t\tif (req.getUri().equals(\"/\")) {\n\t\t\tresponseSender.sendResponse(ctx.getChannel(), HttpResponseStatus.OK, WebSocketServerIndexPage.getContent(getWebSocketLocation(req)), \"UTF-8\",\n\t\t\t\t\t\"text/html; charset=UTF-8\");\n\t\t\treturn;\n\t\t} else if (req.getUri().equals(\"/favicon.ico\")) {\n\t\t\tresponseSender.sendResponse(ctx.getChannel(), HttpResponseStatus.NOT_FOUND);\n\t\t\treturn;\n\t\t}\n\n\t\t// Handshake\n\t\tWebSocketServerHandshakerFactory wsFactory = new WebSocketServerHandshakerFactory(getWebSocketLocation(req), null, false);\n\t\thandshaker = wsFactory.newHandshaker(req);\n\t\tif (handshaker == null) {\n\t\t\twsFactory.sendUnsupportedWebSocketVersionResponse(ctx.getChannel());\n\t\t} else {\n\t\t\thandshaker.handshake(ctx.getChannel(), req).addListener(WebSocketServerHandshaker.HANDSHAKE_LISTENER);\n\t\t}\n\t}", "@Override\n\tpublic void run(){\n\t\tSystem.out.println(\"run\");\n\t\ttry {\n\t\t\tString firstLine = inFromClient.readLine();\n\t\t\tSystem.out.println(\"Received: \" + firstLine);\n\n\t\t\tboolean badRequest = false;\n\t\t\tString[] array = firstLine.split(\" \");\n\t\t\tString HTTPcommand = array[0];\n\t\t\tString URI = array[1];\n\t\t\tString HTTPversion = array[2];\n\t\t\tString path = \"\";\n\t\t\t\n\t\t\tint indexSlash = URI.lastIndexOf(\"/\");\n\t\t\tSystem.out.println(indexSlash);\n\t\t\tpath = URI.substring(indexSlash+1, URI.length());\n\n\t\t\t\n\t\t\tString secondLine = inFromClient.readLine();\n\t\t\tif (!HTTPversion.equals(\"HTTP/1.1\")) {\n\t\t\t\tbadRequest = true;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif (badRequest) {\n\t\t\t\tout.println(\"HTTP/1.1 400 Bad Request\");\n\t\t\t\tout.println('\\r' + '\\n' + '\\r' + '\\n');\n\t\t\t\tout.flush();\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\tswitch(HTTPcommand){\n\t\t\t\tcase \"HEAD\": Head.head(clientSocket, inFromClient, out, path);\n\t\t\t\tbreak;\n\n\t\t\t\tcase \"GET\": Get.get(clientSocket, inFromClient, out, path);\n\t\t\t\tbreak;\n\n\t\t\t\tcase \"PUT\": {\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println('\\r' + '\\n' + '\\r' + '\\n');\n\t\t\t\t\tout.flush();\n\t\t\t\t\tString Line3 = inFromClient.readLine();\n\t\t\t\t\tString Line4 = inFromClient.readLine();\n\t\t\t\t\tString Line5 = inFromClient.readLine();\n\t\t\t\t\tPut.put(inFromClient, path);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t\tcase \"POST\": {\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println('\\r' + '\\n' + '\\r' + '\\n');\n\t\t\t\t\tout.flush();\n\t\t\t\t\tString Line3 = inFromClient.readLine();\n\t\t\t\t\tString Line4 = inFromClient.readLine();\n\t\t\t\t\tString Line5 = inFromClient.readLine();\n\t\t\t\t\tPost.post(inFromClient, path);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tdefault: {\n\t\t\t\t\tout.println(\"HTTP/1.1 501 Not Implemented\");\n\t\t\t\t\tout.println('\\r' + '\\n' + '\\r' + '\\n');\n\t\t\t\t\tout.flush();\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\n\t\t//run();\n\n\t\t//inFromClient.close();\n\t\t//serverSocket.close();\n\t}", "public static AsyncHttpServer createProxyHttpServer(final NioEventloop primaryEventloop,\n\t final HttpClientImpl httpClient) {\n\t\treturn new AsyncHttpServer(primaryEventloop, new AsyncHttpServlet() {\n\t\t\t@Override\n\t\t\tpublic void serveAsync(HttpRequest request, final ResultCallback<HttpResponse> callback) {\n\t\t\t\thttpClient.getHttpResultAsync(HttpRequest.get(REDIRECT_ADDRESS + request.getUrl().getPath()), 1000,\n\t\t\t\t\t\tnew ResultCallback<HttpResponse>() {\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void onResult(final HttpResponse result) {\n\t\t\t\t\t\t\t\tHttpResponse res = HttpResponse.create(result.getCode());\n\t\t\t\t\t\t\t\tres.body(encodeAscii(\"FORWARDED: \" + decodeAscii(result.getBody())));\n\t\t\t\t\t\t\t\tcallback.onResult(res);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void onException(Exception exception) {\n\t\t\t\t\t\t\t\tcallback.onException(exception);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "@SuppressWarnings(\"java:S2189\")\n public static void main(String[] args) {\n ExecutorService executorService = Executors.newFixedThreadPool(4);\n try (ServerSocket serverSocket = new ServerSocket(8080)) {\n log.info(\"Waiting For New Clients...\");\n while (true) {\n Socket sock = serverSocket.accept();\n log.info(\"Connected to a client...\");\n executorService.execute(new ServeRequests(sock));\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void handleHttpRequest(ChannelHandlerContext ctx, FullHttpRequest req) throws Exception {\n if (!req.getDecoderResult().isSuccess()) {\n sendHttpResponse(ctx, req, new DefaultFullHttpResponse(HTTP_1_1, BAD_REQUEST));\n return;\n }\n\n // Allow only GET methods.\n if (req.getMethod() != GET) {\n sendHttpResponse(ctx, req, new DefaultFullHttpResponse(HTTP_1_1, FORBIDDEN));\n return;\n }\n\n // Send the demo page and favicon.ico\n if (\"/\".equals(req.getUri())) {\n ByteBuf content = getContent(getWebSocketLocation(req));\n FullHttpResponse res = new DefaultFullHttpResponse(HTTP_1_1, OK, content);\n res.headers().set(CONTENT_TYPE, \"text/html; charset=UTF-8\");\n setContentLength(res, content.readableBytes());\n sendHttpResponse(ctx, req, res);\n return;\n }\n if (\"/favicon.ico\".equals(req.getUri())) {\n FullHttpResponse res = new DefaultFullHttpResponse(HTTP_1_1, NOT_FOUND);\n sendHttpResponse(ctx, req, res);\n return;\n }\n\n Channel channel = ctx.channel();\n\n QueryStringDecoder dec = new QueryStringDecoder(req.getUri());\n String username = dec.parameters().get(\"username\").get(0);\n String page = dec.parameters().get(\"page\").get(0);\n channel.attr(WebSocketServer.USERNAME).set(username);\n Archon.getInstance().getLogger().warning(Thread.currentThread().getName() + \" [WS] channel username for \" + channel + \": \" + username + \" - page=\" + page);\n\n // Handshake\n WebSocketServerHandshakerFactory wsFactory = new WebSocketServerHandshakerFactory(getWebSocketLocation(req), null, false);\n handshaker = wsFactory.newHandshaker(req);\n if (handshaker == null) {\n WebSocketServerHandshakerFactory.sendUnsupportedWebSocketVersionResponse(ctx.channel());\n } else {\n handshaker.handshake(ctx.channel(), req).addListener((ChannelFutureListener) future -> {\n Channel channel1 = future.channel();\n if (future.isSuccess()) {\n channel1.attr(WebSocketServer.REGISTERED).set(true);\n server.addChannel(channel1);\n } else {\n future.channel().attr(WebSocketServer.REGISTERED).set(false);\n Archon.getInstance().getLogger().log(Level.WARNING, Thread.currentThread().getName() + \" [WS] Failed to register channel (handshake): \" + channel1, future.cause());\n }\n });\n }\n }", "private void init() throws IOReactorException {\n IOReactorConfig ioReactorConfig = IOReactorConfig.custom()\n .setIoThreadCount(Runtime.getRuntime().availableProcessors())\n .setConnectTimeout(BaseConstants.TIMEOUT_SECONDS * 1000)\n .setSoTimeout(BaseConstants.TIMEOUT_SECONDS * 1000)\n .build();\n\n // Create a custom I/O reactort\n ConnectingIOReactor ioReactor = new DefaultConnectingIOReactor(ioReactorConfig);\n PoolingNHttpClientConnectionManager connManager = new PoolingNHttpClientConnectionManager(ioReactor);\n // Configure total max or per route limits for persistent connections\n // that can be kept in the pool or leased by the connection manager.\n connManager.setMaxTotal(100);\n connManager.setDefaultMaxPerRoute(100);\n\n HttpAsyncClientBuilder clientBuilder = HttpAsyncClients.custom();\n RequestConfig.Builder requestConfig = RequestConfig.custom();\n // 连接超时,连接建立时间\n requestConfig.setConnectTimeout(BaseConstants.TIMEOUT_SECONDS * 1000);\n // 请求超时,数据传输过程中数据包之间间隔的最大时间\n requestConfig.setSocketTimeout(BaseConstants.TIMEOUT_SECONDS * 1000);\n // 使用连接池来管理连接,从连接池获取连接的超时时间\n requestConfig.setConnectionRequestTimeout(BaseConstants.TIMEOUT_SECONDS * 1000);\n clientBuilder.setConnectionManager(connManager);\n clientBuilder.setDefaultRequestConfig(requestConfig.build());\n httpclient = clientBuilder.build();\n }", "@Override\n public void run() {\n\n final HttpProxy httpProxy = this.createHttpServerConnection();\n\n //Read the request from the socket and send it to the HTTP server\n final byte[] message = unixSocket.read();\n LOGGER.debug(\"Received message on socket: {}\", new String(message, UTF_8));\n httpProxy.sendRequest(message);\n\n //Return the HTTP response to the socket\n final byte[] response = httpProxy.getResponse();\n LOGGER.debug(\"Received http response: {}\", new String(response, UTF_8));\n unixSocket.write(response);\n\n unixSocket.close();\n httpProxy.disconnect();\n }", "public void run() {\n\t\ttry {\n\t\t\t// Get input and output streams to talk to the client\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(csocket.getInputStream()));\n\t\t\tPrintWriter out = new PrintWriter(csocket.getOutputStream());\n\t\t\t/*\n\t\t\t * read the input lines from client and perform respective action based on the\n\t\t\t * request\n\t\t\t */\n\t\t\tString line;\n\t\t\twhile ((line = in.readLine()) != null) {\n\t\t\t\t// return if all the lines are read\n\t\t\t\tif (line.length() == 0)\n\t\t\t\t\tbreak;\n\t\t\t\telse if (line.contains(\"GET\") && line.contains(\"/index.html\")) {\n\t\t\t\t\t/*\n\t\t\t\t\t * get the respective file requested by the client i.e index.html\n\t\t\t\t\t */\n\t\t\t\t\tFile file = new File(WEB_ROOT, \"/index.html\");\n\t\t\t\t\t// send HTTP Headers\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println(\"Date: \" + new Date());\n\t\t\t\t\tout.println(\"Content-length: \" + file.length());\n\t\t\t\t\tout.println(); // blank line between headers and content\n\t\t\t\t\tout.flush(); // flush character output stream buffer\n\t\t\t\t\tout.write(FileUtils.readFileToString(file, \"UTF-8\"), 0, ((int) file.length()));\n\t\t\t\t} else if (line.contains(\"PUT\")) {\n\t\t\t\t\t/*\n\t\t\t\t\t * put the respective file at a location on local\n\t\t\t\t\t */\n\t\t\t\t\tString[] split = line.split(\" \");\n\t\t\t\t\tFile source = new File(split[1]);\n\t\t\t\t\tFile dest = new File(WEB_ROOT, \"clientFile.html\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// copy the file to local storage\n\t\t\t\t\t\tFileUtils.copyFile(source, dest);\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t// send HTTP Headers\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println(\"Date: \" + new Date());\n\t\t\t\t\tout.println(); // blank line between headers and content\n\t\t\t\t\tout.flush(); // flush character output stream buffer\n\t\t\t\t} else {\n\t\t\t\t\tout.print(line + \"\\r\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// closing the input and output streams\n\t\t\tout.close(); // Flush and close the output stream\n\t\t\tin.close(); // Close the input stream\n\t\t\tcsocket.close(); // Close the socket itself\n\t\t} // If anything goes wrong, print an error message\n\t\tcatch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t\tSystem.err.println(\"Usage: java HttpMirror <port>\");\n\t\t}\n\t}", "public TestHttpServer (HttpCallback cb, int threads, int cperthread, int port)\n throws IOException {\n schan = ServerSocketChannel.open ();\n InetSocketAddress addr = new InetSocketAddress (port);\n schan.socket().bind (addr);\n this.threads = threads;\n this.cb = cb;\n this.cperthread = cperthread;\n servers = new Server [threads];\n for (int i=0; i<threads; i++) {\n servers[i] = new Server (cb, schan, cperthread);\n servers[i].start();\n }\n }", "public static Object httpClient() {\n return new Object();\n// return HttpClient.newBuilder()\n// .version(HttpClient.Version.HTTP_1_1)\n// .followRedirects(HttpClient.Redirect.NORMAL)\n// .connectTimeout(Duration.ofSeconds(300))\n// .build();\n }", "protected HttpClient getHttpClient( ) {\r\n\t\treturn httpClient;\r\n\t}", "public static HttpClient Factory() {\n\t\treturn httpclient;\n\t}", "@Bean\n\tpublic HttpClient httpClient() {\n\t\treturn new HttpClient(this.multiThreadedHttpConnectionManager);\n\t}", "public void httpclient(String url){\n\t\t\r\n\t\t\r\n\t\tString httpUrl =BASIC_URL+url;\r\n\t\t\r\n\t\tSystem.out.println(httpUrl);\r\n\t\t\r\n\t\tHttpGet method =new HttpGet(httpUrl);\r\n\t\t\r\n\t\tmethod.setHeader(\"Content-Type\",\"application/json\");\r\n\t\tmethod.setHeader(\"charset\",\"UTF-8\");\r\n\t\t\r\n\t\ttry {\r\n\t\t\tCloseableHttpResponse res =client.execute(method,context);\r\n\r\n\t\t AuthState targetAuthState = context.getTargetAuthState();\r\n\t\t System.out.println(\"Target auth state: \" + targetAuthState.getState());\r\n\t\t System.out.println(\"Target auth scheme: \" + targetAuthState.getAuthScheme());\r\n\t\t System.out.println(\"Target auth credentials: \" + targetAuthState.getCredentials());\r\n\t\t\t\r\n\t\t HttpEntity ent =res.getEntity();\r\n\t\t \r\n\t\t if (ent != null) { \r\n System.out.println(\"Response content length: \" + ent.getContentLength()); \r\n System.out.println(ent+\"3214242423\");\r\n \r\n System.out.println(EntityUtils.toString(ent));\r\n } \r\n\t\t \r\n\t\t} catch (IOException e) {\r\n\t\t\t\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public void run() {\n // variables to store key HTTP(S) request information\n String sReadLine;\n boolean bNewHTTPHeader = true;\n String sHTTPMethod = \"\";\n String sHTTPRequest = \"\";\n boolean bPersistentConnection = true;\n\n // print the client IP:port\n System.out.println(\"client \" + connectedClient.getInetAddress() + \":\"\n + connectedClient.getPort() + \" is connected\");\n System.out.println();\n\n // create BufferedReader to read in from socket & DataOutputStream to send out to socket\n try {\n inFromClient = new BufferedReader(new InputStreamReader(connectedClient.getInputStream()));\n outToClient = new DataOutputStream(connectedClient.getOutputStream());\n\n } catch (IOException e) {\n System.out.println(\"There was an error setting up the buffered reader, \" +\n \"data stream, or reading from the client:\");\n System.out.println(\" \" + e);\n }\n\n // process the HTTP(S) request\n try {\n // break apart the input to read the http method and request\n while ((sReadLine = inFromClient.readLine()) != null) {\n // create a tokenizer to parse the string\n StringTokenizer tokenizer = new StringTokenizer(sReadLine);\n\n // if new HTTP header, then pull out the Method and Request (first line)\n if (bNewHTTPHeader) {\n sHTTPMethod = tokenizer.nextToken().toUpperCase(); // HTTP method: GET, HEAD\n sHTTPRequest = tokenizer.nextToken().toLowerCase(); // HTTP query: file path\n bNewHTTPHeader = false; // next lines are not part of a new HTTP header\n\n // print to console\n System.out.println(\"New HTTP Header:\");\n System.out.println(\" HTTP Method: \" + sHTTPMethod);\n System.out.println(\" HTTP Request: \" + sHTTPRequest);\n\n // not a new HTTP header: check for key params Connection or empty line\n } else if (sReadLine.length() > 0) {\n // get the next token in the input line\n String sParam = tokenizer.nextToken();\n\n // check to update connection status\n if (sParam.equalsIgnoreCase(\"Connection:\")) {\n String sConnectionRequest = tokenizer.nextToken();\n bPersistentConnection = (sConnectionRequest.equalsIgnoreCase(\"keep-alive\"));\n // print param to console\n System.out.println(\" param: \" + sParam + \" \" + sConnectionRequest);\n } else {\n // otherwise just print param to console\n System.out.println(\" param: \" + sParam);\n }\n\n // no more lines to header: header is over\n } else {\n //print to console\n System.out.println(\"End of Header\");\n System.out.println();\n\n // get the status code & response, then send back to client\n int iStatusCode = getStatusCode(sHTTPMethod, sHTTPRequest);\n String sResponse = getResponse(sHTTPMethod, sHTTPRequest, iStatusCode);\n sendResponse(sHTTPMethod, sHTTPRequest, iStatusCode, sResponse, bPersistentConnection);\n\n // next line is part of a new HTTP header\n bNewHTTPHeader = true;\n }\n }\n\n // loop has ended: client input is null (client must want to disconnect)\n this.connectedClient.close();\n System.out.println(\"input from client \" + connectedClient.getInetAddress() +\n + connectedClient.getPort() + \" is null. This socket closed.\");\n } catch (IOException e) {\n System.out.println(\"There was an error reading the HTTP request:\");\n System.out.println(\" \" + e);\n }\n }", "List<HttpServletServer> getHttpServers();", "public static void main(String[] args) throws IOException {\n\t\tif(args.length != 2)\n\t\t{\n\t\t\tusage();\n\t\t\treturn;\n\t\t}\n\t\tHttpServer server = new HttpServer(Integer.parseInt(args[0]), new FileServer(args[1]));\n\t\tserver.setAllowedMethods(new String[] { \"GET\", \"HEAD\" });\n\t\tserver.setName(\"info.ziyan.net.httpserver.example.FileServer/1.0\");\n\t\tserver.start();\n\t}", "private void handleHttpRequest(ChannelHandlerContext ctx, FullHttpRequest req) throws Exception {\n if (!req.decoderResult().isSuccess()) {\n sendHttpResponse(ctx, req, new DefaultFullHttpResponse(HTTP_1_1, BAD_REQUEST));\n return;\n }\n\n // Allow only GET methods.\n if (req.method() != GET) {\n sendHttpResponse(ctx, req, new DefaultFullHttpResponse(HTTP_1_1, FORBIDDEN));\n return;\n }\n\n // route handler\n if (\"/ws\".equals(req.uri())) {\n WebSocketServerHandshakerFactory wsFactory = new WebSocketServerHandshakerFactory(\n \"ws://\" + req.headers().get(HOST) + \"/ws\", null, false);\n handshaker = wsFactory.newHandshaker(req);\n if (handshaker == null) {\n WebSocketServerHandshakerFactory.sendUnsupportedVersionResponse(ctx.channel());\n } else {\n handshaker.handshake(ctx.channel(), req);\n addCtx(ctx, req.headers());\n }\n } else {\n handleFileRequest(ctx, req);\n }\n }", "protected HttpClient getClient() {\n if (client == null) {\n synchronized (this) {\n if (client == null) {\n client = new DefaultHttpClient(conman, params);\n }\n }\n }\n\n return client;\n }", "public void establishConnection() {\n httpNetworkService = new HTTPNetworkService(handler);\n }", "void doClientSide() throws Exception {\n\n\t\tSSLSocketFactory sslsf = (SSLSocketFactory) SSLSocketFactory\n\t\t\t\t.getDefault();\n\t\tSSLSocket sslSocket = (SSLSocket) sslsf.createSocket(theServerName,\n\t\t\t\t12345);\n\t\t\n\t\tOutputStream sslOS = sslSocket.getOutputStream();\n\t\tsslOS.write(\"Hello SSL Server\".getBytes()); // Write to the Server\n\t\tsslOS.flush();\n\t\tsslSocket.close();\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 }", "private DefaultHttpClient createHttpClient()\n throws IOException\n {\n XCapCredentialsProvider credentialsProvider\n = new XCapCredentialsProvider();\n credentialsProvider.setCredentials(\n AuthScope.ANY,\n new UsernamePasswordCredentials(getUserName(), password));\n\n return HttpUtils.getHttpClient(\n null , null, uri.getHost(), credentialsProvider);\n }", "public void processHTTP(Socket clientSocket, OutputStream out, BufferedReader in) throws InterruptedException, OneThreadLeftException{\n\t\ttry{\n\t\t\t// Create out and in objects to write and read to/from socket\n\t\t\tout = clientSocket.getOutputStream();\n\t\t\tin = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));\n\n\t\t\tString[] inputLine = new String[32]; // According to Wikipedia, there are 31 defined HTTP request lines\n\t\t\tString relPath, absPath;\n\t\t\tint i = 1;\n\t\t\tString[] toCheckLine = new String[10];\n\t\t\tDate toCompareMod = new Date();\n\t\t\tDate toCompareUnmod = new Date();\n\t\t\ttoCompareMod = null;\n\t\t\ttoCompareUnmod = null;\n\t\t\tboolean noHostHeader = true;\n\t\t\tint contentLen = 0;\n\n\t\t\t// If there is an input from the socket, then process it:\n\t\t\tif(!(inputLine[0] = in.readLine()).equals(null)) { \n\t\t\t\twhile(!(inputLine[i] = in.readLine()).equals(\"\")){\n\t\t\t\t\tSystem.out.println(inputLine[i]);\n\t\t\t\t\ttoCheckLine = inputLine[i].split(\" \");\n\t\t\t\t\tif((toCheckLine[0]).equals(\"If-Modified-Since:\")){\n\t\t\t\t\t\ttoCompareMod = processIfModifiedSince(toCheckLine);\n\t\t\t\t\t}\n\t\t\t\t\telse if((toCheckLine[0]).equals(\"If-Unmodified-Since:\")){\n\t\t\t\t\t\ttoCompareUnmod = processIfModifiedSince(toCheckLine);\n\t\t\t\t\t}\n\n\t\t\t\t\t// to handle Host: requirement for version 1.1\n\t\t\t\t\tif((toCheckLine[0]).equals(\"Host:\")){\n\t\t\t\t\t\tnoHostHeader = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// To get content-length for cleaner processing of POST request\n\t\t\t\t\tif((toCheckLine[0]).equals(\"Content-Length:\")){\n\t\t\t\t\t\tcontentLen = Integer.parseInt(toCheckLine[1].trim());\n\t\t\t\t\t}\n\n\t\t\t\t\ti++;\n\t\t\t\t}\n\n\t\t\t\t// Parse input line\n\t\t\t\tString[] splits = (inputLine[0]).split(\" \",3);\n\t\t\t\tThreadPool.registerURI(Thread.currentThread().getId(), splits[1]);\n\t\t\t\tString parentPath = splits[1]; \n\t\t\t\trelPath = splits[1].replaceAll(\"/\", \",\"); \n\t\t\t\tString[] relDirs = relPath.split(\",\",10);\n\t\t\t\tString fileName = relDirs[relDirs.length-1];\n\t\t\t\tabsPath = mRootDir+\"/\";\n\n\t\t\t\t// Check if the client has requested for a servlet to be run\n\t\t\t\tString requestType = splits[0];\n\n\t\t\t\t// In case of POST request\n\t\t\t\tString postBody = \"\";\n\t\t\t\t\n\t\t\t\tif(requestType.equals(\"POST\")){\n\t\t\t\t\tchar[] tempBuf = new char[contentLen];\n\t\t\t\t\tin.read(tempBuf,0,contentLen);\n\t\t\t\t\tpostBody = new String(tempBuf);\n\t\t\t\t\t//System.out.println(\"Postbody before: \"+postBody);\n\t\t\t\t\t//postBody = URLDecoder.decode(postBody, \"utf-8\");\n\t\t\t\t\t//System.out.println(\"Postbody after: \"+postBody);\n\n\t\t\t\t}\n\n\t\t\t\tif(requestType.equals(\"GET\") || requestType.equals(\"HEAD\") || requestType.equals(\"POST\")){\n\t\t\t\t\tString[] wrapperArgs = {mPathToXml, requestType, parentPath};\n\t\t\t\t\ttry{\n\t\t\t\t\t\tif(TestHarness.servletWrapper(wrapperArgs, inputLine, out, postBody, absPath) != 0)\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Check that request conforms to HTTP GET/HEAD request format before further processing\n\t\t\t\tif(splits[0].equals(\"GET\") || splits[0].equals(\"HEAD\")){\n\n\n\t\t\t\t\t/*\n\t\t\t\t\t// If HTTP/1.1, we want to check for Host header\n\t\t\t\t\t// This block verifies that, if it is version 1.1 then Host header must be there\n\t\t\t\t\tString[] version = splits[2].split(\"/\");\n\t\t\t\t\tif(version[1].trim().equals(\"1.1\")){\n\t\t\t\t\t\tif(noHostHeader == true){\n\t\t\t\t\t\t\tString source = \"<html><body><h2>No Host: header received</h2>HTTP 1.1 requests must include the Host: header.</body></html>\";\n\t\t\t\t\t\t\tout.write(\"HTTP/1.1 400 Bad Request\\r\\n\".getBytes(\"UTF-8\"));\n\t\t\t\t\t\t\tout.write(\"Content-Type: text/html\\r\\n\".getBytes(\"UTF-8\"));\n\t\t\t\t\t\t\tout.write((\"Content-Length: \"+source.length()+\"\\r\\n\").getBytes(\"UTF-8\"));\n\t\t\t\t\t\t\tout.write((\"Connection: close\\r\\n\\r\\n\").getBytes(\"UTF-8\"));\n\t\t\t\t\t\t\tout.write(source.getBytes(\"UTF-8\"));\n\t\t\t\t\t\t\tout.close();\n\t\t\t\t\t\t\tin.close();\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\t */\n\n\n\t\t\t\t\t// Check if the request is a GET request\n\t\t\t\t\tif(splits[0].equals(\"GET\")){\n\t\t\t\t\t\tprocessGET(absPath, relDirs, parentPath, splits, out, in, toCompareMod, toCompareUnmod);\n\t\t\t\t\t}\n\t\t\t\t\t// If not, check if the request is a HEAD request\n\t\t\t\t\telse if(splits[0].equals(\"HEAD\")){\n\t\t\t\t\t\tprocessHEAD(absPath, out, in, toCompareUnmod);\n\t\t\t\t\t}\n\t\t\t\t\t// If not GET or HEAD, the method is not implemented in this server\n\t\t\t\t\telse{\n\t\t\t\t\t\tout.write(\"HTTP/1.1 501 Not Implemented\\r\\n\\r\\n\".getBytes(\"UTF-8\"));\n\t\t\t\t\t\tout.write((\"Connection: close\\r\\n\\r\\n\").getBytes(\"UTF-8\"));\n\t\t\t\t\t}\n\n\t\t\t\t\t// Clean up\n\t\t\t\t\tin.close();\n\t\t\t\t\tout.close();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(IOException e){\n\t\t\tSystem.out.println(\"Thread ID: \"+ Thread.currentThread().getId());\n\t\t\tSystem.out.println(\"caught at buf in block, message: \"+e.getMessage());\n\t\t\treturn;\n\t\t}\n\t\tcatch(AllThreadsTerminatedException AllTe){\n\t\t\ttry{\n\t\t\t\tout.close();\n\t\t\t\tin.close();\n\t\t\t}\n\t\t\tcatch(IOException IOE){\n\n\t\t\t}\n\t\t\tthrow new OneThreadLeftException();\n\t\t}\n\n\t}", "private DefaultHttpClient createHttpsClient() throws HttpException {\n DefaultHttpClient client = new DefaultHttpClient();\n SSLContext ctx = null;\n X509TrustManager tm = new TrustAnyTrustManager();\n try {\n ctx = SSLContext.getInstance(\"TLS\");\n ctx.init(null, new TrustManager[] { tm }, null);\n } catch (NoSuchAlgorithmException | KeyManagementException e) {\n throw new HttpException(\"Can't create a Trust Manager.\", e);\n }\n SSLSocketFactory ssf = new SSLSocketFactory(ctx, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);\n client.getConnectionManager().getSchemeRegistry().register(new Scheme(\"https\", 443, ssf));\n return client;\n }", "public static Client getHttpClient() {\r\n return c;\r\n }", "public void init(){\n\t\tmultiplexingClientServer = new MultiplexingClientServer(selectorCreator);\n\t}", "private void startServer(String ip, int port, String contentFolder) throws IOException{\n HttpServer server = HttpServer.create(new InetSocketAddress(ip, port), 0);\n \n //Making / the root directory of the webserver\n server.createContext(\"/\", new Handler(contentFolder));\n //Making /log a dynamic page that uses LogHandler\n server.createContext(\"/log\", new LogHandler());\n //Making /online a dynamic page that uses OnlineUsersHandler\n server.createContext(\"/online\", new OnlineUsersHandler());\n server.setExecutor(null);\n server.start();\n \n //Needing loggin info here!\n }", "public WebServer(Music music, int port) throws IOException {\n this.music = music;\n this.server = HttpServer.create(new InetSocketAddress(port), 0);\n \n // handle concurrent requests with multiple threads\n server.setExecutor(Executors.newCachedThreadPool());\n server.start();\n String hostName = LOCALHOST;\n for (NetworkInterface iface : Collections.list(NetworkInterface.getNetworkInterfaces())) {\n for (InetAddress address: Collections.list(iface.getInetAddresses())) {\n if (address instanceof Inet4Address) { \n if (!address.getHostName().equals(LOCALHOST)) {\n System.out.println(\"Address: \" + address.getHostName());\n hostName = address.getHostName();\n }\n }\n }\n }\n \n for (String voice : music.getVoices()) {\n //handle requests for paths that start with /look/\n System.out.println(\" In your web browser, navigate to\\n\" + hostName + \":\" + port + \"/\" + voice + \"/\" + \"\\n to access the lyrics stream for this voice.\"); \n server.createContext(\"/\" + voice + \"/\", exchange -> {\n try {\n handleClient(exchange);\n } catch (MidiUnavailableException e) {\n throw new RuntimeException(\"Midi Unavailable\");\n } catch (InvalidMidiDataException e) {\n throw new RuntimeException(\"Invalid Midi Data\");\n } catch (InterruptedException e) {\n throw new RuntimeException(\"Interrupted\");\n }\n });\n }\n checkRep();\n }", "public static void main(String[] args) {\n\t\t\n\t\tif(args.length != 4){\n\t\t\tSystem.out.println(\"Program takes 4 arguments. Usage: java HttpClient localhost <port number> <Request Type(GET/PUT)> <filepath>\");\n\t\t}else{\n\t\t\tif (!isNumeric(args[1]))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Please enter valid Port no\");\n\t\t\t\treturn;\n\t\t\t}\n String hostName = args[0];\n\t\t\tint portNo = Integer.parseInt(args[1]);\n\t\t\tString requestType = args[2];\n\t\t\tString filePath = args[3];\n\t\t\tObjectOutputStream outs;\n\t\t\tObjectInputStream ins;\n\t\t\t\n\t\ttry {\n \n\t\t\tSocket socket = new Socket(hostName, portNo);\n\t\t\tSystem.out.println(\"\\n\" + \"Connected to Server on port \" + portNo);\n\t\t\t\n\t\t\touts = new ObjectOutputStream(socket.getOutputStream()); \n\t\t\tins = new ObjectInputStream(socket.getInputStream());\n\t\t\t\n\t\t\tif(requestType.equals(GET)){\n\t\t\t\tSystem.out.println(requestType + \" \" + filePath + \" HTTP/1.1\");\n\t\t\t\tSystem.out.println(\"Host:\" + hostName);\n\t\t\t\touts.writeObject(requestType + \" \" + filePath + \" HTTP/1.1\");\n\t\t\t\touts.writeObject(\"Host:\" + hostName);\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\tString response = (String) ins.readObject();\n\n\t\t\t\t\tSystem.out.println(\"Status: \" + response + \"\\n\");\n\t\t\t\t\tif ( response.equals(RESPONSE_OK)) \n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"Requested file contains : \\n\");\n\t\t\t\t\t\tSystem.out.println(\"-------------------------------------------------\");\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tString line = (String) ins.readObject();\n\t\t\t\t\t\t\twhile (line != null) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tSystem.out.println(line);\n\t\t\t\t\t\t\t\tline = (String) ins.readObject();\n\t\t\t\t\t\t\t}\n \n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tcatch(EOFException e)\n\t\t\t\t\t\t{\n System.out.println(\"-------------------------------------------------\");\n\t\t\t\t\t\t\tSystem.out.println(\"\\nFile is received\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println(response);\n\t\t\t\t\t\t}\n\t\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse if ( requestType.equals(PUT)) \n\t\t\t{\n\t\t\t\tFile file = new File(filePath); \n\t\t\t\tif (!(file.isDirectory()) && (file.exists()))\n\t\t\t\t{\n System.out.println(\"Sending the file: \" + file.getName() + \" to server....\\n\"); \n\t\t\t\t\touts.writeObject(requestType + \" \" + filePath + \" HTTP/1.1\");\n\t\t\t\t\t\n\t\t\t\t\tInputStream fis = new FileInputStream(file); \n\t\t\t\t\tbyte [] buffer = new byte[(int)file.length()];\n\n\t\t\t\t\tint noOfBytes = fis.read(buffer);\n\t\t\t\t\ttry{\n\t\t\t\t\t\tif(noOfBytes > 0)\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\touts.write(buffer, 0, noOfBytes);\n\t\t\t\t\t\t\touts.flush();\n\t\t\t\t\t\t\tSystem.out.println(\"File: \" + file.getName() + \" Sent\\n\\n\");\n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfis.close();\n\t\t\t\t\tSystem.out.println(\"Status Code from server: \" + ins.readObject() + \"\\n\");\n\t\t\t\t\tSystem.out.println(\"Status Message from server: \" + ins.readObject() + \"\\n\");\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\tSystem.out.println(\"File doesn't exist\\n\");\n\t\t\t\t\touts.writeObject(\"Invalid File\");\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Invalid Request type. Use only GET/PUT \\n\");\n\t\t\t\touts.writeObject(\"Invalid Request type\");\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Closing the Socket\");\n\t\t\t\n\t\t\touts.close();\n\t\t\tins.close();\t\t\t\n\t\t\tsocket.close();\n\t\t}\n\t\tcatch( Exception e )\n\t\t{\n\t\t\te.printStackTrace();\n\t\t} \n\t\t}\n\n\t}", "@Override\n public PooledHttpResponse serve(ServiceRequestContext ctx, PooledHttpRequest req) throws Exception {\n assert !(unwrap() instanceof PooledHttpService);\n return PooledHttpResponse.of(unwrap().serve(ctx, req));\n }", "@BeforeClass\n public static void createClient() {\n client = HttpClients.createDefault();\n }", "public HttpClientHelper() {\n defaultHeaders.put(\"Content-Type\", \"application/json\");\n defaultHeaders.put(\"Accept-Encoding\", \"gzip\");\n\n //postDefaultHeaders.put(\"Content-Type\", \"application/json\");\n //postDefaultHeaders.put(\"Content-Encoding\", \"gzip\");\n\n String key = MessageFormat.format(\"{0}#{1}\", UserUtil.getUserUuid(), UserUtil.getUserId());\n\n //postDefaultHeaders.put(\"X-CLIENT-KEY\", key);\n defaultHeaders.put(\"X-CLIENT-KEY\", key);\n client.setTimeout(3000);\n }", "protected abstract ClassicHttpResponse execute(ClassicHttpRequest request, HttpClientContext context) throws IOException;", "public CustomLoginFilter() {\n connectionManager = new MultiThreadedHttpConnectionManager();\n// httpClient = new HttpClient(connectionManager);\n\n// HostConfiguration hostConfiguration = new HostConfiguration();\n// hostConfiguration.setHost(HOST);\n// httpClient.setHostConfiguration(hostConfiguration);\n }", "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 GameServerClient(){\r\n\t\tinitComponents();\r\n\t\t}", "public static final DefaultHttpClient createHttpClient() {\n\t\treturn createHttpClient(3);\n\t}", "public void run()\n {\n Connection conn;\n Socket clientSock;\n int timeout;\n\n conn = new Connection();\n timeout = _config.getClientTimeout() * 1000;\n\n for ( ; ; ) {\n /*\n * Wait for connection request.\n */\n try {\n clientSock = _serverSock.accept();\n }\n catch(IOException e) {\n logError(\"accept() failure: \" + e.getMessage());\n continue;\n }\n\n try {\n clientSock.setSoTimeout(timeout);\n }\n catch(SocketException e) {\n logError(\"Cannot set timeout of client socket: \" + e.getMessage()\n + \" -- closing socket\");\n\n try {\n clientSock.close();\n }\n catch(IOException e2) {\n logError(\"Cannot close socket: \" + e2.getMessage());\n }\n continue;\n }\n\n /*\n * `Create' a new connection.\n */\n try {\n conn.init(clientSock);\n }\n catch(IOException e) {\n logError(\"Cannot open client streams\" + getExceptionMessage(e));\n try {\n clientSock.close();\n }\n catch(IOException e2) {\n logError(\"Cannot close client socket\" + getExceptionMessage(e2));\n }\n continue;\n }\n\n if (DEBUG && _debugLevel > 0) {\n debugPrintLn(\"Reading HTTP Request...\");\n }\n\n /*\n * `Create' a new container for the request.\n */\n setCurrentDate(_date);\n _req.init(conn, _clfDateFormatter.format(_date));\n\n // Get the current GAP list.\n _gapList = GlobeRedirector.getGAPList();\n\n processRequest(conn);\n\n /*\n * If access logging is enabled, write an entry to the access log.\n */\n if (_config.getAccessLogEnabledFlag()) {\n GlobeRedirector.accessLog.write(_req.getCommonLogFileStatistics());\n } \n\n if (DEBUG && _debugLevel > 1) {\n debugPrintLn(\"Closing client connection\");\n }\n\n try {\n conn.close();\n }\n catch(IOException e) {\n logError(\"Cannot close client connection\" + getExceptionMessage(e));\n }\n\n /*\n * Release references that are no longer needed. To reduce the\n * memory footprint, these references are released now because it\n * may take a long time before this thread handles a new request\n * (in which case the references are released too).\n */\n _gapList = null;\n _req.clear();\n _httpRespHdr.clear();\n _cookieCoords = null;\n }\n }", "ClientHandler(Socket socket) {\n this.client = socket;\n }", "public HttpConnector(JsonSystem system) {\r\n super(system);\r\n }", "public interface HttpClientInterface {\n byte[] post(String url, byte[] body);\n}", "public DefaultHttpRequestBuilder (final DefaultHttpClient client) {\r\n\t\tif (client == null) {\r\n\t\t\tthrow new NullPointerException (\"client cannot be null\");\r\n\t\t}\r\n\t\t\r\n\t\tthis.client = client;\r\n\t}", "public AbaloneClient() {\n server = new AbaloneServer();\n clientTUI = new AbaloneClientTUI();\n }", "public interface HttpHandler {\n public void handle(HttpExchange httpExchange) throws IOException;\n}", "void onHTTPRequest(HTTPRequest request, HTTPResponse response);", "private void setupHttpConnectionStuff() {\n if (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO) {\n System.setProperty(\"http.keepAlive\", \"false\");\n }\n if (Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH) {\n try {\n final File httpCacheDir = new File(getCacheDir(), \"http\");\n HttpResponseCache.install(httpCacheDir, TEN_MEGABYTES);\n } catch (IOException ioe) {\n Log.e(Constants.LOG_TAG, \"Could not install http cache on this device.\");\n }\n }\n }", "public ApplicationHostService(HttpContext httpContext, NewRelicClient client)\n {\n super(httpContext, client);\n }", "public HttpComponentsClientHttpRequest(HttpClient httpClient, HttpUriRequest httpRequest)\r\n/* 25: */ {\r\n/* 26:54 */ this.httpClient = httpClient;\r\n/* 27:55 */ this.httpRequest = httpRequest;\r\n/* 28: */ }", "public AsyncHttpServer(NioEventloop eventloop, AsyncHttpServlet servlet) {\n\t\tsuper(eventloop);\n\t\tthis.connectionsList = new ExposedLinkedList<>();\n\t\tthis.servlet = servlet;\n\t\tchar[] chars = eventloop.get(char[].class);\n\t\tif (chars == null || chars.length < MAX_HEADER_LINE_SIZE) {\n\t\t\tchars = new char[MAX_HEADER_LINE_SIZE];\n\t\t\teventloop.set(char[].class, chars);\n\t\t}\n\t\tthis.headerChars = chars;\n\t}", "IHttpService getHttpService();", "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 }", "protected static AuoServer getServer() {\n return server;\n }", "public Client() {\n initComponents();\n \n Server server = new Server();\n server.start();\n \n }", "public interface HttpResponseListener extends AsyncListener {\n /** The http header has been sent. \n * @param response the HttpHeader that was read\n * @param bufferHandle the BufferHandle that may or may not hold unread data.\n * @param keepalive if the sender want to use keepalive.\n * @param isChunked if false content is not chunked, \n * if true content is chunked.\n * @param dataSize the contents size or -1 if size is unknown.\n */\n void httpResponse (HttpHeader response, BufferHandle bufferHandle, \n\t\t boolean keepalive, boolean isChunked, long dataSize);\n \n}", "public static void main(String[] args){ new ThreadPoolBlockingServer().processRequests(); }", "private void serve() {\n\t\tif (request == null) {\n\t\t\tchannel.close();\n\t\t\treturn;\n\t\t}\n\t\tlogger.fine(\"Serving \" + type + \" request : \" + request.getPath());\n\t\tResponse resp = RequestHandler.handle(request);\n\t\tif (resp.getRespCode() == ResponseCode.NOT_FOUND) {\n\t\t\terror404(resp);\n\t\t\treturn;\n\t\t}\n\n\t\tStringBuilder header = new StringBuilder();\n\t\tif (type == Type.HTTP) {\n\t\t\theader.append(\"HTTP/1.0 200 OK\\r\\n\");\n\t\t\theader.append(\"Content-Length: \")\n\t\t\t\t\t.append(resp.getFileData().remaining()).append(\"\\r\\n\");\n\t\t\theader.append(\"Connection: close\\r\\n\");\n\t\t\theader.append(\"Server: Hyperion/1.0\\r\\n\");\n\t\t\theader.append(\"Content-Type: \" + resp.getMimeType() + \"\\r\\n\");\n\t\t\theader.append(\"\\r\\n\");\n\t\t}\n\t\tbyte[] headerBytes = header.toString().getBytes();\n\n\t\tByteBuffer bb = resp.getFileData();\n\t\tChannelBuffer ib = ChannelBuffers.buffer(bb.remaining()\n\t\t\t\t+ headerBytes.length);\n\t\tib.writeBytes(headerBytes);\n\t\tib.writeBytes(bb);\n\t\tchannel.write(ib).addListener(ChannelFutureListener.CLOSE);\n\t}", "public void run() {\r\n try {\r\n while (true) {\r\n Socket serverClient = serverSocket.accept(); //server accept the contentServerId connection request\r\n ServerClientThread sct = new ServerClientThread(serverClient, lamportClock, feeds, timers); //send the request to a separate thread\r\n sct.start();\r\n }\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }" ]
[ "0.62571096", "0.6183197", "0.61613446", "0.6148492", "0.6110891", "0.61091226", "0.6078195", "0.6058254", "0.60320276", "0.6030281", "0.60160786", "0.60077906", "0.593916", "0.5920629", "0.59196067", "0.59120476", "0.5898727", "0.58909196", "0.5885971", "0.58779347", "0.5865628", "0.58576983", "0.584711", "0.5842753", "0.5840872", "0.5826913", "0.5818118", "0.5808207", "0.5786263", "0.57716763", "0.5766536", "0.57515365", "0.5749862", "0.57450145", "0.5740228", "0.5738991", "0.5729226", "0.5727594", "0.5713169", "0.5710483", "0.57080996", "0.57067555", "0.56841624", "0.56672347", "0.5663578", "0.56411165", "0.561425", "0.56089026", "0.5608318", "0.55908763", "0.55803835", "0.5577238", "0.55762964", "0.5576122", "0.5574899", "0.5574389", "0.55725867", "0.55672765", "0.55600446", "0.55491006", "0.55476713", "0.554347", "0.5521405", "0.5520385", "0.5515808", "0.55053484", "0.54940677", "0.54916126", "0.54899853", "0.548447", "0.5479268", "0.54731387", "0.5471656", "0.54716444", "0.54611194", "0.5453863", "0.5452467", "0.54504937", "0.5443554", "0.5443496", "0.5436177", "0.54321814", "0.54299015", "0.5426374", "0.54183334", "0.5406371", "0.5403915", "0.5402562", "0.54005176", "0.5397596", "0.53957105", "0.5387664", "0.53850025", "0.5373914", "0.5370573", "0.5369596", "0.5365299", "0.53566664", "0.5355878", "0.5345093", "0.5342755" ]
0.0
-1
with any HTTP ClientServer
public static String uploadUseFormFile(String toUrl, File[] files, String[] names) { String end = "\r\n"; String twoHyphens = "--"; String boundary = "*****jerry2"; HttpURLConnection conn = null; InputStream is = null; DataOutputStream ds = null; try { URL url = new URL(toUrl); conn = (HttpURLConnection) url.openConnection(); conn.setDoOutput(true); conn.setDoInput(true); conn.setChunkedStreamingMode(0); conn.setRequestMethod("POST"); conn.setRequestProperty("Connection", "Keep-Alive"); conn.setRequestProperty("Charset", "UTF-8"); conn.setRequestProperty("Content-length", String.valueOf(getLength(files))); conn.setRequestProperty("Content-type", "multipart/form-data; boundary="+boundary); /* Content-type: multipart/form-data; boundary=AaB03x --AaB03x content-disposition: form-data; name="pics"; filename="file1.txt" Content-Type: text/plain ... contents of file1.txt ... --AaB03x-- */ ds = new DataOutputStream(conn.getOutputStream()); for (int i = 0; i < files.length; i++) { is = new FileInputStream(files[i]); ds.writeBytes(twoHyphens + boundary + end); ds.writeBytes("content-disposition: form-data; name=\""+names[i]+"\"; filename=\""+files[i].getName()+"\""+end); ds.writeBytes(end); byte[] buf = new byte[128]; int len = -1; while ((len=is.read(buf)) != -1) ds.write(buf, 0, len); ds.writeBytes(end); } ds.writeBytes(twoHyphens + boundary + twoHyphens + end); ds.flush(); //response System.out.println("code="+conn.getResponseCode()+",msg="+conn.getResponseMessage()); return getContent(conn.getInputStream()); } catch (IOException e1) { e1.printStackTrace(); } finally{ try { if (is != null) is.close(); if (ds != null) ds.close(); } catch (IOException e) { e.printStackTrace(); } conn.disconnect(); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static HttpClient createClient() {\n return HttpClients.createMinimal();\n }", "public interface Client {\n\n\t/**\n\t * @throws Http2Exception\n\t */\n\tvoid init() throws Http2Exception;\n\n\t/**\n\t * @return\n\t * @throws Http2Exception\n\t */\n\tboolean start() throws Http2Exception;\n\n\t/**\n\t * @param request\n\t * @return\n\t * @throws Http2Exception\n\t */\n\t Http2Response request(Http2Request request) throws Http2Exception;\n\n\t/**\n\t * @return\n\t * @throws Http2Exception\n\t */\n\tboolean isRuning() throws Http2Exception;\n\n\t/**\n\t * @return\n\t * @throws Http2Exception\n\t */\n\tboolean shutdown() throws Http2Exception;\n\n}", "public void setHttpClient( HttpClient req ) {\r\n\tclient=req;\r\n }", "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 }", "public static void main(String... args) {\n HttpServer httpServer = httpServerBuilder()\n .setPort(8080).build();\n\n /* Setting up a request Consumer with Java 8 Lambda expression. */\n httpServer.setHttpRequestConsumer(httpRequest -> {\n\n Map<String, Object> results = new HashMap<>();\n results.put(\"method\", httpRequest.getMethod());\n results.put(\"uri\", httpRequest.getUri());\n results.put(\"body\", httpRequest.getBodyAsString());\n results.put(\"headers\", httpRequest.getHeaders());\n results.put(\"params\", httpRequest.getParams());\n httpRequest.getReceiver().response(200, \"application/json\", toJson(results));\n });\n\n /* Start the server. */\n httpServer.start();\n\n\n /* Setup an httpClient. */\n HttpClient httpClient = httpClientBuilder().setHost(\"localhost\").setPort(8080).build();\n httpClient.startClient();\n\n sendGets(httpClient);\n sendPosts(httpClient);\n sendPuts(httpClient);\n\n\n Sys.sleep(1000);\n\n httpServer.stop();\n httpClient.stop();\n }", "public abstract Client getClient();", "public interface HttpClient {\n\n\torg.apache.http.client.HttpClient getClient();\n\n\tString fetch(URI uri) throws IOException;\n\n\tvoid init() throws KeyManagementException, NoSuchAlgorithmException;\n}", "public static void main(String[] args) {\n\n Client client = ClientBuilder.newClient();\n WebTarget target = client.target(\"http\");\n\n }", "private static HttpClient getNewHttpClient(){\n HttpParams params = new BasicHttpParams();\n return new DefaultHttpClient(params);\n }", "public void startServer() {\n System.out.println(\"Inicie\");\n httpServer = new HttpServer();\n httpServer.registerProessor(\"/App\", this);\n try {\n httpServer.start();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public TestHttpServer (HttpCallback cb) throws IOException {\n this (cb, 1, 10, 0);\n }", "private void runClient(final HttpMethod httpMethod, final ByteBuf content, final String uri) {\n EventLoopGroup group = new NioEventLoopGroup();\n try {\n final Bootstrap client = new Bootstrap();\n client.group(group)\n .channel(NioSocketChannel.class)\n .handler(new ClientHandler());\n\n final FullHttpRequest request =\n new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, httpMethod, uri, content);\n final HttpHeaders headers = request.headers();\n headers.set(HttpHeaders.Names.CONTENT_TYPE, \"application/json; charset=UTF-8\");\n headers.set(HttpHeaders.Names.HOST, host);\n headers.set(HttpHeaders.Names.CONTENT_LENGTH, String.valueOf(content.readableBytes()));\n\n final Channel clientChannel = client.connect(host, port).sync().channel();\n clientChannel.writeAndFlush(request);\n clientChannel.closeFuture().awaitUninterruptibly();\n group.shutdownGracefully();\n } catch (InterruptedException e) {\n Assert.fail(\"The client failure: \" + e.getMessage());\n }\n }", "public DefaultHttpClientImpl() {\n SchemeRegistry schemeRegistry = new SchemeRegistry();\n schemeRegistry.register(new Scheme(\n \"http\", PlainSocketFactory.getSocketFactory(), 80));\n\n schemeRegistry.register(new Scheme(\n \"https\", SSLSocketFactory.getSocketFactory(), 443));\n conman = new ThreadSafeClientConnManager(params, schemeRegistry);\n }", "Client getClient();", "private void initialize(){\n if(uri != null)\n httpUriRequest = getHttpGet(uri);\n httpClient = HttpClients.createDefault();\n }", "public HttpGetSocket(SocketHandler h)\r\n {\r\n super(h);\r\n }", "public interface ZmoteHTTPDRequestHandler{\n\tpublic String getURI();\n\tpublic Response serve(String uri, String method, Properties header, Properties parms, Properties files, ZmoteHTTPD httpd);\t\n\tpublic ZmoteHTTPDRequestHandler clone();\n}", "@Override\n\t\t\t\t\tpublic void run() {\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tList<String> headers = readRequest(client);\n\t\t\t\t\t\t\tif (headers != null && headers.size() >= 1) {\n\t\t\t\t\t\t\t\tString requestURL = getRequestURL(headers.get(0));\n\t\t\t\t\t\t\t\tLog.d(TAG, requestURL);\n\n\t\t\t\t\t\t\t\tif (requestURL.startsWith(\"http://\")) {\n\n\t\t\t\t\t\t\t\t\t// HttpRequest request = new\n\t\t\t\t\t\t\t\t\t// BasicHttpRequest(\"GET\", requestURL);\n\n\t\t\t\t\t\t\t\t\tprocessHttpRequest(requestURL, client, headers);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tprocessFileRequest(requestURL, client, headers);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} catch (IllegalStateException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "private void handleClient() {\n\t\t//Socket link = null;\n\t\tRequestRecord reqRec = new RequestRecord();\n\t\tResponder respondR = new Responder();\n\t\t\n\t\ttry {\n\t\t\t// STEP 1 : accepting client request in client socket\n\t\t\t//link = servSock.accept(); //-----> already done in *ThreadExecutor*\n\t\t\t\n\t\t\t// STEP 2 : creating i/o stream for socket\n\t\t\tScanner input = new Scanner(link.getInputStream());\n\t\t\tdo{\n\t\t\t\t//PrintWriter output = new PrintWriter(link.getOutputStream(),true);\n\t\t\t\t//DataOutputStream ds = new DataOutputStream(link.getOutputStream());\n\t\t\t\tint numMsg = 0;\n\t\t\t\tString msg = input.nextLine();\n\t\t\t\t\n\t\t\t\t//to write all requests to a File\n\t\t\t\tFileOutputStream reqFile = new FileOutputStream(\"reqFile.txt\");\n\t\t\t\tDataOutputStream dat = new DataOutputStream(reqFile);\n\t\t\t\t\n\t\t\t\t// STEP 4 : listening iteratively till close string send\n\t\t\t\twhile(msg.length()>0){\n\t\t\t\t\tnumMsg++;\n\t\t\t\t\tdat.writeChars(msg + \"\\n\");\n\t\t\t\t\tSystem.out.println(\"\\nNew Message Received\");\n\t\t\t\t\tif(reqRec.setRecord(msg)==false)\n\t\t\t\t\t\tSystem.out.println(\"\\n-----\\nMsg#\"+numMsg+\": \"+msg+\":Error with Request Header Parsing\\n-----\\n\");\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(\"Msg#\" + numMsg + \": \" + msg);\n\t\t\t\t\tmsg = input.nextLine();\n\t\t\t\t};\n\t\t\t\tdat.writeChars(\"\\n-*-*-*-*-*-*-*-*-*-*-*-*-*-\\n\\n\");\n\t\t\t\tdat.close();\n\t\t\t\treqFile.close();\n\t\t\t\tSystem.out.println(\"---newEST : \" + reqRec.getResource());\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"\\n==========Send HTTP Response for Get Request of\\n\"+reqRec.getResource()+\"\\n***********\\n\");\n\t\t\t\tif(respondR.sendHTTPResponseGET(reqRec.getResource(), link)==true)//RES, ds)==true)\n\t\t\t\t\tSystem.out.println(\"-----------Resource Read\");\n\t\t\t\tSystem.out.println(\"Total Messages Transferred: \" + numMsg);\n\t\t\t\t//link.close();\n\t\t\t\tif(reqRec.getConnection().equalsIgnoreCase(\"Keep-Alive\")==true && respondR.isResourceExisting(reqRec.getResource())==true)\n\t\t\t\t\tlink.setKeepAlive(true);\n\t\t\t\telse\n\t\t\t\t\tbreak;\n\t\t\t}while(true);\n\t\t\tSystem.out.print(\"Request Link Over as Connection: \" + reqRec.getConnection());\n\t\t} catch (IOException e) {\n\t\t\tif(link.isClosed())\n\t\t\t\tSystem.out.print(\"\\n\\nCritical(report it to developer):: link closed at exception\\n\\n\");\n\t\t\tSystem.out.println(\"Error in listening.\\n {Error may be here or with RespondR}\\nTraceString: \");\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\t// STEP 5 : closing the connection\n\t\t\tSystem.out.println(\"\\nClosing Connection\\n\");\n\t\t\ttry {\t\t\t\t\n\t\t\t\tlink.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(\"Unable to disconnect.\\nTraceString: \");\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}/*ends :: try...catch...finally*/\n\t\t\n\t}", "public interface HttpClientFactory {\n CloseableHttpClient newHttpClient();\n}", "public static void main(String[] args) throws ClientProtocolException,\n\t\t\tIOException {\n\t\tString url = \"http://localhost:4444/index.html\";\n\t\tString url2 = \"http://posttestserver.com/post.php\";\n\t\t// creates new client\n\t\tG52APRClient client = new G52APRClient();\n\n\t\t// GET\n\t\tSystem.out.println(client.httpGet(url));\n\n\t\t// HEAD\n\t\t//System.out.println(client.httpHead(url));\n\n\t\t// POST\n\t\tString dataBody = \"Testing POST method, it worked. \";\n\t\t//System.out.println(client.httpPost(url, dataBody));\n\n\t\t// POSTARRAY\n\t\t// creating ArrayList\n\t\tArrayList<NameValuePair> dataArray = new ArrayList<NameValuePair>();\n\t\tdataArray.add(new BasicNameValuePair(\"Name\", \"Natalia\"));\n\t\tdataArray.add(new BasicNameValuePair(\"Course\", \"Computer Science\"));\n\t\tdataArray.add(new BasicNameValuePair(\"Age\", \"19\"));\n\t\t//System.out.println(client.httpPost(url, dataArray));\n\n\t\t// getConditional*******************************************\n\n\t\t// date which should return the body (last read before it was last\n\t\t// modified)\n\t\tString date1 = \"Sun Nov 16 21:31:815 GMT 2013\";\n\n\t\t// date which should return the 304 status line (last read after it was\n\t\t// last modified)\n\t\tString date2 = \"Sun Nov 16 21:31:815 GMT 2015\";\n\t\t\n\t\t//System.out.println(client.httpGetConditional(url, date1));\n\t\t\n\t\t//System.out.println(client.httpGetConditional(url, date2));\n\n\t\t// RUN TESTS FROM THIS MAIN TO ClientTests (testing for part 2 of\n\t\t// coursework)\n\t\t//ClientTests ct = new ClientTests(new G52APRClient());\n\t\t//ct.runTests(\"http://cs.nott.ac.uk/~syn/webfiles/index.html\");\n\n\t}", "@Test\n public void testHttpHappyPathOnce() throws Exception {\n final String testAddr = UUID.randomUUID().toString();\n final Subscription server = TestHttpUtil.createTestServerWith(testAddr, \n responseBy(\"text/plain\", HttpTestServer.CONTENT),\n ENABLE_LOGGING);\n final DefaultHttpClient client = new DefaultHttpClient(new TestChannelCreator(), ENABLE_LOGGING);\n try {\n \n final Iterator<HttpObject> itr = \n client.defineInteraction(\n new LocalAddress(testAddr), \n Observable.just(fullHttpRequest()))\n .map(RxNettys.<HttpObject>retainer())\n .toBlocking().toIterable().iterator();\n \n final byte[] bytes = RxNettys.httpObjectsAsBytes(itr);\n \n assertTrue(Arrays.equals(bytes, HttpTestServer.CONTENT));\n } finally {\n client.close();\n server.unsubscribe();\n }\n }", "private HttpClient prepareHttpClient() {\n\t\tHttpClientParams htcParams = new HttpClientParams();\n\t\tmHttpClient = new HttpClient();\n\t\thtcParams.setConnectionManagerTimeout(300000);\n\t\thtcParams.setSoTimeout(300000);\n\t\tmHttpClient.setParams(htcParams);\n\t\treturn mHttpClient;\n\t}", "protected RestClient()\n\t{\n\t\tclient = new HttpClient();\n\t\tclient.setIdleTimeout(3000000);\n\t\t// for possible future use:\n\t\t//exchange_get = new ContentExchange()\n\t\t{\n\t\t\t// define the callback method to process the response when you get it back\n\t\t\t// protected void onResponseComplete() throws IOException\n\t\t\t// {\n\t\t\t// super.onResponseComplete();\n\t\t\t// int responseStatus = this.getStatus();\n\n\t\t\t// do something with the response content\n\t\t\t//System.out.println(\"Response status: \" + responseStatus);\n\t\t\t//System.out.println(this.getResponseContent());\n\t\t\t//\t }\n\t\t};\n\t}", "public HttpConnector(){\n super();\n }", "private HttpClient() {\n\t}", "public interface HttpRequestHandler {\n public boolean canHandle(String uri);\n public httpResponse handle(httpRequest request);\n}", "public static void main(String[] args) {\n int port = 8899;\n ServerBootstrap serverBootstrap = new ServerBootstrap();\n EventLoopGroup boss = new NioEventLoopGroup();\n EventLoopGroup work = new NioEventLoopGroup();\n\n try {\n serverBootstrap.group(boss, work)\n .channel(NioServerSocketChannel.class)\n .localAddress(new InetSocketAddress(port))\n .childHandler(new ChannelInitializer() {\n\n @Override\n protected void initChannel(Channel ch) throws Exception {\n ch.pipeline()\n .addLast(\"codec\", new HttpServerCodec()) // HTTP 编解码\n .addLast(\"compressor\", new HttpContentCompressor()) // HttpContent 压缩\n .addLast(\"aggregator\", new HttpObjectAggregator(65536)) // HTTP 消息聚合\n .addLast(\"handler\", new HttpServerHandler());\n }\n })\n .childOption(ChannelOption.SO_KEEPALIVE, true);\n\n ChannelFuture f = serverBootstrap.bind().sync();\n System.out.println(\"Http Server started, Listening on \" + port);\n f.channel().closeFuture().sync();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n work.shutdownGracefully();\n boss.shutdownGracefully();\n }\n }", "public static void main(String[] args) {\n\n Request getReq = new Request();\n\n try {\n// getReq.sendReq(\"127.0.0.1\", \"/\", 80);\n getReq.sendReq(\"127.0.0.1\", \"/\", 40289);\n } catch (IOException e) {\n\n e.printStackTrace();\n }\n\n\n }", "public void setHttpServer(String httpServer) {\n this.httpServer = httpServer;\n }", "public void serve() throws IOException {\n int req = 0;\n while (req<maxreq) {\n //block intil a client connects\n final Socket socket = serversocket.accept();\n //create a new thread to handle the client\n\n Thread handler = new Thread(new Runnable() {\n public void run() {\n try {\n try {\n handle(socket);\n } finally {\n socket.close();\n }\n } catch (IOException ioe) {\n // this exception wouldn't terminate serve(),\n // since we're now on a different thread, but\n // we still need to handle it\n ioe.printStackTrace();\n }\n }\n });\n // start the thread\n handler.start();\n req++;\n }\n\n }", "public static HttpServer startServer() {\n // create a resource config that scans for JAX-RS resources and providers\n // in com.example.rest package\n final ResourceConfig rc = new ResourceConfig().packages(\"com.assignment.backend\");\n rc.register(org.glassfish.jersey.moxy.json.MoxyJsonFeature.class);\n rc.register(getAbstractBinder());\n rc.property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);\n rc.property(ServerProperties.BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK, true);\n\n // create and start a new instance of grizzly http server\n // exposing the Jersey application at BASE_URI\n return GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);\n }", "public interface HttpClientable {\n\n void get(String url);\n\n void get(String url, ParamStore params);\n\n void get(String url, ParamStore params, String tag);\n\n void post(String url, SparseArray<String> params);\n\n void post(String url, SparseArray<String> params, String tag);\n\n void upload(String url, HashMap<String, Object> params);\n\n void upload(String url, HashMap<String, Object> params, String tag);\n\n void download(String url);\n\n void download(String url, String tag);\n\n void cancelAll();\n\n void cancel(String tag);\n\n}", "private HttpClient getTemplateServerClient(String remoteSource) throws IOException {\n\n SocketFactory factory = (SocketFactory)mSocketFactories.get(remoteSource);\n\n if (factory == null) {\n\n int port = 80;\n String host = remoteSource.substring(TEMPLATE_LOAD_PROTOCOL.length());\n\n int portIndex = host.indexOf(\"/\");\n \n if (portIndex >= 0) {\n host = host.substring(0,portIndex); \n }\n String hostPort = host; \n portIndex = host.indexOf(\":\");\n if (portIndex >= 0) {\n try {\n port = Integer.parseInt(host.substring(portIndex+1));\n }\n catch (NumberFormatException nfe) {\n System.out.println(\"Invalid port number specified\");\n }\n host = host.substring(0,portIndex);\n }\n factory = new PooledSocketFactory(new PlainSocketFactory(InetAddress.getByName(host), \n port, 5000));\n \n if (factory != null) {\n mSocketFactories.put(hostPort, factory);\n }\n }\n return new HttpClient(factory);\n }", "@Bean\n public HttpClient httpClient() {\n return new HttpClient(multiThreadedHttpConnectionManager());\n }", "@Before\n public void buildClient() {\n BasicCookieStore cookieStore = new BasicCookieStore();\n\n // Build Apache Http Client to execute requests\n this.httpClient = HttpClientBuilder.create()\n .setDefaultCookieStore(cookieStore)\n .setRedirectStrategy(new LaxRedirectStrategy())\n .build();\n }", "public HttpClient(String host, int port)\n\t{\n\t\tsuper(host, port);\n\t\tclient = new org.apache.commons.httpclient.HttpClient();\n\t}", "private HttpProxy createHttpServerConnection() {\n\n final HttpProxy httpProxy = httpConnectionFactory.create();\n\n // TODO: add configurable number of attempts, instead of looping forever\n boolean connected = false;\n while (!connected) {\n LOGGER.debug(\"Attempting connection to HTTP server...\");\n connected = httpProxy.connect();\n }\n\n LOGGER.debug(\"Connected to HTTP server\");\n\n return httpProxy;\n }", "ServerTransport serverTransport(TransportResources resources);", "S getServer();", "public static void main(String[] args) throws IOException, URISyntaxException {\n try {\r\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n } catch (Exception e) { \r\n \tSystem.out.println(\"algo no jalo\"); \t\r\n }\r\n\t\t\r\n \tHost host=new Host();\r\n \t \t \t\r\n \thttpServer = HttpServer.create(new InetSocketAddress(puerto), 0);\r\n \t\r\n \thttpServer.createContext(\"/\", new Principal());\t\t//esta es la pagina principal\r\n \thttpServer.createContext(\"/apagado\", new Apagado());\r\n \thttpServer.createContext(\"/descarga\", new Descarga());// llama a la pagina como video1.mp4\r\n \thttpServer.createContext(\"/openFileDialog\", new OpenFileDialog());\r\n \r\n \thttpServer.setExecutor(null);\r\n \thttpServer.start();\r\n \t\r\n\r\n \thost.abreLocalHost();\r\n \thost.cargaGPIO();\r\n\t}", "private CloseableHttpClient getHttpClient() {\n return HttpClients.custom()\n .setConnectionManager(httpClientConnectionManager)\n .setConnectionManagerShared(true)\n .build();\n }", "public TestHttpServer (HttpCallback cb, int threads, int cperthread)\n throws IOException {\n this (cb, threads, cperthread, 0);\n }", "private void handleHttpRequest(ChannelHandlerContext ctx, HttpRequest req) throws Exception {\n\t\tif (req.getMethod() != HttpMethod.GET) {\n\t\t\tresponseSender.sendResponse(ctx.getChannel(), HttpResponseStatus.FORBIDDEN);\n\t\t\treturn;\n\t\t}\n\n\t\t// Send the demo page and favicon.ico\n\t\tif (req.getUri().equals(\"/\")) {\n\t\t\tresponseSender.sendResponse(ctx.getChannel(), HttpResponseStatus.OK, WebSocketServerIndexPage.getContent(getWebSocketLocation(req)), \"UTF-8\",\n\t\t\t\t\t\"text/html; charset=UTF-8\");\n\t\t\treturn;\n\t\t} else if (req.getUri().equals(\"/favicon.ico\")) {\n\t\t\tresponseSender.sendResponse(ctx.getChannel(), HttpResponseStatus.NOT_FOUND);\n\t\t\treturn;\n\t\t}\n\n\t\t// Handshake\n\t\tWebSocketServerHandshakerFactory wsFactory = new WebSocketServerHandshakerFactory(getWebSocketLocation(req), null, false);\n\t\thandshaker = wsFactory.newHandshaker(req);\n\t\tif (handshaker == null) {\n\t\t\twsFactory.sendUnsupportedWebSocketVersionResponse(ctx.getChannel());\n\t\t} else {\n\t\t\thandshaker.handshake(ctx.getChannel(), req).addListener(WebSocketServerHandshaker.HANDSHAKE_LISTENER);\n\t\t}\n\t}", "@Override\n\tpublic void run(){\n\t\tSystem.out.println(\"run\");\n\t\ttry {\n\t\t\tString firstLine = inFromClient.readLine();\n\t\t\tSystem.out.println(\"Received: \" + firstLine);\n\n\t\t\tboolean badRequest = false;\n\t\t\tString[] array = firstLine.split(\" \");\n\t\t\tString HTTPcommand = array[0];\n\t\t\tString URI = array[1];\n\t\t\tString HTTPversion = array[2];\n\t\t\tString path = \"\";\n\t\t\t\n\t\t\tint indexSlash = URI.lastIndexOf(\"/\");\n\t\t\tSystem.out.println(indexSlash);\n\t\t\tpath = URI.substring(indexSlash+1, URI.length());\n\n\t\t\t\n\t\t\tString secondLine = inFromClient.readLine();\n\t\t\tif (!HTTPversion.equals(\"HTTP/1.1\")) {\n\t\t\t\tbadRequest = true;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif (badRequest) {\n\t\t\t\tout.println(\"HTTP/1.1 400 Bad Request\");\n\t\t\t\tout.println('\\r' + '\\n' + '\\r' + '\\n');\n\t\t\t\tout.flush();\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\tswitch(HTTPcommand){\n\t\t\t\tcase \"HEAD\": Head.head(clientSocket, inFromClient, out, path);\n\t\t\t\tbreak;\n\n\t\t\t\tcase \"GET\": Get.get(clientSocket, inFromClient, out, path);\n\t\t\t\tbreak;\n\n\t\t\t\tcase \"PUT\": {\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println('\\r' + '\\n' + '\\r' + '\\n');\n\t\t\t\t\tout.flush();\n\t\t\t\t\tString Line3 = inFromClient.readLine();\n\t\t\t\t\tString Line4 = inFromClient.readLine();\n\t\t\t\t\tString Line5 = inFromClient.readLine();\n\t\t\t\t\tPut.put(inFromClient, path);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t\tcase \"POST\": {\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println('\\r' + '\\n' + '\\r' + '\\n');\n\t\t\t\t\tout.flush();\n\t\t\t\t\tString Line3 = inFromClient.readLine();\n\t\t\t\t\tString Line4 = inFromClient.readLine();\n\t\t\t\t\tString Line5 = inFromClient.readLine();\n\t\t\t\t\tPost.post(inFromClient, path);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tdefault: {\n\t\t\t\t\tout.println(\"HTTP/1.1 501 Not Implemented\");\n\t\t\t\t\tout.println('\\r' + '\\n' + '\\r' + '\\n');\n\t\t\t\t\tout.flush();\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\n\t\t//run();\n\n\t\t//inFromClient.close();\n\t\t//serverSocket.close();\n\t}", "public static AsyncHttpServer createProxyHttpServer(final NioEventloop primaryEventloop,\n\t final HttpClientImpl httpClient) {\n\t\treturn new AsyncHttpServer(primaryEventloop, new AsyncHttpServlet() {\n\t\t\t@Override\n\t\t\tpublic void serveAsync(HttpRequest request, final ResultCallback<HttpResponse> callback) {\n\t\t\t\thttpClient.getHttpResultAsync(HttpRequest.get(REDIRECT_ADDRESS + request.getUrl().getPath()), 1000,\n\t\t\t\t\t\tnew ResultCallback<HttpResponse>() {\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void onResult(final HttpResponse result) {\n\t\t\t\t\t\t\t\tHttpResponse res = HttpResponse.create(result.getCode());\n\t\t\t\t\t\t\t\tres.body(encodeAscii(\"FORWARDED: \" + decodeAscii(result.getBody())));\n\t\t\t\t\t\t\t\tcallback.onResult(res);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void onException(Exception exception) {\n\t\t\t\t\t\t\t\tcallback.onException(exception);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "@SuppressWarnings(\"java:S2189\")\n public static void main(String[] args) {\n ExecutorService executorService = Executors.newFixedThreadPool(4);\n try (ServerSocket serverSocket = new ServerSocket(8080)) {\n log.info(\"Waiting For New Clients...\");\n while (true) {\n Socket sock = serverSocket.accept();\n log.info(\"Connected to a client...\");\n executorService.execute(new ServeRequests(sock));\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void handleHttpRequest(ChannelHandlerContext ctx, FullHttpRequest req) throws Exception {\n if (!req.getDecoderResult().isSuccess()) {\n sendHttpResponse(ctx, req, new DefaultFullHttpResponse(HTTP_1_1, BAD_REQUEST));\n return;\n }\n\n // Allow only GET methods.\n if (req.getMethod() != GET) {\n sendHttpResponse(ctx, req, new DefaultFullHttpResponse(HTTP_1_1, FORBIDDEN));\n return;\n }\n\n // Send the demo page and favicon.ico\n if (\"/\".equals(req.getUri())) {\n ByteBuf content = getContent(getWebSocketLocation(req));\n FullHttpResponse res = new DefaultFullHttpResponse(HTTP_1_1, OK, content);\n res.headers().set(CONTENT_TYPE, \"text/html; charset=UTF-8\");\n setContentLength(res, content.readableBytes());\n sendHttpResponse(ctx, req, res);\n return;\n }\n if (\"/favicon.ico\".equals(req.getUri())) {\n FullHttpResponse res = new DefaultFullHttpResponse(HTTP_1_1, NOT_FOUND);\n sendHttpResponse(ctx, req, res);\n return;\n }\n\n Channel channel = ctx.channel();\n\n QueryStringDecoder dec = new QueryStringDecoder(req.getUri());\n String username = dec.parameters().get(\"username\").get(0);\n String page = dec.parameters().get(\"page\").get(0);\n channel.attr(WebSocketServer.USERNAME).set(username);\n Archon.getInstance().getLogger().warning(Thread.currentThread().getName() + \" [WS] channel username for \" + channel + \": \" + username + \" - page=\" + page);\n\n // Handshake\n WebSocketServerHandshakerFactory wsFactory = new WebSocketServerHandshakerFactory(getWebSocketLocation(req), null, false);\n handshaker = wsFactory.newHandshaker(req);\n if (handshaker == null) {\n WebSocketServerHandshakerFactory.sendUnsupportedWebSocketVersionResponse(ctx.channel());\n } else {\n handshaker.handshake(ctx.channel(), req).addListener((ChannelFutureListener) future -> {\n Channel channel1 = future.channel();\n if (future.isSuccess()) {\n channel1.attr(WebSocketServer.REGISTERED).set(true);\n server.addChannel(channel1);\n } else {\n future.channel().attr(WebSocketServer.REGISTERED).set(false);\n Archon.getInstance().getLogger().log(Level.WARNING, Thread.currentThread().getName() + \" [WS] Failed to register channel (handshake): \" + channel1, future.cause());\n }\n });\n }\n }", "private void init() throws IOReactorException {\n IOReactorConfig ioReactorConfig = IOReactorConfig.custom()\n .setIoThreadCount(Runtime.getRuntime().availableProcessors())\n .setConnectTimeout(BaseConstants.TIMEOUT_SECONDS * 1000)\n .setSoTimeout(BaseConstants.TIMEOUT_SECONDS * 1000)\n .build();\n\n // Create a custom I/O reactort\n ConnectingIOReactor ioReactor = new DefaultConnectingIOReactor(ioReactorConfig);\n PoolingNHttpClientConnectionManager connManager = new PoolingNHttpClientConnectionManager(ioReactor);\n // Configure total max or per route limits for persistent connections\n // that can be kept in the pool or leased by the connection manager.\n connManager.setMaxTotal(100);\n connManager.setDefaultMaxPerRoute(100);\n\n HttpAsyncClientBuilder clientBuilder = HttpAsyncClients.custom();\n RequestConfig.Builder requestConfig = RequestConfig.custom();\n // 连接超时,连接建立时间\n requestConfig.setConnectTimeout(BaseConstants.TIMEOUT_SECONDS * 1000);\n // 请求超时,数据传输过程中数据包之间间隔的最大时间\n requestConfig.setSocketTimeout(BaseConstants.TIMEOUT_SECONDS * 1000);\n // 使用连接池来管理连接,从连接池获取连接的超时时间\n requestConfig.setConnectionRequestTimeout(BaseConstants.TIMEOUT_SECONDS * 1000);\n clientBuilder.setConnectionManager(connManager);\n clientBuilder.setDefaultRequestConfig(requestConfig.build());\n httpclient = clientBuilder.build();\n }", "@Override\n public void run() {\n\n final HttpProxy httpProxy = this.createHttpServerConnection();\n\n //Read the request from the socket and send it to the HTTP server\n final byte[] message = unixSocket.read();\n LOGGER.debug(\"Received message on socket: {}\", new String(message, UTF_8));\n httpProxy.sendRequest(message);\n\n //Return the HTTP response to the socket\n final byte[] response = httpProxy.getResponse();\n LOGGER.debug(\"Received http response: {}\", new String(response, UTF_8));\n unixSocket.write(response);\n\n unixSocket.close();\n httpProxy.disconnect();\n }", "public void run() {\n\t\ttry {\n\t\t\t// Get input and output streams to talk to the client\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(csocket.getInputStream()));\n\t\t\tPrintWriter out = new PrintWriter(csocket.getOutputStream());\n\t\t\t/*\n\t\t\t * read the input lines from client and perform respective action based on the\n\t\t\t * request\n\t\t\t */\n\t\t\tString line;\n\t\t\twhile ((line = in.readLine()) != null) {\n\t\t\t\t// return if all the lines are read\n\t\t\t\tif (line.length() == 0)\n\t\t\t\t\tbreak;\n\t\t\t\telse if (line.contains(\"GET\") && line.contains(\"/index.html\")) {\n\t\t\t\t\t/*\n\t\t\t\t\t * get the respective file requested by the client i.e index.html\n\t\t\t\t\t */\n\t\t\t\t\tFile file = new File(WEB_ROOT, \"/index.html\");\n\t\t\t\t\t// send HTTP Headers\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println(\"Date: \" + new Date());\n\t\t\t\t\tout.println(\"Content-length: \" + file.length());\n\t\t\t\t\tout.println(); // blank line between headers and content\n\t\t\t\t\tout.flush(); // flush character output stream buffer\n\t\t\t\t\tout.write(FileUtils.readFileToString(file, \"UTF-8\"), 0, ((int) file.length()));\n\t\t\t\t} else if (line.contains(\"PUT\")) {\n\t\t\t\t\t/*\n\t\t\t\t\t * put the respective file at a location on local\n\t\t\t\t\t */\n\t\t\t\t\tString[] split = line.split(\" \");\n\t\t\t\t\tFile source = new File(split[1]);\n\t\t\t\t\tFile dest = new File(WEB_ROOT, \"clientFile.html\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// copy the file to local storage\n\t\t\t\t\t\tFileUtils.copyFile(source, dest);\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t// send HTTP Headers\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println(\"Date: \" + new Date());\n\t\t\t\t\tout.println(); // blank line between headers and content\n\t\t\t\t\tout.flush(); // flush character output stream buffer\n\t\t\t\t} else {\n\t\t\t\t\tout.print(line + \"\\r\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// closing the input and output streams\n\t\t\tout.close(); // Flush and close the output stream\n\t\t\tin.close(); // Close the input stream\n\t\t\tcsocket.close(); // Close the socket itself\n\t\t} // If anything goes wrong, print an error message\n\t\tcatch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t\tSystem.err.println(\"Usage: java HttpMirror <port>\");\n\t\t}\n\t}", "public TestHttpServer (HttpCallback cb, int threads, int cperthread, int port)\n throws IOException {\n schan = ServerSocketChannel.open ();\n InetSocketAddress addr = new InetSocketAddress (port);\n schan.socket().bind (addr);\n this.threads = threads;\n this.cb = cb;\n this.cperthread = cperthread;\n servers = new Server [threads];\n for (int i=0; i<threads; i++) {\n servers[i] = new Server (cb, schan, cperthread);\n servers[i].start();\n }\n }", "public static Object httpClient() {\n return new Object();\n// return HttpClient.newBuilder()\n// .version(HttpClient.Version.HTTP_1_1)\n// .followRedirects(HttpClient.Redirect.NORMAL)\n// .connectTimeout(Duration.ofSeconds(300))\n// .build();\n }", "protected HttpClient getHttpClient( ) {\r\n\t\treturn httpClient;\r\n\t}", "public static HttpClient Factory() {\n\t\treturn httpclient;\n\t}", "@Bean\n\tpublic HttpClient httpClient() {\n\t\treturn new HttpClient(this.multiThreadedHttpConnectionManager);\n\t}", "public void httpclient(String url){\n\t\t\r\n\t\t\r\n\t\tString httpUrl =BASIC_URL+url;\r\n\t\t\r\n\t\tSystem.out.println(httpUrl);\r\n\t\t\r\n\t\tHttpGet method =new HttpGet(httpUrl);\r\n\t\t\r\n\t\tmethod.setHeader(\"Content-Type\",\"application/json\");\r\n\t\tmethod.setHeader(\"charset\",\"UTF-8\");\r\n\t\t\r\n\t\ttry {\r\n\t\t\tCloseableHttpResponse res =client.execute(method,context);\r\n\r\n\t\t AuthState targetAuthState = context.getTargetAuthState();\r\n\t\t System.out.println(\"Target auth state: \" + targetAuthState.getState());\r\n\t\t System.out.println(\"Target auth scheme: \" + targetAuthState.getAuthScheme());\r\n\t\t System.out.println(\"Target auth credentials: \" + targetAuthState.getCredentials());\r\n\t\t\t\r\n\t\t HttpEntity ent =res.getEntity();\r\n\t\t \r\n\t\t if (ent != null) { \r\n System.out.println(\"Response content length: \" + ent.getContentLength()); \r\n System.out.println(ent+\"3214242423\");\r\n \r\n System.out.println(EntityUtils.toString(ent));\r\n } \r\n\t\t \r\n\t\t} catch (IOException e) {\r\n\t\t\t\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public void run() {\n // variables to store key HTTP(S) request information\n String sReadLine;\n boolean bNewHTTPHeader = true;\n String sHTTPMethod = \"\";\n String sHTTPRequest = \"\";\n boolean bPersistentConnection = true;\n\n // print the client IP:port\n System.out.println(\"client \" + connectedClient.getInetAddress() + \":\"\n + connectedClient.getPort() + \" is connected\");\n System.out.println();\n\n // create BufferedReader to read in from socket & DataOutputStream to send out to socket\n try {\n inFromClient = new BufferedReader(new InputStreamReader(connectedClient.getInputStream()));\n outToClient = new DataOutputStream(connectedClient.getOutputStream());\n\n } catch (IOException e) {\n System.out.println(\"There was an error setting up the buffered reader, \" +\n \"data stream, or reading from the client:\");\n System.out.println(\" \" + e);\n }\n\n // process the HTTP(S) request\n try {\n // break apart the input to read the http method and request\n while ((sReadLine = inFromClient.readLine()) != null) {\n // create a tokenizer to parse the string\n StringTokenizer tokenizer = new StringTokenizer(sReadLine);\n\n // if new HTTP header, then pull out the Method and Request (first line)\n if (bNewHTTPHeader) {\n sHTTPMethod = tokenizer.nextToken().toUpperCase(); // HTTP method: GET, HEAD\n sHTTPRequest = tokenizer.nextToken().toLowerCase(); // HTTP query: file path\n bNewHTTPHeader = false; // next lines are not part of a new HTTP header\n\n // print to console\n System.out.println(\"New HTTP Header:\");\n System.out.println(\" HTTP Method: \" + sHTTPMethod);\n System.out.println(\" HTTP Request: \" + sHTTPRequest);\n\n // not a new HTTP header: check for key params Connection or empty line\n } else if (sReadLine.length() > 0) {\n // get the next token in the input line\n String sParam = tokenizer.nextToken();\n\n // check to update connection status\n if (sParam.equalsIgnoreCase(\"Connection:\")) {\n String sConnectionRequest = tokenizer.nextToken();\n bPersistentConnection = (sConnectionRequest.equalsIgnoreCase(\"keep-alive\"));\n // print param to console\n System.out.println(\" param: \" + sParam + \" \" + sConnectionRequest);\n } else {\n // otherwise just print param to console\n System.out.println(\" param: \" + sParam);\n }\n\n // no more lines to header: header is over\n } else {\n //print to console\n System.out.println(\"End of Header\");\n System.out.println();\n\n // get the status code & response, then send back to client\n int iStatusCode = getStatusCode(sHTTPMethod, sHTTPRequest);\n String sResponse = getResponse(sHTTPMethod, sHTTPRequest, iStatusCode);\n sendResponse(sHTTPMethod, sHTTPRequest, iStatusCode, sResponse, bPersistentConnection);\n\n // next line is part of a new HTTP header\n bNewHTTPHeader = true;\n }\n }\n\n // loop has ended: client input is null (client must want to disconnect)\n this.connectedClient.close();\n System.out.println(\"input from client \" + connectedClient.getInetAddress() +\n + connectedClient.getPort() + \" is null. This socket closed.\");\n } catch (IOException e) {\n System.out.println(\"There was an error reading the HTTP request:\");\n System.out.println(\" \" + e);\n }\n }", "List<HttpServletServer> getHttpServers();", "public static void main(String[] args) throws IOException {\n\t\tif(args.length != 2)\n\t\t{\n\t\t\tusage();\n\t\t\treturn;\n\t\t}\n\t\tHttpServer server = new HttpServer(Integer.parseInt(args[0]), new FileServer(args[1]));\n\t\tserver.setAllowedMethods(new String[] { \"GET\", \"HEAD\" });\n\t\tserver.setName(\"info.ziyan.net.httpserver.example.FileServer/1.0\");\n\t\tserver.start();\n\t}", "private void handleHttpRequest(ChannelHandlerContext ctx, FullHttpRequest req) throws Exception {\n if (!req.decoderResult().isSuccess()) {\n sendHttpResponse(ctx, req, new DefaultFullHttpResponse(HTTP_1_1, BAD_REQUEST));\n return;\n }\n\n // Allow only GET methods.\n if (req.method() != GET) {\n sendHttpResponse(ctx, req, new DefaultFullHttpResponse(HTTP_1_1, FORBIDDEN));\n return;\n }\n\n // route handler\n if (\"/ws\".equals(req.uri())) {\n WebSocketServerHandshakerFactory wsFactory = new WebSocketServerHandshakerFactory(\n \"ws://\" + req.headers().get(HOST) + \"/ws\", null, false);\n handshaker = wsFactory.newHandshaker(req);\n if (handshaker == null) {\n WebSocketServerHandshakerFactory.sendUnsupportedVersionResponse(ctx.channel());\n } else {\n handshaker.handshake(ctx.channel(), req);\n addCtx(ctx, req.headers());\n }\n } else {\n handleFileRequest(ctx, req);\n }\n }", "protected HttpClient getClient() {\n if (client == null) {\n synchronized (this) {\n if (client == null) {\n client = new DefaultHttpClient(conman, params);\n }\n }\n }\n\n return client;\n }", "public void establishConnection() {\n httpNetworkService = new HTTPNetworkService(handler);\n }", "void doClientSide() throws Exception {\n\n\t\tSSLSocketFactory sslsf = (SSLSocketFactory) SSLSocketFactory\n\t\t\t\t.getDefault();\n\t\tSSLSocket sslSocket = (SSLSocket) sslsf.createSocket(theServerName,\n\t\t\t\t12345);\n\t\t\n\t\tOutputStream sslOS = sslSocket.getOutputStream();\n\t\tsslOS.write(\"Hello SSL Server\".getBytes()); // Write to the Server\n\t\tsslOS.flush();\n\t\tsslSocket.close();\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 }", "private DefaultHttpClient createHttpClient()\n throws IOException\n {\n XCapCredentialsProvider credentialsProvider\n = new XCapCredentialsProvider();\n credentialsProvider.setCredentials(\n AuthScope.ANY,\n new UsernamePasswordCredentials(getUserName(), password));\n\n return HttpUtils.getHttpClient(\n null , null, uri.getHost(), credentialsProvider);\n }", "public void processHTTP(Socket clientSocket, OutputStream out, BufferedReader in) throws InterruptedException, OneThreadLeftException{\n\t\ttry{\n\t\t\t// Create out and in objects to write and read to/from socket\n\t\t\tout = clientSocket.getOutputStream();\n\t\t\tin = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));\n\n\t\t\tString[] inputLine = new String[32]; // According to Wikipedia, there are 31 defined HTTP request lines\n\t\t\tString relPath, absPath;\n\t\t\tint i = 1;\n\t\t\tString[] toCheckLine = new String[10];\n\t\t\tDate toCompareMod = new Date();\n\t\t\tDate toCompareUnmod = new Date();\n\t\t\ttoCompareMod = null;\n\t\t\ttoCompareUnmod = null;\n\t\t\tboolean noHostHeader = true;\n\t\t\tint contentLen = 0;\n\n\t\t\t// If there is an input from the socket, then process it:\n\t\t\tif(!(inputLine[0] = in.readLine()).equals(null)) { \n\t\t\t\twhile(!(inputLine[i] = in.readLine()).equals(\"\")){\n\t\t\t\t\tSystem.out.println(inputLine[i]);\n\t\t\t\t\ttoCheckLine = inputLine[i].split(\" \");\n\t\t\t\t\tif((toCheckLine[0]).equals(\"If-Modified-Since:\")){\n\t\t\t\t\t\ttoCompareMod = processIfModifiedSince(toCheckLine);\n\t\t\t\t\t}\n\t\t\t\t\telse if((toCheckLine[0]).equals(\"If-Unmodified-Since:\")){\n\t\t\t\t\t\ttoCompareUnmod = processIfModifiedSince(toCheckLine);\n\t\t\t\t\t}\n\n\t\t\t\t\t// to handle Host: requirement for version 1.1\n\t\t\t\t\tif((toCheckLine[0]).equals(\"Host:\")){\n\t\t\t\t\t\tnoHostHeader = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// To get content-length for cleaner processing of POST request\n\t\t\t\t\tif((toCheckLine[0]).equals(\"Content-Length:\")){\n\t\t\t\t\t\tcontentLen = Integer.parseInt(toCheckLine[1].trim());\n\t\t\t\t\t}\n\n\t\t\t\t\ti++;\n\t\t\t\t}\n\n\t\t\t\t// Parse input line\n\t\t\t\tString[] splits = (inputLine[0]).split(\" \",3);\n\t\t\t\tThreadPool.registerURI(Thread.currentThread().getId(), splits[1]);\n\t\t\t\tString parentPath = splits[1]; \n\t\t\t\trelPath = splits[1].replaceAll(\"/\", \",\"); \n\t\t\t\tString[] relDirs = relPath.split(\",\",10);\n\t\t\t\tString fileName = relDirs[relDirs.length-1];\n\t\t\t\tabsPath = mRootDir+\"/\";\n\n\t\t\t\t// Check if the client has requested for a servlet to be run\n\t\t\t\tString requestType = splits[0];\n\n\t\t\t\t// In case of POST request\n\t\t\t\tString postBody = \"\";\n\t\t\t\t\n\t\t\t\tif(requestType.equals(\"POST\")){\n\t\t\t\t\tchar[] tempBuf = new char[contentLen];\n\t\t\t\t\tin.read(tempBuf,0,contentLen);\n\t\t\t\t\tpostBody = new String(tempBuf);\n\t\t\t\t\t//System.out.println(\"Postbody before: \"+postBody);\n\t\t\t\t\t//postBody = URLDecoder.decode(postBody, \"utf-8\");\n\t\t\t\t\t//System.out.println(\"Postbody after: \"+postBody);\n\n\t\t\t\t}\n\n\t\t\t\tif(requestType.equals(\"GET\") || requestType.equals(\"HEAD\") || requestType.equals(\"POST\")){\n\t\t\t\t\tString[] wrapperArgs = {mPathToXml, requestType, parentPath};\n\t\t\t\t\ttry{\n\t\t\t\t\t\tif(TestHarness.servletWrapper(wrapperArgs, inputLine, out, postBody, absPath) != 0)\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Check that request conforms to HTTP GET/HEAD request format before further processing\n\t\t\t\tif(splits[0].equals(\"GET\") || splits[0].equals(\"HEAD\")){\n\n\n\t\t\t\t\t/*\n\t\t\t\t\t// If HTTP/1.1, we want to check for Host header\n\t\t\t\t\t// This block verifies that, if it is version 1.1 then Host header must be there\n\t\t\t\t\tString[] version = splits[2].split(\"/\");\n\t\t\t\t\tif(version[1].trim().equals(\"1.1\")){\n\t\t\t\t\t\tif(noHostHeader == true){\n\t\t\t\t\t\t\tString source = \"<html><body><h2>No Host: header received</h2>HTTP 1.1 requests must include the Host: header.</body></html>\";\n\t\t\t\t\t\t\tout.write(\"HTTP/1.1 400 Bad Request\\r\\n\".getBytes(\"UTF-8\"));\n\t\t\t\t\t\t\tout.write(\"Content-Type: text/html\\r\\n\".getBytes(\"UTF-8\"));\n\t\t\t\t\t\t\tout.write((\"Content-Length: \"+source.length()+\"\\r\\n\").getBytes(\"UTF-8\"));\n\t\t\t\t\t\t\tout.write((\"Connection: close\\r\\n\\r\\n\").getBytes(\"UTF-8\"));\n\t\t\t\t\t\t\tout.write(source.getBytes(\"UTF-8\"));\n\t\t\t\t\t\t\tout.close();\n\t\t\t\t\t\t\tin.close();\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\t */\n\n\n\t\t\t\t\t// Check if the request is a GET request\n\t\t\t\t\tif(splits[0].equals(\"GET\")){\n\t\t\t\t\t\tprocessGET(absPath, relDirs, parentPath, splits, out, in, toCompareMod, toCompareUnmod);\n\t\t\t\t\t}\n\t\t\t\t\t// If not, check if the request is a HEAD request\n\t\t\t\t\telse if(splits[0].equals(\"HEAD\")){\n\t\t\t\t\t\tprocessHEAD(absPath, out, in, toCompareUnmod);\n\t\t\t\t\t}\n\t\t\t\t\t// If not GET or HEAD, the method is not implemented in this server\n\t\t\t\t\telse{\n\t\t\t\t\t\tout.write(\"HTTP/1.1 501 Not Implemented\\r\\n\\r\\n\".getBytes(\"UTF-8\"));\n\t\t\t\t\t\tout.write((\"Connection: close\\r\\n\\r\\n\").getBytes(\"UTF-8\"));\n\t\t\t\t\t}\n\n\t\t\t\t\t// Clean up\n\t\t\t\t\tin.close();\n\t\t\t\t\tout.close();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(IOException e){\n\t\t\tSystem.out.println(\"Thread ID: \"+ Thread.currentThread().getId());\n\t\t\tSystem.out.println(\"caught at buf in block, message: \"+e.getMessage());\n\t\t\treturn;\n\t\t}\n\t\tcatch(AllThreadsTerminatedException AllTe){\n\t\t\ttry{\n\t\t\t\tout.close();\n\t\t\t\tin.close();\n\t\t\t}\n\t\t\tcatch(IOException IOE){\n\n\t\t\t}\n\t\t\tthrow new OneThreadLeftException();\n\t\t}\n\n\t}", "private DefaultHttpClient createHttpsClient() throws HttpException {\n DefaultHttpClient client = new DefaultHttpClient();\n SSLContext ctx = null;\n X509TrustManager tm = new TrustAnyTrustManager();\n try {\n ctx = SSLContext.getInstance(\"TLS\");\n ctx.init(null, new TrustManager[] { tm }, null);\n } catch (NoSuchAlgorithmException | KeyManagementException e) {\n throw new HttpException(\"Can't create a Trust Manager.\", e);\n }\n SSLSocketFactory ssf = new SSLSocketFactory(ctx, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);\n client.getConnectionManager().getSchemeRegistry().register(new Scheme(\"https\", 443, ssf));\n return client;\n }", "public static Client getHttpClient() {\r\n return c;\r\n }", "public void init(){\n\t\tmultiplexingClientServer = new MultiplexingClientServer(selectorCreator);\n\t}", "private void startServer(String ip, int port, String contentFolder) throws IOException{\n HttpServer server = HttpServer.create(new InetSocketAddress(ip, port), 0);\n \n //Making / the root directory of the webserver\n server.createContext(\"/\", new Handler(contentFolder));\n //Making /log a dynamic page that uses LogHandler\n server.createContext(\"/log\", new LogHandler());\n //Making /online a dynamic page that uses OnlineUsersHandler\n server.createContext(\"/online\", new OnlineUsersHandler());\n server.setExecutor(null);\n server.start();\n \n //Needing loggin info here!\n }", "public WebServer(Music music, int port) throws IOException {\n this.music = music;\n this.server = HttpServer.create(new InetSocketAddress(port), 0);\n \n // handle concurrent requests with multiple threads\n server.setExecutor(Executors.newCachedThreadPool());\n server.start();\n String hostName = LOCALHOST;\n for (NetworkInterface iface : Collections.list(NetworkInterface.getNetworkInterfaces())) {\n for (InetAddress address: Collections.list(iface.getInetAddresses())) {\n if (address instanceof Inet4Address) { \n if (!address.getHostName().equals(LOCALHOST)) {\n System.out.println(\"Address: \" + address.getHostName());\n hostName = address.getHostName();\n }\n }\n }\n }\n \n for (String voice : music.getVoices()) {\n //handle requests for paths that start with /look/\n System.out.println(\" In your web browser, navigate to\\n\" + hostName + \":\" + port + \"/\" + voice + \"/\" + \"\\n to access the lyrics stream for this voice.\"); \n server.createContext(\"/\" + voice + \"/\", exchange -> {\n try {\n handleClient(exchange);\n } catch (MidiUnavailableException e) {\n throw new RuntimeException(\"Midi Unavailable\");\n } catch (InvalidMidiDataException e) {\n throw new RuntimeException(\"Invalid Midi Data\");\n } catch (InterruptedException e) {\n throw new RuntimeException(\"Interrupted\");\n }\n });\n }\n checkRep();\n }", "public static void main(String[] args) {\n\t\t\n\t\tif(args.length != 4){\n\t\t\tSystem.out.println(\"Program takes 4 arguments. Usage: java HttpClient localhost <port number> <Request Type(GET/PUT)> <filepath>\");\n\t\t}else{\n\t\t\tif (!isNumeric(args[1]))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Please enter valid Port no\");\n\t\t\t\treturn;\n\t\t\t}\n String hostName = args[0];\n\t\t\tint portNo = Integer.parseInt(args[1]);\n\t\t\tString requestType = args[2];\n\t\t\tString filePath = args[3];\n\t\t\tObjectOutputStream outs;\n\t\t\tObjectInputStream ins;\n\t\t\t\n\t\ttry {\n \n\t\t\tSocket socket = new Socket(hostName, portNo);\n\t\t\tSystem.out.println(\"\\n\" + \"Connected to Server on port \" + portNo);\n\t\t\t\n\t\t\touts = new ObjectOutputStream(socket.getOutputStream()); \n\t\t\tins = new ObjectInputStream(socket.getInputStream());\n\t\t\t\n\t\t\tif(requestType.equals(GET)){\n\t\t\t\tSystem.out.println(requestType + \" \" + filePath + \" HTTP/1.1\");\n\t\t\t\tSystem.out.println(\"Host:\" + hostName);\n\t\t\t\touts.writeObject(requestType + \" \" + filePath + \" HTTP/1.1\");\n\t\t\t\touts.writeObject(\"Host:\" + hostName);\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\tString response = (String) ins.readObject();\n\n\t\t\t\t\tSystem.out.println(\"Status: \" + response + \"\\n\");\n\t\t\t\t\tif ( response.equals(RESPONSE_OK)) \n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"Requested file contains : \\n\");\n\t\t\t\t\t\tSystem.out.println(\"-------------------------------------------------\");\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tString line = (String) ins.readObject();\n\t\t\t\t\t\t\twhile (line != null) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tSystem.out.println(line);\n\t\t\t\t\t\t\t\tline = (String) ins.readObject();\n\t\t\t\t\t\t\t}\n \n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tcatch(EOFException e)\n\t\t\t\t\t\t{\n System.out.println(\"-------------------------------------------------\");\n\t\t\t\t\t\t\tSystem.out.println(\"\\nFile is received\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println(response);\n\t\t\t\t\t\t}\n\t\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse if ( requestType.equals(PUT)) \n\t\t\t{\n\t\t\t\tFile file = new File(filePath); \n\t\t\t\tif (!(file.isDirectory()) && (file.exists()))\n\t\t\t\t{\n System.out.println(\"Sending the file: \" + file.getName() + \" to server....\\n\"); \n\t\t\t\t\touts.writeObject(requestType + \" \" + filePath + \" HTTP/1.1\");\n\t\t\t\t\t\n\t\t\t\t\tInputStream fis = new FileInputStream(file); \n\t\t\t\t\tbyte [] buffer = new byte[(int)file.length()];\n\n\t\t\t\t\tint noOfBytes = fis.read(buffer);\n\t\t\t\t\ttry{\n\t\t\t\t\t\tif(noOfBytes > 0)\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\touts.write(buffer, 0, noOfBytes);\n\t\t\t\t\t\t\touts.flush();\n\t\t\t\t\t\t\tSystem.out.println(\"File: \" + file.getName() + \" Sent\\n\\n\");\n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfis.close();\n\t\t\t\t\tSystem.out.println(\"Status Code from server: \" + ins.readObject() + \"\\n\");\n\t\t\t\t\tSystem.out.println(\"Status Message from server: \" + ins.readObject() + \"\\n\");\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\tSystem.out.println(\"File doesn't exist\\n\");\n\t\t\t\t\touts.writeObject(\"Invalid File\");\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Invalid Request type. Use only GET/PUT \\n\");\n\t\t\t\touts.writeObject(\"Invalid Request type\");\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Closing the Socket\");\n\t\t\t\n\t\t\touts.close();\n\t\t\tins.close();\t\t\t\n\t\t\tsocket.close();\n\t\t}\n\t\tcatch( Exception e )\n\t\t{\n\t\t\te.printStackTrace();\n\t\t} \n\t\t}\n\n\t}", "@Override\n public PooledHttpResponse serve(ServiceRequestContext ctx, PooledHttpRequest req) throws Exception {\n assert !(unwrap() instanceof PooledHttpService);\n return PooledHttpResponse.of(unwrap().serve(ctx, req));\n }", "@BeforeClass\n public static void createClient() {\n client = HttpClients.createDefault();\n }", "public HttpClientHelper() {\n defaultHeaders.put(\"Content-Type\", \"application/json\");\n defaultHeaders.put(\"Accept-Encoding\", \"gzip\");\n\n //postDefaultHeaders.put(\"Content-Type\", \"application/json\");\n //postDefaultHeaders.put(\"Content-Encoding\", \"gzip\");\n\n String key = MessageFormat.format(\"{0}#{1}\", UserUtil.getUserUuid(), UserUtil.getUserId());\n\n //postDefaultHeaders.put(\"X-CLIENT-KEY\", key);\n defaultHeaders.put(\"X-CLIENT-KEY\", key);\n client.setTimeout(3000);\n }", "protected abstract ClassicHttpResponse execute(ClassicHttpRequest request, HttpClientContext context) throws IOException;", "public CustomLoginFilter() {\n connectionManager = new MultiThreadedHttpConnectionManager();\n// httpClient = new HttpClient(connectionManager);\n\n// HostConfiguration hostConfiguration = new HostConfiguration();\n// hostConfiguration.setHost(HOST);\n// httpClient.setHostConfiguration(hostConfiguration);\n }", "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 GameServerClient(){\r\n\t\tinitComponents();\r\n\t\t}", "public static final DefaultHttpClient createHttpClient() {\n\t\treturn createHttpClient(3);\n\t}", "public void run()\n {\n Connection conn;\n Socket clientSock;\n int timeout;\n\n conn = new Connection();\n timeout = _config.getClientTimeout() * 1000;\n\n for ( ; ; ) {\n /*\n * Wait for connection request.\n */\n try {\n clientSock = _serverSock.accept();\n }\n catch(IOException e) {\n logError(\"accept() failure: \" + e.getMessage());\n continue;\n }\n\n try {\n clientSock.setSoTimeout(timeout);\n }\n catch(SocketException e) {\n logError(\"Cannot set timeout of client socket: \" + e.getMessage()\n + \" -- closing socket\");\n\n try {\n clientSock.close();\n }\n catch(IOException e2) {\n logError(\"Cannot close socket: \" + e2.getMessage());\n }\n continue;\n }\n\n /*\n * `Create' a new connection.\n */\n try {\n conn.init(clientSock);\n }\n catch(IOException e) {\n logError(\"Cannot open client streams\" + getExceptionMessage(e));\n try {\n clientSock.close();\n }\n catch(IOException e2) {\n logError(\"Cannot close client socket\" + getExceptionMessage(e2));\n }\n continue;\n }\n\n if (DEBUG && _debugLevel > 0) {\n debugPrintLn(\"Reading HTTP Request...\");\n }\n\n /*\n * `Create' a new container for the request.\n */\n setCurrentDate(_date);\n _req.init(conn, _clfDateFormatter.format(_date));\n\n // Get the current GAP list.\n _gapList = GlobeRedirector.getGAPList();\n\n processRequest(conn);\n\n /*\n * If access logging is enabled, write an entry to the access log.\n */\n if (_config.getAccessLogEnabledFlag()) {\n GlobeRedirector.accessLog.write(_req.getCommonLogFileStatistics());\n } \n\n if (DEBUG && _debugLevel > 1) {\n debugPrintLn(\"Closing client connection\");\n }\n\n try {\n conn.close();\n }\n catch(IOException e) {\n logError(\"Cannot close client connection\" + getExceptionMessage(e));\n }\n\n /*\n * Release references that are no longer needed. To reduce the\n * memory footprint, these references are released now because it\n * may take a long time before this thread handles a new request\n * (in which case the references are released too).\n */\n _gapList = null;\n _req.clear();\n _httpRespHdr.clear();\n _cookieCoords = null;\n }\n }", "ClientHandler(Socket socket) {\n this.client = socket;\n }", "public HttpConnector(JsonSystem system) {\r\n super(system);\r\n }", "public interface HttpClientInterface {\n byte[] post(String url, byte[] body);\n}", "public DefaultHttpRequestBuilder (final DefaultHttpClient client) {\r\n\t\tif (client == null) {\r\n\t\t\tthrow new NullPointerException (\"client cannot be null\");\r\n\t\t}\r\n\t\t\r\n\t\tthis.client = client;\r\n\t}", "public AbaloneClient() {\n server = new AbaloneServer();\n clientTUI = new AbaloneClientTUI();\n }", "public interface HttpHandler {\n public void handle(HttpExchange httpExchange) throws IOException;\n}", "void onHTTPRequest(HTTPRequest request, HTTPResponse response);", "private void setupHttpConnectionStuff() {\n if (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO) {\n System.setProperty(\"http.keepAlive\", \"false\");\n }\n if (Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH) {\n try {\n final File httpCacheDir = new File(getCacheDir(), \"http\");\n HttpResponseCache.install(httpCacheDir, TEN_MEGABYTES);\n } catch (IOException ioe) {\n Log.e(Constants.LOG_TAG, \"Could not install http cache on this device.\");\n }\n }\n }", "public ApplicationHostService(HttpContext httpContext, NewRelicClient client)\n {\n super(httpContext, client);\n }", "public HttpComponentsClientHttpRequest(HttpClient httpClient, HttpUriRequest httpRequest)\r\n/* 25: */ {\r\n/* 26:54 */ this.httpClient = httpClient;\r\n/* 27:55 */ this.httpRequest = httpRequest;\r\n/* 28: */ }", "public AsyncHttpServer(NioEventloop eventloop, AsyncHttpServlet servlet) {\n\t\tsuper(eventloop);\n\t\tthis.connectionsList = new ExposedLinkedList<>();\n\t\tthis.servlet = servlet;\n\t\tchar[] chars = eventloop.get(char[].class);\n\t\tif (chars == null || chars.length < MAX_HEADER_LINE_SIZE) {\n\t\t\tchars = new char[MAX_HEADER_LINE_SIZE];\n\t\t\teventloop.set(char[].class, chars);\n\t\t}\n\t\tthis.headerChars = chars;\n\t}", "IHttpService getHttpService();", "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 }", "protected static AuoServer getServer() {\n return server;\n }", "public Client() {\n initComponents();\n \n Server server = new Server();\n server.start();\n \n }", "public interface HttpResponseListener extends AsyncListener {\n /** The http header has been sent. \n * @param response the HttpHeader that was read\n * @param bufferHandle the BufferHandle that may or may not hold unread data.\n * @param keepalive if the sender want to use keepalive.\n * @param isChunked if false content is not chunked, \n * if true content is chunked.\n * @param dataSize the contents size or -1 if size is unknown.\n */\n void httpResponse (HttpHeader response, BufferHandle bufferHandle, \n\t\t boolean keepalive, boolean isChunked, long dataSize);\n \n}", "public static void main(String[] args){ new ThreadPoolBlockingServer().processRequests(); }", "private void serve() {\n\t\tif (request == null) {\n\t\t\tchannel.close();\n\t\t\treturn;\n\t\t}\n\t\tlogger.fine(\"Serving \" + type + \" request : \" + request.getPath());\n\t\tResponse resp = RequestHandler.handle(request);\n\t\tif (resp.getRespCode() == ResponseCode.NOT_FOUND) {\n\t\t\terror404(resp);\n\t\t\treturn;\n\t\t}\n\n\t\tStringBuilder header = new StringBuilder();\n\t\tif (type == Type.HTTP) {\n\t\t\theader.append(\"HTTP/1.0 200 OK\\r\\n\");\n\t\t\theader.append(\"Content-Length: \")\n\t\t\t\t\t.append(resp.getFileData().remaining()).append(\"\\r\\n\");\n\t\t\theader.append(\"Connection: close\\r\\n\");\n\t\t\theader.append(\"Server: Hyperion/1.0\\r\\n\");\n\t\t\theader.append(\"Content-Type: \" + resp.getMimeType() + \"\\r\\n\");\n\t\t\theader.append(\"\\r\\n\");\n\t\t}\n\t\tbyte[] headerBytes = header.toString().getBytes();\n\n\t\tByteBuffer bb = resp.getFileData();\n\t\tChannelBuffer ib = ChannelBuffers.buffer(bb.remaining()\n\t\t\t\t+ headerBytes.length);\n\t\tib.writeBytes(headerBytes);\n\t\tib.writeBytes(bb);\n\t\tchannel.write(ib).addListener(ChannelFutureListener.CLOSE);\n\t}", "public void run() {\r\n try {\r\n while (true) {\r\n Socket serverClient = serverSocket.accept(); //server accept the contentServerId connection request\r\n ServerClientThread sct = new ServerClientThread(serverClient, lamportClock, feeds, timers); //send the request to a separate thread\r\n sct.start();\r\n }\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }" ]
[ "0.62571096", "0.6183197", "0.61613446", "0.6148492", "0.6110891", "0.61091226", "0.6078195", "0.6058254", "0.60320276", "0.6030281", "0.60160786", "0.60077906", "0.593916", "0.5920629", "0.59196067", "0.59120476", "0.5898727", "0.58909196", "0.5885971", "0.58779347", "0.5865628", "0.58576983", "0.584711", "0.5842753", "0.5840872", "0.5826913", "0.5818118", "0.5808207", "0.5786263", "0.57716763", "0.5766536", "0.57515365", "0.5749862", "0.57450145", "0.5740228", "0.5738991", "0.5729226", "0.5727594", "0.5713169", "0.5710483", "0.57080996", "0.57067555", "0.56841624", "0.56672347", "0.5663578", "0.56411165", "0.561425", "0.56089026", "0.5608318", "0.55908763", "0.55803835", "0.5577238", "0.55762964", "0.5576122", "0.5574899", "0.5574389", "0.55725867", "0.55672765", "0.55600446", "0.55491006", "0.55476713", "0.554347", "0.5521405", "0.5520385", "0.5515808", "0.55053484", "0.54940677", "0.54916126", "0.54899853", "0.548447", "0.5479268", "0.54731387", "0.5471656", "0.54716444", "0.54611194", "0.5453863", "0.5452467", "0.54504937", "0.5443554", "0.5443496", "0.5436177", "0.54321814", "0.54299015", "0.5426374", "0.54183334", "0.5406371", "0.5403915", "0.5402562", "0.54005176", "0.5397596", "0.53957105", "0.5387664", "0.53850025", "0.5373914", "0.5370573", "0.5369596", "0.5365299", "0.53566664", "0.5355878", "0.5345093", "0.5342755" ]
0.0
-1
This test demonstrates the recognition of the words 'jackson cook' as forename and surname even though each individual word would have been recognized as city or profession respectively.
@Test public void testNamedEntityRecognitionWithoutCounterNeuron() { Model m = new Model(null, 1); // number of threads Neuron forenameCategory = m.createNeuron("C-forename"); Neuron surnameCategory = m.createNeuron("C-surname"); Neuron suppressingN = m.createNeuron("SUPPR"); // The word input neurons which do not yet possess a relational id. HashMap<String, Neuron> inputNeurons = new HashMap<>(); String[] words = new String[] { "mr.", "jackson", "cook", "was", "born", "in", "new", "york" }; for(String word: words) { Neuron in = m.createNeuron("W-" + word); inputNeurons.put(word, in); } // The entity neurons represent the concrete meanings of the input words. // The helper function 'initAndNeuron' computes the required bias for a // conjunction of the inputs. Neuron cookSurnameEntity = m.initNeuron( m.createNeuron("E-cook (surname)"), 3.0, // adjusts the bias new Input() // Requires the word to be recognized .setNeuron(inputNeurons.get("cook")) .setWeight(10.0f) // This input requires the input activation to have an // activation value of at least 0.9 .setBiasDelta(0.9) .setRelativeRid(0) // references the current word .setRecurrent(false) .setRangeMatch(EQUALS) .setRangeOutput(true), new Input() // The previous word needs to be a forename .setNeuron(forenameCategory) .setWeight(10.0f) .setBiasDelta(0.9) .setRelativeRid(-1) // references the previous word .setRecurrent(true) // this input is a positive feedback loop .setRangeMatch(NONE) .setRangeOutput(false), // This neuron may be suppressed by the E-cook (profession) neuron, but there is no // self suppression taking place even though 'E-cook (surname)' is also contained // in the suppressingN. new Input() .setNeuron(suppressingN) .setWeight(-20.0f) .setBiasDelta(1.0) .setRecurrent(true) // this input is a negative feedback loop .setRangeMatch(CONTAINS) ); Neuron cookProfessionEntity = m.initNeuron( m.createNeuron("E-cook (profession)"), 3.0, new Input() .setNeuron(inputNeurons.get("cook")) .setWeight(15.0f) .setBiasDelta(0.9) .setRecurrent(false) .setRangeMatch(EQUALS) .setRangeOutput(true), new Input() .setNeuron(suppressingN) .setWeight(-20.0f) .setBiasDelta(1.0) .setRecurrent(true) .setRangeMatch(CONTAINS) ); Neuron jacksonForenameEntity = m.initNeuron( m.createNeuron("E-jackson (forename)"), 3.0, new Input() .setNeuron(inputNeurons.get("jackson")) .setWeight(10.0f) .setBiasDelta(0.9) .setRelativeRid(0) .setRecurrent(false) .setRangeMatch(EQUALS) .setRangeOutput(true), new Input() .setNeuron(surnameCategory) .setWeight(10.0f) .setBiasDelta(0.9) .setRelativeRid(1) .setRecurrent(true) .setRangeMatch(NONE), new Input() .setNeuron(suppressingN) .setWeight(-20.0f) .setBiasDelta(1.0) .setRecurrent(true) .setRangeMatch(CONTAINED_IN) ); Neuron jacksonCityEntity = m.initNeuron( m.createNeuron("E-jackson (city)"), 3.0, new Input() .setNeuron(inputNeurons.get("jackson")) .setWeight(12.0f) .setBiasDelta(0.9) .setRecurrent(false) .setRangeMatch(EQUALS) .setRangeOutput(true), new Input() .setNeuron(suppressingN) .setWeight(-20.0f) .setBiasDelta(1.0) .setRecurrent(true) .setRangeMatch(CONTAINED_IN) ); m.initNeuron( forenameCategory, 0.0, new Input() // In this example there is only one forename considered. .setNeuron(jacksonForenameEntity) .setWeight(10.0f) .setBiasDelta(0.0) .setRelativeRid(0) .setRangeMatch(EQUALS) .setRangeOutput(true) ); m.initNeuron( surnameCategory, -0.001, new Input() .setNeuron(cookSurnameEntity) .setWeight(10.0f) .setBiasDelta(0.0) .setRelativeRid(0) .setRangeMatch(EQUALS) .setRangeOutput(true) ); m.initNeuron( suppressingN, -0.001, new Input().setNeuron(cookProfessionEntity) .setWeight(10.0f) .setBiasDelta(0.0) .setRangeMatch(EQUALS) .setRangeOutput(true), new Input() .setNeuron(cookSurnameEntity) .setWeight(10.0f) .setBiasDelta(0.0) .setRangeMatch(EQUALS) .setRangeOutput(true), new Input() .setNeuron(jacksonCityEntity) .setWeight(10.0f) .setBiasDelta(0.0) .setRangeMatch(EQUALS) .setRangeOutput(true), new Input() .setNeuron(jacksonForenameEntity) .setWeight(10.0f) .setBiasDelta(0.0) .setRangeMatch(EQUALS) .setRangeOutput(true) ); // Now that the model is complete, start processing an actual text. Document doc = m.createDocument("mr. jackson cook was born in new york "); int i = 0; int wordPos = 0; for(String w: doc.getContent().split(" ")) { int j = i + w.length(); // Feed the individual words as inputs into the network. inputNeurons.get(w).addInput(doc, i, j, wordPos); i = j + 1; wordPos++; } // Search for the best interpretation of this text. doc.process(); System.out.println(doc.neuronActivationsToString(true, false, true)); System.out.println(); System.out.println("Final Interpretation: " + doc.bestInterpretation.toString()); System.out.println(); System.out.println("Activations of the Surname Category:"); for(Activation act: surnameCategory.getFinalActivations(doc)) { System.out.print(act.key.r + " "); System.out.print(act.key.rid + " "); System.out.print(act.key.o + " "); System.out.print(act.key.n.neuron.get().label + " "); System.out.print(act.finalState.value); } doc.clearActivations(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testFullTextSearch_on_a_field() {\n ReadResponse resp = factual.fetch(TABLE,\n new Query().field(\"name\").search(\"Fried Chicken\"));\n\n for (String name : resp.mapStrings(\"name\")) {\n assertTrue(name.toLowerCase().contains(\"frie\")\n || name.toLowerCase().contains(\"fry\")\n || name.toLowerCase().contains(\"chicken\"));\n }\n }", "@Test\n public void testNamedEntityRecognitionWithCounterNeuron() {\n Model m = new Model(null, 1); // number of threads\n\n Neuron forenameCategory = m.createNeuron(\"C-forename\");\n Neuron surnameCategory = m.createNeuron(\"C-surname\");\n Neuron suppressingN = m.createNeuron(\"SUPPR\");\n\n // The following three neurons are used to assign each word activation\n // a relational id (rid). Here, the relational id specifies the\n // word position within the sentence.\n Neuron spaceN = m.createNeuron(\"SPACE\");\n Neuron startSignal = m.createNeuron(\"START-SIGNAL\");\n Neuron ctNeuron = m.initCounterNeuron(m.createNeuron(\"RID Counter\"),\n spaceN, // clock signal\n false, // direction of the clock signal (range end counts)\n startSignal, // start signal\n true, // direction of the start signal (range begin counts)\n false // direction of the counting neuron\n );\n // initCounterNeuron is just a convenience method which creates an ordinary neuron\n // with some input synapses.\n\n\n // The word input neurons which do not yet possess a relational id.\n HashMap<String, Neuron> inputNeurons = new HashMap<>();\n\n // The word input neurons with a relational id.\n HashMap<String, Neuron> relNeurons = new HashMap<>();\n\n\n String[] words = new String[] {\n \"mr.\", \"jackson\", \"cook\", \"was\", \"born\", \"in\", \"new\", \"york\"\n };\n for(String word: words) {\n Neuron in = m.createNeuron(\"W-\" + word);\n Neuron rn = m.initRelationalNeuron(\n m.createNeuron(\"WR-\" + word),\n ctNeuron, // RID Counting neuron\n in, // Input neuron\n false // Direction of the input neuron\n );\n\n inputNeurons.put(word, in);\n relNeurons.put(word, rn);\n }\n\n // The entity neurons represent the concrete meanings of the input words.\n // The helper function 'initAndNeuron' computes the required bias for a\n // conjunction of the inputs.\n Neuron cookSurnameEntity = m.initNeuron(\n m.createNeuron(\"E-cook (surname)\"),\n 3, // adjusts the bias\n new Input() // Requires the word to be recognized\n .setNeuron(relNeurons.get(\"cook\"))\n .setWeight(10.0f)\n // This input requires the input activation to have an\n // activation value of at least 0.9\n .setBiasDelta(0.9)\n .setRelativeRid(0) // references the current word\n .setRecurrent(false)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input() // The previous word needs to be a forename\n .setNeuron(forenameCategory)\n .setWeight(10.0f)\n .setBiasDelta(0.9)\n .setRelativeRid(-1) // references the previous word\n .setRecurrent(true) // this input is a positive feedback loop\n .setRangeMatch(NONE),\n\n // This neuron may be suppressed by the E-cook (profession) neuron, but there is no\n // self suppression taking place even though 'E-cook (surname)' is also contained\n // in the suppressingN.\n new Input()\n .setNeuron(suppressingN)\n .setWeight(-20.0f)\n .setBiasDelta(1.0)\n .setRecurrent(true) // this input is a negative feedback loop\n .setRangeMatch(CONTAINS)\n );\n\n Neuron cookProfessionEntity = m.initNeuron(\n m.createNeuron(\"E-cook (profession)\"),\n 3,\n new Input()\n .setNeuron(relNeurons.get(\"cook\"))\n .setWeight(15.0f)\n .setBiasDelta(0.9)\n .setRecurrent(false)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(suppressingN)\n .setWeight(-20.0f)\n .setBiasDelta(1.0)\n .setRecurrent(true)\n .setRangeMatch(CONTAINS)\n );\n\n Neuron jacksonForenameEntity = m.initNeuron(\n m.createNeuron(\"E-jackson (forename)\"),\n 3,\n new Input()\n .setNeuron(relNeurons.get(\"jackson\"))\n .setWeight(10.0f)\n .setBiasDelta(0.9)\n .setRelativeRid(0)\n .setRecurrent(false)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(surnameCategory)\n .setWeight(10.0f)\n .setBiasDelta(0.9)\n .setRelativeRid(1)\n .setRecurrent(true)\n .setRangeMatch(NONE),\n new Input()\n .setNeuron(suppressingN)\n .setWeight(-20.0f)\n .setBiasDelta(1.0)\n .setRecurrent(true)\n .setRangeMatch(CONTAINED_IN)\n );\n\n Neuron jacksonCityEntity = m.initNeuron(\n m.createNeuron(\"E-jackson (city)\"),\n 3,\n new Input()\n .setNeuron(relNeurons.get(\"jackson\"))\n .setWeight(12.0f)\n .setBiasDelta(0.9)\n .setRecurrent(false)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(suppressingN)\n .setWeight(-20.0f)\n .setBiasDelta(1.0)\n .setRecurrent(true)\n .setRangeMatch(CONTAINED_IN)\n );\n\n m.initNeuron(forenameCategory,\n -0.001,\n new Input() // In this example there is only one forename considered.\n .setNeuron(jacksonForenameEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRelativeRid(0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true)\n );\n m.initNeuron(surnameCategory,\n -0.001,\n new Input()\n .setNeuron(cookSurnameEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRelativeRid(0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true)\n );\n\n m.initNeuron(suppressingN,\n -0.001,\n new Input()\n .setNeuron(cookProfessionEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(cookSurnameEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(jacksonCityEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(jacksonForenameEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true)\n );\n\n\n // Now that the model is complete, start processing an actual text.\n Document doc = m.createDocument(\"mr. jackson cook was born in new york \", 0);\n\n // The start signal is used as a starting point for relational id counter.\n startSignal.addInput(doc, 0, 1, 0); // iteration, begin, end, relational id\n\n int i = 0;\n for(String w: doc.getContent().split(\" \")) {\n int j = i + w.length();\n // The space is used as a clock signal to increase the relational id.\n spaceN.addInput(doc, j, j + 1);\n\n // Feed the individual words as inputs into the network.\n inputNeurons.get(w).addInput(doc, i, j);\n i = j + 1;\n }\n\n // Search for the best interpretation of this text.\n doc.process();\n\n System.out.println(doc.neuronActivationsToString(true, false, true));\n System.out.println();\n\n System.out.println(\"Selected Option: \" + doc.bestInterpretation.toString());\n System.out.println();\n\n System.out.println(\"Activations of the Surname Category:\");\n for(Activation act: surnameCategory.getFinalActivations(doc)) {\n System.out.print(act.key.r + \" \");\n System.out.print(act.key.rid + \" \");\n System.out.print(act.key.o + \" \");\n System.out.print(act.key.n.neuron.get().label + \" \");\n System.out.print(act.finalState.value);\n }\n\n doc.clearActivations();\n }", "@Test\r\n\tpublic void teachingUnitContainsPersons() {\r\n\t\tassertTrue(teachu1.containsPerson(\"ErK\"));\r\n\t\tassertTrue(teachu1.containsPerson(\"AlP\"));\r\n\t\tassertFalse(teachu1.containsPerson(\"MaP\"));\r\n\t}", "@Test\n public void testSpinTwoWords() {\n final String actualResult = kata4.spinWord(\"Hey fellow warriors\");\n final String expectedResult = \"Hey wollef sroirraw\";\n assertEquals(expectedResult, actualResult);\n }", "public static void main(String[] args) {\n TrieReplaceWordsAndSearchAssist obj = new TrieReplaceWordsAndSearchAssist();\n obj.insert(\"home\");\n obj.insert(\"homemade\");\n obj.insert(\"homework\");\n obj.search(\"home\");\n \n TrieN pre = obj.baseNode(\"hom\");\n if (pre != null)\n System.out.println(\"Base/partial node exists!!\");\n else {\n System.out.println(\"No such base node\");\n }\n \n // assist\n System.out.println(\"Search Assist...\");\n obj.searchAssist(pre, \"hom\");\n \n // replace with shorter words.\n System.out.println(\"Sentence compaction.\");\n obj.insert(\"cat\");\n obj.insert(\"bat\");\n obj.insert(\"rat\");\n String sentence = \"I am cattle batman I hate rattles\";\n String sentenceArray[] = sentence.split(\" \");\n System.out.println(Arrays.toString(sentenceArray));\n obj.replaceWordsWithShorterWords(sentenceArray);\n System.out.println(Arrays.toString(sentenceArray));\n }", "public void testadvancedSearchTitleAndBody(){\n\t\t\n//\t\tmanager.advancedSearchTitleAndBody(ElasticIndex.analyzed, \"List of international tennis player \",\" Andre Agassi\" );\n\t}", "@Test\n public void printAllWords() {\n // TODO\n }", "@Test(timeout = 4000)\n public void test19() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"how something strange has been published. the first word should be capitalized.end\");\n assertEquals(\"how someth strang ha been publ. th first word should be capital.ens\", string0);\n }", "@Test\r\n public void testSearchPeople() throws MovieDbException {\r\n LOG.info(\"searchPeople\");\r\n String personName = \"Bruce Willis\";\r\n boolean includeAdult = false;\r\n List<Person> result = tmdb.searchPeople(personName, includeAdult, 0);\r\n assertTrue(\"Couldn't find the person\", result.size() > 0);\r\n }", "public void testRecognizer() {\n\t\tfinal int TIPO_COLUMN_NUMBER = 4;\n\t\tfinal int INSEGNA_COLUMN_NUMBER = 3;\n\t\tfinal String FUSION_CR_ID = \"fusion\";\n\t\tfinal String CSV_PATH = \"/tables/Elenco_osterie_tipiche_civici.1386925759.csv\";\n\t\tfinal char COLUMN_SEPARATOR = ';';\n\n\t\t// Load CSV file\n//\t\tFile csvFile = new File(CSV_PATH); \n\t\tFile csvFile = FileUtils.getResourceFile(CSV_PATH);\n\t\tRowTable rowTable = RowTable.loadFromCSV(csvFile, COLUMN_SEPARATOR);\n\t\trowTable.removeHeaders();\n\t\t\n\t\t// Create recognizer\n\t\tSet<String> inputRecognizers = new HashSet<String>();\n\t\tinputRecognizers.add(INPUT_RECOGNIZER_ID);\n\t\tFile modelFile = FileUtils.getSVMModelFile(TWO_FEATURES_OSTERIE_CR_NAME);\n\t\tClassifierFusionCR fusionCR \n\t\t\t= new ClassifierFusionCR(FUSION_CR_ID, \n\t\t\t\t\tRESTAURANT_CONCEPT_ID, \n\t\t\t\t\trowTable, \n\t\t\t\t\tmodelFile, \n\t\t\t\t\tinputRecognizers);\n\t\t\n\t\t// Make list of candidates\n\t\tList<ColumnConceptCandidate> candidates = new ArrayList<ColumnConceptCandidate>();\n\t\tColumnConceptCandidate tipoCandidate\n\t\t\t= new ColumnConceptCandidate(TIPO_COLUMN_NUMBER, \n\t\t\t\t\tRESTAURANT_CONCEPT_ID, \n\t\t\t\t\tTIPO_SIMILARITY_SCORE,\n\t\t\t\t\tINPUT_RECOGNIZER_ID);\n\t\tcandidates.add(tipoCandidate);\n\t\tColumnConceptCandidate insegnaCandidate\n\t\t\t= new ColumnConceptCandidate(INSEGNA_COLUMN_NUMBER, \n\t\t\t\tRESTAURANT_CONCEPT_ID, \n\t\t\t\tINSEGNA_SIMILARITY_SCORE,\n\t\t\t\tINPUT_RECOGNIZER_ID);\n\t\tcandidates.add(insegnaCandidate);\n\t\t\n\t\t// Run recognizer\n\t\tfusionCR.computeScoredCandidates(candidates);\n\t\t\n\t\t// Make sure input candidates are gone...\n\t\tassertTrue(candidates.size() == 1);\n\t\t// ... and replaced with a new fusion candidate\n\t\tColumnConceptCandidate resultingCandidate = candidates.get(0);\n\t\tassertTrue(resultingCandidate.getOriginator().equals(FUSION_CR_ID));\n\t\t\n\t\t// Verify the score of the fusion candidate\n\t\tassertTrue(resultingCandidate.getScore() > 0.7);\n\t}", "public static void main(String[] args) {\n\t\tString text = \"\\\"undifferentiated's thyroid carcinomas were carried out with antisera against calcitonin, calcitonin-gene related peptide (CGRP), somatostatin, and also thyroglobulin, using the PAP method. \";\n\t\ttext = text.replace('\\\"', ' ');\n\t\t\n\t\tStringUtil su = new StringUtil();\n\t\t\n\t\t// Extracting...\n\t\tString text2 = new String(text);\n\t\tEnvironmentVariable.setMoaraHome(\"./\");\n\t\tGeneRecognition gr = new GeneRecognition();\n\t\tArrayList<GeneMention> gms = gr.extract(MentionConstant.MODEL_BC2,text);\n\t\t// Listing mentions...\n\t\tSystem.out.println(\"Start\\tEnd\\tMention\");\n\t\tfor (int i=0; i<gms.size(); i++) {\n\t\t\tGeneMention gm = gms.get(i);\n\t\t\tSystem.out.println(gm.Start() + \"\\t\" + gm.End() + \"\\t\" + gm.Text());\n\t\t\t//System.out.println(text2.substring(gm.Start(), gm.End()));\n\t\t\tSystem.out.println(su.getTokenByPosition(text,gm.Start(),gm.End()).trim());\n\t\t}\n\t\tif (true){\n\t\t\treturn;\n\t\t}\n\t\t// Normalizing mentions...\n\t\tOrganism yeast = new Organism(Constant.ORGANISM_YEAST);\n\t\tOrganism human = new Organism(Constant.ORGANISM_HUMAN);\n\t\tExactMatchingNormalization gn = new ExactMatchingNormalization(human);\n\t\tgms = gn.normalize(text,gms);\n\t\t// Listing normalized identifiers...\n\t\t\n\t\tSystem.out.println(\"\\nStart\\tEnd\\t#Pred\\tMention\");\n\t\tfor (int i=0; i<gms.size(); i++) {\n\t\t\tGeneMention gm = gms.get(i);\n\t\t\tif (gm.GeneIds().size()>0) {\n\t\t\t\tSystem.out.println(gm.Start() + \"\\t\" + gm.End() + \"\\t\" + gm.GeneIds().size() + \n\t\t\t\t\t\"\\t\" + su.getTokenByPosition(text,gm.Start(),gm.End()).trim());\n\t\t\t\tfor (int j=0; j<gm.GeneIds().size(); j++) {\n\t\t\t\t\tGenePrediction gp = gm.GeneIds().get(j);\n\t\t\t\t\tSystem.out.print(\"\\t\" + gp.GeneId() + \" \" + gp.OriginalSynonym() + \" \" + gp.ScoreDisambig());\n\t\t\t\t\tSystem.out.println((gm.GeneId().GeneId().equals(gp.GeneId())?\" (*)\":\"\"));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) throws IOException {\n ArrayList<String> words = new ArrayList<String>();\n BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(\"src/main/resources/test.txt\")));\n String temp;\n while((temp = reader.readLine())!=null){\n words.add(temp);\n }\n\n // Step two: build dat\n DATrie dat = new DATrie(DATrie.InitType.Empty);\n for(String word : words)\n dat.add(word);\n\n // Step three: check word\n System.out.println(dat.contains(\"敏感\")+\" \"+dat.contains(\"敏感地带\") +\" \"+dat.contains(\"晓峰\"));\n System.out.println(dat.maxMatch(\"敏感\", 1));\n }", "public static void main(String[] args) {\n\t\tString input = \"the quick brown fox jumped over the lazy dog\";\n\t\tSystem.out.println(Arrays.toString(tokenize(input)));\n\t\t\n\t\tSystem.out.println(detectPrefix(\"quick\"));\n\t\tSystem.out.println(detectPrefix(\"one\"));\n\t\tSystem.out.println(detectPrefix(\"brown\"));\n\t\t\n\t}", "@Test\n\tvoid runRegExFoundText_LegalCase() throws Exception {\n\t\tmaxScore += 10;\n\t\tRegEx.regEx = \"S(a|r|g)*on\";\n\t\ttry {\n\t\t\tRegExTree ret = RegEx.parse();\n\t\t\tAutomaton a = RegEx.RegExTreeToAutomaton(ret);\n\t\t\ta.toTable();\n\t\t\ta.eliminateEpsilonTransitions();\n\t\t\ta.minimize();\n\t\t\tArrayList<MatchResponse> response = a.search(\"books/babylon.txt\");\n\t\t\tassertEquals(30, response.size());\n\t\t} catch (Exception e) {\n\t\t\tfail();\n\t\t}\n\t\tactualScore += 10;\n\t}", "@Test\r\n public void testToBeOrNotToBe() throws IOException {\r\n System.out.println(\"testing 'To be or not to be' variations\");\r\n String[] sentences = new String[]{\r\n \"to be or not to be\", // correct sentence\r\n \"to ben or not to be\",\r\n \"ro be ot not to be\",\r\n \"to be or nod to bee\"};\r\n\r\n CorpusReader cr = new CorpusReader();\r\n ConfusionMatrixReader cmr = new ConfusionMatrixReader();\r\n SpellCorrector sc = new SpellCorrector(cr, cmr);\r\n for (String s : sentences) {\r\n String output = sc.correctPhrase(s);\r\n System.out.println(String.format(\"Input \\\"%0$s\\\" returned \\\"%1$s\\\"\", s, output));\r\n collector.checkThat(\"input sentence: \" + s + \". \", \"to be or not to be\", IsEqual.equalTo(output));\r\n }\r\n }", "public static void main (String[] args) {\r\n\t\tfindWords(sentence);\r\n\t}", "@Test(timeout = 4000)\n public void test36() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"nam(s) of edit(s), typ as indic in th latic book. if ther is als an author field, then th edit field giv th edit of th bok or cllect in which th refer appear.\");\n assertEquals(\"nam(s) of edit(s), typ as ind in th lat book. if ther is al an author field, then th edit field giv th edit of th bok or cllect in which th refer appear.\", string0);\n }", "public static void main(String[] args) {\n\t\tString fname=\"shahin\",lname=\"Shahin \",fullname=fname+lname;\r\n\t\tString name=\"I live in india\";\r\n\t\tSystem.out.println(\"fname equals lname is \"+fname.equals(lname));\r\n\t\tSystem.out.println(\"fname equals lname is \"+fname.equalsIgnoreCase(lname));\r\n\t\tSystem.out.println(\"fname starts with \"+ \"'shah is'\"+fname.startsWith(\"shah\"));\r\n\t\tSystem.out.println(\"fname ends with \"+ \"'in is'\"+fname.endsWith(\"in\"));\r\n\t\tSystem.out.println(\"fname upper \"+ fname.toUpperCase());\r\n\t\tSystem.out.println(\"lname lower \"+ lname.toLowerCase());\r\n\t\tSystem.out.println(\"lname substring\"+ lname.substring(2));\r\n\t\tSystem.out.println(\"lname substring length\"+ lname.substring(2,3));\r\n\t\tSystem.out.println(\"Trim is \"+ lname.trim());\r\n\t\tSystem.out.println(\"fname equals lname is \"+fname.replace(\"a\", \"b\"));\r\n\t\tSystem.out.println(\"split \"+name.split(\" \")[2]);\r\n\t}", "@Test(timeout = 4000)\n public void test39() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"Name(s) of editor(s), typed as indicated in the LaTeX book. If there is also an author field, then the editor field gives the editor of the bok or cllection in which the reference appears.\");\n assertEquals(\"nam(s) of edit(s), typ as indic in th latic book. if ther is als an author field, then th edit field giv th edit of th bok or cllect in which th refer appear.\", string0);\n }", "@Test(timeout = 4000)\n public void test50() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"usu th addres of th publishes or other typ of institut. for major publish hous, van leun recommens omis th inform entir. for smal publishes, on th other hand, you can help th reader by giv th comples addres.\");\n assertEquals(\"usu th addr of th publish or other typ of institut. for major publ hous, van leun recommen om th inform entir. for smal publish, on th other hand, you can help th reader by giv th compl addr.\", string0);\n }", "@Test\n\tvoid testAddAndSearchWordDataStructureDesign() {\n\t\tAddAndSearchWordDataStructureDesign dict = new AddAndSearchWordDataStructureDesign();\n\t\tdict.addWord(\"bad\");\n\t\tdict.addWord(\"dad\");\n\t\tdict.addWord(\"mad\");\n\t\tassertFalse(dict.search(\"pad\"));\n\t\tassertTrue(dict.search(\"bad\"));\n\t\tassertTrue(dict.search(\".ad\"));\n\t\tassertTrue(dict.search(\"b..\"));\n\t}", "@Test(timeout = 4000)\n public void test48() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"The name of a series or set of books. When citing an entire book, the the title field gives its title and an optional series field gives the name of a series or multi-volume set in which the book is published.\");\n assertEquals(\"th nam of a ser or ses of book. when cit an entir book, th th titl field giv it titl and an opt ser field giv th nam of a ser or mult-volum ses in which th book is publ.\", string0);\n }", "@Test\n public void testPhrase() {\n assertQ(req(\"q\",\"text:now-cow\", \"indent\",\"true\")\n ,\"//*[@numFound='1']\"\n );\n // should generate a query of (now OR cow) and match both docs\n assertQ(req(\"q\",\"text_np:now-cow\", \"indent\",\"true\")\n ,\"//*[@numFound='2']\"\n );\n }", "@Test(timeout = 4000)\n public void test41() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"usually the address of the publisher or other type of institution. for major publishing houses, van leunen recommends omitting the information entirely. for small publishers, on the other hand, you &an help the reader by giving the complete address.\");\n assertEquals(\"usu th addres of th publishes or other typ of institut. for major publish hous, van leun recommens omis th inform entir. for smal publishes, on th other hand, you &an help th reader by giv th comples addres.\", string0);\n }", "@Test(timeout = 4000)\n public void test59() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"Name(s) of editor(s), typed as indicated in the LaTeX book. If there is also an author field, then the editor field gives the editor of the book or collection in which the reference appears.\");\n assertEquals(\"nam(s) of edit(s), typ as indic in th latic book. if ther is als an author field, then th edit field giv th edit of th book or collect in which th refer appear.\", string0);\n }", "@Test(timeout = 4000)\n public void test42() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"any addit inform that can help th reader. th first word should be capital.\");\n assertEquals(\"any addit inform that can help th reader. th first word should be capit.\", string0);\n }", "public static void main(String[] args) {\n String input_one = \"Fourscore and seven years ago our fathers brought forth on this continent a new nation, conceived in liberty and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battlefield of that war. We have come to dedicate a portion of that field as a final resting-place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this. But, in a larger sense, we cannot dedicate — we cannot consecrate — we cannot hallow — this ground. The brave men, living and dead, who struggled here have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us — that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion — that we here highly resolve that these dead shall not have died in vain — that this nation shall have a new birth of freedom and that government of the people, by the people, for the people, shall not perish from the earth.\";\r\n String input_two = \"Oh, say can you see, by the dawn's early light,What so proudly we hailed at the twilight's last gleaming?Whose broad stripes and brightstars,through the perilous fight,O'er the ramparts we watched, were so gallantly streaming?And the rockets' red glare, the bombs bursting in air,Gave proof through the night that our flag was still there.O say, does that star-spangled banner yet waveO'er the land of the free and the home of the brave?On the shore, dimly seen through the mists of the deep,Wherethe foe's haughty host in dread silence reposes,What isthatwhichthe breeze, o'er the towering steep,As it fitfully blows, now conceals, now discloses?Now it catches the gleam of the morning's first beam,In full glory reflected now shines on the stream:'Tis the starspangled banner! O long may it waveO'er the land of the free and the home of the brave. And where is that band who so vauntingly swore That the havoc of war and the battle's confusionA home and a country should leaveus no more?Their blood has wiped out their foulfootstep'spollution.Norefuge could save the hireling and slaveFrom the terror of flight, or the gloom of the grave:And the star-spangled banner in triumph doth waveO'er theland of the free and the home of the brave.Oh! thus be it ever, when freemen shall stand Between their loved homes and the war's desolation!Blest with victory and peace, may the heaven-rescued land Praise the Power that hath made and preserved us a nation.Then conquer we must, for our cause it is just,And this be our motto: In God is our trust. And the star-spangled banner forever shall waveO'er the land of the free and the home of \";\r\n\r\n String input_upper = input_one.toUpperCase();\r\n String input_upper2 = input_two.toUpperCase();\r\n // System.out.println(input_upper);\r\n String[] pattern = { \"FREE\", \"BRAVE\", \"NATION\" };\r\n // Brute Force algorithm\r\n System.out.println();\r\n System.out.println(\"**************************** OUTPUT OF FIRST INPUT FILE: *****************************\");\r\n System.out.println();\r\n System.out.println(\"\\t\\t\\t\\t\\tBRUTE FORCE ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n BF_Search bf = new BF_Search();\r\n long bf_startTime = System.nanoTime();\r\n for (int i = 0; i < pattern.length; i++) {\r\n bf.brute_force_search(input_upper, pattern[i]);\r\n }\r\n long bf_endTime = System.nanoTime();\r\n bf.printBF_Comparison();\r\n System.out.println(\"It took: \" + (bf_endTime - bf_startTime) + \" nanoseconds\");\r\n\r\n // Knuth Moris Pratt algorithm\r\n System.out.println(\"\\t\\t\\t\\t\\tKNUTH MORIS PRATT ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n KMP_Search kmp = new KMP_Search();\r\n long kmp_startTime = System.nanoTime();\r\n for (int i = 0; i < pattern.length; i++) {\r\n kmp.KMPSearch(pattern[i], input_upper);\r\n if (i == pattern.length - 1) {\r\n kmp.printKM_Comparisons();\r\n }\r\n }\r\n long kmp_endTime = System.nanoTime();\r\n System.out.println(\"It took: \" + (kmp_endTime - kmp_startTime) + \" nanoseconds\");\r\n\r\n // Boyer Moore algorithm\r\n System.out.println();\r\n System.out.println(\"\\t\\t\\t\\t\\tBOYER MOORE ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n BM_Search bm = new BM_Search();\r\n char[] bm_input = input_upper.toCharArray();\r\n char[] bm_pattern = new char[] {};\r\n long bm_startTime = System.nanoTime();\r\n for (String i : pattern) {\r\n bm_pattern = i.toCharArray();\r\n bm.bm_search(bm_input, bm_pattern);\r\n if (pattern[pattern.length - 1] == i) {\r\n bm.printBM_Comparison();\r\n }\r\n }\r\n long bm_endTime = System.nanoTime();\r\n System.out.println(\"It took: \" + (bm_endTime - bm_startTime) + \" nanoseconds\");\r\n\r\n // Rabin Karp algorithm\r\n System.out.println(\"\\t\\t\\t\\t\\tRABIN KARP ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n RKA_Search rk = new RKA_Search();\r\n int q = 101;\r\n long rk_startTime = System.nanoTime();\r\n for (int i = 0; i < pattern.length; i++) {\r\n rk.rka_search(pattern[i], input_upper, q);\r\n if (i == pattern.length - 1) {\r\n rk.printRKA_Comparison();\r\n }\r\n }\r\n long rk_endTime = System.nanoTime();\r\n System.out.println(\"It took: \" + (rk_endTime - rk_startTime) + \" nanoseconds\");\r\n System.out.println();\r\n System.out.println(\"************************* OUTPUT OF SECOND INPUT FILE: *******************************\");\r\n // Brute Force algorithm\r\n System.out.println();\r\n // System.out.println();\r\n System.out.println(\"\\t\\t\\t\\t\\tBRUTE FORCE ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n BF_Search bf2 = new BF_Search();\r\n long bf_startTime1 = System.nanoTime();\r\n for (int i = 0; i < pattern.length; i++) {\r\n bf.brute_force_search(input_upper2, pattern[i]);\r\n }\r\n long bf_endTime2 = System.nanoTime();\r\n bf2.printBF_Comparison();\r\n System.out.println(\"It took: \" + (bf_endTime2 - bf_startTime1) + \" nanoseconds\");\r\n\r\n // Knuth Moris Pratt algorithm\r\n System.out.println(\"\\t\\t\\t\\t\\tKNUTH MORIS PRATT ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n KMP_Search kmp2 = new KMP_Search();\r\n long kmp_startTime1 = System.nanoTime();\r\n for (int i = 0; i < pattern.length; i++) {\r\n kmp2.KMPSearch(pattern[i], input_upper2);\r\n if (i == pattern.length - 1) {\r\n kmp2.printKM_Comparisons();\r\n }\r\n }\r\n long kmp_endTime2 = System.nanoTime();\r\n System.out.println(\"It took: \" + (kmp_endTime2 - kmp_startTime1) + \" nanoseconds\");\r\n\r\n // Boyer Moore algorithm\r\n System.out.println(\"\\t\\t\\t\\t\\tBOYER MOORE ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n BM_Search bm2 = new BM_Search();\r\n char[] bm_input2 = input_upper.toCharArray();\r\n char[] bm_pattern2 = new char[] {};\r\n long bm_startTime1 = System.nanoTime();\r\n for (String i : pattern) {\r\n bm_pattern2 = i.toCharArray();\r\n bm.bm_search(bm_input2, bm_pattern2);\r\n if (pattern[pattern.length - 1] == i) {\r\n bm2.printBM_Comparison();\r\n }\r\n }\r\n long bm_endTime2 = System.nanoTime();\r\n System.out.println(\"It took: \" + (bm_endTime2 - bm_startTime1) + \" nanoseconds\");\r\n\r\n // Rabin Karp algorithm\r\n System.out.println(\"\\t\\t\\t\\t\\tRABIN KARP ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n RKA_Search rk2 = new RKA_Search();\r\n int q2 = 101;\r\n long rk_startTime1 = System.nanoTime();\r\n for (int i = 0; i < pattern.length; i++) {\r\n rk2.rka_search(pattern[i], input_upper2, q2);\r\n if (i == pattern.length - 1) {\r\n rk2.printRKA_Comparison();\r\n }\r\n }\r\n long rk_endTime2 = System.nanoTime();\r\n System.out.println(\"It took: \" + (rk_endTime2 - rk_startTime1) + \" nanoseconds\");\r\n }", "@Test\n\tvoid runRegExUpperCaseText_LegalCase() throws Exception {\n\t\tmaxScore += 10;\n\t\tRegEx.regEx = \"SARGON\";\n\t\ttry {\n\t\t\tRegExTree ret = RegEx.parse();\n\t\t\tAutomaton a = RegEx.RegExTreeToAutomaton(ret);\n\t\t\ta.toTable();\n\t\t\ta.eliminateEpsilonTransitions();\n\t\t\ta.minimize();\n\t\t\tArrayList<MatchResponse> response = a.search(\"books/babylon.txt\");\n\t\t\tassertEquals(0, response.size());\n\t\t} catch (Exception e) {\n\t\t\tfail();\n\t\t}\n\t\tactualScore += 10;\n\t}", "public static void main(String[] args) throws IOException \r\n\t{\r\n\t\tString s1 = \"THE SALVADORAN GOVERNMENT TODAY DEPLORED THE DISAPPEARANCE OF SOCIAL DEMOCRATIC LEADER HECTOR OQUELI COLINDRES THIS MORNING IN GUATEMALA.\";\r\n\t\tString soln = classifier.classifyToString(s1);\r\n\t\tSystem.out.println(soln);\r\n\t\tNER n = new NER();\r\n\t\tn.getPersons(s1);\r\n\t\tSystem.out.println(\"\\n\");\r\n\t\tn.getOrgs(s1);\r\n\t\tSystem.out.println(\"\\n\");\r\n\t\tn.getLocations(s1);\r\n\t}", "@Test(timeout = 4000)\n public void test45() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"th nam of a ser or ses of book. when cit an entir book, th th titl field giv it titl and an opt ser field giv th nam of a ser or mult-volum ses in which th book is publ.\");\n assertEquals(\"th nam of a ser or se of book. when cit an entir book, th th titl field giv it titl and an opt ser field giv th nam of a ser or mult-vol se in which th book is publ.\", string0);\n }", "@Test //TEST ONE\n void testCapital1stLetterBreedName()\n {\n Rabbit_RegEx rabbit_breed = new Rabbit_RegEx();\n rabbit_breed.setBreedName(\"AmericanFuzzyLop\"); //American Fuzzy Lop, very cute!\n assertTrue(rabbit_breed.getBreedName().matches(\"^[A-Za-z][a-zA-Z-][a-zA-z- ]*\"));\n }", "@Test(timeout = 4000)\n public void test57() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"us for alphabes, cros refer, and creat a label when th ``author'' inform is mis. th field should not be confus with th key that appear in th cit command and at th begin of th databas entr.\");\n assertEquals(\"us for alphab, cro refer, and creat a label when th ``author'' inform is mi. th field should not be confus with th key that appear in th cit command and at th begin of th datab entr.\", string0);\n }", "@Test(timeout = 4000)\n public void test45() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"how someth strang ha been publ. th first word should be capital.\");\n assertEquals(\"how someth strang ha been publ. th first word should be capit.\", string0);\n }", "@Test(timeout = 4000)\n public void test40() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"usu th addres of th publishes or other typ of institut. for major publish hous, van leun recommens omis th inform entir. for smal publishes, on th other hand, you &an help th reader by giv th comples addres.\");\n assertEquals(\"usu th addr of th publish or other typ of institut. for major publ hous, van leun recommen om th inform entir. for smal publish, on th other hand, you &an help th reader by giv th compl addr.\", string0);\n }", "@Test(timeout = 4000)\n public void test61() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"Usually the address of the publisher or other type of institution. For major publishing houses, van Leunen recommends omitting the information entirely. For small publishers, on the other hand, you can help the reader by giving the complete address.\");\n assertEquals(\"usu th addres of th publishes or other typ of institut. for major publish hous, van leun recommens omis th inform entir. for smal publishes, on th other hand, you can help th reader by giv th comples addres.\", string0);\n }", "public static void main(String[] args) {\n\t\tString [] plop = {\"Hello\", \"Alaska\", \"Dad\", \"Peace\"};\r\n\t\tArrayList<String> tj = findWords(plop);\r\n\t\tSystem.out.println(\"bouh\");\r\n\r\n\t}", "@Test(timeout = 4000)\n public void test31() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"The edition of a book---for example, ``Second''. This should be an ordinal, and should have the first letter capitalized, as shown here; the standard styles convert to lower case when necessary.\");\n assertEquals(\"th edit of a book---for exampl, ``second''. th should be an ordin, and should hav th first letter capital, as shown hes; th standard styl convers to lower cas when neces.\", string0);\n }", "@Test(timeout = 4000)\n public void test51() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"us for alphabes, cros refer, and creat a label when th ``author'' inform is mis. th field should not be confus with th key that appear in th cit command and at th begin of th databas entr.\");\n assertEquals(\"us for alphab, cro refer, and creat a label when th ``author'' inform is mi. th field should not be confus with th key that appear in th cit command and at th begin of th datab entr.\", string0);\n }", "@Test\r\n\tpublic void testCapitalizeAllWords() throws Exception{\r\n\t\tAssert.assertEquals(\"Hello World\", Capitalizer.capitalizeAllWords(\"hello woRLd\"));\r\n\t}", "@Test\n public void testSpinOneWord() {\n final String actualResult = kata4.spinWord(\"This is another test\");\n final String expectedResult = \"This is rehtona test\";\n assertEquals(expectedResult, actualResult);\n }", "@Test(timeout = 4000)\n public void test65() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"How somethig strange haseen published. Thefirst word should be capitalized.\");\n assertEquals(\"how somethig strang haseen publ. thefirst word should be capital.\", string0);\n }", "protected void validateFirstName(){\n Boolean firstName = Pattern.matches(\"[A-Z][a-z]{2,}\",getFirstName());\n System.out.println(nameResult(firstName));\n }", "public void testStrings()\n {\n final ReportStringWriter rptr = new ReportStringWriter();\n\n final StringBuffer sb = new StringBuffer()\n .append(\"Cat food\").append('\\n');\n final Reader netRdr = new StringReader(sb.toString());\n final NamedEntityTree net = new NamedEntityTree();\n net.load(netRdr);\n\n StringReader txtRdr = new StringReader(\"Dog food. Eat more Cat food now.\");\n final Lexer lex = new Lexer();\n lex.load(txtRdr);\n lex.analyze();\n\n final Parser parser = new Parser();\n parser.parse(lex);\n\n net.recognize(rptr, net, 1, lex.getSymbolTable(), parser);\n\n assertEquals( \"ROOT:Cat:food\\n\",\n rptr.toString());\n }", "public static void main(String[] args) {\n\t\tStringTokenizer strToken = new StringTokenizer(\"Hello, my name is Vitaly\", \", \", true);\n\t\twhile(strToken.hasMoreElements()){\n\t\t\tSystem.out.println(\"\\\"\" + strToken.nextToken() + \"\\\"\");\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t\tstrToken = new StringTokenizer(\"Hello, my name is Vitali\", \", \", false);\n\t\twhile(strToken.hasMoreElements()){\n\t\t\tSystem.out.println(\"\\\"\" + strToken.nextToken() + \"\\\"\");\n\t\t}\n\t}", "@Test //TEST TWO\n void testallLowerBreedName()\n {\n Rabbit_RegEx rabbit_breed = new Rabbit_RegEx();\n rabbit_breed.setBreedName(\"dwarfhotot\"); //Dwarf Hotot\n assertTrue(rabbit_breed.getBreedName().matches(\"^[A-Za-z][a-zA-Z-][a-zA-z- ]*\"));\n }", "@Test //TEST FIVE\n void testSpacesAndLowercaseBreedName()\n {\n Rabbit_RegEx rabbit_breed = new Rabbit_RegEx();\n rabbit_breed.setBreedName(\"silver fox\");\n assertTrue(rabbit_breed.getBreedName().matches(\"^[A-Za-z][a-zA-Z-][a-zA-z- ]*\"));\n }", "@Test\n\tpublic void testPetWhenGetNameHarris() {\n\t\tPet dog = new Pet(\"Harris\", \"boo\");\t\t\n\t\tString expect = \"Harris\";\n\t\tString result = dog.getPetName();\t\t\n\t\tassertEquals(expect, result);\t\n\t}", "public static void main(String args[]) {\n\t\tList<String> words = Arrays.asList(\"hi\",\"hello\",\"Bye\",\"Goodbye\");\n\t\twords.stream().forEach(s->s=\" __ \"+s);\n\t\twords.forEach(s->System.out.println(s));\n\t\tSystem.out.println();\n\t\t\n\t\t//using method reference \n\t\twords.stream().map(s->\"_\"+s).forEach(System.out::println);\n\t\tSystem.out.println();\n\t\t\n\t\t//operations using map\n\t\twords.stream().map(s-> s.replace(\"i\", \"eye\")).forEach(System.out::println);\n\t\tSystem.out.println();\n\t\t\n\t\t//filter\n\t\twords.stream().filter(s->s.length()<7).forEach(System.out::println);\n\t\tSystem.out.println();\n\t\t\n\t\t//reduce operation and concatenate operation\n\t\tSystem.out.println(words.stream().reduce(\"\",(s1,s2)->s1.toUpperCase()+(s2.toUpperCase())));\n\t\t\n\t\t//Reduce using map and concat\n\t\tSystem.out.println(words.stream().map(s->s.toUpperCase()).reduce(\"\", (s1,s2)->s1.concat(s2)));\n\t\t\n\t\t//concate words with commas in between them\n\t\tSystem.out.println(words.stream().reduce((s1,s2)->s1.concat(\",\"+s2)).get());\n\t\t\n\t\t//Large array of doubles\n\t\tdouble[] list= new Random().doubles(10).toArray();\n\t\t\n\t}", "@Test\n public void execute_nameParameter() throws ParseException {\n //No user input\n execute_parameterPredicate_test(0, \" \", \"name\", true, false, Collections.emptyList());\n //Single keyword, ignore case, person found.\n execute_parameterPredicate_test(1, \"ElLe\", \"name\", true, false, Arrays.asList(ELLE));\n //Single keyword, case sensitive, person found.\n execute_parameterPredicate_test(0, \"ElLe\", \"name\", false, false, Collections.emptyList());\n //Multiple keywords, ignore case, or condition, multiple people found\n execute_parameterPredicate_test(3, \"Kurz Elle Kunz\", \"name\", true, false, Arrays.asList(CARL, ELLE, FIONA));\n //Multiple keywords, ignore case, and condition, no one found\n execute_parameterPredicate_test(0, \"kurz Elle kunz\", \"name\", true, true, Collections.emptyList());\n //Multiple keywords, case sensitive, or condition, multiple people found\n execute_parameterPredicate_test(2, \"kurz Elle Kunz\", \"name\", false, false, Arrays.asList(ELLE, FIONA));\n //Multiple keywords, case sensitive, and condition, no one found\n execute_parameterPredicate_test(0, \"Kurz Elle kunz\", \"name\", false, true, Collections.emptyList());\n }", "public static void main(String arg[]) {\n String frase1 = \"Había vez circo alegraba el\";\n String frase2 = \"una un que siempre carazón sin temer jamás\";\n String frase3 = \"\";\n\n int inicio1 = 0;\n int fin1 = frase1.indexOf(\" \");\n int inicio2 = 0;\n int fin2 = frase2.indexOf(\" \");\n\n while ((fin1 != -1) || (fin2 != -1)) {\n if (fin1 != -1) {\n frase3 = frase3.concat(frase1.substring(inicio1, fin1 + 1));\n inicio1 = fin1 + 1;\n fin1 = frase1.indexOf(\" \", inicio1);\n }\n if (fin2 != -1) {\n frase3 = frase3.concat(frase2.substring(inicio2, fin2 + 1));\n inicio2 = fin2 + 1;\n fin2 = frase2.indexOf(\" \", inicio2);\n }\n }\n System.out.println(frase3);\n }", "@Test\n\tpublic void testKeywordQuery(){\n\t\t//manager.getResponse(\"american football \"); //match multiple keywords\n//\t\tmanager.getResponse(\"list of Bond 007 movies\");\n//\tmanager.getResponse(\"Disney movies\");\n\t\t//manager.keywordQuery(\"Paul Brown Stadium location\");\n\t\t//manager.keywordQuery(\"0Francesco\");\n System.out.println(\"******* keyword query *******\");\n\t\t//manager.keywordQuery(\"sportspeople in tennis\");\n\t\t//manager.keywordSearch(\"list of movies starring Sean Connery\",ElasticIndex.analyzed,100 );\n//\t\tmanager.keywordSearch(\"movies starring Sean Connery\",ElasticIndex.notStemmed,100 );\n// manager.keywordSearch(\"musical movies tony award\",ElasticIndex.analyzed,100 );\n// manager.keywordSearch(\"movies directed by Woody Allen\",ElasticIndex.analyzed,100 );\n// manager.keywordSearch(\"United states professional sports teams\",ElasticIndex.analyzed,100 );\n// manager.keywordSearch(\"computer games developed by Ubisoft\",ElasticIndex.analyzed,100 );\n// manager.keywordSearch(\"computer games developed by Ubisoft\",ElasticIndex.notStemmed,100 );\n// manager.keywordSearch(\"movies academy award nominations\",ElasticIndex.notStemmed,100 );\n System.out.println(SearchResultUtil.toSummary(manager.keywordSearch(\"movies directed by Woody Allen\",ElasticIndex.notLowercased,20 )));\n //manager.keywordSearch(\"grammy best album in 2012\",ElasticIndex.notAnalyzed,100 );\n //(better than analyzed) manager.keywordSearch(\"grammy best album in 2012\",ElasticIndex.notStemmed,100 );\n System.out.println(\"*****************************\");\n\n\t\t//manager.keywordQuery(\"Disney movies\");\n\t}", "public static void main(String[] args) {\n String words = \"coding:java:selenium:python\";\n String[] splitWords = words.split(\":\");\n System.out.println(Arrays.toString(splitWords));\n System.out.println(\"Length of Array - \" +splitWords.length);\n\n for (String each:splitWords) {\n System.out.println(each);\n\n }\n // How many words in your sentence\n // Most popular interview questions\n // 0 1 2 3 4 5\n String sentence = \"Productive study is makes you motivated\";\n String[] wordsInSentence = sentence.split(\" \");\n System.out.println(\"First words: \" +wordsInSentence[0]);\n System.out.println(\"First words: \" +sentence.split(\" \")[5]);\n System.out.println(\"Number of words in sentence: \" + wordsInSentence.length);\n\n // print all words in separate line\n for (String each:wordsInSentence) {\n System.out.println(each);\n }\n\n\n\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data)\n {\n if (requestCode == REQUEST_CODE && resultCode == RESULT_OK)\n {\n // Populate the wordsList with the String values the recognition engine thought it heard\n ArrayList<String> matches = data.getStringArrayListExtra(\n RecognizerIntent.EXTRA_RESULTS);\n \n for(int i=0;i<matches.size();i++)\n {\n \tif(counter==0)\n \t{\n \t\t\n\t \tif(matches.get(i).equals(\"moo\") || matches.get(i).equals(\"moore\") ||\n\t \t\t\tmatches.get(i).equals(\"mou\") || matches.get(i).equals(\"moon\") ||\n\t \t\t\tmatches.get(i).equals(\"movie\") || matches.get(i).equals(\"boo\")\n\t \t|| matches.get(i).equals(\"boohoo\") || matches.get(i).equals(\"boom\"))\n\t \t{\n\t \t\t\n\t \t\n\t \t\tresume();\n\t \t\tbreak;\n\t \t}\n\t \telse{\n\t \t\twrong();\n\t \t\t}\n \t}\n \telse if(counter==1){\n \t\t\n\t \tif(matches.get(i).equals(\"name\") || matches.get(i).equals(\"names\") ||\n\t \t\t\tmatches.get(i).equals(\"nay\") || matches.get(i).equals(\"neigh\") ||\n\t \t\t\tmatches.get(i).equals(\"nee\") || matches.get(i).equals(\"nays\")\n\t \t\t\t|| matches.get(i).equals(\"knee\") || matches.get(i).equals(\"nees\")\n\t \t\t\t|| matches.get(i).equals(\"ne\") || matches.get(i).equals(\"ni\")){\n\t \t\t\n\t \t\tresume();\n\t \t\tbreak;\n\t \t}\n\t \telse\n\t \t\twrong();\n\t \t\n \t}\n \telse if(counter==2){\n\t \tif(matches.get(i).equals(\"oink\") || matches.get(i).equals(\"on\") ||\n\t \t\t\tmatches.get(i).equals(\"oint\") || matches.get(i).equals(\"point\") ||\n\t \t\t\tmatches.get(i).equals(\"online\") || matches.get(i).equals(\"going\")\n\t \t\t\t|| matches.get(i).equals(\"awning\") || matches.get(i).equals(\"wapking\")){\n\t \t\t\n\t \t\n\t \t\tresume();\n\t \t\tbreak;\n\t \t}\n\t \telse\n\t \t\twrong();\n\t \t\n \t}\n \telse if(counter==3){\n \t\t//TextView tv = (TextView) findViewById(R.id.text);\n \t\t//tv.setText(\"Sheep says?\");\n\t \tif(matches.get(i).equals(\"ba\") || matches.get(i).equals(\"baa\") ||\n\t \t\t\tmatches.get(i).equals(\"bar\") || matches.get(i).equals(\"bah\") ||\n\t \t\t\tmatches.get(i).equals(\"baba\") || matches.get(i).equals(\"bleach\")\n\t \t\t\t|| matches.get(i).equals(\"please\") || matches.get(i).equals(\"plate\")\n\t \t\t\t|| matches.get(i).equals(\"pa\") || matches.get(i).equals(\"paa\")){\n\t \t\t\n\t \t\tresume();\n\t \t\tbreak;\n\t \t}\n\t \telse\n\t \t\twrong();\n \t}\n \telse if(counter==4){\n\t \tif(matches.get(i).equals(\"quack\") || matches.get(i).equals(\"crack\") ||\n\t \t\t\tmatches.get(i).equals(\"kodak\") || matches.get(i).equals(\"back\") ||\n\t \t\t\tmatches.get(i).equals(\"call back\") || matches.get(i).equals(\"quake\")\n\t \t\t\t|| matches.get(i).equals(\"quiet\")|| matches.get(i).equals(\"quiet\")\n\t \t\t\t|| matches.get(i).equals(\"whack\")\n\t \t\t\t|| matches.get(i).equals(\"quack quack\")){\n\t \t\tif(counter<4)\n\t \t\t{\n\t \t\t\tcounter++;\n\t \t\t\tloadActivity();\n\t \t\t}\n\t \t\tresume();\n\t \t\tbreak;\n\t \t}\n\t \telse\n\t \t\twrong();\n \t}\n }\n }\n super.onActivityResult(requestCode, resultCode, data);\n }", "@Test\n\tpublic void simpleNameNormalizationTest() {\n\t\tSystem.out.println(NDLDataUtils.normalizeSimpleName(\"MacMillan, Don\"));\n\t\tSystem.out.println(NDLDataUtils.normalizeSimpleName(\"Jana, DK\"));\n\t\tSystem.out.println(NDLDataUtils.normalizeSimpleName(\"A. Kruger\"));\n\t\tSystem.out.println(NDLDataUtils.normalizeSimpleName(\"Peter axyz ac\"));\n\t\tSystem.out.println(NDLDataUtils.normalizeSimpleName(\"Peter Ãac\"));\n\t\tSystem.out.println(NDLDataUtils.normalizeSimpleName(\"Gestionnaire HAL-SU\"));\n\t\tSystem.out.println(NDLDataUtils.normalizeSimpleName(\"Christophe Penkerc'h\"));\n\t\t\n\t\tSet<String> wrongNameTokens = new HashSet<String>(2);\n\t\twrongNameTokens.add(\"phd\");\n\t\twrongNameTokens.add(\"professor\");\n\t\twrongNameTokens.add(\"of\");\n\t\twrongNameTokens.add(\"nutrition\");\n\t\tSystem.out.println(NDLDataUtils.normalizeSimpleNameByWrongNameTokens(\"A. Kruger PhD, Professor Of Nutrition\",\n\t\t\t\twrongNameTokens));\n\t}", "@Test\n\tpublic void VerifyTheSearchResult() {\n\t\tString searchString = \"The Choice\";\n\t\thomePage.search(searchString);\n\t\tString searchTitle = resultPage.getSearchResultTitle();\n\t\tAssert.assertTrue(searchTitle.contains(searchString));\n\t}", "@Test(timeout = 4000)\n public void test47() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"th sponsor institut of a techn report.uas\");\n assertEquals(\"th spons institut of a techn report.ua\", string0);\n }", "public static void main(String[] args) {\n\t\t\n\t\tString s=\"Jesus is blessing my family\";\n\t\tfindVowelsAndConsonants(s);\n\t\t\n\t}", "@Test\r\n public void testGetCandidateWords() throws IOException {\r\n System.out.println(\"getCandidateWords\");\r\n String word = \"idabetes\";\r\n CorpusReader cr = new CorpusReader();\r\n ConfusionMatrixReader cmr = new ConfusionMatrixReader();\r\n SpellCorrector sc = new SpellCorrector(cr, cmr);\r\n Map<String, Double> result = sc.getCandidateWords(word);\r\n for (String key : result.keySet()) {\r\n System.out.println(key + \", \" + result.get(key));\r\n }\r\n\r\n /*assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");*/\r\n }", "public static void main(String[] args) {\n\t\tString jsonResults = \"\";\r\n\t\tString text = \"Before you discuss the resolution, let me place before you one or two things, I want you to understand two things very clearly and to consider them from the same point of view from which I am placing them before you. I ask you to consider it from my point of view, because if you approve of it, you will be enjoined to carry out all I say. It will be a great responsibility. There are people who ask me whether I am the same man that I was in 1920, or whether there has been any change in me. You are right in asking that question.Let me, however, hasten to assure that I am the same Gandhi as I was in 1920. I have not changed in any fundamental respect. I attach the same importance to non-violence that I did then. If at all, my emphasis on it has grown stronger. There is no real contradiction between the present resolution and my previous writings and utterances.Occasions like the present do not occur in everybody’s and but rarely in anybody’s life. I want you to know and feel that there is nothing but purest Ahimsa in all that I am saying and doing today. The draft resolution of the Working Committee is based on Ahimsa, the contemplated struggle similarly has its roots in Ahimsa. If, therefore, there is any among you who has lost faith in Ahimsa or is wearied of it, let him not vote for this resolution. Let me explain my position clearly. God has vouchsafed to me a priceless gift in the weapon of Ahimsa. I and my Ahimsa are on our trail today. If in the present crisis, when the earth is being scorched by the flames of Himsa and crying for deliverance, I failed to make use of the God given talent, God will not forgive me and I shall be judged unworthy of the great gift. I must act now. I may not hesitate and merely look on, when Russia and China are threatened.\";\r\n\t\t//WatsonPersonalityInsights pi = new WatsonPersonalityInsights();\r\n\t\t//jsonResults = pi.getPersonality(BLMX_PI_USER, BLMX_PI_PWORD, text);\r\n\t\t//WatsonToneAnalyzer ta = new WatsonToneAnalyzer();\r\n\t\t//jsonResults = ta.getTone(ToneAnalyzer.VERSION_DATE_2016_05_19, BLMX_TA_USER, BLMX_TA_PWORD, text);\r\n\t\t\r\n\t\tWatsonDocumentConversion dc = new WatsonDocumentConversion();\r\n\t\tString url = \"https://cognizant-ipm.bpm.ibmcloud.com:443/bpm/dev/portal/jsp/ecmDocument?operation=ajax_getDocumentContent&snapshotId=2064.3829fc2c-b76f-4f9d-84fc-e5cf34cb8697&ecmServerConfigurationName=EMBEDDED_ECM_SERVER&documentId=idd_80D78E56-0000-C815-939A-57352E6D520B\";\r\n\t\tString fileName = \"\";\r\n\t\ttry {\r\n\t\t\tjsonResults = dc.convertDocument(\"ANSWERS\",url,fileName, BLMX_DC_USER, BLMX_DC_PWORD, \"[email protected]\", \"Anika@2612\");\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\tSystem.out.println(\"Results > \"+jsonResults);\r\n\t\t\r\n\t\t\r\n\r\n\t}", "@Test\n\tpublic void singleWordGrepTest3() throws Exception {\n\t\t// word is 'mistress'\n\t\tHashSet<String> grepFound = loadGrepResults(\"mistress\");\n\t\tCollection<Page> index = queryTest.query(\"mistress\");\n\t\tHashSet<String> indexFound = new HashSet<String>();\n\n\t\tfor (Page p : index)\n\t\t\tindexFound.add(p.getURL().getPath().toLowerCase());\n\t\t\n\t\t// tests set equality \n\t\tassertEquals(indexFound, grepFound);\n\t}", "private void evaluateNamedEntities(String sentence, ResolutionMode resolutionMode,\n\t\t\tList<String> expectedSurfaceList, List<String> expectedTypeNames,\n \t\t\tList<Double> expectedProbList) throws Exception {\n\n List<NamedEntityType> expectedTypeList = new ArrayList<NamedEntityType>();\n for (String name : expectedTypeNames) {\n expectedTypeList.add(NamedEntityType.valueOf(name));\n }\n\n\t\t// Check that Sentence is not empty\n\t\tassertTrue(\"Extracting String: \",\n\t\t\t\tsentence != null && sentence.length() > 0);\n\n\t\tDocument doc = TextToSciXML.textToSciXML(sentence);\n\t\tIProcessingDocument procDoc = ProcessingDocumentFactory.getInstance()\n\t\t\t\t.makeTokenisedDocument(Tokeniser.getDefaultInstance(), doc);\n\t\t// Check that ProcDoc is not empty\n\t\tassertTrue(procDoc != null);\n\n\t\tList<NamedEntity> neList = recogniser.findNamedEntities(\n\t\t\t\tprocDoc.getTokenSequences(), resolutionMode);\n\t\t// Check that neList is not empty\n\t\tassertTrue(neList != null);\n\n\t\tList<String> actualSurfaceList = new ArrayList<String>();\n\t\tList<Object> actualProbList = new ArrayList<Object>();\n\t\tList<NamedEntityType> actualTypeList = new ArrayList<NamedEntityType>();\n\t\tfor (NamedEntity namedEntity : neList) {\n\t\t\t// Using a count to differentiate between duplicates in a list\n\t\t\tint count = 1;\n\t\t\tString surface = namedEntity.getSurface();\n\t\t\twhile (actualSurfaceList.contains(surface + \"_\"\n\t\t\t\t\t+ String.valueOf(count)))\n\t\t\t\tcount++;\n\n\t\t\tsurface = surface + \"_\" + String.valueOf(count);\n\t\t\tactualSurfaceList.add(surface);\n\t\t\tactualTypeList.add(namedEntity.getType());\n\t\t\tactualProbList.add(namedEntity.getConfidence());\n\n\t\t\t// Check if NamedEntity Surface is in the expectedSurfaceList\n\t\t\tassertTrue(surface + \" is a false positive \",\n\t\t\t\t\texpectedSurfaceList.contains(surface));\n\n\t\t\tif (expectedSurfaceList.contains(surface)) {\n\t\t\t\tint index = expectedSurfaceList.indexOf(surface);\n\t\t\t\tassertEquals(\"Type for \" + namedEntity.getSurface(),\n\t\t\t\t\t\texpectedTypeList.get(index), namedEntity.getType());\n\t\t\t\tif (!NamedEntityType.ONTOLOGY.isInstance(namedEntity.getType())\n && !NamedEntityType.LOCANTPREFIX.isInstance(namedEntity.getType())) {\n\t\t\t\t\tassertEquals(\n\t\t\t\t\t\t\t\"Probability for \" + namedEntity.getSurface(),\n\t\t\t\t\t\t\texpectedProbList.get(index),\n\t\t\t\t\t\t\t(Double) namedEntity.getConfidence(), 1E-15);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t\tfor (String string : expectedSurfaceList) {\n\t\t\tassertTrue(string + \" is a false negative \",\n\t\t\t\t\tactualSurfaceList.contains(string));\n\t\t}\n\n\t}", "@Test\n\t void testLastName() {\n\t\tString expected=\"Faizan\";\n\t\tString actual=user.getLastName();\n\t\tassertEquals(expected, actual);\n\t}", "public static void main(String[] args) {\n String name = \"I love Java I Love Java Java Java\";\n System.out.println(\"starting from 0 \" +name.indexOf(\"Java\"));\n System.out.println(\" starting from 7 \"+name.indexOf(\"Java\", 7));\n System.out.println(\" starting from 7 \"+name.indexOf(\"Java\", 8));\n System.out.println(\" starting from 7 \"+name.indexOf(\"Java\", 9));\n System.out.println(\" starting from 7 \"+name.indexOf(\"Java\", 19));\n System.out.println(\" starting from 7 \"+name.indexOf(\"Java\", 20));\n // ilk java gosterecek yani location of// simdi ise ikinci javayi ariyor +1 ile! (ava I Love )\n //or you can start here + 4 nereden biliyorum +4 cunku\n //java 4 character!!!!!!!!!!! yada ilk aradigin kelimeyi\n // bitiri bitirmez +1 koyarsin eger bilmiyorsam +word.lenght();\n\n int firstJavaLocation = name.indexOf(\"Java\");\n int startingPointToSearchSecondJava = firstJavaLocation+1;\n int secondJavaLocation = name.indexOf(\"Java\",startingPointToSearchSecondJava);\n System.out.println(\"secondJavaLocation = \" + secondJavaLocation);\n //eger cumlede nekadar kelime oldugunu bilmiyorsam I only know there are 3+ words\n // ve sadece ikinci kelimeyi biliyorsam;\n //the word in between first space and second space is second word\n int firstSpaceLocation = name.indexOf(\" \");\n int secondSpace = name.indexOf(\" \", firstJavaLocation + 1);\n System.out.println(\"second word in this sentence is \"\n +name.substring(firstJavaLocation + 1, secondSpace));\n\n\n\n\n }", "public void testFindByKeyword() {\n }", "public static void main(String[] args) {\n\t\tDetectCapital result = new DetectCapital();\n\t\tSystem.out.println(result.detectCapital(\"USA\"));\n\t\tSystem.out.println(result.detectCapital(\"FlaG\"));\n\t\tSystem.out.println(result.detectCapitalI(\"USA\"));\n\t\tSystem.out.println(result.detectCapitalI(\"FlaG\"));\n\t}", "public void testgetEfoDescriptionByName() {\n EFOServiceImpl impl = new EFOServiceImpl();\n String match = \"An experimental factor in Array Express which are essentially the variable aspects of an experiment design which can be used to describe an experiment, or set of experiments, in an increasingly detailed manner.\";\n assertEquals(match, impl.getEfoDescriptionByName(\"experimental factor\"));\n }", "public static void main(String[] args) {\n\t\tFirstOccurence fo = new FirstOccurence();\n\t\tString input = \"mynameissoandsocanyoutellmethat\";\n\t\tString[] dictionary = {\"my\",\"name\",\"is\",\"so\",\"can\",\"you\",\"tell\",\"me\",\"that\",\"and\"};\n\t\tSystem.out.println(fo.insertspace(input,dictionary));\n\t}", "@Test \r\n public void shouldFindOneWordAtTheEnd() {\r\n \r\n String inputWord = \"bxxxxxxxe\";\r\n String[] dictionary =\r\n new String[] {\"able\", \"be\", \"ale\", \"apple\", \"bale\", \"kangaroo\"};\r\n \r\n assertEquals(\"be\", wordSeeker.lookFor(inputWord, dictionary));\r\n }", "@Before\n\tpublic void setUp() throws Exception {\n\t\tList<Paragraph> paragraphs = new ArrayList<Paragraph>();\n\t\tList<Paragraph> paragraphsWithNoSentences = new ArrayList<Paragraph>();\n\t\t\n\t\tScanner sc = null, sc1 = null;\n\t\ttry {\n\t\t\tsc = new Scanner(new File(\"testsearchtext.txt\"));\n\t\t\tsc1 = new Scanner(new File(\"testsearchentity.txt\"));\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tsc.useDelimiter(\"[.]\");\n\t\tsc1.useDelimiter(\"[|]\");\n\t\t\n\t\tList<Sentence> sentences = new ArrayList<Sentence>();\n\t\tint sCount = 0;\n\t\tint pCount = 0;\n\t\twhile(sc.hasNext()){\n\t\t\tString temp = sc.next().trim();\n\n\t\t\tif(sCount > 0 && (sCount%10 == 0 || !sc.hasNext())){\n\t\t\t\tParagraph p = new Paragraph(pCount);\n\t\t\t\tparagraphsWithNoSentences.add(p);\n\t\t\t\t\n\t\t\t\tp = new Paragraph(pCount);\n\t\t\t\tp.setSentences(sentences);\n\t\t\t\tparagraphs.add(p);\n\t\t\t\tpCount++;\n\t\t\t\t\n\t\t\t\tsentences = new ArrayList<Sentence>();\n\t\t\t}\n\t\t\t\n\t\t\tif(!temp.equals(\"\"))\n\t\t\t\tsentences.add(new Sentence((sCount%10), temp));\n\t\t\t\n\t\t\tsCount++;\n\t\t}\n\t\t\n\t\tList<Entity> entities = new ArrayList<Entity>();\n\t\tint currType = -1; \n\t\twhile(sc1.hasNext()){\n\t\t\tString temp = sc1.next().trim();\n\t\t\tif(temp.equals(\"place\")){currType = Entity.PLACE;} else\n\t\t\tif(temp.equals(\"url\")){currType = Entity.URL;} else\n\t\t\tif(temp.equals(\"email\")){currType = Entity.EMAIL;} else\n\t\t\tif(temp.equals(\"address\")){currType = Entity.ADDRESS;} \n\t\t\telse{\n\t\t\t\tentities.add(new Entity(currType, temp));\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tSource s = new Source(\"testsearchtext.txt\", \"testsearchtext.txt\");\n\t\tpt1 = new ProcessedText(s, paragraphs, null); \n\t\t\n\t\ts = new Source(\"testsearchtext1.txt\", \"testsearchtext1.txt\");\n\t\tpt2 = new ProcessedText(s, paragraphsWithNoSentences, null); \n\t\t\n\t\tpt3 = new ProcessedText();\n\t\tpt3.setParagraphs(paragraphs);\n\t\t\n\t\tpt4 = new ProcessedText();\n\t\ts = new Source(\"testsearchtext2.txt\", \"testsearchtext2.txt\");\n\t\tpt4.setMetadata(s);\n\t\t\n\t\ts = new Source(\"testsearchtext3.txt\", \"testsearchtext3.txt\");\n\t\tpt5 = new ProcessedText(s, paragraphs, entities); \n\t\t\n\t\ts = new Source(\"testsearchtext4.txt\", \"testsearchtext4.txt\");\n\t\tpt6 = new ProcessedText(s, null, entities); \n\t}", "public static void main(String[] args) throws IOException {\n \n String s = \" Today's is sunny. She is a sunny girl. To be or not to be. She is in Berlin\\r\\n\"\n\t\t\t\t+ \"today. Sunny Berlin! Berlin is always exciting!\"\n\t\t\t\t+ \"\";\n \n PorterStemmer stemmer = new PorterStemmer();\n Tokenizer tokenizer = new StandardTokenizer();\n Tokenizer wt = new WhitespaceTokenizer();\n\t\t\n final List<String> stop_Words = Arrays.asList(\"is\", \"was\", \"in\", \"to\", \"be\");\n\t\tfinal CharArraySet stopSet = new CharArraySet(stop_Words, true);\n\t\t\n\t\t\n\t\ttokenizer.setReader(new StringReader(s));\n\t\tTokenStream tok = tokenizer;\n\t\t\n\t\ttok = new StopFilter(tok, stopSet);\n\t\ttok.reset();\n\t\t\n\t\tCharTermAttribute attr = tok.addAttribute(CharTermAttribute.class);\n\t\t\n\t\t\n\t\twhile(tok.incrementToken()) {\n\t\t // Grab the term\n\t\t String term = attr.toString();\n\n\t\t System.out.println(term);\n\t\t \n\t\t}\n\t\t\n\t}", "@Test(timeout = 4000)\n public void test53() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"The database key of the entry being cross referenced. Any fields that are missing from the current record are inherited from the field being cross referenced.\");\n assertEquals(\"th databas key of th entr being cros refer. any field that ar mis from th cur record ar inherit from th field being cros refer.\", string0);\n }", "@Test\r\n\tvoid testImportSingleRecordShouldCreateAPersonAndReturnTrue() {\r\n\t\tRecordParser parser = new RecordParser();\r\n\t\tassertTrue(parser.importSingleRecord(\"Cruise | Tom | Male | Green | 1962-07-03\"));\r\n\t\tassertEquals(1, parser.getPeople().size());\r\n\t}", "@Test\n void step() {\n Fb2ConverterStateMachine state = new Fb2ConverterStateMachine();\n StringBuilder sb = new StringBuilder();\n WordsTokenizer wt = new WordsTokenizer(getOriginalText());\n while (wt.hasMoreTokens()) {\n String word = wt.nextToken();\n if (state.step(word)) {\n sb.append(word).append(\" \");\n }\n }\n assertEquals(\"test 1 . text- 2 text 0 text 6111 222 \", sb.toString());\n }", "public static void main(String[] args) {\n MapDictionary<String> dictionary = new MapDictionary<String>();\r\n dictionary.addEntry(new DictionaryEntry<String>(\"50 Cent\",\"\"));\r\n dictionary.addEntry(new DictionaryEntry<String>(\"XYZ120 DVD Player\",\"\"));\r\n dictionary.addEntry(new DictionaryEntry<String>(\"cent\",\"\"));\r\n dictionary.addEntry(new DictionaryEntry<String>(\"dvd player\",\"\"));\r\n\r\n // build the dictionary-chunker:\r\n // dictionary, tokenizer factory, flag1, flag2\r\n // tokenizer will ignore thre blank space in the matching process\r\n // all matches flag:\r\n // sensitive flag: when case sensitivity is enabled, \r\n ExactDictionaryChunker dictionaryChunkerTT\r\n = new ExactDictionaryChunker(dictionary,\r\n IndoEuropeanTokenizerFactory.INSTANCE,\r\n true,true);\r\n\r\n ExactDictionaryChunker dictionaryChunkerTF\r\n = new ExactDictionaryChunker(dictionary,\r\n IndoEuropeanTokenizerFactory.INSTANCE,\r\n true,false);\r\n\r\n ExactDictionaryChunker dictionaryChunkerFT\r\n = new ExactDictionaryChunker(dictionary,\r\n IndoEuropeanTokenizerFactory.INSTANCE,\r\n false,true);\r\n\r\n ExactDictionaryChunker dictionaryChunkerFF\r\n = new ExactDictionaryChunker(dictionary,\r\n IndoEuropeanTokenizerFactory.INSTANCE,\r\n false,false);\r\n\r\n\r\n\r\n System.out.println(\"\\nDICTIONARY\\n\" + dictionary);\r\n \r\n String text = \"50 Cent is hard to distinguish from 50 cent and just plain cent without case.\";\r\n System.out.println(\"TEXT=\" + text);\r\n chunk(dictionaryChunkerFF,text);\r\n \r\n text = \"The product xyz120 DVD player won't match unless it's exact like XYZ120 DVD Player.\";\r\n System.out.println(\"TEXT=\" + text);\r\n chunk(dictionaryChunkerFF,text);\r\n\r\n }", "public static void main(String args[])\n\t{\n\t\tString intro = new String(\"My name is Aisling\");\n\t\t//adding space to make sure the first word is also included\n\t\tintro = \" \" + intro;\n\t\t//creating end index of each word\n\t\tint j = intro.length();\n\t\t//\n\t\t//loops through the string backwards\n\t\tfor(int i = intro.length()-1; i>=0; i--)\n\t\t{\n\t\t\t//checks if its a new word\n\t\t\tif(intro.charAt(i) == ' ')\n\t\t\t{\n\t\t\t\t//prints out words\n\t\t\t\tSystem.out.println(intro.substring(i, j));\n\t\t\t\tj = i;\n\t\t\t}\n\t\t}\n\n\t}", "@Test //TEST FOUR\n void testSpacesAndCapitalsBreedName()\n {\n Rabbit_RegEx rabbit_breed = new Rabbit_RegEx();\n rabbit_breed.setBreedName(\"Netherland Dwarf\");\n assertTrue(rabbit_breed.getBreedName().matches(\"^[A-Za-z][a-zA-Z-][a-zA-z- ]*\"));\n }", "@Test\n public void sanityCheck() {\n Summarizer summarizer = new Summarizer();\n List<String> strings = new ArrayList<String>();\n\n strings.add(\n \"This morning, former President Jonald T. Rump announced that he would be running for re-election in 2024 against the Democratic incumbent, Boe J. Riden. The announcement has startled many Republicans, including Florida Gov. Don ReSanta, who has already announced his campaign. \\\"Look, I respect Rump,\\\" Mr. ReSanta was quoted as saying. \\\"But we just need someone else. The Republican party doesn't need someone who lost to Riden in 2020. If we want to take back the White House, it has to be through someone new.\\\" Later that day, Mr. Rump spat back, saying \\\"Stupid loser ReSanta is too afraid to say what he really thinks! He's mad that I'm running because it means that he's gonna get his ass kicked in the primaries! Sad!\\\" Democrats have also responded to the announcement with surprise. President Riden said in a statement that he was ready to take Rump on, and that he would beat him just like he did in 2020. Other Democrats have been a little more wary, worried that Rump's base would come back in a full force, and possibly lead to another round of violence at Capitol Hill if the election doesn't go Rump's way. Whatever happens, the 2024 election is looking to be the most intense in modern history. MSNABCNN correspondent Machel Raddow reporting.\"\n );\n\n strings.add(\n \"There's a new ice cream shop opening up at 7th Avenue... with a twist! The shop, named \\\"Political Ice Cream,\\\" sells ice cream that is politically-themed! You thought the constant campaigning, ads, debates, opinion pieces, etc. weren't enough? No problem! At Political Ice Cream, you can theme your Ice Cream with political toppings, such as \\\"Blue Wave\\\" M&Ms, or \\\"Make America Great Again\\\" cookie crumbles! Yum, yum! Doesn't that sound delicious? Get yours at 7th Avenue today!\"\n );\n\n List<String> summaries = summarizer.summarize(strings);\n\n System.out.println(summaries.get(0));\n assertTrue(\n summaries\n .get(0)\n .equals(\n \"Former President Jonald T. Rump announced that he would be running for re-election in 2024 against the Democratic incumbent, Boe J. Riden. Florida Gov. Don ReSanta has already announced his campaign. Democrats have also responded with surprise.\"\n )\n );\n\n assertTrue(\n summaries\n .get(1)\n .equals(\n \"Political Ice Cream is a new ice cream shop opening up at 7th Avenue. The shop, named \\\"Political Ice Cream,\\\" sells ice cream that is politically-themed. You can theme your ice cream with political toppings, such as \\\"Blue Wave\\\" M&Ms.\"\n )\n );\n }", "@Test\n public void test_containsKeywords_returnsTrue() {\n ContainsKeywordsPredicate predicate = new ContainsKeywordsPredicate(Collections.singletonList(\"wallet\"));\n assertTrue(predicate.test(new ArticleBuilder().withName(\"Nike wallet\").build()));\n\n // One keyword in finder field\n predicate = new ContainsKeywordsPredicate(Collections.singletonList(\"Alice\"));\n assertTrue(predicate.test(new ArticleBuilder().withFinder(\"Alice Bob\").build()));\n\n // One keyword in description field\n predicate = new ContainsKeywordsPredicate(Collections.singletonList(\"12pm\"));\n assertTrue(predicate.test(new ArticleBuilder().withDescription(\"12pm Library\").build()));\n\n // One keyword in phone field\n predicate = new ContainsKeywordsPredicate(Collections.singletonList(\"88888888\"));\n assertTrue(predicate.test(new ArticleBuilder().withPhone(\"88888888\").build()));\n\n // One keyword in email field\n predicate = new ContainsKeywordsPredicate(Collections.singletonList(\"[email protected]\"));\n assertTrue(predicate.test(new ArticleBuilder().withEmail(\"[email protected]\").build()));\n\n // One keyword in tag field\n predicate = new ContainsKeywordsPredicate(Collections.singletonList(\"black\"));\n assertTrue(predicate.test(new ArticleBuilder().withTags(\"black\", \"blue\").build()));\n\n // Multiple keywords in name field\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"Alice\", \"Bob\"));\n assertTrue(predicate.test(new ArticleBuilder().withName(\"Alice Bob\").build()));\n\n // Multiple keywords in finder field\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"Alice\", \"Bob\"));\n assertTrue(predicate.test(new ArticleBuilder().withFinder(\"Alice Bob\").build()));\n\n // Multiple keywords in description field\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"12pm\", \"Bob\"));\n assertTrue(predicate.test(new ArticleBuilder().withDescription(\"12pm Bob\").build()));\n\n // Multiple keywords in tag field\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"black\", \"Blue\"));\n assertTrue(predicate.test(new ArticleBuilder().withTags(\"black\", \"Blue\").build()));\n\n // Multiple keywords in different fields\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"waLLet\", \"bOB\"));\n assertTrue(predicate.test(new ArticleBuilder().withName(\"wallet\").withFinder(\"Bob\").build()));\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"waLLet\", \"bOB\", \"raining\"));\n assertTrue(predicate.test(new ArticleBuilder().withName(\"wallet\").withFinder(\"Bob\")\n .withDescription(\"Raining heavily\").build()));\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"[email protected]\", \"bOB\", \"blue\"));\n assertTrue(predicate.test(new ArticleBuilder().withEmail(\"[email protected]\")\n .withTags(\"blue\", \"sticker\").withFinder(\"Bob\").build()));\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"66666666\", \"blue\"));\n assertTrue(predicate.test(new ArticleBuilder().withPhone(\"66666666\")\n .withTags(\"blue\", \"sticker\").withDescription(\"blue wallet\").build()));\n }", "@Test(timeout = 4000)\n public void test09() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"weka.core.stemmers.lovinsstemmeryt\");\n assertEquals(\"wek.cor.stemmer.lovinsstemmerys\", string0);\n }", "public String catchPhrase() {\n @SuppressWarnings(\"unchecked\") List<List<String>> catchPhraseLists = (List<List<String>>) faker.fakeValuesService().fetchObject(\"company.buzzwords\");\n return joinSampleOfEachList(catchPhraseLists, \" \");\n }", "@Test(timeout = 4000)\n public void test56() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"Used for alphabetizing, cross referencing, and creating a label when the ``author'' information is missing. This field should not be confused with the key that appears in the cite command and at the beginning of the database entry.\");\n assertEquals(\"us for alphabes, cros refer, and creat a label when th ``author'' inform is mis. th field should not be confus with th key that appear in th cit command and at th begin of th databas entr.\", string0);\n }", "@Test(timeout = 4000)\n public void test59() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"The year of publication or, for an unpublished work, the year it was written. Generally2it should consist of four numerals, such as 1984, although the standard styles can handle any year whose last four n\\npunctuation characters are numerals, such as `hbox{(about 1984)}'.\");\n assertEquals(\"th year of public or, for an unpubl work, th year it wa writ. generally2it should cons of four numer, such as 1984, although th standard styl can handl any year whos last four n\\npunctu character ar numer, such as `hbox{(about 1984)}'.\", string0);\n }", "@Test\n\tpublic void phraseGrepTest1() throws Exception {\n\t\t// phrase is \"I am forced\"\n\t\tHashSet<String> grepFound = loadGrepResults(\"i+am+forced\");\n\t\tCollection<Page> index = queryTest.query(\"\\\"I am Forced\\\"\");\n\t\tHashSet<String> indexFound = new HashSet<String>();\n\n\t\tfor (Page p : index)\n\t\t\tindexFound.add(p.getURL().getPath().toLowerCase());\n\t\t\n\t\t// tests set equality \n\t\tassertEquals(indexFound, grepFound);\n\t}", "@Test\r\n\tpublic void testNameValid() {\r\n\t\tassertTrue(Activity5Query.isNameCorrect(\"JANE\"));\r\n\t\tassertTrue(Activity5Query.isNameCorrect(\"John\"));\r\n\t\tassertTrue(Activity5Query.isNameCorrect(\"Mary\"));\r\n\t\tassertTrue(Activity5Query.isNameCorrect(\" Kurisu\"));\r\n\t\tassertTrue(Activity5Query.isNameCorrect(\"Bond \"));\r\n\t}", "@Test\n\tpublic void testSearchBasedOnRequest1() {\n\t\tsearchBasedOnRequestSetup();\n\t\t\n\t\tPreference prefs = prefManager.getUserPreference();\n\t\tprefs.setThreshold(10000);\n\t\t\n\t\tList<Suggestion> sugg = dm.searchBasedOnRequest(\"Flavorful\", prefs, true);\n\t\tassertTrue(sugg.size() > 0);\n\t\tassertTrue(sugg.get(0).getType() == Suggestion.SENTENCE);\n\t}", "@Test(timeout = 4000)\n public void test19() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"actuad\");\n assertEquals(\"actuas\", string0);\n }", "public static void main(String[] args) {\n\t\t\n\t\tfinal String letters = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*\";\n\n\t\t// b. have a random number generator\n\n\t\tRandom rand = new Random();\n\n\t\t// c. use the random generator to get the charAt a random location based on the\n\t\t// number of characters\n\n\t\tchar char1 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char2 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char3 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char4 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char5 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char6 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char7 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char8 = letters.charAt(rand.nextInt(letters.length()));\n\t\t// d. concatenate the characters together to get the word\n\n\t\tSystem.out.println(\"\" + char1 + char2 + char3 + char4 + char5 + char6 + char7 + char8);\n\t\tSystem.out.println(String.valueOf(char1)+String.valueOf(char2)+String.valueOf(char3)+String.valueOf(char4)+String.valueOf(char5)+String.valueOf(char6)+String.valueOf(char7)+String.valueOf(char8));\n\t\t\t\t\n\n\t\t\n\t\t\n\t\t//Build a username generator absed on lastname and firstname inputs from the user\n\t\t//Conditions: \n\t\t//\t\t\tNo more than 1 username can include either the whole first or last name\n\t\t//\t\t\tAt least 1 username should include numbers\n\t\t//\t\t\tThere needs to be a random component in at least 2 name generations\n\t\t//\t\t\tThe usernames should adhere to the characteristics of typical usernames\n\t\t\n\t\tfinal String numbers = \"1234567890.\";\n\t\tScanner scan = new Scanner(System.in);\n\t\tSystem.out.println(\"Type in your first name > \");\n\t\tString fName = scan.nextLine();\n\t\tSystem.out.println(\"Type in your last name > \");\n\t\tString lName = scan.nextLine();\n\t\t\n\t\tString part1 = fName.toLowerCase().substring(0, rand.nextInt(fName.length()));\n\t\tString part2 = lName.toLowerCase().substring(0, rand.nextInt(lName.length()));\n\t\t\n\t\tSystem.out.println(\"A possible username \" + part1+part2);\n\t\t\n\t\tString part3 = String.valueOf(numbers.charAt(rand.nextInt(numbers.length())));\n\t\tString part4 = String.valueOf(numbers.charAt(rand.nextInt(numbers.length())));\n\t\t\n\t\tSystem.out.println(\"A possible username \" + part1+part2+part3+part4);\n\t\t\n\t\t//Take inputs and Build a decision tree that decides whether to issue a loan or not\n\t\t\n\t\t//https://www.brcommunity.com/images/articles/b624-2full.png\n\t\t\t\n\n\t}", "@Test\n public void test_Name() throws Exception {\n matchInvoke(serviceURL, \"PWDDIC_testSearch_name_req.xml\",\n \"PWDDIC_testSearch_name_res.xml\");\n }", "@Test\n\tpublic void testMiddleTwoThird() {\n\t\t\n\t\tStringMiddle strMiddle = new StringMiddle();\n\t\tString result = strMiddle.middleTwo(\"Practice\");\n\t\tassertEquals(\"ct\", result);\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t// LENGTH();\n//\t\tString str=\"Syntax\";-----------------------\n//\t\t int lengthOfString=str.length();\n//\t\t System.out.println(lengthOfString);\n//\t\t String name=\"Timmy\";---------------------\n//\t\t int lengthOfString=name.length();\n//\t\t System.out.println(lengthOfString);\n//\t\t String name1=\" Syntex Technolody \";------------------\n//\t\t int lengthOfString1=name1.length();\n//\t\t System.out.println(name1.length());\n//\t\t String str2=\"Welcome, students!\";-----------------------\n//\t\t System.out.println(str2.length());\n\t\t// UPPER LOWER cases;\n//\t\t String str3=\"Hello\";\n//\t\t String newString=str3.toUpperCase();\n//\t\t System.out.println(newString);\n//\t\t String lowerCaseString=newString.toLowerCase();\n//\t\t System.out.println(lowerCaseString);\n//\t\t String love=\"Peionies will bring me Love\";\n//\t\t String caseString=love.toUpperCase();\n//\t\t System.out.println(love.toUpperCase());\n//\t\t String job=\"GOOD JOB IS SECCSESS IN LIFE\";\n//\t\t String newString1=job.toLowerCase();\n//\t\t System.out.println(newString1);\n//\t\t //equality;\n//\t\t String p1=\"The Hight is 5 inches\";\n//\t\t String p2=\"The hight is 5 inches\"; //QUASTION---DOES NOT IGNORES CASE!\n//\t\t boolean equality=p1.equalsIgnoreCase(p2);\n//\t\t System.out.println(equality);\n\n\t\tString word1 = \"syntaxsolutions\";\n\t\tString word2 = \"SYNTAXSOLUTIONS\";\n\n\t\tString case1 =word1.toUpperCase();\n\t\tSystem.out.println(case1);\n\n\t\tString case2 = word2.toLowerCase();\n\t\tSystem.out.println(case2);\n\t}", "public static void main(String[] args) throws FileNotFoundException {\n\n ArrayList<String> names = new ArrayList<>();\n Scanner scanner = new Scanner(new File(\"People.csv\"));\n scanner.nextLine();\n while (scanner.hasNext()) {\n String line = scanner.nextLine();\n String[] columns = line.split(\",\");\n String name = columns[1] + \" \" + columns[2];\n names.add(name);\n }\n\n Scanner consoleScanner = new Scanner(System.in);\n System.out.println(\"Type Search Term\");\n String searchTerm = consoleScanner.nextLine();\n\n// String searchTerm = \"mur\";\n\n //solve for via loop\n for (String name: names) {\n if (name.toLowerCase().contains(searchTerm)) {\n System.out.println(name);\n }\n }\n System.out.println();\n\n //solve via stream\n names.stream()\n .map(name -> name.toLowerCase())\n .filter(name -> name.toLowerCase().contains(searchTerm.toLowerCase()))\n// .forEach(System.out::println);\n .collect(Collectors.toCollection(ArrayList<String>::new));\n System.out.println();\n }", "@Test\n void nlpPipeline() {\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 assertFalse(sentences.isEmpty());\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tString[] testSentence = new String[]{\r\n\t\t\t\t\"西三旗硅谷先锋小区半地下室出租,便宜可合租硅谷工信处女干事每月经过下属科室都要亲口交代24口交换机等技术性器件的安装工作\",\r\n\t\t\t\t\"这是一个伸手不见五指的黑夜。我叫孙悟空,我爱北京,我爱Python和C++。\",\r\n\t\t\t \"我不喜欢日本和服。\",\r\n\t\t\t \"雷猴回归人间。\",\r\n\t\t\t \"工信处女干事每月经过下属科室都要亲口交代24口交换机等技术性器件的安装工作\",\r\n\t\t\t \"我需要廉租房\",\r\n\t\t\t \"永和服装饰品有限公司\",\r\n\t\t\t \"我爱北京天安门\",\r\n\t\t\t \"abc\",\r\n\t\t\t \"隐马尔可夫\",\r\n\t\t\t \"雷猴是个好网站\",\r\n\t\t\t \"“Microsoft”一词由“MICROcomputer(微型计算机)”和“SOFTware(软件)”两部分组成\",\r\n\t\t\t \"草泥马和欺实马是今年的流行词汇\",\r\n\t\t\t \"伊藤洋华堂总府店\",\r\n\t\t\t \"中国科学院计算技术研究所\",\r\n\t\t\t \"罗密欧与朱丽叶\",\r\n\t\t\t \"我购买了道具和服装\",\r\n\t\t\t \"PS: 我觉得开源有一个好处,就是能够敦促自己不断改进,避免敞帚自珍\",\r\n\t\t\t \"湖北省石首市\",\r\n\t\t\t \"湖北省十堰市\",\r\n\t\t\t \"总经理完成了这件事情\",\r\n\t\t\t \"电脑修好了\",\r\n\t\t\t \"做好了这件事情就一了百了了\",\r\n\t\t\t \"人们审美的观点是不同的\",\r\n\t\t\t \"我们买了一个美的空调\",\r\n\t\t\t \"线程初始化时我们要注意\",\r\n\t\t\t \"一个分子是由好多原子组织成的\",\r\n\t\t\t \"祝你马到功成\",\r\n\t\t\t \"他掉进了无底洞里\",\r\n\t\t\t \"中国的首都是北京\",\r\n\t\t\t \"孙君意\",\r\n\t\t\t \"外交部发言人马朝旭\",\r\n\t\t\t \"领导人会议和第四届东亚峰会\",\r\n\t\t\t \"在过去的这五年\",\r\n\t\t\t \"还需要很长的路要走\",\r\n\t\t\t \"60周年首都阅兵\",\r\n\t\t\t \"你好人们审美的观点是不同的\",\r\n\t\t\t \"买水果然后去世博园\",\r\n\t\t\t \"但是后来我才知道你是对的\",\r\n\t\t\t \"存在即合理\",\r\n\t\t\t \"的的的的的在的的的的就以和和和\",\r\n\t\t\t \"I love你,不以为耻,反以为rong\",\r\n\t\t\t \"hello你好人们审美的观点是不同的\",\r\n\t\t\t \"很好但主要是基于网页形式\",\r\n\t\t\t \"hello你好人们审美的观点是不同的\",\r\n\t\t\t \"为什么我不能拥有想要的生活\",\r\n\t\t\t \"后来我才\",\r\n\t\t\t \"此次来中国是为了\",\r\n\t\t\t \"使用了它就可以解决一些问题\",\r\n\t\t\t \",使用了它就可以解决一些问题\",\r\n\t\t\t \"其实使用了它就可以解决一些问题\",\r\n\t\t\t \"好人使用了它就可以解决一些问题\",\r\n\t\t\t \"是因为和国家\",\r\n\t\t\t \"老年搜索还支持\",\r\n\t\t\t \"干脆就把那部蒙人的闲法给废了拉倒!RT @laoshipukong : 27日,全国人大常委会第三次审议侵权责任法草案,删除了有关医疗损害责任“举证倒置”的规定。在医患纠纷中本已处于弱势地位的消费者由此将陷入万劫不复的境地。 \",\r\n\t\t\t \"他说的确实在理\",\r\n\t\t\t \"长春市长春节讲话\",\r\n\t\t\t \"结婚的和尚未结婚的\",\r\n\t\t\t \"结合成分子时\",\r\n\t\t\t \"旅游和服务是最好的\",\r\n\t\t\t \"这件事情的确是我的错\",\r\n\t\t\t \"供大家参考指正\",\r\n\t\t\t \"哈尔滨政府公布塌桥原因\",\r\n\t\t\t \"我在机场入口处\",\r\n\t\t\t \"邢永臣摄影报道\",\r\n\t\t\t \"BP神经网络如何训练才能在分类时增加区分度?\",\r\n\t\t\t \"南京市长江大桥\",\r\n\t\t\t \"应一些使用者的建议,也为了便于利用NiuTrans用于SMT研究\",\r\n\t\t\t \"长春市长春药店\",\r\n\t\t\t \"邓颖超生前最喜欢的衣服\",\r\n\t\t\t \"胡锦涛是热爱世界和平的政治局常委\",\r\n\t\t\t \"程序员祝海林和朱会震是在孙健的左面和右面, 范凯在最右面.再往左是李松洪\",\r\n\t\t\t \"一次性交多少钱\",\r\n\t\t\t \"两块五一套,三块八一斤,四块七一本,五块六一条\",\r\n\t\t\t \"小和尚留了一个像大和尚一样的和尚头\",\r\n\t\t\t \"我是中华人民共和国公民;我爸爸是共和党党员; 地铁和平门站\",\r\n\t\t\t \"张晓梅去人民医院做了个B超然后去买了件T恤\",\r\n\t\t\t \"AT&T是一件不错的公司,给你发offer了吗?\",\r\n\t\t\t \"C++和c#是什么关系?11+122=133,是吗?PI=3.14159\",\r\n\t\t\t \"你认识那个和主席握手的的哥吗?他开一辆黑色的士。\",\r\n\t\t\t \"枪杆子中出政权\",\r\n\t\t\t \"张三风同学走上了不归路\",\r\n\t\t\t \"阿Q腰间挂着BB机手里拿着大哥大,说:我一般吃饭不AA制的。\",\r\n\t\t\t \"在1号店能买到小S和大S八卦的书,还有3D电视。\"\r\n\r\n\t\t};\r\n\t\t\r\n\t\tSegment app = new Segment();\r\n\t\t\r\n\t\tfor(String sentence : testSentence)\r\n\t\t\tSystem.out.println(app.cut(sentence));\r\n\t}", "@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 }", "@Test \r\n\tpublic void testConvertForTokenization()\r\n\t{\r\n\t\tArrayList<String> testArrayList = new ArrayList<String>();\r\n\t\ttestArrayList.add(\"This\");\r\n\t\ttestArrayList.add(\"is\");\r\n\t\ttestArrayList.add(\"a\");\r\n\t\ttestArrayList.add(\"test\");\r\n\t\t\r\n\t\tString testSentence = UtilService.convertForTokenization(testArrayList);\r\n\t\t\r\n\t\tassertNotNull(testSentence);\r\n\t\t//note the method adds a space after each word\r\n\t\tassertEquals(\"This is a test \", testSentence.toString());\r\n\t}", "public static void main(String pOptions[]) {\n \n String parameterDirectory = \"[ENTER DEBUGGING DIRECORY]\";\n NamedEntityExtractorParameter neParameter =\n new NamedEntityExtractorParameter(\n parameterDirectory + \"ForenamesDE.txt\",\n parameterDirectory + \"SurnamesDE.txt\",\n parameterDirectory + \"SurnameSuffixesDE_HeinsUndPartner21.txt\",\n parameterDirectory + \"MiddleInitialsDE_HeinsUndPartner21.txt\",\n parameterDirectory + \"TitlesDE_HeinsUndPartner21.txt\",\n parameterDirectory + \"PlacesDE.txt\",\n parameterDirectory + \"OrganizationsStartDE_HeinsUndPartner21.txt\",\n parameterDirectory + \"OrganizationsEndDE_HeinsUndPartner21.txt\",\n parameterDirectory + \"CompositeNE_HeinsUndPartner21.txt\",\n parameterDirectory + \"RegexNE_HeinsUndPartner21.txt\",\n parameterDirectory + \"NameAffixesDE_HeinsUndPartner21.txt\",\n parameterDirectory + \"PlaceAffixesDE_HeinsUndPartner21.txt\",\n parameterDirectory + \"OrganizationsAffixesDE_HeinsUndPartner21.txt\",\n parameterDirectory + \"OrganizationsDE_HeinsUndPartner21.tokenized.txt\",\n \"TestMetaDataAttribute\", false,\n parameterDirectory + \"PlaceIndicatorsDE_HeinsUndPartner21.txt\",\n false, null,\n parameterDirectory + \"PersonNameIndicatorsDE_HeinsUndPartner21.txt\",\n parameterDirectory + \"ProfessionsDE_HeinsUndPartner21.txt\", true,\n parameterDirectory + \"StreetExceptionsDE.txt\",\n parameterDirectory + \"StreetSuffixesDE_HeinsUndPartner21.txt\",\n \"([A-Z][A-Za-z\\\\-\\\\.]*)\",\n \"([0-9\\\\-]{1,4}[a-zA-Z]?|[a-zA-Z\\\\-\\\\/]?|[Nn][Rr][\\\\.]?)\",\n \"(.*-$|^Die.*|^Der.*|^Das.*|[\\\\p{Alpha}]*ring$|.*\\\\/$)\", 2, \n \"([0-9\\\\.]{2,}|^<<.*)\");\n \n NamedEntityExtractor21 neExtractor = new NamedEntityExtractor21(\n neParameter);\n neExtractor.addTempOrganizationName(\"DiE Test ABC GmbH\");\n TestNamedEntityOwner neOwner = new TestNamedEntityOwner();\n \n for (int i = 0; i < neOwner.getNumberOfProcessedTextUnits(); i++) {\n neOwner.replaceProcessedTextUnitFromString(i,\n neExtractor.extractNamedEntities(neOwner\n .getInputTextUnitAsString(i), neOwner));\n }\n System.out.println(neOwner.toString());\n \n }", "@Test\n\tpublic void SecondforWinnerchecker() {\n\t\tString stringOfTestingWord = (\"neword\");\n\t\tboolean ExpectedResult = true;\n\t\tboolean MethodResult = object1.Winnerchecker(stringOfTestingWord);\n\t\tassertEquals(ExpectedResult, MethodResult);\n\t}", "@Test (dataProvider = \"userData\")\n\tpublic void canInputFirstAndLastName(userData John) {\n\t\tboolean expected = true;\n\t\t\n\t\tboolean actual = new AutomationPracticeFormPageObject(driver, baseUrl) \n\t\t.openAutomationWebPage()\n\t\t.inputFirstName(John.getFirstName())\n\t\t.inputLastName(John.getLastName())\n\t\t.isFirstNameAndLastNameFilled();\n\t\t\n\t\tAssert.assertEquals(actual, expected);\n\t}", "public static void main (String[] args) {\n \n doTest (\"hello\");\n doTest (\"query\");\n doTest (\"Mississippi\");\n doTest (\"elephant\");\n doTest (\"Qatar\");\n System.out.println();\n \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}" ]
[ "0.61838347", "0.5956542", "0.5750134", "0.5739621", "0.57008326", "0.56824017", "0.5663054", "0.5659901", "0.562404", "0.56079394", "0.5602404", "0.5570307", "0.55477506", "0.55388266", "0.552417", "0.551308", "0.54795873", "0.54785854", "0.5461597", "0.5461019", "0.54609394", "0.5455551", "0.5453233", "0.5436768", "0.54345465", "0.54333854", "0.54306126", "0.5425091", "0.5411017", "0.5410583", "0.5402", "0.53922343", "0.53792095", "0.53760123", "0.5367353", "0.53594357", "0.5353317", "0.53457725", "0.5316813", "0.5315886", "0.53055197", "0.5298967", "0.52907723", "0.5284865", "0.5282626", "0.5277621", "0.527359", "0.5271144", "0.52707636", "0.5265577", "0.5256632", "0.52505904", "0.52457255", "0.5230892", "0.52196085", "0.5215853", "0.5212397", "0.52096194", "0.5204407", "0.5198708", "0.5193244", "0.5192652", "0.51875633", "0.5186801", "0.5184541", "0.51800674", "0.51759064", "0.5172981", "0.51687634", "0.5162192", "0.5157099", "0.5154947", "0.5148681", "0.51423347", "0.5141417", "0.5141057", "0.5129326", "0.5121953", "0.5121714", "0.5120414", "0.5120219", "0.511978", "0.51196665", "0.5119601", "0.51185465", "0.511839", "0.51166224", "0.51146895", "0.511293", "0.511184", "0.51090646", "0.5103248", "0.51019084", "0.50907326", "0.5088881", "0.50835055", "0.5080927", "0.50795335", "0.50742596", "0.5073356" ]
0.6375532
0
This test demonstrates the recognition of the words 'jackson cook' as forename and surname even though each individual word would have been recognized as city or profession respectively.
@Test public void testNamedEntityRecognitionWithCounterNeuron() { Model m = new Model(null, 1); // number of threads Neuron forenameCategory = m.createNeuron("C-forename"); Neuron surnameCategory = m.createNeuron("C-surname"); Neuron suppressingN = m.createNeuron("SUPPR"); // The following three neurons are used to assign each word activation // a relational id (rid). Here, the relational id specifies the // word position within the sentence. Neuron spaceN = m.createNeuron("SPACE"); Neuron startSignal = m.createNeuron("START-SIGNAL"); Neuron ctNeuron = m.initCounterNeuron(m.createNeuron("RID Counter"), spaceN, // clock signal false, // direction of the clock signal (range end counts) startSignal, // start signal true, // direction of the start signal (range begin counts) false // direction of the counting neuron ); // initCounterNeuron is just a convenience method which creates an ordinary neuron // with some input synapses. // The word input neurons which do not yet possess a relational id. HashMap<String, Neuron> inputNeurons = new HashMap<>(); // The word input neurons with a relational id. HashMap<String, Neuron> relNeurons = new HashMap<>(); String[] words = new String[] { "mr.", "jackson", "cook", "was", "born", "in", "new", "york" }; for(String word: words) { Neuron in = m.createNeuron("W-" + word); Neuron rn = m.initRelationalNeuron( m.createNeuron("WR-" + word), ctNeuron, // RID Counting neuron in, // Input neuron false // Direction of the input neuron ); inputNeurons.put(word, in); relNeurons.put(word, rn); } // The entity neurons represent the concrete meanings of the input words. // The helper function 'initAndNeuron' computes the required bias for a // conjunction of the inputs. Neuron cookSurnameEntity = m.initNeuron( m.createNeuron("E-cook (surname)"), 3, // adjusts the bias new Input() // Requires the word to be recognized .setNeuron(relNeurons.get("cook")) .setWeight(10.0f) // This input requires the input activation to have an // activation value of at least 0.9 .setBiasDelta(0.9) .setRelativeRid(0) // references the current word .setRecurrent(false) .setRangeMatch(EQUALS) .setRangeOutput(true), new Input() // The previous word needs to be a forename .setNeuron(forenameCategory) .setWeight(10.0f) .setBiasDelta(0.9) .setRelativeRid(-1) // references the previous word .setRecurrent(true) // this input is a positive feedback loop .setRangeMatch(NONE), // This neuron may be suppressed by the E-cook (profession) neuron, but there is no // self suppression taking place even though 'E-cook (surname)' is also contained // in the suppressingN. new Input() .setNeuron(suppressingN) .setWeight(-20.0f) .setBiasDelta(1.0) .setRecurrent(true) // this input is a negative feedback loop .setRangeMatch(CONTAINS) ); Neuron cookProfessionEntity = m.initNeuron( m.createNeuron("E-cook (profession)"), 3, new Input() .setNeuron(relNeurons.get("cook")) .setWeight(15.0f) .setBiasDelta(0.9) .setRecurrent(false) .setRangeMatch(EQUALS) .setRangeOutput(true), new Input() .setNeuron(suppressingN) .setWeight(-20.0f) .setBiasDelta(1.0) .setRecurrent(true) .setRangeMatch(CONTAINS) ); Neuron jacksonForenameEntity = m.initNeuron( m.createNeuron("E-jackson (forename)"), 3, new Input() .setNeuron(relNeurons.get("jackson")) .setWeight(10.0f) .setBiasDelta(0.9) .setRelativeRid(0) .setRecurrent(false) .setRangeMatch(EQUALS) .setRangeOutput(true), new Input() .setNeuron(surnameCategory) .setWeight(10.0f) .setBiasDelta(0.9) .setRelativeRid(1) .setRecurrent(true) .setRangeMatch(NONE), new Input() .setNeuron(suppressingN) .setWeight(-20.0f) .setBiasDelta(1.0) .setRecurrent(true) .setRangeMatch(CONTAINED_IN) ); Neuron jacksonCityEntity = m.initNeuron( m.createNeuron("E-jackson (city)"), 3, new Input() .setNeuron(relNeurons.get("jackson")) .setWeight(12.0f) .setBiasDelta(0.9) .setRecurrent(false) .setRangeMatch(EQUALS) .setRangeOutput(true), new Input() .setNeuron(suppressingN) .setWeight(-20.0f) .setBiasDelta(1.0) .setRecurrent(true) .setRangeMatch(CONTAINED_IN) ); m.initNeuron(forenameCategory, -0.001, new Input() // In this example there is only one forename considered. .setNeuron(jacksonForenameEntity) .setWeight(10.0f) .setBiasDelta(0.0) .setRelativeRid(0) .setRangeMatch(EQUALS) .setRangeOutput(true) ); m.initNeuron(surnameCategory, -0.001, new Input() .setNeuron(cookSurnameEntity) .setWeight(10.0f) .setBiasDelta(0.0) .setRelativeRid(0) .setRangeMatch(EQUALS) .setRangeOutput(true) ); m.initNeuron(suppressingN, -0.001, new Input() .setNeuron(cookProfessionEntity) .setWeight(10.0f) .setBiasDelta(0.0) .setRangeMatch(EQUALS) .setRangeOutput(true), new Input() .setNeuron(cookSurnameEntity) .setWeight(10.0f) .setBiasDelta(0.0) .setRangeMatch(EQUALS) .setRangeOutput(true), new Input() .setNeuron(jacksonCityEntity) .setWeight(10.0f) .setBiasDelta(0.0) .setRangeMatch(EQUALS) .setRangeOutput(true), new Input() .setNeuron(jacksonForenameEntity) .setWeight(10.0f) .setBiasDelta(0.0) .setRangeMatch(EQUALS) .setRangeOutput(true) ); // Now that the model is complete, start processing an actual text. Document doc = m.createDocument("mr. jackson cook was born in new york ", 0); // The start signal is used as a starting point for relational id counter. startSignal.addInput(doc, 0, 1, 0); // iteration, begin, end, relational id int i = 0; for(String w: doc.getContent().split(" ")) { int j = i + w.length(); // The space is used as a clock signal to increase the relational id. spaceN.addInput(doc, j, j + 1); // Feed the individual words as inputs into the network. inputNeurons.get(w).addInput(doc, i, j); i = j + 1; } // Search for the best interpretation of this text. doc.process(); System.out.println(doc.neuronActivationsToString(true, false, true)); System.out.println(); System.out.println("Selected Option: " + doc.bestInterpretation.toString()); System.out.println(); System.out.println("Activations of the Surname Category:"); for(Activation act: surnameCategory.getFinalActivations(doc)) { System.out.print(act.key.r + " "); System.out.print(act.key.rid + " "); System.out.print(act.key.o + " "); System.out.print(act.key.n.neuron.get().label + " "); System.out.print(act.finalState.value); } doc.clearActivations(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testNamedEntityRecognitionWithoutCounterNeuron() {\n Model m = new Model(null, 1); // number of threads\n\n Neuron forenameCategory = m.createNeuron(\"C-forename\");\n Neuron surnameCategory = m.createNeuron(\"C-surname\");\n Neuron suppressingN = m.createNeuron(\"SUPPR\");\n\n\n // The word input neurons which do not yet possess a relational id.\n HashMap<String, Neuron> inputNeurons = new HashMap<>();\n\n String[] words = new String[] {\n \"mr.\", \"jackson\", \"cook\", \"was\", \"born\", \"in\", \"new\", \"york\"\n };\n for(String word: words) {\n Neuron in = m.createNeuron(\"W-\" + word);\n\n inputNeurons.put(word, in);\n }\n\n // The entity neurons represent the concrete meanings of the input words.\n // The helper function 'initAndNeuron' computes the required bias for a\n // conjunction of the inputs.\n Neuron cookSurnameEntity = m.initNeuron(\n m.createNeuron(\"E-cook (surname)\"),\n 3.0, // adjusts the bias\n new Input() // Requires the word to be recognized\n .setNeuron(inputNeurons.get(\"cook\"))\n .setWeight(10.0f)\n // This input requires the input activation to have an\n // activation value of at least 0.9\n .setBiasDelta(0.9)\n .setRelativeRid(0) // references the current word\n .setRecurrent(false)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input() // The previous word needs to be a forename\n .setNeuron(forenameCategory)\n .setWeight(10.0f)\n .setBiasDelta(0.9)\n .setRelativeRid(-1) // references the previous word\n .setRecurrent(true) // this input is a positive feedback loop\n .setRangeMatch(NONE)\n .setRangeOutput(false),\n\n // This neuron may be suppressed by the E-cook (profession) neuron, but there is no\n // self suppression taking place even though 'E-cook (surname)' is also contained\n // in the suppressingN.\n new Input()\n .setNeuron(suppressingN)\n .setWeight(-20.0f)\n .setBiasDelta(1.0)\n .setRecurrent(true) // this input is a negative feedback loop\n .setRangeMatch(CONTAINS)\n );\n\n Neuron cookProfessionEntity = m.initNeuron(\n m.createNeuron(\"E-cook (profession)\"),\n 3.0,\n new Input()\n .setNeuron(inputNeurons.get(\"cook\"))\n .setWeight(15.0f)\n .setBiasDelta(0.9)\n .setRecurrent(false)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(suppressingN)\n .setWeight(-20.0f)\n .setBiasDelta(1.0)\n .setRecurrent(true)\n .setRangeMatch(CONTAINS)\n );\n\n Neuron jacksonForenameEntity = m.initNeuron(\n m.createNeuron(\"E-jackson (forename)\"),\n 3.0,\n new Input()\n .setNeuron(inputNeurons.get(\"jackson\"))\n .setWeight(10.0f)\n .setBiasDelta(0.9)\n .setRelativeRid(0)\n .setRecurrent(false)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(surnameCategory)\n .setWeight(10.0f)\n .setBiasDelta(0.9)\n .setRelativeRid(1)\n .setRecurrent(true)\n .setRangeMatch(NONE),\n new Input()\n .setNeuron(suppressingN)\n .setWeight(-20.0f)\n .setBiasDelta(1.0)\n .setRecurrent(true)\n .setRangeMatch(CONTAINED_IN)\n );\n\n Neuron jacksonCityEntity = m.initNeuron(\n m.createNeuron(\"E-jackson (city)\"),\n 3.0,\n new Input()\n .setNeuron(inputNeurons.get(\"jackson\"))\n .setWeight(12.0f)\n .setBiasDelta(0.9)\n .setRecurrent(false)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(suppressingN)\n .setWeight(-20.0f)\n .setBiasDelta(1.0)\n .setRecurrent(true)\n .setRangeMatch(CONTAINED_IN)\n );\n\n m.initNeuron(\n forenameCategory,\n 0.0,\n new Input() // In this example there is only one forename considered.\n .setNeuron(jacksonForenameEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRelativeRid(0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true)\n );\n m.initNeuron(\n surnameCategory,\n -0.001,\n new Input()\n .setNeuron(cookSurnameEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRelativeRid(0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true)\n );\n\n m.initNeuron(\n suppressingN,\n -0.001,\n new Input().setNeuron(cookProfessionEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(cookSurnameEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(jacksonCityEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(jacksonForenameEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true)\n );\n\n\n // Now that the model is complete, start processing an actual text.\n Document doc = m.createDocument(\"mr. jackson cook was born in new york \");\n\n int i = 0;\n int wordPos = 0;\n for(String w: doc.getContent().split(\" \")) {\n int j = i + w.length();\n\n // Feed the individual words as inputs into the network.\n inputNeurons.get(w).addInput(doc, i, j, wordPos);\n i = j + 1;\n wordPos++;\n }\n\n // Search for the best interpretation of this text.\n doc.process();\n\n System.out.println(doc.neuronActivationsToString(true, false, true));\n System.out.println();\n\n System.out.println(\"Final Interpretation: \" + doc.bestInterpretation.toString());\n System.out.println();\n\n System.out.println(\"Activations of the Surname Category:\");\n for(Activation act: surnameCategory.getFinalActivations(doc)) {\n System.out.print(act.key.r + \" \");\n System.out.print(act.key.rid + \" \");\n System.out.print(act.key.o + \" \");\n System.out.print(act.key.n.neuron.get().label + \" \");\n System.out.print(act.finalState.value);\n }\n\n doc.clearActivations();\n }", "@Test\n public void testFullTextSearch_on_a_field() {\n ReadResponse resp = factual.fetch(TABLE,\n new Query().field(\"name\").search(\"Fried Chicken\"));\n\n for (String name : resp.mapStrings(\"name\")) {\n assertTrue(name.toLowerCase().contains(\"frie\")\n || name.toLowerCase().contains(\"fry\")\n || name.toLowerCase().contains(\"chicken\"));\n }\n }", "@Test\r\n\tpublic void teachingUnitContainsPersons() {\r\n\t\tassertTrue(teachu1.containsPerson(\"ErK\"));\r\n\t\tassertTrue(teachu1.containsPerson(\"AlP\"));\r\n\t\tassertFalse(teachu1.containsPerson(\"MaP\"));\r\n\t}", "@Test\n public void testSpinTwoWords() {\n final String actualResult = kata4.spinWord(\"Hey fellow warriors\");\n final String expectedResult = \"Hey wollef sroirraw\";\n assertEquals(expectedResult, actualResult);\n }", "public static void main(String[] args) {\n TrieReplaceWordsAndSearchAssist obj = new TrieReplaceWordsAndSearchAssist();\n obj.insert(\"home\");\n obj.insert(\"homemade\");\n obj.insert(\"homework\");\n obj.search(\"home\");\n \n TrieN pre = obj.baseNode(\"hom\");\n if (pre != null)\n System.out.println(\"Base/partial node exists!!\");\n else {\n System.out.println(\"No such base node\");\n }\n \n // assist\n System.out.println(\"Search Assist...\");\n obj.searchAssist(pre, \"hom\");\n \n // replace with shorter words.\n System.out.println(\"Sentence compaction.\");\n obj.insert(\"cat\");\n obj.insert(\"bat\");\n obj.insert(\"rat\");\n String sentence = \"I am cattle batman I hate rattles\";\n String sentenceArray[] = sentence.split(\" \");\n System.out.println(Arrays.toString(sentenceArray));\n obj.replaceWordsWithShorterWords(sentenceArray);\n System.out.println(Arrays.toString(sentenceArray));\n }", "public void testadvancedSearchTitleAndBody(){\n\t\t\n//\t\tmanager.advancedSearchTitleAndBody(ElasticIndex.analyzed, \"List of international tennis player \",\" Andre Agassi\" );\n\t}", "@Test\n public void printAllWords() {\n // TODO\n }", "@Test(timeout = 4000)\n public void test19() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"how something strange has been published. the first word should be capitalized.end\");\n assertEquals(\"how someth strang ha been publ. th first word should be capital.ens\", string0);\n }", "@Test\r\n public void testSearchPeople() throws MovieDbException {\r\n LOG.info(\"searchPeople\");\r\n String personName = \"Bruce Willis\";\r\n boolean includeAdult = false;\r\n List<Person> result = tmdb.searchPeople(personName, includeAdult, 0);\r\n assertTrue(\"Couldn't find the person\", result.size() > 0);\r\n }", "public void testRecognizer() {\n\t\tfinal int TIPO_COLUMN_NUMBER = 4;\n\t\tfinal int INSEGNA_COLUMN_NUMBER = 3;\n\t\tfinal String FUSION_CR_ID = \"fusion\";\n\t\tfinal String CSV_PATH = \"/tables/Elenco_osterie_tipiche_civici.1386925759.csv\";\n\t\tfinal char COLUMN_SEPARATOR = ';';\n\n\t\t// Load CSV file\n//\t\tFile csvFile = new File(CSV_PATH); \n\t\tFile csvFile = FileUtils.getResourceFile(CSV_PATH);\n\t\tRowTable rowTable = RowTable.loadFromCSV(csvFile, COLUMN_SEPARATOR);\n\t\trowTable.removeHeaders();\n\t\t\n\t\t// Create recognizer\n\t\tSet<String> inputRecognizers = new HashSet<String>();\n\t\tinputRecognizers.add(INPUT_RECOGNIZER_ID);\n\t\tFile modelFile = FileUtils.getSVMModelFile(TWO_FEATURES_OSTERIE_CR_NAME);\n\t\tClassifierFusionCR fusionCR \n\t\t\t= new ClassifierFusionCR(FUSION_CR_ID, \n\t\t\t\t\tRESTAURANT_CONCEPT_ID, \n\t\t\t\t\trowTable, \n\t\t\t\t\tmodelFile, \n\t\t\t\t\tinputRecognizers);\n\t\t\n\t\t// Make list of candidates\n\t\tList<ColumnConceptCandidate> candidates = new ArrayList<ColumnConceptCandidate>();\n\t\tColumnConceptCandidate tipoCandidate\n\t\t\t= new ColumnConceptCandidate(TIPO_COLUMN_NUMBER, \n\t\t\t\t\tRESTAURANT_CONCEPT_ID, \n\t\t\t\t\tTIPO_SIMILARITY_SCORE,\n\t\t\t\t\tINPUT_RECOGNIZER_ID);\n\t\tcandidates.add(tipoCandidate);\n\t\tColumnConceptCandidate insegnaCandidate\n\t\t\t= new ColumnConceptCandidate(INSEGNA_COLUMN_NUMBER, \n\t\t\t\tRESTAURANT_CONCEPT_ID, \n\t\t\t\tINSEGNA_SIMILARITY_SCORE,\n\t\t\t\tINPUT_RECOGNIZER_ID);\n\t\tcandidates.add(insegnaCandidate);\n\t\t\n\t\t// Run recognizer\n\t\tfusionCR.computeScoredCandidates(candidates);\n\t\t\n\t\t// Make sure input candidates are gone...\n\t\tassertTrue(candidates.size() == 1);\n\t\t// ... and replaced with a new fusion candidate\n\t\tColumnConceptCandidate resultingCandidate = candidates.get(0);\n\t\tassertTrue(resultingCandidate.getOriginator().equals(FUSION_CR_ID));\n\t\t\n\t\t// Verify the score of the fusion candidate\n\t\tassertTrue(resultingCandidate.getScore() > 0.7);\n\t}", "public static void main(String[] args) {\n\t\tString text = \"\\\"undifferentiated's thyroid carcinomas were carried out with antisera against calcitonin, calcitonin-gene related peptide (CGRP), somatostatin, and also thyroglobulin, using the PAP method. \";\n\t\ttext = text.replace('\\\"', ' ');\n\t\t\n\t\tStringUtil su = new StringUtil();\n\t\t\n\t\t// Extracting...\n\t\tString text2 = new String(text);\n\t\tEnvironmentVariable.setMoaraHome(\"./\");\n\t\tGeneRecognition gr = new GeneRecognition();\n\t\tArrayList<GeneMention> gms = gr.extract(MentionConstant.MODEL_BC2,text);\n\t\t// Listing mentions...\n\t\tSystem.out.println(\"Start\\tEnd\\tMention\");\n\t\tfor (int i=0; i<gms.size(); i++) {\n\t\t\tGeneMention gm = gms.get(i);\n\t\t\tSystem.out.println(gm.Start() + \"\\t\" + gm.End() + \"\\t\" + gm.Text());\n\t\t\t//System.out.println(text2.substring(gm.Start(), gm.End()));\n\t\t\tSystem.out.println(su.getTokenByPosition(text,gm.Start(),gm.End()).trim());\n\t\t}\n\t\tif (true){\n\t\t\treturn;\n\t\t}\n\t\t// Normalizing mentions...\n\t\tOrganism yeast = new Organism(Constant.ORGANISM_YEAST);\n\t\tOrganism human = new Organism(Constant.ORGANISM_HUMAN);\n\t\tExactMatchingNormalization gn = new ExactMatchingNormalization(human);\n\t\tgms = gn.normalize(text,gms);\n\t\t// Listing normalized identifiers...\n\t\t\n\t\tSystem.out.println(\"\\nStart\\tEnd\\t#Pred\\tMention\");\n\t\tfor (int i=0; i<gms.size(); i++) {\n\t\t\tGeneMention gm = gms.get(i);\n\t\t\tif (gm.GeneIds().size()>0) {\n\t\t\t\tSystem.out.println(gm.Start() + \"\\t\" + gm.End() + \"\\t\" + gm.GeneIds().size() + \n\t\t\t\t\t\"\\t\" + su.getTokenByPosition(text,gm.Start(),gm.End()).trim());\n\t\t\t\tfor (int j=0; j<gm.GeneIds().size(); j++) {\n\t\t\t\t\tGenePrediction gp = gm.GeneIds().get(j);\n\t\t\t\t\tSystem.out.print(\"\\t\" + gp.GeneId() + \" \" + gp.OriginalSynonym() + \" \" + gp.ScoreDisambig());\n\t\t\t\t\tSystem.out.println((gm.GeneId().GeneId().equals(gp.GeneId())?\" (*)\":\"\"));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) throws IOException {\n ArrayList<String> words = new ArrayList<String>();\n BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(\"src/main/resources/test.txt\")));\n String temp;\n while((temp = reader.readLine())!=null){\n words.add(temp);\n }\n\n // Step two: build dat\n DATrie dat = new DATrie(DATrie.InitType.Empty);\n for(String word : words)\n dat.add(word);\n\n // Step three: check word\n System.out.println(dat.contains(\"敏感\")+\" \"+dat.contains(\"敏感地带\") +\" \"+dat.contains(\"晓峰\"));\n System.out.println(dat.maxMatch(\"敏感\", 1));\n }", "public static void main(String[] args) {\n\t\tString input = \"the quick brown fox jumped over the lazy dog\";\n\t\tSystem.out.println(Arrays.toString(tokenize(input)));\n\t\t\n\t\tSystem.out.println(detectPrefix(\"quick\"));\n\t\tSystem.out.println(detectPrefix(\"one\"));\n\t\tSystem.out.println(detectPrefix(\"brown\"));\n\t\t\n\t}", "@Test\n\tvoid runRegExFoundText_LegalCase() throws Exception {\n\t\tmaxScore += 10;\n\t\tRegEx.regEx = \"S(a|r|g)*on\";\n\t\ttry {\n\t\t\tRegExTree ret = RegEx.parse();\n\t\t\tAutomaton a = RegEx.RegExTreeToAutomaton(ret);\n\t\t\ta.toTable();\n\t\t\ta.eliminateEpsilonTransitions();\n\t\t\ta.minimize();\n\t\t\tArrayList<MatchResponse> response = a.search(\"books/babylon.txt\");\n\t\t\tassertEquals(30, response.size());\n\t\t} catch (Exception e) {\n\t\t\tfail();\n\t\t}\n\t\tactualScore += 10;\n\t}", "@Test\r\n public void testToBeOrNotToBe() throws IOException {\r\n System.out.println(\"testing 'To be or not to be' variations\");\r\n String[] sentences = new String[]{\r\n \"to be or not to be\", // correct sentence\r\n \"to ben or not to be\",\r\n \"ro be ot not to be\",\r\n \"to be or nod to bee\"};\r\n\r\n CorpusReader cr = new CorpusReader();\r\n ConfusionMatrixReader cmr = new ConfusionMatrixReader();\r\n SpellCorrector sc = new SpellCorrector(cr, cmr);\r\n for (String s : sentences) {\r\n String output = sc.correctPhrase(s);\r\n System.out.println(String.format(\"Input \\\"%0$s\\\" returned \\\"%1$s\\\"\", s, output));\r\n collector.checkThat(\"input sentence: \" + s + \". \", \"to be or not to be\", IsEqual.equalTo(output));\r\n }\r\n }", "public static void main (String[] args) {\r\n\t\tfindWords(sentence);\r\n\t}", "@Test(timeout = 4000)\n public void test36() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"nam(s) of edit(s), typ as indic in th latic book. if ther is als an author field, then th edit field giv th edit of th bok or cllect in which th refer appear.\");\n assertEquals(\"nam(s) of edit(s), typ as ind in th lat book. if ther is al an author field, then th edit field giv th edit of th bok or cllect in which th refer appear.\", string0);\n }", "public static void main(String[] args) {\n\t\tString fname=\"shahin\",lname=\"Shahin \",fullname=fname+lname;\r\n\t\tString name=\"I live in india\";\r\n\t\tSystem.out.println(\"fname equals lname is \"+fname.equals(lname));\r\n\t\tSystem.out.println(\"fname equals lname is \"+fname.equalsIgnoreCase(lname));\r\n\t\tSystem.out.println(\"fname starts with \"+ \"'shah is'\"+fname.startsWith(\"shah\"));\r\n\t\tSystem.out.println(\"fname ends with \"+ \"'in is'\"+fname.endsWith(\"in\"));\r\n\t\tSystem.out.println(\"fname upper \"+ fname.toUpperCase());\r\n\t\tSystem.out.println(\"lname lower \"+ lname.toLowerCase());\r\n\t\tSystem.out.println(\"lname substring\"+ lname.substring(2));\r\n\t\tSystem.out.println(\"lname substring length\"+ lname.substring(2,3));\r\n\t\tSystem.out.println(\"Trim is \"+ lname.trim());\r\n\t\tSystem.out.println(\"fname equals lname is \"+fname.replace(\"a\", \"b\"));\r\n\t\tSystem.out.println(\"split \"+name.split(\" \")[2]);\r\n\t}", "@Test(timeout = 4000)\n public void test39() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"Name(s) of editor(s), typed as indicated in the LaTeX book. If there is also an author field, then the editor field gives the editor of the bok or cllection in which the reference appears.\");\n assertEquals(\"nam(s) of edit(s), typ as indic in th latic book. if ther is als an author field, then th edit field giv th edit of th bok or cllect in which th refer appear.\", string0);\n }", "@Test(timeout = 4000)\n public void test50() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"usu th addres of th publishes or other typ of institut. for major publish hous, van leun recommens omis th inform entir. for smal publishes, on th other hand, you can help th reader by giv th comples addres.\");\n assertEquals(\"usu th addr of th publish or other typ of institut. for major publ hous, van leun recommen om th inform entir. for smal publish, on th other hand, you can help th reader by giv th compl addr.\", string0);\n }", "@Test\n\tvoid testAddAndSearchWordDataStructureDesign() {\n\t\tAddAndSearchWordDataStructureDesign dict = new AddAndSearchWordDataStructureDesign();\n\t\tdict.addWord(\"bad\");\n\t\tdict.addWord(\"dad\");\n\t\tdict.addWord(\"mad\");\n\t\tassertFalse(dict.search(\"pad\"));\n\t\tassertTrue(dict.search(\"bad\"));\n\t\tassertTrue(dict.search(\".ad\"));\n\t\tassertTrue(dict.search(\"b..\"));\n\t}", "@Test(timeout = 4000)\n public void test48() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"The name of a series or set of books. When citing an entire book, the the title field gives its title and an optional series field gives the name of a series or multi-volume set in which the book is published.\");\n assertEquals(\"th nam of a ser or ses of book. when cit an entir book, th th titl field giv it titl and an opt ser field giv th nam of a ser or mult-volum ses in which th book is publ.\", string0);\n }", "@Test\n public void testPhrase() {\n assertQ(req(\"q\",\"text:now-cow\", \"indent\",\"true\")\n ,\"//*[@numFound='1']\"\n );\n // should generate a query of (now OR cow) and match both docs\n assertQ(req(\"q\",\"text_np:now-cow\", \"indent\",\"true\")\n ,\"//*[@numFound='2']\"\n );\n }", "@Test(timeout = 4000)\n public void test41() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"usually the address of the publisher or other type of institution. for major publishing houses, van leunen recommends omitting the information entirely. for small publishers, on the other hand, you &an help the reader by giving the complete address.\");\n assertEquals(\"usu th addres of th publishes or other typ of institut. for major publish hous, van leun recommens omis th inform entir. for smal publishes, on th other hand, you &an help th reader by giv th comples addres.\", string0);\n }", "@Test(timeout = 4000)\n public void test59() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"Name(s) of editor(s), typed as indicated in the LaTeX book. If there is also an author field, then the editor field gives the editor of the book or collection in which the reference appears.\");\n assertEquals(\"nam(s) of edit(s), typ as indic in th latic book. if ther is als an author field, then th edit field giv th edit of th book or collect in which th refer appear.\", string0);\n }", "@Test(timeout = 4000)\n public void test42() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"any addit inform that can help th reader. th first word should be capital.\");\n assertEquals(\"any addit inform that can help th reader. th first word should be capit.\", string0);\n }", "public static void main(String[] args) {\n String input_one = \"Fourscore and seven years ago our fathers brought forth on this continent a new nation, conceived in liberty and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battlefield of that war. We have come to dedicate a portion of that field as a final resting-place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this. But, in a larger sense, we cannot dedicate — we cannot consecrate — we cannot hallow — this ground. The brave men, living and dead, who struggled here have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us — that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion — that we here highly resolve that these dead shall not have died in vain — that this nation shall have a new birth of freedom and that government of the people, by the people, for the people, shall not perish from the earth.\";\r\n String input_two = \"Oh, say can you see, by the dawn's early light,What so proudly we hailed at the twilight's last gleaming?Whose broad stripes and brightstars,through the perilous fight,O'er the ramparts we watched, were so gallantly streaming?And the rockets' red glare, the bombs bursting in air,Gave proof through the night that our flag was still there.O say, does that star-spangled banner yet waveO'er the land of the free and the home of the brave?On the shore, dimly seen through the mists of the deep,Wherethe foe's haughty host in dread silence reposes,What isthatwhichthe breeze, o'er the towering steep,As it fitfully blows, now conceals, now discloses?Now it catches the gleam of the morning's first beam,In full glory reflected now shines on the stream:'Tis the starspangled banner! O long may it waveO'er the land of the free and the home of the brave. And where is that band who so vauntingly swore That the havoc of war and the battle's confusionA home and a country should leaveus no more?Their blood has wiped out their foulfootstep'spollution.Norefuge could save the hireling and slaveFrom the terror of flight, or the gloom of the grave:And the star-spangled banner in triumph doth waveO'er theland of the free and the home of the brave.Oh! thus be it ever, when freemen shall stand Between their loved homes and the war's desolation!Blest with victory and peace, may the heaven-rescued land Praise the Power that hath made and preserved us a nation.Then conquer we must, for our cause it is just,And this be our motto: In God is our trust. And the star-spangled banner forever shall waveO'er the land of the free and the home of \";\r\n\r\n String input_upper = input_one.toUpperCase();\r\n String input_upper2 = input_two.toUpperCase();\r\n // System.out.println(input_upper);\r\n String[] pattern = { \"FREE\", \"BRAVE\", \"NATION\" };\r\n // Brute Force algorithm\r\n System.out.println();\r\n System.out.println(\"**************************** OUTPUT OF FIRST INPUT FILE: *****************************\");\r\n System.out.println();\r\n System.out.println(\"\\t\\t\\t\\t\\tBRUTE FORCE ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n BF_Search bf = new BF_Search();\r\n long bf_startTime = System.nanoTime();\r\n for (int i = 0; i < pattern.length; i++) {\r\n bf.brute_force_search(input_upper, pattern[i]);\r\n }\r\n long bf_endTime = System.nanoTime();\r\n bf.printBF_Comparison();\r\n System.out.println(\"It took: \" + (bf_endTime - bf_startTime) + \" nanoseconds\");\r\n\r\n // Knuth Moris Pratt algorithm\r\n System.out.println(\"\\t\\t\\t\\t\\tKNUTH MORIS PRATT ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n KMP_Search kmp = new KMP_Search();\r\n long kmp_startTime = System.nanoTime();\r\n for (int i = 0; i < pattern.length; i++) {\r\n kmp.KMPSearch(pattern[i], input_upper);\r\n if (i == pattern.length - 1) {\r\n kmp.printKM_Comparisons();\r\n }\r\n }\r\n long kmp_endTime = System.nanoTime();\r\n System.out.println(\"It took: \" + (kmp_endTime - kmp_startTime) + \" nanoseconds\");\r\n\r\n // Boyer Moore algorithm\r\n System.out.println();\r\n System.out.println(\"\\t\\t\\t\\t\\tBOYER MOORE ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n BM_Search bm = new BM_Search();\r\n char[] bm_input = input_upper.toCharArray();\r\n char[] bm_pattern = new char[] {};\r\n long bm_startTime = System.nanoTime();\r\n for (String i : pattern) {\r\n bm_pattern = i.toCharArray();\r\n bm.bm_search(bm_input, bm_pattern);\r\n if (pattern[pattern.length - 1] == i) {\r\n bm.printBM_Comparison();\r\n }\r\n }\r\n long bm_endTime = System.nanoTime();\r\n System.out.println(\"It took: \" + (bm_endTime - bm_startTime) + \" nanoseconds\");\r\n\r\n // Rabin Karp algorithm\r\n System.out.println(\"\\t\\t\\t\\t\\tRABIN KARP ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n RKA_Search rk = new RKA_Search();\r\n int q = 101;\r\n long rk_startTime = System.nanoTime();\r\n for (int i = 0; i < pattern.length; i++) {\r\n rk.rka_search(pattern[i], input_upper, q);\r\n if (i == pattern.length - 1) {\r\n rk.printRKA_Comparison();\r\n }\r\n }\r\n long rk_endTime = System.nanoTime();\r\n System.out.println(\"It took: \" + (rk_endTime - rk_startTime) + \" nanoseconds\");\r\n System.out.println();\r\n System.out.println(\"************************* OUTPUT OF SECOND INPUT FILE: *******************************\");\r\n // Brute Force algorithm\r\n System.out.println();\r\n // System.out.println();\r\n System.out.println(\"\\t\\t\\t\\t\\tBRUTE FORCE ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n BF_Search bf2 = new BF_Search();\r\n long bf_startTime1 = System.nanoTime();\r\n for (int i = 0; i < pattern.length; i++) {\r\n bf.brute_force_search(input_upper2, pattern[i]);\r\n }\r\n long bf_endTime2 = System.nanoTime();\r\n bf2.printBF_Comparison();\r\n System.out.println(\"It took: \" + (bf_endTime2 - bf_startTime1) + \" nanoseconds\");\r\n\r\n // Knuth Moris Pratt algorithm\r\n System.out.println(\"\\t\\t\\t\\t\\tKNUTH MORIS PRATT ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n KMP_Search kmp2 = new KMP_Search();\r\n long kmp_startTime1 = System.nanoTime();\r\n for (int i = 0; i < pattern.length; i++) {\r\n kmp2.KMPSearch(pattern[i], input_upper2);\r\n if (i == pattern.length - 1) {\r\n kmp2.printKM_Comparisons();\r\n }\r\n }\r\n long kmp_endTime2 = System.nanoTime();\r\n System.out.println(\"It took: \" + (kmp_endTime2 - kmp_startTime1) + \" nanoseconds\");\r\n\r\n // Boyer Moore algorithm\r\n System.out.println(\"\\t\\t\\t\\t\\tBOYER MOORE ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n BM_Search bm2 = new BM_Search();\r\n char[] bm_input2 = input_upper.toCharArray();\r\n char[] bm_pattern2 = new char[] {};\r\n long bm_startTime1 = System.nanoTime();\r\n for (String i : pattern) {\r\n bm_pattern2 = i.toCharArray();\r\n bm.bm_search(bm_input2, bm_pattern2);\r\n if (pattern[pattern.length - 1] == i) {\r\n bm2.printBM_Comparison();\r\n }\r\n }\r\n long bm_endTime2 = System.nanoTime();\r\n System.out.println(\"It took: \" + (bm_endTime2 - bm_startTime1) + \" nanoseconds\");\r\n\r\n // Rabin Karp algorithm\r\n System.out.println(\"\\t\\t\\t\\t\\tRABIN KARP ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n RKA_Search rk2 = new RKA_Search();\r\n int q2 = 101;\r\n long rk_startTime1 = System.nanoTime();\r\n for (int i = 0; i < pattern.length; i++) {\r\n rk2.rka_search(pattern[i], input_upper2, q2);\r\n if (i == pattern.length - 1) {\r\n rk2.printRKA_Comparison();\r\n }\r\n }\r\n long rk_endTime2 = System.nanoTime();\r\n System.out.println(\"It took: \" + (rk_endTime2 - rk_startTime1) + \" nanoseconds\");\r\n }", "@Test\n\tvoid runRegExUpperCaseText_LegalCase() throws Exception {\n\t\tmaxScore += 10;\n\t\tRegEx.regEx = \"SARGON\";\n\t\ttry {\n\t\t\tRegExTree ret = RegEx.parse();\n\t\t\tAutomaton a = RegEx.RegExTreeToAutomaton(ret);\n\t\t\ta.toTable();\n\t\t\ta.eliminateEpsilonTransitions();\n\t\t\ta.minimize();\n\t\t\tArrayList<MatchResponse> response = a.search(\"books/babylon.txt\");\n\t\t\tassertEquals(0, response.size());\n\t\t} catch (Exception e) {\n\t\t\tfail();\n\t\t}\n\t\tactualScore += 10;\n\t}", "public static void main(String[] args) throws IOException \r\n\t{\r\n\t\tString s1 = \"THE SALVADORAN GOVERNMENT TODAY DEPLORED THE DISAPPEARANCE OF SOCIAL DEMOCRATIC LEADER HECTOR OQUELI COLINDRES THIS MORNING IN GUATEMALA.\";\r\n\t\tString soln = classifier.classifyToString(s1);\r\n\t\tSystem.out.println(soln);\r\n\t\tNER n = new NER();\r\n\t\tn.getPersons(s1);\r\n\t\tSystem.out.println(\"\\n\");\r\n\t\tn.getOrgs(s1);\r\n\t\tSystem.out.println(\"\\n\");\r\n\t\tn.getLocations(s1);\r\n\t}", "@Test(timeout = 4000)\n public void test45() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"th nam of a ser or ses of book. when cit an entir book, th th titl field giv it titl and an opt ser field giv th nam of a ser or mult-volum ses in which th book is publ.\");\n assertEquals(\"th nam of a ser or se of book. when cit an entir book, th th titl field giv it titl and an opt ser field giv th nam of a ser or mult-vol se in which th book is publ.\", string0);\n }", "@Test //TEST ONE\n void testCapital1stLetterBreedName()\n {\n Rabbit_RegEx rabbit_breed = new Rabbit_RegEx();\n rabbit_breed.setBreedName(\"AmericanFuzzyLop\"); //American Fuzzy Lop, very cute!\n assertTrue(rabbit_breed.getBreedName().matches(\"^[A-Za-z][a-zA-Z-][a-zA-z- ]*\"));\n }", "@Test(timeout = 4000)\n public void test57() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"us for alphabes, cros refer, and creat a label when th ``author'' inform is mis. th field should not be confus with th key that appear in th cit command and at th begin of th databas entr.\");\n assertEquals(\"us for alphab, cro refer, and creat a label when th ``author'' inform is mi. th field should not be confus with th key that appear in th cit command and at th begin of th datab entr.\", string0);\n }", "@Test(timeout = 4000)\n public void test45() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"how someth strang ha been publ. th first word should be capital.\");\n assertEquals(\"how someth strang ha been publ. th first word should be capit.\", string0);\n }", "@Test(timeout = 4000)\n public void test40() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"usu th addres of th publishes or other typ of institut. for major publish hous, van leun recommens omis th inform entir. for smal publishes, on th other hand, you &an help th reader by giv th comples addres.\");\n assertEquals(\"usu th addr of th publish or other typ of institut. for major publ hous, van leun recommen om th inform entir. for smal publish, on th other hand, you &an help th reader by giv th compl addr.\", string0);\n }", "@Test(timeout = 4000)\n public void test61() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"Usually the address of the publisher or other type of institution. For major publishing houses, van Leunen recommends omitting the information entirely. For small publishers, on the other hand, you can help the reader by giving the complete address.\");\n assertEquals(\"usu th addres of th publishes or other typ of institut. for major publish hous, van leun recommens omis th inform entir. for smal publishes, on th other hand, you can help th reader by giv th comples addres.\", string0);\n }", "public static void main(String[] args) {\n\t\tString [] plop = {\"Hello\", \"Alaska\", \"Dad\", \"Peace\"};\r\n\t\tArrayList<String> tj = findWords(plop);\r\n\t\tSystem.out.println(\"bouh\");\r\n\r\n\t}", "@Test(timeout = 4000)\n public void test31() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"The edition of a book---for example, ``Second''. This should be an ordinal, and should have the first letter capitalized, as shown here; the standard styles convert to lower case when necessary.\");\n assertEquals(\"th edit of a book---for exampl, ``second''. th should be an ordin, and should hav th first letter capital, as shown hes; th standard styl convers to lower cas when neces.\", string0);\n }", "@Test(timeout = 4000)\n public void test51() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"us for alphabes, cros refer, and creat a label when th ``author'' inform is mis. th field should not be confus with th key that appear in th cit command and at th begin of th databas entr.\");\n assertEquals(\"us for alphab, cro refer, and creat a label when th ``author'' inform is mi. th field should not be confus with th key that appear in th cit command and at th begin of th datab entr.\", string0);\n }", "@Test\r\n\tpublic void testCapitalizeAllWords() throws Exception{\r\n\t\tAssert.assertEquals(\"Hello World\", Capitalizer.capitalizeAllWords(\"hello woRLd\"));\r\n\t}", "@Test\n public void testSpinOneWord() {\n final String actualResult = kata4.spinWord(\"This is another test\");\n final String expectedResult = \"This is rehtona test\";\n assertEquals(expectedResult, actualResult);\n }", "@Test(timeout = 4000)\n public void test65() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"How somethig strange haseen published. Thefirst word should be capitalized.\");\n assertEquals(\"how somethig strang haseen publ. thefirst word should be capital.\", string0);\n }", "protected void validateFirstName(){\n Boolean firstName = Pattern.matches(\"[A-Z][a-z]{2,}\",getFirstName());\n System.out.println(nameResult(firstName));\n }", "public void testStrings()\n {\n final ReportStringWriter rptr = new ReportStringWriter();\n\n final StringBuffer sb = new StringBuffer()\n .append(\"Cat food\").append('\\n');\n final Reader netRdr = new StringReader(sb.toString());\n final NamedEntityTree net = new NamedEntityTree();\n net.load(netRdr);\n\n StringReader txtRdr = new StringReader(\"Dog food. Eat more Cat food now.\");\n final Lexer lex = new Lexer();\n lex.load(txtRdr);\n lex.analyze();\n\n final Parser parser = new Parser();\n parser.parse(lex);\n\n net.recognize(rptr, net, 1, lex.getSymbolTable(), parser);\n\n assertEquals( \"ROOT:Cat:food\\n\",\n rptr.toString());\n }", "public static void main(String[] args) {\n\t\tStringTokenizer strToken = new StringTokenizer(\"Hello, my name is Vitaly\", \", \", true);\n\t\twhile(strToken.hasMoreElements()){\n\t\t\tSystem.out.println(\"\\\"\" + strToken.nextToken() + \"\\\"\");\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t\tstrToken = new StringTokenizer(\"Hello, my name is Vitali\", \", \", false);\n\t\twhile(strToken.hasMoreElements()){\n\t\t\tSystem.out.println(\"\\\"\" + strToken.nextToken() + \"\\\"\");\n\t\t}\n\t}", "@Test //TEST TWO\n void testallLowerBreedName()\n {\n Rabbit_RegEx rabbit_breed = new Rabbit_RegEx();\n rabbit_breed.setBreedName(\"dwarfhotot\"); //Dwarf Hotot\n assertTrue(rabbit_breed.getBreedName().matches(\"^[A-Za-z][a-zA-Z-][a-zA-z- ]*\"));\n }", "@Test //TEST FIVE\n void testSpacesAndLowercaseBreedName()\n {\n Rabbit_RegEx rabbit_breed = new Rabbit_RegEx();\n rabbit_breed.setBreedName(\"silver fox\");\n assertTrue(rabbit_breed.getBreedName().matches(\"^[A-Za-z][a-zA-Z-][a-zA-z- ]*\"));\n }", "@Test\n\tpublic void testPetWhenGetNameHarris() {\n\t\tPet dog = new Pet(\"Harris\", \"boo\");\t\t\n\t\tString expect = \"Harris\";\n\t\tString result = dog.getPetName();\t\t\n\t\tassertEquals(expect, result);\t\n\t}", "public static void main(String args[]) {\n\t\tList<String> words = Arrays.asList(\"hi\",\"hello\",\"Bye\",\"Goodbye\");\n\t\twords.stream().forEach(s->s=\" __ \"+s);\n\t\twords.forEach(s->System.out.println(s));\n\t\tSystem.out.println();\n\t\t\n\t\t//using method reference \n\t\twords.stream().map(s->\"_\"+s).forEach(System.out::println);\n\t\tSystem.out.println();\n\t\t\n\t\t//operations using map\n\t\twords.stream().map(s-> s.replace(\"i\", \"eye\")).forEach(System.out::println);\n\t\tSystem.out.println();\n\t\t\n\t\t//filter\n\t\twords.stream().filter(s->s.length()<7).forEach(System.out::println);\n\t\tSystem.out.println();\n\t\t\n\t\t//reduce operation and concatenate operation\n\t\tSystem.out.println(words.stream().reduce(\"\",(s1,s2)->s1.toUpperCase()+(s2.toUpperCase())));\n\t\t\n\t\t//Reduce using map and concat\n\t\tSystem.out.println(words.stream().map(s->s.toUpperCase()).reduce(\"\", (s1,s2)->s1.concat(s2)));\n\t\t\n\t\t//concate words with commas in between them\n\t\tSystem.out.println(words.stream().reduce((s1,s2)->s1.concat(\",\"+s2)).get());\n\t\t\n\t\t//Large array of doubles\n\t\tdouble[] list= new Random().doubles(10).toArray();\n\t\t\n\t}", "@Test\n public void execute_nameParameter() throws ParseException {\n //No user input\n execute_parameterPredicate_test(0, \" \", \"name\", true, false, Collections.emptyList());\n //Single keyword, ignore case, person found.\n execute_parameterPredicate_test(1, \"ElLe\", \"name\", true, false, Arrays.asList(ELLE));\n //Single keyword, case sensitive, person found.\n execute_parameterPredicate_test(0, \"ElLe\", \"name\", false, false, Collections.emptyList());\n //Multiple keywords, ignore case, or condition, multiple people found\n execute_parameterPredicate_test(3, \"Kurz Elle Kunz\", \"name\", true, false, Arrays.asList(CARL, ELLE, FIONA));\n //Multiple keywords, ignore case, and condition, no one found\n execute_parameterPredicate_test(0, \"kurz Elle kunz\", \"name\", true, true, Collections.emptyList());\n //Multiple keywords, case sensitive, or condition, multiple people found\n execute_parameterPredicate_test(2, \"kurz Elle Kunz\", \"name\", false, false, Arrays.asList(ELLE, FIONA));\n //Multiple keywords, case sensitive, and condition, no one found\n execute_parameterPredicate_test(0, \"Kurz Elle kunz\", \"name\", false, true, Collections.emptyList());\n }", "public static void main(String arg[]) {\n String frase1 = \"Había vez circo alegraba el\";\n String frase2 = \"una un que siempre carazón sin temer jamás\";\n String frase3 = \"\";\n\n int inicio1 = 0;\n int fin1 = frase1.indexOf(\" \");\n int inicio2 = 0;\n int fin2 = frase2.indexOf(\" \");\n\n while ((fin1 != -1) || (fin2 != -1)) {\n if (fin1 != -1) {\n frase3 = frase3.concat(frase1.substring(inicio1, fin1 + 1));\n inicio1 = fin1 + 1;\n fin1 = frase1.indexOf(\" \", inicio1);\n }\n if (fin2 != -1) {\n frase3 = frase3.concat(frase2.substring(inicio2, fin2 + 1));\n inicio2 = fin2 + 1;\n fin2 = frase2.indexOf(\" \", inicio2);\n }\n }\n System.out.println(frase3);\n }", "@Test\n\tpublic void testKeywordQuery(){\n\t\t//manager.getResponse(\"american football \"); //match multiple keywords\n//\t\tmanager.getResponse(\"list of Bond 007 movies\");\n//\tmanager.getResponse(\"Disney movies\");\n\t\t//manager.keywordQuery(\"Paul Brown Stadium location\");\n\t\t//manager.keywordQuery(\"0Francesco\");\n System.out.println(\"******* keyword query *******\");\n\t\t//manager.keywordQuery(\"sportspeople in tennis\");\n\t\t//manager.keywordSearch(\"list of movies starring Sean Connery\",ElasticIndex.analyzed,100 );\n//\t\tmanager.keywordSearch(\"movies starring Sean Connery\",ElasticIndex.notStemmed,100 );\n// manager.keywordSearch(\"musical movies tony award\",ElasticIndex.analyzed,100 );\n// manager.keywordSearch(\"movies directed by Woody Allen\",ElasticIndex.analyzed,100 );\n// manager.keywordSearch(\"United states professional sports teams\",ElasticIndex.analyzed,100 );\n// manager.keywordSearch(\"computer games developed by Ubisoft\",ElasticIndex.analyzed,100 );\n// manager.keywordSearch(\"computer games developed by Ubisoft\",ElasticIndex.notStemmed,100 );\n// manager.keywordSearch(\"movies academy award nominations\",ElasticIndex.notStemmed,100 );\n System.out.println(SearchResultUtil.toSummary(manager.keywordSearch(\"movies directed by Woody Allen\",ElasticIndex.notLowercased,20 )));\n //manager.keywordSearch(\"grammy best album in 2012\",ElasticIndex.notAnalyzed,100 );\n //(better than analyzed) manager.keywordSearch(\"grammy best album in 2012\",ElasticIndex.notStemmed,100 );\n System.out.println(\"*****************************\");\n\n\t\t//manager.keywordQuery(\"Disney movies\");\n\t}", "public static void main(String[] args) {\n String words = \"coding:java:selenium:python\";\n String[] splitWords = words.split(\":\");\n System.out.println(Arrays.toString(splitWords));\n System.out.println(\"Length of Array - \" +splitWords.length);\n\n for (String each:splitWords) {\n System.out.println(each);\n\n }\n // How many words in your sentence\n // Most popular interview questions\n // 0 1 2 3 4 5\n String sentence = \"Productive study is makes you motivated\";\n String[] wordsInSentence = sentence.split(\" \");\n System.out.println(\"First words: \" +wordsInSentence[0]);\n System.out.println(\"First words: \" +sentence.split(\" \")[5]);\n System.out.println(\"Number of words in sentence: \" + wordsInSentence.length);\n\n // print all words in separate line\n for (String each:wordsInSentence) {\n System.out.println(each);\n }\n\n\n\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data)\n {\n if (requestCode == REQUEST_CODE && resultCode == RESULT_OK)\n {\n // Populate the wordsList with the String values the recognition engine thought it heard\n ArrayList<String> matches = data.getStringArrayListExtra(\n RecognizerIntent.EXTRA_RESULTS);\n \n for(int i=0;i<matches.size();i++)\n {\n \tif(counter==0)\n \t{\n \t\t\n\t \tif(matches.get(i).equals(\"moo\") || matches.get(i).equals(\"moore\") ||\n\t \t\t\tmatches.get(i).equals(\"mou\") || matches.get(i).equals(\"moon\") ||\n\t \t\t\tmatches.get(i).equals(\"movie\") || matches.get(i).equals(\"boo\")\n\t \t|| matches.get(i).equals(\"boohoo\") || matches.get(i).equals(\"boom\"))\n\t \t{\n\t \t\t\n\t \t\n\t \t\tresume();\n\t \t\tbreak;\n\t \t}\n\t \telse{\n\t \t\twrong();\n\t \t\t}\n \t}\n \telse if(counter==1){\n \t\t\n\t \tif(matches.get(i).equals(\"name\") || matches.get(i).equals(\"names\") ||\n\t \t\t\tmatches.get(i).equals(\"nay\") || matches.get(i).equals(\"neigh\") ||\n\t \t\t\tmatches.get(i).equals(\"nee\") || matches.get(i).equals(\"nays\")\n\t \t\t\t|| matches.get(i).equals(\"knee\") || matches.get(i).equals(\"nees\")\n\t \t\t\t|| matches.get(i).equals(\"ne\") || matches.get(i).equals(\"ni\")){\n\t \t\t\n\t \t\tresume();\n\t \t\tbreak;\n\t \t}\n\t \telse\n\t \t\twrong();\n\t \t\n \t}\n \telse if(counter==2){\n\t \tif(matches.get(i).equals(\"oink\") || matches.get(i).equals(\"on\") ||\n\t \t\t\tmatches.get(i).equals(\"oint\") || matches.get(i).equals(\"point\") ||\n\t \t\t\tmatches.get(i).equals(\"online\") || matches.get(i).equals(\"going\")\n\t \t\t\t|| matches.get(i).equals(\"awning\") || matches.get(i).equals(\"wapking\")){\n\t \t\t\n\t \t\n\t \t\tresume();\n\t \t\tbreak;\n\t \t}\n\t \telse\n\t \t\twrong();\n\t \t\n \t}\n \telse if(counter==3){\n \t\t//TextView tv = (TextView) findViewById(R.id.text);\n \t\t//tv.setText(\"Sheep says?\");\n\t \tif(matches.get(i).equals(\"ba\") || matches.get(i).equals(\"baa\") ||\n\t \t\t\tmatches.get(i).equals(\"bar\") || matches.get(i).equals(\"bah\") ||\n\t \t\t\tmatches.get(i).equals(\"baba\") || matches.get(i).equals(\"bleach\")\n\t \t\t\t|| matches.get(i).equals(\"please\") || matches.get(i).equals(\"plate\")\n\t \t\t\t|| matches.get(i).equals(\"pa\") || matches.get(i).equals(\"paa\")){\n\t \t\t\n\t \t\tresume();\n\t \t\tbreak;\n\t \t}\n\t \telse\n\t \t\twrong();\n \t}\n \telse if(counter==4){\n\t \tif(matches.get(i).equals(\"quack\") || matches.get(i).equals(\"crack\") ||\n\t \t\t\tmatches.get(i).equals(\"kodak\") || matches.get(i).equals(\"back\") ||\n\t \t\t\tmatches.get(i).equals(\"call back\") || matches.get(i).equals(\"quake\")\n\t \t\t\t|| matches.get(i).equals(\"quiet\")|| matches.get(i).equals(\"quiet\")\n\t \t\t\t|| matches.get(i).equals(\"whack\")\n\t \t\t\t|| matches.get(i).equals(\"quack quack\")){\n\t \t\tif(counter<4)\n\t \t\t{\n\t \t\t\tcounter++;\n\t \t\t\tloadActivity();\n\t \t\t}\n\t \t\tresume();\n\t \t\tbreak;\n\t \t}\n\t \telse\n\t \t\twrong();\n \t}\n }\n }\n super.onActivityResult(requestCode, resultCode, data);\n }", "@Test\n\tpublic void simpleNameNormalizationTest() {\n\t\tSystem.out.println(NDLDataUtils.normalizeSimpleName(\"MacMillan, Don\"));\n\t\tSystem.out.println(NDLDataUtils.normalizeSimpleName(\"Jana, DK\"));\n\t\tSystem.out.println(NDLDataUtils.normalizeSimpleName(\"A. Kruger\"));\n\t\tSystem.out.println(NDLDataUtils.normalizeSimpleName(\"Peter axyz ac\"));\n\t\tSystem.out.println(NDLDataUtils.normalizeSimpleName(\"Peter Ãac\"));\n\t\tSystem.out.println(NDLDataUtils.normalizeSimpleName(\"Gestionnaire HAL-SU\"));\n\t\tSystem.out.println(NDLDataUtils.normalizeSimpleName(\"Christophe Penkerc'h\"));\n\t\t\n\t\tSet<String> wrongNameTokens = new HashSet<String>(2);\n\t\twrongNameTokens.add(\"phd\");\n\t\twrongNameTokens.add(\"professor\");\n\t\twrongNameTokens.add(\"of\");\n\t\twrongNameTokens.add(\"nutrition\");\n\t\tSystem.out.println(NDLDataUtils.normalizeSimpleNameByWrongNameTokens(\"A. Kruger PhD, Professor Of Nutrition\",\n\t\t\t\twrongNameTokens));\n\t}", "@Test\n\tpublic void VerifyTheSearchResult() {\n\t\tString searchString = \"The Choice\";\n\t\thomePage.search(searchString);\n\t\tString searchTitle = resultPage.getSearchResultTitle();\n\t\tAssert.assertTrue(searchTitle.contains(searchString));\n\t}", "@Test(timeout = 4000)\n public void test47() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"th sponsor institut of a techn report.uas\");\n assertEquals(\"th spons institut of a techn report.ua\", string0);\n }", "public static void main(String[] args) {\n\t\t\n\t\tString s=\"Jesus is blessing my family\";\n\t\tfindVowelsAndConsonants(s);\n\t\t\n\t}", "@Test\r\n public void testGetCandidateWords() throws IOException {\r\n System.out.println(\"getCandidateWords\");\r\n String word = \"idabetes\";\r\n CorpusReader cr = new CorpusReader();\r\n ConfusionMatrixReader cmr = new ConfusionMatrixReader();\r\n SpellCorrector sc = new SpellCorrector(cr, cmr);\r\n Map<String, Double> result = sc.getCandidateWords(word);\r\n for (String key : result.keySet()) {\r\n System.out.println(key + \", \" + result.get(key));\r\n }\r\n\r\n /*assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");*/\r\n }", "public static void main(String[] args) {\n\t\tString jsonResults = \"\";\r\n\t\tString text = \"Before you discuss the resolution, let me place before you one or two things, I want you to understand two things very clearly and to consider them from the same point of view from which I am placing them before you. I ask you to consider it from my point of view, because if you approve of it, you will be enjoined to carry out all I say. It will be a great responsibility. There are people who ask me whether I am the same man that I was in 1920, or whether there has been any change in me. You are right in asking that question.Let me, however, hasten to assure that I am the same Gandhi as I was in 1920. I have not changed in any fundamental respect. I attach the same importance to non-violence that I did then. If at all, my emphasis on it has grown stronger. There is no real contradiction between the present resolution and my previous writings and utterances.Occasions like the present do not occur in everybody’s and but rarely in anybody’s life. I want you to know and feel that there is nothing but purest Ahimsa in all that I am saying and doing today. The draft resolution of the Working Committee is based on Ahimsa, the contemplated struggle similarly has its roots in Ahimsa. If, therefore, there is any among you who has lost faith in Ahimsa or is wearied of it, let him not vote for this resolution. Let me explain my position clearly. God has vouchsafed to me a priceless gift in the weapon of Ahimsa. I and my Ahimsa are on our trail today. If in the present crisis, when the earth is being scorched by the flames of Himsa and crying for deliverance, I failed to make use of the God given talent, God will not forgive me and I shall be judged unworthy of the great gift. I must act now. I may not hesitate and merely look on, when Russia and China are threatened.\";\r\n\t\t//WatsonPersonalityInsights pi = new WatsonPersonalityInsights();\r\n\t\t//jsonResults = pi.getPersonality(BLMX_PI_USER, BLMX_PI_PWORD, text);\r\n\t\t//WatsonToneAnalyzer ta = new WatsonToneAnalyzer();\r\n\t\t//jsonResults = ta.getTone(ToneAnalyzer.VERSION_DATE_2016_05_19, BLMX_TA_USER, BLMX_TA_PWORD, text);\r\n\t\t\r\n\t\tWatsonDocumentConversion dc = new WatsonDocumentConversion();\r\n\t\tString url = \"https://cognizant-ipm.bpm.ibmcloud.com:443/bpm/dev/portal/jsp/ecmDocument?operation=ajax_getDocumentContent&snapshotId=2064.3829fc2c-b76f-4f9d-84fc-e5cf34cb8697&ecmServerConfigurationName=EMBEDDED_ECM_SERVER&documentId=idd_80D78E56-0000-C815-939A-57352E6D520B\";\r\n\t\tString fileName = \"\";\r\n\t\ttry {\r\n\t\t\tjsonResults = dc.convertDocument(\"ANSWERS\",url,fileName, BLMX_DC_USER, BLMX_DC_PWORD, \"[email protected]\", \"Anika@2612\");\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\tSystem.out.println(\"Results > \"+jsonResults);\r\n\t\t\r\n\t\t\r\n\r\n\t}", "@Test\n\tpublic void singleWordGrepTest3() throws Exception {\n\t\t// word is 'mistress'\n\t\tHashSet<String> grepFound = loadGrepResults(\"mistress\");\n\t\tCollection<Page> index = queryTest.query(\"mistress\");\n\t\tHashSet<String> indexFound = new HashSet<String>();\n\n\t\tfor (Page p : index)\n\t\t\tindexFound.add(p.getURL().getPath().toLowerCase());\n\t\t\n\t\t// tests set equality \n\t\tassertEquals(indexFound, grepFound);\n\t}", "private void evaluateNamedEntities(String sentence, ResolutionMode resolutionMode,\n\t\t\tList<String> expectedSurfaceList, List<String> expectedTypeNames,\n \t\t\tList<Double> expectedProbList) throws Exception {\n\n List<NamedEntityType> expectedTypeList = new ArrayList<NamedEntityType>();\n for (String name : expectedTypeNames) {\n expectedTypeList.add(NamedEntityType.valueOf(name));\n }\n\n\t\t// Check that Sentence is not empty\n\t\tassertTrue(\"Extracting String: \",\n\t\t\t\tsentence != null && sentence.length() > 0);\n\n\t\tDocument doc = TextToSciXML.textToSciXML(sentence);\n\t\tIProcessingDocument procDoc = ProcessingDocumentFactory.getInstance()\n\t\t\t\t.makeTokenisedDocument(Tokeniser.getDefaultInstance(), doc);\n\t\t// Check that ProcDoc is not empty\n\t\tassertTrue(procDoc != null);\n\n\t\tList<NamedEntity> neList = recogniser.findNamedEntities(\n\t\t\t\tprocDoc.getTokenSequences(), resolutionMode);\n\t\t// Check that neList is not empty\n\t\tassertTrue(neList != null);\n\n\t\tList<String> actualSurfaceList = new ArrayList<String>();\n\t\tList<Object> actualProbList = new ArrayList<Object>();\n\t\tList<NamedEntityType> actualTypeList = new ArrayList<NamedEntityType>();\n\t\tfor (NamedEntity namedEntity : neList) {\n\t\t\t// Using a count to differentiate between duplicates in a list\n\t\t\tint count = 1;\n\t\t\tString surface = namedEntity.getSurface();\n\t\t\twhile (actualSurfaceList.contains(surface + \"_\"\n\t\t\t\t\t+ String.valueOf(count)))\n\t\t\t\tcount++;\n\n\t\t\tsurface = surface + \"_\" + String.valueOf(count);\n\t\t\tactualSurfaceList.add(surface);\n\t\t\tactualTypeList.add(namedEntity.getType());\n\t\t\tactualProbList.add(namedEntity.getConfidence());\n\n\t\t\t// Check if NamedEntity Surface is in the expectedSurfaceList\n\t\t\tassertTrue(surface + \" is a false positive \",\n\t\t\t\t\texpectedSurfaceList.contains(surface));\n\n\t\t\tif (expectedSurfaceList.contains(surface)) {\n\t\t\t\tint index = expectedSurfaceList.indexOf(surface);\n\t\t\t\tassertEquals(\"Type for \" + namedEntity.getSurface(),\n\t\t\t\t\t\texpectedTypeList.get(index), namedEntity.getType());\n\t\t\t\tif (!NamedEntityType.ONTOLOGY.isInstance(namedEntity.getType())\n && !NamedEntityType.LOCANTPREFIX.isInstance(namedEntity.getType())) {\n\t\t\t\t\tassertEquals(\n\t\t\t\t\t\t\t\"Probability for \" + namedEntity.getSurface(),\n\t\t\t\t\t\t\texpectedProbList.get(index),\n\t\t\t\t\t\t\t(Double) namedEntity.getConfidence(), 1E-15);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t\tfor (String string : expectedSurfaceList) {\n\t\t\tassertTrue(string + \" is a false negative \",\n\t\t\t\t\tactualSurfaceList.contains(string));\n\t\t}\n\n\t}", "@Test\n\t void testLastName() {\n\t\tString expected=\"Faizan\";\n\t\tString actual=user.getLastName();\n\t\tassertEquals(expected, actual);\n\t}", "public static void main(String[] args) {\n String name = \"I love Java I Love Java Java Java\";\n System.out.println(\"starting from 0 \" +name.indexOf(\"Java\"));\n System.out.println(\" starting from 7 \"+name.indexOf(\"Java\", 7));\n System.out.println(\" starting from 7 \"+name.indexOf(\"Java\", 8));\n System.out.println(\" starting from 7 \"+name.indexOf(\"Java\", 9));\n System.out.println(\" starting from 7 \"+name.indexOf(\"Java\", 19));\n System.out.println(\" starting from 7 \"+name.indexOf(\"Java\", 20));\n // ilk java gosterecek yani location of// simdi ise ikinci javayi ariyor +1 ile! (ava I Love )\n //or you can start here + 4 nereden biliyorum +4 cunku\n //java 4 character!!!!!!!!!!! yada ilk aradigin kelimeyi\n // bitiri bitirmez +1 koyarsin eger bilmiyorsam +word.lenght();\n\n int firstJavaLocation = name.indexOf(\"Java\");\n int startingPointToSearchSecondJava = firstJavaLocation+1;\n int secondJavaLocation = name.indexOf(\"Java\",startingPointToSearchSecondJava);\n System.out.println(\"secondJavaLocation = \" + secondJavaLocation);\n //eger cumlede nekadar kelime oldugunu bilmiyorsam I only know there are 3+ words\n // ve sadece ikinci kelimeyi biliyorsam;\n //the word in between first space and second space is second word\n int firstSpaceLocation = name.indexOf(\" \");\n int secondSpace = name.indexOf(\" \", firstJavaLocation + 1);\n System.out.println(\"second word in this sentence is \"\n +name.substring(firstJavaLocation + 1, secondSpace));\n\n\n\n\n }", "public void testFindByKeyword() {\n }", "public static void main(String[] args) {\n\t\tDetectCapital result = new DetectCapital();\n\t\tSystem.out.println(result.detectCapital(\"USA\"));\n\t\tSystem.out.println(result.detectCapital(\"FlaG\"));\n\t\tSystem.out.println(result.detectCapitalI(\"USA\"));\n\t\tSystem.out.println(result.detectCapitalI(\"FlaG\"));\n\t}", "public void testgetEfoDescriptionByName() {\n EFOServiceImpl impl = new EFOServiceImpl();\n String match = \"An experimental factor in Array Express which are essentially the variable aspects of an experiment design which can be used to describe an experiment, or set of experiments, in an increasingly detailed manner.\";\n assertEquals(match, impl.getEfoDescriptionByName(\"experimental factor\"));\n }", "public static void main(String[] args) {\n\t\tFirstOccurence fo = new FirstOccurence();\n\t\tString input = \"mynameissoandsocanyoutellmethat\";\n\t\tString[] dictionary = {\"my\",\"name\",\"is\",\"so\",\"can\",\"you\",\"tell\",\"me\",\"that\",\"and\"};\n\t\tSystem.out.println(fo.insertspace(input,dictionary));\n\t}", "@Test \r\n public void shouldFindOneWordAtTheEnd() {\r\n \r\n String inputWord = \"bxxxxxxxe\";\r\n String[] dictionary =\r\n new String[] {\"able\", \"be\", \"ale\", \"apple\", \"bale\", \"kangaroo\"};\r\n \r\n assertEquals(\"be\", wordSeeker.lookFor(inputWord, dictionary));\r\n }", "@Before\n\tpublic void setUp() throws Exception {\n\t\tList<Paragraph> paragraphs = new ArrayList<Paragraph>();\n\t\tList<Paragraph> paragraphsWithNoSentences = new ArrayList<Paragraph>();\n\t\t\n\t\tScanner sc = null, sc1 = null;\n\t\ttry {\n\t\t\tsc = new Scanner(new File(\"testsearchtext.txt\"));\n\t\t\tsc1 = new Scanner(new File(\"testsearchentity.txt\"));\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tsc.useDelimiter(\"[.]\");\n\t\tsc1.useDelimiter(\"[|]\");\n\t\t\n\t\tList<Sentence> sentences = new ArrayList<Sentence>();\n\t\tint sCount = 0;\n\t\tint pCount = 0;\n\t\twhile(sc.hasNext()){\n\t\t\tString temp = sc.next().trim();\n\n\t\t\tif(sCount > 0 && (sCount%10 == 0 || !sc.hasNext())){\n\t\t\t\tParagraph p = new Paragraph(pCount);\n\t\t\t\tparagraphsWithNoSentences.add(p);\n\t\t\t\t\n\t\t\t\tp = new Paragraph(pCount);\n\t\t\t\tp.setSentences(sentences);\n\t\t\t\tparagraphs.add(p);\n\t\t\t\tpCount++;\n\t\t\t\t\n\t\t\t\tsentences = new ArrayList<Sentence>();\n\t\t\t}\n\t\t\t\n\t\t\tif(!temp.equals(\"\"))\n\t\t\t\tsentences.add(new Sentence((sCount%10), temp));\n\t\t\t\n\t\t\tsCount++;\n\t\t}\n\t\t\n\t\tList<Entity> entities = new ArrayList<Entity>();\n\t\tint currType = -1; \n\t\twhile(sc1.hasNext()){\n\t\t\tString temp = sc1.next().trim();\n\t\t\tif(temp.equals(\"place\")){currType = Entity.PLACE;} else\n\t\t\tif(temp.equals(\"url\")){currType = Entity.URL;} else\n\t\t\tif(temp.equals(\"email\")){currType = Entity.EMAIL;} else\n\t\t\tif(temp.equals(\"address\")){currType = Entity.ADDRESS;} \n\t\t\telse{\n\t\t\t\tentities.add(new Entity(currType, temp));\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tSource s = new Source(\"testsearchtext.txt\", \"testsearchtext.txt\");\n\t\tpt1 = new ProcessedText(s, paragraphs, null); \n\t\t\n\t\ts = new Source(\"testsearchtext1.txt\", \"testsearchtext1.txt\");\n\t\tpt2 = new ProcessedText(s, paragraphsWithNoSentences, null); \n\t\t\n\t\tpt3 = new ProcessedText();\n\t\tpt3.setParagraphs(paragraphs);\n\t\t\n\t\tpt4 = new ProcessedText();\n\t\ts = new Source(\"testsearchtext2.txt\", \"testsearchtext2.txt\");\n\t\tpt4.setMetadata(s);\n\t\t\n\t\ts = new Source(\"testsearchtext3.txt\", \"testsearchtext3.txt\");\n\t\tpt5 = new ProcessedText(s, paragraphs, entities); \n\t\t\n\t\ts = new Source(\"testsearchtext4.txt\", \"testsearchtext4.txt\");\n\t\tpt6 = new ProcessedText(s, null, entities); \n\t}", "public static void main(String[] args) throws IOException {\n \n String s = \" Today's is sunny. She is a sunny girl. To be or not to be. She is in Berlin\\r\\n\"\n\t\t\t\t+ \"today. Sunny Berlin! Berlin is always exciting!\"\n\t\t\t\t+ \"\";\n \n PorterStemmer stemmer = new PorterStemmer();\n Tokenizer tokenizer = new StandardTokenizer();\n Tokenizer wt = new WhitespaceTokenizer();\n\t\t\n final List<String> stop_Words = Arrays.asList(\"is\", \"was\", \"in\", \"to\", \"be\");\n\t\tfinal CharArraySet stopSet = new CharArraySet(stop_Words, true);\n\t\t\n\t\t\n\t\ttokenizer.setReader(new StringReader(s));\n\t\tTokenStream tok = tokenizer;\n\t\t\n\t\ttok = new StopFilter(tok, stopSet);\n\t\ttok.reset();\n\t\t\n\t\tCharTermAttribute attr = tok.addAttribute(CharTermAttribute.class);\n\t\t\n\t\t\n\t\twhile(tok.incrementToken()) {\n\t\t // Grab the term\n\t\t String term = attr.toString();\n\n\t\t System.out.println(term);\n\t\t \n\t\t}\n\t\t\n\t}", "@Test(timeout = 4000)\n public void test53() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"The database key of the entry being cross referenced. Any fields that are missing from the current record are inherited from the field being cross referenced.\");\n assertEquals(\"th databas key of th entr being cros refer. any field that ar mis from th cur record ar inherit from th field being cros refer.\", string0);\n }", "@Test\r\n\tvoid testImportSingleRecordShouldCreateAPersonAndReturnTrue() {\r\n\t\tRecordParser parser = new RecordParser();\r\n\t\tassertTrue(parser.importSingleRecord(\"Cruise | Tom | Male | Green | 1962-07-03\"));\r\n\t\tassertEquals(1, parser.getPeople().size());\r\n\t}", "@Test\n void step() {\n Fb2ConverterStateMachine state = new Fb2ConverterStateMachine();\n StringBuilder sb = new StringBuilder();\n WordsTokenizer wt = new WordsTokenizer(getOriginalText());\n while (wt.hasMoreTokens()) {\n String word = wt.nextToken();\n if (state.step(word)) {\n sb.append(word).append(\" \");\n }\n }\n assertEquals(\"test 1 . text- 2 text 0 text 6111 222 \", sb.toString());\n }", "public static void main(String args[])\n\t{\n\t\tString intro = new String(\"My name is Aisling\");\n\t\t//adding space to make sure the first word is also included\n\t\tintro = \" \" + intro;\n\t\t//creating end index of each word\n\t\tint j = intro.length();\n\t\t//\n\t\t//loops through the string backwards\n\t\tfor(int i = intro.length()-1; i>=0; i--)\n\t\t{\n\t\t\t//checks if its a new word\n\t\t\tif(intro.charAt(i) == ' ')\n\t\t\t{\n\t\t\t\t//prints out words\n\t\t\t\tSystem.out.println(intro.substring(i, j));\n\t\t\t\tj = i;\n\t\t\t}\n\t\t}\n\n\t}", "public static void main(String[] args) {\n MapDictionary<String> dictionary = new MapDictionary<String>();\r\n dictionary.addEntry(new DictionaryEntry<String>(\"50 Cent\",\"\"));\r\n dictionary.addEntry(new DictionaryEntry<String>(\"XYZ120 DVD Player\",\"\"));\r\n dictionary.addEntry(new DictionaryEntry<String>(\"cent\",\"\"));\r\n dictionary.addEntry(new DictionaryEntry<String>(\"dvd player\",\"\"));\r\n\r\n // build the dictionary-chunker:\r\n // dictionary, tokenizer factory, flag1, flag2\r\n // tokenizer will ignore thre blank space in the matching process\r\n // all matches flag:\r\n // sensitive flag: when case sensitivity is enabled, \r\n ExactDictionaryChunker dictionaryChunkerTT\r\n = new ExactDictionaryChunker(dictionary,\r\n IndoEuropeanTokenizerFactory.INSTANCE,\r\n true,true);\r\n\r\n ExactDictionaryChunker dictionaryChunkerTF\r\n = new ExactDictionaryChunker(dictionary,\r\n IndoEuropeanTokenizerFactory.INSTANCE,\r\n true,false);\r\n\r\n ExactDictionaryChunker dictionaryChunkerFT\r\n = new ExactDictionaryChunker(dictionary,\r\n IndoEuropeanTokenizerFactory.INSTANCE,\r\n false,true);\r\n\r\n ExactDictionaryChunker dictionaryChunkerFF\r\n = new ExactDictionaryChunker(dictionary,\r\n IndoEuropeanTokenizerFactory.INSTANCE,\r\n false,false);\r\n\r\n\r\n\r\n System.out.println(\"\\nDICTIONARY\\n\" + dictionary);\r\n \r\n String text = \"50 Cent is hard to distinguish from 50 cent and just plain cent without case.\";\r\n System.out.println(\"TEXT=\" + text);\r\n chunk(dictionaryChunkerFF,text);\r\n \r\n text = \"The product xyz120 DVD player won't match unless it's exact like XYZ120 DVD Player.\";\r\n System.out.println(\"TEXT=\" + text);\r\n chunk(dictionaryChunkerFF,text);\r\n\r\n }", "@Test //TEST FOUR\n void testSpacesAndCapitalsBreedName()\n {\n Rabbit_RegEx rabbit_breed = new Rabbit_RegEx();\n rabbit_breed.setBreedName(\"Netherland Dwarf\");\n assertTrue(rabbit_breed.getBreedName().matches(\"^[A-Za-z][a-zA-Z-][a-zA-z- ]*\"));\n }", "@Test\n public void sanityCheck() {\n Summarizer summarizer = new Summarizer();\n List<String> strings = new ArrayList<String>();\n\n strings.add(\n \"This morning, former President Jonald T. Rump announced that he would be running for re-election in 2024 against the Democratic incumbent, Boe J. Riden. The announcement has startled many Republicans, including Florida Gov. Don ReSanta, who has already announced his campaign. \\\"Look, I respect Rump,\\\" Mr. ReSanta was quoted as saying. \\\"But we just need someone else. The Republican party doesn't need someone who lost to Riden in 2020. If we want to take back the White House, it has to be through someone new.\\\" Later that day, Mr. Rump spat back, saying \\\"Stupid loser ReSanta is too afraid to say what he really thinks! He's mad that I'm running because it means that he's gonna get his ass kicked in the primaries! Sad!\\\" Democrats have also responded to the announcement with surprise. President Riden said in a statement that he was ready to take Rump on, and that he would beat him just like he did in 2020. Other Democrats have been a little more wary, worried that Rump's base would come back in a full force, and possibly lead to another round of violence at Capitol Hill if the election doesn't go Rump's way. Whatever happens, the 2024 election is looking to be the most intense in modern history. MSNABCNN correspondent Machel Raddow reporting.\"\n );\n\n strings.add(\n \"There's a new ice cream shop opening up at 7th Avenue... with a twist! The shop, named \\\"Political Ice Cream,\\\" sells ice cream that is politically-themed! You thought the constant campaigning, ads, debates, opinion pieces, etc. weren't enough? No problem! At Political Ice Cream, you can theme your Ice Cream with political toppings, such as \\\"Blue Wave\\\" M&Ms, or \\\"Make America Great Again\\\" cookie crumbles! Yum, yum! Doesn't that sound delicious? Get yours at 7th Avenue today!\"\n );\n\n List<String> summaries = summarizer.summarize(strings);\n\n System.out.println(summaries.get(0));\n assertTrue(\n summaries\n .get(0)\n .equals(\n \"Former President Jonald T. Rump announced that he would be running for re-election in 2024 against the Democratic incumbent, Boe J. Riden. Florida Gov. Don ReSanta has already announced his campaign. Democrats have also responded with surprise.\"\n )\n );\n\n assertTrue(\n summaries\n .get(1)\n .equals(\n \"Political Ice Cream is a new ice cream shop opening up at 7th Avenue. The shop, named \\\"Political Ice Cream,\\\" sells ice cream that is politically-themed. You can theme your ice cream with political toppings, such as \\\"Blue Wave\\\" M&Ms.\"\n )\n );\n }", "@Test(timeout = 4000)\n public void test09() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"weka.core.stemmers.lovinsstemmeryt\");\n assertEquals(\"wek.cor.stemmer.lovinsstemmerys\", string0);\n }", "@Test\n public void test_containsKeywords_returnsTrue() {\n ContainsKeywordsPredicate predicate = new ContainsKeywordsPredicate(Collections.singletonList(\"wallet\"));\n assertTrue(predicate.test(new ArticleBuilder().withName(\"Nike wallet\").build()));\n\n // One keyword in finder field\n predicate = new ContainsKeywordsPredicate(Collections.singletonList(\"Alice\"));\n assertTrue(predicate.test(new ArticleBuilder().withFinder(\"Alice Bob\").build()));\n\n // One keyword in description field\n predicate = new ContainsKeywordsPredicate(Collections.singletonList(\"12pm\"));\n assertTrue(predicate.test(new ArticleBuilder().withDescription(\"12pm Library\").build()));\n\n // One keyword in phone field\n predicate = new ContainsKeywordsPredicate(Collections.singletonList(\"88888888\"));\n assertTrue(predicate.test(new ArticleBuilder().withPhone(\"88888888\").build()));\n\n // One keyword in email field\n predicate = new ContainsKeywordsPredicate(Collections.singletonList(\"[email protected]\"));\n assertTrue(predicate.test(new ArticleBuilder().withEmail(\"[email protected]\").build()));\n\n // One keyword in tag field\n predicate = new ContainsKeywordsPredicate(Collections.singletonList(\"black\"));\n assertTrue(predicate.test(new ArticleBuilder().withTags(\"black\", \"blue\").build()));\n\n // Multiple keywords in name field\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"Alice\", \"Bob\"));\n assertTrue(predicate.test(new ArticleBuilder().withName(\"Alice Bob\").build()));\n\n // Multiple keywords in finder field\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"Alice\", \"Bob\"));\n assertTrue(predicate.test(new ArticleBuilder().withFinder(\"Alice Bob\").build()));\n\n // Multiple keywords in description field\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"12pm\", \"Bob\"));\n assertTrue(predicate.test(new ArticleBuilder().withDescription(\"12pm Bob\").build()));\n\n // Multiple keywords in tag field\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"black\", \"Blue\"));\n assertTrue(predicate.test(new ArticleBuilder().withTags(\"black\", \"Blue\").build()));\n\n // Multiple keywords in different fields\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"waLLet\", \"bOB\"));\n assertTrue(predicate.test(new ArticleBuilder().withName(\"wallet\").withFinder(\"Bob\").build()));\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"waLLet\", \"bOB\", \"raining\"));\n assertTrue(predicate.test(new ArticleBuilder().withName(\"wallet\").withFinder(\"Bob\")\n .withDescription(\"Raining heavily\").build()));\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"[email protected]\", \"bOB\", \"blue\"));\n assertTrue(predicate.test(new ArticleBuilder().withEmail(\"[email protected]\")\n .withTags(\"blue\", \"sticker\").withFinder(\"Bob\").build()));\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"66666666\", \"blue\"));\n assertTrue(predicate.test(new ArticleBuilder().withPhone(\"66666666\")\n .withTags(\"blue\", \"sticker\").withDescription(\"blue wallet\").build()));\n }", "public String catchPhrase() {\n @SuppressWarnings(\"unchecked\") List<List<String>> catchPhraseLists = (List<List<String>>) faker.fakeValuesService().fetchObject(\"company.buzzwords\");\n return joinSampleOfEachList(catchPhraseLists, \" \");\n }", "@Test(timeout = 4000)\n public void test56() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"Used for alphabetizing, cross referencing, and creating a label when the ``author'' information is missing. This field should not be confused with the key that appears in the cite command and at the beginning of the database entry.\");\n assertEquals(\"us for alphabes, cros refer, and creat a label when th ``author'' inform is mis. th field should not be confus with th key that appear in th cit command and at th begin of th databas entr.\", string0);\n }", "@Test\n\tpublic void phraseGrepTest1() throws Exception {\n\t\t// phrase is \"I am forced\"\n\t\tHashSet<String> grepFound = loadGrepResults(\"i+am+forced\");\n\t\tCollection<Page> index = queryTest.query(\"\\\"I am Forced\\\"\");\n\t\tHashSet<String> indexFound = new HashSet<String>();\n\n\t\tfor (Page p : index)\n\t\t\tindexFound.add(p.getURL().getPath().toLowerCase());\n\t\t\n\t\t// tests set equality \n\t\tassertEquals(indexFound, grepFound);\n\t}", "@Test(timeout = 4000)\n public void test59() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"The year of publication or, for an unpublished work, the year it was written. Generally2it should consist of four numerals, such as 1984, although the standard styles can handle any year whose last four n\\npunctuation characters are numerals, such as `hbox{(about 1984)}'.\");\n assertEquals(\"th year of public or, for an unpubl work, th year it wa writ. generally2it should cons of four numer, such as 1984, although th standard styl can handl any year whos last four n\\npunctu character ar numer, such as `hbox{(about 1984)}'.\", string0);\n }", "@Test\r\n\tpublic void testNameValid() {\r\n\t\tassertTrue(Activity5Query.isNameCorrect(\"JANE\"));\r\n\t\tassertTrue(Activity5Query.isNameCorrect(\"John\"));\r\n\t\tassertTrue(Activity5Query.isNameCorrect(\"Mary\"));\r\n\t\tassertTrue(Activity5Query.isNameCorrect(\" Kurisu\"));\r\n\t\tassertTrue(Activity5Query.isNameCorrect(\"Bond \"));\r\n\t}", "@Test\n\tpublic void testSearchBasedOnRequest1() {\n\t\tsearchBasedOnRequestSetup();\n\t\t\n\t\tPreference prefs = prefManager.getUserPreference();\n\t\tprefs.setThreshold(10000);\n\t\t\n\t\tList<Suggestion> sugg = dm.searchBasedOnRequest(\"Flavorful\", prefs, true);\n\t\tassertTrue(sugg.size() > 0);\n\t\tassertTrue(sugg.get(0).getType() == Suggestion.SENTENCE);\n\t}", "@Test(timeout = 4000)\n public void test19() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"actuad\");\n assertEquals(\"actuas\", string0);\n }", "public static void main(String[] args) {\n\t\t\n\t\tfinal String letters = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*\";\n\n\t\t// b. have a random number generator\n\n\t\tRandom rand = new Random();\n\n\t\t// c. use the random generator to get the charAt a random location based on the\n\t\t// number of characters\n\n\t\tchar char1 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char2 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char3 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char4 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char5 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char6 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char7 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char8 = letters.charAt(rand.nextInt(letters.length()));\n\t\t// d. concatenate the characters together to get the word\n\n\t\tSystem.out.println(\"\" + char1 + char2 + char3 + char4 + char5 + char6 + char7 + char8);\n\t\tSystem.out.println(String.valueOf(char1)+String.valueOf(char2)+String.valueOf(char3)+String.valueOf(char4)+String.valueOf(char5)+String.valueOf(char6)+String.valueOf(char7)+String.valueOf(char8));\n\t\t\t\t\n\n\t\t\n\t\t\n\t\t//Build a username generator absed on lastname and firstname inputs from the user\n\t\t//Conditions: \n\t\t//\t\t\tNo more than 1 username can include either the whole first or last name\n\t\t//\t\t\tAt least 1 username should include numbers\n\t\t//\t\t\tThere needs to be a random component in at least 2 name generations\n\t\t//\t\t\tThe usernames should adhere to the characteristics of typical usernames\n\t\t\n\t\tfinal String numbers = \"1234567890.\";\n\t\tScanner scan = new Scanner(System.in);\n\t\tSystem.out.println(\"Type in your first name > \");\n\t\tString fName = scan.nextLine();\n\t\tSystem.out.println(\"Type in your last name > \");\n\t\tString lName = scan.nextLine();\n\t\t\n\t\tString part1 = fName.toLowerCase().substring(0, rand.nextInt(fName.length()));\n\t\tString part2 = lName.toLowerCase().substring(0, rand.nextInt(lName.length()));\n\t\t\n\t\tSystem.out.println(\"A possible username \" + part1+part2);\n\t\t\n\t\tString part3 = String.valueOf(numbers.charAt(rand.nextInt(numbers.length())));\n\t\tString part4 = String.valueOf(numbers.charAt(rand.nextInt(numbers.length())));\n\t\t\n\t\tSystem.out.println(\"A possible username \" + part1+part2+part3+part4);\n\t\t\n\t\t//Take inputs and Build a decision tree that decides whether to issue a loan or not\n\t\t\n\t\t//https://www.brcommunity.com/images/articles/b624-2full.png\n\t\t\t\n\n\t}", "@Test\n public void test_Name() throws Exception {\n matchInvoke(serviceURL, \"PWDDIC_testSearch_name_req.xml\",\n \"PWDDIC_testSearch_name_res.xml\");\n }", "@Test\n\tpublic void testMiddleTwoThird() {\n\t\t\n\t\tStringMiddle strMiddle = new StringMiddle();\n\t\tString result = strMiddle.middleTwo(\"Practice\");\n\t\tassertEquals(\"ct\", result);\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t// LENGTH();\n//\t\tString str=\"Syntax\";-----------------------\n//\t\t int lengthOfString=str.length();\n//\t\t System.out.println(lengthOfString);\n//\t\t String name=\"Timmy\";---------------------\n//\t\t int lengthOfString=name.length();\n//\t\t System.out.println(lengthOfString);\n//\t\t String name1=\" Syntex Technolody \";------------------\n//\t\t int lengthOfString1=name1.length();\n//\t\t System.out.println(name1.length());\n//\t\t String str2=\"Welcome, students!\";-----------------------\n//\t\t System.out.println(str2.length());\n\t\t// UPPER LOWER cases;\n//\t\t String str3=\"Hello\";\n//\t\t String newString=str3.toUpperCase();\n//\t\t System.out.println(newString);\n//\t\t String lowerCaseString=newString.toLowerCase();\n//\t\t System.out.println(lowerCaseString);\n//\t\t String love=\"Peionies will bring me Love\";\n//\t\t String caseString=love.toUpperCase();\n//\t\t System.out.println(love.toUpperCase());\n//\t\t String job=\"GOOD JOB IS SECCSESS IN LIFE\";\n//\t\t String newString1=job.toLowerCase();\n//\t\t System.out.println(newString1);\n//\t\t //equality;\n//\t\t String p1=\"The Hight is 5 inches\";\n//\t\t String p2=\"The hight is 5 inches\"; //QUASTION---DOES NOT IGNORES CASE!\n//\t\t boolean equality=p1.equalsIgnoreCase(p2);\n//\t\t System.out.println(equality);\n\n\t\tString word1 = \"syntaxsolutions\";\n\t\tString word2 = \"SYNTAXSOLUTIONS\";\n\n\t\tString case1 =word1.toUpperCase();\n\t\tSystem.out.println(case1);\n\n\t\tString case2 = word2.toLowerCase();\n\t\tSystem.out.println(case2);\n\t}", "public static void main(String[] args) throws FileNotFoundException {\n\n ArrayList<String> names = new ArrayList<>();\n Scanner scanner = new Scanner(new File(\"People.csv\"));\n scanner.nextLine();\n while (scanner.hasNext()) {\n String line = scanner.nextLine();\n String[] columns = line.split(\",\");\n String name = columns[1] + \" \" + columns[2];\n names.add(name);\n }\n\n Scanner consoleScanner = new Scanner(System.in);\n System.out.println(\"Type Search Term\");\n String searchTerm = consoleScanner.nextLine();\n\n// String searchTerm = \"mur\";\n\n //solve for via loop\n for (String name: names) {\n if (name.toLowerCase().contains(searchTerm)) {\n System.out.println(name);\n }\n }\n System.out.println();\n\n //solve via stream\n names.stream()\n .map(name -> name.toLowerCase())\n .filter(name -> name.toLowerCase().contains(searchTerm.toLowerCase()))\n// .forEach(System.out::println);\n .collect(Collectors.toCollection(ArrayList<String>::new));\n System.out.println();\n }", "@Test\n void nlpPipeline() {\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 assertFalse(sentences.isEmpty());\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tString[] testSentence = new String[]{\r\n\t\t\t\t\"西三旗硅谷先锋小区半地下室出租,便宜可合租硅谷工信处女干事每月经过下属科室都要亲口交代24口交换机等技术性器件的安装工作\",\r\n\t\t\t\t\"这是一个伸手不见五指的黑夜。我叫孙悟空,我爱北京,我爱Python和C++。\",\r\n\t\t\t \"我不喜欢日本和服。\",\r\n\t\t\t \"雷猴回归人间。\",\r\n\t\t\t \"工信处女干事每月经过下属科室都要亲口交代24口交换机等技术性器件的安装工作\",\r\n\t\t\t \"我需要廉租房\",\r\n\t\t\t \"永和服装饰品有限公司\",\r\n\t\t\t \"我爱北京天安门\",\r\n\t\t\t \"abc\",\r\n\t\t\t \"隐马尔可夫\",\r\n\t\t\t \"雷猴是个好网站\",\r\n\t\t\t \"“Microsoft”一词由“MICROcomputer(微型计算机)”和“SOFTware(软件)”两部分组成\",\r\n\t\t\t \"草泥马和欺实马是今年的流行词汇\",\r\n\t\t\t \"伊藤洋华堂总府店\",\r\n\t\t\t \"中国科学院计算技术研究所\",\r\n\t\t\t \"罗密欧与朱丽叶\",\r\n\t\t\t \"我购买了道具和服装\",\r\n\t\t\t \"PS: 我觉得开源有一个好处,就是能够敦促自己不断改进,避免敞帚自珍\",\r\n\t\t\t \"湖北省石首市\",\r\n\t\t\t \"湖北省十堰市\",\r\n\t\t\t \"总经理完成了这件事情\",\r\n\t\t\t \"电脑修好了\",\r\n\t\t\t \"做好了这件事情就一了百了了\",\r\n\t\t\t \"人们审美的观点是不同的\",\r\n\t\t\t \"我们买了一个美的空调\",\r\n\t\t\t \"线程初始化时我们要注意\",\r\n\t\t\t \"一个分子是由好多原子组织成的\",\r\n\t\t\t \"祝你马到功成\",\r\n\t\t\t \"他掉进了无底洞里\",\r\n\t\t\t \"中国的首都是北京\",\r\n\t\t\t \"孙君意\",\r\n\t\t\t \"外交部发言人马朝旭\",\r\n\t\t\t \"领导人会议和第四届东亚峰会\",\r\n\t\t\t \"在过去的这五年\",\r\n\t\t\t \"还需要很长的路要走\",\r\n\t\t\t \"60周年首都阅兵\",\r\n\t\t\t \"你好人们审美的观点是不同的\",\r\n\t\t\t \"买水果然后去世博园\",\r\n\t\t\t \"但是后来我才知道你是对的\",\r\n\t\t\t \"存在即合理\",\r\n\t\t\t \"的的的的的在的的的的就以和和和\",\r\n\t\t\t \"I love你,不以为耻,反以为rong\",\r\n\t\t\t \"hello你好人们审美的观点是不同的\",\r\n\t\t\t \"很好但主要是基于网页形式\",\r\n\t\t\t \"hello你好人们审美的观点是不同的\",\r\n\t\t\t \"为什么我不能拥有想要的生活\",\r\n\t\t\t \"后来我才\",\r\n\t\t\t \"此次来中国是为了\",\r\n\t\t\t \"使用了它就可以解决一些问题\",\r\n\t\t\t \",使用了它就可以解决一些问题\",\r\n\t\t\t \"其实使用了它就可以解决一些问题\",\r\n\t\t\t \"好人使用了它就可以解决一些问题\",\r\n\t\t\t \"是因为和国家\",\r\n\t\t\t \"老年搜索还支持\",\r\n\t\t\t \"干脆就把那部蒙人的闲法给废了拉倒!RT @laoshipukong : 27日,全国人大常委会第三次审议侵权责任法草案,删除了有关医疗损害责任“举证倒置”的规定。在医患纠纷中本已处于弱势地位的消费者由此将陷入万劫不复的境地。 \",\r\n\t\t\t \"他说的确实在理\",\r\n\t\t\t \"长春市长春节讲话\",\r\n\t\t\t \"结婚的和尚未结婚的\",\r\n\t\t\t \"结合成分子时\",\r\n\t\t\t \"旅游和服务是最好的\",\r\n\t\t\t \"这件事情的确是我的错\",\r\n\t\t\t \"供大家参考指正\",\r\n\t\t\t \"哈尔滨政府公布塌桥原因\",\r\n\t\t\t \"我在机场入口处\",\r\n\t\t\t \"邢永臣摄影报道\",\r\n\t\t\t \"BP神经网络如何训练才能在分类时增加区分度?\",\r\n\t\t\t \"南京市长江大桥\",\r\n\t\t\t \"应一些使用者的建议,也为了便于利用NiuTrans用于SMT研究\",\r\n\t\t\t \"长春市长春药店\",\r\n\t\t\t \"邓颖超生前最喜欢的衣服\",\r\n\t\t\t \"胡锦涛是热爱世界和平的政治局常委\",\r\n\t\t\t \"程序员祝海林和朱会震是在孙健的左面和右面, 范凯在最右面.再往左是李松洪\",\r\n\t\t\t \"一次性交多少钱\",\r\n\t\t\t \"两块五一套,三块八一斤,四块七一本,五块六一条\",\r\n\t\t\t \"小和尚留了一个像大和尚一样的和尚头\",\r\n\t\t\t \"我是中华人民共和国公民;我爸爸是共和党党员; 地铁和平门站\",\r\n\t\t\t \"张晓梅去人民医院做了个B超然后去买了件T恤\",\r\n\t\t\t \"AT&T是一件不错的公司,给你发offer了吗?\",\r\n\t\t\t \"C++和c#是什么关系?11+122=133,是吗?PI=3.14159\",\r\n\t\t\t \"你认识那个和主席握手的的哥吗?他开一辆黑色的士。\",\r\n\t\t\t \"枪杆子中出政权\",\r\n\t\t\t \"张三风同学走上了不归路\",\r\n\t\t\t \"阿Q腰间挂着BB机手里拿着大哥大,说:我一般吃饭不AA制的。\",\r\n\t\t\t \"在1号店能买到小S和大S八卦的书,还有3D电视。\"\r\n\r\n\t\t};\r\n\t\t\r\n\t\tSegment app = new Segment();\r\n\t\t\r\n\t\tfor(String sentence : testSentence)\r\n\t\t\tSystem.out.println(app.cut(sentence));\r\n\t}", "@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 }", "@Test \r\n\tpublic void testConvertForTokenization()\r\n\t{\r\n\t\tArrayList<String> testArrayList = new ArrayList<String>();\r\n\t\ttestArrayList.add(\"This\");\r\n\t\ttestArrayList.add(\"is\");\r\n\t\ttestArrayList.add(\"a\");\r\n\t\ttestArrayList.add(\"test\");\r\n\t\t\r\n\t\tString testSentence = UtilService.convertForTokenization(testArrayList);\r\n\t\t\r\n\t\tassertNotNull(testSentence);\r\n\t\t//note the method adds a space after each word\r\n\t\tassertEquals(\"This is a test \", testSentence.toString());\r\n\t}", "public static void main(String pOptions[]) {\n \n String parameterDirectory = \"[ENTER DEBUGGING DIRECORY]\";\n NamedEntityExtractorParameter neParameter =\n new NamedEntityExtractorParameter(\n parameterDirectory + \"ForenamesDE.txt\",\n parameterDirectory + \"SurnamesDE.txt\",\n parameterDirectory + \"SurnameSuffixesDE_HeinsUndPartner21.txt\",\n parameterDirectory + \"MiddleInitialsDE_HeinsUndPartner21.txt\",\n parameterDirectory + \"TitlesDE_HeinsUndPartner21.txt\",\n parameterDirectory + \"PlacesDE.txt\",\n parameterDirectory + \"OrganizationsStartDE_HeinsUndPartner21.txt\",\n parameterDirectory + \"OrganizationsEndDE_HeinsUndPartner21.txt\",\n parameterDirectory + \"CompositeNE_HeinsUndPartner21.txt\",\n parameterDirectory + \"RegexNE_HeinsUndPartner21.txt\",\n parameterDirectory + \"NameAffixesDE_HeinsUndPartner21.txt\",\n parameterDirectory + \"PlaceAffixesDE_HeinsUndPartner21.txt\",\n parameterDirectory + \"OrganizationsAffixesDE_HeinsUndPartner21.txt\",\n parameterDirectory + \"OrganizationsDE_HeinsUndPartner21.tokenized.txt\",\n \"TestMetaDataAttribute\", false,\n parameterDirectory + \"PlaceIndicatorsDE_HeinsUndPartner21.txt\",\n false, null,\n parameterDirectory + \"PersonNameIndicatorsDE_HeinsUndPartner21.txt\",\n parameterDirectory + \"ProfessionsDE_HeinsUndPartner21.txt\", true,\n parameterDirectory + \"StreetExceptionsDE.txt\",\n parameterDirectory + \"StreetSuffixesDE_HeinsUndPartner21.txt\",\n \"([A-Z][A-Za-z\\\\-\\\\.]*)\",\n \"([0-9\\\\-]{1,4}[a-zA-Z]?|[a-zA-Z\\\\-\\\\/]?|[Nn][Rr][\\\\.]?)\",\n \"(.*-$|^Die.*|^Der.*|^Das.*|[\\\\p{Alpha}]*ring$|.*\\\\/$)\", 2, \n \"([0-9\\\\.]{2,}|^<<.*)\");\n \n NamedEntityExtractor21 neExtractor = new NamedEntityExtractor21(\n neParameter);\n neExtractor.addTempOrganizationName(\"DiE Test ABC GmbH\");\n TestNamedEntityOwner neOwner = new TestNamedEntityOwner();\n \n for (int i = 0; i < neOwner.getNumberOfProcessedTextUnits(); i++) {\n neOwner.replaceProcessedTextUnitFromString(i,\n neExtractor.extractNamedEntities(neOwner\n .getInputTextUnitAsString(i), neOwner));\n }\n System.out.println(neOwner.toString());\n \n }", "@Test\n\tpublic void SecondforWinnerchecker() {\n\t\tString stringOfTestingWord = (\"neword\");\n\t\tboolean ExpectedResult = true;\n\t\tboolean MethodResult = object1.Winnerchecker(stringOfTestingWord);\n\t\tassertEquals(ExpectedResult, MethodResult);\n\t}", "@Test (dataProvider = \"userData\")\n\tpublic void canInputFirstAndLastName(userData John) {\n\t\tboolean expected = true;\n\t\t\n\t\tboolean actual = new AutomationPracticeFormPageObject(driver, baseUrl) \n\t\t.openAutomationWebPage()\n\t\t.inputFirstName(John.getFirstName())\n\t\t.inputLastName(John.getLastName())\n\t\t.isFirstNameAndLastNameFilled();\n\t\t\n\t\tAssert.assertEquals(actual, expected);\n\t}", "public static void main (String[] args) {\n \n doTest (\"hello\");\n doTest (\"query\");\n doTest (\"Mississippi\");\n doTest (\"elephant\");\n doTest (\"Qatar\");\n System.out.println();\n \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}" ]
[ "0.6376453", "0.61833465", "0.57489777", "0.57396966", "0.57002735", "0.56823343", "0.5662533", "0.5660057", "0.5623393", "0.56075776", "0.56031716", "0.55711484", "0.5548709", "0.55393547", "0.55245787", "0.5513841", "0.5480229", "0.54784125", "0.5462393", "0.54615086", "0.5460826", "0.5456031", "0.5454105", "0.54372203", "0.54351836", "0.5433148", "0.54301333", "0.5424619", "0.5411511", "0.541107", "0.5401883", "0.53929347", "0.5378723", "0.5376486", "0.536754", "0.5359887", "0.53537446", "0.53464556", "0.5316404", "0.5315578", "0.53056866", "0.529833", "0.5290954", "0.52851415", "0.5282838", "0.52781177", "0.52737147", "0.52712953", "0.5269769", "0.52653533", "0.52568007", "0.52512705", "0.52476037", "0.5231451", "0.52193177", "0.5216089", "0.5212528", "0.52094346", "0.5204705", "0.51996326", "0.5193561", "0.51921463", "0.5187924", "0.5186112", "0.51845044", "0.5178903", "0.5175933", "0.51726246", "0.5167902", "0.516318", "0.5157768", "0.51538944", "0.51482606", "0.5142279", "0.5142134", "0.51415694", "0.51292455", "0.5122238", "0.51220983", "0.51214314", "0.51211697", "0.5120787", "0.51202816", "0.51194674", "0.5118828", "0.5118677", "0.5116887", "0.5114198", "0.51127154", "0.5111718", "0.5108117", "0.51034313", "0.51019996", "0.5089993", "0.5088977", "0.5081997", "0.5081639", "0.5078413", "0.50742745", "0.50729376" ]
0.59572935
2
public abstract boolean isPageLoaded(String pageURL);
public void OpenUrl(WebDriver driver, String urlValue) { driver.get(urlValue); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void thePageIsLoaded() {\r\n this.page.isLoaded();\r\n }", "boolean hasPage();", "boolean hasPage();", "@Override\r\n\tpublic boolean isPageLoaded() {\n\t\treturn false;\r\n\t}", "boolean hasPage(String page);", "boolean isLoaded();", "@Test(priority = 1)\n public void testIsPageLoad() throws MalformedURLException {\n\t\tassertTrue(true);\n }", "public boolean isPageLoaded (String title){\n botStyle.waitForPageTitle(title, 60);\n return driver.getTitle().equals(title);\n }", "@Override\n\tprotected void isLoaded() throws Error {\n\t\tif (!isPageLoaded) {\n\t\t\tAssert.fail();\n\t\t}\n\t}", "public boolean isPageComplete();", "public boolean isLoaded();", "public abstract boolean Verifypage();", "public boolean verifyPageLoad() {\n\t\tboolean result = lnkLoginButton.isDisplayed();\n\t\tLog.info(\"Home Page Loaded Successfully\");\n\t\treturn result;\n\t}", "public boolean checkPageUrlToBe(String url) {\n return new WebDriverWait(webDriver, DRIVER_WAIT_TIME).until(ExpectedConditions.urlToBe(url));\n }", "@Override\n public boolean isPageLoaded() {\n\n setLogString(\"Verify the savings Page is loaded\", true, CustomLogLevel.LOW);\n return isDisplayed(getDriver(), By.cssSelector(SAVINGS_CONTAINER), TINY_TIMEOUT)\n && isDisplayed(getDriver(), By.className(SAVINGS_DOLLARS), TINY_TIMEOUT)\n && isDisplayed(getDriver(), By.cssSelector(MENU_SAVINGS), TINY_TIMEOUT);\n\n }", "@Step(\"Waiting for page load\")\n public abstract PageBase load();", "public HomePage verifyPageLoaded() {\n\n (new WebDriverWait(driver, timeout)).until(new ExpectedCondition<Boolean>() {\n public Boolean apply(WebDriver d) {\n return d.getPageSource().contains(pageLoadedText);\n }\n });\n return this;\n }", "public boolean isPageLoaded(int i) {\n waitUntilElementIsClickable(navigationBar);\n return webDriver.getCurrentUrl().contains(\"https://www.google.com/search\")\n && currentPageIndicator.getText().equals(String.valueOf(i+1))\n && webDriver.getTitle().contains(\"Google\");\n }", "@Override\n\tprotected void load() {\n\t\tisPageLoaded = true;\n\t}", "public boolean hasPage() {\n return page_ != null;\n }", "@Override\n protected void isLoaded(){\n String url = driver.getCurrentUrl();\n Assert.assertTrue(url.contains(\"users\"), \"Not on Login page: \".concat(url));\n }", "public boolean isPageOpened() {\n\t\ttry {\n\t\t\tTechnicalComponents.waitTill(txtUpgradeAccount, \"visible\");\n\t\t\tif (driver.getCurrentUrl().contains(urlsuffix)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch (FrameworkException e) {\n\t\t\tthrow new FrameworkException(\n\t\t\t\t\t\"Upgarde page Not Loaded within specified time.---\" + e.getClass() + \"---\" + e.getMessage());\n\t\t}\n\n\t}", "public void validatePageLoad() {\n\t\tJavascriptExecutor js;\n\t\tjs = (JavascriptExecutor) uiElementAction.driver;\n\t\tboolean assertion =\n\t\t\t\tjs.executeScript(\"return document.readyState\").equals(\"complete\") == true;\n\t\tLog.info(\"The page loaded successfully: \" + assertion);\n\t\tAssert.assertTrue(\"The page loaded successfully: \" + assertion, assertion);\n\t}", "public abstract boolean isLoadCompleted();", "boolean hasUrl();", "boolean hasUrl();", "boolean hasUrl();", "boolean hasUrl();", "boolean hasUrl();", "public abstract void pageDisplayed();", "public boolean isLoaded(){return true;}", "public boolean hasPage() {\n return pageBuilder_ != null || page_ != null;\n }", "public boolean isSetPageUrl() {\n return this.pageUrl != null;\n }", "public boolean hasRequestedPage() {\n return getPageIdx() < getPageList().size();\n }", "boolean getUsePage();", "private boolean isPageLoaded(List<By> vps) {\n\t\ttry {\n\t\t\tfor (By point : vps) {\n\t\t\t\tif(!webDriver.findElement(point).isDisplayed()) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If all verification points are found, we are on the correct page.\n\t\t\treturn true;\n\t\t} catch (NoSuchElementException noSuchElementException) {\n\t\t\tlog.debug(NO_SUCH_ELEMENT, noSuchElementException);\n\t\t\treturn false;\n\t\t} catch (NullPointerException noPointerException) {\n\t\t\tlog.debug(NULL_WEB_ELEMENT, noPointerException);\n\t\t\treturn false;\n\t\t} catch (ElementNotVisibleException notVisibleException) {\n\t\t\tlog.debug(NOT_VISIBLE, notVisibleException);\n\t\t\treturn false;\n\t\t}\n\t}", "@Override\n public void waitUntilPageObjectIsLoaded() {\n }", "public boolean isLoadedWithStatusCode(String codeNumber) {\n\t\treturn getDriver().getCurrentUrl()\n\t\t\t\t.equals(GetEnvironmentParam.THE_INTERNET_MAIN_PAGE.getValue() + PageSubURLsProjectYEnum.STATUS_CODES.getValue() + \"/\" + codeNumber);\n\t}", "public boolean isWebShowing();", "private void loadPage() {\n \t\n if (((sPref.equals(ANY)) && (wifiConnected || mobileConnected))\n || ((sPref.equals(WIFI)) && (wifiConnected))) {\n // AsyncTask subclass\n \t\n new DownloadXmlTask().execute(URL);\n } else {\n showErrorPage();\n }\n }", "boolean hasLandingPageView();", "boolean hasPageHelper();", "boolean hasPageHelper();", "boolean hasPageHelper();", "public boolean isLoaded() {\n\t\treturn lib != null;\n\t}", "boolean hasHadithUrl();", "public boolean isDashboardPagePresent() {\r\n\t\treturn isElementPresent(dashboardPage, SHORTWAIT);\r\n\t}", "boolean hasPageNo();", "boolean hasPageNo();", "@Override\n public void onLoad(String url) {\n \n }", "public boolean isLoaded() {\n return parser != null;\n }", "protected boolean isLoaded()\n {\n return m_fLoaded;\n }", "@Override\n\tprotected void isLoaded() throws Error {\n\t\tassertTrue(driver.findElement(By.xpath(\"//a[contains(text(),'Reports')]\")).getText().toString()\n\t\t\t\t.contains(\"Reports\"));\n\t}", "public boolean isLoaded() {\n\treturn loaded;\n }", "public HomePage verifyPageUrl() {\n (new WebDriverWait(driver, timeout)).until(new ExpectedCondition<Boolean>() {\n public Boolean apply(WebDriver d) {\n return d.getCurrentUrl().contains(pageUrl);\n }\n });\n return this;\n }", "@Override\n\tpublic void checkPage() {\n\t}", "public void loadPage() { \n\t \n\t if((sPref.equals(ANY)) && (wifiConnected || mobileConnected)) {\n\t \tnew DownloadXmlTask().execute(URL);\n\t }\n\t else if ((sPref.equals(WIFI)) && (wifiConnected)) {\n\t new DownloadXmlTask().execute(URL);\n\t } else {\n\t // show error\n\t } \n\t }", "public void waitForPageToLoad() {\n\t\ttry {\n\t\t\twait.until(new ExpectedCondition<Boolean>() {\n\t\t\t\tpublic Boolean apply(WebDriver wd) {\n\t\t\t\t\treturn isPageLoaded(verificationPoints());\n\t\t\t\t}\n\t\t\t});\n\t\t} \n\t\tcatch (TimeoutException timeOutException) {\n\t\t\tthrow new AssertionError(this.getClass().getSimpleName() + \" is not verified. Missing \" + returnMissingElements(verificationPoints()));\n\t\t}\n\t}", "@Override\n protected void isLoaded() throws Error {\n\n PageUtils.isLoaded().\n waitForElementIsVisible(driver, teachers).\n waitForElementIsClickable(driver, teachers);\n }", "public boolean isPageActive(PageLocator loc, Object... args);", "public boolean isLoaded() {\n return loaded;\n }", "public boolean isLoaded() \n\t{\n\t return htRecords != null ;\n\t}", "public static boolean isPageReady (WebDriver webDriver)\n\t{\n\t\tJavascriptExecutor javascriptExecutor = (JavascriptExecutor) webDriver;\n\t\treturn javascriptExecutor.executeScript (\"return document.readyState\").equals (\"complete\");\n\t}", "public boolean checkPageUrlMatches(String regex) {\n return new WebDriverWait(webDriver, DRIVER_WAIT_TIME)\n .until(ExpectedConditions.urlMatches(regex));\n }", "public void waitForPageLoaded() {\r\n\r\n\t\tExpectedCondition<Boolean> expectation = new ExpectedCondition<Boolean>() {\r\n\t\t\tpublic Boolean apply(WebDriver driver) {\r\n\t\t\t\treturn ((JavascriptExecutor) driver).executeScript(\"return document.readyState\").equals(\"complete\");\r\n\t\t\t}\r\n\t\t};\r\n\t\tWait<WebDriver> wait = new WebDriverWait(driver, timeout);\r\n\t\twait.until(expectation);\r\n\t}", "boolean hasHadithBookUrl();", "public void waitForContentLoad() {\n // TODO implement generic method to wait until page content is loaded\n\n // wait.until(...);\n // ...\n }", "boolean hasPagesize();", "public boolean JSBridgeUrlLoading(final WebView view, String url) {\n return false;\n }", "public boolean isPageRequested() {\n\n // If we're in add XML MO mode and have at least one future MO, a new page is not desired.\n if (wizard.isInAddXmlMoMode() && wizard.hasFutureManagedObjects()) {\n return false;\n }\n\n return getPageIdx() >= 0;\n }", "@Override\n\tprotected void isLoaded() throws Error \n\t{\n\t\t\n\t}", "boolean hasContent();", "boolean hasContent();", "boolean hasContent();", "boolean hasContent();", "boolean hasContent();", "boolean hasContent();", "boolean hasContent();", "@Override\n\tprotected void isLoaded() throws Error {\n\t\t\n\t}", "@Override\n\tprotected void isLoaded() throws Error {\n\t\t\n\t}", "public boolean hasBeenLoaded () {\n return loaded;\n }", "public boolean isLoaded() {\n return m_module.isLoaded();\n }", "public abstract void loaded();", "public synchronized boolean isLoaded() {\n\t\treturn _resourceData != null;\n\t}", "public boolean hasPage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "private void loadPage(QUrl url, int width, int height, int timeout) {\n // This is an event-based application. So we have to wait until\n // \"loadFinished(bool)\" raised.\n long cancelAt = System.currentTimeMillis() + timeout;\n loading = true;\n loadingResult = false; // Default\n\n // TODO: fromEncoded() needs to be used in some situations. Some\n // sort of flag should be passed in to WebkitRenderer maybe?\n // self._page.mainFrame().load(QUrl.fromEncoded(url))\n\n page.mainFrame().load(url);\n while (loading) {\n if (timeout > 0 && System.currentTimeMillis() >= cancelAt) {\n throw new RuntimeException(\"Request timed out on \" + url);\n }\n while (QApplication.hasPendingEvents()) {\n QCoreApplication.processEvents();\n }\n }\n\n log.debug(\"Processing result\");\n\n if (!loadingResult) {\n log.warn(\"Failed to load \" + url);\n }\n\n // Set initial viewport (the size of the \"window\")\n final QSize size = page.mainFrame().contentsSize();\n log.debug(\"contentsSize: \" + size);\n\n if (width > 0) {\n size.setWidth(width);\n }\n if (height > 0) {\n size.setHeight(height);\n }\n\n window.resize(size);\n }", "public static boolean match(String URL){\n\t\tboolean flag = false;\n\t\tIterator<PageEntity> iter = resultQueue.iterator();\n\t\twhile(iter.hasNext()){\n\t\t\tPageEntity p = (PageEntity) iter.next();\n\t\t\tif(URL.equals(p.getURL())){\n\t\t\t\tflag = true;\n\t\t\t}\n\t\t}\n\t\treturn flag;\n\t}", "public boolean checkPageUrlContains(String fraction) {\n return new WebDriverWait(webDriver, DRIVER_WAIT_TIME)\n .until(ExpectedConditions.urlContains(fraction));\n }", "@java.lang.Override\n public boolean hasUrl() {\n return instance.hasUrl();\n }", "@java.lang.Override\n public boolean hasUrl() {\n return instance.hasUrl();\n }", "boolean hasHasInstitutionHomePage();", "public static boolean waitForPageLoad(WebDriver driver)\n\t\t\tthrows InterruptedException {\n\t\tboolean isLoaded = false;\n\t\tint iTimeOut = Integer.parseInt(Cls_Generic_methods\n\t\t\t\t.getConfigValues(\"timeOutInSeconds\"));\n\t\tThread.sleep(2000);\n\t\ttry {\n\t\t\tlogger.info(\"Waiting For Page load via JS\");\n\t\t\tExpectedCondition<Boolean> pageLoadCondition = new ExpectedCondition<Boolean>() {\n\t\t\t\tpublic Boolean apply(WebDriver driver) {\n\t\t\t\t\treturn ((JavascriptExecutor) driver).executeScript(\n\t\t\t\t\t\t\t\"return document.readyState\").equals(\"complete\");\n\t\t\t\t}\n\t\t\t};\n\t\t\tWebDriverWait wait = new WebDriverWait(driver, iTimeOut);\n\t\t\twait.until(pageLoadCondition);\n\t\t\tisLoaded = true;\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"Error Occured waiting for Page Load \"\n\t\t\t\t\t+ driver.getCurrentUrl());\n\t\t}\n\t\treturn isLoaded;\n\t}", "boolean hasNextPage();", "boolean isForceLoaded();", "public boolean hasPage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public static native boolean nativeIsGoogleHomePageUrl(String url);", "boolean canHandlePageClass(Class<? extends Page> pageClazz, PageParameters pageParameters);", "protected void waitThePageToLoad() {\n ExpectedCondition pageLoadCondition = new ExpectedCondition<Boolean>() {\n public Boolean apply(WebDriver driver) {\n return ((JavascriptExecutor) driver).executeScript(\"return document.readyState\").equals(\"complete\");\n }\n };\n WaitUtils.waitUntil(driver, pageLoadCondition);\n }", "public boolean hasData() {\r\n\t\treturn page.hasContent();\r\n\t}", "public abstract boolean isLoggedIn(String url);", "public final boolean getHasContent() {\n return this.url != null;\n }" ]
[ "0.76160747", "0.75579035", "0.75579035", "0.7307511", "0.7207734", "0.71114373", "0.71110165", "0.7110152", "0.70572144", "0.7026688", "0.6926468", "0.6861921", "0.66280675", "0.662294", "0.6589345", "0.65680206", "0.65541834", "0.6547013", "0.6520814", "0.6513487", "0.6495746", "0.64779574", "0.6475167", "0.6470358", "0.6452594", "0.6452594", "0.6452594", "0.6452594", "0.6452594", "0.6419705", "0.63174474", "0.6302073", "0.62780386", "0.62249756", "0.62114835", "0.62092143", "0.62004024", "0.6178664", "0.61483335", "0.61409134", "0.6138446", "0.601586", "0.601586", "0.601586", "0.6006767", "0.5992658", "0.59919333", "0.5975681", "0.5975681", "0.5972008", "0.5969231", "0.5952598", "0.5950147", "0.59500647", "0.5946709", "0.5916206", "0.5912998", "0.59065646", "0.59063804", "0.5902777", "0.58495796", "0.58462626", "0.58394605", "0.58374804", "0.58280754", "0.5823579", "0.58174086", "0.5810828", "0.5804168", "0.5801524", "0.5759487", "0.5757428", "0.5757428", "0.5757428", "0.5757428", "0.5757428", "0.5757428", "0.5757428", "0.5752084", "0.5752084", "0.5747355", "0.57470906", "0.57428706", "0.5741294", "0.5732777", "0.5724874", "0.57112944", "0.56964654", "0.56961673", "0.56961673", "0.56954867", "0.56932235", "0.56856704", "0.5681967", "0.568109", "0.56730753", "0.56669575", "0.5661877", "0.56584674", "0.5654376", "0.5644251" ]
0.0
-1
Sleep this thread, reinterrupting on a InterruptedException.
public static void sleep(long millis) { run(() -> Thread.sleep(millis)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void sleep() {\n try {\n Thread.sleep(3000L);\n }\n catch (Exception ignored) {\n Log.trace(\"Sleep got interrupted.\");\n }\n }", "public void sleep()\n\t{\n\t\ttry\n\t\t{\n\t\t\tThread.sleep(getMilliseconds());\n\t\t}\n\t\tcatch (InterruptedException e)\n\t\t{\n\t\t\t// ignore but return\n\t\t}\n\t}", "private void sleep()\n {\n try {\n Thread.sleep(Driver.sleepTimeMs);\n }\n catch (InterruptedException ex)\n {\n\n }\n }", "public static void sleep1 () throws InterruptedException {\n\n // throws is cheaper way to get rid of exception\n Thread.sleep(2000);\n\n }", "public static void delay() throws InterruptedException {\n // This is the sleep thread method that makes the program sleep\n // for a program amount of milliseconds to slow down the program\n Thread.sleep(1500);\n }", "private void sleep() {\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "public void sleepUntilNextRetry() throws InterruptedException {\n\t\tint attempts = getAttemptTimes();\n\t\tlong sleepTime = (long) (retryIntervalMillis * Math.pow(2, attempts));\n\t\tLOG.info(\"Sleeping \" + sleepTime + \"ms before retry #\" + attempts\n\t\t\t\t+ \"...\");\n\t\ttimeUnit.sleep(sleepTime);\n\t}", "public void sleep() throws InterruptedException, IllegalArgumentException, Time.Ex_TimeNotAvailable, Time.Ex_TooLate\n {\n // The current time.\n AbsTime now;\n // The duration to wait.\n RelTime duration;\n\n // Make error if NEVER.\n if (isNEVER()) {\n throw new IllegalArgumentException(\"this == NEVER\");\n }\n\n // Don't do anything if ASAP.\n if (!isASAP()) {\n\n // Calculate the time now.\n now = new AbsTime();\n\n // Figure out how long to wait for.\n duration = Time.diff(this, now);\n\n // If duration is negative, throw the Ex_TooLate exception.\n if (duration.getValue() < 0L) {\n throw new Time.Ex_TooLate();\n }\n\n // Do the wait.\n duration.sleep();\n }\n }", "@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tsleep(dauer);\n\t\t\tt.interrupt();\n\t\t} catch (InterruptedException e) {\n\t\t}\n\t}", "@Override\n\tpublic void sleep() {\n\t\t((Application) application()).unlockEC();\n\t\tsuper.sleep();\n\t}", "public static void sleep() {\n\t\ttry {\n\t\t\tThread.sleep(10 * 1000);\n\t\t} catch (InterruptedException e) {\n\t\t}\n\t}", "private static void interruptWithException () {\n\n Thread thread = new Thread(() -> {\n try {\n System.out.println(\"start sleeping ...\");\n Thread.sleep(5000000);\n } catch (InterruptedException e) {\n System.out.println(\"interrupted from outside !\");\n }\n });\n\n thread.start();\n }", "private void Perform_SLEEP()\n {\n if (Utils.bit5(get_ioreg(MCUCR)))\n mSleeping = true;\n return;\n }", "private static void delay() throws InterruptedException {\n\t\tTimeUnit.MILLISECONDS.sleep((long) (minDelay + (long)(Math.random() * ((maxDelay - minDelay) + 1))));\n\t}", "@Override\n public void run() {\n try {\n sleep(duration);\n } catch(InterruptedException e) {\n System.out.println(getName() + \" was interrupted. isInterrupted(): \" + isInterrupted());\n return;\n }\n System.out.println(getName() + \" has awakened\");\n }", "private void schedulerSleep() {\n\n\t\ttry {\n\n\t\t\tThread.sleep(timeSlice);\n\n\t\t} catch (InterruptedException e) {\n\t\t}\n\t\t;\n\n\t}", "private void Sleep() {\n\t\ttry {\n\t\t\tThread.sleep(10 * 1000);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void pause() throws InterruptedException \n\t{\n\t\tThread.sleep(4000);\t\t\t\n\t\t\n\t}", "private void sleep(long ms) throws InterruptedException {\n Thread.sleep(ms);\n }", "private void sleepFor(long t) {\n\t\ttry {\n\t\t\tThread.sleep(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}", "public void timerInterrupt() {\n \tboolean istr = Machine.interrupt().disable();\n \t\n \twhile (sleepingThreads.size()>0 && sleepingThreads.peek().time <= Machine.timer().getTime()) {\n \t\tsleepingThreads.remove().ready();\n \t}\n \n \tKThread.yield();\n \t\n \t//Machine.interrupt().enable();\n \tMachine.interrupt().restore(istr);\n \n }", "@Override\n\tpublic void sleep() {\n\t\t\n\t}", "public static void catchSleep(int time) {\n try {\n Thread.sleep(time);\n } catch (InterruptedException e) {}\n }", "public static void sleepFor(long duration) {\n try {\n Thread.sleep(duration);\n } catch (InterruptedException e) {\n // There is nothing to be done here\n }\n }", "public static void sleepFor(int sec) throws InterruptedException {\n Thread.sleep(sec * 1000);\n }", "public static void sleepForTwoSec() throws InterruptedException {\n Thread.sleep(2000);\n }", "private void sleep() {\n try {\n for(long count = 0L; this.DATA_STORE.isButtonPressed() && count < this.sleepTime; count += 20L) {\n Thread.sleep(20L);\n }\n } catch (InterruptedException iEx) {\n // For now, InterruptedException may be ignored if thrown.\n }\n\n if (this.sleepTime > 20L) {\n this.sleepTime = (long)((double)this.sleepTime / 1.3D);\n }\n }", "public void timerInterrupt() \n {\n\t\n Machine.interrupt().disable(); //disable\n\n //if waitingQueue is empty, and current time is greater than or equal to the first ThreadWaits, wakeUp time,\n while(!waitingQueue.isEmpty() && (waitingQueue.peek().wakeUp < Machine.timer().getTime()\n || waitingQueue.peek().wakeUp == Machine.timer().getTime())) {\n waitingQueue.poll().thread.ready(); //pop head\n }\n\n KThread.currentThread().yield();\n\n Machine.interrupt().enable(); //enable\n\n }", "public static void shortWait(){\r\n\t\ttry {\r\n\t\t\tTimeUnit.SECONDS.sleep(5);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\tSystem.out.println(\"Interruption happened due to sleep() method\");\r\n\t\t}\r\n\t}", "void sleep();", "void sleep();", "private void sleep() {\n\t\tSystem.out.println(\"Ape sleeping\");\n\t}", "@Override\n protected void sleep(int milliseconds) {\n super.sleep(milliseconds);\n }", "protected final void sleep(int inMilliseconds) {\r\n\r\n\t\ttry {\r\n\t\t\tThread.sleep(inMilliseconds);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t} // catch\r\n\t}", "protected void sleep() {\n\t\tSystem.out.println(\"human sleep\");\n\t}", "public void timerInterrupt() {\n\n\t\tMachine.interrupt().disable();\n\n\t\t//while loop the threads in the TreeSet\n\t\twhile(!theThreads.isEmpty()) {\n\t\t\tPair curr_thread = theThreads.first(); //Fetch the first (lowest wakeTime) on the list\n\n\t\t\tif(curr_thread.wakeTime < Machine.timer().getTime()) { //Is the wakeTime for that thread < current time\n\t\t\t\ttheThreads.pollFirst(); //Remove it from the TreeSet, curr_thread holds it still.\n\t\t\t\tcurr_thread.thread.ready(); //Ready that thread\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbreak; //break the loop, not ready yet.\n\t\t\t}\n\t\t}\n\t\tMachine.interrupt().enable();\n\t\tKThread.yield(); //Yield the current thread.\n\t}", "public void testSleep() {\n System.out.println(\"sleep\");\n long thinkTime = 0L;\n IOUtil.sleep(thinkTime);\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 void setSleepTime(int st) {\n this.sleepTime = st;\n\n // notify the update thread so that it can recalculate\n if (updateThread.isRunning())\n updateThread.interrupt();\n }", "public static void inter() throws InterruptedException {\r\n\t\t// Thread.currentThread().sleep(3000);\r\n\t\tstop = true;\r\n\t\t// Thread.currentThread().sleep( 3000 );\r\n\t}", "public void waitSleep(int pTime)\n{\n\n try {Thread.sleep(pTime);} catch (InterruptedException e) { }\n\n}", "public static void sleep(long ms) {\n try {\n Logger.trace(\"Sleeping for {} ms\", ms);\n Thread.sleep(ms);\n } catch (InterruptedException e) { // NOSONAR squid:S2142\n Logger.warn(\"Interrupted while sleeping for {} ms: {}\", ms, e.getMessage());\n Thread.currentThread().interrupt();\n }\n }", "void sleep()\r\n\t{\r\n\t\t\r\n\t}", "private void waitToRetry()\n {\n final int sleepTime = 2000000;\n\n if (keepTrying)\n {\n try\n {\n Thread.sleep(sleepTime);\n }\n catch (Exception error)\n {\n log.error(\"Ignored exception from sleep - probably ok\", error);\n }\n }\n }", "private long sleepForRandomAmountOfTime() throws InterruptedException {\n final long backOffMillis = zeroTo(MAX_BACK_OFF_MILLIS);\n if (LOGGER.isTraceEnabled()) {\n LOGGER.trace(\"Backing off for \" + backOffMillis + \"ms\");\n }\n Thread.sleep(backOffMillis);\n return backOffMillis;\n }", "@Override public void run() {\r\n\t\t\ttry {\r\n\t\t\t\twhile (!stopped) {\r\n\t\t\t\t\tThread.sleep(delay);\r\n\t\t\t\t\tif (!stopped) {\r\n\t\t\t\t\t\tflush();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} catch (final InterruptedException e) {\r\n\t\t\t\tthrow new RuntimeException(e);\r\n\t\t\t}\r\n\t\t}", "public void sleep() {\n \t\thealth = maxHealthModifier;\n \t\ttoxicity = 0;\n \t}", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(1500);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\tleave = false;\n\t\t\t\t}", "public void sleep(int time) {\n try {\n Thread.sleep(time);\n } catch (InterruptedException e) {\n }\n }", "private void sleep(int number) {\n\t\ttry {\n\t\t\tThread.sleep(number);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}}", "private void customWait() throws InterruptedException {\n while (!finished) {\n Thread.sleep(1);\n }\n finished = false;\n }", "public static void sleep(int sec) {\n\t try {\n\t Thread.sleep(sec * 1000);\n\t }\n\t catch(Exception ex) {\n\t \tlogger.error(\"Error:Sleeping the thread\", ex);\n\t }\n\t}", "@Override\n\tpublic void sleeps() {\n\t\t\n\t}", "protected void sleep(final long millis) {\n try {\n Thread.sleep(millis);\n }\n catch (final InterruptedException ie) {\n // Ignore;\n }\n }", "private void delay() {\n\ttry {\n\t\tThread.sleep(500);\n\t} catch (InterruptedException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\t\n\t}", "public void run() {\n try {\n Thread.sleep(10000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n mainThread.interrupt();\n }", "protected void sleepInbetweenRecoveryAttempts(long interval) {\n\t\tif (interval > 0) {\n\t\t\ttry {\n\t\t\t\tThread.sleep(interval);\n\t\t\t}\n\t\t\tcatch (InterruptedException interEx) {\n\t\t\t\t// Re-interrupt current thread, to allow other threads to react.\n\t\t\t\tThread.currentThread().interrupt();\n\t\t\t}\n\t\t}\n\t}", "public static void sleepUninterruptibly(int millis){\n long remaining = millis;\n long end = System.currentTimeMillis() + remaining;\n boolean interrupted = false;\n try {\n do {\n try {\n Thread.sleep(remaining);\n return;\n } catch (InterruptedException e) {\n interrupted = true;\n long now = System.currentTimeMillis();\n remaining = end - now;\n }\n } while (true);\n }finally {\n if (interrupted) {\n Thread.currentThread().interrupt();\n }\n }\n }", "public static void longWait(){\r\n\t\ttry {\r\n\t\t\tTimeUnit.SECONDS.sleep(15);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\tSystem.out.println(\"Interruption happened due to sleep() method\");\r\n\t\t}\r\n\t}", "public static void sleep(long aInDelay) {\n try {\n Thread.sleep(aInDelay);\n } catch (InterruptedException e) {\n Display.logUnexpectedError(e);\n }\n }", "private void pause() throws InterruptedException {\n component.repaint();\n Thread.sleep(delay);\n }", "public void shutdown() throws InterruptedException {\n shutdown(true);\n }", "void await()\n throws InterruptedException;", "private void sleepByScheduleTime() throws InterruptedException\n\t{\n\t\tjava.util.Calendar calendar = java.util.Calendar.getInstance();\n\t\tcalendar.setTime(new java.util.Date(System.currentTimeMillis()));\n\t\tint currHour = calendar.get(calendar.HOUR_OF_DAY);\n\t\tif ((24 - currHour) * 60 < 2 * FtpData.SCHEDULE_TIME)\n\t\t{\n\t\t\tsleep((FtpData.SCHEDULE_TIME + 1) * 60000); // 00h:01\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsleep(FtpData.SCHEDULE_TIME * 60000); // n * minutes;\n\t\t}\n\t}", "private void backoff() {\n nextSleep *= 2;\n if (nextSleep > MAX_SLEEP) nextSleep = MAX_SLEEP;\n try {\n Thread.sleep(nextSleep);\n } catch (InterruptedException e) {\n }\n }", "void cancel() {\n\tsleepThread.interrupt();\n }", "private static void sleep(int n) {\n try {\n TimeUnit.MILLISECONDS.sleep(n);\n } catch (InterruptedException e) {\n System.out.print(\"\\ndelay failed\");\n }\n }", "private void esperarPorFatherThread() {\n\t\ttry {\n\t\t\tThread.sleep(50000);\n\t\t} catch (InterruptedException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t}", "public static void sleep(int delay) {\n try {\n Thread.sleep(delay);\n } catch (InterruptedException e) {\n }\n }", "private void await() {\n try {\n Thread.sleep(10 * 1000L);\n } catch (InterruptedException e) {\n // ignore\n }\n }", "public static void sleep(long msec)\n {\n try\n {\n Thread.sleep(msec);\n }\n catch (InterruptedException e)\n {\n }\n }", "public void goToSleep() {\n mPowerManager.goToSleep(SystemClock.uptimeMillis());\n }", "private synchronized void sleepUntilFirstStudent() throws InterruptedException {\n System.out.println(\"TA: TA taking a nap. ZzZz...\");\n isSleeping = true;\n\n while(isSleeping){\n wait();\n }\n\n }", "public void run() {\n\t\t\t\ttry {Thread.sleep(1000000000);} catch (InterruptedException ie) {}\n\t\t\t}", "@Override\n\tpublic void lockInterruptibly() throws InterruptedException {\n\t\t\n\t}", "@Override\n\tpublic void lockInterruptibly() throws InterruptedException {\n\t\t\n\t}", "public void pauseTilDone() throws InterruptedException { \n\t\t\tthis.me_.join(); \n\t\t}", "void sleep ();", "public static void wait(int ms){\n try\n {\n Thread.sleep(ms);\n }\n catch(InterruptedException ex)\n {\n Thread.currentThread().interrupt();\n }\n}", "public void delayTestFinish() {\r\n\t\ttry {\r\n\t\t\tlatch.await();\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\tthrow new RuntimeException(e);\t// don't expose InterruptedException to users\r\n\t\t} finally {\r\n\t\t\tlatch.reset();\r\n\t\t}\r\n\t}", "private void walk() throws MyException{\n try{\n Thread.sleep((long)(1+300*Math.random()));\n }catch(InterruptedException e){\n throw new MyException(\"Error: Not walking.\");\n }\n }", "public void wakeup()\n {\n // TODO: add in control for state here. Only wakeup if actually blocked as it is usually expensive.\n selector.wakeup();\n }", "public void waitForNextTick() throws InterruptedException {\n Thread.sleep(timeoutPeriod);\n }", "@Override\n public void doTask() throws InterruptedException {\n Thread.sleep(5000);\n }", "private void sleep(int mul)\n {\n try {\n Thread.sleep(Driver.sleepTimeMs * mul);\n }\n catch (InterruptedException ex)\n {\n\n }\n }", "public static void zsleep(int t) {\n try { Thread.sleep(t);\n } catch(InterruptedException e) {}\n }", "@Override\n\tpublic void run() {\n\t\twhile(!Thread.currentThread().isInterrupted()){\n\t\t\ttry{\n\t\t\tThread.sleep(100);\n\t\t\t}\n\t\t\tcatch(InterruptedException e){\n\t\t\t\tThread.currentThread().interrupt();\n\t\t\t}\n\t\t\t\n\t\t\tpostInvalidate();\n\t\t}\n\t}", "public void sleep(Agent ag, long millis) throws InterruptedException {\n getThreadFor(ag).sleep(millis);\n stats.add(new SleepStat(ag.getClass()), millis);\n\n }", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep((long) time);\r\n\t\t\t\t\trightOff();\r\n\t\t\t\t\tif(unhook)\r\n\t\t\t\t\t\tunhookLEDs();\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t}\r\n\t\t\t}", "public void interrupt() {\n interrupted.set(true);\n Thread.currentThread().interrupt();\n }", "public static void sleep(int seconds){\n seconds*=1000;\n try {\n Thread.sleep(seconds);\n }catch (InterruptedException e){\n e.getStackTrace();\n }\n }", "public static void sleepFor(float time) {\n try {\r\n Thread.sleep((int)(time*1000));\r\n } catch (InterruptedException e){\r\n }\r\n }", "private void sleepForChannelJoin() {\r\n\t\t\r\n\t\ttry {\r\n\t\t\tThread.sleep(config.getChannelJoinTimeout());\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void msgGoToSleep() {\n\t\t\n\t}", "public void waitForShutdown() throws InterruptedException {\n\t\tsynchronized(this){\n\t\t\tif(platform != null){\n\t\t\t\tthis.wait();\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}", "void threadDelay() {\n saveState();\n if (pauseSimulator) {\n halt();\n }\n try {\n Thread.sleep(Algorithm_Simulator.timeGap);\n\n } catch (InterruptedException ex) {\n Logger.getLogger(RunBFS.class.getName()).log(Level.SEVERE, null, ex);\n }\n if (pauseSimulator) {\n halt();\n }\n }", "@Override\n public void sleep() {\n System.out.println(\"Zzz...\");\n }", "protected void wash() throws InterruptedException {\n\t\t// Lock hatch\n\t\tmyMachine.setLock(true);\n\n\t\tpreWash();\n\t\tmainWash();\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\trinse();\n\t\t}\n\t\tcentrifuge();\n\t\t// Unlock\n\t\tmyMachine.setLock(false);\n\t}", "public void waitUntil(long x) {\n\n\tlong wakeTime = Machine.timer().getTime() + x;\n\tboolean intrState = Machine.interrupt().disable();\n\tKThread.currentThread().time = wakeTime;\n\tsleepingThreads.add(KThread.currentThread());\n\tKThread.currentThread().sleep();\n Machine.interrupt().restore(intrState);\n \n }", "void await() throws InterruptedException;", "void await() throws InterruptedException;", "void await() throws InterruptedException;" ]
[ "0.7336998", "0.70528466", "0.7044742", "0.70249116", "0.68856305", "0.68383473", "0.6711265", "0.66871256", "0.6611916", "0.66088116", "0.66027856", "0.65901625", "0.6564761", "0.6532065", "0.6497756", "0.64967895", "0.6480851", "0.64228237", "0.64080477", "0.6405643", "0.6349952", "0.634775", "0.63450575", "0.63248545", "0.63219637", "0.63003516", "0.6297938", "0.6265993", "0.6247145", "0.6223589", "0.6223589", "0.620922", "0.61913747", "0.61278266", "0.61267966", "0.6124326", "0.6104828", "0.609323", "0.60838526", "0.6073706", "0.6071912", "0.603897", "0.60330796", "0.6028381", "0.6027273", "0.5996293", "0.59889585", "0.5955374", "0.59468997", "0.5940753", "0.5937696", "0.5922785", "0.5907999", "0.5902075", "0.5897457", "0.5891257", "0.5889931", "0.5879758", "0.58758986", "0.584232", "0.5838638", "0.5838317", "0.5838295", "0.58366984", "0.58215135", "0.5821088", "0.58187795", "0.5804372", "0.57915336", "0.5764942", "0.57630324", "0.57564604", "0.57561636", "0.57406396", "0.57406396", "0.5737327", "0.5736169", "0.5733707", "0.57275164", "0.5722499", "0.571503", "0.56990004", "0.56924033", "0.56919265", "0.5689401", "0.56777936", "0.56614965", "0.5660638", "0.5659633", "0.56573313", "0.5648582", "0.56463903", "0.56456083", "0.5639285", "0.56371665", "0.56329757", "0.56263286", "0.5621708", "0.561149", "0.561149", "0.561149" ]
0.0
-1
Sleep this thread, reinterrupting on a InterruptedException.
public static void sleep(Duration duration) { sleep(duration.toMillis()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void sleep() {\n try {\n Thread.sleep(3000L);\n }\n catch (Exception ignored) {\n Log.trace(\"Sleep got interrupted.\");\n }\n }", "public void sleep()\n\t{\n\t\ttry\n\t\t{\n\t\t\tThread.sleep(getMilliseconds());\n\t\t}\n\t\tcatch (InterruptedException e)\n\t\t{\n\t\t\t// ignore but return\n\t\t}\n\t}", "private void sleep()\n {\n try {\n Thread.sleep(Driver.sleepTimeMs);\n }\n catch (InterruptedException ex)\n {\n\n }\n }", "public static void sleep1 () throws InterruptedException {\n\n // throws is cheaper way to get rid of exception\n Thread.sleep(2000);\n\n }", "public static void delay() throws InterruptedException {\n // This is the sleep thread method that makes the program sleep\n // for a program amount of milliseconds to slow down the program\n Thread.sleep(1500);\n }", "private void sleep() {\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "public void sleepUntilNextRetry() throws InterruptedException {\n\t\tint attempts = getAttemptTimes();\n\t\tlong sleepTime = (long) (retryIntervalMillis * Math.pow(2, attempts));\n\t\tLOG.info(\"Sleeping \" + sleepTime + \"ms before retry #\" + attempts\n\t\t\t\t+ \"...\");\n\t\ttimeUnit.sleep(sleepTime);\n\t}", "public void sleep() throws InterruptedException, IllegalArgumentException, Time.Ex_TimeNotAvailable, Time.Ex_TooLate\n {\n // The current time.\n AbsTime now;\n // The duration to wait.\n RelTime duration;\n\n // Make error if NEVER.\n if (isNEVER()) {\n throw new IllegalArgumentException(\"this == NEVER\");\n }\n\n // Don't do anything if ASAP.\n if (!isASAP()) {\n\n // Calculate the time now.\n now = new AbsTime();\n\n // Figure out how long to wait for.\n duration = Time.diff(this, now);\n\n // If duration is negative, throw the Ex_TooLate exception.\n if (duration.getValue() < 0L) {\n throw new Time.Ex_TooLate();\n }\n\n // Do the wait.\n duration.sleep();\n }\n }", "@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tsleep(dauer);\n\t\t\tt.interrupt();\n\t\t} catch (InterruptedException e) {\n\t\t}\n\t}", "@Override\n\tpublic void sleep() {\n\t\t((Application) application()).unlockEC();\n\t\tsuper.sleep();\n\t}", "public static void sleep() {\n\t\ttry {\n\t\t\tThread.sleep(10 * 1000);\n\t\t} catch (InterruptedException e) {\n\t\t}\n\t}", "private static void interruptWithException () {\n\n Thread thread = new Thread(() -> {\n try {\n System.out.println(\"start sleeping ...\");\n Thread.sleep(5000000);\n } catch (InterruptedException e) {\n System.out.println(\"interrupted from outside !\");\n }\n });\n\n thread.start();\n }", "private void Perform_SLEEP()\n {\n if (Utils.bit5(get_ioreg(MCUCR)))\n mSleeping = true;\n return;\n }", "private static void delay() throws InterruptedException {\n\t\tTimeUnit.MILLISECONDS.sleep((long) (minDelay + (long)(Math.random() * ((maxDelay - minDelay) + 1))));\n\t}", "@Override\n public void run() {\n try {\n sleep(duration);\n } catch(InterruptedException e) {\n System.out.println(getName() + \" was interrupted. isInterrupted(): \" + isInterrupted());\n return;\n }\n System.out.println(getName() + \" has awakened\");\n }", "private void schedulerSleep() {\n\n\t\ttry {\n\n\t\t\tThread.sleep(timeSlice);\n\n\t\t} catch (InterruptedException e) {\n\t\t}\n\t\t;\n\n\t}", "private void Sleep() {\n\t\ttry {\n\t\t\tThread.sleep(10 * 1000);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void pause() throws InterruptedException \n\t{\n\t\tThread.sleep(4000);\t\t\t\n\t\t\n\t}", "private void sleep(long ms) throws InterruptedException {\n Thread.sleep(ms);\n }", "private void sleepFor(long t) {\n\t\ttry {\n\t\t\tThread.sleep(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}", "public void timerInterrupt() {\n \tboolean istr = Machine.interrupt().disable();\n \t\n \twhile (sleepingThreads.size()>0 && sleepingThreads.peek().time <= Machine.timer().getTime()) {\n \t\tsleepingThreads.remove().ready();\n \t}\n \n \tKThread.yield();\n \t\n \t//Machine.interrupt().enable();\n \tMachine.interrupt().restore(istr);\n \n }", "@Override\n\tpublic void sleep() {\n\t\t\n\t}", "public static void catchSleep(int time) {\n try {\n Thread.sleep(time);\n } catch (InterruptedException e) {}\n }", "public static void sleepFor(long duration) {\n try {\n Thread.sleep(duration);\n } catch (InterruptedException e) {\n // There is nothing to be done here\n }\n }", "public static void sleepFor(int sec) throws InterruptedException {\n Thread.sleep(sec * 1000);\n }", "public static void sleepForTwoSec() throws InterruptedException {\n Thread.sleep(2000);\n }", "private void sleep() {\n try {\n for(long count = 0L; this.DATA_STORE.isButtonPressed() && count < this.sleepTime; count += 20L) {\n Thread.sleep(20L);\n }\n } catch (InterruptedException iEx) {\n // For now, InterruptedException may be ignored if thrown.\n }\n\n if (this.sleepTime > 20L) {\n this.sleepTime = (long)((double)this.sleepTime / 1.3D);\n }\n }", "public void timerInterrupt() \n {\n\t\n Machine.interrupt().disable(); //disable\n\n //if waitingQueue is empty, and current time is greater than or equal to the first ThreadWaits, wakeUp time,\n while(!waitingQueue.isEmpty() && (waitingQueue.peek().wakeUp < Machine.timer().getTime()\n || waitingQueue.peek().wakeUp == Machine.timer().getTime())) {\n waitingQueue.poll().thread.ready(); //pop head\n }\n\n KThread.currentThread().yield();\n\n Machine.interrupt().enable(); //enable\n\n }", "public static void shortWait(){\r\n\t\ttry {\r\n\t\t\tTimeUnit.SECONDS.sleep(5);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\tSystem.out.println(\"Interruption happened due to sleep() method\");\r\n\t\t}\r\n\t}", "void sleep();", "void sleep();", "private void sleep() {\n\t\tSystem.out.println(\"Ape sleeping\");\n\t}", "@Override\n protected void sleep(int milliseconds) {\n super.sleep(milliseconds);\n }", "protected final void sleep(int inMilliseconds) {\r\n\r\n\t\ttry {\r\n\t\t\tThread.sleep(inMilliseconds);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t} // catch\r\n\t}", "protected void sleep() {\n\t\tSystem.out.println(\"human sleep\");\n\t}", "public void timerInterrupt() {\n\n\t\tMachine.interrupt().disable();\n\n\t\t//while loop the threads in the TreeSet\n\t\twhile(!theThreads.isEmpty()) {\n\t\t\tPair curr_thread = theThreads.first(); //Fetch the first (lowest wakeTime) on the list\n\n\t\t\tif(curr_thread.wakeTime < Machine.timer().getTime()) { //Is the wakeTime for that thread < current time\n\t\t\t\ttheThreads.pollFirst(); //Remove it from the TreeSet, curr_thread holds it still.\n\t\t\t\tcurr_thread.thread.ready(); //Ready that thread\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbreak; //break the loop, not ready yet.\n\t\t\t}\n\t\t}\n\t\tMachine.interrupt().enable();\n\t\tKThread.yield(); //Yield the current thread.\n\t}", "public void testSleep() {\n System.out.println(\"sleep\");\n long thinkTime = 0L;\n IOUtil.sleep(thinkTime);\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 void setSleepTime(int st) {\n this.sleepTime = st;\n\n // notify the update thread so that it can recalculate\n if (updateThread.isRunning())\n updateThread.interrupt();\n }", "public static void inter() throws InterruptedException {\r\n\t\t// Thread.currentThread().sleep(3000);\r\n\t\tstop = true;\r\n\t\t// Thread.currentThread().sleep( 3000 );\r\n\t}", "public void waitSleep(int pTime)\n{\n\n try {Thread.sleep(pTime);} catch (InterruptedException e) { }\n\n}", "public static void sleep(long ms) {\n try {\n Logger.trace(\"Sleeping for {} ms\", ms);\n Thread.sleep(ms);\n } catch (InterruptedException e) { // NOSONAR squid:S2142\n Logger.warn(\"Interrupted while sleeping for {} ms: {}\", ms, e.getMessage());\n Thread.currentThread().interrupt();\n }\n }", "void sleep()\r\n\t{\r\n\t\t\r\n\t}", "private void waitToRetry()\n {\n final int sleepTime = 2000000;\n\n if (keepTrying)\n {\n try\n {\n Thread.sleep(sleepTime);\n }\n catch (Exception error)\n {\n log.error(\"Ignored exception from sleep - probably ok\", error);\n }\n }\n }", "private long sleepForRandomAmountOfTime() throws InterruptedException {\n final long backOffMillis = zeroTo(MAX_BACK_OFF_MILLIS);\n if (LOGGER.isTraceEnabled()) {\n LOGGER.trace(\"Backing off for \" + backOffMillis + \"ms\");\n }\n Thread.sleep(backOffMillis);\n return backOffMillis;\n }", "@Override public void run() {\r\n\t\t\ttry {\r\n\t\t\t\twhile (!stopped) {\r\n\t\t\t\t\tThread.sleep(delay);\r\n\t\t\t\t\tif (!stopped) {\r\n\t\t\t\t\t\tflush();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} catch (final InterruptedException e) {\r\n\t\t\t\tthrow new RuntimeException(e);\r\n\t\t\t}\r\n\t\t}", "public void sleep() {\n \t\thealth = maxHealthModifier;\n \t\ttoxicity = 0;\n \t}", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(1500);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\tleave = false;\n\t\t\t\t}", "public void sleep(int time) {\n try {\n Thread.sleep(time);\n } catch (InterruptedException e) {\n }\n }", "private void sleep(int number) {\n\t\ttry {\n\t\t\tThread.sleep(number);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}}", "private void customWait() throws InterruptedException {\n while (!finished) {\n Thread.sleep(1);\n }\n finished = false;\n }", "public static void sleep(int sec) {\n\t try {\n\t Thread.sleep(sec * 1000);\n\t }\n\t catch(Exception ex) {\n\t \tlogger.error(\"Error:Sleeping the thread\", ex);\n\t }\n\t}", "@Override\n\tpublic void sleeps() {\n\t\t\n\t}", "protected void sleep(final long millis) {\n try {\n Thread.sleep(millis);\n }\n catch (final InterruptedException ie) {\n // Ignore;\n }\n }", "private void delay() {\n\ttry {\n\t\tThread.sleep(500);\n\t} catch (InterruptedException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\t\n\t}", "public void run() {\n try {\n Thread.sleep(10000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n mainThread.interrupt();\n }", "protected void sleepInbetweenRecoveryAttempts(long interval) {\n\t\tif (interval > 0) {\n\t\t\ttry {\n\t\t\t\tThread.sleep(interval);\n\t\t\t}\n\t\t\tcatch (InterruptedException interEx) {\n\t\t\t\t// Re-interrupt current thread, to allow other threads to react.\n\t\t\t\tThread.currentThread().interrupt();\n\t\t\t}\n\t\t}\n\t}", "public static void sleepUninterruptibly(int millis){\n long remaining = millis;\n long end = System.currentTimeMillis() + remaining;\n boolean interrupted = false;\n try {\n do {\n try {\n Thread.sleep(remaining);\n return;\n } catch (InterruptedException e) {\n interrupted = true;\n long now = System.currentTimeMillis();\n remaining = end - now;\n }\n } while (true);\n }finally {\n if (interrupted) {\n Thread.currentThread().interrupt();\n }\n }\n }", "public static void longWait(){\r\n\t\ttry {\r\n\t\t\tTimeUnit.SECONDS.sleep(15);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\tSystem.out.println(\"Interruption happened due to sleep() method\");\r\n\t\t}\r\n\t}", "public static void sleep(long aInDelay) {\n try {\n Thread.sleep(aInDelay);\n } catch (InterruptedException e) {\n Display.logUnexpectedError(e);\n }\n }", "private void pause() throws InterruptedException {\n component.repaint();\n Thread.sleep(delay);\n }", "public void shutdown() throws InterruptedException {\n shutdown(true);\n }", "void await()\n throws InterruptedException;", "private void sleepByScheduleTime() throws InterruptedException\n\t{\n\t\tjava.util.Calendar calendar = java.util.Calendar.getInstance();\n\t\tcalendar.setTime(new java.util.Date(System.currentTimeMillis()));\n\t\tint currHour = calendar.get(calendar.HOUR_OF_DAY);\n\t\tif ((24 - currHour) * 60 < 2 * FtpData.SCHEDULE_TIME)\n\t\t{\n\t\t\tsleep((FtpData.SCHEDULE_TIME + 1) * 60000); // 00h:01\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsleep(FtpData.SCHEDULE_TIME * 60000); // n * minutes;\n\t\t}\n\t}", "private void backoff() {\n nextSleep *= 2;\n if (nextSleep > MAX_SLEEP) nextSleep = MAX_SLEEP;\n try {\n Thread.sleep(nextSleep);\n } catch (InterruptedException e) {\n }\n }", "void cancel() {\n\tsleepThread.interrupt();\n }", "private static void sleep(int n) {\n try {\n TimeUnit.MILLISECONDS.sleep(n);\n } catch (InterruptedException e) {\n System.out.print(\"\\ndelay failed\");\n }\n }", "private void esperarPorFatherThread() {\n\t\ttry {\n\t\t\tThread.sleep(50000);\n\t\t} catch (InterruptedException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t}", "public static void sleep(int delay) {\n try {\n Thread.sleep(delay);\n } catch (InterruptedException e) {\n }\n }", "private void await() {\n try {\n Thread.sleep(10 * 1000L);\n } catch (InterruptedException e) {\n // ignore\n }\n }", "public static void sleep(long msec)\n {\n try\n {\n Thread.sleep(msec);\n }\n catch (InterruptedException e)\n {\n }\n }", "public void goToSleep() {\n mPowerManager.goToSleep(SystemClock.uptimeMillis());\n }", "private synchronized void sleepUntilFirstStudent() throws InterruptedException {\n System.out.println(\"TA: TA taking a nap. ZzZz...\");\n isSleeping = true;\n\n while(isSleeping){\n wait();\n }\n\n }", "public void run() {\n\t\t\t\ttry {Thread.sleep(1000000000);} catch (InterruptedException ie) {}\n\t\t\t}", "@Override\n\tpublic void lockInterruptibly() throws InterruptedException {\n\t\t\n\t}", "@Override\n\tpublic void lockInterruptibly() throws InterruptedException {\n\t\t\n\t}", "public void pauseTilDone() throws InterruptedException { \n\t\t\tthis.me_.join(); \n\t\t}", "void sleep ();", "public static void wait(int ms){\n try\n {\n Thread.sleep(ms);\n }\n catch(InterruptedException ex)\n {\n Thread.currentThread().interrupt();\n }\n}", "public void delayTestFinish() {\r\n\t\ttry {\r\n\t\t\tlatch.await();\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\tthrow new RuntimeException(e);\t// don't expose InterruptedException to users\r\n\t\t} finally {\r\n\t\t\tlatch.reset();\r\n\t\t}\r\n\t}", "private void walk() throws MyException{\n try{\n Thread.sleep((long)(1+300*Math.random()));\n }catch(InterruptedException e){\n throw new MyException(\"Error: Not walking.\");\n }\n }", "public void wakeup()\n {\n // TODO: add in control for state here. Only wakeup if actually blocked as it is usually expensive.\n selector.wakeup();\n }", "public void waitForNextTick() throws InterruptedException {\n Thread.sleep(timeoutPeriod);\n }", "@Override\n public void doTask() throws InterruptedException {\n Thread.sleep(5000);\n }", "private void sleep(int mul)\n {\n try {\n Thread.sleep(Driver.sleepTimeMs * mul);\n }\n catch (InterruptedException ex)\n {\n\n }\n }", "public static void zsleep(int t) {\n try { Thread.sleep(t);\n } catch(InterruptedException e) {}\n }", "@Override\n\tpublic void run() {\n\t\twhile(!Thread.currentThread().isInterrupted()){\n\t\t\ttry{\n\t\t\tThread.sleep(100);\n\t\t\t}\n\t\t\tcatch(InterruptedException e){\n\t\t\t\tThread.currentThread().interrupt();\n\t\t\t}\n\t\t\t\n\t\t\tpostInvalidate();\n\t\t}\n\t}", "public void sleep(Agent ag, long millis) throws InterruptedException {\n getThreadFor(ag).sleep(millis);\n stats.add(new SleepStat(ag.getClass()), millis);\n\n }", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep((long) time);\r\n\t\t\t\t\trightOff();\r\n\t\t\t\t\tif(unhook)\r\n\t\t\t\t\t\tunhookLEDs();\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t}\r\n\t\t\t}", "public void interrupt() {\n interrupted.set(true);\n Thread.currentThread().interrupt();\n }", "public static void sleep(int seconds){\n seconds*=1000;\n try {\n Thread.sleep(seconds);\n }catch (InterruptedException e){\n e.getStackTrace();\n }\n }", "public static void sleepFor(float time) {\n try {\r\n Thread.sleep((int)(time*1000));\r\n } catch (InterruptedException e){\r\n }\r\n }", "private void sleepForChannelJoin() {\r\n\t\t\r\n\t\ttry {\r\n\t\t\tThread.sleep(config.getChannelJoinTimeout());\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void msgGoToSleep() {\n\t\t\n\t}", "public void waitForShutdown() throws InterruptedException {\n\t\tsynchronized(this){\n\t\t\tif(platform != null){\n\t\t\t\tthis.wait();\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}", "void threadDelay() {\n saveState();\n if (pauseSimulator) {\n halt();\n }\n try {\n Thread.sleep(Algorithm_Simulator.timeGap);\n\n } catch (InterruptedException ex) {\n Logger.getLogger(RunBFS.class.getName()).log(Level.SEVERE, null, ex);\n }\n if (pauseSimulator) {\n halt();\n }\n }", "@Override\n public void sleep() {\n System.out.println(\"Zzz...\");\n }", "protected void wash() throws InterruptedException {\n\t\t// Lock hatch\n\t\tmyMachine.setLock(true);\n\n\t\tpreWash();\n\t\tmainWash();\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\trinse();\n\t\t}\n\t\tcentrifuge();\n\t\t// Unlock\n\t\tmyMachine.setLock(false);\n\t}", "public void waitUntil(long x) {\n\n\tlong wakeTime = Machine.timer().getTime() + x;\n\tboolean intrState = Machine.interrupt().disable();\n\tKThread.currentThread().time = wakeTime;\n\tsleepingThreads.add(KThread.currentThread());\n\tKThread.currentThread().sleep();\n Machine.interrupt().restore(intrState);\n \n }", "void await() throws InterruptedException;", "void await() throws InterruptedException;", "void await() throws InterruptedException;" ]
[ "0.7336998", "0.70528466", "0.7044742", "0.70249116", "0.68856305", "0.68383473", "0.6711265", "0.66871256", "0.6611916", "0.66088116", "0.66027856", "0.65901625", "0.6564761", "0.6532065", "0.6497756", "0.64967895", "0.6480851", "0.64228237", "0.64080477", "0.6405643", "0.6349952", "0.634775", "0.63450575", "0.63248545", "0.63219637", "0.63003516", "0.6297938", "0.6265993", "0.6247145", "0.6223589", "0.6223589", "0.620922", "0.61913747", "0.61278266", "0.61267966", "0.6124326", "0.6104828", "0.609323", "0.60838526", "0.6073706", "0.6071912", "0.603897", "0.60330796", "0.6028381", "0.6027273", "0.5996293", "0.59889585", "0.5955374", "0.59468997", "0.5940753", "0.5937696", "0.5922785", "0.5907999", "0.5902075", "0.5897457", "0.5891257", "0.5889931", "0.5879758", "0.58758986", "0.584232", "0.5838638", "0.5838317", "0.5838295", "0.58366984", "0.58215135", "0.5821088", "0.58187795", "0.5804372", "0.57915336", "0.5764942", "0.57630324", "0.57564604", "0.57561636", "0.57406396", "0.57406396", "0.5737327", "0.5736169", "0.5733707", "0.57275164", "0.5722499", "0.571503", "0.56990004", "0.56924033", "0.56919265", "0.5689401", "0.56777936", "0.56614965", "0.5660638", "0.5659633", "0.56573313", "0.5648582", "0.56463903", "0.56456083", "0.5639285", "0.56371665", "0.56329757", "0.56263286", "0.5621708", "0.561149", "0.561149", "0.561149" ]
0.0
-1
Reinterrupt the current thread if a runnable throws a InterruptedException.
public static void run(InterruptibleRunnable runnable) { try { runnable.run(); } catch (InterruptedException e) { LOGGER.info("Interrupted", e); Thread.currentThread().interrupt(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final void interruptTask() {\n/* 82 */ Thread currentRunner = this.runner;\n/* 83 */ if (currentRunner != null) {\n/* 84 */ currentRunner.interrupt();\n/* */ }\n/* 86 */ this.doneInterrupting = true;\n/* */ }", "public void interrupt() {\n interrupted.set(true);\n Thread.currentThread().interrupt();\n }", "@SuppressWarnings(\"squid:S2221\" /* Stack traces would be lost otherwise */)\n public static void repeat(InterruptibleRunnable runnable) {\n try {\n while (!Thread.interrupted()) {\n run(runnable);\n }\n } catch (Exception e) {\n LOGGER.error(\"{} died unexpectedly\", Thread.currentThread().getName(), e);\n }\n }", "private static void interruptWithException () {\n\n Thread thread = new Thread(() -> {\n try {\n System.out.println(\"start sleeping ...\");\n Thread.sleep(5000000);\n } catch (InterruptedException e) {\n System.out.println(\"interrupted from outside !\");\n }\n });\n\n thread.start();\n }", "public void interrupt() {\n\t\tinterrupted = true;\n\t}", "private void stopThreadByInterrupt() {\n if (customThread != null) {\n try {\n customThread.join();\n customThread.interrupt();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }", "public void timerInterrupt() {\n \tboolean istr = Machine.interrupt().disable();\n \t\n \twhile (sleepingThreads.size()>0 && sleepingThreads.peek().time <= Machine.timer().getTime()) {\n \t\tsleepingThreads.remove().ready();\n \t}\n \n \tKThread.yield();\n \t\n \t//Machine.interrupt().enable();\n \tMachine.interrupt().restore(istr);\n \n }", "@Override\n public void run(){\n\n Thread.currentThread().interrupt();\n }", "public static void main(String[] args) throws InterruptedException {\n InterruptRethrow thread = new InterruptRethrow();\n thread.start();\n Thread.sleep(3000);\n // let me interrupt\n log.info(\"let me interrupt the task thread:D\");\n thread.interrupt();\n log.info(\"task thread interrupted? \" + thread.isInterrupted());\n }", "public void interrupt() {\r\n ServerLogger.log(this.myID + \" interrupt()\");\r\n this.run = false;\r\n //super.interrupt(); //To change body of overridden methods use File | Settings | File Templates.\r\n }", "public void interrupt();", "@Override\n public void interrupt() {\n // the usual check for a set interrupt flag interferes with the looper used, therefore an\n // interrupt from outside directly terminates this handler.\n if (mThread != null) {\n terminate(true);\n } else {\n super.interrupt();\n }\n }", "protected void interrupted() {\r\n\t }", "protected void interrupted() {\n\t\tL.ogInterrupt(this);\n\t}", "public void checkInterruption() throws InterruptedException ;", "protected void interrupted() {\n \t\n }", "protected void interrupted() {\n \t\n }", "public void interrupted() {\n\n }", "protected void interrupted() {\r\n }", "protected void interrupted() {\r\n }", "protected void interrupted() {\r\n }", "protected void interrupted() {\r\n }", "protected void interrupted() {\r\n }", "protected void interrupted() {\r\n }", "void interrupted(W worker);", "public void interruptTask() {\n }", "public void interruptTask() {\n }", "@Test(timeout = 1000)\n public void alreadyInterrupted() throws Exception {\n Thread.currentThread().interrupt();\n assertThrows(InterruptedException.class, () -> lock.lockInterruptibly());\n Thread.currentThread().interrupt();\n assertThrows(InterruptedException.class, () -> lock.tryLock(0, TimeUnit.SECONDS));\n }", "@SuppressWarnings(\"deprecation\")\n private void tryToTerminate(Thread t) {\n if (!t.isAlive()) return;\n \n String tname = t.getName() + \"(#\" + System.identityHashCode(t) + \")\";\n \n // We mark the thread as being killed because once we start calling\n // interrupt or stop weird things can happen. Any logged exceptions should\n // make it clear the thread is being killed.\n runnerThreadGroup.markAsBeingTerminated(t);\n \n logger.warning(\"Attempting to terminate thread: \" + tname + \", currently at:\\n\"\n + traces.formatStackTrace(t.getStackTrace()));\n \n // Try to interrupt first.\n int interruptAttempts = this.killAttempts;\n int interruptWait = this.killWait;\n do {\n try {\n t.interrupt();\n t.join(interruptWait);\n } catch (InterruptedException e) { /* ignore */ }\n \n if (!t.isAlive()) break;\n logger.fine(\"Trying to interrupt thread: \" + tname \n + \", retries: \" + interruptAttempts + \", currently at: \"\n + traces.formatStackTrace(t.getStackTrace()));\n } while (--interruptAttempts >= 0);\n \n if (!t.isAlive()) {\n logger.warning(\"Interrupted a runaway thread: \" + tname);\n }\n \n if (t.isAlive()) {\n logger.warning(\"Does not respond to interrupt(), trying to stop(): \" + tname);\n \n // Try to sent ThreadDeath up its stack if interrupt is not working.\n int killAttempts = this.killAttempts;\n int killWait = this.killWait;\n do {\n try {\n t.stop();\n t.join(killWait);\n } catch (InterruptedException e) { /* ignore */ }\n if (!t.isAlive()) break;\n logger.fine(\"Trying to stop a runaway thread: \" + tname \n + \", retries: \" + killAttempts + \", currently at: \"\n + traces.formatStackTrace(t.getStackTrace()));\n } while (--killAttempts >= 0);\n \n if (!t.isAlive()) {\n logger.warning(\"Stopped a runaway thread: \" + tname);\n } \n }\n \n if (t.isAlive()) {\n logger.severe(\"Could not interrupt or stop thread: \" + tname);\n }\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n }", "protected void interrupted() {\n \n }", "private void stopThreadByRunnable() {\n if (customRunnable != null) {\n customRunnable.killRunnable();\n }\n }", "protected void interrupted() {\n \t// who cares\n }", "@Override\n public void stopThread() {\n Log.d(TAG, \"Stopping \" + getName() + \" thread!\");\n running = false;\n doStopAction();\n boolean retry = true;\n while (retry) {\n try {\n join();\n retry = false;\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }", "public void actionPerformed(ActionEvent e)\n {\n testThread.interrupt();\n }", "protected void interrupted() {\r\n\t\t \tP.println(Tt.getClassName(this) + \" interrupted\");\r\n\t\t }", "protected void interrupted() {\n\t}", "protected void interrupted() {\n\t}", "protected void interrupted() {\n\t}", "protected void interrupted() {\n\t}", "protected void interrupted() {\n\t}", "protected void interrupted() {\n\t}", "protected void interrupted() {\n\t}", "protected void interrupted() {\n\t}", "protected void interrupted() {\n\t}", "void cancel() {\n\tsleepThread.interrupt();\n }", "final protected void interrupt()\n {\n if (startTask != null)\n startTask.interruptAll();\n }", "public void stop() {\n executor.shutdownNow();\n rescanThread.interrupt();\n }", "public abstract void interrupt();", "protected void interrupted() {\n\r\n\t}", "protected void interrupted() {\n\r\n\t}", "public void stop() {\n if (this.thread != null) {\n Thread thre = this.thread;\n this.thread = null;\n thre.interrupt();\n }\n }", "@Override\n\tprotected void interrupted() {\n\t\t//System.out.println(this.getClass().getSimpleName() + \" interrupted\");\n\t}", "private static void checkAndThrowInterruptedException()\n throws InterruptedException {\n if (Thread.currentThread().interrupted()) {\n throw new InterruptedException(\"Timed out before Hive call was made. \"\n + \"Your callTimeout might be set too low or Hive calls are \"\n + \"taking too long.\");\n }\n }", "public void timerInterrupt() {\n\n\t\tMachine.interrupt().disable();\n\n\t\t//while loop the threads in the TreeSet\n\t\twhile(!theThreads.isEmpty()) {\n\t\t\tPair curr_thread = theThreads.first(); //Fetch the first (lowest wakeTime) on the list\n\n\t\t\tif(curr_thread.wakeTime < Machine.timer().getTime()) { //Is the wakeTime for that thread < current time\n\t\t\t\ttheThreads.pollFirst(); //Remove it from the TreeSet, curr_thread holds it still.\n\t\t\t\tcurr_thread.thread.ready(); //Ready that thread\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbreak; //break the loop, not ready yet.\n\t\t\t}\n\t\t}\n\t\tMachine.interrupt().enable();\n\t\tKThread.yield(); //Yield the current thread.\n\t}", "protected void interrupted()\n\t{\n\t\tstop();\n\t}", "private void cancel() {\n mFuture.cancel(mMayInterruptIfRunning);\n }", "public void stop() {\n thread.interrupt();\n }", "@Override\n public void run() {\n System.out.println(\"ffff===\"+ Thread.currentThread().isInterrupted());\n while (true) {\n try{\n Thread.sleep(1);\n System.out.println(\"ccc===\"+ Thread.currentThread().isInterrupted());\n if (Thread.interrupted()) {\n System.out.println(\"ddd===\"+ Thread.currentThread().isInterrupted());\n System.err.println(\"线程中断标志位为true\");\n return;\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }\n }", "protected void interrupted()\n\t{\n\t}" ]
[ "0.6961229", "0.687138", "0.67235976", "0.6551349", "0.64707106", "0.6407882", "0.64024293", "0.6368885", "0.6324804", "0.6314834", "0.63043743", "0.6304185", "0.6257988", "0.6238979", "0.61783266", "0.61659294", "0.61659294", "0.61524904", "0.61367226", "0.61367226", "0.61367226", "0.61367226", "0.61367226", "0.61367226", "0.6129803", "0.6124313", "0.6124313", "0.60996205", "0.6096627", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60771435", "0.60695916", "0.60302377", "0.59987134", "0.59900004", "0.59731877", "0.5964139", "0.59639585", "0.59639585", "0.59639585", "0.59639585", "0.59639585", "0.59639585", "0.59639585", "0.59639585", "0.59639585", "0.59523696", "0.5934569", "0.5930858", "0.59112525", "0.58802724", "0.58802724", "0.58272254", "0.5824038", "0.58040166", "0.5802394", "0.579695", "0.57893664", "0.57871825", "0.5772843", "0.5754125" ]
0.6567515
3
Repeatedly call a runnable until the thread has been interrupted.
@SuppressWarnings("squid:S2221" /* Stack traces would be lost otherwise */) public static void repeat(InterruptibleRunnable runnable) { try { while (!Thread.interrupted()) { run(runnable); } } catch (Exception e) { LOGGER.error("{} died unexpectedly", Thread.currentThread().getName(), e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tsleep(dauer);\n\t\t\tt.interrupt();\n\t\t} catch (InterruptedException e) {\n\t\t}\n\t}", "public static void run(InterruptibleRunnable runnable) {\n try {\n runnable.run();\n } catch (InterruptedException e) {\n LOGGER.info(\"Interrupted\", e);\n Thread.currentThread().interrupt();\n }\n }", "public void run(){\r\n // interrupt is false\r\n while(!interrupt){\r\n // Here in a run method the state of the thread will always be running.\r\n System.out.println(\"Thread running: \" +name+ \" State: \"+ getState());\r\n // try block\r\n try {\r\n // The thread is called to sleep\r\n Thread.sleep(1000);\r\n // The thread may throw InterruptedException if interuppeted. (Throws key word cannot be used with a run method)\r\n } catch(InterruptedException e){\r\n System.out.println(\"Thread Interrupted: \" +name+ \" State: \"+ getState());\r\n }\r\n }\r\n // while loop has finished therefor the thread will exits.\r\n System.out.println(\"Thread exiting under request: \"+name+ \" State: \"+getState());\r\n }", "@Override\n\tpublic void run() {\n\t\twhile(!Thread.currentThread().isInterrupted()){\n\t\t\ttry{\n\t\t\tThread.sleep(100);\n\t\t\t}\n\t\t\tcatch(InterruptedException e){\n\t\t\t\tThread.currentThread().interrupt();\n\t\t\t}\n\t\t\t\n\t\t\tpostInvalidate();\n\t\t}\n\t}", "public void run() {\n try {\n Thread.sleep(10000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n mainThread.interrupt();\n }", "public void run() {\n\t\twhile(true){\n\t\t\tif (Thread.interrupted()) \n\t {\n\t\t\t\tSystem.out.println(\"I am intrupted \"+ Thread.interrupted());\n\t break;\n\t\t\t\t\n\t }\n\t\t\t\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\tThread.currentThread().interrupt();\n\t\t\t}\n\t\t\tfor(int i=0; i<10; i++){\n\t\t\t\tSystem.out.println(\"thread name : \"+Thread.currentThread().getName()+ \"count \"+i);\n\t\t\t}\n\t\t}\n\t}", "final void interruptTask() {\n/* 82 */ Thread currentRunner = this.runner;\n/* 83 */ if (currentRunner != null) {\n/* 84 */ currentRunner.interrupt();\n/* */ }\n/* 86 */ this.doneInterrupting = true;\n/* */ }", "public void run() {\n while (!stopped) {\n Runnable task = (Runnable) queue.remove();\n if (task != null) {\n try {\n task.run();\n } catch (Throwable t) {\n monitor.handleThrowable(this.getClass(), task, t);\n }\n }\n }\n }", "@Override\n\tpublic void run() {\n\n\t\twhile (running.get()) {\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000);\n\t\t\t} catch (InterruptedException ex) {\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Shutting down thread\");\n\t}", "private static void interruptWithException () {\n\n Thread thread = new Thread(() -> {\n try {\n System.out.println(\"start sleeping ...\");\n Thread.sleep(5000000);\n } catch (InterruptedException e) {\n System.out.println(\"interrupted from outside !\");\n }\n });\n\n thread.start();\n }", "@Override\n public void run() {\n try {\n sleep(duration);\n } catch(InterruptedException e) {\n System.out.println(getName() + \" was interrupted. isInterrupted(): \" + isInterrupted());\n return;\n }\n System.out.println(getName() + \" has awakened\");\n }", "@Override\r\n\tpublic void run() {\n\t\tfor (int i=0; i<10; i++){\r\n\t\t\tSystem.out.println(\"Другой поток....\" + mName + \"i=\" +i);\r\n\t\t\t\tif(isInterrupted()){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\tThread.sleep(5000);\r\n\t\t\t} catch (InterruptedException ex) {\r\n\t\t\t\tSystem.out.println(\"Ошибка во сне\");\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\r\n\t\t\t}\r\n\t}", "public void run() {\n\ttimedOut = false;\n\tlong startTime = new Date().getTime();\n\tlong delta = 0;\n\twhile (delta < interval) {\n\t try {\n\t\tThread.sleep(interval - delta);\n\t } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n\t\treturn;\n\t }\n\t delta = new Date().getTime() - startTime;\n\t}\n\ttimedOut = true;\n\ttimeoutHandler.handleTimeout();\n\treturn;\n }", "@Override\n public void run(){\n\n Thread.currentThread().interrupt();\n }", "public void run() {\n\t\t\twhile (true) {\n\t\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\tThread.sleep(500L);\n\t\t\t\t\t// Thread.sleep(30);\n\t\t\t\t\trunOnUiThread(done);\n\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "@Override\n public void run() {\n System.out.println(\"ffff===\"+ Thread.currentThread().isInterrupted());\n while (true) {\n try{\n Thread.sleep(1);\n System.out.println(\"ccc===\"+ Thread.currentThread().isInterrupted());\n if (Thread.interrupted()) {\n System.out.println(\"ddd===\"+ Thread.currentThread().isInterrupted());\n System.err.println(\"线程中断标志位为true\");\n return;\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }\n }", "@Override\r\n\t\tpublic void run() {\n\t\t\twhile(true){\r\n\t\t\t\ttry {\r\n\t\t\t\t\tTimeUnit.SECONDS.sleep(10);\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "@Override\n\tpublic void run() {\n\t\tsuper.run();\n\t\twhile(true) {\n\t\t\ttry {\n\t\t\t\tThread.sleep(500);\n\t\t\t}catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void stopThread() {\n Log.d(TAG, \"Stopping \" + getName() + \" thread!\");\n running = false;\n doStopAction();\n boolean retry = true;\n while (retry) {\n try {\n join();\n retry = false;\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }", "@Override\n\t\tpublic void run() {\n\t\t\ttry {\n\t\t\t\tTimeUnit.SECONDS.sleep(3);\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\t\n\t\t}", "@Override\n\tpublic void run() {\n\t\twhile (!isStoped) {\n\t\t\tdoPause();\n\t\t\tinnerAction();\n\t\t}\n\t}", "@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tThread.sleep(this.timerTime);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tthis.timerFinished = true;\n\t}", "@Override\n public void run() {\n try {\n remove_elements();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "@Override\n\t\tpublic void run() {\n\t\t\tisRepeatFlag = true;\n\t\t}", "public static void inter() throws InterruptedException {\r\n\t\t// Thread.currentThread().sleep(3000);\r\n\t\tstop = true;\r\n\t\t// Thread.currentThread().sleep( 3000 );\r\n\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep((long) time);\r\n\t\t\t\t\trightOff();\r\n\t\t\t\t\tif(unhook)\r\n\t\t\t\t\t\tunhookLEDs();\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t}\r\n\t\t\t}", "@Override\n\t\tpublic void run() {\n\t\t\tsuper.run();\n\t\t\twhile(flag == true){\n\t\t\t\t\n\t\t\t\tssinView.postInvalidate();\n\t\t\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(sleepTime);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "@Override\n\tpublic void run() {\n\t\ttry\n\t\t{\n\t\t\twhile(true)\n\t\t\t{\t\n\t\t\t\tThread.sleep(10);\n\t\t\t\tSystem.out.println(\"INicioooooooooooooooooooooooooooooooooooooooooooooooooooooooooo\");\n\t\t\t\trobot1.tomarPiezaImput(GdeMonitor);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tcatch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public final V runInterruptibly() {\n return this.callable.call();\n }", "public void run() {\r\n\t\tSystem.out.println(\"Thread Starting\");\r\n\t\ttry {\r\n\t\t\twhile(count<5) {\r\n\t\t\t\tThread.sleep(500);\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t}catch(InterruptedException e) {\r\n\t\t\tSystem.out.println(\"Thread Interrupted\");\r\n\t\t}\r\n\t\tSystem.out.println(\"Thread Terminated\");\r\n\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep((long) time);\r\n\t\t\t\t\tleftOff();\r\n\t\t\t\t\tif(unhook)\r\n\t\t\t\t\t\tunhookLEDs();\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t}\r\n\t\t\t}", "public void run() {\n try {\n Thread.sleep(1000000);\n } catch (InterruptedException ie) {\n }\n }", "public void checkInterruption() throws InterruptedException ;", "public void timerInterrupt() \n {\n\t\n Machine.interrupt().disable(); //disable\n\n //if waitingQueue is empty, and current time is greater than or equal to the first ThreadWaits, wakeUp time,\n while(!waitingQueue.isEmpty() && (waitingQueue.peek().wakeUp < Machine.timer().getTime()\n || waitingQueue.peek().wakeUp == Machine.timer().getTime())) {\n waitingQueue.poll().thread.ready(); //pop head\n }\n\n KThread.currentThread().yield();\n\n Machine.interrupt().enable(); //enable\n\n }", "public Future<?> scheduleOneShot(long delay, Runnable runnable) {\n\t\tif (!Raptor.getInstance().isDisposed() && !isDisposed) {\n\t\t\ttry {\n\t\t\t\treturn executor.schedule(new RunnableExceptionDecorator(\n\t\t\t\t\t\trunnable), delay, TimeUnit.MILLISECONDS);\n\t\t\t} catch (RejectedExecutionException rej) {\n\t\t\t\tif (!Raptor.getInstance().isDisposed()) {\n\t\t\t\t\tLOG.error(\"Error executing runnable in scheduleOneShot: \",\n\t\t\t\t\t\t\trej);\n\t\t\t\t\tthreadDump();\n\t\t\t\t\tRaptor.getInstance().onError(\n\t\t\t\t\t\t\t\"ThreadServie has no more threads. A thread dump can be found at \"\n\t\t\t\t\t\t\t\t\t+ THREAD_DUMP_FILE_PATH);\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t} else {\n\t\t\tLOG.info(\"Veoting runnable \" + runnable + \" raptor is disposed.\");\n\t\t\treturn null;\n\t\t}\n\t}", "public void run(){\n while(running){\n System.out.println(\"Inside while loop.\");\n try {\n Thread.sleep(100);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }", "@Override\n public void run() {\n flag = true;\n // The Runnable is posted to run again here:\n handler.postDelayed(this, interval);\n }", "public void run() {\n\t\t\t\ttry {Thread.sleep(1000000000);} catch (InterruptedException ie) {}\n\t\t\t}", "public void timerInterrupt() {\n \tboolean istr = Machine.interrupt().disable();\n \t\n \twhile (sleepingThreads.size()>0 && sleepingThreads.peek().time <= Machine.timer().getTime()) {\n \t\tsleepingThreads.remove().ready();\n \t}\n \n \tKThread.yield();\n \t\n \t//Machine.interrupt().enable();\n \tMachine.interrupt().restore(istr);\n \n }", "@Override\n\tpublic void run() {\n\t\n\t\t\ttry {\n\t\t\t\trouseButton();\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\tthis.interrupt();\n\t\t\t}\n\t\n\t}", "@Override public void run() {\r\n\t\t\ttry {\r\n\t\t\t\twhile (!stopped) {\r\n\t\t\t\t\tThread.sleep(delay);\r\n\t\t\t\t\tif (!stopped) {\r\n\t\t\t\t\t\tflush();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} catch (final InterruptedException e) {\r\n\t\t\t\tthrow new RuntimeException(e);\r\n\t\t\t}\r\n\t\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep((long) time);\r\n\t\t\t\t\tallOff();\r\n\t\t\t\t\tif(unhook)\r\n\t\t\t\t\t\tunhookLEDs();\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t}\r\n\t\t\t}", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\t\n\t\t\t while ( !bFinished ) {\n\t\t\t \ttry {\n\t\t\t\t\t\t\tThread.sleep(200);\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t }\n\t\t\t System.exit(0);\n\t\t\t\t}", "@Override\r\n\tpublic void run() {\n\t\twhile(true) {\r\n\t\t\ttry {\r\n\t\t\t\tsleep(3000);\r\n\t\t\t\tSystem.out.println(\"자동저장\");\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}", "public void timerInterrupt() {\n\n\t\tMachine.interrupt().disable();\n\n\t\t//while loop the threads in the TreeSet\n\t\twhile(!theThreads.isEmpty()) {\n\t\t\tPair curr_thread = theThreads.first(); //Fetch the first (lowest wakeTime) on the list\n\n\t\t\tif(curr_thread.wakeTime < Machine.timer().getTime()) { //Is the wakeTime for that thread < current time\n\t\t\t\ttheThreads.pollFirst(); //Remove it from the TreeSet, curr_thread holds it still.\n\t\t\t\tcurr_thread.thread.ready(); //Ready that thread\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbreak; //break the loop, not ready yet.\n\t\t\t}\n\t\t}\n\t\tMachine.interrupt().enable();\n\t\tKThread.yield(); //Yield the current thread.\n\t}", "public void run(Runnable runnable) {\n\t\tif (!Raptor.getInstance().isDisposed() && !isDisposed) {\n\t\t\ttry {\n\t\t\t\texecutor.execute(new RunnableExceptionDecorator(runnable));\n\t\t\t} catch (RejectedExecutionException rej) {\n\t\t\t\tif (!Raptor.getInstance().isDisposed()) {\n\t\t\t\t\tLOG.error(\"Error executing runnable: \", rej);\n\t\t\t\t\tthreadDump();\n\t\t\t\t\tRaptor.getInstance().onError(\n\t\t\t\t\t\t\t\"ThreadServie has no more threads. A thread dump can be found at \"\n\t\t\t\t\t\t\t\t\t+ THREAD_DUMP_FILE_PATH, rej);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tLOG.info(\"Vetoing runnable in ThreadService, raptor is disposed. \" + runnable);\n\t\t}\n\t}", "@Override\n\t\tpublic void run() {\n\t\t\twhile (flag) {\n\t\t\t\t\n\t\t\t\tgetDoorbellData(App.address+\"CGetData.php?uid=\"+id+\"&getType=b1\");\n\t\t\t\tgetPIRData(App.address+\"CGetData.php?uid=\"+id+\"&getType=5\");\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(2*1000); //暂定延时2s\n\t\t\t\t\t\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\tThread.interrupted();\n\t\t}", "@Override\r\n\tpublic void run() {\n\t\tint i=0;\r\n\t\twhile(i<1000) {\r\n\t\t\tq.get();\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public void run() {\n mReaderHelper.runLoopInventroy();\n mLoopHandler.postDelayed(this, 100);\n }", "@Override\n public void run() {\n if (!this.m_running) {\n this.m_running = true;\n this.pollingLooper();\n }\n }", "public void run(){\n\t\twhile(runBit){\n\n\t\t}\n\t\tprintln(\"pump thread done!\");\n\t}", "@Override\r\n\t\tpublic void run() {\n\t\t\tSystem.out.println(\"updateThread\");\r\n\t\t\thandler.postDelayed(updateThread, 3000);\r\n\t\t}", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(1500);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\tleave = false;\n\t\t\t\t}", "@Override\n\tpublic void run() {\n\t\tint result;\n\t\tRandom random=new Random(Thread.currentThread().getId());\n\t\twhile (true) {\n\t\t\tresult=1000/(int)(random.nextDouble()*1000000000);\n\t\t\tif (Thread.currentThread().isInterrupted()) {\n\t\t\t\tSystem.out.printf(\"%d : interrupted\\n\",Thread.currentThread().getId());\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public void run() {\n int counter = 0;\n while (true) {\n counter++;\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n System.out.println(counter);\n if (counter > 5) break;\n }\n }", "@Override\n\t\tpublic void run() {\n\n\t\t\twhile (isRun) {\n\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(500);\n\n\t\t\t\t\tisRun = false;\n\t\t\t\t\thandler.sendEmptyMessage(2);\n\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "@Override\n\tpublic void run() {\n\t\twhile(true){\n\t\t\t\n\t\t}\n\t}", "@Override\n\tpublic void run() {\n\t\twhile (true) {\n\t\t\tIterator<Future<Integer>> iter = runningThreadsList.iterator();\n\t\t\tif (iter.hasNext()) {\n\t\t\t\tFuture<Integer> future = (Future<Integer>) iter.next();\n\t\t\t\tif (future.isDone()) {\n\t\t\t\t\trunningThreadsList.remove(future);\n\t\t\t\t\t\n\t\t\t\t\tif (allocator.getInventory().isEmpty()) {\n\t\t\t\t\t\tallocator.shutdown();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tThread.yield();\n\t\t}\n\t\t\t\n\t\t\n\t}", "public void run() {\n try {\n Thread.sleep(2000);\n }\n catch (InterruptedException ex) { }\n // system is still running, so force an exit\n System.exit(0);\n }", "@Override\r\n\t\tpublic void run() {\n\t\t\twhile(true){\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}", "@Override\r\n\tpublic void run() {\n\t\tfor (int i=1; i<0;i++) {\r\n\t\t\ttry {\r\n\t\t\t\tcurrentThread();\r\n\t\t\t\tThread.sleep(1000);\r\n\t\t\t\tSystem.out.println(currentThread());\r\n\t\t\t}catch(Exception e) {}\r\n\t\t}\r\n\t}", "@Override\npublic void run() {\n perform();\t\n}", "public void run() {\n\t\t\t\ttry {\n\t\t\t\t\tsleep(5000);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tfinally{ finish(); }\n\t\t\t}", "public void run(){\r\n\t\ttry{\r\n\t\t\tfor(int i=0; i<10; i++){\r\n\t\t\t\tSystem.out.println(Thread.currentThread().getName()+\" is lazy - \"+i);\r\n\t\t\t\tThread.sleep(100);\r\n\t\t\t}\r\n\t\t} catch(InterruptedException interruptedException){\r\n\t\t\tSystem.out.println(\"InterruptedException exception caught. No more execution from this thread now!!\");\r\n\t\t}\r\n\t}", "public void interrupt();", "public void run() {\n for (int i = 0; i < 5; i++) {\n System.out.println(\"Hi\");\n try {Thread.sleep(1000);} catch(Exception e){}; // some heavy code\n }\n }", "@Override\n\t\tpublic void run() {\n if (mRemovedListener != null) {\n // Timed out waiting for device UUID that indicates device removal happened.\n mRemovedListener.onDeviceRemoved(mRemovedDeviceId, false);\n mRemovedListener = null;\n mRemovedUuidHash = 0;\n mRemovedDeviceId = 0;\n mService.setDeviceDiscoveryFilterEnabled(false);\n }\n\t\t}", "@Override\n public void run() {\n try {\n sleep(1000);\n if (spaces.isAlive() || words.isAlive()) {\n spaces.interrupt();\n words.interrupt();\n }\n } catch (InterruptedException e) {\n System.out.println(\"Calulation takes to long, interrupting!\");\n }\n }", "public void shutdown() {\n this.runnable.stop = true;\n LockSupport.unpark(this);\n }", "void interrupted(W worker);", "public void run() {\n\t\twhile (!isShutdown()) {\n\t\t\tlong threadId = Thread.currentThread().getId(); \n\t\t\tSystem.out.println(\"Thread \" + threadId + \" is trying to dequeue from queue of size \" + taskQueue.size());\n\t\t\tRunnable task = taskQueue.dequeue();\n\t\t\ttask.run(); \n\t\t}\n\t}", "private static void runLater(Runnable runnable) {\n Display display = Display.findDisplay(Thread.currentThread());\n if (display != null) {\n display.asyncExec(runnable);\n } else {\n AdtPlugin.log(IStatus.WARNING, \"Could not find display\");\n }\n }", "@Override\n\tpublic void run() {\n\t\tint i = 0;\n\t\twhile(flag) {\n\t\t\tSystem.out.println(\"run......Thread\" + i++);\n\t\t}\n\t}", "@Override\n public void run() {\n ICBlock currentBlock = null;\n\n while (running) {\n try {\n currentBlock = mQueue.take();\n currentBlock.doAction();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n\n }\n\n\n }", "@Override // java.lang.Runnable\n public final void run() {\n ListenableFuture<? extends I> listenableFuture = this.h;\n F f = this.i;\n boolean z = true;\n boolean isCancelled = isCancelled() | (listenableFuture == null);\n if (f != null) {\n z = false;\n }\n if (!isCancelled && !z) {\n this.h = null;\n if (listenableFuture.isCancelled()) {\n setFuture(listenableFuture);\n return;\n }\n try {\n try {\n Object o = o(f, Futures.getDone(listenableFuture));\n this.i = null;\n p(o);\n } catch (Throwable th) {\n this.i = null;\n throw th;\n }\n } catch (CancellationException unused) {\n cancel(false);\n } catch (ExecutionException e) {\n setException(e.getCause());\n } catch (RuntimeException e2) {\n setException(e2);\n } catch (Error e3) {\n setException(e3);\n }\n }\n }", "@Override\r\n\t\tpublic void run() {\n\t\t\twhile(true) {\r\n\t\t\t\tsynchronized(a) {\r\n\t\t\t\t\twhile(!a.isEmpty()) {\r\n\t\t\t\t\t\ta.getFirst().cover();\r\n\t\t\t\t\t\ta.removeFirst();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(2000);\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\r\n\t\t\t\tfor(int i=0;i<15;i++){\r\n\t\t\t\t\tSystem.out.println(\"inside the run method of thread\"+\r\n\t\t\t\t\t\t\tThread.currentThread().getName() +\",i is\"+i);\r\n\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\tThread.sleep(100);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch(InterruptedException e){\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\r\n\t\t\t\tfor(int i=0;i<15;i++){\r\n\t\t\t\t\tSystem.out.println(\"inside the run method of thread\"+\r\n\t\t\t\t\t\t\tThread.currentThread().getName() +\",i is\"+i);\r\n\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\tThread.sleep(100);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch(InterruptedException e){\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\r\n\t\t\t\tfor(int i=0;i<15;i++){\r\n\t\t\t\t\tSystem.out.println(\"inside the run method of thread\"+\r\n\t\t\t\t\t\t\tThread.currentThread().getName() +\",i is\"+i);\r\n\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\tThread.sleep(100);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch(InterruptedException e){\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}", "@Override\n public void run()\n {\n if(_Running.compareAndSet(IDLE, RUNNING)) {\n _SequenceBarrier.clearAlert();\n\n try {\n if(_Running.get() == RUNNING) {\n processEvents();\n }\n }\n finally {\n _Running.set(IDLE);\n }\n }\n else {\n // This is a little bit of guess work. The running state could of changed to HALTED by\n // this point. However, Java does not have compareAndExchange which is the only way\n // to get it exactly correct.\n if(_Running.get() == RUNNING) {\n throw new IllegalStateException(\"Thread is already running\");\n }\n else {\n halt();\n }\n }\n }", "public void run()\n {\n for (Runnable next = next(); null != next; next = next())\n {\n next.run();\n\n synchronized (m_lock)\n {\n m_runnable = null;\n }\n }\n }", "public void interrupt() {\n interrupted.set(true);\n Thread.currentThread().interrupt();\n }", "@Override\n public void run() {\n super.run();\n /**\n * Use following commented line of codes, if you don't want runnable</br>\n * and do comment super.run() as well , otherwise both will run*/\n// while (run && count > 0) {\n// count++;\n// try {\n// Thread.sleep(500);\n// } catch (InterruptedException e) {\n// e.printStackTrace();\n// }\n//\n// System.out.println(tag + \":: count =\" + count);\n// }\n }", "void cancel() {\n\tsleepThread.interrupt();\n }", "void runInThread(Runnable runnable) {\n try {\n Thread thread = new Thread(runnable::run);\n thread.start();\n } catch (Exception ex) {\n log.info(ex.getMessage());\n }\n\n }", "private void customWait() throws InterruptedException {\n while (!finished) {\n Thread.sleep(1);\n }\n finished = false;\n }", "@Override\n public void surfaceDestroyed(SurfaceHolder holder) {\n boolean retry = true;\n int count = 0;\n while (retry && (count < 1000)) {\n count++;\n try {\n thread.setRunning(false);\n thread.join();\n retry = false;\n thread = null; //deletes thread if stopped\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }", "public boolean awaitUninterruptibly(long timeout, TimeUnit unit)\r\n/* 279: */ {\r\n/* 280: */ try\r\n/* 281: */ {\r\n/* 282:307 */ return await0(unit.toNanos(timeout), false);\r\n/* 283: */ }\r\n/* 284: */ catch (InterruptedException e)\r\n/* 285: */ {\r\n/* 286:310 */ throw new InternalError();\r\n/* 287: */ }\r\n/* 288: */ }", "@Test(timeout = 1000)\n public void alreadyInterrupted() throws Exception {\n Thread.currentThread().interrupt();\n assertThrows(InterruptedException.class, () -> lock.lockInterruptibly());\n Thread.currentThread().interrupt();\n assertThrows(InterruptedException.class, () -> lock.tryLock(0, TimeUnit.SECONDS));\n }", "public void stopAndWait() throws InterruptedException {\n\t\t//Store resetCounter.\n\t\tint curReset = resetCounter;\n\t\t\n\t\t//Mark that we want to stop\n\t\tstop();\n\t\t\n\t\t//Wait until we have stopped, or reset has been called.\n\t\twhile (!isStopped() && curReset == resetCounter) {\n\t\t\tif (thread != null) {\n\t\t\t\tthread.join(25L);\n\t\t\t} else {\n\t\t\t\tThread.sleep(25L);\n\t\t\t}\n\t\t}\n\t}", "public void run() {\r\n\twhile (true) {\r\n\t\ttry {\r\n\t\t\tif(!cancel) {\r\n\t\t\t\tsetSoilMoisture();\r\n\t\t\t\tMain.serialization(\"SoilMoisture_S.txt\", this);\r\n\t\t\t\tThread.sleep(updateInterval * TESTINTERVAL);\r\n\t\t\t} else {\r\n\t\t\t\tThread.sleep(1000);\r\n\t\t\t}\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\tSystem.out.println(\"Soil Moisture Sensor stopped!\");\r\n\t\t\t} \r\n\t\t}\r\n\t}", "@Override\n public void run() {\n System.out.println(ANSI_BLUE + \"Hello from \" + currentThread().getName());\n\n // Put this thread to sleep for 3 seconds to allow other threads to be run.\n try {\n // Thread.sleep(5000);\n Thread.sleep(5000);\n }\n\n // This exception will be thrown if another thread woke us up.\n // A thread can be interrupted hence the reason why we have this block of code.\n // For example, an INTERRUPT COULD END THE EXECUTION OF THIS THREAD.\n // There are 2 ways for a thread to know it is being interrupted:\n // 1. Catch the interrupted exception\n // 2. It should call the interrupted method priodically to check whether it is being interruoted.\n catch (InterruptedException e){\n System.out.println(ANSI_BLUE + \"Another thread woke me up\");\n\n // The AnotherThread instance will be terminated as soon as it is interrupted (thanks to the 'return' statement).\n return;\n }\n\n // This will tell us when 3 seconds has elapsed.\n System.out.println(ANSI_BLUE + \"Three seconds has passed and now I'm awake\");\n }", "@Override\n\tpublic void run() {\n\n\t\tint loop = 0;\n\n\t\tdo {\n\t\t\tthis.onCallTeam.setCountTimer(loop);\n\t\t\tloop++;\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000);\n\t\t\t} catch (InterruptedException ex) {\n\t\t\t\tSystem.out.println(\"Interrupted\");\n\t\t\t}\n\t\t} while (loop != 900);// 15 minutes\n\n\t}", "public static void main(String[] args) throws InterruptedException {\n InterruptRethrow thread = new InterruptRethrow();\n thread.start();\n Thread.sleep(3000);\n // let me interrupt\n log.info(\"let me interrupt the task thread:D\");\n thread.interrupt();\n log.info(\"task thread interrupted? \" + thread.isInterrupted());\n }", "protected void stopForecaster() {\n if (m_runThread != null) {\n m_runThread.interrupt();\n m_runThread.stop();\n }\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tstartRecallJobTask();\n\t\t\t\tmHandler.postDelayed(mHandlerTask, INTERVAL);\n\t\t\t}", "@Override\n\tpublic void run() {\n\t\tString result = null;\n\t\twhile (checkToStart()) {\n\t\t\tresult = doRun();\n\t\t\tsendResult(result);\n\t\t}\n\t\t// System.out.println(\"Thread - \" + name + \" is dead\");\n\t}", "public void interrupt() {\n\t\tinterrupted = true;\n\t}", "@Override\n\t\tpublic void run() {\n\t\t\tbyte[] data = new byte[1024];\n\t\t\tByteBuffer buffer = ByteBuffer.allocate(2048);\n\n\t\t\ttry {\n\t\t\t\twhile(!isInterrupted()) {\n\t\t\t\t\tDatagramPacket packet = new DatagramPacket(data, data.length);\n\t\t\t\t\tUDPSocket.receive(packet);\n\n\t\t\t\t\tcheckPacket(buffer, data, packet.getLength());\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t\tif(!UDPSocket.isClosed()) {\n\t\t\t\t\tUDPSocket.close();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tLog.v(TAG, \"udp read Thread exit\");\n\t\t}", "public void interrupted() {\n\n }" ]
[ "0.6902571", "0.63681656", "0.63658065", "0.6350517", "0.63404125", "0.6207948", "0.6190328", "0.61690545", "0.61608064", "0.61362725", "0.60588074", "0.603792", "0.6026022", "0.5985611", "0.59838665", "0.59730494", "0.59328026", "0.5920737", "0.5882888", "0.58648103", "0.5854717", "0.5851006", "0.5848475", "0.5834798", "0.5833984", "0.5828663", "0.58242565", "0.58150697", "0.57908505", "0.57852185", "0.5776226", "0.57729876", "0.57686806", "0.57670325", "0.57487196", "0.5737758", "0.573488", "0.57322395", "0.5722458", "0.57219535", "0.5714803", "0.5712024", "0.5683089", "0.567885", "0.5634236", "0.56340784", "0.5634073", "0.5632948", "0.56230265", "0.56218994", "0.56198025", "0.561965", "0.5612511", "0.56120294", "0.56117755", "0.558864", "0.5570791", "0.5560216", "0.55596644", "0.55458295", "0.5544286", "0.5530917", "0.5520923", "0.5514695", "0.5510098", "0.55062747", "0.5500831", "0.5496836", "0.5483895", "0.5475291", "0.5474381", "0.5463778", "0.5460723", "0.54593074", "0.5459268", "0.5456103", "0.54559153", "0.54559153", "0.54559153", "0.5426128", "0.5424472", "0.54142493", "0.5400024", "0.539465", "0.53913444", "0.53859407", "0.5382555", "0.53822005", "0.53777134", "0.5376623", "0.5373994", "0.53685117", "0.5366421", "0.5365142", "0.53534794", "0.5352839", "0.53526276", "0.53512526", "0.5350839", "0.5349657" ]
0.743843
0
Created by mainza1992 on 08/10/2017.
public interface IRequestInterface { @GET(API_CONSTANTS.SANFRAN_API) Observable<List<ParkingModel>> getParkingList(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n public void func_104112_b() {\n \n }", "private stendhal() {\n\t}", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\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 tires() {\n\t\t\r\n\t}", "private void poetries() {\n\n\t}", "public void mo38117a() {\n }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "private void m50366E() {\n }", "@Override\n public int describeContents() { return 0; }", "@Override\n\tprotected void interr() {\n\t}", "public void mo4359a() {\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\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\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n protected void getExras() {\n }", "private void kk12() {\n\n\t}", "private void init() {\n\n\t}", "@Override\n public void init() {\n\n }", "public void gored() {\n\t\t\n\t}", "private void strin() {\n\n\t}", "public void mo6081a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\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 public void init() {\n }", "private Rekenhulp()\n\t{\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n public void memoria() {\n \n }", "public void mo12930a() {\n }", "public void mo21877s() {\n }", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "public void mo12628c() {\n }", "@Override\n\tpublic void einkaufen() {\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\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "public Pitonyak_09_02() {\r\n }", "@Override\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\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 void init() {\n }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\r\n\tpublic void init() {}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n protected void init() {\n }", "Constructor() {\r\n\t\t \r\n\t }", "public abstract void mo70713b();", "@Override\n\tpublic void nghe() {\n\n\t}", "static void feladat9() {\n\t}", "@Override\n public void init() {}", "static void feladat4() {\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "public void m23075a() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "public void mo55254a() {\n }", "public void mo21878t() {\n }", "@Override\n\tpublic void init() {\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tpublic void init()\n\t{\n\n\t}" ]
[ "0.58945704", "0.5816213", "0.57561386", "0.5727036", "0.5702443", "0.5702443", "0.5690912", "0.5689891", "0.5681307", "0.5626138", "0.5621689", "0.5599227", "0.5591405", "0.5551018", "0.55292666", "0.5526214", "0.5524874", "0.5498767", "0.5492891", "0.5489722", "0.5481001", "0.54799354", "0.54773045", "0.5474173", "0.5468053", "0.54639137", "0.5445427", "0.54219645", "0.5417286", "0.5417286", "0.5417286", "0.5417286", "0.5417286", "0.5412239", "0.5411922", "0.53943264", "0.5381458", "0.53729177", "0.5358599", "0.5345937", "0.5343513", "0.5334506", "0.5334506", "0.5334506", "0.5334506", "0.5334506", "0.5334506", "0.5334506", "0.5312003", "0.5312003", "0.5302154", "0.52986944", "0.52977055", "0.52969724", "0.5292172", "0.52897465", "0.52870727", "0.5284031", "0.52816", "0.52808803", "0.52808803", "0.52808803", "0.52794915", "0.52794915", "0.5278384", "0.52765584", "0.52765584", "0.52765584", "0.52657086", "0.52657086", "0.52657086", "0.52639693", "0.5260907", "0.5260174", "0.5259542", "0.52570695", "0.525643", "0.52528757", "0.52527297", "0.5248083", "0.52436805", "0.52408546", "0.5229357", "0.52287", "0.52287", "0.52237725", "0.5219818", "0.5219818", "0.5219818", "0.5219818", "0.5219818", "0.5219818", "0.52195364", "0.521267", "0.52117366", "0.5210924", "0.5205478", "0.5197365", "0.5196703", "0.5195869", "0.5195237" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public Object call() throws Exception { int max = Integer.MIN_VALUE; for (int i = start;i<end;i++){ if (data[i]>max)max = data[i]; } return max; }
{ "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
Initialize our new UI component
@Override protected void init(VaadinRequest request) { final TextFieldMultiline component = new TextFieldMultiline(); component.setCaption("Caption"); component.setInputPrompt("Enter multiline here"); component.setResetButtonEnabled(true); // component.setEnabled(true); // Initialize our new UI component final TextFieldMultiline disabledComponent = new TextFieldMultiline(); disabledComponent.setCaption("Caption (disabled)"); disabledComponent.setInputPrompt("Enter multiline here"); List<String> list = new ArrayList<>(); list.add("ABC"); list.add("DEF"); disabledComponent.setValue(list); disabledComponent.setEnabled(false); Button btnClear = new Button("clear"); btnClear.addClickListener(e -> component.clear()); // Show it in the middle of the screen final VerticalLayout layout = new VerticalLayout(); layout.setStyleName("demoContentLayout"); layout.setSizeFull(); final HorizontalLayout hLayout = new HorizontalLayout(); hLayout.addComponent(component); hLayout.addComponent(btnClear); hLayout.setSpacing(true); hLayout.setComponentAlignment(btnClear, Alignment.BOTTOM_RIGHT); layout.addComponent(hLayout); layout.setComponentAlignment(hLayout, Alignment.MIDDLE_CENTER); layout.addComponent(disabledComponent); layout.setComponentAlignment(disabledComponent, Alignment.MIDDLE_CENTER); setContent(layout); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public UI() {\n initComponents();\n }", "private void initUI() {\n }", "public void init()\n {\n buildUI(getContentPane());\n }", "protected void initialize()\n {\n uiFactory.configureUIComponent(this, UI_PREFIX);\n\n initializeFields();\n initializeLabels();\n initLayout();\n }", "public RummyUI(){\n \n //Call method initComponents\n initComponents();\n \n }", "@Override\r\n\tprotected void initUI() {\n\r\n\t}", "private void initComponent() {\n\t\taddGrid();\n\t\taddToolBars();\n\t}", "public mainUI() {\n initComponents();\n }", "private void initComponents() {\n\t\t\n\t}", "private void initComponents() {\n\t\t\n\t}", "public uitax() {\n initComponents();\n }", "void initUI();", "public BridgingUI() {\n initComponents();\n initUserActions();\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "private void initcomponent() {\n\r\n\t}", "public GUI() {\n\t\tinitComponents();\n\t}", "public HealthUI() {\n init();\n }", "public userinterface() {\n initComponents();\n }", "private void initialiseUI()\n { \n // The actual data go in this component.\n String defaultRootElement = \"icr:regionSetData\";\n JPanel contentPanel = initialiseContentPanel(defaultRootElement);\n pane = new JScrollPane(contentPanel);\n \n panelLayout = new GroupLayout(this);\n\t\tthis.setLayout(panelLayout);\n\t\tthis.setBackground(DAOConstants.BG_COLOUR);\n\n\t\tpanelLayout.setAutoCreateContainerGaps(true);\n\n panelLayout.setHorizontalGroup(\n\t\t\tpanelLayout.createParallelGroup()\n\t\t\t.addComponent(pane, 10, 520, 540)\n );\n\n panelLayout.setVerticalGroup(\n\t\t\tpanelLayout.createSequentialGroup()\n .addComponent(pane, 10, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)\n );\n }", "private void initialize()\n {\n this.setPreferredSize(new com.ulcjava.base.application.util.Dimension(549,426));\n this.add(getComboBox(), com.ulcjava.base.application.ULCBorderLayoutPane.NORTH);\n }", "public UI() {\n initComponents();\n setResizable(false);\n }", "private void initUI() {\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\trenderer = new LWJGLRenderer();\n\t\t\tgui = new GUI(stateWidget, renderer);\n\t\t\tthemeManager = ThemeManager.createThemeManager(StateWidget.class.getResource(\"gameui.xml\"), renderer);\n\t\t\tgui.applyTheme(themeManager);\n\t\t\t\n\t\t} catch (LWJGLException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void initialize() {\r\n\t\t// set specific properties and add inner components.\r\n\t\tthis.setBorder(BorderFactory.createEtchedBorder());\r\n\t\tthis.setSize(300, 400);\r\n\t\tthis.setLayout(new BorderLayout());\r\n\t\taddComponents();\r\n\t}", "private void initialize() {\n\t\tthis.setSize(430, 280);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setUndecorated(true);\n\t\tthis.setModal(true);\n\t\tthis.setBackground(new java.awt.Color(226,226,222));\n\t\tthis.setTitle(\"Datos del Invitado\");\n\t\tthis.addComponentListener(this);\n\t}", "private void initUI()\r\n\t{\r\n\t\tthis.label = new Label();\r\n\t\t\r\n\t\tthis.label.setText(\"This view is also saveable\");\r\n\t\t\r\n\t\tthis.label.setSizeUndefined();\r\n\t\tthis.add(this.label);\r\n\t\tthis.setSizeFull();\r\n\t}", "public GUI() {\n initComponents();\n }", "public GUI() {\n initComponents();\n }", "public void init() {\n initComponents();\n initData();\n }", "public Library() {\r\n initComponents();\r\n }", "public MHTYGUI() {\n\t\t\tinitComponents();\n\t\t}", "private void initComponents() {\n // Create the RGB and the HSB radio buttons.\n createRgbHsbButtons();\n\n \n \n ColorData initial = new ColorData(new RGB(255, 255, 255), 255);\n\n // Create the upper color wheel for the display.\n upperColorWheel = new ColorWheelComp(shell, this, upperWheelTitle);\n // upperColorWheel.setColor(colorArray.get(0));\n upperColorWheel.setColor(initial);\n\n // Create the color bar object that is displayed\n // in the middle of the dialog.\n colorBar = new ColorBarViewer(shell, this, sliderText, cmapParams);\n\n // Create the lower color wheel for the display.\n lowerColorWheel = new ColorWheelComp(shell, this, lowerWheelTitle);\n // lowerColorWheel.setColor(colorArray.get(colorArray.size() - 1));\n lowerColorWheel.setColor(initial);\n\n // Create the bottom control buttons.\n createBottomButtons();\n }", "public RagaiGUI() {\n initComponents();\n \n }", "@Override\n public void initComponent() {\n }", "@Override\n public void initComponent() {\n }", "public PropsGUI() {\n initComponents();\n }", "private void initUI() {\n\t\tthis.horizontalLayout = new XdevHorizontalLayout();\n\t\tthis.gridLayout = new XdevGridLayout();\n\t\tthis.button = new XdevButton();\n\t\tthis.button2 = new XdevButton();\n\t\tthis.label = new XdevLabel();\n\n\t\tthis.button.setCaption(\"go to HashdemoView\");\n\t\tthis.button2.setCaption(\"go to CommonView\");\n\t\tthis.label.setValue(\"Go into code tab to view comments\");\n\n\t\tthis.gridLayout.setColumns(2);\n\t\tthis.gridLayout.setRows(2);\n\t\tthis.button.setWidth(200, Unit.PIXELS);\n\t\tthis.button.setHeight(-1, Unit.PIXELS);\n\t\tthis.gridLayout.addComponent(this.button, 0, 0);\n\t\tthis.button2.setWidth(200, Unit.PIXELS);\n\t\tthis.button2.setHeight(-1, Unit.PIXELS);\n\t\tthis.gridLayout.addComponent(this.button2, 1, 0);\n\t\tthis.label.setWidth(100, Unit.PERCENTAGE);\n\t\tthis.label.setHeight(-1, Unit.PIXELS);\n\t\tthis.gridLayout.addComponent(this.label, 0, 1, 1, 1);\n\t\tthis.gridLayout.setComponentAlignment(this.label, Alignment.TOP_CENTER);\n\t\tthis.gridLayout.setSizeUndefined();\n\t\tthis.horizontalLayout.addComponent(this.gridLayout);\n\t\tthis.horizontalLayout.setComponentAlignment(this.gridLayout, Alignment.MIDDLE_CENTER);\n\t\tthis.horizontalLayout.setExpandRatio(this.gridLayout, 10.0F);\n\t\tthis.horizontalLayout.setSizeFull();\n\t\tthis.setContent(this.horizontalLayout);\n\t\tthis.setSizeFull();\n\n\t\tthis.button.addClickListener(event -> this.button_buttonClick(event));\n\t\tthis.button2.addClickListener(event -> this.button2_buttonClick(event));\n\t}", "public abstract void initUiAndListener();", "public void initComponents();", "public Gui() {\n initComponents();\n }", "private void initComponents() {\r\n\r\n setLayout(new java.awt.BorderLayout());\r\n }", "public LinkNodesUI() {\n initComponents();\n }", "private void initComponents() {\r\n\t\temulator = new Chip8();\r\n\t\tpanel = new DisplayPanel(emulator);\r\n\t\tregisterPanel = new EmulatorInfoPanel(emulator);\r\n\t\t\r\n\t\tcontroller = new Controller(this, emulator, panel, registerPanel);\r\n\t}", "public DrugUI() {\n initComponents();\n }", "private void initUI() {\r\n\t\tthis.verticalLayout = new XdevVerticalLayout();\r\n\t\tthis.verticalLayout2 = new XdevVerticalLayout();\r\n\t\r\n\t\tthis.setSpacing(false);\r\n\t\tthis.setMargin(new MarginInfo(false));\r\n\t\tthis.verticalLayout.setSpacing(false);\r\n\t\tthis.verticalLayout.setMargin(new MarginInfo(false));\r\n\t\tthis.verticalLayout2.setMargin(new MarginInfo(false));\r\n\t\r\n\t\tthis.verticalLayout2.setSizeFull();\r\n\t\tthis.verticalLayout.addComponent(this.verticalLayout2);\r\n\t\tthis.verticalLayout.setComponentAlignment(this.verticalLayout2, Alignment.MIDDLE_CENTER);\r\n\t\tthis.verticalLayout.setExpandRatio(this.verticalLayout2, 20.0F);\r\n\t\tthis.verticalLayout.setSizeFull();\r\n\t\tthis.addComponent(this.verticalLayout);\r\n\t\tthis.setComponentAlignment(this.verticalLayout, Alignment.MIDDLE_CENTER);\r\n\t\tthis.setExpandRatio(this.verticalLayout, 10.0F);\r\n\t\tthis.setSizeFull();\r\n\t\r\n\t\tthis.addContextClickListener(event -> this.this_contextClick(event));\r\n\t}", "@Override\r\n public void initComponent() {\n }", "private void initComponents() {\n\n setLayout(new java.awt.BorderLayout());\n }", "private void initUI() {\n\t\tfileInputPanel.setLayout(new GridBagLayout());\n\n\t\tGridBagConstraints gridBagConstraints = new GridBagConstraints();\n\t\tgridBagConstraints.insets = new Insets(10, 5, 10, 5);\n\t\tgridBagConstraints.anchor = GridBagConstraints.NORTH;\n\t\tgridBagConstraints.gridwidth = 2;\n\n\t\tJLabel title = new JLabel(\"Welcome to ANNie\");\n\t\ttitle.setFont(new Font(\"Serif\", Font.BOLD, 36));\n\n\t\tfileInputPanel.add(title, gridBagConstraints);\n\n\t\tgridBagConstraints.gridwidth = 1;\n\t\tgridBagConstraints.insets = new Insets(10, 5, 10, 5);\n\n\t\tfileInputPanel.setBorder(BorderFactory.createLineBorder(Color.black));\n\n\t\tcreateFileDropdownArea(gridBagConstraints);\n\t\tcreateLabelSelectArea(gridBagConstraints);\n\t\tcreateButtons(gridBagConstraints);\n\t}", "public AulaView() {\n initComponents();\n }", "public ReportUi() {\n initComponents();\n }", "public intrebarea() {\n initComponents();\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 }", "private UI()\n {\n this(null, null);\n }", "public ConverterGUI() {\n initComponents();\n }", "protected abstract void initializeComponent(View view);", "public ElevatorUI() {\n initComponents();\n }", "public GUI() {\n initComponents();\n }", "private void initComponents()\n {\n //LAYOUT\n initLayoutComponents();\n \n //TRANSITION COMPONENTS\n initTransitionComponents();\n \n //SEARCH PANE COMPONENTS\n initSearchComponents();\n \n //RESULTS PANE COMPONENTS\n initResultComponents();\n \n // CRAWLER CONTROLS\n initCrawlerControlsComponents();\n \n // KEYWORD BAR\n initKeywordBarComponents();\n \n //WORKER CONTROLS\n initWorkerComponents();\n \n //URL COMPONENTS\n initURLMenuComponents();\n\n //BASE LAYOUT COMPONENTS\n initBaseLayout();\n }", "protected void initControl() {\n\t\t\r\n\t}", "private void init() {\n List<Contructor> list = servisContructor.getAllContructors();\n for (Contructor prod : list) {\n contructor.add(new ContructorViewer(prod));\n }\n\n Label label = new Label(\"Catalog Contructors\");\n label.setLayoutX(140);\n label.setLayoutY(20);\n label.setStyle(\"-fx-font-size:20px\");\n\n initTable();\n table.setLayoutX(120);\n table.setLayoutY(60);\n table.setStyle(\"-fx-font-size:16px\");\n\n GridPane control = new ControlPanel(this, 2).getPanel();\n control.setLayoutX(120);\n control.setLayoutY(300);\n\n panel.setAlignment(Pos.CENTER);\n panel.add(label, 0, 0);\n panel.add(table, 0, 1);\n panel.add(control, 0, 2);\n }", "public Libros() {\n initComponents();\n }", "public adivinaGUI() {\n initComponents();\n }", "private void initialize() {\n\t\tjLabel3 = new JLabel();\n\t\tjLabel = new JLabel();\n\t\tthis.setLayout(null);\n\t\tthis.setBounds(new java.awt.Rectangle(0, 0, 486, 377));\n\t\tjLabel.setText(PluginServices.getText(this,\n\t\t\t\t\"Areas_de_influencia._Introduccion_de_datos\") + \":\");\n\t\tjLabel.setBounds(5, 20, 343, 21);\n\t\tjLabel3.setText(PluginServices.getText(this, \"Cobertura_de_entrada\")\n\t\t\t\t+ \":\");\n\t\tjLabel3.setBounds(6, 63, 190, 21);\n\t\tthis.add(jLabel, null);\n\t\tthis.add(jLabel3, null);\n\t\tthis.add(getLayersComboBox(), null);\n\t\tthis.add(getSelectedOnlyCheckBox(), null);\n\t\tthis.add(getMethodSelectionPanel(), null);\n\t\tthis.add(getResultSelectionPanel(), null);\n\t\tthis.add(getExtendedOptionsPanel(), null);\n\t\tconfButtonGroup();\n\t\tlayersComboBox.setSelectedIndex(0);\n\t\tinitSelectedItemsJCheckBox();\n\t\tdistanceBufferRadioButton.setSelected(true);\n\t\tlayerFieldsComboBox.setEnabled(false);\n\t\tverifyTypeBufferComboEnabled();\n\t}", "public BBDJPAAdminGUI() {\n initComponents();\n\n myInit();\n }", "public soal2GUI() {\n initComponents();\n }", "private void initialize() {\n\tif (setup == false) {\n\t elementList.add(new GUISlider());\n\t elementList.add(new GUIChart());\n\t elementList.add(new GUIStatsDisplay());\n\t elementList.add(new GUIPID());\n\t elementList.add(new GUITimer());\n\t elementList.add(new GUINumericUpDown());\n\t setup = true;\n\t}\n }", "public Gui() { \n preInitComponents(); \n initComponents();\n postInitComponents(); \n setVisible(true);\n appInitialization();\n }", "public AplicationGUI() {\n initComponents();\n }", "public ViewInit() {\n initComponents();\n }", "private void initialize() {\r\n\t\tthis.setLayout(new BorderLayout());\r\n\t\tthis.setBounds(new Rectangle(0, 0, 393, 177));\r\n\t\tthis.add(getBasePanel(), BorderLayout.CENTER);\r\n\r\n\t}", "public EjemplarUI() {\n initComponents();\n controlador = Controladores.peliculaController;\n }", "private void initialize()\n {\n this.setTitle( \"SerialComm\" ); // Generated\n this.setSize( 500, 300 );\n this.setContentPane( getJContentPane() );\n }", "protected void initializeGUI() {\n\n\t}", "private void initMyComponents() {\n this.jPanel1.setLayout(new BoxLayout(this.jPanel1, BoxLayout.Y_AXIS));\n this.jPanel1.add(controller.getPressureController().getEMeasureBasicView());\n this.jPanel1.add(controller.getTemperatureController().getEMeasureBasicView());\n this.controller.getPressureController().getListeners().add(this);\n this.controller.getTemperatureController().getListeners().add(this);\n this.jComboBox1.setModel(new DefaultComboBoxModel(FluidKind.values()));\n this.changeResponce();\n }", "protected void initializeComponents() {\n\t\t/* Create fonts for information nodes */\n\t\tFont titleFont = Font.font(\"Arial\", FontWeight.BOLD, 18);\n\t\tFont descriptionFont = Font.font(\"Arial\", 14);\n\t\t/* Configure information nodes */\n\t\tconfigureTitle(titleFont);\n\t\tconfigureDescription(descriptionFont);\n\t\tconfigureIconContainer();\n\t\tconfigureWindow();\n\t\t/* set scene */\n\n\t\tgetContent().add(notificationContainer);\n\t}", "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 }", "@Override\n public final void init() {\n super.init();\n UIUtils.clearAllFields(upperPane);\n changeStatus(Status.NONE);\n intCombo();\n }", "public MainView() {\n initComponents();\n \n }", "private void initialize() {\n\t\tthis.setLayout(null);\n\t\tthis.setBackground(Color.white);\n\t\tthis.setBounds(new Rectangle(0, 0, 943, 615));\n this.setPreferredSize(new Dimension(890,570));\n this.setMinimumSize(new Dimension(890,570));\n\n\t\tm_GraphControlGradient = new GraphControl();\n\t\tm_GraphControlGradient.setBounds(new Rectangle(4, 16, 461, 285));\n\t\tm_GraphControlGradient.setControlsEnabled(false);\n\n\t\tm_GraphControlFlowRate = new GraphControl();\n\t\tm_GraphControlFlowRate.setBounds(new Rectangle(3, 16, 462, 241));\n\t\tm_GraphControlFlowRate.setControlsEnabled(false);\n\n\t\tthis.add(getJbtnPreviousStep(), null);\n\t\tthis.add(getJpanelGradientProfile(), null);\n\t\tthis.add(getJpanelFlowProfile(), null);\n\t\tthis.setVisible(true);\n\t\tthis.add(getJbtnHelp(), null);\n\t\tthis.add(getJpanelStep5(), null);\n\t\t\n\t\tthis.tmOutputModel.addTableModelListener(this);\n\t\tthis.addComponentListener(this);\n\t}", "public orgGui() {\n initComponents();\n }", "public void initialize() {\n\t\ttoolBar.setDrawingPanel(this.drawingPanel);\r\n\t\t//component initialize\r\n\t\tmenuBar.initialize();\r\n\t\ttoolBar.initialize();\r\n\t\tdrawingPanel.initialize();\r\n\t\t\r\n\t}", "private void initialize() {\r\n this.setSize(new Dimension(374, 288));\r\n this.setContentPane(getJPanel());\r\n this.setResizable(false);\r\n this.setModal(true);\r\n this.setTitle(\"颜色选择面板\");\r\n addJPanel();\r\n\t}", "private void initialize() {\n\t\tthis.setSize(329, 270);\n\t\tthis.setContentPane(getJContentPane());\n\t}", "private void init() {\n initView();\n setListener();\n }", "private void initialize() {\r\n\t\tthis.setBounds(new Rectangle(0, 0, 670, 576));\r\n\t\tthis.setResizable(false);\r\n\t\tthis.setTitle(\"数据入库 \");\r\n\t\tthis.setLocationRelativeTo(getOwner());\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t}", "private void initUI() {\n\t\tStage stage = Stage.createStage();\n\n\t\tControl formPanel = buildFormTestTab();\n\n\t\tControl cellPanel = buildCellTestTab();\n\t\t\n\t\tTabPanel tabbedPane = new TabPanel();\n\t\ttabbedPane.add(\"Form Test\", formPanel);\n\t\ttabbedPane.add(\"Cell Layout Test\", cellPanel);\n\n\t\tstage.setContent(tabbedPane);\n\t}", "public DeviceSelectionComponentBase() {\n initComponents();\n }", "public TetrisGUI() {\r\n initializeFields();\r\n }", "private void initComponents() {\n LOOGER.info(\"Get init components\");\n this.loadButton = new JButton(\"Load\");\n this.fillButton = new JButton(\"Fill\");\n this.deleteButton = new JButton(\"Delete\");\n this.setLayout(new FlowLayout());\n LOOGER.info(\"components exit\");\n }", "private void initComponents() {\n rootLayout = new Grid();\n rootLayout.setWidth(new Extent(100, Extent.PERCENT));\n rootLayout.setSize(2);\n add(rootLayout);\n Empsn_Label= new nextapp.echo2.app.Label();\n Empsn_Label.setText(\"N_TIME_BEAR.EMPSN\");\n rootLayout.add(Empsn_Label);\n \n Empsn_DscField = new dsc.echo2app.component.DscField();\n Empsn_DscField.setId(\"Empsn_DscField\");\n Empsn_DscField.setWidth(new Extent(4, Extent.CM));\n rootLayout.add(Empsn_DscField);\n \n\t}", "public Analizer() {\n initComponents();\n }", "public Kuis2() {\n initComponents();\n }", "private void initialize() {\r\n this.setSize(new Dimension(800,600));\r\n this.setContentPane(getJPanel());\r\n\r\n List<String> title = new ArrayList<String>();\r\n title.add(\"Select\");\r\n title.add(\"Field Id\");\r\n title.add(\"Field Name\");\r\n title.add(\"Field Type\");\r\n title.add(\"Image\");\r\n\r\n List<JComponent> componentList = new ArrayList<JComponent>();\r\n componentList.add(checkInit);\r\n componentList.add(fieldIdInit);\r\n componentList.add(filedNameInit);\r\n componentList.add(fieldTypeInit);\r\n componentList.add(imageButton);\r\n\r\n String []arrColumn = {\"SELECT\", \"FIELD_ID\", \"FIELD_NAME\", \"FIELD_TYPE\", \"FIELD_VALUE\"};\r\n String []arrTitle = {\"SELECT\", \"FIELD_ID\", \"FIELD_NAME\", \"FIELD_TYPE\", \"FIELD_VALUE\"};\r\n // init grid\r\n grid = new GridUtils(pageSheet, title, componentList, arrColumn, preButton, afterButton, 5, arrTitle);\r\n // set title\r\n grid.setPageInfo(pageInfoLbl);\r\n \r\n searchDetailList();\r\n \r\n initComboBox();\r\n \r\n setTitle(\"Page Select page\");\r\n\t}", "public Avontool() {\n initComponents();\n }", "public void init() {\n setLayout(new BorderLayout());\n }", "public MainUI() {\r\n initComponents();\r\n this.setLocationRelativeTo(null);\r\n /**/\r\n }", "public VComponente() {\n initComponents();\n }", "@Override\n\tpublic void initGui() {\n\t\tfield_154330_a.init();\n\t\tsuper.initGui();\n\t}", "public MainView() {\n initComponents();\n }", "public MainView() {\n initComponents();\n }", "public DesktopGUI() {\n initComponents();\n }", "public UICadMovel() {\n initComponents();\n }" ]
[ "0.8051734", "0.80307454", "0.79322994", "0.7798693", "0.776069", "0.7695912", "0.768819", "0.76034015", "0.75913465", "0.75913465", "0.7584113", "0.75382036", "0.7505128", "0.7486792", "0.74551654", "0.7448896", "0.7442558", "0.7436078", "0.74053717", "0.7397952", "0.7389507", "0.73702854", "0.73424983", "0.73402625", "0.7325233", "0.73232985", "0.73232985", "0.7277827", "0.7257669", "0.72555643", "0.72472155", "0.7245871", "0.7217482", "0.7217482", "0.7216718", "0.72132105", "0.72088903", "0.7202894", "0.7198522", "0.71911085", "0.7190863", "0.718951", "0.7179652", "0.7177431", "0.71719104", "0.71714497", "0.71664715", "0.7151662", "0.71366054", "0.71240276", "0.70991945", "0.7087636", "0.7087285", "0.70841855", "0.707914", "0.7071662", "0.7068191", "0.70678383", "0.7065401", "0.7061917", "0.7061519", "0.7050565", "0.7041899", "0.7037299", "0.7016616", "0.70121694", "0.7011781", "0.70113105", "0.7006498", "0.70052576", "0.6998825", "0.6996609", "0.6994174", "0.6985333", "0.6984554", "0.69819504", "0.6980509", "0.6976962", "0.69757557", "0.6975152", "0.6965947", "0.69610065", "0.69582695", "0.6956844", "0.6952998", "0.6951134", "0.6944468", "0.69429326", "0.69427806", "0.69392866", "0.6939059", "0.69355863", "0.69323343", "0.69213504", "0.69170684", "0.6916723", "0.6908987", "0.6905225", "0.6905225", "0.6899647", "0.68958056" ]
0.0
-1
Whether or not new bots are allowed to spawn. Initializes necessary data and recursively sets up a bot repository for the AdaptiveClassLoader to load from. Also sets the spawn delay between bots to a low value if the bots are being spawned locally.
BotQueue( ThreadGroup group, BotAction botAction ) { super( group, "BotQueue" ); repository = new Vector<File>(); m_group = group; m_lastSpawnTime = 0; m_botAction = botAction; directory = new File( m_botAction.getCoreData().getGeneralSettings().getString( "Core Location" )); int delay = m_botAction.getGeneralSettings().getInt( "SpawnDelay" ); if( delay == 0 ) SPAWN_DELAY = 20000; else SPAWN_DELAY = delay; if ( m_botAction.getGeneralSettings().getString( "Server" ).equals("localhost") || m_botAction.getGeneralSettings().getString( "Server" ).equals("127.0.0.1")) SPAWN_DELAY = 100; resetRepository(); m_botTypes = Collections.synchronizedMap( new HashMap<String, Integer>() ); m_botStable = Collections.synchronizedMap( new HashMap<String, ChildBot>() ); m_spawnQueue = Collections.synchronizedList( new LinkedList<ChildBot>() ); m_botTypes.put( "hubbot", new Integer( 1 )); if( repository.size() == 0 ) { Tools.printLog( "There are no bots to load. Did you set the Core Location parameter in setup.cfg improperly?" ); } else { System.out.println( "Looking through " + directory.getAbsolutePath() + " for bots. " + (repository.size() - 1) + " child directories." ); System.out.println(); System.out.println("=== Loading bots ... ==="); } m_loader = new AdaptiveClassLoader( repository, getClass().getClassLoader() ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void spawnBot( String className, String login, String password, String messager ) {\n CoreData cdata = m_botAction.getCoreData();\n long currentTime;\n\n String rawClassName = className.toLowerCase();\n BotSettings botInfo = cdata.getBotConfig( rawClassName );\n\n if( botInfo == null ) {\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" tried to spawn bot of type \" + className + \". Invalid bot type or missing CFG file.\" );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader tried to spawn bot of type \" + className + \". Invalid bot type or missing CFG file.\" );\n\n m_botAction.sendSmartPrivateMessage( messager, \"That bot type does not exist, or the CFG file for it is missing.\" );\n return;\n }\n\n Integer maxBots = botInfo.getInteger( \"Max Bots\" );\n Integer currentBotCount = m_botTypes.get( rawClassName );\n\n if( maxBots == null ) {\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" tried to spawn bot of type \" + className + \". Invalid settings file. (MaxBots improperly defined)\" );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader tried to spawn bot of type \" + className + \". Invalid settings file. (MaxBots improperly defined)\" );\n\n m_botAction.sendSmartPrivateMessage( messager, \"The CFG file for that bot type is invalid. (MaxBots improperly defined)\" );\n return;\n }\n\n if( login == null && maxBots.intValue() == 0 ) {\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" tried to spawn bot of type \" + className + \". Spawning for this type is disabled on this hub.\" );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader tried to spawn bot of type \" + className + \". Spawning for this type is disabled on this hub.\" );\n\n m_botAction.sendSmartPrivateMessage( messager, \"Bots of this type are currently disabled on this hub. If you are running another hub, please try from it instead.\" );\n return;\n }\n\n if( currentBotCount == null ) {\n currentBotCount = new Integer( 0 );\n m_botTypes.put( rawClassName, currentBotCount );\n }\n\n if( login == null && currentBotCount.intValue() >= maxBots.intValue() ) {\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" tried to spawn a new bot of type \" + className + \". Maximum number already reached (\" + maxBots + \")\" );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader tried to spawn a new bot of type \" + className + \". Maximum number already reached (\" + maxBots + \")\" );\n\n m_botAction.sendSmartPrivateMessage( messager, \"Maximum number of bots of this type (\" + maxBots + \") has been reached.\" );\n return;\n }\n\n String botName, botPassword;\n currentBotCount = new Integer( getFreeBotNumber( botInfo ) );\n\n if( login == null || password == null ) {\n botName = botInfo.getString( \"Name\" + currentBotCount );\n botPassword = botInfo.getString( \"Password\" + currentBotCount );\n } else {\n botName = login;\n botPassword = password;\n }\n\n Session childBot = null;\n\n try {\n // FIXME: KNOWN BUG - sometimes, even when it detects that a class is updated, the loader\n // will load the old copy/cached class. Perhaps Java itself is caching the class on occasion?\n if( m_loader.shouldReload() ) {\n System.out.println( \"Reinstantiating class loader; cached classes are not up to date.\" );\n resetRepository();\n m_loader = m_loader.reinstantiate();\n }\n\n Class<? extends SubspaceBot> roboClass = m_loader.loadClass( \"twcore.bots.\" + rawClassName + \".\" + rawClassName ).asSubclass(SubspaceBot.class);\n String altIP = botInfo.getString(\"AltIP\" + currentBotCount);\n int altPort = botInfo.getInt(\"AltPort\" + currentBotCount);\n String altSysop = botInfo.getString(\"AltSysop\" + currentBotCount);\n\n if(altIP != null && altSysop != null && altPort > 0)\n childBot = new Session( cdata, roboClass, botName, botPassword, currentBotCount.intValue(), m_group, altIP, altPort, altSysop, true);\n else\n childBot = new Session( cdata, roboClass, botName, botPassword, currentBotCount.intValue(), m_group, true);\n } catch( ClassNotFoundException cnfe ) {\n Tools.printLog( \"Class not found: \" + rawClassName + \".class. Reinstall this bot?\" );\n return;\n }\n\n currentTime = System.currentTimeMillis();\n\n if( m_lastSpawnTime + SPAWN_DELAY > currentTime ) {\n m_botAction.sendSmartPrivateMessage( messager, \"Subspace only allows a certain amount of logins in a short time frame. Please be patient while your bot waits to be spawned.\" );\n\n if( m_spawnQueue.isEmpty() == false ) {\n int size = m_spawnQueue.size();\n\n if( size > 1 ) {\n m_botAction.sendSmartPrivateMessage( messager, \"There are currently \" + m_spawnQueue.size() + \" bots in front of yours.\" );\n } else {\n m_botAction.sendSmartPrivateMessage( messager, \"There is only one bot in front of yours.\" );\n }\n } else {\n m_botAction.sendSmartPrivateMessage( messager, \"You are the only person waiting in line. Your bot will log in shortly.\" );\n }\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" in queue to spawn bot of type \" + className );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader in queue to spawn bot of type \" + className );\n }\n\n String creator;\n\n if(messager != null) creator = messager;\n else creator = \"AutoLoader\";\n\n ChildBot newChildBot = new ChildBot( rawClassName, creator, childBot );\n addToBotCount( rawClassName, 1 );\n m_botStable.put( botName, newChildBot );\n m_spawnQueue.add( newChildBot );\n }", "public void spawnRobots() {\n\t\tString robotName\t= \"\";\n\t\tPlayer newPlayer\t= null;\n\t\tint numberOfRobots \t= 0;\n\t\tint robotsPerPlayer = server.getRobotsPerPlayer();\n\t\tint numberOfPlayers = server.getPlayerCount();\n\t\tint robotsPerLevel\t= server.getRobotsPerLevel();\n\t\t\n\t\t// calculate how many robots that should be spawned\n\t\trobotsPerPlayer = robotsPerPlayer *\n\t\t\t\t\t\t (robotsPerLevel * \n\t\t\t\t\t\t currentLevel);\n\t\t\n\t\tnumberOfRobots \t= robotsPerPlayer *\n\t\t\t\t\t\t numberOfPlayers;\n\t\t\n\t\tfor(int i = 0; i < numberOfRobots; i++) {\n\t\t\trobotName \t\t\t= \"Robot\" + (i+1);\n\t\t\tnewPlayer = initPlayerToGameplane(robotName, \n\t\t\t\t\t\t\t\t \t\t\t PlayerType.Robot, \n\t\t\t\t\t\t\t\t \t\t\t 0, 0);\n\t\t\t\n\t\t\tHandleCommunication.broadcastToClient(null, \n\t\t\t\t\t\t\t\t\t\t\t\t server.getConnectedClientList(), \n\t\t\t\t\t\t\t\t\t\t\t\t SendSetting.AddPlayer, \n\t\t\t\t\t\t\t\t\t\t\t\t newPlayer, \n\t\t\t\t\t\t\t\t\t\t\t\t null);\n\t\t}\n\t}", "@SuppressWarnings(\"unused\")\n public void run() {\n Iterator<String> i;\n String key;\n Session bot;\n ChildBot childBot;\n long currentTime = 0;\n long lastStateDetection = 0;\n int SQLStatusTime = 0;\n final int DETECTION_TIME = 5000;\n\n while( m_botAction.getBotState() != Session.NOT_RUNNING ) {\n if( SQLStatusTime == 2400 ) {\n SQLStatusTime = 0;\n m_botAction.getCoreData().getSQLManager().printStatusToLog();\n }\n\n try {\n currentTime = System.currentTimeMillis() + 1000;\n\n if( m_spawnQueue.isEmpty() == false ) {\n if( !m_spawnBots ) {\n childBot = m_spawnQueue.remove(0);\n\n if(childBot.getBot() != null) {\n m_botStable.remove( childBot.getBot().getBotName() );\n addToBotCount( childBot.getClassName(), (-1) );\n }\n\n if(childBot.getCreator() != null) {\n m_botAction.sendSmartPrivateMessage( childBot.getCreator(), \"Bot failed to log in. Spawning of new bots is currently disabled.\");\n }\n\n m_botAction.sendChatMessage( 1, \"Bot of type \" + childBot.getClassName() + \" failed to log in. Spawning of new bots is currently disabled.\");\n\n } else if( m_lastSpawnTime + SPAWN_DELAY < currentTime ) {\n childBot = m_spawnQueue.remove( 0 );\n bot = childBot.getBot();\n\n bot.start();\n\n while( bot.getBotState() == Session.STARTING ) {\n Thread.sleep( 5 );\n }\n\n if( bot.getBotState() == Session.NOT_RUNNING ) {\n removeBot( bot.getBotName(), \"log in failure; possible bad login/password\" );\n m_botAction.sendSmartPrivateMessage( childBot.getCreator(), \"Bot failed to log in. Verify login and password are correct.\" );\n m_botAction.sendChatMessage( 1, \"Bot of type \" + childBot.getClassName() + \" failed to log in. Verify login and password are correct.\" );\n } else {\n if(childBot.getCreator() != null) {\n m_botAction.sendSmartPrivateMessage( childBot.getCreator(), \"Your new bot is named \" + bot.getBotName() + \".\" );\n m_botAction.sendChatMessage( 1, childBot.getCreator() + \" spawned \" + childBot.getBot().getBotName() + \" of type \" + childBot.getClassName() );\n } else\n m_botAction.sendChatMessage( 1, \"AutoLoader spawned \" + childBot.getBot().getBotName() + \" of type \" + childBot.getClassName() );\n }\n\n m_lastSpawnTime = currentTime;\n }\n }\n\n // Removes bots that are no longer running.\n if( lastStateDetection + DETECTION_TIME < currentTime ) {\n for( i = m_botStable.keySet().iterator(); i.hasNext(); ) {\n key = i.next();\n childBot = m_botStable.get( key );\n\n if( childBot.getBot().getBotState() == Session.NOT_RUNNING && key != null) {\n String removalStatus = removeBot( key );\n\n if( key == null )\n m_botAction.sendChatMessage( 1, \"NOTICE: Unknown (null) bot disconnected without being properly released from stable.\" );\n else\n m_botAction.sendChatMessage( 1, key + \"(\" + childBot.getClassName() + \") \" + removalStatus + \".\" );\n\n childBot = null;\n }\n }\n\n lastStateDetection = currentTime;\n }\n\n SQLStatusTime++;\n Thread.sleep( 1000 );\n } catch( ConcurrentModificationException e ) {\n //m_botAction.sendChatMessage( 1, \"Concurrent modification. No state detection done this time\" );\n } catch( Exception e ) {\n Tools.printStackTrace( e );\n }\n }\n }", "public boolean allowBotSpawn(boolean allowSpawning) {\n if(m_spawnBots == allowSpawning) {\n return false;\n }\n\n m_spawnBots = allowSpawning;\n return true;\n }", "void spawnBot( String className, String messager ) {\n spawnBot( className, null, null, messager);\n }", "private void initRobots() {\n\t\tthis.robots.clear();\n\t\tGraphRobot robot = new GraphRobot();\n\t\tString info = game.toString();\n\t\ttry {\n\t\t\tJSONObject line = new JSONObject(info);\n\t\t\tJSONObject ttt = line.getJSONObject(\"GameServer\");\n\t\t\tint rs = ttt.getInt(\"robots\");\n\t\t\tfor(int a = 0;a<rs;a++) {\n\t\t\t\tgame.addRobot(a);\n\t\t\t}\n\t\t}\n\t\tcatch (JSONException e) {e.printStackTrace();}\n\n\t\tList<String> r = game.getRobots();\n\t\tfor(String s : r) {\n\t\t\trobot.initRobot(s);\n\t\t\tthis.robots.add(robot);\n\t\t}\n\t}", "private void setBaseSpawns() {\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team0-X:148\");\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team0-Y:517\");\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team0-Radius:20\");\r\n\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team1-X:330\");\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team1-Y:517\");\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team1-Radius:20\");\r\n\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team2-X:694\");\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team2-Y:517\");\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team2-Radius:20\");\r\n\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team3-X:876\");\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team3-Y:517\");\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team3-Radius:20\");\r\n\r\n }", "public void load() {\n new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n loader = HijackLoader.create(Language.ENGLISH, true);\n callback.call();\n } catch (Exception e) {\n e.printStackTrace();\n log(Bot.class, Level.SEVERE, \"Error loading bot!\");\n }\n initialized = true;\n log(Bot.class, \"Bot now active.\");\n\n while ((canvas = getCanvas()) == null) {\n Utils.sleep(1);\n }\n\n canvas.setBot(Bot.this);\n Utils.sleep(3000);\n inputHandler = new InputHandler(bot, canvas);\n }\n }).start();\n\n thread = new Thread(new Runnable() {\n @Override\n public void run() {\n while (true) {\n if (!scriptStack.isEmpty()) {\n final Script script = scriptStack.peek();\n if (script != null) {\n final ScriptContext context = script.getContext();\n if (context.randomEvents != null) {\n context.randomEvents.check();\n }\n if (script.isExitRequested()) {\n context.getBot().popScript();\n break;\n }\n if (!script.isPaused()) {\n long time = System.currentTimeMillis();\n if (time >= script.getNextExecutionTime()) {\n int delay = script.pulse();\n if (delay < 0)\n context.getBot().popScript();\n script.setNextExecutionTime(time + delay);\n }\n }\n\n try {\n if (script.getNextExecutionTime() > 0) {\n long sleep = script.getNextExecutionTime() - System.currentTimeMillis();\n if (sleep > 0)\n Thread.sleep(script.getNextExecutionTime()\n - System.currentTimeMillis());\n } else {\n Thread.sleep(500);\n }\n } catch (InterruptedException e1) {\n // ignore the exception, because interrupting is normal\n }\n }\n } else {\n Utils.sleep(5000);\n }\n }\n\n }\n });\n thread.setName(\"Bot-\" + getBotIndex());\n thread.start();\n }", "public static void initializeBlocks() {\n if (Config.enableGiveADamn) {\n giveADamn = new GiveADamn();\n }\n\n if (Config.enableGlowstone) {\n glowstone = new HeavyLight();\n }\n\n if (Config.enableSpicedSand) {\n sandSpiced = new SpicedSand();\n }\n /*\n\n if (Config.enableMuffler){\n muffler = new Muffler();\n }\n */\n }", "private void initializeAgent() {\n if (Math.random() < PROBABILITY_START_WITH_AGENT) {\n agent = new SugarscapeAgent();\n }\n }", "abstract public void initSpawn();", "public GameManager(List<String> botNames){\n\t\tdeck = new Deck();\n\t\ttable = new Table();\n\t\tplayers = new ArrayList<Bot>();\n\t\t\n\t\t//create player objects via reflection\n\t\tfor (String botName : botNames){\n\t\t\ttry {\n\t\t\t\tplayers.add(newInstance(botName));\n\t\t\t} catch (ClassNotFoundException | NoSuchMethodException\t| InstantiationException | \n\t\t\t\t\tIllegalAccessException| IllegalArgumentException | InvocationTargetException e) {\n\t\t\t\t\t\tSystem.err.println(\"No such bot class found: \" + botName);\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}\n\t}", "public void gameInit() {\n lobbyRoom.sendPortToAll();\n lobbyRoom.sendPlayers(game.getCars());\n lobbyRoom.sendTrack(game.getTrack());\n lobbyRoom.sendPowerupManager(game.getManager());\n this.running = true;\n }", "@Override\n public void onEnable() {\n plugin = this;\n if(!getServer().getPluginManager().isPluginEnabled(\"BedWars1058\")){\n getLogger().severe(\"Unable to locate Bedwars1058.\");\n getLogger().severe(\"Plugin will be disabled!\");\n getServer().getPluginManager().disablePlugin(this);\n return;\n }else{\n bwAPI = Bukkit.getServicesManager().getRegistration(BedWars .class).getProvider();\n bedwarsEnabled = true;\n }\n if(!getServer().getPluginManager().isPluginEnabled(\"Citizens\")){\n getLogger().severe(\"Citizens is missing shopkeeper won't be used!\");\n getServer().getPluginManager().disablePlugin(this);\n return;\n }else{\n npcRegistry = CitizensAPI.getNPCRegistry();\n citizensEnabled = true;\n getLogger().info(\"Hooked with Citizens for shopkeeper\");\n }\n /*commandManager = new BukkitCommandManager(this);\n if(commandManager == null){\n getLogger().severe(\"Unable to intialize BukkitCommandManager.\");\n getLogger().severe(\"Plugin will be disabled!\");\n getServer().getPluginManager().disablePlugin(this);\n return;\n }*/\n fileUtils = new FileUtils();\n configuration = new Configuration();\n if(!configuration.createConfiguration(this)){\n getLogger().severe(\"Unable to create configuration file.\");\n getLogger().severe(\"Plugin will be disabled!\");\n getServer().getPluginManager().disablePlugin(this);\n return;\n }\n messages = new Messages();\n if(!messages.generateMessages()){\n getLogger().severe(\"Unable to create messages.yml file.\");\n getLogger().severe(\"Plugin will be disabled!\");\n getServer().getPluginManager().disablePlugin(this);\n return;\n }\n cacheManager = new CacheManager(this);\n if(!cacheManager.buildCache()){\n getLogger().severe(\"Unable to create cache file.\");\n getLogger().severe(\"Plugin will be disabled!\");\n getServer().getPluginManager().disablePlugin(this);\n return;\n }\n scheduler = new WorkloadScheduler();\n scheduler.intializeThread();\n storage = new Storage(this,getConfiguration().isUsingMysql());\n storage.build();\n storage.tryConnection();\n storage.createDatabase();\n randomUtility = new RandomUtility(this);\n cosmeticManager = new CosmeticManager();\n cosmeticManager.loadCosmetics();\n playerManager = new PlayerCosmeticsManager();\n registerListeners();\n cooldownTasks = new Cooldowns();\n cooldownTasks.runTaskTimerAsynchronously(this,100L,20L);\n registerCommands();\n getLogger().info(\"------------------------------------------------\");\n getLogger().info(\"Enabled Plugin\");\n getLogger().info(\"------------------------------------------------\");\n\n }", "private void startSpawning()\n {\n MAUtils.setSpawnFlags(plugin, world, 1, allowMonsters, allowAnimals);\n \n // Start the spawnThread.\n spawnThread = new MASpawnThread(plugin, this);\n spawnTaskId = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, spawnThread, waveDelay, (!waveClear) ? waveInterval : 60);\n }", "public static void startInternalBots(boolean visualize) {\n\t\tConfig config = new Config();\n\t\t\n\t\tconfig.bot1Init = \"internal:conquest.bot.BotStarter\";\n\t\tconfig.bot2Init = \"internal:conquest.bot.BotStarter\";\n\t\t\t\t\n\t\tconfig.visualize = visualize;\n\t\t\n\t\tconfig.replayLog = new File(\"./replay.log\");\n\t\t\n\t\tRunGame run = new RunGame(config);\n\t\tGameResult result = run.go();\n\t\t\n\t\tSystem.exit(0);\n\t}", "public void onLoad()\n {\n saveDefaultConfig();\n\n // Get the lobby name\n chatManager = new ChatManager(this);\n lobby = getConfig().getString(\"lobby\");\n\n // Loading up needed classes\n worldManager = new WorldManager(this);\n\n boolean backupsFound = false;\n\n File backupDir = new File(getDataFolder(), \"backups\");\n if (!backupDir.exists()) {\n getLogger().info(\"No backup directory found; creating one now.\");\n getLogger().info(\"Place world folders you want to reset from in '.../plugins/SkyblockWarriors/backups'\");\n backupDir.mkdirs();\n } else {\n for (File backup : backupDir.listFiles()) {\n if ((backup.isDirectory()) && (backup.listFiles().length != 0)) {\n backupsFound = true;\n }\n }\n\n if (backupsFound) {\n getLogger().info(\"Found backup folder, attempting to reset the world..\");\n // Resetting the world\n worldManager.resetWorld();\n } else {\n if (!getConfig().getBoolean(\"arena-setup\") == false) {\n getLogger().info(\"The plugin should be setup, please copy the world into the backup folder\");\n getLogger().info(\"so the plugin can reset the world on each restart!\");\n }\n }\n }\n }", "public static void startProcessBots(boolean visualize) {\n\t\tConfig config = new Config();\n\t\t\n\t\tconfig.bot1Init = \"process:java -cp bin conquest.bot.BotStarter\";\n\t\tconfig.bot2Init = \"dir;process:./bin;java conquest.bot.BotStarter\";\n\t\t\t\t\n\t\tconfig.visualize = visualize;\n\t\t\n\t\tconfig.replayLog = new File(\"./replay.log\");\n\t\t\n\t\tRunGame run = new RunGame(config);\n\t\tGameResult result = run.go();\n\t\t\n\t\tSystem.exit(0);\n\t}", "public void initiateRespawnBlindness() {\n this.respawnBlindnessEndTick = CommonUtil.getServerTicks() + 5;\n }", "private void configureWorlds(){\n switch (gameWorld){\n case NORMAL:\n world.setPVP(true);\n world.setKeepSpawnInMemory(false);\n world.setAutoSave(false);\n world.setStorm(false);\n world.setThundering(false);\n world.setAnimalSpawnLimit((int) (mobLimit * 0.45));\n world.setMonsterSpawnLimit((int) (mobLimit * 0.45));\n world.setWaterAnimalSpawnLimit((int) (mobLimit * 0.1));\n world.setDifficulty(Difficulty.HARD);\n break;\n case NETHER:\n world.setPVP(true);\n world.setAutoSave(false);\n world.setKeepSpawnInMemory(false);\n world.setStorm(false);\n world.setThundering(false);\n world.setMonsterSpawnLimit((int) (mobLimit * 0.45));\n world.setAnimalSpawnLimit((int) (mobLimit * 0.45));\n world.setWaterAnimalSpawnLimit((int) (mobLimit * 0.1));\n world.setDifficulty(Difficulty.HARD);\n break;\n }\n }", "private static void setupLocations() {\n\t\tcatanWorld = Bukkit.createWorld(new WorldCreator(\"catan\"));\n\t\tspawnWorld = Bukkit.createWorld(new WorldCreator(\"world\"));\n\t\tgameLobby = new Location(catanWorld, -84, 239, -647);\n\t\tgameSpawn = new Location(catanWorld, -83, 192, -643);\n\t\thubSpawn = new Location(spawnWorld, 8, 20, 8);\n\t\twaitingRoom = new Location(catanWorld, -159, 160, -344);\n\t}", "public void initDisableSpawn(String worldname) {\n\t\tspawnDisabledWorlds.add(worldname);\n\t}", "@Override\n\tpublic void onSpawn()\n\t{\n\t\tsetIsNoRndWalk(true);\n\t\tsuper.onSpawn();\n\n\t\t// check the region where this mob is, do not activate the AI if region is inactive.\n\t\tL2WorldRegion region = WorldManager.getInstance().getRegion(getX(), getY());\n\t\tif(region != null && !region.isActive())\n\t\t{\n\t\t\tgetAI().stopAITask();\n\t\t}\n\t}", "@Override\n public void onEnable() {\n spigotLogger = new SpigotLogger(\"Phantom\", ChatColor.WHITE, ChatColor.GRAY, LogLevel.DEBUG);\n\n // Load the configuration files.\n if (!setupConfigs(settingsConfig, messagesConfig)) {\n // If failed -> Stop enabling the plugin any further.\n spigotLogger.log(LogLevel.FATAL, \"Failed to load all config files.\");\n getServer().getPluginManager().disablePlugin(this);\n return;\n }\n\n // Set up all storage systems.\n if (!storageManager.setup()) {\n // If failed -> Stop enabling the plugin any further.\n spigotLogger.log(LogLevel.FATAL, \"Failed to set up storage systems.\");\n getServer().getPluginManager().disablePlugin(this);\n return;\n }\n\n // Load all (internal) modules.\n if (!moduleManager.loadAllModules()) {\n // If failed -> Stop enabling the plugin any further.\n spigotLogger.log(LogLevel.FATAL, \"Failed to load all internal modules.\");\n getServer().getPluginManager().disablePlugin(this);\n return;\n }\n\n // Now everything is loaded and we can start creating all prerequisites for the storage systems.\n // Of course we're running this async as they mostly involve IO operations.\n // Todo create server join states (OPEN, MAINTENANCE, BOOTING) for a minor update.\n Bukkit.getScheduler().runTaskAsynchronously(this, () -> {\n if (!storageManager.testSystems()) {\n // If failed -> Disable Phantom.\n }\n\n if (!storageManager.createPrerequisites()) {\n // If failed -> Disable Phantom.\n }\n });\n\n spigotLogger.log(LogLevel.SUCCESS, \"Enabled plugin.\");\n }", "@Override\n public void onEnable() {\n log.info(\"Loading players file\");\n try {\n players = this.load(PLAYERS_CONF_PATH);\n } catch (Exception e) {\n }\n if (players == null) {\n log.info(\"players == null, creating Map\");\n players = new HashMap<String, PlayerConfig>();\n }\n log.info(\"Enabling CanBadia Plugin\");\n\n PluginManager pm = this.getServer().getPluginManager();\n\n\n getCommand(\"trade\").setExecutor(tradeCommandExecutor);\n getCommand(\"god\").setExecutor(godCommandExecutor);\n getCommand(\"godsfullpower\").setExecutor(godCommandExecutor);\n getCommand(\"market\").setExecutor(marketCommandExecutor);\n getCommand(\"class\").setExecutor(godCommandExecutor);\n getCommand(\"wall\").setExecutor(wallCommandExecutor);\n\n\n /*Some other example listeners\n pm.registerEvent(Event.Type.PLAYER_MOVE, playerListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.BLOCK_PLACE, blockListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.ENTITY_DAMAGE, entityListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.BLOCK_BREAK, blockListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.ENTITY_EXPLODE, entityListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.BLOCK_BREAK, blockListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.CREATURE_SPAWN, spawnListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.ENTITY_EXPLODE, entityListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.BLOCK_BURN, blockListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.BLOCK_IGNITE, blockListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_JOIN, playerListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_INTERACT, playerListener, Event.Priority.Normal, this);\n */\n\n }", "@Override\n\tprotected void onInitialAgentsCreation() {\n\t\tSystem.out.println(\"Création drones\");\n\t\tDrone drone = null;\n\t\tDroneBuilder droneBuilder;\n\t\tfor (int i = 0; i < INITIAL_DRONE_COUNT; i++) {\n\t\t\tdrone = new Drone(this, getEnvironment().getRandom().nextInt(World.WIDTH), getEnvironment().getRandom().nextInt(World.HEIGHT));\n\t\t\tdroneBuilder = new DroneBuilder();\n\t\t\tdroneBuilder.setDrone(drone);\n\t\t\tdroneBuilder.buildBehaviorStates();\n\t\t\tdroneBuilder.buildAgentPhase();\n\t\t}\n\t}", "void initAgents() {\n Runtime rt = Runtime.instance();\n\n //Create a container to host the Default Agent\n Profile p = new ProfileImpl();\n p.setParameter(Profile.MAIN_HOST, \"localhost\");\n //p.setParameter(Profile.MAIN_PORT, \"10098\");\n p.setParameter(Profile.GUI, \"false\");\n ContainerController cc = rt.createMainContainer(p);\n\n HashMap<Integer, String> neighbors = new HashMap <Integer, String>();\n neighbors.put(1, \"2, 4, 3\");\n neighbors.put(2, \"1, 3\");\n neighbors.put(3, \"1, 2, 4\");\n neighbors.put(4, \"1, 3, 5\");\n neighbors.put(5, \"4\");\n\n//Create a container to host the Default Agent\n try {\n for (int i = 1; i <= MainController.numberOfAgents; i++) {\n AgentController agent = cc.createNewAgent(Integer.toString(i), \"ru.spbu.mas.DefaultAgent\",\n new Object[]{neighbors.get(i)});\n agent.start();\n }\n } catch (StaleProxyException e) {\n e.printStackTrace();\n }\n }", "public void robotInit() {\n RobotMap.init();\n initDashboardInput();\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n driveTrain = new DriveTrain();\n power = new Power();\n arm = new Arm();\n sensors = new Sensors();\n ballGrabberSubsystem = new BallGrabberSubsystem();\n winch = new Winch();\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n // OI must be constructed after subsystems. If the OI creates Commands\n //(which it very likely will), subsystems are not guaranteed to be\n // constructed yet. Thus, their requires() statements may grab null\n // pointers. Bad news. Don't move it.\n oi = new OI();\n\n // instantiate the command used for the autonomous period\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS\n\n arcadeDrive = new ArcadeDrive();\n\n readPreferences();\n }", "boolean spawningEnabled();", "private void prepare()\n {\n treespawn treespawn2 = new treespawn();\n addObject(treespawn2,30,486);\n\n hantu hantu = new hantu();\n addObject(hantu,779,359);\n \n hantu hantu2 = new hantu();\n addObject(hantu2,88,84);\n \n bergerak bergerak2 = new bergerak();\n addObject(bergerak2,745,423);\n\n bergerak bergerak3 = new bergerak();\n addObject(bergerak3,266,566);\n \n bergerak bergerak4 = new bergerak();\n addObject(bergerak4,564,566);\n\n hantu hantu3 = new hantu();\n addObject(hantu3,671,490);\n \n hantu hantu4 = new hantu();\n addObject(hantu4,371,499);\n\n bergerak bergerak = new bergerak();\n addObject(bergerak,150,148);\n\n lantai lantai = new lantai();\n addObject(lantai,561,577); \n addObject(lantai,419,579); \n\n player player = new player();\n addObject(player,882,498);\n\n lantai3 lantai3 = new lantai3();\n addObject(lantai3,120,148);\n\n flyinglantai flyinglantai = new flyinglantai();\n addObject(flyinglantai,292,148);\n\n treespawn treespawn = new treespawn();\n addObject(treespawn,30,291);\n\n lantai4 lantai4 = new lantai4();\n addObject(lantai4,235,536);\n \n lantai4 lantai42 = new lantai4();\n addObject(lantai42,275,508);\n \n lantai4 lantai43 = new lantai4();\n addObject(lantai43,323,480);\n \n lantai4 lantai44 = new lantai4();\n addObject(lantai44,369,454);\n\n lantai2 lantai2 = new lantai2();\n addObject(lantai2,680,424);\n\n \n lantai3 lantai32 = new lantai3();\n addObject(lantai32,938,146);\n \n lantai4 lantai45 = new lantai4();\n addObject(lantai45,21,370);\n\n lantai4 lantai46 = new lantai4();\n addObject(lantai46,210,180);\n \n lantai4 lantai47 = new lantai4();\n addObject(lantai47,257,201);\n \n lantai4 lantai48 = new lantai4();\n addObject(lantai48,302,229);\n \n lantai4 lantai49 = new lantai4();\n addObject(lantai49,354,255);\n \n lantai4 lantai410 = new lantai4();\n addObject(lantai410,402,281);\n \n lantai4 lantai411 = new lantai4();\n addObject(lantai411,444,302);\n \n lantai4 lantai412 = new lantai4();\n addObject(lantai412,491,334);\n \n lantai4 lantai413 = new lantai4();\n addObject(lantai413,546,364);\n \n lantai4 lantai414 = new lantai4();\n addObject(lantai414,582,397);\n \n doorlv3 doorlv3 = new doorlv3();\n addObject(doorlv3,910,45);\n\n \n }", "public void startGame(){\n\n AgentAddress coordinatorAddressPre = getAgentWithRole(\"investment_game\", \"tout_le_monde\", \"coordinator\");\n\n if (coordinatorAddressPre==null){\n Coordinator coordinator = new Coordinator();\n\n launchAgent(coordinator);\n\n pause(1000);\n }\n\n Set<Player> players = new HashSet<Player>();\n Player primaryPlayer = null;\n\n //now launch all human player avatar agents, each of them will be initialized as agent having a GUI frame\n Iterator<GameSpecification.PlayerSpecification> playerSpecs = gameSpecification.getPlayerSpecifications().iterator();\n\n int launchedHumanPlayers = 0;\n\n while (playerSpecs.hasNext()){\n GameSpecification.PlayerSpecification spec = playerSpecs.next();\n\n if (spec instanceof GameSpecification.HumanPlayerSpecification){\n\n HumanPlayerAvatar humanPlayerAvatar = new HumanPlayerAvatar(spec.getName());\n\n launchAgent(humanPlayerAvatar,true);\n\n players.add(humanPlayerAvatar);\n\n launchedHumanPlayers++;\n\n if (null == primaryPlayer){\n primaryPlayer=humanPlayerAvatar;\n }\n\n }\n }\n\n //launch computer player agents. If no human players have been launched, the first computer player will display a GUI frame.\n playerSpecs = gameSpecification.getPlayerSpecifications().iterator();\n\n boolean first = true;\n\n while (playerSpecs.hasNext()){\n GameSpecification.PlayerSpecification spec = playerSpecs.next();\n\n if (spec instanceof GameSpecification.ComputerPlayerSpecification){\n\n ChooseAmountStrategy chooseAmountStrategy = ((GameSpecification.ComputerPlayerSpecification) spec).getChooseAmountStrategy();\n\n SelectOpponentStrategy selectOpponentStrategy = ((GameSpecification.ComputerPlayerSpecification) spec).getSelectOpponentStrategy();\n \n ComputerPlayer computerPlayer = new ComputerPlayer(spec.getName(),spec.getPictureFileName(), chooseAmountStrategy, selectOpponentStrategy);\n\n chooseAmountStrategy.setPlayer(computerPlayer);\n\n selectOpponentStrategy.setPlayer(computerPlayer);\n\n launchAgent(computerPlayer, launchedHumanPlayers == 0 && first);\n\n players.add(computerPlayer);\n\n if (null == primaryPlayer){\n primaryPlayer=computerPlayer;\n }\n\n first = false;\n\n }\n }\n\n //request new game from coordinator\n AgentAddress coordinatorAddress;\n\n while((coordinatorAddress = getAgentWithRole(\"investment_game\",\"tout_le_monde\",\"coordinator\"))==null){\n pause(750);\n }\n\n String requestGameSpec = \"<new_game> <for> \"+gameSpecification.getPlayerSpecifications().size()+\" <players> <having> \"+gameSpecification.getRounds()+\" <rounds> <invite> 0 <computer_players>\";\n\n ActMessage reply = (ActMessage)sendMessageWithRoleAndWaitForReply(coordinatorAddress,new ActMessage(\"request_game\",requestGameSpec),\"jeromes_assistant\");\n\n if (reply.getAction().equals(\"game_initialized\")){\n\n final String gameId = reply.getContent();\n\n //let players join the game\n Iterator<Player> playerIterator = players.iterator();\n\n while (playerIterator.hasNext()){\n\n final Player player = playerIterator.next();\n final boolean isPrimaryPlayer = player.equals(primaryPlayer);\n\n new Thread(){\n @Override\n public void run() {\n player.joinGame(gameId,isPrimaryPlayer,player.getPicturePath());\n }\n }.start();\n\n }\n }else{\n //TODO throw Exception\n }\n\n }", "public void setSpawn(boolean spawn) {\r\n this.spawn = spawn;\r\n }", "@Override\n public void robotInit() {\n\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n drive = new Drive();\n pDP = new PDP();\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n // OI must be constructed after subsystems. If the OI creates Commands\n //(which it very likely will), subsystems are not guaranteed to be\n // constructed yet. Thus, their requires() statements may grab null\n // pointers. Bad news. Don't move it.\n oi = new OI();\n camera1 = CameraServer.getInstance().startAutomaticCapture(0);\n camera2 = CameraServer.getInstance().startAutomaticCapture(1);\n camera1.setConnectionStrategy(VideoSource.ConnectionStrategy.kKeepOpen);\n camera2.setConnectionStrategy(VideoSource.ConnectionStrategy.kKeepOpen);\n server = CameraServer.getInstance().getServer();\n flipped = true;\n server.setSource(camera1);\n vexGyro = new AnalogGyro(0);\n vexGyro.setSensitivity(.00175);\n //rightEncoder = new Encoder(0, 1, false);\n //leftEncoder = new Encoder(2, 3, true);\n // Add commands to Autonomous Sendable Chooser\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS\n\n chooser.setDefaultOption(\"Autonomous Command\", new AutonomousCommand());\n PixyCamBlock centerBlock = PixyCam2.GetCentermostBlock();\n if(centerBlock == null)\n {\n SmartDashboard.putString(\"target good? \", \"no, is null\");\n }\n else{\n String out = \"Center Block, X: \"+centerBlock.xCenter + \" Y: \"+centerBlock.yCenter;\n SmartDashboard.putString(\"center block data \", out);\n if (centerBlock.yCenter < 200){\n SmartDashboard.putString(\"target good?\", \"YES!!! ycenter less than 200\");\n }\n }\n \n \n\n\n \n \n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS\n SmartDashboard.putData(\"Auto mode\", chooser);\n SmartDashboard.putBoolean(\"isFlipped\", flipped);\n SmartDashboard.putNumber(\"right encoder\", drive.getRightEncoder());\n SmartDashboard.putNumber(\"left encoder\", drive.getLeftEncoder());\n }", "public void initialize() {\n\n\t\tif (sentryWeight <= 0)\n\t\t\tsentryWeight = 1.0;\n\t\tif (AttackRateSeconds > 30)\n\t\t\tAttackRateSeconds = 30.0;\n\n\t\tif (sentryHealth < 0)\n\t\t\tsentryHealth = 0;\n\n\t\tif (sentryRange < 1)\n\t\t\tsentryRange = 1;\n\t\tif (sentryRange > 100)\n\t\t\tsentryRange = 100;\n\n\t\tif (sentryWeight <= 0)\n\t\t\tsentryWeight = 1.0;\n\n\t\tif (RespawnDelaySeconds < -1)\n\t\t\tRespawnDelaySeconds = -1;\n\n\t\tif (Spawn == null)\n\t\t\tSpawn = myNPC.getBukkitEntity().getLocation();\n\n\n\t\t// defaultSpeed = myNPC.getNavigator().getSpeed();\n\n\t\t((CraftLivingEntity) myNPC.getBukkitEntity()).getHandle().setHealth(sentryHealth);\n\n\t\t_myDamamgers.clear();\n\n\t\tthis.sentryStatus = Status.isLOOKING;\n\t\tfaceForward();\n\n\t\tshootanim = new Packet18ArmAnimation( ((CraftEntity)myNPC.getBukkitEntity()).getHandle(),1);\n\t\thealanim = new Packet18ArmAnimation( ((CraftEntity)myNPC.getBukkitEntity()).getHandle(),6);\n\n\t\t//\tPacket derp = new net.minecraft.server.Packet15Place();\n\n\n\t\tmyNPC.getBukkitEntity().teleport(Spawn); //it should be there... but maybe not if the position was saved elsewhere.\n\n\t\t// plugin.getServer().broadcastMessage(\"NPC GUARDING!\");\n\n\t\tif (taskID == null) {\n\t\t\ttaskID = plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new SentryLogicRunnable(), 40, _logicTick);\n\t\t}\n\n\n\t}", "public void onEnable(){\n new File(getDataFolder().toString()).mkdir();\n playerFile = new File(getDataFolder().toString() + \"/playerList.txt\");\n commandFile = new File(getDataFolder().toString() + \"/commands.txt\");\n blockFile = new File(getDataFolder().toString() + \"/blockList.txt\");\n deathFile = new File(getDataFolder().toString() + \"/deathList.txt\");\n startupFile = new File(getDataFolder().toString() + \"/startupCommands.txt\");\n \n //Load the player file data\n playerCommandMap = new HashMap<String, String>();\n try{\n BufferedReader br = new BufferedReader(new FileReader(playerFile));\n StringTokenizer st;\n String input;\n String name;\n String command;\n while((input = br.readLine()) != null){\n if(input.compareToIgnoreCase(\"<Player> <Command>\") == 0){\n continue;\n }\n st = new StringTokenizer(input, \" \");\n name = st.nextToken();\n command = st.nextToken();\n playerCommandMap.put(name, command);\n }\n \n }catch(FileNotFoundException e){\n log.info(\"No original player command file, creating new one.\");\n }catch(IOException e){\n log.info(\"Error reading player command file\");\n }catch(Exception e){\n log.info(\"Incorrectly formatted player command file\");\n }\n \n //Load the block file data\n blockCommandMap = new HashMap<Location, String>();\n try{\n BufferedReader br = new BufferedReader(new FileReader(blockFile));\n StringTokenizer st;\n String input;\n String command;\n Location loc = null;\n \n while((input = br.readLine()) != null){\n if(input.compareToIgnoreCase(\"<Block Location> <Command>\") == 0){\n continue;\n }\n st = new StringTokenizer(input, \" \");\n loc = new Location(getServer().getWorld(UUID.fromString(st.nextToken())), Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken()));\n command = st.nextToken();\n blockCommandMap.put(loc, command);\n }\n \n }catch(FileNotFoundException e){\n log.info(\"No original block command file, creating new one.\");\n }catch(IOException e){\n log.info(\"Error reading block command file\");\n }catch(Exception e){\n log.info(\"Incorrectly formatted block command file\");\n }\n \n //Load the player death file data\n deathCommandMap = new HashMap<String, String>();\n try{\n BufferedReader br = new BufferedReader(new FileReader(deathFile));\n StringTokenizer st;\n String input;\n String name;\n String command;\n while((input = br.readLine()) != null){\n if(input.compareToIgnoreCase(\"<Player> <Command>\") == 0){\n continue;\n }\n st = new StringTokenizer(input, \" \");\n name = st.nextToken();\n command = st.nextToken();\n deathCommandMap.put(name, command);\n }\n \n }catch(FileNotFoundException e){\n log.info(\"No original player death command file, creating new one.\");\n }catch(IOException e){\n log.info(\"Error reading player death command file\");\n }catch(Exception e){\n log.info(\"Incorrectly formatted player death command file\");\n }\n \n //Load the start up data\n startupCommands = \"\";\n try{\n BufferedReader br = new BufferedReader(new FileReader(startupFile));\n String input;\n while((input = br.readLine()) != null){\n if(input.compareToIgnoreCase(\"<Command>\") == 0){\n continue;\n }\n startupCommands += \":\" + input;\n }\n \n }catch(FileNotFoundException e){\n log.info(\"No original start up command file, creating new one.\");\n }catch(IOException e){\n log.info(\"Error reading start up command file\");\n }catch(Exception e){\n log.info(\"Incorrectly formatted start up command file\");\n }\n \n //Load the command file data\n commandMap = new HashMap<String, String>();\n try{\n BufferedReader br = new BufferedReader(new FileReader(commandFile));\n StringTokenizer st;\n String input;\n String args;\n String name;\n \n //Assumes that the name is only one token long\n while((input = br.readLine()) != null){\n if(input.compareToIgnoreCase(\"<Identifing name> <Command>\") == 0){\n continue;\n }\n st = new StringTokenizer(input, \" \");\n name = st.nextToken();\n args = st.nextToken();\n while(st.hasMoreTokens()){\n args += \" \" + st.nextToken();\n }\n commandMap.put(name, args);\n }\n \n }catch(FileNotFoundException e){\n log.info(\"No original command file, creating new one.\");\n }catch(IOException e){\n log.info(\"Error reading command file\");\n }catch(Exception e){\n log.info(\"Incorrectly formatted command file\");\n }\n \n placeBlock = false;\n startupDone = false;\n blockCommand = \"\";\n playerPosMap = new HashMap<String, Location>();\n \n //Set up the listeners\n PluginManager pm = this.getServer().getPluginManager();\n pm.registerEvent(Event.Type.PLAYER_INTERACT_ENTITY, playerListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_INTERACT, playerListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_MOVE, playerListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_JOIN, playerListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_QUIT, playerListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.ENTITY_DEATH, entityListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.BLOCK_BREAK, blockListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLUGIN_ENABLE, serverListener, Event.Priority.Normal, this);\n \n log.info(\"Autorun Commands v2.3 is enabled\");\n }", "private void loadAlwaysChecks() {\n alwaysChecks.addEnabled(new FlyAllCheck(), new WorldPermissionCheck(true), new RegionPermissionCheck(true));\n // CrazyEnchants Check\n if (pluginLoading(\"CrazyEnchantments\") && pm.getPlugin(\"CrazyEnchantments\").getDescription().getVersion().startsWith(\"1.8\")) {\n alwaysChecks.addEnabled(new CrazyEnchantmentsCheck());\n }\n // AdvancedEnchantments Check\n if (pluginLoading(\"AdvancedEnchantments\")) {\n alwaysChecks.addEnabled(new AdvancedEnchantmentsCheck(pl));\n }\n // SaberFactions Check\n if (pluginLoading(\"Factions\") && pm.getPlugin(\"Factions\").getDescription().getAuthors().contains(\"Driftay\")) {\n alwaysChecks.addEnabled(new SaberFactionsCheck());\n }\n // FabledSkyblock Check\n if (pluginLoading(\"FabledSkyBlock\")) {\n alwaysChecks.addEnabled(new FabledSkyblockCheck());\n }\n\n /* DISABLE */\n // World/Region Checks\n alwaysChecks.addDisabled(new WorldPermissionCheck(false), new RegionPermissionCheck(false));\n // Combat Checks\n loadCombatChecks();\n // Nearby Checks\n if (pl.getConfManager().isNearbyCheck()) {\n alwaysChecks.addDisabled(pl.getConfManager().isNearbyCheckEnemies() ? new NearbyEnemyCheck(pl) : new NearbyCheck(pl));\n }\n // Height Limit Check\n if (pl.getConfManager().getHeightLimit() != -1) {\n alwaysChecks.addDisabled(new HeightLimitCheck());\n }\n }", "private void initialParameters()\n\t{\n\t\tasteroidList = new ArrayList<Asteroid>();\n\t\tfor(int i = 0 ; i < INITIAL_ASTEROIDS ; i++)\n\t\t\tasteroidList.add(new Asteroid(getRandomLocationX(), getRandomLocationY(), SCREEN_WIDTH, SCREEN_HEIGHT));\n\t\t\n\t\t//========== Game Status ===========\n\t\trunning \t= true;\n\t\tisWin \t\t= false;\n\t\tisGameOver \t= false;\n\t\t\n\t\t//========== Game Craft ===========\t\t\n\t\tcraft = new Craft(SCREEN_WIDTH/2, SCREEN_HEIGHT/2, SCREEN_WIDTH, SCREEN_HEIGHT);\n\t}", "public void initialize() {\n\t\tloadRaces();\n\t\tloadBets();\n\t\tgenerateRaces(NUMBER_RACES - races.size());\n\t\t\n\t\traces.stream().forEach(race -> {\n\t\t\texecutor.submit(new RaceWorker(race, this));\n\t\t});\n\t\t\n\t\tinitialized = true;\n\t}", "private void doSpawnProcess()\n\t{\n\t\t// spawn sometin\n\t\tthis.spawn();\n\t\t\n\t\t// record another spawned enemy\n\t\tspawnCurrent++;\n\t\t\n\t\t// if that wasn't the last Walker\n\t\tif(currentWave.getNumberOfWalkers() > 0)\n\t\t{\n\t\t\t// restart the spawn timer\n\t\t\tfloat delay = currentWave.getSpawnDelay();\n\t\t\tspawnTimer.start(delay);\n\t\t}\n\t\t// otherwise, we've spawned all our piggies in this wave\n\t\telse\n\t\t{\n\t\t\tprepareNextWave();\n\t\t}\n\t}", "public ConfigureRobot()\n {\n Scheduler.getInstance().removeAll(); //remove all running commands\n addSequential(new BrakeOpen(),2);\n addSequential(new WaitCommand(1));\n addSequential(new LiftToBottom(),3);\n }", "public static void load() {\n\n\t\ttry {\n\t\t\tnew Thread() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tObjectDef.loadConfig();\n\t\t\t\t\t\tObjectConstants.declare();\n\t\t\t\t\t\tMapLoading.load();\n\t\t\t\t\t\tRegion.sort();\n\t\t\t\t\t\tObjectManager.declare();\n\t\t\t\t\t\tGameDefinitionLoader.loadNpcSpawns();\n\t\t\t\t\t\tNpc.spawnBosses();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}.start();\n\n\t\t\tGlobalItemHandler.spawn();\n\t\t\tTriviaBot.start();\n\t\t\tAchievements.declare();\n\n\t\t\tGameDefinitionLoader.loadItemValues();\n\t\t\tGameDefinitionLoader.loadNpcDefinitions();\n\t\t\tGameDefinitionLoader.loadItemDefinitions();\n\t\t\tGameDefinitionLoader.loadEquipmentDefinitions();\n\t\t\tGameDefinitionLoader.loadShopDefinitions();\n\t\t\tGameDefinitionLoader.setRequirements();\n\t\t\tGameDefinitionLoader.loadWeaponDefinitions();\n\t\t\tGameDefinitionLoader.loadSpecialAttackDefinitions();\n\t\t\tGameDefinitionLoader.loadRangedStrengthDefinitions();\n\t\t\tGameDefinitionLoader.loadSpecialAttackDefinitions();\n\t\t\tGameDefinitionLoader.loadCombatSpellDefinitions();\n\t\t\tGameDefinitionLoader.loadRangedWeaponDefinitions();\n\t\t\tGameDefinitionLoader.loadNpcCombatDefinitions();\n\t\t\tGameDefinitionLoader.loadItemBonusDefinitions();\n\n\t\t\tNPCDrops.parseDrops().load();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void setupAgents() {\r\n try {\r\n setupJade();\r\n //createAgent(Bank.class, \"Bank\");\r\n createAgent(ProductionAgent.class, \"Res1\");\r\n createAgent(ProductionAgent.class, \"Res2\");\r\n createAgent(SocialAgent.class, \"Soc\");\r\n createAgent(ClientAgent.class, \"Client\");\r\n\r\n } catch (Exception e) {\r\n e.printStackTrace(System.err);\r\n }\r\n }", "void forceSpawn() throws SpawnException;", "public static void init() {\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n driveTrainmotor_leftFront = new Talon(1);\n LiveWindow.addActuator(\"DriveTrain\", \"motor_leftFront\", (Talon) driveTrainmotor_leftFront);\n \n driveTrainmotor_leftRear = new Talon(2);\n LiveWindow.addActuator(\"DriveTrain\", \"motor_leftRear\", (Talon) driveTrainmotor_leftRear);\n \n driveTrainmotor_rightFront = new Talon(3);\n LiveWindow.addActuator(\"DriveTrain\", \"motor_rightFront\", (Talon) driveTrainmotor_rightFront);\n \n driveTrainmotor_rightRear = new Talon(4);\n LiveWindow.addActuator(\"DriveTrain\", \"motor_rightRear\", (Talon) driveTrainmotor_rightRear);\n \n driveTrainRobotDrive = new RobotDrive(driveTrainmotor_leftFront, driveTrainmotor_leftRear,\n driveTrainmotor_rightFront, driveTrainmotor_rightRear);\n \n driveTrainRobotDrive.setSafetyEnabled(true);\n driveTrainRobotDrive.setExpiration(0.1);\n driveTrainRobotDrive.setSensitivity(0.5);\n driveTrainRobotDrive.setMaxOutput(1.0);\n\n liftmotor_Lift = new Talon(0);\n LiveWindow.addActuator(\"Lift\", \"motor_Lift\", (Talon) liftmotor_Lift);\n \n liftencoderLiftHeight = new Encoder(1, 2, true, EncodingType.k4X);\n LiveWindow.addSensor(\"Lift\", \"encoder LiftHeight\", liftencoderLiftHeight);\n liftencoderLiftHeight.setDistancePerPulse(1.0);\n liftencoderLiftHeight.setPIDSourceParameter(PIDSourceParameter.kRate);\n liftlimitBottom = new DigitalInput(0);\n LiveWindow.addSensor(\"Lift\", \"limitBottom\", liftlimitBottom);\n \n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n }", "private void initializeBadGuys() {\n\t\tplayer = new Player();\t\t\n\t\tfor (int i = 0; i < councilmen.length; i++) {\n\t\t\tcouncilmen[i] = new Councilman();\n\t\t}\n\t}", "private static void setSpawnerLogic(MobSpawnerBaseLogic logic, Random rand)\n\t{\n\t\tlogic.setEntityId(getRandomMonster(rand));\n\t\t\n\t\tNBTTagCompound nbt = new NBTTagCompound();\n\t\tlogic.writeToNBT(nbt);\n\t\t\n\t\tnbt.setShort(\"SpawnCount\", (short) 4);\n\t\tnbt.setShort(\"MinSpawnDelay\", (short) (20 * 10));\n\t\tnbt.setShort(\"MaxSpawnDelay\", (short) (20 * 30));\n\t\tnbt.setShort(\"MaxNearbyEntities\", (short) 6);\n\t\tnbt.setShort(\"SpawnRange\", (short) 10);\n\n\t\tlogic.readFromNBT(nbt);\n\t}", "@Override\n\tpublic void robotInit() {\n\t\tdrive = new Drive();\n\t\tintake = new Intake();\n\t\tshooter = new Shooter();\n\t\taimShooter = new AimShooter();\n\t\tvision = new Vision();\n\t\tintakeRoller = new IntakeRoller();\n\t\taManipulators = new AManipulators();\n\t\tshooterLock = new ShooterLock();\n\n\t\t// autochooser\n\t\t// autoChooser = new SendableChooser();\n\n\t\toi = new OI();\n\t\t// instantiate the command used for the autonomous period\n\t\tlowGearCommand = new LowGear();\n\n\t\t// auto chooser commands\n\t\t// autoChooser.addDefault(\"FarLeftAuto\", new FarLeftAuto());\n\t\t// autoChooser.addObject(\"MidLeftAuto\", new MidLeftAuto());\n\t\t// autoChooser.addObject(\"MidAuto\", new MidAuto());\n\t\t// autoChooser.addObject(\"MidRightAuto\", new MidRightAuto());\n\t\t// autoChooser.addObject(\"FarRightAuto\", new FarRightAuto());\n\t\t// autoChooser.addObject(\"Uber Auto\", new UberAuto());\n\t\t// autoChooser.addObject(\"Paper Weight\", new PaperWeightAuto());\n\t\t//\n\t\t// SmartDashboard.putData(\"Autonomous\", autoChooser);\n\n\t\t// autonomousCommand = (Command) autoChooser.getSelected();\n\t\tautonomousCommand = new FarLeftAuto();\n\t\t// autonomousCommand = new MidAuto();\n\t\t// CameraServer.getInstance().startAutomaticCapture(\"cam3\");\n\t\t// autonomousCommand = new FarLeftAuto\n\n\t\tpovUpTrigger.whenActive(new MoveActuatorsUp());\n\t\tpovDownTrigger.whenActive(new MoveActuatorsDown());\n\t}", "private void spawnStart() {\n\t\tswitch (gameType) {\n\t\t\n\t\t}\n\t\tspawnCloud(10,1,0,0); //spawns base cloud\n\t\tspawnCloud(rng(7,10),6,rng(1,2),rng(2,3)); //spawns first clouds\n\t\tspawnCloud(rng(9,12),6,rng(1,2),rng(2,3));\n\t\t//spawnCloud(10,6,16,0);\n\t}", "public static void main(String args[]) {\n File config = new File(\"files/config.txt\");\n\n try {\n JavaBot.FileReader = new BufferedReader(new FileReader(config));\n String line = null;\n line = JavaBot.FileReader.readLine();\n\n while (line != null) {\n final String[] array = line.split(\"=\");\n\n if (array.length == 2) {\n JavaBot.configNameArray.add(array[0].replaceAll(\"=\", \"\").trim());\n JavaBot.configArray.add(array[1].trim());\n }\n\n line = JavaBot.FileReader.readLine();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n JavaBot.getAllConfig();\n\n String[] channels = JavaBot.CHANNELS.split(SERVERS_SEPERATOR); \n String[] passwords = JavaBot.NICKSERV_PASSWORDS.split(SERVERS_SEPERATOR); \n String[] names = JavaBot.NAMES.split(SERVERS_SEPERATOR);\n\n /** TRIMMING VARIABLES */\n SERVERS_ARRAY = trimArray(SERVERS_ARRAY);\n channels = trimArray(channels);\n passwords = trimArray(passwords);\n names = trimArray(names);\n\n initPlugins();\n \n /** CLASSES onStart() */\n new onStart();\n\n /** PLUGINS onStart() */\n\n for (final javaBotPlugin plugin : plugins) {\n plugin.onStart();\n }\n\n for (int i = 0; i < SERVERS_ARRAY.length; i++) {\n JavaBot bot = new JavaBot();\n\n // setting of values respective to each instance of the bot\n bot.setServer(SERVERS_ARRAY[i]);\n bot.setBotName(names[i]);\n bot.setPassword(passwords[i]);\n bot.channels_array = channels[i].split(CHANNELS_SEPERATOR); // split up channels\n new Thread(bot).start();\n }\n }", "private void init() {\n healthCheckTimer.newTimeout(\n new TimerTask() {\n @Override\n public void run(Timeout timeout) throws Exception {\n if (!isStop) {\n List<BrpcChannel> newHealthyInstances = new ArrayList<BrpcChannel>();\n Iterator<BrpcChannel> iter = unhealthyInstances.iterator();\n while (iter.hasNext()) {\n BrpcChannel instance = iter.next();\n boolean isHealthy = isInstanceHealthy(instance.getIp(), instance.getPort());\n if (isHealthy) {\n newHealthyInstances.add(instance);\n }\n }\n\n List<BrpcChannel> newUnhealthyInstances = new ArrayList<BrpcChannel>();\n iter = healthyInstances.iterator();\n while (iter.hasNext()) {\n BrpcChannel instance = iter.next();\n boolean isHealthy = isInstanceHealthy(instance.getIp(), instance.getPort());\n if (!isHealthy) {\n newUnhealthyInstances.add(instance);\n }\n }\n\n healthyInstances.addAll(newHealthyInstances);\n unhealthyInstances.removeAll(newHealthyInstances);\n\n healthyInstances.removeAll(newUnhealthyInstances);\n unhealthyInstances.addAll(newUnhealthyInstances);\n notifyInvalidInstance(newUnhealthyInstances);\n\n healthCheckTimer.newTimeout(this,\n rpcClient.getRpcClientOptions().getHealthyCheckIntervalMillis(),\n TimeUnit.MILLISECONDS);\n }\n\n }\n },\n rpcClient.getRpcClientOptions().getHealthyCheckIntervalMillis(),\n TimeUnit.MILLISECONDS);\n }", "public void init() {\n\t\t\n\t\tdebugPrintln(\"Doing init.\");\n\t\t\n\t\t// can sanity check some things by requesting notification when nodes\n\t\t// are created/deleted/etc.\n\t\t// It does not notify when playBufs reach the end of a buffer, though.\n\t\t// Too bad, that. Would have to poll.\n\t\tsendMessage(\"/notify\", new Object[] { 1 });\n\n\t\t//start by cleaning up any detritus from previous runs on the same server:\n\t\tcleanup();\n\n\t\t//sclang creates the default group, not supercollider, so let's follow that convention.\n\t\tcreateGroup(1, 0);\n\n\t\t// create a mother group, under the default group (1),\n\t\t// which will contain all of the SCSoundControl objects.\n\t\t//this is where we would query if another node == _motherGroupID already exists.\n\t\t//if so, would need to choose an alternate groupID (e.g. += 10000)\n\t\tcreateGroup(_motherGroupID, 1);\n\t\t\n\t}", "private void init() {\n dominator = \"\";\n firstBlood = false;\n jLabel1.setIcon(new ImageIcon(getClass().getResource(\"/multiagent/resources/title.jpg\")));\n dialog = new ConfigurationDlg(this, true);\n setTitle(\"Game server\");\n agentList = new ArrayList<>();\n playerCount = 0;\n running = true;\n aborted = true;\n playersAgentsMap = new HashMap<>();\n iPlayerList = new HashMap<>();\n agentsOnSpawn = new String[][]{{\"random\", \"random\", \"random\"}, {\"random\", \"random\", \"random\"}, {\"random\", \"random\", \"random\"}};\n String selected = String.valueOf(dialog.getFieldDimension().getSelectedItem());\n String selected2 = String.valueOf(dialog.getTightnessField().getSelectedItem());\n playingField = new PlayingField(Integer.parseInt(dialog.getResourceField().getText()),\n Integer.parseInt(selected.substring(selected.indexOf(\"x\") + 1)),\n Integer.parseInt(selected2.substring(0, selected2.indexOf(\"%\"))),\n agentList,\n playerCount,\n Integer.parseInt(String.valueOf(dialog.getCountAgents().getSelectedItem())));\n setLocationRelativeTo(null);\n pack();\n }", "protected void initialize() {\n \tif ((deploy && Robot.intake.getHopperTracker() == Status.deployed) || \n \t\t\t(!deploy && Robot.intake.getHopperTracker() == Status.stowed)) {\n \t\t// Hopper is already in desired position, so do nothing\n \t\twaitForMovement = false;\n \t} else if (deploy && (Robot.intake.getIntakeTracker() != Status.deployed)) {\n \t\t// Can't deploy hopper if intake is not deployed (ie., if stowed or unknown or moving)\n \t\twaitForMovement = false;\n \t} else {\n \t\t// OK, we can move the hopper\n \t\twaitForMovement = true;\n \t\tRobot.intake.setHopperTracker(Status.unknown);\t// put in unknown state while hopper is moving\n \tif (deploy) Robot.intake.deployHopper();\n \telse { Robot.intake.stowHopper(); }\n \t}\n }", "private void spawnTrees() {\n int spawnNum = this.random.nextInt(10) + 20;\n if (this.treeTiles.size() >= 30) { // max 30 trees\n spawnNum = 0;\n }\n for (int i = 0; i < spawnNum; i++) {\n String tree = trees[this.random.nextInt(trees.length)];\n int y = this.random.nextInt(this.getMap().length);\n Tile spawnTile = this.getMapAt(this.random.nextInt(this.getMap()[y].length), y);\n Tile centerTile;\n if ((spawnTile != null) && this.inMap(spawnTile.getX()-2, spawnTile.getY()-1)) {\n centerTile = this.getMapAt(spawnTile.getX()-2, spawnTile.getY()-1);\n } else {\n centerTile = null;\n }\n if ((spawnTile != null) && (spawnTile instanceof GroundTile)\n && (centerTile != null) && (centerTile instanceof GroundTile)\n && (spawnTile.getContent() == null)) {\n ExtrinsicTree newTree = new ExtrinsicTree(tree);\n newTree.setStage(17);\n spawnTile.setContent(newTree);\n this.treeTiles.add(spawnTile);\n }\n }\n }", "public void setSpawns() {\n List<Tile> spawns = this.board.getSpawns();// get all the possible spawns from board\n List<Tile> usedSpawns = new ArrayList<Tile>();// empty list used to represent all the spawns that have been used so no playerPiece gets the same spawn\n for (PlayerPiece playerPiece : this.playerPieces) { // for each playerPiece\n boolean hasSpawn = false; // boolean to represent whether the playerPiece has a spawn and used to initiate and stop the following while loop.\n while (!hasSpawn) { // while hasSpawn is false.\n int random_int = (int) (Math.random() * spawns.size());// get random number with max number of the total possible tiles the pieces can spawn from\n Tile spawn = spawns.get(random_int); // get spawn from spawns list using the random int as an index\n if (!usedSpawns.contains(spawn)) {// if the spawn isn't in the usedSpawn list\n playerPiece.setLocation(spawn);// set the location of the playerPiece to the spawn\n usedSpawns.add(spawn);//add the spawn to usedSpawns\n hasSpawn = true; // set the variable to true so the while loop stops.\n }\n }\n }\n }", "public void initializeGame() {\n speed = 75;\n ticks = 0;\n ticksTubes = 0;\n best = null;\n score = 0;\n\n //Make a new pool of birds based on the parameters set in the species'\n //genomes\n birds.clear();\n for (final Species species : Pool.species)\n for (final Genome genome : species.genomes) {\n genome.generateNetwork();\n birds.add(new Bird(species, genome));\n }\n tubes.clear();\n }", "public void enemySpawn(String typeofEnemy) {\n if (spawnTimer == 0) {\n if (typeofEnemy.equals(\"bee\")) {\n outerloop:\n//label to later break when enemy is spawned\n for (int row = 3; row < 5; row++) {\n for (int column = 0; column < 8; column++) {\n if (canSpawn[row][column] == false) {\n handler.getGalagaState().entityManager.entities.add(new EnemyBee(x, y, 32, 32, handler, row, column));\n canSpawn[row][column] = true;\n spawnTimer = random.nextInt(60 * 7);\n break outerloop;\n } else continue;\n }\n }\n } else {//ENEMYOTHER\n outerloop:\n for (int row = 1; row < 3; row++) {\n for (int column = 0; column < 8; column++) {\n if (canSpawn[row][column] == false) {\n handler.getGalagaState().entityManager.entities.add(new EnemyOther(x, y, 32, 32, handler, row, column));\n canSpawn[row][column] = true;\n spawnTimer = random.nextInt(60 * 7);\n break outerloop;\n } else continue;\n }\n }\n\n }\n }\n else {\n spawnTimer--;\n }\n\n// int enemyType = random.nextInt(2);\n// spawnTimer--;\n// if (spawnTimer == 0) {\n// if (typeofEnemy.equals(\"bee\")) {\n// int row = random.nextInt(2) + 3, column = random.nextInt(8);\n// if (canSpawn[row][column] == false) {\n// handler.getGalagaState().entityManager.entities.add(new EnemyBee(x, y, 32, 32, handler, row, column));\n// canSpawn[row][column] = true;\n// } else {\n// return;\n// }\n// } else {\n// int row = random.nextInt(2) + 1, column = random.nextInt(8);\n// if (canSpawn[row][column] == false) {\n// handler.getGalagaState().entityManager.entities.add(new EnemyOther(x, y, 32, 32, handler, row, column));\n// canSpawn[row][column] = true;\n// }\n// }\n// }\n// else{\n// spawnTimer--;\n// }\n\n\n\n\n }", "public void main2() throws StaleProxyException, InterruptedException\n {\n try\n {\n AgentController Agent1=main1.createNewAgent(\"Agent1\",\"players.Agent1\",null);\n Agent1.start();\n AgentController Agent2=main1.createNewAgent(\"Agent2\",\"players.Agent2\",null);\n Agent2.start();\n AgentController Agent3=main1.createNewAgent(\"Agent3\",\"players.Agent3\",null);\n Agent3.start();\n AgentController Agent4=main1.createNewAgent(\"Agent4\",\"players.Agent4\",null);\n Agent4.start();\n AgentController Agent5=main1.createNewAgent(\"Agent5\",\"players.Agent5\",null);\n Agent5.start();\n AgentController Agent6=main1.createNewAgent(\"Agent6\",\"players.Agent6\",null);\n Agent6.start();\n AgentController Agent7=main1.createNewAgent(\"Agent7\",\"players.Agent7\",null);\n Agent7.start();\n AgentController Agent8=main1.createNewAgent(\"Agent8\",\"players.Agent8\",null);\n Agent8.start();\n AgentController Agent9=main1.createNewAgent(\"Agent9\",\"players.Agent9\",null);\n Agent9.start();\n AgentController Agent10=main1.createNewAgent(\"Agent10\",\"players.Agent10\",null);\n Agent10.start();\n AgentController Agent11=main1.createNewAgent(\"Agent11\",\"players.Agent11\",null);\n Agent11.start();\n AgentController Agent12=main1.createNewAgent(\"Agent12\",\"players.Agent12\",null);\n Agent12.start();\n AgentController Agent13=main1.createNewAgent(\"Agent13\",\"players.Agent13\",null);\n Agent13.start();\n AgentController Agent14=main1.createNewAgent(\"Agent14\",\"players.Agent14\",null);\n Agent14.start();\n AgentController Agent15=main1.createNewAgent(\"Agent15\",\"players.Agent15\",null);\n Agent15.start();\n AgentController Agent16=main1.createNewAgent(\"Agent16\",\"players.Agent16\",null);\n Agent16.start();\n AgentController Main=main1.createNewAgent(\"Main\",\"test.Main\",null);\n Main.start();\n }\n catch (StaleProxyException e)\n {\n e.printStackTrace();\n }\n\n display();\n display();\n display();\n display();\n //showResualt();\n }", "@Override\n protected void initialize() {\n desiredTime = System.currentTimeMillis() + (long) (seconds * 1000);\n Robot.driveTrain.configForTeleopMode();\n }", "private GameConfig() {\n\t\tgameLoopSleepMs = 200;\n\t}", "public static void init() {\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n\n frisbeeRollerFrisbeeRoller = new Talon(FRISBEE_ROLLER_CHANNEL);\n\n conveyorMotor = new Talon(CONV_MOTOR_CHANNEL);\n\n spatulaMotor = new Relay(SPATULA_MOTOR_CHANNEL);\n\n loadTalon = new Talon(LOADER_TALON);\n\n elevateTalon = new Talon(ELEVATE_TALON);\n\n try {\n driveTrainrearRightTalon = new CANJaguar(REAR_RIGHT_JAG_CHANNEL);\n\n driveTrainfrontRightTalon = new CANJaguar(FRONT_RIGHT_JAG_CHANNEL);\n\n driveTrainfrontLeftTalon = new CANJaguar(FRONT_LEFT_JAG_CHANNEL);\n\n driveTrainrearLeftTalon = new CANJaguar(REAR_LEFT_JAG_CHANNEL);\n\n shootershooterJag = new CANJaguar(SHOOTER_JAG_CHANNEL);\n } catch (CANTimeoutException ex) {\n ex.printStackTrace();\n }\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n }", "public Bot(int x, int y, int xMax, int yMax, int botSize, ArrayList<Bot> bots) {\n\t\tsens = new Sensors(x, y, xMax, yMax, botSize, bots);\n\t\tcloseBots = new ArrayList<Bot>();\n\t\ttickCount = (int) (Math.random() * 20);\n\t\tisActive = true;\n\t}", "private void startComponents(){\n\n if(isAllowed(sentinel)){\n SentinelComponent sentinelComponent = new SentinelComponent(getInstance());\n sentinelComponent.getCanonicalName();\n }\n\n if(isAllowed(\"fileserver\")){\n FileServer fileServer = new FileServer(getInstance());\n fileServer.getCanonicalName();\n }\n\n if(isAllowed(\"manager\")){\n ManagerComponent Manager = new ManagerComponent(getInstance());\n Manager.getCanonicalName();\n }\n\n// if(isAllowed(\"sdk\")){\n// SDK sdk = new SDK(getInstance());\n// sdk.getCanonicalName();\n// }\n\n if(isAllowed(\"centrum\")){\n CentrumComponent centrum1 = new CentrumComponent(getInstance(), null);\n centrum1.getCanonicalName();\n }\n\n }", "public Bot(int x, int y, int xMax, int yMax, int botSize, ArrayList<Bot> bots) {\n\t\t\n\t\t// init the vars\n\t\tthis.charge = -1.5D;\n\t\tthis.desiredDirection = Math.random() * 360.0;\t// random starting direction\n\t\tthis.seenBots = new ArrayList<Bot>();\n\t\tthis.closeBots = new ArrayList<Bot>();\n\t\tthis.seenCharges = new ArrayList<Object>();\n\t\tthis.LEDs = new ArrayList<LED>();\n\t\tthis.closestWhiteLED = null;\n\t\tthis.botConnectedTo = null;\n\t\tthis.tickCount = (int) (Math.random() * 20);\n\t\tthis.isActive = true;\n\t\t\n\t\t// create the sensors\n\t\tthis.sens = new Sensors(x, y, xMax, yMax, botSize, bots, desiredDirection, this);\n\t\t\n\t\t// add the LEDs\n\t\tLEDs.add(new LED(this, 45));\n\t\tLEDs.add(new LED(this, 90));\n\t\tLEDs.add(new LED(this, 135));\n\t\tLEDs.add(new LED(this, 180));\n\t\tLEDs.add(new LED(this, 225));\n\t\tLEDs.add(new LED(this, 270));\n\t\tLEDs.add(new LED(this, 315));\n\t\tLEDManager = new LEDManager(this.LEDs);\n\t\t\n\t}", "public void gameSetUp() {\n if (!running.get()) return;\n if (!setup.compareAndSet(true, false)) return;\n ArrayList<GodController> controllers = new ArrayList<GodController>();\n controllers.add(new ApolloController(this));\n controllers.add(new ArtemisController(this));\n controllers.add(new AthenaController(this));\n controllers.add(new AtlasController(this));\n controllers.add(new DemeterController(this));\n controllers.add(new HephaestusController(this));\n controllers.add(new HestiaController(this));\n controllers.add(new LimusController(this));\n controllers.add(new MedusaController(this));\n controllers.add(new MinotaurController(this));\n controllers.add(new PanController(this));\n controllers.add(new PrometheusController(this));\n controllers.add(new TritonController(this));\n controllers.add(new ZeusController(this));\n\n Deck deck = game.getDeck();\n\n for (GodController godController : controllers) {\n deck.addCard(godController.generateCard());\n }\n\n players = game.getPlayers();\n\n try {\n broadcastGameInfo(\"gameSetup\");\n broadcastMessage(\"Game started!\");\n broadcastMessage(\"Picking cards...\");\n pickCards();\n broadcastGameInfo(\"boardSetup\");\n chooseStartPlayer();\n placeWorkers();\n\n broadcastGameInfo(\"gameStart\");\n playGame();\n } catch (IOExceptionFromController e) {\n handleDisconnection(e.getController());\n }\n }", "private void waitForCommands() throws IOException, ClassNotFoundException, UnableToStartGameException\n\t{\n\t\tboolean gameBegins = false;\n\t\t\n\t\twhile(!gameBegins)\n\t\t{\n\t\t\tObject object = objectInputStream.readObject();\n\t\t\t\n\t\t\t//Hier Abfragen, ob der Server uns andre Anweisungen melden will (Kartenname, usw.)\n\t\t\t\n\t\t\t//Das Spiel soll beginnen\n\t\t\tif(object instanceof GameStarts)\n\t\t\t{\n\t\t\t\tobject = objectInputStream.readObject();\n\t\t\t\t//Model vom Server kriegen\n\t\t\t\tif(object instanceof Game)\n\t\t\t\t{\n\t\t\t\t\tgame = (Game) object;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new UnableToStartGameException(\"Konnte das Model nicht empfangen.\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tgameBegins = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tGameManager gameManager = new GameManager(socket, gameServer, playerId, game, objectInputStream);\n\t\t//Uebergang von vor dem Spiel ins Spiel\n\t\tnew Thread(gameManager).start();\n\t}", "protected void setup(){\n\n\t\tsuper.setup();\n\n\t\tfinal Object[] args = getArguments();\n\t\tif(args!=null && args[0]!=null && args[1]!=null){\n\t\t\tdeployAgent((Environment) args[0],(EntityType)args[1]);\n\t\t}else{\n\t\t\tSystem.err.println(\"Malfunction during parameter's loading of agent\"+ this.getClass().getName());\n System.exit(-1);\n }\n\t\t\n\t\t//############ PARAMS ##########\n\n\t\tthis.nbmodifsmin \t\t= 30;\t\t\t//nb modifs minimum pour renvoyer la carte\n\t\tthis.timeOut \t\t\t= 1000 * 4;\t\t//secondes pour timeout des messages (*1000 car il faut en ms)\n\t\tthis.sleepbetweenmove \t= 200;\t\t\t//in MS\n\t\tthis.nbmoverandom\t\t= 4;\t\t\t// nb random moves by default\n\t\t\n\t\t//#############################\n\t\t//setup graph\n\t\t//setupgraph();\n\t\tthis.graph = new SingleGraph(\"graphAgent\");\n\t\tinitMyGraph();\n\t\tthis.step = 0;\n\t\tthis.stepMap = new HashMap<String, Integer>();\n\t\tthis.path = new ArrayList<String>();\n\t\tthis.mailbox = new Messages(this);\n\t\tthis.lastMsg = null;\n\t\tthis.switchPath = true;\n\t\tthis.lastsender = null;\n\t\tthis.lastSentMap = new HashMap<String, Integer>(); //nbmodifs\n\t\tthis.remakepath = false; // changes to true if the map changed in a way that requires a new path\n\t\tthis.nbmoverandomoriginal = this.nbmoverandom;\n\t\t\n\t\tthis.toSendMap = new HashMap<String, Graph>(); //actual hashmap graph\n\t\t\n\t\tSystem.out.println(\"the agent \"+this.getLocalName()+ \" is started\");\n\t}", "public static void init() {\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n drivetrainSpeedController1 = new CANTalon(1);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 1\", (CANTalon) drivetrainSpeedController1);\n \n drivetrainSpeedController2 = new CANTalon(2);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController2);\n drivetrainSpeedController3 = new CANTalon(3);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController3);\n drivetrainSpeedController4 = new CANTalon(4);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController4);\n drivetrainSpeedController5 = new CANTalon(5);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController5);\n drivetrainSpeedController6 = new CANTalon(6);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController6);\n \n drivetrainRobotDrive21 = new RobotDrive(drivetrainSpeedController1, drivetrainSpeedController2, drivetrainSpeedController3, drivetrainSpeedController4, drivetrainSpeedController5, drivetrainSpeedController6);\n \n drivetrainRobotDrive21.setSafetyEnabled(true);\n drivetrainRobotDrive21.setExpiration(0.1);\n drivetrainRobotDrive21.setSensitivity(0.5);\n drivetrainRobotDrive21.setMaxOutput(1.0);\n\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n }", "protected void initialize() {\n\t\tRobot.firstAutonomousCommandDone = true;\n\t}", "public void robotInit() {\r\n CommandBase.init();\r\n OI.init();\r\n System.out.println(\"ROBOT READY!\");\r\n }", "public void spawnNew() {\n\t\tif (tier> 1) {\n\t\t\ttier--;\n\t\t\thealth = tier;\n\t\t\tdamage = tier;\n\t\t\tspeed = 5;\n\t\t\timg = getImage(updateImage(tier)); // converted getImage to protected b/c it wasn't accessible by Balloon class (child class)\n\t\t}\n\t\telse {\n\t\t\tisAlive = false;\n\t\t\tdeletePath();\t\t\t\n\t\t}\n\t}", "public void enemySpawner(){\n\t\tif (spawnFrame >= spawnTime){\n\t\t\tfor(int i =0;i<enemies.size();i++){\n\t\t\t\tif (!enemies.get(i).getInGame()){\n\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy);\n\t\t\t\t\tbreak;\n\t\t\t\t\t/*if (enemies.get(i).getNum()==1){\n\t\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (enemies.get(i).getNum()==2){\n\t\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy2);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (enemies.get(i).getNum()==3){\n\t\t\t\t\t\tenemies.get(i).spawnEnemy(Map.enemy3);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}*/\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tspawnFrame=0;\n\t\t} else{\n\t\t\tspawnFrame+=1;\n\t\t}\n\t}", "public void inicializarBotones() {\n\t\t\n\t\t// aņadimos listeners a los botones del panel 'login'\n\t\tthis.controladorLogin = new ControladorLogin(vista, modelo);\n\t\tthis.controladorLogin.addListeners();\n\t\t\n\t\t// aņadimos listeners a los botones del panel 'registro'\n\t\tthis.controladorRegistro = new ControladorRegistro(vista, modelo);\n\t\tthis.controladorRegistro.addListeners();\n\t\t\n\t\t// aņadimos listeners a los botones del panel 'bienvenida'\n\t\tthis.controladorBienvenida = new ControladorBienvenida(vista, modelo);\n\t\tthis.controladorBienvenida.addListeners();\n\t\t\n\t\t// aņadimos listeners a los botones del panel 'sel_billete'\n\t\tthis.controladorBillete = new ControladorBillete(vista, modelo);\n\t\tthis.controladorBillete.addListeners();\n\t\t\n\t\t// aņadimos listeners a los botones del panel 'sel_fecha'\n\t\tthis.controladorFecha = new ControladorFecha(vista, modelo);\n\t\tthis.controladorFecha.addListeners();\n\t\t\n\t\t// aņadimos listeners a los botones del panel 'detalles_compra'\n\t\tthis.controladorDetalles = new ControladorDetalles(vista, modelo);\n\t\tthis.controladorDetalles.addListeners();\n\t\t\n\t\t// aņadimos listeners a los botones del panel 'pago'\n\t\tthis.controladorPago = new ControladorPago(vista, modelo);\n\t\tthis.controladorPago.addListeners();\n\t\t\n\t\t// aņadimos listeners a los botones del panel \"fin_pago\"\n\t\tthis.controladorFinPago = new ControladorFinPago(vista, modelo);\n\t\tthis.controladorFinPago.addListeners();\n\t}", "private void initializePlayers()\n\t{\n\t\tfor(Player player : playerList)\n\t\t{\n\t\t\t// Distribute personality cards\n\t\t\tplayer.setPersonalityCard(board.getPersonalityCardDeck().pickTopCard());\n\t\t\t\n\t\t\t// Distribute money\n\t\t\tboard.getBankAccount().transfertAmountTo(player, nbGoldStartPerPlayer, false);\n\t\t\t\n\t\t\t// Distribute minions\n\t\t\tfor(int i = 0; i < nbMinionsPerPlayer; i++)\n\t\t\t{\n\t\t\t\tplayer.addMinion(new Minion());\n\t\t\t}\n\t\t\t\n\t\t\t// Distribute buildings\n\t\t\tfor(int i = 0; i < nbBuildingsPerPlayer; i++)\n\t\t\t{\n\t\t\t\tplayer.addBuilding(new Building());\n\t\t\t}\n\t\t}\n\n\t\t// Distribute player cards\n\t\tfor(int i = 0; i < nbInitCards; i++)\n\t\t{\n\t\t\tfor(Player player : playerList)\n\t\t\t{\n\t\t\t\tplayer.getPlayerCardDeck().addCard(board.getPlayerCardDeck().pickTopCard());\n\t\t\t}\n\t\t}\n\t}", "private void botLogic(){\n synchronized (lock){Collections.sort(playerList);}\n botTrading();\n botVoting();\n waitPrint();\n await();\n }", "public void setupGame() {\n\t\t// Re-spawn the appropriate number of sheep\n\t\tint numSheep = 31;\n\t\t\n\t\tif (!SheepPhysicsState.PRODUCTION) {\n\t\t\tnumSheep = 1;\n\t\t}\n\t\t\n\t\t// It takes half the sheep to win.\n\t\t_scoreToWin = numSheep / 2;\n\t\tp(\"It takes \" + _scoreToWin + \" sheep to win.\");\n\t\t\n\t\t_hasBeenWon = false;\n\t\t\n\t\t// Non-infrastructural entities.\n\t\t//////////////////////////\n\t\t\n\t\t// Don't create this stuff if I'm replaying.\n\t\tint mod = 1;\n\t\tfor (int i = 0; i < numSheep; i++) {\n\t\t\t//int x = _generator.nextInt(40) - 20;\n\t\t\t//int z = _generator.nextInt(80) - 40;\n\t\t\tmod *= -1;\n\t\t\tint x = i/2 * mod;\n\t\t\tint z = 0;\n\n\t\t\tSheep s = new Sheep(\"sheep-\" + i + \"[\" + _sheepID + \"]\", x, 2, z);\n\t\t\t\n\t\t\tif (!SheepPhysicsState.PRODUCTION) {\n\t\t\t\ts.setBehaviorActive(false);\n\t\t\t}\n\t\t\t\n\t\t\t_sheepID++;\n\t\t}\n\t\t\n\t\t// Add a wubble for testing.\n\t\tif (!_isJimboSpawned && !SheepPhysicsState.PRODUCTION) {\n\t\t\tSystem.out.println(\"Adding Jimbo.\");\n\t\t\t_isJimboSpawned = true;\n\t\t\taddWubble(\"Jimbo\", (short)100, (Integer)1);\n\t\t\taddSidekick(\"Jimbo\");\n\t\t\t//addWubble(\"Bimbo\", (short)101, (Integer)0);\n\t\t}\n\t\t\n\t\t//////////////////////////\n\n\t\t// Add some wrenches in the appropriate spots.\n\t\tnew Wrench(\"blueWrench1\", -8, 5, -20);\n\t\tnew Wrench(\"blueWrench2\", 8, 5, -20);\n\t\tnew Wrench(\"redWrench1\", -8, 5, 20);\n\t\tnew Wrench(\"redWrench2\", 8, 5, 20);\n\t\t\n\t\t// Save the start of the me.\n\t\t_gameStart = System.currentTimeMillis();\n\t\tSystem.out.println(\"Started game at \" + _gameStart);\n\t\t\n\t\t// Make some predicates.\n\t\t//Predicate p = new Predicate(\"baseClassPred\");\n\t\t//GoPred g = new GoPred(\"derivedGoClass\", 1);\n\t\t\n\t\t//new PowerUp(\"PowerUpS\", -1, PowerUpInfo.PowerUpType.SPEEDY, new Vector3f(0, 0.4f, 0));\n\t\t//new PowerUp(\"PowerUpE\", -1, PowerUpInfo.PowerUpType.EATER, new Vector3f(2, 0.4f, 0));\n\t\t//new PowerUp(\"PowerUpS\", -1, PowerUpInfo.PowerUpType.STICKY, new Vector3f(2, 0.4f, 2));\n\t}", "public AllSystemsClimbCenter() {\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=PARAMETERS\n // Add Commands here:\n // e.g. addSequential(new Command1());\n // addSequential(new Command2());\n // these will run in order.\n\n // To run multiple commands at the same time,\n // use addParallel()\n // e.g. addParallel(new Command1());\n // addSequential(new Command2());\n // Command1 and Command2 will run in parallel.\n\n // A command group will require all of the subsystems that each member\n // would require.\n // e.g. if Command1 requires chassis, and Command2 requires arm,\n // a CommandGroup containing them would require both the chassis and the\n // arm.\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=COMMAND_DECLARATIONS\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=COMMAND_DECLARATIONS\n\n // if (!Robot.getKillClimber()) constantly checks if climber was killed by driver\n\n // if (!Robot.getKillClimber())\n // {\n // // set drive direction to correct orientation for climbing (front of robot direction)\n // Robot.chassis.setDriveDirection(-1);\n // }\n\n // if (!Robot.getKillClimber())\n // {\n // // ensure robot intake is in start position\n // addParallel(new ShooterAngleRotate(Constants.ALL_CENTER_SHOOTER_CLIMB_START_POSITION));\n // // ensure robot is against platform\n // addSequential(new DriveWithPower(Constants.ALL_CENTER_CHASSIS_INITIAL_POWER, \n // Constants.ALL_CENTER_CHASSIS_INITIAL_TIME), Constants.ALL_CENTER_CHASSIS_TIMEOUT);\n // }\n \n // extends front and back climber at the same time\n if (!Robot.getKillClimber())\n {\n addParallel(new ClimberFrontSetPosition(Constants.ALL_CENTER_FRONT_CLIMBER_EXTEND_POSITION));\n addParallel(new ClimberBackSetPosition(Constants.ALL_CENTER_BACK_CLIMBER_EXTEND_POSITION));\n // delay only 2 seconds in order to rotate shooter angle to pull in position faster\n addSequential(new Delay(2));\n }\n\n // // rotate shooter angle in order to pull robot onto platform\n // if (!Robot.getKillClimber())\n // {\n // addParallel(new ShooterAngleRotate(Constants.ALL_CENTER_SHOOTER_PULL_IN_POSITION));\n // addSequential(new Delay(2));\n // }\n \n // if (!Robot.getKillClimber())\n // {\n // // start shooter climber wheels in order to pull in\n // addParallel(new SetShooterSpeedStraight(Constants.ALL_CENTER_SHOOTER_PULL_IN_RPM));\n // // drive forward onto the platform\n // addSequential(new DriveWithPower(Constants.ALL_CENTER_CHASSIS_PLATFORM_POWER, \n // Constants.ALL_CENTER_CHASSIS_PLATFORM_TIME), Constants.ALL_CENTER_CHASSIS_TIMEOUT);\n // }\n\n // // bring up back climber\n // if (!Robot.getKillClimber())\n // {\n // addParallel(new ClimberBackSetPosition(Constants.ALL_CENTER_BACK_CLIMBER_RETRACT_POSITION));\n // addSequential(new Delay(2));\n // }\n\n // // drive forward onto the platform\n // if (!Robot.getKillClimber())\n // {\n // addSequential(new DriveWithPower(Constants.ALL_CENTER_CHASSIS_PLATFORM_POWER, \n // Constants.ALL_CENTER_CHASSIS_PLATFORM_TIME), Constants.ALL_CENTER_CHASSIS_TIMEOUT);\n // }\n\n // if (!Robot.getKillClimber())\n // {\n // // bring up front climber\n // addParallel(new ClimberFrontSetPosition(Constants.ALL_CENTER_FRONT_CLIMBER_RETRACT_POSITION));\n // addSequential(new Delay(2));\n // }\n // if (!Robot.getKillClimber())\n // {\n // // drive forward onto the platform\n // addParallel(new DriveWithPower(Constants.ALL_CENTER_CHASSIS_PLATFORM_POWER, \n // Constants.ALL_CENTER_CHASSIS_PLATFORM_TIME), Constants.ALL_CENTER_CHASSIS_TIMEOUT);\n // // bring shooter angle rotate to home position so it doesn't hit driver station\n // addSequential(new ShooterAngleRotate(Constants.ALL_CENTER_SHOOTER_HOME_POSITION));\n // }\n }", "public void prepare() {\n for (IMixinPlatformAgent agent : this.agents) {\n MixinContainer.logger.debug(\"Processing prepare() for {}\", agent);\n agent.prepare();\n }\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}", "public boolean getCanSpawnHere()\r\n {\r\n return false;\r\n }", "private void resetArena() {\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team0-X:\" + SPAWN_CIRCLE0_X);\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team0-Y:\" + SPAWN_CIRCLE0_Y);\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team0-Radius:1\");\r\n\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team1-X:\" + SPAWN_CIRCLE1_X);\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team1-Y:\" + SPAWN_CIRCLE1_Y);\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team1-Radius:1\");\r\n\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team2-X:\" + SPAWN_CIRCLE2_X);\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team2-Y:\" + SPAWN_CIRCLE2_Y);\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team2-Radius:1\");\r\n\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team3-X:\" + SPAWN_CIRCLE3_X);\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team3-Y:\" + SPAWN_CIRCLE3_Y);\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team3-Radius:1\");\r\n\r\n if(m_ensureLock) {\r\n m_ensureLock = false;\r\n m_botAction.toggleLocked();\r\n }\r\n }", "public default boolean shouldSpawnEntity(){ return false; }", "protected void init() {\n eachModule(ModuleHandler.INSTANCE::depends);\n \n // init, only enabled modules are run\n eachEnabledModule(ModuleHandler.INSTANCE::init);\n \n // listen for server world loading events\n // LoadWorldCallback.EVENT.register(server -> eachEnabledModule(m ->\n // m.loadWorld(server)));\n }", "public void robotInit() {\n\t\tmyRobot = new RobotDrive(0,1);\n\t\tteleop = new Teleop(myRobot);\n\t\tauto = new AutonomousDrive(myRobot);\n\t}", "void listBots( String className, String messager ) {\n Iterator<ChildBot> i;\n ChildBot bot;\n String rawClassName = className.toLowerCase();\n\n if( rawClassName.compareTo( \"hubbot\" ) == 0 ) {\n m_botAction.sendSmartPrivateMessage( messager, \"There is only one true master, and that is me.\" );\n } else if( getNumberOfBots( className ) == 0 ) {\n m_botAction.sendSmartPrivateMessage( messager, \"No bots of that type.\" );\n } else {\n m_botAction.sendSmartPrivateMessage( messager, className + \":\" );\n\n for( i = m_botStable.values().iterator(); i.hasNext(); ) {\n bot = i.next();\n\n if( bot != null )\n if( bot.getClassName().compareTo( className ) == 0 )\n m_botAction.sendSmartPrivateMessage( messager, bot.getBot().getBotName() + \" (in \" + bot.getBot().getBotAction().getArenaName() + \"), created by \" + bot.getCreator());\n }\n\n m_botAction.sendSmartPrivateMessage( messager, \"End of list\" );\n }\n }", "@Override\n\tpublic void agentSetup() {\n\n\t\t// load the class names of each object\n\t\tString os = dagent.getOfferingStrategy().getClassname();\n\t\tString as = dagent.getAcceptanceStrategy().getClassname();\n\t\tString om = dagent.getOpponentModel().getClassname();\n\t\tString oms = dagent.getOMStrategy().getClassname();\n\n\t\t// createFrom the actual objects using reflexion\n\n\t\tofferingStrategy = BOAagentRepository.getInstance().getOfferingStrategy(os);\n\t\tacceptConditions = BOAagentRepository.getInstance().getAcceptanceStrategy(as);\n\t\topponentModel = BOAagentRepository.getInstance().getOpponentModel(om);\n\t\tomStrategy = BOAagentRepository.getInstance().getOMStrategy(oms);\n\n\t\t// init the components.\n\t\ttry {\n\t\t\topponentModel.init(negotiationSession, dagent.getOpponentModel().getParameters());\n\t\t\topponentModel.setOpponentUtilitySpace(fNegotiation);\n\t\t\tomStrategy.init(negotiationSession, opponentModel, dagent.getOMStrategy().getParameters());\n\t\t\tofferingStrategy.init(negotiationSession, opponentModel, omStrategy,\n\t\t\t\t\tdagent.getOfferingStrategy().getParameters());\n\t\t\tacceptConditions.init(negotiationSession, offeringStrategy, opponentModel,\n\t\t\t\t\tdagent.getAcceptanceStrategy().getParameters());\n\t\t\tacceptConditions.setOpponentUtilitySpace(fNegotiation);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t// remove the reference to the information object such that the garbage\n\t\t// collector can remove it.\n\t\tdagent = null;\n\t}", "public void robotInit()\n\t{\n\t\toi = new OI();\n\t\t// instantiate the command used for the autonomous period\n\t\t// autonomousCommand = new Driver();\n\t}", "protected void initialize() {\n finished = false;\n Robot.shooter.Spin();//Spin up wheels\n Timer.delay(3);\n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n \n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n \n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n //Robot.shooter.Stop();\n Robot.shooter.TriggerExtend();//Reset Trigger\n \n Robot.driveTrain.DriveBack();//Drives backwards from pyramid\n Timer.delay(1.5);\n Robot.driveTrain.TurnAround();//Turns Bob around\n Timer.delay(1);\n Robot.driveTrain.Stop();//Stops Bob\n \n Robot.pneumatics.CompressorOn();//Turns compressor on\n }", "protected PayerThread() {\n\t\t\tEvent.ASSERTION.issue(sets == null, \"builders is null\");\n\t\t\tEvent.ASSERTION.issue(workloadConfiguration == null, \"configuration is null\");\n\n\t\t\tsetDaemon(true);\n\t\t}", "protected void initialize() {\n \tsetShowStartScreen(false);\n \t\n \t// do not preload resources, for this very simple game\n \t// preloadResources();\n \t\n \t// Max number of balls is just 17\n \tchains.setMaxBalls(17);\n }", "@Override\n protected void initGame() {\n getGameWorld().setEntityFactory(new PlatformerFactory());\n getGameWorld().setLevelFromMap(\"Platformergame1.json\");\n\n // Sets spawnloction of the player\n player = getGameWorld().spawn(\"player\", 50, 50);\n }", "public void randomiseBotDirections() {\n\t\tfor (int i = 0; i < bots.size(); i++) {\n\t\t\tbots.get(i).setDirection(Math.random() * 360);\n\t\t}\n\t}", "private static void loop() throws GameActionException {\n RobotCount.reset();\n MinerEffectiveness.reset();\n\n //Update enemy HQ ranges in mob level\n if(Clock.getRoundNum()%10 == 0) {\n enemyTowers = rc.senseEnemyTowerLocations();\n numberOfTowers = enemyTowers.length;\n if(numberOfTowers < 5 && !Map.isEnemyHQSplashRegionTurnedOff()) {\n Map.turnOffEnemyHQSplashRegion();\n }\n if(numberOfTowers < 2 && !Map.isEnemyHQBuffedRangeTurnedOff()) {\n Map.turnOffEnemyHQBuffedRange();\n }\n }\n \n // Code that runs in every robot (including buildings, excepting missiles)\n sharedLoopCode();\n \n updateEnemyInRange(52);//52 includes splashable region\n checkForEnemies();\n \n int rn = Clock.getRoundNum();\n \n // Launcher strategy\n if(rn == 80) {\n BuildOrder.add(RobotType.HELIPAD); \n } else if(rn == 220) {\n BuildOrder.add(RobotType.AEROSPACELAB);\n } else if (rn == 280) {\n BuildOrder.add(RobotType.AEROSPACELAB);\n } else if (rn == 350) {\n BuildOrder.add(RobotType.AEROSPACELAB);\n } else if (rn == 410) {\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n } else if (rn == 500) {\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n } \n if (rn > 500 && rn%200==0) {\n BuildOrder.add(RobotType.AEROSPACELAB);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n }\n //rc.setIndicatorString(1, \"Distance squared between HQs is \" + distanceBetweenHQs);\n \n \n \n if(rn > 1000 && rn%100 == 0 && rc.getTeamOre() > 700) {\n int index = BuildOrder.size()-1;\n if(BuildOrder.isUnclaimedOrExpired(index)) {\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n }\n }\n \n \n \n /**\n //Building strategy ---------------------------------------------------\n if(Clock.getRoundNum() == 140) {\n BuildOrder.add(RobotType.TECHNOLOGYINSTITUTE);\n BuildOrder.add(RobotType.TRAININGFIELD);\n }\n if(Clock.getRoundNum() == 225) {\n BuildOrder.add(RobotType.BARRACKS);\n BuildOrder.add(RobotType.TANKFACTORY);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n }\n if(Clock.getRoundNum() == 550) {\n BuildOrder.add(RobotType.TANKFACTORY);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n\n }\n if(Clock.getRoundNum() == 800) {\n BuildOrder.add(RobotType.HELIPAD);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.TANKFACTORY);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n\n //BuildOrder.printBuildOrder();\n }\n //---------------------------------------------------------------------\n **/\n \n //Spawn beavers\n if (hasFewBeavers()) { \n trySpawn(HQLocation.directionTo(enemyHQLocation), RobotType.BEAVER);\n }\n \n //Dispense supply\n Supply.dispense(suppliabilityMultiplier);\n \n //Debug\n //if(Clock.getRoundNum() == 700) Map.printRadio();\n //if(Clock.getRoundNum() == 1500) BuildOrder.print();\n\n }", "private void spawnBigEnemy(IEnemyService spawner, World world, GameData gameData) {\r\n if (spawner != null) {\r\n spawner.createBigEnemy(world, gameData, new Position(randomIntRange(1600, 3200), gameData.getGroundHeight()));\r\n spawner.createBigEnemy(world, gameData, new Position(randomIntRange(-600, -2000), gameData.getGroundHeight()));\r\n }\r\n }", "private boolean isCreateBattle() {\r\n int percent = ConfigUtil.getConfigInteger(\"battlePercent\", 30);\r\n if(RandomUtil.nextInt(100) < percent){\r\n return true;\r\n }\r\n return false;\r\n }", "public void robotInit() {\n RobotMap.init();\n driveTrain = new DriveTrain();\n oi = new OI();\n flippy = new Flipper();\n flappy = new Flapper();\n autonomousCommand = new AutoFlip();\n \n OI.init();\n CommandBase.init();\n autoChooser = new SendableChooser();\n autoChooser.addDefault(\"Flap Left\", new AutoFlip());\n SmartDashboard.putData(\"Autonomous_Mode\", autoChooser); \n }", "public void setup() {\n\t\taddBehaviour(new TickerBehaviour(this, 1000L) {\n\n\t\t\t@Override\n\t\t\tprotected void onTick() {\n\t\t\t\tint extinguishedFires = 0;\n\t\t\t\t\n\t\t\t\tfor(int i = 0; i < worldAgent.getAircraftAgents().length; i++) {\n\t\t\t\t\textinguishedFires+=worldAgent.getAircraftAgents()[i].getAircraftMetricsStats().getNumTotalFiresExtinguishedByThisAircraft();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tworldAgent.getWorldMetricsStats().setNumTotalFiresExtinguishedByAllAircrafts(extinguishedFires);\n\t\t\t\t\n\t\t\t\tif(extinguishedFires >= 3) {\t\t\t\t\t\n\t\t\t\t\tlong end_time = System.currentTimeMillis();\n\t\t\t\t\tlong execution_time = end_time - init_time;\n\t\t\t\t\t\n\t\t\t\t\tAircraftAgent[] aircrafts = worldAgent.getAircraftAgents();\n\t\t\t\t\t\n\t\t\t\t\tfor(int i = 0; i < aircrafts.length; i++) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor(Thread sleepingThread : aircrafts[i].getSleepingThreads().values()) {\n\t\t\t\t\t\t\tSystem.err.println(\"Interrupting thread = \\\"\" + sleepingThread.getName() + \"!\");\n\t\t\t\t\t\t\tsleepingThread.interrupt();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tkillContainer();\n\t\t\t\t\t\n\t\t\t\t\tLogger.appendConfigValues(execution_time);\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"Run no. \" + JADELauncher.NUMBER_OF_RUNS + \" finished.\");\n\n\t\t\t\t\tif(JADELauncher.NUMBER_OF_RUNS == 0) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tLogger.closeStream();\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tJADELauncher.NUMBER_OF_RUNS--;\n\t\t\t\t\t\tinstanceRun();\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\n\t\t\t\n\t\t});\n\t\t\n\t\tinstanceRun();\n\t}", "public void robotInit() {\n\t\t//Get preferences from robot flash memory\n\t\tprefs = Preferences.getInstance();\n\t\tarmCalMinPosition = prefs.getDouble(\"armCalMinPosition\", 0);\n\t\tarmCal90DegPosition = prefs.getDouble(\"armCal90DegPosition\", 0);\n\t\tif (armCalMinPosition==0 || armCal90DegPosition==0) {\n\t\t\tDriverStation.reportError(\"Error: Preferences missing from RoboRio for Shooter Arm position calibration. Shooter arm disabled.\", true);\n\t\t\tshooterArmEnabled = false;\n\t\t} else {\n\t\t\tshooterArmEnabled = true;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tdebugStream = new FileWriter(\"/home/lvuser/debug.log\", true);\n\t\t\tdebugStream.write(\"Robot program started\\n\");\n\t\t\tdebugStream.flush();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Could not open debug file: \" + e);\n\t\t}\n\n\t\t//Instantiates the subsystems\n\t\tdriveTrain = new DriveTrain();\n\t\tshifter = new Shifter();\n\t\tshooterArm = new ShooterArm();\n\t\tshooter = new Shooter();\n\t\tintake = new Intake();\n\t\tvision = new Vision();\n\t\tpanel = new PowerDistributionPanel();\n\t\tarmPiston = new ArmPiston();\n\n\t\t// OI must be constructed after subsystems. If the OI creates Commands\n\t\t// (which it very likely will), subsystems are not guaranteed to be\n\t\t// constructed yet. Thus, their requires() statements may grab null\n\t\t// pointers. Bad news. Don't move it.\n\t\toi = new OI();\n\n intake.motorCurrentTrigger.whenActive(new IntakeMotorStop());\n\n timerLEDs.start();\n timerTilt.start();\n timerRumble.start();\n \n // instantiate the command used for the autonomous period\n\t\t//autonomousCommand = new AutonomousCommandGroup();\n\t\traiseArm90 = new ShooterArmMoveToSetLocation(90);\n\t\t\n\t\t// Display active commands and subsystem status on SmartDashboard\n\t\tSmartDashboard.putData(Scheduler.getInstance());\n\t\tSmartDashboard.putData(driveTrain);\n\t\tSmartDashboard.putData(shifter);\n\t\tSmartDashboard.putData(shooterArm);\n\t\tSmartDashboard.putData(shooter);\n\t\tSmartDashboard.putData(intake);\n\t\tSmartDashboard.putData(vision);\n\t\tSmartDashboard.putData(armPiston);\n\t}", "private void loadVariablesFromConfig()\n {\n List<String> spawnNames = (List<String>) spawnConfig.getConfig().getList(\"spawns\");\n for (String spawn : spawnNames) {\n Location location = new Location(\n getServer().getWorld(spawnConfig.getConfig().getString(\"spawn.\" + spawn + \".world\")),\n spawnConfig.getConfig().getDouble(\"spawn.\" + spawn + \".x\"),\n spawnConfig.getConfig().getDouble(\"spawn.\" + spawn + \".y\"),\n spawnConfig.getConfig().getDouble(\"spawn.\" + spawn + \".z\"));\n location.setPitch(spawnConfig.getConfig().getInt(\"spawn.\" + spawn + \".pitch\"));\n location.setYaw(spawnConfig.getConfig().getInt(\"spawn.\" + spawn + \".yaw\"));\n\n spawnLocations.add(location);\n }\n\n // Spectator Spawn\n spectatorSpawn = new Location(\n getServer().getWorld(spawnConfig.getConfig().getString(\"spectatorSpawn.world\")),\n spawnConfig.getConfig().getDouble(\"spectatorSpawn.x\"),\n spawnConfig.getConfig().getDouble(\"spectatorSpawn.y\"),\n spawnConfig.getConfig().getDouble(\"spectatorSpawn.z\"));\n spectatorSpawn.setPitch(spawnConfig.getConfig().getInt(\"spectatorSpawn.pitch\"));\n spectatorSpawn.setYaw(spawnConfig.getConfig().getInt(\"spectatorSpawn.yaw\"));\n }", "protected void initialize() {\n \tRobot.telemetry.setAutonomousStatus(\"Starting \" + commandName + \": \" + distance);\n \tRobot.drivetrain.resetEncoder();\n \t\n \tRobot.driveDistancePID.setSetpoint(distance);\n \tRobot.driveDistancePID.setRawTolerance(RobotPreferences.drivetrainTolerance());\n \tRobot.driveDistancePID.enable();\n \t\n \texpireTime = timeSinceInitialized() + (RobotPreferences.timeOut());\n }" ]
[ "0.7001371", "0.63297087", "0.61439025", "0.60479987", "0.5689258", "0.5558519", "0.544724", "0.5433248", "0.5370056", "0.5325601", "0.530101", "0.5281433", "0.5274631", "0.5258843", "0.52207375", "0.5215851", "0.5204297", "0.5189778", "0.51790637", "0.5174633", "0.5170193", "0.51585746", "0.51559204", "0.51530993", "0.5149121", "0.51346755", "0.512927", "0.51273185", "0.5119306", "0.5114477", "0.5103174", "0.51014006", "0.50913185", "0.5046693", "0.5011398", "0.50031734", "0.49957556", "0.49798274", "0.49786806", "0.4970308", "0.49699917", "0.49653724", "0.496008", "0.4947862", "0.49429983", "0.4929746", "0.49215367", "0.49173358", "0.49158788", "0.49059078", "0.48990968", "0.48980764", "0.48881295", "0.4878646", "0.4854621", "0.48518473", "0.4844075", "0.48405457", "0.4837773", "0.4828846", "0.48276532", "0.48183566", "0.48174536", "0.4812008", "0.48089778", "0.48053363", "0.4803846", "0.48038247", "0.47983277", "0.47773167", "0.47633994", "0.47603512", "0.4755245", "0.4753076", "0.47356728", "0.4734719", "0.47331652", "0.4725166", "0.47225216", "0.47184917", "0.471584", "0.47135243", "0.47098756", "0.4708065", "0.47080266", "0.47049212", "0.46994403", "0.46959338", "0.46948797", "0.46930802", "0.46906683", "0.46895596", "0.46887589", "0.46851087", "0.46838206", "0.46807545", "0.46801043", "0.46789137", "0.4676928", "0.4674766" ]
0.6540891
1
Clears the current repository and adds the core location and all subdirectories to the current bot repository.
public void resetRepository() { repository.clear(); addDirectories( directory ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void deleteDir() throws Exception\n{\n if(_repo!=null) _repo.close(); _repo = null;\n _gdir.delete();\n _gdir.setProp(GitDir.class.getName(), null);\n}", "public void cleanUpRepository()\r\n {\r\n\t\t// delete the repository\r\n\t\trepositoryService.deleteRepository(repository);\r\n\t\t\r\n\t\t// delete the file server\r\n\t\tfileServerService.deleteFileServer(fileServer);\r\n }", "private void deleteRepository() {\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tint opt = JOptionPane.showConfirmDialog(this, \"Delete entire Repository (all change sets) at \"+ repURLFld.getText()+\" ?\", \"Delete All\", JOptionPane.YES_NO_OPTION);\r\n\t\t\tif (opt == JOptionPane.NO_OPTION) return;\r\n\t\t\t\r\n\t\t\t// delete repository header\r\n\t\t\tif (repHeaderLoc!=null) {\r\n\t\t\t\tclient.delete(this.repHeaderLoc);\r\n\t\t\t\tSystem.out.println(\"Deleted Repository Header at \" + repHeaderLoc);\r\n\t\t\t}\r\n\t\t\telse System.out.println(\"URL location of Repository Header not known\");\r\n\t\t\t\r\n\t\t\t// delete all commits at Version Controlled Repository\r\n\t\t\tfor (int ctr=1; ctr<=this.headVersionNumber; ctr++) {\r\n\t\t\t\tURL loc = null;\r\n\t\t\t\tif (versionNodes[ctr]!=null) {\r\n\t\t\t\t\tloc = versionNodes[ctr].location;\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tURI versionURI = new URI(this.repositoryURI.toString()+\"#\"+String.valueOf(ctr));\r\n\t\t\t\t\tSet versionSet = client.findAnnotations(versionURI);\r\n\t\t\t\t\tloc = ((Description) versionSet.iterator().next()).getLocation();\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tclient.delete(loc);\r\n\t\t\t\tSystem.out.println(\"Deleted Version at \"+loc);\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\tcatch (Exception ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t}", "@After\n public void clearRepositories() {\n Assert.assertEquals(1, userRepository.count());\n // check that token repository didn't change\n Assert.assertEquals(1, tokenRepository.count());\n for (Token token: tokenRepository.findAll())\n Assert.assertEquals(\"TOKEN\", token.getKey());\n // reset Repositories\n userRepository.deleteAll();\n tokenRepository.deleteAll();\n }", "private void clearRepoList() {\n this.tvRepoList.setText(\"\");\n }", "public void clearPaths() {\n _thePaths.clear();\n }", "private void cleanupLocal() throws IOException {\n FileSystem lfs = FileSystem.getLocal(new Configuration());\n lfs.delete(new Path(\"build\"), true);\n System.setProperty(\"hadoop.log.dir\", \"logs\");\n }", "public void resetNewDirBots() {\r\n \r\n this.north = new BotSimpleDirection(this.getBoard(), BotSimpleDirection.DIR_NORTH);\r\n this.south = new BotSimpleDirection(this.getBoard(), BotSimpleDirection.DIR_SOUTH);\r\n this.east = new BotSimpleDirection(this.getBoard(), BotSimpleDirection.DIR_EAST);\r\n this.west = new BotSimpleDirection(this.getBoard(), BotSimpleDirection.DIR_WEST);\r\n \r\n // At this point, we can do a clone\r\n this.initDirBotMove(north);\r\n this.initDirBotMove(south);\r\n this.initDirBotMove(east);\r\n this.initDirBotMove(west);\r\n }", "void reset() throws GitException, InterruptedException;", "private static void cleanUpGlobalStateAndFileStore() {\n FileUtils.deleteDirectory(Paths.get(GLOBAL_STATE_DIR));\n }", "void submoduleSync() throws GitException, InterruptedException;", "public static void deleteGitRepository(Git repo) throws IOException {\n if (repo != null\n && repo.getRepository() != null\n && repo.getRepository().getDirectory() != null\n && repo.getRepository().getDirectory().exists()) {\n // This is literally the git directory, i.e. /some/hierarchy/repository/.git,\n // but we want to delete its parent directory.\n File gitDirectory = repo.getRepository().getDirectory();\n org.apache.commons.io.FileUtils.forceDelete(gitDirectory.getParentFile());\n }\n }", "public synchronized void deleteRepository(String currentUser, String name) throws IOException {\n\n\t\tif (isAnonymousUser(currentUser)) {\n\t\t\tthrow new UserAccessException(\"Anonymous user not permitted to delete repository\");\n\t\t}\n\n\t\tvalidateUser(currentUser);\n\n\t\tRepository rep = repositoryMap.get(name);\n\t\tif (rep == null) {\n\t\t\treturn;\n\t\t}\n\n\t\trep.delete(currentUser);\n\n\t\tFile f = new File(rootDirFile, NamingUtilities.mangle(name));\n\t\tif (!FileUtilities.deleteDir(f)) {\n\t\t\tthrow new IOException(\"Failed to remove directory for \" + f.getAbsolutePath());\n\t\t}\n\n\t\trepositoryMap.remove(name);\n\t}", "protected static void cleanUpWorkingDir() {\n final Path testControllerPath =\n Paths.get(SystemPersistence.manager.getConfigurationPath().toString(), TEST_CONTROLLER_FILE);\n try {\n Files.deleteIfExists(testControllerPath);\n } catch (final Exception e) {\n logger.info(\"Problem cleaning {}\", testControllerPath, e);\n }\n\n final Path testControllerBakPath =\n Paths.get(SystemPersistence.manager.getConfigurationPath().toString(), TEST_CONTROLLER_FILE_BAK);\n try {\n Files.deleteIfExists(testControllerBakPath);\n } catch (final Exception e) {\n logger.info(\"Problem cleaning {}\", testControllerBakPath, e);\n }\n }", "public static void repoClone() throws IOException, InvalidRemoteException, TransportException, GitAPIException {\n\t\tFile localPath = new File(\"testRuby\");\n\t\tboolean directoryExist = localPath.exists();\n\t\tlocalPath.delete();\n\t\t// then clone\n\t\tSystem.out.println(\"Cloning from \" + REMOTE_URL + \" to \" + localPath);\n\t\tFileRepositoryBuilder builder = new FileRepositoryBuilder();\n\t\tRepository repository = builder.setWorkTree(localPath).readEnvironment().build();\n\t\tGit git = new Git(repository);\n\t\tif (!directoryExist) {\n\t\t\ttry (Git result = git.cloneRepository().setURI(REMOTE_URL).setDirectory(localPath).call()) {\n\t\t\t\t// Note: the call() returns an opened repository already which\n\t\t\t\t// needs to be closed to avoid file handle leaks!\n\t\t\t\tSystem.out.println(\"Having repository: \" + result.getRepository().getDirectory());\n\t\t\t}\n\t\t} else {\n\t\t\tPullResult pullresult=git.pull().call();\n\t\t\t// Note: the call() returns an opened repository already which needs\n\t\t\t// to be closed to avoid file handle leaks!\n\t\t\tSystem.out.println(\"pulled repository: \" + pullresult.isSuccessful());\n\n\t\t}\n\t}", "public void reset(final Repository repo, final ObjectId id)\n \t\t\tthrows IncorrectObjectTypeException, IOException {\n \t\tfinal ObjectLoader ldr = repo.openObject(id);\n\t\tif (ldr == null)\n\t\t\tthrow new MissingObjectException(id, Constants.TYPE_TREE);\n \t\tfinal byte[] subtreeData = ldr.getCachedBytes();\n \t\tif (ldr.getType() != Constants.OBJ_TREE)\n \t\t\tthrow new IncorrectObjectTypeException(id, Constants.TYPE_TREE);\n \t\treset(subtreeData);\n \t}", "public static void clearRegistry() {\n \t\tLIBRARIES.clear();\n \t}", "static public void unregisterAllRoot()\n {\n java.lang.SecurityManager sm = System.getSecurityManager();\n if( sm != null )\n {\n sm.checkPermission( new RuntimePermission( \"modifyRepository\" ) );\n }\n\n rootMap.clear();\n }", "private void clearClipsDirectory(){\n /* Citation : http://helpdesk.objects.com.au/java/how-to-delete-all-files-in-a-directory#:~:text=Use%20the%20listFiles()%20method,used%20to%20delete%20each%20file. */\n File directory = new File(Main.CREATED_CLIPS_DIRECTORY_PATH);\n File[] files = directory.listFiles();\n if(files != null){\n for(File file : files){\n if(!file.delete()) System.out.println(\"Failed to remove file \" + file.getName() + \" from \" + Main.CREATED_CLIPS_DIRECTORY_PATH);\n }\n }\n }", "public void load() {\r\n\t\t\r\n\t\t//-- Clean\r\n\t\tthis.repositories.clear();\r\n\t\t\r\n\t\tloadInternal();\r\n\t\tloadExternalRepositories();\r\n\t\t\r\n\t}", "public void removeAllPackages() {\r\n myPackages.clear();\r\n }", "@Test\n\tpublic void reload_is_clean() {\n\t\tEnvironmentContext cx = null;\n\t\ttry {\n\t\t\tcx = new EnvironmentContext();\n\t\t} catch (Exception e) {\n\t\t\tfail(e.getMessage());\n\t\t}\n\t\t// And a new repository with that connection\n\t\tBuildProjectRepository repository = new BuildProjectRepositoryApiClient(cx);\n\n\t\tQueryResult result = null;\n\t\ttry {\n\t\t\tresult = cx.getServices().retrieve(repository.buildQueryForAllBuildProjects());\n\t\t} catch (ConnectionException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t} catch (APIException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t} catch (OidException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tfor (Asset asset : result.getAssets()) {\n\t\t\tfor (Entry<String, Attribute> attribute : asset.getAttributes().entrySet()) {\n\t\t\t\ttry {\n\t\t\t\t\tString k = attribute.getKey();\n\t\t\t\t\tObject v = attribute.getValue().getValue();\n\t\t\t\t} catch (APIException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t// When I reload the repository\n\t\ttry {\n\t\t\trepository.reload();\n\t\t} catch (BuildProjectRepositoryException e) {\n\t\t\tfail(e.getMessage());\n\t\t}\n\t\t// Then the repository is not dirty\n\t\tboolean dirty = false;\n\t\ttry {\n\t\t\tdirty = repository.isDirty();\n\t\t} catch (BuildProjectRepositoryException e) {\n\t\t\tfail(e.getMessage());\n\t\t}\n\t\tassertFalse(dirty);\n\t}", "public static void updateRepositoryList() {\n \t\tassetLoader.removeAllRepositories();\n \t\tfor (String repo : MapTool.getCampaign().getRemoteRepositoryList()) {\n \t\t\tassetLoader.addRepository(repo);\n \t\t}\n \t}", "@Override\n\tpublic synchronized void clear() {\n\t\tFile[] files = mRootDirectory.listFiles();\n\t\tif (files != null) {\n\t\t\tfor (File file : files) {\n\t\t\t\tfile.delete();\n\t\t\t}\n\t\t}\n\t\tmEntries.clear();\n\t\tmTotalSize = 0;\n\t\tVolleyLog.d(\"Cache cleared.\");\n\t}", "public void buildAllRepositories() {\n for (ServerRepository serverRepository : serverRepositories.values()) {\n buildRepository(serverRepository, false);\n }\n\n updateServerInfo();\n }", "public void clear() {\n tree.clear();\n }", "@Test\n public void testInitialiseOnExistingRepo() throws Exception {\n moveToTempTestDirectory(\"test-project-initialise\", \"pom.xml\");\n\n final File rootFolder = getFolder().getRoot();\n assertTrue(rootFolder.exists());\n Git.init().setDirectory(rootFolder).call();\n\n verifyRepositoryInitializedWithoutErrors(rootFolder);\n }", "void deleteRepository(URL repositoryUrl);", "public void clear()\n {\n normalImports.clear();\n wildcardImports.clear();\n }", "@Override\r\n\tpublic void remDir(String path) {\n\t\t\r\n\t}", "public static void createTestRepos(Path sourceDirectory) throws IOException {\n Path remoteRoot = Paths.get(\"/tmp/remotes/\");\n Files.createDirectories(remoteRoot);\n\n Files.list(sourceDirectory.resolve(\"configs/containers\"))\n .filter( file -> file.getFileName().toString().endsWith(\".cfg\") )\n .forEach( path -> {\n String containerName = path.getFileName().toString();\n Path containerRepoPath = remoteRoot.resolve(containerName.substring(0, containerName.lastIndexOf('.')));\n\n if (!Files.isDirectory(containerRepoPath.resolve(\".git\"))) {\n try {\n Files.createDirectories(containerRepoPath);\n } catch (IOException e) {\n throw new IllegalArgumentException(e);\n }\n try (Git ignored = initRepo(containerRepoPath)) {\n } catch (GitAPIException e) {\n throw new IllegalArgumentException(e);\n }\n }\n }\n );\n }", "public void reset(String commID) {\n Comm comm = null;\n if (hasuntracked(head)) {\n Utils.message(\"There is an untracked file in the way;\"\n + \" delete it or add it first.\");\n throw new GitletException();\n }\n if (allcomms.containsKey(commID)) {\n comm = allcomms.get(commID);\n } else {\n for (String s : allcomms.keySet()) {\n if (s.substring(0, 8).equals(commID)) {\n comm = allcomms.get(s);\n break;\n }\n }\n\n }\n if (comm == null) {\n Utils.message(\"No commit with that id exists.\");\n } else {\n head = comm;\n for (Blob b: head.getContents().values()) {\n File f = new File(b.getName());\n Utils.writeContents(f,\n head.getContents().get(b.getName()).getContent());\n stagingarea.clear();\n }\n deleteuntracked(head);\n branches.put(branch, head);\n\n }\n }", "private void emptyTestDirectory() {\n // Delete the files in the /tmp/QVCSTestFiles directory.\n File tempDirectory = new File(TestHelper.buildTestDirectoryName(TEST_SUBDIRECTORY));\n File[] files = tempDirectory.listFiles();\n if (files != null) {\n for (File file : files) {\n if (file.isDirectory()) {\n File[] subFiles = file.listFiles();\n for (File subFile : subFiles) {\n if (subFile.isDirectory()) {\n File[] subSubFiles = subFile.listFiles();\n for (File subSubFile : subSubFiles) {\n subSubFile.delete();\n }\n }\n subFile.delete();\n }\n }\n file.delete();\n }\n }\n }", "public void refresh() {\n navTreeWidget.removeItems();\n selectedPath = null;\n loadInitialTree();\n }", "void deleteCoverDirectory() {\n\n try {\n\n Log.i(\"Deleting Covr Directory\", cover_directory.toString());\n FileUtils.deleteDirectory(cover_directory);\n } catch (IOException e) {\n\n }\n\n }", "void deleteDirectories() {\n\n if (story_directory != null && !newStoryReady) {\n deleteStoryDirectory();\n }\n\n if (tag_directory != null && !newStoryReady) {\n deleteTagDirectory();\n }\n\n if (cover_directory != null && !newStoryReady) {\n deleteCoverDirectory();\n }\n }", "public void resetWorkspace() {\n //clear all pages and their drawers\n //clear all drawers and their content\n //clear all block and renderable block instances\n workspace.reset();\n //clear procedure output information\n ProcedureOutputManager.reset();\t//*****\n\n }", "@Test\n public void testInitialiseNewGitRepo() throws Exception {\n moveToTempTestDirectory(\"test-project-initialise\", \"pom.xml\");\n\n final File rootFolder = getFolder().getRoot();\n assertTrue(rootFolder.exists());\n\n verifyRepositoryInitializedWithoutErrors(rootFolder);\n }", "public void deleteAll() {\n repository.deleteAll();\n }", "public static void clearWorld() {\n // TODO: Complete this method\n population.clear();\n babies.clear();\n }", "public void clearFramework() {\r\n\t\tList<Configuration> tests = testCache.getAllTests();\r\n\t\tlog.info(\"Clearing all tests.\\n\");\r\n\t\tfor (Configuration test : tests) {\r\n\t\t\tkillTest(test.getUniqueId());\r\n\t\t}\r\n\t\tworkQueue.clear();\r\n\t\ttestCache.clear();\r\n\t}", "public void clear(){\n this.entities.clear();\n /*for(QuadTree node: this.getNodes()){\n node.clear();\n this.getNodes().remove(node);\n }*/\n this.nodes.clear();\n }", "public void clearChildren() throws RemoteException;", "public static void clearAll(Context ctx){\n \t\t// delete files\n \t\tfor( File f : getCachedFiles(ctx) ){\n \t\t\tf.delete();\n \t\t}\n \t}", "public void clear() {\n count = 0;\n root = null;\n }", "public void clear(){\n root = null;\n count = 0;\n }", "public void clearProject()\n\t{\n\t\tstoreViewState();\n\t\tproject.clearProject();\n\t\tcheckStatus();\n\t}", "public void resetPath();", "@Override\n public void resetStateOfSUT() {\n\n try {\n //FIXME: this fails due to locks on Neo4j. need way to reset it\n //deleteDir(new File(tmpFolder));\n if(!Files.exists(Path.of(tmpFolder))) {\n Files.createDirectories(Path.of(tmpFolder));\n }\n Files.copy(getClass().getClassLoader().getResourceAsStream(\"users.json\"), Path.of(tmpFolder,\"users.json\"), StandardCopyOption.REPLACE_EXISTING);\n Files.copy(getClass().getClassLoader().getResourceAsStream(\"logins.json\"), Path.of(tmpFolder,\"logins.json\"), StandardCopyOption.REPLACE_EXISTING);\n }catch (Exception e){\n throw new RuntimeException(e);\n }\n }", "public void clear() {\n root = null;\n size = 0;\n }", "public void clear() {\n root = null;\n size = 0;\n }", "@TestFor(issues = \"TW-42737\")\n public void test_directory_remove() throws Exception {\n CommitPatchBuilder patchBuilder = myCommitSupport.getCommitPatchBuilder(myRoot);\n patchBuilder.createFile(\"dir/file\", new ByteArrayInputStream(\"content\".getBytes()));\n patchBuilder.createFile(\"dir2/file\", new ByteArrayInputStream(\"content\".getBytes()));\n patchBuilder.commit(new CommitSettingsImpl(\"user\", \"Create dir with file\"));\n patchBuilder.dispose();\n\n RepositoryStateData state1 = myGit.getCurrentState(myRoot);\n\n patchBuilder = myCommitSupport.getCommitPatchBuilder(myRoot);\n patchBuilder.deleteDirectory(\"dir\");\n patchBuilder.commit(new CommitSettingsImpl(\"user\", \"Delete dir\"));\n patchBuilder.dispose();\n\n RepositoryStateData state2 = myGit.getCurrentState(myRoot);\n\n List<ModificationData> changes = myGit.getCollectChangesPolicy().collectChanges(myRoot, state1, state2, CheckoutRules.DEFAULT);\n then(changes).hasSize(1);\n then(changes.get(0).getChanges()).extracting(\"fileName\", \"type\").containsOnly(Tuple.tuple(\"dir/file\", VcsChange.Type.REMOVED));\n }", "public void vaciar()\n {\n this.repositorio.clear();\n }", "static void refreshFileSystem() {\n \t// Clear all existing registrations on the server via CORBA for this username\n server.clearSharedFiles(username);\n server.clearNotSharedFiles(username);\n // Register the files on the server through CORBA that have been added to the directories manually\n server.registerFiles(username);\n System.out.println();\n return;\n }", "public void remove(){\n Api.worldRemover(getWorld().getWorldFolder());\n }", "public CompletableFuture<CleanupRepositoryResponse> cleanupRepository(CleanupRepositoryRequest request)\n\t\t\tthrows IOException {\n\t\treturn this.transport.performRequestAsync(request, CleanupRepositoryRequest.ENDPOINT, this.requestOptions);\n\t}", "public void clear() {\n root = null;\n }", "public void clear() {\n root = null;\n }", "public void resetStore() {\n try {\n db.close();\n uncommited = null;\n uncommitedDeletes = null;\n autoCommit = true;\n bloom = new BloomFilter();\n utxoCache = new LRUCache(openOutCache, 0.75f);\n } catch (IOException e) {\n log.error(\"Exception in resetStore.\", e);\n }\n\n File f = new File(filename);\n if (f.isDirectory()) {\n for (File c : f.listFiles())\n c.delete();\n }\n openDB();\n }", "public Path getRepositoryBaseDir();", "@Override\n public void clear() {\n root = null;\n }", "public void clearNewPaths() {\n this.newPaths = new MazeArray<>();\n }", "@Override\n public void clear() {\n size = 0;\n root = null;\n }", "private void initRootDirectoryFromCopy(WorkUnit workUnit) throws IOException, InterruptedException {\n\n\n if (!workUnit.commandManager.isFirstAttemptMigration()) {\n\n MigrationHistory history = historyMgr.startStep(workUnit.migration, StepEnum.SVN_COPY_ROOT_FOLDER,\n (workUnit.commandManager.isFirstAttemptMigration() ? \"\" : Constants.REEXECUTION_SKIPPING) +\n \"Initialising Root Directory from Copy in context of migration reexecution.\");\n\n // The clean copy folder is used to reinitialise the workUnit.root Folder\n String gitCommand = \"\";\n if (isWindows) {\n // /J Copy using unbuffered I/O. Recommended for very large files.\n gitCommand = format(\"Xcopy /E /I /H /Q %s_copy %s\", workUnit.root, workUnit.root);\n } else {\n // cp -a /source/. /dest/ (\"-a\" is recursive \".\" means files and folders including hidden)\n // root has no trailling / e.g. folder_12345\n gitCommand = format(\"cp -a %s_copy %s\", workUnit.root, workUnit.root);\n }\n execCommand(workUnit.commandManager, Shell.formatDirectory(applicationProperties.work.directory), gitCommand);\n\n // git reset incase a deployment has changed permissions\n // deployment of application seems to change files from 644 to 755 which is not desired.\n gitCommand = \"git reset --hard HEAD\";\n execCommand(workUnit.commandManager, workUnit.directory, gitCommand);\n\n historyMgr.endStep(history, StatusEnum.DONE, null);\n }\n\n }", "public static void clearWorld() {\r\n \tbabies.clear();\r\n \tpopulation.clear();\r\n }", "@Test\n\tpublic void createRepo() throws NoFilepatternException, GitAPIException, IOException {\n\t\t\n\t\t\n\t\tFile baseDir = Files.createTempDir(\"gitrepo\");\n\t\tFile gitDir = new File(baseDir, \".git\");\n\n\t\tRepository repo = new FileRepositoryBuilder().setGitDir(gitDir).setWorkTree(baseDir).build();\n\t\trepo.create();\n\n\t\tGit git = new Git(repo);\n\n\t\tFiles.write(\"Nothing\", new File(baseDir,\"my.sample\"));\n\t\t\n\t\tgit.add().addFilepattern(\"*.sample\").call();\n\t\tgit.commit().setMessage(\"first commit\").call();\n\t\t\n\t\tgit.branchCreate().setName(\"new-branch\").call();\n\t\tgit.checkout().setName(\"new-branch\").call();\n\t\t\n\t\tList<Ref> branches = git.branchList().call();\n\t\t\n\t\tSystem.out.println(\"Branches: \"+branches);\n\t\t\n\t\tAssert.assertTrue(\"clean up\",Files.deleteAll(baseDir));\n\t}", "@SuppressWarnings(\"ResultOfMethodCallIgnored\")\n\tpublic static void cleanAgentCoverageDirectory() throws IOException {\n\t\tPath coverageDir = AgentUtils.getAgentDirectory().resolve(\"coverage\");\n\t\tif (Files.exists(coverageDir)) {\n\t\t\tFiles.list(coverageDir).forEach(path -> path.toFile().delete());\n\t\t\tFiles.delete(coverageDir);\n\t\t}\n\t}", "@Override\r\n public void clear(){\r\n root = null;\r\n }", "@Override\n public void clear() {\n root = null;\n size = 0;\n }", "@Override\n public void clear() {\n root = null;\n size = 0;\n }", "@Override\n public void clear() {\n root = null;\n size = 0;\n }", "private void initializeRepositories() throws IOException {\n String user = ACMConfiguration.getInstance().getUserName();\n LOG.info(String.format(\n \" Home directory: %s\\n\" +\n \" Content repository: %s\\n\" +\n \" Temp Database: %s\\n\" +\n \" Temp Repository (sandbox mode): %s\\n\" +\n \" user: %s\\n\" +\n \" UserRWAccess: %s\\n\" +\n \" online: %s\\n\",\n getProgramHomeDir(),\n getProgramContentDir(),\n getLocalTempDbDir(),\n pathsProvider.getSandboxDir(),\n user,\n Authenticator.getInstance().hasUpdatingRole(),\n AccessControl.isOnline()));\n\n repository = AudioItemRepositoryImpl.buildAudioItemRepository(this);\n }", "public void clear() {\n allDependenciesModificationStamp = -2;\n }", "private static void clear() {\n Context context = Leanplum.getContext();\n if (context != null) {\n SharedPreferences.Editor editor = context.getSharedPreferences(\n \"__leanplum__\", Context.MODE_PRIVATE).edit();\n if (editor != null) {\n editor.clear();\n editor.apply();\n }\n\n editor = context.getSharedPreferences(\"__leanplum_push__\", Context.MODE_PRIVATE).edit();\n if (editor != null) {\n editor.clear();\n editor.apply();\n }\n }\n }", "public void clear() {\n\t\troot = null;\n\t\tcount = 0;\n\t}", "public void reset() {\n\t\tVector2 gravity = new Vector2(world.getGravity() );\n\t\t\n\t\tfor(Obstacle obj : objects) {\n\t\t\tobj.deactivatePhysics(world);\n\t\t}\n\t\tobjects.clear();\n\t\taddQueue.clear();\n\t\tworld.dispose();\n\t\t\n\t\tworld = new World(gravity,false);\n\t\tsetComplete(false);\n\t\tsetFailure(false);\n\t\tpopulateLevel();\n\t}", "private void populateRepositories() throws Exception {\n\t\t\n\t\t// Cleaning Repositories\n\t\trepositories.clear();\n\n\t\t// Validating that RepositoryAdmin exists\n\t\tValidate.notNull(getRepositoryAdmin(), \"RepositoryAdmin not found\");\n\t\t\n\t\t// Checking if exists installed Repos and adding to repositories\n\t\tEnumeration persistedRepos = installedRepos.keys();\n\t\twhile(persistedRepos.hasMoreElements()){\n\t\t\tString repositoryURL = (String) persistedRepos.nextElement();\n\t\t\t// Checking if is a valid URL\n\t\t\tif(repositoryURL.startsWith(\"http\") || repositoryURL.startsWith(\"file\")){\n\t\t\t\t// Installing persisted repositories \n\t\t\t\tgetRepositoryAdmin().addRepository(repositoryURL);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (Repository repo : getRepositoryAdmin().listRepositories()) {\n\t\t\trepositories.add(repo);\n\t\t}\n\t}", "public Builder clearWorkingDirectory() {\n\n workingDirectory_ = getDefaultInstance().getWorkingDirectory();\n onChanged();\n return this;\n }", "@Override\n public void clear()\n {\n explore(null);\n }", "private static void processRepository(File repo) {\n System.out.println(\"Processing repository: \" + repo);\n for (File fileOrDir : repo.listFiles()) {\n if (fileOrDir.isDirectory()) {\n processModule(fileOrDir);\n }\n }\n }", "public void reset(Topology editionClone) throws IOException {\n this.topology = editionClone;\n this.toscaContext = new ToscaContext.Context(topology.getDependencies());\n this.archiveContentTree = DirectoryJSonWalker.getDirectoryTree(this.localGitPath);\n }", "@Override\n\tpublic void clear() {\n\t\tsize = 0;\n\t\troot = null;\n\t}", "public void clear() {\r\n\t\troot = null;\r\n\t\tsize = 0;\r\n\t}", "private void fullBuild() throws CoreException {\n \t\ttry {\n \t\t\tIFolder sortedFolder = getSortedFolder();\n \t\t\tIFolder unsortedFolder = getUnsortedFolder();\n \n \t\t\tif (sortedFolder.exists()) {\n \t\t\t\t//delete all sorted files\n \t\t\t\tIResource[] members = sortedFolder.members();\n \t\t\t\tfor (int i = 0; i < members.length; i++) {\n \t\t\t\t\tdeleteResource(members[i]);\n \t\t\t\t}\n \t\t\t}\n \n \t\t\tif (unsortedFolder.exists()) {\n \t\t\t\tfullBuild(unsortedFolder);\n \t\t\t}\n \t\t} catch (Exception e) {\n \t\t\tthrow new ResourceException(IResourceStatus.BUILD_FAILED, null, \"Sort builder failed\", e);\n \t\t}\n \t}", "private void clearGenesis() {\n bitField0_ = (bitField0_ & ~0x00000001);\n genesis_ = getDefaultInstance().getGenesis();\n }", "public void clearVersionHistoryPanel()\n\t{\n\t\t// Clear text area\n\t\ttextAreaVersions.setText(\"\");\n\t}", "private static void deleteEmptyParentDirs(Path pkgDirPath, Path repoPath) throws IOException {\n Path pathsInBetween = repoPath.relativize(pkgDirPath);\n for (int i = pathsInBetween.getNameCount(); i > 0; i--) {\n Path toRemove = repoPath.resolve(pathsInBetween.subpath(0, i));\n if (!Files.list(toRemove).findAny().isPresent()) {\n Files.delete(toRemove);\n }\n }\n }", "@Override\n protected void setUp() throws Exception {\n baseDirectory = new File(TEST_DIR_NAME);\n assertTrue(ConnectorTestUtils.deleteAllFiles(baseDirectory));\n // Then recreate it empty\n assertTrue(baseDirectory.mkdirs());\n }", "public synchronized void clearResources()\r\n {\r\n // create a new root, making old tree eligible for GCing\r\n createRootNode();\r\n\r\n // clear all registered objects\r\n unRegisterAll();\r\n }", "public void doFullPush( File siteDir ) throws IOException{\n clearDirectories();\n makeRemoteDir( root );\n publish( siteDir, false, null );\n }", "public void reset(){\n\t\tBashCmdUtil.bashCmdNoOutput(\"rm -r data/games_module\");\n\t\tBashCmdUtil.bashCmdNoOutput(\"sed -i \\\"1s/.*/ \"+\"0\"+\" /\\\" data/winnings\");\n\t\tBashCmdUtil.bashCmdNoOutput(\"sed -i \\\"1s/.*/ \"+\"175\"+\" /\\\" data/tts_speed\");\n\t\tBashCmdUtil.bashCmdNoOutput(\"rm data/answered_questions\");\n\t\tBashCmdUtil.bashCmdNoOutput(\"rm data/five_random_categories\");\n\t\tBashCmdUtil.bashCmdNoOutput(\"rm data/current_player\");\n\t\t_currentPlayer = null;\n\t\t_internationalUnlocked = false;\n\t\t_gamesData.clear();\n\t\t_fiveRandomCategories.clear();\n\t\tfor (int i= 0; i<5;i++) {\n\t\t\t_answeredQuestions[i]=0;\n\t\t}\n\t\tBashCmdUtil.bashCmdNoOutput(\"touch data/answered_questions\");\n\t\tinitialiseCategories();\n\t\ttry {\n\t\t\treadCategories();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tsetFiveRandomCategories();\n\t}", "@ManagedOperation(description = \"Reset and reloads the file store\")\n public synchronized void reset() throws IOException {\n synchronized (cache) {\n // trunk and clear, before we reload the store\n trunkStore();\n cache.clear();\n loadStore();\n }\n }", "private Step deleteLocalWorkingDir() {\n return stepBuilderFactory.get(STEP_DELETE_LOCAL_WORK_DIR)\n .tasklet(deleteLocalWorkingDir)\n .build();\n }", "public void makeEmpty(){\n deleteAll(root);\n root = null;\n numItems = 0;\n }", "public void clear() {\n\t\tthis.root = new Node();\n\t}", "void reset(boolean hard) throws GitException, InterruptedException;", "void clearAll();", "void clearAll();", "@Override\r\n\tpublic void clearAll() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void clearAll() {\n\t\t\r\n\t}" ]
[ "0.58742905", "0.5775248", "0.57573754", "0.5342745", "0.5247495", "0.51191086", "0.50585777", "0.50507015", "0.50391287", "0.5026639", "0.50256956", "0.49561208", "0.49105874", "0.48951545", "0.48770857", "0.48742235", "0.4823234", "0.48083678", "0.47898403", "0.47878194", "0.477986", "0.47752205", "0.47506264", "0.4732441", "0.47196645", "0.4715698", "0.47135618", "0.47103366", "0.47076797", "0.4701643", "0.46984753", "0.4687233", "0.4677461", "0.46594355", "0.46152282", "0.46039462", "0.45629272", "0.45585427", "0.45569056", "0.4556769", "0.45459592", "0.453765", "0.45368457", "0.4529907", "0.45015448", "0.44980183", "0.4482559", "0.44809845", "0.4478642", "0.44786298", "0.44786298", "0.4471934", "0.44708765", "0.44698033", "0.4467203", "0.44586265", "0.44568384", "0.44568384", "0.44476402", "0.44467", "0.44250834", "0.44117892", "0.4406561", "0.4404743", "0.44035548", "0.44034594", "0.44030666", "0.4399809", "0.43997458", "0.43997458", "0.43997458", "0.4395895", "0.4392911", "0.43750063", "0.4371549", "0.43712682", "0.43538404", "0.43481547", "0.43473452", "0.4344502", "0.43391278", "0.433583", "0.4334064", "0.43317947", "0.43300495", "0.43291458", "0.43276712", "0.4327166", "0.43261218", "0.43260086", "0.43240476", "0.4323778", "0.43229124", "0.43219033", "0.43169194", "0.43136168", "0.43038237", "0.43038237", "0.42994845", "0.42994845" ]
0.7102041
0
Returns the total number of bots of a given class.
int getNumberOfBots( String className ) { Integer number = m_botTypes.get( className ); if( number == null ) { return 0; } else { return number.intValue(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getBotCount(String className) {\n Integer currentBotCount = m_botTypes.get( className.toLowerCase() );\n\n if( currentBotCount == null ) {\n currentBotCount = new Integer( 0 );\n m_botTypes.put( className.toLowerCase(), currentBotCount );\n }\n\n return currentBotCount;\n }", "int getTotalBotCount() {\n int t = 0;\n\n for (Integer i : m_botTypes.values())\n t += i;\n\n return t;\n }", "public static Integer getBotWins() {\n return humanVsBot.OWins + botVsHuman.XWins;\n }", "public int numberOfBoats(){\n return this.boats.size();\n }", "public int getCantidadRobots();", "public int getNumberOfClasses() {\n return 200;\n }", "public int getNumOfClasses();", "private int calculateTotalHeads() { //kept a separate method with a specific purpose instead of writing code in main\n\t\t//no need to static method, althouth static won't hurt in such a small code\n\t\tint headsCount = 0;\n\t\tfor (int currentCoinNo = 1; currentCoinNo <= noCoins; currentCoinNo++) { \n\t\t\tif(isHead(currentCoinNo)) {\n\t\t\t\theadsCount++;\n\t\t\t}\n\t\t}\n\t\treturn headsCount;\n\t}", "public int getNumRobots() {\n return ((Integer)numRobotsSpinner.getValue()).intValue();\n }", "public int getBottles() {\n return totalBottles;\n }", "int getTrucksCount();", "int getResponsesCount();", "int getAchievementsCount();", "public int countBoats() {\r\n\t\treturn boats.size();\r\n\t}", "int getStatsCount();", "int getStatsCount();", "int getStatsCount();", "public long getVehicleCount() {\n return send(\"\", HttpMethod.GET, VEHICLES_GET_URL, Map.of(), Long.class);\n }", "int getFriendCount();", "int getFriendCount();", "public int totalGames() {\n return wins + losses + draws;\n }", "void addToBotCount( String className, int valueToAdd ) {\n Integer newBotCount;\n Integer oldBotCount;\n\n oldBotCount = m_botTypes.get( className );\n\n if( oldBotCount != null ) {\n if( oldBotCount.intValue() + valueToAdd >= 0 ) {\n newBotCount = new Integer( oldBotCount.intValue() + valueToAdd );\n m_botTypes.put( className, newBotCount );\n }\n }\n }", "int getPeerCount();", "public int getAgentsCount() {\n if (agentsBuilder_ == null) {\n return agents_.size();\n } else {\n return agentsBuilder_.getCount();\n }\n }", "public int countNumberClientsTotal() {\n\t\tint counter = 0;\n\t\tfor(int number : numberClients.values())\n\t\t\tcounter += number;\n\t\treturn counter;\n\t}", "public int getBallsCount() {\n return balls.size();\n }", "int getNumberOfGuests();", "@com.guidewire.pl.persistence.codegen.annotation.OverridesAccessor\n @gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Integer getTotalNumChecks() {\n return ((com.guidewire.pl.domain.database.DBConsistCheckRunPublicMethods)__getDelegateManager().getImplementation(\"com.guidewire.pl.domain.database.DBConsistCheckRunPublicMethods\")).getTotalNumChecks();\n }", "@com.guidewire.pl.persistence.codegen.annotation.OverridesAccessor\n @gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Integer getTotalNumChecks() {\n return ((com.guidewire.pl.domain.database.DBConsistCheckRunPublicMethods)__getDelegateManager().getImplementation(\"com.guidewire.pl.domain.database.DBConsistCheckRunPublicMethods\")).getTotalNumChecks();\n }", "@Override\n\tpublic int queryCount() {\n\t\treturn (int) tBasUnitClassRepository.count();\n\t}", "private int[] countClasses(List<Instance> instances){\r\n\t\tint[] counters = new int[classes.size()];\r\n\t\tfor(Instance ins : instances){\r\n\r\n\t\t\tfor(String str : classes){\r\n\t\t\t\tif(ins.getClassAttribute().equals(str)){\r\n\t\t\t\t\tcounters[classes.indexOf(str)]++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\r\n\t\treturn counters;\r\n\t}", "public static int countSentBytes(\n\t Class<? extends TrackedMessage> messageClassType) {\n\treturn TrackedMessage.countSentBytes(messageClassType, -1);\n }", "int getParticipantsCount();", "int getParticipantsCount();", "private void _updateCount(int classType) {\n int subClass, superClass;\n\n instances_[classType].count++;\n subClass = classType;\n while ( (superClass = CLASS_INFO[subClass][INDEX_SUPER]) != CS_C_NULL) {\n instances_[superClass].count++;\n subClass = superClass;\n }\n }", "public static int countSentBytes() {\n\tint sum = 0;\n\n\tfor (Class<? extends TrackedMessage> messageClassType : TrackedMessage.messagesSent\n\t\t.keySet())\n\t sum += TrackedMessage.countSentBytes(messageClassType);\n\n\treturn sum;\n }", "Long getAllCount();", "int getDonatoriCount();", "public static int countSentMessages() {\n\tint sum = 0;\n\n\tfor (Class<? extends TrackedMessage> messageClassType : TrackedMessage.messagesSent\n\t\t.keySet())\n\t sum += TrackedMessage.countSentMessages(messageClassType);\n\n\treturn sum;\n }", "public int NumOfGames()\n\t{\n\t\treturn gametype.length;\n\t}", "int getUsersCount();", "int getUsersCount();", "int getUsersCount();", "public int countPlayers(){\n return players.size();\n }", "public static int countSentMessages(\n\t Class<? extends TrackedMessage> messageClassType)\n\t throws NullPointerException {\n\treturn TrackedMessage.countSentMessages(messageClassType, -1);\n }", "public static int getClassSize(Class<?> clazz) {\n if(clazz.equals(long.class) || clazz.equals(double.class)) {\n return 2;\n } else {\n return 1;\n }\n }", "private int getGoodsCount(GoodsType type) {\n return colony.getGoodsCount(type);\n }", "public int getGoalsCount() {\n if (goalsBuilder_ == null) {\n return goals_.size();\n } else {\n return goalsBuilder_.getCount();\n }\n }", "public int getTrucksCount() {\n if (trucksBuilder_ == null) {\n return trucks_.size();\n } else {\n return trucksBuilder_.getCount();\n }\n }", "public int getNumberOfBeds() {\n\t\tint total;\n\t\ttotal = getNbrOfBeds()[0] + getNbrOfBeds()[1] + getNbrOfBeds()[2];\n\t\treturn total;\n\t}", "public int numberOfBalls() {\n return 10;\n }", "int getQuestCount();", "public int getTotalOfwins() {\n return statistics.get(TypeOfGames.SIMGAME).getNumberOfWins()\n + statistics.get(TypeOfGames.EASYCOMPUTERGAME).getNumberOfWins()\n + statistics.get(TypeOfGames.HARDCOMPUTERGAME).getNumberOfWins();\n }", "int getPeersCount();", "public static int countReceivedMessages(\n\t Class<? extends TrackedMessage> messageClassType) {\n\treturn TrackedMessage.countReceivedMessages(messageClassType, -1);\n }", "@Override\n public Long getNumberOfWalkers() {\n return walkerRepo.countById();\n }", "int getUserQuestJobsCount();", "public int count() {\n\t Query count = getEntityManager().createQuery(\"select count(u) from \" + getEntityClass().getSimpleName() + \" u\");\n\t return Integer.parseInt(count.getSingleResult().toString());\n\t }", "public int numberOfBalls() {\r\n return 3;\r\n }", "int numberOfBalls();", "public int getNumWins() {\n\t\treturn this.numWins;\n\t}", "@Override\n public int getTotalHumanPlayers() {\n return totalHumanPlayers;\n }", "public int getNumberOfAgents()\n {\n return this.numberOfAgents;\n }", "@Override\r\n\tpublic int getTotalCount(Class<T> type) {\n\t\treturn (int) super.getSessionFactory().getCurrentSession().createQuery(\"select count(1) as num from \"+\r\n\t\t\t\ttype.getName()+\"\").uniqueResult();\r\n\t}", "@Override\r\n\tpublic int totalCount() {\n\t\treturn sqlSession.selectOne(namespace + \".totalCount\");\r\n\t}", "@Override\r\n\tpublic int totalCount() {\n\t\treturn sqlSession.selectOne(namespace + \".totalCount\");\r\n\t}", "public int getTotalOfGames() {\n return statistics.get(TypeOfGames.SIMGAME).getNumberOfGames()\n + statistics.get(TypeOfGames.EASYCOMPUTERGAME).getNumberOfGames()\n + statistics.get(TypeOfGames.HARDCOMPUTERGAME).getNumberOfGames();\n }", "public int numPlayers(){\n return this.members.size();\n }", "int findAllCount() ;", "int getNumOfBuyOrders();", "public int playerCount()\r\n\t{\r\n\t\tint count = 0;\r\n\t\tfor(Player player: this.players)\r\n\t\t{\r\n\t\t\tif(player != null)\r\n\t\t\t{\r\n\t\t\t\t++count;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t}", "int getSuperClassesCount();", "int getTruckstatusCount();", "@Override\n\tpublic long countchitietdonhang() {\n\t\treturn chiTietDonHangRepository.countchitietdonhang();\n\t}", "private int numeroCuentas() {\r\n\t\tint cuentasCreadas = 0;\r\n\t\tfor (Cuenta cuenta : this.cuentas) {\r\n\t\t\tif (cuenta != null) {\r\n\t\t\t\tcuentasCreadas++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn cuentasCreadas;\r\n\t}", "public static int countReceivedBytes() {\n\tint sum = 0;\n\n\tfor (Class<? extends TrackedMessage> messageClassType : TrackedMessage.messagesSent\n\t\t.keySet())\n\t sum += TrackedMessage.countSentBytes(messageClassType);\n\n\treturn sum;\n }", "@SuppressWarnings(\"rawtypes\")\n\tpublic Long countHL7s(Class clazz, Integer messageState, String query);", "public int getCount() {\n\t\treturn Dispatch.get(object, \"Count\").getInt();\n\t}", "public int size(String label){\n\t\treturn classIndex(label).size();\n\t}", "public int getHats() {\n return totalHats;\n }", "public int getResponsesCount() {\n if (responsesBuilder_ == null) {\n return responses_.size();\n } else {\n return responsesBuilder_.getCount();\n }\n }", "@Override\r\n\tpublic int count(int bno) {\n\t\treturn replyDAO.count(bno);\r\n\t}", "@Override\n\tpublic int countAll() {\n\t\tLong count = (Long)finderCache.getResult(FINDER_PATH_COUNT_ALL,\n\t\t\t\tFINDER_ARGS_EMPTY, this);\n\n\t\tif (count == null) {\n\t\t\tSession session = null;\n\n\t\t\ttry {\n\t\t\t\tsession = openSession();\n\n\t\t\t\tQuery q = session.createQuery(_SQL_COUNT_USERSTATISTICS);\n\n\t\t\t\tcount = (Long)q.uniqueResult();\n\n\t\t\t\tfinderCache.putResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY,\n\t\t\t\t\tcount);\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tfinderCache.removeResult(FINDER_PATH_COUNT_ALL,\n\t\t\t\t\tFINDER_ARGS_EMPTY);\n\n\t\t\t\tthrow processException(e);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tcloseSession(session);\n\t\t\t}\n\t\t}\n\n\t\treturn count.intValue();\n\t}", "public Integer getCount(Class<?> type) {\n return events.containsKey(type) ? events.get(type).size() : 0;\n }", "public int nrOfPlayers() {\n int playerCount = 0;\n for (Player player : players) {\n if (player.getName() != null) {\n playerCount++;\n }\n }\n\n return playerCount;\n }", "public int getNumOfBoats() {\n\t\treturn numOfBoats;\n\t}", "@Override\n\tpublic int getTotalCount(Chatting chatting) {\n\t\treturn 0;\n\t}", "public int getTotalMessageCount(){\n Query query = new Query(\"Message\");\n Query query2 = new Query(\"Question\");\n PreparedQuery results = datastore.prepare(query);\n PreparedQuery results2 = datastore.prepare(query2);\n return results.countEntities(FetchOptions.Builder.withLimit(1000)) + results2.countEntities(FetchOptions.Builder.withLimit(1000));\n}", "public int getWallItemsCount(String userUuid);", "public int getMembreCount() {\n try {\n// CriteriaQuery cq = entManager.getCriteriaBuilder().createQuery();\n// Root<Membre> rt = cq.from(Membre.class);\n// cq.select(entManager.getCriteriaBuilder().count(rt));\n// Query q = entManager.createQuery(cq);\n// return ((Long) q.getSingleResult()).intValue();\n \n Query q = entManager.createNamedQuery(\"Membre.findAll\");\n return q.getResultList().size();\n \n } finally {\n// em.close();\n }\n }", "int getChannelStatisticsCount();", "@Override\r\n\tpublic int count(Integer bno) {\n\t\treturn replyMapper.count(bno); \r\n\t}", "public int getUserCount() {\n return instance.getUserCount();\n }", "public int countAll(Class<?> c) throws RNoEntityException{\n\t\tEntity e = ALiteOrmBuilder.getInstance().getEntity(c);\n\t\tif(e == null)\n\t\t\tthrow new RNoEntityException(\"For : \" + c.getName());\n\t\treturn e.countAll(db);\n\t}", "public int getBalls() {\n return totalBalls;\n }", "int getRequestsCount();", "int getRequestsCount();", "long getRequestsCount();", "public static Integer getHumanWins() {\n return humanVsBot.XWins + botVsHuman.OWins;\n }", "public static int countReceivedMessages() {\n\tint sum = 0;\n\n\tfor (Class<? extends TrackedMessage> messageClassType : TrackedMessage.messagesSent\n\t\t.keySet())\n\t sum += TrackedMessage.countReceivedMessages(messageClassType);\n\n\treturn sum;\n }" ]
[ "0.753537", "0.73746854", "0.5971059", "0.57545614", "0.57348984", "0.5719084", "0.57058936", "0.5664923", "0.5596776", "0.55594325", "0.5555599", "0.55479145", "0.554403", "0.55060005", "0.54924667", "0.54924667", "0.54924667", "0.54872906", "0.54778594", "0.54778594", "0.547719", "0.54770523", "0.5472686", "0.54516894", "0.54511184", "0.5430882", "0.5427215", "0.5417095", "0.54097164", "0.54050344", "0.53660184", "0.5364985", "0.53598195", "0.53598195", "0.53501064", "0.53485245", "0.53347653", "0.5310448", "0.53008467", "0.5298456", "0.5295728", "0.5295728", "0.5295728", "0.52924424", "0.52881074", "0.52810526", "0.5279555", "0.52732813", "0.52641755", "0.5251099", "0.52502096", "0.524839", "0.52460426", "0.5229178", "0.5227802", "0.5222633", "0.52208847", "0.5219059", "0.5212059", "0.52078724", "0.5207748", "0.5202828", "0.52008605", "0.51971954", "0.5196136", "0.5196136", "0.51942474", "0.519234", "0.5191838", "0.5190859", "0.5188559", "0.5185432", "0.51829004", "0.517324", "0.5172822", "0.51689786", "0.5158774", "0.51523215", "0.5150302", "0.5150262", "0.5149572", "0.51362616", "0.5125552", "0.5125154", "0.51232713", "0.512249", "0.51216096", "0.51215994", "0.51208365", "0.51206094", "0.511974", "0.5117545", "0.511638", "0.51161355", "0.51153165", "0.51146615", "0.51146615", "0.5111819", "0.51106906", "0.51025754" ]
0.7886265
0
Displays the contents of the current bot spawning queue in PM to the specified player.
void listWaitingList( String messager ) { int i; ChildBot bot; ListIterator<ChildBot> iterator; m_botAction.sendSmartPrivateMessage( messager, "Waiting list:" ); for( iterator = m_spawnQueue.listIterator(), i = 1; iterator.hasNext(); i++ ) { bot = iterator.next(); m_botAction.sendSmartPrivateMessage( messager, i + ": " + bot.getBot().getBotName() + ", created by " + bot.getCreator() + "." ); } m_botAction.sendSmartPrivateMessage( messager, "End of list" ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String gotoQueue() {\n\t\tselectedPlaylist = PlaylistMng.QUEUE_NAME;\n\t\tpassivePlaylist = playlistMng.getPlaylist(PlaylistMng.QUEUE_NAME);\n\t\treturn \"queue\";\n\t}", "public static void display() {\n System.out.println();\t \n System.out.println(\"Contents of the queue are: \" + queue);\n }", "@Override\r\n\tpublic void showDoTimeMessage(Player player) {\n\t}", "public static void displayWelcomeMessage(Player player) {\r\n\t\t\r\n\t\t//Insert Blank lines to clear previous chat from other servers\r\n\t\t//or the players last session.\r\n\t\tplayer.sendMessage(\"\");\r\n\t\tplayer.sendMessage(\"\");\r\n\t\tplayer.sendMessage(\"\");\r\n\t\tplayer.sendMessage(\"\");\r\n\t\tplayer.sendMessage(\"\");\r\n\t\tplayer.sendMessage(\"\");\r\n\t\tplayer.sendMessage(\"\");\r\n\t\tplayer.sendMessage(\"\");\r\n\t\tplayer.sendMessage(\"\");\r\n\t\tplayer.sendMessage(\"\");\r\n\t\tplayer.sendMessage(\"\");\r\n\t\tplayer.sendMessage(\"\");\r\n\t\tplayer.sendMessage(\"\");\r\n\t\tplayer.sendMessage(\"\");\r\n\t\t\r\n\t\tString welcomeMessage = \" \\n\" + \" \\n\" + ChatColor.GOLD + \" \" + ChatColor.BOLD \r\n\t\t\t\t+ \"MinePile: \" + ChatColor.WHITE + \"\" + ChatColor.BOLD + \"RPGMMO \" + plugin.getPluginVersion() + \" \\n\" + \r\n\t\t\t\tChatColor.RESET + ChatColor.GRAY + \" http://www.MinePile.com/\" + \" \\n\" + \r\n\t\t\t\t\" \\n\" + \" \\n\";\r\n\t\tplayer.sendMessage(welcomeMessage);\r\n\t}", "public void display (Player player) {\n player.setScoreboard(this.bukkitScoreboard);\n }", "private void displayPlayerMenu () {\n System.out.println();\n System.out.println(\"Player Selection Menu:\");\n System.out.println(\n \"Timid player...........\" + TIMID);\n System.out.println(\n \"Greedy player..........\" + GREEDY);\n System.out.println(\n \"Clever player..........\" + CLEVER);\n System.out.println(\n \"Interactive player.....\" + INTERACTIVE);\n }", "private void sendMatchEmbed(MatchStats matchStats, MessageChannel channel) {\n\n MessageEmbed matchEmbed = buildMatchEmbed(matchStats);\n MessageAction sendMessage = channel.sendMessage(matchEmbed).setActionRows(getButtons(defaultButtonId, matchStats));\n MatchPlayer player = matchStats.getMainPlayer();\n Consumer<Message> callback = message -> matchMessages.put(message.getIdLong(), matchStats);\n\n if(player.hasLoadouts()) {\n player.setLoadoutImage(buildLoadoutImage(player.getLoadouts()));\n\n /*\n * Setting the attached loadout image file as the embed footer icon prevents it from displaying as\n * a separate message.\n * When viewing the loadout embed, both the embed footer icon & embed image can use the file.\n */\n sendMessage.addFile(player.getLoadoutImage(), \"image.png\").queue(callback);\n return;\n }\n sendMessage.queue(callback);\n }", "@Override\n public void show() {\n mHandler.obtainMessage(0).sendToTarget();\n }", "@Override\r\n\tpublic void showGetPrisonCardMessage(Player player) {\n\t\t\r\n\t}", "public void cmdShowPlayer(User teller, Player player) {\n Formatter msg = new Formatter();\n Integer rating = player.ratings().get(USCL_RATING);\n String ratingStr = (rating == null || rating < 0) ? \"Unavailable\" : rating.toString();\n msg.format(\" Player %s:\\\\n\", player);\n msg.format(\" %6s: %s\\\\n\", \"Name\", player.getRealName());\n msg.format(\" %6s: %s\\\\n\", \"Title\", player.getTitles());\n msg.format(\" %6s: %s\\\\n\", \"Rating\", ratingStr);\n msg.format(\" %6s: %s\\\\n\", \"Team\", player.getTeam());\n msg.format(\" %6s: %s\\\\n\", \"Web\", player.getWebsite());\n command.qtell(teller, msg);\n }", "public void showDetails (Player player) {\r\n\t\tString \tc\t= Term.COLOR_INACTIVE.get();\r\n\t\t\r\n\t\t// Get the color\r\n\t\tif (getActivity() == Activity.SELL\t\t&& isActive())\r\n\t\t\tc\t= Term.COLOR_SELL.get();\r\n\t\t\r\n\t\telse if (getActivity() == Activity.BUY\t\t&& isActive())\r\n\t\t\tc\t= Term.COLOR_BUY.get();\r\n\t\t\r\n\t\telse if (getActivity() == Activity.EXCHANGE\t&& isActive())\r\n\t\t\tc\t= Term.COLOR_EXCHANGE.get();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tList<String>\tmessage\t= new ArrayList<String>();\r\n\t\t\t\t\t\tmessage.add(Term.INFO_1.get() + c + getActivity().toString() \t+ Term.INFO_2.get() + c +scs.formatCurrency(getPrice())\t\t+ Term.INFO_9.get() + c + getOwner());\r\n\t\t\r\n\t\tString \ttext\t= null;\r\n\t\tString\tname\t= getItemName();\r\n\t\t\r\n\t\tif (!isUnlimited()) {\r\n\t\t\tif (getActivity() == Activity.BUY)\r\n\t\t\t\ttext = getAmount()+ \"/\" + getMaxAmount();\r\n\t\t\telse\r\n\t\t\t\ttext = \"\" + getAmount();\r\n\t\t} else {\r\n\t\t\ttext = Term.INFO_UNLIMITED.get();\r\n\t\t}\r\n\t\t\r\n\t\tif (getItemStack().getType() == Material.WRITTEN_BOOK)\r\n\t\t\tname = getNBTStorage().getBookTitle();\r\n\t\t\r\n\t\tmessage.add(Term.INFO_4.get() + c + name\t\t\t\t+ Term.INFO_3.get() + c + text);\r\n//\t\t\t\t\t\tmessage.add(Term.INFO_4.get() + c + getItemName()\t\t\t\t+ Term.INFO_3.get() + c + (!isUnlimited() ? (getActivity() == Activity.BUY ? getMaxAmount() : getAmount()) : Term.INFO_UNLIMITED.get()));\r\n\t\t\r\n\t\tStringBuffer\tbuffer \t= new StringBuffer();\r\n\t\tString\t\t\tdelim\t= \"\";\r\n\t\r\n\t\tfor (Enchantment en : getEnchantments().keySet()) {\r\n\t\t\tint lvl\t= getEnchantments().get(en);\r\n\t\t\t\r\n\t\t\tbuffer.append(delim + en.getName() + \" lvl \" + lvl);\r\n\t\t\tdelim\t= \", \";\r\n\t\t}\r\n\t\t\r\n\t\tif (buffer.toString().length() > 0)\r\n\t\t\tmessage.add(Term.INFO_8.get() + c + buffer.toString());\r\n\t\t\r\n\t\tif (player.hasPermission(Properties.permAdmin))\r\n\t\t\tmessage.add(c + getSHA1());\r\n\t\t\r\n\t\tMessaging.mlSend(player, message);\r\n\t}", "public void howToPlay() {\r\n // An item has been added to the ticket. Fire an event and let everyone know.\r\n System.out.println(\"Step 1: Have no life. \\nStep 2: Deal cards\\nStep 3: Cry yourself to sleep.\");\r\n }", "public void printDetailedPlayer(Player player);", "private void broadcast() {\n for (int key : bootstrapMap.keySet()) {\n bootstrapMap.get(key).getBroadcastView().show(Colors.BLUE + gameService.getCurrentPlayer().getName() + Colors.NOCOLOR, lastAnswer);\n }\n gameService.upDateCurrentPlayer();\n }", "@Override\n\tpublic void showContents() {\n\t\tprogram.add(background);\n\t\tprogram.add(topMatte);\n\t\tprogram.add(bottomMatte);\n\t\tprogram.add(stackLabel);\n\t\t\n\t\tprogram.add(basePurp);\n\t\tprogram.add(currPurp);\n\t\tbasePurp.sendToFront();\n\t\tfor (int i = 0; i < callStack; i++) {\n\t\t\tprogram.add(stackBricks[i]);\n\t\t}\n\n\t\tprogram.add(player.getImage());\n\t\tplayer.move(0, 0);\n\n\t\tAudioPlayer.getInstance().playSound(\"sounds\", \"LevelMusic.mp3\", true);\n\t\tif (portalLeft != null) {\n\t\t\tprogram.add(portalLeft.getImage());\n\t\t}\n\t\tif (portalRight != null) {\n\t\t\tprogram.add(portalRight.getImage());\n\t\t\tprogram.add(portalLabel);\n\t\t}\n\t\tif (next == null || next.payloadRetrieved) {\n\t\t\tprogram.add(payload.getImage());\n\t\t}\n\n\t\tArrayList<Payload> collectedPayload = player.getPayloads();\n\n\t\tprogram.add(psuedocode);\n\n\t\tfor (int i = 0; i < collectedPayload.size(); i++) {\n\t\t\tprogram.add(collectedPayload.get(i).getImage());\n\t\t\tpsuedocode.addRtnLong();\n\t\t}\n\t}", "public void sendUpdate() {\n int i = 1;\n\n Deque<ProxiedPlayer> removePlayers = new LinkedList<>();\n\n for (ProxiedPlayer player : playersQueue) {\n Server playerServer = player.getServer();\n\n // Player is not connected OR Player Server is not the Queue Server\n if (!player.isConnected() || !playerServer.getInfo().getName().equals(Config.queue)) {\n removePlayers.add(player);\n continue;\n }\n\n player.sendMessage(TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&', Config.messagePosition.replaceAll(\"%position%\", Integer.toString(i))) + \"§r\"));\n\n i++;\n }\n\n for (ProxiedPlayer player : removePlayers) {\n try {\n // Remove Player from the queue\n mutex.acquire();\n playersQueue.remove(player);\n\n Main.log(\"sendUpdate\", \"§3§b\" + player.toString() + \"§3 was removed from §b\" + Config.queue + \"§3 (wrong server or disconnected). Queue count is \" + playersQueue.size() + \".\");\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n mutex.release();\n }\n }\n }", "private String waitPrint(){return \"waiting for other players...\";}", "public void showMessages() {\n\t\tThread thread = new Thread(() -> {\r\n\t\t\ttry {\r\n\t\t\t\twhile (!isFinished) {\r\n\t\t\t\t\tbyte[] buffer = new byte[1000];\r\n\t\t\t\t\tDatagramPacket messageIn = new DatagramPacket(buffer, buffer.length, groupIp, port);\r\n\t\t\t\t\tmSocket.receive(messageIn);\r\n\t\t\t\t\tSystem.out.println(new String(messageIn.getData()).trim());\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tSystem.out.println(\"IO: \" + e.getMessage());\r\n\t\t\t}\r\n\t\t});\r\n\t\tthread.start();\r\n\t}", "public void printQueue();", "public void printProcessQueue()\n\t{\n\t\tProcesses.print();\n\t}", "public void print(CommandSender sender) {\n\n\t\tif (sender == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (message != null) {\n\t\t\tsend(sender, message);\n\t\t}\n\t}", "@Override\n public void onExecute(GenericExecutor sender, String[] args) {\n if (sender.getOriginal() instanceof ProxiedPlayer) {\n ProxiedPlayer player = (ProxiedPlayer) sender.getOriginal();\n\n CommandProxyPayload payload = new CommandProxyPayload();\n payload.setExecutor(player.getUniqueId());\n payload.setArgs(args);\n payload.setCommandProxy(CommandProxy.SHOW);\n\n OpenAudioMcBungee.getInstance().getNodeManager().getPacketManager().sendPacket(new PacketPlayer(player), new CommandProxyPacket(payload));\n }\n }", "public void sendCommands(PrintWriter out) {\r\n\t\tsendMessage(\"h: display command list\", out);\r\n\t\tsendMessage(\"t: display the album titles, ordered by date\",out);\r\n\t\tsendMessage(\"g: display songs of an album, ordered by genre\",out);\r\n\t\tsendMessage(\"d: display songs of an album\",out);\r\n\t\tsendMessage(\"u: display audiobooks ordered by author\",out);\r\n\t\tsendMessage(\"c: add a new song\",out);\r\n\t\tsendMessage(\"a: add a new album\",out);\r\n\t\tsendMessage(\"+: add a song to an album\",out);\r\n\t\tsendMessage(\"l: add a new audiobook\",out);\r\n\t\tsendMessage(\"p: create a new playlist from existing songs and audio books\",out);\r\n\t\tsendMessage(\"-: delete an existing playlist\",out);\r\n\t\tsendMessage(\"s: save elements, albums, playlists\",out);\r\n\t\tsendMessage(\"m: play a song\",out);\r\n\t}", "@Override\n public void run() {\n Handler temp = getHandler();\n Scanner scanner = temp.getScanner();\n temp.getGameServer().sendMsg(\"yek nafar ra entekhab konid :(tanha yek payam baraye Mafia) \" +\n temp.getGameServer().getNames().toString(), temp);\n String msg = scanner.nextLine().strip();\n temp.getGameServer().sendMsgToMafia(temp.getName() + \" : \" + msg, temp);\n System.out.println(msg + \"<------\" + toString());\n }", "public void sendMessage()\r\n {\r\n MessageScreen messageScreen = new MessageScreen(_lastMessageSent);\r\n pushScreen(messageScreen);\r\n }", "public void action() {\n MessageTemplate template = MessageTemplate.MatchPerformative(CommunicationHelper.GUI_MESSAGE);\n ACLMessage msg = myAgent.receive(template);\n\n if (msg != null) {\n\n /*-------- DISPLAYING MESSAGE -------*/\n try {\n\n String message = (String) msg.getContentObject();\n\n // TODO temporary\n if (message.equals(\"DistributorAgent - NEXT_SIMSTEP\")) {\n \tguiAgent.nextAutoSimStep();\n // wykorzystywane do sim GOD\n // startuje timer, zeby ten zrobil nextSimstep i statystyki\n // zaraz potem timer trzeba zatrzymac\n }\n\n guiAgent.displayMessage(message);\n\n } catch (UnreadableException e) {\n logger.error(this.guiAgent.getLocalName() + \" - UnreadableException \" + e.getMessage());\n }\n } else {\n\n block();\n }\n }", "@Override\n public void sendChatMessage(EntityPlayer player) {\n }", "@Override\n public void displayInventory(Player player)\n {\n Platform.runLater(() -> {\n InventoryDisplay inventory = gui.getInventory();\n inventory.displayInventory(player);\n });\n }", "private void showSpam(){\n getSpam();\n //display persons\n MainActivity.instance().displayPersonsRunnable = new DisplayPersonsRunnable(MainActivity.instance());\n this.thread = new Thread(MainActivity.instance().displayPersonsRunnable);\n this.thread.start();\n }", "@Override\n\tpublic void tellPlayer(String message) {\n\t\tSystem.out.println(message);\n\t}", "public void print()\n\t{\n\t\tif(gameObj[1].size() > 0)\n\t\t{\n\t\t\tSystem.out.println(\"*********************Player Info*******************************\");\n\t\t\tSystem.out.println(\"[Lives: \" + lives + \"][Score: \" + score + \n\t\t\t\t\t\t\t\"][Time: \" + gameTime + \"]\");\n\t\t\tSystem.out.println(\"*********************Player Info*******************************\");\n\t\t}else\n\t\t\tSystem.out.println(\"Spawn a player ship to view game info\");\n\t}", "public void talk() throws IOException, InterruptedException{\n\t\ttoServer.println(\"PICKUP\");\n\t\ttoServer.println(\"HELLO\");\n\t\ttoServer.println(\"LOOK\");\n\t\twhile (!gameOver){\n\t\t\tThread.sleep(500);\n\t\t\ttoServer.println(queue.take());\n\t\t\ttoServer.println(\"LOOK\");\n\t\t}\n\t}", "private void sendActionBar(@NonNull final String message) {\n for(UUID playerID : getNewsRecipient()) {\n if(isOnline(playerID)) {\n @NonNull final CraftPlayer player = (CraftPlayer) Bukkit.getPlayer(playerID);\n final String actionMsg = \"{\\\"text\\\":\\\"\" + message + \"\\\"}\";\n final PacketPlayOutChat PACKET = new PacketPlayOutChat(IChatBaseComponent.ChatSerializer.a(actionMsg), (byte) 2);\n player.getHandle().playerConnection.sendPacket(PACKET);\n } else {\n getNewsRecipient().remove(playerID);\n }}\n\n }", "public void showLobbyBoard(Player player){\n\t\tFeatherBoardAPI.showScoreboard(player,\"build-battle-lobby\");\n\t}", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tqueuePos.setVisibility(View.VISIBLE);\n\t\t\t\t\tqueuePos.setText(\"AUDIO streaming...\");\n\t\t\t\t\tstartsp.setVisibility(View.GONE);\n\t\t\t\t}", "public void playHoomans() {\r\n System.out.println(\"Thanks for killing each other, human!\");\r\n }", "public void serve()\r\n {\r\n\tCustomerNode temp;\r\n\t\r\n\t// next customer button was pushed\r\n\r\n\ttry // to get the front item\r\n\t{\r\n temp = q.dequeue();\r\n nextField.setText(temp.getName());\r\n lengthField.setText(\"\" + q.size());\r\n messageLabel.setText(\"OK\");\r\n\t}\r\n\tcatch (QueueEmptyException qee)\r\n\t{\r\n messageLabel.setText(qee.getMessage()); // no queue\r\n nextField.setText(\"\");\r\n phoneField.setText(\"\");\r\n\t}\r\n }", "private void showMessage() throws IOException {\n String msg = fromServer.readUTF();\n chatArea.append(msg + \"\\n\");\n // set the chat area always keep focus at bottom\n chatArea.setCaretPosition(chatArea.getDocument().getLength());\n }", "private void sendQueueToWear() {\n new APITask(new APICallback() {\n @Override\n public void r(String result) {\n try {\n JSONArray normalOrderQueue = new JSONObject(result).getJSONArray(\"queue\");\n\n for (int i = 0; i < normalOrderQueue.length(); i++) {\n if (gettingHelp(normalOrderQueue.getJSONObject(i)))\n if (mAdapter.helpedByMe(normalOrderQueue.getJSONObject(i))) {\n JSONObject attendedUser = normalOrderQueue.getJSONObject(i);\n normalOrderQueue = new JSONArray();\n normalOrderQueue.put(attendedUser);\n break;\n } else {\n normalOrderQueue.remove(i);\n i--;\n }\n }\n\n String queue = normalOrderQueue.toString();\n\n PutDataMapRequest putDataMapReq = PutDataMapRequest.create(\"/stayawhile/queue\");\n putDataMapReq.getDataMap().putString(QUEUE_KEY, queue);\n PutDataRequest putDataReq = putDataMapReq.asPutDataRequest();\n putDataReq.setUrgent();\n PendingResult<DataApi.DataItemResult> pendingResult =\n Wearable.DataApi.putDataItem(mGoogleApiClient, putDataReq);\n }\n catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }).execute(\"method\", \"queue/\" + Uri.encode(mQueueName));\n }", "@Override\n\tpublic void showContents() {\n\t\tprogram.add(returnToMain);\n\t\tprogram.add(congratMessage);\n\t\tprogram.setBackground(Color.DARK_GRAY);\n\t\t\n\t}", "public void play() {\n\t\tSystem.out.println(\"playing \"+title+\" by \" +artist);\n\t}", "private void display(){\n out.println(\"\\n-STOCK EXCHANGE-\");\n out.println(\"Apple - Share Price: \" + game.apple.getSharePrice() + \" [\" + game.apple.top() + \"]\");\n out.println(\"BP - Share Price: \" + game.bp.getSharePrice() + \" [\" + game.bp.top() + \"]\");\n out.println(\"Cisco - Share Price: \" + game.cisco.getSharePrice() + \" [\" + game.cisco.top() + \"]\");\n out.println(\"Dell - Share Price: \" + game.dell.getSharePrice() + \" [\" + game.dell.top() + \"]\");\n out.println(\"Ericsson - Share Price: \" + game.ericsson.getSharePrice() + \" [\" + game.ericsson.top() + \"]\");\n\n out.println(\"\\n-PLAYERS-\");\n// System.out.println(playerList.toString());\n for (Player e : playerList) {\n if (e.equals(player)) {\n out.println(e.toString() + \" (you)\");\n } else {\n out.println(e.toString());\n }\n }\n }", "@Override\n public void run() {\n for(MessageManager temp : plugin.playerBossBars.values()){\n if(temp.bossBar.getPlayers().size() > 0){\n temp.advanceBar();\n\n BossBarMessage currentMessage = temp.getCurrentMessageObject();\n temp.bossBar.setTitle(currentMessage.barMessage);\n temp.bossBar.setColor(currentMessage.barColor);\n temp.bossBar.setStyle(currentMessage.barStyle);\n }\n }\n }", "@Override\n\tpublic void execute() {\n\t\t\n\t\tif (GamesHandler.test) {\n\t\t\tserverModel = ServerFacadeTest.getSingleton().getGameModel(gameID);\n\t\t} else {\n\t\t\tserverModel = ServerFacade.getSingleton().getGameModel(gameID);\n\t\t}\n\t\t\n\t\tPlayer player = serverModel.getPlayers().get(sender);\n\t\tDevCardList playerOldDevCards = player.getOldDevCards();\n\t\t\n\t\tplayerOldDevCards.setRoadBuilding(playerOldDevCards.getRoadBuilding() - 1);\n\t\t\n\t\tserverModel.getMap().addRoad(new Road(sender, spot1));\n\t\tserverModel.getMap().addRoad(new Road(sender, spot2));\n\t\t\n\t\tplayer.setRoads(player.getRoads() - 2);\n\t\t\n\t\tplayer.setPlayedDevCard(true);\n\t\t\n\t\tMessageLine line = new MessageLine();\n\t\tString username = player.getName();\n\t\tif(username.toLowerCase().equals(\"ife\") || username.toLowerCase().equals(\"ogeorge\")){\n\t\t\tline.setMessage(\"Ife built a couple of roads to try to catch up with Paul, but Daniel always wins anyway\");\n\t\t}\n\t\telse{\n\t\t\tline.setMessage(username + \" built a couple roads with a road building development card\");\n\t\t}\n//\t\tline.setMessage(username + \" built a couple roads with a road building development card\");\n\t\tline.setSource(username);\n\t\tserverModel.getLog().addLine(line);\n\t}", "public void showPauseButton()\r\n {\r\n Message message = new Message();\r\n message.what = GUIManager.SHOW_PAUSE_BUTTON;\r\n mGUIManager.sendThreadSafeGUIMessage(message);\r\n }", "public void sendPlayer(Player p) {\n\t\tp.sendMessage(ChatColor.GREEN + \"Welcome to the \" + ChatColor.GOLD + \"Tregmine Network\" + ChatColor.GREEN + \" Lobby!\");\n\t\tByteArrayDataOutput out = ByteStreams.newDataOutput();\n\t\tout.writeUTF(\"Connect\");\n\t\tout.writeUTF(\"Hub\");\n\t\tp.sendPluginMessage(this, \"BungeeCord\", out.toByteArray());\n\t}", "void showCreatorWaitingRoom();", "public void sendDataToAMQ(){\n\t\t\r\n\t\tList<String> msg = new ArrayList<>();\r\n\t\tif(offsetfollower < (prototype.followerDrivingInfo.meetingLocation - 500)) {\r\n\t\t\toffsetleader += prototype.leaderDrivingInfo.speed;\r\n\t\t\toffsetfollower += prototype.followerDrivingInfo.speed;\r\n\t\t\tmsg.add(\"<carName TestCar carName> <segmentPosX -4 segmentPosX> <segmentPosY \"+ (+offsetleader) +\" segmentPosY> <carSpeed \" + (prototype.leaderDrivingInfo.speed)+\" carSpeed>\");\r\n\t\t\tmsg.add(\"<carName Camcar carName> <segmentPosX -4 segmentPosX> <segmentPosY \"+ (offsetfollower) +\" segmentPosY> <carSpeed \" + (prototype.followerDrivingInfo.speed)+\" carSpeed>\");\t\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\toffsetleader += prototype.leaderDrivingInfo.speed;\r\n\t\t\toffsetfollower += prototype.leaderDrivingInfo.speed ;\r\n\t\t\tmsg.add(\"<carName TestCar carName> <segmentPosX -4 segmentPosX> <segmentPosY \"+ (+offsetleader) +\" segmentPosY> <carSpeed \" + (prototype.leaderDrivingInfo.speed)+\" carSpeed>\");\t\r\n\t\t\tmsg.add(\"<carName Camcar carName> <segmentPosX -4 segmentPosX> <segmentPosY \"+ (offsetfollower) +\" segmentPosY> <carSpeed \" + (prototype.leaderDrivingInfo.speed)+\" carSpeed>\");\r\n\r\n\t\t}\r\n for(int i = 0; i < msg.size();i++)\r\n {\r\n \tamqp.sendMessage(msg.get(i));\r\n }\r\n// \t}\r\n }", "public void sendGameInfoToAll(){\r\n\t\t\r\n\t\tVector<Player> players = lobby.getLobbyPlayers();\t\r\n\t\tString message = \"UDGM\" + lobby.getGameString();\r\n\t\t\r\n\t\tif(!players.isEmpty()){\r\n\t \tfor(int i=0; i<players.size(); i++){\t \t\t\r\n\t \t\tsendOnePlayer(players.get(i), message);\t \t\t\r\n\t \t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic void action(Player player) {\n\t\tfireMessageEvent(player.getPlayerId());\n\t\tplayer.setPosition(jail);\n\t\tplayer.setInJail(true);\n\t}", "private synchronized void display(Message msg) {\n\t\tSystem.out.println(msg.toString());\n\t\tguiConversation.append(msg.toString());\n\t}", "public void displayDetails(List<String> players, int np, int rID) {\n Platform.runLater(() -> {\n roomID.setText(\"Rood ID: \" + rID);\n playerNumber.setText(\"Players: \" + players.size() + \"/\" + np);\n playerList.getChildren().clear();\n for (String username : players) {\n Text usernameText = new Text(username);\n usernameText.getStyleClass().add(\"light-text\");\n playerList.getChildren().add(usernameText);\n }\n });\n }", "public String callPlayer() {\n\t\treturn \"OVER HERE!!\";\n\t}", "@Override\n public void run() {\n for (int i = 0; i < numberOfPlayers; i++) {\n addPlayer();\n controller\n .getSpf()\n .getLabel1()\n .setText(\n \"\" +\n players.get(players.size() - 1).getName() +\n \" Jugador # \" +\n (players.size() - 1)\n );\n }\n\n controller\n .getSpf()\n .getLabel1()\n .setText(\"Jugadores listos, iniciando partida\");\n\n startMatch();\n\n sendId();\n\n UpdateMatchThread umt = new UpdateMatchThread(this, 0);\n umt.start();\n\n UpdateMatchThread umt1 = new UpdateMatchThread(this, 1);\n umt1.start();\n\n UpdateServerThread upt = new UpdateServerThread(this);\n upt.start();\n }", "public void showLobby() {\n \t\tgameMain.showScreen(lobby);\n \t}", "public void printVictoryMessage() { //main playing method\r\n System.out.println(\"Congrats \" + name + \" you won!!!\");\r\n }", "public void open(Plugin plugin, SpoutPlayer splayer) {\n\n GenericPopup popup = new GenericPopup();\n int width = splayer.getMainScreen().getMaxWidth();\n int height = splayer.getMainScreen().getMaxHeight();\n pluginLeg.log(\"aight\" + width + \"\" + height);\n\n// int width = splayer.getCurrentScreen().getWidth();\n// int height = splayer.getCurrentScreen().getHeight();\n\n //title of the screen\n GenericLabel topLabel = new GenericLabel(\"Clan-Invitation\");\n topLabel.setScale(1);\n\n topLabel.setWidth(topLabel.getText().length() * 8 * (int) topLabel.getScale()).setHeight((int) topLabel.getScale() * 15);\n\n topLabel.setX(width / 2 - topLabel.getWidth() / 2);\n topLabel.setY(topLabel.getHeight() / 2 + 5);\n popup.attachWidget(plugin, topLabel);\n\n //title of the screen\n String questionString = \"&2You are invited to \"+clan.getName()+\". Do you want to join?\";\n GenericLabel questionLabel = new GenericLabel(LegendaryClans.parseColor(questionString));\n questionLabel.setScale(1);\n questionLabel.setWidth(questionLabel.getText().length() * 5 * (int) questionLabel.getScale());\n questionLabel.setHeight((int) questionLabel.getScale() * 15);\n\n questionLabel.setX(width / 2 - questionLabel.getWidth() / 2);\n questionLabel.setY(height / 2 - questionLabel.getHeight() / 2);\n popup.attachWidget(plugin, questionLabel);\n\n //Accept Button\n LegendaryButton acceptButton = new LegendaryButton(LegendaryClans.parseColor(\"&2Accept!\"), popup) {\n\n @Override\n public void onButtonClick(ButtonClickEvent event) {\n if (pluginLeg.getClanManager().getClanByPlayer(clan.getLeaders().get(0)) != null && askedPlayer != null) {\n clan.addMember(askedPlayer);\n } \n getPopup().close();\n }\n };\n\n\n acceptButton.setWidth(acceptButton.getText().length() * 8 * (int) acceptButton.getScale()).setHeight((int) acceptButton.getScale() * 15);;\n acceptButton.setX(width / 2 + width / 4 - acceptButton.getWidth() / 2).setY(height / 2 + height / 4 - acceptButton.getHeight() / 2);\n\n\n popup.attachWidget(plugin, acceptButton);\n //deny button\n LegendaryButton denieButton = new LegendaryButton(LegendaryClans.parseColor(\"&4Deny!\"), popup) {\n\n @Override\n public void onButtonClick(ButtonClickEvent event) {\n clan.broadcastMessage(\"&4\" + askedPlayer.getName() + \" denied invitation!\");\n getPopup().close();\n }\n };\n\n denieButton.setWidth(acceptButton.getText().length() * 8 * (int) acceptButton.getScale());\n denieButton.setHeight((int) denieButton.getScale() * 15);\n// \n// ((LegendaryClans)plugin).log(\"\"+width+\",\"+height);\n// denieButton.setX(denieButton.getX()+denieButton.getWidth()/2 +10);\n\n denieButton.setX(width / 4 - denieButton.getWidth() / 2);\n denieButton.setY(height / 2 + height / 4 - denieButton.getHeight() / 2);\n popup.attachWidget(plugin, denieButton);\n\n splayer.closeActiveWindow();\n splayer.getMainScreen().attachPopupScreen(popup);\n }", "public void printAllPlayers(){\n for (Player player : players){\n player.printPlayerInfo();\n }\n }", "private synchronized void sendAdvance(){\r\n\t\t\tfor(PrintWriter p : players){\r\n\t\t\t\tif(p != null){\r\n\t\t\t\t\tp.println(\"5\");\r\n\t\t\t\t\tp.println(Integer.toString(x));\r\n\t\t\t\t\tp.println(Integer.toString(y));\r\n\t\t\t\t\tp.flush();\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t}", "public void display() {\n\t\tSystem.out.println(\"Queue display\");\n\t\tint maxi = (front < rear) ? rear : (rear + MAX_QUEUE_SIZE);\n\t\tfor (int i = front + 1; i <= maxi; i++) {\n\t\t\tSystem.out.println(data[i]);\n\t\t}\n\t}", "@Override\n\tpublic void show() {\n\t\trefreshServerList();\n\t\t((InputMultiplexer)Gdx.input.getInputProcessor()).addProcessor(ui);\n\t}", "public void sendMessage() {\n\t\tString myPosition=this.agent.getCurrentPosition();\n\t\tif (myPosition!=null){\n\t\t\t\n\t\t\tList<String> wumpusPos = ((CustomAgent)this.myAgent).getStenchs();\n\t\t\t\n\t\t\tif(!wumpusPos.isEmpty()) {\n\t\t\t\tList<String> agents =this.agent.getYellowpage().getOtherAgents(this.agent);\n\t\t\t\t\n\t\t\t\tACLMessage msg=new ACLMessage(ACLMessage.INFORM);\n\t\t\t\tmsg.setSender(this.myAgent.getAID());\n\t\t\t\tmsg.setProtocol(\"WumpusPos\");\n\t\t\t\tmsg.setContent(wumpusPos.get(0)+\",\"+myPosition);\n\t\t\t\t\n\t\t\t\tfor(String a:agents) {\n\t\t\t\t\tif(this.agent.getConversationID(a)>=0) {\n\t\t\t\t\t\tif(a!=null) msg.addReceiver(new AID(a,AID.ISLOCALNAME));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.agent.sendMessage(msg);\n\t\t\t\tthis.lastPos=myPosition;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t}", "private synchronized void display(String msg) {\n\n\t\t//guiConversation.append(msg);\n\t\tSystem.out.println(msg);\n\t}", "@Override\r\n\tpublic void Display() {\n\t\t System.out.print(\"\\nQueue = \");\r\n\t if (len == 0)\r\n\t {\r\n\t System.out.print(\"Empty\\n\");\r\n\t return ;\r\n\t }\r\n\t for (int i = front; i <= rear; i++)\r\n\t System.out.print(queue[i]+\" \");\r\n\t System.out.println(); \r\n\t\t\r\n\t}", "public static void privateMessage(Player fromPlayer, Player toPlayer, String[] message) {\n PlayerDataObject fromPDO = PlayerManager.getPlayerDataObject(fromPlayer);\n PlayerDataObject toPDO = PlayerManager.getPlayerDataObject(toPlayer);\n //target.sendMessage(ChatColor.DARK_GRAY + \"[\" + player.getFriendlyName() + ChatColor.DARK_GRAY + \" > you]: \" + ChatColor.WHITE + String.join(\" \", Arrays.copyOfRange(arg3, 1, arg3.length)).trim());\n //player.sendMessage(ChatColor.DARK_GRAY + \"[You > \" + target.getDisplayName() + ChatColor.DARK_GRAY + \"]: \" + ChatColor.WHITE + String.join(\" \", Arrays.copyOfRange(arg3, 1, arg3.length)).trim());\n ComponentBuilder toComp = new ComponentBuilder(ChatColor.DARK_GRAY + \"[\" + fromPDO.getFriendlyName() + ChatColor.DARK_GRAY + \" > you]\" + ChatColor.WHITE + \":\");\n toComp.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(\"PM \" + fromPDO.getPlainNick()).create()));\n toComp.event(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, \"/pm \" + fromPDO.getName() + \" \"));\n toComp.append(\" \").reset();\n \n ComponentBuilder fromComp = new ComponentBuilder(ChatColor.DARK_GRAY + \"[You > \" + toPDO.getDisplayName() + ChatColor.DARK_GRAY + \"]\" + ChatColor.WHITE + \":\");\n fromComp.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(\"PM \" + toPDO.getPlainNick()).create()));\n fromComp.event(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, \"/pm \" + toPDO.getName() + \" \"));\n fromComp.append(\" \").reset();\n \n TextComponent messageComp = new TextComponent();\n for (String part : message) {\n if (part.matches(\"^.*(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|].*$\")) {\n messageComp.addExtra(assembleURLComponent(part));\n messageComp.addExtra(\" \");\n } else {\n messageComp.addExtra(part + \" \");\n }\n }\n \n BaseComponent[] toMSG = toComp\n .append(messageComp)\n .create();\n BaseComponent[] fromMsg = fromComp\n .append(messageComp)\n .create();\n \n toPDO.sendMessageIf(toMSG);\n fromPDO.sendMessageIf(fromMsg);\n }", "private void displayPlayers() {\n\t\tfor (Player p: game.getPlayers()) {\n\t\t\tview.updateDisplay(p.getId(), p.getDeck().getNumberOfCards());\n\t\t}\n\t}", "public abstract String getQueueDisplayName();", "public void showGameBoard(Player player){\n\t\tFeatherBoardAPI.removeScoreboardOverride(player, \"build-battle-lobby\");\n\n\t\tFeatherBoardAPI.showScoreboard(player,\"build-battle-game\");\n\t}", "public LootBoxButtonPanel(BlockingQueue<Message> queue, Player player, InventoryPanel inventoryPanel, LootBoxPanel lootBoxPanel, ItemImage itemImage) {\r\n this.player = player;\r\n this.queue = queue;\r\n setLayout(new FlowLayout(FlowLayout.LEFT)); //setting the layout of the Panel\r\n JButton OpenLootBoxButton = new JButton(\"Open Loot Box\");//create the Open Loot Box button\r\n OpenLootBoxButton.addActionListener(event -> {\r\n try {\r\n inventoryPanel.setVisible(false);\r\n lootBoxPanel.setVisible(true);\r\n itemImage.setVisible(true);\r\n\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n });\r\n this.add(OpenLootBoxButton);\r\n JButton InventoryButton = new JButton(\"Player's Inventory\");//create the yes button\r\n InventoryButton.addActionListener(event -> {\r\n try {\r\n this.queue.put(new ViewInventoryHitMessage());\r\n } catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n });\r\n\r\n InventoryButton.addActionListener(event -> {\r\n lootBoxPanel.setVisible(false);\r\n itemImage.setVisible(false);\r\n inventoryPanel.setVisible(true);\r\n });\r\n\r\n this.add(InventoryButton);\r\n }", "public void display(){\n for(int i = 0;i < n_items;++i){\n System.out.print(queue_array[(i + front) % max_size] + \" \");\n }\n System.out.println();\n }", "@Override\n protected void display() {\n System.out.println(\"Welcome to team builder tool!\");\n System.out.println(\"Current team: \" + team.getName());\n }", "private static void printDetail() {\n System.out.println(\"Welcome to LockedMe.com\");\n System.out.println(\"Version: 1.0\");\n System.out.println(\"Developer: Sherman Xu\");\n System.out.println(\"[email protected]\");\n }", "public void play()\n { \n printWelcome();\n\n // Enter the main command loop. Here we repeatedly read commands and\n // execute them until the game is over.\n\n boolean finished = false;\n while (! finished) {\n Command command = parser.getCommand();\n //System.out.println(command==null);\n String output = processCommand(command);\n finished = (null == output);\n if (!finished)\n { \n System.out.println(output);\n }\n\n }\n System.out.println(\"Thank you for playing. Good bye.\");\n }", "public void play() {\n\t\tSystem.out.println(\"playing \"+title);\r\n\t}", "public void sendGameInfo(Player plr){\r\n\t\t\r\n\t\tString message = \"UDGM\" + lobby.getGameString();\r\n\t\tsendOnePlayer(plr, message);\r\n\t}", "private void show() {\n System.out.println(team.toString());\n }", "void printPlaylistMenu(){\n\t\tSystem.out.println(\"\\n\\nPlaylist Menu:\");\n\t\tSystem.out.println(\"1. Delete Song: delete <song id>\");\n\t\tSystem.out.println(\"2. Insert Song: insert <song id>\");\n\t\tSystem.out.println(\"3. Search and Insert Song: insert_search title/artist <string of words to be searched>\");\n\t\tSystem.out.println(\"4. Print Playlist: print\");\n\t\tSystem.out.println(\"5. Sort songs: sort artist/title\");\n\t\tSystem.out.println(\"6. Search Song: search artist/title <string of words to be searched>\");\n\t\tSystem.out.println(\"7. Main Menu: main\");\n\t\tSystem.out.print(\"Enter a Command : \");\n\t}", "private void displayMsg(Object o) {\n Message msg = ((Datapacket)o).getMsg();\n client.printMessage(msg);\n }", "private void displayMsg(String msg) {\n //add message to chatList array\n chatList.add(msg);\n //display message in GUI\n mg.appendRoom(msg); \n }", "private void show() {\n System.out.println(\"...................................................................................................................................................................\");\n System.out.print(Color.RESET.getPrintColor() + \"║\");\n for(int i = 0; i < players.size(); i++) {\n if (state.getTurn() == i) {\n System.out.print(Color.PURPLE.getPrintColor());\n System.out.print((i+1) + \"- \" + players.get(i).toString());\n System.out.print(Color.RESET.getPrintColor() + \"║\");\n }\n else {\n System.out.print(Color.CYAN.getPrintColor());\n System.out.print((i+1) + \"- \" + players.get(i).toString());\n System.out.print(Color.RESET.getPrintColor() + \"║\");\n }\n }\n System.out.println();\n System.out.print(\"Direction: \");\n if (state.getDirection() == +1) {\n System.out.println(Color.PURPLE.getPrintColor() + \"clockwise ↻\");\n }\n else {\n System.out.println(Color.PURPLE.getPrintColor() + \"anticlockwise ↺\");\n }\n System.out.println(Color.RESET.getPrintColor() + \"Turn: \" + Color.PURPLE.getPrintColor() + players.get(state.getTurn()).getName() + Color.RESET.getPrintColor());\n System.out.println(currentCard.currToString());\n if (controls.get(state.getTurn()) instanceof PcControl) {\n System.out.print(players.get(state.getTurn()).backHandToString() + Color.RESET.getPrintColor());\n }\n else {\n System.out.print(players.get(state.getTurn()).handToString() + Color.RESET.getPrintColor());\n }\n }", "public void playContent() {\n this.taskHandler.run(this::inlinePlay);\n }", "public static void sendActionBarInfo(Player p, String message) {\n\t\t((CraftPlayer) p).getHandle().playerConnection\n\t\t\t\t.sendPacket(new PacketPlayOutChat(IChatBaseComponent.ChatSerializer.a(\"{\\\"text\\\": \\\"\" + message + \"\\\"}\"), ChatMessageType.GAME_INFO));\n\t}", "private void play() {\n\t\tParcel pc = Parcel.obtain();\n\t\tParcel pc_reply = Parcel.obtain();\n\t\ttry {\n\t\t\tSystem.out.println(\"DEBUG>>>pc\" + pc.toString());\n\t\t\tSystem.out.println(\"DEBUG>>>pc_replay\" + pc_reply.toString());\n\t\t\tib.transact(1, pc, pc_reply, 0);\n\t\t} catch (RemoteException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void sendNameInfoToAll(){\r\n\t\t\r\n\t\tVector<Player> players = lobby.getLobbyPlayers();\t\r\n\t\tString message = \"UDNM\" + lobby.getNameString();\r\n\t\t\r\n\t\tif(!players.isEmpty()){\r\n\t \tfor(int i=0; i<players.size(); i++){\t \t\t\r\n\t \t\tsendOnePlayer(players.get(i), message);\t \t\t\r\n\t \t}\r\n\t\t}\r\n\t}", "private void viewMessage()\n {\n System.out.println( inbox );\n inbox = \"\";\n }", "private void spawnPlayer() {\n\t\tplayer.show(true);\n\t\tplayer.resetPosition();\n\t\tplayerDead = false;\n\t\tplayerDeadTimeLeft = 0.0;\n\t}", "public void sendJoiningPlayer() {\r\n Player p = nui.getPlayerOne();\r\n XferJoinPlayer xfer = new XferJoinPlayer(p);\r\n nui.notifyJoinConnected();\r\n networkPlayer.sendOutput(xfer);\r\n }", "public void render() {\n stroke(color(50, 50, 50));\n fill(color(50, 50, 50));\n rect(0, 0, getWidth(), getTopHeight());\n int tempX = this.x;\n int fontSize = 150 / (this.players.size() * 2);\n\n this.messages = new ArrayList();\n int count = 0;\n for (Player player : this.players) {\n\n StringBuilder bar = new StringBuilder();\n // max lives = 3\n bar.append(player.name() + \" \");\n for (int i=0; i<3; i++) {\n if (i < player.lives()) {\n bar.append('\\u25AE'); // http://jrgraphix.net/r/Unicode/?range=25A0-25FF\n } else {\n bar.append('\\u25AF');\n }\n }\n\n String message = bar.toString();\n messages.add(message);\n\n textAlign(LEFT);\n textFont(f, fontSize);\n fill(player.getColor());\n text(message, tempX, this.y);\n\n int newX = (int) textWidth(message) + 10;\n tempX += newX;\n count++;\n }\n }", "public void displayManagerWindowGUI(SpoutPlayer player, Block block) {\n\t\tif (!this.managerWindows.containsKey(player)) { this.managerWindows.put(player, new ManagerWindow(player, this.plugin)); }\n\t\t\n\t\t//Get the rating window from the hash map and open it\n\t\tthis.managerWindows.get(player).open(block);\n\t\t\n\t}", "public void run() {\n JabberPacket packet=null;\n\n do {\n try {\n packet=queue.pull();\n\n if (packet!=null) {\n PacketHandler h=null;\n if (((JabberSkypeSettings) Main.Settings()).getDebug()) {\n \tSystem.out.println(\"Client: \" + packet.generateXML());\n }\n String e=packet.getElement();\n if (e!=null) {\n String key=null;\n\n if (e.equals(\"iq\")) {\n JabberPacket pQuery=packet.getFirstChild(\"query\");\n\n if (pQuery!=null) {\n key=pQuery.getAttribute(\"xmlns\");\n } else {\n \tJabberPacket pVcard=packet.getFirstChild(\"vcard\");\n \tif (pVcard!= null) {\n \t\tkey=pVcard.getAttribute(\"xmlns\");\n \t\t//need to do difference between setting vcard, and getting it for a user\n \t}\n }\n } else\n key=e;\n\n if (key!=null) {\n h=(PacketHandler)mHandlers.get(key);\n\n if (h==null)\n h=getDefaultHandler();\n\n h.processPacket(packet);\n } //key!=null\n } //e!=null\n } //packet!=null\n } //try\n catch (Exception e) {\n server.getLogger().severe(\"Caught exception: \"+e.getMessage());\n }\n } while (packet!=null && server.getRunning());\n }", "public void play() { \r\n\t System.out.printf(\"Playing Song: artist=%-20s title=%s\\n\", artist, title);\r\n\t}", "public void print() {\n\t\tString sqlList = \"select * from commodity;\";\n\t\tcommodityBuffer = new StringBuffer();\n\t\ttry {\n\t\t\tconnection = SQLConnect.getConnection();\n\t\t\tstatement = connection.createStatement();\n\t\t\tresultSet = statement.executeQuery(sqlList);\n\n\t\t\t// put the commodity messages into a stringbuffer\n\t\t\twhile ( resultSet.next() ) {\n\t\t\t\tcommodityBuffer.append(resultSet.getString(\"number\")+\" - \"+resultSet.getString(\"name\")+\"\\n\");\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t// show the commodity messages on window\n\t\tcommodityArea = new JTextArea(commodityBuffer.toString());\n\t}", "void printPlayersActionInfo(Player p) {\n }", "private void print() {\n\t\t// reorganize a wraparound queue and print\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tSystem.out.print(bq[(head + i) % bq.length] + \" \");\n\t\t}\n\t\tSystem.out.println(\"\\n\");\n\t}", "public void playTopHat() {\n\t\tSystem.out.println(\"ding ding da-ding\");\n\t\t\n\t}", "@PermitAll\n public void cmdShowSchedule(User teller) {\n command.sendQuietly(\"qtell {0} {1}\", teller, \"Current Schedule:\\\\n\");\n Collection<Game> games = tournamentService.findAllGames();\n for (Game game : games) {\n int boardNum = game.boardNumber;\n String whiteStatus = (game.whitePlayer.isOnline()) ? \"\" : \" ?\";\n String whitePlayer = game.whitePlayer.getHandle();\n String blackStatus = (game.blackPlayer.isOnline()) ? \"\" : \" ?\";\n String blackPlayer = game.blackPlayer.getHandle();\n String gameStatus = game.getStatusString();\n String msg = String.format(\"Board %2d: %18s%2s %18s%2s %s\", boardNum, whitePlayer, whiteStatus, blackPlayer, blackStatus, gameStatus);\n command.sendQuietly(\"qtell {0} {1}\", teller, msg);\n }\n command.sendQuietly(\"qtell {0}\", teller);\n }", "private void showMessage(int position) {\n // Open Bottom sheet and show details\n }", "public static void inspectRoom(Player player) {\n System.out.print(\"You see: \");\n player.getCurrentRoom().inspect();\n }", "private void sendQueue() {\r\n firePropertyChange(\"boardQueue\", null, myBoardQueue);\r\n firePropertyChange(\"scaleQueue\", null, myScaleDialogQueue);\r\n firePropertyChange(\"gui\", null, this);\r\n }", "public void printQueue() {\n \t\n \tif(this.front == null) {\t\n \t\tSystem.out.println(\"Queue Empty!!\");\n \t\treturn;\n \t}\n \t\n \twhile(this.front != null) {\n \t\tSystem.out.print(\"(\"+this.front.data+ \") \");\n \t\tthis.front = this.front.next;\n \t}\n }", "protected void processPlayerArrived(String name) {\n Player player = tournamentService.findPlayer(name);\n if (player == null) {\n alertManagers(\"Arriving player {0} is on my notify list, but I don''t have him in the tournament roster.\", name);\n return;\n }\n player.setState(PlayerState.WAITING);\n Game game = tournamentService.findPlayerGame(player);\n if (game == null) return;\n if (game.status.isFinished()) return;\n if (loggingIn) {\n \tcommand.sendCommand(\"observe {0}\", name);\n } else {\n tellManagers(\"{0} arrived. Reserving board {1}.\", name, game.boardNumber);\n }\n command.sendAdminCommand(\"spoof {0} tell JudgeBot nowin\", game.whitePlayer);\n command.sendAdminCommand(\"spoof {0} tell JudgeBot nowin\", game.blackPlayer);\n command.sendAdminCommand(\"set-other {0} kib 0\", game.blackPlayer);\n command.sendAdminCommand(\"set-other {0} kib 0\", game.whitePlayer);\n command.sendAdminCommand(\"reserve-game {0} {1}\", game.whitePlayer, game.boardNumber);\n command.sendAdminCommand(\"reserve-game {0} {1}\", game.blackPlayer, game.boardNumber);\n if (game.status.isAdjourned()) {\n command.sendAdminCommand(\"spoof {0} match {1}\", game.whitePlayer, game.blackPlayer);\n command.sendAdminCommand(\"spoof {0} match {1}\", game.blackPlayer, game.whitePlayer);\n }\n }" ]
[ "0.6134932", "0.5945381", "0.5784654", "0.57228947", "0.57205915", "0.56788117", "0.56294525", "0.5599203", "0.55972296", "0.5570299", "0.55000854", "0.5474358", "0.54584396", "0.5448799", "0.5445229", "0.5425216", "0.5407449", "0.54030603", "0.540066", "0.5380085", "0.5371607", "0.5369894", "0.5368387", "0.53572387", "0.5356527", "0.5349904", "0.5341916", "0.53357244", "0.53291154", "0.53280234", "0.5327972", "0.5318893", "0.5317905", "0.5299765", "0.52898884", "0.52781606", "0.52730036", "0.52629334", "0.525249", "0.5242321", "0.5234402", "0.52317965", "0.52286994", "0.52239484", "0.5222171", "0.52158016", "0.52064514", "0.51916426", "0.51908517", "0.51895964", "0.51878077", "0.51733905", "0.51647896", "0.51621526", "0.5152694", "0.51391435", "0.5131306", "0.5129691", "0.51244885", "0.5114505", "0.51132524", "0.5112169", "0.51113284", "0.51096994", "0.51080716", "0.5099978", "0.5083696", "0.5082858", "0.5080295", "0.50766647", "0.5073992", "0.50707495", "0.5067358", "0.5066645", "0.5064056", "0.5060859", "0.50591874", "0.50564677", "0.50512534", "0.5049264", "0.5048133", "0.50462234", "0.50379175", "0.5031559", "0.5028093", "0.502667", "0.5026437", "0.50261086", "0.5022267", "0.5022225", "0.50157785", "0.5014364", "0.5012775", "0.49917305", "0.4978263", "0.49743772", "0.49740842", "0.4973337", "0.49717817", "0.49694356", "0.49615765" ]
0.0
-1
Lists the number of bots of each currently spawned type to the specified player in PM. If for some reason the count is 0 or less, the result is not displayed.
void listBotTypes( String messager ) { Iterator<String> i; Integer number; String className; m_botAction.sendSmartPrivateMessage( messager, "Listing bot types:" ); for( i = m_botTypes.keySet().iterator(); i.hasNext(); ) { className = i.next(); number = m_botTypes.get( className ); if( number.intValue() > 0 ) m_botAction.sendSmartPrivateMessage( messager, className + ": " + number ); } m_botAction.sendSmartPrivateMessage( messager, "End of list" ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getTotalBotCount() {\n int t = 0;\n\n for (Integer i : m_botTypes.values())\n t += i;\n\n return t;\n }", "public int playersCount(){\r\n\t\treturn players.size();\r\n\t}", "public int countPlayers(){\n return players.size();\n }", "int getNumberOfBots( String className ) {\n Integer number = m_botTypes.get( className );\n\n if( number == null ) {\n return 0;\n } else {\n return number.intValue();\n }\n }", "public int numPlayers(){\n return this.members.size();\n }", "public int getPlayerCount() {\n return 0;\n }", "private void getNumPlayers() {\n\t\tSystem.out.println(\"How many people are playing? (must be between \"+MIN_PLAYERS+\" and \"+MAX_PLAYERS+\")\");\n\t\tnumPlayers = GetInput.getInstance().anInteger(MIN_PLAYERS, MAX_PLAYERS);\n\t}", "public static int getNumPlayers(){\n\t\treturn numPlayers;\n\t}", "public int numPlayers() {\n return playerList.size();\n }", "@Override\n public int getTotalHumanPlayers() {\n return totalHumanPlayers;\n }", "int getParticipantsCount();", "int getParticipantsCount();", "public int getNumberOfPlayers() {\n return listaJogadores.size() - listaJogadoresFalidos.size();\n }", "public int getNumPlayers(){\n\t\treturn this.players.size();\n\t}", "public int playerCount() {\n\t\treturn playerList.size();\n\t}", "public int getNumOfPlayers() {\n\t\treturn playerList.size();\n\t}", "public int playerCount()\r\n\t{\r\n\t\tint count = 0;\r\n\t\tfor(Player player: this.players)\r\n\t\t{\r\n\t\t\tif(player != null)\r\n\t\t\t{\r\n\t\t\t\t++count;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t}", "int getAchievementsCount();", "int getBotCount(String className) {\n Integer currentBotCount = m_botTypes.get( className.toLowerCase() );\n\n if( currentBotCount == null ) {\n currentBotCount = new Integer( 0 );\n m_botTypes.put( className.toLowerCase(), currentBotCount );\n }\n\n return currentBotCount;\n }", "@Override\npublic int getNumPlayers() {\n\treturn numPlayer;\n}", "public int getNumPlayers(){\n return m_numPlayers;\n }", "public int nrOfPlayers() {\n int playerCount = 0;\n for (Player player : players) {\n if (player.getName() != null) {\n playerCount++;\n }\n }\n\n return playerCount;\n }", "int getNumberOfPlayers(){\n return players.size();\n }", "public int getNumPlayers() {\n return numPlayers;\n }", "private int getOnlinePlayers()\n {\n return (int) Bukkit.getOnlinePlayers().stream().filter( p -> p != null && p.isOnline() ).count();\n }", "int getAchieveInfoCount();", "int getCount(Side player) {\n return player == BLACK ? _countBlack : _countWhite;\n }", "public int getNumPlayers() {\n\n\t\treturn this.playerCount;\n\t}", "public int getNbPawns(Player player) {\n Pawn aPawn;\n int Size, nbPawn;\n Size = getSize();\n nbPawn = 0;\n\n for (int numLine = 0; numLine < Size; numLine++) {\n for (int numCol = 0; numCol < Size; numCol++) {\n\n aPawn = field[numLine][numCol];\n if (aPawn != null) {\n if (aPawn.getPlayer() == player) nbPawn++; //if the pawn belong to player\n }\n\n }\n }\n\n return nbPawn;\n }", "public int getNumOfPlayers() {\n\t\treturn numOfPlayers;\n\t}", "@Override\n\tpublic int getOnlinePlayerSum() {\n\t\treturn PlayerManager.getInstance().getOnlinePlayers().size();\n\t}", "private int promptNumPlayers() {\r\n Object[] options = {1, 2, 3, 4};\r\n int numPlr = (int) JOptionPane.showInputDialog(\r\n null,\r\n \"How many people are playing?\",\r\n \"Welcome!\",\r\n JOptionPane.PLAIN_MESSAGE,\r\n null,\r\n options,\r\n 1);\r\n\r\n players = new Player[numPlr];\r\n\r\n for (int i = 0; i < numPlr; i++) {\r\n players[i] = new Player();\r\n }\r\n\r\n return numPlr;\r\n }", "public int getPlayerCount() {\n \n \treturn playerCount;\n \t\n }", "int getNumOfPlayers() {\n return this.numOfPlayers;\n }", "public int getNumPlayerProtections(Player player) {\n List list;\n try {\n list = (List) plugin.map.get(player.getName());\n return list.size();\n } catch (NullPointerException e) {\n plugin.map.put(player.getName(), new ArrayList<>());\n return 0;\n }\n }", "public int getGoalTally(Player player){\r\n return player.getGoal();\r\n }", "public int getPlayerCount() {\n\t\treturn playerCount;\n\t}", "public int loadedPlayers(){\n return playerMap.size();\n }", "public int getCount() {\n\n if (team.size() <= 0)\n return 1;\n return team.size();\n }", "int getFaintedPokemonCount();", "public void sendOpponentHandCounts(ArrayList<Player> plist, Player sentTo) {\n try {\n // Send the number of player hand counts being sent\n sendNumOpponents(plist.size()-1);\n for (int i = 0; i < numPlayers; i++) {\n Player p = plist.get(i);\n if (p != sentTo) { // Do not send player self data as opponent\n dOut.writeInt(p.getHandSize());\n dOut.flush();\n }\n }\n } catch (IOException e) {\n System.out.println(\"Could not send player hand counts\");\n e.printStackTrace();\n }\n }", "int getQuestCount();", "List<PlayedQuestion> getPlayedQuestionsCount();", "public int getWallItemsCount(String userUuid, ProfilePrivacy privacy);", "private static int getNumLiveUnits(ArrayList<Unit> party){\n\t\tint count=0;\n\t\tfor(Unit u:party){\n\t\t\tif(!u.getPokemon().isFainted())\n\t\t\t\tcount++;\n\t\t}\n\t\treturn count;\n\t}", "public int size ()\n\t{\n\t\treturn playerList.size();\n\t}", "public void printAllPlayerStats(List<Player> players);", "int getUserQuestJobsCount();", "public static int GetPlayersLeft () {\n int players_left = 0;\r\n\r\n // LOOK AT EACH PLAYER AND CHECK IF THEY HAVEN'T LOST\r\n for (int i = 0; i < player_count; i++) {\r\n if (!player[i].lost)\r\n players_left++;\r\n }\r\n\r\n // RETURN THE RESULTS\r\n return players_left;\r\n }", "public int numberOfTeams() {\n return noTeams;\n }", "int getFriendListCount();", "int getFriendListCount();", "int getPeerCount();", "public int NumOfGames()\n\t{\n\t\treturn gametype.length;\n\t}", "public String countScore() {\n String str =\"\";\n System.out.println(\"Game has ended\");\n int playerOneCount = 0;\n int playerTwoCount = 0;\n System.out.println(\"this is size of computer board\" + player2.playerTwoDomino.size());\n System.out.println(\"this is size of boneyard \" + allElements.size());\n System.out.println(\"this is size of human board \" + human1.playerOneDomino.size());\n System.out.println(\"this is size of game board \" + gameBoard.size());\n for (int i = 0; i < human1.playerOneDomino.size(); i++) {\n playerOneCount = playerOneCount + human1.playerOneDomino.get(i).getX() + human1.playerOneDomino.get(i).getX();\n }\n for (int j = 0; j < player2.playerTwoDomino.size(); j++) {\n playerTwoCount = playerTwoCount + player2.playerTwoDomino.get(j).getX() + player2.playerTwoDomino.get(j).getY();\n }\n\n if (playerOneCount < playerTwoCount) {\n str = \"Winner is Human by \" + (playerTwoCount - playerOneCount) + \" points\";\n\n\n } else {\n str = \"Winner is Computer by \" + (playerOneCount - playerTwoCount) + \" points\";\n\n }\n\n return str;\n }", "@Override\n public int getItemCount() {\n return players.size();\n }", "int getReservePokemonCount();", "public int getPlayerIdsCount() {\n return playerIds_.size();\n }", "public int getWallItemsCount(String userUuid);", "public int getParticipantsCount()\n {\n return participants.size();\n }", "public int numVanished() {\n return this.vanishedPlayers.size();\n }", "int getFreeBotNumber( BotSettings botInfo ) {\n int i;\n String name;\n int maxBots;\n int result = -1;\n\n maxBots = botInfo.getInt( \"Max Bots\" );\n\n for( i = 1; i <= maxBots && result == -1; i++ ) {\n name = botInfo.getString( \"Name\" + i );\n\n if( m_botStable.get( name ) == null ) {\n result = i;\n }\n }\n\n return result;\n }", "@Override\n // report number of players on a given team (or all players, if null)\n\tpublic int numPlayers(String teamName) {\n\n int numPlayers = 0;\n\n\n if (teamName == null) {\n\n for (int i = 0; i < (stats.keySet()).toArray().length; i++) {\n\n numPlayers++;\n\n }\n\n return numPlayers;\n\n }\n\n else {\n\n Collection<SoccerPlayer> soccerPlayers = stats.values();\n\n for (SoccerPlayer sp: soccerPlayers) {\n\n if (sp.getTeamName().equals(teamName)){\n\n numPlayers++;\n }\n }\n\n return numPlayers;\n\n }\n\n\n\t}", "int getNewlyAvailableQuestsCount();", "public void NumberOfPlayers()\r\n {\r\n Input=JOptionPane.showInputDialog(\"Type the number of players\", JOptionPane.YES_NO_OPTION);\r\n \r\n SecondInput = JOptionPane.showInputDialog(\"How many of those \"+ Input +\" players will be AI ?\", JOptionPane.YES_NO_OPTION);\r\n \r\n while(Converter(SecondInput) >= Converter(Input))\r\n {\r\n if(Converter(SecondInput) >= Converter(Input))\r\n {\r\n JOptionPane.showMessageDialog(this,\"AI players can't be equal or more than the original number of players!\",\r\n \"ERROR\",\r\n JOptionPane.ERROR_MESSAGE);\r\n\r\n SecondInput = JOptionPane.showInputDialog(\"How many of those \"+ Input +\" players will be AI ?\", JOptionPane.YES_NO_OPTION);\r\n }\r\n \r\n }\r\n \r\n if(Input!=null)\r\n {\r\n int j = Converter(Input); \r\n \r\n Start();\r\n }\r\n \r\n }", "int getResponsesCount();", "public void countAllPoints() {\n\t\tfor(ClientThread player: players) {\n\t\t\tplayer.points = PointCounter.countPoint(player.clientCards);\n\t\t\tview.writeLog(player.name+\" : \"+player.points);\n\t\t}\n\t}", "@Override\n\tpublic int countTeam() {\n\t\treturn 0;\n\t}", "public int numAlivePokemon() {\r\n\t\tint count = 0;\r\n\t\tfor (Pokemon p : ownedPokemon) {\r\n\t\t\tif (p.getCurrentHP() > 0) {\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t}", "public void setNumberOfPlayers(int numberOfPlayers) {\n this.numberOfPlayers = numberOfPlayers;\n }", "public int getHumanPlayerHits() {\n return humanPlayerHits;\n }", "public void displayPlayerWinnings()\n {\n for(int card = 0; card < playerCardsWon; card++)\n {\n System.out.println(playerWinnings[card].toString());\n }\n }", "public int nbEnemiesAlive(){\n return state.getPlayers().size()-1;\n }", "private int getTotalPlayerCount() {\n String baseUrl = \"https://www.runescape.com/player_count.js?varname=iPlayerCount\";\n String url = baseUrl + \"&callback=jQuery33102792551319766081_1618634108386&_=\" + System.currentTimeMillis();\n try {\n String response = new NetworkRequest(url, false).get().body;\n Matcher matcher = Pattern.compile(\"\\\\(\\\\d+\\\\)\").matcher(response);\n if(!matcher.find()) {\n throw new Exception();\n }\n return Integer.parseInt(response.substring(matcher.start() + 1, matcher.end() - 1));\n }\n catch(Exception e) {\n return 0;\n }\n }", "int getKills(UUID player);", "public int countPlayers(Long gameId){\n List<User_Game> user_games = userGameRepository.retrieveGamePlayers(gameId);\n return user_games.size();\n }", "public int getPlayerIdsCount() {\n return playerIds_.size();\n }", "int getFriendCount();", "int getFriendCount();", "protected int countOfStatus(final Player player, final String status) {\r\n int hits = 0;\r\n String playerGFString = player.getGamefield();\r\n GameField playerGF = JsonConverter.convertStringToGamefield(playerGFString);\r\n for (Box box : playerGF.getGameField()) {\r\n if(box.getStatus().equals(status)){\r\n hits++;\r\n }\r\n } \r\n return hits;\r\n }", "public int getMaximumPlayers() {\n return maximumPlayers;\n }", "int getStatsCount();", "int getStatsCount();", "int getStatsCount();", "public void displayOutMarbles(int outMarblesCount, Player player) {\n System.out.println(player.getPlayerName()+\" a mis hors jeu \"+outMarblesCount+\" bille(s) du joueurs adverse !\");\n }", "public int countAvailablePowers (Power p) {\n return countPowers(p, 1);\n }", "public int numberOfBoats(){\n return this.boats.size();\n }", "public int getCount() {\n\t\t\treturn chatList.size();\n\t\t}", "public int getMaximumPlayers() {\n return getOption(ArenaOption.MAXIMUM_PLAYERS);\n }", "public static Integer getBotWins() {\n return humanVsBot.OWins + botVsHuman.XWins;\n }", "public int getNumberOfSelectedPlayers() {\n\t\treturn tmpTeam.size();\n\t}", "void listBots( String className, String messager ) {\n Iterator<ChildBot> i;\n ChildBot bot;\n String rawClassName = className.toLowerCase();\n\n if( rawClassName.compareTo( \"hubbot\" ) == 0 ) {\n m_botAction.sendSmartPrivateMessage( messager, \"There is only one true master, and that is me.\" );\n } else if( getNumberOfBots( className ) == 0 ) {\n m_botAction.sendSmartPrivateMessage( messager, \"No bots of that type.\" );\n } else {\n m_botAction.sendSmartPrivateMessage( messager, className + \":\" );\n\n for( i = m_botStable.values().iterator(); i.hasNext(); ) {\n bot = i.next();\n\n if( bot != null )\n if( bot.getClassName().compareTo( className ) == 0 )\n m_botAction.sendSmartPrivateMessage( messager, bot.getBot().getBotName() + \" (in \" + bot.getBot().getBotAction().getArenaName() + \"), created by \" + bot.getCreator());\n }\n\n m_botAction.sendSmartPrivateMessage( messager, \"End of list\" );\n }\n }", "private static void findLongCommSubs() {\n\n for(Player player : inputPlayersList){\n player.setLongCommSubsCounter(LongCommSubsForTwoStrings(player.getTicketNumber(), winningNumber).length());\n }\n }", "public int activePlayers() {\n int playerCount = 0;\n for (Player player : players) {\n if (player.getName() != null && player.getState()) {\n playerCount++;\n }\n }\n\n return playerCount;\n }", "@java.lang.Override\n public int getGoalsCount() {\n return goals_.size();\n }", "public int getPartyCount()\n\t{\n\t\tint r = 0;\n\t\tfor(int i = 0; i < m_pokemon.length; i++)\n\t\t\tif(m_pokemon[i] != null)\n\t\t\t\tr++;\n\t\treturn r;\n\t}", "public int GetPot_Count() {\n\t\treturn POT_COUNT;\n\t}", "int getChannelStatisticsCount();", "public int getLobbyIdCount() {\n return lobbyId_.size();\n }", "public int getChatCount()\n {\n return chatCount;\n }" ]
[ "0.6429145", "0.6385277", "0.636076", "0.6283052", "0.61960155", "0.60910517", "0.6077063", "0.59944385", "0.59927064", "0.59886", "0.5981696", "0.5981696", "0.5947837", "0.58922833", "0.5887985", "0.5881792", "0.5875385", "0.58445835", "0.5828176", "0.58166265", "0.5806971", "0.5805389", "0.5798692", "0.57658345", "0.57563466", "0.57502913", "0.5735217", "0.57347363", "0.57024205", "0.56510866", "0.56427807", "0.5612649", "0.5589848", "0.55854756", "0.55626017", "0.55525404", "0.55409735", "0.55178106", "0.5500289", "0.5488573", "0.5477956", "0.5459169", "0.5456189", "0.5446432", "0.54312074", "0.5423073", "0.5388765", "0.5384347", "0.53696334", "0.5365934", "0.53592265", "0.53592265", "0.5338647", "0.53312916", "0.5322048", "0.53141725", "0.5294445", "0.5288038", "0.5282091", "0.52722174", "0.5269832", "0.52622324", "0.52583814", "0.52566063", "0.525302", "0.52438986", "0.52291626", "0.522702", "0.52257884", "0.52248645", "0.5224048", "0.52197516", "0.52166307", "0.5211523", "0.5195692", "0.5177893", "0.5174852", "0.5161905", "0.5161905", "0.5161317", "0.5160103", "0.5155082", "0.5155082", "0.5155082", "0.51509213", "0.514844", "0.5139933", "0.5121353", "0.5121001", "0.5109614", "0.5107453", "0.51034546", "0.50954556", "0.5092457", "0.5091889", "0.50740016", "0.50727797", "0.5069995", "0.50655526", "0.5062976" ]
0.5264173
61
Lists the login names of all bots of a particular class name to the specified player in PM.
void listBots( String className, String messager ) { Iterator<ChildBot> i; ChildBot bot; String rawClassName = className.toLowerCase(); if( rawClassName.compareTo( "hubbot" ) == 0 ) { m_botAction.sendSmartPrivateMessage( messager, "There is only one true master, and that is me." ); } else if( getNumberOfBots( className ) == 0 ) { m_botAction.sendSmartPrivateMessage( messager, "No bots of that type." ); } else { m_botAction.sendSmartPrivateMessage( messager, className + ":" ); for( i = m_botStable.values().iterator(); i.hasNext(); ) { bot = i.next(); if( bot != null ) if( bot.getClassName().compareTo( className ) == 0 ) m_botAction.sendSmartPrivateMessage( messager, bot.getBot().getBotName() + " (in " + bot.getBot().getBotAction().getArenaName() + "), created by " + bot.getCreator()); } m_botAction.sendSmartPrivateMessage( messager, "End of list" ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void showWaitingPlayerList(List<String> waitingPlayerUsernames);", "public void printAllPlayers(){\n for (Player player : players){\n player.printPlayerInfo();\n }\n }", "public void sendNameInfoToAll(){\r\n\t\t\r\n\t\tVector<Player> players = lobby.getLobbyPlayers();\t\r\n\t\tString message = \"UDNM\" + lobby.getNameString();\r\n\t\t\r\n\t\tif(!players.isEmpty()){\r\n\t \tfor(int i=0; i<players.size(); i++){\t \t\t\r\n\t \t\tsendOnePlayer(players.get(i), message);\t \t\t\r\n\t \t}\r\n\t\t}\r\n\t}", "public static List<String> getOnlinePlayerNames() {\n Iterable<User> onlineUsers = SlapPlugin.getInstance().getEssentials().getOnlineUsers();\n return StreamSupport.stream(onlineUsers.spliterator(), false)\n .map(user -> StringUtils.isEmpty(user.getNickname()) ? user.getName() : user.getNickname())\n .collect(Collectors.toList());\n }", "public List<String> getAllPlayerNames() {\n List<String> playerNames = new ArrayList<>(10);\n for (Player p : players) {\n playerNames.add(p.getName());\n }\n return playerNames;\n }", "private void getPlayerList(){\r\n\r\n PlayerDAO playerDAO = new PlayerDAO(Statistics.this);\r\n players = playerDAO.readListofPlayerNameswDefaultFirst();\r\n\r\n }", "@Override\n public List<String> onTabComplete(CommandSender commandSender, org.bukkit.command.Command command, String label, String[] args) {\n // We currently don't want to tab-completion here\n // Return a new List so it isn't a list of online players\n return Collections.emptyList();\n }", "public static List<String> getNearbyPlayers(Location loc, double radius) {\n\t\tList<String> playerNames = new ArrayList<String>();\n\t\tfor (Player player : Bukkit.getOnlinePlayers()) {\n\t\t\tif (player.getLocation().getWorld().equals(loc.getWorld())) {\n\t\t\t\tif (loc.distanceSquared(player.getLocation()) < Math.pow(radius, 2)) {\n\t\t\t\t\tplayerNames.add(player.getName());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn playerNames;\n\t}", "List<Player> listPlayers();", "public static ArrayList<String> getPlayerInformation() {\n clearScreen();\n ArrayList<String> Names = new ArrayList<String>();\n for (int i = 1; i < 3; i++) {\n System.out.println(\"Player \" + i + \"'s Name:\");\n Names.add(Input.nextLine());\n clearScreen();\n }\n return Names;\n }", "public List<Player> findAllPlayers(){\n\t\treturn playerRepository.findAll();\n\t}", "public static ArrayList<String> getListOfAllAvailableCommandsForACertainPlayer(Player p) {\n ArrayList<String> list = new ArrayList<>();\n\n for (final Map.Entry<String, CmdProperties> entry : commandClasses.entrySet()) {\n if (p.hasPermission(entry.getValue().getPermission())) {\n list.add(entry.getKey());\n }\n }\n\n return list;\n }", "@SuppressWarnings(\"unused\")\n public static List<String> getDiscordChatMutedPlayers() {\n return DiscordListener.chatMuted;\n }", "public List<String> getAllPlayers() throws ServerProblem {\r\n\ttry (Connection connTDB = ConnectionManager.getInstance().getConnection()) {\r\n\t LOGGER.debug(\"Getting all players\");\r\n\t List<String> results = engine.getAllPlayers(connTDB);\r\n\t LOGGER.debug(\"Players found in the database: \" + results);\r\n\t return results;\r\n\t} catch (Exception ex) {\r\n\t String error = \"Problem encountered getting all players: \" + ex;\r\n\t LOGGER.error(error);\r\n\t throw new ServerProblem(error, ex);\r\n\t}\r\n }", "List<Player> findAllPlayers();", "public void sendGameInfoToAll(){\r\n\t\t\r\n\t\tVector<Player> players = lobby.getLobbyPlayers();\t\r\n\t\tString message = \"UDGM\" + lobby.getGameString();\r\n\t\t\r\n\t\tif(!players.isEmpty()){\r\n\t \tfor(int i=0; i<players.size(); i++){\t \t\t\r\n\t \t\tsendOnePlayer(players.get(i), message);\t \t\t\r\n\t \t}\r\n\t\t}\r\n\t}", "public List<String> listPlayerNames() {\n return this.playersNames;\n }", "public void getPlayerList() {\n if (connected == true) {\n try {\n write(\"get playerlist\");\n } catch (IOException e) {\n System.out.println(\"No connecting with server:ServerCommunication:getPlayerList()\");\n }\n }\n }", "public String[] getPlayersUsername(){\n String[] usernames = new String[players.size()];\n Iterator it = players.entrySet().iterator();\n int i = 0;\n while(it.hasNext()){\n Map.Entry pair = (Map.Entry)it.next();\n usernames[i] = (String)pair.getKey();\n i++;\n }\n return usernames;\n }", "List<Player> getPlayers();", "public void sendNameInfo(Player plr){\r\n\t\t\r\n\t\tString message = \"UDNM\" + lobby.getNameString();\r\n\t\tsendOnePlayer(plr, message);\r\n\t}", "public List<String> getRankingPlayer() throws IOException, ClassNotFoundException {\r\n return ctrlDomain.getRankingPlayer();\r\n }", "public List<SkungeePlayer> getPlayers(String... usernames) throws TimeoutException, InterruptedException, ExecutionException {\n\t\tPlayersPacket packet = new PlayersPacket();\n\t\tpacket.setNames(usernames);\n\t\treturn japson.sendPacket(packet);\n\t}", "public List<String> nicknames();", "@Override\r\n\tpublic List<Player> getAllPlayer(String email) {\n\t\treturn dao.getAllPlayer(email);\r\n\t}", "@Override\n public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {\n List<String> players = new ArrayList<>();\n List<String> completions = new ArrayList<>();\n for (Player player : Bukkit.getOnlinePlayers())\n players.add(player.getName());\n if (args.length == 1) {\n StringUtil.copyPartialMatches(args[0], players, completions);\n }\n return completions;\n }", "private List<String> validatePlayer(String playerName, CommandSender sender) {\n\n\t\tList<Player> players = new ArrayList<Player>();\n\t\tList<String> match = new ArrayList<String>();\n\n\t\tplayers = this.getServer().matchPlayer(playerName);\n\t\tif (players.isEmpty()) {\n\t\t\t// Check for an offline player (exact match).\n\t\t\tfor (OfflinePlayer player : Bukkit.getOfflinePlayers()) {\n\t\t\t\tif (player.getName().equals(playerName)) {\n\t\t\t\t\tmatch.add(player.getUniqueId().toString());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/*\n\t\t\tif (Arrays.asList(this.getServer().getOfflinePlayers()).contains(Bukkit.getOfflinePlayer(playerName))) {\n\t\t\t\tmatch.add(Bukkit.getOfflinePlayer(playerName).getName()); //.getUniqueId().toString());\n\t\t\t\t//match.add(Bukkit.getOfflinePlayer(Bukkit.getPlayer(playerName).getUniqueId()).getName()); //.getUniqueId().toString());\n\t\t\t} else {\n\t\t\t\t// look for partial matches\n\t\t\t\tfor (OfflinePlayer offline : this.getServer().getOfflinePlayers()) {\n\t\t\t\t\tif (offline.getName().toLowerCase().startsWith(playerName.toLowerCase()))\n\t\t\t\t\t\tmatch.add(offline.getName()); //.getUniqueId().toString());\n\t\t\t\t}\n\t\t\t}\n\t\t\t*/\n\n\t\t} else {\n\t\t\tfor (Player player : players) {\n\t\t\t\tmatch.add(player.getUniqueId().toString());\n\t\t\t}\n\t\t}\n\n\t\tif (match.isEmpty()) {\n\t\t\tsender.sendMessage(ChatColor.RED + \"Player not found!\");\n\t\t\treturn null;\n\t\t} else if (match.size() > 1) {\n\t\t\tsender.sendMessage(ChatColor.RED + \"Too many matches found! (\" + match.toString() + \")\");\n\t\t\treturn null;\n\t\t}\n\n\t\treturn match;\n\n\t}", "static List<Player> getAllPlayers() {\n\t\treturn null;\r\n\t}", "public void printOtherPlayersInfo(Match match, String nickname) {\n try {\n ArrayList<Player> otherPlayers = match.getOtherPlayers(nickname);\n for (Player player : otherPlayers) {\n System.out.println(player.getNickname());\n System.out.println(player.getNumOfToken());\n ShowScheme scheme = new ShowScheme(player.getScheme());\n System.out.println(\"\");\n chooseAction(match, nickname);\n }\n } catch (NullPointerException e) {\n } catch (NumberFormatException e) {\n System.out.println(\"Digita un carattere valido\");\n } catch (IndexOutOfBoundsException e) {\n }\n\n }", "public List<Player> getAll() {\n PlayerDB pdb = new PlayerDB();\n return pdb.getAll();\n }", "public List<SkungeePlayer> getPlayers(SkungeeServer server, String... usernames) throws TimeoutException, InterruptedException, ExecutionException {\n\t\tPlayersPacket packet = new PlayersPacket();\n\t\tpacket.setNames(usernames);\n\t\tpacket.setServers(server);\n\t\treturn japson.sendPacket(packet);\n\t}", "@PermitAll\n public void cmdWho(User teller) {\n Formatter msg = new Formatter();\n Collection<Player> playersOnline = tournamentService.findOnlinePlayers();\n for (Player player : playersOnline) {\n msg.format(\" %s \\\\n\", player);\n }\n command.qtell(teller, msg);\n }", "private void getPlayers() {\r\n\t\tSystem.out.println(\"How Many Players: \");\r\n\t\tpnum = getNumber(1, 3);\r\n\r\n\t\tfor(int i=0; i < pnum; i++){\r\n\t\t\tSystem.out.println(\"What is player \" + (i + 1) + \"'s name? \");\r\n\t\t\tString name = sc.next();\r\n\t\t\tboolean dupe = true;\r\n\t\t\twhile(dupe){\r\n\t\t\t\tint samecounter = 0;\r\n\t\t\t\tfor(Player p : players){\r\n\t\t\t\t\tif(name.equals(p.getName())){\r\n\t\t\t\t\t\tsamecounter += 1;\r\n\t\t\t\t\t\tSystem.out.println(\"Name is the same as another players. Please choose another name: \");\r\n\t\t\t\t\t\tname = sc.next();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(samecounter == 0){\r\n\t\t\t\t\tdupe = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tplayers.add(new Player(name));\r\n\r\n\t\t}\r\n\t}", "@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)\n public void onPlayerLogin(PlayerLoginEvent event) {\n String playerName = event.getPlayer().getName();\n \n if(plugin.bannedPlayers.contains(playerName)){\n \t event.setKickMessage(\"You are banned from this server!\");\n \t event.setResult(Result.KICK_BANNED);\n \t \n }\n \n \n }", "public String getLoggedPlayerName() {\r\n return ctrlDomain.getLoggedPlayerName();\r\n }", "public static List<String> tabComplete(CommandSender sender, String[] args) {\n\t\tif (!Util.testPermission(sender, \"homeother\") || args.length != 2) return null;\n\t\t\n\t\tList<String> list = createEmptyList();\n\t\tOfflinePlayer offPlayer = SlapHomebrew.getInstance().getServer().getOfflinePlayer(args[0]);\n\t\tif (offPlayer.getPlayer() == null && !offPlayer.hasPlayedBefore()) { //If player doesn't exist\n\t\t\treturn list;\n\t\t}\n\t\t\t\t\n\t\t//Add list and all homes\n\t\tlist.add(\"list\");\n\t\ttry {\n\t\t\tlist.addAll(SlapHomebrew.getInstance().getHomes().getHomes(args[0]));\n\t\t} catch (CommandException e) {}\n\t\t\n\t\t//Filter\n\t\tfilterResults(list, args[1]);\n\t\t\n\t\treturn list; //Return\n\t}", "Collection<User> players();", "public ArrayList<Bot> getAllBots() {\n final String errorMessage = \"Error getting all bots\";\n ResultSet retrievedBots = dbConnector.selectQuery(\"SELECT c.name, bot_id, active_time, probability, activity_status\" +\n \" FROM Bots as b, Company as c WHERE b.company_id = c.company_id;\");\n ArrayList<Bot> bots = null;\n try {\n bots = new ArrayList<Bot>();\n while (retrievedBots.next()) {\n bots.add(toBot(retrievedBots));\n }\n } catch (SQLException e) {\n System.out.println(errorMessage);\n }\n return bots;\n }", "private List<String> receiveConnectedPlayers(@NotNull String data) {\n ConnectedPlayersDto result = GameGraphics.gson.fromJson(data, ConnectedPlayersDto.class);\n if (result.players != null) {\n players = result.players.stream()\n .filter(Objects::nonNull)\n .map(player -> player.name)\n .collect(Collectors.toList());\n return players;\n }\n return null;\n }", "public void setNames(){\n System.out.println();\n System.out.println(\"Welcome! Please set your username!\");\n for(int i = 0; i < players.size(); i ++){\n Player player = players.get(i);\n player.rename(\"Dealer Jack\");\n for(int j = 0; j < i; j ++){\n while(player.getName().equals(players.get(j).getName())){\n System.out.println(\"Username taken! Please enter another name!\");\n player.setName(\"player\" + (i + 1));\n player.rename(\"Dealer Jack\");\n }\n }\n }\n }", "@Override\r\n\tpublic List loginusername(String un) {\n\t\treturn homedao.loginusername(un);\r\n\t}", "public void logGameWinner(Player p){\n\t\t\n\t\tif(p instanceof HumanPlayer) {\n\t\t\tlog += String.format(\"%nUSER WINS GAME\");\n\t\t\twinName =\"Human\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tAIPlayer ai = (AIPlayer) p;\n\t\t\tlog += String.format(\"%n%s WINS GAME\", ai.getName().toUpperCase());\n\t\t\twinName = ai.getName();\n\t\t}\n\t\tlineBreak();\n\t}", "public void printAllPlayerStats(List<Player> players);", "public List<PlayerInfo> getPlayerList(GameInfo gi){\n\t\tClientModelFacade facade = ClientModelFacade.getInstance(null);\n\t\t\n\t\tGameInfo[] gameList = facade.getGamesList();\n\n\t\tfor(int i = 0; i < gameList.length; i++){\n\t\t\tif(gameList[i].getId() == gi.getId()){\n\t\t\t\treturn gameList[i].getPlayers();\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "@RequestMapping(\"/playernames\")\n public List<String> getAllPlayerNames(){\n return playerService.getPlayerNames();\n }", "public List<PlayerInstance> getAllPlayers()\n\t{\n\t\tfinal List<PlayerInstance> players = new ArrayList<>();\n\t\tfor (Creature temp : getCharactersInside())\n\t\t{\n\t\t\tif (temp instanceof PlayerInstance)\n\t\t\t{\n\t\t\t\tplayers.add((PlayerInstance) temp);\n\t\t\t}\n\t\t}\n\t\treturn players;\n\t}", "@Override\r\n\tpublic ArrayList<PlayerPO> getAllPlayers() {\n\t\treturn playerController.getAllPlayers();\r\n\t}", "public List<PlayerItem> getAllPlayerItemById(Player player);", "public String[] getPlayers() {\r\n return playerIds;\r\n }", "default List<Player> getViewers(Class<? extends SimpleInventory> clazz) {\n return this.getViewers().stream()\n .filter(viewer -> this.getOpenedInventory(viewer).getClass().equals(clazz))\n .collect(Collectors.toList());\n }", "@Override\n public List<Player> getPlayers() {\n return players;\n }", "private String getPlayersInfo(List<LightPlayer> players, String name){\n StringBuilder stringBuilder = new StringBuilder();\n for (LightPlayer player : players){\n stringBuilder.append(player.getName());\n if (player.getName().equals(name)) {\n stringBuilder.append(\" (you)\");\n }\n\n stringBuilder\n .append(\"\\n\")\n .append(player.getColor().name())\n .append(\" \")\n .append(\"[\")\n .append(player.getColor().name().toCharArray()[0])\n .append(\"]\")\n .append(\"\\n\");\n\n if (player.getCard() != null) {\n stringBuilder.append(player.getCard().getName().name());\n }\n\n stringBuilder.append(\"\\n\\n\\n\");\n }\n\n return stringBuilder.toString();\n }", "private void login(){\n out.println(\"Enter player name: \");\n player = new Player(in.nextLine());\n game.addPlayerObject(player);\n out.println(\"Player name set to: \" + player.getName() + \"\\r\\n\");\n\n game.incrementPlayersConnected();\n\n login = true;\n }", "public static List<ChatChannel> getChannelsByPlayer(final Player player) {\n List<ChatChannel> list = new ArrayList<ChatChannel>();\n for (ChatChannel cch : ChatManager.channels.values())\n if (cch.isSubscribed(player))\n list.add(cch);\n return list;\n }", "public void listNations(Player player) {\n\t\tplayer.sendMessage(ChatTools.formatTitle(\"Nations\"));\n\t\tArrayList<String> formatedList = new ArrayList<String>();\n\t\tfor (Nation nation : plugin.getTownyUniverse().getNations())\n\t\t\tformatedList.add(Colors.LightBlue + nation.getName() + Colors.Blue + \" [\" + nation.getNumTowns() + \"]\" + Colors.White);\n\t\tfor (String line : ChatTools.list(formatedList))\n\t\t\tplayer.sendMessage(line);\n\t}", "@Override\r\n public String toString(){\n \r\n for(Player player: players){\r\n if(player == null){\r\n continue;\r\n }\r\n System.out.println(player.toString());\r\n }\r\n return \"\";\r\n }", "public JList<Player> getPlayerListGui() {\r\n return playerListGui;\r\n }", "public List <FootballPlayer> getAllPlayers() {\n\t\treturn market.getAllPlayers();\n\t}", "String getPlayerName();", "public List<String> getLogins() {\n List<String> logins = new ArrayList<>();\n for (Commissioner commissioner: Database.getCommissionerSet()) {\n logins.add(commissioner.getLogin());\n }\n return logins;\n }", "public List<Game> getFullGameList() {\n List<Game> listOfGames = null;\n Session session = sessionFactory.openSession();\n // Try to return the user by the given nickname\n try {\n session.beginTransaction();\n // if mode equals ALL then get full list of games\n listOfGames = session.createCriteria(Game.class).list();\n \n session.getTransaction().commit();\n session.flush();\n } \n catch (HibernateException e) { return null; } \n finally { session.close(); }\n // Return userID if seted\n return listOfGames;\n }", "public static void SetPlayerNames () {\n for (int i = 0; i < player_count; i++) {\r\n\r\n // PROMPT THE USER\r\n System.out.print(\"Player \" + (i+1) + \", enter your name: \");\r\n\r\n // INSTANTIATE A NEW PLAYER USING THE NAME THAT'S PROVIDED\r\n player[i] = new Player(input.nextLine());\r\n\r\n // IF THE PLAYER DOESN'T ENTER A NAME, CALL THEM \"BIG BRAIN\"\r\n if (player[i].name.length() == 0) {\r\n player[i].name = \"Big Brain\";\r\n System.out.println(\"Uh, OK...\");\r\n }\r\n\r\n }\r\n\r\n // MAKE SOME SPACE...\r\n System.out.println();\r\n }", "@Override\n\tpublic List<Player> getPlayer() {\n\t\treturn ofy().load().type(Player.class).list();\n\t}", "public String getPlayerListName ( ) {\n\t\treturn handleOptional ( ).map ( Player :: getPlayerListName ).orElse ( name );\n\t}", "public static List<Player> getTrackablePlayers() {\n\t\tPlayer[] players = Bukkit.getOnlinePlayers();\n\t\tList<Player> players1 = new ArrayList<Player>();\n\t\tfor (int i = 0; i < players.length; i++) {\n\t\t\tif (!players[i].hasMetadata(\"invisible\")) {\n\t\t\t\tplayers1.add(players[i]);\n\t\t\t}\n\n\t\t}\n\t\treturn players1;\n\t}", "void listBotTypes( String messager ) {\n Iterator<String> i;\n Integer number;\n String className;\n\n m_botAction.sendSmartPrivateMessage( messager, \"Listing bot types:\" );\n\n for( i = m_botTypes.keySet().iterator(); i.hasNext(); ) {\n className = i.next();\n number = m_botTypes.get( className );\n\n if( number.intValue() > 0 )\n m_botAction.sendSmartPrivateMessage( messager, className + \": \" + number );\n }\n\n m_botAction.sendSmartPrivateMessage( messager, \"End of list\" );\n }", "ArrayList<Player> getAllPlayer();", "public List<LobbyPlayer> getPlayers(String code) throws NoDocumentException {\n return Firebase.requestDocument(\"lobbies/\" + code).toObject(LobbyDTO.class).toModel().getPlayers();\n }", "@RequestMapping(\"/players\")\n public List<Player> getAllPlayers() {\n return playerService.getPlayerList();\n }", "@Override\r\n\tpublic ArrayList<PlayerPO> findPlayerByName(String name) {\n\t\treturn playerController.findPlayerByName(name);\r\n\t}", "public void onPlayerLoggedIn() {\n\t\tshowPlayerButtons();\n\t}", "public List<Models.Class> showClasses() {\n // Get from all levels\n List<Models.Class> results = em.createNativeQuery(\"select c.* from class c, classparticipant cpa, participant p where c.classid = cpa.classid and cpa.participantid = p.participantid and p.userid = ?\", Models.Class.class).setParameter(1, user.getUserid()).getResultList();\n\n // Display the output\n String output = \"\";\n\n output = addChat(results.size() + \" classes were found.\");\n\n for (Models.Class classroom : results) {\n output += \"<div class='result display' onclick=\\\"window.location.href='Class?id=\" + classroom.getClassid() + \"'\\\">\\n\"\n + \" <div class='top'>\\n\"\n + \" <img class='icon' src='https://www.flaticon.com/svg/static/icons/svg/717/717874.svg'>\\n\"\n + \" <div class='text'>\\n\"\n + \" <a class='type'>CLASS</a>\\n\"\n + \" <a class='name'>\" + classroom.getClasstitle() + \"</a>\\n\"\n + \" <a class='subname'>\" + classroom.getClassid() + \"</a>\\n\"\n + \" </div>\\n\"\n + \" </div>\\n\"\n + \" </div>\";\n }\n\n servlet.putInJsp(\"result\", output);\n return results;\n }", "public List<Result> getPlayerResults(Player player) {\t\n\t\treturn results.stream()\n\t\t\t\t.filter(result -> result.participated(player))\n\t\t\t\t.collect(Collectors.toList());\n\t}", "public void drawPlayerNames(Graphics g) {\n\t}", "List<Account> getAccounts(String login);", "public void sendGameInfo(Player plr){\r\n\t\t\r\n\t\tString message = \"UDGM\" + lobby.getGameString();\r\n\t\tsendOnePlayer(plr, message);\r\n\t}", "void showWaitingRoom(ArrayList<String> usernames);", "public Set<String> getPlayers()\n\t{\n\t\tSet<String> player = playerPieces.keySet();\n\t\treturn player;\n\t}", "public List<String> getLoggerNames();", "private static ArrayList<String> getPlayerFileNames() {\n\n ArrayList<String> fileNames = new ArrayList<String>();\n\n File folder = new File(\"otterbein/pig/player\");\n File[] listOfFiles = folder.listFiles();\n\n for (int i = 0; i < listOfFiles.length; i++) {\n if (listOfFiles[i].isFile()) {\n if (listOfFiles[i].getName().endsWith(\".class\")) {\n fileNames.add(listOfFiles[i].getName());\n }\n }\n }\n\n return fileNames;\n }", "protected abstract Player getModPlayer(String name);", "public List<Limit> list(String username);", "public List<Player> getAllPlayersLimit(int limit) {\n\t\treturn repository.findAll(limit);\n\t}", "java.util.List<com.lvl6.proto.QuestProto.UserQuestJobProto> \n getUserQuestJobsList();", "Set<String> getPlayers();", "public List<Player> getAllPlayers() {\r\n // TODO fix actual order of players in the List.\r\n\r\n List<Player> players = new ArrayList<>();\r\n players.addAll(teamRed.getPlayers());\r\n players.addAll(teamBlue.getPlayers());\r\n\r\n return players;\r\n }", "void notifyPlayerJoined(String username);", "public ListResponse<PlayerResponse> getPlayers() {\n\t\tcheckProvided();\n\t\treturn players;\n\t}", "List<TimeLog> findTimelog(String username);", "public List<ServerPlayerEntity> getPlayerList() {\n return this.players;\n }", "public List<Player> getPlayers() {\r\n return players;\r\n }", "public List<Player> getPlayers() {\r\n return players;\r\n }", "public List<PlayerItem> getAll();", "@Override\n public String toString() {\n String className = getClass().getName();\n return className.substring(className.lastIndexOf('.')+1) + \n \" pid: \" + playerId;\n }", "public List<Player> findPlayers(List<Role> rl) {\n List<Player> pl = new ArrayList<Player>();\n for(Player p: players){\n for(Role r: rl){\n if(r.equals(p.getRole())){\n pl.add(0, p);\n }\n }\n }\n return pl;\n }", "void spawnBot( String className, String login, String password, String messager ) {\n CoreData cdata = m_botAction.getCoreData();\n long currentTime;\n\n String rawClassName = className.toLowerCase();\n BotSettings botInfo = cdata.getBotConfig( rawClassName );\n\n if( botInfo == null ) {\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" tried to spawn bot of type \" + className + \". Invalid bot type or missing CFG file.\" );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader tried to spawn bot of type \" + className + \". Invalid bot type or missing CFG file.\" );\n\n m_botAction.sendSmartPrivateMessage( messager, \"That bot type does not exist, or the CFG file for it is missing.\" );\n return;\n }\n\n Integer maxBots = botInfo.getInteger( \"Max Bots\" );\n Integer currentBotCount = m_botTypes.get( rawClassName );\n\n if( maxBots == null ) {\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" tried to spawn bot of type \" + className + \". Invalid settings file. (MaxBots improperly defined)\" );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader tried to spawn bot of type \" + className + \". Invalid settings file. (MaxBots improperly defined)\" );\n\n m_botAction.sendSmartPrivateMessage( messager, \"The CFG file for that bot type is invalid. (MaxBots improperly defined)\" );\n return;\n }\n\n if( login == null && maxBots.intValue() == 0 ) {\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" tried to spawn bot of type \" + className + \". Spawning for this type is disabled on this hub.\" );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader tried to spawn bot of type \" + className + \". Spawning for this type is disabled on this hub.\" );\n\n m_botAction.sendSmartPrivateMessage( messager, \"Bots of this type are currently disabled on this hub. If you are running another hub, please try from it instead.\" );\n return;\n }\n\n if( currentBotCount == null ) {\n currentBotCount = new Integer( 0 );\n m_botTypes.put( rawClassName, currentBotCount );\n }\n\n if( login == null && currentBotCount.intValue() >= maxBots.intValue() ) {\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" tried to spawn a new bot of type \" + className + \". Maximum number already reached (\" + maxBots + \")\" );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader tried to spawn a new bot of type \" + className + \". Maximum number already reached (\" + maxBots + \")\" );\n\n m_botAction.sendSmartPrivateMessage( messager, \"Maximum number of bots of this type (\" + maxBots + \") has been reached.\" );\n return;\n }\n\n String botName, botPassword;\n currentBotCount = new Integer( getFreeBotNumber( botInfo ) );\n\n if( login == null || password == null ) {\n botName = botInfo.getString( \"Name\" + currentBotCount );\n botPassword = botInfo.getString( \"Password\" + currentBotCount );\n } else {\n botName = login;\n botPassword = password;\n }\n\n Session childBot = null;\n\n try {\n // FIXME: KNOWN BUG - sometimes, even when it detects that a class is updated, the loader\n // will load the old copy/cached class. Perhaps Java itself is caching the class on occasion?\n if( m_loader.shouldReload() ) {\n System.out.println( \"Reinstantiating class loader; cached classes are not up to date.\" );\n resetRepository();\n m_loader = m_loader.reinstantiate();\n }\n\n Class<? extends SubspaceBot> roboClass = m_loader.loadClass( \"twcore.bots.\" + rawClassName + \".\" + rawClassName ).asSubclass(SubspaceBot.class);\n String altIP = botInfo.getString(\"AltIP\" + currentBotCount);\n int altPort = botInfo.getInt(\"AltPort\" + currentBotCount);\n String altSysop = botInfo.getString(\"AltSysop\" + currentBotCount);\n\n if(altIP != null && altSysop != null && altPort > 0)\n childBot = new Session( cdata, roboClass, botName, botPassword, currentBotCount.intValue(), m_group, altIP, altPort, altSysop, true);\n else\n childBot = new Session( cdata, roboClass, botName, botPassword, currentBotCount.intValue(), m_group, true);\n } catch( ClassNotFoundException cnfe ) {\n Tools.printLog( \"Class not found: \" + rawClassName + \".class. Reinstall this bot?\" );\n return;\n }\n\n currentTime = System.currentTimeMillis();\n\n if( m_lastSpawnTime + SPAWN_DELAY > currentTime ) {\n m_botAction.sendSmartPrivateMessage( messager, \"Subspace only allows a certain amount of logins in a short time frame. Please be patient while your bot waits to be spawned.\" );\n\n if( m_spawnQueue.isEmpty() == false ) {\n int size = m_spawnQueue.size();\n\n if( size > 1 ) {\n m_botAction.sendSmartPrivateMessage( messager, \"There are currently \" + m_spawnQueue.size() + \" bots in front of yours.\" );\n } else {\n m_botAction.sendSmartPrivateMessage( messager, \"There is only one bot in front of yours.\" );\n }\n } else {\n m_botAction.sendSmartPrivateMessage( messager, \"You are the only person waiting in line. Your bot will log in shortly.\" );\n }\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" in queue to spawn bot of type \" + className );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader in queue to spawn bot of type \" + className );\n }\n\n String creator;\n\n if(messager != null) creator = messager;\n else creator = \"AutoLoader\";\n\n ChildBot newChildBot = new ChildBot( rawClassName, creator, childBot );\n addToBotCount( rawClassName, 1 );\n m_botStable.put( botName, newChildBot );\n m_spawnQueue.add( newChildBot );\n }", "public void setPlayers(ArrayList<String> players) {\n this.players = new ArrayList<>();\n this.nicknames = new ArrayList<>();\n for (int i = 0; i < players.size(); i++) {\n if (!players.get(i).equals(gui.getViewController().getNickName())){\n JMenuItem newPlayerItem = new JMenuItem(players.get(i));\n newPlayerItem.addActionListener(new OpponentItemListener(gui.getViewController(),i));\n this.players.add(newPlayerItem);\n }\n this.nicknames.add(new JLabel(players.get(i)));\n this.nicknames.get(i).setHorizontalAlignment(SwingConstants.CENTER);\n this.nicknames.get(i).setVerticalAlignment(SwingConstants.CENTER);\n }\n for(int i = 0; i<this.players.size();i++){\n this.playerMenu.add(this.players.get(i));\n }\n initTurnPanel();\n }", "public void listTowns(Player player) {\n\t\tplayer.sendMessage(ChatTools.formatTitle(\"Towns\"));\n\t\tArrayList<String> formatedList = new ArrayList<String>();\n\t\tfor (Town town : plugin.getTownyUniverse().getTowns())\n\t\t\tformatedList.add(Colors.LightBlue + town.getName() + Colors.Blue + \" [\" + town.getNumResidents() + \"]\" + Colors.White);\n\t\tfor (String line : ChatTools.list(formatedList))\n\t\t\tplayer.sendMessage(line);\n\t}", "public String getPlayername(Player player) {\n System.out.println(\"――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――\");\n System.out.println(\"Merci de d'indiquer le nom du joueur \"+player.getColor().toString(false)+\" : \");\n String name = readInput.nextLine();\n return name;\n }", "public List<Player> getPlayerList(){\n return this.players;\n }" ]
[ "0.60973644", "0.5764923", "0.5752954", "0.5705262", "0.56926584", "0.5672428", "0.55967623", "0.55275327", "0.5496806", "0.5495307", "0.54756457", "0.5454306", "0.54287785", "0.5420627", "0.5394267", "0.5363511", "0.53344667", "0.53042245", "0.529522", "0.52925175", "0.52908784", "0.5239749", "0.5225578", "0.5204883", "0.5203539", "0.52032626", "0.5192592", "0.5188859", "0.51429254", "0.51152587", "0.50954044", "0.50945324", "0.50916934", "0.5089615", "0.5079498", "0.5069509", "0.505661", "0.50489634", "0.50333446", "0.5023022", "0.499991", "0.49904382", "0.49890304", "0.49871224", "0.49843994", "0.49746296", "0.49723893", "0.4951332", "0.49509284", "0.49494684", "0.49387294", "0.49245495", "0.492435", "0.49181926", "0.49024233", "0.48993155", "0.4898887", "0.4897485", "0.48935544", "0.4892542", "0.48818332", "0.48817003", "0.48665625", "0.48632306", "0.4863133", "0.48629585", "0.48620707", "0.4857488", "0.4851188", "0.4837456", "0.48306817", "0.4829086", "0.4822747", "0.4816612", "0.4816155", "0.48139003", "0.48135957", "0.48127276", "0.48036423", "0.48032248", "0.47947052", "0.47921145", "0.47804624", "0.477831", "0.47771645", "0.4771799", "0.47642568", "0.47628477", "0.47608504", "0.4758482", "0.47523475", "0.47523475", "0.47469518", "0.47436565", "0.47396696", "0.47374415", "0.47370628", "0.47177425", "0.4716497", "0.47052535" ]
0.580522
1
Increments the count of a particular class of bots with a specified value.
void addToBotCount( String className, int valueToAdd ) { Integer newBotCount; Integer oldBotCount; oldBotCount = m_botTypes.get( className ); if( oldBotCount != null ) { if( oldBotCount.intValue() + valueToAdd >= 0 ) { newBotCount = new Integer( oldBotCount.intValue() + valueToAdd ); m_botTypes.put( className, newBotCount ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getBotCount(String className) {\n Integer currentBotCount = m_botTypes.get( className.toLowerCase() );\n\n if( currentBotCount == null ) {\n currentBotCount = new Integer( 0 );\n m_botTypes.put( className.toLowerCase(), currentBotCount );\n }\n\n return currentBotCount;\n }", "public void incrementNumberOfWins(TypeOfGames type) {\n statistics.get(type).incrementNumberOfWins();\n }", "public void incrementCount() {\n count++;\n }", "int getNumberOfBots( String className ) {\n Integer number = m_botTypes.get( className );\n\n if( number == null ) {\n return 0;\n } else {\n return number.intValue();\n }\n }", "public void incCount() { }", "public void incrementNumOfBoats() {\n\t\tnumOfBoats++;\n\t}", "private void increaseDBValue(String target, int value){\n database.getReference(gameCodeRef).child(target).setValue(value+1);\n }", "public void incGamesPlayed() {\n gamesPlayed++;\n }", "void incrementCount();", "public void incrementCount() {\n\t\tcount++;\n\t}", "public void incrementNumAttacked( ){\n this.numAttacked++;\n }", "public void increaseCount(){\n myCount++;\n }", "public void incrementCount(){\n count+=1;\n }", "public void increaseWins(){\n this.numberOfWins=this.numberOfWins+1;\n }", "public void setWins() {\r\n this.wins++;\r\n }", "public int incrementNumberWins()\n\t{\n\t\treturn myNumberWins++;\n\t}", "Builder addCommentCount(Integer value);", "public void incOWins() {\n oWins++;\n }", "private void _updateCount(int classType) {\n int subClass, superClass;\n\n instances_[classType].count++;\n subClass = classType;\n while ( (superClass = CLASS_INFO[subClass][INDEX_SUPER]) != CS_C_NULL) {\n instances_[superClass].count++;\n subClass = superClass;\n }\n }", "public void incrementAmountBought() {\n amountBought++;\n }", "public void incrTurn(){\n this.turn++;\n }", "public Builder setCount(int value) {\n \n count_ = value;\n onChanged();\n return this;\n }", "private void setLikesCount(int value) {\n \n likesCount_ = value;\n }", "public void incrementScore(int val) {\n score += val;\n }", "public void setCount(int value) {\n this.count = value;\n }", "public void setCount(int value) {\n this.count = value;\n }", "public void setCount(int value) {\n this.count = value;\n }", "public void incrementNumberGames(TypeOfGames type) {\n statistics.get(type).incrementNumberGames();\n }", "public void setCounter(int value) { \n\t\tthis.count = value;\n\t}", "public void setWins(int value) {\n this.wins = value;\n }", "public void updateScore(int score){ bot.updateScore(score); }", "default void inc(long value) {\n\t\tcount(Math.abs(value));\n\t}", "public void changeCount(final int c) {\n\t\tcount += c;\n\t}", "public void set_count(int c);", "public void increase(int number) {\r\n this.count += number;\r\n }", "public void increase(int number) {\r\n this.count += number;\r\n }", "public void incrementCoinCount() {\n coinCount++;\n System.out.println(\"Rich! Coin count = \" + coinCount);\n }", "public void increaseTurnCount()\n\t{\n\t\tturnNumber++;\n\t\tthis.currentPlayerID++;\n\t\tthis.currentPlayerID = this.currentPlayerID % this.playerList.size();\n\t}", "Builder addCommentCount(String value);", "public void increment(){\n value+=1;\n }", "public void incrementWin(){wins += 1;}", "private static void setCounter() {++counter;}", "public void addWinnings(int value) {\n\t\tint winnings = getWinnings();\n\t\twinnings = winnings + value;\n\t\tString strWinnings = Integer.toString(winnings);\n\t\tBashCmdUtil.bashCmdNoOutput(\"sed -i \\\"1s/.*/ \"+strWinnings+\" /\\\" data/winnings\");\n\t}", "public void incCounter(){\n counter++;\n }", "public void like() {\n this.likes += 1;\n }", "public void incrementNumberOfShips(int value) {\r\n\t\tnumberOfShips = numberOfShips + value;\r\n\t}", "public void counter(MetricCounter<Integer> metric, int value);", "public void incrementAmount() { amount++; }", "public void incCounter()\n {\n counter++;\n }", "private void incrementCounter()\r\n\t{\r\n\t\tthis.counter++;\r\n\t}", "public void setBonusScore() {\r\n count = count+50;\r\n }", "public void increaseNumHits() {\n\t\tthis.numHits += 1;\n\t}", "public void addCount()\n {\n \tcount++;\n }", "public void addOneToScore() {\r\n score++;\r\n }", "public static void playerWonInc(){\r\n\t\t_playerWon++;\r\n\t}", "void addValueClassCB(int classType) {\n instances_[classType].logNum++;\n instances_[classType].logTotal++;\n }", "public void increaseCourseCount(){}", "private synchronized void incrementCount()\n\t{\n\t\tcount++;\n\t}", "private static void increasePrimitive(int value) {\n value++;\n }", "Builder addInteractionStatistic(InteractionCounter value);", "Status setWornCount();", "public void increaseScenarioCountBy(int amount) {\n this.scenarioCount += amount;\n }", "public void increment(long value) {\n mCount.getAndIncrement();\n mTotal.getAndAdd(value);\n }", "public void setCount(String type){\n if(type.equals(\"Zombie\")){\n this.zombieCounter -= 1;\n } else if (type.equals(\"Sandwich\")){\n this.sandwichCounter -= 1;\n }\n }", "void updateFrequencyCount() {\n //Always increments by 1 so there is no need for a parameter to specify a number\n this.count++;\n }", "public void incrementScore(int amount){\n\t\tthis.score += amount;\n\t}", "@Override\n public synchronized void increment() {\n count++;\n }", "public synchronized void incrementCount() {\r\n\t\tcount++;\r\n\t\tnotifyAll();\r\n\t}", "public void incrementScore(final int value, Firebase reference){\n reference.child(\"score\").runTransaction(new Transaction.Handler() {\n @Override\n public Transaction.Result doTransaction(MutableData mutableData) {\n if (mutableData.getValue(Integer.class) == null) {\n mutableData.setValue(0);\n } else {\n mutableData.setValue(mutableData.getValue(Integer.class) + value);\n }\n return Transaction.success(mutableData);\n }\n\n @Override\n public void onComplete(FirebaseError firebaseError, boolean b, DataSnapshot dataSnapshot) {\n Log.i(TAG, \"Successfully incremented score for player \" + LaserTagApplication.getUid());\n Team.getInstance().incrementScore(value);\n }\n });\n }", "int getTotalBotCount() {\n int t = 0;\n\n for (Integer i : m_botTypes.values())\n t += i;\n\n return t;\n }", "public void increasecounter() {\n\t\tmPref.edit().putInt(PREF_CONVERTED, counter + 1).commit();\r\n\t}", "public static void updateCount(String url) {\n if(sites.isEmpty()) {\n sites.add(new SiteStats(url, 1));\n } else {\n //access via new for-loop\n for(Object object : sites) {\n SiteStats element = (SiteStats) object;\n if ((element.getUrl().equalsIgnoreCase(url))) {\n element.setNumVisits(element.getNumVisits() + 1);\n return;\n }\n }\n sites.add(new SiteStats(url, 1));\n }\n }", "public void updateBallCount() {\n mBallCount = (int) NetworkTableInstance.getDefault().getTable(\"SmartDashboard\").getEntry(\"Driver/Set Ball Count\")\n .getDouble(3);\n }", "public void setNumofbids(int value) {\n this.numofbids = value;\n }", "public void set_count(int value) {\n setUIntBEElement(offsetBits_count(), 16, value);\n }", "public void addCount()\r\n {\r\n bookCount++;\r\n }", "public void IncrementCounter()\r\n {\r\n \tsetCurrentValue( currentValue.add(BigInteger.ONE)); \r\n \r\n log.debug(\"counter now: \" + currentValue.intValue() );\r\n \r\n }", "public static void incrementActivityScore() {\n\t\tmActivityScore++;\n\t\tsaveScore();\n\t}", "Builder addInteractionStatistic(InteractionCounter.Builder value);", "public void increseHitCount() {\n\r\n\t}", "public void count() {\n\t\talgae = -1;\n\t\tcrab = -1;\n\t\tbigFish = -1;\n\t\tfor(GameObjects o: objects) {\n\t\t\tswitch(o.toString()) {\n\t\t\tcase \"algae\":\n\t\t\t\talgae +=1;\n\t\t\t\tbreak;\n\t\t\tcase \"crab\":\n\t\t\t\tcrab +=1;\n\t\t\t\tbreak;\n\t\t\tcase \"big fish\":\n\t\t\t\tbigFish +=1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void updateScore(int winner)\n {\n if (winner == 0)\n {\n playerOneScore++;\n }\n else\n {\n playerTwoScore++;\n }\n }", "void set_num(ThreadContext tc, RakudoObject classHandle, double Value);", "public static void incrementScore() {\n\t\tscore++;\n\t}", "public void increase(String nickname) {\n\t\tint oldValue = this.getScore(nickname);\n\t\tscoreboard.replace(nickname, oldValue, oldValue + 1);\n\t}", "private void updateNrPlayerValues(String target) {\n database.getReference(gameCodeRef).child(target).addListenerForSingleValueEvent(new ValueEventListener()\n {\n @Override\n public void onDataChange(@NonNull DataSnapshot snapshot) {\n String value = String.valueOf(snapshot.getValue());\n if (value.isEmpty() || value == null || value.equals(null) || value.contains(\"null\")){\n startDBValue(target);\n value = \"1\";\n }\n else {\n increaseDBValue(target, Integer.parseInt(value));\n }\n switch (target){\n case \"NumberOfPlayers\":\n break;\n case \"PlayersDoneBrainstorming\":\n checkPlayersDoneBrainstorming(Integer.parseInt(value)+1);\n break;\n case \"PlayersDoneEliminating\":\n checkPlayersDoneEliminating(Integer.parseInt(value)+1);\n break;\n }\n }\n @Override\n public void onCancelled(@NonNull DatabaseError error) {\n Log.w(TAG,\"loadGamecode:onCancelled\", error.toException());\n }\n\n });\n }", "public void increment() {\n mNewNotificationCount.setValue(mNewNotificationCount.getValue() + 1);\n }", "public void setOneNewWanted () {\r\n numWanted ++;\r\n }", "public void incValue(){\n\t\tif(this.value < 9){\n\t\t\tthis.value++;\n\t\t}\n\t\telse{\n\t\t\tthis.value = 0;\n\t\t}\n\t}", "public void addVote() {\n this.votes++;\n }", "public void increment() { this.progressBar.setValue(++this.progressValue); }", "public static void enemyWonInc(){\r\n\t\t_enemyWon++;\r\n\t}", "public void incrementNumberOfDefeats(TypeOfGames type) {\n statistics.get(type).incrementNumberOfDefeats();\n }", "public void increase()\n {\n setCount(getCount() + 1);\n }", "public static synchronized void inccount()\r\n\t{\r\n\t\tcount++;\r\n\t}", "public void incrementActiveRequests() \n {\n ++requests;\n }", "public void setCount(int value) {\n this.bitField0_ |= 2;\n this.count_ = value;\n }", "private void wins(Player player){\n int win = 1;\n player.setWins(win);\n }", "public void incrementTimesPlayed() {\r\n\t\ttimesPlayed++;\r\n\t}", "public Builder setCount(long value) {\n \n count_ = value;\n onChanged();\n return this;\n }" ]
[ "0.6256783", "0.59537345", "0.59445804", "0.58983797", "0.58927715", "0.5855795", "0.5849012", "0.58479583", "0.5845743", "0.5845345", "0.5844566", "0.5839629", "0.5827852", "0.58078927", "0.57339567", "0.57326394", "0.56919944", "0.5669051", "0.56599677", "0.5650567", "0.5639806", "0.5634563", "0.56209075", "0.5615699", "0.559828", "0.559828", "0.559828", "0.55977535", "0.5583526", "0.55818397", "0.5574139", "0.557109", "0.55689734", "0.5543142", "0.5519748", "0.5519748", "0.55174786", "0.5515334", "0.5501117", "0.54946005", "0.54945844", "0.5489346", "0.54717916", "0.5466715", "0.54584384", "0.5445672", "0.54249644", "0.54062396", "0.54057765", "0.5398276", "0.5386117", "0.53756535", "0.5344178", "0.5328061", "0.5321708", "0.53196156", "0.53102696", "0.52905154", "0.52787614", "0.5277404", "0.5270019", "0.523949", "0.5238565", "0.52363724", "0.52360064", "0.5231092", "0.52228314", "0.5220797", "0.52113926", "0.5210077", "0.5208283", "0.5200234", "0.5196455", "0.5192082", "0.5183471", "0.51816803", "0.5172825", "0.51532954", "0.5150401", "0.5149799", "0.51494265", "0.51410466", "0.5137839", "0.51360124", "0.5132712", "0.5118273", "0.51111424", "0.5104485", "0.510397", "0.5102646", "0.5093837", "0.50863445", "0.5084555", "0.5079316", "0.50776184", "0.50758475", "0.50750077", "0.5073023", "0.507103", "0.5067619" ]
0.7563123
0
Returns the total number of bots spawned and active from this core
int getTotalBotCount() { int t = 0; for (Integer i : m_botTypes.values()) t += i; return t; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getAgentsCount() {\n if (agentsBuilder_ == null) {\n return agents_.size();\n } else {\n return agentsBuilder_.getCount();\n }\n }", "public int getAgentsCount() {\n return agents_.size();\n }", "@Exported\n public int getNumberOfOnlineSlaves() {\n int count = 0;\n for (Slave s : slaves) {\n if (s.getComputer().isOnline()) {\n count++;\n }\n }\n return count;\n }", "public int nbEnemiesAlive(){\n return state.getPlayers().size()-1;\n }", "int getExecutorActiveCount();", "private void countAgents(){\r\n\t\t\tfor(Agent agent : agents){\r\n\t\t\t\tif(agent.isActive()) activeAgent ++;\r\n\t\t\t\telse if(agent.getJailTerm() > 0) jailedAgent ++;\r\n\t\t\t\telse quietAgent ++;\r\n\t\t\t}\r\n\t\t}", "int getNumberOfBots( String className ) {\n Integer number = m_botTypes.get( className );\n\n if( number == null ) {\n return 0;\n } else {\n return number.intValue();\n }\n }", "public static Integer getBotWins() {\n return humanVsBot.OWins + botVsHuman.XWins;\n }", "public int activePlayers() {\n int playerCount = 0;\n for (Player player : players) {\n if (player.getName() != null && player.getState()) {\n playerCount++;\n }\n }\n\n return playerCount;\n }", "public int getNumberOfAgents()\n {\n return this.numberOfAgents;\n }", "public int getNumAlive() {\n return numAlive;\n }", "public int getActiveRunwaysCount();", "public int getNumPlayers() {\n\n\t\treturn this.playerCount;\n\t}", "public Integer getNumberOfActiveRunners(){\n return numberOfActiveRunners;\n }", "public int numPlayers(){\n return this.members.size();\n }", "public int playersCount(){\r\n\t\treturn players.size();\r\n\t}", "public int totalGames() {\n return wins + losses + draws;\n }", "public int getCommandCount() {\n return this.commands.size();\n }", "public static int getNumPlayers(){\n\t\treturn numPlayers;\n\t}", "public int manyConnections() {\n\t\tint ammound = 0;\n\t\tfor (int i = 0; i < this.size(); i++) {\n\t\t\tif(this.get(i).clientAlive) {\n\t\t\t\tammound++;\n\t\t\t}\n\t\t\tSystem.out.println(\"Ist Client Nr. \" + i + \" frei? \" + !this.get(i).isAlive());\n\t\t}\n\t\treturn ammound;\n\t\t\n\t}", "int getBotCount(String className) {\n Integer currentBotCount = m_botTypes.get( className.toLowerCase() );\n\n if( currentBotCount == null ) {\n currentBotCount = new Integer( 0 );\n m_botTypes.put( className.toLowerCase(), currentBotCount );\n }\n\n return currentBotCount;\n }", "public int getActorsSize() {\r\n\t\treturn actors.size();\r\n\t}", "public int getStatsCount() {\n return stats_.size();\n }", "public int getStatsCount() {\n return instance.getStatsCount();\n }", "public int getTotalEnemies() {\n\t\treturn totalEnemies;\n\t}", "public int\t\t\t\t\t\t\tgetAgentsCount()\t\t\t\t\t\t\t{ return this.agents; }", "public int getNumPlayers(){\n\t\treturn this.players.size();\n\t}", "private int getOnlinePlayers()\n {\n return (int) Bukkit.getOnlinePlayers().stream().filter( p -> p != null && p.isOnline() ).count();\n }", "@Override\n\tpublic int getOnlinePlayerSum() {\n\t\treturn PlayerManager.getInstance().getOnlinePlayers().size();\n\t}", "public int numActors() { return ActorSet.size(); }", "int getStatsCount();", "int getStatsCount();", "int getStatsCount();", "public int getNumberOfUsers() {\n \t\treturn interactionHistorySizes.size();\n \t}", "public int getNumWins() {\n\t\treturn this.numWins;\n\t}", "public int countPlayers(){\n return players.size();\n }", "public int playerCount()\r\n\t{\r\n\t\tint count = 0;\r\n\t\tfor(Player player: this.players)\r\n\t\t{\r\n\t\t\tif(player != null)\r\n\t\t\t{\r\n\t\t\t\t++count;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t}", "int getGuestAcceleratorsCount();", "public int getNumOfPlayers() {\n\t\treturn numOfPlayers;\n\t}", "int getPeerCount();", "public int getActiveCount() {\n return activeCount;\n }", "private int getChatTabCount()\n {\n return (chatTabbedPane == null) ? 0 : chatTabbedPane.getTabCount();\n }", "public int numPlayers() {\n return playerList.size();\n }", "public int getTotalActivitySwitches() {\n return (int) neurons.stream().filter(n -> n.getValueRange() > 0).count();\n }", "public int getUserCount() {\n return instance.getUserCount();\n }", "public Integer getBuilderBaseWinCount()\n\t{\n\t\treturn versusBattleWinCount;\n\t}", "public int getNumIdle();", "public int getNumberOfConnectedPeersToAim() {\n\t\tint max = getNumberOfConnectedPeersToAimIncludingDarknet();\n\t\treturn max - node.peers.countConnectedDarknetPeers();\n\t}", "@Exported\n public int getNumberOfOfflineSlaves() {\n int count = 0;\n for (Slave s : slaves) {\n if (s.getComputer().isOffline()) {\n count++;\n }\n }\n return count;\n }", "public int getNumPlayers() {\n return numPlayers;\n }", "public int getNumActiveCashUnits() {\n int numActiveUnits = 0 ;\n for( final Trade buyTrade : this.posHldCashTrades ) {\n numActiveUnits += buyTrade.getNumActiveUnits() ;\n }\n return numActiveUnits ;\n }", "@Exported\n public int getNumberOfSlaves() {\n if (this.slaves == null) {\n return 0;\n }\n return this.slaves.size();\n }", "public int getNumOfPlayers() {\n\t\treturn playerList.size();\n\t}", "public final int getDeponentCount() {\r\n synchronized (f_seaLock) {\r\n return f_deponents.size();\r\n }\r\n }", "public int getAcceleratorsCount() {\n if (acceleratorsBuilder_ == null) {\n return accelerators_.size();\n } else {\n return acceleratorsBuilder_.getCount();\n }\n }", "int getAchieveInfoCount();", "public int getCommandCount() {\n return command_.size();\n }", "public int NumOfGames()\n\t{\n\t\treturn gametype.length;\n\t}", "public int getTurnCount() {\n return turnEncoder.getCount();\n }", "protected int numPeers() {\n\t\treturn peers.size();\n\t}", "public int getRequestsCount() {\n return instance.getRequestsCount();\n }", "public int getCommandCount() {\n return command_.size();\n }", "int getCommandCount();", "public int getUseCount() {\n\t\tint useCount=0;\n\t\tsynchronized(connStatus) {\n\t\t\tfor(int i=0; i < currConnections; i++) {\n\t\t\t\tif(connStatus[i] > 0) { // In use\n\t\t\t\t\tuseCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn useCount;\n\t}", "public int getNumberOfCurrentLoans() {\n\t\treturn loans.size();\r\n\t}", "public int getPlayerCount() {\n \n \treturn playerCount;\n \t\n }", "public long getProcessCount() {\n return getProcesses().count();\n }", "public int getHealthCount() {\n return healthCount;\n }", "private void getNumPlayers() {\n\t\tSystem.out.println(\"How many people are playing? (must be between \"+MIN_PLAYERS+\" and \"+MAX_PLAYERS+\")\");\n\t\tnumPlayers = GetInput.getInstance().anInteger(MIN_PLAYERS, MAX_PLAYERS);\n\t}", "private int calculateTotalHeads() { //kept a separate method with a specific purpose instead of writing code in main\n\t\t//no need to static method, althouth static won't hurt in such a small code\n\t\tint headsCount = 0;\n\t\tfor (int currentCoinNo = 1; currentCoinNo <= noCoins; currentCoinNo++) { \n\t\t\tif(isHead(currentCoinNo)) {\n\t\t\t\theadsCount++;\n\t\t\t}\n\t\t}\n\t\treturn headsCount;\n\t}", "public static long getNumberOfOpenConnections() {\n return openConnections.size();\n }", "int getNumOfPlayers() {\n return this.numOfPlayers;\n }", "public int getLobbyIdCount() {\n return lobbyId_.size();\n }", "int getPeersCount();", "public int getLobbyIdCount() {\n return lobbyId_.size();\n }", "public int nrOfPlayers() {\n int playerCount = 0;\n for (Player player : players) {\n if (player.getName() != null) {\n playerCount++;\n }\n }\n\n return playerCount;\n }", "public int getPlayerCount() {\n\t\treturn playerCount;\n\t}", "public static Integer numValidClients() {\n return getLoggedInUserConnections().size() + anonClients.size();\n }", "@Override\n public int howManyActivated(){\n return (gameboardPanel.howManyActivated() + leaderCardsPanel.howManyActivated());\n }", "public int getPlayerCount() {\n return 0;\n }", "@Override\n public int getTotalHumanPlayers() {\n return totalHumanPlayers;\n }", "public int countNumberClientsTotal() {\n\t\tint counter = 0;\n\t\tfor(int number : numberClients.values())\n\t\t\tcounter += number;\n\t\treturn counter;\n\t}", "public int sizeOfAgentArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().count_elements(AGENT$0);\r\n }\r\n }", "public int getTotalWorkerCount() {\n return this.workerCount;\n }", "public int playerCount() {\n\t\treturn playerList.size();\n\t}", "public int getNumRobots() {\n return ((Integer)numRobotsSpinner.getValue()).intValue();\n }", "int getResponsesCount();", "int getAchievementsCount();", "public int countBoats() {\r\n\t\treturn boats.size();\r\n\t}", "public int getActiveUserCount() {\n return activeUserCount;\n }", "public int getNumActive();", "public int getTotalOfwins() {\n return statistics.get(TypeOfGames.SIMGAME).getNumberOfWins()\n + statistics.get(TypeOfGames.EASYCOMPUTERGAME).getNumberOfWins()\n + statistics.get(TypeOfGames.HARDCOMPUTERGAME).getNumberOfWins();\n }", "int senseActualRobotCount(RobotController rc, Robot[] alliedRobots) throws GameActionException {\r\n\t\t\r\n\t\tRobotCount counter = new RobotCount(alliedRobots,rc);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\treturn counter.getTotalRobotCount();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public int getResponsesCount() {\n if (responsesBuilder_ == null) {\n return responses_.size();\n } else {\n return responsesBuilder_.getCount();\n }\n }", "public Integer GetNumOfChild() {\n\t\treturn this.ChildSMILES.size();\n\t}", "public int getNodesCount() {\n if (nodesBuilder_ == null) {\n return nodes_.size();\n } else {\n return nodesBuilder_.getCount();\n }\n }", "public static int countNodes() {\n\t\treturn count_nodes;\n\t}", "public int getBallsCount() {\n return balls.size();\n }", "public int numberOfBoats(){\n return this.boats.size();\n }", "int getChannelStatisticsCount();" ]
[ "0.65842646", "0.648257", "0.64650524", "0.6444905", "0.6439537", "0.63721806", "0.6233609", "0.6218681", "0.6184182", "0.6159715", "0.6149244", "0.6147055", "0.60686755", "0.6066953", "0.6053215", "0.60492396", "0.60489047", "0.60423553", "0.60024965", "0.5987081", "0.5968788", "0.5961348", "0.595042", "0.5950337", "0.593791", "0.5931483", "0.59291095", "0.5927342", "0.5899694", "0.5898526", "0.5885729", "0.5885729", "0.5885729", "0.5881411", "0.58709323", "0.5864002", "0.58477235", "0.5846978", "0.58457726", "0.58351886", "0.5824187", "0.58237773", "0.5818009", "0.581794", "0.5815269", "0.58102", "0.5809227", "0.58048743", "0.5801411", "0.5790031", "0.5781364", "0.5771919", "0.57701236", "0.5767496", "0.5765706", "0.5762685", "0.5759751", "0.5738204", "0.57376134", "0.5737588", "0.5734732", "0.5731745", "0.572753", "0.5717737", "0.5715657", "0.5715157", "0.5704941", "0.5704471", "0.5702811", "0.5702509", "0.56998307", "0.56986487", "0.569218", "0.5688673", "0.5687446", "0.5683462", "0.56811106", "0.56809664", "0.56782025", "0.5665618", "0.5659839", "0.5658416", "0.5656934", "0.564493", "0.5643454", "0.562984", "0.5626097", "0.561813", "0.5616815", "0.56158125", "0.56092066", "0.5607627", "0.5606738", "0.56053454", "0.5598072", "0.5594011", "0.5591017", "0.5590992", "0.5577532", "0.5576078" ]
0.7336248
0
Returns the next free bot number of a class of bots, given the bot's settings.
int getFreeBotNumber( BotSettings botInfo ) { int i; String name; int maxBots; int result = -1; maxBots = botInfo.getInt( "Max Bots" ); for( i = 1; i <= maxBots && result == -1; i++ ) { name = botInfo.getString( "Name" + i ); if( m_botStable.get( name ) == null ) { result = i; } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getNumberOfBots( String className ) {\n Integer number = m_botTypes.get( className );\n\n if( number == null ) {\n return 0;\n } else {\n return number.intValue();\n }\n }", "int getBotCount(String className) {\n Integer currentBotCount = m_botTypes.get( className.toLowerCase() );\n\n if( currentBotCount == null ) {\n currentBotCount = new Integer( 0 );\n m_botTypes.put( className.toLowerCase(), currentBotCount );\n }\n\n return currentBotCount;\n }", "public void setBotNumber(int num) {\n botNum = num;\n }", "public int getNextModuleGeneration() {\n return moduleGeneration.incrementAndGet();\n }", "private int getNextResNum() {\r\n // Loop through every object in the \"stockList\" object array list.\r\n for (int i = 0; i < stockList.size(); i++) {\r\n // If the \"reservationNumber\" of the beanBag in the \"stockList\"\r\n // is greater than the \"nextReservationNum\" global integer.\r\n if (((BeanBag) stockList.get(i)).getReservationNumber() > nextReservationNum) {\r\n // Set the global integer \"nextReservationNum\" to the value of the current\r\n // Reservation number of the beanBag in the \"stockList\".\r\n nextReservationNum = ((BeanBag) stockList.get(i)).getReservationNumber();\r\n }\r\n }\r\n // Increment the \"nextReservationNum\" integer by 1.\r\n nextReservationNum = nextReservationNum + 1;\r\n // Return the value of the \"nextReservationNum\" integer variable.\r\n return nextReservationNum;\r\n }", "int getTotalBotCount() {\n int t = 0;\n\n for (Integer i : m_botTypes.values())\n t += i;\n\n return t;\n }", "private ApnSetting getNextApn() {\n ArrayList<ApnSetting> list = waitingApns;\n ApnSetting apn = null;\n\n if (list != null) {\n if (!list.isEmpty()) {\n apn = list.get(0);\n }\n }\n return apn;\n }", "private int getNextPlayer() {\n int nextPlayerID = ((currentTurn + turnOrder) % numPlayers);\n nextPlayerID = (((nextPlayerID + numPlayers) % numPlayers)); // handles negative numbers\n return nextPlayerID;\n }", "private synchronized static String getNextNumber() {\n String toReturn;\n String number = String.valueOf(Math.round(Math.random() * 89999) + 10000);\n if(meetings.containsKey(number)) {\n toReturn = getNextNumber();\n } else {\n toReturn = number;\n }\n return toReturn;\n }", "private int findAvailableNo() {\n\t\t//TODO: Maybe add a check that a number doesn't already exist even though it is almost impossible\n\t\tboolean notfound = true;\n\t\tint number = 0;\n\t\tnumber = RANDOM_NUMBER.nextInt(Integer.MAX_VALUE);\n\t\t\n\t\treturn number;\n\t}", "public int getNumRobots() {\n return ((Integer)numRobotsSpinner.getValue()).intValue();\n }", "public int getFree() {\n\t\t\n\t\tfor (int i = 0; i < this.size(); i++) {\n\t\t\tif(!this.get(i).clientAlive) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t\t\n\t}", "public int getNewNumber() {\r\n int num;\r\n num=unusedLockers.get(0);\r\n unusedLockers.remove(0);\r\n return num;\r\n }", "public int getNext() {\n return value++;\n }", "public static Integer getBotWins() {\n return humanVsBot.OWins + botVsHuman.XWins;\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}", "public int createBot(Bot bot) {\n final String insertQuery = \"INSERT INTO Bots (company_id, active_time, probability, activity_status) \" +\n \"VALUES (%d, %f, %f, TRUE);\";\n final String selectQuery = \"SELECT * FROM Bots WHERE company_id = %d ORDER BY created_at DESC LIMIT 1;\";\n final String successMessage = \"New bot with id %d has been created\";\n final String errorMessage = \"Error in creating bot for %s\";\n\n // Create the new bot for the specified company\n dbConnector.insertQuery(String.format(Locale.US, insertQuery, bot.getCompany().getCompanyId(), bot.getActiveTime(),\n bot.getProbability()));\n\n // Get the latest bot created for the specified company\n ResultSet verify = dbConnector.selectQuery(String.format(Locale.US, selectQuery, bot.getCompany().getCompanyId()));\n try {\n while (verify.next()) {\n int botId = verify.getInt(\"bot_id\");\n System.out.println(String.format(Locale.US, successMessage, botId));\n return botId;\n }\n } catch (SQLException e) {\n System.out.println(String.format(Locale.US, errorMessage, bot.getCompany().getCompanyId()));\n }\n return -1;\n }", "@Override\n\tpublic long getMaxnum() {\n\t\treturn _esfTournament.getMaxnum();\n\t}", "public synchronized int getNext(String key) {\n // Get value from counter map\n Integer nextObject = counters.get(key);\n int next = 0;\n if (nextObject != null) {\n next = nextObject;\n }\n\n // Handle overflows\n int incr = next + 1;\n if (incr < 0) {\n incr = 0;\n }\n\n // Store value for next call\n counters.put(key, incr);\n\n return next;\n }", "private static byte getNext() {\n return (byte)Tool.getRandomlyFromRange(Byte.MIN_VALUE, Byte.MAX_VALUE);\n }", "public int returnAndUsePlayerNumber() {\r\n\t\tfor (int no = 1; no < this.playerNumbers.length; no++) {\r\n\t\t\tif (!this.playerNumbers[no]) {\r\n\t\t\t\tthis.playerNumbers[no] = true;\r\n\t\t\t\treturn no;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn -1;\r\n\t}", "protected static synchronized long getNextConnectionAttemptGlobalCounter() {\n connectionAttemptsGlobalCounter++;\n if (connectionAttemptsGlobalCounter < 0) {\n connectionAttemptsGlobalCounter = 1;\n }\n return connectionAttemptsGlobalCounter;\n }", "@Override\r\n public BidDetails determineNextBid() {\r\n\r\n double time = negotiationSession.getTime();\r\n\r\n // for the first 20% of the time, offer the bid which gives max utility\r\n if(time < Offer_Max_Util_Time){\r\n BidDetails maxBid = null;\r\n try {\r\n maxBid = this.outcomespace.getMaxBidPossible();\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n System.out.println(\"Exception: cannot generate max utility bid\");\r\n }\r\n return maxBid;\r\n\r\n }else {\r\n //compute the target utility based on time\r\n double utilityGoal = p(time);\r\n // if there is no opponent model available\r\n if (opponentModel instanceof NoModel) {\r\n // generate a Bid near the Utility we wish to have\r\n nextBid = negotiationSession.getOutcomeSpace().getBidNearUtility(utilityGoal);\r\n } else {\r\n // get the best Bid for the Opponent among a list of similarly preferred bids for our Agent\r\n // Then, make an offer with that bid\r\n nextBid = omStrategy.getBid(outcomespace, utilityGoal);\r\n }\r\n }\r\n return nextBid;\r\n }", "private static int getNextColor() {\n\t\tboolean[] used = new boolean[ServerStarter.MAX_PLAYERS];\t\t\t\t\t\t//create a boolean with the maximum of players\n\t\tfor(Player players : ServerStarter.getAllPlayers()) {\n\t\t\tused[players.getColorID()] = true;\t\t\t\t\t\t\t\t\t\t\t//go through all players and set their colorID to true if\n\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//it's used\n\t\tfor(int i = 0; i < used.length; i++) {\n\t\t\tif(!used[i]) {\n\t\t\t\treturn i;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//go through the boolean array and return the next unused color\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "public int getNext(){\n synchronized (ThreadSave.class){\n if(value > 0){\n return 1;\n }\n else if (value < 0){\n return -1;\n }\n else\n return value ++;\n }\n\n }", "public BigInteger getNext() {\n\n\t\t//get the last found\n\t\tBigInteger lastFound;\n\t\tif(primes.size()==0) {\n\t\t\t//initialize last found to 1 if \"primes\" is still empty\n\t\t\tlastFound = new BigInteger(\"1\");\n\t\t\tprimes.add(lastFound);\n\t\t}else {\n\t\t\tlastFound = primes.get(primes.size()-1);\n\t\t}\n\n\n\t\tBigInteger one = new BigInteger(\"1\");\n\t\t//increment last found\n\t\tlastFound = lastFound.add(one);\n\n\t\twhile(!isPrime(lastFound)) {\n\t\t\tlastFound = lastFound.add(one);\n\t\t}\n\n\t\tprimes.add(lastFound);\n\t\treturn lastFound;\n\t}", "public int getNextValue() {\n\t\tRandom randomGenerator = new Random();\n\t\tint randomInt = randomGenerator.nextInt(100) + 1;\n\t\treturn randomInt;\n\t}", "int getNextCount(int vids);", "private int getPreferredHub(){\n SharedPreferences settings = getSharedPreferences(PREFS_NAME,\n Context.MODE_PRIVATE);\n return Integer.parseInt(settings.getString(PREF_HUB, DEFAULT_HUB));\n }", "protected synchronized int resolveNextAvailablePort() {\n\t\tint port = DEFAULT_PORT;\n\t\t\n\t\tif (portsInUse == null) {\n\t\t\tportsInUse = new ArrayList<Integer> ();\n\t\t} else if (portsInUse.isEmpty() ||\n\t\t\t\t!portsInUse.contains(DEFAULT_PORT)) {\n\t\t\t// Do nothing\n\t\t} else {\n\t\t\tint portInUse;\n\t\t\tIterator<Integer> i = portsInUse.iterator();\n\t\t\twhile (i.hasNext()) {\n\t\t\t\tportInUse = i.next();\n\t\t\t\tif (portInUse > port) {\n\t\t\t\t\tport = portInUse;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Set the port to one digit above the highest port in use.\n\t\t\tport++;\n\t\t}\n\t\t\n\t\tportsInUse.add(port);\n\t\t\n\t\treturn port;\n\t}", "public WorkerInfo getNextWorker() {\n\t\tsynchronized (nextWorkerLock) {\n\t\t\tWorkerInfo worker = this.workers[this.nextWorker++];\n\t\t\tthis.nextWorker %= this.workers.length;\n\t\t\treturn worker;\n\t\t}\n\t\t\n\t}", "public int chooseNextProcess() {\n for (int i = currentProcess + 1; i < Process_Table.length; i++) {\n // if the next process is ready and not null return that process\n if (Process_Table[i] != null && Process_Table[i].getStatus() == ProcessState.ready) {\n return i;\n }\n }\n // go up to the currentProcess\n for (int i = 1; i <= currentProcess; i++) {\n // if the process table is not null and the status is ready return i\n if (Process_Table[i] != null && Process_Table[i].getStatus() == ProcessState.ready) {\n return i;\n }\n }\n return 0;\n }", "private int getWobblyRank(MatchStats matchStats) {\n for(int i = 0; i < leaderboard.size(); i++) {\n WobblyScore score = leaderboard.get(i);\n if(score.getKey().equals(WobblyScore.generateKey(matchStats))) {\n return i + 1;\n }\n }\n return 0;\n }", "private int getNextUnique() {\r\n\t\ttry {\r\n\t\t\tint nextUnique = 0;\r\n\t\t\tStatement statement = connection.createStatement();\r\n\t\t\tResultSet rs = statement.executeQuery(\"SELECT MAX(userID) userID FROM users\");\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tnextUnique = rs.getInt(\"userID\") + 1;\r\n\t\t\t}\r\n\t\t\treturn nextUnique;\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "double get_num(ThreadContext tc, RakudoObject classHandle);", "public int get() {\n if(smallestFreeIndex == max) {\n return -1;\n }\n int num = smallestFreeIndex;\n bitset.set(smallestFreeIndex);\n //Only scan for the next free bit, from the previously known smallest free index\n smallestFreeIndex = bitset.nextClearBit(smallestFreeIndex);\n return num;\n }", "List<PendingAccountStatus> next(int count);", "private int getRandNumber() {\n int randNum = 0;\n Random generator = new Random();\n randNum = generator.nextInt(LIST.length()-1);\n return randNum;\n }", "public static synchronized int getRandomPort() {\n\t\treturn getNextFreePortInternal(1);\n\t}", "public int getSimultanDownloadNumPerHost() {\r\n int ret = 0;\r\n if (!org.jdownloader.settings.staticreferences.CFG_GENERAL.MAX_DOWNLOADS_PER_HOST_ENABLED.isEnabled() || (ret = config.getMaxSimultaneDownloadsPerHost()) <= 0) { return Integer.MAX_VALUE; }\r\n return ret;\r\n }", "private int getNextSessionID() {\n\t\treturn sessionNum++;\n\t}", "int getLimit();", "int getLimit();", "private int getRandomNumber(int limit) {\n\t\tlong seed = System.currentTimeMillis();\n\t\tRandom rand = new Random(seed);\n\t\treturn rand.nextInt(limit) + 1;\n\t}", "public it.grpc.tokenRing.Node getFollowingN() {\n return followingN_ == null ? it.grpc.tokenRing.Node.getDefaultInstance() : followingN_;\n }", "public static int calc(int numbteams) {\n int randomSize = (int) (Math.random() * ((numbteams - 1) + 1)) + 1;\n return randomSize;\n }", "public int calculateNextRound(Tournament tournament) {\r\n\t\treturn tournament.getRounds().size() + 1;\r\n\t}", "private int nextIndex() {\n return ThreadLocalRandom.current().nextInt(currentIndex, tracks.size());\n }", "public int getNextActivePlayer() {\n //first check all players after current player\n for (int i = this.activePlayer + 1; i < nrOfPlayers(); i++) {\n if (players.get(i).getState()) {\n return i;\n }\n }\n\n //then check all players from the beginning\n for (int i = 0; i < nrOfPlayers(); i++) {\n if (players.get(i).getState()) {\n return i;\n }\n }\n\n return -1; //should never be returned\n }", "public int getNextWormholeID()\n \t{\n \t\tint maxId = -1;\n \t\tfor (final Integer id : aWormholes.keySet()) {\n \t\t\tmaxId = Math.max(maxId, id);\n \t\t}\n \t\treturn maxId + 1;\n \t}", "@Override\n public int getNextPlayer() {\n //TODO Implement this method\n if(isPlayerOne){\n return 0;\n }else {\n return 1;\n }\n }", "private static int getNextID() {\n return persons.get(persons.size() - 1).getId() + 1;\n }", "public int nextSerialNumber(){\n serialNumber++;\n return serialNumber;\n }", "public int assignIdToNextUser () {\n int currentMax;\n User maxUserId = null;\n try {\n List lst = this.readAllUsers();\n maxUserId = Collections.max(lst, new UserCompar());\n } catch (DaoException exc) {\n exc.printStackTrace();\n }\n currentMax = maxUserId.getId();\n return ++currentMax;\n }", "public int getNuevoNumTransaccionBR() throws BaseDeDatosExcepcion, ConexionExcepcion {\n\t\tif (logger.isDebugEnabled()) {\n\t\t\tlogger.debug(\"getNuevoNumTransaccionBR() - start\");\n\t\t}\n\t\t\n\t\tint result = 0;\n\t\t\n\t\tincrementarNumTransBR();\n\t\tresult = numTransaccionBR;\n\t\t\n\t\tif (logger.isDebugEnabled()) {\n\t\t\tlogger.debug(\"getNuevoNumTransaccionBR() - end\");\n\t\t}\n\t\treturn result;\n\t}", "public int nextPlayer() {\n\t\tplayer = (player + 1) % playerCount;\n\t\treturn player;\n\t}", "private int mobLimitPlacer(){\n if (gameWorld == GameWorld.NORMAL) return\n Api.getConfigManager().getWorldMobLimit();\n else return\n Api.getConfigManager().getNetherMobLimit();\n }", "private int getNum() {\r\n int i = currentNum.incrementAndGet();\r\n if (i < 0)\r\n i = -i;\r\n return i % n;\r\n }", "@Override\r\n\tpublic int next() \r\n\t{\r\n\t\tif (currentNumber == OVERFLOW_PRIME)\r\n\t\t{\r\n\t\t\treturn currentNumber;\r\n\t\t}\r\n\t\t\r\n\t\tif (currentNumber != MAX_NUMBER)\r\n\t\t{\r\n\t\t\tcurrentNumber++;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tcurrentNumber = OVERFLOW_PRIME;\r\n\t\t}\r\n\r\n\t\treturn currentNumber;\r\n\t}", "public int getCantidadRobots();", "private int generateRandomNumber() {\n\t\treturn (int) Math.floor(Math.random() * Constants.RANDOM_NUMBER_GENERATOR_LIMIT);\n\t}", "public int getSmallestSpotNum() {\n if (getNumavailable() >= 1) {\n for (int i = 0; i < spotArr.size(); i++) {\n if (spotArr.get(i).isAvailable()) {\n return i;\n }\n }\n }\n return -1;\n }", "private int getNextUpdateKey() {\n synchronized (monitor) {\n if (lobbyUpdates.size() == 0) {\n return 1;\n }\n return lobbyUpdates.lastKey() + 1;\n }\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Integer getInstanceNumber() {\n return (java.lang.Integer)__getInternalInterface().getFieldValue(INSTANCENUMBER_PROP.get());\n }", "public int getNextIdNumberForPart() {\n int maxId = 0;\n for(Part part : allParts) {\n if(part.getId() > maxId) {\n maxId = part.getId();\n }\n }\n \n return maxId + 1;\n }", "public int whoIsNext(int whoIsNow, int numberOfPlayers)\n\t{ //1,2,3,4\n\t\tint whoIsNextPlayer;\n\t\tif (whoIsNow==numberOfPlayers)\n\t\t\twhoIsNextPlayer=1;\n\t\telse\n\t\t\twhoIsNextPlayer=whoIsNow+1;\n\t\treturn whoIsNextPlayer;\t\t\n\t}", "private PlayState getNext(){\n return values()[(this.ordinal() + 1) % PlayState.values().length];\n }", "public int bestPlay() {\n for (int i = 0; i < hand.size(); i++) {\n if (canBuild(hand.get(i))) {\n return i;\n }\n }\n\n return -1;\n }", "@Override\r\n public int getMaxSimultanPremiumDownloadNum() {\r\n return maxPrem.get();\r\n }", "public static final int followUp() {\n // 36^5 < 2^31 - 1 (range of int)\n return 5;\n }", "public int getRandomsNumber(){\n Random random = new Random();\n int number = random.nextInt(12) + 1;\n return number;\n }", "public int nextVersion() {\n int version = 1;\n File symLink = new File(parent + \"/\" + symbolic);\n if (!symLink.exists()) {\n String absPath = null;\n try {\n absPath = symLink.getCanonicalPath();\n } catch (IOException e) {\n LOG.error(\"Can't get canonical path of \" + parent + \"/\" + symbolic, e);\n absPath = symLink.getAbsolutePath();\n }\n String vStr = CacheDirectory.getCacheVersion(absPath);\n try {\n version = Integer.parseInt(vStr) + 1;\n } catch(NumberFormatException e) {\n LOG.error(\"Can't get version number of \" + absPath);\n } \n }\n return version;\n }", "public long get_next_index(long number) {\n return ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].getLong((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 13));\n }", "private static int dialGreedy(ArrayList<Pair<Pair <Integer, Integer>,Integer>> wts, int money){\n int prevEdgeIndex = -1;\n int noDials = 10;\n int [][] dialArr = new int[money+1][noDials];\n BooleanHolder flip = new BooleanHolder(false);\n return greedyDialMax(wts, money,prevEdgeIndex,dialArr, flip);\n }", "public static int getNforNgram(){\r\n\t\tString path = \"conf/ngram.txt\"; \r\n\t\tint res = 0;\r\n\t\tArrayList<String> words = TextFile.getLines(path);\r\n\t\tString s = words.get(0);\r\n\t\tres = Integer.valueOf(s);\r\n\t\treturn res;\r\n\t}", "static synchronized long getNextSeqNumber() {\n return seqNumber++;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Integer getInstanceNumber() {\n return (java.lang.Integer)__getInternalInterface().getFieldValue(INSTANCENUMBER_PROP.get());\n }", "public int getNext() {\n synchronized(this) {\n System.out.println(\"For Value: \" + value);\n value = value + 1;\n return value;\n }\n }", "public static int getNumberCreated() {\n return numberOfPools;\n }", "private String getNext() {\n \t\t\n \t\tArrayList<String> reel = game.getType().getReel();\n \t\t\n \t\tRandom generator = new Random();\n \t\tint id = generator.nextInt(reel.size());\n \t\t\n \t\tString nextID = reel.get(id);\n \t\tString[] idSplit = nextID.split(\"\\\\:\");\n \t\t\n \t\tif (idSplit.length == 2) {\n \t\t\treturn nextID;\n \t\t}else {\n \t\t\tString newID;\n \t\t\tnewID = Integer.parseInt(idSplit[0]) + \":0\";\n \t\t\t\n \t\t\treturn newID;\n \t\t}\n \t}", "public EncapsulatedIRCCommand getNextCommand();", "public long getNextDynamicMethodSerial() {\n return dynamicMethodSerial.getAndIncrement();\n }", "public int getCurrentNext() {\n\t\tInteger ii = (Integer) get_Value(\"CurrentNext\");\n\t\tif (ii == null)\n\t\t\treturn 0;\n\t\treturn ii.intValue();\n\t}", "protected static synchronized int getPort() throws PortUsedUpException {\n int baseNum = 30000;\n int size = 20000;\n boolean checkAgain = true;\n if (currentPort == 0) {\n currentPort = baseNum;\n checkAgain = false;\n }\n while (!isPortAvailable(currentPort)) {\n if (currentPort == baseNum + size) {\n break;\n }\n currentPort++;\n }\n if (currentPort == baseNum + size) {\n currentPort = 0;\n if (checkAgain) {\n currentPort = getPort();\n if (currentPort == 0) {\n throw new PortUsedUpException(\"No port available now.\");\n } else {\n return currentPort++;\n }\n } else {\n throw new PortUsedUpException(\"No port available now.\");\n }\n } else {\n return currentPort++;\n }\n }", "static int bukkitToneAmount() { return 25; }", "long getFromRank();", "public int generatePolicyNum(){\n\t\tRandom rnd = new Random();\n\t\tint polNum = rnd.nextInt(899999) + 100000; \t\n\t\t\n\t\treturn polNum;\t\t\t\n\t}", "public int randomNum()\r\n {\r\n Random rand = new Random();\r\n int n = rand.nextInt(52)+1;\r\n return n;\r\n }", "public long getNextThreadID() {\n return (Long) getProperty(\"nextThreadID\");\n }", "public int nextPlayer() {\n// int count = 0;\n// for (int i = 0; i < playersArray.length; i++)\n// if (playersArray[i]<0)\n// count++;\n//\n// if (\n do {\n player = (player + 1) % numberPlayers;\n } while (playersArray[player] < 0);\n return player;\n }", "void spawnBot( String className, String login, String password, String messager ) {\n CoreData cdata = m_botAction.getCoreData();\n long currentTime;\n\n String rawClassName = className.toLowerCase();\n BotSettings botInfo = cdata.getBotConfig( rawClassName );\n\n if( botInfo == null ) {\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" tried to spawn bot of type \" + className + \". Invalid bot type or missing CFG file.\" );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader tried to spawn bot of type \" + className + \". Invalid bot type or missing CFG file.\" );\n\n m_botAction.sendSmartPrivateMessage( messager, \"That bot type does not exist, or the CFG file for it is missing.\" );\n return;\n }\n\n Integer maxBots = botInfo.getInteger( \"Max Bots\" );\n Integer currentBotCount = m_botTypes.get( rawClassName );\n\n if( maxBots == null ) {\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" tried to spawn bot of type \" + className + \". Invalid settings file. (MaxBots improperly defined)\" );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader tried to spawn bot of type \" + className + \". Invalid settings file. (MaxBots improperly defined)\" );\n\n m_botAction.sendSmartPrivateMessage( messager, \"The CFG file for that bot type is invalid. (MaxBots improperly defined)\" );\n return;\n }\n\n if( login == null && maxBots.intValue() == 0 ) {\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" tried to spawn bot of type \" + className + \". Spawning for this type is disabled on this hub.\" );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader tried to spawn bot of type \" + className + \". Spawning for this type is disabled on this hub.\" );\n\n m_botAction.sendSmartPrivateMessage( messager, \"Bots of this type are currently disabled on this hub. If you are running another hub, please try from it instead.\" );\n return;\n }\n\n if( currentBotCount == null ) {\n currentBotCount = new Integer( 0 );\n m_botTypes.put( rawClassName, currentBotCount );\n }\n\n if( login == null && currentBotCount.intValue() >= maxBots.intValue() ) {\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" tried to spawn a new bot of type \" + className + \". Maximum number already reached (\" + maxBots + \")\" );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader tried to spawn a new bot of type \" + className + \". Maximum number already reached (\" + maxBots + \")\" );\n\n m_botAction.sendSmartPrivateMessage( messager, \"Maximum number of bots of this type (\" + maxBots + \") has been reached.\" );\n return;\n }\n\n String botName, botPassword;\n currentBotCount = new Integer( getFreeBotNumber( botInfo ) );\n\n if( login == null || password == null ) {\n botName = botInfo.getString( \"Name\" + currentBotCount );\n botPassword = botInfo.getString( \"Password\" + currentBotCount );\n } else {\n botName = login;\n botPassword = password;\n }\n\n Session childBot = null;\n\n try {\n // FIXME: KNOWN BUG - sometimes, even when it detects that a class is updated, the loader\n // will load the old copy/cached class. Perhaps Java itself is caching the class on occasion?\n if( m_loader.shouldReload() ) {\n System.out.println( \"Reinstantiating class loader; cached classes are not up to date.\" );\n resetRepository();\n m_loader = m_loader.reinstantiate();\n }\n\n Class<? extends SubspaceBot> roboClass = m_loader.loadClass( \"twcore.bots.\" + rawClassName + \".\" + rawClassName ).asSubclass(SubspaceBot.class);\n String altIP = botInfo.getString(\"AltIP\" + currentBotCount);\n int altPort = botInfo.getInt(\"AltPort\" + currentBotCount);\n String altSysop = botInfo.getString(\"AltSysop\" + currentBotCount);\n\n if(altIP != null && altSysop != null && altPort > 0)\n childBot = new Session( cdata, roboClass, botName, botPassword, currentBotCount.intValue(), m_group, altIP, altPort, altSysop, true);\n else\n childBot = new Session( cdata, roboClass, botName, botPassword, currentBotCount.intValue(), m_group, true);\n } catch( ClassNotFoundException cnfe ) {\n Tools.printLog( \"Class not found: \" + rawClassName + \".class. Reinstall this bot?\" );\n return;\n }\n\n currentTime = System.currentTimeMillis();\n\n if( m_lastSpawnTime + SPAWN_DELAY > currentTime ) {\n m_botAction.sendSmartPrivateMessage( messager, \"Subspace only allows a certain amount of logins in a short time frame. Please be patient while your bot waits to be spawned.\" );\n\n if( m_spawnQueue.isEmpty() == false ) {\n int size = m_spawnQueue.size();\n\n if( size > 1 ) {\n m_botAction.sendSmartPrivateMessage( messager, \"There are currently \" + m_spawnQueue.size() + \" bots in front of yours.\" );\n } else {\n m_botAction.sendSmartPrivateMessage( messager, \"There is only one bot in front of yours.\" );\n }\n } else {\n m_botAction.sendSmartPrivateMessage( messager, \"You are the only person waiting in line. Your bot will log in shortly.\" );\n }\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" in queue to spawn bot of type \" + className );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader in queue to spawn bot of type \" + className );\n }\n\n String creator;\n\n if(messager != null) creator = messager;\n else creator = \"AutoLoader\";\n\n ChildBot newChildBot = new ChildBot( rawClassName, creator, childBot );\n addToBotCount( rawClassName, 1 );\n m_botStable.put( botName, newChildBot );\n m_spawnQueue.add( newChildBot );\n }", "private int getFreeChannel() {\n\n\t\tfor (int i = 0; i < channels.length; i++) {\n\n\t\t\tif (channels[i] == null || channels[i].isClosed()) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "void addToBotCount( String className, int valueToAdd ) {\n Integer newBotCount;\n Integer oldBotCount;\n\n oldBotCount = m_botTypes.get( className );\n\n if( oldBotCount != null ) {\n if( oldBotCount.intValue() + valueToAdd >= 0 ) {\n newBotCount = new Integer( oldBotCount.intValue() + valueToAdd );\n m_botTypes.put( className, newBotCount );\n }\n }\n }", "String getMaximumRedeliveries();", "public static Integer next() {\n return incrementingInteger++;\n }", "public it.grpc.tokenRing.Node getFollowingN() {\n if (followingNBuilder_ == null) {\n return followingN_ == null ? it.grpc.tokenRing.Node.getDefaultInstance() : followingN_;\n } else {\n return followingNBuilder_.getMessage();\n }\n }", "private static int getCombo() {\n return generator.nextInt(COMBOS) + 1;\n }", "BigInteger getNumberReturned();", "public int getWinningBid() {\n return winningBid;\n }", "Integer getReuse();" ]
[ "0.64191306", "0.62275165", "0.57148093", "0.56567293", "0.56036717", "0.55188245", "0.5437864", "0.5397426", "0.5324201", "0.5213197", "0.50960976", "0.50787735", "0.50586027", "0.5033041", "0.50085473", "0.5002748", "0.49774167", "0.49716356", "0.49657577", "0.4953406", "0.49495527", "0.49307054", "0.49289212", "0.4918339", "0.49173793", "0.49098307", "0.49053168", "0.49034792", "0.4899265", "0.48873317", "0.4884023", "0.4856502", "0.4851705", "0.48479328", "0.4827556", "0.48226842", "0.4791729", "0.4781539", "0.47774583", "0.47704762", "0.47639787", "0.47531024", "0.47531024", "0.475216", "0.47520953", "0.47412735", "0.4730759", "0.47280982", "0.47257704", "0.4725689", "0.47083426", "0.47067946", "0.4701121", "0.4698177", "0.46931875", "0.46931368", "0.46896306", "0.46873328", "0.46613723", "0.4656339", "0.46536827", "0.46484816", "0.46468058", "0.46450368", "0.4630161", "0.46291375", "0.46270603", "0.4618429", "0.46170133", "0.4615927", "0.4614951", "0.46112573", "0.45980918", "0.45955083", "0.45936003", "0.45922664", "0.45906276", "0.4586178", "0.4584548", "0.4579609", "0.45786917", "0.45763963", "0.45755163", "0.45740718", "0.45655206", "0.45641023", "0.45638683", "0.4563535", "0.45570287", "0.45547625", "0.4543837", "0.4542948", "0.45425755", "0.45392138", "0.45373064", "0.45371234", "0.45368588", "0.45362586", "0.4533502", "0.45315364" ]
0.76598173
0
Returns the count of bots that are spawned for the specified bot type (className)
int getBotCount(String className) { Integer currentBotCount = m_botTypes.get( className.toLowerCase() ); if( currentBotCount == null ) { currentBotCount = new Integer( 0 ); m_botTypes.put( className.toLowerCase(), currentBotCount ); } return currentBotCount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getNumberOfBots( String className ) {\n Integer number = m_botTypes.get( className );\n\n if( number == null ) {\n return 0;\n } else {\n return number.intValue();\n }\n }", "int getTotalBotCount() {\n int t = 0;\n\n for (Integer i : m_botTypes.values())\n t += i;\n\n return t;\n }", "private int[] countClasses(List<Instance> instances){\r\n\t\tint[] counters = new int[classes.size()];\r\n\t\tfor(Instance ins : instances){\r\n\r\n\t\t\tfor(String str : classes){\r\n\t\t\t\tif(ins.getClassAttribute().equals(str)){\r\n\t\t\t\t\tcounters[classes.indexOf(str)]++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\r\n\t\treturn counters;\r\n\t}", "void addToBotCount( String className, int valueToAdd ) {\n Integer newBotCount;\n Integer oldBotCount;\n\n oldBotCount = m_botTypes.get( className );\n\n if( oldBotCount != null ) {\n if( oldBotCount.intValue() + valueToAdd >= 0 ) {\n newBotCount = new Integer( oldBotCount.intValue() + valueToAdd );\n m_botTypes.put( className, newBotCount );\n }\n }\n }", "public int countByClassName(java.lang.String className)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "void listBots( String className, String messager ) {\n Iterator<ChildBot> i;\n ChildBot bot;\n String rawClassName = className.toLowerCase();\n\n if( rawClassName.compareTo( \"hubbot\" ) == 0 ) {\n m_botAction.sendSmartPrivateMessage( messager, \"There is only one true master, and that is me.\" );\n } else if( getNumberOfBots( className ) == 0 ) {\n m_botAction.sendSmartPrivateMessage( messager, \"No bots of that type.\" );\n } else {\n m_botAction.sendSmartPrivateMessage( messager, className + \":\" );\n\n for( i = m_botStable.values().iterator(); i.hasNext(); ) {\n bot = i.next();\n\n if( bot != null )\n if( bot.getClassName().compareTo( className ) == 0 )\n m_botAction.sendSmartPrivateMessage( messager, bot.getBot().getBotName() + \" (in \" + bot.getBot().getBotAction().getArenaName() + \"), created by \" + bot.getCreator());\n }\n\n m_botAction.sendSmartPrivateMessage( messager, \"End of list\" );\n }\n }", "public boolean getCount(String type){\n if(type.equals(\"Zombie\") && zombieCounter!=0){\n return true;\n } else return type.equals(\"Sandwich\") && sandwichCounter != 0;\n }", "public int NumOfGames()\n\t{\n\t\treturn gametype.length;\n\t}", "public int getNumOfClasses();", "void hardRemoveAllBotsOfType( String className, String initiator ) {\n String rawClassName = className.toLowerCase();\n Integer numBots = m_botTypes.get( rawClassName );\n LinkedList<String> names = new LinkedList<String>();\n\n for( ChildBot c : m_botStable.values() )\n if( c != null ) {\n if(c.getClassName().equals( rawClassName ))\n names.add( c.getBot().getBotName() );\n }\n\n for( String name : names ) {\n removeBot( name, \"!removetype by \" + initiator );\n m_botAction.sendChatMessage( 1, name + \" logged off. (!removetype initiated.)\" );\n }\n\n if( numBots != null && numBots.intValue() != 0 )\n m_botTypes.put( rawClassName, new Integer(0) );\n }", "public <T extends GameObject> T[] senseNearbyGameObjects(Class<T> type);", "public Integer getCount(Class<?> type) {\n return events.containsKey(type) ? events.get(type).size() : 0;\n }", "public void incrementNumberOfWins(TypeOfGames type) {\n statistics.get(type).incrementNumberOfWins();\n }", "void spawnBot( String className, String login, String password, String messager ) {\n CoreData cdata = m_botAction.getCoreData();\n long currentTime;\n\n String rawClassName = className.toLowerCase();\n BotSettings botInfo = cdata.getBotConfig( rawClassName );\n\n if( botInfo == null ) {\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" tried to spawn bot of type \" + className + \". Invalid bot type or missing CFG file.\" );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader tried to spawn bot of type \" + className + \". Invalid bot type or missing CFG file.\" );\n\n m_botAction.sendSmartPrivateMessage( messager, \"That bot type does not exist, or the CFG file for it is missing.\" );\n return;\n }\n\n Integer maxBots = botInfo.getInteger( \"Max Bots\" );\n Integer currentBotCount = m_botTypes.get( rawClassName );\n\n if( maxBots == null ) {\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" tried to spawn bot of type \" + className + \". Invalid settings file. (MaxBots improperly defined)\" );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader tried to spawn bot of type \" + className + \". Invalid settings file. (MaxBots improperly defined)\" );\n\n m_botAction.sendSmartPrivateMessage( messager, \"The CFG file for that bot type is invalid. (MaxBots improperly defined)\" );\n return;\n }\n\n if( login == null && maxBots.intValue() == 0 ) {\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" tried to spawn bot of type \" + className + \". Spawning for this type is disabled on this hub.\" );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader tried to spawn bot of type \" + className + \". Spawning for this type is disabled on this hub.\" );\n\n m_botAction.sendSmartPrivateMessage( messager, \"Bots of this type are currently disabled on this hub. If you are running another hub, please try from it instead.\" );\n return;\n }\n\n if( currentBotCount == null ) {\n currentBotCount = new Integer( 0 );\n m_botTypes.put( rawClassName, currentBotCount );\n }\n\n if( login == null && currentBotCount.intValue() >= maxBots.intValue() ) {\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" tried to spawn a new bot of type \" + className + \". Maximum number already reached (\" + maxBots + \")\" );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader tried to spawn a new bot of type \" + className + \". Maximum number already reached (\" + maxBots + \")\" );\n\n m_botAction.sendSmartPrivateMessage( messager, \"Maximum number of bots of this type (\" + maxBots + \") has been reached.\" );\n return;\n }\n\n String botName, botPassword;\n currentBotCount = new Integer( getFreeBotNumber( botInfo ) );\n\n if( login == null || password == null ) {\n botName = botInfo.getString( \"Name\" + currentBotCount );\n botPassword = botInfo.getString( \"Password\" + currentBotCount );\n } else {\n botName = login;\n botPassword = password;\n }\n\n Session childBot = null;\n\n try {\n // FIXME: KNOWN BUG - sometimes, even when it detects that a class is updated, the loader\n // will load the old copy/cached class. Perhaps Java itself is caching the class on occasion?\n if( m_loader.shouldReload() ) {\n System.out.println( \"Reinstantiating class loader; cached classes are not up to date.\" );\n resetRepository();\n m_loader = m_loader.reinstantiate();\n }\n\n Class<? extends SubspaceBot> roboClass = m_loader.loadClass( \"twcore.bots.\" + rawClassName + \".\" + rawClassName ).asSubclass(SubspaceBot.class);\n String altIP = botInfo.getString(\"AltIP\" + currentBotCount);\n int altPort = botInfo.getInt(\"AltPort\" + currentBotCount);\n String altSysop = botInfo.getString(\"AltSysop\" + currentBotCount);\n\n if(altIP != null && altSysop != null && altPort > 0)\n childBot = new Session( cdata, roboClass, botName, botPassword, currentBotCount.intValue(), m_group, altIP, altPort, altSysop, true);\n else\n childBot = new Session( cdata, roboClass, botName, botPassword, currentBotCount.intValue(), m_group, true);\n } catch( ClassNotFoundException cnfe ) {\n Tools.printLog( \"Class not found: \" + rawClassName + \".class. Reinstall this bot?\" );\n return;\n }\n\n currentTime = System.currentTimeMillis();\n\n if( m_lastSpawnTime + SPAWN_DELAY > currentTime ) {\n m_botAction.sendSmartPrivateMessage( messager, \"Subspace only allows a certain amount of logins in a short time frame. Please be patient while your bot waits to be spawned.\" );\n\n if( m_spawnQueue.isEmpty() == false ) {\n int size = m_spawnQueue.size();\n\n if( size > 1 ) {\n m_botAction.sendSmartPrivateMessage( messager, \"There are currently \" + m_spawnQueue.size() + \" bots in front of yours.\" );\n } else {\n m_botAction.sendSmartPrivateMessage( messager, \"There is only one bot in front of yours.\" );\n }\n } else {\n m_botAction.sendSmartPrivateMessage( messager, \"You are the only person waiting in line. Your bot will log in shortly.\" );\n }\n\n if(messager != null)\n m_botAction.sendChatMessage( 1, messager + \" in queue to spawn bot of type \" + className );\n else\n m_botAction.sendChatMessage( 1, \"AutoLoader in queue to spawn bot of type \" + className );\n }\n\n String creator;\n\n if(messager != null) creator = messager;\n else creator = \"AutoLoader\";\n\n ChildBot newChildBot = new ChildBot( rawClassName, creator, childBot );\n addToBotCount( rawClassName, 1 );\n m_botStable.put( botName, newChildBot );\n m_spawnQueue.add( newChildBot );\n }", "private int getGoodsCount(GoodsType type) {\n return colony.getGoodsCount(type);\n }", "private void _updateCount(int classType) {\n int subClass, superClass;\n\n instances_[classType].count++;\n subClass = classType;\n while ( (superClass = CLASS_INFO[subClass][INDEX_SUPER]) != CS_C_NULL) {\n instances_[superClass].count++;\n subClass = superClass;\n }\n }", "public long countLotsByEntityType(String type) throws MiddlewareQueryException;", "int getAchievementsCount();", "public Integer getCountTyped(Class<?> type) {\n int count = 0;\n for (Map.Entry<Class<?>, List<EventRecording>> recordingEntry : events.entrySet()) {\n if (type.isAssignableFrom(recordingEntry.getKey())) {\n count += recordingEntry.getValue().size();\n }\n }\n return count;\n }", "public void countCoins() {\r\n\t\tthis.coinCount = 0;\r\n\t\tfor (int x = 0; x < WIDTH; x++) {\r\n\t\t\tfor (int y = 0; y < HEIGHT; y++) {\r\n\t\t\t\tif (this.accessType(x, y) == 'C')\r\n\t\t\t\t\tthis.coinCount++;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public int countByType(long typeId);", "@SuppressWarnings(BookFlowConstants.BOXING)\r\n private int getCount(final Collection<String> types, final String type)\r\n {\r\n int paxCount = 0;\r\n for (final String passengerType : types)\r\n {\r\n if (StringUtils.equalsIgnoreCase(passengerType.trim(), type))\r\n {\r\n paxCount++;\r\n }\r\n }\r\n return paxCount;\r\n }", "public int getActiveRunwaysCount();", "int getSuperClassesCount();", "int getQuestCount();", "int getParticipantsCount();", "int getParticipantsCount();", "List<SpawnType> getSpawnTypes(EntityType entityType);", "public static int getCount(char type) {\n if (type == CARD) {\n return globalCardCount;\n } else {\n return globalRiderCount;\n }\n }", "public int countPlayers(){\n return players.size();\n }", "int getAchieveInfoCount();", "int getUserQuestJobsCount();", "int getUserTypesCount();", "public int nrOfPlayers() {\n int playerCount = 0;\n for (Player player : players) {\n if (player.getName() != null) {\n playerCount++;\n }\n }\n\n return playerCount;\n }", "public int spawn() {\n int totalNumOfFryBorn = 0;\n Iterator<Guppy> it = guppiesInPool.iterator();\n ArrayList<Guppy> currentBabies = new ArrayList<>();\n\n while (it.hasNext()) {\n Guppy mother = it.next();\n ArrayList<Guppy> newBabies = mother.spawn();\n if (newBabies != null) {\n totalNumOfFryBorn += newBabies.size();\n currentBabies.addAll(newBabies);\n }\n }\n guppiesInPool.addAll(currentBabies);\n return totalNumOfFryBorn;\n }", "public int getNumberOfClasses() {\n return 200;\n }", "@Override\r\n\tpublic int countCabsOfType(String carType) {\r\n\t\tlong count = cabRepository.countByCarType(carType);\r\n\t\tint cabCount =(int) count;\r\n\t\treturn cabCount;\r\n\t}", "int countInstances();", "public int randomizedNumberOfLocksByChestType(Random random, TreasureChestType type) {\n\t\t// determine the number of locks to add\n\t\tint numLocks = RandomHelper.randomInt(random, 1, type.getMaxLocks());\t\t\n\t\tTreasure.logger.debug(\"# of locks to use: {})\", numLocks);\n\t\t\n\t\treturn numLocks;\n\t}", "public int getNbPawns(Player player) {\n Pawn aPawn;\n int Size, nbPawn;\n Size = getSize();\n nbPawn = 0;\n\n for (int numLine = 0; numLine < Size; numLine++) {\n for (int numCol = 0; numCol < Size; numCol++) {\n\n aPawn = field[numLine][numCol];\n if (aPawn != null) {\n if (aPawn.getPlayer() == player) nbPawn++; //if the pawn belong to player\n }\n\n }\n }\n\n return nbPawn;\n }", "int getNewlyAvailableQuestsCount();", "List<SpawnType> getSpawnTypes();", "public static int countReceivedMessages(\n\t Class<? extends TrackedMessage> messageClassType) {\n\treturn TrackedMessage.countReceivedMessages(messageClassType, -1);\n }", "public static int countSentMessages(\n\t Class<? extends TrackedMessage> messageClassType)\n\t throws NullPointerException {\n\treturn TrackedMessage.countSentMessages(messageClassType, -1);\n }", "public int nbEnemiesAlive(){\n return state.getPlayers().size()-1;\n }", "public int numPlayers(){\n return this.members.size();\n }", "public void incrementNumberOfDefeats(TypeOfGames type) {\n statistics.get(type).incrementNumberOfDefeats();\n }", "public int countBoats() {\r\n\t\treturn boats.size();\r\n\t}", "public int sleepersCount(int height)\r\n {\n int fullSleepers = (int) ((height)/20);\r\n //Calculating exceeding sleeper.\r\n int extraSleeper = ((height)/20);\r\n //Deciding whether an extra full sleeper is needed or not.\r\n if (fullSleepers != 0)\r\n {\r\n if (extraSleeper % fullSleepers > 0.5)\r\n {\r\n fullSleepers++;\r\n }\r\n }\r\n return fullSleepers;\r\n \r\n }", "public void setCount(String type){\n if(type.equals(\"Zombie\")){\n this.zombieCounter -= 1;\n } else if (type.equals(\"Sandwich\")){\n this.sandwichCounter -= 1;\n }\n }", "public int playersCount(){\r\n\t\treturn players.size();\r\n\t}", "public static Integer getBotWins() {\n return humanVsBot.OWins + botVsHuman.XWins;\n }", "public int getNumRobots() {\n return ((Integer)numRobotsSpinner.getValue()).intValue();\n }", "public static int getNumPlayers(){\n\t\treturn numPlayers;\n\t}", "public int getWallItemsCount(String userUuid);", "public int getCantidadRobots();", "int getStatsCount();", "int getStatsCount();", "int getStatsCount();", "public void count() {\n\t\talgae = -1;\n\t\tcrab = -1;\n\t\tbigFish = -1;\n\t\tfor(GameObjects o: objects) {\n\t\t\tswitch(o.toString()) {\n\t\t\tcase \"algae\":\n\t\t\t\talgae +=1;\n\t\t\t\tbreak;\n\t\t\tcase \"crab\":\n\t\t\t\tcrab +=1;\n\t\t\t\tbreak;\n\t\t\tcase \"big fish\":\n\t\t\t\tbigFish +=1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public static int getNumberCreated() {\n return numberOfPools;\n }", "int getMonstersCount();", "int getMonstersCount();", "int getResponsesCount();", "private int totalCount(Piece side) {\n int sum = 0;\n for (int i = 0; i < M; i++) {\n for (int j = 0; j < M; j++) {\n if (boardArr[i][j].abbrev().equals(sideAbbrev)) {\n sum++;\n }\n }\n }\n return sum;\n }", "public int numberOfBoats(){\n return this.boats.size();\n }", "public static void debug_countTypes() throws GameActionException {\n for (RobotType robotType: RobotType.values()) {\n System.out.println(\"The number of \" + robotType + \" is \" + RobotCount.read(robotType));\n }\n }", "public static int findNumberOfCreatedComputers() {\n return objCounter;\n }", "private static int getNumLiveUnits(ArrayList<Unit> party){\n\t\tint count=0;\n\t\tfor(Unit u:party){\n\t\t\tif(!u.getPokemon().isFainted())\n\t\t\t\tcount++;\n\t\t}\n\t\treturn count;\n\t}", "public int numberOfBalls() {\r\n return 3;\r\n }", "public void incrementNumberGames(TypeOfGames type) {\n statistics.get(type).incrementNumberGames();\n }", "int getClasspathCount();", "int getClasspathCount();", "int getExecutorActiveCount();", "long getRecipesCount();", "public void countDeaths() {\n\t\tfor (LogLineData d : dataList) {\n\n\t\t\tif (!d.getDeadName().equals(\"<WORLD>\")) {\n\t\t\t\tint deadIndex = getKillerIndex(d.getDeadName());\n\n\t\t\t\tif (deadIndex == -1) {\n\t\t\t\t\tNinja n = new Ninja(d.getDeadName());\n\t\t\t\t\tn.setDeathsNumber(1);\n\t\t\t\t\tkillers.add(n);\n\t\t\t\t} else {\n\t\t\t\t\tint death = killers.get(deadIndex).getDeathsNumber();\n\t\t\t\t\tkillers.get(deadIndex).setDeathsNumber(death + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static int countSentBytes(\n\t Class<? extends TrackedMessage> messageClassType) {\n\treturn TrackedMessage.countSentBytes(messageClassType, -1);\n }", "@GetMapping(\"/class/{type}\")\n\t@ResponseBody\n\tpublic long totcountByCategorie(@PathVariable(\"type\")String type) {\n\t\t\n\t\treturn projectservice.totcountByCategorie(type);\n\t}", "private void countAgents(){\r\n\t\t\tfor(Agent agent : agents){\r\n\t\t\t\tif(agent.isActive()) activeAgent ++;\r\n\t\t\t\telse if(agent.getJailTerm() > 0) jailedAgent ++;\r\n\t\t\t\telse quietAgent ++;\r\n\t\t\t}\r\n\t\t}", "public void countStats(String chr, String gene, String geneid, String type){\r\n if(!chr.equals(this.chr) && this.chr != null){\r\n this.printOut(this.chr);\r\n this.counter = new HashMap<>();\r\n System.gc();\r\n this.chr = chr;\r\n }else if(this.chr == null){\r\n this.chr = chr;\r\n }\r\n \r\n \r\n if(!this.counter.containsKey(gene))\r\n this.counter.put(gene, new HashMap<>());\r\n \r\n if(!this.counter.get(gene).containsKey(geneid))\r\n this.counter.get(gene).put(geneid, new HashMap<>());\r\n \r\n if(this.ClassExists(type)){\r\n if(!this.counter.get(gene).get(geneid).containsKey(type))\r\n this.counter.get(gene).get(geneid).put(type, 0);\r\n \r\n this.counter.get(gene).get(geneid).put(type, this.counter.get(gene).get(geneid).get(type) + 1);\r\n } \r\n }", "public static int countSentMessages(\n\t Class<? extends TrackedMessage> messageClassType, int messageType)\n\t throws NullPointerException {\n\tif (null == messageClassType)\n\t throw new NullPointerException(\"messageClassType cannot be null\");\n\n\treturn TrackedMessage.reduceMap(TrackedMessage.unmapType(\n\t\tTrackedMessage.messagesSent, messageClassType), messageType);\n }", "public int playerCount()\r\n\t{\r\n\t\tint count = 0;\r\n\t\tfor(Player player: this.players)\r\n\t\t{\r\n\t\t\tif(player != null)\r\n\t\t\t{\r\n\t\t\t\t++count;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t}", "public int getAgentsCount() {\n if (agentsBuilder_ == null) {\n return agents_.size();\n } else {\n return agentsBuilder_.getCount();\n }\n }", "public long countLotsByEntityTypeAndEntityId(String type, Integer entityId) throws MiddlewareQueryException;", "long countByExample(ClazzExample example);", "public int getCount() {\n\n if (team.size() <= 0)\n return 1;\n return team.size();\n }", "int getCount(Side player) {\n return player == BLACK ? _countBlack : _countWhite;\n }", "public int getMasteredSkills() {\r\n int count = 0;\r\n for (int i = 0; i < getTotalSkills(); i++) {\r\n if (getStaticLevel(i) >= 99) {\r\n count++;\r\n }\r\n }\r\n return count;\r\n }", "int getGroupCount();", "@Override\r\n\tpublic final void calculateSpawnAmount() {\r\n\t\tthis.spawnsRequired = 0;\r\n\t\tfor (final Genome genome : this.members) {\r\n\t\t\tthis.spawnsRequired += genome.getAmountToSpawn();\r\n\t\t}\r\n\r\n\t}", "int countByExample(AgentLevelExample example);", "int getTrucksCount();", "public int getInstancesPerType()\n {\n return instancesPerType;\n }", "public long getCount(MigrationType type);", "int countByExample(TycCompanyExecutiveCrawlerExample example);", "@Override\r\n\tpublic int selectBannerCount(int type) {\n\t\treturn bannerDao.selectBannerCount(type);\r\n\t}", "public int bobCount ();", "int countByExample(TycCompanyCheckCrawlerExample example);", "int getDeleteUserMonsterUuidsCount();", "public int getQuestCount() {\n if (questBuilder_ == null) {\n return quest_.size();\n } else {\n return questBuilder_.getCount();\n }\n }" ]
[ "0.792605", "0.60882455", "0.5625093", "0.5619367", "0.5554781", "0.5408492", "0.5384369", "0.5373985", "0.53650707", "0.53579855", "0.5339003", "0.53282505", "0.53256613", "0.5319775", "0.5315454", "0.5299278", "0.52971303", "0.5194875", "0.5161499", "0.5150685", "0.51089895", "0.50744176", "0.5073891", "0.507333", "0.5071925", "0.5052994", "0.5052994", "0.5030795", "0.50254613", "0.50157636", "0.50155634", "0.49931422", "0.49879286", "0.49760708", "0.49674377", "0.4963786", "0.4918481", "0.49178258", "0.49168822", "0.49138528", "0.48759466", "0.487468", "0.4855544", "0.4849821", "0.48410067", "0.4840332", "0.48323905", "0.48140678", "0.48083904", "0.48063165", "0.48005334", "0.47998843", "0.4773124", "0.47679034", "0.47676486", "0.47665304", "0.47618198", "0.47618198", "0.47618198", "0.4759078", "0.47528088", "0.4746702", "0.4746702", "0.4738803", "0.47365847", "0.4728247", "0.4719591", "0.47168404", "0.47076625", "0.46976918", "0.4695644", "0.46948093", "0.46948093", "0.46930876", "0.467647", "0.4676426", "0.46754587", "0.46657848", "0.46656245", "0.4663288", "0.46590137", "0.4658824", "0.46588084", "0.4658088", "0.4657449", "0.46530664", "0.46529445", "0.4652051", "0.46484494", "0.4646528", "0.46454662", "0.46444002", "0.4642177", "0.46401516", "0.4639908", "0.46382374", "0.46351495", "0.4634956", "0.46293846", "0.46219364" ]
0.7605613
1
Removes a bot with no information provided.
String removeBot( String name ) { try { return removeBot( name, "no longer running; removed from BotQueue stable" ); } catch ( NullPointerException e ) { return "nullbot"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void removeListener(BotListener l);", "String removeBot( String name, String msg ) {\n if( name == null )\n return \"had no name associated; no removal action taken\";\n\n ChildBot deadBot = m_botStable.remove( name );\n\n if( deadBot != null ) {\n try {\n Session deadSesh = deadBot.getBot();\n\n if( deadSesh != null ) {\n if( deadSesh.getBotAction() != null ) {\n deadSesh.getBotAction().cancelTasks();\n }\n\n if( msg != null ) {\n if( !msg.equals(\"\") ) {\n deadSesh.disconnect( msg );\n } else {\n deadSesh.disconnect( \"(empty DC message)\" );\n }\n } else {\n deadSesh.disconnect( \"(null DC message)\" );\n }\n }\n\n // Decrement count for this type of bot\n addToBotCount( deadBot.getClassName(), (-1) );\n deadBot = null;\n return \"has disconnected normally\";\n } catch( NullPointerException e ) {\n Tools.printStackTrace(e);\n m_botAction.sendChatMessage( 1, name + \" had a disconnection problem/was already DC'd (null pointer exception thrown)\");\n }\n }\n\n return \"not found in bot stable (possibly already disconnected)\";\n }", "private void removePlayerFromLobby() {\n\n //Added Firebase functionality assuming var player is the player who wants to leave the game.\n }", "private void logout(){\n player.setName(\"(bot) \" + player.getName());\n botMode = true;\n System.out.println(\"bot made\");\n login = false;\n }", "void removeLogger(BotLogger logger);", "public void remove(Lobby lobby) {\n DocumentReference doc = Firebase.docRefFromPath(\"lobbies/\" + lobby.getGameCode());\n doc.delete();\n }", "@io.vertigo.datamodel.task.proxy.TaskAnnotation(\r\n\t\t\tname = \"TkRemoveAllTopicsFromBot\",\r\n\t\t\trequest = \"delete from topic top \\n\" + \n \" \t\t\twhere top.bot_id = #botId#\",\r\n\t\t\ttaskEngineClass = io.vertigo.basics.task.TaskEngineProc.class)\r\n\tpublic void removeAllTopicsFromBot(@io.vertigo.datamodel.task.proxy.TaskInput(name = \"botId\", smartType = \"STyId\") final Long botId) {\r\n\t\tfinal Task task = createTaskBuilder(\"TkRemoveAllTopicsFromBot\")\r\n\t\t\t\t.addValue(\"botId\", botId)\r\n\t\t\t\t.build();\r\n\t\tgetTaskManager().execute(task);\r\n\t}", "public void removePlayerFromCurrentLobby(LobbyPlayer player) {\n DocumentReference doc = Firebase.docRefFromPath(\"lobbies/\" + player.getLobbyCode());\n doc.update(FieldPath.of(\"players\", player.getUsername()), FieldValue.delete());\n removeListener();\n GameService.removeListener();\n cache = null;\n }", "public void removeAgent() {agent = null;}", "@Override\n public void removeGameApp(Handle<GameAppContext> that) \n {\n manager.removeGameApp(that);\n }", "@io.vertigo.datamodel.task.proxy.TaskAnnotation(\r\n\t\t\tname = \"TkRemoveAllNluTrainingSentenceByBotId\",\r\n\t\t\trequest = \"delete from nlu_training_sentence nts\\n\" + \n \" \t\t\tusing topic top\\n\" + \n \" \t\t\twhere nts.top_id = top.top_id and top.bot_id = #botId#\",\r\n\t\t\ttaskEngineClass = io.vertigo.basics.task.TaskEngineProc.class)\r\n\tpublic void removeAllNluTrainingSentenceByBotId(@io.vertigo.datamodel.task.proxy.TaskInput(name = \"botId\", smartType = \"STyId\") final Long botId) {\r\n\t\tfinal Task task = createTaskBuilder(\"TkRemoveAllNluTrainingSentenceByBotId\")\r\n\t\t\t\t.addValue(\"botId\", botId)\r\n\t\t\t\t.build();\r\n\t\tgetTaskManager().execute(task);\r\n\t}", "public void removePlayer(Player plr){\r\n\t\t\r\n\t\tlobby.removePlayerFromLobby(plr);\r\n\t\tlobby.updateNames();\r\n\t\tsendNameInfoToAll();\r\n\t\tremoveConnection(plr);\r\n\t}", "public void removeMotorista() {\n\t\tConector con = new Conector();\r\n\t\tString params[] = new String[2];\r\n\r\n\t\tparams[0] = \"op=8\";\r\n\t\tparams[1] = \"email=\" + usuario;\r\n\r\n\t\tcon.sendHTTP(params);\r\n\t}", "Bot getBotByBotId(String botId) throws CantGetBotException;", "public Builder clearOpponent() {\n if (opponentBuilder_ == null) {\n opponent_ = null;\n onChanged();\n } else {\n opponent_ = null;\n opponentBuilder_ = null;\n }\n\n return this;\n }", "void unFollow(User user);", "public void deleteChatRoom(ChatRoom cr);", "private void remove() {\n disableButtons();\n clientgui.getClient().sendDeleteEntity(cen);\n cen = Entity.NONE;\n }", "private static void removeTalker(User talker, AppCompatActivity activity) {\n mRefUsersTalk\n .child(mAuth.getCurrentUser().getUid())\n .child(talker.getId())\n .removeValue()\n .addOnSuccessListener(aVoid -> {\n\n //REMOVES CURRENT USER TO TALKER NODE\n mRefUsersTalk\n .child(talker.getId())\n .child(mAuth.getCurrentUser().getUid())\n .removeValue()\n .addOnSuccessListener(aVoid1 -> {\n showProgressDialog(false);\n Toast.makeText(activity.getApplicationContext(), \"Usuário removido com sucesso!\", Toast.LENGTH_SHORT)\n .show();\n\n backToMainActivity(activity);\n })\n .addOnFailureListener(Throwable::getLocalizedMessage);\n })\n .addOnFailureListener(Throwable::getLocalizedMessage);\n\n }", "public abstract BossBar removePlayer(UUID uuid);", "void removeRobot(Position pos);", "public void remove()\n {\n domain.removeParticipant(participant);\n }", "void removeFromGame() {\n\t\t// remove from game\n\t\t//only for multi-player\n\t}", "private void removePlayerFromTheGame(){\n ServerConnection toRemove = currClient;\n\n currClient.send(\"You have been removed from the match!\");\n updateCurrClient();\n server.removePlayerFromMatch(gameID, toRemove);\n\n if ( toRemove == client1 ){\n this.client1 = null;\n }\n else if ( toRemove == client2 ){\n this.client2 = null;\n }\n else {\n client3 = null;\n }\n gameMessage.notify(gameMessage);\n\n if ( (client1 == null && client2 == null) || (client2 == null && client3 == null) || (client1 == null && client3 == null) ){\n gameMessage.notify(gameMessage);\n }\n if ( liteGame.isWinner() ) endOfTheGame = true;\n playerRemoved = true;\n }", "void unsetWhoOwnsWhom();", "public void removeWallet(Wallet wallet);", "public void remove(){\n Api.worldRemover(getWorld().getWorldFolder());\n }", "private void removeRobot(Actor r) {\n\t\tfor (int i = 0; i < attackRobots.size(); i++) {\n\t\t\tif (attackRobots.get(i).equals(r)) {\n\t\t\t\tattackRobots.remove(i);\n\t\t\t\tcheckLost();\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < supportRobots.size(); i++) {\n\t\t\tif (supportRobots.get(i).equals(r))\n\t\t\t\tsupportRobots.remove(i);\n\t\t}\n\t}", "public synchronized void removeCommunicator(TrackerServerCommunicator comm) {\n\t\tcomms.remove(comm);\n\t}", "public void removeGameObj(GameObject obj){\n display.getChildren().remove(obj.getDisplay());\n }", "@Override\n\tpublic void removeGoal(Goal g) {\n\t\t\n\t}", "@Override\r\n\tpublic void excluir(Telefone vo) throws Exception {\n\t\t\r\n\t}", "public void removeRobot(String name){\n robotNames.remove(name);\n measurementHandlers.remove(name);\n }", "public void remove (Object o) \n throws NoPeerException, SQLException, NotFoundException\n {\n PersistentPeer peer = getPeer(o);\n peer.setPersistentEngine (this);\n peer.remove (o);\n }", "public void removeParty(L2Party party)\r\n\t{\r\n\t\t_partys.remove(party);\r\n\t\t_channelLvl = 0;\r\n\t\tfor (L2Party pty : _partys)\r\n\t\t{\r\n\t\t\tif (pty.getLevel() > _channelLvl)\r\n\t\t\t\t_channelLvl = pty.getLevel();\r\n\t\t}\r\n\t\tparty.setCommandChannel(null);\r\n\t\tparty.broadcastToPartyMembers(ExCloseMPCC.STATIC_PACKET);\r\n\r\n\t\tSystemMessage sm;\r\n\t\tif (_partys.size() < 2)\r\n\t\t{\r\n\t\t\tsm = new SystemMessage(SystemMessageId.COMMAND_CHANNEL_DISBANDED);\r\n \t\tbroadcastToChannelMembers(sm);\r\n\t\t\tdisbandChannel();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\telse if (_partys.size() < 5)\r\n\t\t{\r\n\t\t\tsm = new SystemMessage(SystemMessageId.COMMAND_CHANNEL_ONLY_AT_LEAST_5_PARTIES);\r\n \t\tbroadcastToChannelMembers(sm);\r\n \t\tsm = new SystemMessage(SystemMessageId.S1_PARTIES_REMAINING_UNTIL_CHANNEL);\r\n \t\tsm.addNumber(5 - _partys.size());\r\n\t\t}\r\n\t\tbroadcastToChannelMembers(new ExMultiPartyCommandChannelInfo(this));\r\n\t}", "public void removeAIObject(String id) {\n aiObjects.remove(id);\n }", "public void enemyoff(){\n getWorld().removeObject(this);\n }", "private unreg_server_online(Builder builder) {\n super(builder);\n }", "void removePeer(Uuid peer) throws RemoteException;", "public void cmdRemovePlayer(User teller, Player player) {\n boolean removed = tournamentService.removePlayer(player);\n tournamentService.flush();\n if (!removed) {\n command.tell(teller, \"I''m not able to find {0} in the tournament.\", player);\n } else {\n command.tell(teller, \"Done. Player {0} is no longer in the tournament.\", player);\n }\n }", "public void removePlayer(int playerObjId)\n\t{\n\t\t_floodClient.remove(playerObjId);\n\t}", "public boolean unfollow(ProfileInterface other);", "public synchronized void removeGame(String id) {\n if (null != this.waitingGame && this.waitingGame.getID() == id) {\n this.waitingGame = null;\n }\n }", "void removeMember(final PartyMember member);", "public void cmdRemoveTeam(User teller, Team team) {\n int playerCount = tournamentService.removeTeam(team);\n tournamentService.flush();\n if (playerCount < 0) {\n command.tell(teller, \"I''m not able to find {0} in the tournament.\", team);\n } else {\n command.tell(teller, \"Done. Team {0} is no longer in the tournament.\", team.getTeamCode());\n command.tell(teller, \"{0} players were also removed.\", playerCount);\n }\n }", "void removeAdvert(String aid);", "void hardRemoveAllBotsOfType( String className, String initiator ) {\n String rawClassName = className.toLowerCase();\n Integer numBots = m_botTypes.get( rawClassName );\n LinkedList<String> names = new LinkedList<String>();\n\n for( ChildBot c : m_botStable.values() )\n if( c != null ) {\n if(c.getClassName().equals( rawClassName ))\n names.add( c.getBot().getBotName() );\n }\n\n for( String name : names ) {\n removeBot( name, \"!removetype by \" + initiator );\n m_botAction.sendChatMessage( 1, name + \" logged off. (!removetype initiated.)\" );\n }\n\n if( numBots != null && numBots.intValue() != 0 )\n m_botTypes.put( rawClassName, new Integer(0) );\n }", "public static void clearWinners(){winners.clear();}", "public void removeThing(){\n thing = null;\n }", "void remove(InternalSession session);", "public void clearCommand() {\r\n _board = new Board();\r\n _playing = false;\r\n }", "public void maybeRemove(RemoveRandom r, ObjectContainer container, ClientContext context);", "public void removeUser(String username);", "public Builder clearPlayer() {\n if (playerBuilder_ == null) {\n player_ = null;\n onChanged();\n } else {\n player_ = null;\n playerBuilder_ = null;\n }\n\n return this;\n }", "public void kill()\r\n {\n if(isTouching(TopDownPlayer.class))\r\n {\r\n health(1);\r\n\r\n getWorld().removeObject(player);\r\n //getWorld().addObject (new Test(), 20, 20);\r\n\r\n }\r\n // if(healthCount >= 1)\r\n // {\r\n // World world;\r\n // world = getWorld();\r\n // getWorld().removeObject(player);\r\n // \r\n // getWorld().addObject (new Test(), 20, 20);\r\n // }\r\n }", "private void deleteFakeTeam(Player player) {\n\t\tPacketContainer packet = new PacketContainer(PacketType.Play.Server.SCOREBOARD_TEAM);\n\t\tpacket.getStrings().write(0, FakeTeamName);\n\t\tpacket.getIntegers().write(1, 1); // Set remove mode\n\t\t\n\t\ttry {\n\t\t\tProtocolLibrary.getProtocolManager().sendServerPacket(player, packet);\n\t\t} catch (InvocationTargetException e) {\n\t\t\t// Should never happen unless packet changes\n\t\t\tthrow new AssertionError(e);\n\t\t}\n\t}", "@Nullable\n public OnlineMeeting delete() throws ClientException {\n return send(HttpMethod.DELETE, null);\n }", "public void eliminarReceiver(Long id){\r\n persistence.remove(id);\r\n }", "public void removeMember(Player player) {\n\t\tmembers.remove(player.getUniqueId());\n\t\tif (members.isEmpty()) {\n\t\t\tdeleteParty(this); // Uncaches empty parties\n\t\t}\n\t}", "public void unfollow(int followerId, int followeeId) {\n\n }", "public Builder clearAgent() {\n bitField0_ = (bitField0_ & ~0x00000010);\n agent_ = null;\n if (agentBuilder_ != null) {\n agentBuilder_.dispose();\n agentBuilder_ = null;\n }\n onChanged();\n return this;\n }", "private void eliminatePlayer(Player loser){\n players.remove(loser);\n }", "@Override\n\tpublic void removeServer(String arg0) {\n\n\t}", "public static void clear() {\n SharedPrefWrapper sharedPref = SharedPrefWrapper.getInstance();\n sharedPref.clearWeiboPref();\n }", "public void removeVote(String token);", "@Test\n public void testremovePlayer() {\n session.removePlayer(playerRemco);\n // There already was 1 player, so now there should be 0\n assertEquals(0, session.getPlayers().size());\n }", "public void removeServer(Identity identity);", "public void removeResponse(Poll poll){\n poll.getResponses().remove(poll);\n }", "@Override\n\tpublic int admin_remove(BoardVO obj) {\n\t\treturn 0;\n\t}", "public static void deleteUser() {\n try {\n buildSocket();\n ClientService.sendMessageToServer(connectionToServer, ClientService.deleteUser());\n closeSocket();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "void removeMemberById(final String accountId);", "void remove(String identifier) throws GuacamoleException;", "public void deleteRoom(Room room);", "void removeListener(GraphListener listener);", "public void removeTeamMember(final Artifact artifact);", "public void removeAgentAndPlayer(Agent agent) {\n\t\tif ( agents.remove(agent) ) {\n\t\t\tPlayer p = agentPlayers.get(agent);\n\t\t\tif ( p != null ) {\n\t\t\t\t// tell the engine to execute the player's Quit action (which removes the Player from the world)\n\t\t\t\tengine.submitAction(new ActionQuit(p));\n\t\t\t}\n\t\t\t// finally, detach the Agent from their Player\n\t\t\tdetachAgent(agent);\n\t\t\t// the agent no longer wants to handle the events coming from the engine\n\t\t\tengine.unregisterWorldUpdateHandler(agent);\n\t\t\tengine.unregisterPlayerActionsUpdateHandler(agent);\n\t\t\t// we (the session) no longer want to handle actions coming from the agent\n\t\t\tagent.unregisterPlayerActionHandler(this);\n\t\t}\n\t}", "@Test\n\tpublic void testRemoveMentee()\n\t{\n\t\tmentor.removeMentee(mentee);\n\t\tassertThat(mentor.getMentees().size()).isEqualTo(0);\n\t}", "public void remove( IAnswer answerToRemove );", "void removePushApplication(LoggedInUser account, PushApplication pushApp);", "void remove(String installedAppId);", "void setBotOptions(DefaultBotOptions botOptions){\n this.botOptions = botOptions;\n }", "boolean removePlayer(String player);", "@Override public void clientRemoveGame(Game game) throws RemoteException, SQLException {\r\n gameListClientModel.clientRemoveGame(game);\r\n }", "public Builder clearCommand() {\n if (commandBuilder_ == null) {\n if (responseCase_ == 2) {\n responseCase_ = 0;\n response_ = null;\n onChanged();\n }\n } else {\n if (responseCase_ == 2) {\n responseCase_ = 0;\n response_ = null;\n }\n commandBuilder_.clear();\n }\n return this;\n }", "public void removeFightsystem( Fightsystem fightsystem )\r\n {\n\r\n }", "public synchronized void delPlayer(@NotNull PlayerInterface player) {\n\n for(BoardCell boardCell[] : board.getGrid()) {\n for(BoardCell b : boardCell) {\n if(b.getWorker() != null) {\n if(b.getWorker().getPlayerWorker().getNickname().equals(player.getNickname())) {\n b.setWorker(null);\n }\n }\n }\n }\n player.getWorkerRef().clear();\n for (int i = 0; i < onlinePlayers.size(); i++) {\n if(onlinePlayers.get(i).getNickname().equals(player.getNickname())) {\n if(started) {\n stateList.remove(i);\n onlinePlayers.remove(i);\n nickNames.remove(player.getNickname());\n }\n break;\n }\n }\n }", "public void removeCommand(final String command) {\n try {\n commands.remove(command);\n } catch (Exception e) {//NOPMD\n e.printStackTrace();//NOPMD\n e.getMessage();//NOPMD\n }\n }", "private void removeClient () {\n AutomatedClient c = clients.pollFirstEntry().getValue();\n Nnow--;\n\n c.signalToLeave();\n System.out.println(\"O cliente \" + c.getUsername() + \" foi sinalizado para sair\");\n }", "void removeFeature(FriendPresence friendPresence);", "public void remove(Session session);", "public void removeMember(Player player) {\n this.members.remove(player.getUniqueId().toString());\n }", "public void removePlayer(Player player){\n playerList.remove(player);\n }", "void remove(Actor actor);", "@Override\n\t\t\t\t\tpublic void onDisconnected(Robot arg0) {\n\t\t\t\t\t\tmRobot = null;\n\t\t\t\t\t}", "private void removeGuess() {\n\t\tguessList[this.getLastPlayIndex()] = null;\n\t\tif (this.getLastPlayIndex() > 0)\n\t\t\tlastMoveID--;\n\t}", "public void removeFightsystem( Long fightsystemId )\r\n {\n\r\n }", "public void removeActor(Actor act) { ActorSet.removeElement(act); }", "public void removePlayer(String name) {\n\t\tcreateGameLobbyController.removePlayerFromList(name);\n\t}", "public void executeBot(){\n if(botSignal){\n if(bot != null){\n bot.execute();\n }\n }\n botSignal=false;\n }", "@Override\n\tpublic void unfollow(String username) throws Exception {\n\t\t\n\t}" ]
[ "0.60386765", "0.601302", "0.58126456", "0.57292116", "0.571181", "0.5692967", "0.54493976", "0.54415977", "0.5375141", "0.53221214", "0.5315133", "0.5255716", "0.5216033", "0.51543367", "0.51408005", "0.51398134", "0.5129534", "0.5120913", "0.50780666", "0.50341445", "0.5005107", "0.4967728", "0.49593922", "0.49514124", "0.4930335", "0.4918899", "0.48847756", "0.4874745", "0.48660406", "0.486345", "0.48547158", "0.4850071", "0.4846842", "0.48432386", "0.48414454", "0.48293346", "0.48179716", "0.48170826", "0.48114017", "0.47991285", "0.47949094", "0.47877944", "0.47853673", "0.4783759", "0.47779262", "0.4768666", "0.47522298", "0.47474045", "0.47418892", "0.47402304", "0.47368008", "0.473184", "0.47224694", "0.47191346", "0.47175795", "0.47140437", "0.4710917", "0.47103244", "0.47020057", "0.4689884", "0.46897337", "0.46817595", "0.4677083", "0.4675994", "0.46682298", "0.46662995", "0.4665887", "0.46653467", "0.46606", "0.46585968", "0.4658346", "0.46564823", "0.46530527", "0.46523073", "0.46491337", "0.4644634", "0.46424454", "0.46423605", "0.46415007", "0.46385264", "0.46230948", "0.46169478", "0.4613676", "0.46113297", "0.46103454", "0.46059737", "0.460255", "0.4602484", "0.45997983", "0.45985872", "0.45967585", "0.45954195", "0.45894268", "0.45867428", "0.45867386", "0.45859563", "0.45833278", "0.4579271", "0.4574534", "0.4574121" ]
0.6265092
0
Given the login name of a bot, removes it from the system.
String removeBot( String name, String msg ) { if( name == null ) return "had no name associated; no removal action taken"; ChildBot deadBot = m_botStable.remove( name ); if( deadBot != null ) { try { Session deadSesh = deadBot.getBot(); if( deadSesh != null ) { if( deadSesh.getBotAction() != null ) { deadSesh.getBotAction().cancelTasks(); } if( msg != null ) { if( !msg.equals("") ) { deadSesh.disconnect( msg ); } else { deadSesh.disconnect( "(empty DC message)" ); } } else { deadSesh.disconnect( "(null DC message)" ); } } // Decrement count for this type of bot addToBotCount( deadBot.getClassName(), (-1) ); deadBot = null; return "has disconnected normally"; } catch( NullPointerException e ) { Tools.printStackTrace(e); m_botAction.sendChatMessage( 1, name + " had a disconnection problem/was already DC'd (null pointer exception thrown)"); } } return "not found in bot stable (possibly already disconnected)"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void logout(){\n player.setName(\"(bot) \" + player.getName());\n botMode = true;\n System.out.println(\"bot made\");\n login = false;\n }", "String removeBot( String name ) {\n try {\n return removeBot( name, \"no longer running; removed from BotQueue stable\" );\n } catch ( NullPointerException e ) {\n return \"nullbot\";\n }\n }", "public void removeUser(String username);", "public void removeUser(String login) {\n try (PreparedStatement pst = this.conn.prepareStatement(\"DELETE FROM users WHERE login = ?\")) {\n pst.setString(1, login);\n pst.executeUpdate();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public void removeRobot(String name){\n robotNames.remove(name);\n measurementHandlers.remove(name);\n }", "void removeLogger(BotLogger logger);", "private void removePlayerFromLobby() {\n\n //Added Firebase functionality assuming var player is the player who wants to leave the game.\n }", "public static void signOut(String name, Session user) {\n playerList.remove(name);\n user.removeAttribute(\"player\");\n }", "String removeAccount(String userName);", "public void removePlayer(String name) {\n\t\tcreateGameLobbyController.removePlayerFromList(name);\n\t}", "public void removeUserFromChat(String otherUsername){\n String guiTitle = gui.getTitle();\n guiTitle = guiTitle.replace(\" \" + otherUsername + \" \", \"\");\n gui.setTitle(guiTitle);\n availableUsers.add(username);\n gui.addUserToDropDown(otherUsername);\n userStatuses.remove(otherUsername);\n refreshTypingStatuses(otherUsername);\n gui.addUserExitedMessage(otherUsername);\n }", "public void del(String nickname) {\r\n // loop through all users\r\n for (int i = this.UserList.size(); i > 0; i--) {\r\n // check if the user matches\r\n User user = (User) this.UserList.get(i - 1);\r\n if (user.nick().equalsIgnoreCase(nickname)) {\r\n this.UserList.remove(i - 1);\r\n }\r\n }\r\n }", "public void del(String name) {\n\t\tfor (AddrBean ad : addrlist) {\n\t\t\tif (name.equals(ad.getUsername())) {\n\t\t\t\taddrlist.remove(ad);\n\t\t\t}\n\t\t}\n\t}", "public void removeWorld(String name){\n worlds.remove(getWorld(name));\n }", "public void removePlayerFromCurrentLobby(LobbyPlayer player) {\n DocumentReference doc = Firebase.docRefFromPath(\"lobbies/\" + player.getLobbyCode());\n doc.update(FieldPath.of(\"players\", player.getUsername()), FieldValue.delete());\n removeListener();\n GameService.removeListener();\n cache = null;\n }", "public void handleCommand() {\n\t\tif (Client.isLoggedIn() == false)\n\t\t\treturn;\n\t\t\n\t\tClientUser user = Client.getUserByName(argument);\n\t\tif (user == Client.getThisUser()) {\n\t\t\tSystem.err.println(\"Trying to remove this user? This should never happen!\");\n\t\t}\n\t\tif (user != null) {\n\t\t\tClient.removeUser(user);\n\t\t\tClient.getMainWindow().getMainChatPanel().displayInfo(user.getName() + \" has logged off!\");\n\t\t} else {\n\t\t\tSystem.err.println(\"cquit used with a non-exisitng username!\");\n\t\t}\n\t}", "public void deleteUser(String name);", "@Override\n public void removePlayer(String nickname) throws IOException {\n try {\n String sql = \"DELETE FROM sep2database.player WHERE nickname =?;\";\n db.update(sql, nickname);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "void remove(long directoryId, String userName);", "public void removePlayer(String name) {\n\t\tfor(Player p : playerList) {\n\t\t\tif(p.getName().equals(name)) {\n\t\t\t\toccupiedPositions.remove(p.getPosition());\n\t\t\t\tif(p.getType() == Player.PlayerType.Agent) {\n\t\t\t\t\treAssignRobots(p);\n\t\t\t\t\tthis.agents -= 1;\n\t\t\t\t}\n\t\t\t\tplayerList.remove(p);\n\t\t\t}\n\t\t}\n\t\tserver.broadcastToClient(name, SendSetting.RemovePlayer, null, null);\n\t\tserver.updateGameplane();\n\t}", "private void remove(String name) {\n if (team.getPokemon(name) != null) {\n System.out.println(\"You are going to remove \" + name);\n System.out.println(\"This process is inrevertable, are you sure? [y/n]\");\n String command = input.next();\n if (command.equals(\"y\") || command.equals(\"yes\")) {\n team.remove(name);\n System.out.println(name + \" has been removed form your team\");\n System.out.println(\"You currently have \" + team.count() + \" pokemons in your team\");\n }\n } else {\n System.out.println(name + \" is not found within your team\");\n }\n }", "public void deleteUser(String room, String name) {\n ((GroupChatPanel)grouptabs.get(room)).deleteUser(name);\n \n }", "public void deleteUser(String login) {\n userRepository.findOneByLogin(login).ifPresent(user -> {\n userRepository.delete(user);\n log.debug(\"Deleted User: {}\", user);\n });\n }", "void deleteUser( String username );", "public void killPlayer() {\n \tdungeon.removeentity(getX(), getY(), name);\n \t\tdungeon.deleteentity(getX(),getY(),name);\n \t\t//System.out.println(\"YOU LOSE MAMA\");\n \t\t//System.exit(0);\n \t\t\n }", "public synchronized void removeUser(String username) {\n \n if(this.capacity > 0) {\n \n /* Rimuovo utente dalla HashMap */\n usersList.remove(username);\n \n /* Utente rimosso */\n capacity--;\n \n System.out.println(\"GOSSIP System: \"+username+\" removed from Proxy \"+\n id+\"@\"+address+\":\"+port+\" [Capacity: \"+max_capacity+\n \"][Available: \"+(max_capacity-capacity)+\"]\");\n }\n }", "public void removeGuestPlayerFromDB(String username) throws SQLException {\n PreparedStatement stm = T3DB.getConnection().prepareStatement(\n \"delete from GuestPlayer where displayname=?\");\n stm.setString(1, username);\n stm.executeUpdate();\n }", "public void run() {\n main.removeUser(location);\n }", "@Override\n public void removeGameApp(Handle<GameAppContext> that) \n {\n manager.removeGameApp(that);\n }", "public void deleteLogin(String user_id, String login_id) throws IOException {\n\t\t\n\t\tBasicDBObject document = new BasicDBObject();\n\t\tdocument.put(\"login_id\", login_id);\n\t\tcoll3.remove(document);\n\t\t\n\t\t\t\t\n\t}", "void remove(String installedAppId);", "void userRemoved(String username) throws IOException {\n\t\tfor (String repName : getRepositoryNames()) {\n\t\t\tgetRepository(repName).removeUser(username);\n\t\t}\n\t}", "public void dropUser(String userName) throws Exception;", "public void removeUser(String entity)\n\t{\n\t\tUser user = getUser(entity);\n\t\tif (user != null) {\n\t\t\tusersList.remove(user);\n\t\t\tusers.removeChild(user.userElement);\n\t\t}\n\t}", "public void removePlayer(String name) {\n\t\tUser user = users.get(userTurn);\n\t\tFootballPlayer player = market.findPlayer(name);\n\t\tdouble marketValue = player.getMarketValue();\n\t\t\n\t\tif (tmpTeam.size() > 0) {\n\t\t\tuser.updateBudget(marketValue, \"+\");\n\t\t\ttmpTeam.removePlayer(name);\n\t\t}\n\t\tSystem.out.println(\"budget after sell\" + user.getBudget());\n\t}", "public void removeByname(java.lang.String name)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "public void remove(Lobby lobby) {\n DocumentReference doc = Firebase.docRefFromPath(\"lobbies/\" + lobby.getGameCode());\n doc.delete();\n }", "void removeListener(BotListener l);", "public void remove(String name);", "public void removeUserFromRoom(String username)\r\n\t{\r\n\t\ttheGridView.removeCharacterFromRoom(username);\r\n\t}", "public void deleteUserCredentials(String login) throws SQLException;", "public void remove(final String name) {\r\n\t\tremove(names.indexOf(name));\r\n\t}", "void unFollow(User user);", "public void delete(String username);", "void remove(String name) throws Exception;", "public void remove(){\n Api.worldRemover(getWorld().getWorldFolder());\n }", "@Override\n\tpublic void eliminarUsuaris(String name) {\n\t\treposUsuarios.deleteById(name);\n\t}", "void remove(String name);", "void remove(String name);", "public void deleteUser(String username);", "@Override\n\tpublic void unfollow(String username) throws Exception {\n\t\t\n\t}", "public void removeUserFromSession(String token){\n\t\tfor(Session s: getSessionSet()){\n\t\t\tif(s.getToken().equals(token))\n\t\t\t\ts.delete();\t\t\t\t\t//Deletes user session.\n\t\t}\t\n\t}", "public void removeUser(String username) {\n userList.remove(username);\n }", "@SuppressWarnings(\"serial\")\n\tpublic void delUser(final String name) throws Exception{\n\t\tUserRegistry ur = UserRegistry.findOrCreate(doc);\n\t\tUsers users = Users.findOrCreate(ur);\n\t\tusers.deleteChildren(User.TAG,new HashMap<String,String>(){{\n\t\t\tput(\"name\",name);\n\t\t}});\n\t\tdelAllMember(name);\n\t}", "public void remove(String userName) {\n LOG.info(\"Removed \" + userName + \" from the database at \" + System.nanoTime());\n }", "private void removeAccount(ProtocolProviderService protocolProvider)\n {\n Component c = (Component) this.accountSelectors\n .get(protocolProvider.getAccountID());\n \n this.remove(c);\n }", "private void logOut() {\n mApi.getSession().unlink();\n\n // Clear our stored keys\n clearKeys();\n // Change UI state to display logged out version\n setLoggedIn(false);\n }", "boolean removePlayer(String player);", "public void unsetFriendlyName()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(FRIENDLYNAME$2, 0);\r\n }\r\n }", "void shutdownAllBots() {\n LinkedList<String> names = new LinkedList<String>();\n\n for( ChildBot c : m_botStable.values() ) {\n if( c != null ) {\n names.add( c.getBot().getBotName() );\n }\n }\n\n for( String name : names ) {\n removeBot( name, \"core shutdown\" );\n m_botAction.sendChatMessage( 1, name + \" logged off. (Core shutdown.)\" );\n }\n\n m_botTypes.clear();\n }", "public static void deleteLogin(Context context) {\n SharedPreferences.Editor editor = context.getSharedPreferences(Utils.SHARED_PREFERENCES_FILE, Context.MODE_PRIVATE).edit();\n editor.putBoolean(LOGIN_SAVED_KEY, false);\n editor.apply();\n loggedIn = false;\n }", "public void removeServiceEntry(String linkName);", "static synchronized void RemoveUser(ClientHandler user)\r\n {\r\n users.remove(user);\r\n if(users.size() == 0)\r\n {\r\n try {\r\n chatLogWriter.close();\r\n chatLog.delete();\r\n System.out.println(\"!!! Waiting for the next connection... !!!\\n\\n\");\r\n } catch (Exception e)\r\n {\r\n System.out.println(\"Unable to close file!\");\r\n System.exit(1);\r\n }\r\n }\r\n }", "void remove(String identifier) throws GuacamoleException;", "public BrewFindResponse deleteUserFromToken(BrewFindToken tok) {\n\t\tif(!checkToken(tok)) {\n\t\t\treturn new BrewFindResponse(5, \"Invalid token, authorization failed\");\n\t\t}\n\t\t\t\t\n\t\tString uname = Base64.decodeAsString(tok.token);\n\t\t\t\t\n\t\t// Check if user is in db\n\t\tUser u = findUser(uname);\n\t\tif(u == null) {\n\t\t\treturn new BrewFindResponse(2, \"User \" + uname + \" doesn't exist in our system\");\n\t\t}\n\t\t\t\t\n\t\t// Else, remove information from user db\n\t\tdeleteUser(u);\n\t\t\t\t\n\t\t// TODO: Implement un-setting a brewery's user if the user is associated with a brewery\n\t\treturn new BrewFindResponse(0, \"OK\");\n\t}", "boolean unregister(String name);", "public void deleteAccount(String userName) {\n\n }", "@Override\n public void handle(Session session, Player player, LogoutMessage message) {\n player.setLoggedIn(false);\n World.getInstance().unregisterPlayer(player);\n Server.getInstance().unregisterSession(session);\n session.close();\n }", "void removeFromGame() {\n\t\t// remove from game\n\t\t//only for multi-player\n\t}", "protected void removeAccess(final String name) {\n if (!this.hasAccess(name, true)) return;\r\n \r\n // Find line with matching name.\r\n org.bukkit.block.Sign state = this.getSignBlock();\r\n Integer removeFrom = null;\r\n if (state.getLine(2) != null && state.getLine(2).equalsIgnoreCase(name)) removeFrom = 2;\r\n else if (state.getLine(3) != null && state.getLine(3).equalsIgnoreCase(name)) removeFrom = 3;\r\n \r\n if (removeFrom == null) return; \r\n \r\n state.setLine(removeFrom, \"\");\r\n }", "Boolean remover(String userName, Long idProducto);", "@Override\r\n\tpublic void userLogout(String login) {\n\r\n\t}", "public void removeConnection(ClientHandler clientHandler){\n String nick=clientToNames.get(clientHandler);\n System.out.println(\"Removing player \"+nick+\" from the lobby number \" + lobbyID);\n namesToClient.remove(nick, clientHandler);\n nicknames.remove(nick);\n clientToNames.remove(clientHandler, nick);\n playersNumber--;\n }", "void unsetName();", "private native void removeCallback(String name)\n /*-{\n var target = $wnd;\n var parts = name.split('.');\n \n for(var i = 0; i < parts.length - 1; i++) {\n var part = parts[i];\n if (target[part] === undefined) {\n $wnd.console.log(part,'not defined in',target);\n // No longer attached -> nothing more to do\n return;\n }\n target = target[part];\n }\n\n $wnd.console.log('removing',parts[parts.length - 1],'from',target);\n delete target[parts[parts.length - 1]];\n }-*/;", "void hardRemoveAllBotsOfType( String className, String initiator ) {\n String rawClassName = className.toLowerCase();\n Integer numBots = m_botTypes.get( rawClassName );\n LinkedList<String> names = new LinkedList<String>();\n\n for( ChildBot c : m_botStable.values() )\n if( c != null ) {\n if(c.getClassName().equals( rawClassName ))\n names.add( c.getBot().getBotName() );\n }\n\n for( String name : names ) {\n removeBot( name, \"!removetype by \" + initiator );\n m_botAction.sendChatMessage( 1, name + \" logged off. (!removetype initiated.)\" );\n }\n\n if( numBots != null && numBots.intValue() != 0 )\n m_botTypes.put( rawClassName, new Integer(0) );\n }", "public void removePlayer(String p) {\n this.playersNames.remove(p);\n }", "public void DELETE(String name){\r\n\r\n try {\r\n out.println(\"DELE \" + name);\r\n out.flush();\r\n System.out.println(in.readLine());\r\n } catch (Exception e) {\r\n System.out.println(e);\r\n }\r\n\r\n }", "void removePushApplication(LoggedInUser account, PushApplication pushApp);", "public static void removeUsername(final String username)\n\t{\n\t\tif (username2accesses.containsKey(username)) username2accesses.remove(username);\n\t}", "public void Logout(){\n preferences.edit().remove(userRef).apply();\n }", "public void clearLoginInfo(){\n ProfileSharedPreferencesRepository.getInstance(application).clearLoginInfo();\n }", "public void removeMaid(String maidName){\n //remove maid from registry\n mMaidRegistry.remove(maidName);\n }", "private void logout()\r\n {\r\n LogoutRequest request = new LogoutRequest();\r\n request.setUsername(username);\r\n this.sendRequest(request);\r\n }", "private void removeTeam(String teamName) {\n getTeam(teamName).unregister();\n }", "public void removeUsuarioLogin(Usuario usuario) {\r\n\t\tlistaDeUsuarios.remove(usuario);\r\n\t}", "UserGroup removeMember(String companyId, String name, String memberEmail);", "private void eliminatePlayer(Player loser){\n players.remove(loser);\n }", "public boolean removeLogin(final String username) {\r\n\t\tfinal Login login = this.getLogin(username);\r\n\t\treturn this.removeFromDB(login);\r\n\r\n\t}", "public abstract void revokeMembership(String nickname);", "private static void removeTalker(User talker, AppCompatActivity activity) {\n mRefUsersTalk\n .child(mAuth.getCurrentUser().getUid())\n .child(talker.getId())\n .removeValue()\n .addOnSuccessListener(aVoid -> {\n\n //REMOVES CURRENT USER TO TALKER NODE\n mRefUsersTalk\n .child(talker.getId())\n .child(mAuth.getCurrentUser().getUid())\n .removeValue()\n .addOnSuccessListener(aVoid1 -> {\n showProgressDialog(false);\n Toast.makeText(activity.getApplicationContext(), \"Usuário removido com sucesso!\", Toast.LENGTH_SHORT)\n .show();\n\n backToMainActivity(activity);\n })\n .addOnFailureListener(Throwable::getLocalizedMessage);\n })\n .addOnFailureListener(Throwable::getLocalizedMessage);\n\n }", "private static void deleteFootballClub(){\n Scanner scanner = new Scanner(System.in);\n System.out.print(\"Please enter Club Name: \");\n String clubName = scanner.nextLine();\n leagueManager.deleteFootballClub(clubName);\n }", "public void removeCurrentUser() {\n currentUser.logout();\n currentUser = null;\n indicateUserLoginStatusChanged();\n }", "private static void removeFriend(Scanner scanner) {\n System.out.println(\"Type in the full name [firstname lastname] of the friend you wish to remove: \");\n String name = scanner.nextLine().toLowerCase();\n\n String[] names = name.split(\" \");\n String fistname = names[0];\n String lastname = names[1];\n\n if (fistname == null || lastname == null) {\n removeFriend(scanner);\n System.out.println(\"Name is not valid, please try again.\");\n }\n\n FriendNode topNode = FriendList.head;\n Friend friend = null;\n\n while (topNode != null) {\n if (topNode.friend.firstName.toLowerCase().equals(fistname) && topNode.friend.lastName.toLowerCase().equals(lastname)) {\n friend = topNode.friend;\n break;\n }\n topNode = topNode.next;\n }\n\n if (friend != null) {\n friendList.deleteFriend(friend);\n System.out.println(\"Friend: \" + friend.firstName + \" \" + friend.lastName + \" was removed from your friend list.\");\n } else {\n System.out.println(\"Could not find any friend with that name.\");\n }\n\n runApplication(scanner);\n }", "public void onClick(DialogInterface dialog, int which) {\n String username = unm.getText().toString();\r\n\r\n deleteUser(username);\r\n }", "public void removePlayer(Player plr){\r\n\t\t\r\n\t\tlobby.removePlayerFromLobby(plr);\r\n\t\tlobby.updateNames();\r\n\t\tsendNameInfoToAll();\r\n\t\tremoveConnection(plr);\r\n\t}", "public void otherUserLoggedOut(String otherUsername){\n gui.removeUserFromDropDown(otherUsername);\n \n DefaultTableModel otherUserStatus = (DefaultTableModel) gui.getOtherUserStatus().getModel();\n String tStatus = userStatuses.get(otherUsername);\n \n for (int row = 0; row < otherUserStatus.getRowCount(); row++){\n String userstatus = otherUserStatus.getValueAt(row, 0).toString();\n if (userstatus.contains(otherUsername + \": \")){\n if (tStatus == null){\n otherUserStatus.removeRow(row);\n }\n return;\n }\n }\n\n userStatuses.remove(otherUsername);\n gui.addUserLoggedOutMessage(otherUsername);\n }", "public void removePlayer(Nimsys nimSys,ArrayList<Player> list,Scanner keyboard) {\r\n\t\tboolean flag = false;\r\n\t\tIterator<Player> aa = list.iterator();\r\n\t\t\r\n\t\tif(nimSys.commands.length==1){\r\n\t\t\tSystem.out.println(\"Are you sure you want to remove all players? (y/n)\");\r\n\t\t\tString next = keyboard.next();\r\n\t\t\tkeyboard.nextLine();\r\n\t\t\tif(next.equals(\"y\"))\r\n\t\t\t\tlist.clear();\t\r\n\t\t}\r\n\t\t\t\r\n\t\telse{\r\n\t\t\twhile (aa.hasNext()) {\r\n\t\t\t\tPlayer in = aa.next();\r\n\t\t\t\tif(in.getUserName().equals(nimSys.commands[1])){\r\n\t\t\t\t\tlist.remove(in);\r\n\t\t\t\t\tflag = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(flag == false)\r\n\t\t\t\tSystem.out.println(\"The player does not exist.\");\r\n\t\t}\r\n\t\t\r\n\t}", "public static void removeFromList(FormModel form, HttpSession session, HttpServletRequest req, HttpServletResponse res, Connection con, PrintWriter out)\r\n throws IOException\r\n {\n String name_to_remove = req.getParameter(Member.REQ_USER_NAME);\r\n\r\n if (name_to_remove != null && !(name_to_remove.equals(\"\")))\r\n {\r\n\r\n //get the table from the form and add the name in the list\r\n RowModel row = form.getRow(DistributionList.LIST_OF_NAMES);\r\n TableModel names = (TableModel)(((Cell)row.get(0)).getContent());\r\n\r\n names.remove(name_to_remove);\r\n\r\n ActionModel model = names.getContextActions();\r\n Action searchAction = (Action)(model.get(0));\r\n if (names.size()<DistributionList.getMaxListSize(session))\r\n {\r\n searchAction.setSelected(false);\r\n }\r\n else\r\n {\r\n searchAction.setSelected(true);\r\n }\r\n }\r\n\r\n\r\n }", "public void AllianceRemoved(Alliance alliance)\n {\n for(LaunchServerSession session : Sessions.values())\n {\n if(session.CanReceiveUpdates())\n {\n session.RemoveAlliance(alliance);\n }\n }\n }" ]
[ "0.6842523", "0.6809979", "0.6189975", "0.60779524", "0.6049902", "0.60280037", "0.60093427", "0.59961104", "0.595608", "0.58985853", "0.5871943", "0.5827961", "0.5796051", "0.57878107", "0.5731672", "0.57255673", "0.57191086", "0.57152367", "0.5709245", "0.5700412", "0.5698444", "0.56938976", "0.5691283", "0.56609994", "0.56589085", "0.56367564", "0.5634541", "0.5633683", "0.5630167", "0.5614545", "0.56113154", "0.56047595", "0.56016135", "0.5598188", "0.5590494", "0.558919", "0.55864906", "0.5577329", "0.5560025", "0.55552477", "0.55541575", "0.5545221", "0.55451477", "0.55326635", "0.55286926", "0.55281293", "0.5493894", "0.5473603", "0.5473603", "0.54677725", "0.54562414", "0.5454691", "0.54539984", "0.5433462", "0.54284346", "0.54084504", "0.5407361", "0.5404493", "0.54017985", "0.53981036", "0.53879315", "0.5377466", "0.5374091", "0.53730655", "0.5365923", "0.5361839", "0.53586334", "0.5357215", "0.5347351", "0.5343444", "0.5337678", "0.5329796", "0.5329512", "0.5326855", "0.5323322", "0.53218156", "0.53100103", "0.53069663", "0.53046083", "0.5303058", "0.5301923", "0.5299327", "0.52992725", "0.5299228", "0.52947134", "0.52938855", "0.52926594", "0.5292564", "0.52897024", "0.528634", "0.52832943", "0.527509", "0.52716166", "0.526672", "0.5258667", "0.5258533", "0.5257147", "0.5256384", "0.5247232", "0.5243617" ]
0.647409
2
Removes all bots of a given type. For debug purposes, or the impatient.
void hardRemoveAllBotsOfType( String className, String initiator ) { String rawClassName = className.toLowerCase(); Integer numBots = m_botTypes.get( rawClassName ); LinkedList<String> names = new LinkedList<String>(); for( ChildBot c : m_botStable.values() ) if( c != null ) { if(c.getClassName().equals( rawClassName )) names.add( c.getBot().getBotName() ); } for( String name : names ) { removeBot( name, "!removetype by " + initiator ); m_botAction.sendChatMessage( 1, name + " logged off. (!removetype initiated.)" ); } if( numBots != null && numBots.intValue() != 0 ) m_botTypes.put( rawClassName, new Integer(0) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void shutdownAllBots() {\n LinkedList<String> names = new LinkedList<String>();\n\n for( ChildBot c : m_botStable.values() ) {\n if( c != null ) {\n names.add( c.getBot().getBotName() );\n }\n }\n\n for( String name : names ) {\n removeBot( name, \"core shutdown\" );\n m_botAction.sendChatMessage( 1, name + \" logged off. (Core shutdown.)\" );\n }\n\n m_botTypes.clear();\n }", "public void removeRobotsAndRubble() {\n\t\tfor(Player p : playerList) {\n\t\t\tif(p.getType() != PlayerType.Agent) {\n\t\t\t\tremovePosition(p.getPosition());\n\t\t\t\tremovePlayer(p.getName());\n\t\t\t}\n\t\t\telse \n\t\t\t\tp.resetRobotsFollowing();\n\t\t}\n\t}", "public void cleanToAll() {\n\t\tfor(ClientThread player: players) {\n\t\t\tplayer.send(new Package(\"CLEAN\",null));\n\t\t}\n\t}", "public void removeByType(long typeId);", "public void clear_type(String type) {\n\t\t/* Iterate through draw list */\n\t\tIterator<ArrayList<Drawable>> iter = this.drawlist.iterator();\n\t\twhile(iter.hasNext()) {\n\t\t\tArrayList<Drawable> layer = iter.next();\n\t\t\t/* Iterate through the layer. */\n\t\t\tIterator<Drawable> jter = layer.iterator();\n\t\t\twhile(jter.hasNext()) {\n\t\t\t\tif(jter.next().getType().equals(type)) {\n\t\t\t\t\tjter.remove();\n\t\t\t\t}//fi\n\t\t\t}//elihw\n\t\t}//elihw\n\t}", "public void cleanStatuses(){\n\n System.out.println(\"cleaning battle statuses: \");\n // for(MovingEntity enemy: enemies){\n for(MovingEntity enemy: battleEnemies){\n for (Status enemyStatus: enemy.getStatusList()) {\n if (enemyStatus != null) enemyStatus.endStatus(enemy);\n }\n }\n\n //for(MovingEntity friendly: friendlies){\n for(MovingEntity friendly: battleAllies){\n System.out.println(\"cleaning battle statuses for: \" + friendly.getID());\n System.out.println(friendly.getStatusIDs().toString());\n if (friendly.getStatusIDs().contains(\"Tranced\")) {\n // kill off tranced entities\n friendly.setCurrHP(0);\n }\n for (Status friendlyStatus: friendly.getStatusList()) {\n System.out.println(\"status was: \" + friendlyStatus.getID());\n if (friendlyStatus != null) friendlyStatus.endStatus(friendly);\n }\n }\n\n }", "public void removeAllListeners(String type) {\n APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + \".removeAllListeners(%s);\", wrapQuotes(type)));\n }", "public static void clearGameType() {\r\n\t\tMain.isThreeHanded = false;\r\n\t\tMain.isFourHandedSingle = false;\r\n\t\tMain.isFourHandedTeams = false;\r\n\t}", "public void removeAll()\r\n {\r\n if (level ==2)\r\n {\r\n removeObjects(getObjects(Platforms.class));\r\n removeObjects(getObjects(Ladder.class));\r\n removeObjects(getObjects(SmallPlatform.class));\r\n removeObjects(getObjects(Door.class)); \r\n removeObjects(getObjects(Tomato.class)); \r\n removeObjects(getObjects(Bullet.class));\r\n removeObjects(getObjects(DeadTomato.class));\r\n player.setLocation();\r\n }\r\n if (level == 3)\r\n {\r\n removeObjects(getObjects(Tomato.class));\r\n removeObject(door2);\r\n removeObjects(getObjects(Canon.class));\r\n removeObjects(getObjects(CanonBullet.class));\r\n removeObjects(getObjects(Bullet.class));\r\n removeObjects(getObjects(Pedestal.class));\r\n removeObjects(getObjects(Platforms.class));\r\n removeObjects(getObjects(DeadTomato.class));\r\n }\r\n if (level == 4)\r\n {\r\n removeObjects(getObjects(Platforms.class));\r\n removeObjects(getObjects(Text.class));\r\n removeObjects(getObjects(Bullet.class));\r\n removeObjects(getObjects(Ladder.class));\r\n removeObjects(getObjects(Door.class)); \r\n removeObjects(getObjects(Boss.class)); \r\n removeObjects(getObjects(Thorns.class));\r\n player.setLocation();\r\n }\r\n }", "public void setClearCards(String type) {\r\n int currentSize = getGiftCardList().size();\r\n \r\n setGiftCardList(new ArrayList());\r\n for (int i = 0; i < currentSize; i++) {\r\n addBlankGiftCard(getGiftCardList());\r\n }\r\n \r\n setGiftCardTempList(new ArrayList());\r\n for (int i = 0; i < getMaxNumGiftCards(); i++) {\r\n addBlankGiftCard(getGiftCardTempList());\r\n }\r\n }", "boolean shutdownIdleBots() {\n boolean allBotsIdle = true;\n LinkedList<String> names = new LinkedList<String>();\n\n for( ChildBot c : m_botStable.values() ) {\n if( c != null ) {\n if( c.getBot().getSubspaceBot().isIdle() )\n names.add( c.getBot().getBotName() );\n else\n allBotsIdle = false;\n }\n }\n\n for( String name : names ) {\n removeBot( name, \"idle bot shutdown\" );\n m_botAction.sendChatMessage( 1, name + \" logged off. (Idle bot shutdown.)\" );\n }\n\n return allBotsIdle;\n }", "public Builder clearType() {\n bitField0_ = (bitField0_ & ~0x00000001);\n type_ = messages.Basemessage.BaseMessage.Type.SERVERHELLO;\n onChanged();\n return this;\n }", "public void clear() {\n for (int i = 0; i < if_you_items.length; i++) {\n if_you_items[i].setEnabled(true);\n }\n for (int i = 0; i < then_we_items.length; i++) {\n then_we_items[i].setEnabled(true);\n }\n non_promised_ministries.clear();\n non_promised_ministries.addAll(all_ministries);\n // if not at war, can't ask/offer peace\n if (game.getDiplomacy().getDiplomaticState(game.getTurn(), faction) != C.DS_WAR) {\n if_you_items[IfYouWill.PEACE.ordinal()].setEnabled(false);\n then_we_items[ThenWeWill.PEACE.ordinal()].setEnabled(false);\n }\n if (faction > C.HOUSE5) { // non-house\n non_promised_ministries.clear();\n if_you_items[IfYouWill.TECH.ordinal()].setEnabled(false);\n then_we_items[ThenWeWill.TECH.ordinal()].setEnabled(false);\n if_you_items[IfYouWill.VOTES.ordinal()].setEnabled(false);\n then_we_items[ThenWeWill.VOTES.ordinal()].setEnabled(false);\n return;\n }\n // search for promised votes and ministries in pending contracts of sender\n for (Contract con : game.getDiplomacy().getSentContracts()) {\n for (Term term : con.getTerms()) {\n if (term.getDonor() == game.getTurn()) {\n switch (term.getType()) {\n case VOTES:\n System.out.println(\"DBG no votes\");\n then_we_items[ThenWeWill.VOTES.ordinal()].setEnabled(false);\n break;\n case MINISTRY:\n non_promised_ministries.remove(new Integer(term.getAmount()));\n break;\n case MONEY:\n break;\n case STATE:\n break;\n case TECH:\n break;\n default:\n throw new AssertionError();\n }\n }\n if (term.getDonor() == faction) {\n switch (term.getType()) {\n case VOTES:\n System.out.println(\"DBG no votes\");\n if_you_items[IfYouWill.VOTES.ordinal()].setEnabled(false);\n break;\n case MINISTRY:\n non_promised_ministries.remove(new Integer(term.getAmount()));\n break;\n case MONEY:\n break;\n case STATE:\n break;\n case TECH:\n break;\n default:\n throw new AssertionError();\n }\n }\n }\n }\n // search for promised votes and ministries for sender and for receiver\n // those that are made with sender\n if (game.getRegency().getVotes()[game.getTurn()][Regency.CANDIDATE_IDX] > -1\n || game.getRegency().getVotes()[faction][Regency.CANDIDATE_IDX] == game.getTurn()) {\n then_we_items[ThenWeWill.VOTES.ordinal()].setEnabled(false);\n if_you_items[IfYouWill.VOTES.ordinal()].setEnabled(false);\n }\n int[] promises = game.getDiplomacy().getMinistryPromises(game.getTurn());\n for (int i = 0; i < promises.length; i++) {\n if (promises[i] > -1) {\n non_promised_ministries.remove(new Integer(promises[i]));\n }\n }\n promises = game.getDiplomacy().getMinistryPromises(faction);\n for (int i = 0; i < promises.length; i++) {\n if (promises[i] == game.getTurn()) {\n non_promised_ministries.remove(new Integer(promises[i]));\n }\n }\n if (non_promised_ministries.isEmpty()) {\n then_we_items[ThenWeWill.MINISTRY.ordinal()].setEnabled(false);\n if_you_items[IfYouWill.MINISTRY.ordinal()].setEnabled(false);\n }\n }", "public void removeIngredient(String type) {\n\t\tMyStack newBurger = new MyStack();\n\t\twhile (myBurger.size() != 0) {\n\t\t\tif (myBurger.peek().equals(type)) {\n\t\t\t\tmyBurger.pop();\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tString ingredient = (String) myBurger.pop();\n\t\t\t\tnewBurger.push(ingredient);\n\t\t\t}\n\t\t}\n\t\twhile (newBurger.size() != 0) {\n\t\t\tString ingredient = (String) newBurger.pop();\n\t\t\tmyBurger.push(ingredient);\n\t\t}\n\t\tif (type.equals(\"Beef\") || type.equals(\"Chicken\") || type.equals(\"Veggie\")) {\n\t\t\tpattyCount--;\n\t\t}\n\t}", "void listBots( String className, String messager ) {\n Iterator<ChildBot> i;\n ChildBot bot;\n String rawClassName = className.toLowerCase();\n\n if( rawClassName.compareTo( \"hubbot\" ) == 0 ) {\n m_botAction.sendSmartPrivateMessage( messager, \"There is only one true master, and that is me.\" );\n } else if( getNumberOfBots( className ) == 0 ) {\n m_botAction.sendSmartPrivateMessage( messager, \"No bots of that type.\" );\n } else {\n m_botAction.sendSmartPrivateMessage( messager, className + \":\" );\n\n for( i = m_botStable.values().iterator(); i.hasNext(); ) {\n bot = i.next();\n\n if( bot != null )\n if( bot.getClassName().compareTo( className ) == 0 )\n m_botAction.sendSmartPrivateMessage( messager, bot.getBot().getBotName() + \" (in \" + bot.getBot().getBotAction().getArenaName() + \"), created by \" + bot.getCreator());\n }\n\n m_botAction.sendSmartPrivateMessage( messager, \"End of list\" );\n }\n }", "public static void clearAllTileTypes(){\n\t\tTileType.allTileTypes.clear();\n\t}", "void unsetType();", "public static void clearWinners(){winners.clear();}", "@Override\n\tpublic void removeAll() throws SystemException {\n\t\tfor (ESFInstructsShootingDirector esfInstructsShootingDirector : findAll()) {\n\t\t\tremove(esfInstructsShootingDirector);\n\t\t}\n\t}", "public <T extends IDBEntities> void clearEntities(List<Class<? extends IDBEntities>> types) {\n\t\tif (types == null)\n\t\t\treturn;\n\t\tEntityManager em = getEM();\n\t\ttry {\n\t\t\tem.getTransaction().begin();\n\t\t\tfor (Class<? extends IDBEntities> type : types) {\n\t\t\t\tem.createQuery(\"DELETE FROM \" + type.getSimpleName()).executeUpdate();\n\t\t\t}\n\t\t\tem.getTransaction().commit();\n\t\t} catch (Exception ex) {\n\t\t\tem.getTransaction().rollback();\n\t\t} finally {\n\t\t\tem.close();\n\t\t}\n\t}", "public static void removeAll() {\r\n\t\tfor (final Block block : new HashSet<>(instances_.keySet())) {\r\n\t\t\trevertBlock(block, Material.AIR);\r\n\t\t}\r\n\t\tfor (final TempBlock tempblock : REVERT_QUEUE) {\r\n\t\t\ttempblock.state.update(true, applyPhysics(tempblock.state.getType()));\r\n\t\t\tif (tempblock.revertTask != null) {\r\n\t\t\t\ttempblock.revertTask.run();\r\n\t\t\t}\r\n\t\t}\r\n\t\tREVERT_QUEUE.clear();\r\n\t}", "public void deshabilitarBotones()\n\t{\n\t\tbotonPlay.setClickable(false);\n\t\tbotonPause.setClickable(false);\n\t\tbotonPonerRingtone.setClickable(false);\n\t\tbotonDescargar.setClickable(false);\n\t}", "public final void stopAll() {\n for (BotTaskInterface bt : TASKS) {\n LOG.info(\"Stoping BotTask {}\", bt.getName());\n bt.stop();\n }\n EXECUTOR_SERVICE.shutdown();\n }", "public static void kill() {\n Iterator<Recipe> recipes = tj.getServer().recipeIterator();\r\n Recipe recipe;\r\n\r\n while (recipes.hasNext()) {\r\n recipe = recipes.next();\r\n\r\n if (recipe != null && customItems.containsValue(recipe.getResult()))\r\n recipes.remove();\r\n }\r\n\r\n tj = null;\r\n messages = null;\r\n playerDataFolder = null;\r\n players = null;\r\n customItems = null;\r\n }", "public void killRobot(int robotType) {\r\n\t\trobots.get(robotType).setDead();\r\n\t\t++this.robotsDestroyed;\r\n\t}", "public void killRobot(String robotType) {\r\n\t\tif (robotType.toLowerCase().equals(\"scout\")) {\r\n\t\t\tkillRobot(0);\r\n\t\t} else if (robotType.toLowerCase().equals(\"sniper\")) {\r\n\t\t\tkillRobot(1);\r\n\t\t} else if (robotType.toLowerCase().equals(\"tank\")) {\r\n\t\t\tkillRobot(2);\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"Invalid/unknown robot type.\");\r\n\t\t}\r\n\t}", "private void removeRobot(Actor r) {\n\t\tfor (int i = 0; i < attackRobots.size(); i++) {\n\t\t\tif (attackRobots.get(i).equals(r)) {\n\t\t\t\tattackRobots.remove(i);\n\t\t\t\tcheckLost();\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < supportRobots.size(); i++) {\n\t\t\tif (supportRobots.get(i).equals(r))\n\t\t\t\tsupportRobots.remove(i);\n\t\t}\n\t}", "public CardCollection destroyCardType(String type) ;", "private void logout(){\n player.setName(\"(bot) \" + player.getName());\n botMode = true;\n System.out.println(\"bot made\");\n login = false;\n }", "void listBotTypes( String messager ) {\n Iterator<String> i;\n Integer number;\n String className;\n\n m_botAction.sendSmartPrivateMessage( messager, \"Listing bot types:\" );\n\n for( i = m_botTypes.keySet().iterator(); i.hasNext(); ) {\n className = i.next();\n number = m_botTypes.get( className );\n\n if( number.intValue() > 0 )\n m_botAction.sendSmartPrivateMessage( messager, className + \": \" + number );\n }\n\n m_botAction.sendSmartPrivateMessage( messager, \"End of list\" );\n }", "@Override\n public void removeByBrokerIdAndType(long brokerId, String type)\n throws SystemException {\n for (BrokerMessageListener brokerMessageListener : findByBrokerIdAndType(\n brokerId, type, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {\n remove(brokerMessageListener);\n }\n }", "public void removeEvents(){\n for(Entry<Class, List<EventTrigger>> eventGroup: HandlerRegistry.getHandlers().entrySet()){\n String annotation = eventGroup.getKey().getName();\n List<EventTrigger> eventTriggers = new ArrayList<EventTrigger>(eventGroup.getValue());\n for(EventTrigger trigger : eventTriggers){\n if(trigger.getServer()==this) { // do not send own events...\n ESRemoveEvent esre = new ESRemoveEvent(annotation, trigger.getTrigger());\n for(EventShare es : EventShare.getEventShareServers()){\n if(es!=this) {\n if (es.isShareOut()) {\n try {\n es.getEventBusServer().write(esre);\n }catch (Exception e){\n e.printStackTrace();\n }\n }\n }\n }\n HandlerRegistry.getHandlers().get(eventGroup.getKey()).remove(trigger);\n System.out.println(HandlerRegistry.getHandlers());\n }\n }\n }\n }", "String removeBot( String name ) {\n try {\n return removeBot( name, \"no longer running; removed from BotQueue stable\" );\n } catch ( NullPointerException e ) {\n return \"nullbot\";\n }\n }", "public void clearMotors() {\n\t\tmotors.clear();\n\t}", "public void discard(Type type) {\n \t\tType choice = type;\n \n \t\t// pick random type if none is specified\n \t\tif (choice == null) {\n \t\t\twhile (true) {\n \t\t\t\tint pick = (int) (Math.random() * Hexagon.TYPES.length);\n \t\t\t\tif (resources[pick] > 0) {\n \t\t\t\t\tchoice = Hexagon.TYPES[pick];\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n \t\tuseResources(choice, 1);\n \n \t\tint res = Hexagon.getTypeStringResource(choice);\n \t\tappendAction(R.string.player_discarded, res);\n \t}", "void removeLogger(BotLogger logger);", "public void clearEnemies() {\n\t\tIterator<Entity> it = entities.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tEntity e = it.next();\n\t\t\t//Skip playerfish\n\t\t\tif (e instanceof PlayerFish) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t//Kill and remove the entity\n\t\t\te.kill();\n\t\t\tit.remove();\n\t\t}\n\t\t\n\t\t//Remove all non playerfish from collidables\n\t\tcollidables.removeIf(c -> !(c instanceof PlayerFish));\n\t\tdrawables.removeIf(c -> !(c instanceof PlayerFish));\n\t}", "public Builder clearType() {\n\n type_ = 0;\n onChanged();\n return this;\n }", "public void removeAgents() {\n\t\tfor (TestLiveAgent agent : agents.values()) {\n\t\t\tagent.stop();\n\t\t}\n\t\tagents.clear();\n\t}", "public void removeCategory(String type) {\n\t\tif (type.equals(\"Sauces\")) {\n\t\t\tthis.removeIngredient(\"Ketchup\");\n\t\t\tthis.removeIngredient(\"Mustard\");\n\t\t\tthis.removeIngredient(\"Mayonnaise\");\n\t\t\tthis.removeIngredient(\"Baron-Sauce\");\n\t\t} else if (type.equals(\"Cheese\")) {\n\t\t\tthis.removeIngredient(\"Cheddar\");\n\t\t\tthis.removeIngredient(\"Mozzarella\");\n\t\t\tthis.removeIngredient(\"Pepperjack\");\n\t\t} else if (type.equals(\"Veggies\")) {\n\t\t\tthis.removeIngredient(\"Lettuce\");\n\t\t\tthis.removeIngredient(\"Tomato\");\n\t\t\tthis.removeIngredient(\"Onions\");\n\t\t\tthis.removeIngredient(\"Pickle\");\n\t\t\tthis.removeIngredient(\"Mushrooms\");\n\t\t}\n\t}", "public Builder clearType() {\n\n type_ = 0;\n onChanged();\n return this;\n }", "public Builder clearType() {\n\n type_ = 0;\n onChanged();\n return this;\n }", "public Builder clearType() {\n\n type_ = 0;\n onChanged();\n return this;\n }", "public static void disconnectAll(ServerInfo info) {\n for (ProxiedPlayer player : info.getPlayers()) {\n player.disconnect(\"The server is currently unavailable, please try again soon!\");\n }\n }", "protected void stopAll() {\n\t\tif (this.udpServer!=null)\n\t\t\tthis.udpServer.interrupt();\n\t\tif (this.connectionServer!=null)\n\t\t\tthis.connectionServer.interrupt();\n\t\tthis.connectionServer=null; // supprime le TCPServer et les Sockets associés\n\t\tthis.udpServer=null; // supprime l'UDPServer et les Sockets associés\n\t\tif (this.agent.getUserStatusManager()!=null)\n\t\t\tfor (String u : this.agent.getUserStatusManager().getActiveUsers())\n\t\t\t\tthis.removeSocket(u);; // interrompt tous les UserSockets\n\t\tthis.mapSockets.clear();\n\t}", "private void DropEverything() throws isisicatclient.IcatException_Exception {\n List<Object> allGroupsResults = port.search(sessionId, \"Grouping\");\r\n List tempGroups = allGroupsResults;\r\n List<EntityBaseBean> allGroups = (List<EntityBaseBean>) tempGroups;\r\n port.deleteMany(sessionId, allGroups);\r\n\r\n //Drop all rules\r\n List<Object> allRulesResults = port.search(sessionId, \"Rule\");\r\n List tempRules = allRulesResults;\r\n List<EntityBaseBean> allRules = (List<EntityBaseBean>) tempRules;\r\n port.deleteMany(sessionId, allRules);\r\n\r\n //Drop all public steps\r\n List<Object> allPublicStepResults = port.search(sessionId, \"PublicStep\");\r\n List tempPublicSteps = allPublicStepResults;\r\n List<EntityBaseBean> allPublicSteps = (List<EntityBaseBean>) tempPublicSteps;\r\n port.deleteMany(sessionId, allPublicSteps);\r\n }", "public final void removeAllCompositeTypes()\n {\n listModel.removeAllElements();\n\tallTypes.removeAllElements();\n }", "@Override\n\tpublic void deleteByType(int type) {\n\t\tsettingDao.deleteByType(type);\n\t}", "public Builder clearType() {\n\n type_ = 0;\n onChanged();\n return this;\n }", "public Builder clearWalletType() {\n walletType_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000100);\n onChanged();\n return this;\n }", "public void removeAll() {\n\t\tsynchronized (mNpcs) {\n\t\t\tmNpcs = Collections.synchronizedList(new ArrayList<Npc>());\n\t\t\tmDemonCount = 0;\n\t\t\tmHumanCount = 0;\n\t\t}\n\t}", "public Builder clearType() {\n \n type_ = 0;\n onChanged();\n return this;\n }", "void removeAllSpawn();", "public ArrayList<Bot> getAllBots() {\n final String errorMessage = \"Error getting all bots\";\n ResultSet retrievedBots = dbConnector.selectQuery(\"SELECT c.name, bot_id, active_time, probability, activity_status\" +\n \" FROM Bots as b, Company as c WHERE b.company_id = c.company_id;\");\n ArrayList<Bot> bots = null;\n try {\n bots = new ArrayList<Bot>();\n while (retrievedBots.next()) {\n bots.add(toBot(retrievedBots));\n }\n } catch (SQLException e) {\n System.out.println(errorMessage);\n }\n return bots;\n }", "public void unCache(Class<?> type) {\n reflectorCache.remove(type);\n }", "public void unsetTypeId()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(TYPEID$2, 0);\n }\n }", "public Builder clearType() {\n\n\t\t\t\t\ttype_ = 0;\n\t\t\t\t\tonChanged();\n\t\t\t\t\treturn this;\n\t\t\t\t}", "public Builder clearType() {\n\n\t\t\t\ttype_ = 0;\n\t\t\t\tonChanged();\n\t\t\t\treturn this;\n\t\t\t}", "private void removeOOSBalas() {\n balasToRemove = new ArrayList<>();\n balas.forEach(bala -> {\n if(bala.getState() == Enums.BulletState.TO_REMOVE) {\n if(!balasToRemove.contains(bala)) {\n balasToRemove.add(bala);\n }\n }\n });\n balasToRemove.forEach(bala -> balas.remove(bala));\n }", "public void removeInputType(IInputType type);", "public Builder clearType() {\n \n type_ = 0;\n onChanged();\n return this;\n }", "public Builder clearType() {\n \n type_ = 0;\n onChanged();\n return this;\n }", "public Builder clearType() {\n \n type_ = 0;\n onChanged();\n return this;\n }", "public Builder clearType() {\n \n type_ = 0;\n onChanged();\n return this;\n }", "public Builder clearType() {\n \n type_ = 0;\n onChanged();\n return this;\n }", "public Builder clearType() {\n \n type_ = 0;\n onChanged();\n return this;\n }", "public Builder clearType() {\n \n type_ = 0;\n onChanged();\n return this;\n }", "public static void cleanUpChannels() {\n for (ChatChannel channel : ChatManager.channels.values())\n if (channel.getLastActivity() + ChatManager.CHANNEL_LIFETIME < System.currentTimeMillis())\n ChatManager.channels.remove(channel.getName());\n\n }", "public void removeAllFightsystems()\r\n {\n\r\n }", "public Builder clearQuestType() {\n \n questType_ = 0;\n onChanged();\n return this;\n }", "<T extends ListenableEvent> void removeActions(ActionType<T> type);", "public void killAll() {\n for (Map.Entry<Integer, Enemy> entry :enemies.entrySet()) {\n if (!!!entry.getValue().isDead()) {\n entry.getValue().setHealth(0);\n }\n }\n }", "private void removeAllObjects()\n {\n removeObjects (getObjects(Actor.class));\n }", "void removeListener(BotListener l);", "private void deleteAttacks(){\n while(!attacksToDelete.isEmpty()){\n attacks.remove(attacksToDelete.remove());\n }\n }", "public static void cleanChanList() {\n\t\tArrayList<ChatChannel> currentChannels = new ArrayList<ChatChannel>();\n\t\tfor (int i = 0; i < channels.size(); i++) {\n\t\t\tcurrentChannels.add(channels.get(i));\n\t\t}\n\t\t\n\t\t//loop through the new array list\n\t\tfor (ChatChannel channel: currentChannels) {\n\t\t\tboolean remove = true;\n\t\t\tif (!channel.modes.contains(ChatChannel.Mode.PERSIST)) {\n\t\t\t\t//Not persist. Check the players\n\t\t\t\tfor (int f = 0; f < PlayerManager.players.size(); f++){\n\t\t\t\t\tChatPlayer player = PlayerManager.players.get(f);\n\t\t\t\t\t\n\t\t\t\t\t//check if in channel or listening\n\t\t\t\t\tif (player.listening.contains(channel.name.toLowerCase()) || player.listening.contains(channel.name.toLowerCase())){\n\t\t\t\t\t\tremove = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tremove = false;\n\t\t\t}\n\t\t\t\n\t\t\tif (remove) {\n\t\t\t\tremoveChannel(channel.name);\n\t\t\t\tSystem.out.println(\"Remove channel: \"+channel.name);\n\t\t\t}\n\t\t}\n\t}", "public Builder clearVehicleType() {\n if (vehicleTypeBuilder_ == null) {\n vehicleType_ = null;\n onChanged();\n } else {\n vehicleType_ = null;\n vehicleTypeBuilder_ = null;\n }\n\n return this;\n }", "public void resetNewDirBots() {\r\n \r\n this.north = new BotSimpleDirection(this.getBoard(), BotSimpleDirection.DIR_NORTH);\r\n this.south = new BotSimpleDirection(this.getBoard(), BotSimpleDirection.DIR_SOUTH);\r\n this.east = new BotSimpleDirection(this.getBoard(), BotSimpleDirection.DIR_EAST);\r\n this.west = new BotSimpleDirection(this.getBoard(), BotSimpleDirection.DIR_WEST);\r\n \r\n // At this point, we can do a clone\r\n this.initDirBotMove(north);\r\n this.initDirBotMove(south);\r\n this.initDirBotMove(east);\r\n this.initDirBotMove(west);\r\n }", "public Builder clearUserTypes() {\n if (userTypesBuilder_ == null) {\n userTypes_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000004);\n onChanged();\n } else {\n userTypesBuilder_.clear();\n }\n return this;\n }", "private void reviveAttacker(String type) {\n\t\t// Check to see if the game will allow another enemy on screen\n\t\tif(mLivingAttackerCount >= mRoundMaxAttackers)\n\t\t\treturn;\n\n\t\t// Put the string into lowercase just \"in case\"\n\t\ttype = type.toLowerCase();\n\t\t// Check against the two types to revive\n\t\tif(type.equals(\"normal\")) {\n\t\t\tfor(int i = 0; i < ATTACKER_HALF_SIZE; i++) {\n\t\t\t\tif(!mAttackers[i].isAlive()){\n\t\t\t\t\t// Found an attacker indexed as a \"normal\" attacker\n\t\t\t\t\tmAttackers[i].revive();\n\t\t\t\t\tmLivingAttackerCount++;\n\t\t\t\t\treturn; // Just need one!\n\t\t\t\t}\n\t\t\t}\n\t\t} else if(type.equals(\"knight\")) {\n\t\t\tfor(int i = ATTACKER_HALF_SIZE; i < ATTACKER_ARRAY_SIZE; i++) {\n\t\t\t\tif(!mAttackers[i].isAlive()) {\n\t\t\t\t\t// Found an attacker indexed as a \"knight\" attacker\n\t\t\t\t\tmAttackers[i].revive();\n\t\t\t\t\tmAttackers[i].play(\"walk\", true);\n\t\t\t\t\tmLivingAttackerCount++;\n\t\t\t\t\treturn; // Just need one!\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void removeAllAgents() {\n\t\tagents.clear();\n\t}", "private void clearAll(){\r\n List<FantasyMatch> allMatches = fmatchBean.findAll();\r\n for(FantasyMatch fm : allMatches){\r\n fmatchBean.remove(fm);\r\n }\r\n \r\n List<RosterPlayer> allRps= rpBean.findAll();\r\n for(RosterPlayer rp : allRps){\r\n rpBean.remove(rp);\r\n }\r\n \r\n List<FantasyTeam> allTeams = ftBean.findAll();\r\n for(FantasyTeam ft : allTeams){\r\n ftBean.remove(ft);\r\n }\r\n \r\n List<FantasyLeague> allLeagues = flBean.findAll();\r\n for(FantasyLeague fl : allLeagues){\r\n flBean.remove(fl);\r\n }\r\n \r\n List<FantasyUser> allUsers = fUserBean.findAll();\r\n for(FantasyUser fu : allUsers){\r\n fUserBean.remove(fu);\r\n }\r\n }", "public void removeServer(AbstractServer server) {\n server.getHandler().getHandledTypes()\n .forEach(x -> {\n handlerMap.remove(x, server);\n log.trace(\"Un-Registered {} to handle messages of type {}\", server, x);\n });\n }", "public Builder clearType() {\n bitField0_ = (bitField0_ & ~0x00000002);\n type_ = com.example.cs217b.ndn_hangman.MessageBuffer.Messages.MessageType.GUESS;\n onChanged();\n return this;\n }", "public static void clearWorld() {\n\t\t// Complete this method.\n\t\tfor(Critter i: population){\n\t\t\tpopulation.remove(i);\n\t\t}\n\t\tfor(Critter j: babies){\n\t\t\tbabies.remove(j);\n\t\t}\n\t\tpopulation.clear();\n\t\tbabies.clear();\n\n\n\t}", "@Override\r\n public void onDisable()\r\n {\n for (Arena arena : arenaController.getArenas().values())\r\n {\r\n arena.getGameManager().clearArena();\r\n }\r\n\r\n //Close database connection\r\n InputOutput.freeConnection();\r\n }", "public Builder clearGunType() {\n \n gunType_ = 0;\n onChanged();\n return this;\n }", "@Override\n\tpublic void removeAll() throws SystemException {\n\t\tfor (TvShow tvShow : findAll()) {\n\t\t\tremove(tvShow);\n\t\t}\n\t}", "public static void destroyType() {\n\t\t\n\t}", "public void unsetMemberTypes()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_attribute(MEMBERTYPES$2);\n }\n }", "@Override\n public void clearPermissions(Class<? extends AeroCommandBase<?>> command) {\n permissions.remove(command);\n }", "public void removeVehicles() {\r\n numberOfVehicles = 0;\r\n for (Lane lane : lanes) {\r\n lane.removeVehicles();\r\n }\r\n }", "public void deleteCommands() {\n\t\tcommands = new ArrayList<Command>();\n\t\tassert(commands.size() == 0);\n\t}", "public static void clearCache() {\r\n types = null;\r\n typesById = null;\r\n updatedBuiltinTypes = false;\r\n ChangeLogTypeBuiltin.internal_clearCache();\r\n }", "String removeBot( String name, String msg ) {\n if( name == null )\n return \"had no name associated; no removal action taken\";\n\n ChildBot deadBot = m_botStable.remove( name );\n\n if( deadBot != null ) {\n try {\n Session deadSesh = deadBot.getBot();\n\n if( deadSesh != null ) {\n if( deadSesh.getBotAction() != null ) {\n deadSesh.getBotAction().cancelTasks();\n }\n\n if( msg != null ) {\n if( !msg.equals(\"\") ) {\n deadSesh.disconnect( msg );\n } else {\n deadSesh.disconnect( \"(empty DC message)\" );\n }\n } else {\n deadSesh.disconnect( \"(null DC message)\" );\n }\n }\n\n // Decrement count for this type of bot\n addToBotCount( deadBot.getClassName(), (-1) );\n deadBot = null;\n return \"has disconnected normally\";\n } catch( NullPointerException e ) {\n Tools.printStackTrace(e);\n m_botAction.sendChatMessage( 1, name + \" had a disconnection problem/was already DC'd (null pointer exception thrown)\");\n }\n }\n\n return \"not found in bot stable (possibly already disconnected)\";\n }", "public void clearTokenType() {\n genClient.clear(CacheKey.tokenType);\n }", "public void removeRobot(String name){\n robotNames.remove(name);\n measurementHandlers.remove(name);\n }", "public void clearPolymorphismType() {\n // Override in proxy if lazily loaded; otherwise does nothing\n }", "public static void scriptDelete() {\n List<BeverageEntity> beverages = (List<BeverageEntity>) adminFacade.getAllBeverages();\n for (int i = 0; i < beverages.size(); i++) {\n System.out.println(\"delete : \" + beverages.get(i));\n adminFacade.removeBeverage(beverages.get(i));\n }\n List<DecorationEntity> decos = (List<DecorationEntity>) adminFacade.getAllDecorations();\n for (int i = 0; i < decos.size(); i++) {\n System.out.println(\"delete : \" + decos.get(i));\n adminFacade.removeDecoration(decos.get(i));\n }\n\n /* Check that there isn't any other cocktails, and delete remaining */\n List<CocktailEntity> cocktails = (List<CocktailEntity>) adminFacade.getAllCocktails();\n if (cocktails.size() > 0) {\n System.err.println(\"Les cocktails n'ont pas été tous supprimés... \"\n + cocktails.size() + \" cocktails restants :\");\n }\n for (int i = 0; i < cocktails.size(); i++) {\n CocktailEntity cocktail = adminFacade.getCocktailFull(cocktails.get(i));\n System.err.println(cocktail.getName() + \" : \"\n + cocktail.getDeliverables());\n adminFacade.removeCocktail(cocktail);\n }\n\n /* Remove client accounts */\n List<ClientAccountEntity> clients = (List<ClientAccountEntity>) adminFacade.getAllClients();\n for (int i = 0; i < clients.size(); i++) {\n adminFacade.removeClient(clients.get(i));\n }\n\n /* Remove addresses */\n List<AddressEntity> addresses = (List<AddressEntity>) adminFacade.getAllAddresses();\n for (int i = 0; i < addresses.size(); i++) {\n adminFacade.removeAddress(addresses.get(i));\n }\n\n /* TODO :\n * * Remove orders\n */\n }", "public void remove(int type) {\n\t\tint n = check(type);\n\t\tif (n >= 64) {\n\t\t\tn1 &= ~mask(n - 64);\n\t\t} else {\n\t\t\tn0 &= ~mask(n);\n\t\t}\n\t}" ]
[ "0.66647846", "0.563157", "0.55758256", "0.549912", "0.54369503", "0.52673686", "0.5255099", "0.5249097", "0.5240985", "0.5236156", "0.52330387", "0.5148012", "0.5112498", "0.5084305", "0.5082743", "0.50632787", "0.50628364", "0.501771", "0.5014742", "0.5009805", "0.50091", "0.49828565", "0.49791592", "0.49789682", "0.49781522", "0.49774897", "0.4960339", "0.4946442", "0.49209625", "0.4918196", "0.48763415", "0.48652887", "0.48600072", "0.48596677", "0.48571122", "0.4854893", "0.48504665", "0.48469758", "0.48427582", "0.48406914", "0.48391488", "0.48391488", "0.48391488", "0.48346585", "0.48197109", "0.48170772", "0.48125574", "0.48068607", "0.47976917", "0.4794509", "0.47894996", "0.47847474", "0.47785714", "0.4777095", "0.47758126", "0.47709596", "0.47679183", "0.47590607", "0.47573844", "0.47539106", "0.47408652", "0.47408652", "0.47408652", "0.47408652", "0.47408652", "0.47408652", "0.47408652", "0.47370112", "0.47270694", "0.47224805", "0.4715781", "0.47134274", "0.47115", "0.47112006", "0.47034532", "0.4690032", "0.46869567", "0.46756554", "0.46703103", "0.4669738", "0.46654987", "0.46645755", "0.4663062", "0.46598572", "0.46549526", "0.4653506", "0.46534252", "0.4650008", "0.46487892", "0.4637812", "0.46310377", "0.46309844", "0.46283197", "0.46261558", "0.46137214", "0.45919213", "0.4590783", "0.4586798", "0.45769486", "0.45726898" ]
0.71044636
0
Shuts down (removes) all bots.
void shutdownAllBots() { LinkedList<String> names = new LinkedList<String>(); for( ChildBot c : m_botStable.values() ) { if( c != null ) { names.add( c.getBot().getBotName() ); } } for( String name : names ) { removeBot( name, "core shutdown" ); m_botAction.sendChatMessage( 1, name + " logged off. (Core shutdown.)" ); } m_botTypes.clear(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void cleanToAll() {\n\t\tfor(ClientThread player: players) {\n\t\t\tplayer.send(new Package(\"CLEAN\",null));\n\t\t}\n\t}", "public final void stopAll() {\n for (BotTaskInterface bt : TASKS) {\n LOG.info(\"Stoping BotTask {}\", bt.getName());\n bt.stop();\n }\n EXECUTOR_SERVICE.shutdown();\n }", "public void ShutDown()\n {\n bRunning = false;\n \n LaunchLog.Log(COMMS, LOG_NAME, \"Shut down instruction received...\");\n\n for(LaunchServerSession session : Sessions.values())\n {\n LaunchLog.Log(COMMS, LOG_NAME, \"Closing session...\");\n session.Close();\n }\n \n LaunchLog.Log(COMMS, LOG_NAME, \"...All sessions are closed.\");\n }", "protected void stopAll() {\n\t\tif (this.udpServer!=null)\n\t\t\tthis.udpServer.interrupt();\n\t\tif (this.connectionServer!=null)\n\t\t\tthis.connectionServer.interrupt();\n\t\tthis.connectionServer=null; // supprime le TCPServer et les Sockets associés\n\t\tthis.udpServer=null; // supprime l'UDPServer et les Sockets associés\n\t\tif (this.agent.getUserStatusManager()!=null)\n\t\t\tfor (String u : this.agent.getUserStatusManager().getActiveUsers())\n\t\t\t\tthis.removeSocket(u);; // interrompt tous les UserSockets\n\t\tthis.mapSockets.clear();\n\t}", "public void shutdown() {\n drivers.stream().filter(ClosingAwareWebDriver::isAlive)\n .forEach(ClosingAwareWebDriver::forceShutdown);\n }", "public void shutdown() {\n for (TServer server : thriftServers) {\n server.stop();\n }\n try {\n zookeeper.shutdown();\n discovery.close();\n } catch (IOException ex) {\n //don't care\n }\n }", "public void exitAllRooms() {\n\t\tfor (RoomSetting roomSetting : roomSettings) {\n\t\t\troomSetting.getRoom().removeClient(this);\n\t\t}\n\t\troomSettings.clear();\n\t}", "boolean shutdownIdleBots() {\n boolean allBotsIdle = true;\n LinkedList<String> names = new LinkedList<String>();\n\n for( ChildBot c : m_botStable.values() ) {\n if( c != null ) {\n if( c.getBot().getSubspaceBot().isIdle() )\n names.add( c.getBot().getBotName() );\n else\n allBotsIdle = false;\n }\n }\n\n for( String name : names ) {\n removeBot( name, \"idle bot shutdown\" );\n m_botAction.sendChatMessage( 1, name + \" logged off. (Idle bot shutdown.)\" );\n }\n\n return allBotsIdle;\n }", "public void shutdown() {\n logger.info(\"Shutting down modules.\");\n for (Module module : modules) {\n module.stop();\n }\n logger.info(\"Shutting down reporters.\");\n for (Reporter reporter : reporters.values()) {\n reporter.stop();\n }\n }", "public void shutdown() {\n for (Connection connection : connections) { //Try closing all connections\n closeConnection(connection);\n }\n }", "public static void shutDown(){\n for(int i = PS3_LIST_.size()-1; i >= 0; i--){\n PS3 instance = PS3_LIST_.get(i);\n instance.setLed(false);\n instance.destroy();\n }\n PS3Logger.log(PS3Logger.TYPE.DEBUG, null, \"PS3 SHUTDOWN\");\n }", "public void shutdownAll() throws IOException {\n\t\tfor (int i = 0; i < this.size(); i++) {\n\t\t\tif (this.get(i).getClient() != null) {\n\t\t\t\tthis.get(i).sendOkay(\"SHUTDOWN\");\n\t\t\t}\n\t\t}\n\t}", "public void removeAgents() {\n\t\tfor (TestLiveAgent agent : agents.values()) {\n\t\t\tagent.stop();\n\t\t}\n\t\tagents.clear();\n\t}", "public void shutdown() {\n mGameHandler.shutdown();\n mTerminalNetwork.terminate();\n }", "public void shutdown(PircBotX bot) {\n\t\tList<ManagedFutureTask> remainingTasks;\n\t\tsynchronized (runningListeners) {\n\t\t\tremainingTasks = Lists.newArrayList(runningListeners.get(bot));\n\t\t}\n\n\t\t//Wait for all remaining tasks to return\n\t\tfor (ManagedFutureTask curFuture : remainingTasks)\n\t\t\ttry {\n\t\t\t\tlog.debug(\"Waiting for listener \" + curFuture.getListener() + \" to execute event \" + curFuture.getEvent());\n\t\t\t\tcurFuture.get();\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new RuntimeException(\"Cannot shutdown listener \" + curFuture.getListener() + \" executing event \" + curFuture.getEvent(), e);\n\t\t\t}\n\t}", "public synchronized void shutdown()\n {\n Log.info( \"Shutting down. Unloading all loaded plugins...\" );\n\n // Stop the plugin monitoring service.\n pluginMonitor.stop();\n\n // Shutdown all loaded plugins.\n for ( Map.Entry<String, Plugin> plugin : pluginsLoaded.entrySet() )\n {\n try\n {\n plugin.getValue().destroyPlugin();\n Log.info( \"Unloaded plugin '{}'.\", plugin.getKey() );\n }\n catch ( Exception e )\n {\n Log.error( \"An exception occurred while trying to unload plugin '{}':\", plugin.getKey(), e );\n }\n }\n pluginsLoaded.clear();\n pluginDirs.clear();\n pluginMetadata.clear();\n classloaders.clear();\n childPluginMap.clear();\n failureToLoadCount.clear();\n }", "public void shutdown() {\n \t\tfor(Expirator e : expirators) {\n\t\t\te.shutdown();\n \t\t}\n \t\texpirators.clear();\n \t}", "public void shutdown() {\n\t\t//We call peers.values() and put into Array to create an unchanging copy, one that\n\t\t//does not shrink even as the sockets remove themselves from the peers list\n\t\t//this prevents a ConcurrentModificationException\n\t\tonline = false;\n\t\tArrayList<DecentSocket> connections = new ArrayList<DecentSocket>(peers.values());\n\t\tfor(DecentSocket socket: connections) {\n\t\t\tsocket.stop();\n\t\t}\n\t\tlistener.stop();\n\t\tchecker.stop();\n\t}", "public void shutdown(){\n for(MessageHandler h : handlerMap.values()){\n h.shutdown();\n }\n }", "private void logout(){\n player.setName(\"(bot) \" + player.getName());\n botMode = true;\n System.out.println(\"bot made\");\n login = false;\n }", "public void destroy() throws IOException, InterruptedException {\n LOGGER.info(\"Trading bot shutting down, will first cancel all open orders\");\n this.sessionHandler.onShutDown(this.session);\n }", "public void shutDown() {\n if(client != null) {\n client.shutdownClient();\n }\n }", "private void shutDown() {\r\n\t\t\r\n\t\t// send shutdown to children\r\n\t\tlogger.debug(\"BagCheck \"+ this.lineNumber+\" has sent an EndOfDay message to it's Security.\");\r\n\t\tthis.securityActor.tell(new EndOfDay(1));\r\n\r\n\t\t// clear all references\r\n\t\tthis.securityActor = null;\r\n\t}", "public void closeAllBrowsers() {\n\n driver.quit();\n\n\n }", "public void shutdownAll() {\n System.out.println(\"Shutting down network, received halt command!\");\n _poolData.shutdown();\n }", "private static void shutdown() {\n\t\tSystem.out.println(\"Shutting down ...\");\n\t\tpool.shutdown();\n\t\tfor (Client client : clientMap.values()) {\n\t\t\tclient.cleanup();\n\t\t}\n\n\t\t// wait until all threads complete\n\t\ttry {\n\t\t\tif (!pool.awaitTermination(30, TimeUnit.SECONDS)) {\n\t\t\t\tSystem.out.println(\"Force shutdown after 30 seconds ...\");\n\t\t\t\tpool.shutdownNow();\n\t\t\t\tif (!pool.awaitTermination(30, TimeUnit.SECONDS)) {\n\t\t\t\t\tSystem.out.println(\"Terminate the process.\");\n\t\t\t\t\tThread.currentThread().interrupt();\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (InterruptedException e) {\n\t\t\tThread.currentThread().interrupt();\n\t\t}\n\t}", "public void clearDownLanes() {\r\n\t\tdownLanes = null;\r\n\t}", "public void shutdown() {\n fsManager.getOpenFileSystems().forEach(JGitFileSystem::close);\n shutdownSSH();\n forceStopDaemon();\n fsManager.clear();\n }", "public void shutdown() {\n\t\tfor(Player player : new ArrayList<>(entries.keySet())) {\n\t\t\tonQuit(new PlayerQuitEvent(player, (Component) null, PlayerQuitEvent.QuitReason.DISCONNECTED));\n\t\t}\n\t}", "@AfterAll\n\tpublic static void destroy() {\n\t\tif (isSingleTest) {\n\t\t\tlogger.debug(\"Closing ChromeDriver for single test class.\");\n\t\t\tIntegrationUITestListener.stopWebDriver();\n\t\t}\n\t}", "public void shutdown() {\n for (AbstractController child : getChildren()) {\n child.shutdown();\n }\n }", "private void shutDown() {\n this.setState(State.SHUTTING);\n // clean all msg queues\n if (isRoot()) {\n System.out.println(String.format(\"%s: shutdown\", Thread.currentThread().getName()));\n Neighbor pseudoParent = null;\n ArrayList<Neighbor> children = node.getChildren();\n if (children.isEmpty()) {\n // shutDown fast\n } else {\n System.out.println(String.format(\"%s: looking for next root\", Thread.currentThread().getName()));\n for (Neighbor child : node.getChildren()) {\n try {\n child.sendMessage(\n new RootMessage(),\n child::detach\n ).get();\n pseudoParent = child;\n break;\n } catch (InterruptedException | CancellationException | ExecutionException e) {\n e.printStackTrace();\n System.err.println(Thread.currentThread().getName() + \": child not available\");\n }\n }\n\n if (pseudoParent != null) {\n System.out.println(String.format(\"%s: found next root\", Thread.currentThread().getName()));\n broadcastRejoin(pseudoParent);\n } else {\n // shutdown fast\n System.out.println(String.format(\"%s: didn't find next root\", Thread.currentThread().getName()));\n }\n }\n } else {\n try {\n Neighbor parent = node.parent;\n broadcastRejoin(parent);\n parent.sendMessage(new LeaveMessage(), this::detachParent).get();\n } catch (InterruptedException | ExecutionException e) {\n e.printStackTrace();\n }\n }\n setState(State.TERMINATED);\n }", "private void shutdownThreads() {\n\t\tif (backupHeartbeatBroadcaster != null) {\n\t\t\tbackupHeartbeatBroadcaster.cancel();\n\t\t}\n\t\tif (activeHeartbeatTimer != null) {\n\t\t\tactiveHeartbeatTimer.cancel();\n\t\t}\n\t\tif (serverLatencyProcessorTimer != null) {\n\t\t\tserverLatencyProcessorTimer.cancel();\n\t\t}\n\t\tif (backupHeartbeatTimer != null) {\n\t\t\tbackupHeartbeatTimer.cancel();\n\t\t}\n\t\tif (reElectionTimer != null) {\n\t\t\treElectionTimer.cancel();\n\t\t}\n\t\tif (preElectionTimeoutTimer != null) {\n\t\t\tpreElectionTimeoutTimer.cancel();\n\t\t}\n\t}", "public void shutdown() {\n for (BucketMonitor monitor : this.monitors.values()) {\n monitor.shutdown();\n }\n }", "public void shutDown()\n {\n stunStack.removeSocket(serverAddress);\n messageSequence.removeAllElements();\n localSocket.close();\n }", "public void killAll() {\n distributors.forEach(Person::kill);\n distributors = new ArrayList<>();\n }", "public void cancelAllClients(){\n clientsPool.shutdownNow();\n }", "public void stop() {\n\t\tserver.saveObjectToFile(offlineMessagesFileName, _offlineMessages);\n\t\tserver.saveObjectToFile(onlineClientsFileName, _onlineClients);\n\t\tserver.saveObjectToFile(clientFriendsFileName, _clientFriends);\n\t\t_offlineMessages.clear();\n\t\t_onlineClients.clear();\n\t\t_clientFriends.clear();\n\t\tserver.stop();\n\t}", "public static void cleanUpChannels() {\n for (ChatChannel channel : ChatManager.channels.values())\n if (channel.getLastActivity() + ChatManager.CHANNEL_LIFETIME < System.currentTimeMillis())\n ChatManager.channels.remove(channel.getName());\n\n }", "public void shutdown() {\n for (Entry<String,Session> entry : _sessions.entrySet())\n entry.getValue().disconnect();\n \n writeLine(\"\\nDebugServer shutting down.\");\n close();\n }", "public void unregisterAll()\n {\n final Set<javax.servlet.Servlet> servlets = new HashSet<>(this.localServlets);\n for (final javax.servlet.Servlet servlet : servlets)\n {\n unregisterServlet(servlet);\n }\n }", "@After\n\tpublic void tearDown() throws Exception {\n\t\tserverChannel.close();\n\t\tchannel = null;\n\t\tclient = null;\n\t}", "public void shutdown() {\n\t\tfinal List<Runnable> tasks = updater.shutdownNow();\n\t\tif (null == tasks) return;\n\t\tfor (final Runnable t : tasks)\n\t\t\tt.run();\n\t}", "static synchronized void closeAll() {\n List<BlackLabEngine> copy = new ArrayList<>(engines);\n engines.clear();\n for (BlackLabEngine engine : copy) {\n engine.close();\n }\n }", "@AfterClass\n public static void cleanup() throws Exception {\n try {\n if (client != null) client.close();\n if (runners != null) {\n int i = 0;\n for (final NodeRunner runner: runners) {\n print(false, false, \"<<< stoping the JPPF node \" + (++i));\n runner.shutdown();\n }\n }\n if (driver != null) {\n print(false, false, \"<<< shutting down driver\");\n driver.shutdown();;\n }\n } finally {\n BaseTestHelper.generateClientThreadDump();\n }\n }", "public static void closeDriver() {\n driver.remove();\n }", "public void forceShutdownAllGuilds() {\n synchronized (states) {\n List<MusicInterruptedGuild> toSave = new ArrayList<>(states.size());\n\n for (Map.Entry<Long, MusicState> entry : states.entrySet()) {\n long guildId = entry.getKey();\n\n MusicState state = entry.getValue();\n\n shutdownGuild(state);\n\n toSave.add(new MusicInterruptedGuild(guildId, state.getBoundChannelId(), state.getVoiceChannelId()));\n\n MUSIC_PLAYER_GAUGE.dec();\n }\n\n boolean res = this.interruptedGuildRepository.createAll(toSave);\n if (!res) {\n this.logger.log(0, \"Music leave: Failed to insert into interrupted guilds\");\n }\n\n states.clear();\n }\n }", "private void cleanUp(){\n\t\tSSHUtil sSHUtil=(SSHUtil) SpringUtil.getBean(\"sSHUtil\");\n\t\ttry {\n\t\t\tsSHUtil.disconnect();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void clean() {\n\t\tserver.clearPersistentData();\n\t\t_offlineMessages.clear();\n\t\t_onlineClients.clear();\n\t\t_clientFriends.clear();\n\t}", "void killAllApps();", "public void deshabilitarBotones()\n\t{\n\t\tbotonPlay.setClickable(false);\n\t\tbotonPause.setClickable(false);\n\t\tbotonPonerRingtone.setClickable(false);\n\t\tbotonDescargar.setClickable(false);\n\t}", "public void teardown() {\n LOGGER.info(\"Shutting down driver\");\n driver.quit();\n }", "public void destroy(){\n\t\tIterator toolIterator = tools.iterator();\n\t\twhile(toolIterator.hasNext()){\n\t\t\tToolBridge tb = (ToolBridge) toolIterator.next();\n\t\t\ttb.terminate();\n\t\t}\n\n\t\tmultiplexingClientServer.stopRunning();\n\t}", "public synchronized void closeAllConnections() {\n\t\tstop();\n\t}", "protected void cleanUpAndExit() {\n Enumeration<Sender> senderEnum = getSenders().elements();\n\n while (senderEnum.hasMoreElements()) {\n Sender nextSender = senderEnum.nextElement();\n try {\n nextSender.close();\n } catch (IOException e) {\n // TODO: better error output here?\n e.printStackTrace();\n }\n }\n\n System.exit(0);\n }", "public void shutdown() {\n shutdown(false);\n }", "public static void stopEverything(){\r\n\t\tfor(final ExecutionHandler<?> execHandler:allThreads){\r\n\t\t\t//interrupt the stack execution, so that it wont be further executed \r\n\t\t\tstopExecutionHandler(execHandler);\r\n\t\t}\r\n\t\t//Now when all ExecutionHandlers should already be empty, but for sure - clear all global lists explicitly\r\n\t\tallThreads.clear(); \r\n\t\tallExecutablesInProcess.clear();\r\n\t\trootBlockToThread.clear();\r\n\t}", "public static void disconnectAll(ServerInfo info) {\n for (ProxiedPlayer player : info.getPlayers()) {\n player.disconnect(\"The server is currently unavailable, please try again soon!\");\n }\n }", "@Override\n\t\tpublic void closeAll() {\n\t\t\tfor (ClientHandler clientHandler : new ArrayList<ClientHandler>(this.running)) {\n\t\t\t\tclientHandler.close();\n\t\t\t}\n\t\t}", "public void stopServers() {\n EventHandlerService.INSTANCE.reset();\n UserRegistryService.INSTANCE.reset();\n\n if ( eventDispatcher != null ) {\n eventDispatcher.shutdown();\n }\n if ( userClientDispatcher != null ) {\n userClientDispatcher.shutdown();\n }\n if ( eventDispatcherThread != null ) {\n eventDispatcherThread.interrupt();\n }\n if ( userClientDispatcherThread != null ) {\n userClientDispatcherThread.interrupt();\n }\n }", "public void shutdown() {\n MultiThreadedHttpConnectionManager manager = \n (MultiThreadedHttpConnectionManager) httpClient.getHttpConnectionManager();\n manager.shutdown();\n }", "@AfterClass\n public static void destroyDriver() {\n driver.quit();\n driver = null;\n }", "public static void teardown() {\n\t\tdriver.quit();\n\t}", "public void removeRobotsAndRubble() {\n\t\tfor(Player p : playerList) {\n\t\t\tif(p.getType() != PlayerType.Agent) {\n\t\t\t\tremovePosition(p.getPosition());\n\t\t\t\tremovePlayer(p.getName());\n\t\t\t}\n\t\t\telse \n\t\t\t\tp.resetRobotsFollowing();\n\t\t}\n\t}", "public static void kill() {\n Iterator<Recipe> recipes = tj.getServer().recipeIterator();\r\n Recipe recipe;\r\n\r\n while (recipes.hasNext()) {\r\n recipe = recipes.next();\r\n\r\n if (recipe != null && customItems.containsValue(recipe.getResult()))\r\n recipes.remove();\r\n }\r\n\r\n tj = null;\r\n messages = null;\r\n playerDataFolder = null;\r\n players = null;\r\n customItems = null;\r\n }", "public void goAway() {\n Enumeration<ChatClientRoom> cc = clientSessionList.elements();\n while (cc.hasMoreElements()) {\n ChatClientRoom ccr = cc.nextElement();\n ccr.goAway();\n }\n this.dispose();\n try {\n rpc.disconnect();\n } catch (Exception e) {\n System.err.println(\"ChatClientLogin could not disconnect from GMI\");\n }\n System.exit(0);\n }", "public void cleanShutDown () {\n shutdown = true;\n }", "public void quitDriver() {\n webDriver.quit();\n webDriver = null;\n }", "public void shutdownNetwork() {\r\n networkPlayer.stop();\r\n }", "public void cleanUp() {\n\t\tfor (int i = 0; i < 24; i++) {\r\n\t\t\tPlayerAssistant.itemOnInterface(c, 26099, i, -1, -1);\r\n\t\t}\r\n\t\tc.getPA().sendNewString(\"0\", 26013);\r\n\t}", "public void closeAllBrowsers() {\r\n\t\ttry {\r\n\t\t\tif (driver != null) {\r\n\t\t\t\tdriver.quit();\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}", "private void tearEverythingDown() {\n\t\t// It doesn't do any harm if we call this method repeatedly - we only ever end up subscribing once.\n\t\tMultiLocationProvider.getInstance().addListener(this);\n\t}", "public void freeAll()\n\t\t{\n\t\t\ts_cGameInstance = null; \n\t\t}", "public void clearUpLanes () {\r\n\t\tupLanes = null;\r\n\t}", "public void disconnect(){\n\t\tfor (NodeInfo peerInfo : peerList) {\r\n\t\t\t// send leave to peer\r\n\t\t\tsend(\"0114 LEAVE \" + ip + \" \" + port, peerInfo.getIp(), peerInfo.getPort());\r\n\t\t\t\r\n\t\t\tfor (NodeInfo peerInfo2 : peerList) {\r\n\t\t\t\tif (!peerInfo.equals(peerInfo2)) {\r\n\t\t\t\t\tString joinString = \"0114 JOIN \" + peerInfo2.getIp() + \" \" + peerInfo2.getPort();\r\n\t\t\t\t\t\r\n\t\t\t\t\tsend(joinString, peerInfo.getIp(), peerInfo.getPort());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tunRegisterBootstrapServer(serverIp, serverPort, ip, port, username);\r\n\t\t\tapp.printInfo(\"Node disconnected from server....\");\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\t//socket = null;\r\n\t}", "private void shutdown() {\n\t\ttry {\n\t\t\tsock.close();\n\t\t\tgame.handleExit(this);\n\t\t\tstopped = true;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}", "@Teardown\n public void tearDown() {\n if (channel != null) {\n channel.shutdownNow();\n channel = null;\n }\n }", "public static void shutDownPlayer()\n {\n MusicPlayerControl.shutdown();\n JSoundsMainWindowViewController.listSongs=null;\n JSoundsMainWindowViewController.listSongs=new JMusicPlayerList();\n JSoundsMainWindowViewController.alreadyPlaying=false;\n JSoundsMainWindowViewController.dontInitPlayer=false;\n JSoundsMainWindowViewController.shutDown=true;\n }", "void hardRemoveAllBotsOfType( String className, String initiator ) {\n String rawClassName = className.toLowerCase();\n Integer numBots = m_botTypes.get( rawClassName );\n LinkedList<String> names = new LinkedList<String>();\n\n for( ChildBot c : m_botStable.values() )\n if( c != null ) {\n if(c.getClassName().equals( rawClassName ))\n names.add( c.getBot().getBotName() );\n }\n\n for( String name : names ) {\n removeBot( name, \"!removetype by \" + initiator );\n m_botAction.sendChatMessage( 1, name + \" logged off. (!removetype initiated.)\" );\n }\n\n if( numBots != null && numBots.intValue() != 0 )\n m_botTypes.put( rawClassName, new Integer(0) );\n }", "public void shutDown()\n {\n // Runtime.getRuntime().removeShutdownHook(shutdownListener);\n //shutdownListener.run();\n }", "public void clearFramework() {\r\n\t\tList<Configuration> tests = testCache.getAllTests();\r\n\t\tlog.info(\"Clearing all tests.\\n\");\r\n\t\tfor (Configuration test : tests) {\r\n\t\t\tkillTest(test.getUniqueId());\r\n\t\t}\r\n\t\tworkQueue.clear();\r\n\t\ttestCache.clear();\r\n\t}", "void stopGame() {\n leader.disconnect();\n opponent.disconnect();\n }", "public void unload() {\n plugin.getEngine().getWorldProvider().getHeartbeat().unsubscribe(WIND);\n plugin.getRootConfig().unsubscribe(TEMPERATURES);\n }", "void stopNodeAgentServices();", "private void shutdown()\n\t\t{\n\t\tif (myChannelGroup != null)\n\t\t\t{\n\t\t\tmyChannelGroup.close();\n\t\t\t}\n\t\tif (myHttpServer != null)\n\t\t\t{\n\t\t\ttry { myHttpServer.close(); } catch (IOException exc) {}\n\t\t\t}\n\t\tmyLog.log (\"Stopped\");\n\t\t}", "public void stop() {\n if (isStop.compareAndSet(false, true)) {\n if (bootstrap.config().group() != null) {\n Future future = bootstrap.config().group().shutdownGracefully();\n ((io.netty.util.concurrent.Future) future).syncUninterruptibly();\n }\n for (BrpcChannelGroup channelGroup : healthyInstances) {\n channelGroup.close();\n }\n for (BrpcChannelGroup channelGroup : unhealthyInstances) {\n channelGroup.close();\n }\n if (timeoutTimer != null) {\n timeoutTimer.stop();\n }\n if (namingService != null) {\n namingService.unsubscribe(subscribeInfo);\n }\n if (healthCheckTimer != null) {\n healthCheckTimer.stop();\n }\n if (loadBalanceStrategy != null) {\n loadBalanceStrategy.destroy();\n }\n if (callbackThread != null) {\n callbackThread.shutdown();\n }\n if (threadPool != null) {\n threadPool.stop();\n }\n }\n }", "public static void shutdownAll(){\n if(!dataNodeList.isEmpty()){\n for (Iterator iterator = dataNodeList.iterator(); iterator.hasNext();) {\n DataNode dataNode = (DataNode) iterator.next();\n dataNode.shutdown();\n }\n }\n }", "public void shutdown() {\n\t\tInput.cleanUp();\n\t\tVAO.cleanUp();\n\t\tTexture2D.cleanUp();\n\t\tResourceLoader.cleanUp();\n\t}", "public void removeAllAgents() {\n\t\tagents.clear();\n\t}", "public static void stopAllThreads() {\n SystemManager.getAllDistributors().forEach((d) -> {\n d.stopWork();\n });\n SystemManager.getAllUsers().forEach((u) -> {\n u.stopWork();\n });\n Time.stopWork();\n System.out.println(\"[Simulation is ending]\");\n stopWork = true;\n }", "public void clearAllConnections() {\r\n clearAllConnections(false);\r\n }", "public void shutDown();", "public void destroy(){\n\t\tMLog.log(\"destryoing peers\");\n\t\twhile(peers.size()>0){\n\t\t\tPeerInt p=peers.get(peers.size()-1);\n\t\t\tdestroy(p);\n\t\t}\n\t\t\n\t}", "private void reset() {\n\n\n spaceShips.clear();\n playerOne = null;\n playerTwo = null;\n friendlyBullets.clear();\n enemyBullets.clear();\n powerUps.clear();\n enemyGenerator.reset();\n difficulty.reset();\n Bullets.BulletType.resetSpeed();\n\n for (int i = 0; i < enemies.size(); i++) {\n enemies.get(i).getEnemyImage().delete();\n }\n enemies.clear();\n }", "public void KillWumpus() {\t\t\n\t\tliveWumpus = false;\n\t}", "public synchronized void shutDown() {\n\t state.shutDown();\n\t}", "public void shutdown() {\r\n System.exit(0);\r\n }", "void shutDown();", "public static void clearWinners(){winners.clear();}", "public synchronized void shutdown() {\n server.stop();\n }" ]
[ "0.65954435", "0.6505667", "0.63876814", "0.63800967", "0.6279772", "0.6270437", "0.6223515", "0.62069666", "0.61049294", "0.6099938", "0.6063899", "0.60287386", "0.60021156", "0.59954333", "0.5960201", "0.5930068", "0.5919716", "0.59098226", "0.58953744", "0.58864975", "0.5874485", "0.585218", "0.5839079", "0.58389", "0.5827104", "0.5816998", "0.5807906", "0.5756531", "0.5738778", "0.571871", "0.5712693", "0.57011837", "0.5699814", "0.56847614", "0.5681521", "0.5673396", "0.5663664", "0.5658545", "0.5657358", "0.5649383", "0.56360126", "0.561728", "0.5616532", "0.561426", "0.5609229", "0.5603884", "0.5598297", "0.5592631", "0.55874896", "0.5579268", "0.5575787", "0.5573794", "0.55723727", "0.5560247", "0.5560031", "0.5550844", "0.5540169", "0.5530446", "0.5521953", "0.5507036", "0.5506911", "0.5502939", "0.5500426", "0.5500305", "0.5496583", "0.5489745", "0.5488723", "0.54767954", "0.5472003", "0.5471861", "0.54691744", "0.5468355", "0.5462694", "0.5460734", "0.54526186", "0.54407287", "0.54342425", "0.5426723", "0.542063", "0.54172075", "0.5408351", "0.5402508", "0.54022866", "0.53977716", "0.53949076", "0.539385", "0.5392786", "0.53926444", "0.5389756", "0.538929", "0.5386636", "0.5380789", "0.53807336", "0.538019", "0.5379922", "0.53771394", "0.5375662", "0.5356426", "0.5355794", "0.5351688" ]
0.8182887
0
Shuts down (removes) all idle bots.
boolean shutdownIdleBots() { boolean allBotsIdle = true; LinkedList<String> names = new LinkedList<String>(); for( ChildBot c : m_botStable.values() ) { if( c != null ) { if( c.getBot().getSubspaceBot().isIdle() ) names.add( c.getBot().getBotName() ); else allBotsIdle = false; } } for( String name : names ) { removeBot( name, "idle bot shutdown" ); m_botAction.sendChatMessage( 1, name + " logged off. (Idle bot shutdown.)" ); } return allBotsIdle; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void shutdownAllBots() {\n LinkedList<String> names = new LinkedList<String>();\n\n for( ChildBot c : m_botStable.values() ) {\n if( c != null ) {\n names.add( c.getBot().getBotName() );\n }\n }\n\n for( String name : names ) {\n removeBot( name, \"core shutdown\" );\n m_botAction.sendChatMessage( 1, name + \" logged off. (Core shutdown.)\" );\n }\n\n m_botTypes.clear();\n }", "public void ShutDown()\n {\n bRunning = false;\n \n LaunchLog.Log(COMMS, LOG_NAME, \"Shut down instruction received...\");\n\n for(LaunchServerSession session : Sessions.values())\n {\n LaunchLog.Log(COMMS, LOG_NAME, \"Closing session...\");\n session.Close();\n }\n \n LaunchLog.Log(COMMS, LOG_NAME, \"...All sessions are closed.\");\n }", "protected void stopAll() {\n\t\tif (this.udpServer!=null)\n\t\t\tthis.udpServer.interrupt();\n\t\tif (this.connectionServer!=null)\n\t\t\tthis.connectionServer.interrupt();\n\t\tthis.connectionServer=null; // supprime le TCPServer et les Sockets associés\n\t\tthis.udpServer=null; // supprime l'UDPServer et les Sockets associés\n\t\tif (this.agent.getUserStatusManager()!=null)\n\t\t\tfor (String u : this.agent.getUserStatusManager().getActiveUsers())\n\t\t\t\tthis.removeSocket(u);; // interrompt tous les UserSockets\n\t\tthis.mapSockets.clear();\n\t}", "public void shutdown() {\n drivers.stream().filter(ClosingAwareWebDriver::isAlive)\n .forEach(ClosingAwareWebDriver::forceShutdown);\n }", "public static void shutDown(){\n for(int i = PS3_LIST_.size()-1; i >= 0; i--){\n PS3 instance = PS3_LIST_.get(i);\n instance.setLed(false);\n instance.destroy();\n }\n PS3Logger.log(PS3Logger.TYPE.DEBUG, null, \"PS3 SHUTDOWN\");\n }", "public void shutdown() {\n mGameHandler.shutdown();\n mTerminalNetwork.terminate();\n }", "public final void stopAll() {\n for (BotTaskInterface bt : TASKS) {\n LOG.info(\"Stoping BotTask {}\", bt.getName());\n bt.stop();\n }\n EXECUTOR_SERVICE.shutdown();\n }", "private void logout(){\n player.setName(\"(bot) \" + player.getName());\n botMode = true;\n System.out.println(\"bot made\");\n login = false;\n }", "private void shutdownThreads() {\n\t\tif (backupHeartbeatBroadcaster != null) {\n\t\t\tbackupHeartbeatBroadcaster.cancel();\n\t\t}\n\t\tif (activeHeartbeatTimer != null) {\n\t\t\tactiveHeartbeatTimer.cancel();\n\t\t}\n\t\tif (serverLatencyProcessorTimer != null) {\n\t\t\tserverLatencyProcessorTimer.cancel();\n\t\t}\n\t\tif (backupHeartbeatTimer != null) {\n\t\t\tbackupHeartbeatTimer.cancel();\n\t\t}\n\t\tif (reElectionTimer != null) {\n\t\t\treElectionTimer.cancel();\n\t\t}\n\t\tif (preElectionTimeoutTimer != null) {\n\t\t\tpreElectionTimeoutTimer.cancel();\n\t\t}\n\t}", "public void exitAllRooms() {\n\t\tfor (RoomSetting roomSetting : roomSettings) {\n\t\t\troomSetting.getRoom().removeClient(this);\n\t\t}\n\t\troomSettings.clear();\n\t}", "public void shutdown() {\n logger.info(\"Shutting down modules.\");\n for (Module module : modules) {\n module.stop();\n }\n logger.info(\"Shutting down reporters.\");\n for (Reporter reporter : reporters.values()) {\n reporter.stop();\n }\n }", "public void shutdown() {\n\t\t//We call peers.values() and put into Array to create an unchanging copy, one that\n\t\t//does not shrink even as the sockets remove themselves from the peers list\n\t\t//this prevents a ConcurrentModificationException\n\t\tonline = false;\n\t\tArrayList<DecentSocket> connections = new ArrayList<DecentSocket>(peers.values());\n\t\tfor(DecentSocket socket: connections) {\n\t\t\tsocket.stop();\n\t\t}\n\t\tlistener.stop();\n\t\tchecker.stop();\n\t}", "public void goAway() {\n Enumeration<ChatClientRoom> cc = clientSessionList.elements();\n while (cc.hasMoreElements()) {\n ChatClientRoom ccr = cc.nextElement();\n ccr.goAway();\n }\n this.dispose();\n try {\n rpc.disconnect();\n } catch (Exception e) {\n System.err.println(\"ChatClientLogin could not disconnect from GMI\");\n }\n System.exit(0);\n }", "public void shutDown() {\n isStarted = false;\n logger.info(\"[GAME] shut down\");\n }", "public void removeAgents() {\n\t\tfor (TestLiveAgent agent : agents.values()) {\n\t\t\tagent.stop();\n\t\t}\n\t\tagents.clear();\n\t}", "public void cleanToAll() {\n\t\tfor(ClientThread player: players) {\n\t\t\tplayer.send(new Package(\"CLEAN\",null));\n\t\t}\n\t}", "private void shutDown() {\r\n\t\t\r\n\t\t// send shutdown to children\r\n\t\tlogger.debug(\"BagCheck \"+ this.lineNumber+\" has sent an EndOfDay message to it's Security.\");\r\n\t\tthis.securityActor.tell(new EndOfDay(1));\r\n\r\n\t\t// clear all references\r\n\t\tthis.securityActor = null;\r\n\t}", "public void closeIdleConnections()\n {\n \n }", "public void shutdown() {\n \t\tfor(Expirator e : expirators) {\n\t\t\te.shutdown();\n \t\t}\n \t\texpirators.clear();\n \t}", "public synchronized void shutDown() {\n\t state.shutDown();\n\t}", "public void unload() {\n plugin.getEngine().getWorldProvider().getHeartbeat().unsubscribe(WIND);\n plugin.getRootConfig().unsubscribe(TEMPERATURES);\n }", "public void shutdown() {\n for (Entry<String,Session> entry : _sessions.entrySet())\n entry.getValue().disconnect();\n \n writeLine(\"\\nDebugServer shutting down.\");\n close();\n }", "public void closeAllSessions() {\n\n // don't disconnect system user; need it to save database\n Session[] sessions = getAllSessions();\n\n for (int i = 0; i < sessions.length; i++) {\n sessions[i].close();\n }\n\n synchronized(this) {\n sessionMap.clear();\n }\n }", "public void shutdownAll() {\n System.out.println(\"Shutting down network, received halt command!\");\n _poolData.shutdown();\n }", "@Override\r\n\tpublic void shutDown() {\r\n\t\tdown.set(true);\r\n\t\tif (shutDownImmediatelly) {\r\n\t\t\ttry {\r\n\t\t\t\tsuper.shutDown();\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tThread thread = new Thread(new Runnable() {\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void run() {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tSessionForUI.super.shutDown();\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tthread.setDaemon(true);\r\n\t\t\tthread.start();\r\n\t\t}\r\n\t}", "public void destroy() throws IOException, InterruptedException {\n LOGGER.info(\"Trading bot shutting down, will first cancel all open orders\");\n this.sessionHandler.onShutDown(this.session);\n }", "void killAllApps();", "public void shutDown()\n {\n stunStack.removeSocket(serverAddress);\n messageSequence.removeAllElements();\n localSocket.close();\n }", "public void shutdown() {\n for (Connection connection : connections) { //Try closing all connections\n closeConnection(connection);\n }\n }", "public void shutdown() {\n for (TServer server : thriftServers) {\n server.stop();\n }\n try {\n zookeeper.shutdown();\n discovery.close();\n } catch (IOException ex) {\n //don't care\n }\n }", "private static void shutdown() {\n\t\tSystem.out.println(\"Shutting down ...\");\n\t\tpool.shutdown();\n\t\tfor (Client client : clientMap.values()) {\n\t\t\tclient.cleanup();\n\t\t}\n\n\t\t// wait until all threads complete\n\t\ttry {\n\t\t\tif (!pool.awaitTermination(30, TimeUnit.SECONDS)) {\n\t\t\t\tSystem.out.println(\"Force shutdown after 30 seconds ...\");\n\t\t\t\tpool.shutdownNow();\n\t\t\t\tif (!pool.awaitTermination(30, TimeUnit.SECONDS)) {\n\t\t\t\t\tSystem.out.println(\"Terminate the process.\");\n\t\t\t\t\tThread.currentThread().interrupt();\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (InterruptedException e) {\n\t\t\tThread.currentThread().interrupt();\n\t\t}\n\t}", "public void clearDownLanes() {\r\n\t\tdownLanes = null;\r\n\t}", "public synchronized void shutDown() {\n if (this.wakeLock != null) {\n /* Wakelock are ref counted by default. We disable this feature here to ensure that\n * the power lock is released upon shutdown.\n */ \n wakeLock.setReferenceCounted(false);\n wakeLock.release();\n }\n context.unregisterReceiver(broadcastReceiver);\n releaseGlobalContext();\n }", "public void closeAllBrowsers() {\n\n driver.quit();\n\n\n }", "@VisibleForTesting\n void killIoThreads() {\n ioThreadPool.shutdownNow();\n }", "public void shutdown() {\n\t\tfinal List<Runnable> tasks = updater.shutdownNow();\n\t\tif (null == tasks) return;\n\t\tfor (final Runnable t : tasks)\n\t\t\tt.run();\n\t}", "public void shutDown() {\n isShutdown = true;\n eventLoopGroup.shutdownGracefully().awaitUninterruptibly();\n timer.stop();\n }", "public static void disconnect() {\r\n if (isConnected()) {\r\n listener.interrupt();\r\n timerThread.interrupt();\r\n keepAliveThread.interrupt();\r\n db.writeDatabase();\r\n ObjectIO.writeObjectToFile(cmdPath, cmd);\r\n tc.stopCommands();\r\n ObjectIO.writeObjectToFile(tcPath, tc);\r\n try {\r\n irc.close();\r\n }\r\n catch (IOException e) { /* Shouldn't happen */ }\r\n }\r\n irc = null;\r\n }", "public void shutdown(PircBotX bot) {\n\t\tList<ManagedFutureTask> remainingTasks;\n\t\tsynchronized (runningListeners) {\n\t\t\tremainingTasks = Lists.newArrayList(runningListeners.get(bot));\n\t\t}\n\n\t\t//Wait for all remaining tasks to return\n\t\tfor (ManagedFutureTask curFuture : remainingTasks)\n\t\t\ttry {\n\t\t\t\tlog.debug(\"Waiting for listener \" + curFuture.getListener() + \" to execute event \" + curFuture.getEvent());\n\t\t\t\tcurFuture.get();\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new RuntimeException(\"Cannot shutdown listener \" + curFuture.getListener() + \" executing event \" + curFuture.getEvent(), e);\n\t\t\t}\n\t}", "public void shutDown();", "private void setAutoSelfDestruct() {\n \n try{\n //Sets task to shut server down \n this.timer.schedule(new TimerTask() {\n @Override\n public void run() {\n if(clientHandlers.isEmpty()){\n System.err.println(\"Closing due to inactivity\");\n System.exit(0);\n }else{\n setAutoSelfDestruct();\n }\n }\n }, (60000*3));\n }catch( IllegalStateException e){\n System.err.println(\"Timer is being reset\");\n this.timer = new Timer();\n setAutoSelfDestruct();\n }\n }", "public void shutDown() {\n if(client != null) {\n client.shutdownClient();\n }\n }", "void shutDown();", "public void uninitialize()\n {\n System.out.println(\"Real time session unitializing...\");\n for (ChannelSession channelSession : channelSessions)\n {\n if (channelSession.channel() == null)\n {\n if (channelSession.channel() == null)\n {\n channelSession.uninit(error);\n System.exit(TransportReturnCodes.SUCCESS);\n }\n \n closeDictAndItemStreams();\n }\n closeDictAndItemStreams();\n }\n\n // flush before exiting\n flushChannel();\n\n closeChannel();\n }", "private void shutDown() {\n this.setState(State.SHUTTING);\n // clean all msg queues\n if (isRoot()) {\n System.out.println(String.format(\"%s: shutdown\", Thread.currentThread().getName()));\n Neighbor pseudoParent = null;\n ArrayList<Neighbor> children = node.getChildren();\n if (children.isEmpty()) {\n // shutDown fast\n } else {\n System.out.println(String.format(\"%s: looking for next root\", Thread.currentThread().getName()));\n for (Neighbor child : node.getChildren()) {\n try {\n child.sendMessage(\n new RootMessage(),\n child::detach\n ).get();\n pseudoParent = child;\n break;\n } catch (InterruptedException | CancellationException | ExecutionException e) {\n e.printStackTrace();\n System.err.println(Thread.currentThread().getName() + \": child not available\");\n }\n }\n\n if (pseudoParent != null) {\n System.out.println(String.format(\"%s: found next root\", Thread.currentThread().getName()));\n broadcastRejoin(pseudoParent);\n } else {\n // shutdown fast\n System.out.println(String.format(\"%s: didn't find next root\", Thread.currentThread().getName()));\n }\n }\n } else {\n try {\n Neighbor parent = node.parent;\n broadcastRejoin(parent);\n parent.sendMessage(new LeaveMessage(), this::detachParent).get();\n } catch (InterruptedException | ExecutionException e) {\n e.printStackTrace();\n }\n }\n setState(State.TERMINATED);\n }", "public synchronized void closeAllConnections() {\n\t\tstop();\n\t}", "public static void shutDownPlayer()\n {\n MusicPlayerControl.shutdown();\n JSoundsMainWindowViewController.listSongs=null;\n JSoundsMainWindowViewController.listSongs=new JMusicPlayerList();\n JSoundsMainWindowViewController.alreadyPlaying=false;\n JSoundsMainWindowViewController.dontInitPlayer=false;\n JSoundsMainWindowViewController.shutDown=true;\n }", "public void close() {\n socket.close();\n game.close();\n this.running = false;\n }", "public void shutDown()\n\t{\n\t\tthis.threadPool.shutdown();\n\t}", "public void shutdown() {\n shutdown(false);\n }", "public void forceShutdownAllGuilds() {\n synchronized (states) {\n List<MusicInterruptedGuild> toSave = new ArrayList<>(states.size());\n\n for (Map.Entry<Long, MusicState> entry : states.entrySet()) {\n long guildId = entry.getKey();\n\n MusicState state = entry.getValue();\n\n shutdownGuild(state);\n\n toSave.add(new MusicInterruptedGuild(guildId, state.getBoundChannelId(), state.getVoiceChannelId()));\n\n MUSIC_PLAYER_GAUGE.dec();\n }\n\n boolean res = this.interruptedGuildRepository.createAll(toSave);\n if (!res) {\n this.logger.log(0, \"Music leave: Failed to insert into interrupted guilds\");\n }\n\n states.clear();\n }\n }", "public void teardown() {\n for (App app : applications) {\n app.icon.setCallback(null);\n }\n\t}", "public void shutDown()\n {\n // Runtime.getRuntime().removeShutdownHook(shutdownListener);\n //shutdownListener.run();\n }", "protected void takeDown() {\n\t\t// Deregister from the yellow pages\n\t\ttry {\n\t\t\tDFService.deregister(this);\n\t\t}\n\t\tcatch (FIPAException fe) {\n\t\t\tfe.printStackTrace();\n\t\t}\n\t\t// Close the GUI\n\t\tmyGui.dispose();\n\t\t// Printout a dismissal message\n\t\tSystem.out.println(\"agent \"+getAID().getName()+\" terminating.\");\n\t}", "private void shutdown() {\n\t\ttry {\n\t\t\tsock.close();\n\t\t\tgame.handleExit(this);\n\t\t\tstopped = true;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}", "public void shutdown() {\n\t\tfor(Player player : new ArrayList<>(entries.keySet())) {\n\t\t\tonQuit(new PlayerQuitEvent(player, (Component) null, PlayerQuitEvent.QuitReason.DISCONNECTED));\n\t\t}\n\t}", "public void shutdown() {\n MultiThreadedHttpConnectionManager manager = \n (MultiThreadedHttpConnectionManager) httpClient.getHttpConnectionManager();\n manager.shutdown();\n }", "public void logoff() {\n CNHudsonUtil.logoff(this.cna);\n this.cna = null;\n }", "public void turnOff(){\n vendingMachine = null;\n Logger.getGlobal().log(Level.INFO,\" Turning Off...\");\n }", "public void reset() {\n cooldowns.clear();\n }", "public void KillWumpus() {\t\t\n\t\tliveWumpus = false;\n\t}", "public void shutdown() {\n fsManager.getOpenFileSystems().forEach(JGitFileSystem::close);\n shutdownSSH();\n forceStopDaemon();\n fsManager.clear();\n }", "public synchronized void shutdown()\n {\n Log.info( \"Shutting down. Unloading all loaded plugins...\" );\n\n // Stop the plugin monitoring service.\n pluginMonitor.stop();\n\n // Shutdown all loaded plugins.\n for ( Map.Entry<String, Plugin> plugin : pluginsLoaded.entrySet() )\n {\n try\n {\n plugin.getValue().destroyPlugin();\n Log.info( \"Unloaded plugin '{}'.\", plugin.getKey() );\n }\n catch ( Exception e )\n {\n Log.error( \"An exception occurred while trying to unload plugin '{}':\", plugin.getKey(), e );\n }\n }\n pluginsLoaded.clear();\n pluginDirs.clear();\n pluginMetadata.clear();\n classloaders.clear();\n childPluginMap.clear();\n failureToLoadCount.clear();\n }", "public static void cleanUpChannels() {\n for (ChatChannel channel : ChatManager.channels.values())\n if (channel.getLastActivity() + ChatManager.CHANNEL_LIFETIME < System.currentTimeMillis())\n ChatManager.channels.remove(channel.getName());\n\n }", "public void shutdown(){\n for(MessageHandler h : handlerMap.values()){\n h.shutdown();\n }\n }", "public static void stopEverything(){\r\n\t\tfor(final ExecutionHandler<?> execHandler:allThreads){\r\n\t\t\t//interrupt the stack execution, so that it wont be further executed \r\n\t\t\tstopExecutionHandler(execHandler);\r\n\t\t}\r\n\t\t//Now when all ExecutionHandlers should already be empty, but for sure - clear all global lists explicitly\r\n\t\tallThreads.clear(); \r\n\t\tallExecutablesInProcess.clear();\r\n\t\trootBlockToThread.clear();\r\n\t}", "public void stop() {\n\t\tserver.saveObjectToFile(offlineMessagesFileName, _offlineMessages);\n\t\tserver.saveObjectToFile(onlineClientsFileName, _onlineClients);\n\t\tserver.saveObjectToFile(clientFriendsFileName, _clientFriends);\n\t\t_offlineMessages.clear();\n\t\t_onlineClients.clear();\n\t\t_clientFriends.clear();\n\t\tserver.stop();\n\t}", "public void shutdown() {\n _udpServer.stop();\n _registrationTimer.cancel();\n _registrationTimer.purge();\n }", "private void tearEverythingDown() {\n\t\t// It doesn't do any harm if we call this method repeatedly - we only ever end up subscribing once.\n\t\tMultiLocationProvider.getInstance().addListener(this);\n\t}", "public static void shutdown() {\n\t\tgetSessionFactory().close();\n\t}", "public void shutdownAll() throws IOException {\n\t\tfor (int i = 0; i < this.size(); i++) {\n\t\t\tif (this.get(i).getClient() != null) {\n\t\t\t\tthis.get(i).sendOkay(\"SHUTDOWN\");\n\t\t\t}\n\t\t}\n\t}", "public static void logout() {\n try {\n buildSocket();\n ClientService.sendMessageToServer(connectionToServer, ClientService.logoutUser());\n closeSocket();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private void reset() {\n\n\n spaceShips.clear();\n playerOne = null;\n playerTwo = null;\n friendlyBullets.clear();\n enemyBullets.clear();\n powerUps.clear();\n enemyGenerator.reset();\n difficulty.reset();\n Bullets.BulletType.resetSpeed();\n\n for (int i = 0; i < enemies.size(); i++) {\n enemies.get(i).getEnemyImage().delete();\n }\n enemies.clear();\n }", "synchronized void close() {\n\n closeAllSessions();\n sysSession.close();\n sysLobSession.close();\n }", "public void teardown() {\n LOGGER.info(\"Shutting down driver\");\n driver.quit();\n }", "public static void teardown() {\n\t\tdriver.quit();\n\t}", "public void cancelAllClients(){\n clientsPool.shutdownNow();\n }", "public void shutDown() {\n collector.removePool(this);\n factory.poolClosing(this);\n\n // close all objects\n synchronized (objects) {\n for (Iterator it = objects.values().iterator(); it.hasNext();) {\n ObjectRecord rec = (ObjectRecord) it.next();\n if (null != rec) {\n if (rec.isInUse())\n factory.returnObject(rec.getClientObject());\n factory.deleteObject(rec.getObject());\n rec.close();\n }\n }\n objects.clear();\n deadObjects.clear();\n }//end of synch\n\n factory = null;\n poolName = null;\n initialized = false;\n }", "public void cleanShutDown () {\n shutdown = true;\n }", "public void stopServers() {\n EventHandlerService.INSTANCE.reset();\n UserRegistryService.INSTANCE.reset();\n\n if ( eventDispatcher != null ) {\n eventDispatcher.shutdown();\n }\n if ( userClientDispatcher != null ) {\n userClientDispatcher.shutdown();\n }\n if ( eventDispatcherThread != null ) {\n eventDispatcherThread.interrupt();\n }\n if ( userClientDispatcherThread != null ) {\n userClientDispatcherThread.interrupt();\n }\n }", "static synchronized void closeAll() {\n List<BlackLabEngine> copy = new ArrayList<>(engines);\n engines.clear();\n for (BlackLabEngine engine : copy) {\n engine.close();\n }\n }", "public static void shutdown()\n\t{\n\t\tinstance = null;\n\t}", "public void shutdownProcess() {\n Timer shutdownTimer = new Timer();\n TimerTask shutdownTask = new TimerTask() {\n @Override\n public void run() {\n finishShutdown();\n }\n };\n if (this.offlineButton.isSelected() == false) {\n this.online = false;\n this.statusLed.setStatus(\"warning\");\n this.setOutputPower(0);\n this.offlineButton.setSelected(true);\n }\n this.statusLed.setSlowBlink(true);\n this.offlineButton.setDisable(true);\n this.shutdownButton.setDisable(true);\n shutdownTimer.schedule(shutdownTask, 10000l);\n }", "public void deactivatePowerup()\r\n\t{\r\n\t\thasPowerup = false;\r\n\t\tcurrentPowerup = null;\r\n\t}", "public void shutdownNetwork() {\r\n networkPlayer.stop();\r\n }", "public void destroy(){\n\t\tIterator toolIterator = tools.iterator();\n\t\twhile(toolIterator.hasNext()){\n\t\t\tToolBridge tb = (ToolBridge) toolIterator.next();\n\t\t\ttb.terminate();\n\t\t}\n\n\t\tmultiplexingClientServer.stopRunning();\n\t}", "void exitSession()\n\t{\n\t\t// clear out our watchpoint list and displays\n\t\t// keep breakpoints around so that we can try to reapply them if we reconnect\n\t\tm_displays.clear();\n\t\tm_watchpoints.clear();\n\n\t\tif (m_fileInfo != null)\n\t\t\tm_fileInfo.unbind();\n\n\t\tif (m_session != null)\n\t\t\tm_session.terminate();\n\n\t\tm_session = null;\n\t\tm_fileInfo = null;\n\t}", "void stopGame() {\n leader.disconnect();\n opponent.disconnect();\n }", "public void freeAll()\n\t\t{\n\t\t\ts_cGameInstance = null; \n\t\t}", "public void cleanUp() {\n\t\tfor (int i = 0; i < 24; i++) {\r\n\t\t\tPlayerAssistant.itemOnInterface(c, 26099, i, -1, -1);\r\n\t\t}\r\n\t\tc.getPA().sendNewString(\"0\", 26013);\r\n\t}", "public void unhookLEDs() {\r\n\t\ttable.putBoolean(\"hooked\", false);\r\n\t\tleftOff();\r\n\t\trightOff();\r\n\t}", "public void shutDown() {\n System.out.println(\"Shutting down the zoo for the day...\\n\");\n for (int i = 0; i < zoo.length; i++){\n zoo[i].sleep();\n }\n System.out.println();\n System.out.println(\"That's all, thanks for coming!\");\n }", "void destroy() {\n \t\ttry {\r\n \t\t\tupKeep.stopRunning();\r\n \t\t} catch (InterruptedException e) {\r\n \t\t}\r\n \r\n \t\t// Kill all running processes.\r\n \t\tfor (MaximaProcess mp : pool) {\r\n \t\t\tmp.kill();\r\n \t\t}\r\n \t\tpool.clear();\r\n \r\n \t\t// Kill all used processes.\r\n \t\tfor (MaximaProcess mp : usedPool) {\r\n \t\t\tmp.kill();\r\n \t\t}\r\n \t\tusedPool.clear();\r\n \t}", "public void unregisterAll()\n {\n final Set<javax.servlet.Servlet> servlets = new HashSet<>(this.localServlets);\n for (final javax.servlet.Servlet servlet : servlets)\n {\n unregisterServlet(servlet);\n }\n }", "public void killAll() {\n for (Map.Entry<Integer, Enemy> entry :enemies.entrySet()) {\n if (!!!entry.getValue().isDead()) {\n entry.getValue().setHealth(0);\n }\n }\n }", "public void killAll() {\n distributors.forEach(Person::kill);\n distributors = new ArrayList<>();\n }", "void shutdown() {\n if (metricRegistry != null) {\n for (String metricName : gaugeMetricNames) {\n try {\n metricRegistry.remove(metricName);\n } catch (RuntimeException e) {\n // ignore\n }\n }\n }\n }", "public static void stopAllThreads() {\n SystemManager.getAllDistributors().forEach((d) -> {\n d.stopWork();\n });\n SystemManager.getAllUsers().forEach((u) -> {\n u.stopWork();\n });\n Time.stopWork();\n System.out.println(\"[Simulation is ending]\");\n stopWork = true;\n }", "public void logoutInactiveWorkers(){\n\t\tfor ( String workerId : loggedInWorkers){\n\t\t\tif( ! FirebaseService.isWorkerLoggedIn( workerId, this.getID()) ){\n\t\t\t\tthis.logoutWorker( workerId );\n\t\t\t}\n\t\t}\n\t}", "public void shutdown() {\n // For now, do nothing\n }" ]
[ "0.7806945", "0.67678726", "0.64651686", "0.63249767", "0.6322893", "0.6264588", "0.6200217", "0.6120975", "0.59848946", "0.5966605", "0.5948636", "0.5912749", "0.5898507", "0.5873065", "0.58707947", "0.5866721", "0.58559567", "0.5851815", "0.5831936", "0.5821976", "0.5813952", "0.58051544", "0.5784273", "0.5775373", "0.57633734", "0.5758956", "0.57585776", "0.575173", "0.5751069", "0.5745877", "0.574251", "0.5738293", "0.57291484", "0.5717408", "0.57040983", "0.5692939", "0.5690104", "0.56747824", "0.5669927", "0.5667153", "0.56580025", "0.56516325", "0.56418264", "0.5637882", "0.5634408", "0.563294", "0.5632374", "0.56292725", "0.5628224", "0.56253254", "0.5622428", "0.5621566", "0.561714", "0.5616417", "0.56135625", "0.56104624", "0.56086445", "0.56053835", "0.5600221", "0.5595206", "0.5592782", "0.55840415", "0.55811936", "0.5578255", "0.55676633", "0.55623126", "0.55544627", "0.55476135", "0.55468196", "0.5539413", "0.55291116", "0.55289346", "0.5515388", "0.55151016", "0.5508618", "0.5504433", "0.5500952", "0.54932404", "0.54929", "0.54845166", "0.54819566", "0.54805386", "0.54758185", "0.54706883", "0.54678994", "0.54673016", "0.5462512", "0.545666", "0.5450579", "0.54500675", "0.5443468", "0.54419166", "0.54416347", "0.5435995", "0.54351884", "0.5434183", "0.54308206", "0.54207844", "0.5418495", "0.54173154" ]
0.7169081
1